@gobing-ai/spur 0.3.3 → 0.3.4

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
@@ -16814,7 +16814,7 @@ function buildConfigFromEnv(env = process.env) {
16814
16814
  }
16815
16815
  });
16816
16816
  }
16817
- var SPUR_ENV_VARS, SPUR_LOG_LEVELS, DEFAULT_TASKS_DIR = "docs/tasks", DEFAULT_FEATURES_DIR = "docs/features", folderConfigSchema, tasksConfigSchema, featuresConfigSchema, AgentExecutorConfigSchema, AgentConfigSchema, RulesConfigSchema, WorkflowsConfigSchema, RedactionConfigSchema, spurConfigSchema, configSchema;
16817
+ var SPUR_ENV_VARS, SPUR_LOG_LEVELS, DEFAULT_TASKS_DIR = "docs/tasks", DEFAULT_FEATURES_DIR = "docs/features", DEFAULT_DATABASE_URL = ".spur/spur.db", IN_MEMORY_DATABASE_URL = ":memory:", folderConfigSchema, tasksConfigSchema, featuresConfigSchema, AgentExecutorConfigSchema, AgentConfigSchema, RulesConfigSchema, WorkflowsConfigSchema, RedactionConfigSchema, spurConfigSchema, configSchema;
16818
16818
  var init_src = __esm(() => {
16819
16819
  init_zod();
16820
16820
  SPUR_ENV_VARS = {
@@ -16882,8 +16882,8 @@ var init_src = __esm(() => {
16882
16882
  });
16883
16883
  configSchema = exports_external.object({
16884
16884
  database: exports_external.object({
16885
- url: exports_external.string().default(":memory:")
16886
- }).default({ url: ":memory:" }),
16885
+ url: exports_external.string().default(DEFAULT_DATABASE_URL)
16886
+ }).default({ url: DEFAULT_DATABASE_URL }),
16887
16887
  server: exports_external.object({
16888
16888
  port: exports_external.coerce.number().int().positive().default(3000),
16889
16889
  host: exports_external.string().default("localhost"),
@@ -16900,7 +16900,7 @@ var init_src = __esm(() => {
16900
16900
  });
16901
16901
  });
16902
16902
 
16903
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/errors.js
16903
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/errors.js
16904
16904
  function isAppError(error51) {
16905
16905
  return error51 instanceof AppError;
16906
16906
  }
@@ -16928,7 +16928,7 @@ var init_errors3 = __esm(() => {
16928
16928
  };
16929
16929
  });
16930
16930
 
16931
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/api-response.js
16931
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/api-response.js
16932
16932
  var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
16933
16933
  var init_api_response = __esm(() => {
16934
16934
  init_errors3();
@@ -16951,10 +16951,10 @@ var init_api_response = __esm(() => {
16951
16951
  CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
16952
16952
  });
16953
16953
 
16954
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/cursor.js
16954
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/cursor.js
16955
16955
  var init_cursor = () => {};
16956
16956
 
16957
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/object.js
16957
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/object.js
16958
16958
  function isPlainObject2(value) {
16959
16959
  return typeof value === "object" && value !== null && !Array.isArray(value);
16960
16960
  }
@@ -16970,7 +16970,7 @@ function deepMerge(target, source) {
16970
16970
  return result;
16971
16971
  }
16972
16972
 
16973
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/output.js
16973
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/output.js
16974
16974
  function processStream(name) {
16975
16975
  const proc = globalThis.process;
16976
16976
  const stream = proc?.[name];
@@ -16991,7 +16991,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
16991
16991
  }
16992
16992
  var defaultStdoutTarget, defaultStderrTarget;
16993
16993
 
16994
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.3/node_modules/@gobing-ai/ts-utils/dist/index.js
16994
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.4/node_modules/@gobing-ai/ts-utils/dist/index.js
16995
16995
  var init_dist = __esm(() => {
16996
16996
  init_api_response();
16997
16997
  init_cursor();
@@ -23988,7 +23988,7 @@ var init_dist2 = __esm(() => {
23988
23988
  $visitAsync = visit.visitAsync;
23989
23989
  });
23990
23990
 
23991
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/config.js
23991
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/config.js
23992
23992
  function parseYamlObject(text) {
23993
23993
  let parsed;
23994
23994
  try {
@@ -24115,7 +24115,7 @@ var init_config = __esm(() => {
24115
24115
  };
24116
24116
  });
24117
24117
 
24118
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
24118
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
24119
24119
  import { appendFileSync, cpSync, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
24120
24120
  import { dirname, resolve as resolvePath } from "path";
24121
24121
  function createNodeFileSystem(root) {
@@ -24187,7 +24187,7 @@ function findProjectRoot(startDir) {
24187
24187
  }
24188
24188
  var init_file_system_node = () => {};
24189
24189
 
24190
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
24190
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
24191
24191
  var D1NotConfiguredError;
24192
24192
  var init_db_errors = __esm(() => {
24193
24193
  D1NotConfiguredError = class D1NotConfiguredError extends Error {
@@ -24198,7 +24198,7 @@ var init_db_errors = __esm(() => {
24198
24198
  };
24199
24199
  });
24200
24200
 
24201
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
24201
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
24202
24202
  function createCfFileSystem() {
24203
24203
  return {
24204
24204
  getProjectRoot: () => "/bundle",
@@ -24237,7 +24237,7 @@ function createCfFileSystem() {
24237
24237
  }
24238
24238
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
24239
24239
 
24240
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
24240
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
24241
24241
  var exports_runtime_cf = {};
24242
24242
  __export(exports_runtime_cf, {
24243
24243
  cloudflareWorkersFactory: () => cloudflareWorkersFactory
@@ -31455,7 +31455,7 @@ var init_execa = __esm(() => {
31455
31455
  } = getIpcExport());
31456
31456
  });
31457
31457
 
31458
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
31458
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
31459
31459
  import { isatty } from "tty";
31460
31460
 
31461
31461
  class ProcessExecutor {
@@ -31743,7 +31743,7 @@ var init_process_executor = __esm(() => {
31743
31743
  };
31744
31744
  });
31745
31745
 
31746
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
31746
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
31747
31747
  var exports_runtime_node_bun = {};
31748
31748
  __export(exports_runtime_node_bun, {
31749
31749
  nodeBunFactory: () => nodeBunFactory,
@@ -31802,7 +31802,7 @@ var init_runtime_node_bun = __esm(() => {
31802
31802
  };
31803
31803
  });
31804
31804
 
31805
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/platform.js
31805
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/platform.js
31806
31806
  function isCloudflareWorkerRuntime() {
31807
31807
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
31808
31808
  }
@@ -31832,7 +31832,7 @@ function _resetRuntimeFactory() {
31832
31832
  }
31833
31833
  var _factory, _runtimeName;
31834
31834
 
31835
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/context.js
31835
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/context.js
31836
31836
  class RuntimeContext {
31837
31837
  scope;
31838
31838
  runtimeName;
@@ -31922,7 +31922,7 @@ var init_context = __esm(() => {
31922
31922
  init_process_executor();
31923
31923
  });
31924
31924
 
31925
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/path.js
31925
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/path.js
31926
31926
  function normalizeSeparators(path6) {
31927
31927
  return path6.replaceAll("\\", "/");
31928
31928
  }
@@ -32030,7 +32030,7 @@ var init_path = __esm(() => {
32030
32030
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
32031
32031
  });
32032
32032
 
32033
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/fs.js
32033
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/fs.js
32034
32034
  async function ensureDirForFile(path6, fs = createNodeFileSystem()) {
32035
32035
  await fs.ensureDir(dirnamePath(path6));
32036
32036
  }
@@ -32081,7 +32081,7 @@ var init_fs = __esm(() => {
32081
32081
  init_path();
32082
32082
  });
32083
32083
 
32084
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
32084
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
32085
32085
  async function loadStructuredConfig(path6, options = {}) {
32086
32086
  const content = await (options.fileSystem ?? createNodeFileSystem()).readFile(path6);
32087
32087
  return await parseStructuredConfig(content, path6, options);
@@ -32361,10 +32361,10 @@ var init_schema_validation = __esm(() => {
32361
32361
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
32362
32362
  });
32363
32363
 
32364
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/types.js
32364
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/types.js
32365
32365
  var init_types = () => {};
32366
32366
 
32367
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/index.js
32367
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/index.js
32368
32368
  var exports_dist = {};
32369
32369
  __export(exports_dist, {
32370
32370
  writeJsonFile: () => writeJsonFile,
@@ -32679,7 +32679,7 @@ var init_loader = __esm(() => {
32679
32679
  planningFoldersCache = new WeakMap;
32680
32680
  });
32681
32681
 
32682
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
32682
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
32683
32683
  import { Database } from "bun:sqlite";
32684
32684
  var init_bun_sqlite = () => {};
32685
32685
 
@@ -36871,7 +36871,7 @@ var init_bun_sqlite2 = __esm(() => {
36871
36871
  init_session2();
36872
36872
  });
36873
36873
 
36874
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
36874
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
36875
36875
  var inboxMessages;
36876
36876
  var init_inbox_messages = __esm(() => {
36877
36877
  init_sqlite_core();
@@ -36890,7 +36890,7 @@ var init_inbox_messages = __esm(() => {
36890
36890
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
36891
36891
  });
36892
36892
 
36893
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/common.js
36893
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/common.js
36894
36894
  function nowTimestamp() {
36895
36895
  return Date.now();
36896
36896
  }
@@ -36919,7 +36919,7 @@ var init_common3 = __esm(() => {
36919
36919
  appendOnlyColumns = buildAppendOnlyColumns();
36920
36920
  });
36921
36921
 
36922
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
36922
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
36923
36923
  var queueJobs;
36924
36924
  var init_queue_jobs = __esm(() => {
36925
36925
  init_sqlite_core();
@@ -36939,7 +36939,7 @@ var init_queue_jobs = __esm(() => {
36939
36939
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
36940
36940
  });
36941
36941
 
36942
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
36942
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
36943
36943
  var exports_runtime = {};
36944
36944
  __export(exports_runtime, {
36945
36945
  queueJobs: () => queueJobs,
@@ -36950,7 +36950,7 @@ var init_runtime = __esm(() => {
36950
36950
  init_queue_jobs();
36951
36951
  });
36952
36952
 
36953
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
36953
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
36954
36954
  var exports_bun_sqlite = {};
36955
36955
  __export(exports_bun_sqlite, {
36956
36956
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -37229,7 +37229,7 @@ var init_d1 = __esm(() => {
37229
37229
  init_session3();
37230
37230
  });
37231
37231
 
37232
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
37232
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
37233
37233
  var exports_d1 = {};
37234
37234
  __export(exports_d1, {
37235
37235
  D1Adapter: () => D1Adapter
@@ -37277,7 +37277,7 @@ var init_d12 = __esm(() => {
37277
37277
  init_runtime();
37278
37278
  });
37279
37279
 
37280
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapter.js
37280
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/adapter.js
37281
37281
  async function createDbAdapter(config3) {
37282
37282
  switch (config3.driver) {
37283
37283
  case "bun-sqlite": {
@@ -37317,7 +37317,7 @@ var init_drizzle_orm = __esm(() => {
37317
37317
  init_view_common();
37318
37318
  });
37319
37319
 
37320
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/query-spec.js
37320
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/query-spec.js
37321
37321
  function compilePredicate(predicate) {
37322
37322
  if ("and" in predicate) {
37323
37323
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -37355,7 +37355,7 @@ var init_query_spec = __esm(() => {
37355
37355
  };
37356
37356
  });
37357
37357
 
37358
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/base-dao.js
37358
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/base-dao.js
37359
37359
  function asSelectQuery(query) {
37360
37360
  return query;
37361
37361
  }
@@ -37397,7 +37397,7 @@ var init_base_dao = __esm(() => {
37397
37397
  init_query_spec();
37398
37398
  });
37399
37399
 
37400
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
37400
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
37401
37401
  var embeddedMigrations;
37402
37402
  var init_embedded_migrations = __esm(() => {
37403
37403
  embeddedMigrations = [
@@ -37429,7 +37429,7 @@ var init_embedded_migrations = __esm(() => {
37429
37429
  ];
37430
37430
  });
37431
37431
 
37432
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
37432
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
37433
37433
  var EntityDao;
37434
37434
  var init_entity_dao = __esm(() => {
37435
37435
  init_drizzle_orm();
@@ -37591,7 +37591,7 @@ var init_entity_dao = __esm(() => {
37591
37591
  };
37592
37592
  });
37593
37593
 
37594
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
37594
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
37595
37595
  var InboxMessageDao;
37596
37596
  var init_inbox_message_dao = __esm(() => {
37597
37597
  init_drizzle_orm();
@@ -37710,7 +37710,7 @@ var init_migrator2 = __esm(() => {
37710
37710
  init_migrator();
37711
37711
  });
37712
37712
 
37713
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/migrate.js
37713
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/migrate.js
37714
37714
  async function ensureJournalTable(adapter, table3) {
37715
37715
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
37716
37716
  }
@@ -37785,7 +37785,7 @@ var init_migrate = __esm(() => {
37785
37785
  init_embedded_migrations();
37786
37786
  });
37787
37787
 
37788
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
37788
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
37789
37789
  var QueueJobDao;
37790
37790
  var init_queue_job_dao = __esm(() => {
37791
37791
  init_drizzle_orm();
@@ -37926,7 +37926,7 @@ var init_queue_job_dao = __esm(() => {
37926
37926
  };
37927
37927
  });
37928
37928
 
37929
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/index.js
37929
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/index.js
37930
37930
  var exports_dist2 = {};
37931
37931
  __export(exports_dist2, {
37932
37932
  embeddedMigrations: () => embeddedMigrations,
@@ -39752,7 +39752,7 @@ var init_mod = __esm(() => {
39752
39752
  init_config2();
39753
39753
  });
39754
39754
 
39755
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/logger.js
39755
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/logger.js
39756
39756
  function toLogTapeLevel(level) {
39757
39757
  return level === "warn" ? "warning" : level;
39758
39758
  }
@@ -41305,7 +41305,7 @@ var require_src = __commonJS((exports) => {
41305
41305
  };
41306
41306
  });
41307
41307
 
41308
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
41308
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
41309
41309
  function getTelemetryConfig(configPartial = {}) {
41310
41310
  return {
41311
41311
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -41341,7 +41341,7 @@ var init_sdk = __esm(() => {
41341
41341
  resolvedConfig = getTelemetryConfig();
41342
41342
  });
41343
41343
 
41344
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
41344
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
41345
41345
  function isSuppressed(tracer2) {
41346
41346
  return tracer2 === undefined && !getResolvedConfig().enabled;
41347
41347
  }
@@ -41381,7 +41381,7 @@ var init_tracing2 = __esm(() => {
41381
41381
  import_api2 = __toESM(require_src(), 1);
41382
41382
  });
41383
41383
 
41384
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
41384
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
41385
41385
  function getMeter() {
41386
41386
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
41387
41387
  }
@@ -41478,7 +41478,7 @@ var init_metrics = __esm(() => {
41478
41478
  instruments = {};
41479
41479
  });
41480
41480
 
41481
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
41481
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
41482
41482
  function busLogger() {
41483
41483
  if (!_busLogger)
41484
41484
  _busLogger = getLogger2("event-bus");
@@ -41723,7 +41723,7 @@ var init_event_bus = __esm(() => {
41723
41723
  init_metrics();
41724
41724
  });
41725
41725
 
41726
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
41726
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
41727
41727
  function obsLogger() {
41728
41728
  if (!_obsLogger)
41729
41729
  _obsLogger = getLogger2("event-bus.observers");
@@ -41787,7 +41787,7 @@ var init_default_observers = __esm(() => {
41787
41787
  init_event_bus();
41788
41788
  });
41789
41789
 
41790
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
41790
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
41791
41791
  function parseInterval(cron) {
41792
41792
  const trimmed = cron.trim();
41793
41793
  const num = Number(trimmed);
@@ -41861,7 +41861,7 @@ var init_node3 = __esm(() => {
41861
41861
  init_metrics();
41862
41862
  });
41863
41863
 
41864
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
41864
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
41865
41865
  var exports_scheduler_node = {};
41866
41866
  __export(exports_scheduler_node, {
41867
41867
  NodeSchedulerAdapter: () => NodeSchedulerAdapter
@@ -48094,24 +48094,24 @@ var init_planning_folders = __esm(() => {
48094
48094
  init_loader();
48095
48095
  });
48096
48096
 
48097
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
48097
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
48098
48098
  var init_event_bus2 = __esm(() => {
48099
48099
  init_event_bus();
48100
48100
  });
48101
48101
 
48102
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
48102
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
48103
48103
  var init_telemetry = __esm(() => {
48104
48104
  init_tracing2();
48105
48105
  });
48106
48106
 
48107
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/index.js
48107
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/index.js
48108
48108
  var init_dist5 = __esm(() => {
48109
48109
  init_event_bus2();
48110
48110
  init_logger3();
48111
48111
  init_telemetry();
48112
48112
  });
48113
48113
 
48114
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
48114
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
48115
48115
  function resolveAgentName(input) {
48116
48116
  if (isCanonicalName(input))
48117
48117
  return input;
@@ -48341,7 +48341,7 @@ var init_shims = __esm(() => {
48341
48341
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
48342
48342
  });
48343
48343
 
48344
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
48344
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
48345
48345
  function buildIdentityPreamble(ctx) {
48346
48346
  const sections = [
48347
48347
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -48401,7 +48401,7 @@ var init_identity = __esm(() => {
48401
48401
  init_dist3();
48402
48402
  });
48403
48403
 
48404
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
48404
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
48405
48405
  function isClaudeStyleSlashCommand(input) {
48406
48406
  return SLASH_COMMAND_RE.test(input);
48407
48407
  }
@@ -48429,7 +48429,7 @@ var init_slash_command = __esm(() => {
48429
48429
  SLASH_COMMAND_RE = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
48430
48430
  });
48431
48431
 
48432
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
48432
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
48433
48433
  class AiRunner {
48434
48434
  processExecutor;
48435
48435
  defaultCwd;
@@ -48543,7 +48543,7 @@ var init_ai_runner = __esm(() => {
48543
48543
  init_slash_command();
48544
48544
  });
48545
48545
 
48546
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
48546
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
48547
48547
  class AgentDetector {
48548
48548
  runner;
48549
48549
  timeout;
@@ -48619,7 +48619,7 @@ var init_agent_detector = __esm(() => {
48619
48619
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
48620
48620
  });
48621
48621
 
48622
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
48622
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
48623
48623
  function validateAgentId(id) {
48624
48624
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
48625
48625
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -48716,7 +48716,7 @@ var init_agent_spec = __esm(() => {
48716
48716
  };
48717
48717
  });
48718
48718
 
48719
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
48719
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
48720
48720
  function isNonEmpty(value) {
48721
48721
  return value !== undefined && value.trim().length > 0;
48722
48722
  }
@@ -48812,7 +48812,7 @@ var init_auth_shims = __esm(() => {
48812
48812
  };
48813
48813
  });
48814
48814
 
48815
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
48815
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
48816
48816
  class DoctorRunner {
48817
48817
  detector;
48818
48818
  runner;
@@ -48876,15 +48876,15 @@ var init_doctor_runner = __esm(() => {
48876
48876
  init_ai_runner();
48877
48877
  });
48878
48878
 
48879
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
48879
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
48880
48880
  var init_events = () => {};
48881
48881
 
48882
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
48882
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
48883
48883
  function formatMessage(msg) {
48884
48884
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
48885
48885
  }
48886
48886
 
48887
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
48887
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
48888
48888
  import { Buffer as Buffer5 } from "buffer";
48889
48889
 
48890
48890
  class TeamAgentProcess {
@@ -49018,7 +49018,7 @@ var init_team_agent_process = __esm(() => {
49018
49018
  init_dist3();
49019
49019
  });
49020
49020
 
49021
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
49021
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
49022
49022
  class TeamOrchestrator {
49023
49023
  configDir;
49024
49024
  inbox;
@@ -49147,7 +49147,7 @@ var init_team_orchestrator = __esm(() => {
49147
49147
  init_team_agent_process();
49148
49148
  });
49149
49149
 
49150
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.3+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
49150
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.4+2e11ad5b9561782b/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
49151
49151
  var exports_dist3 = {};
49152
49152
  __export(exports_dist3, {
49153
49153
  validateAgentId: () => validateAgentId,
@@ -49198,6 +49198,14 @@ class AgentService {
49198
49198
  constructor(ctx) {
49199
49199
  this.ctx = ctx;
49200
49200
  }
49201
+ bridgeAgentEvents(serverBus) {
49202
+ const bridge = {
49203
+ on: (event, listener) => serverBus.on(event, listener),
49204
+ off: (event, listener) => serverBus.off(event, listener),
49205
+ emit: (event, detail) => serverBus.emit(event, detail)
49206
+ };
49207
+ return bridge;
49208
+ }
49201
49209
  async resolve(flags, deps) {
49202
49210
  const outputPolicy = { mode: "buffered" };
49203
49211
  const runner = deps?.runner ?? new AiRunner({ processExecutor: new NodeProcessExecutor({ output: outputPolicy }) });
@@ -49281,7 +49289,11 @@ class AgentService {
49281
49289
  }
49282
49290
  const jsonOutput = silent || booleanFlag(flags, "json");
49283
49291
  const outputPolicy = jsonOutput ? { mode: "buffered" } : { mode: "stream", isTTY: isatty2(1) };
49284
- const runner = deps?.runner ?? new AiRunner({ processExecutor: new NodeProcessExecutor({ output: outputPolicy }) });
49292
+ const runner = deps?.runner ?? new AiRunner({
49293
+ processExecutor: new NodeProcessExecutor({ output: outputPolicy }),
49294
+ ...this.ctx.events !== undefined ? { events: this.bridgeAgentEvents(this.ctx.events) } : {},
49295
+ ...this.ctx.events !== undefined ? { processEvents: this.bridgeAgentEvents(this.ctx.events) } : {}
49296
+ });
49285
49297
  const detector = deps?.detector ?? new AgentDetector({ runner });
49286
49298
  const doctorRunner = deps?.doctorRunner ?? new DoctorRunner({ agentDetector: detector, runner, env: this.ctx.env });
49287
49299
  const resolved = await this.resolveAgent(prompt, flags, doctorRunner);
@@ -50532,7 +50544,7 @@ var init_drizzle_zod = __esm(() => {
50532
50544
  };
50533
50545
  });
50534
50546
 
50535
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
50547
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
50536
50548
  function sqlExpressionToText(value) {
50537
50549
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
50538
50550
  return;
@@ -50555,7 +50567,7 @@ function getDrizzleTableName(table3) {
50555
50567
  return String(table3[nameSym]);
50556
50568
  }
50557
50569
 
50558
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
50570
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
50559
50571
  function quoteIdent(name) {
50560
50572
  return `"${name.replace(/"/g, '""')}"`;
50561
50573
  }
@@ -50649,7 +50661,7 @@ var init_ddl = __esm(() => {
50649
50661
  init_sqlite_core();
50650
50662
  });
50651
50663
 
50652
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
50664
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
50653
50665
  function defineTable(name, columns2) {
50654
50666
  const table3 = sqliteTable(name, columns2);
50655
50667
  let insert2;
@@ -50683,7 +50695,7 @@ var init_define_table = __esm(() => {
50683
50695
  init_ddl();
50684
50696
  });
50685
50697
 
50686
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.3+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/index.js
50698
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.4+41c9028a9c9e39f8/node_modules/@gobing-ai/ts-db/dist/schema/index.js
50687
50699
  var init_schema = __esm(() => {
50688
50700
  init_sqlite_core();
50689
50701
  init_define_table();
@@ -51238,7 +51250,7 @@ var init_dao = __esm(() => {
51238
51250
  init_workspace_dao();
51239
51251
  });
51240
51252
 
51241
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
51253
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
51242
51254
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
51243
51255
  var init_errors5 = __esm(() => {
51244
51256
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -51273,7 +51285,7 @@ var init_errors5 = __esm(() => {
51273
51285
  };
51274
51286
  });
51275
51287
 
51276
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
51288
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
51277
51289
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
51278
51290
  return {
51279
51291
  workflow: workflowName,
@@ -51504,7 +51516,7 @@ var init_run_lifecycle = __esm(() => {
51504
51516
  ];
51505
51517
  });
51506
51518
 
51507
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
51519
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
51508
51520
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
51509
51521
  var init_schema2 = __esm(() => {
51510
51522
  init_zod();
@@ -51588,7 +51600,7 @@ var init_schema2 = __esm(() => {
51588
51600
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
51589
51601
  });
51590
51602
 
51591
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
51603
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
51592
51604
  async function loadWorkflowDef(path8, options = {}) {
51593
51605
  return parseWorkflowDef(await loadStructuredConfig(path8, options), path8);
51594
51606
  }
@@ -51747,7 +51759,7 @@ var init_config3 = __esm(() => {
51747
51759
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
51748
51760
  });
51749
51761
 
51750
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
51762
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
51751
51763
  class CapabilityRegistry {
51752
51764
  kind;
51753
51765
  capabilities = new Map;
@@ -51778,7 +51790,7 @@ class CapabilityRegistry {
51778
51790
  }
51779
51791
  }
51780
51792
 
51781
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
51793
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
51782
51794
  function assertRelativeExtensionPath(path8, options = {}) {
51783
51795
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
51784
51796
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path8)) {
@@ -51789,20 +51801,20 @@ function assertRelativeExtensionPath(path8, options = {}) {
51789
51801
  }
51790
51802
  }
51791
51803
 
51792
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
51804
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
51793
51805
  var init_extension_loader = () => {};
51794
51806
 
51795
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
51807
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
51796
51808
  var init_extension = __esm(() => {
51797
51809
  init_extension_loader();
51798
51810
  });
51799
51811
 
51800
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.3/node_modules/@gobing-ai/ts-runtime/dist/extension.js
51812
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.4/node_modules/@gobing-ai/ts-runtime/dist/extension.js
51801
51813
  var init_extension2 = __esm(() => {
51802
51814
  init_extension();
51803
51815
  });
51804
51816
 
51805
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
51817
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
51806
51818
  class WorkflowEngineHost {
51807
51819
  actions = new CapabilityRegistry("workflow action");
51808
51820
  guards = new CapabilityRegistry("workflow guard");
@@ -51967,7 +51979,7 @@ var init_host = __esm(() => {
51967
51979
  init_errors5();
51968
51980
  });
51969
51981
 
51970
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
51982
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
51971
51983
  var WORKFLOW_ENGINE_SCHEMA_SQL;
51972
51984
  var init_schema_sql = __esm(() => {
51973
51985
  WORKFLOW_ENGINE_SCHEMA_SQL = `
@@ -52040,7 +52052,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
52040
52052
  `.trim();
52041
52053
  });
52042
52054
 
52043
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
52055
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
52044
52056
  async function applyWorkflowEngineSchema(db2) {
52045
52057
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
52046
52058
  const sql4 = statement.trim();
@@ -52253,7 +52265,7 @@ var init_persistence = __esm(() => {
52253
52265
  init_schema_sql();
52254
52266
  });
52255
52267
 
52256
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
52268
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
52257
52269
  function mergeVars(workflowVars = {}, overrideVars = {}) {
52258
52270
  return { ...workflowVars, ...overrideVars };
52259
52271
  }
@@ -52313,7 +52325,7 @@ var init_variables = __esm(() => {
52313
52325
  TEMPLATE_REF = /\$\{([^}]+)\}/g;
52314
52326
  });
52315
52327
 
52316
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
52328
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
52317
52329
  async function runActionStep(action, vars, deps) {
52318
52330
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
52319
52331
  const resolved = resolveTemplates(action.options ?? {}, {
@@ -52370,7 +52382,7 @@ var init_action_step = __esm(() => {
52370
52382
  init_variables();
52371
52383
  });
52372
52384
 
52373
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
52385
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
52374
52386
  class StateMachineDriver {
52375
52387
  options;
52376
52388
  constructor(options) {
@@ -52498,7 +52510,7 @@ var init_state_machine = __esm(() => {
52498
52510
  EMPTY_OUTCOME = { outcome: "completed", result: undefined };
52499
52511
  });
52500
52512
 
52501
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
52513
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
52502
52514
  class TransitionFlowDriver {
52503
52515
  options;
52504
52516
  constructor(options) {
@@ -52610,7 +52622,7 @@ var init_transition_flow = __esm(() => {
52610
52622
  init_variables();
52611
52623
  });
52612
52624
 
52613
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
52625
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
52614
52626
  class WorkflowService {
52615
52627
  host;
52616
52628
  persistence;
@@ -52794,7 +52806,7 @@ var init_service = __esm(() => {
52794
52806
  init_variables();
52795
52807
  });
52796
52808
 
52797
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
52809
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
52798
52810
  var init_dist7 = __esm(() => {
52799
52811
  init_config3();
52800
52812
  init_host();
@@ -52803,7 +52815,7 @@ var init_dist7 = __esm(() => {
52803
52815
  init_service();
52804
52816
  });
52805
52817
 
52806
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
52818
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
52807
52819
  var HistoryImportError;
52808
52820
  var init_errors6 = __esm(() => {
52809
52821
  HistoryImportError = class HistoryImportError extends Error {
@@ -52816,7 +52828,7 @@ var init_errors6 = __esm(() => {
52816
52828
  };
52817
52829
  });
52818
52830
 
52819
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
52831
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
52820
52832
  import { createHash } from "crypto";
52821
52833
  function stableJson(value) {
52822
52834
  if (Array.isArray(value)) {
@@ -52833,7 +52845,7 @@ function sha256(value) {
52833
52845
  }
52834
52846
  var init_hash = () => {};
52835
52847
 
52836
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
52848
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
52837
52849
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
52838
52850
  if (typeof value === "string") {
52839
52851
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -52870,7 +52882,7 @@ var init_redaction = __esm(() => {
52870
52882
  ];
52871
52883
  });
52872
52884
 
52873
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
52885
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
52874
52886
  var HISTORY_IMPORT_SCHEMA_SQL;
52875
52887
  var init_schema_sql2 = __esm(() => {
52876
52888
  HISTORY_IMPORT_SCHEMA_SQL = `
@@ -52957,7 +52969,7 @@ CREATE TABLE IF NOT EXISTS history_etl_openclaw (
52957
52969
  `.trim();
52958
52970
  });
52959
52971
 
52960
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
52972
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
52961
52973
  function firstString(...values) {
52962
52974
  for (const value of values) {
52963
52975
  if (typeof value === "string" && value.length > 0)
@@ -53045,7 +53057,7 @@ var init_sources = __esm(() => {
53045
53057
  };
53046
53058
  });
53047
53059
 
53048
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
53060
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
53049
53061
  async function applyHistoryImportSchema(db2) {
53050
53062
  for (const statement of HISTORY_IMPORT_SCHEMA_SQL.split(";")) {
53051
53063
  const sql4 = statement.trim();
@@ -53271,13 +53283,13 @@ var init_importer = __esm(() => {
53271
53283
  VALID_TABLE_NAME = /^history_etl_[a-z_]+$/;
53272
53284
  });
53273
53285
 
53274
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.3+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
53286
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.4+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
53275
53287
  var init_dist8 = __esm(() => {
53276
53288
  init_importer();
53277
53289
  init_schema_sql2();
53278
53290
  });
53279
53291
 
53280
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
53292
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
53281
53293
  function collectExtensions(sourceName, sourceDir, extensions) {
53282
53294
  if (extensions === undefined)
53283
53295
  return [];
@@ -53293,7 +53305,7 @@ var init_extensions = __esm(() => {
53293
53305
  init_dist3();
53294
53306
  });
53295
53307
 
53296
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
53308
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
53297
53309
  function createFinding(rule, message, filePath, extras = {}) {
53298
53310
  return {
53299
53311
  ruleId: rule.id,
@@ -53364,7 +53376,7 @@ var init_types2 = __esm(() => {
53364
53376
  });
53365
53377
  });
53366
53378
 
53367
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
53379
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
53368
53380
  async function loadPreset(name, options) {
53369
53381
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath2(root)), options.fileSystem);
53370
53382
  const presetPath = findMergedPreset(merged, name);
@@ -53579,7 +53591,7 @@ var init_loader2 = __esm(() => {
53579
53591
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
53580
53592
  });
53581
53593
 
53582
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
53594
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
53583
53595
  function normalizeFindingPath(filePath) {
53584
53596
  if (!filePath || isAbsolutePath(filePath))
53585
53597
  return null;
@@ -53644,7 +53656,7 @@ var init_test_stub_fixer = __esm(() => {
53644
53656
  realFileSystem = createNodeFileSystem();
53645
53657
  });
53646
53658
 
53647
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
53659
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
53648
53660
  function registerBuiltinFixers(host, exec) {
53649
53661
  const regexFixer = new RegexFixerProvider;
53650
53662
  const pathFixer = new PathFixerProvider;
@@ -53847,7 +53859,7 @@ var init_fixers = __esm(() => {
53847
53859
  };
53848
53860
  });
53849
53861
 
53850
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
53862
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
53851
53863
  function stringArray(value) {
53852
53864
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
53853
53865
  }
@@ -53885,7 +53897,7 @@ function parseInlineFlags(source) {
53885
53897
  return { flags, rest: source.slice(match[0].length) };
53886
53898
  }
53887
53899
 
53888
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
53900
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
53889
53901
  function matchesAny(path8, patterns) {
53890
53902
  if (patterns === undefined || patterns.length === 0)
53891
53903
  return true;
@@ -53933,7 +53945,7 @@ function escapeRegExp(value) {
53933
53945
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
53934
53946
  }
53935
53947
 
53936
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
53948
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
53937
53949
  async function discoverFiles2(options) {
53938
53950
  const fs3 = options.fs ?? createNodeFileSystem();
53939
53951
  const allFiles = await walkDir(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -53961,12 +53973,12 @@ var init_file_discovery = __esm(() => {
53961
53973
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
53962
53974
  });
53963
53975
 
53964
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
53976
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
53965
53977
  var init_file_utils = __esm(() => {
53966
53978
  init_file_discovery();
53967
53979
  });
53968
53980
 
53969
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
53981
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
53970
53982
  class AgentDetectionEvaluator {
53971
53983
  detector;
53972
53984
  constructor(detector = new AgentDetector) {
@@ -53994,7 +54006,7 @@ var init_agent_detection_evaluator = __esm(() => {
53994
54006
  init_file_utils();
53995
54007
  });
53996
54008
 
53997
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
54009
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
53998
54010
  class CoverageGateEvaluator {
53999
54011
  constructor() {}
54000
54012
  async evaluate(rule, context3) {
@@ -54078,7 +54090,7 @@ var init_coverage_gate_evaluator = __esm(() => {
54078
54090
  init_file_utils();
54079
54091
  });
54080
54092
 
54081
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
54093
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
54082
54094
  class ExitCodeEvaluator {
54083
54095
  executor;
54084
54096
  constructor(executor = new NodeProcessExecutor) {
@@ -54114,7 +54126,7 @@ var init_exit_code_evaluator = __esm(() => {
54114
54126
  init_file_utils();
54115
54127
  });
54116
54128
 
54117
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
54129
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
54118
54130
  class ForbiddenImportEvaluator {
54119
54131
  constructor() {}
54120
54132
  async evaluate(rule, context3) {
@@ -54195,7 +54207,7 @@ var init_forbidden_import_evaluator = __esm(() => {
54195
54207
  init_file_utils();
54196
54208
  });
54197
54209
 
54198
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
54210
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
54199
54211
  class ImportBoundaryEvaluator {
54200
54212
  async evaluate(rule, context3) {
54201
54213
  const config3 = rule.evaluator.config ?? {};
@@ -54288,7 +54300,7 @@ var init_import_boundary_evaluator = __esm(() => {
54288
54300
  init_file_utils();
54289
54301
  });
54290
54302
 
54291
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
54303
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
54292
54304
  class PathEvaluator {
54293
54305
  constructor() {}
54294
54306
  async evaluate(rule, context3) {
@@ -54349,7 +54361,7 @@ var init_path_evaluator = __esm(() => {
54349
54361
  init_file_utils();
54350
54362
  });
54351
54363
 
54352
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
54364
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
54353
54365
  class RegexEvaluator {
54354
54366
  constructor() {}
54355
54367
  async evaluate(rule, context3) {
@@ -54427,7 +54439,7 @@ var init_regex_evaluator = __esm(() => {
54427
54439
  init_file_utils();
54428
54440
  });
54429
54441
 
54430
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
54442
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
54431
54443
  class RipgrepEvaluator {
54432
54444
  executor;
54433
54445
  constructor(executor = new NodeProcessExecutor) {
@@ -54520,7 +54532,7 @@ var init_ripgrep_evaluator = __esm(() => {
54520
54532
  init_file_utils();
54521
54533
  });
54522
54534
 
54523
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
54535
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
54524
54536
  class SchemaArtifactEvaluator {
54525
54537
  constructor() {}
54526
54538
  async evaluate(rule, context3) {
@@ -54598,7 +54610,7 @@ var init_schema_artifact_evaluator = __esm(() => {
54598
54610
  init_file_utils();
54599
54611
  });
54600
54612
 
54601
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
54613
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
54602
54614
  class SecretsScannerEvaluator {
54603
54615
  constructor() {}
54604
54616
  async evaluate(rule, context3) {
@@ -54666,7 +54678,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
54666
54678
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
54667
54679
  });
54668
54680
 
54669
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
54681
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
54670
54682
  class SgEvaluator {
54671
54683
  executor;
54672
54684
  constructor(executor = new NodeProcessExecutor) {
@@ -54763,7 +54775,7 @@ var init_sg_evaluator = __esm(() => {
54763
54775
  init_file_utils();
54764
54776
  });
54765
54777
 
54766
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
54778
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
54767
54779
  class TypeScriptTestPathResolver {
54768
54780
  name = "typescript";
54769
54781
  constructor() {}
@@ -54846,7 +54858,7 @@ function testify(rel) {
54846
54858
  return `${dir}test_${base2}`;
54847
54859
  }
54848
54860
 
54849
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
54861
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
54850
54862
  class TestLocationEvaluator {
54851
54863
  resolvers;
54852
54864
  constructor(resolvers) {
@@ -54921,7 +54933,7 @@ var init_test_location_evaluator = __esm(() => {
54921
54933
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
54922
54934
  });
54923
54935
 
54924
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
54936
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
54925
54937
  class TsdocExportEvaluator {
54926
54938
  constructor() {}
54927
54939
  async evaluate(rule, context3) {
@@ -54941,8 +54953,8 @@ class TsdocExportEvaluator {
54941
54953
  const lines = content.split(`
54942
54954
  `);
54943
54955
  for (const site of findExports(lines, requested)) {
54944
- if (!precededByJsdoc(lines, site.line)) {
54945
- findings.push(createFinding(rule, `Exported ${site.kind} "${site.name}" is missing a JSDoc comment`, file2, {
54956
+ if (!precededByDoc(lines, site.line)) {
54957
+ findings.push(createFinding(rule, `Exported ${site.kind} "${site.name}" is missing a doc comment`, file2, {
54946
54958
  line: site.line,
54947
54959
  code: "tsdoc:missing"
54948
54960
  }));
@@ -54968,7 +54980,7 @@ function findExports(lines, requested) {
54968
54980
  }
54969
54981
  return sites;
54970
54982
  }
54971
- function precededByJsdoc(lines, declarationLine) {
54983
+ function precededByDoc(lines, declarationLine) {
54972
54984
  let cursor2 = declarationLine - 2;
54973
54985
  while (cursor2 >= 0) {
54974
54986
  const prev = lines[cursor2]?.trim() ?? "";
@@ -54979,6 +54991,9 @@ function precededByJsdoc(lines, declarationLine) {
54979
54991
  if (prev.endsWith("*/") || prev.startsWith("/**")) {
54980
54992
  return true;
54981
54993
  }
54994
+ if (prev.startsWith("//")) {
54995
+ return true;
54996
+ }
54982
54997
  if (prev.startsWith("*") || prev.startsWith("@")) {
54983
54998
  cursor2 -= 1;
54984
54999
  continue;
@@ -55003,7 +55018,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
55003
55018
  };
55004
55019
  });
55005
55020
 
55006
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
55021
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
55007
55022
  class JsonFormatter {
55008
55023
  constructor() {}
55009
55024
  format(result) {
@@ -55011,7 +55026,7 @@ class JsonFormatter {
55011
55026
  }
55012
55027
  }
55013
55028
 
55014
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
55029
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
55015
55030
  class TextFormatter {
55016
55031
  constructor() {}
55017
55032
  format(result) {
@@ -55025,7 +55040,7 @@ class TextFormatter {
55025
55040
  }
55026
55041
  }
55027
55042
 
55028
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
55043
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
55029
55044
  function registerBuiltins(host, executor) {
55030
55045
  const path8 = new PathEvaluator;
55031
55046
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -55065,7 +55080,7 @@ var init_builtins = __esm(() => {
55065
55080
  init_tsdoc_export_evaluator();
55066
55081
  });
55067
55082
 
55068
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
55083
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
55069
55084
  class RuleEngineHost {
55070
55085
  evaluators;
55071
55086
  formatters;
@@ -55082,7 +55097,7 @@ var init_rule_engine_host = __esm(() => {
55082
55097
  init_extension2();
55083
55098
  });
55084
55099
 
55085
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
55100
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
55086
55101
  class RuleEngine {
55087
55102
  host;
55088
55103
  events;
@@ -55253,7 +55268,7 @@ var init_engine = __esm(() => {
55253
55268
  init_types2();
55254
55269
  });
55255
55270
 
55256
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
55271
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
55257
55272
  async function bundledRulesRoot() {
55258
55273
  if (cachedRoot2 !== undefined)
55259
55274
  return cachedRoot2;
@@ -55304,7 +55319,7 @@ var init_bundled_rules = __esm(() => {
55304
55319
  init_dist3();
55305
55320
  });
55306
55321
 
55307
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
55322
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
55308
55323
  class DbRulePersistenceAdapter {
55309
55324
  db;
55310
55325
  constructor(db2) {
@@ -55338,7 +55353,7 @@ class DbRulePersistenceAdapter {
55338
55353
  }
55339
55354
  }
55340
55355
 
55341
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
55356
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
55342
55357
  var RULE_ENGINE_SCHEMA_SQL = `
55343
55358
  CREATE TABLE IF NOT EXISTS rule_runs (
55344
55359
  id TEXT PRIMARY KEY,
@@ -55384,10 +55399,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
55384
55399
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
55385
55400
  `;
55386
55401
 
55387
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
55402
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
55388
55403
  var init_persistence2 = () => {};
55389
55404
 
55390
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.3+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
55405
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.4+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
55391
55406
  var init_dist9 = __esm(() => {
55392
55407
  init_extensions();
55393
55408
  init_loader2();
@@ -55587,7 +55602,7 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
55587
55602
  ];
55588
55603
  });
55589
55604
 
55590
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
55605
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
55591
55606
  function queueLogger() {
55592
55607
  if (!_queueLogger)
55593
55608
  _queueLogger = getLogger2("job-queue");
@@ -55797,7 +55812,7 @@ var init_db_job_queue = __esm(() => {
55797
55812
  init_tracing2();
55798
55813
  });
55799
55814
 
55800
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
55815
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
55801
55816
  var exports_job_queue_db = {};
55802
55817
  __export(exports_job_queue_db, {
55803
55818
  DBQueueConsumer: () => DBQueueConsumer,
@@ -57138,6 +57153,110 @@ var init_corpus_migrator = __esm(() => {
57138
57153
  NULL_PRESERVING_KEYS = new Set(["parent_wbs"]);
57139
57154
  });
57140
57155
 
57156
+ // ../../packages/app/src/services/event-names.ts
57157
+ function event(name, source, renderer, payloadPolicy = "metadata-only", tier = "default") {
57158
+ return {
57159
+ name,
57160
+ prefix: name.split(".")[0] ?? name,
57161
+ source,
57162
+ tier,
57163
+ persisted: true,
57164
+ streamed: true,
57165
+ payloadPolicy,
57166
+ renderer
57167
+ };
57168
+ }
57169
+ function systemEventCatalogEntry(name) {
57170
+ return SYSTEM_EVENT_CATALOG.find((entry) => entry.name === name);
57171
+ }
57172
+ function normalizeSystemEventPayload(entry, eventPayload) {
57173
+ if (eventPayload === null || eventPayload === undefined)
57174
+ return null;
57175
+ if (typeof eventPayload !== "object")
57176
+ return { value: eventPayload };
57177
+ const source = eventPayload;
57178
+ if (entry.payloadPolicy === "raw-safe")
57179
+ return { ...source };
57180
+ const redacted = { ...source };
57181
+ for (const key of ["body", "content", "message", "prompt", "query", "response", "value"]) {
57182
+ if (key in redacted) {
57183
+ redacted[key] = "[redacted]";
57184
+ }
57185
+ }
57186
+ return redacted;
57187
+ }
57188
+ var SYSTEM_EVENT_CATALOG, SYSTEM_EVENT_NAMES, SYSTEM_EVENT_PERSISTED_NAMES, SYSTEM_EVENT_STREAMED_NAMES, SYSTEM_EVENT_PREFIXES, SYSTEM_EVENT_DEFAULT_NAMES, SYSTEM_EVENT_DIAGNOSTIC_NAMES, PLANNING_EVENT_NAMES, SYSTEM_EVENT_CATALOG_METADATA;
57189
+ var init_event_names = __esm(() => {
57190
+ SYSTEM_EVENT_CATALOG = [
57191
+ event("task.created", "planning", "planning"),
57192
+ event("task.updated", "planning", "planning"),
57193
+ event("task.transitioned", "planning", "planning"),
57194
+ event("feature.created", "planning", "planning"),
57195
+ event("feature.updated", "planning", "planning"),
57196
+ event("feature.transitioned", "planning", "planning"),
57197
+ event("queue.consumer.started", "queue", "queue"),
57198
+ event("queue.consumer.stopped", "queue", "queue"),
57199
+ event("queue.job.enqueued", "queue", "queue"),
57200
+ event("queue.job.completed", "queue", "queue"),
57201
+ event("queue.job.failed", "queue", "queue"),
57202
+ event("queue.job.retrying", "queue", "queue"),
57203
+ event("queue.stats", "queue", "queue"),
57204
+ event("scheduler.job.executed", "scheduler", "scheduler"),
57205
+ event("message.sent", "message", "message"),
57206
+ event("message.replied", "message", "message"),
57207
+ event("process.spawned", "process", "process"),
57208
+ event("process.exited", "process", "process"),
57209
+ event("process.stopped", "process", "process"),
57210
+ event("process.started", "process", "process"),
57211
+ event("agent.invoke.start", "agent", "agent"),
57212
+ event("agent.invoke.exit", "agent", "agent"),
57213
+ event("agent.started", "agent", "agent"),
57214
+ event("agent.stopped", "agent", "agent"),
57215
+ event("agent.message.sent", "agent", "agent"),
57216
+ event("rule.run.start", "rule", "rule"),
57217
+ event("rule.eval.start", "rule", "rule"),
57218
+ event("rule.eval.done", "rule", "rule"),
57219
+ event("rule.eval.error", "rule", "rule"),
57220
+ event("rule.run.done", "rule", "rule"),
57221
+ event("workflow.run.started", "workflow", "workflow-run"),
57222
+ event("workflow.run.done", "workflow", "workflow-run"),
57223
+ event("workflow.run.failed", "workflow", "workflow-run"),
57224
+ event("workflow.run.finalized", "workflow", "workflow-run"),
57225
+ event("workflow.run.paused", "workflow", "workflow-run"),
57226
+ event("workflow.run.resumed", "workflow", "workflow-run"),
57227
+ event("workflow.run.reseeded", "workflow", "workflow-run"),
57228
+ event("workflow.node.enter", "workflow", "workflow-phase"),
57229
+ event("workflow.phase", "workflow", "workflow-phase"),
57230
+ event("workflow.node.transition", "workflow", "workflow-transition"),
57231
+ event("workflow.transition", "workflow", "workflow-transition"),
57232
+ event("workflow.transition.requested", "workflow", "workflow-transition", "metadata-only", "diagnostic"),
57233
+ event("workflow.transition.denied", "workflow", "workflow-transition", "metadata-only", "diagnostic"),
57234
+ event("workflow.action.start", "workflow", "workflow-action"),
57235
+ event("workflow.action.started", "workflow", "workflow-action"),
57236
+ event("workflow.action.done", "workflow", "workflow-action"),
57237
+ event("workflow.action.finished", "workflow", "workflow-action"),
57238
+ event("workflow.action.failed_continue", "workflow", "workflow-action"),
57239
+ event("workflow.guard.evaluated", "workflow", "workflow-guard", "metadata-only", "diagnostic"),
57240
+ event("workflow.hitl.ask", "workflow", "workflow-hitl", "redacted"),
57241
+ event("workflow.hitl.response", "workflow", "workflow-hitl", "redacted"),
57242
+ event("workflow.hitl.note", "workflow", "workflow-hitl", "redacted"),
57243
+ event("workflow.custom", "workflow", "workflow-custom"),
57244
+ event("api.request.error", "api", "api"),
57245
+ event("bus.emit.done", "bus", "bus", "metadata-only", "diagnostic"),
57246
+ event("bus.emit.noop", "bus", "bus", "metadata-only", "diagnostic"),
57247
+ event("bus.handler.error", "bus", "bus", "metadata-only", "diagnostic"),
57248
+ event("bus.handler.async.enqueued", "bus", "bus", "metadata-only", "diagnostic")
57249
+ ];
57250
+ SYSTEM_EVENT_NAMES = SYSTEM_EVENT_CATALOG.map((entry) => entry.name);
57251
+ SYSTEM_EVENT_PERSISTED_NAMES = SYSTEM_EVENT_CATALOG.filter((entry) => entry.tier === "default").map((entry) => entry.name);
57252
+ SYSTEM_EVENT_STREAMED_NAMES = SYSTEM_EVENT_CATALOG.filter((entry) => entry.tier === "default").map((entry) => entry.name);
57253
+ SYSTEM_EVENT_PREFIXES = Array.from(new Set(SYSTEM_EVENT_CATALOG.map((entry) => entry.prefix)));
57254
+ SYSTEM_EVENT_DEFAULT_NAMES = SYSTEM_EVENT_CATALOG.filter((entry) => entry.tier === "default").map((entry) => entry.name);
57255
+ SYSTEM_EVENT_DIAGNOSTIC_NAMES = SYSTEM_EVENT_CATALOG.filter((entry) => entry.tier === "diagnostic").map((entry) => entry.name);
57256
+ PLANNING_EVENT_NAMES = SYSTEM_EVENT_NAMES;
57257
+ SYSTEM_EVENT_CATALOG_METADATA = SYSTEM_EVENT_CATALOG.map(({ name, prefix, source, tier, renderer }) => ({ name, prefix, source, tier, renderer }));
57258
+ });
57259
+
57141
57260
  // ../../packages/app/src/services/planning-check-base.ts
57142
57261
  class PlanningCheckService {
57143
57262
  fs;
@@ -57256,6 +57375,11 @@ var init_planning_check_base = __esm(() => {
57256
57375
  });
57257
57376
 
57258
57377
  // ../../packages/app/src/services/feature-check.ts
57378
+ var exports_feature_check = {};
57379
+ __export(exports_feature_check, {
57380
+ FeatureCheckService: () => FeatureCheckService,
57381
+ DEFAULT_FEATURE_MATRIX: () => DEFAULT_FEATURE_MATRIX
57382
+ });
57259
57383
  var DEFAULT_FEATURE_MATRIX, FeatureCheckService;
57260
57384
  var init_feature_check = __esm(() => {
57261
57385
  init_src2();
@@ -57574,6 +57698,10 @@ class FeatureService {
57574
57698
  const body = stripLeadingSectionHeader(raw, sectionName);
57575
57699
  return this.ctx.writeService.updateSection(ref, sectionName, body);
57576
57700
  }
57701
+ async updateBody(id, body) {
57702
+ const ref = await this.refFor(id);
57703
+ return this.ctx.writeService.updateBody(ref, body);
57704
+ }
57577
57705
  async list() {
57578
57706
  const results = [];
57579
57707
  try {
@@ -58077,18 +58205,18 @@ class BusPlanningEventEmitter {
58077
58205
  this.bus = bus;
58078
58206
  this.dao = dao2;
58079
58207
  }
58080
- async emit(event) {
58208
+ async emit(event2) {
58081
58209
  await this.dao.insert({
58082
58210
  id: createId("pev"),
58083
- entity_kind: event.entity.kind,
58084
- entity_id: event.entity.id,
58085
- event: event.event,
58086
- from_status: event.from ?? null,
58087
- to_status: event.to ?? null,
58088
- payload: event.data ? JSON.stringify(event.data) : null,
58089
- created_at: event.at
58211
+ entity_kind: event2.entity.kind,
58212
+ entity_id: event2.entity.id,
58213
+ event: event2.event,
58214
+ from_status: event2.from ?? null,
58215
+ to_status: event2.to ?? null,
58216
+ payload: event2.data ? JSON.stringify(event2.data) : null,
58217
+ created_at: event2.at
58090
58218
  });
58091
- this.bus.emit(event.event, event);
58219
+ this.bus.emit(event2.event, event2);
58092
58220
  }
58093
58221
  }
58094
58222
  var init_planning_events = __esm(() => {
@@ -58202,14 +58330,14 @@ class PlanningWriteService {
58202
58330
  const serialized = doc2.serialize();
58203
58331
  await atomicWriteAsync(ref.filePath, serialized, ref.id, this.fs, this.projectName);
58204
58332
  const eventName = resolveEventName(mutation.kind, domain2, statusChanged);
58205
- const event = {
58333
+ const event2 = {
58206
58334
  event: eventName,
58207
58335
  entity: { kind: domain2, id: ref.id },
58208
58336
  at: now,
58209
58337
  ...fromStatus !== undefined ? { from: fromStatus } : {},
58210
58338
  ...toStatus !== undefined ? { to: toStatus } : {}
58211
58339
  };
58212
- await this.emitter.emit(event);
58340
+ await this.emitter.emit(event2);
58213
58341
  const warnings = doc2.strippedHeadings.map((line) => `Stripped same-level heading from section body (would become a phantom section): "${line}". ` + "Use bullet lists, tables, or **bold** labels for sub-structure instead.");
58214
58342
  for (const dup of doc2.duplicateSectionNames) {
58215
58343
  warnings.push(`Dropped duplicate "${dup}" section (appeared more than once in the file \u2014 ` + "likely a copy-paste or double-write error). The first occurrence was kept.");
@@ -58306,6 +58434,14 @@ import { delimiter, join as join7, relative, resolve } from "path";
58306
58434
 
58307
58435
  class RuleService {
58308
58436
  context;
58437
+ bridgeEvents(serverBus) {
58438
+ const bridge = {
58439
+ on: (event2, listener) => serverBus.on(event2, listener),
58440
+ off: (event2, listener) => serverBus.off(event2, listener),
58441
+ emit: (event2, detail) => Promise.resolve(serverBus.emit(event2, detail))
58442
+ };
58443
+ return bridge;
58444
+ }
58309
58445
  constructor(context3) {
58310
58446
  this.context = context3;
58311
58447
  }
@@ -58338,7 +58474,13 @@ class RuleService {
58338
58474
  dryRun,
58339
58475
  metadataJson: JSON.stringify(selectedRule === undefined ? { cwd: this.context.cwd } : { cwd: this.context.cwd, rule: selectedRule })
58340
58476
  };
58341
- const engineOptions = { persistence: persistence2, runId, runMeta, fileSystem: this.context.fs };
58477
+ const engineOptions = {
58478
+ persistence: persistence2,
58479
+ runId,
58480
+ runMeta,
58481
+ fileSystem: this.context.fs,
58482
+ ...this.context.events !== undefined ? { events: this.bridgeEvents(this.context.events) } : {}
58483
+ };
58342
58484
  const engine2 = new RuleEngine(engineOptions);
58343
58485
  let result;
58344
58486
  if (verbose && !json3) {
@@ -58503,8 +58645,22 @@ ${ruleIds.join(`
58503
58645
  const disabledRules = rules.filter((r) => r.enabled === false);
58504
58646
  const enabledCount = enabledRules.length;
58505
58647
  const totalCount = rules.length;
58506
- const events2 = new EventBus;
58507
- const engine2 = new RuleEngine({ ...engineOptions, events: events2, fileSystem: this.context.fs });
58648
+ const localBus = new EventBus;
58649
+ if (this.context.events !== undefined) {
58650
+ const serverBus = this.context.events;
58651
+ for (const eventName of [
58652
+ "rule.run.start",
58653
+ "rule.eval.start",
58654
+ "rule.eval.done",
58655
+ "rule.eval.error",
58656
+ "rule.run.done"
58657
+ ]) {
58658
+ localBus.on(eventName, (detail) => {
58659
+ serverBus.emit(eventName, detail);
58660
+ });
58661
+ }
58662
+ }
58663
+ const engine2 = new RuleEngine({ ...engineOptions, events: localBus, fileSystem: this.context.fs });
58508
58664
  const noun = totalCount === 1 ? "rule" : "rules";
58509
58665
  const suffix = disabledRules.length > 0 ? color.dim(` (${disabledRules.length} disabled)`) : "";
58510
58666
  this.context.output.error(`Evaluating ${totalCount} ${noun}\u2026${suffix}`);
@@ -58514,14 +58670,14 @@ ${ruleIds.join(`
58514
58670
  this.context.output.error(`${color.dim("\u25B6")} ${counter} ${rule.id} ${type}`);
58515
58671
  this.context.output.error(` ${color.dim("\u2298 disabled")} \u2014 skipped`);
58516
58672
  }
58517
- events2.on("rule.eval.start", ({ ruleId, index: index2, total }) => {
58673
+ localBus.on("rule.eval.start", ({ ruleId, index: index2, total }) => {
58518
58674
  const shifted = index2 + disabledRules.length;
58519
58675
  const counter = color.dim(`[${shifted}/${total + disabledRules.length}]`);
58520
58676
  const rule = rules.find((r) => r.id === ruleId);
58521
58677
  const type = color.dim(rule ? `(${rule.evaluator.type})` : "");
58522
58678
  this.context.output.error(`${color.dim("\u25B6")} ${counter} ${ruleId} ${type}`);
58523
58679
  });
58524
- events2.on("rule.eval.done", ({ findings, durationMs, details }) => {
58680
+ localBus.on("rule.eval.done", ({ findings, durationMs, details }) => {
58525
58681
  const elapsed = (durationMs / 1000).toFixed(2);
58526
58682
  if (findings === 0) {
58527
58683
  this.context.output.error(` ${color.green("\u2713 passed")} - ${elapsed}s`);
@@ -58532,7 +58688,7 @@ ${ruleIds.join(`
58532
58688
  }
58533
58689
  }
58534
58690
  });
58535
- events2.on("rule.eval.error", ({ ruleId, error: error51 }) => {
58691
+ localBus.on("rule.eval.error", ({ ruleId, error: error51 }) => {
58536
58692
  this.context.output.error(` ${color.yellow(`! evaluator error in ${ruleId}: ${error51}`)}`);
58537
58693
  });
58538
58694
  const result = fixMode !== "none" ? await engine2.evaluateWithFixes([...rules], this.context.cwd, fixMode, stopOnFirst) : await engine2.evaluate([...rules], this.context.cwd, stopOnFirst);
@@ -58996,6 +59152,79 @@ class SupervisorService {
58996
59152
  }
58997
59153
  var DEFAULT_RING_BUFFER_SIZE = 500;
58998
59154
 
59155
+ // ../../packages/app/src/services/system-event-tap.ts
59156
+ function registerSystemEventTap(bus, dao2, logger3, options = {}) {
59157
+ const handlers = new Map;
59158
+ const inFlight = new Set;
59159
+ const diagnosticEnabled = options.diagnosticEnabled === true;
59160
+ for (const entry of SYSTEM_EVENT_CATALOG) {
59161
+ if (entry.tier === "diagnostic" && !diagnosticEnabled)
59162
+ continue;
59163
+ const handler = (event2) => {
59164
+ const occurredAt = new Date().toISOString();
59165
+ const payloadJson = safeStringify(normalizeSystemEventPayload(entry, event2));
59166
+ const actor = extractSystemEventActor(event2);
59167
+ const p = persist(dao2, entry.name, occurredAt, actor, payloadJson, logger3);
59168
+ inFlight.add(p);
59169
+ p.finally(() => inFlight.delete(p));
59170
+ };
59171
+ handlers.set(entry.name, handler);
59172
+ bus.on(entry.name, handler);
59173
+ }
59174
+ return {
59175
+ unsubscribe: () => {
59176
+ for (const [name, handler] of handlers) {
59177
+ bus.off(name, handler);
59178
+ }
59179
+ handlers.clear();
59180
+ },
59181
+ flush: async () => {
59182
+ while (inFlight.size > 0) {
59183
+ await Promise.allSettled(inFlight);
59184
+ }
59185
+ }
59186
+ };
59187
+ }
59188
+ async function persist(dao2, name, occurredAt, actor, payloadJson, logger3) {
59189
+ try {
59190
+ await dao2.insert({
59191
+ id: createId("sev"),
59192
+ event_name: name,
59193
+ occurred_at: occurredAt,
59194
+ actor,
59195
+ payload_json: payloadJson
59196
+ });
59197
+ await dao2.prune(SYSTEM_EVENTS_CAP);
59198
+ } catch (error51) {
59199
+ logger3.warn("system_events tap: persist failed", { name, error: stringifyError(error51) });
59200
+ }
59201
+ }
59202
+ function safeStringify(event2) {
59203
+ try {
59204
+ return JSON.stringify(event2 ?? null);
59205
+ } catch {
59206
+ return null;
59207
+ }
59208
+ }
59209
+ function extractSystemEventActor(event2) {
59210
+ if (event2 && typeof event2 === "object") {
59211
+ const candidate = event2.actor;
59212
+ if (typeof candidate === "string")
59213
+ return candidate;
59214
+ }
59215
+ return null;
59216
+ }
59217
+ function stringifyError(error51) {
59218
+ if (error51 instanceof Error)
59219
+ return `${error51.name}: ${error51.message}`;
59220
+ return String(error51);
59221
+ }
59222
+ var SYSTEM_EVENTS_CAP = 1e4;
59223
+ var init_system_event_tap = __esm(() => {
59224
+ init_src2();
59225
+ init_event_names();
59226
+ });
59227
+
58999
59228
  // ../../packages/app/src/services/task-check.ts
59000
59229
  import { dirname as dirname7, join as join8 } from "path";
59001
59230
  function isPlaceholderBody(body) {
@@ -61608,14 +61837,19 @@ class WorkflowAppService {
61608
61837
  }
61609
61838
  }
61610
61839
  async run(file2, opts = {}) {
61611
- const svc = await this.createEngineService({ recordSelfPid: opts.recordSelfPid === true });
61840
+ const eventsBus = this.ctx.events?.();
61841
+ const svc = await this.createEngineService({
61842
+ recordSelfPid: opts.recordSelfPid === true,
61843
+ events: eventsBus
61844
+ });
61612
61845
  const runId = opts.runId ?? crypto.randomUUID();
61613
61846
  const isDry = opts.dryRun === true;
61614
61847
  const result = await svc.runFile(file2, {
61615
61848
  workdir: this.ctx.cwd,
61616
61849
  runId,
61617
61850
  ...opts.vars ? { vars: opts.vars } : {},
61618
- ...isDry ? { dryRun: true } : {}
61851
+ ...isDry ? { dryRun: true } : {},
61852
+ ...eventsBus !== undefined ? { events: this.bridgeEngineEvents(eventsBus) } : {}
61619
61853
  });
61620
61854
  if (isDry) {
61621
61855
  const db2 = await this.ctx.getDb();
@@ -61830,6 +62064,14 @@ class WorkflowAppService {
61830
62064
  const adapter = bus ? new ObservableWorkflowAdapter(persistence2, bus) : persistence2;
61831
62065
  return new WorkflowService(host, adapter);
61832
62066
  }
62067
+ bridgeEngineEvents(serverBus) {
62068
+ const bridge = {
62069
+ on: (event2, listener) => serverBus.on(event2, listener),
62070
+ off: (event2, listener) => serverBus.off(event2, listener),
62071
+ emit: (event2, detail) => Promise.resolve(serverBus.emit(event2, detail))
62072
+ };
62073
+ return bridge;
62074
+ }
61833
62075
  }
61834
62076
  async function fileExists(path8) {
61835
62077
  try {
@@ -62003,16 +62245,16 @@ var init_lifecycle_adapter = __esm(() => {
62003
62245
  });
62004
62246
 
62005
62247
  // ../../packages/app/src/workflow/step-reporter.ts
62006
- function renderStepLine(event) {
62007
- if (isActionFinished(event)) {
62008
- const mark = event.ok ? "\u2713" : "\u2717";
62009
- return ` ${mark} ${event.status} (${formatDuration(event.durationMs)})`;
62248
+ function renderStepLine(event2) {
62249
+ if (isActionFinished(event2)) {
62250
+ const mark = event2.ok ? "\u2713" : "\u2717";
62251
+ return ` ${mark} ${event2.status} (${formatDuration(event2.durationMs)})`;
62010
62252
  }
62011
- if (isActionStarted(event)) {
62012
- return ` \u2192 ${event.node}: ${event.kind}\u2026`;
62253
+ if (isActionStarted(event2)) {
62254
+ return ` \u2192 ${event2.node}: ${event2.kind}\u2026`;
62013
62255
  }
62014
- if (isPhase(event)) {
62015
- return `\u25B6 ${event.phase} [${event.status}]`;
62256
+ if (isPhase(event2)) {
62257
+ return `\u25B6 ${event2.phase} [${event2.status}]`;
62016
62258
  }
62017
62259
  return null;
62018
62260
  }
@@ -62033,15 +62275,19 @@ var isActionStarted = (e) => ("kind" in e) && ("node" in e), isActionFinished =
62033
62275
  // ../../packages/app/src/index.ts
62034
62276
  var exports_src2 = {};
62035
62277
  __export(exports_src2, {
62278
+ systemEventCatalogEntry: () => systemEventCatalogEntry,
62036
62279
  resolvePlanningFolders: () => resolvePlanningFolders,
62037
62280
  renderTesting: () => renderTesting,
62038
62281
  renderStepLine: () => renderStepLine,
62039
62282
  renderSolutionFromDiff: () => renderSolutionFromDiff,
62040
62283
  renderRunPlan: () => renderRunPlan,
62041
62284
  renderReview: () => renderReview,
62285
+ registerSystemEventTap: () => registerSystemEventTap,
62042
62286
  registerSpurBuiltins: () => registerSpurBuiltins,
62043
62287
  readVerdict: () => readVerdict,
62044
62288
  parseVerdict: () => parseVerdict,
62289
+ normalizeSystemEventPayload: () => normalizeSystemEventPayload,
62290
+ extractSystemEventActor: () => extractSystemEventActor,
62045
62291
  deriveVerdict: () => deriveVerdict,
62046
62292
  WorkflowAppService: () => WorkflowAppService,
62047
62293
  TeamService: () => TeamService,
@@ -62050,11 +62296,19 @@ __export(exports_src2, {
62050
62296
  TASK_LIFECYCLE_PROFILE: () => TASK_LIFECYCLE_PROFILE,
62051
62297
  TASK_ACTION_COMMANDS: () => TASK_ACTION_COMMANDS,
62052
62298
  SupervisorService: () => SupervisorService,
62299
+ SYSTEM_EVENT_STREAMED_NAMES: () => SYSTEM_EVENT_STREAMED_NAMES,
62300
+ SYSTEM_EVENT_PREFIXES: () => SYSTEM_EVENT_PREFIXES,
62301
+ SYSTEM_EVENT_PERSISTED_NAMES: () => SYSTEM_EVENT_PERSISTED_NAMES,
62302
+ SYSTEM_EVENT_NAMES: () => SYSTEM_EVENT_NAMES,
62303
+ SYSTEM_EVENT_CATALOG_METADATA: () => SYSTEM_EVENT_CATALOG_METADATA,
62304
+ SYSTEM_EVENT_CATALOG: () => SYSTEM_EVENT_CATALOG,
62305
+ SYSTEM_EVENTS_CAP: () => SYSTEM_EVENTS_CAP,
62053
62306
  RuleService: () => RuleService,
62054
62307
  RuleCheckActionRunner: () => RuleCheckActionRunner,
62055
62308
  ResponseValidateActionRunner: () => ResponseValidateActionRunner,
62056
62309
  PluginService: () => PluginService,
62057
62310
  PlanningWriteService: () => PlanningWriteService,
62311
+ PLANNING_EVENT_NAMES: () => PLANNING_EVENT_NAMES,
62058
62312
  ObservableWorkflowAdapter: () => ObservableWorkflowAdapter,
62059
62313
  LifecycleAdapter: () => LifecycleAdapter,
62060
62314
  JobWorkerService: () => JobWorkerService,
@@ -62078,12 +62332,14 @@ var init_src3 = __esm(() => {
62078
62332
  init_planning_folders();
62079
62333
  init_agent_service();
62080
62334
  init_corpus_migrator();
62335
+ init_event_names();
62081
62336
  init_feature_check();
62082
62337
  init_feature_service();
62083
62338
  init_history_service();
62084
62339
  init_planning_events();
62085
62340
  init_planning_write_service();
62086
62341
  init_rule_service();
62342
+ init_system_event_tap();
62087
62343
  init_task_check();
62088
62344
  init_task_record();
62089
62345
  init_task_service();
@@ -62176,18 +62432,18 @@ var {
62176
62432
  init_src();
62177
62433
  init_loader();
62178
62434
 
62179
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application-node.js
62435
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application-node.js
62180
62436
  init_dist4();
62181
62437
  init_dist3();
62182
62438
  import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync4 } from "fs";
62183
62439
  import { dirname as dirname4 } from "path";
62184
62440
 
62185
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application/index.js
62441
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application/index.js
62186
62442
  init_default_observers();
62187
62443
  init_event_bus();
62188
62444
  init_logger3();
62189
62445
 
62190
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
62446
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
62191
62447
  class NoopSchedulerAdapter {
62192
62448
  constructor() {}
62193
62449
  register(_cron, _action) {}
@@ -62195,7 +62451,7 @@ class NoopSchedulerAdapter {
62195
62451
  async stop() {}
62196
62452
  }
62197
62453
 
62198
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
62454
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
62199
62455
  function initScheduler(adapter, cronEntries) {
62200
62456
  const resolved = adapter ?? new NoopSchedulerAdapter;
62201
62457
  if (cronEntries) {
@@ -62206,7 +62462,7 @@ function initScheduler(adapter, cronEntries) {
62206
62462
  return resolved;
62207
62463
  }
62208
62464
 
62209
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
62465
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
62210
62466
  init_logger3();
62211
62467
  init_metrics();
62212
62468
  init_sdk();
@@ -62299,7 +62555,7 @@ function dbPlugin(db2) {
62299
62555
  };
62300
62556
  }
62301
62557
 
62302
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
62558
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
62303
62559
  init_logger3();
62304
62560
 
62305
62561
  class PluginHost {
@@ -62387,7 +62643,7 @@ class PluginHost {
62387
62643
  }
62388
62644
  }
62389
62645
 
62390
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application/index.js
62646
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application/index.js
62391
62647
  async function performShutdown(state, reason) {
62392
62648
  if (state.stopped)
62393
62649
  return;
@@ -62482,10 +62738,10 @@ async function runApplication(options) {
62482
62738
  }
62483
62739
  }
62484
62740
 
62485
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application-node.js
62741
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application-node.js
62486
62742
  init_scheduler_node();
62487
62743
 
62488
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
62744
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
62489
62745
  var import_api14 = __toESM(require_src(), 1);
62490
62746
 
62491
62747
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -65501,7 +65757,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
65501
65757
  }), JsonTraceSerializer));
65502
65758
  }
65503
65759
  }
65504
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
65760
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
65505
65761
  var import_resources2 = __toESM(require_src4(), 1);
65506
65762
  var import_sdk_trace_node = __toESM(require_src8(), 1);
65507
65763
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -65552,7 +65808,7 @@ async function shutdownNodeTelemetry() {
65552
65808
  await Promise.all(pending);
65553
65809
  }
65554
65810
 
65555
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.3+ae9bf3ddb9f87572/node_modules/@gobing-ai/ts-infra/dist/application-node.js
65811
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.4+feaf3098ef4ce747/node_modules/@gobing-ai/ts-infra/dist/application-node.js
65556
65812
  class ConfigValidationError extends Error {
65557
65813
  constructor(message) {
65558
65814
  super(message);
@@ -69925,7 +70181,7 @@ import { join as join13, resolve as resolve5 } from "path";
69925
70181
  var CLI_CONFIG = {
69926
70182
  binaryName: "spur",
69927
70183
  binaryLabel: "spur",
69928
- binaryVersion: "0.3.3",
70184
+ binaryVersion: "0.3.4",
69929
70185
  configDir: ".spur",
69930
70186
  configFile: ".spur/config.yaml",
69931
70187
  databaseFile: ".spur/spur.db"
@@ -70520,15 +70776,17 @@ function formatTraceDetail(detail) {
70520
70776
 
70521
70777
  // src/commands/serve.ts
70522
70778
  init_src();
70779
+ import { join as join18 } from "path";
70523
70780
 
70524
70781
  // ../server/src/index.ts
70525
70782
  init_src();
70526
70783
 
70527
70784
  // ../server/src/serve.ts
70528
70785
  init_src3();
70786
+ init_src();
70529
70787
  init_loader();
70530
70788
  init_src2();
70531
- import { dirname as dirname9, isAbsolute as isAbsolute3, join as join16 } from "path";
70789
+ import { dirname as dirname10, isAbsolute as isAbsolute3, join as join17 } from "path";
70532
70790
  init_dist3();
70533
70791
 
70534
70792
  // ../server/src/bootstrap.ts
@@ -70752,8 +71010,8 @@ class EventPublisher {
70752
71010
  get size() {
70753
71011
  return this.#listenersMap.size;
70754
71012
  }
70755
- publish(event, payload) {
70756
- const listeners = this.#listenersMap.get(event);
71013
+ publish(event2, payload) {
71014
+ const listeners = this.#listenersMap.get(event2);
70757
71015
  if (!listeners) {
70758
71016
  return;
70759
71017
  }
@@ -70761,17 +71019,17 @@ class EventPublisher {
70761
71019
  listener(payload);
70762
71020
  }
70763
71021
  }
70764
- subscribe(event, listenerOrOptions) {
71022
+ subscribe(event2, listenerOrOptions) {
70765
71023
  if (typeof listenerOrOptions === "function") {
70766
- let listeners = this.#listenersMap.get(event);
71024
+ let listeners = this.#listenersMap.get(event2);
70767
71025
  if (!listeners) {
70768
- this.#listenersMap.set(event, listeners = []);
71026
+ this.#listenersMap.set(event2, listeners = []);
70769
71027
  }
70770
71028
  listeners.push(listenerOrOptions);
70771
71029
  return once9(() => {
70772
71030
  listeners.splice(listeners.indexOf(listenerOrOptions), 1);
70773
71031
  if (listeners.length === 0) {
70774
- this.#listenersMap.delete(event);
71032
+ this.#listenersMap.delete(event2);
70775
71033
  }
70776
71034
  });
70777
71035
  }
@@ -70780,7 +71038,7 @@ class EventPublisher {
70780
71038
  signal?.throwIfAborted();
70781
71039
  const bufferedEvents = [];
70782
71040
  const pullResolvers = [];
70783
- const unsubscribe = this.subscribe(event, (payload) => {
71041
+ const unsubscribe = this.subscribe(event2, (payload) => {
70784
71042
  const resolver = pullResolvers.shift();
70785
71043
  if (resolver) {
70786
71044
  resolver[0]({ done: false, value: payload });
@@ -70791,9 +71049,9 @@ class EventPublisher {
70791
71049
  }
70792
71050
  }
70793
71051
  });
70794
- const abortListener = (event2) => {
71052
+ const abortListener = (event22) => {
70795
71053
  unsubscribe();
70796
- pullResolvers.forEach((resolver) => resolver[1](event2.target.reason));
71054
+ pullResolvers.forEach((resolver) => resolver[1](event22.target.reason));
70797
71055
  pullResolvers.length = 0;
70798
71056
  bufferedEvents.length = 0;
70799
71057
  };
@@ -71176,8 +71434,8 @@ class EventDecoderStream extends TransformStream {
71176
71434
  super({
71177
71435
  start(controller) {
71178
71436
  decoder = new EventDecoder({
71179
- onEvent: (event) => {
71180
- controller.enqueue(event);
71437
+ onEvent: (event2) => {
71438
+ controller.enqueue(event2);
71181
71439
  }
71182
71440
  });
71183
71441
  },
@@ -71196,8 +71454,8 @@ function assertEventId(id) {
71196
71454
  throw new EventEncoderError("Event's id must not contain a newline character");
71197
71455
  }
71198
71456
  }
71199
- function assertEventName(event) {
71200
- if (event.includes(`
71457
+ function assertEventName(event2) {
71458
+ if (event2.includes(`
71201
71459
  `)) {
71202
71460
  throw new EventEncoderError("Event's event must not contain a newline character");
71203
71461
  }
@@ -71480,13 +71738,13 @@ function toEventStream(iterator, options = {}) {
71480
71738
  }
71481
71739
  const meta3 = getEventMeta(value2.value);
71482
71740
  if (!value2.done || value2.value !== undefined || meta3 !== undefined) {
71483
- const event = value2.done ? "done" : "message";
71741
+ const event2 = value2.done ? "done" : "message";
71484
71742
  controller.enqueue(encodeEventMessage({
71485
71743
  ...meta3,
71486
- event,
71744
+ event: event2,
71487
71745
  data: stringifyJSON(value2.value)
71488
71746
  }));
71489
- span?.addEvent(event);
71747
+ span?.addEvent(event2);
71490
71748
  }
71491
71749
  if (value2.done) {
71492
71750
  controller.close();
@@ -74476,8 +74734,8 @@ var Hono = class _Hono {
74476
74734
  return this.fetch(new Request(/^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`, requestInit), Env, executionCtx);
74477
74735
  };
74478
74736
  fire = () => {
74479
- addEventListener("fetch", (event) => {
74480
- event.respondWith(this.#dispatch(event.request, event, undefined, event.request.method));
74737
+ addEventListener("fetch", (event2) => {
74738
+ event2.respondWith(this.#dispatch(event2.request, event2, undefined, event2.request.method));
74481
74739
  });
74482
74740
  };
74483
74741
  };
@@ -75734,6 +75992,12 @@ class LockTimeoutError extends Error {
75734
75992
  }
75735
75993
 
75736
75994
  // ../server/src/middleware/error-handler.ts
75995
+ function hasHttpStatus(err) {
75996
+ return typeof err === "object" && err !== null && "status" in err && typeof err.status === "number";
75997
+ }
75998
+ function isAppErrorLike(err) {
75999
+ return isAppError(err);
76000
+ }
75737
76001
  function errorEnvelope(code, message, details) {
75738
76002
  return { ok: false, error: { code, message, ...details !== undefined ? { details } : {} } };
75739
76003
  }
@@ -75751,37 +76015,72 @@ function apiCodeForStatus(status) {
75751
76015
  return "INTERNAL_ERROR";
75752
76016
  }
75753
76017
  }
75754
- var globalErrorHandler2 = (err, c3) => {
75755
- const requestId = c3.get("requestId");
75756
- const isProd = false;
75757
- if (err.status !== undefined) {
75758
- const status = err.status ?? 500;
75759
- const msg = isProd ? "Internal server error" : String(err instanceof Error ? err.message : err);
75760
- const details2 = isProd ? undefined : err instanceof Error ? { stack: err.stack, requestId } : { raw: String(err), requestId };
75761
- return c3.json(errorEnvelope(apiCodeForStatus(status), msg, details2), status);
76018
+ function resolveError(err, requestId, isProd) {
76019
+ if (hasHttpStatus(err)) {
76020
+ const status = err.status;
76021
+ const msg = isProd ? "Internal server error" : err.message;
76022
+ const details2 = isProd ? undefined : { stack: err instanceof Error ? err.stack : undefined, requestId };
76023
+ return { status, apiCode: apiCodeForStatus(status), message: msg, details: details2 };
75762
76024
  }
75763
76025
  const message = err instanceof Error ? err.message : String(err);
75764
76026
  if (err instanceof GuardDeniedError) {
75765
- return c3.json(errorEnvelope("GUARD_DENIED", isProd ? "Transition blocked by lifecycle guard" : message, { requestId }), 409);
76027
+ return {
76028
+ status: 409,
76029
+ apiCode: "GUARD_DENIED",
76030
+ message: isProd ? "Transition blocked by lifecycle guard" : message,
76031
+ details: { requestId }
76032
+ };
75766
76033
  }
75767
76034
  if (err instanceof LockTimeoutError) {
75768
- return c3.json(errorEnvelope("LOCK_TIMEOUT", isProd ? "Write lock timed out \u2014 retry later" : message, { requestId }), 503);
76035
+ return {
76036
+ status: 503,
76037
+ apiCode: "LOCK_TIMEOUT",
76038
+ message: isProd ? "Write lock timed out \u2014 retry later" : message,
76039
+ details: { requestId }
76040
+ };
75769
76041
  }
75770
- if (isAppError(err)) {
76042
+ if (isAppErrorLike(err)) {
75771
76043
  const errCode = err.code;
75772
- const code = errCode === "NOT_FOUND" ? 404 : errCode === "VALIDATION" ? 422 : errCode === "CONFLICT" ? 409 : 500;
75773
- const apiCode = code === 404 ? "NOT_FOUND" : code === 422 ? "VALIDATION_FAILED" : code === 409 ? "CONFLICT" : "INTERNAL_ERROR";
75774
- const clientMsg = isProd ? "Internal server error" : code === 500 ? "Internal server error" : message;
75775
- return c3.json(errorEnvelope(apiCode, clientMsg, isProd ? undefined : { requestId }), code);
76044
+ const status = errCode === "NOT_FOUND" ? 404 : errCode === "VALIDATION" ? 422 : errCode === "CONFLICT" ? 409 : 500;
76045
+ const apiCode = apiCodeForStatus(status);
76046
+ const clientMsg = isProd || status === 500 ? "Internal server error" : message;
76047
+ return { status, apiCode, message: clientMsg, details: isProd ? undefined : { requestId } };
75776
76048
  }
75777
76049
  if (message.includes("Lifecycle transition denied")) {
75778
- return c3.json(errorEnvelope("GUARD_DENIED", isProd ? "Transition blocked by lifecycle guard" : message, { requestId }), 409);
76050
+ return {
76051
+ status: 409,
76052
+ apiCode: "GUARD_DENIED",
76053
+ message: isProd ? "Transition blocked by lifecycle guard" : message,
76054
+ details: { requestId }
76055
+ };
75779
76056
  }
75780
76057
  if (message.includes("Cannot acquire") && message.includes("lock")) {
75781
- return c3.json(errorEnvelope("LOCK_TIMEOUT", isProd ? "Write lock timed out \u2014 retry later" : message, { requestId }), 503);
76058
+ return {
76059
+ status: 503,
76060
+ apiCode: "LOCK_TIMEOUT",
76061
+ message: isProd ? "Write lock timed out \u2014 retry later" : message,
76062
+ details: { requestId }
76063
+ };
75782
76064
  }
75783
76065
  const details = isProd ? undefined : err instanceof Error ? { stack: err.stack, requestId } : { raw: String(err), requestId };
75784
- return c3.json(errorEnvelope("INTERNAL_ERROR", isProd ? "Internal server error" : message, details), 500);
76066
+ return { status: 500, apiCode: "INTERNAL_ERROR", message: isProd ? "Internal server error" : message, details };
76067
+ }
76068
+ var globalErrorHandler2 = (err, c3) => {
76069
+ const requestId = c3.get("requestId");
76070
+ const isProd = false;
76071
+ const resolved = resolveError(err, requestId, isProd);
76072
+ const ctx = c3.get("ctx");
76073
+ if (ctx) {
76074
+ ctx.eventBus()?.emit("api.request.error", {
76075
+ method: c3.req.method,
76076
+ path: c3.req.path,
76077
+ status: resolved.status,
76078
+ route: c3.req.routePath,
76079
+ code: resolved.apiCode,
76080
+ requestId: requestId ?? null
76081
+ });
76082
+ }
76083
+ return c3.json(errorEnvelope(resolved.apiCode, resolved.message, resolved.details), resolved.status);
75785
76084
  };
75786
76085
 
75787
76086
  // ../server/src/middleware/request-id.ts
@@ -75831,29 +76130,17 @@ function mountMiddleware(app, appRt) {
75831
76130
  }
75832
76131
 
75833
76132
  // ../server/src/modules/events/event-names.ts
75834
- var PLANNING_EVENT_NAMES = [
75835
- "task.created",
75836
- "task.updated",
75837
- "task.transitioned",
75838
- "feature.created",
75839
- "feature.updated",
75840
- "feature.transitioned",
75841
- "queue.consumer.started",
75842
- "queue.consumer.stopped",
75843
- "queue.job.enqueued",
75844
- "queue.job.completed",
75845
- "queue.job.failed",
75846
- "queue.job.retrying",
75847
- "queue.stats",
75848
- "scheduler.job.executed",
75849
- "message.sent",
75850
- "message.replied",
75851
- "process.spawned",
75852
- "process.exited",
75853
- "process.stopped"
75854
- ];
76133
+ init_event_names();
75855
76134
 
75856
76135
  // ../server/src/modules/events/index.ts
76136
+ function extractSystemEventActor2(event2) {
76137
+ if (event2 && typeof event2 === "object") {
76138
+ const candidate = event2.actor;
76139
+ if (typeof candidate === "string")
76140
+ return candidate;
76141
+ }
76142
+ return null;
76143
+ }
75857
76144
  function sendKeepalive(closed, controller, encoder) {
75858
76145
  if (closed.current)
75859
76146
  return;
@@ -75868,6 +76155,10 @@ var eventsModule = {
75868
76155
  mount(app, ctx) {
75869
76156
  if (!ctx)
75870
76157
  return;
76158
+ const baseNames = SYSTEM_EVENT_STREAMED_NAMES;
76159
+ const diagnosticEnabled = typeof ctx.bootConfig === "function" && ctx.bootConfig().events.diagnostic === true;
76160
+ const diagnosticNames = diagnosticEnabled ? SYSTEM_EVENT_CATALOG.filter((entry) => entry.tier === "diagnostic" && entry.streamed).map((entry) => entry.name) : [];
76161
+ const streamNames = [...baseNames, ...diagnosticNames];
75871
76162
  app.get("/api/events/planning", (c3) => {
75872
76163
  const bus = ctx.eventBus();
75873
76164
  const closed = { current: false };
@@ -75901,15 +76192,18 @@ var eventsModule = {
75901
76192
  }
75902
76193
  signal.addEventListener("abort", teardown);
75903
76194
  heartbeatInterval = setInterval(sendKeepalive, 15000, closed, controller, encoder);
75904
- for (const name of PLANNING_EVENT_NAMES) {
75905
- const handler = (event) => {
76195
+ for (const name of streamNames) {
76196
+ const handler = (event2) => {
75906
76197
  if (closed.current)
75907
76198
  return;
76199
+ const entry = systemEventCatalogEntry(name);
75908
76200
  const envelope = {
75909
76201
  eventName: name,
75910
76202
  occurredAt: new Date().toISOString(),
75911
- actor: null,
75912
- payload: event
76203
+ actor: extractSystemEventActor2(event2),
76204
+ prefix: entry?.prefix ?? name.split(".")[0],
76205
+ renderer: entry?.renderer ?? "generic",
76206
+ payload: entry ? normalizeSystemEventPayload(entry, event2) : null
75913
76207
  };
75914
76208
  try {
75915
76209
  controller.enqueue(encoder.encode(`data: ${JSON.stringify(envelope)}
@@ -75956,16 +76250,15 @@ var eventsModule = {
75956
76250
  eventName: row.event_name,
75957
76251
  occurredAt: row.occurred_at,
75958
76252
  actor: row.actor,
76253
+ prefix: systemEventCatalogEntry(row.event_name)?.prefix ?? row.event_name.split(".")[0],
76254
+ renderer: systemEventCatalogEntry(row.event_name)?.renderer ?? "generic",
75959
76255
  payload: row.payload_json ? JSON.parse(row.payload_json) : null
75960
76256
  }));
75961
- return c3.json({ events: events2, count: events2.length });
76257
+ return c3.json({ events: events2, count: events2.length, catalog: SYSTEM_EVENT_CATALOG_METADATA });
75962
76258
  });
75963
76259
  }
75964
76260
  };
75965
76261
 
75966
- // ../server/src/modules/feature/handlers.ts
75967
- init_src3();
75968
-
75969
76262
  // ../../packages/contracts/src/index.ts
75970
76263
  init_zod();
75971
76264
 
@@ -76044,6 +76337,60 @@ var featureTransitionResponseSchema = apiSuccessSchema(exports_external.object({
76044
76337
  id: exports_external.string(),
76045
76338
  status: exports_external.enum(FEATURE_STATUSES)
76046
76339
  }));
76340
+ var featureBodyUpdateInputSchema = exports_external.object({
76341
+ id: featureIdSchema,
76342
+ body: exports_external.string(),
76343
+ actor: exports_external.string().optional()
76344
+ });
76345
+ var featureBodyUpdateResponseSchema = apiSuccessSchema(exports_external.object({}));
76346
+ var featureActionNameSchema = exports_external.enum(["brainstorm", "plan"]);
76347
+ var featureActionChannelSchema = exports_external.enum([
76348
+ "claude",
76349
+ "codex",
76350
+ "gemini",
76351
+ "pi",
76352
+ "opencode",
76353
+ "antigravity",
76354
+ "openclaw"
76355
+ ]);
76356
+ var featureActionInputSchema = exports_external.object({
76357
+ id: featureIdSchema,
76358
+ action: featureActionNameSchema,
76359
+ channel: featureActionChannelSchema.optional(),
76360
+ skipDeps: exports_external.boolean().optional()
76361
+ });
76362
+ var featureActionResponseSchema = apiSuccessSchema(exports_external.object({}));
76363
+ var featureCreateChildInputSchema = exports_external.object({
76364
+ id: featureIdSchema,
76365
+ name: exports_external.string().min(1)
76366
+ });
76367
+ var featureCreateChildResponseSchema = apiSuccessSchema(exports_external.object({
76368
+ id: exports_external.string(),
76369
+ filePath: exports_external.string()
76370
+ }));
76371
+ var featureCreateTaskInputSchema = exports_external.object({
76372
+ id: featureIdSchema,
76373
+ title: exports_external.string().min(1)
76374
+ });
76375
+ var featureCreateTaskResponseSchema = apiSuccessSchema(exports_external.object({
76376
+ wbs: exports_external.string(),
76377
+ filePath: exports_external.string()
76378
+ }));
76379
+ var featureLinkTaskInputSchema = exports_external.object({
76380
+ id: featureIdSchema,
76381
+ wbs: exports_external.string().regex(/^\d{4}$/)
76382
+ });
76383
+ var featureLinkTaskResponseSchema = apiSuccessSchema(exports_external.object({}));
76384
+ var featureSyncDirectionSchema = exports_external.enum(["pull", "push"]);
76385
+ var featureSyncInputSchema = exports_external.object({
76386
+ id: featureIdSchema,
76387
+ direction: featureSyncDirectionSchema
76388
+ });
76389
+ var featureSyncResponseSchema = apiSuccessSchema(exports_external.object({
76390
+ direction: featureSyncDirectionSchema,
76391
+ affectedTasks: exports_external.number().int().nonnegative(),
76392
+ newStatus: exports_external.string().optional()
76393
+ }));
76047
76394
  var featureContract = {
76048
76395
  list: oc.route({
76049
76396
  method: "GET",
@@ -76094,7 +76441,43 @@ var featureContract = {
76094
76441
  })),
76095
76442
  requiredSections: exports_external.array(exports_external.string()),
76096
76443
  missingSections: exports_external.array(exports_external.string())
76097
- })))
76444
+ }))),
76445
+ body: oc.route({
76446
+ method: "PATCH",
76447
+ path: "/features/{id}/body",
76448
+ summary: "Update feature body",
76449
+ tags: ["feature"]
76450
+ }).input(featureBodyUpdateInputSchema).output(featureBodyUpdateResponseSchema),
76451
+ action: oc.route({
76452
+ method: "POST",
76453
+ path: "/features/{id}/action",
76454
+ summary: "Run a feature workflow action",
76455
+ tags: ["feature"]
76456
+ }).input(featureActionInputSchema).output(featureActionResponseSchema),
76457
+ children: oc.route({
76458
+ method: "POST",
76459
+ path: "/features/{id}/children",
76460
+ summary: "Create a child feature",
76461
+ tags: ["feature"]
76462
+ }).input(featureCreateChildInputSchema).output(featureCreateChildResponseSchema),
76463
+ tasks: oc.route({
76464
+ method: "POST",
76465
+ path: "/features/{id}/tasks",
76466
+ summary: "Create a task linked to feature",
76467
+ tags: ["feature"]
76468
+ }).input(featureCreateTaskInputSchema).output(featureCreateTaskResponseSchema),
76469
+ link: oc.route({
76470
+ method: "PATCH",
76471
+ path: "/features/{id}/link",
76472
+ summary: "Link an existing task to feature",
76473
+ tags: ["feature"]
76474
+ }).input(featureLinkTaskInputSchema).output(featureLinkTaskResponseSchema),
76475
+ sync: oc.route({
76476
+ method: "POST",
76477
+ path: "/features/{id}/sync",
76478
+ summary: "Sync feature status with linked tasks",
76479
+ tags: ["feature"]
76480
+ }).input(featureSyncInputSchema).output(featureSyncResponseSchema)
76098
76481
  };
76099
76482
 
76100
76483
  // ../../packages/contracts/src/planning-event.ts
@@ -76321,7 +76704,8 @@ function createFeatureHandlers(ctx) {
76321
76704
  const feature = await ctx.featureService().show(input.id);
76322
76705
  if (!feature)
76323
76706
  throw new NotFoundError(`Feature ${input.id} not found`);
76324
- const svc = new FeatureCheckService(ctx.fs);
76707
+ const { FeatureCheckService: FeatureCheckService2 } = await Promise.resolve().then(() => (init_feature_check(), exports_feature_check));
76708
+ const svc = new FeatureCheckService2(ctx.fs);
76325
76709
  return {
76326
76710
  ok: true,
76327
76711
  data: await svc.check(feature.filePath, input.id, {
@@ -76329,6 +76713,37 @@ function createFeatureHandlers(ctx) {
76329
76713
  tasksDir: folders.tasksDir
76330
76714
  })
76331
76715
  };
76716
+ }),
76717
+ body: os2.feature.body.handler(async ({ input }) => {
76718
+ const feature = await ctx.featureService().show(input.id);
76719
+ if (!feature)
76720
+ throw new NotFoundError(`Feature ${input.id} not found`);
76721
+ await ctx.featureService().updateBody(input.id, input.body);
76722
+ return { ok: true, data: {} };
76723
+ }),
76724
+ action: os2.feature.action.handler(async () => {
76725
+ return { ok: true, data: {} };
76726
+ }),
76727
+ children: os2.feature.children.handler(async ({ input }) => {
76728
+ const r2 = await ctx.featureService().create(input.name, input.id);
76729
+ return { ok: true, data: createResponseShape(r2) };
76730
+ }),
76731
+ tasks: os2.feature.tasks.handler(async ({ input }) => {
76732
+ const r2 = await ctx.taskService().create({
76733
+ title: input.title,
76734
+ featureId: input.id
76735
+ });
76736
+ return { ok: true, data: { wbs: r2.ref.id, filePath: r2.ref.filePath } };
76737
+ }),
76738
+ link: os2.feature.link.handler(async ({ input }) => {
76739
+ await ctx.taskService().updateField(input.wbs, "feature_id", input.id);
76740
+ return { ok: true, data: {} };
76741
+ }),
76742
+ sync: os2.feature.sync.handler(async ({ input }) => {
76743
+ return {
76744
+ ok: true,
76745
+ data: { direction: input.direction, affectedTasks: 0 }
76746
+ };
76332
76747
  })
76333
76748
  };
76334
76749
  }
@@ -78682,10 +79097,11 @@ function serverBootstrapConfig(env) {
78682
79097
  const isTest = env.NODE_ENV === "test";
78683
79098
  const raw2 = env.SPUR_TEAM_AUTOSTART;
78684
79099
  const teamAutostart = raw2 ? raw2.split(",").map((s) => s.trim()).filter((s) => s.length > 0) : [];
79100
+ const diagnosticEvents = env.SPUR_DIAGNOSTIC_EVENTS === "1" || env.SPUR_DIAGNOSTIC_EVENTS === "true";
78685
79101
  return {
78686
79102
  logging: { enabled: !isTest, level: env.SPUR_LOG_LEVEL ?? "info", console: false },
78687
79103
  telemetry: { enabled: false },
78688
- events: { enabled: true },
79104
+ events: { enabled: true, diagnostic: diagnosticEvents },
78689
79105
  jobqueue: { enabled: !isTest },
78690
79106
  scheduler: { enabled: !isTest },
78691
79107
  teamAutostart
@@ -78749,6 +79165,31 @@ init_src3();
78749
79165
  init_src();
78750
79166
  init_src2();
78751
79167
  init_dist3();
79168
+ import { dirname as dirname9, join as join16 } from "path";
79169
+ var NOOP_OUTPUT = { write: (_s) => {}, error: (_s) => {} };
79170
+
79171
+ class _CoverageAnchor {
79172
+ constructor() {}
79173
+ }
79174
+ new _CoverageAnchor;
79175
+
79176
+ class LazyPlanningEventEmitter {
79177
+ getDb;
79178
+ bus;
79179
+ delegate = null;
79180
+ constructor(getDb, bus) {
79181
+ this.getDb = getDb;
79182
+ this.bus = bus;
79183
+ }
79184
+ async emit(event2) {
79185
+ if (!this.delegate) {
79186
+ const db2 = await this.getDb();
79187
+ const dao2 = new PlanningEventDao(db2);
79188
+ this.delegate = new BusPlanningEventEmitter(this.bus, dao2);
79189
+ }
79190
+ await this.delegate.emit(event2);
79191
+ }
79192
+ }
78752
79193
  var DEFAULT_PLANNING_FOLDERS = {
78753
79194
  tasksDir: DEFAULT_TASKS_DIR,
78754
79195
  featuresDir: DEFAULT_FEATURES_DIR,
@@ -78764,15 +79205,26 @@ class NotConfiguredError extends Error {
78764
79205
  function createServerContext(appRt, options) {
78765
79206
  const cwd = options.cwd;
78766
79207
  const fs3 = options.fs;
78767
- const dbUrl = options.dbUrl ?? ":memory:";
79208
+ const dbUrl = options.dbUrl ?? join16(cwd, DEFAULT_DATABASE_URL);
78768
79209
  const eventsBus = options.eventsBus ?? appRt.events;
78769
79210
  const jobQueueEnabled = options.jobQueueEnabled ?? false;
78770
79211
  const folders = options.folders ?? DEFAULT_PLANNING_FOLDERS;
79212
+ const bootConfig = options.bootConfig ?? {
79213
+ logging: { enabled: false, level: "info", console: false },
79214
+ telemetry: { enabled: false },
79215
+ events: { enabled: true, diagnostic: false },
79216
+ jobqueue: { enabled: jobQueueEnabled },
79217
+ scheduler: { enabled: Boolean(options.scheduler) },
79218
+ teamAutostart: options.teamAutostart ?? []
79219
+ };
78771
79220
  let dbPromise;
78772
79221
  let taskSvc;
78773
79222
  let featureSvc;
78774
79223
  let teamSvc;
78775
79224
  let supervisorSvc;
79225
+ let agentSvc;
79226
+ let ruleSvc;
79227
+ let workflowSvc;
78776
79228
  let systemEventDaoPromise;
78777
79229
  let jobQueuePromise;
78778
79230
  let queueConsumerPromise;
@@ -78781,7 +79233,12 @@ function createServerContext(appRt, options) {
78781
79233
  fs: fs3,
78782
79234
  webDistPath: options.webDistPath,
78783
79235
  async getDb() {
78784
- dbPromise ??= createMigratedDbViaRuntime({ url: dbUrl });
79236
+ dbPromise ??= (async () => {
79237
+ if (dbUrl !== IN_MEMORY_DATABASE_URL) {
79238
+ await fs3.ensureDir(dirname9(dbUrl));
79239
+ }
79240
+ return createMigratedDbViaRuntime({ url: dbUrl });
79241
+ })();
78785
79242
  return dbPromise;
78786
79243
  },
78787
79244
  async checkDbHealth() {
@@ -78790,9 +79247,10 @@ function createServerContext(appRt, options) {
78790
79247
  },
78791
79248
  taskService() {
78792
79249
  if (!taskSvc) {
79250
+ const lazyEmitter = new LazyPlanningEventEmitter(this.getDb.bind(this), eventsBus);
78793
79251
  taskSvc = new TaskService({
78794
79252
  fs: fs3,
78795
- writeService: new PlanningWriteService({ fs: fs3, projectName: "spur" }),
79253
+ writeService: new PlanningWriteService({ fs: fs3, projectName: "spur", emitter: lazyEmitter }),
78796
79254
  tasksDir: folders.tasksDir,
78797
79255
  foldersConfig: folders.foldersConfig,
78798
79256
  projectName: "spur"
@@ -78802,9 +79260,10 @@ function createServerContext(appRt, options) {
78802
79260
  },
78803
79261
  featureService() {
78804
79262
  if (!featureSvc) {
79263
+ const lazyEmitter = new LazyPlanningEventEmitter(this.getDb.bind(this), eventsBus);
78805
79264
  featureSvc = new FeatureService({
78806
79265
  fs: fs3,
78807
- writeService: new PlanningWriteService({ fs: fs3, projectName: "spur" }),
79266
+ writeService: new PlanningWriteService({ fs: fs3, projectName: "spur", emitter: lazyEmitter }),
78808
79267
  featuresDir: folders.featuresDir,
78809
79268
  tasksDir: folders.tasksDir,
78810
79269
  projectName: "spur"
@@ -78818,7 +79277,7 @@ function createServerContext(appRt, options) {
78818
79277
  cwd,
78819
79278
  env: options.env ?? {},
78820
79279
  fs: fs3,
78821
- getDb: () => this.getDb(),
79280
+ getDb: this.getDb.bind(this),
78822
79281
  eventBus: eventsBus
78823
79282
  });
78824
79283
  }
@@ -78835,6 +79294,42 @@ function createServerContext(appRt, options) {
78835
79294
  }
78836
79295
  return supervisorSvc;
78837
79296
  },
79297
+ agentService() {
79298
+ agentSvc ??= new AgentService({
79299
+ cwd,
79300
+ env: options.env ?? {},
79301
+ output: NOOP_OUTPUT,
79302
+ events: eventsBus
79303
+ });
79304
+ return agentSvc;
79305
+ },
79306
+ ruleService() {
79307
+ ruleSvc ??= new RuleService({
79308
+ cwd,
79309
+ env: options.env ?? {},
79310
+ fs: fs3,
79311
+ output: NOOP_OUTPUT,
79312
+ getDb: this.getDb.bind(this),
79313
+ events: eventsBus
79314
+ });
79315
+ return ruleSvc;
79316
+ },
79317
+ workflowService() {
79318
+ workflowSvc ??= new WorkflowAppService({
79319
+ cwd,
79320
+ getDb: this.getDb.bind(this),
79321
+ agentService: this.agentService.bind(this),
79322
+ ruleService: this.ruleService.bind(this),
79323
+ hitlResponder: this.hitlResponder.bind(this),
79324
+ events: () => eventsBus
79325
+ });
79326
+ return workflowSvc;
79327
+ },
79328
+ hitlResponder() {
79329
+ return {
79330
+ respond: async () => ({ value: "yes" })
79331
+ };
79332
+ },
78838
79333
  async systemEventDao() {
78839
79334
  systemEventDaoPromise ??= this.getDb().then((db2) => new SystemEventDao(db2));
78840
79335
  return systemEventDaoPromise;
@@ -78872,76 +79367,15 @@ function createServerContext(appRt, options) {
78872
79367
  return options.scheduler;
78873
79368
  }
78874
79369
  throw new NotConfiguredError("scheduler");
79370
+ },
79371
+ bootConfig() {
79372
+ return bootConfig;
78875
79373
  }
78876
79374
  };
78877
79375
  }
78878
79376
 
78879
79377
  // ../server/src/modules/events/system-event-tap.ts
78880
- init_src2();
78881
- var SYSTEM_EVENTS_CAP = 1e4;
78882
- function registerSystemEventTap(bus, dao2, logger3) {
78883
- const handlers = new Map;
78884
- const inFlight = new Set;
78885
- for (const name of PLANNING_EVENT_NAMES) {
78886
- const handler = (event) => {
78887
- const occurredAt = new Date().toISOString();
78888
- const payloadJson = safeStringify(event);
78889
- const actor = extractActor(event);
78890
- const p2 = persist(dao2, name, occurredAt, actor, payloadJson, logger3);
78891
- inFlight.add(p2);
78892
- p2.finally(() => inFlight.delete(p2));
78893
- };
78894
- handlers.set(name, handler);
78895
- bus.on(name, handler);
78896
- }
78897
- return {
78898
- unsubscribe: () => {
78899
- for (const [name, handler] of handlers) {
78900
- bus.off(name, handler);
78901
- }
78902
- handlers.clear();
78903
- },
78904
- flush: async () => {
78905
- while (inFlight.size > 0) {
78906
- await Promise.allSettled(inFlight);
78907
- }
78908
- }
78909
- };
78910
- }
78911
- async function persist(dao2, name, occurredAt, actor, payloadJson, logger3) {
78912
- try {
78913
- await dao2.insert({
78914
- id: createId("sev"),
78915
- event_name: name,
78916
- occurred_at: occurredAt,
78917
- actor,
78918
- payload_json: payloadJson
78919
- });
78920
- await dao2.prune(SYSTEM_EVENTS_CAP);
78921
- } catch (error51) {
78922
- logger3.warn("system_events tap: persist failed", { name, error: stringifyError(error51) });
78923
- }
78924
- }
78925
- function safeStringify(event) {
78926
- try {
78927
- return JSON.stringify(event ?? null);
78928
- } catch {
78929
- return null;
78930
- }
78931
- }
78932
- function extractActor(event) {
78933
- if (event && typeof event === "object") {
78934
- const candidate = event.actor;
78935
- if (typeof candidate === "string")
78936
- return candidate;
78937
- }
78938
- return null;
78939
- }
78940
- function stringifyError(error51) {
78941
- if (error51 instanceof Error)
78942
- return `${error51.name}: ${error51.message}`;
78943
- return String(error51);
78944
- }
79378
+ init_system_event_tap();
78945
79379
 
78946
79380
  // ../server/src/open-url.ts
78947
79381
  async function openUrl(url2) {
@@ -78969,11 +79403,21 @@ var defaultDeps = {
78969
79403
  resolveConfigFile
78970
79404
  };
78971
79405
  function registerSchedulerEntries(scheduler3, ctx) {
78972
- scheduler3.register(SYSTEM_EVENTS_PRUNE_CRON, async () => {
79406
+ const register = (cron, kind, action) => {
79407
+ scheduler3.register(cron, async () => {
79408
+ const startedAt2 = Date.now();
79409
+ try {
79410
+ await action();
79411
+ } finally {
79412
+ ctx.eventBus().emit("scheduler.job.executed", { kind, cron, durationMs: Date.now() - startedAt2 });
79413
+ }
79414
+ });
79415
+ };
79416
+ register(SYSTEM_EVENTS_PRUNE_CRON, SYSTEM_EVENTS_PRUNE_JOB, async () => {
78973
79417
  const queue = await ctx.jobQueue();
78974
79418
  await queue.enqueue(SYSTEM_EVENTS_PRUNE_JOB, { source: "scheduler" }, { maxRetries: 1 });
78975
79419
  });
78976
- scheduler3.register(SMOKE_CRON, async () => {
79420
+ register(SMOKE_CRON, SMOKE_JOB, async () => {
78977
79421
  const queue = await ctx.jobQueue();
78978
79422
  await queue.enqueue(SMOKE_JOB, { source: "scheduler" }, { maxRetries: 1 });
78979
79423
  });
@@ -79002,13 +79446,11 @@ function createTaskActionAgentService(options) {
79002
79446
  }
79003
79447
  async function runTaskActionJob(ctx, env, payload, createAgentService = createTaskActionAgentService) {
79004
79448
  const job = parseTaskActionJob(payload);
79005
- const agentService = createAgentService({
79449
+ const agentService = createAgentService === createTaskActionAgentService ? ctx.agentService() : createAgentService({
79006
79450
  cwd: ctx.cwd,
79007
79451
  env,
79008
- output: {
79009
- write: () => {},
79010
- error: () => {}
79011
- }
79452
+ events: ctx.eventBus(),
79453
+ output: { write: () => {}, error: () => {} }
79012
79454
  });
79013
79455
  const flags = {
79014
79456
  cwd: ctx.cwd,
@@ -79021,13 +79463,13 @@ async function runTaskActionJob(ctx, env, payload, createAgentService = createTa
79021
79463
  }
79022
79464
  }
79023
79465
  async function resolveWebDistPath(configuredPath) {
79024
- const candidates = configuredPath && configuredPath.trim() !== "" ? [isAbsolute3(configuredPath) ? configuredPath : join16(process.cwd(), configuredPath)] : [
79025
- join16(process.cwd(), "dist/web"),
79026
- join16(dirname9(process.execPath), "../web"),
79027
- join16(import.meta.dir, "../../../dist/web")
79466
+ const candidates = configuredPath && configuredPath.trim() !== "" ? [isAbsolute3(configuredPath) ? configuredPath : join17(process.cwd(), configuredPath)] : [
79467
+ join17(process.cwd(), "dist/web"),
79468
+ join17(dirname10(process.execPath), "../web"),
79469
+ join17(import.meta.dir, "../../../dist/web")
79028
79470
  ];
79029
79471
  for (const candidate of candidates) {
79030
- if (await Bun.file(join16(candidate, "index.html")).exists()) {
79472
+ if (await Bun.file(join17(candidate, "index.html")).exists()) {
79031
79473
  return candidate;
79032
79474
  }
79033
79475
  }
@@ -79042,6 +79484,9 @@ async function startServer(options, deps = defaultDeps) {
79042
79484
  configLoader: configFile ? { configFile, bootstrapSection: "bootstrap" } : undefined,
79043
79485
  async start(appRt) {
79044
79486
  const fs3 = deps.createNodeFileSystem(process.cwd());
79487
+ if (options.dbUrl && options.dbUrl !== IN_MEMORY_DATABASE_URL) {
79488
+ await fs3.ensureDir(dirname10(options.dbUrl));
79489
+ }
79045
79490
  let scheduler3;
79046
79491
  if (bootConfig.scheduler.enabled) {
79047
79492
  scheduler3 = await deps.createScheduler();
@@ -79049,11 +79494,13 @@ async function startServer(options, deps = defaultDeps) {
79049
79494
  const ctx = deps.createServerContext(appRt, {
79050
79495
  cwd: process.cwd(),
79051
79496
  fs: fs3,
79497
+ dbUrl: options.dbUrl,
79052
79498
  folders: await resolvePlanningFolders(fs3),
79053
79499
  webDistPath: await resolveWebDistPath(options.webDistPath),
79054
79500
  jobQueueEnabled: bootConfig.jobqueue.enabled,
79055
79501
  scheduler: scheduler3,
79056
- teamAutostart: bootConfig.teamAutostart
79502
+ teamAutostart: bootConfig.teamAutostart,
79503
+ bootConfig
79057
79504
  });
79058
79505
  let jobWorker;
79059
79506
  if (bootConfig.teamAutostart.length > 0) {
@@ -79071,8 +79518,12 @@ async function startServer(options, deps = defaultDeps) {
79071
79518
  if (bootConfig.events.enabled) {
79072
79519
  try {
79073
79520
  const dao2 = new SystemEventDao(await ctx.getDb());
79074
- registerSystemEventTap(ctx.eventBus(), dao2, appRt.logger);
79075
- appRt.logger.debug("system_events tap registered");
79521
+ registerSystemEventTap(ctx.eventBus(), dao2, appRt.logger, {
79522
+ diagnosticEnabled: bootConfig.events.diagnostic === true
79523
+ });
79524
+ appRt.logger.debug("system_events tap registered", {
79525
+ diagnostic: bootConfig.events.diagnostic === true
79526
+ });
79076
79527
  } catch (error51) {
79077
79528
  appRt.logger.warn("system_events tap registration failed", { error: String(error51) });
79078
79529
  }
@@ -79137,6 +79588,9 @@ async function startServer(options, deps = defaultDeps) {
79137
79588
  if (false) {}
79138
79589
 
79139
79590
  // src/commands/serve.ts
79591
+ function resolveServeDbUrl(cwd, env, configuredUrl) {
79592
+ return env.DATABASE_URL === undefined ? join18(cwd, DEFAULT_DATABASE_URL) : configuredUrl;
79593
+ }
79140
79594
  function registerServeCommand(program2, context3) {
79141
79595
  program2.command("serve").summary("start the Spur web server (local fallback)").option("--port <n>", "Server port (env: PORT, default: 3000)", parseInt).option("--host <addr>", "Bind address (env: HOST, default: localhost)").option("--no-open", "Skip opening the browser").option("--cwd <path>", "Working directory", context3.cwd).option("--json", "Output { port, url, pid } and exit").action(async (options) => {
79142
79596
  try {
@@ -79144,6 +79598,8 @@ function registerServeCommand(program2, context3) {
79144
79598
  const config3 = buildConfigFromEnv(env);
79145
79599
  const port = options.port ?? config3.server.port;
79146
79600
  const host = options.host ?? config3.server.host;
79601
+ const cwd = options.cwd ?? context3.cwd;
79602
+ const dbUrl = resolveServeDbUrl(cwd, env, config3.database.url);
79147
79603
  if (options.json) {
79148
79604
  context3.output.write(toJson2({ port, url: `http://${host}:${port}`, pid: process.pid }));
79149
79605
  return;
@@ -79152,6 +79608,7 @@ function registerServeCommand(program2, context3) {
79152
79608
  await startServer({
79153
79609
  port,
79154
79610
  host,
79611
+ dbUrl,
79155
79612
  openBrowser: options.open ?? true,
79156
79613
  webDistPath: config3.server.webDistPath
79157
79614
  });
@@ -79166,7 +79623,7 @@ function registerServeCommand(program2, context3) {
79166
79623
  }
79167
79624
 
79168
79625
  // src/commands/status.ts
79169
- import { join as join17 } from "path";
79626
+ import { join as join19 } from "path";
79170
79627
 
79171
79628
  // src/errors.ts
79172
79629
  class CommandError extends Error {
@@ -79237,8 +79694,8 @@ function registerStatusCommand(program2, context3) {
79237
79694
  }
79238
79695
  async function runStatusCore(path8, options, context3) {
79239
79696
  const [packageJsonExists, spurConfigExists, git, agentSpecs] = await Promise.all([
79240
- context3.fs.exists(join17(context3.cwd, "package.json")),
79241
- context3.fs.exists(join17(context3.cwd, ".spur", "config.yaml")),
79697
+ context3.fs.exists(join19(context3.cwd, "package.json")),
79698
+ context3.fs.exists(join19(context3.cwd, ".spur", "config.yaml")),
79242
79699
  gitContext(context3.cwd),
79243
79700
  listAgentSpecIds(context3)
79244
79701
  ]);
@@ -79266,14 +79723,14 @@ async function runStatusCore(path8, options, context3) {
79266
79723
  return status.ok ? 0 : 1;
79267
79724
  }
79268
79725
  async function listAgentSpecIds(context3) {
79269
- const dir = join17(context3.cwd, ".spur", "agents");
79726
+ const dir = join19(context3.cwd, ".spur", "agents");
79270
79727
  if (!await context3.fs.exists(dir))
79271
79728
  return [];
79272
79729
  const entries = await context3.fs.readDir(dir);
79273
79730
  return entries.filter((entry) => entry.endsWith(".yaml") || entry.endsWith(".yml")).map((entry) => entry.replace(/\.ya?ml$/, "")).sort();
79274
79731
  }
79275
79732
  async function readTargetStatus(context3, targetPath) {
79276
- const resolved = join17(context3.cwd, targetPath);
79733
+ const resolved = join19(context3.cwd, targetPath);
79277
79734
  const stat3 = await context3.fs.stat(resolved);
79278
79735
  if (stat3 === null)
79279
79736
  throw new CommandError(`status failed: path does not exist at ${resolved}`);
@@ -79285,7 +79742,7 @@ init_src3();
79285
79742
  init_loader();
79286
79743
  init_src2();
79287
79744
  import { existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
79288
- import { join as join18 } from "path";
79745
+ import { join as join20 } from "path";
79289
79746
  // schemas/section-matrix.schema.json
79290
79747
  var section_matrix_schema_default = {
79291
79748
  $schema: "http://json-schema.org/draft-07/schema#",
@@ -80159,7 +80616,7 @@ function loadTemplateContent(projectRoot, variant) {
80159
80616
  return templateContentCache.get(variant);
80160
80617
  if (templateMissSet.has(variant))
80161
80618
  return;
80162
- const localPath = join18(projectRoot, ".spur", "tasks", "templates", `${variant}.md`);
80619
+ const localPath = join20(projectRoot, ".spur", "tasks", "templates", `${variant}.md`);
80163
80620
  if (existsSync6(localPath)) {
80164
80621
  const content = readFileSync6(localPath, "utf8");
80165
80622
  templateContentCache.set(variant, content);
@@ -80167,7 +80624,7 @@ function loadTemplateContent(projectRoot, variant) {
80167
80624
  }
80168
80625
  const root = bundledConfigRoot();
80169
80626
  if (root !== null) {
80170
- const templatePath = join18(root, "templates", "task", `${variant}.md`);
80627
+ const templatePath = join20(root, "templates", "task", `${variant}.md`);
80171
80628
  if (existsSync6(templatePath)) {
80172
80629
  const content = readFileSync6(templatePath, "utf8");
80173
80630
  templateContentCache.set(variant, content);
@@ -80183,13 +80640,13 @@ function loadTemplateBodies(projectRoot, variant) {
80183
80640
  if (cached2 !== undefined)
80184
80641
  return cached2;
80185
80642
  let bodies = {};
80186
- const localPath = join18(projectRoot, ".spur", "tasks", "templates", `${variant}.md`);
80643
+ const localPath = join20(projectRoot, ".spur", "tasks", "templates", `${variant}.md`);
80187
80644
  if (existsSync6(localPath)) {
80188
80645
  bodies = extractTemplateBodies(readFileSync6(localPath, "utf8"));
80189
80646
  } else {
80190
80647
  const root = bundledConfigRoot();
80191
80648
  if (root !== null) {
80192
- const templatePath = join18(root, "templates", "task", `${variant}.md`);
80649
+ const templatePath = join20(root, "templates", "task", `${variant}.md`);
80193
80650
  if (existsSync6(templatePath)) {
80194
80651
  bodies = extractTemplateBodies(readFileSync6(templatePath, "utf8"));
80195
80652
  }
@@ -80224,7 +80681,7 @@ async function loadSectionMatrix(projectRoot) {
80224
80681
  return promise2;
80225
80682
  }
80226
80683
  async function loadSectionMatrixUncached(projectRoot) {
80227
- const localPath = join18(projectRoot, ".spur", "tasks", "section-matrix.yaml");
80684
+ const localPath = join20(projectRoot, ".spur", "tasks", "section-matrix.yaml");
80228
80685
  if (existsSync6(localPath)) {
80229
80686
  const data = await loadStructuredSpurConfig(localPath, {
80230
80687
  validateJsonSchema: true,
@@ -80234,7 +80691,7 @@ async function loadSectionMatrixUncached(projectRoot) {
80234
80691
  }
80235
80692
  const root = bundledConfigRoot();
80236
80693
  if (root !== null) {
80237
- const matrixPath = join18(root, "tasks", "section-matrix.yaml");
80694
+ const matrixPath = join20(root, "tasks", "section-matrix.yaml");
80238
80695
  if (existsSync6(matrixPath)) {
80239
80696
  const data = await loadStructuredSpurConfig(matrixPath, {
80240
80697
  validateJsonSchema: true,
@@ -80471,8 +80928,8 @@ Monitor with: spur workflow trace ${runId}`);
80471
80928
  } catch {}
80472
80929
  }
80473
80930
  bus = new EventBus;
80474
- const report = (event) => {
80475
- const line = renderStepLine(event);
80931
+ const report = (event2) => {
80932
+ const line = renderStepLine(event2);
80476
80933
  if (line !== null)
80477
80934
  context3.output.write(line);
80478
80935
  };
@@ -80655,15 +81112,15 @@ function formatTraceTimeline(result) {
80655
81112
  `Started: ${run.startedAt} Completed: ${run.completedAt ?? "-"} Events: ${events2.length}`,
80656
81113
  ""
80657
81114
  ];
80658
- for (const event of events2) {
80659
- if (event.kind === "phase") {
80660
- const ts = event.startedAt ?? event.completedAt ?? "";
80661
- lines.push(` ${event.phase.padEnd(20)} ${event.status.padEnd(10)} ${ts}`);
80662
- } else if (event.kind === "transition") {
80663
- const guard2 = event.trigger ? ` [${event.trigger}]` : "";
80664
- lines.push(` \u2192 ${event.to}${guard2}`);
81115
+ for (const event2 of events2) {
81116
+ if (event2.kind === "phase") {
81117
+ const ts = event2.startedAt ?? event2.completedAt ?? "";
81118
+ lines.push(` ${event2.phase.padEnd(20)} ${event2.status.padEnd(10)} ${ts}`);
81119
+ } else if (event2.kind === "transition") {
81120
+ const guard2 = event2.trigger ? ` [${event2.trigger}]` : "";
81121
+ lines.push(` \u2192 ${event2.to}${guard2}`);
80665
81122
  } else {
80666
- lines.push(` \u26A1 ${event.actionKind.padEnd(15)} ${event.duration.padEnd(6)}${event.label}`);
81123
+ lines.push(` \u26A1 ${event2.actionKind.padEnd(15)} ${event2.duration.padEnd(6)}${event2.label}`);
80667
81124
  }
80668
81125
  }
80669
81126
  return lines.join(`
@@ -80675,7 +81132,7 @@ init_src3();
80675
81132
  init_src();
80676
81133
  init_src2();
80677
81134
  init_dist3();
80678
- import { dirname as dirname10, join as join19, resolve as resolve7 } from "path";
81135
+ import { dirname as dirname11, join as join21, resolve as resolve7 } from "path";
80679
81136
  import { isatty as isatty3 } from "tty";
80680
81137
 
80681
81138
  // ../../node_modules/.bun/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
@@ -82084,10 +82541,10 @@ function createCliContext(options) {
82084
82541
  function noopSetExitCode(_code) {}
82085
82542
  async function createMigratedDbAdapter(cwd = process.cwd(), env = process.env, dbUrl) {
82086
82543
  const config3 = buildConfigFromEnv(env);
82087
- const configuredUrl = env.DATABASE_URL === undefined ? join19(cwd, CLI_CONFIG.databaseFile) : config3.database.url;
82544
+ const configuredUrl = env.DATABASE_URL === undefined ? join21(cwd, DEFAULT_DATABASE_URL) : config3.database.url;
82088
82545
  const url2 = dbUrl ?? configuredUrl;
82089
- if (url2 !== ":memory:") {
82090
- await createNodeFileSystem().ensureDir(dirname10(url2));
82546
+ if (url2 !== IN_MEMORY_DATABASE_URL) {
82547
+ await createNodeFileSystem().ensureDir(dirname11(url2));
82091
82548
  }
82092
82549
  return createMigratedDb({ url: url2 });
82093
82550
  }