@iowarp/clio-coder 0.3.6 → 0.3.8
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 +59 -0
- package/README.md +22 -6
- package/dist/{acp-2BEHC4DL.js → acp-U67UHUK2.js} +14 -14
- package/dist/{agents-LNNFTM53.js → agents-YU6SGALZ.js} +42 -35
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-KXXFI2VS.js → auth-5ZPJOIVG.js} +32 -24
- package/dist/builtins-C6JMZVV6.js +17 -0
- package/dist/{chunk-E25LMLRW.js → chunk-26LEYJZH.js} +2 -2
- package/dist/{chunk-TSHXZTOQ.js → chunk-2HEJ2F35.js} +5 -5
- package/dist/{chunk-PBTHKCPN.js → chunk-2HFZQUHL.js} +7 -7
- package/dist/{chunk-FO5ZOVUY.js → chunk-3BINW3FP.js} +5 -5
- package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
- package/dist/{chunk-CKXWIANG.js → chunk-4SPRNWDE.js} +18 -16
- package/dist/{chunk-E2ER4LJF.js → chunk-5C3AQNDW.js} +25 -1
- package/dist/{chunk-XF5N4U5A.js → chunk-5DHKRSMQ.js} +9 -8
- package/dist/{chunk-43AOLP7E.js → chunk-5FR74PWO.js} +2 -1
- package/dist/{chunk-EKY57CSP.js → chunk-5H3GB5BO.js} +68 -772
- package/dist/{chunk-6XXKFVSN.js → chunk-5Q2VVUKB.js} +4 -4
- package/dist/{chunk-DJVECN66.js → chunk-7RFXX52T.js} +295 -3705
- package/dist/{chunk-ZXF4XRKW.js → chunk-7RGZWPB6.js} +158 -8
- package/dist/{chunk-FYYLNIL5.js → chunk-A2NJGIB3.js} +2 -2
- package/dist/{chunk-XXQNGV4M.js → chunk-A3WNZD3P.js} +548 -72
- package/dist/{chunk-VEZEGCGW.js → chunk-B5CSFE7B.js} +23 -21
- package/dist/{chunk-2SFS6XQE.js → chunk-DGSYXYMX.js} +3 -2
- package/dist/chunk-DR52UMZW.js +21 -0
- package/dist/{chunk-ZWLZP4ZT.js → chunk-DYIM5TJT.js} +98 -12
- package/dist/{chunk-QKMUKYO7.js → chunk-E77JEWSD.js} +270 -125
- package/dist/{chunk-LYF7OHWH.js → chunk-EMYUUSFG.js} +12 -467
- package/dist/{chunk-4VP4KH3K.js → chunk-EQ63NRB7.js} +8 -8
- package/dist/chunk-FBVTI2TJ.js +518 -0
- package/dist/{chunk-R46L2BIR.js → chunk-FHJEP5SW.js} +19 -25
- package/dist/{chunk-WR67VIZY.js → chunk-GN57SG4G.js} +66 -8
- package/dist/{chunk-RD5U66HV.js → chunk-GPIEI3LY.js} +9 -9
- package/dist/{chunk-PCZJO5TI.js → chunk-GU2UIAFZ.js} +13 -178
- package/dist/chunk-GWS3VEIW.js +195 -0
- package/dist/chunk-H7IXIC72.js +103 -0
- package/dist/{chunk-3BPUFZDL.js → chunk-HLE42MG7.js} +3 -3
- package/dist/{chunk-24I7BN55.js → chunk-IFBNV6H6.js} +3 -3
- package/dist/{chunk-QNQHSOLF.js → chunk-IGWKHNIQ.js} +114 -55
- package/dist/chunk-IIZWH4XA.js +172 -0
- package/dist/{chunk-AD2SYQYC.js → chunk-IJ7RPIYJ.js} +124 -6
- package/dist/chunk-J3YUBZWY.js +382 -0
- package/dist/{chunk-5JGRAMKL.js → chunk-JOZYP4GM.js} +8 -6
- package/dist/{chunk-OH3TOQTB.js → chunk-K4XHGFR5.js} +751 -15
- package/dist/{chunk-EYPA3EGJ.js → chunk-KTYTFRMB.js} +178 -14
- package/dist/chunk-LU7P4LHA.js +33 -0
- package/dist/chunk-ME6CCNFO.js +108 -0
- package/dist/chunk-MXKJU4JB.js +1100 -0
- package/dist/{chunk-RY3LY4J5.js → chunk-N22QMJKY.js} +21 -18
- package/dist/chunk-NMPKI6XL.js +3006 -0
- package/dist/chunk-NUGM5KR6.js +165 -0
- package/dist/{chunk-22NAGB7X.js → chunk-P43ETTHK.js} +5 -94
- package/dist/{chunk-NILBFAPG.js → chunk-PMDBGQSJ.js} +2 -2
- package/dist/chunk-PT7HYKEM.js +165 -0
- package/dist/chunk-RVG5JXAL.js +41 -0
- package/dist/{chunk-GEYXPTRF.js → chunk-RWSI4YD7.js} +2 -2
- package/dist/{chunk-4BPJXDWC.js → chunk-TANS5ZJS.js} +35 -19
- package/dist/{verifiers-NCBTHHN2.js → chunk-TB5666IT.js} +67 -324
- package/dist/{chunk-QM3F2GKX.js → chunk-TLQJPP24.js} +7927 -8088
- package/dist/{chunk-G7MUEIGA.js → chunk-TT36MB5S.js} +2 -1
- package/dist/chunk-TTHACPOM.js +961 -0
- package/dist/{chunk-6US73PDB.js → chunk-TYPGUK6W.js} +7 -7
- package/dist/{chunk-MFFY33HR.js → chunk-U6MBIEMB.js} +554 -209
- package/dist/chunk-VAWNZU7Z.js +242 -0
- package/dist/{chunk-IR4CFBFN.js → chunk-VCBR6CU7.js} +12 -12
- package/dist/{chunk-WHJYKASB.js → chunk-VHN4MY6O.js} +2 -2
- package/dist/{chunk-XYDYPRZI.js → chunk-VWZOAB7K.js} +10 -10
- package/dist/{chunk-ZRGEBJ4T.js → chunk-WLFILSD5.js} +48 -48
- package/dist/{chunk-K7T3E2SR.js → chunk-WNIJTQQK.js} +12 -11
- package/dist/{chunk-CYQKWTG3.js → chunk-WSB3FPX7.js} +68 -20
- package/dist/{chunk-KHSFENX2.js → chunk-WWCZ5F23.js} +116 -14
- package/dist/{chunk-XE2VEJHX.js → chunk-WXY7KU3G.js} +2 -2
- package/dist/{chunk-PPAMZ32Z.js → chunk-XK56QHLX.js} +6 -1
- package/dist/{chunk-KOHPCX4K.js → chunk-XWSF374K.js} +5 -5
- package/dist/{chunk-CJUB2JJ2.js → chunk-YS5VLNH5.js} +10 -10
- package/dist/{chunk-ZZMN5OM4.js → chunk-ZNLWCMVZ.js} +2 -2
- package/dist/{chunk-WHGPSPT5.js → chunk-ZVJ5BLO2.js} +2 -2
- package/dist/cli/index.js +33 -31
- package/dist/{clio-M2KGYUFZ.js → clio-QVTYJ57A.js} +10 -10
- package/dist/{code-nav-GQNL7XA6.js → code-nav-FGGFIE7L.js} +5 -5
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-5TTYYX6G.js → components-ZFA3SAER.js} +9 -9
- package/dist/{config-XUUYQIWO.js → config-LW5IJFQN.js} +65 -55
- package/dist/{configure-IHJ7YOMV.js → configure-7XIZCOU4.js} +29 -24
- package/dist/{context-75MIWW3U.js → context-L3WL3X7K.js} +54 -43
- package/dist/{context-ZQ7SIFJV.js → context-N52ZA626.js} +30 -14
- package/dist/{context-74JLXAWD.js → context-Y6Y7QPR6.js} +12 -12
- package/dist/{context-clear-GYKWNUML.js → context-clear-MBQRLSDQ.js} +54 -43
- package/dist/{context-index-SSR5ECNE.js → context-index-HVMFQHK3.js} +5 -5
- package/dist/{context-working-set-UX5KEP4J.js → context-working-set-GS6DSO7F.js} +18 -18
- package/dist/{dispatch-runner-GIJBHNFL.js → dispatch-runner-22ZCNOM3.js} +367 -79
- package/dist/{docs-6FZSCG5B.js → docs-7LQ23DLM.js} +9 -9
- package/dist/{doctor-SVJ5BZCW.js → doctor-M7YEDGAE.js} +27 -23
- package/dist/{eval-CG6LLBLD.js → eval-BEC2WHDA.js} +73 -20
- package/dist/{evidence-ZYFIEN42.js → evidence-REJUMSKM.js} +70 -59
- package/dist/{evolve-QGEXEMDW.js → evolve-PY5ZBA5K.js} +50 -39
- package/dist/{extensions-ADGNCJJD.js → extensions-HVKU65YU.js} +7 -7
- package/dist/{fleet-S5R4ZOQY.js → fleet-7WZEWRFA.js} +236 -377
- package/dist/fleet-commands-UVHWM76J.js +70 -0
- package/dist/fleet-graph-6ULH7PES.js +125 -0
- package/dist/fleet-new-RDVJLHHH.js +48 -0
- package/dist/{fleet-preflight-BHSNPBMH.js → fleet-preflight-J53T6CCE.js} +5 -5
- package/dist/fleet-validate-72PC4SLA.js +79 -0
- package/dist/{init-5DRU55YR.js → init-OG3TPGQG.js} +69 -57
- package/dist/library-CNTMPLRF.js +217 -0
- package/dist/{memory-7YKKR6UC.js → memory-6IS7F275.js} +52 -41
- package/dist/{models-ZPOLRU2C.js → models-ENRJDA5W.js} +37 -31
- package/dist/{monitor-US5F5YGZ.js → monitor-XLDVO7TN.js} +79 -42
- package/dist/{orchestrator-E2AL4T5N.js → orchestrator-6KSPYRHA.js} +4126 -762
- package/dist/{paths-E7KYAQWE.js → paths-DBXMZMDU.js} +6 -6
- package/dist/registry-LG64LTF4.js +11 -0
- package/dist/{reset-KZ652EK6.js → reset-RZ4ER727.js} +12 -12
- package/dist/{run-SRNBKDWD.js → run-Y2CNK5RU.js} +89 -76
- package/dist/{share-CGZE33UP.js → share-A55GYP6Z.js} +37 -13
- package/dist/{skills-S2X4DLY5.js → skills-ALC5J6AT.js} +29 -13
- package/dist/{skills-eval-W2GGIC4R.js → skills-eval-JPBEBYQU.js} +60 -48
- package/dist/support-MIETYA5E.js +38 -0
- package/dist/{targets-54SWINWB.js → targets-VGNXIR3S.js} +46 -36
- package/dist/{terminal-lease-SAIF2OGY.js → terminal-lease-WOBR64YA.js} +4 -4
- package/dist/{uninstall-BVLWXKBT.js → uninstall-ZJF5H5ZN.js} +9 -9
- package/dist/{upgrade-JKAR27XC.js → upgrade-FUSUAGHR.js} +31 -28
- package/dist/{usage-MSAWCLX4.js → usage-N4MKVHKD.js} +140 -68
- package/dist/verifiers-YAWOJ3H2.js +336 -0
- package/dist/{verify-X5HDROLA.js → verify-LTDHYBGY.js} +10 -9
- package/dist/{wiki-generate-GUSOQ6ZP.js → wiki-generate-6M7GHTBJ.js} +75 -62
- package/dist/worker/entry.js +67 -57
- 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 +11 -6
- package/docs/built-in-agents.md +26 -2
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +83 -3
- package/docs/configuration-and-targets.md +86 -4
- 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 +74 -10
- 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 +228 -16
- package/docs/git-commit-provenance.md +2 -2
- package/docs/glossary.md +22 -2
- 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 +56 -9
- package/docs/proactive-memory.md +1 -1
- package/docs/prompt-envelope-and-tools.md +4 -2
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +83 -65
- 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 -2
- package/src/cli/argv.ts +5 -0
- package/src/cli/configure.ts +107 -23
- package/src/cli/doctor.ts +5 -1
- package/src/cli/evidence.ts +30 -25
- 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 +111 -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/shared.ts +1 -0
- package/src/cli/targets.ts +4 -1
- package/src/cli/usage.ts +111 -19
- package/src/cli/validate-model.ts +60 -5
- package/src/core/bus-events.ts +29 -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/core/path-boundary.ts +100 -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/extension.ts +2 -11
- package/src/domains/agents/fleet-contract.ts +304 -24
- package/src/domains/agents/index.ts +14 -0
- package/src/domains/agents/recipe.ts +7 -1
- package/src/domains/agents/registry.ts +73 -5
- package/src/domains/agents/result-contract.ts +360 -15
- package/src/domains/agents/write-boundary.ts +15 -50
- package/src/domains/config/classify.ts +4 -0
- package/src/domains/context/project-rules.ts +51 -1
- package/src/domains/dispatch/active-route-planner.ts +14 -0
- package/src/domains/dispatch/assignment-reconcile.ts +22 -5
- package/src/domains/dispatch/assignment-store.ts +151 -14
- 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 +48 -0
- package/src/domains/dispatch/delegation-plan.ts +164 -0
- package/src/domains/dispatch/execution-plan.ts +76 -5
- package/src/domains/dispatch/execution-role.ts +12 -2
- package/src/domains/dispatch/execution-scheduler.ts +183 -67
- package/src/domains/dispatch/extension.ts +412 -74
- 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 +791 -0
- package/src/domains/dispatch/gate-role-prompts.ts +47 -0
- package/src/domains/dispatch/host-verification.ts +178 -0
- package/src/domains/dispatch/index.ts +41 -1
- package/src/domains/dispatch/intent-requirements.ts +40 -0
- package/src/domains/dispatch/intent.ts +235 -0
- package/src/domains/dispatch/path-scope.ts +370 -0
- package/src/domains/dispatch/receipt-integrity.ts +9 -4
- package/src/domains/dispatch/state.ts +36 -3
- package/src/domains/dispatch/types.ts +64 -12
- package/src/domains/dispatch/validation.ts +69 -6
- package/src/domains/dispatch/write-boundary-enforcer.ts +45 -0
- package/src/domains/dispatch/write-boundary.ts +201 -22
- package/src/domains/eval/metrics/evidence.ts +79 -2
- package/src/domains/eval/runners/clio-run.ts +12 -2
- package/src/domains/evidence/build.ts +69 -11
- package/src/domains/evidence/index.ts +21 -0
- package/src/domains/evidence/provenance.ts +46 -11
- package/src/domains/evidence/trust-projection.ts +274 -0
- package/src/domains/evidence/trust-status.ts +155 -18
- package/src/domains/evidence/types.ts +4 -0
- package/src/domains/extensions/discovery.ts +88 -1
- package/src/domains/extensions/resources.ts +20 -8
- package/src/domains/extensions/state.ts +6 -2
- package/src/domains/extensions/types.ts +4 -1
- package/src/domains/lifecycle/doctor.ts +140 -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/prompts/contract.ts +3 -5
- package/src/domains/providers/extension.ts +30 -2
- package/src/domains/resources/common-loader.ts +3 -0
- package/src/domains/resources/index.ts +20 -0
- package/src/domains/resources/library.ts +326 -0
- package/src/domains/resources/prompts/loader.ts +119 -14
- package/src/domains/resources/skills/marketplace.ts +37 -12
- package/src/domains/safety/policy-engine.ts +5 -5
- package/src/domains/safety/run-effects.ts +64 -1
- package/src/domains/safety/scope.ts +7 -12
- package/src/domains/session/handoff.ts +629 -0
- package/src/domains/share/archive.ts +67 -2
- package/src/engine/acp/server.ts +4 -1
- package/src/engine/prompt-templates.ts +18 -1
- package/src/engine/worker-runtime.ts +6 -3
- 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 +311 -17
- 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 +23 -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 +221 -30
- 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 +439 -7
- 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/view/artifacts.ts +42 -9
- package/src/interactive/view/view-overlay.ts +15 -3
- package/src/interactive/watchdog-run.ts +75 -0
- package/src/interactive/worker-receipts.ts +14 -2
- package/src/interactive/worker-share.ts +56 -1
- package/src/interactive/worker-stream.ts +15 -0
- package/src/tools/bootstrap.ts +3 -0
- package/src/tools/compete-worktrees.ts +13 -79
- package/src/tools/dispatch-admission.ts +251 -18
- package/src/tools/dispatch-arguments.ts +84 -1
- package/src/tools/dispatch-plan.ts +165 -6
- package/src/tools/dispatch-runner.ts +364 -23
- package/src/tools/dispatch-types.ts +20 -1
- package/src/tools/dispatch.ts +72 -2
- package/src/tools/monitor.ts +29 -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 +21 -14
- package/src/worker/spec-contract.ts +3 -1
- package/dist/chunk-HC4CLZ2Y.js +0 -68
|
@@ -1,486 +1,32 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
assertAgentIdNamespace
|
|
4
|
-
} from "./chunk-R46L2BIR.js";
|
|
5
|
-
import {
|
|
6
|
-
parseFrontmatter
|
|
7
|
-
} from "./chunk-QKMUKYO7.js";
|
|
8
|
-
import {
|
|
9
|
-
loadSkills
|
|
10
|
-
} from "./chunk-4BPJXDWC.js";
|
|
11
2
|
import {
|
|
12
3
|
CONFIRMED_SCOPE,
|
|
13
4
|
READONLY_SCOPE,
|
|
14
5
|
WORKSPACE_SCOPE,
|
|
15
6
|
isSubset
|
|
16
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VCBR6CU7.js";
|
|
17
8
|
import {
|
|
18
9
|
createLoopState,
|
|
19
10
|
observe
|
|
20
11
|
} from "./chunk-UOV2BYIW.js";
|
|
21
12
|
import {
|
|
22
|
-
createSafetyPolicyEngine
|
|
23
|
-
|
|
24
|
-
} from "./chunk-EKY57CSP.js";
|
|
13
|
+
createSafetyPolicyEngine
|
|
14
|
+
} from "./chunk-5H3GB5BO.js";
|
|
25
15
|
import {
|
|
26
|
-
|
|
27
|
-
classify,
|
|
28
|
-
isAgentAudience,
|
|
29
|
-
isAgentCapabilityClass,
|
|
30
|
-
isAgentCategory,
|
|
31
|
-
isAgentLatencyClass,
|
|
32
|
-
isAgentProduct,
|
|
33
|
-
isAgentProjectContextTier,
|
|
34
|
-
isShadowAgent,
|
|
35
|
-
normalizeAgentSpec
|
|
16
|
+
classify
|
|
36
17
|
} from "./chunk-AOCYTWAV.js";
|
|
37
|
-
import {
|
|
38
|
-
clioConfigDir,
|
|
39
|
-
clioStateDir,
|
|
40
|
-
stateRootRemoved
|
|
41
|
-
} from "./chunk-BNAZZHFG.js";
|
|
42
18
|
import {
|
|
43
19
|
BusChannels,
|
|
44
20
|
isRunAbortedPayload
|
|
45
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TT36MB5S.js";
|
|
46
22
|
import {
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
clioStateDir,
|
|
24
|
+
stateRootRemoved
|
|
25
|
+
} from "./chunk-BNAZZHFG.js";
|
|
49
26
|
import {
|
|
50
27
|
init_esm_shims
|
|
51
28
|
} from "./chunk-3R73A4XB.js";
|
|
52
29
|
|
|
53
|
-
// src/domains/agents/index.ts
|
|
54
|
-
init_esm_shims();
|
|
55
|
-
|
|
56
|
-
// src/domains/agents/extension.ts
|
|
57
|
-
init_esm_shims();
|
|
58
|
-
import path3 from "node:path";
|
|
59
|
-
|
|
60
|
-
// src/domains/agents/registry.ts
|
|
61
|
-
init_esm_shims();
|
|
62
|
-
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
63
|
-
import path2 from "node:path";
|
|
64
|
-
|
|
65
|
-
// src/domains/agents/recipe.ts
|
|
66
|
-
init_esm_shims();
|
|
67
|
-
import path from "node:path";
|
|
68
|
-
var AGENT_BUDGET_KEYS = ["toolCalls", "readReserve", "synthesis", "maximum"];
|
|
69
|
-
function parseAgentBudgetPhase(value, prefix, relationTarget) {
|
|
70
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
71
|
-
throw new Error(`${prefix} must be a non-null YAML object`);
|
|
72
|
-
}
|
|
73
|
-
const record = value;
|
|
74
|
-
for (const key of Object.keys(record)) {
|
|
75
|
-
if (key !== "toolCalls" && key !== "readReserve") throw new Error(`${prefix}.${key} is unknown`);
|
|
76
|
-
}
|
|
77
|
-
for (const key of ["toolCalls", "readReserve"]) {
|
|
78
|
-
if (!Object.hasOwn(record, key)) throw new Error(`${prefix}.${key} is required`);
|
|
79
|
-
}
|
|
80
|
-
const toolCalls = record.toolCalls;
|
|
81
|
-
if (typeof toolCalls !== "number" || !Number.isSafeInteger(toolCalls)) {
|
|
82
|
-
throw new Error(`${prefix}.toolCalls must be a finite safe integer`);
|
|
83
|
-
}
|
|
84
|
-
if (toolCalls <= 0) throw new Error(`${prefix}.toolCalls must be greater than 0`);
|
|
85
|
-
const readReserve = record.readReserve;
|
|
86
|
-
if (typeof readReserve !== "number" || !Number.isSafeInteger(readReserve)) {
|
|
87
|
-
throw new Error(`${prefix}.readReserve must be a finite safe integer`);
|
|
88
|
-
}
|
|
89
|
-
if (readReserve < 0) throw new Error(`${prefix}.readReserve must be greater than or equal to 0`);
|
|
90
|
-
if (readReserve >= toolCalls) throw new Error(`${prefix}.readReserve must be less than ${relationTarget}`);
|
|
91
|
-
return { toolCalls, readReserve };
|
|
92
|
-
}
|
|
93
|
-
function parseAgentBudget(value, sourcePath) {
|
|
94
|
-
if (value === void 0) return void 0;
|
|
95
|
-
const prefix = `agent budget: ${sourcePath}: budget`;
|
|
96
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
97
|
-
throw new Error(`${prefix} must be a non-null YAML object`);
|
|
98
|
-
}
|
|
99
|
-
const record = value;
|
|
100
|
-
for (const key of Object.keys(record)) {
|
|
101
|
-
if (!AGENT_BUDGET_KEYS.includes(key)) {
|
|
102
|
-
throw new Error(`${prefix}.${key} is unknown`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
for (const key of ["toolCalls", "readReserve", "synthesis"]) {
|
|
106
|
-
if (!Object.hasOwn(record, key)) throw new Error(`${prefix}.${key} is required`);
|
|
107
|
-
}
|
|
108
|
-
const phase = parseAgentBudgetPhase(
|
|
109
|
-
{ toolCalls: record.toolCalls, readReserve: record.readReserve },
|
|
110
|
-
prefix,
|
|
111
|
-
"budget.toolCalls"
|
|
112
|
-
);
|
|
113
|
-
const synthesis = record.synthesis;
|
|
114
|
-
if (typeof synthesis !== "boolean") throw new Error(`${prefix}.synthesis must be a boolean`);
|
|
115
|
-
const maximum = record.maximum === void 0 ? void 0 : parseAgentBudgetPhase(record.maximum, `${prefix}.maximum`, "budget.maximum.toolCalls");
|
|
116
|
-
if (maximum !== void 0) {
|
|
117
|
-
if (maximum.toolCalls < phase.toolCalls) {
|
|
118
|
-
throw new Error(`${prefix}.maximum.toolCalls must be greater than or equal to budget.toolCalls`);
|
|
119
|
-
}
|
|
120
|
-
if (maximum.readReserve < phase.readReserve) {
|
|
121
|
-
throw new Error(`${prefix}.maximum.readReserve must be greater than or equal to budget.readReserve`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return { ...phase, synthesis, ...maximum === void 0 ? {} : { maximum } };
|
|
125
|
-
}
|
|
126
|
-
function recipeIdFromPath(absPath, rootDir) {
|
|
127
|
-
const resolvedRoot = path.resolve(rootDir);
|
|
128
|
-
const resolvedPath = path.resolve(absPath);
|
|
129
|
-
const relPath = path.relative(resolvedRoot, resolvedPath);
|
|
130
|
-
if (relPath === "" || relPath.startsWith("..") || path.isAbsolute(relPath)) {
|
|
131
|
-
throw new Error(`recipe: path must live under rootDir (${resolvedPath} not under ${resolvedRoot})`);
|
|
132
|
-
}
|
|
133
|
-
if (path.dirname(relPath) !== ".") {
|
|
134
|
-
throw new Error(`recipe: recipes must live directly under rootDir (${resolvedPath})`);
|
|
135
|
-
}
|
|
136
|
-
if (path.extname(relPath) !== ".md") {
|
|
137
|
-
throw new Error(`recipe: recipe files must end in .md (${resolvedPath})`);
|
|
138
|
-
}
|
|
139
|
-
const id = path.basename(relPath, ".md");
|
|
140
|
-
if (id === "") {
|
|
141
|
-
throw new Error(`recipe: recipe filename must not be empty (${resolvedPath})`);
|
|
142
|
-
}
|
|
143
|
-
return id;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// src/domains/agents/recipe-schema.ts
|
|
147
|
-
init_esm_shims();
|
|
148
|
-
var RECIPE_KEYS = [
|
|
149
|
-
"version",
|
|
150
|
-
"name",
|
|
151
|
-
"description",
|
|
152
|
-
"tools",
|
|
153
|
-
"skills",
|
|
154
|
-
"audience",
|
|
155
|
-
"category",
|
|
156
|
-
"capabilityClass",
|
|
157
|
-
"latencyClass",
|
|
158
|
-
"projectContextTier",
|
|
159
|
-
"budget",
|
|
160
|
-
"resultContract",
|
|
161
|
-
"tags"
|
|
162
|
-
];
|
|
163
|
-
var OPTIONAL_RECIPE_KEYS = ["product"];
|
|
164
|
-
var ALL_RECIPE_KEYS = [...RECIPE_KEYS, ...OPTIONAL_RECIPE_KEYS];
|
|
165
|
-
function requiredString(value, path4) {
|
|
166
|
-
if (typeof value !== "string" || value.trim().length === 0)
|
|
167
|
-
throw new Error(`agent recipe: ${path4} must be a non-empty string`);
|
|
168
|
-
return value;
|
|
169
|
-
}
|
|
170
|
-
function requiredStringArray(value, path4) {
|
|
171
|
-
if (!Array.isArray(value)) throw new Error(`agent recipe: ${path4} must be an array of strings`);
|
|
172
|
-
const entries = value.map((entry, index) => requiredString(entry, `${path4}[${index}]`));
|
|
173
|
-
if (new Set(entries).size !== entries.length) throw new Error(`agent recipe: ${path4} must not contain duplicates`);
|
|
174
|
-
return entries;
|
|
175
|
-
}
|
|
176
|
-
function enumValue(value, path4, predicate) {
|
|
177
|
-
if (!predicate(value)) throw new Error(`agent recipe: ${path4} has an unsupported value`);
|
|
178
|
-
return value;
|
|
179
|
-
}
|
|
180
|
-
function parseAudience(value, source, filepath) {
|
|
181
|
-
const audience = enumValue(value, `${filepath}: audience`, isAgentAudience);
|
|
182
|
-
if (source === "builtin") {
|
|
183
|
-
if (audience === "custom") {
|
|
184
|
-
throw new Error(`agent recipe: ${filepath}: a builtin recipe must not declare audience 'custom'`);
|
|
185
|
-
}
|
|
186
|
-
return audience;
|
|
187
|
-
}
|
|
188
|
-
if (audience !== "custom") {
|
|
189
|
-
throw new Error(
|
|
190
|
-
`agent recipe: ${filepath}: a ${source} recipe must declare audience 'custom', not '${audience}'; audience follows where the recipe was discovered and cannot be claimed in frontmatter`
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
return audience;
|
|
194
|
-
}
|
|
195
|
-
function parseTools(value, filepath) {
|
|
196
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
197
|
-
throw new Error(`agent recipe: ${filepath}: tools must be a { required, optional } object`);
|
|
198
|
-
}
|
|
199
|
-
const record = value;
|
|
200
|
-
if (Object.keys(record).some((key) => key !== "required" && key !== "optional")) {
|
|
201
|
-
throw new Error(`agent recipe: ${filepath}: tools has an unknown key`);
|
|
202
|
-
}
|
|
203
|
-
if (!("required" in record) || !("optional" in record)) {
|
|
204
|
-
throw new Error(`agent recipe: ${filepath}: tools.required and tools.optional are required`);
|
|
205
|
-
}
|
|
206
|
-
if (!Array.isArray(record.required) || !Array.isArray(record.optional)) {
|
|
207
|
-
throw new Error(`agent recipe: ${filepath}: tools.required and tools.optional must be arrays`);
|
|
208
|
-
}
|
|
209
|
-
const required = record.required.map((entry, index) => {
|
|
210
|
-
const entryPath = `${filepath}: tools.required[${index}]`;
|
|
211
|
-
if (typeof entry === "string") return requiredString(entry, entryPath);
|
|
212
|
-
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
213
|
-
throw new Error(`agent recipe: ${entryPath} must be a tool name or { anyOf: [...] }`);
|
|
214
|
-
}
|
|
215
|
-
const group = entry;
|
|
216
|
-
if (Object.keys(group).length !== 1 || !("anyOf" in group)) {
|
|
217
|
-
throw new Error(`agent recipe: ${entryPath} must contain only anyOf`);
|
|
218
|
-
}
|
|
219
|
-
const anyOf = requiredStringArray(group.anyOf, `${entryPath}.anyOf`);
|
|
220
|
-
if (anyOf.length === 0) throw new Error(`agent recipe: ${entryPath}.anyOf must not be empty`);
|
|
221
|
-
return { anyOf };
|
|
222
|
-
});
|
|
223
|
-
const optional = requiredStringArray(record.optional, `${filepath}: tools.optional`);
|
|
224
|
-
const tools = [
|
|
225
|
-
...required.flatMap((requirement) => typeof requirement === "string" ? [requirement] : requirement.anyOf),
|
|
226
|
-
...optional
|
|
227
|
-
];
|
|
228
|
-
if (new Set(tools).size !== tools.length)
|
|
229
|
-
throw new Error(`agent recipe: ${filepath}: tools contains duplicate requirements`);
|
|
230
|
-
return { tools, toolRequirements: { required, optional } };
|
|
231
|
-
}
|
|
232
|
-
function parseAgentRecipeSchema(input) {
|
|
233
|
-
const { frontmatter, filepath } = input;
|
|
234
|
-
for (const key of Object.keys(frontmatter)) {
|
|
235
|
-
if (!ALL_RECIPE_KEYS.includes(key)) {
|
|
236
|
-
throw new Error(`agent recipe: ${filepath}: unknown key '${key}'`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
for (const key of RECIPE_KEYS) {
|
|
240
|
-
if (!(key in frontmatter)) throw new Error(`agent recipe: ${filepath}: ${key} is required`);
|
|
241
|
-
}
|
|
242
|
-
if (frontmatter.version !== 1) throw new Error(`agent recipe: ${filepath}: version must be the supported integer 1`);
|
|
243
|
-
if (input.body.trim().length === 0) throw new Error(`agent recipe: ${filepath}: persona body must not be empty`);
|
|
244
|
-
const parsedTools = parseTools(frontmatter.tools, filepath);
|
|
245
|
-
const budget = parseAgentBudget(frontmatter.budget, filepath);
|
|
246
|
-
if (budget === void 0) throw new Error(`agent recipe: ${filepath}: budget is required`);
|
|
247
|
-
return {
|
|
248
|
-
version: 1,
|
|
249
|
-
id: input.id,
|
|
250
|
-
name: requiredString(frontmatter.name, `${filepath}: name`),
|
|
251
|
-
description: requiredString(frontmatter.description, `${filepath}: description`),
|
|
252
|
-
tools: parsedTools.tools,
|
|
253
|
-
toolRequirements: parsedTools.toolRequirements,
|
|
254
|
-
skills: requiredStringArray(frontmatter.skills, `${filepath}: skills`),
|
|
255
|
-
boundSkillPaths: [],
|
|
256
|
-
audience: parseAudience(frontmatter.audience, input.source, filepath),
|
|
257
|
-
category: enumValue(frontmatter.category, `${filepath}: category`, isAgentCategory),
|
|
258
|
-
capabilityClass: enumValue(
|
|
259
|
-
frontmatter.capabilityClass,
|
|
260
|
-
`${filepath}: capabilityClass`,
|
|
261
|
-
isAgentCapabilityClass
|
|
262
|
-
),
|
|
263
|
-
latencyClass: enumValue(
|
|
264
|
-
frontmatter.latencyClass,
|
|
265
|
-
`${filepath}: latencyClass`,
|
|
266
|
-
isAgentLatencyClass
|
|
267
|
-
),
|
|
268
|
-
projectContextTier: enumValue(
|
|
269
|
-
frontmatter.projectContextTier,
|
|
270
|
-
`${filepath}: projectContextTier`,
|
|
271
|
-
isAgentProjectContextTier
|
|
272
|
-
),
|
|
273
|
-
budget,
|
|
274
|
-
resultContract: parseResultContract(frontmatter.resultContract, filepath),
|
|
275
|
-
// Optional, but not lenient. A misspelled product silently costs the run
|
|
276
|
-
// the delivery tools its reserve window was supposed to keep, and the
|
|
277
|
-
// only symptom is a blocked tool call deep in a dispatch log.
|
|
278
|
-
...frontmatter.product === void 0 ? {} : { product: enumValue(frontmatter.product, `${filepath}: product`, isAgentProduct) },
|
|
279
|
-
tags: requiredStringArray(frontmatter.tags, `${filepath}: tags`),
|
|
280
|
-
source: input.source,
|
|
281
|
-
filepath,
|
|
282
|
-
body: input.body
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// src/domains/agents/registry.ts
|
|
287
|
-
var RESERVED_CUSTOM_AGENT_IDS = /* @__PURE__ */ new Set(["worker", "delegate", "auto"]);
|
|
288
|
-
function resolveBoundSkills(recipe, source) {
|
|
289
|
-
if (recipe.skills.length === 0) return { ...recipe, boundSkillPaths: [] };
|
|
290
|
-
const packageSkills = path2.resolve(source.dir, "..", "..", "..", "..", "skills");
|
|
291
|
-
const skills = loadSkills({
|
|
292
|
-
cwd: process.cwd(),
|
|
293
|
-
...source.source === "builtin" && existsSync(packageSkills) ? { explicitSkillPaths: [packageSkills] } : {}
|
|
294
|
-
});
|
|
295
|
-
const byName = new Map(skills.items.map((skill) => [skill.name, skill.filePath]));
|
|
296
|
-
const missing = recipe.skills.filter((skill) => !byName.has(skill));
|
|
297
|
-
if (missing.length > 0) {
|
|
298
|
-
throw new Error(`agent recipe: ${recipe.filepath}: bound skill(s) unavailable: ${missing.join(", ")}`);
|
|
299
|
-
}
|
|
300
|
-
const boundSkillPaths = recipe.skills.map((skill) => {
|
|
301
|
-
const filePath = byName.get(skill);
|
|
302
|
-
if (filePath === void 0) throw new Error(`agent recipe: ${recipe.filepath}: bound skill unavailable: ${skill}`);
|
|
303
|
-
return filePath;
|
|
304
|
-
});
|
|
305
|
-
return { ...recipe, boundSkillPaths };
|
|
306
|
-
}
|
|
307
|
-
function loadRecipesFromDir(source, diagnostics = []) {
|
|
308
|
-
let entries;
|
|
309
|
-
try {
|
|
310
|
-
entries = readdirSync(source.dir, { withFileTypes: true });
|
|
311
|
-
} catch (err) {
|
|
312
|
-
const error = err;
|
|
313
|
-
if (error.code === "ENOENT" || error.code === "ENOTDIR") return [];
|
|
314
|
-
throw err;
|
|
315
|
-
}
|
|
316
|
-
const recipes = [];
|
|
317
|
-
for (const entry of entries) {
|
|
318
|
-
if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
|
|
319
|
-
const filepath = path2.join(source.dir, entry.name);
|
|
320
|
-
try {
|
|
321
|
-
const id = recipeIdFromPath(filepath, source.dir);
|
|
322
|
-
const raw = readFileSync(filepath, "utf8");
|
|
323
|
-
const { frontmatter, body } = parseFrontmatter(raw, filepath);
|
|
324
|
-
const parsedRecipe = parseAgentRecipeSchema({ id, source: source.source, filepath, body, frontmatter });
|
|
325
|
-
const recipe = resolveBoundSkills(parsedRecipe, source);
|
|
326
|
-
assertAgentSpecPolicy(normalizeAgentSpec(recipe));
|
|
327
|
-
recipes.push(recipe);
|
|
328
|
-
} catch (error) {
|
|
329
|
-
if (source.source === "builtin") throw error;
|
|
330
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
331
|
-
diagnostics.push({ source: source.source, filepath, message });
|
|
332
|
-
process.stderr.write(`[clio:agents] quarantine path=${filepath} source=${source.source} reason=${message}
|
|
333
|
-
`);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
recipes.sort((left, right) => left.id.localeCompare(right.id));
|
|
337
|
-
return recipes;
|
|
338
|
-
}
|
|
339
|
-
function mergeRecipes(...sources) {
|
|
340
|
-
const byId = /* @__PURE__ */ new Map();
|
|
341
|
-
const builtinById = /* @__PURE__ */ new Map();
|
|
342
|
-
for (const group of sources) {
|
|
343
|
-
for (const recipe of group) {
|
|
344
|
-
if (recipe.source === "builtin") builtinById.set(recipe.id, recipe);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
for (const group of sources) {
|
|
348
|
-
for (const recipe of group) {
|
|
349
|
-
if (recipe.source !== "builtin" && RESERVED_CUSTOM_AGENT_IDS.has(recipe.id)) {
|
|
350
|
-
process.stderr.write(`[clio:agents] ignore id=${recipe.id} by=${recipe.source} reason=reserved-agent-id
|
|
351
|
-
`);
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
const builtin = builtinById.get(recipe.id);
|
|
355
|
-
if (recipe.source === "user" && builtin && isShadowAgent(normalizeAgentSpec(builtin))) {
|
|
356
|
-
process.stderr.write(`[clio:agents] ignore override id=${recipe.id} by=user reason=reserved-shadow
|
|
357
|
-
`);
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
if (recipe.source === "project" && builtin) {
|
|
361
|
-
process.stderr.write(`[clio:agents] ignore override id=${recipe.id} by=project reason=reserved-builtin
|
|
362
|
-
`);
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
if (byId.has(recipe.id)) process.stderr.write(`[clio:agents] override id=${recipe.id} by=${recipe.source}
|
|
366
|
-
`);
|
|
367
|
-
byId.set(recipe.id, recipe);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
return Array.from(byId.values()).sort((left, right) => left.id.localeCompare(right.id));
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// src/domains/agents/extension.ts
|
|
374
|
-
function createAgentsBundle(_context) {
|
|
375
|
-
let recipes = [];
|
|
376
|
-
let specs = [];
|
|
377
|
-
let diagnostics = [];
|
|
378
|
-
function discover() {
|
|
379
|
-
const builtinDir = path3.join(resolvePackageRoot(), "src", "domains", "agents", "builtins");
|
|
380
|
-
const userDir = path3.join(clioConfigDir(), "agents");
|
|
381
|
-
const projectDir = path3.join(process.cwd(), ".clio-coder", "agents");
|
|
382
|
-
const nextDiagnostics = [];
|
|
383
|
-
const builtin = loadRecipesFromDir({ dir: builtinDir, source: "builtin" }, nextDiagnostics);
|
|
384
|
-
const user = loadRecipesFromDir({ dir: userDir, source: "user" }, nextDiagnostics);
|
|
385
|
-
const project = loadRecipesFromDir({ dir: projectDir, source: "project" }, nextDiagnostics);
|
|
386
|
-
const merged = mergeRecipes(builtin, user, project);
|
|
387
|
-
const config = _context.getContract("config");
|
|
388
|
-
assertAgentIdNamespace(merged, config?.get()?.delegation?.agents ?? []);
|
|
389
|
-
recipes = merged;
|
|
390
|
-
specs = recipes.map(normalizeAgentSpec);
|
|
391
|
-
diagnostics = nextDiagnostics;
|
|
392
|
-
}
|
|
393
|
-
const extension = {
|
|
394
|
-
async start() {
|
|
395
|
-
discover();
|
|
396
|
-
},
|
|
397
|
-
async stop() {
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
const contract = {
|
|
401
|
-
list() {
|
|
402
|
-
return recipes;
|
|
403
|
-
},
|
|
404
|
-
get(id) {
|
|
405
|
-
return recipes.find((r) => r.id === id) ?? null;
|
|
406
|
-
},
|
|
407
|
-
diagnostics() {
|
|
408
|
-
return diagnostics.map((diagnostic) => ({ ...diagnostic }));
|
|
409
|
-
},
|
|
410
|
-
listSpecs() {
|
|
411
|
-
const config = _context.getContract("config");
|
|
412
|
-
const delegationAgents = config?.get()?.delegation?.agents ?? [];
|
|
413
|
-
const delegationSpecs = delegationAgents.map((agent) => ({
|
|
414
|
-
version: 1,
|
|
415
|
-
id: agent.id,
|
|
416
|
-
name: agent.id,
|
|
417
|
-
description: `External ACP delegation agent: ${agent.command} ${(agent.args ?? []).join(" ")}`,
|
|
418
|
-
source: "custom",
|
|
419
|
-
filepath: "settings.yaml",
|
|
420
|
-
tools: [],
|
|
421
|
-
toolRequirements: { required: [], optional: [] },
|
|
422
|
-
category: "explore",
|
|
423
|
-
capabilityClass: "orchestration",
|
|
424
|
-
latencyClass: "deep",
|
|
425
|
-
projectContextTier: "none",
|
|
426
|
-
audience: "custom",
|
|
427
|
-
tags: ["delegation", "acp"],
|
|
428
|
-
skills: [],
|
|
429
|
-
resultContract: { kind: "external-delegation" },
|
|
430
|
-
budget: { toolCalls: 1, readReserve: 0, synthesis: false },
|
|
431
|
-
body: "External ACP delegation."
|
|
432
|
-
}));
|
|
433
|
-
return [...specs, ...delegationSpecs];
|
|
434
|
-
},
|
|
435
|
-
getSpec(id) {
|
|
436
|
-
const found = specs.find((r) => r.id === id);
|
|
437
|
-
if (found) return found;
|
|
438
|
-
const config = _context.getContract("config");
|
|
439
|
-
const agent = config?.get()?.delegation?.agents?.find((entry) => entry.id === id);
|
|
440
|
-
if (agent) {
|
|
441
|
-
return {
|
|
442
|
-
version: 1,
|
|
443
|
-
id: agent.id,
|
|
444
|
-
name: agent.id,
|
|
445
|
-
description: `External ACP delegation agent: ${agent.command} ${(agent.args ?? []).join(" ")}`,
|
|
446
|
-
source: "custom",
|
|
447
|
-
filepath: "settings.yaml",
|
|
448
|
-
tools: [],
|
|
449
|
-
toolRequirements: { required: [], optional: [] },
|
|
450
|
-
category: "explore",
|
|
451
|
-
capabilityClass: "orchestration",
|
|
452
|
-
latencyClass: "deep",
|
|
453
|
-
projectContextTier: "none",
|
|
454
|
-
audience: "custom",
|
|
455
|
-
tags: ["delegation", "acp"],
|
|
456
|
-
skills: [],
|
|
457
|
-
resultContract: { kind: "external-delegation" },
|
|
458
|
-
budget: { toolCalls: 1, readReserve: 0, synthesis: false },
|
|
459
|
-
body: "External ACP delegation."
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
return null;
|
|
463
|
-
},
|
|
464
|
-
reload() {
|
|
465
|
-
discover();
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
return { extension, contract };
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
// src/domains/agents/manifest.ts
|
|
472
|
-
init_esm_shims();
|
|
473
|
-
var AgentsManifest = {
|
|
474
|
-
name: "agents",
|
|
475
|
-
dependsOn: ["config"]
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
// src/domains/agents/index.ts
|
|
479
|
-
var AgentsDomainModule = {
|
|
480
|
-
manifest: AgentsManifest,
|
|
481
|
-
createExtension: createAgentsBundle
|
|
482
|
-
};
|
|
483
|
-
|
|
484
30
|
// src/domains/safety/index.ts
|
|
485
31
|
init_esm_shims();
|
|
486
32
|
|
|
@@ -634,16 +180,16 @@ function buildCompletionContractAuditRecord(input) {
|
|
|
634
180
|
decision: input.decision,
|
|
635
181
|
reason: input.reason,
|
|
636
182
|
rigor: input.rigor,
|
|
637
|
-
mutatedPaths: input.mutatedPaths.map((
|
|
183
|
+
mutatedPaths: input.mutatedPaths.map((path) => redactString(path)),
|
|
638
184
|
evidenceKinds: [...input.evidenceKinds]
|
|
639
185
|
};
|
|
640
186
|
if (input.runId !== void 0) record.runId = input.runId;
|
|
641
187
|
if (input.sessionId !== void 0) record.sessionId = input.sessionId;
|
|
642
188
|
return record;
|
|
643
189
|
}
|
|
644
|
-
function logAuditError(err,
|
|
190
|
+
function logAuditError(err, path) {
|
|
645
191
|
const msg = err instanceof Error ? err.message : String(err);
|
|
646
|
-
const where =
|
|
192
|
+
const where = path ? ` (${path})` : "";
|
|
647
193
|
process.stderr.write(`[clio:audit] ${msg}${where}
|
|
648
194
|
`);
|
|
649
195
|
}
|
|
@@ -1060,7 +606,6 @@ var SafetyDomainModule = {
|
|
|
1060
606
|
};
|
|
1061
607
|
|
|
1062
608
|
export {
|
|
1063
|
-
AgentsDomainModule,
|
|
1064
609
|
SafetyDomainModule
|
|
1065
610
|
};
|
|
1066
|
-
//# sourceMappingURL=chunk-
|
|
611
|
+
//# sourceMappingURL=chunk-EMYUUSFG.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveDynamicConfigValue
|
|
4
|
+
} from "./chunk-SST6Z5JA.js";
|
|
2
5
|
import {
|
|
3
6
|
withStateFileLock,
|
|
4
7
|
withStateFileLockSync
|
|
5
8
|
} from "./chunk-IKCO5N3L.js";
|
|
6
|
-
import {
|
|
7
|
-
resolveDynamicConfigValue
|
|
8
|
-
} from "./chunk-SST6Z5JA.js";
|
|
9
9
|
import {
|
|
10
10
|
require_dist
|
|
11
11
|
} from "./chunk-APJ265NV.js";
|
|
12
|
-
import {
|
|
13
|
-
findEngineEnvKeys,
|
|
14
|
-
getEngineEnvApiKey
|
|
15
|
-
} from "./chunk-YXLYO42X.js";
|
|
16
12
|
import {
|
|
17
13
|
clioConfigDir
|
|
18
14
|
} from "./chunk-BNAZZHFG.js";
|
|
19
15
|
import {
|
|
20
16
|
safeResourceWrite
|
|
21
17
|
} from "./chunk-WEPFGWHJ.js";
|
|
18
|
+
import {
|
|
19
|
+
findEngineEnvKeys,
|
|
20
|
+
getEngineEnvApiKey
|
|
21
|
+
} from "./chunk-YXLYO42X.js";
|
|
22
22
|
import {
|
|
23
23
|
__toESM,
|
|
24
24
|
init_esm_shims
|
|
@@ -959,4 +959,4 @@ export {
|
|
|
959
959
|
authNotRequiredStatus,
|
|
960
960
|
openAuthStorage
|
|
961
961
|
};
|
|
962
|
-
//# sourceMappingURL=chunk-
|
|
962
|
+
//# sourceMappingURL=chunk-EQ63NRB7.js.map
|