feat(contracts): introduce proto contracts tree and wire.v1 envelope#287
Draft
keugenek wants to merge 1 commit intodatabricks:mainfrom
Draft
feat(contracts): introduce proto contracts tree and wire.v1 envelope#287keugenek wants to merge 1 commit intodatabricks:mainfrom
keugenek wants to merge 1 commit intodatabricks:mainfrom
Conversation
Adds `contracts/` at the repo root as the source of truth for the cross-component interface shapes described in the design doc. This PR ships the first slice (`appkit/v1/wire.proto`) and the build wiring needed for subsequent contracts to land without further monorepo changes. What's included - `contracts/buf.yaml` + `contracts/buf.gen.yaml` — buf module config and codegen pipeline using @bufbuild/protoc-gen-es (local, no remote plugin resolution). - `contracts/appkit/v1/wire.proto` — SseEnvelope, SseError, ResultFormat enum. Covers the SSE envelope, structured error frames, and SQL warehouse result-format negotiation. Route conventions, heartbeat/reconnect, and the `window.__appkit__` client-config payload are deferred to follow-up PRs. - `packages/contracts/` — new workspace package `@databricks/appkit-contracts`. Runs `buf generate` via `tools/generate-contracts.ts` and re-exports the typed bindings. Built with tsdown, follows existing `packages/shared/` conventions. - `packages/appkit/src/stream/types.ts` — imports the generated `SseEnvelope` and adds a compile-time compatibility anchor against the existing `BufferedEvent` shape. Non-breaking; `BufferedEvent` will retire in favour of the generated type in a follow-up. - Root `package.json` — `contracts:generate` and `contracts:lint` scripts. - `docs/docs/contracts.md` — short intro page linking back to the design doc and outlining the four planned follow-up contracts. Follow-ups tracked by the design doc - `appkit/v1/query.proto` — typed SQL query schemas (replaces the TS-only `QueryRegistry` augmentation). - `appkit/v1/plugin.proto` — plugin manifest (replaces the JSON Schema in `packages/shared/src/schemas/plugin-manifest.schema.json`). - `agenteval/v1/*.proto` — versioned eval framework to app protocol. - `appkit/v1/deploy.proto` — app manifest consumed by `databricks apps deploy`. Verification - `pnpm contracts:lint` — clean. - `pnpm contracts:generate` — produces `packages/contracts/src/generated/appkit/v1/wire_pb.ts`. - `pnpm -r typecheck` — all 8 workspace projects pass. - `pnpm build` — full monorepo build succeeds, `@databricks/appkit-contracts` emits dist/ via tsdown, publint clean. - `pnpm test` — 1564 tests pass (no new or changed tests in this PR). This PR and its description are AI-assisted by Isaac. Signed-off-by: Evgenii Kniazev <evgenii.kniazev@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
contracts/at the repo root as the source of truth for cross-componentinterface shapes described in the design doc.
This PR ships the first slice (
appkit/v1/wire.proto) and the build wiringneeded for subsequent contracts to land without further monorepo changes.
What's included
contracts/buf.yaml+contracts/buf.gen.yaml— buf module config and codegenpipeline using
@bufbuild/protoc-gen-es(local, no remote plugin resolution).contracts/appkit/v1/wire.proto—SseEnvelope,SseError,ResultFormatenum.Covers the SSE envelope, structured error frames, and SQL warehouse
result-format negotiation. Route conventions, heartbeat/reconnect semantics,
and the
window.__appkit__client-config payload are deferred to follow-ups.packages/contracts/— new workspace package@databricks/appkit-contracts.Runs
buf generateviatools/generate-contracts.tsand re-exports thetyped bindings. Built with tsdown; follows existing
packages/shared/conventions.
packages/appkit/src/stream/types.ts— imports the generatedSseEnvelopeand adds a compile-time compatibility anchor against the existing
BufferedEvent. Non-breaking;BufferedEventwill retire in favour of thegenerated type in a follow-up.
package.json—contracts:generateandcontracts:lintscripts.docs/docs/contracts.md— short intro page linking back to the design docand outlining the four planned follow-up contracts.
Interface design
Per the design doc, the contracts tree will cover five interfaces:
appkit/v1/wire.protopackages/appkit/src/stream/types.tsappkit/v1/query.protoQueryRegistryaugmentation from the type-generatorappkit/v1/plugin.protopackages/shared/src/schemas/plugin-manifest.schema.jsonagenteval/v1/*.protoappkit/v1/deploy.protoapp.yamlcontract with `databricks apps deploy`Consumers: the TS backend, future Python/Rust ports, the React SDK, the
`databricks` CLI, Claude Code scaffolding skills, and the agent-eval framework
all compile against the same generated bindings.
Verification
Test plan
Follow-ups
See design doc for the full five-contract plan. Next PRs:
This pull request and its description are AI-assisted by Isaac.