@vantageos/agent-engine 0.1.0-alpha.8 → 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 +33 -8
- package/dist/component/_generated/api.d.ts +14 -3
- package/dist/component/_generated/api.js +0 -25
- package/dist/component/_generated/component.d.ts +369 -73
- package/dist/component/_generated/component.js +0 -9
- package/dist/component/_generated/dataModel.js +0 -9
- package/dist/component/_generated/server.js +0 -69
- package/dist/component/convex.config.js +0 -44
- package/dist/component/engine/agents.d.ts +3 -3
- package/dist/component/engine/agents.js +0 -7
- package/dist/component/engine/awaitEventTimeout.d.ts +1 -1
- package/dist/component/engine/awaitEventTimeout.js +16 -26
- package/dist/component/engine/connections.d.ts +74 -0
- package/dist/component/engine/connections.js +254 -0
- package/dist/component/engine/delegation.d.ts +5 -5
- package/dist/component/engine/delegation.js +0 -74
- package/dist/component/engine/directory.js +0 -18
- package/dist/component/engine/durableJob.d.ts +24 -17
- package/dist/component/engine/durableJob.js +182 -138
- package/dist/component/engine/mandates.d.ts +2 -2
- package/dist/component/engine/mandates.js +0 -59
- package/dist/component/engine/queue.d.ts +97 -0
- package/dist/component/engine/queue.js +201 -0
- package/dist/component/engine/resolvers.d.ts +1 -1
- package/dist/component/engine/resolvers.js +6 -18
- package/dist/component/engine/sandboxCallback.d.ts +2 -2
- package/dist/component/engine/sandboxCallback.js +2 -79
- package/dist/component/engine/sandboxConfigProvider.d.ts +9 -0
- package/dist/component/engine/sandboxConfigProvider.js +32 -0
- package/dist/component/engine/sessions.d.ts +28 -10
- package/dist/component/engine/sessions.js +130 -170
- package/dist/component/engine/streams.d.ts +47 -0
- package/dist/component/engine/streams.js +162 -0
- package/dist/component/engine/toolApprovals.d.ts +1 -1
- package/dist/component/engine/toolApprovals.js +12 -37
- package/dist/component/engine/vpConnection.js +0 -40
- package/dist/component/engine/wakeup.d.ts +7 -9
- package/dist/component/engine/wakeup.js +54 -127
- package/dist/component/engine/workflows.d.ts +26 -8
- package/dist/component/engine/workflows.js +59 -64
- package/dist/component/engine/world.d.ts +250 -0
- package/dist/component/engine/world.js +689 -0
- package/dist/component/lib/auth.js +0 -26
- package/dist/component/lib/connectionSecret.d.ts +5 -0
- package/dist/component/lib/connectionSecret.js +32 -0
- package/dist/component/schema.d.ts +240 -175
- package/dist/component/schema.js +134 -294
- package/package.json +21 -6
- package/dist/component/engine/habits.d.ts +0 -70
- package/dist/component/engine/habits.js +0 -218
- package/dist/component/testFixtures/callerSteps.d.ts +0 -20
- package/dist/component/testFixtures/callerSteps.js +0 -90
- package/dist/component/testFixtures/delegationDemoWorkflow.d.ts +0 -18
- package/dist/component/testFixtures/delegationDemoWorkflow.js +0 -75
- package/dist/component/testFixtures/sandboxDemoWorkflow.d.ts +0 -19
- package/dist/component/testFixtures/sandboxDemoWorkflow.js +0 -69
- package/dist/component/testFixtures/vpTool.d.ts +0 -4
- package/dist/component/testFixtures/vpTool.js +0 -25
- package/dist/component/testFixtures/wakeupDemoWorkflow.d.ts +0 -19
- package/dist/component/testFixtures/wakeupDemoWorkflow.js +0 -77
- package/dist/component/testFixtures/wakeupWork.d.ts +0 -8
- 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:
|
|
108
|
+
}) -> { sessionId: string /* the world runId */, workflowId: string }
|
|
109
|
+
// 0.3.0: every `sessionId` below IS that runId (string); an unknown,
|
|
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
|
-
}) ->
|
|
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
|
-
}) ->
|
|
128
|
-
components.agentEngine.engine.wakeup.cancel({ orgId,
|
|
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,
|
|
131
|
-
}) -> { status
|
|
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
|
-
}) ->
|
|
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`
|
|
@@ -8,21 +8,27 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type * as engine_agents from "../engine/agents.js";
|
|
10
10
|
import type * as engine_awaitEventTimeout from "../engine/awaitEventTimeout.js";
|
|
11
|
+
import type * as engine_connections from "../engine/connections.js";
|
|
11
12
|
import type * as engine_delegation from "../engine/delegation.js";
|
|
12
13
|
import type * as engine_directory from "../engine/directory.js";
|
|
13
14
|
import type * as engine_durableJob from "../engine/durableJob.js";
|
|
14
|
-
import type * as engine_habits from "../engine/habits.js";
|
|
15
15
|
import type * as engine_mandates from "../engine/mandates.js";
|
|
16
|
+
import type * as engine_queue from "../engine/queue.js";
|
|
16
17
|
import type * as engine_resolvers from "../engine/resolvers.js";
|
|
17
18
|
import type * as engine_sandboxCallback from "../engine/sandboxCallback.js";
|
|
19
|
+
import type * as engine_sandboxConfigProvider from "../engine/sandboxConfigProvider.js";
|
|
18
20
|
import type * as engine_sessions from "../engine/sessions.js";
|
|
21
|
+
import type * as engine_streams from "../engine/streams.js";
|
|
19
22
|
import type * as engine_toolApprovals from "../engine/toolApprovals.js";
|
|
20
23
|
import type * as engine_vpConnection from "../engine/vpConnection.js";
|
|
21
24
|
import type * as engine_wakeup from "../engine/wakeup.js";
|
|
22
25
|
import type * as engine_workflows from "../engine/workflows.js";
|
|
26
|
+
import type * as engine_world from "../engine/world.js";
|
|
23
27
|
import type * as lib_auth from "../lib/auth.js";
|
|
28
|
+
import type * as lib_connectionSecret from "../lib/connectionSecret.js";
|
|
24
29
|
import type * as testFixtures_callerSteps from "../testFixtures/callerSteps.js";
|
|
25
30
|
import type * as testFixtures_delegationDemoWorkflow from "../testFixtures/delegationDemoWorkflow.js";
|
|
31
|
+
import type * as testFixtures_runBinding from "../testFixtures/runBinding.js";
|
|
26
32
|
import type * as testFixtures_sandboxDemoWorkflow from "../testFixtures/sandboxDemoWorkflow.js";
|
|
27
33
|
import type * as testFixtures_vpTool from "../testFixtures/vpTool.js";
|
|
28
34
|
import type * as testFixtures_wakeupDemoWorkflow from "../testFixtures/wakeupDemoWorkflow.js";
|
|
@@ -31,21 +37,27 @@ import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server
|
|
|
31
37
|
declare const fullApi: ApiFromModules<{
|
|
32
38
|
"engine/agents": typeof engine_agents;
|
|
33
39
|
"engine/awaitEventTimeout": typeof engine_awaitEventTimeout;
|
|
40
|
+
"engine/connections": typeof engine_connections;
|
|
34
41
|
"engine/delegation": typeof engine_delegation;
|
|
35
42
|
"engine/directory": typeof engine_directory;
|
|
36
43
|
"engine/durableJob": typeof engine_durableJob;
|
|
37
|
-
"engine/habits": typeof engine_habits;
|
|
38
44
|
"engine/mandates": typeof engine_mandates;
|
|
45
|
+
"engine/queue": typeof engine_queue;
|
|
39
46
|
"engine/resolvers": typeof engine_resolvers;
|
|
40
47
|
"engine/sandboxCallback": typeof engine_sandboxCallback;
|
|
48
|
+
"engine/sandboxConfigProvider": typeof engine_sandboxConfigProvider;
|
|
41
49
|
"engine/sessions": typeof engine_sessions;
|
|
50
|
+
"engine/streams": typeof engine_streams;
|
|
42
51
|
"engine/toolApprovals": typeof engine_toolApprovals;
|
|
43
52
|
"engine/vpConnection": typeof engine_vpConnection;
|
|
44
53
|
"engine/wakeup": typeof engine_wakeup;
|
|
45
54
|
"engine/workflows": typeof engine_workflows;
|
|
55
|
+
"engine/world": typeof engine_world;
|
|
46
56
|
"lib/auth": typeof lib_auth;
|
|
57
|
+
"lib/connectionSecret": typeof lib_connectionSecret;
|
|
47
58
|
"testFixtures/callerSteps": typeof testFixtures_callerSteps;
|
|
48
59
|
"testFixtures/delegationDemoWorkflow": typeof testFixtures_delegationDemoWorkflow;
|
|
60
|
+
"testFixtures/runBinding": typeof testFixtures_runBinding;
|
|
49
61
|
"testFixtures/sandboxDemoWorkflow": typeof testFixtures_sandboxDemoWorkflow;
|
|
50
62
|
"testFixtures/vpTool": typeof testFixtures_vpTool;
|
|
51
63
|
"testFixtures/wakeupDemoWorkflow": typeof testFixtures_wakeupDemoWorkflow;
|
|
@@ -76,6 +88,5 @@ export declare const components: {
|
|
|
76
88
|
agent: import("@convex-dev/agent/_generated/component.js").ComponentApi<"agent">;
|
|
77
89
|
rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
|
|
78
90
|
shardedCounter: import("@convex-dev/sharded-counter/_generated/component.js").ComponentApi<"shardedCounter">;
|
|
79
|
-
crons: import("@convex-dev/crons/_generated/component.js").ComponentApi<"crons">;
|
|
80
91
|
};
|
|
81
92
|
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();
|
|
@@ -66,6 +66,81 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
66
66
|
timeoutMs: number;
|
|
67
67
|
}, string, Name>;
|
|
68
68
|
};
|
|
69
|
+
connections: {
|
|
70
|
+
completeAuthorization: FunctionReference<"mutation", "internal", {
|
|
71
|
+
connectionAuthorizationId: string;
|
|
72
|
+
encryptionKeyBase64?: string;
|
|
73
|
+
orgId: string;
|
|
74
|
+
outcome: "authorized" | "denied";
|
|
75
|
+
resultSummary?: string;
|
|
76
|
+
secretPlaintext?: string;
|
|
77
|
+
}, {
|
|
78
|
+
outcome: "woke" | "already-resolved";
|
|
79
|
+
}, Name>;
|
|
80
|
+
create: FunctionReference<"mutation", "internal", {
|
|
81
|
+
agentId: string;
|
|
82
|
+
authMode: "app-token" | "user-oauth" | "none" | "header";
|
|
83
|
+
encryptionKeyBase64?: string;
|
|
84
|
+
name: string;
|
|
85
|
+
orgId: string;
|
|
86
|
+
secretPlaintext?: string;
|
|
87
|
+
serverConfig: string;
|
|
88
|
+
type: "mcp" | "openapi";
|
|
89
|
+
}, string, Name>;
|
|
90
|
+
get: FunctionReference<"query", "internal", {
|
|
91
|
+
connectionId: string;
|
|
92
|
+
orgId: string;
|
|
93
|
+
}, {
|
|
94
|
+
_creationTime: number;
|
|
95
|
+
_id: string;
|
|
96
|
+
agentId: string;
|
|
97
|
+
authMode: "app-token" | "user-oauth" | "none" | "header";
|
|
98
|
+
createdAt: number;
|
|
99
|
+
hasSecret: boolean;
|
|
100
|
+
name: string;
|
|
101
|
+
orgId: string;
|
|
102
|
+
principalType: "app" | "user";
|
|
103
|
+
serverConfig: string;
|
|
104
|
+
status: "active" | "pending_authorization" | "error";
|
|
105
|
+
type: "mcp" | "openapi";
|
|
106
|
+
updatedAt: number;
|
|
107
|
+
}, Name>;
|
|
108
|
+
getAuthorizationStatus: FunctionReference<"query", "internal", {
|
|
109
|
+
connectionAuthorizationId: string;
|
|
110
|
+
orgId: string;
|
|
111
|
+
}, {
|
|
112
|
+
resultSummary?: string;
|
|
113
|
+
status: "pending" | "authorized" | "denied";
|
|
114
|
+
url: string;
|
|
115
|
+
userCode: string;
|
|
116
|
+
}, Name>;
|
|
117
|
+
listByAgent: FunctionReference<"query", "internal", {
|
|
118
|
+
agentId: string;
|
|
119
|
+
orgId: string;
|
|
120
|
+
}, Array<{
|
|
121
|
+
_creationTime: number;
|
|
122
|
+
_id: string;
|
|
123
|
+
agentId: string;
|
|
124
|
+
authMode: "app-token" | "user-oauth" | "none" | "header";
|
|
125
|
+
createdAt: number;
|
|
126
|
+
hasSecret: boolean;
|
|
127
|
+
name: string;
|
|
128
|
+
orgId: string;
|
|
129
|
+
principalType: "app" | "user";
|
|
130
|
+
serverConfig: string;
|
|
131
|
+
status: "active" | "pending_authorization" | "error";
|
|
132
|
+
type: "mcp" | "openapi";
|
|
133
|
+
updatedAt: number;
|
|
134
|
+
}>, Name>;
|
|
135
|
+
requestAuthorization: FunctionReference<"mutation", "internal", {
|
|
136
|
+
awaitedEventName: string;
|
|
137
|
+
connectionId: string;
|
|
138
|
+
orgId: string;
|
|
139
|
+
url: string;
|
|
140
|
+
userCode: string;
|
|
141
|
+
workflowId: string;
|
|
142
|
+
}, string, Name>;
|
|
143
|
+
};
|
|
69
144
|
delegation: {
|
|
70
145
|
declareSubagent: FunctionReference<"mutation", "internal", {
|
|
71
146
|
childAgentId: string;
|
|
@@ -146,75 +221,6 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
146
221
|
totalSteps: number;
|
|
147
222
|
}, string, Name>;
|
|
148
223
|
};
|
|
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
224
|
mandates: {
|
|
219
225
|
get: FunctionReference<"query", "internal", {
|
|
220
226
|
agentId: string;
|
|
@@ -280,6 +286,68 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
280
286
|
scope: string;
|
|
281
287
|
}, number, Name>;
|
|
282
288
|
};
|
|
289
|
+
queue: {
|
|
290
|
+
claimNextForDelivery: FunctionReference<"mutation", "internal", {
|
|
291
|
+
orgId: string;
|
|
292
|
+
queueNamePrefix: string;
|
|
293
|
+
}, {
|
|
294
|
+
attempt: number;
|
|
295
|
+
createdAt: number;
|
|
296
|
+
deliverAt: number;
|
|
297
|
+
idempotencyKey?: string;
|
|
298
|
+
messageId: string;
|
|
299
|
+
payloadJson: string;
|
|
300
|
+
queueName: string;
|
|
301
|
+
status: "pending" | "claimed" | "delivered" | "failed";
|
|
302
|
+
updatedAt: number;
|
|
303
|
+
} | null, Name>;
|
|
304
|
+
enqueue: FunctionReference<"mutation", "internal", {
|
|
305
|
+
delaySeconds?: number;
|
|
306
|
+
idempotencyKey?: string;
|
|
307
|
+
orgId: string;
|
|
308
|
+
payloadJson: string;
|
|
309
|
+
queueName: string;
|
|
310
|
+
}, {
|
|
311
|
+
messageId: string;
|
|
312
|
+
}, Name>;
|
|
313
|
+
getMessage: FunctionReference<"query", "internal", {
|
|
314
|
+
messageId: string;
|
|
315
|
+
orgId: string;
|
|
316
|
+
}, {
|
|
317
|
+
attempt: number;
|
|
318
|
+
createdAt: number;
|
|
319
|
+
deliverAt: number;
|
|
320
|
+
idempotencyKey?: string;
|
|
321
|
+
messageId: string;
|
|
322
|
+
payloadJson: string;
|
|
323
|
+
queueName: string;
|
|
324
|
+
status: "pending" | "claimed" | "delivered" | "failed";
|
|
325
|
+
updatedAt: number;
|
|
326
|
+
} | null, Name>;
|
|
327
|
+
listPending: FunctionReference<"query", "internal", {
|
|
328
|
+
orgId: string;
|
|
329
|
+
queueNamePrefix: string;
|
|
330
|
+
}, Array<{
|
|
331
|
+
attempt: number;
|
|
332
|
+
createdAt: number;
|
|
333
|
+
deliverAt: number;
|
|
334
|
+
idempotencyKey?: string;
|
|
335
|
+
messageId: string;
|
|
336
|
+
payloadJson: string;
|
|
337
|
+
queueName: string;
|
|
338
|
+
status: "pending" | "claimed" | "delivered" | "failed";
|
|
339
|
+
updatedAt: number;
|
|
340
|
+
}>, Name>;
|
|
341
|
+
markDelivered: FunctionReference<"mutation", "internal", {
|
|
342
|
+
messageId: string;
|
|
343
|
+
orgId: string;
|
|
344
|
+
}, null, Name>;
|
|
345
|
+
markFailedForRetry: FunctionReference<"mutation", "internal", {
|
|
346
|
+
delaySeconds: number;
|
|
347
|
+
messageId: string;
|
|
348
|
+
orgId: string;
|
|
349
|
+
}, null, Name>;
|
|
350
|
+
};
|
|
283
351
|
resolvers: {
|
|
284
352
|
resolveManifest: FunctionReference<"query", "internal", {
|
|
285
353
|
orgId: string;
|
|
@@ -330,6 +398,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
330
398
|
workflowId: string;
|
|
331
399
|
}, string, Name>;
|
|
332
400
|
};
|
|
401
|
+
sandboxConfigProvider: {
|
|
402
|
+
getBoxId: FunctionReference<"query", "internal", {
|
|
403
|
+
agentId: string;
|
|
404
|
+
orgId: string;
|
|
405
|
+
}, string | null, Name>;
|
|
406
|
+
setBoxId: FunctionReference<"mutation", "internal", {
|
|
407
|
+
agentId: string;
|
|
408
|
+
boxId: string;
|
|
409
|
+
orgId: string;
|
|
410
|
+
}, null, Name>;
|
|
411
|
+
};
|
|
333
412
|
sessions: {
|
|
334
413
|
appendReasoning: FunctionReference<"mutation", "internal", {
|
|
335
414
|
chunk: string;
|
|
@@ -346,6 +425,11 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
346
425
|
orgId: string;
|
|
347
426
|
sessionId: string;
|
|
348
427
|
}, null, Name>;
|
|
428
|
+
end: FunctionReference<"mutation", "internal", {
|
|
429
|
+
orgId: string;
|
|
430
|
+
outcome: "completed" | "cancelled";
|
|
431
|
+
sessionId: string;
|
|
432
|
+
}, null, Name>;
|
|
349
433
|
listEvents: FunctionReference<"query", "internal", {
|
|
350
434
|
orgId: string;
|
|
351
435
|
sessionId: string;
|
|
@@ -380,6 +464,55 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
380
464
|
workflowId: string;
|
|
381
465
|
}, Name>;
|
|
382
466
|
};
|
|
467
|
+
streams: {
|
|
468
|
+
closeStream: FunctionReference<"mutation", "internal", {
|
|
469
|
+
name: string;
|
|
470
|
+
orgId: string;
|
|
471
|
+
runId: string;
|
|
472
|
+
}, null, Name>;
|
|
473
|
+
getStreamInfo: FunctionReference<"query", "internal", {
|
|
474
|
+
name: string;
|
|
475
|
+
orgId: string;
|
|
476
|
+
runId: string;
|
|
477
|
+
}, {
|
|
478
|
+
done: boolean;
|
|
479
|
+
tailIndex: number;
|
|
480
|
+
}, Name>;
|
|
481
|
+
listChunksFromIndex: FunctionReference<"query", "internal", {
|
|
482
|
+
limit: number;
|
|
483
|
+
name: string;
|
|
484
|
+
orgId: string;
|
|
485
|
+
runId: string;
|
|
486
|
+
startIndex: number;
|
|
487
|
+
}, Array<{
|
|
488
|
+
dataBase64: string;
|
|
489
|
+
index: number;
|
|
490
|
+
}>, Name>;
|
|
491
|
+
listChunksPage: FunctionReference<"query", "internal", {
|
|
492
|
+
cursor: string | null;
|
|
493
|
+
limit: number;
|
|
494
|
+
name: string;
|
|
495
|
+
orgId: string;
|
|
496
|
+
runId: string;
|
|
497
|
+
}, {
|
|
498
|
+
continueCursor: string;
|
|
499
|
+
isDone: boolean;
|
|
500
|
+
page: Array<{
|
|
501
|
+
dataBase64: string;
|
|
502
|
+
index: number;
|
|
503
|
+
}>;
|
|
504
|
+
}, Name>;
|
|
505
|
+
listStreamNames: FunctionReference<"query", "internal", {
|
|
506
|
+
orgId: string;
|
|
507
|
+
runId: string;
|
|
508
|
+
}, Array<string>, Name>;
|
|
509
|
+
writeChunk: FunctionReference<"mutation", "internal", {
|
|
510
|
+
dataBase64: string;
|
|
511
|
+
name: string;
|
|
512
|
+
orgId: string;
|
|
513
|
+
runId: string;
|
|
514
|
+
}, null, Name>;
|
|
515
|
+
};
|
|
383
516
|
toolApprovals: {
|
|
384
517
|
respond: FunctionReference<"mutation", "internal", {
|
|
385
518
|
decision: "approved" | "denied";
|
|
@@ -432,8 +565,8 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
432
565
|
};
|
|
433
566
|
wakeup: {
|
|
434
567
|
cancel: FunctionReference<"mutation", "internal", {
|
|
568
|
+
messageId: string;
|
|
435
569
|
orgId: string;
|
|
436
|
-
wakeableWorkId: string;
|
|
437
570
|
}, null, Name>;
|
|
438
571
|
enqueue: FunctionReference<"action", "internal", {
|
|
439
572
|
agentId: string;
|
|
@@ -447,12 +580,175 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
447
580
|
workflowId: string;
|
|
448
581
|
}, string, Name>;
|
|
449
582
|
getStatus: FunctionReference<"query", "internal", {
|
|
583
|
+
messageId: string;
|
|
450
584
|
orgId: string;
|
|
451
|
-
wakeableWorkId: string;
|
|
452
585
|
}, {
|
|
453
|
-
|
|
454
|
-
|
|
586
|
+
status: "pending" | "delivered" | "failed";
|
|
587
|
+
}, Name>;
|
|
588
|
+
};
|
|
589
|
+
world: {
|
|
590
|
+
appendEvent: FunctionReference<"mutation", "internal", {
|
|
591
|
+
correlationId?: string;
|
|
592
|
+
dataJson: string;
|
|
593
|
+
eventType: string;
|
|
594
|
+
hookId?: string;
|
|
595
|
+
orgId: string;
|
|
596
|
+
runId: string | null;
|
|
597
|
+
stepId?: string;
|
|
598
|
+
}, {
|
|
599
|
+
event: {
|
|
600
|
+
correlationId?: string;
|
|
601
|
+
createdAt: number;
|
|
602
|
+
dataJson: string;
|
|
603
|
+
eventId: string;
|
|
604
|
+
eventType: string;
|
|
605
|
+
hookId?: string;
|
|
606
|
+
runId: string;
|
|
607
|
+
seq: number;
|
|
608
|
+
stepId?: string;
|
|
609
|
+
};
|
|
610
|
+
hook: {
|
|
611
|
+
createdAt: number;
|
|
612
|
+
hookId: string;
|
|
613
|
+
runId: string;
|
|
614
|
+
status: "pending" | "disposed";
|
|
615
|
+
token: string;
|
|
616
|
+
updatedAt: number;
|
|
617
|
+
} | null;
|
|
618
|
+
run: {
|
|
619
|
+
createdAt: number;
|
|
620
|
+
eventCount: number;
|
|
621
|
+
runId: string;
|
|
622
|
+
status: "running" | "completed" | "failed" | "cancelled";
|
|
623
|
+
updatedAt: number;
|
|
624
|
+
} | null;
|
|
625
|
+
step: {
|
|
626
|
+
createdAt: number;
|
|
627
|
+
dataJson?: string;
|
|
628
|
+
runId: string;
|
|
629
|
+
status: "running" | "completed" | "failed";
|
|
630
|
+
stepId: string;
|
|
631
|
+
updatedAt: number;
|
|
632
|
+
} | null;
|
|
455
633
|
}, Name>;
|
|
634
|
+
getEvent: FunctionReference<"query", "internal", {
|
|
635
|
+
eventId: string;
|
|
636
|
+
orgId: string;
|
|
637
|
+
runId: string;
|
|
638
|
+
}, {
|
|
639
|
+
correlationId?: string;
|
|
640
|
+
createdAt: number;
|
|
641
|
+
dataJson: string;
|
|
642
|
+
eventId: string;
|
|
643
|
+
eventType: string;
|
|
644
|
+
hookId?: string;
|
|
645
|
+
runId: string;
|
|
646
|
+
seq: number;
|
|
647
|
+
stepId?: string;
|
|
648
|
+
} | null, Name>;
|
|
649
|
+
getHook: FunctionReference<"query", "internal", {
|
|
650
|
+
hookId: string;
|
|
651
|
+
orgId: string;
|
|
652
|
+
}, {
|
|
653
|
+
createdAt: number;
|
|
654
|
+
hookId: string;
|
|
655
|
+
runId: string;
|
|
656
|
+
status: "pending" | "disposed";
|
|
657
|
+
token: string;
|
|
658
|
+
updatedAt: number;
|
|
659
|
+
} | null, Name>;
|
|
660
|
+
getHookByToken: FunctionReference<"query", "internal", {
|
|
661
|
+
orgId: string;
|
|
662
|
+
token: string;
|
|
663
|
+
}, {
|
|
664
|
+
createdAt: number;
|
|
665
|
+
hookId: string;
|
|
666
|
+
runId: string;
|
|
667
|
+
status: "pending" | "disposed";
|
|
668
|
+
token: string;
|
|
669
|
+
updatedAt: number;
|
|
670
|
+
} | null, Name>;
|
|
671
|
+
getRun: FunctionReference<"query", "internal", {
|
|
672
|
+
orgId: string;
|
|
673
|
+
runId: string;
|
|
674
|
+
}, {
|
|
675
|
+
createdAt: number;
|
|
676
|
+
eventCount: number;
|
|
677
|
+
runId: string;
|
|
678
|
+
status: "running" | "completed" | "failed" | "cancelled";
|
|
679
|
+
updatedAt: number;
|
|
680
|
+
} | null, Name>;
|
|
681
|
+
getStep: FunctionReference<"query", "internal", {
|
|
682
|
+
orgId: string;
|
|
683
|
+
runId: string;
|
|
684
|
+
stepId: string;
|
|
685
|
+
}, {
|
|
686
|
+
createdAt: number;
|
|
687
|
+
dataJson?: string;
|
|
688
|
+
runId: string;
|
|
689
|
+
status: "running" | "completed" | "failed";
|
|
690
|
+
stepId: string;
|
|
691
|
+
updatedAt: number;
|
|
692
|
+
} | null, Name>;
|
|
693
|
+
listEvents: FunctionReference<"query", "internal", {
|
|
694
|
+
orgId: string;
|
|
695
|
+
runId: string;
|
|
696
|
+
}, Array<{
|
|
697
|
+
correlationId?: string;
|
|
698
|
+
createdAt: number;
|
|
699
|
+
dataJson: string;
|
|
700
|
+
eventId: string;
|
|
701
|
+
eventType: string;
|
|
702
|
+
hookId?: string;
|
|
703
|
+
runId: string;
|
|
704
|
+
seq: number;
|
|
705
|
+
stepId?: string;
|
|
706
|
+
}>, Name>;
|
|
707
|
+
listEventsByCorrelationId: FunctionReference<"query", "internal", {
|
|
708
|
+
correlationId: string;
|
|
709
|
+
orgId: string;
|
|
710
|
+
}, Array<{
|
|
711
|
+
correlationId?: string;
|
|
712
|
+
createdAt: number;
|
|
713
|
+
dataJson: string;
|
|
714
|
+
eventId: string;
|
|
715
|
+
eventType: string;
|
|
716
|
+
hookId?: string;
|
|
717
|
+
runId: string;
|
|
718
|
+
seq: number;
|
|
719
|
+
stepId?: string;
|
|
720
|
+
}>, Name>;
|
|
721
|
+
listHooks: FunctionReference<"query", "internal", {
|
|
722
|
+
orgId: string;
|
|
723
|
+
runId: string;
|
|
724
|
+
}, Array<{
|
|
725
|
+
createdAt: number;
|
|
726
|
+
hookId: string;
|
|
727
|
+
runId: string;
|
|
728
|
+
status: "pending" | "disposed";
|
|
729
|
+
token: string;
|
|
730
|
+
updatedAt: number;
|
|
731
|
+
}>, Name>;
|
|
732
|
+
listRuns: FunctionReference<"query", "internal", {
|
|
733
|
+
orgId: string;
|
|
734
|
+
}, Array<{
|
|
735
|
+
createdAt: number;
|
|
736
|
+
eventCount: number;
|
|
737
|
+
runId: string;
|
|
738
|
+
status: "running" | "completed" | "failed" | "cancelled";
|
|
739
|
+
updatedAt: number;
|
|
740
|
+
}>, Name>;
|
|
741
|
+
listSteps: FunctionReference<"query", "internal", {
|
|
742
|
+
orgId: string;
|
|
743
|
+
runId: string;
|
|
744
|
+
}, Array<{
|
|
745
|
+
createdAt: number;
|
|
746
|
+
dataJson?: string;
|
|
747
|
+
runId: string;
|
|
748
|
+
status: "running" | "completed" | "failed";
|
|
749
|
+
stepId: string;
|
|
750
|
+
updatedAt: number;
|
|
751
|
+
}>, Name>;
|
|
456
752
|
};
|
|
457
753
|
};
|
|
458
754
|
testFixtures: {
|