@mastra/code-sdk 0.0.0-client-tool-results-20260912062135
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/LICENSE.md +32 -0
- package/README.md +37 -0
- package/dist/acp/agent.d.ts +35 -0
- package/dist/acp/agent.d.ts.map +1 -0
- package/dist/acp/agent.js +161 -0
- package/dist/acp/agent.js.map +1 -0
- package/dist/acp/event-mapper.d.ts +22 -0
- package/dist/acp/event-mapper.d.ts.map +1 -0
- package/dist/acp/event-mapper.js +214 -0
- package/dist/acp/event-mapper.js.map +1 -0
- package/dist/acp/index.d.ts +8 -0
- package/dist/acp/index.d.ts.map +1 -0
- package/dist/acp/index.js +65 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/server.d.ts +7 -0
- package/dist/acp/server.d.ts.map +1 -0
- package/dist/acp/server.js +35 -0
- package/dist/acp/server.js.map +1 -0
- package/dist/acp.d.ts +2 -0
- package/dist/acp.d.ts.map +1 -0
- package/dist/acp.js +2 -0
- package/dist/agents/context-audit.d.ts +84 -0
- package/dist/agents/context-audit.d.ts.map +1 -0
- package/dist/agents/context-audit.js +118 -0
- package/dist/agents/context-audit.js.map +1 -0
- package/dist/agents/credential-resolver.d.ts +63 -0
- package/dist/agents/credential-resolver.d.ts.map +1 -0
- package/dist/agents/credential-resolver.js +97 -0
- package/dist/agents/credential-resolver.js.map +1 -0
- package/dist/agents/custom-provider-source.d.ts +35 -0
- package/dist/agents/custom-provider-source.d.ts.map +1 -0
- package/dist/agents/custom-provider-source.js +25 -0
- package/dist/agents/custom-provider-source.js.map +1 -0
- package/dist/agents/instructions.d.ts +29 -0
- package/dist/agents/instructions.d.ts.map +1 -0
- package/dist/agents/instructions.js +58 -0
- package/dist/agents/instructions.js.map +1 -0
- package/dist/agents/mastracode-gateway.d.ts +74 -0
- package/dist/agents/mastracode-gateway.d.ts.map +1 -0
- package/dist/agents/mastracode-gateway.js +431 -0
- package/dist/agents/mastracode-gateway.js.map +1 -0
- package/dist/agents/memory.d.ts +30 -0
- package/dist/agents/memory.d.ts.map +1 -0
- package/dist/agents/memory.js +171 -0
- package/dist/agents/memory.js.map +1 -0
- package/dist/agents/model.d.ts +81 -0
- package/dist/agents/model.d.ts.map +1 -0
- package/dist/agents/model.js +155 -0
- package/dist/agents/model.js.map +1 -0
- package/dist/agents/modes/build.d.ts +10 -0
- package/dist/agents/modes/build.d.ts.map +1 -0
- package/dist/agents/modes/build.js +49 -0
- package/dist/agents/modes/build.js.map +1 -0
- package/dist/agents/modes/explore.d.ts +10 -0
- package/dist/agents/modes/explore.d.ts.map +1 -0
- package/dist/agents/modes/explore.js +42 -0
- package/dist/agents/modes/explore.js.map +1 -0
- package/dist/agents/modes/plan.d.ts +6 -0
- package/dist/agents/modes/plan.d.ts.map +1 -0
- package/dist/agents/modes/plan.js +42 -0
- package/dist/agents/modes/plan.js.map +1 -0
- package/dist/agents/prompts/agent-instructions.d.ts +70 -0
- package/dist/agents/prompts/agent-instructions.d.ts.map +1 -0
- package/dist/agents/prompts/agent-instructions.js +211 -0
- package/dist/agents/prompts/agent-instructions.js.map +1 -0
- package/dist/agents/prompts/build.d.ts +12 -0
- package/dist/agents/prompts/build.d.ts.map +1 -0
- package/dist/agents/prompts/build.js +76 -0
- package/dist/agents/prompts/build.js.map +1 -0
- package/dist/agents/prompts/fast.d.ts +5 -0
- package/dist/agents/prompts/fast.d.ts.map +1 -0
- package/dist/agents/prompts/fast.js +26 -0
- package/dist/agents/prompts/fast.js.map +1 -0
- package/dist/agents/prompts/index.d.ts +50 -0
- package/dist/agents/prompts/index.d.ts.map +1 -0
- package/dist/agents/prompts/index.js +119 -0
- package/dist/agents/prompts/index.js.map +1 -0
- package/dist/agents/prompts/model.d.ts +5 -0
- package/dist/agents/prompts/model.d.ts.map +1 -0
- package/dist/agents/prompts/model.js +23 -0
- package/dist/agents/prompts/model.js.map +1 -0
- package/dist/agents/prompts/plan.d.ts +6 -0
- package/dist/agents/prompts/plan.d.ts.map +1 -0
- package/dist/agents/prompts/plan.js +111 -0
- package/dist/agents/prompts/plan.js.map +1 -0
- package/dist/agents/prompts/tool-guidance.d.ts +18 -0
- package/dist/agents/prompts/tool-guidance.d.ts.map +1 -0
- package/dist/agents/prompts/tool-guidance.js +180 -0
- package/dist/agents/prompts/tool-guidance.js.map +1 -0
- package/dist/agents/sandbox-filesystem.d.ts +117 -0
- package/dist/agents/sandbox-filesystem.d.ts.map +1 -0
- package/dist/agents/sandbox-filesystem.js +356 -0
- package/dist/agents/sandbox-filesystem.js.map +1 -0
- package/dist/agents/subagents/execute.d.ts +3 -0
- package/dist/agents/subagents/execute.d.ts.map +1 -0
- package/dist/agents/subagents/execute.js +27 -0
- package/dist/agents/subagents/execute.js.map +1 -0
- package/dist/agents/subagents/explore.d.ts +3 -0
- package/dist/agents/subagents/explore.d.ts.map +1 -0
- package/dist/agents/subagents/explore.js +18 -0
- package/dist/agents/subagents/explore.js.map +1 -0
- package/dist/agents/subagents/plan.d.ts +3 -0
- package/dist/agents/subagents/plan.d.ts.map +1 -0
- package/dist/agents/subagents/plan.js +18 -0
- package/dist/agents/subagents/plan.js.map +1 -0
- package/dist/agents/thread-caveman-state.d.ts +17 -0
- package/dist/agents/thread-caveman-state.d.ts.map +1 -0
- package/dist/agents/thread-caveman-state.js +107 -0
- package/dist/agents/thread-caveman-state.js.map +1 -0
- package/dist/agents/tool-availability.d.ts +10 -0
- package/dist/agents/tool-availability.d.ts.map +1 -0
- package/dist/agents/tool-availability.js +96 -0
- package/dist/agents/tool-availability.js.map +1 -0
- package/dist/agents/tools.d.ts +36 -0
- package/dist/agents/tools.d.ts.map +1 -0
- package/dist/agents/tools.js +117 -0
- package/dist/agents/tools.js.map +1 -0
- package/dist/agents/workflow-builder-agent.d.ts +2 -0
- package/dist/agents/workflow-builder-agent.d.ts.map +1 -0
- package/dist/agents/workflow-builder-agent.js +80 -0
- package/dist/agents/workflow-builder-agent.js.map +1 -0
- package/dist/agents/workspace.d.ts +32 -0
- package/dist/agents/workspace.d.ts.map +1 -0
- package/dist/agents/workspace.js +208 -0
- package/dist/agents/workspace.js.map +1 -0
- package/dist/analytics.d.ts +18 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +163 -0
- package/dist/analytics.js.map +1 -0
- package/dist/auth/authorization-input.d.ts +16 -0
- package/dist/auth/authorization-input.d.ts.map +1 -0
- package/dist/auth/authorization-input.js +42 -0
- package/dist/auth/authorization-input.js.map +1 -0
- package/dist/auth/device-code.d.ts +93 -0
- package/dist/auth/device-code.d.ts.map +1 -0
- package/dist/auth/device-code.js +129 -0
- package/dist/auth/device-code.js.map +1 -0
- package/dist/auth/index.d.ts +12 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/pkce.d.ts +13 -0
- package/dist/auth/pkce.d.ts.map +1 -0
- package/dist/auth/pkce.js +32 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/provider-auth-error.d.ts +12 -0
- package/dist/auth/provider-auth-error.d.ts.map +1 -0
- package/dist/auth/provider-auth-error.js +16 -0
- package/dist/auth/provider-auth-error.js.map +1 -0
- package/dist/auth/providers/anthropic.d.ts +40 -0
- package/dist/auth/providers/anthropic.d.ts.map +1 -0
- package/dist/auth/providers/anthropic.js +126 -0
- package/dist/auth/providers/anthropic.js.map +1 -0
- package/dist/auth/providers/github-copilot.d.ts +154 -0
- package/dist/auth/providers/github-copilot.d.ts.map +1 -0
- package/dist/auth/providers/github-copilot.js +340 -0
- package/dist/auth/providers/github-copilot.js.map +1 -0
- package/dist/auth/providers/kimi-coding.d.ts +38 -0
- package/dist/auth/providers/kimi-coding.d.ts.map +1 -0
- package/dist/auth/providers/kimi-coding.js +232 -0
- package/dist/auth/providers/kimi-coding.js.map +1 -0
- package/dist/auth/providers/openai-codex.d.ts +139 -0
- package/dist/auth/providers/openai-codex.d.ts.map +1 -0
- package/dist/auth/providers/openai-codex.js +519 -0
- package/dist/auth/providers/openai-codex.js.map +1 -0
- package/dist/auth/providers/xai.d.ts +64 -0
- package/dist/auth/providers/xai.d.ts.map +1 -0
- package/dist/auth/providers/xai.js +205 -0
- package/dist/auth/providers/xai.js.map +1 -0
- package/dist/auth/storage.d.ts +92 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +211 -0
- package/dist/auth/storage.js.map +1 -0
- package/dist/auth/types.d.ts +89 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/clipboard/index.d.ts +26 -0
- package/dist/clipboard/index.d.ts.map +1 -0
- package/dist/clipboard/index.js +226 -0
- package/dist/clipboard/index.js.map +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +18 -0
- package/dist/constants.js.map +1 -0
- package/dist/error-classification.d.ts +10 -0
- package/dist/error-classification.d.ts.map +1 -0
- package/dist/error-classification.js +22 -0
- package/dist/error-classification.js.map +1 -0
- package/dist/evals/context-builder.d.ts +41 -0
- package/dist/evals/context-builder.d.ts.map +1 -0
- package/dist/evals/context-builder.js +161 -0
- package/dist/evals/context-builder.js.map +1 -0
- package/dist/evals/index.d.ts +4 -0
- package/dist/evals/index.d.ts.map +1 -0
- package/dist/evals/index.js +5 -0
- package/dist/evals/scorers/classify-command.d.ts +31 -0
- package/dist/evals/scorers/classify-command.d.ts.map +1 -0
- package/dist/evals/scorers/classify-command.js +73 -0
- package/dist/evals/scorers/classify-command.js.map +1 -0
- package/dist/evals/scorers/efficiency.d.ts +44 -0
- package/dist/evals/scorers/efficiency.d.ts.map +1 -0
- package/dist/evals/scorers/efficiency.js +259 -0
- package/dist/evals/scorers/efficiency.js.map +1 -0
- package/dist/evals/scorers/extract-tools.d.ts +25 -0
- package/dist/evals/scorers/extract-tools.d.ts.map +1 -0
- package/dist/evals/scorers/extract-tools.js +60 -0
- package/dist/evals/scorers/extract-tools.js.map +1 -0
- package/dist/evals/scorers/index.d.ts +3 -0
- package/dist/evals/scorers/index.d.ts.map +1 -0
- package/dist/evals/scorers/index.js +3 -0
- package/dist/evals/scorers/outcome.d.ts +49 -0
- package/dist/evals/scorers/outcome.d.ts.map +1 -0
- package/dist/evals/scorers/outcome.js +347 -0
- package/dist/evals/scorers/outcome.js.map +1 -0
- package/dist/goal-manager.d.ts +78 -0
- package/dist/goal-manager.d.ts.map +1 -0
- package/dist/goal-manager.js +273 -0
- package/dist/goal-manager.js.map +1 -0
- package/dist/goal-signal.d.ts +14 -0
- package/dist/goal-signal.d.ts.map +1 -0
- package/dist/goal-signal.js +17 -0
- package/dist/goal-signal.js.map +1 -0
- package/dist/headless/cli.d.ts +42 -0
- package/dist/headless/cli.d.ts.map +1 -0
- package/dist/headless/cli.js +209 -0
- package/dist/headless/cli.js.map +1 -0
- package/dist/headless/flags.d.ts +33 -0
- package/dist/headless/flags.d.ts.map +1 -0
- package/dist/headless/flags.js +190 -0
- package/dist/headless/flags.js.map +1 -0
- package/dist/headless/format.d.ts +38 -0
- package/dist/headless/format.d.ts.map +1 -0
- package/dist/headless/format.js +89 -0
- package/dist/headless/format.js.map +1 -0
- package/dist/headless/index.d.ts +25 -0
- package/dist/headless/index.d.ts.map +1 -0
- package/dist/headless/index.js +6 -0
- package/dist/headless/policy.d.ts +17 -0
- package/dist/headless/policy.d.ts.map +1 -0
- package/dist/headless/policy.js +42 -0
- package/dist/headless/policy.js.map +1 -0
- package/dist/headless/run-mc.d.ts +7 -0
- package/dist/headless/run-mc.d.ts.map +1 -0
- package/dist/headless/run-mc.js +346 -0
- package/dist/headless/run-mc.js.map +1 -0
- package/dist/headless/types.d.ts +158 -0
- package/dist/headless/types.d.ts.map +1 -0
- package/dist/headless/types.js +19 -0
- package/dist/headless/types.js.map +1 -0
- package/dist/hooks/config.d.ts +11 -0
- package/dist/hooks/config.d.ts.map +1 -0
- package/dist/hooks/config.js +73 -0
- package/dist/hooks/config.js.map +1 -0
- package/dist/hooks/executor.d.ts +13 -0
- package/dist/hooks/executor.d.ts.map +1 -0
- package/dist/hooks/executor.js +129 -0
- package/dist/hooks/executor.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/manager.d.ts +54 -0
- package/dist/hooks/manager.d.ts.map +1 -0
- package/dist/hooks/manager.js +241 -0
- package/dist/hooks/manager.js.map +1 -0
- package/dist/hooks/types.d.ts +172 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +8 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/index.d.ts +341 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +919 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc/ipc-reporter.d.ts +14 -0
- package/dist/ipc/ipc-reporter.d.ts.map +1 -0
- package/dist/ipc/ipc-reporter.js +21 -0
- package/dist/ipc/ipc-reporter.js.map +1 -0
- package/dist/knowledge-inspector.d.ts +119 -0
- package/dist/knowledge-inspector.d.ts.map +1 -0
- package/dist/knowledge-inspector.js +508 -0
- package/dist/knowledge-inspector.js.map +1 -0
- package/dist/knowledge-scope.d.ts +35 -0
- package/dist/knowledge-scope.d.ts.map +1 -0
- package/dist/knowledge-scope.js +47 -0
- package/dist/knowledge-scope.js.map +1 -0
- package/dist/lsp/client.d.ts +56 -0
- package/dist/lsp/client.d.ts.map +1 -0
- package/dist/lsp/client.js +251 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/index.d.ts +4 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +4 -0
- package/dist/lsp/language.d.ts +9 -0
- package/dist/lsp/language.d.ts.map +1 -0
- package/dist/lsp/language.js +44 -0
- package/dist/lsp/language.js.map +1 -0
- package/dist/lsp/manager.d.ts +34 -0
- package/dist/lsp/manager.d.ts.map +1 -0
- package/dist/lsp/manager.js +82 -0
- package/dist/lsp/manager.js.map +1 -0
- package/dist/lsp/server.d.ts +27 -0
- package/dist/lsp/server.d.ts.map +1 -0
- package/dist/lsp/server.js +159 -0
- package/dist/lsp/server.js.map +1 -0
- package/dist/lsp/workspace.d.ts +9 -0
- package/dist/lsp/workspace.d.ts.map +1 -0
- package/dist/lsp/workspace.js +55 -0
- package/dist/lsp/workspace.js.map +1 -0
- package/dist/mcp/config.d.ts +62 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/config.js +301 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/manager.d.ts +101 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/manager.js +644 -0
- package/dist/mcp/manager.js.map +1 -0
- package/dist/mcp/state.d.ts +35 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/state.js +97 -0
- package/dist/mcp/state.js.map +1 -0
- package/dist/mcp/types.d.ts +125 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +1 -0
- package/dist/onboarding/custom-packs.d.ts +7 -0
- package/dist/onboarding/custom-packs.d.ts.map +1 -0
- package/dist/onboarding/custom-packs.js +17 -0
- package/dist/onboarding/custom-packs.js.map +1 -0
- package/dist/onboarding/custom-providers.d.ts +4 -0
- package/dist/onboarding/custom-providers.d.ts.map +1 -0
- package/dist/onboarding/custom-providers.js +30 -0
- package/dist/onboarding/custom-providers.js.map +1 -0
- package/dist/onboarding/index.d.ts +5 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +3 -0
- package/dist/onboarding/om-settings.d.ts +25 -0
- package/dist/onboarding/om-settings.d.ts.map +1 -0
- package/dist/onboarding/om-settings.js +47 -0
- package/dist/onboarding/om-settings.js.map +1 -0
- package/dist/onboarding/packs.d.ts +49 -0
- package/dist/onboarding/packs.d.ts.map +1 -0
- package/dist/onboarding/packs.js +182 -0
- package/dist/onboarding/packs.js.map +1 -0
- package/dist/onboarding/settings.d.ts +438 -0
- package/dist/onboarding/settings.d.ts.map +1 -0
- package/dist/onboarding/settings.js +847 -0
- package/dist/onboarding/settings.js.map +1 -0
- package/dist/permissions.d.ts +55 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +137 -0
- package/dist/permissions.js.map +1 -0
- package/dist/plugin.d.ts +144 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +30 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugins/dependencies.d.ts +9 -0
- package/dist/plugins/dependencies.d.ts.map +1 -0
- package/dist/plugins/dependencies.js +88 -0
- package/dist/plugins/dependencies.js.map +1 -0
- package/dist/plugins/install.d.ts +21 -0
- package/dist/plugins/install.d.ts.map +1 -0
- package/dist/plugins/install.js +190 -0
- package/dist/plugins/install.js.map +1 -0
- package/dist/plugins/loader.d.ts +19 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +258 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manager.d.ts +98 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +456 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/manifest.d.ts +14 -0
- package/dist/plugins/manifest.d.ts.map +1 -0
- package/dist/plugins/manifest.js +50 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/package-link.d.ts +3 -0
- package/dist/plugins/package-link.d.ts.map +1 -0
- package/dist/plugins/package-link.js +61 -0
- package/dist/plugins/package-link.js.map +1 -0
- package/dist/plugins/paths.d.ts +10 -0
- package/dist/plugins/paths.d.ts.map +1 -0
- package/dist/plugins/paths.js +25 -0
- package/dist/plugins/paths.js.map +1 -0
- package/dist/plugins/registry.d.ts +8 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +112 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/scaffold.d.ts +10 -0
- package/dist/plugins/scaffold.d.ts.map +1 -0
- package/dist/plugins/scaffold.js +116 -0
- package/dist/plugins/scaffold.js.map +1 -0
- package/dist/plugins/signal-lane.d.ts +58 -0
- package/dist/plugins/signal-lane.d.ts.map +1 -0
- package/dist/plugins/signal-lane.js +166 -0
- package/dist/plugins/signal-lane.js.map +1 -0
- package/dist/plugins/types.d.ts +81 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +1 -0
- package/dist/process-memory-diagnostics.d.ts +135 -0
- package/dist/process-memory-diagnostics.d.ts.map +1 -0
- package/dist/process-memory-diagnostics.js +500 -0
- package/dist/process-memory-diagnostics.js.map +1 -0
- package/dist/processors/plan-rejection-abort.d.ts +12 -0
- package/dist/processors/plan-rejection-abort.d.ts.map +1 -0
- package/dist/processors/plan-rejection-abort.js +54 -0
- package/dist/processors/plan-rejection-abort.js.map +1 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts +47 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts.map +1 -0
- package/dist/providers/amazon-bedrock-gateway.js +153 -0
- package/dist/providers/amazon-bedrock-gateway.js.map +1 -0
- package/dist/providers/amazon-bedrock.d.ts +28 -0
- package/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/dist/providers/amazon-bedrock.js +102 -0
- package/dist/providers/amazon-bedrock.js.map +1 -0
- package/dist/providers/claude-max.d.ts +65 -0
- package/dist/providers/claude-max.d.ts.map +1 -0
- package/dist/providers/claude-max.js +252 -0
- package/dist/providers/claude-max.js.map +1 -0
- package/dist/providers/github-copilot.d.ts +60 -0
- package/dist/providers/github-copilot.d.ts.map +1 -0
- package/dist/providers/github-copilot.js +266 -0
- package/dist/providers/github-copilot.js.map +1 -0
- package/dist/providers/kimi-coding.d.ts +15 -0
- package/dist/providers/kimi-coding.d.ts.map +1 -0
- package/dist/providers/kimi-coding.js +69 -0
- package/dist/providers/kimi-coding.js.map +1 -0
- package/dist/providers/openai-codex.d.ts +73 -0
- package/dist/providers/openai-codex.d.ts.map +1 -0
- package/dist/providers/openai-codex.js +306 -0
- package/dist/providers/openai-codex.js.map +1 -0
- package/dist/providers/xai.d.ts +33 -0
- package/dist/providers/xai.d.ts.map +1 -0
- package/dist/providers/xai.js +71 -0
- package/dist/providers/xai.js.map +1 -0
- package/dist/schema.d.ts +200 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +92 -0
- package/dist/schema.js.map +1 -0
- package/dist/theme-palette.d.ts +17 -0
- package/dist/theme-palette.d.ts.map +1 -0
- package/dist/theme-palette.js +21 -0
- package/dist/theme-palette.js.map +1 -0
- package/dist/thinking.d.ts +33 -0
- package/dist/thinking.d.ts.map +1 -0
- package/dist/thinking.js +58 -0
- package/dist/thinking.js.map +1 -0
- package/dist/tool-names.d.ts +73 -0
- package/dist/tool-names.d.ts.map +1 -0
- package/dist/tool-names.js +52 -0
- package/dist/tool-names.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/request-sandbox-access.d.ts +6 -0
- package/dist/tools/request-sandbox-access.d.ts.map +1 -0
- package/dist/tools/request-sandbox-access.js +79 -0
- package/dist/tools/request-sandbox-access.js.map +1 -0
- package/dist/tools/utils.d.ts +20 -0
- package/dist/tools/utils.d.ts.map +1 -0
- package/dist/tools/utils.js +32 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/tools/web-search.d.ts +114 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +155 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/workflows/create-workflow.d.ts +7 -0
- package/dist/tools/workflows/create-workflow.d.ts.map +1 -0
- package/dist/tools/workflows/create-workflow.js +81 -0
- package/dist/tools/workflows/create-workflow.js.map +1 -0
- package/dist/tools/workflows/delete-workflow.d.ts +7 -0
- package/dist/tools/workflows/delete-workflow.d.ts.map +1 -0
- package/dist/tools/workflows/delete-workflow.js +21 -0
- package/dist/tools/workflows/delete-workflow.js.map +1 -0
- package/dist/tools/workflows/ephemeral-memory.d.ts +7 -0
- package/dist/tools/workflows/ephemeral-memory.d.ts.map +1 -0
- package/dist/tools/workflows/ephemeral-memory.js +45 -0
- package/dist/tools/workflows/ephemeral-memory.js.map +1 -0
- package/dist/tools/workflows/extract-json-schema.d.ts +12 -0
- package/dist/tools/workflows/extract-json-schema.d.ts.map +1 -0
- package/dist/tools/workflows/extract-json-schema.js +22 -0
- package/dist/tools/workflows/extract-json-schema.js.map +1 -0
- package/dist/tools/workflows/get-workflow.d.ts +11 -0
- package/dist/tools/workflows/get-workflow.d.ts.map +1 -0
- package/dist/tools/workflows/get-workflow.js +34 -0
- package/dist/tools/workflows/get-workflow.js.map +1 -0
- package/dist/tools/workflows/list-available-agents.d.ts +8 -0
- package/dist/tools/workflows/list-available-agents.d.ts.map +1 -0
- package/dist/tools/workflows/list-available-agents.js +32 -0
- package/dist/tools/workflows/list-available-agents.js.map +1 -0
- package/dist/tools/workflows/list-available-tools.d.ts +9 -0
- package/dist/tools/workflows/list-available-tools.d.ts.map +1 -0
- package/dist/tools/workflows/list-available-tools.js +40 -0
- package/dist/tools/workflows/list-available-tools.js.map +1 -0
- package/dist/tools/workflows/list-available-workflows.d.ts +9 -0
- package/dist/tools/workflows/list-available-workflows.d.ts.map +1 -0
- package/dist/tools/workflows/list-available-workflows.js +32 -0
- package/dist/tools/workflows/list-available-workflows.js.map +1 -0
- package/dist/tools/workflows/list-workflows.d.ts +9 -0
- package/dist/tools/workflows/list-workflows.d.ts.map +1 -0
- package/dist/tools/workflows/list-workflows.js +33 -0
- package/dist/tools/workflows/list-workflows.js.map +1 -0
- package/dist/tools/workflows/run-workflow.d.ts +9 -0
- package/dist/tools/workflows/run-workflow.d.ts.map +1 -0
- package/dist/tools/workflows/run-workflow.js +52 -0
- package/dist/tools/workflows/run-workflow.js.map +1 -0
- package/dist/tools/workflows/save-workflow.d.ts +1015 -0
- package/dist/tools/workflows/save-workflow.d.ts.map +1 -0
- package/dist/tools/workflows/save-workflow.js +28 -0
- package/dist/tools/workflows/save-workflow.js.map +1 -0
- package/dist/tools/workflows/tool-ids.d.ts +15 -0
- package/dist/tools/workflows/tool-ids.d.ts.map +1 -0
- package/dist/tools/workflows/tool-ids.js +19 -0
- package/dist/tools/workflows/tool-ids.js.map +1 -0
- package/dist/utils/binaries.d.ts +7 -0
- package/dist/utils/binaries.d.ts.map +1 -0
- package/dist/utils/binaries.js +78 -0
- package/dist/utils/binaries.js.map +1 -0
- package/dist/utils/debug-log.d.ts +12 -0
- package/dist/utils/debug-log.d.ts.map +1 -0
- package/dist/utils/debug-log.js +59 -0
- package/dist/utils/debug-log.js.map +1 -0
- package/dist/utils/errors.d.ts +36 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +196 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/gateway-sync.d.ts +26 -0
- package/dist/utils/gateway-sync.d.ts.map +1 -0
- package/dist/utils/gateway-sync.js +61 -0
- package/dist/utils/gateway-sync.js.map +1 -0
- package/dist/utils/path-security.d.ts +2 -0
- package/dist/utils/path-security.d.ts.map +1 -0
- package/dist/utils/path-security.js +10 -0
- package/dist/utils/path-security.js.map +1 -0
- package/dist/utils/plan-diff.d.ts +25 -0
- package/dist/utils/plan-diff.d.ts.map +1 -0
- package/dist/utils/plan-diff.js +62 -0
- package/dist/utils/plan-diff.js.map +1 -0
- package/dist/utils/plans.d.ts +59 -0
- package/dist/utils/plans.d.ts.map +1 -0
- package/dist/utils/plans.js +117 -0
- package/dist/utils/plans.js.map +1 -0
- package/dist/utils/project.d.ts +160 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +364 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/signals-pubsub.d.ts +41 -0
- package/dist/utils/signals-pubsub.d.ts.map +1 -0
- package/dist/utils/signals-pubsub.js +122 -0
- package/dist/utils/signals-pubsub.js.map +1 -0
- package/dist/utils/slash-command-loader.d.ts +52 -0
- package/dist/utils/slash-command-loader.d.ts.map +1 -0
- package/dist/utils/slash-command-loader.js +142 -0
- package/dist/utils/slash-command-loader.js.map +1 -0
- package/dist/utils/slash-command-processor.d.ts +14 -0
- package/dist/utils/slash-command-processor.d.ts.map +1 -0
- package/dist/utils/slash-command-processor.js +109 -0
- package/dist/utils/slash-command-processor.js.map +1 -0
- package/dist/utils/stdin-pipe.d.ts +33 -0
- package/dist/utils/stdin-pipe.d.ts.map +1 -0
- package/dist/utils/stdin-pipe.js +96 -0
- package/dist/utils/stdin-pipe.js.map +1 -0
- package/dist/utils/storage-factory.d.ts +50 -0
- package/dist/utils/storage-factory.d.ts.map +1 -0
- package/dist/utils/storage-factory.js +121 -0
- package/dist/utils/storage-factory.js.map +1 -0
- package/dist/utils/storage-maintenance.d.ts +103 -0
- package/dist/utils/storage-maintenance.d.ts.map +1 -0
- package/dist/utils/storage-maintenance.js +274 -0
- package/dist/utils/storage-maintenance.js.map +1 -0
- package/dist/utils/thread-lock.d.ts +26 -0
- package/dist/utils/thread-lock.d.ts.map +1 -0
- package/dist/utils/thread-lock.js +112 -0
- package/dist/utils/thread-lock.js.map +1 -0
- package/dist/utils/token-estimator.d.ts +3 -0
- package/dist/utils/token-estimator.d.ts.map +1 -0
- package/dist/utils/token-estimator.js +21 -0
- package/dist/utils/token-estimator.js.map +1 -0
- package/dist/utils/update-check.d.ts +101 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +383 -0
- package/dist/utils/update-check.js.map +1 -0
- package/dist/voice/stt-registry.d.ts +64 -0
- package/dist/voice/stt-registry.d.ts.map +1 -0
- package/dist/voice/stt-registry.js +144 -0
- package/dist/voice/stt-registry.js.map +1 -0
- package/dist/workflows/register-primitives.d.ts +52 -0
- package/dist/workflows/register-primitives.d.ts.map +1 -0
- package/dist/workflows/register-primitives.js +40 -0
- package/dist/workflows/register-primitives.js.map +1 -0
- package/dist/workflows/service.d.ts +64 -0
- package/dist/workflows/service.d.ts.map +1 -0
- package/dist/workflows/service.js +53 -0
- package/dist/workflows/service.js.map +1 -0
- package/package.json +97 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,919 @@
|
|
|
1
|
+
import { 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 { setAuthStorage } from "./providers/openai-codex.js";
|
|
6
|
+
import { MASTRA_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, loadSettings, resolveModelDefaults, resolveOmRoleModel, saveSettings } from "./onboarding/settings.js";
|
|
7
|
+
import { hasCredentialStoreProvider } from "./agents/credential-resolver.js";
|
|
8
|
+
import { getDynamicWorkspace, getGoalJudgeTools } from "./agents/workspace.js";
|
|
9
|
+
import { createGitRefInstructionReader, createGitRefReminderReader, getStaticallyLoadedInstructionPaths } from "./agents/prompts/agent-instructions.js";
|
|
10
|
+
import { getDynamicInstructions } from "./agents/instructions.js";
|
|
11
|
+
import { LOCAL_KNOWLEDGE_ORG_ID } from "./knowledge-scope.js";
|
|
12
|
+
import { createAmazonBedrockGateway } from "./providers/amazon-bedrock-gateway.js";
|
|
13
|
+
import { setAuthStorage as setAuthStorage$1 } from "./providers/claude-max.js";
|
|
14
|
+
import { setAuthStorage as setAuthStorage$2 } from "./providers/github-copilot.js";
|
|
15
|
+
import { setAuthStorage as setAuthStorage$3 } from "./providers/kimi-coding.js";
|
|
16
|
+
import { setAuthStorage as setAuthStorage$4 } from "./providers/xai.js";
|
|
17
|
+
import { createMastraCodeGateway, getDynamicModel, getGoalJudgeModel, resolveModel } from "./agents/model.js";
|
|
18
|
+
import { getDynamicMemory, hasSubconsciousTools } from "./agents/memory.js";
|
|
19
|
+
import { buildMode } from "./agents/modes/build.js";
|
|
20
|
+
import { fastMode } from "./agents/modes/explore.js";
|
|
21
|
+
import { planMode } from "./agents/modes/plan.js";
|
|
22
|
+
import { executeSubagent } from "./agents/subagents/execute.js";
|
|
23
|
+
import { exploreSubagent } from "./agents/subagents/explore.js";
|
|
24
|
+
import { planSubagent } from "./agents/subagents/plan.js";
|
|
25
|
+
import { attachOMThreadStatePersistence, restoreOMThreadStateForCurrentThread } from "./agents/thread-caveman-state.js";
|
|
26
|
+
import { createDynamicTools, createToolHooks } from "./agents/tools.js";
|
|
27
|
+
import { createOutcomeScorer } from "./evals/scorers/outcome.js";
|
|
28
|
+
import { createEfficiencyScorer } from "./evals/scorers/efficiency.js";
|
|
29
|
+
import "./evals/scorers/index.js";
|
|
30
|
+
import { HookManager } from "./hooks/manager.js";
|
|
31
|
+
import "./hooks/index.js";
|
|
32
|
+
import { KnowledgeInspectorError, createKnowledgeInspector } from "./knowledge-inspector.js";
|
|
33
|
+
import { createMcpManager } from "./mcp/manager.js";
|
|
34
|
+
import "./mcp/index.js";
|
|
35
|
+
import { hasExplicitOMConfiguration } from "./onboarding/om-settings.js";
|
|
36
|
+
import { getAvailableModePacks, getAvailableOmPacks, selectPreferredOMPack } from "./onboarding/packs.js";
|
|
37
|
+
import { getToolCategory } from "./permissions.js";
|
|
38
|
+
import { PluginManager } from "./plugins/manager.js";
|
|
39
|
+
import { PluginSignalLane } from "./plugins/signal-lane.js";
|
|
40
|
+
import { PlanRejectionAbortProcessor } from "./processors/plan-rejection-abort.js";
|
|
41
|
+
import { stateSchema } from "./schema.js";
|
|
42
|
+
import { mastraBrand } from "./theme-palette.js";
|
|
43
|
+
import { syncGateways } from "./utils/gateway-sync.js";
|
|
44
|
+
import { createSignalsPubSub } from "./utils/signals-pubsub.js";
|
|
45
|
+
import { DEFAULT_RETENTION, createStorageMaintenance, resolveLocalDbFiles } from "./utils/storage-maintenance.js";
|
|
46
|
+
import { createStorage, createVectorStore } from "./utils/storage-factory.js";
|
|
47
|
+
import { acquireThreadLock, releaseThreadLock } from "./utils/thread-lock.js";
|
|
48
|
+
import { registerWorkflowBuilderPrimitives } from "./workflows/register-primitives.js";
|
|
49
|
+
import { autoApprovePolicy, denyPolicy, permissionModeToPolicy } from "./headless/policy.js";
|
|
50
|
+
import { runMC } from "./headless/run-mc.js";
|
|
51
|
+
import { formatHuman, formatJsonl, renderJsonResult, renderTextResult } from "./headless/format.js";
|
|
52
|
+
import { hasHeadlessFlag, runMCCli } from "./headless/cli.js";
|
|
53
|
+
import "./headless/index.js";
|
|
54
|
+
import { TaskSignalProvider } from "@mastra/core/signals";
|
|
55
|
+
import { createHash } from "crypto";
|
|
56
|
+
import { hostname } from "os";
|
|
57
|
+
import path from "path";
|
|
58
|
+
import { AgentController } from "@mastra/core/agent-controller";
|
|
59
|
+
import { createCodingAgent } from "@mastra/core/coding-agent";
|
|
60
|
+
import { PROVIDER_REGISTRY } from "@mastra/core/llm";
|
|
61
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
62
|
+
import { defaultNotificationDeliveryDecision } from "@mastra/core/notifications";
|
|
63
|
+
import { AgentsMDInjector, PrefillErrorHandler, ProviderHistoryCompat, StreamErrorRetryProcessor, isBadRequestError } from "@mastra/core/processors";
|
|
64
|
+
import { RequestContext } from "@mastra/core/request-context";
|
|
65
|
+
import { InMemoryHarness, MastraCompositeStore } from "@mastra/core/storage";
|
|
66
|
+
import { DEFAULT_GOAL_JUDGE_PROMPT } from "@mastra/core/tools";
|
|
67
|
+
import { DuckDBStore } from "@mastra/duckdb";
|
|
68
|
+
import { GithubSignals } from "@mastra/github-signals";
|
|
69
|
+
import { LibSQLStore, LibSQLVector } from "@mastra/libsql";
|
|
70
|
+
import { MastraPlatformExporter, MastraStorageExporter, Observability, SensitiveDataFilter } from "@mastra/observability";
|
|
71
|
+
import { PostgresStore } from "@mastra/pg";
|
|
72
|
+
//#region src/index.ts
|
|
73
|
+
const CODE_AGENT_ID = "code-agent";
|
|
74
|
+
const MASTRACODE_TRANSIENT_CONNECTION_MAX_RETRIES = 10;
|
|
75
|
+
const MASTRACODE_TRANSIENT_CONNECTION_RETRY_INITIAL_DELAY_MS = 500;
|
|
76
|
+
const MASTRACODE_TRANSIENT_CONNECTION_RETRY_MAX_DELAY_MS = 3e4;
|
|
77
|
+
const TRANSIENT_CONNECTION_ERROR_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "EPIPE"]);
|
|
78
|
+
const TRANSIENT_CONNECTION_MESSAGE_PATTERN = /econnreset|socket hang up|write epipe|other side closed/i;
|
|
79
|
+
const TRANSIENT_SERVER_ERROR_STATUSES = /* @__PURE__ */ new Set([
|
|
80
|
+
500,
|
|
81
|
+
502,
|
|
82
|
+
503
|
|
83
|
+
]);
|
|
84
|
+
const TRANSIENT_SERVER_ERROR_MESSAGE_PATTERN = /internal server|server error|api may be experiencing issues/i;
|
|
85
|
+
/**
|
|
86
|
+
* Matcher for transient connection failures. Cause-chain traversal is handled
|
|
87
|
+
* by `StreamErrorRetryProcessor.isRetryableStreamError`, which calls each
|
|
88
|
+
* matcher at every level of the cause chain.
|
|
89
|
+
*/
|
|
90
|
+
/**
|
|
91
|
+
* Read the session state fields the AgentsMDInjector callbacks need from the
|
|
92
|
+
* controller request context (set by hosts like the factory review flow).
|
|
93
|
+
*/
|
|
94
|
+
function getInjectorSessionState(requestContext) {
|
|
95
|
+
return (requestContext?.get("controller"))?.getState();
|
|
96
|
+
}
|
|
97
|
+
function isTransientConnectionError(error) {
|
|
98
|
+
if (!error) return false;
|
|
99
|
+
const code = typeof error === "object" && "code" in error ? error.code : void 0;
|
|
100
|
+
if (typeof code === "string" && TRANSIENT_CONNECTION_ERROR_CODES.has(code.toUpperCase())) return true;
|
|
101
|
+
const message = error instanceof Error ? error.message : void 0;
|
|
102
|
+
if (typeof message === "string" && TRANSIENT_CONNECTION_MESSAGE_PATTERN.test(message)) return true;
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
function isTransientServerError(error) {
|
|
106
|
+
if (!error) return false;
|
|
107
|
+
const errorObj = typeof error === "object" ? error : void 0;
|
|
108
|
+
if (typeof errorObj?.status === "number" && TRANSIENT_SERVER_ERROR_STATUSES.has(errorObj.status) || typeof errorObj?.statusCode === "number" && TRANSIENT_SERVER_ERROR_STATUSES.has(errorObj.statusCode)) return true;
|
|
109
|
+
const message = error instanceof Error ? error.message : void 0;
|
|
110
|
+
return typeof message === "string" && TRANSIENT_SERVER_ERROR_MESSAGE_PATTERN.test(message);
|
|
111
|
+
}
|
|
112
|
+
function getTransientRetryDelay(retryCount) {
|
|
113
|
+
return Math.min(MASTRACODE_TRANSIENT_CONNECTION_RETRY_INITIAL_DELAY_MS * Math.pow(2, retryCount), MASTRACODE_TRANSIENT_CONNECTION_RETRY_MAX_DELAY_MS);
|
|
114
|
+
}
|
|
115
|
+
function emitTransientRetry(error, retryCount, delayMs, requestContext) {
|
|
116
|
+
(requestContext?.get("controller"))?.emitEvent?.({
|
|
117
|
+
type: "error",
|
|
118
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
119
|
+
retryable: true,
|
|
120
|
+
retryDelay: delayMs,
|
|
121
|
+
retryAttempt: retryCount + 1,
|
|
122
|
+
maxRetries: MASTRACODE_TRANSIENT_CONNECTION_MAX_RETRIES
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/** Short deterministic hash (sha256, first 12 hex chars) matching project.ts shortHash style. */
|
|
126
|
+
function shortHash(input) {
|
|
127
|
+
return createHash("sha256").update(input).digest("hex").slice(0, 12);
|
|
128
|
+
}
|
|
129
|
+
function applyEffectiveDefaultsToModes(modes, effectiveDefaults) {
|
|
130
|
+
return modes.map((mode) => {
|
|
131
|
+
const savedModel = effectiveDefaults[mode.id];
|
|
132
|
+
if (!savedModel) return mode;
|
|
133
|
+
return {
|
|
134
|
+
...mode,
|
|
135
|
+
defaultModelId: savedModel
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function addPluginToolsToModeAllowlists(modes, pluginToolNames) {
|
|
140
|
+
if (pluginToolNames.length === 0) return modes;
|
|
141
|
+
return modes.map((mode) => {
|
|
142
|
+
if (!mode.availableTools) return mode;
|
|
143
|
+
return {
|
|
144
|
+
...mode,
|
|
145
|
+
availableTools: Array.from(/* @__PURE__ */ new Set([...mode.availableTools, ...pluginToolNames]))
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function createAuthStorage() {
|
|
150
|
+
const authStorage = new AuthStorage();
|
|
151
|
+
setAuthStorage$1(authStorage);
|
|
152
|
+
setAuthStorage(authStorage);
|
|
153
|
+
setAuthStorage$2(authStorage);
|
|
154
|
+
setAuthStorage$3(authStorage);
|
|
155
|
+
setAuthStorage$4(authStorage);
|
|
156
|
+
return authStorage;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Resolve cloud observability credentials for the MastraPlatformExporter.
|
|
160
|
+
* Priority: per-resource settings > environment variables > disabled.
|
|
161
|
+
*/
|
|
162
|
+
function resolveCloudObservabilityConfig(settings, authStorage, resourceId) {
|
|
163
|
+
const resourceConfig = settings.observability.resources[resourceId];
|
|
164
|
+
if (resourceConfig) {
|
|
165
|
+
const token = authStorage.getStoredApiKey(`${OBSERVABILITY_AUTH_PREFIX}${resourceId}`);
|
|
166
|
+
if (token) return {
|
|
167
|
+
accessToken: token,
|
|
168
|
+
projectId: resourceConfig.projectId
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
accessToken: process.env.MASTRA_CLOUD_ACCESS_TOKEN,
|
|
173
|
+
projectId: process.env.MASTRA_PROJECT_ID
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Base factory: builds every shared MastraCode resource (storage, observability,
|
|
178
|
+
* memory, MCP, providers, gateways, agent, modes) and the {@link AgentController}, but
|
|
179
|
+
* does NOT call `init()` or create a session. The controller is returned inert so
|
|
180
|
+
* the composition layer can decide its Mastra ownership and session model.
|
|
181
|
+
*
|
|
182
|
+
* See {@link bootLocalAgentController} (Case 3) and `mountAgentControllerOnMastra` (Cases 1 & 2).
|
|
183
|
+
*/
|
|
184
|
+
/**
|
|
185
|
+
* `instanceof` checks against Mastra classes are unreliable here: published
|
|
186
|
+
* packages pin exact `@mastra/core` versions, so a user's dependency graph can
|
|
187
|
+
* contain multiple copies of core (and peer-keyed copies of `@mastra/libsql` /
|
|
188
|
+
* `@mastra/pg`). A store built against one copy fails `instanceof` against
|
|
189
|
+
* another — the injected instance then silently fell through to the
|
|
190
|
+
* StorageConfig path and crashed on `config.url`. These structural checks work
|
|
191
|
+
* across duplicated copies.
|
|
192
|
+
*/
|
|
193
|
+
function isInjectedStorageInstance(storage) {
|
|
194
|
+
if (!storage) return false;
|
|
195
|
+
if (storage instanceof MastraCompositeStore) return true;
|
|
196
|
+
const candidate = storage;
|
|
197
|
+
return typeof candidate.init === "function" && typeof candidate.__registerMastra === "function";
|
|
198
|
+
}
|
|
199
|
+
/** Cross-copy-safe class check: walks the prototype chain by constructor name. */
|
|
200
|
+
function hasAncestorClassNamed(value, className) {
|
|
201
|
+
for (let proto = Object.getPrototypeOf(value); proto; proto = Object.getPrototypeOf(proto)) if (proto.constructor?.name === className) return true;
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
function resolveInjectedStorageBackend(storage, configuredBackend) {
|
|
205
|
+
if (configuredBackend) return configuredBackend;
|
|
206
|
+
if (storage instanceof LibSQLStore || hasAncestorClassNamed(storage, "LibSQLStore")) return "libsql";
|
|
207
|
+
if (storage instanceof PostgresStore || hasAncestorClassNamed(storage, "PostgresStore")) return "pg";
|
|
208
|
+
throw new Error("storageBackend is required when injecting a custom storage instance.");
|
|
209
|
+
}
|
|
210
|
+
async function createMastraCodeAgentController(config) {
|
|
211
|
+
const cwd = config?.cwd ?? process.cwd();
|
|
212
|
+
const homeDir = config?.homeDir ?? config?.initialState?.homeDir;
|
|
213
|
+
const configDir = config?.configDir ?? ".mastracode";
|
|
214
|
+
let activeSession;
|
|
215
|
+
let pluginRuntimeController;
|
|
216
|
+
if (configDir !== ".mastracode") validateConfigDirName(configDir);
|
|
217
|
+
try {
|
|
218
|
+
process.loadEnvFile(path.join(cwd, ".env"));
|
|
219
|
+
} catch {}
|
|
220
|
+
const authStorage = createAuthStorage();
|
|
221
|
+
const globalSettings = loadSettings(config?.settingsPath);
|
|
222
|
+
const storedGatewayKey = authStorage.getStoredApiKey(MASTRA_GATEWAY_PROVIDER);
|
|
223
|
+
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
224
|
+
if (storedGatewayKey) process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
225
|
+
if (storedGatewayUrl) process.env["MASTRA_GATEWAY_URL"] ??= storedGatewayUrl;
|
|
226
|
+
if (!hasCredentialStoreProvider()) try {
|
|
227
|
+
const registry = PROVIDER_REGISTRY;
|
|
228
|
+
const providerEnvVars = {};
|
|
229
|
+
for (const [provider, cfg] of Object.entries(registry)) {
|
|
230
|
+
const envVars = cfg?.apiKeyEnvVar;
|
|
231
|
+
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
232
|
+
}
|
|
233
|
+
providerEnvVars[MASTRA_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
234
|
+
authStorage.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
235
|
+
} catch {
|
|
236
|
+
authStorage.loadStoredApiKeysIntoEnv({
|
|
237
|
+
[MASTRA_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
238
|
+
anthropic: "ANTHROPIC_API_KEY",
|
|
239
|
+
openai: "OPENAI_API_KEY",
|
|
240
|
+
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
241
|
+
cerebras: "CEREBRAS_API_KEY",
|
|
242
|
+
deepseek: "DEEPSEEK_API_KEY"
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const mgApiKey = process.env["MASTRA_GATEWAY_API_KEY"] ?? storedGatewayKey;
|
|
246
|
+
const mastraCodeGateway = createMastraCodeGateway({
|
|
247
|
+
mastraGatewayBaseUrl: (process.env["MASTRA_GATEWAY_URL"] ?? storedGatewayUrl ?? "https://gateway-api.mastra.ai").replace(/\/+$/, "").replace(/\/v1$/, ""),
|
|
248
|
+
mastraGatewayApiKey: mgApiKey,
|
|
249
|
+
routeThroughMastraGateway: false,
|
|
250
|
+
settingsPath: config?.settingsPath
|
|
251
|
+
});
|
|
252
|
+
const amazonBedrockGateway = createAmazonBedrockGateway();
|
|
253
|
+
const project = detectProject(cwd);
|
|
254
|
+
const resourceIdOverride = getResourceIdOverride(project.rootPath, configDir);
|
|
255
|
+
if (resourceIdOverride) {
|
|
256
|
+
project.resourceId = resourceIdOverride;
|
|
257
|
+
project.resourceIdOverride = true;
|
|
258
|
+
}
|
|
259
|
+
const sessionId = `mastracode-session-${shortHash(project.resourceId)}`;
|
|
260
|
+
const ownerId = `mastracode-${shortHash(`${hostname()}\0${project.rootPath}`)}`;
|
|
261
|
+
const configuredPubSub = config?.pubsub;
|
|
262
|
+
const useUnixSocketPubSub = (config?.unixSocketPubSub ?? globalSettings.signals?.unixSocketPubSub ?? false) && process.platform !== "win32";
|
|
263
|
+
const signalsPubSub = configuredPubSub ?? (useUnixSocketPubSub ? createSignalsPubSub(project.resourceId) : void 0);
|
|
264
|
+
const crossProcessPubSub = config?.crossProcessPubSub ?? (!configuredPubSub && useUnixSocketPubSub);
|
|
265
|
+
if (crossProcessPubSub && !signalsPubSub) throw new Error("crossProcessPubSub requires a pubsub instance");
|
|
266
|
+
const injectedStorage = isInjectedStorageInstance(config?.storage) ? config.storage : void 0;
|
|
267
|
+
const storageConfig = injectedStorage ? void 0 : config?.storage ?? getStorageConfig(project.rootPath, globalSettings.storage, configDir);
|
|
268
|
+
const storageResult = injectedStorage ? {
|
|
269
|
+
storage: injectedStorage,
|
|
270
|
+
backend: resolveInjectedStorageBackend(injectedStorage, config?.storageBackend)
|
|
271
|
+
} : await createStorage(storageConfig);
|
|
272
|
+
const storageWarning = storageResult.warning;
|
|
273
|
+
let observabilityDomain;
|
|
274
|
+
let observabilityWarning;
|
|
275
|
+
if (globalSettings.observability.localTracing) try {
|
|
276
|
+
const observabilityDuckDB = new DuckDBStore({
|
|
277
|
+
id: "mastra-code-observability",
|
|
278
|
+
path: getObservabilityDatabasePath()
|
|
279
|
+
});
|
|
280
|
+
await observabilityDuckDB.db.getConnection();
|
|
281
|
+
observabilityDomain = observabilityDuckDB.observability;
|
|
282
|
+
} catch (err) {
|
|
283
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
284
|
+
if (/lock|locked|busy/i.test(message)) observabilityWarning = "Observability unavailable — another MastraCode instance holds the database lock. Traces, scores, and feedback will not be recorded in this session.";
|
|
285
|
+
else observabilityWarning = `Observability unavailable — DuckDB initialization failed: ${message}`;
|
|
286
|
+
}
|
|
287
|
+
const harnessStorage = new InMemoryHarness();
|
|
288
|
+
const storage = new MastraCompositeStore({
|
|
289
|
+
id: "mastra-code-storage",
|
|
290
|
+
default: storageResult.storage,
|
|
291
|
+
domains: {
|
|
292
|
+
observability: observabilityDomain ?? false,
|
|
293
|
+
harness: harnessStorage
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
const observability = new Observability({ configs: { default: {
|
|
297
|
+
serviceName: "mastracode",
|
|
298
|
+
requestContextKeys: [
|
|
299
|
+
"controller.threadId",
|
|
300
|
+
"controller.resourceId",
|
|
301
|
+
"controller.session.modeId",
|
|
302
|
+
"controller.controllerId",
|
|
303
|
+
"controller.state.projectName",
|
|
304
|
+
"controller.state.gitBranch",
|
|
305
|
+
"controller.session.modelId",
|
|
306
|
+
"controller.state.subagentModelId",
|
|
307
|
+
"controller.state.yolo",
|
|
308
|
+
"controller.state.thinkingLevel",
|
|
309
|
+
"controller.state.smartEditing",
|
|
310
|
+
"controller.state.omScope",
|
|
311
|
+
"controller.state.observerModelId",
|
|
312
|
+
"controller.state.reflectorModelId",
|
|
313
|
+
"controller.state.observationThreshold",
|
|
314
|
+
"controller.state.reflectionThreshold"
|
|
315
|
+
],
|
|
316
|
+
exporters: [...observabilityDomain ? [new MastraStorageExporter({ strategy: "event-sourced" })] : [], new MastraPlatformExporter(resolveCloudObservabilityConfig(globalSettings, authStorage, project.resourceId))],
|
|
317
|
+
spanOutputProcessors: [new SensitiveDataFilter()]
|
|
318
|
+
} } });
|
|
319
|
+
const vector = config?.vector ?? (storageConfig ? await createVectorStore(storageConfig, storageResult.backend) : void 0);
|
|
320
|
+
const storageMaintenance = createStorageMaintenance({
|
|
321
|
+
storage: storageResult.storage,
|
|
322
|
+
backend: storageResult.backend,
|
|
323
|
+
retention: DEFAULT_RETENTION,
|
|
324
|
+
localDbFiles: storageConfig ? resolveLocalDbFiles(storageConfig, storageResult.backend) : [],
|
|
325
|
+
closeVector: vector instanceof LibSQLVector ? () => vector.close() : void 0
|
|
326
|
+
});
|
|
327
|
+
const memory = config?.memory === false ? void 0 : config?.memory ?? getDynamicMemory(storage, vector);
|
|
328
|
+
const hasSubconscious = config?.memory === void 0 ? (state) => hasSubconsciousTools(vector, state) : false;
|
|
329
|
+
const mcpManager = config?.disableMcp ? void 0 : createMcpManager(project.rootPath, configDir, config?.mcpServers, globalSettings.mcp);
|
|
330
|
+
const hookManager = config?.disableHooks ? void 0 : new HookManager(project.rootPath, "session-init", configDir, homeDir, project.isWorktree ? {
|
|
331
|
+
path: project.rootPath,
|
|
332
|
+
branch: project.gitBranch,
|
|
333
|
+
mainRepoPath: project.mainRepoPath
|
|
334
|
+
} : void 0);
|
|
335
|
+
const pluginManager = config?.disablePlugins ? void 0 : config?.pluginManager ?? new PluginManager({
|
|
336
|
+
projectRoot: project.rootPath,
|
|
337
|
+
configDir,
|
|
338
|
+
homeDir
|
|
339
|
+
});
|
|
340
|
+
pluginManager?.setRuntime({
|
|
341
|
+
getController: () => pluginRuntimeController,
|
|
342
|
+
getActiveSession: () => activeSession
|
|
343
|
+
});
|
|
344
|
+
const loadedPlugins = pluginManager ? await pluginManager.reload() : [];
|
|
345
|
+
const pluginTools = pluginManager?.getPluginTools() ?? {};
|
|
346
|
+
const outcomeScorer = createOutcomeScorer();
|
|
347
|
+
const efficiencyScorer = createEfficiencyScorer();
|
|
348
|
+
const getNotificationStreamOptions = async ({ resourceId, threadId }) => {
|
|
349
|
+
const session = await controller.getSessionByResource(resourceId) ?? activeSession;
|
|
350
|
+
if (!session) return void 0;
|
|
351
|
+
const modeId = session.mode.get();
|
|
352
|
+
const defaultModeModelId = controller.listModes().find((mode) => mode.id === modeId)?.defaultModelId;
|
|
353
|
+
const modelId = session.model.get() || activeSession?.model.get() || defaultModeModelId || "";
|
|
354
|
+
const requestContext = new RequestContext();
|
|
355
|
+
const agentControllerContext = {
|
|
356
|
+
controllerId: controller.id,
|
|
357
|
+
state: session.state.get(),
|
|
358
|
+
getState: () => session.state.get(),
|
|
359
|
+
setState: (updates) => session.state.set(updates),
|
|
360
|
+
threadId,
|
|
361
|
+
resourceId,
|
|
362
|
+
session: {
|
|
363
|
+
id: session.identity.getId(),
|
|
364
|
+
ownerId: session.identity.getOwnerId(),
|
|
365
|
+
modeId,
|
|
366
|
+
modelId,
|
|
367
|
+
state: {
|
|
368
|
+
get: () => session.state.get(),
|
|
369
|
+
set: (updates) => session.state.set(updates),
|
|
370
|
+
update: (updater) => session.state.update(updater)
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
workspace: session.getWorkspace(),
|
|
374
|
+
getSubagentModelId: (params) => session.subagents.model.get(params ?? {})
|
|
375
|
+
};
|
|
376
|
+
requestContext.set("controller", agentControllerContext);
|
|
377
|
+
return {
|
|
378
|
+
memory: {
|
|
379
|
+
thread: threadId,
|
|
380
|
+
resource: resourceId
|
|
381
|
+
},
|
|
382
|
+
requestContext,
|
|
383
|
+
maxSteps: 1e3,
|
|
384
|
+
savePerStep: false,
|
|
385
|
+
requireToolApproval: session.state.get().yolo !== true,
|
|
386
|
+
modelSettings: { temperature: 1 }
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
const githubSignals = globalSettings.signals?.experimentalGithubSignals && !config?.disableGithubSignals ? new GithubSignals({
|
|
390
|
+
cwd: project.rootPath,
|
|
391
|
+
pollIntervalMs: globalSettings.signals.githubPollIntervalMs,
|
|
392
|
+
gitcrawlCommand: process.env.MASTRACODE_GITCRAWL_BIN ?? process.env.GITCRAWL_BIN ?? process.env.MASTRACODE_GITCRAWL_COMMAND ?? process.env.GITCRAWL_COMMAND,
|
|
393
|
+
getNotificationStreamOptions
|
|
394
|
+
}) : void 0;
|
|
395
|
+
const mastraCodeInputProcessors = [
|
|
396
|
+
...config?.inputProcessors ?? [],
|
|
397
|
+
new PlanRejectionAbortProcessor(),
|
|
398
|
+
new AgentsMDInjector({
|
|
399
|
+
isEnabled: ({ requestContext }) => {
|
|
400
|
+
const state = getInjectorSessionState(requestContext);
|
|
401
|
+
return state?.untrustedCheckout !== true || typeof state?.baseRef === "string";
|
|
402
|
+
},
|
|
403
|
+
getReader: ({ requestContext }) => {
|
|
404
|
+
const state = getInjectorSessionState(requestContext);
|
|
405
|
+
if (state?.untrustedCheckout !== true || typeof state?.baseRef !== "string") return void 0;
|
|
406
|
+
return createGitRefReminderReader(state?.projectPath ?? project.rootPath, state.baseRef);
|
|
407
|
+
},
|
|
408
|
+
getIgnoredInstructionPaths: ({ requestContext }) => {
|
|
409
|
+
const state = getInjectorSessionState(requestContext);
|
|
410
|
+
const projectPath = state?.projectPath ?? project.rootPath;
|
|
411
|
+
return getStaticallyLoadedInstructionPaths(projectPath, void 0, state?.untrustedCheckout === true && typeof state?.baseRef === "string" ? createGitRefInstructionReader(projectPath, state.baseRef) : void 0);
|
|
412
|
+
}
|
|
413
|
+
}),
|
|
414
|
+
new ProviderHistoryCompat()
|
|
415
|
+
];
|
|
416
|
+
const taskSignalProvider = new TaskSignalProvider();
|
|
417
|
+
const NO_PLUGIN_PROCESSORS = {
|
|
418
|
+
input: [],
|
|
419
|
+
output: []
|
|
420
|
+
};
|
|
421
|
+
let pluginProcessorReadWarned = false;
|
|
422
|
+
const pluginSignalLane = pluginManager ? new PluginSignalLane({ reservedProviderIds: [taskSignalProvider.id, ...githubSignals ? [githubSignals.id] : []] }) : void 0;
|
|
423
|
+
let unsubscribePluginReload;
|
|
424
|
+
/**
|
|
425
|
+
* Plugin processors are read through a function so that enabling, disabling or
|
|
426
|
+
* updating a plugin takes effect on the next request rather than requiring a
|
|
427
|
+
* new agent. This runs before every LLM call, and also outside the request
|
|
428
|
+
* path when the Agent catalogues its configured processors — where a throw is
|
|
429
|
+
* swallowed into a debug log. So it only reads already-resolved state: no
|
|
430
|
+
* filesystem, no network, no construction, and it never throws.
|
|
431
|
+
*/
|
|
432
|
+
const readPluginProcessors = () => {
|
|
433
|
+
try {
|
|
434
|
+
return pluginManager?.getPluginProcessors() ?? NO_PLUGIN_PROCESSORS;
|
|
435
|
+
} catch (error) {
|
|
436
|
+
if (!pluginProcessorReadWarned) {
|
|
437
|
+
pluginProcessorReadWarned = true;
|
|
438
|
+
console.warn("Failed to read plugin processors:", error);
|
|
439
|
+
}
|
|
440
|
+
return NO_PLUGIN_PROCESSORS;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const codeAgent = createCodingAgent({
|
|
444
|
+
id: CODE_AGENT_ID,
|
|
445
|
+
name: "Code Agent",
|
|
446
|
+
workspace: void 0,
|
|
447
|
+
instructions: async ({ requestContext }) => {
|
|
448
|
+
const configured = config?.hostInstructions;
|
|
449
|
+
return getDynamicInstructions({
|
|
450
|
+
requestContext,
|
|
451
|
+
hostInstructions: typeof configured === "function" ? await configured({ requestContext }) : configured,
|
|
452
|
+
hasSubconscious,
|
|
453
|
+
hasSubagents: subagents.length > 0
|
|
454
|
+
});
|
|
455
|
+
},
|
|
456
|
+
model: (ctx) => getDynamicModel(ctx, config?.settingsPath),
|
|
457
|
+
notifications: { deliveryPolicy: { decide: async (input) => {
|
|
458
|
+
const decision = defaultNotificationDeliveryDecision(input);
|
|
459
|
+
if (!input.record.resourceId) return decision;
|
|
460
|
+
const streamOptions = await getNotificationStreamOptions({
|
|
461
|
+
resourceId: input.record.resourceId,
|
|
462
|
+
threadId: input.record.threadId
|
|
463
|
+
});
|
|
464
|
+
return streamOptions ? {
|
|
465
|
+
...decision,
|
|
466
|
+
streamOptions
|
|
467
|
+
} : decision;
|
|
468
|
+
} } },
|
|
469
|
+
tools: createDynamicTools(mcpManager, config?.extraTools, config?.disabledTools, storage, pluginTools),
|
|
470
|
+
hooks: createToolHooks(hookManager, config?.postToolObserver),
|
|
471
|
+
scorers: {
|
|
472
|
+
outcome: {
|
|
473
|
+
scorer: outcomeScorer,
|
|
474
|
+
sampling: { type: "none" }
|
|
475
|
+
},
|
|
476
|
+
efficiency: {
|
|
477
|
+
scorer: efficiencyScorer,
|
|
478
|
+
sampling: {
|
|
479
|
+
type: "ratio",
|
|
480
|
+
rate: .3
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
signals: [taskSignalProvider, ...githubSignals ? [githubSignals] : []],
|
|
485
|
+
goal: {
|
|
486
|
+
judge: (ctx) => getGoalJudgeModel(ctx, config?.settingsPath),
|
|
487
|
+
maxRuns: globalSettings.models.goalMaxTurns ?? 50,
|
|
488
|
+
maxSteps: 1e3,
|
|
489
|
+
prompt: DEFAULT_GOAL_JUDGE_PROMPT,
|
|
490
|
+
tools: getGoalJudgeTools
|
|
491
|
+
},
|
|
492
|
+
inputProcessors: () => [
|
|
493
|
+
...mastraCodeInputProcessors,
|
|
494
|
+
...readPluginProcessors().input.map((entry) => entry.value),
|
|
495
|
+
...pluginSignalLane?.getInputProcessors() ?? []
|
|
496
|
+
],
|
|
497
|
+
outputProcessors: () => [...readPluginProcessors().output.map((entry) => entry.value), ...pluginSignalLane?.getOutputProcessors() ?? []],
|
|
498
|
+
errorProcessors: [
|
|
499
|
+
new ProviderHistoryCompat(),
|
|
500
|
+
new StreamErrorRetryProcessor({ matchers: [
|
|
501
|
+
{
|
|
502
|
+
match: isBadRequestError,
|
|
503
|
+
maxRetries: 1,
|
|
504
|
+
delayMs: 2e3
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
match: isTransientConnectionError,
|
|
508
|
+
maxRetries: MASTRACODE_TRANSIENT_CONNECTION_MAX_RETRIES,
|
|
509
|
+
delayMs: ({ retryCount }) => getTransientRetryDelay(retryCount),
|
|
510
|
+
onRetry: ({ error, retryCount, delayMs, requestContext }) => emitTransientRetry(error, retryCount, delayMs, requestContext)
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
match: isTransientServerError,
|
|
514
|
+
maxRetries: MASTRACODE_TRANSIENT_CONNECTION_MAX_RETRIES,
|
|
515
|
+
delayMs: ({ retryCount }) => getTransientRetryDelay(retryCount),
|
|
516
|
+
onRetry: ({ error, retryCount, delayMs, requestContext }) => emitTransientRetry(error, retryCount, delayMs, requestContext)
|
|
517
|
+
}
|
|
518
|
+
] }),
|
|
519
|
+
new PrefillErrorHandler()
|
|
520
|
+
]
|
|
521
|
+
});
|
|
522
|
+
const defaultModes = [
|
|
523
|
+
{
|
|
524
|
+
...buildMode,
|
|
525
|
+
metadata: {
|
|
526
|
+
...buildMode.metadata,
|
|
527
|
+
color: mastraBrand.green
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
...planMode,
|
|
532
|
+
metadata: {
|
|
533
|
+
...planMode.metadata,
|
|
534
|
+
color: mastraBrand.purple
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
...fastMode,
|
|
539
|
+
metadata: {
|
|
540
|
+
...fastMode.metadata,
|
|
541
|
+
color: mastraBrand.orange
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
];
|
|
545
|
+
const intervalHandlers = config?.intervalHandlers ?? [{
|
|
546
|
+
id: "gateway-sync",
|
|
547
|
+
intervalMs: 300 * 1e3,
|
|
548
|
+
immediate: false,
|
|
549
|
+
handler: () => syncGateways()
|
|
550
|
+
}];
|
|
551
|
+
const anthropicCred = authStorage.get("anthropic");
|
|
552
|
+
const openaiCred = authStorage.get("openai-codex");
|
|
553
|
+
const githubCopilotCred = authStorage.get("github-copilot");
|
|
554
|
+
const kimiCodingCred = authStorage.get("kimi-for-coding");
|
|
555
|
+
const startupAccess = {
|
|
556
|
+
anthropic: anthropicCred?.type === "oauth" ? "oauth" : anthropicCred?.type === "api_key" && anthropicCred.key.trim().length > 0 ? "apikey" : false,
|
|
557
|
+
openai: openaiCred?.type === "oauth" ? "oauth" : openaiCred?.type === "api_key" && openaiCred.key.trim().length > 0 ? "apikey" : false,
|
|
558
|
+
cerebras: process.env.CEREBRAS_API_KEY ? "apikey" : false,
|
|
559
|
+
google: process.env.GOOGLE_GENERATIVE_AI_API_KEY ? "apikey" : false,
|
|
560
|
+
deepseek: process.env.DEEPSEEK_API_KEY ? "apikey" : false,
|
|
561
|
+
"github-copilot": githubCopilotCred?.type === "oauth" ? "oauth" : false,
|
|
562
|
+
"kimi-for-coding": kimiCodingCred?.type === "oauth" && isKimiCodingDeviceId(kimiCodingCred.deviceId) ? "oauth" : kimiCodingCred?.type === "api_key" && kimiCodingCred.key.trim().length > 0 || Boolean(process.env.KIMI_API_KEY?.trim()) ? "apikey" : false
|
|
563
|
+
};
|
|
564
|
+
if (mgApiKey) {
|
|
565
|
+
if (!startupAccess.anthropic) startupAccess.anthropic = "apikey";
|
|
566
|
+
if (!startupAccess.openai) startupAccess.openai = "apikey";
|
|
567
|
+
}
|
|
568
|
+
try {
|
|
569
|
+
const registry = PROVIDER_REGISTRY;
|
|
570
|
+
for (const [provider, config] of Object.entries(registry)) {
|
|
571
|
+
if (startupAccess[provider] === "oauth" || startupAccess[provider] === "apikey") continue;
|
|
572
|
+
if (provider === "anthropic" || provider === "openai") continue;
|
|
573
|
+
const envVars = config?.apiKeyEnvVar;
|
|
574
|
+
if ((Array.isArray(envVars) ? envVars : envVars ? [envVars] : []).some((envVar) => process.env[envVar])) startupAccess[provider] = "apikey";
|
|
575
|
+
}
|
|
576
|
+
} catch {}
|
|
577
|
+
const builtinPacks = getAvailableModePacks(startupAccess);
|
|
578
|
+
const builtinOmPacks = getAvailableOmPacks(startupAccess);
|
|
579
|
+
const effectiveDefaults = resolveModelDefaults(globalSettings, builtinPacks);
|
|
580
|
+
const activeProviderId = effectiveDefaults.build?.split("/")[0];
|
|
581
|
+
const preferredOmModel = hasExplicitOMConfiguration(globalSettings) ? void 0 : selectPreferredOMPack(startupAccess, activeProviderId)?.modelId;
|
|
582
|
+
const effectiveObserverModel = resolveOmRoleModel(globalSettings, "observer", builtinOmPacks) || preferredOmModel;
|
|
583
|
+
const effectiveReflectorModel = resolveOmRoleModel(globalSettings, "reflector", builtinOmPacks) || preferredOmModel;
|
|
584
|
+
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
585
|
+
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
586
|
+
const effectiveCavemanObservations = globalSettings.models.omCavemanObservations ?? void 0;
|
|
587
|
+
const effectiveObserveAttachments = globalSettings.models.omObserveAttachments ?? "auto";
|
|
588
|
+
const modes = addPluginToolsToModeAllowlists(applyEffectiveDefaultsToModes(config?.modes ? config.modes : defaultModes, effectiveDefaults), Object.keys(pluginTools));
|
|
589
|
+
const defaultModeId = modes.find((mode) => mode.metadata?.default === true)?.id ?? modes.find((mode) => mode.id === "build")?.id ?? modes[0]?.id;
|
|
590
|
+
if (!defaultModeId) throw new Error("MastraCode requires at least one mode");
|
|
591
|
+
const subagentModeMap = {
|
|
592
|
+
explore: "fast",
|
|
593
|
+
plan: "plan",
|
|
594
|
+
execute: "build"
|
|
595
|
+
};
|
|
596
|
+
const disabledTools = new Set(config?.disabledTools);
|
|
597
|
+
const subagents = (config?.subagents ?? [
|
|
598
|
+
exploreSubagent,
|
|
599
|
+
planSubagent,
|
|
600
|
+
executeSubagent
|
|
601
|
+
]).map((definition) => ({
|
|
602
|
+
...definition,
|
|
603
|
+
...config?.subagents == null && { defaultModelId: modes.find((mode) => mode.id === subagentModeMap[definition.id])?.defaultModelId ?? modes.find((mode) => mode.id === defaultModeId)?.defaultModelId },
|
|
604
|
+
allowedControllerTools: definition.allowedControllerTools?.filter((name) => !disabledTools.has(name)),
|
|
605
|
+
allowedWorkspaceTools: definition.allowedWorkspaceTools?.filter((name) => !disabledTools.has(name)),
|
|
606
|
+
...definition.tools && { tools: Object.fromEntries(Object.entries(definition.tools).filter(([name]) => !disabledTools.has(name))) }
|
|
607
|
+
}));
|
|
608
|
+
const globalInitialState = {};
|
|
609
|
+
if (!config?.disableSettingsOmSeed) {
|
|
610
|
+
if (effectiveObserverModel) globalInitialState.observerModelId = effectiveObserverModel;
|
|
611
|
+
if (effectiveReflectorModel) globalInitialState.reflectorModelId = effectiveReflectorModel;
|
|
612
|
+
if (effectiveObservationThreshold !== void 0) globalInitialState.observationThreshold = effectiveObservationThreshold;
|
|
613
|
+
if (effectiveReflectionThreshold !== void 0) globalInitialState.reflectionThreshold = effectiveReflectionThreshold;
|
|
614
|
+
if (effectiveCavemanObservations !== void 0) globalInitialState.cavemanObservations = effectiveCavemanObservations;
|
|
615
|
+
if (effectiveObserveAttachments !== void 0) globalInitialState.observeAttachments = effectiveObserveAttachments;
|
|
616
|
+
}
|
|
617
|
+
if (globalSettings.preferences.yolo !== null) globalInitialState.yolo = globalSettings.preferences.yolo;
|
|
618
|
+
if (config?.omScope) globalInitialState.omScope = config.omScope;
|
|
619
|
+
for (const [key, modelId] of Object.entries(globalSettings.models.subagentModels)) if (key === "default" || key === "_default") globalInitialState.subagentModelId = modelId;
|
|
620
|
+
else globalInitialState[`subagentModelId_${key}`] = modelId;
|
|
621
|
+
const typedStateSchema = stateSchema;
|
|
622
|
+
const controller = new AgentController({
|
|
623
|
+
id: "mastra-code",
|
|
624
|
+
resourceId: project.resourceId,
|
|
625
|
+
storage,
|
|
626
|
+
observability,
|
|
627
|
+
memory,
|
|
628
|
+
pubsub: signalsPubSub,
|
|
629
|
+
stateSchema: typedStateSchema,
|
|
630
|
+
agent: codeAgent,
|
|
631
|
+
subagents,
|
|
632
|
+
gateways: [amazonBedrockGateway, mastraCodeGateway],
|
|
633
|
+
workspace: config?.workspace ?? ((args) => getDynamicWorkspace(args)),
|
|
634
|
+
browser: config?.browser,
|
|
635
|
+
idGenerator: config?.idGenerator,
|
|
636
|
+
toolCategoryResolver: getToolCategory,
|
|
637
|
+
initialState: {
|
|
638
|
+
projectPath: project.rootPath,
|
|
639
|
+
projectName: project.name,
|
|
640
|
+
gitBranch: project.gitBranch,
|
|
641
|
+
pluginSkillPaths: loadedPlugins.flatMap((plugin) => plugin.status === "active" ? plugin.skillPaths ?? [] : []),
|
|
642
|
+
pluginCommandPaths: loadedPlugins.flatMap((plugin) => plugin.status === "active" ? plugin.commandPaths ?? [] : []),
|
|
643
|
+
pluginInstructions: loadedPlugins.flatMap((plugin) => plugin.status === "active" && plugin.instructions ? [plugin.instructions] : []),
|
|
644
|
+
yolo: true,
|
|
645
|
+
...globalInitialState,
|
|
646
|
+
...config?.initialState,
|
|
647
|
+
configDir
|
|
648
|
+
},
|
|
649
|
+
modes,
|
|
650
|
+
intervalHandlers,
|
|
651
|
+
modelUseCountProvider: () => loadSettings().modelUseCounts,
|
|
652
|
+
modelUseCountTracker: (modelId) => {
|
|
653
|
+
try {
|
|
654
|
+
const settings = loadSettings();
|
|
655
|
+
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
656
|
+
saveSettings(settings);
|
|
657
|
+
} catch (error) {
|
|
658
|
+
console.error("Failed to persist model usage count", error);
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
threadLock: crossProcessPubSub ? void 0 : {
|
|
662
|
+
acquire: acquireThreadLock,
|
|
663
|
+
release: releaseThreadLock
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
pluginRuntimeController = controller;
|
|
667
|
+
if (pluginSignalLane && pluginManager) {
|
|
668
|
+
pluginSignalLane.sync(pluginManager.getPluginSignalProviders());
|
|
669
|
+
unsubscribePluginReload = pluginManager.onReload(() => pluginSignalLane.sync(pluginManager.getPluginSignalProviders()));
|
|
670
|
+
}
|
|
671
|
+
return {
|
|
672
|
+
controller,
|
|
673
|
+
storage,
|
|
674
|
+
storageMaintenance,
|
|
675
|
+
createKnowledgeInspector: (session) => createKnowledgeInspector({
|
|
676
|
+
storage,
|
|
677
|
+
session
|
|
678
|
+
}),
|
|
679
|
+
observability,
|
|
680
|
+
memory,
|
|
681
|
+
mcpManager,
|
|
682
|
+
hookManager,
|
|
683
|
+
pluginManager,
|
|
684
|
+
loadedPlugins,
|
|
685
|
+
pluginTools,
|
|
686
|
+
signalsPubSub,
|
|
687
|
+
authStorage,
|
|
688
|
+
resolveModel,
|
|
689
|
+
storageWarning,
|
|
690
|
+
observabilityWarning,
|
|
691
|
+
builtinPacks,
|
|
692
|
+
builtinOmPacks,
|
|
693
|
+
effectiveDefaults,
|
|
694
|
+
githubSignals,
|
|
695
|
+
sessionId,
|
|
696
|
+
ownerId,
|
|
697
|
+
projectPath: project.rootPath,
|
|
698
|
+
codeAgent,
|
|
699
|
+
setActiveSession: (session) => {
|
|
700
|
+
activeSession = session;
|
|
701
|
+
},
|
|
702
|
+
/**
|
|
703
|
+
* Starts the signal providers contributed by plugins. Called by the
|
|
704
|
+
* composition layer once the controller is inited, because that is when a
|
|
705
|
+
* Mastra instance exists — a provider without one has no storage, and
|
|
706
|
+
* nothing else will hand it one: the Agent propagates Mastra only to the
|
|
707
|
+
* providers in its own `signals` array, which these deliberately are not in.
|
|
708
|
+
*/
|
|
709
|
+
startPluginSignalProviders: () => {
|
|
710
|
+
const mastra = controller.getMastra();
|
|
711
|
+
if (!pluginSignalLane || !mastra) return;
|
|
712
|
+
pluginSignalLane.setMastra(mastra, codeAgent);
|
|
713
|
+
},
|
|
714
|
+
/**
|
|
715
|
+
* Stops every plugin-contributed signal provider and stops listening for
|
|
716
|
+
* plugin reloads. The inverse of `startPluginSignalProviders`, for an
|
|
717
|
+
* embedder that is done with this controller: a `pluginManager` shared
|
|
718
|
+
* across controllers (`MastraCodeConfig.pluginManager`) outlives any one of
|
|
719
|
+
* them, so without this its providers keep polling and its reload listener
|
|
720
|
+
* keeps firing for a controller that is gone.
|
|
721
|
+
*/
|
|
722
|
+
stopPluginSignalProviders: () => {
|
|
723
|
+
unsubscribePluginReload?.();
|
|
724
|
+
unsubscribePluginReload = void 0;
|
|
725
|
+
pluginSignalLane?.stopAll();
|
|
726
|
+
},
|
|
727
|
+
/**
|
|
728
|
+
* Hands Mastra to the statically configured input processors.
|
|
729
|
+
*
|
|
730
|
+
* The Agent does this itself, but only for processors configured as a
|
|
731
|
+
* plain array (`Array.isArray` in `__registerMastra`). This lane is a
|
|
732
|
+
* function so plugins can contribute to it, which takes those processors
|
|
733
|
+
* out of that branch — including any an embedder passed as
|
|
734
|
+
* `config.inputProcessors`, some of which need Mastra to work at all
|
|
735
|
+
* (`CostGuardProcessor` reads observability storage there). Doing it here
|
|
736
|
+
* keeps that unchanged.
|
|
737
|
+
*
|
|
738
|
+
* Plugin processors are deliberately not included: they come and go with
|
|
739
|
+
* their plugin, and the registry keeps the first instance registered under
|
|
740
|
+
* an id forever, which would leave a retired instance behind. Plugins
|
|
741
|
+
* reach Mastra through `getController()` on the plugin context instead.
|
|
742
|
+
*/
|
|
743
|
+
registerConfiguredProcessorsWithMastra: () => {
|
|
744
|
+
const mastra = controller.getMastra();
|
|
745
|
+
if (!mastra) return;
|
|
746
|
+
for (const processor of mastraCodeInputProcessors) {
|
|
747
|
+
mastra.addProcessor(processor);
|
|
748
|
+
mastra.addProcessorConfiguration(processor, CODE_AGENT_ID, "input");
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Wires the session-scoped concerns MastraCode layers on top of a Session:
|
|
755
|
+
* hookManager thread-id sync, GitHub PR polling for the current thread, and
|
|
756
|
+
* per-thread persistence of the mastracode-only `/om` settings.
|
|
757
|
+
*
|
|
758
|
+
* Used by {@link bootLocalAgentController} for the single local session. A server can
|
|
759
|
+
* call this for any session it mints if it wants the same background wiring.
|
|
760
|
+
*/
|
|
761
|
+
async function wireSessionConcerns(base, session) {
|
|
762
|
+
const { hookManager, githubSignals } = base;
|
|
763
|
+
base.setActiveSession(session);
|
|
764
|
+
if (hookManager) session.subscribe((event) => {
|
|
765
|
+
if (event.type === "thread_changed") hookManager.setSessionId(event.threadId);
|
|
766
|
+
else if (event.type === "thread_created") hookManager.setSessionId(event.thread.id);
|
|
767
|
+
});
|
|
768
|
+
if (githubSignals) {
|
|
769
|
+
const startGithubPollingForCurrentThread = async (threadId) => {
|
|
770
|
+
if (!threadId) return;
|
|
771
|
+
githubSignals.stopAllPolling();
|
|
772
|
+
try {
|
|
773
|
+
const thread = (await session.thread.list({ allResources: true })).find((item) => item.id === threadId);
|
|
774
|
+
await githubSignals.startPollingForThread({
|
|
775
|
+
threadId,
|
|
776
|
+
resourceId: thread?.resourceId ?? session.identity.getResourceId()
|
|
777
|
+
}, { pollImmediately: true });
|
|
778
|
+
} catch (error) {
|
|
779
|
+
console.warn("Failed to start GitHub PR polling:", error);
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
session.subscribe((event) => {
|
|
783
|
+
if (event.type === "thread_changed") startGithubPollingForCurrentThread(event.threadId);
|
|
784
|
+
else if (event.type === "thread_created") startGithubPollingForCurrentThread(event.thread.id);
|
|
785
|
+
});
|
|
786
|
+
startGithubPollingForCurrentThread(session.thread.getId());
|
|
787
|
+
}
|
|
788
|
+
const omThreadStateSession = session;
|
|
789
|
+
attachOMThreadStatePersistence(omThreadStateSession);
|
|
790
|
+
await restoreOMThreadStateForCurrentThread(omThreadStateSession).catch(() => {});
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Case 3 (AgentController local + TUI/headless): build the controller, let it stand up its
|
|
794
|
+
* own internal Mastra via `init()`, and mint the single eager session that all
|
|
795
|
+
* work in this process runs through. The AgentController owns no session of its own.
|
|
796
|
+
*/
|
|
797
|
+
async function bootLocalAgentController(config) {
|
|
798
|
+
const base = await createMastraCodeAgentController(config);
|
|
799
|
+
const { controller, sessionId, ownerId, projectPath, codeAgent, mcpManager } = base;
|
|
800
|
+
await controller.init();
|
|
801
|
+
const mastra = controller.getMastra();
|
|
802
|
+
if (mastra) await registerWorkflowBuilderPrimitives(mastra, {
|
|
803
|
+
projectPath,
|
|
804
|
+
codeAgent,
|
|
805
|
+
mcpManager
|
|
806
|
+
});
|
|
807
|
+
await mastra?.startWorkers();
|
|
808
|
+
base.registerConfiguredProcessorsWithMastra();
|
|
809
|
+
base.startPluginSignalProviders();
|
|
810
|
+
const session = await controller.createSession({
|
|
811
|
+
id: sessionId,
|
|
812
|
+
ownerId
|
|
813
|
+
});
|
|
814
|
+
await wireSessionConcerns(base, session);
|
|
815
|
+
const knowledgeInspector = await base.createKnowledgeInspector(session);
|
|
816
|
+
return {
|
|
817
|
+
...base,
|
|
818
|
+
session,
|
|
819
|
+
knowledgeInspector,
|
|
820
|
+
knowledgeInspectorUnavailableReason: knowledgeInspector ? void 0 : "Knowledge inspection requires a configured knowledge storage domain."
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Cases 1 & 2 (AgentController in Server + Web/TUI): build the controller, register it on a
|
|
825
|
+
* server-owned Mastra, THEN init it. Registering before `init()` is what makes
|
|
826
|
+
* the controller inherit the server's Mastra (storage, agents, gateways) instead of
|
|
827
|
+
* spinning up its own internal one — there is a single shared Mastra.
|
|
828
|
+
*
|
|
829
|
+
* No eager session is minted: each client (browser or terminal) creates/resumes
|
|
830
|
+
* its own isolated session via `controller.createSession({ resourceId })`, so one
|
|
831
|
+
* server can drive many concurrent users.
|
|
832
|
+
*
|
|
833
|
+
* Pass an existing `mastra` to mount onto a Mastra that already hosts other
|
|
834
|
+
* primitives; otherwise a Mastra is created that owns the controller's storage so
|
|
835
|
+
* durability is configured in one place.
|
|
836
|
+
*/
|
|
837
|
+
async function mountAgentControllerOnMastra(config) {
|
|
838
|
+
const prepared = await prepareAgentControllerMount(config);
|
|
839
|
+
if (config?.mastra) {
|
|
840
|
+
prepared.base.controller.__registerMastra(config.mastra);
|
|
841
|
+
await prepared.finalize();
|
|
842
|
+
return {
|
|
843
|
+
...prepared.base,
|
|
844
|
+
mastra: config.mastra
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
const mastra = new Mastra(prepared.mastraArgs);
|
|
848
|
+
await prepared.finalize();
|
|
849
|
+
return {
|
|
850
|
+
...prepared.base,
|
|
851
|
+
mastra
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Assemble everything needed to construct the server-owned Mastra WITHOUT
|
|
856
|
+
* constructing it, so a caller (the platform entry `src/mastra/index.ts`) can
|
|
857
|
+
* run the `new Mastra(...)` literal in its own module. The deployer's
|
|
858
|
+
* `checkConfigExport` Babel plugin only marks the config valid when it finds a
|
|
859
|
+
* top-level `new Mastra(...)` exported as `mastra` in the ENTRY file; hiding the
|
|
860
|
+
* construction inside this helper would trip the "Invalid Mastra config" warning.
|
|
861
|
+
*
|
|
862
|
+
* Returns the constructor args plus a `finalize()` that runs the post-construct
|
|
863
|
+
* boot (`controller.init()` + `startWorkers()`). The controller is registered on
|
|
864
|
+
* the Mastra via the `agentControllers` arg at construction time.
|
|
865
|
+
*/
|
|
866
|
+
async function prepareAgentControllerMount(config) {
|
|
867
|
+
const base = await createMastraCodeAgentController(config);
|
|
868
|
+
const { controller, storage, authStorage, projectPath, codeAgent, mcpManager } = base;
|
|
869
|
+
const controllerId = config?.controllerId ?? controller.id;
|
|
870
|
+
const apiRoutes = config?.buildApiRoutes?.({
|
|
871
|
+
controller,
|
|
872
|
+
authStorage
|
|
873
|
+
});
|
|
874
|
+
const extraServerConfig = config?.buildServerConfig?.({
|
|
875
|
+
controller,
|
|
876
|
+
authStorage
|
|
877
|
+
});
|
|
878
|
+
const weOwnTheMastra = !config?.mastra;
|
|
879
|
+
const serverConfig = {
|
|
880
|
+
...extraServerConfig,
|
|
881
|
+
...apiRoutes?.length ? { apiRoutes } : {}
|
|
882
|
+
};
|
|
883
|
+
const mastraArgs = {
|
|
884
|
+
agentControllers: { [controllerId]: controller },
|
|
885
|
+
storage,
|
|
886
|
+
...base.signalsPubSub ? { pubsub: base.signalsPubSub } : {},
|
|
887
|
+
...Object.keys(serverConfig).length ? { server: serverConfig } : {}
|
|
888
|
+
};
|
|
889
|
+
const finalize = async () => {
|
|
890
|
+
await controller.init();
|
|
891
|
+
if (weOwnTheMastra) {
|
|
892
|
+
const mastra = controller.getMastra();
|
|
893
|
+
if (mastra) await registerWorkflowBuilderPrimitives(mastra, {
|
|
894
|
+
projectPath,
|
|
895
|
+
codeAgent,
|
|
896
|
+
mcpManager
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
await controller.getMastra()?.startWorkers();
|
|
900
|
+
base.registerConfiguredProcessorsWithMastra();
|
|
901
|
+
base.startPluginSignalProviders();
|
|
902
|
+
};
|
|
903
|
+
return {
|
|
904
|
+
base,
|
|
905
|
+
mastraArgs,
|
|
906
|
+
finalize
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Back-compat alias. Historically `createMastraCode` built and booted a local
|
|
911
|
+
* controller with a single session; that behavior now lives in
|
|
912
|
+
* {@link bootLocalAgentController}. New code should call the explicit factory for its
|
|
913
|
+
* case: `bootLocalAgentController` (local) or {@link mountAgentControllerOnMastra} (server).
|
|
914
|
+
*/
|
|
915
|
+
const createMastraCode = bootLocalAgentController;
|
|
916
|
+
//#endregion
|
|
917
|
+
export { KnowledgeInspectorError, LOCAL_KNOWLEDGE_ORG_ID, autoApprovePolicy, bootLocalAgentController, createAuthStorage, createKnowledgeInspector, createMastraCode, createMastraCodeAgentController, denyPolicy, formatHuman, formatJsonl, hasHeadlessFlag, mountAgentControllerOnMastra, permissionModeToPolicy, prepareAgentControllerMount, renderJsonResult, renderTextResult, runMC, runMCCli, wireSessionConcerns };
|
|
918
|
+
|
|
919
|
+
//# sourceMappingURL=index.js.map
|