@hosty-sdk/app 0.48.0 → 0.49.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/dist/agent-client.d.ts +26 -2
- package/dist/agent-client.js +149 -16
- package/dist/agent-schemas.js +13 -1
- package/dist/agent.d.ts +17 -0
- package/dist/agent.js +1 -0
- package/package.json +1 -1
- package/schemas/agent-event-v1.schema.json +188 -0
- package/schemas/agent-v1.openapi.json +353 -0
package/dist/agent-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentAttachment, type AgentAttachmentChunk, type AgentAttachmentChunkReceipt, type AgentAuthorizer, type AgentAuthorizationRequest, type AgentCancelInput, type AgentCapabilities, type AgentConfigurationCreate, type AgentConnectionPage, type AgentConnectionUsage, type AgentControlReceipt, type AgentEvent, type AgentModelCatalog, type AgentOperation, type AgentPreparedRequest, type AgentProviderRef, type AgentResponseInput, type AgentRunControlInput, type AgentRunInput, type AgentRunSnapshot, type AgentSession, type AgentSessionCreate, type AgentSessionPage, type AgentWatchItem } from "./agent.js";
|
|
1
|
+
import { type AgentAttachment, type AgentAttachmentChunk, type AgentAttachmentChunkReceipt, type AgentAuthorizer, type AgentAuthorizationRequest, type AgentCancelInput, type AgentCapabilities, type AgentConfigurationCreate, type AgentConnectionPage, type AgentConnectionUsage, type AgentControlReceipt, type AgentEvent, type AgentHistoryObservation, type AgentModelCatalog, type AgentOperation, type AgentPreparedRequest, type AgentProviderRef, type AgentResponseInput, type AgentRunControlInput, type AgentRunInput, type AgentRunSnapshot, type AgentSession, type AgentSessionCreate, type AgentSessionPage, type AgentWatchItem } from "./agent.js";
|
|
2
2
|
export type AgentClientOptions = {
|
|
3
3
|
provider: AgentProviderRef;
|
|
4
4
|
authorize: AgentAuthorizer;
|
|
@@ -63,6 +63,7 @@ export declare class AgentClient {
|
|
|
63
63
|
/** One authenticated stream; watchRun adds reconnect and atomic snapshot recovery. */
|
|
64
64
|
events(runId: string, options?: AgentRequestOptions & {
|
|
65
65
|
cursor?: string;
|
|
66
|
+
onRenewal?: () => void;
|
|
66
67
|
}): AsyncGenerator<{
|
|
67
68
|
event: AgentEvent;
|
|
68
69
|
cursor: string;
|
|
@@ -70,8 +71,31 @@ export declare class AgentClient {
|
|
|
70
71
|
/** Snapshot items replace consumer state; event items are new, deduplicated persisted events. */
|
|
71
72
|
watchRun(runId: string, options?: AgentWatchOptions): AsyncGenerator<AgentWatchItem>;
|
|
72
73
|
}
|
|
74
|
+
export type AgentHistoryOptions = {
|
|
75
|
+
url: string;
|
|
76
|
+
token: string;
|
|
77
|
+
provider?: AgentProviderRef;
|
|
78
|
+
cursor?: string;
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
fetch?: typeof fetch;
|
|
81
|
+
onOpen?: () => void | Promise<void>;
|
|
82
|
+
/** Silence between byte reads, including transport heartbeats, while the consumer is ready. */
|
|
83
|
+
idleTimeoutMs?: number;
|
|
84
|
+
};
|
|
85
|
+
export type AgentHistoryPage = {
|
|
86
|
+
observations: AgentHistoryObservation[];
|
|
87
|
+
through: string;
|
|
88
|
+
nextCursor: string | null;
|
|
89
|
+
};
|
|
90
|
+
/** Open one read-only installation subscription. Resume from the last durably applied position. */
|
|
91
|
+
export declare function watchAgentHistory(options: AgentHistoryOptions): AsyncGenerator<AgentHistoryObservation>;
|
|
92
|
+
/** Read a bounded page at a stable installation feed position. Pass through to subsequent pages. */
|
|
93
|
+
export declare function readAgentHistoryPage(options: AgentHistoryOptions & {
|
|
94
|
+
through?: string;
|
|
95
|
+
limit?: number;
|
|
96
|
+
}): Promise<AgentHistoryPage>;
|
|
73
97
|
/** Streaming decoder handles split UTF-8, CR/LF framing, multi-line data and comment heartbeats. */
|
|
74
|
-
export declare function parseAgentSse(response: Pick<Response, "body">, maxBytes?: number): AsyncGenerator<{
|
|
98
|
+
export declare function parseAgentSse(response: Pick<Response, "body">, maxBytes?: number, idleMs?: number): AsyncGenerator<{
|
|
75
99
|
id: string;
|
|
76
100
|
event: string;
|
|
77
101
|
data: string;
|
package/dist/agent-client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { AgentApiError, } from "./agent.js";
|
|
3
|
-
import { validateAgentEvent, validateAgentRunSnapshot, validateAgentRequest, validateAgentSession, validateAgentCapabilities, validateAgentControlReceipt } from "./agent-server.js";
|
|
3
|
+
import { agentReplayCursor, validateAgentEvent, validateAgentRunSnapshot, validateAgentRequest, validateAgentSession, validateAgentCapabilities, validateAgentControlReceipt } from "./agent-server.js";
|
|
4
4
|
const MAX_BYTES = 1024 * 1024;
|
|
5
5
|
const sha = (body) => createHash("sha256").update(body, "utf8").digest("hex");
|
|
6
6
|
const segment = (id) => {
|
|
@@ -200,6 +200,8 @@ export class AgentClient {
|
|
|
200
200
|
if (!response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase().includes("text/event-stream"))
|
|
201
201
|
throw new AgentApiError("response_invalid", "The provider did not return an event stream.", 502);
|
|
202
202
|
for await (const frame of parseAgentSse(response, MAX_BYTES)) {
|
|
203
|
+
if (frame.event === "renew" && frame.data === "{}")
|
|
204
|
+
options.onRenewal?.();
|
|
203
205
|
if (frame.event !== "agent")
|
|
204
206
|
continue;
|
|
205
207
|
let event;
|
|
@@ -221,7 +223,8 @@ export class AgentClient {
|
|
|
221
223
|
async *watchRun(runId, options = {}) {
|
|
222
224
|
let snapshot = await this.run(runId, options);
|
|
223
225
|
yield { kind: "snapshot", snapshot };
|
|
224
|
-
let cursor = snapshot.cursor, sequence = BigInt(snapshot.lastSequence)
|
|
226
|
+
let cursor = snapshot.cursor, sequence = BigInt(snapshot.lastSequence);
|
|
227
|
+
const generation = snapshot.generation;
|
|
225
228
|
let retries = 0;
|
|
226
229
|
const max = options.maxReconnects ?? 5;
|
|
227
230
|
if (!Number.isSafeInteger(max) || max < 0 || max > 100 || options.reconnectDelayMs !== undefined && (!Number.isSafeInteger(options.reconnectDelayMs) || options.reconnectDelayMs < 0 || options.reconnectDelayMs > 60000))
|
|
@@ -230,7 +233,8 @@ export class AgentClient {
|
|
|
230
233
|
if (snapshot.stopConfirmed && ["succeeded", "failed", "cancelled"].includes(snapshot.state))
|
|
231
234
|
return;
|
|
232
235
|
try {
|
|
233
|
-
|
|
236
|
+
let renewed = false;
|
|
237
|
+
for await (const item of this.events(runId, { signal: options.signal, cursor, onRenewal: () => { renewed = true; } })) {
|
|
234
238
|
if (item.event.generation !== generation)
|
|
235
239
|
throw new AgentApiError("event_generation_changed", "A run's durable generation changed.", 409);
|
|
236
240
|
const next = BigInt(item.event.sequence);
|
|
@@ -247,31 +251,147 @@ export class AgentClient {
|
|
|
247
251
|
if (snapshot.stopConfirmed && ["succeeded", "failed", "cancelled"].includes(snapshot.state))
|
|
248
252
|
return;
|
|
249
253
|
}
|
|
250
|
-
|
|
251
|
-
|
|
254
|
+
// Older providers may change freshness without advancing the event sequence.
|
|
255
|
+
if (!renewed)
|
|
256
|
+
throw new AgentApiError("stream_closed", "The provider closed its active stream.", 503, true);
|
|
257
|
+
retries = 0;
|
|
252
258
|
}
|
|
253
259
|
catch (error) {
|
|
254
260
|
if (options.signal?.aborted)
|
|
255
261
|
throw options.signal.reason;
|
|
256
|
-
|
|
262
|
+
const reload = error instanceof AgentApiError && (error.status === 410 || error.code === "event_gap" || error.code === "stream_closed");
|
|
263
|
+
if (!reload && error instanceof AgentApiError && !error.retryable && ![429, 503, 504].includes(error.status))
|
|
257
264
|
throw error;
|
|
258
|
-
if (
|
|
265
|
+
if (++retries > max)
|
|
259
266
|
throw error;
|
|
267
|
+
if (reload) {
|
|
268
|
+
snapshot = await this.run(runId, options);
|
|
269
|
+
if (snapshot.generation !== generation)
|
|
270
|
+
throw new AgentApiError("event_generation_changed", "A run's durable generation changed.", 409);
|
|
271
|
+
cursor = snapshot.cursor;
|
|
272
|
+
sequence = BigInt(snapshot.lastSequence);
|
|
273
|
+
yield { kind: "snapshot", snapshot };
|
|
274
|
+
}
|
|
260
275
|
}
|
|
261
276
|
options.signal?.throwIfAborted();
|
|
262
|
-
snapshot = await this.run(runId, options);
|
|
263
|
-
if (snapshot.generation !== generation)
|
|
264
|
-
throw new AgentApiError("event_generation_changed", "A run's durable generation changed.", 409);
|
|
265
|
-
cursor = snapshot.cursor;
|
|
266
|
-
sequence = BigInt(snapshot.lastSequence);
|
|
267
|
-
generation = snapshot.generation;
|
|
268
|
-
yield { kind: "snapshot", snapshot };
|
|
269
277
|
if (!snapshot.stopConfirmed)
|
|
270
278
|
await pause(options.reconnectDelayMs ?? 250, options.signal);
|
|
271
279
|
}
|
|
272
280
|
options.signal?.throwIfAborted();
|
|
273
281
|
}
|
|
274
282
|
}
|
|
283
|
+
async function historyResponse(options, accept, page) {
|
|
284
|
+
const url = new URL(options.url);
|
|
285
|
+
if (!["https:", "http:"].includes(url.protocol) || url.username || url.password || url.search || url.hash || !options.token)
|
|
286
|
+
throw new AgentApiError("authorization_invalid", "Invalid installation history binding.", 401);
|
|
287
|
+
const after = agentReplayCursor(options.cursor);
|
|
288
|
+
if (after)
|
|
289
|
+
url.searchParams.set("after", after);
|
|
290
|
+
if (page?.through)
|
|
291
|
+
url.searchParams.set("through", agentReplayCursor(page.through));
|
|
292
|
+
if (page?.limit !== undefined) {
|
|
293
|
+
if (!Number.isInteger(page.limit) || page.limit < 1 || page.limit > 100)
|
|
294
|
+
throw new AgentApiError("invalid_input", "Page size must be between 1 and 100.", 400);
|
|
295
|
+
url.searchParams.set("limit", String(page.limit));
|
|
296
|
+
}
|
|
297
|
+
const response = await (options.fetch ?? globalThis.fetch)(url, {
|
|
298
|
+
headers: { accept, authorization: `Bearer ${options.token}` },
|
|
299
|
+
signal: options.signal, redirect: "error", cache: "no-store",
|
|
300
|
+
});
|
|
301
|
+
if (!response.ok) {
|
|
302
|
+
const raw = await boundedText(response, MAX_BYTES);
|
|
303
|
+
let detail;
|
|
304
|
+
try {
|
|
305
|
+
detail = JSON.parse(raw)?.error;
|
|
306
|
+
}
|
|
307
|
+
catch { /* Older providers may return a plain 404. */ }
|
|
308
|
+
throw new AgentApiError(detail?.code ?? "provider_failed", detail?.message ?? `History request failed (${response.status}).`, response.status);
|
|
309
|
+
}
|
|
310
|
+
if (response.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() !== accept) {
|
|
311
|
+
await response.body?.cancel();
|
|
312
|
+
throw new AgentApiError("response_invalid", "The provider returned an unexpected history representation.", 502);
|
|
313
|
+
}
|
|
314
|
+
return response;
|
|
315
|
+
}
|
|
316
|
+
function historyObject(value) {
|
|
317
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
318
|
+
}
|
|
319
|
+
function historyObservation(value, cursor, provider) {
|
|
320
|
+
if (!historyObject(value) || typeof cursor !== "string" || !agentReplayCursor(cursor))
|
|
321
|
+
throw new AgentApiError("event_invalid", "The history observation is missing its cursor.", 502);
|
|
322
|
+
const { sessionId, runId, generation, userId, principalId } = value;
|
|
323
|
+
const identity = (id) => typeof id === "string" && id.length > 0 && id.length <= 512;
|
|
324
|
+
if (!identity(sessionId) || !identity(runId) || !identity(generation) || !identity(userId) || !identity(principalId) || !historyObject(value.item))
|
|
325
|
+
throw new AgentApiError("event_invalid", "The history observation is missing its identity.", 502);
|
|
326
|
+
const raw = value.item;
|
|
327
|
+
let item;
|
|
328
|
+
let snapshot;
|
|
329
|
+
if (raw.kind === "event") {
|
|
330
|
+
validateAgentEvent(raw.event);
|
|
331
|
+
if (typeof raw.cursor !== "string" || !agentReplayCursor(raw.cursor) || raw.event.runId !== runId || raw.event.generation !== generation)
|
|
332
|
+
throw new AgentApiError("event_invalid", "History event identity changed.", 502);
|
|
333
|
+
if (raw.event.type === "run.updated")
|
|
334
|
+
snapshot = raw.event.data.snapshot;
|
|
335
|
+
item = { kind: "event", event: raw.event, cursor: raw.cursor };
|
|
336
|
+
}
|
|
337
|
+
else if (raw.kind === "snapshot") {
|
|
338
|
+
validateAgentRunSnapshot(raw.snapshot);
|
|
339
|
+
item = { kind: "snapshot", snapshot: raw.snapshot };
|
|
340
|
+
snapshot = raw.snapshot;
|
|
341
|
+
}
|
|
342
|
+
else
|
|
343
|
+
throw new AgentApiError("event_invalid", "Unknown history observation.", 502);
|
|
344
|
+
if (snapshot && (snapshot.ref.id !== runId || snapshot.sessionId !== sessionId || snapshot.generation !== generation
|
|
345
|
+
|| provider && !sameProvider(provider, snapshot.ref.provider)))
|
|
346
|
+
throw new AgentApiError("event_invalid", "History snapshot identity changed.", 502);
|
|
347
|
+
return { sessionId, runId, generation, userId, principalId, item, cursor };
|
|
348
|
+
}
|
|
349
|
+
/** Open one read-only installation subscription. Resume from the last durably applied position. */
|
|
350
|
+
export async function* watchAgentHistory(options) {
|
|
351
|
+
const idleMs = options.idleTimeoutMs ?? 60000;
|
|
352
|
+
if (!Number.isSafeInteger(idleMs) || idleMs < 1 || idleMs > 2147483647)
|
|
353
|
+
throw new AgentApiError("invalid_input", "Invalid history heartbeat timeout.", 400);
|
|
354
|
+
const response = await historyResponse(options, "text/event-stream");
|
|
355
|
+
try {
|
|
356
|
+
await options.onOpen?.();
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
await response.body?.cancel().catch(() => { });
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
for await (const frame of parseAgentSse(response, MAX_BYTES + 32768, idleMs)) {
|
|
363
|
+
if (frame.event !== "observation")
|
|
364
|
+
continue;
|
|
365
|
+
let value;
|
|
366
|
+
try {
|
|
367
|
+
value = JSON.parse(frame.data);
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
throw new AgentApiError("event_invalid", "Invalid installation history JSON.", 502);
|
|
371
|
+
}
|
|
372
|
+
yield historyObservation(value, frame.id, options.provider);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/** Read a bounded page at a stable installation feed position. Pass through to subsequent pages. */
|
|
376
|
+
export async function readAgentHistoryPage(options) {
|
|
377
|
+
const response = await historyResponse(options, "application/json", options);
|
|
378
|
+
const raw = await boundedText(response, 2 * MAX_BYTES + 32768);
|
|
379
|
+
let page;
|
|
380
|
+
try {
|
|
381
|
+
page = JSON.parse(raw);
|
|
382
|
+
}
|
|
383
|
+
catch {
|
|
384
|
+
throw new AgentApiError("response_invalid", "Invalid installation history page JSON.", 502);
|
|
385
|
+
}
|
|
386
|
+
if (!historyObject(page) || typeof page.through !== "string" || !agentReplayCursor(page.through)
|
|
387
|
+
|| options.through && page.through !== options.through || !Array.isArray(page.observations) || page.observations.length > (options.limit ?? 100)
|
|
388
|
+
|| !(page.nextCursor === null || typeof page.nextCursor === "string" && agentReplayCursor(page.nextCursor)))
|
|
389
|
+
throw new AgentApiError("response_invalid", "Invalid installation history page.", 502);
|
|
390
|
+
const observations = page.observations.map(value => historyObservation(value, value?.cursor, options.provider));
|
|
391
|
+
if (page.nextCursor !== null && (!observations.length || page.nextCursor !== observations.at(-1)?.cursor || page.nextCursor === options.cursor))
|
|
392
|
+
throw new AgentApiError("response_invalid", "The history page did not advance.", 502);
|
|
393
|
+
return { observations, through: page.through, nextCursor: page.nextCursor };
|
|
394
|
+
}
|
|
275
395
|
function queryString(value) {
|
|
276
396
|
const query = new URLSearchParams();
|
|
277
397
|
for (const [key, item] of Object.entries(value))
|
|
@@ -302,8 +422,21 @@ async function boundedText(response, max) {
|
|
|
302
422
|
}
|
|
303
423
|
return Buffer.concat(chunks).toString("utf8");
|
|
304
424
|
}
|
|
425
|
+
async function readSseChunk(reader, idleMs) {
|
|
426
|
+
if (idleMs === undefined)
|
|
427
|
+
return reader.read();
|
|
428
|
+
let timer;
|
|
429
|
+
try {
|
|
430
|
+
return await Promise.race([reader.read(), new Promise((_, reject) => {
|
|
431
|
+
timer = setTimeout(() => reject(new AgentApiError("history_stream_idle", "Provider history heartbeats stopped.", 504, true)), idleMs);
|
|
432
|
+
})]);
|
|
433
|
+
}
|
|
434
|
+
finally {
|
|
435
|
+
clearTimeout(timer);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
305
438
|
/** Streaming decoder handles split UTF-8, CR/LF framing, multi-line data and comment heartbeats. */
|
|
306
|
-
export async function* parseAgentSse(response, maxBytes = MAX_BYTES) {
|
|
439
|
+
export async function* parseAgentSse(response, maxBytes = MAX_BYTES, idleMs) {
|
|
307
440
|
const reader = response.body?.getReader();
|
|
308
441
|
if (!reader)
|
|
309
442
|
throw new AgentApiError("event_invalid", "The event stream is empty.", 502);
|
|
@@ -311,7 +444,7 @@ export async function* parseAgentSse(response, maxBytes = MAX_BYTES) {
|
|
|
311
444
|
let buffer = "", id = "", event = "message", data = [], bytes = 0;
|
|
312
445
|
try {
|
|
313
446
|
while (true) {
|
|
314
|
-
const chunk = await reader
|
|
447
|
+
const chunk = await readSseChunk(reader, idleMs);
|
|
315
448
|
buffer += decoder.decode(chunk.value, { stream: !chunk.done });
|
|
316
449
|
let match;
|
|
317
450
|
while ((match = /\r\n|\r|\n/.exec(buffer))) {
|
package/dist/agent-schemas.js
CHANGED
|
@@ -16,6 +16,11 @@ const refProperties = { appId: text(), installationId: text(), key: text() };
|
|
|
16
16
|
const baseControl = { requestId: uuid, expectedGeneration: uuid, expectedRevision: revision };
|
|
17
17
|
const terminalStates = ["queued", "running", "waiting_for_input", "succeeded", "failed", "cancelled", "unknown"];
|
|
18
18
|
const phases = ["preparing", "executing", "waiting", "finalizing", "cancelling", "parked", "interrupted", "terminal"];
|
|
19
|
+
const historyObservation = {
|
|
20
|
+
sessionId: id, runId: id, generation: uuid, principalId: text(512), userId: text(512),
|
|
21
|
+
item: { oneOf: [object({ kind: { const: "snapshot" }, snapshot: ref("RunSnapshot") }),
|
|
22
|
+
object({ kind: { const: "event" }, event: ref("Event"), cursor: text(8192) })] },
|
|
23
|
+
};
|
|
19
24
|
export const AGENT_SCHEMAS = {
|
|
20
25
|
ProviderRef: object(refProperties),
|
|
21
26
|
QualifiedRef: object({ provider: ref("ProviderRef"), id }),
|
|
@@ -71,6 +76,9 @@ export const AGENT_SCHEMAS = {
|
|
|
71
76
|
description: "Latest root context.updated observation within the snapshot watermark; its canonical positive sequence is at most lastSequence. Null usage explicitly clears the observation. Absence means no retained observation. Payloads share the bounded snapshot/event JSON byte allowance." },
|
|
72
77
|
decisions: list(object({ decision: ref("PendingDecision"), state: { enum: ["pending", "resolved", "superseded", "unknown"] }, response: ref("DecisionResponse") }, ["decision", "state"]), 256),
|
|
73
78
|
pendingContinuations: list(object({ requestId: uuid, run: ref("QualifiedRef"), state: { enum: ["pending", "awaiting_authorization", "admitted", "superseded"] } }), 256) }, ["ref", "sessionId", "generation", "revision", "state", "phase", "stopConfirmed", "freshness", "observedAt", "configurationRevision", "lastSequence", "cursor", "pending", "effects"], true),
|
|
79
|
+
HistoryObservation: object(historyObservation),
|
|
80
|
+
HistoryPage: object({ observations: list(object({ ...historyObservation, cursor: text(8192) }), 100),
|
|
81
|
+
through: text(8192), nextCursor: { type: ["string", "null"] } }),
|
|
74
82
|
Session: object({ ref: ref("QualifiedRef"), revision, configurationRevision: revision, configurationDigest: digest,
|
|
75
83
|
nativeState: { enum: ["not_created", "available", "missing", "unavailable", "unknown"] }, activeRun: { oneOf: [ref("QualifiedRef"), { type: "null" }] },
|
|
76
84
|
resolvedSkills: list(object({ skillId: digest, digest }), 202), configuration: ref("Configuration"), correlation: object({ conversation: ref("QualifiedRef"), task: ref("QualifiedRef") }, []) }, ["ref", "revision", "configurationRevision", "configurationDigest", "nativeState", "activeRun", "resolvedSkills"], true),
|
|
@@ -109,6 +117,10 @@ function operation(operationId, response, input, pathParameters = [], statuses =
|
|
|
109
117
|
export const AGENT_OPENAPI = {
|
|
110
118
|
openapi: "3.1.0", info: { title: "Hosty Agent Execution API", version: "1.0.0", description: "Independent provider execution. Paths are relative to the current Core-declared interface base. Exact UTF-8 command bytes and stable mutation UUIDs are retained across retries. No Harness dependency or raw native session IDs." },
|
|
111
119
|
paths: {
|
|
120
|
+
"/history/events": { get: { operationId: "history.events", security: [{ installationHistory: [] }],
|
|
121
|
+
parameters: [{ name: "after", in: "query", schema: text(8192) }, { name: "through", in: "query", schema: text(8192) }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }],
|
|
122
|
+
description: "Resumable, read-only installation history. Frames use event: observation with an opaque installation feed position in id. Commit each observation before saving this position.",
|
|
123
|
+
responses: { ...errors, "200": { description: "History for the authenticated consumer installation.", content: { "text/event-stream": { schema: { type: "string" }, "x-event-schema": ref("HistoryObservation") }, "application/json": { schema: ref("HistoryPage") } } } } } },
|
|
112
124
|
"/capabilities": { get: operation("capabilities", "Capabilities") },
|
|
113
125
|
"/connections": { get: operation("connections.list", "ConnectionPage") },
|
|
114
126
|
"/connections/{connectionId}/models": { get: operation("connections.models", "ModelCatalog", undefined, ["connectionId"]) },
|
|
@@ -126,7 +138,7 @@ export const AGENT_OPENAPI = {
|
|
|
126
138
|
"/runs/{runId}/cancel": { post: operation("runs.cancel", "ControlReceipt", "CancelInput", ["runId"], [200, 202]) },
|
|
127
139
|
"/runs/{runId}/controls": { post: { ...operation("runs.control", "ControlReceipt", "ControlInput", ["runId"], [200, 202]), description: "Optional controls require their advertised capabilities. Reconcile input is an attestation, never proof of actual native exit." } },
|
|
128
140
|
"/runs/{runId}/controls/{requestId}": { get: operation("runs.controls.read", "ControlReceipt", undefined, ["runId", "requestId"]) },
|
|
129
|
-
}, components: { securitySchemes: { coreOperation: { type: "http", scheme: "bearer", description: "Fresh Core exact-operation credential, never the caller's service/user token." } }, schemas: AGENT_SCHEMAS },
|
|
141
|
+
}, components: { securitySchemes: { installationHistory: { type: "http", scheme: "bearer", description: "Core-issued installation history credential." }, coreOperation: { type: "http", scheme: "bearer", description: "Fresh Core exact-operation credential, never the caller's service/user token." } }, schemas: AGENT_SCHEMAS },
|
|
130
142
|
};
|
|
131
143
|
function localRefs(value) {
|
|
132
144
|
if (Array.isArray(value))
|
package/dist/agent.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type AgentRunRef = RunRef;
|
|
|
6
6
|
export declare const AGENT_API_VERSION: 1;
|
|
7
7
|
export declare const AGENT_EVENT_VERSION: "agent-event.1";
|
|
8
8
|
export declare const AGENT_CAPABILITIES: {
|
|
9
|
+
readonly installationHistory: "installation-history";
|
|
9
10
|
readonly resume: "session.resume";
|
|
10
11
|
readonly configuration: "configuration.resume-compatible";
|
|
11
12
|
readonly images: "input.images";
|
|
@@ -452,6 +453,16 @@ export type AgentWatchItem = {
|
|
|
452
453
|
event: AgentEvent;
|
|
453
454
|
cursor: string;
|
|
454
455
|
};
|
|
456
|
+
/** One installation feed receipt. Its cursor is independent of the per-run replay position. */
|
|
457
|
+
export type AgentHistoryObservation = {
|
|
458
|
+
sessionId: string;
|
|
459
|
+
runId: string;
|
|
460
|
+
generation: string;
|
|
461
|
+
userId: string;
|
|
462
|
+
principalId: string;
|
|
463
|
+
item: AgentWatchItem;
|
|
464
|
+
cursor: string;
|
|
465
|
+
};
|
|
455
466
|
export type AgentErrorDetail = {
|
|
456
467
|
code: string;
|
|
457
468
|
message: string;
|
|
@@ -499,6 +510,12 @@ export type AgentAuthorizationRequest = {
|
|
|
499
510
|
sessionId?: string;
|
|
500
511
|
runId?: string;
|
|
501
512
|
configurationDigest?: string;
|
|
513
|
+
/** Originating chat on runs.start. The consumer supplies its own app-relative viewer route. */
|
|
514
|
+
conversation?: {
|
|
515
|
+
sessionId: string;
|
|
516
|
+
viewerPath: string;
|
|
517
|
+
title: string;
|
|
518
|
+
};
|
|
502
519
|
ceiling?: {
|
|
503
520
|
mcp?: AgentMcpSelection;
|
|
504
521
|
resources?: AgentResource[];
|
package/dist/agent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const AGENT_API_VERSION = 1;
|
|
2
2
|
export const AGENT_EVENT_VERSION = "agent-event.1";
|
|
3
3
|
export const AGENT_CAPABILITIES = {
|
|
4
|
+
installationHistory: "installation-history",
|
|
4
5
|
resume: "session.resume", configuration: "configuration.resume-compatible", images: "input.images",
|
|
5
6
|
noNativeTools: "native-tools.none", skills: "skills.catalog", exclusiveSkills: "skills.exclusive-selection",
|
|
6
7
|
coreMcp: "mcp.core", externalMcp: "mcp.external", modelChange: "model.change-on-resume",
|
package/package.json
CHANGED
|
@@ -1709,6 +1709,194 @@
|
|
|
1709
1709
|
],
|
|
1710
1710
|
"additionalProperties": true
|
|
1711
1711
|
},
|
|
1712
|
+
"HistoryObservation": {
|
|
1713
|
+
"type": "object",
|
|
1714
|
+
"properties": {
|
|
1715
|
+
"sessionId": {
|
|
1716
|
+
"type": "string",
|
|
1717
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
1718
|
+
},
|
|
1719
|
+
"runId": {
|
|
1720
|
+
"type": "string",
|
|
1721
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
1722
|
+
},
|
|
1723
|
+
"generation": {
|
|
1724
|
+
"type": "string",
|
|
1725
|
+
"format": "uuid"
|
|
1726
|
+
},
|
|
1727
|
+
"principalId": {
|
|
1728
|
+
"type": "string",
|
|
1729
|
+
"minLength": 1,
|
|
1730
|
+
"maxLength": 512
|
|
1731
|
+
},
|
|
1732
|
+
"userId": {
|
|
1733
|
+
"type": "string",
|
|
1734
|
+
"minLength": 1,
|
|
1735
|
+
"maxLength": 512
|
|
1736
|
+
},
|
|
1737
|
+
"item": {
|
|
1738
|
+
"oneOf": [
|
|
1739
|
+
{
|
|
1740
|
+
"type": "object",
|
|
1741
|
+
"properties": {
|
|
1742
|
+
"kind": {
|
|
1743
|
+
"const": "snapshot"
|
|
1744
|
+
},
|
|
1745
|
+
"snapshot": {
|
|
1746
|
+
"$ref": "#/$defs/RunSnapshot"
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
"required": [
|
|
1750
|
+
"kind",
|
|
1751
|
+
"snapshot"
|
|
1752
|
+
],
|
|
1753
|
+
"additionalProperties": false
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
"type": "object",
|
|
1757
|
+
"properties": {
|
|
1758
|
+
"kind": {
|
|
1759
|
+
"const": "event"
|
|
1760
|
+
},
|
|
1761
|
+
"event": {
|
|
1762
|
+
"$ref": "#/$defs/Event"
|
|
1763
|
+
},
|
|
1764
|
+
"cursor": {
|
|
1765
|
+
"type": "string",
|
|
1766
|
+
"minLength": 1,
|
|
1767
|
+
"maxLength": 8192
|
|
1768
|
+
}
|
|
1769
|
+
},
|
|
1770
|
+
"required": [
|
|
1771
|
+
"kind",
|
|
1772
|
+
"event",
|
|
1773
|
+
"cursor"
|
|
1774
|
+
],
|
|
1775
|
+
"additionalProperties": false
|
|
1776
|
+
}
|
|
1777
|
+
]
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
"required": [
|
|
1781
|
+
"sessionId",
|
|
1782
|
+
"runId",
|
|
1783
|
+
"generation",
|
|
1784
|
+
"principalId",
|
|
1785
|
+
"userId",
|
|
1786
|
+
"item"
|
|
1787
|
+
],
|
|
1788
|
+
"additionalProperties": false
|
|
1789
|
+
},
|
|
1790
|
+
"HistoryPage": {
|
|
1791
|
+
"type": "object",
|
|
1792
|
+
"properties": {
|
|
1793
|
+
"observations": {
|
|
1794
|
+
"type": "array",
|
|
1795
|
+
"maxItems": 100,
|
|
1796
|
+
"items": {
|
|
1797
|
+
"type": "object",
|
|
1798
|
+
"properties": {
|
|
1799
|
+
"sessionId": {
|
|
1800
|
+
"type": "string",
|
|
1801
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
1802
|
+
},
|
|
1803
|
+
"runId": {
|
|
1804
|
+
"type": "string",
|
|
1805
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
1806
|
+
},
|
|
1807
|
+
"generation": {
|
|
1808
|
+
"type": "string",
|
|
1809
|
+
"format": "uuid"
|
|
1810
|
+
},
|
|
1811
|
+
"principalId": {
|
|
1812
|
+
"type": "string",
|
|
1813
|
+
"minLength": 1,
|
|
1814
|
+
"maxLength": 512
|
|
1815
|
+
},
|
|
1816
|
+
"userId": {
|
|
1817
|
+
"type": "string",
|
|
1818
|
+
"minLength": 1,
|
|
1819
|
+
"maxLength": 512
|
|
1820
|
+
},
|
|
1821
|
+
"item": {
|
|
1822
|
+
"oneOf": [
|
|
1823
|
+
{
|
|
1824
|
+
"type": "object",
|
|
1825
|
+
"properties": {
|
|
1826
|
+
"kind": {
|
|
1827
|
+
"const": "snapshot"
|
|
1828
|
+
},
|
|
1829
|
+
"snapshot": {
|
|
1830
|
+
"$ref": "#/$defs/RunSnapshot"
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
"required": [
|
|
1834
|
+
"kind",
|
|
1835
|
+
"snapshot"
|
|
1836
|
+
],
|
|
1837
|
+
"additionalProperties": false
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"type": "object",
|
|
1841
|
+
"properties": {
|
|
1842
|
+
"kind": {
|
|
1843
|
+
"const": "event"
|
|
1844
|
+
},
|
|
1845
|
+
"event": {
|
|
1846
|
+
"$ref": "#/$defs/Event"
|
|
1847
|
+
},
|
|
1848
|
+
"cursor": {
|
|
1849
|
+
"type": "string",
|
|
1850
|
+
"minLength": 1,
|
|
1851
|
+
"maxLength": 8192
|
|
1852
|
+
}
|
|
1853
|
+
},
|
|
1854
|
+
"required": [
|
|
1855
|
+
"kind",
|
|
1856
|
+
"event",
|
|
1857
|
+
"cursor"
|
|
1858
|
+
],
|
|
1859
|
+
"additionalProperties": false
|
|
1860
|
+
}
|
|
1861
|
+
]
|
|
1862
|
+
},
|
|
1863
|
+
"cursor": {
|
|
1864
|
+
"type": "string",
|
|
1865
|
+
"minLength": 1,
|
|
1866
|
+
"maxLength": 8192
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
"required": [
|
|
1870
|
+
"sessionId",
|
|
1871
|
+
"runId",
|
|
1872
|
+
"generation",
|
|
1873
|
+
"principalId",
|
|
1874
|
+
"userId",
|
|
1875
|
+
"item",
|
|
1876
|
+
"cursor"
|
|
1877
|
+
],
|
|
1878
|
+
"additionalProperties": false
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
"through": {
|
|
1882
|
+
"type": "string",
|
|
1883
|
+
"minLength": 1,
|
|
1884
|
+
"maxLength": 8192
|
|
1885
|
+
},
|
|
1886
|
+
"nextCursor": {
|
|
1887
|
+
"type": [
|
|
1888
|
+
"string",
|
|
1889
|
+
"null"
|
|
1890
|
+
]
|
|
1891
|
+
}
|
|
1892
|
+
},
|
|
1893
|
+
"required": [
|
|
1894
|
+
"observations",
|
|
1895
|
+
"through",
|
|
1896
|
+
"nextCursor"
|
|
1897
|
+
],
|
|
1898
|
+
"additionalProperties": false
|
|
1899
|
+
},
|
|
1712
1900
|
"Session": {
|
|
1713
1901
|
"type": "object",
|
|
1714
1902
|
"properties": {
|
|
@@ -6,6 +6,166 @@
|
|
|
6
6
|
"description": "Independent provider execution. Paths are relative to the current Core-declared interface base. Exact UTF-8 command bytes and stable mutation UUIDs are retained across retries. No Harness dependency or raw native session IDs."
|
|
7
7
|
},
|
|
8
8
|
"paths": {
|
|
9
|
+
"/history/events": {
|
|
10
|
+
"get": {
|
|
11
|
+
"operationId": "history.events",
|
|
12
|
+
"security": [
|
|
13
|
+
{
|
|
14
|
+
"installationHistory": []
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"parameters": [
|
|
18
|
+
{
|
|
19
|
+
"name": "after",
|
|
20
|
+
"in": "query",
|
|
21
|
+
"schema": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"maxLength": 8192
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "through",
|
|
29
|
+
"in": "query",
|
|
30
|
+
"schema": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 8192
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "limit",
|
|
38
|
+
"in": "query",
|
|
39
|
+
"schema": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"minimum": 1,
|
|
42
|
+
"maximum": 100
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"description": "Resumable, read-only installation history. Frames use event: observation with an opaque installation feed position in id. Commit each observation before saving this position.",
|
|
47
|
+
"responses": {
|
|
48
|
+
"200": {
|
|
49
|
+
"description": "History for the authenticated consumer installation.",
|
|
50
|
+
"content": {
|
|
51
|
+
"text/event-stream": {
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"x-event-schema": {
|
|
56
|
+
"$ref": "#/components/schemas/HistoryObservation"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"application/json": {
|
|
60
|
+
"schema": {
|
|
61
|
+
"$ref": "#/components/schemas/HistoryPage"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"400": {
|
|
67
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
68
|
+
"content": {
|
|
69
|
+
"application/json": {
|
|
70
|
+
"schema": {
|
|
71
|
+
"$ref": "#/components/schemas/Error"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"401": {
|
|
77
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
78
|
+
"content": {
|
|
79
|
+
"application/json": {
|
|
80
|
+
"schema": {
|
|
81
|
+
"$ref": "#/components/schemas/Error"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"403": {
|
|
87
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
88
|
+
"content": {
|
|
89
|
+
"application/json": {
|
|
90
|
+
"schema": {
|
|
91
|
+
"$ref": "#/components/schemas/Error"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"404": {
|
|
97
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
98
|
+
"content": {
|
|
99
|
+
"application/json": {
|
|
100
|
+
"schema": {
|
|
101
|
+
"$ref": "#/components/schemas/Error"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"409": {
|
|
107
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
108
|
+
"content": {
|
|
109
|
+
"application/json": {
|
|
110
|
+
"schema": {
|
|
111
|
+
"$ref": "#/components/schemas/Error"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"410": {
|
|
117
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
118
|
+
"content": {
|
|
119
|
+
"application/json": {
|
|
120
|
+
"schema": {
|
|
121
|
+
"$ref": "#/components/schemas/Error"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"413": {
|
|
127
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
128
|
+
"content": {
|
|
129
|
+
"application/json": {
|
|
130
|
+
"schema": {
|
|
131
|
+
"$ref": "#/components/schemas/Error"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"422": {
|
|
137
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
138
|
+
"content": {
|
|
139
|
+
"application/json": {
|
|
140
|
+
"schema": {
|
|
141
|
+
"$ref": "#/components/schemas/Error"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"429": {
|
|
147
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
148
|
+
"content": {
|
|
149
|
+
"application/json": {
|
|
150
|
+
"schema": {
|
|
151
|
+
"$ref": "#/components/schemas/Error"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"503": {
|
|
157
|
+
"description": "Structured agent error; retryable never authorizes another mutation UUID.",
|
|
158
|
+
"content": {
|
|
159
|
+
"application/json": {
|
|
160
|
+
"schema": {
|
|
161
|
+
"$ref": "#/components/schemas/Error"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
9
169
|
"/capabilities": {
|
|
10
170
|
"get": {
|
|
11
171
|
"operationId": "capabilities",
|
|
@@ -2460,6 +2620,11 @@
|
|
|
2460
2620
|
},
|
|
2461
2621
|
"components": {
|
|
2462
2622
|
"securitySchemes": {
|
|
2623
|
+
"installationHistory": {
|
|
2624
|
+
"type": "http",
|
|
2625
|
+
"scheme": "bearer",
|
|
2626
|
+
"description": "Core-issued installation history credential."
|
|
2627
|
+
},
|
|
2463
2628
|
"coreOperation": {
|
|
2464
2629
|
"type": "http",
|
|
2465
2630
|
"scheme": "bearer",
|
|
@@ -4173,6 +4338,194 @@
|
|
|
4173
4338
|
],
|
|
4174
4339
|
"additionalProperties": true
|
|
4175
4340
|
},
|
|
4341
|
+
"HistoryObservation": {
|
|
4342
|
+
"type": "object",
|
|
4343
|
+
"properties": {
|
|
4344
|
+
"sessionId": {
|
|
4345
|
+
"type": "string",
|
|
4346
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
4347
|
+
},
|
|
4348
|
+
"runId": {
|
|
4349
|
+
"type": "string",
|
|
4350
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
4351
|
+
},
|
|
4352
|
+
"generation": {
|
|
4353
|
+
"type": "string",
|
|
4354
|
+
"format": "uuid"
|
|
4355
|
+
},
|
|
4356
|
+
"principalId": {
|
|
4357
|
+
"type": "string",
|
|
4358
|
+
"minLength": 1,
|
|
4359
|
+
"maxLength": 512
|
|
4360
|
+
},
|
|
4361
|
+
"userId": {
|
|
4362
|
+
"type": "string",
|
|
4363
|
+
"minLength": 1,
|
|
4364
|
+
"maxLength": 512
|
|
4365
|
+
},
|
|
4366
|
+
"item": {
|
|
4367
|
+
"oneOf": [
|
|
4368
|
+
{
|
|
4369
|
+
"type": "object",
|
|
4370
|
+
"properties": {
|
|
4371
|
+
"kind": {
|
|
4372
|
+
"const": "snapshot"
|
|
4373
|
+
},
|
|
4374
|
+
"snapshot": {
|
|
4375
|
+
"$ref": "#/components/schemas/RunSnapshot"
|
|
4376
|
+
}
|
|
4377
|
+
},
|
|
4378
|
+
"required": [
|
|
4379
|
+
"kind",
|
|
4380
|
+
"snapshot"
|
|
4381
|
+
],
|
|
4382
|
+
"additionalProperties": false
|
|
4383
|
+
},
|
|
4384
|
+
{
|
|
4385
|
+
"type": "object",
|
|
4386
|
+
"properties": {
|
|
4387
|
+
"kind": {
|
|
4388
|
+
"const": "event"
|
|
4389
|
+
},
|
|
4390
|
+
"event": {
|
|
4391
|
+
"$ref": "#/components/schemas/Event"
|
|
4392
|
+
},
|
|
4393
|
+
"cursor": {
|
|
4394
|
+
"type": "string",
|
|
4395
|
+
"minLength": 1,
|
|
4396
|
+
"maxLength": 8192
|
|
4397
|
+
}
|
|
4398
|
+
},
|
|
4399
|
+
"required": [
|
|
4400
|
+
"kind",
|
|
4401
|
+
"event",
|
|
4402
|
+
"cursor"
|
|
4403
|
+
],
|
|
4404
|
+
"additionalProperties": false
|
|
4405
|
+
}
|
|
4406
|
+
]
|
|
4407
|
+
}
|
|
4408
|
+
},
|
|
4409
|
+
"required": [
|
|
4410
|
+
"sessionId",
|
|
4411
|
+
"runId",
|
|
4412
|
+
"generation",
|
|
4413
|
+
"principalId",
|
|
4414
|
+
"userId",
|
|
4415
|
+
"item"
|
|
4416
|
+
],
|
|
4417
|
+
"additionalProperties": false
|
|
4418
|
+
},
|
|
4419
|
+
"HistoryPage": {
|
|
4420
|
+
"type": "object",
|
|
4421
|
+
"properties": {
|
|
4422
|
+
"observations": {
|
|
4423
|
+
"type": "array",
|
|
4424
|
+
"maxItems": 100,
|
|
4425
|
+
"items": {
|
|
4426
|
+
"type": "object",
|
|
4427
|
+
"properties": {
|
|
4428
|
+
"sessionId": {
|
|
4429
|
+
"type": "string",
|
|
4430
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
4431
|
+
},
|
|
4432
|
+
"runId": {
|
|
4433
|
+
"type": "string",
|
|
4434
|
+
"pattern": "^[A-Za-z0-9_-]{1,256}$"
|
|
4435
|
+
},
|
|
4436
|
+
"generation": {
|
|
4437
|
+
"type": "string",
|
|
4438
|
+
"format": "uuid"
|
|
4439
|
+
},
|
|
4440
|
+
"principalId": {
|
|
4441
|
+
"type": "string",
|
|
4442
|
+
"minLength": 1,
|
|
4443
|
+
"maxLength": 512
|
|
4444
|
+
},
|
|
4445
|
+
"userId": {
|
|
4446
|
+
"type": "string",
|
|
4447
|
+
"minLength": 1,
|
|
4448
|
+
"maxLength": 512
|
|
4449
|
+
},
|
|
4450
|
+
"item": {
|
|
4451
|
+
"oneOf": [
|
|
4452
|
+
{
|
|
4453
|
+
"type": "object",
|
|
4454
|
+
"properties": {
|
|
4455
|
+
"kind": {
|
|
4456
|
+
"const": "snapshot"
|
|
4457
|
+
},
|
|
4458
|
+
"snapshot": {
|
|
4459
|
+
"$ref": "#/components/schemas/RunSnapshot"
|
|
4460
|
+
}
|
|
4461
|
+
},
|
|
4462
|
+
"required": [
|
|
4463
|
+
"kind",
|
|
4464
|
+
"snapshot"
|
|
4465
|
+
],
|
|
4466
|
+
"additionalProperties": false
|
|
4467
|
+
},
|
|
4468
|
+
{
|
|
4469
|
+
"type": "object",
|
|
4470
|
+
"properties": {
|
|
4471
|
+
"kind": {
|
|
4472
|
+
"const": "event"
|
|
4473
|
+
},
|
|
4474
|
+
"event": {
|
|
4475
|
+
"$ref": "#/components/schemas/Event"
|
|
4476
|
+
},
|
|
4477
|
+
"cursor": {
|
|
4478
|
+
"type": "string",
|
|
4479
|
+
"minLength": 1,
|
|
4480
|
+
"maxLength": 8192
|
|
4481
|
+
}
|
|
4482
|
+
},
|
|
4483
|
+
"required": [
|
|
4484
|
+
"kind",
|
|
4485
|
+
"event",
|
|
4486
|
+
"cursor"
|
|
4487
|
+
],
|
|
4488
|
+
"additionalProperties": false
|
|
4489
|
+
}
|
|
4490
|
+
]
|
|
4491
|
+
},
|
|
4492
|
+
"cursor": {
|
|
4493
|
+
"type": "string",
|
|
4494
|
+
"minLength": 1,
|
|
4495
|
+
"maxLength": 8192
|
|
4496
|
+
}
|
|
4497
|
+
},
|
|
4498
|
+
"required": [
|
|
4499
|
+
"sessionId",
|
|
4500
|
+
"runId",
|
|
4501
|
+
"generation",
|
|
4502
|
+
"principalId",
|
|
4503
|
+
"userId",
|
|
4504
|
+
"item",
|
|
4505
|
+
"cursor"
|
|
4506
|
+
],
|
|
4507
|
+
"additionalProperties": false
|
|
4508
|
+
}
|
|
4509
|
+
},
|
|
4510
|
+
"through": {
|
|
4511
|
+
"type": "string",
|
|
4512
|
+
"minLength": 1,
|
|
4513
|
+
"maxLength": 8192
|
|
4514
|
+
},
|
|
4515
|
+
"nextCursor": {
|
|
4516
|
+
"type": [
|
|
4517
|
+
"string",
|
|
4518
|
+
"null"
|
|
4519
|
+
]
|
|
4520
|
+
}
|
|
4521
|
+
},
|
|
4522
|
+
"required": [
|
|
4523
|
+
"observations",
|
|
4524
|
+
"through",
|
|
4525
|
+
"nextCursor"
|
|
4526
|
+
],
|
|
4527
|
+
"additionalProperties": false
|
|
4528
|
+
},
|
|
4176
4529
|
"Session": {
|
|
4177
4530
|
"type": "object",
|
|
4178
4531
|
"properties": {
|