@warmdrift/kgauto-compiler 2.0.0-alpha.39 → 2.0.0-alpha.41
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/glassbox/index.d.mts +3 -3
- package/dist/glassbox/index.d.ts +3 -3
- package/dist/glassbox-routes/format.d.mts +2 -2
- package/dist/glassbox-routes/format.d.ts +2 -2
- package/dist/glassbox-routes/index.d.mts +4 -4
- package/dist/glassbox-routes/index.d.ts +4 -4
- package/dist/glassbox-routes/react/index.d.mts +2 -2
- package/dist/glassbox-routes/react/index.d.ts +2 -2
- package/dist/index.d.mts +234 -3
- package/dist/index.d.ts +234 -3
- package/dist/index.js +710 -138
- package/dist/index.mjs +706 -138
- package/dist/{ir-CZ9Ng96k.d.ts → ir-DYpvUSEw.d.ts} +32 -3
- package/dist/{ir-BiZSAVCJ.d.mts → ir-D_kgJcaV.d.mts} +32 -3
- package/dist/profiles.d.mts +28 -1
- package/dist/profiles.d.ts +28 -1
- package/dist/{types-HEl2tS4P.d.ts → types-C8gOJ7hV.d.ts} +1 -1
- package/dist/{types-kzYpX7wB.d.mts → types-CYY769Ls.d.mts} +1 -1
- package/dist/{types-CsFP-H-U.d.ts → types-DigtHnEt.d.ts} +1 -1
- package/dist/{types-f7idIVsm.d.mts → types-MkiWUPM8.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -238,6 +238,24 @@ interface CompilePolicy {
|
|
|
238
238
|
*/
|
|
239
239
|
posture?: 'locked' | 'preferred' | 'open';
|
|
240
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* alpha.41 — entry in `PromptIR.models[]`. Either a literal model id (the
|
|
243
|
+
* pre-alpha.41 shape, fully preserved) or a `{ family: string }` alias that
|
|
244
|
+
* resolves at compile() time to the latest-current model in that family.
|
|
245
|
+
*
|
|
246
|
+
* Family entries resolve via `resolveFamilyEntry` (internal twin of the
|
|
247
|
+
* public `getRecommendedPrimary`). Resolution fails CLOSED — a family that
|
|
248
|
+
* matches no current+active candidate throws `FamilyResolutionError` at
|
|
249
|
+
* compile time. Consumers who want a literal fallback should call
|
|
250
|
+
* `getRecommendedPrimary({ family, fallback, ... })` at IR-construction time
|
|
251
|
+
* and inline the resolved id, rather than passing `{ family }` into the IR.
|
|
252
|
+
*
|
|
253
|
+
* Family taxonomy is defined in `family-resolution.ts`; see also migration
|
|
254
|
+
* 024 (`kgauto_models.family` column + index).
|
|
255
|
+
*/
|
|
256
|
+
type ChainModelEntry = string | {
|
|
257
|
+
family: string;
|
|
258
|
+
};
|
|
241
259
|
/**
|
|
242
260
|
* The IR — the input to compile().
|
|
243
261
|
*/
|
|
@@ -254,8 +272,19 @@ interface PromptIR {
|
|
|
254
272
|
history?: Message[];
|
|
255
273
|
/** The user's current turn — never dropped. */
|
|
256
274
|
currentTurn?: Message;
|
|
257
|
-
/**
|
|
258
|
-
|
|
275
|
+
/**
|
|
276
|
+
* Allowed model IDs (or family aliases — alpha.41+), in caller-preference
|
|
277
|
+
* order. Compiler resolves family entries to literal ids before scoring
|
|
278
|
+
* and picks among them. See {@link ChainModelEntry}.
|
|
279
|
+
*
|
|
280
|
+
* Internal passes downstream of compile()'s family-resolution step
|
|
281
|
+
* receive a narrowed `string[]` shape — `string` is a subtype of
|
|
282
|
+
* `ChainModelEntry`, so a `string[]` IS a `ChainModelEntry[]` at the
|
|
283
|
+
* type level. Code that needs to access string ids (passes.ts) reads
|
|
284
|
+
* via `getModelIds(ir)` from `models-runtime.ts` rather than narrowing
|
|
285
|
+
* inline.
|
|
286
|
+
*/
|
|
287
|
+
models: ChainModelEntry[];
|
|
259
288
|
/** Compile constraints. */
|
|
260
289
|
constraints?: Constraints;
|
|
261
290
|
/**
|
|
@@ -1165,4 +1194,4 @@ interface PerAxisMetrics {
|
|
|
1165
1194
|
/** Per-axis metrics keyed by model — used for chain-comparison views. */
|
|
1166
1195
|
type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
|
|
1167
1196
|
|
|
1168
|
-
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, 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
|
|
1197
|
+
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, 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 MutationApplied as r, type NormalizedTokens as s, type OutcomeKind as t, type PerAxisMetricsByModel as u, type PromptSection as v, type SectionKind as w, type ToolDefinition as x };
|
|
@@ -238,6 +238,24 @@ interface CompilePolicy {
|
|
|
238
238
|
*/
|
|
239
239
|
posture?: 'locked' | 'preferred' | 'open';
|
|
240
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* alpha.41 — entry in `PromptIR.models[]`. Either a literal model id (the
|
|
243
|
+
* pre-alpha.41 shape, fully preserved) or a `{ family: string }` alias that
|
|
244
|
+
* resolves at compile() time to the latest-current model in that family.
|
|
245
|
+
*
|
|
246
|
+
* Family entries resolve via `resolveFamilyEntry` (internal twin of the
|
|
247
|
+
* public `getRecommendedPrimary`). Resolution fails CLOSED — a family that
|
|
248
|
+
* matches no current+active candidate throws `FamilyResolutionError` at
|
|
249
|
+
* compile time. Consumers who want a literal fallback should call
|
|
250
|
+
* `getRecommendedPrimary({ family, fallback, ... })` at IR-construction time
|
|
251
|
+
* and inline the resolved id, rather than passing `{ family }` into the IR.
|
|
252
|
+
*
|
|
253
|
+
* Family taxonomy is defined in `family-resolution.ts`; see also migration
|
|
254
|
+
* 024 (`kgauto_models.family` column + index).
|
|
255
|
+
*/
|
|
256
|
+
type ChainModelEntry = string | {
|
|
257
|
+
family: string;
|
|
258
|
+
};
|
|
241
259
|
/**
|
|
242
260
|
* The IR — the input to compile().
|
|
243
261
|
*/
|
|
@@ -254,8 +272,19 @@ interface PromptIR {
|
|
|
254
272
|
history?: Message[];
|
|
255
273
|
/** The user's current turn — never dropped. */
|
|
256
274
|
currentTurn?: Message;
|
|
257
|
-
/**
|
|
258
|
-
|
|
275
|
+
/**
|
|
276
|
+
* Allowed model IDs (or family aliases — alpha.41+), in caller-preference
|
|
277
|
+
* order. Compiler resolves family entries to literal ids before scoring
|
|
278
|
+
* and picks among them. See {@link ChainModelEntry}.
|
|
279
|
+
*
|
|
280
|
+
* Internal passes downstream of compile()'s family-resolution step
|
|
281
|
+
* receive a narrowed `string[]` shape — `string` is a subtype of
|
|
282
|
+
* `ChainModelEntry`, so a `string[]` IS a `ChainModelEntry[]` at the
|
|
283
|
+
* type level. Code that needs to access string ids (passes.ts) reads
|
|
284
|
+
* via `getModelIds(ir)` from `models-runtime.ts` rather than narrowing
|
|
285
|
+
* inline.
|
|
286
|
+
*/
|
|
287
|
+
models: ChainModelEntry[];
|
|
259
288
|
/** Compile constraints. */
|
|
260
289
|
constraints?: Constraints;
|
|
261
290
|
/**
|
|
@@ -1165,4 +1194,4 @@ interface PerAxisMetrics {
|
|
|
1165
1194
|
/** Per-axis metrics keyed by model — used for chain-comparison views. */
|
|
1166
1195
|
type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
|
|
1167
1196
|
|
|
1168
|
-
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, 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
|
|
1197
|
+
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, 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 MutationApplied as r, type NormalizedTokens as s, type OutcomeKind as t, type PerAxisMetricsByModel as u, type PromptSection as v, type SectionKind as w, type ToolDefinition as x };
|
package/dist/profiles.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as Provider } from './ir-
|
|
1
|
+
import { k as Provider } from './ir-D_kgJcaV.mjs';
|
|
2
2
|
import { IntentArchetypeName } from './dialect.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -118,6 +118,33 @@ interface ModelProfile {
|
|
|
118
118
|
* alpha.9.
|
|
119
119
|
*/
|
|
120
120
|
archetypePerf?: Partial<Record<IntentArchetypeName, number>>;
|
|
121
|
+
/**
|
|
122
|
+
* alpha.41 — model-family identifier (e.g. `'claude-opus'`,
|
|
123
|
+
* `'gemini-flash'`). Reads through from `kgauto_models.family` (migration
|
|
124
|
+
* 024). When unset on a brain row, runtime falls back to
|
|
125
|
+
* `deriveFamilyFromModelId(model.id)` (see `family-resolution.ts`).
|
|
126
|
+
*
|
|
127
|
+
* Used by `getRecommendedPrimary({ family, ... })` and the IR-level
|
|
128
|
+
* `{ family: string }` chain entry resolution at compile time.
|
|
129
|
+
*/
|
|
130
|
+
family?: string;
|
|
131
|
+
/**
|
|
132
|
+
* alpha.41 — version string of the kgauto release that first introduced
|
|
133
|
+
* this profile (e.g. `'2.0.0-alpha.36'`). Threaded through from the brain
|
|
134
|
+
* row's `version_added` column. Family-resolution sorts candidates by
|
|
135
|
+
* `version_added DESC` (lexicographic) as the secondary tiebreaker after
|
|
136
|
+
* `archetypePerf[archetype]`. Undefined on bundled profiles (no brain
|
|
137
|
+
* row).
|
|
138
|
+
*/
|
|
139
|
+
versionAdded?: string;
|
|
140
|
+
/**
|
|
141
|
+
* alpha.41 — whether the brain row is `active = TRUE`. False or undefined
|
|
142
|
+
* means the model is retired / not actively served (kgauto_models row
|
|
143
|
+
* exists but won't be selected by family resolution). Bundled profiles
|
|
144
|
+
* default to `true` when not threaded through (every PROFILES_RAW entry
|
|
145
|
+
* is by definition the active source of truth at bundle time).
|
|
146
|
+
*/
|
|
147
|
+
active?: boolean;
|
|
121
148
|
}
|
|
122
149
|
declare const ALIASES: Record<string, string>;
|
|
123
150
|
interface ProfileBrainHook {
|
package/dist/profiles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as Provider } from './ir-
|
|
1
|
+
import { k as Provider } from './ir-DYpvUSEw.js';
|
|
2
2
|
import { IntentArchetypeName } from './dialect.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -118,6 +118,33 @@ interface ModelProfile {
|
|
|
118
118
|
* alpha.9.
|
|
119
119
|
*/
|
|
120
120
|
archetypePerf?: Partial<Record<IntentArchetypeName, number>>;
|
|
121
|
+
/**
|
|
122
|
+
* alpha.41 — model-family identifier (e.g. `'claude-opus'`,
|
|
123
|
+
* `'gemini-flash'`). Reads through from `kgauto_models.family` (migration
|
|
124
|
+
* 024). When unset on a brain row, runtime falls back to
|
|
125
|
+
* `deriveFamilyFromModelId(model.id)` (see `family-resolution.ts`).
|
|
126
|
+
*
|
|
127
|
+
* Used by `getRecommendedPrimary({ family, ... })` and the IR-level
|
|
128
|
+
* `{ family: string }` chain entry resolution at compile time.
|
|
129
|
+
*/
|
|
130
|
+
family?: string;
|
|
131
|
+
/**
|
|
132
|
+
* alpha.41 — version string of the kgauto release that first introduced
|
|
133
|
+
* this profile (e.g. `'2.0.0-alpha.36'`). Threaded through from the brain
|
|
134
|
+
* row's `version_added` column. Family-resolution sorts candidates by
|
|
135
|
+
* `version_added DESC` (lexicographic) as the secondary tiebreaker after
|
|
136
|
+
* `archetypePerf[archetype]`. Undefined on bundled profiles (no brain
|
|
137
|
+
* row).
|
|
138
|
+
*/
|
|
139
|
+
versionAdded?: string;
|
|
140
|
+
/**
|
|
141
|
+
* alpha.41 — whether the brain row is `active = TRUE`. False or undefined
|
|
142
|
+
* means the model is retired / not actively served (kgauto_models row
|
|
143
|
+
* exists but won't be selected by family resolution). Bundled profiles
|
|
144
|
+
* default to `true` when not threaded through (every PROFILES_RAW entry
|
|
145
|
+
* is by definition the active source of truth at bundle time).
|
|
146
|
+
*/
|
|
147
|
+
active?: boolean;
|
|
121
148
|
}
|
|
122
149
|
declare const ALIASES: Record<string, string>;
|
|
123
150
|
interface ProfileBrainHook {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-DYpvUSEw.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-D_kgJcaV.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmdrift/kgauto-compiler",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.41",
|
|
4
4
|
"description": "Prompt compiler + central learning brain for multi-model AI apps. Swap models without rewriting prompts.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|