@mastra/code-sdk 1.18.0-alpha.3 → 1.19.0-alpha.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/dist/acp/agent.js +2 -2
- package/dist/acp/runtime.js +2 -2
- package/dist/agent-connections/state-processor.js +3 -3
- package/dist/agent-connections/tools.js +2 -2
- package/dist/agents/instructions.d.ts +5 -2
- package/dist/agents/instructions.d.ts.map +1 -1
- package/dist/agents/instructions.js +5 -3
- package/dist/agents/instructions.js.map +1 -1
- package/dist/agents/mastracode-gateway.js +5 -5
- package/dist/agents/memory.js +2 -2
- package/dist/agents/model.js +5 -5
- package/dist/agents/prompts/index.d.ts +2 -0
- package/dist/agents/prompts/index.d.ts.map +1 -1
- package/dist/agents/prompts/index.js +8 -5
- package/dist/agents/prompts/index.js.map +1 -1
- package/dist/agents/prompts/plan.d.ts +1 -0
- package/dist/agents/prompts/plan.d.ts.map +1 -1
- package/dist/agents/prompts/plan.js +4 -1
- package/dist/agents/prompts/plan.js.map +1 -1
- package/dist/agents/prompts/tool-guidance.d.ts.map +1 -1
- package/dist/agents/prompts/tool-guidance.js +9 -1
- package/dist/agents/prompts/tool-guidance.js.map +1 -1
- package/dist/agents/tool-availability.d.ts +7 -2
- package/dist/agents/tool-availability.d.ts.map +1 -1
- package/dist/agents/tool-availability.js +15 -7
- package/dist/agents/tool-availability.js.map +1 -1
- package/dist/agents/tools.js +2 -2
- package/dist/agents/workflow-builder-agent.js +2 -2
- package/dist/agents/workspace.d.ts +3 -1
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/agents/workspace.js +3 -3
- package/dist/agents/workspace.js.map +1 -1
- package/dist/auth/account-rotation-processor.js +4 -4
- package/dist/auth/index.js +3 -3
- package/dist/evals/index.js +1 -1
- package/dist/factory/client.d.ts +4 -1
- package/dist/factory/client.d.ts.map +1 -1
- package/dist/factory/client.js +22 -7
- package/dist/factory/client.js.map +1 -1
- package/dist/headless/cli.js +7 -7
- package/dist/headless/index.js +2 -2
- package/dist/headless/run-mc.js +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -33
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/onboarding/settings.js +2 -2
- package/dist/plugins/install.js +2 -2
- package/dist/plugins/manager.js +3 -3
- package/dist/providers/claude-max.js +5 -5
- package/dist/providers/claude-max.js.map +1 -1
- package/dist/providers/github-copilot.js +2 -2
- package/dist/providers/github-copilot.js.map +1 -1
- package/dist/providers/google-thinking.js +1 -1
- package/dist/providers/google-thinking.js.map +1 -1
- package/dist/providers/kimi-coding.js +1 -1
- package/dist/providers/openai-codex.js +5 -5
- package/dist/providers/openai-codex.js.map +1 -1
- package/dist/providers/provider-thinking.d.ts +1 -1
- package/dist/providers/provider-thinking.d.ts.map +1 -1
- package/dist/providers/provider-thinking.js +2 -2
- package/dist/providers/provider-thinking.js.map +1 -1
- package/dist/providers/xai.js +1 -1
- package/dist/schedules/tools.js +1 -1
- package/dist/tools/utils.js +1 -1
- package/dist/tools/workflows/list-available-tools.js +1 -1
- package/dist/utils/plans.d.ts +2 -0
- package/dist/utils/plans.d.ts.map +1 -1
- package/dist/utils/plans.js +6 -0
- package/dist/utils/plans.js.map +1 -1
- package/dist/utils/prune-cli.js +2 -2
- package/dist/workflows/register-primitives.js +2 -2
- package/package.json +19 -18
package/dist/index.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { CODE_AGENT_ID, DEFAULT_OM_MODEL_ID, validateConfigDirName } from "./constants.js";
|
|
2
|
-
import { detectProject, getObservabilityDatabasePath, getResourceIdOverride, getStorageConfig } from "./utils/project.js";
|
|
3
|
-
import { isKimiCodingDeviceId } from "./auth/providers/kimi-coding.js";
|
|
4
|
-
import { AuthStorage } from "./auth/storage.js";
|
|
5
|
-
import { isThinkingLevelSetting } from "./thinking.js";
|
|
6
|
-
import { setAuthStorage } from "./providers/openai-codex.js";
|
|
7
|
-
import { getAvailableOmPacks, resolveAutoOMModelId } from "./onboarding/packs.js";
|
|
8
|
-
import { MASTRA_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, loadSettings, resolveOmRoleModel, saveSettings } from "./onboarding/settings.js";
|
|
9
|
-
import { resolveExperimentalAgent, validateExperimentalAgent, wrapExperimentalAgent } from "./experimental-agent.js";
|
|
10
1
|
import { createSessionThreadAdvertisement } from "./agent-connections/session-advertisement.js";
|
|
11
2
|
import { AgentConnectionsSignalProvider } from "./agent-connections/signal-provider.js";
|
|
12
3
|
import { createBackgroundCompletionEvents } from "./agents/background-completion-events.js";
|
|
13
4
|
import { createBackgroundCompletionCallbacks } from "./agents/background-completion.js";
|
|
14
5
|
import { hasCredentialStoreProvider, setCredentialLogger, withCredentialTenantPreparation } from "./agents/credential-resolver.js";
|
|
15
|
-
import { createAmazonBedrockGateway } from "./providers/amazon-bedrock-gateway.js";
|
|
16
|
-
import { createGoogleVertexGateway } from "./providers/google-vertex-gateway.js";
|
|
17
|
-
import { setAuthStorage as setAuthStorage$1 } from "./providers/claude-max.js";
|
|
18
|
-
import { setAuthStorage as setAuthStorage$2 } from "./providers/github-copilot.js";
|
|
19
|
-
import { setAuthStorage as setAuthStorage$3 } from "./providers/kimi-coding.js";
|
|
20
|
-
import { setAuthStorage as setAuthStorage$4 } from "./providers/xai.js";
|
|
21
|
-
import { canUseProvider, createMastraCodeGateway, getDynamicModel, getGoalJudgeModel, resolveModel } from "./agents/model.js";
|
|
22
|
-
import { getDynamicWorkspace, getGoalJudgeTools } from "./agents/workspace.js";
|
|
23
|
-
import { createGitRefReminderReader, instructionSourcePaths, loadSessionInstructions, sessionInstructionRoots } from "./agents/prompts/agent-instructions.js";
|
|
24
6
|
import { getDynamicInstructions } from "./agents/instructions.js";
|
|
25
|
-
import { LOCAL_KNOWLEDGE_ORG_ID, knowledgeUnresolvedScopes, resolveKnowledgeSessionScopes } from "./knowledge-scope.js";
|
|
26
7
|
import { getDynamicMemory } from "./agents/memory.js";
|
|
8
|
+
import { canUseProvider, createMastraCodeGateway, getDynamicModel, getGoalJudgeModel, resolveModel } from "./agents/model.js";
|
|
27
9
|
import { buildMode } from "./agents/modes/build.js";
|
|
28
10
|
import { fastMode } from "./agents/modes/explore.js";
|
|
29
11
|
import { createPlanMode } from "./agents/modes/plan.js";
|
|
12
|
+
import { createGitRefReminderReader, instructionSourcePaths, loadSessionInstructions, sessionInstructionRoots } from "./agents/prompts/agent-instructions.js";
|
|
30
13
|
import { builtinSubagents, resolveSubagentsSetting } from "./agents/subagents/index.js";
|
|
31
14
|
import { attachOMThreadStatePersistence, restoreOMThreadStateForCurrentThread } from "./agents/thread-caveman-state.js";
|
|
32
15
|
import { createDynamicTools, createToolHooks } from "./agents/tools.js";
|
|
16
|
+
import { getDynamicWorkspace, getGoalJudgeTools } from "./agents/workspace.js";
|
|
33
17
|
import { AccountRotationProcessor, AccountStartNoticeProcessor, MODEL_FALLBACK_STATE_KEY } from "./auth/account-rotation-processor.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
18
|
+
import { isKimiCodingDeviceId } from "./auth/providers/kimi-coding.js";
|
|
19
|
+
import { AuthStorage } from "./auth/storage.js";
|
|
20
|
+
import { CODE_AGENT_ID, DEFAULT_OM_MODEL_ID, validateConfigDirName } from "./constants.js";
|
|
36
21
|
import "./evals/scorers/index.js";
|
|
37
|
-
import {
|
|
22
|
+
import { resolveExperimentalAgent, validateExperimentalAgent, wrapExperimentalAgent } from "./experimental-agent.js";
|
|
38
23
|
import "./hooks/index.js";
|
|
39
24
|
import { KnowledgeInspectorError, createKnowledgeInspector } from "./knowledge-inspector.js";
|
|
40
|
-
import {
|
|
25
|
+
import { LOCAL_KNOWLEDGE_ORG_ID, knowledgeUnresolvedScopes, resolveKnowledgeSessionScopes } from "./knowledge-scope.js";
|
|
41
26
|
import "./mcp/index.js";
|
|
27
|
+
import { getAvailableOmPacks, resolveAutoOMModelId } from "./onboarding/packs.js";
|
|
28
|
+
import { MASTRA_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, loadSettings, resolveOmRoleModel, saveSettings } from "./onboarding/settings.js";
|
|
42
29
|
import { getToolCategory } from "./permissions.js";
|
|
43
30
|
import { PluginManager } from "./plugins/manager.js";
|
|
44
31
|
import { PluginSignalLane } from "./plugins/signal-lane.js";
|
|
45
32
|
import { PlanRejectionAbortProcessor } from "./processors/plan-rejection-abort.js";
|
|
33
|
+
import { createAmazonBedrockGateway } from "./providers/amazon-bedrock-gateway.js";
|
|
34
|
+
import { createOutcomeScorer } from "./evals/scorers/outcome.js";
|
|
35
|
+
import { createEfficiencyScorer } from "./evals/scorers/efficiency.js";
|
|
36
|
+
import { setAuthStorage } from "./providers/claude-max.js";
|
|
37
|
+
import { HookManager } from "./hooks/manager.js";
|
|
46
38
|
import { createGitHubCopilotGateway } from "./providers/github-copilot-gateway.js";
|
|
39
|
+
import { setAuthStorage as setAuthStorage$1 } from "./providers/github-copilot.js";
|
|
40
|
+
import { createMcpManager } from "./mcp/manager.js";
|
|
41
|
+
import { createGoogleVertexGateway } from "./providers/google-vertex-gateway.js";
|
|
42
|
+
import { setAuthStorage as setAuthStorage$2 } from "./providers/kimi-coding.js";
|
|
43
|
+
import { setAuthStorage as setAuthStorage$3 } from "./providers/openai-codex.js";
|
|
44
|
+
import { setAuthStorage as setAuthStorage$4 } from "./providers/xai.js";
|
|
45
|
+
import "./schedules/index.js";
|
|
46
|
+
import { stateSchema } from "./schema.js";
|
|
47
47
|
import { assembleSchedulePrompt } from "./schedules/prompt.js";
|
|
48
48
|
import { ThreadScheduler, scheduleSignalAttributes, shortScheduleId } from "./schedules/scheduler.js";
|
|
49
49
|
import { runScript } from "./schedules/run-script.js";
|
|
50
50
|
import { createScheduleTools } from "./schedules/tools.js";
|
|
51
|
-
import "./schedules/index.js";
|
|
52
|
-
import { stateSchema } from "./schema.js";
|
|
53
51
|
import { mastraBrand } from "./theme-palette.js";
|
|
52
|
+
import { isThinkingLevelSetting } from "./thinking.js";
|
|
54
53
|
import { DiscardingScoresStorage } from "./utils/discarding-scores-storage.js";
|
|
55
54
|
import { syncGateways } from "./utils/gateway-sync.js";
|
|
56
55
|
import { openLocalObservabilityStore } from "./utils/local-observability.js";
|
|
57
56
|
import { registerSessionAndWaitForMaintenance, unregisterSession } from "./utils/maintenance-lock.js";
|
|
58
|
-
import { createSignalsPubSub } from "./utils/signals-pubsub.js";
|
|
59
57
|
import { createResourceNotificationDispatcher, shouldHoldNotificationDelivery } from "./utils/notification-dispatch.js";
|
|
60
|
-
import {
|
|
58
|
+
import { detectProject, getObservabilityDatabasePath, getResourceIdOverride, getStorageConfig } from "./utils/project.js";
|
|
59
|
+
import { createSignalsPubSub } from "./utils/signals-pubsub.js";
|
|
61
60
|
import { createStorage, createVectorStore } from "./utils/storage-factory.js";
|
|
61
|
+
import { DEFAULT_RETENTION, createStorageMaintenance, resolveLocalDbFiles } from "./utils/storage-maintenance.js";
|
|
62
62
|
import { acquireThreadLock, releaseThreadLock } from "./utils/thread-lock.js";
|
|
63
63
|
import { FOREIGN_THREAD, findWakeSession, sessionLeaseScopes } from "./utils/wake-session.js";
|
|
64
64
|
import { registerWorkflowBuilderPrimitives } from "./workflows/register-primitives.js";
|
|
@@ -162,10 +162,10 @@ function addPluginToolsToModeAllowlists(modes, pluginToolNames) {
|
|
|
162
162
|
}
|
|
163
163
|
function createAuthStorage() {
|
|
164
164
|
const authStorage = new AuthStorage();
|
|
165
|
-
setAuthStorage$1(authStorage);
|
|
166
165
|
setAuthStorage(authStorage);
|
|
167
|
-
setAuthStorage$2(authStorage);
|
|
168
166
|
setAuthStorage$3(authStorage);
|
|
167
|
+
setAuthStorage$1(authStorage);
|
|
168
|
+
setAuthStorage$2(authStorage);
|
|
169
169
|
setAuthStorage$4(authStorage);
|
|
170
170
|
return authStorage;
|
|
171
171
|
}
|
|
@@ -727,6 +727,7 @@ async function createMastraCodeAgentController(config) {
|
|
|
727
727
|
coAuthor: config?.coAuthor,
|
|
728
728
|
hasSubagents: subagents.length > 0,
|
|
729
729
|
disabledBuiltinTools: config?.disableBuiltinTools,
|
|
730
|
+
plansDir: config?.plansDir,
|
|
730
731
|
disabledTools: config?.disabledTools
|
|
731
732
|
});
|
|
732
733
|
},
|
|
@@ -961,6 +962,11 @@ async function createMastraCodeAgentController(config) {
|
|
|
961
962
|
else globalInitialState[`subagentModelId_${key}`] = modelId;
|
|
962
963
|
const typedStateSchema = stateSchema;
|
|
963
964
|
const backgroundCompletionEvents = backgroundToolsEnabled ? createBackgroundCompletionEvents() : void 0;
|
|
965
|
+
const defaultWorkspace = (args) => getDynamicWorkspace({
|
|
966
|
+
...args,
|
|
967
|
+
backgroundToolsEnabled,
|
|
968
|
+
plansDir: config?.plansDir
|
|
969
|
+
});
|
|
964
970
|
let controller;
|
|
965
971
|
controller = new AgentController({
|
|
966
972
|
id: "mastra-code",
|
|
@@ -999,10 +1005,7 @@ async function createMastraCodeAgentController(config) {
|
|
|
999
1005
|
githubCopilotGateway,
|
|
1000
1006
|
mastraCodeGateway
|
|
1001
1007
|
],
|
|
1002
|
-
workspace: config?.workspace ??
|
|
1003
|
-
...args,
|
|
1004
|
-
backgroundToolsEnabled
|
|
1005
|
-
})),
|
|
1008
|
+
workspace: config?.workspace ?? defaultWorkspace,
|
|
1006
1009
|
browser: config?.browser,
|
|
1007
1010
|
idGenerator: config?.idGenerator,
|
|
1008
1011
|
toolCategoryResolver: getToolCategory,
|