@mastra/code-sdk 0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
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/CHANGELOG.md +285 -0
- package/LICENSE.md +30 -0
- package/README.md +50 -0
- package/dist/acp/agent.d.ts +35 -0
- package/dist/acp/agent.d.ts.map +1 -0
- package/dist/acp/agent.js +173 -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 +166 -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 +54 -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 +34 -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 +5 -0
- package/dist/acp.js.map +1 -0
- package/dist/agents/instructions.d.ts +6 -0
- package/dist/agents/instructions.d.ts.map +1 -0
- package/dist/agents/instructions.js +41 -0
- package/dist/agents/instructions.js.map +1 -0
- package/dist/agents/mastracode-gateway.d.ts +67 -0
- package/dist/agents/mastracode-gateway.d.ts.map +1 -0
- package/dist/agents/mastracode-gateway.js +446 -0
- package/dist/agents/mastracode-gateway.js.map +1 -0
- package/dist/agents/memory.d.ts +13 -0
- package/dist/agents/memory.d.ts.map +1 -0
- package/dist/agents/memory.js +107 -0
- package/dist/agents/memory.js.map +1 -0
- package/dist/agents/model.d.ts +55 -0
- package/dist/agents/model.d.ts.map +1 -0
- package/dist/agents/model.js +115 -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 +45 -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 +38 -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 +38 -0
- package/dist/agents/modes/plan.js.map +1 -0
- package/dist/agents/prompts/agent-instructions.d.ts +20 -0
- package/dist/agents/prompts/agent-instructions.d.ts.map +1 -0
- package/dist/agents/prompts/agent-instructions.js +82 -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 +73 -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 +22 -0
- package/dist/agents/prompts/fast.js.map +1 -0
- package/dist/agents/prompts/index.d.ts +19 -0
- package/dist/agents/prompts/index.d.ts.map +1 -0
- package/dist/agents/prompts/index.js +57 -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 +22 -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 +107 -0
- package/dist/agents/prompts/plan.js.map +1 -0
- package/dist/agents/prompts/tool-guidance.d.ts +13 -0
- package/dist/agents/prompts/tool-guidance.d.ts.map +1 -0
- package/dist/agents/prompts/tool-guidance.js +181 -0
- package/dist/agents/prompts/tool-guidance.js.map +1 -0
- package/dist/agents/sandbox-filesystem.d.ts +89 -0
- package/dist/agents/sandbox-filesystem.d.ts.map +1 -0
- package/dist/agents/sandbox-filesystem.js +268 -0
- package/dist/agents/sandbox-filesystem.js.map +1 -0
- package/dist/agents/sandbox-reattach.d.ts +19 -0
- package/dist/agents/sandbox-reattach.d.ts.map +1 -0
- package/dist/agents/sandbox-reattach.js +17 -0
- package/dist/agents/sandbox-reattach.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 +96 -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 +105 -0
- package/dist/agents/tool-availability.js.map +1 -0
- package/dist/agents/tools.d.ts +19 -0
- package/dist/agents/tools.d.ts.map +1 -0
- package/dist/agents/tools.js +145 -0
- package/dist/agents/tools.js.map +1 -0
- package/dist/agents/workspace.d.ts +22 -0
- package/dist/agents/workspace.d.ts.map +1 -0
- package/dist/agents/workspace.js +226 -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 +152 -0
- package/dist/analytics.js.map +1 -0
- package/dist/auth/index.d.ts +9 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +11 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/pkce.d.ts +13 -0
- package/dist/auth/pkce.d.ts.map +1 -0
- package/dist/auth/pkce.js +21 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/providers/anthropic.d.ts +17 -0
- package/dist/auth/providers/anthropic.d.ts.map +1 -0
- package/dist/auth/providers/anthropic.js +94 -0
- package/dist/auth/providers/anthropic.js.map +1 -0
- package/dist/auth/providers/github-copilot.d.ts +100 -0
- package/dist/auth/providers/github-copilot.d.ts.map +1 -0
- package/dist/auth/providers/github-copilot.js +302 -0
- package/dist/auth/providers/github-copilot.js.map +1 -0
- package/dist/auth/providers/openai-codex.d.ts +95 -0
- package/dist/auth/providers/openai-codex.d.ts.map +1 -0
- package/dist/auth/providers/openai-codex.js +527 -0
- package/dist/auth/providers/openai-codex.js.map +1 -0
- package/dist/auth/storage.d.ts +91 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +187 -0
- package/dist/auth/storage.js.map +1 -0
- package/dist/auth/types.d.ts +68 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/clipboard/index.d.ts +26 -0
- package/dist/clipboard/index.d.ts.map +1 -0
- package/dist/clipboard/index.js +192 -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 +23 -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 +14 -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 +120 -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 +8 -0
- package/dist/evals/index.js.map +1 -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 +52 -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 +201 -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 +56 -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 +7 -0
- package/dist/evals/scorers/index.js.map +1 -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 +238 -0
- package/dist/evals/scorers/outcome.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 +196 -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 +188 -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 +85 -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 +32 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/headless/policy.d.ts +17 -0
- package/dist/headless/policy.d.ts.map +1 -0
- package/dist/headless/policy.js +38 -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 +296 -0
- package/dist/headless/run-mc.js.map +1 -0
- package/dist/headless/types.d.ts +134 -0
- package/dist/headless/types.d.ts.map +1 -0
- package/dist/headless/types.js +9 -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 +78 -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 +125 -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 +16 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/manager.d.ts +47 -0
- package/dist/hooks/manager.d.ts.map +1 -0
- package/dist/hooks/manager.js +284 -0
- package/dist/hooks/manager.js.map +1 -0
- package/dist/hooks/types.d.ts +152 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +7 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/index.d.ts +243 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +730 -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 +24 -0
- package/dist/ipc/ipc-reporter.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 +309 -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 +9 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/language.d.ts +9 -0
- package/dist/lsp/language.d.ts.map +1 -0
- package/dist/lsp/language.js +48 -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 +97 -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 +128 -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 +52 -0
- package/dist/lsp/workspace.js.map +1 -0
- package/dist/mcp/config.d.ts +34 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/config.js +205 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +10 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/manager.d.ts +49 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/manager.js +374 -0
- package/dist/mcp/manager.js.map +1 -0
- package/dist/mcp/types.d.ts +85 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +1 -0
- package/dist/mcp/types.js.map +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 +20 -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 +28 -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 +21 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/onboarding/om-settings.d.ts +20 -0
- package/dist/onboarding/om-settings.d.ts.map +1 -0
- package/dist/onboarding/om-settings.js +26 -0
- package/dist/onboarding/om-settings.js.map +1 -0
- package/dist/onboarding/packs.d.ts +48 -0
- package/dist/onboarding/packs.d.ts.map +1 -0
- package/dist/onboarding/packs.js +111 -0
- package/dist/onboarding/packs.js.map +1 -0
- package/dist/onboarding/settings.d.ts +327 -0
- package/dist/onboarding/settings.d.ts.map +1 -0
- package/dist/onboarding/settings.js +598 -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 +119 -0
- package/dist/permissions.js.map +1 -0
- package/dist/plugin.d.ts +81 -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 +111 -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 +200 -0
- package/dist/plugins/install.js.map +1 -0
- package/dist/plugins/loader.d.ts +15 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +221 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manager.d.ts +60 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +378 -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 +75 -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 +77 -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 +26 -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 +96 -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 +152 -0
- package/dist/plugins/scaffold.js.map +1 -0
- package/dist/plugins/types.d.ts +45 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +1 -0
- package/dist/plugins/types.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 +53 -0
- package/dist/processors/plan-rejection-abort.js.map +1 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts +40 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts.map +1 -0
- package/dist/providers/amazon-bedrock-gateway.js +79 -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 +62 -0
- package/dist/providers/amazon-bedrock.js.map +1 -0
- package/dist/providers/claude-max.d.ts +50 -0
- package/dist/providers/claude-max.d.ts.map +1 -0
- package/dist/providers/claude-max.js +151 -0
- package/dist/providers/claude-max.js.map +1 -0
- package/dist/providers/github-copilot.d.ts +58 -0
- package/dist/providers/github-copilot.d.ts.map +1 -0
- package/dist/providers/github-copilot.js +263 -0
- package/dist/providers/github-copilot.js.map +1 -0
- package/dist/providers/openai-codex.d.ts +70 -0
- package/dist/providers/openai-codex.d.ts.map +1 -0
- package/dist/providers/openai-codex.js +291 -0
- package/dist/providers/openai-codex.js.map +1 -0
- package/dist/schema.d.ts +167 -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 +17 -0
- package/dist/theme-palette.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 +43 -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 +9 -0
- package/dist/tools/index.js.map +1 -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 +88 -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 +22 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/tools/web-search.d.ts +35 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +65 -0
- package/dist/tools/web-search.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 +74 -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 +55 -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 +207 -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 +49 -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 +9 -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 +43 -0
- package/dist/utils/plan-diff.js.map +1 -0
- package/dist/utils/plans.d.ts +56 -0
- package/dist/utils/plans.d.ts.map +1 -0
- package/dist/utils/plans.js +99 -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 +302 -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 +104 -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 +177 -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 +96 -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 +72 -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 +101 -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 +236 -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 +108 -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 +52 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +177 -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 +126 -0
- package/dist/voice/stt-registry.js.map +1 -0
- package/package.json +94 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# @mastra/code-sdk
|
|
2
|
+
|
|
3
|
+
## 0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`45613c6`](https://github.com/mastra-ai/mastra/commit/45613c6507f3521909646ff1836cdde903553d8c), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb), [`13d2d44`](https://github.com/mastra-ai/mastra/commit/13d2d4476d78ce1aaede10dc83fb64108c9b9d82), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2)]:
|
|
8
|
+
- @mastra/core@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
9
|
+
- @mastra/observability@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
10
|
+
- @mastra/stagehand@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
11
|
+
- @mastra/memory@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
12
|
+
- @mastra/agent-browser@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
13
|
+
- @mastra/tavily@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
14
|
+
- @mastra/mcp@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
15
|
+
- @mastra/github-signals@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
16
|
+
- @mastra/duckdb@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
17
|
+
- @mastra/libsql@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
18
|
+
- @mastra/pg@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
|
|
19
|
+
|
|
20
|
+
## 0.1.1-alpha.0
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [[`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb), [`13d2d44`](https://github.com/mastra-ai/mastra/commit/13d2d4476d78ce1aaede10dc83fb64108c9b9d82), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2)]:
|
|
25
|
+
- @mastra/core@1.51.1-alpha.0
|
|
26
|
+
- @mastra/stagehand@0.3.1-alpha.0
|
|
27
|
+
- @mastra/memory@1.23.1-alpha.0
|
|
28
|
+
|
|
29
|
+
## 0.1.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- Added support for async `extraTools` providers in `MastraCodeConfig`. The `extraTools` option now accepts an async function that receives the request context, so tools can be resolved per session (for example, only exposing an integration tool when the current project has that integration connected). ([#19369](https://github.com/mastra-ai/mastra/pull/19369))
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
const mastraCode = await createMastraCode({
|
|
37
|
+
extraTools: async ({ requestContext }) => {
|
|
38
|
+
const controller = requestContext.get('controller');
|
|
39
|
+
if (!(await hasLinearConnection(controller?.resourceId))) return {};
|
|
40
|
+
return { linear_get_issue: linearGetIssueTool };
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Added a post-tool observer for custom Mastra Code integrations to react to completed tool calls without replacing built-in tools. ([#19446](https://github.com/mastra-ai/mastra/pull/19446))
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
await mountAgentControllerOnMastra({
|
|
49
|
+
postToolObserver: ({ toolName, output }) => logToolResult(toolName, output),
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Renamed the Gateway constants exported from `@mastra/code-sdk/onboarding/settings` and added `MastraCodeGateway.getMastraGatewayApiKey()` so they match the Gateway product name. The old constant and method names keep working as deprecated aliases, and the stored values are unchanged. ([#18691](https://github.com/mastra-ai/mastra/pull/18691))
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// Before
|
|
57
|
+
import { MEMORY_GATEWAY_PROVIDER, MEMORY_GATEWAY_DEFAULT_URL } from '@mastra/code-sdk/onboarding/settings';
|
|
58
|
+
|
|
59
|
+
// After
|
|
60
|
+
import { MASTRA_GATEWAY_PROVIDER, MASTRA_GATEWAY_DEFAULT_URL } from '@mastra/code-sdk/onboarding/settings';
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- Publish the Mastra Code agent core as `@mastra/code-sdk` (previously the internal `@internal/mastracode` package), so third parties can build their own UIs and surfaces on top of the Mastra Code coding agent. The `mastracode` CLI now consumes it as a regular runtime dependency instead of bundling it into its published output. ([#18986](https://github.com/mastra-ai/mastra/pull/18986))
|
|
64
|
+
|
|
65
|
+
- Improved GitHub plugin dependency installs by requiring exact pnpm versions and running them through Corepack, with an actionable setup error when Corepack is unavailable. ([#19288](https://github.com/mastra-ai/mastra/pull/19288))
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- dependencies updates: ([#16699](https://github.com/mastra-ai/mastra/pull/16699))
|
|
70
|
+
- Updated dependency [`@ai-sdk/amazon-bedrock@^3.0.105` ↗︎](https://www.npmjs.com/package/@ai-sdk/amazon-bedrock/v/3.0.105) (from `^3.0.102`, in `dependencies`)
|
|
71
|
+
- Updated dependency [`@ai-sdk/anthropic@^3.0.92` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.92) (from `^3.0.82`, in `dependencies`)
|
|
72
|
+
- Updated dependency [`@ai-sdk/openai@^3.0.80` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai/v/3.0.80) (from `^3.0.63`, in `dependencies`)
|
|
73
|
+
- Updated dependency [`@ai-sdk/openai-compatible@^2.0.56` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai-compatible/v/2.0.56) (from `^2.0.47`, in `dependencies`)
|
|
74
|
+
- Updated dependency [`ai@^6.0.219` ↗︎](https://www.npmjs.com/package/ai/v/6.0.219) (from `^6.0.176`, in `dependencies`)
|
|
75
|
+
|
|
76
|
+
- dependencies updates: ([#19385](https://github.com/mastra-ai/mastra/pull/19385))
|
|
77
|
+
- Updated dependency [`@ai-sdk/anthropic@^3.0.96` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.96) (from `^3.0.92`, in `dependencies`)
|
|
78
|
+
- Updated dependency [`@ai-sdk/openai@^3.0.84` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai/v/3.0.84) (from `^3.0.80`, in `dependencies`)
|
|
79
|
+
- Updated dependency [`@ai-sdk/openai-compatible@^2.0.59` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai-compatible/v/2.0.59) (from `^2.0.56`, in `dependencies`)
|
|
80
|
+
- Updated dependency [`ai@^6.0.224` ↗︎](https://www.npmjs.com/package/ai/v/6.0.224) (from `^6.0.219`, in `dependencies`)
|
|
81
|
+
|
|
82
|
+
- Fixed the server-owned Mastra instance created by prepareAgentControllerMount ignoring a configured PubSub. When you pass a distributed pubsub (for example Redis Streams) to the agent controller, the mounted Mastra now runs its event bus on the same transport, so streams, workflows, and signals work across multiple server processes. ([#19431](https://github.com/mastra-ai/mastra/pull/19431))
|
|
83
|
+
|
|
84
|
+
- Fixed secure discovery of symlinked custom commands and skills. ([#19279](https://github.com/mastra-ai/mastra/pull/19279))
|
|
85
|
+
|
|
86
|
+
- Removed invalid CommonJS export entries from @mastra/code-sdk so package resolution matches the published ESM output. ([#19127](https://github.com/mastra-ai/mastra/pull/19127))
|
|
87
|
+
|
|
88
|
+
- Added the authoritative session scope to agent controller request context for scoped session integrations. ([#19446](https://github.com/mastra-ai/mastra/pull/19446))
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
const controllerContext = requestContext.get('controller');
|
|
92
|
+
console.log(controllerContext?.scope);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- Updated dependencies [[`bd6d240`](https://github.com/mastra-ai/mastra/commit/bd6d2402db93dddaef0721667e7e8a030e7c6e16), [`0111486`](https://github.com/mastra-ai/mastra/commit/01114867612593eef5cfa2fda6a1194dfedda841), [`96a3749`](https://github.com/mastra-ai/mastra/commit/96a37492235f5b8076b3e3177d83ed5a5e44a640), [`fe1bda0`](https://github.com/mastra-ai/mastra/commit/fe1bda06f6af92a694a51712db747cda1e7185f0), [`25e7c12`](https://github.com/mastra-ai/mastra/commit/25e7c126a770069ae7fb7ecf1d2adb40e017b009), [`1ce5121`](https://github.com/mastra-ai/mastra/commit/1ce512155d122bb21f47d98383e82ffbf84b39e8), [`fb8aea3`](https://github.com/mastra-ai/mastra/commit/fb8aea384291e77311be3a64ee1717320d5c3c73), [`4adc391`](https://github.com/mastra-ai/mastra/commit/4adc3911075249c352bb4832d2471922826344de), [`a5c6337`](https://github.com/mastra-ai/mastra/commit/a5c6337d23c7686c81a32ce62f550f610543a240), [`031931a`](https://github.com/mastra-ai/mastra/commit/031931a715405fb90759b1903c9c25cbf05994af), [`3cfc47a`](https://github.com/mastra-ai/mastra/commit/3cfc47a6b89940aadd0f46fb01ae9624a73a865d), [`eb70da9`](https://github.com/mastra-ai/mastra/commit/eb70da98e1007b18e1463d75121bc07db55f8e09), [`2bb7817`](https://github.com/mastra-ai/mastra/commit/2bb78176112fde628483de2830528f7eee911e56), [`51d9870`](https://github.com/mastra-ai/mastra/commit/51d987032c689c2855374d0f244f5d654da809d1), [`5cab274`](https://github.com/mastra-ai/mastra/commit/5cab2744250e22d12fefa7b32637dce224233cee), [`7fa27d3`](https://github.com/mastra-ai/mastra/commit/7fa27d3b6f5ed68cd34e454a4d3ad9c482a0cfbc), [`8b97958`](https://github.com/mastra-ai/mastra/commit/8b979589f9aa59ba67cac565949475f2ffeb4ac3), [`8410541`](https://github.com/mastra-ai/mastra/commit/84105412c60ecd3bb33a9838146f59c4b588228f), [`a58dcbb`](https://github.com/mastra-ai/mastra/commit/a58dcbb546d7e1d65ebdc1f39e55f0908fcd9391), [`aa38805`](https://github.com/mastra-ai/mastra/commit/aa38805b878b827403be785eb90688d7172f5a40), [`153bd3b`](https://github.com/mastra-ai/mastra/commit/153bd3b396bdfed6b74cf43de12db8fd2d83c04a), [`45a8e65`](https://github.com/mastra-ai/mastra/commit/45a8e65e1556d1362cb3f25187023c36de26661d), [`e955965`](https://github.com/mastra-ai/mastra/commit/e955965dce575a903e37cf054d28ea99aa48785e), [`bc1121a`](https://github.com/mastra-ai/mastra/commit/bc1121a7bb98f7cd73e82e3a7913a667a9fa9911), [`2d22570`](https://github.com/mastra-ai/mastra/commit/2d22570c7dfdd02123d0ecc529efb05ccba2d9fc), [`07bb863`](https://github.com/mastra-ai/mastra/commit/07bb8631919c6f7cf377dccd45b096e0f17fbed0), [`171c3a2`](https://github.com/mastra-ai/mastra/commit/171c3a23f36199ad1354166fb515b22b57f310c2), [`c8ed116`](https://github.com/mastra-ai/mastra/commit/c8ed11699f62bcac70102ab4ec84d80d20541da6), [`01b338c`](https://github.com/mastra-ai/mastra/commit/01b338c56271f0219606710e3e8b26dee27ac6c2), [`bd4d720`](https://github.com/mastra-ai/mastra/commit/bd4d720458e42c49b6829c4662812332be32cfcf), [`aac3e5a`](https://github.com/mastra-ai/mastra/commit/aac3e5a098b08077c7d5020d782d6353b217797c), [`a99eae8`](https://github.com/mastra-ai/mastra/commit/a99eae8908e500c1b2d12f9d277be616b98617a5), [`860ef7e`](https://github.com/mastra-ai/mastra/commit/860ef7e77d92b63469cbe5857aa1e626197e43e9), [`17e818c`](https://github.com/mastra-ai/mastra/commit/17e818c51a958ba90641b1a959dc38faf8c034e9), [`edce8d2`](https://github.com/mastra-ai/mastra/commit/edce8d2769f19e27a05737c627af2d765472a4f8), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`8b7361d`](https://github.com/mastra-ai/mastra/commit/8b7361d35de68b80d05d30a74e0c69e7218fd612), [`1d39058`](https://github.com/mastra-ai/mastra/commit/1d39058e548efd691799985d5c8af2737f1c3bd2), [`3927473`](https://github.com/mastra-ai/mastra/commit/392747323ddb10c643d12be7b9ae913159dfaeed), [`dce50dc`](https://github.com/mastra-ai/mastra/commit/dce50dc9a1c1fcd0f427bb5f6250ec74910cb04b), [`85fb642`](https://github.com/mastra-ai/mastra/commit/85fb642f4d112d0da9f39808617397f7e47fe622), [`6789ab4`](https://github.com/mastra-ai/mastra/commit/6789ab4191ddcd32a932898b360b191e80cee1a9), [`fd13f8e`](https://github.com/mastra-ai/mastra/commit/fd13f8e21990f9904c3eedba3a626bb4a929cdb8), [`634caff`](https://github.com/mastra-ai/mastra/commit/634caff29a9200ad058b67d53f96d9e5832fb8a2), [`f703f87`](https://github.com/mastra-ai/mastra/commit/f703f878de072d51fda557f9c50867d8252bef05), [`481c112`](https://github.com/mastra-ai/mastra/commit/481c1125b752489673ec671fcb7ca80f9c86ffb1), [`c43f3a9`](https://github.com/mastra-ai/mastra/commit/c43f3a9d1efde99b38789364ba4d0ba670f430e3), [`2eb656e`](https://github.com/mastra-ai/mastra/commit/2eb656ecb64671d4a95e3c94bf507ce6a0ef9e3b), [`3e26c87`](https://github.com/mastra-ai/mastra/commit/3e26c87de0c5bc2583b795ce6ca5889b6b161acb), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669), [`33f2b88`](https://github.com/mastra-ai/mastra/commit/33f2b88842c09a567f906fac4cb61cd5277ced59), [`0ad646f`](https://github.com/mastra-ai/mastra/commit/0ad646f71a530f2454664299e5e01bfd13fa12e5), [`177010f`](https://github.com/mastra-ai/mastra/commit/177010ff096d2e4b28d89803be5b1a4cad2a0d6b), [`0ad646f`](https://github.com/mastra-ai/mastra/commit/0ad646f71a530f2454664299e5e01bfd13fa12e5), [`b486abf`](https://github.com/mastra-ai/mastra/commit/b486abfa2a7528c6f527e4015c819ea9fa54aaad), [`54a51e0`](https://github.com/mastra-ai/mastra/commit/54a51e0a484fe1ebad3fb1f7ef5282a075709eb7), [`c43f3a9`](https://github.com/mastra-ai/mastra/commit/c43f3a9d1efde99b38789364ba4d0ba670f430e3), [`a5008f2`](https://github.com/mastra-ai/mastra/commit/a5008f22ae710ad9402ea9f2547d8c02f74d384b), [`e2d5f37`](https://github.com/mastra-ai/mastra/commit/e2d5f373bd289be534d5f8694d34465010533df6), [`1b6e676`](https://github.com/mastra-ai/mastra/commit/1b6e67613c2a019df5920d4273d79bed09555807), [`4ce0163`](https://github.com/mastra-ai/mastra/commit/4ce0163dc86e675a86809685c8ce6c49f1aeb87e), [`4378341`](https://github.com/mastra-ai/mastra/commit/43783412df5ea3dd35f5b1f6e4851e79c346fc89)]:
|
|
96
|
+
- @mastra/core@1.51.0
|
|
97
|
+
- @mastra/memory@1.23.0
|
|
98
|
+
- @mastra/mcp@1.14.0
|
|
99
|
+
- @mastra/schema-compat@1.3.4
|
|
100
|
+
- @mastra/observability@1.16.1
|
|
101
|
+
- @mastra/pg@1.16.0
|
|
102
|
+
- @mastra/libsql@1.16.0
|
|
103
|
+
|
|
104
|
+
## 0.1.0-alpha.13
|
|
105
|
+
|
|
106
|
+
### Minor Changes
|
|
107
|
+
|
|
108
|
+
- Added a post-tool observer for custom Mastra Code integrations to react to completed tool calls without replacing built-in tools. ([#19446](https://github.com/mastra-ai/mastra/pull/19446))
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
await mountAgentControllerOnMastra({
|
|
112
|
+
postToolObserver: ({ toolName, output }) => logToolResult(toolName, output),
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Added the authoritative session scope to agent controller request context for scoped session integrations. ([#19446](https://github.com/mastra-ai/mastra/pull/19446))
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
const controllerContext = requestContext.get('controller');
|
|
122
|
+
console.log(controllerContext?.scope);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- Updated dependencies [[`a99eae8`](https://github.com/mastra-ai/mastra/commit/a99eae8908e500c1b2d12f9d277be616b98617a5), [`fd13f8e`](https://github.com/mastra-ai/mastra/commit/fd13f8e21990f9904c3eedba3a626bb4a929cdb8), [`f703f87`](https://github.com/mastra-ai/mastra/commit/f703f878de072d51fda557f9c50867d8252bef05), [`0ad646f`](https://github.com/mastra-ai/mastra/commit/0ad646f71a530f2454664299e5e01bfd13fa12e5), [`0ad646f`](https://github.com/mastra-ai/mastra/commit/0ad646f71a530f2454664299e5e01bfd13fa12e5)]:
|
|
126
|
+
- @mastra/core@1.51.0-alpha.13
|
|
127
|
+
- @mastra/pg@1.16.0-alpha.0
|
|
128
|
+
- @mastra/libsql@1.16.0-alpha.1
|
|
129
|
+
|
|
130
|
+
## 0.1.0-alpha.12
|
|
131
|
+
|
|
132
|
+
### Patch Changes
|
|
133
|
+
|
|
134
|
+
- Fixed the server-owned Mastra instance created by prepareAgentControllerMount ignoring a configured PubSub. When you pass a distributed pubsub (for example Redis Streams) to the agent controller, the mounted Mastra now runs its event bus on the same transport, so streams, workflows, and signals work across multiple server processes. ([#19431](https://github.com/mastra-ai/mastra/pull/19431))
|
|
135
|
+
|
|
136
|
+
- Updated dependencies [[`aa38805`](https://github.com/mastra-ai/mastra/commit/aa38805b878b827403be785eb90688d7172f5a40), [`2d22570`](https://github.com/mastra-ai/mastra/commit/2d22570c7dfdd02123d0ecc529efb05ccba2d9fc), [`4378341`](https://github.com/mastra-ai/mastra/commit/43783412df5ea3dd35f5b1f6e4851e79c346fc89)]:
|
|
137
|
+
- @mastra/core@1.51.0-alpha.12
|
|
138
|
+
|
|
139
|
+
## 0.1.0-alpha.11
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [[`45a8e65`](https://github.com/mastra-ai/mastra/commit/45a8e65e1556d1362cb3f25187023c36de26661d), [`c8ed116`](https://github.com/mastra-ai/mastra/commit/c8ed11699f62bcac70102ab4ec84d80d20541da6), [`33f2b88`](https://github.com/mastra-ai/mastra/commit/33f2b88842c09a567f906fac4cb61cd5277ced59)]:
|
|
144
|
+
- @mastra/core@1.51.0-alpha.11
|
|
145
|
+
|
|
146
|
+
## 0.1.0-alpha.10
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- Updated dependencies [[`4adc391`](https://github.com/mastra-ai/mastra/commit/4adc3911075249c352bb4832d2471922826344de), [`171c3a2`](https://github.com/mastra-ai/mastra/commit/171c3a23f36199ad1354166fb515b22b57f310c2), [`b486abf`](https://github.com/mastra-ai/mastra/commit/b486abfa2a7528c6f527e4015c819ea9fa54aaad)]:
|
|
151
|
+
- @mastra/core@1.51.0-alpha.10
|
|
152
|
+
- @mastra/schema-compat@1.3.4-alpha.2
|
|
153
|
+
- @mastra/mcp@1.14.0-alpha.0
|
|
154
|
+
- @mastra/memory@1.23.0-alpha.4
|
|
155
|
+
|
|
156
|
+
## 0.1.0-alpha.9
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- Updated dependencies [[`edce8d2`](https://github.com/mastra-ai/mastra/commit/edce8d2769f19e27a05737c627af2d765472a4f8)]:
|
|
161
|
+
- @mastra/core@1.51.0-alpha.9
|
|
162
|
+
|
|
163
|
+
## 0.1.0-alpha.8
|
|
164
|
+
|
|
165
|
+
### Minor Changes
|
|
166
|
+
|
|
167
|
+
- Added support for async `extraTools` providers in `MastraCodeConfig`. The `extraTools` option now accepts an async function that receives the request context, so tools can be resolved per session (for example, only exposing an integration tool when the current project has that integration connected). ([#19369](https://github.com/mastra-ai/mastra/pull/19369))
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
const mastraCode = await createMastraCode({
|
|
171
|
+
extraTools: async ({ requestContext }) => {
|
|
172
|
+
const controller = requestContext.get('controller');
|
|
173
|
+
if (!(await hasLinearConnection(controller?.resourceId))) return {};
|
|
174
|
+
return { linear_get_issue: linearGetIssueTool };
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- dependencies updates: ([#16699](https://github.com/mastra-ai/mastra/pull/16699))
|
|
182
|
+
- Updated dependency [`@ai-sdk/amazon-bedrock@^3.0.105` ↗︎](https://www.npmjs.com/package/@ai-sdk/amazon-bedrock/v/3.0.105) (from `^3.0.102`, in `dependencies`)
|
|
183
|
+
- Updated dependency [`@ai-sdk/anthropic@^3.0.92` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.92) (from `^3.0.82`, in `dependencies`)
|
|
184
|
+
- Updated dependency [`@ai-sdk/openai@^3.0.80` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai/v/3.0.80) (from `^3.0.63`, in `dependencies`)
|
|
185
|
+
- Updated dependency [`@ai-sdk/openai-compatible@^2.0.56` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai-compatible/v/2.0.56) (from `^2.0.47`, in `dependencies`)
|
|
186
|
+
- Updated dependency [`ai@^6.0.219` ↗︎](https://www.npmjs.com/package/ai/v/6.0.219) (from `^6.0.176`, in `dependencies`)
|
|
187
|
+
|
|
188
|
+
- dependencies updates: ([#19385](https://github.com/mastra-ai/mastra/pull/19385))
|
|
189
|
+
- Updated dependency [`@ai-sdk/anthropic@^3.0.96` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.96) (from `^3.0.92`, in `dependencies`)
|
|
190
|
+
- Updated dependency [`@ai-sdk/openai@^3.0.84` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai/v/3.0.84) (from `^3.0.80`, in `dependencies`)
|
|
191
|
+
- Updated dependency [`@ai-sdk/openai-compatible@^2.0.59` ↗︎](https://www.npmjs.com/package/@ai-sdk/openai-compatible/v/2.0.59) (from `^2.0.56`, in `dependencies`)
|
|
192
|
+
- Updated dependency [`ai@^6.0.224` ↗︎](https://www.npmjs.com/package/ai/v/6.0.224) (from `^6.0.219`, in `dependencies`)
|
|
193
|
+
- Updated dependencies [[`bd6d240`](https://github.com/mastra-ai/mastra/commit/bd6d2402db93dddaef0721667e7e8a030e7c6e16), [`0111486`](https://github.com/mastra-ai/mastra/commit/01114867612593eef5cfa2fda6a1194dfedda841), [`96a3749`](https://github.com/mastra-ai/mastra/commit/96a37492235f5b8076b3e3177d83ed5a5e44a640), [`3e26c87`](https://github.com/mastra-ai/mastra/commit/3e26c87de0c5bc2583b795ce6ca5889b6b161acb), [`a5008f2`](https://github.com/mastra-ai/mastra/commit/a5008f22ae710ad9402ea9f2547d8c02f74d384b)]:
|
|
194
|
+
- @mastra/core@1.51.0-alpha.8
|
|
195
|
+
|
|
196
|
+
## 0.1.0-alpha.7
|
|
197
|
+
|
|
198
|
+
### Minor Changes
|
|
199
|
+
|
|
200
|
+
- Renamed the Gateway constants exported from `@mastra/code-sdk/onboarding/settings` and added `MastraCodeGateway.getMastraGatewayApiKey()` so they match the Gateway product name. The old constant and method names keep working as deprecated aliases, and the stored values are unchanged. ([#18691](https://github.com/mastra-ai/mastra/pull/18691))
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
// Before
|
|
204
|
+
import { MEMORY_GATEWAY_PROVIDER, MEMORY_GATEWAY_DEFAULT_URL } from '@mastra/code-sdk/onboarding/settings';
|
|
205
|
+
|
|
206
|
+
// After
|
|
207
|
+
import { MASTRA_GATEWAY_PROVIDER, MASTRA_GATEWAY_DEFAULT_URL } from '@mastra/code-sdk/onboarding/settings';
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- Improved GitHub plugin dependency installs by requiring exact pnpm versions and running them through Corepack, with an actionable setup error when Corepack is unavailable. ([#19288](https://github.com/mastra-ai/mastra/pull/19288))
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- Fixed secure discovery of symlinked custom commands and skills. ([#19279](https://github.com/mastra-ai/mastra/pull/19279))
|
|
215
|
+
|
|
216
|
+
- Updated dependencies [[`25e7c12`](https://github.com/mastra-ai/mastra/commit/25e7c126a770069ae7fb7ecf1d2adb40e017b009), [`1ce5121`](https://github.com/mastra-ai/mastra/commit/1ce512155d122bb21f47d98383e82ffbf84b39e8), [`3cfc47a`](https://github.com/mastra-ai/mastra/commit/3cfc47a6b89940aadd0f46fb01ae9624a73a865d), [`2bb7817`](https://github.com/mastra-ai/mastra/commit/2bb78176112fde628483de2830528f7eee911e56), [`51d9870`](https://github.com/mastra-ai/mastra/commit/51d987032c689c2855374d0f244f5d654da809d1), [`5cab274`](https://github.com/mastra-ai/mastra/commit/5cab2744250e22d12fefa7b32637dce224233cee), [`7fa27d3`](https://github.com/mastra-ai/mastra/commit/7fa27d3b6f5ed68cd34e454a4d3ad9c482a0cfbc), [`a58dcbb`](https://github.com/mastra-ai/mastra/commit/a58dcbb546d7e1d65ebdc1f39e55f0908fcd9391), [`153bd3b`](https://github.com/mastra-ai/mastra/commit/153bd3b396bdfed6b74cf43de12db8fd2d83c04a), [`07bb863`](https://github.com/mastra-ai/mastra/commit/07bb8631919c6f7cf377dccd45b096e0f17fbed0), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669), [`3927473`](https://github.com/mastra-ai/mastra/commit/392747323ddb10c643d12be7b9ae913159dfaeed), [`dce50dc`](https://github.com/mastra-ai/mastra/commit/dce50dc9a1c1fcd0f427bb5f6250ec74910cb04b), [`634caff`](https://github.com/mastra-ai/mastra/commit/634caff29a9200ad058b67d53f96d9e5832fb8a2), [`2eb656e`](https://github.com/mastra-ai/mastra/commit/2eb656ecb64671d4a95e3c94bf507ce6a0ef9e3b), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669)]:
|
|
217
|
+
- @mastra/core@1.51.0-alpha.7
|
|
218
|
+
- @mastra/observability@1.16.1-alpha.1
|
|
219
|
+
- @mastra/mcp@1.14.0-alpha.0
|
|
220
|
+
|
|
221
|
+
## 0.1.0-alpha.6
|
|
222
|
+
|
|
223
|
+
### Patch Changes
|
|
224
|
+
|
|
225
|
+
- Updated dependencies [[`e2d5f37`](https://github.com/mastra-ai/mastra/commit/e2d5f373bd289be534d5f8694d34465010533df6)]:
|
|
226
|
+
- @mastra/core@1.51.0-alpha.6
|
|
227
|
+
|
|
228
|
+
## 0.1.0-alpha.5
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- Updated dependencies [[`fb8aea3`](https://github.com/mastra-ai/mastra/commit/fb8aea384291e77311be3a64ee1717320d5c3c73), [`bd4d720`](https://github.com/mastra-ai/mastra/commit/bd4d720458e42c49b6829c4662812332be32cfcf), [`4ce0163`](https://github.com/mastra-ai/mastra/commit/4ce0163dc86e675a86809685c8ce6c49f1aeb87e)]:
|
|
233
|
+
- @mastra/core@1.51.0-alpha.5
|
|
234
|
+
- @mastra/observability@1.16.1-alpha.0
|
|
235
|
+
- @mastra/mcp@1.14.0-alpha.0
|
|
236
|
+
|
|
237
|
+
## 0.1.0-alpha.4
|
|
238
|
+
|
|
239
|
+
### Patch Changes
|
|
240
|
+
|
|
241
|
+
- Updated dependencies [[`a5c6337`](https://github.com/mastra-ai/mastra/commit/a5c6337d23c7686c81a32ce62f550f610543a240), [`031931a`](https://github.com/mastra-ai/mastra/commit/031931a715405fb90759b1903c9c25cbf05994af), [`eb70da9`](https://github.com/mastra-ai/mastra/commit/eb70da98e1007b18e1463d75121bc07db55f8e09), [`8b97958`](https://github.com/mastra-ai/mastra/commit/8b979589f9aa59ba67cac565949475f2ffeb4ac3), [`8410541`](https://github.com/mastra-ai/mastra/commit/84105412c60ecd3bb33a9838146f59c4b588228f), [`01b338c`](https://github.com/mastra-ai/mastra/commit/01b338c56271f0219606710e3e8b26dee27ac6c2), [`8b7361d`](https://github.com/mastra-ai/mastra/commit/8b7361d35de68b80d05d30a74e0c69e7218fd612), [`85fb642`](https://github.com/mastra-ai/mastra/commit/85fb642f4d112d0da9f39808617397f7e47fe622), [`481c112`](https://github.com/mastra-ai/mastra/commit/481c1125b752489673ec671fcb7ca80f9c86ffb1), [`c43f3a9`](https://github.com/mastra-ai/mastra/commit/c43f3a9d1efde99b38789364ba4d0ba670f430e3), [`c43f3a9`](https://github.com/mastra-ai/mastra/commit/c43f3a9d1efde99b38789364ba4d0ba670f430e3)]:
|
|
242
|
+
- @mastra/core@1.51.0-alpha.4
|
|
243
|
+
- @mastra/memory@1.23.0-alpha.3
|
|
244
|
+
- @mastra/mcp@1.14.0-alpha.0
|
|
245
|
+
|
|
246
|
+
## 0.1.0-alpha.3
|
|
247
|
+
|
|
248
|
+
### Patch Changes
|
|
249
|
+
|
|
250
|
+
- Updated dependencies [[`177010f`](https://github.com/mastra-ai/mastra/commit/177010ff096d2e4b28d89803be5b1a4cad2a0d6b), [`54a51e0`](https://github.com/mastra-ai/mastra/commit/54a51e0a484fe1ebad3fb1f7ef5282a075709eb7)]:
|
|
251
|
+
- @mastra/core@1.51.0-alpha.3
|
|
252
|
+
|
|
253
|
+
## 0.1.0-alpha.2
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- Updated dependencies [[`e955965`](https://github.com/mastra-ai/mastra/commit/e955965dce575a903e37cf054d28ea99aa48785e), [`bc1121a`](https://github.com/mastra-ai/mastra/commit/bc1121a7bb98f7cd73e82e3a7913a667a9fa9911), [`860ef7e`](https://github.com/mastra-ai/mastra/commit/860ef7e77d92b63469cbe5857aa1e626197e43e9), [`17e818c`](https://github.com/mastra-ai/mastra/commit/17e818c51a958ba90641b1a959dc38faf8c034e9), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`1d39058`](https://github.com/mastra-ai/mastra/commit/1d39058e548efd691799985d5c8af2737f1c3bd2)]:
|
|
258
|
+
- @mastra/core@1.51.0-alpha.2
|
|
259
|
+
- @mastra/schema-compat@1.3.4-alpha.1
|
|
260
|
+
- @mastra/libsql@1.16.0-alpha.0
|
|
261
|
+
- @mastra/mcp@1.13.1
|
|
262
|
+
- @mastra/memory@1.23.0-alpha.2
|
|
263
|
+
|
|
264
|
+
## 0.1.0-alpha.1
|
|
265
|
+
|
|
266
|
+
### Patch Changes
|
|
267
|
+
|
|
268
|
+
- Updated dependencies [[`aac3e5a`](https://github.com/mastra-ai/mastra/commit/aac3e5a098b08077c7d5020d782d6353b217797c), [`1b6e676`](https://github.com/mastra-ai/mastra/commit/1b6e67613c2a019df5920d4273d79bed09555807)]:
|
|
269
|
+
- @mastra/memory@1.23.0-alpha.1
|
|
270
|
+
|
|
271
|
+
## 0.1.0-alpha.0
|
|
272
|
+
|
|
273
|
+
### Minor Changes
|
|
274
|
+
|
|
275
|
+
- Publish the Mastra Code agent core as `@mastra/code-sdk` (previously the internal `@internal/mastracode` package), so third parties can build their own UIs and surfaces on top of the Mastra Code coding agent. The `mastracode` CLI now consumes it as a regular runtime dependency instead of bundling it into its published output. ([#18986](https://github.com/mastra-ai/mastra/pull/18986))
|
|
276
|
+
|
|
277
|
+
### Patch Changes
|
|
278
|
+
|
|
279
|
+
- Removed invalid CommonJS export entries from @mastra/code-sdk so package resolution matches the published ESM output. ([#19127](https://github.com/mastra-ai/mastra/pull/19127))
|
|
280
|
+
|
|
281
|
+
- Updated dependencies [[`6789ab4`](https://github.com/mastra-ai/mastra/commit/6789ab4191ddcd32a932898b360b191e80cee1a9)]:
|
|
282
|
+
- @mastra/schema-compat@1.3.4-alpha.0
|
|
283
|
+
- @mastra/core@1.50.2-alpha.1
|
|
284
|
+
- @mastra/mcp@1.13.1
|
|
285
|
+
- @mastra/memory@1.22.3-alpha.0
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Portions of this software are licensed as follows:
|
|
2
|
+
|
|
3
|
+
- All content that resides under any directory named "ee/" within this
|
|
4
|
+
repository, including but not limited to:
|
|
5
|
+
- `packages/core/src/auth/ee/`
|
|
6
|
+
- `packages/server/src/server/auth/ee/`
|
|
7
|
+
is licensed under the license defined in `ee/LICENSE`.
|
|
8
|
+
|
|
9
|
+
- All third-party components incorporated into the Mastra Software are
|
|
10
|
+
licensed under the original license provided by the owner of the
|
|
11
|
+
applicable component.
|
|
12
|
+
|
|
13
|
+
- Content outside of the above-mentioned directories or restrictions is
|
|
14
|
+
available under the "Apache License 2.0" as defined below.
|
|
15
|
+
|
|
16
|
+
# Apache License 2.0
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
19
|
+
|
|
20
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
you may not use this file except in compliance with the License.
|
|
22
|
+
You may obtain a copy of the License at
|
|
23
|
+
|
|
24
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
|
|
26
|
+
Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
See the License for the specific language governing permissions and
|
|
30
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @mastra/code-sdk
|
|
2
|
+
|
|
3
|
+
The agent core behind [Mastra Code](https://mastra.ai) — everything except the terminal UI. Use it to build your own UIs and surfaces (web apps, editors, bots) on top of the Mastra Code coding agent.
|
|
4
|
+
|
|
5
|
+
The published [`mastracode`](https://www.npmjs.com/package/mastracode) CLI/TUI and the Mastra Code web surface are both built on this SDK.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mastra/code-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Mount the Mastra Code agent controller on a Mastra instance:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { mountAgentControllerOnMastra } from '@mastra/code-sdk';
|
|
19
|
+
|
|
20
|
+
// Creates a Mastra instance that hosts the Mastra Code agent controller
|
|
21
|
+
// (thread management, modes, tools, memory) and starts its workers.
|
|
22
|
+
const { mastra, controller } = await mountAgentControllerOnMastra({
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To construct the `Mastra` instance yourself (e.g. in a deployable `mastra` entry file), use `prepareAgentControllerMount`:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
31
|
+
import { prepareAgentControllerMount } from '@mastra/code-sdk';
|
|
32
|
+
|
|
33
|
+
const prepared = await prepareAgentControllerMount({ cwd: process.cwd() });
|
|
34
|
+
|
|
35
|
+
export const mastra = new Mastra(prepared.mastraArgs);
|
|
36
|
+
|
|
37
|
+
await prepared.finalize();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Deep modules are available as subpath imports, e.g.:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { loadSettings } from '@mastra/code-sdk/onboarding/settings';
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> The subpath API surface is still evolving and may change between minor releases while the package is pre-1.0.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
Apache-2.0
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Agent, AgentSideConnection, InitializeRequest, InitializeResponse, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, CancelNotification, ContentBlock } from '@agentclientprotocol/sdk';
|
|
2
|
+
import type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';
|
|
3
|
+
/**
|
|
4
|
+
* ACP Agent implementation that wraps a mastracode Controller.
|
|
5
|
+
* Each instance represents one ACP connection from a client.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MastraCodeAcpAgent implements Agent {
|
|
8
|
+
private readonly connection;
|
|
9
|
+
private readonly controller;
|
|
10
|
+
private readonly session;
|
|
11
|
+
private readonly modes;
|
|
12
|
+
private readonly unsubscribeSessionEvents;
|
|
13
|
+
private readonly sessionMap;
|
|
14
|
+
private currentPromptState;
|
|
15
|
+
private promptMutex;
|
|
16
|
+
private getThreadIdOrThrow;
|
|
17
|
+
constructor(connection: AgentSideConnection, controller: AgentController, session: Session, modes: AgentControllerMode[]);
|
|
18
|
+
dispose(): void;
|
|
19
|
+
initialize(_request: InitializeRequest): Promise<InitializeResponse>;
|
|
20
|
+
authenticate(): Promise<void>;
|
|
21
|
+
newSession(_request: NewSessionRequest): Promise<NewSessionResponse>;
|
|
22
|
+
prompt(request: PromptRequest): Promise<PromptResponse>;
|
|
23
|
+
cancel(_notification: CancelNotification): Promise<void>;
|
|
24
|
+
setSessionMode(params: {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
modeId: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
unstable_setSessionModel(params: {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
modelId: string;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export declare function extractTextFromContentBlocks(blocks: ContentBlock[]): string;
|
|
34
|
+
export declare function mapStopReason(reason: 'complete' | 'aborted' | 'error' | 'suspended'): 'end_turn' | 'cancelled' | 'max_tokens' | 'max_turn_requests' | 'refusal';
|
|
35
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/acp/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAInG;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,KAAK;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAa;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,kBAAkB,CAA4B;IACtD,OAAO,CAAC,WAAW,CAAoC;IAEvD,OAAO,CAAC,kBAAkB;gBASxB,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,mBAAmB,EAAE;IAa9B,OAAO,IAAI,IAAI;IAIT,UAAU,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAcpE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,UAAU,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA0CpE,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAsEvD,MAAM,CAAC,aAAa,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD,cAAc,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5E,wBAAwB,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAK9F;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAY3E;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GACrD,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,mBAAmB,GAAG,SAAS,CAW3E"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { PROTOCOL_VERSION } from "@agentclientprotocol/sdk";
|
|
2
|
+
import { handleAgentControllerEvent } from "./event-mapper.js";
|
|
3
|
+
class MastraCodeAcpAgent {
|
|
4
|
+
connection;
|
|
5
|
+
controller;
|
|
6
|
+
session;
|
|
7
|
+
modes;
|
|
8
|
+
unsubscribeSessionEvents;
|
|
9
|
+
sessionMap = /* @__PURE__ */ new Map();
|
|
10
|
+
// sessionId -> threadId
|
|
11
|
+
currentPromptState = null;
|
|
12
|
+
promptMutex = Promise.resolve();
|
|
13
|
+
getThreadIdOrThrow(sessionId) {
|
|
14
|
+
const threadId = this.sessionMap.get(sessionId);
|
|
15
|
+
if (!threadId) {
|
|
16
|
+
throw new Error(`Unknown ACP sessionId: ${sessionId}`);
|
|
17
|
+
}
|
|
18
|
+
return threadId;
|
|
19
|
+
}
|
|
20
|
+
constructor(connection, controller, session, modes) {
|
|
21
|
+
this.connection = connection;
|
|
22
|
+
this.controller = controller;
|
|
23
|
+
this.session = session;
|
|
24
|
+
this.modes = modes;
|
|
25
|
+
this.unsubscribeSessionEvents = this.session.subscribe((event) => {
|
|
26
|
+
handleAgentControllerEvent(event, this.currentPromptState, this.connection, this.session);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
dispose() {
|
|
30
|
+
this.unsubscribeSessionEvents();
|
|
31
|
+
}
|
|
32
|
+
async initialize(_request) {
|
|
33
|
+
return {
|
|
34
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
35
|
+
agentInfo: {
|
|
36
|
+
name: "mastracode",
|
|
37
|
+
title: "Mastra Code",
|
|
38
|
+
version: "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
agentCapabilities: {
|
|
41
|
+
loadSession: false
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async authenticate() {
|
|
46
|
+
}
|
|
47
|
+
async newSession(_request) {
|
|
48
|
+
const thread = await this.session.thread.create();
|
|
49
|
+
const sessionId = thread.id;
|
|
50
|
+
this.sessionMap.set(sessionId, thread.id);
|
|
51
|
+
await this.session.thread.switch({ threadId: thread.id });
|
|
52
|
+
const availableModes = this.modes.map((m) => ({
|
|
53
|
+
id: m.id,
|
|
54
|
+
name: m.name ?? m.id
|
|
55
|
+
}));
|
|
56
|
+
const currentModeId = this.session.mode.get();
|
|
57
|
+
let models;
|
|
58
|
+
try {
|
|
59
|
+
const availableModels = await this.controller.listAvailableModels();
|
|
60
|
+
const currentModelId = this.session.model.get();
|
|
61
|
+
models = {
|
|
62
|
+
currentModelId: currentModelId ?? "",
|
|
63
|
+
availableModels: availableModels.map((m) => ({
|
|
64
|
+
modelId: m.id,
|
|
65
|
+
name: m.modelName
|
|
66
|
+
}))
|
|
67
|
+
};
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
sessionId,
|
|
72
|
+
modes: {
|
|
73
|
+
currentModeId,
|
|
74
|
+
availableModes
|
|
75
|
+
},
|
|
76
|
+
models
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async prompt(request) {
|
|
80
|
+
const { sessionId, prompt: contentBlocks } = request;
|
|
81
|
+
const text = extractTextFromContentBlocks(contentBlocks);
|
|
82
|
+
const threadId = this.getThreadIdOrThrow(sessionId);
|
|
83
|
+
const prevMutex = this.promptMutex;
|
|
84
|
+
let resolveMutex;
|
|
85
|
+
this.promptMutex = new Promise((resolve) => {
|
|
86
|
+
resolveMutex = resolve;
|
|
87
|
+
});
|
|
88
|
+
await prevMutex;
|
|
89
|
+
try {
|
|
90
|
+
await this.session.thread.switch({ threadId });
|
|
91
|
+
const result = new Promise((resolve) => {
|
|
92
|
+
const usage2 = {
|
|
93
|
+
promptTokens: 0,
|
|
94
|
+
completionTokens: 0,
|
|
95
|
+
totalTokens: 0
|
|
96
|
+
};
|
|
97
|
+
this.currentPromptState = {
|
|
98
|
+
sessionId,
|
|
99
|
+
lastTextLength: 0,
|
|
100
|
+
usage: usage2,
|
|
101
|
+
resolve: (reason2) => {
|
|
102
|
+
resolve({ reason: reason2, usage: usage2 });
|
|
103
|
+
this.currentPromptState = null;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
try {
|
|
108
|
+
await this.session.sendMessage({ content: text });
|
|
109
|
+
} catch (error) {
|
|
110
|
+
this.currentPromptState = null;
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
const { reason, usage } = await result;
|
|
114
|
+
return {
|
|
115
|
+
stopReason: mapStopReason(reason),
|
|
116
|
+
usage: {
|
|
117
|
+
inputTokens: usage.promptTokens,
|
|
118
|
+
outputTokens: usage.completionTokens,
|
|
119
|
+
totalTokens: usage.totalTokens,
|
|
120
|
+
thoughtTokens: usage.reasoningTokens,
|
|
121
|
+
cachedReadTokens: usage.cachedInputTokens,
|
|
122
|
+
cachedWriteTokens: usage.cacheCreationInputTokens
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
} finally {
|
|
126
|
+
resolveMutex();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async cancel(_notification) {
|
|
130
|
+
this.session.abort();
|
|
131
|
+
}
|
|
132
|
+
async setSessionMode(params) {
|
|
133
|
+
const threadId = this.getThreadIdOrThrow(params.sessionId);
|
|
134
|
+
await this.session.thread.switch({ threadId });
|
|
135
|
+
this.session.mode.set({ modeId: params.modeId });
|
|
136
|
+
}
|
|
137
|
+
async unstable_setSessionModel(params) {
|
|
138
|
+
const threadId = this.getThreadIdOrThrow(params.sessionId);
|
|
139
|
+
await this.session.thread.switch({ threadId });
|
|
140
|
+
this.session.model.set({ modelId: params.modelId });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function extractTextFromContentBlocks(blocks) {
|
|
144
|
+
const parts = [];
|
|
145
|
+
for (const block of blocks) {
|
|
146
|
+
if (block.type === "text") {
|
|
147
|
+
parts.push(block.text);
|
|
148
|
+
} else if (block.type === "resource_link") {
|
|
149
|
+
parts.push(`[resource: ${block.uri}]`);
|
|
150
|
+
} else if (block.type === "resource") {
|
|
151
|
+
parts.push(`[resource: ${block.resource.uri}]`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return parts.join("\n");
|
|
155
|
+
}
|
|
156
|
+
function mapStopReason(reason) {
|
|
157
|
+
switch (reason) {
|
|
158
|
+
case "complete":
|
|
159
|
+
return "end_turn";
|
|
160
|
+
case "aborted":
|
|
161
|
+
return "cancelled";
|
|
162
|
+
case "error":
|
|
163
|
+
return "end_turn";
|
|
164
|
+
case "suspended":
|
|
165
|
+
return "end_turn";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
MastraCodeAcpAgent,
|
|
170
|
+
extractTextFromContentBlocks,
|
|
171
|
+
mapStopReason
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/acp/agent.ts"],"sourcesContent":["import type {\n Agent,\n AgentSideConnection,\n InitializeRequest,\n InitializeResponse,\n NewSessionRequest,\n NewSessionResponse,\n PromptRequest,\n PromptResponse,\n CancelNotification,\n ContentBlock,\n} from '@agentclientprotocol/sdk';\nimport { PROTOCOL_VERSION } from '@agentclientprotocol/sdk';\nimport type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';\nimport { handleAgentControllerEvent } from './event-mapper.js';\nimport type { PromptState } from './event-mapper.js';\n\n/**\n * ACP Agent implementation that wraps a mastracode Controller.\n * Each instance represents one ACP connection from a client.\n */\nexport class MastraCodeAcpAgent implements Agent {\n private readonly connection: AgentSideConnection;\n private readonly controller: AgentController;\n private readonly session: Session;\n private readonly modes: AgentControllerMode[];\n private readonly unsubscribeSessionEvents: () => void;\n private readonly sessionMap = new Map<string, string>(); // sessionId -> threadId\n private currentPromptState: PromptState | null = null;\n private promptMutex: Promise<void> = Promise.resolve();\n\n private getThreadIdOrThrow(sessionId: string): string {\n const threadId = this.sessionMap.get(sessionId);\n if (!threadId) {\n throw new Error(`Unknown ACP sessionId: ${sessionId}`);\n }\n return threadId;\n }\n\n constructor(\n connection: AgentSideConnection,\n controller: AgentController,\n session: Session,\n modes: AgentControllerMode[],\n ) {\n this.connection = connection;\n this.controller = controller;\n this.session = session;\n this.modes = modes;\n\n // Register persistent event listener\n this.unsubscribeSessionEvents = this.session.subscribe(event => {\n handleAgentControllerEvent(event, this.currentPromptState, this.connection, this.session);\n });\n }\n\n dispose(): void {\n this.unsubscribeSessionEvents();\n }\n\n async initialize(_request: InitializeRequest): Promise<InitializeResponse> {\n return {\n protocolVersion: PROTOCOL_VERSION,\n agentInfo: {\n name: 'mastracode',\n title: 'Mastra Code',\n version: '0.1.0',\n },\n agentCapabilities: {\n loadSession: false,\n },\n };\n }\n\n async authenticate(): Promise<void> {\n // No-op: mastracode handles its own auth\n }\n\n async newSession(_request: NewSessionRequest): Promise<NewSessionResponse> {\n const thread = await this.session.thread.create();\n const sessionId = thread.id;\n this.sessionMap.set(sessionId, thread.id);\n\n // Switch to the new thread\n await this.session.thread.switch({ threadId: thread.id });\n\n // Build modes list from constructor param\n const availableModes = this.modes.map((m: AgentControllerMode) => ({\n id: m.id,\n name: m.name ?? m.id,\n }));\n\n const currentModeId = this.session.mode.get();\n\n // Build models list (best-effort)\n let models: NewSessionResponse['models'];\n try {\n const availableModels = await this.controller.listAvailableModels();\n const currentModelId = this.session.model.get();\n models = {\n currentModelId: currentModelId ?? '',\n availableModels: availableModels.map(m => ({\n modelId: m.id,\n name: m.modelName,\n })),\n };\n } catch {\n // Model listing may fail if no providers are configured\n }\n\n return {\n sessionId,\n modes: {\n currentModeId,\n availableModes,\n },\n models,\n };\n }\n\n async prompt(request: PromptRequest): Promise<PromptResponse> {\n const { sessionId, prompt: contentBlocks } = request;\n\n // Extract text from content blocks\n const text = extractTextFromContentBlocks(contentBlocks);\n\n const threadId = this.getThreadIdOrThrow(sessionId);\n\n // Serialize prompts via mutex\n const prevMutex = this.promptMutex;\n let resolveMutex: () => void;\n this.promptMutex = new Promise<void>(resolve => {\n resolveMutex = resolve;\n });\n\n await prevMutex;\n\n try {\n // Ensure we're on the right thread while prompts are serialized\n await this.session.thread.switch({ threadId });\n\n // Create prompt state that will be resolved when agent_end fires\n const result = new Promise<{\n reason: 'complete' | 'aborted' | 'error' | 'suspended';\n usage: PromptState['usage'];\n }>(resolve => {\n const usage: PromptState['usage'] = {\n promptTokens: 0,\n completionTokens: 0,\n totalTokens: 0,\n };\n\n this.currentPromptState = {\n sessionId,\n lastTextLength: 0,\n usage,\n resolve: reason => {\n resolve({ reason, usage });\n this.currentPromptState = null;\n },\n };\n });\n\n // Send the message to the session\n try {\n await this.session.sendMessage({ content: text });\n } catch (error) {\n this.currentPromptState = null;\n throw error;\n }\n\n // Wait for agent_end to resolve\n const { reason, usage } = await result;\n\n return {\n stopReason: mapStopReason(reason),\n usage: {\n inputTokens: usage.promptTokens,\n outputTokens: usage.completionTokens,\n totalTokens: usage.totalTokens,\n thoughtTokens: usage.reasoningTokens,\n cachedReadTokens: usage.cachedInputTokens,\n cachedWriteTokens: usage.cacheCreationInputTokens,\n },\n };\n } finally {\n resolveMutex!();\n }\n }\n\n async cancel(_notification: CancelNotification): Promise<void> {\n this.session.abort();\n }\n\n async setSessionMode(params: { sessionId: string; modeId: string }): Promise<void> {\n const threadId = this.getThreadIdOrThrow(params.sessionId);\n await this.session.thread.switch({ threadId });\n this.session.mode.set({ modeId: params.modeId });\n }\n\n async unstable_setSessionModel(params: { sessionId: string; modelId: string }): Promise<void> {\n const threadId = this.getThreadIdOrThrow(params.sessionId);\n await this.session.thread.switch({ threadId });\n this.session.model.set({ modelId: params.modelId });\n }\n}\n\nexport function extractTextFromContentBlocks(blocks: ContentBlock[]): string {\n const parts: string[] = [];\n for (const block of blocks) {\n if (block.type === 'text') {\n parts.push(block.text);\n } else if (block.type === 'resource_link') {\n parts.push(`[resource: ${block.uri}]`);\n } else if (block.type === 'resource') {\n parts.push(`[resource: ${block.resource.uri}]`);\n }\n }\n return parts.join('\\n');\n}\n\nexport function mapStopReason(\n reason: 'complete' | 'aborted' | 'error' | 'suspended',\n): 'end_turn' | 'cancelled' | 'max_tokens' | 'max_turn_requests' | 'refusal' {\n switch (reason) {\n case 'complete':\n return 'end_turn';\n case 'aborted':\n return 'cancelled';\n case 'error':\n return 'end_turn';\n case 'suspended':\n return 'end_turn';\n }\n}\n"],"mappings":"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","names":["usage","reason"]}
|