@iowarp/clio-coder 0.3.1 → 0.3.2

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 (595) hide show
  1. package/CHANGELOG.md +90 -2
  2. package/CONTRIBUTING.md +23 -23
  3. package/README.md +284 -613
  4. package/dist/{acp-FPR54DGL.js → acp-BIYHVZIM.js} +43 -53
  5. package/dist/{agents-OGPIHPJH.js → agents-YT6SSRIT.js} +43 -26
  6. package/dist/assets/codewiki.json +1 -1
  7. package/dist/{auth-IC3K6NIZ.js → auth-5TWEIYDN.js} +20 -12
  8. package/dist/{chunk-PV4JUBVJ.js → chunk-2EHAIA3X.js} +40 -21
  9. package/dist/{chunk-IS3ONKU3.js → chunk-2IR2NMPA.js} +6 -4
  10. package/dist/chunk-2SFS6XQE.js +122 -0
  11. package/dist/chunk-2VTFPG5O.js +48 -0
  12. package/dist/{chunk-MAR7Y6HW.js → chunk-3ZXDFGR5.js} +23 -16
  13. package/dist/chunk-4BJ5BYCE.js +61 -0
  14. package/dist/{chunk-474KN5II.js → chunk-4BPJXDWC.js} +111 -181
  15. package/dist/chunk-4KLWL3UC.js +18 -0
  16. package/dist/chunk-4VP4KH3K.js +962 -0
  17. package/dist/chunk-4ZG3XFUR.js +77 -0
  18. package/dist/chunk-5B2AEOW5.js +5407 -0
  19. package/dist/{chunk-K2ITRMHZ.js → chunk-5TSRNF4G.js} +6 -138
  20. package/dist/{chunk-OLBBMFRD.js → chunk-5UUP6MWO.js} +24 -62
  21. package/dist/chunk-65DEGPJ6.js +52 -0
  22. package/dist/chunk-6EJMN2Y3.js +17 -0
  23. package/dist/chunk-6EJV5X2W.js +16405 -0
  24. package/dist/chunk-6N5PTWMY.js +136 -0
  25. package/dist/chunk-6XLNIQDB.js +27 -0
  26. package/dist/{chunk-TEKV33Q5.js → chunk-77VKQEHF.js} +65 -33
  27. package/dist/chunk-7CR24IG7.js +242 -0
  28. package/dist/{chunk-M5T5VO65.js → chunk-7EYHLWU7.js} +837 -635
  29. package/dist/chunk-7MNJORFF.js +22 -0
  30. package/dist/{chunk-KY56HMHH.js → chunk-A3CYT5EX.js} +125 -31
  31. package/dist/chunk-AGYYIBLL.js +1069 -0
  32. package/dist/chunk-AO4RKG4M.js +277 -0
  33. package/dist/{chunk-GB6QRBXN.js → chunk-APJ265NV.js} +54 -1187
  34. package/dist/chunk-ARBGF5F7.js +174 -0
  35. package/dist/{chunk-673JJUWJ.js → chunk-BMEMKKIT.js} +2 -2
  36. package/dist/chunk-CBCAPZAA.js +229 -0
  37. package/dist/chunk-CMZWFGD2.js +352 -0
  38. package/dist/chunk-ECH6PKUQ.js +39 -0
  39. package/dist/chunk-ED4KHGC3.js +143 -0
  40. package/dist/chunk-EKMEHE4H.js +340 -0
  41. package/dist/{chunk-RPTR2H26.js → chunk-EPVUXGXG.js} +21 -15
  42. package/dist/chunk-FCSXB6T2.js +338 -0
  43. package/dist/chunk-FJ3H4MN5.js +48 -0
  44. package/dist/chunk-FQ4SKYE4.js +29 -0
  45. package/dist/chunk-G2DE3C7R.js +644 -0
  46. package/dist/chunk-G4BMMOKF.js +182 -0
  47. package/dist/{chunk-ZPY3JZ5E.js → chunk-GGXXDWE4.js} +183 -1233
  48. package/dist/chunk-HC4CLZ2Y.js +68 -0
  49. package/dist/{chunk-LU4TK2PR.js → chunk-HFSBBKSQ.js} +5 -56
  50. package/dist/{chunk-PIUMUEMV.js → chunk-HKIYEGME.js} +10 -6
  51. package/dist/chunk-I4HZDVNP.js +73 -0
  52. package/dist/{chunk-4QKXUHSR.js → chunk-IGLFWIYI.js} +70 -20
  53. package/dist/chunk-IKCO5N3L.js +162 -0
  54. package/dist/chunk-IR4CFBFN.js +56 -0
  55. package/dist/{chunk-PFEFKVGL.js → chunk-J5HN4RYU.js} +13 -11
  56. package/dist/{chunk-R5KLMSBV.js → chunk-J5Q24KAG.js} +2 -2
  57. package/dist/{chunk-K5XEMXTI.js → chunk-JVCV3ICN.js} +1 -1
  58. package/dist/chunk-KJ5LWLOE.js +1077 -0
  59. package/dist/chunk-LBMZMYH2.js +285 -0
  60. package/dist/{chunk-G34LV2PF.js → chunk-LBNRH5WM.js} +84 -170
  61. package/dist/{chunk-H6F6BYOH.js → chunk-LZSJBIVT.js} +7003 -7434
  62. package/dist/{chunk-HQQID6OA.js → chunk-M6SHUN7Q.js} +5 -5
  63. package/dist/chunk-MAW544W2.js +1882 -0
  64. package/dist/chunk-MBS4V7ZP.js +217 -0
  65. package/dist/{chunk-FST4FYJB.js → chunk-MFFY33HR.js} +99 -140
  66. package/dist/chunk-MNA4JGU4.js +255 -0
  67. package/dist/chunk-MQSRRFWA.js +3428 -0
  68. package/dist/{chunk-BSU2YIWB.js → chunk-MVVUPGPW.js} +131 -136
  69. package/dist/chunk-OAO4GE4M.js +619 -0
  70. package/dist/chunk-OHHN2SO4.js +5135 -0
  71. package/dist/chunk-OKGUZO2U.js +34 -0
  72. package/dist/{chunk-GAEBEQVI.js → chunk-OOJYHWRB.js} +32 -346
  73. package/dist/{chunk-Q5WJOSJ7.js → chunk-OQ33BKR3.js} +2 -1
  74. package/dist/chunk-OQE5J4C6.js +73 -0
  75. package/dist/{chunk-KKNLWXI6.js → chunk-ORBHGJC5.js} +8 -8
  76. package/dist/chunk-POHLU5DW.js +1186 -0
  77. package/dist/chunk-QKMUKYO7.js +4961 -0
  78. package/dist/{chunk-ASND7OZK.js → chunk-QTYWRVRA.js} +13 -13
  79. package/dist/{chunk-EYOKLTMF.js → chunk-SRF2PJNW.js} +17 -3
  80. package/dist/chunk-SST6Z5JA.js +80 -0
  81. package/dist/chunk-STBPMHSX.js +2456 -0
  82. package/dist/chunk-T6YILFSB.js +80 -0
  83. package/dist/chunk-TZTZS7QK.js +227 -0
  84. package/dist/chunk-UOV2BYIW.js +107 -0
  85. package/dist/{chunk-Q3RUPKEJ.js → chunk-V4RXGQ5Q.js} +58 -189
  86. package/dist/chunk-VAKQQHWR.js +434 -0
  87. package/dist/chunk-VG7TBQIY.js +128 -0
  88. package/dist/chunk-VJWL6YS5.js +244 -0
  89. package/dist/chunk-WEH5XRJQ.js +32 -0
  90. package/dist/chunk-WMSVI4G2.js +2095 -0
  91. package/dist/chunk-WVO7V2QY.js +797 -0
  92. package/dist/chunk-X4RCMKVQ.js +641 -0
  93. package/dist/chunk-X75S7HFS.js +374 -0
  94. package/dist/chunk-XN3L4EYL.js +46 -0
  95. package/dist/{chunk-RDLVBZEO.js → chunk-YCWGATWI.js} +6 -4
  96. package/dist/chunk-YHZX5GEU.js +193 -0
  97. package/dist/chunk-YXLYO42X.js +91 -0
  98. package/dist/{chunk-NMOX6HFD.js → chunk-ZDOOVTXZ.js} +29 -77
  99. package/dist/chunk-ZI647VB5.js +37 -0
  100. package/dist/{chunk-C4PTHK7P.js → chunk-ZWLZP4ZT.js} +5 -5
  101. package/dist/cli/index.js +62 -54
  102. package/dist/clio-4LY5K2AC.js +25 -0
  103. package/dist/code-nav-7AX6FYE6.js +600 -0
  104. package/dist/codewiki/build-worker.js +66 -0
  105. package/dist/compile-cache-CVJMMODC.js +18 -0
  106. package/dist/{components-DMAOEKFB.js → components-KELWS457.js} +11 -6
  107. package/dist/{config-IRUQ7SE4.js → config-GTLUW2PR.js} +92 -55
  108. package/dist/configure-R6A64DHX.js +42 -0
  109. package/dist/context-5VKGUVJJ.js +866 -0
  110. package/dist/{context-3KWFLHJG.js → context-JFZEJ7W5.js} +15 -13
  111. package/dist/{context-5RADCKTR.js → context-RW5HC47S.js} +71 -35
  112. package/dist/{context-clear-7TSNPAAI.js → context-clear-6ZHBAZZT.js} +54 -28
  113. package/dist/{context-index-W4RLWOQH.js → context-index-BZ4UYMTC.js} +30 -24
  114. package/dist/dispatch-runner-VKBRCWQC.js +1997 -0
  115. package/dist/{docs-5AWSPS37.js → docs-2C2LTVT2.js} +23 -10
  116. package/dist/{doctor-UC5NAJYQ.js → doctor-KI767GSN.js} +27 -17
  117. package/dist/{eval-U6TJHRLX.js → eval-XSSNATB4.js} +29 -16
  118. package/dist/{evidence-YEGUW4L3.js → evidence-UA6AWDQQ.js} +46 -26
  119. package/dist/{evolve-TXARCTPG.js → evolve-QNTFGV6Z.js} +45 -25
  120. package/dist/{extensions-OZFJ3A3G.js → extensions-QVDOHDGJ.js} +16 -7
  121. package/dist/{fleet-6G3DHNYE.js → fleet-Q7UOMUSG.js} +163 -54
  122. package/dist/{fleet-preflight-DSNT37JK.js → fleet-preflight-DDN536IT.js} +7 -4
  123. package/dist/{init-KZ5QTF6M.js → init-WBB65ZHQ.js} +69 -32
  124. package/dist/{memory-73ESV5YC.js → memory-MD3O64RI.js} +48 -27
  125. package/dist/{models-A4PVNWJK.js → models-BZU34YWD.js} +39 -25
  126. package/dist/monitor-MEQA5C3I.js +661 -0
  127. package/dist/{chunk-FCIH3BIZ.js → orchestrator-CGFKEP27.js} +11832 -8687
  128. package/dist/{paths-C4H6IV77.js → paths-UXLN5YYZ.js} +10 -5
  129. package/dist/{preload-6WVMHX3A.js → preload-P6DGH2PZ.js} +2 -2
  130. package/dist/{reset-BGW6OGMV.js → reset-L2FQEE3E.js} +16 -10
  131. package/dist/{run-YTPEYQOH.js → run-IV4Q6RLN.js} +101 -61
  132. package/dist/{share-YIFFV4NQ.js → share-S5BZQC5I.js} +15 -8
  133. package/dist/{skills-2V6RA3OQ.js → skills-LQEKRDTN.js} +34 -14
  134. package/dist/{skills-eval-S2TVJO4F.js → skills-eval-3DC4HEWS.js} +70 -34
  135. package/dist/steer-GGWFUJUD.js +77 -0
  136. package/dist/{targets-TYXLPB23.js → targets-C4SSGQOB.js} +43 -27
  137. package/dist/terminal-lease-IT5JW2NR.js +395 -0
  138. package/dist/{trace-GGOJ6Q6Z.js → trace-PNCASAXC.js} +41 -16
  139. package/dist/{chunk-N6F52NLF.js → tree-sitter-HGKH6LG4.js} +28 -2306
  140. package/dist/{uninstall-LLLT4F4W.js → uninstall-FZCQCDKC.js} +10 -5
  141. package/dist/{upgrade-33G2LMM5.js → upgrade-7TT7SQ3G.js} +45 -25
  142. package/dist/{usage-ZAFSXKKG.js → usage-GV4PKT3M.js} +62 -31
  143. package/dist/verify-G6V4D2G7.js +716 -0
  144. package/dist/web-fetch-2YHJ3KTG.js +638 -0
  145. package/dist/{wiki-generate-NUQCVOQ3.js → wiki-generate-DQF6Z66B.js} +74 -34
  146. package/dist/worker/entry.js +221 -36
  147. package/dist/workspace-G4ZWUIPR.js +22 -0
  148. package/docs/README.md +22 -17
  149. package/docs/acp.md +168 -16
  150. package/docs/alcf-provider.md +1 -1
  151. package/docs/architecture.md +136 -7
  152. package/docs/artifact-versions.md +1 -1
  153. package/docs/built-in-agents.md +1 -1
  154. package/docs/capacity-and-scheduling.md +1 -1
  155. package/docs/commands-and-modes.md +114 -71
  156. package/docs/config-knobs-audit.md +1 -3
  157. package/docs/configuration-and-targets.md +174 -46
  158. package/docs/context-engine.md +29 -6
  159. package/docs/development-pipeline.md +26 -1
  160. package/docs/dispatch-architecture-rationale.md +1 -1
  161. package/docs/documentation-coverage.md +2 -2
  162. package/docs/documentation-guide.md +1 -1
  163. package/docs/environment-variables.md +13 -5
  164. package/docs/eval-runner.md +1 -1
  165. package/docs/evals-internal.md +1 -1
  166. package/docs/evidence-and-memory.md +6 -2
  167. package/docs/evolution.md +2 -2
  168. package/docs/exit-codes-and-output.md +15 -9
  169. package/docs/extensions-and-sharing.md +9 -9
  170. package/docs/fleet-dispatch.md +7 -5
  171. package/docs/git-commit-provenance.md +120 -0
  172. package/docs/glossary.md +1 -1
  173. package/docs/installation-and-lifecycle.md +34 -27
  174. package/docs/middleware-and-components.md +1 -1
  175. package/docs/model-catalog.md +45 -14
  176. package/docs/observability.md +8 -5
  177. package/docs/performance-methodology.md +491 -0
  178. package/docs/pi-boundary.md +72 -0
  179. package/docs/proactive-memory.md +3 -3
  180. package/docs/prompt-envelope-and-tools.md +24 -3
  181. package/docs/provider-adapter-cookbook.md +57 -4
  182. package/docs/release-cut-checklist.md +129 -115
  183. package/docs/safety-model.md +9 -5
  184. package/docs/scientific-validation.md +3 -3
  185. package/docs/session-lifecycle.md +55 -12
  186. package/docs/skills-marketplace.md +12 -8
  187. package/docs/time-conventions.md +1 -1
  188. package/docs/tool-usage.md +3 -3
  189. package/docs/trace-store.md +1 -1
  190. package/docs/troubleshooting.md +10 -7
  191. package/docs/tui-design.md +47 -10
  192. package/docs/worker-dispatch-mechanics.md +1 -1
  193. package/package.json +19 -22
  194. package/skills/coding/ast-grep/SKILL.md +136 -0
  195. package/skills/coding/ast-grep/evals.md +56 -0
  196. package/skills/coding/ast-grep/references/rule_reference.md +297 -0
  197. package/skills/coding/coding-standards/SKILL.md +113 -0
  198. package/skills/coding/coding-standards/evals.md +34 -0
  199. package/skills/coding/prototype/SKILL.md +86 -0
  200. package/skills/coding/prototype/evals.md +42 -0
  201. package/skills/coding/prototype/references/LOGIC.md +67 -0
  202. package/skills/coding/prototype/references/UI.md +112 -0
  203. package/skills/coding/tdd/SKILL.md +101 -0
  204. package/skills/coding/tdd/evals.md +41 -0
  205. package/skills/coding/tdd/references/mocking.md +59 -0
  206. package/skills/coding/tdd/references/tests.md +77 -0
  207. package/skills/context/context-handoff/SKILL.md +126 -0
  208. package/skills/context/context-handoff/evals.md +57 -0
  209. package/skills/context/context-handoff/scripts/new-handoff.sh +26 -0
  210. package/skills/context/context-prime/SKILL.md +95 -0
  211. package/skills/context/context-prime/evals.md +54 -0
  212. package/skills/meta/clio-dev/SKILL.md +91 -0
  213. package/skills/meta/clio-dev/evals.md +45 -0
  214. package/skills/meta/clio-test/SKILL.md +130 -0
  215. package/skills/meta/clio-test/evals.md +43 -0
  216. package/skills/meta/clio-test/references/harness.md +97 -0
  217. package/skills/meta/clio-test/references/test-map.md +59 -0
  218. package/skills/meta/credentials/SKILL.md +125 -0
  219. package/skills/meta/credentials/evals.md +104 -0
  220. package/skills/meta/find-skills/SKILL.md +72 -0
  221. package/skills/meta/find-skills/evals.md +47 -0
  222. package/skills/meta/herdr/SKILL.md +127 -0
  223. package/skills/meta/herdr/evals.md +38 -0
  224. package/skills/meta/skill-craft/SKILL.md +102 -0
  225. package/skills/meta/skill-craft/evals.md +41 -0
  226. package/skills/planning/architecture/SKILL.md +129 -0
  227. package/skills/planning/architecture/evals.md +36 -0
  228. package/skills/planning/backlog/SKILL.md +90 -0
  229. package/skills/planning/backlog/evals.md +43 -0
  230. package/skills/planning/prd/SKILL.md +82 -0
  231. package/skills/planning/prd/evals.md +49 -0
  232. package/skills/planning/product-intent/SKILL.md +112 -0
  233. package/skills/planning/product-intent/evals.md +36 -0
  234. package/skills/planning/tech-spec/SKILL.md +115 -0
  235. package/skills/planning/tech-spec/evals.md +47 -0
  236. package/skills/registry.yaml +136 -0
  237. package/skills/research/arxiv-literature/SKILL.md +104 -0
  238. package/skills/research/arxiv-literature/evals.md +58 -0
  239. package/skills/research/experiment-protocol/SKILL.md +122 -0
  240. package/skills/research/experiment-protocol/evals.md +91 -0
  241. package/skills/research/scientific-debugging/SKILL.md +119 -0
  242. package/skills/research/scientific-debugging/evals.md +138 -0
  243. package/skills/research/scientific-modernization/SKILL.md +138 -0
  244. package/skills/research/scientific-modernization/evals.md +84 -0
  245. package/skills/workflow/design-council/SKILL.md +139 -0
  246. package/skills/workflow/design-council/evals.md +97 -0
  247. package/skills/workflow/grill-me/SKILL.md +186 -0
  248. package/skills/workflow/grill-me/evals.md +78 -0
  249. package/skills/workflow/workflow-distiller/SKILL.md +136 -0
  250. package/skills/workflow/workflow-distiller/evals.md +107 -0
  251. package/src/cli/acp.ts +31 -4
  252. package/src/cli/clio.ts +68 -6
  253. package/src/cli/config-inspect.ts +28 -22
  254. package/src/cli/configure.ts +47 -9
  255. package/src/cli/context-clear.ts +2 -2
  256. package/src/cli/context-index.ts +21 -23
  257. package/src/cli/context.ts +13 -8
  258. package/src/cli/default-target.ts +9 -17
  259. package/src/cli/docs.ts +11 -5
  260. package/src/cli/evidence.ts +4 -1
  261. package/src/cli/extensions.ts +10 -1
  262. package/src/cli/fleet.ts +47 -6
  263. package/src/cli/index.ts +55 -26
  264. package/src/cli/memory.ts +3 -1
  265. package/src/cli/models.ts +1 -1
  266. package/src/cli/modes/json-stream.ts +37 -1
  267. package/src/cli/modes/print.ts +24 -9
  268. package/src/cli/run.ts +2 -2
  269. package/src/cli/skills-eval.ts +23 -8
  270. package/src/cli/skills.ts +19 -4
  271. package/src/cli/targets.ts +4 -0
  272. package/src/cli/text-layout.ts +15 -5
  273. package/src/cli/trace.ts +62 -14
  274. package/src/cli/upgrade.ts +18 -2
  275. package/src/cli/usage.ts +10 -3
  276. package/src/cli/wiki-generate.ts +2 -1
  277. package/src/core/agent-environment.ts +7 -0
  278. package/src/core/bash-exec.ts +72 -1
  279. package/src/core/boot-trace.ts +9 -4
  280. package/src/core/bus-events.ts +20 -4
  281. package/src/core/commit-attribution.ts +157 -0
  282. package/src/core/compile-cache.ts +159 -0
  283. package/src/core/config.ts +131 -2
  284. package/src/core/defaults.ts +39 -5
  285. package/src/core/domain-loader.ts +12 -5
  286. package/src/core/git-commit-attribution.ts +362 -0
  287. package/src/core/incomplete-installation.ts +45 -0
  288. package/src/core/response-schema.ts +1 -1
  289. package/src/core/safe-exec.ts +13 -1
  290. package/src/core/settings-layers.ts +155 -21
  291. package/src/core/skill-activation.ts +1 -1
  292. package/src/core/startup-timer.ts +3 -3
  293. package/src/core/state-file-lock.ts +13 -1
  294. package/src/core/termination.ts +78 -5
  295. package/src/domains/config/classify.ts +15 -3
  296. package/src/domains/config/extension.ts +19 -13
  297. package/src/domains/config/index.ts +10 -0
  298. package/src/domains/config/keybindings.ts +42 -6
  299. package/src/domains/context/bootstrap-prompt.ts +1 -1
  300. package/src/domains/context/bootstrap.ts +111 -18
  301. package/src/domains/context/clear.ts +16 -11
  302. package/src/domains/context/clio-md.ts +111 -9
  303. package/src/domains/context/codewiki/artifact.ts +400 -0
  304. package/src/domains/context/codewiki/build-worker-protocol.ts +24 -0
  305. package/src/domains/context/codewiki/build-worker.ts +54 -0
  306. package/src/domains/context/codewiki/coordinator.ts +182 -0
  307. package/src/domains/context/codewiki/indexer.ts +59 -144
  308. package/src/domains/context/codewiki/paths.ts +67 -0
  309. package/src/domains/context/codewiki/schema.ts +80 -0
  310. package/src/domains/context/codewiki/tree-sitter.ts +1 -1
  311. package/src/domains/context/contract.ts +11 -5
  312. package/src/domains/context/extension.ts +94 -143
  313. package/src/domains/context/fingerprint.ts +3 -1
  314. package/src/domains/context/index.ts +12 -22
  315. package/src/domains/context/project-metadata.ts +19 -0
  316. package/src/domains/context/prompt-context.ts +9 -10
  317. package/src/domains/context/refresh.ts +29 -21
  318. package/src/domains/context/runtime.ts +17 -0
  319. package/src/domains/context/wiki/generate.ts +39 -34
  320. package/src/domains/context/wiki/plan.ts +1 -1
  321. package/src/domains/context/wiki/prompts.ts +21 -8
  322. package/src/domains/dispatch/code-step.ts +20 -1
  323. package/src/domains/dispatch/extension.ts +158 -21
  324. package/src/domains/dispatch/failure-classification.ts +6 -0
  325. package/src/domains/dispatch/fleet-commit-attribution.ts +56 -0
  326. package/src/domains/dispatch/orphan-recovery.ts +50 -8
  327. package/src/domains/dispatch/receipt-integrity.ts +5 -0
  328. package/src/domains/dispatch/state.ts +31 -6
  329. package/src/domains/dispatch/transport.ts +2 -1
  330. package/src/domains/dispatch/types.ts +14 -0
  331. package/src/domains/dispatch/worker-spawn.ts +21 -2
  332. package/src/domains/eval/metrics/context.ts +1 -1
  333. package/src/domains/eval/types.ts +0 -1
  334. package/src/domains/evidence/build.ts +41 -1
  335. package/src/domains/lifecycle/migrations/2026-08-18-lmstudio-runtime-id.ts +52 -0
  336. package/src/domains/lifecycle/migrations/index.ts +24 -4
  337. package/src/domains/middleware/hooks-io.ts +12 -0
  338. package/src/domains/middleware/skills-reminder.ts +30 -15
  339. package/src/domains/prompts/compiler.ts +142 -84
  340. package/src/domains/prompts/contract.ts +18 -2
  341. package/src/domains/prompts/extension.ts +39 -7
  342. package/src/domains/prompts/fragment-loader.ts +0 -1
  343. package/src/domains/prompts/fragments/identity/clio.md +2 -4
  344. package/src/domains/prompts/fragments/identity/docs-routing.md +10 -0
  345. package/src/domains/prompts/fragments/identity/self-awareness.md +1 -45
  346. package/src/domains/prompts/fragments/operating/contract.md +4 -50
  347. package/src/domains/prompts/fragments/operating/delegation.md +42 -0
  348. package/src/domains/prompts/fragments/operating/skills.md +26 -0
  349. package/src/domains/prompts/fragments/operating/worker.md +16 -0
  350. package/src/domains/prompts/fragments/safety/auto-edit.md +5 -5
  351. package/src/domains/prompts/fragments/safety/full-auto.md +3 -3
  352. package/src/domains/prompts/fragments/safety/read-only.md +4 -4
  353. package/src/domains/prompts/fragments/safety/suggest.md +2 -2
  354. package/src/domains/prompts/fragments/wiki/page.md +10 -0
  355. package/src/domains/prompts/fragments/wiki/plan.md +10 -0
  356. package/src/domains/prompts/preload.ts +3 -3
  357. package/src/domains/providers/auth/api-key.ts +1 -1
  358. package/src/domains/providers/auth/backend-file.ts +20 -10
  359. package/src/domains/providers/auth/backend-memory.ts +59 -4
  360. package/src/domains/providers/auth/boot-status.ts +65 -0
  361. package/src/domains/providers/auth/oauth.ts +2 -1
  362. package/src/domains/providers/auth/storage.ts +97 -38
  363. package/src/domains/providers/capabilities.ts +12 -4
  364. package/src/domains/providers/contract.ts +15 -4
  365. package/src/domains/providers/extension.ts +18 -6
  366. package/src/domains/providers/model-runtime-capabilities.ts +15 -4
  367. package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +118 -35
  368. package/src/domains/providers/plugins.ts +5 -3
  369. package/src/domains/providers/probe/fingerprint.ts +25 -5
  370. package/src/domains/providers/registry.ts +31 -10
  371. package/src/domains/providers/runtimes/boot-manifest.ts +55 -0
  372. package/src/domains/providers/runtimes/builtins.ts +2 -2
  373. package/src/domains/providers/runtimes/common/lmstudio-http.ts +423 -0
  374. package/src/domains/providers/runtimes/common/local-synth.ts +6 -7
  375. package/src/domains/providers/runtimes/local-native/lmstudio.ts +241 -0
  376. package/src/domains/providers/support.ts +6 -3
  377. package/src/domains/providers/types/local-model-quirks.ts +7 -9
  378. package/src/domains/providers/types/runtime-descriptor.ts +12 -1
  379. package/src/domains/providers/types/target-descriptor.ts +22 -0
  380. package/src/domains/resources/contract.ts +0 -1
  381. package/src/domains/resources/extension.ts +1 -3
  382. package/src/domains/resources/loader.ts +3 -4
  383. package/src/domains/resources/prompts/loader.ts +16 -2
  384. package/src/domains/resources/prompts/substitute.ts +1 -65
  385. package/src/domains/resources/skills/content-hash.ts +2 -0
  386. package/src/domains/resources/skills/install.ts +17 -0
  387. package/src/domains/resources/skills/loader.ts +17 -10
  388. package/src/domains/resources/skills/marketplace.ts +55 -9
  389. package/src/domains/safety/action-classifier.ts +4 -2
  390. package/src/domains/safety/audit.ts +8 -2
  391. package/src/domains/safety/extension.ts +1 -1
  392. package/src/domains/session/compaction/branch-summary.ts +3 -2
  393. package/src/domains/session/compaction/cut-point.ts +2 -1
  394. package/src/domains/session/compaction/tokens.ts +2 -1
  395. package/src/domains/session/context-ledger.ts +14 -0
  396. package/src/domains/session/contract.ts +15 -0
  397. package/src/domains/session/decision-board.ts +190 -0
  398. package/src/domains/session/entries.ts +66 -3
  399. package/src/domains/session/extension.ts +93 -12
  400. package/src/domains/session/retry.ts +10 -18
  401. package/src/domains/session/session-artifacts.ts +107 -0
  402. package/src/domains/session/task-board.ts +207 -13
  403. package/src/domains/session/tree/active-path.ts +44 -5
  404. package/src/domains/session/tree/fork.ts +26 -27
  405. package/src/domains/session/tree/preview.ts +2 -2
  406. package/src/domains/session/workspace/git-probe.ts +17 -11
  407. package/src/domains/user-tasks/store.ts +297 -0
  408. package/src/engine/acp/errors.ts +96 -0
  409. package/src/engine/acp/server.ts +1728 -146
  410. package/src/engine/acp/transport.ts +135 -14
  411. package/src/engine/acp/types.ts +26 -0
  412. package/src/engine/agent.ts +3 -3
  413. package/src/engine/ai.ts +32 -27
  414. package/src/engine/alcf-oauth.ts +26 -19
  415. package/src/engine/api-registry.ts +223 -0
  416. package/src/engine/apis/index.ts +3 -7
  417. package/src/engine/apis/llamacpp-residency.ts +49 -9
  418. package/src/engine/apis/lmstudio-residency.ts +5 -21
  419. package/src/engine/apis/lmstudio.ts +243 -0
  420. package/src/engine/apis/ollama-native.ts +24 -3
  421. package/src/engine/apis/openai-completions.ts +170 -91
  422. package/src/engine/apis/residency.ts +139 -3
  423. package/src/engine/apis/types.ts +16 -0
  424. package/src/engine/env-api-keys.ts +98 -0
  425. package/src/engine/gemma-channel-filter.ts +223 -0
  426. package/src/engine/instrumented-tui.ts +192 -0
  427. package/src/engine/messages.ts +14 -0
  428. package/src/engine/models.ts +42 -0
  429. package/src/engine/oauth.ts +16 -12
  430. package/src/engine/prompt-templates.ts +1 -0
  431. package/src/engine/provider-payload.ts +16 -59
  432. package/src/engine/strip-tokenizer-sentinels.ts +1 -1
  433. package/src/engine/truncate.ts +9 -0
  434. package/src/engine/tui.ts +17 -9
  435. package/src/engine/types.ts +3 -6
  436. package/src/engine/worker-runtime-capabilities.ts +5 -0
  437. package/src/engine/worker-runtime.ts +1 -1
  438. package/src/engine/worker-tools.ts +9 -4
  439. package/src/entry/boot-options.ts +50 -0
  440. package/src/entry/orchestrator.ts +288 -150
  441. package/src/interactive/application-controller.ts +89 -2
  442. package/src/interactive/chat-loop.ts +266 -41
  443. package/src/interactive/chat-panel.ts +173 -47
  444. package/src/interactive/chat-renderer.ts +262 -72
  445. package/src/interactive/clio-editor.ts +3 -8
  446. package/src/interactive/command-fallbacks.ts +2 -2
  447. package/src/interactive/context-overlay.ts +27 -1
  448. package/src/interactive/editor-submit.ts +228 -24
  449. package/src/interactive/export-html/ansi-to-html.ts +161 -0
  450. package/src/interactive/export-html/index.ts +51 -0
  451. package/src/interactive/export-html/template.ts +45 -0
  452. package/src/interactive/export-html/tool-renderer.ts +54 -0
  453. package/src/interactive/footer/dashboard.ts +4 -0
  454. package/src/interactive/footer/notifications.ts +1 -1
  455. package/src/interactive/footer/widgets.ts +20 -2
  456. package/src/interactive/footer-panel.ts +2 -2
  457. package/src/interactive/format-time.ts +14 -2
  458. package/src/interactive/interactive-application.ts +201 -17
  459. package/src/interactive/interactive-event-projection.ts +6 -1
  460. package/src/interactive/interactive-input-runtime.ts +50 -4
  461. package/src/interactive/interactive-presentation.ts +151 -19
  462. package/src/interactive/interactive-shell.ts +268 -14
  463. package/src/interactive/interactive-slash-runtime.ts +176 -114
  464. package/src/interactive/interactive-tickers.ts +38 -7
  465. package/src/interactive/keybinding-manager.ts +1 -1
  466. package/src/interactive/layout.ts +40 -3
  467. package/src/interactive/overlay-frame.ts +1 -1
  468. package/src/interactive/overlay-general-openers.ts +58 -1
  469. package/src/interactive/overlay-key-routing.ts +3 -0
  470. package/src/interactive/overlay-lifecycle.ts +13 -0
  471. package/src/interactive/overlay-permission-lifecycle.ts +2 -1
  472. package/src/interactive/overlay-session-lifecycle.ts +69 -12
  473. package/src/interactive/overlays/decisions.ts +300 -0
  474. package/src/interactive/overlays/help-reference.ts +15 -10
  475. package/src/interactive/overlays/model-selector.ts +34 -16
  476. package/src/interactive/overlays/session-selector.ts +18 -0
  477. package/src/interactive/overlays/settings.ts +105 -17
  478. package/src/interactive/overlays/skills-hub.ts +4 -4
  479. package/src/interactive/overlays/tree-selector.ts +41 -6
  480. package/src/interactive/render-trace.ts +499 -90
  481. package/src/interactive/renderers/compaction-summary.ts +2 -2
  482. package/src/interactive/renderers/diff.ts +115 -104
  483. package/src/interactive/renderers/mermaid.ts +53 -0
  484. package/src/interactive/renderers/tool-execution.ts +386 -133
  485. package/src/interactive/renderers/worker-entry.ts +20 -4
  486. package/src/interactive/session-switch-settlement.ts +10 -0
  487. package/src/interactive/slash-autocomplete.ts +6 -114
  488. package/src/interactive/slash-commands.ts +135 -47
  489. package/src/interactive/slash-spec.ts +9 -38
  490. package/src/interactive/status/controller.ts +5 -1
  491. package/src/interactive/stdout-backpressure.ts +99 -0
  492. package/src/interactive/stream-pacer.ts +530 -0
  493. package/src/interactive/stream-pacing-policy.ts +66 -0
  494. package/src/interactive/tasks-overlay.ts +368 -14
  495. package/src/interactive/terminal-lease.ts +485 -0
  496. package/src/interactive/theme/tokens.ts +1 -1
  497. package/src/interactive/turn-context.ts +4 -3
  498. package/src/interactive/turn-persistence.ts +30 -13
  499. package/src/interactive/turn-queues.ts +12 -0
  500. package/src/interactive/turn-recovery.ts +25 -8
  501. package/src/interactive/turn-runtime.ts +79 -12
  502. package/src/interactive/turn-state.ts +10 -0
  503. package/src/interactive/view/artifacts.ts +114 -4
  504. package/src/interactive/view/view-overlay.ts +3 -0
  505. package/src/interactive/welcome-dashboard.ts +17 -16
  506. package/src/interactive/worker-receipts.ts +52 -3
  507. package/src/interactive/worker-stream.ts +5 -1
  508. package/src/tools/agent-tools.ts +23 -3
  509. package/src/tools/artifact.ts +2 -2
  510. package/src/tools/ask-user.ts +23 -13
  511. package/src/tools/bash.ts +30 -2
  512. package/src/tools/bootstrap.ts +34 -431
  513. package/src/tools/builtin-tool-catalog.ts +265 -0
  514. package/src/tools/codewiki/code-nav-surface.ts +29 -0
  515. package/src/tools/codewiki/code-nav.ts +8 -22
  516. package/src/tools/codewiki/shared.ts +41 -38
  517. package/src/tools/context/docs-engine.ts +14 -3
  518. package/src/tools/context/index.ts +107 -28
  519. package/src/tools/context/surface.ts +19 -0
  520. package/src/tools/core-bootstrap.ts +168 -0
  521. package/src/tools/credential-present.ts +5 -5
  522. package/src/tools/dispatch-admission.ts +533 -0
  523. package/src/tools/dispatch-background.ts +54 -0
  524. package/src/tools/dispatch-event-text.ts +6 -0
  525. package/src/tools/dispatch-plan.ts +9 -4
  526. package/src/tools/dispatch-run-events.ts +238 -0
  527. package/src/tools/dispatch-runner.ts +2370 -0
  528. package/src/tools/dispatch-scout-admission.ts +295 -0
  529. package/src/tools/dispatch-types.ts +77 -0
  530. package/src/tools/dispatch.ts +67 -3161
  531. package/src/tools/find.ts +4 -2
  532. package/src/tools/grep.ts +2 -2
  533. package/src/tools/lazy-tool.ts +60 -0
  534. package/src/tools/ledger.ts +3 -3
  535. package/src/tools/monitor-surface.ts +36 -0
  536. package/src/tools/monitor.ts +2 -32
  537. package/src/tools/observers.ts +2 -2
  538. package/src/tools/registry.ts +39 -27
  539. package/src/tools/safe-exec.ts +2 -2
  540. package/src/tools/steer-surface.ts +17 -0
  541. package/src/tools/steer.ts +2 -13
  542. package/src/tools/tasks.ts +108 -11
  543. package/src/tools/truncate.ts +25 -184
  544. package/src/tools/verify/frontend.ts +3 -1
  545. package/src/tools/verify/index.ts +3 -38
  546. package/src/tools/verify/surface.ts +46 -0
  547. package/src/tools/web-fetch-surface.ts +23 -0
  548. package/src/tools/web-fetch.ts +2 -20
  549. package/src/tools/write.ts +7 -2
  550. package/src/worker/entry.ts +39 -2
  551. package/src/worker/spec-contract.ts +26 -5
  552. package/dist/chunk-7SS2CTV2.js +0 -61361
  553. package/dist/chunk-DKGKUHFA.js +0 -924
  554. package/dist/chunk-GEP36Y4X.js +0 -12796
  555. package/dist/chunk-XYWBQRDM.js +0 -137
  556. package/dist/clio-BZVGEUFJ.js +0 -58
  557. package/dist/configure-S7S6F6CL.js +0 -32
  558. package/docs/html/agents_blueprint.html +0 -936
  559. package/docs/html/alcf_blueprint.html +0 -324
  560. package/docs/html/architecture_blueprint.html +0 -850
  561. package/docs/html/commands_blueprint.html +0 -939
  562. package/docs/html/config_knobs_audit_blueprint.html +0 -178
  563. package/docs/html/configuration_blueprint.html +0 -1080
  564. package/docs/html/context_blueprint.html +0 -603
  565. package/docs/html/documentation_blueprint.html +0 -832
  566. package/docs/html/environment_blueprint.html +0 -404
  567. package/docs/html/eval_blueprint.html +0 -743
  568. package/docs/html/evals_internal_blueprint.html +0 -190
  569. package/docs/html/evolution_blueprint.html +0 -674
  570. package/docs/html/extensions_blueprint.html +0 -2065
  571. package/docs/html/fleet_dispatch_blueprint.html +0 -286
  572. package/docs/html/index.html +0 -919
  573. package/docs/html/lifecycle_blueprint.html +0 -723
  574. package/docs/html/memory_blueprint.html +0 -699
  575. package/docs/html/middleware_blueprint.html +0 -664
  576. package/docs/html/models_blueprint.html +0 -2366
  577. package/docs/html/observability_blueprint.html +0 -683
  578. package/docs/html/provider_adapter_blueprint.html +0 -245
  579. package/docs/html/safety_blueprint.html +0 -1386
  580. package/docs/html/shared.css +0 -571
  581. package/docs/html/shared.js +0 -143
  582. package/docs/html/skills_blueprint.html +0 -671
  583. package/docs/html/soak_blueprint.html +0 -182
  584. package/docs/html/tool_usage_blueprint.html +0 -350
  585. package/docs/html/tools_blueprint.html +0 -2249
  586. package/docs/html/trace_blueprint.html +0 -235
  587. package/docs/html/tui_design_blueprint.html +0 -374
  588. package/docs/html/validation_blueprint.html +0 -961
  589. package/docs/html/worker_dispatch_blueprint.html +0 -231
  590. package/src/core/release.ts +0 -2
  591. package/src/domains/providers/runtimes/common/lmstudio-logger.ts +0 -32
  592. package/src/domains/providers/runtimes/local-native/lmstudio-native.ts +0 -491
  593. package/src/engine/apis/lmstudio-native.ts +0 -1438
  594. package/src/engine/apis/thinking-replay.ts +0 -11
  595. package/src/tools/string-enum.ts +0 -15
@@ -0,0 +1,1882 @@
1
+ import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-3R73A4XB.js";
5
+
6
+ // src/engine/tui.ts
7
+ init_esm_shims();
8
+ import {
9
+ Box,
10
+ CombinedAutocompleteProvider,
11
+ Container,
12
+ Editor,
13
+ fuzzyFilter,
14
+ getKeybindings,
15
+ Input,
16
+ isKeyRelease,
17
+ KeybindingsManager,
18
+ Markdown,
19
+ Marked,
20
+ matchesKey,
21
+ ProcessTerminal,
22
+ ScrollView,
23
+ setKeybindings,
24
+ stripTerminalSequences,
25
+ Text,
26
+ TUI_KEYBINDINGS,
27
+ TuiAltScreen as TuiAltScreen2,
28
+ TuiMainScreen as TuiMainScreen2,
29
+ truncateToWidth,
30
+ VStack,
31
+ visibleWidth,
32
+ wrapTextWithAnsi
33
+ } from "@earendil-works/pi-tui";
34
+
35
+ // src/engine/instrumented-tui.ts
36
+ init_esm_shims();
37
+ import { TuiAltScreen, TuiMainScreen } from "@earendil-works/pi-tui";
38
+ var DeferredRenderAdmission = class {
39
+ constructor(admission, render) {
40
+ this.admission = admission;
41
+ this.render = render;
42
+ }
43
+ admission;
44
+ render;
45
+ pending = false;
46
+ force = false;
47
+ release = null;
48
+ request(force) {
49
+ if (!this.admission?.blocked) return false;
50
+ this.pending = true;
51
+ this.force ||= force;
52
+ this.release ??= this.admission.onWritable(() => {
53
+ this.release?.();
54
+ this.release = null;
55
+ if (!this.pending) return;
56
+ const pendingForce = this.force;
57
+ this.pending = false;
58
+ this.force = false;
59
+ this.render(pendingForce);
60
+ });
61
+ return true;
62
+ }
63
+ /** A direct/final render supersedes any older request held behind the gate. */
64
+ settled() {
65
+ this.pending = false;
66
+ this.force = false;
67
+ this.release?.();
68
+ this.release = null;
69
+ }
70
+ };
71
+ var InstrumentedTuiMainScreen = class extends TuiMainScreen {
72
+ constructor(terminal, renderObserver, showHardwareCursor, logDirectory, renderAdmission) {
73
+ super(terminal, showHardwareCursor, logDirectory);
74
+ this.renderObserver = renderObserver;
75
+ this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
76
+ }
77
+ renderObserver;
78
+ requestRender(force = false) {
79
+ if (!this.deferredAdmission.request(force)) super.requestRender(force);
80
+ }
81
+ doRender() {
82
+ this.deferredAdmission.settled();
83
+ if (this.renderObserver.isEnabled?.() === false) {
84
+ super.doRender();
85
+ return;
86
+ }
87
+ const frame2 = this.renderObserver.beginFrame({
88
+ mode: this.mode,
89
+ columns: this.terminal.columns,
90
+ rows: this.terminal.rows
91
+ });
92
+ this.currentFrame = frame2;
93
+ try {
94
+ super.doRender();
95
+ } finally {
96
+ this.currentFrame = void 0;
97
+ this.renderObserver.endFrame(frame2);
98
+ }
99
+ }
100
+ compositeOverlays(lines, termWidth, termHeight) {
101
+ return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
102
+ }
103
+ applyLineResets(lines) {
104
+ return this.measure("normalization", () => super.applyLineResets(lines));
105
+ }
106
+ extractCursorPosition(lines, height) {
107
+ return this.measure("cursor", () => super.extractCursorPosition(lines, height));
108
+ }
109
+ measure(phase, operation) {
110
+ if (this.renderObserver.isEnabled?.() === false) return operation();
111
+ const frame2 = this.currentFrame;
112
+ if (frame2 === void 0) return operation();
113
+ const phaseToken = this.renderObserver.beginPhase(frame2, phase);
114
+ try {
115
+ return operation();
116
+ } finally {
117
+ this.renderObserver.endPhase(frame2, phase, phaseToken);
118
+ }
119
+ }
120
+ currentFrame;
121
+ deferredAdmission;
122
+ };
123
+ var InstrumentedTuiAltScreen = class extends TuiAltScreen {
124
+ constructor(terminal, renderObserver, showHardwareCursor, logDirectory, options, renderAdmission) {
125
+ super(terminal, showHardwareCursor, logDirectory, options);
126
+ this.renderObserver = renderObserver;
127
+ this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
128
+ }
129
+ renderObserver;
130
+ currentFrame;
131
+ requestRender(force = false) {
132
+ if (!this.deferredAdmission.request(force)) super.requestRender(force);
133
+ }
134
+ doRender() {
135
+ this.deferredAdmission.settled();
136
+ if (this.renderObserver.isEnabled?.() === false) {
137
+ super.doRender();
138
+ return;
139
+ }
140
+ const frame2 = this.renderObserver.beginFrame({
141
+ mode: this.mode,
142
+ columns: this.terminal.columns,
143
+ rows: this.terminal.rows
144
+ });
145
+ this.currentFrame = frame2;
146
+ try {
147
+ super.doRender();
148
+ } finally {
149
+ this.currentFrame = void 0;
150
+ this.renderObserver.endFrame(frame2);
151
+ }
152
+ }
153
+ compositeOverlays(lines, termWidth, termHeight) {
154
+ return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
155
+ }
156
+ applyLineResets(lines) {
157
+ return this.measure("normalization", () => super.applyLineResets(lines));
158
+ }
159
+ extractCursorPosition(lines, height) {
160
+ return this.measure("cursor", () => super.extractCursorPosition(lines, height));
161
+ }
162
+ measure(phase, operation) {
163
+ if (this.renderObserver.isEnabled?.() === false) return operation();
164
+ const frame2 = this.currentFrame;
165
+ if (frame2 === void 0) return operation();
166
+ const phaseToken = this.renderObserver.beginPhase(frame2, phase);
167
+ try {
168
+ return operation();
169
+ } finally {
170
+ this.renderObserver.endPhase(frame2, phase, phaseToken);
171
+ }
172
+ }
173
+ deferredAdmission;
174
+ };
175
+
176
+ // src/engine/select-list.ts
177
+ init_esm_shims();
178
+ import {
179
+ SelectList as EngineSelectList
180
+ } from "@earendil-works/pi-tui";
181
+ var PI_SELECT_CURSOR = "\u2192";
182
+ var ESC = String.fromCharCode(27);
183
+ var LEADING_CURSOR_PATTERN = new RegExp(`^((?:${ESC}\\[[0-9;]*m)*)${PI_SELECT_CURSOR} `);
184
+ var SelectList = class extends EngineSelectList {
185
+ designCursor;
186
+ constructor(items, maxVisible, theme, layout) {
187
+ super(items, maxVisible, theme, layout);
188
+ this.designCursor = theme.cursor;
189
+ }
190
+ render(width) {
191
+ const lines = super.render(width);
192
+ const cursor = this.designCursor;
193
+ if (!cursor || cursor === PI_SELECT_CURSOR) return lines;
194
+ return lines.map((line) => line.replace(LEADING_CURSOR_PATTERN, `$1${cursor} `));
195
+ }
196
+ };
197
+
198
+ // src/engine/tui.ts
199
+ function createAgentProgress(terminal) {
200
+ let active = false;
201
+ return {
202
+ start() {
203
+ if (active) return;
204
+ active = true;
205
+ terminal.setProgress(true);
206
+ },
207
+ stop() {
208
+ if (!active) return;
209
+ active = false;
210
+ terminal.setProgress(false);
211
+ },
212
+ isActive() {
213
+ return active;
214
+ }
215
+ };
216
+ }
217
+
218
+ // src/interactive/theme/glyphs.ts
219
+ init_esm_shims();
220
+ var GLYPH = {
221
+ // Clio wordmark, shown in the welcome and dashboard headers only.
222
+ brand: ">C_",
223
+ // Agent voice glyph for the chat reply prefix. It renders in accent on a
224
+ // normal turn and error red on a failed one. The `>C_` wordmark is no longer
225
+ // the reply prefix; it survives only in the two headers above.
226
+ agent: "\u2726",
227
+ user: "\u203A",
228
+ // Selection focus marker for list overlays. It is deliberately distinct from
229
+ // the tool ledger's toolHeader so a focused row never reads as a tool line.
230
+ cursor: "\u276F",
231
+ toolHeader: "\u25B8",
232
+ running: "\u25CF",
233
+ queued: "\u25CC",
234
+ speed: "\u26A1",
235
+ ok: "\u2713",
236
+ error: "\u2717",
237
+ cancelled: "\u2298",
238
+ active: "\u25C6",
239
+ scoped: "\u25C7",
240
+ up: "\u2191",
241
+ down: "\u2193",
242
+ rail: "\u2502",
243
+ innerDivider: "\u254C",
244
+ barFull: "\u2588",
245
+ barEmpty: "\u2591",
246
+ contextFull: "\u25B0",
247
+ contextFree: "\u25B1",
248
+ // Autocompact reserve cells: held-back headroom is neither used nor free,
249
+ // so it carries its own glyph and never reads as filled when only color is
250
+ // lost. The medium-shade block is single-width in the same fonts that carry
251
+ // the barFull/barEmpty fallbacks.
252
+ contextReserve: "\u2592",
253
+ info: "\u2139",
254
+ warn: "\u26A0",
255
+ warnInline: "!",
256
+ phaseWaiting: "\u25D4",
257
+ phaseThinking: "\u25D0",
258
+ phaseWriting: "\u25D1",
259
+ phaseTool: "\u2699",
260
+ phaseBlocked: "\u23F8",
261
+ phaseRetry: "\u21BB",
262
+ phaseCompact: "\u267B",
263
+ phaseDispatch: "\u21F2",
264
+ // Marks a run that Clio started for itself (a shadow worker or an internal
265
+ // harness run) so internal activity reads as a sub-process of the current
266
+ // turn. It replaces the old `sh:`/`in:` agent-name prefixes; the two
267
+ // audiences are told apart by tone, not by a second glyph.
268
+ subProcess: "\u21B3",
269
+ // Who asked for a dispatched run. Hollow is the operator's own (/run,
270
+ // /delegate); filled is one the model started by calling a dispatch tool.
271
+ // The transcript block, the board row, and the footer count share the pair,
272
+ // so a running ◇ anywhere is work the operator started themselves.
273
+ workerHuman: "\u25C7",
274
+ workerAgent: "\u25C6",
275
+ // A run neither the operator nor the model asked for: wiki documenting, a
276
+ // bootstrap scout, a judge. It stays off the transcript entirely, so the
277
+ // board is the only surface that shows it and it gets the quietest mark
278
+ // that still holds the origin column.
279
+ workerInternal: "\xB7",
280
+ ellipsis: "\u2026",
281
+ favorite: "\u2605"
282
+ };
283
+ var SPINNER_FRAMES = ["\u28FE", "\u28FD", "\u28FB", "\u28BF", "\u287F", "\u28DF", "\u28EF", "\u28F7"];
284
+ function spinnerFrame(tick) {
285
+ const index = (tick % SPINNER_FRAMES.length + SPINNER_FRAMES.length) % SPINNER_FRAMES.length;
286
+ return SPINNER_FRAMES[index] ?? SPINNER_FRAMES[0];
287
+ }
288
+
289
+ // src/interactive/theme/index.ts
290
+ init_esm_shims();
291
+
292
+ // src/interactive/theme/tokens.ts
293
+ init_esm_shims();
294
+ var TOKENS = {
295
+ accent: { rgb: [70, 229, 208], xterm: 80 },
296
+ accentDeep: { rgb: [31, 183, 166], xterm: 44 },
297
+ // Second brand color: neon orange. The token name teaches the rule: orange
298
+ // means Clio is acting. It fires only for Clio's signature actions
299
+ // (dispatching, queued and running fleet work, steering) and for the border
300
+ // of a prompt that has taken the keyboard and is waiting on a decision, never
301
+ // as decoration, and never a metric, at most one orange element per region of
302
+ // the screen. warning stays the soft amber for actual warnings.
303
+ action: { rgb: [255, 126, 41], xterm: 208 },
304
+ success: { rgb: [87, 227, 137], xterm: 114 },
305
+ warning: { rgb: [255, 180, 84], xterm: 221 },
306
+ error: { rgb: [255, 92, 102], xterm: 203 },
307
+ info: { rgb: [91, 168, 255], xterm: 75 },
308
+ reason: { rgb: [157, 140, 255], xterm: 141 },
309
+ dim: { rgb: [106, 122, 133], xterm: 59 },
310
+ muted: { rgb: [138, 153, 164], xterm: 102 },
311
+ title: { rgb: [70, 229, 208], xterm: 80 },
312
+ frame: { rgb: [47, 93, 90], xterm: 23 },
313
+ frameStrong: { rgb: [42, 171, 158], xterm: 37 }
314
+ };
315
+ var SGR_RESET = "\x1B[0m";
316
+ var SGR_DIM = "\x1B[2m";
317
+ function colorDisabled(env = process.env) {
318
+ const raw = env.NO_COLOR;
319
+ return typeof raw === "string" && raw.length > 0;
320
+ }
321
+ function detectTruecolor(env = process.env) {
322
+ const colorTerm = (env.COLORTERM ?? "").toLowerCase();
323
+ if (colorTerm.includes("truecolor") || colorTerm.includes("24bit")) return true;
324
+ const term = (env.TERM ?? "").toLowerCase();
325
+ return term.includes("truecolor") || term.includes("24bit");
326
+ }
327
+ function fgCode(color, truecolor) {
328
+ return truecolor ? `38;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `38;5;${color.xterm}`;
329
+ }
330
+ function bgCode(color, truecolor) {
331
+ return truecolor ? `48;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `48;5;${color.xterm}`;
332
+ }
333
+ function fgSequence(token, truecolor = detectTruecolor()) {
334
+ if (colorDisabled()) return "";
335
+ return `\x1B[${fgCode(TOKENS[token], truecolor)}m`;
336
+ }
337
+ function createClioTheme(options = {}) {
338
+ const truecolor = options.truecolor ?? detectTruecolor();
339
+ const color = options.color ?? !colorDisabled();
340
+ const paint = (text, mods) => {
341
+ const codes = [];
342
+ if (mods.bold) codes.push("1");
343
+ if (mods.dim) codes.push("2");
344
+ if (mods.italic) codes.push("3");
345
+ if (mods.underline) codes.push("4");
346
+ if (color && mods.fg) codes.push(fgCode(TOKENS[mods.fg], truecolor));
347
+ if (color && mods.bg) codes.push(bgCode(TOKENS[mods.bg], truecolor));
348
+ if (codes.length === 0) return text;
349
+ return `\x1B[${codes.join(";")}m${text}${SGR_RESET}`;
350
+ };
351
+ return {
352
+ truecolor,
353
+ paint,
354
+ fg: (token, text) => paint(text, { fg: token }),
355
+ bg: (token, text) => paint(text, { bg: token }),
356
+ style: (token, text, mods = {}) => paint(text, { ...mods, fg: token }),
357
+ fgSequence: (token) => color ? `\x1B[${fgCode(TOKENS[token], truecolor)}m` : ""
358
+ };
359
+ }
360
+
361
+ // src/interactive/theme/components.ts
362
+ init_esm_shims();
363
+
364
+ // src/interactive/theme/segments.ts
365
+ init_esm_shims();
366
+ function present(parts) {
367
+ return parts.filter((part) => typeof part === "string" && part.length > 0);
368
+ }
369
+ function brandMark(theme) {
370
+ const prompt = GLYPH.brand.slice(0, 1);
371
+ const initial = GLYPH.brand.slice(1, 2);
372
+ const cursor = GLYPH.brand.slice(2, 3);
373
+ return `${theme.fg("dim", prompt)}${theme.style("accent", initial, { bold: true })}${theme.fg("dim", cursor)}`;
374
+ }
375
+ function dotSep(theme) {
376
+ return theme.fg("dim", " \xB7 ");
377
+ }
378
+ function barSep(theme) {
379
+ return theme.fg("frame", " \u2502 ");
380
+ }
381
+ function sectionTag(theme, token, label, pad = 0) {
382
+ const text = pad > 0 ? label.padEnd(pad) : label;
383
+ return theme.style(token, text, { bold: true });
384
+ }
385
+ function screenTitle(theme, label) {
386
+ return theme.style("title", label, { bold: true });
387
+ }
388
+ function listGroupHeader(theme, label) {
389
+ return theme.fg("dim", `\u2500\u2500 ${label}`);
390
+ }
391
+ function joinChips(theme, parts) {
392
+ return present(parts).join(dotSep(theme));
393
+ }
394
+ function joinSections(theme, parts) {
395
+ return present(parts).join(barSep(theme));
396
+ }
397
+
398
+ // src/interactive/theme/components.ts
399
+ var identity = (text) => text;
400
+ function markdownTheme(theme, highlightCode) {
401
+ return {
402
+ heading: (text) => screenTitle(theme, text),
403
+ link: (text) => theme.fg("info", text),
404
+ linkUrl: (text) => theme.fg("dim", text),
405
+ code: (text) => theme.fg("muted", text),
406
+ codeBlock: (text) => text,
407
+ codeBlockBorder: (text) => theme.fg("frame", text),
408
+ quote: (text) => theme.fg("muted", text),
409
+ quoteBorder: (text) => theme.fg("frame", text),
410
+ hr: (text) => theme.fg("frame", text),
411
+ listBullet: (text) => theme.fg("accent", text),
412
+ bold: (text) => theme.paint(text, { bold: true }),
413
+ italic: (text) => theme.paint(text, { italic: true }),
414
+ strikethrough: identity,
415
+ underline: (text) => theme.paint(text, { underline: true }),
416
+ ...highlightCode ? { highlightCode } : {}
417
+ };
418
+ }
419
+ function selectListTheme(theme) {
420
+ return {
421
+ // The design cursor the engine SelectList swaps in for pi-tui's arrow.
422
+ cursor: GLYPH.cursor,
423
+ selectedPrefix: (text) => theme.fg("accent", text),
424
+ selectedText: (text) => theme.style("accent", text, { bold: true }),
425
+ description: (text) => theme.fg("muted", text),
426
+ scrollInfo: (text) => theme.fg("dim", text),
427
+ noMatch: (text) => theme.fg("warning", text)
428
+ };
429
+ }
430
+ function settingsListTheme(theme) {
431
+ return {
432
+ label: (text, selected) => selected ? theme.style("accent", text, { bold: true }) : text,
433
+ value: (text, selected) => selected ? theme.fg("success", text) : theme.fg("muted", text),
434
+ description: (text) => theme.fg("muted", text),
435
+ cursor: GLYPH.cursor,
436
+ hint: (text) => theme.fg("dim", text)
437
+ };
438
+ }
439
+ function editorTheme(theme) {
440
+ return {
441
+ borderColor: (text) => theme.style("frameStrong", text, { bold: true }),
442
+ selectList: selectListTheme(theme)
443
+ };
444
+ }
445
+
446
+ // src/interactive/theme/labels.ts
447
+ init_esm_shims();
448
+ function abbreviateModelId(modelId) {
449
+ const base = (modelId ?? "").trim().split("/").filter(Boolean).pop() ?? "";
450
+ if (base.length === 0) return "model";
451
+ const parts = base.split("-").filter((part) => part.length > 0);
452
+ if (parts.length <= 1) return base.length > 18 ? base.slice(0, 18) : base;
453
+ const kept = [];
454
+ for (const part of parts) {
455
+ const next = [...kept, part].join("-");
456
+ if (kept.length > 0 && next.length > 18) break;
457
+ kept.push(part);
458
+ }
459
+ const joined = kept.join("-");
460
+ return joined.length > 18 ? joined.slice(0, 18) : joined;
461
+ }
462
+ function formatTargetLabel(targetId, modelId, options = {}) {
463
+ const target = (targetId ?? "").trim();
464
+ const model = (modelId ?? "").trim();
465
+ if (target.length === 0 && model.length === 0) return "not configured";
466
+ const shown = options.abbreviate === false ? model : abbreviateModelId(model);
467
+ if (target.length === 0) return `no target \xB7 ${shown}`;
468
+ if (model.length === 0) return `${target} \xB7 no model`;
469
+ return `${target}${options.separator ?? " \xB7 "}${shown}`;
470
+ }
471
+ function formatCompactMs(value) {
472
+ const ms = Math.max(0, Math.round(value));
473
+ if (ms < 1e3) return `${ms}ms`;
474
+ const seconds = ms / 1e3;
475
+ return seconds < 60 ? `${seconds.toFixed(seconds >= 10 ? 0 : 1)}s` : `${Math.floor(seconds / 60)}m${Math.round(seconds % 60)}s`;
476
+ }
477
+ function formatContextPercent(percent) {
478
+ return typeof percent === "number" && Number.isFinite(percent) ? `${percent.toFixed(1)}%` : "?%";
479
+ }
480
+ function collapseHomePath(path) {
481
+ const home = process.env.HOME;
482
+ if (!home || home.length === 0) return path;
483
+ if (path === home) return "~";
484
+ return path.startsWith(`${home}/`) ? `~/${path.slice(home.length + 1)}` : path;
485
+ }
486
+
487
+ // src/interactive/theme/rules.ts
488
+ init_esm_shims();
489
+ function padAnsi(text, width, ellipsis = "") {
490
+ return truncateToWidth(text, Math.max(0, width), ellipsis, true);
491
+ }
492
+ function fitUnits(theme, prefix, units, maxWidth) {
493
+ const sep = " \xB7 ";
494
+ let line = prefix;
495
+ for (let index = 0; index < units.length; index += 1) {
496
+ const candidate = index === 0 ? `${line}${units[index]}` : `${line}${sep}${units[index]}`;
497
+ const reserve = index < units.length - 1 ? 2 : 0;
498
+ if (visibleWidth(candidate) + reserve > maxWidth) {
499
+ if (index === 0) return truncateToWidth(candidate, Math.max(0, maxWidth), "\u2026", false);
500
+ return `${line} ${theme.fg("dim", "\u2026")}`;
501
+ }
502
+ line = candidate;
503
+ }
504
+ return line;
505
+ }
506
+ function rule(theme, width, options = {}) {
507
+ const safeWidth = Math.max(0, width);
508
+ if (safeWidth === 0) return "";
509
+ const left = options.left ? `${theme.style(options.leftToken ?? "accent", options.left, { bold: true })} ` : "";
510
+ const rightBody = options.rightRaw ? options.right : theme.fg(options.rightToken ?? "muted", options.right ?? "");
511
+ const right = options.right ? ` ${rightBody} ${options.rightTail ?? ""}` : "";
512
+ const labelsWidth = visibleWidth(left) + visibleWidth(right);
513
+ if (labelsWidth >= safeWidth) return truncateToWidth(`${left}${right}`.trim(), safeWidth, "", true);
514
+ const fill = theme.style(options.fillToken ?? "frame", "\u2500".repeat(safeWidth - labelsWidth), {
515
+ bold: options.fillToken === "frameStrong"
516
+ });
517
+ return `${left}${fill}${right}`;
518
+ }
519
+ function frame(theme, title, lines, width, opts = {}) {
520
+ const safeWidth = Math.max(4, width);
521
+ const contentWidth = Math.max(0, safeWidth - 4);
522
+ const frameFg = (text) => theme.fg("frame", text);
523
+ const hasTitle = title.length > 0;
524
+ const styledTitle = !hasTitle ? "" : title.includes("\x1B") ? title : theme.style("title", title, { bold: true });
525
+ const titleWidth = visibleWidth(title);
526
+ const meta = opts.rightMeta ?? "";
527
+ const hasMeta = meta.length > 0;
528
+ const metaWidth = hasMeta ? visibleWidth(meta) : 0;
529
+ const leftVisible = 2 + (hasTitle ? titleWidth + 2 : 0);
530
+ const rightVisible = hasMeta ? metaWidth + 4 : 1;
531
+ const fillWidth = Math.max(0, safeWidth - leftVisible - rightVisible);
532
+ const leftStr = hasTitle ? `${frameFg("\u250C\u2500")} ${styledTitle} ` : frameFg("\u250C\u2500");
533
+ const rightStr = hasMeta ? ` ${theme.fg("dim", meta)} ${frameFg("\u2500\u2510")}` : frameFg("\u2510");
534
+ const top = `${leftStr}${frameFg("\u2500".repeat(fillWidth))}${rightStr}`;
535
+ const body = lines.map((line) => `${frameFg("\u2502")} ${padAnsi(line, contentWidth)} ${frameFg("\u2502")}`);
536
+ const bottom = `${frameFg("\u2514")}${frameFg("\u2500".repeat(safeWidth - 2))}${frameFg("\u2518")}`;
537
+ return [top, ...body, bottom];
538
+ }
539
+ function innerDivider(theme, width) {
540
+ return theme.fg("frame", GLYPH.innerDivider.repeat(Math.max(0, width)));
541
+ }
542
+
543
+ // src/interactive/theme/index.ts
544
+ var sharedTheme = null;
545
+ function clioTheme() {
546
+ sharedTheme ??= createClioTheme();
547
+ return sharedTheme;
548
+ }
549
+
550
+ // src/interactive/clio-editor.ts
551
+ init_esm_shims();
552
+ var REVERSE_VIDEO_BLANK = `${String.fromCharCode(27)}[7m ${String.fromCharCode(27)}[0m`;
553
+ var EMPTY_PROMPT = "Ask Clio\u2026 / for commands";
554
+ var MIN_HINT_WIDTH = 60;
555
+ function hasScrollIndicator(line) {
556
+ const stripped = stripTerminalSequences(line);
557
+ return stripped.includes(GLYPH.up) || stripped.includes(GLYPH.down);
558
+ }
559
+ function normalizeThinkingHint(value) {
560
+ return value.replace(/^think\s+/i, "").trim().toLowerCase();
561
+ }
562
+ function styledThinkingHint(theme, value) {
563
+ const hint = normalizeThinkingHint(value);
564
+ switch (hint) {
565
+ case "off":
566
+ return theme.fg("dim", hint);
567
+ case "minimal":
568
+ case "low":
569
+ return theme.fg("muted", hint);
570
+ case "xhigh":
571
+ case "max":
572
+ case "on":
573
+ return theme.style("reason", hint, { bold: true });
574
+ default:
575
+ return theme.fg("reason", hint);
576
+ }
577
+ }
578
+ function styledRailLabel(theme, chrome) {
579
+ return `${theme.fg("dim", chrome.getModelLabel())} ${theme.fg("dim", "\xB7")} ${styledThinkingHint(theme, chrome.getThinkingLabel())}`;
580
+ }
581
+ function composerMode(chrome, text) {
582
+ if (!(chrome.isStreaming?.() ?? false)) return "MESSAGE";
583
+ const willSteer = chrome.willEnterSteer?.(text) ?? text.trim().length > 0;
584
+ return willSteer ? "STEER" : "FOLLOW-UP";
585
+ }
586
+ function lowerRailHint(theme, chrome) {
587
+ return theme.fg(
588
+ "dim",
589
+ `${chrome.getSubmitKeyLabel?.() ?? "Enter"} send \xB7 ${chrome.getNewlineKeyLabel?.() ?? "Shift+Enter"} newline`
590
+ );
591
+ }
592
+ function renderEmptyPrompt(line, width, theme) {
593
+ const cursorAt = line.indexOf(REVERSE_VIDEO_BLANK);
594
+ if (cursorAt < 0) return line;
595
+ const afterCursorAt = cursorAt + REVERSE_VIDEO_BLANK.length;
596
+ const available = Math.max(0, width - 1);
597
+ const prompt = truncateToWidth(theme.fg("dim", EMPTY_PROMPT), available, "\u2026", false);
598
+ const consumed = visibleWidth(prompt);
599
+ return `${line.slice(0, afterCursorAt)}${prompt}${line.slice(afterCursorAt + consumed)}`;
600
+ }
601
+ function findBottomRail(lines, width) {
602
+ const rail = "\u2500".repeat(Math.max(0, width));
603
+ for (let index = 1; index < lines.length; index += 1) {
604
+ if (stripTerminalSequences(lines[index] ?? "") === rail) return index;
605
+ }
606
+ return -1;
607
+ }
608
+ var ClioEditor = class extends Editor {
609
+ constructor(tui, chrome) {
610
+ super(tui, editorTheme(clioTheme()));
611
+ this.chrome = chrome;
612
+ }
613
+ chrome;
614
+ render(width) {
615
+ const lines = super.render(width);
616
+ if (lines.length === 0) return lines;
617
+ const theme = clioTheme();
618
+ const safeWidth = Math.max(0, width);
619
+ const text = this.getText();
620
+ const mode = composerMode(this.chrome, text);
621
+ if (hasScrollIndicator(lines[0] ?? "")) {
622
+ const modeLabel = theme.style(mode === "STEER" ? "action" : "accentDeep", mode, { bold: true });
623
+ lines[0] = truncateToWidth(`${modeLabel} ${lines[0] ?? ""}`, safeWidth, "", true);
624
+ } else {
625
+ lines[0] = rule(theme, safeWidth, {
626
+ left: mode,
627
+ leftToken: mode === "STEER" ? "action" : "accentDeep",
628
+ right: styledRailLabel(theme, this.chrome),
629
+ fillToken: "frameStrong",
630
+ rightRaw: true,
631
+ rightTail: theme.style("frameStrong", "\u2500", { bold: true })
632
+ });
633
+ }
634
+ if (text.length === 0 && lines[1]) lines[1] = renderEmptyPrompt(lines[1], safeWidth, theme);
635
+ const bottomRail = findBottomRail(lines, safeWidth);
636
+ if (bottomRail >= 0 && safeWidth >= MIN_HINT_WIDTH) {
637
+ lines[bottomRail] = rule(theme, safeWidth, {
638
+ right: lowerRailHint(theme, this.chrome),
639
+ fillToken: "frameStrong",
640
+ rightRaw: true,
641
+ rightTail: theme.style("frameStrong", "\u2500", { bold: true })
642
+ });
643
+ }
644
+ return lines;
645
+ }
646
+ /**
647
+ * pi-tui's bracketed-paste handling inserts pasted text (including a
648
+ * trailing newline the paste carried) without submitting: a pasted
649
+ * `/model\n` lands as two lines in the buffer and just sits there. Once
650
+ * the base handler has applied a chunk that closed a paste, check whether
651
+ * the buffer now reads as a completed slash command and, if so, submit it
652
+ * through the same handler the typed-Enter path uses.
653
+ */
654
+ handleInput(data) {
655
+ const closedPaste = data.includes("\x1B[201~");
656
+ super.handleInput(data);
657
+ if (!closedPaste) return;
658
+ const text = this.getText();
659
+ if (!text.endsWith("\n")) return;
660
+ const command = text.trimEnd();
661
+ if (!command.startsWith("/")) return;
662
+ this.setText("");
663
+ this.onSubmit?.(command);
664
+ }
665
+ };
666
+
667
+ // src/interactive/interactive-shell.ts
668
+ init_esm_shims();
669
+
670
+ // src/interactive/render-trace.ts
671
+ init_esm_shims();
672
+ import { mkdirSync, writeFileSync } from "node:fs";
673
+ import { appendFile } from "node:fs/promises";
674
+ import { dirname } from "node:path";
675
+ var RENDER_TRACE_VERSION = 2;
676
+ function createAsyncTraceWriter(path, options = {}) {
677
+ const maxRecords = options.maxRecords ?? 4096;
678
+ const batchRecords = options.batchRecords ?? 128;
679
+ const append = options.append ?? ((target, payload) => appendFile(target, payload, "utf8"));
680
+ const recordTime = options.recordTime ?? (() => performance.now());
681
+ const appendTimeoutMs = options.appendTimeoutMs ?? 5e3;
682
+ const pending = [];
683
+ let dropped = 0;
684
+ let inFlight = false;
685
+ let scheduled = false;
686
+ let failed = false;
687
+ let closing = false;
688
+ let closePromise = null;
689
+ let resolveClose = null;
690
+ const settleClose = () => {
691
+ if (closing && !inFlight && pending.length === 0) resolveClose?.();
692
+ };
693
+ const pump = () => {
694
+ scheduled = false;
695
+ if (failed || inFlight || pending.length === 0) {
696
+ settleClose();
697
+ return;
698
+ }
699
+ inFlight = true;
700
+ const payload = pending.splice(0, batchRecords).join("");
701
+ let appendTimer = null;
702
+ const appendDeadline = new Promise((_resolve, reject) => {
703
+ appendTimer = setTimeout(() => reject(new Error("render trace append timed out")), appendTimeoutMs);
704
+ });
705
+ void Promise.race([append(path, payload), appendDeadline]).catch(() => {
706
+ failed = true;
707
+ pending.length = 0;
708
+ }).finally(() => {
709
+ if (appendTimer) clearTimeout(appendTimer);
710
+ inFlight = false;
711
+ if (pending.length > 0 && !failed) queueMicrotask(pump);
712
+ else settleClose();
713
+ });
714
+ };
715
+ const schedule = () => {
716
+ if (scheduled || inFlight || failed) return;
717
+ scheduled = true;
718
+ queueMicrotask(pump);
719
+ };
720
+ return {
721
+ enqueue(record) {
722
+ if (failed || closing) return;
723
+ if (pending.length >= maxRecords) {
724
+ pending.shift();
725
+ dropped += 1;
726
+ }
727
+ pending.push(`${JSON.stringify(record)}
728
+ `);
729
+ schedule();
730
+ },
731
+ close() {
732
+ if (closePromise) return closePromise;
733
+ if (dropped > 0 && !failed) {
734
+ pending.push(
735
+ `${JSON.stringify({ type: "trace_drop", version: RENDER_TRACE_VERSION, at: recordTime(), records: dropped })}
736
+ `
737
+ );
738
+ }
739
+ closing = true;
740
+ closePromise = new Promise((resolve) => {
741
+ resolveClose = resolve;
742
+ });
743
+ if (failed) {
744
+ pending.length = 0;
745
+ resolveClose?.();
746
+ } else {
747
+ schedule();
748
+ settleClose();
749
+ }
750
+ return closePromise;
751
+ }
752
+ };
753
+ }
754
+ function rounded(value) {
755
+ return Math.round(value * 1e3) / 1e3;
756
+ }
757
+ function graphemeCount(text) {
758
+ const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
759
+ let count = 0;
760
+ for (const _part of segmenter.segment(text)) count += 1;
761
+ return count;
762
+ }
763
+ function renderTracePath(env = process.env) {
764
+ const raw = env.CLIO_CODER_RENDER_TRACE?.trim();
765
+ return raw && raw.length > 0 ? raw : null;
766
+ }
767
+ function createRenderTrace(path, now = () => performance.now(), writerOptions = {}) {
768
+ mkdirSync(dirname(path), { recursive: true });
769
+ writeFileSync(path, "", "utf8");
770
+ const openedAt = now();
771
+ const at = () => rounded(now() - openedAt);
772
+ const writer = createAsyncTraceWriter(path, { ...writerOptions, recordTime: at });
773
+ let frameSeq = 0;
774
+ let writeSeq = 0;
775
+ let eventSeq = 0;
776
+ let inputSeq = 0;
777
+ let generation = 0;
778
+ let panelHighWater = 0;
779
+ let inputHighWater = 0;
780
+ let queueDepth = 0;
781
+ let currentFrame = null;
782
+ let pendingPanel = null;
783
+ let lastCommitAt = null;
784
+ let firstCommitListener = null;
785
+ let firstCommitDelivered = false;
786
+ const ranges = /* @__PURE__ */ new Map();
787
+ const pendingDrains = /* @__PURE__ */ new Map();
788
+ writer.enqueue({ type: "trace_start", version: RENDER_TRACE_VERSION, at: 0 });
789
+ const trace = {
790
+ recordPanelRender(metrics) {
791
+ pendingPanel = metrics;
792
+ },
793
+ beginGeneration() {
794
+ generation += 1;
795
+ ranges.clear();
796
+ },
797
+ recordVisibleEvent(fields) {
798
+ eventSeq += 1;
799
+ const key = `${generation}:${fields.kind}:${fields.contentIndex}`;
800
+ const previous = ranges.get(key) ?? { codeUnits: 0, graphemes: 0 };
801
+ const graphemes = graphemeCount(fields.delta);
802
+ const next = { codeUnits: previous.codeUnits + fields.delta.length, graphemes: previous.graphemes + graphemes };
803
+ ranges.set(key, next);
804
+ writer.enqueue({
805
+ type: "event_ingress",
806
+ version: RENDER_TRACE_VERSION,
807
+ eventSeq,
808
+ generation,
809
+ kind: fields.kind,
810
+ contentIndex: fields.contentIndex,
811
+ at: at(),
812
+ codeUnitStart: previous.codeUnits,
813
+ codeUnitEnd: next.codeUnits,
814
+ graphemeStart: previous.graphemes,
815
+ graphemeEnd: next.graphemes,
816
+ bytes: Buffer.byteLength(fields.delta, "utf8")
817
+ });
818
+ return eventSeq;
819
+ },
820
+ recordQueue(sequence, action) {
821
+ queueDepth = Math.max(0, queueDepth + (action === "admit" ? 1 : -1));
822
+ writer.enqueue({
823
+ type: "queue",
824
+ version: RENDER_TRACE_VERSION,
825
+ eventSeq: sequence,
826
+ action,
827
+ at: at(),
828
+ depth: queueDepth
829
+ });
830
+ },
831
+ recordPanelApplied(sequence) {
832
+ panelHighWater = Math.max(panelHighWater, sequence);
833
+ writer.enqueue({
834
+ type: "panel",
835
+ version: RENDER_TRACE_VERSION,
836
+ eventSeq: sequence,
837
+ at: at(),
838
+ highWater: panelHighWater
839
+ });
840
+ },
841
+ recordInputIngress(action, bytes, visualExpected = action !== "no-visual-change") {
842
+ inputSeq += 1;
843
+ if (visualExpected) inputHighWater = inputSeq;
844
+ writer.enqueue({
845
+ type: "input_ingress",
846
+ version: RENDER_TRACE_VERSION,
847
+ inputSeq,
848
+ action,
849
+ at: at(),
850
+ bytes,
851
+ visualExpected
852
+ });
853
+ return inputSeq;
854
+ },
855
+ beginFrame(fields) {
856
+ frameSeq += 1;
857
+ const frame2 = {
858
+ frameId: frameSeq,
859
+ ...fields,
860
+ beginAt: at(),
861
+ panelHighWater,
862
+ inputHighWater,
863
+ panel: pendingPanel,
864
+ phases: { component: 0, overlay: 0, normalization: 0, cursor: 0 },
865
+ commits: []
866
+ };
867
+ pendingPanel = null;
868
+ currentFrame = frame2;
869
+ return frame2;
870
+ },
871
+ endFrame(frameToken) {
872
+ const frame2 = frameToken;
873
+ const endAt = at();
874
+ const terminalEnqueueMs = frame2.commits.reduce((sum, commit) => sum + commit.enqueueMs, 0);
875
+ const measured = frame2.phases.component + frame2.phases.overlay + frame2.phases.normalization + frame2.phases.cursor + terminalEnqueueMs;
876
+ const record = {
877
+ type: "frame",
878
+ version: RENDER_TRACE_VERSION,
879
+ frameId: frame2.frameId,
880
+ mode: frame2.mode,
881
+ columns: frame2.columns,
882
+ rows: frame2.rows,
883
+ beginAt: frame2.beginAt,
884
+ endAt,
885
+ durationMs: rounded(Math.max(0, endAt - frame2.beginAt)),
886
+ sinceLastCommitMs: lastCommitAt === null || frame2.commits.length === 0 ? null : rounded(Math.max(0, (frame2.commits[0]?.at ?? endAt) - lastCommitAt)),
887
+ panelHighWater: frame2.panelHighWater,
888
+ inputHighWater: frame2.inputHighWater,
889
+ panel: frame2.panel,
890
+ pipeline: {
891
+ componentMs: rounded(frame2.phases.component),
892
+ overlayCompositionMs: rounded(frame2.phases.overlay),
893
+ normalizationMs: rounded(frame2.phases.normalization),
894
+ cursorExtractionMs: rounded(frame2.phases.cursor),
895
+ viewportDiffAnsiCursorMs: rounded(Math.max(0, endAt - frame2.beginAt - measured)),
896
+ terminalEnqueueMs: rounded(terminalEnqueueMs)
897
+ },
898
+ commits: frame2.commits
899
+ };
900
+ writer.enqueue(record);
901
+ if (frame2.commits.length > 0) {
902
+ lastCommitAt = frame2.commits.at(-1)?.at ?? endAt;
903
+ if (!firstCommitDelivered) {
904
+ firstCommitDelivered = true;
905
+ firstCommitListener?.(frame2.frameId);
906
+ }
907
+ }
908
+ if (currentFrame === frame2) currentFrame = null;
909
+ },
910
+ beginPhase(_frame, _phase) {
911
+ return now();
912
+ },
913
+ endPhase(frameToken, phase, phaseToken) {
914
+ const frame2 = frameToken;
915
+ frame2.phases[phase] += Math.max(0, now() - phaseToken);
916
+ },
917
+ beginComponentRender() {
918
+ return currentFrame ? now() : null;
919
+ },
920
+ endComponentRender(token) {
921
+ if (currentFrame === null || token === null) return;
922
+ currentFrame.phases.component += Math.max(0, now() - token);
923
+ },
924
+ recordTerminalWrite(fields) {
925
+ writeSeq += 1;
926
+ const frameId = currentFrame?.frameId ?? null;
927
+ const commit = {
928
+ writeId: writeSeq,
929
+ at: at(),
930
+ bytes: fields.bytes,
931
+ enqueueMs: rounded(fields.enqueueMs),
932
+ returned: fields.returned,
933
+ backpressured: !fields.returned
934
+ };
935
+ currentFrame?.commits.push(commit);
936
+ writer.enqueue({ type: "terminal_write", version: RENDER_TRACE_VERSION, frameId, ...commit });
937
+ if (!fields.returned) pendingDrains.set(writeSeq, { frameId, at: commit.at });
938
+ return writeSeq;
939
+ },
940
+ recordTerminalDrain(writeId) {
941
+ const pending = pendingDrains.get(writeId);
942
+ if (!pending) return;
943
+ pendingDrains.delete(writeId);
944
+ const drainAt = at();
945
+ writer.enqueue({
946
+ type: "terminal_drain",
947
+ version: RENDER_TRACE_VERSION,
948
+ writeId,
949
+ frameId: pending.frameId,
950
+ at: drainAt,
951
+ waitMs: rounded(Math.max(0, drainAt - pending.at))
952
+ });
953
+ },
954
+ currentFrameId: () => currentFrame?.frameId ?? null,
955
+ onFirstFrameCommit(listener) {
956
+ firstCommitListener = listener;
957
+ },
958
+ close: () => writer.close()
959
+ };
960
+ return trace;
961
+ }
962
+ function traceComponentRenders(component, trace) {
963
+ const original = component.render;
964
+ const wrapped = function(width) {
965
+ const token = trace.beginComponentRender();
966
+ try {
967
+ return original.call(this, width);
968
+ } finally {
969
+ trace.endComponentRender(token);
970
+ }
971
+ };
972
+ component.render = wrapped;
973
+ return () => {
974
+ if (component.render === wrapped) component.render = original;
975
+ };
976
+ }
977
+ function traceProcessStdout(trace, now = () => performance.now(), stdout = process.stdout) {
978
+ const original = stdout.write;
979
+ const pendingDrainWrites = [];
980
+ let drainListening = false;
981
+ const wrapped = function(...args) {
982
+ const chunk = args[0];
983
+ const start = now();
984
+ const returned = Reflect.apply(original, this, args);
985
+ const enqueueMs = Math.max(0, now() - start);
986
+ let bytes = 0;
987
+ try {
988
+ bytes = Buffer.isBuffer(chunk) ? chunk.byteLength : ArrayBuffer.isView(chunk) ? chunk.byteLength : Buffer.byteLength(String(chunk), typeof args[1] === "string" ? args[1] : "utf8");
989
+ } catch {
990
+ bytes = Buffer.byteLength(String(chunk), "utf8");
991
+ }
992
+ const writeId = trace.recordTerminalWrite({ bytes, enqueueMs, returned });
993
+ if (!returned) {
994
+ pendingDrainWrites.push(writeId);
995
+ if (!drainListening) {
996
+ drainListening = true;
997
+ stdout.once("drain", () => {
998
+ drainListening = false;
999
+ for (const pendingWriteId of pendingDrainWrites.splice(0)) trace.recordTerminalDrain(pendingWriteId);
1000
+ });
1001
+ }
1002
+ }
1003
+ return returned;
1004
+ };
1005
+ stdout.write = wrapped;
1006
+ return () => {
1007
+ if (stdout.write === wrapped) stdout.write = original;
1008
+ };
1009
+ }
1010
+
1011
+ // src/interactive/stdout-backpressure.ts
1012
+ init_esm_shims();
1013
+ function installStdoutBackpressureGate(stdout = process.stdout) {
1014
+ const original = stdout.write;
1015
+ const listeners = /* @__PURE__ */ new Set();
1016
+ let blocked = false;
1017
+ let observed = false;
1018
+ let restored = false;
1019
+ let drainListening = false;
1020
+ const notifyWritable = () => {
1021
+ drainListening = false;
1022
+ if (!blocked) return;
1023
+ blocked = false;
1024
+ for (const listener of [...listeners]) listener();
1025
+ };
1026
+ const listenForDrain = () => {
1027
+ if (drainListening || restored) return;
1028
+ drainListening = true;
1029
+ stdout.once("drain", notifyWritable);
1030
+ };
1031
+ const wrapped = function(...args) {
1032
+ const returned = Reflect.apply(original, this, args);
1033
+ if (!returned) {
1034
+ observed = true;
1035
+ blocked = true;
1036
+ listenForDrain();
1037
+ }
1038
+ return returned;
1039
+ };
1040
+ stdout.write = wrapped;
1041
+ return {
1042
+ get blocked() {
1043
+ return blocked;
1044
+ },
1045
+ get observed() {
1046
+ return observed;
1047
+ },
1048
+ onWritable(listener) {
1049
+ if (restored || !blocked) {
1050
+ queueMicrotask(listener);
1051
+ return () => {
1052
+ };
1053
+ }
1054
+ listeners.add(listener);
1055
+ return () => listeners.delete(listener);
1056
+ },
1057
+ whenWritable(timeoutMs) {
1058
+ if (restored || !blocked) return Promise.resolve(true);
1059
+ return new Promise((resolve) => {
1060
+ let timer;
1061
+ const release = this.onWritable(() => {
1062
+ if (timer) clearTimeout(timer);
1063
+ release();
1064
+ resolve(true);
1065
+ });
1066
+ if (timeoutMs !== void 0 && Number.isFinite(timeoutMs) && timeoutMs >= 0) {
1067
+ timer = setTimeout(() => {
1068
+ release();
1069
+ resolve(false);
1070
+ }, timeoutMs);
1071
+ }
1072
+ });
1073
+ },
1074
+ restore() {
1075
+ if (restored) return;
1076
+ restored = true;
1077
+ blocked = false;
1078
+ if (drainListening) {
1079
+ stdout.off("drain", notifyWritable);
1080
+ drainListening = false;
1081
+ }
1082
+ if (stdout.write === wrapped) stdout.write = original;
1083
+ for (const listener of [...listeners]) listener();
1084
+ listeners.clear();
1085
+ }
1086
+ };
1087
+ }
1088
+
1089
+ // src/interactive/interactive-shell.ts
1090
+ var KEEP_ALIVE_INTERVAL_MS = 1 << 30;
1091
+ function createInteractiveShell(deps) {
1092
+ const terminal = deps.createTerminal();
1093
+ const tui = deps.createTui(terminal);
1094
+ const scheduleInterval = deps.scheduleInterval ?? ((callback, intervalMs) => setInterval(callback, intervalMs));
1095
+ const clearScheduledInterval = deps.clearScheduledInterval ?? ((handle) => clearInterval(handle));
1096
+ let mounted = false;
1097
+ let keepAlive = null;
1098
+ let resolveRun = null;
1099
+ let run = null;
1100
+ let completedCode = null;
1101
+ let stopped = false;
1102
+ let stopSettlement = null;
1103
+ return {
1104
+ terminal,
1105
+ tui,
1106
+ mount(root, focus) {
1107
+ if (mounted) return;
1108
+ mounted = true;
1109
+ deps.prepareRoot?.(root);
1110
+ tui.addChild(root);
1111
+ if (tui.mode === "fullscreen") tui.setLayoutRoot?.(root);
1112
+ tui.setFocus(focus);
1113
+ tui.start();
1114
+ },
1115
+ anchor() {
1116
+ if (run) return run;
1117
+ run = new Promise((resolve) => {
1118
+ resolveRun = resolve;
1119
+ if (completedCode !== null) resolve(completedCode);
1120
+ });
1121
+ keepAlive = scheduleInterval(() => {
1122
+ }, KEEP_ALIVE_INTERVAL_MS);
1123
+ return run;
1124
+ },
1125
+ releaseAnchor() {
1126
+ if (!keepAlive) return;
1127
+ clearScheduledInterval(keepAlive);
1128
+ keepAlive = null;
1129
+ },
1130
+ stop() {
1131
+ if (stopped) return;
1132
+ stopped = true;
1133
+ try {
1134
+ tui.stop();
1135
+ } catch {
1136
+ } finally {
1137
+ try {
1138
+ stopSettlement = Promise.resolve(deps.onStop?.()).then(() => void 0);
1139
+ } catch {
1140
+ stopSettlement = Promise.resolve();
1141
+ }
1142
+ }
1143
+ },
1144
+ async commitCurrentFrame() {
1145
+ if (!tui.renderNow) {
1146
+ tui.requestRender();
1147
+ return null;
1148
+ }
1149
+ tui.renderNow(false);
1150
+ return null;
1151
+ },
1152
+ hasObservedBackpressure: () => false,
1153
+ setStreamPacingActive: () => {
1154
+ },
1155
+ settle() {
1156
+ return stopSettlement ?? Promise.resolve();
1157
+ },
1158
+ nextCommittedFrame() {
1159
+ return Promise.resolve(null);
1160
+ },
1161
+ complete(code) {
1162
+ if (completedCode !== null) return;
1163
+ completedCode = code;
1164
+ resolveRun?.(code);
1165
+ }
1166
+ };
1167
+ }
1168
+ var activeRenderTrace = null;
1169
+ function getActiveRenderTrace() {
1170
+ return activeRenderTrace;
1171
+ }
1172
+ async function settleLatestInteractiveFrame(gate, timeoutMs, renderFrame) {
1173
+ const writableBeforeRender = gate ? await gate.whenWritable(timeoutMs) : true;
1174
+ const frameId = await renderFrame();
1175
+ if (writableBeforeRender && gate) await gate.whenWritable(timeoutMs);
1176
+ return frameId;
1177
+ }
1178
+ function createProcessInteractiveShell(options = {}) {
1179
+ const tracePath = renderTracePath();
1180
+ let restoreStdout = null;
1181
+ let restoreFirstFrameStdout = null;
1182
+ let restoreRoot = null;
1183
+ let backpressure = null;
1184
+ let observedBackpressure = false;
1185
+ if (tracePath) {
1186
+ let candidate = null;
1187
+ try {
1188
+ candidate = createRenderTrace(tracePath);
1189
+ restoreStdout = traceProcessStdout(candidate);
1190
+ activeRenderTrace = candidate;
1191
+ } catch {
1192
+ restoreStdout?.();
1193
+ restoreStdout = null;
1194
+ void candidate?.close().catch(() => {
1195
+ });
1196
+ activeRenderTrace = null;
1197
+ }
1198
+ } else activeRenderTrace = null;
1199
+ const trace = activeRenderTrace;
1200
+ if (trace && options.onFirstFrameCommit) trace.onFirstFrameCommit(options.onFirstFrameCommit);
1201
+ let firstFrameDelivered = false;
1202
+ let firstFrameSeq = 0;
1203
+ let firstFrameActive = false;
1204
+ let firstFrameWrote = false;
1205
+ if (!trace && options.onFirstFrameCommit) {
1206
+ const stdout = process.stdout;
1207
+ const original = stdout.write;
1208
+ const wrapped = function(...args) {
1209
+ const returned = Reflect.apply(original, this, args);
1210
+ if (firstFrameActive) firstFrameWrote = true;
1211
+ return returned;
1212
+ };
1213
+ stdout.write = wrapped;
1214
+ restoreFirstFrameStdout = () => {
1215
+ if (stdout.write === wrapped) stdout.write = original;
1216
+ };
1217
+ }
1218
+ const firstFrameOnlyObserver = {
1219
+ isEnabled: () => !firstFrameDelivered,
1220
+ beginFrame: () => {
1221
+ firstFrameSeq += 1;
1222
+ firstFrameActive = true;
1223
+ firstFrameWrote = false;
1224
+ return firstFrameSeq;
1225
+ },
1226
+ endFrame: (frame2) => {
1227
+ firstFrameActive = false;
1228
+ if (firstFrameDelivered || !firstFrameWrote) return;
1229
+ firstFrameDelivered = true;
1230
+ options.onFirstFrameCommit?.(frame2);
1231
+ restoreFirstFrameStdout?.();
1232
+ restoreFirstFrameStdout = null;
1233
+ },
1234
+ beginPhase: () => null,
1235
+ endPhase: () => {
1236
+ }
1237
+ };
1238
+ const primaryObserver = trace ?? (options.onFirstFrameCommit ? firstFrameOnlyObserver : null);
1239
+ let committedFrameSequence = 0;
1240
+ const frameWaiters = [];
1241
+ const renderObserver = {
1242
+ isEnabled: () => frameWaiters.length > 0 || primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
1243
+ beginFrame: (fields) => ({
1244
+ primary: primaryObserver?.beginFrame(fields),
1245
+ primaryActive: primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
1246
+ frameId: ++committedFrameSequence
1247
+ }),
1248
+ endFrame: (token) => {
1249
+ const frame2 = token;
1250
+ if (frame2.primaryActive) primaryObserver?.endFrame(frame2.primary);
1251
+ for (const waiter of frameWaiters.splice(0)) waiter.resolve(frame2.frameId);
1252
+ },
1253
+ beginPhase: (token, phase) => {
1254
+ const frame2 = token;
1255
+ return frame2.primaryActive ? primaryObserver?.beginPhase(frame2.primary, phase) : null;
1256
+ },
1257
+ endPhase: (token, phase, phaseToken) => {
1258
+ const frame2 = token;
1259
+ if (frame2.primaryActive) primaryObserver?.endPhase(frame2.primary, phase, phaseToken);
1260
+ }
1261
+ };
1262
+ const renderAdmission = {
1263
+ get blocked() {
1264
+ return backpressure?.blocked ?? false;
1265
+ },
1266
+ onWritable(listener) {
1267
+ if (backpressure) return backpressure.onWritable(listener);
1268
+ queueMicrotask(listener);
1269
+ return () => {
1270
+ };
1271
+ }
1272
+ };
1273
+ const setStreamPacingActive = (active) => {
1274
+ if (active) {
1275
+ backpressure ??= installStdoutBackpressureGate();
1276
+ return;
1277
+ }
1278
+ if (!backpressure) return;
1279
+ observedBackpressure ||= backpressure.observed;
1280
+ backpressure.restore();
1281
+ backpressure = null;
1282
+ };
1283
+ let instrumentationCleanupStarted = false;
1284
+ let instrumentationCleanupPromise = Promise.resolve();
1285
+ const cleanupInstrumentation = () => {
1286
+ if (instrumentationCleanupStarted) return instrumentationCleanupPromise;
1287
+ instrumentationCleanupStarted = true;
1288
+ const errors = [];
1289
+ const attempt = (operation) => {
1290
+ try {
1291
+ operation();
1292
+ } catch (error) {
1293
+ errors.push(error);
1294
+ }
1295
+ };
1296
+ attempt(() => setStreamPacingActive(false));
1297
+ attempt(() => restoreRoot?.());
1298
+ restoreRoot = null;
1299
+ attempt(() => restoreStdout?.());
1300
+ restoreStdout = null;
1301
+ attempt(() => restoreFirstFrameStdout?.());
1302
+ restoreFirstFrameStdout = null;
1303
+ if (activeRenderTrace === trace) activeRenderTrace = null;
1304
+ instrumentationCleanupPromise = (async () => {
1305
+ if (trace) {
1306
+ try {
1307
+ await trace.close();
1308
+ } catch (error) {
1309
+ errors.push(error);
1310
+ }
1311
+ }
1312
+ if (errors.length > 0) throw new AggregateError(errors, "interactive shell instrumentation cleanup failed");
1313
+ })();
1314
+ return instrumentationCleanupPromise;
1315
+ };
1316
+ let shell;
1317
+ try {
1318
+ setStreamPacingActive(options.streamPacingActive === true);
1319
+ shell = createInteractiveShell({
1320
+ createTerminal: options.testing?.createTerminal ?? (() => new ProcessTerminal()),
1321
+ createTui: (terminal) => options.testing?.createTui?.(terminal) ?? (options.tuiMode === "fullscreen" ? new InstrumentedTuiAltScreen(terminal, renderObserver, void 0, void 0, void 0, renderAdmission) : new InstrumentedTuiMainScreen(terminal, renderObserver, void 0, void 0, renderAdmission)),
1322
+ prepareRoot: (root) => {
1323
+ if (trace) restoreRoot = traceComponentRenders(root, trace);
1324
+ },
1325
+ onStop: cleanupInstrumentation
1326
+ });
1327
+ } catch (error) {
1328
+ void cleanupInstrumentation().catch(() => {
1329
+ });
1330
+ throw error;
1331
+ }
1332
+ return {
1333
+ ...shell,
1334
+ nextCommittedFrame() {
1335
+ return new Promise((resolve) => {
1336
+ frameWaiters.push({ resolve });
1337
+ });
1338
+ },
1339
+ async commitCurrentFrame(timeoutMs = 3e4) {
1340
+ return await settleLatestInteractiveFrame(backpressure, timeoutMs, async () => {
1341
+ const tui = shell.tui;
1342
+ const waiter = { resolve: () => {
1343
+ } };
1344
+ const frame2 = new Promise((resolve) => {
1345
+ waiter.resolve = resolve;
1346
+ frameWaiters.push(waiter);
1347
+ });
1348
+ try {
1349
+ tui.renderNow(false);
1350
+ } catch (error) {
1351
+ const index = frameWaiters.indexOf(waiter);
1352
+ if (index >= 0) frameWaiters.splice(index, 1);
1353
+ throw error;
1354
+ }
1355
+ return await frame2;
1356
+ });
1357
+ },
1358
+ hasObservedBackpressure: () => observedBackpressure || backpressure?.observed === true,
1359
+ setStreamPacingActive
1360
+ };
1361
+ }
1362
+
1363
+ // src/interactive/keybinding-manager.ts
1364
+ init_esm_shims();
1365
+
1366
+ // src/domains/config/keybindings.ts
1367
+ init_esm_shims();
1368
+ var CLIO_APP_KEYBINDINGS = {
1369
+ "clio.thinking.cycle": {
1370
+ defaultKeys: "shift+tab",
1371
+ description: "Cycle orchestrator thinking level"
1372
+ },
1373
+ "clio.exit": {
1374
+ defaultKeys: "ctrl+d",
1375
+ description: "Exit when the editor is empty"
1376
+ },
1377
+ "clio.status.toggle": {
1378
+ defaultKeys: "alt+u",
1379
+ description: "Toggle the footer dashboard (compact / expanded)"
1380
+ },
1381
+ "clio.session.tree": {
1382
+ defaultKeys: "alt+t",
1383
+ description: "Open the /tree navigator"
1384
+ },
1385
+ "clio.dispatchBoard.toggle": {
1386
+ defaultKeys: "alt+w",
1387
+ description: "Toggle the dispatch (workers) board overlay"
1388
+ },
1389
+ "clio.tasks.open": {
1390
+ // Approved application-boundary override of pi-tui editor word-back.
1391
+ defaultKeys: "alt+b",
1392
+ description: "Open the composite session and operator task board"
1393
+ },
1394
+ "clio.decisions.open": {
1395
+ // Approved application-boundary override of pi-tui editor word-delete.
1396
+ defaultKeys: "alt+d",
1397
+ description: "Open the settled interview decision board"
1398
+ },
1399
+ "clio.dispatch.background": {
1400
+ // Ctrl+B alone is pi-tui's editor cursor-left, so the Claude Code chord
1401
+ // cannot be the primary here. Alt+S ("send to background") keeps the app
1402
+ // scheme and earns the Ctrl+G leader fallback, which only alt+<letter>
1403
+ // bindings get; Ctrl+Alt+B stays for the b-for-background muscle memory.
1404
+ defaultKeys: ["alt+s", "ctrl+alt+b"],
1405
+ description: "Send the running attached dispatch to the background as a detached batch"
1406
+ },
1407
+ "clio.model.select": {
1408
+ defaultKeys: "alt+l",
1409
+ description: "Open the model + targets selector"
1410
+ },
1411
+ "clio.model.cycleForward": {
1412
+ defaultKeys: "alt+j",
1413
+ description: "Cycle to next scoped model"
1414
+ },
1415
+ "clio.model.cycleBackward": {
1416
+ defaultKeys: "alt+k",
1417
+ description: "Cycle to previous scoped model"
1418
+ },
1419
+ "clio.tool.expand": {
1420
+ defaultKeys: "alt+o",
1421
+ description: "Fold or unfold the newest tool call or worker block between its one-line summary and full details (no effect while /output verbose pins them open)"
1422
+ },
1423
+ "clio.tool.expandAll": {
1424
+ // Alt+Shift+letter is commonly consumed by OS keyboard-layout switching.
1425
+ // Keep it discoverable, but pair it with the legacy-safe Ctrl+Alt form.
1426
+ defaultKeys: ["ctrl+alt+o", "alt+shift+o"],
1427
+ description: "Fold or unfold every tool call and worker block at once (no effect while /output verbose pins them open)"
1428
+ },
1429
+ "clio.tool.liveOutput": {
1430
+ defaultKeys: "alt+p",
1431
+ description: "Toggle streaming partial tool output in expanded tool bodies"
1432
+ },
1433
+ "clio.thinking.expand": {
1434
+ defaultKeys: "alt+r",
1435
+ description: "Toggle the latest thinking block between hidden marker and full body (no effect while /output verbose pins it open)"
1436
+ },
1437
+ "clio.thinking.expandAll": {
1438
+ // Ctrl+Alt+R is the fallback for terminals/OSes that do not forward
1439
+ // Alt+Shift+R as a distinct key event.
1440
+ defaultKeys: ["ctrl+alt+r", "alt+shift+r"],
1441
+ description: "Toggle all thinking blocks between hidden markers and full bodies (no effect while /output verbose pins them open)"
1442
+ },
1443
+ "clio.editor.external": {
1444
+ defaultKeys: "alt+g",
1445
+ description: "Open the current input in an external editor"
1446
+ },
1447
+ "clio.message.followUp": {
1448
+ defaultKeys: "alt+enter",
1449
+ description: "End of turn: queue the current input for delivery when the active run settles (Enter delivers it at the next slot, between tool batches)"
1450
+ },
1451
+ "clio.message.interrupt": {
1452
+ // Alt+I keeps the app scheme and earns the Ctrl+G leader fallback. A
1453
+ // Ctrl+Enter chord was rejected because legacy terminals send it as a
1454
+ // plain Enter, which would turn every send into a cancel.
1455
+ defaultKeys: "alt+i",
1456
+ description: "Interrupt: cancel the active run and deliver the current input now (refused while an attached dispatch runs or a permission ask is parked; the input then queues for the next slot)"
1457
+ },
1458
+ "clio.message.dequeue": {
1459
+ defaultKeys: "alt+up",
1460
+ description: "Restore queued steering and follow-up messages to the editor"
1461
+ },
1462
+ "clio.notifications.dismiss": {
1463
+ defaultKeys: "alt+x",
1464
+ description: "Dismiss footer notifications"
1465
+ },
1466
+ "clio.leader": {
1467
+ defaultKeys: "ctrl+g",
1468
+ description: "Start portable leader-key fallback for Alt shortcuts"
1469
+ }
1470
+ };
1471
+ var CLIO_KEYBINDINGS = {
1472
+ ...TUI_KEYBINDINGS,
1473
+ "tui.editor.historyPrevious": {
1474
+ ...TUI_KEYBINDINGS["tui.editor.historyPrevious"],
1475
+ defaultKeys: "ctrl+p"
1476
+ },
1477
+ "tui.editor.historyNext": {
1478
+ ...TUI_KEYBINDINGS["tui.editor.historyNext"],
1479
+ defaultKeys: "ctrl+n"
1480
+ },
1481
+ ...CLIO_APP_KEYBINDINGS
1482
+ };
1483
+ var CLIO_APP_KEYBINDING_IDS = Object.keys(CLIO_APP_KEYBINDINGS);
1484
+
1485
+ // src/interactive/keybinding-manager.ts
1486
+ var BASE_SPECIAL_KEYS = /* @__PURE__ */ new Set([
1487
+ "escape",
1488
+ "esc",
1489
+ "enter",
1490
+ "return",
1491
+ "tab",
1492
+ "space",
1493
+ "backspace",
1494
+ "delete",
1495
+ "insert",
1496
+ "clear",
1497
+ "home",
1498
+ "end",
1499
+ "pageup",
1500
+ "pagedown",
1501
+ "up",
1502
+ "down",
1503
+ "left",
1504
+ "right",
1505
+ "f1",
1506
+ "f2",
1507
+ "f3",
1508
+ "f4",
1509
+ "f5",
1510
+ "f6",
1511
+ "f7",
1512
+ "f8",
1513
+ "f9",
1514
+ "f10",
1515
+ "f11",
1516
+ "f12"
1517
+ ]);
1518
+ var BASE_SYMBOL_KEYS = /* @__PURE__ */ new Set([
1519
+ "`",
1520
+ "-",
1521
+ "=",
1522
+ "[",
1523
+ "]",
1524
+ "\\",
1525
+ ";",
1526
+ "'",
1527
+ ",",
1528
+ ".",
1529
+ "/",
1530
+ "!",
1531
+ "@",
1532
+ "#",
1533
+ "$",
1534
+ "%",
1535
+ "^",
1536
+ "&",
1537
+ "*",
1538
+ "(",
1539
+ ")",
1540
+ "_",
1541
+ "+",
1542
+ "|",
1543
+ "~",
1544
+ "{",
1545
+ "}",
1546
+ ":",
1547
+ "<",
1548
+ ">",
1549
+ "?"
1550
+ ]);
1551
+ var MODIFIERS = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "super"]);
1552
+ function isValidKeyId(keyId) {
1553
+ if (typeof keyId !== "string" || keyId.length === 0) return false;
1554
+ const parts = keyId.toLowerCase().split("+");
1555
+ if (parts.length === 0) return false;
1556
+ const base = parts[parts.length - 1];
1557
+ if (!base) return false;
1558
+ const mods = parts.slice(0, -1);
1559
+ const seen = /* @__PURE__ */ new Set();
1560
+ for (const mod of mods) {
1561
+ if (!MODIFIERS.has(mod)) return false;
1562
+ if (seen.has(mod)) return false;
1563
+ seen.add(mod);
1564
+ }
1565
+ if (base.length === 1) {
1566
+ const ch = base.charCodeAt(0);
1567
+ const isLetter = ch >= 97 && ch <= 122;
1568
+ const isDigit = ch >= 48 && ch <= 57;
1569
+ return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
1570
+ }
1571
+ return BASE_SPECIAL_KEYS.has(base);
1572
+ }
1573
+ function validateKeybindings(raw) {
1574
+ const valid = {};
1575
+ const invalid = [];
1576
+ for (const [id, value] of Object.entries(raw)) {
1577
+ if (typeof value === "string") {
1578
+ if (value.length === 0) continue;
1579
+ if (isValidKeyId(value)) {
1580
+ valid[id] = value;
1581
+ } else {
1582
+ invalid.push({ id, keys: [value] });
1583
+ }
1584
+ continue;
1585
+ }
1586
+ if (Array.isArray(value)) {
1587
+ const accepted = [];
1588
+ const rejected = [];
1589
+ for (const entry of value) {
1590
+ if (typeof entry !== "string" || entry.length === 0) continue;
1591
+ if (isValidKeyId(entry)) {
1592
+ accepted.push(entry);
1593
+ } else {
1594
+ rejected.push(entry);
1595
+ }
1596
+ }
1597
+ if (accepted.length > 0) valid[id] = accepted;
1598
+ if (rejected.length > 0) invalid.push({ id, keys: rejected });
1599
+ }
1600
+ }
1601
+ return { valid, invalid };
1602
+ }
1603
+ function formatInvalidKeybindingNotice(invalid) {
1604
+ const count = invalid.reduce((sum, entry) => sum + entry.keys.length, 0);
1605
+ const detail = invalid.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}"`)).join(", ");
1606
+ return `Clio Coder: ${count} invalid keybinding${count === 1 ? "" : "s"} in settings.yaml (defaults kept): ${detail}. Fix settings.yaml or run \`clio-coder doctor\`.
1607
+ `;
1608
+ }
1609
+ function envValue(env, key) {
1610
+ return env[key]?.trim() ?? "";
1611
+ }
1612
+ function detectTerminalKeySupport(env = process.env) {
1613
+ const term = envValue(env, "TERM");
1614
+ const termProgram = envValue(env, "TERM_PROGRAM");
1615
+ const kittyWindow = envValue(env, "KITTY_WINDOW_ID");
1616
+ const normalized = `${term} ${termProgram}`.toLowerCase();
1617
+ if (kittyWindow.length > 0 || normalized.includes("xterm-kitty") || normalized.includes("kitty")) {
1618
+ return { name: "kitty", supportsCsiU: true, reason: "Kitty keyboard protocol detected", altLetterMode: "meta" };
1619
+ }
1620
+ if (normalized.includes("wezterm") || normalized.includes("ghostty")) {
1621
+ return {
1622
+ name: termProgram || term || "modern terminal",
1623
+ supportsCsiU: true,
1624
+ reason: "CSI-u capable terminal",
1625
+ altLetterMode: "meta"
1626
+ };
1627
+ }
1628
+ if (termProgram === "Apple_Terminal") {
1629
+ return {
1630
+ name: termProgram,
1631
+ supportsCsiU: false,
1632
+ reason: "Terminal.app sends Option-letter as composed text unless Use Option as Meta key is enabled",
1633
+ altLetterMode: "text"
1634
+ };
1635
+ }
1636
+ if (termProgram === "iTerm.app") {
1637
+ return {
1638
+ name: termProgram,
1639
+ supportsCsiU: true,
1640
+ reason: "iTerm2 reports modified keys as Meta or CSI-u",
1641
+ altLetterMode: "meta"
1642
+ };
1643
+ }
1644
+ if (termProgram.toLowerCase() === "vscode") {
1645
+ return {
1646
+ name: "vscode",
1647
+ supportsCsiU: false,
1648
+ reason: "VS Code terminal does not reliably emit CSI-u",
1649
+ altLetterMode: "meta",
1650
+ ideReservedKeys: ["ctrl+p", "shift+ctrl+p", "ctrl+l"]
1651
+ };
1652
+ }
1653
+ if (term.startsWith("screen") || term.startsWith("tmux")) {
1654
+ return { name: term, supportsCsiU: false, reason: "terminal multiplexer may block CSI-u", altLetterMode: "meta" };
1655
+ }
1656
+ return {
1657
+ name: termProgram || term || "legacy terminal",
1658
+ supportsCsiU: false,
1659
+ reason: "CSI-u support not detected",
1660
+ altLetterMode: "meta"
1661
+ };
1662
+ }
1663
+ function keyRequiresCsiU(keyId) {
1664
+ const parts = keyId.toLowerCase().split("+");
1665
+ if (parts.length < 3) return false;
1666
+ const base = parts[parts.length - 1] ?? "";
1667
+ const modifiers = new Set(parts.slice(0, -1));
1668
+ if (!modifiers.has("shift") || !modifiers.has("ctrl")) return false;
1669
+ if (base.length !== 1) return false;
1670
+ const code = base.charCodeAt(0);
1671
+ const isLetter = code >= 97 && code <= 122;
1672
+ const isDigit = code >= 48 && code <= 57;
1673
+ return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
1674
+ }
1675
+ function normalizeBindingValue(value) {
1676
+ if (value === void 0) return [];
1677
+ return (Array.isArray(value) ? value : [value]).map(String);
1678
+ }
1679
+ function defaultBindingValue(id) {
1680
+ const value = CLIO_APP_KEYBINDINGS[id].defaultKeys;
1681
+ return normalizeBindingValue(value);
1682
+ }
1683
+ function normalizeKeyForRisk(keyId) {
1684
+ return keyId.toLowerCase().replace(/^ctrl\+shift\+/, "shift+ctrl+");
1685
+ }
1686
+ function altLetterBase(keyId) {
1687
+ const parts = keyId.toLowerCase().split("+");
1688
+ if (parts.length !== 2 || parts[0] !== "alt") return null;
1689
+ const base = parts[1] ?? "";
1690
+ return base.length === 1 && base >= "a" && base <= "z" ? base : null;
1691
+ }
1692
+ function keyUsesAltLetter(keyId) {
1693
+ return altLetterBase(keyId) !== null;
1694
+ }
1695
+ function terminalReservedReason(keyId) {
1696
+ const key = normalizeKeyForRisk(keyId);
1697
+ if (key === "ctrl+s" || key === "ctrl+q") return "terminal flow control may intercept this chord";
1698
+ if (key === "ctrl+z") return "shell job control may suspend the process";
1699
+ return null;
1700
+ }
1701
+ function keyRiskReason(keyId, support) {
1702
+ const key = normalizeKeyForRisk(keyId);
1703
+ if (!support.supportsCsiU && keyRequiresCsiU(key)) return `needs CSI-u; ${support.reason}`;
1704
+ if (support.altLetterMode === "text" && keyUsesAltLetter(key)) return support.reason;
1705
+ if (support.ideReservedKeys?.map(normalizeKeyForRisk).includes(key)) return `${support.name} may reserve this chord`;
1706
+ return terminalReservedReason(key);
1707
+ }
1708
+ var MACOS_OPTION_DEFAULT_WARNING_ID = "clio.macos.option-letter.defaults";
1709
+ function detectPlatformKeybindingWarnings(userBindings, support = detectTerminalKeySupport()) {
1710
+ const warnings = [];
1711
+ const macosDefaultAltKeys = [];
1712
+ for (const id of CLIO_APP_KEYBINDING_IDS) {
1713
+ const userValue = userBindings[id];
1714
+ const source = userValue === void 0 ? "default" : "user";
1715
+ const keys = userValue === void 0 ? defaultBindingValue(id) : normalizeBindingValue(userValue);
1716
+ const risky = keys.filter((key) => keyRiskReason(key, support) !== null);
1717
+ if (risky.length === 0) continue;
1718
+ const firstReason = keyRiskReason(risky[0] ?? "", support) ?? support.reason;
1719
+ if (source === "default" && support.name === "Apple_Terminal" && risky.every(keyUsesAltLetter)) {
1720
+ macosDefaultAltKeys.push(...risky);
1721
+ continue;
1722
+ }
1723
+ warnings.push({ id, keys: risky, terminal: support.name, reason: firstReason, source });
1724
+ }
1725
+ if (macosDefaultAltKeys.length > 0) {
1726
+ warnings.unshift({
1727
+ id: MACOS_OPTION_DEFAULT_WARNING_ID,
1728
+ keys: [...new Set(macosDefaultAltKeys)],
1729
+ terminal: support.name,
1730
+ reason: support.reason,
1731
+ source: "default"
1732
+ });
1733
+ }
1734
+ return warnings;
1735
+ }
1736
+ function isMacosOptionDefaultWarning(warning) {
1737
+ return warning.id === MACOS_OPTION_DEFAULT_WARNING_ID;
1738
+ }
1739
+ function formatPlatformKeybindingNotice(warnings) {
1740
+ const macosOption = warnings.find(isMacosOptionDefaultWarning);
1741
+ if (macosOption && warnings.length === 1) {
1742
+ const keys = macosOption.keys.map((key) => {
1743
+ const base = altLetterBase(key);
1744
+ return base ? `Alt+${base.toUpperCase()}` : key;
1745
+ }).join(", ");
1746
+ return `Clio keybinding notice: Terminal.app may not send Option-letter shortcuts by default (${keys}). Enable Use Option as Meta key in Settings \u25B8 Profiles \u25B8 Keyboard for native Alt, or use Ctrl+G then the shortcut letter, slash commands (/help lists commands), and /help.
1747
+ `;
1748
+ }
1749
+ const count = warnings.reduce((sum, entry) => sum + entry.keys.length, 0);
1750
+ const detail = warnings.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}" (${entry.source}, ${entry.reason})`)).join(", ");
1751
+ return `Clio keybinding notice: ${count} keybinding${count === 1 ? "" : "s"} may not fire reliably in this terminal: ${detail}. Rebind in settings.yaml or inspect /help.
1752
+ `;
1753
+ }
1754
+ function joinKeys(keys) {
1755
+ if (keys.length === 0) return "(unbound)";
1756
+ if (keys.length === 1) return String(keys[0]);
1757
+ return keys.join(" / ");
1758
+ }
1759
+ function deriveLeaderTargets(inner) {
1760
+ const targets = [];
1761
+ for (const id of CLIO_APP_KEYBINDING_IDS) {
1762
+ for (const key of inner.getKeys(id)) {
1763
+ const base = altLetterBase(String(key));
1764
+ if (base) targets.push({ key: base, id });
1765
+ }
1766
+ }
1767
+ return targets;
1768
+ }
1769
+ function buildManager(inner, invalid, platformWarnings) {
1770
+ const frozen = invalid.map((entry) => ({ id: entry.id, keys: [...entry.keys] }));
1771
+ const frozenPlatformWarnings = platformWarnings.map((entry) => ({
1772
+ id: entry.id,
1773
+ keys: [...entry.keys],
1774
+ terminal: entry.terminal,
1775
+ reason: entry.reason,
1776
+ source: entry.source
1777
+ }));
1778
+ const frozenLeaderTargets = deriveLeaderTargets(inner).map((entry) => ({ ...entry }));
1779
+ return {
1780
+ matches(data, id) {
1781
+ return inner.matches(data, id);
1782
+ },
1783
+ getKeys(id) {
1784
+ return inner.getKeys(id);
1785
+ },
1786
+ getDescription(id) {
1787
+ return inner.getDefinition(id).description ?? "";
1788
+ },
1789
+ getConflicts() {
1790
+ return inner.getConflicts();
1791
+ },
1792
+ overrideCount() {
1793
+ return Object.keys(inner.getUserBindings()).length;
1794
+ },
1795
+ invalidCount() {
1796
+ return frozen.reduce((sum, entry) => sum + entry.keys.length, 0);
1797
+ },
1798
+ invalidBindings() {
1799
+ return frozen;
1800
+ },
1801
+ platformWarnings() {
1802
+ return frozenPlatformWarnings;
1803
+ },
1804
+ leaderTargets() {
1805
+ return frozenLeaderTargets;
1806
+ },
1807
+ hotkeyEntries() {
1808
+ const userBindings = inner.getUserBindings();
1809
+ return CLIO_APP_KEYBINDING_IDS.map((id) => ({
1810
+ id,
1811
+ keys: joinKeys(inner.getKeys(id)),
1812
+ description: inner.getDefinition(id).description ?? "",
1813
+ source: userBindings[id] === void 0 ? "default" : "user"
1814
+ }));
1815
+ }
1816
+ };
1817
+ }
1818
+ function createKeybindingManager(settings, env = process.env) {
1819
+ const { valid, invalid } = validateKeybindings(settings.keybindings ?? {});
1820
+ const inner = new KeybindingsManager(CLIO_KEYBINDINGS, valid);
1821
+ setKeybindings(inner);
1822
+ return buildManager(inner, invalid, detectPlatformKeybindingWarnings(valid, detectTerminalKeySupport(env)));
1823
+ }
1824
+
1825
+ export {
1826
+ SelectList,
1827
+ createAgentProgress,
1828
+ Box,
1829
+ CombinedAutocompleteProvider,
1830
+ Container,
1831
+ fuzzyFilter,
1832
+ getKeybindings,
1833
+ Input,
1834
+ isKeyRelease,
1835
+ Markdown,
1836
+ Marked,
1837
+ matchesKey,
1838
+ ScrollView,
1839
+ stripTerminalSequences,
1840
+ Text,
1841
+ truncateToWidth,
1842
+ VStack,
1843
+ visibleWidth,
1844
+ wrapTextWithAnsi,
1845
+ SGR_RESET,
1846
+ SGR_DIM,
1847
+ fgSequence,
1848
+ GLYPH,
1849
+ spinnerFrame,
1850
+ brandMark,
1851
+ dotSep,
1852
+ barSep,
1853
+ sectionTag,
1854
+ screenTitle,
1855
+ listGroupHeader,
1856
+ joinChips,
1857
+ joinSections,
1858
+ markdownTheme,
1859
+ selectListTheme,
1860
+ settingsListTheme,
1861
+ abbreviateModelId,
1862
+ formatTargetLabel,
1863
+ formatCompactMs,
1864
+ formatContextPercent,
1865
+ collapseHomePath,
1866
+ padAnsi,
1867
+ fitUnits,
1868
+ rule,
1869
+ frame,
1870
+ innerDivider,
1871
+ clioTheme,
1872
+ ClioEditor,
1873
+ getActiveRenderTrace,
1874
+ createProcessInteractiveShell,
1875
+ validateKeybindings,
1876
+ formatInvalidKeybindingNotice,
1877
+ detectTerminalKeySupport,
1878
+ detectPlatformKeybindingWarnings,
1879
+ formatPlatformKeybindingNotice,
1880
+ createKeybindingManager
1881
+ };
1882
+ //# sourceMappingURL=chunk-MAW544W2.js.map