@hasna/loops 0.3.39 → 0.3.40

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/dist/cli/index.js CHANGED
@@ -946,8 +946,6 @@ class Store {
946
946
  WHERE idempotency_key IS NOT NULL;
947
947
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_workflow_created ON workflow_runs(workflow_id, created_at DESC);
948
948
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_loop_run ON workflow_runs(loop_run_id);
949
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
950
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
951
949
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
952
950
 
953
951
  CREATE TABLE IF NOT EXISTS workflow_invocations (
@@ -1120,6 +1118,7 @@ class Store {
1120
1118
  this.addColumnIfMissing("workflow_runs", "manifest_path", "TEXT");
1121
1119
  this.addColumnIfMissing("workflow_step_runs", "pid", "INTEGER");
1122
1120
  this.addColumnIfMissing("workflow_step_runs", "goal_run_id", "TEXT");
1121
+ this.createWorkflowRunBackfillIndexes();
1123
1122
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0001_initial_and_workflows", nowIso());
1124
1123
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0002_loop_machines", nowIso());
1125
1124
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0003_goals", nowIso());
@@ -1132,6 +1131,12 @@ class Store {
1132
1131
  return;
1133
1132
  this.db.query(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`).run();
1134
1133
  }
1134
+ createWorkflowRunBackfillIndexes() {
1135
+ this.db.exec(`
1136
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
1137
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
1138
+ `);
1139
+ }
1135
1140
  assertDaemonLeaseFence(opts = {}, now = nowIso()) {
1136
1141
  if (!opts.daemonLeaseId)
1137
1142
  return;
@@ -5711,7 +5716,7 @@ function buildScriptInventoryReport(store, opts = {}) {
5711
5716
  // package.json
5712
5717
  var package_default = {
5713
5718
  name: "@hasna/loops",
5714
- version: "0.3.39",
5719
+ version: "0.3.40",
5715
5720
  description: "Persistent local loop and workflow runner for deterministic commands and headless AI coding agents",
5716
5721
  type: "module",
5717
5722
  main: "dist/index.js",
@@ -946,8 +946,6 @@ class Store {
946
946
  WHERE idempotency_key IS NOT NULL;
947
947
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_workflow_created ON workflow_runs(workflow_id, created_at DESC);
948
948
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_loop_run ON workflow_runs(loop_run_id);
949
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
950
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
951
949
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
952
950
 
953
951
  CREATE TABLE IF NOT EXISTS workflow_invocations (
@@ -1120,6 +1118,7 @@ class Store {
1120
1118
  this.addColumnIfMissing("workflow_runs", "manifest_path", "TEXT");
1121
1119
  this.addColumnIfMissing("workflow_step_runs", "pid", "INTEGER");
1122
1120
  this.addColumnIfMissing("workflow_step_runs", "goal_run_id", "TEXT");
1121
+ this.createWorkflowRunBackfillIndexes();
1123
1122
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0001_initial_and_workflows", nowIso());
1124
1123
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0002_loop_machines", nowIso());
1125
1124
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0003_goals", nowIso());
@@ -1132,6 +1131,12 @@ class Store {
1132
1131
  return;
1133
1132
  this.db.query(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`).run();
1134
1133
  }
1134
+ createWorkflowRunBackfillIndexes() {
1135
+ this.db.exec(`
1136
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
1137
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
1138
+ `);
1139
+ }
1135
1140
  assertDaemonLeaseFence(opts = {}, now = nowIso()) {
1136
1141
  if (!opts.daemonLeaseId)
1137
1142
  return;
@@ -5025,7 +5030,7 @@ function enableStartup(result) {
5025
5030
  // package.json
5026
5031
  var package_default = {
5027
5032
  name: "@hasna/loops",
5028
- version: "0.3.39",
5033
+ version: "0.3.40",
5029
5034
  description: "Persistent local loop and workflow runner for deterministic commands and headless AI coding agents",
5030
5035
  type: "module",
5031
5036
  main: "dist/index.js",
package/dist/index.js CHANGED
@@ -944,8 +944,6 @@ class Store {
944
944
  WHERE idempotency_key IS NOT NULL;
945
945
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_workflow_created ON workflow_runs(workflow_id, created_at DESC);
946
946
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_loop_run ON workflow_runs(loop_run_id);
947
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
948
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
949
947
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
950
948
 
951
949
  CREATE TABLE IF NOT EXISTS workflow_invocations (
@@ -1118,6 +1116,7 @@ class Store {
1118
1116
  this.addColumnIfMissing("workflow_runs", "manifest_path", "TEXT");
1119
1117
  this.addColumnIfMissing("workflow_step_runs", "pid", "INTEGER");
1120
1118
  this.addColumnIfMissing("workflow_step_runs", "goal_run_id", "TEXT");
1119
+ this.createWorkflowRunBackfillIndexes();
1121
1120
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0001_initial_and_workflows", nowIso());
1122
1121
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0002_loop_machines", nowIso());
1123
1122
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0003_goals", nowIso());
@@ -1130,6 +1129,12 @@ class Store {
1130
1129
  return;
1131
1130
  this.db.query(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`).run();
1132
1131
  }
1132
+ createWorkflowRunBackfillIndexes() {
1133
+ this.db.exec(`
1134
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
1135
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
1136
+ `);
1137
+ }
1133
1138
  assertDaemonLeaseFence(opts = {}, now = nowIso()) {
1134
1139
  if (!opts.daemonLeaseId)
1135
1140
  return;
@@ -69,6 +69,7 @@ export declare class Store {
69
69
  * in {@link migrate}, never user input, so interpolation here is safe.
70
70
  */
71
71
  private addColumnIfMissing;
72
+ private createWorkflowRunBackfillIndexes;
72
73
  private assertDaemonLeaseFence;
73
74
  createLoop(input: CreateLoopInput, from?: Date): Loop;
74
75
  getLoop(id: string): Loop | undefined;
package/dist/lib/store.js CHANGED
@@ -944,8 +944,6 @@ class Store {
944
944
  WHERE idempotency_key IS NOT NULL;
945
945
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_workflow_created ON workflow_runs(workflow_id, created_at DESC);
946
946
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_loop_run ON workflow_runs(loop_run_id);
947
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
948
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
949
947
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
950
948
 
951
949
  CREATE TABLE IF NOT EXISTS workflow_invocations (
@@ -1118,6 +1116,7 @@ class Store {
1118
1116
  this.addColumnIfMissing("workflow_runs", "manifest_path", "TEXT");
1119
1117
  this.addColumnIfMissing("workflow_step_runs", "pid", "INTEGER");
1120
1118
  this.addColumnIfMissing("workflow_step_runs", "goal_run_id", "TEXT");
1119
+ this.createWorkflowRunBackfillIndexes();
1121
1120
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0001_initial_and_workflows", nowIso());
1122
1121
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0002_loop_machines", nowIso());
1123
1122
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0003_goals", nowIso());
@@ -1130,6 +1129,12 @@ class Store {
1130
1129
  return;
1131
1130
  this.db.query(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`).run();
1132
1131
  }
1132
+ createWorkflowRunBackfillIndexes() {
1133
+ this.db.exec(`
1134
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
1135
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
1136
+ `);
1137
+ }
1133
1138
  assertDaemonLeaseFence(opts = {}, now = nowIso()) {
1134
1139
  if (!opts.daemonLeaseId)
1135
1140
  return;
package/dist/sdk/index.js CHANGED
@@ -944,8 +944,6 @@ class Store {
944
944
  WHERE idempotency_key IS NOT NULL;
945
945
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_workflow_created ON workflow_runs(workflow_id, created_at DESC);
946
946
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_loop_run ON workflow_runs(loop_run_id);
947
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
948
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
949
947
  CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
950
948
 
951
949
  CREATE TABLE IF NOT EXISTS workflow_invocations (
@@ -1118,6 +1116,7 @@ class Store {
1118
1116
  this.addColumnIfMissing("workflow_runs", "manifest_path", "TEXT");
1119
1117
  this.addColumnIfMissing("workflow_step_runs", "pid", "INTEGER");
1120
1118
  this.addColumnIfMissing("workflow_step_runs", "goal_run_id", "TEXT");
1119
+ this.createWorkflowRunBackfillIndexes();
1121
1120
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0001_initial_and_workflows", nowIso());
1122
1121
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0002_loop_machines", nowIso());
1123
1122
  this.db.query("INSERT OR IGNORE INTO schema_migrations (id, applied_at) VALUES (?, ?)").run("0003_goals", nowIso());
@@ -1130,6 +1129,12 @@ class Store {
1130
1129
  return;
1131
1130
  this.db.query(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`).run();
1132
1131
  }
1132
+ createWorkflowRunBackfillIndexes() {
1133
+ this.db.exec(`
1134
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_invocation ON workflow_runs(invocation_id);
1135
+ CREATE INDEX IF NOT EXISTS idx_workflow_runs_work_item ON workflow_runs(work_item_id);
1136
+ `);
1137
+ }
1133
1138
  assertDaemonLeaseFence(opts = {}, now = nowIso()) {
1134
1139
  if (!opts.daemonLeaseId)
1135
1140
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/loops",
3
- "version": "0.3.39",
3
+ "version": "0.3.40",
4
4
  "description": "Persistent local loop and workflow runner for deterministic commands and headless AI coding agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",