veryfront 0.1.233 → 0.1.235
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/esm/deno.d.ts +1 -0
- package/esm/deno.js +2 -1
- package/esm/src/agent/durable.d.ts +102 -0
- package/esm/src/agent/durable.d.ts.map +1 -1
- package/esm/src/agent/durable.js +258 -12
- package/esm/src/agent/index.d.ts +2 -1
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +2 -1
- package/esm/src/agent/invoke-agent-child-runs.d.ts +145 -0
- package/esm/src/agent/invoke-agent-child-runs.d.ts.map +1 -0
- package/esm/src/agent/invoke-agent-child-runs.js +101 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -1
- package/src/deno.js +2 -1
- package/src/src/agent/durable.ts +358 -12
- package/src/src/agent/index.ts +28 -0
- package/src/src/agent/invoke-agent-child-runs.ts +170 -0
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare namespace _default {
|
|
|
19
19
|
"./agent": string;
|
|
20
20
|
"./agent/conversation-bootstrap": string;
|
|
21
21
|
"./agent/durable": string;
|
|
22
|
+
"./agent/invoke-agent-child-runs": string;
|
|
22
23
|
"./channels/control-plane": string;
|
|
23
24
|
"./channels/invoke": string;
|
|
24
25
|
"./tool": string;
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.235",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"workspace": [
|
|
@@ -32,6 +32,7 @@ export default {
|
|
|
32
32
|
"./agent": "./src/agent/index.ts",
|
|
33
33
|
"./agent/conversation-bootstrap": "./src/agent/conversation-bootstrap.ts",
|
|
34
34
|
"./agent/durable": "./src/agent/durable.ts",
|
|
35
|
+
"./agent/invoke-agent-child-runs": "./src/agent/invoke-agent-child-runs.ts",
|
|
35
36
|
"./channels/control-plane": "./src/channels/control-plane.ts",
|
|
36
37
|
"./channels/invoke": "./src/channels/invoke.ts",
|
|
37
38
|
"./tool": "./src/tool/index.ts",
|
|
@@ -16,6 +16,14 @@ export declare function resolveConversationRunTargets(input: {
|
|
|
16
16
|
projectId?: string | null;
|
|
17
17
|
branchId?: string | null;
|
|
18
18
|
}): ConversationRunTargets;
|
|
19
|
+
export declare const ConversationRunStatusSchema: z.ZodEnum<{
|
|
20
|
+
failed: "failed";
|
|
21
|
+
pending: "pending";
|
|
22
|
+
completed: "completed";
|
|
23
|
+
running: "running";
|
|
24
|
+
cancelled: "cancelled";
|
|
25
|
+
waiting_for_tool: "waiting_for_tool";
|
|
26
|
+
}>;
|
|
19
27
|
export declare const ConversationRunProjectionSchema: z.ZodPipe<z.ZodObject<{
|
|
20
28
|
runId: z.ZodOptional<z.ZodString>;
|
|
21
29
|
run_id: z.ZodOptional<z.ZodString>;
|
|
@@ -57,6 +65,8 @@ export declare const ConversationRunProjectionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
57
65
|
latest_external_event_sequence?: number | undefined;
|
|
58
66
|
}>>;
|
|
59
67
|
export type ConversationRunProjection = z.infer<typeof ConversationRunProjectionSchema>;
|
|
68
|
+
export type ActiveConversationRunStatus = Extract<ConversationRunProjection["status"], "pending" | "running" | "waiting_for_tool">;
|
|
69
|
+
export type TerminalConversationRunStatus = Extract<ConversationRunProjection["status"], "completed" | "failed" | "cancelled">;
|
|
60
70
|
export declare const CreateConversationRunAcceptedSchema: z.ZodPipe<z.ZodObject<{
|
|
61
71
|
run: z.ZodObject<{
|
|
62
72
|
runId: z.ZodOptional<z.ZodString>;
|
|
@@ -87,6 +97,53 @@ export declare const CompleteConversationRunResponseSchema: z.ZodObject<{
|
|
|
87
97
|
}>;
|
|
88
98
|
}, z.core.$loose>;
|
|
89
99
|
}, z.core.$loose>;
|
|
100
|
+
export declare const AppendConversationRunEventsResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
101
|
+
latestEventId: z.ZodNumber;
|
|
102
|
+
latestExternalEventSequence: z.ZodNumber;
|
|
103
|
+
appendedCount: z.ZodNumber;
|
|
104
|
+
run: z.ZodObject<{
|
|
105
|
+
runId: z.ZodString;
|
|
106
|
+
conversationId: z.ZodString;
|
|
107
|
+
latestEventId: z.ZodNumber;
|
|
108
|
+
latestExternalEventSequence: z.ZodNumber;
|
|
109
|
+
}, z.core.$loose>;
|
|
110
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
111
|
+
latest_event_id: z.ZodNumber;
|
|
112
|
+
latest_external_event_sequence: z.ZodNumber;
|
|
113
|
+
appended_count: z.ZodNumber;
|
|
114
|
+
run: z.ZodObject<{
|
|
115
|
+
run_id: z.ZodString;
|
|
116
|
+
conversation_id: z.ZodString;
|
|
117
|
+
latest_event_id: z.ZodNumber;
|
|
118
|
+
latest_external_event_sequence: z.ZodNumber;
|
|
119
|
+
}, z.core.$loose>;
|
|
120
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
121
|
+
latestEventId: number;
|
|
122
|
+
latestExternalEventSequence: number;
|
|
123
|
+
appendedCount: number;
|
|
124
|
+
run: {
|
|
125
|
+
runId: string;
|
|
126
|
+
conversationId: string;
|
|
127
|
+
latestEventId: number;
|
|
128
|
+
latestExternalEventSequence: number;
|
|
129
|
+
run_id: string;
|
|
130
|
+
conversation_id: string;
|
|
131
|
+
latest_event_id: number;
|
|
132
|
+
latest_external_event_sequence: number;
|
|
133
|
+
};
|
|
134
|
+
}, {
|
|
135
|
+
latest_event_id: number;
|
|
136
|
+
latest_external_event_sequence: number;
|
|
137
|
+
appended_count: number;
|
|
138
|
+
run: {
|
|
139
|
+
[x: string]: unknown;
|
|
140
|
+
run_id: string;
|
|
141
|
+
conversation_id: string;
|
|
142
|
+
latest_event_id: number;
|
|
143
|
+
latest_external_event_sequence: number;
|
|
144
|
+
};
|
|
145
|
+
}>>]>;
|
|
146
|
+
export type AppendConversationRunEventsResponse = z.infer<typeof AppendConversationRunEventsResponseSchema>;
|
|
90
147
|
export interface ConversationAgentRunUsage {
|
|
91
148
|
inputTokens: number;
|
|
92
149
|
outputTokens: number;
|
|
@@ -113,6 +170,51 @@ export interface FinalizeConversationAgentRunInput {
|
|
|
113
170
|
terminalErrorCode?: string | null;
|
|
114
171
|
terminalErrorMessage?: string | null;
|
|
115
172
|
}
|
|
173
|
+
export declare class ConversationRunTerminalStateError extends Error {
|
|
174
|
+
readonly status: TerminalConversationRunStatus;
|
|
175
|
+
readonly run: ConversationRunProjection;
|
|
176
|
+
constructor(run: ConversationRunProjection, status: TerminalConversationRunStatus);
|
|
177
|
+
}
|
|
178
|
+
export declare class AppendConversationRunEventsError extends Error {
|
|
179
|
+
readonly status: number;
|
|
180
|
+
readonly detail: string | null;
|
|
181
|
+
constructor(input: {
|
|
182
|
+
status: number;
|
|
183
|
+
detail?: string | null;
|
|
184
|
+
statusText?: string;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
export declare function parseAppendConversationRunEventsErrorBody(bodyText: string): string | null;
|
|
188
|
+
export declare function isIgnorableConversationRunAppendError(error: unknown): error is AppendConversationRunEventsError;
|
|
189
|
+
export declare function isCursorMismatchConversationRunAppendError(error: unknown): error is AppendConversationRunEventsError;
|
|
190
|
+
export declare function isActiveConversationRunStatus(status: ConversationRunProjection["status"]): status is ActiveConversationRunStatus;
|
|
191
|
+
export declare function getConversationRun(input: {
|
|
192
|
+
authToken: string;
|
|
193
|
+
apiUrl: string;
|
|
194
|
+
conversationId: string;
|
|
195
|
+
runId: string;
|
|
196
|
+
abortSignal?: AbortSignal;
|
|
197
|
+
}): Promise<ConversationRunProjection>;
|
|
198
|
+
export declare function monitorConversationRunStatus(input: {
|
|
199
|
+
authToken: string;
|
|
200
|
+
apiUrl: string;
|
|
201
|
+
conversationId: string;
|
|
202
|
+
runId: string;
|
|
203
|
+
abortSignal?: AbortSignal;
|
|
204
|
+
pollIntervalMs: number;
|
|
205
|
+
onTerminal: (error: ConversationRunTerminalStateError) => void | Promise<void>;
|
|
206
|
+
onPollError?: (error: unknown) => void | Promise<void>;
|
|
207
|
+
}): Promise<void>;
|
|
208
|
+
export declare function appendConversationRunEvents(input: {
|
|
209
|
+
authToken: string;
|
|
210
|
+
apiUrl: string;
|
|
211
|
+
conversationId: string;
|
|
212
|
+
runId: string;
|
|
213
|
+
expectedPreviousEventId?: number;
|
|
214
|
+
expectedPreviousExternalEventSequence?: number;
|
|
215
|
+
events: unknown[];
|
|
216
|
+
abortSignal?: AbortSignal;
|
|
217
|
+
}): Promise<AppendConversationRunEventsResponse>;
|
|
116
218
|
export declare function createConversationAgentRun(input: CreateConversationAgentRunInput): Promise<ConversationRunProjection>;
|
|
117
219
|
export declare function finalizeConversationAgentRun(input: FinalizeConversationAgentRunInput): Promise<void>;
|
|
118
220
|
//# sourceMappingURL=durable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable.d.ts","sourceRoot":"","sources":["../../../src/src/agent/durable.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"durable.d.ts","sourceRoot":"","sources":["../../../src/src/agent/durable.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,eAAO,MAAM,4BAA4B;;;;;;;;;;iBAIvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MA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-2,6 +2,31 @@ import "../../_dnt.polyfills.js";
|
|
|
2
2
|
import * as dntShim from "../../_dnt.shims.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
const AGENT_RUN_API_TIMEOUT_MS = 15_000;
|
|
5
|
+
function createTimedAbortSignal(timeoutMs, abortSignal) {
|
|
6
|
+
const controller = new AbortController();
|
|
7
|
+
let abortedByCaller = false;
|
|
8
|
+
const timeout = dntShim.setTimeout(() => {
|
|
9
|
+
controller.abort();
|
|
10
|
+
}, timeoutMs);
|
|
11
|
+
const onAbort = () => {
|
|
12
|
+
abortedByCaller = true;
|
|
13
|
+
controller.abort();
|
|
14
|
+
};
|
|
15
|
+
if (abortSignal?.aborted) {
|
|
16
|
+
onAbort();
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
signal: controller.signal,
|
|
23
|
+
wasAbortedByCaller: () => abortedByCaller,
|
|
24
|
+
cleanup: () => {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
abortSignal?.removeEventListener("abort", onAbort);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
5
30
|
export const ConversationRunTargetsSchema = z.object({
|
|
6
31
|
sourceTargetKind: z.enum(["project", "preview_branch"]).nullable(),
|
|
7
32
|
runtimeTargetKind: z.enum(["production", "preview_branch"]).nullable(),
|
|
@@ -26,6 +51,14 @@ export function resolveConversationRunTargets(input) {
|
|
|
26
51
|
targetBranchId: null,
|
|
27
52
|
});
|
|
28
53
|
}
|
|
54
|
+
export const ConversationRunStatusSchema = z.enum([
|
|
55
|
+
"pending",
|
|
56
|
+
"running",
|
|
57
|
+
"waiting_for_tool",
|
|
58
|
+
"completed",
|
|
59
|
+
"failed",
|
|
60
|
+
"cancelled",
|
|
61
|
+
]);
|
|
29
62
|
export const ConversationRunProjectionSchema = z
|
|
30
63
|
.object({
|
|
31
64
|
runId: z.string().min(1).optional(),
|
|
@@ -38,7 +71,7 @@ export const ConversationRunProjectionSchema = z
|
|
|
38
71
|
latest_event_id: z.number().int().nonnegative().optional(),
|
|
39
72
|
latestExternalEventSequence: z.number().int().nonnegative().optional(),
|
|
40
73
|
latest_external_event_sequence: z.number().int().nonnegative().optional(),
|
|
41
|
-
status:
|
|
74
|
+
status: ConversationRunStatusSchema,
|
|
42
75
|
})
|
|
43
76
|
.passthrough()
|
|
44
77
|
.transform((data) => {
|
|
@@ -92,11 +125,130 @@ export const CompleteConversationRunResponseSchema = z
|
|
|
92
125
|
.passthrough(),
|
|
93
126
|
})
|
|
94
127
|
.passthrough();
|
|
128
|
+
const AppendConversationRunEventsCamelRunSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
runId: z.string().min(1),
|
|
131
|
+
conversationId: z.string().uuid(),
|
|
132
|
+
latestEventId: z.number().int().nonnegative(),
|
|
133
|
+
latestExternalEventSequence: z.number().int().nonnegative(),
|
|
134
|
+
})
|
|
135
|
+
.passthrough();
|
|
136
|
+
const AppendConversationRunEventsSnakeRunSchema = z
|
|
137
|
+
.object({
|
|
138
|
+
run_id: z.string().min(1),
|
|
139
|
+
conversation_id: z.string().uuid(),
|
|
140
|
+
latest_event_id: z.number().int().nonnegative(),
|
|
141
|
+
latest_external_event_sequence: z.number().int().nonnegative(),
|
|
142
|
+
})
|
|
143
|
+
.passthrough();
|
|
144
|
+
export const AppendConversationRunEventsResponseSchema = z.union([
|
|
145
|
+
z.object({
|
|
146
|
+
latestEventId: z.number().int().nonnegative(),
|
|
147
|
+
latestExternalEventSequence: z.number().int().nonnegative(),
|
|
148
|
+
appendedCount: z.number().int().nonnegative(),
|
|
149
|
+
run: AppendConversationRunEventsCamelRunSchema,
|
|
150
|
+
}),
|
|
151
|
+
z.object({
|
|
152
|
+
latest_event_id: z.number().int().nonnegative(),
|
|
153
|
+
latest_external_event_sequence: z.number().int().nonnegative(),
|
|
154
|
+
appended_count: z.number().int().nonnegative(),
|
|
155
|
+
run: AppendConversationRunEventsSnakeRunSchema,
|
|
156
|
+
}).transform((data) => ({
|
|
157
|
+
latestEventId: data.latest_event_id,
|
|
158
|
+
latestExternalEventSequence: data.latest_external_event_sequence,
|
|
159
|
+
appendedCount: data.appended_count,
|
|
160
|
+
run: {
|
|
161
|
+
...data.run,
|
|
162
|
+
runId: data.run.run_id,
|
|
163
|
+
conversationId: data.run.conversation_id,
|
|
164
|
+
latestEventId: data.run.latest_event_id,
|
|
165
|
+
latestExternalEventSequence: data.run.latest_external_event_sequence,
|
|
166
|
+
},
|
|
167
|
+
})),
|
|
168
|
+
]);
|
|
169
|
+
const ConversationRunErrorSchema = z.object({
|
|
170
|
+
detail: z.string().min(1).optional(),
|
|
171
|
+
error: z.string().min(1).optional(),
|
|
172
|
+
});
|
|
173
|
+
export class ConversationRunTerminalStateError extends Error {
|
|
174
|
+
status;
|
|
175
|
+
run;
|
|
176
|
+
constructor(run, status) {
|
|
177
|
+
super(`Conversation run ${run.runId} became ${status} before host execution finished`);
|
|
178
|
+
this.name = "ConversationRunTerminalStateError";
|
|
179
|
+
this.status = status;
|
|
180
|
+
this.run = run;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export class AppendConversationRunEventsError extends Error {
|
|
184
|
+
status;
|
|
185
|
+
detail;
|
|
186
|
+
constructor(input) {
|
|
187
|
+
const detail = input.detail?.trim() || input.statusText || `HTTP ${input.status}`;
|
|
188
|
+
super(`Append conversation run events failed (${input.status}): ${detail}`);
|
|
189
|
+
this.name = "AppendConversationRunEventsError";
|
|
190
|
+
this.status = input.status;
|
|
191
|
+
this.detail = input.detail?.trim() || null;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
export function parseAppendConversationRunEventsErrorBody(bodyText) {
|
|
195
|
+
if (!bodyText) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const parsed = ConversationRunErrorSchema.safeParse(JSON.parse(bodyText));
|
|
200
|
+
if (parsed.success) {
|
|
201
|
+
return parsed.data.detail ?? parsed.data.error ?? null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return bodyText;
|
|
206
|
+
}
|
|
207
|
+
return bodyText;
|
|
208
|
+
}
|
|
209
|
+
export function isIgnorableConversationRunAppendError(error) {
|
|
210
|
+
if (!(error instanceof AppendConversationRunEventsError)) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
if (error.status === 404) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
if (error.status !== 400) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
return (error.detail === "Cannot append external events to a terminal run" ||
|
|
220
|
+
error.detail === "Cannot append external events while the run is waiting for a tool result");
|
|
221
|
+
}
|
|
222
|
+
export function isCursorMismatchConversationRunAppendError(error) {
|
|
223
|
+
return (error instanceof AppendConversationRunEventsError &&
|
|
224
|
+
error.status === 400 &&
|
|
225
|
+
error.detail === "External run event cursor mismatch");
|
|
226
|
+
}
|
|
227
|
+
export function isActiveConversationRunStatus(status) {
|
|
228
|
+
return status === "pending" || status === "running" || status === "waiting_for_tool";
|
|
229
|
+
}
|
|
230
|
+
async function waitForConversationRunPoll(ms, abortSignal) {
|
|
231
|
+
if (ms <= 0 || abortSignal?.aborted) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
await new Promise((resolve) => {
|
|
235
|
+
const timeoutId = dntShim.setTimeout(() => {
|
|
236
|
+
abortSignal?.removeEventListener("abort", resolveOnAbort);
|
|
237
|
+
resolve();
|
|
238
|
+
}, ms);
|
|
239
|
+
const resolveOnAbort = () => {
|
|
240
|
+
clearTimeout(timeoutId);
|
|
241
|
+
abortSignal?.removeEventListener("abort", resolveOnAbort);
|
|
242
|
+
resolve();
|
|
243
|
+
};
|
|
244
|
+
abortSignal?.addEventListener("abort", resolveOnAbort, { once: true });
|
|
245
|
+
});
|
|
246
|
+
}
|
|
95
247
|
async function controlPlaneJson(input) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
248
|
+
if (input.abortSignal?.aborted) {
|
|
249
|
+
throw new DOMException("This operation was aborted", "AbortError");
|
|
250
|
+
}
|
|
251
|
+
const timedAbort = createTimedAbortSignal(AGENT_RUN_API_TIMEOUT_MS, input.abortSignal);
|
|
100
252
|
let response;
|
|
101
253
|
try {
|
|
102
254
|
response = await fetch(input.url, {
|
|
@@ -106,17 +258,19 @@ async function controlPlaneJson(input) {
|
|
|
106
258
|
"Content-Type": "application/json",
|
|
107
259
|
},
|
|
108
260
|
...(input.body !== undefined ? { body: JSON.stringify(input.body) } : {}),
|
|
109
|
-
signal:
|
|
261
|
+
signal: timedAbort.signal,
|
|
110
262
|
});
|
|
111
263
|
}
|
|
112
264
|
catch (error) {
|
|
113
|
-
if (error instanceof DOMException &&
|
|
265
|
+
if (error instanceof DOMException &&
|
|
266
|
+
error.name === "AbortError" &&
|
|
267
|
+
!timedAbort.wasAbortedByCaller()) {
|
|
114
268
|
throw new Error(`${input.operation} timed out after ${AGENT_RUN_API_TIMEOUT_MS}ms`);
|
|
115
269
|
}
|
|
116
270
|
throw error;
|
|
117
271
|
}
|
|
118
272
|
finally {
|
|
119
|
-
|
|
273
|
+
timedAbort.cleanup();
|
|
120
274
|
}
|
|
121
275
|
if (!response.ok) {
|
|
122
276
|
const body = await response.text().catch(() => "");
|
|
@@ -124,6 +278,98 @@ async function controlPlaneJson(input) {
|
|
|
124
278
|
}
|
|
125
279
|
return input.responseSchema.parse(await response.json());
|
|
126
280
|
}
|
|
281
|
+
export async function getConversationRun(input) {
|
|
282
|
+
return controlPlaneJson({
|
|
283
|
+
authToken: input.authToken,
|
|
284
|
+
url: `${input.apiUrl}/conversations/${input.conversationId}/runs/${input.runId}`,
|
|
285
|
+
responseSchema: ConversationRunProjectionSchema,
|
|
286
|
+
operation: "Read conversation durable run projection",
|
|
287
|
+
abortSignal: input.abortSignal,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
export async function monitorConversationRunStatus(input) {
|
|
291
|
+
while (!input.abortSignal?.aborted) {
|
|
292
|
+
await waitForConversationRunPoll(input.pollIntervalMs, input.abortSignal);
|
|
293
|
+
if (input.abortSignal?.aborted) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const run = await getConversationRun({
|
|
298
|
+
authToken: input.authToken,
|
|
299
|
+
apiUrl: input.apiUrl,
|
|
300
|
+
conversationId: input.conversationId,
|
|
301
|
+
runId: input.runId,
|
|
302
|
+
abortSignal: input.abortSignal,
|
|
303
|
+
});
|
|
304
|
+
if (isActiveConversationRunStatus(run.status)) {
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (run.status === "completed" ||
|
|
308
|
+
run.status === "failed" ||
|
|
309
|
+
run.status === "cancelled") {
|
|
310
|
+
await input.onTerminal(new ConversationRunTerminalStateError(run, run.status));
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
if (input.abortSignal?.aborted) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
await input.onPollError?.(error);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
export async function appendConversationRunEvents(input) {
|
|
326
|
+
if (input.abortSignal?.aborted) {
|
|
327
|
+
throw new DOMException("This operation was aborted", "AbortError");
|
|
328
|
+
}
|
|
329
|
+
const timedAbort = createTimedAbortSignal(AGENT_RUN_API_TIMEOUT_MS, input.abortSignal);
|
|
330
|
+
let response;
|
|
331
|
+
try {
|
|
332
|
+
response = await fetch(`${input.apiUrl}/conversations/${input.conversationId}/runs/${input.runId}/events`, {
|
|
333
|
+
method: "POST",
|
|
334
|
+
headers: {
|
|
335
|
+
Authorization: `Bearer ${input.authToken}`,
|
|
336
|
+
"Content-Type": "application/json",
|
|
337
|
+
},
|
|
338
|
+
body: JSON.stringify({
|
|
339
|
+
...(input.expectedPreviousEventId !== undefined
|
|
340
|
+
? { expected_previous_event_id: input.expectedPreviousEventId }
|
|
341
|
+
: {}),
|
|
342
|
+
...(input.expectedPreviousExternalEventSequence !== undefined
|
|
343
|
+
? {
|
|
344
|
+
expected_previous_external_event_sequence: input.expectedPreviousExternalEventSequence,
|
|
345
|
+
}
|
|
346
|
+
: {}),
|
|
347
|
+
events: input.events,
|
|
348
|
+
}),
|
|
349
|
+
signal: timedAbort.signal,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
if (error instanceof DOMException &&
|
|
354
|
+
error.name === "AbortError" &&
|
|
355
|
+
!timedAbort.wasAbortedByCaller()) {
|
|
356
|
+
throw new Error(`Append conversation run events timed out after ${AGENT_RUN_API_TIMEOUT_MS}ms`);
|
|
357
|
+
}
|
|
358
|
+
throw error;
|
|
359
|
+
}
|
|
360
|
+
finally {
|
|
361
|
+
timedAbort.cleanup();
|
|
362
|
+
}
|
|
363
|
+
if (!response.ok) {
|
|
364
|
+
const body = await response.text().catch(() => "");
|
|
365
|
+
throw new AppendConversationRunEventsError({
|
|
366
|
+
status: response.status,
|
|
367
|
+
detail: parseAppendConversationRunEventsErrorBody(body),
|
|
368
|
+
statusText: response.statusText,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return AppendConversationRunEventsResponseSchema.parse(await response.json());
|
|
372
|
+
}
|
|
127
373
|
export async function createConversationAgentRun(input) {
|
|
128
374
|
const targets = resolveConversationRunTargets({
|
|
129
375
|
projectId: input.projectId ?? null,
|
|
@@ -158,11 +404,11 @@ export async function createConversationAgentRun(input) {
|
|
|
158
404
|
responseSchema: CreateConversationRunAcceptedSchema,
|
|
159
405
|
operation: "Create canonical durable run",
|
|
160
406
|
});
|
|
161
|
-
return
|
|
407
|
+
return getConversationRun({
|
|
162
408
|
authToken: input.authToken,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
409
|
+
apiUrl: input.apiUrl,
|
|
410
|
+
conversationId: input.conversationId,
|
|
411
|
+
runId,
|
|
166
412
|
});
|
|
167
413
|
}
|
|
168
414
|
export async function finalizeConversationAgentRun(input) {
|
package/esm/src/agent/index.d.ts
CHANGED
|
@@ -90,7 +90,8 @@ export { normalizeAgUiRuntimeMessages } from "./ag-ui-runtime-support.js";
|
|
|
90
90
|
export { type AgUiBrowserEncodedEvent, type AgUiBrowserEncoderState, type AgUiBrowserRunFinishedMetadata, type AgUiRuntimeStreamEvent, buildAgUiBrowserFinalizeResponse, createAgUiBrowserEncoderState, finalizeAgUiBrowserEvents, mapRuntimeStreamEventToAgUiBrowserEvents, } from "./ag-ui-browser-encoder.js";
|
|
91
91
|
export { type AgUiBrowserResponseEncoder, type AgUiBrowserResponseExecution, type AgUiBrowserResponseRequestState, createAgUiBrowserResponseStream, type CreateAgUiBrowserResponseStreamInput, } from "./ag-ui-browser-response-stream.js";
|
|
92
92
|
export { bootstrapConversationAgentRun, type BootstrapConversationAgentRunResult, type ConversationMessageRecord, ConversationMessageRecordSchema, type ConversationRecord, ConversationRecordSchema, createConversationMessage, createConversationRecord, ensureConversationProjectLink, fetchConversationRecord, } from "./conversation-bootstrap.js";
|
|
93
|
-
export { CompleteConversationRunResponseSchema, type ConversationAgentRunUsage, type ConversationRunProjection, ConversationRunProjectionSchema, type ConversationRunTargets, ConversationRunTargetsSchema, createConversationAgentRun, finalizeConversationAgentRun, resolveConversationRunTargets, } from "./durable.js";
|
|
93
|
+
export { type ActiveConversationRunStatus, appendConversationRunEvents, AppendConversationRunEventsError, type AppendConversationRunEventsResponse, AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, type ConversationAgentRunUsage, type ConversationRunProjection, ConversationRunProjectionSchema, ConversationRunStatusSchema, type ConversationRunTargets, ConversationRunTargetsSchema, ConversationRunTerminalStateError, createConversationAgentRun, finalizeConversationAgentRun, getConversationRun, isActiveConversationRunStatus, isCursorMismatchConversationRunAppendError, isIgnorableConversationRunAppendError, monitorConversationRunStatus, parseAppendConversationRunEventsErrorBody, resolveConversationRunTargets, type TerminalConversationRunStatus, } from "./durable.js";
|
|
94
|
+
export { buildInvokeAgentChildRunLifecycleCustomEvent, buildInvokeAgentChildRunProgressEvents, buildInvokeAgentChildRunStateDelta, type InvokeAgentChildRunLifecycleCustomEvent, InvokeAgentChildRunLifecycleCustomEventSchema, type InvokeAgentChildRunLifecycleValue, InvokeAgentChildRunLifecycleValueSchema, type InvokeAgentChildRunProgressEvent, type InvokeAgentChildRunProgressInput, type InvokeAgentChildRunStateDelta, InvokeAgentChildRunStateDeltaSchema, publishInvokeAgentChildRunProgress, } from "./invoke-agent-child-runs.js";
|
|
94
95
|
export { type HostedChildLifecycleAdapter, type HostedChildLifecycleRunnerOptions, type HostedChildLifecycleRunResult, type HostedChildLifecycleTerminalState, runHostedChildLifecycle, } from "./hosted-child-lifecycle.js";
|
|
95
96
|
export { type HostedLifecycleAdapter, type HostedLifecycleExecution, type HostedLifecycleRunnerOptions, type HostedLifecycleRunResult, type HostedLifecycleTerminalState, runHostedLifecycle, } from "./hosted-lifecycle.js";
|
|
96
97
|
export { mergeToolCallInput, mergeToolInputDelta, parseDataStreamSseEvents, parseToolInputObject, streamDataStreamEvents, stripLeadingEmptyObjectPlaceholder, } from "./data-stream.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YA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B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
|
package/esm/src/agent/index.js
CHANGED
|
@@ -89,7 +89,8 @@ export { normalizeAgUiRuntimeMessages } from "./ag-ui-runtime-support.js";
|
|
|
89
89
|
export { buildAgUiBrowserFinalizeResponse, createAgUiBrowserEncoderState, finalizeAgUiBrowserEvents, mapRuntimeStreamEventToAgUiBrowserEvents, } from "./ag-ui-browser-encoder.js";
|
|
90
90
|
export { createAgUiBrowserResponseStream, } from "./ag-ui-browser-response-stream.js";
|
|
91
91
|
export { bootstrapConversationAgentRun, ConversationMessageRecordSchema, ConversationRecordSchema, createConversationMessage, createConversationRecord, ensureConversationProjectLink, fetchConversationRecord, } from "./conversation-bootstrap.js";
|
|
92
|
-
export { CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, ConversationRunTargetsSchema, createConversationAgentRun, finalizeConversationAgentRun, resolveConversationRunTargets, } from "./durable.js";
|
|
92
|
+
export { appendConversationRunEvents, AppendConversationRunEventsError, AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, ConversationRunStatusSchema, ConversationRunTargetsSchema, ConversationRunTerminalStateError, createConversationAgentRun, finalizeConversationAgentRun, getConversationRun, isActiveConversationRunStatus, isCursorMismatchConversationRunAppendError, isIgnorableConversationRunAppendError, monitorConversationRunStatus, parseAppendConversationRunEventsErrorBody, resolveConversationRunTargets, } from "./durable.js";
|
|
93
|
+
export { buildInvokeAgentChildRunLifecycleCustomEvent, buildInvokeAgentChildRunProgressEvents, buildInvokeAgentChildRunStateDelta, InvokeAgentChildRunLifecycleCustomEventSchema, InvokeAgentChildRunLifecycleValueSchema, InvokeAgentChildRunStateDeltaSchema, publishInvokeAgentChildRunProgress, } from "./invoke-agent-child-runs.js";
|
|
93
94
|
export { runHostedChildLifecycle, } from "./hosted-child-lifecycle.js";
|
|
94
95
|
export { runHostedLifecycle, } from "./hosted-lifecycle.js";
|
|
95
96
|
export { mergeToolCallInput, mergeToolInputDelta, parseDataStreamSseEvents, parseToolInputObject, streamDataStreamEvents, stripLeadingEmptyObjectPlaceholder, } from "./data-stream.js";
|