@warmdrift/kgauto-compiler 2.0.0-alpha.82 → 2.0.0-alpha.85

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.
@@ -1666,6 +1666,9 @@ function _setProfileBrainHook(hook) {
1666
1666
  function canonicalId(id) {
1667
1667
  return brainHook.resolveAlias?.(id) ?? ALIASES[id] ?? id;
1668
1668
  }
1669
+ function resolveModelAlias(id) {
1670
+ return canonicalId(id);
1671
+ }
1669
1672
  var PROFILE_INDEX = new Map(
1670
1673
  PROFILES_RAW.map((p) => [p.id, p])
1671
1674
  );
@@ -1699,6 +1702,7 @@ export {
1699
1702
  latencyTierOf,
1700
1703
  ALIASES,
1701
1704
  _setProfileBrainHook,
1705
+ resolveModelAlias,
1702
1706
  getProfile,
1703
1707
  tryGetProfile,
1704
1708
  allProfiles,
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  allProfiles,
3
+ resolveModelAlias,
3
4
  tryGetProfile
4
- } from "./chunk-VVRDFE6T.mjs";
5
+ } from "./chunk-FD3NFXDC.mjs";
5
6
 
6
7
  // src/brain-query.ts
7
8
  var FRESH_SNAPSHOT = {
@@ -407,6 +408,17 @@ function isSameModelRetryEnabledFromEnv(envSource = defaultEnv()) {
407
408
  return raw === "1" || raw === "true";
408
409
  }
409
410
 
411
+ // src/policy-match.ts
412
+ function canonicalPolicySet(ids) {
413
+ const set = /* @__PURE__ */ new Set();
414
+ for (const id of ids ?? []) set.add(resolveModelAlias(id));
415
+ return set;
416
+ }
417
+ function policySetHas(set, modelId) {
418
+ if (set.size === 0) return false;
419
+ return set.has(resolveModelAlias(modelId));
420
+ }
421
+
410
422
  // src/fallback.ts
411
423
  var COST_RANKING_REFERENCE_SHAPE = {
412
424
  inputTokens: 4e3,
@@ -599,8 +611,8 @@ function getDefaultFallbackChain(opts) {
599
611
  chain = [...starter];
600
612
  }
601
613
  if (policy?.blockedModels && policy.blockedModels.length > 0) {
602
- const blocked = new Set(policy.blockedModels);
603
- chain = chain.filter((id) => !blocked.has(id));
614
+ const blocked = canonicalPolicySet(policy.blockedModels);
615
+ chain = chain.filter((id) => !policySetHas(blocked, id));
604
616
  }
605
617
  const seen = /* @__PURE__ */ new Set();
606
618
  const deduped = [];
@@ -703,8 +715,8 @@ function getDefaultFallbackChainWithGrounding(opts) {
703
715
  chain = [...starter];
704
716
  }
705
717
  if (policy?.blockedModels && policy.blockedModels.length > 0) {
706
- const blocked = new Set(policy.blockedModels);
707
- chain = chain.filter((e) => !blocked.has(e.id));
718
+ const blocked = canonicalPolicySet(policy.blockedModels);
719
+ chain = chain.filter((e) => !policySetHas(blocked, e.id));
708
720
  }
709
721
  const seen = /* @__PURE__ */ new Set();
710
722
  const deduped = [];
@@ -803,6 +815,8 @@ export {
803
815
  ARCHETYPE_FLOOR_DEFAULT,
804
816
  ABSOLUTE_FLOOR,
805
817
  getModelCompatibility,
818
+ canonicalPolicySet,
819
+ policySetHas,
806
820
  loadArchetypePerfFromBrain,
807
821
  loadArchetypePerfNFromBrain,
808
822
  MEASURED_GROUNDING_MIN_N,
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var LIBRARY_VERSION = "2.0.0-alpha.82";
2
+ var LIBRARY_VERSION = "2.0.0-alpha.85";
3
3
 
4
4
  // src/key-health.ts
5
5
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-CRXaR7nJ.mjs';
2
- export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-CRXaR7nJ.mjs';
3
- import '../ir-D4S9R816.mjs';
1
+ import { G as GlassboxEvent } from '../types-y42mwdvM.mjs';
2
+ export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-y42mwdvM.mjs';
3
+ import '../ir-JUoybVM-.mjs';
4
4
  import '../dialect.mjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-CAs9-0S4.js';
2
- export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-CAs9-0S4.js';
3
- import '../ir-Cx9hJj0B.js';
1
+ import { G as GlassboxEvent } from '../types-BqTKRECa.js';
2
+ export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-BqTKRECa.js';
3
+ import '../ir-DfrM71pA.js';
4
4
  import '../dialect.js';
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-DHi4FcUu.mjs';
2
- import '../ir-D4S9R816.mjs';
1
+ import { T as TraceHealth } from '../types-BGH_KAHu.mjs';
2
+ import '../ir-JUoybVM-.mjs';
3
3
  import '../dialect.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-Cvd6kRNv.js';
2
- import '../ir-Cx9hJj0B.js';
1
+ import { T as TraceHealth } from '../types-DLDJbCha.js';
2
+ import '../ir-DfrM71pA.js';
3
3
  import '../dialect.js';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-CRXaR7nJ.mjs';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-DHi4FcUu.mjs';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-DHi4FcUu.mjs';
4
- import '../ir-D4S9R816.mjs';
1
+ import { G as GlassboxEvent } from '../types-y42mwdvM.mjs';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-BGH_KAHu.mjs';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-BGH_KAHu.mjs';
4
+ import '../ir-JUoybVM-.mjs';
5
5
  import '../dialect.mjs';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-CAs9-0S4.js';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-Cvd6kRNv.js';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-Cvd6kRNv.js';
4
- import '../ir-Cx9hJj0B.js';
1
+ import { G as GlassboxEvent } from '../types-BqTKRECa.js';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-DLDJbCha.js';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-DLDJbCha.js';
4
+ import '../ir-DfrM71pA.js';
5
5
  import '../dialect.js';
6
6
 
7
7
  /**
@@ -1717,6 +1717,9 @@ var brainHook = {};
1717
1717
  function canonicalId(id) {
1718
1718
  return brainHook.resolveAlias?.(id) ?? ALIASES[id] ?? id;
1719
1719
  }
1720
+ function resolveModelAlias(id) {
1721
+ return canonicalId(id);
1722
+ }
1720
1723
  var PROFILE_INDEX = new Map(
1721
1724
  PROFILES_RAW.map((p) => [p.id, p])
1722
1725
  );
@@ -1891,6 +1894,17 @@ var loadChainsFromBrain = createBrainQueryCache({
1891
1894
  bundledFallback: getAllStarterChains
1892
1895
  });
1893
1896
 
1897
+ // src/policy-match.ts
1898
+ function canonicalPolicySet(ids) {
1899
+ const set = /* @__PURE__ */ new Set();
1900
+ for (const id of ids ?? []) set.add(resolveModelAlias(id));
1901
+ return set;
1902
+ }
1903
+ function policySetHas(set, modelId) {
1904
+ if (set.size === 0) return false;
1905
+ return set.has(resolveModelAlias(modelId));
1906
+ }
1907
+
1894
1908
  // src/archetype-perf-brain.ts
1895
1909
  function isPerfRow(x) {
1896
1910
  if (!x || typeof x !== "object") return false;
@@ -2135,8 +2149,8 @@ function getDefaultFallbackChain(opts) {
2135
2149
  chain = [...starter];
2136
2150
  }
2137
2151
  if (policy?.blockedModels && policy.blockedModels.length > 0) {
2138
- const blocked = new Set(policy.blockedModels);
2139
- chain = chain.filter((id) => !blocked.has(id));
2152
+ const blocked = canonicalPolicySet(policy.blockedModels);
2153
+ chain = chain.filter((id) => !policySetHas(blocked, id));
2140
2154
  }
2141
2155
  const seen = /* @__PURE__ */ new Set();
2142
2156
  const deduped = [];
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ARCHETYPE_FLOOR_DEFAULT,
3
3
  getDefaultFallbackChain
4
- } from "../chunk-XPD4I3Q5.mjs";
4
+ } from "../chunk-LO2JXTGG.mjs";
5
5
  import {
6
6
  tryGetProfile
7
- } from "../chunk-VVRDFE6T.mjs";
7
+ } from "../chunk-FD3NFXDC.mjs";
8
8
  import {
9
9
  subscribe,
10
10
  subscribeApp
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as TraceDetail } from '../../types-DHi4FcUu.mjs';
3
- import '../../ir-D4S9R816.mjs';
2
+ import { a as TraceDetail } from '../../types-BGH_KAHu.mjs';
3
+ import '../../ir-JUoybVM-.mjs';
4
4
  import '../../dialect.mjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as TraceDetail } from '../../types-Cvd6kRNv.js';
3
- import '../../ir-Cx9hJj0B.js';
2
+ import { a as TraceDetail } from '../../types-DLDJbCha.js';
3
+ import '../../ir-DfrM71pA.js';
4
4
  import '../../dialect.js';
5
5
 
6
6
  /**