@jive-sh/workflow-platform 0.7.0 → 1.0.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 +66 -435
- package/component/_generated/api.ts +72 -0
- package/component/_generated/component.ts +621 -0
- package/component/_generated/dataModel.ts +60 -0
- package/component/_generated/server.ts +169 -0
- package/component/convex.config.ts +3 -0
- package/component/engine.ts +755 -0
- package/component/errors.ts +66 -0
- package/component/events.ts +17 -0
- package/component/notes.ts +13 -0
- package/component/places.ts +136 -0
- package/component/retention.ts +205 -0
- package/component/runEngine.ts +25 -0
- package/component/schema.ts +132 -0
- package/component/steps.ts +188 -0
- package/component/store.ts +512 -0
- package/component/tasks.ts +289 -0
- package/component/worker.ts +109 -0
- package/component/workflows.ts +83 -0
- package/dist/definition/agent-runner.js +9 -0
- package/dist/definition/agent-runner.js.map +1 -0
- package/dist/definition/file-store.js +9 -0
- package/dist/definition/file-store.js.map +1 -0
- package/dist/definition/program-build.js +10 -0
- package/dist/definition/program-build.js.map +1 -0
- package/dist/definition/step.js +1 -0
- package/dist/definition/step.js.map +1 -0
- package/dist/definition/task-schema.js +5 -0
- package/dist/definition/task-schema.js.map +1 -0
- package/dist/definition/tasks.js +9 -0
- package/dist/definition/tasks.js.map +1 -0
- package/dist/definition/workflow.js +111 -0
- package/dist/definition/workflow.js.map +1 -0
- package/dist/graph.js +301 -9
- package/dist/graph.js.map +1 -1
- package/dist/index.js +7 -196
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
- package/src/definition/agent-runner.ts +59 -0
- package/src/definition/file-store.ts +20 -0
- package/src/definition/program-build.ts +30 -0
- package/src/definition/step.ts +106 -0
- package/src/definition/task-schema.ts +15 -0
- package/src/definition/tasks.ts +43 -0
- package/src/definition/workflow.ts +255 -0
- package/src/graph.ts +341 -19
- package/src/index.ts +8 -238
- package/worker/directory-file-store.ts +42 -0
- package/worker/index.ts +12 -0
- package/worker/platform-client.ts +138 -0
- package/worker/step-meter.ts +80 -0
- package/worker/worker-tasks.ts +27 -0
- package/worker/worker.test.ts +200 -0
- package/worker/worker.ts +240 -0
- package/dist/budget-states.js +0 -30
- package/dist/budget-states.js.map +0 -1
- package/dist/cpu-limit/limiter.js +0 -839
- package/dist/cpu-limit/limiter.js.map +0 -1
- package/dist/cpu-limit/use.js +0 -139
- package/dist/cpu-limit/use.js.map +0 -1
- package/dist/dashboard/agent-usage.js +0 -25
- package/dist/dashboard/agent-usage.js.map +0 -1
- package/dist/dashboard/dashboard.css +0 -148
- package/dist/dashboard/drilldown.js +0 -47
- package/dist/dashboard/drilldown.js.map +0 -1
- package/dist/dashboard/queue-lines.js +0 -44
- package/dist/dashboard/queue-lines.js.map +0 -1
- package/dist/dashboard/queue-table.js +0 -16
- package/dist/dashboard/queue-table.js.map +0 -1
- package/dist/dashboard/run-doing-words.js +0 -29
- package/dist/dashboard/run-doing-words.js.map +0 -1
- package/dist/dashboard/setting-words.js +0 -18
- package/dist/dashboard/setting-words.js.map +0 -1
- package/dist/dashboard/spending-words.js +0 -24
- package/dist/dashboard/spending-words.js.map +0 -1
- package/dist/failure.js +0 -35
- package/dist/failure.js.map +0 -1
- package/dist/keep-running.js +0 -79
- package/dist/keep-running.js.map +0 -1
- package/dist/outside-failure.js +0 -31
- package/dist/outside-failure.js.map +0 -1
- package/dist/pick-wakes.js +0 -125
- package/dist/pick-wakes.js.map +0 -1
- package/dist/project.js +0 -1
- package/dist/project.js.map +0 -1
- package/dist/queue-counts.js +0 -51
- package/dist/queue-counts.js.map +0 -1
- package/dist/reasons.js +0 -33
- package/dist/reasons.js.map +0 -1
- package/dist/retention.js +0 -59
- package/dist/retention.js.map +0 -1
- package/dist/settings.js +0 -88
- package/dist/settings.js.map +0 -1
- package/dist/spending-limit.js +0 -82
- package/dist/spending-limit.js.map +0 -1
- package/dist/step-files.js +0 -200
- package/dist/step-files.js.map +0 -1
- package/dist/step-meter.js +0 -97
- package/dist/step-meter.js.map +0 -1
- package/dist/step-times.js +0 -114
- package/dist/step-times.js.map +0 -1
- package/dist/step-usage.js +0 -19
- package/dist/step-usage.js.map +0 -1
- package/dist/steps.js +0 -1205
- package/dist/steps.js.map +0 -1
- package/dist/storage/agent-claims.js +0 -3
- package/dist/storage/agent-claims.js.map +0 -1
- package/dist/storage/budgets.js +0 -121
- package/dist/storage/budgets.js.map +0 -1
- package/dist/storage/engine-records.js +0 -91
- package/dist/storage/engine-records.js.map +0 -1
- package/dist/storage/engine-storage.js +0 -67
- package/dist/storage/engine-storage.js.map +0 -1
- package/dist/storage/input-records.js +0 -12
- package/dist/storage/input-records.js.map +0 -1
- package/dist/storage/move-store.js +0 -251
- package/dist/storage/move-store.js.map +0 -1
- package/dist/storage/sqlite-store.js +0 -901
- package/dist/storage/sqlite-store.js.map +0 -1
- package/dist/storage/step-records.js +0 -11
- package/dist/storage/step-records.js.map +0 -1
- package/dist/storage/storage-error.js +0 -19
- package/dist/storage/storage-error.js.map +0 -1
- package/dist/storage/task-store.js +0 -30
- package/dist/storage/task-store.js.map +0 -1
- package/dist/system-workflows.js +0 -54
- package/dist/system-workflows.js.map +0 -1
- package/dist/tasks.js +0 -500
- package/dist/tasks.js.map +0 -1
- package/dist/views/format.js +0 -37
- package/dist/views/format.js.map +0 -1
- package/dist/views/runs-now.js +0 -117
- package/dist/views/runs-now.js.map +0 -1
- package/dist/views/step-funnel.js +0 -98
- package/dist/views/step-funnel.js.map +0 -1
- package/dist/views/step-graph.js +0 -39
- package/dist/views/step-graph.js.map +0 -1
- package/dist/views/workflows-view.js +0 -236
- package/dist/views/workflows-view.js.map +0 -1
- package/src/budget-states.ts +0 -54
- package/src/cpu-limit/limiter.ts +0 -935
- package/src/cpu-limit/use.ts +0 -166
- package/src/dashboard/agent-usage-line.tsx +0 -28
- package/src/dashboard/agent-usage.ts +0 -48
- package/src/dashboard/dashboard.css +0 -148
- package/src/dashboard/drilldown.ts +0 -70
- package/src/dashboard/index.tsx +0 -4
- package/src/dashboard/limits-and-runs.tsx +0 -191
- package/src/dashboard/machine-controls.tsx +0 -53
- package/src/dashboard/queue-bar.tsx +0 -62
- package/src/dashboard/queue-chart.tsx +0 -149
- package/src/dashboard/queue-lines.ts +0 -87
- package/src/dashboard/queue-table.ts +0 -37
- package/src/dashboard/run-doing-words.ts +0 -41
- package/src/dashboard/setting-words.ts +0 -30
- package/src/dashboard/spending-limit-control.tsx +0 -47
- package/src/dashboard/spending-words.ts +0 -32
- package/src/dashboard/time-distribution.tsx +0 -61
- package/src/dashboard/workflow-dag.tsx +0 -322
- package/src/dashboard/workflow-drilldown.tsx +0 -31
- package/src/dashboard/workflows-dashboard.tsx +0 -532
- package/src/failure.ts +0 -36
- package/src/keep-running.ts +0 -85
- package/src/outside-failure.ts +0 -39
- package/src/pick-wakes.ts +0 -182
- package/src/project.ts +0 -127
- package/src/queue-counts.ts +0 -64
- package/src/reasons.ts +0 -30
- package/src/retention.ts +0 -90
- package/src/settings.ts +0 -171
- package/src/spending-limit.ts +0 -139
- package/src/step-files.ts +0 -208
- package/src/step-meter.ts +0 -120
- package/src/step-times.ts +0 -151
- package/src/step-usage.ts +0 -23
- package/src/steps.ts +0 -1616
- package/src/storage/agent-claims.ts +0 -63
- package/src/storage/budgets.ts +0 -152
- package/src/storage/engine-records.ts +0 -119
- package/src/storage/engine-storage.ts +0 -82
- package/src/storage/input-records.ts +0 -43
- package/src/storage/move-store.ts +0 -265
- package/src/storage/sqlite-store.ts +0 -1022
- package/src/storage/step-records.ts +0 -358
- package/src/storage/storage-error.ts +0 -35
- package/src/storage/task-store.ts +0 -235
- package/src/system-workflows.ts +0 -70
- package/src/tasks.ts +0 -586
- package/src/views/format.ts +0 -40
- package/src/views/runs-now.ts +0 -188
- package/src/views/step-funnel.ts +0 -163
- package/src/views/step-graph.ts +0 -77
- package/src/views/workflows-view.ts +0 -484
- package/src/workflow-dag.test.tsx +0 -89
- package/src/workflow-page.test.tsx +0 -170
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `ComponentApi` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { FunctionReference } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing a Convex component's exposed API.
|
|
15
|
+
*
|
|
16
|
+
* Useful when expecting a parameter like `components.myComponent`.
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
20
|
+
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
25
|
+
{
|
|
26
|
+
places: {
|
|
27
|
+
tasksAt: FunctionReference<
|
|
28
|
+
"query",
|
|
29
|
+
"internal",
|
|
30
|
+
{
|
|
31
|
+
paginationOpts: {
|
|
32
|
+
cursor: string | null;
|
|
33
|
+
endCursor?: string | null;
|
|
34
|
+
id?: number;
|
|
35
|
+
maximumBytesRead?: number;
|
|
36
|
+
maximumRowsRead?: number;
|
|
37
|
+
numItems: number;
|
|
38
|
+
};
|
|
39
|
+
place:
|
|
40
|
+
| { line: string }
|
|
41
|
+
| { step: string }
|
|
42
|
+
| { end: string }
|
|
43
|
+
| { inFrontOf: string };
|
|
44
|
+
workflow: string;
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
continueCursor: string;
|
|
48
|
+
isDone: boolean;
|
|
49
|
+
page: Array<{
|
|
50
|
+
enteredAt: number;
|
|
51
|
+
fields: any;
|
|
52
|
+
note?: string;
|
|
53
|
+
run?: {
|
|
54
|
+
call: number;
|
|
55
|
+
heartbeatAt?: number;
|
|
56
|
+
startedAt: number;
|
|
57
|
+
worker?: string;
|
|
58
|
+
};
|
|
59
|
+
startedBy: string;
|
|
60
|
+
task: string;
|
|
61
|
+
}>;
|
|
62
|
+
},
|
|
63
|
+
Name
|
|
64
|
+
>;
|
|
65
|
+
};
|
|
66
|
+
retention: {
|
|
67
|
+
pruneNow: FunctionReference<
|
|
68
|
+
"action",
|
|
69
|
+
"internal",
|
|
70
|
+
{ now?: number; workflow: string },
|
|
71
|
+
{ runs: number; turnTasks: number },
|
|
72
|
+
Name
|
|
73
|
+
>;
|
|
74
|
+
};
|
|
75
|
+
steps: {
|
|
76
|
+
stepRuns: FunctionReference<
|
|
77
|
+
"query",
|
|
78
|
+
"internal",
|
|
79
|
+
{
|
|
80
|
+
paginationOpts: {
|
|
81
|
+
cursor: string | null;
|
|
82
|
+
endCursor?: string | null;
|
|
83
|
+
id?: number;
|
|
84
|
+
maximumBytesRead?: number;
|
|
85
|
+
maximumRowsRead?: number;
|
|
86
|
+
numItems: number;
|
|
87
|
+
};
|
|
88
|
+
since?: number;
|
|
89
|
+
step: string;
|
|
90
|
+
workflow: string;
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
continueCursor: string;
|
|
94
|
+
isDone: boolean;
|
|
95
|
+
page: Array<{
|
|
96
|
+
agent?: string;
|
|
97
|
+
call: number;
|
|
98
|
+
endState?: string;
|
|
99
|
+
endedAt?: number;
|
|
100
|
+
error?: string;
|
|
101
|
+
skippedOthers?: Array<{
|
|
102
|
+
reason: string;
|
|
103
|
+
task: string;
|
|
104
|
+
workflow: string;
|
|
105
|
+
}>;
|
|
106
|
+
spend: {
|
|
107
|
+
cacheRead: number;
|
|
108
|
+
cacheWrite: number;
|
|
109
|
+
compiles: number;
|
|
110
|
+
costUsd: number;
|
|
111
|
+
fresh: number;
|
|
112
|
+
output: number;
|
|
113
|
+
requests: number;
|
|
114
|
+
};
|
|
115
|
+
startedAt: number;
|
|
116
|
+
status: string;
|
|
117
|
+
task: string;
|
|
118
|
+
transcripts: Array<{ name: string; ref: string }>;
|
|
119
|
+
}>;
|
|
120
|
+
},
|
|
121
|
+
Name
|
|
122
|
+
>;
|
|
123
|
+
stepStats: FunctionReference<
|
|
124
|
+
"query",
|
|
125
|
+
"internal",
|
|
126
|
+
{ since: number; step: string; until?: number; workflow: string },
|
|
127
|
+
{
|
|
128
|
+
agents: Array<{ agent: string; runs: number }>;
|
|
129
|
+
calls: number;
|
|
130
|
+
cpuSeconds: { child: number; own: number };
|
|
131
|
+
endStates: Array<{ endState: string; runs: number }>;
|
|
132
|
+
failed: number;
|
|
133
|
+
filesWritten: number;
|
|
134
|
+
peakMemoryMb: number;
|
|
135
|
+
perTask: {
|
|
136
|
+
cpuSeconds: { median: number; p90: number };
|
|
137
|
+
tokens: { median: number; p90: number };
|
|
138
|
+
wallSeconds: { median: number; p90: number };
|
|
139
|
+
};
|
|
140
|
+
running: number;
|
|
141
|
+
spend: {
|
|
142
|
+
cacheRead: number;
|
|
143
|
+
cacheWrite: number;
|
|
144
|
+
compiles: number;
|
|
145
|
+
costUsd: number;
|
|
146
|
+
fresh: number;
|
|
147
|
+
output: number;
|
|
148
|
+
requests: number;
|
|
149
|
+
};
|
|
150
|
+
tasks: number;
|
|
151
|
+
wallSeconds: number;
|
|
152
|
+
},
|
|
153
|
+
Name
|
|
154
|
+
>;
|
|
155
|
+
subWorkflowSpend: FunctionReference<
|
|
156
|
+
"query",
|
|
157
|
+
"internal",
|
|
158
|
+
{
|
|
159
|
+
parent: { step: string; workflow: string };
|
|
160
|
+
since: number;
|
|
161
|
+
until?: number;
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
parentTasks: number;
|
|
165
|
+
perParentTaskTokens: { median: number; p90: number };
|
|
166
|
+
spend: {
|
|
167
|
+
cacheRead: number;
|
|
168
|
+
cacheWrite: number;
|
|
169
|
+
compiles: number;
|
|
170
|
+
costUsd: number;
|
|
171
|
+
fresh: number;
|
|
172
|
+
output: number;
|
|
173
|
+
requests: number;
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
Name
|
|
177
|
+
>;
|
|
178
|
+
};
|
|
179
|
+
tasks: {
|
|
180
|
+
create: FunctionReference<
|
|
181
|
+
"mutation",
|
|
182
|
+
"internal",
|
|
183
|
+
{
|
|
184
|
+
event?: string;
|
|
185
|
+
fields: any;
|
|
186
|
+
files?: Array<{ name: string; ref: string }>;
|
|
187
|
+
parent?: {
|
|
188
|
+
entryIndex: number;
|
|
189
|
+
flow: string;
|
|
190
|
+
step: string;
|
|
191
|
+
task: string;
|
|
192
|
+
workflow: string;
|
|
193
|
+
};
|
|
194
|
+
workflow: string;
|
|
195
|
+
},
|
|
196
|
+
string,
|
|
197
|
+
Name
|
|
198
|
+
>;
|
|
199
|
+
find: FunctionReference<
|
|
200
|
+
"query",
|
|
201
|
+
"internal",
|
|
202
|
+
{
|
|
203
|
+
at?:
|
|
204
|
+
| { line: string }
|
|
205
|
+
| { step: string }
|
|
206
|
+
| { end: string }
|
|
207
|
+
| { inFrontOf: string };
|
|
208
|
+
limit: number;
|
|
209
|
+
where?: any;
|
|
210
|
+
workflow: string;
|
|
211
|
+
},
|
|
212
|
+
Array<{
|
|
213
|
+
at: { line: string } | { step: string } | { end: string };
|
|
214
|
+
fields: any;
|
|
215
|
+
files: Array<{ name: string; ref: string }>;
|
|
216
|
+
notes: Array<{
|
|
217
|
+
at: number;
|
|
218
|
+
note: string;
|
|
219
|
+
step?: string;
|
|
220
|
+
workflow: string;
|
|
221
|
+
}>;
|
|
222
|
+
taskId: string;
|
|
223
|
+
}>,
|
|
224
|
+
Name
|
|
225
|
+
>;
|
|
226
|
+
get: FunctionReference<
|
|
227
|
+
"query",
|
|
228
|
+
"internal",
|
|
229
|
+
{ task: string },
|
|
230
|
+
null | {
|
|
231
|
+
endedAs?: string;
|
|
232
|
+
fields: any;
|
|
233
|
+
files: Array<{ name: string; ref: string }>;
|
|
234
|
+
id: string;
|
|
235
|
+
parent?: {
|
|
236
|
+
entryIndex: number;
|
|
237
|
+
flow: string;
|
|
238
|
+
step: string;
|
|
239
|
+
task: string;
|
|
240
|
+
workflow: string;
|
|
241
|
+
};
|
|
242
|
+
places: Array<{ place: string; startedBy: string }>;
|
|
243
|
+
stepRuns: Array<{
|
|
244
|
+
agent?: string;
|
|
245
|
+
call: number;
|
|
246
|
+
endState?: string;
|
|
247
|
+
endedAt?: number;
|
|
248
|
+
error?: string;
|
|
249
|
+
files: Array<string>;
|
|
250
|
+
note?: string;
|
|
251
|
+
skippedOthers?: Array<{
|
|
252
|
+
reason: string;
|
|
253
|
+
task: string;
|
|
254
|
+
workflow: string;
|
|
255
|
+
}>;
|
|
256
|
+
spend: {
|
|
257
|
+
cacheRead: number;
|
|
258
|
+
cacheWrite: number;
|
|
259
|
+
compiles: number;
|
|
260
|
+
costUsd: number;
|
|
261
|
+
fresh: number;
|
|
262
|
+
output: number;
|
|
263
|
+
requests: number;
|
|
264
|
+
};
|
|
265
|
+
startedAt: number;
|
|
266
|
+
status: string;
|
|
267
|
+
step: string;
|
|
268
|
+
transcripts: Array<{ name: string; ref: string }>;
|
|
269
|
+
used: {
|
|
270
|
+
childCpuSeconds: number;
|
|
271
|
+
filesWritten: number;
|
|
272
|
+
ownCpuSeconds: number;
|
|
273
|
+
peakMemoryMb: number;
|
|
274
|
+
};
|
|
275
|
+
version: string;
|
|
276
|
+
worker?: string;
|
|
277
|
+
}>;
|
|
278
|
+
workflow: string;
|
|
279
|
+
},
|
|
280
|
+
Name
|
|
281
|
+
>;
|
|
282
|
+
moveToFront: FunctionReference<
|
|
283
|
+
"mutation",
|
|
284
|
+
"internal",
|
|
285
|
+
{ note: string; tasks: Array<string>; workflow: string },
|
|
286
|
+
{ moved: Array<string>; notWaiting: Array<string> },
|
|
287
|
+
Name
|
|
288
|
+
>;
|
|
289
|
+
notes: FunctionReference<
|
|
290
|
+
"query",
|
|
291
|
+
"internal",
|
|
292
|
+
{ task: string },
|
|
293
|
+
Array<{ at: number; note: string; step?: string; workflow: string }>,
|
|
294
|
+
Name
|
|
295
|
+
>;
|
|
296
|
+
recordSubWorkflowTask: FunctionReference<
|
|
297
|
+
"mutation",
|
|
298
|
+
"internal",
|
|
299
|
+
{ entryIndex: number; flow: string; task: string },
|
|
300
|
+
null,
|
|
301
|
+
Name
|
|
302
|
+
>;
|
|
303
|
+
requeue: FunctionReference<
|
|
304
|
+
"mutation",
|
|
305
|
+
"internal",
|
|
306
|
+
{ event: string; fields?: any; note: string; task: string },
|
|
307
|
+
null,
|
|
308
|
+
Name
|
|
309
|
+
>;
|
|
310
|
+
setFields: FunctionReference<
|
|
311
|
+
"mutation",
|
|
312
|
+
"internal",
|
|
313
|
+
{
|
|
314
|
+
fields: any;
|
|
315
|
+
files?: Array<{ name: string; ref: string }>;
|
|
316
|
+
task: string;
|
|
317
|
+
},
|
|
318
|
+
null,
|
|
319
|
+
Name
|
|
320
|
+
>;
|
|
321
|
+
subWorkflowTaskEnded: FunctionReference<
|
|
322
|
+
"mutation",
|
|
323
|
+
"internal",
|
|
324
|
+
{ endState: string; entryIndex: number; fields: any; flow: string },
|
|
325
|
+
null,
|
|
326
|
+
Name
|
|
327
|
+
>;
|
|
328
|
+
subWorkflowTasks: FunctionReference<
|
|
329
|
+
"query",
|
|
330
|
+
"internal",
|
|
331
|
+
{ task: string },
|
|
332
|
+
Array<{
|
|
333
|
+
endedAs?: string;
|
|
334
|
+
entryIndex: number;
|
|
335
|
+
task?: string;
|
|
336
|
+
workflow: string;
|
|
337
|
+
}>,
|
|
338
|
+
Name
|
|
339
|
+
>;
|
|
340
|
+
writeOther: FunctionReference<
|
|
341
|
+
"mutation",
|
|
342
|
+
"internal",
|
|
343
|
+
{
|
|
344
|
+
by: string;
|
|
345
|
+
fields?: any;
|
|
346
|
+
files?: Array<{ name: string; ref: string }>;
|
|
347
|
+
note: string;
|
|
348
|
+
task: string;
|
|
349
|
+
},
|
|
350
|
+
null | string,
|
|
351
|
+
Name
|
|
352
|
+
>;
|
|
353
|
+
};
|
|
354
|
+
worker: {
|
|
355
|
+
complete: FunctionReference<
|
|
356
|
+
"mutation",
|
|
357
|
+
"internal",
|
|
358
|
+
{
|
|
359
|
+
endState: string;
|
|
360
|
+
fields?: any;
|
|
361
|
+
files?: Array<{ name: string; ref: string }>;
|
|
362
|
+
listed?: Array<any>;
|
|
363
|
+
measurements?: {
|
|
364
|
+
agent?: string;
|
|
365
|
+
files: Array<string>;
|
|
366
|
+
fingerprint?: string;
|
|
367
|
+
spend: {
|
|
368
|
+
cacheRead: number;
|
|
369
|
+
cacheWrite: number;
|
|
370
|
+
compiles: number;
|
|
371
|
+
costUsd: number;
|
|
372
|
+
fresh: number;
|
|
373
|
+
output: number;
|
|
374
|
+
requests: number;
|
|
375
|
+
};
|
|
376
|
+
transcripts: Array<{ name: string; ref: string }>;
|
|
377
|
+
used: {
|
|
378
|
+
childCpuSeconds: number;
|
|
379
|
+
filesWritten: number;
|
|
380
|
+
ownCpuSeconds: number;
|
|
381
|
+
peakMemoryMb: number;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
note?: string;
|
|
385
|
+
run: string;
|
|
386
|
+
skippedOthers?: Array<{
|
|
387
|
+
reason: string;
|
|
388
|
+
task: string;
|
|
389
|
+
workflow: string;
|
|
390
|
+
}>;
|
|
391
|
+
workflow: string;
|
|
392
|
+
},
|
|
393
|
+
null,
|
|
394
|
+
Name
|
|
395
|
+
>;
|
|
396
|
+
fail: FunctionReference<
|
|
397
|
+
"mutation",
|
|
398
|
+
"internal",
|
|
399
|
+
{
|
|
400
|
+
error: string;
|
|
401
|
+
measurements?: {
|
|
402
|
+
agent?: string;
|
|
403
|
+
files: Array<string>;
|
|
404
|
+
fingerprint?: string;
|
|
405
|
+
spend: {
|
|
406
|
+
cacheRead: number;
|
|
407
|
+
cacheWrite: number;
|
|
408
|
+
compiles: number;
|
|
409
|
+
costUsd: number;
|
|
410
|
+
fresh: number;
|
|
411
|
+
output: number;
|
|
412
|
+
requests: number;
|
|
413
|
+
};
|
|
414
|
+
transcripts: Array<{ name: string; ref: string }>;
|
|
415
|
+
used: {
|
|
416
|
+
childCpuSeconds: number;
|
|
417
|
+
filesWritten: number;
|
|
418
|
+
ownCpuSeconds: number;
|
|
419
|
+
peakMemoryMb: number;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
run: string;
|
|
423
|
+
},
|
|
424
|
+
null,
|
|
425
|
+
Name
|
|
426
|
+
>;
|
|
427
|
+
heartbeat: FunctionReference<
|
|
428
|
+
"mutation",
|
|
429
|
+
"internal",
|
|
430
|
+
{ leaseMs: number; run: string },
|
|
431
|
+
null,
|
|
432
|
+
Name
|
|
433
|
+
>;
|
|
434
|
+
oldestTakeable: FunctionReference<
|
|
435
|
+
"mutation",
|
|
436
|
+
"internal",
|
|
437
|
+
{ steps: Array<{ step: string; workflow: string }> },
|
|
438
|
+
null | number,
|
|
439
|
+
Name
|
|
440
|
+
>;
|
|
441
|
+
runOf: FunctionReference<
|
|
442
|
+
"query",
|
|
443
|
+
"internal",
|
|
444
|
+
{ run: string },
|
|
445
|
+
null | { status: string; step: string; task: string; workflow: string },
|
|
446
|
+
Name
|
|
447
|
+
>;
|
|
448
|
+
take: FunctionReference<
|
|
449
|
+
"mutation",
|
|
450
|
+
"internal",
|
|
451
|
+
{
|
|
452
|
+
leaseMs: number;
|
|
453
|
+
steps: Array<{ step: string; workflow: string }>;
|
|
454
|
+
worker: string;
|
|
455
|
+
},
|
|
456
|
+
null | {
|
|
457
|
+
lastFingerprint?: string;
|
|
458
|
+
run: string;
|
|
459
|
+
step: string;
|
|
460
|
+
task: {
|
|
461
|
+
fields: any;
|
|
462
|
+
files: Array<{ name: string; ref: string }>;
|
|
463
|
+
id: string;
|
|
464
|
+
notes: Array<{
|
|
465
|
+
at: number;
|
|
466
|
+
note: string;
|
|
467
|
+
step?: string;
|
|
468
|
+
workflow: string;
|
|
469
|
+
}>;
|
|
470
|
+
};
|
|
471
|
+
workflow: string;
|
|
472
|
+
},
|
|
473
|
+
Name
|
|
474
|
+
>;
|
|
475
|
+
};
|
|
476
|
+
workflows: {
|
|
477
|
+
counts: FunctionReference<
|
|
478
|
+
"query",
|
|
479
|
+
"internal",
|
|
480
|
+
{ workflow: string },
|
|
481
|
+
{
|
|
482
|
+
budgets: {
|
|
483
|
+
agents: { inUse: number; limit: number };
|
|
484
|
+
cpu: { inUse: number; limit: number };
|
|
485
|
+
};
|
|
486
|
+
ends: Array<{ end: string; tasks: number }>;
|
|
487
|
+
lines: Array<{ line: string; tasks: number }>;
|
|
488
|
+
steps: Array<{ step: string; tasks: number }>;
|
|
489
|
+
},
|
|
490
|
+
Name
|
|
491
|
+
>;
|
|
492
|
+
get: FunctionReference<
|
|
493
|
+
"query",
|
|
494
|
+
"internal",
|
|
495
|
+
{ workflow: string },
|
|
496
|
+
null | {
|
|
497
|
+
budgets: { agents: number; cpu: number };
|
|
498
|
+
graph: {
|
|
499
|
+
budgets: { agents: number; cpu: number };
|
|
500
|
+
endStates: Array<string>;
|
|
501
|
+
events: Array<
|
|
502
|
+
| { id: string; kind: "task" }
|
|
503
|
+
| { field: string; id: string; kind: "change"; resumes?: string }
|
|
504
|
+
| {
|
|
505
|
+
everyMs: number;
|
|
506
|
+
fields?: any;
|
|
507
|
+
fieldsProblem?: string;
|
|
508
|
+
id: string;
|
|
509
|
+
kind: "timer";
|
|
510
|
+
}
|
|
511
|
+
| { id: string; kind: "request" }
|
|
512
|
+
| { id: string; key: string; kind: "list"; leftAs: string }
|
|
513
|
+
>;
|
|
514
|
+
inProgress?: { limit: number; per?: string };
|
|
515
|
+
lines: Array<{
|
|
516
|
+
from:
|
|
517
|
+
| { event: string }
|
|
518
|
+
| { endState: string; step: string }
|
|
519
|
+
| { end: string };
|
|
520
|
+
id: string;
|
|
521
|
+
to: { step: string } | { end: string };
|
|
522
|
+
}>;
|
|
523
|
+
name: string;
|
|
524
|
+
retention?: { days?: number; keepAtLeastRuns?: number };
|
|
525
|
+
steps: Array<{
|
|
526
|
+
access?: {
|
|
527
|
+
services: Array<string>;
|
|
528
|
+
tasks?: { read: Array<string>; write: Array<string> };
|
|
529
|
+
};
|
|
530
|
+
endStates: Array<string>;
|
|
531
|
+
id: string;
|
|
532
|
+
inputsSettledBy?: Array<string>;
|
|
533
|
+
kind: "code" | "agent" | "workflow";
|
|
534
|
+
retention?: { days?: number; keepAtLeastRuns?: number };
|
|
535
|
+
retries?: { delayMs: number; giveUp: string; limit: number };
|
|
536
|
+
syncs?: string;
|
|
537
|
+
workflow?: {
|
|
538
|
+
collect?: { endState: string; into: string };
|
|
539
|
+
each?: string;
|
|
540
|
+
name: string;
|
|
541
|
+
};
|
|
542
|
+
}>;
|
|
543
|
+
};
|
|
544
|
+
version: string;
|
|
545
|
+
},
|
|
546
|
+
Name
|
|
547
|
+
>;
|
|
548
|
+
register: FunctionReference<
|
|
549
|
+
"mutation",
|
|
550
|
+
"internal",
|
|
551
|
+
{
|
|
552
|
+
graph: {
|
|
553
|
+
budgets: { agents: number; cpu: number };
|
|
554
|
+
endStates: Array<string>;
|
|
555
|
+
events: Array<
|
|
556
|
+
| { id: string; kind: "task" }
|
|
557
|
+
| { field: string; id: string; kind: "change"; resumes?: string }
|
|
558
|
+
| {
|
|
559
|
+
everyMs: number;
|
|
560
|
+
fields?: any;
|
|
561
|
+
fieldsProblem?: string;
|
|
562
|
+
id: string;
|
|
563
|
+
kind: "timer";
|
|
564
|
+
}
|
|
565
|
+
| { id: string; kind: "request" }
|
|
566
|
+
| { id: string; key: string; kind: "list"; leftAs: string }
|
|
567
|
+
>;
|
|
568
|
+
inProgress?: { limit: number; per?: string };
|
|
569
|
+
lines: Array<{
|
|
570
|
+
from:
|
|
571
|
+
| { event: string }
|
|
572
|
+
| { endState: string; step: string }
|
|
573
|
+
| { end: string };
|
|
574
|
+
id: string;
|
|
575
|
+
to: { step: string } | { end: string };
|
|
576
|
+
}>;
|
|
577
|
+
name: string;
|
|
578
|
+
retention?: { days?: number; keepAtLeastRuns?: number };
|
|
579
|
+
steps: Array<{
|
|
580
|
+
access?: {
|
|
581
|
+
services: Array<string>;
|
|
582
|
+
tasks?: { read: Array<string>; write: Array<string> };
|
|
583
|
+
};
|
|
584
|
+
endStates: Array<string>;
|
|
585
|
+
id: string;
|
|
586
|
+
inputsSettledBy?: Array<string>;
|
|
587
|
+
kind: "code" | "agent" | "workflow";
|
|
588
|
+
retention?: { days?: number; keepAtLeastRuns?: number };
|
|
589
|
+
retries?: { delayMs: number; giveUp: string; limit: number };
|
|
590
|
+
syncs?: string;
|
|
591
|
+
workflow?: {
|
|
592
|
+
collect?: { endState: string; into: string };
|
|
593
|
+
each?: string;
|
|
594
|
+
name: string;
|
|
595
|
+
};
|
|
596
|
+
}>;
|
|
597
|
+
};
|
|
598
|
+
hooks?: {
|
|
599
|
+
startSubWorkflowTasks: string;
|
|
600
|
+
subWorkflowTaskEnded: string;
|
|
601
|
+
};
|
|
602
|
+
},
|
|
603
|
+
null,
|
|
604
|
+
Name
|
|
605
|
+
>;
|
|
606
|
+
remove: FunctionReference<
|
|
607
|
+
"mutation",
|
|
608
|
+
"internal",
|
|
609
|
+
{ workflow: string },
|
|
610
|
+
null,
|
|
611
|
+
Name
|
|
612
|
+
>;
|
|
613
|
+
setBudgets: FunctionReference<
|
|
614
|
+
"mutation",
|
|
615
|
+
"internal",
|
|
616
|
+
{ budgets: { agents: number; cpu: number }; workflow: string },
|
|
617
|
+
null,
|
|
618
|
+
Name
|
|
619
|
+
>;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated data model types.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
DataModelFromSchemaDefinition,
|
|
13
|
+
DocumentByName,
|
|
14
|
+
TableNamesInDataModel,
|
|
15
|
+
SystemTableNames,
|
|
16
|
+
} from "convex/server";
|
|
17
|
+
import type { GenericId } from "convex/values";
|
|
18
|
+
import schema from "../schema.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The names of all of your Convex tables.
|
|
22
|
+
*/
|
|
23
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The type of a document stored in Convex.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
29
|
+
*/
|
|
30
|
+
export type Doc<TableName extends TableNames> = DocumentByName<
|
|
31
|
+
DataModel,
|
|
32
|
+
TableName
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An identifier for a document in Convex.
|
|
37
|
+
*
|
|
38
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
39
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
40
|
+
*
|
|
41
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
42
|
+
*
|
|
43
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
44
|
+
* strings when type checking.
|
|
45
|
+
*
|
|
46
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
47
|
+
*/
|
|
48
|
+
export type Id<TableName extends TableNames | SystemTableNames> =
|
|
49
|
+
GenericId<TableName>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A type describing your Convex data model.
|
|
53
|
+
*
|
|
54
|
+
* This type includes information about what tables you have, the type of
|
|
55
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
56
|
+
*
|
|
57
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
58
|
+
* `mutationGeneric` to make them type-safe.
|
|
59
|
+
*/
|
|
60
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|