@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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/providers/registry.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { readdirSync, statSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { pathToFileURL } from "node:url";
|
|
11
|
+
var RUNTIME_KINDS = ["http", "sdk", "subprocess"];
|
|
12
|
+
var RUNTIME_AUTHS = ["api-key", "oauth", "aws-sdk", "vertex-adc", "claude-cli", "none"];
|
|
13
|
+
function createRuntimeRegistry() {
|
|
14
|
+
const byId = /* @__PURE__ */ new Map();
|
|
15
|
+
const canonical = /* @__PURE__ */ new Set();
|
|
16
|
+
const register = (desc) => {
|
|
17
|
+
const ids = [desc.id, ...desc.aliases ?? []];
|
|
18
|
+
const conflict = ids.find((id) => byId.has(id));
|
|
19
|
+
if (conflict) {
|
|
20
|
+
throw new Error(`runtime id '${conflict}' already registered`);
|
|
21
|
+
}
|
|
22
|
+
for (const id of ids) byId.set(id, desc);
|
|
23
|
+
canonical.add(desc.id);
|
|
24
|
+
};
|
|
25
|
+
const get = (id) => byId.get(id) ?? null;
|
|
26
|
+
const list = () => Array.from(canonical, (id) => byId.get(id)).filter((entry) => entry !== void 0);
|
|
27
|
+
const clear = () => {
|
|
28
|
+
byId.clear();
|
|
29
|
+
canonical.clear();
|
|
30
|
+
};
|
|
31
|
+
const loadFromDir = async (dir, beforeImport) => {
|
|
32
|
+
let entries;
|
|
33
|
+
try {
|
|
34
|
+
const stat = statSync(dir);
|
|
35
|
+
if (!stat.isDirectory()) return [];
|
|
36
|
+
entries = readdirSync(dir);
|
|
37
|
+
} catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const loaded = [];
|
|
41
|
+
for (const name of entries) {
|
|
42
|
+
if (!name.endsWith(".js")) continue;
|
|
43
|
+
const full = join(dir, name);
|
|
44
|
+
const desc = await importDescriptor(full, pathToFileURL(full).href, beforeImport);
|
|
45
|
+
if (desc === null) continue;
|
|
46
|
+
try {
|
|
47
|
+
register(desc);
|
|
48
|
+
loaded.push(desc.id);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
process.stderr.write(`[providers] runtime plugin ${full} rejected: ${describeError(err)}
|
|
51
|
+
`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return loaded;
|
|
55
|
+
};
|
|
56
|
+
const loadFromPackage = async (packageName, beforeImport) => {
|
|
57
|
+
let mod;
|
|
58
|
+
try {
|
|
59
|
+
await beforeImport?.();
|
|
60
|
+
mod = await import(packageName);
|
|
61
|
+
} catch (err) {
|
|
62
|
+
process.stderr.write(`[providers] runtime package ${packageName} failed to import: ${describeError(err)}
|
|
63
|
+
`);
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
const exported = mod.clioRuntimes;
|
|
67
|
+
if (!Array.isArray(exported)) {
|
|
68
|
+
process.stderr.write(`[providers] runtime package ${packageName} has no 'clioRuntimes' array export
|
|
69
|
+
`);
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
const loaded = [];
|
|
73
|
+
for (const candidate of exported) {
|
|
74
|
+
const validation = validateRuntimeDescriptor(candidate);
|
|
75
|
+
if (!validation.ok) {
|
|
76
|
+
process.stderr.write(
|
|
77
|
+
`[providers] runtime package ${packageName} exported an invalid descriptor: ${validation.reason}
|
|
78
|
+
`
|
|
79
|
+
);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
register(validation.descriptor);
|
|
84
|
+
loaded.push(validation.descriptor.id);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
process.stderr.write(`[providers] runtime package ${packageName} id conflict: ${describeError(err)}
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return loaded;
|
|
91
|
+
};
|
|
92
|
+
return { register, get, list, clear, loadFromDir, loadFromPackage };
|
|
93
|
+
}
|
|
94
|
+
var singleton = null;
|
|
95
|
+
function getRuntimeRegistry() {
|
|
96
|
+
if (singleton === null) singleton = createRuntimeRegistry();
|
|
97
|
+
return singleton;
|
|
98
|
+
}
|
|
99
|
+
async function importDescriptor(file, href, beforeImport) {
|
|
100
|
+
let mod;
|
|
101
|
+
try {
|
|
102
|
+
await beforeImport?.();
|
|
103
|
+
mod = await import(href);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
process.stderr.write(`[providers] runtime plugin ${file} failed to import: ${describeError(err)}
|
|
106
|
+
`);
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const candidate = mod.default;
|
|
110
|
+
const validation = validateRuntimeDescriptor(candidate);
|
|
111
|
+
if (!validation.ok) {
|
|
112
|
+
process.stderr.write(
|
|
113
|
+
`[providers] runtime plugin ${file} has invalid default-export RuntimeDescriptor: ${validation.reason}
|
|
114
|
+
`
|
|
115
|
+
);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return validation.descriptor;
|
|
119
|
+
}
|
|
120
|
+
function validateRuntimeDescriptor(value) {
|
|
121
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
122
|
+
return { ok: false, reason: "descriptor must be an object" };
|
|
123
|
+
}
|
|
124
|
+
const v = value;
|
|
125
|
+
if (typeof v.id !== "string" || v.id.trim().length === 0) {
|
|
126
|
+
return { ok: false, reason: "id must be a non-empty string" };
|
|
127
|
+
}
|
|
128
|
+
if (v.aliases !== void 0 && (!Array.isArray(v.aliases) || v.aliases.some((alias) => typeof alias !== "string" || alias.trim().length === 0))) {
|
|
129
|
+
return { ok: false, reason: "aliases must be non-empty strings when present" };
|
|
130
|
+
}
|
|
131
|
+
if (typeof v.displayName !== "string" || v.displayName.trim().length === 0) {
|
|
132
|
+
return { ok: false, reason: "displayName must be a non-empty string" };
|
|
133
|
+
}
|
|
134
|
+
if (typeof v.kind !== "string" || !RUNTIME_KINDS.includes(v.kind)) {
|
|
135
|
+
return { ok: false, reason: `kind must be one of: ${RUNTIME_KINDS.join(", ")}` };
|
|
136
|
+
}
|
|
137
|
+
if (typeof v.apiFamily !== "string" || v.apiFamily.trim().length === 0) {
|
|
138
|
+
return { ok: false, reason: "apiFamily must be a non-empty string" };
|
|
139
|
+
}
|
|
140
|
+
if (typeof v.auth !== "string" || !RUNTIME_AUTHS.includes(v.auth)) {
|
|
141
|
+
return { ok: false, reason: `auth must be one of: ${RUNTIME_AUTHS.join(", ")}` };
|
|
142
|
+
}
|
|
143
|
+
if (typeof v.defaultCapabilities !== "object" || v.defaultCapabilities === null || Array.isArray(v.defaultCapabilities)) {
|
|
144
|
+
return { ok: false, reason: "defaultCapabilities must be an object" };
|
|
145
|
+
}
|
|
146
|
+
if (typeof v.synthesizeModel !== "function") {
|
|
147
|
+
return { ok: false, reason: "synthesizeModel must be a function" };
|
|
148
|
+
}
|
|
149
|
+
for (const field of ["probe", "probeModels", "complete", "infill", "embed", "rerank"]) {
|
|
150
|
+
if (v[field] !== void 0 && typeof v[field] !== "function") {
|
|
151
|
+
return { ok: false, reason: `${field} must be a function when present` };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { ok: true, descriptor: value };
|
|
155
|
+
}
|
|
156
|
+
function describeError(err) {
|
|
157
|
+
if (err instanceof Error) return err.message;
|
|
158
|
+
return String(err);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
createRuntimeRegistry,
|
|
163
|
+
getRuntimeRegistry
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=chunk-NUGM5KR6.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
gateRouteCorrelation,
|
|
4
|
+
isExecutionRole
|
|
5
|
+
} from "./chunk-H7IXIC72.js";
|
|
2
6
|
import {
|
|
3
7
|
isAgentCapabilityClass
|
|
4
8
|
} from "./chunk-AOCYTWAV.js";
|
|
@@ -6,90 +10,6 @@ import {
|
|
|
6
10
|
init_esm_shims
|
|
7
11
|
} from "./chunk-3R73A4XB.js";
|
|
8
12
|
|
|
9
|
-
// src/domains/dispatch/execution-role.ts
|
|
10
|
-
init_esm_shims();
|
|
11
|
-
var EXECUTION_ROLES = [
|
|
12
|
-
"builder",
|
|
13
|
-
"reviewer",
|
|
14
|
-
"judge",
|
|
15
|
-
"researcher",
|
|
16
|
-
"verifier",
|
|
17
|
-
"recovery"
|
|
18
|
-
];
|
|
19
|
-
function isExecutionRole(value) {
|
|
20
|
-
return typeof value === "string" && EXECUTION_ROLES.includes(value);
|
|
21
|
-
}
|
|
22
|
-
function deriveExecutionRole(input) {
|
|
23
|
-
if (input.attempt > 0) return "recovery";
|
|
24
|
-
if (input.gateRole === "reviewer") return "reviewer";
|
|
25
|
-
if (input.gateRole === "judge") return "judge";
|
|
26
|
-
if (input.gateRole === "builder" || input.gateRole === "candidate") return "builder";
|
|
27
|
-
if (input.resultContractKind === "verifier-report") return "verifier";
|
|
28
|
-
if (input.capabilityClass === "read-only") return "researcher";
|
|
29
|
-
return "builder";
|
|
30
|
-
}
|
|
31
|
-
function agentRoleFactsResolver(getSpec) {
|
|
32
|
-
return (agentId) => {
|
|
33
|
-
const spec = getSpec(agentId);
|
|
34
|
-
return spec === null ? null : { capabilityClass: spec.capabilityClass, resultContractKind: spec.resultContract.kind };
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function requestExecutionRole(input) {
|
|
38
|
-
const facts = input.resolveFacts?.(input.agentId) ?? null;
|
|
39
|
-
return deriveExecutionRole({
|
|
40
|
-
attempt: 0,
|
|
41
|
-
...input.gateRole !== void 0 ? { gateRole: input.gateRole } : {},
|
|
42
|
-
capabilityClass: facts?.capabilityClass ?? "workspace-edit",
|
|
43
|
-
resultContractKind: facts?.resultContractKind ?? null
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function withAttemptRole(requestRole, attempt) {
|
|
47
|
-
return attempt > 0 ? "recovery" : requestRole;
|
|
48
|
-
}
|
|
49
|
-
var DEFAULT_GATE_DECIDER_AGENT_ID = "verifier";
|
|
50
|
-
function gateDeciderAgentId(requested) {
|
|
51
|
-
const trimmed = requested?.trim() ?? "";
|
|
52
|
-
return trimmed.length > 0 ? trimmed : DEFAULT_GATE_DECIDER_AGENT_ID;
|
|
53
|
-
}
|
|
54
|
-
function appliesRecipeResultContract(gateRole) {
|
|
55
|
-
return gateRole !== "reviewer" && gateRole !== "judge";
|
|
56
|
-
}
|
|
57
|
-
function routeCorrelationFactsForRun(run) {
|
|
58
|
-
return {
|
|
59
|
-
agentId: run.agentId,
|
|
60
|
-
targetId: run.targetId,
|
|
61
|
-
wireModelId: run.wireModelId,
|
|
62
|
-
runtimeId: run.runtimeId,
|
|
63
|
-
nodeId: run.node?.id ?? "local"
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function modelFamily(model) {
|
|
67
|
-
return model.trim().toLowerCase().replace(/[-_:]?\d{4}[-_]?\d{2}[-_]?\d{2}$/u, "");
|
|
68
|
-
}
|
|
69
|
-
function gateRouteCorrelation(subject, decider) {
|
|
70
|
-
const agent = subject.agentId === decider.agentId;
|
|
71
|
-
const target = subject.targetId === decider.targetId;
|
|
72
|
-
const sameModelFamily = modelFamily(subject.wireModelId) === modelFamily(decider.wireModelId);
|
|
73
|
-
const runtime = subject.runtimeId === decider.runtimeId;
|
|
74
|
-
const node = subject.nodeId === decider.nodeId;
|
|
75
|
-
const dimensions = [
|
|
76
|
-
...agent ? ["agent"] : [],
|
|
77
|
-
...target ? ["target"] : [],
|
|
78
|
-
...sameModelFamily ? ["model-family"] : [],
|
|
79
|
-
...runtime ? ["runtime"] : [],
|
|
80
|
-
...node ? ["node"] : []
|
|
81
|
-
].sort();
|
|
82
|
-
return {
|
|
83
|
-
agent,
|
|
84
|
-
target,
|
|
85
|
-
modelFamily: sameModelFamily,
|
|
86
|
-
runtime,
|
|
87
|
-
node,
|
|
88
|
-
independent: !agent && !sameModelFamily,
|
|
89
|
-
dimensions
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
13
|
// src/domains/dispatch/routing-intent.ts
|
|
94
14
|
init_esm_shims();
|
|
95
15
|
var KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1053,15 +973,6 @@ function evaluateRouteDecision(decision, realized) {
|
|
|
1053
973
|
}
|
|
1054
974
|
|
|
1055
975
|
export {
|
|
1056
|
-
isExecutionRole,
|
|
1057
|
-
deriveExecutionRole,
|
|
1058
|
-
agentRoleFactsResolver,
|
|
1059
|
-
requestExecutionRole,
|
|
1060
|
-
withAttemptRole,
|
|
1061
|
-
gateDeciderAgentId,
|
|
1062
|
-
appliesRecipeResultContract,
|
|
1063
|
-
routeCorrelationFactsForRun,
|
|
1064
|
-
gateRouteCorrelation,
|
|
1065
976
|
ROUTE_POLICY_VERSION,
|
|
1066
977
|
routePriorForLatencyClass,
|
|
1067
978
|
routeObservationFromHistory,
|
|
@@ -1084,4 +995,4 @@ export {
|
|
|
1084
995
|
routingIntentRejection,
|
|
1085
996
|
explainRouteDecision
|
|
1086
997
|
};
|
|
1087
|
-
//# sourceMappingURL=chunk-
|
|
998
|
+
//# sourceMappingURL=chunk-P43ETTHK.js.map
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
17
17
|
combineSafeOutput,
|
|
18
18
|
runCommandVector
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-B5CSFE7B.js";
|
|
20
20
|
import {
|
|
21
21
|
StringEnum
|
|
22
22
|
} from "./chunk-FCSXB6T2.js";
|
|
@@ -177,4 +177,4 @@ export {
|
|
|
177
177
|
prepareVerifyArguments,
|
|
178
178
|
verifyToolSurface
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
180
|
+
//# sourceMappingURL=chunk-PMDBGQSJ.js.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
createEngineAi,
|
|
4
|
+
getEngineSupportedThinkingLevels
|
|
5
|
+
} from "./chunk-FCSXB6T2.js";
|
|
6
|
+
import {
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-3R73A4XB.js";
|
|
9
|
+
|
|
10
|
+
// src/domains/providers/capabilities.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
function mergeCapabilities(base, kb, probe, userOverride) {
|
|
13
|
+
const merged = { ...base };
|
|
14
|
+
applyLayer(merged, probe);
|
|
15
|
+
applyLayer(merged, kb);
|
|
16
|
+
applyDeploymentLimits(merged, probe);
|
|
17
|
+
applyLayer(merged, userOverride);
|
|
18
|
+
return merged;
|
|
19
|
+
}
|
|
20
|
+
function applyDeploymentLimits(target, probe) {
|
|
21
|
+
if (!probe) return;
|
|
22
|
+
if (probe.contextWindow !== void 0) target.contextWindow = probe.contextWindow;
|
|
23
|
+
if (probe.maxTokens !== void 0) target.maxTokens = probe.maxTokens;
|
|
24
|
+
}
|
|
25
|
+
function supportsAgentRoleTools(capabilities) {
|
|
26
|
+
return capabilities.tools === true;
|
|
27
|
+
}
|
|
28
|
+
var AGENT_ROLE_TOOLS_REQUIRED_REASON = "reports no tool support; Clio drives every agent role through typed tools";
|
|
29
|
+
function applyLayer(target, layer) {
|
|
30
|
+
if (!layer) return;
|
|
31
|
+
for (const key of Object.keys(layer)) {
|
|
32
|
+
const value = layer[key];
|
|
33
|
+
if (value !== void 0) target[key] = value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/domains/providers/catalog.ts
|
|
38
|
+
init_esm_shims();
|
|
39
|
+
var engineAi = createEngineAi();
|
|
40
|
+
var CATALOG_PROVIDER_BY_RUNTIME_ID = /* @__PURE__ */ new Map([
|
|
41
|
+
["anthropic", "anthropic"],
|
|
42
|
+
["anthropic-max", "anthropic"],
|
|
43
|
+
["claude-code", "anthropic"],
|
|
44
|
+
["claude-sdk", "anthropic"],
|
|
45
|
+
["bedrock", "amazon-bedrock"],
|
|
46
|
+
["deepseek", "deepseek"],
|
|
47
|
+
["google", "google"],
|
|
48
|
+
["groq", "groq"],
|
|
49
|
+
["mistral", "mistral"],
|
|
50
|
+
["openai", "openai"],
|
|
51
|
+
["openai-codex", "openai-codex"],
|
|
52
|
+
["openrouter", "openrouter"]
|
|
53
|
+
]);
|
|
54
|
+
function catalogProviderForRuntime(runtimeId) {
|
|
55
|
+
return CATALOG_PROVIDER_BY_RUNTIME_ID.get(runtimeId);
|
|
56
|
+
}
|
|
57
|
+
function listCatalogModelsForRuntime(runtimeId) {
|
|
58
|
+
const provider = catalogProviderForRuntime(runtimeId);
|
|
59
|
+
if (!provider) return [];
|
|
60
|
+
try {
|
|
61
|
+
return engineAi.listModels(provider);
|
|
62
|
+
} catch {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function resolveEffectivePricing(target, runtimeId, wireModelId) {
|
|
67
|
+
if (target.pricing) {
|
|
68
|
+
const rates = {
|
|
69
|
+
input: target.pricing.input,
|
|
70
|
+
output: target.pricing.output,
|
|
71
|
+
cacheRead: target.pricing.cacheRead ?? 0,
|
|
72
|
+
cacheWrite: target.pricing.cacheWrite ?? 0
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
rates,
|
|
76
|
+
provenance: Object.values(rates).every((rate) => rate === 0) ? "known_free" : "known"
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const catalogModel = getCatalogModelForRuntime(runtimeId, wireModelId);
|
|
80
|
+
if (!catalogModel) return { rates: null, provenance: "unknown" };
|
|
81
|
+
return {
|
|
82
|
+
rates: {
|
|
83
|
+
input: catalogModel.cost.input,
|
|
84
|
+
output: catalogModel.cost.output,
|
|
85
|
+
cacheRead: catalogModel.cost.cacheRead,
|
|
86
|
+
cacheWrite: catalogModel.cost.cacheWrite
|
|
87
|
+
},
|
|
88
|
+
provenance: "estimated"
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function resolveCostProvenance(target, runtimeId, wireModelId) {
|
|
92
|
+
return resolveEffectivePricing(target, runtimeId, wireModelId).provenance;
|
|
93
|
+
}
|
|
94
|
+
function getCatalogModelForRuntime(runtimeId, wireModelId) {
|
|
95
|
+
const provider = catalogProviderForRuntime(runtimeId);
|
|
96
|
+
if (!provider) return void 0;
|
|
97
|
+
try {
|
|
98
|
+
return engineAi.getModel(provider, wireModelId);
|
|
99
|
+
} catch {
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function capabilitiesFromCatalogModel(defaultCapabilities, model) {
|
|
104
|
+
if (!model) return defaultCapabilities;
|
|
105
|
+
return {
|
|
106
|
+
...defaultCapabilities,
|
|
107
|
+
reasoning: model.reasoning,
|
|
108
|
+
vision: model.input.includes("image"),
|
|
109
|
+
contextWindow: model.contextWindow,
|
|
110
|
+
maxTokens: model.maxTokens
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function catalogThinkingLevelsForRuntime(runtimeId, wireModelId) {
|
|
114
|
+
const model = getCatalogModelForRuntime(runtimeId, wireModelId);
|
|
115
|
+
return model ? getEngineSupportedThinkingLevels(model) : void 0;
|
|
116
|
+
}
|
|
117
|
+
function synthesizeCatalogBackedModel(input) {
|
|
118
|
+
const builtin = getCatalogModelForRuntime(input.runtimeId, input.wireModelId);
|
|
119
|
+
const caps = mergeCapabilities(
|
|
120
|
+
capabilitiesFromCatalogModel(input.defaultCapabilities, builtin),
|
|
121
|
+
input.kb?.entry.capabilities ?? null,
|
|
122
|
+
null,
|
|
123
|
+
input.target.capabilities ?? null
|
|
124
|
+
);
|
|
125
|
+
const pricing = input.target.pricing;
|
|
126
|
+
const targetHeaders = input.target.auth?.headers;
|
|
127
|
+
const model = {
|
|
128
|
+
...builtin ?? {},
|
|
129
|
+
id: input.wireModelId,
|
|
130
|
+
name: `${input.wireModelId} (${input.target.id})`,
|
|
131
|
+
api: input.api,
|
|
132
|
+
provider: input.provider,
|
|
133
|
+
baseUrl: input.target.url ?? builtin?.baseUrl ?? input.defaultBaseUrl,
|
|
134
|
+
reasoning: caps.reasoning,
|
|
135
|
+
input: caps.vision ? builtin?.input.includes("image") ? builtin.input : ["text", "image"] : ["text"],
|
|
136
|
+
cost: {
|
|
137
|
+
input: pricing?.input ?? builtin?.cost.input ?? 0,
|
|
138
|
+
output: pricing?.output ?? builtin?.cost.output ?? 0,
|
|
139
|
+
cacheRead: pricing?.cacheRead ?? builtin?.cost.cacheRead ?? 0,
|
|
140
|
+
cacheWrite: pricing?.cacheWrite ?? builtin?.cost.cacheWrite ?? 0
|
|
141
|
+
},
|
|
142
|
+
contextWindow: caps.contextWindow,
|
|
143
|
+
maxTokens: caps.maxTokens
|
|
144
|
+
};
|
|
145
|
+
const headers = { ...input.defaultHeaders ?? {}, ...builtin?.headers ?? {}, ...targetHeaders ?? {} };
|
|
146
|
+
if (Object.keys(headers).length > 0) {
|
|
147
|
+
model.headers = headers;
|
|
148
|
+
}
|
|
149
|
+
return model;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
mergeCapabilities,
|
|
154
|
+
supportsAgentRoleTools,
|
|
155
|
+
AGENT_ROLE_TOOLS_REQUIRED_REASON,
|
|
156
|
+
catalogProviderForRuntime,
|
|
157
|
+
listCatalogModelsForRuntime,
|
|
158
|
+
resolveEffectivePricing,
|
|
159
|
+
resolveCostProvenance,
|
|
160
|
+
getCatalogModelForRuntime,
|
|
161
|
+
capabilitiesFromCatalogModel,
|
|
162
|
+
catalogThinkingLevelsForRuntime,
|
|
163
|
+
synthesizeCatalogBackedModel
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=chunk-PT7HYKEM.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/safety/rigor.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
var VALIDATION_CONTRACT_FILES = [
|
|
11
|
+
path.join(".clio-coder", "validation.yaml"),
|
|
12
|
+
path.join(".clio-coder", "validation.yml"),
|
|
13
|
+
"validation.yaml",
|
|
14
|
+
"validation.yml",
|
|
15
|
+
"VALIDATION.md"
|
|
16
|
+
];
|
|
17
|
+
function resolveRigor(options) {
|
|
18
|
+
if (options.override === "high" || options.override === "normal") return options.override;
|
|
19
|
+
const cwd = options.cwd ?? process.cwd();
|
|
20
|
+
return hasValidationContract(cwd) ? "high" : "normal";
|
|
21
|
+
}
|
|
22
|
+
function parseRigorOverride(value) {
|
|
23
|
+
if (typeof value !== "string") return null;
|
|
24
|
+
const normalized = value.trim().toLowerCase();
|
|
25
|
+
if (normalized === "high") return "high";
|
|
26
|
+
if (normalized === "normal") return "normal";
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function hasValidationContract(cwd) {
|
|
30
|
+
try {
|
|
31
|
+
return VALIDATION_CONTRACT_FILES.some((relative) => existsSync(path.join(cwd, relative)));
|
|
32
|
+
} catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
resolveRigor,
|
|
39
|
+
parseRigorOverride
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-RVG5JXAL.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __clioCreateRequire } from "node:module"; const requir
|
|
|
2
2
|
import {
|
|
3
3
|
cwdHash,
|
|
4
4
|
sessionPaths
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3BINW3FP.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
8
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -610,4 +610,4 @@ export {
|
|
|
610
610
|
snapshotInputTokens,
|
|
611
611
|
reconcileSnapshot
|
|
612
612
|
};
|
|
613
|
-
//# sourceMappingURL=chunk-
|
|
613
|
+
//# sourceMappingURL=chunk-RWSI4YD7.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
readRootEntries,
|
|
4
4
|
splitYamlFrontmatter,
|
|
5
5
|
stringField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DGSYXYMX.js";
|
|
7
7
|
import {
|
|
8
8
|
enabledExtensionResourceRoots
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DYIM5TJT.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";
|
|
@@ -159,24 +159,38 @@ function optionalString(value) {
|
|
|
159
159
|
function indexAudit(value) {
|
|
160
160
|
return value === "pass" || value === "warn" || value === "fail" || value === "unknown" ? value : void 0;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function parseMarketplaceIndex(indexPath, diagnostics = []) {
|
|
163
163
|
try {
|
|
164
164
|
const parsed = JSON.parse(readFileSync(indexPath, "utf8"));
|
|
165
165
|
const rawSkills = Array.isArray(parsed) ? parsed : parsed && typeof parsed === "object" && Array.isArray(parsed.skills) ? parsed.skills : [];
|
|
166
|
-
return rawSkills.filter(isIndexSkill).
|
|
166
|
+
return rawSkills.filter(isIndexSkill).flatMap((skill) => {
|
|
167
167
|
const record = skill;
|
|
168
168
|
const version = optionalString(record.version);
|
|
169
169
|
const audit = indexAudit(record.audit);
|
|
170
170
|
const category = optionalString(record.category);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
if (record.kind !== void 0 && !["skill", "agent", "prompt", "fleet"].includes(String(record.kind))) {
|
|
172
|
+
diagnostics.push(`skill marketplace index entry has unsupported kind: ${skill.name}`);
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
if (record.requires !== void 0 && (!Array.isArray(record.requires) || record.requires.some((entry) => typeof entry !== "string"))) {
|
|
176
|
+
diagnostics.push(`library_requirement_malformed: ${skill.name}`);
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
const kind = record.kind === "agent" || record.kind === "prompt" || record.kind === "fleet" ? record.kind : "skill";
|
|
180
|
+
const requires = Array.isArray(record.requires) ? record.requires.filter((entry) => typeof entry === "string") : void 0;
|
|
181
|
+
return [
|
|
182
|
+
{
|
|
183
|
+
kind,
|
|
184
|
+
name: skill.name.trim(),
|
|
185
|
+
description: skill.description.trim(),
|
|
186
|
+
sourceUrl: skill.sourceUrl.trim(),
|
|
187
|
+
...version ? { version } : {},
|
|
188
|
+
...audit ? { audit } : {},
|
|
189
|
+
...category ? { category } : {},
|
|
190
|
+
...requires ? { requires } : {},
|
|
191
|
+
origin: "index"
|
|
192
|
+
}
|
|
193
|
+
];
|
|
180
194
|
});
|
|
181
195
|
} catch (err) {
|
|
182
196
|
diagnostics.push(`skill marketplace index unreadable: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -228,7 +242,8 @@ function catalogEntry(skill, catalogDir) {
|
|
|
228
242
|
...version ? { version } : {},
|
|
229
243
|
...skill.provenance?.audit ? { audit: skill.provenance.audit } : {},
|
|
230
244
|
...category ? { category } : {},
|
|
231
|
-
origin: "catalog"
|
|
245
|
+
origin: "catalog",
|
|
246
|
+
kind: "skill"
|
|
232
247
|
};
|
|
233
248
|
}
|
|
234
249
|
function catalogSkills(dir, diagnostics) {
|
|
@@ -253,7 +268,7 @@ function discoverMarketplaceSkills(options = {}) {
|
|
|
253
268
|
const indexPath = options.indexPath === null ? null : options.indexPath ?? process.env.CLIO_CODER_SKILL_MARKETPLACE_INDEX ?? null;
|
|
254
269
|
const resolvedIndexPath = indexPath ?? defaultIndexPath();
|
|
255
270
|
if (options.indexPath !== null && resolvedIndexPath && existsSync(resolvedIndexPath)) {
|
|
256
|
-
for (const skill of
|
|
271
|
+
for (const skill of parseMarketplaceIndex(resolvedIndexPath, diagnostics)) {
|
|
257
272
|
if (seen.has(skill.name)) continue;
|
|
258
273
|
seen.add(skill.name);
|
|
259
274
|
skills.push(skill);
|
|
@@ -1167,6 +1182,7 @@ function updateSkills(input = {}) {
|
|
|
1167
1182
|
}
|
|
1168
1183
|
|
|
1169
1184
|
export {
|
|
1185
|
+
normalizedSkillHash,
|
|
1170
1186
|
updateSkills,
|
|
1171
1187
|
MARKETPLACE_UNCONFIGURED,
|
|
1172
1188
|
discoverMarketplaceSkills,
|
|
@@ -1179,4 +1195,4 @@ export {
|
|
|
1179
1195
|
expandSkillInvocationInput,
|
|
1180
1196
|
parsePendingSkillRequests
|
|
1181
1197
|
};
|
|
1182
|
-
//# sourceMappingURL=chunk-
|
|
1198
|
+
//# sourceMappingURL=chunk-TANS5ZJS.js.map
|