@vantageos/agent-engine 0.3.0-alpha.0 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/component/_generated/api.d.ts +26 -2
- package/dist/component/_generated/component.d.ts +19 -0
- package/dist/component/_generated/dataModel.d.ts +38 -0
- package/dist/component/_generated/server.d.ts +106 -0
- package/dist/component/engine/agents.d.ts +3 -3
- package/dist/component/engine/awaitEventTimeout.js +3 -5
- package/dist/component/engine/connections.d.ts +1 -1
- package/dist/component/engine/delegation.d.ts +4 -4
- package/dist/component/engine/durableJob.d.ts +3 -26
- package/dist/component/engine/durableJob.js +14 -217
- package/dist/component/engine/mandates.d.ts +2 -2
- package/dist/component/engine/resolvers.js +1 -1
- package/dist/component/engine/sandboxCallback.d.ts +1 -1
- package/dist/component/engine/sessions.js +10 -38
- package/dist/component/engine/streams.d.ts +1 -1
- package/dist/component/engine/wakeup.d.ts +2 -2
- package/dist/component/engine/workflows.d.ts +0 -24
- package/dist/component/engine/workflows.js +2 -66
- package/dist/component/engine/world.d.ts +31 -30
- package/dist/component/engine/world.js +60 -36
- package/dist/component/schema.d.ts +27 -112
- package/dist/component/schema.js +1 -48
- package/package.json +6 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DatabaseReader, type MutationCtx } from "../_generated/server.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Id } from "../_generated/dataModel.js";
|
|
3
3
|
declare function slotToEventId(seq: number): string;
|
|
4
4
|
export type AppendEventArgs = {
|
|
5
5
|
orgId: string;
|
|
@@ -24,7 +24,7 @@ export declare function appendEventCore(ctx: MutationCtx, args: AppendEventArgs)
|
|
|
24
24
|
};
|
|
25
25
|
run: {
|
|
26
26
|
runId: string;
|
|
27
|
-
status: "
|
|
27
|
+
status: "completed" | "failed" | "cancelled" | "running";
|
|
28
28
|
eventCount: number;
|
|
29
29
|
createdAt: number;
|
|
30
30
|
updatedAt: number;
|
|
@@ -32,7 +32,7 @@ export declare function appendEventCore(ctx: MutationCtx, args: AppendEventArgs)
|
|
|
32
32
|
step: {
|
|
33
33
|
runId: string;
|
|
34
34
|
stepId: string;
|
|
35
|
-
status: "
|
|
35
|
+
status: "completed" | "failed" | "running";
|
|
36
36
|
dataJson: string | undefined;
|
|
37
37
|
createdAt: number;
|
|
38
38
|
updatedAt: number;
|
|
@@ -68,7 +68,7 @@ export declare const appendEvent: import("convex/server").RegisteredMutation<"pu
|
|
|
68
68
|
};
|
|
69
69
|
run: {
|
|
70
70
|
runId: string;
|
|
71
|
-
status: "
|
|
71
|
+
status: "completed" | "failed" | "cancelled" | "running";
|
|
72
72
|
eventCount: number;
|
|
73
73
|
createdAt: number;
|
|
74
74
|
updatedAt: number;
|
|
@@ -76,7 +76,7 @@ export declare const appendEvent: import("convex/server").RegisteredMutation<"pu
|
|
|
76
76
|
step: {
|
|
77
77
|
runId: string;
|
|
78
78
|
stepId: string;
|
|
79
|
-
status: "
|
|
79
|
+
status: "completed" | "failed" | "running";
|
|
80
80
|
dataJson: string | undefined;
|
|
81
81
|
createdAt: number;
|
|
82
82
|
updatedAt: number;
|
|
@@ -90,40 +90,41 @@ export declare const appendEvent: import("convex/server").RegisteredMutation<"pu
|
|
|
90
90
|
updatedAt: number;
|
|
91
91
|
} | null;
|
|
92
92
|
}>>;
|
|
93
|
-
export declare
|
|
94
|
-
export declare
|
|
95
|
-
export
|
|
93
|
+
export declare const RUN_KIND_PREFIX = "run:";
|
|
94
|
+
export declare const LEGACY_KIND_PREFIX = "legacy:";
|
|
95
|
+
export type RunKind = "session" | "job";
|
|
96
|
+
export type RunStatus = "running" | "completed" | "failed" | "cancelled";
|
|
97
|
+
export declare function legacyCorrelationId(kind: RunKind, legacyId: string): string;
|
|
98
|
+
export declare function findRunIdByCorrelation(ctx: {
|
|
99
|
+
db: DatabaseReader;
|
|
100
|
+
}, orgId: string, correlationId: string): Promise<string | null>;
|
|
101
|
+
export declare function openRun(ctx: MutationCtx, args: {
|
|
96
102
|
orgId: string;
|
|
97
|
-
|
|
98
|
-
legacyId: string;
|
|
103
|
+
kind: RunKind;
|
|
99
104
|
data: Record<string, unknown>;
|
|
100
105
|
}): Promise<string>;
|
|
101
|
-
export declare
|
|
106
|
+
export declare const RUN_WORKFLOW_BOUND = "run_workflow_bound";
|
|
107
|
+
export declare function bindWorkflowToRun(ctx: MutationCtx, args: {
|
|
102
108
|
orgId: string;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
runId: string;
|
|
110
|
+
workflowId: string;
|
|
111
|
+
workflowVersion: string;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
export declare function workflowOfRun(ctx: {
|
|
114
|
+
db: DatabaseReader;
|
|
115
|
+
}, orgId: string, runId: string): Promise<{
|
|
116
|
+
workflowId: string;
|
|
117
|
+
workflowVersion: string;
|
|
118
|
+
} | null>;
|
|
111
119
|
export type LoadedRun = {
|
|
112
120
|
runId: string;
|
|
113
121
|
status: RunStatus;
|
|
114
122
|
eventCount: number;
|
|
115
|
-
legacyId: string | null;
|
|
116
123
|
created: Record<string, unknown>;
|
|
117
124
|
};
|
|
118
125
|
export declare function loadRun(ctx: {
|
|
119
126
|
db: DatabaseReader;
|
|
120
127
|
}, orgId: string, runId: string, kind: RunKind, notFoundMessage: string): Promise<LoadedRun>;
|
|
121
|
-
export declare function legacySessionOf(ctx: {
|
|
122
|
-
db: DatabaseReader;
|
|
123
|
-
}, run: LoadedRun, orgId: string): Promise<Doc<"sessions"> | null>;
|
|
124
|
-
export declare function legacyJobOf(ctx: {
|
|
125
|
-
db: DatabaseReader;
|
|
126
|
-
}, run: LoadedRun, orgId: string): Promise<Doc<"durableJobs"> | null>;
|
|
127
128
|
export declare function agentIdOfRun(ctx: {
|
|
128
129
|
db: DatabaseReader;
|
|
129
130
|
}, run: LoadedRun): Id<"agents">;
|
|
@@ -134,7 +135,7 @@ export declare const getRun: import("convex/server").RegisteredQuery<"public", {
|
|
|
134
135
|
runId: string;
|
|
135
136
|
}, Promise<{
|
|
136
137
|
runId: string;
|
|
137
|
-
status: "
|
|
138
|
+
status: "completed" | "failed" | "cancelled" | "running";
|
|
138
139
|
eventCount: number;
|
|
139
140
|
createdAt: number;
|
|
140
141
|
updatedAt: number;
|
|
@@ -143,7 +144,7 @@ export declare const listRuns: import("convex/server").RegisteredQuery<"public",
|
|
|
143
144
|
orgId: string;
|
|
144
145
|
}, Promise<{
|
|
145
146
|
runId: string;
|
|
146
|
-
status: "
|
|
147
|
+
status: "completed" | "failed" | "cancelled" | "running";
|
|
147
148
|
eventCount: number;
|
|
148
149
|
createdAt: number;
|
|
149
150
|
updatedAt: number;
|
|
@@ -155,7 +156,7 @@ export declare const getStep: import("convex/server").RegisteredQuery<"public",
|
|
|
155
156
|
}, Promise<{
|
|
156
157
|
runId: string;
|
|
157
158
|
stepId: string;
|
|
158
|
-
status: "
|
|
159
|
+
status: "completed" | "failed" | "running";
|
|
159
160
|
dataJson: string | undefined;
|
|
160
161
|
createdAt: number;
|
|
161
162
|
updatedAt: number;
|
|
@@ -166,7 +167,7 @@ export declare const listSteps: import("convex/server").RegisteredQuery<"public"
|
|
|
166
167
|
}, Promise<{
|
|
167
168
|
runId: string;
|
|
168
169
|
stepId: string;
|
|
169
|
-
status: "
|
|
170
|
+
status: "completed" | "failed" | "running";
|
|
170
171
|
dataJson: string | undefined;
|
|
171
172
|
createdAt: number;
|
|
172
173
|
updatedAt: number;
|
|
@@ -346,14 +346,30 @@ export const appendEvent = mutation({
|
|
|
346
346
|
hook: v.union(hookResult, v.null()),
|
|
347
347
|
}),
|
|
348
348
|
handler: async (ctx, args) => {
|
|
349
|
-
if (args.correlationId?.startsWith(
|
|
349
|
+
if (args.correlationId?.startsWith(RUN_KIND_PREFIX) ||
|
|
350
|
+
args.correlationId?.startsWith(LEGACY_KIND_PREFIX)) {
|
|
350
351
|
throw new Error("Validation: invalid correlationId");
|
|
351
352
|
}
|
|
353
|
+
if (args.eventType === RUN_WORKFLOW_BOUND) {
|
|
354
|
+
throw new Error("Validation: invalid eventType");
|
|
355
|
+
}
|
|
352
356
|
return appendEventCore(ctx, args);
|
|
353
357
|
},
|
|
354
358
|
});
|
|
355
|
-
export
|
|
356
|
-
|
|
359
|
+
export const RUN_KIND_PREFIX = "run:";
|
|
360
|
+
export const LEGACY_KIND_PREFIX = "legacy:";
|
|
361
|
+
const LEGACY_KIND_NAME = {
|
|
362
|
+
session: "sessions",
|
|
363
|
+
job: "durableJobs",
|
|
364
|
+
};
|
|
365
|
+
function runKindPrefix(kind) {
|
|
366
|
+
return `${RUN_KIND_PREFIX}${kind}:`;
|
|
367
|
+
}
|
|
368
|
+
function legacyKindPrefix(kind) {
|
|
369
|
+
return `${LEGACY_KIND_PREFIX}${LEGACY_KIND_NAME[kind]}:`;
|
|
370
|
+
}
|
|
371
|
+
export function legacyCorrelationId(kind, legacyId) {
|
|
372
|
+
return `${legacyKindPrefix(kind)}${legacyId}`;
|
|
357
373
|
}
|
|
358
374
|
export async function findRunIdByCorrelation(ctx, orgId, correlationId) {
|
|
359
375
|
const events = await ctx.db
|
|
@@ -362,28 +378,56 @@ export async function findRunIdByCorrelation(ctx, orgId, correlationId) {
|
|
|
362
378
|
.collect();
|
|
363
379
|
return events.find((e) => e.eventType === "run_created")?.runId ?? null;
|
|
364
380
|
}
|
|
365
|
-
export async function
|
|
381
|
+
export async function openRun(ctx, args) {
|
|
366
382
|
const result = await appendEventCore(ctx, {
|
|
367
383
|
orgId: args.orgId,
|
|
368
384
|
runId: null,
|
|
369
385
|
eventType: "run_created",
|
|
370
|
-
correlationId:
|
|
386
|
+
correlationId: `${runKindPrefix(args.kind)}${crypto.randomUUID()}`,
|
|
371
387
|
dataJson: JSON.stringify(args.data),
|
|
372
388
|
});
|
|
373
389
|
return result.event.runId;
|
|
374
390
|
}
|
|
375
|
-
export
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
391
|
+
export const RUN_WORKFLOW_BOUND = "run_workflow_bound";
|
|
392
|
+
function workflowCorrelationId(runId) {
|
|
393
|
+
return `workflow:${runId}`;
|
|
394
|
+
}
|
|
395
|
+
export async function bindWorkflowToRun(ctx, args) {
|
|
379
396
|
await appendEventCore(ctx, {
|
|
380
397
|
orgId: args.orgId,
|
|
381
|
-
runId,
|
|
382
|
-
eventType:
|
|
383
|
-
|
|
384
|
-
dataJson:
|
|
398
|
+
runId: args.runId,
|
|
399
|
+
eventType: RUN_WORKFLOW_BOUND,
|
|
400
|
+
correlationId: workflowCorrelationId(args.runId),
|
|
401
|
+
dataJson: JSON.stringify({
|
|
402
|
+
workflowId: args.workflowId,
|
|
403
|
+
workflowVersion: args.workflowVersion,
|
|
404
|
+
}),
|
|
385
405
|
});
|
|
386
|
-
|
|
406
|
+
}
|
|
407
|
+
export async function workflowOfRun(ctx, orgId, runId) {
|
|
408
|
+
const events = await ctx.db
|
|
409
|
+
.query("worldEvents")
|
|
410
|
+
.withIndex("by_org_correlation", (q) => q.eq("orgId", orgId).eq("correlationId", workflowCorrelationId(runId)))
|
|
411
|
+
.collect();
|
|
412
|
+
let latest = null;
|
|
413
|
+
for (const e of events) {
|
|
414
|
+
if (e.eventType !== RUN_WORKFLOW_BOUND || e.runId !== runId)
|
|
415
|
+
continue;
|
|
416
|
+
if (latest === null || e.seq > latest.seq)
|
|
417
|
+
latest = e;
|
|
418
|
+
}
|
|
419
|
+
if (latest === null)
|
|
420
|
+
return null;
|
|
421
|
+
try {
|
|
422
|
+
const data = JSON.parse(latest.dataJson);
|
|
423
|
+
if (typeof data.workflowId !== "string" || typeof data.workflowVersion !== "string") {
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
return { workflowId: data.workflowId, workflowVersion: data.workflowVersion };
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
387
431
|
}
|
|
388
432
|
export async function loadRun(ctx, orgId, runId, kind, notFoundMessage) {
|
|
389
433
|
const run = await ctx.db
|
|
@@ -395,11 +439,11 @@ export async function loadRun(ctx, orgId, runId, kind, notFoundMessage) {
|
|
|
395
439
|
.query("worldEvents")
|
|
396
440
|
.withIndex("by_org_run_seq", (q) => q.eq("orgId", orgId).eq("runId", runId).eq("seq", 1))
|
|
397
441
|
.unique();
|
|
398
|
-
const prefix = `legacy:${kind}:`;
|
|
399
442
|
if (!first ||
|
|
400
443
|
first.eventType !== "run_created" ||
|
|
401
444
|
first.correlationId === undefined ||
|
|
402
|
-
!first.correlationId.startsWith(
|
|
445
|
+
!(first.correlationId.startsWith(runKindPrefix(kind)) ||
|
|
446
|
+
first.correlationId.startsWith(legacyKindPrefix(kind)))) {
|
|
403
447
|
throw new Error(notFoundMessage);
|
|
404
448
|
}
|
|
405
449
|
let created = {};
|
|
@@ -412,33 +456,13 @@ export async function loadRun(ctx, orgId, runId, kind, notFoundMessage) {
|
|
|
412
456
|
catch {
|
|
413
457
|
created = {};
|
|
414
458
|
}
|
|
415
|
-
const legacyId = first.correlationId.slice(prefix.length);
|
|
416
459
|
return {
|
|
417
460
|
runId: run.runId,
|
|
418
461
|
status: run.status,
|
|
419
462
|
eventCount: run.eventCount,
|
|
420
|
-
legacyId: legacyId.length > 0 ? legacyId : null,
|
|
421
463
|
created,
|
|
422
464
|
};
|
|
423
465
|
}
|
|
424
|
-
export async function legacySessionOf(ctx, run, orgId) {
|
|
425
|
-
if (run.legacyId === null)
|
|
426
|
-
return null;
|
|
427
|
-
const id = ctx.db.normalizeId("sessions", run.legacyId);
|
|
428
|
-
if (id === null)
|
|
429
|
-
return null;
|
|
430
|
-
const doc = await ctx.db.get(id);
|
|
431
|
-
return doc !== null && doc.orgId === orgId ? doc : null;
|
|
432
|
-
}
|
|
433
|
-
export async function legacyJobOf(ctx, run, orgId) {
|
|
434
|
-
if (run.legacyId === null)
|
|
435
|
-
return null;
|
|
436
|
-
const id = ctx.db.normalizeId("durableJobs", run.legacyId);
|
|
437
|
-
if (id === null)
|
|
438
|
-
return null;
|
|
439
|
-
const doc = await ctx.db.get(id);
|
|
440
|
-
return doc !== null && doc.orgId === orgId ? doc : null;
|
|
441
|
-
}
|
|
442
466
|
export function agentIdOfRun(ctx, run) {
|
|
443
467
|
const raw = run.created.agentId;
|
|
444
468
|
const id = typeof raw === "string" ? ctx.db.normalizeId("agents", raw) : null;
|
|
@@ -1,50 +1,4 @@
|
|
|
1
1
|
declare const _default: import("convex/server").SchemaDefinition<{
|
|
2
|
-
durableJobs: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
|
-
workflowId?: string | undefined;
|
|
4
|
-
lastError?: string | undefined;
|
|
5
|
-
abandonedAtStep?: number | undefined;
|
|
6
|
-
orgId: string;
|
|
7
|
-
stepFunctionHandle: string;
|
|
8
|
-
totalSteps: number;
|
|
9
|
-
maxAttemptsPerStep: number;
|
|
10
|
-
cursor: number;
|
|
11
|
-
status: "running" | "completed" | "abandoned" | "cancelled";
|
|
12
|
-
workflowVersion: string;
|
|
13
|
-
createdAt: number;
|
|
14
|
-
updatedAt: number;
|
|
15
|
-
kind: string;
|
|
16
|
-
}, {
|
|
17
|
-
orgId: import("convex/values").VString<string, "required">;
|
|
18
|
-
kind: import("convex/values").VString<string, "required">;
|
|
19
|
-
stepFunctionHandle: import("convex/values").VString<string, "required">;
|
|
20
|
-
totalSteps: import("convex/values").VFloat64<number, "required">;
|
|
21
|
-
maxAttemptsPerStep: import("convex/values").VFloat64<number, "required">;
|
|
22
|
-
cursor: import("convex/values").VFloat64<number, "required">;
|
|
23
|
-
status: import("convex/values").VUnion<"running" | "completed" | "abandoned" | "cancelled", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"abandoned", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
|
|
24
|
-
workflowId: import("convex/values").VString<string | undefined, "optional">;
|
|
25
|
-
workflowVersion: import("convex/values").VString<string, "required">;
|
|
26
|
-
lastError: import("convex/values").VString<string | undefined, "optional">;
|
|
27
|
-
abandonedAtStep: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
28
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
29
|
-
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
30
|
-
}, "required", "orgId" | "stepFunctionHandle" | "totalSteps" | "maxAttemptsPerStep" | "cursor" | "status" | "workflowId" | "workflowVersion" | "lastError" | "abandonedAtStep" | "createdAt" | "updatedAt" | "kind">, {
|
|
31
|
-
by_org: ["orgId", "_creationTime"];
|
|
32
|
-
by_org_status: ["orgId", "status", "_creationTime"];
|
|
33
|
-
}, {}, {}>;
|
|
34
|
-
callerStepInvocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
35
|
-
orgId: string;
|
|
36
|
-
createdAt: number;
|
|
37
|
-
jobId: import("convex/values").GenericId<"durableJobs">;
|
|
38
|
-
stepIndex: number;
|
|
39
|
-
}, {
|
|
40
|
-
orgId: import("convex/values").VString<string, "required">;
|
|
41
|
-
jobId: import("convex/values").VId<import("convex/values").GenericId<"durableJobs">, "required">;
|
|
42
|
-
stepIndex: import("convex/values").VFloat64<number, "required">;
|
|
43
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
44
|
-
}, "required", "orgId" | "createdAt" | "jobId" | "stepIndex">, {
|
|
45
|
-
by_org: ["orgId", "_creationTime"];
|
|
46
|
-
by_org_job: ["orgId", "jobId", "_creationTime"];
|
|
47
|
-
}, {}, {}>;
|
|
48
2
|
agents: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
49
3
|
description?: string | undefined;
|
|
50
4
|
reasoningEffort?: "none" | "low" | "medium" | "high" | undefined;
|
|
@@ -53,12 +7,12 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
53
7
|
maxInputTokensPerSession?: number | false | undefined;
|
|
54
8
|
name: string;
|
|
55
9
|
orgId: string;
|
|
56
|
-
status: "draft" | "live" | "archived";
|
|
57
|
-
createdAt: number;
|
|
58
|
-
updatedAt: number;
|
|
59
10
|
instructions: string;
|
|
60
11
|
model: string;
|
|
12
|
+
status: "draft" | "live" | "archived";
|
|
61
13
|
createdBy: string;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
updatedAt: number;
|
|
62
16
|
}, {
|
|
63
17
|
orgId: import("convex/values").VString<string, "required">;
|
|
64
18
|
name: import("convex/values").VString<string, "required">;
|
|
@@ -73,7 +27,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
73
27
|
createdBy: import("convex/values").VString<string, "required">;
|
|
74
28
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
75
29
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
76
|
-
}, "required", "description" | "name" | "orgId" | "
|
|
30
|
+
}, "required", "description" | "name" | "orgId" | "instructions" | "model" | "reasoningEffort" | "modelProvider" | "maxSubagents" | "maxInputTokensPerSession" | "status" | "createdBy" | "createdAt" | "updatedAt">, {
|
|
77
31
|
by_org: ["orgId", "_creationTime"];
|
|
78
32
|
by_org_status: ["orgId", "status", "_creationTime"];
|
|
79
33
|
}, {}, {}>;
|
|
@@ -96,47 +50,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
96
50
|
by_org_agent: ["orgId", "agentId", "_creationTime"];
|
|
97
51
|
by_org_agent_tool: ["orgId", "agentId", "toolName", "_creationTime"];
|
|
98
52
|
}, {}, {}>;
|
|
99
|
-
sessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
100
|
-
workflowId?: string | undefined;
|
|
101
|
-
workflowVersion?: string | undefined;
|
|
102
|
-
orgId: string;
|
|
103
|
-
status: "running" | "completed" | "cancelled";
|
|
104
|
-
createdAt: number;
|
|
105
|
-
updatedAt: number;
|
|
106
|
-
createdBy: string;
|
|
107
|
-
agentId: import("convex/values").GenericId<"agents">;
|
|
108
|
-
}, {
|
|
109
|
-
orgId: import("convex/values").VString<string, "required">;
|
|
110
|
-
agentId: import("convex/values").VId<import("convex/values").GenericId<"agents">, "required">;
|
|
111
|
-
status: import("convex/values").VUnion<"running" | "completed" | "cancelled", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
|
|
112
|
-
createdBy: import("convex/values").VString<string, "required">;
|
|
113
|
-
workflowId: import("convex/values").VString<string | undefined, "optional">;
|
|
114
|
-
workflowVersion: import("convex/values").VString<string | undefined, "optional">;
|
|
115
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
116
|
-
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
117
|
-
}, "required", "orgId" | "status" | "workflowId" | "workflowVersion" | "createdAt" | "updatedAt" | "createdBy" | "agentId">, {
|
|
118
|
-
by_org: ["orgId", "_creationTime"];
|
|
119
|
-
by_org_agent: ["orgId", "agentId", "_creationTime"];
|
|
120
|
-
}, {}, {}>;
|
|
121
|
-
sessionEvents: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
122
|
-
payload?: string | undefined;
|
|
123
|
-
name: "session.started" | "turn.started" | "turn.reasoning" | "turn.toolCall.requested" | "turn.toolCall.completed" | "turn.toolCall.denied" | "turn.completed" | "tool.approval.requested" | "tool.approval.resolved" | "sandbox.timeout";
|
|
124
|
-
orgId: string;
|
|
125
|
-
createdAt: number;
|
|
126
|
-
sessionId: import("convex/values").GenericId<"sessions">;
|
|
127
|
-
}, {
|
|
128
|
-
orgId: import("convex/values").VString<string, "required">;
|
|
129
|
-
sessionId: import("convex/values").VId<import("convex/values").GenericId<"sessions">, "required">;
|
|
130
|
-
name: import("convex/values").VUnion<"session.started" | "turn.started" | "turn.reasoning" | "turn.toolCall.requested" | "turn.toolCall.completed" | "turn.toolCall.denied" | "turn.completed" | "tool.approval.requested" | "tool.approval.resolved" | "sandbox.timeout", [import("convex/values").VLiteral<"session.started", "required">, import("convex/values").VLiteral<"turn.started", "required">, import("convex/values").VLiteral<"turn.reasoning", "required">, import("convex/values").VLiteral<"turn.toolCall.requested", "required">, import("convex/values").VLiteral<"turn.toolCall.completed", "required">, import("convex/values").VLiteral<"turn.toolCall.denied", "required">, import("convex/values").VLiteral<"turn.completed", "required">, import("convex/values").VLiteral<"tool.approval.requested", "required">, import("convex/values").VLiteral<"tool.approval.resolved", "required">, import("convex/values").VLiteral<"sandbox.timeout", "required">], "required", never>;
|
|
131
|
-
payload: import("convex/values").VString<string | undefined, "optional">;
|
|
132
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
133
|
-
}, "required", "name" | "orgId" | "createdAt" | "sessionId" | "payload">, {
|
|
134
|
-
by_org: ["orgId", "_creationTime"];
|
|
135
|
-
by_org_session: ["orgId", "sessionId", "_creationTime"];
|
|
136
|
-
}, {}, {}>;
|
|
137
53
|
awaitEventTimeouts: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
138
|
-
sessionId?: import("convex/values").GenericId<"sessions"> | undefined;
|
|
139
54
|
runId?: string | undefined;
|
|
55
|
+
sessionId?: string | undefined;
|
|
140
56
|
scheduledFunctionId?: import("convex/values").GenericId<"_scheduled_functions"> | undefined;
|
|
141
57
|
firedAt?: number | undefined;
|
|
142
58
|
cancelledAt?: number | undefined;
|
|
@@ -146,20 +62,19 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
146
62
|
}, {
|
|
147
63
|
orgId: import("convex/values").VString<string, "required">;
|
|
148
64
|
runId: import("convex/values").VString<string | undefined, "optional">;
|
|
149
|
-
sessionId: import("convex/values").
|
|
65
|
+
sessionId: import("convex/values").VString<string | undefined, "optional">;
|
|
150
66
|
awaitedEventName: import("convex/values").VString<string, "required">;
|
|
151
67
|
deadlineAt: import("convex/values").VFloat64<number, "required">;
|
|
152
68
|
scheduledFunctionId: import("convex/values").VId<import("convex/values").GenericId<"_scheduled_functions"> | undefined, "optional">;
|
|
153
69
|
firedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
154
70
|
cancelledAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
155
|
-
}, "required", "orgId" | "
|
|
71
|
+
}, "required", "orgId" | "runId" | "sessionId" | "awaitedEventName" | "deadlineAt" | "scheduledFunctionId" | "firedAt" | "cancelledAt">, {
|
|
156
72
|
by_org: ["orgId", "_creationTime"];
|
|
157
|
-
by_org_session: ["orgId", "sessionId", "_creationTime"];
|
|
158
73
|
by_org_run: ["orgId", "runId", "_creationTime"];
|
|
159
74
|
}, {}, {}>;
|
|
160
75
|
wakeupDemoResults: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
161
76
|
wokenAt?: number | undefined;
|
|
162
|
-
observedStatus?: "completed" | "
|
|
77
|
+
observedStatus?: "completed" | "failed" | "cancelled" | undefined;
|
|
163
78
|
observedResultSummary?: string | undefined;
|
|
164
79
|
orgId: string;
|
|
165
80
|
enqueuedAt: number;
|
|
@@ -167,7 +82,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
167
82
|
orgId: import("convex/values").VString<string, "required">;
|
|
168
83
|
enqueuedAt: import("convex/values").VFloat64<number, "required">;
|
|
169
84
|
wokenAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
170
|
-
observedStatus: import("convex/values").VUnion<"completed" | "
|
|
85
|
+
observedStatus: import("convex/values").VUnion<"completed" | "failed" | "cancelled" | undefined, [import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "optional", never>;
|
|
171
86
|
observedResultSummary: import("convex/values").VString<string | undefined, "optional">;
|
|
172
87
|
}, "required", "orgId" | "enqueuedAt" | "wokenAt" | "observedStatus" | "observedResultSummary">, {
|
|
173
88
|
by_org: ["orgId", "_creationTime"];
|
|
@@ -177,11 +92,11 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
177
92
|
orgId: string;
|
|
178
93
|
createdAt: number;
|
|
179
94
|
updatedAt: number;
|
|
180
|
-
kind: "token bucket" | "fixed window";
|
|
181
95
|
agentId: import("convex/values").GenericId<"agents">;
|
|
182
96
|
scope: string;
|
|
183
97
|
rate: number;
|
|
184
98
|
period: number;
|
|
99
|
+
kind: "token bucket" | "fixed window";
|
|
185
100
|
}, {
|
|
186
101
|
orgId: import("convex/values").VString<string, "required">;
|
|
187
102
|
agentId: import("convex/values").VId<import("convex/values").GenericId<"agents">, "required">;
|
|
@@ -192,7 +107,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
192
107
|
capacity: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
193
108
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
194
109
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
195
|
-
}, "required", "orgId" | "createdAt" | "updatedAt" | "
|
|
110
|
+
}, "required", "orgId" | "createdAt" | "updatedAt" | "agentId" | "scope" | "rate" | "period" | "capacity" | "kind">, {
|
|
196
111
|
by_org: ["orgId", "_creationTime"];
|
|
197
112
|
by_org_agent: ["orgId", "agentId", "_creationTime"];
|
|
198
113
|
by_org_agent_scope: ["orgId", "agentId", "scope", "_creationTime"];
|
|
@@ -252,10 +167,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
252
167
|
resultSummary?: string | undefined;
|
|
253
168
|
orgId: string;
|
|
254
169
|
status: "completed" | "failed" | "pending" | "timedOut";
|
|
255
|
-
workflowId: string;
|
|
256
170
|
createdAt: number;
|
|
257
171
|
updatedAt: number;
|
|
258
172
|
awaitedEventName: string;
|
|
173
|
+
workflowId: string;
|
|
259
174
|
sandboxId: string;
|
|
260
175
|
}, {
|
|
261
176
|
orgId: import("convex/values").VString<string, "required">;
|
|
@@ -266,7 +181,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
266
181
|
resultSummary: import("convex/values").VString<string | undefined, "optional">;
|
|
267
182
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
268
183
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
269
|
-
}, "required", "orgId" | "status" | "
|
|
184
|
+
}, "required", "orgId" | "status" | "createdAt" | "updatedAt" | "awaitedEventName" | "workflowId" | "sandboxId" | "resultSummary">, {
|
|
270
185
|
by_org: ["orgId", "_creationTime"];
|
|
271
186
|
by_org_workflow: ["orgId", "workflowId", "_creationTime"];
|
|
272
187
|
by_org_sandbox: ["orgId", "sandboxId", "_creationTime"];
|
|
@@ -328,12 +243,12 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
328
243
|
delegationRuns: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
329
244
|
resultSummary?: string | undefined;
|
|
330
245
|
orgId: string;
|
|
331
|
-
status: "completed" | "
|
|
332
|
-
workflowId: string;
|
|
246
|
+
status: "completed" | "failed" | "cancelled" | "pending";
|
|
333
247
|
createdAt: number;
|
|
334
248
|
updatedAt: number;
|
|
335
249
|
toolName: string;
|
|
336
250
|
awaitedEventName: string;
|
|
251
|
+
workflowId: string;
|
|
337
252
|
parentAgentId: import("convex/values").GenericId<"agents">;
|
|
338
253
|
childAgentId: import("convex/values").GenericId<"agents">;
|
|
339
254
|
}, {
|
|
@@ -343,11 +258,11 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
343
258
|
toolName: import("convex/values").VString<string, "required">;
|
|
344
259
|
workflowId: import("convex/values").VString<string, "required">;
|
|
345
260
|
awaitedEventName: import("convex/values").VString<string, "required">;
|
|
346
|
-
status: import("convex/values").VUnion<"completed" | "
|
|
261
|
+
status: import("convex/values").VUnion<"completed" | "failed" | "cancelled" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
|
|
347
262
|
resultSummary: import("convex/values").VString<string | undefined, "optional">;
|
|
348
263
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
349
264
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
350
|
-
}, "required", "orgId" | "status" | "
|
|
265
|
+
}, "required", "orgId" | "status" | "createdAt" | "updatedAt" | "toolName" | "awaitedEventName" | "workflowId" | "resultSummary" | "parentAgentId" | "childAgentId">, {
|
|
351
266
|
by_org: ["orgId", "_creationTime"];
|
|
352
267
|
by_org_parent: ["orgId", "parentAgentId", "_creationTime"];
|
|
353
268
|
by_org_workflow: ["orgId", "workflowId", "_creationTime"];
|
|
@@ -356,22 +271,22 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
356
271
|
agentCloneRuns: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
357
272
|
resultSummary?: string | undefined;
|
|
358
273
|
orgId: string;
|
|
359
|
-
status: "completed" | "
|
|
360
|
-
workflowId: string;
|
|
274
|
+
status: "completed" | "failed" | "cancelled" | "pending";
|
|
361
275
|
createdAt: number;
|
|
362
276
|
updatedAt: number;
|
|
363
277
|
agentId: import("convex/values").GenericId<"agents">;
|
|
364
278
|
awaitedEventName: string;
|
|
279
|
+
workflowId: string;
|
|
365
280
|
}, {
|
|
366
281
|
orgId: import("convex/values").VString<string, "required">;
|
|
367
282
|
agentId: import("convex/values").VId<import("convex/values").GenericId<"agents">, "required">;
|
|
368
283
|
workflowId: import("convex/values").VString<string, "required">;
|
|
369
284
|
awaitedEventName: import("convex/values").VString<string, "required">;
|
|
370
|
-
status: import("convex/values").VUnion<"completed" | "
|
|
285
|
+
status: import("convex/values").VUnion<"completed" | "failed" | "cancelled" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
|
|
371
286
|
resultSummary: import("convex/values").VString<string | undefined, "optional">;
|
|
372
287
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
373
288
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
374
|
-
}, "required", "orgId" | "status" | "
|
|
289
|
+
}, "required", "orgId" | "status" | "createdAt" | "updatedAt" | "agentId" | "awaitedEventName" | "workflowId" | "resultSummary">, {
|
|
375
290
|
by_org: ["orgId", "_creationTime"];
|
|
376
291
|
by_org_agent: ["orgId", "agentId", "_creationTime"];
|
|
377
292
|
}, {}, {}>;
|
|
@@ -444,10 +359,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
444
359
|
resultSummary?: string | undefined;
|
|
445
360
|
orgId: string;
|
|
446
361
|
status: "pending" | "denied" | "authorized";
|
|
447
|
-
workflowId: string;
|
|
448
362
|
createdAt: number;
|
|
449
363
|
updatedAt: number;
|
|
450
364
|
awaitedEventName: string;
|
|
365
|
+
workflowId: string;
|
|
451
366
|
connectionId: import("convex/values").GenericId<"connections">;
|
|
452
367
|
url: string;
|
|
453
368
|
userCode: string;
|
|
@@ -463,7 +378,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
463
378
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
464
379
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
465
380
|
resolvedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
466
|
-
}, "required", "orgId" | "status" | "
|
|
381
|
+
}, "required", "orgId" | "status" | "createdAt" | "updatedAt" | "awaitedEventName" | "resolvedAt" | "workflowId" | "resultSummary" | "connectionId" | "url" | "userCode">, {
|
|
467
382
|
by_org: ["orgId", "_creationTime"];
|
|
468
383
|
by_org_connection: ["orgId", "connectionId", "_creationTime"];
|
|
469
384
|
}, {}, {}>;
|
|
@@ -482,7 +397,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
482
397
|
}, {}, {}>;
|
|
483
398
|
worldRuns: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
484
399
|
orgId: string;
|
|
485
|
-
status: "
|
|
400
|
+
status: "completed" | "failed" | "cancelled" | "running";
|
|
486
401
|
createdAt: number;
|
|
487
402
|
updatedAt: number;
|
|
488
403
|
runId: string;
|
|
@@ -490,7 +405,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
490
405
|
}, {
|
|
491
406
|
orgId: import("convex/values").VString<string, "required">;
|
|
492
407
|
runId: import("convex/values").VString<string, "required">;
|
|
493
|
-
status: import("convex/values").VUnion<"
|
|
408
|
+
status: import("convex/values").VUnion<"completed" | "failed" | "cancelled" | "running", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
|
|
494
409
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
495
410
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
496
411
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
@@ -501,7 +416,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
501
416
|
worldSteps: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
502
417
|
dataJson?: string | undefined;
|
|
503
418
|
orgId: string;
|
|
504
|
-
status: "
|
|
419
|
+
status: "completed" | "failed" | "running";
|
|
505
420
|
createdAt: number;
|
|
506
421
|
updatedAt: number;
|
|
507
422
|
runId: string;
|
|
@@ -510,7 +425,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
510
425
|
orgId: import("convex/values").VString<string, "required">;
|
|
511
426
|
runId: import("convex/values").VString<string, "required">;
|
|
512
427
|
stepId: import("convex/values").VString<string, "required">;
|
|
513
|
-
status: import("convex/values").VUnion<"
|
|
428
|
+
status: import("convex/values").VUnion<"completed" | "failed" | "running", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
|
|
514
429
|
dataJson: import("convex/values").VString<string | undefined, "optional">;
|
|
515
430
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
516
431
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|