@heddleagent/execution-host-client 6.5.0 → 6.6.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.
- package/README.md +7 -6
- package/dist/adopter/contracts.d.ts +13 -0
- package/dist/adopter/contracts.d.ts.map +1 -0
- package/dist/adopter/contracts.js +13 -0
- package/dist/adopter/contracts.js.map +1 -0
- package/dist/adopter/hosted-conversation-client.d.ts +20 -0
- package/dist/adopter/hosted-conversation-client.d.ts.map +1 -0
- package/dist/adopter/hosted-conversation-client.js +103 -0
- package/dist/adopter/hosted-conversation-client.js.map +1 -0
- package/dist/adopter/index.d.ts +5 -0
- package/dist/adopter/index.d.ts.map +1 -0
- package/dist/adopter/index.js +3 -0
- package/dist/adopter/index.js.map +1 -0
- package/dist/adopter/types.d.ts +14 -0
- package/dist/adopter/types.d.ts.map +1 -0
- package/dist/adopter/types.js +2 -0
- package/dist/adopter/types.js.map +1 -0
- package/dist/agentcore/agentcore-execution-host.d.ts.map +1 -1
- package/dist/agentcore/agentcore-execution-host.js +7 -4
- package/dist/agentcore/agentcore-execution-host.js.map +1 -1
- package/dist/agentcore/index.d.ts +2 -0
- package/dist/agentcore/index.d.ts.map +1 -1
- package/dist/agentcore/index.js +1 -0
- package/dist/agentcore/index.js.map +1 -1
- package/dist/agentcore/schemas.d.ts +11 -0
- package/dist/agentcore/schemas.d.ts.map +1 -0
- package/dist/agentcore/schemas.js +12 -0
- package/dist/agentcore/schemas.js.map +1 -0
- package/dist/agentcore/types.d.ts +2 -4
- package/dist/agentcore/types.d.ts.map +1 -1
- package/dist/agentcore/types.js.map +1 -1
- package/dist/coordinator/contracts.d.ts +367 -2
- package/dist/coordinator/contracts.d.ts.map +1 -1
- package/dist/coordinator/contracts.js +72 -2
- package/dist/coordinator/contracts.js.map +1 -1
- package/dist/coordinator/hosted-heartbeat-coordinator-client.d.ts +6 -2
- package/dist/coordinator/hosted-heartbeat-coordinator-client.d.ts.map +1 -1
- package/dist/coordinator/hosted-heartbeat-coordinator-client.js +21 -1
- package/dist/coordinator/hosted-heartbeat-coordinator-client.js.map +1 -1
- package/dist/coordinator/index.d.ts +2 -2
- package/dist/coordinator/index.d.ts.map +1 -1
- package/dist/coordinator/index.js +1 -1
- package/dist/coordinator/index.js.map +1 -1
- package/dist/coordinator/types.d.ts +7 -3
- package/dist/coordinator/types.d.ts.map +1 -1
- package/dist/coordinator/types.js.map +1 -1
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +1 -0
- package/dist/host/index.js.map +1 -1
- package/dist/host/runtime-session/errors.d.ts +21 -0
- package/dist/host/runtime-session/errors.d.ts.map +1 -0
- package/dist/host/runtime-session/errors.js +21 -0
- package/dist/host/runtime-session/errors.js.map +1 -0
- package/dist/host/runtime-session/index.d.ts +9 -0
- package/dist/host/runtime-session/index.d.ts.map +1 -0
- package/dist/host/runtime-session/index.js +5 -0
- package/dist/host/runtime-session/index.js.map +1 -0
- package/dist/host/runtime-session/scope-binding.d.ts +17 -0
- package/dist/host/runtime-session/scope-binding.d.ts.map +1 -0
- package/dist/host/runtime-session/scope-binding.js +37 -0
- package/dist/host/runtime-session/scope-binding.js.map +1 -0
- package/dist/host/runtime-session/service.d.ts +38 -0
- package/dist/host/runtime-session/service.d.ts.map +1 -0
- package/dist/host/runtime-session/service.js +177 -0
- package/dist/host/runtime-session/service.js.map +1 -0
- package/dist/host/runtime-session/status.d.ts +17 -0
- package/dist/host/runtime-session/status.d.ts.map +1 -0
- package/dist/host/runtime-session/status.js +33 -0
- package/dist/host/runtime-session/status.js.map +1 -0
- package/dist/host/runtime-session/types.d.ts +61 -0
- package/dist/host/runtime-session/types.d.ts.map +1 -0
- package/dist/host/runtime-session/types.js +2 -0
- package/dist/host/runtime-session/types.js.map +1 -0
- package/dist/http-sse/direct-http-execution-host.d.ts.map +1 -1
- package/dist/http-sse/direct-http-execution-host.js +10 -177
- package/dist/http-sse/direct-http-execution-host.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/execution-host-event-stream.d.ts +18 -0
- package/dist/internal/execution-host-event-stream.d.ts.map +1 -0
- package/dist/internal/execution-host-event-stream.js +141 -0
- package/dist/internal/execution-host-event-stream.js.map +1 -0
- package/dist/internal/http-response.d.ts +4 -0
- package/dist/internal/http-response.d.ts.map +1 -0
- package/dist/internal/http-response.js +57 -0
- package/dist/internal/http-response.js.map +1 -0
- package/dist/node/http-service.d.ts +0 -2
- package/dist/node/http-service.d.ts.map +1 -1
- package/dist/node/http-service.js +1 -2
- package/dist/node/http-service.js.map +1 -1
- package/dist/node/index.d.ts +2 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +2 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +6 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const HOSTED_HEARTBEAT_COORDINATOR_PATHS: Readonly<{
|
|
3
|
+
state: "/v1/coordinator";
|
|
3
4
|
tasks: "/v1/heartbeat/tasks";
|
|
4
5
|
pause: "/v1/control/pause";
|
|
5
6
|
resume: "/v1/control/resume";
|
|
7
|
+
drain: "/v1/control/drain";
|
|
6
8
|
}>;
|
|
7
9
|
export declare const HOSTED_HEARTBEAT_DELEGATIONS_PATH = "/hosted-execution/internal/heartbeat-delegations";
|
|
8
10
|
export declare const HostedHeartbeatCoordinatorTaskInputSchema: z.ZodObject<{
|
|
@@ -21,14 +23,374 @@ export declare const HostedHeartbeatCoordinatorTaskInputSchema: z.ZodObject<{
|
|
|
21
23
|
searchIgnoreDirs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
24
|
systemContext: z.ZodOptional<z.ZodString>;
|
|
23
25
|
}, z.core.$strict>;
|
|
24
|
-
export declare const
|
|
26
|
+
export declare const HostedHeartbeatCoordinatorStateSchema: z.ZodEnum<{
|
|
27
|
+
running: "running";
|
|
28
|
+
paused: "paused";
|
|
29
|
+
drained: "drained";
|
|
30
|
+
stopped: "stopped";
|
|
31
|
+
}>;
|
|
32
|
+
export declare const HostedHeartbeatCoordinatorStateResponseSchema: z.ZodObject<{
|
|
33
|
+
state: z.ZodEnum<{
|
|
34
|
+
running: "running";
|
|
35
|
+
paused: "paused";
|
|
36
|
+
drained: "drained";
|
|
37
|
+
stopped: "stopped";
|
|
38
|
+
}>;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export declare const HostedHeartbeatCoordinatorTaskStatusSchema: z.ZodEnum<{
|
|
41
|
+
running: "running";
|
|
42
|
+
failed: "failed";
|
|
43
|
+
idle: "idle";
|
|
44
|
+
waiting: "waiting";
|
|
45
|
+
blocked: "blocked";
|
|
46
|
+
complete: "complete";
|
|
47
|
+
}>;
|
|
48
|
+
export declare const HostedHeartbeatCoordinatorTaskResultSchema: z.ZodObject<{
|
|
49
|
+
kind: z.ZodEnum<{
|
|
50
|
+
agent: "agent";
|
|
51
|
+
cancelled: "cancelled";
|
|
52
|
+
failed: "failed";
|
|
53
|
+
blocked: "blocked";
|
|
54
|
+
skipped: "skipped";
|
|
55
|
+
retry: "retry";
|
|
56
|
+
}>;
|
|
57
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
continue: "continue";
|
|
59
|
+
pause: "pause";
|
|
60
|
+
complete: "complete";
|
|
61
|
+
escalate: "escalate";
|
|
62
|
+
}>>;
|
|
63
|
+
summary: z.ZodString;
|
|
64
|
+
outcome: z.ZodString;
|
|
65
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
66
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
67
|
+
}, z.core.$loose>;
|
|
68
|
+
/** Stable product/operator projection returned by the Coordinator API. */
|
|
69
|
+
export declare const HostedHeartbeatCoordinatorTaskViewSchema: z.ZodObject<{
|
|
25
70
|
id: z.ZodString;
|
|
71
|
+
taskId: z.ZodString;
|
|
26
72
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodOptional<z.ZodString>;
|
|
74
|
+
task: z.ZodString;
|
|
75
|
+
enabled: z.ZodBoolean;
|
|
76
|
+
continuationMode: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
operator: "operator";
|
|
78
|
+
agent: "agent";
|
|
79
|
+
}>>;
|
|
80
|
+
schedule: z.ZodObject<{
|
|
81
|
+
intervalMs: z.ZodNumber;
|
|
82
|
+
nextRunAt: z.ZodOptional<z.ZodISODateTime>;
|
|
83
|
+
}, z.core.$loose>;
|
|
84
|
+
state: z.ZodObject<{
|
|
85
|
+
status: z.ZodEnum<{
|
|
86
|
+
running: "running";
|
|
87
|
+
failed: "failed";
|
|
88
|
+
idle: "idle";
|
|
89
|
+
waiting: "waiting";
|
|
90
|
+
blocked: "blocked";
|
|
91
|
+
complete: "complete";
|
|
92
|
+
}>;
|
|
93
|
+
progress: z.ZodOptional<z.ZodString>;
|
|
94
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
runAt: z.ZodOptional<z.ZodISODateTime>;
|
|
96
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
kind: z.ZodEnum<{
|
|
100
|
+
agent: "agent";
|
|
101
|
+
cancelled: "cancelled";
|
|
102
|
+
failed: "failed";
|
|
103
|
+
blocked: "blocked";
|
|
104
|
+
skipped: "skipped";
|
|
105
|
+
retry: "retry";
|
|
106
|
+
}>;
|
|
107
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
108
|
+
continue: "continue";
|
|
109
|
+
pause: "pause";
|
|
110
|
+
complete: "complete";
|
|
111
|
+
escalate: "escalate";
|
|
112
|
+
}>>;
|
|
113
|
+
summary: z.ZodString;
|
|
114
|
+
outcome: z.ZodString;
|
|
115
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
+
}, z.core.$loose>>;
|
|
118
|
+
error: z.ZodOptional<z.ZodString>;
|
|
119
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
120
|
+
}, z.core.$loose>;
|
|
27
121
|
}, z.core.$loose>;
|
|
28
122
|
export declare const HostedHeartbeatCoordinatorTaskListSchema: z.ZodObject<{
|
|
29
123
|
tasks: z.ZodArray<z.ZodObject<{
|
|
30
124
|
id: z.ZodString;
|
|
125
|
+
taskId: z.ZodString;
|
|
126
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
name: z.ZodOptional<z.ZodString>;
|
|
128
|
+
task: z.ZodString;
|
|
129
|
+
enabled: z.ZodBoolean;
|
|
130
|
+
continuationMode: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
operator: "operator";
|
|
132
|
+
agent: "agent";
|
|
133
|
+
}>>;
|
|
134
|
+
schedule: z.ZodObject<{
|
|
135
|
+
intervalMs: z.ZodNumber;
|
|
136
|
+
nextRunAt: z.ZodOptional<z.ZodISODateTime>;
|
|
137
|
+
}, z.core.$loose>;
|
|
138
|
+
state: z.ZodObject<{
|
|
139
|
+
status: z.ZodEnum<{
|
|
140
|
+
running: "running";
|
|
141
|
+
failed: "failed";
|
|
142
|
+
idle: "idle";
|
|
143
|
+
waiting: "waiting";
|
|
144
|
+
blocked: "blocked";
|
|
145
|
+
complete: "complete";
|
|
146
|
+
}>;
|
|
147
|
+
progress: z.ZodOptional<z.ZodString>;
|
|
148
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
149
|
+
runAt: z.ZodOptional<z.ZodISODateTime>;
|
|
150
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
kind: z.ZodEnum<{
|
|
154
|
+
agent: "agent";
|
|
155
|
+
cancelled: "cancelled";
|
|
156
|
+
failed: "failed";
|
|
157
|
+
blocked: "blocked";
|
|
158
|
+
skipped: "skipped";
|
|
159
|
+
retry: "retry";
|
|
160
|
+
}>;
|
|
161
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
162
|
+
continue: "continue";
|
|
163
|
+
pause: "pause";
|
|
164
|
+
complete: "complete";
|
|
165
|
+
escalate: "escalate";
|
|
166
|
+
}>>;
|
|
167
|
+
summary: z.ZodString;
|
|
168
|
+
outcome: z.ZodString;
|
|
169
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
170
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
171
|
+
}, z.core.$loose>>;
|
|
172
|
+
error: z.ZodOptional<z.ZodString>;
|
|
173
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
174
|
+
}, z.core.$loose>;
|
|
175
|
+
}, z.core.$loose>>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
export declare const HostedHeartbeatCoordinatorRunViewSchema: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
taskId: z.ZodString;
|
|
180
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
181
|
+
executionId: z.ZodString;
|
|
182
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
183
|
+
createdAt: z.ZodISODateTime;
|
|
184
|
+
task: z.ZodObject<{
|
|
185
|
+
id: z.ZodString;
|
|
186
|
+
taskId: z.ZodString;
|
|
31
187
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
188
|
+
name: z.ZodOptional<z.ZodString>;
|
|
189
|
+
task: z.ZodString;
|
|
190
|
+
enabled: z.ZodBoolean;
|
|
191
|
+
continuationMode: z.ZodOptional<z.ZodEnum<{
|
|
192
|
+
operator: "operator";
|
|
193
|
+
agent: "agent";
|
|
194
|
+
}>>;
|
|
195
|
+
schedule: z.ZodObject<{
|
|
196
|
+
intervalMs: z.ZodNumber;
|
|
197
|
+
nextRunAt: z.ZodOptional<z.ZodISODateTime>;
|
|
198
|
+
}, z.core.$loose>;
|
|
199
|
+
state: z.ZodObject<{
|
|
200
|
+
status: z.ZodEnum<{
|
|
201
|
+
running: "running";
|
|
202
|
+
failed: "failed";
|
|
203
|
+
idle: "idle";
|
|
204
|
+
waiting: "waiting";
|
|
205
|
+
blocked: "blocked";
|
|
206
|
+
complete: "complete";
|
|
207
|
+
}>;
|
|
208
|
+
progress: z.ZodOptional<z.ZodString>;
|
|
209
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
210
|
+
runAt: z.ZodOptional<z.ZodISODateTime>;
|
|
211
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
212
|
+
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
213
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
kind: z.ZodEnum<{
|
|
215
|
+
agent: "agent";
|
|
216
|
+
cancelled: "cancelled";
|
|
217
|
+
failed: "failed";
|
|
218
|
+
blocked: "blocked";
|
|
219
|
+
skipped: "skipped";
|
|
220
|
+
retry: "retry";
|
|
221
|
+
}>;
|
|
222
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
223
|
+
continue: "continue";
|
|
224
|
+
pause: "pause";
|
|
225
|
+
complete: "complete";
|
|
226
|
+
escalate: "escalate";
|
|
227
|
+
}>>;
|
|
228
|
+
summary: z.ZodString;
|
|
229
|
+
outcome: z.ZodString;
|
|
230
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
231
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
232
|
+
}, z.core.$loose>>;
|
|
233
|
+
error: z.ZodOptional<z.ZodString>;
|
|
234
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
235
|
+
}, z.core.$loose>;
|
|
236
|
+
}, z.core.$loose>;
|
|
237
|
+
result: z.ZodObject<{
|
|
238
|
+
kind: z.ZodEnum<{
|
|
239
|
+
agent: "agent";
|
|
240
|
+
cancelled: "cancelled";
|
|
241
|
+
failed: "failed";
|
|
242
|
+
blocked: "blocked";
|
|
243
|
+
skipped: "skipped";
|
|
244
|
+
retry: "retry";
|
|
245
|
+
}>;
|
|
246
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
247
|
+
continue: "continue";
|
|
248
|
+
pause: "pause";
|
|
249
|
+
complete: "complete";
|
|
250
|
+
escalate: "escalate";
|
|
251
|
+
}>>;
|
|
252
|
+
summary: z.ZodString;
|
|
253
|
+
outcome: z.ZodString;
|
|
254
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
256
|
+
}, z.core.$loose>;
|
|
257
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
}, z.core.$loose>;
|
|
259
|
+
export declare const HostedHeartbeatCoordinatorTaskDetailSchema: z.ZodObject<{
|
|
260
|
+
task: z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
taskId: z.ZodString;
|
|
263
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
264
|
+
name: z.ZodOptional<z.ZodString>;
|
|
265
|
+
task: z.ZodString;
|
|
266
|
+
enabled: z.ZodBoolean;
|
|
267
|
+
continuationMode: z.ZodOptional<z.ZodEnum<{
|
|
268
|
+
operator: "operator";
|
|
269
|
+
agent: "agent";
|
|
270
|
+
}>>;
|
|
271
|
+
schedule: z.ZodObject<{
|
|
272
|
+
intervalMs: z.ZodNumber;
|
|
273
|
+
nextRunAt: z.ZodOptional<z.ZodISODateTime>;
|
|
274
|
+
}, z.core.$loose>;
|
|
275
|
+
state: z.ZodObject<{
|
|
276
|
+
status: z.ZodEnum<{
|
|
277
|
+
running: "running";
|
|
278
|
+
failed: "failed";
|
|
279
|
+
idle: "idle";
|
|
280
|
+
waiting: "waiting";
|
|
281
|
+
blocked: "blocked";
|
|
282
|
+
complete: "complete";
|
|
283
|
+
}>;
|
|
284
|
+
progress: z.ZodOptional<z.ZodString>;
|
|
285
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
286
|
+
runAt: z.ZodOptional<z.ZodISODateTime>;
|
|
287
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
+
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
290
|
+
kind: z.ZodEnum<{
|
|
291
|
+
agent: "agent";
|
|
292
|
+
cancelled: "cancelled";
|
|
293
|
+
failed: "failed";
|
|
294
|
+
blocked: "blocked";
|
|
295
|
+
skipped: "skipped";
|
|
296
|
+
retry: "retry";
|
|
297
|
+
}>;
|
|
298
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
299
|
+
continue: "continue";
|
|
300
|
+
pause: "pause";
|
|
301
|
+
complete: "complete";
|
|
302
|
+
escalate: "escalate";
|
|
303
|
+
}>>;
|
|
304
|
+
summary: z.ZodString;
|
|
305
|
+
outcome: z.ZodString;
|
|
306
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
307
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
308
|
+
}, z.core.$loose>>;
|
|
309
|
+
error: z.ZodOptional<z.ZodString>;
|
|
310
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
311
|
+
}, z.core.$loose>;
|
|
312
|
+
}, z.core.$loose>;
|
|
313
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
314
|
+
id: z.ZodString;
|
|
315
|
+
taskId: z.ZodString;
|
|
316
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
317
|
+
executionId: z.ZodString;
|
|
318
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
319
|
+
createdAt: z.ZodISODateTime;
|
|
320
|
+
task: z.ZodObject<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
taskId: z.ZodString;
|
|
323
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
324
|
+
name: z.ZodOptional<z.ZodString>;
|
|
325
|
+
task: z.ZodString;
|
|
326
|
+
enabled: z.ZodBoolean;
|
|
327
|
+
continuationMode: z.ZodOptional<z.ZodEnum<{
|
|
328
|
+
operator: "operator";
|
|
329
|
+
agent: "agent";
|
|
330
|
+
}>>;
|
|
331
|
+
schedule: z.ZodObject<{
|
|
332
|
+
intervalMs: z.ZodNumber;
|
|
333
|
+
nextRunAt: z.ZodOptional<z.ZodISODateTime>;
|
|
334
|
+
}, z.core.$loose>;
|
|
335
|
+
state: z.ZodObject<{
|
|
336
|
+
status: z.ZodEnum<{
|
|
337
|
+
running: "running";
|
|
338
|
+
failed: "failed";
|
|
339
|
+
idle: "idle";
|
|
340
|
+
waiting: "waiting";
|
|
341
|
+
blocked: "blocked";
|
|
342
|
+
complete: "complete";
|
|
343
|
+
}>;
|
|
344
|
+
progress: z.ZodOptional<z.ZodString>;
|
|
345
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
346
|
+
runAt: z.ZodOptional<z.ZodISODateTime>;
|
|
347
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
348
|
+
resumable: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
350
|
+
kind: z.ZodEnum<{
|
|
351
|
+
agent: "agent";
|
|
352
|
+
cancelled: "cancelled";
|
|
353
|
+
failed: "failed";
|
|
354
|
+
blocked: "blocked";
|
|
355
|
+
skipped: "skipped";
|
|
356
|
+
retry: "retry";
|
|
357
|
+
}>;
|
|
358
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
continue: "continue";
|
|
360
|
+
pause: "pause";
|
|
361
|
+
complete: "complete";
|
|
362
|
+
escalate: "escalate";
|
|
363
|
+
}>>;
|
|
364
|
+
summary: z.ZodString;
|
|
365
|
+
outcome: z.ZodString;
|
|
366
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
367
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
368
|
+
}, z.core.$loose>>;
|
|
369
|
+
error: z.ZodOptional<z.ZodString>;
|
|
370
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
371
|
+
}, z.core.$loose>;
|
|
372
|
+
}, z.core.$loose>;
|
|
373
|
+
result: z.ZodObject<{
|
|
374
|
+
kind: z.ZodEnum<{
|
|
375
|
+
agent: "agent";
|
|
376
|
+
cancelled: "cancelled";
|
|
377
|
+
failed: "failed";
|
|
378
|
+
blocked: "blocked";
|
|
379
|
+
skipped: "skipped";
|
|
380
|
+
retry: "retry";
|
|
381
|
+
}>;
|
|
382
|
+
decision: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
continue: "continue";
|
|
384
|
+
pause: "pause";
|
|
385
|
+
complete: "complete";
|
|
386
|
+
escalate: "escalate";
|
|
387
|
+
}>>;
|
|
388
|
+
summary: z.ZodString;
|
|
389
|
+
outcome: z.ZodString;
|
|
390
|
+
agentRunId: z.ZodOptional<z.ZodString>;
|
|
391
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
392
|
+
}, z.core.$loose>;
|
|
393
|
+
loadedCheckpoint: z.ZodOptional<z.ZodBoolean>;
|
|
32
394
|
}, z.core.$loose>>;
|
|
33
395
|
}, z.core.$strict>;
|
|
34
396
|
export declare const HostedHeartbeatDesiredTaskSchema: z.ZodObject<{
|
|
@@ -121,7 +483,10 @@ export declare const HostedHeartbeatDelegationAuthorizationSchema: z.ZodObject<{
|
|
|
121
483
|
allowedTools: z.ZodArray<z.ZodString>;
|
|
122
484
|
}, z.core.$strict>;
|
|
123
485
|
export type HostedHeartbeatCoordinatorTaskInput = z.infer<typeof HostedHeartbeatCoordinatorTaskInputSchema>;
|
|
124
|
-
export type
|
|
486
|
+
export type HostedHeartbeatCoordinatorState = z.infer<typeof HostedHeartbeatCoordinatorStateSchema>;
|
|
487
|
+
export type HostedHeartbeatCoordinatorTaskView = z.infer<typeof HostedHeartbeatCoordinatorTaskViewSchema>;
|
|
488
|
+
export type HostedHeartbeatCoordinatorRunView = z.infer<typeof HostedHeartbeatCoordinatorRunViewSchema>;
|
|
489
|
+
export type HostedHeartbeatCoordinatorTaskDetail = z.infer<typeof HostedHeartbeatCoordinatorTaskDetailSchema>;
|
|
125
490
|
export type HostedHeartbeatDesiredTask = z.infer<typeof HostedHeartbeatDesiredTaskSchema>;
|
|
126
491
|
export type HostedHeartbeatDesiredTaskCatalog = z.infer<typeof HostedHeartbeatDesiredTaskCatalogSchema>;
|
|
127
492
|
export type HostedHeartbeatDelegationRequest = z.infer<typeof HostedHeartbeatDelegationRequestSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/coordinator/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,kCAAkC
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/coordinator/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,kCAAkC;;;;;;EAM7C,CAAC;AAEH,eAAO,MAAM,iCAAiC,qDACM,CAAC;AAErD,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;kBAc3C,CAAC;AAEZ,eAAO,MAAM,qCAAqC;;;;;EAKhD,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;;kBAE/C,CAAC;AAEZ,eAAO,MAAM,0CAA0C;;;;;;;EAOrD,CAAC;AAEH,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;;;;;;iBAcvC,CAAC;AAEjB,0EAA0E;AAC1E,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBrC,CAAC;AAEjB,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE1C,CAAC;AAEZ,e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AM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC"}
|
|
@@ -4,9 +4,11 @@ const ProductExecutionScopeSchema = ExecutionScopeSchema.omit({
|
|
|
4
4
|
adopterId: true,
|
|
5
5
|
});
|
|
6
6
|
export const HOSTED_HEARTBEAT_COORDINATOR_PATHS = Object.freeze({
|
|
7
|
+
state: '/v1/coordinator',
|
|
7
8
|
tasks: '/v1/heartbeat/tasks',
|
|
8
9
|
pause: '/v1/control/pause',
|
|
9
10
|
resume: '/v1/control/resume',
|
|
11
|
+
drain: '/v1/control/drain',
|
|
10
12
|
});
|
|
11
13
|
export const HOSTED_HEARTBEAT_DELEGATIONS_PATH = '/hosted-execution/internal/heartbeat-delegations';
|
|
12
14
|
export const HostedHeartbeatCoordinatorTaskInputSchema = z.object({
|
|
@@ -24,12 +26,80 @@ export const HostedHeartbeatCoordinatorTaskInputSchema = z.object({
|
|
|
24
26
|
.optional(),
|
|
25
27
|
systemContext: z.string().max(200_000).optional(),
|
|
26
28
|
}).strict();
|
|
27
|
-
export const
|
|
29
|
+
export const HostedHeartbeatCoordinatorStateSchema = z.enum([
|
|
30
|
+
'running',
|
|
31
|
+
'paused',
|
|
32
|
+
'drained',
|
|
33
|
+
'stopped',
|
|
34
|
+
]);
|
|
35
|
+
export const HostedHeartbeatCoordinatorStateResponseSchema = z.object({
|
|
36
|
+
state: HostedHeartbeatCoordinatorStateSchema,
|
|
37
|
+
}).strict();
|
|
38
|
+
export const HostedHeartbeatCoordinatorTaskStatusSchema = z.enum([
|
|
39
|
+
'idle',
|
|
40
|
+
'running',
|
|
41
|
+
'waiting',
|
|
42
|
+
'blocked',
|
|
43
|
+
'complete',
|
|
44
|
+
'failed',
|
|
45
|
+
]);
|
|
46
|
+
export const HostedHeartbeatCoordinatorTaskResultSchema = z.object({
|
|
47
|
+
kind: z.enum([
|
|
48
|
+
'agent',
|
|
49
|
+
'skipped',
|
|
50
|
+
'cancelled',
|
|
51
|
+
'retry',
|
|
52
|
+
'blocked',
|
|
53
|
+
'failed',
|
|
54
|
+
]),
|
|
55
|
+
decision: z.enum(['continue', 'pause', 'complete', 'escalate']).optional(),
|
|
56
|
+
summary: z.string(),
|
|
57
|
+
outcome: z.string(),
|
|
58
|
+
agentRunId: OpaqueIdSchema.optional(),
|
|
59
|
+
usage: z.unknown().optional(),
|
|
60
|
+
}).passthrough();
|
|
61
|
+
/** Stable product/operator projection returned by the Coordinator API. */
|
|
62
|
+
export const HostedHeartbeatCoordinatorTaskViewSchema = z.object({
|
|
28
63
|
id: OpaqueIdSchema,
|
|
64
|
+
taskId: OpaqueIdSchema,
|
|
29
65
|
workspaceId: OpaqueIdSchema.optional(),
|
|
66
|
+
name: z.string().optional(),
|
|
67
|
+
task: z.string(),
|
|
68
|
+
enabled: z.boolean(),
|
|
69
|
+
continuationMode: z.enum(['operator', 'agent']).optional(),
|
|
70
|
+
schedule: z.object({
|
|
71
|
+
intervalMs: z.number().int().positive(),
|
|
72
|
+
nextRunAt: TimestampSchema.optional(),
|
|
73
|
+
}).passthrough(),
|
|
74
|
+
state: z.object({
|
|
75
|
+
status: HostedHeartbeatCoordinatorTaskStatusSchema,
|
|
76
|
+
progress: z.string().optional(),
|
|
77
|
+
runId: OpaqueIdSchema.optional(),
|
|
78
|
+
runAt: TimestampSchema.optional(),
|
|
79
|
+
loadedCheckpoint: z.boolean().optional(),
|
|
80
|
+
resumable: z.boolean().optional(),
|
|
81
|
+
result: HostedHeartbeatCoordinatorTaskResultSchema.optional(),
|
|
82
|
+
error: z.string().optional(),
|
|
83
|
+
updatedAt: TimestampSchema.optional(),
|
|
84
|
+
}).passthrough(),
|
|
30
85
|
}).passthrough();
|
|
31
86
|
export const HostedHeartbeatCoordinatorTaskListSchema = z.object({
|
|
32
|
-
tasks: z.array(
|
|
87
|
+
tasks: z.array(HostedHeartbeatCoordinatorTaskViewSchema),
|
|
88
|
+
}).strict();
|
|
89
|
+
export const HostedHeartbeatCoordinatorRunViewSchema = z.object({
|
|
90
|
+
id: OpaqueIdSchema,
|
|
91
|
+
taskId: OpaqueIdSchema,
|
|
92
|
+
workspaceId: OpaqueIdSchema.optional(),
|
|
93
|
+
executionId: OpaqueIdSchema,
|
|
94
|
+
runId: OpaqueIdSchema.optional(),
|
|
95
|
+
createdAt: TimestampSchema,
|
|
96
|
+
task: HostedHeartbeatCoordinatorTaskViewSchema,
|
|
97
|
+
result: HostedHeartbeatCoordinatorTaskResultSchema,
|
|
98
|
+
loadedCheckpoint: z.boolean().optional(),
|
|
99
|
+
}).passthrough();
|
|
100
|
+
export const HostedHeartbeatCoordinatorTaskDetailSchema = z.object({
|
|
101
|
+
task: HostedHeartbeatCoordinatorTaskViewSchema,
|
|
102
|
+
runs: z.array(HostedHeartbeatCoordinatorRunViewSchema),
|
|
33
103
|
}).strict();
|
|
34
104
|
export const HostedHeartbeatDesiredTaskSchema = z.object({
|
|
35
105
|
taskId: OpaqueIdSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/coordinator/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,2BAA2B,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAC5D,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9D,KAAK,EAAE,qBAAqB;IA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AAS,KAAK,KAAK,CAAC,SAAS;WAClC,IAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,gBAAgB,CAAC;AACxD,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n ExecutionScopeSchema,\n HEARTBEAT_TASK_WORKFLOW,\n McpAllowedToolsSchema,\n McpServerIdSchema,\n OpaqueIdSchema,\n RuntimeSessionIdSchema,\n TimestampSchema,\n} from '../contracts/index.js';\n\nconst ProductExecutionScopeSchema = ExecutionScopeSchema.omit({\n adopterId: true,\n});\n\nexport const HOSTED_HEARTBEAT_COORDINATOR_PATHS = Object.freeze({\n tasks: '/v1/heartbeat/tasks',\n pause: '/v1/control/pause',\n resume: '/v1/control/resume',\n});\n\nexport const HOSTED_HEARTBEAT_DELEGATIONS_PATH =\n '/hosted-execution/internal/heartbeat-delegations';\n\nexport const HostedHeartbeatCoordinatorTaskInputSchema = z.object({\n workspaceId: OpaqueIdSchema.optional(),\n name: z.string().trim().min(1).max(200).optional(),\n task: z.string().trim().min(1).max(200_000),\n enabled: z.boolean().optional(),\n continuationMode: z.enum(['operator', 'agent']).optional(),\n intervalMs: z.number().int().min(1_000).max(Number.MAX_SAFE_INTEGER)\n .optional(),\n defer: z.boolean().optional(),\n model: z.string().trim().min(1).max(512).optional(),\n maxSteps: z.number().int().positive().max(10_000).optional(),\n searchIgnoreDirs: z.array(z.string().min(1).max(1_024)).max(1_000)\n .optional(),\n systemContext: z.string().max(200_000).optional(),\n}).strict();\n\nexport const HostedHeartbeatCoordinatorTaskSummarySchema = z.object({\n id: OpaqueIdSchema,\n workspaceId: OpaqueIdSchema.optional(),\n}).passthrough();\n\nexport const HostedHeartbeatCoordinatorTaskListSchema = z.object({\n tasks: z.array(HostedHeartbeatCoordinatorTaskSummarySchema),\n}).strict();\n\nexport const HostedHeartbeatDesiredTaskSchema = z.object({\n taskId: OpaqueIdSchema,\n input: HostedHeartbeatCoordinatorTaskInputSchema,\n}).strict();\n\nexport const HostedHeartbeatDesiredTaskCatalogSchema = z.object({\n tasks: z.array(HostedHeartbeatDesiredTaskSchema).max(10_000),\n resume: z.boolean(),\n}).strict().superRefine(({ tasks }, context) => {\n const seen = new Set<string>();\n tasks.forEach(({ taskId }, index) => {\n if (seen.has(taskId)) {\n context.addIssue({\n code: 'custom',\n path: ['tasks', index, 'taskId'],\n message: 'must be unique within the desired task catalog',\n });\n }\n seen.add(taskId);\n });\n});\n\nexport const HostedHeartbeatDelegationRequestSchema = z.object({\n schemaVersion: z.literal(1),\n taskId: OpaqueIdSchema,\n executionId: OpaqueIdSchema,\n}).strict();\n\nconst DelegatedAuthorityMetadataSchema = z.object({\n scope: ExecutionScopeSchema,\n runtimeSessionId: RuntimeSessionIdSchema,\n invocationId: OpaqueIdSchema,\n workflow: z.literal(HEARTBEAT_TASK_WORKFLOW),\n issuedAt: TimestampSchema,\n executionExpiresAt: TimestampSchema,\n mcp: z.object({\n capabilityId: OpaqueIdSchema,\n serverId: McpServerIdSchema,\n allowedTools: McpAllowedToolsSchema,\n expiresAt: TimestampSchema,\n }).strict(),\n}).strict();\n\nexport const HostedHeartbeatDelegationSchema = z.object({\n schemaVersion: z.literal(1),\n taskId: OpaqueIdSchema,\n executionId: OpaqueIdSchema,\n scope: ProductExecutionScopeSchema,\n runtimeSessionId: RuntimeSessionIdSchema,\n deadlineAt: TimestampSchema,\n authority: z.object({\n metadata: DelegatedAuthorityMetadataSchema,\n executionAssertion: z.string().min(1).max(16_384),\n mcpCapability: z.string().min(1).max(16_384),\n }).strict(),\n}).strict().superRefine((delegation, context) => {\n const metadata = delegation.authority.metadata;\n const mismatches: Array<[path: string, mismatched: boolean]> = [\n ['executionId', metadata.invocationId !== delegation.executionId],\n [\n 'runtimeSessionId',\n metadata.runtimeSessionId !== delegation.runtimeSessionId,\n ],\n ['scope', !sameProductScope(metadata.scope, delegation.scope)],\n ];\n mismatches\n .filter(([, mismatched]) => mismatched)\n .forEach(([path]) => context.addIssue({\n code: 'custom',\n path: [path],\n message: 'must match the delegated execution authority metadata',\n }));\n});\n\nexport const HostedHeartbeatDelegationAuthorizationSchema = z.object({\n scope: ProductExecutionScopeSchema,\n allowedTools: McpAllowedToolsSchema,\n}).strict();\n\nexport type HostedHeartbeatCoordinatorTaskInput = z.infer<\n typeof HostedHeartbeatCoordinatorTaskInputSchema\n>;\nexport type HostedHeartbeatCoordinatorTaskSummary = z.infer<\n typeof HostedHeartbeatCoordinatorTaskSummarySchema\n>;\nexport type HostedHeartbeatDesiredTask = z.infer<\n typeof HostedHeartbeatDesiredTaskSchema\n>;\nexport type HostedHeartbeatDesiredTaskCatalog = z.infer<\n typeof HostedHeartbeatDesiredTaskCatalogSchema\n>;\nexport type HostedHeartbeatDelegationRequest = z.infer<\n typeof HostedHeartbeatDelegationRequestSchema\n>;\nexport type HostedHeartbeatDelegation = z.infer<\n typeof HostedHeartbeatDelegationSchema\n>;\nexport type HostedHeartbeatDelegationAuthorization = z.infer<\n typeof HostedHeartbeatDelegationAuthorizationSchema\n>;\n\nfunction sameProductScope(\n left: z.infer<typeof ExecutionScopeSchema>,\n right: z.infer<typeof ProductExecutionScopeSchema>,\n): boolean {\n return left.tenantId === right.tenantId\n && left.subjectId === right.subjectId\n && left.productSessionId === right.productSessionId;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/coordinator/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,2BAA2B,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAC5D,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9D,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE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gB,CACvB,IAA0C,EAC1C,KAAkD;IAElD,OAAO,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;WAClC,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS;WAClC,IAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,gBAAgB,CAAC;AACxD,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n ExecutionScopeSchema,\n HEARTBEAT_TASK_WORKFLOW,\n McpAllowedToolsSchema,\n McpServerIdSchema,\n OpaqueIdSchema,\n RuntimeSessionIdSchema,\n TimestampSchema,\n} from '../contracts/index.js';\n\nconst ProductExecutionScopeSchema = ExecutionScopeSchema.omit({\n adopterId: true,\n});\n\nexport const HOSTED_HEARTBEAT_COORDINATOR_PATHS = Object.freeze({\n state: '/v1/coordinator',\n tasks: '/v1/heartbeat/tasks',\n pause: '/v1/control/pause',\n resume: '/v1/control/resume',\n drain: '/v1/control/drain',\n});\n\nexport const HOSTED_HEARTBEAT_DELEGATIONS_PATH =\n '/hosted-execution/internal/heartbeat-delegations';\n\nexport const HostedHeartbeatCoordinatorTaskInputSchema = z.object({\n workspaceId: OpaqueIdSchema.optional(),\n name: z.string().trim().min(1).max(200).optional(),\n task: z.string().trim().min(1).max(200_000),\n enabled: z.boolean().optional(),\n continuationMode: z.enum(['operator', 'agent']).optional(),\n intervalMs: z.number().int().min(1_000).max(Number.MAX_SAFE_INTEGER)\n .optional(),\n defer: z.boolean().optional(),\n model: z.string().trim().min(1).max(512).optional(),\n maxSteps: z.number().int().positive().max(10_000).optional(),\n searchIgnoreDirs: z.array(z.string().min(1).max(1_024)).max(1_000)\n .optional(),\n systemContext: z.string().max(200_000).optional(),\n}).strict();\n\nexport const HostedHeartbeatCoordinatorStateSchema = z.enum([\n 'running',\n 'paused',\n 'drained',\n 'stopped',\n]);\n\nexport const HostedHeartbeatCoordinatorStateResponseSchema = z.object({\n state: HostedHeartbeatCoordinatorStateSchema,\n}).strict();\n\nexport const HostedHeartbeatCoordinatorTaskStatusSchema = z.enum([\n 'idle',\n 'running',\n 'waiting',\n 'blocked',\n 'complete',\n 'failed',\n]);\n\nexport const HostedHeartbeatCoordinatorTaskResultSchema = z.object({\n kind: z.enum([\n 'agent',\n 'skipped',\n 'cancelled',\n 'retry',\n 'blocked',\n 'failed',\n ]),\n decision: z.enum(['continue', 'pause', 'complete', 'escalate']).optional(),\n summary: z.string(),\n outcome: z.string(),\n agentRunId: OpaqueIdSchema.optional(),\n usage: z.unknown().optional(),\n}).passthrough();\n\n/** Stable product/operator projection returned by the Coordinator API. */\nexport const HostedHeartbeatCoordinatorTaskViewSchema = z.object({\n id: OpaqueIdSchema,\n taskId: OpaqueIdSchema,\n workspaceId: OpaqueIdSchema.optional(),\n name: z.string().optional(),\n task: z.string(),\n enabled: z.boolean(),\n continuationMode: z.enum(['operator', 'agent']).optional(),\n schedule: z.object({\n intervalMs: z.number().int().positive(),\n nextRunAt: TimestampSchema.optional(),\n }).passthrough(),\n state: z.object({\n status: HostedHeartbeatCoordinatorTaskStatusSchema,\n progress: z.string().optional(),\n runId: OpaqueIdSchema.optional(),\n runAt: TimestampSchema.optional(),\n loadedCheckpoint: z.boolean().optional(),\n resumable: z.boolean().optional(),\n result: HostedHeartbeatCoordinatorTaskResultSchema.optional(),\n error: z.string().optional(),\n updatedAt: TimestampSchema.optional(),\n }).passthrough(),\n}).passthrough();\n\nexport const HostedHeartbeatCoordinatorTaskListSchema = z.object({\n tasks: z.array(HostedHeartbeatCoordinatorTaskViewSchema),\n}).strict();\n\nexport const HostedHeartbeatCoordinatorRunViewSchema = z.object({\n id: OpaqueIdSchema,\n taskId: OpaqueIdSchema,\n workspaceId: OpaqueIdSchema.optional(),\n executionId: OpaqueIdSchema,\n runId: OpaqueIdSchema.optional(),\n createdAt: TimestampSchema,\n task: HostedHeartbeatCoordinatorTaskViewSchema,\n result: HostedHeartbeatCoordinatorTaskResultSchema,\n loadedCheckpoint: z.boolean().optional(),\n}).passthrough();\n\nexport const HostedHeartbeatCoordinatorTaskDetailSchema = z.object({\n task: HostedHeartbeatCoordinatorTaskViewSchema,\n runs: z.array(HostedHeartbeatCoordinatorRunViewSchema),\n}).strict();\n\nexport const HostedHeartbeatDesiredTaskSchema = z.object({\n taskId: OpaqueIdSchema,\n input: HostedHeartbeatCoordinatorTaskInputSchema,\n}).strict();\n\nexport const HostedHeartbeatDesiredTaskCatalogSchema = z.object({\n tasks: z.array(HostedHeartbeatDesiredTaskSchema).max(10_000),\n resume: z.boolean(),\n}).strict().superRefine(({ tasks }, context) => {\n const seen = new Set<string>();\n tasks.forEach(({ taskId }, index) => {\n if (seen.has(taskId)) {\n context.addIssue({\n code: 'custom',\n path: ['tasks', index, 'taskId'],\n message: 'must be unique within the desired task catalog',\n });\n }\n seen.add(taskId);\n });\n});\n\nexport const HostedHeartbeatDelegationRequestSchema = z.object({\n schemaVersion: z.literal(1),\n taskId: OpaqueIdSchema,\n executionId: OpaqueIdSchema,\n}).strict();\n\nconst DelegatedAuthorityMetadataSchema = z.object({\n scope: ExecutionScopeSchema,\n runtimeSessionId: RuntimeSessionIdSchema,\n invocationId: OpaqueIdSchema,\n workflow: z.literal(HEARTBEAT_TASK_WORKFLOW),\n issuedAt: TimestampSchema,\n executionExpiresAt: TimestampSchema,\n mcp: z.object({\n capabilityId: OpaqueIdSchema,\n serverId: McpServerIdSchema,\n allowedTools: McpAllowedToolsSchema,\n expiresAt: TimestampSchema,\n }).strict(),\n}).strict();\n\nexport const HostedHeartbeatDelegationSchema = z.object({\n schemaVersion: z.literal(1),\n taskId: OpaqueIdSchema,\n executionId: OpaqueIdSchema,\n scope: ProductExecutionScopeSchema,\n runtimeSessionId: RuntimeSessionIdSchema,\n deadlineAt: TimestampSchema,\n authority: z.object({\n metadata: DelegatedAuthorityMetadataSchema,\n executionAssertion: z.string().min(1).max(16_384),\n mcpCapability: z.string().min(1).max(16_384),\n }).strict(),\n}).strict().superRefine((delegation, context) => {\n const metadata = delegation.authority.metadata;\n const mismatches: Array<[path: string, mismatched: boolean]> = [\n ['executionId', metadata.invocationId !== delegation.executionId],\n [\n 'runtimeSessionId',\n metadata.runtimeSessionId !== delegation.runtimeSessionId,\n ],\n ['scope', !sameProductScope(metadata.scope, delegation.scope)],\n ];\n mismatches\n .filter(([, mismatched]) => mismatched)\n .forEach(([path]) => context.addIssue({\n code: 'custom',\n path: [path],\n message: 'must match the delegated execution authority metadata',\n }));\n});\n\nexport const HostedHeartbeatDelegationAuthorizationSchema = z.object({\n scope: ProductExecutionScopeSchema,\n allowedTools: McpAllowedToolsSchema,\n}).strict();\n\nexport type HostedHeartbeatCoordinatorTaskInput = z.infer<\n typeof HostedHeartbeatCoordinatorTaskInputSchema\n>;\nexport type HostedHeartbeatCoordinatorState = z.infer<\n typeof HostedHeartbeatCoordinatorStateSchema\n>;\nexport type HostedHeartbeatCoordinatorTaskView = z.infer<\n typeof HostedHeartbeatCoordinatorTaskViewSchema\n>;\nexport type HostedHeartbeatCoordinatorRunView = z.infer<\n typeof HostedHeartbeatCoordinatorRunViewSchema\n>;\nexport type HostedHeartbeatCoordinatorTaskDetail = z.infer<\n typeof HostedHeartbeatCoordinatorTaskDetailSchema\n>;\nexport type HostedHeartbeatDesiredTask = z.infer<\n typeof HostedHeartbeatDesiredTaskSchema\n>;\nexport type HostedHeartbeatDesiredTaskCatalog = z.infer<\n typeof HostedHeartbeatDesiredTaskCatalogSchema\n>;\nexport type HostedHeartbeatDelegationRequest = z.infer<\n typeof HostedHeartbeatDelegationRequestSchema\n>;\nexport type HostedHeartbeatDelegation = z.infer<\n typeof HostedHeartbeatDelegationSchema\n>;\nexport type HostedHeartbeatDelegationAuthorization = z.infer<\n typeof HostedHeartbeatDelegationAuthorizationSchema\n>;\n\nfunction sameProductScope(\n left: z.infer<typeof ExecutionScopeSchema>,\n right: z.infer<typeof ProductExecutionScopeSchema>,\n): boolean {\n return left.tenantId === right.tenantId\n && left.subjectId === right.subjectId\n && left.productSessionId === right.productSessionId;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HostedHeartbeatCoordinatorTaskInput, type
|
|
1
|
+
import { type HostedHeartbeatCoordinatorTaskInput, type HostedHeartbeatCoordinatorState, type HostedHeartbeatCoordinatorTaskDetail, type HostedHeartbeatCoordinatorTaskView } from './contracts.js';
|
|
2
2
|
import type { HostedHeartbeatCoordinatorClientConfig, HostedHeartbeatCoordinatorTaskApi } from './types.js';
|
|
3
3
|
export declare class HostedHeartbeatCoordinatorRequestError extends Error {
|
|
4
4
|
readonly method: string;
|
|
@@ -11,10 +11,14 @@ export declare class HostedHeartbeatCoordinatorRequestError extends Error {
|
|
|
11
11
|
export declare class HostedHeartbeatCoordinatorClient implements HostedHeartbeatCoordinatorTaskApi {
|
|
12
12
|
#private;
|
|
13
13
|
constructor(config: HostedHeartbeatCoordinatorClientConfig);
|
|
14
|
-
|
|
14
|
+
readState(signal?: AbortSignal): Promise<HostedHeartbeatCoordinatorState>;
|
|
15
|
+
listTasks(signal?: AbortSignal): Promise<HostedHeartbeatCoordinatorTaskView[]>;
|
|
16
|
+
readTask(rawTaskId: string, signal?: AbortSignal): Promise<HostedHeartbeatCoordinatorTaskDetail>;
|
|
15
17
|
upsertTask(rawTaskId: string, rawTask: HostedHeartbeatCoordinatorTaskInput, signal?: AbortSignal): Promise<void>;
|
|
16
18
|
deleteTask(rawTaskId: string, signal?: AbortSignal): Promise<void>;
|
|
19
|
+
triggerTask(rawTaskId: string, signal?: AbortSignal): Promise<HostedHeartbeatCoordinatorTaskView>;
|
|
17
20
|
pause(signal?: AbortSignal): Promise<void>;
|
|
18
21
|
resume(signal?: AbortSignal): Promise<void>;
|
|
22
|
+
drain(signal?: AbortSignal): Promise<void>;
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=hosted-heartbeat-coordinator-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-heartbeat-coordinator-client.d.ts","sourceRoot":"","sources":["../../src/coordinator/hosted-heartbeat-coordinator-client.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"hosted-heartbeat-coordinator-client.d.ts","sourceRoot":"","sources":["../../src/coordinator/hosted-heartbeat-coordinator-client.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,kCAAkC,EACxC,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,sCAAsC,EACtC,iCAAiC,EAClC,MAAM,YAAY,CAAC;AAOpB,qBAAa,sCAAuC,SAAQ,KAAK;IAI7D,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM;IALzB,QAAQ,CAAC,IAAI,4CAA4C;gBAG9C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM;CAI1B;AAED,gFAAgF;AAChF,qBAAa,gCACb,YAAW,iCAAiC;;gBAK9B,MAAM,EAAE,sCAAsC;IAQpD,SAAS,CACb,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,+BAA+B,CAAC;IAUrC,SAAS,CACb,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kCAAkC,EAAE,CAAC;IAU1C,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,oCAAoC,CAAC;IAU1C,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,mCAAmC,EAC5C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAWV,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlE,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kCAAkC,CAAC;IASxC,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1C,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3C,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA8BjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { OpaqueIdSchema, isSafeWebUrl, } from '../contracts/index.js';
|
|
3
|
-
import { HOSTED_HEARTBEAT_COORDINATOR_PATHS, HostedHeartbeatCoordinatorTaskInputSchema, HostedHeartbeatCoordinatorTaskListSchema, } from './contracts.js';
|
|
3
|
+
import { HOSTED_HEARTBEAT_COORDINATOR_PATHS, HostedHeartbeatCoordinatorStateResponseSchema, HostedHeartbeatCoordinatorTaskDetailSchema, HostedHeartbeatCoordinatorTaskInputSchema, HostedHeartbeatCoordinatorTaskListSchema, HostedHeartbeatCoordinatorTaskViewSchema, } from './contracts.js';
|
|
4
4
|
import { HostedHeartbeatServiceTokenSchema } from './service-token.js';
|
|
5
5
|
const SafeBaseUrlSchema = z.custom((value) => value instanceof URL && isSafeWebUrl(value), 'baseUrl must be a safe HTTPS or loopback HTTP URL');
|
|
6
6
|
export class HostedHeartbeatCoordinatorRequestError extends Error {
|
|
@@ -25,10 +25,18 @@ export class HostedHeartbeatCoordinatorClient {
|
|
|
25
25
|
this.#authorization = `Bearer ${HostedHeartbeatServiceTokenSchema.parse(config.apiToken)}`;
|
|
26
26
|
this.#fetch = config.fetch ?? globalThis.fetch;
|
|
27
27
|
}
|
|
28
|
+
async readState(signal) {
|
|
29
|
+
const response = await this.#request(HOSTED_HEARTBEAT_COORDINATOR_PATHS.state, { method: 'GET', signal });
|
|
30
|
+
return HostedHeartbeatCoordinatorStateResponseSchema.parse(await response.json()).state;
|
|
31
|
+
}
|
|
28
32
|
async listTasks(signal) {
|
|
29
33
|
const response = await this.#request(HOSTED_HEARTBEAT_COORDINATOR_PATHS.tasks, { method: 'GET', signal });
|
|
30
34
|
return HostedHeartbeatCoordinatorTaskListSchema.parse(await response.json()).tasks;
|
|
31
35
|
}
|
|
36
|
+
async readTask(rawTaskId, signal) {
|
|
37
|
+
const response = await this.#request(this.#taskPath(OpaqueIdSchema.parse(rawTaskId)), { method: 'GET', signal });
|
|
38
|
+
return HostedHeartbeatCoordinatorTaskDetailSchema.parse(await response.json());
|
|
39
|
+
}
|
|
32
40
|
async upsertTask(rawTaskId, rawTask, signal) {
|
|
33
41
|
const taskId = OpaqueIdSchema.parse(rawTaskId);
|
|
34
42
|
const task = HostedHeartbeatCoordinatorTaskInputSchema.parse(rawTask);
|
|
@@ -45,6 +53,12 @@ export class HostedHeartbeatCoordinatorClient {
|
|
|
45
53
|
signal,
|
|
46
54
|
});
|
|
47
55
|
}
|
|
56
|
+
async triggerTask(rawTaskId, signal) {
|
|
57
|
+
const taskId = OpaqueIdSchema.parse(rawTaskId);
|
|
58
|
+
const path = `${this.#taskPath(taskId)}/trigger`;
|
|
59
|
+
const response = await this.#request(path, { method: 'POST', signal });
|
|
60
|
+
return HostedHeartbeatCoordinatorTaskViewSchema.parse(await response.json());
|
|
61
|
+
}
|
|
48
62
|
async pause(signal) {
|
|
49
63
|
await this.#request(HOSTED_HEARTBEAT_COORDINATOR_PATHS.pause, {
|
|
50
64
|
method: 'POST',
|
|
@@ -57,6 +71,12 @@ export class HostedHeartbeatCoordinatorClient {
|
|
|
57
71
|
signal,
|
|
58
72
|
});
|
|
59
73
|
}
|
|
74
|
+
async drain(signal) {
|
|
75
|
+
await this.#request(HOSTED_HEARTBEAT_COORDINATOR_PATHS.drain, {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
signal,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
60
80
|
#taskPath(taskId) {
|
|
61
81
|
return `${HOSTED_HEARTBEAT_COORDINATOR_PATHS.tasks}/${encodeURIComponent(taskId)}`;
|
|
62
82
|
}
|