@databricks/appkit 0.63.0 → 0.65.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 +3 -2
- package/dist/appkit/package.js +1 -1
- package/dist/cli/commands/doctor/resolve-targets.js +1 -1
- package/dist/cli/commands/plugin/create/scaffold.js +2 -2
- package/dist/cli/commands/plugin/create/scaffold.js.map +1 -1
- package/dist/core/agent/agent-dirs.js +14 -0
- package/dist/core/agent/agent-dirs.js.map +1 -0
- package/dist/core/agent/create-agent.d.ts +5 -7
- package/dist/core/agent/create-agent.d.ts.map +1 -1
- package/dist/core/agent/create-agent.js +28 -7
- package/dist/core/agent/create-agent.js.map +1 -1
- package/dist/core/agent/load-agents.d.ts.map +1 -1
- package/dist/core/agent/load-agents.js +4 -4
- package/dist/core/agent/load-agents.js.map +1 -1
- package/dist/core/agent/load-code-agents.js +115 -0
- package/dist/core/agent/load-code-agents.js.map +1 -0
- package/dist/core/agent/types.d.ts +20 -6
- package/dist/core/agent/types.d.ts.map +1 -1
- package/dist/core/agent/types.js.map +1 -1
- package/dist/core/appkit.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2 -2
- package/dist/plugin/plugin.d.ts +2 -2
- package/dist/plugins/agents/agents.d.ts +38 -7
- package/dist/plugins/agents/agents.d.ts.map +1 -1
- package/dist/plugins/agents/agents.js +147 -39
- package/dist/plugins/agents/agents.js.map +1 -1
- package/dist/plugins/agents/tool-approval-gate.js.map +1 -1
- package/dist/plugins/ai-search/ai-search.d.ts +1 -1
- package/dist/plugins/ai-search/ai-search.d.ts.map +1 -1
- package/dist/plugins/ai-search/ai-search.js +3 -1
- package/dist/plugins/ai-search/ai-search.js.map +1 -1
- package/dist/plugins/analytics/analytics.d.ts +2 -2
- package/dist/plugins/analytics/analytics.d.ts.map +1 -1
- package/dist/plugins/analytics/analytics.js +3 -1
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/files/plugin.d.ts +5 -4
- package/dist/plugins/files/plugin.d.ts.map +1 -1
- package/dist/plugins/files/plugin.js +2 -1
- package/dist/plugins/files/plugin.js.map +1 -1
- package/dist/plugins/genie/genie.d.ts +2 -2
- package/dist/plugins/genie/genie.d.ts.map +1 -1
- package/dist/plugins/genie/genie.js +3 -1
- package/dist/plugins/genie/genie.js.map +1 -1
- package/dist/plugins/jobs/plugin.d.ts +3 -2
- package/dist/plugins/jobs/plugin.d.ts.map +1 -1
- package/dist/plugins/jobs/plugin.js +2 -1
- package/dist/plugins/jobs/plugin.js.map +1 -1
- package/dist/plugins/lakebase/lakebase.d.ts +4 -4
- package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +3 -1
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/server/index.d.ts +1 -1
- package/dist/plugins/server/index.d.ts.map +1 -1
- package/dist/plugins/server/index.js +3 -1
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/plugins/serving/serving.d.ts +1 -0
- package/dist/plugins/serving/serving.d.ts.map +1 -1
- package/dist/plugins/serving/serving.js +2 -1
- package/dist/plugins/serving/serving.js.map +1 -1
- package/dist/plugins/ui-variants/index.js +3 -1
- package/dist/plugins/ui-variants/index.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/manifest-loader.d.ts +20 -1
- package/dist/registry/manifest-loader.d.ts.map +1 -1
- package/dist/registry/manifest-loader.js +23 -1
- package/dist/registry/manifest-loader.js.map +1 -1
- package/dist/schemas/manifest.d.ts +1 -1
- package/dist/shared/src/agent.d.ts +1 -1
- package/dist/shared/src/index.d.ts +1 -1
- package/dist/shared/src/naming.js +13 -1
- package/dist/shared/src/naming.js.map +1 -1
- package/dist/shared/src/schemas/manifest.d.ts +1 -1
- package/dist/shared/src/schemas/manifest.js +463 -0
- package/dist/shared/src/schemas/manifest.js.map +1 -0
- package/dist/testing/fixtures.d.ts +1 -1
- package/dist/tsdown/index.d.ts +58 -0
- package/dist/tsdown/index.d.ts.map +1 -0
- package/dist/tsdown/index.js +71 -0
- package/dist/tsdown/index.js.map +1 -0
- package/docs/api/appkit/Function.createAgent.md +1 -3
- package/docs/api/appkit/Function.defineManifest.md +32 -0
- package/docs/api/appkit/Interface.AgentDefinition.md +12 -1
- package/docs/api/appkit/Interface.AgentsPluginConfig.md +6 -15
- package/docs/api/appkit/TypeAlias.AgentEvent.md +1 -1
- package/docs/api/appkit/Variable.agents.md +2 -2
- package/docs/api/appkit.md +47 -46
- package/docs/plugins/agents.md +85 -21
- package/docs/plugins/testing.md +2 -2
- package/llms.txt +3 -2
- package/package.json +5 -1
- package/sbom.cdx.json +1 -1
package/docs/plugins/agents.md
CHANGED
|
@@ -4,7 +4,7 @@ Beta plugin
|
|
|
4
4
|
|
|
5
5
|
This plugin is currently **beta**. APIs may change between minor releases. Import from `@databricks/appkit/beta`. See [Plugin Stability Tiers](./docs/plugins/stability.md).
|
|
6
6
|
|
|
7
|
-
The `agents` plugin turns a Databricks AppKit app into an AI-agent host. It
|
|
7
|
+
The `agents` plugin turns a Databricks AppKit app into an AI-agent host. It discovers agent definitions from disk — one folder per agent under `server/agents/`, holding either `agent.md` (markdown) or `agent.ts` (code) — and exposes them at `POST /invocations` and `POST /responses` (non-streaming, aliases) alongside `POST /chat` (streaming) and routes for thread management, cancellation, and HITL approval. In every case the agent's id is its folder name; there's no map to maintain and no id to restate.
|
|
8
8
|
|
|
9
9
|
This page covers the full lifecycle. For the hand-written primitives (`tool()`, `mcpServer()`), see [tools](./docs/plugins/server.md).
|
|
10
10
|
|
|
@@ -36,14 +36,15 @@ That alone gives you a live HTTP server with `POST /invocations` (and its alias
|
|
|
36
36
|
|
|
37
37
|
## Level 1: drop a markdown agent package[](#level-1-drop-a-markdown-agent-package "Direct link to Level 1: drop a markdown agent package")
|
|
38
38
|
|
|
39
|
-
Each agent lives in its own
|
|
39
|
+
Each agent lives in its own folder under `server/agents/` with entry file `agent.md`. A folder is an agent only if it holds an entry file (`agent.md` or `agent.ts`); a folder without one is skipped, so per-agent asset folders like `skills/` sit beside the entry.
|
|
40
40
|
|
|
41
41
|
```text
|
|
42
42
|
my-app/
|
|
43
|
-
server
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
server/
|
|
44
|
+
server.ts
|
|
45
|
+
agents/
|
|
46
|
+
assistant/
|
|
47
|
+
agent.md
|
|
47
48
|
|
|
48
49
|
```
|
|
49
50
|
|
|
@@ -61,13 +62,17 @@ Use the available tools to query data, browse files, and help users.
|
|
|
61
62
|
|
|
62
63
|
On startup the plugin:
|
|
63
64
|
|
|
64
|
-
1. Discovers
|
|
65
|
+
1. Discovers `server/agents/assistant/agent.md` and registers agent id `assistant`.
|
|
65
66
|
2. Parses the YAML frontmatter and markdown body as the agent's `instructions`.
|
|
66
|
-
3. Resolves the adapter from `endpoint` (or falls back to `
|
|
67
|
+
3. Resolves the adapter from `endpoint` (or falls back to `DATABRICKS_SERVING_ENDPOINT_NAME`).
|
|
67
68
|
4. Mounts the agent at the default name (`assistant`).
|
|
68
69
|
|
|
69
70
|
The agent starts with **no tools**. Tools are opt-in — declare them in frontmatter (Level 2 below) or opt into auto-inherit explicitly with `agents({ autoInheritTools: { file: true } })`. See "Auto-inherit posture" further down for what that costs and why it's off by default.
|
|
70
71
|
|
|
72
|
+
Migrating from `config/agents/`
|
|
73
|
+
|
|
74
|
+
Earlier versions kept markdown agents under `config/agents/<id>/agent.md`. That location is still read as a deprecated fallback (one-time warning on boot); move each folder to `server/agents/<id>/agent.md` so every agent — markdown and code — lives in one place.
|
|
75
|
+
|
|
71
76
|
Requests land at `POST /invocations` (or its alias `POST /responses`) with an OpenAI Responses-compatible body. These endpoints run the agent to completion and return a single JSON response — no SSE. Streaming clients should use `POST /chat`. Every tool call runs through `asUser(req)` so SQL executes as the requesting user, file access respects Unity Catalog ACLs, and telemetry spans are created automatically.
|
|
72
77
|
|
|
73
78
|
No HITL on `/invocations` and `/responses`
|
|
@@ -102,12 +107,14 @@ When any `tools:` is declared the auto-inherit default is turned off — the age
|
|
|
102
107
|
|
|
103
108
|
## Level 3: code-defined agents[](#level-3-code-defined-agents "Direct link to Level 3: code-defined agents")
|
|
104
109
|
|
|
110
|
+
Code agents live one-per-folder under `server/agents/`, with entry file `agent.ts` (mirroring markdown's `agent.md`). The entry exports a created agent and its **id is the folder name** (`server/agents/support/agent.ts` → `support`). Nothing restates the id.
|
|
111
|
+
|
|
105
112
|
```ts
|
|
106
|
-
|
|
107
|
-
import {
|
|
113
|
+
// server/agents/support/agent.ts
|
|
114
|
+
import { createAgent, tool } from "@databricks/appkit/beta";
|
|
108
115
|
import { z } from "zod";
|
|
109
116
|
|
|
110
|
-
|
|
117
|
+
export default createAgent({ // id derived from folder name: "support"
|
|
111
118
|
instructions: "You help customers with data and files.",
|
|
112
119
|
model: "databricks-claude-sonnet-4-5", // string sugar
|
|
113
120
|
tools(plugins) {
|
|
@@ -123,17 +130,40 @@ const support = createAgent({
|
|
|
123
130
|
},
|
|
124
131
|
});
|
|
125
132
|
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The `agents` plugin discovers these files at startup — no registration, no map:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
// server/server.ts
|
|
139
|
+
import { analytics, createApp, files, server } from "@databricks/appkit";
|
|
140
|
+
import { agents } from "@databricks/appkit/beta";
|
|
141
|
+
|
|
126
142
|
await createApp({
|
|
127
|
-
plugins: [server(), analytics(), files(), agents(
|
|
143
|
+
plugins: [server(), analytics(), files(), agents()], // no agent map, no import
|
|
128
144
|
});
|
|
129
145
|
|
|
130
146
|
```
|
|
131
147
|
|
|
148
|
+
Discovery imports each `server/agents/<id>/agent.ts` — the source `.ts` under `tsx` in dev, and the compiled `dist/agents/<id>/agent.js` in a production build (built output wins over source, independent of `NODE_ENV`). Because the production server is bundled and only imports things reachable from `server/server.ts`, the template's `tsdown` config lists `server/agents/*/agent.ts` as build entries so `dist/agents/*/agent.js` are emitted for the scan — that wiring is what lets a dropped-in folder survive the prod bundle. (Markdown `agent.md` is read from source in both dev and prod — it's data, not compiled.) The root is always `server/agents` — there is no config option to relocate it; markdown still under `config/agents/` is read as a deprecated fallback (one-time warning).
|
|
149
|
+
|
|
150
|
+
Built output shadows source in dev
|
|
151
|
+
|
|
152
|
+
Because compiled output wins over source, a stale `dist/agents` / `build/agents` left over from a previous `npm run build` will be picked up by `npm run dev` instead of your live `server/agents/*.ts`, so edits appear ignored. **Delete the build dir** if a code agent seems frozen — a rebuild only swaps in a newer snapshot, so only deleting it restores live-from-source dev reload. Markdown is always read from source, so `agent.md` edits are never shadowed.
|
|
153
|
+
|
|
154
|
+
The entry may `export default createAgent({...})` or export a single named created agent; either way the id is the folder name. A folder whose entry exports no created agent (or has no `agent.ts`/`agent.md` at all) is skipped. Mark one agent as the default with `createAgent({ default: true })` (mirrors markdown frontmatter `default: true`); an explicit `agents({ defaultAgent })` still wins.
|
|
155
|
+
|
|
132
156
|
Code-defined agents start with no tools by default. The function form `tools(plugins) => Record<string, AgentTool>` is the primary way to pull in plugin tools: each plugin registered in `createApp({ plugins: [...] })` shows up on the `plugins` parameter, and you call `.toolkit(opts?)` on it to get a spread-friendly record. The runtime invokes the function once at agent setup and caches the result — every plugin is mentioned exactly once (in `createApp`), with no held variables or marker imports.
|
|
133
157
|
|
|
134
|
-
Inline `tool({...})` calls live in the same record. `name` is optional — the agents plugin overrides it with the record key (`get_weather` above).
|
|
158
|
+
Inline `tool({...})` calls live in the same record. Their `name` is optional — the agents plugin overrides it with the record key (`get_weather` above).
|
|
135
159
|
|
|
136
|
-
|
|
160
|
+
Auto-inherit is **off for both origins by default** — a markdown or code agent with no declared `tools:` gets an empty tool index. Opt an origin in explicitly with `agents({ autoInheritTools: { file: true } })` (or `{ code: true }`, or `true` for both).
|
|
161
|
+
|
|
162
|
+
Deprecated: the `agents({ agents: { ... } })` map
|
|
163
|
+
|
|
164
|
+
Passing a hand-built agent map still works and is honored for backward compatibility, but it emits a one-time deprecation warning and will be removed in a future minor. It restates each agent's id (once in `createAgent`, once as the map key); discovery from `server/agents/` removes both the map and the restatement. Migrate by moving each `createAgent(...)` into its own `server/agents/<id>/agent.ts` (default or single named export) and dropping the map. If a discovered agent and a map entry share an id, discovery wins and the map entry is ignored (with a one-time warning). (Inline sub-agents — `createAgent({ agents: { ... } })` on a definition — are unaffected; only the plugin-level map is deprecated.)
|
|
165
|
+
|
|
166
|
+
Some examples further down still pass agents inline via this map for snippet brevity — in a real app each of those `createAgent(...)` definitions lives in its own `server/agents/<id>/agent.ts` and needs no map.
|
|
137
167
|
|
|
138
168
|
### Scoping tools in code[](#scoping-tools-in-code "Direct link to Scoping tools in code")
|
|
139
169
|
|
|
@@ -170,16 +200,16 @@ const supervisor = createAgent({
|
|
|
170
200
|
agents: { researcher, writer }, // exposed as agent-researcher, agent-writer
|
|
171
201
|
});
|
|
172
202
|
|
|
203
|
+
// server/agents/{supervisor,researcher,writer}/agent.ts — one folder each
|
|
204
|
+
export default supervisor;
|
|
205
|
+
|
|
173
206
|
await createApp({
|
|
174
|
-
plugins: [
|
|
175
|
-
server(),
|
|
176
|
-
agents({ agents: { supervisor, researcher, writer } }),
|
|
177
|
-
],
|
|
207
|
+
plugins: [server(), agents()], // discovered from server/agents/
|
|
178
208
|
});
|
|
179
209
|
|
|
180
210
|
```
|
|
181
211
|
|
|
182
|
-
Each key in `agents: {...}` on an `AgentDefinition` becomes an `agent-<key>` tool on the parent. When invoked, the agents plugin runs the child's adapter with a fresh message list (no shared thread state) and returns the aggregated text. Cycles are rejected at load
|
|
212
|
+
Put `supervisor`, `researcher`, and `writer` in their own `server/agents/<id>/agent.ts` folders (default export each) — a markdown parent can also delegate to a code child in a sibling folder via `agents: [helper]` frontmatter. Each key in `agents: {...}` on an `AgentDefinition` becomes an `agent-<key>` tool on the parent. When invoked, the agents plugin runs the child's adapter with a fresh message list (no shared thread state) and returns the aggregated text. Cycles in a code agent's inline `agents: {}` graph are rejected at load (`createAgent`); markdown `agents:` delegation rejects self-references at load and bounds deeper cycles at runtime via `limits.maxSubAgentDepth`.
|
|
183
213
|
|
|
184
214
|
## Level 5: standalone (no `createApp`)[](#level-5-standalone-no-createapp "Direct link to level-5-standalone-no-createapp")
|
|
185
215
|
|
|
@@ -229,6 +259,36 @@ const result = await runAgent(classifier, {
|
|
|
229
259
|
|
|
230
260
|
MCP hosted tools (`mcpServer(...)`) still require `agents()` (they need a live MCP client). Supervisor-API hosted tools (`supervisorTools.*`), by contrast, **work in standalone `runAgent`** — the adapter has everything it needs to execute them server-side. This makes batch-eval / CI use of supervisor agents possible without `createApp`. Plugin tool dispatch in standalone mode runs as the service principal (no OBO) and **bypasses the agents-plugin approval gate** — treat standalone runAgent as a trusted-prompt environment (CI, batch eval, internal scripts), not as an exposed user-facing surface.
|
|
231
261
|
|
|
262
|
+
## Adding agents to an existing app[](#adding-agents-to-an-existing-app "Direct link to Adding agents to an existing app")
|
|
263
|
+
|
|
264
|
+
Already have an app and want to add agents? What you touch depends on the kind:
|
|
265
|
+
|
|
266
|
+
**Markdown agents** — just the plugin. Drop `server/agents/<id>/agent.md`, add `agents()` to your `plugins`, done. Markdown is read from source at runtime in both dev and prod, so there is no build change.
|
|
267
|
+
|
|
268
|
+
**Code agents** (`server/agents/<id>/agent.ts`) — also update your server build so a production bundle emits them. Code agents aren't imported anywhere, so a build that only compiles `server/server.ts` never produces `dist/agents/*/agent.js`, and a bundled `npm run build` + start would discover **zero** code agents.
|
|
269
|
+
|
|
270
|
+
Dev hides this
|
|
271
|
+
|
|
272
|
+
`npm run dev` (tsx) imports the `.ts` source directly, so code agents work there with no build change — the gap only appears in a bundled build. If you add code agents but forget the build change, the plugin warns at startup (and names the fix) rather than failing silently.
|
|
273
|
+
|
|
274
|
+
The one-line fix is to adopt the build preset:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
// tsdown.server.config.ts
|
|
278
|
+
import { appkitServerConfig } from '@databricks/appkit/tsdown';
|
|
279
|
+
|
|
280
|
+
export default appkitServerConfig();
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`appkitServerConfig()` auto-detects `server/agents/` and adds the entry glob + `clean` only when code agents exist; pass overrides as `appkitServerConfig({ external, define, ... })`, or a function `appkitServerConfig((base) => ({ ...base }))` for full control. It's also the last time you touch this file — future build-wiring changes ship with the package. If you'd rather keep a hand-written config, add the entries yourself:
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
entry: ['server/server.ts', 'server/agents/*/agent.ts'],
|
|
288
|
+
clean: true,
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
|
|
232
292
|
## Managed agents: the Supervisor API adapter[](#managed-agents-the-supervisor-api-adapter "Direct link to Managed agents: the Supervisor API adapter")
|
|
233
293
|
|
|
234
294
|
`DatabricksAdapter.fromSupervisorApi` (beta) is the zero-config way to run an agent: instead of provisioning and pointing at a model-serving endpoint, you run the agentic loop in the Databricks workspace by targeting the AI Gateway Responses API (`/ai-gateway/mlflow/v1/responses`), which runs the LLM — and any hosted tools — as a managed service on Databricks. No `DATABRICKS_SERVING_ENDPOINT_NAME`, no stream-capability check, no JS tool plumbing for the common cases.
|
|
@@ -361,8 +421,8 @@ Some hosted tool kinds return their final assistant text without incremental `ou
|
|
|
361
421
|
|
|
362
422
|
```ts
|
|
363
423
|
agents({
|
|
364
|
-
|
|
365
|
-
agents?: Record<string, AgentDefinition>,
|
|
424
|
+
// Agents live under server/agents/<id>/ (fixed root). config/agents is read as a deprecated fallback.
|
|
425
|
+
agents?: Record<string, AgentDefinition>, // DEPRECATED — use server/agents/<id>/ discovery
|
|
366
426
|
defaultAgent?: string,
|
|
367
427
|
defaultModel?: AgentAdapter | Promise<AgentAdapter> | string,
|
|
368
428
|
tools?: Record<string, AgentTool>,
|
|
@@ -381,6 +441,7 @@ agents({
|
|
|
381
441
|
maxConcurrentStreamsPerUser?: number, // default: 5
|
|
382
442
|
maxToolCalls?: number, // default: 50
|
|
383
443
|
maxSubAgentDepth?: number, // default: 3
|
|
444
|
+
toolCallTimeoutMs?: number, // default: 300_000 (5 min)
|
|
384
445
|
},
|
|
385
446
|
})
|
|
386
447
|
|
|
@@ -538,6 +599,7 @@ agents({
|
|
|
538
599
|
maxConcurrentStreamsPerUser: 5, // HTTP 429 + Retry-After when exceeded
|
|
539
600
|
maxToolCalls: 50, // aborts the run if the budget is exhausted
|
|
540
601
|
maxSubAgentDepth: 3, // rejects sub-agent recursion beyond this
|
|
602
|
+
toolCallTimeoutMs: 300_000, // per-tool-call timeout (5 min; cold SQL/Genie headroom)
|
|
541
603
|
},
|
|
542
604
|
});
|
|
543
605
|
|
|
@@ -567,8 +629,10 @@ appkit.agents.getThreads(userId); // list user's threads
|
|
|
567
629
|
| `model` | string | Same as `endpoint`; either works. |
|
|
568
630
|
| `tools` | array | Unified tool list. Entries are `plugin:<name>` / `plugin:<name>: [t1, t2]` / `plugin:<name>: { only, except, rename, prefix }` for plugin tools, or a bare `<key>` resolved against `agents({ tools: {...} })` for ambient tools. See "Level 2: scope tools in frontmatter" above for examples. |
|
|
569
631
|
| `default` | boolean | First agent id (sorted order) with `default: true` becomes the default agent. |
|
|
632
|
+
| `agents` | array | Sub-agent ids (sibling folders) to delegate to; each becomes an `agent-<id>` tool. Resolves against other markdown and code agents. |
|
|
570
633
|
| `maxSteps` | number | Adapter max-step hint. |
|
|
571
634
|
| `maxTokens` | number | Adapter max-token hint. |
|
|
635
|
+
| `generationParams` | object | Adapter generation params (e.g. `temperature`, `top_p`) passed through when AppKit builds the adapter. |
|
|
572
636
|
| `baseSystemPrompt` | false \| string | Per-agent override. `false` disables the AppKit base prompt. |
|
|
573
637
|
| `ephemeral` | boolean | If `true`, the thread created for a chat request against this agent is deleted from `ThreadStore` after the stream finishes. Use for stateless one-shot agents (e.g. autocomplete) so history does not accumulate or contaminate future calls. Defaults to `false`. |
|
|
574
638
|
|
package/docs/plugins/testing.md
CHANGED
|
@@ -49,7 +49,7 @@ const mock = createTestPluginContext({
|
|
|
49
49
|
`attach()` wires the context to a plugin the production way: it seeds an in-memory cache (if AppKit hasn't already initialized one), then calls the plugin's `attachContext`, which rebuilds telemetry and flips `isReady` to `true`. Await it before exercising any handler that reads `this.context`, `this.cache`, or gates on `isReady`:
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
|
-
const plugin = new MyAgentPlugin({
|
|
52
|
+
const plugin = new MyAgentPlugin({});
|
|
53
53
|
await mock.attach(plugin);
|
|
54
54
|
|
|
55
55
|
```
|
|
@@ -222,7 +222,7 @@ To test a plugin that dispatches cross-plugin tool calls, register fake provider
|
|
|
222
222
|
|
|
223
223
|
```ts
|
|
224
224
|
const mock = createTestPluginContext({ analytics: { query: [{ n: 1 }] } });
|
|
225
|
-
const plugin = new MyAgentPlugin({
|
|
225
|
+
const plugin = new MyAgentPlugin({});
|
|
226
226
|
await mock.attach(plugin);
|
|
227
227
|
|
|
228
228
|
// `obo` sets the forwarded identity headers `asUser` needs — without them the
|
package/llms.txt
CHANGED
|
@@ -83,11 +83,12 @@ npx @databricks/appkit docs <query>
|
|
|
83
83
|
- [Function: agentIdFromMarkdownPath()](./docs/api/appkit/Function.agentIdFromMarkdownPath.md): Derives the logical agent id from a markdown path. When the file is named
|
|
84
84
|
- [Function: appKitServingTypesPlugin()](./docs/api/appkit/Function.appKitServingTypesPlugin.md): Vite plugin to generate TypeScript types for AppKit serving endpoints.
|
|
85
85
|
- [Function: appKitTypesPlugin()](./docs/api/appkit/Function.appKitTypesPlugin.md): Vite plugin to generate types for AppKit queries.
|
|
86
|
-
- [Function: createAgent()](./docs/api/appkit/Function.createAgent.md): Pure factory for agent definitions
|
|
86
|
+
- [Function: createAgent()](./docs/api/appkit/Function.createAgent.md): Pure factory for agent definitions: cycle-detects the sub-agent graph and
|
|
87
87
|
- [Function: createApp()](./docs/api/appkit/Function.createApp.md): Bootstraps AppKit with the provided configuration.
|
|
88
88
|
- [Function: createLakebasePool()](./docs/api/appkit/Function.createLakebasePool.md): Create a Lakebase pool with appkit's logger integration.
|
|
89
89
|
- [Function: createLakebasePoolManager()](./docs/api/appkit/Function.createLakebasePoolManager.md): Create a pool manager that maintains per-key Lakebase connection pools.
|
|
90
90
|
- [Function: createWorkspaceClient()](./docs/api/appkit/Function.createWorkspaceClient.md): Construct an AppKit workspace client.
|
|
91
|
+
- [Function: defineManifest()](./docs/api/appkit/Function.defineManifest.md): Validates a raw manifest (typically a manifest.json import) against the
|
|
91
92
|
- [Function: defineTool()](./docs/api/appkit/Function.defineTool.md): Defines a single tool entry for a plugin's internal registry.
|
|
92
93
|
- [Function: executeFromRegistry()](./docs/api/appkit/Function.executeFromRegistry.md): Validates tool-call arguments against the entry's schema and invokes its
|
|
93
94
|
- [Function: extractServingEndpoints()](./docs/api/appkit/Function.extractServingEndpoints.md): Extract serving endpoint config from a server file by AST-parsing it.
|
|
@@ -198,7 +199,7 @@ npx @databricks/appkit docs <query>
|
|
|
198
199
|
- [Type Alias: SupervisorTool](./docs/api/appkit/TypeAlias.SupervisorTool.md): Tools supported by the Databricks AI Gateway Responses API. The shapes match
|
|
199
200
|
- [Type Alias: ToolRegistry](./docs/api/appkit/TypeAlias.ToolRegistry.md)
|
|
200
201
|
- [Type Alias: ToPlugin()<T, U, N>](./docs/api/appkit/TypeAlias.ToPlugin.md): Factory function type returned by toPlugin(). Accepts optional config and returns a PluginData tuple.
|
|
201
|
-
- [Variable: agents](./docs/api/appkit/Variable.agents.md): Plugin factory for the agents plugin.
|
|
202
|
+
- [Variable: agents](./docs/api/appkit/Variable.agents.md): Plugin factory for the agents plugin. Discovers agents from
|
|
202
203
|
- [Variable: aiSearch](./docs/api/appkit/Variable.aiSearch.md)
|
|
203
204
|
- [Variable: READ_ACTIONS](./docs/api/appkit/Variable.READ_ACTIONS.md): Actions that only read data.
|
|
204
205
|
- [Variable: sql](./docs/api/appkit/Variable.sql.md): SQL helper namespace
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/appkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.65.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"types": "./dist/testing/index.d.ts",
|
|
38
38
|
"default": "./dist/testing/index.js"
|
|
39
39
|
},
|
|
40
|
+
"./tsdown": {
|
|
41
|
+
"types": "./dist/tsdown/index.d.ts",
|
|
42
|
+
"default": "./dist/tsdown/index.js"
|
|
43
|
+
},
|
|
40
44
|
"./package.json": "./package.json"
|
|
41
45
|
},
|
|
42
46
|
"scripts": {
|