@iowarp/clio-coder 0.3.7 → 0.3.9
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 +80 -0
- package/README.md +13 -4
- package/dist/{acp-SK4MD6MM.js → acp-7LOELQFP.js} +13 -13
- package/dist/{agents-2FN2K6ME.js → agents-FIBG2SHA.js} +41 -37
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-QIYZWM5I.js → auth-OI4LIH2I.js} +31 -24
- package/dist/builtins-AD25UL3C.js +17 -0
- package/dist/{chunk-5FR74PWO.js → chunk-2JDWVJND.js} +2 -2
- package/dist/chunk-3DPEIQKN.js +113 -0
- package/dist/{chunk-EOOQZZDE.js → chunk-3DUR4WUA.js} +19 -19
- package/dist/{chunk-WHJYKASB.js → chunk-3MRC2YSQ.js} +2 -2
- package/dist/{chunk-EBEFWSGL.js → chunk-3UUY7R3Z.js} +14 -10
- package/dist/{chunk-LADCF22A.js → chunk-3V5AYSEQ.js} +113 -54
- package/dist/{chunk-BMWK7ZIZ.js → chunk-465CC7FK.js} +16 -13
- package/dist/{chunk-5WIGXA4T.js → chunk-47CMYGET.js} +111 -4
- package/dist/{chunk-CEYBNUGC.js → chunk-4H6ULJ3H.js} +378 -36
- package/dist/{chunk-YTYFXUI3.js → chunk-4LJX2PUC.js} +9 -9
- package/dist/{chunk-DOOEX22V.js → chunk-56KB5IJP.js} +5 -5
- package/dist/{chunk-SPULKLCF.js → chunk-5DQRIYDZ.js} +2 -2
- package/dist/{chunk-TSHXZTOQ.js → chunk-5HFBWUMU.js} +23 -11
- package/dist/{chunk-5UJ6ECTS.js → chunk-5PVQ4SRS.js} +80 -8
- package/dist/{chunk-ZWLZP4ZT.js → chunk-5QKCQQ3E.js} +359 -17
- package/dist/{chunk-6M7VS3J3.js → chunk-5T7RBWN2.js} +111 -5
- package/dist/chunk-774ILSRL.js +172 -0
- package/dist/chunk-7C6RYZGQ.js +391 -0
- package/dist/{chunk-GH5622CP.js → chunk-A2NJGIB3.js} +2 -2
- package/dist/{chunk-C4JBQ5SR.js → chunk-AD7Y7STJ.js} +6 -6
- package/dist/{chunk-GEYXPTRF.js → chunk-AEYBF3TB.js} +33 -12
- package/dist/{chunk-2SFS6XQE.js → chunk-AMKHQW3C.js} +3 -2
- package/dist/{chunk-D4MDIG46.js → chunk-B5CSFE7B.js} +7 -7
- package/dist/{chunk-MXI6J5JF.js → chunk-B5XRQOLB.js} +10 -10
- package/dist/{chunk-X2KV5FXT.js → chunk-BVDVID7E.js} +2 -2
- package/dist/{chunk-JNXPYBB4.js → chunk-CA42X6KT.js} +3 -3
- package/dist/{chunk-VREKEFLL.js → chunk-D73KXYPF.js} +3 -3
- package/dist/{chunk-JTSEDYVQ.js → chunk-DG4M6ZUE.js} +7 -7
- package/dist/{chunk-DQA7QLMD.js → chunk-EBOC7MT3.js} +10 -25
- package/dist/{chunk-KZ2H5X4G.js → chunk-ECUO3KDP.js} +129 -14
- package/dist/{chunk-JRIO5UD2.js → chunk-EQ63NRB7.js} +5 -5
- package/dist/{chunk-YD734TPH.js → chunk-FALJGAWU.js} +2 -2
- package/dist/{chunk-GWS3VEIW.js → chunk-FWDFM5ZU.js} +24 -3
- package/dist/{chunk-XEGB6BCN.js → chunk-GAYUJ7LE.js} +68 -14
- package/dist/{chunk-UND3GU2L.js → chunk-H7IXIC72.js} +2 -2
- package/dist/{chunk-IR4CFBFN.js → chunk-HAY4ZE2P.js} +12 -12
- package/dist/{chunk-UVDSQ6LW.js → chunk-HCBCAYZU.js} +74 -147
- package/dist/{chunk-4DWFMQDR.js → chunk-HJB5IUKP.js} +89 -145
- package/dist/{chunk-M4AKACEO.js → chunk-HKO36JWF.js} +33 -5
- package/dist/{chunk-KCMKRQX4.js → chunk-HPCTNZM2.js} +45 -82
- package/dist/{chunk-465YSENW.js → chunk-IFBNV6H6.js} +3 -3
- package/dist/{chunk-FJ3H4MN5.js → chunk-IHKBWSXF.js} +2 -2
- package/dist/chunk-JEQQR47K.js +3025 -0
- package/dist/{chunk-FO5ZOVUY.js → chunk-KV2AOLDF.js} +27 -7
- package/dist/chunk-LU7P4LHA.js +33 -0
- package/dist/{chunk-6TUKSZVF.js → chunk-LXPJXFM5.js} +11 -11
- package/dist/{chunk-VQNODYQ4.js → chunk-MIX5N5AC.js} +488 -3668
- package/dist/chunk-MLOK6ZOS.js +2888 -0
- package/dist/{chunk-ZZMN5OM4.js → chunk-MV2VUEJC.js} +2 -2
- package/dist/{chunk-MVVUPGPW.js → chunk-MXHC5QYU.js} +6 -6
- package/dist/{chunk-OBMAI2DP.js → chunk-N3PBVRTZ.js} +12 -388
- package/dist/{chunk-WJHBC77E.js → chunk-N5XKWMDW.js} +17 -7
- package/dist/{chunk-5C3AQNDW.js → chunk-NNNWO6F2.js} +124 -36
- package/dist/{chunk-UFQ3F4FW.js → chunk-NQ6UCCOD.js} +4 -4
- package/dist/chunk-NUGM5KR6.js +165 -0
- package/dist/{chunk-DMD2AGVS.js → chunk-NZU6YDNV.js} +20 -18
- package/dist/{chunk-WHGPSPT5.js → chunk-O6I4CIEU.js} +151 -13
- package/dist/{chunk-XN3L4EYL.js → chunk-OEDBCISO.js} +2 -2
- package/dist/{chunk-PD3MESLB.js → chunk-P3JGPQFL.js} +4 -4
- package/dist/{chunk-UHXRNZ2J.js → chunk-PNY46YEY.js} +23 -6
- package/dist/{chunk-THKY7CD7.js → chunk-PZ4I4JE2.js} +134 -29
- package/dist/{chunk-SROCI7ZU.js → chunk-QQ7EKM72.js} +5 -5
- package/dist/{chunk-QCTRSGHQ.js → chunk-R7LNVMCS.js} +91 -53
- package/dist/{chunk-GOXNB3AO.js → chunk-RAPCMZL4.js} +75 -4
- package/dist/chunk-RKKLTLYB.js +45 -0
- package/dist/{chunk-OB5HIGJY.js → chunk-RKRLDWD3.js} +4 -1
- package/dist/{chunk-DJNLUABN.js → chunk-S4COXYBG.js} +588 -32
- package/dist/{chunk-3HAPLH5M.js → chunk-T3Z6VAAF.js} +172 -11
- package/dist/{chunk-FOT2FX5J.js → chunk-TD7UE2L5.js} +12 -10
- package/dist/{chunk-UUANF5CR.js → chunk-TEO2TLVN.js} +856 -967
- package/dist/{chunk-FCSXB6T2.js → chunk-UOSL25KY.js} +14 -2
- package/dist/{chunk-EELBMBT6.js → chunk-VKBMFOYV.js} +74 -15
- package/dist/chunk-VO2LKSTM.js +165 -0
- package/dist/{chunk-5C77SEEY.js → chunk-VPTUJU4P.js} +3 -3
- package/dist/{chunk-WEH5XRJQ.js → chunk-WIE7ZOSW.js} +2 -2
- package/dist/{chunk-J7PIKKWC.js → chunk-WXCJ7VME.js} +8 -8
- package/dist/{chunk-4DGYLA73.js → chunk-XDOQXGFO.js} +22 -7
- package/dist/{chunk-PPAMZ32Z.js → chunk-XK56QHLX.js} +6 -1
- package/dist/{chunk-AB4XIIVB.js → chunk-YKOFT37S.js} +6 -6
- package/dist/chunk-YSEHGPCT.js +127 -0
- package/dist/{chunk-HFSBBKSQ.js → chunk-YW7UVM5V.js} +138 -3
- package/dist/cli/index.js +32 -32
- package/dist/{clio-WBVQEBKO.js → clio-LT5V7SSZ.js} +9 -9
- package/dist/{code-nav-FGGFIE7L.js → code-nav-LMW275PA.js} +5 -5
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-F7OEATSO.js → components-ZFA3SAER.js} +8 -8
- package/dist/{config-TRBL3RCF.js → config-RXS5T3JT.js} +98 -65
- package/dist/{configure-OLCVPHNM.js → configure-2WYWSCSD.js} +26 -22
- package/dist/{context-MJIJ6GOX.js → context-I3BTOTCS.js} +12 -12
- package/dist/{context-XEWE3MOJ.js → context-MVOORGMF.js} +54 -47
- package/dist/{context-WFPKQSM6.js → context-PALKKQYL.js} +28 -28
- package/dist/{context-clear-KNOS2JPB.js → context-clear-N2WOYZ2K.js} +53 -46
- package/dist/{context-index-SSR5ECNE.js → context-index-HNG3MOME.js} +6 -6
- package/dist/{context-working-set-EUXAZI6N.js → context-working-set-MIEVECVZ.js} +17 -18
- package/dist/{dispatch-runner-B7MTOVKL.js → dispatch-runner-VVA4SRRH.js} +90 -61
- package/dist/{docs-FLJTIDSE.js → docs-7LQ23DLM.js} +8 -8
- package/dist/doctor-TWBWFK5V.js +165 -0
- package/dist/eval-IJ5VEZDJ.js +4483 -0
- package/dist/{evidence-JZNBUOQZ.js → evidence-L5APPXNV.js} +68 -61
- package/dist/{evolve-FJVC4KKI.js → evolve-RGNKFJ52.js} +47 -40
- package/dist/{extensions-IQL36S7K.js → extensions-7WYWUX5A.js} +13 -7
- package/dist/{fleet-BDKYJFCP.js → fleet-6CNVBZZP.js} +113 -76
- package/dist/{fleet-commands-ZFIWZSB3.js → fleet-commands-L2SXSYEI.js} +10 -10
- package/dist/{fleet-graph-Y6HPXIVF.js → fleet-graph-2J3OOIPO.js} +17 -15
- package/dist/{fleet-preflight-BHSNPBMH.js → fleet-preflight-CZRJ4JP5.js} +5 -6
- package/dist/{fleet-validate-BIYREGIK.js → fleet-validate-C5RI6DP7.js} +20 -19
- package/dist/{init-LQUB5COQ.js → init-VBN2ACVA.js} +70 -63
- package/dist/{library-NJAHIGG4.js → library-JHGUMLY2.js} +22 -20
- package/dist/{memory-OG6HOYKM.js → memory-K4OQIYWG.js} +49 -42
- package/dist/{models-5ZG5XY7J.js → models-2NCZUWDD.js} +35 -29
- package/dist/{monitor-TJ7AMTGB.js → monitor-MMVTJABD.js} +64 -45
- package/dist/{orchestrator-WZYB54DM.js → orchestrator-ZKBPCHW6.js} +1971 -520
- package/dist/{paths-XUC7GS6E.js → paths-DBXMZMDU.js} +5 -5
- package/dist/registry-LG64LTF4.js +11 -0
- package/dist/{reset-PXQT45IY.js → reset-DD5JGOY3.js} +11 -11
- package/dist/{run-FQ74YF62.js → run-QEGNX7FL.js} +89 -83
- package/dist/{share-FW7SVCL3.js → share-JKD3BQMW.js} +20 -18
- package/dist/{skills-7E7IRB3R.js → skills-LMQIKDOZ.js} +23 -21
- package/dist/{skills-eval-LI75W6OK.js → skills-eval-I7X2774U.js} +59 -52
- package/dist/{steer-GGWFUJUD.js → steer-CF5TDANS.js} +3 -3
- package/dist/support-I7LOJLIF.js +38 -0
- package/dist/{targets-4CIFKCTW.js → targets-RUSR6B5Z.js} +77 -42
- package/dist/{terminal-lease-WUZY7ZV5.js → terminal-lease-QYVORFR4.js} +6 -4
- package/dist/{trace-PNCASAXC.js → trace-ODOQIVIW.js} +61 -6
- package/dist/{uninstall-7FV7IP4E.js → uninstall-ZJF5H5ZN.js} +8 -8
- package/dist/{upgrade-K2HVIVMQ.js → upgrade-XANW3FXB.js} +29 -26
- package/dist/{usage-GTZELZQX.js → usage-4H7ZRXQT.js} +110 -61
- package/dist/{verifiers-RLAHT27O.js → verifiers-UZXNBZEB.js} +13 -13
- package/dist/{verify-BX3BRKH5.js → verify-BVKWTNDL.js} +9 -9
- package/dist/{wiki-generate-ASIFASCN.js → wiki-generate-MY7WV2QI.js} +76 -69
- package/dist/worker/entry.js +69 -66
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/artifact-versions.md +11 -5
- package/docs/built-in-agents.md +1 -1
- package/docs/capacity-and-scheduling.md +23 -2
- package/docs/commands-and-modes.md +2 -2
- package/docs/configuration-and-targets.md +37 -5
- package/docs/context-engine.md +63 -4
- package/docs/documentation-coverage.md +3 -3
- package/docs/documentation-guide.md +1 -1
- package/docs/environment-variables.md +2 -0
- package/docs/eval-runner.md +262 -11
- package/docs/evals-internal.md +72 -2
- package/docs/evidence-and-memory.md +77 -12
- package/docs/evolution.md +1 -1
- package/docs/extensions-and-sharing.md +3 -1
- package/docs/fleet-dispatch.md +34 -9
- package/docs/glossary.md +21 -1
- package/docs/installation-and-lifecycle.md +1 -1
- package/docs/middleware-and-components.md +1 -1
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +54 -3
- package/docs/proactive-memory.md +127 -14
- package/docs/prompt-envelope-and-tools.md +22 -2
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +60 -41
- package/docs/safety-model.md +1 -1
- package/docs/scientific-validation.md +1 -1
- package/docs/skills-marketplace.md +1 -1
- package/docs/tool-usage.md +1 -1
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +87 -0
- package/docs/tui-design.md +1 -1
- package/docs/worker-dispatch-mechanics.md +1 -1
- package/package.json +2 -2
- package/src/cli/agents.ts +1 -1
- package/src/cli/argv.ts +5 -0
- package/src/cli/config-inspect.ts +33 -6
- package/src/cli/config.ts +1 -1
- package/src/cli/configure.ts +107 -23
- package/src/cli/doctor-state-size.ts +82 -0
- package/src/cli/doctor.ts +7 -1
- package/src/cli/eval.ts +80 -16
- package/src/cli/evidence.ts +30 -25
- package/src/cli/extensions.ts +5 -1
- package/src/cli/fleet-preflight.ts +2 -12
- package/src/cli/fleet.ts +32 -3
- package/src/cli/shared.ts +1 -0
- package/src/cli/targets.ts +45 -11
- package/src/cli/trace.ts +63 -4
- package/src/cli/usage.ts +63 -14
- package/src/cli/validate-model.ts +60 -5
- package/src/core/bus-events.ts +54 -1
- package/src/core/cache-telemetry.ts +42 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/config.ts +18 -0
- package/src/core/defaults.ts +36 -6
- package/src/core/endpoint-key.ts +27 -0
- package/src/core/path-boundary.ts +100 -0
- package/src/core/residency-target-key.ts +25 -0
- package/src/core/response-schema.ts +36 -2
- package/src/domains/agents/extension.ts +2 -11
- package/src/domains/agents/fleet-contract.ts +30 -12
- package/src/domains/agents/recipe.ts +7 -1
- package/src/domains/agents/registry.ts +73 -5
- package/src/domains/agents/result-contract.ts +128 -17
- package/src/domains/agents/write-boundary.ts +15 -50
- package/src/domains/config/classify.ts +3 -0
- package/src/domains/context/codewiki/coordinator.ts +12 -4
- package/src/domains/context/project-rules.ts +51 -1
- package/src/domains/dispatch/admission.ts +40 -3
- package/src/domains/dispatch/assignment-reconcile.ts +22 -5
- package/src/domains/dispatch/assignment-store.ts +151 -14
- package/src/domains/dispatch/capacity-lease.ts +98 -9
- package/src/domains/dispatch/contract.ts +26 -1
- package/src/domains/dispatch/delegation-plan.ts +2 -5
- package/src/domains/dispatch/execution-plan.ts +44 -4
- package/src/domains/dispatch/execution-role.ts +9 -1
- package/src/domains/dispatch/extension.ts +309 -96
- package/src/domains/dispatch/fleet-run.ts +78 -4
- package/src/domains/dispatch/gate-role-prompts.ts +38 -0
- package/src/domains/dispatch/heartbeat.ts +32 -8
- package/src/domains/dispatch/index.ts +6 -1
- package/src/domains/dispatch/intent-requirements.ts +40 -0
- package/src/domains/dispatch/intent.ts +84 -8
- package/src/domains/dispatch/orphan-recovery.ts +5 -0
- package/src/domains/dispatch/path-scope.ts +370 -0
- package/src/domains/dispatch/receipt-integrity.ts +2 -1
- package/src/domains/dispatch/reservation-store.ts +116 -8
- package/src/domains/dispatch/state.ts +4 -0
- package/src/domains/dispatch/types.ts +14 -7
- package/src/domains/dispatch/validation.ts +6 -3
- package/src/domains/dispatch/worker-spawn.ts +25 -11
- package/src/domains/dispatch/write-boundary-enforcer.ts +62 -0
- package/src/domains/dispatch/write-boundary.ts +262 -22
- package/src/domains/eval/artifacts/store.ts +62 -0
- package/src/domains/eval/compare/behavioral.ts +224 -0
- package/src/domains/eval/compare/compare.ts +355 -2
- package/src/domains/eval/compare/envelope.ts +128 -0
- package/src/domains/eval/compare/gates.ts +24 -6
- package/src/domains/eval/compare/thresholds.ts +30 -3
- package/src/domains/eval/execution-provenance.ts +240 -0
- package/src/domains/eval/metrics/aggregate.ts +136 -0
- package/src/domains/eval/metrics/call-ledger-stream.ts +112 -0
- package/src/domains/eval/metrics/evidence.ts +79 -2
- package/src/domains/eval/metrics/tracked.ts +413 -0
- package/src/domains/eval/provenance.ts +117 -0
- package/src/domains/eval/reports/comparison.ts +128 -0
- package/src/domains/eval/reports/junit.ts +17 -3
- package/src/domains/eval/reports/markdown.ts +3 -3
- package/src/domains/eval/reports/text.ts +14 -0
- package/src/domains/eval/run-compare.ts +20 -0
- package/src/domains/eval/runners/clio-run.ts +139 -2
- package/src/domains/eval/runners/external-command.ts +28 -3
- package/src/domains/eval/schema/adapter.ts +111 -0
- package/src/domains/eval/schema/artifact.ts +20 -0
- package/src/domains/eval/schema/behavioral-metrics.ts +204 -0
- package/src/domains/eval/schema/behavioral.ts +520 -0
- package/src/domains/eval/schema/execution-envelope.ts +194 -0
- package/src/domains/eval/schema/serving.ts +74 -0
- package/src/domains/eval/schema/suite.ts +38 -8
- package/src/domains/eval/schema/validate.ts +58 -3
- package/src/domains/eval/schema/verdict.ts +237 -0
- package/src/domains/eval/suites/resolve.ts +2 -0
- package/src/domains/eval/suites/run.ts +264 -33
- package/src/domains/eval/verifiers/command.ts +2 -1
- package/src/domains/eval/workspaces/temp-copy.ts +145 -13
- package/src/domains/evidence/build.ts +68 -21
- package/src/domains/evidence/eval.ts +2 -12
- package/src/domains/evidence/findings-markdown.ts +33 -0
- package/src/domains/evidence/index.ts +21 -0
- package/src/domains/evidence/provenance.ts +46 -11
- package/src/domains/evidence/run-trust.ts +7 -113
- package/src/domains/evidence/trust-projection.ts +274 -0
- package/src/domains/evidence/trust-status.ts +145 -17
- package/src/domains/evidence/types.ts +4 -0
- package/src/domains/extensions/compatibility.ts +285 -0
- package/src/domains/extensions/discovery.ts +126 -4
- package/src/domains/extensions/resources.ts +21 -9
- package/src/domains/extensions/state.ts +18 -5
- package/src/domains/extensions/types.ts +6 -1
- package/src/domains/lifecycle/doctor.ts +209 -2
- package/src/domains/memory/index.ts +14 -0
- package/src/domains/memory/task-bank-promotion.ts +64 -0
- package/src/domains/memory/task-memory-policy.ts +77 -8
- package/src/domains/memory/task-memory-spend.ts +131 -0
- package/src/domains/memory/task-memory-status.ts +7 -0
- package/src/domains/memory/task-memory-telemetry.ts +2 -0
- package/src/domains/middleware/index.ts +1 -0
- package/src/domains/middleware/memory-intervention.ts +69 -5
- package/src/domains/middleware/memory-step-endpoint.ts +71 -0
- package/src/domains/observability/background-memory-usage.ts +140 -0
- package/src/domains/observability/cost.ts +1 -1
- package/src/domains/observability/index.ts +7 -0
- package/src/domains/observability/out-of-turn-usage.ts +51 -2
- package/src/domains/observability/trace-store.ts +192 -2
- package/src/domains/prompts/compiler.ts +100 -13
- package/src/domains/prompts/contract.ts +3 -5
- package/src/domains/providers/endpoint-capacity.ts +96 -0
- package/src/domains/providers/extension.ts +30 -2
- package/src/domains/providers/index.ts +10 -0
- package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +243 -1
- package/src/domains/providers/runtime-resolution.ts +8 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +31 -9
- package/src/domains/providers/runtimes/local-native/llamacpp-anthropic.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-completion.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-embed.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-rerank.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp.ts +4 -1
- package/src/domains/providers/runtimes/local-native/lmstudio.ts +4 -1
- package/src/domains/providers/runtimes/local-native/ollama-native.ts +6 -1
- package/src/domains/providers/types/capability-flags.ts +2 -0
- package/src/domains/providers/types/target-descriptor.ts +2 -0
- package/src/domains/resources/common-loader.ts +3 -0
- package/src/domains/resources/prompts/loader.ts +184 -17
- package/src/domains/safety/call-target.ts +52 -0
- package/src/domains/safety/policy-engine.ts +5 -5
- package/src/domains/safety/run-effects.ts +96 -2
- package/src/domains/safety/scope.ts +7 -12
- package/src/domains/session/context-accounting.ts +52 -1
- package/src/domains/session/context-ledger.ts +37 -13
- package/src/domains/session/index.ts +6 -0
- package/src/domains/session/prompt-cache.ts +140 -0
- package/src/domains/session/prompt-manifest.ts +42 -0
- package/src/engine/acp/adapter.ts +18 -3
- package/src/engine/acp/server.ts +4 -1
- package/src/engine/ai.ts +35 -0
- package/src/engine/apis/llamacpp-residency.ts +55 -3
- package/src/engine/apis/lmstudio.ts +25 -5
- package/src/engine/apis/ollama-native.ts +2 -1
- package/src/engine/apis/openai-completions.ts +80 -17
- package/src/engine/apis/residency-lock.ts +3 -1
- package/src/engine/apis/residency.ts +34 -1
- package/src/engine/prompt-templates.ts +18 -1
- package/src/engine/provider-payload.ts +29 -1
- package/src/engine/worker-runtime.ts +6 -3
- package/src/entry/orchestrator.ts +176 -30
- package/src/interactive/chat-loop-messages.ts +26 -7
- package/src/interactive/chat-loop.ts +318 -41
- package/src/interactive/chat-panel.ts +62 -8
- package/src/interactive/clio-editor.ts +45 -8
- package/src/interactive/context-activity.ts +5 -1
- package/src/interactive/context-meter.ts +1 -1
- package/src/interactive/context-overlay.ts +40 -10
- package/src/interactive/cost-overlay.ts +64 -6
- package/src/interactive/dispatch-board.ts +127 -5
- package/src/interactive/fleet-run-preview.ts +41 -15
- package/src/interactive/handoff-round.ts +41 -2
- package/src/interactive/interactive-application.ts +24 -1
- package/src/interactive/interactive-event-projection.ts +14 -0
- package/src/interactive/interactive-input-runtime.ts +8 -0
- package/src/interactive/interactive-presentation.ts +4 -0
- package/src/interactive/interactive-shell.ts +20 -17
- package/src/interactive/interactive-slash-runtime.ts +27 -4
- package/src/interactive/memory-overlay.ts +8 -0
- package/src/interactive/mutation-preview.ts +295 -0
- package/src/interactive/overlay-general-openers.ts +16 -0
- package/src/interactive/overlay-key-routing.ts +38 -0
- package/src/interactive/overlay-lifecycle.ts +38 -5
- package/src/interactive/overlay-permission-lifecycle.ts +22 -2
- package/src/interactive/overlay-session-lifecycle.ts +73 -9
- package/src/interactive/overlays/ask-user.ts +91 -19
- package/src/interactive/overlays/help-reference.ts +4 -0
- package/src/interactive/overlays/prompts.ts +11 -1
- package/src/interactive/overlays/settings.ts +176 -48
- package/src/interactive/permission-hint.ts +34 -2
- package/src/interactive/permission-overlay.ts +159 -9
- package/src/interactive/prewarm.ts +197 -0
- package/src/interactive/render-trace.ts +162 -15
- package/src/interactive/renderers/tool-execution.ts +4 -0
- package/src/interactive/side-question.ts +58 -1
- package/src/interactive/slash-commands.ts +7 -2
- package/src/interactive/status/controller.ts +11 -0
- package/src/interactive/status/state-machine.ts +54 -2
- package/src/interactive/status/types.ts +7 -0
- package/src/interactive/terminal-lease.ts +2 -0
- package/src/interactive/turn-context.ts +299 -31
- package/src/interactive/turn-persistence.ts +14 -4
- package/src/interactive/turn-prewarm.ts +364 -0
- package/src/interactive/turn-queues.ts +7 -4
- package/src/interactive/turn-runtime.ts +8 -1
- package/src/interactive/turn-state.ts +23 -0
- package/src/interactive/view/artifacts.ts +42 -9
- package/src/interactive/view/view-overlay.ts +43 -6
- package/src/interactive/worker-receipts.ts +14 -2
- package/src/interactive/worker-stream.ts +8 -0
- package/src/tools/ask-user.ts +43 -2
- package/src/tools/dispatch-admission.ts +12 -13
- package/src/tools/dispatch-arguments.ts +27 -0
- package/src/tools/dispatch-plan.ts +46 -9
- package/src/tools/dispatch-runner.ts +48 -13
- package/src/tools/dispatch-scout.ts +1 -1
- package/src/tools/monitor.ts +13 -0
- package/src/tools/registry.ts +16 -0
- package/src/tools/worker-evidence.ts +19 -13
- package/src/worker/spec-contract.ts +2 -1
- package/dist/chunk-AOCYTWAV.js +0 -449
- package/dist/chunk-HWUFFB6L.js +0 -83
- package/dist/chunk-R346GLFC.js +0 -31
- package/dist/chunk-ZGH7FGS5.js +0 -1079
- package/dist/doctor-RN4YKO2X.js +0 -87
- package/dist/eval-RUBJVSNQ.js +0 -2557
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveAuthTarget,
|
|
4
|
+
resolveRuntimeAuthTarget
|
|
5
|
+
} from "./chunk-EQ63NRB7.js";
|
|
6
|
+
import {
|
|
7
|
+
getRuntimeRegistry
|
|
8
|
+
} from "./chunk-NUGM5KR6.js";
|
|
9
|
+
import {
|
|
10
|
+
catalogProviderForRuntime,
|
|
11
|
+
listCatalogModelsForRuntime
|
|
12
|
+
} from "./chunk-VO2LKSTM.js";
|
|
13
|
+
import {
|
|
14
|
+
init_esm_shims
|
|
15
|
+
} from "./chunk-3R73A4XB.js";
|
|
16
|
+
|
|
17
|
+
// src/domains/providers/support.ts
|
|
18
|
+
init_esm_shims();
|
|
19
|
+
var SUMMARY_BY_RUNTIME_ID = {
|
|
20
|
+
alcf: "ALCF inference gateway (Sophia/Metis) via Globus",
|
|
21
|
+
anthropic: "Anthropic API",
|
|
22
|
+
"anthropic-max": "Claude Pro/Max subscription via Anthropic OAuth",
|
|
23
|
+
bedrock: "Amazon Bedrock",
|
|
24
|
+
"claude-code": "Claude Code subscription via installed claude CLI",
|
|
25
|
+
"claude-sdk": "Claude Code subscription via Claude Agent SDK",
|
|
26
|
+
deepseek: "DeepSeek API",
|
|
27
|
+
google: "Google Gemini API",
|
|
28
|
+
groq: "Groq API",
|
|
29
|
+
mistral: "Mistral API",
|
|
30
|
+
openai: "OpenAI Platform API",
|
|
31
|
+
"openai-codex": "ChatGPT Plus/Pro via Codex OAuth",
|
|
32
|
+
openrouter: "OpenRouter API",
|
|
33
|
+
"ollama-native": "Ollama native API",
|
|
34
|
+
lmstudio: "LM Studio chat over OpenAI-compatible REST with native REST model management",
|
|
35
|
+
llamacpp: "llama.cpp server (auto-detect surface)",
|
|
36
|
+
"anthropic-compat": "Generic Anthropic-compatible REST",
|
|
37
|
+
"openai-compat": "Generic OpenAI-compatible REST"
|
|
38
|
+
};
|
|
39
|
+
function groupPriority(group) {
|
|
40
|
+
switch (group) {
|
|
41
|
+
case "featured":
|
|
42
|
+
return 0;
|
|
43
|
+
case "subscription":
|
|
44
|
+
return 1;
|
|
45
|
+
case "cloud-api":
|
|
46
|
+
return 2;
|
|
47
|
+
case "local-http":
|
|
48
|
+
return 3;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function supportGroupLabel(group) {
|
|
52
|
+
switch (group) {
|
|
53
|
+
case "featured":
|
|
54
|
+
return "Featured";
|
|
55
|
+
case "subscription":
|
|
56
|
+
return "Subscriptions";
|
|
57
|
+
case "cloud-api":
|
|
58
|
+
return "Cloud APIs";
|
|
59
|
+
case "local-http":
|
|
60
|
+
return "Local HTTP";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function classifyGroup(runtime) {
|
|
64
|
+
if (runtime.id === "openai-codex") return "featured";
|
|
65
|
+
if (runtime.id === "alcf") return "cloud-api";
|
|
66
|
+
if (runtime.auth === "oauth" || runtime.auth === "claude-cli") return "subscription";
|
|
67
|
+
if (catalogProviderForRuntime(runtime.id) || runtime.auth === "api-key" && !runtime.probe) {
|
|
68
|
+
return "cloud-api";
|
|
69
|
+
}
|
|
70
|
+
return "local-http";
|
|
71
|
+
}
|
|
72
|
+
function knownModelsFor(runtimeId, runtime) {
|
|
73
|
+
const catalogModels = listCatalogModelsForRuntime(runtimeId);
|
|
74
|
+
if (catalogModels.length === 0) return runtime?.knownModels ? [...runtime.knownModels] : [];
|
|
75
|
+
return catalogModels.map((model) => model.id);
|
|
76
|
+
}
|
|
77
|
+
function listKnownModelsForRuntime(runtimeId) {
|
|
78
|
+
return knownModelsFor(runtimeId, getRuntimeIfRegistered(runtimeId));
|
|
79
|
+
}
|
|
80
|
+
function getRuntimeIfRegistered(runtimeId) {
|
|
81
|
+
try {
|
|
82
|
+
return getRuntimeRegistry().get(runtimeId);
|
|
83
|
+
} catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function runtimeModelListSource(runtime) {
|
|
88
|
+
if (runtime.knownModels && runtime.knownModels.length > 0) return "runtime";
|
|
89
|
+
if (listCatalogModelsForRuntime(runtime.id).length > 0) return "catalog";
|
|
90
|
+
return "none";
|
|
91
|
+
}
|
|
92
|
+
function modelListSourceForRuntimeId(runtimeId) {
|
|
93
|
+
const runtime = getRuntimeIfRegistered(runtimeId);
|
|
94
|
+
if (runtime) return runtimeModelListSource(runtime);
|
|
95
|
+
return listCatalogModelsForRuntime(runtimeId).length > 0 ? "catalog" : "none";
|
|
96
|
+
}
|
|
97
|
+
function defaultModelForRuntime(runtimeId) {
|
|
98
|
+
if (modelListSourceForRuntimeId(runtimeId) === "catalog") return void 0;
|
|
99
|
+
return listKnownModelsForRuntime(runtimeId)[0];
|
|
100
|
+
}
|
|
101
|
+
function describeRuntimeModels(entry, sample) {
|
|
102
|
+
if (entry.modelSource === "catalog") return `${entry.modelHints.length} in catalog`;
|
|
103
|
+
if (entry.modelHints.length === 0) return "-";
|
|
104
|
+
return entry.modelHints.slice(0, sample).join(", ");
|
|
105
|
+
}
|
|
106
|
+
function buildProviderSupportEntry(runtime) {
|
|
107
|
+
const modelHints = knownModelsFor(runtime.id, runtime);
|
|
108
|
+
const modelSource = runtimeModelListSource(runtime);
|
|
109
|
+
const defaultModel = modelSource === "catalog" ? void 0 : modelHints[0];
|
|
110
|
+
return {
|
|
111
|
+
runtimeId: runtime.id,
|
|
112
|
+
label: runtime.displayName,
|
|
113
|
+
group: classifyGroup(runtime),
|
|
114
|
+
summary: SUMMARY_BY_RUNTIME_ID[runtime.id] ?? runtime.displayName,
|
|
115
|
+
...defaultModel ? { defaultModel } : {},
|
|
116
|
+
modelHints,
|
|
117
|
+
modelSource,
|
|
118
|
+
featured: runtime.id === "openai-codex",
|
|
119
|
+
connectable: runtime.auth === "oauth" || runtime.auth === "api-key",
|
|
120
|
+
supportsCustomUrl: runtime.kind === "http" && (classifyGroup(runtime) === "local-http" || runtime.id === "openai-compat" || runtime.id === "anthropic-compat" || runtime.id === "alcf")
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function compareProviderSupportEntries(a, b) {
|
|
124
|
+
return groupPriority(a.group) - groupPriority(b.group) || (a.featured === b.featured ? 0 : a.featured ? -1 : 1) || a.label.localeCompare(b.label) || a.runtimeId.localeCompare(b.runtimeId);
|
|
125
|
+
}
|
|
126
|
+
function listProviderSupportEntries(runtimes, options = {}) {
|
|
127
|
+
const filtered = options.includeHidden ? runtimes : runtimes.filter((runtime) => runtime.hidden !== true);
|
|
128
|
+
return filtered.map((runtime) => buildProviderSupportEntry(runtime)).sort(compareProviderSupportEntries);
|
|
129
|
+
}
|
|
130
|
+
function configuredTargetsForRuntime(settings, runtimeId) {
|
|
131
|
+
const canonical = getRuntimeIfRegistered(runtimeId)?.id ?? runtimeId;
|
|
132
|
+
return settings.targets.filter(
|
|
133
|
+
(target) => (getRuntimeIfRegistered(target.runtime)?.id ?? target.runtime) === canonical
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function resolveProviderReference(input, settings, getRuntime) {
|
|
137
|
+
const trimmed = input.trim();
|
|
138
|
+
if (trimmed.length === 0) return null;
|
|
139
|
+
const target = settings.targets.find((entry) => entry.id === trimmed) ?? null;
|
|
140
|
+
if (target) {
|
|
141
|
+
const runtime2 = getRuntime(target.runtime);
|
|
142
|
+
if (!runtime2) return null;
|
|
143
|
+
return {
|
|
144
|
+
input: trimmed,
|
|
145
|
+
target,
|
|
146
|
+
runtime: runtime2,
|
|
147
|
+
authTarget: resolveAuthTarget(target, runtime2)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const runtime = getRuntime(trimmed);
|
|
151
|
+
if (!runtime) return null;
|
|
152
|
+
return {
|
|
153
|
+
input: trimmed,
|
|
154
|
+
target: null,
|
|
155
|
+
runtime,
|
|
156
|
+
authTarget: resolveRuntimeAuthTarget(runtime)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
supportGroupLabel,
|
|
162
|
+
listKnownModelsForRuntime,
|
|
163
|
+
runtimeModelListSource,
|
|
164
|
+
defaultModelForRuntime,
|
|
165
|
+
describeRuntimeModels,
|
|
166
|
+
buildProviderSupportEntry,
|
|
167
|
+
compareProviderSupportEntries,
|
|
168
|
+
listProviderSupportEntries,
|
|
169
|
+
configuredTargetsForRuntime,
|
|
170
|
+
resolveProviderReference
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=chunk-774ILSRL.js.map
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
detectValidationCommand,
|
|
4
|
+
extractCommandDeleteTargets,
|
|
5
|
+
extractCommandWriteTargets,
|
|
6
|
+
toolMutationPaths
|
|
7
|
+
} from "./chunk-MV3K5QF2.js";
|
|
8
|
+
import {
|
|
9
|
+
isProjectVerifierCheckId,
|
|
10
|
+
isVerificationScriptName
|
|
11
|
+
} from "./chunk-UL3WSD3F.js";
|
|
12
|
+
import {
|
|
13
|
+
ToolNames
|
|
14
|
+
} from "./chunk-CGKSTWHD.js";
|
|
15
|
+
import {
|
|
16
|
+
init_esm_shims
|
|
17
|
+
} from "./chunk-3R73A4XB.js";
|
|
18
|
+
|
|
19
|
+
// src/domains/safety/finish-contract.ts
|
|
20
|
+
init_esm_shims();
|
|
21
|
+
var FINISH_CONTRACT_ADVISORY_MESSAGE = "[Clio Coder] finish-contract advisory: you changed files this turn without recording validation evidence or an explicit limitation. Run a verification command or state what could not be verified.";
|
|
22
|
+
var DEFAULT_RECENT_ENTRY_LIMIT = 80;
|
|
23
|
+
var LIMITATION_PATTERNS = [
|
|
24
|
+
/\b(?:blocked by|blocker|blockers|unable to|not able to|could not|couldn't|cannot|can't)\b/i,
|
|
25
|
+
/\b(?:did not|didn't|have not|haven't|has not|hasn't|was not able|wasn't able)\b/i,
|
|
26
|
+
/\b(?:not complete|incomplete)\b/i,
|
|
27
|
+
/\b(?:not|un)(?:\s|-)?(?:validated|verified|tested)\b/i,
|
|
28
|
+
/^\s*Tests\s*:\s*(?:not run|not executed|not available|failed|blocked|skipped)\b/im,
|
|
29
|
+
/^\s*Known gaps?\s*:\s*(?!\s*(?:none|no\b|n\/a|not applicable)\b).+/im,
|
|
30
|
+
/\bremaining(?:\s+\w+){0,3}\s+(?:work|issue|issues|gap|gaps|blocker|blockers)\b/i
|
|
31
|
+
];
|
|
32
|
+
function assessFinishContract(input) {
|
|
33
|
+
const assistantText = input.assistantText.trim();
|
|
34
|
+
const sessionEntries = input.sessionEntries ?? [];
|
|
35
|
+
const assistantTurnId = input.assistantTurnId ?? null;
|
|
36
|
+
const window = recentEntries(sessionEntries, assistantTurnId, input.recentEntryLimit ?? DEFAULT_RECENT_ENTRY_LIMIT);
|
|
37
|
+
const mutatedPaths = mutatingReceipts(window);
|
|
38
|
+
if (mutatedPaths.length === 0) {
|
|
39
|
+
return { kind: "ok", reason: "no_mutation", evidence: [], mutatedPaths };
|
|
40
|
+
}
|
|
41
|
+
const evidence = collectValidationEvidence(window);
|
|
42
|
+
if (evidence.length > 0) {
|
|
43
|
+
return { kind: "ok", reason: "validation_evidence", evidence, mutatedPaths };
|
|
44
|
+
}
|
|
45
|
+
if (hasExplicitLimitation(assistantText)) {
|
|
46
|
+
return { kind: "ok", reason: "explicit_limitation", evidence: [], mutatedPaths };
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
kind: "engage",
|
|
50
|
+
reason: "unvalidated_mutation",
|
|
51
|
+
message: FINISH_CONTRACT_ADVISORY_MESSAGE,
|
|
52
|
+
evidence: [],
|
|
53
|
+
mutatedPaths
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function hasExplicitLimitation(text) {
|
|
57
|
+
const normalized = text.trim();
|
|
58
|
+
if (normalized.length === 0) return false;
|
|
59
|
+
return LIMITATION_PATTERNS.some((pattern) => pattern.test(normalized));
|
|
60
|
+
}
|
|
61
|
+
function mutatingReceipts(recent) {
|
|
62
|
+
const mutationCalls = /* @__PURE__ */ new Map();
|
|
63
|
+
const paths = [];
|
|
64
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65
|
+
for (const entry of recent) {
|
|
66
|
+
const bashMutation = bashExecutionMutationPaths(entry);
|
|
67
|
+
if (bashMutation !== null) {
|
|
68
|
+
for (const path of bashMutation) pushPath(paths, seen, path);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const call = mutatingToolCall(entry);
|
|
72
|
+
if (call !== null) {
|
|
73
|
+
mutationCalls.set(call.toolCallId, call);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const resultId = successfulToolResultId(entry);
|
|
77
|
+
if (resultId !== null) {
|
|
78
|
+
const candidate = mutationCalls.get(resultId);
|
|
79
|
+
if (candidate !== void 0) {
|
|
80
|
+
for (const path of candidate.paths) pushPath(paths, seen, path);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return paths;
|
|
85
|
+
}
|
|
86
|
+
function mutationPathsForTool(toolName, args) {
|
|
87
|
+
if (toolName === ToolNames.Bash) {
|
|
88
|
+
const command = typeof args?.command === "string" ? args.command : null;
|
|
89
|
+
if (command === null) return [];
|
|
90
|
+
return [...extractCommandWriteTargets(command), ...extractCommandDeleteTargets(command)];
|
|
91
|
+
}
|
|
92
|
+
return toolMutationPaths(toolName, args);
|
|
93
|
+
}
|
|
94
|
+
function mutatingToolCall(entry) {
|
|
95
|
+
const record = asRecord(entry);
|
|
96
|
+
if (record?.kind !== "message" || record.role !== "tool_call") return null;
|
|
97
|
+
const payload = asRecord(record.payload);
|
|
98
|
+
if (payload === null) return null;
|
|
99
|
+
const toolName = stringFromFirst(payload, ["name", "toolName", "tool"]);
|
|
100
|
+
if (toolName === null) return null;
|
|
101
|
+
const args = asRecord(payload.args ?? payload.arguments ?? payload.input) ?? void 0;
|
|
102
|
+
const paths = mutationPathsForTool(toolName, args);
|
|
103
|
+
if (paths.length === 0) return null;
|
|
104
|
+
const toolCallId = stringFromFirst(payload, ["toolCallId", "tool_call_id", "id"]) ?? turnIdOf(entry);
|
|
105
|
+
if (toolCallId === null) return null;
|
|
106
|
+
return { toolCallId, paths };
|
|
107
|
+
}
|
|
108
|
+
function bashExecutionMutationPaths(entry) {
|
|
109
|
+
const record = asRecord(entry);
|
|
110
|
+
if (record?.kind !== "bashExecution") return null;
|
|
111
|
+
if (typeof record.command !== "string") return null;
|
|
112
|
+
if (record.cancelled === true || record.exitCode !== 0) return null;
|
|
113
|
+
return [...extractCommandWriteTargets(record.command), ...extractCommandDeleteTargets(record.command)];
|
|
114
|
+
}
|
|
115
|
+
function pushPath(paths, seen, path) {
|
|
116
|
+
if (path.length === 0 || seen.has(path)) return;
|
|
117
|
+
seen.add(path);
|
|
118
|
+
paths.push(path);
|
|
119
|
+
}
|
|
120
|
+
function collectValidationEvidence(recent) {
|
|
121
|
+
const evidence = [];
|
|
122
|
+
const toolCalls = /* @__PURE__ */ new Map();
|
|
123
|
+
const dispatchCalls = /* @__PURE__ */ new Map();
|
|
124
|
+
const seen = /* @__PURE__ */ new Set();
|
|
125
|
+
for (const entry of recent) {
|
|
126
|
+
const protectedArtifact = protectedArtifactEvidence(entry);
|
|
127
|
+
if (protectedArtifact !== null) {
|
|
128
|
+
pushEvidence(evidence, seen, protectedArtifact);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const call = bashValidationCall(entry);
|
|
132
|
+
if (call !== null) {
|
|
133
|
+
toolCalls.set(call.toolCallId, call);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const typedValidationCall = validationToolCall(entry);
|
|
137
|
+
if (typedValidationCall !== null) {
|
|
138
|
+
toolCalls.set(typedValidationCall.toolCallId, typedValidationCall);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const dispatchCall = dispatchEvidenceCall(entry);
|
|
142
|
+
if (dispatchCall !== null) {
|
|
143
|
+
dispatchCalls.set(dispatchCall.toolCallId, dispatchCall);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const resultId = successfulToolResultId(entry);
|
|
147
|
+
if (resultId !== null) {
|
|
148
|
+
const dispatchCandidate = dispatchCalls.get(resultId);
|
|
149
|
+
const dispatchReceipt = dispatchReceiptEvidence(entry, dispatchCandidate);
|
|
150
|
+
if (dispatchReceipt !== null) {
|
|
151
|
+
pushEvidence(evidence, seen, dispatchReceipt);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const candidate = toolCalls.get(resultId);
|
|
155
|
+
if (candidate !== void 0) {
|
|
156
|
+
pushEvidence(evidence, seen, validationEvidence(candidate));
|
|
157
|
+
}
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const bashExecution = bashExecutionEvidence(entry);
|
|
161
|
+
if (bashExecution !== null) pushEvidence(evidence, seen, bashExecution);
|
|
162
|
+
}
|
|
163
|
+
return evidence;
|
|
164
|
+
}
|
|
165
|
+
function recentEntries(entries, assistantTurnId, recentEntryLimit) {
|
|
166
|
+
const boundedLimit = Number.isFinite(recentEntryLimit) && recentEntryLimit > 0 ? Math.floor(recentEntryLimit) : DEFAULT_RECENT_ENTRY_LIMIT;
|
|
167
|
+
const assistantIndex = assistantTurnId === null ? -1 : entries.findIndex((entry) => turnIdOf(entry) === assistantTurnId);
|
|
168
|
+
const endExclusive = assistantIndex >= 0 ? assistantIndex : entries.length;
|
|
169
|
+
let startInclusive = Math.max(0, endExclusive - boundedLimit);
|
|
170
|
+
for (let index = endExclusive - 1; index >= startInclusive; index -= 1) {
|
|
171
|
+
if (isUserMessageEntry(entries[index])) {
|
|
172
|
+
startInclusive = index + 1;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return entries.slice(startInclusive, endExclusive);
|
|
177
|
+
}
|
|
178
|
+
function bashValidationCall(entry) {
|
|
179
|
+
const record = asRecord(entry);
|
|
180
|
+
if (record?.kind !== "message" || record.role !== "tool_call") return null;
|
|
181
|
+
const payload = asRecord(record.payload);
|
|
182
|
+
if (payload === null) return null;
|
|
183
|
+
const toolName = stringFromFirst(payload, ["name", "toolName", "tool"]);
|
|
184
|
+
if (toolName !== "bash") return null;
|
|
185
|
+
const args = asRecord(payload.args ?? payload.arguments ?? payload.input);
|
|
186
|
+
const command = typeof args?.command === "string" ? args.command : null;
|
|
187
|
+
if (command === null) return null;
|
|
188
|
+
const detected = detectValidationCommand(command);
|
|
189
|
+
if (detected.kind !== "validation") return null;
|
|
190
|
+
const toolCallId = stringFromFirst(payload, ["toolCallId", "tool_call_id", "id"]) ?? turnIdOf(entry);
|
|
191
|
+
if (toolCallId === null) return null;
|
|
192
|
+
const candidate = {
|
|
193
|
+
toolCallId,
|
|
194
|
+
command: detected.matched
|
|
195
|
+
};
|
|
196
|
+
const turnId = turnIdOf(entry);
|
|
197
|
+
if (turnId !== null) candidate.turnId = turnId;
|
|
198
|
+
return candidate;
|
|
199
|
+
}
|
|
200
|
+
function dispatchEvidenceCall(entry) {
|
|
201
|
+
const record = asRecord(entry);
|
|
202
|
+
if (record?.kind !== "message" || record.role !== "tool_call") return null;
|
|
203
|
+
const payload = asRecord(record.payload);
|
|
204
|
+
if (payload === null) return null;
|
|
205
|
+
const toolName = stringFromFirst(payload, ["name", "toolName", "tool"]);
|
|
206
|
+
if (toolName !== "dispatch") return null;
|
|
207
|
+
const args = asRecord(payload.args ?? payload.arguments ?? payload.input);
|
|
208
|
+
const { agentId, task } = dispatchCallDescriptor(args);
|
|
209
|
+
const toolCallId = stringFromFirst(payload, ["toolCallId", "tool_call_id", "id"]) ?? turnIdOf(entry);
|
|
210
|
+
if (toolCallId === null) return null;
|
|
211
|
+
const candidate = {
|
|
212
|
+
toolCallId,
|
|
213
|
+
command: `agent=${agentId}${task.length > 0 ? ` task=${task}` : ""}`
|
|
214
|
+
};
|
|
215
|
+
const turnId = turnIdOf(entry);
|
|
216
|
+
if (turnId !== null) candidate.turnId = turnId;
|
|
217
|
+
return candidate;
|
|
218
|
+
}
|
|
219
|
+
function dispatchCallDescriptor(args) {
|
|
220
|
+
const defaultAgent = stringFromFirst(args ?? {}, ["agent", "agent_id", "agentId"]);
|
|
221
|
+
const tasks = Array.isArray(args?.tasks) ? args.tasks : null;
|
|
222
|
+
if (tasks !== null && tasks.length > 0) {
|
|
223
|
+
const first = tasks[0];
|
|
224
|
+
if (typeof first === "string") {
|
|
225
|
+
return { agentId: defaultAgent ?? "coder", task: first.trim() };
|
|
226
|
+
}
|
|
227
|
+
const firstRecord = asRecord(first);
|
|
228
|
+
const itemAgent = firstRecord === null ? null : stringFromFirst(firstRecord, ["agent", "agent_id", "agentId"]);
|
|
229
|
+
const itemTask = typeof firstRecord?.task === "string" ? firstRecord.task.trim() : "";
|
|
230
|
+
return { agentId: itemAgent ?? defaultAgent ?? "coder", task: itemTask };
|
|
231
|
+
}
|
|
232
|
+
const singleTask = typeof args?.task === "string" ? args.task.trim() : "";
|
|
233
|
+
return { agentId: defaultAgent ?? "coder", task: singleTask };
|
|
234
|
+
}
|
|
235
|
+
function validationToolCall(entry) {
|
|
236
|
+
const record = asRecord(entry);
|
|
237
|
+
if (record?.kind !== "message" || record.role !== "tool_call") return null;
|
|
238
|
+
const payload = asRecord(record.payload);
|
|
239
|
+
if (payload === null) return null;
|
|
240
|
+
const toolName = stringFromFirst(payload, ["name", "toolName", "tool"]);
|
|
241
|
+
if (toolName === null) return null;
|
|
242
|
+
const summary = typedValidationSummary(toolName, payload);
|
|
243
|
+
if (summary === null) return null;
|
|
244
|
+
const toolCallId = stringFromFirst(payload, ["toolCallId", "tool_call_id", "id"]) ?? turnIdOf(entry);
|
|
245
|
+
if (toolCallId === null) return null;
|
|
246
|
+
const candidate = {
|
|
247
|
+
toolCallId,
|
|
248
|
+
command: summary
|
|
249
|
+
};
|
|
250
|
+
const turnId = turnIdOf(entry);
|
|
251
|
+
if (turnId !== null) candidate.turnId = turnId;
|
|
252
|
+
return candidate;
|
|
253
|
+
}
|
|
254
|
+
function typedValidationSummary(toolName, payload) {
|
|
255
|
+
const args = asRecord(payload.args ?? payload.arguments ?? payload.input);
|
|
256
|
+
if (toolName === "verify") {
|
|
257
|
+
const check = typeof args?.check === "string" ? args.check.trim() : "";
|
|
258
|
+
if (check === "frontend") {
|
|
259
|
+
const path = typeof args?.path === "string" && args.path.trim().length > 0 ? args.path.trim() : "artifact";
|
|
260
|
+
return `verify frontend ${path}`;
|
|
261
|
+
}
|
|
262
|
+
if (isVerificationScriptName(check)) return `npm run ${check}`;
|
|
263
|
+
if (isProjectVerifierCheckId(check)) return `verify ${check}`;
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
function successfulToolResultId(entry) {
|
|
269
|
+
const record = asRecord(entry);
|
|
270
|
+
if (record?.kind !== "message" || record.role !== "tool_result") return null;
|
|
271
|
+
const payload = asRecord(record.payload);
|
|
272
|
+
if (payload === null) return null;
|
|
273
|
+
if (payload.isError === true || payload.error === true) return null;
|
|
274
|
+
const result = asRecord(payload.result);
|
|
275
|
+
const details = asRecord(result?.details);
|
|
276
|
+
if (details?.kind === "error") return null;
|
|
277
|
+
return stringFromFirst(payload, ["toolCallId", "tool_call_id", "id"]);
|
|
278
|
+
}
|
|
279
|
+
function dispatchReceiptEvidence(entry, candidate) {
|
|
280
|
+
const record = asRecord(entry);
|
|
281
|
+
if (record?.kind !== "message" || record.role !== "tool_result") return null;
|
|
282
|
+
const payload = asRecord(record.payload);
|
|
283
|
+
if (payload === null) return null;
|
|
284
|
+
const toolName = stringFromFirst(payload, ["toolName", "name", "tool"]);
|
|
285
|
+
if (toolName !== null && toolName !== "dispatch") return null;
|
|
286
|
+
const result = asRecord(payload.result);
|
|
287
|
+
const details = asRecord(result?.details);
|
|
288
|
+
if (details === null) return null;
|
|
289
|
+
const summary = passedDispatchReceiptSummary(details, candidate);
|
|
290
|
+
if (summary === null) return null;
|
|
291
|
+
const evidence = {
|
|
292
|
+
kind: "dispatch_receipt",
|
|
293
|
+
summary
|
|
294
|
+
};
|
|
295
|
+
const turnId = candidate?.turnId ?? turnIdOf(entry);
|
|
296
|
+
if (turnId !== null && turnId !== void 0) evidence.turnId = turnId;
|
|
297
|
+
return evidence;
|
|
298
|
+
}
|
|
299
|
+
function passedDispatchReceiptSummary(details, candidate) {
|
|
300
|
+
if (Array.isArray(details.runs)) {
|
|
301
|
+
const runs = details.runs.map(asRecord);
|
|
302
|
+
if (runs.length === 0 || runs.some((run) => run === null || run.exitCode !== 0)) return null;
|
|
303
|
+
if (typeof details.failedCount === "number" && details.failedCount !== 0) return null;
|
|
304
|
+
const first = runs[0];
|
|
305
|
+
const runId = typeof first?.runId === "string" && first.runId.length > 0 ? first.runId : "unknown";
|
|
306
|
+
const agentId = dispatchReceiptAgentId(typeof first?.agentId === "string" ? first.agentId : void 0, candidate);
|
|
307
|
+
const extra = runs.length > 1 ? ` (+${runs.length - 1} more)` : "";
|
|
308
|
+
return `dispatch receipt passed: run ${runId} agent ${agentId}${extra}`;
|
|
309
|
+
}
|
|
310
|
+
if (details.exitCode === 0) {
|
|
311
|
+
const runId = typeof details.runId === "string" && details.runId.length > 0 ? details.runId : "unknown";
|
|
312
|
+
const agentId = dispatchReceiptAgentId(typeof details.agentId === "string" ? details.agentId : void 0, candidate);
|
|
313
|
+
return `dispatch receipt passed: run ${runId} agent ${agentId}`;
|
|
314
|
+
}
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
function dispatchReceiptAgentId(receiptAgentId, candidate) {
|
|
318
|
+
if (receiptAgentId !== void 0 && receiptAgentId.length > 0) return receiptAgentId;
|
|
319
|
+
return candidate?.command.match(/^agent=([^\s]+)/)?.[1] ?? "unknown";
|
|
320
|
+
}
|
|
321
|
+
function bashExecutionEvidence(entry) {
|
|
322
|
+
const record = asRecord(entry);
|
|
323
|
+
if (record?.kind !== "bashExecution") return null;
|
|
324
|
+
if (typeof record.command !== "string") return null;
|
|
325
|
+
if (record.cancelled === true) return null;
|
|
326
|
+
if (record.exitCode !== 0) return null;
|
|
327
|
+
const detected = detectValidationCommand(record.command);
|
|
328
|
+
if (detected.kind !== "validation") return null;
|
|
329
|
+
const evidence = {
|
|
330
|
+
kind: "validation_command",
|
|
331
|
+
summary: `validation command passed: ${detected.matched}`
|
|
332
|
+
};
|
|
333
|
+
const turnId = turnIdOf(entry);
|
|
334
|
+
if (turnId !== null) evidence.turnId = turnId;
|
|
335
|
+
return evidence;
|
|
336
|
+
}
|
|
337
|
+
function protectedArtifactEvidence(entry) {
|
|
338
|
+
const record = asRecord(entry);
|
|
339
|
+
if (record?.kind !== "protectedArtifact" || record.action !== "protect") return null;
|
|
340
|
+
const artifact = asRecord(record.artifact);
|
|
341
|
+
const path = typeof artifact?.path === "string" && artifact.path.trim().length > 0 ? artifact.path.trim() : null;
|
|
342
|
+
if (path === null) return null;
|
|
343
|
+
const evidence = {
|
|
344
|
+
kind: "protected_artifact",
|
|
345
|
+
summary: `protected artifact recorded: ${path}`
|
|
346
|
+
};
|
|
347
|
+
const turnId = turnIdOf(entry);
|
|
348
|
+
if (turnId !== null) evidence.turnId = turnId;
|
|
349
|
+
return evidence;
|
|
350
|
+
}
|
|
351
|
+
function validationEvidence(candidate) {
|
|
352
|
+
const evidence = {
|
|
353
|
+
kind: "validation_command",
|
|
354
|
+
summary: `validation command passed: ${candidate.command}`
|
|
355
|
+
};
|
|
356
|
+
if (candidate.turnId !== void 0) evidence.turnId = candidate.turnId;
|
|
357
|
+
return evidence;
|
|
358
|
+
}
|
|
359
|
+
function pushEvidence(evidence, seen, item) {
|
|
360
|
+
const key = `${item.kind}\0${item.summary}\0${item.turnId ?? ""}`;
|
|
361
|
+
if (seen.has(key)) return;
|
|
362
|
+
seen.add(key);
|
|
363
|
+
evidence.push(item);
|
|
364
|
+
}
|
|
365
|
+
function isUserMessageEntry(entry) {
|
|
366
|
+
const record = asRecord(entry);
|
|
367
|
+
if (record?.kind !== "message" || record.role !== "user") return false;
|
|
368
|
+
const payload = asRecord(record.payload);
|
|
369
|
+
return payload?.synthetic !== true;
|
|
370
|
+
}
|
|
371
|
+
function turnIdOf(entry) {
|
|
372
|
+
const record = asRecord(entry);
|
|
373
|
+
return typeof record?.turnId === "string" ? record.turnId : null;
|
|
374
|
+
}
|
|
375
|
+
function stringFromFirst(record, keys) {
|
|
376
|
+
for (const key of keys) {
|
|
377
|
+
const value = record[key];
|
|
378
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
379
|
+
}
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
function asRecord(value) {
|
|
383
|
+
return value !== null && typeof value === "object" ? value : null;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export {
|
|
387
|
+
DEFAULT_RECENT_ENTRY_LIMIT,
|
|
388
|
+
assessFinishContract,
|
|
389
|
+
typedValidationSummary
|
|
390
|
+
};
|
|
391
|
+
//# sourceMappingURL=chunk-7C6RYZGQ.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
7
7
|
resolveSafeCwd
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-B5CSFE7B.js";
|
|
9
9
|
import {
|
|
10
10
|
require_dist
|
|
11
11
|
} from "./chunk-APJ265NV.js";
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
parseProjectVerifierCatalogText,
|
|
311
311
|
packageDeclaredCheck
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-A2NJGIB3.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
readRootEntries,
|
|
4
4
|
splitYamlFrontmatter,
|
|
5
5
|
stringField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AMKHQW3C.js";
|
|
7
7
|
import {
|
|
8
8
|
enabledExtensionResourceRoots
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5QKCQQ3E.js";
|
|
10
10
|
import {
|
|
11
11
|
ToolNames
|
|
12
12
|
} from "./chunk-CGKSTWHD.js";
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
INTEROP_AGENT_KINDS,
|
|
15
15
|
interopSourceRank
|
|
16
16
|
} from "./chunk-IHXBNWMM.js";
|
|
17
|
+
import {
|
|
18
|
+
resolvePackageRoot
|
|
19
|
+
} from "./chunk-IWHMRKLL.js";
|
|
17
20
|
import {
|
|
18
21
|
clioConfigDir
|
|
19
22
|
} from "./chunk-BNAZZHFG.js";
|
|
20
23
|
import {
|
|
21
24
|
fsyncDirectory
|
|
22
25
|
} from "./chunk-WEPFGWHJ.js";
|
|
23
|
-
import {
|
|
24
|
-
resolvePackageRoot
|
|
25
|
-
} from "./chunk-IWHMRKLL.js";
|
|
26
26
|
import {
|
|
27
27
|
init_esm_shims
|
|
28
28
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -1195,4 +1195,4 @@ export {
|
|
|
1195
1195
|
expandSkillInvocationInput,
|
|
1196
1196
|
parsePendingSkillRequests
|
|
1197
1197
|
};
|
|
1198
|
-
//# sourceMappingURL=chunk-
|
|
1198
|
+
//# sourceMappingURL=chunk-AD7Y7STJ.js.map
|