@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
|
@@ -65,6 +65,9 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
require_dist
|
|
67
67
|
} from "./chunk-APJ265NV.js";
|
|
68
|
+
import {
|
|
69
|
+
clioConfigDir
|
|
70
|
+
} from "./chunk-BNAZZHFG.js";
|
|
68
71
|
import {
|
|
69
72
|
resolvePackageRoot
|
|
70
73
|
} from "./chunk-IWHMRKLL.js";
|
|
@@ -3874,23 +3877,23 @@ init_esm_shims();
|
|
|
3874
3877
|
|
|
3875
3878
|
// node_modules/typebox/build/value/delta/diff.mjs
|
|
3876
3879
|
init_esm_shims();
|
|
3877
|
-
function CreateUpdate(
|
|
3878
|
-
return { type: "update", path
|
|
3880
|
+
function CreateUpdate(path, value) {
|
|
3881
|
+
return { type: "update", path, value };
|
|
3879
3882
|
}
|
|
3880
|
-
function CreateInsert(
|
|
3881
|
-
return { type: "insert", path
|
|
3883
|
+
function CreateInsert(path, value) {
|
|
3884
|
+
return { type: "insert", path, value };
|
|
3882
3885
|
}
|
|
3883
|
-
function CreateDelete(
|
|
3884
|
-
return { type: "delete", path
|
|
3886
|
+
function CreateDelete(path) {
|
|
3887
|
+
return { type: "delete", path };
|
|
3885
3888
|
}
|
|
3886
3889
|
function AssertCanDiffObject(value) {
|
|
3887
3890
|
if (guard_exports.IsObject(value) && guard_exports.IsEqual(guard_exports.Symbols(value).length, 0))
|
|
3888
3891
|
return;
|
|
3889
3892
|
throw new Error("Cannot create diffs for objects with symbols keys");
|
|
3890
3893
|
}
|
|
3891
|
-
function* FromObject8(
|
|
3894
|
+
function* FromObject8(path, left, right) {
|
|
3892
3895
|
if (!guard_exports.IsObject(right) || guard_exports.IsArray(right))
|
|
3893
|
-
return yield CreateUpdate(
|
|
3896
|
+
return yield CreateUpdate(path, right);
|
|
3894
3897
|
AssertCanDiffObject(left);
|
|
3895
3898
|
AssertCanDiffObject(right);
|
|
3896
3899
|
const leftKeys = guard_exports.Keys(left);
|
|
@@ -3900,7 +3903,7 @@ function* FromObject8(path2, left, right) {
|
|
|
3900
3903
|
continue;
|
|
3901
3904
|
if (guard_exports.IsUnsafePropertyKey(key))
|
|
3902
3905
|
continue;
|
|
3903
|
-
yield CreateInsert(`${
|
|
3906
|
+
yield CreateInsert(`${path}/${key}`, right[key]);
|
|
3904
3907
|
}
|
|
3905
3908
|
for (const key of leftKeys) {
|
|
3906
3909
|
if (!guard_exports.HasPropertyKey(right, key))
|
|
@@ -3909,52 +3912,52 @@ function* FromObject8(path2, left, right) {
|
|
|
3909
3912
|
continue;
|
|
3910
3913
|
if (Equal(left, right))
|
|
3911
3914
|
continue;
|
|
3912
|
-
yield* FromValue2(`${
|
|
3915
|
+
yield* FromValue2(`${path}/${key}`, left[key], right[key]);
|
|
3913
3916
|
}
|
|
3914
3917
|
for (const key of leftKeys) {
|
|
3915
3918
|
if (guard_exports.HasPropertyKey(right, key))
|
|
3916
3919
|
continue;
|
|
3917
3920
|
if (guard_exports.IsUnsafePropertyKey(key))
|
|
3918
3921
|
continue;
|
|
3919
|
-
yield CreateDelete(`${
|
|
3922
|
+
yield CreateDelete(`${path}/${key}`);
|
|
3920
3923
|
}
|
|
3921
3924
|
}
|
|
3922
|
-
function* FromArray8(
|
|
3925
|
+
function* FromArray8(path, left, right) {
|
|
3923
3926
|
if (!guard_exports.IsArray(right))
|
|
3924
|
-
return yield CreateUpdate(
|
|
3927
|
+
return yield CreateUpdate(path, right);
|
|
3925
3928
|
for (let i = 0; i < Math.min(left.length, right.length); i++) {
|
|
3926
|
-
yield* FromValue2(`${
|
|
3929
|
+
yield* FromValue2(`${path}/${i}`, left[i], right[i]);
|
|
3927
3930
|
}
|
|
3928
3931
|
for (let i = 0; i < right.length; i++) {
|
|
3929
3932
|
if (i < left.length)
|
|
3930
3933
|
continue;
|
|
3931
|
-
yield CreateInsert(`${
|
|
3934
|
+
yield CreateInsert(`${path}/${i}`, right[i]);
|
|
3932
3935
|
}
|
|
3933
3936
|
for (let i = left.length - 1; i >= 0; i--) {
|
|
3934
3937
|
if (i < right.length)
|
|
3935
3938
|
continue;
|
|
3936
|
-
yield CreateDelete(`${
|
|
3939
|
+
yield CreateDelete(`${path}/${i}`);
|
|
3937
3940
|
}
|
|
3938
3941
|
}
|
|
3939
|
-
function* FromTypedArray(
|
|
3942
|
+
function* FromTypedArray(path, left, right) {
|
|
3940
3943
|
const typeLeft = globalThis.Object.getPrototypeOf(left).constructor.name;
|
|
3941
3944
|
const typeRight = globalThis.Object.getPrototypeOf(right).constructor.name;
|
|
3942
3945
|
const predicate = globals_exports.IsTypeArray(right) && guard_exports.IsEqual(left.length, right.length) && guard_exports.IsEqual(typeLeft, typeRight);
|
|
3943
3946
|
if (predicate) {
|
|
3944
3947
|
for (let index = 0; index < Math.min(left.length, right.length); index++) {
|
|
3945
|
-
yield* FromValue2(`${
|
|
3948
|
+
yield* FromValue2(`${path}/${index}`, left[index], right[index]);
|
|
3946
3949
|
}
|
|
3947
3950
|
} else {
|
|
3948
|
-
return yield CreateUpdate(
|
|
3951
|
+
return yield CreateUpdate(path, right);
|
|
3949
3952
|
}
|
|
3950
3953
|
}
|
|
3951
|
-
function* FromUnknown(
|
|
3954
|
+
function* FromUnknown(path, left, right) {
|
|
3952
3955
|
if (left === right)
|
|
3953
3956
|
return;
|
|
3954
|
-
yield CreateUpdate(
|
|
3957
|
+
yield CreateUpdate(path, right);
|
|
3955
3958
|
}
|
|
3956
|
-
function* FromValue2(
|
|
3957
|
-
return globals_exports.IsTypeArray(left) ? yield* FromTypedArray(
|
|
3959
|
+
function* FromValue2(path, left, right) {
|
|
3960
|
+
return globals_exports.IsTypeArray(left) ? yield* FromTypedArray(path, left, right) : guard_exports.IsArray(left) ? yield* FromArray8(path, left, right) : guard_exports.IsObject(left) ? yield* FromObject8(path, left, right) : yield* FromUnknown(path, left, right);
|
|
3958
3961
|
}
|
|
3959
3962
|
function Diff(current, next) {
|
|
3960
3963
|
return [...FromValue2("", current, next)];
|
|
@@ -4360,9 +4363,9 @@ function parseFleetCommands(raw, sourcePath) {
|
|
|
4360
4363
|
return { version: 1, commands, path: sourcePath };
|
|
4361
4364
|
}
|
|
4362
4365
|
function loadFleetCommands(cwd) {
|
|
4363
|
-
const
|
|
4364
|
-
if (!existsSync(
|
|
4365
|
-
return parseFleetCommands(readFileSync(
|
|
4366
|
+
const path = fleetCommandsPath(cwd);
|
|
4367
|
+
if (!existsSync(path)) return null;
|
|
4368
|
+
return parseFleetCommands(readFileSync(path, "utf8"), path);
|
|
4366
4369
|
}
|
|
4367
4370
|
|
|
4368
4371
|
// src/domains/agents/fleet-contract.ts
|
|
@@ -4437,11 +4440,11 @@ function normalizeWriteBoundary(entries) {
|
|
|
4437
4440
|
const normalized = new Set(entries.map(normalizeWriteBoundaryEntry));
|
|
4438
4441
|
return [...normalized].sort();
|
|
4439
4442
|
}
|
|
4440
|
-
function toRepoRelativePosix(
|
|
4441
|
-
return
|
|
4443
|
+
function toRepoRelativePosix(path) {
|
|
4444
|
+
return path.split("\\").join("/");
|
|
4442
4445
|
}
|
|
4443
|
-
function writeBoundaryCovers(boundary,
|
|
4444
|
-
const candidate = toRepoRelativePosix(
|
|
4446
|
+
function writeBoundaryCovers(boundary, path) {
|
|
4447
|
+
const candidate = toRepoRelativePosix(path);
|
|
4445
4448
|
return boundary.some((entry) => entry.endsWith("/") ? candidate.startsWith(entry) : candidate === entry);
|
|
4446
4449
|
}
|
|
4447
4450
|
function describeWriteBoundary(boundary) {
|
|
@@ -4450,11 +4453,15 @@ function describeWriteBoundary(boundary) {
|
|
|
4450
4453
|
|
|
4451
4454
|
// src/domains/agents/fleet-contract.ts
|
|
4452
4455
|
var FLEET_WRITE_BOUNDARY_VERSION = 4;
|
|
4456
|
+
var FLEET_DYNAMIC_STEP_VERSION = 5;
|
|
4453
4457
|
var FLEET_LOOP_MAX_ATTEMPTS = 5;
|
|
4454
4458
|
var FleetScopeSchema = typebox_exports.Union([typebox_exports.Literal("readonly"), typebox_exports.Literal("workspace")]);
|
|
4455
4459
|
function writesSchema(version) {
|
|
4456
4460
|
return version >= FLEET_WRITE_BOUNDARY_VERSION ? { writes: typebox_exports.Optional(typebox_exports.Array(typebox_exports.String({ minLength: 1 }), { maxItems: WRITE_BOUNDARY_MAX_ENTRIES })) } : {};
|
|
4457
4461
|
}
|
|
4462
|
+
function routeSchema(version) {
|
|
4463
|
+
return version >= FLEET_DYNAMIC_STEP_VERSION ? { target: typebox_exports.Optional(typebox_exports.String({ minLength: 1 })), profile: typebox_exports.Optional(typebox_exports.String({ minLength: 1 })) } : {};
|
|
4464
|
+
}
|
|
4458
4465
|
function agentStepSchema(version) {
|
|
4459
4466
|
return typebox_exports.Object(
|
|
4460
4467
|
{
|
|
@@ -4463,7 +4470,40 @@ function agentStepSchema(version) {
|
|
|
4463
4470
|
agent: typebox_exports.String({ minLength: 1 }),
|
|
4464
4471
|
scope: FleetScopeSchema,
|
|
4465
4472
|
dependencies: typebox_exports.Array(typebox_exports.String({ minLength: 1 })),
|
|
4466
|
-
...writesSchema(version)
|
|
4473
|
+
...writesSchema(version),
|
|
4474
|
+
...routeSchema(version)
|
|
4475
|
+
},
|
|
4476
|
+
{ additionalProperties: false }
|
|
4477
|
+
);
|
|
4478
|
+
}
|
|
4479
|
+
function gateStepSchema() {
|
|
4480
|
+
return typebox_exports.Object(
|
|
4481
|
+
{
|
|
4482
|
+
kind: typebox_exports.Literal("gate"),
|
|
4483
|
+
id: typebox_exports.String({ minLength: 1 }),
|
|
4484
|
+
agent: typebox_exports.String({ minLength: 1 }),
|
|
4485
|
+
path: typebox_exports.String({ minLength: 1 }),
|
|
4486
|
+
run: typebox_exports.String({ minLength: 1 }),
|
|
4487
|
+
scope: typebox_exports.Optional(typebox_exports.Literal("workspace")),
|
|
4488
|
+
dependencies: typebox_exports.Array(typebox_exports.String({ minLength: 1 })),
|
|
4489
|
+
...routeSchema(5)
|
|
4490
|
+
},
|
|
4491
|
+
{ additionalProperties: false }
|
|
4492
|
+
);
|
|
4493
|
+
}
|
|
4494
|
+
function planStepSchema() {
|
|
4495
|
+
return typebox_exports.Object(
|
|
4496
|
+
{
|
|
4497
|
+
kind: typebox_exports.Literal("plan"),
|
|
4498
|
+
id: typebox_exports.String({ minLength: 1 }),
|
|
4499
|
+
agent: typebox_exports.Optional(typebox_exports.String({ minLength: 1 })),
|
|
4500
|
+
roster: typebox_exports.Array(typebox_exports.String({ minLength: 1 }), { minItems: 1, maxItems: 16 }),
|
|
4501
|
+
maxTasks: typebox_exports.Integer({ minimum: 1, maximum: 16 }),
|
|
4502
|
+
proposals: typebox_exports.Optional(typebox_exports.Boolean()),
|
|
4503
|
+
scope: FleetScopeSchema,
|
|
4504
|
+
dependencies: typebox_exports.Array(typebox_exports.String({ minLength: 1 })),
|
|
4505
|
+
...writesSchema(5),
|
|
4506
|
+
...routeSchema(5)
|
|
4467
4507
|
},
|
|
4468
4508
|
{ additionalProperties: false }
|
|
4469
4509
|
);
|
|
@@ -4500,12 +4540,19 @@ function loopStepSchema(version) {
|
|
|
4500
4540
|
},
|
|
4501
4541
|
{ additionalProperties: false }
|
|
4502
4542
|
),
|
|
4543
|
+
...version >= FLEET_DYNAMIC_STEP_VERSION ? [
|
|
4544
|
+
typebox_exports.Object(
|
|
4545
|
+
{ kind: typebox_exports.Literal("gate"), gate: typebox_exports.String({ minLength: 1 }) },
|
|
4546
|
+
{ additionalProperties: false }
|
|
4547
|
+
)
|
|
4548
|
+
] : [],
|
|
4503
4549
|
typebox_exports.Object(
|
|
4504
4550
|
{
|
|
4505
4551
|
kind: typebox_exports.Literal("agent"),
|
|
4506
4552
|
agent: typebox_exports.String({ minLength: 1 }),
|
|
4507
4553
|
scope: FleetScopeSchema,
|
|
4508
|
-
...writesSchema(version)
|
|
4554
|
+
...writesSchema(version),
|
|
4555
|
+
...routeSchema(version)
|
|
4509
4556
|
},
|
|
4510
4557
|
{ additionalProperties: false }
|
|
4511
4558
|
)
|
|
@@ -4515,7 +4562,8 @@ function loopStepSchema(version) {
|
|
|
4515
4562
|
kind: typebox_exports.Optional(typebox_exports.Literal("agent")),
|
|
4516
4563
|
agent: typebox_exports.String({ minLength: 1 }),
|
|
4517
4564
|
scope: FleetScopeSchema,
|
|
4518
|
-
...writesSchema(version)
|
|
4565
|
+
...writesSchema(version),
|
|
4566
|
+
...routeSchema(version)
|
|
4519
4567
|
},
|
|
4520
4568
|
{ additionalProperties: false }
|
|
4521
4569
|
)
|
|
@@ -4526,6 +4574,15 @@ function loopStepSchema(version) {
|
|
|
4526
4574
|
function stepSchema(version) {
|
|
4527
4575
|
if (version === 1) return agentStepSchema(1);
|
|
4528
4576
|
if (version === 2) return typebox_exports.Union([agentStepSchema(2), codeStepSchema(2)]);
|
|
4577
|
+
if (version === 5) {
|
|
4578
|
+
return typebox_exports.Union([
|
|
4579
|
+
agentStepSchema(version),
|
|
4580
|
+
codeStepSchema(version),
|
|
4581
|
+
loopStepSchema(version),
|
|
4582
|
+
gateStepSchema(),
|
|
4583
|
+
planStepSchema()
|
|
4584
|
+
]);
|
|
4585
|
+
}
|
|
4529
4586
|
return typebox_exports.Union([agentStepSchema(version), codeStepSchema(version), loopStepSchema(version)]);
|
|
4530
4587
|
}
|
|
4531
4588
|
function frontmatterSchema(version) {
|
|
@@ -4537,7 +4594,8 @@ function frontmatterSchema(version) {
|
|
|
4537
4594
|
steps: typebox_exports.Array(stepSchema(version), { minItems: 1 }),
|
|
4538
4595
|
maxWorkers: typebox_exports.Integer({ minimum: 1 }),
|
|
4539
4596
|
budgetUsd: typebox_exports.Optional(typebox_exports.Number()),
|
|
4540
|
-
onFailure: typebox_exports.Union([typebox_exports.Literal("stop"), typebox_exports.Literal("continue")])
|
|
4597
|
+
onFailure: typebox_exports.Union([typebox_exports.Literal("stop"), typebox_exports.Literal("continue")]),
|
|
4598
|
+
...version >= FLEET_DYNAMIC_STEP_VERSION ? { writers: typebox_exports.Optional(typebox_exports.Literal(1)) } : {}
|
|
4541
4599
|
},
|
|
4542
4600
|
{ additionalProperties: false }
|
|
4543
4601
|
);
|
|
@@ -4546,11 +4604,12 @@ var SCHEMAS = {
|
|
|
4546
4604
|
1: frontmatterSchema(1),
|
|
4547
4605
|
2: frontmatterSchema(2),
|
|
4548
4606
|
3: frontmatterSchema(3),
|
|
4549
|
-
4: frontmatterSchema(4)
|
|
4607
|
+
4: frontmatterSchema(4),
|
|
4608
|
+
5: frontmatterSchema(5)
|
|
4550
4609
|
};
|
|
4551
4610
|
function contractVersion(frontmatter) {
|
|
4552
4611
|
const value = frontmatter.version;
|
|
4553
|
-
return value === 1 || value === 2 || value === 3 || value === 4 ? value : null;
|
|
4612
|
+
return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 ? value : null;
|
|
4554
4613
|
}
|
|
4555
4614
|
function firstSchemaError2(frontmatter, version) {
|
|
4556
4615
|
const schema = SCHEMAS[version];
|
|
@@ -4565,6 +4624,36 @@ function normalizedWrites(writes) {
|
|
|
4565
4624
|
return writes === void 0 ? {} : { writes: normalizeWriteBoundary(writes) };
|
|
4566
4625
|
}
|
|
4567
4626
|
function normalizeStep(step) {
|
|
4627
|
+
const route = (value) => ({
|
|
4628
|
+
...value.target !== void 0 ? { target: value.target } : {},
|
|
4629
|
+
...value.profile !== void 0 ? { profile: value.profile } : {}
|
|
4630
|
+
});
|
|
4631
|
+
if (step.kind === "gate") {
|
|
4632
|
+
return {
|
|
4633
|
+
kind: "gate",
|
|
4634
|
+
id: step.id,
|
|
4635
|
+
agent: step.agent ?? "",
|
|
4636
|
+
path: step.path ?? "",
|
|
4637
|
+
run: step.run ?? "",
|
|
4638
|
+
scope: "workspace",
|
|
4639
|
+
dependencies: [...step.dependencies],
|
|
4640
|
+
...route(step)
|
|
4641
|
+
};
|
|
4642
|
+
}
|
|
4643
|
+
if (step.kind === "plan") {
|
|
4644
|
+
return {
|
|
4645
|
+
kind: "plan",
|
|
4646
|
+
id: step.id,
|
|
4647
|
+
agent: step.agent ?? "architect",
|
|
4648
|
+
roster: [...step.roster ?? []],
|
|
4649
|
+
maxTasks: step.maxTasks ?? 0,
|
|
4650
|
+
proposals: step.proposals ?? false,
|
|
4651
|
+
scope: step.scope,
|
|
4652
|
+
dependencies: [...step.dependencies],
|
|
4653
|
+
...normalizedWrites(step.writes),
|
|
4654
|
+
...route(step)
|
|
4655
|
+
};
|
|
4656
|
+
}
|
|
4568
4657
|
if (step.kind === "loop") {
|
|
4569
4658
|
const check = step.check;
|
|
4570
4659
|
const repair = step.repair;
|
|
@@ -4573,8 +4662,20 @@ function normalizeStep(step) {
|
|
|
4573
4662
|
id: step.id,
|
|
4574
4663
|
maxAttempts: step.maxAttempts ?? 0,
|
|
4575
4664
|
dependencies: [...step.dependencies],
|
|
4576
|
-
check: check.kind === "code" ? { kind: "code", command: check.command ?? "", scope: check.scope, ...normalizedWrites(check.writes) } : { kind: "
|
|
4577
|
-
|
|
4665
|
+
check: check.kind === "code" ? { kind: "code", command: check.command ?? "", scope: check.scope, ...normalizedWrites(check.writes) } : check.kind === "gate" ? { kind: "gate", gate: check.gate ?? "" } : {
|
|
4666
|
+
kind: "agent",
|
|
4667
|
+
agent: check.agent ?? "",
|
|
4668
|
+
scope: check.scope,
|
|
4669
|
+
...normalizedWrites(check.writes),
|
|
4670
|
+
...route(check)
|
|
4671
|
+
},
|
|
4672
|
+
repair: {
|
|
4673
|
+
kind: "agent",
|
|
4674
|
+
agent: repair.agent,
|
|
4675
|
+
scope: repair.scope,
|
|
4676
|
+
...normalizedWrites(repair.writes),
|
|
4677
|
+
...route(repair)
|
|
4678
|
+
}
|
|
4578
4679
|
};
|
|
4579
4680
|
}
|
|
4580
4681
|
if (step.kind === "code") {
|
|
@@ -4594,7 +4695,8 @@ function normalizeStep(step) {
|
|
|
4594
4695
|
agent: step.agent ?? "",
|
|
4595
4696
|
scope: step.scope,
|
|
4596
4697
|
dependencies: [...step.dependencies],
|
|
4597
|
-
...normalizedWrites(step.writes)
|
|
4698
|
+
...normalizedWrites(step.writes),
|
|
4699
|
+
...route(step)
|
|
4598
4700
|
};
|
|
4599
4701
|
}
|
|
4600
4702
|
function fleetLoopCheckStepId(loopId, attempt) {
|
|
@@ -4635,6 +4737,13 @@ function validateFleetGraph(contract) {
|
|
|
4635
4737
|
}
|
|
4636
4738
|
}
|
|
4637
4739
|
for (const step of contract.steps) {
|
|
4740
|
+
if (step.kind === "loop" && step.check.kind === "gate") {
|
|
4741
|
+
const gateId = step.check.gate;
|
|
4742
|
+
const gate = contract.steps.find((candidate) => candidate.id === gateId);
|
|
4743
|
+
if (gate?.kind !== "gate") {
|
|
4744
|
+
throw new Error(`fleet contract ${contract.path}: loop '${step.id}' names unknown gate '${gateId}'`);
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4638
4747
|
for (const dependency of step.dependencies) {
|
|
4639
4748
|
if (dependency === step.id) throw new Error(`fleet contract ${contract.path}: step '${step.id}' depends on itself`);
|
|
4640
4749
|
if (!declared.has(dependency)) {
|
|
@@ -4688,10 +4797,18 @@ function fleetStepBoundaries(contract) {
|
|
|
4688
4797
|
};
|
|
4689
4798
|
for (const step of contract.steps) {
|
|
4690
4799
|
if (step.kind === "loop") {
|
|
4691
|
-
|
|
4800
|
+
if (step.check.kind === "gate") {
|
|
4801
|
+
const gateId = step.check.gate;
|
|
4802
|
+
const gate = contract.steps.find((candidate) => candidate.id === gateId);
|
|
4803
|
+
if (gate?.kind === "gate") add(`${step.id}.check`, "workspace", [gate.path]);
|
|
4804
|
+
} else add(`${step.id}.check`, step.check.scope, step.check.writes);
|
|
4692
4805
|
add(`${step.id}.repair`, step.repair.scope, step.repair.writes);
|
|
4693
4806
|
continue;
|
|
4694
4807
|
}
|
|
4808
|
+
if (step.kind === "gate") {
|
|
4809
|
+
add(step.id, "workspace", [step.path]);
|
|
4810
|
+
continue;
|
|
4811
|
+
}
|
|
4695
4812
|
add(step.id, step.scope, step.writes);
|
|
4696
4813
|
}
|
|
4697
4814
|
return boundaries;
|
|
@@ -4707,9 +4824,9 @@ function validateWriteBoundaries(contract) {
|
|
|
4707
4824
|
}
|
|
4708
4825
|
for (const step of contract.steps) {
|
|
4709
4826
|
const declared = step.kind === "loop" ? [
|
|
4710
|
-
{ id: `${step.id}.check`, scope: step.check.scope, writes: step.check.writes },
|
|
4827
|
+
...step.check.kind === "gate" ? [] : [{ id: `${step.id}.check`, scope: step.check.scope, writes: step.check.writes }],
|
|
4711
4828
|
{ id: `${step.id}.repair`, scope: step.repair.scope, writes: step.repair.writes }
|
|
4712
|
-
] : [{ id: step.id, scope: step.scope, writes: step.writes }];
|
|
4829
|
+
] : step.kind === "gate" ? [] : [{ id: step.id, scope: step.scope, writes: step.writes }];
|
|
4713
4830
|
for (const position of declared) {
|
|
4714
4831
|
if (position.scope === "readonly" && position.writes !== void 0) {
|
|
4715
4832
|
throw new Error(
|
|
@@ -4742,11 +4859,10 @@ function parseFleetContract(raw, sourcePath) {
|
|
|
4742
4859
|
const { frontmatter, body } = parseFrontmatter(raw, sourcePath);
|
|
4743
4860
|
const version = contractVersion(frontmatter);
|
|
4744
4861
|
if (version === null) {
|
|
4745
|
-
throw new Error(
|
|
4746
|
-
`fleet contract ${sourcePath}: version must be 1 (agent steps), 2 (agent and code steps), 3 (adds bounded loops and commit steps), or 4 (adds enforced write boundaries)`
|
|
4747
|
-
);
|
|
4862
|
+
throw new Error(`fleet contract ${sourcePath}: version must be 1, 2, 3, 4, or 5`);
|
|
4748
4863
|
}
|
|
4749
4864
|
if (version < FLEET_WRITE_BOUNDARY_VERSION) assertNoWritesBefore(frontmatter, sourcePath, version);
|
|
4865
|
+
if (version < FLEET_DYNAMIC_STEP_VERSION) assertNoV5FieldsBefore(frontmatter, sourcePath, version);
|
|
4750
4866
|
const schemaError = firstSchemaError2(frontmatter, version);
|
|
4751
4867
|
if (schemaError !== null) {
|
|
4752
4868
|
throw new Error(`fleet contract ${sourcePath}: ${schemaError}`);
|
|
@@ -4767,13 +4883,47 @@ function parseFleetContract(raw, sourcePath) {
|
|
|
4767
4883
|
maxWorkers: fm.maxWorkers,
|
|
4768
4884
|
budgetUsd: fm.budgetUsd ?? null,
|
|
4769
4885
|
onFailure: fm.onFailure,
|
|
4886
|
+
...fm.writers === 1 ? { writers: 1 } : {},
|
|
4770
4887
|
body: trimmedBody,
|
|
4771
4888
|
path: sourcePath
|
|
4772
4889
|
};
|
|
4773
4890
|
validateFleetGraph(contract);
|
|
4774
4891
|
validateWriteBoundaries(contract);
|
|
4892
|
+
validateV5Declarations(contract);
|
|
4775
4893
|
return contract;
|
|
4776
4894
|
}
|
|
4895
|
+
function validateV5Declarations(contract) {
|
|
4896
|
+
if (contract.version < FLEET_DYNAMIC_STEP_VERSION) return;
|
|
4897
|
+
const route = (id, value) => {
|
|
4898
|
+
if (value.target !== void 0 && value.profile !== void 0) {
|
|
4899
|
+
throw new Error(`fleet contract ${contract.path}: step '${id}' may declare target or profile, never both`);
|
|
4900
|
+
}
|
|
4901
|
+
};
|
|
4902
|
+
for (const step of contract.steps) {
|
|
4903
|
+
if (step.kind === "agent" || step.kind === "plan" || step.kind === "gate") route(step.id, step);
|
|
4904
|
+
if (step.kind === "plan" && new Set(step.roster).size !== step.roster.length) {
|
|
4905
|
+
throw new Error(`fleet contract ${contract.path}: plan step '${step.id}' roster contains duplicate agents`);
|
|
4906
|
+
}
|
|
4907
|
+
if (step.kind === "gate") {
|
|
4908
|
+
let normalized;
|
|
4909
|
+
try {
|
|
4910
|
+
normalized = normalizeWriteBoundary([step.path]);
|
|
4911
|
+
} catch (error) {
|
|
4912
|
+
throw new Error(
|
|
4913
|
+
`fleet contract ${contract.path}: gate '${step.id}' path is invalid: ${error instanceof Error ? error.message : String(error)}`
|
|
4914
|
+
);
|
|
4915
|
+
}
|
|
4916
|
+
if (normalized[0] !== step.path.replaceAll("\\", "/")) {
|
|
4917
|
+
throw new Error(
|
|
4918
|
+
`fleet contract ${contract.path}: gate '${step.id}' path must be normalized and repository-relative`
|
|
4919
|
+
);
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
if (step.kind !== "loop") continue;
|
|
4923
|
+
if (step.check.kind === "agent") route(`${step.id}.check`, step.check);
|
|
4924
|
+
route(`${step.id}.repair`, step.repair);
|
|
4925
|
+
}
|
|
4926
|
+
}
|
|
4777
4927
|
function assertNoWritesBefore(frontmatter, sourcePath, version) {
|
|
4778
4928
|
const steps = Array.isArray(frontmatter.steps) ? frontmatter.steps : [];
|
|
4779
4929
|
const declaresWrites = (value) => typeof value === "object" && value !== null && "writes" in value;
|
|
@@ -4786,10 +4936,38 @@ function assertNoWritesBefore(frontmatter, sourcePath, version) {
|
|
|
4786
4936
|
}
|
|
4787
4937
|
}
|
|
4788
4938
|
}
|
|
4939
|
+
function assertNoV5FieldsBefore(frontmatter, sourcePath, version) {
|
|
4940
|
+
const forbidden = ["target", "profile"];
|
|
4941
|
+
if ("writers" in frontmatter) {
|
|
4942
|
+
throw new Error(
|
|
4943
|
+
`fleet contract ${sourcePath}: 'writers' requires contract version ${FLEET_DYNAMIC_STEP_VERSION}; this contract declares version ${version}`
|
|
4944
|
+
);
|
|
4945
|
+
}
|
|
4946
|
+
for (const value of Array.isArray(frontmatter.steps) ? frontmatter.steps : []) {
|
|
4947
|
+
if (typeof value !== "object" || value === null) continue;
|
|
4948
|
+
const step = value;
|
|
4949
|
+
if (step.kind === "plan" || step.kind === "gate") {
|
|
4950
|
+
throw new Error(
|
|
4951
|
+
`fleet contract ${sourcePath}: kind '${String(step.kind)}' requires contract version ${FLEET_DYNAMIC_STEP_VERSION}; this contract declares version ${version}`
|
|
4952
|
+
);
|
|
4953
|
+
}
|
|
4954
|
+
for (const candidate of [step, step.check, step.repair]) {
|
|
4955
|
+
if (typeof candidate !== "object" || candidate === null) continue;
|
|
4956
|
+
for (const field of forbidden) {
|
|
4957
|
+
if (field in candidate) {
|
|
4958
|
+
throw new Error(
|
|
4959
|
+
`fleet contract ${sourcePath}: '${field}' requires contract version ${FLEET_DYNAMIC_STEP_VERSION}; this contract declares version ${version}`
|
|
4960
|
+
);
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
}
|
|
4964
|
+
}
|
|
4965
|
+
}
|
|
4789
4966
|
function fleetCodeSteps(contract) {
|
|
4790
4967
|
const steps = [];
|
|
4791
4968
|
for (const step of contract.steps) {
|
|
4792
4969
|
if (step.kind === "code") steps.push({ id: step.id, command: step.command });
|
|
4970
|
+
else if (step.kind === "gate") steps.push({ id: step.id, command: step.run });
|
|
4793
4971
|
else if (step.kind === "loop" && step.check.kind === "code") {
|
|
4794
4972
|
steps.push({ id: fleetLoopCheckStepId(step.id, 1), command: step.check.command });
|
|
4795
4973
|
}
|
|
@@ -4831,6 +5009,8 @@ function builtinFleetsDir() {
|
|
|
4831
5009
|
function fleetContractPath(cwd, name) {
|
|
4832
5010
|
const projectPath = join2(fleetsDir(cwd), `${name}.md`);
|
|
4833
5011
|
if (existsSync2(projectPath)) return { path: projectPath, source: "project" };
|
|
5012
|
+
const userPath = join2(clioConfigDir(), "fleets", `${name}.md`);
|
|
5013
|
+
if (existsSync2(userPath)) return { path: userPath, source: "user" };
|
|
4834
5014
|
const builtinPath = join2(builtinFleetsDir(), `${name}.md`);
|
|
4835
5015
|
if (existsSync2(builtinPath)) return { path: builtinPath, source: "builtin" };
|
|
4836
5016
|
return null;
|
|
@@ -4863,21 +5043,22 @@ function listFleetContracts(cwd) {
|
|
|
4863
5043
|
const listings = /* @__PURE__ */ new Map();
|
|
4864
5044
|
const sources = [
|
|
4865
5045
|
{ dir: builtinFleetsDir(), source: "builtin" },
|
|
5046
|
+
{ dir: join2(clioConfigDir(), "fleets"), source: "user" },
|
|
4866
5047
|
{ dir: fleetsDir(cwd), source: "project" }
|
|
4867
5048
|
];
|
|
4868
5049
|
for (const { dir, source } of sources) {
|
|
4869
5050
|
for (const file of listDirectory(dir)) {
|
|
4870
|
-
const
|
|
5051
|
+
const path = join2(dir, file);
|
|
4871
5052
|
const name = basename(file, ".md");
|
|
4872
5053
|
try {
|
|
4873
|
-
const contract = parseFleetContract(readFileSync2(
|
|
5054
|
+
const contract = parseFleetContract(readFileSync2(path, "utf8"), path);
|
|
4874
5055
|
if (registryError !== null && fleetCodeSteps(contract).length > 0) throw new Error(registryError);
|
|
4875
5056
|
validateFleetCommands(contract, registry);
|
|
4876
|
-
listings.set(name, { name, path
|
|
5057
|
+
listings.set(name, { name, path, source, contract, error: null, needsCommands: null });
|
|
4877
5058
|
} catch (err) {
|
|
4878
5059
|
listings.set(name, {
|
|
4879
5060
|
name,
|
|
4880
|
-
path
|
|
5061
|
+
path,
|
|
4881
5062
|
source,
|
|
4882
5063
|
contract: null,
|
|
4883
5064
|
error: err instanceof Error ? err.message : String(err),
|
|
@@ -4908,37 +5089,6 @@ function renderFleetPrompt(body, vars) {
|
|
|
4908
5089
|
return rendered;
|
|
4909
5090
|
}
|
|
4910
5091
|
|
|
4911
|
-
// src/domains/safety/rigor.ts
|
|
4912
|
-
init_esm_shims();
|
|
4913
|
-
import { existsSync as existsSync3 } from "node:fs";
|
|
4914
|
-
import path from "node:path";
|
|
4915
|
-
var VALIDATION_CONTRACT_FILES = [
|
|
4916
|
-
path.join(".clio-coder", "validation.yaml"),
|
|
4917
|
-
path.join(".clio-coder", "validation.yml"),
|
|
4918
|
-
"validation.yaml",
|
|
4919
|
-
"validation.yml",
|
|
4920
|
-
"VALIDATION.md"
|
|
4921
|
-
];
|
|
4922
|
-
function resolveRigor(options) {
|
|
4923
|
-
if (options.override === "high" || options.override === "normal") return options.override;
|
|
4924
|
-
const cwd = options.cwd ?? process.cwd();
|
|
4925
|
-
return hasValidationContract(cwd) ? "high" : "normal";
|
|
4926
|
-
}
|
|
4927
|
-
function parseRigorOverride(value) {
|
|
4928
|
-
if (typeof value !== "string") return null;
|
|
4929
|
-
const normalized = value.trim().toLowerCase();
|
|
4930
|
-
if (normalized === "high") return "high";
|
|
4931
|
-
if (normalized === "normal") return "normal";
|
|
4932
|
-
return null;
|
|
4933
|
-
}
|
|
4934
|
-
function hasValidationContract(cwd) {
|
|
4935
|
-
try {
|
|
4936
|
-
return VALIDATION_CONTRACT_FILES.some((relative) => existsSync3(path.join(cwd, relative)));
|
|
4937
|
-
} catch {
|
|
4938
|
-
return false;
|
|
4939
|
-
}
|
|
4940
|
-
}
|
|
4941
|
-
|
|
4942
5092
|
export {
|
|
4943
5093
|
parseFrontmatter,
|
|
4944
5094
|
FLEET_COMMAND_BASE_ENV,
|
|
@@ -4948,14 +5098,16 @@ export {
|
|
|
4948
5098
|
describeWriteBoundary,
|
|
4949
5099
|
fleetLoopCheckStepId,
|
|
4950
5100
|
fleetLoopRepairStepId,
|
|
5101
|
+
validateFleetGraph,
|
|
4951
5102
|
fleetStepWriteBoundary,
|
|
5103
|
+
fleetStepBoundaries,
|
|
5104
|
+
parseFleetContract,
|
|
4952
5105
|
FLEET_COMMANDS_REPO_PATH,
|
|
4953
5106
|
FLEET_COMMANDS_REMEDY,
|
|
4954
5107
|
FleetCommandRegistryMissingError,
|
|
5108
|
+
validateFleetCommands,
|
|
4955
5109
|
loadFleetContract,
|
|
4956
5110
|
listFleetContracts,
|
|
4957
|
-
renderFleetPrompt
|
|
4958
|
-
resolveRigor,
|
|
4959
|
-
parseRigorOverride
|
|
5111
|
+
renderFleetPrompt
|
|
4960
5112
|
};
|
|
4961
|
-
//# sourceMappingURL=chunk-
|
|
5113
|
+
//# sourceMappingURL=chunk-KCMKRQX4.js.map
|