@databricks/appkit-ui 0.32.0 → 0.34.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 (87) hide show
  1. package/CLAUDE.md +53 -1
  2. package/NOTICE.md +1 -0
  3. package/dist/js/index.js +1 -0
  4. package/dist/react/hooks/index.d.ts +1 -0
  5. package/dist/react/hooks/index.js +1 -0
  6. package/dist/react/hooks/types.d.ts +11 -5
  7. package/dist/react/hooks/types.d.ts.map +1 -1
  8. package/dist/react/hooks/use-agent-chat.d.ts +128 -0
  9. package/dist/react/hooks/use-agent-chat.d.ts.map +1 -0
  10. package/dist/react/hooks/use-agent-chat.js +133 -0
  11. package/dist/react/hooks/use-agent-chat.js.map +1 -0
  12. package/dist/react/hooks/use-analytics-query.d.ts +4 -4
  13. package/dist/react/hooks/use-analytics-query.d.ts.map +1 -1
  14. package/dist/react/hooks/use-analytics-query.js +4 -4
  15. package/dist/react/hooks/use-analytics-query.js.map +1 -1
  16. package/dist/react/hooks/use-chart-data.js +9 -9
  17. package/dist/react/hooks/use-chart-data.js.map +1 -1
  18. package/dist/react/index.d.ts +2 -1
  19. package/dist/react/index.js +2 -1
  20. package/dist/shared/src/index.js +2 -0
  21. package/dist/shared/src/sql/helpers.d.ts +113 -8
  22. package/dist/shared/src/sql/helpers.d.ts.map +1 -1
  23. package/dist/shared/src/sql/helpers.js +116 -7
  24. package/dist/shared/src/sql/helpers.js.map +1 -1
  25. package/dist/shared/src/sql/index.js +1 -0
  26. package/dist/shared/src/sql/types.d.ts +16 -2
  27. package/dist/shared/src/sql/types.d.ts.map +1 -1
  28. package/docs/api/appkit/Class.AppKitMcpClient.md +157 -0
  29. package/docs/api/appkit/Class.DatabricksAdapter.md +151 -0
  30. package/docs/api/appkit/Function.agentIdFromMarkdownPath.md +18 -0
  31. package/docs/api/appkit/Function.createAgent.md +33 -0
  32. package/docs/api/appkit/Function.defineTool.md +26 -0
  33. package/docs/api/appkit/Function.executeFromRegistry.md +25 -0
  34. package/docs/api/appkit/Function.functionToolToDefinition.md +16 -0
  35. package/docs/api/appkit/Function.isFunctionTool.md +16 -0
  36. package/docs/api/appkit/Function.isHostedTool.md +16 -0
  37. package/docs/api/appkit/Function.isToolkitEntry.md +18 -0
  38. package/docs/api/appkit/Function.loadAgentFromFile.md +21 -0
  39. package/docs/api/appkit/Function.loadAgentsFromDir.md +26 -0
  40. package/docs/api/appkit/Function.mcpServer.md +28 -0
  41. package/docs/api/appkit/Function.parseTextToolCalls.md +26 -0
  42. package/docs/api/appkit/Function.resolveHostedTools.md +16 -0
  43. package/docs/api/appkit/Function.runAgent.md +26 -0
  44. package/docs/api/appkit/Function.tool.md +28 -0
  45. package/docs/api/appkit/Function.toolsFromRegistry.md +20 -0
  46. package/docs/api/appkit/Interface.AgentAdapter.md +21 -0
  47. package/docs/api/appkit/Interface.AgentDefinition.md +112 -0
  48. package/docs/api/appkit/Interface.AgentInput.md +37 -0
  49. package/docs/api/appkit/Interface.AgentRunContext.md +32 -0
  50. package/docs/api/appkit/Interface.AgentToolDefinition.md +37 -0
  51. package/docs/api/appkit/Interface.AgentsPluginConfig.md +241 -0
  52. package/docs/api/appkit/Interface.AutoInheritToolsConfig.md +27 -0
  53. package/docs/api/appkit/Interface.BasePluginConfig.md +1 -0
  54. package/docs/api/appkit/Interface.FunctionTool.md +80 -0
  55. package/docs/api/appkit/Interface.McpConnectAllResult.md +38 -0
  56. package/docs/api/appkit/Interface.Message.md +55 -0
  57. package/docs/api/appkit/Interface.PluginToolkitProvider.md +22 -0
  58. package/docs/api/appkit/Interface.PromptContext.md +30 -0
  59. package/docs/api/appkit/Interface.RegisteredAgent.md +75 -0
  60. package/docs/api/appkit/Interface.RunAgentInput.md +34 -0
  61. package/docs/api/appkit/Interface.RunAgentResult.md +23 -0
  62. package/docs/api/appkit/Interface.Thread.md +46 -0
  63. package/docs/api/appkit/Interface.ThreadStore.md +103 -0
  64. package/docs/api/appkit/Interface.ToolAnnotations.md +56 -0
  65. package/docs/api/appkit/Interface.ToolConfig.md +72 -0
  66. package/docs/api/appkit/Interface.ToolEntry.md +73 -0
  67. package/docs/api/appkit/Interface.ToolProvider.md +38 -0
  68. package/docs/api/appkit/Interface.ToolkitEntry.md +59 -0
  69. package/docs/api/appkit/Interface.ToolkitOptions.md +45 -0
  70. package/docs/api/appkit/TypeAlias.AgentEvent.md +299 -0
  71. package/docs/api/appkit/TypeAlias.AgentTool.md +11 -0
  72. package/docs/api/appkit/TypeAlias.AgentTools.md +8 -0
  73. package/docs/api/appkit/TypeAlias.AgentToolsFn.md +20 -0
  74. package/docs/api/appkit/TypeAlias.BaseSystemPromptOption.md +9 -0
  75. package/docs/api/appkit/TypeAlias.HostedTool.md +10 -0
  76. package/docs/api/appkit/TypeAlias.Plugins.md +26 -0
  77. package/docs/api/appkit/TypeAlias.ResolvedToolEntry.md +29 -0
  78. package/docs/api/appkit/TypeAlias.ToolRegistry.md +6 -0
  79. package/docs/api/appkit/Variable.agents.md +19 -0
  80. package/docs/api/appkit/Variable.sql.md +203 -21
  81. package/docs/api/appkit.md +113 -62
  82. package/docs/app-management.md +2 -2
  83. package/docs/plugins/agents.md +441 -0
  84. package/docs/plugins/analytics.md +7 -2
  85. package/llms.txt +53 -1
  86. package/package.json +1 -1
  87. package/sbom.cdx.json +1 -1
@@ -0,0 +1,45 @@
1
+ # Interface: ToolkitOptions
2
+
3
+ ## Properties[​](#properties "Direct link to Properties")
4
+
5
+ ### except?[​](#except "Direct link to except?")
6
+
7
+ ```ts
8
+ optional except: string[];
9
+
10
+ ```
11
+
12
+ Exclude tools whose local name matches one of these.
13
+
14
+ ***
15
+
16
+ ### only?[​](#only "Direct link to only?")
17
+
18
+ ```ts
19
+ optional only: string[];
20
+
21
+ ```
22
+
23
+ Only include tools whose local name matches one of these.
24
+
25
+ ***
26
+
27
+ ### prefix?[​](#prefix "Direct link to prefix?")
28
+
29
+ ```ts
30
+ optional prefix: string;
31
+
32
+ ```
33
+
34
+ Key prefix to prepend to each tool's local name. Defaults to `${pluginName}.`.
35
+
36
+ ***
37
+
38
+ ### rename?[​](#rename "Direct link to rename?")
39
+
40
+ ```ts
41
+ optional rename: Record<string, string>;
42
+
43
+ ```
44
+
45
+ Remap specific local names to different keys (applied after prefix).
@@ -0,0 +1,299 @@
1
+ # Type Alias: AgentEvent
2
+
3
+ ```ts
4
+ type AgentEvent =
5
+ | {
6
+ content: string;
7
+ type: "message_delta";
8
+ }
9
+ | {
10
+ content: string;
11
+ type: "message";
12
+ }
13
+ | {
14
+ args: unknown;
15
+ callId: string;
16
+ name: string;
17
+ type: "tool_call";
18
+ }
19
+ | {
20
+ callId: string;
21
+ error?: string;
22
+ result: unknown;
23
+ type: "tool_result";
24
+ }
25
+ | {
26
+ content: string;
27
+ type: "thinking";
28
+ }
29
+ | {
30
+ error?: string;
31
+ status: "running" | "waiting" | "complete" | "error";
32
+ type: "status";
33
+ }
34
+ | {
35
+ data: Record<string, unknown>;
36
+ type: "metadata";
37
+ }
38
+ | {
39
+ annotations?: ToolAnnotations;
40
+ approvalId: string;
41
+ args: unknown;
42
+ streamId: string;
43
+ toolName: string;
44
+ type: "approval_pending";
45
+ };
46
+
47
+ ```
48
+
49
+ ## Type Declaration[​](#type-declaration "Direct link to Type Declaration")
50
+
51
+ ```ts
52
+ {
53
+ content: string;
54
+ type: "message_delta";
55
+ }
56
+
57
+ ```
58
+
59
+ ### content[​](#content "Direct link to content")
60
+
61
+ ```ts
62
+ content: string;
63
+
64
+ ```
65
+
66
+ ### type[​](#type "Direct link to type")
67
+
68
+ ```ts
69
+ type: "message_delta";
70
+
71
+ ```
72
+
73
+ ```ts
74
+ {
75
+ content: string;
76
+ type: "message";
77
+ }
78
+
79
+ ```
80
+
81
+ ### content[​](#content-1 "Direct link to content")
82
+
83
+ ```ts
84
+ content: string;
85
+
86
+ ```
87
+
88
+ ### type[​](#type-1 "Direct link to type")
89
+
90
+ ```ts
91
+ type: "message";
92
+
93
+ ```
94
+
95
+ ```ts
96
+ {
97
+ args: unknown;
98
+ callId: string;
99
+ name: string;
100
+ type: "tool_call";
101
+ }
102
+
103
+ ```
104
+
105
+ ### args[​](#args "Direct link to args")
106
+
107
+ ```ts
108
+ args: unknown;
109
+
110
+ ```
111
+
112
+ ### callId[​](#callid "Direct link to callId")
113
+
114
+ ```ts
115
+ callId: string;
116
+
117
+ ```
118
+
119
+ ### name[​](#name "Direct link to name")
120
+
121
+ ```ts
122
+ name: string;
123
+
124
+ ```
125
+
126
+ ### type[​](#type-2 "Direct link to type")
127
+
128
+ ```ts
129
+ type: "tool_call";
130
+
131
+ ```
132
+
133
+ ```ts
134
+ {
135
+ callId: string;
136
+ error?: string;
137
+ result: unknown;
138
+ type: "tool_result";
139
+ }
140
+
141
+ ```
142
+
143
+ ### callId[​](#callid-1 "Direct link to callId")
144
+
145
+ ```ts
146
+ callId: string;
147
+
148
+ ```
149
+
150
+ ### error?[​](#error "Direct link to error?")
151
+
152
+ ```ts
153
+ optional error: string;
154
+
155
+ ```
156
+
157
+ ### result[​](#result "Direct link to result")
158
+
159
+ ```ts
160
+ result: unknown;
161
+
162
+ ```
163
+
164
+ ### type[​](#type-3 "Direct link to type")
165
+
166
+ ```ts
167
+ type: "tool_result";
168
+
169
+ ```
170
+
171
+ ```ts
172
+ {
173
+ content: string;
174
+ type: "thinking";
175
+ }
176
+
177
+ ```
178
+
179
+ ### content[​](#content-2 "Direct link to content")
180
+
181
+ ```ts
182
+ content: string;
183
+
184
+ ```
185
+
186
+ ### type[​](#type-4 "Direct link to type")
187
+
188
+ ```ts
189
+ type: "thinking";
190
+
191
+ ```
192
+
193
+ ```ts
194
+ {
195
+ error?: string;
196
+ status: "running" | "waiting" | "complete" | "error";
197
+ type: "status";
198
+ }
199
+
200
+ ```
201
+
202
+ ### error?[​](#error-1 "Direct link to error?")
203
+
204
+ ```ts
205
+ optional error: string;
206
+
207
+ ```
208
+
209
+ ### status[​](#status "Direct link to status")
210
+
211
+ ```ts
212
+ status: "running" | "waiting" | "complete" | "error";
213
+
214
+ ```
215
+
216
+ ### type[​](#type-5 "Direct link to type")
217
+
218
+ ```ts
219
+ type: "status";
220
+
221
+ ```
222
+
223
+ ```ts
224
+ {
225
+ data: Record<string, unknown>;
226
+ type: "metadata";
227
+ }
228
+
229
+ ```
230
+
231
+ ### data[​](#data "Direct link to data")
232
+
233
+ ```ts
234
+ data: Record<string, unknown>;
235
+
236
+ ```
237
+
238
+ ### type[​](#type-6 "Direct link to type")
239
+
240
+ ```ts
241
+ type: "metadata";
242
+
243
+ ```
244
+
245
+ ```ts
246
+ {
247
+ annotations?: ToolAnnotations;
248
+ approvalId: string;
249
+ args: unknown;
250
+ streamId: string;
251
+ toolName: string;
252
+ type: "approval_pending";
253
+ }
254
+
255
+ ```
256
+
257
+ ### annotations?[​](#annotations "Direct link to annotations?")
258
+
259
+ ```ts
260
+ optional annotations: ToolAnnotations;
261
+
262
+ ```
263
+
264
+ ### approvalId[​](#approvalid "Direct link to approvalId")
265
+
266
+ ```ts
267
+ approvalId: string;
268
+
269
+ ```
270
+
271
+ ### args[​](#args-1 "Direct link to args")
272
+
273
+ ```ts
274
+ args: unknown;
275
+
276
+ ```
277
+
278
+ ### streamId[​](#streamid "Direct link to streamId")
279
+
280
+ ```ts
281
+ streamId: string;
282
+
283
+ ```
284
+
285
+ ### toolName[​](#toolname "Direct link to toolName")
286
+
287
+ ```ts
288
+ toolName: string;
289
+
290
+ ```
291
+
292
+ ### type[​](#type-7 "Direct link to type")
293
+
294
+ ```ts
295
+ type: "approval_pending";
296
+
297
+ ```
298
+
299
+ Emitted by the agents plugin (not adapters) when a mutating tool call is awaiting human approval — fires for tools annotated with `effect: "write" | "update" | "destructive"` (preferred) or the legacy `destructive: true` boolean. Clients should render an approval prompt and POST to `/chat/approve` with the matching `approvalId` and a `decision` of `approve` or `deny`.
@@ -0,0 +1,11 @@
1
+ # Type Alias: AgentTool
2
+
3
+ ```ts
4
+ type AgentTool =
5
+ | FunctionTool
6
+ | HostedTool
7
+ | ToolkitEntry;
8
+
9
+ ```
10
+
11
+ Any tool an agent can invoke: inline function tools (`tool()`), hosted MCP tools (`mcpServer()` / raw hosted), or toolkit references from plugins (`analytics().toolkit()`).
@@ -0,0 +1,8 @@
1
+ # Type Alias: AgentTools
2
+
3
+ ```ts
4
+ type AgentTools = Record<string, AgentTool>;
5
+
6
+ ```
7
+
8
+ Per-agent tool record. String keys map to inline tools, toolkit entries, hosted tools, etc.
@@ -0,0 +1,20 @@
1
+ # Type Alias: AgentToolsFn()
2
+
3
+ ```ts
4
+ type AgentToolsFn = (plugins: Plugins) => AgentTools;
5
+
6
+ ```
7
+
8
+ Function form of `AgentDefinition.tools`. Receives the typed [Plugins](./docs/api/appkit/TypeAlias.Plugins.md) map and returns a tool record. Invoked exactly once at setup (or once per `runAgent` call in standalone mode); the result is cached as the agent's resolved tool record.
9
+
10
+ Use the function form when an agent needs tools from registered plugins. The bare object form is fine when an agent only uses inline tools.
11
+
12
+ ## Parameters[​](#parameters "Direct link to Parameters")
13
+
14
+ | Parameter | Type |
15
+ | --------- | --------------------------------------------------------- |
16
+ | `plugins` | [`Plugins`](./docs/api/appkit/TypeAlias.Plugins.md) |
17
+
18
+ ## Returns[​](#returns "Direct link to Returns")
19
+
20
+ [`AgentTools`](./docs/api/appkit/TypeAlias.AgentTools.md)
@@ -0,0 +1,9 @@
1
+ # Type Alias: BaseSystemPromptOption
2
+
3
+ ```ts
4
+ type BaseSystemPromptOption =
5
+ | false
6
+ | string
7
+ | (ctx: PromptContext) => string;
8
+
9
+ ```
@@ -0,0 +1,10 @@
1
+ # Type Alias: HostedTool
2
+
3
+ ```ts
4
+ type HostedTool =
5
+ | GenieTool
6
+ | VectorSearchIndexTool
7
+ | CustomMcpServerTool
8
+ | ExternalMcpServerTool;
9
+
10
+ ```
@@ -0,0 +1,26 @@
1
+ # Type Alias: Plugins
2
+
3
+ ```ts
4
+ type Plugins = Record<string, PluginToolkitProvider>;
5
+
6
+ ```
7
+
8
+ Plugin map passed to the function form of [AgentDefinition.tools](./docs/api/appkit/Interface.AgentDefinition.md#tools). Each entry exposes a `.toolkit(opts?)` method that returns a record of [ToolkitEntry](./docs/api/appkit/Interface.ToolkitEntry.md) markers ready to be spread into a tool record.
9
+
10
+ AppKit does not statically know which plugins the surrounding `createApp` will register, so this is a plain string-keyed record. Refer to plugins by the name used in `createApp({ plugins: [...] })`; unknown names resolve to `undefined` at runtime.
11
+
12
+ ## Example[​](#example "Direct link to Example")
13
+
14
+ ```ts
15
+ const support = createAgent({
16
+ instructions: "...",
17
+ tools(plugins) {
18
+ return {
19
+ get_weather: tool({ ... }),
20
+ ...plugins.analytics.toolkit(),
21
+ ...plugins.files.toolkit({ only: ["uploads.read"] }),
22
+ };
23
+ },
24
+ });
25
+
26
+ ```
@@ -0,0 +1,29 @@
1
+ # Type Alias: ResolvedToolEntry
2
+
3
+ ```ts
4
+ type ResolvedToolEntry =
5
+ | {
6
+ def: AgentToolDefinition;
7
+ localName: string;
8
+ pluginName: string;
9
+ source: "toolkit";
10
+ }
11
+ | {
12
+ def: AgentToolDefinition;
13
+ functionTool: FunctionTool;
14
+ source: "function";
15
+ }
16
+ | {
17
+ def: AgentToolDefinition;
18
+ mcpToolName: string;
19
+ source: "mcp";
20
+ }
21
+ | {
22
+ agentName: string;
23
+ def: AgentToolDefinition;
24
+ source: "subagent";
25
+ };
26
+
27
+ ```
28
+
29
+ Internal tool-index entry after a tool record has been resolved to a dispatchable form.
@@ -0,0 +1,6 @@
1
+ # Type Alias: ToolRegistry
2
+
3
+ ```ts
4
+ type ToolRegistry = Record<string, ToolEntry>;
5
+
6
+ ```
@@ -0,0 +1,19 @@
1
+ # Variable: agents
2
+
3
+ ```ts
4
+ const agents: ToPlugin<typeof AgentsPlugin, AgentsPluginConfig, string>;
5
+
6
+ ```
7
+
8
+ Plugin factory for the agents plugin. Reads `config/agents/*.md` by default, resolves toolkits/tools from registered plugins, exposes `appkit.agents.*` runtime API and mounts `/invocations`.
9
+
10
+ ## Example[​](#example "Direct link to Example")
11
+
12
+ ```ts
13
+ import { agents, analytics, createApp, server } from "@databricks/appkit";
14
+
15
+ await createApp({
16
+ plugins: [server(), analytics(), agents()],
17
+ });
18
+
19
+ ```