@warmdrift/kgauto-compiler 2.0.0-alpha.76 → 2.0.0-alpha.78

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.
@@ -442,6 +442,26 @@ type MutationApplied = {
442
442
  rankBefore?: number;
443
443
  rankAfter?: number;
444
444
  };
445
+ /**
446
+ * alpha.78 — shape-proof accessor for a mutation entry (PB filing
447
+ * 2026-07-25 addendum #2). TWO public surfaces share the name
448
+ * `mutationsApplied` with DIFFERENT element types: `CompileResult` /
449
+ * `CallResult` carry `MutationApplied[]` (objects), while
450
+ * `compileForAISDKv6` carries `string[]` (ids) — each internally
451
+ * consistent, but a consumer coding to one surface's d.ts while reading the
452
+ * other's runtime gets a silent false negative (`typeof m === 'string'`
453
+ * compiles clean, runs clean, and is wrong on every row). Neither element
454
+ * type can change without breaking a live consumer, so the fix is an
455
+ * accessor that is correct on both.
456
+ */
457
+ declare function mutationId(m: string | MutationApplied): string;
458
+ /**
459
+ * alpha.78 — does any mutation in the list match `idOrPrefix` (exact id, or
460
+ * prefix when it ends with `*`)? Works on both `mutationsApplied` element
461
+ * shapes. `hasMutation(result.mutationsApplied, 'quality-gate-measured-*')`
462
+ * is the gate-detection idiom PB hand-rolled in their deep-smoke.
463
+ */
464
+ declare function hasMutation(list: ReadonlyArray<string | MutationApplied> | undefined, idOrPrefix: string): boolean;
445
465
  /**
446
466
  * Target-specific wire request. Shape varies by provider — caller passes the
447
467
  * right field to the right SDK.
@@ -1090,6 +1110,36 @@ interface CallOptions {
1090
1110
  * later calls in the same isolate are gated either way).
1091
1111
  */
1092
1112
  gateWarmupMs?: number;
1113
+ /**
1114
+ * alpha.78 — per-ATTEMPT time bound on the provider leg, in ms
1115
+ * (IC `per-call-timeout-on-call-options` + the portfolio-wide
1116
+ * unbounded-LLM-call scan). Without it the only ceiling is the serverless
1117
+ * route's `maxDuration`, and one hung socket eats the entire route budget
1118
+ * before the fallback chain — the product's whole promise — can walk.
1119
+ *
1120
+ * Semantics per attempt shape:
1121
+ * - non-streaming: total bound via `AbortSignal.timeout()`; firing
1122
+ * classifies retryable `timeout` (L-061) so the chain WALKS.
1123
+ * - streaming: per-chunk STALL bound (max silence between bytes,
1124
+ * covering time-to-first-byte) — a total bound would cut legitimate
1125
+ * long streams. Also classifies `timeout` on fire.
1126
+ *
1127
+ * Each wire attempt (including the same-model retry) gets a fresh budget.
1128
+ * Default: none — today's unbounded behavior, additive and opt-in; a
1129
+ * consumer-side bounds scan (tt-intel s114 shape) can then require it
1130
+ * mechanically. A hang recorded before this existed reads as model
1131
+ * latency in brain telemetry — transport stalls were indistinguishable
1132
+ * from slow models.
1133
+ */
1134
+ attemptTimeoutMs?: number;
1135
+ /**
1136
+ * alpha.78 — caller-owned cancellation (route-level deadline propagation).
1137
+ * Composed per-attempt with `attemptTimeoutMs` via `AbortSignal.any`.
1138
+ * Aborting classifies terminal `aborted` and stops the WHOLE chain walk —
1139
+ * the caller cancelled, so walking would spend money on an answer nobody
1140
+ * is waiting for. Distinct from a timeout, which walks.
1141
+ */
1142
+ abortSignal?: AbortSignal;
1093
1143
  toolRelevanceThreshold?: number;
1094
1144
  compressHistoryAfter?: number;
1095
1145
  /** Override API keys (defaults: process.env). */
@@ -1209,12 +1259,21 @@ interface CallAttempt {
1209
1259
  * for alpha.10+ — e.g. mid-stream policy rejects)
1210
1260
  * - `provider_auth_failed` alpha.14 — initial provider returned 401/403
1211
1261
  * (upstream key revocation, malformed-but-truthy
1212
- * key, billing lapse). The chain walks to the
1213
- * next non-same-provider target instead of
1262
+ * key). The chain walks to the next
1263
+ * non-same-provider target instead of
1214
1264
  * short-circuiting; same-provider remaining
1215
1265
  * entries skip with errorCode='auth_inferred'.
1266
+ * - `provider_billing_exhausted` alpha.77 — the provider's ACCOUNT is out
1267
+ * of credits (Anthropic "credit balance is too
1268
+ * low" 400, OpenAI insufficient_quota 429,
1269
+ * Google billing-disabled, DeepSeek 402). Walks
1270
+ * like auth and skips same-provider siblings
1271
+ * (errorCode='billing_exhausted_inferred').
1272
+ * Distinct from auth AND from rate_limit because
1273
+ * its disposition is distinct: it never clears
1274
+ * on its own — a human funds the account.
1216
1275
  */
1217
- type FallbackReason = 'rate_limit' | 'provider_error' | 'cost_cap' | 'cliff' | 'contract_violation' | 'provider_auth_failed';
1276
+ type FallbackReason = 'rate_limit' | 'provider_error' | 'cost_cap' | 'cliff' | 'contract_violation' | 'provider_auth_failed' | 'provider_billing_exhausted';
1218
1277
  interface CallResult {
1219
1278
  /** Compile handle (still valid for record() if consumer wants to add oracle scores later). */
1220
1279
  handle: string;
@@ -1470,10 +1529,11 @@ interface RecordInput {
1470
1529
  /** Model originally targeted when a fallback fired. */
1471
1530
  fellOverFrom?: string;
1472
1531
  /**
1473
- * Why the fallback fired. Closed set mirroring CallResult.fallbackReason
1474
- * keep in sync with the wire-contract enum (TraceDetail.fallbackReason).
1532
+ * Why the fallback fired the SAME closed set as CallResult.fallbackReason
1533
+ * (one derivation; the alpha.77 DTS break caught this field's inline copy
1534
+ * drifting when the canonical union grew a member).
1475
1535
  */
1476
- fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
1536
+ fallbackReason?: FallbackReason;
1477
1537
  /**
1478
1538
  * alpha.66 — true when the one-shot same-model retry fired during this
1479
1539
  * call (migration 039 `retried_same_model`). Powers the offline rollup:
@@ -1644,4 +1704,4 @@ interface PerAxisMetrics {
1644
1704
  /** Per-axis metrics keyed by model — used for chain-comparison views. */
1645
1705
  type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
1646
1706
 
1647
- export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, captureGoldenIr as D, type EffortLevel as E, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, parseGoldenCaptureRate as J, resolveGoldenCaptureRate as K, shouldCaptureGolden as L, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type SystemModelMessage as S, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type CompileResult as e, type SectionRewrite as f, type RecordOutcomeInput as g, type OracleScore as h, type Adapter as i, type PerAxisMetrics as j, type Provider as k, type ChainEntry as l, type CallAttempt as m, CallError as n, type ChainModelEntry as o, type ChainWithGrounding as p, type Constraints as q, type GoldenCaptureOptions as r, type MutationApplied as s, type NormalizedTokens as t, type OutcomeKind as u, type PerAxisMetricsByModel as v, type PromptSection as w, type SectionKind as x, type ShadowProbeConfig as y, type ToolDefinition as z };
1707
+ export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, captureGoldenIr as D, type EffortLevel as E, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, hasMutation as J, mutationId as K, parseGoldenCaptureRate as L, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, resolveGoldenCaptureRate as Q, type RecordInput as R, type SystemModelMessage as S, type ToolCall as T, shouldCaptureGolden as U, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type CompileResult as e, type SectionRewrite as f, type RecordOutcomeInput as g, type OracleScore as h, type Adapter as i, type PerAxisMetrics as j, type Provider as k, type ChainEntry as l, type CallAttempt as m, CallError as n, type ChainModelEntry as o, type ChainWithGrounding as p, type Constraints as q, type GoldenCaptureOptions as r, type MutationApplied as s, type NormalizedTokens as t, type OutcomeKind as u, type PerAxisMetricsByModel as v, type PromptSection as w, type SectionKind as x, type ShadowProbeConfig as y, type ToolDefinition as z };
@@ -442,6 +442,26 @@ type MutationApplied = {
442
442
  rankBefore?: number;
443
443
  rankAfter?: number;
444
444
  };
445
+ /**
446
+ * alpha.78 — shape-proof accessor for a mutation entry (PB filing
447
+ * 2026-07-25 addendum #2). TWO public surfaces share the name
448
+ * `mutationsApplied` with DIFFERENT element types: `CompileResult` /
449
+ * `CallResult` carry `MutationApplied[]` (objects), while
450
+ * `compileForAISDKv6` carries `string[]` (ids) — each internally
451
+ * consistent, but a consumer coding to one surface's d.ts while reading the
452
+ * other's runtime gets a silent false negative (`typeof m === 'string'`
453
+ * compiles clean, runs clean, and is wrong on every row). Neither element
454
+ * type can change without breaking a live consumer, so the fix is an
455
+ * accessor that is correct on both.
456
+ */
457
+ declare function mutationId(m: string | MutationApplied): string;
458
+ /**
459
+ * alpha.78 — does any mutation in the list match `idOrPrefix` (exact id, or
460
+ * prefix when it ends with `*`)? Works on both `mutationsApplied` element
461
+ * shapes. `hasMutation(result.mutationsApplied, 'quality-gate-measured-*')`
462
+ * is the gate-detection idiom PB hand-rolled in their deep-smoke.
463
+ */
464
+ declare function hasMutation(list: ReadonlyArray<string | MutationApplied> | undefined, idOrPrefix: string): boolean;
445
465
  /**
446
466
  * Target-specific wire request. Shape varies by provider — caller passes the
447
467
  * right field to the right SDK.
@@ -1090,6 +1110,36 @@ interface CallOptions {
1090
1110
  * later calls in the same isolate are gated either way).
1091
1111
  */
1092
1112
  gateWarmupMs?: number;
1113
+ /**
1114
+ * alpha.78 — per-ATTEMPT time bound on the provider leg, in ms
1115
+ * (IC `per-call-timeout-on-call-options` + the portfolio-wide
1116
+ * unbounded-LLM-call scan). Without it the only ceiling is the serverless
1117
+ * route's `maxDuration`, and one hung socket eats the entire route budget
1118
+ * before the fallback chain — the product's whole promise — can walk.
1119
+ *
1120
+ * Semantics per attempt shape:
1121
+ * - non-streaming: total bound via `AbortSignal.timeout()`; firing
1122
+ * classifies retryable `timeout` (L-061) so the chain WALKS.
1123
+ * - streaming: per-chunk STALL bound (max silence between bytes,
1124
+ * covering time-to-first-byte) — a total bound would cut legitimate
1125
+ * long streams. Also classifies `timeout` on fire.
1126
+ *
1127
+ * Each wire attempt (including the same-model retry) gets a fresh budget.
1128
+ * Default: none — today's unbounded behavior, additive and opt-in; a
1129
+ * consumer-side bounds scan (tt-intel s114 shape) can then require it
1130
+ * mechanically. A hang recorded before this existed reads as model
1131
+ * latency in brain telemetry — transport stalls were indistinguishable
1132
+ * from slow models.
1133
+ */
1134
+ attemptTimeoutMs?: number;
1135
+ /**
1136
+ * alpha.78 — caller-owned cancellation (route-level deadline propagation).
1137
+ * Composed per-attempt with `attemptTimeoutMs` via `AbortSignal.any`.
1138
+ * Aborting classifies terminal `aborted` and stops the WHOLE chain walk —
1139
+ * the caller cancelled, so walking would spend money on an answer nobody
1140
+ * is waiting for. Distinct from a timeout, which walks.
1141
+ */
1142
+ abortSignal?: AbortSignal;
1093
1143
  toolRelevanceThreshold?: number;
1094
1144
  compressHistoryAfter?: number;
1095
1145
  /** Override API keys (defaults: process.env). */
@@ -1209,12 +1259,21 @@ interface CallAttempt {
1209
1259
  * for alpha.10+ — e.g. mid-stream policy rejects)
1210
1260
  * - `provider_auth_failed` alpha.14 — initial provider returned 401/403
1211
1261
  * (upstream key revocation, malformed-but-truthy
1212
- * key, billing lapse). The chain walks to the
1213
- * next non-same-provider target instead of
1262
+ * key). The chain walks to the next
1263
+ * non-same-provider target instead of
1214
1264
  * short-circuiting; same-provider remaining
1215
1265
  * entries skip with errorCode='auth_inferred'.
1266
+ * - `provider_billing_exhausted` alpha.77 — the provider's ACCOUNT is out
1267
+ * of credits (Anthropic "credit balance is too
1268
+ * low" 400, OpenAI insufficient_quota 429,
1269
+ * Google billing-disabled, DeepSeek 402). Walks
1270
+ * like auth and skips same-provider siblings
1271
+ * (errorCode='billing_exhausted_inferred').
1272
+ * Distinct from auth AND from rate_limit because
1273
+ * its disposition is distinct: it never clears
1274
+ * on its own — a human funds the account.
1216
1275
  */
1217
- type FallbackReason = 'rate_limit' | 'provider_error' | 'cost_cap' | 'cliff' | 'contract_violation' | 'provider_auth_failed';
1276
+ type FallbackReason = 'rate_limit' | 'provider_error' | 'cost_cap' | 'cliff' | 'contract_violation' | 'provider_auth_failed' | 'provider_billing_exhausted';
1218
1277
  interface CallResult {
1219
1278
  /** Compile handle (still valid for record() if consumer wants to add oracle scores later). */
1220
1279
  handle: string;
@@ -1470,10 +1529,11 @@ interface RecordInput {
1470
1529
  /** Model originally targeted when a fallback fired. */
1471
1530
  fellOverFrom?: string;
1472
1531
  /**
1473
- * Why the fallback fired. Closed set mirroring CallResult.fallbackReason
1474
- * keep in sync with the wire-contract enum (TraceDetail.fallbackReason).
1532
+ * Why the fallback fired the SAME closed set as CallResult.fallbackReason
1533
+ * (one derivation; the alpha.77 DTS break caught this field's inline copy
1534
+ * drifting when the canonical union grew a member).
1475
1535
  */
1476
- fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
1536
+ fallbackReason?: FallbackReason;
1477
1537
  /**
1478
1538
  * alpha.66 — true when the one-shot same-model retry fired during this
1479
1539
  * call (migration 039 `retried_same_model`). Powers the offline rollup:
@@ -1644,4 +1704,4 @@ interface PerAxisMetrics {
1644
1704
  /** Per-axis metrics keyed by model — used for chain-comparison views. */
1645
1705
  type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
1646
1706
 
1647
- export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, captureGoldenIr as D, type EffortLevel as E, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, parseGoldenCaptureRate as J, resolveGoldenCaptureRate as K, shouldCaptureGolden as L, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type SystemModelMessage as S, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type CompileResult as e, type SectionRewrite as f, type RecordOutcomeInput as g, type OracleScore as h, type Adapter as i, type PerAxisMetrics as j, type Provider as k, type ChainEntry as l, type CallAttempt as m, CallError as n, type ChainModelEntry as o, type ChainWithGrounding as p, type Constraints as q, type GoldenCaptureOptions as r, type MutationApplied as s, type NormalizedTokens as t, type OutcomeKind as u, type PerAxisMetricsByModel as v, type PromptSection as w, type SectionKind as x, type ShadowProbeConfig as y, type ToolDefinition as z };
1707
+ export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, captureGoldenIr as D, type EffortLevel as E, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, hasMutation as J, mutationId as K, parseGoldenCaptureRate as L, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, resolveGoldenCaptureRate as Q, type RecordInput as R, type SystemModelMessage as S, type ToolCall as T, shouldCaptureGolden as U, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type CompileResult as e, type SectionRewrite as f, type RecordOutcomeInput as g, type OracleScore as h, type Adapter as i, type PerAxisMetrics as j, type Provider as k, type ChainEntry as l, type CallAttempt as m, CallError as n, type ChainModelEntry as o, type ChainWithGrounding as p, type Constraints as q, type GoldenCaptureOptions as r, type MutationApplied as s, type NormalizedTokens as t, type OutcomeKind as u, type PerAxisMetricsByModel as v, type PromptSection as w, type SectionKind as x, type ShadowProbeConfig as y, type ToolDefinition as z };
@@ -25,7 +25,7 @@ __export(key_health_exports, {
25
25
  module.exports = __toCommonJS(key_health_exports);
26
26
 
27
27
  // src/version.ts
28
- var LIBRARY_VERSION = "2.0.0-alpha.76";
28
+ var LIBRARY_VERSION = "2.0.0-alpha.78";
29
29
 
30
30
  // src/key-health.ts
31
31
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createKeyHealthRoute
3
- } from "./chunk-WZZCW6NA.mjs";
3
+ } from "./chunk-QVD2QWST.mjs";
4
4
  export {
5
5
  createKeyHealthRoute
6
6
  };
@@ -1,4 +1,4 @@
1
- import { k as Provider } from './ir-CZukZvDn.mjs';
1
+ import { k as Provider } from './ir-BFwWhj2s.mjs';
2
2
  import { IntentArchetypeName } from './dialect.mjs';
3
3
 
4
4
  /**
@@ -22,7 +22,17 @@ interface CliffRule {
22
22
  /** Threshold — meaning depends on metric. */
23
23
  threshold: number;
24
24
  /** What action to take when triggered. */
25
- action: 'downgrade_quality_warning' | 'drop_to_top_relevant' | 'force_thinking_budget_zero' | 'force_terse_output' | 'escalate_target' | 'strip_tools';
25
+ action: 'downgrade_quality_warning' | 'drop_to_top_relevant' | 'force_thinking_budget_zero' | 'force_terse_output' | 'escalate_target' | 'strip_tools'
26
+ /**
27
+ * alpha.78 — apply the band-dominating QUALITY_GATE_PENALTY (same lever
28
+ * as the alpha.49 schema-weak gate) when the IR declares
29
+ * structuredOutput and the metric crosses threshold. For models whose
30
+ * declared structured-output support is MEASURED not to hold above an
31
+ * input size on an archetype — evidence-shaped, unlike the archetype-
32
+ * wide `structuredOutputHint: 'avoid'`. Only meaningful with
33
+ * `metric: 'input_tokens'` (+ usually `whenIntent`).
34
+ */
35
+ | 'quality_gate_structured';
26
36
  /**
27
37
  * Optional: only fire this cliff when the IR's intent.archetype matches.
28
38
  * Used for archetype-specific failure modes (e.g. Gemini Flash returns
@@ -1,4 +1,4 @@
1
- import { k as Provider } from './ir-B0v2f9NY.js';
1
+ import { k as Provider } from './ir-DZKS1tI7.js';
2
2
  import { IntentArchetypeName } from './dialect.js';
3
3
 
4
4
  /**
@@ -22,7 +22,17 @@ interface CliffRule {
22
22
  /** Threshold — meaning depends on metric. */
23
23
  threshold: number;
24
24
  /** What action to take when triggered. */
25
- action: 'downgrade_quality_warning' | 'drop_to_top_relevant' | 'force_thinking_budget_zero' | 'force_terse_output' | 'escalate_target' | 'strip_tools';
25
+ action: 'downgrade_quality_warning' | 'drop_to_top_relevant' | 'force_thinking_budget_zero' | 'force_terse_output' | 'escalate_target' | 'strip_tools'
26
+ /**
27
+ * alpha.78 — apply the band-dominating QUALITY_GATE_PENALTY (same lever
28
+ * as the alpha.49 schema-weak gate) when the IR declares
29
+ * structuredOutput and the metric crosses threshold. For models whose
30
+ * declared structured-output support is MEASURED not to hold above an
31
+ * input size on an archetype — evidence-shaped, unlike the archetype-
32
+ * wide `structuredOutputHint: 'avoid'`. Only meaningful with
33
+ * `metric: 'input_tokens'` (+ usually `whenIntent`).
34
+ */
35
+ | 'quality_gate_structured';
26
36
  /**
27
37
  * Optional: only fire this cliff when the IR's intent.archetype matches.
28
38
  * Used for archetype-specific failure modes (e.g. Gemini Flash returns
package/dist/profiles.js CHANGED
@@ -395,6 +395,22 @@ var PROFILES_RAW = [
395
395
  threshold: 16,
396
396
  action: "drop_to_top_relevant",
397
397
  reason: "Haiku reliability degrades above ~16 tools"
398
+ },
399
+ {
400
+ // alpha.78 — the declared `structuredOutput: 'grammar'` does NOT
401
+ // hold on long-input summarize. MEASURED (brain, playbacksam):
402
+ // 21 disambiguated `structured_output_parse_failed` fallover rows
403
+ // 2026-07-22..27, tokens_in 12,280–31,450; PB's gate counted 20/20
404
+ // in-window failures. Clean traffic p50 sits at ~9K tokens_in, so
405
+ // 12K gates the failing band without touching the working one.
406
+ // Short-input summarize carries no failure evidence and stays
407
+ // ungated — this is why it's a cliff, not an archetype-wide
408
+ // `structuredOutputHint: 'avoid'`.
409
+ metric: "input_tokens",
410
+ threshold: 12e3,
411
+ action: "quality_gate_structured",
412
+ whenIntent: "summarize",
413
+ reason: "Structured-output parse failures at 100% in-window on long-input summarize (measured on playbacksam, 2026-07-25..27; haiku only led when input size made price dominate, then failed every time)."
398
414
  }
399
415
  ],
400
416
  costInputPer1m: 1,
package/dist/profiles.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  latencyTierOf,
9
9
  profilesByProvider,
10
10
  tryGetProfile
11
- } from "./chunk-N36LE3MK.mjs";
11
+ } from "./chunk-VVRDFE6T.mjs";
12
12
  export {
13
13
  ALIASES,
14
14
  LATENCY_TIER_MS,
@@ -1,4 +1,4 @@
1
- import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-B0v2f9NY.js';
1
+ import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-DZKS1tI7.js';
2
2
 
3
3
  /**
4
4
  * Glass-Box observability types (alpha.17).
@@ -1,11 +1,4 @@
1
- import { i as Adapter, x as SectionKind } from './ir-B0v2f9NY.js';
2
-
3
- /**
4
- * Internal config + hook types for createGlassboxRoutes().
5
- *
6
- * The public contract lives on `GlassboxRoutesConfig` in ./index.ts; these
7
- * are the narrower per-handler shapes consumed by proxy.ts and stream.ts.
8
- */
1
+ import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-DZKS1tI7.js';
9
2
 
10
3
  /**
11
4
  * Wire contract for the Glass-Box Chrome extension's brain-poll endpoint.
@@ -131,7 +124,7 @@ interface TraceDetail extends TraceSummary {
131
124
  /** Derived: cacheReadInputTokens / max(tokensIn, 1). 0-1. */
132
125
  inputCacheHitRatio: number;
133
126
  fellOverFrom?: string;
134
- fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
127
+ fallbackReason?: FallbackReason;
135
128
  /** Up to 2 alternatives. Empty array (not undefined) when none qualify. */
136
129
  counterfactuals?: TraceCounterfactual[];
137
130
  /** Undefined when 7d volume < 5/day (insufficient data). */
@@ -1,4 +1,4 @@
1
- import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-CZukZvDn.mjs';
1
+ import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-BFwWhj2s.mjs';
2
2
 
3
3
  /**
4
4
  * Glass-Box observability types (alpha.17).
@@ -1,11 +1,4 @@
1
- import { i as Adapter, x as SectionKind } from './ir-CZukZvDn.mjs';
2
-
3
- /**
4
- * Internal config + hook types for createGlassboxRoutes().
5
- *
6
- * The public contract lives on `GlassboxRoutesConfig` in ./index.ts; these
7
- * are the narrower per-handler shapes consumed by proxy.ts and stream.ts.
8
- */
1
+ import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-BFwWhj2s.mjs';
9
2
 
10
3
  /**
11
4
  * Wire contract for the Glass-Box Chrome extension's brain-poll endpoint.
@@ -131,7 +124,7 @@ interface TraceDetail extends TraceSummary {
131
124
  /** Derived: cacheReadInputTokens / max(tokensIn, 1). 0-1. */
132
125
  inputCacheHitRatio: number;
133
126
  fellOverFrom?: string;
134
- fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
127
+ fallbackReason?: FallbackReason;
135
128
  /** Up to 2 alternatives. Empty array (not undefined) when none qualify. */
136
129
  counterfactuals?: TraceCounterfactual[];
137
130
  /** Undefined when 7d volume < 5/day (insufficient data). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmdrift/kgauto-compiler",
3
- "version": "2.0.0-alpha.76",
3
+ "version": "2.0.0-alpha.78",
4
4
  "description": "Prompt compiler with executable provider knowledge for multi-model AI apps: normalized multi-provider transport with fallback chains, compile-time cliff guards, a curated model registry, and a telemetry flight recorder. Swap models without rewriting prompts.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",