@mastra/code-sdk 0.0.0-agent-tags-alpha-20261125185303

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 (407) hide show
  1. package/LICENSE.md +32 -0
  2. package/README.md +284 -0
  3. package/dist/acp/agent.d.ts +48 -0
  4. package/dist/acp/agent.js +414 -0
  5. package/dist/acp/errors.d.ts +3 -0
  6. package/dist/acp/errors.js +11 -0
  7. package/dist/acp/event-mapper.d.ts +28 -0
  8. package/dist/acp/event-mapper.js +274 -0
  9. package/dist/acp/index.d.ts +9 -0
  10. package/dist/acp/index.js +21 -0
  11. package/dist/acp/runtime.d.ts +5 -0
  12. package/dist/acp/runtime.js +91 -0
  13. package/dist/acp/server.d.ts +4 -0
  14. package/dist/acp/server.js +35 -0
  15. package/dist/acp/skills.d.ts +6 -0
  16. package/dist/acp/skills.js +30 -0
  17. package/dist/acp.d.ts +2 -0
  18. package/dist/acp.js +1 -0
  19. package/dist/agent-connections/messaging-processor.d.ts +17 -0
  20. package/dist/agent-connections/messaging-processor.js +131 -0
  21. package/dist/agent-connections/ownership.d.ts +24 -0
  22. package/dist/agent-connections/ownership.js +96 -0
  23. package/dist/agent-connections/registry.d.ts +20 -0
  24. package/dist/agent-connections/registry.js +167 -0
  25. package/dist/agent-connections/session-advertisement.d.ts +27 -0
  26. package/dist/agent-connections/session-advertisement.js +86 -0
  27. package/dist/agent-connections/signal-provider.d.ts +141 -0
  28. package/dist/agent-connections/signal-provider.js +35 -0
  29. package/dist/agent-connections/state-processor.d.ts +23 -0
  30. package/dist/agent-connections/state-processor.js +270 -0
  31. package/dist/agent-connections/thread-state.d.ts +41 -0
  32. package/dist/agent-connections/thread-state.js +157 -0
  33. package/dist/agent-connections/tools.d.ts +133 -0
  34. package/dist/agent-connections/tools.js +616 -0
  35. package/dist/agent-connections/types.d.ts +99 -0
  36. package/dist/agent-connections/types.js +4 -0
  37. package/dist/agent-connections/untrusted-text.d.ts +5 -0
  38. package/dist/agent-connections/untrusted-text.js +19 -0
  39. package/dist/agents/background-completion-events.d.ts +16 -0
  40. package/dist/agents/background-completion-events.js +16 -0
  41. package/dist/agents/background-completion.d.ts +22 -0
  42. package/dist/agents/background-completion.js +73 -0
  43. package/dist/agents/context-audit.d.ts +84 -0
  44. package/dist/agents/context-audit.js +115 -0
  45. package/dist/agents/credential-resolver.d.ts +74 -0
  46. package/dist/agents/credential-resolver.js +142 -0
  47. package/dist/agents/custom-provider-source.d.ts +35 -0
  48. package/dist/agents/custom-provider-source.js +22 -0
  49. package/dist/agents/fastembed-subprocess.d.ts +52 -0
  50. package/dist/agents/fastembed-subprocess.js +282 -0
  51. package/dist/agents/instructions.d.ts +42 -0
  52. package/dist/agents/instructions.js +69 -0
  53. package/dist/agents/mastracode-gateway.d.ts +85 -0
  54. package/dist/agents/mastracode-gateway.js +500 -0
  55. package/dist/agents/memory.d.ts +36 -0
  56. package/dist/agents/memory.js +248 -0
  57. package/dist/agents/model.d.ts +158 -0
  58. package/dist/agents/model.js +382 -0
  59. package/dist/agents/modes/build.d.ts +12 -0
  60. package/dist/agents/modes/build.js +33 -0
  61. package/dist/agents/modes/explore.d.ts +10 -0
  62. package/dist/agents/modes/explore.js +25 -0
  63. package/dist/agents/modes/plan.d.ts +8 -0
  64. package/dist/agents/modes/plan.js +43 -0
  65. package/dist/agents/prompts/agent-instructions.d.ts +122 -0
  66. package/dist/agents/prompts/agent-instructions.js +617 -0
  67. package/dist/agents/prompts/build.d.ts +12 -0
  68. package/dist/agents/prompts/build.js +73 -0
  69. package/dist/agents/prompts/fast.d.ts +5 -0
  70. package/dist/agents/prompts/fast.js +23 -0
  71. package/dist/agents/prompts/index.d.ts +61 -0
  72. package/dist/agents/prompts/index.js +141 -0
  73. package/dist/agents/prompts/model.d.ts +5 -0
  74. package/dist/agents/prompts/model.js +20 -0
  75. package/dist/agents/prompts/plan.d.ts +11 -0
  76. package/dist/agents/prompts/plan.js +132 -0
  77. package/dist/agents/prompts/tool-guidance.d.ts +18 -0
  78. package/dist/agents/prompts/tool-guidance.js +158 -0
  79. package/dist/agents/sandbox-filesystem.d.ts +232 -0
  80. package/dist/agents/sandbox-filesystem.js +851 -0
  81. package/dist/agents/subagents/execute.d.ts +3 -0
  82. package/dist/agents/subagents/execute.js +24 -0
  83. package/dist/agents/subagents/explore.d.ts +3 -0
  84. package/dist/agents/subagents/explore.js +15 -0
  85. package/dist/agents/subagents/index.d.ts +6 -0
  86. package/dist/agents/subagents/index.js +15 -0
  87. package/dist/agents/subagents/plan.d.ts +3 -0
  88. package/dist/agents/subagents/plan.js +15 -0
  89. package/dist/agents/thread-caveman-state.d.ts +17 -0
  90. package/dist/agents/thread-caveman-state.js +104 -0
  91. package/dist/agents/tool-availability.d.ts +17 -0
  92. package/dist/agents/tool-availability.js +134 -0
  93. package/dist/agents/tools.d.ts +37 -0
  94. package/dist/agents/tools.js +154 -0
  95. package/dist/agents/workflow-builder-agent.d.ts +2 -0
  96. package/dist/agents/workflow-builder-agent.js +79 -0
  97. package/dist/agents/workspace.d.ts +35 -0
  98. package/dist/agents/workspace.js +207 -0
  99. package/dist/analytics.d.ts +18 -0
  100. package/dist/analytics.js +159 -0
  101. package/dist/auth/account-rotation-processor.d.ts +210 -0
  102. package/dist/auth/account-rotation-processor.js +662 -0
  103. package/dist/auth/account-routing-context.d.ts +17 -0
  104. package/dist/auth/account-routing-context.js +38 -0
  105. package/dist/auth/authorization-input.d.ts +16 -0
  106. package/dist/auth/authorization-input.js +39 -0
  107. package/dist/auth/device-code.d.ts +93 -0
  108. package/dist/auth/device-code.js +126 -0
  109. package/dist/auth/index.d.ts +13 -0
  110. package/dist/auth/index.js +9 -0
  111. package/dist/auth/pkce.d.ts +13 -0
  112. package/dist/auth/pkce.js +29 -0
  113. package/dist/auth/provider-auth-error.d.ts +24 -0
  114. package/dist/auth/provider-auth-error.js +44 -0
  115. package/dist/auth/providers/anthropic.d.ts +40 -0
  116. package/dist/auth/providers/anthropic.js +117 -0
  117. package/dist/auth/providers/github-copilot.d.ts +154 -0
  118. package/dist/auth/providers/github-copilot.js +359 -0
  119. package/dist/auth/providers/kimi-coding.d.ts +38 -0
  120. package/dist/auth/providers/kimi-coding.js +225 -0
  121. package/dist/auth/providers/openai-codex.d.ts +141 -0
  122. package/dist/auth/providers/openai-codex.js +531 -0
  123. package/dist/auth/providers/xai.d.ts +64 -0
  124. package/dist/auth/providers/xai.js +223 -0
  125. package/dist/auth/storage.d.ts +222 -0
  126. package/dist/auth/storage.js +805 -0
  127. package/dist/auth/types.d.ts +164 -0
  128. package/dist/auth/types.js +1 -0
  129. package/dist/clipboard/index.d.ts +26 -0
  130. package/dist/clipboard/index.js +224 -0
  131. package/dist/constants.d.ts +29 -0
  132. package/dist/constants.js +34 -0
  133. package/dist/error-classification.d.ts +10 -0
  134. package/dist/error-classification.js +19 -0
  135. package/dist/evals/context-builder.d.ts +41 -0
  136. package/dist/evals/context-builder.js +156 -0
  137. package/dist/evals/index.d.ts +4 -0
  138. package/dist/evals/index.js +5 -0
  139. package/dist/evals/scorers/classify-command.d.ts +30 -0
  140. package/dist/evals/scorers/classify-command.js +61 -0
  141. package/dist/evals/scorers/efficiency.d.ts +44 -0
  142. package/dist/evals/scorers/efficiency.js +256 -0
  143. package/dist/evals/scorers/extract-tools.d.ts +25 -0
  144. package/dist/evals/scorers/extract-tools.js +57 -0
  145. package/dist/evals/scorers/index.d.ts +3 -0
  146. package/dist/evals/scorers/index.js +3 -0
  147. package/dist/evals/scorers/outcome.d.ts +49 -0
  148. package/dist/evals/scorers/outcome.js +360 -0
  149. package/dist/experimental-agent.d.ts +19 -0
  150. package/dist/experimental-agent.js +45 -0
  151. package/dist/factory/client.d.ts +44 -0
  152. package/dist/factory/client.js +110 -0
  153. package/dist/factory/remote-controller.d.ts +34 -0
  154. package/dist/factory/remote-controller.js +40 -0
  155. package/dist/factory/remote-session.d.ts +210 -0
  156. package/dist/factory/remote-session.js +415 -0
  157. package/dist/goal-manager.d.ts +114 -0
  158. package/dist/goal-manager.js +351 -0
  159. package/dist/goal-signal.d.ts +14 -0
  160. package/dist/goal-signal.js +14 -0
  161. package/dist/headless/cli.d.ts +55 -0
  162. package/dist/headless/cli.js +261 -0
  163. package/dist/headless/flags.d.ts +33 -0
  164. package/dist/headless/flags.js +207 -0
  165. package/dist/headless/format.d.ts +41 -0
  166. package/dist/headless/format.js +94 -0
  167. package/dist/headless/index.d.ts +25 -0
  168. package/dist/headless/index.js +6 -0
  169. package/dist/headless/policy.d.ts +17 -0
  170. package/dist/headless/policy.js +39 -0
  171. package/dist/headless/run-mc.d.ts +7 -0
  172. package/dist/headless/run-mc.js +438 -0
  173. package/dist/headless/types.d.ts +175 -0
  174. package/dist/headless/types.js +16 -0
  175. package/dist/hooks/config.d.ts +11 -0
  176. package/dist/hooks/config.js +77 -0
  177. package/dist/hooks/executor.d.ts +13 -0
  178. package/dist/hooks/executor.js +128 -0
  179. package/dist/hooks/index.d.ts +6 -0
  180. package/dist/hooks/index.js +5 -0
  181. package/dist/hooks/manager.d.ts +75 -0
  182. package/dist/hooks/manager.js +289 -0
  183. package/dist/hooks/types.d.ts +180 -0
  184. package/dist/hooks/types.js +5 -0
  185. package/dist/index.d.ts +537 -0
  186. package/dist/index.js +1399 -0
  187. package/dist/ipc/ipc-reporter.d.ts +14 -0
  188. package/dist/ipc/ipc-reporter.js +18 -0
  189. package/dist/knowledge-inspector.d.ts +139 -0
  190. package/dist/knowledge-inspector.js +533 -0
  191. package/dist/knowledge-scope-id.d.ts +7 -0
  192. package/dist/knowledge-scope-id.js +10 -0
  193. package/dist/knowledge-scope.d.ts +41 -0
  194. package/dist/knowledge-scope.js +85 -0
  195. package/dist/lsp/client.d.ts +56 -0
  196. package/dist/lsp/client.js +248 -0
  197. package/dist/lsp/index.d.ts +4 -0
  198. package/dist/lsp/index.js +4 -0
  199. package/dist/lsp/language.d.ts +9 -0
  200. package/dist/lsp/language.js +41 -0
  201. package/dist/lsp/manager.d.ts +34 -0
  202. package/dist/lsp/manager.js +79 -0
  203. package/dist/lsp/server.d.ts +27 -0
  204. package/dist/lsp/server.js +158 -0
  205. package/dist/lsp/workspace.d.ts +9 -0
  206. package/dist/lsp/workspace.js +52 -0
  207. package/dist/mcp/config.d.ts +77 -0
  208. package/dist/mcp/config.js +313 -0
  209. package/dist/mcp/index.d.ts +6 -0
  210. package/dist/mcp/index.js +3 -0
  211. package/dist/mcp/manager.d.ts +104 -0
  212. package/dist/mcp/manager.js +693 -0
  213. package/dist/mcp/state.d.ts +35 -0
  214. package/dist/mcp/state.js +94 -0
  215. package/dist/mcp/types.d.ts +139 -0
  216. package/dist/mcp/types.js +1 -0
  217. package/dist/onboarding/custom-packs.d.ts +7 -0
  218. package/dist/onboarding/custom-packs.js +17 -0
  219. package/dist/onboarding/custom-providers.d.ts +4 -0
  220. package/dist/onboarding/custom-providers.js +27 -0
  221. package/dist/onboarding/index.d.ts +5 -0
  222. package/dist/onboarding/index.js +3 -0
  223. package/dist/onboarding/om-settings.d.ts +47 -0
  224. package/dist/onboarding/om-settings.js +80 -0
  225. package/dist/onboarding/pack-activation.d.ts +43 -0
  226. package/dist/onboarding/pack-activation.js +105 -0
  227. package/dist/onboarding/packs.d.ts +106 -0
  228. package/dist/onboarding/packs.js +283 -0
  229. package/dist/onboarding/settings.d.ts +563 -0
  230. package/dist/onboarding/settings.js +1110 -0
  231. package/dist/permissions.d.ts +55 -0
  232. package/dist/permissions.js +139 -0
  233. package/dist/platform/index.d.ts +74 -0
  234. package/dist/platform/index.js +199 -0
  235. package/dist/plugin.d.ts +156 -0
  236. package/dist/plugin.js +27 -0
  237. package/dist/plugins/dependencies.d.ts +9 -0
  238. package/dist/plugins/dependencies.js +84 -0
  239. package/dist/plugins/install.d.ts +21 -0
  240. package/dist/plugins/install.js +187 -0
  241. package/dist/plugins/loader.d.ts +25 -0
  242. package/dist/plugins/loader.js +264 -0
  243. package/dist/plugins/manager.d.ts +115 -0
  244. package/dist/plugins/manager.js +507 -0
  245. package/dist/plugins/manifest.d.ts +14 -0
  246. package/dist/plugins/manifest.js +47 -0
  247. package/dist/plugins/package-link.d.ts +3 -0
  248. package/dist/plugins/package-link.js +58 -0
  249. package/dist/plugins/paths.d.ts +10 -0
  250. package/dist/plugins/paths.js +22 -0
  251. package/dist/plugins/registry.d.ts +8 -0
  252. package/dist/plugins/registry.js +109 -0
  253. package/dist/plugins/scaffold.d.ts +10 -0
  254. package/dist/plugins/scaffold.js +115 -0
  255. package/dist/plugins/signal-lane.d.ts +59 -0
  256. package/dist/plugins/signal-lane.js +163 -0
  257. package/dist/plugins/types.d.ts +95 -0
  258. package/dist/plugins/types.js +1 -0
  259. package/dist/process-memory-diagnostics.d.ts +136 -0
  260. package/dist/process-memory-diagnostics.js +497 -0
  261. package/dist/processors/plan-rejection-abort.d.ts +16 -0
  262. package/dist/processors/plan-rejection-abort.js +62 -0
  263. package/dist/providers/amazon-bedrock-gateway.d.ts +47 -0
  264. package/dist/providers/amazon-bedrock-gateway.js +142 -0
  265. package/dist/providers/amazon-bedrock.d.ts +28 -0
  266. package/dist/providers/amazon-bedrock.js +99 -0
  267. package/dist/providers/anthropic-prompt-cache.d.ts +19 -0
  268. package/dist/providers/anthropic-prompt-cache.js +8 -0
  269. package/dist/providers/anthropic-thinking.d.ts +5 -0
  270. package/dist/providers/anthropic-thinking.js +22 -0
  271. package/dist/providers/claude-max.d.ts +67 -0
  272. package/dist/providers/claude-max.js +232 -0
  273. package/dist/providers/github-copilot-gateway.d.ts +35 -0
  274. package/dist/providers/github-copilot-gateway.js +58 -0
  275. package/dist/providers/github-copilot.d.ts +60 -0
  276. package/dist/providers/github-copilot.js +320 -0
  277. package/dist/providers/google-thinking.d.ts +31 -0
  278. package/dist/providers/google-thinking.js +64 -0
  279. package/dist/providers/google-vertex-gateway.d.ts +23 -0
  280. package/dist/providers/google-vertex-gateway.js +49 -0
  281. package/dist/providers/google-vertex.d.ts +6 -0
  282. package/dist/providers/google-vertex.js +51 -0
  283. package/dist/providers/kimi-coding.d.ts +14 -0
  284. package/dist/providers/kimi-coding.js +80 -0
  285. package/dist/providers/model-ids.d.ts +53 -0
  286. package/dist/providers/model-ids.js +132 -0
  287. package/dist/providers/openai-codex.d.ts +114 -0
  288. package/dist/providers/openai-codex.js +427 -0
  289. package/dist/providers/provider-thinking.d.ts +23 -0
  290. package/dist/providers/provider-thinking.js +61 -0
  291. package/dist/providers/thinking-request.d.ts +14 -0
  292. package/dist/providers/thinking-request.js +87 -0
  293. package/dist/providers/xai.d.ts +33 -0
  294. package/dist/providers/xai.js +72 -0
  295. package/dist/schedules/index.d.ts +10 -0
  296. package/dist/schedules/index.js +6 -0
  297. package/dist/schedules/interval.d.ts +49 -0
  298. package/dist/schedules/interval.js +212 -0
  299. package/dist/schedules/prompt.d.ts +36 -0
  300. package/dist/schedules/prompt.js +36 -0
  301. package/dist/schedules/run-script.d.ts +8 -0
  302. package/dist/schedules/run-script.js +80 -0
  303. package/dist/schedules/scheduler.d.ts +101 -0
  304. package/dist/schedules/scheduler.js +167 -0
  305. package/dist/schedules/tools.d.ts +57 -0
  306. package/dist/schedules/tools.js +217 -0
  307. package/dist/schema.d.ts +499 -0
  308. package/dist/schema.js +131 -0
  309. package/dist/theme-palette.d.ts +17 -0
  310. package/dist/theme-palette.js +18 -0
  311. package/dist/thinking-catalog.d.ts +4 -0
  312. package/dist/thinking-catalog.js +13 -0
  313. package/dist/thinking.d.ts +37 -0
  314. package/dist/thinking.js +134 -0
  315. package/dist/tool-names.d.ts +77 -0
  316. package/dist/tool-names.js +53 -0
  317. package/dist/tools/index.d.ts +6 -0
  318. package/dist/tools/index.js +3 -0
  319. package/dist/tools/request-sandbox-access.d.ts +6 -0
  320. package/dist/tools/request-sandbox-access.js +80 -0
  321. package/dist/tools/utils.d.ts +20 -0
  322. package/dist/tools/utils.js +31 -0
  323. package/dist/tools/web-search.d.ts +116 -0
  324. package/dist/tools/web-search.js +158 -0
  325. package/dist/tools/workflows/create-workflow.d.ts +7 -0
  326. package/dist/tools/workflows/create-workflow.js +82 -0
  327. package/dist/tools/workflows/delete-workflow.d.ts +7 -0
  328. package/dist/tools/workflows/delete-workflow.js +18 -0
  329. package/dist/tools/workflows/ephemeral-memory.d.ts +28 -0
  330. package/dist/tools/workflows/ephemeral-memory.js +41 -0
  331. package/dist/tools/workflows/extract-json-schema.d.ts +12 -0
  332. package/dist/tools/workflows/extract-json-schema.js +19 -0
  333. package/dist/tools/workflows/get-workflow.d.ts +11 -0
  334. package/dist/tools/workflows/get-workflow.js +31 -0
  335. package/dist/tools/workflows/list-available-agents.d.ts +8 -0
  336. package/dist/tools/workflows/list-available-agents.js +29 -0
  337. package/dist/tools/workflows/list-available-classifiers.d.ts +19 -0
  338. package/dist/tools/workflows/list-available-classifiers.js +53 -0
  339. package/dist/tools/workflows/list-available-tools.d.ts +9 -0
  340. package/dist/tools/workflows/list-available-tools.js +37 -0
  341. package/dist/tools/workflows/list-available-workflows.d.ts +9 -0
  342. package/dist/tools/workflows/list-available-workflows.js +29 -0
  343. package/dist/tools/workflows/list-workflows.d.ts +9 -0
  344. package/dist/tools/workflows/list-workflows.js +30 -0
  345. package/dist/tools/workflows/run-workflow.d.ts +9 -0
  346. package/dist/tools/workflows/run-workflow.js +49 -0
  347. package/dist/tools/workflows/save-workflow.d.ts +1125 -0
  348. package/dist/tools/workflows/save-workflow.js +25 -0
  349. package/dist/tools/workflows/tool-ids.d.ts +16 -0
  350. package/dist/tools/workflows/tool-ids.js +17 -0
  351. package/dist/utils/binaries.d.ts +7 -0
  352. package/dist/utils/binaries.js +97 -0
  353. package/dist/utils/debug-log.d.ts +12 -0
  354. package/dist/utils/debug-log.js +56 -0
  355. package/dist/utils/discarding-scores-storage.d.ts +33 -0
  356. package/dist/utils/discarding-scores-storage.js +51 -0
  357. package/dist/utils/errors.d.ts +36 -0
  358. package/dist/utils/errors.js +215 -0
  359. package/dist/utils/gateway-sync.d.ts +26 -0
  360. package/dist/utils/gateway-sync.js +58 -0
  361. package/dist/utils/local-observability.d.ts +19 -0
  362. package/dist/utils/local-observability.js +54 -0
  363. package/dist/utils/maintenance-lock.d.ts +42 -0
  364. package/dist/utils/maintenance-lock.js +196 -0
  365. package/dist/utils/notification-dispatch.d.ts +74 -0
  366. package/dist/utils/notification-dispatch.js +128 -0
  367. package/dist/utils/open-url.d.ts +10 -0
  368. package/dist/utils/open-url.js +27 -0
  369. package/dist/utils/path-security.d.ts +2 -0
  370. package/dist/utils/path-security.js +7 -0
  371. package/dist/utils/plan-diff.d.ts +25 -0
  372. package/dist/utils/plan-diff.js +59 -0
  373. package/dist/utils/plans.d.ts +61 -0
  374. package/dist/utils/plans.js +120 -0
  375. package/dist/utils/project.d.ts +160 -0
  376. package/dist/utils/project.js +361 -0
  377. package/dist/utils/prune-cli.d.ts +24 -0
  378. package/dist/utils/prune-cli.js +124 -0
  379. package/dist/utils/signals-pubsub.d.ts +103 -0
  380. package/dist/utils/signals-pubsub.js +409 -0
  381. package/dist/utils/slash-command-loader.d.ts +52 -0
  382. package/dist/utils/slash-command-loader.js +139 -0
  383. package/dist/utils/slash-command-processor.d.ts +14 -0
  384. package/dist/utils/slash-command-processor.js +106 -0
  385. package/dist/utils/stdin-pipe.d.ts +33 -0
  386. package/dist/utils/stdin-pipe.js +93 -0
  387. package/dist/utils/storage-factory.d.ts +50 -0
  388. package/dist/utils/storage-factory.js +118 -0
  389. package/dist/utils/storage-maintenance.d.ts +121 -0
  390. package/dist/utils/storage-maintenance.js +352 -0
  391. package/dist/utils/thread-lock.d.ts +26 -0
  392. package/dist/utils/thread-lock.js +109 -0
  393. package/dist/utils/token-estimator.d.ts +3 -0
  394. package/dist/utils/token-estimator.js +19 -0
  395. package/dist/utils/update-check.d.ts +151 -0
  396. package/dist/utils/update-check.js +430 -0
  397. package/dist/utils/wake-session.d.ts +44 -0
  398. package/dist/utils/wake-session.js +83 -0
  399. package/dist/voice/stt-registry.d.ts +67 -0
  400. package/dist/voice/stt-registry.js +144 -0
  401. package/dist/voice/transcribe.d.ts +10 -0
  402. package/dist/voice/transcribe.js +75 -0
  403. package/dist/workflows/register-primitives.d.ts +52 -0
  404. package/dist/workflows/register-primitives.js +40 -0
  405. package/dist/workflows/service.d.ts +64 -0
  406. package/dist/workflows/service.js +50 -0
  407. package/package.json +117 -0
@@ -0,0 +1,499 @@
1
+ import type { OMModel } from '@mastra/core/agent-controller';
2
+ import { z } from 'zod';
3
+ import type { ThinkingLevelSetting } from './thinking.js';
4
+ export type PermissionPolicy = 'allow' | 'ask' | 'deny';
5
+ export type MastraCodeSessionState = {
6
+ currentModelId: string;
7
+ modeId: string;
8
+ };
9
+ export type MastraCodeComposedState = MastraCodeState & MastraCodeSessionState;
10
+ export interface ModelRouteEntry {
11
+ id: string;
12
+ label: string;
13
+ modelId: string;
14
+ accountId?: string;
15
+ memoryModelId?: string;
16
+ }
17
+ export interface ModelRoute {
18
+ entries: ModelRouteEntry[];
19
+ }
20
+ export interface PendingModelFallback {
21
+ fromEntryId: string;
22
+ toEntryId: string;
23
+ toModelId: string;
24
+ threadId?: string;
25
+ reason: 'pool-exhausted' | 'persistent-outage';
26
+ at: string;
27
+ }
28
+ export interface MastraCodeState {
29
+ [key: string]: unknown;
30
+ [key: `subagentModelId_${string}`]: string | undefined;
31
+ subagentModelId?: string;
32
+ projectPath?: string;
33
+ projectName?: string;
34
+ /** Factory project that owns this session. */
35
+ factoryProjectId?: string;
36
+ /** Whether this session uses organization or owner-scoped models and credentials. */
37
+ factoryModelScope?: 'factory' | 'user';
38
+ /** Stable user id of the Factory session owner. */
39
+ factoryOwnerUserId?: string;
40
+ /** Authoritative organization id seeded by factory at session construction. */
41
+ factoryOrgId?: string;
42
+ /**
43
+ * Factory owns this session but could not resolve its organization. Knowledge
44
+ * capture refuses rather than filing under a substituted identity; without the
45
+ * marker a projectless factory session is indistinguishable from a local one.
46
+ */
47
+ factoryOrgUnresolved?: boolean;
48
+ /** Linked repository used by this session when source-control execution is required. */
49
+ projectRepositoryId?: string;
50
+ /** Active feature branch checked out in the session workdir. */
51
+ branch?: string;
52
+ /**
53
+ * The session's checkout contains third-party content (e.g. a PR branch
54
+ * under review). Project-level instruction files (AGENTS.md, CLAUDE.md)
55
+ * are attacker-writable there and must not be ingested into the system
56
+ * prompt or injected as reminders.
57
+ */
58
+ untrustedCheckout?: boolean;
59
+ /**
60
+ * Trusted git ref (typically the PR's base branch) to serve project
61
+ * instruction files from when the checkout is untrusted. Without it,
62
+ * project-scope instruction files are skipped entirely.
63
+ */
64
+ baseRef?: string;
65
+ /**
66
+ * Skip the home-directory instruction files (~/.claude/AGENTS.md and
67
+ * friends). Hosts running sessions for someone else set this so a run never
68
+ * inherits the machine owner's personal configuration.
69
+ */
70
+ skipGlobalInstructions?: boolean;
71
+ /**
72
+ * Directories under the working directory whose project instruction files
73
+ * (AGENTS.md, CLAUDE.md) load, the session's own checkout first. Hosts that
74
+ * boot several checkouts under one working directory set it; unset, the
75
+ * working directory itself is the only root.
76
+ */
77
+ instructionRoots?: string[];
78
+ configDir: string;
79
+ homeDir?: string;
80
+ gitBranch?: string;
81
+ lastCommand?: string;
82
+ observerModelId?: string;
83
+ reflectorModelId?: string;
84
+ observerModelSelection: OMModel;
85
+ reflectorModelSelection: OMModel;
86
+ observationThreshold: number;
87
+ reflectionThreshold: number;
88
+ cavemanObservations: boolean;
89
+ observeAttachments: 'auto' | boolean;
90
+ omScope?: 'thread' | 'resource';
91
+ /** Ordered host-supplied model and account fallback route for this thread. */
92
+ modelRoute?: ModelRoute;
93
+ /** One-hop fallback intent written by account rotation and consumed by the host. */
94
+ mastracodePendingModelFallback?: PendingModelFallback | null;
95
+ /**
96
+ * Session-level reasoning-effort override. When unset, the effective level is
97
+ * resolved at request time from settings (`models.modeThinkingDefaults[mode]`
98
+ * falling back to `preferences.thinkingLevel`).
99
+ */
100
+ thinkingLevel?: ThinkingLevelSetting;
101
+ yolo: boolean;
102
+ permissionRules: {
103
+ categories: Record<string, PermissionPolicy>;
104
+ tools: Record<string, PermissionPolicy>;
105
+ };
106
+ smartEditing: boolean;
107
+ notifications: 'bell' | 'system' | 'both' | 'off';
108
+ tasks: Array<{
109
+ id?: string;
110
+ content: string;
111
+ status: 'pending' | 'in_progress' | 'completed';
112
+ activeForm: string;
113
+ }>;
114
+ sandboxAllowedPaths: string[];
115
+ pluginSkillPaths: string[];
116
+ pluginCommandPaths: string[];
117
+ pluginInstructions: string[];
118
+ activePlan: {
119
+ title: string;
120
+ plan: string;
121
+ approvedAt: string;
122
+ } | null;
123
+ activeBrowserSettings?: {
124
+ enabled: boolean;
125
+ provider: 'stagehand' | 'agent-browser';
126
+ headless?: boolean;
127
+ viewport?: {
128
+ width: number;
129
+ height: number;
130
+ } | 'window';
131
+ cdpUrl?: string;
132
+ profile?: string;
133
+ executablePath?: string;
134
+ scope?: 'shared' | 'thread';
135
+ stagehand?: {
136
+ env: 'LOCAL' | 'BROWSERBASE';
137
+ projectId?: string;
138
+ model?: string;
139
+ preserveUserDataDir?: boolean;
140
+ };
141
+ agentBrowser?: {
142
+ storageState?: string;
143
+ };
144
+ };
145
+ activeBrowserModel?: {
146
+ modelName?: string;
147
+ source: 'settings' | 'chat-model' | 'codex-oauth' | 'stagehand-default';
148
+ viaCodexOAuth: boolean;
149
+ };
150
+ }
151
+ export declare const stateSchema: z.ZodPipe<z.ZodObject<{
152
+ currentModelId: z.ZodOptional<z.ZodString>;
153
+ modeId: z.ZodOptional<z.ZodString>;
154
+ modelRoute: z.ZodOptional<z.ZodObject<{
155
+ entries: z.ZodArray<z.ZodObject<{
156
+ id: z.ZodString;
157
+ label: z.ZodString;
158
+ modelId: z.ZodString;
159
+ accountId: z.ZodOptional<z.ZodString>;
160
+ memoryModelId: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>>;
162
+ }, z.core.$strip>>;
163
+ subagentModelId: z.ZodOptional<z.ZodString>;
164
+ subagentModelId_explore: z.ZodOptional<z.ZodString>;
165
+ subagentModelId_plan: z.ZodOptional<z.ZodString>;
166
+ subagentModelId_execute: z.ZodOptional<z.ZodString>;
167
+ projectPath: z.ZodOptional<z.ZodString>;
168
+ projectName: z.ZodOptional<z.ZodString>;
169
+ factoryProjectId: z.ZodOptional<z.ZodString>;
170
+ factoryModelScope: z.ZodOptional<z.ZodEnum<{
171
+ factory: "factory";
172
+ user: "user";
173
+ }>>;
174
+ factoryOwnerUserId: z.ZodOptional<z.ZodString>;
175
+ factoryOrgId: z.ZodOptional<z.ZodString>;
176
+ factoryOrgUnresolved: z.ZodOptional<z.ZodBoolean>;
177
+ projectRepositoryId: z.ZodOptional<z.ZodString>;
178
+ branch: z.ZodOptional<z.ZodString>;
179
+ untrustedCheckout: z.ZodOptional<z.ZodBoolean>;
180
+ baseRef: z.ZodOptional<z.ZodString>;
181
+ skipGlobalInstructions: z.ZodOptional<z.ZodBoolean>;
182
+ instructionRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ configDir: z.ZodDefault<z.ZodString>;
184
+ homeDir: z.ZodOptional<z.ZodString>;
185
+ gitBranch: z.ZodOptional<z.ZodString>;
186
+ lastCommand: z.ZodOptional<z.ZodString>;
187
+ observerModelId: z.ZodOptional<z.ZodString>;
188
+ reflectorModelId: z.ZodOptional<z.ZodString>;
189
+ observerModelSelection: z.ZodOptional<z.ZodString>;
190
+ reflectorModelSelection: z.ZodOptional<z.ZodString>;
191
+ observationThreshold: z.ZodDefault<z.ZodNumber>;
192
+ reflectionThreshold: z.ZodDefault<z.ZodNumber>;
193
+ cavemanObservations: z.ZodDefault<z.ZodBoolean>;
194
+ observeAttachments: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodBoolean]>>;
195
+ omScope: z.ZodOptional<z.ZodEnum<{
196
+ resource: "resource";
197
+ thread: "thread";
198
+ }>>;
199
+ thinkingLevel: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
200
+ high: "high";
201
+ low: "low";
202
+ max: "max";
203
+ medium: "medium";
204
+ off: "off";
205
+ xhigh: "xhigh";
206
+ }>>, unknown>;
207
+ yolo: z.ZodDefault<z.ZodBoolean>;
208
+ permissionRules: z.ZodDefault<z.ZodObject<{
209
+ categories: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
210
+ allow: "allow";
211
+ ask: "ask";
212
+ deny: "deny";
213
+ }>>>;
214
+ tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
215
+ allow: "allow";
216
+ ask: "ask";
217
+ deny: "deny";
218
+ }>>>;
219
+ }, z.core.$strip>>;
220
+ smartEditing: z.ZodDefault<z.ZodBoolean>;
221
+ notifications: z.ZodDefault<z.ZodEnum<{
222
+ bell: "bell";
223
+ both: "both";
224
+ off: "off";
225
+ system: "system";
226
+ }>>;
227
+ tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
228
+ id: z.ZodOptional<z.ZodString>;
229
+ content: z.ZodString;
230
+ status: z.ZodEnum<{
231
+ completed: "completed";
232
+ in_progress: "in_progress";
233
+ pending: "pending";
234
+ }>;
235
+ activeForm: z.ZodString;
236
+ }, z.core.$strip>>>;
237
+ sandboxAllowedPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
238
+ mastracodePendingModelFallback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
239
+ fromEntryId: z.ZodString;
240
+ toEntryId: z.ZodString;
241
+ toModelId: z.ZodString;
242
+ threadId: z.ZodOptional<z.ZodString>;
243
+ reason: z.ZodEnum<{
244
+ "persistent-outage": "persistent-outage";
245
+ "pool-exhausted": "pool-exhausted";
246
+ }>;
247
+ at: z.ZodString;
248
+ }, z.core.$strip>>>;
249
+ pluginSkillPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
250
+ pluginCommandPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
251
+ pluginInstructions: z.ZodDefault<z.ZodArray<z.ZodString>>;
252
+ activePlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
253
+ title: z.ZodString;
254
+ plan: z.ZodString;
255
+ approvedAt: z.ZodString;
256
+ }, z.core.$strip>>>;
257
+ activeBrowserSettings: z.ZodOptional<z.ZodObject<{
258
+ enabled: z.ZodBoolean;
259
+ provider: z.ZodEnum<{
260
+ "agent-browser": "agent-browser";
261
+ stagehand: "stagehand";
262
+ }>;
263
+ headless: z.ZodOptional<z.ZodBoolean>;
264
+ viewport: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
265
+ width: z.ZodNumber;
266
+ height: z.ZodNumber;
267
+ }, z.core.$strip>, z.ZodLiteral<"window">]>>;
268
+ cdpUrl: z.ZodOptional<z.ZodString>;
269
+ profile: z.ZodOptional<z.ZodString>;
270
+ executablePath: z.ZodOptional<z.ZodString>;
271
+ scope: z.ZodOptional<z.ZodEnum<{
272
+ shared: "shared";
273
+ thread: "thread";
274
+ }>>;
275
+ stagehand: z.ZodOptional<z.ZodObject<{
276
+ env: z.ZodEnum<{
277
+ BROWSERBASE: "BROWSERBASE";
278
+ LOCAL: "LOCAL";
279
+ }>;
280
+ projectId: z.ZodOptional<z.ZodString>;
281
+ model: z.ZodOptional<z.ZodString>;
282
+ preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
283
+ }, z.core.$strip>>;
284
+ agentBrowser: z.ZodOptional<z.ZodObject<{
285
+ storageState: z.ZodOptional<z.ZodString>;
286
+ }, z.core.$strip>>;
287
+ }, z.core.$strip>>;
288
+ activeBrowserModel: z.ZodOptional<z.ZodObject<{
289
+ modelName: z.ZodOptional<z.ZodString>;
290
+ source: z.ZodEnum<{
291
+ "chat-model": "chat-model";
292
+ "codex-oauth": "codex-oauth";
293
+ settings: "settings";
294
+ "stagehand-default": "stagehand-default";
295
+ }>;
296
+ viaCodexOAuth: z.ZodBoolean;
297
+ }, z.core.$strip>>;
298
+ }, z.core.$strip>, z.ZodTransform<{
299
+ currentModelId?: string | undefined;
300
+ modeId?: string | undefined;
301
+ modelRoute?: {
302
+ entries: {
303
+ id: string;
304
+ label: string;
305
+ modelId: string;
306
+ accountId?: string | undefined;
307
+ memoryModelId?: string | undefined;
308
+ }[];
309
+ } | undefined;
310
+ subagentModelId?: string | undefined;
311
+ subagentModelId_explore?: string | undefined;
312
+ subagentModelId_plan?: string | undefined;
313
+ subagentModelId_execute?: string | undefined;
314
+ projectPath?: string | undefined;
315
+ projectName?: string | undefined;
316
+ factoryProjectId?: string | undefined;
317
+ factoryModelScope?: "factory" | "user" | undefined;
318
+ factoryOwnerUserId?: string | undefined;
319
+ factoryOrgId?: string | undefined;
320
+ factoryOrgUnresolved?: boolean | undefined;
321
+ projectRepositoryId?: string | undefined;
322
+ branch?: string | undefined;
323
+ untrustedCheckout?: boolean | undefined;
324
+ baseRef?: string | undefined;
325
+ skipGlobalInstructions?: boolean | undefined;
326
+ instructionRoots?: string[] | undefined;
327
+ configDir: string;
328
+ homeDir?: string | undefined;
329
+ gitBranch?: string | undefined;
330
+ lastCommand?: string | undefined;
331
+ observerModelId?: string | undefined;
332
+ reflectorModelId?: string | undefined;
333
+ observationThreshold: number;
334
+ reflectionThreshold: number;
335
+ cavemanObservations: boolean;
336
+ observeAttachments: "auto" | boolean;
337
+ omScope?: "resource" | "thread" | undefined;
338
+ thinkingLevel?: "high" | "low" | "max" | "medium" | "off" | "xhigh" | undefined;
339
+ yolo: boolean;
340
+ permissionRules: {
341
+ categories: Record<string, "allow" | "ask" | "deny">;
342
+ tools: Record<string, "allow" | "ask" | "deny">;
343
+ };
344
+ smartEditing: boolean;
345
+ notifications: "bell" | "both" | "off" | "system";
346
+ tasks: {
347
+ id?: string | undefined;
348
+ content: string;
349
+ status: "completed" | "in_progress" | "pending";
350
+ activeForm: string;
351
+ }[];
352
+ sandboxAllowedPaths: string[];
353
+ mastracodePendingModelFallback?: {
354
+ fromEntryId: string;
355
+ toEntryId: string;
356
+ toModelId: string;
357
+ threadId?: string | undefined;
358
+ reason: "persistent-outage" | "pool-exhausted";
359
+ at: string;
360
+ } | null | undefined;
361
+ pluginSkillPaths: string[];
362
+ pluginCommandPaths: string[];
363
+ pluginInstructions: string[];
364
+ activePlan: {
365
+ title: string;
366
+ plan: string;
367
+ approvedAt: string;
368
+ } | null;
369
+ activeBrowserSettings?: {
370
+ enabled: boolean;
371
+ provider: "agent-browser" | "stagehand";
372
+ headless?: boolean | undefined;
373
+ viewport?: "window" | {
374
+ width: number;
375
+ height: number;
376
+ } | undefined;
377
+ cdpUrl?: string | undefined;
378
+ profile?: string | undefined;
379
+ executablePath?: string | undefined;
380
+ scope?: "shared" | "thread" | undefined;
381
+ stagehand?: {
382
+ env: "BROWSERBASE" | "LOCAL";
383
+ projectId?: string | undefined;
384
+ model?: string | undefined;
385
+ preserveUserDataDir?: boolean | undefined;
386
+ } | undefined;
387
+ agentBrowser?: {
388
+ storageState?: string | undefined;
389
+ } | undefined;
390
+ } | undefined;
391
+ activeBrowserModel?: {
392
+ modelName?: string | undefined;
393
+ source: "chat-model" | "codex-oauth" | "settings" | "stagehand-default";
394
+ viaCodexOAuth: boolean;
395
+ } | undefined;
396
+ observerModelSelection: string;
397
+ reflectorModelSelection: string;
398
+ }, {
399
+ currentModelId?: string | undefined;
400
+ modeId?: string | undefined;
401
+ modelRoute?: {
402
+ entries: {
403
+ id: string;
404
+ label: string;
405
+ modelId: string;
406
+ accountId?: string | undefined;
407
+ memoryModelId?: string | undefined;
408
+ }[];
409
+ } | undefined;
410
+ subagentModelId?: string | undefined;
411
+ subagentModelId_explore?: string | undefined;
412
+ subagentModelId_plan?: string | undefined;
413
+ subagentModelId_execute?: string | undefined;
414
+ projectPath?: string | undefined;
415
+ projectName?: string | undefined;
416
+ factoryProjectId?: string | undefined;
417
+ factoryModelScope?: "factory" | "user" | undefined;
418
+ factoryOwnerUserId?: string | undefined;
419
+ factoryOrgId?: string | undefined;
420
+ factoryOrgUnresolved?: boolean | undefined;
421
+ projectRepositoryId?: string | undefined;
422
+ branch?: string | undefined;
423
+ untrustedCheckout?: boolean | undefined;
424
+ baseRef?: string | undefined;
425
+ skipGlobalInstructions?: boolean | undefined;
426
+ instructionRoots?: string[] | undefined;
427
+ configDir: string;
428
+ homeDir?: string | undefined;
429
+ gitBranch?: string | undefined;
430
+ lastCommand?: string | undefined;
431
+ observerModelId?: string | undefined;
432
+ reflectorModelId?: string | undefined;
433
+ observerModelSelection?: string | undefined;
434
+ reflectorModelSelection?: string | undefined;
435
+ observationThreshold: number;
436
+ reflectionThreshold: number;
437
+ cavemanObservations: boolean;
438
+ observeAttachments: "auto" | boolean;
439
+ omScope?: "resource" | "thread" | undefined;
440
+ thinkingLevel?: "high" | "low" | "max" | "medium" | "off" | "xhigh" | undefined;
441
+ yolo: boolean;
442
+ permissionRules: {
443
+ categories: Record<string, "allow" | "ask" | "deny">;
444
+ tools: Record<string, "allow" | "ask" | "deny">;
445
+ };
446
+ smartEditing: boolean;
447
+ notifications: "bell" | "both" | "off" | "system";
448
+ tasks: {
449
+ id?: string | undefined;
450
+ content: string;
451
+ status: "completed" | "in_progress" | "pending";
452
+ activeForm: string;
453
+ }[];
454
+ sandboxAllowedPaths: string[];
455
+ mastracodePendingModelFallback?: {
456
+ fromEntryId: string;
457
+ toEntryId: string;
458
+ toModelId: string;
459
+ threadId?: string | undefined;
460
+ reason: "persistent-outage" | "pool-exhausted";
461
+ at: string;
462
+ } | null | undefined;
463
+ pluginSkillPaths: string[];
464
+ pluginCommandPaths: string[];
465
+ pluginInstructions: string[];
466
+ activePlan: {
467
+ title: string;
468
+ plan: string;
469
+ approvedAt: string;
470
+ } | null;
471
+ activeBrowserSettings?: {
472
+ enabled: boolean;
473
+ provider: "agent-browser" | "stagehand";
474
+ headless?: boolean | undefined;
475
+ viewport?: "window" | {
476
+ width: number;
477
+ height: number;
478
+ } | undefined;
479
+ cdpUrl?: string | undefined;
480
+ profile?: string | undefined;
481
+ executablePath?: string | undefined;
482
+ scope?: "shared" | "thread" | undefined;
483
+ stagehand?: {
484
+ env: "BROWSERBASE" | "LOCAL";
485
+ projectId?: string | undefined;
486
+ model?: string | undefined;
487
+ preserveUserDataDir?: boolean | undefined;
488
+ } | undefined;
489
+ agentBrowser?: {
490
+ storageState?: string | undefined;
491
+ } | undefined;
492
+ } | undefined;
493
+ activeBrowserModel?: {
494
+ modelName?: string | undefined;
495
+ source: "chat-model" | "codex-oauth" | "settings" | "stagehand-default";
496
+ viaCodexOAuth: boolean;
497
+ } | undefined;
498
+ }>>;
499
+ //# sourceMappingURL=schema.d.ts.map
package/dist/schema.js ADDED
@@ -0,0 +1,131 @@
1
+ import { DEFAULT_CONFIG_DIR } from "./constants.js";
2
+ import { THINKING_LEVEL_VALUES } from "./thinking.js";
3
+ import { z } from "zod";
4
+ // src/schema.ts
5
+ const stateSchema = z.object({
6
+ currentModelId: z.string().optional(),
7
+ modeId: z.string().optional(),
8
+ modelRoute: z.object({ entries: z.array(z.object({
9
+ id: z.string().max(512),
10
+ label: z.string().max(512),
11
+ modelId: z.string().max(512),
12
+ accountId: z.string().max(512).optional(),
13
+ memoryModelId: z.string().max(512).optional()
14
+ })).max(32) }).optional(),
15
+ subagentModelId: z.string().optional(),
16
+ subagentModelId_explore: z.string().optional(),
17
+ subagentModelId_plan: z.string().optional(),
18
+ subagentModelId_execute: z.string().optional(),
19
+ projectPath: z.string().optional(),
20
+ projectName: z.string().optional(),
21
+ factoryProjectId: z.string().optional(),
22
+ factoryModelScope: z.enum(["factory", "user"]).optional(),
23
+ factoryOwnerUserId: z.string().optional(),
24
+ factoryOrgId: z.string().optional(),
25
+ factoryOrgUnresolved: z.boolean().optional(),
26
+ projectRepositoryId: z.string().optional(),
27
+ branch: z.string().optional(),
28
+ untrustedCheckout: z.boolean().optional(),
29
+ baseRef: z.string().optional(),
30
+ skipGlobalInstructions: z.boolean().optional(),
31
+ instructionRoots: z.array(z.string()).optional(),
32
+ configDir: z.string().default(DEFAULT_CONFIG_DIR),
33
+ homeDir: z.string().optional(),
34
+ gitBranch: z.string().optional(),
35
+ lastCommand: z.string().optional(),
36
+ observerModelId: z.string().optional(),
37
+ reflectorModelId: z.string().optional(),
38
+ observerModelSelection: z.string().optional(),
39
+ reflectorModelSelection: z.string().optional(),
40
+ observationThreshold: z.number().default(3e4),
41
+ reflectionThreshold: z.number().default(4e4),
42
+ cavemanObservations: z.boolean().default(false),
43
+ observeAttachments: z.union([z.literal("auto"), z.boolean()]).default("auto"),
44
+ omScope: z.enum(["thread", "resource"]).optional(),
45
+ thinkingLevel: z.preprocess((value) => value === null ? void 0 : value, z.enum(THINKING_LEVEL_VALUES).optional()),
46
+ yolo: z.boolean().default(false),
47
+ permissionRules: z.object({
48
+ categories: z.record(z.string(), z.enum([
49
+ "allow",
50
+ "ask",
51
+ "deny"
52
+ ])).default({}),
53
+ tools: z.record(z.string(), z.enum([
54
+ "allow",
55
+ "ask",
56
+ "deny"
57
+ ])).default({})
58
+ }).default({
59
+ categories: {},
60
+ tools: {}
61
+ }),
62
+ smartEditing: z.boolean().default(true),
63
+ notifications: z.enum([
64
+ "bell",
65
+ "system",
66
+ "both",
67
+ "off"
68
+ ]).default("off"),
69
+ tasks: z.array(z.object({
70
+ id: z.string().optional(),
71
+ content: z.string(),
72
+ status: z.enum([
73
+ "pending",
74
+ "in_progress",
75
+ "completed"
76
+ ]),
77
+ activeForm: z.string()
78
+ })).default([]),
79
+ sandboxAllowedPaths: z.array(z.string()).default([]),
80
+ mastracodePendingModelFallback: z.object({
81
+ fromEntryId: z.string(),
82
+ toEntryId: z.string(),
83
+ toModelId: z.string(),
84
+ threadId: z.string().optional(),
85
+ reason: z.enum(["pool-exhausted", "persistent-outage"]),
86
+ at: z.string()
87
+ }).nullish(),
88
+ pluginSkillPaths: z.array(z.string()).default([]),
89
+ pluginCommandPaths: z.array(z.string()).default([]),
90
+ pluginInstructions: z.array(z.string()).default([]),
91
+ activePlan: z.object({
92
+ title: z.string(),
93
+ plan: z.string(),
94
+ approvedAt: z.string()
95
+ }).nullable().default(null),
96
+ activeBrowserSettings: z.object({
97
+ enabled: z.boolean(),
98
+ provider: z.enum(["stagehand", "agent-browser"]),
99
+ headless: z.boolean().optional(),
100
+ viewport: z.union([z.object({
101
+ width: z.number(),
102
+ height: z.number()
103
+ }), z.literal("window")]).optional(),
104
+ cdpUrl: z.string().optional(),
105
+ profile: z.string().optional(),
106
+ executablePath: z.string().optional(),
107
+ scope: z.enum(["shared", "thread"]).optional(),
108
+ stagehand: z.object({
109
+ env: z.enum(["LOCAL", "BROWSERBASE"]),
110
+ projectId: z.string().optional(),
111
+ model: z.string().optional(),
112
+ preserveUserDataDir: z.boolean().optional()
113
+ }).optional(),
114
+ agentBrowser: z.object({ storageState: z.string().optional() }).optional()
115
+ }).optional(),
116
+ activeBrowserModel: z.object({
117
+ modelName: z.string().optional(),
118
+ source: z.enum([
119
+ "settings",
120
+ "chat-model",
121
+ "codex-oauth",
122
+ "stagehand-default"
123
+ ]),
124
+ viaCodexOAuth: z.boolean()
125
+ }).optional()
126
+ }).transform((state) => ({
127
+ ...state,
128
+ observerModelSelection: state.observerModelSelection ?? state.observerModelId ?? "auto",
129
+ reflectorModelSelection: state.reflectorModelSelection ?? state.reflectorModelId ?? "auto"
130
+ }));
131
+ export { stateSchema };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Mastra brand palette (immutable — stays constant regardless of theme).
3
+ *
4
+ * Lives outside the TUI so non-TUI code (e.g. mode metadata colors in
5
+ * `createMastraCode`) can use brand colors without importing TUI modules.
6
+ * The TUI's `theme.ts` re-exports this and layers contrast adaptation on top.
7
+ */
8
+ export declare const mastraBrand: {
9
+ readonly purple: '#7f45e0';
10
+ readonly green: '#16c858';
11
+ readonly orange: '#fdac53';
12
+ readonly pink: '#ff69cc';
13
+ readonly blue: '#2563eb';
14
+ readonly red: '#DC5663';
15
+ readonly yellow: '#e7e67b';
16
+ };
17
+ //# sourceMappingURL=theme-palette.d.ts.map
@@ -0,0 +1,18 @@
1
+ // src/theme-palette.ts
2
+ /**
3
+ * Mastra brand palette (immutable — stays constant regardless of theme).
4
+ *
5
+ * Lives outside the TUI so non-TUI code (e.g. mode metadata colors in
6
+ * `createMastraCode`) can use brand colors without importing TUI modules.
7
+ * The TUI's `theme.ts` re-exports this and layers contrast adaptation on top.
8
+ */
9
+ const mastraBrand = {
10
+ purple: "#7f45e0",
11
+ green: "#16c858",
12
+ orange: "#fdac53",
13
+ pink: "#ff69cc",
14
+ blue: "#2563eb",
15
+ red: "#DC5663",
16
+ yellow: "#e7e67b"
17
+ };
18
+ export { mastraBrand };
@@ -0,0 +1,4 @@
1
+ import type { ThinkingLevelSetting } from './thinking.js';
2
+ export declare function runCatalogThinkingLevel(selectionId: string, level: ThinkingLevelSetting): ThinkingLevelSetting;
3
+ export declare function getCatalogThinkingLevels(selectionId: string): ThinkingLevelSetting[];
4
+ //# sourceMappingURL=thinking-catalog.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { parseCodexModelSelection } from "./providers/model-ids.js";
2
+ import { getAvailableThinkingLevelsForModel, runThinkingLevel } from "./thinking.js";
3
+ import { getModelReasoningOptions } from "@mastra/core/llm";
4
+ // src/thinking-catalog.ts
5
+ function runCatalogThinkingLevel(selectionId, level) {
6
+ const { modelId } = parseCodexModelSelection(selectionId);
7
+ return runThinkingLevel(modelId, level, getModelReasoningOptions(modelId));
8
+ }
9
+ function getCatalogThinkingLevels(selectionId) {
10
+ const { modelId } = parseCodexModelSelection(selectionId);
11
+ return getAvailableThinkingLevelsForModel(modelId, getModelReasoningOptions(modelId));
12
+ }
13
+ export { getCatalogThinkingLevels, runCatalogThinkingLevel };