@dbx-tools/appkit-mastra 0.1.25 → 0.1.27
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 +115 -303
- package/dist/src/agents.d.ts +10 -0
- package/dist/src/agents.js +15 -2
- package/dist/src/chart.d.ts +131 -79
- package/dist/src/chart.js +386 -279
- package/dist/src/config.d.ts +19 -16
- package/dist/src/genie.d.ts +90 -106
- package/dist/src/genie.js +523 -642
- package/dist/src/intercept.d.ts +48 -0
- package/dist/src/intercept.js +167 -0
- package/dist/src/plugin.d.ts +12 -0
- package/dist/src/plugin.js +185 -1
- package/dist/src/processors/strip-stale-charts.d.ts +16 -13
- package/dist/src/processors/strip-stale-charts.js +16 -13
- package/dist/src/statement.d.ts +73 -0
- package/dist/src/statement.js +118 -0
- package/dist/src/tools/email.js +27 -28
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/agents.ts +16 -2
- package/src/chart.ts +499 -319
- package/src/config.ts +19 -16
- package/src/genie.ts +560 -768
- package/src/intercept.ts +206 -0
- package/src/plugin.ts +210 -2
- package/src/processors/strip-stale-charts.ts +16 -13
- package/src/statement.ts +127 -0
- package/src/tools/email.ts +27 -28
package/package.json
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"name": "@dbx-tools/appkit-mastra",
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.27",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@databricks/sdk-experimental": "^0.17",
|
|
15
|
-
"@dbx-tools/appkit-mastra-shared": "0.1.
|
|
16
|
-
"@dbx-tools/genie": "0.1.
|
|
17
|
-
"@dbx-tools/genie-shared": "0.1.
|
|
18
|
-
"@dbx-tools/shared": "0.1.
|
|
15
|
+
"@dbx-tools/appkit-mastra-shared": "0.1.27",
|
|
16
|
+
"@dbx-tools/genie": "0.1.27",
|
|
17
|
+
"@dbx-tools/genie-shared": "0.1.27",
|
|
18
|
+
"@dbx-tools/shared": "0.1.27",
|
|
19
19
|
"@mastra/ai-sdk": "^1",
|
|
20
20
|
"@mastra/core": "^1",
|
|
21
21
|
"@mastra/express": "^1",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"license": "Apache-2.0",
|
|
47
|
-
"homepage": "https://github.com/reggie-db/dbx-tools-
|
|
47
|
+
"homepage": "https://github.com/reggie-db/dbx-tools-js#readme",
|
|
48
48
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/reggie-db/dbx-tools-
|
|
49
|
+
"url": "https://github.com/reggie-db/dbx-tools-js/issues"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
53
|
-
"url": "git+https://github.com/reggie-db/dbx-tools-
|
|
53
|
+
"url": "git+https://github.com/reggie-db/dbx-tools-js.git",
|
|
54
54
|
"directory": "packages/appkit-mastra"
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/agents.ts
CHANGED
|
@@ -20,12 +20,12 @@ import { createTool } from "@mastra/core/tools";
|
|
|
20
20
|
import type { Tool } from "@mastra/core/tools";
|
|
21
21
|
import type { PgVectorConfig, PostgresStoreConfig } from "@mastra/pg";
|
|
22
22
|
|
|
23
|
-
import { buildRenderDataTool } from "./chart.js";
|
|
24
23
|
import type { MastraPluginConfig } from "./config.js";
|
|
25
24
|
import { buildGenieToolkitProvider, resolveGenieSpaces } from "./genie.js";
|
|
26
25
|
import type { MemoryBuilder } from "./memory.js";
|
|
27
26
|
import { buildModel, FALLBACK_MODEL_IDS } from "./model.js";
|
|
28
27
|
import { stripStaleChartsProcessor } from "./processors/strip-stale-charts.js";
|
|
28
|
+
import { buildRenderDataTool } from "./chart.js";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Tool record accepted by every Mastra `Agent.tools` field and by the
|
|
@@ -323,6 +323,17 @@ export interface BuiltAgents {
|
|
|
323
323
|
/** Fallback agent id used when `config.agents` is omitted entirely. */
|
|
324
324
|
export const FALLBACK_AGENT_ID = "default";
|
|
325
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Default per-turn step ceiling applied to every registered agent
|
|
328
|
+
* when {@link MastraPluginConfig.agentMaxSteps} is unset. Sized to
|
|
329
|
+
* fit a decomposed Genie turn (grounding + several `ask_genie`
|
|
330
|
+
* calls + `prepare_chart` per dataset + the final-text reply) with
|
|
331
|
+
* headroom for the model to chain a couple of follow-ups before
|
|
332
|
+
* answering - well above Mastra's own `agent.generate` default of
|
|
333
|
+
* 5, which would cut multi-step orchestration off mid-loop.
|
|
334
|
+
*/
|
|
335
|
+
export const DEFAULT_AGENT_MAX_STEPS = 25;
|
|
336
|
+
|
|
326
337
|
const FALLBACK_AGENT_INSTRUCTIONS = `You are a data analyst. The user will ask questions about
|
|
327
338
|
business metrics and may share personal preferences you should remember across turns.
|
|
328
339
|
|
|
@@ -420,7 +431,7 @@ export async function buildAgents(opts: {
|
|
|
420
431
|
const style = resolveStyleInstructions(config);
|
|
421
432
|
// Default-on protection against the model copying turn-scoped
|
|
422
433
|
// chartIds from prior assistant tool results into the new
|
|
423
|
-
// turn's `[
|
|
434
|
+
// turn's `[chart:<id>]` markers. Opt out per-plugin via
|
|
424
435
|
// `config.stripStaleCharts: false`.
|
|
425
436
|
const inputProcessors =
|
|
426
437
|
config.stripStaleCharts === false ? [] : [stripStaleChartsProcessor];
|
|
@@ -435,6 +446,9 @@ export async function buildAgents(opts: {
|
|
|
435
446
|
...(def.description !== undefined ? { description: def.description } : {}),
|
|
436
447
|
instructions: composeInstructions(def.instructions, style),
|
|
437
448
|
model: resolveModel(config, def.model),
|
|
449
|
+
defaultOptions: {
|
|
450
|
+
maxSteps: config.agentMaxSteps ?? DEFAULT_AGENT_MAX_STEPS,
|
|
451
|
+
},
|
|
438
452
|
tools,
|
|
439
453
|
...(memory ? { memory } : {}),
|
|
440
454
|
...(inputProcessors.length > 0 ? { inputProcessors } : {}),
|