@claudexor/core 3.20.1 → 3.22.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/adapter.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AccountIdentity, AuthPreference, AuthSourceKind, ConformanceReport, CredentialProfile, CredentialProfileStatus, HarnessCapabilityProfile, HarnessEvent, HarnessManifest, HarnessModel, HarnessRunSpec, InteractionAnswerSet, InteractionRequest, ProcessingPreference, ProcessingReceipt, ProcessingCostBasis } from "@claudexor/schema";
1
+ import type { AccountIdentity, AuthPreference, AuthSourceKind, ConformanceReport, CredentialProfile, CredentialProfileStatus, EffortResolution, HarnessCapabilityProfile, HarnessEvent, HarnessManifest, HarnessModel, HarnessRunSpec, InteractionAnswerSet, InteractionRequest, ProcessingPreference, ProcessingReceipt, ProcessingCostBasis } from "@claudexor/schema";
2
2
  /** Accounts-only doctor receipt. Identity never widens generic HarnessStatus. */
3
3
  export interface HarnessAccountDoctorReceipt {
4
4
  report: ConformanceReport;
@@ -41,6 +41,12 @@ export interface PreparedHarnessProcessing {
41
41
  model: string | null;
42
42
  receipt: ProcessingReceipt;
43
43
  costBasis: ProcessingCostBasis;
44
+ /** Effort receipt of a model-id effort carrier (`effortParameter: "--model"`):
45
+ * produced by the SAME preparation that chose `model` and
46
+ * `receipt.submittedNative`, so the native id, the level token and the
47
+ * disclosure cannot disagree. Absent when the level is a separate flag the
48
+ * adapter resolves at spawn, or when the harness has no effort control. */
49
+ effort?: EffortResolution;
44
50
  }
45
51
  /**
46
52
  * Why a live message did not reach the model, filled from adapter/registry
@@ -72,7 +78,11 @@ export interface LiveMessageResult {
72
78
  */
73
79
  export interface HarnessAdapter {
74
80
  readonly id: string;
75
- /** Separate native effort carrier; the adapter resolves it at the final route. */
81
+ /** Native effort carrier the adapter resolves at its final route: a separate
82
+ * flag (`--effort`, `model_reasoning_effort`), or `--model` when the level is
83
+ * a token of a compound model id and `prepareProcessing` selects the listed
84
+ * variant of the requested model's family (Cursor, Antigravity). Absent = no
85
+ * effort control; the engine records the preference as omitted. */
76
86
  readonly effortParameter?: string;
77
87
  /**
78
88
  * Static capability declaration available without spawning the vendor CLI.
@@ -131,9 +141,87 @@ export interface HarnessAdapter {
131
141
  * `probeCredentialProfile`, not an additional probe: callers choose one.
132
142
  */
133
143
  probeCredentialAccount?(profile: CredentialProfile, abortSignal?: AbortSignal): Promise<CredentialAccountProbeReceipt>;
144
+ /**
145
+ * Optional continuity capability: locate the native session's holder file,
146
+ * move it into another account's store, type the vendor's rejection of
147
+ * carried state. Absent = no `native_moved` carrier for this harness;
148
+ * same-account resume keeps using `resume_session_id`, guarded by the
149
+ * engine-side session-id comparison.
150
+ */
151
+ continuity?: HarnessContinuityCapability;
134
152
  }
135
153
  /** A registry of available adapters keyed by harness id. */
136
154
  export type AdapterRegistry = Map<string, HarnessAdapter>;
155
+ /** Environment a harness child sees (the `HarnessRunSpec.env` shape, nullable values allowed). */
156
+ export type EnvMap = Record<string, string | null | undefined>;
157
+ /**
158
+ * The env key the engine sets on the EnvMap it hands to `continuity.locate` /
159
+ * `continuity.move`: the registry `isolation_locator` of the credential profile
160
+ * whose store holds (or will hold) the session. Absent = the harness's default
161
+ * native store. Each adapter maps it onto its own vendor variable with the same
162
+ * canonicalization its run route uses (claude `CLAUDE_CONFIG_DIR`, codex
163
+ * `CODEX_HOME`), so the engine never spells a vendor variable (INV-135).
164
+ */
165
+ export declare const CONTINUITY_PROFILE_LOCATOR_ENV = "CLAUDEXOR_PROFILE_LOCATOR";
166
+ /**
167
+ * The typed `payload.code` of the error event an adapter yields when the
168
+ * session it recovered at its earliest handshake is NOT the one
169
+ * `resume_session_id` asked for (codex: the `thread/resume` reply before
170
+ * `turn/start`). The engine reads only this code (never prose) and records
171
+ * `identityCheck: mismatch_before_effects`.
172
+ */
173
+ export declare const CONTINUITY_IDENTITY_MISMATCH_CODE = "resume_identity_mismatch";
174
+ /** A native session the adapter located: the concrete history file (the holder) plus sidecars. */
175
+ export interface LocatedNativeSession {
176
+ found: true;
177
+ /** Absolute path of the history file that holds the session. */
178
+ file: string;
179
+ mtimeMs: number;
180
+ /** Absolute paths of sibling state a move must carry (claude `<sid>/`, codex rollout parts). */
181
+ sidecars: string[];
182
+ }
183
+ export type ContinuityLocateResult = LocatedNativeSession | {
184
+ found: false;
185
+ };
186
+ export type ContinuityMoveResult = {
187
+ ok: true;
188
+ resumeRef: {
189
+ nativeSessionId: string;
190
+ };
191
+ retire?: () => void | Promise<void>;
192
+ } | {
193
+ ok: false;
194
+ reason: string;
195
+ };
196
+ /**
197
+ * Optional per-adapter continuity capability (session carriers across
198
+ * processes and accounts). Harness-specific mechanics live HERE; the engine
199
+ * sees typed results only.
200
+ *
201
+ * `move` places the session where the TARGET resume looks (claude:
202
+ * `<target locator>/projects/<enc(targetCwd)>/<sid>.jsonl` + `<sid>/`; codex:
203
+ * the same relative `sessions/` path under the target `CODEX_HOME`, every
204
+ * part), so resume by id works and `HarnessRunSpec` needs no path field.
205
+ * Order: copy → verify destination → the engine publishes the new holder in
206
+ * the capsule → invokes the returned `retire` step. Failed moves remove their
207
+ * destination copies and preserve the source. A failed destination never destroys the
208
+ * only history. Never credentials: no `auth.json`, no claude credential files.
209
+ */
210
+ export interface HarnessContinuityCapability {
211
+ locate(ref: {
212
+ nativeSessionId: string;
213
+ cwd: string;
214
+ }, env: EnvMap): Promise<ContinuityLocateResult>;
215
+ move(located: {
216
+ file: string;
217
+ sidecars: string[];
218
+ nativeSessionId?: string;
219
+ }, fromEnv: EnvMap, toEnv: EnvMap, targetCwd: string): Promise<ContinuityMoveResult>;
220
+ /** Adapter-internal typing of its vendor's own rejection of carried state
221
+ * (claude: an API 400 on a thinking signature; codex: `invalid_encrypted_content`).
222
+ * The orchestrator reads only this boolean, never the prose. */
223
+ rejectsCarriedState?(ev: HarnessEvent): boolean;
224
+ }
137
225
  /**
138
226
  * Imperative answer channel for interactive harness sessions.
139
227
  *
@@ -1 +1 @@
1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,iBAAiB,CAAC,IAAI,MAAM,CAAC;CAC9B;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,cAAc,GAAG,kBAAkB,GAAG,SAAS,CAK/F"}
package/dist/adapter.js CHANGED
@@ -1,3 +1,20 @@
1
+ /**
2
+ * The env key the engine sets on the EnvMap it hands to `continuity.locate` /
3
+ * `continuity.move`: the registry `isolation_locator` of the credential profile
4
+ * whose store holds (or will hold) the session. Absent = the harness's default
5
+ * native store. Each adapter maps it onto its own vendor variable with the same
6
+ * canonicalization its run route uses (claude `CLAUDE_CONFIG_DIR`, codex
7
+ * `CODEX_HOME`), so the engine never spells a vendor variable (INV-135).
8
+ */
9
+ export const CONTINUITY_PROFILE_LOCATOR_ENV = "CLAUDEXOR_PROFILE_LOCATOR";
10
+ /**
11
+ * The typed `payload.code` of the error event an adapter yields when the
12
+ * session it recovered at its earliest handshake is NOT the one
13
+ * `resume_session_id` asked for (codex: the `thread/resume` reply before
14
+ * `turn/start`). The engine reads only this code (never prose) and records
15
+ * `identityCheck: mismatch_before_effects`.
16
+ */
17
+ export const CONTINUITY_IDENTITY_MISMATCH_CODE = "resume_identity_mismatch";
1
18
  export function interactionChannelFromSpec(spec) {
2
19
  const channel = spec.extra?.["interactionChannel"];
3
20
  if (!channel || typeof channel !== "object")
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AA8MA,MAAM,UAAU,0BAA0B,CAAC,IAAoB;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACnD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,SAAS,GAAG,OAAsC,CAAC;IACzD,OAAO,OAAO,SAAS,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAE,OAA8B,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/F,CAAC"}
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AA8MA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,2BAA2B,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,CAAC;AAwE5E,MAAM,UAAU,0BAA0B,CAAC,IAAoB;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACnD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,SAAS,GAAG,OAAsC,CAAC;IACzD,OAAO,OAAO,SAAS,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAE,OAA8B,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { type EffortHint, type EffortResolution } from "@claudexor/schema";
2
+ /**
3
+ * Effort as a MODEL-ID carrier (Cursor, Antigravity). These CLIs expose no
4
+ * effort flag: the level is a token of a compound model id (`grok-4.7-xhigh`,
5
+ * `gemini-3.8-flash-high`). "One effort word on every route" therefore means
6
+ * choosing the LISTED sibling of the requested model's family (owner decision
7
+ * 2026-10-05, «2. B»): the model id names the family, the effort names the
8
+ * level, and the account's own model list decides what exists.
9
+ *
10
+ * Family = the id with exactly ONE shared-order level token removed. Every
11
+ * other token (`fast`, `thinking`, `codex`, `mini`, `extra`, …) stays in the
12
+ * key, so a level choice never crosses fast/standard or thinking/no-thinking
13
+ * and `extra-high` is not a synonym of anything. A family exists only when THIS
14
+ * account lists two or more levels under one key; a bare id (`grok-4.7`) is its
15
+ * own key and selects a listed `grok-4.7-<level>` sibling. Rank is ONLY the
16
+ * shared preference order: the vendor's model list is a menu, never a ladder,
17
+ * and labels are never read. An id carrying two or more level tokens is
18
+ * ambiguous and stays as it is.
19
+ *
20
+ * Nothing here refuses. A word outside the shared order, an id without a
21
+ * family, an empty or unread account list, a missing model: each leaves the id
22
+ * unchanged with an `omitted` receipt whose reason says why.
23
+ *
24
+ * ONE result: the preparation that returns this selection also puts `model`
25
+ * into `ProcessingReceipt.submittedNative`, the id authority every transport
26
+ * reads. The requested id is the caller's own model hint, so the effort receipt
27
+ * carries no native-id fields of its own — `parameter: "--model"` names the
28
+ * carrier and `submitted` is the level token.
29
+ */
30
+ export interface EffortVariantFamily {
31
+ /** The id with its single level token removed; the id itself when it carries none. */
32
+ key: string;
33
+ /** The level token the id carries; null for a bare id. */
34
+ level: EffortHint | null;
35
+ }
36
+ /** `null` = ambiguous (two or more shared-order tokens): never guessed. */
37
+ export declare function effortVariantFamily(id: string): EffortVariantFamily | null;
38
+ export interface EffortVariantSelection {
39
+ /** The id to submit: the listed family member the level chose, else the requested id unchanged. */
40
+ model: string | null;
41
+ /** The ONE effort receipt of this preparation (`parameter: "--model"`). */
42
+ effort: EffortResolution;
43
+ }
44
+ /**
45
+ * Select the listed variant of `model`'s family that `requested` places on the
46
+ * shared preference order: the requested level when the account lists it, else
47
+ * the strongest listed level not above it, else the weakest listed level.
48
+ *
49
+ * `catalog` is the model list of the exact account that will run; pass
50
+ * `unavailable` to say why none was consulted (no pinned account, unread list)
51
+ * — the id then stays unchanged and the receipt says so.
52
+ */
53
+ export declare function selectEffortVariant(preference: string | null | undefined, model: string | null, catalog: readonly string[], unavailable?: string): EffortVariantSelection;
54
+ //# sourceMappingURL=effort-variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effort-variants.d.ts","sourceRoot":"","sources":["../src/effort-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGpG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,GAAG,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1B;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAS1E;AAED,MAAM,WAAW,sBAAsB;IACrC,mGAAmG;IACnG,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,2EAA2E;IAC3E,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,WAAW,CAAC,EAAE,MAAM,GACnB,sBAAsB,CAoDxB"}
@@ -0,0 +1,83 @@
1
+ import { EFFORT_PREFERENCE_ORDER } from "@claudexor/schema";
2
+ import { effortReceipt, resolveEffort } from "./effort.js";
3
+ /** `null` = ambiguous (two or more shared-order tokens): never guessed. */
4
+ export function effortVariantFamily(id) {
5
+ const tokens = id.split("-");
6
+ const levelAt = tokens.flatMap((token, index) => EFFORT_PREFERENCE_ORDER.includes(token) ? [index] : []);
7
+ if (levelAt.length > 1)
8
+ return null;
9
+ if (levelAt.length === 0)
10
+ return { key: id, level: null };
11
+ const index = levelAt[0];
12
+ return { key: tokens.filter((_, i) => i !== index).join("-"), level: tokens[index] };
13
+ }
14
+ const SHARED_ORDER_TEXT = EFFORT_PREFERENCE_ORDER.join(" < ");
15
+ const rank = (level) => EFFORT_PREFERENCE_ORDER.indexOf(level);
16
+ /**
17
+ * Listed families: key → level → the exact listed id. Only ids with exactly one
18
+ * level token contribute; a key where one level maps to two different ids (the
19
+ * token in two positions) is dropped instead of being guessed.
20
+ */
21
+ function listedFamilies(catalog) {
22
+ const families = new Map();
23
+ const ambiguous = new Set();
24
+ for (const id of new Set(catalog)) {
25
+ const family = effortVariantFamily(id);
26
+ if (!family || family.level === null)
27
+ continue;
28
+ const members = families.get(family.key) ?? new Map();
29
+ const existing = members.get(family.level);
30
+ if (existing !== undefined && existing !== id)
31
+ ambiguous.add(family.key);
32
+ members.set(family.level, id);
33
+ families.set(family.key, members);
34
+ }
35
+ for (const key of ambiguous)
36
+ families.delete(key);
37
+ return families;
38
+ }
39
+ /**
40
+ * Select the listed variant of `model`'s family that `requested` places on the
41
+ * shared preference order: the requested level when the account lists it, else
42
+ * the strongest listed level not above it, else the weakest listed level.
43
+ *
44
+ * `catalog` is the model list of the exact account that will run; pass
45
+ * `unavailable` to say why none was consulted (no pinned account, unread list)
46
+ * — the id then stays unchanged and the receipt says so.
47
+ */
48
+ export function selectEffortVariant(preference, model, catalog, unavailable) {
49
+ const requested = preference?.trim() ? preference : null;
50
+ const unchanged = (note, source = "account_catalog") => {
51
+ const receipt = effortReceipt({ status: "ok", effort: null, clamped: false, ladder: [], placedBy: null }, requested, source, "--model");
52
+ const reason = [receipt.reason, note].filter((part) => part).join("; ");
53
+ return { model, effort: reason ? { ...receipt, reason } : receipt };
54
+ };
55
+ if (!requested)
56
+ return unchanged(null, "adapter");
57
+ if (!model)
58
+ return unchanged("no model was requested, so the effort has no family to select from", "adapter");
59
+ if (catalog.length === 0)
60
+ return unchanged(`${unavailable ?? "the account listed no models"}; the requested model id is unchanged`, "adapter");
61
+ const family = effortVariantFamily(model);
62
+ if (!family)
63
+ return unchanged(`"${model}" carries more than one shared-order level token, so its family is ambiguous and the id is unchanged`);
64
+ const members = listedFamilies(catalog).get(family.key);
65
+ if (!members || members.size < 2)
66
+ return unchanged(`the account lists no second level for the family "${family.key}" of "${model}", so the id is unchanged`);
67
+ const levels = [...members.keys()].sort((a, b) => rank(a) - rank(b));
68
+ const check = resolveEffort(requested, levels, { vendor: [], shared: EFFORT_PREFERENCE_ORDER });
69
+ if (check.status !== "ok" || check.effort === null)
70
+ return unchanged(`the id is unchanged (family "${family.key}" lists: ${levels.join(", ")})`);
71
+ const selected = members.get(check.effort);
72
+ const receipt = effortReceipt(check, requested, "account_catalog", "--model");
73
+ return {
74
+ model: selected,
75
+ effort: {
76
+ ...receipt,
77
+ reason: `effort "${requested}" selected the listed variant "${selected}" of family "${family.key}" ` +
78
+ `(listed levels: ${levels.join(", ")}; ranked by the shared preference order ${SHARED_ORDER_TEXT}, ` +
79
+ `which claims no vendor support) for requested model "${model}"`,
80
+ },
81
+ };
82
+ }
83
+ //# sourceMappingURL=effort-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effort-variants.js","sourceRoot":"","sources":["../src/effort-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAA0C,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsC3D,2EAA2E;AAC3E,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAC9C,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC;IAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,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AAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC;QAC9B,OAAO,SAAS,CACd,qDAAqD,MAAM,CAAC,GAAG,SAAS,KAAK,2BAA2B,CACzG,CAAC;IACJ,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAChG,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAChD,OAAO,SAAS,CAAC,gCAAgC,MAAM,CAAC,GAAG,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/F,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAE,CAAC;IAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;IAC9E,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE;YACN,GAAG,OAAO;YACV,MAAM,EACJ,WAAW,SAAS,kCAAkC,QAAQ,gBAAgB,MAAM,CAAC,GAAG,IAAI;gBAC5F,mBAAmB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C,iBAAiB,IAAI;gBACpG,wDAAwD,KAAK,GAAG;SACnE;KACF,CAAC;AACJ,CAAC"}
package/dist/effort.d.ts CHANGED
@@ -1,22 +1,32 @@
1
- import { type EffortHint, type EffortResolution } from "@claudexor/schema";
1
+ import { type EffortHint, type EffortResolution, type HarnessRunSpec } from "@claudexor/schema";
2
2
  /**
3
- * Effort resolution against VENDOR-ordered ladders. There is no static rank
4
- * table anywhere in this repo: a level's rank is its position in the ladder the
5
- * vendor itself advertised (a model's own ordered list, or the harness's merged
6
- * ladder — `mergeEffortLadders` in the schema package). Ranking is NOT
3
+ * Effort resolution against VENDOR-ordered ladders. A level's rank is its
4
+ * position in the ladder the vendor itself advertised (a model's own ordered
5
+ * list, or the harness's merged ladder — `mergeEffortLadders` in the schema
6
+ * package). Only when the vendor ladder does not list the requested word at all
7
+ * does the resolver consult the shared preference order
8
+ * (`EFFORT_PREFERENCE_ORDER`), and then only to PLACE the word onto a level the
9
+ * route really advertises; the receipt names that placement. Ranking is NOT
7
10
  * permission: what a run may actually use is whatever the resolved (harness,
8
11
  * model) ADVERTISES, so a level newer than this repo passes through untouched
9
12
  * the moment the vendor ships it.
10
13
  */
11
14
  /**
12
15
  * Outcome of resolving a requested effort against an advertised vocabulary.
13
- * `rejected` carries actionable text naming what IS advertised — an unknown
14
- * level is never silently downgraded into something we merely guessed at.
16
+ * The ONE result every consumer of a route reads: the arg builder takes
17
+ * `effort`, the receipt derives `downward`/`floor` from `ladder` — the order the
18
+ * level was actually chosen by — and the disclosure names `placedBy`. `rejected`
19
+ * carries actionable text naming what IS advertised — an unknown level is never
20
+ * silently downgraded into something we merely guessed at.
15
21
  */
16
22
  export type EffortCheck = {
17
23
  status: "ok";
18
24
  effort: EffortHint | null;
19
25
  clamped: boolean;
26
+ /** The rank order the level was chosen by; `advertised` itself when nothing was clamped. */
27
+ ladder: readonly EffortHint[];
28
+ /** Which order placed a clamped request; null for exact, omitted or unrequested. */
29
+ placedBy: "vendor" | "shared" | null;
20
30
  } | {
21
31
  status: "rejected";
22
32
  message: string;
@@ -25,6 +35,22 @@ export type EffortCheck = {
25
35
  * breaks ties between disconnected/branching chains; those ties are not ranks.
26
36
  * Exact membership remains usable even when ordering cannot be established. */
27
37
  export declare function effortRankLadder(lists: ReadonlyArray<readonly EffortHint[]>): readonly EffortHint[];
38
+ /**
39
+ * The two rank orders one route may clamp along, both derived from the vendor's
40
+ * RAW ordered lists. `vendor` is the route's own merged order and is tried
41
+ * first. `shared` merges the comparable words of the SAME raw lists with
42
+ * `EFFORT_PREFERENCE_ORDER`, only for a word the vendor order does not list.
43
+ * Extra vendor words do not disable that placement. Using raw lists (never an
44
+ * already-collapsed `vendor`) preserves contradictions between comparable
45
+ * words: the fallback cannot invent a rank the vendor disputes.
46
+ */
47
+ export interface EffortLadders {
48
+ vendor: readonly EffortHint[];
49
+ shared: readonly EffortHint[];
50
+ }
51
+ export declare function effortLadders(lists: ReadonlyArray<readonly EffortHint[]>): EffortLadders;
52
+ /** A bare ladder is the degenerate vendor-only case: no shared fallback. */
53
+ export type EffortLadderInput = readonly EffortHint[] | EffortLadders;
28
54
  /**
29
55
  * Resolve a requested reasoning-effort level against the levels a specific
30
56
  * (harness, model) advertises. THE single owner of effort semantics; every
@@ -32,27 +58,28 @@ export declare function effortRankLadder(lists: ReadonlyArray<readonly EffortHin
32
58
  *
33
59
  * `advertised` is what the resolved target accepts (the model's own ordered
34
60
  * list, or the harness ladder when the model recorded none). `ladder` is the
35
- * rank authority for clamping: the harness's MERGED vendor order, so a level
36
- * one sibling model advertises can clamp onto what THIS model accepts (`ultra`
37
- * on gpt-5.4 → `xhigh`, because the merged codex ladder places `ultra` above
38
- * it). It defaults to `advertised` itself — the degenerate case where nothing
39
- * beyond the target's own order is known, including a harness whose models'
40
- * orders CONTRADICT each other: pass `advertised` there, which makes
41
- * cross-model clamping impossible by construction and refuses instead of
42
- * inventing an order.
61
+ * rank authority for clamping — normally `effortLadders(rawVendorLists)`, whose
62
+ * `vendor` order lets a level one sibling model advertises clamp onto what THIS
63
+ * model accepts (`ultra` on gpt-5.4 → `xhigh`, because the merged codex ladder
64
+ * places `ultra` above it) and whose `shared` order places a word no vendor list
65
+ * carries (`ultra` on a `max`-capped Claude → `max`; `none` → the known minimum).
66
+ * A bare array is the degenerate vendor-only case (nothing beyond the target's
67
+ * own order is known; no shared fallback), and it defaults to `advertised`.
43
68
  *
44
69
  * - nothing requested → ok, no effort (pass no flag).
45
70
  * - `advertised` empty → ok, no effort: effort is not a tunable surface here, so
46
71
  * the caller discloses it as ignored (INV-105) instead of clamping to a guess.
47
72
  * - requested IS advertised → PASS THROUGH VERBATIM. This is what makes a
48
73
  * future vendor level work with no Claudexor change.
49
- * - requested is not advertised but the LADDER places it → choose the strongest
50
- * advertised level not above the request. If every supported level exceeds
51
- * the request, use the known minimum (reasoning cannot be disabled there).
52
- * - requested is unknown to the ladder too → REJECT, naming the advertised
53
- * set. We cannot place it, so any "nearest" would be invented.
74
+ * - requested is not advertised but the VENDOR order places it → the strongest
75
+ * advertised level not above the request; if every supported level exceeds
76
+ * the request, the known minimum (reasoning cannot be disabled there).
77
+ * - the vendor order does not list it but the SHARED order does → the same
78
+ * choice along the shared order, flagged `placedBy: "shared"`.
79
+ * - neither order places it → REJECT, naming the advertised set. We cannot place
80
+ * it, so any "nearest" would be invented.
54
81
  */
55
- export declare function resolveEffort(requested: EffortHint | null | undefined, advertised: readonly EffortHint[], ladder?: readonly EffortHint[]): EffortCheck;
82
+ export declare function resolveEffort(requested: EffortHint | null | undefined, advertised: readonly EffortHint[], ladder?: EffortLadderInput): EffortCheck;
56
83
  /**
57
84
  * Map a requested effort onto a level the resolved (harness, model) accepts, or
58
85
  * null when none should be sent. Thin translational wrapper over `resolveEffort`
@@ -61,12 +88,21 @@ export declare function resolveEffort(requested: EffortHint | null | undefined,
61
88
  * fabricated downgrade. Surfaces that can talk back to the user call
62
89
  * `resolveEffort` and report its `message`.
63
90
  */
64
- export declare function normalizeEffort(requested: EffortHint | null | undefined, advertised: readonly EffortHint[], ladder?: readonly EffortHint[]): EffortHint | null;
91
+ export declare function normalizeEffort(requested: EffortHint | null | undefined, advertised: readonly EffortHint[], ladder?: EffortLadderInput): EffortHint | null;
92
+ /**
93
+ * The typed receipt for ONE check — the same object the arg builder read, so
94
+ * `submitted` and the flag actually sent cannot disagree, and `downward`/`floor`
95
+ * are judged on the ladder that chose the level. `reason` states a shared-order
96
+ * placement (it never implies vendor support), and notes a word outside the
97
+ * shared order when nothing was submitted; it is prose, consumers branch on
98
+ * `resolution` only.
99
+ */
100
+ export declare function effortReceipt(check: EffortCheck, requested: string | null | undefined, source: EffortResolution["source"], parameter: string | null, unverifiable?: boolean): EffortResolution;
65
101
  /** Shared typed receipt; native adapters supply the final route's capability
66
102
  * facts. Empty supported and unavailable proof remain different outcomes. */
67
- export declare function resolveEffortEvidence(requested: string | null | undefined, advertised: readonly string[], ladder: readonly string[], source: EffortResolution["source"], parameter: string | null, unverifiable?: boolean): EffortResolution;
103
+ export declare function resolveEffortEvidence(requested: string | null | undefined, advertised: readonly string[], ladder: EffortLadderInput, source: EffortResolution["source"], parameter: string | null, unverifiable?: boolean): EffortResolution;
68
104
  /** Diagnostic only: status events never inject assistant conversation text. */
69
- export declare function effortResolutionEvent(sessionId: string, receipt: EffortResolution): import("@claudexor/schema").HarnessEvent;
105
+ export declare function effortResolutionEvent(sessionId: string, receipt: EffortResolution, spec?: Pick<HarnessRunSpec, "model_hint" | "processing">): import("@claudexor/schema").HarnessEvent;
70
106
  /** Native adapters stop before transport when their final route cannot place a preference. */
71
107
  export declare function throwIfEffortRejected(receipt: import("@claudexor/schema").EffortResolution): void;
72
108
  //# sourceMappingURL=effort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE/F;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,OAAO,EAA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AAa,CAC3B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,YAAY,UAAQ,GACnB,gBAAgB,CA6BlB;AAED;6EAC6E;AAC7E,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,YAAY,UAAQ,GACnB,gBAAgB,CAGlB;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,EACzB,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,YAAY,CAAC,GACvD,OAAO,mBAAmB,EAAE,YAAY,CAwB1C;AAED,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAKjG"}
package/dist/effort.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { EffortPreferenceRejectedError } from "./errors.js";
2
- import { mergeEffortLadders } from "@claudexor/schema";
2
+ import { EFFORT_PREFERENCE_ORDER, mergeEffortLadders, } from "@claudexor/schema";
3
3
  /** Only a vendor-proven total order may drive substitutions. The display merge
4
4
  * breaks ties between disconnected/branching chains; those ties are not ranks.
5
5
  * Exact membership remains usable even when ordering cannot be established. */
@@ -16,6 +16,42 @@ export function effortRankLadder(lists) {
16
16
  ? order
17
17
  : [];
18
18
  }
19
+ export function effortLadders(lists) {
20
+ return {
21
+ vendor: effortRankLadder(lists),
22
+ shared: effortRankLadder([
23
+ ...lists.map((list) => list.filter((level) => EFFORT_PREFERENCE_ORDER.includes(level))),
24
+ EFFORT_PREFERENCE_ORDER,
25
+ ]),
26
+ };
27
+ }
28
+ function laddersOf(input) {
29
+ return Array.isArray(input)
30
+ ? { vendor: input, shared: [] }
31
+ : input;
32
+ }
33
+ /**
34
+ * Where `requested` lands on ONE rank order: the strongest advertised level not
35
+ * above it, else the known minimum. `null` when this order cannot place the
36
+ * request (the caller tries the next order); a typed rejection when the order
37
+ * places the request below every advertised level but cannot rank them all.
38
+ */
39
+ function placeOnLadder(requested, advertised, ladder) {
40
+ const want = ladder.indexOf(requested);
41
+ // Only levels the ladder places can host a clamp; a level outside the ladder
42
+ // is a valid TARGET only through the exact-match branch of `resolveEffort`.
43
+ const rankable = advertised.filter((level) => ladder.indexOf(level) >= 0);
44
+ if (want < 0 || rankable.length === 0)
45
+ return null;
46
+ const ordered = [...rankable].sort((a, b) => ladder.indexOf(a) - ladder.indexOf(b));
47
+ const lower = ordered.filter((level) => ladder.indexOf(level) <= want).at(-1);
48
+ if (!lower && rankable.length !== advertised.length)
49
+ return {
50
+ status: "rejected",
51
+ message: "The advertised minimum effort cannot be established from the vendor order.",
52
+ };
53
+ return lower ?? ordered[0];
54
+ }
19
55
  /**
20
56
  * Resolve a requested reasoning-effort level against the levels a specific
21
57
  * (harness, model) advertises. THE single owner of effort semantics; every
@@ -23,54 +59,63 @@ export function effortRankLadder(lists) {
23
59
  *
24
60
  * `advertised` is what the resolved target accepts (the model's own ordered
25
61
  * list, or the harness ladder when the model recorded none). `ladder` is the
26
- * rank authority for clamping: the harness's MERGED vendor order, so a level
27
- * one sibling model advertises can clamp onto what THIS model accepts (`ultra`
28
- * on gpt-5.4 → `xhigh`, because the merged codex ladder places `ultra` above
29
- * it). It defaults to `advertised` itself — the degenerate case where nothing
30
- * beyond the target's own order is known, including a harness whose models'
31
- * orders CONTRADICT each other: pass `advertised` there, which makes
32
- * cross-model clamping impossible by construction and refuses instead of
33
- * inventing an order.
62
+ * rank authority for clamping — normally `effortLadders(rawVendorLists)`, whose
63
+ * `vendor` order lets a level one sibling model advertises clamp onto what THIS
64
+ * model accepts (`ultra` on gpt-5.4 → `xhigh`, because the merged codex ladder
65
+ * places `ultra` above it) and whose `shared` order places a word no vendor list
66
+ * carries (`ultra` on a `max`-capped Claude → `max`; `none` → the known minimum).
67
+ * A bare array is the degenerate vendor-only case (nothing beyond the target's
68
+ * own order is known; no shared fallback), and it defaults to `advertised`.
34
69
  *
35
70
  * - nothing requested → ok, no effort (pass no flag).
36
71
  * - `advertised` empty → ok, no effort: effort is not a tunable surface here, so
37
72
  * the caller discloses it as ignored (INV-105) instead of clamping to a guess.
38
73
  * - requested IS advertised → PASS THROUGH VERBATIM. This is what makes a
39
74
  * future vendor level work with no Claudexor change.
40
- * - requested is not advertised but the LADDER places it → choose the strongest
41
- * advertised level not above the request. If every supported level exceeds
42
- * the request, use the known minimum (reasoning cannot be disabled there).
43
- * - requested is unknown to the ladder too → REJECT, naming the advertised
44
- * set. We cannot place it, so any "nearest" would be invented.
75
+ * - requested is not advertised but the VENDOR order places it → the strongest
76
+ * advertised level not above the request; if every supported level exceeds
77
+ * the request, the known minimum (reasoning cannot be disabled there).
78
+ * - the vendor order does not list it but the SHARED order does → the same
79
+ * choice along the shared order, flagged `placedBy: "shared"`.
80
+ * - neither order places it → REJECT, naming the advertised set. We cannot place
81
+ * it, so any "nearest" would be invented.
45
82
  */
46
83
  export function resolveEffort(requested, advertised, ladder = advertised) {
47
- if (requested === null || requested === undefined) {
48
- return { status: "ok", effort: null, clamped: false };
49
- }
84
+ const verbatim = (effort) => ({
85
+ status: "ok",
86
+ effort,
87
+ clamped: false,
88
+ ladder: advertised,
89
+ placedBy: null,
90
+ });
91
+ if (requested === null || requested === undefined)
92
+ return verbatim(null);
50
93
  if (advertised.length === 0)
51
- return { status: "ok", effort: null, clamped: false };
94
+ return verbatim(null);
52
95
  if (advertised.includes(requested))
53
- return { status: "ok", effort: requested, clamped: false };
54
- const want = ladder.indexOf(requested);
55
- // Only levels the ladder places can host a clamp; a level outside the ladder
56
- // is a valid TARGET only through the exact-match branch above.
57
- const rankable = advertised.filter((level) => ladder.indexOf(level) >= 0);
58
- if (want < 0 || rankable.length === 0) {
59
- return {
60
- status: "rejected",
61
- message: `effort "${requested}" is not advertised here and the advertised ladder cannot place it ` +
62
- `(advertised: ${advertised.join(", ")})`,
63
- };
96
+ return verbatim(requested);
97
+ const ladders = laddersOf(ladder);
98
+ const orders = [
99
+ ["vendor", ladders.vendor],
100
+ ["shared", ladders.shared],
101
+ ];
102
+ for (const [placedBy, order] of orders) {
103
+ const comparable = placedBy === "shared" ? advertised.filter((level) => order.includes(level)) : advertised;
104
+ const placed = placeOnLadder(requested, comparable, order);
105
+ if (placed === null)
106
+ continue;
107
+ if (typeof placed !== "string")
108
+ return placed;
109
+ return { status: "ok", effort: placed, clamped: true, ladder: order, placedBy };
64
110
  }
65
- const ordered = [...rankable].sort((a, b) => ladder.indexOf(a) - ladder.indexOf(b));
66
- const lower = ordered.filter((level) => ladder.indexOf(level) <= want).at(-1);
67
- if (!lower && rankable.length !== advertised.length)
68
- return {
69
- status: "rejected",
70
- message: "The advertised minimum effort cannot be established from the vendor order.",
71
- };
72
- const best = lower ?? ordered[0];
73
- return { status: "ok", effort: best, clamped: true };
111
+ const outside = !EFFORT_PREFERENCE_ORDER.includes(requested)
112
+ ? `; "${requested}" is outside the shared preference order (${EFFORT_PREFERENCE_ORDER.join(", ")})`
113
+ : "";
114
+ return {
115
+ status: "rejected",
116
+ message: `effort "${requested}" is not advertised here and the advertised ladder cannot place it ` +
117
+ `(advertised: ${advertised.join(", ")})${outside}`,
118
+ };
74
119
  }
75
120
  /**
76
121
  * Map a requested effort onto a level the resolved (harness, model) accepts, or
@@ -84,10 +129,16 @@ export function normalizeEffort(requested, advertised, ladder = advertised) {
84
129
  const check = resolveEffort(requested, advertised, ladder);
85
130
  return check.status === "ok" ? check.effort : null;
86
131
  }
87
- /** Shared typed receipt; native adapters supply the final route's capability
88
- * facts. Empty supported and unavailable proof remain different outcomes. */
89
- export function resolveEffortEvidence(requested, advertised, ladder, source, parameter, unverifiable = false) {
90
- const check = resolveEffort(requested, unverifiable ? [] : advertised, ladder);
132
+ const SHARED_ORDER_TEXT = EFFORT_PREFERENCE_ORDER.join(" < ");
133
+ /**
134
+ * The typed receipt for ONE check — the same object the arg builder read, so
135
+ * `submitted` and the flag actually sent cannot disagree, and `downward`/`floor`
136
+ * are judged on the ladder that chose the level. `reason` states a shared-order
137
+ * placement (it never implies vendor support), and notes a word outside the
138
+ * shared order when nothing was submitted; it is prose, consumers branch on
139
+ * `resolution` only.
140
+ */
141
+ export function effortReceipt(check, requested, source, parameter, unverifiable = false) {
91
142
  const base = {
92
143
  requested: requested ?? null,
93
144
  source,
@@ -97,29 +148,52 @@ export function resolveEffortEvidence(requested, advertised, ladder, source, par
97
148
  };
98
149
  if (check.status === "rejected")
99
150
  return { ...base, submitted: null, resolution: "rejected", reason: check.message };
100
- const submitted = check.effort;
101
- const resolution = submitted === null
102
- ? requested && unverifiable
103
- ? "unverifiable"
104
- : "omitted"
105
- : !check.clamped
106
- ? "exact"
107
- : ladder.indexOf(submitted) < ladder.indexOf(requested)
108
- ? "downward"
109
- : "floor";
110
- return { ...base, submitted, resolution };
151
+ const submitted = unverifiable ? null : check.effort;
152
+ if (submitted === null) {
153
+ const resolution = requested && unverifiable ? "unverifiable" : "omitted";
154
+ const outside = requested && !EFFORT_PREFERENCE_ORDER.includes(requested)
155
+ ? `"${requested}" is outside the shared preference order (${SHARED_ORDER_TEXT}); no native effort was submitted`
156
+ : null;
157
+ return { ...base, submitted, resolution, ...(outside ? { reason: outside } : {}) };
158
+ }
159
+ const resolution = !check.clamped
160
+ ? "exact"
161
+ : check.ladder.indexOf(submitted) < check.ladder.indexOf(requested)
162
+ ? "downward"
163
+ : "floor";
164
+ const reason = check.placedBy === "shared"
165
+ ? `"${requested}" is not on this route's vendor ladder; the shared preference order (${SHARED_ORDER_TEXT}) placed it and resolved it ${resolution} to ${submitted}, which claims neither vendor support for "${requested}" nor equal quality across vendors`
166
+ : null;
167
+ return { ...base, submitted, resolution, ...(reason ? { reason } : {}) };
168
+ }
169
+ /** Shared typed receipt; native adapters supply the final route's capability
170
+ * facts. Empty supported and unavailable proof remain different outcomes. */
171
+ export function resolveEffortEvidence(requested, advertised, ladder, source, parameter, unverifiable = false) {
172
+ const check = resolveEffort(requested, unverifiable ? [] : advertised, ladder);
173
+ return effortReceipt(check, requested, source, parameter, unverifiable);
111
174
  }
112
175
  /** Diagnostic only: status events never inject assistant conversation text. */
113
- export function effortResolutionEvent(sessionId, receipt) {
114
- const detail = receipt.requested && receipt.resolution !== "exact"
115
- ? `effort=${receipt.requested}: ${receipt.resolution}; submitted=${receipt.submitted ?? "omitted (native default)"}`
176
+ export function effortResolutionEvent(sessionId, receipt, spec) {
177
+ const modelChanged = receipt.parameter === "--model" &&
178
+ spec?.processing?.submittedNative != null &&
179
+ spec.processing.submittedNative !== spec.model_hint;
180
+ const detail = receipt.requested && (receipt.resolution !== "exact" || modelChanged)
181
+ ? `effort=${receipt.requested}: ${receipt.resolution}; submitted=${receipt.submitted ?? "omitted (native default)"}` +
182
+ (receipt.reason ? `; ${receipt.reason}` : "")
116
183
  : null;
117
184
  return {
118
185
  type: "status",
119
186
  session_id: sessionId,
120
187
  ts: new Date().toISOString(),
121
188
  effort_resolution: receipt,
122
- ...(detail ? { text: `[effort] ${detail}`, payload: { ignored_settings: [detail] } } : {}),
189
+ // An exact selection that changed the model id is information, not an
190
+ // adaptation: it never rides the ignored-settings (warning) channel.
191
+ ...(detail
192
+ ? {
193
+ text: `[effort] ${detail}`,
194
+ ...(receipt.resolution !== "exact" ? { payload: { ignored_settings: [detail] } } : {}),
195
+ }
196
+ : {}),
123
197
  };
124
198
  }
125
199
  /** Native adapters stop before transport when their final route cannot place a preference. */
@@ -1 +1 @@
1
- {"version":3,"file":"effort.js","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6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ANGED
@@ -2,6 +2,7 @@ export * from "./errors.js";
2
2
  export * from "./adapter.js";
3
3
  export * from "./attachment-integrity.js";
4
4
  export * from "./effort.js";
5
+ export * from "./effort-variants.js";
5
6
  export * from "./processing.js";
6
7
  export * from "./model.js";
7
8
  export * from "./model-adapter.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./errors.js";
2
2
  export * from "./adapter.js";
3
3
  export * from "./attachment-integrity.js";
4
4
  export * from "./effort.js";
5
+ export * from "./effort-variants.js";
5
6
  export * from "./processing.js";
6
7
  export * from "./model.js";
7
8
  export * from "./model-adapter.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CA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Ac,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { type HarnessRunSpec } from "@claudexor/schema";
2
2
  import type { HarnessAdapter, HarnessProcessingSpec, PreparedHarnessProcessing } from "./adapter.js";
3
3
  /** Shared fallback for adapters without service controls. Never changes model,
4
- * effort, credential route, or output policy. Native observations stay unknown. */
4
+ * effort, credential route, or output policy. Native observations stay unknown.
5
+ * An adapter whose effort rides the model id returns its effort receipt from
6
+ * the same call; it is validated here and travels with the prepared result. */
5
7
  export declare function prepareHarnessProcessing(adapter: HarnessAdapter, spec: HarnessProcessingSpec): Promise<PreparedHarnessProcessing>;
6
8
  /** Runtime-only callback owned by the caller's existing budget lease. It sees
7
9
  * the exact prepared spec, after account/model resolution and before spawn. */
@@ -1 +1 @@
1
- {"version":3,"file":"processing.d.ts","sourceRoot":"","sources":["../src/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAEtB;mFACmF;AACnF,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAsBpC;AAED;+EAC+E;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjF"}
1
+ {"version":3,"file":"processing.d.ts","sourceRoot":"","sources":["../src/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAEtB;;;+EAG+E;AAC/E,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAuBpC;AAED;+EAC+E;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjF"}
@@ -1,6 +1,8 @@
1
- import { ProcessingReceipt, ProcessingCostBasis } from "@claudexor/schema";
1
+ import { EffortResolution, ProcessingReceipt, ProcessingCostBasis, } from "@claudexor/schema";
2
2
  /** Shared fallback for adapters without service controls. Never changes model,
3
- * effort, credential route, or output policy. Native observations stay unknown. */
3
+ * effort, credential route, or output policy. Native observations stay unknown.
4
+ * An adapter whose effort rides the model id returns its effort receipt from
5
+ * the same call; it is validated here and travels with the prepared result. */
4
6
  export async function prepareHarnessProcessing(adapter, spec) {
5
7
  const prepared = adapter.prepareProcessing
6
8
  ? await adapter.prepareProcessing(spec)
@@ -22,6 +24,7 @@ export async function prepareHarnessProcessing(adapter, spec) {
22
24
  model: prepared.model,
23
25
  receipt,
24
26
  costBasis: ProcessingCostBasis.parse(prepared.costBasis),
27
+ ...(prepared.effort ? { effort: EffortResolution.parse(prepared.effort) } : {}),
25
28
  };
26
29
  }
27
30
  export async function admitPreparedProcessing(spec) {
@@ -1 +1 @@
1
- {"version":3,"file":"processing.js","sourceRoot":"","sources":["../src/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAuB,MAAM,mBAAmB,CAAC;AAOhG;mFACmF;AACnF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAuB,EACvB,IAA2B;IAE3B,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB;QACxC,CAAC,CAAC,MAAM,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC;QACvC,CAAC,CAAC;YACE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE;gBACP,SAAS,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI;gBAClC,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,IAAI;gBACrB,QAAQ,EAAE,SAAkB;gBAC5B,cAAc,EAAE,EAAE;gBAClB,MAAM,EAAE,gCAAgC;gBACxC,MAAM,EAAE,oBAAoB;aAC7B;YACD,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE;SACxF,CAAC;IACN,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1D,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,OAAO;QACP,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;KACzD,CAAC;AACJ,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAAoB;IAChE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACpD,IAAI,OAAO,SAAS,KAAK,UAAU;QAAE,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AoB;IAChE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACpD,IAAI,OAAO,SAAS,KAAK,UAAU;QAAE,MAAO,SAAiC,CAAC,IAAI,CAAC,CAAC;AACtF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudexor/core",
3
- "version": "3.20.1",
3
+ "version": "3.22.0",
4
4
  "license": "MIT",
5
5
  "description": "HarnessAdapter contract, process helpers, typed errors, and low-level execution utilities.",
6
6
  "type": "module",
@@ -20,8 +20,8 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "@playwright/mcp": "0.0.83",
23
- "@claudexor/schema": "3.20.1",
24
- "@claudexor/util": "3.20.1"
23
+ "@claudexor/schema": "3.22.0",
24
+ "@claudexor/util": "3.22.0"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",