workplane 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,583 @@
1
+ {
2
+ "id": "b86b7154-4eff-4bca-af49-b916cb40b7b2",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.artifacts": {
8
+ "name": "artifacts",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "run_id": {
18
+ "name": "run_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "type": {
24
+ "name": "type",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "name": {
30
+ "name": "name",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "path": {
36
+ "name": "path",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "metadata": {
42
+ "name": "metadata",
43
+ "type": "jsonb",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "created_at": {
48
+ "name": "created_at",
49
+ "type": "timestamp with time zone",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "now()"
53
+ }
54
+ },
55
+ "indexes": {
56
+ "idx_artifacts_run_id": {
57
+ "name": "idx_artifacts_run_id",
58
+ "columns": [
59
+ {
60
+ "expression": "run_id",
61
+ "isExpression": false,
62
+ "asc": true,
63
+ "nulls": "last"
64
+ }
65
+ ],
66
+ "isUnique": false,
67
+ "concurrently": false,
68
+ "method": "btree",
69
+ "with": {}
70
+ }
71
+ },
72
+ "foreignKeys": {
73
+ "artifacts_run_id_runs_id_fk": {
74
+ "name": "artifacts_run_id_runs_id_fk",
75
+ "tableFrom": "artifacts",
76
+ "tableTo": "runs",
77
+ "columnsFrom": [
78
+ "run_id"
79
+ ],
80
+ "columnsTo": [
81
+ "id"
82
+ ],
83
+ "onDelete": "no action",
84
+ "onUpdate": "no action"
85
+ }
86
+ },
87
+ "compositePrimaryKeys": {},
88
+ "uniqueConstraints": {},
89
+ "policies": {},
90
+ "checkConstraints": {},
91
+ "isRLSEnabled": false
92
+ },
93
+ "public.nodes": {
94
+ "name": "nodes",
95
+ "schema": "",
96
+ "columns": {
97
+ "id": {
98
+ "name": "id",
99
+ "type": "text",
100
+ "primaryKey": true,
101
+ "notNull": true
102
+ },
103
+ "name": {
104
+ "name": "name",
105
+ "type": "text",
106
+ "primaryKey": false,
107
+ "notNull": true
108
+ },
109
+ "capabilities": {
110
+ "name": "capabilities",
111
+ "type": "text[]",
112
+ "primaryKey": false,
113
+ "notNull": true,
114
+ "default": "'{}'::text[]"
115
+ },
116
+ "status": {
117
+ "name": "status",
118
+ "type": "text",
119
+ "primaryKey": false,
120
+ "notNull": true,
121
+ "default": "'online'"
122
+ },
123
+ "last_heartbeat_at": {
124
+ "name": "last_heartbeat_at",
125
+ "type": "timestamp with time zone",
126
+ "primaryKey": false,
127
+ "notNull": false
128
+ },
129
+ "created_at": {
130
+ "name": "created_at",
131
+ "type": "timestamp with time zone",
132
+ "primaryKey": false,
133
+ "notNull": true,
134
+ "default": "now()"
135
+ },
136
+ "updated_at": {
137
+ "name": "updated_at",
138
+ "type": "timestamp with time zone",
139
+ "primaryKey": false,
140
+ "notNull": true,
141
+ "default": "now()"
142
+ }
143
+ },
144
+ "indexes": {},
145
+ "foreignKeys": {},
146
+ "compositePrimaryKeys": {},
147
+ "uniqueConstraints": {},
148
+ "policies": {},
149
+ "checkConstraints": {},
150
+ "isRLSEnabled": false
151
+ },
152
+ "public.run_input_events": {
153
+ "name": "run_input_events",
154
+ "schema": "",
155
+ "columns": {
156
+ "id": {
157
+ "name": "id",
158
+ "type": "bigserial",
159
+ "primaryKey": true,
160
+ "notNull": true
161
+ },
162
+ "run_id": {
163
+ "name": "run_id",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true
167
+ },
168
+ "sequence": {
169
+ "name": "sequence",
170
+ "type": "bigint",
171
+ "primaryKey": false,
172
+ "notNull": true
173
+ },
174
+ "kind": {
175
+ "name": "kind",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": true
179
+ },
180
+ "payload": {
181
+ "name": "payload",
182
+ "type": "jsonb",
183
+ "primaryKey": false,
184
+ "notNull": true
185
+ },
186
+ "created_at": {
187
+ "name": "created_at",
188
+ "type": "timestamp with time zone",
189
+ "primaryKey": false,
190
+ "notNull": true,
191
+ "default": "now()"
192
+ },
193
+ "delivered_at": {
194
+ "name": "delivered_at",
195
+ "type": "timestamp with time zone",
196
+ "primaryKey": false,
197
+ "notNull": false
198
+ }
199
+ },
200
+ "indexes": {
201
+ "idx_run_input_events_run_sequence": {
202
+ "name": "idx_run_input_events_run_sequence",
203
+ "columns": [
204
+ {
205
+ "expression": "run_id",
206
+ "isExpression": false,
207
+ "asc": true,
208
+ "nulls": "last"
209
+ },
210
+ {
211
+ "expression": "sequence",
212
+ "isExpression": false,
213
+ "asc": true,
214
+ "nulls": "last"
215
+ }
216
+ ],
217
+ "isUnique": true,
218
+ "concurrently": false,
219
+ "method": "btree",
220
+ "with": {}
221
+ },
222
+ "idx_run_input_events_undelivered": {
223
+ "name": "idx_run_input_events_undelivered",
224
+ "columns": [
225
+ {
226
+ "expression": "run_id",
227
+ "isExpression": false,
228
+ "asc": true,
229
+ "nulls": "last"
230
+ },
231
+ {
232
+ "expression": "sequence",
233
+ "isExpression": false,
234
+ "asc": true,
235
+ "nulls": "last"
236
+ }
237
+ ],
238
+ "isUnique": false,
239
+ "where": "\"run_input_events\".\"delivered_at\" is null",
240
+ "concurrently": false,
241
+ "method": "btree",
242
+ "with": {}
243
+ }
244
+ },
245
+ "foreignKeys": {
246
+ "run_input_events_run_id_runs_id_fk": {
247
+ "name": "run_input_events_run_id_runs_id_fk",
248
+ "tableFrom": "run_input_events",
249
+ "tableTo": "runs",
250
+ "columnsFrom": [
251
+ "run_id"
252
+ ],
253
+ "columnsTo": [
254
+ "id"
255
+ ],
256
+ "onDelete": "no action",
257
+ "onUpdate": "no action"
258
+ }
259
+ },
260
+ "compositePrimaryKeys": {},
261
+ "uniqueConstraints": {},
262
+ "policies": {},
263
+ "checkConstraints": {},
264
+ "isRLSEnabled": false
265
+ },
266
+ "public.run_logs": {
267
+ "name": "run_logs",
268
+ "schema": "",
269
+ "columns": {
270
+ "id": {
271
+ "name": "id",
272
+ "type": "bigserial",
273
+ "primaryKey": true,
274
+ "notNull": true
275
+ },
276
+ "run_id": {
277
+ "name": "run_id",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": true
281
+ },
282
+ "step_name": {
283
+ "name": "step_name",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "stream": {
289
+ "name": "stream",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": true
293
+ },
294
+ "message": {
295
+ "name": "message",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": true
299
+ },
300
+ "timestamp": {
301
+ "name": "timestamp",
302
+ "type": "timestamp with time zone",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "default": "now()"
306
+ }
307
+ },
308
+ "indexes": {
309
+ "idx_run_logs_run_id_timestamp": {
310
+ "name": "idx_run_logs_run_id_timestamp",
311
+ "columns": [
312
+ {
313
+ "expression": "run_id",
314
+ "isExpression": false,
315
+ "asc": true,
316
+ "nulls": "last"
317
+ },
318
+ {
319
+ "expression": "timestamp",
320
+ "isExpression": false,
321
+ "asc": true,
322
+ "nulls": "last"
323
+ }
324
+ ],
325
+ "isUnique": false,
326
+ "concurrently": false,
327
+ "method": "btree",
328
+ "with": {}
329
+ }
330
+ },
331
+ "foreignKeys": {
332
+ "run_logs_run_id_runs_id_fk": {
333
+ "name": "run_logs_run_id_runs_id_fk",
334
+ "tableFrom": "run_logs",
335
+ "tableTo": "runs",
336
+ "columnsFrom": [
337
+ "run_id"
338
+ ],
339
+ "columnsTo": [
340
+ "id"
341
+ ],
342
+ "onDelete": "no action",
343
+ "onUpdate": "no action"
344
+ }
345
+ },
346
+ "compositePrimaryKeys": {},
347
+ "uniqueConstraints": {},
348
+ "policies": {},
349
+ "checkConstraints": {},
350
+ "isRLSEnabled": false
351
+ },
352
+ "public.runs": {
353
+ "name": "runs",
354
+ "schema": "",
355
+ "columns": {
356
+ "id": {
357
+ "name": "id",
358
+ "type": "text",
359
+ "primaryKey": true,
360
+ "notNull": true
361
+ },
362
+ "task_id": {
363
+ "name": "task_id",
364
+ "type": "text",
365
+ "primaryKey": false,
366
+ "notNull": true
367
+ },
368
+ "node_id": {
369
+ "name": "node_id",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": true
373
+ },
374
+ "attempt": {
375
+ "name": "attempt",
376
+ "type": "integer",
377
+ "primaryKey": false,
378
+ "notNull": true
379
+ },
380
+ "status": {
381
+ "name": "status",
382
+ "type": "text",
383
+ "primaryKey": false,
384
+ "notNull": true
385
+ },
386
+ "started_at": {
387
+ "name": "started_at",
388
+ "type": "timestamp with time zone",
389
+ "primaryKey": false,
390
+ "notNull": false
391
+ },
392
+ "ended_at": {
393
+ "name": "ended_at",
394
+ "type": "timestamp with time zone",
395
+ "primaryKey": false,
396
+ "notNull": false
397
+ },
398
+ "error": {
399
+ "name": "error",
400
+ "type": "text",
401
+ "primaryKey": false,
402
+ "notNull": false
403
+ },
404
+ "created_at": {
405
+ "name": "created_at",
406
+ "type": "timestamp with time zone",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "default": "now()"
410
+ },
411
+ "updated_at": {
412
+ "name": "updated_at",
413
+ "type": "timestamp with time zone",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "default": "now()"
417
+ }
418
+ },
419
+ "indexes": {
420
+ "idx_runs_task_id": {
421
+ "name": "idx_runs_task_id",
422
+ "columns": [
423
+ {
424
+ "expression": "task_id",
425
+ "isExpression": false,
426
+ "asc": true,
427
+ "nulls": "last"
428
+ }
429
+ ],
430
+ "isUnique": false,
431
+ "concurrently": false,
432
+ "method": "btree",
433
+ "with": {}
434
+ },
435
+ "idx_runs_node_id": {
436
+ "name": "idx_runs_node_id",
437
+ "columns": [
438
+ {
439
+ "expression": "node_id",
440
+ "isExpression": false,
441
+ "asc": true,
442
+ "nulls": "last"
443
+ }
444
+ ],
445
+ "isUnique": false,
446
+ "concurrently": false,
447
+ "method": "btree",
448
+ "with": {}
449
+ }
450
+ },
451
+ "foreignKeys": {
452
+ "runs_task_id_tasks_id_fk": {
453
+ "name": "runs_task_id_tasks_id_fk",
454
+ "tableFrom": "runs",
455
+ "tableTo": "tasks",
456
+ "columnsFrom": [
457
+ "task_id"
458
+ ],
459
+ "columnsTo": [
460
+ "id"
461
+ ],
462
+ "onDelete": "no action",
463
+ "onUpdate": "no action"
464
+ },
465
+ "runs_node_id_nodes_id_fk": {
466
+ "name": "runs_node_id_nodes_id_fk",
467
+ "tableFrom": "runs",
468
+ "tableTo": "nodes",
469
+ "columnsFrom": [
470
+ "node_id"
471
+ ],
472
+ "columnsTo": [
473
+ "id"
474
+ ],
475
+ "onDelete": "no action",
476
+ "onUpdate": "no action"
477
+ }
478
+ },
479
+ "compositePrimaryKeys": {},
480
+ "uniqueConstraints": {},
481
+ "policies": {},
482
+ "checkConstraints": {},
483
+ "isRLSEnabled": false
484
+ },
485
+ "public.tasks": {
486
+ "name": "tasks",
487
+ "schema": "",
488
+ "columns": {
489
+ "id": {
490
+ "name": "id",
491
+ "type": "text",
492
+ "primaryKey": true,
493
+ "notNull": true
494
+ },
495
+ "kind": {
496
+ "name": "kind",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": true
500
+ },
501
+ "adapter": {
502
+ "name": "adapter",
503
+ "type": "text",
504
+ "primaryKey": false,
505
+ "notNull": true
506
+ },
507
+ "payload": {
508
+ "name": "payload",
509
+ "type": "jsonb",
510
+ "primaryKey": false,
511
+ "notNull": true
512
+ },
513
+ "requires": {
514
+ "name": "requires",
515
+ "type": "text[]",
516
+ "primaryKey": false,
517
+ "notNull": true,
518
+ "default": "'{}'::text[]"
519
+ },
520
+ "status": {
521
+ "name": "status",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": true
525
+ },
526
+ "created_at": {
527
+ "name": "created_at",
528
+ "type": "timestamp with time zone",
529
+ "primaryKey": false,
530
+ "notNull": true,
531
+ "default": "now()"
532
+ },
533
+ "updated_at": {
534
+ "name": "updated_at",
535
+ "type": "timestamp with time zone",
536
+ "primaryKey": false,
537
+ "notNull": true,
538
+ "default": "now()"
539
+ }
540
+ },
541
+ "indexes": {
542
+ "idx_tasks_status_created_at": {
543
+ "name": "idx_tasks_status_created_at",
544
+ "columns": [
545
+ {
546
+ "expression": "status",
547
+ "isExpression": false,
548
+ "asc": true,
549
+ "nulls": "last"
550
+ },
551
+ {
552
+ "expression": "created_at",
553
+ "isExpression": false,
554
+ "asc": true,
555
+ "nulls": "last"
556
+ }
557
+ ],
558
+ "isUnique": false,
559
+ "concurrently": false,
560
+ "method": "btree",
561
+ "with": {}
562
+ }
563
+ },
564
+ "foreignKeys": {},
565
+ "compositePrimaryKeys": {},
566
+ "uniqueConstraints": {},
567
+ "policies": {},
568
+ "checkConstraints": {},
569
+ "isRLSEnabled": false
570
+ }
571
+ },
572
+ "enums": {},
573
+ "schemas": {},
574
+ "sequences": {},
575
+ "roles": {},
576
+ "policies": {},
577
+ "views": {},
578
+ "_meta": {
579
+ "columns": {},
580
+ "schemas": {},
581
+ "tables": {}
582
+ }
583
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1780195148702,
9
+ "tag": "0000_majestic_norman_osborn",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,75 @@
1
+ CREATE TABLE `artifacts` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `run_id` text NOT NULL,
4
+ `type` text NOT NULL,
5
+ `name` text NOT NULL,
6
+ `path` text NOT NULL,
7
+ `metadata` text,
8
+ `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
9
+ FOREIGN KEY (`run_id`) REFERENCES `runs`(`id`) ON UPDATE no action ON DELETE no action
10
+ );
11
+ --> statement-breakpoint
12
+ CREATE INDEX `idx_artifacts_run_id` ON `artifacts` (`run_id`);--> statement-breakpoint
13
+ CREATE TABLE `nodes` (
14
+ `id` text PRIMARY KEY NOT NULL,
15
+ `name` text NOT NULL,
16
+ `capabilities` text DEFAULT '[]' NOT NULL,
17
+ `status` text DEFAULT 'online' NOT NULL,
18
+ `last_heartbeat_at` text,
19
+ `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
20
+ `updated_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL
21
+ );
22
+ --> statement-breakpoint
23
+ CREATE TABLE `run_input_events` (
24
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
25
+ `run_id` text NOT NULL,
26
+ `sequence` integer NOT NULL,
27
+ `kind` text NOT NULL,
28
+ `payload` text DEFAULT '{}' NOT NULL,
29
+ `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
30
+ `delivered_at` text,
31
+ FOREIGN KEY (`run_id`) REFERENCES `runs`(`id`) ON UPDATE no action ON DELETE no action
32
+ );
33
+ --> statement-breakpoint
34
+ CREATE UNIQUE INDEX `idx_run_input_events_run_sequence` ON `run_input_events` (`run_id`,`sequence`);--> statement-breakpoint
35
+ CREATE INDEX `idx_run_input_events_undelivered` ON `run_input_events` (`run_id`,`sequence`) WHERE "run_input_events"."delivered_at" is null;--> statement-breakpoint
36
+ CREATE TABLE `run_logs` (
37
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
38
+ `run_id` text NOT NULL,
39
+ `step_name` text,
40
+ `stream` text NOT NULL,
41
+ `message` text NOT NULL,
42
+ `timestamp` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
43
+ FOREIGN KEY (`run_id`) REFERENCES `runs`(`id`) ON UPDATE no action ON DELETE no action
44
+ );
45
+ --> statement-breakpoint
46
+ CREATE INDEX `idx_run_logs_run_id_timestamp` ON `run_logs` (`run_id`,`timestamp`);--> statement-breakpoint
47
+ CREATE TABLE `runs` (
48
+ `id` text PRIMARY KEY NOT NULL,
49
+ `task_id` text NOT NULL,
50
+ `node_id` text NOT NULL,
51
+ `attempt` integer NOT NULL,
52
+ `status` text NOT NULL,
53
+ `started_at` text,
54
+ `ended_at` text,
55
+ `error` text,
56
+ `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
57
+ `updated_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
58
+ FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE no action,
59
+ FOREIGN KEY (`node_id`) REFERENCES `nodes`(`id`) ON UPDATE no action ON DELETE no action
60
+ );
61
+ --> statement-breakpoint
62
+ CREATE INDEX `idx_runs_task_id` ON `runs` (`task_id`);--> statement-breakpoint
63
+ CREATE INDEX `idx_runs_node_id` ON `runs` (`node_id`);--> statement-breakpoint
64
+ CREATE TABLE `tasks` (
65
+ `id` text PRIMARY KEY NOT NULL,
66
+ `kind` text NOT NULL,
67
+ `adapter` text NOT NULL,
68
+ `payload` text DEFAULT '{}' NOT NULL,
69
+ `requires` text DEFAULT '[]' NOT NULL,
70
+ `status` text NOT NULL,
71
+ `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
72
+ `updated_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL
73
+ );
74
+ --> statement-breakpoint
75
+ CREATE INDEX `idx_tasks_status_created_at` ON `tasks` (`status`,`created_at`);