@databricks/appkit 0.48.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CLAUDE.md +11 -1
  2. package/dist/agents/databricks.d.ts +24 -7
  3. package/dist/agents/databricks.d.ts.map +1 -1
  4. package/dist/agents/databricks.js +25 -0
  5. package/dist/agents/databricks.js.map +1 -1
  6. package/dist/agents/supervisor-api.d.ts +362 -0
  7. package/dist/agents/supervisor-api.d.ts.map +1 -0
  8. package/dist/agents/supervisor-api.js +498 -0
  9. package/dist/agents/supervisor-api.js.map +1 -0
  10. package/dist/appkit/package.js +1 -1
  11. package/dist/beta.d.ts +2 -1
  12. package/dist/beta.js +2 -1
  13. package/dist/connectors/serving/client.d.ts +24 -0
  14. package/dist/connectors/serving/client.d.ts.map +1 -0
  15. package/dist/connectors/serving/client.js +34 -14
  16. package/dist/connectors/serving/client.js.map +1 -1
  17. package/dist/core/agent/run-agent.d.ts.map +1 -1
  18. package/dist/core/agent/run-agent.js +51 -2
  19. package/dist/core/agent/run-agent.js.map +1 -1
  20. package/dist/core/agent/types.d.ts +19 -3
  21. package/dist/core/agent/types.d.ts.map +1 -1
  22. package/dist/core/agent/types.js.map +1 -1
  23. package/dist/plugins/agents/agents.d.ts.map +1 -1
  24. package/dist/plugins/agents/agents.js +65 -5
  25. package/dist/plugins/agents/agents.js.map +1 -1
  26. package/dist/registry/manifest-loader.d.ts +1 -1
  27. package/dist/shared/src/agent.d.ts +28 -0
  28. package/dist/shared/src/agent.d.ts.map +1 -1
  29. package/dist/stream/index.js +1 -0
  30. package/dist/stream/sse-reader.js +86 -0
  31. package/dist/stream/sse-reader.js.map +1 -0
  32. package/docs/api/appkit/Class.DatabricksAdapter.md +34 -0
  33. package/docs/api/appkit/Class.SupervisorApiAdapter.md +121 -0
  34. package/docs/api/appkit/Function.fromSupervisorApi.md +63 -0
  35. package/docs/api/appkit/Function.isSupervisorTool.md +18 -0
  36. package/docs/api/appkit/Interface.AgentAdapter.md +24 -0
  37. package/docs/api/appkit/Interface.AgentInput.md +13 -0
  38. package/docs/api/appkit/Interface.HostedSupervisorTool.md +21 -0
  39. package/docs/api/appkit/Interface.SupervisorApiAdapterOptions.md +38 -0
  40. package/docs/api/appkit/Interface.SupervisorExtension.md +12 -0
  41. package/docs/api/appkit/Interface.WorkspaceClientLike.md +67 -0
  42. package/docs/api/appkit/TypeAlias.AgentTool.md +3 -2
  43. package/docs/api/appkit/TypeAlias.ResolvedToolEntry.md +167 -0
  44. package/docs/api/appkit/TypeAlias.SupervisorTool.md +45 -0
  45. package/docs/api/appkit/Variable.SUPERVISOR_EXTENSION_KEY.md +8 -0
  46. package/docs/api/appkit/Variable.supervisorTools.md +176 -0
  47. package/docs/api/appkit.md +118 -108
  48. package/docs/plugins/agents.md +136 -6
  49. package/llms.txt +11 -1
  50. package/package.json +1 -1
  51. package/sbom.cdx.json +1 -1
@@ -149,3 +149,37 @@ Routes through the shared `connectors/serving/stream` helper, which delegates to
149
149
  #### Returns[​](#returns-3 "Direct link to Returns")
150
150
 
151
151
  `Promise`<`DatabricksAdapter`>
152
+
153
+ ***
154
+
155
+ ### fromSupervisorApi()[​](#fromsupervisorapi "Direct link to fromSupervisorApi()")
156
+
157
+ ```ts
158
+ static fromSupervisorApi(options: SupervisorApiAdapterOptions): Promise<AgentAdapter>;
159
+
160
+ ```
161
+
162
+ Discoverability shim for the Supervisor API adapter. Returns an [AgentAdapter](./docs/api/appkit/Interface.AgentAdapter.md) (a `SupervisorApiAdapter` at runtime), NOT a DatabricksAdapter — the two are separate classes (different wire formats, different lifecycle). The return type is the [AgentAdapter](./docs/api/appkit/Interface.AgentAdapter.md) interface so callers aren't bound to the concrete class. Surfaced here so application developers see a single `DatabricksAdapter.from*` autocomplete root.
163
+
164
+ Dynamic-imports `./supervisor-api` to avoid forming a load-time cycle: both files share `connectors/serving/client.ts`.
165
+
166
+ #### Parameters[​](#parameters-4 "Direct link to Parameters")
167
+
168
+ | Parameter | Type |
169
+ | --------- | ------------------------------------------------------------------------------------------------- |
170
+ | `options` | [`SupervisorApiAdapterOptions`](./docs/api/appkit/Interface.SupervisorApiAdapterOptions.md) |
171
+
172
+ #### Returns[​](#returns-4 "Direct link to Returns")
173
+
174
+ `Promise`<[`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md)>
175
+
176
+ #### Example[​](#example-1 "Direct link to Example")
177
+
178
+ ```ts
179
+ import { DatabricksAdapter } from "@databricks/appkit/beta";
180
+
181
+ const model = await DatabricksAdapter.fromSupervisorApi({
182
+ model: "databricks-claude-sonnet-4-5",
183
+ });
184
+
185
+ ```
@@ -0,0 +1,121 @@
1
+ # Class: SupervisorApiAdapter
2
+
3
+ Adapter that calls the Databricks AI Gateway Responses API (`/ai-gateway/mlflow/v1/responses`).
4
+
5
+ Streams SSE events in the OpenAI Responses API wire format and maps them to the AppKit `AgentEvent` protocol. Tool execution is handled server-side, so the adapter ignores the agents-plugin tool index.
6
+
7
+ Authentication is handled via the Databricks SDK credential chain — the same mechanism used by `DatabricksAdapter.fromModelServing`. The transport is injected via SupervisorApiAdapterCtorOptions.streamBody; the [fromSupervisorApi](./docs/api/appkit/Function.fromSupervisorApi.md) factory wires it through the SDK's `apiClient.request({ raw: true })`.
8
+
9
+ Set `DEBUG=appkit:agents:supervisor-api` to log the outbound request shape (model, instructions length, input shape, tool count) and to be notified when the recovery path engages (no incremental deltas, text pulled from `response.completed.output[]`). The no-delta warning includes a per-turn event-type histogram and the SA-reported status/error/ incomplete\_details, so it's already actionable without DEBUG.
10
+
11
+ Tools are not configured on the adapter. Declare them via `createAgent({ tools: () => ({ key: supervisorTools.genieSpace({...}) }) })` (or markdown frontmatter referencing an ambient `supervisorTools.*` entry); the agents plugin / standalone `runAgent` aggregates hosted-supervisor entries and routes them to the adapter via `AgentInput.extensions[SUPERVISOR_EXTENSION_KEY]`. Advanced callers invoking `adapter.run(...)` directly populate that key themselves.
12
+
13
+ ## Example[​](#example "Direct link to Example")
14
+
15
+ ```ts
16
+ import { createApp, createAgent } from "@databricks/appkit";
17
+ import {
18
+ agents,
19
+ DatabricksAdapter,
20
+ supervisorTools,
21
+ } from "@databricks/appkit/beta";
22
+
23
+ await createApp({
24
+ plugins: [
25
+ agents({
26
+ agents: {
27
+ assistant: createAgent({
28
+ instructions: "You are a helpful assistant.",
29
+ model: DatabricksAdapter.fromSupervisorApi({
30
+ model: "databricks-claude-sonnet-4",
31
+ }),
32
+ tools: () => ({
33
+ nyc: supervisorTools.genieSpace({
34
+ id: "01ABCDEF12345678",
35
+ description: "NYC taxi trip records and zones",
36
+ }),
37
+ }),
38
+ }),
39
+ },
40
+ }),
41
+ ],
42
+ });
43
+
44
+ ```
45
+
46
+ ## Implements[​](#implements "Direct link to Implements")
47
+
48
+ * [`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md)
49
+
50
+ ## Constructors[​](#constructors "Direct link to Constructors")
51
+
52
+ ### Constructor[​](#constructor "Direct link to Constructor")
53
+
54
+ ```ts
55
+ new SupervisorApiAdapter(options: SupervisorApiAdapterCtorOptions): SupervisorApiAdapter;
56
+
57
+ ```
58
+
59
+ #### Parameters[​](#parameters "Direct link to Parameters")
60
+
61
+ | Parameter | Type |
62
+ | --------- | --------------------------------- |
63
+ | `options` | `SupervisorApiAdapterCtorOptions` |
64
+
65
+ #### Returns[​](#returns "Direct link to Returns")
66
+
67
+ `SupervisorApiAdapter`
68
+
69
+ ## Properties[​](#properties "Direct link to Properties")
70
+
71
+ ### acceptsExtensions[​](#acceptsextensions "Direct link to acceptsExtensions")
72
+
73
+ ```ts
74
+ readonly acceptsExtensions: readonly ["databricks.supervisor"];
75
+
76
+ ```
77
+
78
+ Capability negotiation: the adapter reads its hosted-tool payload from [AgentInput.extensions](./docs/api/appkit/Interface.AgentInput.md#extensions) under [SUPERVISOR\_EXTENSION\_KEY](./docs/api/appkit/Variable.SUPERVISOR_EXTENSION_KEY.md). The agents plugin uses this list to warn at registration when the tool index produces extensions the adapter wouldn't consume.
79
+
80
+ #### Implementation of[​](#implementation-of "Direct link to Implementation of")
81
+
82
+ [`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md).[`acceptsExtensions`](./docs/api/appkit/Interface.AgentAdapter.md#acceptsextensions)
83
+
84
+ ***
85
+
86
+ ### consumesInputTools[​](#consumesinputtools "Direct link to consumesInputTools")
87
+
88
+ ```ts
89
+ readonly consumesInputTools: false = false;
90
+
91
+ ```
92
+
93
+ Capability negotiation: the adapter does not consume `input.tools`. Tool execution is owned by the Databricks AI Gateway server-side, so any function tools or local sub-agents declared on this agent would be silently dropped — the agents plugin warns at registration when that combination is detected.
94
+
95
+ #### Implementation of[​](#implementation-of-1 "Direct link to Implementation of")
96
+
97
+ [`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md).[`consumesInputTools`](./docs/api/appkit/Interface.AgentAdapter.md#consumesinputtools)
98
+
99
+ ## Methods[​](#methods "Direct link to Methods")
100
+
101
+ ### run()[​](#run "Direct link to run()")
102
+
103
+ ```ts
104
+ run(input: AgentInput, context: AgentRunContext): AsyncGenerator<AgentEvent, void, unknown>;
105
+
106
+ ```
107
+
108
+ #### Parameters[​](#parameters-1 "Direct link to Parameters")
109
+
110
+ | Parameter | Type |
111
+ | --------- | ------------------------------------------------------------------------- |
112
+ | `input` | [`AgentInput`](./docs/api/appkit/Interface.AgentInput.md) |
113
+ | `context` | [`AgentRunContext`](./docs/api/appkit/Interface.AgentRunContext.md) |
114
+
115
+ #### Returns[​](#returns-1 "Direct link to Returns")
116
+
117
+ `AsyncGenerator`<[`AgentEvent`](./docs/api/appkit/TypeAlias.AgentEvent.md), `void`, `unknown`>
118
+
119
+ #### Implementation of[​](#implementation-of-2 "Direct link to Implementation of")
120
+
121
+ [`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md).[`run`](./docs/api/appkit/Interface.AgentAdapter.md#run)
@@ -0,0 +1,63 @@
1
+ # Function: fromSupervisorApi()
2
+
3
+ ```ts
4
+ function fromSupervisorApi(options: SupervisorApiAdapterOptions): Promise<AgentAdapter>;
5
+
6
+ ```
7
+
8
+ Creates an [AgentAdapter](./docs/api/appkit/Interface.AgentAdapter.md) backed by the Databricks AI Gateway Responses API (`/ai-gateway/mlflow/v1/responses`).
9
+
10
+ Uses the SDK's default credential chain for auth (reads DATABRICKS\_HOST, DATABRICKS\_TOKEN, OAuth config, etc.). Tools are declared on the agent (via `createAgent({ tools })`), not on this factory.
11
+
12
+ Application code should prefer the [DatabricksAdapter.fromSupervisorApi](./docs/api/appkit/Class.DatabricksAdapter.md#fromsupervisorapi) static — it delegates here and keeps a single `DatabricksAdapter.from*` autocomplete root for all Databricks-backed adapters. This free function is the implementation behind the static and remains exported for callers that want to import it directly without pulling in [DatabricksAdapter](./docs/api/appkit/Class.DatabricksAdapter.md).
13
+
14
+ ## Parameters[​](#parameters "Direct link to Parameters")
15
+
16
+ | Parameter | Type |
17
+ | --------- | ------------------------------------------------------------------------------------------------- |
18
+ | `options` | [`SupervisorApiAdapterOptions`](./docs/api/appkit/Interface.SupervisorApiAdapterOptions.md) |
19
+
20
+ ## Returns[​](#returns "Direct link to Returns")
21
+
22
+ `Promise`<[`AgentAdapter`](./docs/api/appkit/Interface.AgentAdapter.md)>
23
+
24
+ ## Example[​](#example "Direct link to Example")
25
+
26
+ ```ts
27
+ import { createApp, createAgent } from "@databricks/appkit";
28
+ import {
29
+ agents,
30
+ DatabricksAdapter,
31
+ supervisorTools,
32
+ } from "@databricks/appkit/beta";
33
+
34
+ await createApp({
35
+ plugins: [
36
+ agents({
37
+ agents: {
38
+ assistant: createAgent({
39
+ instructions: "You are a helpful assistant.",
40
+ model: DatabricksAdapter.fromSupervisorApi({
41
+ model: "databricks-claude-sonnet-4",
42
+ }),
43
+ tools: () => ({
44
+ nyc: supervisorTools.genieSpace({
45
+ id: "01ABCDEF12345678",
46
+ description: "NYC taxi trip records and zones",
47
+ }),
48
+ }),
49
+ }),
50
+ },
51
+ }),
52
+ ],
53
+ });
54
+
55
+ ```
56
+
57
+ ## Remarks[​](#remarks "Direct link to Remarks")
58
+
59
+ ⚠ When passing your own `workspaceClient`, see the warning on [SupervisorApiAdapterOptions.workspaceClient](./docs/api/appkit/Interface.SupervisorApiAdapterOptions.md#workspaceclient) — the client is captured once and reused, so per-request OBO clients would leak identity across requests.
60
+
61
+ ## See[​](#see "Direct link to See")
62
+
63
+ [DatabricksAdapter.fromSupervisorApi](./docs/api/appkit/Class.DatabricksAdapter.md#fromsupervisorapi) — the recommended application-facing entry point.
@@ -0,0 +1,18 @@
1
+ # Function: isSupervisorTool()
2
+
3
+ ```ts
4
+ function isSupervisorTool(value: unknown): value is HostedSupervisorTool;
5
+
6
+ ```
7
+
8
+ Type guard for [HostedSupervisorTool](./docs/api/appkit/Interface.HostedSupervisorTool.md). Used by the agents plugin (`buildToolIndex`) and standalone `runAgent` (`classifyTool`) to route supervisor-hosted tools to the extensions payload rather than the adapter's `tools` array.
9
+
10
+ ## Parameters[​](#parameters "Direct link to Parameters")
11
+
12
+ | Parameter | Type |
13
+ | --------- | --------- |
14
+ | `value` | `unknown` |
15
+
16
+ ## Returns[​](#returns "Direct link to Returns")
17
+
18
+ `value is HostedSupervisorTool`
@@ -1,5 +1,29 @@
1
1
  # Interface: AgentAdapter
2
2
 
3
+ ## Properties[​](#properties "Direct link to Properties")
4
+
5
+ ### acceptsExtensions?[​](#acceptsextensions "Direct link to acceptsExtensions?")
6
+
7
+ ```ts
8
+ readonly optional acceptsExtensions: readonly string[];
9
+
10
+ ```
11
+
12
+ Extension keys this adapter consumes from [AgentInput.extensions](./docs/api/appkit/Interface.AgentInput.md#extensions). The agents plugin (and standalone `runAgent`) warns at registration if the tool index produces extensions whose keys aren't listed here.
13
+
14
+ Adapters that don't read extensions can omit this field.
15
+
16
+ ***
17
+
18
+ ### consumesInputTools?[​](#consumesinputtools "Direct link to consumesInputTools?")
19
+
20
+ ```ts
21
+ readonly optional consumesInputTools: boolean;
22
+
23
+ ```
24
+
25
+ Whether the adapter consumes tools from `input.tools`. Defaults to true. Adapters whose tool execution happens elsewhere (e.g. the Supervisor API, where SA owns the tool loop server-side) declare false; the agents plugin warns at registration if the agent declares function tools or local sub-agents alongside such an adapter, since those tools would never reach the model.
26
+
3
27
  ## Methods[​](#methods "Direct link to Methods")
4
28
 
5
29
  ### run()[​](#run "Direct link to run()")
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Properties[​](#properties "Direct link to Properties")
4
4
 
5
+ ### extensions?[​](#extensions "Direct link to extensions?")
6
+
7
+ ```ts
8
+ optional extensions: Readonly<Record<string, unknown>>;
9
+
10
+ ```
11
+
12
+ Adapter-specific opaque payloads, keyed by adapter namespace. The shared contract intentionally does not enumerate keys — see each adapter's docs for which keys it reads and the shape of each value.
13
+
14
+ The agents plugin and standalone `runAgent` populate this from the agent's tool index when entries declare an adapter-side spec (e.g. Supervisor API hosted tools). Adapters that don't read extensions should leave it untouched.
15
+
16
+ ***
17
+
5
18
  ### messages[​](#messages "Direct link to messages")
6
19
 
7
20
  ```ts
@@ -0,0 +1,21 @@
1
+ # Interface: HostedSupervisorTool
2
+
3
+ Tagged record returned by every [supervisorTools](./docs/api/appkit/Variable.supervisorTools.md) factory. The `__kind` discriminator lets the agents plugin (and standalone `runAgent`) classify these tools without a structural match against the wire format — keeps the SA wire shape free to evolve and avoids namespace collisions with MCP hosted tools (which use `type: "genie-space"` hyphenated, vs SA's `type: "genie_space"` underscored).
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### \_\_kind[​](#__kind "Direct link to __kind")
8
+
9
+ ```ts
10
+ readonly __kind: "hosted-supervisor";
11
+
12
+ ```
13
+
14
+ ***
15
+
16
+ ### spec[​](#spec "Direct link to spec")
17
+
18
+ ```ts
19
+ readonly spec: SupervisorTool;
20
+
21
+ ```
@@ -0,0 +1,38 @@
1
+ # Interface: SupervisorApiAdapterOptions
2
+
3
+ ## Properties[​](#properties "Direct link to Properties")
4
+
5
+ ### model[​](#model "Direct link to model")
6
+
7
+ ```ts
8
+ model: string;
9
+
10
+ ```
11
+
12
+ Model identifier to pass in the request body (e.g. "databricks-claude-sonnet-4").
13
+
14
+ ***
15
+
16
+ ### timeoutMs?[​](#timeoutms "Direct link to timeoutMs?")
17
+
18
+ ```ts
19
+ optional timeoutMs: number;
20
+
21
+ ```
22
+
23
+ Total wall-clock budget (ms) for a single `run()`. When the SSE stream runs longer than this — e.g. an upstream that stalls without closing — the adapter aborts it and emits a terminal `transport` error rather than hanging the request indefinitely.
24
+
25
+ This is a total-duration cap, not an idle cap. Defaults to 5 minutes, generous enough for multi-tool server-side orchestration.
26
+
27
+ ***
28
+
29
+ ### workspaceClient?[​](#workspaceclient "Direct link to workspaceClient?")
30
+
31
+ ```ts
32
+ optional workspaceClient: WorkspaceClientLike;
33
+
34
+ ```
35
+
36
+ A WorkspaceClient (or structural equivalent) used for host resolution and per-request authentication. When omitted, a `WorkspaceClient({})` is created internally using the default SDK credential chain (`DATABRICKS_HOST`, OAuth, PAT, etc.).
37
+
38
+ ⚠ The `workspaceClient` is captured at construction and reused across every request. Passing a per-request OBO (On-Behalf-Of) client here would silently leak the first request's identity into all subsequent requests served by this adapter instance. Use the default credential chain or pass a service-principal client. (CWE-664)
@@ -0,0 +1,12 @@
1
+ # Interface: SupervisorExtension
2
+
3
+ Shape of the value at `AgentInput.extensions[SUPERVISOR_EXTENSION_KEY]`. The agents plugin / `runAgent` build this from the tool index; advanced callers invoking `adapter.run(...)` directly populate it themselves.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### hostedTools?[​](#hostedtools "Direct link to hostedTools?")
8
+
9
+ ```ts
10
+ optional hostedTools: SupervisorTool[];
11
+
12
+ ```
@@ -0,0 +1,67 @@
1
+ # Interface: WorkspaceClientLike
2
+
3
+ Structural shape of a Databricks SDK client used by [fromSupervisorApi](./docs/api/appkit/Function.fromSupervisorApi.md). Only what we need: `apiClient.request` for streaming and `config.ensureResolved` to materialise the host/credentials.
4
+
5
+ Exported because [SupervisorApiAdapterOptions.workspaceClient](./docs/api/appkit/Interface.SupervisorApiAdapterOptions.md#workspaceclient) (a public type) references it — callers passing their own client can name the shape they need to satisfy.
6
+
7
+ ## Extends[​](#extends "Direct link to Extends")
8
+
9
+ * `ApiClientLike`
10
+
11
+ ## Properties[​](#properties "Direct link to Properties")
12
+
13
+ ### apiClient[​](#apiclient "Direct link to apiClient")
14
+
15
+ ```ts
16
+ apiClient: {
17
+ request: Promise<unknown>;
18
+ };
19
+
20
+ ```
21
+
22
+ #### request()[​](#request "Direct link to request()")
23
+
24
+ ```ts
25
+ request(options: Record<string, unknown>, context?: unknown): Promise<unknown>;
26
+
27
+ ```
28
+
29
+ ##### Parameters[​](#parameters "Direct link to Parameters")
30
+
31
+ | Parameter | Type |
32
+ | ---------- | ----------------------------- |
33
+ | `options` | `Record`<`string`, `unknown`> |
34
+ | `context?` | `unknown` |
35
+
36
+ ##### Returns[​](#returns "Direct link to Returns")
37
+
38
+ `Promise`<`unknown`>
39
+
40
+ #### Inherited from[​](#inherited-from "Direct link to Inherited from")
41
+
42
+ ```ts
43
+ ApiClientLike.apiClient
44
+
45
+ ```
46
+
47
+ ***
48
+
49
+ ### config[​](#config "Direct link to config")
50
+
51
+ ```ts
52
+ config: {
53
+ ensureResolved: Promise<void>;
54
+ };
55
+
56
+ ```
57
+
58
+ #### ensureResolved()[​](#ensureresolved "Direct link to ensureResolved()")
59
+
60
+ ```ts
61
+ ensureResolved(): Promise<void>;
62
+
63
+ ```
64
+
65
+ ##### Returns[​](#returns-1 "Direct link to Returns")
66
+
67
+ `Promise`<`void`>
@@ -4,8 +4,9 @@
4
4
  type AgentTool =
5
5
  | FunctionTool
6
6
  | HostedTool
7
- | ToolkitEntry;
7
+ | ToolkitEntry
8
+ | HostedSupervisorTool;
8
9
 
9
10
  ```
10
11
 
11
- Any tool an agent can invoke: inline function tools (`tool()`), hosted MCP tools (`mcpServer()` / raw hosted), or toolkit references from plugins (`analytics().toolkit()`).
12
+ Any tool an agent can invoke: inline function tools (`tool()`), hosted MCP tools (`mcpServer()` / raw hosted), toolkit references from plugins (`analytics().toolkit()`), or adapter-hosted Supervisor-API tools (`supervisorTools.*`).
@@ -22,8 +22,175 @@ type ResolvedToolEntry =
22
22
  agentName: string;
23
23
  def: AgentToolDefinition;
24
24
  source: "subagent";
25
+ }
26
+ | {
27
+ def: AgentToolDefinition;
28
+ source: "hosted-supervisor";
29
+ spec: SupervisorTool;
25
30
  };
26
31
 
27
32
  ```
28
33
 
29
34
  Internal tool-index entry after a tool record has been resolved to a dispatchable form.
35
+
36
+ ## Type Declaration[​](#type-declaration "Direct link to Type Declaration")
37
+
38
+ ```ts
39
+ {
40
+ def: AgentToolDefinition;
41
+ localName: string;
42
+ pluginName: string;
43
+ source: "toolkit";
44
+ }
45
+
46
+ ```
47
+
48
+ ### def[​](#def "Direct link to def")
49
+
50
+ ```ts
51
+ def: AgentToolDefinition;
52
+
53
+ ```
54
+
55
+ ### localName[​](#localname "Direct link to localName")
56
+
57
+ ```ts
58
+ localName: string;
59
+
60
+ ```
61
+
62
+ ### pluginName[​](#pluginname "Direct link to pluginName")
63
+
64
+ ```ts
65
+ pluginName: string;
66
+
67
+ ```
68
+
69
+ ### source[​](#source "Direct link to source")
70
+
71
+ ```ts
72
+ source: "toolkit";
73
+
74
+ ```
75
+
76
+ ```ts
77
+ {
78
+ def: AgentToolDefinition;
79
+ functionTool: FunctionTool;
80
+ source: "function";
81
+ }
82
+
83
+ ```
84
+
85
+ ### def[​](#def-1 "Direct link to def")
86
+
87
+ ```ts
88
+ def: AgentToolDefinition;
89
+
90
+ ```
91
+
92
+ ### functionTool[​](#functiontool "Direct link to functionTool")
93
+
94
+ ```ts
95
+ functionTool: FunctionTool;
96
+
97
+ ```
98
+
99
+ ### source[​](#source-1 "Direct link to source")
100
+
101
+ ```ts
102
+ source: "function";
103
+
104
+ ```
105
+
106
+ ```ts
107
+ {
108
+ def: AgentToolDefinition;
109
+ mcpToolName: string;
110
+ source: "mcp";
111
+ }
112
+
113
+ ```
114
+
115
+ ### def[​](#def-2 "Direct link to def")
116
+
117
+ ```ts
118
+ def: AgentToolDefinition;
119
+
120
+ ```
121
+
122
+ ### mcpToolName[​](#mcptoolname "Direct link to mcpToolName")
123
+
124
+ ```ts
125
+ mcpToolName: string;
126
+
127
+ ```
128
+
129
+ ### source[​](#source-2 "Direct link to source")
130
+
131
+ ```ts
132
+ source: "mcp";
133
+
134
+ ```
135
+
136
+ ```ts
137
+ {
138
+ agentName: string;
139
+ def: AgentToolDefinition;
140
+ source: "subagent";
141
+ }
142
+
143
+ ```
144
+
145
+ ### agentName[​](#agentname "Direct link to agentName")
146
+
147
+ ```ts
148
+ agentName: string;
149
+
150
+ ```
151
+
152
+ ### def[​](#def-3 "Direct link to def")
153
+
154
+ ```ts
155
+ def: AgentToolDefinition;
156
+
157
+ ```
158
+
159
+ ### source[​](#source-3 "Direct link to source")
160
+
161
+ ```ts
162
+ source: "subagent";
163
+
164
+ ```
165
+
166
+ ```ts
167
+ {
168
+ def: AgentToolDefinition;
169
+ source: "hosted-supervisor";
170
+ spec: SupervisorTool;
171
+ }
172
+
173
+ ```
174
+
175
+ ### def[​](#def-4 "Direct link to def")
176
+
177
+ ```ts
178
+ def: AgentToolDefinition;
179
+
180
+ ```
181
+
182
+ ### source[​](#source-4 "Direct link to source")
183
+
184
+ ```ts
185
+ source: "hosted-supervisor";
186
+
187
+ ```
188
+
189
+ Adapter-side hosted tool (executed by the model-host, not by the Node process). Today: Supervisor API hosted tools (Genie spaces, UC functions, etc.). The `spec` is opaque to the agents plugin — it routes the entry into `AgentInput.extensions` for the adapter that declared the matching `acceptsExtensions` key. `def` is a synthetic placeholder kept so the index has a uniform shape; it is intentionally NOT included in the `tools` array passed to `adapter.run()` (those entries are not callable functions).
190
+
191
+ ### spec[​](#spec "Direct link to spec")
192
+
193
+ ```ts
194
+ spec: SupervisorTool;
195
+
196
+ ```
@@ -0,0 +1,45 @@
1
+ # Type Alias: SupervisorTool
2
+
3
+ ```ts
4
+ type SupervisorTool =
5
+ | {
6
+ genie_space: {
7
+ description: string;
8
+ id: string;
9
+ };
10
+ type: "genie_space";
11
+ }
12
+ | {
13
+ type: "uc_function";
14
+ uc_function: {
15
+ description: string;
16
+ name: string;
17
+ };
18
+ }
19
+ | {
20
+ knowledge_assistant: {
21
+ description: string;
22
+ knowledge_assistant_id: string;
23
+ };
24
+ type: "knowledge_assistant";
25
+ }
26
+ | {
27
+ app: {
28
+ description: string;
29
+ name: string;
30
+ };
31
+ type: "app";
32
+ }
33
+ | {
34
+ type: "uc_connection";
35
+ uc_connection: {
36
+ description: string;
37
+ name: string;
38
+ };
39
+ };
40
+
41
+ ```
42
+
43
+ Tools supported by the Databricks AI Gateway Responses API. The shapes match the wire format the endpoint expects, so the adapter passes the array straight into the request body.
44
+
45
+ This is an adapter-internal wire type. Application code authors tools via the [supervisorTools](./docs/api/appkit/Variable.supervisorTools.md) factories, which return tagged [HostedSupervisorTool](./docs/api/appkit/Interface.HostedSupervisorTool.md) records — the agents plugin then unwraps the `.spec` when routing through [AgentInput.extensions](./docs/api/appkit/Interface.AgentInput.md#extensions).
@@ -0,0 +1,8 @@
1
+ # Variable: SUPERVISOR\_EXTENSION\_KEY
2
+
3
+ ```ts
4
+ const SUPERVISOR_EXTENSION_KEY: "databricks.supervisor";
5
+
6
+ ```
7
+
8
+ Namespace key under which the adapter reads its hosted-tool payload from [AgentInput.extensions](./docs/api/appkit/Interface.AgentInput.md#extensions). Exported so the agents plugin and standalone `runAgent` (the producers) can write under the same key the adapter reads.