@claudexor/harness-claude 3.13.0 → 3.14.0
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/dist/capability-profile.d.ts +12 -7
- package/dist/capability-profile.d.ts.map +1 -1
- package/dist/capability-profile.js +14 -10
- package/dist/capability-profile.js.map +1 -1
- package/dist/effort-probe.d.ts +21 -6
- package/dist/effort-probe.d.ts.map +1 -1
- package/dist/effort-probe.js +77 -17
- package/dist/effort-probe.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -21
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts +7 -0
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +8 -1
- package/dist/interactive.js.map +1 -1
- package/dist/model-probe.d.ts +109 -0
- package/dist/model-probe.d.ts.map +1 -0
- package/dist/model-probe.js +396 -0
- package/dist/model-probe.js.map +1 -0
- package/dist/vendor-cli-version.d.ts +7 -5
- package/dist/vendor-cli-version.d.ts.map +1 -1
- package/dist/vendor-cli-version.js +8 -6
- package/dist/vendor-cli-version.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live Claude model inventory from the prompt-free `initialize` handshake.
|
|
3
|
+
*
|
|
4
|
+
* The installed `claude` CLI answers a bare `initialize` control_request on
|
|
5
|
+
* stdin with its model picker (`models[]`: the selectors `--model` accepts,
|
|
6
|
+
* what each resolves to, a display name) and exits 0 on stdin EOF, without a
|
|
7
|
+
* prompt, without a generation, and — with the flags below — without a login
|
|
8
|
+
* (live-measured 2.1.280: 0.2 s, one stdout line, zero stderr). That answer is
|
|
9
|
+
* the ONE producer behind the adapter's `models()`, so a model the vendor ships
|
|
10
|
+
* after this release is selectable without a Claudexor release per model.
|
|
11
|
+
*
|
|
12
|
+
* What the picker is and is not (INV-104): it proves PRESENCE — "this binary,
|
|
13
|
+
* on this route, offers these selectors" — never absence. It accepts ids it
|
|
14
|
+
* does not list (`claude-opus-5-5`, older exact ids), it is modulated by the
|
|
15
|
+
* account (an API key adds `sonnet[1m]`, a Max plan changes the Fable row),
|
|
16
|
+
* and it ECHOES local configuration as fabricated rows (`--model`,
|
|
17
|
+
* `ANTHROPIC_MODEL`, a settings.json `model`; live-measured). Hence:
|
|
18
|
+
* `CLAUDE_MODEL_INVENTORY` declares absence ADVISORY, the probe never passes
|
|
19
|
+
* `--model`, runs with `--setting-sources ""` (no hooks, no settings echo) and
|
|
20
|
+
* `--strict-mcp-config`, scrubs the model-override env, and every consumer
|
|
21
|
+
* gets the frozen `CLAUDE_KNOWN_MODELS` ids appended as `origin: "hint"` rows —
|
|
22
|
+
* presence never shrinks below today's manifest, even when the binary is gone.
|
|
23
|
+
*
|
|
24
|
+
* Scopes (owner decision 2026-09-24, Q5=A: an account view reads the account):
|
|
25
|
+
* - PROFILE-BOUND, `config_dir_login`: the profile's own `CLAUDE_CONFIG_DIR`
|
|
26
|
+
* and keychain bridge exactly as its runs use, bootstrap allowed, so the
|
|
27
|
+
* account's own rows (server-provided options, org default, entitlement
|
|
28
|
+
* filtering) appear in account views.
|
|
29
|
+
* - PROFILE-BOUND, `api_key` / `oauth_token`: the profile's own credential in
|
|
30
|
+
* the env var its runs use (`ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`),
|
|
31
|
+
* under a scratch `HOME` + `CLAUDE_CONFIG_DIR`, bootstrap allowed — the
|
|
32
|
+
* picker an API-key account sees (`sonnet[1m]`, …) is not the logged-out
|
|
33
|
+
* menu. The cache key is the profile id; no secret byte ever keys anything.
|
|
34
|
+
* - BINARY-ONLY (no profile — the unscoped listing): a disposable scratch
|
|
35
|
+
* `HOME` + `CLAUDE_CONFIG_DIR` under the Claudexor-owned state root and
|
|
36
|
+
* `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` — no credential is read,
|
|
37
|
+
* nothing outside the scratch dir is written.
|
|
38
|
+
*
|
|
39
|
+
* One cached single-flight capture per (scope, binary identity): concurrent
|
|
40
|
+
* callers share one child, a caller's abort never reaches it, answers live for
|
|
41
|
+
* an hour, failures for a minute, and a binary that changes on disk is
|
|
42
|
+
* re-probed on the next call without a daemon restart.
|
|
43
|
+
*/
|
|
44
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
45
|
+
import { join } from "node:path";
|
|
46
|
+
import { composeBaseEnv, harnessBinaryIdentity, harnessBinaryIdentityOnPath, providerScrubEnv, runCapture, } from "@claudexor/core";
|
|
47
|
+
import { resolveSecret } from "@claudexor/secrets";
|
|
48
|
+
import { ensureDir, nativeHarnessStateRoot } from "@claudexor/util";
|
|
49
|
+
import { CLAUDE_KNOWN_MODELS } from "./capability-profile.js";
|
|
50
|
+
import { BIN } from "./effort-probe.js";
|
|
51
|
+
import { claudeNativeEnv } from "./index.js";
|
|
52
|
+
import { CLAUDE_INIT_REQUEST_ID } from "./interactive.js";
|
|
53
|
+
import { canonicalProfileConfigDir } from "./profile.js";
|
|
54
|
+
/**
|
|
55
|
+
* The manifest declaration of what `models()` proves — kept beside the
|
|
56
|
+
* producer so the two halves cannot drift apart (INV-104, codex precedent).
|
|
57
|
+
* `model_inventory_routes` is OMITTED on purpose: the picker answers on every
|
|
58
|
+
* route (logged out included), so the producer serves unscoped queries too.
|
|
59
|
+
*/
|
|
60
|
+
export const CLAUDE_MODEL_INVENTORY = {
|
|
61
|
+
model_inventory_absence: "advisory",
|
|
62
|
+
};
|
|
63
|
+
/** Exactly what the probe spawns. NEVER `--model`: the picker echoes it back
|
|
64
|
+
* as a fabricated row with an invented effort ladder. */
|
|
65
|
+
export const CLAUDE_MODEL_PROBE_ARGS = [
|
|
66
|
+
"-p",
|
|
67
|
+
"--input-format",
|
|
68
|
+
"stream-json",
|
|
69
|
+
"--output-format",
|
|
70
|
+
"stream-json",
|
|
71
|
+
"--verbose",
|
|
72
|
+
"--setting-sources",
|
|
73
|
+
"",
|
|
74
|
+
"--strict-mcp-config",
|
|
75
|
+
];
|
|
76
|
+
export const CLAUDE_MODEL_PROBE_TIMEOUT_MS = 10_000;
|
|
77
|
+
export const CLAUDE_MODEL_PROBE_TTL_MS = 60 * 60_000;
|
|
78
|
+
export const CLAUDE_MODEL_PROBE_FAILURE_TTL_MS = 60_000;
|
|
79
|
+
/** Same bound and eviction as the codex effort cache: expired first, then
|
|
80
|
+
* oldest-inserted. The population is tiny (one binary × one scope per
|
|
81
|
+
* profile), so eviction only ever bites a rotated binary's dead keys. */
|
|
82
|
+
const CLAUDE_MODEL_PROBE_CACHE_MAX_ENTRIES = 64;
|
|
83
|
+
/** The one stdin frame: the initialize handshake interactive runs also open with. */
|
|
84
|
+
export function claudeInitializeFrame() {
|
|
85
|
+
return (JSON.stringify({
|
|
86
|
+
type: "control_request",
|
|
87
|
+
request_id: CLAUDE_INIT_REQUEST_ID,
|
|
88
|
+
request: { subtype: "initialize" },
|
|
89
|
+
}) + "\n");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Pure parse of the probe's stdout: the line whose `control_response` answers
|
|
93
|
+
* OUR request id with `subtype: "success"` and a `models` array. Hook frames
|
|
94
|
+
* (`system/hook_started`, …) may precede it, so the frame is selected by id,
|
|
95
|
+
* never by position. Anything else — no such frame, an error subtype, a
|
|
96
|
+
* non-array picker — is a probe failure (`null`), never "no models".
|
|
97
|
+
* `description`, effort fields and `supportsFastMode` are deliberately not
|
|
98
|
+
* read (no per-model effort harvesting in v1; no regex over model prose).
|
|
99
|
+
*/
|
|
100
|
+
export function parseClaudeInitialize(stdout, requestId) {
|
|
101
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
102
|
+
if (!line.trim())
|
|
103
|
+
continue;
|
|
104
|
+
let frame;
|
|
105
|
+
try {
|
|
106
|
+
frame = JSON.parse(line);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (!isRecord(frame) || frame["type"] !== "control_response")
|
|
112
|
+
continue;
|
|
113
|
+
const response = frame["response"];
|
|
114
|
+
if (!isRecord(response) || response["request_id"] !== requestId)
|
|
115
|
+
continue;
|
|
116
|
+
if (response["subtype"] !== "success")
|
|
117
|
+
return null;
|
|
118
|
+
const body = response["response"];
|
|
119
|
+
const models = isRecord(body) ? body["models"] : undefined;
|
|
120
|
+
if (!Array.isArray(models))
|
|
121
|
+
return null;
|
|
122
|
+
const rows = [];
|
|
123
|
+
for (const row of models) {
|
|
124
|
+
if (!isRecord(row))
|
|
125
|
+
continue;
|
|
126
|
+
const value = row["value"];
|
|
127
|
+
if (typeof value !== "string" || !value.trim())
|
|
128
|
+
continue;
|
|
129
|
+
rows.push({
|
|
130
|
+
value,
|
|
131
|
+
displayName: nonBlank(row["displayName"]),
|
|
132
|
+
resolvedModel: nonBlank(row["resolvedModel"]),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return { models: rows };
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function isRecord(value) {
|
|
140
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
141
|
+
}
|
|
142
|
+
function nonBlank(value) {
|
|
143
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The rows every consumer sees, in this order and deduplicated by exact id:
|
|
147
|
+
* 1. each picker selector verbatim (`origin: "live"`, `resolved_model` = what
|
|
148
|
+
* the vendor says it resolves to; the alias→resolution link stays on the
|
|
149
|
+
* alias row);
|
|
150
|
+
* 2. each resolution not already a row of its own (`origin: "live"`) — a
|
|
151
|
+
* vendor-endorsed exact id a dropdown can pin (owner Q7: no free text);
|
|
152
|
+
* 3. every frozen `CLAUDE_KNOWN_MODELS` id not already present
|
|
153
|
+
* (`origin: "hint"`) — the presence floor, which is ALL of the answer when
|
|
154
|
+
* the probe failed. `context_window: null` always (the only sources would
|
|
155
|
+
* be the `[1m]` suffix or description prose); `routes: null` (the answer
|
|
156
|
+
* already reflects the route it ran under).
|
|
157
|
+
*/
|
|
158
|
+
export function claudeModelRows(answer) {
|
|
159
|
+
const rows = [];
|
|
160
|
+
const seen = new Set();
|
|
161
|
+
const push = (id, label, origin, resolvedModel) => {
|
|
162
|
+
if (seen.has(id))
|
|
163
|
+
return;
|
|
164
|
+
seen.add(id);
|
|
165
|
+
rows.push({
|
|
166
|
+
id,
|
|
167
|
+
label,
|
|
168
|
+
context_window: null,
|
|
169
|
+
routes: null,
|
|
170
|
+
origin,
|
|
171
|
+
resolved_model: resolvedModel,
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
for (const row of answer?.models ?? [])
|
|
175
|
+
push(row.value, row.displayName, "live", row.resolvedModel);
|
|
176
|
+
for (const row of answer?.models ?? []) {
|
|
177
|
+
if (row.resolvedModel !== null)
|
|
178
|
+
push(row.resolvedModel, null, "live", null);
|
|
179
|
+
}
|
|
180
|
+
for (const id of CLAUDE_KNOWN_MODELS)
|
|
181
|
+
push(id, null, "hint", null);
|
|
182
|
+
return rows;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Which store the probe reads. A `config_dir_login` profile is probed under
|
|
186
|
+
* its OWN config dir; an `api_key` / `oauth_token` profile with its OWN
|
|
187
|
+
* credential in the env var its runs use; no profile (the unscoped listing)
|
|
188
|
+
* gets the credential-free binary probe. The scope key is the account half of
|
|
189
|
+
* the cache key; it never carries secret bytes (a config dir path or a profile
|
|
190
|
+
* id, not a token).
|
|
191
|
+
*/
|
|
192
|
+
export function claudeModelProbeScope(spec) {
|
|
193
|
+
const profile = spec?.credentialProfile;
|
|
194
|
+
if (profile?.credential_kind === "config_dir_login") {
|
|
195
|
+
const configDir = canonicalProfileConfigDir(profile.isolation_locator ?? "");
|
|
196
|
+
return { kind: "profile", key: `config:${configDir}`, configDir };
|
|
197
|
+
}
|
|
198
|
+
if (profile?.credential_kind === "api_key" || profile?.credential_kind === "oauth_token") {
|
|
199
|
+
return {
|
|
200
|
+
kind: "credential",
|
|
201
|
+
key: `credential:${profile.profile_id}`,
|
|
202
|
+
envKey: profile.credential_kind === "api_key" ? "ANTHROPIC_API_KEY" : "CLAUDE_CODE_OAUTH_TOKEN",
|
|
203
|
+
secretRef: profile.secret_ref ?? null,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return { kind: "binary", key: "binary" };
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Env keys whose value the picker echoes as a fabricated row (`ANTHROPIC_MODEL`)
|
|
210
|
+
* or folds into `resolvedModel` (`ANTHROPIC_DEFAULT_<FAMILY>_MODEL`,
|
|
211
|
+
* live-measured). Matched on the KEY NAME so any future family is covered.
|
|
212
|
+
*/
|
|
213
|
+
function isModelOverrideEnvKey(key) {
|
|
214
|
+
return key === "ANTHROPIC_MODEL" || /^ANTHROPIC_DEFAULT_[A-Z0-9_]*MODEL$/.test(key);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The env PATCH the probe child spawns under (applied by `runCapture` over the
|
|
218
|
+
* normalized host env; `null` deletes). Provider secrets are scrubbed on every
|
|
219
|
+
* scope; the profile scope re-adds nothing (the keychain bridge IS the
|
|
220
|
+
* credential transport), the credential scope re-adds exactly the profile's
|
|
221
|
+
* own variable, and both credential-free scopes point HOME/config at the
|
|
222
|
+
* scratch dir. Every model-override key present anywhere in the effective env
|
|
223
|
+
* is deleted explicitly so the answer describes the binary, not this host.
|
|
224
|
+
*/
|
|
225
|
+
export function claudeModelProbeEnv(scope, base, scratchDir, secret = null) {
|
|
226
|
+
const patch = scope.kind === "profile"
|
|
227
|
+
? { ...claudeNativeEnv(base, scope.configDir) }
|
|
228
|
+
: {
|
|
229
|
+
...(base ?? {}),
|
|
230
|
+
...providerScrubEnv(),
|
|
231
|
+
HOME: scratchDir,
|
|
232
|
+
USERPROFILE: scratchDir,
|
|
233
|
+
CLAUDE_CONFIG_DIR: scratchDir,
|
|
234
|
+
// A credential scope needs the bootstrap (its rows come from the
|
|
235
|
+
// account); the binary scope must not talk to anyone.
|
|
236
|
+
...(scope.kind === "credential"
|
|
237
|
+
? { [scope.envKey]: secret }
|
|
238
|
+
: { CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1" }),
|
|
239
|
+
};
|
|
240
|
+
for (const key of [...Object.keys(composeBaseEnv("mirror_native")), ...Object.keys(patch)]) {
|
|
241
|
+
if (isModelOverrideEnvKey(key))
|
|
242
|
+
patch[key] = null;
|
|
243
|
+
}
|
|
244
|
+
return patch;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Which bytes the probe will run, resolved exactly the way the spawn layer
|
|
248
|
+
* resolves a bare `claude`: the normalized host env, unless the caller's env
|
|
249
|
+
* patch carries a PATH — the spawn layer applies that patch verbatim over the
|
|
250
|
+
* normalized env, so such a child resolves on the patch PATH alone and the
|
|
251
|
+
* probe must not re-normalize it (it would key and capture the managed binary
|
|
252
|
+
* while the run executes the override). The probe's own HOME overrides are
|
|
253
|
+
* never applied here either.
|
|
254
|
+
*/
|
|
255
|
+
function probeBinaryIdentity(base, deps) {
|
|
256
|
+
const patchPath = base?.["PATH"];
|
|
257
|
+
if (typeof patchPath === "string") {
|
|
258
|
+
return (deps.binaryIdentityOnPath ?? harnessBinaryIdentityOnPath)(BIN, patchPath);
|
|
259
|
+
}
|
|
260
|
+
return (deps.binaryIdentity ?? harnessBinaryIdentity)(BIN, composeBaseEnv("mirror_native"));
|
|
261
|
+
}
|
|
262
|
+
const cache = new Map();
|
|
263
|
+
const pending = new Map();
|
|
264
|
+
/** Drop every cached answer and forget in-flight probes (tests). A login or
|
|
265
|
+
* logout changes the account half of a profile scope, and nothing calls this
|
|
266
|
+
* on that path today: such a profile can serve its previous rows for up to
|
|
267
|
+
* the hour-long TTL, and `fresh: true` on the query is the bypass. */
|
|
268
|
+
export function clearClaudeModelProbeCache() {
|
|
269
|
+
cache.clear();
|
|
270
|
+
pending.clear();
|
|
271
|
+
}
|
|
272
|
+
function store(key, entry, nowMs) {
|
|
273
|
+
for (const [k, v] of cache)
|
|
274
|
+
if (v.expiresAtMs <= nowMs)
|
|
275
|
+
cache.delete(k);
|
|
276
|
+
cache.delete(key);
|
|
277
|
+
while (cache.size >= CLAUDE_MODEL_PROBE_CACHE_MAX_ENTRIES) {
|
|
278
|
+
const oldest = cache.keys().next();
|
|
279
|
+
if (oldest.done)
|
|
280
|
+
break;
|
|
281
|
+
cache.delete(oldest.value);
|
|
282
|
+
}
|
|
283
|
+
cache.set(key, entry);
|
|
284
|
+
}
|
|
285
|
+
function cacheKey(scope, identity) {
|
|
286
|
+
// A JSON array, never a joined string: two halves are paths.
|
|
287
|
+
return JSON.stringify([scope.key, identity.path, identity.ino, identity.size, identity.mtimeMs]);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* One capture. Spawns the exact identity path (so the bytes probed are the
|
|
291
|
+
* bytes keyed), in a fresh scratch cwd that is never a repository (a `-p`
|
|
292
|
+
* start inside a repo would load its project hooks and `.mcp.json`), and
|
|
293
|
+
* removes the scratch dir afterwards whatever happened. Null = failure.
|
|
294
|
+
*/
|
|
295
|
+
async function captureOnce(scope, base, identity, capture, secret) {
|
|
296
|
+
const root = join(nativeHarnessStateRoot(), "claude", "model-probe");
|
|
297
|
+
ensureDir(root);
|
|
298
|
+
const scratch = mkdtempSync(join(root, "probe-"));
|
|
299
|
+
try {
|
|
300
|
+
const result = await capture(identity.path, [...CLAUDE_MODEL_PROBE_ARGS], {
|
|
301
|
+
env: claudeModelProbeEnv(scope, base, scratch, secret),
|
|
302
|
+
cwd: scratch,
|
|
303
|
+
input: claudeInitializeFrame(),
|
|
304
|
+
timeoutMs: CLAUDE_MODEL_PROBE_TIMEOUT_MS,
|
|
305
|
+
cancelSignal: "SIGTERM",
|
|
306
|
+
cancelKillDelayMs: 0,
|
|
307
|
+
});
|
|
308
|
+
// A killed or timed-out child may have flushed a complete-looking line
|
|
309
|
+
// before the signal landed; those bytes are not a fresh vendor answer.
|
|
310
|
+
if (result.signal !== null)
|
|
311
|
+
return null;
|
|
312
|
+
return parseClaudeInitialize(result.stdout, CLAUDE_INIT_REQUEST_ID);
|
|
313
|
+
}
|
|
314
|
+
finally {
|
|
315
|
+
rmSync(scratch, { recursive: true, force: true });
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* The adapter's `models()`: TOTAL and never empty. Any failure — the binary
|
|
320
|
+
* missing, a spawn error, a timeout/signal, an unparseable answer, an env
|
|
321
|
+
* derivation error (bad profile locator, keychain bridge) — yields the hint
|
|
322
|
+
* rows alone, so presence never shrinks below the manifest and a listing can
|
|
323
|
+
* never make a caller believe the account has no models.
|
|
324
|
+
*/
|
|
325
|
+
export async function probeClaudeModels(spec, deps = {}) {
|
|
326
|
+
const fallback = () => claudeModelRows(null);
|
|
327
|
+
if (spec?.abortSignal?.aborted)
|
|
328
|
+
return fallback();
|
|
329
|
+
const nowMs = deps.nowMs ?? Date.now;
|
|
330
|
+
let key;
|
|
331
|
+
let flight;
|
|
332
|
+
try {
|
|
333
|
+
const scope = claudeModelProbeScope(spec);
|
|
334
|
+
// A credential profile whose secret is not stored cannot be probed as that
|
|
335
|
+
// account (its runs refuse too): hints, no spawn, nothing cached.
|
|
336
|
+
const secret = scope.kind === "credential" && scope.secretRef
|
|
337
|
+
? (deps.resolveProfileSecret ?? resolveSecret)(scope.secretRef)
|
|
338
|
+
: null;
|
|
339
|
+
if (scope.kind === "credential" && !secret)
|
|
340
|
+
return fallback();
|
|
341
|
+
const identity = probeBinaryIdentity(spec?.env, deps);
|
|
342
|
+
if (identity === null)
|
|
343
|
+
return fallback();
|
|
344
|
+
key = cacheKey(scope, identity);
|
|
345
|
+
if (!spec?.fresh) {
|
|
346
|
+
const hit = cache.get(key);
|
|
347
|
+
if (hit && hit.expiresAtMs > nowMs())
|
|
348
|
+
return [...hit.rows];
|
|
349
|
+
}
|
|
350
|
+
const inFlight = pending.get(key);
|
|
351
|
+
if (inFlight !== undefined)
|
|
352
|
+
return await awaitProbe(inFlight, spec?.abortSignal, fallback);
|
|
353
|
+
// The capture owns its own bound; no caller's signal reaches it, so one
|
|
354
|
+
// cancelled caller cannot hand every later caller a killed capture.
|
|
355
|
+
const started = nowMs();
|
|
356
|
+
flight = captureOnce(scope, spec?.env, identity, deps.runCapture ?? runCapture, secret)
|
|
357
|
+
.catch(() => null)
|
|
358
|
+
.then((answer) => {
|
|
359
|
+
const rows = claudeModelRows(answer);
|
|
360
|
+
// A probe superseded by a cache clear is not stored: its scope may no
|
|
361
|
+
// longer describe the store (login/logout changed it).
|
|
362
|
+
if (pending.get(key) === flight) {
|
|
363
|
+
const ttl = answer === null ? CLAUDE_MODEL_PROBE_FAILURE_TTL_MS : CLAUDE_MODEL_PROBE_TTL_MS;
|
|
364
|
+
store(key, { rows, expiresAtMs: started + ttl }, nowMs());
|
|
365
|
+
}
|
|
366
|
+
return rows;
|
|
367
|
+
})
|
|
368
|
+
.finally(() => {
|
|
369
|
+
if (pending.get(key) === flight)
|
|
370
|
+
pending.delete(key);
|
|
371
|
+
});
|
|
372
|
+
pending.set(key, flight);
|
|
373
|
+
}
|
|
374
|
+
catch {
|
|
375
|
+
return fallback();
|
|
376
|
+
}
|
|
377
|
+
return await awaitProbe(flight, spec?.abortSignal, fallback);
|
|
378
|
+
}
|
|
379
|
+
/** Bound only the CALLER's wait: an aborted caller reads the hint rows while
|
|
380
|
+
* the shared capture keeps running for everybody else. */
|
|
381
|
+
function awaitProbe(flight, signal, fallback) {
|
|
382
|
+
const settle = flight.then((rows) => [...rows], () => fallback());
|
|
383
|
+
if (!signal)
|
|
384
|
+
return settle;
|
|
385
|
+
if (signal.aborted)
|
|
386
|
+
return Promise.resolve(fallback());
|
|
387
|
+
return new Promise((resolve) => {
|
|
388
|
+
const onAbort = () => resolve(fallback());
|
|
389
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
390
|
+
void settle.then((rows) => {
|
|
391
|
+
signal.removeEventListener("abort", onAbort);
|
|
392
|
+
resolve(signal.aborted ? fallback() : rows);
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=model-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-probe.js","sourceRoot":"","sources":["../src/model-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,2BAA2B,EAC3B,gBAAgB,EAChB,UAAU,GAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAIzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,uBAAuB,EAAE,UAAU;CAIpC,CAAC;AAEF;yDACyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,IAAI;IACJ,gBAAgB;IAChB,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,EAAE;IACF,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GA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C3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAED;0DAC0D;AAC1D,SAAS,UAAU,CACjB,MAA+B,EAC/B,MAA+B,EAC/B,QAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CACxB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,EACnB,GAAG,EAAE,CAAC,QAAQ,EAAE,CACjB,CAAC;IACF,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,OAAO,CAAiB,CAAC,OAAO,EAAE,EAAE;QAC7C,MAAM,OAAO,GAAG,GAAS,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { PinnedVendorCliVersion } from "@claudexor/util";
|
|
2
2
|
/**
|
|
3
3
|
* The ONE Claude vendor-CLI version this Claudexor release is verified
|
|
4
|
-
* against — the pinned-install SSOT (issue #89).
|
|
4
|
+
* against — the pinned-install SSOT (issue #89). Two readers alias it and
|
|
5
5
|
* therefore can never drift apart:
|
|
6
|
-
* - `CLAUDE_KNOWN_MODELS_VERIFIED_AGAINST` (model-truth freshness gate),
|
|
7
6
|
* - `CLAUDE_EFFORT_SNAPSHOT_VERIFIED_AGAINST` (effort-snapshot trust gate),
|
|
8
7
|
* - the remote harness installer's exact `@anthropic-ai/claude-code@<v>` pin.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* `CLAUDE_KNOWN_MODELS_VERIFIED_AGAINST` deliberately does NOT alias it: that
|
|
9
|
+
* stamp records when the hint list was last actually re-verified, and a pin
|
|
10
|
+
* bump never re-checks model ids.
|
|
11
|
+
* Bump it ONLY while re-recording the effort snapshot (`--help` capture) and
|
|
12
|
+
* the recordable fixtures against the same CLI build — the stamp is a
|
|
13
|
+
* verification claim, not a wish.
|
|
12
14
|
*/
|
|
13
15
|
export declare const CLAUDE_VENDOR_CLI_VERSION: PinnedVendorCliVersion;
|
|
14
16
|
//# sourceMappingURL=vendor-cli-version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-cli-version.d.ts","sourceRoot":"","sources":["../src/vendor-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"vendor-cli-version.d.ts","sourceRoot":"","sources":["../src/vendor-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,EAAE,sBAAkC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The ONE Claude vendor-CLI version this Claudexor release is verified
|
|
3
|
-
* against — the pinned-install SSOT (issue #89).
|
|
3
|
+
* against — the pinned-install SSOT (issue #89). Two readers alias it and
|
|
4
4
|
* therefore can never drift apart:
|
|
5
|
-
* - `CLAUDE_KNOWN_MODELS_VERIFIED_AGAINST` (model-truth freshness gate),
|
|
6
5
|
* - `CLAUDE_EFFORT_SNAPSHOT_VERIFIED_AGAINST` (effort-snapshot trust gate),
|
|
7
6
|
* - the remote harness installer's exact `@anthropic-ai/claude-code@<v>` pin.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* `CLAUDE_KNOWN_MODELS_VERIFIED_AGAINST` deliberately does NOT alias it: that
|
|
8
|
+
* stamp records when the hint list was last actually re-verified, and a pin
|
|
9
|
+
* bump never re-checks model ids.
|
|
10
|
+
* Bump it ONLY while re-recording the effort snapshot (`--help` capture) and
|
|
11
|
+
* the recordable fixtures against the same CLI build — the stamp is a
|
|
12
|
+
* verification claim, not a wish.
|
|
11
13
|
*/
|
|
12
|
-
export const CLAUDE_VENDOR_CLI_VERSION = "2.1.
|
|
14
|
+
export const CLAUDE_VENDOR_CLI_VERSION = "2.1.281";
|
|
13
15
|
//# sourceMappingURL=vendor-cli-version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-cli-version.js","sourceRoot":"","sources":["../src/vendor-cli-version.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"vendor-cli-version.js","sourceRoot":"","sources":["../src/vendor-cli-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA2B,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudexor/harness-claude",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Claude Code adapter (claude -p --output-format stream-json).",
|
|
6
6
|
"type": "module",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@claudexor/core": "3.
|
|
20
|
-
"@claudexor/
|
|
21
|
-
"@claudexor/
|
|
22
|
-
"@claudexor/
|
|
19
|
+
"@claudexor/core": "3.14.0",
|
|
20
|
+
"@claudexor/util": "3.14.0",
|
|
21
|
+
"@claudexor/schema": "3.14.0",
|
|
22
|
+
"@claudexor/secrets": "3.14.0"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|