Commit b2e1e2d
committed
refactor(appkit): restructure supervisor-api adapter per PR databricks#345 review
Address structural feedback from Mario Cadenas' review of PR databricks#345 (sections
1-8). Stacked on top of the §9 defensive fixes commit.
API changes (BETA surface only):
- Add `DatabricksAdapter.fromSupervisorApi` static factory for discoverability
alongside `.fromChatCompletions`.
- Shrink `SupervisorApiAdapterOptions` to `{ model, workspaceClient? }`; tools
no longer live on the adapter.
- Hosted tools (`supervisorTools.*`) now return tagged `HostedSupervisorTool`
records and accept named options instead of positional args.
- Declare hosted tools on the agent's `tools` map (same place as function
tools / sub-agents); the agents plugin and `runAgent` route them to the
adapter via the new `AgentInput.extensions[SUPERVISOR_EXTENSION_KEY]`.
- Add capability-negotiation fields to `AgentAdapter`:
`acceptsExtensions?` + `consumesInputTools?`. The agents plugin and
`runAgent` warn at registration when adapter capabilities don't match
declared tools.
Internals:
- Extend `ResolvedToolEntry` / `StandaloneEntry` with a `hosted-supervisor`
branch; `classifyTool` matches it before MCP hosted-tool rejection so
standalone `runAgent` supports supervisor tools.
- Defense-in-depth: both indexers throw if a `hosted-supervisor` entry is
ever dispatched as a callable function.
- `DatabricksAdapter.fromSupervisorApi` uses a dynamic import to avoid
load-time cycles.
Docs:
- Rewrite supervisor-API section in docs/plugins/agents.md for the new shape.
- Add cross-adapter sub-agent composition note (one-directional: chat
parents can call supervisor children, not vice-versa, until SA's
function-call events are routed back through `context.executeTool`).
Playground:
- Update dev-playground supervisor agent to the new shape
(`DatabricksAdapter.fromSupervisorApi(...)` + tools on `createAgent`).
Tests:
- Rewrite supervisor-api.test.ts factory + adapter tests for the new shape.
- Add `isSupervisorTool` and `DatabricksAdapter.fromSupervisorApi` tests.
- New regression tests in `run-agent.test.ts` covering the
hosted-supervisor extension-routing path and both capability-mismatch
warnings.
- New agents-plugin tests covering the same warning paths and the new
`hosted-supervisor` tool-index branch.
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>1 parent 6ee2efb commit b2e1e2d
29 files changed
Lines changed: 2104 additions & 298 deletions
File tree
- apps/dev-playground/server
- docs/docs
- api/appkit
- plugins
- packages
- appkit/src
- agents
- tests
- core/agent
- tests
- plugins/agents
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments