@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.
- package/CLAUDE.md +11 -1
- package/dist/agents/databricks.d.ts +24 -7
- package/dist/agents/databricks.d.ts.map +1 -1
- package/dist/agents/databricks.js +25 -0
- package/dist/agents/databricks.js.map +1 -1
- package/dist/agents/supervisor-api.d.ts +362 -0
- package/dist/agents/supervisor-api.d.ts.map +1 -0
- package/dist/agents/supervisor-api.js +498 -0
- package/dist/agents/supervisor-api.js.map +1 -0
- package/dist/appkit/package.js +1 -1
- package/dist/beta.d.ts +2 -1
- package/dist/beta.js +2 -1
- package/dist/connectors/serving/client.d.ts +24 -0
- package/dist/connectors/serving/client.d.ts.map +1 -0
- package/dist/connectors/serving/client.js +34 -14
- package/dist/connectors/serving/client.js.map +1 -1
- package/dist/core/agent/run-agent.d.ts.map +1 -1
- package/dist/core/agent/run-agent.js +51 -2
- package/dist/core/agent/run-agent.js.map +1 -1
- package/dist/core/agent/types.d.ts +19 -3
- package/dist/core/agent/types.d.ts.map +1 -1
- package/dist/core/agent/types.js.map +1 -1
- package/dist/plugins/agents/agents.d.ts.map +1 -1
- package/dist/plugins/agents/agents.js +65 -5
- package/dist/plugins/agents/agents.js.map +1 -1
- package/dist/registry/manifest-loader.d.ts +1 -1
- package/dist/shared/src/agent.d.ts +28 -0
- package/dist/shared/src/agent.d.ts.map +1 -1
- package/dist/stream/index.js +1 -0
- package/dist/stream/sse-reader.js +86 -0
- package/dist/stream/sse-reader.js.map +1 -0
- 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.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 +136 -6
- package/llms.txt +11 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -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
|
+
```
|