@databricks/appkit-ui 0.32.0 → 0.33.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 +53 -1
- package/NOTICE.md +1 -0
- package/dist/react/hooks/index.d.ts +1 -0
- package/dist/react/hooks/index.js +1 -0
- package/dist/react/hooks/types.d.ts +11 -5
- package/dist/react/hooks/types.d.ts.map +1 -1
- package/dist/react/hooks/use-agent-chat.d.ts +128 -0
- package/dist/react/hooks/use-agent-chat.d.ts.map +1 -0
- package/dist/react/hooks/use-agent-chat.js +133 -0
- package/dist/react/hooks/use-agent-chat.js.map +1 -0
- package/dist/react/hooks/use-analytics-query.d.ts +4 -4
- package/dist/react/hooks/use-analytics-query.d.ts.map +1 -1
- package/dist/react/hooks/use-analytics-query.js +4 -4
- package/dist/react/hooks/use-analytics-query.js.map +1 -1
- package/dist/react/hooks/use-chart-data.js +9 -9
- package/dist/react/hooks/use-chart-data.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/docs/api/appkit/Class.AppKitMcpClient.md +157 -0
- package/docs/api/appkit/Class.DatabricksAdapter.md +151 -0
- package/docs/api/appkit/Function.agentIdFromMarkdownPath.md +18 -0
- package/docs/api/appkit/Function.createAgent.md +33 -0
- package/docs/api/appkit/Function.defineTool.md +26 -0
- package/docs/api/appkit/Function.executeFromRegistry.md +25 -0
- package/docs/api/appkit/Function.functionToolToDefinition.md +16 -0
- package/docs/api/appkit/Function.isFunctionTool.md +16 -0
- package/docs/api/appkit/Function.isHostedTool.md +16 -0
- package/docs/api/appkit/Function.isToolkitEntry.md +18 -0
- package/docs/api/appkit/Function.loadAgentFromFile.md +21 -0
- package/docs/api/appkit/Function.loadAgentsFromDir.md +26 -0
- package/docs/api/appkit/Function.mcpServer.md +28 -0
- package/docs/api/appkit/Function.parseTextToolCalls.md +26 -0
- package/docs/api/appkit/Function.resolveHostedTools.md +16 -0
- package/docs/api/appkit/Function.runAgent.md +26 -0
- package/docs/api/appkit/Function.tool.md +28 -0
- package/docs/api/appkit/Function.toolsFromRegistry.md +20 -0
- package/docs/api/appkit/Interface.AgentAdapter.md +21 -0
- package/docs/api/appkit/Interface.AgentDefinition.md +112 -0
- package/docs/api/appkit/Interface.AgentInput.md +37 -0
- package/docs/api/appkit/Interface.AgentRunContext.md +32 -0
- package/docs/api/appkit/Interface.AgentToolDefinition.md +37 -0
- package/docs/api/appkit/Interface.AgentsPluginConfig.md +241 -0
- package/docs/api/appkit/Interface.AutoInheritToolsConfig.md +27 -0
- package/docs/api/appkit/Interface.BasePluginConfig.md +1 -0
- package/docs/api/appkit/Interface.FunctionTool.md +80 -0
- package/docs/api/appkit/Interface.McpConnectAllResult.md +38 -0
- package/docs/api/appkit/Interface.Message.md +55 -0
- package/docs/api/appkit/Interface.PluginToolkitProvider.md +22 -0
- package/docs/api/appkit/Interface.PromptContext.md +30 -0
- package/docs/api/appkit/Interface.RegisteredAgent.md +75 -0
- package/docs/api/appkit/Interface.RunAgentInput.md +34 -0
- package/docs/api/appkit/Interface.RunAgentResult.md +23 -0
- package/docs/api/appkit/Interface.Thread.md +46 -0
- package/docs/api/appkit/Interface.ThreadStore.md +103 -0
- package/docs/api/appkit/Interface.ToolAnnotations.md +56 -0
- package/docs/api/appkit/Interface.ToolConfig.md +72 -0
- package/docs/api/appkit/Interface.ToolEntry.md +73 -0
- package/docs/api/appkit/Interface.ToolProvider.md +38 -0
- package/docs/api/appkit/Interface.ToolkitEntry.md +59 -0
- package/docs/api/appkit/Interface.ToolkitOptions.md +45 -0
- package/docs/api/appkit/TypeAlias.AgentEvent.md +299 -0
- package/docs/api/appkit/TypeAlias.AgentTool.md +11 -0
- package/docs/api/appkit/TypeAlias.AgentTools.md +8 -0
- package/docs/api/appkit/TypeAlias.AgentToolsFn.md +20 -0
- package/docs/api/appkit/TypeAlias.BaseSystemPromptOption.md +9 -0
- package/docs/api/appkit/TypeAlias.HostedTool.md +10 -0
- package/docs/api/appkit/TypeAlias.Plugins.md +26 -0
- package/docs/api/appkit/TypeAlias.ResolvedToolEntry.md +29 -0
- package/docs/api/appkit/TypeAlias.ToolRegistry.md +6 -0
- package/docs/api/appkit/Variable.agents.md +19 -0
- package/docs/api/appkit.md +113 -62
- package/docs/plugins/agents.md +441 -0
- package/llms.txt +53 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Interface: ToolEntry\<S>
|
|
2
|
+
|
|
3
|
+
Single-tool entry for a plugin's internal tool registry.
|
|
4
|
+
|
|
5
|
+
Plugins collect these into a `Record<string, ToolEntry>` keyed by the tool's public name and dispatch via `executeFromRegistry`.
|
|
6
|
+
|
|
7
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
8
|
+
|
|
9
|
+
| Type Parameter | Default type |
|
|
10
|
+
| ------------------------- | ------------ |
|
|
11
|
+
| `S` *extends* `z.ZodType` | `z.ZodType` |
|
|
12
|
+
|
|
13
|
+
## Properties[](#properties "Direct link to Properties")
|
|
14
|
+
|
|
15
|
+
### annotations?[](#annotations "Direct link to annotations?")
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
optional annotations: ToolAnnotations;
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
### autoInheritable?[](#autoinheritable "Direct link to autoInheritable?")
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
optional autoInheritable: boolean;
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Whether this tool is eligible for auto-inheritance into markdown or code-defined agents that enable `autoInheritTools`. Defaults to `false` (safe-by-default) — plugin authors must explicitly opt a tool in if they consider it safe enough to appear in every agent's tool record without an explicit `tools:` declaration. Destructive or privilege-sensitive tools should leave this unset so that they only reach agents that wire them explicitly (via `tools:` object/function form, markdown `plugin:NAME` entries in the unified `tools:` list, or `plugins.<name>.toolkit({ only: [...] })`).
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### description[](#description "Direct link to description")
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
description: string;
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
***
|
|
43
|
+
|
|
44
|
+
### execute()[](#execute "Direct link to execute()")
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
execute: (args: output<S>, signal?: AbortSignal) => unknown;
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Callback the agents plugin invokes after Zod validation succeeds.
|
|
52
|
+
|
|
53
|
+
Named `execute` to match the public `tool({ execute })` form — both the agent-author surface and the plugin-author surface now spell their callback the same way. `args` is the inferred Zod output (so `T extends z.ZodType` flows through and `args` is fully typed). `signal` is the per-run AbortSignal: forward it to any awaited I/O so cancellation actually unwinds the call (analytics and lakebase both do this).
|
|
54
|
+
|
|
55
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
56
|
+
|
|
57
|
+
| Parameter | Type |
|
|
58
|
+
| --------- | ------------- |
|
|
59
|
+
| `args` | `output`<`S`> |
|
|
60
|
+
| `signal?` | `AbortSignal` |
|
|
61
|
+
|
|
62
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
63
|
+
|
|
64
|
+
`unknown`
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### schema[](#schema "Direct link to schema")
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
schema: S;
|
|
72
|
+
|
|
73
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Interface: ToolProvider
|
|
2
|
+
|
|
3
|
+
## Methods[](#methods "Direct link to Methods")
|
|
4
|
+
|
|
5
|
+
### executeAgentTool()[](#executeagenttool "Direct link to executeAgentTool()")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
executeAgentTool(
|
|
9
|
+
name: string,
|
|
10
|
+
args: unknown,
|
|
11
|
+
signal?: AbortSignal): Promise<unknown>;
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
16
|
+
|
|
17
|
+
| Parameter | Type |
|
|
18
|
+
| --------- | ------------- |
|
|
19
|
+
| `name` | `string` |
|
|
20
|
+
| `args` | `unknown` |
|
|
21
|
+
| `signal?` | `AbortSignal` |
|
|
22
|
+
|
|
23
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
24
|
+
|
|
25
|
+
`Promise`<`unknown`>
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### getAgentTools()[](#getagenttools "Direct link to getAgentTools()")
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
getAgentTools(): AgentToolDefinition[];
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Returns[](#returns-1 "Direct link to Returns")
|
|
37
|
+
|
|
38
|
+
[`AgentToolDefinition`](./docs/api/appkit/Interface.AgentToolDefinition.md)\[]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Interface: ToolkitEntry
|
|
2
|
+
|
|
3
|
+
A tool reference produced by a plugin's `.toolkit()` call. The agents plugin recognizes the `__toolkitRef` brand and dispatches tool invocations through `PluginContext.executeTool(req, pluginName, localName, ...)`, preserving OBO (asUser) and telemetry spans.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### \_\_toolkitRef[](#__toolkitref "Direct link to __toolkitRef")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly __toolkitRef: true;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### annotations?[](#annotations "Direct link to annotations?")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
optional annotations: ToolAnnotations;
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### autoInheritable?[](#autoinheritable "Direct link to autoInheritable?")
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
optional autoInheritable: boolean;
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Whether this tool is eligible for `autoInheritTools` spreading. Mirrors [ToolEntry.autoInheritable](./docs/api/appkit/Interface.ToolEntry.md#autoinheritable) from the source registry so the agents plugin can filter auto-inherited tools without re-walking the provider's internal registry.
|
|
33
|
+
|
|
34
|
+
***
|
|
35
|
+
|
|
36
|
+
### def[](#def "Direct link to def")
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
def: AgentToolDefinition;
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### localName[](#localname "Direct link to localName")
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
localName: string;
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
***
|
|
53
|
+
|
|
54
|
+
### pluginName[](#pluginname "Direct link to pluginName")
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
pluginName: string;
|
|
58
|
+
|
|
59
|
+
```
|
|
@@ -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,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,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,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
|
+
```
|