@dbx-tools/appkit-mastra 0.1.5 → 0.1.10
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/README.md +394 -0
- package/index.ts +46 -37
- package/package.json +58 -47
- package/src/agents.ts +233 -62
- package/src/chart.ts +555 -285
- package/src/config.ts +282 -18
- package/src/filesystems.ts +1090 -0
- package/src/genie.ts +1004 -601
- package/src/history.ts +178 -79
- package/src/mcp.ts +105 -0
- package/src/memory.ts +129 -74
- package/src/mlflow.ts +149 -0
- package/src/model.ts +80 -408
- package/src/observability.ts +144 -0
- package/src/pagination.ts +34 -0
- package/src/plugin.ts +573 -59
- package/src/processors.ts +168 -0
- package/src/rest.ts +67 -0
- package/src/server.ts +243 -45
- package/src/serving-sanitize.ts +167 -0
- package/src/serving.ts +27 -224
- package/src/statement.ts +89 -0
- package/src/storage-schema.ts +41 -0
- package/src/summarize.ts +176 -0
- package/src/threads.ts +338 -0
- package/src/workspaces.ts +346 -0
- package/src/writer.ts +44 -0
- package/tsconfig.json +41 -0
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -19
- package/dist/src/agents.d.ts +0 -306
- package/dist/src/agents.js +0 -393
- package/dist/src/chart.d.ts +0 -104
- package/dist/src/chart.js +0 -375
- package/dist/src/config.d.ts +0 -170
- package/dist/src/config.js +0 -12
- package/dist/src/genie.d.ts +0 -116
- package/dist/src/genie.js +0 -594
- package/dist/src/history.d.ts +0 -67
- package/dist/src/history.js +0 -158
- package/dist/src/memory.d.ts +0 -79
- package/dist/src/memory.js +0 -197
- package/dist/src/model.d.ts +0 -159
- package/dist/src/model.js +0 -423
- package/dist/src/plugin.d.ts +0 -130
- package/dist/src/plugin.js +0 -255
- package/dist/src/render-chart-route.d.ts +0 -33
- package/dist/src/render-chart-route.js +0 -120
- package/dist/src/server.d.ts +0 -46
- package/dist/src/server.js +0 -113
- package/dist/src/serving.d.ts +0 -156
- package/dist/src/serving.js +0 -214
- package/src/render-chart-route.ts +0 -141
package/README.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# @dbx-tools/node-appkit-mastra
|
|
2
|
+
|
|
3
|
+
AppKit plugin and server-side toolkit for hosting Mastra agents inside a
|
|
4
|
+
Databricks App.
|
|
5
|
+
|
|
6
|
+
Import this package when an AppKit backend needs an agent service with
|
|
7
|
+
Databricks on-behalf-of auth, optional Lakebase-backed memory, Databricks Genie
|
|
8
|
+
tools, model selection, chart/data embeds, MLflow feedback, and MCP exposure.
|
|
9
|
+
The package mounts the standard Mastra agent stream under the AppKit server, so
|
|
10
|
+
clients can use Mastra-compatible chat transports instead of a custom protocol.
|
|
11
|
+
|
|
12
|
+
Key features:
|
|
13
|
+
|
|
14
|
+
- AppKit plugin lifecycle integration: routes, setup, shutdown, sibling plugin
|
|
15
|
+
access, and AppKit request context are handled inside `plugin.mastra()`.
|
|
16
|
+
- Agent composition: define one or more Mastra agents, give each one local tools,
|
|
17
|
+
AppKit plugin toolkits, workspace skills, model defaults, and approval-gated
|
|
18
|
+
tools.
|
|
19
|
+
- Databricks execution model: tool calls run with the active AppKit OBO client
|
|
20
|
+
where available, while storage and background work use service-principal
|
|
21
|
+
connections.
|
|
22
|
+
- Durable conversations: Lakebase-backed Mastra storage provides thread
|
|
23
|
+
history, message persistence, and optional vector memory.
|
|
24
|
+
- Rich data answers: Genie tools, statement fetches, chart preparation, and
|
|
25
|
+
embed markers let an agent answer with text plus delayed chart/table payloads.
|
|
26
|
+
- Operational surfaces: model-list routes, feedback routes, MCP exposure,
|
|
27
|
+
scoped API gating, tracing, and MLflow feedback are bundled with the plugin.
|
|
28
|
+
|
|
29
|
+
## Why Not Just AppKit Agents?
|
|
30
|
+
|
|
31
|
+
Native AppKit includes a beta Agents plugin with markdown and TypeScript agent
|
|
32
|
+
definitions, AppKit tool-provider integration, streaming chat, thread
|
|
33
|
+
management, cancellation, and HITL approval. Use it when you want the AppKit
|
|
34
|
+
agent model and do not need a separate agent framework.
|
|
35
|
+
|
|
36
|
+
Use this package when you specifically want Mastra inside AppKit:
|
|
37
|
+
|
|
38
|
+
- Mastra's larger plugin/tool ecosystem, MCP support, memory/storage model,
|
|
39
|
+
workflow primitives, and `@mastra/client-js` stream shape.
|
|
40
|
+
- AppKit toolkits as Mastra tools, so Analytics, Files, Genie, and other AppKit
|
|
41
|
+
ToolProvider plugins stay available without rewriting them.
|
|
42
|
+
- Genie as an agent tool that emits typed progress events, result metadata, and
|
|
43
|
+
delayed chart/data markers into the same assistant turn.
|
|
44
|
+
- A paired React client in [`@dbx-tools/ui-mastra`](../../ui/mastra) with model
|
|
45
|
+
picking, thread sidebar, approvals, feedback, exports, and inline embeds.
|
|
46
|
+
- Per-request model override and fuzzy endpoint resolution through
|
|
47
|
+
[`@dbx-tools/node-model`](../model), instead of binding every agent to a fixed
|
|
48
|
+
endpoint name.
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { analytics, createApp, lakebase, server } from "@databricks/appkit";
|
|
54
|
+
import { agents, genie, plugin } from "@dbx-tools/node-appkit-mastra";
|
|
55
|
+
import { z } from "zod";
|
|
56
|
+
|
|
57
|
+
const analyst = agents.createAgent({
|
|
58
|
+
name: "analyst",
|
|
59
|
+
instructions: ["You answer questions about workspace data.", genie.GENIE_INSTRUCTIONS].join(
|
|
60
|
+
"\n\n",
|
|
61
|
+
),
|
|
62
|
+
tools(plugins) {
|
|
63
|
+
return {
|
|
64
|
+
...plugins.analytics.toolkit(),
|
|
65
|
+
...plugins.genie?.toolkit(),
|
|
66
|
+
get_weather: agents.tool({
|
|
67
|
+
description: "Get a simple weather report.",
|
|
68
|
+
schema: z.object({ city: z.string() }),
|
|
69
|
+
execute: async ({ city }) => `Sunny in ${city}`,
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
await createApp({
|
|
76
|
+
plugins: [
|
|
77
|
+
server(),
|
|
78
|
+
analytics(),
|
|
79
|
+
lakebase(),
|
|
80
|
+
plugin.mastra({
|
|
81
|
+
agents: { analyst },
|
|
82
|
+
defaultAgent: "analyst",
|
|
83
|
+
genie: { spaces: { sales: "01ef..." } },
|
|
84
|
+
}),
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Benefits of importing the package:
|
|
90
|
+
|
|
91
|
+
- `plugin.mastra()` registers a full AppKit plugin named `mastra`.
|
|
92
|
+
- `agents.createAgent()` keeps agent definitions typed and applies the default
|
|
93
|
+
Databricks workspace/skill mounts.
|
|
94
|
+
- `agents.tool()` lets the same AppKit-shaped tool body work in this Mastra
|
|
95
|
+
plugin.
|
|
96
|
+
- `genie.GENIE_INSTRUCTIONS` and `plugins.genie.toolkit()` give agents a
|
|
97
|
+
Databricks Genie workflow without embedding a second agent.
|
|
98
|
+
- Lakebase registration automatically enables durable thread storage and vector
|
|
99
|
+
memory unless you opt out.
|
|
100
|
+
|
|
101
|
+
## Agent Registration
|
|
102
|
+
|
|
103
|
+
`plugin.mastra({ agents })` accepts a single definition, an array, or a record.
|
|
104
|
+
Records are best when clients need stable agent ids:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
plugin.mastra({
|
|
108
|
+
agents: {
|
|
109
|
+
support: agents.createAgent({ instructions: "Answer support questions." }),
|
|
110
|
+
analyst: agents.createAgent({ instructions: "Analyze workspace data." }),
|
|
111
|
+
},
|
|
112
|
+
defaultAgent: "support",
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
When no agents are supplied, the plugin registers a built-in `default` analyst so
|
|
117
|
+
the route surface still works for smoke tests. Each agent is streamed through the
|
|
118
|
+
Mastra agent API mounted below the plugin path, typically `/api/mastra`.
|
|
119
|
+
|
|
120
|
+
Use `agents.createTool` when you need Mastra-native fields such as
|
|
121
|
+
`outputSchema`, `suspendSchema`, `requireApproval`, or MCP metadata. Use
|
|
122
|
+
`agents.tool` for the smaller AppKit-compatible shape:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
const approveRefund = agents.createTool({
|
|
126
|
+
id: "approve_refund",
|
|
127
|
+
description: "Approve a refund request.",
|
|
128
|
+
inputSchema: z.object({ orderId: z.string(), amount: z.number() }),
|
|
129
|
+
requireApproval: true,
|
|
130
|
+
execute: async ({ context }) => approve(context.orderId, context.amount),
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## AppKit Toolkits
|
|
135
|
+
|
|
136
|
+
The `tools(plugins)` callback receives a dynamic index of registered AppKit
|
|
137
|
+
tool-provider plugins. Each entry exposes `.toolkit(opts)` with AppKit-compatible
|
|
138
|
+
`prefix`, `only`, `except`, and `rename` options.
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
const agent = agents.createAgent({
|
|
142
|
+
instructions: "Use the narrowest tool that answers the question.",
|
|
143
|
+
tools(plugins) {
|
|
144
|
+
return {
|
|
145
|
+
...plugins.analytics.toolkit({ only: ["query"] }),
|
|
146
|
+
...plugins.files?.toolkit({ prefix: "files.", except: ["delete"] }),
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Tool calls dispatch back through the owning AppKit plugin, preserving OBO auth
|
|
153
|
+
and AppKit telemetry behavior. Optional plugins should be guarded with `?.` when
|
|
154
|
+
you spread their tools.
|
|
155
|
+
|
|
156
|
+
## Memory And Storage
|
|
157
|
+
|
|
158
|
+
The `memory` and `storage` config fields can be `false`, `true`, or a concrete
|
|
159
|
+
Mastra Postgres/PgVector config.
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
plugin.mastra({
|
|
163
|
+
agents: analyst,
|
|
164
|
+
storage: true,
|
|
165
|
+
memory: { id: "analytics_memory", tableName: "agent_memory" },
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
With `lakebase()` registered, both default to enabled:
|
|
170
|
+
|
|
171
|
+
- storage uses a per-agent schema for durable threads and messages;
|
|
172
|
+
- memory uses a shared vector index for semantic recall;
|
|
173
|
+
- the service-principal pool is created outside any request so OBO user
|
|
174
|
+
identities are not captured in background storage work.
|
|
175
|
+
|
|
176
|
+
Without `lakebase()`, agents are stateless unless you provide explicit storage
|
|
177
|
+
and memory configs.
|
|
178
|
+
|
|
179
|
+
## Workspace Skills
|
|
180
|
+
|
|
181
|
+
Every `agents.createAgent()` gets a default Mastra `Workspace` from
|
|
182
|
+
`workspaces.createWorkspace()`. It mounts Databricks Workspace files through the
|
|
183
|
+
current OBO user's `WorkspaceClient`, so Mastra can discover Assistant-style
|
|
184
|
+
`SKILL.md` files at request time.
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
const agent = agents.createAgent({
|
|
188
|
+
instructions: "Use mounted workspace skills when relevant.",
|
|
189
|
+
workspace: workspaces.createWorkspace({
|
|
190
|
+
assistantSkills: true,
|
|
191
|
+
mounts: [
|
|
192
|
+
async () => ({
|
|
193
|
+
mounts: { "/reference": myFilesystem },
|
|
194
|
+
skillPaths: ["/reference/skills"],
|
|
195
|
+
}),
|
|
196
|
+
],
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Production workspace mounts require a forwarded token with `workspace`,
|
|
202
|
+
`workspace.workspace`, or `all-apis` scope. Development mode skips that gate for
|
|
203
|
+
local iteration.
|
|
204
|
+
|
|
205
|
+
## Genie Tools
|
|
206
|
+
|
|
207
|
+
`genie.buildGenieTools()` and `plugins.genie.toolkit()` expose tools for:
|
|
208
|
+
|
|
209
|
+
- asking a configured Genie space;
|
|
210
|
+
- reading space descriptions and serialized space metadata;
|
|
211
|
+
- fetching statement rows by `statement_id`;
|
|
212
|
+
- preparing charts from Genie result sets.
|
|
213
|
+
|
|
214
|
+
The central agent drives those tools directly. Genie events stream through the
|
|
215
|
+
Mastra writer using the shared contract from
|
|
216
|
+
[`@dbx-tools/shared-mastra`](../../shared/mastra), so clients can show thinking,
|
|
217
|
+
SQL, row counts, summaries, chart markers, and data markers as the turn runs.
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
const agent = agents.createAgent({
|
|
221
|
+
instructions: `${baseInstructions}\n\n${genie.GENIE_INSTRUCTIONS}`,
|
|
222
|
+
tools(plugins) {
|
|
223
|
+
return { ...plugins.genie?.toolkit({ prefix: "" }) };
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Charts And Data Embeds
|
|
229
|
+
|
|
230
|
+
`chart.prepareChart()` mints a chart id immediately, caches an in-progress
|
|
231
|
+
record, resolves the data in the background, and stores a terminal chart or
|
|
232
|
+
error. `chart.fetchChart()` long-polls that cache for route handlers and custom
|
|
233
|
+
clients.
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
const { chartId } = await chart.prepareChart({
|
|
237
|
+
config,
|
|
238
|
+
request: {
|
|
239
|
+
title: "Revenue by region",
|
|
240
|
+
chartType: "bar",
|
|
241
|
+
instructions: "Compare total revenue by region.",
|
|
242
|
+
data: rows,
|
|
243
|
+
},
|
|
244
|
+
resolveData: async () => rows,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const resolved = await chart.fetchChart(chartId);
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Agents can return `[chart:<id>]` and `[data:<statement_id>]` markers in prose.
|
|
251
|
+
The embed route resolves them later, which avoids forcing the language model to
|
|
252
|
+
inline large tables or wait for chart planning before continuing its answer.
|
|
253
|
+
|
|
254
|
+
## Model Selection
|
|
255
|
+
|
|
256
|
+
`model.buildModel()` adapts the generic resolver from
|
|
257
|
+
[`@dbx-tools/node-model`](../model) to Mastra. It resolves the model per request,
|
|
258
|
+
so OBO identity and request-specific overrides stay isolated.
|
|
259
|
+
|
|
260
|
+
Model priority is:
|
|
261
|
+
|
|
262
|
+
1. request override (`X-Mastra-Model`, `?model=`, body `model` / `modelId`);
|
|
263
|
+
2. per-agent `model`;
|
|
264
|
+
3. plugin `defaultModel`;
|
|
265
|
+
4. `DATABRICKS_SERVING_ENDPOINT_NAME`;
|
|
266
|
+
5. workspace catalogue ranking and static fallback floor.
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
plugin.mastra({
|
|
270
|
+
agents: analyst,
|
|
271
|
+
defaultModel: "claude sonnet",
|
|
272
|
+
modelFuzzyMatch: true,
|
|
273
|
+
modelOverride: true,
|
|
274
|
+
});
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Use `serving.extractModelOverride()` and `serving.resolveServingConfig()` when
|
|
278
|
+
building custom routes that should behave like the plugin's `/models` and stream
|
|
279
|
+
routes.
|
|
280
|
+
|
|
281
|
+
## Threads, History, And Suggestions
|
|
282
|
+
|
|
283
|
+
When storage is enabled, the plugin provides route helpers and in-process
|
|
284
|
+
functions for conversation management:
|
|
285
|
+
|
|
286
|
+
- `history.loadHistory()` and `history.clearHistory()` read or clear one thread;
|
|
287
|
+
- `threads.listThreads()`, `threads.renameThread()`, and
|
|
288
|
+
`threads.deleteThread()` operate on the caller's scoped conversations;
|
|
289
|
+
- `genie.collectSpaceSuggestions()` reads starter questions from the configured
|
|
290
|
+
Genie space.
|
|
291
|
+
|
|
292
|
+
The plugin resolves the active thread from `x-mastra-thread-id`, `?threadId=`,
|
|
293
|
+
or a per-session fallback cookie. That keeps streaming, history, and clear
|
|
294
|
+
operations aligned around the same conversation id.
|
|
295
|
+
|
|
296
|
+
## Feedback And Observability
|
|
297
|
+
|
|
298
|
+
`observability.buildObservability()` wires Mastra tracing when OTLP export is
|
|
299
|
+
configured. `mlflow.resolveFeedbackEnabled()` turns MLflow feedback on when both
|
|
300
|
+
trace export and an MLflow experiment are configured, unless the plugin config
|
|
301
|
+
forces a value.
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
plugin.mastra({
|
|
305
|
+
agents: analyst,
|
|
306
|
+
feedback: true,
|
|
307
|
+
});
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
`mlflow.logFeedback()` logs a human assessment against the active MLflow trace.
|
|
311
|
+
The response header name and request/response schemas live in
|
|
312
|
+
[`@dbx-tools/shared-mastra`](../../shared/mastra).
|
|
313
|
+
|
|
314
|
+
## MCP Exposure
|
|
315
|
+
|
|
316
|
+
`mcp.buildMcpServer()` exposes registered agents as MCP tools by default. The
|
|
317
|
+
AppKit plugin publishes clean aliases under its base path:
|
|
318
|
+
|
|
319
|
+
```ts
|
|
320
|
+
plugin.mastra({
|
|
321
|
+
agents: analyst,
|
|
322
|
+
mcp: {
|
|
323
|
+
serverId: "analytics",
|
|
324
|
+
name: "Analytics MCP",
|
|
325
|
+
tools: false,
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Use `mcp: false` to disable MCP. Turn on `tools: true` only for ambient tools
|
|
331
|
+
that are safe outside an in-process chat turn.
|
|
332
|
+
|
|
333
|
+
## API Gate
|
|
334
|
+
|
|
335
|
+
The stock `@mastra/express` app has broad management routes. The plugin's
|
|
336
|
+
default `apiAccess: "scoped"` allows only the chat, read-only metadata,
|
|
337
|
+
plugin-owned `/route/*`, embed, model, suggestion, and MCP surfaces that the
|
|
338
|
+
client needs. Use `apiAccess: "full"` only for a trusted first-party console.
|
|
339
|
+
|
|
340
|
+
`server.isMastraRequestAllowed()` is exported for tests and custom dispatch
|
|
341
|
+
logic that need the same allowlist.
|
|
342
|
+
|
|
343
|
+
## Configuration Reference
|
|
344
|
+
|
|
345
|
+
The plugin config is intentionally centered on the AppKit lifecycle instead of
|
|
346
|
+
requiring callers to assemble a Mastra server by hand.
|
|
347
|
+
|
|
348
|
+
- `agents` registers a single agent, an array, or a record keyed by stable agent
|
|
349
|
+
ids. Records are best for UIs because the ids become route-visible.
|
|
350
|
+
- `defaultAgent` controls which registered agent handles requests that do not
|
|
351
|
+
name an agent explicitly.
|
|
352
|
+
- `storage` and `memory` accept `true`, `false`, or concrete Mastra Postgres /
|
|
353
|
+
PgVector options. `true` resolves from `lakebase()` when present.
|
|
354
|
+
- `genie.spaces` maps aliases to Genie Space IDs. Those aliases flow into tools,
|
|
355
|
+
suggestions, and chart/data workflows.
|
|
356
|
+
- `defaultModel`, `modelOverride`, and `modelFuzzyMatch` control how loose model
|
|
357
|
+
names are resolved through Databricks Model Serving.
|
|
358
|
+
- `feedback` controls whether MLflow feedback routes are exposed. The automatic
|
|
359
|
+
mode enables feedback when tracing and an MLflow experiment are configured.
|
|
360
|
+
- `mcp` controls whether agents are exposed as MCP tools and how that server is
|
|
361
|
+
named.
|
|
362
|
+
- `apiAccess` chooses the route allowlist. Keep the default scoped mode for
|
|
363
|
+
deployed apps.
|
|
364
|
+
|
|
365
|
+
Use this package when you want an AppKit-native agent runtime. Use the shared
|
|
366
|
+
schemas in [`@dbx-tools/shared-mastra`](../../shared/mastra) when building a
|
|
367
|
+
client that talks to these routes.
|
|
368
|
+
|
|
369
|
+
## Modules
|
|
370
|
+
|
|
371
|
+
- `plugin` - `MastraPlugin` and `mastra()` AppKit plugin factory.
|
|
372
|
+
- `agents` - `createAgent`, `tool`, `createTool`, agent build helpers, fallback
|
|
373
|
+
defaults, and approval-gated tool inspection.
|
|
374
|
+
- `config` - plugin config types and RequestContext key constants.
|
|
375
|
+
- `model` / `serving` / `servingSanitize` - Mastra model config, request
|
|
376
|
+
overrides, serving-endpoint config, and request-body cleanup.
|
|
377
|
+
- `genie` - Genie prompt, space normalization, Genie toolkits, and suggestions.
|
|
378
|
+
- `chart` / `statement` / `writer` - chart cache, statement row fetches, and
|
|
379
|
+
safe writer events.
|
|
380
|
+
- `history` / `threads` / `pagination` - conversation persistence helpers and
|
|
381
|
+
route handlers.
|
|
382
|
+
- `memory` / `storageSchema` - Lakebase-backed Mastra store/vector setup.
|
|
383
|
+
- `workspaces` / `filesystems` - Mastra workspace creation and Databricks
|
|
384
|
+
Workspace file adapters.
|
|
385
|
+
- `mcp` - MCP server construction.
|
|
386
|
+
- `observability` / `mlflow` - tracing and feedback.
|
|
387
|
+
- `server` / `rest` / `processors` - Express dispatch, Databricks REST helpers,
|
|
388
|
+
stream/result processors.
|
|
389
|
+
|
|
390
|
+
Browser-facing wire types are in
|
|
391
|
+
[`@dbx-tools/shared-mastra`](../../shared/mastra). Genie event contracts are in
|
|
392
|
+
[`@dbx-tools/shared-genie`](../../shared/genie). Model request/result contracts
|
|
393
|
+
are in [`@dbx-tools/shared-model`](../../shared/model). The matching React chat
|
|
394
|
+
surface is [`@dbx-tools/ui-mastra`](../../ui/mastra).
|
package/index.ts
CHANGED
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
export * from "./src/
|
|
13
|
-
export * from "
|
|
14
|
-
export * from "./src/
|
|
15
|
-
export * from "./src/
|
|
16
|
-
export * from "./src/
|
|
17
|
-
export * from "./src/
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from "./src/
|
|
31
|
-
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} from "./src/model
|
|
1
|
+
// GENERATED by projen watch - DO NOT EDIT.
|
|
2
|
+
// Regenerated from the exporting modules in ./src.
|
|
3
|
+
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
|
+
|
|
5
|
+
export * as agents from "./src/agents";
|
|
6
|
+
export * as chart from "./src/chart";
|
|
7
|
+
export * as config from "./src/config";
|
|
8
|
+
export * as filesystems from "./src/filesystems";
|
|
9
|
+
export * as genie from "./src/genie";
|
|
10
|
+
export * as history from "./src/history";
|
|
11
|
+
export * as mcp from "./src/mcp";
|
|
12
|
+
export * as memory from "./src/memory";
|
|
13
|
+
export * as mlflow from "./src/mlflow";
|
|
14
|
+
export * as model from "./src/model";
|
|
15
|
+
export * as observability from "./src/observability";
|
|
16
|
+
export * as pagination from "./src/pagination";
|
|
17
|
+
export * as plugin from "./src/plugin";
|
|
18
|
+
export * as processors from "./src/processors";
|
|
19
|
+
export * as rest from "./src/rest";
|
|
20
|
+
export * as server from "./src/server";
|
|
21
|
+
export * as serving from "./src/serving";
|
|
22
|
+
export * as servingSanitize from "./src/serving-sanitize";
|
|
23
|
+
export * as statement from "./src/statement";
|
|
24
|
+
export * as storageSchema from "./src/storage-schema";
|
|
25
|
+
export * as summarize from "./src/summarize";
|
|
26
|
+
export * as threads from "./src/threads";
|
|
27
|
+
export * as workspaces from "./src/workspaces";
|
|
28
|
+
export * as writer from "./src/writer";
|
|
29
|
+
export type { MastraTools, AppKitToolOptions, ToolkitOptions, MastraPluginToolkitProvider, MastraPlugins, MastraToolsFn, MastraAgentWorkspaceResolver, MastraAgentDefinition, MastraStorageConfigOverride, MastraMemoryConfigOverride, BuiltAgents } from "./src/agents";
|
|
30
|
+
export type { ChartPlannerRequest, PrepareChartOptions, FetchChartOptions } from "./src/chart";
|
|
31
|
+
export type { User, MastraMemoryConfig, MastraMcpConfig, MastraPluginConfig } from "./src/config";
|
|
32
|
+
export type { DatabricksMkdirsMode, DatabricksWorkspaceFilesystemOptions } from "./src/filesystems";
|
|
33
|
+
export type { GenieSpaceConfig, GenieSpacesConfig } from "./src/genie";
|
|
34
|
+
export type { LoadHistoryOptions, ClearHistoryOptions, HistoryRouteOptions } from "./src/history";
|
|
35
|
+
export type { ResolvedMcp } from "./src/mcp";
|
|
36
|
+
export type { LogFeedbackParams } from "./src/mlflow";
|
|
37
|
+
export type { BuildModelOverrides } from "./src/model";
|
|
38
|
+
export type { BuildObservabilityOptions } from "./src/observability";
|
|
39
|
+
export type { PerPageBounds } from "./src/pagination";
|
|
40
|
+
export type { DatabricksFetchInit } from "./src/rest";
|
|
41
|
+
export type { MastraApiGateOptions } from "./src/server";
|
|
42
|
+
export type { ModelOverrideRequest } from "./src/serving";
|
|
43
|
+
export type { ServingChatMessage } from "./src/serving-sanitize";
|
|
44
|
+
export type { SummarizeOptions } from "./src/summarize";
|
|
45
|
+
export type { ListThreadsOptions, DeleteThreadOptions, RenameThreadOptions, ThreadsRouteOptions } from "./src/threads";
|
|
46
|
+
export type { CreateWorkspaceOptions } from "./src/workspaces";
|
package/package.json
CHANGED
|
@@ -1,55 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"types": "dist/index.d.ts",
|
|
4
|
-
"exports": {
|
|
5
|
-
".": {
|
|
6
|
-
"source": "./index.ts",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"default": "./dist/index.js"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"index.ts",
|
|
14
|
-
"src"
|
|
15
|
-
],
|
|
16
|
-
"license": "Apache-2.0",
|
|
17
|
-
"homepage": "https://github.com/reggie-db/dbx-tools-appkit#readme",
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/reggie-db/dbx-tools-appkit/issues"
|
|
20
|
-
},
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"registry": "https://registry.npmjs.org/",
|
|
23
|
-
"access": "public"
|
|
24
|
-
},
|
|
2
|
+
"name": "@dbx-tools/appkit-mastra",
|
|
25
3
|
"repository": {
|
|
26
4
|
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/reggie-db/dbx-tools
|
|
28
|
-
"directory": "
|
|
5
|
+
"url": "git+https://github.com/reggie-db/dbx-tools.git",
|
|
6
|
+
"directory": "workspaces/node/appkit-mastra"
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@types/express": "^5.0.5",
|
|
10
|
+
"@types/node": "^24.6.0",
|
|
11
|
+
"@types/pg": "^8",
|
|
12
|
+
"tsx": "^4.23.0",
|
|
13
|
+
"typescript": "^5.9.3"
|
|
29
14
|
},
|
|
30
|
-
"name": "@dbx-tools/appkit-mastra",
|
|
31
|
-
"version": "0.1.5",
|
|
32
|
-
"module": "index.ts",
|
|
33
|
-
"type": "module",
|
|
34
15
|
"dependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@mastra/ai-sdk": "^1.
|
|
38
|
-
"@mastra/core": "^1.
|
|
39
|
-
"@mastra/express": "^1.
|
|
40
|
-
"@mastra/fastembed": "^1.0",
|
|
41
|
-
"@mastra/
|
|
42
|
-
"@mastra/
|
|
43
|
-
"
|
|
44
|
-
"
|
|
16
|
+
"@databricks/appkit": "^0.43.0",
|
|
17
|
+
"@databricks/sdk-experimental": "^0.17.0",
|
|
18
|
+
"@mastra/ai-sdk": "^1.6.0",
|
|
19
|
+
"@mastra/core": "^1.47.0",
|
|
20
|
+
"@mastra/express": "^1.4.2",
|
|
21
|
+
"@mastra/fastembed": "^1.2.0",
|
|
22
|
+
"@mastra/mcp": "^1.12.0",
|
|
23
|
+
"@mastra/memory": "^1.21.2",
|
|
24
|
+
"@mastra/observability": "^1.15.2",
|
|
25
|
+
"@mastra/otel-bridge": "^1.4.0",
|
|
26
|
+
"@mastra/pg": "^1.14.2",
|
|
27
|
+
"@opentelemetry/api": "^1.9.1",
|
|
28
|
+
"pg": "^8.22.0",
|
|
29
|
+
"zod": "^4.3.6",
|
|
30
|
+
"@dbx-tools/appkit": "0.1.10",
|
|
31
|
+
"@dbx-tools/core": "0.1.10",
|
|
32
|
+
"@dbx-tools/genie": "0.1.10",
|
|
33
|
+
"@dbx-tools/databricks": "0.1.10",
|
|
34
|
+
"@dbx-tools/model": "0.1.10",
|
|
35
|
+
"@dbx-tools/shared-core": "0.1.10",
|
|
36
|
+
"@dbx-tools/shared-genie": "0.1.10",
|
|
37
|
+
"@dbx-tools/shared-mastra": "0.1.10",
|
|
38
|
+
"@dbx-tools/shared-model": "0.1.10"
|
|
45
39
|
},
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
"main": "index.ts",
|
|
41
|
+
"license": "UNLICENSED",
|
|
42
|
+
"version": "0.1.10",
|
|
43
|
+
"types": "index.ts",
|
|
44
|
+
"type": "module",
|
|
45
|
+
"exports": {
|
|
46
|
+
".": "./index.ts",
|
|
47
|
+
"./package.json": "./package.json"
|
|
49
48
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
"dbxToolsConfig": {
|
|
50
|
+
"tags": [
|
|
51
|
+
"node"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\".",
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "projen build",
|
|
57
|
+
"compile": "projen compile",
|
|
58
|
+
"default": "projen default",
|
|
59
|
+
"package": "projen package",
|
|
60
|
+
"post-compile": "projen post-compile",
|
|
61
|
+
"pre-compile": "projen pre-compile",
|
|
62
|
+
"test": "projen test",
|
|
63
|
+
"watch": "projen watch",
|
|
64
|
+
"projen": "projen"
|
|
54
65
|
}
|
|
55
|
-
}
|
|
66
|
+
}
|