@dbx-tools/shared-mastra 0.3.4 → 0.3.6
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 +5 -3
- package/package.json +4 -4
- package/src/routes.ts +10 -8
- package/src/wire.ts +3 -2
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@ selection fields, and Mastra response schemas used by
|
|
|
10
10
|
Key features:
|
|
11
11
|
|
|
12
12
|
- Route constants for the AppKit-Mastra client surface, including history,
|
|
13
|
-
threads, suggestions, model lists,
|
|
13
|
+
threads, suggestions, model lists, the per-agent default-model lookup,
|
|
14
|
+
embeds, and feedback.
|
|
14
15
|
- Header/query/body constants for thread selection and model override requests.
|
|
15
16
|
- Embed-marker parsing for delayed chart and statement-data payloads in
|
|
16
17
|
streaming assistant text.
|
|
@@ -28,7 +29,7 @@ const config = wire.MastraClientConfigSchema.parse(await response.json());
|
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
`wire.MastraClientConfigSchema` describes the plugin-published client config:
|
|
31
|
-
mount path, default agent,
|
|
32
|
+
mount path, default agent, the agent roster, and feedback enablement. Use it to
|
|
32
33
|
bootstrap a UI without hard-coding server paths.
|
|
33
34
|
|
|
34
35
|
## Use Route Constants
|
|
@@ -41,7 +42,8 @@ const threadsUrl = `${basePath}${routes.MASTRA_ROUTES.threads}`;
|
|
|
41
42
|
```
|
|
42
43
|
|
|
43
44
|
`routes.MASTRA_ROUTES` keeps client fetch calls aligned with plugin route names
|
|
44
|
-
for history, threads, models, suggestions, feedback,
|
|
45
|
+
for history, threads, models, the default-model lookup, suggestions, feedback,
|
|
46
|
+
and embeds.
|
|
45
47
|
|
|
46
48
|
## Select Threads And Models
|
|
47
49
|
|
package/package.json
CHANGED
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"zod": "^4.3.6",
|
|
15
|
-
"@dbx-tools/shared-core": "0.3.
|
|
16
|
-
"@dbx-tools/shared-
|
|
17
|
-
"@dbx-tools/shared-
|
|
15
|
+
"@dbx-tools/shared-core": "0.3.6",
|
|
16
|
+
"@dbx-tools/shared-model": "0.3.6",
|
|
17
|
+
"@dbx-tools/shared-genie": "0.3.6"
|
|
18
18
|
},
|
|
19
19
|
"main": "index.ts",
|
|
20
20
|
"license": "UNLICENSED",
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"version": "0.3.
|
|
24
|
+
"version": "0.3.6",
|
|
25
25
|
"types": "index.ts",
|
|
26
26
|
"type": "module",
|
|
27
27
|
"exports": {
|
package/src/routes.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* `@dbx-tools/appkit-mastra-ui`) so a relayout - or a rename of a
|
|
6
6
|
* sub-path - is a one-line change here and the two can never drift.
|
|
7
7
|
*
|
|
8
|
-
* The agent-scoped segments (`history`, `threads`, `suggestions
|
|
9
|
-
* an optional `/:agentId` suffix; the default agent
|
|
10
|
-
* segment. Conversation streaming itself rides the standard Mastra
|
|
8
|
+
* The agent-scoped segments (`history`, `threads`, `suggestions`,
|
|
9
|
+
* `defaultModel`) take an optional `/:agentId` suffix; the default agent
|
|
10
|
+
* uses the bare segment. Conversation streaming itself rides the standard Mastra
|
|
11
11
|
* agent routes (`@mastra/client-js`'s `getAgent(id).stream()`), so
|
|
12
12
|
* there's no chat segment here.
|
|
13
13
|
*
|
|
@@ -22,11 +22,13 @@ export const MASTRA_ROUTES = {
|
|
|
22
22
|
feedback: "/route/feedback",
|
|
23
23
|
suggestions: "/suggestions",
|
|
24
24
|
models: "/models",
|
|
25
|
-
// The serving-endpoint
|
|
26
|
-
// model. Agent-scoped via an
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
25
|
+
// The static serving-endpoint an agent falls back to when the client pins
|
|
26
|
+
// no model. Agent-scoped like `history`/`threads`/`suggestions` via an
|
|
27
|
+
// optional `/:agentId` suffix; the default agent uses the bare segment.
|
|
28
|
+
// Returns `{ agentId, model, displayName }` where `model` and `displayName`
|
|
29
|
+
// are null when the agent resolves its model dynamically at call time
|
|
30
|
+
// (nothing static to advertise). Lets the picker label its default option
|
|
31
|
+
// with the humanized model name.
|
|
30
32
|
defaultModel: "/default-model",
|
|
31
33
|
embed: "/embed",
|
|
32
34
|
} as const;
|
package/src/wire.ts
CHANGED
|
@@ -591,8 +591,9 @@ export type GenieDatasetData = z.infer<typeof GenieDatasetDataSchema>;
|
|
|
591
591
|
*
|
|
592
592
|
* `option` is intentionally NOT included. The resolved Echarts
|
|
593
593
|
* spec lives off-band in the chart cache: the host UI fetches it
|
|
594
|
-
* by `chartId`
|
|
595
|
-
*
|
|
594
|
+
* by `chartId` from the plugin's embed route (derived from
|
|
595
|
+
* `basePath` + {@link MASTRA_ROUTES}.embed, i.e. `/embed/chart/:id`;
|
|
596
|
+
* see {@link Chart}). Embedding the full spec inline would
|
|
596
597
|
* inflate every dataset by several KB per chart and round-trip
|
|
597
598
|
* through the LLM context for zero benefit (the model only needs
|
|
598
599
|
* the `chartId` to place a `[chart:<chartId>]` marker in its
|