@gobing-ai/spur 0.3.89 → 0.3.90

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
@@ -48,7 +48,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
48
48
  var __promiseAll = (args) => Promise.all(args);
49
49
  var __require = import.meta.require;
50
50
 
51
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/errors.js
51
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/errors.js
52
52
  var ErrorCode, AppError, ValidationError;
53
53
  var init_errors = __esm(() => {
54
54
  ErrorCode = {
@@ -73,7 +73,7 @@ var init_errors = __esm(() => {
73
73
  };
74
74
  });
75
75
 
76
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/api-response.js
76
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/api-response.js
77
77
  var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
78
78
  var init_api_response = __esm(() => {
79
79
  init_errors();
@@ -96,10 +96,10 @@ var init_api_response = __esm(() => {
96
96
  CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
97
97
  });
98
98
 
99
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/cursor.js
99
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/cursor.js
100
100
  var init_cursor = () => {};
101
101
 
102
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/env.js
102
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/env.js
103
103
  function getEnvVar(name, fallback) {
104
104
  const raw = process.env[name];
105
105
  return raw === undefined ? fallback : raw;
@@ -121,10 +121,10 @@ function getAppOptions(config, key, fallback) {
121
121
  return value === undefined || value === null ? fallback : value;
122
122
  }
123
123
 
124
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
124
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
125
125
  var init_event_severity = () => {};
126
126
 
127
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/object.js
127
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/object.js
128
128
  function isPlainObject(value) {
129
129
  return typeof value === "object" && value !== null && !Array.isArray(value);
130
130
  }
@@ -142,7 +142,7 @@ function deepMerge(target, source) {
142
142
  return result;
143
143
  }
144
144
 
145
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/output.js
145
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/output.js
146
146
  function processStream(name) {
147
147
  const proc = globalThis.process;
148
148
  const stream = proc?.[name];
@@ -163,7 +163,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
163
163
  }
164
164
  var defaultStdoutTarget, defaultStderrTarget;
165
165
 
166
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.69/node_modules/@gobing-ai/ts-utils/dist/index.js
166
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.0/node_modules/@gobing-ai/ts-utils/dist/index.js
167
167
  var init_dist = __esm(() => {
168
168
  init_api_response();
169
169
  init_cursor();
@@ -22324,7 +22324,7 @@ var init_dist2 = __esm(() => {
22324
22324
  $visitAsync = visit.visitAsync;
22325
22325
  });
22326
22326
 
22327
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/config.js
22327
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/config.js
22328
22328
  function getProcessEnv() {
22329
22329
  return getEnvVars();
22330
22330
  }
@@ -22402,7 +22402,7 @@ var init_config = __esm(() => {
22402
22402
  };
22403
22403
  });
22404
22404
 
22405
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
22405
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
22406
22406
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
22407
22407
  import { dirname, resolve as resolvePath } from "path";
22408
22408
  function createNodeFileSystem(root, paths) {
@@ -22489,7 +22489,7 @@ function findProjectRoot(startDir) {
22489
22489
  }
22490
22490
  var init_file_system_node = () => {};
22491
22491
 
22492
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
22492
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
22493
22493
  var DbModuleNotInstalledError;
22494
22494
  var init_db_errors = __esm(() => {
22495
22495
  DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
@@ -29701,7 +29701,7 @@ var init_execa = __esm(() => {
29701
29701
  } = getIpcExport());
29702
29702
  });
29703
29703
 
29704
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29704
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29705
29705
  import { isatty } from "tty";
29706
29706
  function processEventSeverity(reason, exitCode) {
29707
29707
  if (reason === "error")
@@ -30163,7 +30163,7 @@ var init_process_executor = __esm(() => {
30163
30163
  init_config();
30164
30164
  });
30165
30165
 
30166
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
30166
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
30167
30167
  function getNodeFileSystem() {
30168
30168
  if (!_nodeFileSystem)
30169
30169
  _nodeFileSystem = createNodeFileSystem();
@@ -30223,7 +30223,7 @@ var init_runtime_node_bun = __esm(() => {
30223
30223
  };
30224
30224
  });
30225
30225
 
30226
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/context.js
30226
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/context.js
30227
30227
  class RuntimeContext {
30228
30228
  scope;
30229
30229
  runtimeName;
@@ -30293,7 +30293,7 @@ var init_context = __esm(() => {
30293
30293
  init_runtime_node_bun();
30294
30294
  });
30295
30295
 
30296
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/path.js
30296
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/path.js
30297
30297
  function normalizeSeparators(path6) {
30298
30298
  return path6.replaceAll("\\", "/");
30299
30299
  }
@@ -30354,17 +30354,17 @@ var init_path = __esm(() => {
30354
30354
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
30355
30355
  });
30356
30356
 
30357
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
30357
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
30358
30358
  var REMOTE_SCHEMA_MAX_BYTES;
30359
30359
  var init_schema_validation = __esm(() => {
30360
30360
  init_dist2();
30361
30361
  REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
30362
30362
  });
30363
30363
 
30364
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/types.js
30364
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/types.js
30365
30365
  var init_types = () => {};
30366
30366
 
30367
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/index.js
30367
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/index.js
30368
30368
  var init_dist3 = __esm(() => {
30369
30369
  init_config();
30370
30370
  init_context();
@@ -30373,7 +30373,7 @@ var init_dist3 = __esm(() => {
30373
30373
  init_types();
30374
30374
  });
30375
30375
 
30376
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+14602661d82b264c/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
30376
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+2527165804db8725/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
30377
30377
  import { Database } from "bun:sqlite";
30378
30378
  var init_bun_sqlite = () => {};
30379
30379
 
@@ -34803,7 +34803,7 @@ var init_bun_sqlite2 = __esm(() => {
34803
34803
  init_session2();
34804
34804
  });
34805
34805
 
34806
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
34806
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
34807
34807
  var inboxMessages;
34808
34808
  var init_inbox_messages = __esm(() => {
34809
34809
  init_sqlite_core();
@@ -34823,7 +34823,7 @@ var init_inbox_messages = __esm(() => {
34823
34823
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
34824
34824
  });
34825
34825
 
34826
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/common.js
34826
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/common.js
34827
34827
  function nowTimestamp() {
34828
34828
  return Date.now();
34829
34829
  }
@@ -34852,7 +34852,7 @@ var init_common3 = __esm(() => {
34852
34852
  appendOnlyColumns = buildAppendOnlyColumns();
34853
34853
  });
34854
34854
 
34855
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
34855
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
34856
34856
  var queueJobs;
34857
34857
  var init_queue_jobs = __esm(() => {
34858
34858
  init_sqlite_core();
@@ -34876,7 +34876,7 @@ var init_queue_jobs = __esm(() => {
34876
34876
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
34877
34877
  });
34878
34878
 
34879
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
34879
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
34880
34880
  var exports_runtime = {};
34881
34881
  __export(exports_runtime, {
34882
34882
  queueJobs: () => queueJobs,
@@ -34887,7 +34887,7 @@ var init_runtime = __esm(() => {
34887
34887
  init_queue_jobs();
34888
34888
  });
34889
34889
 
34890
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
34890
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
34891
34891
  var exports_bun_sqlite = {};
34892
34892
  __export(exports_bun_sqlite, {
34893
34893
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -35198,7 +35198,7 @@ var init_d1 = __esm(() => {
35198
35198
  init_session3();
35199
35199
  });
35200
35200
 
35201
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
35201
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
35202
35202
  var exports_d1 = {};
35203
35203
  __export(exports_d1, {
35204
35204
  D1Adapter: () => D1Adapter
@@ -35262,7 +35262,7 @@ var init_d12 = __esm(() => {
35262
35262
  init_runtime();
35263
35263
  });
35264
35264
 
35265
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/adapter.js
35265
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/adapter.js
35266
35266
  async function createDbAdapter(config3) {
35267
35267
  switch (config3.driver) {
35268
35268
  case "bun-sqlite": {
@@ -35296,7 +35296,7 @@ var init_drizzle_orm = __esm(() => {
35296
35296
  init_view_common();
35297
35297
  });
35298
35298
 
35299
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/query-spec.js
35299
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/query-spec.js
35300
35300
  function compilePredicate(predicate) {
35301
35301
  if ("and" in predicate) {
35302
35302
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -35334,7 +35334,7 @@ var init_query_spec = __esm(() => {
35334
35334
  };
35335
35335
  });
35336
35336
 
35337
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/base-dao.js
35337
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/base-dao.js
35338
35338
  function asSelectQuery(query) {
35339
35339
  return query;
35340
35340
  }
@@ -35376,7 +35376,7 @@ var init_base_dao = __esm(() => {
35376
35376
  init_query_spec();
35377
35377
  });
35378
35378
 
35379
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
35379
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
35380
35380
  var embeddedMigrations;
35381
35381
  var init_embedded_migrations = __esm(() => {
35382
35382
  embeddedMigrations = [
@@ -35418,7 +35418,7 @@ var init_embedded_migrations = __esm(() => {
35418
35418
  ];
35419
35419
  });
35420
35420
 
35421
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
35421
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
35422
35422
  var EntityDao;
35423
35423
  var init_entity_dao = __esm(() => {
35424
35424
  init_drizzle_orm();
@@ -35580,7 +35580,7 @@ var init_entity_dao = __esm(() => {
35580
35580
  };
35581
35581
  });
35582
35582
 
35583
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
35583
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
35584
35584
  function isPromiseLike(value) {
35585
35585
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
35586
35586
  }
@@ -35822,7 +35822,7 @@ var init_migrator2 = __esm(() => {
35822
35822
  init_migrator();
35823
35823
  });
35824
35824
 
35825
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/migrate.js
35825
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/migrate.js
35826
35826
  async function ensureJournalTable(adapter, table3) {
35827
35827
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
35828
35828
  }
@@ -35897,7 +35897,7 @@ var init_migrate = __esm(() => {
35897
35897
  init_embedded_migrations();
35898
35898
  });
35899
35899
 
35900
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
35900
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
35901
35901
  function assertValidTimeoutMs(value) {
35902
35902
  if (value === undefined || value === null)
35903
35903
  return;
@@ -36094,7 +36094,7 @@ var init_queue_job_dao = __esm(() => {
36094
36094
  };
36095
36095
  });
36096
36096
 
36097
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/index.js
36097
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/index.js
36098
36098
  var exports_dist = {};
36099
36099
  __export(exports_dist, {
36100
36100
  embeddedMigrations: () => embeddedMigrations,
@@ -38228,7 +38228,7 @@ var require_extra_typings = __commonJS((exports, module) => {
38228
38228
  exports.createArgument = (name, description) => new commander.Argument(name, description);
38229
38229
  });
38230
38230
 
38231
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/config.js
38231
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/config.js
38232
38232
  function parseYamlObject(text3) {
38233
38233
  let parsed;
38234
38234
  try {
@@ -38355,7 +38355,7 @@ var init_config2 = __esm(() => {
38355
38355
  };
38356
38356
  });
38357
38357
 
38358
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
38358
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
38359
38359
  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";
38360
38360
  import { dirname as dirname2, resolve as resolvePath3 } from "path";
38361
38361
  function createNodeFileSystem3(root, paths) {
@@ -38442,7 +38442,7 @@ function findProjectRoot3(startDir) {
38442
38442
  }
38443
38443
  var init_file_system_node2 = () => {};
38444
38444
 
38445
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
38445
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
38446
38446
  var D1NotConfiguredError2, DbModuleNotInstalledError3;
38447
38447
  var init_db_errors2 = __esm(() => {
38448
38448
  D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
@@ -38459,7 +38459,7 @@ var init_db_errors2 = __esm(() => {
38459
38459
  };
38460
38460
  });
38461
38461
 
38462
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
38462
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
38463
38463
  function createCfFileSystem2() {
38464
38464
  return {
38465
38465
  getProjectRoot: () => "/bundle",
@@ -38498,7 +38498,7 @@ function createCfFileSystem2() {
38498
38498
  }
38499
38499
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
38500
38500
 
38501
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
38501
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
38502
38502
  var exports_runtime_cf = {};
38503
38503
  __export(exports_runtime_cf, {
38504
38504
  cloudflareWorkersFactory: () => cloudflareWorkersFactory2
@@ -38536,7 +38536,7 @@ var init_runtime_cf = __esm(() => {
38536
38536
  };
38537
38537
  });
38538
38538
 
38539
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
38539
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
38540
38540
  import { isatty as isatty2 } from "tty";
38541
38541
  function processEventSeverity2(reason, exitCode) {
38542
38542
  if (reason === "error")
@@ -39044,7 +39044,7 @@ var init_process_executor2 = __esm(() => {
39044
39044
  ProcessExecutor2 = NodeProcessExecutor3;
39045
39045
  });
39046
39046
 
39047
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
39047
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
39048
39048
  var exports_runtime_node_bun = {};
39049
39049
  __export(exports_runtime_node_bun, {
39050
39050
  nodeBunFactory: () => nodeBunFactory3,
@@ -39112,7 +39112,7 @@ var init_runtime_node_bun2 = __esm(() => {
39112
39112
  };
39113
39113
  });
39114
39114
 
39115
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/platform.js
39115
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/platform.js
39116
39116
  function isCloudflareWorkerRuntime2() {
39117
39117
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
39118
39118
  }
@@ -39142,7 +39142,7 @@ function _resetRuntimeFactory2() {
39142
39142
  }
39143
39143
  var _factory, _runtimeName;
39144
39144
 
39145
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/context.js
39145
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/context.js
39146
39146
  class RuntimeContext2 {
39147
39147
  scope;
39148
39148
  runtimeName;
@@ -39232,7 +39232,7 @@ var init_context2 = __esm(() => {
39232
39232
  init_runtime_node_bun2();
39233
39233
  });
39234
39234
 
39235
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/path.js
39235
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/path.js
39236
39236
  function normalizeSeparators2(path7) {
39237
39237
  return path7.replaceAll("\\", "/");
39238
39238
  }
@@ -39355,7 +39355,7 @@ var init_path2 = __esm(() => {
39355
39355
  SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
39356
39356
  });
39357
39357
 
39358
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/fs.js
39358
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/fs.js
39359
39359
  async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
39360
39360
  await fs2.ensureDir(dirnamePath(path7));
39361
39361
  }
@@ -39423,7 +39423,7 @@ var init_fs = __esm(() => {
39423
39423
  init_path2();
39424
39424
  });
39425
39425
 
39426
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
39426
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
39427
39427
  function allocateId() {
39428
39428
  nextIdSeq += 1;
39429
39429
  return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
@@ -39547,7 +39547,7 @@ function createInMemoryProcessRegistry2(options) {
39547
39547
  }
39548
39548
  var nextIdSeq = 0;
39549
39549
 
39550
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
39550
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
39551
39551
  function ambientRuntimePaths2() {
39552
39552
  const cwd = getProcessCwd2();
39553
39553
  return { cwd, home: getHomeDir() ?? cwd };
@@ -39557,7 +39557,7 @@ var init_runtime_paths = __esm(() => {
39557
39557
  init_path2();
39558
39558
  });
39559
39559
 
39560
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
39560
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
39561
39561
  async function loadStructuredConfig(path7, options = {}) {
39562
39562
  const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
39563
39563
  return await parseStructuredConfig(content, path7, options);
@@ -39840,10 +39840,10 @@ var init_schema_validation2 = __esm(() => {
39840
39840
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
39841
39841
  });
39842
39842
 
39843
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/types.js
39843
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/types.js
39844
39844
  var init_types2 = () => {};
39845
39845
 
39846
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/index.js
39846
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/index.js
39847
39847
  var exports_dist2 = {};
39848
39848
  __export(exports_dist2, {
39849
39849
  writeJsonFile: () => writeJsonFile2,
@@ -42434,7 +42434,7 @@ var init_mod = __esm(() => {
42434
42434
  init_config3();
42435
42435
  });
42436
42436
 
42437
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/logger.js
42437
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/logger.js
42438
42438
  function toLogTapeLevel(level) {
42439
42439
  return level === "warn" ? "warning" : level;
42440
42440
  }
@@ -43987,7 +43987,7 @@ var require_src = __commonJS((exports) => {
43987
43987
  };
43988
43988
  });
43989
43989
 
43990
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
43990
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
43991
43991
  function getTelemetryConfig(configPartial = {}) {
43992
43992
  return {
43993
43993
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -44023,7 +44023,7 @@ var init_sdk = __esm(() => {
44023
44023
  resolvedConfig = getTelemetryConfig();
44024
44024
  });
44025
44025
 
44026
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
44026
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
44027
44027
  function isSuppressed(tracer2) {
44028
44028
  return tracer2 === undefined && !getResolvedConfig().enabled;
44029
44029
  }
@@ -44063,7 +44063,7 @@ var init_tracing2 = __esm(() => {
44063
44063
  import_api2 = __toESM(require_src(), 1);
44064
44064
  });
44065
44065
 
44066
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
44066
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
44067
44067
  function getMeter() {
44068
44068
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
44069
44069
  }
@@ -44160,7 +44160,7 @@ var init_metrics = __esm(() => {
44160
44160
  instruments = {};
44161
44161
  });
44162
44162
 
44163
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
44163
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
44164
44164
  function busLogger() {
44165
44165
  if (!_busLogger)
44166
44166
  _busLogger = getLogger2("event-bus");
@@ -44413,7 +44413,7 @@ var init_event_bus = __esm(() => {
44413
44413
  init_metrics();
44414
44414
  });
44415
44415
 
44416
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
44416
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
44417
44417
  function obsLogger() {
44418
44418
  if (!_obsLogger)
44419
44419
  _obsLogger = getLogger2("event-bus.observers");
@@ -44477,7 +44477,7 @@ var init_default_observers = __esm(() => {
44477
44477
  init_event_bus();
44478
44478
  });
44479
44479
 
44480
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
44480
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
44481
44481
  function parentDir(filePath) {
44482
44482
  const idx = filePath.lastIndexOf("/");
44483
44483
  return idx <= 0 ? "." : filePath.slice(0, idx);
@@ -44575,7 +44575,7 @@ var init_file_observer = __esm(() => {
44575
44575
  init_logger3();
44576
44576
  });
44577
44577
 
44578
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/execution-policy.js
44578
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/execution-policy.js
44579
44579
  function resolveExecutionTimeoutMs(scope, value, inherited) {
44580
44580
  if (value === undefined) {
44581
44581
  return inherited ?? null;
@@ -44652,7 +44652,7 @@ async function runWithExecutionDeadline(action, options) {
44652
44652
  return { outcome: "completed", result, elapsedMs, timedOut };
44653
44653
  }
44654
44654
 
44655
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
44655
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
44656
44656
  function settleWithin(promise2, deadline) {
44657
44657
  const remaining = deadline - Date.now();
44658
44658
  if (remaining <= 0)
@@ -54813,7 +54813,7 @@ END`;
54813
54813
  ];
54814
54814
  });
54815
54815
 
54816
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54816
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54817
54817
  var HistoryImportError, ImportCancelledError;
54818
54818
  var init_errors5 = __esm(() => {
54819
54819
  HistoryImportError = class HistoryImportError extends Error {
@@ -54834,7 +54834,7 @@ var init_errors5 = __esm(() => {
54834
54834
  };
54835
54835
  });
54836
54836
 
54837
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/cancellation.js
54837
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/cancellation.js
54838
54838
  function throwIfImportAborted(signal) {
54839
54839
  if (signal?.aborted) {
54840
54840
  throw new ImportCancelledError("Import cancelled by abort signal", signal.reason);
@@ -54844,7 +54844,7 @@ var init_cancellation = __esm(() => {
54844
54844
  init_errors5();
54845
54845
  });
54846
54846
 
54847
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54847
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54848
54848
  import { createHash as createHash3 } from "crypto";
54849
54849
  function stableJson(value) {
54850
54850
  if (Array.isArray(value)) {
@@ -54861,8 +54861,8 @@ function sha256(value) {
54861
54861
  }
54862
54862
  var init_hash = () => {};
54863
54863
 
54864
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54865
- var HISTORY_IMPORT_SCHEMA_VERSION = "0.4.69", HISTORY_IMPORT_SCHEMA_SQL;
54864
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54865
+ var HISTORY_IMPORT_SCHEMA_VERSION = "0.5.0", HISTORY_IMPORT_SCHEMA_SQL;
54866
54866
  var init_schema_sql = __esm(() => {
54867
54867
  HISTORY_IMPORT_SCHEMA_SQL = `
54868
54868
  CREATE TABLE IF NOT EXISTS history_import_checkpoint (
@@ -54984,7 +54984,7 @@ CREATE INDEX IF NOT EXISTS idx_history_skill_call_invocation_kind
54984
54984
  `.trim();
54985
54985
  });
54986
54986
 
54987
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
54987
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
54988
54988
  function identityFieldMap(keys) {
54989
54989
  const map2 = {};
54990
54990
  for (const key of keys) {
@@ -56622,7 +56622,7 @@ var init_mappers = __esm(() => {
56622
56622
  DSH_SCHEMA = passthroughSchema;
56623
56623
  });
56624
56624
 
56625
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
56625
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
56626
56626
  function firstString(...values) {
56627
56627
  for (const value of values) {
56628
56628
  if (typeof value === "string" && value.length > 0)
@@ -56783,7 +56783,7 @@ var init_sources = __esm(() => {
56783
56783
  };
56784
56784
  });
56785
56785
 
56786
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
56786
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
56787
56787
  function targetTableFor(table3) {
56788
56788
  if (!VALID_TABLE_NAME.test(table3)) {
56789
56789
  throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
@@ -57206,7 +57206,7 @@ var init_jsonl_importer_dao = __esm(() => {
57206
57206
  ARGS_TOOL_NAME_KEYS = ["tool", "tool_name", "toolName", "name", "command"];
57207
57207
  });
57208
57208
 
57209
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
57209
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
57210
57210
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
57211
57211
  if (typeof value === "string") {
57212
57212
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -57258,7 +57258,7 @@ var init_redaction = __esm(() => {
57258
57258
  ];
57259
57259
  });
57260
57260
 
57261
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/zstd.js
57261
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/zstd.js
57262
57262
  async function zstdDecompress(file2, env2) {
57263
57263
  const result = await new NodeProcessExecutor3().run({
57264
57264
  command: "zstd",
@@ -57278,7 +57278,7 @@ var init_zstd = __esm(() => {
57278
57278
  init_errors5();
57279
57279
  });
57280
57280
 
57281
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
57281
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
57282
57282
  function toolCallKey(source, sessionId, callId) {
57283
57283
  return `${source}${TOOL_CALL_KEY_SEP}${sessionId}${TOOL_CALL_KEY_SEP}${callId}`;
57284
57284
  }
@@ -57705,7 +57705,7 @@ var init_importer = __esm(() => {
57705
57705
  init_zstd();
57706
57706
  });
57707
57707
 
57708
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
57708
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
57709
57709
  async function runOpenCodeImport(options) {
57710
57710
  throwIfImportAborted(options.signal);
57711
57711
  const paths = options.paths ?? ambientRuntimePaths2();
@@ -57997,7 +57997,7 @@ var init_opencode_importer = __esm(() => {
57997
57997
  init_redaction();
57998
57998
  });
57999
57999
 
58000
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/tables.js
58000
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/tables.js
58001
58001
  var BOOKKEEPING_HISTORY_TABLES, IMPORTER_OWNED_TABLES;
58002
58002
  var init_tables = __esm(() => {
58003
58003
  init_jsonl_importer_dao();
@@ -58010,7 +58010,7 @@ var init_tables = __esm(() => {
58010
58010
  ];
58011
58011
  });
58012
58012
 
58013
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.69+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
58013
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.0+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
58014
58014
  var init_dist6 = __esm(() => {
58015
58015
  init_importer();
58016
58016
  init_mappers();
@@ -60921,7 +60921,7 @@ function observationIsNewer(leftAt, leftId, rightAt, rightId) {
60921
60921
  }
60922
60922
  var AGENT_EXECUTOR_UPDATE_COLUMNS = "project_id, executor_name, observation_id, observed_at, agent, model, disabled, owner, layer, skipped_reason, applied_observation_id, applied_at, attempts, retry_after, last_error";
60923
60923
 
60924
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
60924
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
60925
60925
  function sqlExpressionToText(value) {
60926
60926
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
60927
60927
  return;
@@ -60944,7 +60944,7 @@ function getDrizzleTableName(table3) {
60944
60944
  return String(table3[nameSym]);
60945
60945
  }
60946
60946
 
60947
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
60947
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
60948
60948
  function quoteIdent(name) {
60949
60949
  return `"${name.replace(/"/g, '""')}"`;
60950
60950
  }
@@ -61316,7 +61316,7 @@ var init_drizzle_zod = __esm(() => {
61316
61316
  };
61317
61317
  });
61318
61318
 
61319
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
61319
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
61320
61320
  function defineTable(name, columns2) {
61321
61321
  const table3 = sqliteTable(name, columns2);
61322
61322
  let insert2;
@@ -61350,7 +61350,7 @@ var init_define_table = __esm(() => {
61350
61350
  init_ddl();
61351
61351
  });
61352
61352
 
61353
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.69+05fbb1390ec7b1f8/node_modules/@gobing-ai/ts-db/dist/schema/index.js
61353
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.0+f83c6595be6598d8/node_modules/@gobing-ai/ts-db/dist/schema/index.js
61354
61354
  var exports_schema = {};
61355
61355
  __export(exports_schema, {
61356
61356
  text: () => text,
@@ -62267,7 +62267,7 @@ var init_dao = __esm(() => {
62267
62267
  init_workspace_dao();
62268
62268
  });
62269
62269
 
62270
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
62270
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
62271
62271
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
62272
62272
  var init_errors6 = __esm(() => {
62273
62273
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -62302,12 +62302,12 @@ var init_errors6 = __esm(() => {
62302
62302
  };
62303
62303
  });
62304
62304
 
62305
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
62305
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
62306
62306
  var init_event_bus2 = __esm(() => {
62307
62307
  init_event_bus();
62308
62308
  });
62309
62309
 
62310
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/api-client.js
62310
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/api-client.js
62311
62311
  function sanitizeUrlForObservability(url2) {
62312
62312
  try {
62313
62313
  const parsed = new URL(url2);
@@ -62538,12 +62538,12 @@ var init_api_client = __esm(() => {
62538
62538
  };
62539
62539
  });
62540
62540
 
62541
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
62541
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
62542
62542
  var init_telemetry = __esm(() => {
62543
62543
  init_tracing2();
62544
62544
  });
62545
62545
 
62546
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/index.js
62546
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/index.js
62547
62547
  var init_dist7 = __esm(() => {
62548
62548
  init_api_client();
62549
62549
  init_event_bus2();
@@ -62551,7 +62551,7 @@ var init_dist7 = __esm(() => {
62551
62551
  init_telemetry();
62552
62552
  });
62553
62553
 
62554
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
62554
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
62555
62555
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
62556
62556
  return {
62557
62557
  workflow: workflowName,
@@ -62728,15 +62728,6 @@ class RunLifecycle {
62728
62728
  });
62729
62729
  return this.result("paused", stateOrNodeId, transitionsTaken);
62730
62730
  }
62731
- emitResumed(node) {
62732
- addSpanEvent("workflow.run.resumed", { runId: this.runId, node });
62733
- this.events?.emit("workflow.run.resumed", {
62734
- runId: this.runId,
62735
- node,
62736
- externalKey: this.externalKey,
62737
- severity: "info"
62738
- });
62739
- }
62740
62731
  actionStart(stateOrNodeId, kind) {
62741
62732
  addSpanEvent("workflow.action.start", { runId: this.runId, node: stateOrNodeId, kind });
62742
62733
  this.events?.emit("workflow.action.start", {
@@ -62835,7 +62826,7 @@ var init_run_lifecycle = __esm(() => {
62835
62826
  ];
62836
62827
  });
62837
62828
 
62838
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
62829
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
62839
62830
  class CapabilityRegistry {
62840
62831
  kind;
62841
62832
  capabilities = new Map;
@@ -62866,7 +62857,7 @@ class CapabilityRegistry {
62866
62857
  }
62867
62858
  }
62868
62859
 
62869
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
62860
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
62870
62861
  function assertRelativeExtensionPath(path9, options = {}) {
62871
62862
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
62872
62863
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
@@ -62877,7 +62868,7 @@ function assertRelativeExtensionPath(path9, options = {}) {
62877
62868
  }
62878
62869
  }
62879
62870
 
62880
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
62871
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
62881
62872
  import { isAbsolute, resolve as resolve2 } from "path";
62882
62873
  async function loadExtensionModules(refs, options, register) {
62883
62874
  if (refs.length === 0)
@@ -62916,17 +62907,17 @@ async function loadExtensionModules(refs, options, register) {
62916
62907
  }
62917
62908
  var init_extension_loader = () => {};
62918
62909
 
62919
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
62910
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
62920
62911
  var init_extension = __esm(() => {
62921
62912
  init_extension_loader();
62922
62913
  });
62923
62914
 
62924
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.69+f504dfcd1d6bf912/node_modules/@gobing-ai/ts-runtime/dist/extension.js
62915
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.0+d0022131540a5533/node_modules/@gobing-ai/ts-runtime/dist/extension.js
62925
62916
  var init_extension2 = __esm(() => {
62926
62917
  init_extension();
62927
62918
  });
62928
62919
 
62929
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
62920
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
62930
62921
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, relativeExtensionPath, WorkflowExtensionsSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
62931
62922
  var init_schema2 = __esm(() => {
62932
62923
  init_extension2();
@@ -62987,7 +62978,8 @@ var init_schema2 = __esm(() => {
62987
62978
  description: exports_external.string().optional(),
62988
62979
  onEnter: exports_external.array(ActionDefSchema).optional(),
62989
62980
  onExit: exports_external.array(ActionDefSchema).optional(),
62990
- pause: exports_external.boolean().optional()
62981
+ pause: exports_external.boolean().optional(),
62982
+ resumeRerun: exports_external.boolean().optional()
62991
62983
  }).strict()),
62992
62984
  transitions: exports_external.array(exports_external.object({
62993
62985
  from: exports_external.string().min(1),
@@ -63015,7 +63007,8 @@ var init_schema2 = __esm(() => {
63015
63007
  description: exports_external.string().optional(),
63016
63008
  type: exports_external.enum(["action", "gate", "parallel", "decision"]).optional(),
63017
63009
  action: ActionDefSchema.optional(),
63018
- pause: exports_external.boolean().optional()
63010
+ pause: exports_external.boolean().optional(),
63011
+ resumeRerun: exports_external.boolean().optional()
63019
63012
  }).strict()),
63020
63013
  edges: exports_external.array(exports_external.object({
63021
63014
  from: exports_external.string().min(1),
@@ -63028,7 +63021,7 @@ var init_schema2 = __esm(() => {
63028
63021
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
63029
63022
  });
63030
63023
 
63031
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
63024
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
63032
63025
  async function loadWorkflowDef(path9, options = {}) {
63033
63026
  return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
63034
63027
  }
@@ -63195,7 +63188,7 @@ var init_config4 = __esm(() => {
63195
63188
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
63196
63189
  });
63197
63190
 
63198
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
63191
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
63199
63192
  function collectWorkflowExtensions(sourceName, sourceDir, extensions) {
63200
63193
  if (extensions === undefined)
63201
63194
  return [];
@@ -63259,7 +63252,7 @@ var init_extensions = __esm(() => {
63259
63252
  init_errors6();
63260
63253
  });
63261
63254
 
63262
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
63255
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
63263
63256
  class WorkflowEngineHost {
63264
63257
  lifecycleBus;
63265
63258
  actions = new CapabilityRegistry("workflow action");
@@ -63429,8 +63422,8 @@ var init_host = __esm(() => {
63429
63422
  init_errors6();
63430
63423
  });
63431
63424
 
63432
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
63433
- var WORKFLOW_ENGINE_SCHEMA_SQL;
63425
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
63426
+ var WORKFLOW_ENGINE_SCHEMA_SQL, WORKFLOW_ENGINE_MIGRATIONS_SQL;
63434
63427
  var init_schema_sql2 = __esm(() => {
63435
63428
  WORKFLOW_ENGINE_SCHEMA_SQL = `
63436
63429
  CREATE TABLE IF NOT EXISTS runs (
@@ -63444,7 +63437,10 @@ CREATE TABLE IF NOT EXISTS runs (
63444
63437
  completed_at TEXT,
63445
63438
  metadata_json TEXT NOT NULL DEFAULT '{}',
63446
63439
  created_at INTEGER NOT NULL DEFAULT 0,
63447
- updated_at INTEGER NOT NULL DEFAULT 0
63440
+ updated_at INTEGER NOT NULL DEFAULT 0,
63441
+ owner_attempt TEXT,
63442
+ owner_pid INTEGER,
63443
+ interrupt_reason TEXT
63448
63444
  );
63449
63445
 
63450
63446
  CREATE UNIQUE INDEX IF NOT EXISTS idx_runs_external_key
@@ -63499,16 +63495,32 @@ CREATE TABLE IF NOT EXISTS action_runs (
63499
63495
  updated_at INTEGER NOT NULL DEFAULT 0,
63500
63496
  FOREIGN KEY (run_id) REFERENCES runs(id)
63501
63497
  );
63498
+ `.trim();
63499
+ WORKFLOW_ENGINE_MIGRATIONS_SQL = `
63500
+ ALTER TABLE runs ADD COLUMN owner_attempt TEXT;
63501
+ ALTER TABLE runs ADD COLUMN owner_pid INTEGER;
63502
+ ALTER TABLE runs ADD COLUMN interrupt_reason TEXT;
63502
63503
  `.trim();
63503
63504
  });
63504
63505
 
63505
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
63506
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
63506
63507
  async function applyWorkflowEngineSchema(db2) {
63507
63508
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
63508
63509
  const sql4 = statement.trim();
63509
63510
  if (sql4.length > 0)
63510
63511
  await db2.exec(sql4);
63511
63512
  }
63513
+ for (const statement of WORKFLOW_ENGINE_MIGRATIONS_SQL.split(";")) {
63514
+ const sql4 = statement.trim();
63515
+ if (sql4.length === 0)
63516
+ continue;
63517
+ try {
63518
+ await db2.exec(sql4);
63519
+ } catch (error51) {
63520
+ if (!/duplicate column/i.test(String(error51)))
63521
+ throw error51;
63522
+ }
63523
+ }
63512
63524
  }
63513
63525
  function isRecord(value) {
63514
63526
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -63551,6 +63563,20 @@ class DbWorkflowPersistenceAdapter {
63551
63563
  async finalizeRun(runId, status, completedAt) {
63552
63564
  await this.db.run("UPDATE runs SET status = ?, completed_at = ?, updated_at = ? WHERE id = ?", status, completedAt, Date.now(), runId);
63553
63565
  }
63566
+ async claimRunOwnership(runId, owner, expectedStatuses) {
63567
+ await this.ensureSchema();
63568
+ const placeholders = expectedStatuses.map(() => "?").join(", ");
63569
+ await this.db.run(`UPDATE runs SET status = 'running', completed_at = NULL, owner_attempt = ?, owner_pid = ?, updated_at = ?
63570
+ WHERE id = ? AND status IN (${placeholders})`, owner.attemptId, owner.pid ?? null, Date.now(), runId, ...expectedStatuses);
63571
+ const run = await this.loadRun(runId);
63572
+ return run !== undefined && run.status === "running" && run.owner_attempt === owner.attemptId ? run : undefined;
63573
+ }
63574
+ async interruptRun(runId, reason) {
63575
+ await this.ensureSchema();
63576
+ await this.db.run("UPDATE runs SET status = 'interrupted', interrupt_reason = ?, completed_at = NULL, updated_at = ? WHERE id = ? AND status = 'running'", reason, Date.now(), runId);
63577
+ const run = await this.loadRun(runId);
63578
+ return run !== undefined && run.status === "interrupted" ? run : undefined;
63579
+ }
63554
63580
  async savePhase(runId, phase, status) {
63555
63581
  const op = this.phaseRow(runId, phase, status, Date.now());
63556
63582
  await this.db.run(op.sql, ...op.params);
@@ -63722,6 +63748,33 @@ class MemoryWorkflowPersistenceAdapter {
63722
63748
  if (run !== undefined)
63723
63749
  this.runs.set(runId, { ...run, status, completed_at: completedAt });
63724
63750
  }
63751
+ async claimRunOwnership(runId, owner, expectedStatuses) {
63752
+ const run = this.runs.get(runId);
63753
+ if (run === undefined || !expectedStatuses.includes(run.status)) {
63754
+ return;
63755
+ }
63756
+ const claimed = {
63757
+ ...run,
63758
+ status: "running",
63759
+ completed_at: null,
63760
+ owner_attempt: owner.attemptId,
63761
+ owner_pid: owner.pid ?? null
63762
+ };
63763
+ this.runs.set(runId, claimed);
63764
+ return claimed;
63765
+ }
63766
+ async interruptRun(runId, reason) {
63767
+ const run = this.runs.get(runId);
63768
+ if (run === undefined || run.status !== "running")
63769
+ return;
63770
+ const interrupted = {
63771
+ ...run,
63772
+ status: "interrupted",
63773
+ interrupt_reason: reason
63774
+ };
63775
+ this.runs.set(runId, interrupted);
63776
+ return interrupted;
63777
+ }
63725
63778
  actionRuns = [];
63726
63779
  async saveActionStart(runId, node, kind, _options) {
63727
63780
  const id = crypto.randomUUID();
@@ -63818,7 +63871,7 @@ var init_persistence = __esm(() => {
63818
63871
  init_schema_sql2();
63819
63872
  });
63820
63873
 
63821
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
63874
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
63822
63875
  function mergeVars(workflowVars = {}, overrideVars = {}) {
63823
63876
  return { ...workflowVars, ...overrideVars };
63824
63877
  }
@@ -63878,7 +63931,7 @@ var init_variables = __esm(() => {
63878
63931
  TEMPLATE_REF = /\$\{([^}]+)\}/g;
63879
63932
  });
63880
63933
 
63881
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
63934
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
63882
63935
  async function runActionStep(action, vars, deps) {
63883
63936
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
63884
63937
  const resolved = resolveTemplates(action.options ?? {}, {
@@ -63942,7 +63995,7 @@ var init_action_step = __esm(() => {
63942
63995
  init_variables();
63943
63996
  });
63944
63997
 
63945
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
63998
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
63946
63999
  class StateMachineDriver {
63947
64000
  options;
63948
64001
  constructor(options) {
@@ -63966,17 +64019,24 @@ class StateMachineDriver {
63966
64019
  let lastActionResult;
63967
64020
  const iterationBound = workflow.iterationBound ?? 50;
63968
64021
  const defaultOnError = workflow.defaultOnError;
63969
- let isResume = resumeFromState !== undefined;
64022
+ let resumeMode = resumeFromState !== undefined ? options.resumeMode ?? "skip-enter" : undefined;
63970
64023
  let persistedViaHop = false;
63971
64024
  if (current === undefined) {
63972
64025
  const label = resumeFromState ?? workflow.initialState;
63973
64026
  throw new FSMError(`State "${label}" is not declared`);
63974
64027
  }
63975
64028
  while (true) {
63976
- if (isResume) {
63977
- isResume = false;
64029
+ if (resumeMode === "skip-enter") {
64030
+ resumeMode = undefined;
63978
64031
  persistedViaHop = true;
63979
64032
  } else {
64033
+ if (resumeMode === "rerun-enter") {
64034
+ if (current.resumeRerun !== true) {
64035
+ throw new FSMError(`Cannot rerun-resume into state "${current.id}": not marked resumeRerun: true ` + '(mark its on-enter actions as safe to re-run, or resume with resumeMode: "skip-enter")');
64036
+ }
64037
+ resumeMode = undefined;
64038
+ persistedViaHop = true;
64039
+ }
63980
64040
  await lifecycle.enter(current.id, transitionsTaken, !persistedViaHop, vars);
63981
64041
  const enter = options.dryRun ? EMPTY_OUTCOME : await runActionSequence(current.onEnter ?? [], vars, {
63982
64042
  host: this.options.host,
@@ -64078,7 +64138,7 @@ var init_state_machine = __esm(() => {
64078
64138
  EMPTY_OUTCOME = { outcome: "completed", result: undefined, setVars: undefined };
64079
64139
  });
64080
64140
 
64081
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
64141
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
64082
64142
  class TransitionFlowDriver {
64083
64143
  options;
64084
64144
  constructor(options) {
@@ -64101,17 +64161,24 @@ class TransitionFlowDriver {
64101
64161
  let lastActionResult;
64102
64162
  const iterationBound = workflow.iterationBound ?? 50;
64103
64163
  const defaultOnError = workflow.defaultOnError;
64104
- let isResume = resumeFromNode !== undefined;
64164
+ let resumeMode = resumeFromNode !== undefined ? options.resumeMode ?? "skip-enter" : undefined;
64105
64165
  let persistedViaHop = false;
64106
64166
  if (current === undefined) {
64107
64167
  const label = resumeFromNode ?? workflow.initialNode;
64108
64168
  throw new FSMError(`Node "${label}" is not declared`);
64109
64169
  }
64110
64170
  while (true) {
64111
- if (isResume) {
64112
- isResume = false;
64171
+ if (resumeMode === "skip-enter") {
64172
+ resumeMode = undefined;
64113
64173
  persistedViaHop = true;
64114
64174
  } else {
64175
+ if (resumeMode === "rerun-enter") {
64176
+ if (current.resumeRerun !== true) {
64177
+ throw new FSMError(`Cannot rerun-resume into node "${current.id}": not marked resumeRerun: true ` + '(mark its action as safe to re-run, or resume with resumeMode: "skip-enter")');
64178
+ }
64179
+ resumeMode = undefined;
64180
+ persistedViaHop = true;
64181
+ }
64115
64182
  await lifecycle.enter(current.id, transitionsTaken, !persistedViaHop, vars);
64116
64183
  if (options.dryRun) {
64117
64184
  if (current.action !== undefined) {
@@ -64197,7 +64264,7 @@ var init_transition_flow = __esm(() => {
64197
64264
  init_variables();
64198
64265
  });
64199
64266
 
64200
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
64267
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
64201
64268
  class WorkflowService {
64202
64269
  host;
64203
64270
  persistence;
@@ -64281,23 +64348,32 @@ class WorkflowService {
64281
64348
  if (run === undefined) {
64282
64349
  throw new WorkflowResumeError(`Run "${runId}" not found`);
64283
64350
  }
64284
- if (run.status !== "paused") {
64285
- throw new WorkflowResumeError(`Run "${runId}" is not paused (status: ${run.status})`);
64351
+ if (run.status !== "paused" && run.status !== "interrupted") {
64352
+ throw new WorkflowResumeError(`Run "${runId}" is not resumable (status: ${run.status})`);
64286
64353
  }
64287
64354
  const currentState = await this.persistence.loadCurrentState(runId);
64288
64355
  if (currentState === undefined) {
64289
64356
  throw new WorkflowResumeError(`Run "${runId}" has no persisted state to resume from`);
64290
64357
  }
64358
+ const resumeMode = options?.resumeMode ?? (run.status === "interrupted" ? "rerun-enter" : "skip-enter");
64359
+ this.assertResumeRerunAllowed(workflow, currentState, resumeMode);
64291
64360
  const snapshot = await this.persistence.loadLatestStateSnapshot(runId);
64292
64361
  const persistedVars = extractEffectiveVars(snapshot?.data);
64293
64362
  const restoredVars = mergeVars(persistedVars, options?.vars);
64294
- const mergedOptions = { ...options, vars: restoredVars };
64295
- const extKey = run.external_key ?? undefined;
64296
- await this.persistence.finalizeRun(runId, "running", "");
64363
+ const owner = options?.resumeOwner ?? { attemptId: crypto.randomUUID() };
64364
+ const mergedOptions = { ...options, vars: restoredVars, resumeMode };
64365
+ const claimed = await this.persistence.claimRunOwnership(runId, owner, ["paused", "interrupted"]);
64366
+ if (claimed === undefined) {
64367
+ const current = await this.persistence.loadRun(runId);
64368
+ throw new WorkflowResumeError(`Run "${runId}" could not be claimed for resume ` + `(status: ${current?.status ?? "unknown"}, owner: ${current?.owner_attempt ?? "none"})`);
64369
+ }
64370
+ const extKey = claimed.external_key ?? undefined;
64297
64371
  const events = this.resolveEvents(mergedOptions.events);
64298
64372
  events?.emit("workflow.run.resumed", {
64299
64373
  runId,
64300
64374
  node: currentState,
64375
+ resumeMode,
64376
+ ownerAttemptId: owner.attemptId,
64301
64377
  externalKey: extKey,
64302
64378
  severity: "info"
64303
64379
  });
@@ -64312,6 +64388,27 @@ class WorkflowService {
64312
64388
  persistence: this.persistence
64313
64389
  }).resume(workflow, runId, currentState, extKey, mergedOptions);
64314
64390
  }
64391
+ async interruptRun(runId, reason) {
64392
+ const interrupted = await this.persistence.interruptRun(runId, reason);
64393
+ if (interrupted !== undefined) {
64394
+ const events = this.resolveEvents(undefined);
64395
+ events?.emit("workflow.run.interrupted", {
64396
+ runId,
64397
+ reason,
64398
+ externalKey: interrupted.external_key ?? undefined,
64399
+ severity: "warning"
64400
+ });
64401
+ }
64402
+ return interrupted;
64403
+ }
64404
+ assertResumeRerunAllowed(workflow, currentState, resumeMode) {
64405
+ if (resumeMode !== "rerun-enter")
64406
+ return;
64407
+ const node = workflow.kind === "transition-flow" ? workflow.nodes.find((candidate) => candidate.id === currentState) : workflow.states.find((candidate) => candidate.id === currentState);
64408
+ if (node !== undefined && node.resumeRerun !== true) {
64409
+ throw new FSMError(`Cannot rerun-resume into "${currentState}": not marked resumeRerun: true ` + '(mark its actions as safe to re-run \u2014 idempotent or deduped by runId+state \u2014 or resume with resumeMode: "skip-enter")');
64410
+ }
64411
+ }
64315
64412
  async listPausedRuns(options) {
64316
64413
  return await this.persistence.listPausedRuns(options);
64317
64414
  }
@@ -64422,7 +64519,7 @@ var init_service = __esm(() => {
64422
64519
  init_variables();
64423
64520
  });
64424
64521
 
64425
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
64522
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
64426
64523
  var init_dist8 = __esm(() => {
64427
64524
  init_config4();
64428
64525
  init_extensions();
@@ -64432,7 +64529,7 @@ var init_dist8 = __esm(() => {
64432
64529
  init_service();
64433
64530
  });
64434
64531
 
64435
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
64532
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
64436
64533
  function collectExtensions(sourceName, sourceDir, extensions) {
64437
64534
  if (extensions === undefined)
64438
64535
  return [];
@@ -64446,7 +64543,7 @@ function collectExtensions(sourceName, sourceDir, extensions) {
64446
64543
  }
64447
64544
  var init_extensions2 = () => {};
64448
64545
 
64449
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
64546
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
64450
64547
  function createFinding(rule, message, filePath, extras = {}) {
64451
64548
  return {
64452
64549
  ruleId: rule.id,
@@ -64517,7 +64614,7 @@ var init_types3 = __esm(() => {
64517
64614
  });
64518
64615
  });
64519
64616
 
64520
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
64617
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
64521
64618
  async function loadPreset(name, options) {
64522
64619
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
64523
64620
  const presetPath = findMergedPreset(merged, name);
@@ -64732,7 +64829,7 @@ var init_loader2 = __esm(() => {
64732
64829
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
64733
64830
  });
64734
64831
 
64735
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
64832
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
64736
64833
  function normalizeFindingPath(filePath) {
64737
64834
  if (!filePath || isAbsolutePath2(filePath))
64738
64835
  return null;
@@ -64797,7 +64894,7 @@ var init_test_stub_fixer = __esm(() => {
64797
64894
  realFileSystem = createNodeFileSystem3();
64798
64895
  });
64799
64896
 
64800
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
64897
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
64801
64898
  function registerBuiltinFixers(host, exec) {
64802
64899
  const regexFixer = new RegexFixerProvider;
64803
64900
  const pathFixer = new PathFixerProvider;
@@ -65000,7 +65097,7 @@ var init_fixers = __esm(() => {
65000
65097
  };
65001
65098
  });
65002
65099
 
65003
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
65100
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
65004
65101
  function getAgentSessionCapability(agent) {
65005
65102
  return AGENT_SESSION_CAPABILITY[agent];
65006
65103
  }
@@ -65405,7 +65502,7 @@ var init_shims = __esm(() => {
65405
65502
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
65406
65503
  });
65407
65504
 
65408
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
65505
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
65409
65506
  function buildIdentityPreamble(ctx) {
65410
65507
  const sections = [
65411
65508
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -65481,7 +65578,7 @@ var init_identity = __esm(() => {
65481
65578
  init_dist5();
65482
65579
  });
65483
65580
 
65484
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/quota.js
65581
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/quota.js
65485
65582
  import { createHash as createHash4 } from "crypto";
65486
65583
  function classifyQuotaErrorRecord(record2) {
65487
65584
  const bounded = record2.length > MAX_QUOTA_EVIDENCE_BYTES ? record2.slice(-MAX_QUOTA_EVIDENCE_BYTES) : record2;
@@ -65582,7 +65679,7 @@ var init_quota = __esm(() => {
65582
65679
  ]);
65583
65680
  });
65584
65681
 
65585
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
65682
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
65586
65683
  function isClaudeStyleSlashCommand(input) {
65587
65684
  return SLASH_COMMAND_RE2.test(input);
65588
65685
  }
@@ -65610,7 +65707,7 @@ var init_slash_command = __esm(() => {
65610
65707
  SLASH_COMMAND_RE2 = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
65611
65708
  });
65612
65709
 
65613
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
65710
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
65614
65711
  function buildCorrelationEnv(correlation) {
65615
65712
  return {
65616
65713
  [AGENT_RUN_ID_ENV]: correlation.runId,
@@ -65770,7 +65867,7 @@ var init_ai_runner = __esm(() => {
65770
65867
  init_slash_command();
65771
65868
  });
65772
65869
 
65773
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
65870
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
65774
65871
  class AgentDetector {
65775
65872
  runner;
65776
65873
  timeout;
@@ -65846,7 +65943,7 @@ var init_agent_detector = __esm(() => {
65846
65943
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
65847
65944
  });
65848
65945
 
65849
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
65946
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
65850
65947
  function validateAgentId(id) {
65851
65948
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
65852
65949
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -65945,7 +66042,7 @@ var init_agent_spec = __esm(() => {
65945
66042
  };
65946
66043
  });
65947
66044
 
65948
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
66045
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
65949
66046
  function isNonEmpty(value) {
65950
66047
  return value !== undefined && value.trim().length > 0;
65951
66048
  }
@@ -66070,7 +66167,7 @@ var init_auth_shims = __esm(() => {
66070
66167
  };
66071
66168
  });
66072
66169
 
66073
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
66170
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
66074
66171
  class ModelHealthProbeRegistry {
66075
66172
  probes = new Map;
66076
66173
  register(providerPrefix, probe) {
@@ -66194,7 +66291,7 @@ var init_model_health_probe = __esm(() => {
66194
66291
  };
66195
66292
  });
66196
66293
 
66197
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
66294
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
66198
66295
  class DoctorRunner {
66199
66296
  detector;
66200
66297
  runner;
@@ -66334,15 +66431,15 @@ var init_doctor_runner = __esm(() => {
66334
66431
  init_model_health_probe();
66335
66432
  });
66336
66433
 
66337
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
66434
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
66338
66435
  var init_events = () => {};
66339
66436
 
66340
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
66437
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
66341
66438
  function formatMessage(msg) {
66342
66439
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
66343
66440
  }
66344
66441
 
66345
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
66442
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
66346
66443
  import { Buffer as Buffer5 } from "buffer";
66347
66444
 
66348
66445
  class TeamAgentProcess {
@@ -66509,7 +66606,7 @@ var init_team_agent_process = __esm(() => {
66509
66606
  init_quota();
66510
66607
  });
66511
66608
 
66512
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
66609
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
66513
66610
  class TeamOrchestrator {
66514
66611
  configDir;
66515
66612
  inbox;
@@ -66650,7 +66747,7 @@ var init_team_orchestrator = __esm(() => {
66650
66747
  init_team_agent_process();
66651
66748
  });
66652
66749
 
66653
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.69+2e18240a83d8b4d9/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
66750
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.0+5b0af428ade73509/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
66654
66751
  var exports_dist3 = {};
66655
66752
  __export(exports_dist3, {
66656
66753
  validateAgentId: () => validateAgentId,
@@ -66710,7 +66807,7 @@ var init_dist9 = __esm(() => {
66710
66807
  init_team_orchestrator();
66711
66808
  });
66712
66809
 
66713
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
66810
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
66714
66811
  function stringArray(value) {
66715
66812
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
66716
66813
  }
@@ -66748,7 +66845,7 @@ function parseInlineFlags(source) {
66748
66845
  return { flags, rest: source.slice(match[0].length) };
66749
66846
  }
66750
66847
 
66751
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
66848
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
66752
66849
  function matchesAny(path9, patterns) {
66753
66850
  if (patterns === undefined || patterns.length === 0)
66754
66851
  return true;
@@ -66796,7 +66893,7 @@ function escapeRegExp(value) {
66796
66893
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
66797
66894
  }
66798
66895
 
66799
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
66896
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
66800
66897
  async function discoverFiles2(options) {
66801
66898
  const fs3 = options.fs ?? createNodeFileSystem3();
66802
66899
  const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -66827,12 +66924,12 @@ var init_file_discovery = __esm(() => {
66827
66924
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
66828
66925
  });
66829
66926
 
66830
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
66927
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
66831
66928
  var init_file_utils = __esm(() => {
66832
66929
  init_file_discovery();
66833
66930
  });
66834
66931
 
66835
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
66932
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
66836
66933
  class AgentDetectionEvaluator {
66837
66934
  detector;
66838
66935
  constructor(detector = new AgentDetector) {
@@ -66860,7 +66957,7 @@ var init_agent_detection_evaluator = __esm(() => {
66860
66957
  init_file_utils();
66861
66958
  });
66862
66959
 
66863
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
66960
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
66864
66961
  class CoverageGateEvaluator {
66865
66962
  constructor() {}
66866
66963
  async evaluate(rule, context4) {
@@ -66944,7 +67041,7 @@ var init_coverage_gate_evaluator = __esm(() => {
66944
67041
  init_file_utils();
66945
67042
  });
66946
67043
 
66947
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
67044
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
66948
67045
  class ExitCodeEvaluator {
66949
67046
  executor;
66950
67047
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -66980,7 +67077,7 @@ var init_exit_code_evaluator = __esm(() => {
66980
67077
  init_file_utils();
66981
67078
  });
66982
67079
 
66983
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
67080
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
66984
67081
  class ForbiddenImportEvaluator {
66985
67082
  constructor() {}
66986
67083
  async evaluate(rule, context4) {
@@ -67061,7 +67158,7 @@ var init_forbidden_import_evaluator = __esm(() => {
67061
67158
  init_file_utils();
67062
67159
  });
67063
67160
 
67064
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
67161
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
67065
67162
  class ImportBoundaryEvaluator {
67066
67163
  async evaluate(rule, context4) {
67067
67164
  const config4 = rule.evaluator.config ?? {};
@@ -67154,7 +67251,7 @@ var init_import_boundary_evaluator = __esm(() => {
67154
67251
  init_file_utils();
67155
67252
  });
67156
67253
 
67157
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
67254
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
67158
67255
  class PathEvaluator {
67159
67256
  constructor() {}
67160
67257
  async evaluate(rule, context4) {
@@ -67215,7 +67312,7 @@ var init_path_evaluator = __esm(() => {
67215
67312
  init_file_utils();
67216
67313
  });
67217
67314
 
67218
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
67315
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
67219
67316
  class RegexEvaluator {
67220
67317
  constructor() {}
67221
67318
  async evaluate(rule, context4) {
@@ -67293,7 +67390,7 @@ var init_regex_evaluator = __esm(() => {
67293
67390
  init_file_utils();
67294
67391
  });
67295
67392
 
67296
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
67393
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
67297
67394
  class RipgrepEvaluator {
67298
67395
  executor;
67299
67396
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -67386,7 +67483,7 @@ var init_ripgrep_evaluator = __esm(() => {
67386
67483
  init_file_utils();
67387
67484
  });
67388
67485
 
67389
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
67486
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
67390
67487
  class SchemaArtifactEvaluator {
67391
67488
  constructor() {}
67392
67489
  async evaluate(rule, context4) {
@@ -67464,7 +67561,7 @@ var init_schema_artifact_evaluator = __esm(() => {
67464
67561
  init_file_utils();
67465
67562
  });
67466
67563
 
67467
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
67564
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
67468
67565
  class SecretsScannerEvaluator {
67469
67566
  constructor() {}
67470
67567
  async evaluate(rule, context4) {
@@ -67532,7 +67629,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
67532
67629
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
67533
67630
  });
67534
67631
 
67535
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
67632
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
67536
67633
  class SgEvaluator {
67537
67634
  executor;
67538
67635
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -67629,7 +67726,7 @@ var init_sg_evaluator = __esm(() => {
67629
67726
  init_file_utils();
67630
67727
  });
67631
67728
 
67632
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
67729
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
67633
67730
  class TypeScriptTestPathResolver {
67634
67731
  name = "typescript";
67635
67732
  constructor() {}
@@ -67712,7 +67809,7 @@ function testify(rel) {
67712
67809
  return `${dir}test_${base2}`;
67713
67810
  }
67714
67811
 
67715
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
67812
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
67716
67813
  class TestLocationEvaluator {
67717
67814
  resolvers;
67718
67815
  constructor(resolvers) {
@@ -67787,7 +67884,7 @@ var init_test_location_evaluator = __esm(() => {
67787
67884
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
67788
67885
  });
67789
67886
 
67790
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
67887
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
67791
67888
  class TsdocExportEvaluator {
67792
67889
  constructor() {}
67793
67890
  async evaluate(rule, context4) {
@@ -67872,7 +67969,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
67872
67969
  };
67873
67970
  });
67874
67971
 
67875
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
67972
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
67876
67973
  class JsonFormatter {
67877
67974
  constructor() {}
67878
67975
  format(result) {
@@ -67880,7 +67977,7 @@ class JsonFormatter {
67880
67977
  }
67881
67978
  }
67882
67979
 
67883
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
67980
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
67884
67981
  class TextFormatter {
67885
67982
  constructor() {}
67886
67983
  format(result) {
@@ -67894,7 +67991,7 @@ class TextFormatter {
67894
67991
  }
67895
67992
  }
67896
67993
 
67897
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
67994
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
67898
67995
  function registerBuiltins(host, executor) {
67899
67996
  const path9 = new PathEvaluator;
67900
67997
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -67934,7 +68031,7 @@ var init_builtins = __esm(() => {
67934
68031
  init_tsdoc_export_evaluator();
67935
68032
  });
67936
68033
 
67937
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
68034
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
67938
68035
  class RuleEngineHost {
67939
68036
  evaluators;
67940
68037
  formatters;
@@ -67951,7 +68048,7 @@ var init_rule_engine_host = __esm(() => {
67951
68048
  init_extension2();
67952
68049
  });
67953
68050
 
67954
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
68051
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
67955
68052
  class RuleEngine {
67956
68053
  host;
67957
68054
  events;
@@ -68137,7 +68234,7 @@ var init_engine = __esm(() => {
68137
68234
  init_types3();
68138
68235
  });
68139
68236
 
68140
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
68237
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
68141
68238
  async function bundledRulesRoot() {
68142
68239
  if (cachedRoot2 !== undefined)
68143
68240
  return cachedRoot2;
@@ -68188,7 +68285,7 @@ var init_bundled_rules = __esm(() => {
68188
68285
  init_dist5();
68189
68286
  });
68190
68287
 
68191
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
68288
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
68192
68289
  class DbRulePersistenceAdapter {
68193
68290
  db;
68194
68291
  constructor(db2) {
@@ -68222,7 +68319,7 @@ class DbRulePersistenceAdapter {
68222
68319
  }
68223
68320
  }
68224
68321
 
68225
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
68322
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
68226
68323
  var RULE_ENGINE_SCHEMA_SQL = `
68227
68324
  CREATE TABLE IF NOT EXISTS rule_runs (
68228
68325
  id TEXT PRIMARY KEY,
@@ -68268,10 +68365,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
68268
68365
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
68269
68366
  `;
68270
68367
 
68271
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
68368
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
68272
68369
  var init_persistence2 = () => {};
68273
68370
 
68274
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.69+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
68371
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.0+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
68275
68372
  var init_dist10 = __esm(() => {
68276
68373
  init_extensions2();
68277
68374
  init_loader2();
@@ -69419,7 +69516,7 @@ ${HISTORY_TASK_SESSION_SCHEMA_SQL}
69419
69516
  ];
69420
69517
  });
69421
69518
 
69422
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
69519
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
69423
69520
  function queueLogger() {
69424
69521
  if (!_queueLogger)
69425
69522
  _queueLogger = getLogger2("job-queue");
@@ -69822,7 +69919,7 @@ var init_db_job_queue = __esm(() => {
69822
69919
  init_tracing2();
69823
69920
  });
69824
69921
 
69825
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
69922
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
69826
69923
  var exports_job_queue_db = {};
69827
69924
  __export(exports_job_queue_db, {
69828
69925
  DBQueueConsumer: () => DBQueueConsumer,
@@ -73204,6 +73301,12 @@ class ObservableWorkflowAdapter {
73204
73301
  severity: status === "failed" ? "error" : status === "paused" ? "warning" : "info"
73205
73302
  });
73206
73303
  }
73304
+ async claimRunOwnership(runId, owner, expectedStatuses) {
73305
+ return this.inner.claimRunOwnership(runId, owner, expectedStatuses);
73306
+ }
73307
+ async interruptRun(runId, reason) {
73308
+ return this.inner.interruptRun(runId, reason);
73309
+ }
73207
73310
  async savePhase(runId, phase, status) {
73208
73311
  await this.inner.savePhase(runId, phase, status);
73209
73312
  await this.bus.emit("workflow.phase", { ...this.envelope(runId), phase, status });
@@ -84656,7 +84759,7 @@ class MockHistoryBoardService {
84656
84759
  filterSessions(filter) {
84657
84760
  if (!filter)
84658
84761
  return this.sessions;
84659
- const now2 = new Date("2026-08-21T20:00:00.000Z").getTime();
84762
+ const now2 = MOCK_NOW;
84660
84763
  let minTime = 0;
84661
84764
  let maxTime = Number.POSITIVE_INFINITY;
84662
84765
  if (filter.range === "1h") {
@@ -84983,7 +85086,7 @@ class MockHistoryBoardService {
84983
85086
  };
84984
85087
  }
84985
85088
  buildKpiTrend(sessions) {
84986
- const end = new Date;
85089
+ const end = new Date(MOCK_NOW);
84987
85090
  end.setUTCHours(0, 0, 0, 0);
84988
85091
  const byDay = new Map;
84989
85092
  for (const s3 of sessions) {
@@ -85563,7 +85666,7 @@ System components and dataflow...`,
85563
85666
  };
85564
85667
  }
85565
85668
  }
85566
- var SOURCES_CATALOG, MODELS_CATALOG, TOOLS_CATALOG, SKILLS_CATALOG;
85669
+ var SOURCES_CATALOG, MODELS_CATALOG, TOOLS_CATALOG, SKILLS_CATALOG, MOCK_NOW;
85567
85670
  var init_history_board_mock_service = __esm(() => {
85568
85671
  SOURCES_CATALOG = [
85569
85672
  {
@@ -85680,6 +85783,7 @@ var init_history_board_mock_service = __esm(() => {
85680
85783
  { id: "sp-dev-run", label: "Sp Dev Run", color: "#199e70" },
85681
85784
  { id: "sp-code-verification", label: "Sp Code Verification", color: "#c98500" }
85682
85785
  ];
85786
+ MOCK_NOW = new Date("2026-08-21T20:00:00.000Z").getTime();
85683
85787
  });
85684
85788
 
85685
85789
  // ../../packages/app/src/services/history-board-service.ts
@@ -88849,6 +88953,12 @@ class WorkflowActionTraceWriter {
88849
88953
  async finalizeRun(runId, status, completedAt) {
88850
88954
  return this.inner.finalizeRun(runId, status, completedAt);
88851
88955
  }
88956
+ async claimRunOwnership(runId, owner, expectedStatuses) {
88957
+ return this.inner.claimRunOwnership(runId, owner, expectedStatuses);
88958
+ }
88959
+ async interruptRun(runId, reason) {
88960
+ return this.inner.interruptRun(runId, reason);
88961
+ }
88852
88962
  async recordAction(boundary2) {
88853
88963
  const start = await this.guard("action.start", { runId: boundary2.runId, node: boundary2.node, kind: boundary2.kind }, () => this.inner.saveActionStart(boundary2.runId, boundary2.node, boundary2.kind));
88854
88964
  if (!start.ok)
@@ -91841,6 +91951,38 @@ var init_run_artifact = __esm(() => {
91841
91951
  });
91842
91952
 
91843
91953
  // ../../packages/app/src/workflow/actions/shell.ts
91954
+ function isRecord4(value) {
91955
+ return typeof value === "object" && value !== null && !Array.isArray(value);
91956
+ }
91957
+ function utf8SafeByteTail(value, maxBytes) {
91958
+ const bytes = Buffer.from(value, "utf8");
91959
+ if (bytes.byteLength <= maxBytes)
91960
+ return { tail: value, truncated: false };
91961
+ let start = bytes.byteLength - maxBytes;
91962
+ while (start < bytes.length && ((bytes[start] ?? 0) & 192) === 128)
91963
+ start += 1;
91964
+ return { tail: bytes.subarray(start).toString("utf8"), truncated: true };
91965
+ }
91966
+ function createShellOutputRedactor(secrets) {
91967
+ return (kind, payload) => {
91968
+ if (kind !== KIND15)
91969
+ return payload;
91970
+ const data = payload.data;
91971
+ if (!isRecord4(data))
91972
+ return payload;
91973
+ const next = { ...data };
91974
+ for (const stream of ["stdout", "stderr"]) {
91975
+ const value = data[stream];
91976
+ if (typeof value !== "string")
91977
+ continue;
91978
+ const redacted = redactAndBound(value, secrets, Number.MAX_SAFE_INTEGER);
91979
+ const { tail: tail2, truncated } = utf8SafeByteTail(redacted, SHELL_OUTPUT_TAIL_BYTES);
91980
+ next[stream] = tail2;
91981
+ next[`${stream}Truncated`] = truncated;
91982
+ }
91983
+ return { ...payload, data: next };
91984
+ };
91985
+ }
91844
91986
  function stringOption3(options, key2, fallback) {
91845
91987
  const value = options[key2];
91846
91988
  if (typeof value === "string")
@@ -91861,10 +92003,12 @@ function arrayOption2(options, key2) {
91861
92003
  class StreamingShellActionRunner {
91862
92004
  processExecutor;
91863
92005
  observabilityBus;
92006
+ secrets;
91864
92007
  kind = KIND15;
91865
- constructor(processExecutor, observabilityBus) {
92008
+ constructor(processExecutor, observabilityBus, secrets = []) {
91866
92009
  this.processExecutor = processExecutor;
91867
92010
  this.observabilityBus = observabilityBus;
92011
+ this.secrets = secrets;
91868
92012
  }
91869
92013
  async execute(options, context4) {
91870
92014
  const command = stringOption3(options, "command");
@@ -91881,7 +92025,25 @@ class StreamingShellActionRunner {
91881
92025
  });
91882
92026
  let stdout = "";
91883
92027
  let stderr = "";
92028
+ const carryFor = { stdout: "", stderr: "" };
91884
92029
  const readers = [];
92030
+ const emitChunk = (stream, text4) => {
92031
+ if (this.observabilityBus === undefined || text4 === "")
92032
+ return;
92033
+ const event = {
92034
+ schemaVersion: 1,
92035
+ eventId: crypto.randomUUID(),
92036
+ sequence: 0,
92037
+ runId: context4.runId,
92038
+ at: new Date().toISOString(),
92039
+ kind: KIND15,
92040
+ node: context4.stateOrNodeId,
92041
+ stream,
92042
+ chunk: bounded(text4),
92043
+ severity: "info"
92044
+ };
92045
+ this.observabilityBus.emit("workflow.action.output", event);
92046
+ };
91885
92047
  const consume = (stream, readable2) => {
91886
92048
  if (readable2 === null)
91887
92049
  return;
@@ -91899,42 +92061,22 @@ class StreamingShellActionRunner {
91899
92061
  stdout += chunk;
91900
92062
  else
91901
92063
  stderr += chunk;
91902
- if (this.observabilityBus !== undefined) {
91903
- const event = {
91904
- schemaVersion: 1,
91905
- eventId: crypto.randomUUID(),
91906
- sequence: 0,
91907
- runId: context4.runId,
91908
- at: new Date().toISOString(),
91909
- kind: KIND15,
91910
- node: context4.stateOrNodeId,
91911
- stream,
91912
- chunk: bounded(chunk),
91913
- severity: "info"
91914
- };
91915
- this.observabilityBus.emit("workflow.action.output", event);
91916
- }
91917
- }
91918
- const tail2 = decoder.decode();
92064
+ const combined = carryFor[stream] + chunk;
92065
+ const { ready, carry } = redactStreamingValue(combined, this.secrets);
92066
+ carryFor[stream] = carry;
92067
+ emitChunk(stream, ready);
92068
+ }
92069
+ const decodedTail = decoder.decode();
92070
+ if (stream === "stdout")
92071
+ stdout += decodedTail;
92072
+ else
92073
+ stderr += decodedTail;
92074
+ const tail2 = carryFor[stream] + decodedTail;
92075
+ carryFor[stream] = "";
91919
92076
  if (tail2 !== "") {
91920
- if (stream === "stdout")
91921
- stdout += tail2;
91922
- else
91923
- stderr += tail2;
91924
- if (this.observabilityBus !== undefined) {
91925
- this.observabilityBus.emit("workflow.action.output", {
91926
- schemaVersion: 1,
91927
- eventId: crypto.randomUUID(),
91928
- sequence: 0,
91929
- runId: context4.runId,
91930
- at: new Date().toISOString(),
91931
- kind: KIND15,
91932
- node: context4.stateOrNodeId,
91933
- stream,
91934
- chunk: bounded(tail2),
91935
- severity: "info"
91936
- });
91937
- }
92077
+ const { ready, carry } = redactStreamingValue(tail2, this.secrets);
92078
+ emitChunk(stream, ready);
92079
+ emitChunk(stream, redactAndBound(carry, this.secrets, Number.MAX_SAFE_INTEGER));
91938
92080
  }
91939
92081
  })());
91940
92082
  };
@@ -91949,8 +92091,9 @@ class StreamingShellActionRunner {
91949
92091
  };
91950
92092
  }
91951
92093
  }
91952
- var KIND15 = "shell";
92094
+ var KIND15 = "shell", SHELL_OUTPUT_TAIL_BYTES = 65536;
91953
92095
  var init_shell = __esm(() => {
92096
+ init_agent_execution();
91954
92097
  init_observability();
91955
92098
  init_child_env();
91956
92099
  });
@@ -92034,7 +92177,7 @@ var init_shell2 = __esm(() => {
92034
92177
  function registerSpurBuiltins(host, options) {
92035
92178
  const fileSystem = options.fileSystem ?? createNodeFileSystem3();
92036
92179
  host.registerAction(new AgentRunActionRunner(options.agentService, options.observabilityBus, options.steeringController, options.agentConfig), "builtin");
92037
- host.registerAction(new StreamingShellActionRunner(options.processExecutor ?? new NodeProcessExecutor3, options.observabilityBus), "builtin");
92180
+ host.registerAction(new StreamingShellActionRunner(options.processExecutor ?? new NodeProcessExecutor3, options.observabilityBus, options.secretValues ?? []), "builtin");
92038
92181
  host.registerGuard(new EnvShellGuardRunner(options.processExecutor ?? new NodeProcessExecutor3), "builtin");
92039
92182
  host.registerGuard(new ContractViolationGuardRunner, "builtin");
92040
92183
  host.registerAction(new RuleCheckActionRunner(options.ruleService), "builtin");
@@ -92205,6 +92348,14 @@ function withSelfPidRecording(inner, db2) {
92205
92348
  return result;
92206
92349
  };
92207
92350
  }
92351
+ if (prop === "claimRunOwnership") {
92352
+ return async (runId, owner, expectedStatuses) => {
92353
+ const claimed = await target.claimRunOwnership(runId, owner, expectedStatuses);
92354
+ if (claimed !== undefined)
92355
+ await stamp(runId);
92356
+ return claimed;
92357
+ };
92358
+ }
92208
92359
  const value = Reflect.get(target, prop, receiver);
92209
92360
  return typeof value === "function" ? value.bind(target) : value;
92210
92361
  }
@@ -92347,6 +92498,7 @@ class WorkflowAppService {
92347
92498
  runId,
92348
92499
  vars: runVars,
92349
92500
  ...isDry ? { dryRun: true } : {},
92501
+ ...opts.redactor !== undefined ? { redactor: opts.redactor } : {},
92350
92502
  ...eventsBus !== undefined ? {
92351
92503
  events: withWorkflowIdentity(dropRetiredActionBoundaryAliases(bridgeEventBus(eventsBus)), workflow)
92352
92504
  } : {}
@@ -92421,8 +92573,12 @@ class WorkflowAppService {
92421
92573
  const cutoffIso = new Date(Date.now() - olderThanMinutes * 60000).toISOString();
92422
92574
  const stale = await dao2.listStaleRuns(cutoffIso);
92423
92575
  if (!dryRun) {
92576
+ const engine2 = new WorkflowService(createDefaultWorkflowEngineHost({}), new DbWorkflowPersistenceAdapter(db2));
92424
92577
  for (const run of stale) {
92425
- await dao2.finalizeStale(run.id, `stale: non-terminal > ${olderThanMinutes}m (spur workflow clean)`);
92578
+ const interrupted = run.status === "running" ? await engine2.interruptRun(run.id, `stale: owner lost > ${olderThanMinutes}m (spur workflow clean)`) : undefined;
92579
+ if (interrupted === undefined) {
92580
+ await dao2.finalizeStale(run.id, `stale: non-terminal > ${olderThanMinutes}m (spur workflow clean)`);
92581
+ }
92426
92582
  }
92427
92583
  }
92428
92584
  return {
@@ -92557,8 +92713,8 @@ class WorkflowAppService {
92557
92713
  async continuePaused(runId, opts) {
92558
92714
  const eventsBus = this.ctx.events?.();
92559
92715
  const row = await new RunDao(await this.ctx.getDb()).traceRowById(runId);
92560
- if (row?.status !== "paused") {
92561
- throw new Error(`Run "${runId}" is not paused (or does not exist) - nothing to continue.`);
92716
+ if (row?.status !== "paused" && row?.status !== "interrupted") {
92717
+ throw new Error(`Run "${runId}" is not resumable (status: ${row?.status ?? "missing"}) - only paused or interrupted runs can be continued.`);
92562
92718
  }
92563
92719
  let rawMeta = {};
92564
92720
  try {
@@ -92649,7 +92805,8 @@ class WorkflowAppService {
92649
92805
  }
92650
92806
  const svc = await this.createEngineService({
92651
92807
  events: eventsBus,
92652
- extensions: { workflow: resolved.workflow, file: resolved.path }
92808
+ extensions: { workflow: resolved.workflow, file: resolved.path },
92809
+ ...opts?.recordSelfPid === true ? { recordSelfPid: true } : {}
92653
92810
  });
92654
92811
  const workflow = resolved.workflow;
92655
92812
  const hitlVar = opts?.hitlVar ?? "__hitlAnswer";
@@ -92662,6 +92819,8 @@ class WorkflowAppService {
92662
92819
  const result = await svc.resumeRun(workflow, runId, {
92663
92820
  workdir: launchWorkdir,
92664
92821
  ...Object.keys(resumeVars).length > 0 ? { vars: resumeVars } : {},
92822
+ ...opts?.redactor !== undefined ? { redactor: opts.redactor } : {},
92823
+ ...opts?.resumeOwner !== undefined ? { resumeOwner: opts.resumeOwner } : {},
92665
92824
  ...eventsBus !== undefined ? {
92666
92825
  events: withWorkflowIdentity(dropRetiredActionBoundaryAliases(bridgeEventBus(eventsBus)), workflow)
92667
92826
  } : {}
@@ -92931,7 +93090,8 @@ class WorkflowAppService {
92931
93090
  ...processExec !== undefined ? { processExecutor: processExec } : {},
92932
93091
  ...opts.steeringController !== undefined ? { steeringController: opts.steeringController } : {},
92933
93092
  agentConfig: agentSlice,
92934
- getDb: () => this.ctx.getDb()
93093
+ getDb: () => this.ctx.getDb(),
93094
+ ...this.ctx.secretValues !== undefined ? { secretValues: this.ctx.secretValues } : {}
92935
93095
  });
92936
93096
  if (opts.extensions !== undefined) {
92937
93097
  await this.loadWorkflowExtensions(host, opts.extensions.workflow, opts.extensions.file);
@@ -93445,7 +93605,7 @@ function traceNextAction(run, outputArtifact) {
93445
93605
  if (run.status === "running" || run.status === "pending") {
93446
93606
  return { label: "Follow run", kind: "command", value: `spur workflow trace ${run.runId} --follow` };
93447
93607
  }
93448
- if (run.status === "paused") {
93608
+ if (run.status === "paused" || run.status === "interrupted") {
93449
93609
  return { label: "Continue run", kind: "command", value: `spur workflow continue ${run.runId}` };
93450
93610
  }
93451
93611
  if (run.status === "failed" && outputArtifact !== undefined) {
@@ -93476,6 +93636,21 @@ function projectActionTraceResult(resultJson, secretValues = []) {
93476
93636
  else if (typeof value === "number" || typeof value === "boolean")
93477
93637
  resultFields[field2] = value;
93478
93638
  }
93639
+ if (result.kind === "shell") {
93640
+ for (const [field2, source] of [
93641
+ ["stdoutTail", "stdout"],
93642
+ ["stderrTail", "stderr"]
93643
+ ]) {
93644
+ const value = data[source];
93645
+ if (typeof value === "string")
93646
+ resultFields[field2] = value;
93647
+ }
93648
+ for (const flag of ["stdoutTruncated", "stderrTruncated"]) {
93649
+ const value = data[flag];
93650
+ if (typeof value === "boolean")
93651
+ resultFields[flag] = value;
93652
+ }
93653
+ }
93479
93654
  const invocation = {};
93480
93655
  if (invocationSource !== undefined) {
93481
93656
  for (const field2 of TRACE_INVOCATION_FIELDS) {
@@ -99785,6 +99960,7 @@ __export(exports_src2, {
99785
99960
  verdictRowsMatchScenarios: () => verdictRowsMatchScenarios,
99786
99961
  validateSchedulerCustomJobPayload: () => validateSchedulerCustomJobPayload,
99787
99962
  validateHistoryRefreshPayload: () => validateHistoryRefreshPayload,
99963
+ utf8SafeByteTail: () => utf8SafeByteTail,
99788
99964
  toEnvelopeJson: () => toEnvelopeJson,
99789
99965
  toEnvelopeError: () => toEnvelopeError,
99790
99966
  terminateJobChildren: () => terminateJobChildren,
@@ -99927,6 +100103,7 @@ __export(exports_src2, {
99927
100103
  createWorkflowEventIdentity: () => createWorkflowEventIdentity,
99928
100104
  createWorkflowActionTraceWriter: () => createWorkflowActionTraceWriter,
99929
100105
  createSystemEventCatchAllSink: () => createSystemEventCatchAllSink,
100106
+ createShellOutputRedactor: () => createShellOutputRedactor,
99930
100107
  createRunLogTraceFailureRecorder: () => createRunLogTraceFailureRecorder,
99931
100108
  createPsProcessInspector: () => createPsProcessInspector,
99932
100109
  createOrAttachInlineRun: () => createOrAttachInlineRun,
@@ -99999,6 +100176,7 @@ __export(exports_src2, {
99999
100176
  SYSTEM_EVENT_CATALOG_METADATA: () => SYSTEM_EVENT_CATALOG_METADATA,
100000
100177
  SYSTEM_EVENT_CATALOG: () => SYSTEM_EVENT_CATALOG,
100001
100178
  STRATEGIES: () => STRATEGIES,
100179
+ SHELL_OUTPUT_TAIL_BYTES: () => SHELL_OUTPUT_TAIL_BYTES,
100002
100180
  SCHEDULER_CUSTOM_TIMEOUT_MS: () => SCHEDULER_CUSTOM_TIMEOUT_MS,
100003
100181
  SCHEDULER_CUSTOM_JOB: () => SCHEDULER_CUSTOM_JOB,
100004
100182
  SCHEDULER_CUSTOM_ACTIVE_INDEX: () => SCHEDULER_CUSTOM_ACTIVE_INDEX,
@@ -100162,6 +100340,7 @@ var init_src3 = __esm(async () => {
100162
100340
  init_file_read_into_var();
100163
100341
  init_rule_check();
100164
100342
  init_run_artifact();
100343
+ init_shell();
100165
100344
  init_builtins2();
100166
100345
  init_composition_baseline();
100167
100346
  init_escalation_packet();
@@ -100265,19 +100444,19 @@ var {
100265
100444
  init_src();
100266
100445
  init_loader();
100267
100446
 
100268
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application-node.js
100447
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application-node.js
100269
100448
  init_dist4();
100270
100449
  init_dist5();
100271
100450
  import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
100272
100451
  import { dirname as dirname6 } from "path";
100273
100452
 
100274
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application/index.js
100453
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application/index.js
100275
100454
  init_default_observers();
100276
100455
  init_event_bus();
100277
100456
  init_file_observer();
100278
100457
  init_logger3();
100279
100458
 
100280
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
100459
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
100281
100460
  class NoopSchedulerAdapter {
100282
100461
  constructor() {}
100283
100462
  register(_cron, _action) {}
@@ -100285,7 +100464,7 @@ class NoopSchedulerAdapter {
100285
100464
  async stop() {}
100286
100465
  }
100287
100466
 
100288
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
100467
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
100289
100468
  function initScheduler(adapter, cronEntries) {
100290
100469
  const resolved = adapter ?? new NoopSchedulerAdapter;
100291
100470
  if (cronEntries) {
@@ -100296,7 +100475,7 @@ function initScheduler(adapter, cronEntries) {
100296
100475
  return resolved;
100297
100476
  }
100298
100477
 
100299
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
100478
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
100300
100479
  init_logger3();
100301
100480
  init_metrics();
100302
100481
  init_sdk();
@@ -100389,7 +100568,7 @@ function dbPlugin(db2) {
100389
100568
  };
100390
100569
  }
100391
100570
 
100392
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
100571
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
100393
100572
  init_logger3();
100394
100573
 
100395
100574
  class PluginHost {
@@ -100477,7 +100656,7 @@ class PluginHost {
100477
100656
  }
100478
100657
  }
100479
100658
 
100480
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application/index.js
100659
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application/index.js
100481
100660
  async function performShutdown(state, reason) {
100482
100661
  if (state.stopped)
100483
100662
  return;
@@ -100589,7 +100768,7 @@ async function runApplication(options) {
100589
100768
  throw error51;
100590
100769
  }
100591
100770
  }
100592
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/scheduler/cron.js
100771
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/scheduler/cron.js
100593
100772
  var MAX_SCAN_MINUTES = 8 * 366 * 24 * 60;
100594
100773
  var DAYS_OF_WEEK = 7;
100595
100774
  function parseField(raw, min, max) {
@@ -100703,7 +100882,7 @@ function nextCronTime(expr, nowMs) {
100703
100882
  throw new RangeError(`unsupported cron expression "${expr.source}": no matching time within 8 years`);
100704
100883
  }
100705
100884
 
100706
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
100885
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
100707
100886
  init_logger3();
100708
100887
  init_metrics();
100709
100888
  var MAX_TIMEOUT = 2147483647;
@@ -100857,7 +101036,7 @@ class NodeSchedulerAdapter {
100857
101036
  }
100858
101037
  }
100859
101038
  }
100860
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
101039
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
100861
101040
  var import_api14 = __toESM(require_src(), 1);
100862
101041
 
100863
101042
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -103873,7 +104052,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
103873
104052
  }), JsonTraceSerializer));
103874
104053
  }
103875
104054
  }
103876
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
104055
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
103877
104056
  var import_resources2 = __toESM(require_src4(), 1);
103878
104057
  var import_sdk_trace_node = __toESM(require_src8(), 1);
103879
104058
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -103924,7 +104103,7 @@ async function shutdownNodeTelemetry() {
103924
104103
  await Promise.all(pending);
103925
104104
  }
103926
104105
 
103927
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.69+4e4376cb6b9d6e60/node_modules/@gobing-ai/ts-infra/dist/application-node.js
104106
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.0+dea746b7b279d311/node_modules/@gobing-ai/ts-infra/dist/application-node.js
103928
104107
  class ConfigValidationError extends Error {
103929
104108
  constructor(message) {
103930
104109
  super(message);
@@ -111252,6 +111431,22 @@ async function verifyLockfile(ctx, output2) {
111252
111431
  }
111253
111432
  output2.write(" \u21B3 bun.lock: verified (bun install --frozen-lockfile)");
111254
111433
  }
111434
+ async function assertPluginInstallable(ctx, output2) {
111435
+ const smokePath = join38(ctx.repoRoot, "scripts", "commands", "plugin-install-smoke.ts");
111436
+ if (!existsSync13(smokePath)) {
111437
+ output2.write(" \u21B3 plugin-install-smoke: gate script not present in this repo \u2014 skipped");
111438
+ return;
111439
+ }
111440
+ const result = await run(ctx.repoRoot, ["bun", "run", "plugin-smoke"]);
111441
+ if (!result.ok) {
111442
+ if (result.stdout)
111443
+ output2.write(result.stdout);
111444
+ if (result.stderr)
111445
+ output2.write(result.stderr);
111446
+ throw new Error("plugin-install-smoke failed \u2014 fix the plugin surface before releasing (bun run plugin-smoke).");
111447
+ }
111448
+ output2.write(" \u21B3 plugin-install-smoke: plugin surface is standalone and installs clean");
111449
+ }
111255
111450
  async function git2(repoRoot, args) {
111256
111451
  const result = await run(repoRoot, ["git", ...args]);
111257
111452
  if (!result.ok) {
@@ -111502,6 +111697,7 @@ async function bumpVersion(ctx, config4, version3, options, output2) {
111502
111697
  if (await npmViewVersion(ctx.repoRoot, config4.packageName, version3)) {
111503
111698
  throw new Error(`${config4.packageName}@${version3} is already published on npm. Use a new version.`);
111504
111699
  }
111700
+ await assertPluginInstallable(ctx, output2);
111505
111701
  const manifestPath = join38(ctx.repoRoot, config4.packageDir, "package.json");
111506
111702
  const manifest = await readJson2(manifestPath);
111507
111703
  if (manifest === null)
@@ -111564,6 +111760,7 @@ async function bumpAll(ctx, version3, options, output2) {
111564
111760
  if (existingLocal.has(tag))
111565
111761
  throw new Error(`tag already exists locally: ${tag}`);
111566
111762
  }
111763
+ await assertPluginInstallable(ctx, output2);
111567
111764
  const remoteRefs = await git2(ctx.repoRoot, ["ls-remote", "--tags", "origin"]);
111568
111765
  for (const tag of allTags) {
111569
111766
  if (remoteRefs.includes(`refs/tags/${tag}`)) {
@@ -112205,7 +112402,7 @@ import { createRequire } from "module";
112205
112402
  var CLI_CONFIG = {
112206
112403
  binaryName: "spur",
112207
112404
  binaryLabel: "spur",
112208
- binaryVersion: "0.3.89",
112405
+ binaryVersion: "0.3.90",
112209
112406
  configDir: ".spur",
112210
112407
  configFile: ".spur/config.yaml",
112211
112408
  databaseFile: ".spur/spur.db"
@@ -125165,6 +125362,34 @@ async function waitForRunRegistration(service, runId, timeoutMs, pollMs = 250) {
125165
125362
  }
125166
125363
  }
125167
125364
  }
125365
+ async function waitForResumeClaim(service, runId, timeoutMs, pollMs = 250) {
125366
+ const deadline = Date.now() + timeoutMs;
125367
+ for (;; ) {
125368
+ try {
125369
+ const entry = await service.trace(runId);
125370
+ if (entry.run.status !== "paused" && entry.run.status !== "interrupted")
125371
+ return true;
125372
+ } catch {}
125373
+ if (Date.now() >= deadline)
125374
+ return false;
125375
+ await sleep5(pollMs);
125376
+ }
125377
+ }
125378
+ async function existingWorkflowRun(service, runId) {
125379
+ if (runId === "")
125380
+ return false;
125381
+ try {
125382
+ await service.trace(runId);
125383
+ return true;
125384
+ } catch (error51) {
125385
+ if (error51 instanceof Error && error51.message.startsWith("Run not found:"))
125386
+ return false;
125387
+ throw error51;
125388
+ }
125389
+ }
125390
+ function existingRunRefusal(runId) {
125391
+ return `workflow run: run id ${runId} already exists \u2014 refusing to overwrite. Choose a fresh id with --run-id.`;
125392
+ }
125168
125393
  function expectedDigestMismatch(resolvedDigest, expectedDigest) {
125169
125394
  if (expectedDigest === undefined)
125170
125395
  return null;
@@ -125329,6 +125554,11 @@ needed and let the operator run it from a clean shell.`, "VALIDATION_FAILED");
125329
125554
  context4.setExitCode(1);
125330
125555
  return;
125331
125556
  }
125557
+ if (await existingWorkflowRun(makeSvc(options.json), runId2)) {
125558
+ writeJsonError(context4.output, options, existingRunRefusal(runId2), "VALIDATION_FAILED");
125559
+ context4.setExitCode(1);
125560
+ return;
125561
+ }
125332
125562
  const spurParts = resolveSpurBin().split(" ");
125333
125563
  const spurBin = spurParts[0] ?? process.execPath;
125334
125564
  const spurArgs = spurParts.slice(1);
@@ -125370,7 +125600,8 @@ needed and let the operator run it from a clean shell.`, "VALIDATION_FAILED");
125370
125600
  runId: runId2,
125371
125601
  vars: { spurBin: resolveSpurBin(), ...parseVars(options.vars) },
125372
125602
  dryRun: options.dryRun || undefined,
125373
- resolvedDefinition: resolvedDefinition2
125603
+ resolvedDefinition: resolvedDefinition2,
125604
+ redactor: createShellOutputRedactor(configuredSecretValues(context4.env))
125374
125605
  });
125375
125606
  } finally {
125376
125607
  clearWorkflowRunActive();
@@ -125422,6 +125653,11 @@ Monitor with: spur workflow trace ${runId2} --follow`);
125422
125653
  context4.setExitCode(1);
125423
125654
  return;
125424
125655
  }
125656
+ if (options.runId && await existingWorkflowRun(makeSvc(json3), runId)) {
125657
+ writeJsonError(context4.output, options, existingRunRefusal(runId), "VALIDATION_FAILED");
125658
+ context4.setExitCode(1);
125659
+ return;
125660
+ }
125425
125661
  const humanProgress = !json3 && !quiet && !silent;
125426
125662
  const bus = new EventBus;
125427
125663
  const ledger = await attachSystemEventLedger(bus, context4);
@@ -125549,6 +125785,7 @@ Monitor with: spur workflow trace ${runId2} --follow`);
125549
125785
  vars,
125550
125786
  dryRun: options.dryRun || undefined,
125551
125787
  recordSelfPid: getEnvVar("SPUR_ASYNC_WORKER") === "1",
125788
+ redactor: createShellOutputRedactor(configuredSecretValues(context4.env)),
125552
125789
  ...steeringController !== undefined ? { steeringController } : {},
125553
125790
  ...resolvedDefinition !== undefined ? { resolvedDefinition } : {}
125554
125791
  });
@@ -125574,7 +125811,7 @@ Monitor with: spur workflow trace ${runId2} --follow`);
125574
125811
  context4.setExitCode(result.status === "done" ? 0 : 1);
125575
125812
  await maybeTriggerHistoryRefresh(context4, "pipeline-run", runId);
125576
125813
  });
125577
- workflow.command("continue").description("Resume a paused (HITL) workflow run. Omit run-id to resume the most recent paused run.").argument("[run-id]", "Run ID to resume (default: the most recent paused run)").option("--yes", "Skip the CLI resume confirmation (does not set the persisted HITL answer)").option(...SHARED_OPTIONS.forceWorkflowContinue).option("--answer <yes|no|cancel>", "Inject a HITL gate answer before guard re-evaluation (0433). Does not imply --yes.").option(...SHARED_OPTIONS.jsonSupported).option(...SHARED_OPTIONS.jsonEnvelope).action(async (runId, options) => {
125814
+ workflow.command("continue").description("Resume a paused (HITL) workflow run. Omit run-id to resume the most recent paused run.").argument("[run-id]", "Run ID to resume (default: the most recent paused run)").option("--yes", "Skip the CLI resume confirmation (does not set the persisted HITL answer)").option(...SHARED_OPTIONS.forceWorkflowContinue).option("--answer <yes|no|cancel>", "Inject a HITL gate answer before guard re-evaluation (0433). Does not imply --yes.").option("--async", "Detach: resume in a background worker and report started/failed (0901 R4).").option("--no-log", "Opt out of appending to the consolidated .spur/run/<RUNID>.log").option(...SHARED_OPTIONS.jsonSupported).option(...SHARED_OPTIONS.jsonEnvelope).action(async (runId, options) => {
125578
125815
  const json3 = options.json === true;
125579
125816
  let hitlAnswer;
125580
125817
  if (options.answer !== undefined) {
@@ -125586,6 +125823,11 @@ Monitor with: spur workflow trace ${runId2} --follow`);
125586
125823
  }
125587
125824
  hitlAnswer = v;
125588
125825
  }
125826
+ if ((json3 || !process.stdout.isTTY) && hitlAnswer === undefined) {
125827
+ writeJsonError(context4.output, options, "Refusing headless `workflow continue` without --answer: a non-interactive resume must answer the pending HITL gate explicitly (--answer yes|no|cancel). --yes only skips the CLI resume confirmation and does not answer gates.", "VALIDATION_FAILED");
125828
+ context4.setExitCode(2);
125829
+ return;
125830
+ }
125589
125831
  const bus = new EventBus;
125590
125832
  const ledger = await attachSystemEventLedger(bus, context4);
125591
125833
  const quotaPersistence = attachAgentQuotaPersistence(bus, context4);
@@ -125615,10 +125857,63 @@ Monitor with: spur workflow trace ${runId2} --follow`);
125615
125857
  }
125616
125858
  }
125617
125859
  }
125618
- const result = await svc.continuePaused(targetId, {
125619
- hitlAnswer,
125620
- force: options.force === true ? true : undefined
125621
- });
125860
+ const result = await (async () => {
125861
+ if (options.async === true) {
125862
+ const cmd = ["workflow", "continue", targetId, "--yes"];
125863
+ if (hitlAnswer !== undefined)
125864
+ cmd.push("--answer", hitlAnswer);
125865
+ if (options.force === true)
125866
+ cmd.push("--force");
125867
+ if (json3)
125868
+ cmd.push("--json");
125869
+ if (options.jsonEnvelope === true)
125870
+ cmd.push("--json-envelope");
125871
+ if (options.log === false)
125872
+ cmd.push("--no-log");
125873
+ await spawnAsyncWorkflowWorker(resolveSpurBin(), cmd);
125874
+ const started = await waitForResumeClaim(svc, targetId, asyncRegisterTimeoutMs(context4.spurConfig));
125875
+ if (started) {
125876
+ if (json3) {
125877
+ context4.output.write(toEnvelopeJson({ status: "started", runId: targetId }, { enveloped: options.jsonEnvelope }));
125878
+ } else {
125879
+ context4.output.write(`workflow continue ${targetId}: started in background - follow with \`spur workflow trace ${targetId}\``);
125880
+ }
125881
+ context4.setExitCode(0);
125882
+ } else {
125883
+ const reason = "async resume worker failed to start or claim the run";
125884
+ const hint = "run `workflow continue` synchronously (omit --async) to see the failure";
125885
+ if (json3) {
125886
+ context4.output.write(toEnvelopeJson({ status: "failed", runId: targetId, reason, hint }, { enveloped: options.jsonEnvelope }));
125887
+ } else {
125888
+ context4.output.write(`workflow continue failed: ${reason}. ${hint}.`);
125889
+ }
125890
+ context4.setExitCode(1);
125891
+ }
125892
+ return;
125893
+ }
125894
+ const runLog = options.log === false ? undefined : new WorkflowRunLogSink({
125895
+ bus,
125896
+ dir: join48(context4.cwd, ".spur", "run"),
125897
+ runId: targetId,
125898
+ ...resolveOutputLogConfig(context4.spurConfig ?? null)
125899
+ });
125900
+ try {
125901
+ const result2 = await svc.continuePaused(targetId, {
125902
+ hitlAnswer,
125903
+ force: options.force === true ? true : undefined,
125904
+ redactor: createShellOutputRedactor(configuredSecretValues(context4.env)),
125905
+ ...getEnvVar("SPUR_ASYNC_WORKER") === "1" ? {
125906
+ resumeOwner: { attemptId: crypto.randomUUID(), pid: process.pid },
125907
+ recordSelfPid: true
125908
+ } : {}
125909
+ });
125910
+ return result2;
125911
+ } finally {
125912
+ runLog?.close();
125913
+ }
125914
+ })();
125915
+ if (result === undefined)
125916
+ return;
125622
125917
  context4.output.write(json3 ? toEnvelopeJson(result, { enveloped: options.jsonEnvelope }) : `workflow ${result.status}: ${result.workflowName} -> ${result.finalState}`);
125623
125918
  context4.setExitCode(result.status === "done" ? 0 : 1);
125624
125919
  await maybeTriggerHistoryRefresh(context4, "pipeline-run", targetId);