@vantageos/agent-engine 0.1.0-alpha.8 → 0.3.0-alpha.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.
Files changed (62) hide show
  1. package/README.md +33 -8
  2. package/dist/component/_generated/api.d.ts +14 -27
  3. package/dist/component/_generated/api.js +0 -25
  4. package/dist/component/_generated/component.d.ts +369 -92
  5. package/dist/component/_generated/component.js +0 -9
  6. package/dist/component/_generated/dataModel.d.ts +0 -38
  7. package/dist/component/_generated/dataModel.js +0 -9
  8. package/dist/component/_generated/server.d.ts +0 -106
  9. package/dist/component/_generated/server.js +0 -69
  10. package/dist/component/convex.config.js +0 -44
  11. package/dist/component/engine/agents.js +0 -7
  12. package/dist/component/engine/awaitEventTimeout.d.ts +1 -1
  13. package/dist/component/engine/awaitEventTimeout.js +18 -26
  14. package/dist/component/engine/connections.d.ts +74 -0
  15. package/dist/component/engine/connections.js +254 -0
  16. package/dist/component/engine/delegation.d.ts +1 -1
  17. package/dist/component/engine/delegation.js +0 -74
  18. package/dist/component/engine/directory.js +0 -18
  19. package/dist/component/engine/durableJob.d.ts +34 -4
  20. package/dist/component/engine/durableJob.js +333 -86
  21. package/dist/component/engine/mandates.js +0 -59
  22. package/dist/component/engine/queue.d.ts +97 -0
  23. package/dist/component/engine/queue.js +201 -0
  24. package/dist/component/engine/resolvers.d.ts +1 -1
  25. package/dist/component/engine/resolvers.js +6 -18
  26. package/dist/component/engine/sandboxCallback.d.ts +1 -1
  27. package/dist/component/engine/sandboxCallback.js +2 -79
  28. package/dist/component/engine/sandboxConfigProvider.d.ts +9 -0
  29. package/dist/component/engine/sandboxConfigProvider.js +32 -0
  30. package/dist/component/engine/sessions.d.ts +28 -10
  31. package/dist/component/engine/sessions.js +153 -165
  32. package/dist/component/engine/streams.d.ts +47 -0
  33. package/dist/component/engine/streams.js +162 -0
  34. package/dist/component/engine/toolApprovals.d.ts +1 -1
  35. package/dist/component/engine/toolApprovals.js +12 -37
  36. package/dist/component/engine/vpConnection.js +0 -40
  37. package/dist/component/engine/wakeup.d.ts +5 -7
  38. package/dist/component/engine/wakeup.js +54 -127
  39. package/dist/component/engine/workflows.d.ts +42 -0
  40. package/dist/component/engine/workflows.js +100 -41
  41. package/dist/component/engine/world.d.ts +249 -0
  42. package/dist/component/engine/world.js +665 -0
  43. package/dist/component/lib/auth.js +0 -26
  44. package/dist/component/lib/connectionSecret.d.ts +5 -0
  45. package/dist/component/lib/connectionSecret.js +32 -0
  46. package/dist/component/schema.d.ts +227 -77
  47. package/dist/component/schema.js +137 -250
  48. package/package.json +17 -3
  49. package/dist/component/engine/habits.d.ts +0 -70
  50. package/dist/component/engine/habits.js +0 -218
  51. package/dist/component/testFixtures/callerSteps.d.ts +0 -20
  52. package/dist/component/testFixtures/callerSteps.js +0 -90
  53. package/dist/component/testFixtures/delegationDemoWorkflow.d.ts +0 -18
  54. package/dist/component/testFixtures/delegationDemoWorkflow.js +0 -75
  55. package/dist/component/testFixtures/sandboxDemoWorkflow.d.ts +0 -19
  56. package/dist/component/testFixtures/sandboxDemoWorkflow.js +0 -69
  57. package/dist/component/testFixtures/vpTool.d.ts +0 -4
  58. package/dist/component/testFixtures/vpTool.js +0 -25
  59. package/dist/component/testFixtures/wakeupDemoWorkflow.d.ts +0 -19
  60. package/dist/component/testFixtures/wakeupDemoWorkflow.js +0 -77
  61. package/dist/component/testFixtures/wakeupWork.d.ts +0 -8
  62. package/dist/component/testFixtures/wakeupWork.js +0 -21
@@ -1,23 +1,4 @@
1
- /**
2
- * Generated `ComponentApi` utility.
3
- *
4
- * THIS CODE IS AUTOMATICALLY GENERATED.
5
- *
6
- * To regenerate, run `npx convex dev`.
7
- * @module
8
- */
9
1
  import type { FunctionReference } from "convex/server";
10
- /**
11
- * A utility for referencing a Convex component's exposed API.
12
- *
13
- * Useful when expecting a parameter like `components.myComponent`.
14
- * Usage:
15
- * ```ts
16
- * async function myFunction(ctx: QueryCtx, component: ComponentApi) {
17
- * return ctx.runQuery(component.someFile.someQuery, { ...args });
18
- * }
19
- * ```
20
- */
21
2
  export type ComponentApi<Name extends string | undefined = string | undefined> = {
22
3
  engine: {
23
4
  agents: {
@@ -66,6 +47,81 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
66
47
  timeoutMs: number;
67
48
  }, string, Name>;
68
49
  };
50
+ connections: {
51
+ completeAuthorization: FunctionReference<"mutation", "internal", {
52
+ connectionAuthorizationId: string;
53
+ encryptionKeyBase64?: string;
54
+ orgId: string;
55
+ outcome: "authorized" | "denied";
56
+ resultSummary?: string;
57
+ secretPlaintext?: string;
58
+ }, {
59
+ outcome: "woke" | "already-resolved";
60
+ }, Name>;
61
+ create: FunctionReference<"mutation", "internal", {
62
+ agentId: string;
63
+ authMode: "app-token" | "user-oauth" | "none" | "header";
64
+ encryptionKeyBase64?: string;
65
+ name: string;
66
+ orgId: string;
67
+ secretPlaintext?: string;
68
+ serverConfig: string;
69
+ type: "mcp" | "openapi";
70
+ }, string, Name>;
71
+ get: FunctionReference<"query", "internal", {
72
+ connectionId: string;
73
+ orgId: string;
74
+ }, {
75
+ _creationTime: number;
76
+ _id: string;
77
+ agentId: string;
78
+ authMode: "app-token" | "user-oauth" | "none" | "header";
79
+ createdAt: number;
80
+ hasSecret: boolean;
81
+ name: string;
82
+ orgId: string;
83
+ principalType: "app" | "user";
84
+ serverConfig: string;
85
+ status: "active" | "pending_authorization" | "error";
86
+ type: "mcp" | "openapi";
87
+ updatedAt: number;
88
+ }, Name>;
89
+ getAuthorizationStatus: FunctionReference<"query", "internal", {
90
+ connectionAuthorizationId: string;
91
+ orgId: string;
92
+ }, {
93
+ resultSummary?: string;
94
+ status: "pending" | "authorized" | "denied";
95
+ url: string;
96
+ userCode: string;
97
+ }, Name>;
98
+ listByAgent: FunctionReference<"query", "internal", {
99
+ agentId: string;
100
+ orgId: string;
101
+ }, Array<{
102
+ _creationTime: number;
103
+ _id: string;
104
+ agentId: string;
105
+ authMode: "app-token" | "user-oauth" | "none" | "header";
106
+ createdAt: number;
107
+ hasSecret: boolean;
108
+ name: string;
109
+ orgId: string;
110
+ principalType: "app" | "user";
111
+ serverConfig: string;
112
+ status: "active" | "pending_authorization" | "error";
113
+ type: "mcp" | "openapi";
114
+ updatedAt: number;
115
+ }>, Name>;
116
+ requestAuthorization: FunctionReference<"mutation", "internal", {
117
+ awaitedEventName: string;
118
+ connectionId: string;
119
+ orgId: string;
120
+ url: string;
121
+ userCode: string;
122
+ workflowId: string;
123
+ }, string, Name>;
124
+ };
69
125
  delegation: {
70
126
  declareSubagent: FunctionReference<"mutation", "internal", {
71
127
  childAgentId: string;
@@ -146,75 +202,6 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
146
202
  totalSteps: number;
147
203
  }, string, Name>;
148
204
  };
149
- habits: {
150
- create: FunctionReference<"mutation", "internal", {
151
- agentId: string;
152
- cronExpression: string;
153
- name: string;
154
- orgId: string;
155
- prompt: string;
156
- }, string, Name>;
157
- disable: FunctionReference<"mutation", "internal", {
158
- habitId: string;
159
- orgId: string;
160
- }, null, Name>;
161
- enable: FunctionReference<"mutation", "internal", {
162
- habitId: string;
163
- orgId: string;
164
- }, null, Name>;
165
- get: FunctionReference<"query", "internal", {
166
- habitId: string;
167
- orgId: string;
168
- }, {
169
- _creationTime: number;
170
- _id: string;
171
- agentId: string;
172
- createdAt: number;
173
- cronExpression: string;
174
- cronJobId?: string;
175
- enabled: boolean;
176
- lastRunAt?: number;
177
- name: string;
178
- orgId: string;
179
- prompt: string;
180
- updatedAt: number;
181
- } | null, Name>;
182
- listForAgent: FunctionReference<"query", "internal", {
183
- agentId: string;
184
- orgId: string;
185
- }, Array<{
186
- _creationTime: number;
187
- _id: string;
188
- agentId: string;
189
- createdAt: number;
190
- cronExpression: string;
191
- cronJobId?: string;
192
- enabled: boolean;
193
- lastRunAt?: number;
194
- name: string;
195
- orgId: string;
196
- prompt: string;
197
- updatedAt: number;
198
- }>, Name>;
199
- listRuns: FunctionReference<"query", "internal", {
200
- habitId: string;
201
- orgId: string;
202
- }, Array<{
203
- _creationTime: number;
204
- _id: string;
205
- agentId: string;
206
- habitId: string;
207
- orgId: string;
208
- ranAt: number;
209
- }>, Name>;
210
- updateSchedule: FunctionReference<"mutation", "internal", {
211
- cronExpression?: string;
212
- habitId: string;
213
- name?: string;
214
- orgId: string;
215
- prompt?: string;
216
- }, null, Name>;
217
- };
218
205
  mandates: {
219
206
  get: FunctionReference<"query", "internal", {
220
207
  agentId: string;
@@ -280,6 +267,68 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
280
267
  scope: string;
281
268
  }, number, Name>;
282
269
  };
270
+ queue: {
271
+ claimNextForDelivery: FunctionReference<"mutation", "internal", {
272
+ orgId: string;
273
+ queueNamePrefix: string;
274
+ }, {
275
+ attempt: number;
276
+ createdAt: number;
277
+ deliverAt: number;
278
+ idempotencyKey?: string;
279
+ messageId: string;
280
+ payloadJson: string;
281
+ queueName: string;
282
+ status: "pending" | "claimed" | "delivered" | "failed";
283
+ updatedAt: number;
284
+ } | null, Name>;
285
+ enqueue: FunctionReference<"mutation", "internal", {
286
+ delaySeconds?: number;
287
+ idempotencyKey?: string;
288
+ orgId: string;
289
+ payloadJson: string;
290
+ queueName: string;
291
+ }, {
292
+ messageId: string;
293
+ }, Name>;
294
+ getMessage: FunctionReference<"query", "internal", {
295
+ messageId: string;
296
+ orgId: string;
297
+ }, {
298
+ attempt: number;
299
+ createdAt: number;
300
+ deliverAt: number;
301
+ idempotencyKey?: string;
302
+ messageId: string;
303
+ payloadJson: string;
304
+ queueName: string;
305
+ status: "pending" | "claimed" | "delivered" | "failed";
306
+ updatedAt: number;
307
+ } | null, Name>;
308
+ listPending: FunctionReference<"query", "internal", {
309
+ orgId: string;
310
+ queueNamePrefix: string;
311
+ }, Array<{
312
+ attempt: number;
313
+ createdAt: number;
314
+ deliverAt: number;
315
+ idempotencyKey?: string;
316
+ messageId: string;
317
+ payloadJson: string;
318
+ queueName: string;
319
+ status: "pending" | "claimed" | "delivered" | "failed";
320
+ updatedAt: number;
321
+ }>, Name>;
322
+ markDelivered: FunctionReference<"mutation", "internal", {
323
+ messageId: string;
324
+ orgId: string;
325
+ }, null, Name>;
326
+ markFailedForRetry: FunctionReference<"mutation", "internal", {
327
+ delaySeconds: number;
328
+ messageId: string;
329
+ orgId: string;
330
+ }, null, Name>;
331
+ };
283
332
  resolvers: {
284
333
  resolveManifest: FunctionReference<"query", "internal", {
285
334
  orgId: string;
@@ -330,6 +379,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
330
379
  workflowId: string;
331
380
  }, string, Name>;
332
381
  };
382
+ sandboxConfigProvider: {
383
+ getBoxId: FunctionReference<"query", "internal", {
384
+ agentId: string;
385
+ orgId: string;
386
+ }, string | null, Name>;
387
+ setBoxId: FunctionReference<"mutation", "internal", {
388
+ agentId: string;
389
+ boxId: string;
390
+ orgId: string;
391
+ }, null, Name>;
392
+ };
333
393
  sessions: {
334
394
  appendReasoning: FunctionReference<"mutation", "internal", {
335
395
  chunk: string;
@@ -346,6 +406,11 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
346
406
  orgId: string;
347
407
  sessionId: string;
348
408
  }, null, Name>;
409
+ end: FunctionReference<"mutation", "internal", {
410
+ orgId: string;
411
+ outcome: "completed" | "cancelled";
412
+ sessionId: string;
413
+ }, null, Name>;
349
414
  listEvents: FunctionReference<"query", "internal", {
350
415
  orgId: string;
351
416
  sessionId: string;
@@ -380,6 +445,55 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
380
445
  workflowId: string;
381
446
  }, Name>;
382
447
  };
448
+ streams: {
449
+ closeStream: FunctionReference<"mutation", "internal", {
450
+ name: string;
451
+ orgId: string;
452
+ runId: string;
453
+ }, null, Name>;
454
+ getStreamInfo: FunctionReference<"query", "internal", {
455
+ name: string;
456
+ orgId: string;
457
+ runId: string;
458
+ }, {
459
+ done: boolean;
460
+ tailIndex: number;
461
+ }, Name>;
462
+ listChunksFromIndex: FunctionReference<"query", "internal", {
463
+ limit: number;
464
+ name: string;
465
+ orgId: string;
466
+ runId: string;
467
+ startIndex: number;
468
+ }, Array<{
469
+ dataBase64: string;
470
+ index: number;
471
+ }>, Name>;
472
+ listChunksPage: FunctionReference<"query", "internal", {
473
+ cursor: string | null;
474
+ limit: number;
475
+ name: string;
476
+ orgId: string;
477
+ runId: string;
478
+ }, {
479
+ continueCursor: string;
480
+ isDone: boolean;
481
+ page: Array<{
482
+ dataBase64: string;
483
+ index: number;
484
+ }>;
485
+ }, Name>;
486
+ listStreamNames: FunctionReference<"query", "internal", {
487
+ orgId: string;
488
+ runId: string;
489
+ }, Array<string>, Name>;
490
+ writeChunk: FunctionReference<"mutation", "internal", {
491
+ dataBase64: string;
492
+ name: string;
493
+ orgId: string;
494
+ runId: string;
495
+ }, null, Name>;
496
+ };
383
497
  toolApprovals: {
384
498
  respond: FunctionReference<"mutation", "internal", {
385
499
  decision: "approved" | "denied";
@@ -432,8 +546,8 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
432
546
  };
433
547
  wakeup: {
434
548
  cancel: FunctionReference<"mutation", "internal", {
549
+ messageId: string;
435
550
  orgId: string;
436
- wakeableWorkId: string;
437
551
  }, null, Name>;
438
552
  enqueue: FunctionReference<"action", "internal", {
439
553
  agentId: string;
@@ -447,12 +561,175 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
447
561
  workflowId: string;
448
562
  }, string, Name>;
449
563
  getStatus: FunctionReference<"query", "internal", {
564
+ messageId: string;
450
565
  orgId: string;
451
- wakeableWorkId: string;
452
566
  }, {
453
- resultSummary?: string;
454
- status: "pending" | "completed" | "failed" | "cancelled";
567
+ status: "pending" | "delivered" | "failed";
568
+ }, Name>;
569
+ };
570
+ world: {
571
+ appendEvent: FunctionReference<"mutation", "internal", {
572
+ correlationId?: string;
573
+ dataJson: string;
574
+ eventType: string;
575
+ hookId?: string;
576
+ orgId: string;
577
+ runId: string | null;
578
+ stepId?: string;
579
+ }, {
580
+ event: {
581
+ correlationId?: string;
582
+ createdAt: number;
583
+ dataJson: string;
584
+ eventId: string;
585
+ eventType: string;
586
+ hookId?: string;
587
+ runId: string;
588
+ seq: number;
589
+ stepId?: string;
590
+ };
591
+ hook: {
592
+ createdAt: number;
593
+ hookId: string;
594
+ runId: string;
595
+ status: "pending" | "disposed";
596
+ token: string;
597
+ updatedAt: number;
598
+ } | null;
599
+ run: {
600
+ createdAt: number;
601
+ eventCount: number;
602
+ runId: string;
603
+ status: "running" | "completed" | "failed" | "cancelled";
604
+ updatedAt: number;
605
+ } | null;
606
+ step: {
607
+ createdAt: number;
608
+ dataJson?: string;
609
+ runId: string;
610
+ status: "running" | "completed" | "failed";
611
+ stepId: string;
612
+ updatedAt: number;
613
+ } | null;
455
614
  }, Name>;
615
+ getEvent: FunctionReference<"query", "internal", {
616
+ eventId: string;
617
+ orgId: string;
618
+ runId: string;
619
+ }, {
620
+ correlationId?: string;
621
+ createdAt: number;
622
+ dataJson: string;
623
+ eventId: string;
624
+ eventType: string;
625
+ hookId?: string;
626
+ runId: string;
627
+ seq: number;
628
+ stepId?: string;
629
+ } | null, Name>;
630
+ getHook: FunctionReference<"query", "internal", {
631
+ hookId: string;
632
+ orgId: string;
633
+ }, {
634
+ createdAt: number;
635
+ hookId: string;
636
+ runId: string;
637
+ status: "pending" | "disposed";
638
+ token: string;
639
+ updatedAt: number;
640
+ } | null, Name>;
641
+ getHookByToken: FunctionReference<"query", "internal", {
642
+ orgId: string;
643
+ token: string;
644
+ }, {
645
+ createdAt: number;
646
+ hookId: string;
647
+ runId: string;
648
+ status: "pending" | "disposed";
649
+ token: string;
650
+ updatedAt: number;
651
+ } | null, Name>;
652
+ getRun: FunctionReference<"query", "internal", {
653
+ orgId: string;
654
+ runId: string;
655
+ }, {
656
+ createdAt: number;
657
+ eventCount: number;
658
+ runId: string;
659
+ status: "running" | "completed" | "failed" | "cancelled";
660
+ updatedAt: number;
661
+ } | null, Name>;
662
+ getStep: FunctionReference<"query", "internal", {
663
+ orgId: string;
664
+ runId: string;
665
+ stepId: string;
666
+ }, {
667
+ createdAt: number;
668
+ dataJson?: string;
669
+ runId: string;
670
+ status: "running" | "completed" | "failed";
671
+ stepId: string;
672
+ updatedAt: number;
673
+ } | null, Name>;
674
+ listEvents: FunctionReference<"query", "internal", {
675
+ orgId: string;
676
+ runId: string;
677
+ }, Array<{
678
+ correlationId?: string;
679
+ createdAt: number;
680
+ dataJson: string;
681
+ eventId: string;
682
+ eventType: string;
683
+ hookId?: string;
684
+ runId: string;
685
+ seq: number;
686
+ stepId?: string;
687
+ }>, Name>;
688
+ listEventsByCorrelationId: FunctionReference<"query", "internal", {
689
+ correlationId: string;
690
+ orgId: string;
691
+ }, Array<{
692
+ correlationId?: string;
693
+ createdAt: number;
694
+ dataJson: string;
695
+ eventId: string;
696
+ eventType: string;
697
+ hookId?: string;
698
+ runId: string;
699
+ seq: number;
700
+ stepId?: string;
701
+ }>, Name>;
702
+ listHooks: FunctionReference<"query", "internal", {
703
+ orgId: string;
704
+ runId: string;
705
+ }, Array<{
706
+ createdAt: number;
707
+ hookId: string;
708
+ runId: string;
709
+ status: "pending" | "disposed";
710
+ token: string;
711
+ updatedAt: number;
712
+ }>, Name>;
713
+ listRuns: FunctionReference<"query", "internal", {
714
+ orgId: string;
715
+ }, Array<{
716
+ createdAt: number;
717
+ eventCount: number;
718
+ runId: string;
719
+ status: "running" | "completed" | "failed" | "cancelled";
720
+ updatedAt: number;
721
+ }>, Name>;
722
+ listSteps: FunctionReference<"query", "internal", {
723
+ orgId: string;
724
+ runId: string;
725
+ }, Array<{
726
+ createdAt: number;
727
+ dataJson?: string;
728
+ runId: string;
729
+ status: "running" | "completed" | "failed";
730
+ stepId: string;
731
+ updatedAt: number;
732
+ }>, Name>;
456
733
  };
457
734
  };
458
735
  testFixtures: {
@@ -1,10 +1 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated `ComponentApi` utility.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
1
  export {};
@@ -1,45 +1,7 @@
1
- /**
2
- * Generated data model types.
3
- *
4
- * THIS CODE IS AUTOMATICALLY GENERATED.
5
- *
6
- * To regenerate, run `npx convex dev`.
7
- * @module
8
- */
9
1
  import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
10
2
  import type { GenericId } from "convex/values";
11
3
  import schema from "../schema.js";
12
- /**
13
- * The names of all of your Convex tables.
14
- */
15
4
  export type TableNames = TableNamesInDataModel<DataModel>;
16
- /**
17
- * The type of a document stored in Convex.
18
- *
19
- * @typeParam TableName - A string literal type of the table name (like "users").
20
- */
21
5
  export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
22
- /**
23
- * An identifier for a document in Convex.
24
- *
25
- * Convex documents are uniquely identified by their `Id`, which is accessible
26
- * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
27
- *
28
- * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
29
- *
30
- * IDs are just strings at runtime, but this type can be used to distinguish them from other
31
- * strings when type checking.
32
- *
33
- * @typeParam TableName - A string literal type of the table name (like "users").
34
- */
35
6
  export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
36
- /**
37
- * A type describing your Convex data model.
38
- *
39
- * This type includes information about what tables you have, the type of
40
- * documents stored in those tables, and the indexes defined on them.
41
- *
42
- * This type is used to parameterize methods like `queryGeneric` and
43
- * `mutationGeneric` to make them type-safe.
44
- */
45
7
  export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
@@ -1,10 +1 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated data model types.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
1
  export {};