@mastra/code-sdk 1.8.2-alpha.0 → 1.8.2-alpha.1

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.
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Execute subagent — focused task execution with write capabilities.
2
+ * Build mode — interactive task execution with write capabilities.
3
3
  *
4
- * This subagent is given a specific implementation task and uses both
5
- * read and write tools to complete it. It can modify files, run commands,
6
- * and perform actual development work within a constrained scope.
4
+ * The default top-level mode for implementing features, fixing bugs, and
5
+ * making changes directly in conversation with the user. Full read/write
6
+ * access within the task's scope. (Not to be confused with the separate
7
+ * `executeSubagent`, which has its own concise, parent-reporting
8
+ * instructions for when work is delegated to a sub-agent.)
7
9
  */
8
10
  import type { AgentControllerMode } from '@mastra/core/agent-controller';
9
11
  export declare const buildMode: AgentControllerMode;
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/agents/modes/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,eAAO,MAAM,SAAS,EAAE,mBA8CvB,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/agents/modes/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,eAAO,MAAM,SAAS,EAAE,mBAiCvB,CAAC"}
@@ -23,19 +23,6 @@ const buildMode = {
23
23
  . Make changes incrementally — verify each change before moving on
24
24
  . Run tests or type-check to verify
25
25
 
26
- ## Efficiency
27
- Your output returns to the parent agent. Be concise:
28
- - Don't repeat file contents in your response
29
- - Summarize what changed, don't narrate each step
30
- - Keep your final summary under 300 words
31
-
32
- ## Output Format
33
- End with a structured summary:
34
- . **Completed**: What you implemented (1-2 sentences)
35
- . **Changes**: Files modified/created
36
- . **Verification**: How you verified it works
37
- . **Notes**: Follow-up needed (if any)
38
-
39
26
  ## Workflows
40
27
  - To build a workflow: call \`create-workflow\` with the user's request verbatim. A focused sub-agent handles discovery, composition, and saving — don't try to do it inline.
41
28
  - To run an existing workflow: call \`run-workflow\` with { workflowId, inputData }. Returns { status, result, error? }.
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","names":[],"sources":["../../../src/agents/modes/build.ts"],"sourcesContent":["/**\n * Execute subagent — focused task execution with write capabilities.\n *\n * This subagent is given a specific implementation task and uses both\n * read and write tools to complete it. It can modify files, run commands,\n * and perform actual development work within a constrained scope.\n */\nimport type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nexport const buildMode: AgentControllerMode = {\n id: 'build',\n name: 'Build',\n description:\n \"Task execution with write capabilities. Use for 'implement feature X', 'fix bug Y', 'refactor module Z'.\",\n instructions: `You are a focused execution agent. Your job is to complete a specific, well-defined task by making the necessary changes to the codebase.\n\n## Rules\n- You have FULL ACCESS to read, write, and execute within your task scope.\n- Stay focused on the specific task given. Do not make unrelated changes.\n- Read files before modifying them — use view first, then string_replace_lsp or write_file.\n- Verify your changes work by running relevant tests or checking for errors.\n\n## Tool Strategy\n- **Read first**: Always view a file before editing it\n- **Edit precisely**: Use string_replace_lsp with enough context to match uniquely\n- **Use specialized tools**: Prefer view/search_content/find_files over shell commands for reading\n- **Parallelize**: Make independent tool calls together (e.g., view multiple files at once)\n\n## Workflow\n. Understand the task and explore relevant code\n. For complex tasks (3+ steps): track progress internally and summarize it in your final answer\n. Make changes incrementally — verify each change before moving on\n. Run tests or type-check to verify\n\n## Efficiency\nYour output returns to the parent agent. Be concise:\n- Don't repeat file contents in your response\n- Summarize what changed, don't narrate each step\n- Keep your final summary under 300 words\n\n## Output Format\nEnd with a structured summary:\n. **Completed**: What you implemented (1-2 sentences)\n. **Changes**: Files modified/created\n. **Verification**: How you verified it works\n. **Notes**: Follow-up needed (if any)\n\n## Workflows\n- To build a workflow: call \\`create-workflow\\` with the user's request verbatim. A focused sub-agent handles discovery, composition, and saving — don't try to do it inline.\n- To run an existing workflow: call \\`run-workflow\\` with { workflowId, inputData }. Returns { status, result, error? }.\n- To inspect or manage: \\`list-workflows\\`, \\`get-workflow\\`, \\`delete-workflow\\`.`,\n defaultModelId: 'openai/gpt-5.5',\n metadata: {\n default: true,\n },\n};\n"],"mappings":";AASA,MAAa,YAAiC;CAC5C,IAAI;CACJ,MAAM;CACN,aACE;CACF,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCd,gBAAgB;CAChB,UAAU,EACR,SAAS,KACX;AACF"}
1
+ {"version":3,"file":"build.js","names":[],"sources":["../../../src/agents/modes/build.ts"],"sourcesContent":["/**\n * Build mode — interactive task execution with write capabilities.\n *\n * The default top-level mode for implementing features, fixing bugs, and\n * making changes directly in conversation with the user. Full read/write\n * access within the task's scope. (Not to be confused with the separate\n * `executeSubagent`, which has its own concise, parent-reporting\n * instructions for when work is delegated to a sub-agent.)\n */\nimport type { AgentControllerMode } from '@mastra/core/agent-controller';\n\nexport const buildMode: AgentControllerMode = {\n id: 'build',\n name: 'Build',\n description:\n \"Task execution with write capabilities. Use for 'implement feature X', 'fix bug Y', 'refactor module Z'.\",\n instructions: `You are a focused execution agent. Your job is to complete a specific, well-defined task by making the necessary changes to the codebase.\n\n## Rules\n- You have FULL ACCESS to read, write, and execute within your task scope.\n- Stay focused on the specific task given. Do not make unrelated changes.\n- Read files before modifying them — use view first, then string_replace_lsp or write_file.\n- Verify your changes work by running relevant tests or checking for errors.\n\n## Tool Strategy\n- **Read first**: Always view a file before editing it\n- **Edit precisely**: Use string_replace_lsp with enough context to match uniquely\n- **Use specialized tools**: Prefer view/search_content/find_files over shell commands for reading\n- **Parallelize**: Make independent tool calls together (e.g., view multiple files at once)\n\n## Workflow\n. Understand the task and explore relevant code\n. For complex tasks (3+ steps): track progress internally and summarize it in your final answer\n. Make changes incrementally — verify each change before moving on\n. Run tests or type-check to verify\n\n## Workflows\n- To build a workflow: call \\`create-workflow\\` with the user's request verbatim. A focused sub-agent handles discovery, composition, and saving — don't try to do it inline.\n- To run an existing workflow: call \\`run-workflow\\` with { workflowId, inputData }. Returns { status, result, error? }.\n- To inspect or manage: \\`list-workflows\\`, \\`get-workflow\\`, \\`delete-workflow\\`.`,\n defaultModelId: 'openai/gpt-5.5',\n metadata: {\n default: true,\n },\n};\n"],"mappings":";AAWA,MAAa,YAAiC;CAC5C,IAAI;CACJ,MAAM;CACN,aACE;CACF,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,gBAAgB;CAChB,UAAU,EACR,SAAS,KACX;AACF"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Explore subagent — read-only codebase exploration.
2
+ * Explore mode — interactive, read-only codebase exploration.
3
3
  *
4
- * This subagent is given a focused task (e.g., "find all usages of X",
5
- * "understand how module Y works") and uses read-only tools to explore
6
- * the codebase, then returns a concise summary of its findings.
4
+ * The top-level mode for questions like "find all usages of X" or "how
5
+ * does module Y work". Read-only; answers the user directly in
6
+ * conversation rather than reporting back to a parent agent.
7
7
  */
8
8
  import type { AgentControllerMode } from '@mastra/core/agent-controller';
9
9
  export declare const fastMode: AgentControllerMode;
@@ -1 +1 @@
1
- {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../src/agents/modes/explore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,eAAO,MAAM,QAAQ,EAAE,mBAqCtB,CAAC"}
1
+ {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../src/agents/modes/explore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,eAAO,MAAM,QAAQ,EAAE,mBAuBtB,CAAC"}
@@ -18,20 +18,6 @@ const fastMode = {
18
18
  - **Read efficiently**: Use view with view_range for large files — don't read entire files if you only need a section
19
19
  - **Parallelize**: Make multiple independent tool calls in one round when exploring different areas
20
20
 
21
- ## Efficiency
22
- Your output returns to the parent agent. Be concise:
23
- - Don't include raw file contents in your response — summarize what you found
24
- - Reference files by path and line number, not by copying code
25
- - If a search returns many results, report the count and key examples, not every match
26
-
27
- ## Output Format
28
- End with a structured summary:
29
- . **Answer**: Direct answer to the question (1-2 sentences)
30
- . **Key Files**: Most relevant files with line numbers
31
- . **Details**: Additional context if needed
32
-
33
- Keep your summary under 300 words.
34
-
35
21
  ## Workflows
36
22
  - You can use \`list-workflows\` and \`get-workflow\` to inspect saved workflows. You cannot create, run, or delete in this mode.`,
37
23
  availableTools: [...EXPLORE_MODE_AVAILABLE_TOOLS]
@@ -1 +1 @@
1
- {"version":3,"file":"explore.js","names":[],"sources":["../../../src/agents/modes/explore.ts"],"sourcesContent":["/**\n * Explore subagent — read-only codebase exploration.\n *\n * This subagent is given a focused task (e.g., \"find all usages of X\",\n * \"understand how module Y works\") and uses read-only tools to explore\n * the codebase, then returns a concise summary of its findings.\n */\nimport type { AgentControllerMode } from '@mastra/core/agent-controller';\nimport { EXPLORE_MODE_AVAILABLE_TOOLS } from '../tool-availability.js';\n\nexport const fastMode: AgentControllerMode = {\n id: 'fast',\n name: 'Explore',\n description:\n \"Read-only codebase exploration. Use for questions like 'find all usages of X', 'how does module Y work'.\",\n defaultModelId: 'openai/gpt-5.4-mini',\n instructions: `You are an expert code explorer. Your job is to investigate a codebase and answer a specific question or gather specific information.\n\n## Rules\n- You have READ-ONLY access. You cannot modify files or run commands.\n- Be thorough — search broadly first, then drill into relevant files.\n- After gathering enough information, produce a clear, concise summary of your findings.\n\n## Tool Strategy\n- **Start broad**: Use find_files (glob) to understand project structure\n- **Search smart**: Use search_content (grep) with specific patterns — avoid overly broad searches\n- **Read efficiently**: Use view with view_range for large files — don't read entire files if you only need a section\n- **Parallelize**: Make multiple independent tool calls in one round when exploring different areas\n\n## Efficiency\nYour output returns to the parent agent. Be concise:\n- Don't include raw file contents in your response — summarize what you found\n- Reference files by path and line number, not by copying code\n- If a search returns many results, report the count and key examples, not every match\n\n## Output Format\nEnd with a structured summary:\n. **Answer**: Direct answer to the question (1-2 sentences)\n. **Key Files**: Most relevant files with line numbers\n. **Details**: Additional context if needed\n\nKeep your summary under 300 words.\n\n## Workflows\n- You can use \\`list-workflows\\` and \\`get-workflow\\` to inspect saved workflows. You cannot create, run, or delete in this mode.`,\n\n availableTools: [...EXPLORE_MODE_AVAILABLE_TOOLS],\n};\n"],"mappings":";;AAUA,MAAa,WAAgC;CAC3C,IAAI;CACJ,MAAM;CACN,aACE;CACF,gBAAgB;CAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bd,gBAAgB,CAAC,GAAG,4BAA4B;AAClD"}
1
+ {"version":3,"file":"explore.js","names":[],"sources":["../../../src/agents/modes/explore.ts"],"sourcesContent":["/**\n * Explore mode — interactive, read-only codebase exploration.\n *\n * The top-level mode for questions like \"find all usages of X\" or \"how\n * does module Y work\". Read-only; answers the user directly in\n * conversation rather than reporting back to a parent agent.\n */\nimport type { AgentControllerMode } from '@mastra/core/agent-controller';\nimport { EXPLORE_MODE_AVAILABLE_TOOLS } from '../tool-availability.js';\n\nexport const fastMode: AgentControllerMode = {\n id: 'fast',\n name: 'Explore',\n description:\n \"Read-only codebase exploration. Use for questions like 'find all usages of X', 'how does module Y work'.\",\n defaultModelId: 'openai/gpt-5.4-mini',\n instructions: `You are an expert code explorer. Your job is to investigate a codebase and answer a specific question or gather specific information.\n\n## Rules\n- You have READ-ONLY access. You cannot modify files or run commands.\n- Be thorough — search broadly first, then drill into relevant files.\n- After gathering enough information, produce a clear, concise summary of your findings.\n\n## Tool Strategy\n- **Start broad**: Use find_files (glob) to understand project structure\n- **Search smart**: Use search_content (grep) with specific patterns — avoid overly broad searches\n- **Read efficiently**: Use view with view_range for large files — don't read entire files if you only need a section\n- **Parallelize**: Make multiple independent tool calls in one round when exploring different areas\n\n## Workflows\n- You can use \\`list-workflows\\` and \\`get-workflow\\` to inspect saved workflows. You cannot create, run, or delete in this mode.`,\n\n availableTools: [...EXPLORE_MODE_AVAILABLE_TOOLS],\n};\n"],"mappings":";;AAUA,MAAa,WAAgC;CAC3C,IAAI;CACJ,MAAM;CACN,aACE;CACF,gBAAgB;CAChB,cAAc;;;;;;;;;;;;;;;CAgBd,gBAAgB,CAAC,GAAG,4BAA4B;AAClD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/code-sdk",
3
- "version": "1.8.2-alpha.0",
3
+ "version": "1.8.2-alpha.1",
4
4
  "description": "Mastra Code SDK: the agent core behind Mastra Code (everything except the TUI) — build your own UIs and surfaces on top of it",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -56,20 +56,20 @@
56
56
  "vscode-languageserver-protocol": "^3.17.5",
57
57
  "yaml": "^2.7.1",
58
58
  "zod": "^4.6.4",
59
+ "@mastra/duckdb": "1.11.0-alpha.1",
59
60
  "@mastra/agent-browser": "0.5.3",
60
- "@mastra/core": "1.70.0-alpha.0",
61
- "@mastra/duckdb": "1.11.0-alpha.0",
61
+ "@mastra/fastembed": "1.3.1",
62
62
  "@mastra/github-signals": "0.5.0",
63
- "@mastra/libsql": "1.23.1",
63
+ "@mastra/core": "1.70.0-alpha.1",
64
+ "@mastra/libsql": "1.23.2-alpha.0",
64
65
  "@mastra/mcp": "2.1.0-alpha.0",
65
- "@mastra/memory": "1.31.0",
66
+ "@mastra/memory": "1.32.0-alpha.0",
67
+ "@mastra/pg": "1.27.0-alpha.1",
66
68
  "@mastra/observability": "1.18.0",
67
- "@mastra/fastembed": "1.3.1",
68
69
  "@mastra/parallel": "0.1.2",
69
- "@mastra/schema-compat": "1.3.11",
70
- "@mastra/stagehand": "0.3.5",
71
70
  "@mastra/tavily": "1.1.2",
72
- "@mastra/pg": "1.27.0-alpha.0"
71
+ "@mastra/stagehand": "0.3.5",
72
+ "@mastra/schema-compat": "1.3.11"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@libsql/client": "^0.18.0",
@@ -81,8 +81,8 @@
81
81
  "typescript-eslint": "^8.57.0",
82
82
  "vitest": "4.1.11",
83
83
  "@internal/lint": "0.0.135",
84
- "@internal/workspace-test-utils": "0.0.79",
85
- "@internal/types-builder": "0.0.110"
84
+ "@internal/types-builder": "0.0.110",
85
+ "@internal/workspace-test-utils": "0.0.79"
86
86
  },
87
87
  "engines": {
88
88
  "node": ">=22.19.0"