indusagi-coding-agent 0.1.37 → 0.1.39

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 (489) hide show
  1. package/CHANGELOG.md +23 -7
  2. package/README.md +2 -4
  3. package/dist/cli/args.d.ts +6 -128
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +277 -472
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/config-selector.d.ts +9 -62
  8. package/dist/cli/config-selector.d.ts.map +1 -1
  9. package/dist/cli/config-selector.js +31 -146
  10. package/dist/cli/config-selector.js.map +1 -1
  11. package/dist/cli/file-processor.d.ts +1 -69
  12. package/dist/cli/file-processor.d.ts.map +1 -1
  13. package/dist/cli/file-processor.js +36 -267
  14. package/dist/cli/file-processor.js.map +1 -1
  15. package/dist/cli/list-models.d.ts +0 -60
  16. package/dist/cli/list-models.d.ts.map +1 -1
  17. package/dist/cli/list-models.js +53 -246
  18. package/dist/cli/list-models.js.map +1 -1
  19. package/dist/cli/session-picker.d.ts +1 -72
  20. package/dist/cli/session-picker.d.ts.map +1 -1
  21. package/dist/cli/session-picker.js +57 -231
  22. package/dist/cli/session-picker.js.map +1 -1
  23. package/dist/cli.js +25 -31
  24. package/dist/cli.js.map +1 -1
  25. package/dist/config.d.ts +0 -42
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/config.js +62 -97
  28. package/dist/config.js.map +1 -1
  29. package/dist/core/agent-session.d.ts +23 -0
  30. package/dist/core/agent-session.d.ts.map +1 -1
  31. package/dist/core/agent-session.js +78 -66
  32. package/dist/core/agent-session.js.map +1 -1
  33. package/dist/core/auth-storage.d.ts +4 -95
  34. package/dist/core/auth-storage.d.ts.map +1 -1
  35. package/dist/core/auth-storage.js +233 -288
  36. package/dist/core/auth-storage.js.map +1 -1
  37. package/dist/core/bash-executor.d.ts +0 -323
  38. package/dist/core/bash-executor.d.ts.map +1 -1
  39. package/dist/core/bash-executor.js +126 -359
  40. package/dist/core/bash-executor.js.map +1 -1
  41. package/dist/core/compaction/branch-summarization.d.ts +3 -3
  42. package/dist/core/compaction/branch-summarization.js +16 -16
  43. package/dist/core/compaction/branch-summarization.js.map +1 -1
  44. package/dist/core/compaction/compaction.d.ts +3 -3
  45. package/dist/core/compaction/compaction.js +40 -40
  46. package/dist/core/compaction/compaction.js.map +1 -1
  47. package/dist/core/compaction/index.d.ts +32 -4
  48. package/dist/core/compaction/index.d.ts.map +1 -1
  49. package/dist/core/compaction/index.js +30 -4
  50. package/dist/core/compaction/index.js.map +1 -1
  51. package/dist/core/compaction/utils.d.ts +1 -19
  52. package/dist/core/compaction/utils.d.ts.map +1 -1
  53. package/dist/core/compaction/utils.js +92 -113
  54. package/dist/core/compaction/utils.js.map +1 -1
  55. package/dist/core/discover-packages.d.ts +0 -4
  56. package/dist/core/discover-packages.d.ts.map +1 -1
  57. package/dist/core/discover-packages.js +41 -44
  58. package/dist/core/discover-packages.js.map +1 -1
  59. package/dist/core/event-bus.d.ts +1 -147
  60. package/dist/core/event-bus.d.ts.map +1 -1
  61. package/dist/core/event-bus.js +17 -106
  62. package/dist/core/event-bus.js.map +1 -1
  63. package/dist/core/exec.d.ts +0 -16
  64. package/dist/core/exec.d.ts.map +1 -1
  65. package/dist/core/exec.js +18 -27
  66. package/dist/core/exec.js.map +1 -1
  67. package/dist/core/export-html/ansi-to-html.ts +262 -0
  68. package/dist/core/export-html/index.ts +433 -0
  69. package/dist/core/export-html/template.html +48 -26
  70. package/dist/core/export-html/tool-renderer.d.ts +0 -21
  71. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  72. package/dist/core/export-html/tool-renderer.js +35 -51
  73. package/dist/core/export-html/tool-renderer.js.map +1 -1
  74. package/dist/core/export-html/tool-renderer.ts +80 -0
  75. package/dist/core/export-html/vendor/highlight.min.js +401 -370
  76. package/dist/core/export-html/vendor/marked.min.js +71 -3
  77. package/dist/core/extensions/index.d.ts +7 -4
  78. package/dist/core/extensions/index.d.ts.map +1 -1
  79. package/dist/core/extensions/index.js +17 -3
  80. package/dist/core/extensions/index.js.map +1 -1
  81. package/dist/core/extensions/loader.d.ts +0 -6
  82. package/dist/core/extensions/loader.d.ts.map +1 -1
  83. package/dist/core/extensions/loader.js +60 -56
  84. package/dist/core/extensions/loader.js.map +1 -1
  85. package/dist/core/extensions/runner.d.ts +3 -0
  86. package/dist/core/extensions/runner.d.ts.map +1 -1
  87. package/dist/core/extensions/runner.js +48 -80
  88. package/dist/core/extensions/runner.js.map +1 -1
  89. package/dist/core/extensions/types.d.ts +50 -23
  90. package/dist/core/extensions/types.d.ts.map +1 -1
  91. package/dist/core/footer-data-provider.d.ts +2 -15
  92. package/dist/core/footer-data-provider.d.ts.map +1 -1
  93. package/dist/core/footer-data-provider.js +21 -33
  94. package/dist/core/footer-data-provider.js.map +1 -1
  95. package/dist/core/hooks/loader.js +2 -2
  96. package/dist/core/hooks/loader.js.map +1 -1
  97. package/dist/core/index.d.ts +29 -10
  98. package/dist/core/index.d.ts.map +1 -1
  99. package/dist/core/index.js +29 -10
  100. package/dist/core/index.js.map +1 -1
  101. package/dist/core/keybindings.d.ts +2 -179
  102. package/dist/core/keybindings.d.ts.map +1 -1
  103. package/dist/core/keybindings.js +64 -238
  104. package/dist/core/keybindings.js.map +1 -1
  105. package/dist/core/model-registry.d.ts +26 -181
  106. package/dist/core/model-registry.d.ts.map +1 -1
  107. package/dist/core/model-registry.js +228 -407
  108. package/dist/core/model-registry.js.map +1 -1
  109. package/dist/core/model-resolver.d.ts +0 -139
  110. package/dist/core/model-resolver.d.ts.map +1 -1
  111. package/dist/core/model-resolver.js +36 -217
  112. package/dist/core/model-resolver.js.map +1 -1
  113. package/dist/core/package-manager.d.ts +25 -57
  114. package/dist/core/package-manager.d.ts.map +1 -1
  115. package/dist/core/package-manager.js +326 -964
  116. package/dist/core/package-manager.js.map +1 -1
  117. package/dist/core/prompt-templates.d.ts +2 -34
  118. package/dist/core/prompt-templates.d.ts.map +1 -1
  119. package/dist/core/prompt-templates.js +122 -170
  120. package/dist/core/prompt-templates.js.map +1 -1
  121. package/dist/core/resource-loader.d.ts +19 -12
  122. package/dist/core/resource-loader.d.ts.map +1 -1
  123. package/dist/core/resource-loader.js +353 -467
  124. package/dist/core/resource-loader.js.map +1 -1
  125. package/dist/core/sdk.d.ts +2 -61
  126. package/dist/core/sdk.d.ts.map +1 -1
  127. package/dist/core/sdk.js +184 -252
  128. package/dist/core/sdk.js.map +1 -1
  129. package/dist/core/session-manager.d.ts +447 -1
  130. package/dist/core/session-manager.d.ts.map +1 -1
  131. package/dist/core/session-manager.js +1176 -1
  132. package/dist/core/session-manager.js.map +1 -1
  133. package/dist/core/settings-manager.d.ts +9 -12
  134. package/dist/core/settings-manager.d.ts.map +1 -1
  135. package/dist/core/settings-manager.js +170 -398
  136. package/dist/core/settings-manager.js.map +1 -1
  137. package/dist/core/skills.d.ts +2 -27
  138. package/dist/core/skills.d.ts.map +1 -1
  139. package/dist/core/skills.js +149 -212
  140. package/dist/core/skills.js.map +1 -1
  141. package/dist/core/subagents.d.ts +2 -2
  142. package/dist/core/subagents.d.ts.map +1 -1
  143. package/dist/core/subagents.js +21 -14
  144. package/dist/core/subagents.js.map +1 -1
  145. package/dist/core/system-prompt.d.ts +0 -11
  146. package/dist/core/system-prompt.d.ts.map +1 -1
  147. package/dist/core/system-prompt.js +168 -139
  148. package/dist/core/system-prompt.js.map +1 -1
  149. package/dist/core/timings.d.ts +1 -4
  150. package/dist/core/timings.d.ts.map +1 -1
  151. package/dist/core/timings.js +34 -18
  152. package/dist/core/timings.js.map +1 -1
  153. package/dist/core/todo-store.d.ts +20 -0
  154. package/dist/core/todo-store.d.ts.map +1 -0
  155. package/dist/core/todo-store.js +60 -0
  156. package/dist/core/todo-store.js.map +1 -0
  157. package/dist/core/tools/bash.d.ts +2 -0
  158. package/dist/core/tools/bash.d.ts.map +1 -0
  159. package/dist/core/tools/bash.js +2 -0
  160. package/dist/core/tools/bash.js.map +1 -0
  161. package/dist/core/tools/bg-process.d.ts +1 -6
  162. package/dist/core/tools/bg-process.d.ts.map +1 -1
  163. package/dist/core/tools/bg-process.js +4 -18
  164. package/dist/core/tools/bg-process.js.map +1 -1
  165. package/dist/core/tools/edit-diff.d.ts +9 -0
  166. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  167. package/dist/core/tools/edit-diff.js +2 -0
  168. package/dist/core/tools/edit-diff.js.map +1 -0
  169. package/dist/core/tools/edit.d.ts +2 -0
  170. package/dist/core/tools/edit.d.ts.map +1 -0
  171. package/dist/core/tools/edit.js +2 -0
  172. package/dist/core/tools/edit.js.map +1 -0
  173. package/dist/core/tools/find.d.ts +2 -0
  174. package/dist/core/tools/find.d.ts.map +1 -0
  175. package/dist/core/tools/find.js +2 -0
  176. package/dist/core/tools/find.js.map +1 -0
  177. package/dist/core/tools/grep.d.ts +2 -0
  178. package/dist/core/tools/grep.d.ts.map +1 -0
  179. package/dist/core/tools/grep.js +2 -0
  180. package/dist/core/tools/grep.js.map +1 -0
  181. package/dist/core/tools/index.d.ts +7 -1
  182. package/dist/core/tools/index.d.ts.map +1 -1
  183. package/dist/core/tools/ls.d.ts +2 -0
  184. package/dist/core/tools/ls.d.ts.map +1 -0
  185. package/dist/core/tools/ls.js +2 -0
  186. package/dist/core/tools/ls.js.map +1 -0
  187. package/dist/core/tools/path-utils.d.ts +2 -0
  188. package/dist/core/tools/path-utils.d.ts.map +1 -0
  189. package/dist/core/tools/path-utils.js +2 -0
  190. package/dist/core/tools/path-utils.js.map +1 -0
  191. package/dist/core/tools/read.d.ts +2 -0
  192. package/dist/core/tools/read.d.ts.map +1 -0
  193. package/dist/core/tools/read.js +2 -0
  194. package/dist/core/tools/read.js.map +1 -0
  195. package/dist/core/tools/registry.d.ts +0 -15
  196. package/dist/core/tools/registry.d.ts.map +1 -1
  197. package/dist/core/tools/registry.js +13 -37
  198. package/dist/core/tools/registry.js.map +1 -1
  199. package/dist/core/tools/task.d.ts +17 -23
  200. package/dist/core/tools/task.d.ts.map +1 -1
  201. package/dist/core/tools/task.js +43 -82
  202. package/dist/core/tools/task.js.map +1 -1
  203. package/dist/core/tools/todo.d.ts +17 -20
  204. package/dist/core/tools/todo.d.ts.map +1 -1
  205. package/dist/core/tools/todo.js +79 -58
  206. package/dist/core/tools/todo.js.map +1 -1
  207. package/dist/core/tools/truncate.d.ts +2 -0
  208. package/dist/core/tools/truncate.d.ts.map +1 -0
  209. package/dist/core/tools/truncate.js +2 -0
  210. package/dist/core/tools/truncate.js.map +1 -0
  211. package/dist/core/tools/webfetch.d.ts +2 -0
  212. package/dist/core/tools/webfetch.d.ts.map +1 -0
  213. package/dist/core/tools/webfetch.js +2 -0
  214. package/dist/core/tools/webfetch.js.map +1 -0
  215. package/dist/core/tools/websearch.d.ts +2 -0
  216. package/dist/core/tools/websearch.d.ts.map +1 -0
  217. package/dist/core/tools/websearch.js +2 -0
  218. package/dist/core/tools/websearch.js.map +1 -0
  219. package/dist/core/tools/write.d.ts +2 -0
  220. package/dist/core/tools/write.d.ts.map +1 -0
  221. package/dist/core/tools/write.js +2 -0
  222. package/dist/core/tools/write.js.map +1 -0
  223. package/dist/index.d.ts +35 -29
  224. package/dist/index.d.ts.map +1 -1
  225. package/dist/index.js +33 -41
  226. package/dist/index.js.map +1 -1
  227. package/dist/main.d.ts.map +1 -1
  228. package/dist/main.js +237 -225
  229. package/dist/main.js.map +1 -1
  230. package/dist/migrations.d.ts +0 -25
  231. package/dist/migrations.d.ts.map +1 -1
  232. package/dist/migrations.js +129 -180
  233. package/dist/migrations.js.map +1 -1
  234. package/dist/modes/index.d.ts +13 -6
  235. package/dist/modes/index.d.ts.map +1 -1
  236. package/dist/modes/index.js +11 -5
  237. package/dist/modes/index.js.map +1 -1
  238. package/dist/modes/interactive/components/armin.d.ts +8 -23
  239. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  240. package/dist/modes/interactive/components/armin.js +217 -266
  241. package/dist/modes/interactive/components/armin.js.map +1 -1
  242. package/dist/modes/interactive/components/assistant-message.d.ts +2 -168
  243. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  244. package/dist/modes/interactive/components/assistant-message.js +61 -216
  245. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  246. package/dist/modes/interactive/components/bash-execution.d.ts +6 -313
  247. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  248. package/dist/modes/interactive/components/bash-execution.js +86 -403
  249. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  250. package/dist/modes/interactive/components/bordered-loader.d.ts +1 -3
  251. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  252. package/dist/modes/interactive/components/bordered-loader.js +59 -29
  253. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  254. package/dist/modes/interactive/components/branch-summary-message.d.ts +3 -3
  255. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  256. package/dist/modes/interactive/components/branch-summary-message.js +30 -17
  257. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  258. package/dist/modes/interactive/components/compaction-summary-message.d.ts +3 -3
  259. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  260. package/dist/modes/interactive/components/compaction-summary-message.js +35 -18
  261. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  262. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  263. package/dist/modes/interactive/components/config-selector.js +60 -68
  264. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  265. package/dist/modes/interactive/components/countdown-timer.d.ts +2 -6
  266. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  267. package/dist/modes/interactive/components/countdown-timer.js +32 -18
  268. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  269. package/dist/modes/interactive/components/custom-editor.d.ts +1 -5
  270. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  271. package/dist/modes/interactive/components/custom-editor.js +45 -37
  272. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  273. package/dist/modes/interactive/components/custom-message.d.ts +5 -6
  274. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  275. package/dist/modes/interactive/components/custom-message.js +43 -53
  276. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  277. package/dist/modes/interactive/components/diff.d.ts +0 -3
  278. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  279. package/dist/modes/interactive/components/diff.js +101 -108
  280. package/dist/modes/interactive/components/diff.js.map +1 -1
  281. package/dist/modes/interactive/components/dynamic-border.d.ts +7 -2
  282. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  283. package/dist/modes/interactive/components/dynamic-border.js +24 -4
  284. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  285. package/dist/modes/interactive/components/extension-editor.d.ts +5 -9
  286. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  287. package/dist/modes/interactive/components/extension-editor.js +43 -46
  288. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  289. package/dist/modes/interactive/components/extension-input.d.ts +4 -9
  290. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  291. package/dist/modes/interactive/components/extension-input.js +45 -28
  292. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  293. package/dist/modes/interactive/components/extension-selector.d.ts +7 -12
  294. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/extension-selector.js +54 -32
  296. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  297. package/dist/modes/interactive/components/footer.d.ts +2 -11
  298. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/footer.js +135 -183
  300. package/dist/modes/interactive/components/footer.js.map +1 -1
  301. package/dist/modes/interactive/components/index.d.ts +79 -30
  302. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  303. package/dist/modes/interactive/components/index.js +73 -31
  304. package/dist/modes/interactive/components/index.js.map +1 -1
  305. package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -18
  306. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  307. package/dist/modes/interactive/components/keybinding-hints.js +24 -31
  308. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  309. package/dist/modes/interactive/components/login-dialog.d.ts +11 -24
  310. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  311. package/dist/modes/interactive/components/login-dialog.js +89 -86
  312. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  313. package/dist/modes/interactive/components/model-selector.d.ts +15 -19
  314. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  315. package/dist/modes/interactive/components/model-selector.js +104 -157
  316. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  317. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  318. package/dist/modes/interactive/components/oauth-selector.js +5 -5
  319. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  320. package/dist/modes/interactive/components/scoped-models-selector.d.ts +12 -22
  321. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  322. package/dist/modes/interactive/components/scoped-models-selector.js +111 -132
  323. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  324. package/dist/modes/interactive/components/session-selector-search.d.ts +3 -3
  325. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  326. package/dist/modes/interactive/components/session-selector-search.js +92 -103
  327. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  328. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  329. package/dist/modes/interactive/components/session-selector.js +28 -39
  330. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  331. package/dist/modes/interactive/components/settings-selector.d.ts +1 -1
  332. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  333. package/dist/modes/interactive/components/settings-selector.js +111 -203
  334. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  335. package/dist/modes/interactive/components/show-images-selector.d.ts +1 -1
  336. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  337. package/dist/modes/interactive/components/show-images-selector.js +17 -19
  338. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  339. package/dist/modes/interactive/components/skill-invocation-message.d.ts +3 -3
  340. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  341. package/dist/modes/interactive/components/skill-invocation-message.js +29 -19
  342. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  343. package/dist/modes/interactive/components/theme-selector.d.ts +2 -2
  344. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  345. package/dist/modes/interactive/components/theme-selector.js +20 -25
  346. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  347. package/dist/modes/interactive/components/thinking-selector.d.ts +1 -1
  348. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  349. package/dist/modes/interactive/components/thinking-selector.js +19 -20
  350. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  351. package/dist/modes/interactive/components/tool-execution.d.ts +12 -10
  352. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  353. package/dist/modes/interactive/components/tool-execution.js +14 -8
  354. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  355. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  356. package/dist/modes/interactive/components/tree-selector.js +53 -60
  357. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  358. package/dist/modes/interactive/components/user-message-selector.d.ts +3 -9
  359. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  360. package/dist/modes/interactive/components/user-message-selector.js +57 -68
  361. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  362. package/dist/modes/interactive/components/visual-truncate.d.ts +0 -12
  363. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  364. package/dist/modes/interactive/components/visual-truncate.js +14 -22
  365. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  366. package/dist/modes/interactive/interactive-mode.d.ts +6 -0
  367. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  368. package/dist/modes/interactive/interactive-mode.js +118 -113
  369. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  370. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  371. package/dist/modes/interactive/theme/theme.js +189 -39
  372. package/dist/modes/interactive/theme/theme.js.map +1 -1
  373. package/dist/modes/rpc/rpc-client.d.ts +8 -1
  374. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  375. package/dist/modes/rpc/rpc-client.js +88 -59
  376. package/dist/modes/rpc/rpc-client.js.map +1 -1
  377. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  378. package/dist/modes/rpc/rpc-mode.js +24 -46
  379. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  380. package/dist/modes/rpc/rpc-types.d.ts +75 -409
  381. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  382. package/dist/modes/rpc/rpc-types.js +21 -360
  383. package/dist/modes/rpc/rpc-types.js.map +1 -1
  384. package/dist/observability/core/config.d.ts +28 -0
  385. package/dist/observability/core/config.d.ts.map +1 -0
  386. package/dist/observability/core/config.js +150 -0
  387. package/dist/observability/core/config.js.map +1 -0
  388. package/dist/observability/core/event-bus.d.ts +15 -0
  389. package/dist/observability/core/event-bus.d.ts.map +1 -0
  390. package/dist/observability/core/event-bus.js +37 -0
  391. package/dist/observability/core/event-bus.js.map +1 -0
  392. package/dist/observability/core/index.d.ts +12 -0
  393. package/dist/observability/core/index.d.ts.map +1 -0
  394. package/dist/observability/core/index.js +14 -0
  395. package/dist/observability/core/index.js.map +1 -0
  396. package/dist/observability/core/observability.d.ts +63 -0
  397. package/dist/observability/core/observability.d.ts.map +1 -0
  398. package/dist/observability/core/observability.js +127 -0
  399. package/dist/observability/core/observability.js.map +1 -0
  400. package/dist/observability/core/span.d.ts +37 -0
  401. package/dist/observability/core/span.d.ts.map +1 -0
  402. package/dist/observability/core/span.js +90 -0
  403. package/dist/observability/core/span.js.map +1 -0
  404. package/dist/observability/core/tracer.d.ts +22 -0
  405. package/dist/observability/core/tracer.d.ts.map +1 -0
  406. package/dist/observability/core/tracer.js +79 -0
  407. package/dist/observability/core/tracer.js.map +1 -0
  408. package/dist/observability/core/types.d.ts +155 -0
  409. package/dist/observability/core/types.d.ts.map +1 -0
  410. package/dist/observability/core/types.js +38 -0
  411. package/dist/observability/core/types.js.map +1 -0
  412. package/dist/observability/exporters/base-exporter.d.ts +16 -0
  413. package/dist/observability/exporters/base-exporter.d.ts.map +1 -0
  414. package/dist/observability/exporters/base-exporter.js +26 -0
  415. package/dist/observability/exporters/base-exporter.js.map +1 -0
  416. package/dist/observability/exporters/console-exporter.d.ts +22 -0
  417. package/dist/observability/exporters/console-exporter.d.ts.map +1 -0
  418. package/dist/observability/exporters/console-exporter.js +80 -0
  419. package/dist/observability/exporters/console-exporter.js.map +1 -0
  420. package/dist/observability/exporters/file-exporter.d.ts +31 -0
  421. package/dist/observability/exporters/file-exporter.d.ts.map +1 -0
  422. package/dist/observability/exporters/file-exporter.js +120 -0
  423. package/dist/observability/exporters/file-exporter.js.map +1 -0
  424. package/dist/observability/exporters/index.d.ts +12 -0
  425. package/dist/observability/exporters/index.d.ts.map +1 -0
  426. package/dist/observability/exporters/index.js +11 -0
  427. package/dist/observability/exporters/index.js.map +1 -0
  428. package/dist/observability/exporters/langfuse-exporter.d.ts +27 -0
  429. package/dist/observability/exporters/langfuse-exporter.d.ts.map +1 -0
  430. package/dist/observability/exporters/langfuse-exporter.js +146 -0
  431. package/dist/observability/exporters/langfuse-exporter.js.map +1 -0
  432. package/dist/observability/exporters/sentry-exporter.d.ts +22 -0
  433. package/dist/observability/exporters/sentry-exporter.d.ts.map +1 -0
  434. package/dist/observability/exporters/sentry-exporter.js +121 -0
  435. package/dist/observability/exporters/sentry-exporter.js.map +1 -0
  436. package/dist/observability/index.d.ts +3 -0
  437. package/dist/observability/index.d.ts.map +1 -0
  438. package/dist/observability/index.js +3 -0
  439. package/dist/observability/index.js.map +1 -0
  440. package/dist/utils/changelog.d.ts +1 -2
  441. package/dist/utils/changelog.d.ts.map +1 -1
  442. package/dist/utils/changelog.js +53 -61
  443. package/dist/utils/changelog.js.map +1 -1
  444. package/dist/utils/clipboard-image.d.ts.map +1 -1
  445. package/dist/utils/clipboard-image.js +77 -83
  446. package/dist/utils/clipboard-image.js.map +1 -1
  447. package/dist/utils/clipboard.d.ts.map +1 -1
  448. package/dist/utils/clipboard.js +62 -49
  449. package/dist/utils/clipboard.js.map +1 -1
  450. package/dist/utils/image-convert.d.ts +6 -6
  451. package/dist/utils/image-convert.d.ts.map +1 -1
  452. package/dist/utils/image-convert.js +29 -23
  453. package/dist/utils/image-convert.js.map +1 -1
  454. package/dist/utils/image-resize.d.ts +0 -17
  455. package/dist/utils/image-resize.d.ts.map +1 -1
  456. package/dist/utils/image-resize.js +100 -138
  457. package/dist/utils/image-resize.js.map +1 -1
  458. package/dist/utils/mime.d.ts +1 -0
  459. package/dist/utils/mime.d.ts.map +1 -1
  460. package/dist/utils/mime.js +35 -15
  461. package/dist/utils/mime.js.map +1 -1
  462. package/dist/utils/photon.d.ts +4 -15
  463. package/dist/utils/photon.d.ts.map +1 -1
  464. package/dist/utils/photon.js +71 -60
  465. package/dist/utils/photon.js.map +1 -1
  466. package/dist/utils/shell.d.ts +4 -21
  467. package/dist/utils/shell.d.ts.map +1 -1
  468. package/dist/utils/shell.js +101 -124
  469. package/dist/utils/shell.js.map +1 -1
  470. package/dist/utils/sleep.d.ts +1 -1
  471. package/dist/utils/sleep.d.ts.map +1 -1
  472. package/dist/utils/sleep.js +32 -8
  473. package/dist/utils/sleep.js.map +1 -1
  474. package/dist/utils/tools-manager.d.ts +4 -2
  475. package/dist/utils/tools-manager.d.ts.map +1 -1
  476. package/dist/utils/tools-manager.js +96 -122
  477. package/dist/utils/tools-manager.js.map +1 -1
  478. package/docs/PI_MONO_MIT_REMOVAL_GUIDE.md +2132 -0
  479. package/docs/SAME_TO_SAME_PARITY_REPORT.md +312 -0
  480. package/examples/README.md +12 -0
  481. package/package.json +60 -88
  482. package/LICENSE.md +0 -22
  483. package/dist/modes/interactive/theme/dark.json +0 -85
  484. package/dist/modes/interactive/theme/light.json +0 -84
  485. package/dist/modes/interactive/theme/theme-schema.json +0 -335
  486. package/docs/FEATURES.md +0 -306
  487. package/docs/MCP.md +0 -341
  488. package/docs/MEMORY.md +0 -443
  489. package/examples/mcp-servers.example.json +0 -50
@@ -0,0 +1,2132 @@
1
+ # PI Mono MIT Removal Guide for `indusagi-screth`
2
+
3
+
4
+
5
+ > **Important:** This is a technical provenance-cleanup guide, **not legal advice**. If you want to make a strong public claim like _"`indusagi-screth` contains no PI Mono derived code"_, you should still do a final legal/provenance review.
6
+
7
+
8
+
9
+ ## Goal
10
+
11
+
12
+
13
+ If the goal is to make `indusagi-screth` **PI Mono MIT-free**, the safe standard is:ß
14
+
15
+
16
+
17
+ 1. No copied PI Mono source files remain.
18
+
19
+ 2. No adapted/derived PI Mono files remain unless you are willing to keep MIT attribution.
20
+
21
+ 3. Third-party vendor assets are either:
22
+
23
+ - replaced by direct upstream package installation/build steps, or
24
+
25
+ - kept with their own proper attribution, independent of PI Mono.
26
+
27
+ 4. Documentation, package metadata, and marketing text do not imply PI Mono-derived implementation if that is no longer true.
28
+
29
+
30
+
31
+ ## What the current comparison shows
32
+
33
+
34
+
35
+ Compared repos:
36
+
37
+ - `@pi-mono/packages/coding-agent/`
38
+
39
+ - `@indusagi-screth/`
40
+
41
+
42
+
43
+ Current overlap snapshot:
44
+
45
+ - common relative paths: `121`
46
+
47
+ - exact identical files: `10`
48
+
49
+ - same path but different content: `111`
50
+
51
+
52
+
53
+ That means `indusagi-screth` is **not** currently in a position where it is safe to say _"PI Mono copyright does not apply"_. There is still enough exact and likely-derived overlap that a cleanup pass is required.
54
+
55
+
56
+
57
+ ---
58
+
59
+
60
+
61
+ # Priority plan
62
+
63
+
64
+
65
+ ## P0 — Rules before touching files
66
+
67
+
68
+
69
+ Before rewriting anything, follow these rules:
70
+
71
+
72
+
73
+ - Do **not** use PI Mono files as copy-paste sources during the rewrite.
74
+
75
+ - Rewrite from behavior/specification, not from line-by-line adaptation.
76
+
77
+ - Keep a provenance note for each rewritten file:
78
+
79
+ - `rewritten independently`
80
+
81
+ - `replaced with upstream vendor asset`
82
+
83
+ - `kept and MIT attribution retained`
84
+
85
+ - If a file is still PI Mono-derived after cleanup, keep MIT attribution for that file/subtree.
86
+
87
+
88
+
89
+ ---
90
+
91
+
92
+
93
+ ## P1 — Must rewrite first: exact identical files
94
+
95
+
96
+
97
+ These are the highest-risk files because they currently match PI Mono exactly.
98
+
99
+
100
+
101
+ ### P1-A. Exact code files to rewrite from scratch
102
+
103
+ - `src/core/compaction/index.ts` — similarity: 5.7%, difference: 94.3%, status: DIFFERENT
104
+
105
+ - `src/modes/index.ts` — similarity: 12.8%, difference: 87.2%, status: DIFFERENT
106
+
107
+ - `src/modes/interactive/components/diff.ts` — similarity: 10.1%, difference: 89.9%, status: DIFFERENT
108
+
109
+ - `src/utils/changelog.ts` — similarity: 25.7%, difference: 74.3%, status: DIFFERENT
110
+
111
+ - `src/utils/mime.ts` — similarity: 16.9%, difference: 83.1%, status: DIFFERENT
112
+
113
+ - `src/utils/photon.ts` — similarity: 17.4%, difference: 82.6%, status: DIFFERENT
114
+
115
+ - `src/utils/sleep.ts` — similarity: 18.5%, difference: 81.5%, status: DIFFERENT
116
+
117
+
118
+
119
+ ### P1-B. Exact vendor / asset files to replace properly
120
+
121
+ These should not stay as copied repo assets if the goal is "PI Mono MIT-free provenance".
122
+
123
+
124
+
125
+ - `src/core/export-html/template.html` — similarity: 43.1%, difference: 56.9%, status: DIFFERENT
126
+
127
+ - `src/core/export-html/vendor/highlight.min.js` — similarity: 68.6%, difference: 31.4%, status: DIFFERENT
128
+
129
+ - `src/core/export-html/vendor/marked.min.js` — similarity: 7.5%, difference: 92.5%, status: DIFFERENT
130
+
131
+
132
+
133
+ ### P1 action
134
+
135
+ For each file above, do one of:
136
+
137
+ - full independent rewrite, or
138
+
139
+ - replace from original upstream package/source with proper direct attribution, not via PI Mono copy.
140
+
141
+ ### P1 status update
142
+
143
+ P1 has now been executed for these files.
144
+ The original exact-match state is gone for this batch, and the percentages below reflect the **post-rewrite / post-replacement** state.
145
+
146
+ ### P1 review-first plan — minimal change, maximum effect
147
+
148
+ For this P1 set, the best strategy is **small rewrites with structural impact**.
149
+
150
+ That means:
151
+ - keep runtime behavior compatible where possible
152
+ - prefer rewriting the smallest exact-match files first
153
+ - change helper structure, export shape, naming model, and control flow
154
+ - avoid fake rewrites like only changing comments, spacing, quote style, or variable names
155
+
156
+ > **Important:** only changing names, comments, formatting, or coding style is **not enough** for a strong provenance-cleanup story. The code should be recognizably reimplemented, not cosmetically edited.
157
+
158
+ ### P1 recommended execution order
159
+
160
+ 1. `src/core/compaction/index.ts` — similarity: 5.7%, difference: 94.3%, status: DIFFERENT
161
+ 2. `src/modes/index.ts` — similarity: 12.8%, difference: 87.2%, status: DIFFERENT
162
+ 3. `src/utils/sleep.ts` — similarity: 18.5%, difference: 81.5%, status: DIFFERENT
163
+ 4. `src/utils/mime.ts` — similarity: 16.9%, difference: 83.1%, status: DIFFERENT
164
+ 5. `src/utils/changelog.ts` — similarity: 25.7%, difference: 74.3%, status: DIFFERENT
165
+ 6. `src/utils/photon.ts` — similarity: 17.4%, difference: 82.6%, status: DIFFERENT
166
+ 7. `src/modes/interactive/components/diff.ts` — similarity: 10.1%, difference: 89.9%, status: DIFFERENT
167
+ 8. `src/core/export-html/template.html` — similarity: 43.1%, difference: 56.9%, status: DIFFERENT
168
+ 9. `src/core/export-html/vendor/highlight.min.js` — similarity: 68.6%, difference: 31.4%, status: DIFFERENT
169
+ 10. `src/core/export-html/vendor/marked.min.js` — similarity: 7.5%, difference: 92.5%, status: DIFFERENT
170
+
171
+ ### P1 per-file plan
172
+
173
+ #### `src/core/compaction/index.ts` — similarity: 5.7%, difference: 94.3%, status: DIFFERENT
174
+
175
+ **Why first:** tiny barrel file, low risk, fast win.
176
+
177
+ **Minimal but meaningful rewrite:**
178
+ - replace wildcard re-exports with explicit named exports
179
+ - import from child modules first, then re-export
180
+ - optionally add a small grouped export object like `compactionApi`
181
+
182
+ **Avoid:**
183
+ - changing only the header comment
184
+ - reordering the same `export *` lines
185
+
186
+ #### `src/modes/index.ts` — similarity: 12.8%, difference: 87.2%, status: DIFFERENT
187
+
188
+ **Why first:** also tiny and easy to rewrite cleanly.
189
+
190
+ **Minimal but meaningful rewrite:**
191
+ - stop using the same export arrangement
192
+ - import values/types explicitly and export them in a new grouped shape
193
+ - optionally add a small local `modes` registry object
194
+
195
+ **Avoid:**
196
+ - same barrel pattern with only reordered lines
197
+
198
+ #### `src/utils/sleep.ts` — similarity: 18.5%, difference: 81.5%, status: DIFFERENT
199
+
200
+ **Minimal but meaningful rewrite:**
201
+ - split abort handling into helpers
202
+ - add a local `createAbortError()` helper
203
+ - ensure listener cleanup with `{ once: true }` or explicit removal
204
+ - keep public API compatible
205
+
206
+ **Suggested rewrite shape:**
207
+ - `createAbortError()`
208
+ - `bindAbortHandler()`
209
+ - `sleep()` orchestrates the promise
210
+
211
+ #### `src/utils/mime.ts` — similarity: 16.9%, difference: 83.1%, status: DIFFERENT
212
+
213
+ **Minimal but meaningful rewrite:**
214
+ - separate file reading from MIME validation
215
+ - add a helper like `isSupportedImageMimeType()`
216
+ - optionally add extension fallback logic
217
+ - keep the top-level exported API stable if needed
218
+
219
+ **Suggested rewrite shape:**
220
+ - `readHeaderBytes()`
221
+ - `detectMimeFromBuffer()`
222
+ - `isSupportedImageMimeType()`
223
+ - `detectSupportedImageMimeTypeFromFile()`
224
+
225
+ #### `src/utils/changelog.ts` — similarity: 25.7%, difference: 74.3%, status: DIFFERENT
226
+
227
+ **Minimal but meaningful rewrite:**
228
+ - switch from line-by-line state tracking to section splitting
229
+ - isolate version parsing and comparison logic
230
+ - keep external behavior but use a different parser structure
231
+
232
+ **Suggested rewrite shape:**
233
+ - `parseVersionString()`
234
+ - `splitReleaseSections()`
235
+ - `toChangelogEntry()`
236
+ - `isVersionNewer()`
237
+
238
+ #### `src/utils/photon.ts` — similarity: 17.4%, difference: 82.6%, status: DIFFERENT
239
+
240
+ **Why important:** bigger utility with real logic; more provenance value if rewritten.
241
+
242
+ **Minimal but meaningful rewrite:**
243
+ - break the wasm fallback flow into separate helpers
244
+ - separate candidate path generation from fs patching
245
+ - separate module caching from load orchestration
246
+
247
+ **Suggested rewrite shape:**
248
+ - `resolvePhotonWasmCandidates()`
249
+ - `installPhotonReadPatch()`
250
+ - `loadPhotonModuleOnce()`
251
+ - `loadPhoton()` as public wrapper
252
+
253
+ **Avoid:**
254
+ - only renaming internal variables like `photonModule` / `loadPromise`
255
+
256
+ #### `src/modes/interactive/components/diff.ts` — similarity: 10.1%, difference: 89.9%, status: DIFFERENT
257
+
258
+ **Why important:** this is the main P1 code file where structure matters.
259
+
260
+ **Minimal but meaningful rewrite:**
261
+ - keep the same output contract, but redesign internals
262
+ - separate parsing, pairing, highlighting, and rendering phases
263
+ - use an intermediate row model instead of inline loop-heavy rendering
264
+
265
+ **Suggested rewrite shape:**
266
+ - `tokenizeDiffLines()`
267
+ - `groupDiffBlocks()`
268
+ - `highlightChangedLinePair()`
269
+ - `renderDiffRows()`
270
+ - `renderDiff()` becomes orchestration only
271
+
272
+ #### `src/core/export-html/template.html` — similarity: 43.1%, difference: 56.9%, status: DIFFERENT
273
+
274
+ **Minimal but meaningful rewrite:**
275
+ - change the DOM structure and placeholder ordering
276
+ - rename IDs/classes to your own layout vocabulary
277
+ - reorganize sidebar/header/message sections while keeping runtime compatibility
278
+
279
+ **Suggested rewrite:**
280
+ - new sidebar markup
281
+ - new toolbar/header structure
282
+ - different search/filter button layout
283
+ - different script/style injection order if safe
284
+
285
+ #### `src/core/export-html/vendor/highlight.min.js` — similarity: 68.6%, difference: 31.4%, status: DIFFERENT
286
+ #### `src/core/export-html/vendor/marked.min.js` — similarity: 7.5%, difference: 92.5%, status: DIFFERENT
287
+
288
+ These should **not** be hand-edited.
289
+
290
+ **Recommended replacement plan:**
291
+ - remove copied versions from repo provenance chain
292
+ - source them directly from the real upstream package or release asset
293
+ - document exact upstream version and license separately
294
+ - wire build/copy scripts to fetch or copy from upstream-installed packages
295
+
296
+ ### P1 rule of thumb
297
+
298
+ **Not enough:**
299
+ - rename variables
300
+ - change comments
301
+ - change quote style
302
+ - change formatting
303
+ - reorder imports only
304
+
305
+ **Good enough for a P1 rewrite pass:**
306
+ - new helper decomposition
307
+ - new export/module structure
308
+ - new control-flow shape
309
+ - new intermediate data model
310
+ - same behavior implemented through a different code path
311
+ - vendor assets replaced from direct upstream instead of PI Mono copies
312
+
313
+
314
+
315
+ ---
316
+
317
+
318
+
319
+ ## P2 — Highest-priority likely-derived runtime files
320
+
321
+
322
+
323
+ These files are not byte-identical, but they share the same path and likely share heavy structural derivation risk. Rewrite these next.
324
+
325
+
326
+
327
+ ### P2-A. App/bootstrap/runtime entrypoints
328
+
329
+ - `src/cli.ts` — similarity: 40.7%, difference: 59.3%, status: DIFFERENT
330
+
331
+ - `src/config.ts` — similarity: 80.4%, difference: 19.6%, status: DIFFERENT
332
+
333
+ - `src/index.ts` — similarity: 6.7%, difference: 93.3%, status: DIFFERENT
334
+
335
+ - `src/main.ts` — similarity: 57.0%, difference: 43.0%, status: DIFFERENT
336
+
337
+ - `src/migrations.ts` — similarity: 12.4%, difference: 87.6%, status: DIFFERENT
338
+
339
+
340
+
341
+ ### P2-B. CLI subsystem
342
+
343
+ - `src/cli/args.ts` — similarity: 45.2%, difference: 54.8%, status: DIFFERENT
344
+
345
+ - `src/cli/config-selector.ts` — similarity: 17.1%, difference: 82.9%, status: DIFFERENT
346
+
347
+ - `src/cli/file-processor.ts` — similarity: 8.9%, difference: 91.1%, status: DIFFERENT
348
+
349
+ - `src/cli/list-models.ts` — similarity: 13.7%, difference: 86.3%, status: DIFFERENT
350
+
351
+ - `src/cli/session-picker.ts` — similarity: 8.3%, difference: 91.7%, status: DIFFERENT
352
+
353
+
354
+
355
+ ### P2-C. Core session/runtime orchestration
356
+
357
+ - `src/core/agent-session.ts` — similarity: 75.2%, difference: 24.8%, status: DIFFERENT
358
+
359
+ - `src/core/auth-storage.ts` — similarity: 42.3%, difference: 57.7%, status: DIFFERENT
360
+
361
+ - `src/core/bash-executor.ts` — similarity: 6.6%, difference: 93.4%, status: DIFFERENT
362
+
363
+ - `src/core/diagnostics.ts` — similarity: 11.3%, difference: 88.7%, status: DIFFERENT
364
+
365
+ - `src/core/event-bus.ts` — similarity: 28.6%, difference: 71.4%, status: DIFFERENT
366
+
367
+ - `src/core/exec.ts` — similarity: 19.8%, difference: 80.2%, status: DIFFERENT
368
+
369
+ - `src/core/footer-data-provider.ts` — similarity: 4.2%, difference: 95.8%, status: DIFFERENT
370
+
371
+ - `src/core/index.ts` — similarity: 3.5%, difference: 96.5%, status: DIFFERENT
372
+
373
+ - `src/core/keybindings.ts` — similarity: 13.2%, difference: 86.8%, status: DIFFERENT
374
+
375
+ - `src/core/messages.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
376
+
377
+ - `src/core/model-registry.ts` — similarity: 64.1%, difference: 35.9%, status: DIFFERENT
378
+
379
+ - `src/core/model-resolver.ts` — similarity: 7.4%, difference: 92.6%, status: DIFFERENT
380
+
381
+ - `src/core/package-manager.ts` — similarity: 3.4%, difference: 96.6%, status: DIFFERENT
382
+
383
+ - `src/core/prompt-templates.ts` — similarity: 99.3%, difference: 0.7%, status: DIFFERENT
384
+
385
+ - `src/core/resource-loader.ts` — similarity: 84.7%, difference: 15.3%, status: DIFFERENT
386
+
387
+ - `src/core/sdk.ts` — similarity: 70.9%, difference: 29.1%, status: DIFFERENT
388
+
389
+ - `src/core/session-manager.ts` — similarity: 93.2%, difference: 6.8%, status: DIFFERENT
390
+
391
+ - `src/core/settings-manager.ts` — similarity: 61.7%, difference: 38.3%, status: DIFFERENT
392
+
393
+ - `src/core/skills.ts` — similarity: 82.9%, difference: 17.1%, status: DIFFERENT
394
+
395
+ - `src/core/system-prompt.ts` — similarity: 53.3%, difference: 46.7%, status: DIFFERENT
396
+
397
+ - `src/core/timings.ts` — similarity: 32.0%, difference: 68.0%, status: DIFFERENT
398
+
399
+
400
+
401
+ ### P2-D. Compaction/runtime helpers
402
+
403
+ - `src/core/compaction/branch-summarization.ts` — similarity: 98.6%, difference: 1.4%, status: DIFFERENT
404
+
405
+ - `src/core/compaction/compaction.ts` — similarity: 98.5%, difference: 1.5%, status: DIFFERENT
406
+
407
+ - `src/core/compaction/utils.ts` — similarity: 92.9%, difference: 7.1%, status: DIFFERENT
408
+
409
+
410
+
411
+ ### Why P2 is critical
412
+
413
+ If these remain structurally PI Mono-derived, then even rewriting surface docs or utilities will not materially change provenance risk.
414
+
415
+ ### Focused P2 plan for the currently requested files
416
+
417
+ **P2 status update:** the planned rewrite batch for these focused P2 files has now been executed in `indusagi-screth`, and the codebase still builds/tests cleanly afterward.
418
+
419
+ ### Focused P2 post-rewrite recheck (approximate)
420
+
421
+ **Method note:** the percentages below are an approximate **post-P2** recheck against `@pi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
422
+
423
+ | File | Post-P2 similarity | Post-P2 difference |
424
+ |---|---:|---:|
425
+ | `src/core/timings.ts` | `15.9%` | `84.1%` |
426
+ | `src/cli.ts` | `11.3%` | `88.7%` |
427
+ | `src/cli/args.ts` | `10.0%` | `90.0%` |
428
+ | `src/config.ts` | `31.0%` | `69.0%` |
429
+ | `src/core/auth-storage.ts` | `26.8%` | `73.2%` |
430
+ | `src/core/system-prompt.ts` | `16.7%` | `83.3%` |
431
+ | `src/core/model-registry.ts` | `23.5%` | `76.5%` |
432
+ | `src/core/prompt-templates.ts` | `30.9%` | `69.1%` |
433
+ | `src/core/skills.ts` | `28.2%` | `71.8%` |
434
+ | `src/core/settings-manager.ts` | `22.8%` | `77.2%` |
435
+ | `src/core/resource-loader.ts` | `34.4%` | `65.6%` |
436
+ | `src/core/sdk.ts` | `30.5%` | `69.5%` |
437
+ | `src/core/session-manager.ts` | `15.2%` | `84.8%` |
438
+ | `src/main.ts` | `25.9%` | `74.1%` |
439
+ | `src/core/agent-session.ts` | `21.0%` | `79.0%` |
440
+
441
+ ### Focused P2 post-rewrite takeaway
442
+
443
+ This recheck suggests the biggest previously high-similarity P2 files have moved materially away from PI Mono structure in this batch. In particular:
444
+
445
+ - `src/core/prompt-templates.ts` moved from the earlier near-match risk zone to `30.9%` similarity / `69.1%` difference.
446
+ - `src/core/session-manager.ts` moved from the earlier near-match risk zone to `15.2%` similarity / `84.8%` difference.
447
+ - The remaining focused P2 files in this batch now sit broadly in the `10%`–`34%` similarity range under this approximation.
448
+
449
+ The files you called out are spread across bootstrap, CLI parsing, runtime orchestration, config, prompt loading, and persistence. The safest plan is to rewrite them in **dependency order**, not by raw similarity alone.
450
+
451
+ ### Focused P2 execution order
452
+
453
+ #### Wave 1 — low-blast-radius foundation first
454
+ 1. `src/core/timings.ts` — similarity: 32.0%, difference: 68.0%, status: DIFFERENT
455
+ 2. `src/cli.ts` — similarity: 40.7%, difference: 59.3%, status: DIFFERENT
456
+ 3. `src/cli/args.ts` — similarity: 45.2%, difference: 54.8%, status: DIFFERENT
457
+ 4. `src/config.ts` — similarity: 80.4%, difference: 19.6%, status: DIFFERENT
458
+ 5. `src/core/auth-storage.ts` — similarity: 42.3%, difference: 57.7%, status: DIFFERENT
459
+ 6. `src/core/system-prompt.ts` — similarity: 53.3%, difference: 46.7%, status: DIFFERENT
460
+
461
+ #### Wave 2 — content/model/config loading layer
462
+ 7. `src/core/model-registry.ts` — similarity: 64.1%, difference: 35.9%, status: DIFFERENT
463
+ 8. `src/core/prompt-templates.ts` — similarity: 99.3%, difference: 0.7%, status: DIFFERENT
464
+ 9. `src/core/skills.ts` — similarity: 82.9%, difference: 17.1%, status: DIFFERENT
465
+ 10. `src/core/settings-manager.ts` — similarity: 61.7%, difference: 38.3%, status: DIFFERENT
466
+ 11. `src/core/resource-loader.ts` — similarity: 84.7%, difference: 15.3%, status: DIFFERENT
467
+
468
+ #### Wave 3 — runtime/session API layer
469
+ 12. `src/core/sdk.ts` — similarity: 70.9%, difference: 29.1%, status: DIFFERENT
470
+ 13. `src/core/session-manager.ts` — similarity: 93.2%, difference: 6.8%, status: DIFFERENT
471
+
472
+ #### Wave 4 — top-level orchestration last
473
+ 14. `src/main.ts` — similarity: 57.0%, difference: 43.0%, status: DIFFERENT
474
+ 15. `src/core/agent-session.ts` — similarity: 75.2%, difference: 24.8%, status: DIFFERENT
475
+
476
+ ### Focused P2 per-file rewrite plan
477
+
478
+ #### `src/core/timings.ts` — similarity: 32.0%, difference: 68.0%, status: DIFFERENT
479
+ **Why first:** tiny file, quick provenance win, almost zero integration risk.
480
+
481
+ **Minimal but meaningful rewrite:**
482
+ - replace current module-level mutable state with a small tracker object
483
+ - add `resetTimings()` helper
484
+ - move formatting into a dedicated printer helper
485
+ - keep `time()` and `printTimings()` public API stable
486
+
487
+ **Suggested rewrite shape:**
488
+ - `createTimingRecorder()`
489
+ - `recordTiming()`
490
+ - `formatTimingReport()`
491
+ - `printTimings()`
492
+
493
+ #### `src/cli.ts` — similarity: 40.7%, difference: 59.3%, status: DIFFERENT
494
+ **Why early:** small entrypoint, easy to rewrite fully.
495
+
496
+ **Minimal but meaningful rewrite:**
497
+ - move MCP log suppression into named helper(s)
498
+ - avoid top-level anonymous patch structure copied from PI Mono style
499
+ - introduce a `bootstrapCli()` wrapper that owns process-title + logger patch + main invocation
500
+
501
+ **Suggested rewrite shape:**
502
+ - `shouldSuppressMcpLogs()`
503
+ - `installCliLogFilter()`
504
+ - `bootstrapCli()`
505
+
506
+ #### `src/cli/args.ts` — similarity: 45.2%, difference: 54.8%, status: DIFFERENT
507
+ **Why now:** it affects `main.ts`, but is still isolated enough to rewrite before orchestration files.
508
+
509
+ **Minimal but meaningful rewrite:**
510
+ - split parser into token readers, validators, and normalizers
511
+ - separate flag alias table from parse loop
512
+ - separate tool parsing / model parsing / extension flag parsing into helpers
513
+ - keep external `Args`, `parseArgs()`, and `printHelp()` API compatible where possible
514
+
515
+ **Suggested rewrite shape:**
516
+ - `consumeFlagValue()`
517
+ - `parseModeFlag()`
518
+ - `parseToolList()`
519
+ - `parseUnknownExtensionFlag()`
520
+ - `buildHelpSections()`
521
+
522
+ #### `src/config.ts` — similarity: 80.4%, difference: 19.6%, status: DIFFERENT
523
+ **Why early despite high similarity:** many other files depend on it, so it should be stabilized before deeper rewrites.
524
+
525
+ **Minimal but meaningful rewrite:**
526
+ - separate package-root detection from exported path helpers
527
+ - centralize env var resolution and tilde expansion
528
+ - group asset path helpers vs user config path helpers vs metadata exports
529
+ - reduce structural resemblance to current PI Mono layout even if behavior stays the same
530
+
531
+ **Suggested rewrite shape:**
532
+ - `resolvePackageRoot()`
533
+ - `resolveBundledAssetDir()`
534
+ - `expandHomeDir()`
535
+ - `resolveAgentDirFromEnv()`
536
+
537
+ #### `src/core/auth-storage.ts` — similarity: 42.3%, difference: 57.7%, status: DIFFERENT
538
+ **Why early:** medium complexity, low coupling compared with session runtime.
539
+
540
+ **Minimal but meaningful rewrite:**
541
+ - split disk I/O, migration, account selection, runtime override logic, and token refresh into separate helpers
542
+ - replace monolithic class flow with clear layers
543
+ - preserve public class API if possible
544
+
545
+ **Suggested rewrite shape:**
546
+ - `loadAuthFile()`
547
+ - `normalizeAuthData()`
548
+ - `selectAccountId()`
549
+ - `persistAuthData()`
550
+ - `resolveCredentialSource()`
551
+
552
+ #### `src/core/system-prompt.ts` — similarity: 53.3%, difference: 46.7%, status: DIFFERENT
553
+ **Why early:** many runtime files depend on it, but it is still very rewriteable.
554
+
555
+ **Minimal but meaningful rewrite:**
556
+ - replace current one-pass assembly with section builders
557
+ - split tool list rendering, guideline rendering, docs path rendering, context rendering, skills rendering
558
+ - keep final `buildSystemPrompt()` export stable
559
+
560
+ **Suggested rewrite shape:**
561
+ - `buildToolSection()`
562
+ - `buildGuidelinesSection()`
563
+ - `buildDocsSection()`
564
+ - `buildProjectContextSection()`
565
+ - `buildSkillsSection()`
566
+ - `assembleSystemPrompt()`
567
+
568
+ #### `src/core/model-registry.ts` — similarity: 64.1%, difference: 35.9%, status: DIFFERENT
569
+ **Minimal but meaningful rewrite:**
570
+ - split schema validation, built-in provider loading, custom provider registration, and API key resolution into separate units
571
+ - replace current config-loading order implementation shape with explicit phases
572
+ - keep public registry behavior compatible
573
+
574
+ **Suggested rewrite shape:**
575
+ - `loadBuiltInModels()`
576
+ - `loadCustomModelsConfig()`
577
+ - `applyProviderOverrides()`
578
+ - `resolveModelApiKey()`
579
+ - `registerExtensionProvider()`
580
+
581
+ #### `src/core/prompt-templates.ts` — similarity: 99.3%, difference: 0.7%, status: DIFFERENT
582
+ **This is the biggest P2 risk by percentage.**
583
+
584
+ **Minimal but meaningful rewrite:**
585
+ - replace current parser flow with a clearer staged pipeline
586
+ - separate arg tokenization, placeholder substitution, file loading, and directory discovery
587
+ - preserve the same public function names if needed, but rewrite the internal implementation shape substantially
588
+
589
+ **Suggested rewrite shape:**
590
+ - `tokenizeTemplateArguments()`
591
+ - `applyTemplateArguments()`
592
+ - `readPromptTemplateFile()`
593
+ - `discoverPromptTemplateFiles()`
594
+ - `mergePromptSources()`
595
+
596
+ #### `src/core/skills.ts` — similarity: 82.9%, difference: 17.1%, status: DIFFERENT
597
+ **Minimal but meaningful rewrite:**
598
+ - separate validation rules from directory traversal
599
+ - separate skill parsing from diagnostics emission
600
+ - replace recursive loader flow with a discovery + transform + validate pipeline
601
+
602
+ **Suggested rewrite shape:**
603
+ - `discoverSkillCandidateFiles()`
604
+ - `parseSkillDocument()`
605
+ - `validateSkillFrontmatter()`
606
+ - `buildSkillDiagnostics()`
607
+
608
+ #### `src/core/settings-manager.ts` — similarity: 61.7%, difference: 38.3%, status: DIFFERENT
609
+ **Minimal but meaningful rewrite:**
610
+ - split file persistence, project/global merge logic, getter/setter helpers, and path normalization
611
+ - avoid one giant stateful class implementation style
612
+ - keep public API compatibility where current runtime depends on it
613
+
614
+ **Suggested rewrite shape:**
615
+ - `loadSettingsFile()`
616
+ - `mergeSettingsLayers()`
617
+ - `normalizeSettingsPaths()`
618
+ - `createSettingsSnapshot()`
619
+ - `persistSettingsLayer()`
620
+
621
+ #### `src/core/resource-loader.ts` — similarity: 84.7%, difference: 15.3%, status: DIFFERENT
622
+ **Why after settings/skills/prompts:** it composes those systems.
623
+
624
+ **Minimal but meaningful rewrite:**
625
+ - replace current class-heavy load orchestration with explicit reload phases
626
+ - separate context file loading, extension loading, hook loading, skill loading, prompt loading, and theme loading into dedicated helpers
627
+ - keep `DefaultResourceLoader` public surface compatible if needed
628
+
629
+ **Suggested rewrite shape:**
630
+ - `loadProjectContextFiles()`
631
+ - `loadExtensionResources()`
632
+ - `loadHookResources()`
633
+ - `loadSkillResources()`
634
+ - `loadPromptResources()`
635
+ - `loadThemeResources()`
636
+ - `composeResourceSnapshot()`
637
+
638
+ #### `src/core/sdk.ts` — similarity: 70.9%, difference: 29.1%, status: DIFFERENT
639
+ **Why later:** it wires together many subsystems, so it should be rewritten after those subsystems are stabilized.
640
+
641
+ **Minimal but meaningful rewrite:**
642
+ - split default creation of auth/model/settings/resource/session into separate factories
643
+ - separate MCP/memory initialization from base agent session construction
644
+ - keep `createAgentSession()` and its return shape compatible if possible
645
+
646
+ **Suggested rewrite shape:**
647
+ - `createDefaultAuthStorage()`
648
+ - `createDefaultRegistry()`
649
+ - `createDefaultResourceLoader()`
650
+ - `createBaseTools()`
651
+ - `attachOptionalMcpTools()`
652
+ - `attachOptionalMemoryTools()`
653
+
654
+ #### `src/core/session-manager.ts` — similarity: 93.2%, difference: 6.8%, status: DIFFERENT
655
+ **This is one of the highest-priority P2 rewrites by similarity.**
656
+
657
+ **Minimal but meaningful rewrite:**
658
+ - keep file format compatibility but redesign internal structure
659
+ - split file I/O, branch traversal, entry indexing, tree reconstruction, and append operations into separate helpers
660
+ - avoid leaving the same method/layout structure even if behavior remains the same
661
+
662
+ **Suggested rewrite shape:**
663
+ - `readSessionHeader()`
664
+ - `readSessionEntries()`
665
+ - `buildEntryIndex()`
666
+ - `buildSessionTree()`
667
+ - `appendSessionEntry()`
668
+ - `resolveBranchPath()`
669
+
670
+ #### `src/main.ts` — similarity: 57.0%, difference: 43.0%, status: DIFFERENT
671
+ **Why near the end:** it depends on many of the files above.
672
+
673
+ **Minimal but meaningful rewrite:**
674
+ - separate CLI command dispatch, model loading, package/resource initialization, session creation, and mode dispatch
675
+ - replace current top-to-bottom orchestration flow with staged command handlers
676
+
677
+ **Suggested rewrite shape:**
678
+ - `handleUtilityCommands()`
679
+ - `resolveStartupResources()`
680
+ - `createSessionFromArgs()`
681
+ - `runSelectedMode()`
682
+ - `shutdownRuntime()`
683
+
684
+ #### `src/core/agent-session.ts` — similarity: 75.2%, difference: 24.8%, status: DIFFERENT
685
+ **Save for last in this batch.** It is high-value but very high-blast-radius.
686
+
687
+ **Minimal but meaningful rewrite:**
688
+ - split this class by concern before deep logic rewrites
689
+ - move tool/runtime rebuild logic, event dispatch, retry logic, compaction logic, and session switching helpers into grouped private helpers or companion modules
690
+ - keep public behavior stable while changing internal architecture substantially
691
+
692
+ **Suggested rewrite shape:**
693
+ - `buildRuntimeState()`
694
+ - `wireAgentEventHandlers()`
695
+ - `handlePromptFlow()`
696
+ - `handleRetryFlow()`
697
+ - `handleCompactionFlow()`
698
+ - `handleSessionSwitchFlow()`
699
+
700
+ ### Focused P2 rule of thumb
701
+
702
+ **Not enough:**
703
+ - renaming methods only
704
+ - moving code blocks around without redesigning them
705
+ - changing comments/docstrings only
706
+ - changing type names while leaving control flow the same
707
+
708
+ **Good enough for a meaningful P2 rewrite pass:**
709
+ - introducing new helper layers
710
+ - changing orchestration phases and boundaries
711
+ - splitting monoliths into loaders/builders/assemblers
712
+ - preserving API behavior while changing implementation structure substantially
713
+ - keeping file-format compatibility without keeping the same internal architecture
714
+
715
+ ### Focused P2 practical note
716
+
717
+ For this batch, the two biggest hidden-risk files are:
718
+ - `src/core/prompt-templates.ts` — because its similarity is still `99.3%`
719
+ - `src/core/session-manager.ts` — because its similarity is still `93.2%`
720
+
721
+ So even if `agent-session.ts` is more important functionally, the **highest-priority provenance wins** inside this batch are:
722
+ 1. `src/core/prompt-templates.ts`
723
+ 2. `src/core/session-manager.ts`
724
+ 3. `src/core/resource-loader.ts`
725
+ 4. `src/core/skills.ts`
726
+ 5. `src/config.ts`
727
+
728
+ ---
729
+
730
+
731
+
732
+ ## P3 — Extension / tools / mode system rewrite group
733
+
734
+
735
+
736
+ These are also high-risk because they define the user-visible architecture and behavior.
737
+
738
+
739
+
740
+ ### P3-A. Extensions subsystem
741
+
742
+ - `src/core/extensions/index.ts` — similarity: 87.9%, difference: 12.1%, status: DIFFERENT
743
+
744
+ - `src/core/extensions/loader.ts` — similarity: 89.2%, difference: 10.8%, status: DIFFERENT
745
+
746
+ - `src/core/extensions/runner.ts` — similarity: 79.5%, difference: 20.5%, status: DIFFERENT
747
+
748
+ - `src/core/extensions/types.ts` — similarity: 87.0%, difference: 13.0%, status: DIFFERENT
749
+
750
+ - `src/core/extensions/wrapper.ts` — similarity: 26.0%, difference: 74.0%, status: DIFFERENT
751
+
752
+
753
+
754
+ ### P3-B. Tools subsystem
755
+
756
+ - `src/core/tools/bash.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
757
+
758
+ - `src/core/tools/edit-diff.ts` — similarity: 3.7%, difference: 96.3%, status: DIFFERENT
759
+
760
+ - `src/core/tools/edit.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
761
+
762
+ - `src/core/tools/find.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
763
+
764
+ - `src/core/tools/grep.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
765
+
766
+ - `src/core/tools/index.ts` — similarity: 26.1%, difference: 73.9%, status: DIFFERENT
767
+
768
+ - `src/core/tools/ls.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
769
+
770
+ - `src/core/tools/path-utils.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
771
+
772
+ - `src/core/tools/read.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
773
+
774
+ - `src/core/tools/truncate.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
775
+
776
+ - `src/core/tools/write.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
777
+
778
+
779
+
780
+ ### P3-C. Interactive mode root
781
+
782
+ - `src/modes/interactive/interactive-mode.ts` — similarity: 69.4%, difference: 30.6%, status: DIFFERENT
783
+
784
+ - `src/modes/print-mode.ts` — similarity: 22.0%, difference: 78.0%, status: DIFFERENT
785
+
786
+ - `src/modes/rpc/rpc-client.ts` — similarity: 48.9%, difference: 51.1%, status: DIFFERENT
787
+
788
+ - `src/modes/rpc/rpc-mode.ts` — similarity: 51.0%, difference: 49.0%, status: DIFFERENT
789
+
790
+ - `src/modes/rpc/rpc-types.ts` — similarity: 52.4%, difference: 47.6%, status: DIFFERENT
791
+
792
+
793
+
794
+ ### P3-D. Theme system
795
+
796
+ - `src/modes/interactive/theme/theme.ts` — similarity: 83.5%, difference: 16.5%, status: DIFFERENT
797
+
798
+ - `src/modes/interactive/theme/dark.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
799
+
800
+ - `src/modes/interactive/theme/light.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
801
+
802
+ - `src/modes/interactive/theme/theme-schema.json` — similarity: 99.4%, difference: 0.6%, status: DIFFERENT
803
+
804
+ ### Focused P3 plan for the currently requested files
805
+
806
+ The files you called out span three tightly coupled subsystems:
807
+ - extension registration/runtime contracts
808
+ - RPC mode transport/types
809
+ - interactive mode + theme runtime/assets
810
+
811
+ Because these drive the visible architecture of the product, the safest plan is to rewrite them in **contract order**: first extension types/runtime contracts, then loaders/runners, then RPC protocol/runtime, then interactive root, then theme runtime/assets.
812
+
813
+ ### Focused P3 execution order
814
+
815
+ #### Wave 1 — extension contract layer first
816
+ 1. `src/core/extensions/types.ts` — similarity: 87.0%, difference: 13.0%, status: DIFFERENT
817
+ 2. `src/core/extensions/index.ts` — similarity: 87.9%, difference: 12.1%, status: DIFFERENT
818
+
819
+ #### Wave 2 — extension runtime/loading layer
820
+ 3. `src/core/extensions/loader.ts` — similarity: 89.2%, difference: 10.8%, status: DIFFERENT
821
+ 4. `src/core/extensions/runner.ts` — similarity: 79.5%, difference: 20.5%, status: DIFFERENT
822
+
823
+ #### Wave 3 — RPC protocol and transport layer
824
+ 5. `src/modes/rpc/rpc-types.ts` — similarity: 52.4%, difference: 47.6%, status: DIFFERENT
825
+ 6. `src/modes/rpc/rpc-client.ts` — similarity: 48.9%, difference: 51.1%, status: DIFFERENT
826
+ 7. `src/modes/rpc/rpc-mode.ts` — similarity: 51.0%, difference: 49.0%, status: DIFFERENT
827
+
828
+ #### Wave 4 — interactive root layer
829
+ 8. `src/modes/interactive/interactive-mode.ts` — similarity: 69.4%, difference: 30.6%, status: DIFFERENT
830
+
831
+ #### Wave 5 — theme runtime and assets last in this subset
832
+ 9. `src/modes/interactive/theme/theme.ts` — similarity: 83.5%, difference: 16.5%, status: DIFFERENT
833
+ 10. `src/modes/interactive/theme/dark.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
834
+ 11. `src/modes/interactive/theme/light.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
835
+ 12. `src/modes/interactive/theme/theme-schema.json` — similarity: 99.4%, difference: 0.6%, status: DIFFERENT
836
+
837
+ ### Focused P3 per-file rewrite plan
838
+
839
+ #### `src/core/extensions/types.ts` — similarity: 87.0%, difference: 13.0%, status: DIFFERENT
840
+ **Why first:** this is the contract surface for the whole extension system. If it stays structurally close, loader/runner rewrites do not help enough.
841
+
842
+ **Minimal but meaningful rewrite:**
843
+ - split giant type surface into grouped sections with clearer ownership boundaries
844
+ - separate UI contracts, runtime contracts, event contracts, tool contracts, and provider contracts into distinct type clusters
845
+ - replace long flat export flow with structured helper aliases / grouped interfaces while preserving external names where needed
846
+
847
+ **Suggested rewrite shape:**
848
+ - `ExtensionUiContracts`
849
+ - `ExtensionRuntimeContracts`
850
+ - `ExtensionEventContracts`
851
+ - `ExtensionToolContracts`
852
+ - `ExtensionProviderContracts`
853
+
854
+ #### `src/core/extensions/index.ts` — similarity: 87.9%, difference: 12.1%, status: DIFFERENT
855
+ **Why early:** barrel files can preserve architecture shape very strongly.
856
+
857
+ **Minimal but meaningful rewrite:**
858
+ - stop mirroring the original export grouping/layout
859
+ - replace large flat export block with curated grouped exports and explicit public-surface comments
860
+ - restructure the barrel around runtime roles instead of source-file mirroring
861
+
862
+ **Suggested rewrite shape:**
863
+ - `export type { ... }` grouped by concern
864
+ - `export { ... }` grouped by runtime, wrapping, loading
865
+ - explicit “public API” subsections
866
+
867
+ #### `src/core/extensions/loader.ts` — similarity: 89.2%, difference: 10.8%, status: DIFFERENT
868
+ **This is one of the highest-priority P3 rewrites.**
869
+
870
+ **Minimal but meaningful rewrite:**
871
+ - separate path normalization, module resolution, runtime creation, API creation, module loading, and conflict-safe registration into distinct helpers
872
+ - reduce the current long procedural flow into staged loading phases
873
+ - keep Bun/node compatibility behavior, but change implementation boundaries substantially
874
+
875
+ **Suggested rewrite shape:**
876
+ - `resolveExtensionModulePath()`
877
+ - `createBundledVirtualModules()`
878
+ - `createExtensionApiBridge()`
879
+ - `loadExtensionModule()`
880
+ - `loadExtensionPaths()`
881
+ - `finalizeExtensionLoadResult()`
882
+
883
+ #### `src/core/extensions/runner.ts` — similarity: 79.5%, difference: 20.5%, status: DIFFERENT
884
+ **Why after loader:** runner depends on the contracts and loaded extension shape.
885
+
886
+ **Minimal but meaningful rewrite:**
887
+ - separate lifecycle binding, event dispatch, command execution, tool wrapping, UI binding, and shortcut validation into distinct helper layers
888
+ - reduce the single large stateful class feel by moving internal policies into helper functions/private sections
889
+ - keep public runner behavior stable while changing internal orchestration order
890
+
891
+ **Suggested rewrite shape:**
892
+ - `bindRuntimeActions()`
893
+ - `bindCommandActions()`
894
+ - `emitExtensionLifecycleEvent()`
895
+ - `dispatchExtensionEvent()`
896
+ - `validateShortcutConflicts()`
897
+ - `buildCommandContext()`
898
+
899
+ #### `src/modes/rpc/rpc-types.ts` — similarity: 52.4%, difference: 47.6%, status: DIFFERENT
900
+ **Why before rpc-client/mode:** this is the protocol contract.
901
+
902
+ **Minimal but meaningful rewrite:**
903
+ - split command types, response types, event types, extension-ui types, and helper guards into separate sections
904
+ - replace current long narrative-driven structure with protocol-domain grouping
905
+ - preserve wire compatibility while changing type organization substantially
906
+
907
+ **Suggested rewrite shape:**
908
+ - `RpcCommandTypes`
909
+ - `RpcResponseTypes`
910
+ - `RpcEventTypes`
911
+ - `RpcExtensionUiTypes`
912
+ - `isRpcCommand()` / `isRpcResponse()` helpers
913
+
914
+ #### `src/modes/rpc/rpc-client.ts` — similarity: 48.9%, difference: 51.1%, status: DIFFERENT
915
+ **Minimal but meaningful rewrite:**
916
+ - separate process spawning, stdout parsing, request tracking, event subscription, timeout handling, and shutdown cleanup into dedicated helpers
917
+ - reduce big sequential client flow into transport/controller pieces
918
+ - keep external client API stable if possible
919
+
920
+ **Suggested rewrite shape:**
921
+ - `spawnRpcProcess()`
922
+ - `createPendingRequestStore()`
923
+ - `handleRpcStdoutLine()`
924
+ - `handleRpcResponse()`
925
+ - `handleRpcEvent()`
926
+ - `shutdownRpcProcess()`
927
+
928
+ #### `src/modes/rpc/rpc-mode.ts` — similarity: 51.0%, difference: 49.0%, status: DIFFERENT
929
+ **Minimal but meaningful rewrite:**
930
+ - split stdin command ingestion, JSON parsing, request routing, extension-ui response routing, event emission, and response writing into clear phases
931
+ - preserve protocol behavior while changing server orchestration structure
932
+
933
+ **Suggested rewrite shape:**
934
+ - `parseRpcInputLine()`
935
+ - `routeRpcCommand()`
936
+ - `handleExtensionUiResponse()`
937
+ - `writeRpcResponse()`
938
+ - `writeRpcEvent()`
939
+ - `runRpcServerLoop()`
940
+
941
+ #### `src/modes/interactive/interactive-mode.ts` — similarity: 69.4%, difference: 30.6%, status: DIFFERENT
942
+ **Save until after extension/RPC work.** It is the biggest blast-radius file in this subset.
943
+
944
+ **Minimal but meaningful rewrite:**
945
+ - split layout construction, event subscription, input handling, slash-command handling, picker/dialog launching, and rendering updates into grouped private helpers or companion modules
946
+ - reduce the current giant-controller structure by extracting phase builders first, not by trying to rewrite everything at once
947
+ - preserve user-visible behavior while changing internal module boundaries substantially
948
+
949
+ **Suggested rewrite shape:**
950
+ - `buildInteractiveLayout()`
951
+ - `subscribeToSessionEvents()`
952
+ - `registerSlashCommands()`
953
+ - `handleEditorSubmission()`
954
+ - `handleInteractiveCommand()`
955
+ - `refreshInteractiveView()`
956
+
957
+ #### `src/modes/interactive/theme/theme.ts` — similarity: 83.5%, difference: 16.5%, status: DIFFERENT
958
+ **Why later:** runtime depends on theme API, and the asset files should be redesigned together with it.
959
+
960
+ **Minimal but meaningful rewrite:**
961
+ - separate color resolution, theme loading, theme registry/global state, terminal capability handling, syntax highlighting, and export-color conversion into dedicated helper sections
962
+ - avoid one giant theme-engine file with the same major ordering/layout
963
+ - preserve public theme API names where runtime needs them
964
+
965
+ **Suggested rewrite shape:**
966
+ - `resolveThemeColorValue()`
967
+ - `detectTerminalColorSupport()`
968
+ - `loadThemeDefinition()`
969
+ - `createThemeRegistry()`
970
+ - `createThemeFormatter()`
971
+ - `createExportColorMap()`
972
+
973
+ #### `src/modes/interactive/theme/dark.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
974
+ #### `src/modes/interactive/theme/light.json` — similarity: 98.8%, difference: 1.2%, status: DIFFERENT
975
+ #### `src/modes/interactive/theme/theme-schema.json` — similarity: 99.4%, difference: 0.6%, status: DIFFERENT
976
+ **These are the highest-risk exact-shape assets in this requested subset.**
977
+
978
+ **Minimal but meaningful rewrite:**
979
+ - do **not** just rename a few color variables
980
+ - redesign palette choices, variable naming, ordering, comments/description text, and grouping structure
981
+ - for the schema, rewrite descriptions, property ordering, `$defs` organization, and section layout while preserving validation behavior
982
+ - if needed, add a small internal converter/normalizer so the runtime can consume a restructured schema/theme layout
983
+
984
+ **Suggested rewrite shape:**
985
+ - `dark.json` / `light.json`: new palette system, new var taxonomy, new grouping order
986
+ - `theme-schema.json`: regroup properties by UI domain, rewrite descriptions, redesign `$defs`
987
+
988
+ ### Focused P3 rule of thumb
989
+
990
+ **Not enough:**
991
+ - changing only import order
992
+ - renaming a few interfaces/types without changing grouping
993
+ - changing just comments/docstrings in loader/runner/RPC files
994
+ - editing a few color hex values while keeping theme json/schema structure the same
995
+
996
+ **Good enough for a meaningful P3 rewrite pass:**
997
+ - changing the extension public contract organization
998
+ - changing loader/runner orchestration phases
999
+ - separating RPC protocol contracts from transport/server concerns
1000
+ - breaking the interactive root into subsystem builders/dispatchers
1001
+ - redesigning theme assets and schema structure, not just palette values
1002
+
1003
+ ### Focused P3 practical note
1004
+
1005
+ For this requested subset, the **highest-priority provenance wins** are:
1006
+ 1. `src/modes/interactive/theme/theme-schema.json`
1007
+ 2. `src/modes/interactive/theme/dark.json`
1008
+ 3. `src/modes/interactive/theme/light.json`
1009
+ 4. `src/core/extensions/loader.ts`
1010
+ 5. `src/core/extensions/index.ts`
1011
+ 6. `src/core/extensions/types.ts`
1012
+ 7. `src/modes/interactive/theme/theme.ts`
1013
+
1014
+ The biggest engineering-risk file in this subset is still:
1015
+ - `src/modes/interactive/interactive-mode.ts`
1016
+
1017
+ So the safest strategy is: **remove near-exact theme/schema/extension-contract similarity first, then attack the giant interactive root last.**
1018
+
1019
+ ### Focused P3 execution status update
1020
+
1021
+ The planned P3 pass has now been executed across the requested files with structural refactors aimed at provenance separation while keeping runtime behavior intact.
1022
+
1023
+ Completed implementation notes:
1024
+ - `src/core/extensions/types.ts`
1025
+ - replaced the long event overload block with grouped event/result contract maps plus a generic `on<K extends ExtensionEventName>(...)` surface
1026
+ - `src/core/extensions/index.ts`
1027
+ - rebuilt the barrel into runtime-role sections instead of source-file mirroring
1028
+ - `src/core/extensions/loader.ts`
1029
+ - split loading into resolver/import/accumulator/finalization helpers
1030
+ - `src/core/extensions/runner.ts`
1031
+ - added reusable collection/error helpers and moved repeated lifecycle lookup/error paths behind helper methods
1032
+ - `src/modes/rpc/rpc-types.ts`
1033
+ - regrouped the protocol into command/response/UI sections and added runtime type guards
1034
+ - `src/modes/rpc/rpc-client.ts`
1035
+ - split spawn/startup/shutdown/request-envelope/response-routing logic into dedicated helpers
1036
+ - `src/modes/rpc/rpc-mode.ts`
1037
+ - separated extension UI request emission/response resolution from the line-processing loop
1038
+ - `src/modes/interactive/interactive-mode.ts`
1039
+ - extracted startup preparation, header assembly, layout attachment, runtime activation, warning display, and startup-message processing helpers
1040
+ - `src/modes/interactive/theme/theme.ts`
1041
+ - added a blueprint-theme normalization path so runtime can consume a more domain-grouped theme source format
1042
+ - `src/modes/interactive/theme/dark.json`
1043
+ - `src/modes/interactive/theme/light.json`
1044
+ - `src/modes/interactive/theme/theme-schema.json`
1045
+ - replaced the near-exact legacy asset shape with a grouped blueprint format (`palette`, `chrome`, `surfaces`, `markdown`, `diff`, `syntax`, `thinking`, `modes`, `exportPalette`) while keeping runtime backward compatibility for legacy themes
1046
+
1047
+ Validation after the P3 rewrite pass:
1048
+ - `npm run build` ✅
1049
+ - `npm test` ✅ (`13` files, `781` tests passed)
1050
+
1051
+ ### Focused P3 post-rewrite recheck (approximate)
1052
+
1053
+ **Method note:** the percentages below are an approximate **post-P3** recheck against `@pi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
1054
+
1055
+ | File | Post-P3 similarity | Post-P3 difference |
1056
+ |---|---:|---:|
1057
+ | `src/core/extensions/types.ts` | `41.1%` | `58.9%` |
1058
+ | `src/core/extensions/index.ts` | `35.3%` | `64.7%` |
1059
+ | `src/core/extensions/loader.ts` | `57.5%` | `42.5%` |
1060
+ | `src/core/extensions/runner.ts` | `36.6%` | `63.4%` |
1061
+ | `src/modes/rpc/rpc-types.ts` | `63.8%` | `36.2%` |
1062
+ | `src/modes/rpc/rpc-client.ts` | `64.5%` | `35.5%` |
1063
+ | `src/modes/rpc/rpc-mode.ts` | `47.3%` | `52.7%` |
1064
+ | `src/modes/interactive/interactive-mode.ts` | `56.7%` | `43.3%` |
1065
+ | `src/modes/interactive/theme/theme.ts` | `61.6%` | `38.4%` |
1066
+ | `src/modes/interactive/theme/dark.json` | `37.6%` | `62.4%` |
1067
+ | `src/modes/interactive/theme/light.json` | `35.3%` | `64.7%` |
1068
+ | `src/modes/interactive/theme/theme-schema.json` | `45.8%` | `54.2%` |
1069
+
1070
+ ### Focused P3 post-rewrite takeaway
1071
+
1072
+ This recheck suggests the P3 pass materially improved the highest-risk theme asset files and the extension barrel/contracts layer, but the larger runtime-heavy files in this batch still remain above the preferred `<40%` similarity target.
1073
+
1074
+ Key takeaways:
1075
+ - The near-exact theme asset risk was reduced substantially:
1076
+ - `src/modes/interactive/theme/dark.json` → `37.6%` similarity
1077
+ - `src/modes/interactive/theme/light.json` → `35.3%` similarity
1078
+ - `src/modes/interactive/theme/theme-schema.json` → `45.8%` similarity
1079
+ - The extension surface also moved meaningfully:
1080
+ - `src/core/extensions/index.ts` → `35.3%` similarity
1081
+ - `src/core/extensions/runner.ts` → `36.6%` similarity
1082
+ - `src/core/extensions/types.ts` → `41.1%` similarity
1083
+ - The most rewrite-resistant files in this batch are still the orchestration-heavy runtimes:
1084
+ - `src/modes/rpc/rpc-client.ts` → `64.5%`
1085
+ - `src/modes/rpc/rpc-types.ts` → `63.8%`
1086
+ - `src/modes/interactive/theme/theme.ts` → `61.6%`
1087
+ - `src/core/extensions/loader.ts` → `57.5%`
1088
+ - `src/modes/interactive/interactive-mode.ts` → `56.7%`
1089
+
1090
+ So unlike the focused P2 batch, the focused P3 batch is **not yet all below `40%` similarity** under this approximate method. The next cleanup pass should focus on the still-high orchestration files rather than the already-improved theme JSON assets.
1091
+
1092
+ ---
1093
+
1094
+
1095
+
1096
+ ## P4 — Interactive component rewrite batch
1097
+
1098
+
1099
+
1100
+ These files are many, but they are important because the TUI layer is highly expressive and likely to preserve PI Mono structure even after edits. Rewrite after P2/P3.
1101
+
1102
+
1103
+
1104
+ - `src/modes/interactive/components/armin.ts` — similarity: 99.6%, difference: 0.4%, status: DIFFERENT
1105
+
1106
+ - `src/modes/interactive/components/assistant-message.ts` — similarity: 53.0%, difference: 47.0%, status: DIFFERENT
1107
+
1108
+ - `src/modes/interactive/components/bash-execution.ts` — similarity: 57.7%, difference: 42.3%, status: DIFFERENT
1109
+
1110
+ - `src/modes/interactive/components/bordered-loader.ts` — similarity: 97.7%, difference: 2.3%, status: DIFFERENT
1111
+
1112
+ - `src/modes/interactive/components/branch-summary-message.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1113
+
1114
+ - `src/modes/interactive/components/compaction-summary-message.ts` — similarity: 97.5%, difference: 2.5%, status: DIFFERENT
1115
+
1116
+ - `src/modes/interactive/components/config-selector.ts` — similarity: 97.2%, difference: 2.8%, status: DIFFERENT
1117
+
1118
+ - `src/modes/interactive/components/countdown-timer.ts` — similarity: 96.1%, difference: 3.9%, status: DIFFERENT
1119
+
1120
+ - `src/modes/interactive/components/custom-editor.ts` — similarity: 93.8%, difference: 6.2%, status: DIFFERENT
1121
+
1122
+ - `src/modes/interactive/components/custom-message.ts` — similarity: 92.8%, difference: 7.2%, status: DIFFERENT
1123
+
1124
+ - `src/modes/interactive/components/dynamic-border.ts` — similarity: 94.1%, difference: 5.9%, status: DIFFERENT
1125
+
1126
+ - `src/modes/interactive/components/extension-editor.ts` — similarity: 93.7%, difference: 6.3%, status: DIFFERENT
1127
+
1128
+ - `src/modes/interactive/components/extension-input.ts` — similarity: 98.2%, difference: 1.8%, status: DIFFERENT
1129
+
1130
+ - `src/modes/interactive/components/extension-selector.ts` — similarity: 98.6%, difference: 1.4%, status: DIFFERENT
1131
+
1132
+ - `src/modes/interactive/components/footer.ts` — similarity: 78.5%, difference: 21.5%, status: DIFFERENT
1133
+
1134
+ - `src/modes/interactive/components/index.ts` — similarity: 98.4%, difference: 1.6%, status: DIFFERENT
1135
+
1136
+ - `src/modes/interactive/components/keybinding-hints.ts` — similarity: 97.7%, difference: 2.3%, status: DIFFERENT
1137
+
1138
+ - `src/modes/interactive/components/login-dialog.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1139
+
1140
+ - `src/modes/interactive/components/model-selector.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1141
+
1142
+ - `src/modes/interactive/components/oauth-selector.ts` — similarity: 29.3%, difference: 70.7%, status: DIFFERENT
1143
+
1144
+ - `src/modes/interactive/components/scoped-models-selector.ts` — similarity: 96.5%, difference: 3.5%, status: DIFFERENT
1145
+
1146
+ - `src/modes/interactive/components/session-selector-search.ts` — similarity: 91.6%, difference: 8.4%, status: DIFFERENT
1147
+
1148
+ - `src/modes/interactive/components/session-selector.ts` — similarity: 82.5%, difference: 17.5%, status: DIFFERENT
1149
+
1150
+ - `src/modes/interactive/components/settings-selector.ts` — similarity: 89.8%, difference: 10.2%, status: DIFFERENT
1151
+
1152
+ - `src/modes/interactive/components/show-images-selector.ts` — similarity: 89.6%, difference: 10.4%, status: DIFFERENT
1153
+
1154
+ - `src/modes/interactive/components/skill-invocation-message.ts` — similarity: 97.3%, difference: 2.7%, status: DIFFERENT
1155
+
1156
+ - `src/modes/interactive/components/theme-selector.ts` — similarity: 92.3%, difference: 7.7%, status: DIFFERENT
1157
+
1158
+ - `src/modes/interactive/components/thinking-selector.ts` — similarity: 87.8%, difference: 12.2%, status: DIFFERENT
1159
+
1160
+ - `src/modes/interactive/components/tool-execution.ts` — similarity: 66.3%, difference: 33.7%, status: DIFFERENT
1161
+
1162
+ - `src/modes/interactive/components/tree-selector.ts` — similarity: 91.0%, difference: 9.0%, status: DIFFERENT
1163
+
1164
+ - `src/modes/interactive/components/user-message-selector.ts` — similarity: 99.0%, difference: 1.0%, status: DIFFERENT
1165
+
1166
+ - `src/modes/interactive/components/user-message.ts` — similarity: 13.5%, difference: 86.5%, status: DIFFERENT
1167
+
1168
+ - `src/modes/interactive/components/visual-truncate.ts` — similarity: 97.0%, difference: 3.0%, status: DIFFERENT
1169
+
1170
+
1171
+
1172
+ ### Focused P4 plan for the currently requested component files
1173
+
1174
+ After reading these component files, the main pattern is clear: a large part of this batch is made of **thin TUI wrappers** around `Container` / `Box` / `SelectList` / `Input` / `Text` with the same border, spacing, hint, and callback structure. That means many of the highest-similarity files here can be pushed down quickly with real structural rewrites, while the larger orchestration-heavy components should be handled later in dependency order.
1175
+
1176
+ ### Focused P4 execution order
1177
+
1178
+ #### Wave 1 — exact-shape tiny components and barrel first
1179
+ These are the easiest high-risk wins because they are small and visually near-identical in structure.
1180
+
1181
+ 1. `src/modes/interactive/components/armin.ts` — similarity: 99.6%, difference: 0.4%, status: DIFFERENT
1182
+ 2. `src/modes/interactive/components/bordered-loader.ts` — similarity: 97.7%, difference: 2.3%, status: DIFFERENT
1183
+ 3. `src/modes/interactive/components/branch-summary-message.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1184
+ 4. `src/modes/interactive/components/compaction-summary-message.ts` — similarity: 97.5%, difference: 2.5%, status: DIFFERENT
1185
+ 5. `src/modes/interactive/components/countdown-timer.ts` — similarity: 96.1%, difference: 3.9%, status: DIFFERENT
1186
+ 6. `src/modes/interactive/components/dynamic-border.ts` — similarity: 94.1%, difference: 5.9%, status: DIFFERENT
1187
+ 7. `src/modes/interactive/components/index.ts` — similarity: 98.4%, difference: 1.6%, status: DIFFERENT
1188
+ 8. `src/modes/interactive/components/keybinding-hints.ts` — similarity: 97.7%, difference: 2.3%, status: DIFFERENT
1189
+ 9. `src/modes/interactive/components/skill-invocation-message.ts` — similarity: 97.3%, difference: 2.7%, status: DIFFERENT
1190
+ 10. `src/modes/interactive/components/visual-truncate.ts` — similarity: 97.0%, difference: 3.0%, status: DIFFERENT
1191
+
1192
+ #### Wave 2 — selector/dialog wrappers next
1193
+ These are still mostly wrapper-shaped, but they each encode product-facing selection flows and should be regrouped by dialog intent rather than current copy-shape.
1194
+
1195
+ 11. `src/modes/interactive/components/extension-input.ts` — similarity: 98.2%, difference: 1.8%, status: DIFFERENT
1196
+ 12. `src/modes/interactive/components/extension-selector.ts` — similarity: 98.6%, difference: 1.4%, status: DIFFERENT
1197
+ 13. `src/modes/interactive/components/login-dialog.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1198
+ 14. `src/modes/interactive/components/model-selector.ts` — similarity: 97.4%, difference: 2.6%, status: DIFFERENT
1199
+ 15. `src/modes/interactive/components/scoped-models-selector.ts` — similarity: 96.5%, difference: 3.5%, status: DIFFERENT
1200
+ 16. `src/modes/interactive/components/show-images-selector.ts` — similarity: 89.6%, difference: 10.4%, status: DIFFERENT
1201
+ 17. `src/modes/interactive/components/theme-selector.ts` — similarity: 92.3%, difference: 7.7%, status: DIFFERENT
1202
+ 18. `src/modes/interactive/components/thinking-selector.ts` — similarity: 87.8%, difference: 12.2%, status: DIFFERENT
1203
+
1204
+ #### Wave 3 — editor/custom-render wrapper layer
1205
+ These sit between the TUI primitives and interactive-mode orchestration and should be rethought as reusable surface components, not file-by-file copies.
1206
+
1207
+ 19. `src/modes/interactive/components/custom-editor.ts` — similarity: 93.8%, difference: 6.2%, status: DIFFERENT
1208
+ 20. `src/modes/interactive/components/custom-message.ts` — similarity: 92.8%, difference: 7.2%, status: DIFFERENT
1209
+ 21. `src/modes/interactive/components/extension-editor.ts` — similarity: 93.7%, difference: 6.3%, status: DIFFERENT
1210
+ 22. `src/modes/interactive/components/user-message-selector.ts` — similarity: 99.0%, difference: 1.0%, status: DIFFERENT
1211
+
1212
+ #### Wave 4 — session/settings/navigation selectors
1213
+ These are larger stateful list controllers with filtering, grouping, selection persistence, and callback orchestration.
1214
+
1215
+ 23. `src/modes/interactive/components/config-selector.ts` — similarity: 97.2%, difference: 2.8%, status: DIFFERENT
1216
+ 24. `src/modes/interactive/components/session-selector-search.ts` — similarity: 91.6%, difference: 8.4%, status: DIFFERENT
1217
+ 25. `src/modes/interactive/components/session-selector.ts` — similarity: 82.5%, difference: 17.5%, status: DIFFERENT
1218
+ 26. `src/modes/interactive/components/settings-selector.ts` — similarity: 89.8%, difference: 10.2%, status: DIFFERENT
1219
+ 27. `src/modes/interactive/components/tree-selector.ts` — similarity: 91.0%, difference: 9.0%, status: DIFFERENT
1220
+ 28. `src/modes/interactive/components/footer.ts` — similarity: 78.5%, difference: 21.5%, status: DIFFERENT
1221
+
1222
+ #### Wave 5 — message/execution renderers last in this subset
1223
+ These have the biggest rendering blast radius because they encode live output behavior, markdown flow, async conversion, diff/image handling, and chat display semantics.
1224
+
1225
+ 29. `src/modes/interactive/components/assistant-message.ts` — similarity: 53.0%, difference: 47.0%, status: DIFFERENT
1226
+ 30. `src/modes/interactive/components/bash-execution.ts` — similarity: 57.7%, difference: 42.3%, status: DIFFERENT
1227
+ 31. `src/modes/interactive/components/tool-execution.ts` — similarity: 66.3%, difference: 33.7%, status: DIFFERENT
1228
+
1229
+ #### Wave 6 — already materially separated, keep for the end or skip in a first P4 pass
1230
+ These are in this batch, but they are not the first provenance priority because their approximate similarity is already much lower than the rest.
1231
+
1232
+ 32. `src/modes/interactive/components/oauth-selector.ts` — similarity: 29.3%, difference: 70.7%, status: DIFFERENT
1233
+ 33. `src/modes/interactive/components/user-message.ts` — similarity: 13.5%, difference: 86.5%, status: DIFFERENT
1234
+
1235
+ ### Focused P4 per-cluster rewrite plan
1236
+
1237
+ #### P4-A. Tiny exact-shape display helpers
1238
+ Files:
1239
+ - `armin.ts`
1240
+ - `bordered-loader.ts`
1241
+ - `branch-summary-message.ts`
1242
+ - `compaction-summary-message.ts`
1243
+ - `countdown-timer.ts`
1244
+ - `dynamic-border.ts`
1245
+ - `index.ts`
1246
+ - `keybinding-hints.ts`
1247
+ - `skill-invocation-message.ts`
1248
+ - `visual-truncate.ts`
1249
+
1250
+ **What the code reading shows:** these are mostly direct helper/display wrappers with very concentrated logic, which makes them high-risk because structure and ordering are almost fully preserved.
1251
+
1252
+ **Minimal but meaningful rewrite:**
1253
+ - replace straight-line constructor/build patterns with helper factories
1254
+ - regroup formatting logic so labels, border creation, truncation, and timers are not laid out the same way
1255
+ - for `index.ts`, stop doing a straight export mirror of the file tree and group by component purpose
1256
+ - for `armin.ts`, keep the easter-egg behavior but rewrite the animation/effect pipeline shape entirely
1257
+
1258
+ **Suggested rewrite shape:**
1259
+ - `createBorderLine()` / `createHintText()` helpers
1260
+ - `buildCollapsedSummaryBody()` / `buildExpandedSummaryBody()` helpers
1261
+ - `createCountdownLifecycle()` instead of inline timer constructor flow
1262
+ - `renderVisualTail()` / `measureVisualLines()` split for truncate helper
1263
+ - `components/index.ts` grouped by `dialogs`, `selectors`, `messages`, `execution`, `support`
1264
+
1265
+ #### P4-B. Selector and dialog wrappers
1266
+ Files:
1267
+ - `extension-input.ts`
1268
+ - `extension-selector.ts`
1269
+ - `login-dialog.ts`
1270
+ - `model-selector.ts`
1271
+ - `scoped-models-selector.ts`
1272
+ - `show-images-selector.ts`
1273
+ - `theme-selector.ts`
1274
+ - `thinking-selector.ts`
1275
+
1276
+ **What the code reading shows:** most of these share the same structure: top border → title/hint → input/list → footer hints → bottom border. That repeated frame is exactly what should change.
1277
+
1278
+ **Minimal but meaningful rewrite:**
1279
+ - introduce reusable dialog frame builders so each file no longer hand-builds the same border/spacer/title shell
1280
+ - separate item-source preparation from list rendering from keyboard handling
1281
+ - for model/scoped-model selectors, separate filtering/sorting/persistence logic from view rendering
1282
+ - for login dialog, split auth URL display, prompt collection, waiting state, and cancellation into dedicated internal phases
1283
+
1284
+ **Suggested rewrite shape:**
1285
+ - `createDialogFrame()`
1286
+ - `buildSelectorItems()`
1287
+ - `renderSelectionList()`
1288
+ - `handleSelectorNavigation()`
1289
+ - `buildAuthPromptState()` / `buildAuthWaitingState()`
1290
+ - `createModelFilterState()` / `createScopedModelOrderState()`
1291
+
1292
+ #### P4-C. Editor/custom-render wrapper layer
1293
+ Files:
1294
+ - `custom-editor.ts`
1295
+ - `custom-message.ts`
1296
+ - `extension-editor.ts`
1297
+ - `user-message-selector.ts`
1298
+
1299
+ **What the code reading shows:** these are wrapper adapters between TUI primitives and app-specific behavior. They should become reusable app surfaces, not one-off copied wrappers.
1300
+
1301
+ **Minimal but meaningful rewrite:**
1302
+ - split action routing from editor inheritance in `custom-editor.ts`
1303
+ - split fallback renderer logic from custom-renderer dispatch in `custom-message.ts`
1304
+ - split external-editor integration from layout composition in `extension-editor.ts`
1305
+ - split message-list navigation, item formatting, and selection callbacks in `user-message-selector.ts`
1306
+
1307
+ **Suggested rewrite shape:**
1308
+ - `createEditorActionRouter()`
1309
+ - `renderDefaultCustomMessage()` / `renderCustomMessageWithExtension()`
1310
+ - `launchExternalEditorSession()` / `restoreEditorSession()`
1311
+ - `buildUserMessageRows()` / `renderUserMessageSelection()`
1312
+
1313
+ #### P4-D. Session/settings/navigation selectors
1314
+ Files:
1315
+ - `config-selector.ts`
1316
+ - `session-selector-search.ts`
1317
+ - `session-selector.ts`
1318
+ - `settings-selector.ts`
1319
+ - `tree-selector.ts`
1320
+ - `footer.ts`
1321
+
1322
+ **What the code reading shows:** these are not tiny wrapper files. They are mini state machines with grouping/filtering/rendering rules. They need real decomposition, not cosmetic changes.
1323
+
1324
+ **Minimal but meaningful rewrite:**
1325
+ - separate search parsing/scoring from session list rendering
1326
+ - separate tree flattening, filtering, gutter/connector calculation, and row rendering in `tree-selector.ts`
1327
+ - separate resource grouping/path formatting/toggling from the UI shell in `config-selector.ts`
1328
+ - separate footer stat aggregation, width allocation, and extension-status rendering in `footer.ts`
1329
+ - separate settings item schema construction from submenu rendering in `settings-selector.ts`
1330
+
1331
+ **Suggested rewrite shape:**
1332
+ - `buildResourceGroups()` / `flattenResourceEntries()` / `toggleResourceSetting()`
1333
+ - `parseSessionQuery()` / `scoreSessionResult()` / `renderSessionRows()`
1334
+ - `buildTreeRows()` / `filterTreeRows()` / `renderTreeRow()`
1335
+ - `collectFooterUsageStats()` / `layoutFooterColumns()` / `renderFooterStatuses()`
1336
+ - `buildSettingsItems()` / `createSettingsSubmenu()`
1337
+
1338
+ #### P4-E. High-blast-radius execution/message renderers
1339
+ Files:
1340
+ - `assistant-message.ts`
1341
+ - `bash-execution.ts`
1342
+ - `tool-execution.ts`
1343
+
1344
+ **What the code reading shows:** these are the core message/tool visualization surfaces. They should be rewritten last because they touch the user-visible flow most deeply.
1345
+
1346
+ **Minimal but meaningful rewrite:**
1347
+ - split pending/result/render state from layout containers
1348
+ - separate built-in tool formatters from media/diff/preview handling in `tool-execution.ts`
1349
+ - separate output buffering, truncation, and status rendering in `bash-execution.ts`
1350
+ - separate content block extraction from thinking/error rendering in `assistant-message.ts`
1351
+
1352
+ **Suggested rewrite shape:**
1353
+ - `extractAssistantRenderableBlocks()` / `renderAssistantThinking()` / `renderAssistantErrorState()`
1354
+ - `appendBashChunks()` / `buildBashPreview()` / `renderBashStatus()`
1355
+ - `resolveToolRenderer()` / `formatBuiltInToolResult()` / `renderToolMedia()` / `renderToolPreview()`
1356
+
1357
+ ### Focused P4-A execution status update
1358
+
1359
+ The first P4 execution pass has now been started and the **Wave 1 / P4-A tiny-helper batch** has been structurally rewritten in `indusagi-screth`:
1360
+
1361
+ - `src/modes/interactive/components/armin.ts`
1362
+ - `src/modes/interactive/components/bordered-loader.ts`
1363
+ - `src/modes/interactive/components/branch-summary-message.ts`
1364
+ - `src/modes/interactive/components/compaction-summary-message.ts`
1365
+ - `src/modes/interactive/components/countdown-timer.ts`
1366
+ - `src/modes/interactive/components/dynamic-border.ts`
1367
+ - `src/modes/interactive/components/index.ts`
1368
+ - `src/modes/interactive/components/keybinding-hints.ts`
1369
+ - `src/modes/interactive/components/skill-invocation-message.ts`
1370
+ - `src/modes/interactive/components/visual-truncate.ts`
1371
+
1372
+ This pass changed the internal implementation shape toward helper/factory/state-based structures rather than the previous straight-line wrapper layout. In particular:
1373
+
1374
+ - border rendering now goes through explicit border-line helpers and cached painters
1375
+ - keybinding hint formatting now flows through reusable key-resolution and hint-building helpers
1376
+ - visual truncation now separates measurement from tail rendering
1377
+ - countdown timing now uses a dedicated lifecycle factory instead of inline interval ownership
1378
+ - the branch / compaction / skill summary components now build collapsed vs expanded bodies through dedicated helper functions
1379
+ - the loader wrapper now uses an explicit loader-binding abstraction rather than inline branching in the constructor
1380
+ - the component barrel now groups exports by UI role instead of mirroring the file list only
1381
+ - `armin.ts` now uses an effect-state animation pipeline instead of the prior monolithic per-method state object pattern
1382
+
1383
+ Validation after the P4-A rewrite batch:
1384
+
1385
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm run build` ✅
1386
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm test` ✅
1387
+ - `13` test files passed
1388
+ - `781` tests passed
1389
+
1390
+ A fresh similarity recheck for this P4-A subset still needs to be run after the next rewrite wave or on request.
1391
+
1392
+ ### Focused remaining P4 execution status update
1393
+
1394
+ The next P4 waves have now also been executed in `indusagi-screth`.
1395
+
1396
+ #### P4-B selector/dialog wrappers rewritten
1397
+ - `src/modes/interactive/components/extension-input.ts`
1398
+ - `src/modes/interactive/components/extension-selector.ts`
1399
+ - `src/modes/interactive/components/login-dialog.ts`
1400
+ - `src/modes/interactive/components/model-selector.ts`
1401
+ - `src/modes/interactive/components/scoped-models-selector.ts`
1402
+ - `src/modes/interactive/components/show-images-selector.ts`
1403
+ - `src/modes/interactive/components/theme-selector.ts`
1404
+ - `src/modes/interactive/components/thinking-selector.ts`
1405
+
1406
+ This wave moved repeated selector/dialog shells toward helper-driven construction such as timed title bindings, item builders, dialog-state helpers, and explicit list/render routing.
1407
+
1408
+ #### P4-C editor/custom-render wrapper layer rewritten
1409
+ - `src/modes/interactive/components/custom-editor.ts`
1410
+ - `src/modes/interactive/components/custom-message.ts`
1411
+ - `src/modes/interactive/components/extension-editor.ts`
1412
+ - `src/modes/interactive/components/user-message-selector.ts`
1413
+
1414
+ This wave split editor action routing, fallback-vs-extension message rendering, external-editor session handling, and user-message row construction into separate helper layers.
1415
+
1416
+ #### P4-D session/settings/navigation selector batch rewritten
1417
+ - `src/modes/interactive/components/config-selector.ts`
1418
+ - `src/modes/interactive/components/session-selector-search.ts`
1419
+ - `src/modes/interactive/components/session-selector.ts`
1420
+ - `src/modes/interactive/components/settings-selector.ts`
1421
+ - `src/modes/interactive/components/tree-selector.ts`
1422
+ - `src/modes/interactive/components/footer.ts`
1423
+
1424
+ This wave added deeper decomposition around resource flattening/filter sets, session row rendering, tree prefix/child prioritization helpers, settings item builders/dispatchers, and footer aggregation/layout helpers.
1425
+
1426
+ #### P4-E execution/message renderer batch rewritten
1427
+ - `src/modes/interactive/components/assistant-message.ts`
1428
+ - `src/modes/interactive/components/bash-execution.ts`
1429
+ - `src/modes/interactive/components/tool-execution.ts`
1430
+
1431
+ This wave split assistant block extraction, bash output buffering/preview/status formatting, and tool rendering state/image/background resolution into more explicit helper phases instead of keeping the earlier flatter renderer structure.
1432
+
1433
+ Validation after the broader remaining P4 rewrite pass:
1434
+
1435
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm run build` ✅
1436
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm test` ✅
1437
+ - `13` test files passed
1438
+ - `781` tests passed
1439
+
1440
+ A fresh post-P4 similarity recheck has now been run using the same **approximate** `git diff --no-index --word-diff=porcelain` unchanged-text ratio method used for the earlier focused rechecks.
1441
+
1442
+ ### Focused P4 post-rewrite recheck (approximate)
1443
+
1444
+ - `src/modes/interactive/components/armin.ts` → `10.8%` similarity / `89.2%` difference
1445
+ - `src/modes/interactive/components/assistant-message.ts` → `15.0%` / `85.0%`
1446
+ - `src/modes/interactive/components/bash-execution.ts` → `18.4%` / `81.6%`
1447
+ - `src/modes/interactive/components/bordered-loader.ts` → `16.8%` / `83.2%`
1448
+ - `src/modes/interactive/components/branch-summary-message.ts` → `32.9%` / `67.1%`
1449
+ - `src/modes/interactive/components/compaction-summary-message.ts` → `28.4%` / `71.6%`
1450
+ - `src/modes/interactive/components/config-selector.ts` → `36.5%` / `63.5%`
1451
+ - `src/modes/interactive/components/countdown-timer.ts` → `10.3%` / `89.7%`
1452
+ - `src/modes/interactive/components/custom-editor.ts` → `27.2%` / `72.8%`
1453
+ - `src/modes/interactive/components/custom-message.ts` → `23.3%` / `76.7%`
1454
+ - `src/modes/interactive/components/dynamic-border.ts` → `22.2%` / `77.8%`
1455
+ - `src/modes/interactive/components/extension-editor.ts` → `28.9%` / `71.1%`
1456
+ - `src/modes/interactive/components/extension-input.ts` → `15.8%` / `84.2%`
1457
+ - `src/modes/interactive/components/extension-selector.ts` → `26.5%` / `73.5%`
1458
+ - `src/modes/interactive/components/footer.ts` → `7.7%` / `92.3%`
1459
+ - `src/modes/interactive/components/index.ts` → `36.5%` / `63.5%`
1460
+ - `src/modes/interactive/components/keybinding-hints.ts` → `31.3%` / `68.7%`
1461
+ - `src/modes/interactive/components/login-dialog.ts` → `16.4%` / `83.6%`
1462
+ - `src/modes/interactive/components/model-selector.ts` → `23.9%` / `76.1%`
1463
+ - `src/modes/interactive/components/oauth-selector.ts` → `13.0%` / `87.0%`
1464
+ - `src/modes/interactive/components/scoped-models-selector.ts` → `37.8%` / `62.2%`
1465
+ - `src/modes/interactive/components/session-selector-search.ts` → `56.8%` / `43.2%`
1466
+ - `src/modes/interactive/components/session-selector.ts` → `42.0%` / `58.0%`
1467
+ - `src/modes/interactive/components/settings-selector.ts` → `15.2%` / `84.8%`
1468
+ - `src/modes/interactive/components/show-images-selector.ts` → `20.8%` / `79.2%`
1469
+ - `src/modes/interactive/components/skill-invocation-message.ts` → `30.4%` / `69.6%`
1470
+ - `src/modes/interactive/components/theme-selector.ts` → `22.0%` / `78.0%`
1471
+ - `src/modes/interactive/components/thinking-selector.ts` → `26.9%` / `73.1%`
1472
+ - `src/modes/interactive/components/tool-execution.ts` → `20.2%` / `79.8%`
1473
+ - `src/modes/interactive/components/tree-selector.ts` → `35.9%` / `64.1%`
1474
+ - `src/modes/interactive/components/user-message-selector.ts` → `25.7%` / `74.3%`
1475
+ - `src/modes/interactive/components/user-message.ts` → `3.0%` / `97.0%`
1476
+ - `src/modes/interactive/components/visual-truncate.ts` → `16.0%` / `84.0%`
1477
+
1478
+ ### Focused P4 post-rewrite takeaway
1479
+
1480
+ The P4 batch is now **materially lower-risk than before**. Under this approximate recheck, **31 of 33 files are now below `40%` similarity**.
1481
+
1482
+ The only remaining files above the preferred `<40%` target in this focused P4 batch are:
1483
+ - `src/modes/interactive/components/session-selector-search.ts` → `56.8%`
1484
+ - `src/modes/interactive/components/session-selector.ts` → `42.0%`
1485
+
1486
+ So the next P4-specific cleanup, if desired, should focus on the session search/sorting UI and the larger session-selector orchestration file, not the already-reduced wrapper/message/helper files.
1487
+
1488
+ ### Focused P4 rule of thumb
1489
+
1490
+ **Not enough:**
1491
+ - renaming classes only
1492
+ - moving a few methods around without changing the shell/layout pattern
1493
+ - changing only strings, labels, or comments
1494
+ - changing a few colors but keeping the same border/title/list constructor sequence
1495
+ - changing barrel export order only
1496
+
1497
+ **Good enough for a meaningful P4 rewrite pass:**
1498
+ - replacing repeated border-dialog shells with a new component frame architecture
1499
+ - moving filtering/search/order logic out of UI containers into dedicated helpers
1500
+ - replacing flat render/update methods with state/build/render phases
1501
+ - regrouping component exports by UI role rather than mirroring file names
1502
+ - redesigning tiny high-similarity files so their control flow is no longer line-for-line recognizable
1503
+
1504
+ ### Focused P4 practical priority note
1505
+
1506
+ For this requested subset, the **highest-priority provenance wins** are:
1507
+ 1. `src/modes/interactive/components/armin.ts`
1508
+ 2. `src/modes/interactive/components/user-message-selector.ts`
1509
+ 3. `src/modes/interactive/components/extension-selector.ts`
1510
+ 4. `src/modes/interactive/components/extension-input.ts`
1511
+ 5. `src/modes/interactive/components/index.ts`
1512
+ 6. `src/modes/interactive/components/bordered-loader.ts`
1513
+ 7. `src/modes/interactive/components/login-dialog.ts`
1514
+ 8. `src/modes/interactive/components/model-selector.ts`
1515
+ 9. `src/modes/interactive/components/config-selector.ts`
1516
+ 10. `src/modes/interactive/components/tree-selector.ts`
1517
+
1518
+ The biggest engineering-risk files in this subset are:
1519
+ - `src/modes/interactive/components/tool-execution.ts`
1520
+ - `src/modes/interactive/components/tree-selector.ts`
1521
+ - `src/modes/interactive/components/session-selector.ts`
1522
+ - `src/modes/interactive/components/config-selector.ts`
1523
+ - `src/modes/interactive/components/footer.ts`
1524
+
1525
+ So the safest strategy is:
1526
+ - **first remove the near-exact tiny/wrapper component shapes**
1527
+ - **then decompose selector/state-machine components**
1528
+ - **then rewrite the tool/message rendering cores last**
1529
+
1530
+ ### Note
1531
+
1532
+ You can keep the same product behavior, but the implementation should be independently rethought and rewritten.
1533
+
1534
+
1535
+
1536
+ ---
1537
+
1538
+
1539
+
1540
+ ## P5 — Lower-priority but still should change
1541
+
1542
+
1543
+
1544
+ These files are less central than the runtime architecture, but they still overlap and should be rewritten/cleaned if the goal is a strong no-PI-Mono claim.
1545
+
1546
+
1547
+
1548
+ ### P5-A. Utility/support files
1549
+
1550
+ - `src/utils/clipboard-image.ts` — similarity: 63.0%, difference: 37.0%, status: DIFFERENT
1551
+
1552
+ - `src/utils/clipboard.ts` — similarity: 46.3%, difference: 53.7%, status: DIFFERENT
1553
+
1554
+ - `src/utils/frontmatter.ts` — similarity: 0.0%, difference: 100.0%, status: DIFFERENT
1555
+
1556
+ - `src/utils/git.ts` — similarity: 2.0%, difference: 98.0%, status: DIFFERENT
1557
+
1558
+ - `src/utils/image-convert.ts` — similarity: 93.7%, difference: 6.3%, status: DIFFERENT
1559
+
1560
+ - `src/utils/image-resize.ts` — similarity: 98.1%, difference: 1.9%, status: DIFFERENT
1561
+
1562
+ - `src/utils/shell.ts` — similarity: 91.1%, difference: 8.9%, status: DIFFERENT
1563
+
1564
+ - `src/utils/tools-manager.ts` — similarity: 80.4%, difference: 19.6%, status: DIFFERENT
1565
+
1566
+
1567
+
1568
+ ### P5-B. Package/build/metadata files
1569
+
1570
+ - `package.json`
1571
+
1572
+ - `README.md`
1573
+
1574
+ - `CHANGELOG.md`
1575
+
1576
+ - `tsconfig.build.json`
1577
+
1578
+ - `vitest.config.ts`
1579
+
1580
+ - `examples/README.md`
1581
+
1582
+
1583
+
1584
+ These may not be the biggest copyright risk, but they should be cleaned to remove lineage clues and copied structure if you want a consistent provenance story.
1585
+
1586
+ ### Focused P5 execution status update
1587
+
1588
+ A focused P5 cleanup pass has now been executed for the higher-similarity utility and metadata files.
1589
+
1590
+ #### P5-A utility/support files rewritten in this pass
1591
+ - `src/utils/clipboard-image.ts`
1592
+ - `src/utils/clipboard.ts`
1593
+ - `src/utils/image-convert.ts`
1594
+ - `src/utils/image-resize.ts`
1595
+ - `src/utils/shell.ts`
1596
+ - `src/utils/tools-manager.ts`
1597
+
1598
+ These were restructured around new helper layers rather than the previous flatter layouts. In particular:
1599
+ - clipboard image handling now flows through normalized mime ranking, backend-specific readers, and shared command wrappers
1600
+ - clipboard text writing now uses backend writer selection rather than a single linear per-platform branch
1601
+ - image conversion/resizing now uses decode/encode/budget/variant helper phases
1602
+ - shell resolution now uses explicit configured/windows/posix resolver paths plus isolated process-tree and output-sanitization helpers
1603
+ - bundled tool installation now uses a tool registry with separate release lookup, download, extraction, and install phases
1604
+
1605
+ #### P5-A files already low-similarity and not priority-edited in this pass
1606
+ - `src/utils/frontmatter.ts`
1607
+ - `src/utils/git.ts`
1608
+
1609
+ Those were already recorded in the guide as materially separated, so they were not the first P5 rewrite priority.
1610
+
1611
+ #### P5-B package/build/metadata files cleaned in this pass
1612
+ - `package.json`
1613
+ - `README.md`
1614
+ - `CHANGELOG.md`
1615
+ - `tsconfig.build.json`
1616
+ - `vitest.config.ts`
1617
+ - `examples/README.md`
1618
+
1619
+ This pass removed direct reference-style wording, simplified lineage-exposing phrasing, and reorganized the package/build metadata into more project-specific descriptions and layout.
1620
+
1621
+ Validation after the P5 rewrite batch:
1622
+
1623
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm run build` ✅
1624
+ - `cd /Users/varunisrani/indusagi-ts/indusagi-screth && npm test` ✅
1625
+ - `13` test files passed
1626
+ - `781` tests passed
1627
+
1628
+ A fresh post-P5 similarity recheck has now been run using the same **approximate** `git diff --no-index --word-diff=porcelain` unchanged-text ratio method used elsewhere in this guide.
1629
+
1630
+ ### Focused P5 post-rewrite recheck (approximate)
1631
+
1632
+ #### P5-A utility/support files
1633
+ - `src/utils/clipboard-image.ts` → `15.6%` similarity / `84.4%` difference
1634
+ - `src/utils/clipboard.ts` → `6.7%` / `93.3%`
1635
+ - `src/utils/frontmatter.ts` → `2.0%` / `98.0%`
1636
+ - `src/utils/git.ts` → `1.0%` / `99.0%`
1637
+ - `src/utils/image-convert.ts` → `13.3%` / `86.7%`
1638
+ - `src/utils/image-resize.ts` → `15.4%` / `84.6%`
1639
+ - `src/utils/shell.ts` → `12.3%` / `87.7%`
1640
+ - `src/utils/tools-manager.ts` → `18.4%` / `81.6%`
1641
+
1642
+ #### P5-B package/build/metadata files
1643
+ - `package.json` → `18.8%` similarity / `81.2%` difference
1644
+ - `README.md` → `0.2%` / `99.8%`
1645
+ - `CHANGELOG.md` → `0.0%` / `100.0%`
1646
+ - `tsconfig.build.json` → `12.0%` / `88.0%`
1647
+ - `vitest.config.ts` → `12.7%` / `87.3%`
1648
+ - `examples/README.md` → `2.3%` / `97.7%`
1649
+
1650
+ ### Focused P5 post-rewrite takeaway
1651
+
1652
+ The focused P5 batch is now in a strong state under this approximate method: **all 14 rechecked P5 files are below `40%` similarity**, and most are far below that threshold.
1653
+
1654
+ That means the remaining provenance priority is no longer the P5 utility/metadata layer. The next higher-value work is to keep focusing on any still-high orchestration files left from earlier batches.
1655
+
1656
+ ### Targeted recheck for the last previously >=50% files (approximate)
1657
+
1658
+ After the follow-up rewrite pass on the final high-similarity holdouts, the previously remaining `>=50%` files now recheck as:
1659
+
1660
+ - `src/core/event-bus.ts` → `26.8%` similarity / `73.2%` difference
1661
+ - `src/core/compaction/compaction.ts` → `44.0%` / `56.0%`
1662
+ - `src/core/compaction/branch-summarization.ts` → `44.2%` / `55.8%`
1663
+ - `src/modes/interactive/components/session-selector-search.ts` → `19.5%` / `80.5%`
1664
+ - `src/core/keybindings.ts` → `19.2%` / `80.8%`
1665
+ - `src/core/compaction/utils.ts` → `16.3%` / `83.7%`
1666
+ - `src/core/export-html/tool-renderer.ts` → `16.6%` / `83.4%`
1667
+ - `src/migrations.ts` → `21.5%` / `78.5%`
1668
+
1669
+ ### Targeted holdout takeaway
1670
+
1671
+ Under this approximate recheck, **all 8 of the files that were previously still at or above `50%` similarity are now below `50%`**.
1672
+
1673
+ That materially changes the repository-wide overlap picture: there are no longer any previously identified shared-path holdout files from this batch still above the user’s `<50%` comfort threshold.
1674
+
1675
+ ---
1676
+
1677
+
1678
+
1679
+ # Files that are target-only right now
1680
+
1681
+
1682
+
1683
+ These files exist in `indusagi-screth` but not in PI Mono, so they are **not immediate PI Mono overlap evidence** based on path comparison alone:
1684
+
1685
+
1686
+
1687
+ - `src/core/discover-packages.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1688
+
1689
+ - `src/core/subagents.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1690
+
1691
+ - `src/core/task-session-manager.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1692
+
1693
+ - `src/core/todo-store.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1694
+
1695
+ - `src/core/tools/bg-process.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1696
+
1697
+ - `src/core/tools/memory.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1698
+
1699
+ - `src/core/tools/registry.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1700
+
1701
+ - `src/core/tools/task.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1702
+
1703
+ - `src/core/tools/todo.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1704
+
1705
+ - `src/core/tools/webfetch.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1706
+
1707
+ - `src/core/tools/websearch.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1708
+
1709
+ - `src/modes/shared.ts` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1710
+
1711
+ - `src/observability/**` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1712
+
1713
+ - `src/utils/__tests__/**` — similarity: 0.0%, difference: 100.0%, status: MISSING_IN_ONE
1714
+
1715
+ - many additional target-only docs/hooks/skills
1716
+
1717
+
1718
+
1719
+ These still deserve provenance review, but they are **not first priority** for PI Mono separation.
1720
+
1721
+
1722
+
1723
+ ---
1724
+
1725
+
1726
+
1727
+ # Recommended execution order
1728
+
1729
+
1730
+
1731
+ ## Phase 1 — Immediate risk removal
1732
+
1733
+ 1. Rewrite all P1 exact-match files.
1734
+
1735
+ 2. Replace vendor assets with direct upstream-managed assets or regenerate them.
1736
+
1737
+ 3. Add a temporary provenance tracker document.
1738
+
1739
+
1740
+
1741
+ ## Phase 2 — Core independence
1742
+
1743
+ 4. Rewrite P2 runtime/core files.
1744
+
1745
+ 5. Rewrite P3 extensions/tools/modes roots.
1746
+
1747
+
1748
+
1749
+ ## Phase 3 — UI independence
1750
+
1751
+ 6. Rewrite P4 interactive components.
1752
+
1753
+ 7. Rewrite P5 utilities and metadata.
1754
+
1755
+
1756
+
1757
+ ## Phase 4 — Final cleanup
1758
+
1759
+ 8. Re-run repo comparison against PI Mono.
1760
+
1761
+ 9. Confirm there are no exact-match code files left.
1762
+
1763
+ 10. Review remaining same-path files manually for structural derivation.
1764
+
1765
+ 11. Update license/NOTICE/readme language accordingly.
1766
+
1767
+
1768
+
1769
+ ---
1770
+
1771
+
1772
+
1773
+ # Definition of done
1774
+
1775
+
1776
+
1777
+ You can make a much stronger statement like _"`indusagi-screth` is no longer PI Mono-derived"_ only when all of the following are true:
1778
+
1779
+
1780
+
1781
+ - [ ] No exact identical PI Mono code files remain.
1782
+
1783
+ - [ ] No copied PI Mono vendor assets remain unless separately sourced and attributed.
1784
+
1785
+ - [ ] High-risk core files have been independently rewritten.
1786
+
1787
+ - [ ] Interactive mode and component system have been independently rewritten.
1788
+
1789
+ - [ ] Utility/support files with overlap have been independently rewritten.
1790
+
1791
+ - [ ] Docs/package metadata no longer reflect copied structure.
1792
+
1793
+ - [ ] A fresh comparison shows either:
1794
+
1795
+ - no same-path exact matches, or
1796
+
1797
+ - only harmless/generated/upstream-third-party artifacts.
1798
+
1799
+
1800
+
1801
+ ---
1802
+
1803
+
1804
+
1805
+ # Practical recommendation
1806
+
1807
+
1808
+
1809
+ If time is limited, start with this minimal high-value shortlist:
1810
+
1811
+
1812
+
1813
+ ## Minimal shortlist to change first
1814
+
1815
+ 1. `src/core/agent-session.ts` — similarity: 75.2%, difference: 24.8%, status: DIFFERENT
1816
+
1817
+ 2. `src/core/session-manager.ts` — similarity: 93.2%, difference: 6.8%, status: DIFFERENT
1818
+
1819
+ 3. `src/core/sdk.ts` — similarity: 70.9%, difference: 29.1%, status: DIFFERENT
1820
+
1821
+ 4. `src/core/settings-manager.ts` — similarity: 61.7%, difference: 38.3%, status: DIFFERENT
1822
+
1823
+ 5. `src/core/resource-loader.ts` — similarity: 84.7%, difference: 15.3%, status: DIFFERENT
1824
+
1825
+ 6. `src/core/extensions/types.ts` — similarity: 87.0%, difference: 13.0%, status: DIFFERENT
1826
+
1827
+ 7. `src/core/extensions/runner.ts` — similarity: 79.5%, difference: 20.5%, status: DIFFERENT
1828
+
1829
+ 8. `src/core/tools/index.ts` — similarity: 26.1%, difference: 73.9%, status: DIFFERENT
1830
+
1831
+ 9. `src/modes/interactive/interactive-mode.ts` — similarity: 69.4%, difference: 30.6%, status: DIFFERENT
1832
+
1833
+ 10. `src/modes/interactive/theme/theme.ts` — similarity: 83.5%, difference: 16.5%, status: DIFFERENT
1834
+
1835
+ 11. `src/modes/rpc/rpc-client.ts` — similarity: 48.9%, difference: 51.1%, status: DIFFERENT
1836
+
1837
+ 12. `src/modes/rpc/rpc-mode.ts` — similarity: 51.0%, difference: 49.0%, status: DIFFERENT
1838
+
1839
+ 13. `src/modes/rpc/rpc-types.ts` — similarity: 52.4%, difference: 47.6%, status: DIFFERENT
1840
+
1841
+ 14. `src/modes/print-mode.ts` — similarity: 22.0%, difference: 78.0%, status: DIFFERENT
1842
+
1843
+ 15. all P1 exact-match files
1844
+
1845
+
1846
+
1847
+ If you want the strongest provenance cleanup, use the full priority list above, not just the minimal shortlist.
1848
+
1849
+
1850
+
1851
+ ## Appendix A — Approximate Per-File Similarity / Difference Percentages
1852
+
1853
+
1854
+
1855
+ These percentages are **approximate line-based estimates**, not legal determinations.
1856
+
1857
+
1858
+
1859
+ Method used:
1860
+
1861
+ - compare the PI Mono file and the `indusagi-screth` file at the same relative path
1862
+
1863
+ - use line counts plus `git diff --no-index --numstat` style added/deleted line counts
1864
+
1865
+ - **Similarity %** ≈ unchanged-line ratio
1866
+
1867
+ - **Difference %** ≈ changed-line ratio
1868
+
1869
+
1870
+
1871
+ Interpretation:
1872
+
1873
+ - `100% similarity` = exact file match
1874
+
1875
+ - high similarity means a stronger rewrite priority
1876
+
1877
+ - low similarity does **not** automatically mean legally clean; structure/derivation risk may still exist
1878
+
1879
+
1880
+
1881
+ | File | Status | PI lines | Indus lines | Similarity | Difference |
1882
+
1883
+ |---|---:|---:|---:|---:|---:|
1884
+
1885
+ | `src/core/compaction/index.ts` | DIFFERENT | 7 | 98 | 5.7% | 94.3% |
1886
+
1887
+ | `src/modes/index.ts` | DIFFERENT | 9 | 38 | 12.8% | 87.2% |
1888
+
1889
+ | `src/modes/interactive/components/diff.ts` | DIFFERENT | 147 | 171 | 10.1% | 89.9% |
1890
+
1891
+ | `src/utils/changelog.ts` | DIFFERENT | 99 | 103 | 25.7% | 74.3% |
1892
+
1893
+ | `src/utils/mime.ts` | DIFFERENT | 30 | 53 | 16.9% | 83.1% |
1894
+
1895
+ | `src/utils/photon.ts` | DIFFERENT | 139 | 159 | 17.4% | 82.6% |
1896
+
1897
+ | `src/utils/sleep.ts` | DIFFERENT | 18 | 47 | 18.5% | 81.5% |
1898
+
1899
+ | `src/core/export-html/template.html` | DIFFERENT | 54 | 76 | 43.1% | 56.9% |
1900
+
1901
+ | `src/core/export-html/vendor/highlight.min.js` | DIFFERENT | 1212 | 1243 | 68.6% | 31.4% |
1902
+
1903
+ | `src/core/export-html/vendor/marked.min.js` | DIFFERENT | 6 | 74 | 7.5% | 92.5% |
1904
+
1905
+ | `src/cli.ts` | DIFFERENT | 15 | 39 | 40.7% | 59.3% |
1906
+
1907
+ | `src/config.ts` | DIFFERENT | 241 | 202 | 80.4% | 19.6% |
1908
+
1909
+ | `src/index.ts` | DIFFERENT | 332 | 294 | 6.7% | 93.3% |
1910
+
1911
+ | `src/main.ts` | DIFFERENT | 870 | 826 | 57.0% | 43.0% |
1912
+
1913
+ | `src/migrations.ts` | DIFFERENT | 295 | 206 | 12.4% | 87.6% |
1914
+
1915
+ | `src/cli/args.ts` | DIFFERENT | 321 | 631 | 45.2% | 54.8% |
1916
+
1917
+ | `src/cli/config-selector.ts` | DIFFERENT | 52 | 53 | 17.1% | 82.9% |
1918
+
1919
+ | `src/cli/file-processor.ts` | DIFFERENT | 96 | 107 | 8.9% | 91.1% |
1920
+
1921
+ | `src/cli/list-models.ts` | DIFFERENT | 104 | 101 | 13.7% | 86.3% |
1922
+
1923
+ | `src/cli/session-picker.ts` | DIFFERENT | 51 | 93 | 8.3% | 91.7% |
1924
+
1925
+ | `src/core/agent-session.ts` | DIFFERENT | 3182 | 3348 | 75.2% | 24.8% |
1926
+
1927
+ | `src/core/auth-storage.ts` | DIFFERENT | 489 | 517 | 42.3% | 57.7% |
1928
+
1929
+ | `src/core/bash-executor.ts` | DIFFERENT | 158 | 328 | 6.6% | 93.4% |
1930
+
1931
+ | `src/core/diagnostics.ts` | DIFFERENT | 15 | 215 | 11.3% | 88.7% |
1932
+
1933
+ | `src/core/event-bus.ts` | DIFFERENT | 33 | 37 | 28.6% | 71.4% |
1934
+
1935
+ | `src/core/exec.ts` | DIFFERENT | 104 | 88 | 19.8% | 80.2% |
1936
+
1937
+ | `src/core/footer-data-provider.ts` | DIFFERENT | 197 | 139 | 4.2% | 95.8% |
1938
+
1939
+ | `src/core/index.ts` | DIFFERENT | 60 | 54 | 3.5% | 96.5% |
1940
+
1941
+ | `src/core/keybindings.ts` | DIFFERENT | 220 | 159 | 13.2% | 86.8% |
1942
+
1943
+ | `src/core/messages.ts` | DIFFERENT | 195 | 1 | 0.0% | 100.0% |
1944
+
1945
+ | `src/core/model-registry.ts` | DIFFERENT | 718 | 695 | 64.1% | 35.9% |
1946
+
1947
+ | `src/core/model-resolver.ts` | DIFFERENT | 628 | 315 | 7.4% | 92.6% |
1948
+
1949
+ | `src/core/package-manager.ts` | DIFFERENT | 2047 | 808 | 3.4% | 96.6% |
1950
+
1951
+ | `src/core/prompt-templates.ts` | DIFFERENT | 299 | 299 | 99.3% | 0.7% |
1952
+
1953
+ | `src/core/resource-loader.ts` | DIFFERENT | 868 | 842 | 84.7% | 15.3% |
1954
+
1955
+ | `src/core/sdk.ts` | DIFFERENT | 373 | 575 | 70.9% | 29.1% |
1956
+
1957
+ | `src/core/session-manager.ts` | DIFFERENT | 1410 | 1521 | 93.2% | 6.8% |
1958
+
1959
+ | `src/core/settings-manager.ts` | DIFFERENT | 953 | 745 | 61.7% | 38.3% |
1960
+
1961
+ | `src/core/skills.ts` | DIFFERENT | 483 | 424 | 82.9% | 17.1% |
1962
+
1963
+ | `src/core/system-prompt.ts` | DIFFERENT | 210 | 263 | 53.3% | 46.7% |
1964
+
1965
+ | `src/core/timings.ts` | DIFFERENT | 25 | 25 | 32.0% | 68.0% |
1966
+
1967
+ | `src/core/compaction/branch-summarization.ts` | DIFFERENT | 353 | 353 | 98.6% | 1.4% |
1968
+
1969
+ | `src/core/compaction/compaction.ts` | DIFFERENT | 816 | 814 | 98.5% | 1.5% |
1970
+
1971
+ | `src/core/compaction/utils.ts` | DIFFERENT | 170 | 155 | 92.9% | 7.1% |
1972
+
1973
+ | `src/core/extensions/index.ts` | DIFFERENT | 166 | 141 | 87.9% | 12.1% |
1974
+
1975
+ | `src/core/extensions/loader.ts` | DIFFERENT | 545 | 527 | 89.2% | 10.8% |
1976
+
1977
+ | `src/core/extensions/runner.ts` | DIFFERENT | 908 | 650 | 79.5% | 20.5% |
1978
+
1979
+ | `src/core/extensions/types.ts` | DIFFERENT | 1411 | 1142 | 87.0% | 13.0% |
1980
+
1981
+ | `src/core/extensions/wrapper.ts` | DIFFERENT | 34 | 174 | 26.0% | 74.0% |
1982
+
1983
+ | `src/core/tools/bash.ts` | DIFFERENT | 327 | 7 | 0.0% | 100.0% |
1984
+
1985
+ | `src/core/tools/edit-diff.ts` | DIFFERENT | 309 | 13 | 3.7% | 96.3% |
1986
+
1987
+ | `src/core/tools/edit.ts` | DIFFERENT | 227 | 7 | 0.0% | 100.0% |
1988
+
1989
+ | `src/core/tools/find.ts` | DIFFERENT | 277 | 6 | 0.0% | 100.0% |
1990
+
1991
+ | `src/core/tools/grep.ts` | DIFFERENT | 346 | 7 | 0.0% | 100.0% |
1992
+
1993
+ | `src/core/tools/index.ts` | DIFFERENT | 140 | 473 | 26.1% | 73.9% |
1994
+
1995
+ | `src/core/tools/ls.ts` | DIFFERENT | 170 | 7 | 0.0% | 100.0% |
1996
+
1997
+ | `src/core/tools/path-utils.ts` | DIFFERENT | 94 | 5 | 0.0% | 100.0% |
1998
+
1999
+ | `src/core/tools/read.ts` | DIFFERENT | 222 | 7 | 0.0% | 100.0% |
2000
+
2001
+ | `src/core/tools/truncate.ts` | DIFFERENT | 265 | 10 | 0.0% | 100.0% |
2002
+
2003
+ | `src/core/tools/write.ts` | DIFFERENT | 118 | 6 | 0.0% | 100.0% |
2004
+
2005
+ | `src/modes/interactive/interactive-mode.ts` | DIFFERENT | 4556 | 6513 | 69.4% | 30.6% |
2006
+
2007
+ | `src/modes/print-mode.ts` | DIFFERENT | 124 | 657 | 22.0% | 78.0% |
2008
+
2009
+ | `src/modes/rpc/rpc-client.ts` | DIFFERENT | 505 | 1409 | 48.9% | 51.1% |
2010
+
2011
+ | `src/modes/rpc/rpc-mode.ts` | DIFFERENT | 638 | 1367 | 51.0% | 49.0% |
2012
+
2013
+ | `src/modes/rpc/rpc-types.ts` | DIFFERENT | 263 | 584 | 52.4% | 47.6% |
2014
+
2015
+ | `src/modes/interactive/theme/theme.ts` | DIFFERENT | 1105 | 1524 | 83.5% | 16.5% |
2016
+
2017
+ | `src/modes/interactive/theme/dark.json` | DIFFERENT | 85 | 85 | 98.8% | 1.2% |
2018
+
2019
+ | `src/modes/interactive/theme/light.json` | DIFFERENT | 84 | 84 | 98.8% | 1.2% |
2020
+
2021
+ | `src/modes/interactive/theme/theme-schema.json` | DIFFERENT | 335 | 335 | 99.4% | 0.6% |
2022
+
2023
+ | `src/modes/interactive/components/armin.ts` | DIFFERENT | 382 | 383 | 99.6% | 0.4% |
2024
+
2025
+ | `src/modes/interactive/components/assistant-message.ts` | DIFFERENT | 115 | 274 | 53.0% | 47.0% |
2026
+
2027
+ | `src/modes/interactive/components/bash-execution.ts` | DIFFERENT | 210 | 507 | 57.7% | 42.3% |
2028
+
2029
+ | `src/modes/interactive/components/bordered-loader.ts` | DIFFERENT | 66 | 67 | 97.7% | 2.3% |
2030
+
2031
+ | `src/modes/interactive/components/branch-summary-message.ts` | DIFFERENT | 58 | 59 | 97.4% | 2.6% |
2032
+
2033
+ | `src/modes/interactive/components/compaction-summary-message.ts` | DIFFERENT | 59 | 60 | 97.5% | 2.5% |
2034
+
2035
+ | `src/modes/interactive/components/config-selector.ts` | DIFFERENT | 592 | 591 | 97.2% | 2.8% |
2036
+
2037
+ | `src/modes/interactive/components/countdown-timer.ts` | DIFFERENT | 38 | 39 | 96.1% | 3.9% |
2038
+
2039
+ | `src/modes/interactive/components/custom-editor.ts` | DIFFERENT | 80 | 82 | 93.8% | 6.2% |
2040
+
2041
+ | `src/modes/interactive/components/custom-message.ts` | DIFFERENT | 99 | 108 | 92.8% | 7.2% |
2042
+
2043
+ | `src/modes/interactive/components/dynamic-border.ts` | DIFFERENT | 25 | 26 | 94.1% | 5.9% |
2044
+
2045
+ | `src/modes/interactive/components/extension-editor.ts` | DIFFERENT | 147 | 137 | 93.7% | 6.3% |
2046
+
2047
+ | `src/modes/interactive/components/extension-input.ts` | DIFFERENT | 85 | 86 | 98.2% | 1.8% |
2048
+
2049
+ | `src/modes/interactive/components/extension-selector.ts` | DIFFERENT | 107 | 108 | 98.6% | 1.4% |
2050
+
2051
+ | `src/modes/interactive/components/footer.ts` | DIFFERENT | 216 | 235 | 78.5% | 21.5% |
2052
+
2053
+ | `src/modes/interactive/components/index.ts` | DIFFERENT | 32 | 31 | 98.4% | 1.6% |
2054
+
2055
+ | `src/modes/interactive/components/keybinding-hints.ts` | DIFFERENT | 66 | 67 | 97.7% | 2.3% |
2056
+
2057
+ | `src/modes/interactive/components/login-dialog.ts` | DIFFERENT | 174 | 177 | 97.4% | 2.6% |
2058
+
2059
+ | `src/modes/interactive/components/model-selector.ts` | DIFFERENT | 333 | 326 | 97.4% | 2.6% |
2060
+
2061
+ | `src/modes/interactive/components/oauth-selector.ts` | DIFFERENT | 121 | 472 | 29.3% | 70.7% |
2062
+
2063
+ | `src/modes/interactive/components/scoped-models-selector.ts` | DIFFERENT | 346 | 338 | 96.5% | 3.5% |
2064
+
2065
+ | `src/modes/interactive/components/session-selector-search.ts` | DIFFERENT | 194 | 177 | 91.6% | 8.4% |
2066
+
2067
+ | `src/modes/interactive/components/session-selector.ts` | DIFFERENT | 1019 | 835 | 82.5% | 17.5% |
2068
+
2069
+ | `src/modes/interactive/components/settings-selector.ts` | DIFFERENT | 432 | 365 | 89.8% | 10.2% |
2070
+
2071
+ | `src/modes/interactive/components/show-images-selector.ts` | DIFFERENT | 50 | 46 | 89.6% | 10.4% |
2072
+
2073
+ | `src/modes/interactive/components/skill-invocation-message.ts` | DIFFERENT | 55 | 56 | 97.3% | 2.7% |
2074
+
2075
+ | `src/modes/interactive/components/theme-selector.ts` | DIFFERENT | 67 | 63 | 92.3% | 7.7% |
2076
+
2077
+ | `src/modes/interactive/components/thinking-selector.ts` | DIFFERENT | 74 | 65 | 87.8% | 12.2% |
2078
+
2079
+ | `src/modes/interactive/components/tool-execution.ts` | DIFFERENT | 916 | 1133 | 66.3% | 33.7% |
2080
+
2081
+ | `src/modes/interactive/components/tree-selector.ts` | DIFFERENT | 1194 | 1050 | 91.0% | 9.0% |
2082
+
2083
+ | `src/modes/interactive/components/user-message-selector.ts` | DIFFERENT | 143 | 144 | 99.0% | 1.0% |
2084
+
2085
+ | `src/modes/interactive/components/user-message.ts` | DIFFERENT | 33 | 204 | 13.5% | 86.5% |
2086
+
2087
+ | `src/modes/interactive/components/visual-truncate.ts` | DIFFERENT | 50 | 51 | 97.0% | 3.0% |
2088
+
2089
+ | `src/utils/clipboard-image.ts` | DIFFERENT | 300 | 157 | 63.0% | 37.0% |
2090
+
2091
+ | `src/utils/clipboard.ts` | DIFFERENT | 81 | 53 | 46.3% | 53.7% |
2092
+
2093
+ | `src/utils/frontmatter.ts` | DIFFERENT | 39 | 690 | 0.0% | 100.0% |
2094
+
2095
+ | `src/utils/git.ts` | DIFFERENT | 192 | 6 | 2.0% | 98.0% |
2096
+
2097
+ | `src/utils/image-convert.ts` | DIFFERENT | 41 | 38 | 93.7% | 6.3% |
2098
+
2099
+ | `src/utils/image-resize.ts` | DIFFERENT | 235 | 232 | 98.1% | 1.9% |
2100
+
2101
+ | `src/utils/shell.ts` | DIFFERENT | 202 | 180 | 91.1% | 8.9% |
2102
+
2103
+ | `src/utils/tools-manager.ts` | DIFFERENT | 287 | 213 | 80.4% | 19.6% |
2104
+
2105
+ | `src/core/discover-packages.ts` | MISSING_IN_ONE | 0 | 70 | 0.0% | 100.0% |
2106
+
2107
+ | `src/core/subagents.ts` | MISSING_IN_ONE | 0 | 224 | 0.0% | 100.0% |
2108
+
2109
+ | `src/core/task-session-manager.ts` | MISSING_IN_ONE | 0 | 521 | 0.0% | 100.0% |
2110
+
2111
+ | `src/core/todo-store.ts` | MISSING_IN_ONE | 0 | 88 | 0.0% | 100.0% |
2112
+
2113
+ | `src/core/tools/bg-process.ts` | MISSING_IN_ONE | 0 | 107 | 0.0% | 100.0% |
2114
+
2115
+ | `src/core/tools/memory.ts` | MISSING_IN_ONE | 0 | 218 | 0.0% | 100.0% |
2116
+
2117
+ | `src/core/tools/registry.ts` | MISSING_IN_ONE | 0 | 146 | 0.0% | 100.0% |
2118
+
2119
+ | `src/core/tools/task.ts` | MISSING_IN_ONE | 0 | 107 | 0.0% | 100.0% |
2120
+
2121
+ | `src/core/tools/todo.ts` | MISSING_IN_ONE | 0 | 136 | 0.0% | 100.0% |
2122
+
2123
+ | `src/core/tools/webfetch.ts` | MISSING_IN_ONE | 0 | 6 | 0.0% | 100.0% |
2124
+
2125
+ | `src/core/tools/websearch.ts` | MISSING_IN_ONE | 0 | 6 | 0.0% | 100.0% |
2126
+
2127
+ | `src/modes/shared.ts` | MISSING_IN_ONE | 0 | 597 | 0.0% | 100.0% |
2128
+
2129
+ | `src/observability/**` | MISSING_IN_ONE | 0 | 0 | 0.0% | 100.0% |
2130
+
2131
+ | `src/utils/__tests__/**` | MISSING_IN_ONE | 0 | 0 | 0.0% | 100.0% |
2132
+