@warmdrift/kgauto-compiler 2.0.0-alpha.71 → 2.0.0-alpha.73
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/{chunk-SBFSYCQG.mjs → chunk-46U2NVOL.mjs} +1 -1
- package/dist/{chunk-URFQR3SB.mjs → chunk-65KZE7AC.mjs} +1 -1
- package/dist/{chunk-4UO4CCSP.mjs → chunk-N36LE3MK.mjs} +76 -5
- 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/index.js +76 -5
- package/dist/glassbox-routes/index.mjs +2 -2
- 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 +58 -10
- package/dist/index.d.ts +58 -10
- package/dist/index.js +186 -12
- package/dist/index.mjs +110 -9
- package/dist/{ir-BEQ28muo.d.ts → ir-B0v2f9NY.d.ts} +39 -0
- package/dist/{ir-CnnJST_N.d.mts → ir-CZukZvDn.d.mts} +39 -0
- package/dist/key-health.js +1 -1
- package/dist/key-health.mjs +1 -1
- package/dist/profiles.d.mts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +76 -5
- package/dist/profiles.mjs +1 -1
- package/dist/{types-DeGRCTlJ.d.mts → types-BOTLfJOp.d.mts} +1 -1
- package/dist/{types-DSeJJ6tt.d.ts → types-Ba68lIs1.d.ts} +1 -1
- package/dist/{types-BDFrJkma.d.mts → types-BgJ5iQB_.d.mts} +1 -1
- package/dist/{types-B--CYzMo.d.ts → types-D-PuKCWk.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -47,7 +47,8 @@ var PROFILES_RAW = [
|
|
|
47
47
|
id: "claude-fable-5",
|
|
48
48
|
verifiedAgainstDocs: "2026-06-21",
|
|
49
49
|
provider: "anthropic",
|
|
50
|
-
status: "
|
|
50
|
+
status: "current",
|
|
51
|
+
// s76 2026-07-25: GA since 2026-06-09 per docs; was preview.
|
|
51
52
|
maxContextTokens: 1e6,
|
|
52
53
|
maxOutputTokens: 128e3,
|
|
53
54
|
maxTools: 64,
|
|
@@ -101,7 +102,8 @@ var PROFILES_RAW = [
|
|
|
101
102
|
id: "claude-opus-4-8",
|
|
102
103
|
verifiedAgainstDocs: "2026-06-21",
|
|
103
104
|
provider: "anthropic",
|
|
104
|
-
status: "
|
|
105
|
+
status: "legacy",
|
|
106
|
+
// s76 2026-07-25: docs list as LEGACY (Opus 5 generation is current).
|
|
105
107
|
maxContextTokens: 1e6,
|
|
106
108
|
maxOutputTokens: 128e3,
|
|
107
109
|
maxTools: 64,
|
|
@@ -141,11 +143,78 @@ var PROFILES_RAW = [
|
|
|
141
143
|
classify: 8
|
|
142
144
|
}
|
|
143
145
|
},
|
|
146
|
+
{
|
|
147
|
+
// ── Claude Opus 5 — added s76 (2026-07-25, alpha.72) ──────────────────
|
|
148
|
+
// The model every seat in the portfolio actually runs, absent from the
|
|
149
|
+
// roster until now. Found by a catalog QA, not by the release watcher:
|
|
150
|
+
// the watcher detects unknown IDs on a provider's /models endpoint, but
|
|
151
|
+
// detection was never wired to ingestion, so the gap sat open. (That is
|
|
152
|
+
// what `scripts/catalog-sync.mjs` exists to close.)
|
|
153
|
+
//
|
|
154
|
+
// PROVENANCE — doc-verified 2026-07-25 against
|
|
155
|
+
// platform.claude.com/docs/en/docs/about-claude/models/overview:
|
|
156
|
+
// 1M context · 128k max output · $5/$25 per MTok · adaptive thinking YES
|
|
157
|
+
// · extended thinking NO · `effort` defaults to 'high' on the Claude API
|
|
158
|
+
// · reliable knowledge cutoff May 2026.
|
|
159
|
+
//
|
|
160
|
+
// FAMILY-INHERITED (not doc-read): maxTools, parallelToolCalls,
|
|
161
|
+
// structuredOutput, systemPromptMode, streaming. These are identical
|
|
162
|
+
// across opus-4-6 / 4-7 / 4-8 / sonnet-5 / fable-5 — five consecutive
|
|
163
|
+
// models — so they are a structural provider constant rather than a
|
|
164
|
+
// per-model value. Deliberately distinguished from the gemini-3.1-flash-lite
|
|
165
|
+
// failure, where a template-clone of PRICE (the field that actually varies,
|
|
166
|
+
// there by 2.5-3.75x) went unverified for 65 days.
|
|
167
|
+
id: "claude-opus-5",
|
|
168
|
+
verifiedAgainstDocs: "2026-07-25",
|
|
169
|
+
provider: "anthropic",
|
|
170
|
+
status: "current",
|
|
171
|
+
maxContextTokens: 1e6,
|
|
172
|
+
maxOutputTokens: 128e3,
|
|
173
|
+
maxTools: 64,
|
|
174
|
+
parallelToolCalls: true,
|
|
175
|
+
structuredOutput: "grammar",
|
|
176
|
+
systemPromptMode: "inline",
|
|
177
|
+
streaming: true,
|
|
178
|
+
cliffs: [],
|
|
179
|
+
costInputPer1m: 5,
|
|
180
|
+
costOutputPer1m: 25,
|
|
181
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
182
|
+
recovery: [
|
|
183
|
+
{
|
|
184
|
+
signal: "rate_limit",
|
|
185
|
+
action: "escalate",
|
|
186
|
+
reason: "429 from Anthropic \u2014 escalate to fallback chain"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
signal: "model_not_found",
|
|
190
|
+
action: "escalate",
|
|
191
|
+
reason: "Model deprecated/renamed \u2014 escalate (L-061)"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
|
|
195
|
+
weaknesses: ["cost", "latency"],
|
|
196
|
+
notes: "Anthropic frontier for complex agentic coding + enterprise work; the Opus-tier current default as of 2026-07-25, superseding 4.8/4.7/4.6 (all now legacy). Doc-verified 2026-07-25: 1M ctx, 128k out, $5/$25, adaptive thinking (extended thinking NOT supported \u2014 that is Haiku 4.5 only in this generation), `effort` defaults to high on the Claude API. Price is unchanged from 4.5 through 5 \u2014 the tier moved without a cost change.",
|
|
197
|
+
// COLD-START PRIOR cloned from claude-opus-4-8. Self-labelling: below
|
|
198
|
+
// MEASURED_GROUNDING_MIN_N (10) brain rows these resolve as
|
|
199
|
+
// grounding:'judgment', so nothing reads them as measured until they are.
|
|
200
|
+
archetypePerf: {
|
|
201
|
+
critique: 10,
|
|
202
|
+
plan: 10,
|
|
203
|
+
generate: 9,
|
|
204
|
+
ask: 9,
|
|
205
|
+
extract: 9,
|
|
206
|
+
transform: 9,
|
|
207
|
+
hunt: 8,
|
|
208
|
+
summarize: 8,
|
|
209
|
+
classify: 8
|
|
210
|
+
}
|
|
211
|
+
},
|
|
144
212
|
{
|
|
145
213
|
id: "claude-opus-4-7",
|
|
146
214
|
verifiedAgainstDocs: "2026-05-08",
|
|
147
215
|
provider: "anthropic",
|
|
148
|
-
status: "
|
|
216
|
+
status: "legacy",
|
|
217
|
+
// s76 2026-07-25: docs list as LEGACY (Opus 5 is current). Bundle said current while the brain already said legacy — the two disagreed.
|
|
149
218
|
maxContextTokens: 1e6,
|
|
150
219
|
maxOutputTokens: 128e3,
|
|
151
220
|
maxTools: 64,
|
|
@@ -239,7 +308,8 @@ var PROFILES_RAW = [
|
|
|
239
308
|
id: "claude-sonnet-4-6",
|
|
240
309
|
verifiedAgainstDocs: "2026-05-08",
|
|
241
310
|
provider: "anthropic",
|
|
242
|
-
status: "
|
|
311
|
+
status: "legacy",
|
|
312
|
+
// s76 2026-07-25: docs list as LEGACY (Sonnet 5 is current).
|
|
243
313
|
maxContextTokens: 1e6,
|
|
244
314
|
maxOutputTokens: 64e3,
|
|
245
315
|
maxTools: 64,
|
|
@@ -1378,7 +1448,8 @@ var PROFILES_RAW = [
|
|
|
1378
1448
|
id: "claude-sonnet-5",
|
|
1379
1449
|
verifiedAgainstDocs: "2026-07-02",
|
|
1380
1450
|
provider: "anthropic",
|
|
1381
|
-
status: "
|
|
1451
|
+
status: "current",
|
|
1452
|
+
// s76 2026-07-25: GA per docs; was preview.
|
|
1382
1453
|
maxContextTokens: 1e6,
|
|
1383
1454
|
maxOutputTokens: 128e3,
|
|
1384
1455
|
maxTools: 64,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
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-
|
|
3
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-BgJ5iQB_.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-BgJ5iQB_.mjs';
|
|
3
|
+
import '../ir-CZukZvDn.mjs';
|
|
4
4
|
import '../dialect.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/glassbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
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-
|
|
3
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-D-PuKCWk.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-D-PuKCWk.js';
|
|
3
|
+
import '../ir-B0v2f9NY.js';
|
|
4
4
|
import '../dialect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-
|
|
3
|
-
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-
|
|
4
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-BgJ5iQB_.mjs';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-BOTLfJOp.mjs';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-BOTLfJOp.mjs';
|
|
4
|
+
import '../ir-CZukZvDn.mjs';
|
|
5
5
|
import '../dialect.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-
|
|
3
|
-
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-
|
|
4
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-D-PuKCWk.js';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-Ba68lIs1.js';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-Ba68lIs1.js';
|
|
4
|
+
import '../ir-B0v2f9NY.js';
|
|
5
5
|
import '../dialect.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -101,7 +101,8 @@ var PROFILES_RAW = [
|
|
|
101
101
|
id: "claude-fable-5",
|
|
102
102
|
verifiedAgainstDocs: "2026-06-21",
|
|
103
103
|
provider: "anthropic",
|
|
104
|
-
status: "
|
|
104
|
+
status: "current",
|
|
105
|
+
// s76 2026-07-25: GA since 2026-06-09 per docs; was preview.
|
|
105
106
|
maxContextTokens: 1e6,
|
|
106
107
|
maxOutputTokens: 128e3,
|
|
107
108
|
maxTools: 64,
|
|
@@ -155,7 +156,8 @@ var PROFILES_RAW = [
|
|
|
155
156
|
id: "claude-opus-4-8",
|
|
156
157
|
verifiedAgainstDocs: "2026-06-21",
|
|
157
158
|
provider: "anthropic",
|
|
158
|
-
status: "
|
|
159
|
+
status: "legacy",
|
|
160
|
+
// s76 2026-07-25: docs list as LEGACY (Opus 5 generation is current).
|
|
159
161
|
maxContextTokens: 1e6,
|
|
160
162
|
maxOutputTokens: 128e3,
|
|
161
163
|
maxTools: 64,
|
|
@@ -195,11 +197,78 @@ var PROFILES_RAW = [
|
|
|
195
197
|
classify: 8
|
|
196
198
|
}
|
|
197
199
|
},
|
|
200
|
+
{
|
|
201
|
+
// ── Claude Opus 5 — added s76 (2026-07-25, alpha.72) ──────────────────
|
|
202
|
+
// The model every seat in the portfolio actually runs, absent from the
|
|
203
|
+
// roster until now. Found by a catalog QA, not by the release watcher:
|
|
204
|
+
// the watcher detects unknown IDs on a provider's /models endpoint, but
|
|
205
|
+
// detection was never wired to ingestion, so the gap sat open. (That is
|
|
206
|
+
// what `scripts/catalog-sync.mjs` exists to close.)
|
|
207
|
+
//
|
|
208
|
+
// PROVENANCE — doc-verified 2026-07-25 against
|
|
209
|
+
// platform.claude.com/docs/en/docs/about-claude/models/overview:
|
|
210
|
+
// 1M context · 128k max output · $5/$25 per MTok · adaptive thinking YES
|
|
211
|
+
// · extended thinking NO · `effort` defaults to 'high' on the Claude API
|
|
212
|
+
// · reliable knowledge cutoff May 2026.
|
|
213
|
+
//
|
|
214
|
+
// FAMILY-INHERITED (not doc-read): maxTools, parallelToolCalls,
|
|
215
|
+
// structuredOutput, systemPromptMode, streaming. These are identical
|
|
216
|
+
// across opus-4-6 / 4-7 / 4-8 / sonnet-5 / fable-5 — five consecutive
|
|
217
|
+
// models — so they are a structural provider constant rather than a
|
|
218
|
+
// per-model value. Deliberately distinguished from the gemini-3.1-flash-lite
|
|
219
|
+
// failure, where a template-clone of PRICE (the field that actually varies,
|
|
220
|
+
// there by 2.5-3.75x) went unverified for 65 days.
|
|
221
|
+
id: "claude-opus-5",
|
|
222
|
+
verifiedAgainstDocs: "2026-07-25",
|
|
223
|
+
provider: "anthropic",
|
|
224
|
+
status: "current",
|
|
225
|
+
maxContextTokens: 1e6,
|
|
226
|
+
maxOutputTokens: 128e3,
|
|
227
|
+
maxTools: 64,
|
|
228
|
+
parallelToolCalls: true,
|
|
229
|
+
structuredOutput: "grammar",
|
|
230
|
+
systemPromptMode: "inline",
|
|
231
|
+
streaming: true,
|
|
232
|
+
cliffs: [],
|
|
233
|
+
costInputPer1m: 5,
|
|
234
|
+
costOutputPer1m: 25,
|
|
235
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
236
|
+
recovery: [
|
|
237
|
+
{
|
|
238
|
+
signal: "rate_limit",
|
|
239
|
+
action: "escalate",
|
|
240
|
+
reason: "429 from Anthropic \u2014 escalate to fallback chain"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
signal: "model_not_found",
|
|
244
|
+
action: "escalate",
|
|
245
|
+
reason: "Model deprecated/renamed \u2014 escalate (L-061)"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
|
|
249
|
+
weaknesses: ["cost", "latency"],
|
|
250
|
+
notes: "Anthropic frontier for complex agentic coding + enterprise work; the Opus-tier current default as of 2026-07-25, superseding 4.8/4.7/4.6 (all now legacy). Doc-verified 2026-07-25: 1M ctx, 128k out, $5/$25, adaptive thinking (extended thinking NOT supported \u2014 that is Haiku 4.5 only in this generation), `effort` defaults to high on the Claude API. Price is unchanged from 4.5 through 5 \u2014 the tier moved without a cost change.",
|
|
251
|
+
// COLD-START PRIOR cloned from claude-opus-4-8. Self-labelling: below
|
|
252
|
+
// MEASURED_GROUNDING_MIN_N (10) brain rows these resolve as
|
|
253
|
+
// grounding:'judgment', so nothing reads them as measured until they are.
|
|
254
|
+
archetypePerf: {
|
|
255
|
+
critique: 10,
|
|
256
|
+
plan: 10,
|
|
257
|
+
generate: 9,
|
|
258
|
+
ask: 9,
|
|
259
|
+
extract: 9,
|
|
260
|
+
transform: 9,
|
|
261
|
+
hunt: 8,
|
|
262
|
+
summarize: 8,
|
|
263
|
+
classify: 8
|
|
264
|
+
}
|
|
265
|
+
},
|
|
198
266
|
{
|
|
199
267
|
id: "claude-opus-4-7",
|
|
200
268
|
verifiedAgainstDocs: "2026-05-08",
|
|
201
269
|
provider: "anthropic",
|
|
202
|
-
status: "
|
|
270
|
+
status: "legacy",
|
|
271
|
+
// s76 2026-07-25: docs list as LEGACY (Opus 5 is current). Bundle said current while the brain already said legacy — the two disagreed.
|
|
203
272
|
maxContextTokens: 1e6,
|
|
204
273
|
maxOutputTokens: 128e3,
|
|
205
274
|
maxTools: 64,
|
|
@@ -293,7 +362,8 @@ var PROFILES_RAW = [
|
|
|
293
362
|
id: "claude-sonnet-4-6",
|
|
294
363
|
verifiedAgainstDocs: "2026-05-08",
|
|
295
364
|
provider: "anthropic",
|
|
296
|
-
status: "
|
|
365
|
+
status: "legacy",
|
|
366
|
+
// s76 2026-07-25: docs list as LEGACY (Sonnet 5 is current).
|
|
297
367
|
maxContextTokens: 1e6,
|
|
298
368
|
maxOutputTokens: 64e3,
|
|
299
369
|
maxTools: 64,
|
|
@@ -1432,7 +1502,8 @@ var PROFILES_RAW = [
|
|
|
1432
1502
|
id: "claude-sonnet-5",
|
|
1433
1503
|
verifiedAgainstDocs: "2026-07-02",
|
|
1434
1504
|
provider: "anthropic",
|
|
1435
|
-
status: "
|
|
1505
|
+
status: "current",
|
|
1506
|
+
// s76 2026-07-25: GA per docs; was preview.
|
|
1436
1507
|
maxContextTokens: 1e6,
|
|
1437
1508
|
maxOutputTokens: 128e3,
|
|
1438
1509
|
maxTools: 64,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARCHETYPE_FLOOR_DEFAULT,
|
|
3
3
|
getDefaultFallbackChain
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-46U2NVOL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
tryGetProfile
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-N36LE3MK.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-
|
|
3
|
-
import '../../ir-
|
|
2
|
+
import { a as TraceDetail } from '../../types-BOTLfJOp.mjs';
|
|
3
|
+
import '../../ir-CZukZvDn.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-
|
|
3
|
-
import '../../ir-
|
|
2
|
+
import { a as TraceDetail } from '../../types-Ba68lIs1.js';
|
|
3
|
+
import '../../ir-B0v2f9NY.js';
|
|
4
4
|
import '../../dialect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-
|
|
2
|
-
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-
|
|
1
|
+
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-CZukZvDn.mjs';
|
|
2
|
+
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-CZukZvDn.mjs';
|
|
3
3
|
import { ModelProfile, ArchetypeConvention } from './profiles.mjs';
|
|
4
4
|
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, tryGetProfile } from './profiles.mjs';
|
|
5
5
|
export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.mjs';
|
|
@@ -120,11 +120,6 @@ declare function execute(request: CompiledRequest, opts?: ExecuteOptions): Promi
|
|
|
120
120
|
* Hard cap at fallbackChain.length + 1 attempts. Terminal errors short-circuit.
|
|
121
121
|
*/
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* Compile, execute, normalize, record. Returns a CallResult once a provider
|
|
125
|
-
* actually serves the request. Throws CallError if the fallback chain is
|
|
126
|
-
* exhausted without success.
|
|
127
|
-
*/
|
|
128
123
|
declare function call(ir: PromptIR, opts?: CallOptions): Promise<CallResult>;
|
|
129
124
|
/** Served-side result the AI-SDK consumer already holds from streamText. */
|
|
130
125
|
interface ProbeShadowServed {
|
|
@@ -440,6 +435,19 @@ interface BrainQueryConfig {
|
|
|
440
435
|
interface BrainConfig {
|
|
441
436
|
/** Brain HTTP endpoint base URL (e.g., https://kgauto-brain.vercel.app/api). */
|
|
442
437
|
endpoint: string;
|
|
438
|
+
/**
|
|
439
|
+
* alpha.73 — the consumer's app id, declared once so brain-driven levers can
|
|
440
|
+
* start their first read at configuration time instead of at the first
|
|
441
|
+
* compile.
|
|
442
|
+
*
|
|
443
|
+
* Optional and purely an optimisation: every IR already carries `appId`, and
|
|
444
|
+
* omitting this changes no verdict — it only means the measured-failure
|
|
445
|
+
* gate's warm-up starts when `call()` runs rather than when the module
|
|
446
|
+
* initialises. Declaring it lets a short-lived isolate spend its startup
|
|
447
|
+
* time on the fetch, so the bounded wait in `call()` usually costs nothing.
|
|
448
|
+
* Consumers running one app per process should set it.
|
|
449
|
+
*/
|
|
450
|
+
appId?: string;
|
|
443
451
|
/** Bearer token for auth. */
|
|
444
452
|
apiKey?: string;
|
|
445
453
|
/** Optional error hook for debugging. Defaults to console.warn. */
|
|
@@ -1009,7 +1017,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
|
|
|
1009
1017
|
* guard in `tests/version.test.ts` fails the suite (and therefore
|
|
1010
1018
|
* `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
|
|
1011
1019
|
*/
|
|
1012
|
-
declare const LIBRARY_VERSION = "2.0.0-alpha.
|
|
1020
|
+
declare const LIBRARY_VERSION = "2.0.0-alpha.73";
|
|
1013
1021
|
|
|
1014
1022
|
/**
|
|
1015
1023
|
* Oracle contract — how an app tells the brain whether a response was good.
|
|
@@ -2997,12 +3005,52 @@ interface GetMeasuredFailureOpts {
|
|
|
2997
3005
|
archetype: IntentArchetypeName | string;
|
|
2998
3006
|
model: string;
|
|
2999
3007
|
}
|
|
3008
|
+
/**
|
|
3009
|
+
* alpha.73 — start the warm-up WITHOUT needing a compile to trigger it.
|
|
3010
|
+
*
|
|
3011
|
+
* The SWR posture below ("cold start returns undefined and warms in the
|
|
3012
|
+
* background") is right for a long-lived process and wrong for a
|
|
3013
|
+
* short-lived isolate, where the first compile IS most compiles. Measured on
|
|
3014
|
+
* playbacksam: on a cold isolate the gate was absent, `claude-haiku-4-5` led,
|
|
3015
|
+
* cliffed, was same-model retried and fell over to gemini — two billed
|
|
3016
|
+
* inferences and ~27–34s, every time an isolate is new. PB has ~1 user, so
|
|
3017
|
+
* its isolates are cold most of the time, which inverts the usual severity
|
|
3018
|
+
* ordering: this hits the LOWEST-traffic consumers hardest, and they are the
|
|
3019
|
+
* ones least able to absorb it.
|
|
3020
|
+
*
|
|
3021
|
+
* Kicking the fetch off at `configureBrain()` moves the refresh into the time
|
|
3022
|
+
* the isolate spends on everything else it does before its first compile.
|
|
3023
|
+
* Fire-and-forget and non-blocking: on its own this narrows the window rather
|
|
3024
|
+
* than closing it, which is why `awaitMeasuredFailureReady()` exists too.
|
|
3025
|
+
*
|
|
3026
|
+
* Returns the in-flight promise (or undefined when not configured / already
|
|
3027
|
+
* fresh) so a caller can await it. NEVER throws.
|
|
3028
|
+
*/
|
|
3029
|
+
declare function prefetchMeasuredFailure(appId: string): Promise<void> | undefined;
|
|
3030
|
+
/**
|
|
3031
|
+
* alpha.73 — bounded await on the warm-up, for async callers only.
|
|
3032
|
+
*
|
|
3033
|
+
* `compile()` is synchronous and must stay so, so it cannot block on a fetch;
|
|
3034
|
+
* `call()` is async and is about to spend seconds on an inference, which makes
|
|
3035
|
+
* a few hundred milliseconds here a trivially good trade against the ~27–34s
|
|
3036
|
+
* and second billed inference a cold-blind gate costs.
|
|
3037
|
+
*
|
|
3038
|
+
* Deliberately bounded and deliberately silent on timeout: the gate is
|
|
3039
|
+
* protective, never required. If the brain is slow or down, the caller
|
|
3040
|
+
* proceeds un-gated exactly as it does today — this can delay a call by at
|
|
3041
|
+
* most `timeoutMs`, and can never fail one.
|
|
3042
|
+
*
|
|
3043
|
+
* NEVER throws.
|
|
3044
|
+
*/
|
|
3045
|
+
declare function awaitMeasuredFailureReady(appId: string, timeoutMs: number): Promise<void>;
|
|
3000
3046
|
/**
|
|
3001
3047
|
* Sync reader. Returns the verdict for `(appId, archetype, model)` or
|
|
3002
3048
|
* undefined (not configured / cold / below minSample / brain down).
|
|
3003
3049
|
*
|
|
3004
3050
|
* NEVER throws. Cold start returns undefined and warms in the background —
|
|
3005
|
-
* same posture as every other brain-driven lever in compile().
|
|
3051
|
+
* same posture as every other brain-driven lever in compile(). Async callers
|
|
3052
|
+
* that can afford a bounded wait should call `awaitMeasuredFailureReady()`
|
|
3053
|
+
* first; `call()` does.
|
|
3006
3054
|
*/
|
|
3007
3055
|
declare function getMeasuredFailureVerdict(opts: GetMeasuredFailureOpts): MeasuredFailureVerdict | undefined;
|
|
3008
3056
|
declare function _testResetMeasuredFailure(): void;
|
|
@@ -3054,4 +3102,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
|
|
|
3054
3102
|
*/
|
|
3055
3103
|
declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
|
|
3056
3104
|
|
|
3057
|
-
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, setTokenizer, wilsonLowerBound };
|
|
3105
|
+
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, setTokenizer, wilsonLowerBound };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-
|
|
2
|
-
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-
|
|
1
|
+
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-B0v2f9NY.js';
|
|
2
|
+
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-B0v2f9NY.js';
|
|
3
3
|
import { ModelProfile, ArchetypeConvention } from './profiles.js';
|
|
4
4
|
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, tryGetProfile } from './profiles.js';
|
|
5
5
|
export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.js';
|
|
@@ -120,11 +120,6 @@ declare function execute(request: CompiledRequest, opts?: ExecuteOptions): Promi
|
|
|
120
120
|
* Hard cap at fallbackChain.length + 1 attempts. Terminal errors short-circuit.
|
|
121
121
|
*/
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* Compile, execute, normalize, record. Returns a CallResult once a provider
|
|
125
|
-
* actually serves the request. Throws CallError if the fallback chain is
|
|
126
|
-
* exhausted without success.
|
|
127
|
-
*/
|
|
128
123
|
declare function call(ir: PromptIR, opts?: CallOptions): Promise<CallResult>;
|
|
129
124
|
/** Served-side result the AI-SDK consumer already holds from streamText. */
|
|
130
125
|
interface ProbeShadowServed {
|
|
@@ -440,6 +435,19 @@ interface BrainQueryConfig {
|
|
|
440
435
|
interface BrainConfig {
|
|
441
436
|
/** Brain HTTP endpoint base URL (e.g., https://kgauto-brain.vercel.app/api). */
|
|
442
437
|
endpoint: string;
|
|
438
|
+
/**
|
|
439
|
+
* alpha.73 — the consumer's app id, declared once so brain-driven levers can
|
|
440
|
+
* start their first read at configuration time instead of at the first
|
|
441
|
+
* compile.
|
|
442
|
+
*
|
|
443
|
+
* Optional and purely an optimisation: every IR already carries `appId`, and
|
|
444
|
+
* omitting this changes no verdict — it only means the measured-failure
|
|
445
|
+
* gate's warm-up starts when `call()` runs rather than when the module
|
|
446
|
+
* initialises. Declaring it lets a short-lived isolate spend its startup
|
|
447
|
+
* time on the fetch, so the bounded wait in `call()` usually costs nothing.
|
|
448
|
+
* Consumers running one app per process should set it.
|
|
449
|
+
*/
|
|
450
|
+
appId?: string;
|
|
443
451
|
/** Bearer token for auth. */
|
|
444
452
|
apiKey?: string;
|
|
445
453
|
/** Optional error hook for debugging. Defaults to console.warn. */
|
|
@@ -1009,7 +1017,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
|
|
|
1009
1017
|
* guard in `tests/version.test.ts` fails the suite (and therefore
|
|
1010
1018
|
* `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
|
|
1011
1019
|
*/
|
|
1012
|
-
declare const LIBRARY_VERSION = "2.0.0-alpha.
|
|
1020
|
+
declare const LIBRARY_VERSION = "2.0.0-alpha.73";
|
|
1013
1021
|
|
|
1014
1022
|
/**
|
|
1015
1023
|
* Oracle contract — how an app tells the brain whether a response was good.
|
|
@@ -2997,12 +3005,52 @@ interface GetMeasuredFailureOpts {
|
|
|
2997
3005
|
archetype: IntentArchetypeName | string;
|
|
2998
3006
|
model: string;
|
|
2999
3007
|
}
|
|
3008
|
+
/**
|
|
3009
|
+
* alpha.73 — start the warm-up WITHOUT needing a compile to trigger it.
|
|
3010
|
+
*
|
|
3011
|
+
* The SWR posture below ("cold start returns undefined and warms in the
|
|
3012
|
+
* background") is right for a long-lived process and wrong for a
|
|
3013
|
+
* short-lived isolate, where the first compile IS most compiles. Measured on
|
|
3014
|
+
* playbacksam: on a cold isolate the gate was absent, `claude-haiku-4-5` led,
|
|
3015
|
+
* cliffed, was same-model retried and fell over to gemini — two billed
|
|
3016
|
+
* inferences and ~27–34s, every time an isolate is new. PB has ~1 user, so
|
|
3017
|
+
* its isolates are cold most of the time, which inverts the usual severity
|
|
3018
|
+
* ordering: this hits the LOWEST-traffic consumers hardest, and they are the
|
|
3019
|
+
* ones least able to absorb it.
|
|
3020
|
+
*
|
|
3021
|
+
* Kicking the fetch off at `configureBrain()` moves the refresh into the time
|
|
3022
|
+
* the isolate spends on everything else it does before its first compile.
|
|
3023
|
+
* Fire-and-forget and non-blocking: on its own this narrows the window rather
|
|
3024
|
+
* than closing it, which is why `awaitMeasuredFailureReady()` exists too.
|
|
3025
|
+
*
|
|
3026
|
+
* Returns the in-flight promise (or undefined when not configured / already
|
|
3027
|
+
* fresh) so a caller can await it. NEVER throws.
|
|
3028
|
+
*/
|
|
3029
|
+
declare function prefetchMeasuredFailure(appId: string): Promise<void> | undefined;
|
|
3030
|
+
/**
|
|
3031
|
+
* alpha.73 — bounded await on the warm-up, for async callers only.
|
|
3032
|
+
*
|
|
3033
|
+
* `compile()` is synchronous and must stay so, so it cannot block on a fetch;
|
|
3034
|
+
* `call()` is async and is about to spend seconds on an inference, which makes
|
|
3035
|
+
* a few hundred milliseconds here a trivially good trade against the ~27–34s
|
|
3036
|
+
* and second billed inference a cold-blind gate costs.
|
|
3037
|
+
*
|
|
3038
|
+
* Deliberately bounded and deliberately silent on timeout: the gate is
|
|
3039
|
+
* protective, never required. If the brain is slow or down, the caller
|
|
3040
|
+
* proceeds un-gated exactly as it does today — this can delay a call by at
|
|
3041
|
+
* most `timeoutMs`, and can never fail one.
|
|
3042
|
+
*
|
|
3043
|
+
* NEVER throws.
|
|
3044
|
+
*/
|
|
3045
|
+
declare function awaitMeasuredFailureReady(appId: string, timeoutMs: number): Promise<void>;
|
|
3000
3046
|
/**
|
|
3001
3047
|
* Sync reader. Returns the verdict for `(appId, archetype, model)` or
|
|
3002
3048
|
* undefined (not configured / cold / below minSample / brain down).
|
|
3003
3049
|
*
|
|
3004
3050
|
* NEVER throws. Cold start returns undefined and warms in the background —
|
|
3005
|
-
* same posture as every other brain-driven lever in compile().
|
|
3051
|
+
* same posture as every other brain-driven lever in compile(). Async callers
|
|
3052
|
+
* that can afford a bounded wait should call `awaitMeasuredFailureReady()`
|
|
3053
|
+
* first; `call()` does.
|
|
3006
3054
|
*/
|
|
3007
3055
|
declare function getMeasuredFailureVerdict(opts: GetMeasuredFailureOpts): MeasuredFailureVerdict | undefined;
|
|
3008
3056
|
declare function _testResetMeasuredFailure(): void;
|
|
@@ -3054,4 +3102,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
|
|
|
3054
3102
|
*/
|
|
3055
3103
|
declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
|
|
3056
3104
|
|
|
3057
|
-
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, setTokenizer, wilsonLowerBound };
|
|
3105
|
+
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, setTokenizer, wilsonLowerBound };
|