mastracode 0.13.1-alpha.2 → 0.14.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/prompts/base.d.ts.map +1 -1
- package/dist/agents/prompts/build.d.ts +1 -1
- package/dist/agents/prompts/build.d.ts.map +1 -1
- package/dist/{chunk-XV3GXFJW.js → chunk-56R7RUUI.js} +49 -30
- package/dist/chunk-56R7RUUI.js.map +1 -0
- package/dist/{chunk-EHH67Q47.js → chunk-AMPURF4V.js} +56 -18
- package/dist/chunk-AMPURF4V.js.map +1 -0
- package/dist/{chunk-CREUKVBM.cjs → chunk-GPFPBYEB.cjs} +60 -20
- package/dist/chunk-GPFPBYEB.cjs.map +1 -0
- package/dist/{chunk-YQOJQ4FP.cjs → chunk-IX2PNG2J.cjs} +87 -68
- package/dist/chunk-IX2PNG2J.cjs.map +1 -0
- package/dist/{chunk-EEXMLLGR.cjs → chunk-JDWUHIKF.cjs} +1312 -774
- package/dist/chunk-JDWUHIKF.cjs.map +1 -0
- package/dist/{chunk-AASZ7C6A.js → chunk-SPO7WDMK.js} +549 -11
- package/dist/chunk-SPO7WDMK.js.map +1 -0
- package/dist/{chunk-P2NLJLNZ.cjs → chunk-WWCN7QMN.cjs} +3 -2
- package/dist/chunk-WWCN7QMN.cjs.map +1 -0
- package/dist/{chunk-WGXQUI3D.js → chunk-XV4ZDFJA.js} +3 -2
- package/dist/chunk-XV4ZDFJA.js.map +1 -0
- package/dist/cli.cjs +19 -19
- package/dist/cli.js +4 -4
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/settings.d.ts +30 -0
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/storage-6ETK2DZQ.js +3 -0
- package/dist/{storage-EVBOAXYI.js.map → storage-6ETK2DZQ.js.map} +1 -1
- package/dist/storage-N7JQG4EH.cjs +24 -0
- package/dist/{storage-FHIJ2CJ5.cjs.map → storage-N7JQG4EH.cjs.map} +1 -1
- package/dist/tui/command-dispatch.d.ts.map +1 -1
- package/dist/tui/commands/api-keys.d.ts +7 -0
- package/dist/tui/commands/api-keys.d.ts.map +1 -0
- package/dist/tui/commands/browser.d.ts.map +1 -1
- package/dist/tui/commands/index.d.ts +1 -0
- package/dist/tui/commands/index.d.ts.map +1 -1
- package/dist/tui/commands/settings.d.ts.map +1 -1
- package/dist/tui/components/settings.d.ts +1 -0
- package/dist/tui/components/settings.d.ts.map +1 -1
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/setup.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +7 -7
- package/dist/chunk-AASZ7C6A.js.map +0 -1
- package/dist/chunk-CREUKVBM.cjs.map +0 -1
- package/dist/chunk-EEXMLLGR.cjs.map +0 -1
- package/dist/chunk-EHH67Q47.js.map +0 -1
- package/dist/chunk-P2NLJLNZ.cjs.map +0 -1
- package/dist/chunk-WGXQUI3D.js.map +0 -1
- package/dist/chunk-XV3GXFJW.js.map +0 -1
- package/dist/chunk-YQOJQ4FP.cjs.map +0 -1
- package/dist/storage-EVBOAXYI.js +0 -3
- package/dist/storage-FHIJ2CJ5.cjs +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.14.0-alpha.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added `/browser set` command for configuring browser profile, executable path, storage state, and CDP URL. Updated the interactive wizard with advanced options for custom browsers and CDP connections. ([#15194](https://github.com/mastra-ai/mastra/pull/15194))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Improved Mastra Code prompt guidance for autonomous decisions and blocked work. ([#15352](https://github.com/mastra-ai/mastra/pull/15352))
|
|
12
|
+
|
|
13
|
+
- Improved observational memory summaries to use caveman-style custom instructions for terser stored observations. ([#15359](https://github.com/mastra-ai/mastra/pull/15359))
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`8687969`](https://github.com/mastra-ai/mastra/commit/86879696b80f87269bec34fd17fa377bce3a5892), [`cbdf3e1`](https://github.com/mastra-ai/mastra/commit/cbdf3e12b3d0c30a6e5347be658e2009648c130a), [`8fe46d3`](https://github.com/mastra-ai/mastra/commit/8fe46d354027f3f0f0846e64219772348de106dd), [`18c67db`](https://github.com/mastra-ai/mastra/commit/18c67dbb9c9ebc26f26f65f7d3ff836e5691ef46), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`8dcc77e`](https://github.com/mastra-ai/mastra/commit/8dcc77e78a5340f5848f74b9e9f1b3da3513c1f5), [`aa67fc5`](https://github.com/mastra-ai/mastra/commit/aa67fc59ee8a5eeff1f23eb05970b8d7a536c8ff), [`fa8140b`](https://github.com/mastra-ai/mastra/commit/fa8140bcd4251d2e3ac85fdc5547dfc4f372b5be), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`a6b7d82`](https://github.com/mastra-ai/mastra/commit/a6b7d820d5028da1284899baf3a7318b5d573f42), [`8ce5d0d`](https://github.com/mastra-ai/mastra/commit/8ce5d0dab0e13ee9ce01562fc434523e93a71ef9), [`7e7bf60`](https://github.com/mastra-ai/mastra/commit/7e7bf606886bf374a6f9d4ca9b09dd83d0533372), [`184907d`](https://github.com/mastra-ai/mastra/commit/184907d775d8609c03c26e78ccaf37315f3aa287), [`18c67db`](https://github.com/mastra-ai/mastra/commit/18c67dbb9c9ebc26f26f65f7d3ff836e5691ef46), [`5f3d4dd`](https://github.com/mastra-ai/mastra/commit/5f3d4ddf237241f4b238ac062ac61eadabed0770), [`0c4cd13`](https://github.com/mastra-ai/mastra/commit/0c4cd131931c04ac5405373c932a242dbe88edd6), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`b16a753`](https://github.com/mastra-ai/mastra/commit/b16a753d5748440248d7df82e29bb987a9c8386c)]:
|
|
16
|
+
- @mastra/stagehand@0.2.0-alpha.0
|
|
17
|
+
- @mastra/core@1.25.0-alpha.3
|
|
18
|
+
- @mastra/agent-browser@0.2.0-alpha.0
|
|
19
|
+
- @mastra/pg@1.9.1-alpha.1
|
|
20
|
+
- @mastra/libsql@1.8.1-alpha.1
|
|
21
|
+
- @mastra/mcp@1.5.0-alpha.0
|
|
22
|
+
|
|
23
|
+
## 0.14.0-alpha.3
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- Added /api-keys command to manage API keys for model providers. You can add, update, or remove keys directly, or access it from the settings menu. ([#15014](https://github.com/mastra-ai/mastra/pull/15014))
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`f5e254f`](https://github.com/mastra-ai/mastra/commit/f5e254f2984c4aae25e26a34ac2e2bbd637b27a6), [`6544c97`](https://github.com/mastra-ai/mastra/commit/6544c974182bccfb31f48efff07671ac528d1533)]:
|
|
32
|
+
- @mastra/pg@1.9.1-alpha.0
|
|
33
|
+
- @mastra/libsql@1.8.1-alpha.0
|
|
34
|
+
|
|
3
35
|
## 0.13.1-alpha.2
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAoExC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,YAAY,IAC3E,oBAAoB;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,YAmD/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwH1D"}
|
|
@@ -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 the
|
|
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 Prove that it works. 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- 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";
|
|
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,
|
|
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,6lEAkD3B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { loadSettings, MEMORY_GATEWAY_PROVIDER, getAvailableModePacks, getAvailableOmPacks, resolveModelDefaults, resolveOmModel, mastra, releaseThreadLock, acquireThreadLock, getCustomProviderId, toCustomProviderModelId, saveSettings } from './chunk-
|
|
2
|
-
import { AuthStorage, detectProject, getResourceIdOverride, getStorageConfig, getVectorDatabasePath, getCurrentGitBranch, getOmScope, getDatabasePath } from './chunk-
|
|
1
|
+
import { loadSettings, MEMORY_GATEWAY_PROVIDER, getAvailableModePacks, getAvailableOmPacks, resolveModelDefaults, resolveOmModel, mastra, releaseThreadLock, acquireThreadLock, getCustomProviderId, toCustomProviderModelId, saveSettings } from './chunk-AMPURF4V.js';
|
|
2
|
+
import { AuthStorage, detectProject, getResourceIdOverride, getStorageConfig, getVectorDatabasePath, getCurrentGitBranch, getOmScope, getDatabasePath } from './chunk-XV4ZDFJA.js';
|
|
3
3
|
import { MC_TOOLS, getToolCategory, TOOL_NAME_OVERRIDES } from './chunk-JP7WKMD4.js';
|
|
4
4
|
import { Agent } from '@mastra/core/agent';
|
|
5
5
|
import { taskCheckTool, taskWriteTool, Harness } from '@mastra/core/harness';
|
|
6
6
|
import { GatewayRegistry, PROVIDER_REGISTRY, ModelRouterLanguageModel, GATEWAY_AUTH_HEADER, MastraGateway, ModelsDevGateway, NetlifyGateway } from '@mastra/core/llm';
|
|
7
|
-
import { AgentsMDInjector } from '@mastra/core/processors';
|
|
7
|
+
import { PrefillErrorHandler, AgentsMDInjector } from '@mastra/core/processors';
|
|
8
8
|
import { createTool } from '@mastra/core/tools';
|
|
9
9
|
import { tavily } from '@tavily/core';
|
|
10
10
|
import { z } from 'zod';
|
|
@@ -42,6 +42,12 @@ Current mode: ${ctx.mode}
|
|
|
42
42
|
|
|
43
43
|
${ctx.toolGuidance}
|
|
44
44
|
|
|
45
|
+
# Memory Style
|
|
46
|
+
- Your memory system may contain observations or reflections written in terse caveman-speak to reduce token usage.
|
|
47
|
+
- Treat that compressed memory style as storage format only.
|
|
48
|
+
- Do NOT imitate or adopt caveman-speak in your user-facing responses unless the user explicitly asks for that style.
|
|
49
|
+
- Use the memory content for facts and context, but respond in your normal clear professional style by default.
|
|
50
|
+
|
|
45
51
|
# How to Work on Tasks
|
|
46
52
|
|
|
47
53
|
## Start by Understanding
|
|
@@ -49,16 +55,6 @@ ${ctx.toolGuidance}
|
|
|
49
55
|
- For unfamiliar codebases, check git log to understand recent changes and patterns.
|
|
50
56
|
- Identify existing conventions (naming, structure, error handling) and follow them.
|
|
51
57
|
|
|
52
|
-
## Work Incrementally
|
|
53
|
-
- Focus on ONE thing at a time. Complete it fully before moving to the next.
|
|
54
|
-
- Leave the codebase in a clean state after each change \u2014 no half-implemented features.
|
|
55
|
-
- For multi-step tasks, use tasks to track progress and ensure nothing is missed.
|
|
56
|
-
|
|
57
|
-
## Verify Before Moving On
|
|
58
|
-
- After each change, verify it works. Don't assume \u2014 actually test it.
|
|
59
|
-
- Run the relevant tests, check for type errors, or manually verify the behavior.
|
|
60
|
-
- If something breaks, fix it immediately. Don't pile more changes on top of broken code.
|
|
61
|
-
|
|
62
58
|
# Coding Philosophy
|
|
63
59
|
|
|
64
60
|
- **Avoid over-engineering.** Only make changes that are directly requested or clearly necessary.
|
|
@@ -73,8 +69,7 @@ ${ctx.toolGuidance}
|
|
|
73
69
|
## Hard Rules
|
|
74
70
|
- NEVER run destructive commands (\`push --force\`, \`reset --hard\`, \`clean -fd\`) unless explicitly requested.
|
|
75
71
|
- NEVER use interactive flags (\`git rebase -i\`, \`git add -i\`) \u2014 TTY input isn't supported.
|
|
76
|
-
- NEVER
|
|
77
|
-
- NEVER force push to \`main\` or \`master\` without warning the user first.
|
|
72
|
+
- NEVER force push to \`main\` or \`master\` without asking the user first.
|
|
78
73
|
- Avoid \`git commit --amend\` unless the commit was just created and hasn't been pushed.
|
|
79
74
|
|
|
80
75
|
## Secrets
|
|
@@ -84,7 +79,7 @@ Don't commit files likely to contain secrets (\`.env\`, \`*.key\`, \`credentials
|
|
|
84
79
|
Write commit messages that explain WHY, not just WHAT. Match the repo's existing style. Include \`Co-Authored-By: Mastra Code${ctx.modelId ? ` (${ctx.modelId})` : ""} <noreply@mastra.ai>\` in the message body.
|
|
85
80
|
|
|
86
81
|
## Pull Requests
|
|
87
|
-
Use \`gh pr create\`. Include a summary of what changed and a test plan.
|
|
82
|
+
Use \`gh pr create\`. Include a summary of what changed and a test plan. Word the pull request title/description to explain the entire unit of work being shipped, worded to explain it to someone who doesn't know anything about the work being shipped. Do not add details of fixes that were needed along the way.
|
|
88
83
|
|
|
89
84
|
# Subagent Rules
|
|
90
85
|
- Only use subagents when you will spawn **multiple subagents in parallel**. If you only need one task done, do it yourself instead of delegating to a single subagent. Exception: the **audit-tests** subagent may be used on its own.
|
|
@@ -94,11 +89,10 @@ Use \`gh pr create\`. Include a summary of what changed and a test plan.
|
|
|
94
89
|
- NEVER guess file paths or function signatures. Use search_content/find_files to find them.
|
|
95
90
|
- NEVER make up URLs. Only use URLs the user provides or that you find in the codebase.
|
|
96
91
|
- When referencing code locations, include the file path and line number.
|
|
97
|
-
- If you're unsure about something, ask the user rather than guessing.
|
|
98
92
|
|
|
99
93
|
# File Access & Sandbox
|
|
100
94
|
|
|
101
|
-
By default, you can only access files within the current project directory. If you get a "Permission denied" or "Access denied" error when trying to read, write, or access files outside the project root, do NOT keep retrying. Instead, use the \`request_access\` tool to request access to the external directory.
|
|
95
|
+
By default, you can only access files within the current project directory. If you get a "Permission denied" or "Access denied" error when trying to read, write, or access files outside the project root, do NOT keep retrying. Instead, use the \`request_access\` tool to request access to the external directory.
|
|
102
96
|
|
|
103
97
|
You are an autonomous AI assistant with strong common sense reasoning capabilities. Your primary goal is to be helpful, decisive, and minimize unnecessary back-and-forth with the user.
|
|
104
98
|
|
|
@@ -111,7 +105,7 @@ You are an autonomous AI assistant with strong common sense reasoning capabiliti
|
|
|
111
105
|
**Common Sense Reasoning**
|
|
112
106
|
- Apply implicit knowledge about how the world works (cause-and-effect, social norms, practical constraints)
|
|
113
107
|
- Consider the user's likely intent, not just literal words
|
|
114
|
-
-
|
|
108
|
+
- Make reasonable assumptions when the most sensible path is clear, but ask the user when ambiguity is material and could change the outcome.
|
|
115
109
|
- Bias towards action, but be flexible in your rules. If you think the user would want you to ask them, then do! Especially if they've previously stated a preference that you do in the specific situation.
|
|
116
110
|
|
|
117
111
|
**Decision Framework**
|
|
@@ -146,6 +140,7 @@ Only if all are "no" \u2192 THEN ask the user
|
|
|
146
140
|
- Information available through reasonable inference
|
|
147
141
|
- Choices where any reasonable option works
|
|
148
142
|
- Things you can reasonably assume based on context
|
|
143
|
+
- When common sense applies or the answer is obvious
|
|
149
144
|
|
|
150
145
|
# Tone and Style
|
|
151
146
|
- 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.
|
|
@@ -186,7 +181,7 @@ You are in BUILD mode. You have full access to all tools and can read, write, ed
|
|
|
186
181
|
**For non-trivial tasks** (3+ files, architectural decisions, unclear requirements):
|
|
187
182
|
- Use task_write to track your steps
|
|
188
183
|
- Work on ONE step at a time \u2014 complete it and verify it works before moving on
|
|
189
|
-
- If the
|
|
184
|
+
- If multiple approaches are plausible and the choice would materially affect scope, behavior, or risk, stop and ask the user
|
|
190
185
|
|
|
191
186
|
## The Implementation Loop
|
|
192
187
|
|
|
@@ -195,9 +190,10 @@ For each change you make:
|
|
|
195
190
|
1. **Understand** \u2014 Read the relevant code. Check how similar things are done elsewhere.
|
|
196
191
|
2. **Implement** \u2014 Make the change. Follow existing patterns and conventions.
|
|
197
192
|
3. **Verify** \u2014 Test that it works. Don't assume \u2014 actually run it.
|
|
198
|
-
4. **
|
|
193
|
+
4. **Prove** \u2014 Prove that it works. The burden of proof is on YOU.
|
|
194
|
+
5. **Clean up** \u2014 Ensure no broken code, no debug statements, no half-done features.
|
|
199
195
|
|
|
200
|
-
Only move to the next change after the current one is verified working.
|
|
196
|
+
Only move to the next change after the current one is verified and proved to be working.
|
|
201
197
|
|
|
202
198
|
## Verification is Required
|
|
203
199
|
|
|
@@ -207,7 +203,7 @@ Before considering any task complete:
|
|
|
207
203
|
- If there are no automated tests, manually verify the behavior works as expected
|
|
208
204
|
- Use task_check to ensure all tracked tasks are done
|
|
209
205
|
|
|
210
|
-
**Don't mark something as done until you've verified it actually works.**
|
|
206
|
+
**Don't mark something as done until you've verified and proved it actually works.**
|
|
211
207
|
|
|
212
208
|
## Error Recovery
|
|
213
209
|
|
|
@@ -216,11 +212,10 @@ When something breaks:
|
|
|
216
212
|
2. Find the root cause, not just the symptom
|
|
217
213
|
3. Fix it properly \u2014 no casts or suppressions to hide errors
|
|
218
214
|
4. Re-run to confirm the fix
|
|
219
|
-
5. If
|
|
215
|
+
5. If progress is blocked after reasonable attempts, briefly explain the blocker, what you've tried, and the next best option
|
|
220
216
|
|
|
221
217
|
## Git in Build Mode
|
|
222
218
|
|
|
223
|
-
- Don't commit unless asked \u2014 just report what you changed
|
|
224
219
|
- Before committing, verify the code compiles and passes lint
|
|
225
220
|
- Use descriptive branch names: \`feat/...\`, \`fix/...\`, \`refactor/...\`
|
|
226
221
|
`;
|
|
@@ -1388,6 +1383,28 @@ function getReflectorModel({ requestContext }) {
|
|
|
1388
1383
|
requestContext
|
|
1389
1384
|
});
|
|
1390
1385
|
}
|
|
1386
|
+
var CAVEMAN_OM_INSTRUCTION = `Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
1387
|
+
|
|
1388
|
+
Use full caveman compression style.
|
|
1389
|
+
|
|
1390
|
+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact. Leave out the words "agent" and "assistant" at the start of each observation line, it is assumed each line is referring to the assistant unless it specifically says it was about the user. Leave out parenthesis and other text characters like * that would not contribute to understanding the observations.
|
|
1391
|
+
|
|
1392
|
+
Pattern: \`[thing] [action] [reason]. [next step]\`
|
|
1393
|
+
|
|
1394
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
1395
|
+
Yes: "Bug in auth middleware. Token expiry check use < not <=. Fix:"
|
|
1396
|
+
|
|
1397
|
+
Example 1
|
|
1398
|
+
\u{1F534} 14:31 user asks why React component rerenders
|
|
1399
|
+
\u{1F7E1} 14:32 saw inline object prop create new ref each render, cause rerender
|
|
1400
|
+
\u2705 14:34 fixed render issue by wrap object in useMemo
|
|
1401
|
+
|
|
1402
|
+
Example 2
|
|
1403
|
+
\u{1F7E1} 15:10 explained pool reuse DB connections, skip repeat handshake overhead
|
|
1404
|
+
|
|
1405
|
+
Don't say "Agent did x", say "did x". It will be assumed the agent did what was observed. The who should only be specified for the user or other third parties: "user asked x"
|
|
1406
|
+
|
|
1407
|
+
Drop caveman for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question, and anything that requires remembering verbatim content. Resume caveman after clear part done`;
|
|
1391
1408
|
function getDynamicMemory(storage, vector) {
|
|
1392
1409
|
return ({ requestContext }) => {
|
|
1393
1410
|
const state = getHarnessState(requestContext);
|
|
@@ -1417,13 +1434,14 @@ function getDynamicMemory(storage, vector) {
|
|
|
1417
1434
|
blockAfter: 2,
|
|
1418
1435
|
previousObserverTokens: observerPreviousObservationTokens,
|
|
1419
1436
|
threadTitle: true,
|
|
1420
|
-
instruction: 'Messages wrapped in <system-reminder type="dynamic-agents-md" ...>...</system-reminder> are ephemeral project-context instructions injected from files on disk. Do NOT observe or extract information from these messages \u2014 they are reloaded automatically when needed and should not be stored in memory
|
|
1437
|
+
instruction: 'Messages wrapped in <system-reminder type="dynamic-agents-md" ...>...</system-reminder> are ephemeral project-context instructions injected from files on disk. Do NOT observe or extract information from these messages \u2014 they are reloaded automatically when needed and should not be stored in memory.\n\n' + CAVEMAN_OM_INSTRUCTION
|
|
1421
1438
|
},
|
|
1422
1439
|
reflection: {
|
|
1423
1440
|
bufferActivation: isResourceScope ? void 0 : 1 / 2,
|
|
1424
1441
|
blockAfter: 1.1,
|
|
1425
1442
|
model: getReflectorModel,
|
|
1426
|
-
observationTokens: refThreshold
|
|
1443
|
+
observationTokens: refThreshold,
|
|
1444
|
+
instruction: CAVEMAN_OM_INSTRUCTION
|
|
1427
1445
|
}
|
|
1428
1446
|
}
|
|
1429
1447
|
}
|
|
@@ -2707,7 +2725,8 @@ async function createMastraCode(config) {
|
|
|
2707
2725
|
return getStaticallyLoadedInstructionPaths(projectPath);
|
|
2708
2726
|
}
|
|
2709
2727
|
})
|
|
2710
|
-
]
|
|
2728
|
+
],
|
|
2729
|
+
errorProcessors: [new PrefillErrorHandler()]
|
|
2711
2730
|
});
|
|
2712
2731
|
const defaultSubagents = [exploreSubagent, planSubagent, executeSubagent];
|
|
2713
2732
|
const defaultModes = [
|
|
@@ -2922,5 +2941,5 @@ async function createMastraCode(config) {
|
|
|
2922
2941
|
}
|
|
2923
2942
|
|
|
2924
2943
|
export { createAuthStorage, createMastraCode };
|
|
2925
|
-
//# sourceMappingURL=chunk-
|
|
2926
|
-
//# sourceMappingURL=chunk-
|
|
2944
|
+
//# sourceMappingURL=chunk-56R7RUUI.js.map
|
|
2945
|
+
//# sourceMappingURL=chunk-56R7RUUI.js.map
|