@travisennis/acai 0.0.11 → 0.0.13

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 (292) hide show
  1. package/README.md +5 -5
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +2 -5
  4. package/dist/commands/history/types.d.ts +3 -2
  5. package/dist/commands/history/types.d.ts.map +1 -1
  6. package/dist/commands/init-project/utils.d.ts +0 -1
  7. package/dist/commands/init-project/utils.d.ts.map +1 -1
  8. package/dist/commands/init-project/utils.js +1 -12
  9. package/dist/commands/manager.d.ts.map +1 -1
  10. package/dist/commands/manager.js +6 -19
  11. package/dist/commands/resources/index.d.ts.map +1 -1
  12. package/dist/commands/resources/index.js +4 -1
  13. package/dist/commands/session/index.d.ts.map +1 -1
  14. package/dist/commands/session/index.js +6 -0
  15. package/dist/commands/session/types.d.ts +1 -0
  16. package/dist/commands/session/types.d.ts.map +1 -1
  17. package/dist/commands/share/html-renderer.d.ts.map +1 -1
  18. package/dist/commands/share/html-renderer.js +54 -48
  19. package/dist/commands/tools/index.d.ts +3 -0
  20. package/dist/commands/tools/index.d.ts.map +1 -0
  21. package/dist/commands/tools/index.js +191 -0
  22. package/dist/commands/tools/templates.d.ts +6 -0
  23. package/dist/commands/tools/templates.d.ts.map +1 -0
  24. package/dist/commands/tools/templates.js +97 -0
  25. package/dist/config/index.d.ts +5 -2
  26. package/dist/config/index.d.ts.map +1 -1
  27. package/dist/config/index.js +42 -6
  28. package/dist/index.d.ts +14 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +98 -68
  31. package/dist/models/anthropic-provider.d.ts +1 -1
  32. package/dist/models/deepseek-provider.d.ts +3 -3
  33. package/dist/models/deepseek-provider.js +17 -17
  34. package/dist/models/google-provider.d.ts +2 -4
  35. package/dist/models/google-provider.d.ts.map +1 -1
  36. package/dist/models/google-provider.js +2 -17
  37. package/dist/models/groq-provider.d.ts +2 -4
  38. package/dist/models/groq-provider.d.ts.map +1 -1
  39. package/dist/models/groq-provider.js +3 -21
  40. package/dist/models/manager.d.ts +1 -10
  41. package/dist/models/manager.d.ts.map +1 -1
  42. package/dist/models/manager.js +2 -2
  43. package/dist/models/opencode-go-provider.d.ts +11 -1
  44. package/dist/models/opencode-go-provider.d.ts.map +1 -1
  45. package/dist/models/opencode-go-provider.js +130 -0
  46. package/dist/models/opencode-zen-provider.d.ts +3 -3
  47. package/dist/models/opencode-zen-provider.d.ts.map +1 -1
  48. package/dist/models/opencode-zen-provider.js +26 -32
  49. package/dist/models/openrouter-provider.d.ts +4 -15
  50. package/dist/models/openrouter-provider.d.ts.map +1 -1
  51. package/dist/models/openrouter-provider.js +26 -169
  52. package/dist/models/providers.d.ts +1 -1
  53. package/dist/models/providers.d.ts.map +1 -1
  54. package/dist/models/xai-provider.d.ts +1 -2
  55. package/dist/models/xai-provider.d.ts.map +1 -1
  56. package/dist/models/xai-provider.js +0 -13
  57. package/dist/prompts/manager.d.ts.map +1 -1
  58. package/dist/prompts/manager.js +5 -1
  59. package/dist/prompts/system-prompt.d.ts +1 -2
  60. package/dist/prompts/system-prompt.d.ts.map +1 -1
  61. package/dist/prompts/system-prompt.js +26 -15
  62. package/dist/repl/index.d.ts +28 -13
  63. package/dist/repl/index.d.ts.map +1 -1
  64. package/dist/repl/index.js +242 -305
  65. package/dist/skills/activated-tracker.d.ts +11 -0
  66. package/dist/skills/activated-tracker.d.ts.map +1 -0
  67. package/dist/skills/activated-tracker.js +16 -0
  68. package/dist/skills/index.d.ts +12 -2
  69. package/dist/skills/index.d.ts.map +1 -1
  70. package/dist/skills/index.js +127 -71
  71. package/dist/terminal/control.d.ts +1 -21
  72. package/dist/terminal/control.d.ts.map +1 -1
  73. package/dist/terminal/control.js +1 -32
  74. package/dist/terminal/formatting.d.ts +0 -33
  75. package/dist/terminal/formatting.d.ts.map +1 -1
  76. package/dist/terminal/formatting.js +0 -91
  77. package/dist/terminal/highlight/theme.d.ts +0 -37
  78. package/dist/terminal/highlight/theme.d.ts.map +1 -1
  79. package/dist/terminal/highlight/theme.js +1 -79
  80. package/dist/terminal/keys.d.ts +0 -97
  81. package/dist/terminal/keys.d.ts.map +1 -1
  82. package/dist/terminal/keys.js +0 -194
  83. package/dist/terminal/select-prompt.d.ts.map +1 -1
  84. package/dist/terminal/select-prompt.js +65 -51
  85. package/dist/terminal/style.d.ts +1 -1
  86. package/dist/terminal/style.d.ts.map +1 -1
  87. package/dist/terminal/supports-color.d.ts.map +1 -1
  88. package/dist/terminal/supports-color.js +38 -20
  89. package/dist/terminal/supports-hyperlinks.d.ts +3 -0
  90. package/dist/terminal/supports-hyperlinks.d.ts.map +1 -1
  91. package/dist/terminal/supports-hyperlinks.js +72 -31
  92. package/dist/terminal/table/layout-manager.d.ts +0 -20
  93. package/dist/terminal/table/layout-manager.d.ts.map +1 -1
  94. package/dist/terminal/table/layout-manager.js +68 -44
  95. package/dist/terminal/table/utils.d.ts +0 -1
  96. package/dist/terminal/table/utils.d.ts.map +1 -1
  97. package/dist/terminal/table/utils.js +2 -4
  98. package/dist/tools/apply-patch.d.ts +5 -3
  99. package/dist/tools/apply-patch.d.ts.map +1 -1
  100. package/dist/tools/apply-patch.js +154 -123
  101. package/dist/tools/bash.d.ts +4 -4
  102. package/dist/tools/bash.d.ts.map +1 -1
  103. package/dist/tools/bash.js +27 -13
  104. package/dist/tools/dynamic-tool-loader.d.ts +17 -3
  105. package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
  106. package/dist/tools/dynamic-tool-loader.js +360 -81
  107. package/dist/tools/edit-file.d.ts +2 -2
  108. package/dist/tools/index.d.ts +27 -151
  109. package/dist/tools/index.d.ts.map +1 -1
  110. package/dist/tools/index.js +16 -21
  111. package/dist/tools/read-file.d.ts +8 -8
  112. package/dist/tools/read-file.d.ts.map +1 -1
  113. package/dist/tools/read-file.js +32 -13
  114. package/dist/tools/save-file.d.ts +4 -4
  115. package/dist/tools/skill.d.ts +2 -1
  116. package/dist/tools/skill.d.ts.map +1 -1
  117. package/dist/tools/skill.js +64 -14
  118. package/dist/tools/types.d.ts +8 -2
  119. package/dist/tools/types.d.ts.map +1 -1
  120. package/dist/tools/web-fetch.d.ts +8 -12
  121. package/dist/tools/web-fetch.d.ts.map +1 -1
  122. package/dist/tools/web-fetch.js +86 -44
  123. package/dist/tools/web-search.d.ts +4 -8
  124. package/dist/tools/web-search.d.ts.map +1 -1
  125. package/dist/tools/web-search.js +41 -33
  126. package/dist/tui/autocomplete/utils.d.ts +0 -15
  127. package/dist/tui/autocomplete/utils.d.ts.map +1 -1
  128. package/dist/tui/autocomplete/utils.js +0 -85
  129. package/dist/tui/autocomplete.d.ts +1 -1
  130. package/dist/tui/autocomplete.d.ts.map +1 -1
  131. package/dist/tui/autocomplete.js +1 -1
  132. package/dist/tui/components/editor.d.ts +12 -0
  133. package/dist/tui/components/editor.d.ts.map +1 -1
  134. package/dist/tui/components/editor.js +181 -195
  135. package/dist/tui/components/footer.d.ts +0 -2
  136. package/dist/tui/components/footer.d.ts.map +1 -1
  137. package/dist/tui/components/footer.js +1 -17
  138. package/dist/tui/components/input.d.ts +4 -0
  139. package/dist/tui/components/input.d.ts.map +1 -1
  140. package/dist/tui/components/input.js +33 -31
  141. package/dist/tui/components/markdown.d.ts +30 -0
  142. package/dist/tui/components/markdown.d.ts.map +1 -1
  143. package/dist/tui/components/markdown.js +274 -242
  144. package/dist/tui/components/modal.d.ts.map +1 -1
  145. package/dist/tui/components/modal.js +11 -11
  146. package/dist/tui/components/select-list.d.ts +5 -0
  147. package/dist/tui/components/select-list.d.ts.map +1 -1
  148. package/dist/tui/components/select-list.js +69 -98
  149. package/dist/tui/components/table.d.ts +6 -0
  150. package/dist/tui/components/table.d.ts.map +1 -1
  151. package/dist/tui/components/table.js +61 -52
  152. package/dist/tui/index.d.ts +1 -8
  153. package/dist/tui/index.d.ts.map +1 -1
  154. package/dist/tui/index.js +0 -8
  155. package/dist/tui/tui.d.ts +9 -0
  156. package/dist/tui/tui.d.ts.map +1 -1
  157. package/dist/tui/tui.js +78 -48
  158. package/dist/tui/utils.d.ts +7 -0
  159. package/dist/tui/utils.d.ts.map +1 -1
  160. package/dist/tui/utils.js +117 -53
  161. package/dist/utils/bash.d.ts.map +1 -1
  162. package/dist/utils/bash.js +121 -104
  163. package/dist/utils/binary-output.d.ts +32 -0
  164. package/dist/utils/binary-output.d.ts.map +1 -0
  165. package/dist/utils/binary-output.js +127 -0
  166. package/dist/utils/command-protection.d.ts +3 -2
  167. package/dist/utils/command-protection.d.ts.map +1 -1
  168. package/dist/utils/command-protection.js +121 -29
  169. package/dist/utils/filesystem/operations.d.ts +0 -15
  170. package/dist/utils/filesystem/operations.d.ts.map +1 -1
  171. package/dist/utils/filesystem/operations.js +1 -38
  172. package/dist/utils/filesystem/security.d.ts.map +1 -1
  173. package/dist/utils/filesystem/security.js +22 -15
  174. package/dist/utils/filetype-detection.d.ts +0 -1
  175. package/dist/utils/filetype-detection.d.ts.map +1 -1
  176. package/dist/utils/filetype-detection.js +0 -12
  177. package/dist/utils/formatting.d.ts +0 -30
  178. package/dist/utils/formatting.d.ts.map +1 -1
  179. package/dist/utils/formatting.js +0 -44
  180. package/dist/utils/git.d.ts +4 -6
  181. package/dist/utils/git.d.ts.map +1 -1
  182. package/dist/utils/git.js +36 -46
  183. package/dist/utils/ignore.d.ts +1 -1
  184. package/dist/utils/ignore.d.ts.map +1 -1
  185. package/dist/utils/ignore.js +1 -1
  186. package/dist/utils/parsing.d.ts +1 -1
  187. package/dist/utils/parsing.d.ts.map +1 -1
  188. package/dist/utils/process.d.ts.map +1 -1
  189. package/dist/utils/process.js +77 -79
  190. package/dist/utils/yaml.d.ts +0 -1
  191. package/dist/utils/yaml.d.ts.map +1 -1
  192. package/dist/utils/yaml.js +80 -89
  193. package/dist/utils/zod.d.ts +0 -3
  194. package/dist/utils/zod.d.ts.map +1 -1
  195. package/dist/utils/zod.js +0 -7
  196. package/package.json +32 -29
  197. package/dist/agent/sub-agent.d.ts +0 -23
  198. package/dist/agent/sub-agent.d.ts.map +0 -1
  199. package/dist/agent/sub-agent.js +0 -109
  200. package/dist/commands/add-directory/index.d.ts +0 -3
  201. package/dist/commands/add-directory/index.d.ts.map +0 -1
  202. package/dist/commands/add-directory/index.js +0 -50
  203. package/dist/commands/add-directory/utils.d.ts +0 -3
  204. package/dist/commands/add-directory/utils.d.ts.map +0 -1
  205. package/dist/commands/add-directory/utils.js +0 -15
  206. package/dist/commands/clear/index.d.ts +0 -3
  207. package/dist/commands/clear/index.d.ts.map +0 -1
  208. package/dist/commands/clear/index.js +0 -13
  209. package/dist/commands/generate-rules/index.d.ts +0 -3
  210. package/dist/commands/generate-rules/index.d.ts.map +0 -1
  211. package/dist/commands/generate-rules/index.js +0 -206
  212. package/dist/commands/generate-rules/service.d.ts +0 -22
  213. package/dist/commands/generate-rules/service.d.ts.map +0 -1
  214. package/dist/commands/generate-rules/service.js +0 -103
  215. package/dist/commands/generate-rules/utils.d.ts +0 -5
  216. package/dist/commands/generate-rules/utils.d.ts.map +0 -1
  217. package/dist/commands/generate-rules/utils.js +0 -25
  218. package/dist/commands/handoff/index.d.ts +0 -3
  219. package/dist/commands/handoff/index.d.ts.map +0 -1
  220. package/dist/commands/handoff/index.js +0 -97
  221. package/dist/commands/handoff/utils.d.ts +0 -4
  222. package/dist/commands/handoff/utils.d.ts.map +0 -1
  223. package/dist/commands/handoff/utils.js +0 -123
  224. package/dist/commands/list-directories/index.d.ts +0 -3
  225. package/dist/commands/list-directories/index.d.ts.map +0 -1
  226. package/dist/commands/list-directories/index.js +0 -35
  227. package/dist/commands/pickup/index.d.ts +0 -3
  228. package/dist/commands/pickup/index.d.ts.map +0 -1
  229. package/dist/commands/pickup/index.js +0 -141
  230. package/dist/commands/pickup/types.d.ts +0 -6
  231. package/dist/commands/pickup/types.d.ts.map +0 -1
  232. package/dist/commands/pickup/types.js +0 -1
  233. package/dist/commands/pickup/utils.d.ts +0 -7
  234. package/dist/commands/pickup/utils.d.ts.map +0 -1
  235. package/dist/commands/pickup/utils.js +0 -56
  236. package/dist/commands/remove-directory/index.d.ts +0 -3
  237. package/dist/commands/remove-directory/index.d.ts.map +0 -1
  238. package/dist/commands/remove-directory/index.js +0 -55
  239. package/dist/commands/review/index.d.ts +0 -3
  240. package/dist/commands/review/index.d.ts.map +0 -1
  241. package/dist/commands/review/index.js +0 -12
  242. package/dist/commands/review/review-panel.d.ts +0 -3
  243. package/dist/commands/review/review-panel.d.ts.map +0 -1
  244. package/dist/commands/review/review-panel.js +0 -186
  245. package/dist/commands/review/utils.d.ts +0 -18
  246. package/dist/commands/review/utils.d.ts.map +0 -1
  247. package/dist/commands/review/utils.js +0 -146
  248. package/dist/commands/shell/index.d.ts +0 -3
  249. package/dist/commands/shell/index.d.ts.map +0 -1
  250. package/dist/commands/shell/index.js +0 -96
  251. package/dist/modes/manager.d.ts +0 -24
  252. package/dist/modes/manager.d.ts.map +0 -1
  253. package/dist/modes/manager.js +0 -77
  254. package/dist/modes/prompts.d.ts +0 -2
  255. package/dist/modes/prompts.d.ts.map +0 -1
  256. package/dist/modes/prompts.js +0 -142
  257. package/dist/subagents/index.d.ts +0 -16
  258. package/dist/subagents/index.d.ts.map +0 -1
  259. package/dist/subagents/index.js +0 -231
  260. package/dist/terminal/index.d.ts +0 -9
  261. package/dist/terminal/index.d.ts.map +0 -1
  262. package/dist/terminal/index.js +0 -8
  263. package/dist/tools/agent.d.ts +0 -27
  264. package/dist/tools/agent.d.ts.map +0 -1
  265. package/dist/tools/agent.js +0 -81
  266. package/dist/tools/directory-tree.d.ts +0 -28
  267. package/dist/tools/directory-tree.d.ts.map +0 -1
  268. package/dist/tools/directory-tree.js +0 -152
  269. package/dist/tools/glob.d.ts +0 -35
  270. package/dist/tools/glob.d.ts.map +0 -1
  271. package/dist/tools/glob.js +0 -159
  272. package/dist/tools/grep.d.ts +0 -100
  273. package/dist/tools/grep.d.ts.map +0 -1
  274. package/dist/tools/grep.js +0 -601
  275. package/dist/tools/ls.d.ts +0 -26
  276. package/dist/tools/ls.d.ts.map +0 -1
  277. package/dist/tools/ls.js +0 -82
  278. package/dist/tui/components/header.d.ts +0 -21
  279. package/dist/tui/components/header.d.ts.map +0 -1
  280. package/dist/tui/components/header.js +0 -63
  281. package/dist/utils/bash/parse.d.ts +0 -19
  282. package/dist/utils/bash/parse.d.ts.map +0 -1
  283. package/dist/utils/bash/parse.js +0 -223
  284. package/dist/utils/bash/quote.d.ts +0 -6
  285. package/dist/utils/bash/quote.d.ts.map +0 -1
  286. package/dist/utils/bash/quote.js +0 -23
  287. package/dist/utils/generators.d.ts +0 -3
  288. package/dist/utils/generators.d.ts.map +0 -1
  289. package/dist/utils/generators.js +0 -25
  290. package/dist/utils/glob.d.ts +0 -52
  291. package/dist/utils/glob.d.ts.map +0 -1
  292. package/dist/utils/glob.js +0 -376
@@ -1,186 +0,0 @@
1
- import { join } from "node:path";
2
- import { initExecutionEnvironment } from "../../execution/index.js";
3
- import { getTerminalSize } from "../../terminal/control.js";
4
- import style from "../../terminal/style.js";
5
- import { Markdown } from "../../tui/components/markdown.js";
6
- import { Spacer } from "../../tui/components/spacer.js";
7
- import { Container, SelectList, Text, } from "../../tui/index.js";
8
- import { formatFileDiffForDisplay, getUntrackedFiles, openFileInEditor, parseGitDiffFiles, } from "./utils.js";
9
- export async function showReviewPanel(tui, container, inputContainer, editor) {
10
- try {
11
- const execEnv = await initExecutionEnvironment();
12
- const stagedResult = await execEnv.executeCommand("git diff --cached", {
13
- cwd: process.cwd(),
14
- timeout: 5000,
15
- preserveOutputOnError: true,
16
- captureStderr: true,
17
- throwOnError: false,
18
- });
19
- const unstagedResult = await execEnv.executeCommand("git diff", {
20
- cwd: process.cwd(),
21
- timeout: 5000,
22
- preserveOutputOnError: true,
23
- captureStderr: true,
24
- throwOnError: false,
25
- });
26
- const untrackedResult = await execEnv.executeCommand("git ls-files --others --exclude-standard", {
27
- cwd: process.cwd(),
28
- timeout: 5000,
29
- preserveOutputOnError: true,
30
- captureStderr: true,
31
- throwOnError: false,
32
- });
33
- const stagedOutput = stagedResult.exitCode === 0 ? stagedResult.output : "";
34
- const unstagedOutput = unstagedResult.exitCode === 0 ? unstagedResult.output : "";
35
- const untrackedOutput = untrackedResult.exitCode === 0 ? untrackedResult.output : "";
36
- const combinedOutput = stagedOutput +
37
- (stagedOutput && unstagedOutput ? "\n" : "") +
38
- unstagedOutput;
39
- if (!combinedOutput.trim()) {
40
- container.addChild(new Spacer(1));
41
- container.addChild(new Markdown("No changes detected in the current directory.", {
42
- customBgRgb: {
43
- r: 52,
44
- g: 53,
45
- b: 65,
46
- },
47
- paddingX: 1,
48
- paddingY: 1,
49
- }));
50
- tui.requestRender();
51
- return;
52
- }
53
- const fileChanges = parseGitDiffFiles(combinedOutput);
54
- const untrackedFiles = await getUntrackedFiles(untrackedOutput, process.cwd());
55
- fileChanges.push(...untrackedFiles);
56
- if (fileChanges.length === 0) {
57
- container.addChild(new Spacer(1));
58
- container.addChild(new Markdown("No file changes could be parsed.", {
59
- customBgRgb: {
60
- r: 52,
61
- g: 53,
62
- b: 65,
63
- },
64
- paddingX: 1,
65
- paddingY: 1,
66
- }));
67
- tui.requestRender();
68
- return;
69
- }
70
- const selectItems = fileChanges.map((file) => ({
71
- value: file.fileName,
72
- label: file.fileName,
73
- description: file.stats,
74
- }));
75
- const selectList = new SelectList(selectItems, 10);
76
- const selectContainer = new Container();
77
- const { columns } = getTerminalSize();
78
- selectContainer.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
79
- selectContainer.addChild(new Spacer(1));
80
- selectContainer.addChild(selectList);
81
- selectContainer.addChild(new Spacer(1));
82
- selectContainer.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
83
- const originalEditor = editor;
84
- inputContainer.clear();
85
- inputContainer.addChild(selectContainer);
86
- tui.setFocus(selectList);
87
- selectList.onSelect = (selectedItem) => {
88
- const selectedFile = fileChanges.find((file) => file.fileName === selectedItem.value);
89
- if (!selectedFile) {
90
- container.addChild(new Spacer(1));
91
- container.addChild(new Markdown(style.red("Error: Selected file not found."), {
92
- customBgRgb: {
93
- r: 52,
94
- g: 53,
95
- b: 65,
96
- },
97
- paddingX: 1,
98
- paddingY: 1,
99
- }));
100
- tui.requestRender();
101
- return;
102
- }
103
- const actionItems = [
104
- { value: "diff", label: "View diff", description: "Show changes" },
105
- {
106
- value: "edit",
107
- label: "Open in editor",
108
- description: `Open in ${process.env["EDITOR"] || process.env["VISUAL"] || "vi"}`,
109
- },
110
- ];
111
- const actionSelectList = new SelectList(actionItems, 5);
112
- const actionContainer = new Container();
113
- actionContainer.addChild(new Spacer(1));
114
- actionContainer.addChild(new Text(style.blue(`Selected: ${selectedFile.fileName}`), 0, 0));
115
- actionContainer.addChild(new Spacer(1));
116
- actionContainer.addChild(actionSelectList);
117
- actionContainer.addChild(new Spacer(1));
118
- actionContainer.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
119
- inputContainer.clear();
120
- inputContainer.addChild(actionContainer);
121
- tui.setFocus(actionSelectList);
122
- tui.requestRender();
123
- actionSelectList.onSelect = (actionItem) => {
124
- if (actionItem.value === "diff") {
125
- container.addChild(new Spacer(1));
126
- container.addChild(new Markdown(formatFileDiffForDisplay(selectedFile.fileName, selectedFile.diff), {
127
- customBgRgb: {
128
- r: 52,
129
- g: 53,
130
- b: 65,
131
- },
132
- paddingX: 1,
133
- paddingY: 1,
134
- }));
135
- }
136
- else if (actionItem.value === "edit") {
137
- const filePath = join(process.cwd(), selectedFile.fileName);
138
- const result = openFileInEditor(filePath, tui.getTerminal());
139
- if (!result.success) {
140
- container.addChild(new Spacer(1));
141
- container.addChild(new Markdown(`Failed to open file in editor: ${result.error || "Unknown error"}`, {
142
- customBgRgb: {
143
- r: 52,
144
- g: 53,
145
- b: 65,
146
- },
147
- paddingX: 1,
148
- paddingY: 1,
149
- }));
150
- }
151
- }
152
- inputContainer.clear();
153
- inputContainer.addChild(originalEditor);
154
- tui.setFocus(originalEditor);
155
- tui.requestRender();
156
- };
157
- actionSelectList.onCancel = () => {
158
- inputContainer.clear();
159
- inputContainer.addChild(selectContainer);
160
- tui.setFocus(selectList);
161
- tui.requestRender();
162
- };
163
- };
164
- selectList.onCancel = () => {
165
- inputContainer.clear();
166
- inputContainer.addChild(originalEditor);
167
- tui.setFocus(originalEditor);
168
- tui.requestRender();
169
- };
170
- tui.requestRender();
171
- }
172
- catch (error) {
173
- console.error("Error executing git diff:", error);
174
- container.addChild(new Spacer(1));
175
- container.addChild(new Markdown("Failed to retrieve git changes. Ensure git is installed and initialized.", {
176
- customBgRgb: {
177
- r: 52,
178
- g: 53,
179
- b: 65,
180
- },
181
- paddingX: 1,
182
- paddingY: 1,
183
- }));
184
- tui.requestRender();
185
- }
186
- }
@@ -1,18 +0,0 @@
1
- import type { Terminal } from "../../tui/terminal.ts";
2
- interface FileChange {
3
- fileName: string;
4
- diff: string;
5
- stats: string;
6
- }
7
- export declare function parseGitDiffFiles(diffOutput: string): FileChange[];
8
- export declare function formatFileDiffForDisplay(fileName: string, diff: string): string;
9
- export declare function getUntrackedFiles(untrackedOutput: string, cwd: string): Promise<FileChange[]>;
10
- /**
11
- * Open a file in the user's preferred editor ($EDITOR or $VISUAL)
12
- */
13
- export declare function openFileInEditor(filePath: string, terminal: Terminal): {
14
- success: boolean;
15
- error?: string;
16
- };
17
- export {};
18
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/review/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AA6CD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,EAAE,CAwBlE;AAgBD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,CAaR;AAED,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,UAAU,EAAE,CAAC,CAsCvB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBtC"}
@@ -1,146 +0,0 @@
1
- import { spawnSync } from "node:child_process";
2
- import fs from "node:fs";
3
- import { join } from "node:path";
4
- function isDiffContentLine(line) {
5
- return ((line.startsWith("+") && !line.startsWith("+++")) ||
6
- (line.startsWith("-") && !line.startsWith("---")) ||
7
- line.startsWith(" ") ||
8
- line.startsWith("index") ||
9
- line.startsWith("old mode") ||
10
- line.startsWith("new mode") ||
11
- line.startsWith("deleted file") ||
12
- line.startsWith("new file"));
13
- }
14
- function parseHunkStats(line, isNewFile) {
15
- const statsMatch = line.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);
16
- if (!statsMatch) {
17
- return "Additions: 1, Deletions: 0";
18
- }
19
- const deletions = isNewFile ? 0 : Number.parseInt(statsMatch[2], 10);
20
- const additions = Number.parseInt(statsMatch[4], 10);
21
- return `Additions: ${additions}, Deletions: ${deletions}`;
22
- }
23
- function startNewFile(state, line) {
24
- if (state.currentFile) {
25
- state.fileChanges.push(state.currentFile);
26
- }
27
- const fileMatch = line.match(/diff --git a\/(.*) b\/(.*)/);
28
- if (!fileMatch)
29
- return;
30
- state.currentFile = { fileName: fileMatch[1], diff: "", stats: "" };
31
- state.inDiff = true;
32
- state.isNewFile =
33
- fileMatch[1] === "/dev/null" || fileMatch[2] === "/dev/null";
34
- }
35
- export function parseGitDiffFiles(diffOutput) {
36
- const lines = diffOutput.split("\n");
37
- const state = {
38
- fileChanges: [],
39
- currentFile: null,
40
- inDiff: false,
41
- isNewFile: false,
42
- };
43
- for (const line of lines) {
44
- if (line.startsWith("diff --git")) {
45
- startNewFile(state, line);
46
- }
47
- else if (line.startsWith("@@") && state.currentFile) {
48
- state.currentFile.stats = parseHunkStats(line, state.isNewFile);
49
- }
50
- else if (state.inDiff && state.currentFile && isDiffContentLine(line)) {
51
- state.currentFile.diff += `${line}\n`;
52
- }
53
- }
54
- if (state.currentFile) {
55
- state.fileChanges.push(state.currentFile);
56
- }
57
- return state.fileChanges;
58
- }
59
- function formatDiffLine(line) {
60
- if (line.trim() === "")
61
- return null;
62
- if (line.startsWith("+") && !line.startsWith("+++")) {
63
- return `+${line.substring(1)}`;
64
- }
65
- if (line.startsWith("-") && !line.startsWith("---")) {
66
- return `-${line.substring(1)}`;
67
- }
68
- if (line.startsWith(" ")) {
69
- return ` ${line.substring(1)}`;
70
- }
71
- return line;
72
- }
73
- export function formatFileDiffForDisplay(fileName, diff) {
74
- const lines = diff.split("\n");
75
- const formattedLines = [`### ${fileName}`, "", "```diff"];
76
- for (const line of lines) {
77
- const formatted = formatDiffLine(line);
78
- if (formatted !== null) {
79
- formattedLines.push(formatted);
80
- }
81
- }
82
- formattedLines.push("```");
83
- return formattedLines.join("\n");
84
- }
85
- export async function getUntrackedFiles(untrackedOutput, cwd) {
86
- const fileChanges = [];
87
- const untrackedFiles = untrackedOutput
88
- .trim()
89
- .split("\n")
90
- .filter((file) => file.length > 0);
91
- for (const fileName of untrackedFiles) {
92
- try {
93
- const filePath = join(cwd, fileName);
94
- const fileContent = await fs.promises.readFile(filePath, "utf-8");
95
- const lines = fileContent.split("\n").length;
96
- // Create a diff-like representation for the untracked file
97
- const diff = `diff --git a/${fileName} b/${fileName}
98
- new file mode 100644
99
- index 0000000..0000000
100
- --- /dev/null
101
- +++ b/${fileName}
102
- @@ -0,0 +1,${lines} @@
103
- ${fileContent
104
- .split("\n")
105
- .map((line) => `+${line}`)
106
- .join("\n")}
107
- `;
108
- fileChanges.push({
109
- fileName,
110
- diff,
111
- stats: `Additions: ${lines}, Deletions: 0`,
112
- });
113
- }
114
- catch (error) {
115
- // Skip files that can't be read (e.g., directories, binary files)
116
- console.error(`Failed to read untracked file: ${fileName}`, error);
117
- }
118
- }
119
- return fileChanges;
120
- }
121
- /**
122
- * Open a file in the user's preferred editor ($EDITOR or $VISUAL)
123
- */
124
- export function openFileInEditor(filePath, terminal) {
125
- const editor = process.env["EDITOR"] || process.env["VISUAL"] || "vi";
126
- terminal.enterExternalMode();
127
- try {
128
- const result = spawnSync(editor, [filePath], {
129
- stdio: "inherit",
130
- });
131
- if (result.error) {
132
- return { success: false, error: result.error.message };
133
- }
134
- // Note: Editors often exit with non-zero codes (e.g., :cq in vim, or when
135
- // quitting without saving). We only treat spawn errors as failures, not
136
- // exit codes, since the user may intentionally exit with an error code.
137
- return { success: true };
138
- }
139
- catch (error) {
140
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
141
- return { success: false, error: errorMessage };
142
- }
143
- finally {
144
- terminal.exitExternalMode();
145
- }
146
- }
@@ -1,3 +0,0 @@
1
- import type { CommandOptions, ReplCommand } from "../types.ts";
2
- export declare const shellCommand: (options: CommandOptions) => ReplCommand;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/shell/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/D,eAAO,MAAM,YAAY,GAAI,SAAS,cAAc,KAAG,WAuItD,CAAC"}
@@ -1,96 +0,0 @@
1
- import { initExecutionEnvironment } from "../../execution/index.js";
2
- import style from "../../terminal/style.js";
3
- import { Loader, SelectList, Spacer, Text } from "../../tui/index.js";
4
- // Command execution timeout in milliseconds
5
- const DEFAULT_TIMEOUT = 1.5 * 60 * 1000; // 1.5 minutes
6
- export const shellCommand = (options) => {
7
- const { promptManager, tokenCounter } = options;
8
- return {
9
- command: "/shell",
10
- aliases: ["/sh"],
11
- description: "Run a non-interactive shell command on the local machine.",
12
- getSubCommands: () => Promise.resolve([]),
13
- async handle(args, { tui, container, editor, }) {
14
- const commandStr = args.join(" ");
15
- if (!commandStr.trim()) {
16
- container.addChild(new Text(style.red("Provide a non-empty command."), 0, 1));
17
- tui.requestRender();
18
- editor.setText("");
19
- return "continue";
20
- }
21
- const execEnv = await initExecutionEnvironment();
22
- const colorEnv = {
23
- ["FORCE_COLOR"]: "1",
24
- ["CLICOLOR"]: "1",
25
- ["CLICOLOR_FORCE"]: "1",
26
- ["TERM"]: process.env["TERM"] ?? "xterm-256color",
27
- ["COLORTERM"]: process.env["COLORTERM"] ?? "truecolor",
28
- ["npm_config_color"]: "true",
29
- };
30
- // Show loader before execution
31
- const truncatedCommand = commandStr.length > 50
32
- ? `${commandStr.substring(0, 50)}...`
33
- : commandStr;
34
- const loader = new Loader(tui, `Running: ${truncatedCommand}`);
35
- container.addChild(loader);
36
- tui.requestRender();
37
- const { output, exitCode, duration } = await execEnv.executeCommand(commandStr, {
38
- cwd: process.cwd(),
39
- timeout: DEFAULT_TIMEOUT,
40
- preserveOutputOnError: true,
41
- captureStderr: true,
42
- throwOnError: false,
43
- env: colorEnv,
44
- });
45
- // Cleanup loader
46
- loader.stop();
47
- container.removeChild(loader);
48
- // Display results with spacing
49
- container.addChild(new Spacer(1));
50
- container.addChild(new Text(style.gray(`Exit code: ${exitCode}, Duration: ${duration}ms`), 1, 0));
51
- container.addChild(new Spacer(1));
52
- container.addChild(new Text(output, 2, 0));
53
- // Create context selection component
54
- const contextSelector = new SelectList([
55
- {
56
- value: "yes",
57
- label: "Yes",
58
- description: "Add output to prompt context",
59
- },
60
- {
61
- value: "no",
62
- label: "No",
63
- description: "Do not add output to context",
64
- },
65
- ]);
66
- contextSelector.onSelect = (item) => {
67
- if (item.value === "yes") {
68
- const tokenCount = tokenCounter.count(output);
69
- promptManager.addContext(output);
70
- container.addChild(new Text(style.green(`Output added to prompt context. (${tokenCount} tokens)`), 3, 0));
71
- }
72
- else {
73
- container.addChild(new Text(style.gray("Output not added to context."), 3, 0));
74
- }
75
- // Remove the selector and show final result
76
- container.removeChild(contextSelector);
77
- tui.setFocus(editor);
78
- tui.requestRender();
79
- editor.setText("");
80
- };
81
- contextSelector.onCancel = () => {
82
- // User cancelled - default to not adding to context
83
- container.addChild(new Text(style.gray("Output not added to context."), 3, 0));
84
- container.removeChild(contextSelector);
85
- tui.setFocus(editor);
86
- tui.requestRender();
87
- editor.setText("");
88
- };
89
- // Add the selector to the container
90
- container.addChild(contextSelector);
91
- tui.setFocus(contextSelector);
92
- tui.requestRender();
93
- return "continue";
94
- },
95
- };
96
- };
@@ -1,24 +0,0 @@
1
- import type { UserModelMessage } from "ai";
2
- type Mode = "normal" | "planning" | "research";
3
- export declare class ModeManager {
4
- private currentMode;
5
- private firstMessageInMode;
6
- getCurrentMode(): Mode;
7
- getDisplayName(): string;
8
- cycleMode(): void;
9
- getInitialPrompt(): string;
10
- getReminderPrompt(): string;
11
- isNormal(): boolean;
12
- isFirstMessage(): boolean;
13
- markFirstMessageSent(): void;
14
- getReminderMessage(): UserModelMessage | undefined;
15
- reset(): void;
16
- toJson(): {
17
- mode: Mode;
18
- };
19
- fromJson(data: {
20
- mode?: string;
21
- }): void;
22
- }
23
- export {};
24
- //# sourceMappingURL=manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/modes/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAI3C,KAAK,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAmC/C,qBAAa,WAAW;IACtB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,kBAAkB,CAAQ;IAElC,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,MAAM;IAIxB,SAAS,IAAI,IAAI;IAOjB,gBAAgB,IAAI,MAAM;IAI1B,iBAAiB,IAAI,MAAM;IAI3B,QAAQ,IAAI,OAAO;IAInB,cAAc,IAAI,OAAO;IAIzB,oBAAoB,IAAI,IAAI;IAI5B,kBAAkB,IAAI,gBAAgB,GAAG,SAAS;IAWlD,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE;IAIxB,QAAQ,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAMxC"}
@@ -1,77 +0,0 @@
1
- import { createUserMessage } from "../sessions/manager.js";
2
- import { planningPrompt } from "./prompts.js";
3
- const MODE_DEFINITIONS = {
4
- normal: {
5
- name: "normal",
6
- displayName: "Normal",
7
- initialPrompt: "",
8
- reminderPrompt: "",
9
- },
10
- planning: {
11
- name: "planning",
12
- displayName: "Plan",
13
- initialPrompt: planningPrompt,
14
- reminderPrompt: "Remember: You are still in Plan Mode. Continue focusing on architectural design, systematic planning, and high-level considerations.",
15
- },
16
- research: {
17
- name: "research",
18
- displayName: "Research",
19
- initialPrompt: "You are in RESEARCH MODE. Your goal is to thoroughly investigate:\n\n1. Current state and context\n2. Existing solutions\n3. Best practices\n4. Trade-offs\n5. Potential pitfalls",
20
- reminderPrompt: "Remember: You are still in RESEARCH MODE. Continue investigating thoroughly. Synthesize findings.",
21
- },
22
- };
23
- const ALL_MODES = ["normal", "planning", "research"];
24
- export class ModeManager {
25
- currentMode = "normal";
26
- firstMessageInMode = true;
27
- getCurrentMode() {
28
- return this.currentMode;
29
- }
30
- getDisplayName() {
31
- return MODE_DEFINITIONS[this.currentMode].displayName;
32
- }
33
- cycleMode() {
34
- const currentIndex = ALL_MODES.indexOf(this.currentMode);
35
- const nextIndex = (currentIndex + 1) % ALL_MODES.length;
36
- this.currentMode = ALL_MODES[nextIndex];
37
- this.firstMessageInMode = true;
38
- }
39
- getInitialPrompt() {
40
- return MODE_DEFINITIONS[this.currentMode].initialPrompt;
41
- }
42
- getReminderPrompt() {
43
- return MODE_DEFINITIONS[this.currentMode].reminderPrompt;
44
- }
45
- isNormal() {
46
- return this.currentMode === "normal";
47
- }
48
- isFirstMessage() {
49
- return this.firstMessageInMode;
50
- }
51
- markFirstMessageSent() {
52
- this.firstMessageInMode = false;
53
- }
54
- getReminderMessage() {
55
- if (this.isNormal() || this.firstMessageInMode) {
56
- return undefined;
57
- }
58
- const reminder = this.getReminderPrompt();
59
- if (!reminder) {
60
- return undefined;
61
- }
62
- return createUserMessage([], reminder);
63
- }
64
- reset() {
65
- this.currentMode = "normal";
66
- this.firstMessageInMode = true;
67
- }
68
- toJson() {
69
- return { mode: this.currentMode };
70
- }
71
- fromJson(data) {
72
- if (data.mode && ALL_MODES.includes(data.mode)) {
73
- this.currentMode = data.mode;
74
- }
75
- this.firstMessageInMode = false;
76
- }
77
- }
@@ -1,2 +0,0 @@
1
- export declare const planningPrompt = "\n# Plan Mode (Conversational)\n\nYou work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed\u2014intent- and implementation-wise\u2014so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.\n\n## Mode rules (strict)\n\nYou are in **Plan Mode** until a developer message explicitly ends it.\n\nPlan Mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Plan Mode, treat it as a request to **plan the execution**, not perform it.\n\n## Execution vs. mutation in Plan Mode\n\nYou may explore and execute **non-mutating** actions that improve the plan. You must not perform **mutating** actions.\n\n### Allowed (non-mutating, plan-improving)\n\nActions that gather truth, reduce ambiguity, or validate feasibility without changing repo-tracked state. Examples:\n\n* Reading or searching files, configs, schemas, types, manifests, and docs\n* Static analysis, inspection, and repo exploration\n* Dry-run style commands when they do not edit repo-tracked files\n* Tests, builds, or checks that may write to caches or build artifacts (for example, `target/`, `.cache/`, or snapshots) so long as they do not edit repo-tracked files\n\n### Not allowed (mutating, plan-executing)\n\nActions that implement the plan or change repo-tracked state. Examples:\n\n* Editing or writing files\n* Running formatters or linters that rewrite files\n* Applying patches, migrations, or codegen that updates repo-tracked files\n* Side-effectful commands whose purpose is to carry out the plan rather than refine it\n\nWhen in doubt: if the action would reasonably be described as \"doing the work\" rather than \"planning the work,\" do not do it.\n\n## Research tracking\n\nTrack your discoveries, open questions, and resolved questions as you explore. Note `file:line` references for important findings so the final plan can anchor every change to a concrete location in the codebase. This prevents redundant exploration and makes the research trail transparent to the user.\n\n## Powerful exploration tools\n\nYou have access to powerful tools for codebase exploration\u2014use them liberally:\n\n* **codebase-researcher subagent**: When you need thorough investigation of a feature, system, or component, launch the codebase-researcher subagent to perform deep exploration. Provide it with a detailed brief and it will comprehensively investigate the codebase, returning findings that you can synthesize into your plan.\n\nFor complex tasks, consider launching the codebase-researcher in parallel while you explore other areas using Grep and Glob, then synthesizing findings into your plan.\n\n## PHASE 1 \u2014 Ground in the environment (explore first, ask second)\n\nBegin by grounding yourself in the actual environment. Eliminate unknowns in the prompt by discovering facts, not by asking the user. Resolve all questions that can be answered through exploration or inspection. Identify missing or ambiguous details only if they cannot be derived from the environment. Silent exploration between turns is allowed and encouraged.\n\nBefore asking the user any question, perform at least one targeted non-mutating exploration pass (for example: search relevant files, inspect likely entrypoints/configs, confirm current implementation shape), unless no local environment/repo is available.\n\nException: you may ask clarifying questions about the user's prompt before exploring, ONLY if there are obvious ambiguities or contradictions in the prompt itself. However, if ambiguity might be resolved by exploring, always prefer exploring first.\n\nDo not ask questions that can be answered from the repo or system (for example, \"where is this struct?\" or \"which UI component should we use?\" when exploration can make it clear). Only ask once you have exhausted reasonable non-mutating exploration.\n\n## PHASE 2 \u2014 Intent chat (what they actually want)\n\n* Keep asking until you can clearly state: goal + success criteria, audience, in/out of scope, constraints, current state, and the key preferences/tradeoffs.\n* Require an explicit **\"Out of Scope\"** statement \u2014 what we are NOT doing. This prevents scope creep and sets clear expectations.\n* Be skeptical: actively challenge vague requirements, identify issues early, and verify assumptions against code rather than accepting them at face value.\n* Bias toward questions over guessing: if any high-impact ambiguity remains, do NOT plan yet\u2014ask.\n\n## PHASE 3 \u2014 Implementation chat (what/how we\u2019ll build)\n\n* Once intent is stable, keep asking until the spec is decision complete: approach, interfaces (APIs/schemas/I/O), data flow, edge cases/failure modes, testing + acceptance criteria, rollout/monitoring, and any migrations/compat constraints.\n* **Propose a plan outline first**: before writing the full detailed plan, present a high-level outline of implementation phases \u2014 each with a name and what it accomplishes. Get user feedback on structure before filling in details.\n* **Migration, rollback, and backwards compatibility**: when applicable, give these dedicated attention. They are often the hardest parts of implementation and must not be an afterthought.\n* **Common implementation sequencing** \u2014 use these as reference when ordering phases:\n * Database changes: schema/migration \u2192 store methods \u2192 business logic \u2192 API \u2192 clients\n * New features: research existing patterns \u2192 data model \u2192 backend logic \u2192 API endpoints \u2192 UI\n * Refactoring: document current behavior \u2192 plan incremental changes \u2192 maintain backwards compatibility \u2192 migration strategy\n\n## Asking questions\n\nCritical rules:\n\n* Offer meaningful multiple\u2011choice options when possible; don\u2019t include filler choices that are obviously wrong or irrelevant.\n\nYou SHOULD ask many questions, but each question must:\n\n* materially change the spec/plan, OR\n* confirm/lock an assumption, OR\n* choose between meaningful tradeoffs.\n* not be answerable by non-mutating commands.\n\n## Two kinds of unknowns (treat differently)\n\n1. **Discoverable facts** (repo/system truth): explore first.\n\n * Before asking, run targeted searches and check likely sources of truth (configs/manifests/entrypoints/schemas/types/constants).\n * Ask only if: multiple plausible candidates; nothing found but you need a missing identifier/context; or ambiguity is actually product intent.\n * If asking, present concrete candidates (paths/service names) + recommend one.\n * Never ask questions you can answer from your environment (e.g., \u201Cwhere is this struct\u201D).\n\n2. **Preferences/tradeoffs** (not discoverable): ask early.\n\n * These are intent or implementation preferences that cannot be derived from exploration.\n * Provide 2\u20134 mutually exclusive options + a recommended default.\n * If unanswered, proceed with the recommended option and record it as an assumption in the final plan.\n\n## Finalization rule\n\nOnly output the final plan when it is decision complete and leaves no decisions to the implementer.\n\nWhen you present the official plan, wrap it in a `<proposed_plan>` block so the client can render it specially:\n\n1) The opening tag must be on its own line.\n2) Start the plan content on the next line (no text on the same line as the tag).\n3) The closing tag must be on its own line.\n4) Use Markdown inside the block.\n5) Keep the tags exactly as `<proposed_plan>` and `</proposed_plan>` (do not translate or rename them), even if the plan content is in another language.\n\nExample:\n\n<proposed_plan>\nplan content\n</proposed_plan>\n\nplan content should be human and agent digestible. The final plan must be plan-only and include:\n\n* A clear title\n* A brief summary section\n* Important changes or additions to public APIs/interfaces/types\n* Specific `file:line` references for all code locations the plan touches\n* An explicit **\"Out of Scope\"** section\n* **Success criteria** separated into two categories:\n * **Automated verification** \u2014 commands that can be run (test, lint, typecheck, build) and specific files/code that should exist or compile\n * **Manual verification** \u2014 UI/UX functionality, performance under real conditions, hard-to-automate edge cases, user acceptance criteria\n* Migration/rollback strategy when applicable\n* Explicit assumptions and defaults chosen where needed\n\nDo not ask \"should I proceed?\" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a `<proposed_plan>` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.\n\nOnly produce at most one `<proposed_plan>` block per turn, and only when you are presenting a complete spec.\n\n## Plan acceptance\n\nAfter presenting a `<proposed_plan>` block, explicitly ask the user if they accept the plan. If they accept (e.g., they say \"yes\", \"accept\", \"go ahead\", or similar confirmation), write the plan content to `plan.md` in the current working directory using the Write tool. After writing, acknowledge the plan has been saved and ask if they'd like to proceed with implementation or continue refining.\n";
2
- //# sourceMappingURL=prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../source/modes/prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,suSA4I1B,CAAC"}