@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
package/README.md CHANGED
@@ -33,6 +33,16 @@ consuming app.
33
33
  npm install @vantageos/agent-engine
34
34
  ```
35
35
 
36
+ ### What ships in the package
37
+
38
+ The published tarball is `dist/` (compiled JS + `.d.ts`), `README.md`,
39
+ `LICENSE`. `dist/component/testFixtures/**` is deliberately excluded
40
+ (`package.json` `"files"` negation `"!dist/component/testFixtures"`) — it is
41
+ test-only demo workflow code used by this repo's own component-packaging
42
+ tests, never part of the public `exports` (`./convex.config` and
43
+ `./_generated/component.js`), and not a documented consumer API. No file is
44
+ published without a stated reason.
45
+
36
46
  ## Quickstart
37
47
 
38
48
  Register the component in your app's `convex/convex.config.ts`:
@@ -95,7 +105,9 @@ components.agentEngine.engine.resolvers.resolveManifest({
95
105
 
96
106
  components.agentEngine.engine.sessions.start({
97
107
  orgId, agentId, createdBy,
98
- }) -> { sessionId: Id<"sessions">, workflowId: string }
108
+ }) -> { sessionId: string /* the world runId */, workflowId: string }
109
+ // 0.3.0: every `sessionId` below IS that runId (string); an unknown, legacy,
110
+ // cross-org or non-session id is refused as "Session not found".
99
111
  components.agentEngine.engine.sessions.sendTurn({
100
112
  orgId, sessionId, input,
101
113
  }) -> null
@@ -111,9 +123,13 @@ components.agentEngine.engine.sessions.completeToolCall({
111
123
  components.agentEngine.engine.sessions.completeTurn({
112
124
  orgId, sessionId,
113
125
  }) -> null
126
+ components.agentEngine.engine.sessions.end({
127
+ orgId, sessionId, outcome: "completed"|"cancelled",
128
+ }) -> null
114
129
  components.agentEngine.engine.sessions.listEvents({
115
130
  orgId, sessionId,
116
- }) -> sessionEvent[]
131
+ }) -> { _id /* journal eventId */, _creationTime /* event createdAt, ms */,
132
+ name, payload?, createdAt }[] (read from the world journal)
117
133
 
118
134
  components.agentEngine.engine.toolApprovals.respond({
119
135
  orgId, sessionId, toolName,
@@ -124,16 +140,16 @@ components.agentEngine.engine.toolApprovals.respond({
124
140
  components.agentEngine.engine.wakeup.enqueue({
125
141
  orgId, agentId, mandateScope, cost, reason,
126
142
  workFunctionHandle, workflowId, awaitedEventName,
127
- }) -> Id<"wakeableWork"> (action)
128
- components.agentEngine.engine.wakeup.cancel({ orgId, wakeableWorkId }) -> null
143
+ }) -> string (action; the world-queue messageId)
144
+ components.agentEngine.engine.wakeup.cancel({ orgId, messageId }) -> null
129
145
  components.agentEngine.engine.wakeup.getStatus({
130
- orgId, wakeableWorkId,
131
- }) -> { status, resultSummary?, ... }
146
+ orgId, messageId,
147
+ }) -> { status: "pending" | "delivered" | "failed" }
132
148
 
133
149
  components.agentEngine.engine.durableJob.start({
134
150
  orgId, kind, stepFunctionHandle, totalSteps, maxAttemptsPerStep,
135
- }) -> Id<"durableJobs">
136
- components.agentEngine.engine.durableJob.getStatus({ orgId, jobId })
151
+ }) -> string (the world runId)
152
+ components.agentEngine.engine.durableJob.getStatus({ orgId, jobId /* runId */ })
137
153
  -> { status, cursor, totalSteps, lastError?, abandonedAtStep? }
138
154
  components.agentEngine.engine.durableJob.cancel({ orgId, jobId }) -> null
139
155
 
@@ -242,6 +258,15 @@ calling in. Every document lookup by id is checked against the caller's own
242
258
  `orgId` before being returned or mutated; a cross-org read or write is
243
259
  refused the same way a not-found row would be.
244
260
 
261
+ ## Dependency pins
262
+
263
+ `ai` is pinned to v6 (`6.0.35`) in the root package; any other tree that declares `ai` must use the same major (world-convex declares none today).
264
+
265
+ Two sub-packages (`first-orchestrator/`, `scheduling-specialist/`) keep `ai ^7.0.58` because
266
+ eve@0.44.3 peers `ai ^7.0.58` (no eve release peers v6); each runs in its own process with its own
267
+ install, sharing no dependency tree with root or world-convex. Everywhere else the v6 pin stands;
268
+ `scripts/vitestScope.test.ts` enforces it.
269
+
245
270
  ## Requirements
246
271
 
247
272
  - Convex `^1.42`
@@ -1,28 +1,26 @@
1
- /**
2
- * Generated `api` utility.
3
- *
4
- * THIS CODE IS AUTOMATICALLY GENERATED.
5
- *
6
- * To regenerate, run `npx convex dev`.
7
- * @module
8
- */
9
1
  import type * as engine_agents from "../engine/agents.js";
10
2
  import type * as engine_awaitEventTimeout from "../engine/awaitEventTimeout.js";
3
+ import type * as engine_connections from "../engine/connections.js";
11
4
  import type * as engine_delegation from "../engine/delegation.js";
12
5
  import type * as engine_directory from "../engine/directory.js";
13
6
  import type * as engine_durableJob from "../engine/durableJob.js";
14
- import type * as engine_habits from "../engine/habits.js";
15
7
  import type * as engine_mandates from "../engine/mandates.js";
8
+ import type * as engine_queue from "../engine/queue.js";
16
9
  import type * as engine_resolvers from "../engine/resolvers.js";
17
10
  import type * as engine_sandboxCallback from "../engine/sandboxCallback.js";
11
+ import type * as engine_sandboxConfigProvider from "../engine/sandboxConfigProvider.js";
18
12
  import type * as engine_sessions from "../engine/sessions.js";
13
+ import type * as engine_streams from "../engine/streams.js";
19
14
  import type * as engine_toolApprovals from "../engine/toolApprovals.js";
20
15
  import type * as engine_vpConnection from "../engine/vpConnection.js";
21
16
  import type * as engine_wakeup from "../engine/wakeup.js";
22
17
  import type * as engine_workflows from "../engine/workflows.js";
18
+ import type * as engine_world from "../engine/world.js";
23
19
  import type * as lib_auth from "../lib/auth.js";
20
+ import type * as lib_connectionSecret from "../lib/connectionSecret.js";
24
21
  import type * as testFixtures_callerSteps from "../testFixtures/callerSteps.js";
25
22
  import type * as testFixtures_delegationDemoWorkflow from "../testFixtures/delegationDemoWorkflow.js";
23
+ import type * as testFixtures_legacyBind from "../testFixtures/legacyBind.js";
26
24
  import type * as testFixtures_sandboxDemoWorkflow from "../testFixtures/sandboxDemoWorkflow.js";
27
25
  import type * as testFixtures_vpTool from "../testFixtures/vpTool.js";
28
26
  import type * as testFixtures_wakeupDemoWorkflow from "../testFixtures/wakeupDemoWorkflow.js";
@@ -31,43 +29,33 @@ import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server
31
29
  declare const fullApi: ApiFromModules<{
32
30
  "engine/agents": typeof engine_agents;
33
31
  "engine/awaitEventTimeout": typeof engine_awaitEventTimeout;
32
+ "engine/connections": typeof engine_connections;
34
33
  "engine/delegation": typeof engine_delegation;
35
34
  "engine/directory": typeof engine_directory;
36
35
  "engine/durableJob": typeof engine_durableJob;
37
- "engine/habits": typeof engine_habits;
38
36
  "engine/mandates": typeof engine_mandates;
37
+ "engine/queue": typeof engine_queue;
39
38
  "engine/resolvers": typeof engine_resolvers;
40
39
  "engine/sandboxCallback": typeof engine_sandboxCallback;
40
+ "engine/sandboxConfigProvider": typeof engine_sandboxConfigProvider;
41
41
  "engine/sessions": typeof engine_sessions;
42
+ "engine/streams": typeof engine_streams;
42
43
  "engine/toolApprovals": typeof engine_toolApprovals;
43
44
  "engine/vpConnection": typeof engine_vpConnection;
44
45
  "engine/wakeup": typeof engine_wakeup;
45
46
  "engine/workflows": typeof engine_workflows;
47
+ "engine/world": typeof engine_world;
46
48
  "lib/auth": typeof lib_auth;
49
+ "lib/connectionSecret": typeof lib_connectionSecret;
47
50
  "testFixtures/callerSteps": typeof testFixtures_callerSteps;
48
51
  "testFixtures/delegationDemoWorkflow": typeof testFixtures_delegationDemoWorkflow;
52
+ "testFixtures/legacyBind": typeof testFixtures_legacyBind;
49
53
  "testFixtures/sandboxDemoWorkflow": typeof testFixtures_sandboxDemoWorkflow;
50
54
  "testFixtures/vpTool": typeof testFixtures_vpTool;
51
55
  "testFixtures/wakeupDemoWorkflow": typeof testFixtures_wakeupDemoWorkflow;
52
56
  "testFixtures/wakeupWork": typeof testFixtures_wakeupWork;
53
57
  }>;
54
- /**
55
- * A utility for referencing Convex functions in your app's public API.
56
- *
57
- * Usage:
58
- * ```js
59
- * const myFunctionReference = api.myModule.myFunction;
60
- * ```
61
- */
62
58
  export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
63
- /**
64
- * A utility for referencing Convex functions in your app's internal API.
65
- *
66
- * Usage:
67
- * ```js
68
- * const myFunctionReference = internal.myModule.myFunction;
69
- * ```
70
- */
71
59
  export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
72
60
  export declare const components: {
73
61
  workflow: import("@convex-dev/workflow/_generated/component.js").ComponentApi<"workflow">;
@@ -76,6 +64,5 @@ export declare const components: {
76
64
  agent: import("@convex-dev/agent/_generated/component.js").ComponentApi<"agent">;
77
65
  rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
78
66
  shardedCounter: import("@convex-dev/sharded-counter/_generated/component.js").ComponentApi<"shardedCounter">;
79
- crons: import("@convex-dev/crons/_generated/component.js").ComponentApi<"crons">;
80
67
  };
81
68
  export {};
@@ -1,30 +1,5 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated `api` utility.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
1
  import { anyApi, componentsGeneric } from "convex/server";
11
2
  const fullApi = anyApi;
12
- /**
13
- * A utility for referencing Convex functions in your app's public API.
14
- *
15
- * Usage:
16
- * ```js
17
- * const myFunctionReference = api.myModule.myFunction;
18
- * ```
19
- */
20
3
  export const api = anyApi;
21
- /**
22
- * A utility for referencing Convex functions in your app's internal API.
23
- *
24
- * Usage:
25
- * ```js
26
- * const myFunctionReference = internal.myModule.myFunction;
27
- * ```
28
- */
29
4
  export const internal = anyApi;
30
5
  export const components = componentsGeneric();