@iowarp/clio-coder 0.3.6 → 0.3.7
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.
- package/CHANGELOG.md +28 -0
- package/README.md +16 -5
- package/dist/{acp-2BEHC4DL.js → acp-SK4MD6MM.js} +10 -10
- package/dist/{agents-LNNFTM53.js → agents-2FN2K6ME.js} +30 -25
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-KXXFI2VS.js → auth-QIYZWM5I.js} +13 -13
- package/dist/{chunk-KHSFENX2.js → chunk-3HAPLH5M.js} +10 -10
- package/dist/{chunk-24I7BN55.js → chunk-465YSENW.js} +2 -2
- package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
- package/dist/{chunk-CYQKWTG3.js → chunk-4DWFMQDR.js} +4 -4
- package/dist/{chunk-E2ER4LJF.js → chunk-5C3AQNDW.js} +25 -1
- package/dist/{chunk-22NAGB7X.js → chunk-5C77SEEY.js} +5 -94
- package/dist/{chunk-43AOLP7E.js → chunk-5FR74PWO.js} +2 -1
- package/dist/{chunk-K7T3E2SR.js → chunk-5UJ6ECTS.js} +10 -9
- package/dist/{chunk-6US73PDB.js → chunk-6M7VS3J3.js} +5 -5
- package/dist/{chunk-CJUB2JJ2.js → chunk-6TUKSZVF.js} +5 -5
- package/dist/{chunk-5JGRAMKL.js → chunk-AB4XIIVB.js} +8 -6
- package/dist/{chunk-R46L2BIR.js → chunk-BMWK7ZIZ.js} +14 -20
- package/dist/{chunk-4BPJXDWC.js → chunk-C4JBQ5SR.js} +30 -14
- package/dist/{chunk-XXQNGV4M.js → chunk-CEYBNUGC.js} +243 -63
- package/dist/{chunk-VEZEGCGW.js → chunk-D4MDIG46.js} +20 -18
- package/dist/chunk-DJNLUABN.js +843 -0
- package/dist/{chunk-RY3LY4J5.js → chunk-DMD2AGVS.js} +5 -4
- package/dist/{chunk-KOHPCX4K.js → chunk-DOOEX22V.js} +2 -2
- package/dist/chunk-DQA7QLMD.js +123 -0
- package/dist/chunk-DR52UMZW.js +21 -0
- package/dist/{chunk-XF5N4U5A.js → chunk-EBEFWSGL.js} +6 -5
- package/dist/{chunk-EYPA3EGJ.js → chunk-EELBMBT6.js} +120 -13
- package/dist/{chunk-CKXWIANG.js → chunk-EOOQZZDE.js} +16 -14
- package/dist/{chunk-WR67VIZY.js → chunk-FOT2FX5J.js} +63 -5
- package/dist/{chunk-FYYLNIL5.js → chunk-GH5622CP.js} +2 -2
- package/dist/chunk-GWS3VEIW.js +195 -0
- package/dist/{chunk-LYF7OHWH.js → chunk-J7PIKKWC.js} +8 -463
- package/dist/{chunk-NILBFAPG.js → chunk-JNXPYBB4.js} +2 -2
- package/dist/{chunk-4VP4KH3K.js → chunk-JRIO5UD2.js} +4 -4
- package/dist/{chunk-6XXKFVSN.js → chunk-JTSEDYVQ.js} +7 -7
- package/dist/{chunk-QKMUKYO7.js → chunk-KCMKRQX4.js} +236 -84
- package/dist/chunk-KZ2H5X4G.js +1026 -0
- package/dist/{chunk-QNQHSOLF.js → chunk-LADCF22A.js} +12 -12
- package/dist/chunk-M4AKACEO.js +382 -0
- package/dist/{chunk-XYDYPRZI.js → chunk-MXI6J5JF.js} +7 -7
- package/dist/{chunk-G7MUEIGA.js → chunk-OB5HIGJY.js} +1 -1
- package/dist/{chunk-EKY57CSP.js → chunk-OBMAI2DP.js} +61 -767
- package/dist/chunk-PD3MESLB.js +242 -0
- package/dist/{chunk-ZRGEBJ4T.js → chunk-QCTRSGHQ.js} +21 -21
- package/dist/chunk-RVG5JXAL.js +41 -0
- package/dist/{chunk-RD5U66HV.js → chunk-SROCI7ZU.js} +7 -7
- package/dist/{chunk-MFFY33HR.js → chunk-THKY7CD7.js} +466 -205
- package/dist/{chunk-PCZJO5TI.js → chunk-UFQ3F4FW.js} +13 -178
- package/dist/{chunk-AD2SYQYC.js → chunk-UHXRNZ2J.js} +121 -3
- package/dist/chunk-UND3GU2L.js +103 -0
- package/dist/{chunk-QM3F2GKX.js → chunk-UUANF5CR.js} +2247 -2096
- package/dist/chunk-UVDSQ6LW.js +472 -0
- package/dist/{chunk-DJVECN66.js → chunk-VQNODYQ4.js} +14 -14
- package/dist/{chunk-3BPUFZDL.js → chunk-VREKEFLL.js} +3 -3
- package/dist/{chunk-PBTHKCPN.js → chunk-WJHBC77E.js} +6 -6
- package/dist/{chunk-XE2VEJHX.js → chunk-X2KV5FXT.js} +2 -2
- package/dist/{chunk-ZXF4XRKW.js → chunk-XEGB6BCN.js} +157 -7
- package/dist/{chunk-E25LMLRW.js → chunk-YD734TPH.js} +2 -2
- package/dist/{verifiers-NCBTHHN2.js → chunk-YTYFXUI3.js} +65 -322
- package/dist/{chunk-OH3TOQTB.js → chunk-ZGH7FGS5.js} +13 -7
- package/dist/cli/index.js +32 -30
- package/dist/{clio-M2KGYUFZ.js → clio-WBVQEBKO.js} +7 -7
- package/dist/{code-nav-GQNL7XA6.js → code-nav-FGGFIE7L.js} +3 -3
- package/dist/{components-5TTYYX6G.js → components-F7OEATSO.js} +4 -4
- package/dist/{config-XUUYQIWO.js → config-TRBL3RCF.js} +34 -29
- package/dist/{configure-IHJ7YOMV.js → configure-OLCVPHNM.js} +15 -15
- package/dist/{context-74JLXAWD.js → context-MJIJ6GOX.js} +11 -11
- package/dist/{context-ZQ7SIFJV.js → context-WFPKQSM6.js} +19 -3
- package/dist/{context-75MIWW3U.js → context-XEWE3MOJ.js} +31 -26
- package/dist/{context-clear-GYKWNUML.js → context-clear-KNOS2JPB.js} +31 -26
- package/dist/{context-working-set-UX5KEP4J.js → context-working-set-EUXAZI6N.js} +8 -8
- package/dist/{dispatch-runner-GIJBHNFL.js → dispatch-runner-B7MTOVKL.js} +313 -53
- package/dist/{docs-6FZSCG5B.js → docs-FLJTIDSE.js} +4 -4
- package/dist/{doctor-SVJ5BZCW.js → doctor-RN4YKO2X.js} +14 -14
- package/dist/{eval-CG6LLBLD.js → eval-RUBJVSNQ.js} +8 -7
- package/dist/{evidence-ZYFIEN42.js → evidence-JZNBUOQZ.js} +30 -25
- package/dist/{evolve-QGEXEMDW.js → evolve-FJVC4KKI.js} +30 -25
- package/dist/{extensions-ADGNCJJD.js → extensions-IQL36S7K.js} +4 -4
- package/dist/{fleet-S5R4ZOQY.js → fleet-BDKYJFCP.js} +214 -360
- package/dist/fleet-commands-ZFIWZSB3.js +70 -0
- package/dist/fleet-graph-Y6HPXIVF.js +125 -0
- package/dist/fleet-new-RDVJLHHH.js +48 -0
- package/dist/fleet-validate-BIYREGIK.js +79 -0
- package/dist/{init-5DRU55YR.js → init-LQUB5COQ.js} +44 -37
- package/dist/library-NJAHIGG4.js +217 -0
- package/dist/{memory-7YKKR6UC.js → memory-OG6HOYKM.js} +31 -26
- package/dist/{models-ZPOLRU2C.js → models-5ZG5XY7J.js} +21 -20
- package/dist/{monitor-US5F5YGZ.js → monitor-TJ7AMTGB.js} +49 -30
- package/dist/{orchestrator-E2AL4T5N.js → orchestrator-WZYB54DM.js} +3827 -581
- package/dist/{paths-E7KYAQWE.js → paths-XUC7GS6E.js} +4 -4
- package/dist/{reset-KZ652EK6.js → reset-PXQT45IY.js} +7 -7
- package/dist/{run-SRNBKDWD.js → run-FQ74YF62.js} +53 -45
- package/dist/{share-CGZE33UP.js → share-FW7SVCL3.js} +33 -9
- package/dist/{skills-S2X4DLY5.js → skills-7E7IRB3R.js} +24 -8
- package/dist/{skills-eval-W2GGIC4R.js → skills-eval-LI75W6OK.js} +34 -27
- package/dist/{targets-54SWINWB.js → targets-4CIFKCTW.js} +23 -22
- package/dist/{terminal-lease-SAIF2OGY.js → terminal-lease-WUZY7ZV5.js} +4 -4
- package/dist/{uninstall-BVLWXKBT.js → uninstall-7FV7IP4E.js} +4 -4
- package/dist/{upgrade-JKAR27XC.js → upgrade-K2HVIVMQ.js} +20 -19
- package/dist/{usage-MSAWCLX4.js → usage-GTZELZQX.js} +116 -49
- package/dist/verifiers-RLAHT27O.js +336 -0
- package/dist/{verify-X5HDROLA.js → verify-BX3BRKH5.js} +7 -6
- package/dist/{wiki-generate-GUSOQ6ZP.js → wiki-generate-ASIFASCN.js} +45 -37
- package/dist/worker/entry.js +38 -35
- package/docs/README.md +3 -2
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-versions.md +10 -6
- package/docs/built-in-agents.md +26 -2
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +82 -2
- package/docs/configuration-and-targets.md +79 -2
- package/docs/context-engine.md +1 -1
- package/docs/development-pipeline.md +1 -1
- package/docs/dispatch-architecture-rationale.md +1 -1
- package/docs/documentation-coverage.md +3 -3
- package/docs/documentation-guide.md +3 -3
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +1 -1
- package/docs/evidence-and-memory.md +5 -5
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +4 -1
- package/docs/extensions-and-sharing.md +6 -2
- package/docs/fleet-demo-runbook.md +2 -2
- package/docs/fleet-dispatch.md +197 -10
- package/docs/git-commit-provenance.md +2 -2
- package/docs/glossary.md +1 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +2 -1
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +55 -8
- package/docs/proactive-memory.md +1 -1
- package/docs/prompt-envelope-and-tools.md +1 -1
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +79 -64
- package/docs/resource-library.md +59 -0
- package/docs/safety-model.md +2 -2
- package/docs/scientific-validation.md +3 -3
- package/docs/session-lifecycle.md +37 -1
- package/docs/skills-marketplace.md +16 -3
- package/docs/tool-usage.md +14 -7
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +1 -1
- package/docs/worker-dispatch-mechanics.md +3 -3
- package/package.json +1 -1
- package/src/cli/fleet-commands.ts +37 -0
- package/src/cli/fleet-graph.ts +102 -0
- package/src/cli/fleet-new.ts +36 -0
- package/src/cli/fleet-preflight.ts +121 -0
- package/src/cli/fleet-validate.ts +30 -0
- package/src/cli/fleet.ts +173 -335
- package/src/cli/index.ts +3 -1
- package/src/cli/library.ts +190 -0
- package/src/cli/share.ts +13 -1
- package/src/cli/usage.ts +111 -19
- package/src/core/bus-events.ts +4 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/config.ts +130 -0
- package/src/core/defaults.ts +81 -0
- package/src/domains/agents/builtins/architect.md +1 -0
- package/src/domains/agents/builtins/oracle.md +33 -0
- package/src/domains/agents/catalog.ts +13 -1
- package/src/domains/agents/fleet-contract.ts +278 -16
- package/src/domains/agents/index.ts +14 -0
- package/src/domains/agents/result-contract.ts +235 -1
- package/src/domains/config/classify.ts +4 -0
- package/src/domains/dispatch/active-route-planner.ts +14 -0
- package/src/domains/dispatch/backoff.ts +2 -1
- package/src/domains/dispatch/capability-match.ts +1 -0
- package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
- package/src/domains/dispatch/contract.ts +34 -0
- package/src/domains/dispatch/delegation-plan.ts +167 -0
- package/src/domains/dispatch/execution-plan.ts +76 -5
- package/src/domains/dispatch/execution-role.ts +3 -1
- package/src/domains/dispatch/execution-scheduler.ts +183 -67
- package/src/domains/dispatch/extension.ts +258 -9
- package/src/domains/dispatch/fleet-gate.ts +14 -0
- package/src/domains/dispatch/fleet-plan.ts +63 -3
- package/src/domains/dispatch/fleet-run.ts +737 -0
- package/src/domains/dispatch/gate-role-prompts.ts +9 -0
- package/src/domains/dispatch/host-verification.ts +178 -0
- package/src/domains/dispatch/index.ts +38 -0
- package/src/domains/dispatch/intent.ts +159 -0
- package/src/domains/dispatch/receipt-integrity.ts +8 -4
- package/src/domains/dispatch/state.ts +36 -3
- package/src/domains/dispatch/types.ts +51 -6
- package/src/domains/dispatch/validation.ts +66 -6
- package/src/domains/evidence/trust-status.ts +10 -1
- package/src/domains/middleware/index.ts +15 -0
- package/src/domains/middleware/watchdog.ts +281 -0
- package/src/domains/observability/contract.ts +3 -1
- package/src/domains/observability/cost.ts +12 -1
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/observability/index.ts +10 -0
- package/src/domains/observability/out-of-turn-usage.ts +223 -0
- package/src/domains/resources/index.ts +20 -0
- package/src/domains/resources/library.ts +326 -0
- package/src/domains/resources/skills/marketplace.ts +37 -12
- package/src/domains/session/handoff.ts +629 -0
- package/src/domains/share/archive.ts +67 -2
- package/src/entry/orchestrator.ts +37 -0
- package/src/interactive/bus-notices.ts +26 -0
- package/src/interactive/chat-loop.ts +235 -1
- package/src/interactive/chat-renderer.ts +22 -0
- package/src/interactive/cost-overlay.ts +31 -3
- package/src/interactive/council-dispatch.ts +30 -0
- package/src/interactive/council-grid.ts +213 -0
- package/src/interactive/council.ts +99 -0
- package/src/interactive/dispatch-board.ts +260 -16
- package/src/interactive/fleet-run-preview.ts +307 -0
- package/src/interactive/footer/notifications.ts +219 -0
- package/src/interactive/handoff-round.ts +56 -0
- package/src/interactive/interactive-application.ts +43 -1
- package/src/interactive/interactive-event-projection.ts +9 -1
- package/src/interactive/interactive-slash-runtime.ts +52 -2
- package/src/interactive/interactive-subscriptions.ts +14 -2
- package/src/interactive/oracle.ts +179 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +6 -0
- package/src/interactive/overlay-general-openers.ts +190 -1
- package/src/interactive/overlay-key-routing.ts +17 -1
- package/src/interactive/overlay-lifecycle.ts +41 -1
- package/src/interactive/overlay-permission-lifecycle.ts +10 -0
- package/src/interactive/overlay-resource-openers.ts +11 -3
- package/src/interactive/overlay-session-lifecycle.ts +234 -2
- package/src/interactive/overlays/fleet-run-approval.ts +208 -0
- package/src/interactive/overlays/handoff-review.ts +185 -0
- package/src/interactive/overlays/library-install-confirm.ts +151 -0
- package/src/interactive/overlays/list-overlay.ts +168 -2
- package/src/interactive/overlays/settings.ts +101 -4
- package/src/interactive/overlays/side-question.ts +139 -0
- package/src/interactive/overlays/skills-hub.ts +401 -15
- package/src/interactive/side-question.ts +171 -0
- package/src/interactive/slash-commands.ts +432 -5
- package/src/interactive/slash-spec.ts +19 -6
- package/src/interactive/theme/tokens.ts +30 -0
- package/src/interactive/turn-middleware.ts +15 -1
- package/src/interactive/watchdog-run.ts +75 -0
- package/src/interactive/worker-share.ts +56 -1
- package/src/interactive/worker-stream.ts +7 -0
- package/src/tools/bootstrap.ts +3 -0
- package/src/tools/compete-worktrees.ts +13 -79
- package/src/tools/dispatch-admission.ts +242 -8
- package/src/tools/dispatch-arguments.ts +57 -1
- package/src/tools/dispatch-plan.ts +136 -6
- package/src/tools/dispatch-runner.ts +319 -13
- package/src/tools/dispatch-types.ts +20 -1
- package/src/tools/dispatch.ts +72 -2
- package/src/tools/monitor.ts +16 -0
- package/src/tools/profiles.ts +18 -4
- package/src/tools/task-worktree.ts +238 -0
- package/src/tools/verify/authoring.ts +61 -1
- package/src/tools/verify/scripts.ts +62 -0
- package/src/tools/worker-evidence.ts +2 -1
- package/src/worker/spec-contract.ts +1 -0
- package/dist/chunk-HC4CLZ2Y.js +0 -68
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
discoverDeclaredProjectCommands
|
|
4
|
+
} from "./chunk-YTYFXUI3.js";
|
|
5
|
+
import "./chunk-LCGCVYZ4.js";
|
|
6
|
+
import "./chunk-UFQ3F4FW.js";
|
|
7
|
+
import "./chunk-PD3MESLB.js";
|
|
8
|
+
import "./chunk-JNXPYBB4.js";
|
|
9
|
+
import "./chunk-GH5622CP.js";
|
|
10
|
+
import "./chunk-VG7TBQIY.js";
|
|
11
|
+
import "./chunk-OQE5J4C6.js";
|
|
12
|
+
import "./chunk-UL3WSD3F.js";
|
|
13
|
+
import "./chunk-ECH6PKUQ.js";
|
|
14
|
+
import "./chunk-6XLNIQDB.js";
|
|
15
|
+
import "./chunk-5B2AEOW5.js";
|
|
16
|
+
import "./chunk-CGKSTWHD.js";
|
|
17
|
+
import "./chunk-D4MDIG46.js";
|
|
18
|
+
import "./chunk-FQ4SKYE4.js";
|
|
19
|
+
import "./chunk-FCSXB6T2.js";
|
|
20
|
+
import "./chunk-APJ265NV.js";
|
|
21
|
+
import "./chunk-YXLYO42X.js";
|
|
22
|
+
import "./chunk-BNAZZHFG.js";
|
|
23
|
+
import "./chunk-6EJMN2Y3.js";
|
|
24
|
+
import {
|
|
25
|
+
init_esm_shims
|
|
26
|
+
} from "./chunk-3R73A4XB.js";
|
|
27
|
+
|
|
28
|
+
// src/cli/fleet-commands.ts
|
|
29
|
+
init_esm_shims();
|
|
30
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
31
|
+
import { dirname, join } from "node:path";
|
|
32
|
+
function quoted(value) {
|
|
33
|
+
return JSON.stringify(value);
|
|
34
|
+
}
|
|
35
|
+
function runFleetCommands(args) {
|
|
36
|
+
if (args.length !== 1 || args[0] !== "init") {
|
|
37
|
+
process.stderr.write("clio-coder fleet: commands: usage: clio-coder fleet commands init\n");
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
const destination = join(process.cwd(), ".clio-coder", "fleets", "commands.yaml");
|
|
41
|
+
if (existsSync(destination)) {
|
|
42
|
+
process.stderr.write(`clio-coder fleet: commands init: destination already exists: ${destination}
|
|
43
|
+
`);
|
|
44
|
+
return 2;
|
|
45
|
+
}
|
|
46
|
+
const entries = discoverDeclaredProjectCommands(process.cwd());
|
|
47
|
+
const lines = [
|
|
48
|
+
"# Draft fleet command registry.",
|
|
49
|
+
"# Every entry was discovered from a project declaration. Uncommenting an entry confirms its exact invocation.",
|
|
50
|
+
"# version: 1",
|
|
51
|
+
"# commands:"
|
|
52
|
+
];
|
|
53
|
+
for (const entry of entries) {
|
|
54
|
+
lines.push(
|
|
55
|
+
`# ${entry.id}:`,
|
|
56
|
+
`# argv: [${entry.command.map(quoted).join(", ")}]`,
|
|
57
|
+
`# description: ${quoted(`Discovered from ${entry.provenance.path}: ${entry.provenance.detail}`)}`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
mkdirSync(dirname(destination), { recursive: true });
|
|
61
|
+
writeFileSync(destination, `${lines.join("\n")}
|
|
62
|
+
`, { flag: "wx" });
|
|
63
|
+
process.stdout.write(`${destination}
|
|
64
|
+
`);
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
runFleetCommands
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=fleet-commands-ZFIWZSB3.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
inspectFleet
|
|
4
|
+
} from "./chunk-DQA7QLMD.js";
|
|
5
|
+
import "./chunk-M4AKACEO.js";
|
|
6
|
+
import "./chunk-UVDSQ6LW.js";
|
|
7
|
+
import "./chunk-DR52UMZW.js";
|
|
8
|
+
import "./chunk-C4JBQ5SR.js";
|
|
9
|
+
import "./chunk-2SFS6XQE.js";
|
|
10
|
+
import "./chunk-ZWLZP4ZT.js";
|
|
11
|
+
import "./chunk-KCMKRQX4.js";
|
|
12
|
+
import "./chunk-UND3GU2L.js";
|
|
13
|
+
import "./chunk-DJNLUABN.js";
|
|
14
|
+
import "./chunk-AOCYTWAV.js";
|
|
15
|
+
import "./chunk-MV3K5QF2.js";
|
|
16
|
+
import "./chunk-UL3WSD3F.js";
|
|
17
|
+
import "./chunk-ECH6PKUQ.js";
|
|
18
|
+
import "./chunk-5B2AEOW5.js";
|
|
19
|
+
import "./chunk-CGKSTWHD.js";
|
|
20
|
+
import "./chunk-IHXBNWMM.js";
|
|
21
|
+
import "./chunk-UHXRNZ2J.js";
|
|
22
|
+
import "./chunk-4DGYLA73.js";
|
|
23
|
+
import "./chunk-LL4KHSZI.js";
|
|
24
|
+
import "./chunk-FQ4SKYE4.js";
|
|
25
|
+
import "./chunk-4ZG3XFUR.js";
|
|
26
|
+
import "./chunk-IKCO5N3L.js";
|
|
27
|
+
import "./chunk-3I7MS7N2.js";
|
|
28
|
+
import "./chunk-APJ265NV.js";
|
|
29
|
+
import "./chunk-BNAZZHFG.js";
|
|
30
|
+
import "./chunk-WEPFGWHJ.js";
|
|
31
|
+
import "./chunk-IWHMRKLL.js";
|
|
32
|
+
import {
|
|
33
|
+
init_esm_shims
|
|
34
|
+
} from "./chunk-3R73A4XB.js";
|
|
35
|
+
|
|
36
|
+
// src/cli/fleet-graph.ts
|
|
37
|
+
init_esm_shims();
|
|
38
|
+
function contractKind(step) {
|
|
39
|
+
if (step.kind === "code") return "code";
|
|
40
|
+
if (step.gate !== void 0) return "gate";
|
|
41
|
+
if (step.plan !== void 0) return "plan";
|
|
42
|
+
return "agent";
|
|
43
|
+
}
|
|
44
|
+
function projectedStep(step) {
|
|
45
|
+
return {
|
|
46
|
+
id: step.id,
|
|
47
|
+
kind: contractKind(step),
|
|
48
|
+
...step.kind === "agent" ? { agent: step.agentId } : { command: step.commandId },
|
|
49
|
+
...step.kind === "agent" && step.gate !== void 0 ? { gate: { path: step.gate.path, command: step.gate.commandId } } : {},
|
|
50
|
+
...step.kind === "agent" && step.plan !== void 0 ? { plan: { roster: [...step.plan.roster], maxTasks: step.plan.maxTasks, proposals: step.plan.proposals } } : {},
|
|
51
|
+
...step.kind === "agent" && step.target !== void 0 ? { target: step.target } : {},
|
|
52
|
+
...step.kind === "agent" && step.profile !== void 0 ? { profile: step.profile } : {},
|
|
53
|
+
scope: step.scope,
|
|
54
|
+
writes: [...step.writes ?? []],
|
|
55
|
+
dependencies: [...step.dependencies]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function runFleetGraph(args) {
|
|
59
|
+
const json = args.includes("--json");
|
|
60
|
+
const name = args.find((arg) => !arg.startsWith("-"));
|
|
61
|
+
const unknown = args.find((arg, index) => arg.startsWith("-") && arg !== "--json" || index > 1);
|
|
62
|
+
if (name === void 0 || unknown !== void 0) {
|
|
63
|
+
process.stderr.write("clio-coder fleet: graph: usage: clio-coder fleet graph <name> [--json]\n");
|
|
64
|
+
return 2;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const { plan } = inspectFleet(name);
|
|
68
|
+
const byId = new Map(plan.steps.map((step) => [step.id, step]));
|
|
69
|
+
const waves = plan.waves.map((ids, index) => ({
|
|
70
|
+
wave: index + 1,
|
|
71
|
+
steps: ids.flatMap((id) => {
|
|
72
|
+
const step = byId.get(id);
|
|
73
|
+
return step === void 0 ? [] : [projectedStep(step)];
|
|
74
|
+
})
|
|
75
|
+
}));
|
|
76
|
+
const loops = plan.loops.map((loop) => ({
|
|
77
|
+
id: loop.id,
|
|
78
|
+
check: loop.checkStepIds.map((id) => projectedStep(byId.get(id))),
|
|
79
|
+
repair: loop.repairStepIds.map((id) => projectedStep(byId.get(id)))
|
|
80
|
+
}));
|
|
81
|
+
if (json) {
|
|
82
|
+
process.stdout.write(`${JSON.stringify({ fleet: name, planHash: plan.hash, waves, loops }, null, 2)}
|
|
83
|
+
`);
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
for (const wave of waves) {
|
|
87
|
+
process.stdout.write(`wave ${wave.wave}
|
|
88
|
+
`);
|
|
89
|
+
for (const step of wave.steps) {
|
|
90
|
+
const subject = step.kind === "code" ? `command=${step.command}` : `agent=${step.agent}`;
|
|
91
|
+
const gate = step.gate;
|
|
92
|
+
const plan2 = step.plan;
|
|
93
|
+
const detail = gate !== void 0 ? ` gate=${gate.path} run=${gate.command}` : plan2 !== void 0 ? ` roster=${JSON.stringify(plan2.roster)} maxTasks=${plan2.maxTasks}${plan2.proposals ? " proposals" : ""}` : "";
|
|
94
|
+
const route = step.target !== void 0 ? ` target=${step.target}` : step.profile !== void 0 ? ` profile=${step.profile}` : "";
|
|
95
|
+
process.stdout.write(
|
|
96
|
+
` ${step.id} kind=${step.kind} ${subject}${route} scope=${step.scope} writes=${JSON.stringify(step.writes)}${detail}
|
|
97
|
+
`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const loop of loops) {
|
|
102
|
+
process.stdout.write(`loop ${loop.id}
|
|
103
|
+
`);
|
|
104
|
+
for (const step of loop.check)
|
|
105
|
+
process.stdout.write(
|
|
106
|
+
` check ${step.id} kind=${step.kind} scope=${step.scope} writes=${JSON.stringify(step.writes)}
|
|
107
|
+
`
|
|
108
|
+
);
|
|
109
|
+
for (const step of loop.repair)
|
|
110
|
+
process.stdout.write(
|
|
111
|
+
` repair ${step.id} kind=${step.kind} scope=${step.scope} writes=${JSON.stringify(step.writes)}
|
|
112
|
+
`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return 0;
|
|
116
|
+
} catch (error) {
|
|
117
|
+
process.stderr.write(`clio-coder fleet: ${error instanceof Error ? error.message : String(error)}
|
|
118
|
+
`);
|
|
119
|
+
return 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
runFleetGraph
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=fleet-graph-Y6HPXIVF.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolvePackageRoot
|
|
4
|
+
} from "./chunk-IWHMRKLL.js";
|
|
5
|
+
import {
|
|
6
|
+
init_esm_shims
|
|
7
|
+
} from "./chunk-3R73A4XB.js";
|
|
8
|
+
|
|
9
|
+
// src/cli/fleet-new.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { dirname, join } from "node:path";
|
|
13
|
+
var BUILTINS = ["build-review", "build-test", "sdlc"];
|
|
14
|
+
var SAFE_STEM = /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/u;
|
|
15
|
+
function usage(message) {
|
|
16
|
+
process.stderr.write(`clio-coder fleet: new: ${message}
|
|
17
|
+
`);
|
|
18
|
+
return 2;
|
|
19
|
+
}
|
|
20
|
+
function runFleetNew(args) {
|
|
21
|
+
const name = args[0];
|
|
22
|
+
const fromIndex = args.indexOf("--from");
|
|
23
|
+
const builtin = fromIndex === -1 ? void 0 : args[fromIndex + 1];
|
|
24
|
+
const known = BUILTINS.join(", ");
|
|
25
|
+
if (name === void 0) return usage("usage: clio-coder fleet new <name> --from <builtin>");
|
|
26
|
+
if (!SAFE_STEM.test(name)) return usage(`'${name}' is not a safe file stem`);
|
|
27
|
+
if (fromIndex === -1 || builtin === void 0) return usage("--from <builtin> is required");
|
|
28
|
+
const expected = /* @__PURE__ */ new Set([name, "--from", builtin]);
|
|
29
|
+
const unknown = args.find((arg) => !expected.has(arg));
|
|
30
|
+
if (unknown !== void 0) return usage(`unknown argument: ${unknown}`);
|
|
31
|
+
if (!BUILTINS.includes(builtin)) {
|
|
32
|
+
return usage(`unknown builtin '${builtin}'. Known builtins: ${known}`);
|
|
33
|
+
}
|
|
34
|
+
const destination = join(process.cwd(), ".clio-coder", "fleets", `${name}.md`);
|
|
35
|
+
if (existsSync(destination)) return usage(`destination already exists: ${destination}`);
|
|
36
|
+
const source = join(resolvePackageRoot(), "src", "domains", "agents", "fleets", `${builtin}.md`);
|
|
37
|
+
mkdirSync(dirname(destination), { recursive: true });
|
|
38
|
+
const sourceText = readFileSync(source, "utf8");
|
|
39
|
+
const renamed = sourceText.replace(/^name:\s*[^\n]+$/mu, `name: ${name}`);
|
|
40
|
+
writeFileSync(destination, renamed, { flag: "wx" });
|
|
41
|
+
process.stdout.write(`${destination}
|
|
42
|
+
`);
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
runFleetNew
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=fleet-new-RDVJLHHH.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
inspectFleet
|
|
4
|
+
} from "./chunk-DQA7QLMD.js";
|
|
5
|
+
import {
|
|
6
|
+
preflightWriteBoundaries
|
|
7
|
+
} from "./chunk-KZ2H5X4G.js";
|
|
8
|
+
import "./chunk-M4AKACEO.js";
|
|
9
|
+
import "./chunk-UVDSQ6LW.js";
|
|
10
|
+
import "./chunk-DR52UMZW.js";
|
|
11
|
+
import "./chunk-C4JBQ5SR.js";
|
|
12
|
+
import "./chunk-2SFS6XQE.js";
|
|
13
|
+
import "./chunk-ZWLZP4ZT.js";
|
|
14
|
+
import {
|
|
15
|
+
FLEET_COMMANDS_REMEDY,
|
|
16
|
+
FleetCommandRegistryMissingError
|
|
17
|
+
} from "./chunk-KCMKRQX4.js";
|
|
18
|
+
import "./chunk-UND3GU2L.js";
|
|
19
|
+
import "./chunk-DJNLUABN.js";
|
|
20
|
+
import "./chunk-AOCYTWAV.js";
|
|
21
|
+
import "./chunk-MV3K5QF2.js";
|
|
22
|
+
import "./chunk-UL3WSD3F.js";
|
|
23
|
+
import "./chunk-ECH6PKUQ.js";
|
|
24
|
+
import "./chunk-5B2AEOW5.js";
|
|
25
|
+
import "./chunk-CGKSTWHD.js";
|
|
26
|
+
import "./chunk-IHXBNWMM.js";
|
|
27
|
+
import "./chunk-UHXRNZ2J.js";
|
|
28
|
+
import "./chunk-4DGYLA73.js";
|
|
29
|
+
import "./chunk-LL4KHSZI.js";
|
|
30
|
+
import "./chunk-FO5ZOVUY.js";
|
|
31
|
+
import "./chunk-R346GLFC.js";
|
|
32
|
+
import "./chunk-FQ4SKYE4.js";
|
|
33
|
+
import "./chunk-4ZG3XFUR.js";
|
|
34
|
+
import "./chunk-IKCO5N3L.js";
|
|
35
|
+
import "./chunk-3I7MS7N2.js";
|
|
36
|
+
import "./chunk-APJ265NV.js";
|
|
37
|
+
import "./chunk-BNAZZHFG.js";
|
|
38
|
+
import "./chunk-WEPFGWHJ.js";
|
|
39
|
+
import "./chunk-IWHMRKLL.js";
|
|
40
|
+
import {
|
|
41
|
+
init_esm_shims
|
|
42
|
+
} from "./chunk-3R73A4XB.js";
|
|
43
|
+
|
|
44
|
+
// src/cli/fleet-validate.ts
|
|
45
|
+
init_esm_shims();
|
|
46
|
+
function runFleetValidate(args) {
|
|
47
|
+
const json = args.includes("--json");
|
|
48
|
+
const unknown = args.find((arg, index) => arg.startsWith("-") && arg !== "--json" || index > 1);
|
|
49
|
+
const name = args.find((arg) => !arg.startsWith("-"));
|
|
50
|
+
if (name === void 0 || unknown !== void 0) {
|
|
51
|
+
process.stderr.write("clio-coder fleet: validate: usage: clio-coder fleet validate <name> [--json]\n");
|
|
52
|
+
return 2;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const result = inspectFleet(name);
|
|
56
|
+
preflightWriteBoundaries(result.plan, process.cwd());
|
|
57
|
+
if (json)
|
|
58
|
+
process.stdout.write(
|
|
59
|
+
`${JSON.stringify({ valid: true, fleet: name, checks: result.checks, planHash: result.plan.hash }, null, 2)}
|
|
60
|
+
`
|
|
61
|
+
);
|
|
62
|
+
else for (const check of result.checks) process.stdout.write(`${check.check}: ${check.summary}
|
|
63
|
+
`);
|
|
64
|
+
return 0;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
67
|
+
const message = raw.startsWith("unknown agent '") ? `preflight failed: ${raw}` : raw;
|
|
68
|
+
const diagnostics = [message, ...error instanceof FleetCommandRegistryMissingError ? [FLEET_COMMANDS_REMEDY] : []];
|
|
69
|
+
if (json) process.stdout.write(`${JSON.stringify({ valid: false, fleet: name, diagnostics }, null, 2)}
|
|
70
|
+
`);
|
|
71
|
+
else process.stderr.write(`clio-coder fleet: ${diagnostics.join("\n ")}
|
|
72
|
+
`);
|
|
73
|
+
return 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
runFleetValidate
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=fleet-validate-BIYREGIK.js.map
|
|
@@ -4,57 +4,64 @@ import {
|
|
|
4
4
|
bootstrapInputFromInitOptions,
|
|
5
5
|
modelBootstrapGenerate,
|
|
6
6
|
validateInitOptions
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EOOQZZDE.js";
|
|
8
8
|
import "./chunk-J5Q24KAG.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-EBEFWSGL.js";
|
|
10
|
+
import "./chunk-J7PIKKWC.js";
|
|
11
|
+
import "./chunk-BMWK7ZIZ.js";
|
|
12
|
+
import "./chunk-5UJ6ECTS.js";
|
|
13
|
+
import "./chunk-GWS3VEIW.js";
|
|
14
14
|
import "./chunk-HFSBBKSQ.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-YD734TPH.js";
|
|
16
16
|
import {
|
|
17
17
|
runBootstrap
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4DWFMQDR.js";
|
|
19
19
|
import "./chunk-LCGCVYZ4.js";
|
|
20
20
|
import "./chunk-5WIGXA4T.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-6M7VS3J3.js";
|
|
22
|
+
import "./chunk-UUANF5CR.js";
|
|
23
|
+
import "./chunk-6TUKSZVF.js";
|
|
24
|
+
import "./chunk-KZ2H5X4G.js";
|
|
25
|
+
import "./chunk-M4AKACEO.js";
|
|
26
|
+
import "./chunk-RVG5JXAL.js";
|
|
27
|
+
import "./chunk-ZGH7FGS5.js";
|
|
26
28
|
import "./chunk-TSHXZTOQ.js";
|
|
27
29
|
import "./chunk-TXOTCRLG.js";
|
|
28
30
|
import "./chunk-HVDIIIQW.js";
|
|
29
31
|
import "./chunk-NDINPTJ4.js";
|
|
30
32
|
import "./chunk-MVVUPGPW.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-THKY7CD7.js";
|
|
34
|
+
import "./chunk-UVDSQ6LW.js";
|
|
35
|
+
import "./chunk-DR52UMZW.js";
|
|
36
|
+
import "./chunk-C4JBQ5SR.js";
|
|
33
37
|
import "./chunk-2SFS6XQE.js";
|
|
34
38
|
import "./chunk-ZWLZP4ZT.js";
|
|
35
39
|
import "./chunk-W6GROXXM.js";
|
|
36
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-KCMKRQX4.js";
|
|
41
|
+
import "./chunk-XEGB6BCN.js";
|
|
37
42
|
import "./chunk-IR4CFBFN.js";
|
|
38
43
|
import "./chunk-UOV2BYIW.js";
|
|
39
44
|
import "./chunk-WHGPSPT5.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-MV3K5QF2.js";
|
|
45
|
+
import "./chunk-CEYBNUGC.js";
|
|
46
|
+
import "./chunk-5FR74PWO.js";
|
|
47
|
+
import "./chunk-OBMAI2DP.js";
|
|
48
|
+
import "./chunk-5C77SEEY.js";
|
|
49
|
+
import "./chunk-UND3GU2L.js";
|
|
46
50
|
import "./chunk-CMZWFGD2.js";
|
|
47
51
|
import "./chunk-I4HZDVNP.js";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-UL3WSD3F.js";
|
|
52
|
+
import "./chunk-GH5622CP.js";
|
|
50
53
|
import "./chunk-VG7TBQIY.js";
|
|
51
54
|
import "./chunk-OQE5J4C6.js";
|
|
52
|
-
import "./chunk-ECH6PKUQ.js";
|
|
53
55
|
import "./chunk-GOXNB3AO.js";
|
|
54
56
|
import "./chunk-HWUFFB6L.js";
|
|
57
|
+
import "./chunk-DJNLUABN.js";
|
|
58
|
+
import "./chunk-AOCYTWAV.js";
|
|
59
|
+
import "./chunk-MV3K5QF2.js";
|
|
60
|
+
import "./chunk-UL3WSD3F.js";
|
|
55
61
|
import "./chunk-ODFEOB4F.js";
|
|
56
62
|
import "./chunk-OZNBF4L3.js";
|
|
57
63
|
import "./chunk-4BJ5BYCE.js";
|
|
64
|
+
import "./chunk-ECH6PKUQ.js";
|
|
58
65
|
import "./chunk-6XLNIQDB.js";
|
|
59
66
|
import "./chunk-5B2AEOW5.js";
|
|
60
67
|
import "./chunk-CGKSTWHD.js";
|
|
@@ -65,31 +72,31 @@ import "./chunk-LBMZMYH2.js";
|
|
|
65
72
|
import "./chunk-33YXPOE3.js";
|
|
66
73
|
import {
|
|
67
74
|
VALID_THINKING_LEVELS
|
|
68
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-VQNODYQ4.js";
|
|
69
76
|
import "./chunk-CFGTUFWB.js";
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-4OC57DA6.js";
|
|
72
|
-
import "./chunk-LL4KHSZI.js";
|
|
73
|
-
import "./chunk-4VP4KH3K.js";
|
|
74
|
-
import "./chunk-VEZEGCGW.js";
|
|
75
|
-
import "./chunk-FQ4SKYE4.js";
|
|
76
|
-
import "./chunk-IKCO5N3L.js";
|
|
77
|
-
import "./chunk-3I7MS7N2.js";
|
|
77
|
+
import "./chunk-JRIO5UD2.js";
|
|
78
78
|
import "./chunk-IHXBNWMM.js";
|
|
79
79
|
import "./chunk-GEYXPTRF.js";
|
|
80
|
+
import "./chunk-UHXRNZ2J.js";
|
|
81
|
+
import "./chunk-4DGYLA73.js";
|
|
82
|
+
import "./chunk-LL4KHSZI.js";
|
|
80
83
|
import "./chunk-SST6Z5JA.js";
|
|
81
84
|
import "./chunk-FO5ZOVUY.js";
|
|
82
85
|
import "./chunk-R346GLFC.js";
|
|
86
|
+
import "./chunk-D4MDIG46.js";
|
|
87
|
+
import "./chunk-FQ4SKYE4.js";
|
|
83
88
|
import "./chunk-4ZG3XFUR.js";
|
|
89
|
+
import "./chunk-IKCO5N3L.js";
|
|
90
|
+
import "./chunk-3I7MS7N2.js";
|
|
84
91
|
import "./chunk-FCSXB6T2.js";
|
|
85
92
|
import "./chunk-APJ265NV.js";
|
|
86
93
|
import "./chunk-YXLYO42X.js";
|
|
87
94
|
import "./chunk-BNAZZHFG.js";
|
|
88
95
|
import "./chunk-6EJMN2Y3.js";
|
|
89
96
|
import "./chunk-WEPFGWHJ.js";
|
|
90
|
-
import "./chunk-
|
|
97
|
+
import "./chunk-X2KV5FXT.js";
|
|
91
98
|
import "./chunk-ZGVHUX3M.js";
|
|
92
|
-
import "./chunk-
|
|
99
|
+
import "./chunk-OB5HIGJY.js";
|
|
93
100
|
import "./chunk-JVCV3ICN.js";
|
|
94
101
|
import "./chunk-7CR24IG7.js";
|
|
95
102
|
import "./chunk-IWHMRKLL.js";
|
|
@@ -281,4 +288,4 @@ async function runInitCommand(args) {
|
|
|
281
288
|
export {
|
|
282
289
|
runInitCommand
|
|
283
290
|
};
|
|
284
|
-
//# sourceMappingURL=init-
|
|
291
|
+
//# sourceMappingURL=init-LQUB5COQ.js.map
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
classifyLibraryRequirements,
|
|
4
|
+
confirmLibraryRemote,
|
|
5
|
+
discoverLibrary,
|
|
6
|
+
installLibraryPlan,
|
|
7
|
+
libraryEntryRef,
|
|
8
|
+
libraryInstallPath,
|
|
9
|
+
planLibraryInstall,
|
|
10
|
+
syncLibrary
|
|
11
|
+
} from "./chunk-THKY7CD7.js";
|
|
12
|
+
import "./chunk-UVDSQ6LW.js";
|
|
13
|
+
import "./chunk-DR52UMZW.js";
|
|
14
|
+
import "./chunk-C4JBQ5SR.js";
|
|
15
|
+
import "./chunk-2SFS6XQE.js";
|
|
16
|
+
import "./chunk-ZWLZP4ZT.js";
|
|
17
|
+
import "./chunk-KCMKRQX4.js";
|
|
18
|
+
import "./chunk-DJNLUABN.js";
|
|
19
|
+
import "./chunk-AOCYTWAV.js";
|
|
20
|
+
import "./chunk-MV3K5QF2.js";
|
|
21
|
+
import "./chunk-UL3WSD3F.js";
|
|
22
|
+
import "./chunk-ECH6PKUQ.js";
|
|
23
|
+
import "./chunk-5B2AEOW5.js";
|
|
24
|
+
import "./chunk-CGKSTWHD.js";
|
|
25
|
+
import "./chunk-465YSENW.js";
|
|
26
|
+
import {
|
|
27
|
+
printError,
|
|
28
|
+
printOk
|
|
29
|
+
} from "./chunk-PPAMZ32Z.js";
|
|
30
|
+
import "./chunk-5TSRNF4G.js";
|
|
31
|
+
import "./chunk-JRIO5UD2.js";
|
|
32
|
+
import "./chunk-IHXBNWMM.js";
|
|
33
|
+
import "./chunk-UHXRNZ2J.js";
|
|
34
|
+
import "./chunk-4DGYLA73.js";
|
|
35
|
+
import "./chunk-LL4KHSZI.js";
|
|
36
|
+
import "./chunk-SST6Z5JA.js";
|
|
37
|
+
import "./chunk-D4MDIG46.js";
|
|
38
|
+
import "./chunk-FQ4SKYE4.js";
|
|
39
|
+
import "./chunk-4ZG3XFUR.js";
|
|
40
|
+
import "./chunk-IKCO5N3L.js";
|
|
41
|
+
import "./chunk-3I7MS7N2.js";
|
|
42
|
+
import "./chunk-APJ265NV.js";
|
|
43
|
+
import "./chunk-YXLYO42X.js";
|
|
44
|
+
import "./chunk-BNAZZHFG.js";
|
|
45
|
+
import "./chunk-6EJMN2Y3.js";
|
|
46
|
+
import "./chunk-WEPFGWHJ.js";
|
|
47
|
+
import "./chunk-IWHMRKLL.js";
|
|
48
|
+
import {
|
|
49
|
+
init_esm_shims
|
|
50
|
+
} from "./chunk-3R73A4XB.js";
|
|
51
|
+
|
|
52
|
+
// src/cli/library.ts
|
|
53
|
+
init_esm_shims();
|
|
54
|
+
var KINDS = /* @__PURE__ */ new Set(["skill", "agent", "prompt", "fleet"]);
|
|
55
|
+
var HELP = `clio-coder library <command>
|
|
56
|
+
|
|
57
|
+
Commands:
|
|
58
|
+
clio-coder library list [--kind <kind>] [--json]
|
|
59
|
+
clio-coder library search <query> [--kind <kind>] [--json]
|
|
60
|
+
clio-coder library add <ref> [--from <catalog|path>] [--with-requirements] [--yes] [--json]
|
|
61
|
+
clio-coder library use <kind> <name>
|
|
62
|
+
clio-coder library sync
|
|
63
|
+
clio-coder library push
|
|
64
|
+
clio-coder library remote confirm <url>
|
|
65
|
+
`;
|
|
66
|
+
function parse(argv) {
|
|
67
|
+
const out = { positional: [], json: false, yes: false, withRequirements: false, help: false };
|
|
68
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
69
|
+
const arg = argv[i];
|
|
70
|
+
if (!arg) continue;
|
|
71
|
+
if (!out.command && !arg.startsWith("-")) {
|
|
72
|
+
out.command = arg;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (arg === "--json") out.json = true;
|
|
76
|
+
else if (arg === "--yes") out.yes = true;
|
|
77
|
+
else if (arg === "--with-requirements") out.withRequirements = true;
|
|
78
|
+
else if (arg === "--help" || arg === "-h") out.help = true;
|
|
79
|
+
else if (arg === "--kind") {
|
|
80
|
+
const value = argv[++i];
|
|
81
|
+
if (!value || !KINDS.has(value))
|
|
82
|
+
throw new Error("--kind requires skill, agent, prompt, or fleet");
|
|
83
|
+
out.kind = value;
|
|
84
|
+
} else if (arg === "--from") {
|
|
85
|
+
const value = argv[++i];
|
|
86
|
+
if (!value) throw new Error("--from requires a value");
|
|
87
|
+
out.from = value;
|
|
88
|
+
} else if (arg.startsWith("-")) throw new Error(`unknown flag: ${arg}`);
|
|
89
|
+
else out.positional.push(arg);
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function selectEntry(entries, ref) {
|
|
94
|
+
const matches = ref.includes(":") ? entries.filter((entry) => libraryEntryRef(entry) === ref) : entries.filter((entry) => entry.name === ref);
|
|
95
|
+
if (matches.length === 0) throw new Error(`library entry not found: ${ref}`);
|
|
96
|
+
if (matches.length > 1)
|
|
97
|
+
throw new Error(`library entry is ambiguous; use a typed reference: ${matches.map(libraryEntryRef).join(", ")}`);
|
|
98
|
+
return matches[0];
|
|
99
|
+
}
|
|
100
|
+
function filtered(entries, kind) {
|
|
101
|
+
return entries.filter((entry) => kind === void 0 || entry.kind === kind);
|
|
102
|
+
}
|
|
103
|
+
async function runLibraryCommand(argv) {
|
|
104
|
+
let parsed;
|
|
105
|
+
try {
|
|
106
|
+
parsed = parse(argv);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
109
|
+
return 2;
|
|
110
|
+
}
|
|
111
|
+
if (!parsed.command || parsed.help) {
|
|
112
|
+
process.stdout.write(HELP);
|
|
113
|
+
return parsed.help ? 0 : 2;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
if (parsed.command === "list" || parsed.command === "search") {
|
|
117
|
+
const discovery = discoverLibrary();
|
|
118
|
+
const query = parsed.command === "search" ? parsed.positional.join(" ").trim().toLowerCase() : "";
|
|
119
|
+
if (parsed.command === "search" && !query) throw new Error("library search requires a query");
|
|
120
|
+
const entries = filtered(discovery.entries, parsed.kind).filter(
|
|
121
|
+
(entry) => !query || entry.name.toLowerCase().includes(query) || entry.description.toLowerCase().includes(query)
|
|
122
|
+
);
|
|
123
|
+
if (parsed.json)
|
|
124
|
+
process.stdout.write(`${JSON.stringify({ entries, diagnostics: discovery.diagnostics }, null, 2)}
|
|
125
|
+
`);
|
|
126
|
+
else
|
|
127
|
+
for (const entry of entries) process.stdout.write(`${libraryEntryRef(entry).padEnd(28)} ${entry.description}
|
|
128
|
+
`);
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
if (parsed.command === "add") {
|
|
132
|
+
const ref = parsed.positional[0];
|
|
133
|
+
if (!ref || parsed.positional.length !== 1) throw new Error("library add requires one reference");
|
|
134
|
+
const catalog = parsed.from && parsed.from !== "catalog" ? parsed.from : void 0;
|
|
135
|
+
const discovery = discoverLibrary(catalog ? { catalog } : {});
|
|
136
|
+
let entry;
|
|
137
|
+
try {
|
|
138
|
+
entry = selectEntry(discovery.entries, ref);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
const refusal = ref.includes(":") ? discovery.refusals[ref] : Object.entries(discovery.refusals).find(([key]) => key.endsWith(`:${ref}`))?.[1];
|
|
141
|
+
if (refusal) throw new Error(refusal);
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
const requirements = classifyLibraryRequirements(entry, discovery.entries);
|
|
145
|
+
if (requirements.unsatisfied.length > 0 && !parsed.withRequirements) {
|
|
146
|
+
const refs = requirements.unsatisfied.map(libraryEntryRef);
|
|
147
|
+
if (parsed.json)
|
|
148
|
+
process.stdout.write(
|
|
149
|
+
`${JSON.stringify({ ok: false, entry: libraryEntryRef(entry), satisfiedRequirements: requirements.satisfied.map(libraryEntryRef), unresolvedRequirements: refs }, null, 2)}
|
|
150
|
+
`
|
|
151
|
+
);
|
|
152
|
+
else
|
|
153
|
+
process.stderr.write(
|
|
154
|
+
`satisfied requirements: ${requirements.satisfied.length > 0 ? requirements.satisfied.map(libraryEntryRef).join(", ") : "none"}
|
|
155
|
+
unresolved requirements: ${refs.join(", ")}
|
|
156
|
+
pass --with-requirements to install them in dependency order
|
|
157
|
+
`
|
|
158
|
+
);
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
const plans = [...parsed.withRequirements ? requirements.unsatisfied : [], entry].map(planLibraryInstall);
|
|
162
|
+
if (parsed.json)
|
|
163
|
+
process.stdout.write(
|
|
164
|
+
`${JSON.stringify({ ok: true, confirmed: parsed.yes, satisfiedRequirements: requirements.satisfied.map(libraryEntryRef), writes: plans.map((plan) => ({ ref: libraryEntryRef(plan.entry), path: plan.path, sha256: plan.sha256 })) }, null, 2)}
|
|
165
|
+
`
|
|
166
|
+
);
|
|
167
|
+
else {
|
|
168
|
+
process.stdout.write("library add plan:\n");
|
|
169
|
+
process.stdout.write(
|
|
170
|
+
` satisfied requirements: ${requirements.satisfied.length > 0 ? requirements.satisfied.map(libraryEntryRef).join(", ") : "none"}
|
|
171
|
+
`
|
|
172
|
+
);
|
|
173
|
+
for (const plan of plans)
|
|
174
|
+
process.stdout.write(` ${libraryEntryRef(plan.entry)} -> ${plan.path} sha256 ${plan.sha256}
|
|
175
|
+
`);
|
|
176
|
+
}
|
|
177
|
+
if (!parsed.yes) return 0;
|
|
178
|
+
for (const plan of plans) installLibraryPlan(plan);
|
|
179
|
+
if (!parsed.json) printOk(`installed ${plans.length} library entry or entries`);
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
if (parsed.command === "use") {
|
|
183
|
+
const kind = parsed.positional[0];
|
|
184
|
+
const name = parsed.positional[1];
|
|
185
|
+
if (!kind || !KINDS.has(kind) || !name || parsed.positional.length !== 2)
|
|
186
|
+
throw new Error("library use requires a kind and name");
|
|
187
|
+
const output = kind === "fleet" ? `clio-coder fleet run ${name}` : kind === "agent" ? `/run ${name}` : kind === "skill" ? `${libraryInstallPath({ kind, name })}
|
|
188
|
+
load it from /skill in the TUI, or ask the model to call context(scope="skills")` : name;
|
|
189
|
+
process.stdout.write(`${output}
|
|
190
|
+
`);
|
|
191
|
+
return 0;
|
|
192
|
+
}
|
|
193
|
+
if (parsed.command === "remote") {
|
|
194
|
+
if (parsed.positional[0] !== "confirm" || !parsed.positional[1] || parsed.positional.length !== 2)
|
|
195
|
+
throw new Error("library remote confirm requires a URL");
|
|
196
|
+
confirmLibraryRemote(parsed.positional[1]);
|
|
197
|
+
printOk("confirmed library remote");
|
|
198
|
+
return 0;
|
|
199
|
+
}
|
|
200
|
+
if (parsed.command === "sync" || parsed.command === "push") {
|
|
201
|
+
await syncLibrary(parsed.command);
|
|
202
|
+
printOk(`library ${parsed.command} complete`);
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
throw new Error(`unknown library command: ${parsed.command}`);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
208
|
+
printError(message);
|
|
209
|
+
if (parsed.json) process.stdout.write(`${JSON.stringify({ ok: false, error: message }, null, 2)}
|
|
210
|
+
`);
|
|
211
|
+
return 1;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export {
|
|
215
|
+
runLibraryCommand
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=library-NJAHIGG4.js.map
|