@warmdrift/kgauto-check 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -3
- package/dist/bin.js +1 -1
- package/dist/chunk-XWIGHIJP.js +4484 -0
- package/dist/index.d.ts +241 -14
- package/dist/index.js +13 -1
- package/package.json +4 -4
- package/dist/chunk-BWPYT7JO.js +0 -465
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ declare const CallSiteSchema: z.ZodObject<{
|
|
|
16
16
|
model: z.ZodString;
|
|
17
17
|
/** How the model id is selected at this site. */
|
|
18
18
|
modelSelection: z.ZodOptional<z.ZodEnum<["hardcoded", "config", "env", "dynamic"]>>;
|
|
19
|
+
/**
|
|
20
|
+
* 0.4.0 (Amendment B): where the request is served, when the code shows it — the
|
|
21
|
+
* provider's own API, or a cloud platform that serves the provider's models on its
|
|
22
|
+
* own lifecycle schedule. Omit when you cannot tell.
|
|
23
|
+
*/
|
|
24
|
+
platform: z.ZodOptional<z.ZodEnum<["provider-api", "vertex", "bedrock", "azure", "other"]>>;
|
|
19
25
|
/**
|
|
20
26
|
* Best-guess intent archetype from kgauto's dialect (ask, classify,
|
|
21
27
|
* critique, extract, generate, hunt, plan, summarize, transform).
|
|
@@ -47,6 +53,7 @@ declare const CallSiteSchema: z.ZodObject<{
|
|
|
47
53
|
id: string;
|
|
48
54
|
model: string;
|
|
49
55
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
56
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
50
57
|
archetype?: string | undefined;
|
|
51
58
|
estInputTokens?: number | undefined;
|
|
52
59
|
maxInputTokens?: number | undefined;
|
|
@@ -63,6 +70,7 @@ declare const CallSiteSchema: z.ZodObject<{
|
|
|
63
70
|
id: string;
|
|
64
71
|
model: string;
|
|
65
72
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
73
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
66
74
|
archetype?: string | undefined;
|
|
67
75
|
estInputTokens?: number | undefined;
|
|
68
76
|
maxInputTokens?: number | undefined;
|
|
@@ -76,6 +84,38 @@ declare const CallSiteSchema: z.ZodObject<{
|
|
|
76
84
|
estCallsPerMonth?: number | undefined;
|
|
77
85
|
notes?: string | undefined;
|
|
78
86
|
}>;
|
|
87
|
+
/**
|
|
88
|
+
* 0.4.0 (R5) — a model id the project holds where no literal call site
|
|
89
|
+
* carries it: a model picker, a config default, an environment default, a
|
|
90
|
+
* list of supported models. The card reports on its lifecycle; there is no
|
|
91
|
+
* request shape to check it against.
|
|
92
|
+
*/
|
|
93
|
+
declare const ModelMentionSchema: z.ZodObject<{
|
|
94
|
+
/** Model id exactly as written in the project. */
|
|
95
|
+
model: z.ZodString;
|
|
96
|
+
/** Where it is written, e.g. "src/config/models.ts:14". */
|
|
97
|
+
where: z.ZodString;
|
|
98
|
+
modelSelection: z.ZodOptional<z.ZodEnum<["hardcoded", "config", "env", "dynamic"]>>;
|
|
99
|
+
/**
|
|
100
|
+
* 0.4.0 (Amendment B): where the request is served, when the code shows it — the
|
|
101
|
+
* provider's own API, or a cloud platform that serves the provider's models on its
|
|
102
|
+
* own lifecycle schedule. Omit when you cannot tell.
|
|
103
|
+
*/
|
|
104
|
+
platform: z.ZodOptional<z.ZodEnum<["provider-api", "vertex", "bedrock", "azure", "other"]>>;
|
|
105
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
model: string;
|
|
108
|
+
where: string;
|
|
109
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
110
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
111
|
+
notes?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
model: string;
|
|
114
|
+
where: string;
|
|
115
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
116
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
117
|
+
notes?: string | undefined;
|
|
118
|
+
}>;
|
|
79
119
|
declare const ExtractSchema: z.ZodObject<{
|
|
80
120
|
project: z.ZodObject<{
|
|
81
121
|
name: z.ZodString;
|
|
@@ -87,6 +127,7 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
87
127
|
name: string;
|
|
88
128
|
description?: string | undefined;
|
|
89
129
|
}>;
|
|
130
|
+
/** May be empty (0.4.0): a project with no literal call site still gets a card. */
|
|
90
131
|
callSites: z.ZodArray<z.ZodObject<{
|
|
91
132
|
/** Agent-chosen stable label, e.g. "api/summarize.ts:42" or "hunt loop". */
|
|
92
133
|
id: z.ZodString;
|
|
@@ -94,6 +135,12 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
94
135
|
model: z.ZodString;
|
|
95
136
|
/** How the model id is selected at this site. */
|
|
96
137
|
modelSelection: z.ZodOptional<z.ZodEnum<["hardcoded", "config", "env", "dynamic"]>>;
|
|
138
|
+
/**
|
|
139
|
+
* 0.4.0 (Amendment B): where the request is served, when the code shows it — the
|
|
140
|
+
* provider's own API, or a cloud platform that serves the provider's models on its
|
|
141
|
+
* own lifecycle schedule. Omit when you cannot tell.
|
|
142
|
+
*/
|
|
143
|
+
platform: z.ZodOptional<z.ZodEnum<["provider-api", "vertex", "bedrock", "azure", "other"]>>;
|
|
97
144
|
/**
|
|
98
145
|
* Best-guess intent archetype from kgauto's dialect (ask, classify,
|
|
99
146
|
* critique, extract, generate, hunt, plan, summarize, transform).
|
|
@@ -125,6 +172,7 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
125
172
|
id: string;
|
|
126
173
|
model: string;
|
|
127
174
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
175
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
128
176
|
archetype?: string | undefined;
|
|
129
177
|
estInputTokens?: number | undefined;
|
|
130
178
|
maxInputTokens?: number | undefined;
|
|
@@ -141,6 +189,7 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
141
189
|
id: string;
|
|
142
190
|
model: string;
|
|
143
191
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
192
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
144
193
|
archetype?: string | undefined;
|
|
145
194
|
estInputTokens?: number | undefined;
|
|
146
195
|
maxInputTokens?: number | undefined;
|
|
@@ -154,6 +203,33 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
154
203
|
estCallsPerMonth?: number | undefined;
|
|
155
204
|
notes?: string | undefined;
|
|
156
205
|
}>, "many">;
|
|
206
|
+
/** Model ids no call site carries (0.4.0). */
|
|
207
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
208
|
+
/** Model id exactly as written in the project. */
|
|
209
|
+
model: z.ZodString;
|
|
210
|
+
/** Where it is written, e.g. "src/config/models.ts:14". */
|
|
211
|
+
where: z.ZodString;
|
|
212
|
+
modelSelection: z.ZodOptional<z.ZodEnum<["hardcoded", "config", "env", "dynamic"]>>;
|
|
213
|
+
/**
|
|
214
|
+
* 0.4.0 (Amendment B): where the request is served, when the code shows it — the
|
|
215
|
+
* provider's own API, or a cloud platform that serves the provider's models on its
|
|
216
|
+
* own lifecycle schedule. Omit when you cannot tell.
|
|
217
|
+
*/
|
|
218
|
+
platform: z.ZodOptional<z.ZodEnum<["provider-api", "vertex", "bedrock", "azure", "other"]>>;
|
|
219
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
model: string;
|
|
222
|
+
where: string;
|
|
223
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
224
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
225
|
+
notes?: string | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
model: string;
|
|
228
|
+
where: string;
|
|
229
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
230
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
231
|
+
notes?: string | undefined;
|
|
232
|
+
}>, "many">>;
|
|
157
233
|
notes: z.ZodOptional<z.ZodString>;
|
|
158
234
|
}, "strip", z.ZodTypeAny, {
|
|
159
235
|
project: {
|
|
@@ -164,6 +240,7 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
164
240
|
id: string;
|
|
165
241
|
model: string;
|
|
166
242
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
243
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
167
244
|
archetype?: string | undefined;
|
|
168
245
|
estInputTokens?: number | undefined;
|
|
169
246
|
maxInputTokens?: number | undefined;
|
|
@@ -178,6 +255,13 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
178
255
|
notes?: string | undefined;
|
|
179
256
|
}[];
|
|
180
257
|
notes?: string | undefined;
|
|
258
|
+
models?: {
|
|
259
|
+
model: string;
|
|
260
|
+
where: string;
|
|
261
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
262
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
263
|
+
notes?: string | undefined;
|
|
264
|
+
}[] | undefined;
|
|
181
265
|
}, {
|
|
182
266
|
project: {
|
|
183
267
|
name: string;
|
|
@@ -187,6 +271,7 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
187
271
|
id: string;
|
|
188
272
|
model: string;
|
|
189
273
|
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
274
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
190
275
|
archetype?: string | undefined;
|
|
191
276
|
estInputTokens?: number | undefined;
|
|
192
277
|
maxInputTokens?: number | undefined;
|
|
@@ -201,23 +286,125 @@ declare const ExtractSchema: z.ZodObject<{
|
|
|
201
286
|
notes?: string | undefined;
|
|
202
287
|
}[];
|
|
203
288
|
notes?: string | undefined;
|
|
289
|
+
models?: {
|
|
290
|
+
model: string;
|
|
291
|
+
where: string;
|
|
292
|
+
modelSelection?: "hardcoded" | "config" | "env" | "dynamic" | undefined;
|
|
293
|
+
platform?: "provider-api" | "vertex" | "bedrock" | "azure" | "other" | undefined;
|
|
294
|
+
notes?: string | undefined;
|
|
295
|
+
}[] | undefined;
|
|
204
296
|
}>;
|
|
205
297
|
type CallSite = z.infer<typeof CallSiteSchema>;
|
|
298
|
+
type ModelMention = z.infer<typeof ModelMentionSchema>;
|
|
206
299
|
type Extract = z.infer<typeof ExtractSchema>;
|
|
207
300
|
|
|
301
|
+
/**
|
|
302
|
+
* The lifecycle ledger's row shape (R1). The data lives in
|
|
303
|
+
* `lifecycle-ledger.ts`, generated from the providers' saved pages by
|
|
304
|
+
* `scripts/build-ledger.mjs` — never typed by hand.
|
|
305
|
+
*/
|
|
306
|
+
type LedgerProvider = 'anthropic' | 'openai' | 'google' | 'deepseek';
|
|
307
|
+
/** The provider's word, mapped onto one small set. `pageWord` keeps the page's own text. */
|
|
308
|
+
type LedgerWord = 'deprecated' | 'retired' | 'shut down' | 'legacy' | 'rerouted' | 'scheduled for shutdown';
|
|
309
|
+
interface LedgerRow {
|
|
310
|
+
/** The model id exactly as the page writes it. */
|
|
311
|
+
id: string;
|
|
312
|
+
provider: LedgerProvider;
|
|
313
|
+
word: LedgerWord;
|
|
314
|
+
/** The page's own status text for this row (a table cell, a section heading or a sentence). */
|
|
315
|
+
pageWord: string;
|
|
316
|
+
/** ISO date the page gives for the announcement / deprecation, when it gives one. */
|
|
317
|
+
announced?: string;
|
|
318
|
+
/** ISO date the page gives for retirement, shutdown or discontinuation. */
|
|
319
|
+
shutdown?: string;
|
|
320
|
+
/** ISO date the page gives as a floor ("not sooner than", "at earliest"). */
|
|
321
|
+
shutdownFloor?: string;
|
|
322
|
+
/** The page's date text, verbatim. */
|
|
323
|
+
dateText?: string;
|
|
324
|
+
/** The replacement the page names, backticks removed. */
|
|
325
|
+
replacement?: string;
|
|
326
|
+
/** Where the page says requests to this id are now routed. */
|
|
327
|
+
routesTo?: string;
|
|
328
|
+
/** DeepSeek: the model the page said the name pointed to when it announced the discontinuation. */
|
|
329
|
+
pointedTo?: string;
|
|
330
|
+
/** How the id was matched when the page names it by display name ("GPT-4o (…)"). */
|
|
331
|
+
matchedBy?: 'display-name';
|
|
332
|
+
/** The page section the row sits in, when the page is split by family. */
|
|
333
|
+
section?: string;
|
|
334
|
+
/** A second sentence from the same page that the row relies on. */
|
|
335
|
+
note?: string;
|
|
336
|
+
url: string;
|
|
337
|
+
/** ISO date the page was read. */
|
|
338
|
+
readOn: string;
|
|
339
|
+
/** The page line (or sentence) the row was built from, verbatim. */
|
|
340
|
+
quote: string;
|
|
341
|
+
/** A second page that confirms the row, with its own quote and read date. */
|
|
342
|
+
alsoUrl?: string;
|
|
343
|
+
alsoQuote?: string;
|
|
344
|
+
alsoReadOn?: string;
|
|
345
|
+
}
|
|
346
|
+
interface LedgerSource {
|
|
347
|
+
provider: LedgerProvider;
|
|
348
|
+
url: string;
|
|
349
|
+
/** ISO UTC time of the curl. */
|
|
350
|
+
readAt: string;
|
|
351
|
+
/** sha256 of the saved page bytes. */
|
|
352
|
+
sha256: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* R3 — an id is matched as a developer writes it; R1/R2 — the ledger is read
|
|
357
|
+
* before the catalog. Pure functions over the generated ledger and the
|
|
358
|
+
* compiler's catalog; no network.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
interface Resolution {
|
|
362
|
+
/** The id exactly as configured. */
|
|
363
|
+
configured: string;
|
|
364
|
+
/** The id looked up. */
|
|
365
|
+
base: string;
|
|
366
|
+
/** What was done to get from one to the other, in words; empty when nothing was. */
|
|
367
|
+
steps: string[];
|
|
368
|
+
/** Set when the id is a partner platform's form: its lifecycle dates may differ from the provider's own API. */
|
|
369
|
+
partner?: Partner;
|
|
370
|
+
}
|
|
371
|
+
/** A cloud platform that serves a provider's models on its own lifecycle schedule. */
|
|
372
|
+
type Partner = 'vertex' | 'bedrock' | 'azure';
|
|
373
|
+
/**
|
|
374
|
+
* The prefix, Bedrock and Vertex forms are rewritten to the provider's own
|
|
375
|
+
* id. A dated snapshot is NOT stripped here — the lookup tries the dated id
|
|
376
|
+
* first, because the pages list dated snapshots as rows of their own.
|
|
377
|
+
*/
|
|
378
|
+
declare function resolveId(configured: string): Resolution;
|
|
379
|
+
interface LedgerHit {
|
|
380
|
+
row?: LedgerRow;
|
|
381
|
+
/** The id the ledger row was found under, when it differs from the resolved base. */
|
|
382
|
+
via?: string;
|
|
383
|
+
/** The id the catalog should be read under. */
|
|
384
|
+
catalogId: string;
|
|
385
|
+
}
|
|
386
|
+
declare function lookupLedger(res: Resolution): LedgerHit;
|
|
387
|
+
|
|
208
388
|
/**
|
|
209
389
|
* The deterministic check engine. Every finding carries a confidence tier —
|
|
210
390
|
* the mechanical answer to "how much confidence?":
|
|
211
391
|
*
|
|
212
|
-
* certain —
|
|
213
|
-
*
|
|
392
|
+
* certain — the provider's own page, or a fact read from the
|
|
393
|
+
* developer's code; stated flatly.
|
|
394
|
+
* likely — priced/inferred from the agent's own estimates, or a
|
|
395
|
+
* kgauto catalog value no provider page is cited for.
|
|
214
396
|
* measurable-only — honestly unknowable from a code read; each one is
|
|
215
397
|
* exactly what the observe day exists to measure.
|
|
216
398
|
*
|
|
217
|
-
*
|
|
218
|
-
* (
|
|
219
|
-
*
|
|
220
|
-
* is
|
|
399
|
+
* 0.4.0: the provider's word comes first. A model id is resolved as the
|
|
400
|
+
* developer wrote it (R3), looked up in the lifecycle ledger read from the
|
|
401
|
+
* providers' deprecation pages (R1), then in the compiler's catalog, whose
|
|
402
|
+
* `providerLifecycle` is the page's word with its read date (R2). kgauto's own
|
|
403
|
+
* routing `status` is never printed as a fact about the model, and a limit
|
|
404
|
+
* that is only a kgauto default is never printed as certain (R4).
|
|
405
|
+
*
|
|
406
|
+
* No network, no writes: the card's destination sentence is true because
|
|
407
|
+
* there is no code path that could make it false.
|
|
221
408
|
*/
|
|
222
409
|
|
|
223
410
|
type Confidence = 'certain' | 'likely' | 'measurable-only';
|
|
@@ -228,7 +415,7 @@ interface Finding {
|
|
|
228
415
|
confidence: Confidence;
|
|
229
416
|
title: string;
|
|
230
417
|
detail: string;
|
|
231
|
-
/** Where the claim comes from — catalog field, extract field, arithmetic. */
|
|
418
|
+
/** Where the claim comes from — a provider page with its URL, a catalog field, an extract field, arithmetic. */
|
|
232
419
|
basis: string;
|
|
233
420
|
callSites: string[];
|
|
234
421
|
}
|
|
@@ -238,22 +425,58 @@ interface CheckResult {
|
|
|
238
425
|
catalogVersion: string;
|
|
239
426
|
}
|
|
240
427
|
interface EngineOptions {
|
|
241
|
-
/** Test seam:
|
|
428
|
+
/** Test seam: catalog lookup override for a resolved id. Defaults to the bundled roster. */
|
|
242
429
|
resolve?: (id: string) => {
|
|
243
430
|
canonical: string;
|
|
244
431
|
profile: ModelProfile | undefined;
|
|
245
432
|
};
|
|
246
|
-
/** Test seam: full roster override (for cheaper-candidate scans). */
|
|
433
|
+
/** Test seam: full roster override (for cheaper-candidate scans and the family sort). */
|
|
247
434
|
roster?: () => ModelProfile[];
|
|
248
435
|
}
|
|
249
436
|
declare const DESTINATION_SENTENCE: string;
|
|
437
|
+
type Line = Omit<Finding, 'id' | 'callSites'>;
|
|
438
|
+
/** What the check knows about one model id as configured. */
|
|
439
|
+
interface ModelAnalysis {
|
|
440
|
+
res: Resolution;
|
|
441
|
+
/** The id as the card prints it: as configured, with what it was looked up as. */
|
|
442
|
+
shown: string;
|
|
443
|
+
row?: LedgerRow;
|
|
444
|
+
/** The ledger id the row was found under, when it differs from the looked-up id. */
|
|
445
|
+
via?: string;
|
|
446
|
+
/** The catalog profile the request checks run against; absent = the checks skip this id. */
|
|
447
|
+
profile?: ModelProfile;
|
|
448
|
+
/** The id the profile was found under. */
|
|
449
|
+
canonical: string;
|
|
450
|
+
lines: Line[];
|
|
451
|
+
/** The partner platform the site runs on, when the extract shows one. */
|
|
452
|
+
partner?: Partner;
|
|
453
|
+
}
|
|
454
|
+
declare function analyseModel(configured: string, opts?: EngineOptions, site?: {
|
|
455
|
+
id?: string;
|
|
456
|
+
where?: string;
|
|
457
|
+
notes?: string;
|
|
458
|
+
platform?: string;
|
|
459
|
+
}): ModelAnalysis;
|
|
250
460
|
declare function runCheck(extract: Extract, opts?: EngineOptions): CheckResult;
|
|
251
|
-
declare function renderCard(extract: Extract, findings: Finding[],
|
|
461
|
+
declare function renderCard(extract: Extract, findings: Finding[], analyses?: ReadonlyMap<string, ModelAnalysis>): string;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* GENERATED by scripts/build-ledger.mjs from the providers' own deprecation
|
|
465
|
+
* pages, saved by `curl -sL` and read on the dates below. Do not edit by
|
|
466
|
+
* hand: re-fetch the pages and re-run the script. Every row carries the page
|
|
467
|
+
* line it came from (`quote`), the URL and the day it was read; the script
|
|
468
|
+
* refused any row whose quote is not on the page.
|
|
469
|
+
*
|
|
470
|
+
* Rows per provider: anthropic 21 · openai 171 · google 76 · deepseek 4 (272 in all).
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
declare const LEDGER_SOURCES: readonly LedgerSource[];
|
|
474
|
+
declare const LEDGER: readonly LedgerRow[];
|
|
252
475
|
|
|
253
476
|
declare function buildServer(): McpServer;
|
|
254
477
|
|
|
255
|
-
declare const SERVER_INSTRUCTIONS = "You are talking to kgauto-check, a local, offline checker for AI call surfaces.\n\nFlow: (1) call start_check to get extraction instructions, (2) read THIS project's code yourself and build the extract, (3) call run_check with it, (4) present the returned card to your human verbatim (it is grouped by confidence tier on purpose), (5) if they want measured numbers, call get_observe_day_plan.\n\nPrivacy contract, which you should relay to your human: the extract contains identifiers and counts only \u2014 never prompt text, never source code, never secrets. This check ran
|
|
256
|
-
declare const START_CHECK_INSTRUCTIONS = "# kgauto check \u2014 extraction instructions (for you, the agent)\n\nYour job: read this project's code and build an extract of its AI call surface. You have repo access; kgauto does not, by design.\n\n## What to find\nScan for LLM API usage: provider SDK imports (anthropic, openai, @google/generative-ai / @google/genai, ai-sdk, litellm, langchain, ...), raw HTTPS calls to provider endpoints, and any internal wrapper around them. Each distinct place the project sends a prompt to a model is one call site.\n\n## What to collect per call site (identifiers and counts ONLY)\n- id: a stable label you choose, e.g. \"api/summarize.ts:42\"\n- model: the model id exactly as configured\n- modelSelection: hardcoded | config | env | dynamic\n- archetype: your best guess at the work's intent \u2014 one of: ask, classify, critique, extract, generate, hunt, plan, summarize, transform\n- estInputTokens / maxInputTokens / estOutputTokens: estimate from the code (what gets concatenated into the prompt; ~4 chars per token). Worst case matters \u2014 find the biggest thing that can flow in.\n- toolCount, usesParallelToolCalls: from the tools array and how results are consumed\n- expectsStructuredOutput: true if the response is JSON.parse'd or schema-validated\n- streaming, retry (none | same-model | fallback-chain | unknown), fallbackModels\n- estCallsPerMonth: only if genuinely inferable (cron cadence, obvious traffic); omit rather than invent\n\n## Privacy contract (relay this to your human)\nDo NOT put prompt text, source code, file contents, or secrets in the extract. Identifiers and counts only. This check ran
|
|
478
|
+
declare const SERVER_INSTRUCTIONS = "You are talking to kgauto-check, a local, offline checker for AI call surfaces.\n\nFlow: (1) call start_check to get extraction instructions, (2) read THIS project's code yourself and build the extract, (3) call run_check with it, (4) present the returned card to your human verbatim (it is grouped by confidence tier on purpose), (5) if they want measured numbers, call get_observe_day_plan.\n\nPrivacy contract, which you should relay to your human: the extract contains identifiers and counts only \u2014 never prompt text, never source code, never secrets. This check ran on your machine, against the catalog bundled with it and the providers\u2019 deprecation pages it was built with. Nothing was uploaded; no rows were written anywhere.\n\nget_model_facts answers one-off questions about any model id \u2014 what its provider's deprecation page says, then the verified catalog \u2014 and is what makes keeping this server installed useful between checks.";
|
|
479
|
+
declare const START_CHECK_INSTRUCTIONS = "# kgauto check \u2014 extraction instructions (for you, the agent)\n\nYour job: read this project's code and build an extract of its AI call surface. You have repo access; kgauto does not, by design.\n\n## What to find\nScan for LLM API usage: provider SDK imports (anthropic, openai, @google/generative-ai / @google/genai, ai-sdk, litellm, langchain, ...), raw HTTPS calls to provider endpoints, and any internal wrapper around them. Each distinct place the project sends a prompt to a model is one call site.\n\n## What to collect per call site (identifiers and counts ONLY)\n- id: a stable label you choose, e.g. \"api/summarize.ts:42\"\n- model: the model id exactly as configured (a provider or gateway prefix such as openai/ or openrouter/anthropic/ is fine; the check says what it looked the id up as)\n- modelSelection: hardcoded | config | env | dynamic\n- platform: state it for EVERY call site \u2014 where the request is served: provider-api (the provider's own API), vertex, bedrock, azure, or other (a gateway or another host). Tell it from the SDK imported (e.g. @anthropic-ai/sdk vs @anthropic-ai/vertex-sdk or @aws-sdk/client-bedrock-runtime; google-genai vs google.cloud.aiplatform / @google-cloud/aiplatform), the base URL (api.openai.com vs *.openai.azure.com; generativelanguage.googleapis.com vs *-aiplatform.googleapis.com), and the credentials used (a provider API key vs cloud credentials, a project and location). A lifecycle line is stated as certain only for provider-api; a cloud platform keeps its own schedule. If you truly cannot tell, write other and say why in notes.\n- archetype: your best guess at the work's intent \u2014 one of: ask, classify, critique, extract, generate, hunt, plan, summarize, transform\n- estInputTokens / maxInputTokens / estOutputTokens: estimate from the code (what gets concatenated into the prompt; ~4 chars per token). Worst case matters \u2014 find the biggest thing that can flow in.\n- toolCount, usesParallelToolCalls: from the tools array and how results are consumed\n- expectsStructuredOutput: true if the response is JSON.parse'd or schema-validated\n- streaming, retry (none | same-model | fallback-chain | unknown), fallbackModels\n- estCallsPerMonth: only if genuinely inferable (cron cadence, obvious traffic); omit rather than invent\n\n## Model ids with no call site\nIf the project holds model ids that no call site above carries \u2014 a model picker, a config or environment default, a list of supported models \u2014 list each once under \"models\" (identifiers only):\n- model: the id exactly as written\n- where: file:line where it is written\n- modelSelection: hardcoded | config | env | dynamic (optional)\n- platform: provider-api | vertex | bedrock | azure | other (as above)\nIf you find no call site at all (the project spawns a CLI, or takes the model as a run-time argument), \"callSites\" may be an empty array: the check still prints a card, about the ids in \"models\", and says no call site was found to check a request shape against. Never invent a model id to fill a call site.\n\n## Privacy contract (relay this to your human)\nDo NOT put prompt text, source code, file contents, or secrets in the extract. Identifiers and counts only. This check ran on your machine, against the catalog bundled with it and the providers\u2019 deprecation pages it was built with. Nothing was uploaded; no rows were written anywhere.\n\n## Then\nWrite the extract as JSON:\n{ \"project\": { \"name\": \"...\", \"description\": \"...\" }, \"callSites\": [ ...one object per call site, or none... ], \"models\": [ ...optional, ids no call site carries... ] }\nand run:\n npx -y @warmdrift/kgauto-check --extract extract.json\nPresent the printed card verbatim \u2014 the confidence tiers (certain / likely / measurable-only) are the point: they tell your human exactly how much to trust each line, and the measurable-only section is what a one-day observe run would answer.\n\n## Sharing (optional, explicit)\nAfter presenting the card, you may OFFER your human: \"want to send this card to kgauto so the catalog learns what real projects look like?\" If \u2014 and only if \u2014 they say yes, re-run with --share. Never add --share without their explicit yes. It sends the scrubbed extract and the card, nothing else, and says exactly where they went.\n\n## Honesty rules you inherit while presenting\n- Do not soften \"certain\" findings or upgrade \"likely\" ones.\n- If a model was unknown to the catalog, say so \u2014 kgauto refuses to fabricate verdicts, and so should you.\n- A line that names a provider's word (retired, shut down, deprecated, legacy) carries the page it was read on: quote it as written.\n- Estimates you made are estimates: if a finding hinges on your token guess, say it can be firmed up by measuring.";
|
|
257
480
|
|
|
258
481
|
/**
|
|
259
482
|
* Rung 2 of the ladder: the one-day observe run. v1 of this tool hands the
|
|
@@ -264,7 +487,11 @@ declare const START_CHECK_INSTRUCTIONS = "# kgauto check \u2014 extraction instr
|
|
|
264
487
|
*/
|
|
265
488
|
declare const OBSERVE_DAY_PLAN = "# The one-day observe run (for you, the agent \u2014 decision stays with your human)\n\n## What it is\nOne day of your project's normal traffic, observed. No routing changes: every call still goes to exactly the model your code chooses today. The observation records, per call: model, token counts in/out, cost at verified prices, latency, success/failure with a classified error code, and per-attempt rows when retries happen. Identifiers and counts \u2014 prompt text is never required.\n\n## What it answers (the measurable-only tier of your check card)\n- actual failure rate per model \u2014 including walkaway failures that green health checks miss\n- actual input-waste ratio per call site (the >85% input-share signal, measured instead of estimated)\n- which call sites dominate spend\n- the evidence base for whether a cheaper model could hold quality here (kgauto's judged eval runs on real captured cases, never on price alone)\n\n## The two honesty requirements (non-negotiable, relay both)\n1. **Destination, named before anything runs.** Your human gets one plain sentence stating exactly where outcome rows land and what is in them, BEFORE the first row is written. \"Nothing is uploaded\" was true of the check because it writes nothing; the observe day writes rows, so it must say where.\n2. **Observation never intervenes.** If your project uses fallback chains, observing must not pin a model and silently disable the chain \u2014 a forced pin is an intervention sold as observation. Rows are recorded per attempt, so the chain's real behaviour is what gets measured.\n\n## How to proceed\nThe integration is small (the kgauto compiler's call/record path with your existing keys), but because rows now land somewhere, the wiring starts with that destination sentence and your human's explicit yes. Next step: have your human reply to whoever pointed them at kgauto \u2014 the observe day is set up per-project, together.";
|
|
266
489
|
|
|
267
|
-
/**
|
|
490
|
+
/**
|
|
491
|
+
* One model id → what the provider's page says first (the lifecycle ledger,
|
|
492
|
+
* then the catalog profile's providerLifecycle), then the catalog card.
|
|
493
|
+
* Honest miss on an id in neither (s51).
|
|
494
|
+
*/
|
|
268
495
|
declare function renderModelFacts(model: string): string;
|
|
269
496
|
|
|
270
497
|
/** One source of truth: package.json, read at runtime (dist/ sits one level
|
|
@@ -272,4 +499,4 @@ declare function renderModelFacts(model: string): string;
|
|
|
272
499
|
* two declarations of one fact. */
|
|
273
500
|
declare const CHECK_VERSION: string;
|
|
274
501
|
|
|
275
|
-
export { CHECK_VERSION, type CallSite, CallSiteSchema, type CheckResult, type Confidence, DESTINATION_SENTENCE, type EngineOptions, type Extract, ExtractSchema, type Finding, OBSERVE_DAY_PLAN, SERVER_INSTRUCTIONS, START_CHECK_INSTRUCTIONS, type Severity, buildServer, renderCard, renderModelFacts, runCheck };
|
|
502
|
+
export { CHECK_VERSION, type CallSite, CallSiteSchema, type CheckResult, type Confidence, DESTINATION_SENTENCE, type EngineOptions, type Extract, ExtractSchema, type Finding, LEDGER, LEDGER_SOURCES, type LedgerProvider, type LedgerRow, type LedgerSource, type LedgerWord, type ModelAnalysis, type ModelMention, ModelMentionSchema, OBSERVE_DAY_PLAN, SERVER_INSTRUCTIONS, START_CHECK_INSTRUCTIONS, type Severity, analyseModel, buildServer, lookupLedger, renderCard, renderModelFacts, resolveId, runCheck };
|
package/dist/index.js
CHANGED
|
@@ -3,24 +3,36 @@ import {
|
|
|
3
3
|
CallSiteSchema,
|
|
4
4
|
DESTINATION_SENTENCE,
|
|
5
5
|
ExtractSchema,
|
|
6
|
+
LEDGER,
|
|
7
|
+
LEDGER_SOURCES,
|
|
8
|
+
ModelMentionSchema,
|
|
6
9
|
OBSERVE_DAY_PLAN,
|
|
7
10
|
SERVER_INSTRUCTIONS,
|
|
8
11
|
START_CHECK_INSTRUCTIONS,
|
|
12
|
+
analyseModel,
|
|
9
13
|
buildServer,
|
|
14
|
+
lookupLedger,
|
|
10
15
|
renderCard,
|
|
11
16
|
renderModelFacts,
|
|
17
|
+
resolveId,
|
|
12
18
|
runCheck
|
|
13
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XWIGHIJP.js";
|
|
14
20
|
export {
|
|
15
21
|
CHECK_VERSION,
|
|
16
22
|
CallSiteSchema,
|
|
17
23
|
DESTINATION_SENTENCE,
|
|
18
24
|
ExtractSchema,
|
|
25
|
+
LEDGER,
|
|
26
|
+
LEDGER_SOURCES,
|
|
27
|
+
ModelMentionSchema,
|
|
19
28
|
OBSERVE_DAY_PLAN,
|
|
20
29
|
SERVER_INSTRUCTIONS,
|
|
21
30
|
START_CHECK_INSTRUCTIONS,
|
|
31
|
+
analyseModel,
|
|
22
32
|
buildServer,
|
|
33
|
+
lookupLedger,
|
|
23
34
|
renderCard,
|
|
24
35
|
renderModelFacts,
|
|
36
|
+
resolveId,
|
|
25
37
|
runCheck
|
|
26
38
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmdrift/kgauto-check",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Point your AI at your project
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Point your AI at your project — kgauto's local check, as a pure CLI for coding agents. Your agent extracts the project's AI surface (identifiers and counts, never code) and this tool checks it against kgauto's verified model catalog: statuses, prices, cliffs, capability mismatches, resilience. Fully offline; --share is the one explicit opt-in exception.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kgauto-check": "dist/bin.js"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
42
|
-
"@warmdrift/kgauto-compiler": "^2.0.0-alpha.
|
|
42
|
+
"@warmdrift/kgauto-compiler": "^2.0.0-alpha.132",
|
|
43
43
|
"zod": "^3.23.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"typescript": "^5.4.0",
|
|
49
49
|
"vitest": "^2.0.0"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|