@jive-sh/workflow-platform 0.7.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/README.md +70 -435
  2. package/component/_generated/api.ts +72 -0
  3. package/component/_generated/component.ts +629 -0
  4. package/component/_generated/dataModel.ts +60 -0
  5. package/component/_generated/server.ts +169 -0
  6. package/component/convex.config.ts +3 -0
  7. package/component/engine.ts +756 -0
  8. package/component/errors.ts +66 -0
  9. package/component/events.ts +17 -0
  10. package/component/notes.ts +19 -0
  11. package/component/places.ts +136 -0
  12. package/component/retention.ts +205 -0
  13. package/component/runEngine.ts +25 -0
  14. package/component/schema.ts +135 -0
  15. package/component/steps.ts +188 -0
  16. package/component/store.ts +513 -0
  17. package/component/tasks.ts +290 -0
  18. package/component/worker.ts +109 -0
  19. package/component/workflows.ts +83 -0
  20. package/dist/definition/agent-runner.js +9 -0
  21. package/dist/definition/agent-runner.js.map +1 -0
  22. package/dist/definition/file-store.js +9 -0
  23. package/dist/definition/file-store.js.map +1 -0
  24. package/dist/definition/program-build.js +10 -0
  25. package/dist/definition/program-build.js.map +1 -0
  26. package/dist/definition/step.js +1 -0
  27. package/dist/definition/step.js.map +1 -0
  28. package/dist/definition/task-schema.js +5 -0
  29. package/dist/definition/task-schema.js.map +1 -0
  30. package/dist/definition/tasks.js +9 -0
  31. package/dist/definition/tasks.js.map +1 -0
  32. package/dist/definition/workflow.js +117 -0
  33. package/dist/definition/workflow.js.map +1 -0
  34. package/dist/graph.js +310 -9
  35. package/dist/graph.js.map +1 -1
  36. package/dist/index.js +7 -196
  37. package/dist/index.js.map +1 -1
  38. package/package.json +9 -4
  39. package/src/definition/agent-runner.ts +59 -0
  40. package/src/definition/file-store.ts +20 -0
  41. package/src/definition/program-build.ts +30 -0
  42. package/src/definition/step.ts +106 -0
  43. package/src/definition/task-schema.ts +15 -0
  44. package/src/definition/tasks.ts +43 -0
  45. package/src/definition/workflow.ts +262 -0
  46. package/src/graph.ts +352 -19
  47. package/src/index.ts +8 -238
  48. package/worker/directory-file-store.ts +42 -0
  49. package/worker/index.ts +12 -0
  50. package/worker/platform-client.ts +144 -0
  51. package/worker/step-meter.ts +80 -0
  52. package/worker/worker-tasks.ts +27 -0
  53. package/worker/worker.test.ts +200 -0
  54. package/worker/worker.ts +240 -0
  55. package/dist/budget-states.js +0 -30
  56. package/dist/budget-states.js.map +0 -1
  57. package/dist/cpu-limit/limiter.js +0 -839
  58. package/dist/cpu-limit/limiter.js.map +0 -1
  59. package/dist/cpu-limit/use.js +0 -139
  60. package/dist/cpu-limit/use.js.map +0 -1
  61. package/dist/dashboard/agent-usage.js +0 -25
  62. package/dist/dashboard/agent-usage.js.map +0 -1
  63. package/dist/dashboard/dashboard.css +0 -148
  64. package/dist/dashboard/drilldown.js +0 -47
  65. package/dist/dashboard/drilldown.js.map +0 -1
  66. package/dist/dashboard/queue-lines.js +0 -44
  67. package/dist/dashboard/queue-lines.js.map +0 -1
  68. package/dist/dashboard/queue-table.js +0 -16
  69. package/dist/dashboard/queue-table.js.map +0 -1
  70. package/dist/dashboard/run-doing-words.js +0 -29
  71. package/dist/dashboard/run-doing-words.js.map +0 -1
  72. package/dist/dashboard/setting-words.js +0 -18
  73. package/dist/dashboard/setting-words.js.map +0 -1
  74. package/dist/dashboard/spending-words.js +0 -24
  75. package/dist/dashboard/spending-words.js.map +0 -1
  76. package/dist/failure.js +0 -35
  77. package/dist/failure.js.map +0 -1
  78. package/dist/keep-running.js +0 -79
  79. package/dist/keep-running.js.map +0 -1
  80. package/dist/outside-failure.js +0 -31
  81. package/dist/outside-failure.js.map +0 -1
  82. package/dist/pick-wakes.js +0 -125
  83. package/dist/pick-wakes.js.map +0 -1
  84. package/dist/project.js +0 -1
  85. package/dist/project.js.map +0 -1
  86. package/dist/queue-counts.js +0 -51
  87. package/dist/queue-counts.js.map +0 -1
  88. package/dist/reasons.js +0 -33
  89. package/dist/reasons.js.map +0 -1
  90. package/dist/retention.js +0 -59
  91. package/dist/retention.js.map +0 -1
  92. package/dist/settings.js +0 -88
  93. package/dist/settings.js.map +0 -1
  94. package/dist/spending-limit.js +0 -82
  95. package/dist/spending-limit.js.map +0 -1
  96. package/dist/step-files.js +0 -200
  97. package/dist/step-files.js.map +0 -1
  98. package/dist/step-meter.js +0 -97
  99. package/dist/step-meter.js.map +0 -1
  100. package/dist/step-times.js +0 -114
  101. package/dist/step-times.js.map +0 -1
  102. package/dist/step-usage.js +0 -19
  103. package/dist/step-usage.js.map +0 -1
  104. package/dist/steps.js +0 -1205
  105. package/dist/steps.js.map +0 -1
  106. package/dist/storage/agent-claims.js +0 -3
  107. package/dist/storage/agent-claims.js.map +0 -1
  108. package/dist/storage/budgets.js +0 -121
  109. package/dist/storage/budgets.js.map +0 -1
  110. package/dist/storage/engine-records.js +0 -91
  111. package/dist/storage/engine-records.js.map +0 -1
  112. package/dist/storage/engine-storage.js +0 -67
  113. package/dist/storage/engine-storage.js.map +0 -1
  114. package/dist/storage/input-records.js +0 -12
  115. package/dist/storage/input-records.js.map +0 -1
  116. package/dist/storage/move-store.js +0 -251
  117. package/dist/storage/move-store.js.map +0 -1
  118. package/dist/storage/sqlite-store.js +0 -901
  119. package/dist/storage/sqlite-store.js.map +0 -1
  120. package/dist/storage/step-records.js +0 -11
  121. package/dist/storage/step-records.js.map +0 -1
  122. package/dist/storage/storage-error.js +0 -19
  123. package/dist/storage/storage-error.js.map +0 -1
  124. package/dist/storage/task-store.js +0 -30
  125. package/dist/storage/task-store.js.map +0 -1
  126. package/dist/system-workflows.js +0 -54
  127. package/dist/system-workflows.js.map +0 -1
  128. package/dist/tasks.js +0 -500
  129. package/dist/tasks.js.map +0 -1
  130. package/dist/views/format.js +0 -37
  131. package/dist/views/format.js.map +0 -1
  132. package/dist/views/runs-now.js +0 -117
  133. package/dist/views/runs-now.js.map +0 -1
  134. package/dist/views/step-funnel.js +0 -98
  135. package/dist/views/step-funnel.js.map +0 -1
  136. package/dist/views/step-graph.js +0 -39
  137. package/dist/views/step-graph.js.map +0 -1
  138. package/dist/views/workflows-view.js +0 -236
  139. package/dist/views/workflows-view.js.map +0 -1
  140. package/src/budget-states.ts +0 -54
  141. package/src/cpu-limit/limiter.ts +0 -935
  142. package/src/cpu-limit/use.ts +0 -166
  143. package/src/dashboard/agent-usage-line.tsx +0 -28
  144. package/src/dashboard/agent-usage.ts +0 -48
  145. package/src/dashboard/dashboard.css +0 -148
  146. package/src/dashboard/drilldown.ts +0 -70
  147. package/src/dashboard/index.tsx +0 -4
  148. package/src/dashboard/limits-and-runs.tsx +0 -191
  149. package/src/dashboard/machine-controls.tsx +0 -53
  150. package/src/dashboard/queue-bar.tsx +0 -62
  151. package/src/dashboard/queue-chart.tsx +0 -149
  152. package/src/dashboard/queue-lines.ts +0 -87
  153. package/src/dashboard/queue-table.ts +0 -37
  154. package/src/dashboard/run-doing-words.ts +0 -41
  155. package/src/dashboard/setting-words.ts +0 -30
  156. package/src/dashboard/spending-limit-control.tsx +0 -47
  157. package/src/dashboard/spending-words.ts +0 -32
  158. package/src/dashboard/time-distribution.tsx +0 -61
  159. package/src/dashboard/workflow-dag.tsx +0 -322
  160. package/src/dashboard/workflow-drilldown.tsx +0 -31
  161. package/src/dashboard/workflows-dashboard.tsx +0 -532
  162. package/src/failure.ts +0 -36
  163. package/src/keep-running.ts +0 -85
  164. package/src/outside-failure.ts +0 -39
  165. package/src/pick-wakes.ts +0 -182
  166. package/src/project.ts +0 -127
  167. package/src/queue-counts.ts +0 -64
  168. package/src/reasons.ts +0 -30
  169. package/src/retention.ts +0 -90
  170. package/src/settings.ts +0 -171
  171. package/src/spending-limit.ts +0 -139
  172. package/src/step-files.ts +0 -208
  173. package/src/step-meter.ts +0 -120
  174. package/src/step-times.ts +0 -151
  175. package/src/step-usage.ts +0 -23
  176. package/src/steps.ts +0 -1616
  177. package/src/storage/agent-claims.ts +0 -63
  178. package/src/storage/budgets.ts +0 -152
  179. package/src/storage/engine-records.ts +0 -119
  180. package/src/storage/engine-storage.ts +0 -82
  181. package/src/storage/input-records.ts +0 -43
  182. package/src/storage/move-store.ts +0 -265
  183. package/src/storage/sqlite-store.ts +0 -1022
  184. package/src/storage/step-records.ts +0 -358
  185. package/src/storage/storage-error.ts +0 -35
  186. package/src/storage/task-store.ts +0 -235
  187. package/src/system-workflows.ts +0 -70
  188. package/src/tasks.ts +0 -586
  189. package/src/views/format.ts +0 -40
  190. package/src/views/runs-now.ts +0 -188
  191. package/src/views/step-funnel.ts +0 -163
  192. package/src/views/step-graph.ts +0 -77
  193. package/src/views/workflows-view.ts +0 -484
  194. package/src/workflow-dag.test.tsx +0 -89
  195. package/src/workflow-page.test.tsx +0 -170
@@ -0,0 +1,629 @@
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
+ by?: { step: string; task: string; workflow: string };
219
+ note: string;
220
+ step?: string;
221
+ workflow: string;
222
+ }>;
223
+ taskId: string;
224
+ }>,
225
+ Name
226
+ >;
227
+ get: FunctionReference<
228
+ "query",
229
+ "internal",
230
+ { task: string },
231
+ null | {
232
+ endedAs?: string;
233
+ fields: any;
234
+ files: Array<{ name: string; ref: string }>;
235
+ id: string;
236
+ parent?: {
237
+ entryIndex: number;
238
+ flow: string;
239
+ step: string;
240
+ task: string;
241
+ workflow: string;
242
+ };
243
+ places: Array<{ place: string; startedBy: string }>;
244
+ stepRuns: Array<{
245
+ agent?: string;
246
+ call: number;
247
+ endState?: string;
248
+ endedAt?: number;
249
+ error?: string;
250
+ files: Array<string>;
251
+ note?: string;
252
+ skippedOthers?: Array<{
253
+ reason: string;
254
+ task: string;
255
+ workflow: string;
256
+ }>;
257
+ spend: {
258
+ cacheRead: number;
259
+ cacheWrite: number;
260
+ compiles: number;
261
+ costUsd: number;
262
+ fresh: number;
263
+ output: number;
264
+ requests: number;
265
+ };
266
+ startedAt: number;
267
+ status: string;
268
+ step: string;
269
+ transcripts: Array<{ name: string; ref: string }>;
270
+ used: {
271
+ childCpuSeconds: number;
272
+ filesWritten: number;
273
+ ownCpuSeconds: number;
274
+ peakMemoryMb: number;
275
+ };
276
+ version: string;
277
+ worker?: string;
278
+ }>;
279
+ workflow: string;
280
+ },
281
+ Name
282
+ >;
283
+ moveToFront: FunctionReference<
284
+ "mutation",
285
+ "internal",
286
+ { note: string; tasks: Array<string>; workflow: string },
287
+ { moved: Array<string>; notWaiting: Array<string> },
288
+ Name
289
+ >;
290
+ notes: FunctionReference<
291
+ "query",
292
+ "internal",
293
+ { task: string },
294
+ Array<{
295
+ at: number;
296
+ by?: { step: string; task: string; workflow: string };
297
+ note: string;
298
+ step?: string;
299
+ workflow: string;
300
+ }>,
301
+ Name
302
+ >;
303
+ recordSubWorkflowTask: FunctionReference<
304
+ "mutation",
305
+ "internal",
306
+ { entryIndex: number; flow: string; task: string },
307
+ null,
308
+ Name
309
+ >;
310
+ requeue: FunctionReference<
311
+ "mutation",
312
+ "internal",
313
+ { event: string; fields?: any; note: string; task: string },
314
+ null,
315
+ Name
316
+ >;
317
+ setFields: FunctionReference<
318
+ "mutation",
319
+ "internal",
320
+ {
321
+ fields: any;
322
+ files?: Array<{ name: string; ref: string }>;
323
+ task: string;
324
+ },
325
+ null,
326
+ Name
327
+ >;
328
+ subWorkflowTaskEnded: FunctionReference<
329
+ "mutation",
330
+ "internal",
331
+ { endState: string; entryIndex: number; fields: any; flow: string },
332
+ null,
333
+ Name
334
+ >;
335
+ subWorkflowTasks: FunctionReference<
336
+ "query",
337
+ "internal",
338
+ { task: string },
339
+ Array<{
340
+ endedAs?: string;
341
+ entryIndex: number;
342
+ task?: string;
343
+ workflow: string;
344
+ }>,
345
+ Name
346
+ >;
347
+ writeOther: FunctionReference<
348
+ "mutation",
349
+ "internal",
350
+ {
351
+ by: { step: string; task: string; workflow: string };
352
+ fields?: any;
353
+ files?: Array<{ name: string; ref: string }>;
354
+ note: string;
355
+ task: string;
356
+ },
357
+ null | string,
358
+ Name
359
+ >;
360
+ };
361
+ worker: {
362
+ complete: FunctionReference<
363
+ "mutation",
364
+ "internal",
365
+ {
366
+ endState: string;
367
+ fields?: any;
368
+ files?: Array<{ name: string; ref: string }>;
369
+ listed?: Array<any>;
370
+ measurements?: {
371
+ agent?: string;
372
+ files: Array<string>;
373
+ fingerprint?: string;
374
+ spend: {
375
+ cacheRead: number;
376
+ cacheWrite: number;
377
+ compiles: number;
378
+ costUsd: number;
379
+ fresh: number;
380
+ output: number;
381
+ requests: number;
382
+ };
383
+ transcripts: Array<{ name: string; ref: string }>;
384
+ used: {
385
+ childCpuSeconds: number;
386
+ filesWritten: number;
387
+ ownCpuSeconds: number;
388
+ peakMemoryMb: number;
389
+ };
390
+ };
391
+ note?: string;
392
+ run: string;
393
+ skippedOthers?: Array<{
394
+ reason: string;
395
+ task: string;
396
+ workflow: string;
397
+ }>;
398
+ workflow: string;
399
+ },
400
+ null,
401
+ Name
402
+ >;
403
+ fail: FunctionReference<
404
+ "mutation",
405
+ "internal",
406
+ {
407
+ error: string;
408
+ measurements?: {
409
+ agent?: string;
410
+ files: Array<string>;
411
+ fingerprint?: string;
412
+ spend: {
413
+ cacheRead: number;
414
+ cacheWrite: number;
415
+ compiles: number;
416
+ costUsd: number;
417
+ fresh: number;
418
+ output: number;
419
+ requests: number;
420
+ };
421
+ transcripts: Array<{ name: string; ref: string }>;
422
+ used: {
423
+ childCpuSeconds: number;
424
+ filesWritten: number;
425
+ ownCpuSeconds: number;
426
+ peakMemoryMb: number;
427
+ };
428
+ };
429
+ run: string;
430
+ },
431
+ null,
432
+ Name
433
+ >;
434
+ heartbeat: FunctionReference<
435
+ "mutation",
436
+ "internal",
437
+ { leaseMs: number; run: string },
438
+ null,
439
+ Name
440
+ >;
441
+ oldestTakeable: FunctionReference<
442
+ "mutation",
443
+ "internal",
444
+ { steps: Array<{ step: string; workflow: string }> },
445
+ null | number,
446
+ Name
447
+ >;
448
+ runOf: FunctionReference<
449
+ "query",
450
+ "internal",
451
+ { run: string },
452
+ null | { status: string; step: string; task: string; workflow: string },
453
+ Name
454
+ >;
455
+ take: FunctionReference<
456
+ "mutation",
457
+ "internal",
458
+ {
459
+ leaseMs: number;
460
+ steps: Array<{ step: string; workflow: string }>;
461
+ worker: string;
462
+ },
463
+ null | {
464
+ lastFingerprint?: string;
465
+ run: string;
466
+ step: string;
467
+ task: {
468
+ fields: any;
469
+ files: Array<{ name: string; ref: string }>;
470
+ id: string;
471
+ notes: Array<{
472
+ at: number;
473
+ by?: { step: string; task: string; workflow: string };
474
+ note: string;
475
+ step?: string;
476
+ workflow: string;
477
+ }>;
478
+ };
479
+ workflow: string;
480
+ },
481
+ Name
482
+ >;
483
+ };
484
+ workflows: {
485
+ counts: FunctionReference<
486
+ "query",
487
+ "internal",
488
+ { workflow: string },
489
+ {
490
+ budgets: {
491
+ agents: { inUse: number; limit: number };
492
+ cpu: { inUse: number; limit: number };
493
+ };
494
+ ends: Array<{ end: string; tasks: number }>;
495
+ lines: Array<{ line: string; tasks: number }>;
496
+ steps: Array<{ step: string; tasks: number }>;
497
+ },
498
+ Name
499
+ >;
500
+ get: FunctionReference<
501
+ "query",
502
+ "internal",
503
+ { workflow: string },
504
+ null | {
505
+ budgets: { agents: number; cpu: number };
506
+ graph: {
507
+ budgets: { agents: number; cpu: number };
508
+ endStates: Array<string>;
509
+ events: Array<
510
+ | { id: string; kind: "task" }
511
+ | { field: string; id: string; kind: "change"; resumes?: string }
512
+ | {
513
+ everyMs: number;
514
+ fields?: any;
515
+ fieldsProblem?: string;
516
+ id: string;
517
+ kind: "timer";
518
+ }
519
+ | { id: string; kind: "request" }
520
+ | { id: string; key: string; kind: "list"; leftAs: string }
521
+ >;
522
+ inProgress?: { limit: number; per?: string };
523
+ lines: Array<{
524
+ from:
525
+ | { event: string }
526
+ | { endState: string; step: string }
527
+ | { end: string };
528
+ id: string;
529
+ to: { step: string } | { end: string };
530
+ }>;
531
+ name: string;
532
+ retention?: { days?: number; keepAtLeastRuns?: number };
533
+ steps: Array<{
534
+ access?: {
535
+ services: Array<string>;
536
+ tasks?: { read: Array<string>; write: Array<string> };
537
+ };
538
+ endStates: Array<string>;
539
+ id: string;
540
+ inputsSettledBy?: Array<string>;
541
+ kind: "code" | "agent" | "workflow";
542
+ retention?: { days?: number; keepAtLeastRuns?: number };
543
+ retries?: { delayMs: number; giveUp: string; limit: number };
544
+ syncs?: string;
545
+ workflow?: {
546
+ collect?: { endState: string; into: string };
547
+ each?: string;
548
+ name: string;
549
+ };
550
+ }>;
551
+ };
552
+ version: string;
553
+ },
554
+ Name
555
+ >;
556
+ register: FunctionReference<
557
+ "mutation",
558
+ "internal",
559
+ {
560
+ graph: {
561
+ budgets: { agents: number; cpu: number };
562
+ endStates: Array<string>;
563
+ events: Array<
564
+ | { id: string; kind: "task" }
565
+ | { field: string; id: string; kind: "change"; resumes?: string }
566
+ | {
567
+ everyMs: number;
568
+ fields?: any;
569
+ fieldsProblem?: string;
570
+ id: string;
571
+ kind: "timer";
572
+ }
573
+ | { id: string; kind: "request" }
574
+ | { id: string; key: string; kind: "list"; leftAs: string }
575
+ >;
576
+ inProgress?: { limit: number; per?: string };
577
+ lines: Array<{
578
+ from:
579
+ | { event: string }
580
+ | { endState: string; step: string }
581
+ | { end: string };
582
+ id: string;
583
+ to: { step: string } | { end: string };
584
+ }>;
585
+ name: string;
586
+ retention?: { days?: number; keepAtLeastRuns?: number };
587
+ steps: Array<{
588
+ access?: {
589
+ services: Array<string>;
590
+ tasks?: { read: Array<string>; write: Array<string> };
591
+ };
592
+ endStates: Array<string>;
593
+ id: string;
594
+ inputsSettledBy?: Array<string>;
595
+ kind: "code" | "agent" | "workflow";
596
+ retention?: { days?: number; keepAtLeastRuns?: number };
597
+ retries?: { delayMs: number; giveUp: string; limit: number };
598
+ syncs?: string;
599
+ workflow?: {
600
+ collect?: { endState: string; into: string };
601
+ each?: string;
602
+ name: string;
603
+ };
604
+ }>;
605
+ };
606
+ hooks?: {
607
+ startSubWorkflowTasks: string;
608
+ subWorkflowTaskEnded: string;
609
+ };
610
+ },
611
+ null,
612
+ Name
613
+ >;
614
+ remove: FunctionReference<
615
+ "mutation",
616
+ "internal",
617
+ { workflow: string },
618
+ null,
619
+ Name
620
+ >;
621
+ setBudgets: FunctionReference<
622
+ "mutation",
623
+ "internal",
624
+ { budgets: { agents: number; cpu: number }; workflow: string },
625
+ null,
626
+ Name
627
+ >;
628
+ };
629
+ };
@@ -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>;