@iowarp/clio-coder 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/CHANGELOG.md +407 -0
  2. package/CODE_OF_CONDUCT.md +21 -0
  3. package/CONTRIBUTING.md +224 -0
  4. package/LICENSE +202 -0
  5. package/NOTICE +9 -0
  6. package/README.md +798 -0
  7. package/SECURITY.md +72 -0
  8. package/assets/clio-coder-logo-128.webp +0 -0
  9. package/damage-control-rules.yaml +419 -0
  10. package/dist/acp-UMLFVA3F.js +92 -0
  11. package/dist/agents-Q4MYPMUW.js +91 -0
  12. package/dist/auth-O6HYIJ6J.js +521 -0
  13. package/dist/chunk-262G75JS.js +35 -0
  14. package/dist/chunk-26BZQOAD.js +1281 -0
  15. package/dist/chunk-2J63S4SF.js +508 -0
  16. package/dist/chunk-3DANZDGR.js +717 -0
  17. package/dist/chunk-4UQA7NCT.js +29 -0
  18. package/dist/chunk-527KG6XR.js +497 -0
  19. package/dist/chunk-5LDRNKX2.js +1063 -0
  20. package/dist/chunk-5N2FG33Q.js +25 -0
  21. package/dist/chunk-67MTHP2E.js +135 -0
  22. package/dist/chunk-6CWDTGUC.js +20 -0
  23. package/dist/chunk-7BHLZB3A.js +2115 -0
  24. package/dist/chunk-7RBKDI66.js +348 -0
  25. package/dist/chunk-AMFR5YA3.js +541 -0
  26. package/dist/chunk-BBUH4VAA.js +1224 -0
  27. package/dist/chunk-BYEU76JP.js +899 -0
  28. package/dist/chunk-CLJ5HLUD.js +458 -0
  29. package/dist/chunk-D5YD55AR.js +116 -0
  30. package/dist/chunk-DXQNI4PC.js +61 -0
  31. package/dist/chunk-E3NYWENM.js +1004 -0
  32. package/dist/chunk-GNGDQYDU.js +34688 -0
  33. package/dist/chunk-GOTUR54M.js +9 -0
  34. package/dist/chunk-HBU5MTAM.js +41 -0
  35. package/dist/chunk-HMYNFFY4.js +28 -0
  36. package/dist/chunk-JPOWPFCU.js +1010 -0
  37. package/dist/chunk-JWHCJDCI.js +1215 -0
  38. package/dist/chunk-KBR4MZZR.js +41 -0
  39. package/dist/chunk-KKKPTZLM.js +93 -0
  40. package/dist/chunk-ME6DNWIU.js +66 -0
  41. package/dist/chunk-NI4DEJMC.js +88 -0
  42. package/dist/chunk-O4EJEDHO.js +659 -0
  43. package/dist/chunk-PIDUD6M2.js +31 -0
  44. package/dist/chunk-PS4PFJQP.js +29459 -0
  45. package/dist/chunk-QV47YRF4.js +48 -0
  46. package/dist/chunk-RQDWMVRB.js +279 -0
  47. package/dist/chunk-TFSSEXL6.js +136 -0
  48. package/dist/chunk-TKHQ4DGZ.js +8290 -0
  49. package/dist/chunk-TPOCL34A.js +2876 -0
  50. package/dist/chunk-UGYAX5YI.js +565 -0
  51. package/dist/chunk-UHTSULZS.js +461 -0
  52. package/dist/chunk-UU3R62TT.js +128 -0
  53. package/dist/chunk-UWIJNAOB.js +3906 -0
  54. package/dist/chunk-VOO7NYPP.js +914 -0
  55. package/dist/chunk-VPAWTYLY.js +117 -0
  56. package/dist/chunk-WD6AJM35.js +1216 -0
  57. package/dist/chunk-X3BR7HWV.js +115 -0
  58. package/dist/chunk-X3NE4WVW.js +120 -0
  59. package/dist/chunk-XNISANGE.js +1395 -0
  60. package/dist/chunk-XV4ZJ6ZM.js +3177 -0
  61. package/dist/cli/index.js +236 -0
  62. package/dist/clio-KIQ5SNDS.js +53 -0
  63. package/dist/components-JVHMUBEB.js +653 -0
  64. package/dist/config-ZFCDBMDC.js +372 -0
  65. package/dist/configure-G4E3A2PG.js +27 -0
  66. package/dist/context-CDXTP2MP.js +293 -0
  67. package/dist/context-E3KIFVXI.js +185 -0
  68. package/dist/context-clear-3F4PLXOS.js +102 -0
  69. package/dist/context-index-Q7YSYTR3.js +106 -0
  70. package/dist/docs-YIETIWZI.js +280 -0
  71. package/dist/doctor-M5HJJZOL.js +61 -0
  72. package/dist/domains/agents/builtins/architect.md +33 -0
  73. package/dist/domains/agents/builtins/coder.md +31 -0
  74. package/dist/domains/agents/builtins/context-bootstrap.md +38 -0
  75. package/dist/domains/agents/builtins/debugger.md +30 -0
  76. package/dist/domains/agents/builtins/documenter.md +31 -0
  77. package/dist/domains/agents/builtins/git-master.md +30 -0
  78. package/dist/domains/agents/builtins/provenance.md +30 -0
  79. package/dist/domains/agents/builtins/researcher.md +71 -0
  80. package/dist/domains/agents/builtins/scout.md +42 -0
  81. package/dist/domains/agents/builtins/tester.md +31 -0
  82. package/dist/domains/agents/builtins/verifier.md +30 -0
  83. package/dist/domains/agents/builtins/wiki-writer.md +41 -0
  84. package/dist/eval-B3KZZESM.js +2674 -0
  85. package/dist/evidence-V67CHM35.js +233 -0
  86. package/dist/evolve-YDZSUQYA.js +518 -0
  87. package/dist/extensions-SRG7XCAH.js +207 -0
  88. package/dist/fleet-CA2CRTVG.js +760 -0
  89. package/dist/fleet-preflight-CLIAX7YR.js +21 -0
  90. package/dist/init-2OZDJE2D.js +227 -0
  91. package/dist/memory-3PIQQAKX.js +207 -0
  92. package/dist/models-DY35XI7Y.js +237 -0
  93. package/dist/paths-5OMXW7Z4.js +57 -0
  94. package/dist/preload-KZVHET2B.js +11 -0
  95. package/dist/reset-PIFYNOS3.js +216 -0
  96. package/dist/run-3VSPP24F.js +735 -0
  97. package/dist/share-D36RQCXM.js +241 -0
  98. package/dist/skills-F2MRLELY.js +445 -0
  99. package/dist/skills-eval-E2ZTW4PL.js +932 -0
  100. package/dist/targets-DZMEZAH4.js +977 -0
  101. package/dist/trace-7NYCUI2J.js +250 -0
  102. package/dist/uninstall-AD3JWHBB.js +322 -0
  103. package/dist/upgrade-WYYBKGDY.js +301 -0
  104. package/dist/usage-ULIDAGFF.js +755 -0
  105. package/dist/version-ROZ6CZKH.js +16 -0
  106. package/dist/wiki-generate-PKFIX6OB.js +377 -0
  107. package/dist/worker/entry.js +1739 -0
  108. package/docs/README.md +93 -0
  109. package/docs/acp.md +120 -0
  110. package/docs/alcf-provider.md +72 -0
  111. package/docs/architecture.md +172 -0
  112. package/docs/artifact-versions.md +54 -0
  113. package/docs/built-in-agents.md +265 -0
  114. package/docs/capacity-and-scheduling.md +97 -0
  115. package/docs/commands-and-modes.md +554 -0
  116. package/docs/config-knobs-audit.md +115 -0
  117. package/docs/configuration-and-targets.md +812 -0
  118. package/docs/context-engine.md +236 -0
  119. package/docs/dispatch-architecture-rationale.md +126 -0
  120. package/docs/documentation-coverage.md +46 -0
  121. package/docs/documentation-guide.md +166 -0
  122. package/docs/environment-variables.md +105 -0
  123. package/docs/eval-runner.md +205 -0
  124. package/docs/evals-internal.md +298 -0
  125. package/docs/evidence-and-memory.md +243 -0
  126. package/docs/evolution.md +143 -0
  127. package/docs/exit-codes-and-output.md +74 -0
  128. package/docs/extensions-and-sharing.md +306 -0
  129. package/docs/fleet-demo-runbook.md +179 -0
  130. package/docs/fleet-dispatch.md +591 -0
  131. package/docs/glossary.md +75 -0
  132. package/docs/html/agents_blueprint.html +936 -0
  133. package/docs/html/alcf_blueprint.html +324 -0
  134. package/docs/html/architecture_blueprint.html +850 -0
  135. package/docs/html/commands_blueprint.html +794 -0
  136. package/docs/html/config_knobs_audit_blueprint.html +178 -0
  137. package/docs/html/configuration_blueprint.html +1080 -0
  138. package/docs/html/context_blueprint.html +603 -0
  139. package/docs/html/documentation_blueprint.html +832 -0
  140. package/docs/html/environment_blueprint.html +404 -0
  141. package/docs/html/eval_blueprint.html +743 -0
  142. package/docs/html/evals_internal_blueprint.html +190 -0
  143. package/docs/html/evolution_blueprint.html +674 -0
  144. package/docs/html/extensions_blueprint.html +2065 -0
  145. package/docs/html/fleet_dispatch_blueprint.html +286 -0
  146. package/docs/html/index.html +919 -0
  147. package/docs/html/lifecycle_blueprint.html +723 -0
  148. package/docs/html/memory_blueprint.html +699 -0
  149. package/docs/html/middleware_blueprint.html +664 -0
  150. package/docs/html/models_blueprint.html +2366 -0
  151. package/docs/html/observability_blueprint.html +683 -0
  152. package/docs/html/provider_adapter_blueprint.html +245 -0
  153. package/docs/html/safety_blueprint.html +1386 -0
  154. package/docs/html/shared.css +571 -0
  155. package/docs/html/shared.js +143 -0
  156. package/docs/html/skills_blueprint.html +671 -0
  157. package/docs/html/soak_blueprint.html +182 -0
  158. package/docs/html/tool_usage_blueprint.html +350 -0
  159. package/docs/html/tools_blueprint.html +2249 -0
  160. package/docs/html/trace_blueprint.html +235 -0
  161. package/docs/html/tui_design_blueprint.html +314 -0
  162. package/docs/html/validation_blueprint.html +961 -0
  163. package/docs/html/worker_dispatch_blueprint.html +231 -0
  164. package/docs/installation-and-lifecycle.md +308 -0
  165. package/docs/middleware-and-components.md +148 -0
  166. package/docs/model-catalog.md +189 -0
  167. package/docs/observability.md +233 -0
  168. package/docs/proactive-memory.md +452 -0
  169. package/docs/prompt-envelope-and-tools.md +142 -0
  170. package/docs/provider-adapter-cookbook.md +148 -0
  171. package/docs/release-cut-checklist.md +138 -0
  172. package/docs/safety-model.md +357 -0
  173. package/docs/scientific-validation.md +105 -0
  174. package/docs/session-lifecycle.md +156 -0
  175. package/docs/skills-marketplace.md +46 -0
  176. package/docs/tool-usage.md +527 -0
  177. package/docs/trace-store.md +132 -0
  178. package/docs/troubleshooting.md +33 -0
  179. package/docs/tui-design.md +239 -0
  180. package/docs/worker-dispatch-mechanics.md +242 -0
  181. package/package.json +132 -0
  182. package/skills/README.md +408 -0
  183. package/skills/git/commit-crafting/SKILL.md +79 -0
  184. package/skills/git/commit-crafting/evals.md +92 -0
  185. package/skills/git/create-pr/SKILL.md +116 -0
  186. package/skills/git/create-pr/evals.md +114 -0
  187. package/skills/git/investigate-issue/SKILL.md +139 -0
  188. package/skills/git/investigate-issue/evals.md +94 -0
  189. package/skills/git/resolve-merge-conflicts/SKILL.md +96 -0
  190. package/skills/git/resolve-merge-conflicts/evals.md +58 -0
  191. package/skills/git/review-changes/SKILL.md +103 -0
  192. package/skills/git/review-changes/evals.md +85 -0
  193. package/skills/git/worktree-create/SKILL.md +92 -0
  194. package/skills/git/worktree-create/evals.md +97 -0
  195. package/skills/git/worktree-create/references/worktree-setup.md +66 -0
  196. package/skills/git/worktree-merge/SKILL.md +95 -0
  197. package/skills/git/worktree-merge/evals.md +114 -0
  198. package/skills/skill-marketplace.json +261 -0
  199. package/skills/workflow/cut-it/SKILL.md +86 -0
  200. package/skills/workflow/cut-it/evals.md +42 -0
  201. package/src/domains/agents/builtins/architect.md +33 -0
  202. package/src/domains/agents/builtins/coder.md +31 -0
  203. package/src/domains/agents/builtins/context-bootstrap.md +38 -0
  204. package/src/domains/agents/builtins/debugger.md +30 -0
  205. package/src/domains/agents/builtins/documenter.md +31 -0
  206. package/src/domains/agents/builtins/git-master.md +30 -0
  207. package/src/domains/agents/builtins/provenance.md +30 -0
  208. package/src/domains/agents/builtins/researcher.md +71 -0
  209. package/src/domains/agents/builtins/scout.md +42 -0
  210. package/src/domains/agents/builtins/tester.md +31 -0
  211. package/src/domains/agents/builtins/verifier.md +30 -0
  212. package/src/domains/agents/builtins/wiki-writer.md +41 -0
  213. package/src/domains/agents/fleets/build-review.md +34 -0
  214. package/src/domains/agents/fleets/build-test.md +35 -0
  215. package/src/domains/agents/fleets/sdlc.md +86 -0
  216. package/src/domains/prompts/fragments/identity/clio-worker.md +11 -0
  217. package/src/domains/prompts/fragments/identity/clio.md +26 -0
  218. package/src/domains/prompts/fragments/operating/contract.md +64 -0
  219. package/src/domains/prompts/fragments/safety/auto-edit.md +14 -0
  220. package/src/domains/prompts/fragments/safety/full-auto.md +14 -0
  221. package/src/domains/prompts/fragments/safety/read-only.md +13 -0
  222. package/src/domains/prompts/fragments/safety/suggest.md +13 -0
  223. package/src/domains/prompts/fragments/wiki/page.md +75 -0
  224. package/src/domains/prompts/fragments/wiki/plan.md +48 -0
  225. package/src/domains/providers/models/cloud-models/alcf.yaml +40 -0
  226. package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +993 -0
@@ -0,0 +1,236 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ traceBoot
4
+ } from "../chunk-6CWDTGUC.js";
5
+ import {
6
+ extractGlobalFlags,
7
+ parseFlags,
8
+ printError
9
+ } from "../chunk-67MTHP2E.js";
10
+
11
+ // src/cli/index.ts
12
+ import { fileURLToPath } from "node:url";
13
+ var HELP = `Clio Coder command line
14
+
15
+ Coding agent for HPC and scientific-software work, part of IOWarp's CLIO ecosystem of agentic
16
+ science. CLIO stands for Context Layer for Input/Output, named for the Greek muse of history.
17
+
18
+ Usage:
19
+ clio-coder start interactive repository chat
20
+ clio-coder acp serve Clio as an ACP v1 agent over stdio
21
+ clio-coder run [flags] <task> run one headless main-agent turn
22
+ clio-coder --version, -v print the Clio Coder version
23
+ clio-coder --api-key <key> override the active target API key for this run
24
+ clio-coder --no-context-files, -nc skip CLIO-CODER.md project-context injection
25
+ clio-coder configure interactive first-run/configuration wizard
26
+ clio-coder targets list configured targets, health, auth, and capabilities
27
+ clio-coder targets add add a target interactively or via flags
28
+ clio-coder targets use <id> set chat and fleet defaults to a target
29
+ clio-coder targets profile set a named fleet profile
30
+ clio-coder targets remove <id> remove a target
31
+ clio-coder targets rename <old> <new> rename a target
32
+ clio-coder models [search] list models for configured targets
33
+ clio-coder auth list|status|login|logout [target-or-runtime]
34
+ clio-coder doctor [--fix] diagnose state; --fix creates or repairs it
35
+ clio-coder paths [--json] print resolved config/data/cache directories
36
+ clio-coder reset recover or wipe Clio Coder state
37
+ clio-coder context show project context status (CLIO-CODER.md, preload, codewiki)
38
+ clio-coder context init [--yes] [--preview|--heuristic] explore the repo and bootstrap CLIO-CODER.md and codewiki
39
+ clio-coder context refresh [--wiki] re-index the codewiki and optionally update the Markdown wiki
40
+ clio-coder context wiki [--update] [--status] [--depth auto|simple|medium|detailed] [--target <id>] [--model <id>]
41
+ clio-coder context reset [--all] [--yes] clear accumulated project context artifacts
42
+ clio-coder context index [--json] build the codewiki index without model calls
43
+ clio-coder uninstall remove all Clio Coder state; --remove-binary also unlinks the launcher
44
+ clio-coder upgrade upgrade Clio Coder and run pending migrations
45
+ clio-coder agents list discovered agent recipes
46
+ clio-coder fleet list|run|status|drain|resume fleet contracts, status, and admission control
47
+ clio-coder evidence build, list, or inspect evidence artifacts
48
+ clio-coder eval run, report, or compare local eval task files
49
+ clio-coder memory list, propose, approve, reject, or prune memory
50
+ clio-coder usage report cross-session usage facts and opportunities (experimental)
51
+ clio-coder trace query or view the durable dispatch trace mirror
52
+ clio-coder extensions install, list, enable, disable, or remove extension packages
53
+ clio-coder skills list, inspect, validate, or install skills
54
+ clio-coder docs [topic] serve bundled HTML docs on 127.0.0.1 (--no-open to skip browser)
55
+ clio-coder dev <command> harness instruments; run 'clio-coder dev' for the list
56
+ clio-coder --help, -h this message
57
+ clio-coder --help --all this message plus every command under 'clio-coder dev'
58
+ `;
59
+ var DEV_COMMANDS = [
60
+ { name: "components", summary: "list, snapshot, or diff harness components" },
61
+ { name: "evolve", summary: "create, validate, or summarize change manifests" },
62
+ { name: "share", summary: "export or import Clio project/resource archives" }
63
+ ];
64
+ var DEV_HELP = `Clio Coder harness instruments
65
+
66
+ Usage:
67
+ ${DEV_COMMANDS.map((entry) => ` clio-coder dev ${entry.name.padEnd(20)}${entry.summary}`).join("\n")}
68
+
69
+ Each also resolves without the 'dev' prefix, so existing scripts and agent
70
+ callers keep working. The prefix exists so the default help stays the set of
71
+ commands a person needs to read.
72
+ `;
73
+ function helpText(all) {
74
+ return all ? `${HELP}
75
+ ${DEV_HELP}` : HELP;
76
+ }
77
+ var MIN_NODE = [22, 19, 0];
78
+ function nodeVersionError() {
79
+ const parts = process.versions.node.split(".").map((part) => Number.parseInt(part, 10));
80
+ for (let i = 0; i < MIN_NODE.length; i += 1) {
81
+ const actual = parts[i] ?? 0;
82
+ const wanted = MIN_NODE[i] ?? 0;
83
+ if (actual > wanted) return null;
84
+ if (actual < wanted) {
85
+ return `clio-coder requires Node.js >=${MIN_NODE.join(".")}; this is ${process.versions.node}. Upgrade Node and retry.`;
86
+ }
87
+ }
88
+ return null;
89
+ }
90
+ async function main(argv) {
91
+ traceBoot("cli entry");
92
+ const versionError = nodeVersionError();
93
+ if (versionError !== null) {
94
+ printError(versionError);
95
+ return 1;
96
+ }
97
+ const {
98
+ apiKey,
99
+ noContextFiles,
100
+ noSkills,
101
+ skillPaths,
102
+ rest,
103
+ error: globalFlagError
104
+ } = extractGlobalFlags(argv, isCommandToken);
105
+ if (globalFlagError) {
106
+ printError(globalFlagError);
107
+ return 2;
108
+ }
109
+ const { flags, positional } = parseFlags(rest);
110
+ const subcommand = positional[0];
111
+ const subcommandIndex = rest.findIndex((arg) => !arg.startsWith("-"));
112
+ const firstArg = rest[0];
113
+ if (firstArg === "--help" || firstArg === "-h" || (flags.has("help") || flags.has("h")) && !subcommand) {
114
+ process.stdout.write(helpText(flags.has("all")));
115
+ return 0;
116
+ }
117
+ if (flags.has("version") || flags.has("v")) {
118
+ const { runVersionCommand } = await import("../version-ROZ6CZKH.js");
119
+ return runVersionCommand();
120
+ }
121
+ const subArgs = subcommandIndex === -1 ? [] : rest.slice(subcommandIndex + 1);
122
+ const bootOptions = {
123
+ ...apiKey === void 0 ? {} : { apiKey },
124
+ ...noContextFiles ? { noContextFiles: true } : {},
125
+ ...noSkills ? { noSkills: true } : {},
126
+ ...skillPaths.length > 0 ? { skillPaths } : {}
127
+ };
128
+ if (!subcommand) {
129
+ const { runClioCommand } = await import("../clio-KIQ5SNDS.js");
130
+ return runClioCommand(bootOptions);
131
+ }
132
+ return dispatch(subcommand, subArgs, bootOptions);
133
+ }
134
+ var extensionsCommand = async (subArgs) => (await import("../extensions-SRG7XCAH.js")).runExtensionsCommand(subArgs);
135
+ var COMMAND_HANDLERS = /* @__PURE__ */ new Map([
136
+ ["acp", async (subArgs, bootOptions) => (await import("../acp-UMLFVA3F.js")).runAcpCommand(subArgs, bootOptions)],
137
+ ["auth", async (subArgs) => (await import("../auth-O6HYIJ6J.js")).runAuthCommand(subArgs)],
138
+ ["config", async (subArgs) => (await import("../config-ZFCDBMDC.js")).runConfigCommand(subArgs)],
139
+ ["configure", async (subArgs) => (await import("../configure-G4E3A2PG.js")).runConfigureCommand(subArgs)],
140
+ ["targets", async (subArgs) => (await import("../targets-DZMEZAH4.js")).runTargetsCommand(subArgs)],
141
+ ["models", async (subArgs) => (await import("../models-DY35XI7Y.js")).runModelsCommand(subArgs)],
142
+ ["agents", async (subArgs) => (await import("../agents-Q4MYPMUW.js")).runAgentsCommand(subArgs)],
143
+ ["components", async (subArgs) => (await import("../components-JVHMUBEB.js")).runComponentsCommand(subArgs)],
144
+ ["evidence", async (subArgs) => (await import("../evidence-V67CHM35.js")).runEvidenceCommand(subArgs)],
145
+ ["eval", async (subArgs) => (await import("../eval-B3KZZESM.js")).runEvalCommand(subArgs)],
146
+ ["memory", async (subArgs) => (await import("../memory-3PIQQAKX.js")).runMemoryCommand(subArgs)],
147
+ ["usage", async (subArgs) => (await import("../usage-ULIDAGFF.js")).runUsageCommand(subArgs)],
148
+ ["trace", async (subArgs) => (await import("../trace-7NYCUI2J.js")).runTraceCommand(subArgs)],
149
+ ["evolve", async (subArgs) => (await import("../evolve-YDZSUQYA.js")).runEvolveCommand(subArgs)],
150
+ [
151
+ "dev",
152
+ async (subArgs, bootOptions) => {
153
+ const devSubcommand = subArgs[0];
154
+ if (devSubcommand === void 0 || devSubcommand === "--help" || devSubcommand === "-h") {
155
+ process.stdout.write(DEV_HELP);
156
+ return 0;
157
+ }
158
+ if (!DEV_COMMANDS.some((entry) => entry.name === devSubcommand)) {
159
+ printError(`unknown dev command: ${devSubcommand}`);
160
+ process.stdout.write(DEV_HELP);
161
+ return 2;
162
+ }
163
+ return dispatch(devSubcommand, subArgs.slice(1), bootOptions);
164
+ }
165
+ ],
166
+ ["extensions", extensionsCommand],
167
+ ["ext", extensionsCommand],
168
+ ["fleet", async (subArgs) => (await import("../fleet-CA2CRTVG.js")).runFleetCommand(subArgs)],
169
+ ["skills", async (subArgs) => (await import("../skills-F2MRLELY.js")).runSkillsCommand(subArgs)],
170
+ ["docs", async (subArgs) => (await import("../docs-YIETIWZI.js")).runDocsCommand(subArgs)],
171
+ ["share", async (subArgs) => (await import("../share-D36RQCXM.js")).runShareCommand(subArgs)],
172
+ ["export", async (subArgs) => (await import("../share-D36RQCXM.js")).runExportCommand(subArgs)],
173
+ ["import", async (subArgs) => (await import("../share-D36RQCXM.js")).runImportCommand(subArgs)],
174
+ ["context", async (subArgs) => (await import("../context-CDXTP2MP.js")).runContextCommand(subArgs)],
175
+ ["run", async (subArgs, bootOptions) => (await import("../run-3VSPP24F.js")).runClioRun(subArgs, bootOptions)],
176
+ ["doctor", async (subArgs) => (await import("../doctor-M5HJJZOL.js")).runDoctorCommand(subArgs)],
177
+ ["paths", async (subArgs) => (await import("../paths-5OMXW7Z4.js")).runPathsCommand(subArgs)],
178
+ ["reset", async (subArgs) => (await import("../reset-PIFYNOS3.js")).runResetCommand(subArgs)],
179
+ ["uninstall", async (subArgs) => (await import("../uninstall-AD3JWHBB.js")).runUninstallCommand(subArgs)],
180
+ ["upgrade", async (subArgs) => (await import("../upgrade-WYYBKGDY.js")).runUpgradeCommand(subArgs)],
181
+ ["version", async () => (await import("../version-ROZ6CZKH.js")).runVersionCommand()],
182
+ [
183
+ "worker",
184
+ async () => {
185
+ await import("../worker/entry.js");
186
+ return 0;
187
+ }
188
+ ]
189
+ ]);
190
+ var RETIRED_SUBCOMMANDS = /* @__PURE__ */ new Set(["context-init", "context-index", "context-clear"]);
191
+ function isCommandToken(token) {
192
+ return COMMAND_HANDLERS.has(token) || RETIRED_SUBCOMMANDS.has(token);
193
+ }
194
+ function incompleteInstallationAdvice(err) {
195
+ if (err?.code !== "ERR_MODULE_NOT_FOUND") return null;
196
+ const message = err instanceof Error ? err.message : String(err);
197
+ let outputDir;
198
+ try {
199
+ outputDir = fileURLToPath(new URL("../", import.meta.url));
200
+ } catch {
201
+ return null;
202
+ }
203
+ if (!message.includes(outputDir)) return null;
204
+ return [
205
+ `${message}`,
206
+ "",
207
+ "This Clio Coder installation is incomplete: the command's own module is missing from",
208
+ `${outputDir}`,
209
+ "Reinstall to restore it, using the line that matches how you installed:",
210
+ " npm install -g @iowarp/clio-coder # npm install",
211
+ " npm run install:local # source checkout"
212
+ ].join("\n");
213
+ }
214
+ async function dispatch(subcommand, subArgs, bootOptions) {
215
+ const handler = COMMAND_HANDLERS.get(subcommand);
216
+ if (handler) {
217
+ try {
218
+ return await handler(subArgs, bootOptions);
219
+ } catch (err) {
220
+ const advice = incompleteInstallationAdvice(err);
221
+ if (advice === null) throw err;
222
+ printError(advice);
223
+ return 1;
224
+ }
225
+ }
226
+ printError(`unknown subcommand: ${subcommand}`);
227
+ process.stdout.write(helpText(false));
228
+ return 2;
229
+ }
230
+ main(process.argv.slice(2)).then((code) => {
231
+ process.exitCode = code;
232
+ }).catch((err) => {
233
+ printError(err instanceof Error ? err.message : String(err));
234
+ process.exitCode = 1;
235
+ });
236
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,53 @@
1
+ import {
2
+ runClioCommand
3
+ } from "./chunk-PS4PFJQP.js";
4
+ import "./chunk-AMFR5YA3.js";
5
+ import "./chunk-O4EJEDHO.js";
6
+ import "./chunk-4UQA7NCT.js";
7
+ import "./chunk-3DANZDGR.js";
8
+ import "./chunk-JPOWPFCU.js";
9
+ import "./chunk-NI4DEJMC.js";
10
+ import "./chunk-7RBKDI66.js";
11
+ import "./chunk-527KG6XR.js";
12
+ import "./chunk-UU3R62TT.js";
13
+ import "./chunk-6CWDTGUC.js";
14
+ import "./chunk-BYEU76JP.js";
15
+ import "./chunk-HMYNFFY4.js";
16
+ import "./chunk-UWIJNAOB.js";
17
+ import "./chunk-X3BR7HWV.js";
18
+ import "./chunk-VOO7NYPP.js";
19
+ import "./chunk-GNGDQYDU.js";
20
+ import "./chunk-2J63S4SF.js";
21
+ import "./chunk-RQDWMVRB.js";
22
+ import "./chunk-7BHLZB3A.js";
23
+ import "./chunk-TPOCL34A.js";
24
+ import "./chunk-E3NYWENM.js";
25
+ import "./chunk-XV4ZJ6ZM.js";
26
+ import "./chunk-26BZQOAD.js";
27
+ import "./chunk-WD6AJM35.js";
28
+ import "./chunk-QV47YRF4.js";
29
+ import "./chunk-CLJ5HLUD.js";
30
+ import "./chunk-BBUH4VAA.js";
31
+ import "./chunk-GOTUR54M.js";
32
+ import "./chunk-KBR4MZZR.js";
33
+ import "./chunk-XNISANGE.js";
34
+ import "./chunk-KKKPTZLM.js";
35
+ import "./chunk-ME6DNWIU.js";
36
+ import "./chunk-262G75JS.js";
37
+ import "./chunk-TFSSEXL6.js";
38
+ import "./chunk-PIDUD6M2.js";
39
+ import "./chunk-67MTHP2E.js";
40
+ import "./chunk-TKHQ4DGZ.js";
41
+ import "./chunk-D5YD55AR.js";
42
+ import "./chunk-JWHCJDCI.js";
43
+ import "./chunk-UHTSULZS.js";
44
+ import "./chunk-5LDRNKX2.js";
45
+ import "./chunk-UGYAX5YI.js";
46
+ import "./chunk-5N2FG33Q.js";
47
+ import "./chunk-VPAWTYLY.js";
48
+ import "./chunk-X3NE4WVW.js";
49
+ import "./chunk-DXQNI4PC.js";
50
+ export {
51
+ runClioCommand
52
+ };
53
+ //# sourceMappingURL=clio-KIQ5SNDS.js.map