@databricks/appkit-ui 0.47.1 → 0.49.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.
- package/CLAUDE.md +11 -1
- package/dist/cli/commands/lint.js +6 -0
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.js +3 -1
- package/dist/react/ui-variants/index.d.ts +2 -0
- package/dist/react/ui-variants/variant.d.ts +21 -0
- package/dist/react/ui-variants/variant.d.ts.map +1 -0
- package/dist/react/ui-variants/variant.js +15 -0
- package/dist/react/ui-variants/variant.js.map +1 -0
- package/dist/react/ui-variants/variants.d.ts +87 -0
- package/dist/react/ui-variants/variants.d.ts.map +1 -0
- package/dist/react/ui-variants/variants.js +199 -0
- package/dist/react/ui-variants/variants.js.map +1 -0
- package/dist/schemas/manifest.d.ts +1 -0
- package/dist/schemas/manifest.d.ts.map +1 -1
- package/dist/schemas/manifest.js +1 -0
- package/dist/schemas/manifest.js.map +1 -1
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/docs/api/appkit/Class.DatabricksAdapter.md +34 -0
- package/docs/api/appkit/Class.SupervisorApiAdapter.md +121 -0
- package/docs/api/appkit/Function.fromSupervisorApi.md +63 -0
- package/docs/api/appkit/Function.isSupervisorTool.md +18 -0
- package/docs/api/appkit/Interface.AgentAdapter.md +24 -0
- package/docs/api/appkit/Interface.AgentInput.md +13 -0
- package/docs/api/appkit/Interface.HostedSupervisorTool.md +21 -0
- package/docs/api/appkit/Interface.PluginManifest.md +27 -9
- package/docs/api/appkit/Interface.SupervisorApiAdapterOptions.md +38 -0
- package/docs/api/appkit/Interface.SupervisorExtension.md +12 -0
- package/docs/api/appkit/Interface.WorkspaceClientLike.md +67 -0
- package/docs/api/appkit/TypeAlias.AgentTool.md +3 -2
- package/docs/api/appkit/TypeAlias.ResolvedToolEntry.md +167 -0
- package/docs/api/appkit/TypeAlias.SupervisorTool.md +45 -0
- package/docs/api/appkit/Variable.SUPERVISOR_EXTENSION_KEY.md +8 -0
- package/docs/api/appkit/Variable.supervisorTools.md +176 -0
- package/docs/api/appkit.md +118 -108
- package/docs/plugins/agents.md +131 -1
- package/docs/plugins/manifest.md +12 -11
- package/llms.txt +11 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
- package/scripts/postinstall.js +0 -1
|
@@ -75,6 +75,24 @@ Omit.description
|
|
|
75
75
|
|
|
76
76
|
***
|
|
77
77
|
|
|
78
|
+
### devOnly?[](#devonly "Direct link to devOnly?")
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
optional devOnly: boolean;
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
When true, this plugin is only registered when NODE\_ENV === "development". In any other environment createApp skips it entirely (not constructed, no routes, resources not validated). Use for dev-only tooling that must never run in a deployed app.
|
|
86
|
+
|
|
87
|
+
#### Inherited from[](#inherited-from-2 "Direct link to Inherited from")
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
Omit.devOnly
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
***
|
|
95
|
+
|
|
78
96
|
### displayName[](#displayname "Direct link to displayName")
|
|
79
97
|
|
|
80
98
|
```ts
|
|
@@ -84,7 +102,7 @@ displayName: string;
|
|
|
84
102
|
|
|
85
103
|
Human-readable display name for UI and CLI
|
|
86
104
|
|
|
87
|
-
#### Inherited from[](#inherited-from-
|
|
105
|
+
#### Inherited from[](#inherited-from-3 "Direct link to Inherited from")
|
|
88
106
|
|
|
89
107
|
```ts
|
|
90
108
|
Omit.displayName
|
|
@@ -102,7 +120,7 @@ optional hidden: boolean;
|
|
|
102
120
|
|
|
103
121
|
When true, this plugin is excluded from the template plugins manifest (appkit.plugins.json) during sync.
|
|
104
122
|
|
|
105
|
-
#### Inherited from[](#inherited-from-
|
|
123
|
+
#### Inherited from[](#inherited-from-4 "Direct link to Inherited from")
|
|
106
124
|
|
|
107
125
|
```ts
|
|
108
126
|
Omit.hidden
|
|
@@ -120,7 +138,7 @@ optional keywords: string[];
|
|
|
120
138
|
|
|
121
139
|
Keywords for plugin discovery
|
|
122
140
|
|
|
123
|
-
#### Inherited from[](#inherited-from-
|
|
141
|
+
#### Inherited from[](#inherited-from-5 "Direct link to Inherited from")
|
|
124
142
|
|
|
125
143
|
```ts
|
|
126
144
|
Omit.keywords
|
|
@@ -138,7 +156,7 @@ optional license: string;
|
|
|
138
156
|
|
|
139
157
|
SPDX license identifier
|
|
140
158
|
|
|
141
|
-
#### Inherited from[](#inherited-from-
|
|
159
|
+
#### Inherited from[](#inherited-from-6 "Direct link to Inherited from")
|
|
142
160
|
|
|
143
161
|
```ts
|
|
144
162
|
Omit.license
|
|
@@ -174,7 +192,7 @@ optional onSetupMessage: string;
|
|
|
174
192
|
|
|
175
193
|
Message displayed to the user after project initialization. Use this to inform about manual setup steps (e.g. environment variables, resource provisioning).
|
|
176
194
|
|
|
177
|
-
#### Inherited from[](#inherited-from-
|
|
195
|
+
#### Inherited from[](#inherited-from-7 "Direct link to Inherited from")
|
|
178
196
|
|
|
179
197
|
```ts
|
|
180
198
|
Omit.onSetupMessage
|
|
@@ -192,7 +210,7 @@ optional repository: string;
|
|
|
192
210
|
|
|
193
211
|
URL to the plugin's source repository
|
|
194
212
|
|
|
195
|
-
#### Inherited from[](#inherited-from-
|
|
213
|
+
#### Inherited from[](#inherited-from-8 "Direct link to Inherited from")
|
|
196
214
|
|
|
197
215
|
```ts
|
|
198
216
|
Omit.repository
|
|
@@ -278,7 +296,7 @@ optional should: string[];
|
|
|
278
296
|
|
|
279
297
|
```
|
|
280
298
|
|
|
281
|
-
#### Inherited from[](#inherited-from-
|
|
299
|
+
#### Inherited from[](#inherited-from-9 "Direct link to Inherited from")
|
|
282
300
|
|
|
283
301
|
```ts
|
|
284
302
|
Omit.scaffolding
|
|
@@ -296,7 +314,7 @@ optional stability: "beta" | "ga";
|
|
|
296
314
|
|
|
297
315
|
Plugin stability level. Beta plugins may have breaking API changes between minor releases but are on a path to GA. GA (general availability) plugins follow semver strictly.
|
|
298
316
|
|
|
299
|
-
#### Inherited from[](#inherited-from-
|
|
317
|
+
#### Inherited from[](#inherited-from-10 "Direct link to Inherited from")
|
|
300
318
|
|
|
301
319
|
```ts
|
|
302
320
|
Omit.stability
|
|
@@ -314,7 +332,7 @@ optional version: string;
|
|
|
314
332
|
|
|
315
333
|
Plugin version (semver format)
|
|
316
334
|
|
|
317
|
-
#### Inherited from[](#inherited-from-
|
|
335
|
+
#### Inherited from[](#inherited-from-11 "Direct link to Inherited from")
|
|
318
336
|
|
|
319
337
|
```ts
|
|
320
338
|
Omit.version
|
|
@@ -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),
|
|
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.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Variable: supervisorTools
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const supervisorTools: {
|
|
5
|
+
app: (__namedParameters: {
|
|
6
|
+
description: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}) => HostedSupervisorTool;
|
|
9
|
+
genieSpace: (__namedParameters: {
|
|
10
|
+
description: string;
|
|
11
|
+
id: string;
|
|
12
|
+
}) => HostedSupervisorTool;
|
|
13
|
+
knowledgeAssistant: (__namedParameters: {
|
|
14
|
+
description: string;
|
|
15
|
+
knowledgeAssistantId: string;
|
|
16
|
+
}) => HostedSupervisorTool;
|
|
17
|
+
ucConnection: (__namedParameters: {
|
|
18
|
+
description: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}) => HostedSupervisorTool;
|
|
21
|
+
ucFunction: (__namedParameters: {
|
|
22
|
+
description: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}) => HostedSupervisorTool;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Concise factories for declaring Supervisor API tools.
|
|
30
|
+
|
|
31
|
+
Each factory accepts a single named-options object: routing-critical strings (`id`, `name`, `description`) get labels at the call site so "we swapped the args and didn't notice for two weeks" bugs are impossible.
|
|
32
|
+
|
|
33
|
+
`description` is required: SA's protobuf validation rejects `null`/`""`, AND the LLM running on SA reads this string to decide when to route to the tool. Two genie spaces both labelled "Genie space" give the model nothing to discriminate on, so callers always own the routing hint.
|
|
34
|
+
|
|
35
|
+
⚠ The `description` is read by the LLM at routing time — it is a prompt-injection sink. Do **not** derive it from untrusted input (user messages, request bodies, external systems). Treat it as application configuration. (CWE-1427)
|
|
36
|
+
|
|
37
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
38
|
+
|
|
39
|
+
### app()[](#app "Direct link to app()")
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
app: (__namedParameters: {
|
|
43
|
+
description: string;
|
|
44
|
+
name: string;
|
|
45
|
+
}) => HostedSupervisorTool;
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
50
|
+
|
|
51
|
+
| Parameter | Type |
|
|
52
|
+
| ------------------------------- | ---------------------------------------------- |
|
|
53
|
+
| `__namedParameters` | { `description`: `string`; `name`: `string`; } |
|
|
54
|
+
| `__namedParameters.description` | `string` |
|
|
55
|
+
| `__namedParameters.name` | `string` |
|
|
56
|
+
|
|
57
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
58
|
+
|
|
59
|
+
[`HostedSupervisorTool`](./docs/api/appkit/Interface.HostedSupervisorTool.md)
|
|
60
|
+
|
|
61
|
+
### genieSpace()[](#geniespace "Direct link to genieSpace()")
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
genieSpace: (__namedParameters: {
|
|
65
|
+
description: string;
|
|
66
|
+
id: string;
|
|
67
|
+
}) => HostedSupervisorTool;
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Parameters[](#parameters-1 "Direct link to Parameters")
|
|
72
|
+
|
|
73
|
+
| Parameter | Type |
|
|
74
|
+
| ------------------------------- | -------------------------------------------- |
|
|
75
|
+
| `__namedParameters` | { `description`: `string`; `id`: `string`; } |
|
|
76
|
+
| `__namedParameters.description` | `string` |
|
|
77
|
+
| `__namedParameters.id` | `string` |
|
|
78
|
+
|
|
79
|
+
#### Returns[](#returns-1 "Direct link to Returns")
|
|
80
|
+
|
|
81
|
+
[`HostedSupervisorTool`](./docs/api/appkit/Interface.HostedSupervisorTool.md)
|
|
82
|
+
|
|
83
|
+
### knowledgeAssistant()[](#knowledgeassistant "Direct link to knowledgeAssistant()")
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
knowledgeAssistant: (__namedParameters: {
|
|
87
|
+
description: string;
|
|
88
|
+
knowledgeAssistantId: string;
|
|
89
|
+
}) => HostedSupervisorTool;
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Parameters[](#parameters-2 "Direct link to Parameters")
|
|
94
|
+
|
|
95
|
+
| Parameter | Type |
|
|
96
|
+
| ---------------------------------------- | -------------------------------------------------------------- |
|
|
97
|
+
| `__namedParameters` | { `description`: `string`; `knowledgeAssistantId`: `string`; } |
|
|
98
|
+
| `__namedParameters.description` | `string` |
|
|
99
|
+
| `__namedParameters.knowledgeAssistantId` | `string` |
|
|
100
|
+
|
|
101
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
102
|
+
|
|
103
|
+
[`HostedSupervisorTool`](./docs/api/appkit/Interface.HostedSupervisorTool.md)
|
|
104
|
+
|
|
105
|
+
### ucConnection()[](#ucconnection "Direct link to ucConnection()")
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
ucConnection: (__namedParameters: {
|
|
109
|
+
description: string;
|
|
110
|
+
name: string;
|
|
111
|
+
}) => HostedSupervisorTool;
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Parameters[](#parameters-3 "Direct link to Parameters")
|
|
116
|
+
|
|
117
|
+
| Parameter | Type |
|
|
118
|
+
| ------------------------------- | ---------------------------------------------- |
|
|
119
|
+
| `__namedParameters` | { `description`: `string`; `name`: `string`; } |
|
|
120
|
+
| `__namedParameters.description` | `string` |
|
|
121
|
+
| `__namedParameters.name` | `string` |
|
|
122
|
+
|
|
123
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
124
|
+
|
|
125
|
+
[`HostedSupervisorTool`](./docs/api/appkit/Interface.HostedSupervisorTool.md)
|
|
126
|
+
|
|
127
|
+
### ucFunction()[](#ucfunction "Direct link to ucFunction()")
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
ucFunction: (__namedParameters: {
|
|
131
|
+
description: string;
|
|
132
|
+
name: string;
|
|
133
|
+
}) => HostedSupervisorTool;
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Parameters[](#parameters-4 "Direct link to Parameters")
|
|
138
|
+
|
|
139
|
+
| Parameter | Type |
|
|
140
|
+
| ------------------------------- | ---------------------------------------------- |
|
|
141
|
+
| `__namedParameters` | { `description`: `string`; `name`: `string`; } |
|
|
142
|
+
| `__namedParameters.description` | `string` |
|
|
143
|
+
| `__namedParameters.name` | `string` |
|
|
144
|
+
|
|
145
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
146
|
+
|
|
147
|
+
[`HostedSupervisorTool`](./docs/api/appkit/Interface.HostedSupervisorTool.md)
|
|
148
|
+
|
|
149
|
+
## Example[](#example "Direct link to Example")
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { createAgent } from "@databricks/appkit";
|
|
153
|
+
import {
|
|
154
|
+
agents,
|
|
155
|
+
DatabricksAdapter,
|
|
156
|
+
supervisorTools,
|
|
157
|
+
} from "@databricks/appkit/beta";
|
|
158
|
+
|
|
159
|
+
const assistant = createAgent({
|
|
160
|
+
instructions: "You are a helpful assistant.",
|
|
161
|
+
model: DatabricksAdapter.fromSupervisorApi({
|
|
162
|
+
model: "databricks-claude-sonnet-4",
|
|
163
|
+
}),
|
|
164
|
+
tools: () => ({
|
|
165
|
+
nyc: supervisorTools.genieSpace({
|
|
166
|
+
id: "01ABCDEF12345678",
|
|
167
|
+
description: "NYC taxi trip records and zones",
|
|
168
|
+
}),
|
|
169
|
+
add: supervisorTools.ucFunction({
|
|
170
|
+
name: "main.default.add",
|
|
171
|
+
description: "Adds two integers and returns the sum.",
|
|
172
|
+
}),
|
|
173
|
+
}),
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
```
|