@iowarp/clio-coder 0.3.7 → 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 +31 -0
- package/README.md +7 -2
- package/dist/{acp-SK4MD6MM.js → acp-U67UHUK2.js} +13 -13
- package/dist/{agents-2FN2K6ME.js → agents-YU6SGALZ.js} +35 -33
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-QIYZWM5I.js → auth-5ZPJOIVG.js} +32 -24
- package/dist/builtins-C6JMZVV6.js +17 -0
- package/dist/{chunk-YD734TPH.js → chunk-26LEYJZH.js} +2 -2
- package/dist/{chunk-TSHXZTOQ.js → chunk-2HEJ2F35.js} +5 -5
- package/dist/{chunk-WJHBC77E.js → chunk-2HFZQUHL.js} +5 -5
- package/dist/{chunk-FO5ZOVUY.js → chunk-3BINW3FP.js} +5 -5
- package/dist/{chunk-EOOQZZDE.js → chunk-4SPRNWDE.js} +18 -18
- package/dist/{chunk-EBEFWSGL.js → chunk-5DHKRSMQ.js} +7 -7
- package/dist/{chunk-OBMAI2DP.js → chunk-5H3GB5BO.js} +11 -9
- package/dist/{chunk-JTSEDYVQ.js → chunk-5Q2VVUKB.js} +7 -7
- package/dist/{chunk-VQNODYQ4.js → chunk-7RFXX52T.js} +294 -3704
- package/dist/{chunk-XEGB6BCN.js → chunk-7RGZWPB6.js} +5 -5
- package/dist/{chunk-GH5622CP.js → chunk-A2NJGIB3.js} +2 -2
- package/dist/{chunk-CEYBNUGC.js → chunk-A3WNZD3P.js} +323 -27
- package/dist/{chunk-D4MDIG46.js → chunk-B5CSFE7B.js} +7 -7
- package/dist/{chunk-2SFS6XQE.js → chunk-DGSYXYMX.js} +3 -2
- package/dist/{chunk-ZWLZP4ZT.js → chunk-DYIM5TJT.js} +98 -12
- package/dist/{chunk-KCMKRQX4.js → chunk-E77JEWSD.js} +42 -49
- package/dist/{chunk-J7PIKKWC.js → chunk-EMYUUSFG.js} +7 -7
- package/dist/{chunk-JRIO5UD2.js → chunk-EQ63NRB7.js} +5 -5
- package/dist/{chunk-UVDSQ6LW.js → chunk-FBVTI2TJ.js} +74 -28
- package/dist/{chunk-BMWK7ZIZ.js → chunk-FHJEP5SW.js} +13 -13
- package/dist/{chunk-FOT2FX5J.js → chunk-GN57SG4G.js} +7 -7
- package/dist/{chunk-SROCI7ZU.js → chunk-GPIEI3LY.js} +5 -5
- package/dist/{chunk-UFQ3F4FW.js → chunk-GU2UIAFZ.js} +4 -4
- package/dist/{chunk-UND3GU2L.js → chunk-H7IXIC72.js} +2 -2
- package/dist/{chunk-VREKEFLL.js → chunk-HLE42MG7.js} +3 -3
- package/dist/{chunk-465YSENW.js → chunk-IFBNV6H6.js} +3 -3
- package/dist/{chunk-LADCF22A.js → chunk-IGWKHNIQ.js} +113 -54
- package/dist/chunk-IIZWH4XA.js +172 -0
- package/dist/{chunk-UHXRNZ2J.js → chunk-IJ7RPIYJ.js} +4 -4
- package/dist/{chunk-M4AKACEO.js → chunk-J3YUBZWY.js} +2 -2
- package/dist/{chunk-AB4XIIVB.js → chunk-JOZYP4GM.js} +6 -6
- package/dist/{chunk-ZGH7FGS5.js → chunk-K4XHGFR5.js} +742 -12
- package/dist/{chunk-EELBMBT6.js → chunk-KTYTFRMB.js} +62 -5
- package/dist/chunk-LU7P4LHA.js +33 -0
- package/dist/{chunk-DQA7QLMD.js → chunk-ME6CCNFO.js} +9 -24
- package/dist/{chunk-KZ2H5X4G.js → chunk-MXKJU4JB.js} +88 -14
- package/dist/{chunk-DMD2AGVS.js → chunk-N22QMJKY.js} +20 -18
- package/dist/chunk-NMPKI6XL.js +3006 -0
- package/dist/chunk-NUGM5KR6.js +165 -0
- package/dist/{chunk-5C77SEEY.js → chunk-P43ETTHK.js} +2 -2
- package/dist/{chunk-JNXPYBB4.js → chunk-PMDBGQSJ.js} +2 -2
- package/dist/chunk-PT7HYKEM.js +165 -0
- package/dist/{chunk-GEYXPTRF.js → chunk-RWSI4YD7.js} +2 -2
- package/dist/{chunk-C4JBQ5SR.js → chunk-TANS5ZJS.js} +6 -6
- package/dist/{chunk-YTYFXUI3.js → chunk-TB5666IT.js} +9 -9
- package/dist/{chunk-UUANF5CR.js → chunk-TLQJPP24.js} +375 -687
- package/dist/{chunk-OB5HIGJY.js → chunk-TT36MB5S.js} +2 -1
- package/dist/{chunk-DJNLUABN.js → chunk-TTHACPOM.js} +135 -17
- package/dist/{chunk-6M7VS3J3.js → chunk-TYPGUK6W.js} +4 -4
- package/dist/{chunk-THKY7CD7.js → chunk-U6MBIEMB.js} +108 -24
- package/dist/{chunk-PD3MESLB.js → chunk-VAWNZU7Z.js} +4 -4
- package/dist/{chunk-IR4CFBFN.js → chunk-VCBR6CU7.js} +12 -12
- package/dist/{chunk-WHJYKASB.js → chunk-VHN4MY6O.js} +2 -2
- package/dist/{chunk-MXI6J5JF.js → chunk-VWZOAB7K.js} +10 -10
- package/dist/{chunk-QCTRSGHQ.js → chunk-WLFILSD5.js} +36 -36
- package/dist/{chunk-5UJ6ECTS.js → chunk-WNIJTQQK.js} +6 -6
- package/dist/{chunk-4DWFMQDR.js → chunk-WSB3FPX7.js} +68 -20
- package/dist/{chunk-3HAPLH5M.js → chunk-WWCZ5F23.js} +112 -10
- package/dist/{chunk-X2KV5FXT.js → chunk-WXY7KU3G.js} +2 -2
- package/dist/{chunk-PPAMZ32Z.js → chunk-XK56QHLX.js} +6 -1
- package/dist/{chunk-DOOEX22V.js → chunk-XWSF374K.js} +4 -4
- package/dist/{chunk-6TUKSZVF.js → chunk-YS5VLNH5.js} +8 -8
- 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 +31 -31
- package/dist/{clio-WBVQEBKO.js → clio-QVTYJ57A.js} +8 -8
- package/dist/code-nav-FGGFIE7L.js +2 -2
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-F7OEATSO.js → components-ZFA3SAER.js} +8 -8
- package/dist/{config-TRBL3RCF.js → config-LW5IJFQN.js} +58 -53
- package/dist/{configure-OLCVPHNM.js → configure-7XIZCOU4.js} +26 -21
- package/dist/{context-XEWE3MOJ.js → context-L3WL3X7K.js} +47 -41
- package/dist/{context-WFPKQSM6.js → context-N52ZA626.js} +22 -22
- package/dist/{context-MJIJ6GOX.js → context-Y6Y7QPR6.js} +12 -12
- package/dist/{context-clear-KNOS2JPB.js → context-clear-MBQRLSDQ.js} +47 -41
- package/dist/{context-index-SSR5ECNE.js → context-index-HVMFQHK3.js} +5 -5
- package/dist/{context-working-set-EUXAZI6N.js → context-working-set-GS6DSO7F.js} +14 -14
- package/dist/{dispatch-runner-B7MTOVKL.js → dispatch-runner-22ZCNOM3.js} +83 -55
- package/dist/{docs-FLJTIDSE.js → docs-7LQ23DLM.js} +8 -8
- package/dist/{doctor-RN4YKO2X.js → doctor-M7YEDGAE.js} +24 -20
- package/dist/{eval-RUBJVSNQ.js → eval-BEC2WHDA.js} +71 -19
- package/dist/{evidence-JZNBUOQZ.js → evidence-REJUMSKM.js} +62 -56
- package/dist/{evolve-FJVC4KKI.js → evolve-PY5ZBA5K.js} +41 -35
- package/dist/{extensions-IQL36S7K.js → extensions-HVKU65YU.js} +6 -6
- package/dist/{fleet-BDKYJFCP.js → fleet-7WZEWRFA.js} +72 -67
- package/dist/{fleet-commands-ZFIWZSB3.js → fleet-commands-UVHWM76J.js} +10 -10
- package/dist/{fleet-graph-Y6HPXIVF.js → fleet-graph-6ULH7PES.js} +13 -13
- package/dist/{fleet-preflight-BHSNPBMH.js → fleet-preflight-J53T6CCE.js} +5 -5
- package/dist/{fleet-validate-BIYREGIK.js → fleet-validate-72PC4SLA.js} +17 -17
- package/dist/{init-LQUB5COQ.js → init-OG3TPGQG.js} +61 -56
- package/dist/{library-NJAHIGG4.js → library-CNTMPLRF.js} +18 -18
- package/dist/{memory-OG6HOYKM.js → memory-6IS7F275.js} +43 -37
- package/dist/{models-5ZG5XY7J.js → models-ENRJDA5W.js} +33 -28
- package/dist/{monitor-TJ7AMTGB.js → monitor-XLDVO7TN.js} +56 -38
- package/dist/{orchestrator-WZYB54DM.js → orchestrator-6KSPYRHA.js} +421 -303
- package/dist/{paths-XUC7GS6E.js → paths-DBXMZMDU.js} +5 -5
- package/dist/registry-LG64LTF4.js +11 -0
- package/dist/{reset-PXQT45IY.js → reset-RZ4ER727.js} +10 -10
- package/dist/{run-FQ74YF62.js → run-Y2CNK5RU.js} +79 -74
- package/dist/{share-FW7SVCL3.js → share-A55GYP6Z.js} +16 -16
- package/dist/{skills-7E7IRB3R.js → skills-ALC5J6AT.js} +19 -19
- package/dist/{skills-eval-LI75W6OK.js → skills-eval-JPBEBYQU.js} +52 -47
- package/dist/support-MIETYA5E.js +38 -0
- package/dist/{targets-4CIFKCTW.js → targets-VGNXIR3S.js} +42 -33
- package/dist/{terminal-lease-WUZY7ZV5.js → terminal-lease-WOBR64YA.js} +3 -3
- package/dist/{uninstall-7FV7IP4E.js → uninstall-ZJF5H5ZN.js} +8 -8
- package/dist/{upgrade-K2HVIVMQ.js → upgrade-FUSUAGHR.js} +27 -25
- package/dist/{usage-GTZELZQX.js → usage-N4MKVHKD.js} +51 -46
- package/dist/{verifiers-RLAHT27O.js → verifiers-YAWOJ3H2.js} +13 -13
- package/dist/{verify-BX3BRKH5.js → verify-LTDHYBGY.js} +9 -9
- package/dist/{wiki-generate-ASIFASCN.js → wiki-generate-6M7GHTBJ.js} +66 -61
- package/dist/worker/entry.js +68 -61
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/artifact-versions.md +6 -5
- package/docs/built-in-agents.md +1 -1
- package/docs/commands-and-modes.md +2 -2
- package/docs/configuration-and-targets.md +8 -3
- package/docs/context-engine.md +1 -1
- package/docs/documentation-guide.md +1 -1
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +1 -1
- package/docs/evidence-and-memory.md +70 -6
- package/docs/evolution.md +1 -1
- package/docs/extensions-and-sharing.md +1 -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 +2 -2
- 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 +41 -38
- 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/tui-design.md +1 -1
- package/docs/worker-dispatch-mechanics.md +1 -1
- 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-preflight.ts +2 -12
- package/src/cli/shared.ts +1 -0
- package/src/cli/targets.ts +4 -1
- package/src/cli/validate-model.ts +60 -5
- package/src/core/bus-events.ts +25 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/path-boundary.ts +100 -0
- 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/context/project-rules.ts +51 -1
- package/src/domains/dispatch/assignment-reconcile.ts +22 -5
- package/src/domains/dispatch/assignment-store.ts +151 -14
- package/src/domains/dispatch/contract.ts +15 -1
- package/src/domains/dispatch/delegation-plan.ts +2 -5
- package/src/domains/dispatch/execution-role.ts +9 -1
- package/src/domains/dispatch/extension.ts +156 -67
- package/src/domains/dispatch/fleet-run.ts +57 -3
- package/src/domains/dispatch/gate-role-prompts.ts +38 -0
- package/src/domains/dispatch/index.ts +3 -1
- package/src/domains/dispatch/intent-requirements.ts +40 -0
- package/src/domains/dispatch/intent.ts +84 -8
- package/src/domains/dispatch/path-scope.ts +370 -0
- package/src/domains/dispatch/receipt-integrity.ts +2 -1
- package/src/domains/dispatch/types.ts +14 -7
- package/src/domains/dispatch/validation.ts +6 -3
- 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 +145 -17
- 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/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/prompts/loader.ts +119 -14
- 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/engine/acp/server.ts +4 -1
- package/src/engine/prompt-templates.ts +18 -1
- package/src/engine/worker-runtime.ts +6 -3
- package/src/interactive/dispatch-board.ts +53 -3
- package/src/interactive/interactive-event-projection.ts +14 -0
- package/src/interactive/overlays/settings.ts +141 -47
- package/src/interactive/slash-commands.ts +7 -2
- package/src/interactive/view/artifacts.ts +42 -9
- package/src/interactive/view/view-overlay.ts +15 -3
- package/src/interactive/worker-receipts.ts +14 -2
- package/src/interactive/worker-stream.ts +8 -0
- package/src/tools/dispatch-admission.ts +12 -13
- package/src/tools/dispatch-arguments.ts +27 -0
- package/src/tools/dispatch-plan.ts +29 -0
- package/src/tools/dispatch-runner.ts +48 -13
- package/src/tools/monitor.ts +13 -0
- package/src/tools/worker-evidence.ts +19 -13
- package/src/worker/spec-contract.ts +2 -1
|
@@ -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
|
|
@@ -2,7 +2,7 @@ import { createRequire as __clioCreateRequire } from "node:module"; const requir
|
|
|
2
2
|
import {
|
|
3
3
|
gateRouteCorrelation,
|
|
4
4
|
isExecutionRole
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H7IXIC72.js";
|
|
6
6
|
import {
|
|
7
7
|
isAgentCapabilityClass
|
|
8
8
|
} from "./chunk-AOCYTWAV.js";
|
|
@@ -995,4 +995,4 @@ export {
|
|
|
995
995
|
routingIntentRejection,
|
|
996
996
|
explainRouteDecision
|
|
997
997
|
};
|
|
998
|
-
//# 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
|
|
@@ -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";
|
|
@@ -1195,4 +1195,4 @@ export {
|
|
|
1195
1195
|
expandSkillInvocationInput,
|
|
1196
1196
|
parsePendingSkillRequests
|
|
1197
1197
|
};
|
|
1198
|
-
//# sourceMappingURL=chunk-
|
|
1198
|
+
//# sourceMappingURL=chunk-TANS5ZJS.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
parseTomlDocument,
|
|
4
|
-
tomlTableAt
|
|
5
|
-
} from "./chunk-LCGCVYZ4.js";
|
|
6
2
|
import {
|
|
7
3
|
verifyTool
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GU2UIAFZ.js";
|
|
9
5
|
import {
|
|
10
6
|
discoverDeclaredChecksAtRoot,
|
|
11
7
|
discoverDeclaredProjectEntriesAtRoot
|
|
12
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VAWNZU7Z.js";
|
|
9
|
+
import {
|
|
10
|
+
parseTomlDocument,
|
|
11
|
+
tomlTableAt
|
|
12
|
+
} from "./chunk-LCGCVYZ4.js";
|
|
13
13
|
import {
|
|
14
14
|
PROJECT_VERIFIER_CATALOG_CAPS,
|
|
15
15
|
PROJECT_VERIFIER_CATALOG_RELATIVE_PATH,
|
|
16
16
|
PROJECT_VERIFIER_CATALOG_VERSION,
|
|
17
17
|
compareCodepoints,
|
|
18
18
|
parseProjectVerifierCatalogText
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-A2NJGIB3.js";
|
|
20
20
|
import {
|
|
21
21
|
isVerificationScriptName
|
|
22
22
|
} from "./chunk-UL3WSD3F.js";
|
|
23
23
|
import {
|
|
24
24
|
SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
25
25
|
resolveSafeCwd
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-B5CSFE7B.js";
|
|
27
27
|
import {
|
|
28
28
|
require_dist
|
|
29
29
|
} from "./chunk-APJ265NV.js";
|
|
@@ -960,4 +960,4 @@ export {
|
|
|
960
960
|
previewVerifierDraft,
|
|
961
961
|
runVerifierAuthoringWorkflow
|
|
962
962
|
};
|
|
963
|
-
//# sourceMappingURL=chunk-
|
|
963
|
+
//# sourceMappingURL=chunk-TB5666IT.js.map
|