@gobing-ai/spur 0.3.27 → 0.3.28

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/spur.js CHANGED
@@ -47,7 +47,7 @@ var __export = (target, all) => {
47
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
48
48
  var __require = import.meta.require;
49
49
 
50
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/errors.js
50
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/errors.js
51
51
  var ErrorCode;
52
52
  var init_errors = __esm(() => {
53
53
  ErrorCode = {
@@ -58,7 +58,7 @@ var init_errors = __esm(() => {
58
58
  };
59
59
  });
60
60
 
61
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/api-response.js
61
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/api-response.js
62
62
  var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
63
63
  var init_api_response = __esm(() => {
64
64
  init_errors();
@@ -81,16 +81,18 @@ var init_api_response = __esm(() => {
81
81
  CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
82
82
  });
83
83
 
84
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/cursor.js
84
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/cursor.js
85
85
  var init_cursor = () => {};
86
86
 
87
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/object.js
87
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/object.js
88
88
  function isPlainObject(value) {
89
89
  return typeof value === "object" && value !== null && !Array.isArray(value);
90
90
  }
91
91
  function deepMerge(target, source) {
92
92
  const result = { ...target };
93
93
  for (const [key, value] of Object.entries(source)) {
94
+ if (key === "__proto__")
95
+ continue;
94
96
  if (isPlainObject(value) && isPlainObject(result[key])) {
95
97
  result[key] = deepMerge(result[key], value);
96
98
  } else {
@@ -100,7 +102,7 @@ function deepMerge(target, source) {
100
102
  return result;
101
103
  }
102
104
 
103
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/output.js
105
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/output.js
104
106
  function processStream(name) {
105
107
  const proc = globalThis.process;
106
108
  const stream = proc?.[name];
@@ -121,7 +123,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
121
123
  }
122
124
  var defaultStdoutTarget, defaultStderrTarget;
123
125
 
124
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.14/node_modules/@gobing-ai/ts-utils/dist/index.js
126
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.15/node_modules/@gobing-ai/ts-utils/dist/index.js
125
127
  var init_dist = __esm(() => {
126
128
  init_api_response();
127
129
  init_cursor();
@@ -21743,7 +21745,7 @@ var init_zod = __esm(() => {
21743
21745
  init_external();
21744
21746
  });
21745
21747
 
21746
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/config.js
21748
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/config.js
21747
21749
  function getProcessEnv() {
21748
21750
  return process.env;
21749
21751
  }
@@ -21821,11 +21823,11 @@ var init_config = __esm(() => {
21821
21823
  };
21822
21824
  });
21823
21825
 
21824
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21826
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21825
21827
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
21826
21828
  import { dirname, resolve as resolvePath } from "path";
21827
- function createNodeFileSystem(root) {
21828
- const projectRoot = root ?? findProjectRoot(process.cwd());
21829
+ function createNodeFileSystem(root, paths) {
21830
+ const projectRoot = root ?? findProjectRoot(paths?.cwd ?? process.cwd());
21829
21831
  return {
21830
21832
  getProjectRoot: () => projectRoot,
21831
21833
  resolve: (...segments) => resolvePath(projectRoot, ...segments),
@@ -21908,7 +21910,7 @@ function findProjectRoot(startDir) {
21908
21910
  }
21909
21911
  var init_file_system_node = () => {};
21910
21912
 
21911
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21913
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21912
21914
  var DbModuleNotInstalledError;
21913
21915
  var init_db_errors = __esm(() => {
21914
21916
  DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
@@ -29099,7 +29101,7 @@ var init_execa = __esm(() => {
29099
29101
  } = getIpcExport());
29100
29102
  });
29101
29103
 
29102
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29104
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29103
29105
  import { isatty } from "tty";
29104
29106
 
29105
29107
  class NodeProcessExecutor {
@@ -29113,7 +29115,7 @@ class NodeProcessExecutor {
29113
29115
  async runUntraced(options) {
29114
29116
  const args = options.args ?? [];
29115
29117
  const execaOptions = buildExecaOptions({
29116
- cwd: options.cwd,
29118
+ cwd: options.cwd ?? this.config.paths?.cwd,
29117
29119
  env: options.env,
29118
29120
  timeout: options.timeout ?? this.config.defaultTimeout,
29119
29121
  maxOutput: options.maxOutput ?? this.config.defaultMaxOutput,
@@ -29429,7 +29431,7 @@ var init_process_executor = __esm(() => {
29429
29431
  init_execa();
29430
29432
  });
29431
29433
 
29432
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29434
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29433
29435
  function getNodeFileSystem() {
29434
29436
  if (!_nodeFileSystem)
29435
29437
  _nodeFileSystem = createNodeFileSystem();
@@ -29489,7 +29491,7 @@ var init_runtime_node_bun = __esm(() => {
29489
29491
  };
29490
29492
  });
29491
29493
 
29492
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/context.js
29494
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/context.js
29493
29495
  class RuntimeContext {
29494
29496
  scope;
29495
29497
  runtimeName;
@@ -29559,7 +29561,7 @@ var init_context = __esm(() => {
29559
29561
  init_runtime_node_bun();
29560
29562
  });
29561
29563
 
29562
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/path.js
29564
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/path.js
29563
29565
  function normalizeSeparators(path6) {
29564
29566
  return path6.replaceAll("\\", "/");
29565
29567
  }
@@ -29620,17 +29622,17 @@ var init_path = __esm(() => {
29620
29622
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
29621
29623
  });
29622
29624
 
29623
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29625
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29624
29626
  var REMOTE_SCHEMA_MAX_BYTES;
29625
29627
  var init_schema_validation = __esm(() => {
29626
29628
  init_dist2();
29627
29629
  REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
29628
29630
  });
29629
29631
 
29630
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/types.js
29632
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/types.js
29631
29633
  var init_types = () => {};
29632
29634
 
29633
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/index.js
29635
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/index.js
29634
29636
  var init_dist3 = __esm(() => {
29635
29637
  init_config();
29636
29638
  init_context();
@@ -29639,7 +29641,7 @@ var init_dist3 = __esm(() => {
29639
29641
  init_types();
29640
29642
  });
29641
29643
 
29642
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+c51d44ed7d8b072c/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29644
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+3805a7059a817025/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29643
29645
  import { Database } from "bun:sqlite";
29644
29646
  var init_bun_sqlite = () => {};
29645
29647
 
@@ -33831,7 +33833,7 @@ var init_bun_sqlite2 = __esm(() => {
33831
33833
  init_session2();
33832
33834
  });
33833
33835
 
33834
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33836
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33835
33837
  var inboxMessages;
33836
33838
  var init_inbox_messages = __esm(() => {
33837
33839
  init_sqlite_core();
@@ -33850,7 +33852,7 @@ var init_inbox_messages = __esm(() => {
33850
33852
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
33851
33853
  });
33852
33854
 
33853
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33855
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33854
33856
  function nowTimestamp() {
33855
33857
  return Date.now();
33856
33858
  }
@@ -33879,7 +33881,7 @@ var init_common3 = __esm(() => {
33879
33881
  appendOnlyColumns = buildAppendOnlyColumns();
33880
33882
  });
33881
33883
 
33882
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33884
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33883
33885
  var queueJobs;
33884
33886
  var init_queue_jobs = __esm(() => {
33885
33887
  init_sqlite_core();
@@ -33899,7 +33901,7 @@ var init_queue_jobs = __esm(() => {
33899
33901
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
33900
33902
  });
33901
33903
 
33902
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33904
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33903
33905
  var exports_runtime = {};
33904
33906
  __export(exports_runtime, {
33905
33907
  queueJobs: () => queueJobs,
@@ -33910,7 +33912,7 @@ var init_runtime = __esm(() => {
33910
33912
  init_queue_jobs();
33911
33913
  });
33912
33914
 
33913
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33915
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33914
33916
  var exports_bun_sqlite = {};
33915
33917
  __export(exports_bun_sqlite, {
33916
33918
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -34199,7 +34201,7 @@ var init_d1 = __esm(() => {
34199
34201
  init_session3();
34200
34202
  });
34201
34203
 
34202
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34204
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34203
34205
  var exports_d1 = {};
34204
34206
  __export(exports_d1, {
34205
34207
  D1Adapter: () => D1Adapter
@@ -34263,7 +34265,7 @@ var init_d12 = __esm(() => {
34263
34265
  init_runtime();
34264
34266
  });
34265
34267
 
34266
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/adapter.js
34268
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/adapter.js
34267
34269
  async function createDbAdapter(config3) {
34268
34270
  switch (config3.driver) {
34269
34271
  case "bun-sqlite": {
@@ -34303,7 +34305,7 @@ var init_drizzle_orm = __esm(() => {
34303
34305
  init_view_common();
34304
34306
  });
34305
34307
 
34306
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34308
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34307
34309
  function compilePredicate(predicate) {
34308
34310
  if ("and" in predicate) {
34309
34311
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -34341,7 +34343,7 @@ var init_query_spec = __esm(() => {
34341
34343
  };
34342
34344
  });
34343
34345
 
34344
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34346
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34345
34347
  function asSelectQuery(query) {
34346
34348
  return query;
34347
34349
  }
@@ -34383,7 +34385,7 @@ var init_base_dao = __esm(() => {
34383
34385
  init_query_spec();
34384
34386
  });
34385
34387
 
34386
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34388
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34387
34389
  var embeddedMigrations;
34388
34390
  var init_embedded_migrations = __esm(() => {
34389
34391
  embeddedMigrations = [
@@ -34415,7 +34417,7 @@ var init_embedded_migrations = __esm(() => {
34415
34417
  ];
34416
34418
  });
34417
34419
 
34418
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34420
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34419
34421
  var EntityDao;
34420
34422
  var init_entity_dao = __esm(() => {
34421
34423
  init_drizzle_orm();
@@ -34577,7 +34579,7 @@ var init_entity_dao = __esm(() => {
34577
34579
  };
34578
34580
  });
34579
34581
 
34580
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34582
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34581
34583
  function isPromiseLike(value) {
34582
34584
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
34583
34585
  }
@@ -34750,7 +34752,7 @@ var init_migrator2 = __esm(() => {
34750
34752
  init_migrator();
34751
34753
  });
34752
34754
 
34753
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/migrate.js
34755
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/migrate.js
34754
34756
  async function ensureJournalTable(adapter, table3) {
34755
34757
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
34756
34758
  }
@@ -34825,7 +34827,7 @@ var init_migrate = __esm(() => {
34825
34827
  init_embedded_migrations();
34826
34828
  });
34827
34829
 
34828
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34830
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34829
34831
  var QueueJobDao;
34830
34832
  var init_queue_job_dao = __esm(() => {
34831
34833
  init_drizzle_orm();
@@ -34966,7 +34968,7 @@ var init_queue_job_dao = __esm(() => {
34966
34968
  };
34967
34969
  });
34968
34970
 
34969
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/index.js
34971
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/index.js
34970
34972
  var exports_dist = {};
34971
34973
  __export(exports_dist, {
34972
34974
  embeddedMigrations: () => embeddedMigrations,
@@ -37432,7 +37434,7 @@ var init_src = __esm(() => {
37432
37434
  });
37433
37435
  });
37434
37436
 
37435
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/config.js
37437
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/config.js
37436
37438
  function parseYamlObject(text3) {
37437
37439
  let parsed;
37438
37440
  try {
@@ -37559,11 +37561,11 @@ var init_config2 = __esm(() => {
37559
37561
  };
37560
37562
  });
37561
37563
 
37562
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37564
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37563
37565
  import { appendFileSync as appendFileSync3, cpSync as cpSync2, createReadStream as createReadStream3, createWriteStream as createWriteStream3, existsSync as existsSync2, mkdirSync as mkdirSync2, readdirSync as readdirSync2, readFileSync as readFileSync4, realpathSync as realpathSync2, renameSync as renameSync2, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
37564
37566
  import { dirname as dirname2, resolve as resolvePath3 } from "path";
37565
- function createNodeFileSystem3(root) {
37566
- const projectRoot = root ?? findProjectRoot3(process.cwd());
37567
+ function createNodeFileSystem3(root, paths) {
37568
+ const projectRoot = root ?? findProjectRoot3(paths?.cwd ?? process.cwd());
37567
37569
  return {
37568
37570
  getProjectRoot: () => projectRoot,
37569
37571
  resolve: (...segments) => resolvePath3(projectRoot, ...segments),
@@ -37646,7 +37648,7 @@ function findProjectRoot3(startDir) {
37646
37648
  }
37647
37649
  var init_file_system_node2 = () => {};
37648
37650
 
37649
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37651
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37650
37652
  var D1NotConfiguredError2, DbModuleNotInstalledError3;
37651
37653
  var init_db_errors2 = __esm(() => {
37652
37654
  D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
@@ -37663,7 +37665,7 @@ var init_db_errors2 = __esm(() => {
37663
37665
  };
37664
37666
  });
37665
37667
 
37666
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37668
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37667
37669
  function createCfFileSystem2() {
37668
37670
  return {
37669
37671
  getProjectRoot: () => "/bundle",
@@ -37702,7 +37704,7 @@ function createCfFileSystem2() {
37702
37704
  }
37703
37705
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
37704
37706
 
37705
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37707
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37706
37708
  var exports_runtime_cf = {};
37707
37709
  __export(exports_runtime_cf, {
37708
37710
  cloudflareWorkersFactory: () => cloudflareWorkersFactory2
@@ -37740,7 +37742,7 @@ var init_runtime_cf = __esm(() => {
37740
37742
  };
37741
37743
  });
37742
37744
 
37743
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37745
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37744
37746
  import { isatty as isatty2 } from "tty";
37745
37747
 
37746
37748
  class NodeProcessExecutor3 {
@@ -37754,7 +37756,7 @@ class NodeProcessExecutor3 {
37754
37756
  async runUntraced(options) {
37755
37757
  const args = options.args ?? [];
37756
37758
  const execaOptions = buildExecaOptions2({
37757
- cwd: options.cwd,
37759
+ cwd: options.cwd ?? this.config.paths?.cwd,
37758
37760
  env: options.env,
37759
37761
  timeout: options.timeout ?? this.config.defaultTimeout,
37760
37762
  maxOutput: options.maxOutput ?? this.config.defaultMaxOutput,
@@ -38117,7 +38119,7 @@ var init_process_executor2 = __esm(() => {
38117
38119
  ProcessExecutor2 = NodeProcessExecutor3;
38118
38120
  });
38119
38121
 
38120
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38122
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38121
38123
  var exports_runtime_node_bun = {};
38122
38124
  __export(exports_runtime_node_bun, {
38123
38125
  nodeBunFactory: () => nodeBunFactory3,
@@ -38185,7 +38187,7 @@ var init_runtime_node_bun2 = __esm(() => {
38185
38187
  };
38186
38188
  });
38187
38189
 
38188
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38190
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38189
38191
  function isCloudflareWorkerRuntime2() {
38190
38192
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
38191
38193
  }
@@ -38215,7 +38217,7 @@ function _resetRuntimeFactory2() {
38215
38217
  }
38216
38218
  var _factory, _runtimeName;
38217
38219
 
38218
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/context.js
38220
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/context.js
38219
38221
  class RuntimeContext2 {
38220
38222
  scope;
38221
38223
  runtimeName;
@@ -38305,7 +38307,7 @@ var init_context2 = __esm(() => {
38305
38307
  init_runtime_node_bun2();
38306
38308
  });
38307
38309
 
38308
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/path.js
38310
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/path.js
38309
38311
  function normalizeSeparators2(path7) {
38310
38312
  return path7.replaceAll("\\", "/");
38311
38313
  }
@@ -38428,7 +38430,7 @@ var init_path2 = __esm(() => {
38428
38430
  SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
38429
38431
  });
38430
38432
 
38431
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38433
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38432
38434
  async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
38433
38435
  await fs2.ensureDir(dirnamePath(path7));
38434
38436
  }
@@ -38479,7 +38481,7 @@ var init_fs = __esm(() => {
38479
38481
  init_path2();
38480
38482
  });
38481
38483
 
38482
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38484
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38483
38485
  function allocateId() {
38484
38486
  nextIdSeq += 1;
38485
38487
  return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
@@ -38603,7 +38605,17 @@ function createInMemoryProcessRegistry2(options) {
38603
38605
  }
38604
38606
  var nextIdSeq = 0;
38605
38607
 
38606
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38608
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
38609
+ function ambientRuntimePaths2() {
38610
+ const cwd = getProcessCwd2();
38611
+ return { cwd, home: getHomeDir() ?? cwd };
38612
+ }
38613
+ var init_runtime_paths = __esm(() => {
38614
+ init_config2();
38615
+ init_path2();
38616
+ });
38617
+
38618
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38607
38619
  async function loadStructuredConfig(path7, options = {}) {
38608
38620
  const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
38609
38621
  return await parseStructuredConfig(content, path7, options);
@@ -38880,10 +38892,10 @@ var init_schema_validation2 = __esm(() => {
38880
38892
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
38881
38893
  });
38882
38894
 
38883
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/types.js
38895
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/types.js
38884
38896
  var init_types2 = () => {};
38885
38897
 
38886
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/index.js
38898
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/index.js
38887
38899
  var exports_dist2 = {};
38888
38900
  __export(exports_dist2, {
38889
38901
  writeJsonFile: () => writeJsonFile2,
@@ -38929,6 +38941,7 @@ __export(exports_dist2, {
38929
38941
  basenamePath: () => basenamePath,
38930
38942
  atomicWriteJson: () => atomicWriteJson2,
38931
38943
  atomicWriteFile: () => atomicWriteFile2,
38944
+ ambientRuntimePaths: () => ambientRuntimePaths2,
38932
38945
  _resetRuntimeFactory: () => _resetRuntimeFactory2,
38933
38946
  _resetNodeFileSystem: () => _resetNodeFileSystem2,
38934
38947
  YamlParseError: () => YamlParseError,
@@ -38952,6 +38965,7 @@ var init_dist5 = __esm(() => {
38952
38965
  init_process_executor2();
38953
38966
  init_runtime_cf();
38954
38967
  init_runtime_node_bun2();
38968
+ init_runtime_paths();
38955
38969
  init_process_executor2();
38956
38970
  init_config2();
38957
38971
  init_context2();
@@ -41033,7 +41047,7 @@ var init_mod = __esm(() => {
41033
41047
  init_config3();
41034
41048
  });
41035
41049
 
41036
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/logger.js
41050
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/logger.js
41037
41051
  function toLogTapeLevel(level) {
41038
41052
  return level === "warn" ? "warning" : level;
41039
41053
  }
@@ -42586,7 +42600,7 @@ var require_src = __commonJS((exports) => {
42586
42600
  };
42587
42601
  });
42588
42602
 
42589
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42603
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42590
42604
  function getTelemetryConfig(configPartial = {}) {
42591
42605
  return {
42592
42606
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -42622,7 +42636,7 @@ var init_sdk = __esm(() => {
42622
42636
  resolvedConfig = getTelemetryConfig();
42623
42637
  });
42624
42638
 
42625
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42639
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42626
42640
  function isSuppressed(tracer2) {
42627
42641
  return tracer2 === undefined && !getResolvedConfig().enabled;
42628
42642
  }
@@ -42662,7 +42676,7 @@ var init_tracing2 = __esm(() => {
42662
42676
  import_api2 = __toESM(require_src(), 1);
42663
42677
  });
42664
42678
 
42665
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42679
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42666
42680
  function getMeter() {
42667
42681
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
42668
42682
  }
@@ -42759,7 +42773,7 @@ var init_metrics = __esm(() => {
42759
42773
  instruments = {};
42760
42774
  });
42761
42775
 
42762
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42776
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42763
42777
  function busLogger() {
42764
42778
  if (!_busLogger)
42765
42779
  _busLogger = getLogger2("event-bus");
@@ -43004,7 +43018,7 @@ var init_event_bus = __esm(() => {
43004
43018
  init_metrics();
43005
43019
  });
43006
43020
 
43007
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43021
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43008
43022
  function obsLogger() {
43009
43023
  if (!_obsLogger)
43010
43024
  _obsLogger = getLogger2("event-bus.observers");
@@ -43068,7 +43082,7 @@ var init_default_observers = __esm(() => {
43068
43082
  init_event_bus();
43069
43083
  });
43070
43084
 
43071
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43085
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43072
43086
  function parentDir(filePath) {
43073
43087
  const idx = filePath.lastIndexOf("/");
43074
43088
  return idx <= 0 ? "." : filePath.slice(0, idx);
@@ -43166,7 +43180,22 @@ var init_file_observer = __esm(() => {
43166
43180
  init_logger3();
43167
43181
  });
43168
43182
 
43169
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43183
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
43184
+ function settleWithin(promise2, deadline) {
43185
+ const remaining = deadline - Date.now();
43186
+ if (remaining <= 0)
43187
+ return Promise.resolve();
43188
+ const { promise: settled, resolve } = Promise.withResolvers();
43189
+ const timer = setTimeout(resolve, remaining);
43190
+ const done = () => {
43191
+ clearTimeout(timer);
43192
+ resolve();
43193
+ };
43194
+ promise2.then(done, done);
43195
+ return settled;
43196
+ }
43197
+
43198
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43170
43199
  function parseInterval(cron) {
43171
43200
  const trimmed = cron.trim();
43172
43201
  const num = Number(trimmed);
@@ -43189,8 +43218,16 @@ function parseInterval(cron) {
43189
43218
 
43190
43219
  class NodeSchedulerAdapter {
43191
43220
  entries = [];
43221
+ drainTimeoutMs;
43192
43222
  running = false;
43193
- constructor() {}
43223
+ inflight = new Set;
43224
+ constructor(config4 = {}) {
43225
+ const { drainTimeoutMs } = config4;
43226
+ if (drainTimeoutMs !== undefined && (!Number.isFinite(drainTimeoutMs) || drainTimeoutMs < 0)) {
43227
+ throw new RangeError(`NodeSchedulerAdapter drainTimeoutMs must be a non-negative finite number; received ${drainTimeoutMs}`);
43228
+ }
43229
+ this.drainTimeoutMs = drainTimeoutMs ?? 30000;
43230
+ }
43194
43231
  register(cron, action) {
43195
43232
  this.entries.push({ cron, action });
43196
43233
  if (this.running) {
@@ -43216,12 +43253,23 @@ class NodeSchedulerAdapter {
43216
43253
  entry.timer = undefined;
43217
43254
  }
43218
43255
  }
43256
+ const deadline = Date.now() + this.drainTimeoutMs;
43257
+ for (const p of [...this.inflight]) {
43258
+ await settleWithin(p, deadline);
43259
+ }
43219
43260
  }
43220
43261
  startEntry(entry) {
43221
43262
  if (entry.timer)
43222
43263
  return;
43223
43264
  const interval = parseInterval(entry.cron);
43224
- entry.timer = setInterval(this._onScheduledTick.bind(this, entry), interval);
43265
+ entry.timer = setInterval(() => {
43266
+ const tick = this._onScheduledTick(entry);
43267
+ this.inflight.add(tick);
43268
+ const cleanup = () => {
43269
+ this.inflight.delete(tick);
43270
+ };
43271
+ tick.then(cleanup, cleanup);
43272
+ }, interval);
43225
43273
  }
43226
43274
  async _onScheduledTick(entry) {
43227
43275
  const startMs = performance.now();
@@ -43240,7 +43288,7 @@ var init_node3 = __esm(() => {
43240
43288
  init_metrics();
43241
43289
  });
43242
43290
 
43243
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43291
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43244
43292
  var exports_scheduler_node = {};
43245
43293
  __export(exports_scheduler_node, {
43246
43294
  NodeSchedulerAdapter: () => NodeSchedulerAdapter
@@ -50188,8 +50236,17 @@ function parseFeature(content) {
50188
50236
  }
50189
50237
 
50190
50238
  // ../../packages/domain/src/bdd/coverage.ts
50239
+ function stripScenarioPrefixes(title) {
50240
+ let out = title.trim();
50241
+ let previous;
50242
+ do {
50243
+ previous = out;
50244
+ out = out.replace(/^\[[^\]]*\]\s*/, "").replace(/^Scenario:\s*/i, "").replace(/^R\d+\s*[:\-\u2014]?\s*/, "").trim();
50245
+ } while (out !== previous);
50246
+ return out;
50247
+ }
50191
50248
  function normalizeTitle(title) {
50192
- return title.replace(/^(R\d+)\s*[:\-\u2014]?\s*/, "").trim().toLowerCase().replace(/[\u0027\u2018\u2019\u201c\u201d]/g, "").replace(/\s+/g, " ").trim();
50249
+ return stripScenarioPrefixes(title).replace(/^(R\d+)\s*[:\-\u2014]?\s*/, "").trim().toLowerCase().replace(/[\u0027\u2018\u2019\u201c\u201d]/g, "").replace(/\s+/g, " ").trim();
50193
50250
  }
50194
50251
  function checkAcCoverage(featureAc, taskAc, taskChecklist) {
50195
50252
  const featureParsed = parseForCoverage(featureAc);
@@ -50935,7 +50992,7 @@ var init_drizzle_zod = __esm(() => {
50935
50992
  };
50936
50993
  });
50937
50994
 
50938
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
50995
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
50939
50996
  function sqlExpressionToText(value) {
50940
50997
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
50941
50998
  return;
@@ -50958,7 +51015,7 @@ function getDrizzleTableName(table3) {
50958
51015
  return String(table3[nameSym]);
50959
51016
  }
50960
51017
 
50961
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
51018
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
50962
51019
  function quoteIdent(name) {
50963
51020
  return `"${name.replace(/"/g, '""')}"`;
50964
51021
  }
@@ -51052,7 +51109,7 @@ var init_ddl = __esm(() => {
51052
51109
  init_sqlite_core();
51053
51110
  });
51054
51111
 
51055
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51112
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51056
51113
  function defineTable(name, columns2) {
51057
51114
  const table3 = sqliteTable(name, columns2);
51058
51115
  let insert2;
@@ -51086,7 +51143,7 @@ var init_define_table = __esm(() => {
51086
51143
  init_ddl();
51087
51144
  });
51088
51145
 
51089
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.14+eb0d628435e6547b/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51146
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.15+7b9696e001f6f9db/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51090
51147
  var init_schema = __esm(() => {
51091
51148
  init_sqlite_core();
51092
51149
  init_define_table();
@@ -51711,7 +51768,7 @@ var init_dao = __esm(() => {
51711
51768
  init_workspace_dao();
51712
51769
  });
51713
51770
 
51714
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
51771
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
51715
51772
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
51716
51773
  var init_errors6 = __esm(() => {
51717
51774
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -51746,12 +51803,12 @@ var init_errors6 = __esm(() => {
51746
51803
  };
51747
51804
  });
51748
51805
 
51749
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
51806
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
51750
51807
  var init_event_bus2 = __esm(() => {
51751
51808
  init_event_bus();
51752
51809
  });
51753
51810
 
51754
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/api-client.js
51811
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/api-client.js
51755
51812
  function sanitizeUrlForObservability(url2) {
51756
51813
  try {
51757
51814
  const parsed = new URL(url2);
@@ -51981,12 +52038,12 @@ var init_api_client = __esm(() => {
51981
52038
  };
51982
52039
  });
51983
52040
 
51984
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
52041
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
51985
52042
  var init_telemetry = __esm(() => {
51986
52043
  init_tracing2();
51987
52044
  });
51988
52045
 
51989
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/index.js
52046
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/index.js
51990
52047
  var init_dist6 = __esm(() => {
51991
52048
  init_api_client();
51992
52049
  init_event_bus2();
@@ -51994,7 +52051,7 @@ var init_dist6 = __esm(() => {
51994
52051
  init_telemetry();
51995
52052
  });
51996
52053
 
51997
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
52054
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
51998
52055
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
51999
52056
  return {
52000
52057
  workflow: workflowName,
@@ -52253,7 +52310,7 @@ var init_run_lifecycle = __esm(() => {
52253
52310
  ];
52254
52311
  });
52255
52312
 
52256
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
52313
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
52257
52314
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
52258
52315
  var init_schema2 = __esm(() => {
52259
52316
  init_zod();
@@ -52337,7 +52394,7 @@ var init_schema2 = __esm(() => {
52337
52394
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
52338
52395
  });
52339
52396
 
52340
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
52397
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
52341
52398
  async function loadWorkflowDef(path9, options = {}) {
52342
52399
  return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
52343
52400
  }
@@ -52496,7 +52553,7 @@ var init_config4 = __esm(() => {
52496
52553
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
52497
52554
  });
52498
52555
 
52499
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
52556
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
52500
52557
  class CapabilityRegistry {
52501
52558
  kind;
52502
52559
  capabilities = new Map;
@@ -52527,7 +52584,7 @@ class CapabilityRegistry {
52527
52584
  }
52528
52585
  }
52529
52586
 
52530
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
52587
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
52531
52588
  function assertRelativeExtensionPath(path9, options = {}) {
52532
52589
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
52533
52590
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
@@ -52538,20 +52595,20 @@ function assertRelativeExtensionPath(path9, options = {}) {
52538
52595
  }
52539
52596
  }
52540
52597
 
52541
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
52598
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
52542
52599
  var init_extension_loader = () => {};
52543
52600
 
52544
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
52601
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
52545
52602
  var init_extension = __esm(() => {
52546
52603
  init_extension_loader();
52547
52604
  });
52548
52605
 
52549
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.14+1afbae169bbe5102/node_modules/@gobing-ai/ts-runtime/dist/extension.js
52606
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.15+df0d32ac93e36a8d/node_modules/@gobing-ai/ts-runtime/dist/extension.js
52550
52607
  var init_extension2 = __esm(() => {
52551
52608
  init_extension();
52552
52609
  });
52553
52610
 
52554
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
52611
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
52555
52612
  class WorkflowEngineHost {
52556
52613
  lifecycleBus;
52557
52614
  actions = new CapabilityRegistry("workflow action");
@@ -52720,7 +52777,7 @@ var init_host = __esm(() => {
52720
52777
  init_errors6();
52721
52778
  });
52722
52779
 
52723
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
52780
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
52724
52781
  var WORKFLOW_ENGINE_SCHEMA_SQL;
52725
52782
  var init_schema_sql = __esm(() => {
52726
52783
  WORKFLOW_ENGINE_SCHEMA_SQL = `
@@ -52793,7 +52850,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
52793
52850
  `.trim();
52794
52851
  });
52795
52852
 
52796
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
52853
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
52797
52854
  async function applyWorkflowEngineSchema(db2) {
52798
52855
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
52799
52856
  const sql4 = statement.trim();
@@ -53082,7 +53139,7 @@ var init_persistence = __esm(() => {
53082
53139
  init_schema_sql();
53083
53140
  });
53084
53141
 
53085
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53142
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53086
53143
  function mergeVars(workflowVars = {}, overrideVars = {}) {
53087
53144
  return { ...workflowVars, ...overrideVars };
53088
53145
  }
@@ -53142,7 +53199,7 @@ var init_variables = __esm(() => {
53142
53199
  TEMPLATE_REF = /\$\{([^}]+)\}/g;
53143
53200
  });
53144
53201
 
53145
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
53202
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
53146
53203
  async function runActionStep(action, vars, deps) {
53147
53204
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
53148
53205
  const resolved = resolveTemplates(action.options ?? {}, {
@@ -53200,7 +53257,7 @@ var init_action_step = __esm(() => {
53200
53257
  init_variables();
53201
53258
  });
53202
53259
 
53203
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
53260
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
53204
53261
  class StateMachineDriver {
53205
53262
  options;
53206
53263
  constructor(options) {
@@ -53334,7 +53391,7 @@ var init_state_machine = __esm(() => {
53334
53391
  EMPTY_OUTCOME = { outcome: "completed", result: undefined };
53335
53392
  });
53336
53393
 
53337
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
53394
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
53338
53395
  class TransitionFlowDriver {
53339
53396
  options;
53340
53397
  constructor(options) {
@@ -53452,7 +53509,7 @@ var init_transition_flow = __esm(() => {
53452
53509
  init_variables();
53453
53510
  });
53454
53511
 
53455
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
53512
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
53456
53513
  class WorkflowService {
53457
53514
  host;
53458
53515
  persistence;
@@ -53669,7 +53726,7 @@ var init_service = __esm(() => {
53669
53726
  init_variables();
53670
53727
  });
53671
53728
 
53672
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
53729
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
53673
53730
  var init_dist7 = __esm(() => {
53674
53731
  init_config4();
53675
53732
  init_host();
@@ -53678,7 +53735,7 @@ var init_dist7 = __esm(() => {
53678
53735
  init_service();
53679
53736
  });
53680
53737
 
53681
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
53738
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
53682
53739
  var HistoryImportError;
53683
53740
  var init_errors7 = __esm(() => {
53684
53741
  HistoryImportError = class HistoryImportError extends Error {
@@ -53691,7 +53748,7 @@ var init_errors7 = __esm(() => {
53691
53748
  };
53692
53749
  });
53693
53750
 
53694
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
53751
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
53695
53752
  import { createHash } from "crypto";
53696
53753
  function stableJson(value) {
53697
53754
  if (Array.isArray(value)) {
@@ -53708,7 +53765,7 @@ function sha256(value) {
53708
53765
  }
53709
53766
  var init_hash = () => {};
53710
53767
 
53711
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
53768
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
53712
53769
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
53713
53770
  if (typeof value === "string") {
53714
53771
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -53745,7 +53802,7 @@ var init_redaction = __esm(() => {
53745
53802
  ];
53746
53803
  });
53747
53804
 
53748
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
53805
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
53749
53806
  var HISTORY_IMPORT_SCHEMA_SQL;
53750
53807
  var init_schema_sql2 = __esm(() => {
53751
53808
  HISTORY_IMPORT_SCHEMA_SQL = `
@@ -53832,7 +53889,7 @@ CREATE TABLE IF NOT EXISTS history_etl_openclaw (
53832
53889
  `.trim();
53833
53890
  });
53834
53891
 
53835
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
53892
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
53836
53893
  function firstString(...values) {
53837
53894
  for (const value of values) {
53838
53895
  if (typeof value === "string" && value.length > 0)
@@ -53897,11 +53954,59 @@ function sourceDefinition(source, displayName, defaultRoots, filePatterns) {
53897
53954
  };
53898
53955
  }
53899
53956
  function getSourceDefinition(source) {
53900
- return SOURCE_DEFINITIONS[source];
53957
+ const definition = SOURCE_DEFINITIONS[source];
53958
+ if (definition === undefined) {
53959
+ throw new HistoryImportError(`Unknown LLM JSONL source: ${source}`, { source });
53960
+ }
53961
+ return definition;
53962
+ }
53963
+ function validateSourceDefinition(definition) {
53964
+ const requiredFields = [
53965
+ "source",
53966
+ "displayName",
53967
+ "defaultRoots",
53968
+ "filePatterns",
53969
+ "targetTable",
53970
+ "splitConfig",
53971
+ "fieldMap",
53972
+ "fieldTransforms",
53973
+ "schema"
53974
+ ];
53975
+ for (const field of requiredFields) {
53976
+ if (definition[field] === undefined || definition[field] === null) {
53977
+ throw new HistoryImportError(`Source definition is missing required field: ${String(field)}`, {
53978
+ source: definition.source,
53979
+ field: String(field)
53980
+ });
53981
+ }
53982
+ }
53983
+ if (definition.filePatterns.length === 0) {
53984
+ throw new HistoryImportError("Source definition must declare at least one file pattern", {
53985
+ source: definition.source,
53986
+ field: "filePatterns"
53987
+ });
53988
+ }
53989
+ assertValidTable(definition.targetTable, definition.source);
53990
+ if (definition.splitConfig.mode !== "one-to-one" && definition.splitConfig.targetTable !== undefined) {
53991
+ assertValidTable(definition.splitConfig.targetTable, definition.source);
53992
+ }
53993
+ return definition;
53901
53994
  }
53902
- var sourceRecordSchema, SOURCE_DEFINITIONS;
53995
+ function resolveSourceDefinition(input) {
53996
+ if (typeof input === "string") {
53997
+ return getSourceDefinition(input);
53998
+ }
53999
+ return validateSourceDefinition(input);
54000
+ }
54001
+ function assertValidTable(table3, source) {
54002
+ if (!VALID_TABLE_NAME.test(table3)) {
54003
+ throw new HistoryImportError(`Invalid history ETL target table for source "${source}": ${table3}. Must match ${VALID_TABLE_NAME.source}.`, { source, table: table3 });
54004
+ }
54005
+ }
54006
+ var sourceRecordSchema, VALID_TABLE_NAME, SOURCE_DEFINITIONS;
53903
54007
  var init_sources = __esm(() => {
53904
54008
  init_zod();
54009
+ init_errors7();
53905
54010
  sourceRecordSchema = exports_external.object({
53906
54011
  source_record_id: exports_external.string().min(1),
53907
54012
  created_at: exports_external.string().min(1),
@@ -53909,6 +54014,7 @@ var init_sources = __esm(() => {
53909
54014
  role: exports_external.string().optional(),
53910
54015
  model: exports_external.string().optional()
53911
54016
  }).passthrough();
54017
+ VALID_TABLE_NAME = /^history_etl_[a-z_]+$/;
53912
54018
  SOURCE_DEFINITIONS = {
53913
54019
  pi: sourceDefinition("pi", "Pi", [".pi/history", ".pi"], ["*.jsonl", "*.json"]),
53914
54020
  claude: sourceDefinition("claude", "Claude Code", [".claude/projects", ".claude"], ["*.jsonl"]),
@@ -53920,7 +54026,7 @@ var init_sources = __esm(() => {
53920
54026
  };
53921
54027
  });
53922
54028
 
53923
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
54029
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
53924
54030
  async function applyHistoryImportSchema(db2) {
53925
54031
  for (const statement of HISTORY_IMPORT_SCHEMA_SQL.split(";")) {
53926
54032
  const sql4 = statement.trim();
@@ -53929,14 +54035,35 @@ async function applyHistoryImportSchema(db2) {
53929
54035
  }
53930
54036
  }
53931
54037
  }
54038
+ async function ensureTargetTables(db2, definition) {
54039
+ const tables = new Set([targetTableFor(definition.targetTable)]);
54040
+ if (definition.splitConfig.mode !== "one-to-one" && definition.splitConfig.targetTable !== undefined) {
54041
+ tables.add(targetTableFor(definition.splitConfig.targetTable));
54042
+ }
54043
+ for (const table3 of tables) {
54044
+ await db2.exec(ETL_TABLE_DDL(table3));
54045
+ }
54046
+ }
54047
+ function ETL_TABLE_DDL(table3) {
54048
+ return `CREATE TABLE IF NOT EXISTS ${table3} (
54049
+ record_hash TEXT PRIMARY KEY,
54050
+ source_file TEXT NOT NULL,
54051
+ source_line INTEGER NOT NULL,
54052
+ split_index INTEGER NOT NULL,
54053
+ payload_json TEXT NOT NULL,
54054
+ imported_at TEXT NOT NULL
54055
+ );`;
54056
+ }
53932
54057
  async function runJsonlImport(source, options) {
53933
- const definition = getSourceDefinition(source);
54058
+ const definition = resolveSourceDefinition(source);
54059
+ const resolvedSource = definition.source;
53934
54060
  const fileSystem = options.fileSystem ?? createNodeFileSystem3();
53935
54061
  await applyHistoryImportSchema(options.db);
54062
+ await ensureTargetTables(options.db, definition);
53936
54063
  const mode = options.mode ?? "incremental";
53937
- const files = await discoverFiles(definition, options.roots, options.files, fileSystem);
54064
+ const files = await discoverFiles(definition, options.roots, options.files, fileSystem, options.paths);
53938
54065
  if (mode === "full" && !options.dryRun) {
53939
- await resetCheckpoints(options.db, source, files);
54066
+ await resetCheckpoints(options.db, resolvedSource, files);
53940
54067
  }
53941
54068
  const parseErrors = [];
53942
54069
  const validationErrors = [];
@@ -53945,7 +54072,7 @@ async function runJsonlImport(source, options) {
53945
54072
  let skippedDuplicates = 0;
53946
54073
  let checkpointUpdates = 0;
53947
54074
  for (const file2 of files) {
53948
- const checkpoint = mode === "incremental" ? await readCheckpoint(options.db, source, file2) : 0;
54075
+ const checkpoint = mode === "incremental" ? await readCheckpoint(options.db, resolvedSource, file2) : 0;
53949
54076
  let lineNumber = 0;
53950
54077
  for await (const rawLine of readLines(fileSystem, file2)) {
53951
54078
  lineNumber += 1;
@@ -53963,7 +54090,7 @@ async function runJsonlImport(source, options) {
53963
54090
  if (split === undefined)
53964
54091
  continue;
53965
54092
  const normalized = normalizeRecord(definition, split.raw, {
53966
- source,
54093
+ source: resolvedSource,
53967
54094
  sourceFile: file2,
53968
54095
  sourceLine: lineNumber,
53969
54096
  splitIndex
@@ -53980,7 +54107,7 @@ async function runJsonlImport(source, options) {
53980
54107
  const redacted = redactRecord(parsed.data, options.redactionRules);
53981
54108
  lineSucceeded = true;
53982
54109
  const recordHash = sha256({
53983
- source,
54110
+ source: resolvedSource,
53984
54111
  sourceFile: file2,
53985
54112
  sourceLine: lineNumber,
53986
54113
  splitIndex,
@@ -53992,18 +54119,18 @@ async function runJsonlImport(source, options) {
53992
54119
  }
53993
54120
  if (!options.dryRun) {
53994
54121
  await insertRecord(options.db, split.targetTable, recordHash, file2, lineNumber, splitIndex, redacted, options.now);
53995
- await insertLedger(options.db, recordHash, source, file2, lineNumber, splitIndex, split.targetTable, options.now);
54122
+ await insertLedger(options.db, recordHash, resolvedSource, file2, lineNumber, splitIndex, split.targetTable, options.now);
53996
54123
  }
53997
54124
  importedRecords += 1;
53998
54125
  }
53999
54126
  if (lineSucceeded && !options.dryRun) {
54000
- await writeCheckpoint(options.db, source, file2, lineNumber, options.now);
54127
+ await writeCheckpoint(options.db, resolvedSource, file2, lineNumber, options.now);
54001
54128
  checkpointUpdates += 1;
54002
54129
  }
54003
54130
  }
54004
54131
  }
54005
54132
  return {
54006
- source,
54133
+ source: resolvedSource,
54007
54134
  mode,
54008
54135
  scannedFiles: files.length,
54009
54136
  processedLines,
@@ -54064,11 +54191,12 @@ function normalizeRecord(definition, raw, context4) {
54064
54191
  normalized.split_index = context4.splitIndex;
54065
54192
  return normalized;
54066
54193
  }
54067
- async function discoverFiles(definition, roots, files, fileSystem) {
54194
+ async function discoverFiles(definition, roots, files, fileSystem, paths) {
54068
54195
  if (files !== undefined && files.length > 0) {
54069
54196
  return files.map((file2) => resolvePath4(file2)).sort();
54070
54197
  }
54071
- const resolvedRoots = (roots ?? definition.defaultRoots).map((root) => resolvePath4(root));
54198
+ const ambient = paths ?? ambientRuntimePaths2();
54199
+ const resolvedRoots = roots !== undefined ? roots.map((root) => resolvePath4(ambient.cwd, root)) : definition.defaultRoots.map((root) => resolvePath4(ambient.home, root));
54072
54200
  const found = new Set;
54073
54201
  for (const root of resolvedRoots) {
54074
54202
  if (!await fileSystem.exists(root))
@@ -54146,7 +54274,6 @@ async function* readLines(fileSystem, file2) {
54146
54274
  yield line;
54147
54275
  }
54148
54276
  }
54149
- var VALID_TABLE_NAME;
54150
54277
  var init_importer = __esm(() => {
54151
54278
  init_dist5();
54152
54279
  init_errors7();
@@ -54154,16 +54281,15 @@ var init_importer = __esm(() => {
54154
54281
  init_redaction();
54155
54282
  init_schema_sql2();
54156
54283
  init_sources();
54157
- VALID_TABLE_NAME = /^history_etl_[a-z_]+$/;
54158
54284
  });
54159
54285
 
54160
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.14+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
54286
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.15+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
54161
54287
  var init_dist8 = __esm(() => {
54162
54288
  init_importer();
54163
54289
  init_schema_sql2();
54164
54290
  });
54165
54291
 
54166
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
54292
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
54167
54293
  function collectExtensions(sourceName, sourceDir, extensions) {
54168
54294
  if (extensions === undefined)
54169
54295
  return [];
@@ -54179,7 +54305,7 @@ var init_extensions = __esm(() => {
54179
54305
  init_dist5();
54180
54306
  });
54181
54307
 
54182
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
54308
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
54183
54309
  function createFinding(rule, message, filePath, extras = {}) {
54184
54310
  return {
54185
54311
  ruleId: rule.id,
@@ -54250,7 +54376,7 @@ var init_types3 = __esm(() => {
54250
54376
  });
54251
54377
  });
54252
54378
 
54253
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
54379
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
54254
54380
  async function loadPreset(name, options) {
54255
54381
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
54256
54382
  const presetPath = findMergedPreset(merged, name);
@@ -54465,7 +54591,7 @@ var init_loader2 = __esm(() => {
54465
54591
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
54466
54592
  });
54467
54593
 
54468
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
54594
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
54469
54595
  function normalizeFindingPath(filePath) {
54470
54596
  if (!filePath || isAbsolutePath2(filePath))
54471
54597
  return null;
@@ -54530,7 +54656,7 @@ var init_test_stub_fixer = __esm(() => {
54530
54656
  realFileSystem = createNodeFileSystem3();
54531
54657
  });
54532
54658
 
54533
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
54659
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
54534
54660
  function registerBuiltinFixers(host, exec) {
54535
54661
  const regexFixer = new RegexFixerProvider;
54536
54662
  const pathFixer = new PathFixerProvider;
@@ -54733,7 +54859,7 @@ var init_fixers = __esm(() => {
54733
54859
  };
54734
54860
  });
54735
54861
 
54736
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
54862
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
54737
54863
  function resolveAgentName(input) {
54738
54864
  if (isCanonicalName(input))
54739
54865
  return input;
@@ -54984,7 +55110,7 @@ var init_shims = __esm(() => {
54984
55110
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
54985
55111
  });
54986
55112
 
54987
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
55113
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
54988
55114
  function buildIdentityPreamble(ctx) {
54989
55115
  const sections = [
54990
55116
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -55044,7 +55170,7 @@ var init_identity = __esm(() => {
55044
55170
  init_dist5();
55045
55171
  });
55046
55172
 
55047
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
55173
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
55048
55174
  function isClaudeStyleSlashCommand(input) {
55049
55175
  return SLASH_COMMAND_RE.test(input);
55050
55176
  }
@@ -55072,7 +55198,15 @@ var init_slash_command = __esm(() => {
55072
55198
  SLASH_COMMAND_RE = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
55073
55199
  });
55074
55200
 
55075
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
55201
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
55202
+ function buildCorrelationEnv(correlation) {
55203
+ return {
55204
+ [AGENT_RUN_ID_ENV]: correlation.runId,
55205
+ [AGENT_EXECUTION_ID_ENV]: correlation.executionId,
55206
+ ...correlation.actionId !== undefined ? { [AGENT_ACTION_ID_ENV]: correlation.actionId } : {}
55207
+ };
55208
+ }
55209
+
55076
55210
  class AiRunner {
55077
55211
  processExecutor;
55078
55212
  defaultCwd;
@@ -55131,6 +55265,7 @@ class AiRunner {
55131
55265
  label,
55132
55266
  ...options.correlation !== undefined ? { correlation: options.correlation } : {}
55133
55267
  });
55268
+ const correlationEnv = options.correlation === undefined ? undefined : buildCorrelationEnv(options.correlation);
55134
55269
  const result = await this.processExecutor.run({
55135
55270
  command: command.command,
55136
55271
  args: command.args,
@@ -55139,6 +55274,7 @@ class AiRunner {
55139
55274
  forceBuffered,
55140
55275
  cwd: options.cwd ?? this.defaultCwd,
55141
55276
  timeout: options.timeout ?? this.defaultTimeout,
55277
+ ...correlationEnv !== undefined ? { env: correlationEnv } : {},
55142
55278
  ...options.signal !== undefined ? { signal: options.signal } : {},
55143
55279
  ...options.onOutput !== undefined ? { onOutput: options.onOutput } : {}
55144
55280
  });
@@ -55189,6 +55325,7 @@ function applyIdentityPreamble(agent, promptOptions, context4) {
55189
55325
  ${promptOptions.input}`;
55190
55326
  return { ...promptOptions, input };
55191
55327
  }
55328
+ var AGENT_RUN_ID_ENV = "SPUR_RUN_ID", AGENT_EXECUTION_ID_ENV = "SPUR_EXECUTION_ID", AGENT_ACTION_ID_ENV = "SPUR_ACTION_ID";
55192
55329
  var init_ai_runner = __esm(() => {
55193
55330
  init_dist6();
55194
55331
  init_dist5();
@@ -55197,7 +55334,7 @@ var init_ai_runner = __esm(() => {
55197
55334
  init_slash_command();
55198
55335
  });
55199
55336
 
55200
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
55337
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
55201
55338
  class AgentDetector {
55202
55339
  runner;
55203
55340
  timeout;
@@ -55273,7 +55410,7 @@ var init_agent_detector = __esm(() => {
55273
55410
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
55274
55411
  });
55275
55412
 
55276
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
55413
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
55277
55414
  function validateAgentId(id) {
55278
55415
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
55279
55416
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -55370,7 +55507,7 @@ var init_agent_spec = __esm(() => {
55370
55507
  };
55371
55508
  });
55372
55509
 
55373
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
55510
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
55374
55511
  function isNonEmpty(value) {
55375
55512
  return value !== undefined && value.trim().length > 0;
55376
55513
  }
@@ -55475,7 +55612,7 @@ var init_auth_shims = __esm(() => {
55475
55612
  };
55476
55613
  });
55477
55614
 
55478
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
55615
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
55479
55616
  class ModelHealthProbeRegistry {
55480
55617
  probes = new Map;
55481
55618
  register(providerPrefix, probe) {
@@ -55583,7 +55720,7 @@ var init_model_health_probe = __esm(() => {
55583
55720
  };
55584
55721
  });
55585
55722
 
55586
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
55723
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
55587
55724
  class DoctorRunner {
55588
55725
  detector;
55589
55726
  runner;
@@ -55720,15 +55857,15 @@ var init_doctor_runner = __esm(() => {
55720
55857
  init_model_health_probe();
55721
55858
  });
55722
55859
 
55723
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
55860
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
55724
55861
  var init_events = () => {};
55725
55862
 
55726
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
55863
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
55727
55864
  function formatMessage(msg) {
55728
55865
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
55729
55866
  }
55730
55867
 
55731
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
55868
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
55732
55869
  import { Buffer as Buffer5 } from "buffer";
55733
55870
 
55734
55871
  class TeamAgentProcess {
@@ -55862,7 +55999,7 @@ var init_team_agent_process = __esm(() => {
55862
55999
  init_dist5();
55863
56000
  });
55864
56001
 
55865
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
56002
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
55866
56003
  class TeamOrchestrator {
55867
56004
  configDir;
55868
56005
  inbox;
@@ -55991,7 +56128,7 @@ var init_team_orchestrator = __esm(() => {
55991
56128
  init_team_agent_process();
55992
56129
  });
55993
56130
 
55994
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.14+127e896e9a498407/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
56131
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.15+1d3d52e40c4aad1a/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
55995
56132
  var exports_dist3 = {};
55996
56133
  __export(exports_dist3, {
55997
56134
  validateAgentId: () => validateAgentId,
@@ -56022,7 +56159,10 @@ __export(exports_dist3, {
56022
56159
  DEFAULT_PROBE_TIMEOUT_MS: () => DEFAULT_PROBE_TIMEOUT_MS,
56023
56160
  AiRunner: () => AiRunner,
56024
56161
  AgentDetector: () => AgentDetector,
56025
- AGENT_SHIMS: () => AGENT_SHIMS
56162
+ AGENT_SHIMS: () => AGENT_SHIMS,
56163
+ AGENT_RUN_ID_ENV: () => AGENT_RUN_ID_ENV,
56164
+ AGENT_EXECUTION_ID_ENV: () => AGENT_EXECUTION_ID_ENV,
56165
+ AGENT_ACTION_ID_ENV: () => AGENT_ACTION_ID_ENV
56026
56166
  });
56027
56167
  var init_dist9 = __esm(() => {
56028
56168
  init_agent_detector();
@@ -56039,7 +56179,7 @@ var init_dist9 = __esm(() => {
56039
56179
  init_team_orchestrator();
56040
56180
  });
56041
56181
 
56042
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
56182
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
56043
56183
  function stringArray(value) {
56044
56184
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
56045
56185
  }
@@ -56077,7 +56217,7 @@ function parseInlineFlags(source) {
56077
56217
  return { flags, rest: source.slice(match[0].length) };
56078
56218
  }
56079
56219
 
56080
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
56220
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
56081
56221
  function matchesAny(path9, patterns) {
56082
56222
  if (patterns === undefined || patterns.length === 0)
56083
56223
  return true;
@@ -56125,7 +56265,7 @@ function escapeRegExp(value) {
56125
56265
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
56126
56266
  }
56127
56267
 
56128
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
56268
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
56129
56269
  async function discoverFiles2(options) {
56130
56270
  const fs3 = options.fs ?? createNodeFileSystem3();
56131
56271
  const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -56153,12 +56293,12 @@ var init_file_discovery = __esm(() => {
56153
56293
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
56154
56294
  });
56155
56295
 
56156
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
56296
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
56157
56297
  var init_file_utils = __esm(() => {
56158
56298
  init_file_discovery();
56159
56299
  });
56160
56300
 
56161
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
56301
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
56162
56302
  class AgentDetectionEvaluator {
56163
56303
  detector;
56164
56304
  constructor(detector = new AgentDetector) {
@@ -56186,7 +56326,7 @@ var init_agent_detection_evaluator = __esm(() => {
56186
56326
  init_file_utils();
56187
56327
  });
56188
56328
 
56189
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
56329
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
56190
56330
  class CoverageGateEvaluator {
56191
56331
  constructor() {}
56192
56332
  async evaluate(rule, context4) {
@@ -56270,7 +56410,7 @@ var init_coverage_gate_evaluator = __esm(() => {
56270
56410
  init_file_utils();
56271
56411
  });
56272
56412
 
56273
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
56413
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
56274
56414
  class ExitCodeEvaluator {
56275
56415
  executor;
56276
56416
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -56306,7 +56446,7 @@ var init_exit_code_evaluator = __esm(() => {
56306
56446
  init_file_utils();
56307
56447
  });
56308
56448
 
56309
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
56449
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
56310
56450
  class ForbiddenImportEvaluator {
56311
56451
  constructor() {}
56312
56452
  async evaluate(rule, context4) {
@@ -56387,7 +56527,7 @@ var init_forbidden_import_evaluator = __esm(() => {
56387
56527
  init_file_utils();
56388
56528
  });
56389
56529
 
56390
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
56530
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
56391
56531
  class ImportBoundaryEvaluator {
56392
56532
  async evaluate(rule, context4) {
56393
56533
  const config4 = rule.evaluator.config ?? {};
@@ -56480,7 +56620,7 @@ var init_import_boundary_evaluator = __esm(() => {
56480
56620
  init_file_utils();
56481
56621
  });
56482
56622
 
56483
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
56623
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
56484
56624
  class PathEvaluator {
56485
56625
  constructor() {}
56486
56626
  async evaluate(rule, context4) {
@@ -56541,7 +56681,7 @@ var init_path_evaluator = __esm(() => {
56541
56681
  init_file_utils();
56542
56682
  });
56543
56683
 
56544
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
56684
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
56545
56685
  class RegexEvaluator {
56546
56686
  constructor() {}
56547
56687
  async evaluate(rule, context4) {
@@ -56619,7 +56759,7 @@ var init_regex_evaluator = __esm(() => {
56619
56759
  init_file_utils();
56620
56760
  });
56621
56761
 
56622
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
56762
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
56623
56763
  class RipgrepEvaluator {
56624
56764
  executor;
56625
56765
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -56712,7 +56852,7 @@ var init_ripgrep_evaluator = __esm(() => {
56712
56852
  init_file_utils();
56713
56853
  });
56714
56854
 
56715
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
56855
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
56716
56856
  class SchemaArtifactEvaluator {
56717
56857
  constructor() {}
56718
56858
  async evaluate(rule, context4) {
@@ -56790,7 +56930,7 @@ var init_schema_artifact_evaluator = __esm(() => {
56790
56930
  init_file_utils();
56791
56931
  });
56792
56932
 
56793
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
56933
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
56794
56934
  class SecretsScannerEvaluator {
56795
56935
  constructor() {}
56796
56936
  async evaluate(rule, context4) {
@@ -56858,7 +56998,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
56858
56998
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
56859
56999
  });
56860
57000
 
56861
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
57001
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
56862
57002
  class SgEvaluator {
56863
57003
  executor;
56864
57004
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -56955,7 +57095,7 @@ var init_sg_evaluator = __esm(() => {
56955
57095
  init_file_utils();
56956
57096
  });
56957
57097
 
56958
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
57098
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
56959
57099
  class TypeScriptTestPathResolver {
56960
57100
  name = "typescript";
56961
57101
  constructor() {}
@@ -57038,7 +57178,7 @@ function testify(rel) {
57038
57178
  return `${dir}test_${base2}`;
57039
57179
  }
57040
57180
 
57041
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
57181
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
57042
57182
  class TestLocationEvaluator {
57043
57183
  resolvers;
57044
57184
  constructor(resolvers) {
@@ -57113,7 +57253,7 @@ var init_test_location_evaluator = __esm(() => {
57113
57253
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
57114
57254
  });
57115
57255
 
57116
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
57256
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
57117
57257
  class TsdocExportEvaluator {
57118
57258
  constructor() {}
57119
57259
  async evaluate(rule, context4) {
@@ -57198,7 +57338,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
57198
57338
  };
57199
57339
  });
57200
57340
 
57201
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
57341
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
57202
57342
  class JsonFormatter {
57203
57343
  constructor() {}
57204
57344
  format(result) {
@@ -57206,7 +57346,7 @@ class JsonFormatter {
57206
57346
  }
57207
57347
  }
57208
57348
 
57209
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
57349
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
57210
57350
  class TextFormatter {
57211
57351
  constructor() {}
57212
57352
  format(result) {
@@ -57220,7 +57360,7 @@ class TextFormatter {
57220
57360
  }
57221
57361
  }
57222
57362
 
57223
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
57363
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
57224
57364
  function registerBuiltins(host, executor) {
57225
57365
  const path9 = new PathEvaluator;
57226
57366
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -57260,7 +57400,7 @@ var init_builtins = __esm(() => {
57260
57400
  init_tsdoc_export_evaluator();
57261
57401
  });
57262
57402
 
57263
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
57403
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
57264
57404
  class RuleEngineHost {
57265
57405
  evaluators;
57266
57406
  formatters;
@@ -57277,7 +57417,7 @@ var init_rule_engine_host = __esm(() => {
57277
57417
  init_extension2();
57278
57418
  });
57279
57419
 
57280
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
57420
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
57281
57421
  class RuleEngine {
57282
57422
  host;
57283
57423
  events;
@@ -57448,7 +57588,7 @@ var init_engine = __esm(() => {
57448
57588
  init_types3();
57449
57589
  });
57450
57590
 
57451
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
57591
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
57452
57592
  async function bundledRulesRoot() {
57453
57593
  if (cachedRoot2 !== undefined)
57454
57594
  return cachedRoot2;
@@ -57499,7 +57639,7 @@ var init_bundled_rules = __esm(() => {
57499
57639
  init_dist5();
57500
57640
  });
57501
57641
 
57502
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
57642
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
57503
57643
  class DbRulePersistenceAdapter {
57504
57644
  db;
57505
57645
  constructor(db2) {
@@ -57533,7 +57673,7 @@ class DbRulePersistenceAdapter {
57533
57673
  }
57534
57674
  }
57535
57675
 
57536
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
57676
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
57537
57677
  var RULE_ENGINE_SCHEMA_SQL = `
57538
57678
  CREATE TABLE IF NOT EXISTS rule_runs (
57539
57679
  id TEXT PRIMARY KEY,
@@ -57579,10 +57719,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
57579
57719
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
57580
57720
  `;
57581
57721
 
57582
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
57722
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
57583
57723
  var init_persistence2 = () => {};
57584
57724
 
57585
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.14+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
57725
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.15+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
57586
57726
  var init_dist10 = __esm(() => {
57587
57727
  init_extensions();
57588
57728
  init_loader2();
@@ -57802,7 +57942,7 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
57802
57942
  ];
57803
57943
  });
57804
57944
 
57805
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
57945
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
57806
57946
  function queueLogger() {
57807
57947
  if (!_queueLogger)
57808
57948
  _queueLogger = getLogger2("job-queue");
@@ -57819,7 +57959,7 @@ class DBJobQueue {
57819
57959
  async enqueue(type, payload, options) {
57820
57960
  const id = await this.dao.enqueue(type, payload, options);
57821
57961
  getQueueJobEnqueuedTotal().add(1, { type });
57822
- await this.events?.emit("queue.job.enqueued", { jobId: id, type });
57962
+ await this.events?.emit("queue.job.enqueued", enqueuedDetail(id, type, options));
57823
57963
  return id;
57824
57964
  }
57825
57965
  async enqueueBatch(jobs) {
@@ -57827,7 +57967,8 @@ class DBJobQueue {
57827
57967
  getQueueJobEnqueuedTotal().add(jobs.length);
57828
57968
  if (this.events) {
57829
57969
  for (const [index2, jobId] of ids.entries()) {
57830
- await this.events.emit("queue.job.enqueued", { jobId, type: jobs[index2]?.type ?? "unknown" });
57970
+ const job = jobs[index2];
57971
+ await this.events.emit("queue.job.enqueued", enqueuedDetail(jobId, job?.type ?? "unknown", job));
57831
57972
  }
57832
57973
  }
57833
57974
  return ids;
@@ -57836,6 +57977,16 @@ class DBJobQueue {
57836
57977
  return this.dao.getStats();
57837
57978
  }
57838
57979
  }
57980
+ function enqueuedDetail(jobId, type, options) {
57981
+ const detail = { jobId, type, enqueuedAt: Date.now() };
57982
+ if (options && options.maxRetries !== undefined)
57983
+ detail.maxRetries = options.maxRetries;
57984
+ if (options && options.delay !== undefined)
57985
+ detail.delayMs = options.delay;
57986
+ if (options && options.ttlMs !== undefined)
57987
+ detail.ttlMs = options.ttlMs;
57988
+ return detail;
57989
+ }
57839
57990
 
57840
57991
  class DBQueueConsumer {
57841
57992
  dao;
@@ -57851,6 +58002,7 @@ class DBQueueConsumer {
57851
58002
  timer = null;
57852
58003
  running = false;
57853
58004
  inFlight = 0;
58005
+ pollPromise = null;
57854
58006
  constructor(dao, config4 = {}) {
57855
58007
  this.dao = dao;
57856
58008
  this.pollInterval = nonNegativeFiniteConfig("pollInterval", config4.pollInterval ?? 1000);
@@ -57870,7 +58022,13 @@ class DBQueueConsumer {
57870
58022
  return;
57871
58023
  this.running = true;
57872
58024
  this.schedule(0);
57873
- await this.events?.emit("queue.consumer.started");
58025
+ await this.events?.emit("queue.consumer.started", {
58026
+ startedAt: Date.now(),
58027
+ pollInterval: this.pollInterval,
58028
+ batchSize: this.batchSize,
58029
+ maxConcurrency: this.maxConcurrency,
58030
+ visibilityTimeout: this.visibilityTimeout
58031
+ });
57874
58032
  }
57875
58033
  async stop() {
57876
58034
  const wasRunning = this.running;
@@ -57880,11 +58038,22 @@ class DBQueueConsumer {
57880
58038
  this.timer = null;
57881
58039
  }
57882
58040
  const deadline = Date.now() + this.drainTimeoutMs;
58041
+ const pending = this.pollPromise;
58042
+ if (pending !== null) {
58043
+ await settleWithin(pending, deadline);
58044
+ }
57883
58045
  while (this.inFlight > 0 && Date.now() < deadline) {
57884
58046
  await sleep(10);
57885
58047
  }
57886
- if (wasRunning)
57887
- await this.events?.emit("queue.consumer.stopped");
58048
+ if (wasRunning) {
58049
+ const detail = {
58050
+ stoppedAt: Date.now(),
58051
+ drainTimeoutMs: this.drainTimeoutMs,
58052
+ inFlightAtStop: this.inFlight,
58053
+ drained: this.inFlight === 0
58054
+ };
58055
+ await this.events?.emit("queue.consumer.stopped", detail);
58056
+ }
57888
58057
  }
57889
58058
  async stats() {
57890
58059
  return this.dao.getStats();
@@ -57913,7 +58082,11 @@ class DBQueueConsumer {
57913
58082
  }
57914
58083
  schedule(delay) {
57915
58084
  this.timer = setTimeout(() => {
57916
- this.poll();
58085
+ const cycle = this.poll().finally(() => {
58086
+ if (this.pollPromise === cycle)
58087
+ this.pollPromise = null;
58088
+ });
58089
+ this.pollPromise = cycle;
57917
58090
  }, delay);
57918
58091
  }
57919
58092
  async poll() {
@@ -57935,7 +58108,7 @@ class DBQueueConsumer {
57935
58108
  try {
57936
58109
  job = toJob(record2);
57937
58110
  } catch (error51) {
57938
- await this.failOrRetry(record2, error51);
58111
+ await this.failOrRetry(record2, error51, 0);
57939
58112
  return;
57940
58113
  }
57941
58114
  return traceAsync("queue.job.process", async () => {
@@ -57946,45 +58119,59 @@ class DBQueueConsumer {
57946
58119
  });
57947
58120
  const handler = this.handlers.get(job.type);
57948
58121
  if (handler === undefined) {
57949
- await this.failOrRetry(job, new Error(`No handler registered for job type "${job.type}"`));
58122
+ await this.failOrRetry(job, new Error(`No handler registered for job type "${job.type}"`), 0);
57950
58123
  return;
57951
58124
  }
57952
58125
  const startMs = performance.now();
57953
58126
  try {
57954
58127
  await handler(job);
57955
58128
  await this.dao.markCompleted(job.id);
58129
+ const durationMs = performance.now() - startMs;
57956
58130
  getQueueJobCompletedTotal().add(1, { type: job.type });
57957
- getQueueJobProcessingDuration().record(performance.now() - startMs, { type: job.type });
57958
- await this.events?.emit("queue.job.completed", { jobId: job.id, type: job.type });
58131
+ getQueueJobProcessingDuration().record(durationMs, { type: job.type });
58132
+ const completed = {
58133
+ jobId: job.id,
58134
+ type: job.type,
58135
+ durationMs: Number.isFinite(durationMs) ? durationMs : 0,
58136
+ attempt: job.attempts
58137
+ };
58138
+ await this.events?.emit("queue.job.completed", completed);
57959
58139
  } catch (error51) {
57960
- getQueueJobProcessingDuration().record(performance.now() - startMs, { type: job.type });
57961
- await this.failOrRetry(job, error51);
58140
+ const durationMs = performance.now() - startMs;
58141
+ getQueueJobProcessingDuration().record(durationMs, { type: job.type });
58142
+ await this.failOrRetry(job, error51, Number.isFinite(durationMs) ? durationMs : 0);
57962
58143
  }
57963
58144
  });
57964
58145
  }
57965
- async failOrRetry(job, error51) {
58146
+ async failOrRetry(job, error51, durationMs) {
57966
58147
  const attempts = job.attempts + 1;
57967
58148
  const message = error51 instanceof Error ? error51.message : String(error51);
57968
58149
  if (attempts >= job.maxRetries) {
57969
58150
  await this.dao.markFailed(job.id, attempts, message);
57970
58151
  getQueueJobFailedTotal().add(1, { type: job.type });
57971
- await this.events?.emit("queue.job.failed", {
58152
+ const failed = {
57972
58153
  jobId: job.id,
57973
58154
  type: job.type,
57974
58155
  error: message,
57975
- attempt: attempts
57976
- });
58156
+ attempt: attempts,
58157
+ maxRetries: job.maxRetries,
58158
+ durationMs
58159
+ };
58160
+ await this.events?.emit("queue.job.failed", failed);
57977
58161
  return;
57978
58162
  }
57979
58163
  const delay = Math.min(this.maxDelay, this.baseDelay * 2 ** Math.max(0, attempts - 1));
57980
58164
  const nextRetryAt = Date.now() + delay;
57981
58165
  await this.dao.markForRetry(job.id, attempts, message, nextRetryAt);
57982
- await this.events?.emit("queue.job.retrying", {
58166
+ const retrying = {
57983
58167
  jobId: job.id,
57984
58168
  type: job.type,
57985
58169
  attempt: attempts,
57986
- nextRetryAt
57987
- });
58170
+ maxRetries: job.maxRetries,
58171
+ nextRetryAt,
58172
+ error: message
58173
+ };
58174
+ await this.events?.emit("queue.job.retrying", retrying);
57988
58175
  }
57989
58176
  }
57990
58177
  function toJob(record2) {
@@ -58003,7 +58190,9 @@ function toJob(record2) {
58003
58190
  };
58004
58191
  }
58005
58192
  function sleep(ms) {
58006
- return new Promise((resolve) => setTimeout(resolve, ms));
58193
+ const { promise: promise2, resolve } = Promise.withResolvers();
58194
+ setTimeout(resolve, ms);
58195
+ return promise2;
58007
58196
  }
58008
58197
  function positiveIntegerConfig(name, value) {
58009
58198
  if (!Number.isInteger(value) || value <= 0) {
@@ -58030,7 +58219,7 @@ var init_db_job_queue = __esm(() => {
58030
58219
  init_tracing2();
58031
58220
  });
58032
58221
 
58033
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
58222
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
58034
58223
  var exports_job_queue_db = {};
58035
58224
  __export(exports_job_queue_db, {
58036
58225
  DBQueueConsumer: () => DBQueueConsumer,
@@ -61685,7 +61874,7 @@ function defaultVerdictRunDir(tasksDir) {
61685
61874
  return join8(dirname8(tasksDir), ".spur", "run");
61686
61875
  }
61687
61876
  function rowMatchesScenario(id, sc) {
61688
- const stripped = id.replace(/^Scenario:\s*/i, "").trim();
61877
+ const stripped = id.replace(/^\[[^\]]*\]\s*/, "").replace(/^Scenario:\s*/i, "").replace(/^\[[^\]]*\]\s*/, "").trim();
61689
61878
  return normalizeTitle(id) === sc.normalized || normalizeTitle(stripped) === sc.normalized || id === sc.alias || stripped === sc.alias;
61690
61879
  }
61691
61880
  var DEFAULT_FEATURE_MATRIX, FeatureCheckService;
@@ -66727,8 +66916,9 @@ var init_task_service = __esm(() => {
66727
66916
  // ../../packages/app/src/services/task-verdict.ts
66728
66917
  function deriveVerdict(answerText, taskCheckPassed) {
66729
66918
  const requirements = extractRequirements(answerText);
66730
- const acceptanceCriteria = applyAcceptanceCriteriaEvidenceRule(extractAcceptanceCriteria(answerText));
66731
- const checks4 = extractChecks(answerText, taskCheckPassed, acceptanceCriteria);
66919
+ const parsedAc = extractAcceptanceCriteria(answerText);
66920
+ const acceptanceCriteria = applyAcceptanceCriteriaEvidenceRule(parsedAc.rows);
66921
+ const checks4 = extractChecks(answerText, taskCheckPassed, acceptanceCriteria, parsedAc.dropped);
66732
66922
  if (requirements.length === 0) {
66733
66923
  return { verdict: "UNKNOWN", requirements, acceptanceCriteria, checks: checks4 };
66734
66924
  }
@@ -66796,6 +66986,7 @@ function normalizeStatus(raw) {
66796
66986
  }
66797
66987
  function extractAcceptanceCriteria(text4) {
66798
66988
  const rows = [];
66989
+ const dropped = [];
66799
66990
  const lines = text4.split(`
66800
66991
  `);
66801
66992
  let inTable = false;
@@ -66817,15 +67008,19 @@ function extractAcceptanceCriteria(text4) {
66817
67008
  continue;
66818
67009
  if (inTable && cells.length >= 4) {
66819
67010
  const id = cells[0] ?? "";
66820
- const status = normalizeAcceptanceCriteriaStatus(cells[1] ?? "");
66821
- const evidenceType = normalizeEvidenceType(cells[2] ?? "");
67011
+ const statusRaw = cells[1] ?? "";
67012
+ const evidenceTypeRaw = cells[2] ?? "";
67013
+ const status = normalizeAcceptanceCriteriaStatus(statusRaw);
67014
+ const evidenceType = normalizeEvidenceType(evidenceTypeRaw);
66822
67015
  const evidence = cells[3] ?? "";
66823
67016
  if (status !== null && evidenceType !== null && id.length > 0) {
66824
67017
  rows.push({ id, status, evidenceType, evidence });
67018
+ } else if (id.length > 0) {
67019
+ dropped.push(evidenceType === null && status !== null ? `${id} (unrecognised evidence type "${evidenceTypeRaw}")` : `${id} (unrecognised status "${statusRaw}")`);
66825
67020
  }
66826
67021
  }
66827
67022
  }
66828
- return rows;
67023
+ return { rows, dropped };
66829
67024
  }
66830
67025
  function normalizeAcceptanceCriteriaStatus(raw) {
66831
67026
  const upper = raw.toUpperCase();
@@ -66845,8 +67040,9 @@ function normalizeEvidenceType(raw) {
66845
67040
  return "test";
66846
67041
  if (normalized === "command")
66847
67042
  return "command";
66848
- if (normalized === "static-ref" || normalized === "static")
67043
+ if (normalized === "static-ref" || normalized === "static" || normalized === "doc" || normalized === "docs" || normalized === "documentation") {
66849
67044
  return "static-ref";
67045
+ }
66850
67046
  if (normalized === "manual-review" || normalized === "manual")
66851
67047
  return "manual-review";
66852
67048
  if (normalized === "llm-judge" || normalized === "judge")
@@ -66869,7 +67065,7 @@ function requiresExecutableEvidence(id) {
66869
67065
  const nonBehavior = normalized.includes("[non-behavior]") || normalized.includes("[docs-only]") || normalized.includes("[doc-only]");
66870
67066
  return !nonCore && !nonBehavior;
66871
67067
  }
66872
- function extractChecks(_text, taskCheckPassed, acceptanceCriteria) {
67068
+ function extractChecks(_text, taskCheckPassed, acceptanceCriteria, droppedAcRows = []) {
66873
67069
  const checks4 = [
66874
67070
  {
66875
67071
  name: "spur task check",
@@ -66901,6 +67097,13 @@ function extractChecks(_text, taskCheckPassed, acceptanceCriteria) {
66901
67097
  }
66902
67098
  }
66903
67099
  }
67100
+ if (droppedAcRows.length > 0) {
67101
+ checks4.push({
67102
+ name: "ac-row-dropped",
67103
+ status: "fail",
67104
+ evidence: `${droppedAcRows.length} AC row(s) could not be parsed and were omitted from the verdict: ` + `${droppedAcRows.join("; ")}. Accepted evidence types: test, command, static-ref (aliases: ` + "static, doc, docs, documentation), manual-review, llm-judge, n/a. Accepted statuses: " + "MET, PARTIAL, UNMET, N/A."
67105
+ });
67106
+ }
66904
67107
  if (acceptanceCriteria.length > 0) {
66905
67108
  const downgraded = acceptanceCriteria.filter((row) => row.status === "PARTIAL" && requiresExecutableEvidence(row.id) && row.evidenceType !== "test" && row.evidenceType !== "command");
66906
67109
  checks4.push({
@@ -69827,19 +70030,19 @@ var {
69827
70030
  init_src();
69828
70031
  init_loader();
69829
70032
 
69830
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application-node.js
70033
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application-node.js
69831
70034
  init_dist4();
69832
70035
  init_dist5();
69833
70036
  import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
69834
70037
  import { dirname as dirname5 } from "path";
69835
70038
 
69836
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application/index.js
70039
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application/index.js
69837
70040
  init_default_observers();
69838
70041
  init_event_bus();
69839
70042
  init_file_observer();
69840
70043
  init_logger3();
69841
70044
 
69842
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
70045
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
69843
70046
  class NoopSchedulerAdapter {
69844
70047
  constructor() {}
69845
70048
  register(_cron, _action) {}
@@ -69847,7 +70050,7 @@ class NoopSchedulerAdapter {
69847
70050
  async stop() {}
69848
70051
  }
69849
70052
 
69850
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
70053
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
69851
70054
  function initScheduler(adapter, cronEntries) {
69852
70055
  const resolved = adapter ?? new NoopSchedulerAdapter;
69853
70056
  if (cronEntries) {
@@ -69858,7 +70061,7 @@ function initScheduler(adapter, cronEntries) {
69858
70061
  return resolved;
69859
70062
  }
69860
70063
 
69861
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
70064
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
69862
70065
  init_logger3();
69863
70066
  init_metrics();
69864
70067
  init_sdk();
@@ -69951,7 +70154,7 @@ function dbPlugin(db2) {
69951
70154
  };
69952
70155
  }
69953
70156
 
69954
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
70157
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
69955
70158
  init_logger3();
69956
70159
 
69957
70160
  class PluginHost {
@@ -70039,7 +70242,7 @@ class PluginHost {
70039
70242
  }
70040
70243
  }
70041
70244
 
70042
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application/index.js
70245
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application/index.js
70043
70246
  async function performShutdown(state, reason) {
70044
70247
  if (state.stopped)
70045
70248
  return;
@@ -70150,10 +70353,10 @@ async function runApplication(options) {
70150
70353
  }
70151
70354
  }
70152
70355
 
70153
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application-node.js
70356
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application-node.js
70154
70357
  init_scheduler_node();
70155
70358
 
70156
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
70359
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
70157
70360
  var import_api14 = __toESM(require_src(), 1);
70158
70361
 
70159
70362
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -73169,7 +73372,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
73169
73372
  }), JsonTraceSerializer));
73170
73373
  }
73171
73374
  }
73172
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
73375
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
73173
73376
  var import_resources2 = __toESM(require_src4(), 1);
73174
73377
  var import_sdk_trace_node = __toESM(require_src8(), 1);
73175
73378
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -73220,7 +73423,7 @@ async function shutdownNodeTelemetry() {
73220
73423
  await Promise.all(pending);
73221
73424
  }
73222
73425
 
73223
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.14+a32276a722fab3c8/node_modules/@gobing-ai/ts-infra/dist/application-node.js
73426
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.15+60cc1f0410bb6d88/node_modules/@gobing-ai/ts-infra/dist/application-node.js
73224
73427
  class ConfigValidationError extends Error {
73225
73428
  constructor(message) {
73226
73429
  super(message);
@@ -73309,11 +73512,13 @@ async function runNodeApplication(options) {
73309
73512
  const logFilePath = yamlBootstrap.logging?.filePath;
73310
73513
  const loggingConfig = typeof logFilePath === "string" ? { ...loggingOpts, fileSink: createFileSink(logFilePath) } : loggingOpts;
73311
73514
  const schedulerConfig = {};
73312
- const rawSched = { ...schedulerOpts };
73313
- if (rawSched.enabled === true) {
73515
+ if (schedulerOpts.enabled === true) {
73314
73516
  schedulerConfig.enabled = true;
73315
73517
  schedulerConfig.autoStart = schedulerOpts.autoStart;
73316
- schedulerConfig.adapter = new NodeSchedulerAdapter;
73518
+ schedulerConfig.adapter = schedulerOpts.adapter ?? new NodeSchedulerAdapter;
73519
+ if (schedulerOpts.entries) {
73520
+ schedulerConfig.entries = schedulerOpts.entries;
73521
+ }
73317
73522
  }
73318
73523
  const plugins = [];
73319
73524
  let dbAdapter = options.services?.db;
@@ -77807,7 +78012,7 @@ import { join as join18, resolve as resolve6 } from "path";
77807
78012
  var CLI_CONFIG = {
77808
78013
  binaryName: "spur",
77809
78014
  binaryLabel: "spur",
77810
- binaryVersion: "0.3.27",
78015
+ binaryVersion: "0.3.28",
77811
78016
  configDir: ".spur",
77812
78017
  configFile: ".spur/config.yaml",
77813
78018
  databaseFile: ".spur/spur.db"