@gobing-ai/spur 0.3.42 → 0.3.43

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.24/node_modules/@gobing-ai/ts-utils/dist/errors.js
50
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/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.24/node_modules/@gobing-ai/ts-utils/dist/api-response.js
61
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/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,10 +81,10 @@ 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.24/node_modules/@gobing-ai/ts-utils/dist/cursor.js
84
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/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.24/node_modules/@gobing-ai/ts-utils/dist/object.js
87
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/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
  }
@@ -102,7 +102,7 @@ function deepMerge(target, source) {
102
102
  return result;
103
103
  }
104
104
 
105
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.24/node_modules/@gobing-ai/ts-utils/dist/output.js
105
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/node_modules/@gobing-ai/ts-utils/dist/output.js
106
106
  function processStream(name) {
107
107
  const proc = globalThis.process;
108
108
  const stream = proc?.[name];
@@ -123,7 +123,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
123
123
  }
124
124
  var defaultStdoutTarget, defaultStderrTarget;
125
125
 
126
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.24/node_modules/@gobing-ai/ts-utils/dist/index.js
126
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.27/node_modules/@gobing-ai/ts-utils/dist/index.js
127
127
  var init_dist = __esm(() => {
128
128
  init_api_response();
129
129
  init_cursor();
@@ -21745,7 +21745,7 @@ var init_zod = __esm(() => {
21745
21745
  init_external();
21746
21746
  });
21747
21747
 
21748
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/config.js
21748
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/config.js
21749
21749
  function getProcessEnv() {
21750
21750
  return process.env;
21751
21751
  }
@@ -21823,7 +21823,7 @@ var init_config = __esm(() => {
21823
21823
  };
21824
21824
  });
21825
21825
 
21826
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21826
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21827
21827
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
21828
21828
  import { dirname, resolve as resolvePath } from "path";
21829
21829
  function createNodeFileSystem(root, paths) {
@@ -21910,7 +21910,7 @@ function findProjectRoot(startDir) {
21910
21910
  }
21911
21911
  var init_file_system_node = () => {};
21912
21912
 
21913
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21913
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21914
21914
  var DbModuleNotInstalledError;
21915
21915
  var init_db_errors = __esm(() => {
21916
21916
  DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
@@ -29121,7 +29121,7 @@ var init_execa = __esm(() => {
29121
29121
  } = getIpcExport());
29122
29122
  });
29123
29123
 
29124
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29124
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29125
29125
  import { isatty } from "tty";
29126
29126
 
29127
29127
  class NodeProcessExecutor {
@@ -29460,7 +29460,7 @@ var init_process_executor = __esm(() => {
29460
29460
  init_execa();
29461
29461
  });
29462
29462
 
29463
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29463
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29464
29464
  function getNodeFileSystem() {
29465
29465
  if (!_nodeFileSystem)
29466
29466
  _nodeFileSystem = createNodeFileSystem();
@@ -29520,7 +29520,7 @@ var init_runtime_node_bun = __esm(() => {
29520
29520
  };
29521
29521
  });
29522
29522
 
29523
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/context.js
29523
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/context.js
29524
29524
  class RuntimeContext {
29525
29525
  scope;
29526
29526
  runtimeName;
@@ -29590,7 +29590,7 @@ var init_context = __esm(() => {
29590
29590
  init_runtime_node_bun();
29591
29591
  });
29592
29592
 
29593
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/path.js
29593
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/path.js
29594
29594
  function normalizeSeparators(path6) {
29595
29595
  return path6.replaceAll("\\", "/");
29596
29596
  }
@@ -29651,17 +29651,17 @@ var init_path = __esm(() => {
29651
29651
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
29652
29652
  });
29653
29653
 
29654
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29654
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29655
29655
  var REMOTE_SCHEMA_MAX_BYTES;
29656
29656
  var init_schema_validation = __esm(() => {
29657
29657
  init_dist2();
29658
29658
  REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
29659
29659
  });
29660
29660
 
29661
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/types.js
29661
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/types.js
29662
29662
  var init_types = () => {};
29663
29663
 
29664
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/index.js
29664
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/index.js
29665
29665
  var init_dist3 = __esm(() => {
29666
29666
  init_config();
29667
29667
  init_context();
@@ -29670,7 +29670,7 @@ var init_dist3 = __esm(() => {
29670
29670
  init_types();
29671
29671
  });
29672
29672
 
29673
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+9ac10ce9c9bdeb65/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29673
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+9a36123834b81a08/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29674
29674
  import { Database } from "bun:sqlite";
29675
29675
  var init_bun_sqlite = () => {};
29676
29676
 
@@ -33862,7 +33862,7 @@ var init_bun_sqlite2 = __esm(() => {
33862
33862
  init_session2();
33863
33863
  });
33864
33864
 
33865
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33865
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33866
33866
  var inboxMessages;
33867
33867
  var init_inbox_messages = __esm(() => {
33868
33868
  init_sqlite_core();
@@ -33881,7 +33881,7 @@ var init_inbox_messages = __esm(() => {
33881
33881
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
33882
33882
  });
33883
33883
 
33884
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33884
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33885
33885
  function nowTimestamp() {
33886
33886
  return Date.now();
33887
33887
  }
@@ -33910,7 +33910,7 @@ var init_common3 = __esm(() => {
33910
33910
  appendOnlyColumns = buildAppendOnlyColumns();
33911
33911
  });
33912
33912
 
33913
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33913
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33914
33914
  var queueJobs;
33915
33915
  var init_queue_jobs = __esm(() => {
33916
33916
  init_sqlite_core();
@@ -33930,7 +33930,7 @@ var init_queue_jobs = __esm(() => {
33930
33930
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
33931
33931
  });
33932
33932
 
33933
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33933
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33934
33934
  var exports_runtime = {};
33935
33935
  __export(exports_runtime, {
33936
33936
  queueJobs: () => queueJobs,
@@ -33941,7 +33941,7 @@ var init_runtime = __esm(() => {
33941
33941
  init_queue_jobs();
33942
33942
  });
33943
33943
 
33944
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33944
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33945
33945
  var exports_bun_sqlite = {};
33946
33946
  __export(exports_bun_sqlite, {
33947
33947
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -34232,7 +34232,7 @@ var init_d1 = __esm(() => {
34232
34232
  init_session3();
34233
34233
  });
34234
34234
 
34235
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34235
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34236
34236
  var exports_d1 = {};
34237
34237
  __export(exports_d1, {
34238
34238
  D1Adapter: () => D1Adapter
@@ -34296,7 +34296,7 @@ var init_d12 = __esm(() => {
34296
34296
  init_runtime();
34297
34297
  });
34298
34298
 
34299
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/adapter.js
34299
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/adapter.js
34300
34300
  async function createDbAdapter(config3) {
34301
34301
  switch (config3.driver) {
34302
34302
  case "bun-sqlite": {
@@ -34336,7 +34336,7 @@ var init_drizzle_orm = __esm(() => {
34336
34336
  init_view_common();
34337
34337
  });
34338
34338
 
34339
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34339
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34340
34340
  function compilePredicate(predicate) {
34341
34341
  if ("and" in predicate) {
34342
34342
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -34374,7 +34374,7 @@ var init_query_spec = __esm(() => {
34374
34374
  };
34375
34375
  });
34376
34376
 
34377
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34377
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34378
34378
  function asSelectQuery(query) {
34379
34379
  return query;
34380
34380
  }
@@ -34416,7 +34416,7 @@ var init_base_dao = __esm(() => {
34416
34416
  init_query_spec();
34417
34417
  });
34418
34418
 
34419
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34419
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34420
34420
  var embeddedMigrations;
34421
34421
  var init_embedded_migrations = __esm(() => {
34422
34422
  embeddedMigrations = [
@@ -34448,7 +34448,7 @@ var init_embedded_migrations = __esm(() => {
34448
34448
  ];
34449
34449
  });
34450
34450
 
34451
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34451
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34452
34452
  var EntityDao;
34453
34453
  var init_entity_dao = __esm(() => {
34454
34454
  init_drizzle_orm();
@@ -34610,7 +34610,7 @@ var init_entity_dao = __esm(() => {
34610
34610
  };
34611
34611
  });
34612
34612
 
34613
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34613
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34614
34614
  function isPromiseLike(value) {
34615
34615
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
34616
34616
  }
@@ -34783,7 +34783,7 @@ var init_migrator2 = __esm(() => {
34783
34783
  init_migrator();
34784
34784
  });
34785
34785
 
34786
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/migrate.js
34786
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/migrate.js
34787
34787
  async function ensureJournalTable(adapter, table3) {
34788
34788
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
34789
34789
  }
@@ -34858,7 +34858,7 @@ var init_migrate = __esm(() => {
34858
34858
  init_embedded_migrations();
34859
34859
  });
34860
34860
 
34861
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34861
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34862
34862
  var QueueJobDao;
34863
34863
  var init_queue_job_dao = __esm(() => {
34864
34864
  init_drizzle_orm();
@@ -34999,7 +34999,7 @@ var init_queue_job_dao = __esm(() => {
34999
34999
  };
35000
35000
  });
35001
35001
 
35002
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/index.js
35002
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/index.js
35003
35003
  var exports_dist = {};
35004
35004
  __export(exports_dist, {
35005
35005
  embeddedMigrations: () => embeddedMigrations,
@@ -37487,7 +37487,7 @@ var init_src = __esm(() => {
37487
37487
  });
37488
37488
  });
37489
37489
 
37490
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/config.js
37490
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/config.js
37491
37491
  function parseYamlObject(text3) {
37492
37492
  let parsed;
37493
37493
  try {
@@ -37614,7 +37614,7 @@ var init_config2 = __esm(() => {
37614
37614
  };
37615
37615
  });
37616
37616
 
37617
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37617
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37618
37618
  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";
37619
37619
  import { dirname as dirname2, resolve as resolvePath3 } from "path";
37620
37620
  function createNodeFileSystem3(root, paths) {
@@ -37701,7 +37701,7 @@ function findProjectRoot3(startDir) {
37701
37701
  }
37702
37702
  var init_file_system_node2 = () => {};
37703
37703
 
37704
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37704
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37705
37705
  var D1NotConfiguredError2, DbModuleNotInstalledError3;
37706
37706
  var init_db_errors2 = __esm(() => {
37707
37707
  D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
@@ -37718,7 +37718,7 @@ var init_db_errors2 = __esm(() => {
37718
37718
  };
37719
37719
  });
37720
37720
 
37721
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37721
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37722
37722
  function createCfFileSystem2() {
37723
37723
  return {
37724
37724
  getProjectRoot: () => "/bundle",
@@ -37757,7 +37757,7 @@ function createCfFileSystem2() {
37757
37757
  }
37758
37758
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
37759
37759
 
37760
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37760
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37761
37761
  var exports_runtime_cf = {};
37762
37762
  __export(exports_runtime_cf, {
37763
37763
  cloudflareWorkersFactory: () => cloudflareWorkersFactory2
@@ -37795,7 +37795,7 @@ var init_runtime_cf = __esm(() => {
37795
37795
  };
37796
37796
  });
37797
37797
 
37798
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37798
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37799
37799
  import { isatty as isatty2 } from "tty";
37800
37800
 
37801
37801
  class NodeProcessExecutor3 {
@@ -38181,7 +38181,7 @@ var init_process_executor2 = __esm(() => {
38181
38181
  ProcessExecutor2 = NodeProcessExecutor3;
38182
38182
  });
38183
38183
 
38184
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38184
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38185
38185
  var exports_runtime_node_bun = {};
38186
38186
  __export(exports_runtime_node_bun, {
38187
38187
  nodeBunFactory: () => nodeBunFactory3,
@@ -38249,7 +38249,7 @@ var init_runtime_node_bun2 = __esm(() => {
38249
38249
  };
38250
38250
  });
38251
38251
 
38252
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38252
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38253
38253
  function isCloudflareWorkerRuntime2() {
38254
38254
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
38255
38255
  }
@@ -38279,7 +38279,7 @@ function _resetRuntimeFactory2() {
38279
38279
  }
38280
38280
  var _factory, _runtimeName;
38281
38281
 
38282
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/context.js
38282
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/context.js
38283
38283
  class RuntimeContext2 {
38284
38284
  scope;
38285
38285
  runtimeName;
@@ -38369,7 +38369,7 @@ var init_context2 = __esm(() => {
38369
38369
  init_runtime_node_bun2();
38370
38370
  });
38371
38371
 
38372
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/path.js
38372
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/path.js
38373
38373
  function normalizeSeparators2(path7) {
38374
38374
  return path7.replaceAll("\\", "/");
38375
38375
  }
@@ -38492,7 +38492,7 @@ var init_path2 = __esm(() => {
38492
38492
  SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
38493
38493
  });
38494
38494
 
38495
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38495
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38496
38496
  async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
38497
38497
  await fs2.ensureDir(dirnamePath(path7));
38498
38498
  }
@@ -38543,7 +38543,7 @@ var init_fs = __esm(() => {
38543
38543
  init_path2();
38544
38544
  });
38545
38545
 
38546
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38546
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38547
38547
  function allocateId() {
38548
38548
  nextIdSeq += 1;
38549
38549
  return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
@@ -38667,7 +38667,7 @@ function createInMemoryProcessRegistry2(options) {
38667
38667
  }
38668
38668
  var nextIdSeq = 0;
38669
38669
 
38670
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
38670
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
38671
38671
  function ambientRuntimePaths2() {
38672
38672
  const cwd = getProcessCwd2();
38673
38673
  return { cwd, home: getHomeDir() ?? cwd };
@@ -38677,7 +38677,7 @@ var init_runtime_paths = __esm(() => {
38677
38677
  init_path2();
38678
38678
  });
38679
38679
 
38680
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38680
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38681
38681
  async function loadStructuredConfig(path7, options = {}) {
38682
38682
  const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
38683
38683
  return await parseStructuredConfig(content, path7, options);
@@ -38954,10 +38954,10 @@ var init_schema_validation2 = __esm(() => {
38954
38954
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
38955
38955
  });
38956
38956
 
38957
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/types.js
38957
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/types.js
38958
38958
  var init_types2 = () => {};
38959
38959
 
38960
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/index.js
38960
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/index.js
38961
38961
  var exports_dist2 = {};
38962
38962
  __export(exports_dist2, {
38963
38963
  writeJsonFile: () => writeJsonFile2,
@@ -41108,7 +41108,7 @@ var init_mod = __esm(() => {
41108
41108
  init_config3();
41109
41109
  });
41110
41110
 
41111
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/logger.js
41111
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/logger.js
41112
41112
  function toLogTapeLevel(level) {
41113
41113
  return level === "warn" ? "warning" : level;
41114
41114
  }
@@ -42661,7 +42661,7 @@ var require_src = __commonJS((exports) => {
42661
42661
  };
42662
42662
  });
42663
42663
 
42664
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42664
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42665
42665
  function getTelemetryConfig(configPartial = {}) {
42666
42666
  return {
42667
42667
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -42697,7 +42697,7 @@ var init_sdk = __esm(() => {
42697
42697
  resolvedConfig = getTelemetryConfig();
42698
42698
  });
42699
42699
 
42700
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42700
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42701
42701
  function isSuppressed(tracer2) {
42702
42702
  return tracer2 === undefined && !getResolvedConfig().enabled;
42703
42703
  }
@@ -42737,7 +42737,7 @@ var init_tracing2 = __esm(() => {
42737
42737
  import_api2 = __toESM(require_src(), 1);
42738
42738
  });
42739
42739
 
42740
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42740
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42741
42741
  function getMeter() {
42742
42742
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
42743
42743
  }
@@ -42834,7 +42834,7 @@ var init_metrics = __esm(() => {
42834
42834
  instruments = {};
42835
42835
  });
42836
42836
 
42837
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42837
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42838
42838
  function busLogger() {
42839
42839
  if (!_busLogger)
42840
42840
  _busLogger = getLogger2("event-bus");
@@ -43079,7 +43079,7 @@ var init_event_bus = __esm(() => {
43079
43079
  init_metrics();
43080
43080
  });
43081
43081
 
43082
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43082
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43083
43083
  function obsLogger() {
43084
43084
  if (!_obsLogger)
43085
43085
  _obsLogger = getLogger2("event-bus.observers");
@@ -43143,7 +43143,7 @@ var init_default_observers = __esm(() => {
43143
43143
  init_event_bus();
43144
43144
  });
43145
43145
 
43146
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43146
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43147
43147
  function parentDir(filePath) {
43148
43148
  const idx = filePath.lastIndexOf("/");
43149
43149
  return idx <= 0 ? "." : filePath.slice(0, idx);
@@ -43241,7 +43241,7 @@ var init_file_observer = __esm(() => {
43241
43241
  init_logger3();
43242
43242
  });
43243
43243
 
43244
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
43244
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
43245
43245
  function settleWithin(promise2, deadline) {
43246
43246
  const remaining = deadline - Date.now();
43247
43247
  if (remaining <= 0)
@@ -43256,7 +43256,7 @@ function settleWithin(promise2, deadline) {
43256
43256
  return settled;
43257
43257
  }
43258
43258
 
43259
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43259
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43260
43260
  function parseInterval(cron) {
43261
43261
  const trimmed = cron.trim();
43262
43262
  const num = Number(trimmed);
@@ -43349,7 +43349,7 @@ var init_node3 = __esm(() => {
43349
43349
  init_metrics();
43350
43350
  });
43351
43351
 
43352
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43352
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43353
43353
  var exports_scheduler_node = {};
43354
43354
  __export(exports_scheduler_node, {
43355
43355
  NodeSchedulerAdapter: () => NodeSchedulerAdapter
@@ -50354,7 +50354,9 @@ async function messageRollup(db2, sel) {
50354
50354
  SUM(m.cache_read_tokens) AS cacheReadTokens,
50355
50355
  SUM(m.cache_write_tokens) AS cacheWriteTokens,
50356
50356
  SUM(m.cost_usd) AS costUsd,
50357
- SUM(CASE WHEN m.input_tokens IS NOT NULL OR m.output_tokens IS NOT NULL THEN 1 ELSE 0 END) AS recordsWithUsage
50357
+ SUM(CASE WHEN m.input_tokens IS NOT NULL OR m.output_tokens IS NOT NULL THEN 1 ELSE 0 END) AS recordsWithUsage,
50358
+ SUM(CASE WHEN m.role = 'assistant' THEN m.duration_ms END) AS assistantDurationMs,
50359
+ SUM(CASE WHEN m.role = 'assistant' THEN m.duration_ms IS NULL END) AS assistantDurationUnmeasured
50358
50360
  FROM history_message m
50359
50361
  ${where}
50360
50362
  GROUP BY m.source, m.model, DATE(m.ts)`, ...params);
@@ -50393,7 +50395,9 @@ async function bySession(db2, sel, top) {
50393
50395
  MIN(m.ts) AS startedAt,
50394
50396
  COUNT(*) AS messages,
50395
50397
  SUM(m.input_tokens + m.output_tokens) AS tokens,
50396
- SUM(m.cost_usd) AS costUsd
50398
+ SUM(m.cost_usd) AS costUsd,
50399
+ SUM(CASE WHEN m.role = 'assistant' THEN m.duration_ms END) AS assistantDurationMs,
50400
+ SUM(CASE WHEN m.role = 'assistant' THEN m.duration_ms IS NULL END) AS assistantDurationUnmeasured
50397
50401
  FROM history_message m
50398
50402
  ${where}
50399
50403
  GROUP BY m.session_id, m.source
@@ -50441,7 +50445,9 @@ async function bySession(db2, sel, top) {
50441
50445
  toolCalls,
50442
50446
  topTool,
50443
50447
  tokens: msg.tokens,
50444
- costUsd: msg.costUsd
50448
+ costUsd: msg.costUsd,
50449
+ assistantDurationMs: msg.assistantDurationMs,
50450
+ assistantDurationUnmeasured: msg.assistantDurationUnmeasured
50445
50451
  };
50446
50452
  });
50447
50453
  }
@@ -51782,7 +51788,7 @@ var init_drizzle_zod = __esm(() => {
51782
51788
  };
51783
51789
  });
51784
51790
 
51785
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
51791
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
51786
51792
  function sqlExpressionToText(value) {
51787
51793
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
51788
51794
  return;
@@ -51805,7 +51811,7 @@ function getDrizzleTableName(table3) {
51805
51811
  return String(table3[nameSym]);
51806
51812
  }
51807
51813
 
51808
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
51814
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
51809
51815
  function quoteIdent(name) {
51810
51816
  return `"${name.replace(/"/g, '""')}"`;
51811
51817
  }
@@ -51899,7 +51905,7 @@ var init_ddl = __esm(() => {
51899
51905
  init_sqlite_core();
51900
51906
  });
51901
51907
 
51902
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51908
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51903
51909
  function defineTable(name, columns2) {
51904
51910
  const table3 = sqliteTable(name, columns2);
51905
51911
  let insert2;
@@ -51933,7 +51939,7 @@ var init_define_table = __esm(() => {
51933
51939
  init_ddl();
51934
51940
  });
51935
51941
 
51936
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.24+cdac192cf152c5ea/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51942
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.27+d178e82c03238f76/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51937
51943
  var init_schema = __esm(() => {
51938
51944
  init_sqlite_core();
51939
51945
  init_define_table();
@@ -52558,7 +52564,7 @@ var init_dao = __esm(() => {
52558
52564
  init_workspace_dao();
52559
52565
  });
52560
52566
 
52561
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
52567
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
52562
52568
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
52563
52569
  var init_errors6 = __esm(() => {
52564
52570
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -52593,12 +52599,12 @@ var init_errors6 = __esm(() => {
52593
52599
  };
52594
52600
  });
52595
52601
 
52596
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
52602
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
52597
52603
  var init_event_bus2 = __esm(() => {
52598
52604
  init_event_bus();
52599
52605
  });
52600
52606
 
52601
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/api-client.js
52607
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/api-client.js
52602
52608
  function sanitizeUrlForObservability(url2) {
52603
52609
  try {
52604
52610
  const parsed = new URL(url2);
@@ -52828,12 +52834,12 @@ var init_api_client = __esm(() => {
52828
52834
  };
52829
52835
  });
52830
52836
 
52831
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
52837
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
52832
52838
  var init_telemetry = __esm(() => {
52833
52839
  init_tracing2();
52834
52840
  });
52835
52841
 
52836
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/index.js
52842
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/index.js
52837
52843
  var init_dist6 = __esm(() => {
52838
52844
  init_api_client();
52839
52845
  init_event_bus2();
@@ -52841,7 +52847,7 @@ var init_dist6 = __esm(() => {
52841
52847
  init_telemetry();
52842
52848
  });
52843
52849
 
52844
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
52850
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
52845
52851
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
52846
52852
  return {
52847
52853
  workflow: workflowName,
@@ -53100,7 +53106,7 @@ var init_run_lifecycle = __esm(() => {
53100
53106
  ];
53101
53107
  });
53102
53108
 
53103
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
53109
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
53104
53110
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
53105
53111
  var init_schema2 = __esm(() => {
53106
53112
  init_zod();
@@ -53185,7 +53191,7 @@ var init_schema2 = __esm(() => {
53185
53191
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
53186
53192
  });
53187
53193
 
53188
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
53194
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
53189
53195
  async function loadWorkflowDef(path9, options = {}) {
53190
53196
  return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
53191
53197
  }
@@ -53352,7 +53358,7 @@ var init_config4 = __esm(() => {
53352
53358
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
53353
53359
  });
53354
53360
 
53355
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
53361
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
53356
53362
  class CapabilityRegistry {
53357
53363
  kind;
53358
53364
  capabilities = new Map;
@@ -53383,7 +53389,7 @@ class CapabilityRegistry {
53383
53389
  }
53384
53390
  }
53385
53391
 
53386
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
53392
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
53387
53393
  function assertRelativeExtensionPath(path9, options = {}) {
53388
53394
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
53389
53395
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
@@ -53394,20 +53400,20 @@ function assertRelativeExtensionPath(path9, options = {}) {
53394
53400
  }
53395
53401
  }
53396
53402
 
53397
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
53403
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
53398
53404
  var init_extension_loader = () => {};
53399
53405
 
53400
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
53406
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
53401
53407
  var init_extension = __esm(() => {
53402
53408
  init_extension_loader();
53403
53409
  });
53404
53410
 
53405
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.24+0e570c46d7f56d30/node_modules/@gobing-ai/ts-runtime/dist/extension.js
53411
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.27+f7e0689639f664f9/node_modules/@gobing-ai/ts-runtime/dist/extension.js
53406
53412
  var init_extension2 = __esm(() => {
53407
53413
  init_extension();
53408
53414
  });
53409
53415
 
53410
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
53416
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
53411
53417
  class WorkflowEngineHost {
53412
53418
  lifecycleBus;
53413
53419
  actions = new CapabilityRegistry("workflow action");
@@ -53576,7 +53582,7 @@ var init_host = __esm(() => {
53576
53582
  init_errors6();
53577
53583
  });
53578
53584
 
53579
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
53585
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
53580
53586
  var WORKFLOW_ENGINE_SCHEMA_SQL;
53581
53587
  var init_schema_sql = __esm(() => {
53582
53588
  WORKFLOW_ENGINE_SCHEMA_SQL = `
@@ -53649,7 +53655,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
53649
53655
  `.trim();
53650
53656
  });
53651
53657
 
53652
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
53658
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
53653
53659
  async function applyWorkflowEngineSchema(db2) {
53654
53660
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
53655
53661
  const sql4 = statement.trim();
@@ -53938,7 +53944,7 @@ var init_persistence = __esm(() => {
53938
53944
  init_schema_sql();
53939
53945
  });
53940
53946
 
53941
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53947
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53942
53948
  function mergeVars(workflowVars = {}, overrideVars = {}) {
53943
53949
  return { ...workflowVars, ...overrideVars };
53944
53950
  }
@@ -53998,7 +54004,7 @@ var init_variables = __esm(() => {
53998
54004
  TEMPLATE_REF = /\$\{([^}]+)\}/g;
53999
54005
  });
54000
54006
 
54001
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
54007
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
54002
54008
  async function runActionStep(action, vars, deps) {
54003
54009
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
54004
54010
  const resolved = resolveTemplates(action.options ?? {}, {
@@ -54056,7 +54062,7 @@ var init_action_step = __esm(() => {
54056
54062
  init_variables();
54057
54063
  });
54058
54064
 
54059
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
54065
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
54060
54066
  class StateMachineDriver {
54061
54067
  options;
54062
54068
  constructor(options) {
@@ -54192,7 +54198,7 @@ var init_state_machine = __esm(() => {
54192
54198
  EMPTY_OUTCOME = { outcome: "completed", result: undefined };
54193
54199
  });
54194
54200
 
54195
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
54201
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
54196
54202
  class TransitionFlowDriver {
54197
54203
  options;
54198
54204
  constructor(options) {
@@ -54311,7 +54317,7 @@ var init_transition_flow = __esm(() => {
54311
54317
  init_variables();
54312
54318
  });
54313
54319
 
54314
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
54320
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
54315
54321
  class WorkflowService {
54316
54322
  host;
54317
54323
  persistence;
@@ -54528,7 +54534,7 @@ var init_service = __esm(() => {
54528
54534
  init_variables();
54529
54535
  });
54530
54536
 
54531
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
54537
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
54532
54538
  var init_dist7 = __esm(() => {
54533
54539
  init_config4();
54534
54540
  init_host();
@@ -54537,7 +54543,7 @@ var init_dist7 = __esm(() => {
54537
54543
  init_service();
54538
54544
  });
54539
54545
 
54540
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54546
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54541
54547
  import { createHash as createHash2 } from "crypto";
54542
54548
  function stableJson(value) {
54543
54549
  if (Array.isArray(value)) {
@@ -54554,7 +54560,7 @@ function sha256(value) {
54554
54560
  }
54555
54561
  var init_hash = () => {};
54556
54562
 
54557
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54563
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54558
54564
  var HistoryImportError;
54559
54565
  var init_errors7 = __esm(() => {
54560
54566
  HistoryImportError = class HistoryImportError extends Error {
@@ -54567,7 +54573,7 @@ var init_errors7 = __esm(() => {
54567
54573
  };
54568
54574
  });
54569
54575
 
54570
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54576
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54571
54577
  var HISTORY_IMPORT_SCHEMA_SQL;
54572
54578
  var init_schema_sql2 = __esm(() => {
54573
54579
  HISTORY_IMPORT_SCHEMA_SQL = `
@@ -54711,7 +54717,7 @@ CREATE INDEX IF NOT EXISTS idx_history_tool_call_message_hash
54711
54717
  `.trim();
54712
54718
  });
54713
54719
 
54714
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
54720
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
54715
54721
  function identityFieldMap(keys) {
54716
54722
  const map2 = {};
54717
54723
  for (const key of keys) {
@@ -54912,39 +54918,41 @@ function piSplit(raw) {
54912
54918
  }
54913
54919
  return entries;
54914
54920
  }
54915
- function ompSplit(raw) {
54921
+ function ompSplit(raw, context4) {
54922
+ const msg = raw.message;
54916
54923
  const recordType = String(raw.type ?? "");
54917
- if (recordType === "title" || recordType === "title_change" || recordType === "service_tier_change" || recordType === "ttsr_injection" || recordType === "session_init" || recordType === "compaction") {
54924
+ const sessionId = sessionIdFromContext(context4, raw);
54925
+ const seq = context4?.sourceLine ?? (typeof raw.seq === "number" ? raw.seq : 0);
54926
+ const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
54927
+ if (recordType === "title" || recordType === "title_change" || recordType === "service_tier_change" || recordType === "ttsr_injection" || recordType === "session_init" || recordType === "session" || recordType === "model_change" || recordType === "thinking_level_change" || recordType === "compaction" || recordType === "custom" || recordType === "custom_message" || recordType.startsWith("custom.")) {
54918
54928
  return [
54919
54929
  {
54920
54930
  targetTable: "history_message",
54921
54931
  record: {
54922
- session_id: s(raw.id, o2(raw.session).id) ?? "unknown",
54923
- seq: typeof raw.seq === "number" ? raw.seq : 0,
54932
+ session_id: sessionId,
54933
+ seq,
54924
54934
  role: "meta",
54925
54935
  record_type: recordType,
54926
54936
  disposition: "meta",
54927
- ts: s(raw.ts, raw.timestamp) ?? new Date(0).toISOString(),
54937
+ ts,
54928
54938
  provenance: "ambient"
54929
54939
  }
54930
54940
  }
54931
54941
  ];
54932
54942
  }
54933
54943
  const entries = [];
54934
- const sessionId = s(raw.id, o2(raw.session).id) ?? "unknown";
54935
- const seq = typeof raw.seq === "number" ? raw.seq : 0;
54936
- const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
54937
- const role = mapRole(raw.type ?? raw.role);
54938
- const model = s(raw.model, o2(raw.message).model);
54944
+ const role = mapRole(msg?.role ?? raw.type ?? raw.role);
54945
+ const model = s(raw.model, o2(msg).model);
54939
54946
  const cwd = s(raw.cwd, raw.dir);
54940
- const msg = raw.message;
54941
- const usage = msg?.usage;
54947
+ const usage = msg?.usage ?? raw.usage;
54942
54948
  const inputTokens = usage?.input ?? usage?.input_tokens ?? undefined;
54943
54949
  const outputTokens = usage?.output ?? usage?.output_tokens ?? undefined;
54944
54950
  const cacheRead = usage?.cacheRead ?? usage?.cache_read_tokens ?? undefined;
54945
54951
  const cacheWrite = usage?.cacheWrite ?? usage?.cache_write_tokens ?? undefined;
54946
54952
  const costObj = msg?.cost ?? raw.cost;
54947
54953
  const costUsd = typeof costObj?.total === "number" ? costObj.total : computeCost(inputTokens, outputTokens, model);
54954
+ const contentBlocks = msg?.content ?? raw.content;
54955
+ const durationMs = typeof msg?.duration === "number" && Number.isFinite(msg.duration) ? msg.duration : undefined;
54948
54956
  const messageSplitIndex = entries.length;
54949
54957
  entries.push({
54950
54958
  targetTable: "history_message",
@@ -54955,43 +54963,53 @@ function ompSplit(raw) {
54955
54963
  record_type: recordType,
54956
54964
  disposition: "keep",
54957
54965
  ts,
54958
- duration_ms: undefined,
54966
+ duration_ms: durationMs,
54959
54967
  model: model ?? null,
54960
54968
  input_tokens: inputTokens ?? null,
54961
54969
  output_tokens: outputTokens ?? null,
54962
54970
  cache_read_tokens: cacheRead ?? null,
54963
54971
  cache_write_tokens: cacheWrite ?? null,
54964
54972
  cost_usd: costUsd ?? null,
54965
- content_text: s(raw.content, raw.text, msg?.content) ?? null,
54973
+ content_text: extractContentText(contentBlocks) ?? s(raw.content, raw.text, msg?.content) ?? null,
54966
54974
  cwd: cwd ?? null,
54967
54975
  provenance: detectProvenance(cwd)
54968
54976
  }
54969
54977
  });
54970
- if (Array.isArray(raw.content) && role === "assistant") {
54971
- for (const block of raw.content) {
54972
- if (block?.toolCall) {
54973
- const tc = block.toolCall;
54974
- entries.push({
54975
- targetTable: "history_tool_call",
54976
- record: {
54977
- _messageSplitIndex: messageSplitIndex,
54978
- session_id: sessionId,
54979
- seq,
54980
- tool_name: String(tc.name ?? ""),
54981
- args_digest: argsDigest(tc.input ?? tc.arguments),
54982
- status: "ok",
54983
- started_at: undefined,
54984
- completed_at: undefined,
54985
- duration_ms: undefined,
54986
- result_bytes: undefined,
54987
- error_text: undefined
54988
- }
54989
- });
54990
- }
54978
+ if (Array.isArray(contentBlocks) && role === "assistant") {
54979
+ for (const block of contentBlocks) {
54980
+ const call = normalizeOmpToolCall(block);
54981
+ if (call === null)
54982
+ continue;
54983
+ entries.push({
54984
+ targetTable: "history_tool_call",
54985
+ record: {
54986
+ _messageSplitIndex: messageSplitIndex,
54987
+ session_id: sessionId,
54988
+ seq,
54989
+ tool_name: String(call.name ?? ""),
54990
+ args_digest: argsDigest(call.input ?? call.arguments),
54991
+ status: "ok",
54992
+ started_at: undefined,
54993
+ completed_at: undefined,
54994
+ duration_ms: undefined,
54995
+ result_bytes: undefined,
54996
+ error_text: undefined
54997
+ }
54998
+ });
54991
54999
  }
54992
55000
  }
54993
55001
  return entries;
54994
55002
  }
55003
+ function normalizeOmpToolCall(block) {
55004
+ if (typeof block !== "object" || block === null)
55005
+ return null;
55006
+ const nested = o2(block.toolCall);
55007
+ if (Object.keys(nested).length > 0)
55008
+ return nested;
55009
+ if (block.type === "toolCall")
55010
+ return block;
55011
+ return null;
55012
+ }
54995
55013
  function codexSplit(raw) {
54996
55014
  const entries = [];
54997
55015
  const payload = raw.payload ?? raw;
@@ -55763,7 +55781,7 @@ var init_mappers = __esm(() => {
55763
55781
  GEMINI_SCHEMA = passthroughSchema;
55764
55782
  });
55765
55783
 
55766
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
55784
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
55767
55785
  function firstString(...values) {
55768
55786
  for (const value of values) {
55769
55787
  if (typeof value === "string" && value.length > 0)
@@ -55917,7 +55935,7 @@ var init_sources = __esm(() => {
55917
55935
  };
55918
55936
  });
55919
55937
 
55920
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
55938
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
55921
55939
  function targetTableFor(table3) {
55922
55940
  if (!VALID_TABLE_NAME.test(table3)) {
55923
55941
  throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
@@ -56013,6 +56031,43 @@ async function insertLedger(db2, recordHash, source, sourceFile, sourceLine, spl
56013
56031
  await db2.run(`INSERT INTO history_import_ledger (record_hash, source, source_file, source_line, split_index, target_table, imported_at)
56014
56032
  VALUES (?, ?, ?, ?, ?, ?, ?)`, recordHash, source, sourceFile, sourceLine, splitIndex, targetTable, timestamp(now2));
56015
56033
  }
56034
+ async function reconcileFullImport(db2, source, desiredHashes, discoveredFiles, dryRun) {
56035
+ const ledgerRows = await db2.queryAll("SELECT record_hash, target_table FROM history_import_ledger WHERE source = ?", source);
56036
+ const stale = [];
56037
+ for (const row of ledgerRows) {
56038
+ if (!desiredHashes.has(row.record_hash))
56039
+ stale.push(row);
56040
+ }
56041
+ const checkpointRows = await db2.queryAll("SELECT source_file FROM history_import_checkpoint WHERE source = ?", source);
56042
+ const discovered = new Set(discoveredFiles);
56043
+ const staleCheckpoints = checkpointRows.map((row) => row.source_file).filter((sourceFile) => !discovered.has(sourceFile));
56044
+ const summary = {
56045
+ staleTargetRows: stale.length,
56046
+ staleLedgerRows: stale.length,
56047
+ staleCheckpointRows: staleCheckpoints.length
56048
+ };
56049
+ if (dryRun || stale.length === 0 && staleCheckpoints.length === 0)
56050
+ return summary;
56051
+ const operations2 = [];
56052
+ for (const row of stale) {
56053
+ operations2.push({
56054
+ sql: `DELETE FROM ${targetTableFor(row.target_table)} WHERE record_hash = ?`,
56055
+ params: [row.record_hash]
56056
+ });
56057
+ operations2.push({
56058
+ sql: "DELETE FROM history_import_ledger WHERE record_hash = ?",
56059
+ params: [row.record_hash]
56060
+ });
56061
+ }
56062
+ for (const sourceFile of staleCheckpoints) {
56063
+ operations2.push({
56064
+ sql: "DELETE FROM history_import_checkpoint WHERE source = ? AND source_file = ?",
56065
+ params: [source, sourceFile]
56066
+ });
56067
+ }
56068
+ await db2.batch(operations2);
56069
+ return summary;
56070
+ }
56016
56071
  async function readOpenCodeMessages(db2, lastTime, lastId, limit) {
56017
56072
  return db2.queryAll(`SELECT m.id, m.session_id, m.time_created, m.data, s.directory
56018
56073
  FROM message m
@@ -56051,6 +56106,12 @@ function openCodeDeleteOperations(entries) {
56051
56106
  }
56052
56107
  ]);
56053
56108
  }
56109
+ function deleteCheckpointOperation(source, sourceFile) {
56110
+ return {
56111
+ sql: "DELETE FROM history_import_checkpoint WHERE source = ? AND source_file = ?",
56112
+ params: [source, sourceFile]
56113
+ };
56114
+ }
56054
56115
  function openCodeBulkWriteOperations(entries, checkpointFiles, now2) {
56055
56116
  const importedAt = timestamp(now2);
56056
56117
  const operations2 = [];
@@ -56157,7 +56218,7 @@ var init_jsonl_importer_dao = __esm(() => {
56157
56218
  _ensuredTables = new Set;
56158
56219
  });
56159
56220
 
56160
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
56221
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
56161
56222
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
56162
56223
  if (typeof value === "string") {
56163
56224
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -56194,7 +56255,7 @@ var init_redaction = __esm(() => {
56194
56255
  ];
56195
56256
  });
56196
56257
 
56197
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
56258
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
56198
56259
  async function runJsonlImport(source, options) {
56199
56260
  const definition = resolveSourceDefinition(source);
56200
56261
  const resolvedSource = definition.source;
@@ -56213,6 +56274,7 @@ async function runJsonlImport(source, options) {
56213
56274
  let skippedDuplicates = 0;
56214
56275
  let unknownRecords = 0;
56215
56276
  let checkpointUpdates = 0;
56277
+ const desiredHashes = new Set;
56216
56278
  for (const file2 of files) {
56217
56279
  const checkpoint = mode === "incremental" ? await readCheckpoint(options.db, resolvedSource, file2) : 0;
56218
56280
  let lineNumber = 0;
@@ -56232,6 +56294,7 @@ async function runJsonlImport(source, options) {
56232
56294
  splitIndex: 0
56233
56295
  });
56234
56296
  let lineSucceeded = false;
56297
+ let lineRejected = false;
56235
56298
  const prepared = [];
56236
56299
  for (let splitIndex = 0;splitIndex < splitRecords.length; splitIndex += 1) {
56237
56300
  const split = splitRecords[splitIndex];
@@ -56250,6 +56313,7 @@ async function runJsonlImport(source, options) {
56250
56313
  sourceLine: lineNumber,
56251
56314
  reason: parsed.error.issues.map((issue2) => issue2.message).join("; ")
56252
56315
  });
56316
+ lineRejected = true;
56253
56317
  continue;
56254
56318
  }
56255
56319
  const redacted = redactRecord(parsed.data, options.redactionRules);
@@ -56261,12 +56325,15 @@ async function runJsonlImport(source, options) {
56261
56325
  splitIndex,
56262
56326
  record: redacted
56263
56327
  });
56328
+ desiredHashes.add(recordHash);
56264
56329
  if (await ledgerExists(options.db, recordHash)) {
56265
56330
  skippedDuplicates += 1;
56266
56331
  continue;
56267
56332
  }
56268
56333
  prepared.push({ split, splitIndex, normalized: redacted, recordHash });
56269
56334
  }
56335
+ if (lineRejected)
56336
+ continue;
56270
56337
  const recordHashBySplitIndex = new Map(prepared.map((e) => [e.splitIndex, e.recordHash]));
56271
56338
  for (const entry of prepared) {
56272
56339
  const { split, splitIndex, normalized, recordHash } = entry;
@@ -56293,6 +56360,10 @@ async function runJsonlImport(source, options) {
56293
56360
  }
56294
56361
  }
56295
56362
  }
56363
+ let reconciliation;
56364
+ if (mode === "full") {
56365
+ reconciliation = await reconcileFullImport(options.db, resolvedSource, desiredHashes, files, options.dryRun ?? false);
56366
+ }
56296
56367
  return {
56297
56368
  source: resolvedSource,
56298
56369
  mode,
@@ -56303,7 +56374,8 @@ async function runJsonlImport(source, options) {
56303
56374
  unknownRecords,
56304
56375
  parseErrors,
56305
56376
  validationErrors,
56306
- checkpointUpdates
56377
+ checkpointUpdates,
56378
+ reconciliation
56307
56379
  };
56308
56380
  }
56309
56381
  function parseJsonLine(line, sourceFile, sourceLine, parseErrors) {
@@ -56421,7 +56493,7 @@ var init_importer = __esm(() => {
56421
56493
  init_sources();
56422
56494
  });
56423
56495
 
56424
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
56496
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
56425
56497
  async function runOpenCodeImport(options) {
56426
56498
  const paths = options.paths ?? ambientRuntimePaths2();
56427
56499
  const sourceDatabase = options.sourceDatabase ?? joinPath2(paths.home, ".local/share/opencode/opencode.db");
@@ -56440,7 +56512,12 @@ async function runOpenCodeImport(options) {
56440
56512
  let lastTime = -1;
56441
56513
  let lastId = "";
56442
56514
  const existingBySourceFile = await readOpenCodeExistingEntries(options.db);
56515
+ const seenSourceFiles = new Set;
56443
56516
  const operations2 = [];
56517
+ let staleTargetRows = 0;
56518
+ let staleLedgerRows = 0;
56519
+ let staleCheckpointRows = 0;
56520
+ let reconciliation;
56444
56521
  try {
56445
56522
  while (true) {
56446
56523
  const messages = await readOpenCodeMessages(sourceDb, lastTime, lastId, PAGE_SIZE);
@@ -56462,11 +56539,16 @@ async function runOpenCodeImport(options) {
56462
56539
  validationErrors.push({ sourceFile, sourceLine: 1, reason: "OpenCode message has no valid role" });
56463
56540
  continue;
56464
56541
  }
56542
+ seenSourceFiles.add(sourceFile);
56465
56543
  const existing = existingBySourceFile.get(sourceFile) ?? [];
56466
56544
  if (sameHashes(existing, entries)) {
56467
56545
  skippedDuplicates += entries.length;
56468
56546
  continue;
56469
56547
  }
56548
+ if (mode === "full") {
56549
+ staleTargetRows += existing.length;
56550
+ staleLedgerRows += existing.length;
56551
+ }
56470
56552
  if (!options.dryRun) {
56471
56553
  operations2.push(...openCodeDeleteOperations(existing));
56472
56554
  for (const entry of entries) {
@@ -56487,6 +56569,20 @@ async function runOpenCodeImport(options) {
56487
56569
  lastTime = tail.time_created;
56488
56570
  lastId = tail.id;
56489
56571
  }
56572
+ if (mode === "full") {
56573
+ for (const [sourceFile, entries] of existingBySourceFile) {
56574
+ if (seenSourceFiles.has(sourceFile))
56575
+ continue;
56576
+ staleLedgerRows += entries.length;
56577
+ staleTargetRows += entries.length;
56578
+ staleCheckpointRows += 1;
56579
+ if (!options.dryRun) {
56580
+ operations2.push(...openCodeDeleteOperations(entries));
56581
+ operations2.push(deleteCheckpointOperation(SOURCE, sourceFile));
56582
+ }
56583
+ }
56584
+ reconciliation = { staleTargetRows, staleLedgerRows, staleCheckpointRows };
56585
+ }
56490
56586
  if (operations2.length > 0)
56491
56587
  await options.db.batch(operations2);
56492
56588
  } finally {
@@ -56502,7 +56598,8 @@ async function runOpenCodeImport(options) {
56502
56598
  unknownRecords: 0,
56503
56599
  parseErrors,
56504
56600
  validationErrors,
56505
- checkpointUpdates
56601
+ checkpointUpdates,
56602
+ reconciliation
56506
56603
  };
56507
56604
  }
56508
56605
  function groupParts(parts) {
@@ -56647,14 +56744,14 @@ var init_opencode_importer = __esm(() => {
56647
56744
  init_redaction();
56648
56745
  });
56649
56746
 
56650
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.24+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
56747
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.27+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
56651
56748
  var init_dist8 = __esm(() => {
56652
56749
  init_importer();
56653
56750
  init_opencode_importer();
56654
56751
  init_schema_sql2();
56655
56752
  });
56656
56753
 
56657
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
56754
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
56658
56755
  function collectExtensions(sourceName, sourceDir, extensions) {
56659
56756
  if (extensions === undefined)
56660
56757
  return [];
@@ -56670,7 +56767,7 @@ var init_extensions = __esm(() => {
56670
56767
  init_dist5();
56671
56768
  });
56672
56769
 
56673
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
56770
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
56674
56771
  function createFinding(rule, message, filePath, extras = {}) {
56675
56772
  return {
56676
56773
  ruleId: rule.id,
@@ -56741,7 +56838,7 @@ var init_types3 = __esm(() => {
56741
56838
  });
56742
56839
  });
56743
56840
 
56744
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
56841
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
56745
56842
  async function loadPreset(name, options) {
56746
56843
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
56747
56844
  const presetPath = findMergedPreset(merged, name);
@@ -56956,7 +57053,7 @@ var init_loader2 = __esm(() => {
56956
57053
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
56957
57054
  });
56958
57055
 
56959
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
57056
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
56960
57057
  function normalizeFindingPath(filePath) {
56961
57058
  if (!filePath || isAbsolutePath2(filePath))
56962
57059
  return null;
@@ -57021,7 +57118,7 @@ var init_test_stub_fixer = __esm(() => {
57021
57118
  realFileSystem = createNodeFileSystem3();
57022
57119
  });
57023
57120
 
57024
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
57121
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
57025
57122
  function registerBuiltinFixers(host, exec) {
57026
57123
  const regexFixer = new RegexFixerProvider;
57027
57124
  const pathFixer = new PathFixerProvider;
@@ -57224,7 +57321,7 @@ var init_fixers = __esm(() => {
57224
57321
  };
57225
57322
  });
57226
57323
 
57227
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
57324
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
57228
57325
  function getAgentSessionCapability(agent) {
57229
57326
  return AGENT_SESSION_CAPABILITY[agent];
57230
57327
  }
@@ -57516,7 +57613,7 @@ var init_shims = __esm(() => {
57516
57613
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
57517
57614
  });
57518
57615
 
57519
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
57616
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
57520
57617
  function buildIdentityPreamble(ctx) {
57521
57618
  const sections = [
57522
57619
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -57576,7 +57673,7 @@ var init_identity = __esm(() => {
57576
57673
  init_dist5();
57577
57674
  });
57578
57675
 
57579
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
57676
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
57580
57677
  function isClaudeStyleSlashCommand(input) {
57581
57678
  return SLASH_COMMAND_RE.test(input);
57582
57679
  }
@@ -57604,7 +57701,7 @@ var init_slash_command = __esm(() => {
57604
57701
  SLASH_COMMAND_RE = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
57605
57702
  });
57606
57703
 
57607
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
57704
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
57608
57705
  function buildCorrelationEnv(correlation) {
57609
57706
  return {
57610
57707
  [AGENT_RUN_ID_ENV]: correlation.runId,
@@ -57740,7 +57837,7 @@ var init_ai_runner = __esm(() => {
57740
57837
  init_slash_command();
57741
57838
  });
57742
57839
 
57743
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
57840
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
57744
57841
  class AgentDetector {
57745
57842
  runner;
57746
57843
  timeout;
@@ -57816,7 +57913,7 @@ var init_agent_detector = __esm(() => {
57816
57913
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
57817
57914
  });
57818
57915
 
57819
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
57916
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
57820
57917
  function validateAgentId(id) {
57821
57918
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
57822
57919
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -57913,7 +58010,7 @@ var init_agent_spec = __esm(() => {
57913
58010
  };
57914
58011
  });
57915
58012
 
57916
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
58013
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
57917
58014
  function isNonEmpty(value) {
57918
58015
  return value !== undefined && value.trim().length > 0;
57919
58016
  }
@@ -58018,7 +58115,7 @@ var init_auth_shims = __esm(() => {
58018
58115
  };
58019
58116
  });
58020
58117
 
58021
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
58118
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
58022
58119
  class ModelHealthProbeRegistry {
58023
58120
  probes = new Map;
58024
58121
  register(providerPrefix, probe) {
@@ -58126,7 +58223,7 @@ var init_model_health_probe = __esm(() => {
58126
58223
  };
58127
58224
  });
58128
58225
 
58129
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
58226
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
58130
58227
  class DoctorRunner {
58131
58228
  detector;
58132
58229
  runner;
@@ -58263,15 +58360,15 @@ var init_doctor_runner = __esm(() => {
58263
58360
  init_model_health_probe();
58264
58361
  });
58265
58362
 
58266
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
58363
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
58267
58364
  var init_events = () => {};
58268
58365
 
58269
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
58366
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
58270
58367
  function formatMessage(msg) {
58271
58368
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
58272
58369
  }
58273
58370
 
58274
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
58371
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
58275
58372
  import { Buffer as Buffer5 } from "buffer";
58276
58373
 
58277
58374
  class TeamAgentProcess {
@@ -58405,7 +58502,7 @@ var init_team_agent_process = __esm(() => {
58405
58502
  init_dist5();
58406
58503
  });
58407
58504
 
58408
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
58505
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
58409
58506
  class TeamOrchestrator {
58410
58507
  configDir;
58411
58508
  inbox;
@@ -58534,7 +58631,7 @@ var init_team_orchestrator = __esm(() => {
58534
58631
  init_team_agent_process();
58535
58632
  });
58536
58633
 
58537
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.24+fd3bcbcfd5172c57/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
58634
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.27+7c83d7dc3b29919c/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
58538
58635
  var exports_dist3 = {};
58539
58636
  __export(exports_dist3, {
58540
58637
  validateAgentId: () => validateAgentId,
@@ -58586,7 +58683,7 @@ var init_dist9 = __esm(() => {
58586
58683
  init_team_orchestrator();
58587
58684
  });
58588
58685
 
58589
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
58686
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
58590
58687
  function stringArray(value) {
58591
58688
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
58592
58689
  }
@@ -58624,7 +58721,7 @@ function parseInlineFlags(source) {
58624
58721
  return { flags, rest: source.slice(match[0].length) };
58625
58722
  }
58626
58723
 
58627
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
58724
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
58628
58725
  function matchesAny(path9, patterns) {
58629
58726
  if (patterns === undefined || patterns.length === 0)
58630
58727
  return true;
@@ -58672,7 +58769,7 @@ function escapeRegExp(value) {
58672
58769
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
58673
58770
  }
58674
58771
 
58675
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
58772
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
58676
58773
  async function discoverFiles2(options) {
58677
58774
  const fs3 = options.fs ?? createNodeFileSystem3();
58678
58775
  const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -58700,12 +58797,12 @@ var init_file_discovery = __esm(() => {
58700
58797
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
58701
58798
  });
58702
58799
 
58703
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
58800
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
58704
58801
  var init_file_utils = __esm(() => {
58705
58802
  init_file_discovery();
58706
58803
  });
58707
58804
 
58708
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
58805
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
58709
58806
  class AgentDetectionEvaluator {
58710
58807
  detector;
58711
58808
  constructor(detector = new AgentDetector) {
@@ -58733,7 +58830,7 @@ var init_agent_detection_evaluator = __esm(() => {
58733
58830
  init_file_utils();
58734
58831
  });
58735
58832
 
58736
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
58833
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
58737
58834
  class CoverageGateEvaluator {
58738
58835
  constructor() {}
58739
58836
  async evaluate(rule, context4) {
@@ -58817,7 +58914,7 @@ var init_coverage_gate_evaluator = __esm(() => {
58817
58914
  init_file_utils();
58818
58915
  });
58819
58916
 
58820
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
58917
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
58821
58918
  class ExitCodeEvaluator {
58822
58919
  executor;
58823
58920
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -58853,7 +58950,7 @@ var init_exit_code_evaluator = __esm(() => {
58853
58950
  init_file_utils();
58854
58951
  });
58855
58952
 
58856
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
58953
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
58857
58954
  class ForbiddenImportEvaluator {
58858
58955
  constructor() {}
58859
58956
  async evaluate(rule, context4) {
@@ -58934,7 +59031,7 @@ var init_forbidden_import_evaluator = __esm(() => {
58934
59031
  init_file_utils();
58935
59032
  });
58936
59033
 
58937
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
59034
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
58938
59035
  class ImportBoundaryEvaluator {
58939
59036
  async evaluate(rule, context4) {
58940
59037
  const config4 = rule.evaluator.config ?? {};
@@ -59027,7 +59124,7 @@ var init_import_boundary_evaluator = __esm(() => {
59027
59124
  init_file_utils();
59028
59125
  });
59029
59126
 
59030
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
59127
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
59031
59128
  class PathEvaluator {
59032
59129
  constructor() {}
59033
59130
  async evaluate(rule, context4) {
@@ -59088,7 +59185,7 @@ var init_path_evaluator = __esm(() => {
59088
59185
  init_file_utils();
59089
59186
  });
59090
59187
 
59091
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
59188
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
59092
59189
  class RegexEvaluator {
59093
59190
  constructor() {}
59094
59191
  async evaluate(rule, context4) {
@@ -59166,7 +59263,7 @@ var init_regex_evaluator = __esm(() => {
59166
59263
  init_file_utils();
59167
59264
  });
59168
59265
 
59169
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
59266
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
59170
59267
  class RipgrepEvaluator {
59171
59268
  executor;
59172
59269
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -59259,7 +59356,7 @@ var init_ripgrep_evaluator = __esm(() => {
59259
59356
  init_file_utils();
59260
59357
  });
59261
59358
 
59262
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
59359
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
59263
59360
  class SchemaArtifactEvaluator {
59264
59361
  constructor() {}
59265
59362
  async evaluate(rule, context4) {
@@ -59337,7 +59434,7 @@ var init_schema_artifact_evaluator = __esm(() => {
59337
59434
  init_file_utils();
59338
59435
  });
59339
59436
 
59340
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
59437
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
59341
59438
  class SecretsScannerEvaluator {
59342
59439
  constructor() {}
59343
59440
  async evaluate(rule, context4) {
@@ -59405,7 +59502,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
59405
59502
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
59406
59503
  });
59407
59504
 
59408
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
59505
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
59409
59506
  class SgEvaluator {
59410
59507
  executor;
59411
59508
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -59502,7 +59599,7 @@ var init_sg_evaluator = __esm(() => {
59502
59599
  init_file_utils();
59503
59600
  });
59504
59601
 
59505
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
59602
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
59506
59603
  class TypeScriptTestPathResolver {
59507
59604
  name = "typescript";
59508
59605
  constructor() {}
@@ -59585,7 +59682,7 @@ function testify(rel) {
59585
59682
  return `${dir}test_${base2}`;
59586
59683
  }
59587
59684
 
59588
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
59685
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
59589
59686
  class TestLocationEvaluator {
59590
59687
  resolvers;
59591
59688
  constructor(resolvers) {
@@ -59660,7 +59757,7 @@ var init_test_location_evaluator = __esm(() => {
59660
59757
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
59661
59758
  });
59662
59759
 
59663
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
59760
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
59664
59761
  class TsdocExportEvaluator {
59665
59762
  constructor() {}
59666
59763
  async evaluate(rule, context4) {
@@ -59745,7 +59842,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
59745
59842
  };
59746
59843
  });
59747
59844
 
59748
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
59845
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
59749
59846
  class JsonFormatter {
59750
59847
  constructor() {}
59751
59848
  format(result) {
@@ -59753,7 +59850,7 @@ class JsonFormatter {
59753
59850
  }
59754
59851
  }
59755
59852
 
59756
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
59853
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
59757
59854
  class TextFormatter {
59758
59855
  constructor() {}
59759
59856
  format(result) {
@@ -59767,7 +59864,7 @@ class TextFormatter {
59767
59864
  }
59768
59865
  }
59769
59866
 
59770
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
59867
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
59771
59868
  function registerBuiltins(host, executor) {
59772
59869
  const path9 = new PathEvaluator;
59773
59870
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -59807,7 +59904,7 @@ var init_builtins = __esm(() => {
59807
59904
  init_tsdoc_export_evaluator();
59808
59905
  });
59809
59906
 
59810
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
59907
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
59811
59908
  class RuleEngineHost {
59812
59909
  evaluators;
59813
59910
  formatters;
@@ -59824,7 +59921,7 @@ var init_rule_engine_host = __esm(() => {
59824
59921
  init_extension2();
59825
59922
  });
59826
59923
 
59827
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
59924
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
59828
59925
  class RuleEngine {
59829
59926
  host;
59830
59927
  events;
@@ -59995,7 +60092,7 @@ var init_engine = __esm(() => {
59995
60092
  init_types3();
59996
60093
  });
59997
60094
 
59998
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
60095
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
59999
60096
  async function bundledRulesRoot() {
60000
60097
  if (cachedRoot2 !== undefined)
60001
60098
  return cachedRoot2;
@@ -60046,7 +60143,7 @@ var init_bundled_rules = __esm(() => {
60046
60143
  init_dist5();
60047
60144
  });
60048
60145
 
60049
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
60146
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
60050
60147
  class DbRulePersistenceAdapter {
60051
60148
  db;
60052
60149
  constructor(db2) {
@@ -60080,7 +60177,7 @@ class DbRulePersistenceAdapter {
60080
60177
  }
60081
60178
  }
60082
60179
 
60083
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
60180
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
60084
60181
  var RULE_ENGINE_SCHEMA_SQL = `
60085
60182
  CREATE TABLE IF NOT EXISTS rule_runs (
60086
60183
  id TEXT PRIMARY KEY,
@@ -60126,10 +60223,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
60126
60223
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
60127
60224
  `;
60128
60225
 
60129
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
60226
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
60130
60227
  var init_persistence2 = () => {};
60131
60228
 
60132
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.24+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
60229
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.27+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
60133
60230
  var init_dist10 = __esm(() => {
60134
60231
  init_extensions();
60135
60232
  init_loader2();
@@ -60352,7 +60449,7 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
60352
60449
  ];
60353
60450
  });
60354
60451
 
60355
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
60452
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
60356
60453
  function queueLogger() {
60357
60454
  if (!_queueLogger)
60358
60455
  _queueLogger = getLogger2("job-queue");
@@ -60629,7 +60726,7 @@ var init_db_job_queue = __esm(() => {
60629
60726
  init_tracing2();
60630
60727
  });
60631
60728
 
60632
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
60729
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
60633
60730
  var exports_job_queue_db = {};
60634
60731
  __export(exports_job_queue_db, {
60635
60732
  DBQueueConsumer: () => DBQueueConsumer,
@@ -64757,6 +64854,10 @@ function hasAdjacentFileLineColumns(body) {
64757
64854
  }
64758
64855
  return false;
64759
64856
  }
64857
+ function hasSolutionFileLineCitation(body) {
64858
+ const hasFileLine = /`[^`]+?:\d+(-\d+)?`/.test(body) || /[^\s`]\.\w+:\d+/.test(body);
64859
+ return hasFileLine || hasAdjacentFileLineColumns(body);
64860
+ }
64760
64861
  var TaskCheckService;
64761
64862
  var init_task_check = __esm(() => {
64762
64863
  init_src2();
@@ -64899,18 +65000,14 @@ var init_task_check = __esm(() => {
64899
65000
  }
64900
65001
  }
64901
65002
  const solBody = doc2.getSection("Solution");
64902
- if (solBody !== null && !isPlaceholderBody(solBody)) {
64903
- const hasFileLine = /`[^`]+?:\d+(-\d+)?`/.test(solBody) || /[^\s`]\.\w+:\d+/.test(solBody);
64904
- const hasTableFileLine = hasFileLine || hasAdjacentFileLineColumns(solBody);
64905
- if (!hasTableFileLine) {
64906
- findings.push({
64907
- layer: "L3",
64908
- code: FINDING_CODES.L3_SOLUTION_FILE_LINE,
64909
- severity: "error",
64910
- section: "Solution",
64911
- message: "Solution must contain at least one `file:line` citation"
64912
- });
64913
- }
65003
+ if (solBody !== null && !isPlaceholderBody(solBody) && !hasSolutionFileLineCitation(solBody)) {
65004
+ findings.push({
65005
+ layer: "L3",
65006
+ code: FINDING_CODES.L3_SOLUTION_FILE_LINE,
65007
+ severity: "error",
65008
+ section: "Solution",
65009
+ message: "Solution must contain at least one `file:line` citation"
65010
+ });
64914
65011
  }
64915
65012
  const revBody = doc2.getSection("Review");
64916
65013
  const revRequired = (entry?.required ?? []).includes("Review");
@@ -67142,7 +67239,9 @@ class HistoryService {
67142
67239
  toolCalls: r.toolCalls,
67143
67240
  tokens: r.tokens ?? 0,
67144
67241
  costUsd: r.costUsd ?? 0,
67145
- topTool: r.topTool
67242
+ topTool: r.topTool,
67243
+ assistantDurationMs: r.assistantDurationMs ?? 0,
67244
+ assistantDurationUnmeasured: r.assistantDurationUnmeasured
67146
67245
  })),
67147
67246
  loops: loopRows,
67148
67247
  warnings: [...buildWarnings(driftRows, coverage), ...opts.extraWarnings ?? []]
@@ -67211,7 +67310,15 @@ class HistoryService {
67211
67310
  } finally {
67212
67311
  clearTimeout(timer);
67213
67312
  }
67214
- const status = result.scannedFiles === 0 ? "empty" : "ok";
67313
+ const hasDegradedInput = result.parseErrors.length > 0 || result.validationErrors.length > 0;
67314
+ const status = result.scannedFiles === 0 ? "empty" : hasDegradedInput ? "degraded" : "ok";
67315
+ if (hasDegradedInput) {
67316
+ sourceWarnings.push({
67317
+ code: "source-degraded",
67318
+ source,
67319
+ detail: `source '${source}' imported ${result.importedRecords} records but skipped ` + `${result.parseErrors.length} parse and ${result.validationErrors.length} ` + "validation error(s); samples are bounded in the artifact and streamed to the sidecar"
67320
+ });
67321
+ }
67215
67322
  if (status === "empty" && wasNonEmpty) {
67216
67323
  sourceWarnings.push({
67217
67324
  code: "source-was-nonempty",
@@ -67230,7 +67337,8 @@ class HistoryService {
67230
67337
  parseErrors: result.parseErrors.length,
67231
67338
  validationErrors: result.validationErrors.length,
67232
67339
  parseErrorSamples: result.parseErrors.slice(0, MAX_ERROR_SAMPLES).map(formatIssue),
67233
- validationErrorSamples: result.validationErrors.slice(0, MAX_ERROR_SAMPLES).map(formatIssue)
67340
+ validationErrorSamples: result.validationErrors.slice(0, MAX_ERROR_SAMPLES).map(formatIssue),
67341
+ ...result.reconciliation ? { reconciliation: result.reconciliation } : {}
67234
67342
  };
67235
67343
  return { coverageEntry, sourceWarnings };
67236
67344
  } catch (e) {
@@ -67267,7 +67375,9 @@ function emptyTotals() {
67267
67375
  messages: 0,
67268
67376
  toolCalls: 0,
67269
67377
  durationMs: 0,
67270
- durationUnmeasured: 0
67378
+ durationUnmeasured: 0,
67379
+ assistantDurationMs: 0,
67380
+ assistantDurationUnmeasured: 0
67271
67381
  };
67272
67382
  }
67273
67383
  function foldMessage(bucket, row) {
@@ -67279,6 +67389,8 @@ function foldMessage(bucket, row) {
67279
67389
  bucket.cacheWriteTokens += row.cacheWriteTokens ?? 0;
67280
67390
  bucket.costUsd += row.costUsd ?? 0;
67281
67391
  bucket.recordsWithUsage += row.recordsWithUsage;
67392
+ bucket.assistantDurationMs += row.assistantDurationMs ?? 0;
67393
+ bucket.assistantDurationUnmeasured += row.assistantDurationUnmeasured;
67282
67394
  }
67283
67395
  function foldTool(bucket, row) {
67284
67396
  bucket.toolCalls += row.toolCalls;
@@ -67321,11 +67433,11 @@ function buildCoverage(sourceRows, tRows, driftRows, coverageErrors, importCover
67321
67433
  for (const row of sourceRows)
67322
67434
  sqlBySource.set(row.source, row);
67323
67435
  return importCoverage.map((imp) => {
67324
- if (imp.status === "ok") {
67436
+ if (imp.status === "ok" || imp.status === "degraded") {
67325
67437
  const sql4 = sqlBySource.get(imp.source);
67326
67438
  return {
67327
67439
  source: imp.source,
67328
- status: "ok",
67440
+ status: imp.status,
67329
67441
  files: sql4?.files ?? imp.files,
67330
67442
  messages: sql4?.messages ?? imp.messages,
67331
67443
  toolCalls: toolCounts2[imp.source] ?? 0,
@@ -67334,7 +67446,8 @@ function buildCoverage(sourceRows, tRows, driftRows, coverageErrors, importCover
67334
67446
  parseErrors: imp.parseErrors,
67335
67447
  validationErrors: imp.validationErrors,
67336
67448
  parseErrorSamples: imp.parseErrorSamples,
67337
- validationErrorSamples: imp.validationErrorSamples
67449
+ validationErrorSamples: imp.validationErrorSamples,
67450
+ ...imp.reconciliation ? { reconciliation: imp.reconciliation } : {}
67338
67451
  };
67339
67452
  }
67340
67453
  return imp;
@@ -67348,9 +67461,10 @@ function buildCoverage(sourceRows, tRows, driftRows, coverageErrors, importCover
67348
67461
  unknownCounts[row.source] = (unknownCounts[row.source] ?? 0) + row.n;
67349
67462
  return sourceRows.map((s2) => {
67350
67463
  const err = coverageErrors?.[s2.source] ?? { parseErrors: [], validationErrors: [] };
67464
+ const hasErrors = err.parseErrors.length > 0 || err.validationErrors.length > 0;
67351
67465
  return {
67352
67466
  source: s2.source,
67353
- status: s2.messages > 0 ? "ok" : "empty",
67467
+ status: s2.messages > 0 ? hasErrors ? "degraded" : "ok" : "empty",
67354
67468
  files: s2.files,
67355
67469
  messages: s2.messages,
67356
67470
  toolCalls: toolCounts[s2.source] ?? 0,
@@ -67375,6 +67489,13 @@ function buildWarnings(driftRows, coverage) {
67375
67489
  if (entry.status === "empty") {
67376
67490
  warnings.push({ code: "source-empty", source: entry.source, detail: "0 messages discovered" });
67377
67491
  }
67492
+ if (entry.status === "degraded") {
67493
+ warnings.push({
67494
+ code: "source-degraded",
67495
+ source: entry.source,
67496
+ detail: `${entry.parseErrors} parse and ${entry.validationErrors} validation error(s) \u2014 ` + "source imported with skipped records (task 0504 R2)"
67497
+ });
67498
+ }
67378
67499
  }
67379
67500
  return warnings;
67380
67501
  }
@@ -67477,7 +67598,8 @@ function parseMode(value) {
67477
67598
  }
67478
67599
  function computeExitCode(entries) {
67479
67600
  const failed = entries.filter((e) => e.status === "failed").length;
67480
- if (failed === 0)
67601
+ const degraded = entries.filter((e) => e.status === "degraded").length;
67602
+ if (failed === 0 && degraded === 0)
67481
67603
  return 0;
67482
67604
  if (failed === entries.length)
67483
67605
  return 1;
@@ -70053,7 +70175,7 @@ class TaskService {
70053
70175
  return { ...templateBodies, ...taskBodies };
70054
70176
  }
70055
70177
  async findDuplicateFollowUp(featureId2, title, withinSec) {
70056
- const siblings = await this.list({ featureId: featureId2 });
70178
+ const siblings = featureId2 !== undefined ? await this.list({ featureId: featureId2 }) : (await this.list()).filter((t) => (t.frontmatter?.feature_id ?? undefined) === undefined);
70057
70179
  const now2 = Date.now();
70058
70180
  const lowerTitle = title.toLowerCase();
70059
70181
  for (const t of siblings) {
@@ -70082,7 +70204,7 @@ class TaskService {
70082
70204
  const status = params.status ?? (params.featureId !== undefined ? "todo" : "backlog");
70083
70205
  return this.writeService.createAllocated(folder, async () => {
70084
70206
  const dedupeWithinSec = params.dedupeWithinSec === null ? undefined : params.dedupeWithinSec ?? 300;
70085
- if (dedupeWithinSec !== undefined && params.featureId !== undefined) {
70207
+ if (dedupeWithinSec !== undefined) {
70086
70208
  const collision = await this.findDuplicateFollowUp(params.featureId, params.title, dedupeWithinSec);
70087
70209
  if (collision !== null) {
70088
70210
  throw new DuplicateFollowUpError(collision.wbs, collision.name, params.title);
@@ -70372,6 +70494,9 @@ class TaskService {
70372
70494
  const filePath = await this.resolveTaskFile(wbs);
70373
70495
  const raw = await this.ctx.fs.readFile(sourceFile);
70374
70496
  const body = stripLeadingSectionHeader2(raw, sectionName);
70497
+ if (sectionName === "Solution" && !hasSolutionFileLineCitation(body)) {
70498
+ throw new SectionMutationError("invalid-solution", "Solution must contain at least one `file:line` citation");
70499
+ }
70375
70500
  const ref = { kind: "task", id: wbs, filePath, folder: this.ctx.tasksDir };
70376
70501
  const result = await this.writeService.updateSection(ref, sectionName, body);
70377
70502
  if (sectionName === "Acceptance Criteria") {
@@ -70835,6 +70960,7 @@ var init_task_service = __esm(() => {
70835
70960
  init_src2();
70836
70961
  init_errors5();
70837
70962
  init_pipeline_run_link();
70963
+ init_task_check();
70838
70964
  init_task_locator();
70839
70965
  init_task_record();
70840
70966
  DependencyMutationError = class DependencyMutationError extends Error {
@@ -74533,19 +74659,19 @@ var {
74533
74659
  init_src();
74534
74660
  init_loader();
74535
74661
 
74536
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application-node.js
74662
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application-node.js
74537
74663
  init_dist4();
74538
74664
  init_dist5();
74539
74665
  import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
74540
74666
  import { dirname as dirname5 } from "path";
74541
74667
 
74542
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application/index.js
74668
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application/index.js
74543
74669
  init_default_observers();
74544
74670
  init_event_bus();
74545
74671
  init_file_observer();
74546
74672
  init_logger3();
74547
74673
 
74548
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
74674
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
74549
74675
  class NoopSchedulerAdapter {
74550
74676
  constructor() {}
74551
74677
  register(_cron, _action) {}
@@ -74553,7 +74679,7 @@ class NoopSchedulerAdapter {
74553
74679
  async stop() {}
74554
74680
  }
74555
74681
 
74556
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
74682
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
74557
74683
  function initScheduler(adapter, cronEntries) {
74558
74684
  const resolved = adapter ?? new NoopSchedulerAdapter;
74559
74685
  if (cronEntries) {
@@ -74564,7 +74690,7 @@ function initScheduler(adapter, cronEntries) {
74564
74690
  return resolved;
74565
74691
  }
74566
74692
 
74567
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
74693
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
74568
74694
  init_logger3();
74569
74695
  init_metrics();
74570
74696
  init_sdk();
@@ -74657,7 +74783,7 @@ function dbPlugin(db2) {
74657
74783
  };
74658
74784
  }
74659
74785
 
74660
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
74786
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
74661
74787
  init_logger3();
74662
74788
 
74663
74789
  class PluginHost {
@@ -74745,7 +74871,7 @@ class PluginHost {
74745
74871
  }
74746
74872
  }
74747
74873
 
74748
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application/index.js
74874
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application/index.js
74749
74875
  async function performShutdown(state, reason) {
74750
74876
  if (state.stopped)
74751
74877
  return;
@@ -74856,10 +74982,10 @@ async function runApplication(options) {
74856
74982
  }
74857
74983
  }
74858
74984
 
74859
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application-node.js
74985
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application-node.js
74860
74986
  init_scheduler_node();
74861
74987
 
74862
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
74988
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
74863
74989
  var import_api14 = __toESM(require_src(), 1);
74864
74990
 
74865
74991
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -77875,7 +78001,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
77875
78001
  }), JsonTraceSerializer));
77876
78002
  }
77877
78003
  }
77878
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
78004
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
77879
78005
  var import_resources2 = __toESM(require_src4(), 1);
77880
78006
  var import_sdk_trace_node = __toESM(require_src8(), 1);
77881
78007
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -77926,7 +78052,7 @@ async function shutdownNodeTelemetry() {
77926
78052
  await Promise.all(pending);
77927
78053
  }
77928
78054
 
77929
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.24+f96ea141b2a06f45/node_modules/@gobing-ai/ts-infra/dist/application-node.js
78055
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.27+2c3cbd358f360a0e/node_modules/@gobing-ai/ts-infra/dist/application-node.js
77930
78056
  class ConfigValidationError extends Error {
77931
78057
  constructor(message) {
77932
78058
  super(message);
@@ -82494,22 +82620,39 @@ async function assertFeatureCheckPass(context4, id, folderOverride, strict, asSt
82494
82620
  init_src3();
82495
82621
  init_src2();
82496
82622
  init_dist6();
82623
+ import { createRequire } from "module";
82497
82624
 
82498
82625
  // src/config.ts
82499
82626
  var CLI_CONFIG = {
82500
82627
  binaryName: "spur",
82501
82628
  binaryLabel: "spur",
82502
- binaryVersion: "0.3.42",
82629
+ binaryVersion: "0.3.43",
82503
82630
  configDir: ".spur",
82504
82631
  configFile: ".spur/config.yaml",
82505
82632
  databaseFile: ".spur/spur.db"
82506
82633
  };
82507
82634
 
82508
82635
  // src/commands/history.ts
82636
+ async function resolveImportProvenance(fs3) {
82637
+ const binary = process.argv[1] ?? "unknown";
82638
+ let importer = "unknown";
82639
+ try {
82640
+ const require2 = createRequire(import.meta.url);
82641
+ const packagePath = require2.resolve("@gobing-ai/ts-llm-jsonl-importer/package.json");
82642
+ const raw = JSON.parse(await fs3.readFile(packagePath));
82643
+ const version3 = raw !== null && typeof raw === "object" && "version" in raw ? raw.version : undefined;
82644
+ if (typeof version3 === "string" && version3.length > 0)
82645
+ importer = version3;
82646
+ } catch {}
82647
+ return { binary, importer };
82648
+ }
82649
+ function formatProvenance(provenance) {
82650
+ return `binary: ${provenance.binary}
82651
+ importer: @gobing-ai/ts-llm-jsonl-importer@${provenance.importer}`;
82652
+ }
82509
82653
  function registerHistoryCommand(program2, context4) {
82510
82654
  const noun = program2.command("history").summary("import and analyze coding-agent history");
82511
82655
  noun.command("import").description("Import agent conversation JSONL. `--source all` fans out across all sources with " + "per-source failure isolation (task 0470). A single source is the n=1 case of " + "the same contract \u2014 never two import paths.").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw|omp|grok|agy|all", "all").option("--file <path>", "Import one JSONL file (single-source only)").option("--root <path>", "Scan a history root").option("--mode <mode>", "full|incremental|force-file").option("--dry-run", "Scan without persisting imported records").option("--source-timeout <ms>", "Per-source timeout in milliseconds (default 600000 = 10 min)", "600000").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
82512
- const svc = new HistoryService({ getDb: () => context4.getDb() });
82513
82656
  const source = options.source ?? "all";
82514
82657
  if (options.file && source === "all") {
82515
82658
  context4.output.write(options.json ? toJson2({ status: "error", message: '--file requires a single --source, not "all".' }) : 'spur history import: --file requires a single --source, not "all".');
@@ -82528,6 +82671,13 @@ function registerHistoryCommand(program2, context4) {
82528
82671
  context4.setExitCode(1);
82529
82672
  return;
82530
82673
  }
82674
+ if (options.file && mode === "full" && options.dryRun !== true) {
82675
+ const unsafeMsg = "spur history import: --file <path> --mode full without --dry-run is unsafe \u2014 full mode " + "treats the file as the authoritative source for reconciliation. Preview with --dry-run, " + "or import a single file with --mode force-file.";
82676
+ context4.output.write(options.json ? toJson2({ status: "error", message: unsafeMsg }) : unsafeMsg);
82677
+ context4.setExitCode(1);
82678
+ return;
82679
+ }
82680
+ const svc = new HistoryService({ getDb: () => context4.getDb() });
82531
82681
  const fanOut = await svc.importAll({
82532
82682
  sources: source === "all" ? undefined : [source],
82533
82683
  file: options.file || undefined,
@@ -82536,7 +82686,9 @@ function registerHistoryCommand(program2, context4) {
82536
82686
  dryRun: options.dryRun === true,
82537
82687
  sourceTimeout
82538
82688
  });
82539
- context4.output.write(options.json ? toJson2(fanOut) : formatFanOutResult(fanOut));
82689
+ const provenance = await resolveImportProvenance(context4.fs);
82690
+ context4.output.write(options.json ? toJson2({ ...fanOut, provenance }) : `${formatProvenance(provenance)}
82691
+ ${formatFanOutResult(fanOut)}`);
82540
82692
  context4.setExitCode(fanOut.exitCode);
82541
82693
  });
82542
82694
  noun.command("analyze").description("Aggregate imported history with SQL and write a versioned JSON artifact (Q1-Q10 forensic query set).").option("--since <iso>", "Inclusive lower bound on message timestamp").option("--until <iso>", "Inclusive upper bound on message timestamp").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw|omp|grok|agy|all", "all").option("--session <id>", "Narrow to a single session id").option("--run <runId>", "Narrow to a single workflow run id").option("--task <wbs>", "Narrow to a single task WBS").option("--top <n>", "Leaderboard depth for byTool/bySession", "20").option("--out <path>", "Write the artifact to this path instead of the dated reports dir").option("--json", "Emit the artifact as JSON instead of the human summary").action(async (options) => {
@@ -82656,6 +82808,8 @@ function registerHistoryCommand(program2, context4) {
82656
82808
  });
82657
82809
  } else {
82658
82810
  const failing = entries.filter((e) => e.status === "failed");
82811
+ const degraded = entries.filter((e) => e.status === "degraded");
82812
+ const problems = [...failing, ...degraded];
82659
82813
  await bus.emit("history.daily.failed", {
82660
82814
  source: "history",
82661
82815
  renderer: "history-daily",
@@ -82663,7 +82817,7 @@ function registerHistoryCommand(program2, context4) {
82663
82817
  sources,
82664
82818
  okSources,
82665
82819
  failedSources,
82666
- detail: failing.length > 0 ? failing.map((e) => `${e.source}: ${e.parseErrors + e.validationErrors} errors`).join("; ") : "daily fan-out reported non-zero exit with no failing source",
82820
+ detail: problems.length > 0 ? problems.map((e) => `${e.source}: ${e.status} (${e.parseErrors + e.validationErrors} ` + "parse/validation errors)").join("; ") : "daily fan-out reported non-zero exit with no failing or degraded source",
82667
82821
  durationMs,
82668
82822
  artifactPath
82669
82823
  });
@@ -93846,7 +94000,7 @@ function registerTaskCommand(program2, context4) {
93846
94000
  dedupeWithinSec: options.allowDuplicateName ? null : options.dedupeWithin
93847
94001
  });
93848
94002
  if (options.json) {
93849
- context4.output.write(toJson2(result));
94003
+ context4.output.write(toJson2({ ...result, wbs: result.ref.id, filePath: result.ref.filePath }));
93850
94004
  } else {
93851
94005
  context4.output.write(`Created task ${result.ref.id}: ${result.ref.filePath}`);
93852
94006
  }
@@ -94026,8 +94180,13 @@ ${result.content}`);
94026
94180
  context4.setExitCode(2);
94027
94181
  }
94028
94182
  } catch (err) {
94029
- context4.output.error(String(err));
94030
- context4.setExitCode(1);
94183
+ if (err instanceof SectionMutationError) {
94184
+ context4.output.error(`[${err.code}] ${err.message}`);
94185
+ context4.setExitCode(err.code === "usage" ? 2 : 3);
94186
+ } else {
94187
+ context4.output.error(String(err));
94188
+ context4.setExitCode(1);
94189
+ }
94031
94190
  }
94032
94191
  });
94033
94192
  task.command("deps").summary("Mutate the dependencies[] frontmatter array on a task.").description("Mutate the `dependencies[]` array on an existing task. Operations:\n" + ` set <wbs...> \u2014 replace the array with the given WBS values