dsh-tool-protobuf: Read, inspect, and compare Protocol Buffers in DSH without protoc

Preface

When doing API or gRPC related development in DeepSeek Harness (DSH), the questions the agent often needs to answer are not “can this .proto compile”, but rather: what is declared in the file, what changed between two versions, whether a field number is still available, or whether anyone would reuse the number of a deleted field. Installing a protoc toolchain can answer compilation questions, but it is often too heavy for the reading and compatibility judgments above, and may not even be readily available in some environments.

Below is the community plugin dsh-tool-protobuf (maintainer yuehancn): it parses .proto syntax in-process, without depending on protoc, Python, or external network access, and exposes six dedicated tools to conversations for outline, description, diff, audit, and number queries.

What is this

dsh-tool-protobuf is a tool-type plugin in the DSH ecosystem (repo: yuehancn/dsh-tool-protobuf, directory page: SkillHub plugin page). The current package version is 0.1.0, license MIT, requiring DSH >=0.2.0-rc.2.

One-line positioning: read, audit, and compare Protocol Buffer definitions in conversations, without installing protoc. It does not generate code, produce descriptor sets, or do wire encoding; when real compilation is needed, protobuf_status can detect whether protoc is available locally, and then you can shell out yourself.

What questions each of the six tools answers

Tool Purpose
protobuf_status Whether protoc is available locally; what .proto files exist under workDir
protobuf_outline Single-file overview: syntax, package, imports, and the structure of various declarations
protobuf_describe A single message or service: field numbers, types, wire cost; RPC streaming shape and gRPC path
protobuf_diff Changes between two versions, classified as breaking / risky / additive
protobuf_audit Find problems that protoc might let pass, but that are easy to trip over in practice
protobuf_next_number Which field numbers are free in a message, or whether a specified number is safe

The plugin reads only one file at a time (protobuf_diff accepts two paths, not a whole tree). It does not resolve import chains: imports only report names; cross-file types are reported as unresolved rather than guessing types.

Why diff and audit deserve separate mention

protobuf_diff and wire compatibility

Protobuf wire data is keyed by field number, not by field name. Renaming while preserving the number is usually harmless; changing the name and number together causes old bytes to land on wrong fields. Deleting a field without reserving its number, then reusing it later, causes old data to be silently misread. Changing type at the same number (e.g. int32 → string) is equally dangerous.

protobuf_diff explicitly names and lists these cases, e.g. type-changed, number-reused, number-changed, field-removed (and distinguishes whether the number has been reserved), with actionable output rather than just “there are changes”.

protobuf_audit and compiler blind spots

protoc accepts many definitions that are syntactically legal but engineering-dangerous: duplicate field numbers, numbers falling in protobuf reserved ranges, illegal map key types, proto3 enums missing 0 values, etc. The audit also warns about holes below the high-watermark that are not reserved—when a field is deleted without leaving its number, the next edit can easily cause a compatibility incident; in large files, holes are summarized as a single finding to avoid flooding the output.

Installation and configuration

Installation

The method given in the official README is a local link (you need to put the plugin directory on your machine first, replacing the path with the actual location):

dsh plugin --profile <your-profile> link /path/to/dsh-tool-protobuf

Configure workDir

workDir is the boundary of allowed reads, not a hint. Configure it in the profile’s cordis.patch.yml, e.g.:

# in your profile's cordis.patch.yml
- id: tool-protobuf
  config:
    workDir: C:/work/my-service/proto

Path safety policy: the path passed by the caller only takes the last segment (filename); preceding segments are discarded, avoiding reading files outside workDir via .. or drive-letter combinations. Files exceeding 8 MB are refused for parsing.

Typical usage (conversation side)

After installing and configuring workDir, the agent can call the above tools in DSH conversations; no additional CLI is needed. A common flow can be:

  1. Use protobuf_status to confirm local protoc and the proto list in the directory.
  2. Use protobuf_outline / protobuf_describe to understand the existing schema.
  3. Before changing the schema, use protobuf_next_number to pick a number; after changing, use protobuf_diff on two file paths for a compatibility review.
  4. Before merging, run protobuf_audit on a single file.

The README gives output examples for protobuf_diff and protobuf_audit, which can serve as references for the expected format (including verdict: incompatible, breaking/risky/additive classification, and specific items).

Applicable scenarios and limitations

Suitable: proto reading, review, version diff, number and reserved rule checking in the DSH agent loop; the above work can still be done when there is no protoc on the machine.

Not suitable or worth knowing: no compilation, no codegen; no cross-file type resolution; the diff is between two files, not a directory diff. imports are only reported by name.

Security and trust: the plugin runs with the current DSH process permissions and can only read files within the scope allowed by the workDir policy. Before installing, it is recommended to read the GitHub source and the MIT license; the community directory SkillHub is an independent site, with no official affiliation with DeepSeek / High-Flyer.

The maintainer explains in the README: a hand-written parser is consistent with itself, so the test suite can use real protoc as a two-way oracle when PROTOC_PYTHON is set (with well-formed and deliberately-broken fixtures); when not set, oracle cases are skipped. This is irrelevant to daily use, but shows that the parsing behavior was once validated against an external compiler.

Summary

dsh-tool-protobuf collects the most common proto questions in Agent scenarios—reading structure, comparing versions, querying numbers, catching compatibility pitfalls—into six DSH tools, completing them in conversations without installing protoc. If your workflow centers on schema evolution, prioritize getting familiar with protobuf_diff and protobuf_audit.

  • Directory page: https://www.skillhub.cn/plugins/yuehancn/dsh-tool-protobuf
  • GitHub: https://github.com/yuehancn/dsh-tool-protobuf
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye