mastracode 0.18.0-alpha.8 → 0.18.0-alpha.9

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 (59) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/agents/prompts/build.d.ts +1 -1
  3. package/dist/agents/prompts/build.d.ts.map +1 -1
  4. package/dist/agents/prompts/index.d.ts.map +1 -1
  5. package/dist/agents/prompts/tool-guidance.d.ts.map +1 -1
  6. package/dist/agents/subagents/execute.d.ts.map +1 -1
  7. package/dist/{chunk-BV5IMX2N.cjs → chunk-2G75WRPR.cjs} +76 -52
  8. package/dist/chunk-2G75WRPR.cjs.map +1 -0
  9. package/dist/{chunk-WOKTYUW4.js → chunk-7QZKXAXL.js} +46 -22
  10. package/dist/chunk-7QZKXAXL.js.map +1 -0
  11. package/dist/{chunk-OBFBUWOR.cjs → chunk-AWYGW5ZV.cjs} +12 -4
  12. package/dist/chunk-AWYGW5ZV.cjs.map +1 -0
  13. package/dist/{chunk-HSJIIPG6.cjs → chunk-SKZLYA4E.cjs} +210 -52
  14. package/dist/chunk-SKZLYA4E.cjs.map +1 -0
  15. package/dist/{chunk-JP7WKMD4.js → chunk-TTAAM2XR.js} +12 -4
  16. package/dist/chunk-TTAAM2XR.js.map +1 -0
  17. package/dist/{chunk-XCF2QRID.js → chunk-VNMYCOR2.js} +197 -39
  18. package/dist/chunk-VNMYCOR2.js.map +1 -0
  19. package/dist/cli.cjs +7 -7
  20. package/dist/cli.js +2 -2
  21. package/dist/index.cjs +3 -3
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/permissions-EDE3D2DA.js +3 -0
  26. package/dist/{permissions-RFLEFJHS.js.map → permissions-EDE3D2DA.js.map} +1 -1
  27. package/dist/permissions-GWY37IEK.cjs +40 -0
  28. package/dist/{permissions-YLP5R74I.cjs.map → permissions-GWY37IEK.cjs.map} +1 -1
  29. package/dist/permissions.d.ts.map +1 -1
  30. package/dist/schema.d.ts +1 -0
  31. package/dist/schema.d.ts.map +1 -1
  32. package/dist/tui/commands/clone.d.ts.map +1 -1
  33. package/dist/tui/commands/new.d.ts.map +1 -1
  34. package/dist/tui/commands/resource.d.ts.map +1 -1
  35. package/dist/tui/commands/threads.d.ts.map +1 -1
  36. package/dist/tui/components/task-progress.d.ts +3 -3
  37. package/dist/tui/components/task-progress.d.ts.map +1 -1
  38. package/dist/tui/event-dispatch.d.ts.map +1 -1
  39. package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -1
  40. package/dist/tui/handlers/message.d.ts.map +1 -1
  41. package/dist/tui/handlers/tool.d.ts +1 -0
  42. package/dist/tui/handlers/tool.d.ts.map +1 -1
  43. package/dist/tui/handlers/types.d.ts +3 -3
  44. package/dist/tui/handlers/types.d.ts.map +1 -1
  45. package/dist/tui/render-messages.d.ts +3 -3
  46. package/dist/tui/render-messages.d.ts.map +1 -1
  47. package/dist/tui/state.d.ts +4 -2
  48. package/dist/tui/state.d.ts.map +1 -1
  49. package/dist/tui.cjs +11 -11
  50. package/dist/tui.js +1 -1
  51. package/package.json +8 -9
  52. package/dist/chunk-BV5IMX2N.cjs.map +0 -1
  53. package/dist/chunk-HSJIIPG6.cjs.map +0 -1
  54. package/dist/chunk-JP7WKMD4.js.map +0 -1
  55. package/dist/chunk-OBFBUWOR.cjs.map +0 -1
  56. package/dist/chunk-WOKTYUW4.js.map +0 -1
  57. package/dist/chunk-XCF2QRID.js.map +0 -1
  58. package/dist/permissions-RFLEFJHS.js +0 -3
  59. package/dist/permissions-YLP5R74I.cjs +0 -40
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.18.0-alpha.9
4
+
5
+ ### Minor Changes
6
+
7
+ - Improved MastraCode task tracking so agents keep stable task IDs in prompts and update one task at a time while working. ([#16254](https://github.com/mastra-ai/mastra/pull/16254))
8
+
9
+ MastraCode now preserves Harness task IDs in state, includes those IDs in the current task list prompt, and replays structured task snapshots from full thread history when a thread reloads. The TUI keeps successful task updates quiet, shows task-tool failures inline, avoids duplicate completed-task summaries, and restores replayed tasks through the Harness display-state API.
10
+
11
+ MastraCode also documents the structured `task_check` result fields in agent guidance and keeps streaming `task_write` input typed separately from normalized task state.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`6742347`](https://github.com/mastra-ai/mastra/commit/6742347d71955d7639adc9ddf6ff8282de7ee3ba), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`62666c3`](https://github.com/mastra-ai/mastra/commit/62666c367eaeac3941ead454b1d38810cc855721), [`4af2160`](https://github.com/mastra-ai/mastra/commit/4af2160322f4718cac421930cce85641e9512389), [`b2fd6be`](https://github.com/mastra-ai/mastra/commit/b2fd6beef989f5e463c9a33d8a6c20ac1800e011), [`136c959`](https://github.com/mastra-ai/mastra/commit/136c9592fb0eeb0cd212f28629d8a29b7557a2fc), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`4df7cc7`](https://github.com/mastra-ai/mastra/commit/4df7cc79342fd065fe7fdeef93c094db14b12bcd), [`aca3121`](https://github.com/mastra-ai/mastra/commit/aca31211233dac25459f140ea4fcfb3a5af64c18), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`9cdf38e`](https://github.com/mastra-ai/mastra/commit/9cdf38e58506e1109c8b38f97cd7770978a4218e), [`990851e`](https://github.com/mastra-ai/mastra/commit/990851edcb0e30be5c2c18b6532f1a876cc2d335), [`6068a6c`](https://github.com/mastra-ai/mastra/commit/6068a6c42950fad3ebfc92346417896ba60803d2), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`e2a079c`](https://github.com/mastra-ai/mastra/commit/e2a079cc3755b1895f7bd5dc36e9be81b11c7c22), [`f70160c`](https://github.com/mastra-ai/mastra/commit/f70160c53c366e71e1d8dde2c6aeaf1b62fb77e6), [`534a456`](https://github.com/mastra-ai/mastra/commit/534a456a25e4df1e5407e7e632f4cb3b1fa14f9d), [`36bae07`](https://github.com/mastra-ai/mastra/commit/36bae07c0e70b1b3006f2fd20830e8883dcbd066)]:
16
+ - @mastra/core@1.33.0-alpha.7
17
+ - @mastra/libsql@1.10.1-alpha.1
18
+ - @mastra/observability@1.12.0-alpha.1
19
+ - @mastra/memory@1.18.0-alpha.2
20
+
3
21
  ## 0.18.0-alpha.8
4
22
 
5
23
  ### Patch Changes
@@ -8,5 +8,5 @@ import type { PromptContext } from './index.js';
8
8
  * knows exactly what to implement.
9
9
  */
10
10
  export declare function buildModePromptFn(ctx: PromptContext): string;
11
- export declare const buildModePrompt = "\n# Build Mode\n\nYou are in BUILD mode. You have full access to all tools and can read, write, edit, and execute commands.\n\n## Working Style\n\n**For simple tasks** (typo fixes, small edits, single-file changes):\n- Just do it. No need to explain your plan first.\n\n**For non-trivial tasks** (3+ files, architectural decisions, unclear requirements):\n- Use task_write to track your steps\n- Work on ONE step at a time \u2014 complete it and verify it works before moving on\n- If multiple approaches are plausible and the choice would materially affect scope, behavior, or risk, stop and ask the user\n\n## The Implementation Loop\n\nFor each change you make:\n\n1. **Understand** \u2014 Read the relevant code. Check how similar things are done elsewhere.\n2. **Implement** \u2014 Make the change. Follow existing patterns and conventions.\n3. **Verify** \u2014 Test that it works. Don't assume \u2014 actually run it.\n4. **Prove** \u2014 Proactively prove that the change is good, makes sense in context, is a positive contribution, and works fully. The burden of proof is on YOU.\n5. **Clean up** \u2014 Ensure no broken code, no debug statements, no half-done features.\n\nOnly move to the next change after the current one is verified and proved to be working.\n\n## Verification is Required\n\nBefore considering any task complete:\n- Run relevant tests (check package.json for test scripts)\n- For TypeScript, run `tsc --noEmit` to catch type errors\n- If there are no automated tests, manually verify the behavior works as expected\n- Confirm the result makes sense in the codebase and improves the requested behavior\n- Use task_check to ensure all tracked tasks are done\n\n**Don't mark something as done until you've verified and proved it actually works.**\n\n## Error Recovery\n\nWhen something breaks:\n1. Read the full error output carefully \u2014 don't guess\n2. Find the root cause, not just the symptom\n3. Fix it properly \u2014 no casts or suppressions to hide errors\n4. Re-run to confirm the fix\n5. If progress is blocked after reasonable attempts, briefly explain the blocker, what you've tried, and the next best option\n\n## Git in Build Mode\n\n- Before committing, verify the code compiles and passes lint\n- Use descriptive branch names: `feat/...`, `fix/...`, `refactor/...`\n";
11
+ export declare const buildModePrompt = "\n# Build Mode\n\nYou are in BUILD mode. You have full access to all tools and can read, write, edit, and execute commands.\n\n## Working Style\n\n**For simple tasks** (typo fixes, small edits, single-file changes):\n- Just do it. No need to explain your plan first.\n\n**For non-trivial tasks** (3+ files, architectural decisions, unclear requirements):\n- Use the available task-management tools to create and update your task list\n- Work on ONE step at a time \u2014 complete it and verify it works before moving on\n- If multiple approaches are plausible and the choice would materially affect scope, behavior, or risk, stop and ask the user\n\n## The Implementation Loop\n\nFor each change you make:\n\n1. **Understand** \u2014 Read the relevant code. Check how similar things are done elsewhere.\n2. **Implement** \u2014 Make the change. Follow existing patterns and conventions.\n3. **Verify** \u2014 Test that it works. Don't assume \u2014 actually run it.\n4. **Prove** \u2014 Proactively prove that the change is good, makes sense in context, is a positive contribution, and works fully. The burden of proof is on YOU.\n5. **Clean up** \u2014 Ensure no broken code, no debug statements, no half-done features.\n\nOnly move to the next change after the current one is verified and proved to be working.\n\n## Verification is Required\n\nBefore considering any task complete:\n- Run relevant tests (check package.json for test scripts)\n- For TypeScript, run `tsc --noEmit` to catch type errors\n- If there are no automated tests, manually verify the behavior works as expected\n- Confirm the result makes sense in the codebase and improves the requested behavior\n- Use available task-checking tools to ensure all tracked tasks are done\n\n**Don't mark something as done until you've verified and proved it actually works.**\n\n## Error Recovery\n\nWhen something breaks:\n1. Read the full error output carefully \u2014 don't guess\n2. Find the root cause, not just the symptom\n3. Fix it properly \u2014 no casts or suppressions to hide errors\n4. Re-run to confirm the fix\n5. If progress is blocked after reasonable attempts, briefly explain the blocker, what you've tried, and the next best option\n\n## Git in Build Mode\n\n- Before committing, verify the code compiles and passes lint\n- Use descriptive branch names: `feat/...`, `fix/...`, `refactor/...`\n";
12
12
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/build.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAiB5D;AAED,eAAO,MAAM,eAAe,8wEAmD3B,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/build.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAiB5D;AAED,eAAO,MAAM,eAAe,00EAmD3B,CAAC"}
@@ -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,CA8D1D"}
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;AAepE,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,CA+D1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool-guidance.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/tool-guidance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA0K3F"}
1
+ {"version":3,"file":"tool-guidance.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/tool-guidance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA6M3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/agents/subagents/execute.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,eAAO,MAAM,eAAe,EAAE,eA0C7B,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/agents/subagents/execute.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,eAAe,EAAE,eAqC7B,CAAC"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkU3HWL5UG_cjs = require('./chunk-U3HWL5UG.cjs');
4
4
  var chunk24SDVHO7_cjs = require('./chunk-24SDVHO7.cjs');
5
- var chunkOBFBUWOR_cjs = require('./chunk-OBFBUWOR.cjs');
5
+ var chunkAWYGW5ZV_cjs = require('./chunk-AWYGW5ZV.cjs');
6
6
  var path = require('path');
7
7
  var agent = require('@mastra/core/agent');
8
8
  var harness = require('@mastra/core/harness');
@@ -214,7 +214,7 @@ Only if all are "no" \u2192 THEN ask the user
214
214
  - Your output is displayed in a terminal so long output text will be hard for the user to read. Keep responses short/concise and to the point, the user will ask questions if they need you to expand on anything. Be critical of yourself and don't add filler sentences, say what you mean, and say it quickly, while remaining friendly.
215
215
  - Use Github-flavored markdown for formatting.
216
216
  - Only use emojis if the user explicitly requests it.
217
- - Use tool calls for actions (editing files, running commands, searching, etc.). Use text for communication \u2014 talk to the user in text, not via tools, except for communication tools like \`submit_plan\`, \`ask_user\`, and \`task_write\`.
217
+ - Use tool calls for actions (editing files, running commands, searching, updating tasks, etc.). Use text for communication \u2014 talk to the user in text, not via tools, except for explicit user-facing or progress tools listed in the tool guidance.
218
218
  - Prioritize technical accuracy over validating the user's beliefs. Be direct and objective. Respectful correction is more valuable than false agreement.
219
219
  `;
220
220
  }
@@ -251,7 +251,7 @@ You are in BUILD mode. You have full access to all tools and can read, write, ed
251
251
  - Just do it. No need to explain your plan first.
252
252
 
253
253
  **For non-trivial tasks** (3+ files, architectural decisions, unclear requirements):
254
- - Use task_write to track your steps
254
+ - Use the available task-management tools to create and update your task list
255
255
  - Work on ONE step at a time \u2014 complete it and verify it works before moving on
256
256
  - If multiple approaches are plausible and the choice would materially affect scope, behavior, or risk, stop and ask the user
257
257
 
@@ -274,7 +274,7 @@ Before considering any task complete:
274
274
  - For TypeScript, run \`tsc --noEmit\` to catch type errors
275
275
  - If there are no automated tests, manually verify the behavior works as expected
276
276
  - Confirm the result makes sense in the codebase and improves the requested behavior
277
- - Use task_check to ensure all tracked tasks are done
277
+ - Use available task-checking tools to ensure all tracked tasks are done
278
278
 
279
279
  **Don't mark something as done until you've verified and proved it actually works.**
280
280
 
@@ -566,9 +566,9 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
566
566
  ];
567
567
  const isPlanMode = modeId === "plan";
568
568
  const planModeTools = {
569
- mastra_workspace_write_file: { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_write_file, enabled: false },
570
- mastra_workspace_edit_file: { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_edit_file, enabled: false },
571
- mastra_workspace_ast_edit: { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_ast_edit, enabled: false }
569
+ mastra_workspace_write_file: { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_write_file, enabled: false },
570
+ mastra_workspace_edit_file: { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_edit_file, enabled: false },
571
+ mastra_workspace_ast_edit: { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES.mastra_workspace_ast_edit, enabled: false }
572
572
  };
573
573
  let existing;
574
574
  try {
@@ -577,11 +577,11 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
577
577
  }
578
578
  if (existing) {
579
579
  existing.filesystem.setAllowedPaths(allowedPaths);
580
- existing.setToolsConfig(isPlanMode ? { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES);
580
+ existing.setToolsConfig(isPlanMode ? { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES);
581
581
  return existing;
582
582
  }
583
583
  const userLsp = chunkU3HWL5UG_cjs.loadSettings().lsp ?? {};
584
- const mcModulePath = path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-BV5IMX2N.cjs', document.baseURI).href)))), "..");
584
+ const mcModulePath = path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-2G75WRPR.cjs', document.baseURI).href)))), "..");
585
585
  const lspConfig = {
586
586
  ...userLsp,
587
587
  packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
@@ -599,7 +599,7 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
599
599
  workingDirectory: projectPath,
600
600
  env: buildSandboxEnv()
601
601
  }),
602
- tools: isPlanMode ? { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES,
602
+ tools: isPlanMode ? { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES,
603
603
  ...skillPaths.length > 0 ? { skills: skillPaths } : {},
604
604
  lsp: lspConfig
605
605
  });
@@ -804,74 +804,74 @@ IMPORTANT: You can ONLY call tools by their exact registered names listed below.
804
804
 
805
805
  You have access to the following tools. Use the RIGHT tool for the job:`);
806
806
  const readTools = [];
807
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.VIEW)) {
807
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW)) {
808
808
  readTools.push(`
809
- **${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW}** \u2014 Read file contents
809
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW}** \u2014 Read file contents
810
810
  - Use this to read files before editing them. NEVER propose changes to code you haven't read.
811
811
  - Use \`offset\` (1-indexed start line) and \`limit\` (number of lines) for large files.
812
812
  - Example: Read lines 50-100: \`{ path: "src/big-file.ts", offset: 50, limit: 51 }\`
813
- - To list directories, use \`${chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES}\` instead.`);
813
+ - To list directories, use \`${chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES}\` instead.`);
814
814
  }
815
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT)) {
815
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT)) {
816
816
  readTools.push(`
817
- **${chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT}** \u2014 Search file contents using regex
817
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT}** \u2014 Search file contents using regex
818
818
  - Preferred for content search (finding functions, variables, error messages, imports, etc.)
819
819
  - Use \`path\` to filter by directory or glob pattern. Supports \`contextLines\`, \`caseSensitive\`, and \`maxCount\`.
820
820
  - Example: Find a function: \`{ pattern: "function handleSubmit", path: "**/*.ts" }\`
821
821
  - Example: Find imports: \`{ pattern: "from ['\\"\\]express['\\"\\]", path: "**/*.ts" }\`
822
822
  - Respects .gitignore by default.`);
823
823
  }
824
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES)) {
824
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES)) {
825
825
  readTools.push(`
826
- **${chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES}** \u2014 List files and directories as a tree
826
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES}** \u2014 List files and directories as a tree
827
827
  - Preferred for exploring project structure and finding files by pattern.
828
828
  - Returns tree-style output. Respects .gitignore by default.
829
829
  - Example: List project root: \`{ path: "./" }\`
830
830
  - Example: Find test files: \`{ path: "./src", pattern: "**/*.test.ts" }\`
831
831
  - Example: Find config files: \`{ pattern: "*.config.{js,ts,json}" }\``);
832
832
  }
833
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.EXECUTE_COMMAND)) {
833
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.EXECUTE_COMMAND)) {
834
834
  readTools.push(`
835
- **${chunkOBFBUWOR_cjs.MC_TOOLS.EXECUTE_COMMAND}** \u2014 Run shell commands
835
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.EXECUTE_COMMAND}** \u2014 Run shell commands
836
836
  - Use for: git, npm/pnpm, docker, build tools, test runners, and other terminal operations.
837
- - Prefer dedicated tools for: file reading (${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW}), file search (${chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT}/${chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES}), file editing (${chunkOBFBUWOR_cjs.MC_TOOLS.STRING_REPLACE_LSP}/${chunkOBFBUWOR_cjs.MC_TOOLS.WRITE_FILE}).
837
+ - Prefer dedicated tools for: file reading (${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW}), file search (${chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT}/${chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES}), file editing (${chunkAWYGW5ZV_cjs.MC_TOOLS.STRING_REPLACE_LSP}/${chunkAWYGW5ZV_cjs.MC_TOOLS.WRITE_FILE}).
838
838
  - Commands have a 30-second default timeout. Use \`timeout\` for longer commands, \`cwd\` for working directory.
839
839
  - Use the \`tail\` parameter or pipe to \`| tail -N\` to limit output \u2014 the full output streams to the user, only the tail is returned to you. If you're building any kind of package you should be tailing.
840
840
  - Good: Run independent commands in parallel when possible.
841
- - Bad: Running \`cat file.txt\` \u2014 use the ${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW} tool instead.`);
841
+ - Bad: Running \`cat file.txt\` \u2014 use the ${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW} tool instead.`);
842
842
  }
843
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.LSP_INSPECT)) {
843
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.LSP_INSPECT)) {
844
844
  readTools.push(`
845
- **${chunkOBFBUWOR_cjs.MC_TOOLS.LSP_INSPECT}** \u2014 Inspect code using Language Server Protocol
845
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.LSP_INSPECT}** \u2014 Inspect code using Language Server Protocol
846
846
  - Use this for type information, hover docs, go-to-definition, and finding implementations for a symbol.
847
847
  - Best when you already know the file and line and need semantic code intelligence rather than raw file contents.
848
848
  - Input: \`path\` (absolute file path), \`line\` (1-indexed line number), \`match\` (the exact line content with exactly one \`<<<\` cursor marker).
849
849
  - Output includes: \`hover\`, \`definition\` (compact location with preview), and \`implementation\` (compact usage/implementation locations).
850
850
  - Example: \`{ path: "/abs/path/src/foo.ts", line: 10, match: "const foo = <<<bar()" }\` \u2014 inspect the symbol at the \`<<<\` position.
851
- - Use \`${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW}\` when you need to read the implementation or surrounding code.
852
- - Use \`${chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT}\` or \`${chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES}\` first if you do not yet know where the symbol is.`);
851
+ - Use \`${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW}\` when you need to read the implementation or surrounding code.
852
+ - Use \`${chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT}\` or \`${chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES}\` first if you do not yet know where the symbol is.`);
853
853
  }
854
854
  if (readTools.length > 0) {
855
855
  sections.push(readTools.join("\n"));
856
856
  }
857
857
  if (modeId !== "plan") {
858
858
  const writeTools = [];
859
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.STRING_REPLACE_LSP)) {
859
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.STRING_REPLACE_LSP)) {
860
860
  writeTools.push(`
861
- **${chunkOBFBUWOR_cjs.MC_TOOLS.STRING_REPLACE_LSP}** \u2014 Edit files by replacing exact text
862
- - You MUST read a file with \`${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW}\` before editing it.
861
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.STRING_REPLACE_LSP}** \u2014 Edit files by replacing exact text
862
+ - You MUST read a file with \`${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW}\` before editing it.
863
863
  - \`old_string\` must be an exact match of existing text in the file.
864
864
  - Provide enough surrounding context in \`old_string\` to make it unique.
865
865
  - Use \`replace_all: true\` to replace all occurrences (default: false, requires unique match).
866
- - For creating new files, use \`${chunkOBFBUWOR_cjs.MC_TOOLS.WRITE_FILE}\` instead.
866
+ - For creating new files, use \`${chunkAWYGW5ZV_cjs.MC_TOOLS.WRITE_FILE}\` instead.
867
867
  - Good: Include 2-3 lines of surrounding context to ensure uniqueness.
868
868
  - Bad: Using just \`return true;\` \u2014 too common, will match multiple places.`);
869
869
  }
870
- if (!denied.has(chunkOBFBUWOR_cjs.MC_TOOLS.WRITE_FILE)) {
870
+ if (!denied.has(chunkAWYGW5ZV_cjs.MC_TOOLS.WRITE_FILE)) {
871
871
  writeTools.push(`
872
- **${chunkOBFBUWOR_cjs.MC_TOOLS.WRITE_FILE}** \u2014 Create new files or overwrite existing ones
872
+ **${chunkAWYGW5ZV_cjs.MC_TOOLS.WRITE_FILE}** \u2014 Create new files or overwrite existing ones
873
873
  - Use this to create new files.
874
- - If overwriting an existing file, you MUST have read it first with \`${chunkOBFBUWOR_cjs.MC_TOOLS.VIEW}\`.
874
+ - If overwriting an existing file, you MUST have read it first with \`${chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW}\`.
875
875
  - Prefer editing existing files over creating new ones.`);
876
876
  }
877
877
  if (writeTools.length > 0) {
@@ -889,20 +889,42 @@ ${webTools.join(" / ")} \u2014 Search the web / extract page content
889
889
  }
890
890
  }
891
891
  const taskTools = [];
892
- if (!denied.has("task_write")) {
892
+ const canUpdateTask = !denied.has("task_update");
893
+ const canCompleteTask = !denied.has("task_complete");
894
+ const canCheckTasks = !denied.has("task_check");
895
+ const canWriteTasks = !denied.has("task_write");
896
+ const patchToolGuidance = canUpdateTask && canCompleteTask ? "- Prefer task_update or task_complete when changing one existing task." : canUpdateTask ? "- Prefer task_update when changing one existing task." : canCompleteTask ? "- Prefer task_complete when marking one existing task completed." : "- Use task_write with the full task list when changing existing tasks.";
897
+ if (canWriteTasks) {
893
898
  taskTools.push(`
894
899
  **task_write** \u2014 Track tasks for complex multi-step work
895
900
  - Use when a task requires 3 or more distinct steps or actions.
896
- - Pass the FULL task list each time (replaces previous list).
901
+ - Use task_write to create the initial task list or replace the whole list after replanning.
902
+ - Each task has: id (stable identifier), content (imperative form), status (pending, in_progress, or completed), activeForm (present continuous form shown during execution).
903
+ - Keep task IDs stable across updates. If you omit IDs, the tool result returns generated IDs.
904
+ ${patchToolGuidance}
897
905
  - Mark tasks \`in_progress\` BEFORE starting work. Only ONE task should be \`in_progress\` at a time.
898
- - Mark tasks \`completed\` IMMEDIATELY after finishing each task. Do not batch completions.
899
- - Each task has: content (imperative form), status (pending|in_progress|completed), activeForm (present continuous form shown during execution).`);
906
+ - Mark tasks \`completed\` IMMEDIATELY after finishing each task. Do not batch completions.`);
900
907
  }
901
- if (!denied.has("task_check")) {
908
+ if (canUpdateTask) {
909
+ taskTools.push(`
910
+ **task_update** \u2014 Patch one tracked task by ID
911
+ - Use this for targeted changes to one existing task.
912
+ - Provide the task ID and only the fields that changed: content, status, or activeForm.`);
913
+ }
914
+ if (canCompleteTask) {
915
+ const idSource = canCheckTasks ? "Use task_check if you need the current IDs before completing a task." : canWriteTasks ? "Use IDs returned by task_write." : "Use only task IDs already visible in the current task list.";
916
+ taskTools.push(`
917
+ **task_complete** \u2014 Mark one tracked task completed by ID
918
+ - Use this immediately after finishing a tracked task.
919
+ - ${idSource}`);
920
+ }
921
+ if (canCheckTasks) {
902
922
  taskTools.push(`
903
923
  **task_check** \u2014 Check completion status of tasks
904
- - Use this BEFORE deciding you're done with a task to verify all tasks are completed.
905
- - Returns the number of completed, in progress, and pending tasks.
924
+ - Use this BEFORE finishing tracked work to verify all tasks are completed.
925
+ - Returns a readable status summary plus structured fields: tasks, summary, incompleteTasks, and isError.
926
+ - summary includes total, completed, inProgress, pending, incomplete, hasTasks, and allCompleted.
927
+ - Use summary.allCompleted to decide whether tracked work is complete; if summary.hasTasks is false, no task list is currently tracked.
906
928
  - If any tasks remain incomplete, continue working on them.
907
929
  - IMPORTANT: Always check task completion before ending work on a complex task.`);
908
930
  }
@@ -935,6 +957,9 @@ ${webTools.join(" / ")} \u2014 Search the web / extract page content
935
957
  }
936
958
 
937
959
  // src/agents/prompts/index.ts
960
+ function formatTaskPromptValue(value) {
961
+ return value.replace(/\s+/g, " ").replace(/[<>{}]/g, (char) => ({ "<": "&lt;", ">": "&gt;", "{": "&#123;", "}": "&#125;" })[char] ?? char).trim();
962
+ }
938
963
  var modePrompts = {
939
964
  build: buildModePromptFn,
940
965
  plan: planModePrompt,
@@ -971,7 +996,8 @@ function buildFullPrompt(ctx) {
971
996
  if (tasks && tasks.length > 0) {
972
997
  const lines = tasks.map((t) => {
973
998
  const icon = t.status === "completed" ? "\u2713" : t.status === "in_progress" ? "\u25B8" : "\u25CB";
974
- return ` ${icon} [${t.status}] ${t.content}`;
999
+ const id = t.id ? ` {id: ${formatTaskPromptValue(t.id)}}` : "";
1000
+ return ` ${icon} [${t.status}]${id} ${formatTaskPromptValue(t.content)}`;
975
1001
  });
976
1002
  taskSection = `
977
1003
  <current-task-list>
@@ -1116,6 +1142,8 @@ ${CAVEMAN_OM_INSTRUCTION}` : DYNAMIC_AGENTS_MD_INSTRUCTION;
1116
1142
  return cachedMemory;
1117
1143
  };
1118
1144
  }
1145
+
1146
+ // src/agents/subagents/execute.ts
1119
1147
  var executeSubagent = {
1120
1148
  id: "execute",
1121
1149
  name: "Execute",
@@ -1136,10 +1164,9 @@ var executeSubagent = {
1136
1164
 
1137
1165
  ## Workflow
1138
1166
  . Understand the task and explore relevant code
1139
- . For complex tasks (3+ steps): use task_write to track progress
1167
+ . For complex tasks (3+ steps): track progress internally and summarize it in your final answer
1140
1168
  . Make changes incrementally \u2014 verify each change before moving on
1141
1169
  . Run tests or type-check to verify
1142
- . If you created tasks: ALWAYS call task_check before finishing
1143
1170
 
1144
1171
  ## Efficiency
1145
1172
  Your output returns to the parent agent. Be concise:
@@ -1152,11 +1179,7 @@ End with a structured summary:
1152
1179
  . **Completed**: What you implemented (1-2 sentences)
1153
1180
  . **Changes**: Files modified/created
1154
1181
  . **Verification**: How you verified it works
1155
- . **Notes**: Follow-up needed (if any)`,
1156
- tools: {
1157
- task_write: harness.taskWriteTool,
1158
- task_check: harness.taskCheckTool
1159
- }
1182
+ . **Notes**: Follow-up needed (if any)`
1160
1183
  };
1161
1184
 
1162
1185
  // src/agents/subagents/explore.ts
@@ -1190,7 +1213,7 @@ End with a structured summary:
1190
1213
  . **Details**: Additional context if needed
1191
1214
 
1192
1215
  Keep your summary under 300 words.`,
1193
- allowedWorkspaceTools: [chunkOBFBUWOR_cjs.MC_TOOLS.VIEW, chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT, chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES]
1216
+ allowedWorkspaceTools: [chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW, chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT, chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES]
1194
1217
  };
1195
1218
 
1196
1219
  // src/agents/subagents/plan.ts
@@ -1226,7 +1249,7 @@ Structure your plan as:
1226
1249
  . **Risks**: Potential issues or edge cases (if any)
1227
1250
 
1228
1251
  Be specific about code locations (file paths, function names, line numbers). Keep the plan actionable and under 500 words.`,
1229
- allowedWorkspaceTools: [chunkOBFBUWOR_cjs.MC_TOOLS.VIEW, chunkOBFBUWOR_cjs.MC_TOOLS.SEARCH_CONTENT, chunkOBFBUWOR_cjs.MC_TOOLS.FIND_FILES]
1252
+ allowedWorkspaceTools: [chunkAWYGW5ZV_cjs.MC_TOOLS.VIEW, chunkAWYGW5ZV_cjs.MC_TOOLS.SEARCH_CONTENT, chunkAWYGW5ZV_cjs.MC_TOOLS.FIND_FILES]
1230
1253
  };
1231
1254
 
1232
1255
  // src/agents/thread-caveman-state.ts
@@ -2625,6 +2648,7 @@ var stateSchema = zod.z.object({
2625
2648
  // Task list (ephemeral per-thread, cleared on thread switch/creation)
2626
2649
  tasks: zod.z.array(
2627
2650
  zod.z.object({
2651
+ id: zod.z.string().optional(),
2628
2652
  content: zod.z.string(),
2629
2653
  status: zod.z.enum(["pending", "in_progress", "completed"]),
2630
2654
  activeForm: zod.z.string()
@@ -3184,7 +3208,7 @@ async function createMastraCode(config) {
3184
3208
  stateSchema,
3185
3209
  subagents,
3186
3210
  resolveModel: (modelId) => chunkU3HWL5UG_cjs.resolveModel(modelId),
3187
- toolCategoryResolver: chunkOBFBUWOR_cjs.getToolCategory,
3211
+ toolCategoryResolver: chunkAWYGW5ZV_cjs.getToolCategory,
3188
3212
  initialState: {
3189
3213
  projectPath: project.rootPath,
3190
3214
  projectName: project.name,
@@ -3291,5 +3315,5 @@ async function createMastraCode(config) {
3291
3315
 
3292
3316
  exports.createAuthStorage = createAuthStorage;
3293
3317
  exports.createMastraCode = createMastraCode;
3294
- //# sourceMappingURL=chunk-BV5IMX2N.cjs.map
3295
- //# sourceMappingURL=chunk-BV5IMX2N.cjs.map
3318
+ //# sourceMappingURL=chunk-2G75WRPR.cjs.map
3319
+ //# sourceMappingURL=chunk-2G75WRPR.cjs.map