opencode-supertask 0.1.20 → 0.1.22
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 +51 -25
- package/dist/cli/index.js +1374 -581
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/index.d.ts +3 -1
- package/dist/gateway/index.js +878 -296
- package/dist/gateway/index.js.map +1 -1
- package/dist/plugin/supertask.js +593 -232
- package/dist/plugin/supertask.js.map +1 -1
- package/dist/web/index.js +554 -212
- package/dist/web/index.js.map +1 -1
- package/dist/worker/index.d.ts +19 -7
- package/dist/worker/index.js +442 -151
- package/dist/worker/index.js.map +1 -1
- package/drizzle/0004_reliability_fields.sql +31 -0
- package/drizzle/meta/0004_snapshot.json +85 -13
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
+
CREATE TABLE `__new_task_runs` (
|
|
3
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
4
|
+
`task_id` integer NOT NULL,
|
|
5
|
+
`session_id` text,
|
|
6
|
+
`model` text,
|
|
7
|
+
`status` text DEFAULT 'running',
|
|
8
|
+
`started_at` integer,
|
|
9
|
+
`finished_at` integer,
|
|
10
|
+
`log` text,
|
|
11
|
+
`locked_at` integer,
|
|
12
|
+
`locked_by` text,
|
|
13
|
+
`heartbeat_at` integer,
|
|
14
|
+
`worker_pid` integer,
|
|
15
|
+
`child_pid` integer,
|
|
16
|
+
FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE cascade
|
|
17
|
+
);
|
|
18
|
+
--> statement-breakpoint
|
|
19
|
+
INSERT INTO `__new_task_runs`("id", "task_id", "session_id", "model", "status", "started_at", "finished_at", "log", "locked_at", "locked_by", "heartbeat_at", "worker_pid", "child_pid") SELECT "id", "task_id", "session_id", "model", "status", "started_at", "finished_at", "log", "locked_at", "locked_by", "heartbeat_at", "worker_pid", "child_pid" FROM `task_runs`;--> statement-breakpoint
|
|
20
|
+
DROP TABLE `task_runs`;--> statement-breakpoint
|
|
21
|
+
ALTER TABLE `__new_task_runs` RENAME TO `task_runs`;--> statement-breakpoint
|
|
22
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
23
|
+
CREATE INDEX `task_runs_task_started_idx` ON `task_runs` (`task_id`,`started_at`,`id`);--> statement-breakpoint
|
|
24
|
+
CREATE INDEX `task_runs_status_heartbeat_idx` ON `task_runs` (`status`,`heartbeat_at`);--> statement-breakpoint
|
|
25
|
+
ALTER TABLE `task_templates` ADD `batch_id` text;--> statement-breakpoint
|
|
26
|
+
ALTER TABLE `task_templates` ADD `timeout_ms` integer;--> statement-breakpoint
|
|
27
|
+
CREATE INDEX `task_templates_due_idx` ON `task_templates` (`enabled`,`next_run_at`,`id`);--> statement-breakpoint
|
|
28
|
+
ALTER TABLE `tasks` ADD `retry_backoff_ms` integer DEFAULT 30000;--> statement-breakpoint
|
|
29
|
+
CREATE INDEX `tasks_queue_idx` ON `tasks` (`status`,`retry_after`,`urgency`,`importance`,`created_at`,`id`);--> statement-breakpoint
|
|
30
|
+
CREATE INDEX `tasks_batch_status_idx` ON `tasks` (`batch_id`,`status`);--> statement-breakpoint
|
|
31
|
+
CREATE INDEX `tasks_template_status_idx` ON `tasks` (`template_id`,`status`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "6",
|
|
3
3
|
"dialect": "sqlite",
|
|
4
|
-
"id": "
|
|
5
|
-
"prevId": "
|
|
4
|
+
"id": "ad7e4a09-7706-42fe-be2e-a2f1f91976fe",
|
|
5
|
+
"prevId": "f9e6bdaa-5d53-428f-ba2a-6d1d2deee5b3",
|
|
6
6
|
"tables": {
|
|
7
7
|
"task_runs": {
|
|
8
8
|
"name": "task_runs",
|
|
@@ -100,7 +100,25 @@
|
|
|
100
100
|
"autoincrement": false
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
-
"indexes": {
|
|
103
|
+
"indexes": {
|
|
104
|
+
"task_runs_task_started_idx": {
|
|
105
|
+
"name": "task_runs_task_started_idx",
|
|
106
|
+
"columns": [
|
|
107
|
+
"task_id",
|
|
108
|
+
"started_at",
|
|
109
|
+
"id"
|
|
110
|
+
],
|
|
111
|
+
"isUnique": false
|
|
112
|
+
},
|
|
113
|
+
"task_runs_status_heartbeat_idx": {
|
|
114
|
+
"name": "task_runs_status_heartbeat_idx",
|
|
115
|
+
"columns": [
|
|
116
|
+
"status",
|
|
117
|
+
"heartbeat_at"
|
|
118
|
+
],
|
|
119
|
+
"isUnique": false
|
|
120
|
+
}
|
|
121
|
+
},
|
|
104
122
|
"foreignKeys": {
|
|
105
123
|
"task_runs_task_id_tasks_id_fk": {
|
|
106
124
|
"name": "task_runs_task_id_tasks_id_fk",
|
|
@@ -112,7 +130,7 @@
|
|
|
112
130
|
"columnsTo": [
|
|
113
131
|
"id"
|
|
114
132
|
],
|
|
115
|
-
"onDelete": "
|
|
133
|
+
"onDelete": "cascade",
|
|
116
134
|
"onUpdate": "no action"
|
|
117
135
|
}
|
|
118
136
|
},
|
|
@@ -190,6 +208,13 @@
|
|
|
190
208
|
"autoincrement": false,
|
|
191
209
|
"default": 3
|
|
192
210
|
},
|
|
211
|
+
"batch_id": {
|
|
212
|
+
"name": "batch_id",
|
|
213
|
+
"type": "text",
|
|
214
|
+
"primaryKey": false,
|
|
215
|
+
"notNull": false,
|
|
216
|
+
"autoincrement": false
|
|
217
|
+
},
|
|
193
218
|
"schedule_type": {
|
|
194
219
|
"name": "schedule_type",
|
|
195
220
|
"type": "text",
|
|
@@ -242,6 +267,13 @@
|
|
|
242
267
|
"autoincrement": false,
|
|
243
268
|
"default": 30000
|
|
244
269
|
},
|
|
270
|
+
"timeout_ms": {
|
|
271
|
+
"name": "timeout_ms",
|
|
272
|
+
"type": "integer",
|
|
273
|
+
"primaryKey": false,
|
|
274
|
+
"notNull": false,
|
|
275
|
+
"autoincrement": false
|
|
276
|
+
},
|
|
245
277
|
"last_run_at": {
|
|
246
278
|
"name": "last_run_at",
|
|
247
279
|
"type": "integer",
|
|
@@ -281,7 +313,17 @@
|
|
|
281
313
|
"default": 0
|
|
282
314
|
}
|
|
283
315
|
},
|
|
284
|
-
"indexes": {
|
|
316
|
+
"indexes": {
|
|
317
|
+
"task_templates_due_idx": {
|
|
318
|
+
"name": "task_templates_due_idx",
|
|
319
|
+
"columns": [
|
|
320
|
+
"enabled",
|
|
321
|
+
"next_run_at",
|
|
322
|
+
"id"
|
|
323
|
+
],
|
|
324
|
+
"isUnique": false
|
|
325
|
+
}
|
|
326
|
+
},
|
|
285
327
|
"foreignKeys": {},
|
|
286
328
|
"compositePrimaryKeys": {},
|
|
287
329
|
"uniqueConstraints": {},
|
|
@@ -371,13 +413,6 @@
|
|
|
371
413
|
"notNull": false,
|
|
372
414
|
"autoincrement": false
|
|
373
415
|
},
|
|
374
|
-
"session_id": {
|
|
375
|
-
"name": "session_id",
|
|
376
|
-
"type": "text",
|
|
377
|
-
"primaryKey": false,
|
|
378
|
-
"notNull": false,
|
|
379
|
-
"autoincrement": false
|
|
380
|
-
},
|
|
381
416
|
"status": {
|
|
382
417
|
"name": "status",
|
|
383
418
|
"type": "text",
|
|
@@ -430,6 +465,14 @@
|
|
|
430
465
|
"autoincrement": false,
|
|
431
466
|
"default": 3
|
|
432
467
|
},
|
|
468
|
+
"retry_backoff_ms": {
|
|
469
|
+
"name": "retry_backoff_ms",
|
|
470
|
+
"type": "integer",
|
|
471
|
+
"primaryKey": false,
|
|
472
|
+
"notNull": false,
|
|
473
|
+
"autoincrement": false,
|
|
474
|
+
"default": 30000
|
|
475
|
+
},
|
|
433
476
|
"retry_after": {
|
|
434
477
|
"name": "retry_after",
|
|
435
478
|
"type": "integer",
|
|
@@ -459,7 +502,36 @@
|
|
|
459
502
|
"autoincrement": false
|
|
460
503
|
}
|
|
461
504
|
},
|
|
462
|
-
"indexes": {
|
|
505
|
+
"indexes": {
|
|
506
|
+
"tasks_queue_idx": {
|
|
507
|
+
"name": "tasks_queue_idx",
|
|
508
|
+
"columns": [
|
|
509
|
+
"status",
|
|
510
|
+
"retry_after",
|
|
511
|
+
"urgency",
|
|
512
|
+
"importance",
|
|
513
|
+
"created_at",
|
|
514
|
+
"id"
|
|
515
|
+
],
|
|
516
|
+
"isUnique": false
|
|
517
|
+
},
|
|
518
|
+
"tasks_batch_status_idx": {
|
|
519
|
+
"name": "tasks_batch_status_idx",
|
|
520
|
+
"columns": [
|
|
521
|
+
"batch_id",
|
|
522
|
+
"status"
|
|
523
|
+
],
|
|
524
|
+
"isUnique": false
|
|
525
|
+
},
|
|
526
|
+
"tasks_template_status_idx": {
|
|
527
|
+
"name": "tasks_template_status_idx",
|
|
528
|
+
"columns": [
|
|
529
|
+
"template_id",
|
|
530
|
+
"status"
|
|
531
|
+
],
|
|
532
|
+
"isUnique": false
|
|
533
|
+
}
|
|
534
|
+
},
|
|
463
535
|
"foreignKeys": {},
|
|
464
536
|
"compositePrimaryKeys": {},
|
|
465
537
|
"uniqueConstraints": {},
|