@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,27 @@
|
|
|
1
|
+
# Interface: AutoInheritToolsConfig
|
|
2
|
+
|
|
3
|
+
Auto-inherit configuration. When enabled for a given agent origin, agents with no explicit `tools:` declaration receive every registered ToolProvider plugin tool whose author marked `autoInheritable: true`. Tools without that flag — destructive, state-mutating, or privilege-sensitive — never spread automatically and must be wired via `tools:` (object or function form in code, `plugin:NAME` entries in markdown frontmatter).
|
|
4
|
+
|
|
5
|
+
Defaults are `false` for both origins (safe-by-default): developers must consciously opt an origin in to any auto-inherit behaviour.
|
|
6
|
+
|
|
7
|
+
## Properties[](#properties "Direct link to Properties")
|
|
8
|
+
|
|
9
|
+
### code?[](#code "Direct link to code?")
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
optional code: boolean;
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Default for code-defined agents (via `agents: { foo: createAgent(...) }`). Default: `false`.
|
|
17
|
+
|
|
18
|
+
***
|
|
19
|
+
|
|
20
|
+
### file?[](#file "Direct link to file?")
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
optional file: boolean;
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Default for agents loaded from markdown files. Default: `false`.
|
|
@@ -4,6 +4,7 @@ Base configuration interface for AppKit plugins
|
|
|
4
4
|
|
|
5
5
|
## Extended by[](#extended-by "Direct link to Extended by")
|
|
6
6
|
|
|
7
|
+
* [`AgentsPluginConfig`](./docs/api/appkit/Interface.AgentsPluginConfig.md)
|
|
7
8
|
* [`IJobsConfig`](./docs/api/appkit/Interface.IJobsConfig.md)
|
|
8
9
|
|
|
9
10
|
## Indexable[](#indexable "Direct link to Indexable")
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Interface: FunctionTool
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### annotations?[](#annotations "Direct link to annotations?")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
optional annotations: ToolAnnotations;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Behavioural hints that drive the agents plugin's approval gate and the client's approval-card styling. Prefer setting `effect` (one of `"read" | "write" | "update" | "destructive"`) — any mutating value forces HITL approval before `execute()` runs. Legacy `destructive: true` is still honoured. Must be preserved through [functionToolToDefinition](./docs/api/appkit/Function.functionToolToDefinition.md) so the plugin sees them when building agent tool indexes.
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### description?[](#description "Direct link to description?")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
optional description: string | null;
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### execute()[](#execute "Direct link to execute()")
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
execute: (args: Record<string, unknown>) => unknown;
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Returns any shape; downstream `normalizeToolResult` serializes to a string before handing the value to the LLM.
|
|
33
|
+
|
|
34
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
35
|
+
|
|
36
|
+
| Parameter | Type |
|
|
37
|
+
| --------- | ----------------------------- |
|
|
38
|
+
| `args` | `Record`<`string`, `unknown`> |
|
|
39
|
+
|
|
40
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
41
|
+
|
|
42
|
+
`unknown`
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
46
|
+
### name?[](#name "Direct link to name?")
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
optional name: string;
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Optional. When this tool is placed in a keyed record (`tools: { my_tool: ... }` or the function form), the agents plugin overrides this with the record key at index-build time. Only set it explicitly when constructing a `FunctionTool` outside any keyed-record context.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### parameters?[](#parameters-1 "Direct link to parameters?")
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
optional parameters: Record<string, unknown> | null;
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
***
|
|
65
|
+
|
|
66
|
+
### strict?[](#strict "Direct link to strict?")
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
optional strict: boolean | null;
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### type[](#type "Direct link to type")
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
type: "function";
|
|
79
|
+
|
|
80
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Interface: McpConnectAllResult
|
|
2
|
+
|
|
3
|
+
Per-endpoint outcome of [AppKitMcpClient.connectAll](./docs/api/appkit/Class.AppKitMcpClient.md#connectall). Callers (the agents plugin in particular) use the split to warn at startup when some MCP servers are unreachable without aborting boot for the rest.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### connected[](#connected "Direct link to connected")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
connected: string[];
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### failed[](#failed "Direct link to failed")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
failed: {
|
|
20
|
+
error: Error;
|
|
21
|
+
name: string;
|
|
22
|
+
}[];
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### error[](#error "Direct link to error")
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
error: Error;
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### name[](#name "Direct link to name")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
name: string;
|
|
37
|
+
|
|
38
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Interface: Message
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### content[](#content "Direct link to content")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
content: string;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
***
|
|
13
|
+
|
|
14
|
+
### createdAt[](#createdat "Direct link to createdAt")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### id[](#id "Direct link to id")
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
id: string;
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
***
|
|
31
|
+
|
|
32
|
+
### role[](#role "Direct link to role")
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### toolCallId?[](#toolcallid "Direct link to toolCallId?")
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
optional toolCallId: string;
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
***
|
|
49
|
+
|
|
50
|
+
### toolCalls?[](#toolcalls "Direct link to toolCalls?")
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
optional toolCalls: ToolCall[];
|
|
54
|
+
|
|
55
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Interface: PluginToolkitProvider
|
|
2
|
+
|
|
3
|
+
Minimum shape every entry in the [Plugins](./docs/api/appkit/TypeAlias.Plugins.md) map must expose. Core plugins (analytics, files, genie, lakebase) implement this directly via their `.toolkit()` method. The agents plugin and standalone `runAgent` synthesize this shape for any registered plugin that doesn't implement `.toolkit()` directly (falling back to `getAgentTools()` walking).
|
|
4
|
+
|
|
5
|
+
## Methods[](#methods "Direct link to Methods")
|
|
6
|
+
|
|
7
|
+
### toolkit()[](#toolkit "Direct link to toolkit()")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
toolkit(opts?: ToolkitOptions): Record<string, ToolkitEntry>;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
15
|
+
|
|
16
|
+
| Parameter | Type |
|
|
17
|
+
| --------- | ----------------------------------------------------------------------- |
|
|
18
|
+
| `opts?` | [`ToolkitOptions`](./docs/api/appkit/Interface.ToolkitOptions.md) |
|
|
19
|
+
|
|
20
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
21
|
+
|
|
22
|
+
`Record`<`string`, [`ToolkitEntry`](./docs/api/appkit/Interface.ToolkitEntry.md)>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Interface: PromptContext
|
|
2
|
+
|
|
3
|
+
Context passed to `baseSystemPrompt` callbacks.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### agentName[](#agentname "Direct link to agentName")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
agentName: string;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### pluginNames[](#pluginnames "Direct link to pluginNames")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
pluginNames: string[];
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### toolNames[](#toolnames "Direct link to toolNames")
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
toolNames: string[];
|
|
29
|
+
|
|
30
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Interface: RegisteredAgent
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### adapter[](#adapter "Direct link to adapter")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
adapter: AgentAdapter;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
***
|
|
13
|
+
|
|
14
|
+
### baseSystemPrompt?[](#basesystemprompt "Direct link to baseSystemPrompt?")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
optional baseSystemPrompt: BaseSystemPromptOption;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### ephemeral?[](#ephemeral "Direct link to ephemeral?")
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
optional ephemeral: boolean;
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Mirrors `AgentDefinition.ephemeral` — skip thread persistence.
|
|
31
|
+
|
|
32
|
+
***
|
|
33
|
+
|
|
34
|
+
### instructions[](#instructions "Direct link to instructions")
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
instructions: string;
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
43
|
+
### maxSteps?[](#maxsteps "Direct link to maxSteps?")
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
optional maxSteps: number;
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
***
|
|
51
|
+
|
|
52
|
+
### maxTokens?[](#maxtokens "Direct link to maxTokens?")
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
optional maxTokens: number;
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### name[](#name "Direct link to name")
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
name: string;
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
***
|
|
69
|
+
|
|
70
|
+
### toolIndex[](#toolindex "Direct link to toolIndex")
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
toolIndex: Map<string, ResolvedToolEntry>;
|
|
74
|
+
|
|
75
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Interface: RunAgentInput
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### messages[](#messages "Direct link to messages")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
messages: string | Message[];
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Seed messages for the run. Either a single user string or a full message list.
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### plugins?[](#plugins "Direct link to plugins?")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
optional plugins: PluginData<PluginConstructor, unknown, string>[];
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Optional plugin list. Required when `def.tools` is the function form `(plugins) => Record<string, AgentTool>` and the function dereferences any plugins. `runAgent` constructs a fresh instance per plugin and dispatches tool calls against it as the service principal (no OBO — there is no HTTP request in standalone mode).
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### signal?[](#signal "Direct link to signal?")
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
optional signal: AbortSignal;
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Abort signal for cancellation.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: RunAgentResult
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### events[](#events "Direct link to events")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
events: AgentEvent[];
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Every event the adapter yielded, in order. Useful for inspection/tests.
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### text[](#text "Direct link to text")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
text: string;
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Aggregated text output from all `message_delta` events.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Interface: Thread
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### createdAt[](#createdat "Direct link to createdAt")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
***
|
|
13
|
+
|
|
14
|
+
### id[](#id "Direct link to id")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### messages[](#messages "Direct link to messages")
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
messages: Message[];
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
***
|
|
31
|
+
|
|
32
|
+
### updatedAt[](#updatedat "Direct link to updatedAt")
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### userId[](#userid "Direct link to userId")
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
userId: string;
|
|
45
|
+
|
|
46
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Interface: ThreadStore
|
|
2
|
+
|
|
3
|
+
## Methods[](#methods "Direct link to Methods")
|
|
4
|
+
|
|
5
|
+
### addMessage()[](#addmessage "Direct link to addMessage()")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
addMessage(
|
|
9
|
+
threadId: string,
|
|
10
|
+
userId: string,
|
|
11
|
+
message: Message): Promise<void>;
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
16
|
+
|
|
17
|
+
| Parameter | Type |
|
|
18
|
+
| ---------- | --------------------------------------------------------- |
|
|
19
|
+
| `threadId` | `string` |
|
|
20
|
+
| `userId` | `string` |
|
|
21
|
+
| `message` | [`Message`](./docs/api/appkit/Interface.Message.md) |
|
|
22
|
+
|
|
23
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
24
|
+
|
|
25
|
+
`Promise`<`void`>
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### create()[](#create "Direct link to create()")
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
create(userId: string): Promise<Thread>;
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Parameters[](#parameters-1 "Direct link to Parameters")
|
|
37
|
+
|
|
38
|
+
| Parameter | Type |
|
|
39
|
+
| --------- | -------- |
|
|
40
|
+
| `userId` | `string` |
|
|
41
|
+
|
|
42
|
+
#### Returns[](#returns-1 "Direct link to Returns")
|
|
43
|
+
|
|
44
|
+
`Promise`<[`Thread`](./docs/api/appkit/Interface.Thread.md)>
|
|
45
|
+
|
|
46
|
+
***
|
|
47
|
+
|
|
48
|
+
### delete()[](#delete "Direct link to delete()")
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
delete(threadId: string, userId: string): Promise<boolean>;
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Parameters[](#parameters-2 "Direct link to Parameters")
|
|
56
|
+
|
|
57
|
+
| Parameter | Type |
|
|
58
|
+
| ---------- | -------- |
|
|
59
|
+
| `threadId` | `string` |
|
|
60
|
+
| `userId` | `string` |
|
|
61
|
+
|
|
62
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
63
|
+
|
|
64
|
+
`Promise`<`boolean`>
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### get()[](#get "Direct link to get()")
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
get(threadId: string, userId: string): Promise<Thread | null>;
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Parameters[](#parameters-3 "Direct link to Parameters")
|
|
76
|
+
|
|
77
|
+
| Parameter | Type |
|
|
78
|
+
| ---------- | -------- |
|
|
79
|
+
| `threadId` | `string` |
|
|
80
|
+
| `userId` | `string` |
|
|
81
|
+
|
|
82
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
83
|
+
|
|
84
|
+
`Promise`<[`Thread`](./docs/api/appkit/Interface.Thread.md) | `null`>
|
|
85
|
+
|
|
86
|
+
***
|
|
87
|
+
|
|
88
|
+
### list()[](#list "Direct link to list()")
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
list(userId: string): Promise<Thread[]>;
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Parameters[](#parameters-4 "Direct link to Parameters")
|
|
96
|
+
|
|
97
|
+
| Parameter | Type |
|
|
98
|
+
| --------- | -------- |
|
|
99
|
+
| `userId` | `string` |
|
|
100
|
+
|
|
101
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
102
|
+
|
|
103
|
+
`Promise`<[`Thread`](./docs/api/appkit/Interface.Thread.md)\[]>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Interface: ToolAnnotations
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### ~~destructive?~~[](#destructive "Direct link to destructive")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
optional destructive: boolean;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
#### Deprecated[](#deprecated "Direct link to Deprecated")
|
|
13
|
+
|
|
14
|
+
Prefer [effect](#effect) with value `"destructive"`. Retained so existing annotations continue to force the approval gate, and so MCP-style consumers that only read `destructive` still see the hint.
|
|
15
|
+
|
|
16
|
+
***
|
|
17
|
+
|
|
18
|
+
### effect?[](#effect "Direct link to effect?")
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
optional effect: ToolEffect;
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Preferred semantic label. When set, drives both the approval gate (fires for `write`/`update`/`destructive`) and the approval-card styling.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### idempotent?[](#idempotent "Direct link to idempotent?")
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
optional idempotent: boolean;
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
***
|
|
37
|
+
|
|
38
|
+
### ~~readOnly?~~[](#readonly "Direct link to readonly")
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
optional readOnly: boolean;
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Deprecated[](#deprecated-1 "Direct link to Deprecated")
|
|
46
|
+
|
|
47
|
+
Prefer [effect](#effect). Retained for backward compatibility with tools authored against the original flags and for MCP interop.
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### requiresUserContext?[](#requiresusercontext "Direct link to requiresUserContext?")
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
optional requiresUserContext: boolean;
|
|
55
|
+
|
|
56
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Interface: ToolConfig\<S>
|
|
2
|
+
|
|
3
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
4
|
+
|
|
5
|
+
| Type Parameter |
|
|
6
|
+
| ------------------------- |
|
|
7
|
+
| `S` *extends* `z.ZodType` |
|
|
8
|
+
|
|
9
|
+
## Properties[](#properties "Direct link to Properties")
|
|
10
|
+
|
|
11
|
+
### annotations?[](#annotations "Direct link to annotations?")
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
optional annotations: ToolAnnotations;
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Behavioural hints forwarded to the resolved tool definition. Prefer `effect` (`"read" | "write" | "update" | "destructive"`) — any mutating value forces the agents-plugin approval gate before `execute()` runs and the client's approval card will colour itself accordingly. Legacy `destructive: true` still gates. Dropped silently before the fix that added this field.
|
|
19
|
+
|
|
20
|
+
***
|
|
21
|
+
|
|
22
|
+
### description[](#description "Direct link to description")
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
description: string;
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
What the tool does, what it expects, and when the LLM should call it. The model reads this verbatim when deciding whether to invoke the tool, so write it for an LLM, not for a human reader of your code: spell out the inputs, the return shape, and any pre-conditions or side effects.
|
|
30
|
+
|
|
31
|
+
Required. Earlier versions silently fell back to the tool's name when omitted, which surfaced cryptic identifiers like `"get_weather"` as the description — the model then had no signal about expected use and either skipped the tool or called it speculatively. Making this mandatory at the type level forces a real description at authoring time instead of debugging a confused agent later.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### execute()[](#execute "Direct link to execute()")
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
execute: (args: output<S>) => unknown;
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Returning a non-string value is fine: the agent runtime serializes the result via `normalizeToolResult` before handing it to the LLM (strings pass through; `null` becomes `"null"`; everything else gets `JSON.stringify`'d; `undefined` becomes `""`). Return whatever shape is most natural for your tool — typically an object — and let the runtime handle the wire format.
|
|
43
|
+
|
|
44
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
45
|
+
|
|
46
|
+
| Parameter | Type |
|
|
47
|
+
| --------- | ------------- |
|
|
48
|
+
| `args` | `output`<`S`> |
|
|
49
|
+
|
|
50
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
51
|
+
|
|
52
|
+
`unknown`
|
|
53
|
+
|
|
54
|
+
***
|
|
55
|
+
|
|
56
|
+
### name?[](#name "Direct link to name?")
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
optional name: string;
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Optional. When the tool is placed in a keyed record (the standard `tools: { my_tool: tool({...}) }` form, or the function form `tools(plugins) => ({ my_tool: tool({...}) })`), the agents plugin overrides the tool's LLM-visible name with the record key. Set `name` explicitly only if you're constructing a `FunctionTool` outside any keyed-record context — otherwise the record key wins.
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### schema[](#schema "Direct link to schema")
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
schema: S;
|
|
71
|
+
|
|
72
|
+
```
|