mastracode 0.26.1-alpha.0 → 0.27.0-alpha.10

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +279 -0
  2. package/README.md +130 -0
  3. package/dist/{acp-UF33ZDIG.cjs → acp-33VZO665.cjs} +7 -7
  4. package/dist/{acp-UF33ZDIG.cjs.map → acp-33VZO665.cjs.map} +1 -1
  5. package/dist/{acp-LENNVD37.js → acp-AFC64ZEZ.js} +5 -5
  6. package/dist/{acp-LENNVD37.js.map → acp-AFC64ZEZ.js.map} +1 -1
  7. package/dist/agents/instructions.d.ts.map +1 -1
  8. package/dist/agents/model.d.ts +6 -0
  9. package/dist/agents/model.d.ts.map +1 -1
  10. package/dist/agents/prompts/index.d.ts +1 -2
  11. package/dist/agents/prompts/index.d.ts.map +1 -1
  12. package/dist/agents/thread-caveman-state.d.ts +2 -2
  13. package/dist/agents/thread-caveman-state.d.ts.map +1 -1
  14. package/dist/agents/tools.d.ts +4 -2
  15. package/dist/agents/tools.d.ts.map +1 -1
  16. package/dist/agents/workspace.d.ts +3 -3
  17. package/dist/agents/workspace.d.ts.map +1 -1
  18. package/dist/{chunk-7BTCK3WA.cjs → chunk-6BLA5N5M.cjs} +3771 -1518
  19. package/dist/chunk-6BLA5N5M.cjs.map +1 -0
  20. package/dist/{chunk-BULVNQ2P.cjs → chunk-6HMHCNGR.cjs} +2 -2
  21. package/dist/chunk-6HMHCNGR.cjs.map +1 -0
  22. package/dist/{chunk-X3CUXLJP.js → chunk-BTN7GCNT.js} +3376 -1124
  23. package/dist/chunk-BTN7GCNT.js.map +1 -0
  24. package/dist/{chunk-NDCWIAKG.js → chunk-GAPPKMQT.js} +144 -4
  25. package/dist/chunk-GAPPKMQT.js.map +1 -0
  26. package/dist/{chunk-Z5EMG7I2.js → chunk-GETSQXPO.js} +2 -2
  27. package/dist/chunk-GETSQXPO.js.map +1 -0
  28. package/dist/{chunk-YPTGVE6M.cjs → chunk-HADE25EX.cjs} +2712 -385
  29. package/dist/chunk-HADE25EX.cjs.map +1 -0
  30. package/dist/{chunk-IVWQHERI.js → chunk-KP5DGNCF.js} +2600 -293
  31. package/dist/chunk-KP5DGNCF.js.map +1 -0
  32. package/dist/{chunk-KGBCGF6C.cjs → chunk-WX46SWL3.cjs} +157 -12
  33. package/dist/chunk-WX46SWL3.cjs.map +1 -0
  34. package/dist/cli.cjs +186 -594
  35. package/dist/cli.cjs.map +1 -1
  36. package/dist/cli.js +170 -579
  37. package/dist/cli.js.map +1 -1
  38. package/dist/headless/cli.d.ts +42 -0
  39. package/dist/headless/cli.d.ts.map +1 -0
  40. package/dist/headless/flags.d.ts +33 -0
  41. package/dist/headless/flags.d.ts.map +1 -0
  42. package/dist/headless/format.d.ts +38 -0
  43. package/dist/headless/format.d.ts.map +1 -0
  44. package/dist/headless/index.d.ts +25 -0
  45. package/dist/headless/index.d.ts.map +1 -0
  46. package/dist/headless/policy.d.ts +17 -0
  47. package/dist/headless/policy.d.ts.map +1 -0
  48. package/dist/headless/run-mc.d.ts +7 -0
  49. package/dist/headless/run-mc.d.ts.map +1 -0
  50. package/dist/headless/types.d.ts +134 -0
  51. package/dist/headless/types.d.ts.map +1 -0
  52. package/dist/headless.cjs +76 -0
  53. package/dist/headless.cjs.map +1 -0
  54. package/dist/headless.js +3 -0
  55. package/dist/headless.js.map +1 -0
  56. package/dist/index.cjs +47 -7
  57. package/dist/index.d.ts +21 -3
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mcp/config.d.ts.map +1 -1
  61. package/dist/native/macos-stt.plist +16 -0
  62. package/dist/native/macos-stt.swift +231 -0
  63. package/dist/onboarding/settings.d.ts +16 -0
  64. package/dist/onboarding/settings.d.ts.map +1 -1
  65. package/dist/plugin.cjs +40 -0
  66. package/dist/plugin.cjs.map +1 -0
  67. package/dist/plugin.d.ts +81 -0
  68. package/dist/plugin.d.ts.map +1 -0
  69. package/dist/plugin.js +29 -0
  70. package/dist/plugin.js.map +1 -0
  71. package/dist/plugins/install.d.ts +16 -0
  72. package/dist/plugins/install.d.ts.map +1 -0
  73. package/dist/plugins/loader.d.ts +15 -0
  74. package/dist/plugins/loader.d.ts.map +1 -0
  75. package/dist/plugins/manager.d.ts +56 -0
  76. package/dist/plugins/manager.d.ts.map +1 -0
  77. package/dist/plugins/manifest.d.ts +14 -0
  78. package/dist/plugins/manifest.d.ts.map +1 -0
  79. package/dist/plugins/package-link.d.ts +2 -0
  80. package/dist/plugins/package-link.d.ts.map +1 -0
  81. package/dist/plugins/paths.d.ts +10 -0
  82. package/dist/plugins/paths.d.ts.map +1 -0
  83. package/dist/plugins/registry.d.ts +8 -0
  84. package/dist/plugins/registry.d.ts.map +1 -0
  85. package/dist/plugins/scaffold.d.ts +10 -0
  86. package/dist/plugins/scaffold.d.ts.map +1 -0
  87. package/dist/plugins/types.d.ts +45 -0
  88. package/dist/plugins/types.d.ts.map +1 -0
  89. package/dist/providers/amazon-bedrock-gateway.d.ts +40 -0
  90. package/dist/providers/amazon-bedrock-gateway.d.ts.map +1 -0
  91. package/dist/providers/amazon-bedrock.d.ts +28 -0
  92. package/dist/providers/amazon-bedrock.d.ts.map +1 -0
  93. package/dist/schema.d.ts +21 -0
  94. package/dist/schema.d.ts.map +1 -1
  95. package/dist/storage-MMPSGE6N.js +3 -0
  96. package/dist/{storage-OFG4C77R.js.map → storage-MMPSGE6N.js.map} +1 -1
  97. package/dist/storage-ZNRO3RDU.cjs +24 -0
  98. package/dist/{storage-RIEW2ZEA.cjs.map → storage-ZNRO3RDU.cjs.map} +1 -1
  99. package/dist/tools/request-sandbox-access.d.ts.map +1 -1
  100. package/dist/tui/command-dispatch.d.ts.map +1 -1
  101. package/dist/tui/commands/index.d.ts +2 -0
  102. package/dist/tui/commands/index.d.ts.map +1 -1
  103. package/dist/tui/commands/plugins.d.ts +3 -0
  104. package/dist/tui/commands/plugins.d.ts.map +1 -0
  105. package/dist/tui/commands/types.d.ts +2 -0
  106. package/dist/tui/commands/types.d.ts.map +1 -1
  107. package/dist/tui/commands/voice.d.ts +11 -0
  108. package/dist/tui/commands/voice.d.ts.map +1 -0
  109. package/dist/tui/components/custom-editor.d.ts +93 -0
  110. package/dist/tui/components/custom-editor.d.ts.map +1 -1
  111. package/dist/tui/components/help-overlay.d.ts.map +1 -1
  112. package/dist/tui/components/idle-counter.d.ts +11 -4
  113. package/dist/tui/components/idle-counter.d.ts.map +1 -1
  114. package/dist/tui/components/subagent-execution.d.ts +36 -3
  115. package/dist/tui/components/subagent-execution.d.ts.map +1 -1
  116. package/dist/tui/event-dispatch.d.ts.map +1 -1
  117. package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -1
  118. package/dist/tui/handlers/message.d.ts.map +1 -1
  119. package/dist/tui/handlers/tool.d.ts +2 -0
  120. package/dist/tui/handlers/tool.d.ts.map +1 -1
  121. package/dist/tui/mastra-tui.d.ts +8 -3
  122. package/dist/tui/mastra-tui.d.ts.map +1 -1
  123. package/dist/tui/render-messages.d.ts.map +1 -1
  124. package/dist/tui/setup.d.ts.map +1 -1
  125. package/dist/tui/state.d.ts +16 -1
  126. package/dist/tui/state.d.ts.map +1 -1
  127. package/dist/tui/status-duration.d.ts +4 -0
  128. package/dist/tui/status-duration.d.ts.map +1 -0
  129. package/dist/tui/status-line.d.ts.map +1 -1
  130. package/dist/tui/voice/engines/cloud-engine.d.ts +28 -0
  131. package/dist/tui/voice/engines/cloud-engine.d.ts.map +1 -0
  132. package/dist/tui/voice/engines/index.d.ts +15 -0
  133. package/dist/tui/voice/engines/index.d.ts.map +1 -0
  134. package/dist/tui/voice/engines/macos-native-engine.d.ts +35 -0
  135. package/dist/tui/voice/engines/macos-native-engine.d.ts.map +1 -0
  136. package/dist/tui/voice/engines/types.d.ts +86 -0
  137. package/dist/tui/voice/engines/types.d.ts.map +1 -0
  138. package/dist/tui/voice/mic-capture.d.ts +60 -0
  139. package/dist/tui/voice/mic-capture.d.ts.map +1 -0
  140. package/dist/tui/voice/native/compile.d.ts +45 -0
  141. package/dist/tui/voice/native/compile.d.ts.map +1 -0
  142. package/dist/tui/voice/native/open-settings.d.ts +12 -0
  143. package/dist/tui/voice/native/open-settings.d.ts.map +1 -0
  144. package/dist/tui/voice/stt-registry.d.ts +64 -0
  145. package/dist/tui/voice/stt-registry.d.ts.map +1 -0
  146. package/dist/tui/voice/transcribe.d.ts +63 -0
  147. package/dist/tui/voice/transcribe.d.ts.map +1 -0
  148. package/dist/tui/voice/voice-controller.d.ts +109 -0
  149. package/dist/tui/voice/voice-controller.d.ts.map +1 -0
  150. package/dist/tui.cjs +19 -19
  151. package/dist/tui.js +2 -2
  152. package/dist/utils/project.d.ts +8 -0
  153. package/dist/utils/project.d.ts.map +1 -1
  154. package/dist/utils/slash-command-loader.d.ts +1 -1
  155. package/dist/utils/slash-command-loader.d.ts.map +1 -1
  156. package/dist/utils/storage-factory.d.ts +20 -0
  157. package/dist/utils/storage-factory.d.ts.map +1 -1
  158. package/package.json +65 -19
  159. package/dist/agents/prompts/base.d.ts +0 -25
  160. package/dist/agents/prompts/base.d.ts.map +0 -1
  161. package/dist/chunk-7BTCK3WA.cjs.map +0 -1
  162. package/dist/chunk-BULVNQ2P.cjs.map +0 -1
  163. package/dist/chunk-IVWQHERI.js.map +0 -1
  164. package/dist/chunk-KGBCGF6C.cjs.map +0 -1
  165. package/dist/chunk-NDCWIAKG.js.map +0 -1
  166. package/dist/chunk-X3CUXLJP.js.map +0 -1
  167. package/dist/chunk-YPTGVE6M.cjs.map +0 -1
  168. package/dist/chunk-Z5EMG7I2.js.map +0 -1
  169. package/dist/headless.d.ts +0 -38
  170. package/dist/headless.d.ts.map +0 -1
  171. package/dist/storage-OFG4C77R.js +0 -3
  172. package/dist/storage-RIEW2ZEA.cjs +0 -24
package/CHANGELOG.md CHANGED
@@ -1,5 +1,284 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.27.0-alpha.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Improved the Mastra Code status area to show active work time, completed work duration, and idle time. ([#18656](https://github.com/mastra-ai/mastra/pull/18656))
8
+
9
+ - Added Mastra Code plugin support: ([#18658](https://github.com/mastra-ai/mastra/pull/18658))
10
+ - Install, scaffold, configure, block, and auto-update plugins with local-change backups.
11
+ - Load plugin tools in all modes, including streaming progress and subagent-style rendering.
12
+ - Load bundled plugin commands, skills, and plugin-provided system instructions.
13
+
14
+ Example:
15
+
16
+ ```ts
17
+ import { createTool, defineMastraCodePlugin, z } from 'mastracode/plugin';
18
+
19
+ export default defineMastraCodePlugin({
20
+ id: 'acme.tools',
21
+ tools: {
22
+ echo: {
23
+ tool: createTool({
24
+ id: 'echo',
25
+ inputSchema: z.object({ message: z.string() }),
26
+ execute: async ({ message }) => ({ message }),
27
+ }),
28
+ },
29
+ },
30
+ });
31
+ ```
32
+
33
+ - Updated dependencies [[`6f578ac`](https://github.com/mastra-ai/mastra/commit/6f578acba84930b406b2a0700b17cfdfaf5aae56), [`c01012f`](https://github.com/mastra-ai/mastra/commit/c01012f50368d29eb3fc3764df42d48291973d23), [`9eefdc0`](https://github.com/mastra-ai/mastra/commit/9eefdc0ac03f989718c6d835334940a977938895), [`be875ed`](https://github.com/mastra-ai/mastra/commit/be875ed43f856742ce58529f531b5ea0ae6911f3), [`9eefdc0`](https://github.com/mastra-ai/mastra/commit/9eefdc0ac03f989718c6d835334940a977938895), [`7d112ca`](https://github.com/mastra-ai/mastra/commit/7d112ca17078479b2659b88ba1c85b936cfc111c)]:
34
+ - @mastra/memory@1.22.0-alpha.3
35
+ - @mastra/core@1.48.0-alpha.10
36
+ - @mastra/server@1.48.0-alpha.10
37
+ - @mastra/libsql@1.14.3-alpha.0
38
+ - @mastra/pg@1.14.3-alpha.0
39
+ - @mastra/hono@1.5.3-alpha.10
40
+ - @mastra/react@1.2.1-alpha.10
41
+
42
+ ## 0.27.0-alpha.9
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [[`e84e791`](https://github.com/mastra-ai/mastra/commit/e84e79174031d7bc8793ca6c805eb38b06e7cfb1)]:
47
+ - @mastra/core@1.48.0-alpha.9
48
+ - @mastra/react@1.2.1-alpha.9
49
+ - @mastra/server@1.48.0-alpha.9
50
+ - @mastra/hono@1.5.3-alpha.9
51
+
52
+ ## 0.27.0-alpha.8
53
+
54
+ ### Patch Changes
55
+
56
+ - MastraCode now builds its code agent through the new `createCodingAgent` factory from `@mastra/core/coding-agent` instead of constructing the `Agent` inline. No user-facing behavior changes — the system prompt and agent configuration are unchanged. ([#18695](https://github.com/mastra-ai/mastra/pull/18695))
57
+
58
+ - Updated dependencies [[`0ac14ce`](https://github.com/mastra-ai/mastra/commit/0ac14cea48e1b0a7857782153c78f7242fdf7e1a), [`c2f0b7f`](https://github.com/mastra-ai/mastra/commit/c2f0b7f1370f4428d165f51f0d1d9a48331cc257)]:
59
+ - @mastra/core@1.48.0-alpha.8
60
+ - @mastra/react@1.2.1-alpha.8
61
+ - @mastra/server@1.48.0-alpha.8
62
+ - @mastra/hono@1.5.3-alpha.8
63
+
64
+ ## 0.27.0-alpha.7
65
+
66
+ ### Minor Changes
67
+
68
+ - Reworked headless mode into a real programmatic API. You can now run MastraCode from Node/CI code with `runMC({ controller, session, prompt })`, which returns a handle that streams live events as an async-iterable and resolves to a typed result with status, text, usage, tool calls, and an exit code — it never calls `process.exit` or writes to global streams. The CLI is now a thin adapter over the same runner. ([#18680](https://github.com/mastra-ai/mastra/pull/18680))
69
+
70
+ ```ts
71
+ import { createMastraCode, runMC } from 'mastracode';
72
+
73
+ const { controller, session } = await createMastraCode({ settingsPath });
74
+
75
+ const run = runMC({ controller, session, prompt: 'Fix the failing test' });
76
+ for await (const event of run) {
77
+ // optional: react to live progress events
78
+ }
79
+ const result = await run.result;
80
+ process.exitCode = result.exitCode; // 0 success, 1 error/aborted/max-turns, 2 timeout
81
+ ```
82
+
83
+ Approvals and suspensions are resolved by a pluggable policy (default keeps the previous auto-approve behavior); a built-in `denyPolicy` plus `permissionModeToPolicy` are exported, and a new `--permission-mode {auto|deny}` flag selects between them. A new `--max-turns` flag (and `maxTurns` option) caps assistant turns and reports a `max_turns` status with exit code 1 when the cap is hit mid-task.
84
+
85
+ Breaking changes / migration:
86
+ - Output flags consolidated: the `--format` and `--output-format` flags are replaced by a single `--output` flag with values `human`, `json`, or `jsonl`.
87
+ - Before: `mastracode --prompt "..." --output-format json`
88
+ - After: `mastracode --prompt "..." --output json`
89
+ - Programmatic entry point changed from the old `runHeadless`/`headlessMain` to `runMC` (pure runner) and `runMCCli` (CLI adapter). `runMC` takes an already-built `controller` + `session` from `createMastraCode` and returns a result object instead of only an exit code.
90
+
91
+ - Turned MastraCode Web into a multi-org cloud coding service. When WorkOS auth and a GitHub App are configured, a team can sign in, connect their repos, and run coding agents that branch, commit, push, and open pull requests — all from isolated cloud sandboxes. When the relevant environment variables are absent, the server and UI behave exactly as before (local-path projects, single shared store, no auth UI), so this is fully opt-in. ([#18567](https://github.com/mastra-ai/mastra/pull/18567))
92
+
93
+ **Authentication (WorkOS AuthKit).** Setting `WORKOS_API_KEY` and `WORKOS_CLIENT_ID` protects every route: unauthenticated visitors are redirected to the WorkOS hosted login, signed-in users get an encrypted session, expired sessions bounce back to login, and the sidebar shows the signed-in email with a Sign out button. Users with no WorkOS organization get a personal org bootstrapped on first authenticated use (idempotent, with recovery from partial creations), so personal accounts can use org-scoped features without hand-creating an org.
94
+
95
+ **Org-owned GitHub projects.** With the GitHub App env vars set (`GITHUB_APP_ID`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_CLIENT_ID`, `GITHUB_APP_CLIENT_SECRET`, `GITHUB_APP_SLUG`, `APP_DATABASE_URL`), users install/connect the app, pick repos they can access, and turn each into a project. The installation and connected repos belong to the WorkOS organization; the same repo can be connected independently by different orgs with no cross-visibility. Each repo is materialized into an isolated cloud sandbox on open — cloned (or pulled) inside the sandbox with a short-lived installation token that never reaches the browser and is scrubbed from the remote afterward.
96
+
97
+ **Cloud coding-agent write-back.** From a connected repo, each user gets their own sandbox, git worktrees, and feature branches. The agent runs against the selected worktree (file edits and commands bind to its path) and can commit, push, and open pull requests via the in-sandbox `gh` CLI, authenticated with short-lived per-operation installation tokens. The sidebar shows a nested project → worktree → conversations tree with a "+ New worktree" affordance; conversations scope per worktree.
98
+
99
+ **Sandbox providers.** A provider is selected automatically: Railway when `RAILWAY_API_TOKEN` is set, otherwise a local provider that runs git directly on the host (single-user local dev only — no tenant isolation). `MASTRACODE_SANDBOX_PROVIDER` overrides explicitly. Idle sandboxes are torn down and re-provisioned on the next open; a per-replica live-sandbox cap (`MASTRACODE_MAX_SANDBOXES`) and a per-user teardown route bound resource use.
100
+
101
+ **Per-(org,user) state isolation.** Agent state (threads, messages, memory, recall vectors) is isolated by the `(organization, user)` pair, each backed by a dedicated libSQL database whose location is derived server-side from a hash of `(orgId, userId)` — never a client-supplied path. By default each tenant gets local libSQL files under `MASTRACODE_TENANT_DB_ROOT`; for hosted deployments, point each tenant at a remote libSQL/Turso database via `MASTRACODE_TENANT_DB_URL_TEMPLATE` (plus optional vector template and auth tokens).
102
+
103
+ **Sandbox isolation hardening.** Commands run in the local sandbox receive only a sanitized allow-list of environment variables (PATH/HOME/locale/git config), so server secrets such as `GITHUB_APP_PRIVATE_KEY`, `WORKOS_API_KEY`, and `APP_DATABASE_URL` are never exposed to code running against an untrusted checkout. Sandbox filesystem write operations (write/append/copy/move/mkdir) now verify the destination's real path — including a symlinked parent directory — stays within the workspace root, preventing a malicious repo's symlink from redirecting writes outside the sandbox.
104
+
105
+ **Multi-replica deployment hardening.** Per-(project,user) git writes are serialized across replicas with Postgres advisory locks (`MASTRACODE_DISTRIBUTED_LOCK`, on by default; requires `APP_DATABASE_URL`). OAuth/install state signing requires a replica-stable secret in multi-replica setups, in-memory tenant stacks are evicted by idle timeout and an LRU cap (`MASTRACODE_TENANT_IDLE_MINUTES`, `MASTRACODE_TENANT_MAX_APPS`), and `MASTRACODE_REQUIRE_REMOTE_TENANT_DB=1` fails startup when no shared remote tenant DB is configured.
106
+
107
+ ```bash
108
+ # Auth + GitHub App (opt-in)
109
+ WORKOS_API_KEY=sk_xxxxxxxx
110
+ WORKOS_CLIENT_ID=client_xxxxxxxx
111
+ GITHUB_APP_ID=123456
112
+ GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
113
+ GITHUB_APP_CLIENT_ID=Iv1.xxxxxxxx
114
+ GITHUB_APP_CLIENT_SECRET=xxxxxxxx
115
+ GITHUB_APP_SLUG=your-app-slug
116
+ APP_DATABASE_URL=postgres://user:pass@host:5432/mastracode_web
117
+
118
+ # Multi-replica hosted deployment
119
+ GITHUB_APP_WEBHOOK_SECRET=... # replica-stable state signing
120
+ MASTRACODE_DISTRIBUTED_LOCK=1 # cross-replica git write locks
121
+ MASTRACODE_REQUIRE_REMOTE_TENANT_DB=1 # require shared remote tenant DBs
122
+ MASTRACODE_TENANT_DB_URL_TEMPLATE=libsql://{id}-org.turso.io
123
+ MASTRACODE_TENANT_IDLE_MINUTES=30
124
+ MASTRACODE_TENANT_MAX_APPS=100
125
+ MASTRACODE_MAX_SANDBOXES=50
126
+ ```
127
+
128
+ Still deferred: collaboration within a project (multiple users sharing one worktree/sandbox/branch), org admin/roles and membership management, and org-level project deletion.
129
+
130
+ - Auto-provision a per-tenant Turso database in deployed MastraCode Web environments. ([#18690](https://github.com/mastra-ai/mastra/pull/18690))
131
+
132
+ Previously, hosting per-`(org, user)` agent state on Turso required each tenant's database to already exist at the URL produced by `MASTRACODE_TENANT_DB_URL_TEMPLATE`. There was no way to create those databases on demand, so the only zero-setup option was server-local libSQL files — which are ephemeral and not shared across replicas.
133
+
134
+ Setting `MASTRACODE_TURSO_PLATFORM_TOKEN` and `MASTRACODE_TURSO_ORG` now enables a third tenant-storage mode: the first time a tenant is seen, its own Turso database is created via the Turso Platform API (idempotent — an "already exists" race recovers the hostname via `databases.get`), a scoped auth token is minted, and the stable database-name/hostname mapping is persisted in the app Postgres (`tenant_databases` table, requires `APP_DATABASE_URL`). All replicas converge on the same database and cold starts never re-create it. Only the durable mapping is stored; the auth token is minted fresh per resolution, so no long-lived credential is persisted.
135
+
136
+ Resolution priority is: explicit `MASTRACODE_TENANT_DB_URL_TEMPLATE` → Turso auto-provisioning → local libSQL files. Turso provisioning also satisfies `MASTRACODE_REQUIRE_REMOTE_TENANT_DB=1`. The `@tursodatabase/api` client is loaded dynamically, so deployments that don't use Turso never pull it in at runtime.
137
+
138
+ ```bash
139
+ MASTRACODE_TURSO_PLATFORM_TOKEN=... # Turso Platform API token
140
+ MASTRACODE_TURSO_ORG=my-org # org that owns provisioned databases
141
+ MASTRACODE_TURSO_GROUP=default # optional group (default "default")
142
+ APP_DATABASE_URL=postgres://... # required for the mapping table
143
+ ```
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [[`8be63b0`](https://github.com/mastra-ai/mastra/commit/8be63b015fb8d72cea1220f05e7dc3bb997cc249), [`ee14cae`](https://github.com/mastra-ai/mastra/commit/ee14cae244805783bde518a6142de28b744b169c), [`345eecc`](https://github.com/mastra-ai/mastra/commit/345eecce6ba519b5d987f0e10b5de4c8e5734580), [`ee14cae`](https://github.com/mastra-ai/mastra/commit/ee14cae244805783bde518a6142de28b744b169c)]:
148
+ - @mastra/core@1.48.0-alpha.7
149
+ - @mastra/server@1.48.0-alpha.7
150
+ - @mastra/hono@1.5.3-alpha.7
151
+ - @mastra/react@1.2.1-alpha.7
152
+
153
+ ## 0.27.0-alpha.6
154
+
155
+ ### Patch Changes
156
+
157
+ - Renamed the AgentController interval API. `heartbeatHandlers` is now `intervalHandlers`, the `HeartbeatHandler` type is now `IntervalHandler`, and the `removeHeartbeat()`/`stopHeartbeats()` methods are now `removeInterval()`/`stopIntervals()`. This better reflects that these are fixed-interval background tasks, not liveness pings, and is distinct from the unrelated `mastra.heartbeats` scheduled-agent feature. ([#18665](https://github.com/mastra-ai/mastra/pull/18665))
158
+
159
+ **Before**
160
+
161
+ ```ts
162
+ const { controller } = await createMastraCode({
163
+ heartbeatHandlers: [{ id: 'sync', intervalMs: 60_000, handler: async () => {} }],
164
+ });
165
+ await controller.removeHeartbeat({ id: 'sync' });
166
+ await controller.stopHeartbeats();
167
+ ```
168
+
169
+ **After**
170
+
171
+ ```ts
172
+ const { controller } = await createMastraCode({
173
+ intervalHandlers: [{ id: 'sync', intervalMs: 60_000, handler: async () => {} }],
174
+ });
175
+ await controller.removeInterval({ id: 'sync' });
176
+ await controller.stopIntervals();
177
+ ```
178
+
179
+ - Improved MastraCode web chat so hydrated and streaming messages render consistently, including tool cards, reasoning, and failed-tool states. ([#18620](https://github.com/mastra-ai/mastra/pull/18620))
180
+
181
+ - Updated dependencies [[`b33c77d`](https://github.com/mastra-ai/mastra/commit/b33c77d5293f14a794f3ec38dc947a6676de2764), [`1009f77`](https://github.com/mastra-ai/mastra/commit/1009f772aa40016b49267c8566d0c29f6a16aa3c), [`23c31de`](https://github.com/mastra-ai/mastra/commit/23c31de96ed8153402dcf092ac84b27a0c3638c1), [`0368766`](https://github.com/mastra-ai/mastra/commit/0368766744c7ea3df4d6059e2cc15f7bdf55f5a6), [`d0702ee`](https://github.com/mastra-ai/mastra/commit/d0702eedc1594cb2d0d83476440cfc2ec8820adb), [`65a66db`](https://github.com/mastra-ai/mastra/commit/65a66dbe249a0d92d828c605b955e73a983cf3b0), [`2866f04`](https://github.com/mastra-ai/mastra/commit/2866f04953edb78c1637fa45cc53abe24122edcb)]:
182
+ - @mastra/core@1.48.0-alpha.6
183
+ - @mastra/schema-compat@1.3.2-alpha.1
184
+ - @mastra/mcp@1.12.1-alpha.0
185
+ - @mastra/react@1.2.1-alpha.6
186
+ - @mastra/memory@1.21.3-alpha.2
187
+ - @mastra/server@1.48.0-alpha.6
188
+ - @mastra/hono@1.5.3-alpha.6
189
+
190
+ ## 0.27.0-alpha.5
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [[`1917c53`](https://github.com/mastra-ai/mastra/commit/1917c53b19dac43926f29c496893b0686462dca4), [`c607ece`](https://github.com/mastra-ai/mastra/commit/c607eceeda028a80b24d00ee7dae376db73df526), [`58e287b`](https://github.com/mastra-ai/mastra/commit/58e287b1edaf978b13745a1795989cad3826e82b)]:
195
+ - @mastra/core@1.48.0-alpha.5
196
+ - @mastra/server@1.48.0-alpha.5
197
+ - @mastra/memory@1.21.3-alpha.1
198
+ - @mastra/hono@1.5.3-alpha.5
199
+
200
+ ## 0.27.0-alpha.4
201
+
202
+ ### Minor Changes
203
+
204
+ - Added voice input to the MastraCode TUI. Enable it with /voice, then hold the spacebar to dictate a prompt and release to finish. Your speech streams into the input in real time as you talk and is transcribed with OpenAI Whisper. The setting persists across restarts. ([#18624](https://github.com/mastra-ai/mastra/pull/18624))
205
+
206
+ Requires an OpenAI API key (set `OPENAI_API_KEY` or configure it via `/api-keys`) and a local audio recorder on your `PATH` — `rec`/`sox` (recommended for live streaming) or `ffmpeg` on macOS, and `pw-record`/`parecord`/`arecord`/`sox` on Linux.
207
+
208
+ - Added Amazon Bedrock as a model provider in Mastra Code. Bedrock models surfaced by models.dev are now selectable via `/models` and usable as build/plan/fast or subagent models with the `amazon-bedrock/<modelId>` form. Models are only offered when AWS credentials are detected. ([#17937](https://github.com/mastra-ai/mastra/pull/17937))
209
+
210
+ Bedrock authenticates with AWS SigV4 through the standard AWS credential chain (`fromNodeProviderChain`), so environment variables, shared `~/.aws` profiles, SSO, and container/instance roles all work without extra configuration. Set `AWS_REGION` (defaults to `us-east-1`) to target a region, or `AWS_BEARER_TOKEN_BEDROCK` to use Bedrock API-key auth instead.
211
+
212
+ ```sh
213
+ # Pick a Bedrock model from the picker
214
+ /models
215
+
216
+ # Or set it directly via the build/plan/fast slots
217
+ /build amazon-bedrock/<modelId>
218
+ ```
219
+
220
+ ### Patch Changes
221
+
222
+ - Amazon Bedrock models now appear under their own `amazon-bedrock/<model>` provider in the model picker instead of the `mastracode/amazon-bedrock/<model>` namespace. Bedrock is resolved through a dedicated Amazon Bedrock gateway that authenticates with the AWS credential chain (SigV4) and surfaces models from the public models.dev catalog. Saved model selections using the previous `mastracode/amazon-bedrock/...` IDs are still resolved at runtime, so existing config keeps working. ([#17937](https://github.com/mastra-ai/mastra/pull/17937))
223
+
224
+ - Updated dependencies [[`705ba98`](https://github.com/mastra-ai/mastra/commit/705ba98726d388a596e896225f237907ca6807a9), [`e62c108`](https://github.com/mastra-ai/mastra/commit/e62c108409dfd6a6cac0a48ec39c5cc81d24fd52), [`bfbbb01`](https://github.com/mastra-ai/mastra/commit/bfbbb01bd845ba54cdc0c678c277d08a7cb847e4)]:
225
+ - @mastra/core@1.48.0-alpha.4
226
+ - @mastra/server@1.48.0-alpha.4
227
+ - @mastra/hono@1.5.3-alpha.4
228
+
229
+ ## 0.27.0-alpha.3
230
+
231
+ ### Patch Changes
232
+
233
+ - Fixed MCP HTTP server URLs so `${VAR}` references resolve from the environment, the same way header values already do. A server configured with `"url": "${MCP_SERVER_URL}"` is now connected instead of being silently skipped as an invalid URL. ([#18579](https://github.com/mastra-ai/mastra/pull/18579))
234
+
235
+ - MCP stdio servers now resolve `${VAR}` references in their `env` values from the host environment, matching the existing behavior for HTTP server headers. You can reference secrets from the environment instead of hardcoding them in `mcp.json`: ([#18529](https://github.com/mastra-ai/mastra/pull/18529))
236
+
237
+ ```json
238
+ {
239
+ "mcpServers": {
240
+ "github": {
241
+ "command": "npx",
242
+ "args": ["-y", "@modelcontextprotocol/server-github"],
243
+ "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
244
+ }
245
+ }
246
+ }
247
+ ```
248
+
249
+ - Updated dependencies [[`cdd5f93`](https://github.com/mastra-ai/mastra/commit/cdd5f939cefa67390629704dce92563ccbf492b2), [`1b8728a`](https://github.com/mastra-ai/mastra/commit/1b8728a57fd844205a452b0b4216d20ff60c784a), [`9feeaa0`](https://github.com/mastra-ai/mastra/commit/9feeaa0f9a1af07039e5b4f22b932b0cb18617e8), [`e05dade`](https://github.com/mastra-ai/mastra/commit/e05dade21c3e2551893ad939e6028cdafd84a1b2), [`213feb8`](https://github.com/mastra-ai/mastra/commit/213feb87bfdd1d8ec00ea660e218f9bcfcb34e7b)]:
250
+ - @mastra/core@1.48.0-alpha.3
251
+ - @mastra/schema-compat@1.3.2-alpha.0
252
+ - @mastra/server@1.48.0-alpha.3
253
+ - @mastra/mcp@1.12.0
254
+ - @mastra/memory@1.21.3-alpha.0
255
+ - @mastra/hono@1.5.3-alpha.3
256
+
257
+ ## 0.27.0-alpha.2
258
+
259
+ ### Patch Changes
260
+
261
+ - Updated dependencies [[`e420b3c`](https://github.com/mastra-ai/mastra/commit/e420b3c3ffc98bbc5b791897ea390bb47af99696)]:
262
+ - @mastra/core@1.48.0-alpha.2
263
+ - @mastra/server@1.48.0-alpha.2
264
+ - @mastra/hono@1.5.3-alpha.2
265
+
266
+ ## 0.27.0-alpha.1
267
+
268
+ ### Minor Changes
269
+
270
+ - **Improved web settings data loading** ([#18518](https://github.com/mastra-ai/mastra/pull/18518))
271
+ - Settings panels now avoid duplicate requests and refresh lists after saves or removals.
272
+ - Provider keys, custom providers, model packs, observational memory, and the directory picker now stay in sync automatically.
273
+ - Streaming chat behavior is unchanged.
274
+
275
+ ### Patch Changes
276
+
277
+ - Updated dependencies [[`95857bc`](https://github.com/mastra-ai/mastra/commit/95857bcd6669da7193f503e803f0d72a2bd66be6), [`8e9c0fb`](https://github.com/mastra-ai/mastra/commit/8e9c0fb48fd58da2efcdff2cf1202ee41092c315)]:
278
+ - @mastra/core@1.48.0-alpha.1
279
+ - @mastra/server@1.48.0-alpha.1
280
+ - @mastra/hono@1.5.3-alpha.1
281
+
3
282
  ## 0.26.1-alpha.0
4
283
 
5
284
  ### Patch Changes
package/README.md CHANGED
@@ -101,6 +101,7 @@ Select a suggestion with arrow keys and press Tab to insert it.
101
101
  | `/mcp` | Show/reload MCP server connections |
102
102
  | `/sandbox` | Manage allowed paths (add/remove dirs) |
103
103
  | `/permissions` | View/manage tool approval permissions |
104
+ | `/plugins` | Install and manage trusted Mastra Code plugins |
104
105
  | `/settings` | General settings (notifications, YOLO, etc.) |
105
106
  | `/yolo` | Toggle YOLO mode (auto-approve all tools) |
106
107
  | `/resource` | Show/switch resource ID (tag for sharing) |
@@ -111,6 +112,10 @@ Select a suggestion with arrow keys and press Tab to insert it.
111
112
  | `/help` | Show available commands |
112
113
  | `/exit` | Exit the TUI |
113
114
 
115
+ ### Plugins
116
+
117
+ Use `/plugins` to install and manage trusted local or GitHub plugins. Plugins can add tools, commands, skills, and system instructions. Because plugins execute code inside Mastra Code and their instructions are appended to the agent prompt, only install plugins from sources you trust.
118
+
114
119
  ### Goals
115
120
 
116
121
  Use `/goal <objective>` to have Mastra Code keep working toward an objective across turns. Goals use a judge model to decide whether the goal is complete, should continue, or should wait for an explicit user checkpoint. Configure defaults with `/judge`.
@@ -215,6 +220,8 @@ When both are available, Claude Max OAuth takes priority.
215
220
 
216
221
  For **other providers** (OpenAI, Google, etc.), set the corresponding environment variable (e.g., `OPENAI_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`) or use OAuth where supported.
217
222
 
223
+ For **Amazon Bedrock**, mastracode authenticates with AWS SigV4 through the standard AWS credential chain — environment variables (`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`), a shared `~/.aws` profile (`AWS_PROFILE`, including SSO), or a container/instance role all work, the same resolution order as the AWS CLI. Set `AWS_REGION` (defaults to `us-east-1`) to choose a region. Select Bedrock models with the `amazon-bedrock/<modelId>` form, where `<modelId>` is any Bedrock model ID surfaced via `/models`. To use Bedrock API-key auth instead of SigV4, set `AWS_BEARER_TOKEN_BEDROCK`.
224
+
218
225
  Credentials are stored alongside the database in `auth.json`.
219
226
 
220
227
  ### Custom providers and models
@@ -256,6 +263,129 @@ To save plans to a project-local directory instead, set the `MASTRA_PLANS_DIR` e
256
263
  export MASTRA_PLANS_DIR=.mastracode/plans
257
264
  ```
258
265
 
266
+ ### Web UI: optional auth & GitHub projects
267
+
268
+ The web UI (`mastracode web`) supports optional WorkOS authentication and a GitHub App
269
+ integration. Both are off by default — when their environment variables are absent the web UI
270
+ behaves exactly as before.
271
+
272
+ **WorkOS auth** — when `WORKOS_API_KEY` and `WORKOS_CLIENT_ID` are set, every route requires a
273
+ signed-in user (hosted login + encrypted session):
274
+
275
+ ```bash
276
+ export WORKOS_API_KEY=...
277
+ export WORKOS_CLIENT_ID=...
278
+ export WORKOS_REDIRECT_URI=https://your-host/auth/callback # optional
279
+ export WORKOS_COOKIE_PASSWORD=... # optional (recommended in prod)
280
+ ```
281
+
282
+ On first authenticated use, a user with no WorkOS organization is automatically given a personal
283
+ org (the org is created and the user added as a member), so org-scoped features work without
284
+ hand-creating an org in the WorkOS dashboard. The WorkOS API key must be allowed to create
285
+ organizations and memberships; if it isn't, bootstrap fails soft (logged) and the user keeps the
286
+ `organization_required` response.
287
+
288
+ **GitHub projects** — when the GitHub App variables are set _and_ WorkOS auth is enabled,
289
+ signed-in users can install the GitHub App, pick repositories, and turn each repo into a project.
290
+ The tenant boundary is the **WorkOS organization**: the GitHub App installation and the connected
291
+ project (repo) are owned by the org, while each user inside the org gets their own isolated
292
+ sandbox, worktrees, branches, and PRs against that repo. The **same repo can be connected
293
+ independently by different orgs** without ever seeing each other's projects, sandboxes, or state.
294
+ Personal accounts are bootstrapped into a personal org on first use (see above), so they can
295
+ connect GitHub projects too; users always get isolated agent state regardless. Repo and project
296
+ metadata persist in a separate application Postgres (`APP_DATABASE_URL`):
297
+
298
+ ```bash
299
+ export GITHUB_APP_ID=...
300
+ export GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
301
+ export GITHUB_APP_CLIENT_ID=...
302
+ export GITHUB_APP_CLIENT_SECRET=...
303
+ export GITHUB_APP_SLUG=your-app-slug
304
+ export APP_DATABASE_URL=postgres://user:pass@host:5432/db
305
+ export GITHUB_APP_REDIRECT_URI=https://your-host/auth/github/callback # optional
306
+ ```
307
+
308
+ GitHub-backed projects are cloned into an isolated cloud sandbox on open, which requires a
309
+ sandbox provider. Railway is the first supported backend:
310
+
311
+ ```bash
312
+ export RAILWAY_API_TOKEN=...
313
+ export RAILWAY_ENVIRONMENT_ID=...
314
+ export MASTRACODE_SANDBOX_PROVIDER=railway # optional (default when a token is set)
315
+ export MASTRACODE_SANDBOX_WORKDIR=/workspace # optional (path inside the sandbox)
316
+ export MASTRACODE_SANDBOX_IDLE_MINUTES=30 # optional (idle teardown window; default 30)
317
+ ```
318
+
319
+ The sandbox template must have `git` and `gh` (the GitHub CLI) installed and outbound network
320
+ access to `github.com`. `gh` is only required to open pull requests; clone/open work without it.
321
+ Idle sandboxes are stopped by the provider after `MASTRACODE_SANDBOX_IDLE_MINUTES`; the next open
322
+ detects the stopped VM and re-provisions automatically.
323
+ Without a sandbox provider, users can still connect GitHub and pick repos, but opening a repo
324
+ project shows a clear "sandbox not configured" error.
325
+
326
+ ### Per-(org,user) storage isolation
327
+
328
+ When WorkOS web auth is enabled, the tenant boundary is the **(organization, user)** pair: each
329
+ user in each org operates against their own dedicated libSQL database for all agent state (threads,
330
+ messages, memory, observational memory, recall vectors) — no tenant can read another tenant's data
331
+ at the storage layer. Two users in the same org are isolated, and the same user across two orgs is
332
+ also isolated. The database location is derived server-side from a hash of `(orgId, userId)` (no
333
+ client-supplied paths); users without an org fall back to a user-only key.
334
+
335
+ ```bash
336
+ # Local files (default): one isolated DB dir per tenant under this root
337
+ export MASTRACODE_TENANT_DB_ROOT=~/.mastracode/web/tenants # optional
338
+
339
+ # Or remote libSQL/Turso per tenant ({id} = hashed (orgId, userId)). This mode
340
+ # assumes each tenant DB already exists at the templated URL.
341
+ export MASTRACODE_TENANT_DB_URL_TEMPLATE=libsql://{id}-org.turso.io # optional
342
+ export MASTRACODE_TENANT_VECTOR_URL_TEMPLATE=libsql://{id}-vec-org.turso.io # optional
343
+ export MASTRACODE_TENANT_DB_AUTH_TOKEN=... # optional
344
+ export MASTRACODE_TENANT_VECTOR_AUTH_TOKEN=... # optional
345
+
346
+ # Or auto-provision a Turso database per tenant on first access via the Turso
347
+ # Platform API (no pre-created DBs needed). Requires APP_DATABASE_URL: the
348
+ # stable db-name/hostname mapping is persisted there so replicas converge on
349
+ # one DB and cold starts don't re-create it. A scoped token is minted fresh per
350
+ # resolution, so no long-lived credential is stored.
351
+ export MASTRACODE_TURSO_PLATFORM_TOKEN=... # optional
352
+ export MASTRACODE_TURSO_ORG=my-org # optional
353
+ export MASTRACODE_TURSO_GROUP=default # optional (default "default")
354
+ ```
355
+
356
+ Resolution priority: explicit `MASTRACODE_TENANT_DB_URL_TEMPLATE` → Turso
357
+ auto-provisioning (when the platform token + org are set) → local libSQL files.
358
+
359
+ When web auth is disabled the server uses a single shared store, exactly as before.
360
+
361
+ ### Multi-replica deployment
362
+
363
+ The web server keeps each tenant's Mastra stack in an in-memory cache and serializes per-user git
364
+ write operations. For hosted, multi-replica deployments a few settings make this safe and bounded:
365
+
366
+ ```bash
367
+ # Replica-stable state signing — REQUIRED across replicas. Without an explicit
368
+ # GITHUB_APP_WEBHOOK_SECRET (or WORKOS_COOKIE_PASSWORD) the OAuth/install state
369
+ # is signed with a per-process random key and callbacks fail on other replicas.
370
+ export GITHUB_APP_WEBHOOK_SECRET=...
371
+
372
+ # Cross-replica serialization of per-(project,user) git writes via Postgres
373
+ # advisory locks (default on, requires APP_DATABASE_URL). Set 0 for local dev.
374
+ export MASTRACODE_DISTRIBUTED_LOCK=1
375
+
376
+ # Persist/share tenant DBs across replicas — fail/warn at startup if no remote
377
+ # tenant DB backend (URL template OR Turso auto-provisioning) is configured
378
+ # (local-file DBs don't survive restarts or sharing).
379
+ export MASTRACODE_REQUIRE_REMOTE_TENANT_DB=1
380
+
381
+ # Bound in-memory tenant caches as the team grows.
382
+ export MASTRACODE_TENANT_IDLE_MINUTES=30 # idle eviction window (0 disables)
383
+ export MASTRACODE_TENANT_MAX_APPS=100 # LRU cap on cached stacks (0 disables)
384
+
385
+ # Per-replica cap on concurrently live sandboxes (0 / unset = unlimited).
386
+ export MASTRACODE_MAX_SANDBOXES=50
387
+ ```
388
+
259
389
  ## Architecture
260
390
 
261
391
  ```
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkYPTGVE6M_cjs = require('./chunk-YPTGVE6M.cjs');
4
- var chunkKGBCGF6C_cjs = require('./chunk-KGBCGF6C.cjs');
5
3
  var chunkVBH3L4LD_cjs = require('./chunk-VBH3L4LD.cjs');
4
+ var chunkHADE25EX_cjs = require('./chunk-HADE25EX.cjs');
5
+ var chunkWX46SWL3_cjs = require('./chunk-WX46SWL3.cjs');
6
6
  var crypto = require('crypto');
7
7
  var stream = require('stream');
8
8
  var sdk = require('@agentclientprotocol/sdk');
@@ -45,7 +45,7 @@ async function acpMain(options) {
45
45
  };
46
46
  let result;
47
47
  try {
48
- result = await chunkYPTGVE6M_cjs.createMastraCode({
48
+ result = await chunkHADE25EX_cjs.createMastraCode({
49
49
  unixSocketPubSub: false,
50
50
  disableMcp: false,
51
51
  disableHooks: false
@@ -57,12 +57,12 @@ async function acpMain(options) {
57
57
  { id: "fast", name: "Fast" }
58
58
  ];
59
59
  const cleanup = async () => {
60
- chunkKGBCGF6C_cjs.releaseAllThreadLocks();
60
+ chunkWX46SWL3_cjs.releaseAllThreadLocks();
61
61
  const closeSignalsPubSub = signalsPubSub?.close;
62
62
  await Promise.allSettled([
63
63
  mcpManager?.disconnect(),
64
64
  controller?.getMastra()?.stopWorkers(),
65
- controller?.stopHeartbeats(),
65
+ controller?.stopIntervals(),
66
66
  closeSignalsPubSub?.()
67
67
  ]);
68
68
  console.log = originalConsoleLog;
@@ -83,5 +83,5 @@ async function acpMain(options) {
83
83
  }
84
84
 
85
85
  exports.acpMain = acpMain;
86
- //# sourceMappingURL=acp-UF33ZDIG.cjs.map
87
- //# sourceMappingURL=acp-UF33ZDIG.cjs.map
86
+ //# sourceMappingURL=acp-33VZO665.cjs.map
87
+ //# sourceMappingURL=acp-33VZO665.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/acp/server.ts","../src/acp/index.ts"],"names":["Readable","Writable","stream","ndJsonStream","randomUUID","AgentSideConnection","MastraCodeAcpAgent","setAutoApprove","createMastraCode","releaseAllThreadLocks"],"mappings":";;;;;;;;;AAUA,eAAsB,YAAA,CACpB,UAAA,EACA,KAAA,EACA,OAAA,EACe;AAEf,EAAA,MAAM,KAAA,GAAQA,eAAA,CAAS,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAC1C,EAAA,MAAM,MAAA,GAASC,eAAA,CAAS,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA;AAC5C,EAAA,MAAMC,QAAA,GAASC,gBAAA,CAAa,MAAA,EAAQ,KAAK,CAAA;AACzC,EAAA,IAAI,OAAA;AACJ,EAAA,IAAI,KAAA;AAGJ,EAAA,IAAI;AACF,IAAA,OAAA,GAAU,MAAM,WAAW,aAAA,CAAc;AAAA,MACvC,EAAA,EAAI,CAAA,IAAA,EAAOC,iBAAA,EAAY,CAAA,CAAA;AAAA,MACvB,OAAA,EAAS,CAAA,UAAA,EAAaA,iBAAA,EAAY,CAAA;AAAA,KACnC,CAAA;AACD,IAAA,MAAM,aAAA,GAAgB,OAAA;AAGtB,IAAA,MAAM,UAAA,GAAa,IAAIC,uBAAA,CAAoB,CAAA,IAAA,KAAQ;AACjD,MAAA,KAAA,GAAQ,IAAIC,oCAAA,CAAmB,IAAA,EAAM,UAAA,EAAY,eAAe,KAAK,CAAA;AACrE,MAAA,OAAO,KAAA;AAAA,IACT,GAAGJ,QAAM,CAAA;AAET,IAAA,MAAM,UAAA,CAAW,MAAA;AAAA,EACnB,CAAA,SAAE;AACA,IAAA,KAAA,EAAO,OAAA,EAAQ;AACf,IAAA,OAAA,EAAS,OAAO,iBAAA,EAAkB;AAClC,IAAA,MAAM,OAAA,EAAS,OAAO,mBAAA,EAAoB;AAC1C,IAAA,IAAI,OAAA,EA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,CAAA;AAID,MAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AAAA,IAChB,CAAA;AAGA,IAAA,MAAM,eAAe,YAAY;AAC/B,MAAA,MAAM,OAAA,EAAQ;AACd,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,IAChB,CAAA;AAEA,IAAA,OAAA,CAAQ,EAAA,CAAG,UAAU,YAAY,CAAA;AACjC,IAAA,OAAA,CAAQ,EAAA,CAAG,WAAW,YAAY,CAAA;AAElC,IAAA,MAAM,YAAA,CAAa,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AAAA,EAC/C,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,mBAAA,EAAsB,KAAK;AAAA,CAAI,CAAA;AAEpD,IAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AACd,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF","file":"acp-UF33ZDIG.cjs","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { Readable, Writable } from 'node:stream';\nimport { AgentSideConnection, ndJsonStream } from '@agentclientprotocol/sdk';\nimport type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';\nimport { MastraCodeAcpAgent } from './agent.js';\n\n/**\n * Run the ACP server over stdio.\n * This sets up the JSON-RPC stream and keeps the process alive until the client disconnects.\n */\nexport async function runAcpServer(\n controller: AgentController,\n modes: AgentControllerMode[],\n cleanup?: () => Promise<void>,\n): Promise<void> {\n // Create the ndJSON stream from stdin/stdout\n const input = Readable.toWeb(process.stdin) as ReadableStream<Uint8Array>;\n const output = Writable.toWeb(process.stdout) as WritableStream<Uint8Array>;\n const stream = ndJsonStream(output, input);\n let session: Session | undefined;\n let agent: MastraCodeAcpAgent | undefined;\n\n // Handle cleanup on disconnect (success or error)\n try {\n session = await controller.createSession({\n id: `acp-${randomUUID()}`,\n ownerId: `acp-owner-${randomUUID()}`,\n });\n const activeSession = session;\n\n // Create the agent-side connection\n const connection = new AgentSideConnection(conn => {\n agent = new MastraCodeAcpAgent(conn, controller, activeSession, modes);\n return agent;\n }, stream);\n\n await connection.closed;\n } finally {\n agent?.dispose();\n session?.thread.detachFromCurrent();\n await session?.thread.clearAndReleaseLock();\n if (cleanup) {\n await cleanup();\n }\n }\n}\n","import type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nimport { createMastraCode } from '../index.js';\nimport { releaseAllThreadLocks } from '../utils/thread-lock.js';\nimport { setAutoApprove } from './event-mapper.js';\nimport { runAcpServer } from './server.js';\n\n/**\n * Entry point for ACP server mode.\n * Initializes mastracode and runs the ACP protocol over stdio.\n */\nexport async function acpMain(options?: { dangerousAutoApprove?: boolean }): Promise<void> {\n if (options?.dangerousAutoApprove) {\n setAutoApprove(true);\n }\n // Redirect console.log to stderr to avoid polluting the JSON-RPC stream on stdout.\n // eslint-disable-next-line no-console\n const originalConsoleLog = console.log;\n // eslint-disable-next-line no-console\n console.log = (...args: unknown[]) => {\n process.stderr.write(args.map(String).join(' ') + '\\n');\n };\n\n let result: Awaited<ReturnType<typeof createMastraCode>> | undefined;\n\n try {\n result = await createMastraCode({\n unixSocketPubSub: false,\n disableMcp: false,\n disableHooks: false,\n });\n\n const { controller, mcpManager, signalsPubSub } = result;\n\n // Default modes (same as createMastraCode defaults)\n const modes: AgentControllerMode[] = [\n { id: 'build', name: 'Build' },\n { id: 'plan', name: 'Plan' },\n { id: 'fast', name: 'Fast' },\n ];\n\n // Cleanup function (mirrors main.ts asyncCleanup)\n const cleanup = async () => {\n releaseAllThreadLocks();\n const closeSignalsPubSub = (signalsPubSub as { close?: () => Promise<void> | void } | undefined)?.close;\n await Promise.allSettled([\n mcpManager?.disconnect(),\n controller?.getMastra()?.stopWorkers(),\n controller?.stopHeartbeats(),\n closeSignalsPubSub?.(),\n ]);\n\n // Restore console.log\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n };\n\n // Handle signals\n const handleSignal = async () => {\n await cleanup();\n process.exit(0);\n };\n\n process.on('SIGINT', handleSignal);\n process.on('SIGTERM', handleSignal);\n\n await runAcpServer(controller, modes, cleanup);\n } catch (error) {\n process.stderr.write(`[acp] Fatal error: ${error}\\n`);\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n process.exit(1);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/acp/server.ts","../src/acp/index.ts"],"names":["Readable","Writable","stream","ndJsonStream","randomUUID","AgentSideConnection","MastraCodeAcpAgent","setAutoApprove","createMastraCode","releaseAllThreadLocks"],"mappings":";;;;;;;;;AAUA,eAAsB,YAAA,CACpB,UAAA,EACA,KAAA,EACA,OAAA,EACe;AAEf,EAAA,MAAM,KAAA,GAAQA,eAAA,CAAS,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAC1C,EAAA,MAAM,MAAA,GAASC,eAAA,CAAS,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA;AAC5C,EAAA,MAAMC,QAAA,GAASC,gBAAA,CAAa,MAAA,EAAQ,KAAK,CAAA;AACzC,EAAA,IAAI,OAAA;AACJ,EAAA,IAAI,KAAA;AAGJ,EAAA,IAAI;AACF,IAAA,OAAA,GAAU,MAAM,WAAW,aAAA,CAAc;AAAA,MACvC,EAAA,EAAI,CAAA,IAAA,EAAOC,iBAAA,EAAY,CAAA,CAAA;AAAA,MACvB,OAAA,EAAS,CAAA,UAAA,EAAaA,iBAAA,EAAY,CAAA;AAAA,KACnC,CAAA;AACD,IAAA,MAAM,aAAA,GAAgB,OAAA;AAGtB,IAAA,MAAM,UAAA,GAAa,IAAIC,uBAAA,CAAoB,CAAA,IAAA,KAAQ;AACjD,MAAA,KAAA,GAAQ,IAAIC,oCAAA,CAAmB,IAAA,EAAM,UAAA,EAAY,eAAe,KAAK,CAAA;AACrE,MAAA,OAAO,KAAA;AAAA,IACT,GAAGJ,QAAM,CAAA;AAET,IAAA,MAAM,UAAA,CAAW,MAAA;AAAA,EACnB,CAAA,SAAE;AACA,IAAA,K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AAA,QACvB,YAAY,UAAA,EAAW;AAAA,QACvB,UAAA,EAAY,SAAA,EAAU,EAAG,WAAA,EAAY;AAAA,QACrC,YAAY,aAAA,EAAc;AAAA,QAC1B,kBAAA;AAAqB,OACtB,CAAA;AAID,MAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AAAA,IAChB,CAAA;AAGA,IAAA,MAAM,eAAe,YAAY;AAC/B,MAAA,MAAM,OAAA,EAAQ;AACd,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,IAChB,CAAA;AAEA,IAAA,OAAA,CAAQ,EAAA,CAAG,UAAU,YAAY,CAAA;AACjC,IAAA,OAAA,CAAQ,EAAA,CAAG,WAAW,YAAY,CAAA;AAElC,IAAA,MAAM,YAAA,CAAa,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AAAA,EAC/C,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,mBAAA,EAAsB,KAAK;AAAA,CAAI,CAAA;AAEpD,IAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AACd,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF","file":"acp-33VZO665.cjs","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { Readable, Writable } from 'node:stream';\nimport { AgentSideConnection, ndJsonStream } from '@agentclientprotocol/sdk';\nimport type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';\nimport { MastraCodeAcpAgent } from './agent.js';\n\n/**\n * Run the ACP server over stdio.\n * This sets up the JSON-RPC stream and keeps the process alive until the client disconnects.\n */\nexport async function runAcpServer(\n controller: AgentController,\n modes: AgentControllerMode[],\n cleanup?: () => Promise<void>,\n): Promise<void> {\n // Create the ndJSON stream from stdin/stdout\n const input = Readable.toWeb(process.stdin) as ReadableStream<Uint8Array>;\n const output = Writable.toWeb(process.stdout) as WritableStream<Uint8Array>;\n const stream = ndJsonStream(output, input);\n let session: Session | undefined;\n let agent: MastraCodeAcpAgent | undefined;\n\n // Handle cleanup on disconnect (success or error)\n try {\n session = await controller.createSession({\n id: `acp-${randomUUID()}`,\n ownerId: `acp-owner-${randomUUID()}`,\n });\n const activeSession = session;\n\n // Create the agent-side connection\n const connection = new AgentSideConnection(conn => {\n agent = new MastraCodeAcpAgent(conn, controller, activeSession, modes);\n return agent;\n }, stream);\n\n await connection.closed;\n } finally {\n agent?.dispose();\n session?.thread.detachFromCurrent();\n await session?.thread.clearAndReleaseLock();\n if (cleanup) {\n await cleanup();\n }\n }\n}\n","import type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nimport { createMastraCode } from '../index.js';\nimport { releaseAllThreadLocks } from '../utils/thread-lock.js';\nimport { setAutoApprove } from './event-mapper.js';\nimport { runAcpServer } from './server.js';\n\n/**\n * Entry point for ACP server mode.\n * Initializes mastracode and runs the ACP protocol over stdio.\n */\nexport async function acpMain(options?: { dangerousAutoApprove?: boolean }): Promise<void> {\n if (options?.dangerousAutoApprove) {\n setAutoApprove(true);\n }\n // Redirect console.log to stderr to avoid polluting the JSON-RPC stream on stdout.\n // eslint-disable-next-line no-console\n const originalConsoleLog = console.log;\n // eslint-disable-next-line no-console\n console.log = (...args: unknown[]) => {\n process.stderr.write(args.map(String).join(' ') + '\\n');\n };\n\n let result: Awaited<ReturnType<typeof createMastraCode>> | undefined;\n\n try {\n result = await createMastraCode({\n unixSocketPubSub: false,\n disableMcp: false,\n disableHooks: false,\n });\n\n const { controller, mcpManager, signalsPubSub } = result;\n\n // Default modes (same as createMastraCode defaults)\n const modes: AgentControllerMode[] = [\n { id: 'build', name: 'Build' },\n { id: 'plan', name: 'Plan' },\n { id: 'fast', name: 'Fast' },\n ];\n\n // Cleanup function (mirrors main.ts asyncCleanup)\n const cleanup = async () => {\n releaseAllThreadLocks();\n const closeSignalsPubSub = (signalsPubSub as { close?: () => Promise<void> | void } | undefined)?.close;\n await Promise.allSettled([\n mcpManager?.disconnect(),\n controller?.getMastra()?.stopWorkers(),\n controller?.stopIntervals(),\n closeSignalsPubSub?.(),\n ]);\n\n // Restore console.log\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n };\n\n // Handle signals\n const handleSignal = async () => {\n await cleanup();\n process.exit(0);\n };\n\n process.on('SIGINT', handleSignal);\n process.on('SIGTERM', handleSignal);\n\n await runAcpServer(controller, modes, cleanup);\n } catch (error) {\n process.stderr.write(`[acp] Fatal error: ${error}\\n`);\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n process.exit(1);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { createMastraCode } from './chunk-IVWQHERI.js';
2
- import { releaseAllThreadLocks } from './chunk-NDCWIAKG.js';
3
1
  import { setAutoApprove, MastraCodeAcpAgent } from './chunk-IFUIWWGJ.js';
2
+ import { createMastraCode } from './chunk-KP5DGNCF.js';
3
+ import { releaseAllThreadLocks } from './chunk-GAPPKMQT.js';
4
4
  import { randomUUID } from 'crypto';
5
5
  import { Readable, Writable } from 'stream';
6
6
  import { ndJsonStream, AgentSideConnection } from '@agentclientprotocol/sdk';
@@ -60,7 +60,7 @@ async function acpMain(options) {
60
60
  await Promise.allSettled([
61
61
  mcpManager?.disconnect(),
62
62
  controller?.getMastra()?.stopWorkers(),
63
- controller?.stopHeartbeats(),
63
+ controller?.stopIntervals(),
64
64
  closeSignalsPubSub?.()
65
65
  ]);
66
66
  console.log = originalConsoleLog;
@@ -81,5 +81,5 @@ async function acpMain(options) {
81
81
  }
82
82
 
83
83
  export { acpMain };
84
- //# sourceMappingURL=acp-LENNVD37.js.map
85
- //# sourceMappingURL=acp-LENNVD37.js.map
84
+ //# sourceMappingURL=acp-AFC64ZEZ.js.map
85
+ //# sourceMappingURL=acp-AFC64ZEZ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/acp/server.ts","../src/acp/index.ts"],"names":[],"mappings":";;;;;;;AAUA,eAAsB,YAAA,CACpB,UAAA,EACA,KAAA,EACA,OAAA,EACe;AAEf,EAAA,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CAAA;AAElC,IAAA,MAAM,YAAA,CAAa,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AAAA,EAC/C,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,mBAAA,EAAsB,KAAK;AAAA,CAAI,CAAA;AAEpD,IAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AACd,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF","file":"acp-LENNVD37.js","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { Readable, Writable } from 'node:stream';\nimport { AgentSideConnection, ndJsonStream } from '@agentclientprotocol/sdk';\nimport type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';\nimport { MastraCodeAcpAgent } from './agent.js';\n\n/**\n * Run the ACP server over stdio.\n * This sets up the JSON-RPC stream and keeps the process alive until the client disconnects.\n */\nexport async function runAcpServer(\n controller: AgentController,\n modes: AgentControllerMode[],\n cleanup?: () => Promise<void>,\n): Promise<void> {\n // Create the ndJSON stream from stdin/stdout\n const input = Readable.toWeb(process.stdin) as ReadableStream<Uint8Array>;\n const output = Writable.toWeb(process.stdout) as WritableStream<Uint8Array>;\n const stream = ndJsonStream(output, input);\n let session: Session | undefined;\n let agent: MastraCodeAcpAgent | undefined;\n\n // Handle cleanup on disconnect (success or error)\n try {\n session = await controller.createSession({\n id: `acp-${randomUUID()}`,\n ownerId: `acp-owner-${randomUUID()}`,\n });\n const activeSession = session;\n\n // Create the agent-side connection\n const connection = new AgentSideConnection(conn => {\n agent = new MastraCodeAcpAgent(conn, controller, activeSession, modes);\n return agent;\n }, stream);\n\n await connection.closed;\n } finally {\n agent?.dispose();\n session?.thread.detachFromCurrent();\n await session?.thread.clearAndReleaseLock();\n if (cleanup) {\n await cleanup();\n }\n }\n}\n","import type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nimport { createMastraCode } from '../index.js';\nimport { releaseAllThreadLocks } from '../utils/thread-lock.js';\nimport { setAutoApprove } from './event-mapper.js';\nimport { runAcpServer } from './server.js';\n\n/**\n * Entry point for ACP server mode.\n * Initializes mastracode and runs the ACP protocol over stdio.\n */\nexport async function acpMain(options?: { dangerousAutoApprove?: boolean }): Promise<void> {\n if (options?.dangerousAutoApprove) {\n setAutoApprove(true);\n }\n // Redirect console.log to stderr to avoid polluting the JSON-RPC stream on stdout.\n // eslint-disable-next-line no-console\n const originalConsoleLog = console.log;\n // eslint-disable-next-line no-console\n console.log = (...args: unknown[]) => {\n process.stderr.write(args.map(String).join(' ') + '\\n');\n };\n\n let result: Awaited<ReturnType<typeof createMastraCode>> | undefined;\n\n try {\n result = await createMastraCode({\n unixSocketPubSub: false,\n disableMcp: false,\n disableHooks: false,\n });\n\n const { controller, mcpManager, signalsPubSub } = result;\n\n // Default modes (same as createMastraCode defaults)\n const modes: AgentControllerMode[] = [\n { id: 'build', name: 'Build' },\n { id: 'plan', name: 'Plan' },\n { id: 'fast', name: 'Fast' },\n ];\n\n // Cleanup function (mirrors main.ts asyncCleanup)\n const cleanup = async () => {\n releaseAllThreadLocks();\n const closeSignalsPubSub = (signalsPubSub as { close?: () => Promise<void> | void } | undefined)?.close;\n await Promise.allSettled([\n mcpManager?.disconnect(),\n controller?.getMastra()?.stopWorkers(),\n controller?.stopHeartbeats(),\n closeSignalsPubSub?.(),\n ]);\n\n // Restore console.log\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n };\n\n // Handle signals\n const handleSignal = async () => {\n await cleanup();\n process.exit(0);\n };\n\n process.on('SIGINT', handleSignal);\n process.on('SIGTERM', handleSignal);\n\n await runAcpServer(controller, modes, cleanup);\n } catch (error) {\n process.stderr.write(`[acp] Fatal error: ${error}\\n`);\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n process.exit(1);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/acp/server.ts","../src/acp/index.ts"],"names":[],"mappings":";;;;;;;AAUA,eAAsB,YAAA,CACpB,UAAA,EACA,K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,CAAQ,EAAA,CAAG,WAAW,YAAY,CAAA;AAElC,IAAA,MAAM,YAAA,CAAa,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AAAA,EAC/C,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,mBAAA,EAAsB,KAAK;AAAA,CAAI,CAAA;AAEpD,IAAA,OAAA,CAAQ,GAAA,GAAM,kBAAA;AACd,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF","file":"acp-AFC64ZEZ.js","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { Readable, Writable } from 'node:stream';\nimport { AgentSideConnection, ndJsonStream } from '@agentclientprotocol/sdk';\nimport type { AgentController, AgentControllerMode, Session } from '@mastra/core/agent-controller';\nimport { MastraCodeAcpAgent } from './agent.js';\n\n/**\n * Run the ACP server over stdio.\n * This sets up the JSON-RPC stream and keeps the process alive until the client disconnects.\n */\nexport async function runAcpServer(\n controller: AgentController,\n modes: AgentControllerMode[],\n cleanup?: () => Promise<void>,\n): Promise<void> {\n // Create the ndJSON stream from stdin/stdout\n const input = Readable.toWeb(process.stdin) as ReadableStream<Uint8Array>;\n const output = Writable.toWeb(process.stdout) as WritableStream<Uint8Array>;\n const stream = ndJsonStream(output, input);\n let session: Session | undefined;\n let agent: MastraCodeAcpAgent | undefined;\n\n // Handle cleanup on disconnect (success or error)\n try {\n session = await controller.createSession({\n id: `acp-${randomUUID()}`,\n ownerId: `acp-owner-${randomUUID()}`,\n });\n const activeSession = session;\n\n // Create the agent-side connection\n const connection = new AgentSideConnection(conn => {\n agent = new MastraCodeAcpAgent(conn, controller, activeSession, modes);\n return agent;\n }, stream);\n\n await connection.closed;\n } finally {\n agent?.dispose();\n session?.thread.detachFromCurrent();\n await session?.thread.clearAndReleaseLock();\n if (cleanup) {\n await cleanup();\n }\n }\n}\n","import type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nimport { createMastraCode } from '../index.js';\nimport { releaseAllThreadLocks } from '../utils/thread-lock.js';\nimport { setAutoApprove } from './event-mapper.js';\nimport { runAcpServer } from './server.js';\n\n/**\n * Entry point for ACP server mode.\n * Initializes mastracode and runs the ACP protocol over stdio.\n */\nexport async function acpMain(options?: { dangerousAutoApprove?: boolean }): Promise<void> {\n if (options?.dangerousAutoApprove) {\n setAutoApprove(true);\n }\n // Redirect console.log to stderr to avoid polluting the JSON-RPC stream on stdout.\n // eslint-disable-next-line no-console\n const originalConsoleLog = console.log;\n // eslint-disable-next-line no-console\n console.log = (...args: unknown[]) => {\n process.stderr.write(args.map(String).join(' ') + '\\n');\n };\n\n let result: Awaited<ReturnType<typeof createMastraCode>> | undefined;\n\n try {\n result = await createMastraCode({\n unixSocketPubSub: false,\n disableMcp: false,\n disableHooks: false,\n });\n\n const { controller, mcpManager, signalsPubSub } = result;\n\n // Default modes (same as createMastraCode defaults)\n const modes: AgentControllerMode[] = [\n { id: 'build', name: 'Build' },\n { id: 'plan', name: 'Plan' },\n { id: 'fast', name: 'Fast' },\n ];\n\n // Cleanup function (mirrors main.ts asyncCleanup)\n const cleanup = async () => {\n releaseAllThreadLocks();\n const closeSignalsPubSub = (signalsPubSub as { close?: () => Promise<void> | void } | undefined)?.close;\n await Promise.allSettled([\n mcpManager?.disconnect(),\n controller?.getMastra()?.stopWorkers(),\n controller?.stopIntervals(),\n closeSignalsPubSub?.(),\n ]);\n\n // Restore console.log\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n };\n\n // Handle signals\n const handleSignal = async () => {\n await cleanup();\n process.exit(0);\n };\n\n process.on('SIGINT', handleSignal);\n process.on('SIGTERM', handleSignal);\n\n await runAcpServer(controller, modes, cleanup);\n } catch (error) {\n process.stderr.write(`[acp] Fatal error: ${error}\\n`);\n // eslint-disable-next-line no-console\n console.log = originalConsoleLog;\n process.exit(1);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/agents/instructions.ts"],"names":[],"mappings":"AAOA,wBAAsB,sBAAsB,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE;QAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CAAE,mBAyBjH"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/agents/instructions.ts"],"names":[],"mappings":"AAOA,wBAAsB,sBAAsB,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE;QAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CAAE,mBAiCjH"}
@@ -8,6 +8,12 @@ export type { MastraCodeCustomProvider, MastraCodeGatewayOptions } from './mastr
8
8
  type ResolvedModel = GatewayLanguageModel;
9
9
  export declare function createMastraCodeGateway(options: MastraCodeGatewayOptions): MastraCodeGateway;
10
10
  export declare function createMastraCodeModelCatalogProvider(gateway: MastraModelGatewayInterface): import("@mastra/core/harness").CustomModelCatalogProvider;
11
+ /**
12
+ * Placeholder for future model ID normalization.
13
+ * Currently returns the input unchanged, but exists as a seam
14
+ * for aliasing, casing fixes, or validation in the future.
15
+ */
16
+ export declare function resolveModelId(modelId: string): string;
11
17
  /**
12
18
  * Resolve a model ID to the correct provider instance.
13
19
  * Shared by the main agent, observer, and reflector.
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/agents/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAGL,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACL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AExE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAElG,KAAK,aAAa,GAAG,oBAAoB,CAAC;AAa1C,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAE5F;AAED,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,2BAA2B,6DAIxF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,aAAa,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CAAE,GACzG,oBAAoB,CA+DtB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,GAAG,aAAa,CAWrG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,EACtD,YAAY,CAAC,EAAE,MAAM,GACpB,aAAa,GAAG,SAAS,CAI3B"}
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Prompt system — exports the prompt builder and mode-specific prompts.
3
3
  */
4
- export { buildBasePrompt } from './base.js';
5
4
  export { buildModePrompt, buildModePromptFn } from './build.js';
6
5
  export { planModePrompt } from './plan.js';
7
6
  export { fastModePrompt } from './fast.js';
8
- import type { PromptContext as BasePromptContext } from './base.js';
7
+ import type { PromptContext as BasePromptContext } from '@mastra/core/coding-agent';
9
8
  export interface PromptContext extends Omit<BasePromptContext, 'toolGuidance'> {
10
9
  modeId: string;
11
10
  state?: any;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAK3C,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAQpE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAQD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAmD1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAUpF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAQD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAmD1D"}