reasonix 0.52.0 → 0.53.0

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 (143) hide show
  1. package/README.md +1 -0
  2. package/README.zh-CN.md +1 -0
  3. package/dashboard/dist/app.css +1 -1
  4. package/dashboard/dist/app.js +13 -13
  5. package/dashboard/dist/app.js.map +1 -1
  6. package/dist/cli/{acp-NEUYWGUU.js → acp-ABNDGEYC.js} +63 -30
  7. package/dist/cli/acp-ABNDGEYC.js.map +1 -0
  8. package/dist/cli/chat-377YZV56.js +49 -0
  9. package/dist/cli/{chunk-FY5UERSG.js → chunk-2WZT27GR.js} +9 -9
  10. package/dist/cli/{chunk-B4MOGWHW.js → chunk-4EHRIP5U.js} +7 -7
  11. package/dist/cli/chunk-4EHRIP5U.js.map +1 -0
  12. package/dist/cli/{chunk-RCC73DWQ.js → chunk-4SBXAHR6.js} +4 -4
  13. package/dist/cli/{chunk-5YLEKX2V.js → chunk-4V4TKQMB.js} +4 -4
  14. package/dist/cli/{chunk-5YLEKX2V.js.map → chunk-4V4TKQMB.js.map} +1 -1
  15. package/dist/cli/chunk-7ZO6H6ZK.js +54 -0
  16. package/dist/cli/chunk-7ZO6H6ZK.js.map +1 -0
  17. package/dist/cli/{chunk-3OXD5CBM.js → chunk-A6GSOADP.js} +17870 -16070
  18. package/dist/cli/chunk-A6GSOADP.js.map +1 -0
  19. package/dist/cli/{chunk-Z663GVUB.js → chunk-APOSDBAU.js} +3 -3
  20. package/dist/cli/{chunk-CTRM32BP.js → chunk-B5JISV5I.js} +2 -2
  21. package/dist/cli/{chunk-HNZ4727T.js → chunk-DFHI2MRB.js} +412 -152
  22. package/dist/cli/chunk-DFHI2MRB.js.map +1 -0
  23. package/dist/cli/{chunk-CGVW5W7N.js → chunk-EPIHGOM3.js} +14 -14
  24. package/dist/cli/{chunk-CGVW5W7N.js.map → chunk-EPIHGOM3.js.map} +1 -1
  25. package/dist/cli/{chunk-77JIQ7SL.js → chunk-EQFZIHKJ.js} +8 -8
  26. package/dist/cli/chunk-EQFZIHKJ.js.map +1 -0
  27. package/dist/cli/{chunk-XNMXVL6C.js → chunk-FB27YXPX.js} +2 -2
  28. package/dist/cli/{chunk-ARBGTNHM.js → chunk-FK7NXDRP.js} +2 -2
  29. package/dist/cli/{chunk-AOYUW3HR.js → chunk-GCNBIWK7.js} +22 -2
  30. package/dist/cli/chunk-GCNBIWK7.js.map +1 -0
  31. package/dist/cli/{chunk-XBYHNZ5Z.js → chunk-GMQVINZK.js} +13 -5
  32. package/dist/cli/chunk-GMQVINZK.js.map +1 -0
  33. package/dist/cli/{chunk-MVLPXZAA.js → chunk-GOASYYZ4.js} +43 -11
  34. package/dist/cli/{chunk-MVLPXZAA.js.map → chunk-GOASYYZ4.js.map} +1 -1
  35. package/dist/cli/{chunk-WPY7AFS6.js → chunk-I4SH5Z7S.js} +2 -2
  36. package/dist/cli/{chunk-MW64SQUE.js → chunk-J26XOB2T.js} +2 -2
  37. package/dist/cli/{chunk-DLTE4GBY.js → chunk-J4MYMBJ7.js} +3 -3
  38. package/dist/cli/{chunk-CFJY64UA.js → chunk-LRO63VNK.js} +2 -2
  39. package/dist/cli/{chunk-XUZHBQSM.js → chunk-MQJR7YQ2.js} +2 -2
  40. package/dist/cli/{chunk-CPCUMMSR.js → chunk-NVI4XPOQ.js} +3 -3
  41. package/dist/cli/{chunk-RHQOGG43.js → chunk-OHSVEXFF.js} +3 -3
  42. package/dist/cli/chunk-OHSVEXFF.js.map +1 -0
  43. package/dist/cli/{chunk-AMSK3ZLB.js → chunk-P5SUHDUQ.js} +2 -2
  44. package/dist/cli/{chunk-GFJJEW3Z.js → chunk-QSKDP3OS.js} +55 -5
  45. package/dist/cli/chunk-QSKDP3OS.js.map +1 -0
  46. package/dist/cli/{chunk-D6WRFR6V.js → chunk-R7JMQMLD.js} +6 -5
  47. package/dist/cli/chunk-R7JMQMLD.js.map +1 -0
  48. package/dist/cli/{chunk-VVPV5HU6.js → chunk-RRZIIMAF.js} +2 -2
  49. package/dist/cli/{chunk-GNRKXRRE.js → chunk-S3QII236.js} +369 -359
  50. package/dist/cli/{chunk-GNRKXRRE.js.map → chunk-S3QII236.js.map} +1 -1
  51. package/dist/cli/{chunk-HI6THNAZ.js → chunk-TGP7JGHN.js} +32 -14
  52. package/dist/cli/chunk-TGP7JGHN.js.map +1 -0
  53. package/dist/cli/{chunk-CLHMV6OL.js → chunk-U7G72DHQ.js} +83 -42
  54. package/dist/cli/chunk-U7G72DHQ.js.map +1 -0
  55. package/dist/cli/{chunk-OMNRXZNA.js → chunk-URAI4YRL.js} +2 -2
  56. package/dist/cli/{chunk-6QBUXA73.js → chunk-V4AXMN4X.js} +2 -2
  57. package/dist/cli/{chunk-2W4F3RIZ.js → chunk-XHP6NYOT.js} +3 -2
  58. package/dist/cli/{chunk-2W4F3RIZ.js.map → chunk-XHP6NYOT.js.map} +1 -1
  59. package/dist/cli/{code-WN6D4VZO.js → code-JPFZJYVW.js} +34 -34
  60. package/dist/cli/{commands-DHETOY7O.js → commands-IUL2CLKH.js} +4 -4
  61. package/dist/cli/{commit-BBUYAKZV.js → commit-JT7LYBTL.js} +3 -3
  62. package/dist/cli/{config-KV7VV5LG.js → config-T4RWI5NG.js} +6 -2
  63. package/dist/cli/{desktop-LJVXWXNF.js → desktop-AUBW2SLL.js} +122 -38
  64. package/dist/cli/desktop-AUBW2SLL.js.map +1 -0
  65. package/dist/cli/devtools-O5HOMAGZ.js +3 -0
  66. package/dist/cli/diff-NINZHUJR.js +165 -0
  67. package/dist/cli/diff-NINZHUJR.js.map +1 -0
  68. package/dist/cli/{doctor-GI5LOEZL.js → doctor-OMAYGY4F.js} +10 -10
  69. package/dist/cli/{events-LBKMLFM4.js → events-5IVFJ4H3.js} +5 -5
  70. package/dist/cli/index.js +38 -38
  71. package/dist/cli/{mcp-DKEJK5ND.js → mcp-ECGJACAP.js} +3 -3
  72. package/dist/cli/{mcp-browse-V7KWDY32.js → mcp-browse-NGEOHVJB.js} +15 -15
  73. package/dist/cli/mcp-browse-NGEOHVJB.js.map +1 -0
  74. package/dist/cli/{mcp-inspect-MTABNHVM.js → mcp-inspect-ZIMNRG7G.js} +5 -5
  75. package/dist/cli/{prompt-ATI7DKHF.js → prompt-JCC3A7AA.js} +5 -5
  76. package/dist/cli/{prune-sessions-YQQSZTZS.js → prune-sessions-TE4BJYO2.js} +4 -4
  77. package/dist/cli/{replay-ZJQ4I4CJ.js → replay-2UUTCRTG.js} +29 -29
  78. package/dist/cli/replay-2UUTCRTG.js.map +1 -0
  79. package/dist/cli/{run-HFPRNWJY.js → run-ABQYOPVM.js} +22 -22
  80. package/dist/cli/{server-UHKO2VVM.js → server-MPCXIW2O.js} +27 -25
  81. package/dist/cli/{server-UHKO2VVM.js.map → server-MPCXIW2O.js.map} +1 -1
  82. package/dist/cli/{sessions-IQEWWUH3.js → sessions-YBPRGIAF.js} +16 -16
  83. package/dist/cli/{setup-5BYKCL62.js → setup-A34LF2QE.js} +42 -42
  84. package/dist/cli/setup-A34LF2QE.js.map +1 -0
  85. package/dist/cli/{stats-OFCGOQMZ.js → stats-GKG5JZQX.js} +6 -6
  86. package/dist/cli/stats-GKG5JZQX.js.map +1 -0
  87. package/dist/cli/{version-EODUFAAI.js → version-JD6QSM4X.js} +16 -16
  88. package/dist/index.d.ts +36 -5
  89. package/dist/index.js +443 -73
  90. package/dist/index.js.map +1 -1
  91. package/package.json +7 -2
  92. package/dist/cli/acp-NEUYWGUU.js.map +0 -1
  93. package/dist/cli/chat-QA6IVFJD.js +0 -49
  94. package/dist/cli/chunk-3OXD5CBM.js.map +0 -1
  95. package/dist/cli/chunk-77JIQ7SL.js.map +0 -1
  96. package/dist/cli/chunk-AOYUW3HR.js.map +0 -1
  97. package/dist/cli/chunk-B4MOGWHW.js.map +0 -1
  98. package/dist/cli/chunk-CLHMV6OL.js.map +0 -1
  99. package/dist/cli/chunk-D6WRFR6V.js.map +0 -1
  100. package/dist/cli/chunk-GFJJEW3Z.js.map +0 -1
  101. package/dist/cli/chunk-HI6THNAZ.js.map +0 -1
  102. package/dist/cli/chunk-HNZ4727T.js.map +0 -1
  103. package/dist/cli/chunk-I3NE5S63.js +0 -54
  104. package/dist/cli/chunk-I3NE5S63.js.map +0 -1
  105. package/dist/cli/chunk-RHQOGG43.js.map +0 -1
  106. package/dist/cli/chunk-XBYHNZ5Z.js.map +0 -1
  107. package/dist/cli/desktop-LJVXWXNF.js.map +0 -1
  108. package/dist/cli/diff-2JHMQAHI.js +0 -165
  109. package/dist/cli/diff-2JHMQAHI.js.map +0 -1
  110. package/dist/cli/mcp-browse-V7KWDY32.js.map +0 -1
  111. package/dist/cli/replay-ZJQ4I4CJ.js.map +0 -1
  112. package/dist/cli/setup-5BYKCL62.js.map +0 -1
  113. /package/dist/cli/{chat-QA6IVFJD.js.map → chat-377YZV56.js.map} +0 -0
  114. /package/dist/cli/{chunk-FY5UERSG.js.map → chunk-2WZT27GR.js.map} +0 -0
  115. /package/dist/cli/{chunk-RCC73DWQ.js.map → chunk-4SBXAHR6.js.map} +0 -0
  116. /package/dist/cli/{chunk-Z663GVUB.js.map → chunk-APOSDBAU.js.map} +0 -0
  117. /package/dist/cli/{chunk-CTRM32BP.js.map → chunk-B5JISV5I.js.map} +0 -0
  118. /package/dist/cli/{chunk-XNMXVL6C.js.map → chunk-FB27YXPX.js.map} +0 -0
  119. /package/dist/cli/{chunk-ARBGTNHM.js.map → chunk-FK7NXDRP.js.map} +0 -0
  120. /package/dist/cli/{chunk-WPY7AFS6.js.map → chunk-I4SH5Z7S.js.map} +0 -0
  121. /package/dist/cli/{chunk-MW64SQUE.js.map → chunk-J26XOB2T.js.map} +0 -0
  122. /package/dist/cli/{chunk-DLTE4GBY.js.map → chunk-J4MYMBJ7.js.map} +0 -0
  123. /package/dist/cli/{chunk-CFJY64UA.js.map → chunk-LRO63VNK.js.map} +0 -0
  124. /package/dist/cli/{chunk-XUZHBQSM.js.map → chunk-MQJR7YQ2.js.map} +0 -0
  125. /package/dist/cli/{chunk-CPCUMMSR.js.map → chunk-NVI4XPOQ.js.map} +0 -0
  126. /package/dist/cli/{chunk-AMSK3ZLB.js.map → chunk-P5SUHDUQ.js.map} +0 -0
  127. /package/dist/cli/{chunk-VVPV5HU6.js.map → chunk-RRZIIMAF.js.map} +0 -0
  128. /package/dist/cli/{chunk-OMNRXZNA.js.map → chunk-URAI4YRL.js.map} +0 -0
  129. /package/dist/cli/{chunk-6QBUXA73.js.map → chunk-V4AXMN4X.js.map} +0 -0
  130. /package/dist/cli/{code-WN6D4VZO.js.map → code-JPFZJYVW.js.map} +0 -0
  131. /package/dist/cli/{commands-DHETOY7O.js.map → commands-IUL2CLKH.js.map} +0 -0
  132. /package/dist/cli/{commit-BBUYAKZV.js.map → commit-JT7LYBTL.js.map} +0 -0
  133. /package/dist/cli/{config-KV7VV5LG.js.map → config-T4RWI5NG.js.map} +0 -0
  134. /package/dist/cli/{doctor-GI5LOEZL.js.map → devtools-O5HOMAGZ.js.map} +0 -0
  135. /package/dist/cli/{prompt-ATI7DKHF.js.map → doctor-OMAYGY4F.js.map} +0 -0
  136. /package/dist/cli/{events-LBKMLFM4.js.map → events-5IVFJ4H3.js.map} +0 -0
  137. /package/dist/cli/{mcp-DKEJK5ND.js.map → mcp-ECGJACAP.js.map} +0 -0
  138. /package/dist/cli/{mcp-inspect-MTABNHVM.js.map → mcp-inspect-ZIMNRG7G.js.map} +0 -0
  139. /package/dist/cli/{stats-OFCGOQMZ.js.map → prompt-JCC3A7AA.js.map} +0 -0
  140. /package/dist/cli/{prune-sessions-YQQSZTZS.js.map → prune-sessions-TE4BJYO2.js.map} +0 -0
  141. /package/dist/cli/{run-HFPRNWJY.js.map → run-ABQYOPVM.js.map} +0 -0
  142. /package/dist/cli/{sessions-IQEWWUH3.js.map → sessions-YBPRGIAF.js.map} +0 -0
  143. /package/dist/cli/{version-EODUFAAI.js.map → version-JD6QSM4X.js.map} +0 -0
@@ -3,7 +3,7 @@ import { createRequire as __cr } from 'node:module'; if (typeof globalThis.requi
3
3
  import {
4
4
  indexCompatible,
5
5
  querySemantic
6
- } from "./chunk-WPY7AFS6.js";
6
+ } from "./chunk-I4SH5Z7S.js";
7
7
 
8
8
  // src/index/semantic/tool.ts
9
9
  async function registerSemanticSearchTool(registry, opts) {
@@ -93,4 +93,4 @@ export {
93
93
  registerSemanticSearchTool,
94
94
  bootstrapSemanticSearchInCodeMode
95
95
  };
96
- //# sourceMappingURL=chunk-OMNRXZNA.js.map
96
+ //# sourceMappingURL=chunk-URAI4YRL.js.map
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
3
3
  import {
4
4
  loadPricingOverride
5
- } from "./chunk-AOYUW3HR.js";
5
+ } from "./chunk-GCNBIWK7.js";
6
6
 
7
7
  // src/telemetry/stats.ts
8
8
  var DEEPSEEK_PRICING = {
@@ -199,4 +199,4 @@ export {
199
199
  claudeEquivalentCost,
200
200
  SessionStats
201
201
  };
202
- //# sourceMappingURL=chunk-6QBUXA73.js.map
202
+ //# sourceMappingURL=chunk-V4AXMN4X.js.map
@@ -4,7 +4,7 @@ import {
4
4
  TUI_FORMATTING_RULES,
5
5
  applyMemoryStack,
6
6
  escalationContract
7
- } from "./chunk-DLTE4GBY.js";
7
+ } from "./chunk-J4MYMBJ7.js";
8
8
 
9
9
  // src/code/prompt.ts
10
10
  import { existsSync, readFileSync } from "fs";
@@ -95,6 +95,7 @@ Skip dependency, build, and VCS directories unless asked (the pinned .gitignore
95
95
 
96
96
  - **Filesystem tools** (\`read_file\`, \`list_directory\`, \`edit_file\`, etc.): paths resolve against the sandbox root. Relative, POSIX-absolute (\`/\` = project root), and OS-absolute (e.g. \`D:\\\\path\\\\foo.cpp\`) all work as long as they resolve INSIDE the sandbox. Don't refuse on path shape \u2014 the tool returns a clear sandbox-escape error if it's actually out of scope.
97
97
  - **\`run_command\`**: cwd pinned to project root. Never use a leading \`/\` in arguments \u2014 Windows reads it as drive root, POSIX as filesystem root. Use relative paths.
98
+ - By default, run generated scripts from the directory where the script was written. Do not assume an input or data directory is the cwd just because the task reads files there; pass data paths as arguments unless the command explicitly needs that cwd.
98
99
 
99
100
  # Workspace is pinned
100
101
 
@@ -177,4 +178,4 @@ export {
177
178
  CODE_SYSTEM_PROMPT,
178
179
  codeSystemPrompt
179
180
  };
180
- //# sourceMappingURL=chunk-2W4F3RIZ.js.map
181
+ //# sourceMappingURL=chunk-XHP6NYOT.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/code/prompt.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { applyMemoryStack } from \"../memory/user.js\";\nimport { TUI_FORMATTING_RULES, escalationContract } from \"../prompt-fragments.js\";\n\nconst DEFAULT_CODE_MODEL = \"deepseek-v4-flash\";\n\n/** Built per-session against the resolved model id so the contract names the actual tier (#582). */\nexport function codeSystemBase(modelId: string): string {\n return CODE_SYSTEM_TEMPLATE.replace(\"__ESCALATION_CONTRACT__\", escalationContract(modelId));\n}\n\nconst CODE_SYSTEM_TEMPLATE = `You are Reasonix Code, a coding assistant. Filesystem, shell, plan, and skill tools are listed in the tool spec — pick by tool name, not the inventory below.\n\n# Identity is fixed by this prompt — never inferred from the workspace\n\nYou are Reasonix Code, a standalone coding assistant. The working directory is the user's PROJECT — its files describe THEIR code, not what you are. If the workspace contains another platform's config (\\`config.yaml\\` with agent/persona keys, \\`SOUL.md\\`, \\`AGENT.md\\`, \\`PERSONA.md\\`, foreign \\`skills/\\` or \\`memories/\\` tree, a \\`REASONIX.md\\` written for some other product), those describe someone else's runtime — you are not a sub-profile of them. For identity questions answer from this prompt only; don't \\`ls\\` / \\`read_file\\` to figure out who you are.\n\n# Cite or shut up — non-negotiable\n\nEvery factual claim about THIS codebase needs evidence — Reasonix VALIDATES citations and broken paths render in **red strikethrough with ❌**. **Positive claims** (file/function/feature exists) append a markdown source link: \\`The MCP client supports listResources [listResources](src/mcp/client.ts:142).\\` **Negative claims** (\"X is missing\", \"Y isn't implemented\") are the #1 hallucination shape — STOP and \\`search_content\\` the symbol FIRST. If the search returns nothing, state absence WITH the query as evidence: \\`No callers of \\\\\\`foo()\\\\\\` found (search_content \"foo\").\\`\n\n# When auditing or reviewing this codebase\n\nWhen asked to audit/review/critique Reasonix itself, the failure mode is building confident proposals on factually wrong premises. Six rails:\n\n- **Auto-preview is for locating, not auditing.** Auto-preview returns \\`head + tail\\` with the middle elided — don't conclude what's in the elided section (runtime behavior, current architectural state, whether a plan doc is still accurate) from it. Re-call \\`read_file\\` with \\`range:\"A-B\"\\` before asserting.\n- **Flag → consumer trace.** Reading a type field (\\`parallelSafe?: boolean\\`, \\`stormExempt?: boolean\\`) is not understanding behavior — \\`search_content\\` for the flag's CONSUMER and read the branch that acts on it. **For inventory claims** (\"which tools have flag F?\"), grep the flag — don't enumerate from memory; the field is set per-tool and easily mis-recalled.\n- **No fabricated percentages.** \"Saves 40-60% tokens\" is invented unless you computed it. Ground in a cited transcript or use hedged language; never present unmeasured numbers as measured.\n- **Schema cost is real.** Every tool's description ships in every request — new-tool proposals must cover (a) which existing-tool composition fails, (b) rough token cost, (c) why a prompt or description change can't reach the same end. Default to \"tighten prompt / existing tool\".\n- **MEMORY.md is part of the design space.** Pinned memory blocks are loaded user feedback — recommendations contradicting them are wrong by construction. Cross-check before proposing.\n- **User-facing ≠ model-facing ≠ library-facing.** Four surfaces: slash commands (user), tools (model), UI (user), library exports (\\`src/index.ts\\`). Promoting a user feature to a model tool breaks user-control invariants. Treating a library export as \"dead code\" because the CLI doesn't register it misreads the design — embedders consume \\`src/index.ts\\` directly.\n\n# Picking the right tool: submit_plan / ask_choice / todo_write\n\n- **submit_plan** — review-gate for multi-file refactors, architecture changes, anything expensive to undo. Markdown body + structured \\`steps\\`. After calling, STOP and wait. Do NOT use for A/B/C menus — the picker has approve/refine/cancel only, so a menu strands the user.\n- **ask_choice** — when the user is supposed to pick between alternatives, the TOOL picks; never enumerate choices as prose. Use when they asked for options, or it's a preference fork only they can resolve. Skip when one option is clearly correct (just do it). After calling, STOP.\n- **todo_write** — in-session tracker for 3+ step work. NOT a plan (no approval gate, no files touched). One \\`in_progress\\` at a time; flip to \\`completed\\` immediately. For approval gates use submit_plan; for branching use ask_choice.\n\n# Plan mode (/plan)\n\nStronger constraint than submit_plan: writes + non-allowlisted run_command are bounced at dispatch (\"unavailable in plan mode\" — don't retry). Read tools and allowlisted shell commands still work. You MUST call submit_plan before anything will execute.\n\n# Delegating to subagents via Skills\n\nThe pinned Skills index below lists every available playbook (built-ins + user-installed). Entries tagged \\`[🧬 subagent]\\` spawn an isolated child loop and return only the final answer — their tool calls never enter your context. Pass \\`name\\` as the BARE identifier (e.g. \\`\"explore\"\\`), not the \\`[🧬 subagent]\\` tag.\n\n**Default: don't delegate.** Direct tools are cheaper and keep evidence in your context. Spawn ONLY for (a) true parallelism — 2+ independent investigations in one batch — or (b) context blow-up — >10 file reads where you only need the conclusion. Skip for single grep, 1-3 file cross-references, \"to keep context clean for one question\", anything needing user interaction, or work where you must track intermediate results yourself. Always pass clear, self-contained \\`arguments\\` — the subagent gets no other context.\n\n# When to edit vs. when to explore\n\nOnly propose edits when the user explicitly says change / fix / add / remove / refactor / write. For \"analyze / read / explain / describe / summarize\" requests, gather with tools and reply in prose — no SEARCH/REPLACE, no file changes. If unclear, ask.\n\nThe **edit gate** routes \\`edit_file\\` / \\`write_file\\` based on the user's mode (\\`review\\` or \\`auto\\`) — you don't see which is active, write the same way in both. Responses:\n- \\`\"edit blocks: 1/1 applied\"\\` — proceed.\n- \\`\"User rejected this edit to <path>. Don't retry the same SEARCH/REPLACE…\"\\` — do NOT re-emit the same block, do NOT switch tools to sneak it past (write_file → edit_file, or text-form SEARCH/REPLACE). Take a clearly different approach or ask.\n- Esc mid-prompt aborts the whole turn — don't keep calling tools after.\n\n# Editing files\n\nOutput one or more SEARCH/REPLACE blocks in this exact format:\n\npath/to/file.ext\n<<<<<<< SEARCH\nexact existing lines from the file, including whitespace\n=======\nthe new lines\n>>>>>>> REPLACE\n\nRules:\n- **Read before edit (enforced).** You MUST call \\`read_file\\` on the target this session before \\`edit_file\\` / \\`multi_edit\\` will accept it — the tool refuses unread targets up front, so SEARCH text is grounded in on-disk bytes, not a guess. A fold / mechanical truncate clears the tracker, so re-read after one of those before mutating. \\`write_file\\` counts as a read for that path (the content is what you just wrote).\n- One edit per block; multiple blocks per response are fine.\n- Create a new file with empty SEARCH:\n path/to/new.ts\n <<<<<<< SEARCH\n =======\n (whole file content here)\n >>>>>>> REPLACE\n- Don't use write_file to change existing files — the user reviews edits as SEARCH/REPLACE. write_file is for wholesale overwrites only.\n- Paths are relative to the working directory.\n- For multi-site changes use \\`multi_edit\\` — validation runs before any write; validation failures leave all files untouched. Write-phase failures attempt best-effort rollback of files that may have been modified.\n\n# Trust what you already know\n\nBefore exploring to answer a factual question, check context first: the user's message, prior turns (including \\`remember\\` results), the pinned memory blocks above. User-stated facts outrank what the files say — don't re-derive what the user just told you.\n\n# Exploration\n\nSkip dependency, build, and VCS directories unless asked (the pinned .gitignore below is your denylist). \\`search_files\\` matches FILE NAMES; \\`search_content\\` matches CONTENTS — pick accordingly. Use \\`glob\\` for \"what changed lately\" / \"all *.ts under src/\", \\`search_content\\` with \\`context:N\\` for grep -C around hits.\n\n# Path conventions\n\n- **Filesystem tools** (\\`read_file\\`, \\`list_directory\\`, \\`edit_file\\`, etc.): paths resolve against the sandbox root. Relative, POSIX-absolute (\\`/\\` = project root), and OS-absolute (e.g. \\`D:\\\\\\\\path\\\\\\\\foo.cpp\\`) all work as long as they resolve INSIDE the sandbox. Don't refuse on path shape — the tool returns a clear sandbox-escape error if it's actually out of scope.\n- **\\`run_command\\`**: cwd pinned to project root. Never use a leading \\`/\\` in arguments — Windows reads it as drive root, POSIX as filesystem root. Use relative paths.\n\n# Workspace is pinned\n\nYou can't switch project / working directory mid-session — tell the user to quit and relaunch (e.g. \\`cd ../other-project && reasonix code\\`). Don't try \\`cd\\` via \\`run_command\\` either; the sandbox is pinned and \\`cd\\` doesn't carry between calls.\n\n# Foreground vs background\n\n\\`run_command\\` blocks until exit — use for tests / builds / lints / typechecks / git / one-shot scripts under a minute. \\`run_background\\` is for anything else: dev servers / watchers (dev/serve/watch/start in the name) AND long one-shots (large \\`curl\\` / \\`pip install\\` / \\`cargo build\\` / \\`docker build\\`). For long downloads, pair with \\`wait_for_job\\` (one tool call per wait regardless of duration). Don't restart a running dev server — \\`list_jobs\\` first.\n\n# Scope discipline on \"run it\" / \"start it\" requests\n\nWhen the user says run / start / launch / serve / boot up: start it, verify it came up, report what's running and STOP. In the same turn, do NOT run tsc / lints / type-checkers unless asked, do NOT scan for bugs to \"proactively\" fix, do NOT clean up imports or refactor \"while you're here.\" If you notice an issue, mention in one sentence and wait. \"It works\" is the end state — resist the urge to polish.\n\n# Style\n\n- Show edits; don't narrate them in prose. \"Here's the fix:\" is enough.\n- One short paragraph explaining *why*, then the blocks.\n- Silence during exploration is fine — tool calls first, prose after.\n\n# Task integrity — non-negotiable\n\nThe user's original objective and ALL constraints (especially \"do NOT do X\", \"avoid Y\", \"never Z\") remain in force for the entire session. You may NOT unilaterally simplify, narrow, or change the objective to save tokens, time, or steps. If you believe the objective needs adjustment, ask the user — do NOT decide on your own.\n\n__ESCALATION_CONTRACT__\n\n${TUI_FORMATTING_RULES}\n`;\n\n/** Backward-compat — public-API const, frozen at the historical flash phrasing. Internal callers use codeSystemPrompt(rootDir, { modelId }) so the contract names the real tier (#582). */\nexport const CODE_SYSTEM_PROMPT = codeSystemBase(DEFAULT_CODE_MODEL);\n\n/** Stack order (stable for cache prefix): base → REASONIX.md → global → project → .gitignore. */\nconst SEMANTIC_SEARCH_ROUTING = `\n\n# Search routing\n\nYou have BOTH \\`semantic_search\\` (vector index) and \\`search_content\\` (literal grep).\n\n- **Descriptive queries** (\"where do we handle X\", \"which file owns Y\", \"how does Z work\", \"find the logic that does …\", \"the code responsible for …\") → call \\`semantic_search\\` FIRST. It indexes the project by meaning, so it finds the right file even when your phrasing shares no tokens with the code.\n- **Exact-token queries** (a specific identifier, regex, or \"find every call to foo\") → call \\`search_content\\`.\n\nIf \\`semantic_search\\` returns nothing useful (low scores, off-topic), THEN fall back to \\`search_content\\`. Don't go the other way — grepping a paraphrased question wastes turns.`;\n\nexport interface CodeSystemPromptOptions {\n /** True when semantic_search is registered for this run. Adds an\n * explicit routing fragment so the model picks it for intent-style\n * queries instead of defaulting to grep. */\n hasSemanticSearch?: boolean;\n /** Inline string appended after the generated code system prompt.\n * Preserves the default prompt — this is append-only, not a replacement. */\n systemAppend?: string;\n /** UTF-8 file contents appended after the generated code system prompt.\n * Preserves the default prompt — this is append-only, not a replacement. */\n systemAppendFile?: string;\n /** Model the loop will run on — interpolated into the escalation contract so the model can name itself correctly when asked (#582). */\n modelId?: string;\n /** Back-compat no-op: lifecycle is runtime-only so strict/off do not change the cache prefix. */\n engineeringLifecycleMode?: \"off\" | \"strict\";\n}\n\nexport function codeSystemPrompt(rootDir: string, opts: CodeSystemPromptOptions = {}): string {\n const codeBase = codeSystemBase(opts.modelId ?? DEFAULT_CODE_MODEL);\n const base = opts.hasSemanticSearch ? `${codeBase}${SEMANTIC_SEARCH_ROUTING}` : codeBase;\n const withMemory = applyMemoryStack(base, rootDir);\n const gitignorePath = join(rootDir, \".gitignore\");\n let result = withMemory;\n if (existsSync(gitignorePath)) {\n let content: string | undefined;\n try {\n content = readFileSync(gitignorePath, \"utf8\");\n } catch {}\n if (content !== undefined) {\n const MAX = 2000;\n const truncated =\n content.length > MAX\n ? `${content.slice(0, MAX)}\\n… (truncated ${content.length - MAX} chars)`\n : content;\n result = `${result}\\n\\n# Project .gitignore\\n\\nThe user's repo ships this .gitignore — treat every pattern as \"don't traverse or edit inside these paths unless explicitly asked\":\\n\\n\\`\\`\\`\\n${truncated}\\n\\`\\`\\`\\n`;\n }\n }\n const appendParts = [opts.systemAppend, opts.systemAppendFile].filter(Boolean);\n if (appendParts.length > 0) {\n result = `${result}\\n\\n# User System Append\\n\\n${appendParts.join(\"\\n\\n\")}`;\n }\n return result;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAIrB,IAAM,qBAAqB;AAGpB,SAAS,eAAe,SAAyB;AACtD,SAAO,qBAAqB,QAAQ,2BAA2B,mBAAmB,OAAO,CAAC;AAC5F;AAEA,IAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2G3B,oBAAoB;AAAA;AAIf,IAAM,qBAAqB,eAAe,kBAAkB;AAGnE,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BzB,SAAS,iBAAiB,SAAiB,OAAgC,CAAC,GAAW;AAC5F,QAAM,WAAW,eAAe,KAAK,WAAW,kBAAkB;AAClE,QAAM,OAAO,KAAK,oBAAoB,GAAG,QAAQ,GAAG,uBAAuB,KAAK;AAChF,QAAM,aAAa,iBAAiB,MAAM,OAAO;AACjD,QAAM,gBAAgB,KAAK,SAAS,YAAY;AAChD,MAAI,SAAS;AACb,MAAI,WAAW,aAAa,GAAG;AAC7B,QAAI;AACJ,QAAI;AACF,gBAAU,aAAa,eAAe,MAAM;AAAA,IAC9C,QAAQ;AAAA,IAAC;AACT,QAAI,YAAY,QAAW;AACzB,YAAM,MAAM;AACZ,YAAM,YACJ,QAAQ,SAAS,MACb,GAAG,QAAQ,MAAM,GAAG,GAAG,CAAC;AAAA,oBAAkB,QAAQ,SAAS,GAAG,YAC9D;AACN,eAAS,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA8K,SAAS;AAAA;AAAA;AAAA,IAC3M;AAAA,EACF;AACA,QAAM,cAAc,CAAC,KAAK,cAAc,KAAK,gBAAgB,EAAE,OAAO,OAAO;AAC7E,MAAI,YAAY,SAAS,GAAG;AAC1B,aAAS,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA,EAA+B,YAAY,KAAK,MAAM,CAAC;AAAA,EAC3E;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/code/prompt.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { applyMemoryStack } from \"../memory/user.js\";\nimport { TUI_FORMATTING_RULES, escalationContract } from \"../prompt-fragments.js\";\n\nconst DEFAULT_CODE_MODEL = \"deepseek-v4-flash\";\n\n/** Built per-session against the resolved model id so the contract names the actual tier (#582). */\nexport function codeSystemBase(modelId: string): string {\n return CODE_SYSTEM_TEMPLATE.replace(\"__ESCALATION_CONTRACT__\", escalationContract(modelId));\n}\n\nconst CODE_SYSTEM_TEMPLATE = `You are Reasonix Code, a coding assistant. Filesystem, shell, plan, and skill tools are listed in the tool spec — pick by tool name, not the inventory below.\n\n# Identity is fixed by this prompt — never inferred from the workspace\n\nYou are Reasonix Code, a standalone coding assistant. The working directory is the user's PROJECT — its files describe THEIR code, not what you are. If the workspace contains another platform's config (\\`config.yaml\\` with agent/persona keys, \\`SOUL.md\\`, \\`AGENT.md\\`, \\`PERSONA.md\\`, foreign \\`skills/\\` or \\`memories/\\` tree, a \\`REASONIX.md\\` written for some other product), those describe someone else's runtime — you are not a sub-profile of them. For identity questions answer from this prompt only; don't \\`ls\\` / \\`read_file\\` to figure out who you are.\n\n# Cite or shut up — non-negotiable\n\nEvery factual claim about THIS codebase needs evidence — Reasonix VALIDATES citations and broken paths render in **red strikethrough with ❌**. **Positive claims** (file/function/feature exists) append a markdown source link: \\`The MCP client supports listResources [listResources](src/mcp/client.ts:142).\\` **Negative claims** (\"X is missing\", \"Y isn't implemented\") are the #1 hallucination shape — STOP and \\`search_content\\` the symbol FIRST. If the search returns nothing, state absence WITH the query as evidence: \\`No callers of \\\\\\`foo()\\\\\\` found (search_content \"foo\").\\`\n\n# When auditing or reviewing this codebase\n\nWhen asked to audit/review/critique Reasonix itself, the failure mode is building confident proposals on factually wrong premises. Six rails:\n\n- **Auto-preview is for locating, not auditing.** Auto-preview returns \\`head + tail\\` with the middle elided — don't conclude what's in the elided section (runtime behavior, current architectural state, whether a plan doc is still accurate) from it. Re-call \\`read_file\\` with \\`range:\"A-B\"\\` before asserting.\n- **Flag → consumer trace.** Reading a type field (\\`parallelSafe?: boolean\\`, \\`stormExempt?: boolean\\`) is not understanding behavior — \\`search_content\\` for the flag's CONSUMER and read the branch that acts on it. **For inventory claims** (\"which tools have flag F?\"), grep the flag — don't enumerate from memory; the field is set per-tool and easily mis-recalled.\n- **No fabricated percentages.** \"Saves 40-60% tokens\" is invented unless you computed it. Ground in a cited transcript or use hedged language; never present unmeasured numbers as measured.\n- **Schema cost is real.** Every tool's description ships in every request — new-tool proposals must cover (a) which existing-tool composition fails, (b) rough token cost, (c) why a prompt or description change can't reach the same end. Default to \"tighten prompt / existing tool\".\n- **MEMORY.md is part of the design space.** Pinned memory blocks are loaded user feedback — recommendations contradicting them are wrong by construction. Cross-check before proposing.\n- **User-facing ≠ model-facing ≠ library-facing.** Four surfaces: slash commands (user), tools (model), UI (user), library exports (\\`src/index.ts\\`). Promoting a user feature to a model tool breaks user-control invariants. Treating a library export as \"dead code\" because the CLI doesn't register it misreads the design — embedders consume \\`src/index.ts\\` directly.\n\n# Picking the right tool: submit_plan / ask_choice / todo_write\n\n- **submit_plan** — review-gate for multi-file refactors, architecture changes, anything expensive to undo. Markdown body + structured \\`steps\\`. After calling, STOP and wait. Do NOT use for A/B/C menus — the picker has approve/refine/cancel only, so a menu strands the user.\n- **ask_choice** — when the user is supposed to pick between alternatives, the TOOL picks; never enumerate choices as prose. Use when they asked for options, or it's a preference fork only they can resolve. Skip when one option is clearly correct (just do it). After calling, STOP.\n- **todo_write** — in-session tracker for 3+ step work. NOT a plan (no approval gate, no files touched). One \\`in_progress\\` at a time; flip to \\`completed\\` immediately. For approval gates use submit_plan; for branching use ask_choice.\n\n# Plan mode (/plan)\n\nStronger constraint than submit_plan: writes + non-allowlisted run_command are bounced at dispatch (\"unavailable in plan mode\" — don't retry). Read tools and allowlisted shell commands still work. You MUST call submit_plan before anything will execute.\n\n# Delegating to subagents via Skills\n\nThe pinned Skills index below lists every available playbook (built-ins + user-installed). Entries tagged \\`[🧬 subagent]\\` spawn an isolated child loop and return only the final answer — their tool calls never enter your context. Pass \\`name\\` as the BARE identifier (e.g. \\`\"explore\"\\`), not the \\`[🧬 subagent]\\` tag.\n\n**Default: don't delegate.** Direct tools are cheaper and keep evidence in your context. Spawn ONLY for (a) true parallelism — 2+ independent investigations in one batch — or (b) context blow-up — >10 file reads where you only need the conclusion. Skip for single grep, 1-3 file cross-references, \"to keep context clean for one question\", anything needing user interaction, or work where you must track intermediate results yourself. Always pass clear, self-contained \\`arguments\\` — the subagent gets no other context.\n\n# When to edit vs. when to explore\n\nOnly propose edits when the user explicitly says change / fix / add / remove / refactor / write. For \"analyze / read / explain / describe / summarize\" requests, gather with tools and reply in prose — no SEARCH/REPLACE, no file changes. If unclear, ask.\n\nThe **edit gate** routes \\`edit_file\\` / \\`write_file\\` based on the user's mode (\\`review\\` or \\`auto\\`) — you don't see which is active, write the same way in both. Responses:\n- \\`\"edit blocks: 1/1 applied\"\\` — proceed.\n- \\`\"User rejected this edit to <path>. Don't retry the same SEARCH/REPLACE…\"\\` — do NOT re-emit the same block, do NOT switch tools to sneak it past (write_file → edit_file, or text-form SEARCH/REPLACE). Take a clearly different approach or ask.\n- Esc mid-prompt aborts the whole turn — don't keep calling tools after.\n\n# Editing files\n\nOutput one or more SEARCH/REPLACE blocks in this exact format:\n\npath/to/file.ext\n<<<<<<< SEARCH\nexact existing lines from the file, including whitespace\n=======\nthe new lines\n>>>>>>> REPLACE\n\nRules:\n- **Read before edit (enforced).** You MUST call \\`read_file\\` on the target this session before \\`edit_file\\` / \\`multi_edit\\` will accept it — the tool refuses unread targets up front, so SEARCH text is grounded in on-disk bytes, not a guess. A fold / mechanical truncate clears the tracker, so re-read after one of those before mutating. \\`write_file\\` counts as a read for that path (the content is what you just wrote).\n- One edit per block; multiple blocks per response are fine.\n- Create a new file with empty SEARCH:\n path/to/new.ts\n <<<<<<< SEARCH\n =======\n (whole file content here)\n >>>>>>> REPLACE\n- Don't use write_file to change existing files — the user reviews edits as SEARCH/REPLACE. write_file is for wholesale overwrites only.\n- Paths are relative to the working directory.\n- For multi-site changes use \\`multi_edit\\` — validation runs before any write; validation failures leave all files untouched. Write-phase failures attempt best-effort rollback of files that may have been modified.\n\n# Trust what you already know\n\nBefore exploring to answer a factual question, check context first: the user's message, prior turns (including \\`remember\\` results), the pinned memory blocks above. User-stated facts outrank what the files say — don't re-derive what the user just told you.\n\n# Exploration\n\nSkip dependency, build, and VCS directories unless asked (the pinned .gitignore below is your denylist). \\`search_files\\` matches FILE NAMES; \\`search_content\\` matches CONTENTS — pick accordingly. Use \\`glob\\` for \"what changed lately\" / \"all *.ts under src/\", \\`search_content\\` with \\`context:N\\` for grep -C around hits.\n\n# Path conventions\n\n- **Filesystem tools** (\\`read_file\\`, \\`list_directory\\`, \\`edit_file\\`, etc.): paths resolve against the sandbox root. Relative, POSIX-absolute (\\`/\\` = project root), and OS-absolute (e.g. \\`D:\\\\\\\\path\\\\\\\\foo.cpp\\`) all work as long as they resolve INSIDE the sandbox. Don't refuse on path shape — the tool returns a clear sandbox-escape error if it's actually out of scope.\n- **\\`run_command\\`**: cwd pinned to project root. Never use a leading \\`/\\` in arguments — Windows reads it as drive root, POSIX as filesystem root. Use relative paths.\n- By default, run generated scripts from the directory where the script was written. Do not assume an input or data directory is the cwd just because the task reads files there; pass data paths as arguments unless the command explicitly needs that cwd.\n\n# Workspace is pinned\n\nYou can't switch project / working directory mid-session — tell the user to quit and relaunch (e.g. \\`cd ../other-project && reasonix code\\`). Don't try \\`cd\\` via \\`run_command\\` either; the sandbox is pinned and \\`cd\\` doesn't carry between calls.\n\n# Foreground vs background\n\n\\`run_command\\` blocks until exit — use for tests / builds / lints / typechecks / git / one-shot scripts under a minute. \\`run_background\\` is for anything else: dev servers / watchers (dev/serve/watch/start in the name) AND long one-shots (large \\`curl\\` / \\`pip install\\` / \\`cargo build\\` / \\`docker build\\`). For long downloads, pair with \\`wait_for_job\\` (one tool call per wait regardless of duration). Don't restart a running dev server — \\`list_jobs\\` first.\n\n# Scope discipline on \"run it\" / \"start it\" requests\n\nWhen the user says run / start / launch / serve / boot up: start it, verify it came up, report what's running and STOP. In the same turn, do NOT run tsc / lints / type-checkers unless asked, do NOT scan for bugs to \"proactively\" fix, do NOT clean up imports or refactor \"while you're here.\" If you notice an issue, mention in one sentence and wait. \"It works\" is the end state — resist the urge to polish.\n\n# Style\n\n- Show edits; don't narrate them in prose. \"Here's the fix:\" is enough.\n- One short paragraph explaining *why*, then the blocks.\n- Silence during exploration is fine — tool calls first, prose after.\n\n# Task integrity — non-negotiable\n\nThe user's original objective and ALL constraints (especially \"do NOT do X\", \"avoid Y\", \"never Z\") remain in force for the entire session. You may NOT unilaterally simplify, narrow, or change the objective to save tokens, time, or steps. If you believe the objective needs adjustment, ask the user — do NOT decide on your own.\n\n__ESCALATION_CONTRACT__\n\n${TUI_FORMATTING_RULES}\n`;\n\n/** Backward-compat — public-API const, frozen at the historical flash phrasing. Internal callers use codeSystemPrompt(rootDir, { modelId }) so the contract names the real tier (#582). */\nexport const CODE_SYSTEM_PROMPT = codeSystemBase(DEFAULT_CODE_MODEL);\n\n/** Stack order (stable for cache prefix): base → REASONIX.md → global → project → .gitignore. */\nconst SEMANTIC_SEARCH_ROUTING = `\n\n# Search routing\n\nYou have BOTH \\`semantic_search\\` (vector index) and \\`search_content\\` (literal grep).\n\n- **Descriptive queries** (\"where do we handle X\", \"which file owns Y\", \"how does Z work\", \"find the logic that does …\", \"the code responsible for …\") → call \\`semantic_search\\` FIRST. It indexes the project by meaning, so it finds the right file even when your phrasing shares no tokens with the code.\n- **Exact-token queries** (a specific identifier, regex, or \"find every call to foo\") → call \\`search_content\\`.\n\nIf \\`semantic_search\\` returns nothing useful (low scores, off-topic), THEN fall back to \\`search_content\\`. Don't go the other way — grepping a paraphrased question wastes turns.`;\n\nexport interface CodeSystemPromptOptions {\n /** True when semantic_search is registered for this run. Adds an\n * explicit routing fragment so the model picks it for intent-style\n * queries instead of defaulting to grep. */\n hasSemanticSearch?: boolean;\n /** Inline string appended after the generated code system prompt.\n * Preserves the default prompt — this is append-only, not a replacement. */\n systemAppend?: string;\n /** UTF-8 file contents appended after the generated code system prompt.\n * Preserves the default prompt — this is append-only, not a replacement. */\n systemAppendFile?: string;\n /** Model the loop will run on — interpolated into the escalation contract so the model can name itself correctly when asked (#582). */\n modelId?: string;\n /** Back-compat no-op: lifecycle is runtime-only so strict/off do not change the cache prefix. */\n engineeringLifecycleMode?: \"off\" | \"strict\";\n}\n\nexport function codeSystemPrompt(rootDir: string, opts: CodeSystemPromptOptions = {}): string {\n const codeBase = codeSystemBase(opts.modelId ?? DEFAULT_CODE_MODEL);\n const base = opts.hasSemanticSearch ? `${codeBase}${SEMANTIC_SEARCH_ROUTING}` : codeBase;\n const withMemory = applyMemoryStack(base, rootDir);\n const gitignorePath = join(rootDir, \".gitignore\");\n let result = withMemory;\n if (existsSync(gitignorePath)) {\n let content: string | undefined;\n try {\n content = readFileSync(gitignorePath, \"utf8\");\n } catch {}\n if (content !== undefined) {\n const MAX = 2000;\n const truncated =\n content.length > MAX\n ? `${content.slice(0, MAX)}\\n… (truncated ${content.length - MAX} chars)`\n : content;\n result = `${result}\\n\\n# Project .gitignore\\n\\nThe user's repo ships this .gitignore — treat every pattern as \"don't traverse or edit inside these paths unless explicitly asked\":\\n\\n\\`\\`\\`\\n${truncated}\\n\\`\\`\\`\\n`;\n }\n }\n const appendParts = [opts.systemAppend, opts.systemAppendFile].filter(Boolean);\n if (appendParts.length > 0) {\n result = `${result}\\n\\n# User System Append\\n\\n${appendParts.join(\"\\n\\n\")}`;\n }\n return result;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAIrB,IAAM,qBAAqB;AAGpB,SAAS,eAAe,SAAyB;AACtD,SAAO,qBAAqB,QAAQ,2BAA2B,mBAAmB,OAAO,CAAC;AAC5F;AAEA,IAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4G3B,oBAAoB;AAAA;AAIf,IAAM,qBAAqB,eAAe,kBAAkB;AAGnE,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BzB,SAAS,iBAAiB,SAAiB,OAAgC,CAAC,GAAW;AAC5F,QAAM,WAAW,eAAe,KAAK,WAAW,kBAAkB;AAClE,QAAM,OAAO,KAAK,oBAAoB,GAAG,QAAQ,GAAG,uBAAuB,KAAK;AAChF,QAAM,aAAa,iBAAiB,MAAM,OAAO;AACjD,QAAM,gBAAgB,KAAK,SAAS,YAAY;AAChD,MAAI,SAAS;AACb,MAAI,WAAW,aAAa,GAAG;AAC7B,QAAI;AACJ,QAAI;AACF,gBAAU,aAAa,eAAe,MAAM;AAAA,IAC9C,QAAQ;AAAA,IAAC;AACT,QAAI,YAAY,QAAW;AACzB,YAAM,MAAM;AACZ,YAAM,YACJ,QAAQ,SAAS,MACb,GAAG,QAAQ,MAAM,GAAG,GAAG,CAAC;AAAA,oBAAkB,QAAQ,SAAS,GAAG,YAC9D;AACN,eAAS,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA8K,SAAS;AAAA;AAAA;AAAA,IAC3M;AAAA,EACF;AACA,QAAM,cAAc,CAAC,KAAK,cAAc,KAAK,gBAAgB,EAAE,OAAO,OAAO;AAC7E,MAAI,YAAY,SAAS,GAAG;AAC1B,aAAS,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA,EAA+B,YAAY,KAAK,MAAM,CAAC;AAAA,EAC3E;AACA,SAAO;AACT;","names":[]}
@@ -2,60 +2,60 @@
2
2
  import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
3
3
  import {
4
4
  chatCommand
5
- } from "./chunk-GNRKXRRE.js";
6
- import "./chunk-77JIQ7SL.js";
5
+ } from "./chunk-S3QII236.js";
6
+ import "./chunk-EQFZIHKJ.js";
7
7
  import "./chunk-JMBMLOBP.js";
8
+ import "./chunk-APOSDBAU.js";
8
9
  import "./chunk-SZ5XES2N.js";
9
- import "./chunk-B4MOGWHW.js";
10
- import "./chunk-XNMXVL6C.js";
10
+ import "./chunk-4EHRIP5U.js";
11
+ import "./chunk-FB27YXPX.js";
11
12
  import "./chunk-XJXDHAES.js";
12
- import "./chunk-MVLPXZAA.js";
13
+ import "./chunk-GOASYYZ4.js";
13
14
  import {
14
15
  buildCodeToolset
15
- } from "./chunk-FY5UERSG.js";
16
- import "./chunk-OMNRXZNA.js";
17
- import "./chunk-XBYHNZ5Z.js";
18
- import "./chunk-CFJY64UA.js";
19
- import "./chunk-XUZHBQSM.js";
16
+ } from "./chunk-2WZT27GR.js";
17
+ import "./chunk-URAI4YRL.js";
18
+ import "./chunk-GMQVINZK.js";
19
+ import "./chunk-LRO63VNK.js";
20
+ import "./chunk-MQJR7YQ2.js";
20
21
  import {
21
22
  markPhase
22
23
  } from "./chunk-ZZM6QJ4W.js";
23
- import "./chunk-HNZ4727T.js";
24
- import "./chunk-MW64SQUE.js";
25
- import "./chunk-D6WRFR6V.js";
26
- import "./chunk-RCC73DWQ.js";
27
- import "./chunk-5YLEKX2V.js";
28
- import "./chunk-2W4F3RIZ.js";
24
+ import "./chunk-DFHI2MRB.js";
25
+ import "./chunk-4SBXAHR6.js";
26
+ import "./chunk-J26XOB2T.js";
27
+ import "./chunk-R7JMQMLD.js";
28
+ import "./chunk-4V4TKQMB.js";
29
+ import "./chunk-FK7NXDRP.js";
30
+ import "./chunk-V4AXMN4X.js";
31
+ import "./chunk-XHP6NYOT.js";
29
32
  import {
30
33
  detectForeignAgentPlatform
31
- } from "./chunk-DLTE4GBY.js";
32
- import "./chunk-CGVW5W7N.js";
33
- import "./chunk-RHQOGG43.js";
34
- import "./chunk-3OXD5CBM.js";
34
+ } from "./chunk-J4MYMBJ7.js";
35
+ import "./chunk-EPIHGOM3.js";
36
+ import "./chunk-OHSVEXFF.js";
37
+ import "./chunk-A6GSOADP.js";
35
38
  import "./chunk-PLHAZOLZ.js";
36
39
  import "./chunk-L3VPEESB.js";
37
- import "./chunk-HI6THNAZ.js";
38
- import "./chunk-VVPV5HU6.js";
39
- import "./chunk-WPY7AFS6.js";
40
+ import "./chunk-TGP7JGHN.js";
41
+ import "./chunk-RRZIIMAF.js";
42
+ import "./chunk-I4SH5Z7S.js";
40
43
  import "./chunk-YMYX6QTC.js";
41
44
  import "./chunk-BOWSNGQC.js";
42
- import "./chunk-CPCUMMSR.js";
45
+ import "./chunk-QSKDP3OS.js";
46
+ import "./chunk-25T6CVUP.js";
47
+ import "./chunk-NVI4XPOQ.js";
43
48
  import "./chunk-6UNHNVJR.js";
44
49
  import {
45
50
  sanitizeName
46
- } from "./chunk-AMSK3ZLB.js";
51
+ } from "./chunk-P5SUHDUQ.js";
47
52
  import "./chunk-XXC2BYTV.js";
48
- import "./chunk-GFJJEW3Z.js";
49
- import "./chunk-25T6CVUP.js";
50
53
  import {
51
54
  loadDotenv
52
55
  } from "./chunk-2UQP6H6T.js";
53
- import "./chunk-Z663GVUB.js";
54
- import "./chunk-ARBGTNHM.js";
55
- import "./chunk-6QBUXA73.js";
56
56
  import {
57
57
  t
58
- } from "./chunk-CLHMV6OL.js";
58
+ } from "./chunk-U7G72DHQ.js";
59
59
  import {
60
60
  DEFAULT_MODEL,
61
61
  bridgeEndpointEnv,
@@ -63,7 +63,7 @@ import {
63
63
  normalizeMcpConfig,
64
64
  readConfig,
65
65
  specToRaw
66
- } from "./chunk-AOYUW3HR.js";
66
+ } from "./chunk-GCNBIWK7.js";
67
67
  import "./chunk-TUK7OWJA.js";
68
68
 
69
69
  // src/cli/commands/code.tsx
@@ -74,7 +74,7 @@ async function codeCommand(opts = {}) {
74
74
  const resolvedModel = opts.model?.trim() || loadModel() || DEFAULT_MODEL;
75
75
  loadDotenv();
76
76
  bridgeEndpointEnv();
77
- const { codeSystemPrompt } = await import("./prompt-ATI7DKHF.js");
77
+ const { codeSystemPrompt } = await import("./prompt-JCC3A7AA.js");
78
78
  const rootDir = resolve(opts.dir ?? process.cwd());
79
79
  const session = opts.noSession ? void 0 : `code-${sanitizeName(basename(rootDir))}`;
80
80
  markPhase("semantic_bootstrap_start");
@@ -158,4 +158,4 @@ async function codeCommand(opts = {}) {
158
158
  export {
159
159
  codeCommand
160
160
  };
161
- //# sourceMappingURL=code-WN6D4VZO.js.map
161
+ //# sourceMappingURL=code-JPFZJYVW.js.map
@@ -4,15 +4,15 @@ import {
4
4
  checkOllamaStatus,
5
5
  pullOllamaModel,
6
6
  startOllamaDaemon
7
- } from "./chunk-VVPV5HU6.js";
7
+ } from "./chunk-RRZIIMAF.js";
8
8
  import {
9
9
  buildIndex
10
- } from "./chunk-WPY7AFS6.js";
10
+ } from "./chunk-I4SH5Z7S.js";
11
11
  import "./chunk-6UNHNVJR.js";
12
12
  import {
13
13
  loadIndexConfig,
14
14
  resolveSemanticEmbeddingConfig
15
- } from "./chunk-AOYUW3HR.js";
15
+ } from "./chunk-GCNBIWK7.js";
16
16
  import "./chunk-TUK7OWJA.js";
17
17
 
18
18
  // src/cli/commands/index.ts
@@ -353,4 +353,4 @@ function makeTtyWriter() {
353
353
  export {
354
354
  indexCommand
355
355
  };
356
- //# sourceMappingURL=commands-DHETOY7O.js.map
356
+ //# sourceMappingURL=commands-IUL2CLKH.js.map
@@ -2,14 +2,14 @@
2
2
  import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
3
3
  import {
4
4
  DeepSeekClient
5
- } from "./chunk-GFJJEW3Z.js";
5
+ } from "./chunk-QSKDP3OS.js";
6
6
  import "./chunk-25T6CVUP.js";
7
7
  import {
8
8
  loadDotenv
9
9
  } from "./chunk-2UQP6H6T.js";
10
10
  import {
11
11
  loadEndpoint
12
- } from "./chunk-AOYUW3HR.js";
12
+ } from "./chunk-GCNBIWK7.js";
13
13
  import "./chunk-TUK7OWJA.js";
14
14
 
15
15
  // src/cli/commands/commit.ts
@@ -288,4 +288,4 @@ async function commitCommand(opts = {}) {
288
288
  export {
289
289
  commitCommand
290
290
  };
291
- //# sourceMappingURL=commit-BBUYAKZV.js.map
291
+ //# sourceMappingURL=commit-JT7LYBTL.js.map
@@ -18,6 +18,7 @@ import {
18
18
  isReasoningEffort,
19
19
  loadApiKey,
20
20
  loadBaseUrl,
21
+ loadBraveApiKey,
21
22
  loadDashboardEnabled,
22
23
  loadDesktopOpenTabs,
23
24
  loadEditMode,
@@ -35,6 +36,7 @@ import {
35
36
  loadMetasoApiKey,
36
37
  loadModel,
37
38
  loadMouseWheelRows,
39
+ loadOllamaApiKey,
38
40
  loadPerplexityApiKey,
39
41
  loadPricingOverride,
40
42
  loadProjectPathAllowed,
@@ -96,7 +98,7 @@ import {
96
98
  webSearchEndpoint,
97
99
  webSearchEngine,
98
100
  writeConfig
99
- } from "./chunk-AOYUW3HR.js";
101
+ } from "./chunk-GCNBIWK7.js";
100
102
  import "./chunk-TUK7OWJA.js";
101
103
  export {
102
104
  DEFAULT_MODEL,
@@ -116,6 +118,7 @@ export {
116
118
  isReasoningEffort,
117
119
  loadApiKey,
118
120
  loadBaseUrl,
121
+ loadBraveApiKey,
119
122
  loadDashboardEnabled,
120
123
  loadDesktopOpenTabs,
121
124
  loadEditMode,
@@ -133,6 +136,7 @@ export {
133
136
  loadMetasoApiKey,
134
137
  loadModel,
135
138
  loadMouseWheelRows,
139
+ loadOllamaApiKey,
136
140
  loadPerplexityApiKey,
137
141
  loadPricingOverride,
138
142
  loadProjectPathAllowed,
@@ -195,4 +199,4 @@ export {
195
199
  webSearchEngine,
196
200
  writeConfig
197
201
  };
198
- //# sourceMappingURL=config-KV7VV5LG.js.map
202
+ //# sourceMappingURL=config-T4RWI5NG.js.map