@claudexor/core 3.19.0 → 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.
Files changed (65) hide show
  1. package/dist/adapter.d.ts +92 -2
  2. package/dist/adapter.d.ts.map +1 -1
  3. package/dist/adapter.js +17 -0
  4. package/dist/adapter.js.map +1 -1
  5. package/dist/answer-assembly.js +3 -3
  6. package/dist/answer-assembly.js.map +1 -1
  7. package/dist/credential-execution.d.ts +40 -0
  8. package/dist/credential-execution.d.ts.map +1 -0
  9. package/dist/credential-execution.js +69 -0
  10. package/dist/credential-execution.js.map +1 -0
  11. package/dist/doctor.d.ts.map +1 -1
  12. package/dist/doctor.js +9 -6
  13. package/dist/doctor.js.map +1 -1
  14. package/dist/effort-variants.d.ts +54 -0
  15. package/dist/effort-variants.d.ts.map +1 -0
  16. package/dist/effort-variants.js +83 -0
  17. package/dist/effort-variants.js.map +1 -0
  18. package/dist/effort.d.ts +60 -24
  19. package/dist/effort.d.ts.map +1 -1
  20. package/dist/effort.js +131 -57
  21. package/dist/effort.js.map +1 -1
  22. package/dist/env-scope.d.ts +2 -0
  23. package/dist/env-scope.d.ts.map +1 -1
  24. package/dist/env-scope.js +16 -0
  25. package/dist/env-scope.js.map +1 -1
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/instructions.d.ts +1 -1
  31. package/dist/instructions.js +1 -1
  32. package/dist/native/claudexor-process-identity +0 -0
  33. package/dist/npm-launch.d.ts +19 -0
  34. package/dist/npm-launch.d.ts.map +1 -0
  35. package/dist/npm-launch.js +214 -0
  36. package/dist/npm-launch.js.map +1 -0
  37. package/dist/proc.d.ts +8 -18
  38. package/dist/proc.d.ts.map +1 -1
  39. package/dist/proc.js +31 -50
  40. package/dist/proc.js.map +1 -1
  41. package/dist/process-lifeline.d.ts +19 -0
  42. package/dist/process-lifeline.d.ts.map +1 -0
  43. package/dist/process-lifeline.js +25 -0
  44. package/dist/process-lifeline.js.map +1 -0
  45. package/dist/process-lines.d.ts +13 -0
  46. package/dist/process-lines.d.ts.map +1 -0
  47. package/dist/process-lines.js +70 -0
  48. package/dist/process-lines.js.map +1 -0
  49. package/dist/process-tree.d.ts +5 -0
  50. package/dist/process-tree.d.ts.map +1 -1
  51. package/dist/process-tree.js +16 -0
  52. package/dist/process-tree.js.map +1 -1
  53. package/dist/processing.d.ts +3 -1
  54. package/dist/processing.d.ts.map +1 -1
  55. package/dist/processing.js +5 -2
  56. package/dist/processing.js.map +1 -1
  57. package/dist/runloop.d.ts +3 -1
  58. package/dist/runloop.d.ts.map +1 -1
  59. package/dist/runloop.js +33 -1
  60. package/dist/runloop.js.map +1 -1
  61. package/dist/runtime-env.d.ts +27 -12
  62. package/dist/runtime-env.d.ts.map +1 -1
  63. package/dist/runtime-env.js +102 -49
  64. package/dist/runtime-env.js.map +1 -1
  65. package/package.json +3 -3
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,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C;;+EAE+E;AAC/E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,CAAC,SAAS,UAAU,EAAE,CAAC,GAC1C,SAAS,UAAU,EAAE,CAcvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EACxC,UAAU,EAAE,SAAS,UAAU,EAAE,EACjC,MAAM,GAAE,SAAS,UAAU,EAAe,GACzC,WAAW,CA6Bb;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EACxC,UAAU,EAAE,SAAS,UAAU,EAAE,EACjC,MAAM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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,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAA0C,MAAM,mBAAmB,CAAC;AAqB/F;;+EAE+E;AAC/E,MAAM,UAAU,gBAAgB,CAC9B,KAA2C;IAE3C,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACzB,OAAO,KAAK,CAAC,KAAK,CAChB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACf,KAAK,KAAK,CAAC;QACX,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,MAAM,GAAG,IAAI,CAAC,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AAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC;IACX,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,SAAS;QACrB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC5B,iBAAiB,EAAE,OAAO;QAC1B,sEAAsE;QACtE,qEAAqE;QACrE,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,IAAI,EAAE,YAAY,MAAM,EAAE;gBAC1B,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,qBAAqB,CAAC,OAAqD;IACzF,IAAI,OAAO,CAAC,UAAU,KAAK,UAAU;QACnC,MAAM,IAAI,6BAA6B,CACrC,OAAO,CAAC,MAAM,IAAI,qDAAqD,CACxE,CAAC;AACN,CAAC"}
@@ -53,4 +53,6 @@ export declare function pickAllowlistedEnv(source: NodeJS.ProcessEnv, keys: read
53
53
  * providerScrubEnv patch are applied ON TOP of this by the spawn layer.
54
54
  */
55
55
  export declare function composeBaseEnv(inheritance: "mirror_native" | "clean", source?: NodeJS.ProcessEnv, execPath?: string, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
56
+ /** Apply the run patch once, after baseline PATH/OS identity preparation. */
57
+ export declare function composeSpawnEnv(inheritance?: "mirror_native" | "clean", patch?: Record<string, string | null | undefined>): NodeJS.ProcessEnv;
56
58
  //# sourceMappingURL=env-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-scope.d.ts","sourceRoot":"","sources":["../src/env-scope.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mB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MAAM,EAAE,EACvB,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,CAAC,UAAU,CAWnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,eAAe,GAAG,OAAO,EACtC,MAAM,GAAE,MAAM,CAAC,UAAwB,EACvC,QAAQ,GAAE,MAAyB,EACnC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,CAAC,UAAU,CAInB;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAC7B,WAAW,GAAE,eAAe,GAAG,OAAyB,EACxD,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAM,GACpD,MAAM,CAAC,UAAU,CAWnB"}
package/dist/env-scope.js CHANGED
@@ -187,4 +187,20 @@ export function composeBaseEnv(inheritance, source = process.env, execPath = pro
187
187
  return normalizedSource;
188
188
  return pickAllowlistedEnv(normalizedSource, CLEAN_ENV_ALLOWLIST, platform);
189
189
  }
190
+ /** Apply the run patch once, after baseline PATH/OS identity preparation. */
191
+ export function composeSpawnEnv(inheritance = "mirror_native", patch = {}) {
192
+ const env = composeBaseEnv(inheritance);
193
+ for (const [key, value] of Object.entries(patch)) {
194
+ if (process.platform === "win32")
195
+ for (const existing of Object.keys(env)) {
196
+ if (existing.toUpperCase() === key.toUpperCase())
197
+ delete env[existing];
198
+ }
199
+ if (value === null || value === undefined)
200
+ delete env[key];
201
+ else
202
+ env[key] = value;
203
+ }
204
+ return env;
205
+ }
190
206
  //# sourceMappingURL=env-scope.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-scope.js","sourceRoot":"","sources":["../src/env-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,eAAe;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gB,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;AAC7E,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,eAAe,CAC7B,WAAW,GAA8B,eAAe,EACxD,KAAK,GAA8C,EAAE;IAErD,MAAM,GAAG,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;YAC9B,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxC,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE;oBAAE,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;YACzE,CAAC;QACH,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;;YACtD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/index.d.ts 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";
@@ -18,6 +19,7 @@ export * from "./auth-readiness.js";
18
19
  export * from "./auth-capability-verifier.js";
19
20
  export * from "./env-scope.js";
20
21
  export * from "./runtime-env.js";
22
+ export * from "./npm-launch.js";
21
23
  export * from "./executable-inspection.js";
22
24
  export * from "./instructions.js";
23
25
  export * from "./browser-mcp.js";
@@ -28,4 +30,5 @@ export * from "./isolation-locator.js";
28
30
  export * from "./credential-profile-policy.js";
29
31
  export * from "./credential-selection.js";
30
32
  export * from "./credential-mutation-window.js";
33
+ export * from "./credential-execution.js";
31
34
  //# sourceMappingURL=index.d.ts.map
@@ -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,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"}
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";
@@ -18,6 +19,7 @@ export * from "./auth-readiness.js";
18
19
  export * from "./auth-capability-verifier.js";
19
20
  export * from "./env-scope.js";
20
21
  export * from "./runtime-env.js";
22
+ export * from "./npm-launch.js";
21
23
  export * from "./executable-inspection.js";
22
24
  export * from "./instructions.js";
23
25
  export * from "./browser-mcp.js";
@@ -28,4 +30,5 @@ export * from "./isolation-locator.js";
28
30
  export * from "./credential-profile-policy.js";
29
31
  export * from "./credential-selection.js";
30
32
  export * from "./credential-mutation-window.js";
33
+ export * from "./credential-execution.js";
31
34
  //# sourceMappingURL=index.js.map
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,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,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"}
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,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"}
@@ -1,7 +1,7 @@
1
1
  import type { HarnessRunSpec } from "@claudexor/schema";
2
2
  /**
3
3
  * Layer caller-supplied per-run instructions onto the prompt for harnesses with
4
- * NO native system-prompt flag (cursor, agy, opencode, raw-api). Claude and Codex use
4
+ * NO native system-prompt flag (cursor, agy, opencode, copilot, raw-api). Claude and Codex use
5
5
  * their native additive channels (`--append-system-prompt-file`, `developer_instructions`)
6
6
  * instead and never call this. The block is explicitly delimited so the model
7
7
  * reads it as system framing, not as part of the user's request.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Layer caller-supplied per-run instructions onto the prompt for harnesses with
3
- * NO native system-prompt flag (cursor, agy, opencode, raw-api). Claude and Codex use
3
+ * NO native system-prompt flag (cursor, agy, opencode, copilot, raw-api). Claude and Codex use
4
4
  * their native additive channels (`--append-system-prompt-file`, `developer_instructions`)
5
5
  * instead and never call this. The block is explicitly delimited so the model
6
6
  * reads it as system framing, not as part of the user's request.
@@ -0,0 +1,19 @@
1
+ /** A vendor entry remains the identity. Its interpreter is only launch transport. */
2
+ export interface HarnessInterpreter {
3
+ binary: string;
4
+ args: string[];
5
+ env?: Record<string, string>;
6
+ }
7
+ export interface HarnessCommand {
8
+ entrypoint: string;
9
+ interpreter?: HarnessInterpreter;
10
+ launcher?: string;
11
+ }
12
+ /** A selected file's physical invocation. PATH is already composed by its owner. */
13
+ export declare function commandForFile(path: string, pathValue: string, platform: NodeJS.Platform, pathDelimiter: string, source?: NodeJS.ProcessEnv): HarnessCommand | null;
14
+ export declare function interpretedCommand(entrypoint: string, args: readonly string[], env: NodeJS.ProcessEnv, interpreter?: HarnessInterpreter): {
15
+ binary: string;
16
+ args: string[];
17
+ env: NodeJS.ProcessEnv;
18
+ };
19
+ //# sourceMappingURL=npm-launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm-launch.d.ts","sourceRoot":"","sources":["../src/npm-launch.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmJD,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,MAAM,CAAC,UAAwB,GACtC,cAAc,GAAG,IAAI,CAyCvB;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,CAAC,EAAE,kBAAkB,GAC/B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,CAQ5D"}