@tryglen/cli 0.37.1 → 0.38.1

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 (798) hide show
  1. package/README.md +21 -4
  2. package/dist/_generated/contract/index.js +3 -0
  3. package/dist/_generated/contract/index.js.map +1 -0
  4. package/dist/_generated/contract/procedures.gen.js +34 -0
  5. package/dist/_generated/contract/procedures.gen.js.map +1 -0
  6. package/dist/_generated/contract/types.gen.js +3 -0
  7. package/dist/_generated/contract/types.gen.js.map +1 -0
  8. package/dist/_generated/contract/zod.gen.js +799 -0
  9. package/dist/_generated/contract/zod.gen.js.map +1 -0
  10. package/dist/bin.js +137 -560
  11. package/dist/bin.js.map +1 -1
  12. package/dist/clients/agents/agent-bin.js +67 -0
  13. package/dist/clients/agents/agent-bin.js.map +1 -0
  14. package/dist/clients/agents/agent-path-overrides.js +23 -0
  15. package/dist/clients/agents/agent-path-overrides.js.map +1 -0
  16. package/dist/clients/agents/agents-table.js +91 -0
  17. package/dist/clients/agents/agents-table.js.map +1 -0
  18. package/dist/{_utils → clients/agents}/managed-block.js +8 -4
  19. package/dist/clients/agents/managed-block.js.map +1 -0
  20. package/dist/clients/agents/normalize-transcript-timestamp.js.map +1 -0
  21. package/dist/clients/agents/plugin-status.js +74 -0
  22. package/dist/clients/agents/plugin-status.js.map +1 -0
  23. package/dist/clients/agents/run-agent-steps.js +21 -0
  24. package/dist/clients/agents/run-agent-steps.js.map +1 -0
  25. package/dist/{_utils → clients/claude}/extract-claude-segments.js +9 -5
  26. package/dist/clients/claude/extract-claude-segments.js.map +1 -0
  27. package/dist/clients/claude/parse-claude-transcript.js +114 -0
  28. package/dist/clients/claude/parse-claude-transcript.js.map +1 -0
  29. package/dist/clients/codex/codex-app-server.js +102 -0
  30. package/dist/clients/codex/codex-app-server.js.map +1 -0
  31. package/dist/clients/codex/codex-hooks-file.js +65 -0
  32. package/dist/clients/codex/codex-hooks-file.js.map +1 -0
  33. package/dist/clients/codex/codex-hooks-merge.js +9 -0
  34. package/dist/clients/codex/codex-hooks-merge.js.map +1 -0
  35. package/dist/clients/codex/codex-hooks-setup.js +167 -0
  36. package/dist/clients/codex/codex-hooks-setup.js.map +1 -0
  37. package/dist/clients/codex/codex-paths.js +13 -0
  38. package/dist/clients/codex/codex-paths.js.map +1 -0
  39. package/dist/clients/codex/codex-repair-trace.js +36 -0
  40. package/dist/clients/codex/codex-repair-trace.js.map +1 -0
  41. package/dist/clients/codex/codex-rules-setup.js +27 -0
  42. package/dist/clients/codex/codex-rules-setup.js.map +1 -0
  43. package/dist/{_utils → clients/codex}/codex-trust-toml.js +6 -5
  44. package/dist/clients/codex/codex-trust-toml.js.map +1 -0
  45. package/dist/clients/codex/extract-codex-segments.js +64 -0
  46. package/dist/clients/codex/extract-codex-segments.js.map +1 -0
  47. package/dist/clients/codex/parse-codex-transcript.js +123 -0
  48. package/dist/clients/codex/parse-codex-transcript.js.map +1 -0
  49. package/dist/clients/cursor/parse-cursor-db.js +185 -0
  50. package/dist/clients/cursor/parse-cursor-db.js.map +1 -0
  51. package/dist/clients/git/canonical-remote-url.js +13 -0
  52. package/dist/clients/git/canonical-remote-url.js.map +1 -0
  53. package/dist/clients/git/git-context.js +60 -0
  54. package/dist/clients/git/git-context.js.map +1 -0
  55. package/dist/clients/git/git-hook-setup.js +128 -0
  56. package/dist/clients/git/git-hook-setup.js.map +1 -0
  57. package/dist/{_utils → clients/git}/pr-review-link.js +5 -4
  58. package/dist/clients/git/pr-review-link.js.map +1 -0
  59. package/dist/clients/glen-api/config.js +11 -0
  60. package/dist/clients/glen-api/config.js.map +1 -0
  61. package/dist/clients/glen-api/glen-api.js +199 -0
  62. package/dist/clients/glen-api/glen-api.js.map +1 -0
  63. package/dist/{_utils → clients/glen-api}/glen-headers.js +1 -1
  64. package/dist/clients/glen-api/glen-headers.js.map +1 -0
  65. package/dist/clients/glen-api/refresh-control-state.js +18 -0
  66. package/dist/clients/glen-api/refresh-control-state.js.map +1 -0
  67. package/dist/clients/glen-api/report-cli-install.js +20 -0
  68. package/dist/clients/glen-api/report-cli-install.js.map +1 -0
  69. package/dist/clients/glen-api/sync-mode-from-server.js +45 -0
  70. package/dist/clients/glen-api/sync-mode-from-server.js.map +1 -0
  71. package/dist/clients/indicator/indicator-app.js +127 -0
  72. package/dist/clients/indicator/indicator-app.js.map +1 -0
  73. package/dist/clients/indicator/indicator-health.js +40 -0
  74. package/dist/clients/indicator/indicator-health.js.map +1 -0
  75. package/dist/clients/jcode/jcode-bundle.js +19 -0
  76. package/dist/clients/jcode/jcode-bundle.js.map +1 -0
  77. package/dist/clients/jcode/jcode-event.js +74 -0
  78. package/dist/clients/jcode/jcode-event.js.map +1 -0
  79. package/dist/{_utils → clients/jcode}/jcode-hook-lines.js +1 -1
  80. package/dist/clients/jcode/jcode-hook-lines.js.map +1 -0
  81. package/dist/{_utils → clients/jcode}/jcode-hooks-toml.js +21 -29
  82. package/dist/clients/jcode/jcode-hooks-toml.js.map +1 -0
  83. package/dist/clients/jcode/jcode-paths.js +14 -0
  84. package/dist/clients/jcode/jcode-paths.js.map +1 -0
  85. package/dist/clients/jcode/jcode-setup.js +148 -0
  86. package/dist/clients/jcode/jcode-setup.js.map +1 -0
  87. package/dist/clients/jcode/jcode-skills-sync.js +84 -0
  88. package/dist/clients/jcode/jcode-skills-sync.js.map +1 -0
  89. package/dist/{_utils → clients/jcode}/parse-jcode-session.js +38 -35
  90. package/dist/clients/jcode/parse-jcode-session.js.map +1 -0
  91. package/dist/clients/npm/semver-newer.js +8 -0
  92. package/dist/clients/npm/semver-newer.js.map +1 -0
  93. package/dist/clients/npm/update.js +147 -0
  94. package/dist/clients/npm/update.js.map +1 -0
  95. package/dist/{_utils → clients/pi}/extract-pi-segments.js +7 -3
  96. package/dist/clients/pi/extract-pi-segments.js.map +1 -0
  97. package/dist/clients/pi/parse-pi-transcript.js +149 -0
  98. package/dist/clients/pi/parse-pi-transcript.js.map +1 -0
  99. package/dist/clients/telemetry/send-events.js +32 -0
  100. package/dist/clients/telemetry/send-events.js.map +1 -0
  101. package/dist/commands/_utils/forget-or-restore-observation-or-message.js +41 -0
  102. package/dist/commands/_utils/forget-or-restore-observation-or-message.js.map +1 -0
  103. package/dist/commands/artifact/_utils/explain-artifact-error.js +31 -0
  104. package/dist/commands/artifact/_utils/explain-artifact-error.js.map +1 -0
  105. package/dist/commands/artifact/_utils/require-slug.js +14 -0
  106. package/dist/commands/artifact/_utils/require-slug.js.map +1 -0
  107. package/dist/commands/artifact/artifact.options.js +43 -0
  108. package/dist/commands/artifact/artifact.options.js.map +1 -0
  109. package/dist/commands/artifact/create.js +87 -0
  110. package/dist/commands/artifact/create.js.map +1 -0
  111. package/dist/commands/artifact/delete.js +18 -0
  112. package/dist/commands/artifact/delete.js.map +1 -0
  113. package/dist/commands/artifact/get.js +21 -0
  114. package/dist/commands/artifact/get.js.map +1 -0
  115. package/dist/commands/artifact/list.js +4 -0
  116. package/dist/commands/artifact/list.js.map +1 -0
  117. package/dist/commands/artifact/search.js +25 -0
  118. package/dist/commands/artifact/search.js.map +1 -0
  119. package/dist/commands/artifact/share.js +42 -0
  120. package/dist/commands/artifact/share.js.map +1 -0
  121. package/dist/commands/code-search/code-search.options.js +10 -0
  122. package/dist/commands/code-search/code-search.options.js.map +1 -0
  123. package/dist/commands/code-search/index.js +106 -0
  124. package/dist/commands/code-search/index.js.map +1 -0
  125. package/dist/commands/dependency/dependency.options.js +10 -0
  126. package/dist/commands/dependency/dependency.options.js.map +1 -0
  127. package/dist/commands/dependency/index.js +25 -0
  128. package/dist/commands/dependency/index.js.map +1 -0
  129. package/dist/{_utils → commands/doctor/_utils}/ingest-diagnosis.js +16 -17
  130. package/dist/commands/doctor/_utils/ingest-diagnosis.js.map +1 -0
  131. package/dist/commands/doctor/_utils/login-check.js +48 -0
  132. package/dist/commands/doctor/_utils/login-check.js.map +1 -0
  133. package/dist/commands/doctor/doctor.options.js +17 -0
  134. package/dist/commands/doctor/doctor.options.js.map +1 -0
  135. package/dist/commands/doctor/index.js +366 -0
  136. package/dist/commands/doctor/index.js.map +1 -0
  137. package/dist/commands/feedback/feedback.options.js +82 -0
  138. package/dist/commands/feedback/feedback.options.js.map +1 -0
  139. package/dist/commands/feedback/index.js +64 -0
  140. package/dist/commands/feedback/index.js.map +1 -0
  141. package/dist/commands/forget/forget.options.js +12 -0
  142. package/dist/commands/forget/forget.options.js.map +1 -0
  143. package/dist/commands/forget/index.js +30 -0
  144. package/dist/commands/forget/index.js.map +1 -0
  145. package/dist/commands/git-hooks/git-hooks.options.js +17 -0
  146. package/dist/commands/git-hooks/git-hooks.options.js.map +1 -0
  147. package/dist/commands/git-hooks/index.js +21 -0
  148. package/dist/commands/git-hooks/index.js.map +1 -0
  149. package/dist/commands/git-hooks/write-commit-trailer.js +38 -0
  150. package/dist/commands/git-hooks/write-commit-trailer.js.map +1 -0
  151. package/dist/commands/import/_utils/collect-import-files.js +54 -0
  152. package/dist/commands/import/_utils/collect-import-files.js.map +1 -0
  153. package/dist/commands/import/_utils/detect-transcript-format.js +46 -0
  154. package/dist/commands/import/_utils/detect-transcript-format.js.map +1 -0
  155. package/dist/{_utils → commands/import/_utils}/parse-harbor-atif.js +28 -51
  156. package/dist/commands/import/_utils/parse-harbor-atif.js.map +1 -0
  157. package/dist/{_utils → commands/import/_utils}/resolve-import-workspace.js +12 -17
  158. package/dist/commands/import/_utils/resolve-import-workspace.js.map +1 -0
  159. package/dist/{_utils → commands/import/_utils}/transcript-turns.js +47 -52
  160. package/dist/commands/import/_utils/transcript-turns.js.map +1 -0
  161. package/dist/commands/import/import.options.js +18 -0
  162. package/dist/commands/import/import.options.js.map +1 -0
  163. package/dist/commands/import/import.schema.js +28 -0
  164. package/dist/commands/import/import.schema.js.map +1 -0
  165. package/dist/commands/import/index.js +284 -0
  166. package/dist/commands/import/index.js.map +1 -0
  167. package/dist/commands/incognito/incognito.options.js +7 -0
  168. package/dist/commands/incognito/incognito.options.js.map +1 -0
  169. package/dist/commands/incognito/index.js +5 -0
  170. package/dist/commands/incognito/index.js.map +1 -0
  171. package/dist/commands/indicator/index.js +59 -0
  172. package/dist/commands/indicator/index.js.map +1 -0
  173. package/dist/commands/indicator/indicator.options.js +7 -0
  174. package/dist/commands/indicator/indicator.options.js.map +1 -0
  175. package/dist/commands/ingest/_utils/agent-adapter.js +37 -0
  176. package/dist/commands/ingest/_utils/agent-adapter.js.map +1 -0
  177. package/dist/{_utils → commands/ingest/_utils}/build-turn-body.js +8 -6
  178. package/dist/commands/ingest/_utils/build-turn-body.js.map +1 -0
  179. package/dist/{_utils → commands/ingest/_utils}/format-turn-nudges.js +14 -31
  180. package/dist/commands/ingest/_utils/format-turn-nudges.js.map +1 -0
  181. package/dist/commands/ingest/_utils/idempotency-key.js +4 -0
  182. package/dist/commands/ingest/_utils/idempotency-key.js.map +1 -0
  183. package/dist/commands/ingest/_utils/ingest-failure-memo.js +58 -0
  184. package/dist/commands/ingest/_utils/ingest-failure-memo.js.map +1 -0
  185. package/dist/commands/ingest/_utils/parse-transcript.js +76 -0
  186. package/dist/commands/ingest/_utils/parse-transcript.js.map +1 -0
  187. package/dist/commands/ingest/_utils/turn-cache.js +73 -0
  188. package/dist/commands/ingest/_utils/turn-cache.js.map +1 -0
  189. package/dist/commands/ingest/index.js +379 -0
  190. package/dist/commands/ingest/index.js.map +1 -0
  191. package/dist/commands/ingest/ingest.options.js +13 -0
  192. package/dist/commands/ingest/ingest.options.js.map +1 -0
  193. package/dist/commands/install/_utils/claude-statusline.js +58 -0
  194. package/dist/commands/install/_utils/claude-statusline.js.map +1 -0
  195. package/dist/commands/install/_utils/codex-post-install.js +56 -0
  196. package/dist/commands/install/_utils/codex-post-install.js.map +1 -0
  197. package/dist/{_utils → commands/install/_utils}/ensure-global-cli.js +49 -52
  198. package/dist/commands/install/_utils/ensure-global-cli.js.map +1 -0
  199. package/dist/commands/install/_utils/finish-install.js +67 -0
  200. package/dist/commands/install/_utils/finish-install.js.map +1 -0
  201. package/dist/commands/install/_utils/jcode-install.js +29 -0
  202. package/dist/commands/install/_utils/jcode-install.js.map +1 -0
  203. package/dist/{_utils → commands/install/_utils}/npm-error-cause.js +1 -2
  204. package/dist/commands/install/_utils/npm-error-cause.js.map +1 -0
  205. package/dist/commands/install/_utils/prepare-machine.js +85 -0
  206. package/dist/commands/install/_utils/prepare-machine.js.map +1 -0
  207. package/dist/commands/install/codex-hooks-repair.js +17 -0
  208. package/dist/commands/install/codex-hooks-repair.js.map +1 -0
  209. package/dist/commands/install/index.js +186 -0
  210. package/dist/commands/install/index.js.map +1 -0
  211. package/dist/commands/install/install.options.js +41 -0
  212. package/dist/commands/install/install.options.js.map +1 -0
  213. package/dist/commands/invite/index.js +47 -0
  214. package/dist/commands/invite/index.js.map +1 -0
  215. package/dist/commands/invite/invite.options.js +24 -0
  216. package/dist/commands/invite/invite.options.js.map +1 -0
  217. package/dist/commands/login/_utils/open-browser.js +9 -0
  218. package/dist/commands/login/_utils/open-browser.js.map +1 -0
  219. package/dist/commands/login/_utils/parse-start.js +25 -0
  220. package/dist/commands/login/_utils/parse-start.js.map +1 -0
  221. package/dist/commands/login/_utils/poll-for-approval.js +55 -0
  222. package/dist/commands/login/_utils/poll-for-approval.js.map +1 -0
  223. package/dist/commands/login/index.js +101 -0
  224. package/dist/commands/login/index.js.map +1 -0
  225. package/dist/commands/login/login.options.js +12 -0
  226. package/dist/commands/login/login.options.js.map +1 -0
  227. package/dist/commands/logout/index.js +16 -0
  228. package/dist/commands/logout/index.js.map +1 -0
  229. package/dist/commands/logout/logout.options.js +4 -0
  230. package/dist/commands/logout/logout.options.js.map +1 -0
  231. package/dist/commands/onboard/index.js +20 -0
  232. package/dist/commands/onboard/index.js.map +1 -0
  233. package/dist/commands/org/_utils/apply-switch.js +37 -0
  234. package/dist/commands/org/_utils/apply-switch.js.map +1 -0
  235. package/dist/commands/org/_utils/fetch-orgs.js +19 -0
  236. package/dist/commands/org/_utils/fetch-orgs.js.map +1 -0
  237. package/dist/commands/org/list.js +14 -0
  238. package/dist/commands/org/list.js.map +1 -0
  239. package/dist/commands/org/org.options.js +10 -0
  240. package/dist/commands/org/org.options.js.map +1 -0
  241. package/dist/commands/org/switch.js +37 -0
  242. package/dist/commands/org/switch.js.map +1 -0
  243. package/dist/commands/pr-link/_utils/is-commit-command.js +14 -0
  244. package/dist/commands/pr-link/_utils/is-commit-command.js.map +1 -0
  245. package/dist/commands/pr-link/_utils/record-commit-anchor.js +46 -0
  246. package/dist/commands/pr-link/_utils/record-commit-anchor.js.map +1 -0
  247. package/dist/commands/pr-link/index.js +74 -0
  248. package/dist/commands/pr-link/index.js.map +1 -0
  249. package/dist/commands/pr-link/pr-link.options.js +13 -0
  250. package/dist/commands/pr-link/pr-link.options.js.map +1 -0
  251. package/dist/commands/restore/index.js +27 -0
  252. package/dist/commands/restore/index.js.map +1 -0
  253. package/dist/commands/restore/restore.options.js +12 -0
  254. package/dist/commands/restore/restore.options.js.map +1 -0
  255. package/dist/{_utils → commands/search/_utils}/format-search-result.js +5 -4
  256. package/dist/commands/search/_utils/format-search-result.js.map +1 -0
  257. package/dist/commands/search/_utils/runtime-timezone.js +12 -0
  258. package/dist/commands/search/_utils/runtime-timezone.js.map +1 -0
  259. package/dist/commands/search/index.js +36 -0
  260. package/dist/commands/search/index.js.map +1 -0
  261. package/dist/commands/search/search.options.js +7 -0
  262. package/dist/commands/search/search.options.js.map +1 -0
  263. package/dist/commands/session-start/index.js +119 -0
  264. package/dist/commands/session-start/index.js.map +1 -0
  265. package/dist/commands/session-start/session-start.options.js +13 -0
  266. package/dist/commands/session-start/session-start.options.js.map +1 -0
  267. package/dist/commands/set-mode/index.js +38 -0
  268. package/dist/commands/set-mode/index.js.map +1 -0
  269. package/dist/commands/set-mode/set-mode.options.js +8 -0
  270. package/dist/commands/set-mode/set-mode.options.js.map +1 -0
  271. package/dist/commands/skill/_utils/download-file.js +28 -0
  272. package/dist/commands/skill/_utils/download-file.js.map +1 -0
  273. package/dist/commands/skill/_utils/explain-skill-error.js +31 -0
  274. package/dist/commands/skill/_utils/explain-skill-error.js.map +1 -0
  275. package/dist/commands/skill/_utils/skill-cache.js +136 -0
  276. package/dist/commands/skill/_utils/skill-cache.js.map +1 -0
  277. package/dist/commands/skill/create/_utils/pack-skill-dir.js +160 -0
  278. package/dist/commands/skill/create/_utils/pack-skill-dir.js.map +1 -0
  279. package/dist/commands/skill/create/index.js +108 -0
  280. package/dist/commands/skill/create/index.js.map +1 -0
  281. package/dist/commands/skill/search.js +38 -0
  282. package/dist/commands/skill/search.js.map +1 -0
  283. package/dist/commands/skill/share.js +52 -0
  284. package/dist/commands/skill/share.js.map +1 -0
  285. package/dist/commands/skill/skill.options.js +58 -0
  286. package/dist/commands/skill/skill.options.js.map +1 -0
  287. package/dist/commands/skill/use.js +72 -0
  288. package/dist/commands/skill/use.js.map +1 -0
  289. package/dist/commands/status/index.js +33 -0
  290. package/dist/commands/status/index.js.map +1 -0
  291. package/dist/commands/status/status.options.js +4 -0
  292. package/dist/commands/status/status.options.js.map +1 -0
  293. package/dist/commands/statusline/index.js +33 -0
  294. package/dist/commands/statusline/index.js.map +1 -0
  295. package/dist/commands/statusline/statusline.options.js +4 -0
  296. package/dist/commands/statusline/statusline.options.js.map +1 -0
  297. package/dist/commands/suggestions/index.js +36 -0
  298. package/dist/commands/suggestions/index.js.map +1 -0
  299. package/dist/commands/suggestions/suggestions.options.js +12 -0
  300. package/dist/commands/suggestions/suggestions.options.js.map +1 -0
  301. package/dist/commands/takeover/_utils/agent-paths.js +13 -7
  302. package/dist/commands/takeover/_utils/agent-paths.js.map +1 -1
  303. package/dist/commands/takeover/_utils/agent-process.js +111 -0
  304. package/dist/commands/takeover/_utils/agent-process.js.map +1 -0
  305. package/dist/commands/takeover/_utils/archive-codex-desktop-thread.js +17 -58
  306. package/dist/commands/takeover/_utils/archive-codex-desktop-thread.js.map +1 -1
  307. package/dist/commands/takeover/_utils/canonical-digest.js +2 -2
  308. package/dist/commands/takeover/_utils/canonical-digest.js.map +1 -1
  309. package/dist/commands/takeover/_utils/codex-desktop-recovery.js +77 -95
  310. package/dist/commands/takeover/_utils/codex-desktop-recovery.js.map +1 -1
  311. package/dist/commands/takeover/_utils/context-fit.js +7 -4
  312. package/dist/commands/takeover/_utils/context-fit.js.map +1 -1
  313. package/dist/commands/takeover/_utils/cursor-store.js +333 -281
  314. package/dist/commands/takeover/_utils/cursor-store.js.map +1 -1
  315. package/dist/commands/takeover/_utils/import-codex-desktop-thread.js +138 -282
  316. package/dist/commands/takeover/_utils/import-codex-desktop-thread.js.map +1 -1
  317. package/dist/commands/takeover/_utils/launch-desktop-url.js +19 -24
  318. package/dist/commands/takeover/_utils/launch-desktop-url.js.map +1 -1
  319. package/dist/commands/takeover/_utils/native-file.js +86 -73
  320. package/dist/commands/takeover/_utils/native-file.js.map +1 -1
  321. package/dist/commands/takeover/_utils/probe-agent.js +12 -9
  322. package/dist/commands/takeover/_utils/probe-agent.js.map +1 -1
  323. package/dist/commands/takeover/_utils/staged-session.js +18 -17
  324. package/dist/commands/takeover/_utils/staged-session.js.map +1 -1
  325. package/dist/commands/takeover/_utils/write-claude-session.js +10 -13
  326. package/dist/commands/takeover/_utils/write-claude-session.js.map +1 -1
  327. package/dist/commands/takeover/_utils/write-codex-desktop-session.js +39 -37
  328. package/dist/commands/takeover/_utils/write-codex-desktop-session.js.map +1 -1
  329. package/dist/commands/takeover/_utils/write-codex-session.js +34 -25
  330. package/dist/commands/takeover/_utils/write-codex-session.js.map +1 -1
  331. package/dist/commands/takeover/_utils/write-cursor-session.js +8 -19
  332. package/dist/commands/takeover/_utils/write-cursor-session.js.map +1 -1
  333. package/dist/commands/takeover/_utils/write-pi-session.js +34 -22
  334. package/dist/commands/takeover/_utils/write-pi-session.js.map +1 -1
  335. package/dist/commands/takeover/index.js +129 -164
  336. package/dist/commands/takeover/index.js.map +1 -1
  337. package/dist/commands/takeover/takeover.options.js +6 -0
  338. package/dist/commands/takeover/takeover.options.js.map +1 -0
  339. package/dist/commands/takeover/takeover.schema.js +17 -55
  340. package/dist/commands/takeover/takeover.schema.js.map +1 -1
  341. package/dist/commands/telemetry/index.js +33 -0
  342. package/dist/commands/telemetry/index.js.map +1 -0
  343. package/dist/commands/telemetry/send.js +7 -0
  344. package/dist/commands/telemetry/send.js.map +1 -0
  345. package/dist/commands/telemetry/telemetry.options.js +12 -0
  346. package/dist/commands/telemetry/telemetry.options.js.map +1 -0
  347. package/dist/commands/uninstall/_utils/purge-agent-plugins.js +58 -0
  348. package/dist/commands/uninstall/_utils/purge-agent-plugins.js.map +1 -0
  349. package/dist/commands/uninstall/_utils/purge-claude-statusline.js +51 -0
  350. package/dist/commands/uninstall/_utils/purge-claude-statusline.js.map +1 -0
  351. package/dist/commands/uninstall/_utils/purge-local-state.js +52 -0
  352. package/dist/commands/uninstall/_utils/purge-local-state.js.map +1 -0
  353. package/dist/commands/uninstall/index.js +138 -0
  354. package/dist/commands/uninstall/index.js.map +1 -0
  355. package/dist/commands/uninstall/uninstall.options.js +4 -0
  356. package/dist/commands/uninstall/uninstall.options.js.map +1 -0
  357. package/dist/commands/update/index.js +117 -0
  358. package/dist/commands/update/index.js.map +1 -0
  359. package/dist/commands/update/self-update.js +7 -0
  360. package/dist/commands/update/self-update.js.map +1 -0
  361. package/dist/commands/update/update.options.js +7 -0
  362. package/dist/commands/update/update.options.js.map +1 -0
  363. package/dist/core/errors/cli-error.js +28 -0
  364. package/dist/core/errors/cli-error.js.map +1 -0
  365. package/dist/core/errors/result.js +21 -0
  366. package/dist/core/errors/result.js.map +1 -0
  367. package/dist/core/errors/settle.js +18 -0
  368. package/dist/core/errors/settle.js.map +1 -0
  369. package/dist/core/json/is-record.js +3 -0
  370. package/dist/core/json/is-record.js.map +1 -0
  371. package/dist/core/json/json-field.js +5 -0
  372. package/dist/core/json/json-field.js.map +1 -0
  373. package/dist/core/json/jsonl-records.js +15 -0
  374. package/dist/core/json/jsonl-records.js.map +1 -0
  375. package/dist/core/json/parse-json.js +4 -0
  376. package/dist/core/json/parse-json.js.map +1 -0
  377. package/dist/core/run/cli-input.js +116 -0
  378. package/dist/core/run/cli-input.js.map +1 -0
  379. package/dist/core/run/hook-agents.js +4 -0
  380. package/dist/core/run/hook-agents.js.map +1 -0
  381. package/dist/{_utils → core/run}/normalize-boolean-flags.js +0 -1
  382. package/dist/core/run/normalize-boolean-flags.js.map +1 -0
  383. package/dist/core/run/run-hook.js +18 -0
  384. package/dist/core/run/run-hook.js.map +1 -0
  385. package/dist/core/run/run.js +16 -0
  386. package/dist/core/run/run.js.map +1 -0
  387. package/dist/core/state/credentials.js +34 -0
  388. package/dist/core/state/credentials.js.map +1 -0
  389. package/dist/core/state/ephemeral-session.js +11 -0
  390. package/dist/core/state/ephemeral-session.js.map +1 -0
  391. package/dist/core/state/glen-home.js +9 -0
  392. package/dist/core/state/glen-home.js.map +1 -0
  393. package/dist/core/state/ingest-heartbeat.js +56 -0
  394. package/dist/core/state/ingest-heartbeat.js.map +1 -0
  395. package/dist/core/state/install-receipt.js +174 -0
  396. package/dist/core/state/install-receipt.js.map +1 -0
  397. package/dist/core/state/session-map.js +22 -0
  398. package/dist/core/state/session-map.js.map +1 -0
  399. package/dist/core/state/state-line-memo.js +52 -0
  400. package/dist/core/state/state-line-memo.js.map +1 -0
  401. package/dist/{_utils → core/state}/state-line.js +1 -1
  402. package/dist/core/state/state-line.js.map +1 -0
  403. package/dist/core/state/state.js +51 -0
  404. package/dist/core/state/state.js.map +1 -0
  405. package/dist/core/system/env.js +74 -0
  406. package/dist/core/system/env.js.map +1 -0
  407. package/dist/core/system/files.js +102 -0
  408. package/dist/core/system/files.js.map +1 -0
  409. package/dist/core/system/glen-base-url.js +4 -0
  410. package/dist/core/system/glen-base-url.js.map +1 -0
  411. package/dist/core/system/http.js +146 -0
  412. package/dist/core/system/http.js.map +1 -0
  413. package/dist/core/system/run-program.js +55 -0
  414. package/dist/core/system/run-program.js.map +1 -0
  415. package/dist/core/system/sha256-hex.js +4 -0
  416. package/dist/core/system/sha256-hex.js.map +1 -0
  417. package/dist/{_utils → core/system}/shell-profile.js +43 -56
  418. package/dist/core/system/shell-profile.js.map +1 -0
  419. package/dist/core/system/spawn-detached.js +10 -0
  420. package/dist/core/system/spawn-detached.js.map +1 -0
  421. package/dist/core/system/spawn-self.js +5 -0
  422. package/dist/core/system/spawn-self.js.map +1 -0
  423. package/dist/core/system/sqlite.js +55 -0
  424. package/dist/core/system/sqlite.js.map +1 -0
  425. package/dist/core/system/version.js +16 -0
  426. package/dist/core/system/version.js.map +1 -0
  427. package/dist/core/telemetry/build-event.js +27 -0
  428. package/dist/core/telemetry/build-event.js.map +1 -0
  429. package/dist/core/telemetry/events-store.js +62 -0
  430. package/dist/core/telemetry/events-store.js.map +1 -0
  431. package/dist/core/telemetry/finish-telemetry.js +32 -0
  432. package/dist/core/telemetry/finish-telemetry.js.map +1 -0
  433. package/dist/core/telemetry/install-id.js +18 -0
  434. package/dist/core/telemetry/install-id.js.map +1 -0
  435. package/dist/core/telemetry/note-if-err.js +8 -0
  436. package/dist/core/telemetry/note-if-err.js.map +1 -0
  437. package/dist/core/telemetry/record-event.js +7 -0
  438. package/dist/core/telemetry/record-event.js.map +1 -0
  439. package/dist/core/telemetry/telemetry-context.js +10 -0
  440. package/dist/core/telemetry/telemetry-context.js.map +1 -0
  441. package/dist/core/telemetry/telemetry-settings.js +32 -0
  442. package/dist/core/telemetry/telemetry-settings.js.map +1 -0
  443. package/dist/core/terminal/attention-summary.js +14 -0
  444. package/dist/core/terminal/attention-summary.js.map +1 -0
  445. package/dist/core/terminal/out.js +86 -0
  446. package/dist/core/terminal/out.js.map +1 -0
  447. package/dist/core/terminal/prompt.js +34 -0
  448. package/dist/core/terminal/prompt.js.map +1 -0
  449. package/dist/core/terminal/read-hook-event.js +17 -0
  450. package/dist/core/terminal/read-hook-event.js.map +1 -0
  451. package/dist/core/terminal/read-stdin.js +23 -0
  452. package/dist/core/terminal/read-stdin.js.map +1 -0
  453. package/dist/jcode/plugin.json +1 -1
  454. package/dist/jcode/skills/feedback/SKILL.md +8 -8
  455. package/dist/jcode/skills/invite/SKILL.md +4 -4
  456. package/dist/jcode/skills/setup/SKILL.md +6 -4
  457. package/dist/macos/glen.app/Contents/MacOS/glen +0 -0
  458. package/package.json +16 -7
  459. package/dist/_utils/agent-adapter.d.ts +0 -9
  460. package/dist/_utils/agent-adapter.js +0 -49
  461. package/dist/_utils/agent-adapter.js.map +0 -1
  462. package/dist/_utils/agents-table.d.ts +0 -11
  463. package/dist/_utils/agents-table.js +0 -35
  464. package/dist/_utils/agents-table.js.map +0 -1
  465. package/dist/_utils/build-turn-body.d.ts +0 -17
  466. package/dist/_utils/build-turn-body.js.map +0 -1
  467. package/dist/_utils/cli-error.d.ts +0 -12
  468. package/dist/_utils/cli-error.js +0 -21
  469. package/dist/_utils/cli-error.js.map +0 -1
  470. package/dist/_utils/codex-app-server.d.ts +0 -11
  471. package/dist/_utils/codex-app-server.js +0 -94
  472. package/dist/_utils/codex-app-server.js.map +0 -1
  473. package/dist/_utils/codex-hooks-merge.d.ts +0 -22
  474. package/dist/_utils/codex-hooks-merge.js +0 -60
  475. package/dist/_utils/codex-hooks-merge.js.map +0 -1
  476. package/dist/_utils/codex-hooks-setup.d.ts +0 -14
  477. package/dist/_utils/codex-hooks-setup.js +0 -162
  478. package/dist/_utils/codex-hooks-setup.js.map +0 -1
  479. package/dist/_utils/codex-paths.d.ts +0 -5
  480. package/dist/_utils/codex-paths.js +0 -10
  481. package/dist/_utils/codex-paths.js.map +0 -1
  482. package/dist/_utils/codex-repair-trace.d.ts +0 -11
  483. package/dist/_utils/codex-repair-trace.js +0 -39
  484. package/dist/_utils/codex-repair-trace.js.map +0 -1
  485. package/dist/_utils/codex-rules-setup.d.ts +0 -4
  486. package/dist/_utils/codex-rules-setup.js +0 -34
  487. package/dist/_utils/codex-rules-setup.js.map +0 -1
  488. package/dist/_utils/codex-trust-toml.d.ts +0 -7
  489. package/dist/_utils/codex-trust-toml.js.map +0 -1
  490. package/dist/_utils/collect-import-files.d.ts +0 -4
  491. package/dist/_utils/collect-import-files.js +0 -50
  492. package/dist/_utils/collect-import-files.js.map +0 -1
  493. package/dist/_utils/config.d.ts +0 -45
  494. package/dist/_utils/config.js +0 -47
  495. package/dist/_utils/config.js.map +0 -1
  496. package/dist/_utils/confirm.d.ts +0 -7
  497. package/dist/_utils/confirm.js +0 -35
  498. package/dist/_utils/confirm.js.map +0 -1
  499. package/dist/_utils/credentials.d.ts +0 -15
  500. package/dist/_utils/credentials.js +0 -62
  501. package/dist/_utils/credentials.js.map +0 -1
  502. package/dist/_utils/detect-transcript-format.d.ts +0 -2
  503. package/dist/_utils/detect-transcript-format.js +0 -57
  504. package/dist/_utils/detect-transcript-format.js.map +0 -1
  505. package/dist/_utils/ensure-global-cli.d.ts +0 -4
  506. package/dist/_utils/ensure-global-cli.js.map +0 -1
  507. package/dist/_utils/ephemeral-session.d.ts +0 -2
  508. package/dist/_utils/ephemeral-session.js +0 -12
  509. package/dist/_utils/ephemeral-session.js.map +0 -1
  510. package/dist/_utils/extract-claude-segments.d.ts +0 -2
  511. package/dist/_utils/extract-claude-segments.js.map +0 -1
  512. package/dist/_utils/extract-codex-segments.d.ts +0 -2
  513. package/dist/_utils/extract-codex-segments.js +0 -65
  514. package/dist/_utils/extract-codex-segments.js.map +0 -1
  515. package/dist/_utils/extract-pi-segments.d.ts +0 -2
  516. package/dist/_utils/extract-pi-segments.js.map +0 -1
  517. package/dist/_utils/find-bin.d.ts +0 -7
  518. package/dist/_utils/find-bin.js +0 -89
  519. package/dist/_utils/find-bin.js.map +0 -1
  520. package/dist/_utils/format-search-result.d.ts +0 -2
  521. package/dist/_utils/format-search-result.js.map +0 -1
  522. package/dist/_utils/format-turn-nudges.d.ts +0 -2
  523. package/dist/_utils/format-turn-nudges.js.map +0 -1
  524. package/dist/_utils/git-context.d.ts +0 -13
  525. package/dist/_utils/git-context.js +0 -82
  526. package/dist/_utils/git-context.js.map +0 -1
  527. package/dist/_utils/git-hook-setup.d.ts +0 -18
  528. package/dist/_utils/git-hook-setup.js +0 -115
  529. package/dist/_utils/git-hook-setup.js.map +0 -1
  530. package/dist/_utils/glen-headers.d.ts +0 -8
  531. package/dist/_utils/glen-headers.js.map +0 -1
  532. package/dist/_utils/http.d.ts +0 -23
  533. package/dist/_utils/http.js +0 -97
  534. package/dist/_utils/http.js.map +0 -1
  535. package/dist/_utils/idempotency-key.d.ts +0 -2
  536. package/dist/_utils/idempotency-key.js +0 -7
  537. package/dist/_utils/idempotency-key.js.map +0 -1
  538. package/dist/_utils/indicator-app.d.ts +0 -9
  539. package/dist/_utils/indicator-app.js +0 -91
  540. package/dist/_utils/indicator-app.js.map +0 -1
  541. package/dist/_utils/indicator-health.d.ts +0 -8
  542. package/dist/_utils/indicator-health.js +0 -37
  543. package/dist/_utils/indicator-health.js.map +0 -1
  544. package/dist/_utils/ingest-diagnosis.d.ts +0 -24
  545. package/dist/_utils/ingest-diagnosis.js.map +0 -1
  546. package/dist/_utils/ingest-failure-memo.d.ts +0 -2
  547. package/dist/_utils/ingest-failure-memo.js +0 -58
  548. package/dist/_utils/ingest-failure-memo.js.map +0 -1
  549. package/dist/_utils/ingest-heartbeat.d.ts +0 -9
  550. package/dist/_utils/ingest-heartbeat.js +0 -48
  551. package/dist/_utils/ingest-heartbeat.js.map +0 -1
  552. package/dist/_utils/install-receipt.d.ts +0 -51
  553. package/dist/_utils/install-receipt.js +0 -202
  554. package/dist/_utils/install-receipt.js.map +0 -1
  555. package/dist/_utils/jcode-bundle.d.ts +0 -3
  556. package/dist/_utils/jcode-bundle.js +0 -16
  557. package/dist/_utils/jcode-bundle.js.map +0 -1
  558. package/dist/_utils/jcode-event.d.ts +0 -3
  559. package/dist/_utils/jcode-event.js +0 -66
  560. package/dist/_utils/jcode-event.js.map +0 -1
  561. package/dist/_utils/jcode-hook-lines.d.ts +0 -5
  562. package/dist/_utils/jcode-hook-lines.js.map +0 -1
  563. package/dist/_utils/jcode-hooks-toml.d.ts +0 -8
  564. package/dist/_utils/jcode-hooks-toml.js.map +0 -1
  565. package/dist/_utils/jcode-paths.d.ts +0 -7
  566. package/dist/_utils/jcode-paths.js +0 -10
  567. package/dist/_utils/jcode-paths.js.map +0 -1
  568. package/dist/_utils/jcode-setup.d.ts +0 -27
  569. package/dist/_utils/jcode-setup.js +0 -151
  570. package/dist/_utils/jcode-setup.js.map +0 -1
  571. package/dist/_utils/jcode-skills-sync.d.ts +0 -8
  572. package/dist/_utils/jcode-skills-sync.js +0 -74
  573. package/dist/_utils/jcode-skills-sync.js.map +0 -1
  574. package/dist/_utils/login-check.d.ts +0 -2
  575. package/dist/_utils/login-check.js +0 -57
  576. package/dist/_utils/login-check.js.map +0 -1
  577. package/dist/_utils/managed-block.d.ts +0 -4
  578. package/dist/_utils/managed-block.js.map +0 -1
  579. package/dist/_utils/normalize-boolean-flags.d.ts +0 -2
  580. package/dist/_utils/normalize-boolean-flags.js.map +0 -1
  581. package/dist/_utils/normalize-transcript-timestamp.d.ts +0 -2
  582. package/dist/_utils/normalize-transcript-timestamp.js.map +0 -1
  583. package/dist/_utils/npm-error-cause.d.ts +0 -5
  584. package/dist/_utils/npm-error-cause.js.map +0 -1
  585. package/dist/_utils/open-browser.d.ts +0 -2
  586. package/dist/_utils/open-browser.js +0 -18
  587. package/dist/_utils/open-browser.js.map +0 -1
  588. package/dist/_utils/parse-claude-transcript.d.ts +0 -3
  589. package/dist/_utils/parse-claude-transcript.js +0 -145
  590. package/dist/_utils/parse-claude-transcript.js.map +0 -1
  591. package/dist/_utils/parse-codex-transcript.d.ts +0 -3
  592. package/dist/_utils/parse-codex-transcript.js +0 -132
  593. package/dist/_utils/parse-codex-transcript.js.map +0 -1
  594. package/dist/_utils/parse-cursor-db.d.ts +0 -5
  595. package/dist/_utils/parse-cursor-db.js +0 -212
  596. package/dist/_utils/parse-cursor-db.js.map +0 -1
  597. package/dist/_utils/parse-harbor-atif.d.ts +0 -3
  598. package/dist/_utils/parse-harbor-atif.js.map +0 -1
  599. package/dist/_utils/parse-jcode-session.d.ts +0 -14
  600. package/dist/_utils/parse-jcode-session.js.map +0 -1
  601. package/dist/_utils/parse-pi-transcript.d.ts +0 -3
  602. package/dist/_utils/parse-pi-transcript.js +0 -164
  603. package/dist/_utils/parse-pi-transcript.js.map +0 -1
  604. package/dist/_utils/parse-transcript.d.ts +0 -14
  605. package/dist/_utils/parse-transcript.js +0 -94
  606. package/dist/_utils/parse-transcript.js.map +0 -1
  607. package/dist/_utils/plugin-status.d.ts +0 -4
  608. package/dist/_utils/plugin-status.js +0 -76
  609. package/dist/_utils/plugin-status.js.map +0 -1
  610. package/dist/_utils/post-route.d.ts +0 -6
  611. package/dist/_utils/post-route.js +0 -66
  612. package/dist/_utils/post-route.js.map +0 -1
  613. package/dist/_utils/pr-review-link.d.ts +0 -11
  614. package/dist/_utils/pr-review-link.js.map +0 -1
  615. package/dist/_utils/proactive-ticket-log.d.ts +0 -3
  616. package/dist/_utils/proactive-ticket-log.js +0 -21
  617. package/dist/_utils/proactive-ticket-log.js.map +0 -1
  618. package/dist/_utils/purge-agent-plugins.d.ts +0 -8
  619. package/dist/_utils/purge-agent-plugins.js +0 -62
  620. package/dist/_utils/purge-agent-plugins.js.map +0 -1
  621. package/dist/_utils/purge-claude-statusline.d.ts +0 -12
  622. package/dist/_utils/purge-claude-statusline.js +0 -57
  623. package/dist/_utils/purge-claude-statusline.js.map +0 -1
  624. package/dist/_utils/purge-local-state.d.ts +0 -7
  625. package/dist/_utils/purge-local-state.js +0 -40
  626. package/dist/_utils/purge-local-state.js.map +0 -1
  627. package/dist/_utils/record-commit-anchor.d.ts +0 -8
  628. package/dist/_utils/record-commit-anchor.js +0 -73
  629. package/dist/_utils/record-commit-anchor.js.map +0 -1
  630. package/dist/_utils/refresh-control-state.d.ts +0 -6
  631. package/dist/_utils/refresh-control-state.js +0 -30
  632. package/dist/_utils/refresh-control-state.js.map +0 -1
  633. package/dist/_utils/render-callback-page.d.ts +0 -2
  634. package/dist/_utils/render-callback-page.js +0 -90
  635. package/dist/_utils/render-callback-page.js.map +0 -1
  636. package/dist/_utils/report-cli-install.d.ts +0 -2
  637. package/dist/_utils/report-cli-install.js +0 -17
  638. package/dist/_utils/report-cli-install.js.map +0 -1
  639. package/dist/_utils/resolve-import-workspace.d.ts +0 -4
  640. package/dist/_utils/resolve-import-workspace.js.map +0 -1
  641. package/dist/_utils/result.d.ts +0 -14
  642. package/dist/_utils/result.js +0 -12
  643. package/dist/_utils/result.js.map +0 -1
  644. package/dist/_utils/run-bin.d.ts +0 -14
  645. package/dist/_utils/run-bin.js +0 -60
  646. package/dist/_utils/run-bin.js.map +0 -1
  647. package/dist/_utils/runtime-timezone.d.ts +0 -1
  648. package/dist/_utils/runtime-timezone.js +0 -13
  649. package/dist/_utils/runtime-timezone.js.map +0 -1
  650. package/dist/_utils/session-map.d.ts +0 -4
  651. package/dist/_utils/session-map.js +0 -38
  652. package/dist/_utils/session-map.js.map +0 -1
  653. package/dist/_utils/shell-profile.d.ts +0 -13
  654. package/dist/_utils/shell-profile.js.map +0 -1
  655. package/dist/_utils/state-line-memo.d.ts +0 -2
  656. package/dist/_utils/state-line-memo.js +0 -47
  657. package/dist/_utils/state-line-memo.js.map +0 -1
  658. package/dist/_utils/state-line.d.ts +0 -3
  659. package/dist/_utils/state-line.js.map +0 -1
  660. package/dist/_utils/state.d.ts +0 -15
  661. package/dist/_utils/state.js +0 -53
  662. package/dist/_utils/state.js.map +0 -1
  663. package/dist/_utils/sync-mode-from-server.d.ts +0 -3
  664. package/dist/_utils/sync-mode-from-server.js +0 -44
  665. package/dist/_utils/sync-mode-from-server.js.map +0 -1
  666. package/dist/_utils/transcript-turns.d.ts +0 -51
  667. package/dist/_utils/transcript-turns.js.map +0 -1
  668. package/dist/_utils/turn-cache.d.ts +0 -7
  669. package/dist/_utils/turn-cache.js +0 -56
  670. package/dist/_utils/turn-cache.js.map +0 -1
  671. package/dist/_utils/update.d.ts +0 -19
  672. package/dist/_utils/update.js +0 -196
  673. package/dist/_utils/update.js.map +0 -1
  674. package/dist/_utils/version.d.ts +0 -2
  675. package/dist/_utils/version.js +0 -18
  676. package/dist/_utils/version.js.map +0 -1
  677. package/dist/_utils/which.d.ts +0 -2
  678. package/dist/_utils/which.js +0 -4
  679. package/dist/_utils/which.js.map +0 -1
  680. package/dist/_utils/write-commit-trailer.d.ts +0 -2
  681. package/dist/_utils/write-commit-trailer.js +0 -25
  682. package/dist/_utils/write-commit-trailer.js.map +0 -1
  683. package/dist/bin.d.ts +0 -2
  684. package/dist/commands/_utils/materialize-skill.d.ts +0 -30
  685. package/dist/commands/_utils/materialize-skill.js +0 -207
  686. package/dist/commands/_utils/materialize-skill.js.map +0 -1
  687. package/dist/commands/_utils/mutate-evidence.d.ts +0 -17
  688. package/dist/commands/_utils/mutate-evidence.js +0 -80
  689. package/dist/commands/_utils/mutate-evidence.js.map +0 -1
  690. package/dist/commands/_utils/pack-skill-dir.d.ts +0 -15
  691. package/dist/commands/_utils/pack-skill-dir.js +0 -169
  692. package/dist/commands/_utils/pack-skill-dir.js.map +0 -1
  693. package/dist/commands/artifact.d.ts +0 -18
  694. package/dist/commands/artifact.js +0 -139
  695. package/dist/commands/artifact.js.map +0 -1
  696. package/dist/commands/code-search.d.ts +0 -4
  697. package/dist/commands/code-search.js +0 -164
  698. package/dist/commands/code-search.js.map +0 -1
  699. package/dist/commands/dependency.d.ts +0 -4
  700. package/dist/commands/dependency.js +0 -23
  701. package/dist/commands/dependency.js.map +0 -1
  702. package/dist/commands/doctor.d.ts +0 -7
  703. package/dist/commands/doctor.js +0 -243
  704. package/dist/commands/doctor.js.map +0 -1
  705. package/dist/commands/feedback.d.ts +0 -15
  706. package/dist/commands/feedback.js +0 -112
  707. package/dist/commands/feedback.js.map +0 -1
  708. package/dist/commands/forget.d.ts +0 -4
  709. package/dist/commands/forget.js +0 -29
  710. package/dist/commands/forget.js.map +0 -1
  711. package/dist/commands/git-hooks.d.ts +0 -9
  712. package/dist/commands/git-hooks.js +0 -18
  713. package/dist/commands/git-hooks.js.map +0 -1
  714. package/dist/commands/import.d.ts +0 -8
  715. package/dist/commands/import.js +0 -414
  716. package/dist/commands/import.js.map +0 -1
  717. package/dist/commands/incognito.d.ts +0 -4
  718. package/dist/commands/incognito.js +0 -13
  719. package/dist/commands/incognito.js.map +0 -1
  720. package/dist/commands/indicator.d.ts +0 -4
  721. package/dist/commands/indicator.js +0 -65
  722. package/dist/commands/indicator.js.map +0 -1
  723. package/dist/commands/ingest.d.ts +0 -3
  724. package/dist/commands/ingest.js +0 -367
  725. package/dist/commands/ingest.js.map +0 -1
  726. package/dist/commands/install.d.ts +0 -9
  727. package/dist/commands/install.js +0 -431
  728. package/dist/commands/install.js.map +0 -1
  729. package/dist/commands/invite.d.ts +0 -4
  730. package/dist/commands/invite.js +0 -61
  731. package/dist/commands/invite.js.map +0 -1
  732. package/dist/commands/login.d.ts +0 -4
  733. package/dist/commands/login.js +0 -145
  734. package/dist/commands/login.js.map +0 -1
  735. package/dist/commands/logout.d.ts +0 -4
  736. package/dist/commands/logout.js +0 -26
  737. package/dist/commands/logout.js.map +0 -1
  738. package/dist/commands/onboard.d.ts +0 -4
  739. package/dist/commands/onboard.js +0 -18
  740. package/dist/commands/onboard.js.map +0 -1
  741. package/dist/commands/org.d.ts +0 -5
  742. package/dist/commands/org.js +0 -157
  743. package/dist/commands/org.js.map +0 -1
  744. package/dist/commands/pr-link.d.ts +0 -2
  745. package/dist/commands/pr-link.js +0 -69
  746. package/dist/commands/pr-link.js.map +0 -1
  747. package/dist/commands/restore.d.ts +0 -4
  748. package/dist/commands/restore.js +0 -23
  749. package/dist/commands/restore.js.map +0 -1
  750. package/dist/commands/search.d.ts +0 -4
  751. package/dist/commands/search.js +0 -85
  752. package/dist/commands/search.js.map +0 -1
  753. package/dist/commands/session-start.d.ts +0 -2
  754. package/dist/commands/session-start.js +0 -114
  755. package/dist/commands/session-start.js.map +0 -1
  756. package/dist/commands/set-mode.d.ts +0 -5
  757. package/dist/commands/set-mode.js +0 -96
  758. package/dist/commands/set-mode.js.map +0 -1
  759. package/dist/commands/skill.d.ts +0 -18
  760. package/dist/commands/skill.js +0 -309
  761. package/dist/commands/skill.js.map +0 -1
  762. package/dist/commands/status.d.ts +0 -4
  763. package/dist/commands/status.js +0 -33
  764. package/dist/commands/status.js.map +0 -1
  765. package/dist/commands/statusline.d.ts +0 -2
  766. package/dist/commands/statusline.js +0 -37
  767. package/dist/commands/statusline.js.map +0 -1
  768. package/dist/commands/suggestions.d.ts +0 -4
  769. package/dist/commands/suggestions.js +0 -84
  770. package/dist/commands/suggestions.js.map +0 -1
  771. package/dist/commands/takeover/_utils/agent-paths.d.ts +0 -6
  772. package/dist/commands/takeover/_utils/archive-codex-desktop-thread.d.ts +0 -5
  773. package/dist/commands/takeover/_utils/canonical-digest.d.ts +0 -5
  774. package/dist/commands/takeover/_utils/codex-desktop-recovery.d.ts +0 -16
  775. package/dist/commands/takeover/_utils/context-fit.d.ts +0 -18
  776. package/dist/commands/takeover/_utils/cursor-store.d.ts +0 -49
  777. package/dist/commands/takeover/_utils/import-codex-desktop-thread.d.ts +0 -14
  778. package/dist/commands/takeover/_utils/launch-desktop-url.d.ts +0 -4
  779. package/dist/commands/takeover/_utils/native-file.d.ts +0 -14
  780. package/dist/commands/takeover/_utils/probe-agent.d.ts +0 -20
  781. package/dist/commands/takeover/_utils/provenance-context.d.ts +0 -7
  782. package/dist/commands/takeover/_utils/staged-session.d.ts +0 -64
  783. package/dist/commands/takeover/_utils/write-claude-desktop-session.d.ts +0 -47
  784. package/dist/commands/takeover/_utils/write-claude-session.d.ts +0 -53
  785. package/dist/commands/takeover/_utils/write-codex-desktop-session.d.ts +0 -96
  786. package/dist/commands/takeover/_utils/write-codex-session.d.ts +0 -52
  787. package/dist/commands/takeover/_utils/write-cursor-session.d.ts +0 -57
  788. package/dist/commands/takeover/_utils/write-pi-session.d.ts +0 -52
  789. package/dist/commands/takeover/index.d.ts +0 -21
  790. package/dist/commands/takeover/takeover.schema.d.ts +0 -24
  791. package/dist/commands/uninstall.d.ts +0 -8
  792. package/dist/commands/uninstall.js +0 -130
  793. package/dist/commands/uninstall.js.map +0 -1
  794. package/dist/commands/update.d.ts +0 -4
  795. package/dist/commands/update.js +0 -127
  796. package/dist/commands/update.js.map +0 -1
  797. package/dist/jcode/skills/session-takeover/SKILL.md +0 -67
  798. /package/dist/{_utils → clients/agents}/normalize-transcript-timestamp.js +0 -0
package/dist/bin.js CHANGED
@@ -1,575 +1,152 @@
1
1
  #!/usr/bin/env node
2
2
  import { cac } from "cac";
3
- import { formatCliError } from "./_utils/cli-error.js";
4
- import { cliVersion } from "./_utils/version.js";
3
+ import { cliErr } from "./core/errors/cli-error.js";
4
+ import { out } from "./core/terminal/out.js";
5
+ import { err, ok } from "./core/errors/result.js";
6
+ import { run } from "./core/run/run.js";
7
+ import { runHook } from "./core/run/run-hook.js";
8
+ import { cliVersion } from "./core/system/version.js";
9
+ import { cliInput } from "./core/run/cli-input.js";
10
+ import { artifactOptions } from "./commands/artifact/artifact.options.js";
11
+ import { codeSearchOptions } from "./commands/code-search/code-search.options.js";
12
+ import { dependencyOptions } from "./commands/dependency/dependency.options.js";
13
+ import { doctorOptions } from "./commands/doctor/doctor.options.js";
14
+ import { feedbackOptions } from "./commands/feedback/feedback.options.js";
15
+ import { forgetOptions } from "./commands/forget/forget.options.js";
16
+ import { gitHooksOptions } from "./commands/git-hooks/git-hooks.options.js";
17
+ import { importOptions } from "./commands/import/import.options.js";
18
+ import { incognitoOptions } from "./commands/incognito/incognito.options.js";
19
+ import { indicatorOptions } from "./commands/indicator/indicator.options.js";
20
+ import { ingestOptions } from "./commands/ingest/ingest.options.js";
21
+ import { installOptions } from "./commands/install/install.options.js";
22
+ import { inviteOptions } from "./commands/invite/invite.options.js";
23
+ import { loginOptions } from "./commands/login/login.options.js";
24
+ import { logoutOptions } from "./commands/logout/logout.options.js";
25
+ import { orgOptions } from "./commands/org/org.options.js";
26
+ import { prLinkOptions } from "./commands/pr-link/pr-link.options.js";
27
+ import { restoreOptions } from "./commands/restore/restore.options.js";
28
+ import { searchOptions } from "./commands/search/search.options.js";
29
+ import { sessionStartOptions } from "./commands/session-start/session-start.options.js";
30
+ import { setModeOptions } from "./commands/set-mode/set-mode.options.js";
31
+ import { skillOptions } from "./commands/skill/skill.options.js";
32
+ import { statusOptions } from "./commands/status/status.options.js";
33
+ import { statuslineOptions } from "./commands/statusline/statusline.options.js";
34
+ import { suggestionsOptions } from "./commands/suggestions/suggestions.options.js";
35
+ import { takeoverOptions } from "./commands/takeover/takeover.options.js";
36
+ import { telemetryOptions } from "./commands/telemetry/telemetry.options.js";
37
+ import { uninstallOptions } from "./commands/uninstall/uninstall.options.js";
38
+ import { updateOptions } from "./commands/update/update.options.js";
5
39
  const cli = cac("glen");
6
- cli.command("login", "Connect glen via browser sign-in").action(async () => {
7
- const { login } = await import("./commands/login.js");
8
- const result = await login();
9
- if (!result.ok) {
10
- process.stderr.write(formatCliError(result.error));
11
- process.exit(1);
12
- }
13
- });
14
- cli
15
- .command("logout", "Sign out of glen and remove credentials")
16
- .action(async () => {
17
- const { logout } = await import("./commands/logout.js");
18
- const result = await logout();
19
- if (!result.ok) {
20
- process.stderr.write(formatCliError(result.error));
21
- process.exit(1);
22
- }
23
- });
24
- cli.command("status", "Check connection status").action(async () => {
25
- const { status } = await import("./commands/status.js");
26
- const result = await status();
27
- if (!result.ok)
28
- process.exit(1);
29
- });
30
- cli
31
- .command("search <query>", "Search glen memory")
32
- .action(async (query) => {
33
- const { search } = await import("./commands/search.js");
34
- const result = await search(query);
35
- if (!result.ok) {
36
- process.stderr.write(formatCliError(result.error));
37
- process.exit(1);
38
- }
39
- });
40
- cli
41
- .command("takeover <code>", "Continue a shared transcript in a fresh native agent session")
42
- .action(async (code) => {
43
- const { takeover } = await import("./commands/takeover/index.js");
44
- const result = await takeover(code);
45
- if (!result.ok) {
46
- process.stderr.write(formatCliError(result.error));
47
- process.exit(1);
48
- }
49
- });
50
- cli
51
- .command("code-search <location> [question]", 'Trace selected code to the conversations that produced it: code-search <path:start-end> "<question>"')
52
- .action(async (location, question) => {
53
- const { codeSearch } = await import("./commands/code-search.js");
54
- const result = await codeSearch(location, question ?? "");
55
- if (!result.ok) {
56
- process.stderr.write(formatCliError(result.error));
57
- process.exit(1);
58
- }
59
- });
60
- cli
61
- .command(
62
- // cac's variadic form is `<...name>`; `<name...>` parses as one positional and silently drops extra paths.
63
- "import <...path>", "Import old local agent transcripts (Claude Code, Codex, Cursor, Pi) into glen memory")
64
- .option("--dry-run", "List what would be imported without writing anything")
65
- .option("--report <path>", "Write a machine-readable import report")
66
- .action(async (paths, options) => {
67
- const { importTranscripts } = await import("./commands/import.js");
68
- const result = await importTranscripts(paths, {
69
- dryRun: options.dryRun === true,
70
- ...(options.report !== undefined ? { report: options.report } : {}),
71
- });
72
- if (!result.ok) {
73
- process.stderr.write(formatCliError(result.error));
74
- process.exit(1);
75
- }
76
- });
77
- cli
78
- .command("forget <...reference>", "Forget one or more observation:<id> or message:<id> search sources")
79
- .action(async (reference) => {
80
- const { forget } = await import("./commands/forget.js");
81
- const result = await forget(reference);
82
- if (!result.ok) {
83
- process.stderr.write(formatCliError(result.error));
84
- process.exit(1);
85
- }
86
- });
87
- cli
88
- .command("restore <...reference>", "Restore one or more forgotten observation:<id> or message:<id> sources")
89
- .action(async (reference) => {
90
- const { restore } = await import("./commands/restore.js");
91
- const result = await restore(reference);
92
- if (!result.ok) {
93
- process.stderr.write(formatCliError(result.error));
94
- process.exit(1);
95
- }
96
- });
97
- cli
98
- .command(
99
- // cac's variadic form is `[...name]`; `[name...]` passes one bare string, which the spread splits into characters.
100
- "invite [email] [...otherEmails]", "Invite teammates by email, or print a shareable join link when no email is given")
101
- .option("--role <role>", "Role for the invitees: member (default) | admin")
102
- .action(async (email, otherEmails, options) => {
103
- const role = options.role === "admin" ? "admin" : "member";
104
- const emails = [...(email ? [email] : []), ...(otherEmails ?? [])];
105
- const { invite } = await import("./commands/invite.js");
106
- const result = await invite(emails, role);
107
- if (!result.ok) {
108
- process.stderr.write(formatCliError(result.error));
109
- process.exit(1);
110
- }
111
- });
112
- cli
113
- .command("on", "Turn glen on — inject context and record")
114
- .action(async () => {
115
- const { setMode } = await import("./commands/set-mode.js");
116
- const r = await setMode("on");
117
- if (!r.ok) {
118
- process.stderr.write(formatCliError(r.error));
119
- process.exit(1);
120
- }
121
- });
122
- cli
123
- .command("off", "Turn glen off — inject nothing and record nothing until `glen on`")
124
- .action(async () => {
125
- const { setMode } = await import("./commands/set-mode.js");
126
- const r = await setMode("off");
127
- if (!r.ok) {
128
- process.stderr.write(formatCliError(r.error));
129
- process.exit(1);
130
- }
131
- });
132
- cli
133
- .command("silent", "Silent mode — record everything, surface nothing until `glen on`")
134
- .action(async () => {
135
- const { setMode } = await import("./commands/set-mode.js");
136
- const r = await setMode("silent");
137
- if (!r.ok) {
138
- process.stderr.write(formatCliError(r.error));
139
- process.exit(1);
140
- }
141
- });
142
- cli
143
- .command("incognito [state]", "Go off the record — keep recalling, record nothing (back-compat: on|off)")
144
- .action(async (state) => {
145
- const { incognito } = await import("./commands/incognito.js");
146
- const r = await incognito(state);
147
- if (!r.ok) {
148
- process.stderr.write(formatCliError(r.error));
149
- process.exit(1);
150
- }
151
- });
152
- cli
153
- .command("suggestions <kind> <state>", "Toggle glen's skill nudges account-wide: skill-create|skill-use on|off")
154
- .action(async (kind, state) => {
155
- const { suggestions } = await import("./commands/suggestions.js");
156
- const r = await suggestions(kind, state);
157
- if (!r.ok) {
158
- process.stderr.write(formatCliError(r.error));
159
- process.exit(1);
160
- }
161
- });
162
- cli
163
- .command("ingest", "Ingest a turn from stdin (used by agent hooks)")
164
- .option("--agent <agent>", "Agent type: claude-code | codex | cursor | pi | jcode")
165
- .action(async (options) => {
166
- try {
167
- const { ingest } = await import("./commands/ingest.js");
168
- await ingest(options.agent);
169
- }
170
- catch {
171
- // Hook must never block a prompt — swallow and exit clean.
172
- }
173
- process.exit(0);
174
- });
175
- cli
176
- .command("pr-link", "Surface a Glen review link from a tool event (used by agent hooks)")
177
- .option("--agent <agent>", "Agent type: claude-code | codex | cursor | pi")
178
- .action(async (options) => {
179
- try {
180
- const { prLink } = await import("./commands/pr-link.js");
181
- await prLink(options.agent);
182
- }
183
- catch { }
184
- process.exit(0);
185
- });
186
- cli
187
- .command("bug <title>", "Report a glen bug to the Glen team")
188
- .option("--description <description>", "What is wrong")
189
- .option("--steps <steps>", "Steps to reproduce")
190
- .option("--severity <severity>", "low | medium | high | critical")
191
- .option("--from <from>", "Who it is from: user (default) | agent")
192
- .option("--agent <agent>", "Agent type: claude-code | codex | cursor | pi")
193
- .option("--proactive", "Self-initiated filing; at most one per session")
194
- .action(async (title, options) => {
195
- const { feedback } = await import("./commands/feedback.js");
196
- const result = await feedback("bug", title, options);
197
- if (!result.ok) {
198
- process.stderr.write(formatCliError(result.error));
199
- process.exit(1);
200
- }
201
- });
202
- cli
203
- .command("feedback <title>", "Send product feedback to the Glen team")
204
- .option("--wants <wants>", "The concrete change being asked for")
205
- .option("--why <why>", "Why it matters — the underlying need")
206
- .option("--context <context>", "Any extra context")
207
- .option("--from <from>", "Who it is from: user (default) | agent")
208
- .option("--agent <agent>", "Agent type: claude-code | codex | cursor | pi")
209
- .option("--proactive", "Self-initiated filing; at most one per session")
210
- .action(async (title, options) => {
211
- const { feedback } = await import("./commands/feedback.js");
212
- const result = await feedback("feedback", title, options);
213
- if (!result.ok) {
214
- process.stderr.write(formatCliError(result.error));
215
- process.exit(1);
216
- }
217
- });
218
- cli
219
- .command("org <action> [slug]", "Manage organizations: list | switch [slug]")
220
- .action(async (action, slug) => {
221
- if (action === "list") {
222
- const { orgList } = await import("./commands/org.js");
223
- const r = await orgList();
224
- if (!r.ok) {
225
- process.stderr.write(formatCliError(r.error));
226
- process.exit(1);
227
- }
228
- return;
229
- }
230
- if (action === "switch") {
231
- const { orgSwitch } = await import("./commands/org.js");
232
- const r = await orgSwitch(slug);
233
- if (!r.ok) {
234
- process.stderr.write(formatCliError(r.error));
235
- process.exit(1);
236
- }
237
- return;
238
- }
239
- process.stderr.write(`Unknown subcommand "${action}". Use: glen org list | glen org switch [slug]\n`);
240
- process.exit(1);
241
- });
242
- cli
243
- .command("skill <action> [arg]", "Glen skill library: search [query] | use <slug> | create | share <slug>")
244
- .option("--by <author>", "skill search: filter by author name (or 'me')")
245
- .option("--name <name>", "skill create: the skill's name")
246
- .option("--description <description>", "skill create: one-line description")
247
- .option("--file <path>", "skill create: path to the SKILL.md body")
248
- .option("--dir <path>", "skill create: path to a skill directory (SKILL.md + scripts/ references/ assets/)")
249
- .option("--deps <path>", "skill create: path to a JSON array of dependencies")
250
- .option("--update", "skill create: overwrite your own same-named skill")
251
- .option("--org", "skill create/share: share with your whole org (create default: private to you)")
252
- .option("--with <emails>", "skill share: comma-separated teammate emails to add")
253
- .action(async (action, arg, options) => {
254
- // cac yields `true` for a valued flag passed bare — coerce to undefined.
255
- const str = (v) => typeof v === "string" ? v : undefined;
256
- if (action === "search") {
257
- const { skillSearch } = await import("./commands/skill.js");
258
- const r = await skillSearch(arg, str(options.by));
259
- if (!r.ok) {
260
- process.stderr.write(formatCliError(r.error));
261
- process.exit(1);
262
- }
263
- return;
264
- }
265
- if (action === "use") {
266
- const { skillUse } = await import("./commands/skill.js");
267
- const r = await skillUse(arg);
268
- if (!r.ok) {
269
- process.stderr.write(formatCliError(r.error));
270
- process.exit(1);
271
- }
272
- return;
273
- }
274
- if (action === "create") {
275
- const { skillCreate } = await import("./commands/skill.js");
276
- const depStr = str(options.deps);
277
- const dirStr = str(options.dir);
278
- const r = await skillCreate({
279
- name: str(options.name),
280
- description: str(options.description),
281
- file: str(options.file),
282
- ...(dirStr ? { dir: dirStr } : {}),
283
- ...(depStr ? { deps: depStr } : {}),
284
- update: options.update === true,
285
- org: options.org === true,
286
- });
287
- if (!r.ok) {
288
- process.stderr.write(formatCliError(r.error));
289
- process.exit(1);
290
- }
291
- return;
292
- }
293
- if (action === "share") {
294
- const { skillShare } = await import("./commands/skill.js");
295
- const r = await skillShare(arg, {
296
- with: str(options.with),
297
- org: options.org === true,
298
- });
299
- if (!r.ok) {
300
- process.stderr.write(formatCliError(r.error));
301
- process.exit(1);
302
- }
303
- return;
304
- }
305
- process.stderr.write(`Unknown subcommand "${action}". Use: glen skill search [query] | glen skill use <slug> | glen skill create | glen skill share <slug>\n`);
306
- process.exit(1);
307
- });
308
- cli
309
- .command("artifact <action> [arg]", "Org artifact library: search [query] | get <slug> | create | list | share <slug> | delete <slug>")
310
- .option("--title <title>", "artifact create: the artifact's title")
311
- .option("--file <path>", "artifact create: path to the .md/.html document, or - for stdin")
312
- .option("--format <format>", "artifact create: markdown | html | auto (default: infer from extension)")
313
- .option("--update", "artifact create: overwrite your own same-named artifact")
314
- .option("--org", "artifact create/share: share with your whole org (create default: private to you)")
315
- .option("--with <emails>", "artifact share: comma-separated teammate emails to add")
316
- .action(async (action, arg, options) => {
317
- const str = (v) => typeof v === "string" ? v : undefined;
318
- if (action === "search") {
319
- const { artifactSearch } = await import("./commands/artifact.js");
320
- const r = await artifactSearch(arg);
321
- if (!r.ok) {
322
- process.stderr.write(formatCliError(r.error));
323
- process.exit(1);
324
- }
325
- return;
326
- }
327
- if (action === "get") {
328
- const { artifactGet } = await import("./commands/artifact.js");
329
- const r = await artifactGet(arg);
330
- if (!r.ok) {
331
- process.stderr.write(formatCliError(r.error));
332
- process.exit(1);
333
- }
334
- return;
335
- }
336
- if (action === "list") {
337
- const { artifactList } = await import("./commands/artifact.js");
338
- const r = await artifactList();
339
- if (!r.ok) {
340
- process.stderr.write(formatCliError(r.error));
341
- process.exit(1);
342
- }
343
- return;
344
- }
345
- if (action === "create") {
346
- const { artifactCreate } = await import("./commands/artifact.js");
347
- const r = await artifactCreate({
348
- title: str(options.title),
349
- file: str(options.file),
350
- format: str(options.format),
351
- update: options.update === true,
352
- org: options.org === true,
353
- });
354
- if (!r.ok) {
355
- process.stderr.write(formatCliError(r.error));
356
- process.exit(1);
357
- }
358
- return;
359
- }
360
- if (action === "delete") {
361
- const { artifactDelete } = await import("./commands/artifact.js");
362
- const r = await artifactDelete(arg);
363
- if (!r.ok) {
364
- process.stderr.write(formatCliError(r.error));
365
- process.exit(1);
366
- }
367
- return;
368
- }
369
- if (action === "share") {
370
- const { artifactShare } = await import("./commands/artifact.js");
371
- const r = await artifactShare(arg, {
372
- with: str(options.with),
373
- org: options.org === true,
374
- });
375
- if (!r.ok) {
376
- process.stderr.write(formatCliError(r.error));
377
- process.exit(1);
378
- }
379
- return;
380
- }
381
- process.stderr.write(`Unknown subcommand "${action}". Use: glen artifact search|get|create|list|share|delete\n`);
382
- process.exit(1);
383
- });
384
- cli
385
- .command("dependency <action> [arg]", "Org dependency registry: search [query]")
386
- .action(async (action, arg) => {
387
- if (action === "search") {
388
- const { dependencySearch } = await import("./commands/dependency.js");
389
- const r = await dependencySearch(arg);
390
- if (!r.ok) {
391
- process.stderr.write(formatCliError(r.error));
392
- process.exit(1);
393
- }
394
- return;
395
- }
396
- process.stderr.write(`Unknown subcommand "${action}". Use: glen dependency search [query]\n`);
397
- process.exit(1);
398
- });
399
- cli
400
- .command("git-hooks <action> [arg]", "Manage glen git hooks: install | prepare-commit-msg <msgFile>")
401
- .option("--absolute-git-hook-path", "Embed the absolute glen path in the hook (for GUI git clients)")
402
- .action(async (action, arg, options) => {
403
- if (action === "prepare-commit-msg") {
404
- const { writeCommitTrailer } = await import("./_utils/write-commit-trailer.js");
405
- await writeCommitTrailer(arg ?? "");
406
- return; // always exit 0 — never block a commit
407
- }
408
- if (action === "install") {
409
- const { installGitHooks } = await import("./commands/git-hooks.js");
410
- const result = await installGitHooks({
411
- absolute: options.absoluteGitHookPath ?? false,
412
- });
413
- if (!result.ok) {
414
- const { formatCliError } = await import("./_utils/cli-error.js");
415
- process.stderr.write(formatCliError(result.error));
416
- process.exit(1);
417
- }
418
- return;
419
- }
420
- process.stderr.write(`Unknown subcommand "${action}". Use: glen git-hooks install\n`);
421
- });
422
- cli
423
- .command("install", "Detect coding agents and install glen plugins")
424
- .option("--agent <agent>", "Install for one agent non-interactively: claude (alias: claude-code) | codex | cursor | pi | jcode")
425
- .option("--codex-path <path>", "Absolute path to the codex binary (when auto-detection fails)")
426
- .option("--claude-path <path>", "Absolute path to the claude binary (when auto-detection fails)")
427
- .option("--pi-path <path>", "Absolute path to the pi binary (when auto-detection fails)")
428
- .option("--jcode-path <path>", "Absolute path to the jcode binary (when auto-detection fails)")
429
- .action(async (options) => {
430
- if (options.agent === true) {
431
- process.stderr.write("glen install: --agent requires a value (claude | codex | cursor | pi | jcode)\n");
432
- process.exit(1);
433
- }
434
- if (options.codexPath === true ||
435
- options.claudePath === true ||
436
- options.piPath === true ||
437
- options.jcodePath === true) {
438
- process.stderr.write("glen install: --codex-path/--claude-path/--pi-path/--jcode-path require a value (an absolute path to the binary)\n");
439
- process.exit(1);
440
- }
441
- const agent = typeof options.agent === "string" ? options.agent : undefined;
442
- const { install } = await import("./commands/install.js");
443
- const result = await install(agent, {
444
- codex: typeof options.codexPath === "string" ? options.codexPath : undefined,
445
- claude: typeof options.claudePath === "string"
446
- ? options.claudePath
447
- : undefined,
448
- pi: typeof options.piPath === "string" ? options.piPath : undefined,
449
- jcode: typeof options.jcodePath === "string" ? options.jcodePath : undefined,
450
- });
451
- if (!result.ok) {
452
- process.stderr.write(formatCliError(result.error));
453
- process.exit(1);
454
- }
455
- });
456
- cli
457
- .command("uninstall", "Completely remove Glen's local plugins, hooks, state, caches, and CLI")
458
- .action(async () => {
459
- const { uninstall } = await import("./commands/uninstall.js");
460
- const result = await uninstall();
461
- if (!result.ok) {
462
- process.stderr.write(formatCliError(result.error));
463
- process.exit(1);
464
- }
465
- });
466
- cli.command("version", "Print the CLI version").action(() => {
467
- process.stdout.write(`${cliVersion}\n`);
468
- });
469
- cli
470
- .command("update", "Update the glen CLI and any installed glen plugins")
471
- .action(async () => {
472
- const { update } = await import("./commands/update.js");
473
- const result = await update();
474
- if (!result.ok) {
475
- process.stderr.write(formatCliError(result.error));
476
- process.exit(1);
477
- }
478
- });
479
- cli
480
- .command("doctor", "Show version, update status, session state, and plugin hints")
481
- .option("--auto", "Quiet mode: run background update + plugin upgrades (used by hooks)")
482
- .option("--login-check", "Print a one-line warning when glen is installed but has never recorded from this machine (used by the shell-profile hook)")
483
- .action(async (options) => {
484
- const { doctor } = await import("./commands/doctor.js");
485
- const result = await doctor({
486
- auto: options.auto === true,
487
- loginCheck: options.loginCheck === true,
488
- });
489
- if (!result.ok) {
490
- process.stderr.write(formatCliError(result.error));
491
- process.exit(1);
492
- }
493
- });
494
- cli
495
- .command("indicator <action>", "Menu bar recording indicator (macOS): start | stop | status")
496
- .action(async (action) => {
497
- const { indicator } = await import("./commands/indicator.js");
498
- const result = await indicator(action);
499
- if (!result.ok) {
500
- process.stderr.write(formatCliError(result.error));
501
- process.exit(1);
502
- }
503
- });
504
- cli
505
- .command("statusline", "Output a single status line for the agent's UI (used by hooks)")
506
- .action(async () => {
507
- try {
508
- const { statusline } = await import("./commands/statusline.js");
509
- await statusline();
510
- }
511
- catch {
512
- // Statusline must never break the host UI — output the safe fallback.
513
- process.stdout.write('🏔️ glen — ask me to "set up glen"');
514
- }
515
- process.exit(0);
516
- });
517
- cli
518
- .command("session-start", "Output hook JSON for the agent's SessionStart event (used by hooks)")
519
- .option("--agent <agent>", "Agent type (claude-code | codex | cursor | pi | jcode) — selects the hook output shape")
520
- .action(async (options) => {
521
- try {
522
- const { sessionStart } = await import("./commands/session-start.js");
523
- await sessionStart(options.agent);
524
- }
525
- catch {
526
- // Hook must never block a session — output a safe no-op JSON response.
527
- if (options.agent === "cursor") {
528
- process.stdout.write(JSON.stringify({
529
- additional_context: "[glen] not set up — use the setup skill",
530
- }));
531
- }
532
- else {
533
- process.stdout.write(JSON.stringify({
534
- hookSpecificOutput: {
535
- hookEventName: "SessionStart",
536
- additionalContext: "[glen] not set up — use the setup skill",
537
- },
538
- }));
539
- }
540
- }
541
- process.exit(0);
542
- });
543
- cli.command("__self-update", "(internal)").action(async () => {
544
- const { runSelfUpdate } = await import("./_utils/update.js");
545
- runSelfUpdate();
546
- process.exit(0);
547
- });
548
- cli.command("__codex-hooks-repair", "(internal)").action(async () => {
549
- const { installCodexHooks } = await import("./_utils/codex-hooks-setup.js");
550
- const { writeRepairTrace } = await import("./_utils/codex-repair-trace.js");
551
- const r = await installCodexHooks();
552
- await writeRepairTrace(r.ok ? { ok: true } : { ok: false, error: r.error });
553
- process.exit(0);
554
- });
40
+ cliInput.command(cli, "login", "Connect glen via browser sign-in", loginOptions, (input) => run("login", async () => (await import("./commands/login/index.js")).login(input)));
41
+ cliInput.command(cli, "logout", "Sign out of glen and remove credentials", logoutOptions, () => run("logout", async () => (await import("./commands/logout/index.js")).logout()));
42
+ cliInput.command(cli, "status", "Check connection status", statusOptions, () => run("status", async () => (await import("./commands/status/index.js")).status()));
43
+ cliInput.command(cli, "search <query>", "Search glen memory", searchOptions, (input) => run("search", async () => (await import("./commands/search/index.js")).search(input)));
44
+ cliInput.command(cli, "takeover <code>", "Continue a shared transcript in a fresh native agent session", takeoverOptions, (input) => run("takeover", async () => (await import("./commands/takeover/index.js")).takeover(input)));
45
+ cliInput.command(cli, "code-search <location> [question]", 'Trace selected code to the conversations that produced it: code-search <path:start-end> "<question>"', codeSearchOptions, (input) => run("code-search", async () => (await import("./commands/code-search/index.js")).codeSearch(input)));
46
+ cliInput.command(cli,
47
+ // cac's variadic form is `<...name>`; `<name...>` silently drops extra paths.
48
+ "import <...path>", "Import old local agent transcripts (Claude Code, Codex, Cursor, Pi) into glen memory", importOptions, (input) => run("import", async () => (await import("./commands/import/index.js")).importTranscripts(input)));
49
+ cliInput.command(cli, "forget <...reference>", "Forget one or more observation:<id> or message:<id> search sources", forgetOptions, (input) => run("forget", async () => (await import("./commands/forget/index.js")).forget(input)));
50
+ cliInput.command(cli, "restore <...reference>", "Restore one or more forgotten observation:<id> or message:<id> sources", restoreOptions, (input) => run("restore", async () => (await import("./commands/restore/index.js")).restore(input)));
51
+ cliInput.command(cli,
52
+ // cac's variadic form is `[...name]`; `[name...]` passes one string, which the spread splits into chars.
53
+ "invite [email] [...otherEmails]", "Invite teammates by email, or print a shareable join link when no email is given", inviteOptions, (input) => run("invite", async () => (await import("./commands/invite/index.js")).invite(input)));
54
+ for (const [mode, description] of [
55
+ ["on", "Turn glen on: inject context and record"],
56
+ ["off", "Turn glen off: inject nothing and record nothing until `glen on`"],
57
+ ["silent", "Silent mode: record everything, surface nothing until `glen on`"],
58
+ ])
59
+ cliInput.command(cli, mode, description, setModeOptions[mode], () => run(mode, async () => (await import("./commands/set-mode/index.js")).setMode(mode)));
60
+ cliInput.command(cli, "incognito [state]", "Go off the record: keep recalling, record nothing (back-compat: on|off)", incognitoOptions, (input) => run("incognito", async () => (await import("./commands/incognito/index.js")).incognito(input)));
61
+ cliInput.command(cli, "suggestions <kind> <state>", "Toggle glen's skill nudges account-wide: skill-create|skill-use on|off", suggestionsOptions, (input) => run("suggestions", async () => (await import("./commands/suggestions/index.js")).suggestions(input)));
62
+ cliInput.command(cli, "telemetry [action]", "Error reporting for glen itself: status (default) | enable | disable", telemetryOptions.telemetry, (input) => run("telemetry", async () => (await import("./commands/telemetry/index.js")).telemetry(input)));
63
+ cliInput.hook(cli, "ingest", "Ingest a turn from stdin (used by agent hooks)", ingestOptions, (input) => runHook("ingest", input.agent, async () => (await import("./commands/ingest/index.js")).ingest(input)));
64
+ cliInput.hook(cli, "pr-link", "Surface a Glen review link from a tool event (used by agent hooks)", prLinkOptions, (input) => runHook("pr-link", input.agent, async () => (await import("./commands/pr-link/index.js")).prLink(input)));
65
+ cliInput.command(cli, "bug <title>", "Report a glen bug to the Glen team", feedbackOptions.bug, (input) => run("bug", async () => (await import("./commands/feedback/index.js")).feedback.bug(input)));
66
+ cliInput.command(cli, "feedback <title>", "Send product feedback to the Glen team", feedbackOptions.feedback, (input) => run("feedback", async () => (await import("./commands/feedback/index.js")).feedback.feedback(input)));
67
+ cliInput.command(cli, "org <action> [slug]", "Manage organizations: list | switch [slug]", orgOptions, (input) => run("org", async () => input.action === "list"
68
+ ? (await import("./commands/org/list.js")).orgList()
69
+ : (await import("./commands/org/switch.js")).orgSwitch(input.slug)));
70
+ cliInput.command(cli, "skill <action> [arg]", "Glen skill library: search [query] | use <slug> | create | share <slug>", skillOptions, (input) => run("skill", async () => {
71
+ switch (input.action) {
72
+ case "search":
73
+ return (await import("./commands/skill/search.js")).skillSearch(input);
74
+ case "use":
75
+ return (await import("./commands/skill/use.js")).skillUse(input.arg);
76
+ case "create":
77
+ return (await import("./commands/skill/create/index.js")).skillCreate(input);
78
+ case "share":
79
+ return (await import("./commands/skill/share.js")).skillShare(input);
80
+ }
81
+ }));
82
+ cliInput.command(cli, "artifact <action> [arg]", "Org artifact library: search [query] | get <slug> | create | list | share <slug> | delete <slug>", artifactOptions, (input) => run("artifact", async () => {
83
+ switch (input.action) {
84
+ case "search":
85
+ return (await import("./commands/artifact/search.js")).artifactSearch(input.arg);
86
+ case "get":
87
+ return (await import("./commands/artifact/get.js")).artifactGet(input.arg);
88
+ case "list":
89
+ return (await import("./commands/artifact/list.js")).artifactList();
90
+ case "create":
91
+ return (await import("./commands/artifact/create.js")).artifactCreate(input);
92
+ case "delete":
93
+ return (await import("./commands/artifact/delete.js")).artifactDelete(input.arg);
94
+ case "share":
95
+ return (await import("./commands/artifact/share.js")).artifactShare(input);
96
+ }
97
+ }));
98
+ cliInput.command(cli, "dependency <action> [arg]", "Org dependency registry: search [query]", dependencyOptions, (input) => run("dependency", async () => (await import("./commands/dependency/index.js")).dependencySearch(input.arg)));
99
+ cliInput.command(cli, "git-hooks <action> [arg]", "Manage glen git hooks: install | prepare-commit-msg <msgFile>", gitHooksOptions, (input) =>
100
+ // Called by git on every commit: must never block it.
101
+ input.action === "prepare-commit-msg"
102
+ ? runHook("git-hooks.prepare-commit-msg", undefined, async () => (await import("./commands/git-hooks/write-commit-trailer.js")).writeCommitTrailer(input.arg ?? ""))
103
+ : run("git-hooks", async () => (await import("./commands/git-hooks/index.js")).installGitHooks(input)));
104
+ cliInput.command(cli, "install", "Detect coding agents and install glen plugins", installOptions.install, (input) => run("install", async () => (await import("./commands/install/index.js")).install(input)));
105
+ cliInput.command(cli, "uninstall", "Completely remove Glen's local plugins, hooks, state, caches, and CLI", uninstallOptions, () => run("uninstall", async () => (await import("./commands/uninstall/index.js")).uninstall()));
106
+ cliInput.command(cli, "version", "Print the CLI version", cliInput.define({}), () => run("version", async () => {
107
+ out.data(cliVersion);
108
+ return ok(undefined);
109
+ }));
110
+ cliInput.command(cli, "update", "Update the glen CLI and any installed glen plugins", updateOptions.update, () => run("update", async () => (await import("./commands/update/index.js")).update()));
111
+ cliInput.command(cli, "doctor", "Show version, update status, session state, and plugin hints", doctorOptions, (input) => {
112
+ const doctor = async () => (await import("./commands/doctor/index.js")).doctor(input);
113
+ // --auto runs inside SessionStart and --login-check in the shell profile.
114
+ return input.auto || input.loginCheck
115
+ ? runHook("doctor", undefined, doctor)
116
+ : run("doctor", doctor);
117
+ });
118
+ cliInput.command(cli, "indicator <action>", "Menu bar recording indicator (macOS): start | stop | status", indicatorOptions, (input) => run("indicator", async () => (await import("./commands/indicator/index.js")).indicator(input)));
119
+ cliInput.hook(cli, "statusline", "Output a single status line for the agent's UI (used by hooks)", statuslineOptions, () => runHook("statusline", undefined, async () => (await import("./commands/statusline/index.js")).statusline(), () => out.hookText('🏔️ glen · ask me to "set up glen"')));
120
+ cliInput.hook(cli, "session-start", "Output hook JSON for the agent's SessionStart event (used by hooks)", sessionStartOptions, (input) => runHook("session-start", input.agent, async () => (await import("./commands/session-start/index.js")).sessionStart(input), () => out.hookJson(input.agent === "cursor"
121
+ ? { additional_context: "[glen] not set up: use the setup skill" }
122
+ : {
123
+ hookSpecificOutput: {
124
+ hookEventName: "SessionStart",
125
+ additionalContext: "[glen] not set up: use the setup skill",
126
+ },
127
+ })));
128
+ cliInput.hook(cli, "__self-update", "(internal)", updateOptions.selfUpdate, () => runHook("__self-update", undefined, async () => (await import("./commands/update/self-update.js")).selfUpdate()));
129
+ cliInput.hook(cli, "__codex-hooks-repair", "(internal)", installOptions.codexHooksRepair, () => runHook("__codex-hooks-repair", undefined, async () => (await import("./commands/install/codex-hooks-repair.js")).codexHooksRepair()));
130
+ cliInput.hook(cli, "__telemetry-send", "(internal)", telemetryOptions.send, () => runHook("__telemetry-send", undefined, async () => (await import("./commands/telemetry/send.js")).telemetrySend()));
555
131
  // Unknown commands must fail loudly: cac's default is a silent exit 0, which reads as success.
556
132
  cli.on("command:*", () => {
557
- process.stderr.write(`glen: unknown command "${cli.args[0]}". Run \`glen --help\` for usage.\n`);
558
- process.exit(1);
133
+ void run("unknown", async () => err(cliErr("Usage", {
134
+ code: "cli.unknown_command",
135
+ what: `unknown command "${cli.args[0] ?? ""}"`,
136
+ remedy: "run `glen --help` for usage",
137
+ })));
559
138
  });
560
139
  cli.help();
561
140
  cli.version(cliVersion);
562
141
  // No process.exit here: exiting right after help output can truncate piped stdout.
563
- const isBareInvocation = process.argv.length <= 2;
564
- if (isBareInvocation) {
565
- const { maybeOnboard } = await import("./commands/onboard.js");
566
- const result = await maybeOnboard();
567
- if (!(result.ok && result.value === "ran")) {
142
+ if (process.argv.length <= 2) {
143
+ const { maybeOnboard } = await import("./commands/onboard/index.js");
144
+ const result = await maybeOnboard(() => cliInput.defaults(installOptions.install));
145
+ if (!(result.ok && result.value === "ran"))
568
146
  cli.outputHelp();
569
- }
570
147
  }
571
148
  else {
572
- const { normalizeBooleanFlags } = await import("./_utils/normalize-boolean-flags.js");
149
+ const { normalizeBooleanFlags } = await import("./core/run/normalize-boolean-flags.js");
573
150
  cli.parse(normalizeBooleanFlags(process.argv, ["--dry-run"]));
574
151
  }
575
152
  //# sourceMappingURL=bin.js.map