@dbx-tools/appkit-mastra 0.1.93 → 0.1.94
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/dist/index.d.ts +14 -1
- package/dist/index.js +6 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { Memory } from "@mastra/memory";
|
|
|
17
17
|
import { PgVectorConfig, PostgresStore, PostgresStoreConfig } from "@mastra/pg";
|
|
18
18
|
import { Pool } from "pg";
|
|
19
19
|
import { MastraServer } from "@mastra/express";
|
|
20
|
+
import { Workspace } from "@mastra/core/workspace";
|
|
20
21
|
import * as _mastra_core_workflows0 from "@mastra/core/workflows";
|
|
21
22
|
import * as _mastra_core_vector0 from "@mastra/core/vector";
|
|
22
23
|
import * as _mastra_core_tts0 from "@mastra/core/tts";
|
|
@@ -764,6 +765,8 @@ interface MastraPluginToolkitProvider {
|
|
|
764
765
|
type MastraPlugins = Record<string, MastraPluginToolkitProvider>;
|
|
765
766
|
/** Function form of {@link MastraAgentDefinition.tools}. */
|
|
766
767
|
type MastraToolsFn = (plugins: MastraPlugins) => MastraTools | Promise<MastraTools>;
|
|
768
|
+
/** Function form of {@link MastraAgentDefinition.workspace}. */
|
|
769
|
+
type MastraAgentWorkspaceResolver = () => Workspace | undefined;
|
|
767
770
|
/**
|
|
768
771
|
* A code-defined Mastra agent. Mirrors the shape AppKit's `agents`
|
|
769
772
|
* plugin uses for `AgentDefinition`. The registry key under
|
|
@@ -825,6 +828,16 @@ interface MastraAgentDefinition {
|
|
|
825
828
|
* `PostgresStore` config (custom schema, connection, etc.).
|
|
826
829
|
*/
|
|
827
830
|
storage?: boolean | MastraStorageConfigOverride;
|
|
831
|
+
/**
|
|
832
|
+
* Mastra {@link Workspace} for this agent. When it exposes skills,
|
|
833
|
+
* Mastra injects `<available_skills>` metadata each turn and mounts
|
|
834
|
+
* `skill` / `skill_search` / `skill_read` at runtime.
|
|
835
|
+
*
|
|
836
|
+
* Use a zero-arg function so resolution happens at agent registration
|
|
837
|
+
* (for example `skillWorkspace` from `@dbx-tools/appkit-skills`
|
|
838
|
+
* after `aiDevKit()` has primed the cache).
|
|
839
|
+
*/
|
|
840
|
+
workspace?: Workspace | MastraAgentWorkspaceResolver;
|
|
828
841
|
}
|
|
829
842
|
/**
|
|
830
843
|
* Distributive `Omit` so unions in `PostgresStoreConfig` /
|
|
@@ -1404,4 +1417,4 @@ declare function buildSummarizeTool(config: MastraPluginConfig): _mastra_core_to
|
|
|
1404
1417
|
maxWords?: number | undefined;
|
|
1405
1418
|
}, unknown, unknown, unknown, _mastra_core_tools0.ToolExecutionContext<unknown, unknown, unknown>, "summarize", unknown>;
|
|
1406
1419
|
//#endregion
|
|
1407
|
-
export { AppKitToolOptions, BuiltAgents, ChartPlannerRequest, DEFAULT_AGENT_MAX_STEPS, DEFAULT_GENIE_ALIAS, DEFAULT_STYLE_INSTRUCTIONS, FALLBACK_AGENT_ID, FetchChartOptions, GENIE_INSTRUCTIONS, GenieSpaceConfig, GenieSpacesConfig, MASTRA_MODEL_OVERRIDE_KEY, MASTRA_REQUEST_ID_KEY, MASTRA_USER_EMAIL_KEY, MASTRA_USER_KEY, MASTRA_USER_NAME_KEY, MastraAgentDefinition, MastraMcpConfig, MastraMemoryConfig, MastraMemoryConfigOverride, MastraPlugin, MastraPluginConfig, MastraPluginToolkitProvider, MastraPlugins, MastraStorageConfigOverride, MastraTools, MastraToolsFn, type ModelOverrideRequest, PrepareChartOptions, ResolvedMcp, type SummarizeOptions, TRACE_REQUEST_CONTEXT_KEYS, ToolkitOptions, User, approvalGatedToolIds, buildAgents, buildGenieToolkitProvider, buildGenieTools, buildMcpServer, buildRenderDataTool, buildSummarizeTool, chartPlannerRequestSchema, collectSpaceSuggestions, createAgent, createTool, extractModelOverride, fetchChart, mastra, normalizeGenieSpaces, prepareChart, resolveGenieSpaces, summarizeText, tool };
|
|
1420
|
+
export { AppKitToolOptions, BuiltAgents, ChartPlannerRequest, DEFAULT_AGENT_MAX_STEPS, DEFAULT_GENIE_ALIAS, DEFAULT_STYLE_INSTRUCTIONS, FALLBACK_AGENT_ID, FetchChartOptions, GENIE_INSTRUCTIONS, GenieSpaceConfig, GenieSpacesConfig, MASTRA_MODEL_OVERRIDE_KEY, MASTRA_REQUEST_ID_KEY, MASTRA_USER_EMAIL_KEY, MASTRA_USER_KEY, MASTRA_USER_NAME_KEY, MastraAgentDefinition, MastraAgentWorkspaceResolver, MastraMcpConfig, MastraMemoryConfig, MastraMemoryConfigOverride, MastraPlugin, MastraPluginConfig, MastraPluginToolkitProvider, MastraPlugins, MastraStorageConfigOverride, MastraTools, MastraToolsFn, type ModelOverrideRequest, PrepareChartOptions, ResolvedMcp, type SummarizeOptions, TRACE_REQUEST_CONTEXT_KEYS, ToolkitOptions, User, approvalGatedToolIds, buildAgents, buildGenieToolkitProvider, buildGenieTools, buildMcpServer, buildRenderDataTool, buildSummarizeTool, chartPlannerRequestSchema, collectSpaceSuggestions, createAgent, createTool, extractModelOverride, fetchChart, mastra, normalizeGenieSpaces, prepareChart, resolveGenieSpaces, summarizeText, tool };
|
package/dist/index.js
CHANGED
|
@@ -2257,6 +2257,7 @@ async function buildAgents(opts) {
|
|
|
2257
2257
|
const approvalGatedByAgent = [];
|
|
2258
2258
|
for (const [id, def] of Object.entries(definitions)) {
|
|
2259
2259
|
const tools = await resolveTools(def.tools, plugins, ambientTools);
|
|
2260
|
+
const workspace = resolveAgentWorkspace(def.workspace);
|
|
2260
2261
|
const gated = approvalGatedToolIds(tools);
|
|
2261
2262
|
if (gated.length > 0) approvalGatedByAgent.push({
|
|
2262
2263
|
agentId: id,
|
|
@@ -2272,6 +2273,7 @@ async function buildAgents(opts) {
|
|
|
2272
2273
|
defaultOptions: { maxSteps: config.agentMaxSteps ?? DEFAULT_AGENT_MAX_STEPS },
|
|
2273
2274
|
tools,
|
|
2274
2275
|
...memory ? { memory } : {},
|
|
2276
|
+
...workspace ? { workspace } : {},
|
|
2275
2277
|
inputProcessors,
|
|
2276
2278
|
outputProcessors
|
|
2277
2279
|
});
|
|
@@ -2441,6 +2443,10 @@ async function resolveTools(defTools, plugins, ambientTools) {
|
|
|
2441
2443
|
...resolved
|
|
2442
2444
|
};
|
|
2443
2445
|
}
|
|
2446
|
+
function resolveAgentWorkspace(workspace) {
|
|
2447
|
+
if (!workspace) return void 0;
|
|
2448
|
+
return typeof workspace === "function" ? workspace() : workspace;
|
|
2449
|
+
}
|
|
2444
2450
|
/**
|
|
2445
2451
|
* Build the {@link MastraPlugins} runtime proxy handed to
|
|
2446
2452
|
* `tools(plugins)` callbacks.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbx-tools/appkit-mastra",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.94",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@databricks/sdk-experimental": "^0.17",
|
|
6
|
-
"@dbx-tools/appkit-mastra-shared": "0.1.
|
|
7
|
-
"@dbx-tools/genie": "0.1.
|
|
8
|
-
"@dbx-tools/genie-shared": "0.1.
|
|
9
|
-
"@dbx-tools/model": "0.1.
|
|
10
|
-
"@dbx-tools/shared": "0.1.
|
|
6
|
+
"@dbx-tools/appkit-mastra-shared": "0.1.94",
|
|
7
|
+
"@dbx-tools/genie": "0.1.94",
|
|
8
|
+
"@dbx-tools/genie-shared": "0.1.94",
|
|
9
|
+
"@dbx-tools/model": "0.1.94",
|
|
10
|
+
"@dbx-tools/shared": "0.1.94",
|
|
11
11
|
"@mastra/ai-sdk": "^1",
|
|
12
12
|
"@mastra/core": "^1",
|
|
13
13
|
"@mastra/express": "^1",
|