@agentskit/chat-protocol 0.1.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/LICENSE +22 -0
- package/README.md +16 -0
- package/dist/fixtures.cjs +384 -0
- package/dist/fixtures.d.cts +884 -0
- package/dist/fixtures.d.ts +884 -0
- package/dist/fixtures.js +346 -0
- package/dist/index.cjs +902 -0
- package/dist/index.d.cts +697 -0
- package/dist/index.d.ts +697 -0
- package/dist/index.js +809 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentsKit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @agentskit/chat-protocol
|
|
2
|
+
|
|
3
|
+
Framework-neutral v1 turn events for AgentsKit Chat.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { decodeTurnEvent } from '@agentskit/chat-protocol'
|
|
7
|
+
|
|
8
|
+
const result = decodeTurnEvent(untrustedInput)
|
|
9
|
+
if (!result.ok) return result.diagnostic
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The package transports snapshots of canonical AgentsKit state. It does not implement a controller, stream reducer, transport, or persistence layer.
|
|
13
|
+
|
|
14
|
+
It also owns the accepted versioned site-config, local-knowledge, and unified-answer envelopes used by the deterministic answer plane. Decode untrusted data with `decodeDeterministicSiteConfig` and `decodeAnswerResponse`; cryptographically verify local artifacts with `verifyLocalKnowledgeArtifact`. See the [deterministic answer guide](../../docs/protocol/deterministic-answers.md).
|
|
15
|
+
|
|
16
|
+
For one canonical assistant message containing both streamed prose and registered application components, use `createAssistantContentEncoder` and decode with `decodeAssistantContent`. Every text chunk must pass through the encoder; raw model output must never be appended to the envelope. See the [v1 protocol guide](../../docs/protocol/v1.md#ordered-assistant-content).
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/fixtures.ts
|
|
21
|
+
var fixtures_exports = {};
|
|
22
|
+
__export(fixtures_exports, {
|
|
23
|
+
deterministicAnswerFixtures: () => deterministicAnswerFixtures,
|
|
24
|
+
deterministicContentHashFixture: () => deterministicContentHashFixture,
|
|
25
|
+
deterministicSiteConfigFixture: () => deterministicSiteConfigFixture,
|
|
26
|
+
invalidChoiceListPropsFrame: () => invalidChoiceListPropsFrame,
|
|
27
|
+
invalidComponentFrameFixtures: () => invalidComponentFrameFixtures,
|
|
28
|
+
invalidDeterministicArtifactFixtures: () => invalidDeterministicArtifactFixtures,
|
|
29
|
+
invalidTurnEventFixtures: () => invalidTurnEventFixtures,
|
|
30
|
+
localKnowledgeArtifactFixture: () => localKnowledgeArtifactFixture,
|
|
31
|
+
persistentSessionFixture: () => persistentSessionFixture,
|
|
32
|
+
staleLocalKnowledgeArtifactFixture: () => staleLocalKnowledgeArtifactFixture,
|
|
33
|
+
standardComponentFrameFixtures: () => standardComponentFrameFixtures,
|
|
34
|
+
unknownComponentFrame: () => unknownComponentFrame,
|
|
35
|
+
validChoiceListFrame: () => validChoiceListFrame,
|
|
36
|
+
validTurnEventFixtures: () => validTurnEventFixtures
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(fixtures_exports);
|
|
39
|
+
var base = {
|
|
40
|
+
protocol: "agentskit.chat.turn",
|
|
41
|
+
version: 1,
|
|
42
|
+
sessionId: "session-conformance",
|
|
43
|
+
turnId: "turn-conformance",
|
|
44
|
+
emittedAt: "2026-07-11T03:00:00.000Z"
|
|
45
|
+
};
|
|
46
|
+
var validTurnEventFixtures = [
|
|
47
|
+
{
|
|
48
|
+
name: "submit",
|
|
49
|
+
event: {
|
|
50
|
+
...base,
|
|
51
|
+
eventId: "event-submit",
|
|
52
|
+
sequence: 0,
|
|
53
|
+
event: "client.turn.submit",
|
|
54
|
+
payload: { input: "hello" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "idle snapshot",
|
|
59
|
+
event: {
|
|
60
|
+
...base,
|
|
61
|
+
eventId: "event-idle",
|
|
62
|
+
sequence: 1,
|
|
63
|
+
event: "server.turn.snapshot",
|
|
64
|
+
payload: {
|
|
65
|
+
status: "idle",
|
|
66
|
+
usage: { promptTokens: 0, completionTokens: 0, totalTokens: 0 },
|
|
67
|
+
messages: []
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "streaming snapshot",
|
|
73
|
+
event: {
|
|
74
|
+
...base,
|
|
75
|
+
eventId: "event-streaming",
|
|
76
|
+
sequence: 2,
|
|
77
|
+
event: "server.turn.snapshot",
|
|
78
|
+
payload: {
|
|
79
|
+
status: "streaming",
|
|
80
|
+
lineage: { operation: "submit" },
|
|
81
|
+
usage: { promptTokens: 2, completionTokens: 1, totalTokens: 3 },
|
|
82
|
+
messages: [{
|
|
83
|
+
id: "message-assistant",
|
|
84
|
+
role: "assistant",
|
|
85
|
+
content: "AgentsKit",
|
|
86
|
+
status: "streaming",
|
|
87
|
+
createdAt: "2026-07-11T03:00:00.000Z"
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "complete snapshot with tool call",
|
|
94
|
+
event: {
|
|
95
|
+
...base,
|
|
96
|
+
eventId: "event-complete",
|
|
97
|
+
sequence: 3,
|
|
98
|
+
event: "server.turn.snapshot",
|
|
99
|
+
payload: {
|
|
100
|
+
status: "complete",
|
|
101
|
+
lineage: { operation: "regenerate", parentTurnId: "turn-previous", sourceMessageId: "message-assistant" },
|
|
102
|
+
usage: { promptTokens: 2, completionTokens: 3, totalTokens: 5 },
|
|
103
|
+
messages: [{
|
|
104
|
+
id: "message-assistant",
|
|
105
|
+
role: "assistant",
|
|
106
|
+
content: "AgentsKit received: hello",
|
|
107
|
+
status: "complete",
|
|
108
|
+
toolCalls: [{
|
|
109
|
+
id: "tool-call-1",
|
|
110
|
+
name: "lookup",
|
|
111
|
+
args: { query: "hello" },
|
|
112
|
+
result: "found",
|
|
113
|
+
status: "complete"
|
|
114
|
+
}],
|
|
115
|
+
createdAt: "2026-07-11T03:00:01.000Z"
|
|
116
|
+
}]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "diagnostic",
|
|
122
|
+
event: {
|
|
123
|
+
...base,
|
|
124
|
+
eventId: "event-diagnostic",
|
|
125
|
+
sequence: 4,
|
|
126
|
+
event: "server.turn.diagnostic",
|
|
127
|
+
payload: {
|
|
128
|
+
version: 1,
|
|
129
|
+
code: "ADAPTER_FAILED",
|
|
130
|
+
message: "The adapter failed.",
|
|
131
|
+
retryable: false
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "error snapshot",
|
|
137
|
+
event: {
|
|
138
|
+
...base,
|
|
139
|
+
eventId: "event-error",
|
|
140
|
+
sequence: 5,
|
|
141
|
+
event: "server.turn.snapshot",
|
|
142
|
+
payload: {
|
|
143
|
+
status: "error",
|
|
144
|
+
usage: { promptTokens: 2, completionTokens: 0, totalTokens: 2 },
|
|
145
|
+
messages: [],
|
|
146
|
+
error: {
|
|
147
|
+
version: 1,
|
|
148
|
+
code: "ADAPTER_FAILED",
|
|
149
|
+
message: "The adapter failed.",
|
|
150
|
+
retryable: false
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
];
|
|
156
|
+
var invalidTurnEventFixtures = [
|
|
157
|
+
{
|
|
158
|
+
name: "invalid payload",
|
|
159
|
+
event: null,
|
|
160
|
+
code: "PROTOCOL_INVALID_PAYLOAD"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "unknown version",
|
|
164
|
+
event: { ...base, eventId: "future", version: 2, sequence: 0, event: "client.turn.submit", payload: { input: "hello" } },
|
|
165
|
+
code: "PROTOCOL_UNSUPPORTED_VERSION"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "unknown event",
|
|
169
|
+
event: { ...base, eventId: "unknown", sequence: 0, event: "server.turn.future", payload: {} },
|
|
170
|
+
code: "PROTOCOL_UNKNOWN_EVENT"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "blank input",
|
|
174
|
+
event: { ...base, eventId: "blank", sequence: 0, event: "client.turn.submit", payload: { input: " " } },
|
|
175
|
+
code: "PROTOCOL_INVALID_PAYLOAD"
|
|
176
|
+
}
|
|
177
|
+
];
|
|
178
|
+
var validChoiceListFrame = {
|
|
179
|
+
protocol: "agentskit.chat.component",
|
|
180
|
+
version: 1,
|
|
181
|
+
type: "render",
|
|
182
|
+
componentKey: "choice-list",
|
|
183
|
+
instanceId: "destination-choice",
|
|
184
|
+
props: {
|
|
185
|
+
prompt: "Where should we go?",
|
|
186
|
+
choices: [
|
|
187
|
+
{ id: "docs", label: "Documentation", description: "Read the component guide." },
|
|
188
|
+
{ id: "demo", label: "Demo" }
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
fallback: { kind: "choice-list", summary: "Choose Documentation or Demo." }
|
|
192
|
+
};
|
|
193
|
+
var catalogFrame = (componentKey, props, summary) => ({
|
|
194
|
+
protocol: "agentskit.chat.component",
|
|
195
|
+
version: 1,
|
|
196
|
+
type: "render",
|
|
197
|
+
componentKey,
|
|
198
|
+
instanceId: `${componentKey}-fixture`,
|
|
199
|
+
props,
|
|
200
|
+
fallback: { kind: componentKey, summary }
|
|
201
|
+
});
|
|
202
|
+
var standardComponentFrameFixtures = [
|
|
203
|
+
catalogFrame("button-group", { label: "Actions", buttons: [{ id: "save", label: "Save" }] }, "Choose Save."),
|
|
204
|
+
validChoiceListFrame,
|
|
205
|
+
catalogFrame("form", { title: "Contact", fields: [{ id: "email", label: "Email", type: "email", required: true }], submitLabel: "Send" }, "Contact form."),
|
|
206
|
+
catalogFrame("confirmation", { title: "Delete?", message: "This cannot be undone.", confirmLabel: "Delete", cancelLabel: "Cancel" }, "Confirm deletion."),
|
|
207
|
+
catalogFrame("progress", { label: "Upload", value: 42, status: "Uploading" }, "Upload is 42% complete."),
|
|
208
|
+
catalogFrame("source-list", { label: "Sources", sources: [{ id: "docs", title: "Documentation", url: "/docs" }] }, "Sources: Documentation."),
|
|
209
|
+
catalogFrame("link-card", { title: "Guide", description: "Read the guide.", href: "https://example.com/guide" }, "Guide link."),
|
|
210
|
+
catalogFrame("error-notice", { title: "Failed", message: "Try again.", code: "E_TEST", retryLabel: "Retry" }, "Failed: Try again."),
|
|
211
|
+
catalogFrame("tool-call", { name: "Search", status: "complete", arguments: { q: "AgentsKit" }, result: "Found" }, "Search completed."),
|
|
212
|
+
catalogFrame("approval-request", { title: "Approve send?", description: "Send the email.", approveLabel: "Approve", denyLabel: "Deny" }, "Approval required."),
|
|
213
|
+
catalogFrame("table", { caption: "Users", columns: [{ key: "name", label: "Name" }], rows: [{ name: "Ada" }] }, "Users table with one row."),
|
|
214
|
+
catalogFrame("file-attachment", { name: "report.pdf", mimeType: "application/pdf", sizeBytes: 1024, url: "/report.pdf" }, "Attached report.pdf.")
|
|
215
|
+
];
|
|
216
|
+
var invalidChoiceListPropsFrame = {
|
|
217
|
+
...validChoiceListFrame,
|
|
218
|
+
props: { prompt: "", choices: [] }
|
|
219
|
+
};
|
|
220
|
+
var unknownComponentFrame = {
|
|
221
|
+
...validChoiceListFrame,
|
|
222
|
+
componentKey: "future-component"
|
|
223
|
+
};
|
|
224
|
+
var invalidComponentFrameFixtures = [
|
|
225
|
+
{ name: "invalid frame", frame: null, code: "COMPONENT_INVALID_FRAME" },
|
|
226
|
+
{ name: "unsupported version", frame: { ...validChoiceListFrame, version: 2 }, code: "COMPONENT_UNSUPPORTED_VERSION" },
|
|
227
|
+
{ name: "unknown type", frame: { ...validChoiceListFrame, type: "future" }, code: "COMPONENT_UNKNOWN_TYPE" }
|
|
228
|
+
];
|
|
229
|
+
var persistentSessionFixture = {
|
|
230
|
+
protocol: "agentskit.chat.session",
|
|
231
|
+
version: 1,
|
|
232
|
+
sessionId: "cross-client",
|
|
233
|
+
definitionId: "protocol-session",
|
|
234
|
+
definitionRevision: 1,
|
|
235
|
+
updatedAt: "2026-07-11T00:00:00.000Z",
|
|
236
|
+
cursor: 1,
|
|
237
|
+
conversation: { state: "complete", decisions: [] },
|
|
238
|
+
confirmations: []
|
|
239
|
+
};
|
|
240
|
+
var deterministicContentHashFixture = "sha256:d1b98e69dcb00985dc5fdad4a8475f926168e6485e85716758ad5e0f35cd4906";
|
|
241
|
+
var deterministicSiteConfigFixture = {
|
|
242
|
+
protocol: "agentskit.chat.site",
|
|
243
|
+
version: 1,
|
|
244
|
+
siteId: "agentskit-docs",
|
|
245
|
+
artifact: { href: "/agentskit-chat.knowledge.json", contentHash: deterministicContentHashFixture },
|
|
246
|
+
fallback: { mode: "backend" }
|
|
247
|
+
};
|
|
248
|
+
var localKnowledgeArtifactFixture = {
|
|
249
|
+
protocol: "agentskit.chat.knowledge",
|
|
250
|
+
version: 1,
|
|
251
|
+
artifactId: "agentskit-docs-2026-07-13",
|
|
252
|
+
siteId: "agentskit-docs",
|
|
253
|
+
contentHash: deterministicContentHashFixture,
|
|
254
|
+
generatedAt: "2026-07-13T00:00:00.000Z",
|
|
255
|
+
expiresAt: "2026-07-14T00:00:00.000Z",
|
|
256
|
+
entries: [
|
|
257
|
+
{
|
|
258
|
+
id: "install-cli",
|
|
259
|
+
kind: "command",
|
|
260
|
+
label: "Install the CLI",
|
|
261
|
+
match: { type: "exact", values: ["install cli", "npm install agentskit"] },
|
|
262
|
+
answer: { markdown: "Run `npm install agentskit`.", citations: [{ id: "quickstart", title: "Quickstart", href: "/docs/quickstart" }] }
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "docs-agentskit",
|
|
266
|
+
kind: "document",
|
|
267
|
+
label: "AgentsKit documentation",
|
|
268
|
+
match: { type: "exact", values: ["docs", "agentskit docs"] },
|
|
269
|
+
answer: { markdown: "Open the AgentsKit documentation.", citations: [{ id: "agentskit-docs", title: "AgentsKit docs", href: "https://agentskit.io/docs" }] }
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: "docs-registry",
|
|
273
|
+
kind: "document",
|
|
274
|
+
label: "Registry documentation",
|
|
275
|
+
match: { type: "exact", values: ["docs", "registry docs"] },
|
|
276
|
+
answer: { markdown: "Open the Registry documentation.", citations: [{ id: "registry-docs", title: "Registry docs", href: "https://registry.agentskit.io" }] }
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
};
|
|
280
|
+
var staleLocalKnowledgeArtifactFixture = {
|
|
281
|
+
...localKnowledgeArtifactFixture,
|
|
282
|
+
artifactId: "agentskit-docs-stale",
|
|
283
|
+
contentHash: "sha256:c48a310e9497d1588e408bf7eb72ca64c04f25431ef8d17cd351b1d3bab3a3e9",
|
|
284
|
+
generatedAt: "2026-07-11T00:00:00.000Z",
|
|
285
|
+
expiresAt: "2026-07-12T00:00:00.000Z"
|
|
286
|
+
};
|
|
287
|
+
var deterministicAnswerFixtures = {
|
|
288
|
+
local: {
|
|
289
|
+
protocol: "agentskit.chat.answer",
|
|
290
|
+
version: 1,
|
|
291
|
+
outcome: "answer",
|
|
292
|
+
query: "Install CLI",
|
|
293
|
+
normalizedQuery: "install cli",
|
|
294
|
+
answer: localKnowledgeArtifactFixture.entries[0].answer,
|
|
295
|
+
provenance: { source: "local", artifactId: localKnowledgeArtifactFixture.artifactId, contentHash: deterministicContentHashFixture, entryIds: ["install-cli"] },
|
|
296
|
+
confidence: { level: "high", basis: "exact" }
|
|
297
|
+
},
|
|
298
|
+
backend: {
|
|
299
|
+
protocol: "agentskit.chat.answer",
|
|
300
|
+
version: 1,
|
|
301
|
+
outcome: "answer",
|
|
302
|
+
query: "Compare runtimes",
|
|
303
|
+
normalizedQuery: "compare runtimes",
|
|
304
|
+
answer: { markdown: "The backend can answer open-ended comparisons.", citations: [] },
|
|
305
|
+
provenance: { source: "backend", provider: "ask", model: "configured-by-host" },
|
|
306
|
+
confidence: { level: "high", basis: "backend" }
|
|
307
|
+
},
|
|
308
|
+
ambiguous: {
|
|
309
|
+
protocol: "agentskit.chat.answer",
|
|
310
|
+
version: 1,
|
|
311
|
+
outcome: "choices",
|
|
312
|
+
query: "docs",
|
|
313
|
+
normalizedQuery: "docs",
|
|
314
|
+
message: "More than one exact local answer matches. Choose one to continue.",
|
|
315
|
+
suggestions: [
|
|
316
|
+
{ id: "docs-agentskit", label: "AgentsKit documentation", value: "agentskit docs" },
|
|
317
|
+
{ id: "docs-registry", label: "Registry documentation", value: "registry docs" }
|
|
318
|
+
],
|
|
319
|
+
provenance: { source: "local", artifactId: localKnowledgeArtifactFixture.artifactId, contentHash: deterministicContentHashFixture, entryIds: ["docs-agentskit", "docs-registry"] },
|
|
320
|
+
confidence: { level: "medium", basis: "ambiguous" }
|
|
321
|
+
},
|
|
322
|
+
miss: {
|
|
323
|
+
protocol: "agentskit.chat.answer",
|
|
324
|
+
version: 1,
|
|
325
|
+
outcome: "escalation",
|
|
326
|
+
query: "Why?",
|
|
327
|
+
normalizedQuery: "why?",
|
|
328
|
+
message: "No exact local answer was found. A backend answer is required.",
|
|
329
|
+
reason: "miss",
|
|
330
|
+
confidence: { level: "low", basis: "miss" }
|
|
331
|
+
},
|
|
332
|
+
stale: {
|
|
333
|
+
protocol: "agentskit.chat.answer",
|
|
334
|
+
version: 1,
|
|
335
|
+
outcome: "escalation",
|
|
336
|
+
query: "install cli",
|
|
337
|
+
normalizedQuery: "install cli",
|
|
338
|
+
message: "Local knowledge is stale. A backend answer is required.",
|
|
339
|
+
reason: "stale",
|
|
340
|
+
confidence: { level: "low", basis: "stale" }
|
|
341
|
+
},
|
|
342
|
+
corrupt: {
|
|
343
|
+
protocol: "agentskit.chat.answer",
|
|
344
|
+
version: 1,
|
|
345
|
+
outcome: "escalation",
|
|
346
|
+
query: "install cli",
|
|
347
|
+
normalizedQuery: "install cli",
|
|
348
|
+
message: "Local knowledge is corrupt. A backend answer is required.",
|
|
349
|
+
reason: "corrupt",
|
|
350
|
+
confidence: { level: "low", basis: "corrupt" }
|
|
351
|
+
},
|
|
352
|
+
offline: {
|
|
353
|
+
protocol: "agentskit.chat.answer",
|
|
354
|
+
version: 1,
|
|
355
|
+
outcome: "escalation",
|
|
356
|
+
query: "Why?",
|
|
357
|
+
normalizedQuery: "why?",
|
|
358
|
+
message: "This question needs the backend, which is not available.",
|
|
359
|
+
reason: "offline",
|
|
360
|
+
confidence: { level: "low", basis: "offline" }
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
var invalidDeterministicArtifactFixtures = [
|
|
364
|
+
{ name: "unsupported version", artifact: { ...localKnowledgeArtifactFixture, version: 2 }, code: "DETERMINISTIC_UNSUPPORTED_VERSION" },
|
|
365
|
+
{ name: "corrupt artifact", artifact: { ...localKnowledgeArtifactFixture, entries: [{ unexpected: true }] }, code: "DETERMINISTIC_INVALID_PAYLOAD" },
|
|
366
|
+
{ name: "hash mismatch", artifact: localKnowledgeArtifactFixture, expectedContentHash: `sha256:${"b".repeat(64)}`, code: "DETERMINISTIC_HASH_MISMATCH" }
|
|
367
|
+
];
|
|
368
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
369
|
+
0 && (module.exports = {
|
|
370
|
+
deterministicAnswerFixtures,
|
|
371
|
+
deterministicContentHashFixture,
|
|
372
|
+
deterministicSiteConfigFixture,
|
|
373
|
+
invalidChoiceListPropsFrame,
|
|
374
|
+
invalidComponentFrameFixtures,
|
|
375
|
+
invalidDeterministicArtifactFixtures,
|
|
376
|
+
invalidTurnEventFixtures,
|
|
377
|
+
localKnowledgeArtifactFixture,
|
|
378
|
+
persistentSessionFixture,
|
|
379
|
+
staleLocalKnowledgeArtifactFixture,
|
|
380
|
+
standardComponentFrameFixtures,
|
|
381
|
+
unknownComponentFrame,
|
|
382
|
+
validChoiceListFrame,
|
|
383
|
+
validTurnEventFixtures
|
|
384
|
+
});
|