@yjjeong/omg 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/LICENSE +21 -0
  3. package/README.md +153 -0
  4. package/dist/cli/args.d.ts +39 -0
  5. package/dist/cli/args.d.ts.map +1 -0
  6. package/dist/cli/args.js +129 -0
  7. package/dist/cli/args.js.map +1 -0
  8. package/dist/cli/autoCommit.d.ts +20 -0
  9. package/dist/cli/autoCommit.d.ts.map +1 -0
  10. package/dist/cli/autoCommit.js +121 -0
  11. package/dist/cli/autoCommit.js.map +1 -0
  12. package/dist/cli/bgTasks.d.ts +57 -0
  13. package/dist/cli/bgTasks.d.ts.map +1 -0
  14. package/dist/cli/bgTasks.js +193 -0
  15. package/dist/cli/bgTasks.js.map +1 -0
  16. package/dist/cli/compactor.d.ts +48 -0
  17. package/dist/cli/compactor.d.ts.map +1 -0
  18. package/dist/cli/compactor.js +73 -0
  19. package/dist/cli/compactor.js.map +1 -0
  20. package/dist/cli/doctor.d.ts +77 -0
  21. package/dist/cli/doctor.d.ts.map +1 -0
  22. package/dist/cli/doctor.js +279 -0
  23. package/dist/cli/doctor.js.map +1 -0
  24. package/dist/cli/gitStatus.d.ts +7 -0
  25. package/dist/cli/gitStatus.d.ts.map +1 -0
  26. package/dist/cli/gitStatus.js +70 -0
  27. package/dist/cli/gitStatus.js.map +1 -0
  28. package/dist/cli/handoff.d.ts +36 -0
  29. package/dist/cli/handoff.d.ts.map +1 -0
  30. package/dist/cli/handoff.js +60 -0
  31. package/dist/cli/handoff.js.map +1 -0
  32. package/dist/cli/interactive/brokers.d.ts +31 -0
  33. package/dist/cli/interactive/brokers.d.ts.map +1 -0
  34. package/dist/cli/interactive/brokers.js +259 -0
  35. package/dist/cli/interactive/brokers.js.map +1 -0
  36. package/dist/cli/interactive/index.d.ts +8 -0
  37. package/dist/cli/interactive/index.d.ts.map +1 -0
  38. package/dist/cli/interactive/index.js +731 -0
  39. package/dist/cli/interactive/index.js.map +1 -0
  40. package/dist/cli/interactive/proxyQuestions.d.ts +15 -0
  41. package/dist/cli/interactive/proxyQuestions.d.ts.map +1 -0
  42. package/dist/cli/interactive/proxyQuestions.js +48 -0
  43. package/dist/cli/interactive/proxyQuestions.js.map +1 -0
  44. package/dist/cli/interactive/tabManager.d.ts +32 -0
  45. package/dist/cli/interactive/tabManager.d.ts.map +1 -0
  46. package/dist/cli/interactive/tabManager.js +244 -0
  47. package/dist/cli/interactive/tabManager.js.map +1 -0
  48. package/dist/cli/interactive/teamHint.d.ts +2 -0
  49. package/dist/cli/interactive/teamHint.d.ts.map +1 -0
  50. package/dist/cli/interactive/teamHint.js +14 -0
  51. package/dist/cli/interactive/teamHint.js.map +1 -0
  52. package/dist/cli/login.d.ts +13 -0
  53. package/dist/cli/login.d.ts.map +1 -0
  54. package/dist/cli/login.js +53 -0
  55. package/dist/cli/login.js.map +1 -0
  56. package/dist/cli/modes/demo.d.ts +12 -0
  57. package/dist/cli/modes/demo.d.ts.map +1 -0
  58. package/dist/cli/modes/demo.js +48 -0
  59. package/dist/cli/modes/demo.js.map +1 -0
  60. package/dist/cli/modes/doctor.d.ts +28 -0
  61. package/dist/cli/modes/doctor.d.ts.map +1 -0
  62. package/dist/cli/modes/doctor.js +79 -0
  63. package/dist/cli/modes/doctor.js.map +1 -0
  64. package/dist/cli/modes/login.d.ts +5 -0
  65. package/dist/cli/modes/login.d.ts.map +1 -0
  66. package/dist/cli/modes/login.js +40 -0
  67. package/dist/cli/modes/login.js.map +1 -0
  68. package/dist/cli/modes/mcpServe.d.ts +9 -0
  69. package/dist/cli/modes/mcpServe.d.ts.map +1 -0
  70. package/dist/cli/modes/mcpServe.js +112 -0
  71. package/dist/cli/modes/mcpServe.js.map +1 -0
  72. package/dist/cli/modes/orchestrator.d.ts +14 -0
  73. package/dist/cli/modes/orchestrator.d.ts.map +1 -0
  74. package/dist/cli/modes/orchestrator.js +64 -0
  75. package/dist/cli/modes/orchestrator.js.map +1 -0
  76. package/dist/cli/modes/team.d.ts +14 -0
  77. package/dist/cli/modes/team.d.ts.map +1 -0
  78. package/dist/cli/modes/team.js +87 -0
  79. package/dist/cli/modes/team.js.map +1 -0
  80. package/dist/cli/registry.d.ts +3 -0
  81. package/dist/cli/registry.d.ts.map +1 -0
  82. package/dist/cli/registry.js +15 -0
  83. package/dist/cli/registry.js.map +1 -0
  84. package/dist/cli/slash/core.d.ts +3 -0
  85. package/dist/cli/slash/core.d.ts.map +1 -0
  86. package/dist/cli/slash/core.js +509 -0
  87. package/dist/cli/slash/core.js.map +1 -0
  88. package/dist/cli/slash/index.d.ts +3 -0
  89. package/dist/cli/slash/index.d.ts.map +1 -0
  90. package/dist/cli/slash/index.js +28 -0
  91. package/dist/cli/slash/index.js.map +1 -0
  92. package/dist/cli/slash/modes.d.ts +3 -0
  93. package/dist/cli/slash/modes.d.ts.map +1 -0
  94. package/dist/cli/slash/modes.js +530 -0
  95. package/dist/cli/slash/modes.js.map +1 -0
  96. package/dist/cli/slash/session.d.ts +3 -0
  97. package/dist/cli/slash/session.d.ts.map +1 -0
  98. package/dist/cli/slash/session.js +376 -0
  99. package/dist/cli/slash/session.js.map +1 -0
  100. package/dist/cli/slash/shared.d.ts +43 -0
  101. package/dist/cli/slash/shared.d.ts.map +1 -0
  102. package/dist/cli/slash/shared.js +6 -0
  103. package/dist/cli/slash/shared.js.map +1 -0
  104. package/dist/cli/slash/tabs.d.ts +3 -0
  105. package/dist/cli/slash/tabs.d.ts.map +1 -0
  106. package/dist/cli/slash/tabs.js +497 -0
  107. package/dist/cli/slash/tabs.js.map +1 -0
  108. package/dist/cli/slash/team.d.ts +3 -0
  109. package/dist/cli/slash/team.d.ts.map +1 -0
  110. package/dist/cli/slash/team.js +85 -0
  111. package/dist/cli/slash/team.js.map +1 -0
  112. package/dist/cli/slash.d.ts +3 -0
  113. package/dist/cli/slash.d.ts.map +1 -0
  114. package/dist/cli/slash.js +8 -0
  115. package/dist/cli/slash.js.map +1 -0
  116. package/dist/cli/teamPipeline.d.ts +42 -0
  117. package/dist/cli/teamPipeline.d.ts.map +1 -0
  118. package/dist/cli/teamPipeline.js +406 -0
  119. package/dist/cli/teamPipeline.js.map +1 -0
  120. package/dist/cli/touchedFiles.d.ts +14 -0
  121. package/dist/cli/touchedFiles.d.ts.map +1 -0
  122. package/dist/cli/touchedFiles.js +66 -0
  123. package/dist/cli/touchedFiles.js.map +1 -0
  124. package/dist/cli/turn.d.ts +47 -0
  125. package/dist/cli/turn.d.ts.map +1 -0
  126. package/dist/cli/turn.js +626 -0
  127. package/dist/cli/turn.js.map +1 -0
  128. package/dist/cli/types.d.ts +47 -0
  129. package/dist/cli/types.d.ts.map +1 -0
  130. package/dist/cli/types.js +5 -0
  131. package/dist/cli/types.js.map +1 -0
  132. package/dist/cli/uiSession.d.ts +10 -0
  133. package/dist/cli/uiSession.d.ts.map +1 -0
  134. package/dist/cli/uiSession.js +66 -0
  135. package/dist/cli/uiSession.js.map +1 -0
  136. package/dist/cli.d.ts +3 -0
  137. package/dist/cli.d.ts.map +1 -0
  138. package/dist/cli.js +128 -0
  139. package/dist/cli.js.map +1 -0
  140. package/dist/core/adapter.d.ts +47 -0
  141. package/dist/core/adapter.d.ts.map +1 -0
  142. package/dist/core/adapter.js +48 -0
  143. package/dist/core/adapter.js.map +1 -0
  144. package/dist/core/adapters/anthropic.d.ts +35 -0
  145. package/dist/core/adapters/anthropic.d.ts.map +1 -0
  146. package/dist/core/adapters/anthropic.js +203 -0
  147. package/dist/core/adapters/anthropic.js.map +1 -0
  148. package/dist/core/adapters/claudeCli.d.ts +126 -0
  149. package/dist/core/adapters/claudeCli.d.ts.map +1 -0
  150. package/dist/core/adapters/claudeCli.js +584 -0
  151. package/dist/core/adapters/claudeCli.js.map +1 -0
  152. package/dist/core/adapters/cliAdapterBase.d.ts +48 -0
  153. package/dist/core/adapters/cliAdapterBase.d.ts.map +1 -0
  154. package/dist/core/adapters/cliAdapterBase.js +105 -0
  155. package/dist/core/adapters/cliAdapterBase.js.map +1 -0
  156. package/dist/core/adapters/cliStderr.d.ts +35 -0
  157. package/dist/core/adapters/cliStderr.d.ts.map +1 -0
  158. package/dist/core/adapters/cliStderr.js +87 -0
  159. package/dist/core/adapters/cliStderr.js.map +1 -0
  160. package/dist/core/adapters/codexCli.d.ts +113 -0
  161. package/dist/core/adapters/codexCli.d.ts.map +1 -0
  162. package/dist/core/adapters/codexCli.js +424 -0
  163. package/dist/core/adapters/codexCli.js.map +1 -0
  164. package/dist/core/adapters/gemini.d.ts +17 -0
  165. package/dist/core/adapters/gemini.d.ts.map +1 -0
  166. package/dist/core/adapters/gemini.js +133 -0
  167. package/dist/core/adapters/gemini.js.map +1 -0
  168. package/dist/core/adapters/geminiCli.d.ts +91 -0
  169. package/dist/core/adapters/geminiCli.d.ts.map +1 -0
  170. package/dist/core/adapters/geminiCli.js +276 -0
  171. package/dist/core/adapters/geminiCli.js.map +1 -0
  172. package/dist/core/adapters/nudges.d.ts +21 -0
  173. package/dist/core/adapters/nudges.d.ts.map +1 -0
  174. package/dist/core/adapters/nudges.js +75 -0
  175. package/dist/core/adapters/nudges.js.map +1 -0
  176. package/dist/core/adapters/openai.d.ts +17 -0
  177. package/dist/core/adapters/openai.d.ts.map +1 -0
  178. package/dist/core/adapters/openai.js +138 -0
  179. package/dist/core/adapters/openai.js.map +1 -0
  180. package/dist/core/adapters/parseFailures.d.ts +10 -0
  181. package/dist/core/adapters/parseFailures.d.ts.map +1 -0
  182. package/dist/core/adapters/parseFailures.js +35 -0
  183. package/dist/core/adapters/parseFailures.js.map +1 -0
  184. package/dist/core/adapters/utils.d.ts +11 -0
  185. package/dist/core/adapters/utils.d.ts.map +1 -0
  186. package/dist/core/adapters/utils.js +33 -0
  187. package/dist/core/adapters/utils.js.map +1 -0
  188. package/dist/core/askBroker.d.ts +11 -0
  189. package/dist/core/askBroker.d.ts.map +1 -0
  190. package/dist/core/askBroker.js +78 -0
  191. package/dist/core/askBroker.js.map +1 -0
  192. package/dist/core/atomicWrite.d.ts +5 -0
  193. package/dist/core/atomicWrite.d.ts.map +1 -0
  194. package/dist/core/atomicWrite.js +18 -0
  195. package/dist/core/atomicWrite.js.map +1 -0
  196. package/dist/core/brokers/askBroker.d.ts +11 -0
  197. package/dist/core/brokers/askBroker.d.ts.map +1 -0
  198. package/dist/core/brokers/askBroker.js +78 -0
  199. package/dist/core/brokers/askBroker.js.map +1 -0
  200. package/dist/core/brokers/permissionBroker.d.ts +7 -0
  201. package/dist/core/brokers/permissionBroker.d.ts.map +1 -0
  202. package/dist/core/brokers/permissionBroker.js +63 -0
  203. package/dist/core/brokers/permissionBroker.js.map +1 -0
  204. package/dist/core/brokers/socketBroker.d.ts +35 -0
  205. package/dist/core/brokers/socketBroker.d.ts.map +1 -0
  206. package/dist/core/brokers/socketBroker.js +74 -0
  207. package/dist/core/brokers/socketBroker.js.map +1 -0
  208. package/dist/core/clipboard.d.ts +4 -0
  209. package/dist/core/clipboard.d.ts.map +1 -0
  210. package/dist/core/clipboard.js +46 -0
  211. package/dist/core/clipboard.js.map +1 -0
  212. package/dist/core/compactor.d.ts +32 -0
  213. package/dist/core/compactor.d.ts.map +1 -0
  214. package/dist/core/compactor.js +91 -0
  215. package/dist/core/compactor.js.map +1 -0
  216. package/dist/core/consensusEngine.d.ts +21 -0
  217. package/dist/core/consensusEngine.d.ts.map +1 -0
  218. package/dist/core/consensusEngine.js +116 -0
  219. package/dist/core/consensusEngine.js.map +1 -0
  220. package/dist/core/context/contextCompressor.d.ts +10 -0
  221. package/dist/core/context/contextCompressor.d.ts.map +1 -0
  222. package/dist/core/context/contextCompressor.js +54 -0
  223. package/dist/core/context/contextCompressor.js.map +1 -0
  224. package/dist/core/context/contextWindows.d.ts +25 -0
  225. package/dist/core/context/contextWindows.d.ts.map +1 -0
  226. package/dist/core/context/contextWindows.js +101 -0
  227. package/dist/core/context/contextWindows.js.map +1 -0
  228. package/dist/core/context/summarizer.d.ts +65 -0
  229. package/dist/core/context/summarizer.d.ts.map +1 -0
  230. package/dist/core/context/summarizer.js +184 -0
  231. package/dist/core/context/summarizer.js.map +1 -0
  232. package/dist/core/context/usageCache.d.ts +19 -0
  233. package/dist/core/context/usageCache.d.ts.map +1 -0
  234. package/dist/core/context/usageCache.js +157 -0
  235. package/dist/core/context/usageCache.js.map +1 -0
  236. package/dist/core/context/usageWindow.d.ts +19 -0
  237. package/dist/core/context/usageWindow.d.ts.map +1 -0
  238. package/dist/core/context/usageWindow.js +73 -0
  239. package/dist/core/context/usageWindow.js.map +1 -0
  240. package/dist/core/contextCompressor.d.ts +10 -0
  241. package/dist/core/contextCompressor.d.ts.map +1 -0
  242. package/dist/core/contextCompressor.js +54 -0
  243. package/dist/core/contextCompressor.js.map +1 -0
  244. package/dist/core/contextWindows.d.ts +5 -0
  245. package/dist/core/contextWindows.d.ts.map +1 -0
  246. package/dist/core/contextWindows.js +60 -0
  247. package/dist/core/contextWindows.js.map +1 -0
  248. package/dist/core/continuum/digest.d.ts +35 -0
  249. package/dist/core/continuum/digest.d.ts.map +1 -0
  250. package/dist/core/continuum/digest.js +91 -0
  251. package/dist/core/continuum/digest.js.map +1 -0
  252. package/dist/core/continuum/index.d.ts +6 -0
  253. package/dist/core/continuum/index.d.ts.map +1 -0
  254. package/dist/core/continuum/index.js +7 -0
  255. package/dist/core/continuum/index.js.map +1 -0
  256. package/dist/core/continuum/inject.d.ts +9 -0
  257. package/dist/core/continuum/inject.d.ts.map +1 -0
  258. package/dist/core/continuum/inject.js +78 -0
  259. package/dist/core/continuum/inject.js.map +1 -0
  260. package/dist/core/continuum/projectId.d.ts +10 -0
  261. package/dist/core/continuum/projectId.d.ts.map +1 -0
  262. package/dist/core/continuum/projectId.js +60 -0
  263. package/dist/core/continuum/projectId.js.map +1 -0
  264. package/dist/core/continuum/store.d.ts +24 -0
  265. package/dist/core/continuum/store.d.ts.map +1 -0
  266. package/dist/core/continuum/store.js +144 -0
  267. package/dist/core/continuum/store.js.map +1 -0
  268. package/dist/core/continuum/types.d.ts +87 -0
  269. package/dist/core/continuum/types.d.ts.map +1 -0
  270. package/dist/core/continuum/types.js +9 -0
  271. package/dist/core/continuum/types.js.map +1 -0
  272. package/dist/core/dag.d.ts +21 -0
  273. package/dist/core/dag.d.ts.map +1 -0
  274. package/dist/core/dag.js +71 -0
  275. package/dist/core/dag.js.map +1 -0
  276. package/dist/core/director.d.ts +11 -0
  277. package/dist/core/director.d.ts.map +1 -0
  278. package/dist/core/director.js +37 -0
  279. package/dist/core/director.js.map +1 -0
  280. package/dist/core/hookedToolBroker.d.ts +25 -0
  281. package/dist/core/hookedToolBroker.d.ts.map +1 -0
  282. package/dist/core/hookedToolBroker.js +95 -0
  283. package/dist/core/hookedToolBroker.js.map +1 -0
  284. package/dist/core/langHint.d.ts +9 -0
  285. package/dist/core/langHint.d.ts.map +1 -0
  286. package/dist/core/langHint.js +33 -0
  287. package/dist/core/langHint.js.map +1 -0
  288. package/dist/core/mcp/mcpClient.d.ts +42 -0
  289. package/dist/core/mcp/mcpClient.d.ts.map +1 -0
  290. package/dist/core/mcp/mcpClient.js +134 -0
  291. package/dist/core/mcp/mcpClient.js.map +1 -0
  292. package/dist/core/mcp/mcpConfig.d.ts +58 -0
  293. package/dist/core/mcp/mcpConfig.d.ts.map +1 -0
  294. package/dist/core/mcp/mcpConfig.js +148 -0
  295. package/dist/core/mcp/mcpConfig.js.map +1 -0
  296. package/dist/core/mcp/mcpManager.d.ts +31 -0
  297. package/dist/core/mcp/mcpManager.d.ts.map +1 -0
  298. package/dist/core/mcp/mcpManager.js +83 -0
  299. package/dist/core/mcp/mcpManager.js.map +1 -0
  300. package/dist/core/mcpClient.d.ts +42 -0
  301. package/dist/core/mcpClient.d.ts.map +1 -0
  302. package/dist/core/mcpClient.js +134 -0
  303. package/dist/core/mcpClient.js.map +1 -0
  304. package/dist/core/mcpConfig.d.ts +24 -0
  305. package/dist/core/mcpConfig.d.ts.map +1 -0
  306. package/dist/core/mcpConfig.js +74 -0
  307. package/dist/core/mcpConfig.js.map +1 -0
  308. package/dist/core/mcpManager.d.ts +31 -0
  309. package/dist/core/mcpManager.d.ts.map +1 -0
  310. package/dist/core/mcpManager.js +83 -0
  311. package/dist/core/mcpManager.js.map +1 -0
  312. package/dist/core/memory.d.ts +22 -0
  313. package/dist/core/memory.d.ts.map +1 -0
  314. package/dist/core/memory.js +102 -0
  315. package/dist/core/memory.js.map +1 -0
  316. package/dist/core/omgToolManifest.d.ts +34 -0
  317. package/dist/core/omgToolManifest.d.ts.map +1 -0
  318. package/dist/core/omgToolManifest.js +59 -0
  319. package/dist/core/omgToolManifest.js.map +1 -0
  320. package/dist/core/orchestration/consensusEngine.d.ts +21 -0
  321. package/dist/core/orchestration/consensusEngine.d.ts.map +1 -0
  322. package/dist/core/orchestration/consensusEngine.js +116 -0
  323. package/dist/core/orchestration/consensusEngine.js.map +1 -0
  324. package/dist/core/orchestration/dag.d.ts +21 -0
  325. package/dist/core/orchestration/dag.d.ts.map +1 -0
  326. package/dist/core/orchestration/dag.js +71 -0
  327. package/dist/core/orchestration/dag.js.map +1 -0
  328. package/dist/core/orchestration/director.d.ts +11 -0
  329. package/dist/core/orchestration/director.d.ts.map +1 -0
  330. package/dist/core/orchestration/director.js +37 -0
  331. package/dist/core/orchestration/director.js.map +1 -0
  332. package/dist/core/orchestration/orchestrator.d.ts +32 -0
  333. package/dist/core/orchestration/orchestrator.d.ts.map +1 -0
  334. package/dist/core/orchestration/orchestrator.js +214 -0
  335. package/dist/core/orchestration/orchestrator.js.map +1 -0
  336. package/dist/core/orchestration/roleRouter.d.ts +28 -0
  337. package/dist/core/orchestration/roleRouter.d.ts.map +1 -0
  338. package/dist/core/orchestration/roleRouter.js +64 -0
  339. package/dist/core/orchestration/roleRouter.js.map +1 -0
  340. package/dist/core/orchestration/teamRunner.d.ts +69 -0
  341. package/dist/core/orchestration/teamRunner.d.ts.map +1 -0
  342. package/dist/core/orchestration/teamRunner.js +477 -0
  343. package/dist/core/orchestration/teamRunner.js.map +1 -0
  344. package/dist/core/orchestration/types.d.ts +115 -0
  345. package/dist/core/orchestration/types.d.ts.map +1 -0
  346. package/dist/core/orchestration/types.js +71 -0
  347. package/dist/core/orchestration/types.js.map +1 -0
  348. package/dist/core/orchestrator.d.ts +32 -0
  349. package/dist/core/orchestrator.d.ts.map +1 -0
  350. package/dist/core/orchestrator.js +214 -0
  351. package/dist/core/orchestrator.js.map +1 -0
  352. package/dist/core/permissionBroker.d.ts +7 -0
  353. package/dist/core/permissionBroker.d.ts.map +1 -0
  354. package/dist/core/permissionBroker.js +63 -0
  355. package/dist/core/permissionBroker.js.map +1 -0
  356. package/dist/core/planConfig.d.ts +15 -0
  357. package/dist/core/planConfig.d.ts.map +1 -0
  358. package/dist/core/planConfig.js +98 -0
  359. package/dist/core/planConfig.js.map +1 -0
  360. package/dist/core/presetPersistence.d.ts +4 -0
  361. package/dist/core/presetPersistence.d.ts.map +1 -0
  362. package/dist/core/presetPersistence.js +64 -0
  363. package/dist/core/presetPersistence.js.map +1 -0
  364. package/dist/core/roleRouter.d.ts +26 -0
  365. package/dist/core/roleRouter.d.ts.map +1 -0
  366. package/dist/core/roleRouter.js +62 -0
  367. package/dist/core/roleRouter.js.map +1 -0
  368. package/dist/core/sessionList.d.ts +26 -0
  369. package/dist/core/sessionList.d.ts.map +1 -0
  370. package/dist/core/sessionList.js +278 -0
  371. package/dist/core/sessionList.js.map +1 -0
  372. package/dist/core/slugify.d.ts +2 -0
  373. package/dist/core/slugify.d.ts.map +1 -0
  374. package/dist/core/slugify.js +17 -0
  375. package/dist/core/slugify.js.map +1 -0
  376. package/dist/core/socketBroker.d.ts +19 -0
  377. package/dist/core/socketBroker.d.ts.map +1 -0
  378. package/dist/core/socketBroker.js +48 -0
  379. package/dist/core/socketBroker.js.map +1 -0
  380. package/dist/core/state/agentsMdScaffold.d.ts +15 -0
  381. package/dist/core/state/agentsMdScaffold.d.ts.map +1 -0
  382. package/dist/core/state/agentsMdScaffold.js +118 -0
  383. package/dist/core/state/agentsMdScaffold.js.map +1 -0
  384. package/dist/core/state/atomicWrite.d.ts +5 -0
  385. package/dist/core/state/atomicWrite.d.ts.map +1 -0
  386. package/dist/core/state/atomicWrite.js +18 -0
  387. package/dist/core/state/atomicWrite.js.map +1 -0
  388. package/dist/core/state/handoff.d.ts +20 -0
  389. package/dist/core/state/handoff.d.ts.map +1 -0
  390. package/dist/core/state/handoff.js +71 -0
  391. package/dist/core/state/handoff.js.map +1 -0
  392. package/dist/core/state/mcpCatalog.d.ts +11 -0
  393. package/dist/core/state/mcpCatalog.d.ts.map +1 -0
  394. package/dist/core/state/mcpCatalog.js +51 -0
  395. package/dist/core/state/mcpCatalog.js.map +1 -0
  396. package/dist/core/state/mcpRecommendations.d.ts +7 -0
  397. package/dist/core/state/mcpRecommendations.d.ts.map +1 -0
  398. package/dist/core/state/mcpRecommendations.js +57 -0
  399. package/dist/core/state/mcpRecommendations.js.map +1 -0
  400. package/dist/core/state/memory.d.ts +22 -0
  401. package/dist/core/state/memory.d.ts.map +1 -0
  402. package/dist/core/state/memory.js +102 -0
  403. package/dist/core/state/memory.js.map +1 -0
  404. package/dist/core/state/planConfig.d.ts +15 -0
  405. package/dist/core/state/planConfig.d.ts.map +1 -0
  406. package/dist/core/state/planConfig.js +98 -0
  407. package/dist/core/state/planConfig.js.map +1 -0
  408. package/dist/core/state/presetPersistence.d.ts +4 -0
  409. package/dist/core/state/presetPersistence.d.ts.map +1 -0
  410. package/dist/core/state/presetPersistence.js +67 -0
  411. package/dist/core/state/presetPersistence.js.map +1 -0
  412. package/dist/core/state/sessionList.d.ts +26 -0
  413. package/dist/core/state/sessionList.d.ts.map +1 -0
  414. package/dist/core/state/sessionList.js +278 -0
  415. package/dist/core/state/sessionList.js.map +1 -0
  416. package/dist/core/state/stackDetect.d.ts +8 -0
  417. package/dist/core/state/stackDetect.d.ts.map +1 -0
  418. package/dist/core/state/stackDetect.js +40 -0
  419. package/dist/core/state/stackDetect.js.map +1 -0
  420. package/dist/core/state/tabPersistence.d.ts +29 -0
  421. package/dist/core/state/tabPersistence.d.ts.map +1 -0
  422. package/dist/core/state/tabPersistence.js +65 -0
  423. package/dist/core/state/tabPersistence.js.map +1 -0
  424. package/dist/core/tabPersistence.d.ts +29 -0
  425. package/dist/core/tabPersistence.d.ts.map +1 -0
  426. package/dist/core/tabPersistence.js +65 -0
  427. package/dist/core/tabPersistence.js.map +1 -0
  428. package/dist/core/teamRunner.d.ts +42 -0
  429. package/dist/core/teamRunner.d.ts.map +1 -0
  430. package/dist/core/teamRunner.js +248 -0
  431. package/dist/core/teamRunner.js.map +1 -0
  432. package/dist/core/toolGate.d.ts +23 -0
  433. package/dist/core/toolGate.d.ts.map +1 -0
  434. package/dist/core/toolGate.js +51 -0
  435. package/dist/core/toolGate.js.map +1 -0
  436. package/dist/core/toolInterceptor.d.ts +7 -0
  437. package/dist/core/toolInterceptor.d.ts.map +1 -0
  438. package/dist/core/toolInterceptor.js +108 -0
  439. package/dist/core/toolInterceptor.js.map +1 -0
  440. package/dist/core/tools/hookedToolBroker.d.ts +25 -0
  441. package/dist/core/tools/hookedToolBroker.d.ts.map +1 -0
  442. package/dist/core/tools/hookedToolBroker.js +95 -0
  443. package/dist/core/tools/hookedToolBroker.js.map +1 -0
  444. package/dist/core/tools/omgToolManifest.d.ts +42 -0
  445. package/dist/core/tools/omgToolManifest.d.ts.map +1 -0
  446. package/dist/core/tools/omgToolManifest.js +66 -0
  447. package/dist/core/tools/omgToolManifest.js.map +1 -0
  448. package/dist/core/tools/toolGate.d.ts +23 -0
  449. package/dist/core/tools/toolGate.d.ts.map +1 -0
  450. package/dist/core/tools/toolGate.js +51 -0
  451. package/dist/core/tools/toolGate.js.map +1 -0
  452. package/dist/core/tools/toolInterceptor.d.ts +7 -0
  453. package/dist/core/tools/toolInterceptor.d.ts.map +1 -0
  454. package/dist/core/tools/toolInterceptor.js +108 -0
  455. package/dist/core/tools/toolInterceptor.js.map +1 -0
  456. package/dist/core/tools/tools.d.ts +34 -0
  457. package/dist/core/tools/tools.d.ts.map +1 -0
  458. package/dist/core/tools/tools.js +328 -0
  459. package/dist/core/tools/tools.js.map +1 -0
  460. package/dist/core/tools.d.ts +34 -0
  461. package/dist/core/tools.d.ts.map +1 -0
  462. package/dist/core/tools.js +300 -0
  463. package/dist/core/tools.js.map +1 -0
  464. package/dist/core/types.d.ts +107 -0
  465. package/dist/core/types.d.ts.map +1 -0
  466. package/dist/core/types.js +55 -0
  467. package/dist/core/types.js.map +1 -0
  468. package/dist/core/usageCache.d.ts +19 -0
  469. package/dist/core/usageCache.d.ts.map +1 -0
  470. package/dist/core/usageCache.js +157 -0
  471. package/dist/core/usageCache.js.map +1 -0
  472. package/dist/core/usageWindow.d.ts +19 -0
  473. package/dist/core/usageWindow.d.ts.map +1 -0
  474. package/dist/core/usageWindow.js +73 -0
  475. package/dist/core/usageWindow.js.map +1 -0
  476. package/dist/core/util/bgProtocol.d.ts +5 -0
  477. package/dist/core/util/bgProtocol.d.ts.map +1 -0
  478. package/dist/core/util/bgProtocol.js +20 -0
  479. package/dist/core/util/bgProtocol.js.map +1 -0
  480. package/dist/core/util/clipboard.d.ts +4 -0
  481. package/dist/core/util/clipboard.d.ts.map +1 -0
  482. package/dist/core/util/clipboard.js +46 -0
  483. package/dist/core/util/clipboard.js.map +1 -0
  484. package/dist/core/util/clipboardImage.d.ts +3 -0
  485. package/dist/core/util/clipboardImage.d.ts.map +1 -0
  486. package/dist/core/util/clipboardImage.js +58 -0
  487. package/dist/core/util/clipboardImage.js.map +1 -0
  488. package/dist/core/util/langHint.d.ts +9 -0
  489. package/dist/core/util/langHint.d.ts.map +1 -0
  490. package/dist/core/util/langHint.js +33 -0
  491. package/dist/core/util/langHint.js.map +1 -0
  492. package/dist/core/util/slugify.d.ts +2 -0
  493. package/dist/core/util/slugify.d.ts.map +1 -0
  494. package/dist/core/util/slugify.js +28 -0
  495. package/dist/core/util/slugify.js.map +1 -0
  496. package/dist/hooks/hookedToolProxy.mjs +118 -0
  497. package/dist/index.d.ts +2 -0
  498. package/dist/index.d.ts.map +1 -0
  499. package/dist/index.js +8 -0
  500. package/dist/index.js.map +1 -0
  501. package/dist/ipc/dispatcher.d.ts +21 -0
  502. package/dist/ipc/dispatcher.d.ts.map +1 -0
  503. package/dist/ipc/dispatcher.js +160 -0
  504. package/dist/ipc/dispatcher.js.map +1 -0
  505. package/dist/ipc/events.d.ts +33 -0
  506. package/dist/ipc/events.d.ts.map +1 -0
  507. package/dist/ipc/events.js +42 -0
  508. package/dist/ipc/events.js.map +1 -0
  509. package/dist/ipc/rpc.d.ts +31 -0
  510. package/dist/ipc/rpc.d.ts.map +1 -0
  511. package/dist/ipc/rpc.js +110 -0
  512. package/dist/ipc/rpc.js.map +1 -0
  513. package/dist/ipc/stdio.d.ts +11 -0
  514. package/dist/ipc/stdio.d.ts.map +1 -0
  515. package/dist/ipc/stdio.js +52 -0
  516. package/dist/ipc/stdio.js.map +1 -0
  517. package/dist/mcp/askClient.d.ts +9 -0
  518. package/dist/mcp/askClient.d.ts.map +1 -0
  519. package/dist/mcp/askClient.js +70 -0
  520. package/dist/mcp/askClient.js.map +1 -0
  521. package/dist/mcp/constants.d.ts +6 -0
  522. package/dist/mcp/constants.d.ts.map +1 -0
  523. package/dist/mcp/constants.js +8 -0
  524. package/dist/mcp/constants.js.map +1 -0
  525. package/dist/mcp/permissionClient.d.ts +5 -0
  526. package/dist/mcp/permissionClient.d.ts.map +1 -0
  527. package/dist/mcp/permissionClient.js +71 -0
  528. package/dist/mcp/permissionClient.js.map +1 -0
  529. package/dist/mcp/schemas.d.ts +9 -0
  530. package/dist/mcp/schemas.d.ts.map +1 -0
  531. package/dist/mcp/schemas.js +121 -0
  532. package/dist/mcp/schemas.js.map +1 -0
  533. package/dist/mcp/server.d.ts +41 -0
  534. package/dist/mcp/server.d.ts.map +1 -0
  535. package/dist/mcp/server.js +204 -0
  536. package/dist/mcp/server.js.map +1 -0
  537. package/dist/policy/loader.d.ts +27 -0
  538. package/dist/policy/loader.d.ts.map +1 -0
  539. package/dist/policy/loader.js +89 -0
  540. package/dist/policy/loader.js.map +1 -0
  541. package/dist/policy/team-claude-only.yaml +46 -0
  542. package/dist/policy/team-codex-only.yaml +46 -0
  543. package/dist/policy/team-codex.yaml +54 -0
  544. package/dist/policy/team.yaml +104 -0
  545. package/dist/toolhook/hookedToolProxy.mjs +118 -0
  546. package/dist/ui/components/App.d.ts +14 -0
  547. package/dist/ui/components/App.d.ts.map +1 -0
  548. package/dist/ui/components/App.js +803 -0
  549. package/dist/ui/components/App.js.map +1 -0
  550. package/dist/ui/components/AskPicker.d.ts +8 -0
  551. package/dist/ui/components/AskPicker.d.ts.map +1 -0
  552. package/dist/ui/components/AskPicker.js +202 -0
  553. package/dist/ui/components/AskPicker.js.map +1 -0
  554. package/dist/ui/components/CommandInput.d.ts +63 -0
  555. package/dist/ui/components/CommandInput.d.ts.map +1 -0
  556. package/dist/ui/components/CommandInput.js +994 -0
  557. package/dist/ui/components/CommandInput.js.map +1 -0
  558. package/dist/ui/components/DiffView.d.ts +19 -0
  559. package/dist/ui/components/DiffView.d.ts.map +1 -0
  560. package/dist/ui/components/DiffView.js +93 -0
  561. package/dist/ui/components/DiffView.js.map +1 -0
  562. package/dist/ui/components/Dock.d.ts +49 -0
  563. package/dist/ui/components/Dock.d.ts.map +1 -0
  564. package/dist/ui/components/Dock.js +52 -0
  565. package/dist/ui/components/Dock.js.map +1 -0
  566. package/dist/ui/components/EventLog.d.ts +42 -0
  567. package/dist/ui/components/EventLog.d.ts.map +1 -0
  568. package/dist/ui/components/EventLog.js +450 -0
  569. package/dist/ui/components/EventLog.js.map +1 -0
  570. package/dist/ui/components/FileSuggest.d.ts +8 -0
  571. package/dist/ui/components/FileSuggest.d.ts.map +1 -0
  572. package/dist/ui/components/FileSuggest.js +19 -0
  573. package/dist/ui/components/FileSuggest.js.map +1 -0
  574. package/dist/ui/components/HRule.d.ts +27 -0
  575. package/dist/ui/components/HRule.d.ts.map +1 -0
  576. package/dist/ui/components/HRule.js +75 -0
  577. package/dist/ui/components/HRule.js.map +1 -0
  578. package/dist/ui/components/HintBar.d.ts +2 -0
  579. package/dist/ui/components/HintBar.d.ts.map +1 -0
  580. package/dist/ui/components/HintBar.js +19 -0
  581. package/dist/ui/components/HintBar.js.map +1 -0
  582. package/dist/ui/components/MarkdownText.d.ts +13 -0
  583. package/dist/ui/components/MarkdownText.d.ts.map +1 -0
  584. package/dist/ui/components/MarkdownText.js +255 -0
  585. package/dist/ui/components/MarkdownText.js.map +1 -0
  586. package/dist/ui/components/PermissionPrompt.d.ts +8 -0
  587. package/dist/ui/components/PermissionPrompt.d.ts.map +1 -0
  588. package/dist/ui/components/PermissionPrompt.js +37 -0
  589. package/dist/ui/components/PermissionPrompt.js.map +1 -0
  590. package/dist/ui/components/SessionPicker.d.ts +16 -0
  591. package/dist/ui/components/SessionPicker.d.ts.map +1 -0
  592. package/dist/ui/components/SessionPicker.js +116 -0
  593. package/dist/ui/components/SessionPicker.js.map +1 -0
  594. package/dist/ui/components/SlashPalette.d.ts +8 -0
  595. package/dist/ui/components/SlashPalette.d.ts.map +1 -0
  596. package/dist/ui/components/SlashPalette.js +41 -0
  597. package/dist/ui/components/SlashPalette.js.map +1 -0
  598. package/dist/ui/components/Spinner.d.ts +37 -0
  599. package/dist/ui/components/Spinner.d.ts.map +1 -0
  600. package/dist/ui/components/Spinner.js +139 -0
  601. package/dist/ui/components/Spinner.js.map +1 -0
  602. package/dist/ui/components/StatusBar.d.ts +92 -0
  603. package/dist/ui/components/StatusBar.d.ts.map +1 -0
  604. package/dist/ui/components/StatusBar.js +268 -0
  605. package/dist/ui/components/StatusBar.js.map +1 -0
  606. package/dist/ui/components/TabChip.d.ts +11 -0
  607. package/dist/ui/components/TabChip.d.ts.map +1 -0
  608. package/dist/ui/components/TabChip.js +23 -0
  609. package/dist/ui/components/TabChip.js.map +1 -0
  610. package/dist/ui/components/TeamIndicator.d.ts +6 -0
  611. package/dist/ui/components/TeamIndicator.d.ts.map +1 -0
  612. package/dist/ui/components/TeamIndicator.js +17 -0
  613. package/dist/ui/components/TeamIndicator.js.map +1 -0
  614. package/dist/ui/components/TeamStatusPanel.d.ts +14 -0
  615. package/dist/ui/components/TeamStatusPanel.d.ts.map +1 -0
  616. package/dist/ui/components/TeamStatusPanel.js +65 -0
  617. package/dist/ui/components/TeamStatusPanel.js.map +1 -0
  618. package/dist/ui/components/ThinkingBlock.d.ts +10 -0
  619. package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
  620. package/dist/ui/components/ThinkingBlock.js +21 -0
  621. package/dist/ui/components/ThinkingBlock.js.map +1 -0
  622. package/dist/ui/components/TodoIndicator.d.ts +11 -0
  623. package/dist/ui/components/TodoIndicator.d.ts.map +1 -0
  624. package/dist/ui/components/TodoIndicator.js +37 -0
  625. package/dist/ui/components/TodoIndicator.js.map +1 -0
  626. package/dist/ui/components/ToolCallCard.d.ts +16 -0
  627. package/dist/ui/components/ToolCallCard.d.ts.map +1 -0
  628. package/dist/ui/components/ToolCallCard.js +195 -0
  629. package/dist/ui/components/ToolCallCard.js.map +1 -0
  630. package/dist/ui/components/Welcome.d.ts +8 -0
  631. package/dist/ui/components/Welcome.d.ts.map +1 -0
  632. package/dist/ui/components/Welcome.js +53 -0
  633. package/dist/ui/components/Welcome.js.map +1 -0
  634. package/dist/ui/cursorState.d.ts +29 -0
  635. package/dist/ui/cursorState.d.ts.map +1 -0
  636. package/dist/ui/cursorState.js +49 -0
  637. package/dist/ui/cursorState.js.map +1 -0
  638. package/dist/ui/diff.d.ts +34 -0
  639. package/dist/ui/diff.d.ts.map +1 -0
  640. package/dist/ui/diff.js +184 -0
  641. package/dist/ui/diff.js.map +1 -0
  642. package/dist/ui/diffLang.d.ts +2 -0
  643. package/dist/ui/diffLang.d.ts.map +1 -0
  644. package/dist/ui/diffLang.js +36 -0
  645. package/dist/ui/diffLang.js.map +1 -0
  646. package/dist/ui/emoji.d.ts +4 -0
  647. package/dist/ui/emoji.d.ts.map +1 -0
  648. package/dist/ui/emoji.js +73 -0
  649. package/dist/ui/emoji.js.map +1 -0
  650. package/dist/ui/fileMentions.d.ts +41 -0
  651. package/dist/ui/fileMentions.d.ts.map +1 -0
  652. package/dist/ui/fileMentions.js +135 -0
  653. package/dist/ui/fileMentions.js.map +1 -0
  654. package/dist/ui/hooks/useLineEditor.d.ts +44 -0
  655. package/dist/ui/hooks/useLineEditor.d.ts.map +1 -0
  656. package/dist/ui/hooks/useLineEditor.js +142 -0
  657. package/dist/ui/hooks/useLineEditor.js.map +1 -0
  658. package/dist/ui/inputHistory.d.ts +8 -0
  659. package/dist/ui/inputHistory.d.ts.map +1 -0
  660. package/dist/ui/inputHistory.js +56 -0
  661. package/dist/ui/inputHistory.js.map +1 -0
  662. package/dist/ui/jsonrpc.d.ts +17 -0
  663. package/dist/ui/jsonrpc.d.ts.map +1 -0
  664. package/dist/ui/jsonrpc.js +41 -0
  665. package/dist/ui/jsonrpc.js.map +1 -0
  666. package/dist/ui/launcher.d.ts +20 -0
  667. package/dist/ui/launcher.d.ts.map +1 -0
  668. package/dist/ui/launcher.js +185 -0
  669. package/dist/ui/launcher.js.map +1 -0
  670. package/dist/ui/markdown.d.ts +104 -0
  671. package/dist/ui/markdown.d.ts.map +1 -0
  672. package/dist/ui/markdown.js +449 -0
  673. package/dist/ui/markdown.js.map +1 -0
  674. package/dist/ui/mouse.d.ts +22 -0
  675. package/dist/ui/mouse.d.ts.map +1 -0
  676. package/dist/ui/mouse.js +31 -0
  677. package/dist/ui/mouse.js.map +1 -0
  678. package/dist/ui/outbound.d.ts +20 -0
  679. package/dist/ui/outbound.d.ts.map +1 -0
  680. package/dist/ui/outbound.js +49 -0
  681. package/dist/ui/outbound.js.map +1 -0
  682. package/dist/ui/screenMode.d.ts +25 -0
  683. package/dist/ui/screenMode.d.ts.map +1 -0
  684. package/dist/ui/screenMode.js +43 -0
  685. package/dist/ui/screenMode.js.map +1 -0
  686. package/dist/ui/slashCatalog.d.ts +18 -0
  687. package/dist/ui/slashCatalog.d.ts.map +1 -0
  688. package/dist/ui/slashCatalog.js +243 -0
  689. package/dist/ui/slashCatalog.js.map +1 -0
  690. package/dist/ui/syntax.d.ts +11 -0
  691. package/dist/ui/syntax.d.ts.map +1 -0
  692. package/dist/ui/syntax.js +78 -0
  693. package/dist/ui/syntax.js.map +1 -0
  694. package/dist/ui/theme.d.ts +165 -0
  695. package/dist/ui/theme.d.ts.map +1 -0
  696. package/dist/ui/theme.js +394 -0
  697. package/dist/ui/theme.js.map +1 -0
  698. package/dist/ui/types.d.ts +203 -0
  699. package/dist/ui/types.d.ts.map +1 -0
  700. package/dist/ui/types.js +53 -0
  701. package/dist/ui/types.js.map +1 -0
  702. package/package.json +104 -0
@@ -0,0 +1,34 @@
1
+ export type DiffLineKind = "add" | "del" | "ctx" | "hunk" | "fold";
2
+ export interface DiffLine {
3
+ kind: DiffLineKind;
4
+ text: string;
5
+ /** Phase 95: 1-based line number in the OLD file. Set on `del` and
6
+ * `ctx`; absent on `add` and `hunk`. */
7
+ oldLine?: number;
8
+ /** 1-based line number in the NEW file. Set on `add` and `ctx`;
9
+ * absent on `del` and `hunk`. */
10
+ newLine?: number;
11
+ /** Phase 124: on a `fold` row, how many unchanged lines were elided. */
12
+ count?: number;
13
+ }
14
+ /** Phase 124: collapse long runs of unchanged context so a large diff
15
+ * reads change-first (git-style). A maximal `ctx` run keeps `keep`
16
+ * lines adjacent to each neighbouring change and replaces the middle
17
+ * with a single `fold` row. Runs at the very start / end only keep the
18
+ * side that borders a change. Non-ctx rows pass through untouched. */
19
+ export declare function foldUnchanged(lines: readonly DiffLine[], keep?: number): DiffLine[];
20
+ /** LCS-based line diff. Output preserves source order, with deletes
21
+ * appearing where they were and inserts where they land in the new
22
+ * text. Equal-cost choices favor the deletion first so a block
23
+ * rename reads top-down (old block, new block) instead of
24
+ * interleaved. */
25
+ export declare function lineDiff(oldText: string, newText: string): DiffLine[];
26
+ /** Parse unified-diff text into DiffLines. File headers (`+++`,
27
+ * `---`) and `` markers drop out; hunk
28
+ * headers (`@@ ... @@`) become their own row so the renderer can
29
+ * highlight them. */
30
+ export declare function parseUnifiedDiff(text: string): DiffLine[];
31
+ /** Heuristic: does this look like unified diff content? Cheap test
32
+ * for ToolCallCard's auto-detection on tool outputs. */
33
+ export declare function looksLikeUnifiedDiff(text: string): boolean;
34
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/ui/diff.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;6CACyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;sCACkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;uEAIuE;AACvE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,IAAI,SAAI,GACP,QAAQ,EAAE,CA8BZ;AAED;;;;mBAImB;AACnB,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAqDrE;AAED;;;sBAGsB;AACtB,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAmDzD;AAED;yDACyD;AACzD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAY1D"}
@@ -0,0 +1,184 @@
1
+ // Phase 24: diff helpers.
2
+ //
3
+ // Two producers feed into the renderer:
4
+ //
5
+ // 1. lineDiff(old, new) — for Edit-style tool inputs that carry
6
+ // both an old_string and a new_string. LCS-based; small inputs
7
+ // only (the Edit tool's old/new are typically tens of lines).
8
+ //
9
+ // 2. parseUnifiedDiff(text) — for ```diff``` fences or tool
10
+ // outputs that already speak unified diff format.
11
+ //
12
+ // Both produce the same DiffLine list so DiffView is one component.
13
+ /** Phase 124: collapse long runs of unchanged context so a large diff
14
+ * reads change-first (git-style). A maximal `ctx` run keeps `keep`
15
+ * lines adjacent to each neighbouring change and replaces the middle
16
+ * with a single `fold` row. Runs at the very start / end only keep the
17
+ * side that borders a change. Non-ctx rows pass through untouched. */
18
+ export function foldUnchanged(lines, keep = 3) {
19
+ const out = [];
20
+ const n = lines.length;
21
+ let i = 0;
22
+ while (i < n) {
23
+ if (lines[i].kind !== "ctx") {
24
+ out.push(lines[i]);
25
+ i++;
26
+ continue;
27
+ }
28
+ let j = i;
29
+ while (j < n && lines[j].kind === "ctx")
30
+ j++;
31
+ const run = lines.slice(i, j);
32
+ const headKeep = i === 0 ? 0 : keep;
33
+ const tailKeep = j === n ? 0 : keep;
34
+ if (run.length > headKeep + tailKeep + 1) {
35
+ for (let k = 0; k < headKeep; k++)
36
+ out.push(run[k]);
37
+ const folded = run.length - headKeep - tailKeep;
38
+ out.push({
39
+ kind: "fold",
40
+ text: `${folded} unchanged line${folded === 1 ? "" : "s"}`,
41
+ count: folded,
42
+ });
43
+ for (let k = run.length - tailKeep; k < run.length; k++)
44
+ out.push(run[k]);
45
+ }
46
+ else {
47
+ out.push(...run);
48
+ }
49
+ i = j;
50
+ }
51
+ return out;
52
+ }
53
+ /** LCS-based line diff. Output preserves source order, with deletes
54
+ * appearing where they were and inserts where they land in the new
55
+ * text. Equal-cost choices favor the deletion first so a block
56
+ * rename reads top-down (old block, new block) instead of
57
+ * interleaved. */
58
+ export function lineDiff(oldText, newText) {
59
+ const a = oldText.split("\n");
60
+ const b = newText.split("\n");
61
+ // Trim a shared trailing empty line if both strings ended in \n —
62
+ // otherwise we get a phantom equal blank line at the bottom.
63
+ if (a.length > 0 &&
64
+ b.length > 0 &&
65
+ a[a.length - 1] === "" &&
66
+ b[b.length - 1] === "") {
67
+ a.pop();
68
+ b.pop();
69
+ }
70
+ const n = a.length;
71
+ const m = b.length;
72
+ // dp[i][j] = LCS length of a[i:] vs b[j:]
73
+ const dp = Array.from({ length: n + 1 }, () => new Array(m + 1).fill(0));
74
+ for (let i = n - 1; i >= 0; i--) {
75
+ for (let j = m - 1; j >= 0; j--) {
76
+ dp[i][j] =
77
+ a[i] === b[j]
78
+ ? dp[i + 1][j + 1] + 1
79
+ : Math.max(dp[i + 1][j], dp[i][j + 1]);
80
+ }
81
+ }
82
+ const out = [];
83
+ let i = 0;
84
+ let j = 0;
85
+ while (i < n && j < m) {
86
+ if (a[i] === b[j]) {
87
+ out.push({ kind: "ctx", text: a[i], oldLine: i + 1, newLine: j + 1 });
88
+ i++;
89
+ j++;
90
+ }
91
+ else if (dp[i + 1][j] >= dp[i][j + 1]) {
92
+ out.push({ kind: "del", text: a[i], oldLine: i + 1 });
93
+ i++;
94
+ }
95
+ else {
96
+ out.push({ kind: "add", text: b[j], newLine: j + 1 });
97
+ j++;
98
+ }
99
+ }
100
+ while (i < n) {
101
+ out.push({ kind: "del", text: a[i], oldLine: i + 1 });
102
+ i++;
103
+ }
104
+ while (j < m) {
105
+ out.push({ kind: "add", text: b[j], newLine: j + 1 });
106
+ j++;
107
+ }
108
+ return out;
109
+ }
110
+ /** Parse unified-diff text into DiffLines. File headers (`+++`,
111
+ * `---`) and `` markers drop out; hunk
112
+ * headers (`@@ ... @@`) become their own row so the renderer can
113
+ * highlight them. */
114
+ export function parseUnifiedDiff(text) {
115
+ const lines = text.split("\n");
116
+ const out = [];
117
+ // Phase 95: track running line numbers parsed from hunk headers
118
+ // (e.g. "@@ -120,5 +118,7 @@") so DiffView can render the gutter.
119
+ let oldLine = 0;
120
+ let newLine = 0;
121
+ const HUNK_RE = /^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/;
122
+ for (const line of lines) {
123
+ if (line.startsWith("+++") ||
124
+ line.startsWith("---") ||
125
+ line.startsWith("diff --git")) {
126
+ continue;
127
+ }
128
+ if (line.startsWith("\\ "))
129
+ continue; // ""
130
+ if (line.startsWith("@@")) {
131
+ const m = HUNK_RE.exec(line);
132
+ if (m) {
133
+ oldLine = parseInt(m[1], 10);
134
+ newLine = parseInt(m[2], 10);
135
+ }
136
+ out.push({ kind: "hunk", text: line });
137
+ continue;
138
+ }
139
+ if (line.startsWith("+")) {
140
+ out.push({ kind: "add", text: line.slice(1), newLine });
141
+ newLine++;
142
+ continue;
143
+ }
144
+ if (line.startsWith("-")) {
145
+ out.push({ kind: "del", text: line.slice(1), oldLine });
146
+ oldLine++;
147
+ continue;
148
+ }
149
+ if (line.startsWith(" ")) {
150
+ out.push({ kind: "ctx", text: line.slice(1), oldLine, newLine });
151
+ oldLine++;
152
+ newLine++;
153
+ continue;
154
+ }
155
+ // Empty line in the middle of a hunk → context with nothing.
156
+ if (line === "") {
157
+ out.push({ kind: "ctx", text: "", oldLine, newLine });
158
+ oldLine++;
159
+ newLine++;
160
+ }
161
+ // Anything else (free-form preamble lines) — drop silently.
162
+ }
163
+ return out;
164
+ }
165
+ /** Heuristic: does this look like unified diff content? Cheap test
166
+ * for ToolCallCard's auto-detection on tool outputs. */
167
+ export function looksLikeUnifiedDiff(text) {
168
+ if (!text.includes("\n"))
169
+ return false;
170
+ const lines = text.split("\n");
171
+ let plusses = 0;
172
+ let minuses = 0;
173
+ let hunks = 0;
174
+ for (const line of lines) {
175
+ if (line.startsWith("@@"))
176
+ hunks++;
177
+ else if (line.startsWith("+") && !line.startsWith("+++"))
178
+ plusses++;
179
+ else if (line.startsWith("-") && !line.startsWith("---"))
180
+ minuses++;
181
+ }
182
+ return hunks > 0 || (plusses > 0 && minuses > 0);
183
+ }
184
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/ui/diff.ts"],"names":[],"mappings":"AAAA,0BAA0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IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;aAC/D,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function langFromDiffHeader(diff: string): string | undefined;
2
+ //# sourceMappingURL=diffLang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diffLang.d.ts","sourceRoot":"","sources":["../../src/ui/diffLang.ts"],"names":[],"mappings":"AAMA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBnE"}
@@ -0,0 +1,36 @@
1
+ // Phase 206: derive a syntax-highlighting language hint from a
2
+ // unified-diff body. Unified diffs typically carry `--- a/<path>` and
3
+ // `+++ b/<path>` header lines; the file extension on those is enough
4
+ // to resolve a syntax via `highlight()` later. Falls back to undefined
5
+ // when neither header is present.
6
+ export function langFromDiffHeader(diff) {
7
+ // Scan only the first 40 lines — headers always appear at the top.
8
+ const lines = diff.split("\n", 40);
9
+ for (const raw of lines) {
10
+ let m = /^(?:---|\+\+\+)\s+(?:a\/|b\/)?(.+?)(?:\t|$)/.exec(raw);
11
+ if (m) {
12
+ const path = m[1].trim();
13
+ if (path && path !== "/dev/null") {
14
+ const lang = langFromPath(path);
15
+ if (lang)
16
+ return lang;
17
+ }
18
+ }
19
+ // git diff "diff --git a/foo b/foo" line also carries paths.
20
+ m = /^diff --git\s+a\/(\S+)\s+b\/\S+/.exec(raw);
21
+ if (m) {
22
+ const lang = langFromPath(m[1]);
23
+ if (lang)
24
+ return lang;
25
+ }
26
+ }
27
+ return undefined;
28
+ }
29
+ function langFromPath(path) {
30
+ const base = path.split("/").pop() ?? "";
31
+ const dot = base.lastIndexOf(".");
32
+ if (dot <= 0 || dot === base.length - 1)
33
+ return undefined;
34
+ return base.slice(dot + 1).toLowerCase();
35
+ }
36
+ //# sourceMappingURL=diffLang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diffLang.js","sourceRoot":"","sources":["../../src/ui/diffLang.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,sEAAsE;AACtE,qEAAqE;AACrE,uEAAuE;AACvE,kCAAkC;AAElC,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,mEAAmE;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACnC,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,6CAA6C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChE,IAAI,CAAC,EAAE,CAAC;YACN,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACzB,IAAI,IAAI,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;gBACjC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,IAAI;oBAAE,OAAO,IAAI,CAAC;YACxB,CAAC;QACH,CAAC;QACD,6DAA6D;QAC7D,CAAC,GAAG,iCAAiC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,EAAE,CAAC;YACN,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Resolve a shortcode name (without the surrounding colons) to its
2
+ * emoji, or null when unknown. */
3
+ export declare function shortcodeToEmoji(name: string): string | null;
4
+ //# sourceMappingURL=emoji.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji.d.ts","sourceRoot":"","sources":["../../src/ui/emoji.ts"],"names":[],"mappings":"AAqEA;mCACmC;AACnC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE5D"}
@@ -0,0 +1,73 @@
1
+ // Phase 133: GitHub-style :shortcode: → emoji substitution.
2
+ //
3
+ // A curated map of the shortcodes that actually show up in dev / GitHub
4
+ // prose. We don't ship the full ~1800-entry gemoji set — this covers the
5
+ // common cases and anything unknown is left as literal text (so a stray
6
+ // `:foo:` reads as written rather than vanishing).
7
+ const EMOJI = {
8
+ // status / checks
9
+ white_check_mark: "✅",
10
+ heavy_check_mark: "✔️",
11
+ check: "✔️",
12
+ x: "❌",
13
+ warning: "⚠️",
14
+ rotating_light: "🚨",
15
+ no_entry: "⛔",
16
+ white_circle: "⚪",
17
+ red_circle: "🔴",
18
+ large_blue_circle: "🔵",
19
+ green_circle: "🟢",
20
+ yellow_circle: "🟡",
21
+ // work / build
22
+ rocket: "🚀",
23
+ hammer: "🔨",
24
+ wrench: "🔧",
25
+ package: "📦",
26
+ gear: "⚙️",
27
+ recycle: "♻️",
28
+ construction: "🚧",
29
+ zap: "⚡",
30
+ fire: "🔥",
31
+ sparkles: "✨",
32
+ boom: "💥",
33
+ bug: "🐛",
34
+ lock: "🔒",
35
+ key: "🔑",
36
+ hourglass: "⏳",
37
+ stopwatch: "⏱️",
38
+ // data / docs
39
+ chart_with_upwards_trend: "📈",
40
+ chart_with_downwards_trend: "📉",
41
+ bar_chart: "📊",
42
+ books: "📚",
43
+ book: "📖",
44
+ memo: "📝",
45
+ pushpin: "📌",
46
+ bulb: "💡",
47
+ mag: "🔍",
48
+ clipboard: "📋",
49
+ // sentiment / reactions
50
+ tada: "🎉",
51
+ thumbsup: "👍",
52
+ "+1": "👍",
53
+ thumbsdown: "👎",
54
+ "-1": "👎",
55
+ eyes: "👀",
56
+ rocket_ship: "🚀",
57
+ ok_hand: "👌",
58
+ pray: "🙏",
59
+ heart: "❤️",
60
+ star: "⭐",
61
+ // arrows / pointers
62
+ point_right: "👉",
63
+ point_left: "👈",
64
+ arrow_right: "➡️",
65
+ arrow_left: "⬅️",
66
+ white_check: "✅",
67
+ };
68
+ /** Resolve a shortcode name (without the surrounding colons) to its
69
+ * emoji, or null when unknown. */
70
+ export function shortcodeToEmoji(name) {
71
+ return EMOJI[name] ?? null;
72
+ }
73
+ //# sourceMappingURL=emoji.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji.js","sourceRoot":"","sources":["../../src/ui/emoji.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,mDAAmD;AAEnD,MAAM,KAAK,GAA2B;IACpC,kBAAkB;IAClB,gBAAgB,EAAE,GAAG;IACrB,gBAAgB,EAAE,IAAI;IACtB,KAAK,EAAE,IAAI;IACX,CAAC,EAAE,GAAG;IACN,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,GAAG;IACb,YAAY,EAAE,GAAG;IACjB,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;IACvB,YAAY,EAAE,IAAI;IAClB,aAAa,EAA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+ loaded: string[];
4
+ failed: string[];
5
+ }
6
+ export interface ImageMentionResult {
7
+ /** Input with the image `@tokens` removed (spacing preserved). */
8
+ text: string;
9
+ /** Absolute paths of image mentions that exist on disk. */
10
+ images: string[];
11
+ /** Raw tokens whose file wasn't found (for a UI warning). */
12
+ missing: string[];
13
+ }
14
+ /** Pull `@image.png`-style mentions out of `text`. Run BEFORE
15
+ * expandFileMentions so image paths don't get inlined as text. */
16
+ export declare function extractImageMentions(text: string, opts?: {
17
+ cwd?: string;
18
+ home?: string;
19
+ }): ImageMentionResult;
20
+ export declare function expandFileMentions(text: string, opts?: {
21
+ cwd?: string;
22
+ home?: string;
23
+ }): ExpansionResult;
24
+ export interface MentionContext {
25
+ /** Index of the `@` character in `buffer`. */
26
+ start: number;
27
+ /** Cursor position (end-exclusive). */
28
+ end: number;
29
+ /** Substring of the mention *after* the `@`, e.g. "src/cl". */
30
+ query: string;
31
+ }
32
+ export declare function activeMention(buffer: string, cursor: number): MentionContext | null;
33
+ export interface FileSuggestion {
34
+ /** Path relative to the scan root, with `/` suffix for dirs. */
35
+ display: string;
36
+ isDir: boolean;
37
+ }
38
+ export declare function scanDir(cwd: string, partial: string, opts?: {
39
+ max?: number;
40
+ }): FileSuggestion[];
41
+ //# sourceMappingURL=fileMentions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileMentions.d.ts","sourceRoot":"","sources":["../../src/ui/fileMentions.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AASD,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;mEACmE;AACnE,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACzC,kBAAkB,CAuBpB;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACzC,eAAe,CAgCjB;AAOD,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,IAAI,CAgBvB;AAOD,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAID,wBAAgB,OAAO,CACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1B,cAAc,EAAE,CAuClB"}
@@ -0,0 +1,135 @@
1
+ // Phase 21: expand @path tokens in user input into inlined file
2
+ // blocks. Conservative on what counts as a mention to avoid grabbing
3
+ // "@user" or "@here"-style strings.
4
+ import { readdirSync, readFileSync, statSync } from "node:fs";
5
+ import { homedir } from "node:os";
6
+ import { join, resolve } from "node:path";
7
+ const MAX_INLINE_CHARS = 32_000;
8
+ // Phase 340: an `@path` ending in an image extension is an IMAGE attachment,
9
+ // not a file to inline as text. extractImageMentions pulls those out (so
10
+ // expandFileMentions never binary-loads them) and returns absolute paths.
11
+ const IMAGE_EXT = /\.(png|jpe?g|gif|webp|bmp)$/i;
12
+ /** Pull `@image.png`-style mentions out of `text`. Run BEFORE
13
+ * expandFileMentions so image paths don't get inlined as text. */
14
+ export function extractImageMentions(text, opts = {}) {
15
+ const cwd = opts.cwd ?? process.cwd();
16
+ const home = opts.home ?? process.env.HOME ?? homedir();
17
+ const pattern = /(^|\s)@([^\s]+)/g;
18
+ const images = [];
19
+ const missing = [];
20
+ const out = text.replace(pattern, (match, lead, raw) => {
21
+ if (!raw || !IMAGE_EXT.test(raw))
22
+ return match; // leave non-image @ alone
23
+ const path = raw.startsWith("~/") && home ? join(home, raw.slice(2)) : raw;
24
+ const abs = resolve(cwd, path);
25
+ try {
26
+ if (statSync(abs).isFile()) {
27
+ images.push(abs);
28
+ return lead; // drop the token, keep its leading space/newline
29
+ }
30
+ }
31
+ catch {
32
+ /* fall through to missing */
33
+ }
34
+ missing.push(raw);
35
+ return lead; // drop regardless so it isn't binary-loaded downstream
36
+ });
37
+ return { text: out, images, missing };
38
+ }
39
+ export function expandFileMentions(text, opts = {}) {
40
+ const cwd = opts.cwd ?? process.cwd();
41
+ const home = opts.home ?? process.env.HOME ?? homedir();
42
+ const pattern = /(^|\s)@([^\s]+)/g;
43
+ const loaded = [];
44
+ const failed = [];
45
+ const expanded = text.replace(pattern, (_match, lead, raw) => {
46
+ if (!raw)
47
+ return `${lead}@${raw}`;
48
+ const path = raw.startsWith("~/") && home ? join(home, raw.slice(2)) : raw;
49
+ const abs = resolve(cwd, path);
50
+ try {
51
+ const st = statSync(abs);
52
+ if (!st.isFile()) {
53
+ failed.push(`${raw} (not a file)`);
54
+ return `${lead}@${raw}`;
55
+ }
56
+ let body = readFileSync(abs, "utf-8");
57
+ if (body.length > MAX_INLINE_CHARS) {
58
+ body = body.slice(0, MAX_INLINE_CHARS) + "\n... (truncated)";
59
+ }
60
+ loaded.push(raw);
61
+ return `${lead}\n\`\`\`${raw}\n${body}\n\`\`\`\n`;
62
+ }
63
+ catch (e) {
64
+ failed.push(`${raw} (${e.message})`);
65
+ return `${lead}@${raw}`;
66
+ }
67
+ });
68
+ return { expanded, loaded, failed };
69
+ }
70
+ export function activeMention(buffer, cursor) {
71
+ if (cursor <= 0 || cursor > buffer.length)
72
+ return null;
73
+ let i = cursor;
74
+ while (i > 0) {
75
+ const ch = buffer[i - 1];
76
+ if (ch === "@") {
77
+ const before = i >= 2 ? buffer[i - 2] : "";
78
+ if (i === 1 || /\s/.test(before)) {
79
+ return { start: i - 1, end: cursor, query: buffer.slice(i, cursor) };
80
+ }
81
+ return null;
82
+ }
83
+ if (/\s/.test(ch))
84
+ return null;
85
+ i -= 1;
86
+ }
87
+ return null;
88
+ }
89
+ const SCAN_CAP_PER_DIR = 200;
90
+ export function scanDir(cwd, partial, opts = {}) {
91
+ const max = opts.max ?? 8;
92
+ // Split the partial into "directory portion" + "name prefix". For
93
+ // `src/cl` the directory is `src/` and the name prefix is `cl`.
94
+ const slashIdx = partial.lastIndexOf("/");
95
+ const dirPart = slashIdx === -1 ? "" : partial.slice(0, slashIdx + 1);
96
+ const namePart = slashIdx === -1 ? partial : partial.slice(slashIdx + 1);
97
+ const scanRoot = dirPart ? resolve(cwd, dirPart) : resolve(cwd);
98
+ let entries;
99
+ try {
100
+ entries = readdirSync(scanRoot);
101
+ }
102
+ catch {
103
+ return [];
104
+ }
105
+ if (entries.length > SCAN_CAP_PER_DIR) {
106
+ entries = entries.slice(0, SCAN_CAP_PER_DIR);
107
+ }
108
+ const showHidden = namePart.startsWith(".");
109
+ const lower = namePart.toLowerCase();
110
+ const matches = [];
111
+ for (const name of entries) {
112
+ if (!showHidden && name.startsWith("."))
113
+ continue;
114
+ if (!name.toLowerCase().startsWith(lower))
115
+ continue;
116
+ let isDir;
117
+ try {
118
+ isDir = statSync(join(scanRoot, name)).isDirectory();
119
+ }
120
+ catch {
121
+ continue;
122
+ }
123
+ matches.push({
124
+ display: dirPart + name + (isDir ? "/" : ""),
125
+ isDir,
126
+ });
127
+ }
128
+ matches.sort((a, b) => {
129
+ if (a.isDir !== b.isDir)
130
+ return a.isDir ? -1 : 1;
131
+ return a.display.toLowerCase().localeCompare(b.display.toLowerCase());
132
+ });
133
+ return matches.slice(0, max);
134
+ }
135
+ //# sourceMappingURL=fileMentions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileMentions.js","sourceRoot":"","sources":["../../src/ui/fileMentions.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,qEAAqE;AACrE,oCAAoC;AAEpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQ1C,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,6EAA6E;AAC7E,yEAAyE;AACzE,0EAA0E;AAC1E,MAAM,SAAS,GAAG,8BAA8B,CAAC;AAWjD;mEACmE;AACnE,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,OAAwC,EAAE;IAE1C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;IACxD,MAAM,OAAO,GAAG,kBAAkB,CAAC;IACnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,GAAW,EAAE,EAAE;QACrE,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,0BAA0B;QAC1E,MAAM,IAAI,GACR,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,C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AAE,CAAC,EAAE,EAAE;QACpB,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;YAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,44 @@
1
+ export interface LineEditorApi {
2
+ /** Current text. Updates via React state so consumers re-render. */
3
+ readonly buffer: string;
4
+ /** Cursor index in [0, buffer.length]. */
5
+ readonly cursor: number;
6
+ /** Replace buffer and place the cursor; cursor is clamped. */
7
+ setBuffer(next: string, cursor: number): void;
8
+ /** Move the cursor without touching the buffer. Clamped to [0, len]. */
9
+ setCursor(next: number): void;
10
+ /** Insert text at the cursor. Coalesces consecutive non-whitespace
11
+ * typing into one undo snapshot (Phase 126). Returns the new
12
+ * buffer so callers can keep dependent state in sync (e.g.
13
+ * history draft) without waiting for React's next render. */
14
+ insert(text: string): string;
15
+ /** Delete chars in [from, to). Always records an undo boundary. */
16
+ deleteRange(from: number, to: number): void;
17
+ /** Pop one undo snapshot. Returns the restored buffer, or null
18
+ * when the stack is empty. */
19
+ undo(): string | null;
20
+ /** Pop one redo snapshot. Returns the restored buffer, or null
21
+ * when the stack is empty. */
22
+ redo(): string | null;
23
+ /** Clear buffer/cursor and reset undo, redo, and the paste store.
24
+ * Called by CommandInput's submit() to start a fresh timeline. */
25
+ reset(): void;
26
+ /** Stash a large paste and return the chip token to splice into
27
+ * the buffer. The token is rendered as a `[paste#N: M lines]`
28
+ * chip and expanded back at submit (Phase 135). */
29
+ storePaste(text: string, lineCount: number): string;
30
+ /** Replace every paste-chip token in `s` with its original text. */
31
+ expandPastes(s: string): string;
32
+ /** Phase 340: stash an image file path and return a `[image#N]` chip
33
+ * token to splice into the buffer (mirrors storePaste). */
34
+ storeImage(absPath: string): string;
35
+ /** Phase 340: remove every image-chip token from `s` and return the
36
+ * cleaned text plus the image paths (in first-seen order) so the
37
+ * prompt the model gets carries no `[image#N]` literal. */
38
+ expandImages(s: string): {
39
+ text: string;
40
+ images: string[];
41
+ };
42
+ }
43
+ export declare function useLineEditor(): LineEditorApi;
44
+ //# sourceMappingURL=useLineEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLineEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useLineEditor.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,wEAAwE;IACxE,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;kEAG8D;IAC9D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mEAAmE;IACnE,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C;mCAC+B;IAC/B,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC;IACtB;mCAC+B;IAC/B,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC;IACtB;uEACmE;IACnE,KAAK,IAAI,IAAI,CAAC;IACd;;wDAEoD;IACpD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpD,oEAAoE;IACpE,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;gEAC4D;IAC5D,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;gEAE4D;IAC5D,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC7D;AAED,wBAAgB,aAAa,IAAI,aAAa,CAoI7C"}