@yaklabs-ai/plugin-sdk 0.54.0 → 0.54.1
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 +16 -5
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/canonical-transcript.d.ts +66 -0
- package/dist/canonical-transcript.js +567 -3
- package/dist/disclosure.d.ts +329 -110
- package/dist/disclosure.js +1 -0
- package/dist/kay-agent-testing.d.ts +334 -111
- package/dist/kay-agent-testing.js +1 -0
- package/dist/kay-agent.d.ts +389 -87
- package/dist/kay-agent.js +19 -0
- package/dist/kay-app-session-summary.d.ts +267 -128
- package/dist/kay-app.d.ts +1527 -212
- package/dist/kay-app.js +19 -0
- package/dist/workers.d.ts +27 -0
- package/dist/workers.js +20 -0
- package/package.json +5 -1
|
@@ -25,6 +25,254 @@ declare function AddReadonlyDeferred<Type extends TSchema>(type: Type, options?:
|
|
|
25
25
|
*/
|
|
26
26
|
declare type AgentMessage = Message | CustomAgentMessages[keyof CustomAgentMessages];
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The optional schema-validated terminal output contract a session may declare
|
|
30
|
+
* (issue #2234). `schema` is a bounded JSON object (a JSON Schema); `required`
|
|
31
|
+
* (default off) decides whether a text-only completion settles the turn -
|
|
32
|
+
* `true` holds every run to a submission, while the `"per-run"` literal defers
|
|
33
|
+
* the decision to each run's driver (a reused subagent session's assignment
|
|
34
|
+
* runs are stamped; its internal wake turns are not);
|
|
35
|
+
* `sessionTitle` (default off) adds the reserved `submit_final` field a turn
|
|
36
|
+
* uses to rename its own session; `whenToSubmit` is the one sentence telling the
|
|
37
|
+
* model when an OPTIONAL submission is worth making (ignored when `required`
|
|
38
|
+
* is `true` or `"per-run"`).
|
|
39
|
+
* The wire enforces the size caps and the credential-key tripwire; the herd
|
|
40
|
+
* kernel enforces the full acceptance policy (JSON-only, depth, non-local
|
|
41
|
+
* `$ref`).
|
|
42
|
+
*
|
|
43
|
+
* STRICT on purpose, which makes this schema a required stop for every new
|
|
44
|
+
* contract field: an unmirrored one is not merely absent on the wire, it fails
|
|
45
|
+
* the whole contract's parse, and the consumer that reads a stored session drops
|
|
46
|
+
* the contract entirely rather than reporting anything.
|
|
47
|
+
*/
|
|
48
|
+
declare const AgentRuntimeFinalOutputContract: z.ZodObject<{
|
|
49
|
+
schema: z.ZodType<{
|
|
50
|
+
[key: string]: JsonValue_4;
|
|
51
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
52
|
+
[key: string]: JsonValue_4;
|
|
53
|
+
}, unknown>>;
|
|
54
|
+
required: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"per-run">]>>;
|
|
55
|
+
sessionTitle: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
whenToSubmit: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
|
|
59
|
+
declare type AgentRuntimeFinalOutputContract = z.infer<typeof AgentRuntimeFinalOutputContract>;
|
|
60
|
+
|
|
61
|
+
/** Model pricing in USD per one million tokens. */
|
|
62
|
+
declare const AgentRuntimeModelCost: z.ZodObject<{
|
|
63
|
+
input: z.ZodNumber;
|
|
64
|
+
output: z.ZodNumber;
|
|
65
|
+
cacheRead: z.ZodNumber;
|
|
66
|
+
cacheWrite: z.ZodNumber;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
|
|
69
|
+
declare type AgentRuntimeModelCost = z.infer<typeof AgentRuntimeModelCost>;
|
|
70
|
+
|
|
71
|
+
declare const AgentRuntimeModelFeatures: z.ZodObject<{
|
|
72
|
+
thinking: z.ZodBoolean;
|
|
73
|
+
vision: z.ZodBoolean;
|
|
74
|
+
toolUse: z.ZodBoolean;
|
|
75
|
+
streaming: z.ZodBoolean;
|
|
76
|
+
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
inputModalities: z.ZodArray<z.ZodEnum<{
|
|
78
|
+
text: "text";
|
|
79
|
+
image: "image";
|
|
80
|
+
audio: "audio";
|
|
81
|
+
video: "video";
|
|
82
|
+
pdf: "pdf";
|
|
83
|
+
embedding: "embedding";
|
|
84
|
+
}>>;
|
|
85
|
+
outputModalities: z.ZodArray<z.ZodEnum<{
|
|
86
|
+
text: "text";
|
|
87
|
+
image: "image";
|
|
88
|
+
audio: "audio";
|
|
89
|
+
video: "video";
|
|
90
|
+
pdf: "pdf";
|
|
91
|
+
embedding: "embedding";
|
|
92
|
+
}>>;
|
|
93
|
+
structuredOutput: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
promptCaching: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
|
|
99
|
+
declare type AgentRuntimeModelFeatures = z.infer<typeof AgentRuntimeModelFeatures>;
|
|
100
|
+
|
|
101
|
+
declare const AgentRuntimeModelScores: z.ZodObject<{
|
|
102
|
+
intelligence: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
value: z.ZodNumber;
|
|
104
|
+
}, z.core.$strict>>;
|
|
105
|
+
coding: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
value: z.ZodNumber;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
speedTps: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
value: z.ZodNumber;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
112
|
+
value: z.ZodNumber;
|
|
113
|
+
}, z.core.$strict>>>;
|
|
114
|
+
source: z.ZodOptional<z.ZodString>;
|
|
115
|
+
asOf: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
|
|
118
|
+
declare type AgentRuntimeModelScores = z.infer<typeof AgentRuntimeModelScores>;
|
|
119
|
+
|
|
120
|
+
declare const AgentRuntimeModelTierId: z.ZodEnum<{
|
|
121
|
+
small: "small";
|
|
122
|
+
medium: "medium";
|
|
123
|
+
large: "large";
|
|
124
|
+
ultra: "ultra";
|
|
125
|
+
}>;
|
|
126
|
+
|
|
127
|
+
declare type AgentRuntimeModelTierId = z.infer<typeof AgentRuntimeModelTierId>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* One product model tier (resolved through the provider tier tables), projected with the
|
|
131
|
+
* model the tier RESOLVES TO for this runtime right now. `resolved` is absent
|
|
132
|
+
* when nothing - pin or floor - is currently eligible; the preview is
|
|
133
|
+
* point-in-time (checked-strength, never minting), so surfaces re-fetch rather
|
|
134
|
+
* than cache it across auth changes.
|
|
135
|
+
*/
|
|
136
|
+
declare const AgentRuntimeModelTierInfo: z.ZodObject<{
|
|
137
|
+
id: z.ZodEnum<{
|
|
138
|
+
small: "small";
|
|
139
|
+
medium: "medium";
|
|
140
|
+
large: "large";
|
|
141
|
+
ultra: "ultra";
|
|
142
|
+
}>;
|
|
143
|
+
displayName: z.ZodString;
|
|
144
|
+
description: z.ZodString;
|
|
145
|
+
resolved: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
provider: z.ZodString;
|
|
147
|
+
modelId: z.ZodString;
|
|
148
|
+
modelReference: z.ZodString;
|
|
149
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
|
|
153
|
+
declare type AgentRuntimeModelTierInfo = z.infer<typeof AgentRuntimeModelTierInfo>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* One session-steward observation (hindsight): structured FACTS, never
|
|
157
|
+
* actions - appended to the session's log as a `session_steward` custom entry,
|
|
158
|
+
* from which summary state derives (`stewardTitle` / `stewardCommentary` /
|
|
159
|
+
* `stewardNextSteps` / `stewardCompactionSuggested`). Derivation is
|
|
160
|
+
* side-effect-free by contract. The compaction flag has two consumers:
|
|
161
|
+
* auto-compaction taken once at append time behind the
|
|
162
|
+
* `kayLoop.hindsight.stewardAutoCompact` flag, and - when auto-compact is
|
|
163
|
+
* off - the standing `stewardCompactionSuggested` summary field that backs
|
|
164
|
+
* the UI's "compact now" affordance. NOT itself a wire payload - it
|
|
165
|
+
* lives here as the ONE shared source of the summary's steward fields (the
|
|
166
|
+
* entry on disk, the backend fold, and the stored-state reader all validate
|
|
167
|
+
* against it); only the derived summary fields ever cross the wire.
|
|
168
|
+
*/
|
|
169
|
+
declare const AgentRuntimeSessionStewardEntry: z.ZodObject<{
|
|
170
|
+
titleChange: z.ZodNullable<z.ZodString>;
|
|
171
|
+
summaryAddition: z.ZodNullable<z.ZodString>;
|
|
172
|
+
nextSteps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
173
|
+
workHeadline: z.ZodOptional<z.ZodString>;
|
|
174
|
+
workHeadlineReview: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
175
|
+
labelKind: z.ZodEnum<{
|
|
176
|
+
purpose: "purpose";
|
|
177
|
+
result: "result";
|
|
178
|
+
}>;
|
|
179
|
+
text: z.ZodString;
|
|
180
|
+
faultProbability: z.ZodNullable<z.ZodNumber>;
|
|
181
|
+
accepted: z.ZodBoolean;
|
|
182
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
184
|
+
attempt: z.ZodObject<{
|
|
185
|
+
outcome: z.ZodEnum<{
|
|
186
|
+
error: "error";
|
|
187
|
+
none: "none";
|
|
188
|
+
rejected: "rejected";
|
|
189
|
+
}>;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
}, z.core.$strict>]>>>;
|
|
192
|
+
workBlock: z.ZodOptional<z.ZodObject<{
|
|
193
|
+
firstToolResultEntryId: z.ZodString;
|
|
194
|
+
lastToolResultEntryId: z.ZodString;
|
|
195
|
+
toolResultEntryIds: z.ZodArray<z.ZodString>;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
goodCompactionOpportunity: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
suggestedModelTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
199
|
+
small: "small";
|
|
200
|
+
medium: "medium";
|
|
201
|
+
large: "large";
|
|
202
|
+
ultra: "ultra";
|
|
203
|
+
}>>>;
|
|
204
|
+
reviewedThroughEntryId: z.ZodOptional<z.ZodString>;
|
|
205
|
+
outcomeVerdict: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
206
|
+
verdict: z.ZodEnum<{
|
|
207
|
+
bad: "bad";
|
|
208
|
+
good: "good";
|
|
209
|
+
mixed: "mixed";
|
|
210
|
+
unclear: "unclear";
|
|
211
|
+
}>;
|
|
212
|
+
confidence: z.ZodEnum<{
|
|
213
|
+
low: "low";
|
|
214
|
+
medium: "medium";
|
|
215
|
+
high: "high";
|
|
216
|
+
}>;
|
|
217
|
+
basis: z.ZodString;
|
|
218
|
+
correctionsObserved: z.ZodNumber;
|
|
219
|
+
retriesObserved: z.ZodNumber;
|
|
220
|
+
rubricVersion: z.ZodNumber;
|
|
221
|
+
}, z.core.$strict>>>;
|
|
222
|
+
deferredVerdicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
223
|
+
subjectSessionId: z.ZodString;
|
|
224
|
+
verdict: z.ZodEnum<{
|
|
225
|
+
bad: "bad";
|
|
226
|
+
good: "good";
|
|
227
|
+
mixed: "mixed";
|
|
228
|
+
unclear: "unclear";
|
|
229
|
+
}>;
|
|
230
|
+
confidence: z.ZodEnum<{
|
|
231
|
+
low: "low";
|
|
232
|
+
medium: "medium";
|
|
233
|
+
high: "high";
|
|
234
|
+
}>;
|
|
235
|
+
basis: z.ZodString;
|
|
236
|
+
rubricVersion: z.ZodNumber;
|
|
237
|
+
}, z.core.$strict>>>;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
|
|
240
|
+
declare type AgentRuntimeSessionStewardEntry = z.infer<typeof AgentRuntimeSessionStewardEntry>;
|
|
241
|
+
|
|
242
|
+
/** One trailing-window spend view (mirrors `SpendWindowView`). */
|
|
243
|
+
declare const AgentRuntimeSpendWindow: z.ZodObject<{
|
|
244
|
+
window: z.ZodEnum<{
|
|
245
|
+
trailing24h: "trailing24h";
|
|
246
|
+
trailing7d: "trailing7d";
|
|
247
|
+
trailing30d: "trailing30d";
|
|
248
|
+
trailing90d: "trailing90d";
|
|
249
|
+
}>;
|
|
250
|
+
measuredUsd: z.ZodNumber;
|
|
251
|
+
estimatedUsd: z.ZodNumber;
|
|
252
|
+
unknownTurns: z.ZodNumber;
|
|
253
|
+
tokens: z.ZodObject<{
|
|
254
|
+
input: z.ZodNumber;
|
|
255
|
+
output: z.ZodNumber;
|
|
256
|
+
cacheRead: z.ZodNumber;
|
|
257
|
+
cacheWrite: z.ZodNumber;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
effectiveUsdPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
|
|
262
|
+
declare type AgentRuntimeSpendWindow = z.infer<typeof AgentRuntimeSpendWindow>;
|
|
263
|
+
|
|
264
|
+
declare const AgentRuntimeThinkingLevel: z.ZodEnum<{
|
|
265
|
+
max: "max";
|
|
266
|
+
off: "off";
|
|
267
|
+
minimal: "minimal";
|
|
268
|
+
low: "low";
|
|
269
|
+
medium: "medium";
|
|
270
|
+
high: "high";
|
|
271
|
+
xhigh: "xhigh";
|
|
272
|
+
}>;
|
|
273
|
+
|
|
274
|
+
declare type AgentRuntimeThinkingLevel = z.infer<typeof AgentRuntimeThinkingLevel>;
|
|
275
|
+
|
|
28
276
|
declare const Alpha: TAlpha;
|
|
29
277
|
|
|
30
278
|
/** Creates a Any type. */
|
|
@@ -1265,6 +1513,12 @@ declare type JsonValue_3 = string | number | boolean | null | JsonValue_3[] | {
|
|
|
1265
1513
|
|
|
1266
1514
|
declare const JsonValue_3: z.ZodType<JsonValue_3>;
|
|
1267
1515
|
|
|
1516
|
+
declare type JsonValue_4 = string | number | boolean | null | JsonValue_4[] | {
|
|
1517
|
+
[key: string]: JsonValue_4;
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
declare const JsonValue_4: z.ZodType<JsonValue_4>;
|
|
1521
|
+
|
|
1268
1522
|
/** The inert session-config subset a plugin-authored agent definition may contribute. */
|
|
1269
1523
|
declare interface KayAppAgentDefinitionConfig {
|
|
1270
1524
|
/**
|
|
@@ -1288,13 +1542,7 @@ declare interface KayAppAgentDefinitionConfig {
|
|
|
1288
1542
|
}
|
|
1289
1543
|
|
|
1290
1544
|
/** A plugin-authored definition's structured-output contract (the wire's final-output shape). */
|
|
1291
|
-
declare
|
|
1292
|
-
/** JSON Schema for the structured value a matching turn submits. */
|
|
1293
|
-
readonly schema: JsonSchema;
|
|
1294
|
-
readonly required?: boolean | "per-run";
|
|
1295
|
-
readonly sessionTitle?: boolean;
|
|
1296
|
-
readonly whenToSubmit?: string;
|
|
1297
|
-
}
|
|
1545
|
+
declare type KayAppAgentDefinitionFinalOutput = ReadonlyContract<AgentRuntimeFinalOutputContract>;
|
|
1298
1546
|
|
|
1299
1547
|
/**
|
|
1300
1548
|
* An opaque handle to one definition THIS plugin registered. `define` returns it; `sessions.run`
|
|
@@ -1400,27 +1648,10 @@ declare type KayAppModelCompleteOutcome = {
|
|
|
1400
1648
|
};
|
|
1401
1649
|
|
|
1402
1650
|
/** Per-million-token model prices projected by the host. */
|
|
1403
|
-
declare
|
|
1404
|
-
readonly input: number;
|
|
1405
|
-
readonly output: number;
|
|
1406
|
-
readonly cacheRead: number;
|
|
1407
|
-
readonly cacheWrite: number;
|
|
1408
|
-
}
|
|
1651
|
+
declare type KayAppModelCost = Readonly<AgentRuntimeModelCost>;
|
|
1409
1652
|
|
|
1410
1653
|
/** Model capabilities safe for plugin policy and presentation. */
|
|
1411
|
-
declare
|
|
1412
|
-
readonly thinking: boolean;
|
|
1413
|
-
readonly vision: boolean;
|
|
1414
|
-
readonly toolUse: boolean;
|
|
1415
|
-
readonly streaming: boolean;
|
|
1416
|
-
readonly reasoning?: boolean;
|
|
1417
|
-
readonly inputModalities: readonly KayAppModelModality[];
|
|
1418
|
-
readonly outputModalities: readonly KayAppModelModality[];
|
|
1419
|
-
readonly structuredOutput?: boolean;
|
|
1420
|
-
readonly promptCaching?: boolean;
|
|
1421
|
-
readonly contextWindow?: number;
|
|
1422
|
-
readonly maxOutputTokens?: number;
|
|
1423
|
-
}
|
|
1654
|
+
declare type KayAppModelFeatures = ReadonlyContract<AgentRuntimeModelFeatures>;
|
|
1424
1655
|
|
|
1425
1656
|
/** The plugin-safe projection of one model in Bonsai's live model catalog. */
|
|
1426
1657
|
declare interface KayAppModelInfo {
|
|
@@ -1450,9 +1681,6 @@ declare interface KayAppModelInfo {
|
|
|
1450
1681
|
readonly disabledBy?: "privacy-setting" | "subscription-reauth";
|
|
1451
1682
|
}
|
|
1452
1683
|
|
|
1453
|
-
/** Input or output modality advertised by a model. */
|
|
1454
|
-
declare type KayAppModelModality = "text" | "image" | "audio" | "video" | "pdf" | "embedding";
|
|
1455
|
-
|
|
1456
1684
|
/** Safe model catalog plus an optional, consented direct-completion broker. */
|
|
1457
1685
|
declare interface KayAppModels {
|
|
1458
1686
|
/** Returns the current projection; an empty catalog is an empty array. */
|
|
@@ -1477,23 +1705,11 @@ declare interface KayAppModels {
|
|
|
1477
1705
|
complete?(input: KayAppModelCompleteInput): Promise<KayAppModelCompleteOutcome>;
|
|
1478
1706
|
}
|
|
1479
1707
|
|
|
1480
|
-
/** One normalized model score. */
|
|
1481
|
-
declare interface KayAppModelScore {
|
|
1482
|
-
readonly value: number;
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
1708
|
/** Optional host-curated scores and their provenance. */
|
|
1486
|
-
declare
|
|
1487
|
-
readonly intelligence?: KayAppModelScore;
|
|
1488
|
-
readonly coding?: KayAppModelScore;
|
|
1489
|
-
readonly speedTps?: KayAppModelScore;
|
|
1490
|
-
readonly categories?: Readonly<Record<string, KayAppModelScore>>;
|
|
1491
|
-
readonly source?: string;
|
|
1492
|
-
readonly asOf?: string;
|
|
1493
|
-
}
|
|
1709
|
+
declare type KayAppModelScores = ReadonlyContract<AgentRuntimeModelScores>;
|
|
1494
1710
|
|
|
1495
1711
|
/** Bonsai's canonical task-difficulty tier vocabulary at the plugin boundary. */
|
|
1496
|
-
declare type KayAppModelTierId =
|
|
1712
|
+
declare type KayAppModelTierId = AgentRuntimeModelTierId;
|
|
1497
1713
|
|
|
1498
1714
|
/**
|
|
1499
1715
|
* The plugin-safe projection of one product model tier (small/medium/large/ultra -
|
|
@@ -1503,17 +1719,7 @@ declare type KayAppModelTierId = "small" | "medium" | "large" | "ultra";
|
|
|
1503
1719
|
* something derivable from the model alone (the same model can be curated onto two
|
|
1504
1720
|
* different tiers), so `listTiers()` is the only seam a plugin reads it through.
|
|
1505
1721
|
*/
|
|
1506
|
-
declare
|
|
1507
|
-
readonly id: KayAppModelTierId;
|
|
1508
|
-
readonly displayName: string;
|
|
1509
|
-
readonly description: string;
|
|
1510
|
-
readonly resolved?: {
|
|
1511
|
-
readonly provider: string;
|
|
1512
|
-
readonly modelId: string;
|
|
1513
|
-
readonly modelReference: string;
|
|
1514
|
-
readonly displayName?: string;
|
|
1515
|
-
};
|
|
1516
|
-
}
|
|
1722
|
+
declare type KayAppModelTierInfo = ReadonlyContract<AgentRuntimeModelTierInfo>;
|
|
1517
1723
|
|
|
1518
1724
|
/** An ephemeral one-shot agent definition. Identity and permission rules remain host-owned. */
|
|
1519
1725
|
declare interface KayAppSessionAgentDefinition {
|
|
@@ -1529,33 +1735,7 @@ declare interface KayAppSessionAgentDefinition {
|
|
|
1529
1735
|
* optional field follows one rule: OMITTED says nothing and leaves the standing value alone, while
|
|
1530
1736
|
* an explicit value replaces it (`[]` withdraws the next steps, `false` clears a compaction offer).
|
|
1531
1737
|
*/
|
|
1532
|
-
declare
|
|
1533
|
-
readonly titleChange: string | null;
|
|
1534
|
-
readonly summaryAddition: string | null;
|
|
1535
|
-
readonly nextSteps?: readonly string[] | undefined;
|
|
1536
|
-
/** A one-line label for the closed work block {@link workBlock} names. */
|
|
1537
|
-
readonly workHeadline?: string;
|
|
1538
|
-
readonly workHeadlineReview?: readonly ({
|
|
1539
|
-
readonly labelKind: "result" | "purpose";
|
|
1540
|
-
readonly text: string;
|
|
1541
|
-
readonly faultProbability: number | null;
|
|
1542
|
-
readonly accepted: boolean;
|
|
1543
|
-
readonly reason?: string;
|
|
1544
|
-
} | {
|
|
1545
|
-
readonly attempt: {
|
|
1546
|
-
readonly outcome: "none" | "rejected" | "error";
|
|
1547
|
-
};
|
|
1548
|
-
})[];
|
|
1549
|
-
readonly workBlock?: WorkBlockCoverage;
|
|
1550
|
-
readonly goodCompactionOpportunity?: boolean;
|
|
1551
|
-
/** The last entry the annotation reviewed: the transcript marker's anchor. */
|
|
1552
|
-
readonly reviewedThroughEntryId?: string;
|
|
1553
|
-
/** A tier the remaining work suits better, or null when the current one still fits. */
|
|
1554
|
-
readonly suggestedModelTier?: KayAppModelTierId | null;
|
|
1555
|
-
readonly outcomeVerdict?: KayAppSessionOutcomeVerdict | null;
|
|
1556
|
-
/** At most three; a verdict naming the annotated session itself is dropped. */
|
|
1557
|
-
readonly deferredVerdicts?: readonly KayAppSessionDeferredVerdict[];
|
|
1558
|
-
}
|
|
1738
|
+
declare type KayAppSessionAnnotation = ReadonlyContract<AgentRuntimeSessionStewardEntry>;
|
|
1559
1739
|
|
|
1560
1740
|
/** One stored session's spend, including the sessions it started. */
|
|
1561
1741
|
declare interface KayAppSessionCost {
|
|
@@ -1623,21 +1803,7 @@ declare interface KayAppSessionCostModelBreakdown {
|
|
|
1623
1803
|
}
|
|
1624
1804
|
|
|
1625
1805
|
/** Token counts across a set of model calls. */
|
|
1626
|
-
declare
|
|
1627
|
-
readonly input: number;
|
|
1628
|
-
readonly output: number;
|
|
1629
|
-
readonly cacheRead: number;
|
|
1630
|
-
readonly cacheWrite: number;
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
/** A verdict about an EARLIER session, filed on the annotated one and naming its subject. */
|
|
1634
|
-
declare interface KayAppSessionDeferredVerdict {
|
|
1635
|
-
readonly subjectSessionId: string;
|
|
1636
|
-
readonly verdict: KayAppSessionVerdict;
|
|
1637
|
-
readonly confidence: KayAppSessionVerdictConfidence;
|
|
1638
|
-
readonly basis: string;
|
|
1639
|
-
readonly rubricVersion: number;
|
|
1640
|
-
}
|
|
1806
|
+
declare type KayAppSessionCostTokens = Readonly<AgentRuntimeSpendWindow["tokens"]>;
|
|
1641
1807
|
|
|
1642
1808
|
/** One bounded page from the host's stored transcript reader. */
|
|
1643
1809
|
declare interface KayAppSessionEntryBatch {
|
|
@@ -1750,19 +1916,6 @@ declare type KayAppSessionOrigin = {
|
|
|
1750
1916
|
readonly forkedAtEntryId?: string | undefined;
|
|
1751
1917
|
};
|
|
1752
1918
|
|
|
1753
|
-
/** A judgment of whether the annotated session's own work served the user. */
|
|
1754
|
-
declare interface KayAppSessionOutcomeVerdict {
|
|
1755
|
-
readonly verdict: KayAppSessionVerdict;
|
|
1756
|
-
readonly confidence: KayAppSessionVerdictConfidence;
|
|
1757
|
-
/** The stated evidence. The host cuts an over-long basis on a word boundary. */
|
|
1758
|
-
readonly basis: string;
|
|
1759
|
-
/** User-correction turns counted in the transcript. */
|
|
1760
|
-
readonly correctionsObserved: number;
|
|
1761
|
-
/** Visible retry loops counted in the transcript. */
|
|
1762
|
-
readonly retriesObserved: number;
|
|
1763
|
-
readonly rubricVersion: number;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
1919
|
/**
|
|
1767
1920
|
* One bounded page of a session's stored transcript, oldest first, or why there is none. Pass
|
|
1768
1921
|
* `cursor` back for the next page. `replace` means the page starts over from the first record: the
|
|
@@ -2295,12 +2448,6 @@ export declare interface KayAppSessionSummaryResult {
|
|
|
2295
2448
|
readonly continuation?: KayAppSessionSummaryContinuation;
|
|
2296
2449
|
}
|
|
2297
2450
|
|
|
2298
|
-
/** How a session's work is judged to have served the user. `"unclear"` is a real answer, not a failure. */
|
|
2299
|
-
declare type KayAppSessionVerdict = "good" | "mixed" | "bad" | "unclear";
|
|
2300
|
-
|
|
2301
|
-
/** The judge's own certainty: a tuning filter, never a weight the reader applies. */
|
|
2302
|
-
declare type KayAppSessionVerdictConfidence = "low" | "medium" | "high";
|
|
2303
|
-
|
|
2304
2451
|
export declare interface KayAppSessionWorkSummary {
|
|
2305
2452
|
readonly goal: string;
|
|
2306
2453
|
readonly work: readonly string[];
|
|
@@ -2337,7 +2484,7 @@ declare interface KayAppStoredSession {
|
|
|
2337
2484
|
}
|
|
2338
2485
|
|
|
2339
2486
|
/** Bonsai's reasoning-effort ladder, in ascending order. */
|
|
2340
|
-
declare type KayAppThinkingLevel =
|
|
2487
|
+
declare type KayAppThinkingLevel = AgentRuntimeThinkingLevel;
|
|
2341
2488
|
|
|
2342
2489
|
/**
|
|
2343
2490
|
* The host-stamped per-call context an app-contributed tool's `execute` receives. The app
|
|
@@ -3060,6 +3207,10 @@ declare function Readonly_2<Type extends TSchema>(type: Type): TAddReadonly<Type
|
|
|
3060
3207
|
|
|
3061
3208
|
declare const Readonly_3: (input: string) => [unknown, string] | [];
|
|
3062
3209
|
|
|
3210
|
+
declare type ReadonlyContract<T> = T extends readonly (infer Item)[] ? readonly ReadonlyContract<Item>[] : T extends object ? {
|
|
3211
|
+
readonly [Key in keyof T]: ReadonlyContract<T[Key]>;
|
|
3212
|
+
} : T;
|
|
3213
|
+
|
|
3063
3214
|
declare type ReadonlyKeys<Properties extends TProperties, Result extends PropertyKey = {
|
|
3064
3215
|
[Key in keyof Properties]: Properties[Key] extends TReadonly<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? never : Key) : never;
|
|
3065
3216
|
}[keyof Properties]> = Result;
|
|
@@ -7676,18 +7827,6 @@ declare const WithValue: (input: string) => [unknown, string] | [];
|
|
|
7676
7827
|
|
|
7677
7828
|
declare function WithValueMapping(input: unknown): unknown;
|
|
7678
7829
|
|
|
7679
|
-
declare type WorkBlockCoverage = z.infer<typeof WorkBlockCoverageSchema>;
|
|
7680
|
-
|
|
7681
|
-
/**
|
|
7682
|
-
* Exact ordered completed executions, addressed by persisted tool-result entry IDs.
|
|
7683
|
-
* Provider call IDs can repeat across retries and turns; they are never ownership keys.
|
|
7684
|
-
*/
|
|
7685
|
-
declare const WorkBlockCoverageSchema: z.ZodObject<{
|
|
7686
|
-
firstToolResultEntryId: z.ZodString;
|
|
7687
|
-
lastToolResultEntryId: z.ZodString;
|
|
7688
|
-
toolResultEntryIds: z.ZodArray<z.ZodString>;
|
|
7689
|
-
}, z.core.$strict>;
|
|
7690
|
-
|
|
7691
7830
|
declare interface XAdditionalItems<AdditionalItems extends XSchema = XSchema> {
|
|
7692
7831
|
additionalItems: AdditionalItems;
|
|
7693
7832
|
}
|