@yaklabs-ai/plugin-sdk 0.13.5 → 0.13.7
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 +19 -8
- package/THIRD-PARTY-INVENTORY.json +8 -1
- package/dist/agent-conversation.d.ts +93 -0
- package/dist/agent-conversation.js +174 -0
- package/dist/app-data.d.ts +7 -0
- package/dist/app-data.js +9 -0
- package/dist/disclosure.d.ts +5 -7
- package/dist/kay-agent-testing.d.ts +30 -7
- package/dist/kay-agent-testing.js +37 -0
- package/dist/kay-agent.d.ts +43 -8
- package/dist/kay-agent.js +197 -2
- package/dist/kay-app.d.ts +60 -55
- package/dist/kay-app.js +66 -50
- package/dist/time.d.ts +157 -0
- package/dist/time.js +37 -0
- package/dist/transcript-review.d.ts +310 -0
- package/dist/transcript-review.js +680 -0
- package/dist/transcript.d.ts +109 -0
- package/dist/transcript.js +83 -1
- package/dist/vendored-mcp.d.ts +1217 -0
- package/dist/vendored-mcp.js +471 -0
- package/package.json +23 -2
- package/skills/directory-plugin-authoring/SKILL.md +9 -8
package/dist/kay-agent.js
CHANGED
|
@@ -1,3 +1,197 @@
|
|
|
1
|
+
// packages/herd-uri/dist/claims.js
|
|
2
|
+
var SCHEME_RE = /^([a-z][a-z0-9+.-]*):\/\//i;
|
|
3
|
+
var CAPTURE_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
4
|
+
var REST_CAPTURE_RE = /^:([A-Za-z_][A-Za-z0-9_]*)\*$/;
|
|
5
|
+
var CONSTRAINED_CAPTURE_RE = /^([A-Za-z_][A-Za-z0-9_]*)(?:\((.*)\))?$/;
|
|
6
|
+
var MAX_CAPTURE_CONSTRAINT_LENGTH = 64;
|
|
7
|
+
function compileUriClaim(claim) {
|
|
8
|
+
if (claim.kind === "scheme") {
|
|
9
|
+
const scheme = normalizeProtocol(claim.scheme);
|
|
10
|
+
return {
|
|
11
|
+
claim,
|
|
12
|
+
match(input) {
|
|
13
|
+
const actual = SCHEME_RE.exec(input.trim())?.[1]?.toLowerCase();
|
|
14
|
+
if (actual !== scheme)
|
|
15
|
+
return void 0;
|
|
16
|
+
return { claimKind: claim.kind };
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const pattern = compileRoutePattern(claim.pattern);
|
|
21
|
+
return {
|
|
22
|
+
claim,
|
|
23
|
+
match(input) {
|
|
24
|
+
const parsed = parsePatternInput(input);
|
|
25
|
+
if (parsed === void 0)
|
|
26
|
+
return void 0;
|
|
27
|
+
const captures = matchRoute(pattern, parsed);
|
|
28
|
+
if (captures === void 0)
|
|
29
|
+
return void 0;
|
|
30
|
+
return {
|
|
31
|
+
claimKind: claim.kind,
|
|
32
|
+
...Object.keys(captures).length > 0 ? { captures } : {},
|
|
33
|
+
...claim.normalizeTo !== void 0 ? {
|
|
34
|
+
normalizedUri: withInputSearch(claim, pattern, parsed, interpolateNormalizeTo(claim.normalizeTo, captures, pattern.restCaptures ?? []))
|
|
35
|
+
} : {}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function normalizeProtocol(value) {
|
|
41
|
+
return value.replace(/:$/, "").toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
function parsePatternInput(input) {
|
|
44
|
+
try {
|
|
45
|
+
const url = new URL(input.trim());
|
|
46
|
+
return {
|
|
47
|
+
protocol: normalizeProtocol(url.protocol),
|
|
48
|
+
hostname: url.hostname.toLowerCase(),
|
|
49
|
+
pathname: url.pathname,
|
|
50
|
+
search: url.search.startsWith("?") ? url.search.slice(1) : url.search
|
|
51
|
+
};
|
|
52
|
+
} catch {
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function compileRoutePattern(pattern) {
|
|
57
|
+
const pathname = pattern.pathname !== void 0 ? compileParts(pattern.pathname, "/", { allowRest: true }) : void 0;
|
|
58
|
+
return {
|
|
59
|
+
...pattern.protocol !== void 0 ? { protocol: normalizeProtocol(pattern.protocol) } : {},
|
|
60
|
+
...pattern.hostname !== void 0 ? { hostname: compileParts(pattern.hostname.toLowerCase(), ".") } : {},
|
|
61
|
+
...pathname !== void 0 ? { pathname } : {},
|
|
62
|
+
...pathname !== void 0 ? {
|
|
63
|
+
restCaptures: pathname.filter((part) => part.rest === true).map((part) => part.capture)
|
|
64
|
+
} : {},
|
|
65
|
+
...pattern.search !== void 0 ? { search: compileParts(pattern.search.replace(/^\?/, ""), "&") } : {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function compileParts(value, separator, options = {}) {
|
|
69
|
+
if (value === "")
|
|
70
|
+
return [];
|
|
71
|
+
const parts = value.split(separator);
|
|
72
|
+
return parts.map((part, index) => {
|
|
73
|
+
const restMatch = REST_CAPTURE_RE.exec(part);
|
|
74
|
+
if (restMatch !== null) {
|
|
75
|
+
if (options.allowRest !== true || index !== parts.length - 1) {
|
|
76
|
+
throw new Error("URI claim rest captures must be final pathname segments.");
|
|
77
|
+
}
|
|
78
|
+
return { capture: restMatch[1], rest: true };
|
|
79
|
+
}
|
|
80
|
+
if (part.startsWith(":")) {
|
|
81
|
+
const rawCapture = part.slice(1);
|
|
82
|
+
const match = CONSTRAINED_CAPTURE_RE.exec(rawCapture);
|
|
83
|
+
if (match === null) {
|
|
84
|
+
throw new Error(`Invalid URI claim capture ':${rawCapture}'.`);
|
|
85
|
+
}
|
|
86
|
+
const capture = match[1];
|
|
87
|
+
if (!CAPTURE_RE.test(capture)) {
|
|
88
|
+
throw new Error(`Invalid URI claim capture ':${rawCapture}'.`);
|
|
89
|
+
}
|
|
90
|
+
const constraint = match[2];
|
|
91
|
+
if (constraint !== void 0)
|
|
92
|
+
assertSupportedConstraint(constraint);
|
|
93
|
+
return {
|
|
94
|
+
capture,
|
|
95
|
+
...constraint !== void 0 ? { constraint: new RegExp(`^(?:${constraint})$`) } : {}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return { literal: part };
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function assertSupportedConstraint(constraint) {
|
|
102
|
+
if (constraint.length > MAX_CAPTURE_CONSTRAINT_LENGTH || /[()|]/.test(constraint)) {
|
|
103
|
+
throw new Error("URI claim capture constraints must be short segment regexes without grouping or alternation.");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function matchRoute(pattern, input) {
|
|
107
|
+
if (pattern.protocol !== void 0 && pattern.protocol !== input.protocol) {
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
110
|
+
const captures = {};
|
|
111
|
+
if (pattern.hostname !== void 0 && !matchParts(pattern.hostname, input.hostname, ".", captures)) {
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
if (pattern.pathname !== void 0 && !matchParts(pattern.pathname, input.pathname, "/", captures)) {
|
|
115
|
+
return void 0;
|
|
116
|
+
}
|
|
117
|
+
if (pattern.search !== void 0 && !matchParts(pattern.search, input.search, "&", captures)) {
|
|
118
|
+
return void 0;
|
|
119
|
+
}
|
|
120
|
+
return captures;
|
|
121
|
+
}
|
|
122
|
+
function matchParts(pattern, value, separator, captures) {
|
|
123
|
+
const parts = value.split(separator);
|
|
124
|
+
let partIndex = 0;
|
|
125
|
+
for (let i = 0; i < pattern.length; i += 1) {
|
|
126
|
+
const expected = pattern[i];
|
|
127
|
+
if (expected.rest === true) {
|
|
128
|
+
const remaining = parts.slice(partIndex);
|
|
129
|
+
if (remaining.every((part) => part === ""))
|
|
130
|
+
return false;
|
|
131
|
+
captures[expected.capture] = remaining.join(separator);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
if (partIndex >= parts.length)
|
|
135
|
+
return false;
|
|
136
|
+
const actual = parts[partIndex];
|
|
137
|
+
if (expected.capture !== void 0) {
|
|
138
|
+
const decoded = safeDecode(actual);
|
|
139
|
+
if (expected.constraint !== void 0 && !expected.constraint.test(decoded)) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
captures[expected.capture] = decoded;
|
|
143
|
+
partIndex += 1;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (expected.literal !== actual)
|
|
147
|
+
return false;
|
|
148
|
+
partIndex += 1;
|
|
149
|
+
}
|
|
150
|
+
return partIndex === parts.length;
|
|
151
|
+
}
|
|
152
|
+
function safeDecode(value) {
|
|
153
|
+
try {
|
|
154
|
+
return decodeURIComponent(value);
|
|
155
|
+
} catch {
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function withInputSearch(claim, pattern, input, normalized) {
|
|
160
|
+
if (claim.kind !== "uriPattern" || claim.normalizeTo === void 0 || pattern.search !== void 0 || input.search.length === 0 || claim.normalizeTo.includes("?") || templateProtocol(claim.normalizeTo) !== input.protocol) {
|
|
161
|
+
return normalized;
|
|
162
|
+
}
|
|
163
|
+
return `${normalized}?${input.search}`;
|
|
164
|
+
}
|
|
165
|
+
function templateProtocol(template) {
|
|
166
|
+
return SCHEME_RE.exec(template)?.[1]?.toLowerCase();
|
|
167
|
+
}
|
|
168
|
+
function interpolateNormalizeTo(template, captures, restCaptures) {
|
|
169
|
+
return template.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (full, name, offset) => {
|
|
170
|
+
const value = captures[name];
|
|
171
|
+
if (value === void 0)
|
|
172
|
+
return full;
|
|
173
|
+
return encodeCaptureValue({
|
|
174
|
+
template,
|
|
175
|
+
offset,
|
|
176
|
+
value,
|
|
177
|
+
rest: restCaptures.includes(name)
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function encodeCaptureValue({ template, offset, value, rest }) {
|
|
182
|
+
const normalized = isAuthorityCapture(template, offset) ? value.toLowerCase() : value;
|
|
183
|
+
if (!rest)
|
|
184
|
+
return encodeURIComponent(normalized);
|
|
185
|
+
return normalized.split("/").join("/");
|
|
186
|
+
}
|
|
187
|
+
function isAuthorityCapture(template, offset) {
|
|
188
|
+
const prefix = template.slice(0, offset);
|
|
189
|
+
const schemeIndex = prefix.lastIndexOf("://");
|
|
190
|
+
if (schemeIndex === -1)
|
|
191
|
+
return false;
|
|
192
|
+
return !/[/?#]/.test(prefix.slice(schemeIndex + 3));
|
|
193
|
+
}
|
|
194
|
+
|
|
1
195
|
// packages/herd-uri/dist/errors.js
|
|
2
196
|
var UriError = class extends Error {
|
|
3
197
|
};
|
|
@@ -142,10 +336,10 @@ function isProducedResourceDeclaration(value) {
|
|
|
142
336
|
// packages/herd-uri/dist/template-route.js
|
|
143
337
|
var PLACEHOLDER_RE = /<([^<>]+)>/g;
|
|
144
338
|
var REST_SUFFIX = "...";
|
|
145
|
-
var
|
|
339
|
+
var SCHEME_RE2 = /^([a-zA-Z][a-zA-Z0-9+.-]*):(?:\/\/)?(.*)$/s;
|
|
146
340
|
function parseRoute(address) {
|
|
147
341
|
const trimmed = address.trim();
|
|
148
|
-
const match =
|
|
342
|
+
const match = SCHEME_RE2.exec(trimmed);
|
|
149
343
|
const scheme = match?.[1]?.toLowerCase() ?? "";
|
|
150
344
|
const rest = match?.[2] ?? trimmed;
|
|
151
345
|
const [rawPath = "", rawQuery] = splitQuery(rest);
|
|
@@ -1577,6 +1771,7 @@ export {
|
|
|
1577
1771
|
bytesToBase64,
|
|
1578
1772
|
capability,
|
|
1579
1773
|
collectKayAgentAdvertisement,
|
|
1774
|
+
compileUriClaim,
|
|
1580
1775
|
contentDigest,
|
|
1581
1776
|
contentResult,
|
|
1582
1777
|
createFallbackOnlyWithJev,
|
package/dist/kay-app.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ declare function AddReadonlyDeferred<Type extends TSchema>(type: Type, options?:
|
|
|
61
61
|
declare type AgentMessage = Message | CustomAgentMessages[keyof CustomAgentMessages];
|
|
62
62
|
|
|
63
63
|
/** Final or partial result produced by a tool. */
|
|
64
|
-
export declare interface AgentToolResult<T =
|
|
64
|
+
export declare interface AgentToolResult<T = JsonValue_2 | undefined> {
|
|
65
65
|
/** Text or image content returned to the model. */
|
|
66
66
|
content: (TextContent | ImageContent)[];
|
|
67
67
|
/** Arbitrary structured details for logs or UI rendering. */
|
|
@@ -70,7 +70,7 @@ export declare interface AgentToolResult<T = JsonValue | undefined> {
|
|
|
70
70
|
* Machine-readable result matching the tool's `outputSchema`, for programmatic callers. Not sent
|
|
71
71
|
* to the model; `content` remains the model-facing result.
|
|
72
72
|
*/
|
|
73
|
-
structuredContent?:
|
|
73
|
+
structuredContent?: JsonValue_2;
|
|
74
74
|
/** Usage from the final tool execution itself, if available. Not used for main LLM context accounting. */
|
|
75
75
|
usage?: Usage;
|
|
76
76
|
/**
|
|
@@ -421,7 +421,7 @@ declare interface BranchSummaryEntry extends EntryBase {
|
|
|
421
421
|
type: "branch_summary";
|
|
422
422
|
fromId: string | null;
|
|
423
423
|
summary: string;
|
|
424
|
-
details?:
|
|
424
|
+
details?: JsonValue_2;
|
|
425
425
|
usage?: Usage;
|
|
426
426
|
fromHook: boolean;
|
|
427
427
|
}
|
|
@@ -511,7 +511,7 @@ declare interface CompactionEntry extends EntryBase {
|
|
|
511
511
|
summary: string;
|
|
512
512
|
retainedTail: AgentMessage[];
|
|
513
513
|
tokensBefore: number;
|
|
514
|
-
details?:
|
|
514
|
+
details?: JsonValue_2;
|
|
515
515
|
usage?: Usage;
|
|
516
516
|
fromHook: boolean;
|
|
517
517
|
}
|
|
@@ -756,7 +756,7 @@ declare interface CustomAgentMessages {
|
|
|
756
756
|
declare interface CustomEntry extends EntryBase {
|
|
757
757
|
type: "custom";
|
|
758
758
|
customType: string;
|
|
759
|
-
data?:
|
|
759
|
+
data?: JsonValue_2;
|
|
760
760
|
}
|
|
761
761
|
|
|
762
762
|
declare interface CustomMessage<T = unknown> {
|
|
@@ -831,7 +831,7 @@ declare interface DeferredHandle {
|
|
|
831
831
|
expiresAt?: number;
|
|
832
832
|
pollAfterMs?: number;
|
|
833
833
|
/** Provider conversion data required to reconstruct the final assistant message. */
|
|
834
|
-
data?:
|
|
834
|
+
data?: JsonValue_4;
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
/** Creates a Dependent type */
|
|
@@ -1420,7 +1420,7 @@ declare function IsEnum(value: unknown): value is TEnum;
|
|
|
1420
1420
|
/** Returns true if the given value is a EnumValue */
|
|
1421
1421
|
declare function IsEnumValue(value: unknown): value is TEnumValue;
|
|
1422
1422
|
|
|
1423
|
-
declare type IsExactlyJsonValue<T> = [T] extends [
|
|
1423
|
+
declare type IsExactlyJsonValue<T> = [T] extends [JsonValue_4] ? ([JsonValue_4] extends [T] ? true : false) : false;
|
|
1424
1424
|
|
|
1425
1425
|
declare function IsExtendsFalse(value: unknown): value is TExtendsFalse;
|
|
1426
1426
|
|
|
@@ -1719,39 +1719,39 @@ export declare type JevState = object;
|
|
|
1719
1719
|
export declare type JevTransport = "direct" | "hosted";
|
|
1720
1720
|
|
|
1721
1721
|
declare type JsonObject = {
|
|
1722
|
-
[key: string]:
|
|
1722
|
+
[key: string]: JsonValue_4;
|
|
1723
1723
|
};
|
|
1724
1724
|
|
|
1725
1725
|
declare type JsonPrimitive = string | number | boolean | null;
|
|
1726
1726
|
|
|
1727
1727
|
/** The JSON representation of a typed in-memory value. Optional object properties remain optional. */
|
|
1728
|
-
declare type JsonRepresentation<T> = IsAny_2<T> extends true ?
|
|
1728
|
+
declare type JsonRepresentation<T> = IsAny_2<T> extends true ? JsonValue_4 : unknown extends T ? JsonValue_4 : [T] extends [JsonValue_4] ? T : T extends readonly unknown[] ? {
|
|
1729
1729
|
[TKey in keyof T]: JsonRepresentation<Exclude<T[TKey], undefined>>;
|
|
1730
1730
|
} : T extends object ? {
|
|
1731
1731
|
[TKey in keyof T]: JsonRepresentation<Exclude<T[TKey], undefined>>;
|
|
1732
1732
|
} : never;
|
|
1733
1733
|
|
|
1734
|
-
declare
|
|
1734
|
+
export declare const JsonSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
1735
1735
|
|
|
1736
|
-
declare
|
|
1736
|
+
export declare type JsonSchema = z.infer<typeof JsonSchema>;
|
|
1737
1737
|
|
|
1738
|
-
declare type JsonSchema_2 =
|
|
1738
|
+
declare type JsonSchema_2 = Record<string, unknown>;
|
|
1739
1739
|
|
|
1740
|
-
declare type JsonValue =
|
|
1740
|
+
export declare type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
1741
1741
|
[key: string]: JsonValue;
|
|
1742
1742
|
};
|
|
1743
1743
|
|
|
1744
|
-
declare
|
|
1745
|
-
readonly [key: string]: JsonValue_2;
|
|
1746
|
-
} | readonly JsonValue_2[];
|
|
1747
|
-
|
|
1748
|
-
declare type JsonValue_3 = null | boolean | number | string | readonly JsonValue_3[] | JsonObject;
|
|
1744
|
+
export declare const JsonValue: z.ZodType<JsonValue>;
|
|
1749
1745
|
|
|
1750
|
-
declare type
|
|
1751
|
-
[key: string]:
|
|
1746
|
+
declare type JsonValue_2 = null | boolean | number | string | JsonValue_2[] | {
|
|
1747
|
+
[key: string]: JsonValue_2;
|
|
1752
1748
|
};
|
|
1753
1749
|
|
|
1754
|
-
declare
|
|
1750
|
+
declare type JsonValue_3 = JsonPrimitive | {
|
|
1751
|
+
readonly [key: string]: JsonValue_3;
|
|
1752
|
+
} | readonly JsonValue_3[];
|
|
1753
|
+
|
|
1754
|
+
declare type JsonValue_4 = null | boolean | number | string | readonly JsonValue_4[] | JsonObject;
|
|
1755
1755
|
|
|
1756
1756
|
/**
|
|
1757
1757
|
* Every condition kind an automation can be created with, as runtime data.
|
|
@@ -1773,6 +1773,9 @@ export declare const KAY_APP_AUTOMATION_CONDITION_KINDS: readonly ["time", "uri-
|
|
|
1773
1773
|
/** Maximum UTF-8 JSON size of one plugin app-data live change. */
|
|
1774
1774
|
export declare const KAY_APP_DATA_CHANGE_MAX_BYTES: number;
|
|
1775
1775
|
|
|
1776
|
+
/** Maximum UTF-8 JSON size of one plugin app-data snapshot. */
|
|
1777
|
+
export declare const KAY_APP_DATA_SNAPSHOT_MAX_BYTES: number;
|
|
1778
|
+
|
|
1776
1779
|
declare interface KayAgentWhiteboardCreateInput {
|
|
1777
1780
|
readonly name: string;
|
|
1778
1781
|
readonly title: string;
|
|
@@ -2135,7 +2138,7 @@ export declare interface KayAppAgentDefinitionConfig {
|
|
|
2135
2138
|
/** A plugin-authored definition's structured-output contract (the wire's final-output shape). */
|
|
2136
2139
|
export declare interface KayAppAgentDefinitionFinalOutput {
|
|
2137
2140
|
/** JSON Schema for the structured value a matching turn submits. */
|
|
2138
|
-
readonly schema:
|
|
2141
|
+
readonly schema: JsonSchema;
|
|
2139
2142
|
readonly required?: boolean | "per-run";
|
|
2140
2143
|
readonly sessionTitle?: boolean;
|
|
2141
2144
|
readonly whenToSubmit?: string;
|
|
@@ -2435,7 +2438,7 @@ export declare type KayAppAutomationEffect = {
|
|
|
2435
2438
|
/** As STORED: always a reference, never inline source. */
|
|
2436
2439
|
readonly kind: "script";
|
|
2437
2440
|
readonly ref: KayAppAutomationScriptRef;
|
|
2438
|
-
readonly initialState?:
|
|
2441
|
+
readonly initialState?: JsonValue;
|
|
2439
2442
|
} | {
|
|
2440
2443
|
readonly kind: "deliver-turn";
|
|
2441
2444
|
readonly target: {
|
|
@@ -2467,7 +2470,7 @@ export declare type KayAppAutomationEffectInput = {
|
|
|
2467
2470
|
* and stores a reference to that file. Pass this OR `ref`, never both.
|
|
2468
2471
|
*/
|
|
2469
2472
|
readonly source?: string;
|
|
2470
|
-
readonly initialState?:
|
|
2473
|
+
readonly initialState?: JsonValue;
|
|
2471
2474
|
};
|
|
2472
2475
|
|
|
2473
2476
|
/**
|
|
@@ -2639,11 +2642,15 @@ export declare type KayAppAutomationRunOutcome = {
|
|
|
2639
2642
|
/** `sha256:<hex>` over the bytes the run resolved and pinned. */
|
|
2640
2643
|
readonly sourceDigest?: string | undefined;
|
|
2641
2644
|
} | undefined;
|
|
2645
|
+
/** How many tries the run's effect took, when more than one. */
|
|
2646
|
+
readonly tries?: number | undefined;
|
|
2642
2647
|
} | {
|
|
2643
2648
|
readonly status: "failed";
|
|
2644
2649
|
readonly summary?: KayAppRunSummary | undefined;
|
|
2645
2650
|
readonly reason: "executor_failed" | "permission_denied" | "surface_unavailable" | "target_gone";
|
|
2646
2651
|
readonly message?: string | undefined;
|
|
2652
|
+
/** How many tries the run's effect took, when more than one. */
|
|
2653
|
+
readonly tries?: number | undefined;
|
|
2647
2654
|
} | {
|
|
2648
2655
|
readonly status: "skipped";
|
|
2649
2656
|
readonly reason: "already_running" | "binding_inactive" | "circuit_breaker" | "concurrency_capped" | "guard_not_satisfied" | "missed_window" | "timer_cancelled";
|
|
@@ -2922,7 +2929,7 @@ export declare interface KayAppConfigSnapshot {
|
|
|
2922
2929
|
* The folded value of the named own section; `undefined` when the user has configured
|
|
2923
2930
|
* nothing for it (defaults are the plugin's own concern — the fold carries only what a file set).
|
|
2924
2931
|
*/
|
|
2925
|
-
readonly value:
|
|
2932
|
+
readonly value: JsonValue_3 | undefined;
|
|
2926
2933
|
/**
|
|
2927
2934
|
* Winner provenance for the section, when the fold recorded it (it always does for a present
|
|
2928
2935
|
* value). Absent for an absent value. A deep section carries per-field origins so a plugin can
|
|
@@ -2937,7 +2944,7 @@ export declare interface KayAppConfigSnapshot {
|
|
|
2937
2944
|
* section deep-merges (send field-only patches; a nested `null` deletes that field), anything
|
|
2938
2945
|
* else replaces wholesale.
|
|
2939
2946
|
*/
|
|
2940
|
-
export declare type KayAppConfigWritePatch = Readonly<Record<string,
|
|
2947
|
+
export declare type KayAppConfigWritePatch = Readonly<Record<string, JsonValue_3 | undefined>>;
|
|
2941
2948
|
|
|
2942
2949
|
/** What a config write reports back — never the settings document itself. */
|
|
2943
2950
|
export declare interface KayAppConfigWriteResult {
|
|
@@ -2980,7 +2987,7 @@ export declare interface KayAppCorpus {
|
|
|
2980
2987
|
* longer than the page is stepped over and counted in `oversizedRecords`.
|
|
2981
2988
|
*/
|
|
2982
2989
|
readEntryBatch?(sessionId: string, options?: {
|
|
2983
|
-
readonly cursor?:
|
|
2990
|
+
readonly cursor?: JsonValue;
|
|
2984
2991
|
readonly throughEntryId?: string;
|
|
2985
2992
|
/** Host-only cancellation for the bounded physical read. */
|
|
2986
2993
|
readonly signal?: AbortSignal;
|
|
@@ -2996,9 +3003,9 @@ export declare interface KayAppCorpus {
|
|
|
2996
3003
|
export declare interface KayAppCorpusEntryBatch {
|
|
2997
3004
|
readonly entries: readonly TranscriptEntry[];
|
|
2998
3005
|
/** Opaque JSON cursor after the physical page; only the host may interpret it or open its path. */
|
|
2999
|
-
readonly cursor:
|
|
3006
|
+
readonly cursor: JsonValue;
|
|
3000
3007
|
/** Opaque cursor at the physical page start, for a partial logical chunk. */
|
|
3001
|
-
readonly pageStartCursor?:
|
|
3008
|
+
readonly pageStartCursor?: JsonValue;
|
|
3002
3009
|
readonly mode: "replace" | "append";
|
|
3003
3010
|
/**
|
|
3004
3011
|
* `record-too-large`: a record longer than the page that the host could not step over, because
|
|
@@ -4302,7 +4309,7 @@ declare interface KayAppSessionRunBase {
|
|
|
4302
4309
|
/** The run's final output text (the headless session's reply channel). */
|
|
4303
4310
|
readonly output: string;
|
|
4304
4311
|
/** Present when a structured completion was requested and the run completed. */
|
|
4305
|
-
readonly result?:
|
|
4312
|
+
readonly result?: JsonValue;
|
|
4306
4313
|
readonly errorMessage?: string | undefined;
|
|
4307
4314
|
/** Attested live host-tool roster when the caller requested one explicitly. */
|
|
4308
4315
|
readonly activeToolNames?: readonly KayAppSessionRunHostToolName[] | undefined;
|
|
@@ -4320,7 +4327,7 @@ export declare type KayAppSessionRunCompletion = {
|
|
|
4320
4327
|
} | {
|
|
4321
4328
|
readonly kind: "structured";
|
|
4322
4329
|
/** JSON Schema for the required value returned through `result`. */
|
|
4323
|
-
readonly schema:
|
|
4330
|
+
readonly schema: JsonSchema;
|
|
4324
4331
|
};
|
|
4325
4332
|
|
|
4326
4333
|
/** Provider-neutral recorded classification; an unclassified failure omits the field. */
|
|
@@ -5202,11 +5209,9 @@ export declare interface KayAppTimeSnapshot {
|
|
|
5202
5209
|
/**
|
|
5203
5210
|
* The time zone the user is in, as an IANA id in the spelling ICU resolves (`America/New_York`).
|
|
5204
5211
|
* One zone can have two ids, and ICU picks one: `Asia/Kolkata` comes back as `Asia/Calcutta`. So
|
|
5205
|
-
* never compare zone ids with
|
|
5206
|
-
*
|
|
5207
|
-
*
|
|
5208
|
-
* results. Pass `zone` as the `timeZone` of `Intl.DateTimeFormat` or `toLocaleString` to format a
|
|
5209
|
-
* time for the user.
|
|
5212
|
+
* never compare zone ids with `===`: compare with `sameZone` from `@bonsai/plugin-sdk/time`. Pass
|
|
5213
|
+
* `zone` as the `timeZone` of `Intl.DateTimeFormat` or `toLocaleString` to format a time for the
|
|
5214
|
+
* user.
|
|
5210
5215
|
*
|
|
5211
5216
|
* When `zoneSource` is `utc-fallback` the zone is unknown, and this value is `UTC` only because a
|
|
5212
5217
|
* value is required.
|
|
@@ -7055,7 +7060,7 @@ declare function PickDeferred<Type extends TSchema, Indexer extends TSchema>(typ
|
|
|
7055
7060
|
* every rule it accepts, the same way it stamps the definition's identity. A plugin cannot ask for
|
|
7056
7061
|
* durability, so it cannot be told "no" about it either.
|
|
7057
7062
|
*/
|
|
7058
|
-
declare const PluginAgentDefinitionPermissionRule: z.ZodObject<{
|
|
7063
|
+
export declare const PluginAgentDefinitionPermissionRule: z.ZodObject<{
|
|
7059
7064
|
effect: z.ZodEnum<{
|
|
7060
7065
|
allow: "allow";
|
|
7061
7066
|
deny: "deny";
|
|
@@ -7073,7 +7078,7 @@ declare const PluginAgentDefinitionPermissionRule: z.ZodObject<{
|
|
|
7073
7078
|
}>>;
|
|
7074
7079
|
}, z.core.$strict>;
|
|
7075
7080
|
|
|
7076
|
-
declare type PluginAgentDefinitionPermissionRule = z.infer<typeof PluginAgentDefinitionPermissionRule>;
|
|
7081
|
+
export declare type PluginAgentDefinitionPermissionRule = z.infer<typeof PluginAgentDefinitionPermissionRule>;
|
|
7077
7082
|
|
|
7078
7083
|
declare const Properties: (input: string) => [unknown, string] | [];
|
|
7079
7084
|
|
|
@@ -7132,7 +7137,7 @@ declare interface ProxiedToolCall {
|
|
|
7132
7137
|
readonly input: Record<string, unknown>;
|
|
7133
7138
|
}
|
|
7134
7139
|
|
|
7135
|
-
declare interface RawResource {
|
|
7140
|
+
export declare interface RawResource {
|
|
7136
7141
|
readonly uri: string;
|
|
7137
7142
|
readonly content: string | Uint8Array;
|
|
7138
7143
|
readonly mimeType: string;
|
|
@@ -7392,8 +7397,8 @@ declare function ReturnTypeDeferred<Type extends TSchema>(type: Type, options?:
|
|
|
7392
7397
|
* owns:
|
|
7393
7398
|
* - {@link RunFailureReason}.
|
|
7394
7399
|
* does_not_own:
|
|
7395
|
-
* - Classifying a failure into a reason (
|
|
7396
|
-
*
|
|
7400
|
+
* - Classifying a failure into a reason (`./run-failure-classifier.ts`), or the engine's
|
|
7401
|
+
* run-error mapping and recovery policy (`@herd/herd-agent`).
|
|
7397
7402
|
* ---
|
|
7398
7403
|
*/
|
|
7399
7404
|
/** Provider-neutral factual category for a failed model run. */
|
|
@@ -7801,7 +7806,7 @@ declare type SamplingParams = Record<string, unknown>;
|
|
|
7801
7806
|
|
|
7802
7807
|
declare type SamplingParamsByThinkingLevel = Partial<Record<ModelThinkingLevel, SamplingParams>>;
|
|
7803
7808
|
|
|
7804
|
-
declare type SchemaInput = z.ZodType |
|
|
7809
|
+
declare type SchemaInput = z.ZodType | JsonSchema_2;
|
|
7805
7810
|
|
|
7806
7811
|
/** One all-of arm in an ordered scope requirement. */
|
|
7807
7812
|
declare interface ScopeAlternative {
|
|
@@ -10898,7 +10903,7 @@ declare interface ToolReference {
|
|
|
10898
10903
|
name: string;
|
|
10899
10904
|
}
|
|
10900
10905
|
|
|
10901
|
-
declare type ToolResultMessage<TDetails =
|
|
10906
|
+
declare type ToolResultMessage<TDetails = JsonValue_4> = IsJsonCompatible<TDetails> extends true ? {
|
|
10902
10907
|
role: "toolResult";
|
|
10903
10908
|
toolCallId: string;
|
|
10904
10909
|
toolName: string;
|
|
@@ -12291,7 +12296,7 @@ declare interface UriExternalCliRunResult {
|
|
|
12291
12296
|
readonly stderrTruncated?: boolean;
|
|
12292
12297
|
}
|
|
12293
12298
|
|
|
12294
|
-
declare interface UriHelp {
|
|
12299
|
+
export declare interface UriHelp {
|
|
12295
12300
|
readonly uri: string;
|
|
12296
12301
|
readonly title: string;
|
|
12297
12302
|
readonly summary: string;
|
|
@@ -12334,12 +12339,12 @@ declare interface UriListMetadata {
|
|
|
12334
12339
|
readonly incompleteSearch?: boolean;
|
|
12335
12340
|
}
|
|
12336
12341
|
|
|
12337
|
-
declare interface UriListParams {
|
|
12342
|
+
export declare interface UriListParams {
|
|
12338
12343
|
readonly cursor?: string;
|
|
12339
12344
|
readonly limit?: number;
|
|
12340
12345
|
}
|
|
12341
12346
|
|
|
12342
|
-
declare interface UriListResult {
|
|
12347
|
+
export declare interface UriListResult {
|
|
12343
12348
|
readonly uri: string;
|
|
12344
12349
|
readonly items: readonly UriListItem[];
|
|
12345
12350
|
readonly nextCursor?: string;
|
|
@@ -12588,7 +12593,7 @@ declare interface UriMutationReceipt {
|
|
|
12588
12593
|
declare interface UriMutationResult {
|
|
12589
12594
|
readonly uri: string;
|
|
12590
12595
|
readonly summary?: string;
|
|
12591
|
-
readonly resource?: RawResource |
|
|
12596
|
+
readonly resource?: RawResource | JsonValue_3;
|
|
12592
12597
|
readonly validation?: readonly UriValidationMessage[];
|
|
12593
12598
|
readonly metadata?: Record<string, unknown>;
|
|
12594
12599
|
/** Typed state/recovery evidence; successful callers may trust it without a proof read. */
|
|
@@ -12760,7 +12765,7 @@ declare interface UriParameter {
|
|
|
12760
12765
|
readonly in: "uri" | "query" | "selector";
|
|
12761
12766
|
readonly required: boolean;
|
|
12762
12767
|
readonly description?: string;
|
|
12763
|
-
readonly schema:
|
|
12768
|
+
readonly schema: JsonSchema_2;
|
|
12764
12769
|
readonly examples?: readonly unknown[];
|
|
12765
12770
|
}
|
|
12766
12771
|
|
|
@@ -12790,14 +12795,14 @@ declare interface UriPatternInit {
|
|
|
12790
12795
|
readonly search?: string;
|
|
12791
12796
|
}
|
|
12792
12797
|
|
|
12793
|
-
declare type UriPayload = string |
|
|
12798
|
+
export declare type UriPayload = string | JsonValue_3;
|
|
12794
12799
|
|
|
12795
12800
|
export declare interface UriPayloadContract {
|
|
12796
12801
|
readonly name: string;
|
|
12797
12802
|
readonly mediaType?: string;
|
|
12798
12803
|
readonly description?: string;
|
|
12799
12804
|
/** Omitted when the node accepts or returns an unstructured payload. */
|
|
12800
|
-
readonly schema?:
|
|
12805
|
+
readonly schema?: JsonSchema_2;
|
|
12801
12806
|
/** Cross-value invariants the module enforces but plain JSON Schema cannot express. */
|
|
12802
12807
|
readonly semanticConstraints?: readonly string[];
|
|
12803
12808
|
readonly examples?: readonly unknown[];
|
|
@@ -13070,13 +13075,13 @@ declare interface UriSearchItem {
|
|
|
13070
13075
|
readonly operations?: readonly UriOperation[];
|
|
13071
13076
|
}
|
|
13072
13077
|
|
|
13073
|
-
declare interface UriSearchParams {
|
|
13078
|
+
export declare interface UriSearchParams {
|
|
13074
13079
|
readonly query: string;
|
|
13075
13080
|
readonly limit?: number;
|
|
13076
13081
|
readonly cursor?: string;
|
|
13077
13082
|
}
|
|
13078
13083
|
|
|
13079
|
-
declare interface UriSearchResult {
|
|
13084
|
+
export declare interface UriSearchResult {
|
|
13080
13085
|
readonly uri: string;
|
|
13081
13086
|
readonly query: string;
|
|
13082
13087
|
readonly items: readonly UriSearchItem[];
|
|
@@ -13446,7 +13451,7 @@ declare const WhiteboardEntryInspection: z.ZodObject<{
|
|
|
13446
13451
|
}>;
|
|
13447
13452
|
mutable: z.ZodBoolean;
|
|
13448
13453
|
diagnostics: z.ZodArray<z.ZodString>;
|
|
13449
|
-
value: z.ZodOptional<z.ZodType<
|
|
13454
|
+
value: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
13450
13455
|
text: z.ZodString;
|
|
13451
13456
|
truncated: z.ZodBoolean;
|
|
13452
13457
|
}, z.core.$strict>;
|
|
@@ -13463,7 +13468,7 @@ export declare const WhiteboardEntrySnapshot: z.ZodObject<{
|
|
|
13463
13468
|
authorSessionId: z.ZodNullable<z.ZodString>;
|
|
13464
13469
|
}, z.core.$strict>;
|
|
13465
13470
|
revision: z.ZodString;
|
|
13466
|
-
value: z.ZodType<
|
|
13471
|
+
value: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
13467
13472
|
}, z.core.$strict>;
|
|
13468
13473
|
|
|
13469
13474
|
export declare type WhiteboardEntrySnapshot = Readonly<Omit<z.infer<typeof WhiteboardEntrySnapshot>, "entry"> & {
|
|
@@ -13499,7 +13504,7 @@ export declare const WhiteboardTypeInfo: z.ZodObject<{
|
|
|
13499
13504
|
export declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;
|
|
13500
13505
|
|
|
13501
13506
|
/** The logical plugin-defined JSON payload stored inside a host-owned entry envelope. */
|
|
13502
|
-
export declare const WhiteboardValue: z.ZodType<
|
|
13507
|
+
export declare const WhiteboardValue: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
13503
13508
|
|
|
13504
13509
|
export declare type WhiteboardValue = z.infer<typeof WhiteboardValue>;
|
|
13505
13510
|
|