@gobing-ai/spur 0.3.33 → 0.3.35

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.
Files changed (65) hide show
  1. package/config/config.example.yaml +1 -1
  2. package/config/corpus-baseline.json +61 -0
  3. package/config/templates/task/brainstorm.md +1 -0
  4. package/config/templates/task/feature-impl.md +4 -1
  5. package/config/templates/task/issue.md +1 -0
  6. package/config/templates/task/meta.md +4 -1
  7. package/config/templates/task/review.md +1 -0
  8. package/config/templates/task/standard.md +4 -1
  9. package/config/workflows/feature-lifecycle.yaml +10 -0
  10. package/config/workflows/idea-pipeline.yaml +1 -1
  11. package/config/workflows/task-pipeline.yaml +38 -5
  12. package/package.json +9 -9
  13. package/schemas/spur-config.schema.json +37 -23
  14. package/spur.js +1864 -482
  15. package/web/_astro/{BoardApp.CyyIiK76.js → BoardApp.8sc6Rb1t.js} +14 -14
  16. package/web/_astro/BoardApp.ChKnY1JD.js +1 -0
  17. package/web/_astro/{TaskDetail.BfUuRsfM.js → TaskDetail.DOKJP-Kp.js} +1 -1
  18. package/web/_astro/{arc.C7fql4LL.js → arc.CTqmqspU.js} +1 -1
  19. package/web/_astro/{architectureDiagram-3BPJPVTR.IJPsRX-V.js → architectureDiagram-3BPJPVTR.B0iBdehs.js} +1 -1
  20. package/web/_astro/{blockDiagram-GPEHLZMM.B1AUwBxq.js → blockDiagram-GPEHLZMM.BHE5UFj5.js} +1 -1
  21. package/web/_astro/{c4Diagram-AAUBKEIU.BuSJPR3z.js → c4Diagram-AAUBKEIU.DQApkgGM.js} +1 -1
  22. package/web/_astro/channel.B0q9WGrH.js +1 -0
  23. package/web/_astro/{chunk-2J33WTMH.CaOPTr9l.js → chunk-2J33WTMH.fPrKLM8v.js} +1 -1
  24. package/web/_astro/{chunk-4BX2VUAB.DQzxExn8.js → chunk-4BX2VUAB.DExvwBhn.js} +1 -1
  25. package/web/_astro/{chunk-55IACEB6.IIb103c7.js → chunk-55IACEB6.EjNkjuD6.js} +1 -1
  26. package/web/_astro/{chunk-727SXJPM.DOYz1K1b.js → chunk-727SXJPM.Dl8xy5rT.js} +1 -1
  27. package/web/_astro/{chunk-AQP2D5EJ.CFcfW-wt.js → chunk-AQP2D5EJ.BSzMBgBs.js} +1 -1
  28. package/web/_astro/{chunk-FMBD7UC4.C7Hn0jo3.js → chunk-FMBD7UC4.CAeOHpbb.js} +1 -1
  29. package/web/_astro/{chunk-ND2GUHAM.Ba83VQ1m.js → chunk-ND2GUHAM.Bbeu_ZOH.js} +1 -1
  30. package/web/_astro/{chunk-QZHKN3VN.CizNbIIP.js → chunk-QZHKN3VN.Da_GaIAZ.js} +1 -1
  31. package/web/_astro/{classDiagram-4FO5ZUOK.2NYYPXHq.js → classDiagram-4FO5ZUOK.sMfFYSQp.js} +1 -1
  32. package/web/_astro/{classDiagram-v2-Q7XG4LA2.2NYYPXHq.js → classDiagram-v2-Q7XG4LA2.sMfFYSQp.js} +1 -1
  33. package/web/_astro/{cose-bilkent-S5V4N54A.DwBqVzml.js → cose-bilkent-S5V4N54A.PS3IwOH4.js} +1 -1
  34. package/web/_astro/{dagre-BM42HDAG.DqnYsHWG.js → dagre-BM42HDAG.EQCx8a6D.js} +1 -1
  35. package/web/_astro/{diagram-2AECGRRQ.D8TKhgy-.js → diagram-2AECGRRQ.aEFQl8v8.js} +1 -1
  36. package/web/_astro/{diagram-5GNKFQAL.BUD6Prj5.js → diagram-5GNKFQAL.jyN4tqFX.js} +1 -1
  37. package/web/_astro/{diagram-KO2AKTUF.Cvg7hmND.js → diagram-KO2AKTUF.DaTVHnme.js} +1 -1
  38. package/web/_astro/{diagram-LMA3HP47.FUG_B9eS.js → diagram-LMA3HP47.DWsGRLAN.js} +1 -1
  39. package/web/_astro/{diagram-OG6HWLK6.XsBZQ0hQ.js → diagram-OG6HWLK6.DYxmOViu.js} +1 -1
  40. package/web/_astro/{erDiagram-TEJ5UH35.M_LSGgLQ.js → erDiagram-TEJ5UH35.BKM75coa.js} +1 -1
  41. package/web/_astro/{flowDiagram-I6XJVG4X.DZikZBRa.js → flowDiagram-I6XJVG4X.B7qpqDW5.js} +1 -1
  42. package/web/_astro/{ganttDiagram-6RSMTGT7.DTKuEmXY.js → ganttDiagram-6RSMTGT7.CYBL-hwy.js} +1 -1
  43. package/web/_astro/{gitGraphDiagram-PVQCEYII.Dt-E9XmY.js → gitGraphDiagram-PVQCEYII.Cz4ly3Kq.js} +1 -1
  44. package/web/_astro/{infoDiagram-5YYISTIA.D5snevU1.js → infoDiagram-5YYISTIA.CIS7cXrJ.js} +1 -1
  45. package/web/_astro/{ishikawaDiagram-YF4QCWOH.DmXdBf9W.js → ishikawaDiagram-YF4QCWOH.DQ-pmaOG.js} +1 -1
  46. package/web/_astro/{journeyDiagram-JHISSGLW.HPJSRkkU.js → journeyDiagram-JHISSGLW.DVS6F7UM.js} +1 -1
  47. package/web/_astro/{kanban-definition-UN3LZRKU.BxCqCnL1.js → kanban-definition-UN3LZRKU.D8t-G-U6.js} +1 -1
  48. package/web/_astro/{linear.BnXQUpS-.js → linear.IO8rTd_n.js} +1 -1
  49. package/web/_astro/{mermaid.core.D-ZeOmpg.js → mermaid.core.CjVnvFNf.js} +4 -4
  50. package/web/_astro/{mindmap-definition-RKZ34NQL.DxrftiFR.js → mindmap-definition-RKZ34NQL.DZoEMTnU.js} +1 -1
  51. package/web/_astro/{pieDiagram-4H26LBE5.D-ZcWxwg.js → pieDiagram-4H26LBE5.86r1QWnX.js} +1 -1
  52. package/web/_astro/{quadrantDiagram-W4KKPZXB.C-dVJ7GW.js → quadrantDiagram-W4KKPZXB.DzFA9uPk.js} +1 -1
  53. package/web/_astro/{requirementDiagram-4Y6WPE33.lalE_R8X.js → requirementDiagram-4Y6WPE33.dQvdvfMr.js} +1 -1
  54. package/web/_astro/{sankeyDiagram-5OEKKPKP.C4uPynAF.js → sankeyDiagram-5OEKKPKP.BvC-VNI8.js} +1 -1
  55. package/web/_astro/{sequenceDiagram-3UESZ5HK.uBOenkqh.js → sequenceDiagram-3UESZ5HK.DDQNwHs8.js} +1 -1
  56. package/web/_astro/{stateDiagram-AJRCARHV.CQOusSP2.js → stateDiagram-AJRCARHV.BKwYy-tQ.js} +1 -1
  57. package/web/_astro/{stateDiagram-v2-BHNVJYJU.Bw0ZdjYb.js → stateDiagram-v2-BHNVJYJU.KxCiRYYf.js} +1 -1
  58. package/web/_astro/{timeline-definition-PNZ67QCA.DbkPA5ce.js → timeline-definition-PNZ67QCA.Bh9NDjOx.js} +1 -1
  59. package/web/_astro/{vennDiagram-CIIHVFJN.CIKhzwoA.js → vennDiagram-CIIHVFJN.DIM-n6us.js} +1 -1
  60. package/web/_astro/{wardley-L42UT6IY.0P-tqaFs.js → wardley-L42UT6IY.DW15qOFQ.js} +1 -1
  61. package/web/_astro/{wardleyDiagram-YWT4CUSO.DrwTvM_M.js → wardleyDiagram-YWT4CUSO.UTIvjsG9.js} +1 -1
  62. package/web/_astro/{xychartDiagram-2RQKCTM6.BgJsQVms.js → xychartDiagram-2RQKCTM6.CQYhkVDS.js} +1 -1
  63. package/web/index.html +1 -1
  64. package/web/_astro/BoardApp.CBVEjvSW.js +0 -1
  65. package/web/_astro/channel.D3uZSASb.js +0 -1
package/spur.js CHANGED
@@ -47,7 +47,7 @@ var __export = (target, all) => {
47
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
48
48
  var __require = import.meta.require;
49
49
 
50
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/errors.js
50
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/errors.js
51
51
  var ErrorCode;
52
52
  var init_errors = __esm(() => {
53
53
  ErrorCode = {
@@ -58,7 +58,7 @@ var init_errors = __esm(() => {
58
58
  };
59
59
  });
60
60
 
61
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/api-response.js
61
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/api-response.js
62
62
  var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
63
63
  var init_api_response = __esm(() => {
64
64
  init_errors();
@@ -81,10 +81,10 @@ var init_api_response = __esm(() => {
81
81
  CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
82
82
  });
83
83
 
84
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/cursor.js
84
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/cursor.js
85
85
  var init_cursor = () => {};
86
86
 
87
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/object.js
87
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/object.js
88
88
  function isPlainObject(value) {
89
89
  return typeof value === "object" && value !== null && !Array.isArray(value);
90
90
  }
@@ -102,7 +102,7 @@ function deepMerge(target, source) {
102
102
  return result;
103
103
  }
104
104
 
105
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/output.js
105
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/output.js
106
106
  function processStream(name) {
107
107
  const proc = globalThis.process;
108
108
  const stream = proc?.[name];
@@ -123,7 +123,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
123
123
  }
124
124
  var defaultStdoutTarget, defaultStderrTarget;
125
125
 
126
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.19/node_modules/@gobing-ai/ts-utils/dist/index.js
126
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/index.js
127
127
  var init_dist = __esm(() => {
128
128
  init_api_response();
129
129
  init_cursor();
@@ -21745,7 +21745,7 @@ var init_zod = __esm(() => {
21745
21745
  init_external();
21746
21746
  });
21747
21747
 
21748
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/config.js
21748
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/config.js
21749
21749
  function getProcessEnv() {
21750
21750
  return process.env;
21751
21751
  }
@@ -21823,7 +21823,7 @@ var init_config = __esm(() => {
21823
21823
  };
21824
21824
  });
21825
21825
 
21826
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21826
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21827
21827
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
21828
21828
  import { dirname, resolve as resolvePath } from "path";
21829
21829
  function createNodeFileSystem(root, paths) {
@@ -21910,7 +21910,7 @@ function findProjectRoot(startDir) {
21910
21910
  }
21911
21911
  var init_file_system_node = () => {};
21912
21912
 
21913
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21913
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
21914
21914
  var DbModuleNotInstalledError;
21915
21915
  var init_db_errors = __esm(() => {
21916
21916
  DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
@@ -29121,7 +29121,7 @@ var init_execa = __esm(() => {
29121
29121
  } = getIpcExport());
29122
29122
  });
29123
29123
 
29124
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29124
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29125
29125
  import { isatty } from "tty";
29126
29126
 
29127
29127
  class NodeProcessExecutor {
@@ -29460,7 +29460,7 @@ var init_process_executor = __esm(() => {
29460
29460
  init_execa();
29461
29461
  });
29462
29462
 
29463
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29463
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
29464
29464
  function getNodeFileSystem() {
29465
29465
  if (!_nodeFileSystem)
29466
29466
  _nodeFileSystem = createNodeFileSystem();
@@ -29520,7 +29520,7 @@ var init_runtime_node_bun = __esm(() => {
29520
29520
  };
29521
29521
  });
29522
29522
 
29523
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/context.js
29523
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/context.js
29524
29524
  class RuntimeContext {
29525
29525
  scope;
29526
29526
  runtimeName;
@@ -29590,7 +29590,7 @@ var init_context = __esm(() => {
29590
29590
  init_runtime_node_bun();
29591
29591
  });
29592
29592
 
29593
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/path.js
29593
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/path.js
29594
29594
  function normalizeSeparators(path6) {
29595
29595
  return path6.replaceAll("\\", "/");
29596
29596
  }
@@ -29651,17 +29651,17 @@ var init_path = __esm(() => {
29651
29651
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
29652
29652
  });
29653
29653
 
29654
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29654
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
29655
29655
  var REMOTE_SCHEMA_MAX_BYTES;
29656
29656
  var init_schema_validation = __esm(() => {
29657
29657
  init_dist2();
29658
29658
  REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
29659
29659
  });
29660
29660
 
29661
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/types.js
29661
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/types.js
29662
29662
  var init_types = () => {};
29663
29663
 
29664
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/index.js
29664
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/index.js
29665
29665
  var init_dist3 = __esm(() => {
29666
29666
  init_config();
29667
29667
  init_context();
@@ -29670,7 +29670,7 @@ var init_dist3 = __esm(() => {
29670
29670
  init_types();
29671
29671
  });
29672
29672
 
29673
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+1d5c5fe73da9d0ae/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29673
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
29674
29674
  import { Database } from "bun:sqlite";
29675
29675
  var init_bun_sqlite = () => {};
29676
29676
 
@@ -33862,7 +33862,7 @@ var init_bun_sqlite2 = __esm(() => {
33862
33862
  init_session2();
33863
33863
  });
33864
33864
 
33865
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33865
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
33866
33866
  var inboxMessages;
33867
33867
  var init_inbox_messages = __esm(() => {
33868
33868
  init_sqlite_core();
@@ -33881,7 +33881,7 @@ var init_inbox_messages = __esm(() => {
33881
33881
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
33882
33882
  });
33883
33883
 
33884
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33884
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/common.js
33885
33885
  function nowTimestamp() {
33886
33886
  return Date.now();
33887
33887
  }
@@ -33910,7 +33910,7 @@ var init_common3 = __esm(() => {
33910
33910
  appendOnlyColumns = buildAppendOnlyColumns();
33911
33911
  });
33912
33912
 
33913
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33913
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
33914
33914
  var queueJobs;
33915
33915
  var init_queue_jobs = __esm(() => {
33916
33916
  init_sqlite_core();
@@ -33930,7 +33930,7 @@ var init_queue_jobs = __esm(() => {
33930
33930
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
33931
33931
  });
33932
33932
 
33933
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33933
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
33934
33934
  var exports_runtime = {};
33935
33935
  __export(exports_runtime, {
33936
33936
  queueJobs: () => queueJobs,
@@ -33941,7 +33941,7 @@ var init_runtime = __esm(() => {
33941
33941
  init_queue_jobs();
33942
33942
  });
33943
33943
 
33944
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33944
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
33945
33945
  var exports_bun_sqlite = {};
33946
33946
  __export(exports_bun_sqlite, {
33947
33947
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -34232,7 +34232,7 @@ var init_d1 = __esm(() => {
34232
34232
  init_session3();
34233
34233
  });
34234
34234
 
34235
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34235
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
34236
34236
  var exports_d1 = {};
34237
34237
  __export(exports_d1, {
34238
34238
  D1Adapter: () => D1Adapter
@@ -34296,7 +34296,7 @@ var init_d12 = __esm(() => {
34296
34296
  init_runtime();
34297
34297
  });
34298
34298
 
34299
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/adapter.js
34299
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapter.js
34300
34300
  async function createDbAdapter(config3) {
34301
34301
  switch (config3.driver) {
34302
34302
  case "bun-sqlite": {
@@ -34336,7 +34336,7 @@ var init_drizzle_orm = __esm(() => {
34336
34336
  init_view_common();
34337
34337
  });
34338
34338
 
34339
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34339
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/query-spec.js
34340
34340
  function compilePredicate(predicate) {
34341
34341
  if ("and" in predicate) {
34342
34342
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -34374,7 +34374,7 @@ var init_query_spec = __esm(() => {
34374
34374
  };
34375
34375
  });
34376
34376
 
34377
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34377
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/base-dao.js
34378
34378
  function asSelectQuery(query) {
34379
34379
  return query;
34380
34380
  }
@@ -34416,7 +34416,7 @@ var init_base_dao = __esm(() => {
34416
34416
  init_query_spec();
34417
34417
  });
34418
34418
 
34419
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34419
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
34420
34420
  var embeddedMigrations;
34421
34421
  var init_embedded_migrations = __esm(() => {
34422
34422
  embeddedMigrations = [
@@ -34448,7 +34448,7 @@ var init_embedded_migrations = __esm(() => {
34448
34448
  ];
34449
34449
  });
34450
34450
 
34451
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34451
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
34452
34452
  var EntityDao;
34453
34453
  var init_entity_dao = __esm(() => {
34454
34454
  init_drizzle_orm();
@@ -34610,7 +34610,7 @@ var init_entity_dao = __esm(() => {
34610
34610
  };
34611
34611
  });
34612
34612
 
34613
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34613
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
34614
34614
  function isPromiseLike(value) {
34615
34615
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
34616
34616
  }
@@ -34783,7 +34783,7 @@ var init_migrator2 = __esm(() => {
34783
34783
  init_migrator();
34784
34784
  });
34785
34785
 
34786
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/migrate.js
34786
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/migrate.js
34787
34787
  async function ensureJournalTable(adapter, table3) {
34788
34788
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
34789
34789
  }
@@ -34858,7 +34858,7 @@ var init_migrate = __esm(() => {
34858
34858
  init_embedded_migrations();
34859
34859
  });
34860
34860
 
34861
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34861
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
34862
34862
  var QueueJobDao;
34863
34863
  var init_queue_job_dao = __esm(() => {
34864
34864
  init_drizzle_orm();
@@ -34999,7 +34999,7 @@ var init_queue_job_dao = __esm(() => {
34999
34999
  };
35000
35000
  });
35001
35001
 
35002
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/index.js
35002
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/index.js
35003
35003
  var exports_dist = {};
35004
35004
  __export(exports_dist, {
35005
35005
  embeddedMigrations: () => embeddedMigrations,
@@ -37149,6 +37149,7 @@ var init_finding_codes = __esm(() => {
37149
37149
  "L3.requirements-format",
37150
37150
  "L3.requirements-empty",
37151
37151
  "L3.ac-empty",
37152
+ "L3.ac-requirement-coverage",
37152
37153
  "L3.solution-file-line",
37153
37154
  "L3.review-priority-table",
37154
37155
  "L3.testing-coverage",
@@ -37195,6 +37196,7 @@ var init_finding_codes = __esm(() => {
37195
37196
  L3_REQUIREMENTS_FORMAT: "L3.requirements-format",
37196
37197
  L3_REQUIREMENTS_EMPTY: "L3.requirements-empty",
37197
37198
  L3_AC_EMPTY: "L3.ac-empty",
37199
+ L3_AC_REQUIREMENT_COVERAGE: "L3.ac-requirement-coverage",
37198
37200
  L3_SOLUTION_FILE_LINE: "L3.solution-file-line",
37199
37201
  L3_REVIEW_PRIORITY_TABLE: "L3.review-priority-table",
37200
37202
  L3_TESTING_COVERAGE: "L3.testing-coverage",
@@ -37381,7 +37383,6 @@ var init_src = __esm(() => {
37381
37383
  AgentConfigSchema = exports_external.object({
37382
37384
  default: exports_external.string().optional(),
37383
37385
  executors: exports_external.array(AgentExecutorConfigSchema).optional(),
37384
- "default-by-phase": exports_external.record(exports_external.string(), exports_external.string()).optional(),
37385
37386
  team: exports_external.record(exports_external.string(), TeamConfigSchema).optional(),
37386
37387
  output: AgentOutputConfigSchema.optional(),
37387
37388
  sessionAffinity: exports_external.boolean().optional()
@@ -37486,7 +37487,7 @@ var init_src = __esm(() => {
37486
37487
  });
37487
37488
  });
37488
37489
 
37489
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/config.js
37490
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/config.js
37490
37491
  function parseYamlObject(text3) {
37491
37492
  let parsed;
37492
37493
  try {
@@ -37613,7 +37614,7 @@ var init_config2 = __esm(() => {
37613
37614
  };
37614
37615
  });
37615
37616
 
37616
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37617
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
37617
37618
  import { appendFileSync as appendFileSync3, cpSync as cpSync2, createReadStream as createReadStream3, createWriteStream as createWriteStream3, existsSync as existsSync2, mkdirSync as mkdirSync2, readdirSync as readdirSync2, readFileSync as readFileSync4, realpathSync as realpathSync2, renameSync as renameSync2, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
37618
37619
  import { dirname as dirname2, resolve as resolvePath3 } from "path";
37619
37620
  function createNodeFileSystem3(root, paths) {
@@ -37700,7 +37701,7 @@ function findProjectRoot3(startDir) {
37700
37701
  }
37701
37702
  var init_file_system_node2 = () => {};
37702
37703
 
37703
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37704
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
37704
37705
  var D1NotConfiguredError2, DbModuleNotInstalledError3;
37705
37706
  var init_db_errors2 = __esm(() => {
37706
37707
  D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
@@ -37717,7 +37718,7 @@ var init_db_errors2 = __esm(() => {
37717
37718
  };
37718
37719
  });
37719
37720
 
37720
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37721
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
37721
37722
  function createCfFileSystem2() {
37722
37723
  return {
37723
37724
  getProjectRoot: () => "/bundle",
@@ -37756,7 +37757,7 @@ function createCfFileSystem2() {
37756
37757
  }
37757
37758
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
37758
37759
 
37759
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37760
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
37760
37761
  var exports_runtime_cf = {};
37761
37762
  __export(exports_runtime_cf, {
37762
37763
  cloudflareWorkersFactory: () => cloudflareWorkersFactory2
@@ -37794,7 +37795,7 @@ var init_runtime_cf = __esm(() => {
37794
37795
  };
37795
37796
  });
37796
37797
 
37797
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37798
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
37798
37799
  import { isatty as isatty2 } from "tty";
37799
37800
 
37800
37801
  class NodeProcessExecutor3 {
@@ -38180,7 +38181,7 @@ var init_process_executor2 = __esm(() => {
38180
38181
  ProcessExecutor2 = NodeProcessExecutor3;
38181
38182
  });
38182
38183
 
38183
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38184
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
38184
38185
  var exports_runtime_node_bun = {};
38185
38186
  __export(exports_runtime_node_bun, {
38186
38187
  nodeBunFactory: () => nodeBunFactory3,
@@ -38248,7 +38249,7 @@ var init_runtime_node_bun2 = __esm(() => {
38248
38249
  };
38249
38250
  });
38250
38251
 
38251
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38252
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/platform.js
38252
38253
  function isCloudflareWorkerRuntime2() {
38253
38254
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
38254
38255
  }
@@ -38278,7 +38279,7 @@ function _resetRuntimeFactory2() {
38278
38279
  }
38279
38280
  var _factory, _runtimeName;
38280
38281
 
38281
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/context.js
38282
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/context.js
38282
38283
  class RuntimeContext2 {
38283
38284
  scope;
38284
38285
  runtimeName;
@@ -38368,7 +38369,7 @@ var init_context2 = __esm(() => {
38368
38369
  init_runtime_node_bun2();
38369
38370
  });
38370
38371
 
38371
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/path.js
38372
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/path.js
38372
38373
  function normalizeSeparators2(path7) {
38373
38374
  return path7.replaceAll("\\", "/");
38374
38375
  }
@@ -38491,7 +38492,7 @@ var init_path2 = __esm(() => {
38491
38492
  SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
38492
38493
  });
38493
38494
 
38494
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38495
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/fs.js
38495
38496
  async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
38496
38497
  await fs2.ensureDir(dirnamePath(path7));
38497
38498
  }
@@ -38542,7 +38543,7 @@ var init_fs = __esm(() => {
38542
38543
  init_path2();
38543
38544
  });
38544
38545
 
38545
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38546
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
38546
38547
  function allocateId() {
38547
38548
  nextIdSeq += 1;
38548
38549
  return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
@@ -38666,7 +38667,7 @@ function createInMemoryProcessRegistry2(options) {
38666
38667
  }
38667
38668
  var nextIdSeq = 0;
38668
38669
 
38669
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
38670
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
38670
38671
  function ambientRuntimePaths2() {
38671
38672
  const cwd = getProcessCwd2();
38672
38673
  return { cwd, home: getHomeDir() ?? cwd };
@@ -38676,7 +38677,7 @@ var init_runtime_paths = __esm(() => {
38676
38677
  init_path2();
38677
38678
  });
38678
38679
 
38679
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38680
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
38680
38681
  async function loadStructuredConfig(path7, options = {}) {
38681
38682
  const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
38682
38683
  return await parseStructuredConfig(content, path7, options);
@@ -38953,10 +38954,10 @@ var init_schema_validation2 = __esm(() => {
38953
38954
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
38954
38955
  });
38955
38956
 
38956
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/types.js
38957
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/types.js
38957
38958
  var init_types2 = () => {};
38958
38959
 
38959
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/index.js
38960
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/index.js
38960
38961
  var exports_dist2 = {};
38961
38962
  __export(exports_dist2, {
38962
38963
  writeJsonFile: () => writeJsonFile2,
@@ -41107,7 +41108,7 @@ var init_mod = __esm(() => {
41107
41108
  init_config3();
41108
41109
  });
41109
41110
 
41110
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/logger.js
41111
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/logger.js
41111
41112
  function toLogTapeLevel(level) {
41112
41113
  return level === "warn" ? "warning" : level;
41113
41114
  }
@@ -42660,7 +42661,7 @@ var require_src = __commonJS((exports) => {
42660
42661
  };
42661
42662
  });
42662
42663
 
42663
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42664
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
42664
42665
  function getTelemetryConfig(configPartial = {}) {
42665
42666
  return {
42666
42667
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -42696,7 +42697,7 @@ var init_sdk = __esm(() => {
42696
42697
  resolvedConfig = getTelemetryConfig();
42697
42698
  });
42698
42699
 
42699
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42700
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
42700
42701
  function isSuppressed(tracer2) {
42701
42702
  return tracer2 === undefined && !getResolvedConfig().enabled;
42702
42703
  }
@@ -42736,7 +42737,7 @@ var init_tracing2 = __esm(() => {
42736
42737
  import_api2 = __toESM(require_src(), 1);
42737
42738
  });
42738
42739
 
42739
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42740
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
42740
42741
  function getMeter() {
42741
42742
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
42742
42743
  }
@@ -42833,7 +42834,7 @@ var init_metrics = __esm(() => {
42833
42834
  instruments = {};
42834
42835
  });
42835
42836
 
42836
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42837
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
42837
42838
  function busLogger() {
42838
42839
  if (!_busLogger)
42839
42840
  _busLogger = getLogger2("event-bus");
@@ -43078,7 +43079,7 @@ var init_event_bus = __esm(() => {
43078
43079
  init_metrics();
43079
43080
  });
43080
43081
 
43081
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43082
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
43082
43083
  function obsLogger() {
43083
43084
  if (!_obsLogger)
43084
43085
  _obsLogger = getLogger2("event-bus.observers");
@@ -43142,7 +43143,7 @@ var init_default_observers = __esm(() => {
43142
43143
  init_event_bus();
43143
43144
  });
43144
43145
 
43145
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43146
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
43146
43147
  function parentDir(filePath) {
43147
43148
  const idx = filePath.lastIndexOf("/");
43148
43149
  return idx <= 0 ? "." : filePath.slice(0, idx);
@@ -43240,7 +43241,7 @@ var init_file_observer = __esm(() => {
43240
43241
  init_logger3();
43241
43242
  });
43242
43243
 
43243
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
43244
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
43244
43245
  function settleWithin(promise2, deadline) {
43245
43246
  const remaining = deadline - Date.now();
43246
43247
  if (remaining <= 0)
@@ -43255,7 +43256,7 @@ function settleWithin(promise2, deadline) {
43255
43256
  return settled;
43256
43257
  }
43257
43258
 
43258
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43259
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
43259
43260
  function parseInterval(cron) {
43260
43261
  const trimmed = cron.trim();
43261
43262
  const num = Number(trimmed);
@@ -43348,7 +43349,7 @@ var init_node3 = __esm(() => {
43348
43349
  init_metrics();
43349
43350
  });
43350
43351
 
43351
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43352
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
43352
43353
  var exports_scheduler_node = {};
43353
43354
  __export(exports_scheduler_node, {
43354
43355
  NodeSchedulerAdapter: () => NodeSchedulerAdapter
@@ -50152,6 +50153,12 @@ class WorkflowRunLogSink {
50152
50153
  === run ${event.outcome} (exit ${event.exitCode}) after ${event.durationMs}ms ===
50153
50154
  `);
50154
50155
  break;
50156
+ case "heartbeat": {
50157
+ const timeout = event.timeoutMs !== undefined ? ` timeoutMs=${event.timeoutMs}` : "";
50158
+ this.append(`[${event.at}] agent.run progress: elapsed=${event.elapsedMs}ms${timeout}
50159
+ `);
50160
+ break;
50161
+ }
50155
50162
  default:
50156
50163
  break;
50157
50164
  }
@@ -51488,7 +51495,7 @@ var init_drizzle_zod = __esm(() => {
51488
51495
  };
51489
51496
  });
51490
51497
 
51491
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
51498
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
51492
51499
  function sqlExpressionToText(value) {
51493
51500
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
51494
51501
  return;
@@ -51511,7 +51518,7 @@ function getDrizzleTableName(table3) {
51511
51518
  return String(table3[nameSym]);
51512
51519
  }
51513
51520
 
51514
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
51521
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
51515
51522
  function quoteIdent(name) {
51516
51523
  return `"${name.replace(/"/g, '""')}"`;
51517
51524
  }
@@ -51605,7 +51612,7 @@ var init_ddl = __esm(() => {
51605
51612
  init_sqlite_core();
51606
51613
  });
51607
51614
 
51608
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51615
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
51609
51616
  function defineTable(name, columns2) {
51610
51617
  const table3 = sqliteTable(name, columns2);
51611
51618
  let insert2;
@@ -51639,7 +51646,7 @@ var init_define_table = __esm(() => {
51639
51646
  init_ddl();
51640
51647
  });
51641
51648
 
51642
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.19+035ffc9bc0428b94/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51649
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/index.js
51643
51650
  var init_schema = __esm(() => {
51644
51651
  init_sqlite_core();
51645
51652
  init_define_table();
@@ -52264,7 +52271,7 @@ var init_dao = __esm(() => {
52264
52271
  init_workspace_dao();
52265
52272
  });
52266
52273
 
52267
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
52274
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
52268
52275
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
52269
52276
  var init_errors6 = __esm(() => {
52270
52277
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -52299,12 +52306,12 @@ var init_errors6 = __esm(() => {
52299
52306
  };
52300
52307
  });
52301
52308
 
52302
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
52309
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
52303
52310
  var init_event_bus2 = __esm(() => {
52304
52311
  init_event_bus();
52305
52312
  });
52306
52313
 
52307
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/api-client.js
52314
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/api-client.js
52308
52315
  function sanitizeUrlForObservability(url2) {
52309
52316
  try {
52310
52317
  const parsed = new URL(url2);
@@ -52534,12 +52541,12 @@ var init_api_client = __esm(() => {
52534
52541
  };
52535
52542
  });
52536
52543
 
52537
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
52544
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
52538
52545
  var init_telemetry = __esm(() => {
52539
52546
  init_tracing2();
52540
52547
  });
52541
52548
 
52542
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/index.js
52549
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/index.js
52543
52550
  var init_dist6 = __esm(() => {
52544
52551
  init_api_client();
52545
52552
  init_event_bus2();
@@ -52547,7 +52554,7 @@ var init_dist6 = __esm(() => {
52547
52554
  init_telemetry();
52548
52555
  });
52549
52556
 
52550
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
52557
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
52551
52558
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
52552
52559
  return {
52553
52560
  workflow: workflowName,
@@ -52806,7 +52813,7 @@ var init_run_lifecycle = __esm(() => {
52806
52813
  ];
52807
52814
  });
52808
52815
 
52809
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
52816
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
52810
52817
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
52811
52818
  var init_schema2 = __esm(() => {
52812
52819
  init_zod();
@@ -52891,7 +52898,7 @@ var init_schema2 = __esm(() => {
52891
52898
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
52892
52899
  });
52893
52900
 
52894
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
52901
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
52895
52902
  async function loadWorkflowDef(path9, options = {}) {
52896
52903
  return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
52897
52904
  }
@@ -53058,7 +53065,7 @@ var init_config4 = __esm(() => {
53058
53065
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
53059
53066
  });
53060
53067
 
53061
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
53068
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
53062
53069
  class CapabilityRegistry {
53063
53070
  kind;
53064
53071
  capabilities = new Map;
@@ -53089,7 +53096,7 @@ class CapabilityRegistry {
53089
53096
  }
53090
53097
  }
53091
53098
 
53092
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
53099
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
53093
53100
  function assertRelativeExtensionPath(path9, options = {}) {
53094
53101
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
53095
53102
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
@@ -53100,20 +53107,20 @@ function assertRelativeExtensionPath(path9, options = {}) {
53100
53107
  }
53101
53108
  }
53102
53109
 
53103
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
53110
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
53104
53111
  var init_extension_loader = () => {};
53105
53112
 
53106
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
53113
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
53107
53114
  var init_extension = __esm(() => {
53108
53115
  init_extension_loader();
53109
53116
  });
53110
53117
 
53111
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.19+e40533aaad760d62/node_modules/@gobing-ai/ts-runtime/dist/extension.js
53118
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension.js
53112
53119
  var init_extension2 = __esm(() => {
53113
53120
  init_extension();
53114
53121
  });
53115
53122
 
53116
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
53123
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
53117
53124
  class WorkflowEngineHost {
53118
53125
  lifecycleBus;
53119
53126
  actions = new CapabilityRegistry("workflow action");
@@ -53282,7 +53289,7 @@ var init_host = __esm(() => {
53282
53289
  init_errors6();
53283
53290
  });
53284
53291
 
53285
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
53292
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
53286
53293
  var WORKFLOW_ENGINE_SCHEMA_SQL;
53287
53294
  var init_schema_sql = __esm(() => {
53288
53295
  WORKFLOW_ENGINE_SCHEMA_SQL = `
@@ -53355,7 +53362,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
53355
53362
  `.trim();
53356
53363
  });
53357
53364
 
53358
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
53365
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
53359
53366
  async function applyWorkflowEngineSchema(db2) {
53360
53367
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
53361
53368
  const sql4 = statement.trim();
@@ -53644,7 +53651,7 @@ var init_persistence = __esm(() => {
53644
53651
  init_schema_sql();
53645
53652
  });
53646
53653
 
53647
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53654
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
53648
53655
  function mergeVars(workflowVars = {}, overrideVars = {}) {
53649
53656
  return { ...workflowVars, ...overrideVars };
53650
53657
  }
@@ -53704,7 +53711,7 @@ var init_variables = __esm(() => {
53704
53711
  TEMPLATE_REF = /\$\{([^}]+)\}/g;
53705
53712
  });
53706
53713
 
53707
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
53714
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
53708
53715
  async function runActionStep(action, vars, deps) {
53709
53716
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
53710
53717
  const resolved = resolveTemplates(action.options ?? {}, {
@@ -53762,7 +53769,7 @@ var init_action_step = __esm(() => {
53762
53769
  init_variables();
53763
53770
  });
53764
53771
 
53765
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
53772
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
53766
53773
  class StateMachineDriver {
53767
53774
  options;
53768
53775
  constructor(options) {
@@ -53898,7 +53905,7 @@ var init_state_machine = __esm(() => {
53898
53905
  EMPTY_OUTCOME = { outcome: "completed", result: undefined };
53899
53906
  });
53900
53907
 
53901
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
53908
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
53902
53909
  class TransitionFlowDriver {
53903
53910
  options;
53904
53911
  constructor(options) {
@@ -54017,7 +54024,7 @@ var init_transition_flow = __esm(() => {
54017
54024
  init_variables();
54018
54025
  });
54019
54026
 
54020
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
54027
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
54021
54028
  class WorkflowService {
54022
54029
  host;
54023
54030
  persistence;
@@ -54234,7 +54241,7 @@ var init_service = __esm(() => {
54234
54241
  init_variables();
54235
54242
  });
54236
54243
 
54237
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
54244
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
54238
54245
  var init_dist7 = __esm(() => {
54239
54246
  init_config4();
54240
54247
  init_host();
@@ -54243,7 +54250,7 @@ var init_dist7 = __esm(() => {
54243
54250
  init_service();
54244
54251
  });
54245
54252
 
54246
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54253
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
54247
54254
  import { createHash } from "crypto";
54248
54255
  function stableJson(value) {
54249
54256
  if (Array.isArray(value)) {
@@ -54260,7 +54267,7 @@ function sha256(value) {
54260
54267
  }
54261
54268
  var init_hash = () => {};
54262
54269
 
54263
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54270
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54264
54271
  var HistoryImportError;
54265
54272
  var init_errors7 = __esm(() => {
54266
54273
  HistoryImportError = class HistoryImportError extends Error {
@@ -54273,7 +54280,7 @@ var init_errors7 = __esm(() => {
54273
54280
  };
54274
54281
  });
54275
54282
 
54276
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54283
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
54277
54284
  var HISTORY_IMPORT_SCHEMA_SQL;
54278
54285
  var init_schema_sql2 = __esm(() => {
54279
54286
  HISTORY_IMPORT_SCHEMA_SQL = `
@@ -54357,10 +54364,1000 @@ CREATE TABLE IF NOT EXISTS history_etl_openclaw (
54357
54364
  payload_json TEXT NOT NULL,
54358
54365
  imported_at TEXT NOT NULL
54359
54366
  );
54367
+
54368
+ CREATE TABLE IF NOT EXISTS history_message (
54369
+ record_hash TEXT PRIMARY KEY,
54370
+ source TEXT NOT NULL,
54371
+ source_file TEXT NOT NULL,
54372
+ source_line INTEGER NOT NULL,
54373
+ session_id TEXT NOT NULL,
54374
+ seq INTEGER NOT NULL,
54375
+ turn_index INTEGER,
54376
+ role TEXT NOT NULL,
54377
+ record_type TEXT NOT NULL,
54378
+ disposition TEXT NOT NULL,
54379
+ ts TEXT NOT NULL,
54380
+ duration_ms INTEGER,
54381
+ model TEXT,
54382
+ input_tokens INTEGER,
54383
+ output_tokens INTEGER,
54384
+ cache_read_tokens INTEGER,
54385
+ cache_write_tokens INTEGER,
54386
+ cost_usd REAL,
54387
+ content_text TEXT,
54388
+ cwd TEXT,
54389
+ provenance TEXT NOT NULL,
54390
+ run_id TEXT,
54391
+ task_wbs TEXT,
54392
+ imported_at TEXT NOT NULL
54393
+ );
54394
+
54395
+ CREATE TABLE IF NOT EXISTS history_tool_call (
54396
+ record_hash TEXT PRIMARY KEY,
54397
+ message_hash TEXT NOT NULL,
54398
+ source TEXT NOT NULL,
54399
+ source_file TEXT NOT NULL,
54400
+ source_line INTEGER NOT NULL,
54401
+ session_id TEXT NOT NULL,
54402
+ seq INTEGER NOT NULL,
54403
+ tool_name TEXT NOT NULL,
54404
+ args_digest TEXT,
54405
+ status TEXT NOT NULL,
54406
+ started_at TEXT,
54407
+ completed_at TEXT,
54408
+ duration_ms INTEGER,
54409
+ result_bytes INTEGER,
54410
+ error_text TEXT,
54411
+ imported_at TEXT NOT NULL
54412
+ );
54413
+
54414
+ CREATE INDEX IF NOT EXISTS idx_history_message_session
54415
+ ON history_message(source, session_id, seq);
54416
+ CREATE INDEX IF NOT EXISTS idx_history_message_ts
54417
+ ON history_message(ts);
54418
+ CREATE INDEX IF NOT EXISTS idx_history_tool_call_session
54419
+ ON history_tool_call(source, session_id, seq);
54420
+ CREATE INDEX IF NOT EXISTS idx_history_tool_call_tool_name
54421
+ ON history_tool_call(tool_name);
54422
+ CREATE INDEX IF NOT EXISTS idx_history_tool_call_message_hash
54423
+ ON history_tool_call(message_hash);
54360
54424
  `.trim();
54361
54425
  });
54362
54426
 
54363
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
54427
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
54428
+ function identityFieldMap(keys) {
54429
+ const map2 = {};
54430
+ for (const key of keys) {
54431
+ map2[key] = key;
54432
+ }
54433
+ return map2;
54434
+ }
54435
+ function detectProvenance(cwd) {
54436
+ if (cwd === undefined)
54437
+ return "ambient";
54438
+ return cwd.includes("/spur") || cwd.includes("/spur-new") ? "spur-run" : "ambient";
54439
+ }
54440
+ function argsDigest(args) {
54441
+ const redacted = redactArgs(args);
54442
+ return sha256(redacted);
54443
+ }
54444
+ function redactArgs(args) {
54445
+ if (typeof args === "string") {
54446
+ if (args.length > 80)
54447
+ return "[REDACTED:long]";
54448
+ if (/[A-Za-z0-9+/]{40,}=*|[A-Za-z0-9_-]{20,}/.test(args))
54449
+ return "[REDACTED:secret]";
54450
+ return args;
54451
+ }
54452
+ if (Array.isArray(args))
54453
+ return args.map(redactArgs);
54454
+ if (args !== null && typeof args === "object") {
54455
+ const result = {};
54456
+ for (const [key, value] of Object.entries(args)) {
54457
+ result[key] = redactArgs(value);
54458
+ }
54459
+ return result;
54460
+ }
54461
+ return args;
54462
+ }
54463
+ function claudeSplit(raw) {
54464
+ const entries = [];
54465
+ const sessionId = s(raw.sessionId, raw.conversation_uuid) ?? "unknown";
54466
+ const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.messageIndex === "number" ? raw.messageIndex : 0;
54467
+ const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
54468
+ const role = mapRole(raw.type ?? raw.role);
54469
+ const recordType = String(raw.type ?? "");
54470
+ const model = s(raw.model);
54471
+ const cwd = s(raw.cwd, raw.dir);
54472
+ if (raw.subtype === "turn_duration" && typeof raw.durationMs === "number") {
54473
+ entries.push({
54474
+ targetTable: "history_message",
54475
+ record: {
54476
+ session_id: sessionId,
54477
+ seq,
54478
+ role: "system",
54479
+ record_type: "turn_duration",
54480
+ disposition: "meta",
54481
+ ts,
54482
+ duration_ms: raw.durationMs,
54483
+ content_text: null,
54484
+ provenance: detectProvenance(cwd)
54485
+ }
54486
+ });
54487
+ return entries;
54488
+ }
54489
+ if (recordType === "attachment" || recordType.startsWith("file-history")) {
54490
+ entries.push({
54491
+ targetTable: "history_message",
54492
+ record: {
54493
+ session_id: sessionId,
54494
+ seq,
54495
+ role: "meta",
54496
+ record_type: recordType,
54497
+ disposition: "meta",
54498
+ ts,
54499
+ provenance: detectProvenance(cwd)
54500
+ }
54501
+ });
54502
+ return entries;
54503
+ }
54504
+ const hasUsage = typeof raw.usage === "object" && raw.usage !== null;
54505
+ const usage = hasUsage ? raw.usage : undefined;
54506
+ const inputTokens = typeof raw.inputTokens === "number" ? raw.inputTokens : undefined;
54507
+ const outputTokens = typeof raw.outputTokens === "number" ? raw.outputTokens : undefined;
54508
+ const cacheRead = usage?.cacheReadTokens ?? usage?.cache_read_tokens ?? undefined;
54509
+ const cacheWrite = usage?.cacheWriteTokens ?? usage?.cache_write_tokens ?? undefined;
54510
+ const costUsd = computeCost(inputTokens, outputTokens, model);
54511
+ const contentBlocks = raw.content;
54512
+ const contentText = extractContentText(contentBlocks);
54513
+ const messageSplitIndex = entries.length;
54514
+ entries.push({
54515
+ targetTable: "history_message",
54516
+ record: {
54517
+ session_id: sessionId,
54518
+ seq,
54519
+ turn_index: typeof raw.turnIndex === "number" ? raw.turnIndex : undefined,
54520
+ role,
54521
+ record_type: recordType,
54522
+ disposition: "keep",
54523
+ ts,
54524
+ duration_ms: undefined,
54525
+ model: model ?? null,
54526
+ input_tokens: inputTokens ?? null,
54527
+ output_tokens: outputTokens ?? null,
54528
+ cache_read_tokens: cacheRead ?? null,
54529
+ cache_write_tokens: cacheWrite ?? null,
54530
+ cost_usd: costUsd ?? null,
54531
+ content_text: contentText ?? null,
54532
+ cwd: cwd ?? null,
54533
+ provenance: detectProvenance(cwd)
54534
+ }
54535
+ });
54536
+ if (Array.isArray(contentBlocks) && role === "assistant") {
54537
+ for (const block of contentBlocks) {
54538
+ if (typeof block !== "object" || block === null)
54539
+ continue;
54540
+ const b = block;
54541
+ if (b.type === "tool_use") {
54542
+ entries.push({
54543
+ targetTable: "history_tool_call",
54544
+ record: {
54545
+ _messageSplitIndex: messageSplitIndex,
54546
+ session_id: sessionId,
54547
+ seq,
54548
+ tool_name: String(b.name ?? ""),
54549
+ args_digest: argsDigest(b.input),
54550
+ status: "ok",
54551
+ started_at: undefined,
54552
+ completed_at: undefined,
54553
+ duration_ms: undefined,
54554
+ result_bytes: undefined,
54555
+ error_text: undefined
54556
+ }
54557
+ });
54558
+ }
54559
+ }
54560
+ }
54561
+ return entries;
54562
+ }
54563
+ function piSplit(raw) {
54564
+ const entries = [];
54565
+ const r = raw;
54566
+ const sessionId = s(r.id, o2(r.session).id) ?? "unknown";
54567
+ const seq = typeof r.seq === "number" ? r.seq : 0;
54568
+ const ts = s(r.ts, r.timestamp, r.createdAt) ?? new Date(0).toISOString();
54569
+ const role = mapRole(r.type ?? r.role);
54570
+ const recordType = String(r.type ?? "");
54571
+ const model = s(r.model, o2(r.message).model);
54572
+ const cwd = s(r.cwd, r.dir);
54573
+ const msg = r.message;
54574
+ const usage = msg?.usage;
54575
+ const inputTokens = usage?.input ?? usage?.input_tokens ?? undefined;
54576
+ const outputTokens = usage?.output ?? usage?.output_tokens ?? undefined;
54577
+ const cacheRead = usage?.cacheRead ?? usage?.cache_read_tokens ?? undefined;
54578
+ const cacheWrite = usage?.cacheWrite ?? usage?.cache_write_tokens ?? undefined;
54579
+ const costObj = msg?.cost ?? r.cost;
54580
+ const costUsd = typeof costObj?.total === "number" ? costObj.total : computeCost(inputTokens, outputTokens, model);
54581
+ const messageSplitIndex = entries.length;
54582
+ entries.push({
54583
+ targetTable: "history_message",
54584
+ record: {
54585
+ session_id: sessionId,
54586
+ seq,
54587
+ role,
54588
+ record_type: recordType,
54589
+ disposition: "keep",
54590
+ ts,
54591
+ duration_ms: undefined,
54592
+ model: model ?? null,
54593
+ input_tokens: inputTokens ?? null,
54594
+ output_tokens: outputTokens ?? null,
54595
+ cache_read_tokens: cacheRead ?? null,
54596
+ cache_write_tokens: cacheWrite ?? null,
54597
+ cost_usd: costUsd ?? null,
54598
+ content_text: s(r.content, r.text, msg?.content) ?? null,
54599
+ cwd: cwd ?? null,
54600
+ provenance: detectProvenance(cwd)
54601
+ }
54602
+ });
54603
+ if (Array.isArray(r.content) && role === "assistant") {
54604
+ for (const block of r.content) {
54605
+ if (block?.toolCall) {
54606
+ const tc = block.toolCall;
54607
+ entries.push({
54608
+ targetTable: "history_tool_call",
54609
+ record: {
54610
+ _messageSplitIndex: messageSplitIndex,
54611
+ session_id: sessionId,
54612
+ seq,
54613
+ tool_name: String(tc.name ?? ""),
54614
+ args_digest: argsDigest(tc.input ?? tc.arguments),
54615
+ status: "ok",
54616
+ started_at: undefined,
54617
+ completed_at: undefined,
54618
+ duration_ms: undefined,
54619
+ result_bytes: undefined,
54620
+ error_text: undefined
54621
+ }
54622
+ });
54623
+ }
54624
+ }
54625
+ }
54626
+ return entries;
54627
+ }
54628
+ function ompSplit(raw) {
54629
+ const recordType = String(raw.type ?? "");
54630
+ if (recordType === "title" || recordType === "title_change" || recordType === "service_tier_change" || recordType === "ttsr_injection" || recordType === "session_init" || recordType === "compaction") {
54631
+ return [
54632
+ {
54633
+ targetTable: "history_message",
54634
+ record: {
54635
+ session_id: s(raw.id, o2(raw.session).id) ?? "unknown",
54636
+ seq: typeof raw.seq === "number" ? raw.seq : 0,
54637
+ role: "meta",
54638
+ record_type: recordType,
54639
+ disposition: "meta",
54640
+ ts: s(raw.ts, raw.timestamp) ?? new Date(0).toISOString(),
54641
+ provenance: "ambient"
54642
+ }
54643
+ }
54644
+ ];
54645
+ }
54646
+ const entries = [];
54647
+ const sessionId = s(raw.id, o2(raw.session).id) ?? "unknown";
54648
+ const seq = typeof raw.seq === "number" ? raw.seq : 0;
54649
+ const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
54650
+ const role = mapRole(raw.type ?? raw.role);
54651
+ const model = s(raw.model, o2(raw.message).model);
54652
+ const cwd = s(raw.cwd, raw.dir);
54653
+ const msg = raw.message;
54654
+ const usage = msg?.usage;
54655
+ const inputTokens = usage?.input ?? usage?.input_tokens ?? undefined;
54656
+ const outputTokens = usage?.output ?? usage?.output_tokens ?? undefined;
54657
+ const cacheRead = usage?.cacheRead ?? usage?.cache_read_tokens ?? undefined;
54658
+ const cacheWrite = usage?.cacheWrite ?? usage?.cache_write_tokens ?? undefined;
54659
+ const costObj = msg?.cost ?? raw.cost;
54660
+ const costUsd = typeof costObj?.total === "number" ? costObj.total : computeCost(inputTokens, outputTokens, model);
54661
+ const messageSplitIndex = entries.length;
54662
+ entries.push({
54663
+ targetTable: "history_message",
54664
+ record: {
54665
+ session_id: sessionId,
54666
+ seq,
54667
+ role,
54668
+ record_type: recordType,
54669
+ disposition: "keep",
54670
+ ts,
54671
+ duration_ms: undefined,
54672
+ model: model ?? null,
54673
+ input_tokens: inputTokens ?? null,
54674
+ output_tokens: outputTokens ?? null,
54675
+ cache_read_tokens: cacheRead ?? null,
54676
+ cache_write_tokens: cacheWrite ?? null,
54677
+ cost_usd: costUsd ?? null,
54678
+ content_text: s(raw.content, raw.text, msg?.content) ?? null,
54679
+ cwd: cwd ?? null,
54680
+ provenance: detectProvenance(cwd)
54681
+ }
54682
+ });
54683
+ if (Array.isArray(raw.content) && role === "assistant") {
54684
+ for (const block of raw.content) {
54685
+ if (block?.toolCall) {
54686
+ const tc = block.toolCall;
54687
+ entries.push({
54688
+ targetTable: "history_tool_call",
54689
+ record: {
54690
+ _messageSplitIndex: messageSplitIndex,
54691
+ session_id: sessionId,
54692
+ seq,
54693
+ tool_name: String(tc.name ?? ""),
54694
+ args_digest: argsDigest(tc.input ?? tc.arguments),
54695
+ status: "ok",
54696
+ started_at: undefined,
54697
+ completed_at: undefined,
54698
+ duration_ms: undefined,
54699
+ result_bytes: undefined,
54700
+ error_text: undefined
54701
+ }
54702
+ });
54703
+ }
54704
+ }
54705
+ }
54706
+ return entries;
54707
+ }
54708
+ function codexSplit(raw) {
54709
+ const entries = [];
54710
+ const payload = raw.payload ?? raw;
54711
+ const sessionId = s(raw.session_id, o2(raw.session_meta).id, raw.id) ?? "unknown";
54712
+ const seq = typeof raw.seq === "number" ? raw.seq : 0;
54713
+ const ts = s(raw.timestamp, raw.ts, payload.ts) ?? new Date(0).toISOString();
54714
+ const recordType = String(raw.type ?? "");
54715
+ if (recordType === "" && raw.id && raw.timestamp && raw.instructions) {
54716
+ return [
54717
+ {
54718
+ targetTable: "history_message",
54719
+ record: {
54720
+ session_id: sessionId,
54721
+ seq,
54722
+ role: "unknown",
54723
+ record_type: "short_format",
54724
+ disposition: "unknown",
54725
+ ts,
54726
+ provenance: "ambient"
54727
+ }
54728
+ }
54729
+ ];
54730
+ }
54731
+ const role = mapRole(recordType);
54732
+ const model = s(raw.model, payload.model, o2(o2(raw.turn_context).payload).model);
54733
+ const cwd = s(raw.cwd, raw.dir);
54734
+ const tokenCount = payload.token_count;
54735
+ const inputTokens = tokenCount?.input ?? tokenCount?.input_tokens ?? undefined;
54736
+ const outputTokens = tokenCount?.output ?? tokenCount?.output_tokens ?? undefined;
54737
+ const turnCtx = raw.turn_context;
54738
+ const turnPayload = turnCtx?.payload;
54739
+ const turnInputTokens = turnPayload?.input_tokens;
54740
+ const turnOutputTokens = turnPayload?.output_tokens;
54741
+ const finalInput = inputTokens !== undefined ? inputTokens : turnInputTokens;
54742
+ const finalOutput = outputTokens !== undefined ? outputTokens : turnOutputTokens;
54743
+ const costUsd = computeCost(finalInput, finalOutput, model);
54744
+ const messageSplitIndex = entries.length;
54745
+ entries.push({
54746
+ targetTable: "history_message",
54747
+ record: {
54748
+ session_id: sessionId,
54749
+ seq,
54750
+ role,
54751
+ record_type: recordType,
54752
+ disposition: "keep",
54753
+ ts,
54754
+ duration_ms: undefined,
54755
+ model: model ?? null,
54756
+ input_tokens: finalInput ?? null,
54757
+ output_tokens: finalOutput ?? null,
54758
+ cache_read_tokens: null,
54759
+ cache_write_tokens: null,
54760
+ cost_usd: costUsd ?? null,
54761
+ content_text: s(payload.content, payload.text, raw.content, raw.text) ?? null,
54762
+ cwd: cwd ?? null,
54763
+ provenance: detectProvenance(cwd)
54764
+ }
54765
+ });
54766
+ const responseItems = payload.response_item ? [payload.response_item] : Array.isArray(payload.response_items) ? payload.response_items : [];
54767
+ for (const item of responseItems) {
54768
+ if (item.function_call) {
54769
+ const fc = item.function_call;
54770
+ entries.push({
54771
+ targetTable: "history_tool_call",
54772
+ record: {
54773
+ _messageSplitIndex: messageSplitIndex,
54774
+ session_id: sessionId,
54775
+ seq,
54776
+ tool_name: String(fc.name ?? ""),
54777
+ args_digest: argsDigest(fc.arguments),
54778
+ status: "ok",
54779
+ started_at: undefined,
54780
+ completed_at: undefined,
54781
+ duration_ms: undefined,
54782
+ result_bytes: undefined,
54783
+ error_text: undefined
54784
+ }
54785
+ });
54786
+ }
54787
+ }
54788
+ return entries;
54789
+ }
54790
+ function agySplit(raw) {
54791
+ const entries = [];
54792
+ const recordType = String(raw.type ?? "");
54793
+ const sessionId = s(raw.session_id, raw.conversation_id) ?? "unknown";
54794
+ const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : 0;
54795
+ const ts = s(raw.created_at, raw.timestamp, raw.ts) ?? new Date(0).toISOString();
54796
+ let role;
54797
+ let disposition;
54798
+ let contentText = null;
54799
+ switch (recordType) {
54800
+ case "USER_INPUT":
54801
+ case "ASK_QUESTION":
54802
+ role = "user";
54803
+ disposition = "keep";
54804
+ contentText = s(raw.content, raw.text, raw.message) ?? null;
54805
+ break;
54806
+ case "PLANNER_RESPONSE":
54807
+ role = "assistant";
54808
+ disposition = "keep";
54809
+ contentText = s(raw.content, raw.text, raw.message, raw.plan) ?? null;
54810
+ break;
54811
+ case "ERROR_MESSAGE":
54812
+ role = "system";
54813
+ disposition = "keep";
54814
+ contentText = s(raw.content, raw.text, raw.message) ?? null;
54815
+ break;
54816
+ case "RUN_COMMAND":
54817
+ case "VIEW_FILE":
54818
+ case "GREP_SEARCH":
54819
+ case "LIST_DIRECTORY":
54820
+ case "READ_URL_CONTENT":
54821
+ role = "tool";
54822
+ disposition = "keep";
54823
+ contentText = s(raw.content, raw.command, raw.file_path, raw.pattern) ?? null;
54824
+ break;
54825
+ case "CODE_ACTION":
54826
+ case "INVOKE_SUBAGENT":
54827
+ role = "tool";
54828
+ disposition = "keep";
54829
+ contentText = s(raw.content, raw.text) ?? null;
54830
+ break;
54831
+ case "CONVERSATION_HISTORY":
54832
+ case "CHECKPOINT":
54833
+ case "GENERIC":
54834
+ role = "meta";
54835
+ disposition = "meta";
54836
+ contentText = s(raw.content, raw.text) ?? null;
54837
+ break;
54838
+ default:
54839
+ if (recordType.length === 0) {
54840
+ role = "unknown";
54841
+ disposition = "unknown";
54842
+ } else {
54843
+ role = "meta";
54844
+ disposition = "meta";
54845
+ contentText = s(raw.content, raw.text) ?? null;
54846
+ }
54847
+ break;
54848
+ }
54849
+ const messageSplitIndex = entries.length;
54850
+ entries.push({
54851
+ targetTable: "history_message",
54852
+ record: {
54853
+ session_id: sessionId,
54854
+ seq,
54855
+ role,
54856
+ record_type: recordType,
54857
+ disposition,
54858
+ ts,
54859
+ duration_ms: undefined,
54860
+ model: null,
54861
+ input_tokens: null,
54862
+ output_tokens: null,
54863
+ cache_read_tokens: null,
54864
+ cache_write_tokens: null,
54865
+ cost_usd: null,
54866
+ content_text: contentText,
54867
+ cwd: null,
54868
+ provenance: "ambient"
54869
+ }
54870
+ });
54871
+ if (recordType === "PLANNER_RESPONSE" && Array.isArray(raw.tool_calls)) {
54872
+ for (const tc of raw.tool_calls) {
54873
+ entries.push({
54874
+ targetTable: "history_tool_call",
54875
+ record: {
54876
+ _messageSplitIndex: messageSplitIndex,
54877
+ session_id: sessionId,
54878
+ seq: typeof tc.step_index === "number" ? tc.step_index : seq,
54879
+ tool_name: String(tc.name ?? tc.tool_name ?? ""),
54880
+ args_digest: argsDigest(tc.input ?? tc.arguments),
54881
+ status: "ok",
54882
+ started_at: undefined,
54883
+ completed_at: undefined,
54884
+ duration_ms: undefined,
54885
+ result_bytes: undefined,
54886
+ error_text: undefined
54887
+ }
54888
+ });
54889
+ }
54890
+ }
54891
+ return entries;
54892
+ }
54893
+ function normalizeGrokRecord(raw) {
54894
+ const params = raw.params;
54895
+ const update2 = params?.update;
54896
+ const isUpdatesShape = typeof raw.method === "string" && params !== undefined && update2 !== undefined;
54897
+ const body = isUpdatesShape ? update2 : raw;
54898
+ const recordType = String((isUpdatesShape ? update2?.sessionUpdate : raw.type) ?? raw.sessionUpdate ?? "");
54899
+ const sessionId = s(params?.sessionId, raw.session_id, raw.sessionId, raw.params?.sessionId) ?? "unknown";
54900
+ const ts = normalizeTs(raw.ts ?? raw.timestamp ?? body.ts ?? body.timestamp);
54901
+ const seq = typeof raw.seq === "number" ? raw.seq : typeof body.seq === "number" ? body.seq : 0;
54902
+ const meta3 = body._meta ?? params?._meta ?? raw._meta;
54903
+ const model = s(meta3?.modelId, body.model, raw.model);
54904
+ const contentText = extractGrokContent(body.content ?? body.text ?? raw.content ?? raw.text);
54905
+ const usage = body.usage ?? raw.usage;
54906
+ const toolMeta = meta3?.["x.ai/tool"];
54907
+ const toolName = s(body.title, body.tool_name, body.name, toolMeta?.name, toolMeta?.label, raw.tool_name, raw.name) ?? "";
54908
+ const toolArgs = body.rawInput ?? body.input ?? body.arguments ?? toolMeta?.input ?? raw.input ?? raw.arguments;
54909
+ const toolStatus = s(body.status, raw.outcome, raw.status) ?? "ok";
54910
+ const durationMs = typeof body.duration_ms === "number" ? body.duration_ms : typeof raw.duration_ms === "number" ? raw.duration_ms : typeof usage?.apiDurationMs === "number" ? usage.apiDurationMs : undefined;
54911
+ const errorText = body.error !== undefined ? String(body.error) : raw.error !== undefined ? String(raw.error) : undefined;
54912
+ const hasTypeDiscriminator = recordType.length > 0 || isUpdatesShape;
54913
+ return {
54914
+ recordType,
54915
+ sessionId,
54916
+ ts,
54917
+ seq,
54918
+ body,
54919
+ model,
54920
+ contentText,
54921
+ usage,
54922
+ toolName,
54923
+ toolArgs,
54924
+ toolStatus,
54925
+ durationMs,
54926
+ errorText,
54927
+ hasTypeDiscriminator
54928
+ };
54929
+ }
54930
+ function normalizeTs(value) {
54931
+ if (typeof value === "number" && Number.isFinite(value)) {
54932
+ const ms = value > 1000000000000 ? value : value * 1000;
54933
+ return new Date(ms).toISOString();
54934
+ }
54935
+ if (typeof value === "string" && value.length > 0) {
54936
+ const asNum = Number(value);
54937
+ if (Number.isFinite(asNum) && /^\d+(\.\d+)?$/.test(value.trim())) {
54938
+ const ms = asNum > 1000000000000 ? asNum : asNum * 1000;
54939
+ return new Date(ms).toISOString();
54940
+ }
54941
+ return value;
54942
+ }
54943
+ return new Date(0).toISOString();
54944
+ }
54945
+ function extractGrokContent(content) {
54946
+ if (typeof content === "string")
54947
+ return content;
54948
+ if (content !== null && typeof content === "object" && !Array.isArray(content)) {
54949
+ const c3 = content;
54950
+ if (typeof c3.text === "string")
54951
+ return c3.text;
54952
+ if (typeof c3.content === "string")
54953
+ return c3.content;
54954
+ }
54955
+ if (Array.isArray(content)) {
54956
+ const parts = [];
54957
+ for (const block of content) {
54958
+ if (typeof block === "string")
54959
+ parts.push(block);
54960
+ else if (block !== null && typeof block === "object") {
54961
+ const b = block;
54962
+ if (typeof b.text === "string")
54963
+ parts.push(b.text);
54964
+ }
54965
+ }
54966
+ return parts.length > 0 ? parts.join(`
54967
+ `) : null;
54968
+ }
54969
+ return null;
54970
+ }
54971
+ function grokSplit(raw) {
54972
+ const entries = [];
54973
+ const n2 = normalizeGrokRecord(raw);
54974
+ const { recordType, sessionId, ts, seq } = n2;
54975
+ if (recordType === "turn_completed") {
54976
+ const usage = n2.usage;
54977
+ const modelUsage = usage?.modelUsage;
54978
+ const modelFromUsage = modelUsage !== null && typeof modelUsage === "object" ? Object.keys(modelUsage)[0] : undefined;
54979
+ const model = s(n2.model, modelFromUsage);
54980
+ const inputTokens = usage?.inputTokens ?? usage?.input ?? usage?.input_tokens;
54981
+ const outputTokens = usage?.outputTokens ?? usage?.output ?? usage?.output_tokens;
54982
+ const cacheRead = usage?.cachedReadTokens ?? usage?.cache_read_tokens;
54983
+ entries.push({
54984
+ targetTable: "history_message",
54985
+ record: {
54986
+ session_id: sessionId,
54987
+ seq,
54988
+ role: "assistant",
54989
+ record_type: recordType,
54990
+ disposition: "keep",
54991
+ ts,
54992
+ duration_ms: n2.durationMs ?? null,
54993
+ model: model ?? null,
54994
+ input_tokens: inputTokens ?? null,
54995
+ output_tokens: outputTokens ?? null,
54996
+ cache_read_tokens: cacheRead ?? null,
54997
+ cache_write_tokens: null,
54998
+ cost_usd: null,
54999
+ content_text: n2.contentText,
55000
+ cwd: null,
55001
+ provenance: "ambient"
55002
+ }
55003
+ });
55004
+ return entries;
55005
+ }
55006
+ if (recordType === "tool_started") {
55007
+ const messageSplitIndex = 0;
55008
+ entries.push({
55009
+ targetTable: "history_message",
55010
+ record: {
55011
+ session_id: sessionId,
55012
+ seq,
55013
+ role: "assistant",
55014
+ record_type: recordType,
55015
+ disposition: "keep",
55016
+ ts,
55017
+ duration_ms: undefined,
55018
+ model: n2.model ?? null,
55019
+ input_tokens: null,
55020
+ output_tokens: null,
55021
+ cache_read_tokens: null,
55022
+ cache_write_tokens: null,
55023
+ cost_usd: null,
55024
+ content_text: n2.contentText,
55025
+ cwd: null,
55026
+ provenance: "ambient"
55027
+ }
55028
+ });
55029
+ entries.push({
55030
+ targetTable: "history_tool_call",
55031
+ record: {
55032
+ _messageSplitIndex: messageSplitIndex,
55033
+ session_id: sessionId,
55034
+ seq,
55035
+ tool_name: n2.toolName,
55036
+ args_digest: argsDigest(n2.toolArgs),
55037
+ status: n2.toolStatus || "ok",
55038
+ started_at: ts,
55039
+ completed_at: undefined,
55040
+ duration_ms: undefined,
55041
+ result_bytes: undefined,
55042
+ error_text: n2.errorText
55043
+ }
55044
+ });
55045
+ return entries;
55046
+ }
55047
+ if (recordType === "tool_completed") {
55048
+ entries.push({
55049
+ targetTable: "history_tool_call",
55050
+ record: {
55051
+ _messageSplitIndex: 0,
55052
+ session_id: sessionId,
55053
+ seq,
55054
+ tool_name: n2.toolName,
55055
+ args_digest: null,
55056
+ status: n2.toolStatus || "ok",
55057
+ started_at: undefined,
55058
+ completed_at: ts,
55059
+ duration_ms: n2.durationMs,
55060
+ result_bytes: undefined,
55061
+ error_text: n2.errorText
55062
+ }
55063
+ });
55064
+ return entries;
55065
+ }
55066
+ if (recordType === "tool_call" || recordType === "tool_call_update") {
55067
+ const messageSplitIndex = 0;
55068
+ entries.push({
55069
+ targetTable: "history_message",
55070
+ record: {
55071
+ session_id: sessionId,
55072
+ seq,
55073
+ role: "assistant",
55074
+ record_type: recordType,
55075
+ disposition: "keep",
55076
+ ts,
55077
+ duration_ms: undefined,
55078
+ model: n2.model ?? null,
55079
+ input_tokens: null,
55080
+ output_tokens: null,
55081
+ cache_read_tokens: null,
55082
+ cache_write_tokens: null,
55083
+ cost_usd: null,
55084
+ content_text: n2.contentText,
55085
+ cwd: null,
55086
+ provenance: "ambient"
55087
+ }
55088
+ });
55089
+ entries.push({
55090
+ targetTable: "history_tool_call",
55091
+ record: {
55092
+ _messageSplitIndex: messageSplitIndex,
55093
+ session_id: sessionId,
55094
+ seq,
55095
+ tool_name: n2.toolName,
55096
+ args_digest: argsDigest(n2.toolArgs),
55097
+ status: n2.toolStatus || "ok",
55098
+ started_at: recordType === "tool_call" ? ts : undefined,
55099
+ completed_at: recordType === "tool_call_update" ? ts : undefined,
55100
+ duration_ms: n2.durationMs,
55101
+ result_bytes: undefined,
55102
+ error_text: n2.errorText
55103
+ }
55104
+ });
55105
+ return entries;
55106
+ }
55107
+ if (recordType === "user" || recordType === "user_message" || recordType === "user_message_chunk" || recordType === "message") {
55108
+ entries.push({
55109
+ targetTable: "history_message",
55110
+ record: {
55111
+ session_id: sessionId,
55112
+ seq,
55113
+ role: "user",
55114
+ record_type: recordType || "user_message",
55115
+ disposition: "keep",
55116
+ ts,
55117
+ duration_ms: undefined,
55118
+ model: null,
55119
+ input_tokens: null,
55120
+ output_tokens: null,
55121
+ cache_read_tokens: null,
55122
+ cache_write_tokens: null,
55123
+ cost_usd: null,
55124
+ content_text: n2.contentText,
55125
+ cwd: null,
55126
+ provenance: "ambient"
55127
+ }
55128
+ });
55129
+ return entries;
55130
+ }
55131
+ if (recordType === "assistant" || recordType === "agent_message_chunk") {
55132
+ entries.push({
55133
+ targetTable: "history_message",
55134
+ record: {
55135
+ session_id: sessionId,
55136
+ seq,
55137
+ role: "assistant",
55138
+ record_type: recordType,
55139
+ disposition: "keep",
55140
+ ts,
55141
+ duration_ms: undefined,
55142
+ model: n2.model ?? null,
55143
+ input_tokens: null,
55144
+ output_tokens: null,
55145
+ cache_read_tokens: null,
55146
+ cache_write_tokens: null,
55147
+ cost_usd: null,
55148
+ content_text: n2.contentText,
55149
+ cwd: null,
55150
+ provenance: "ambient"
55151
+ }
55152
+ });
55153
+ return entries;
55154
+ }
55155
+ if (GROK_META_TYPES.has(recordType)) {
55156
+ entries.push({
55157
+ targetTable: "history_message",
55158
+ record: {
55159
+ session_id: sessionId,
55160
+ seq,
55161
+ role: "meta",
55162
+ record_type: recordType,
55163
+ disposition: "meta",
55164
+ ts,
55165
+ duration_ms: n2.durationMs ?? null,
55166
+ model: n2.model ?? null,
55167
+ input_tokens: null,
55168
+ output_tokens: null,
55169
+ cache_read_tokens: null,
55170
+ cache_write_tokens: null,
55171
+ cost_usd: null,
55172
+ content_text: n2.contentText,
55173
+ cwd: null,
55174
+ provenance: "ambient"
55175
+ }
55176
+ });
55177
+ return entries;
55178
+ }
55179
+ if (!n2.hasTypeDiscriminator || recordType.length === 0) {
55180
+ entries.push({
55181
+ targetTable: "history_message",
55182
+ record: {
55183
+ session_id: sessionId,
55184
+ seq,
55185
+ role: "unknown",
55186
+ record_type: stableFieldShape(raw),
55187
+ disposition: "unknown",
55188
+ ts,
55189
+ duration_ms: undefined,
55190
+ model: null,
55191
+ input_tokens: null,
55192
+ output_tokens: null,
55193
+ cache_read_tokens: null,
55194
+ cache_write_tokens: null,
55195
+ cost_usd: null,
55196
+ content_text: n2.contentText,
55197
+ cwd: null,
55198
+ provenance: "ambient"
55199
+ }
55200
+ });
55201
+ return entries;
55202
+ }
55203
+ entries.push({
55204
+ targetTable: "history_message",
55205
+ record: {
55206
+ session_id: sessionId,
55207
+ seq,
55208
+ role: "meta",
55209
+ record_type: recordType,
55210
+ disposition: "meta",
55211
+ ts,
55212
+ duration_ms: n2.durationMs ?? null,
55213
+ model: n2.model ?? null,
55214
+ input_tokens: null,
55215
+ output_tokens: null,
55216
+ cache_read_tokens: null,
55217
+ cache_write_tokens: null,
55218
+ cost_usd: null,
55219
+ content_text: n2.contentText,
55220
+ cwd: null,
55221
+ provenance: "ambient"
55222
+ }
55223
+ });
55224
+ return entries;
55225
+ }
55226
+ function o2(value) {
55227
+ return typeof value === "object" && value !== null ? value : {};
55228
+ }
55229
+ function s(...values) {
55230
+ for (const value of values) {
55231
+ if (typeof value === "string" && value.length > 0)
55232
+ return value;
55233
+ if (typeof value === "number" && Number.isFinite(value))
55234
+ return String(value);
55235
+ }
55236
+ return;
55237
+ }
55238
+ function mapRole(type) {
55239
+ const t = String(type ?? "").toLowerCase();
55240
+ if (t === "user" || t === "human")
55241
+ return "user";
55242
+ if (t === "assistant" || t === "ai" || t === "model")
55243
+ return "assistant";
55244
+ if (t === "system" || t === "error")
55245
+ return "system";
55246
+ return t || "unknown";
55247
+ }
55248
+ function computeCost(inputTokens, outputTokens, model) {
55249
+ if (inputTokens === undefined || inputTokens === null)
55250
+ return;
55251
+ if (outputTokens === undefined || outputTokens === null)
55252
+ return;
55253
+ const inputRate = model?.toLowerCase().includes("claude") ? 3 : 1;
55254
+ const outputRate = model?.toLowerCase().includes("claude") ? 15 : 5;
55255
+ return (inputTokens * inputRate + outputTokens * outputRate) / 1e6;
55256
+ }
55257
+ function extractContentText(content) {
55258
+ if (typeof content === "string")
55259
+ return content;
55260
+ if (!Array.isArray(content))
55261
+ return;
55262
+ const parts = [];
55263
+ for (const block of content) {
55264
+ if (typeof block !== "object" || block === null)
55265
+ continue;
55266
+ const b = block;
55267
+ if (b.type === "text" && typeof b.text === "string") {
55268
+ parts.push(b.text);
55269
+ }
55270
+ }
55271
+ return parts.length > 0 ? parts.join(`
55272
+ `) : undefined;
55273
+ }
55274
+ function stableFieldShape(raw) {
55275
+ return Object.keys(raw).map((k) => k.toLowerCase()).sort().join("+");
55276
+ }
55277
+ var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, GROK_META_TYPES, CLAUDE_FIELD_MAP, PI_FIELD_MAP, OMP_FIELD_MAP, CODEX_FIELD_MAP, AGY_FIELD_MAP, GROK_FIELD_MAP, passthroughSchema, CLAUDE_SCHEMA, PI_SCHEMA, OMP_SCHEMA, CODEX_SCHEMA, AGY_SCHEMA, GROK_SCHEMA;
55278
+ var init_mappers = __esm(() => {
55279
+ init_zod();
55280
+ init_hash();
55281
+ MESSAGE_MAPPER_KEYS = [
55282
+ "session_id",
55283
+ "seq",
55284
+ "turn_index",
55285
+ "role",
55286
+ "record_type",
55287
+ "disposition",
55288
+ "ts",
55289
+ "duration_ms",
55290
+ "model",
55291
+ "input_tokens",
55292
+ "output_tokens",
55293
+ "cache_read_tokens",
55294
+ "cache_write_tokens",
55295
+ "cost_usd",
55296
+ "content_text",
55297
+ "cwd",
55298
+ "provenance",
55299
+ "run_id",
55300
+ "task_wbs"
55301
+ ];
55302
+ TOOL_CALL_MAPPER_KEYS = [
55303
+ "_messageSplitIndex",
55304
+ "session_id",
55305
+ "seq",
55306
+ "tool_name",
55307
+ "args_digest",
55308
+ "status",
55309
+ "started_at",
55310
+ "completed_at",
55311
+ "duration_ms",
55312
+ "result_bytes",
55313
+ "error_text"
55314
+ ];
55315
+ GROK_META_TYPES = new Set([
55316
+ "phase_changed",
55317
+ "permission_requested",
55318
+ "permission_resolved",
55319
+ "mcp_server_starting",
55320
+ "mcp_server_connected",
55321
+ "mcp_config_resolved",
55322
+ "mcp_managed_config_result",
55323
+ "mcp_transport_decode_error",
55324
+ "mcp_init_completed",
55325
+ "mcp_health_check",
55326
+ "loop_started",
55327
+ "first_token",
55328
+ "agent_thought_chunk",
55329
+ "hook_execution",
55330
+ "plan",
55331
+ "session_recap",
55332
+ "task_backgrounded",
55333
+ "task_completed",
55334
+ "retry_state",
55335
+ "auto_compact_started",
55336
+ "auto_compact_completed",
55337
+ "compaction_checkpoint",
55338
+ "image_compressed",
55339
+ "reasoning",
55340
+ "system",
55341
+ "turn_started",
55342
+ "turn_ended",
55343
+ "yolo_toggled"
55344
+ ]);
55345
+ CLAUDE_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55346
+ PI_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55347
+ OMP_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55348
+ CODEX_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55349
+ AGY_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55350
+ GROK_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
55351
+ passthroughSchema = exports_external.object({}).passthrough();
55352
+ CLAUDE_SCHEMA = passthroughSchema;
55353
+ PI_SCHEMA = passthroughSchema;
55354
+ OMP_SCHEMA = passthroughSchema;
55355
+ CODEX_SCHEMA = passthroughSchema;
55356
+ AGY_SCHEMA = passthroughSchema;
55357
+ GROK_SCHEMA = passthroughSchema;
55358
+ });
55359
+
55360
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
54364
55361
  function firstString(...values) {
54365
55362
  for (const value of values) {
54366
55363
  if (typeof value === "string" && value.length > 0)
@@ -54424,6 +55421,19 @@ function sourceDefinition(source, displayName, defaultRoots, filePatterns) {
54424
55421
  schema: sourceRecordSchema
54425
55422
  };
54426
55423
  }
55424
+ function customSourceDefinition(source, displayName, defaultRoots, filePatterns, split, fieldMap, schema) {
55425
+ return {
55426
+ source,
55427
+ displayName,
55428
+ defaultRoots,
55429
+ filePatterns,
55430
+ targetTable: `history_etl_${source}`,
55431
+ splitConfig: { mode: "custom", split },
55432
+ fieldMap,
55433
+ fieldTransforms: {},
55434
+ schema
55435
+ };
55436
+ }
54427
55437
  function getSourceDefinition(source) {
54428
55438
  const definition = SOURCE_DEFINITIONS[source];
54429
55439
  if (definition === undefined) {
@@ -54471,13 +55481,14 @@ function resolveSourceDefinition(input) {
54471
55481
  }
54472
55482
  function assertValidTable(table3, source) {
54473
55483
  if (!VALID_TABLE_NAME.test(table3)) {
54474
- throw new HistoryImportError(`Invalid history ETL target table for source "${source}": ${table3}. Must match ${VALID_TABLE_NAME.source}.`, { source, table: table3 });
55484
+ throw new HistoryImportError(`Invalid history target table for source "${source}": ${table3}. Must match ${VALID_TABLE_NAME.source}.`, { source, table: table3 });
54475
55485
  }
54476
55486
  }
54477
55487
  var sourceRecordSchema, VALID_TABLE_NAME, SOURCE_DEFINITIONS;
54478
55488
  var init_sources = __esm(() => {
54479
55489
  init_zod();
54480
55490
  init_errors7();
55491
+ init_mappers();
54481
55492
  sourceRecordSchema = exports_external.object({
54482
55493
  source_record_id: exports_external.string().min(1),
54483
55494
  created_at: exports_external.string().min(1),
@@ -54485,11 +55496,14 @@ var init_sources = __esm(() => {
54485
55496
  role: exports_external.string().optional(),
54486
55497
  model: exports_external.string().optional()
54487
55498
  }).passthrough();
54488
- VALID_TABLE_NAME = /^history_etl_[a-z_]+$/;
55499
+ VALID_TABLE_NAME = /^history_[a-z_]+$/;
54489
55500
  SOURCE_DEFINITIONS = {
54490
- pi: sourceDefinition("pi", "Pi", [".pi/history", ".pi"], ["*.jsonl", "*.json"]),
54491
- claude: sourceDefinition("claude", "Claude Code", [".claude/projects", ".claude"], ["*.jsonl"]),
54492
- codex: sourceDefinition("codex", "Codex", [".codex/sessions", ".codex"], ["*.jsonl"]),
55501
+ pi: customSourceDefinition("pi", "Pi", [".pi/agent/sessions"], ["*.jsonl"], piSplit, PI_FIELD_MAP, PI_SCHEMA),
55502
+ claude: customSourceDefinition("claude", "Claude Code", [".claude/projects"], ["*.jsonl"], claudeSplit, CLAUDE_FIELD_MAP, CLAUDE_SCHEMA),
55503
+ codex: customSourceDefinition("codex", "Codex", [".codex/sessions"], ["*.jsonl"], codexSplit, CODEX_FIELD_MAP, CODEX_SCHEMA),
55504
+ omp: customSourceDefinition("omp", "OMP", [".omp/agent/sessions"], ["*.jsonl"], ompSplit, OMP_FIELD_MAP, OMP_SCHEMA),
55505
+ grok: customSourceDefinition("grok", "Grok", [".grok/sessions"], ["*.jsonl"], grokSplit, GROK_FIELD_MAP, GROK_SCHEMA),
55506
+ agy: customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli/brain"], ["*.jsonl"], agySplit, AGY_FIELD_MAP, AGY_SCHEMA),
54493
55507
  gemini: sourceDefinition("gemini", "Gemini CLI", [".gemini", ".config/gemini"], ["*.jsonl"]),
54494
55508
  opencode: sourceDefinition("opencode", "OpenCode", [".opencode", ".local/share/opencode"], ["*.jsonl"]),
54495
55509
  antigravity: sourceDefinition("antigravity", "Antigravity", [".antigravity"], ["*.jsonl"]),
@@ -54497,7 +55511,7 @@ var init_sources = __esm(() => {
54497
55511
  };
54498
55512
  });
54499
55513
 
54500
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
55514
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
54501
55515
  function targetTableFor(table3) {
54502
55516
  if (!VALID_TABLE_NAME.test(table3)) {
54503
55517
  throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
@@ -54531,6 +55545,8 @@ async function ensureTargetTables(db2, definition) {
54531
55545
  tables.add(targetTableFor(definition.splitConfig.targetTable));
54532
55546
  }
54533
55547
  for (const table3 of tables) {
55548
+ if (TYPED_TABLE_COLUMNS[table3] !== undefined)
55549
+ continue;
54534
55550
  await db2.exec(ETL_TABLE_DDL(table3));
54535
55551
  }
54536
55552
  }
@@ -54556,21 +55572,97 @@ async function ledgerExists(db2, recordHash) {
54556
55572
  }
54557
55573
  async function insertRecord(db2, targetTable, recordHash, sourceFile, sourceLine, splitIndex, payload, now2) {
54558
55574
  const table3 = targetTableFor(targetTable);
54559
- await db2.run(`INSERT INTO ${table3} (record_hash, source_file, source_line, split_index, payload_json, imported_at)
54560
- VALUES (?, ?, ?, ?, ?, ?)
54561
- ON CONFLICT(record_hash) DO NOTHING`, recordHash, sourceFile, sourceLine, splitIndex, JSON.stringify(payload), timestamp(now2));
55575
+ const typedColumns = TYPED_TABLE_COLUMNS[table3];
55576
+ if (typedColumns !== undefined) {
55577
+ const unknownKeys = Object.keys(payload).filter((k) => !typedColumns.includes(k) && !TYPED_IGNORED_KEYS.has(k));
55578
+ if (unknownKeys.length > 0) {
55579
+ throw new HistoryImportError(`Typed table "${table3}" has unknown columns: ${unknownKeys.join(", ")}. ` + `Expected one of: ${typedColumns.join(", ")}.`, { table: table3, unknownKeys, knownColumns: typedColumns });
55580
+ }
55581
+ const ts = timestamp(now2);
55582
+ const values = typedColumns.map((col) => {
55583
+ if (col === "record_hash")
55584
+ return recordHash;
55585
+ if (col === "imported_at")
55586
+ return ts;
55587
+ const v = payload[col];
55588
+ return v === undefined ? null : v;
55589
+ });
55590
+ if (!_ensuredTables.has(table3)) {
55591
+ _ensuredTables.add(table3);
55592
+ }
55593
+ await db2.run(`INSERT INTO ${table3} (${typedColumns.join(", ")})
55594
+ VALUES (${typedColumns.map(() => "?").join(", ")})
55595
+ ON CONFLICT(record_hash) DO NOTHING`, ...values);
55596
+ } else {
55597
+ if (!_ensuredTables.has(table3)) {
55598
+ await db2.exec(ETL_TABLE_DDL(table3));
55599
+ _ensuredTables.add(table3);
55600
+ }
55601
+ await db2.run(`INSERT INTO ${table3} (record_hash, source_file, source_line, split_index, payload_json, imported_at)
55602
+ VALUES (?, ?, ?, ?, ?, ?)
55603
+ ON CONFLICT(record_hash) DO NOTHING`, recordHash, sourceFile, sourceLine, splitIndex, JSON.stringify(payload), timestamp(now2));
55604
+ }
54562
55605
  }
54563
55606
  async function insertLedger(db2, recordHash, source, sourceFile, sourceLine, splitIndex, targetTable, now2) {
54564
55607
  await db2.run(`INSERT INTO history_import_ledger (record_hash, source, source_file, source_line, split_index, target_table, imported_at)
54565
55608
  VALUES (?, ?, ?, ?, ?, ?, ?)`, recordHash, source, sourceFile, sourceLine, splitIndex, targetTable, timestamp(now2));
54566
55609
  }
55610
+ var TYPED_TABLE_COLUMNS, TYPED_IGNORED_KEYS, _ensuredTables;
54567
55611
  var init_jsonl_importer_dao = __esm(() => {
54568
55612
  init_errors7();
54569
55613
  init_schema_sql2();
54570
55614
  init_sources();
55615
+ TYPED_TABLE_COLUMNS = {
55616
+ history_message: [
55617
+ "record_hash",
55618
+ "source",
55619
+ "source_file",
55620
+ "source_line",
55621
+ "session_id",
55622
+ "seq",
55623
+ "turn_index",
55624
+ "role",
55625
+ "record_type",
55626
+ "disposition",
55627
+ "ts",
55628
+ "duration_ms",
55629
+ "model",
55630
+ "input_tokens",
55631
+ "output_tokens",
55632
+ "cache_read_tokens",
55633
+ "cache_write_tokens",
55634
+ "cost_usd",
55635
+ "content_text",
55636
+ "cwd",
55637
+ "provenance",
55638
+ "run_id",
55639
+ "task_wbs",
55640
+ "imported_at"
55641
+ ],
55642
+ history_tool_call: [
55643
+ "record_hash",
55644
+ "message_hash",
55645
+ "source",
55646
+ "source_file",
55647
+ "source_line",
55648
+ "session_id",
55649
+ "seq",
55650
+ "tool_name",
55651
+ "args_digest",
55652
+ "status",
55653
+ "started_at",
55654
+ "completed_at",
55655
+ "duration_ms",
55656
+ "result_bytes",
55657
+ "error_text",
55658
+ "imported_at"
55659
+ ]
55660
+ };
55661
+ TYPED_IGNORED_KEYS = new Set(["_meta", "split_index"]);
55662
+ _ensuredTables = new Set;
54571
55663
  });
54572
55664
 
54573
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
55665
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
54574
55666
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
54575
55667
  if (typeof value === "string") {
54576
55668
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -54607,7 +55699,7 @@ var init_redaction = __esm(() => {
54607
55699
  ];
54608
55700
  });
54609
55701
 
54610
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
55702
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
54611
55703
  async function runJsonlImport(source, options) {
54612
55704
  const definition = resolveSourceDefinition(source);
54613
55705
  const resolvedSource = definition.source;
@@ -54624,6 +55716,7 @@ async function runJsonlImport(source, options) {
54624
55716
  let processedLines = 0;
54625
55717
  let importedRecords = 0;
54626
55718
  let skippedDuplicates = 0;
55719
+ let unknownRecords = 0;
54627
55720
  let checkpointUpdates = 0;
54628
55721
  for (const file2 of files) {
54629
55722
  const checkpoint = mode === "incremental" ? await readCheckpoint(options.db, resolvedSource, file2) : 0;
@@ -54639,6 +55732,7 @@ async function runJsonlImport(source, options) {
54639
55732
  continue;
54640
55733
  const splitRecords = splitRawRecord(definition, raw);
54641
55734
  let lineSucceeded = false;
55735
+ const prepared = [];
54642
55736
  for (let splitIndex = 0;splitIndex < splitRecords.length; splitIndex += 1) {
54643
55737
  const split = splitRecords[splitIndex];
54644
55738
  if (split === undefined)
@@ -54671,8 +55765,24 @@ async function runJsonlImport(source, options) {
54671
55765
  skippedDuplicates += 1;
54672
55766
  continue;
54673
55767
  }
55768
+ prepared.push({ split, splitIndex, normalized: redacted, recordHash });
55769
+ }
55770
+ const recordHashBySplitIndex = new Map(prepared.map((e) => [e.splitIndex, e.recordHash]));
55771
+ for (const entry of prepared) {
55772
+ const { split, splitIndex, normalized, recordHash } = entry;
55773
+ if (normalized.disposition === "unknown") {
55774
+ unknownRecords += 1;
55775
+ }
55776
+ const msgSplitIdx = normalized._messageSplitIndex;
55777
+ delete normalized._messageSplitIndex;
55778
+ if (msgSplitIdx !== undefined && typeof msgSplitIdx === "number") {
55779
+ const msgHash = recordHashBySplitIndex.get(msgSplitIdx);
55780
+ if (msgHash !== undefined) {
55781
+ normalized.message_hash = msgHash;
55782
+ }
55783
+ }
54674
55784
  if (!options.dryRun) {
54675
- await insertRecord(options.db, split.targetTable, recordHash, file2, lineNumber, splitIndex, redacted, options.now);
55785
+ await insertRecord(options.db, split.targetTable, recordHash, file2, lineNumber, splitIndex, normalized, options.now);
54676
55786
  await insertLedger(options.db, recordHash, resolvedSource, file2, lineNumber, splitIndex, split.targetTable, options.now);
54677
55787
  }
54678
55788
  importedRecords += 1;
@@ -54690,6 +55800,7 @@ async function runJsonlImport(source, options) {
54690
55800
  processedLines,
54691
55801
  importedRecords,
54692
55802
  skippedDuplicates,
55803
+ unknownRecords,
54693
55804
  parseErrors,
54694
55805
  validationErrors,
54695
55806
  checkpointUpdates
@@ -54715,10 +55826,14 @@ function splitRawRecord(definition, raw) {
54715
55826
  }
54716
55827
  if (definition.splitConfig.mode === "custom") {
54717
55828
  const config5 = definition.splitConfig;
54718
- return config5.split(raw).map((entry) => ({
54719
- targetTable: targetTableFor(config5.targetTable ?? definition.targetTable),
54720
- raw: entry
54721
- }));
55829
+ const configTable = config5.targetTable !== undefined ? targetTableFor(config5.targetTable) : undefined;
55830
+ return config5.split(raw).map((entry) => {
55831
+ const hasTargetTable = "targetTable" in entry && typeof entry.targetTable === "string";
55832
+ const record2 = hasTargetTable ? entry.record : entry;
55833
+ const entryTable = hasTargetTable ? entry.targetTable : undefined;
55834
+ const table3 = entryTable ?? configTable ?? targetTable;
55835
+ return { targetTable: targetTableFor(table3), raw: record2 };
55836
+ });
54722
55837
  }
54723
55838
  const config4 = definition.splitConfig;
54724
55839
  const nested = raw[config4.field];
@@ -54797,13 +55912,13 @@ var init_importer = __esm(() => {
54797
55912
  init_sources();
54798
55913
  });
54799
55914
 
54800
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.19+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
55915
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
54801
55916
  var init_dist8 = __esm(() => {
54802
55917
  init_importer();
54803
55918
  init_schema_sql2();
54804
55919
  });
54805
55920
 
54806
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
55921
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
54807
55922
  function collectExtensions(sourceName, sourceDir, extensions) {
54808
55923
  if (extensions === undefined)
54809
55924
  return [];
@@ -54819,7 +55934,7 @@ var init_extensions = __esm(() => {
54819
55934
  init_dist5();
54820
55935
  });
54821
55936
 
54822
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
55937
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
54823
55938
  function createFinding(rule, message, filePath, extras = {}) {
54824
55939
  return {
54825
55940
  ruleId: rule.id,
@@ -54890,7 +56005,7 @@ var init_types3 = __esm(() => {
54890
56005
  });
54891
56006
  });
54892
56007
 
54893
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
56008
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
54894
56009
  async function loadPreset(name, options) {
54895
56010
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
54896
56011
  const presetPath = findMergedPreset(merged, name);
@@ -55105,7 +56220,7 @@ var init_loader2 = __esm(() => {
55105
56220
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
55106
56221
  });
55107
56222
 
55108
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
56223
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
55109
56224
  function normalizeFindingPath(filePath) {
55110
56225
  if (!filePath || isAbsolutePath2(filePath))
55111
56226
  return null;
@@ -55170,7 +56285,7 @@ var init_test_stub_fixer = __esm(() => {
55170
56285
  realFileSystem = createNodeFileSystem3();
55171
56286
  });
55172
56287
 
55173
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
56288
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
55174
56289
  function registerBuiltinFixers(host, exec) {
55175
56290
  const regexFixer = new RegexFixerProvider;
55176
56291
  const pathFixer = new PathFixerProvider;
@@ -55373,7 +56488,7 @@ var init_fixers = __esm(() => {
55373
56488
  };
55374
56489
  });
55375
56490
 
55376
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
56491
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
55377
56492
  function getAgentSessionCapability(agent) {
55378
56493
  return AGENT_SESSION_CAPABILITY[agent];
55379
56494
  }
@@ -55665,7 +56780,7 @@ var init_shims = __esm(() => {
55665
56780
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
55666
56781
  });
55667
56782
 
55668
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
56783
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
55669
56784
  function buildIdentityPreamble(ctx) {
55670
56785
  const sections = [
55671
56786
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -55725,7 +56840,7 @@ var init_identity = __esm(() => {
55725
56840
  init_dist5();
55726
56841
  });
55727
56842
 
55728
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
56843
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
55729
56844
  function isClaudeStyleSlashCommand(input) {
55730
56845
  return SLASH_COMMAND_RE.test(input);
55731
56846
  }
@@ -55753,7 +56868,7 @@ var init_slash_command = __esm(() => {
55753
56868
  SLASH_COMMAND_RE = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
55754
56869
  });
55755
56870
 
55756
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
56871
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
55757
56872
  function buildCorrelationEnv(correlation) {
55758
56873
  return {
55759
56874
  [AGENT_RUN_ID_ENV]: correlation.runId,
@@ -55889,7 +57004,7 @@ var init_ai_runner = __esm(() => {
55889
57004
  init_slash_command();
55890
57005
  });
55891
57006
 
55892
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
57007
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
55893
57008
  class AgentDetector {
55894
57009
  runner;
55895
57010
  timeout;
@@ -55965,7 +57080,7 @@ var init_agent_detector = __esm(() => {
55965
57080
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
55966
57081
  });
55967
57082
 
55968
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
57083
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
55969
57084
  function validateAgentId(id) {
55970
57085
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
55971
57086
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -56062,7 +57177,7 @@ var init_agent_spec = __esm(() => {
56062
57177
  };
56063
57178
  });
56064
57179
 
56065
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
57180
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
56066
57181
  function isNonEmpty(value) {
56067
57182
  return value !== undefined && value.trim().length > 0;
56068
57183
  }
@@ -56167,7 +57282,7 @@ var init_auth_shims = __esm(() => {
56167
57282
  };
56168
57283
  });
56169
57284
 
56170
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
57285
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
56171
57286
  class ModelHealthProbeRegistry {
56172
57287
  probes = new Map;
56173
57288
  register(providerPrefix, probe) {
@@ -56275,7 +57390,7 @@ var init_model_health_probe = __esm(() => {
56275
57390
  };
56276
57391
  });
56277
57392
 
56278
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
57393
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
56279
57394
  class DoctorRunner {
56280
57395
  detector;
56281
57396
  runner;
@@ -56412,15 +57527,15 @@ var init_doctor_runner = __esm(() => {
56412
57527
  init_model_health_probe();
56413
57528
  });
56414
57529
 
56415
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
57530
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
56416
57531
  var init_events = () => {};
56417
57532
 
56418
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
57533
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
56419
57534
  function formatMessage(msg) {
56420
57535
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
56421
57536
  }
56422
57537
 
56423
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
57538
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
56424
57539
  import { Buffer as Buffer5 } from "buffer";
56425
57540
 
56426
57541
  class TeamAgentProcess {
@@ -56554,7 +57669,7 @@ var init_team_agent_process = __esm(() => {
56554
57669
  init_dist5();
56555
57670
  });
56556
57671
 
56557
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
57672
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
56558
57673
  class TeamOrchestrator {
56559
57674
  configDir;
56560
57675
  inbox;
@@ -56683,7 +57798,7 @@ var init_team_orchestrator = __esm(() => {
56683
57798
  init_team_agent_process();
56684
57799
  });
56685
57800
 
56686
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.19+15c6896e8ddc6ea7/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
57801
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
56687
57802
  var exports_dist3 = {};
56688
57803
  __export(exports_dist3, {
56689
57804
  validateAgentId: () => validateAgentId,
@@ -56735,7 +57850,7 @@ var init_dist9 = __esm(() => {
56735
57850
  init_team_orchestrator();
56736
57851
  });
56737
57852
 
56738
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
57853
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
56739
57854
  function stringArray(value) {
56740
57855
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
56741
57856
  }
@@ -56773,7 +57888,7 @@ function parseInlineFlags(source) {
56773
57888
  return { flags, rest: source.slice(match[0].length) };
56774
57889
  }
56775
57890
 
56776
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
57891
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
56777
57892
  function matchesAny(path9, patterns) {
56778
57893
  if (patterns === undefined || patterns.length === 0)
56779
57894
  return true;
@@ -56821,7 +57936,7 @@ function escapeRegExp(value) {
56821
57936
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
56822
57937
  }
56823
57938
 
56824
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
57939
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
56825
57940
  async function discoverFiles2(options) {
56826
57941
  const fs3 = options.fs ?? createNodeFileSystem3();
56827
57942
  const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -56849,12 +57964,12 @@ var init_file_discovery = __esm(() => {
56849
57964
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
56850
57965
  });
56851
57966
 
56852
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
57967
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
56853
57968
  var init_file_utils = __esm(() => {
56854
57969
  init_file_discovery();
56855
57970
  });
56856
57971
 
56857
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
57972
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
56858
57973
  class AgentDetectionEvaluator {
56859
57974
  detector;
56860
57975
  constructor(detector = new AgentDetector) {
@@ -56882,7 +57997,7 @@ var init_agent_detection_evaluator = __esm(() => {
56882
57997
  init_file_utils();
56883
57998
  });
56884
57999
 
56885
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
58000
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
56886
58001
  class CoverageGateEvaluator {
56887
58002
  constructor() {}
56888
58003
  async evaluate(rule, context4) {
@@ -56966,7 +58081,7 @@ var init_coverage_gate_evaluator = __esm(() => {
56966
58081
  init_file_utils();
56967
58082
  });
56968
58083
 
56969
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
58084
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
56970
58085
  class ExitCodeEvaluator {
56971
58086
  executor;
56972
58087
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -57002,7 +58117,7 @@ var init_exit_code_evaluator = __esm(() => {
57002
58117
  init_file_utils();
57003
58118
  });
57004
58119
 
57005
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
58120
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
57006
58121
  class ForbiddenImportEvaluator {
57007
58122
  constructor() {}
57008
58123
  async evaluate(rule, context4) {
@@ -57083,7 +58198,7 @@ var init_forbidden_import_evaluator = __esm(() => {
57083
58198
  init_file_utils();
57084
58199
  });
57085
58200
 
57086
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
58201
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
57087
58202
  class ImportBoundaryEvaluator {
57088
58203
  async evaluate(rule, context4) {
57089
58204
  const config4 = rule.evaluator.config ?? {};
@@ -57176,7 +58291,7 @@ var init_import_boundary_evaluator = __esm(() => {
57176
58291
  init_file_utils();
57177
58292
  });
57178
58293
 
57179
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
58294
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
57180
58295
  class PathEvaluator {
57181
58296
  constructor() {}
57182
58297
  async evaluate(rule, context4) {
@@ -57237,7 +58352,7 @@ var init_path_evaluator = __esm(() => {
57237
58352
  init_file_utils();
57238
58353
  });
57239
58354
 
57240
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
58355
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
57241
58356
  class RegexEvaluator {
57242
58357
  constructor() {}
57243
58358
  async evaluate(rule, context4) {
@@ -57315,7 +58430,7 @@ var init_regex_evaluator = __esm(() => {
57315
58430
  init_file_utils();
57316
58431
  });
57317
58432
 
57318
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
58433
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
57319
58434
  class RipgrepEvaluator {
57320
58435
  executor;
57321
58436
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -57408,7 +58523,7 @@ var init_ripgrep_evaluator = __esm(() => {
57408
58523
  init_file_utils();
57409
58524
  });
57410
58525
 
57411
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
58526
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
57412
58527
  class SchemaArtifactEvaluator {
57413
58528
  constructor() {}
57414
58529
  async evaluate(rule, context4) {
@@ -57486,7 +58601,7 @@ var init_schema_artifact_evaluator = __esm(() => {
57486
58601
  init_file_utils();
57487
58602
  });
57488
58603
 
57489
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
58604
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
57490
58605
  class SecretsScannerEvaluator {
57491
58606
  constructor() {}
57492
58607
  async evaluate(rule, context4) {
@@ -57554,7 +58669,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
57554
58669
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
57555
58670
  });
57556
58671
 
57557
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
58672
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
57558
58673
  class SgEvaluator {
57559
58674
  executor;
57560
58675
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -57651,7 +58766,7 @@ var init_sg_evaluator = __esm(() => {
57651
58766
  init_file_utils();
57652
58767
  });
57653
58768
 
57654
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
58769
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
57655
58770
  class TypeScriptTestPathResolver {
57656
58771
  name = "typescript";
57657
58772
  constructor() {}
@@ -57734,7 +58849,7 @@ function testify(rel) {
57734
58849
  return `${dir}test_${base2}`;
57735
58850
  }
57736
58851
 
57737
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
58852
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
57738
58853
  class TestLocationEvaluator {
57739
58854
  resolvers;
57740
58855
  constructor(resolvers) {
@@ -57809,7 +58924,7 @@ var init_test_location_evaluator = __esm(() => {
57809
58924
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
57810
58925
  });
57811
58926
 
57812
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
58927
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
57813
58928
  class TsdocExportEvaluator {
57814
58929
  constructor() {}
57815
58930
  async evaluate(rule, context4) {
@@ -57894,7 +59009,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
57894
59009
  };
57895
59010
  });
57896
59011
 
57897
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
59012
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
57898
59013
  class JsonFormatter {
57899
59014
  constructor() {}
57900
59015
  format(result) {
@@ -57902,7 +59017,7 @@ class JsonFormatter {
57902
59017
  }
57903
59018
  }
57904
59019
 
57905
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
59020
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
57906
59021
  class TextFormatter {
57907
59022
  constructor() {}
57908
59023
  format(result) {
@@ -57916,7 +59031,7 @@ class TextFormatter {
57916
59031
  }
57917
59032
  }
57918
59033
 
57919
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
59034
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
57920
59035
  function registerBuiltins(host, executor) {
57921
59036
  const path9 = new PathEvaluator;
57922
59037
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -57956,7 +59071,7 @@ var init_builtins = __esm(() => {
57956
59071
  init_tsdoc_export_evaluator();
57957
59072
  });
57958
59073
 
57959
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
59074
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
57960
59075
  class RuleEngineHost {
57961
59076
  evaluators;
57962
59077
  formatters;
@@ -57973,7 +59088,7 @@ var init_rule_engine_host = __esm(() => {
57973
59088
  init_extension2();
57974
59089
  });
57975
59090
 
57976
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
59091
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
57977
59092
  class RuleEngine {
57978
59093
  host;
57979
59094
  events;
@@ -58144,7 +59259,7 @@ var init_engine = __esm(() => {
58144
59259
  init_types3();
58145
59260
  });
58146
59261
 
58147
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
59262
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
58148
59263
  async function bundledRulesRoot() {
58149
59264
  if (cachedRoot2 !== undefined)
58150
59265
  return cachedRoot2;
@@ -58195,7 +59310,7 @@ var init_bundled_rules = __esm(() => {
58195
59310
  init_dist5();
58196
59311
  });
58197
59312
 
58198
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
59313
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
58199
59314
  class DbRulePersistenceAdapter {
58200
59315
  db;
58201
59316
  constructor(db2) {
@@ -58229,7 +59344,7 @@ class DbRulePersistenceAdapter {
58229
59344
  }
58230
59345
  }
58231
59346
 
58232
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
59347
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
58233
59348
  var RULE_ENGINE_SCHEMA_SQL = `
58234
59349
  CREATE TABLE IF NOT EXISTS rule_runs (
58235
59350
  id TEXT PRIMARY KEY,
@@ -58275,10 +59390,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
58275
59390
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
58276
59391
  `;
58277
59392
 
58278
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
59393
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
58279
59394
  var init_persistence2 = () => {};
58280
59395
 
58281
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.19+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
59396
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
58282
59397
  var init_dist10 = __esm(() => {
58283
59398
  init_extensions();
58284
59399
  init_loader2();
@@ -58498,7 +59613,7 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
58498
59613
  ];
58499
59614
  });
58500
59615
 
58501
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
59616
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
58502
59617
  function queueLogger() {
58503
59618
  if (!_queueLogger)
58504
59619
  _queueLogger = getLogger2("job-queue");
@@ -58775,7 +59890,7 @@ var init_db_job_queue = __esm(() => {
58775
59890
  init_tracing2();
58776
59891
  });
58777
59892
 
58778
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
59893
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
58779
59894
  var exports_job_queue_db = {};
58780
59895
  __export(exports_job_queue_db, {
58781
59896
  DBQueueConsumer: () => DBQueueConsumer,
@@ -59267,10 +60382,10 @@ var init_schema4 = __esm(() => {
59267
60382
  }
59268
60383
  ];
59269
60384
  CANONICAL_STAGE_BY_KEY = new Map;
59270
- for (const s of REGISTERED_CANONICAL_STAGES) {
59271
- CANONICAL_STAGE_BY_KEY.set(s.id, s);
59272
- for (const a2 of s.aliases ?? []) {
59273
- CANONICAL_STAGE_BY_KEY.set(a2, s);
60385
+ for (const s2 of REGISTERED_CANONICAL_STAGES) {
60386
+ CANONICAL_STAGE_BY_KEY.set(s2.id, s2);
60387
+ for (const a2 of s2.aliases ?? []) {
60388
+ CANONICAL_STAGE_BY_KEY.set(a2, s2);
59274
60389
  }
59275
60390
  }
59276
60391
  });
@@ -59994,12 +61109,12 @@ class MarkdownDocument {
59994
61109
  const seen = new Set;
59995
61110
  const sections = [];
59996
61111
  const duplicateNames = [];
59997
- for (const s of allSections) {
59998
- if (seen.has(s.name)) {
59999
- duplicateNames.push(s.name);
61112
+ for (const s2 of allSections) {
61113
+ if (seen.has(s2.name)) {
61114
+ duplicateNames.push(s2.name);
60000
61115
  } else {
60001
- seen.add(s.name);
60002
- sections.push(s);
61116
+ seen.add(s2.name);
61117
+ sections.push(s2);
60003
61118
  }
60004
61119
  }
60005
61120
  const doc2 = new MarkdownDocument(domain2, frontmatterBlock, frontmatter, preamble, sections);
@@ -60029,7 +61144,7 @@ class MarkdownDocument {
60029
61144
  return result;
60030
61145
  }
60031
61146
  get sectionNames() {
60032
- return this._sections.map((s) => s.name);
61147
+ return this._sections.map((s2) => s2.name);
60033
61148
  }
60034
61149
  get strippedHeadings() {
60035
61150
  return this._strippedHeadings;
@@ -60039,7 +61154,7 @@ class MarkdownDocument {
60039
61154
  }
60040
61155
  get canonicalSections() {
60041
61156
  const base2 = this._domain === "task" ? TASK_CANONICAL_SECTIONS : FEATURE_CANONICAL_SECTIONS;
60042
- const extra = UNIVERSAL_SECTIONS.filter((s) => !base2.includes(s));
61157
+ const extra = UNIVERSAL_SECTIONS.filter((s2) => !base2.includes(s2));
60043
61158
  return [...base2, ...extra];
60044
61159
  }
60045
61160
  validateSectionName(name) {
@@ -60048,7 +61163,7 @@ class MarkdownDocument {
60048
61163
  }
60049
61164
  }
60050
61165
  findSection(name) {
60051
- return this._sections.find((s) => s.name === name);
61166
+ return this._sections.find((s2) => s2.name === name);
60052
61167
  }
60053
61168
  hasSection(name) {
60054
61169
  return this.findSection(name) !== undefined;
@@ -60453,6 +61568,7 @@ var init_schema6 = __esm(() => {
60453
61568
  priority: exports_external.enum(PRIORITIES).optional(),
60454
61569
  tags: exports_external.array(exports_external.string()).optional(),
60455
61570
  dependencies: exports_external.array(exports_external.string()).optional(),
61571
+ ac_numbering: exports_external.literal("task-local").optional(),
60456
61572
  done_forced: exports_external.preprocess((v) => typeof v === "string" ? v === "true" : v, exports_external.boolean().optional()),
60457
61573
  done_reason: exports_external.string().optional(),
60458
61574
  feature_link_declined: exports_external.preprocess((v) => typeof v === "string" ? v === "true" : v, exports_external.boolean().optional()),
@@ -60566,7 +61682,7 @@ var init_task_skeleton = __esm(() => {
60566
61682
  References: "Links to design docs, ADRs, related tasks/features.",
60567
61683
  History: "Auto-appended transition log \u2014 leave empty at creation."
60568
61684
  };
60569
- CANONICAL_INDEX = new Map(TASK_CANONICAL_SECTIONS.map((s, i2) => [s, i2]));
61685
+ CANONICAL_INDEX = new Map(TASK_CANONICAL_SECTIONS.map((s2, i2) => [s2, i2]));
60570
61686
  });
60571
61687
 
60572
61688
  // ../../packages/domain/src/stage-registry/validator.ts
@@ -61342,13 +62458,6 @@ class AgentService {
61342
62458
  ...observer !== undefined ? { observer } : {}
61343
62459
  };
61344
62460
  }
61345
- hasWarnedDeprecation = false;
61346
- warnDeprecationOnce(message) {
61347
- if (!this.hasWarnedDeprecation) {
61348
- this.ctx.output.error(`Warning: ${message}`);
61349
- this.hasWarnedDeprecation = true;
61350
- }
61351
- }
61352
62461
  async resolveAgent(prompt, flags, doctorRunner) {
61353
62462
  const raw = stringFlag(flags, "agent", "auto");
61354
62463
  if (raw === "auto")
@@ -61360,12 +62469,6 @@ class AgentService {
61360
62469
  async resolveAgentAuto(prompt, flags, doctorRunner) {
61361
62470
  const config4 = this.ctx.agentConfig;
61362
62471
  const phase = extractPhase(prompt);
61363
- const phaseMap = config4?.["default-by-phase"];
61364
- const phaseSelector = phase !== undefined ? phaseMap?.[phase] : undefined;
61365
- if (phaseSelector !== undefined && phase !== undefined) {
61366
- this.warnDeprecationOnce(`default-by-phase is deprecated; use stage model_policy instead. Phase '${phase}' mapped to '${phaseSelector}'.`);
61367
- return this.resolveExecutorSelector(phaseSelector, doctorRunner, "phase", phase);
61368
- }
61369
62472
  const stageFlag = stringFlag(flags, "stage", "");
61370
62473
  const targetStageId = stageFlag !== "" ? stageFlag : phase !== undefined ? phase : undefined;
61371
62474
  if (targetStageId !== undefined) {
@@ -62758,8 +63861,10 @@ var init_feature_check = __esm(() => {
62758
63861
  await this.checkChildrenLimit(featureId2, options.featuresDir, findings);
62759
63862
  }
62760
63863
  const dogfoodDir = options?.dogfoodDir ?? (options?.featuresDir ? join9(dirname8(options.featuresDir), "dogfood") : undefined);
62761
- const runDir = options?.runDir ?? (options?.tasksDir ? defaultVerdictRunDir(options.tasksDir) : undefined);
62762
- await this.runL4(doc2, featureId2, status, options?.tasksDir, dogfoodDir, runDir, findings);
63864
+ const primaryTasksDir = options?.tasksDir ?? options?.tasksDirs?.[0];
63865
+ const runDir = options?.runDir ?? (primaryTasksDir ? defaultVerdictRunDir(primaryTasksDir) : undefined);
63866
+ const taskScanDirs = options?.tasksDirs && options.tasksDirs.length > 0 ? options.tasksDirs : options?.tasksDir ? [options.tasksDir] : [];
63867
+ await this.runL4(doc2, featureId2, status, taskScanDirs, dogfoodDir, runDir, findings);
62763
63868
  return { id: featureId2, ...this.summarizeWithStatus(status, findings, strict, options?.severityOverrides) };
62764
63869
  }
62765
63870
  runL3(doc2, findings) {
@@ -62871,49 +63976,49 @@ var init_feature_check = __esm(() => {
62871
63976
  });
62872
63977
  }
62873
63978
  }
62874
- async runL4(doc2, featureId2, status, tasksDir, dogfoodDir, runDir, findings) {
62875
- if (tasksDir === undefined)
63979
+ async runL4(doc2, featureId2, status, tasksDirs, dogfoodDir, runDir, findings) {
63980
+ if (tasksDirs.length === 0)
62876
63981
  return;
62877
63982
  let linkedTasks = 0;
62878
63983
  const incompleteTasks = [];
62879
63984
  const linkedTaskAc = [];
62880
63985
  const linkedTaskSolutions = [];
62881
63986
  const linkedTaskRecords = [];
62882
- try {
62883
- const entries = await this.fs.readDir(tasksDir);
62884
- for (const entry of entries) {
62885
- if (!/^\d{4}_.+\.md$/.test(entry))
62886
- continue;
62887
- try {
62888
- const raw = await this.fs.readFile(`${tasksDir}/${entry}`);
62889
- const taskDoc = MarkdownDocument.parse(raw, "task");
62890
- const tfm = taskDoc.frontmatterData ?? {};
62891
- const tfid = tfm.feature_id ?? tfm["feature-id"];
62892
- if (tfid !== featureId2)
63987
+ for (const tasksDir of tasksDirs) {
63988
+ try {
63989
+ const entries = await this.fs.readDir(tasksDir);
63990
+ for (const entry of entries) {
63991
+ if (!/^\d{4}_.+\.md$/.test(entry))
62893
63992
  continue;
62894
- linkedTasks += 1;
62895
- const tStatus = tfm.status ?? "backlog";
62896
- const wbs = entry.match(/^(\d{4})_/)?.[1] ?? entry;
62897
- if (tStatus !== "done" && tStatus !== "cancelled") {
62898
- incompleteTasks.push(wbs);
63993
+ try {
63994
+ const raw = await this.fs.readFile(`${tasksDir}/${entry}`);
63995
+ const taskDoc = MarkdownDocument.parse(raw, "task");
63996
+ const tfm = taskDoc.frontmatterData ?? {};
63997
+ const tfid = tfm.feature_id ?? tfm["feature-id"];
63998
+ if (tfid !== featureId2)
63999
+ continue;
64000
+ linkedTasks += 1;
64001
+ const tStatus = tfm.status ?? "backlog";
64002
+ const wbs = entry.match(/^(\d{4})_/)?.[1] ?? entry;
64003
+ if (tStatus !== "done" && tStatus !== "cancelled") {
64004
+ incompleteTasks.push(wbs);
64005
+ }
64006
+ const tac = stripAcFence(taskDoc.getSection("Acceptance Criteria") ?? "");
64007
+ if (tac.trim().length > 0)
64008
+ linkedTaskAc.push(tac);
64009
+ linkedTaskSolutions.push(taskDoc.getSection("Solution") ?? "");
64010
+ linkedTaskRecords.push({ wbs, status: tStatus, ac: tac });
64011
+ } catch {
64012
+ findings.push({
64013
+ layer: "L4",
64014
+ code: FINDING_CODES.L4_LINKED_TASK_PARSE_FAILED,
64015
+ severity: "warning",
64016
+ section: "",
64017
+ message: `Linked task file "${entry}" failed to parse \u2014 dangling feature_id edge`
64018
+ });
62899
64019
  }
62900
- const tac = stripAcFence(taskDoc.getSection("Acceptance Criteria") ?? "");
62901
- if (tac.trim().length > 0)
62902
- linkedTaskAc.push(tac);
62903
- linkedTaskSolutions.push(taskDoc.getSection("Solution") ?? "");
62904
- linkedTaskRecords.push({ wbs, status: tStatus, ac: tac });
62905
- } catch {
62906
- findings.push({
62907
- layer: "L4",
62908
- code: FINDING_CODES.L4_LINKED_TASK_PARSE_FAILED,
62909
- severity: "warning",
62910
- section: "",
62911
- message: `Linked task file "${entry}" failed to parse \u2014 dangling feature_id edge`
62912
- });
62913
64020
  }
62914
- }
62915
- } catch {
62916
- return;
64021
+ } catch {}
62917
64022
  }
62918
64023
  const acBody = stripAcFence(doc2.getSection("Acceptance Criteria") ?? "");
62919
64024
  const hasScenarios = /^\s*Scenario:/m.test(acBody);
@@ -62931,7 +64036,7 @@ var init_feature_check = __esm(() => {
62931
64036
  if (stillOrphan.size === 0)
62932
64037
  break;
62933
64038
  const orphanedByThisTask = new Set(checkAcCoverage(acBody, taskAc, parseChecklist(taskAc)).orphans);
62934
- stillOrphan = new Set([...stillOrphan].filter((o2) => orphanedByThisTask.has(o2)));
64039
+ stillOrphan = new Set([...stillOrphan].filter((o3) => orphanedByThisTask.has(o3)));
62935
64040
  }
62936
64041
  for (const orphan of stillOrphan) {
62937
64042
  findings.push({
@@ -62987,9 +64092,9 @@ var init_feature_check = __esm(() => {
62987
64092
  return;
62988
64093
  if (parsed.scenarios.length === 0)
62989
64094
  return;
62990
- const scenarioAliases = parsed.scenarios.map((s, i2) => ({
62991
- title: s.name,
62992
- normalized: normalizeTitle(s.name),
64095
+ const scenarioAliases = parsed.scenarios.map((s2, i2) => ({
64096
+ title: s2.name,
64097
+ normalized: normalizeTitle(s2.name),
62993
64098
  alias: `AC-${i2 + 1}`
62994
64099
  }));
62995
64100
  const covers = {};
@@ -63018,7 +64123,9 @@ var init_feature_check = __esm(() => {
63018
64123
  artifacts2.set(wbs, artifact);
63019
64124
  const diagnosticParts = [];
63020
64125
  if (artifact.diagnostics.artifactError !== undefined) {
63021
- diagnosticParts.push(artifact.diagnostics.artifactError);
64126
+ if (artifact.diagnostics.artifactError !== "artifact is missing") {
64127
+ diagnosticParts.push(artifact.diagnostics.artifactError);
64128
+ }
63022
64129
  }
63023
64130
  if (artifact.diagnostics.rejectedRowCount > 0) {
63024
64131
  diagnosticParts.push(`${artifact.diagnostics.rejectedRowCount} rejected coverage row(s)`);
@@ -63381,9 +64488,13 @@ class FeatureService {
63381
64488
  }
63382
64489
  const checkL4Gate = async () => {
63383
64490
  const checkSvc = new FeatureCheckService(this.ctx.fs);
64491
+ const tasksDirs = this.ctx.foldersConfig ? Object.keys(this.ctx.foldersConfig.folders).map((p) => this.ctx.fs.resolve(p)) : [this.ctx.tasksDir];
64492
+ if (!tasksDirs.includes(this.ctx.tasksDir))
64493
+ tasksDirs.unshift(this.ctx.tasksDir);
63384
64494
  const res = await checkSvc.check(feature.filePath, featureId2, {
63385
64495
  featuresDir: this.ctx.featuresDir,
63386
64496
  tasksDir: this.ctx.tasksDir,
64497
+ tasksDirs,
63387
64498
  runDir: defaultVerdictRunDir(this.ctx.tasksDir)
63388
64499
  });
63389
64500
  const l4Errors = res.findings.filter((f) => f.layer === "L4" && f.severity === "error");
@@ -63929,7 +65040,18 @@ var SOURCES, MODES;
63929
65040
  var init_history_service = __esm(() => {
63930
65041
  init_src2();
63931
65042
  init_dist8();
63932
- SOURCES = ["pi", "claude", "codex", "gemini", "opencode", "antigravity", "openclaw"];
65043
+ SOURCES = [
65044
+ "pi",
65045
+ "claude",
65046
+ "codex",
65047
+ "gemini",
65048
+ "opencode",
65049
+ "antigravity",
65050
+ "openclaw",
65051
+ "omp",
65052
+ "grok",
65053
+ "agy"
65054
+ ];
63933
65055
  MODES = ["full", "incremental", "force-file"];
63934
65056
  });
63935
65057
 
@@ -64299,8 +65421,8 @@ function parseEtimeToSeconds(etime) {
64299
65421
  const d = Number(dayMatch[1]);
64300
65422
  const h2 = Number(dayMatch[2]);
64301
65423
  const m = Number(dayMatch[3]);
64302
- const s = Number(dayMatch[4]);
64303
- return d * 86400 + h2 * 3600 + m * 60 + s;
65424
+ const s2 = Number(dayMatch[4]);
65425
+ return d * 86400 + h2 * 3600 + m * 60 + s2;
64304
65426
  }
64305
65427
  const parts = t.split(":").map((p) => Number(p));
64306
65428
  if (parts.some((n2) => !Number.isFinite(n2)))
@@ -64308,12 +65430,12 @@ function parseEtimeToSeconds(etime) {
64308
65430
  if (parts.length === 1)
64309
65431
  return parts[0] ?? null;
64310
65432
  if (parts.length === 2) {
64311
- const [m, s] = parts;
64312
- return (m ?? 0) * 60 + (s ?? 0);
65433
+ const [m, s2] = parts;
65434
+ return (m ?? 0) * 60 + (s2 ?? 0);
64313
65435
  }
64314
65436
  if (parts.length === 3) {
64315
- const [h2, m, s] = parts;
64316
- return (h2 ?? 0) * 3600 + (m ?? 0) * 60 + (s ?? 0);
65437
+ const [h2, m, s2] = parts;
65438
+ return (h2 ?? 0) * 3600 + (m ?? 0) * 60 + (s2 ?? 0);
64317
65439
  }
64318
65440
  return null;
64319
65441
  }
@@ -65133,7 +66255,7 @@ ${ruleIds.join(`
65133
66255
  const counts = { error: 0, warning: 0, info: 0 };
65134
66256
  for (const f of findings)
65135
66257
  counts[f.severity] += 1;
65136
- const parts = ["error", "warning", "info"].filter((s) => counts[s] > 0).map((s) => `${counts[s]} ${s}${counts[s] === 1 ? "" : "s"}`);
66258
+ const parts = ["error", "warning", "info"].filter((s2) => counts[s2] > 0).map((s2) => `${counts[s2]} ${s2}${counts[s2] === 1 ? "" : "s"}`);
65137
66259
  const tint = counts.error > 0 ? color.red : counts.warning > 0 ? color.yellow : color.cyan;
65138
66260
  return tint(`\u2717 ${parts.join(", ")}`);
65139
66261
  }
@@ -65169,7 +66291,7 @@ ${ruleIds.join(`
65169
66291
  const counts = { error: 0, warning: 0, info: 0 };
65170
66292
  for (const f of violations)
65171
66293
  counts[f.severity] += 1;
65172
- const parts = ["error", "warning", "info"].filter((s) => counts[s] > 0).map((s) => `${counts[s]} ${s}${counts[s] === 1 ? "" : "s"}`);
66294
+ const parts = ["error", "warning", "info"].filter((s2) => counts[s2] > 0).map((s2) => `${counts[s2]} ${s2}${counts[s2] === 1 ? "" : "s"}`);
65173
66295
  if (errored > 0)
65174
66296
  parts.push(`${errored} misconfigured ${errored === 1 ? "rule" : "rules"}`);
65175
66297
  return `${parts.join(", ")} across ${ruleCount} ${rulesNoun}.`;
@@ -65664,7 +66786,7 @@ class SupervisorService {
65664
66786
  return existing.entry;
65665
66787
  }
65666
66788
  const specs = await this.loadSpecs();
65667
- const spec = specs.find((s) => s.id === agentId);
66789
+ const spec = specs.find((s2) => s2.id === agentId);
65668
66790
  if (!spec) {
65669
66791
  throw new Error(`No agent spec found for "${agentId}"`);
65670
66792
  }
@@ -65791,7 +66913,7 @@ class SupervisorService {
65791
66913
  async startAutostart(ids) {
65792
66914
  const results = [];
65793
66915
  const specs = await this.loadSpecs();
65794
- const specIds = new Set(specs.map((s) => s.id));
66916
+ const specIds = new Set(specs.map((s2) => s2.id));
65795
66917
  for (const id of ids) {
65796
66918
  if (!specIds.has(id)) {
65797
66919
  throw new Error(`Autostart agent "${id}" not found \u2014 check .spur/agents/ and team.autostart config`);
@@ -66217,7 +67339,7 @@ var init_task_check = __esm(() => {
66217
67339
  for (const block of blocks) {
66218
67340
  const firstLine = block.trimStart().split(`
66219
67341
  `)[0] ?? "";
66220
- if (/^\s*[-*]?\s*(?:\[[ xX]\]\s*)?R\d+\.?\s/.test(firstLine)) {
67342
+ if (/^\s*[-*]?\s*(?:\[[ xX]\]\s*)?[*_]{0,2}R\d+\.?[*_]{0,2}\s/.test(firstLine)) {
66221
67343
  numbered++;
66222
67344
  }
66223
67345
  }
@@ -66231,6 +67353,59 @@ var init_task_check = __esm(() => {
66231
67353
  });
66232
67354
  }
66233
67355
  }
67356
+ const acBodyForCoverage = doc2.getSection("Acceptance Criteria");
67357
+ if (doc2.frontmatterData?.ac_numbering === "task-local" && reqBody !== null && !isPlaceholderBody(reqBody) && acBodyForCoverage !== null && !isPlaceholderBody(stripAcFence(acBodyForCoverage))) {
67358
+ const reqIds = new Set;
67359
+ for (const line of reqBody.split(`
67360
+ `)) {
67361
+ const m = /^\s*[-*]?\s*(?:\[[ xX]\]\s*)?R(\d+)\.?\s/.exec(line);
67362
+ if (m?.[1] !== undefined)
67363
+ reqIds.add(m[1]);
67364
+ }
67365
+ const acIds = new Set;
67366
+ let scenarioCount = 0;
67367
+ for (const line of stripAcFence(acBodyForCoverage).split(`
67368
+ `)) {
67369
+ const s2 = /^\s*Scenario(?:\s+Outline)?:\s*(.*)$/.exec(line);
67370
+ if (s2 === null)
67371
+ continue;
67372
+ scenarioCount++;
67373
+ const id = /^R(\d+)\b/.exec((s2[1] ?? "").trim());
67374
+ if (id?.[1] !== undefined)
67375
+ acIds.add(id[1]);
67376
+ }
67377
+ const byNumber = (a2, b) => Number(a2) - Number(b);
67378
+ if (reqIds.size > 0 && scenarioCount > 0 && acIds.size === 0) {
67379
+ findings.push({
67380
+ layer: "L3",
67381
+ code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
67382
+ severity: "warning",
67383
+ section: "Acceptance Criteria",
67384
+ message: "ac_numbering is task-local but no scenario is R-numbered \u2014 prefix each scenario with the requirement it covers (Scenario: R1 \u2014 \u2026)"
67385
+ });
67386
+ } else if (reqIds.size > 0 && acIds.size > 0) {
67387
+ const uncovered = [...reqIds].filter((id) => !acIds.has(id)).sort(byNumber);
67388
+ const stale = [...acIds].filter((id) => !reqIds.has(id)).sort(byNumber);
67389
+ if (uncovered.length > 0) {
67390
+ findings.push({
67391
+ layer: "L3",
67392
+ code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
67393
+ severity: "warning",
67394
+ section: "Acceptance Criteria",
67395
+ message: `Requirements with no Acceptance Criteria scenario: ${uncovered.map((id) => `R${id}`).join(", ")} \u2014 add a scenario or drop the requirement`
67396
+ });
67397
+ }
67398
+ if (stale.length > 0) {
67399
+ findings.push({
67400
+ layer: "L3",
67401
+ code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
67402
+ severity: "warning",
67403
+ section: "Acceptance Criteria",
67404
+ message: `Acceptance Criteria scenarios cite requirements that do not exist: ${stale.map((id) => `R${id}`).join(", ")} \u2014 the AC is stale relative to Requirements`
67405
+ });
67406
+ }
67407
+ }
67408
+ }
66234
67409
  const solBody = doc2.getSection("Solution");
66235
67410
  if (solBody !== null && !isPlaceholderBody(solBody)) {
66236
67411
  const hasFileLine = /`[^`]+?:\d+(-\d+)?`/.test(solBody) || /[^\s`]\.\w+:\d+/.test(solBody);
@@ -66349,12 +67524,13 @@ var init_task_check = __esm(() => {
66349
67524
  const featureTerminal = featureStatus === "done" || featureStatus === "cancelled";
66350
67525
  const taskTerminal = status === "done" || status === "cancelled";
66351
67526
  if (featureTerminal && !taskTerminal) {
67527
+ const reopenGuide = featureStatus === "done" ? `Reopen: \`spur feature update ${featureId2} active\` (or \`spur feature sync ${featureId2} --force\` when non-terminal tasks are already linked). Alternatively re-parent: \`spur task update <wbs> --feature <otherId>\`.` : `Feature is cancelled \u2014 re-parent or unlink this live task (\`spur task update <wbs> --feature <otherId>\`).`;
66352
67528
  findings.push({
66353
67529
  layer: "L4",
66354
67530
  code: FINDING_CODES.L4_FEATURE_TERMINAL,
66355
67531
  severity: "error",
66356
67532
  section: "",
66357
- message: `Feature "${featureId2}" is ${featureStatus} \u2014 remove or re-parent this task`
67533
+ message: `Feature "${featureId2}" is ${featureStatus} \u2014 live tasks cannot stay linked without action. ${reopenGuide}`
66358
67534
  });
66359
67535
  }
66360
67536
  await this.checkAcCoverage(doc2, featurePath, featureId2, findings);
@@ -66405,7 +67581,7 @@ var init_task_check = __esm(() => {
66405
67581
  const kids = await this.findChildren(tasksDir, wbs);
66406
67582
  if (kids.length === 0)
66407
67583
  return;
66408
- const closed = (s) => s === "done" || s === "cancelled";
67584
+ const closed = (s2) => s2 === "done" || s2 === "cancelled";
66409
67585
  const parentClosed = closed(status);
66410
67586
  const openKids = kids.filter((c3) => !closed(c3.status));
66411
67587
  if (parentClosed && openKids.length > 0) {
@@ -66695,8 +67871,8 @@ var init_task_check = __esm(() => {
66695
67871
  });
66696
67872
 
66697
67873
  // ../../packages/app/src/services/task-record.ts
66698
- function escapeTablePipe(s) {
66699
- return s.replace(/\|/g, "\\|");
67874
+ function escapeTablePipe(s2) {
67875
+ return s2.replace(/\|/g, "\\|");
66700
67876
  }
66701
67877
  function parseVerdict(raw, fallbackWbs) {
66702
67878
  if (raw.trim() === "") {
@@ -66995,8 +68171,8 @@ function patchFrontmatterField(rendered, key, value) {
66995
68171
  return `${before}${key}: ${value}
66996
68172
  ${fm}${after}`;
66997
68173
  }
66998
- function escapeRegex2(s) {
66999
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
68174
+ function escapeRegex2(s2) {
68175
+ return s2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
67000
68176
  }
67001
68177
  function renderCreatedTaskContent(params) {
67002
68178
  let content = renderTaskTemplate(params.rawTemplate, {
@@ -67220,7 +68396,8 @@ class TaskService {
67220
68396
  parent_wbs: true,
67221
68397
  priority: true,
67222
68398
  done_forced: true,
67223
- done_reason: true
68399
+ done_reason: true,
68400
+ ac_numbering: true
67224
68401
  };
67225
68402
  if (!(key in allowed)) {
67226
68403
  throw new Error(`Field "${key}" is not settable via update; allowed: ${Object.keys(allowed).join(", ")}.`);
@@ -67307,7 +68484,7 @@ class TaskService {
67307
68484
  added: [],
67308
68485
  matrix: { required: [...required2], optional: [...optional2], forbidden: [...forbidden] },
67309
68486
  present,
67310
- missing: required2.filter((s) => !present.includes(s)),
68487
+ missing: required2.filter((s2) => !present.includes(s2)),
67311
68488
  warnings: []
67312
68489
  };
67313
68490
  }
@@ -67341,7 +68518,7 @@ class TaskService {
67341
68518
  warnings: result.warnings ?? []
67342
68519
  };
67343
68520
  }
67344
- const missing = required2.filter((s) => !present.includes(s));
68521
+ const missing = required2.filter((s2) => !present.includes(s2));
67345
68522
  if (missing.length === 0) {
67346
68523
  return {
67347
68524
  op: "init",
@@ -67354,15 +68531,15 @@ class TaskService {
67354
68531
  }
67355
68532
  const written = [];
67356
68533
  let last;
67357
- for (const s of missing) {
67358
- const body = renderSectionGuidanceBody(s);
68534
+ for (const s2 of missing) {
68535
+ const body = renderSectionGuidanceBody(s2);
67359
68536
  try {
67360
- last = await this.writeService.updateSection(ref, s, body);
68537
+ last = await this.writeService.updateSection(ref, s2, body);
67361
68538
  } catch (err) {
67362
68539
  const landed = written.length > 0 ? written.join(", ") : "(none)";
67363
- throw new Error(`init failed while writing section "${s}"; sections already written: ${landed}. ` + `Re-run init to complete the rest (it is idempotent). Cause: ${String(err)}`);
68540
+ throw new Error(`init failed while writing section "${s2}"; sections already written: ${landed}. ` + `Re-run init to complete the rest (it is idempotent). Cause: ${String(err)}`);
67364
68541
  }
67365
- written.push(s);
68542
+ written.push(s2);
67366
68543
  }
67367
68544
  return {
67368
68545
  op: "init",
@@ -67937,31 +69114,45 @@ function extractRequirements(text4) {
67937
69114
  const lines = text4.split(`
67938
69115
  `);
67939
69116
  let inTable = false;
69117
+ let colMap = null;
67940
69118
  for (const line of lines) {
67941
69119
  const trimmed = line.trim();
67942
69120
  if (!trimmed.startsWith("|"))
67943
69121
  continue;
67944
69122
  const cells = trimmed.split("|").map((c3) => c3.trim()).filter(Boolean);
67945
69123
  if (!inTable && cells.length >= 2) {
67946
- const h0 = (cells[0] ?? "").toLowerCase();
67947
- const h1 = (cells[1] ?? "").toLowerCase();
67948
- if ((h0.includes("req") || h0 === "requirement") && (h1.includes("status") || h1 === "verdict")) {
67949
- inTable = true;
67950
- continue;
69124
+ const h0 = (cells[0] ?? "").toLowerCase().trim();
69125
+ const h0IsId = h0.includes("req") || h0 === "requirement" || h0 === "r#" || h0 === "r" || /^r\d+$/.test(h0);
69126
+ if (h0IsId) {
69127
+ const statusIdx = cells.findIndex((c3) => {
69128
+ const x = c3.toLowerCase().trim();
69129
+ return x.includes("status") || x === "verdict";
69130
+ });
69131
+ if (statusIdx >= 0) {
69132
+ const evidenceIdx = cells.findIndex((c3) => c3.toLowerCase().includes("evidence"));
69133
+ colMap = {
69134
+ id: 0,
69135
+ status: statusIdx,
69136
+ evidence: evidenceIdx >= 0 ? evidenceIdx : undefined
69137
+ };
69138
+ inTable = true;
69139
+ continue;
69140
+ }
67951
69141
  }
67952
69142
  }
67953
69143
  if (/^[-:]+$/.test(cells[0] ?? ""))
67954
69144
  continue;
67955
- if (inTable && cells.length >= 2) {
69145
+ if (inTable && colMap && cells.length >= 2) {
67956
69146
  const first = (cells[0] ?? "").toLowerCase();
67957
69147
  const second = (cells[1] ?? "").toLowerCase();
67958
69148
  if ((first === "ac" || first.includes("acceptance") || first === "check" || first === "name") && (second.includes("status") || second === "verdict")) {
67959
69149
  inTable = false;
69150
+ colMap = null;
67960
69151
  continue;
67961
69152
  }
67962
- const id = cells[0] ?? "";
67963
- const statusRaw = (cells[1] ?? "").toUpperCase();
67964
- const evidence = cells.length >= 3 ? cells[2] ?? "" : "";
69153
+ const id = cells[colMap.id] ?? "";
69154
+ const statusRaw = (cells[colMap.status] ?? "").toUpperCase();
69155
+ const evidence = colMap.evidence !== undefined ? cells[colMap.evidence] ?? "" : "";
67965
69156
  const status = normalizeStatus(statusRaw);
67966
69157
  if (status !== null && id.length > 0) {
67967
69158
  reqs.push({ id, status, evidence });
@@ -68411,7 +69602,7 @@ class TeamService {
68411
69602
  }
68412
69603
  const agentConfig = config4?.agent;
68413
69604
  const specs = await loadAgentSpecs(this.configDir);
68414
- const existingTeamSpecs = specs.filter((s) => s.tags?.includes(`team:${teamId}`) && s.tags?.includes("spur:generated"));
69605
+ const existingTeamSpecs = specs.filter((s2) => s2.tags?.includes(`team:${teamId}`) && s2.tags?.includes("spur:generated"));
68415
69606
  const desiredMembers = teamConfig.members.map((m) => normalizeMember(m));
68416
69607
  const desiredIds = new Set;
68417
69608
  const toUpsert = [];
@@ -68419,7 +69610,7 @@ class TeamService {
68419
69610
  const localId = member.id ?? member.executor;
68420
69611
  const composedId = `${teamId}-${localId}`;
68421
69612
  desiredIds.add(composedId);
68422
- const existing = specs.find((s) => s.id === composedId);
69613
+ const existing = specs.find((s2) => s2.id === composedId);
68423
69614
  if (existing && !existing.tags?.includes("spur:generated"))
68424
69615
  continue;
68425
69616
  const resolved = resolveExecutor(member.executor, agentConfig);
@@ -68440,12 +69631,12 @@ class TeamService {
68440
69631
  };
68441
69632
  toUpsert.push(spec);
68442
69633
  }
68443
- const orphaned = existingTeamSpecs.filter((s) => !desiredIds.has(s.id));
69634
+ const orphaned = existingTeamSpecs.filter((s2) => !desiredIds.has(s2.id));
68444
69635
  if (opts?.check) {
68445
69636
  return {
68446
69637
  teamId,
68447
- upserted: toUpsert.map((s) => s.id),
68448
- orphaned: orphaned.map((s) => s.id),
69638
+ upserted: toUpsert.map((s2) => s2.id),
69639
+ orphaned: orphaned.map((s2) => s2.id),
68449
69640
  written: false
68450
69641
  };
68451
69642
  }
@@ -68457,8 +69648,8 @@ class TeamService {
68457
69648
  }
68458
69649
  const result = {
68459
69650
  teamId,
68460
- upserted: toUpsert.map((s) => s.id),
68461
- orphaned: orphaned.map((s) => s.id),
69651
+ upserted: toUpsert.map((s2) => s2.id),
69652
+ orphaned: orphaned.map((s2) => s2.id),
68462
69653
  written: true
68463
69654
  };
68464
69655
  this.emitTeamLifecycleEvent("team.up", {
@@ -68470,8 +69661,8 @@ class TeamService {
68470
69661
  }
68471
69662
  async teardownTeam(teamId, opts) {
68472
69663
  const specs = await loadAgentSpecs(this.configDir);
68473
- const teamSpecs = specs.filter((s) => s.tags?.includes(`team:${teamId}`));
68474
- const generated = teamSpecs.filter((s) => s.tags?.includes("spur:generated"));
69664
+ const teamSpecs = specs.filter((s2) => s2.tags?.includes(`team:${teamId}`));
69665
+ const generated = teamSpecs.filter((s2) => s2.tags?.includes("spur:generated"));
68475
69666
  if (opts?.purge) {
68476
69667
  for (const spec of generated) {
68477
69668
  await deleteAgentSpec(spec.id, this.configDir);
@@ -68479,8 +69670,8 @@ class TeamService {
68479
69670
  }
68480
69671
  const result = {
68481
69672
  teamId,
68482
- purged: opts?.purge ? generated.map((s) => s.id) : [],
68483
- stopped: teamSpecs.map((s) => s.id)
69673
+ purged: opts?.purge ? generated.map((s2) => s2.id) : [],
69674
+ stopped: teamSpecs.map((s2) => s2.id)
68484
69675
  };
68485
69676
  this.emitTeamLifecycleEvent("team.down", {
68486
69677
  teamId,
@@ -68527,7 +69718,7 @@ class TeamService {
68527
69718
  async resolveMemberIdentity(agentId) {
68528
69719
  try {
68529
69720
  const specs = await loadAgentSpecs(this.configDir);
68530
- const spec = specs.find((s) => s.id === agentId);
69721
+ const spec = specs.find((s2) => s2.id === agentId);
68531
69722
  if (!spec)
68532
69723
  return { teamId: null, agentType: null };
68533
69724
  const teamTag = spec.tags?.find((t) => t.startsWith("team:"));
@@ -68593,7 +69784,7 @@ function resolveAutostartSet(config4, envAutostart) {
68593
69784
  }
68594
69785
  }
68595
69786
  if (envAutostart) {
68596
- for (const id of envAutostart.split(",").map((s) => s.trim()).filter(Boolean)) {
69787
+ for (const id of envAutostart.split(",").map((s2) => s2.trim()).filter(Boolean)) {
68597
69788
  ids.add(id);
68598
69789
  }
68599
69790
  }
@@ -69126,42 +70317,45 @@ import { dirname as dirname12, isAbsolute as isAbsolute2, join as join15 } from
69126
70317
  class AgentRunActionRunner {
69127
70318
  observabilityBus;
69128
70319
  steeringController;
70320
+ agentConfig;
69129
70321
  kind = KIND;
69130
70322
  agentService;
69131
- constructor(agentService, observabilityBus, steeringController) {
70323
+ constructor(agentService, observabilityBus, steeringController, agentConfig = {}) {
69132
70324
  this.observabilityBus = observabilityBus;
69133
70325
  this.steeringController = steeringController;
70326
+ this.agentConfig = agentConfig;
69134
70327
  this.agentService = agentService;
69135
70328
  }
69136
70329
  async execute(options, context4) {
69137
70330
  const input = asOptionalString(options.input);
69138
70331
  const agent = asOptionalString(options.agent);
69139
- const cfg = context4.config;
69140
- const dispatchAgent = agent === "inline" ? cfg?.agent?.default ?? undefined : agent;
70332
+ const dispatchAgent = agent === "inline" ? this.agentConfig.default ?? undefined : agent;
69141
70333
  const model = asOptionalString(options.model);
69142
70334
  const mode = asOptionalString(options.mode) ?? "text";
69143
70335
  const cwd = asOptionalString(options.cwd) ?? context4.workdir ?? ".";
69144
70336
  const sessionAffinityVar = context4.vars.sessionAffinity;
69145
- const affinityDisabled = sessionAffinityVar === "false" || typeof sessionAffinityVar === "boolean" && !sessionAffinityVar || options.sessionAffinity === false || cfg?.agent?.sessionAffinity === false;
70337
+ const affinityDisabled = sessionAffinityVar === "false" || typeof sessionAffinityVar === "boolean" && !sessionAffinityVar || options.sessionAffinity === false || this.agentConfig.sessionAffinity === false;
69146
70338
  const affinityOn = !affinityDisabled;
69147
70339
  const agentLabel = dispatchAgent ?? "<default>";
69148
- const targetAgentDir = dispatchAgent ?? cfg?.agent?.default ?? "omp";
70340
+ const targetAgentDir = dispatchAgent ?? this.agentConfig.default ?? "omp";
69149
70341
  const prevAgent = asOptionalString(context4.vars.__agentSessionAgent);
69150
70342
  let sessionDir = asOptionalString(context4.vars.__agentSessionDir);
69151
70343
  if (affinityOn) {
69152
70344
  if (!sessionDir || prevAgent && prevAgent !== targetAgentDir) {
69153
70345
  sessionDir = join15(cwd, ".spur", "run", context4.runId, "agent-sessions", targetAgentDir);
69154
70346
  }
70347
+ } else {
70348
+ if (!sessionDir) {
70349
+ sessionDir = join15(cwd, ".spur", "run", context4.runId, "agent-sessions", targetAgentDir);
70350
+ }
69155
70351
  }
69156
70352
  const storedSessionId = asOptionalString(context4.vars.__agentSessionId);
69157
70353
  let continueFlag = asOptionalBoolean(options.continue);
69158
70354
  const latch = context4.vars.__agentSession;
69159
70355
  const latchAutoContinued = continueFlag === undefined && latch === "open";
69160
70356
  if (latchAutoContinued) {
69161
- if (affinityOn) {
70357
+ if (!affinityOn) {
69162
70358
  continueFlag = true;
69163
- } else {
69164
- continueFlag = undefined;
69165
70359
  }
69166
70360
  }
69167
70361
  if (input === undefined && !continueFlag) {
@@ -69178,9 +70372,9 @@ class AgentRunActionRunner {
69178
70372
  flags.mode = mode;
69179
70373
  if (cwd !== "")
69180
70374
  flags.cwd = cwd;
69181
- if (affinityOn && sessionDir) {
70375
+ if (sessionDir) {
69182
70376
  flags.sessionDir = sessionDir;
69183
- if (storedSessionId) {
70377
+ if (affinityOn && storedSessionId) {
69184
70378
  flags.sessionId = storedSessionId;
69185
70379
  }
69186
70380
  }
@@ -69219,6 +70413,7 @@ class AgentRunActionRunner {
69219
70413
  actionId
69220
70414
  },
69221
70415
  ...observer !== undefined ? { observer } : {},
70416
+ heartbeatMs: AGENT_RUN_PROGRESS_INTERVAL_MS,
69222
70417
  ...steeringSignal !== undefined ? { signal: steeringSignal } : {}
69223
70418
  });
69224
70419
  if (this.steeringController === undefined)
@@ -69269,11 +70464,11 @@ class AgentRunActionRunner {
69269
70464
  }
69270
70465
  }
69271
70466
  const stepLabel = context4.stateOrNodeId;
69272
- if (ok && requireDiff === true && !await gitHasNonCorpusChanges(cwd)) {
70467
+ if (ok && requireDiff === true && !await gitHasNonCorpusChanges(cwd, this.agentConfig.excludeGlobs)) {
69273
70468
  return {
69274
70469
  ok: false,
69275
70470
  data: buildResultData(exitCode, agentLabel, capture, answer, invocation),
69276
- error: `agent.run '${stepLabel}' (${agentLabel}) exited 0 but produced zero non-corpus file changes \u2014 empty implement (no-op). The implement agent must change at least one file outside docs/tasks3|docs/features; fix the implement input and re-run the pipeline.`
70471
+ error: `agent.run '${stepLabel}' (${agentLabel}) exited 0 but produced zero non-corpus file changes \u2014 empty implement (no-op). The implement agent must change at least one file outside the configured task/feature folders; fix the implement input and re-run the pipeline.`
69277
70472
  };
69278
70473
  }
69279
70474
  if (!ok) {
@@ -69281,19 +70476,24 @@ class AgentRunActionRunner {
69281
70476
  }
69282
70477
  const partialWorkHint = `partial work (if any) preserved at .spur/run/${context4.runId}-${stepLabel}-partial.md; resume from that tree per the timed-out-implement runbook (plugins/sp/skills/spur-dev/references/execution-workflow.md)`;
69283
70478
  const error51 = ok ? undefined : traced.signal !== undefined ? timeoutMs !== undefined ? `agent.run '${stepLabel}' (${agentLabel}) terminated by signal ${traced.signal} (configured timeout: ${timeoutMs}ms; timeout or cancellation); ${partialWorkHint}` : `agent.run '${stepLabel}' (${agentLabel}) was cancelled by signal ${traced.signal}; ${partialWorkHint}` : traced.message !== undefined ? `agent.run '${stepLabel}' (${agentLabel}) dispatch failed: ${traced.message}` : `agent.run '${stepLabel}' (${agentLabel}) exited with code ${exitCode}; ${partialWorkHint}`;
70479
+ const resolvedAgent = invocation?.agent ?? targetAgentDir;
70480
+ let resolvedSessionDir = sessionDir;
70481
+ if (ok && affinityOn && resolvedAgent !== targetAgentDir && !context4.vars.__agentSessionDir) {
70482
+ resolvedSessionDir = join15(cwd, ".spur", "run", context4.runId, "agent-sessions", resolvedAgent);
70483
+ }
69284
70484
  let discoveredSessionId = storedSessionId;
69285
- if (ok && affinityOn && sessionDir && !discoveredSessionId) {
69286
- discoveredSessionId = await discoverSessionId(sessionDir);
70485
+ if (ok && affinityOn && resolvedSessionDir && !discoveredSessionId) {
70486
+ discoveredSessionId = await discoverSessionId(resolvedSessionDir);
69287
70487
  }
69288
- if (ok && affinityOn && sessionDir) {
70488
+ if (ok && affinityOn && resolvedSessionDir) {
69289
70489
  try {
69290
70490
  const sidecarPath = join15(cwd, ".spur", "run", `${context4.runId}-agent-session.json`);
69291
70491
  const fs3 = createNodeFileSystem3(cwd);
69292
70492
  await fs3.ensureDir(dirname12(sidecarPath));
69293
70493
  await fs3.writeFile(sidecarPath, JSON.stringify({
69294
- agent: agentLabel,
70494
+ agent: resolvedAgent,
69295
70495
  sessionId: discoveredSessionId ?? null,
69296
- sessionDir,
70496
+ sessionDir: resolvedSessionDir,
69297
70497
  openedAt: new Date().toISOString()
69298
70498
  }, null, 2));
69299
70499
  } catch {}
@@ -69304,9 +70504,9 @@ class AgentRunActionRunner {
69304
70504
  error: error51,
69305
70505
  setVars: ok ? {
69306
70506
  __agentSession: resumeRetried ? "no-resume" : "open",
69307
- ...affinityOn && sessionDir ? { __agentSessionDir: sessionDir } : {},
70507
+ ...affinityOn && resolvedSessionDir ? { __agentSessionDir: resolvedSessionDir } : {},
69308
70508
  ...affinityOn && (discoveredSessionId || storedSessionId) ? { __agentSessionId: discoveredSessionId || storedSessionId } : {},
69309
- ...affinityOn ? { __agentSessionAgent: targetAgentDir } : {},
70509
+ ...affinityOn ? { __agentSessionAgent: resolvedAgent } : {},
69310
70510
  ...steeringNote !== undefined ? { __steeringNote: steeringNote } : {}
69311
70511
  } : undefined
69312
70512
  };
@@ -69321,9 +70521,12 @@ async function discoverSessionId(sessionDir) {
69321
70521
  const entries = await fs3.readDir(sessionDir);
69322
70522
  if (entries.length === 0)
69323
70523
  return;
70524
+ const jsonEntries = entries.filter((e) => e.toLowerCase().endsWith(".json"));
70525
+ if (jsonEntries.length === 0)
70526
+ return;
69324
70527
  let newestFile;
69325
70528
  let newestMtime = 0;
69326
- for (const entry of entries) {
70529
+ for (const entry of jsonEntries) {
69327
70530
  const fullPath = join15(sessionDir, entry);
69328
70531
  const st = await fs3.stat(fullPath);
69329
70532
  if (st?.isFile() && st.mtimeMs > newestMtime) {
@@ -69373,6 +70576,36 @@ function asOptionalNumber(value) {
69373
70576
  }
69374
70577
  return;
69375
70578
  }
70579
+ function extractCompletedRequirementsHeuristic(taskMarkdown) {
70580
+ const found = new Set;
70581
+ const planMatch = taskMarkdown.match(/^#{2,3}\s+Plan\s*$/m);
70582
+ if (planMatch) {
70583
+ const rest = taskMarkdown.slice((planMatch.index ?? 0) + planMatch[0].length);
70584
+ const nextSection = rest.match(/^#{2,3}\s+/m);
70585
+ const planBody = nextSection ? rest.slice(0, nextSection.index ?? 0) : rest;
70586
+ const xItems = planBody.match(/^\s*-\s*\[x\]\s*(.+)$/gim);
70587
+ if (xItems) {
70588
+ for (const item of xItems) {
70589
+ const text4 = item.replace(/^\s*-\s*\[x\]\s*/i, "").trim();
70590
+ if (text4)
70591
+ found.add(`- [x] ${text4}`);
70592
+ }
70593
+ }
70594
+ }
70595
+ const solutionMatch = taskMarkdown.match(/^#{2,3}\s+Solution\s*$/m);
70596
+ if (solutionMatch) {
70597
+ const rest = taskMarkdown.slice((solutionMatch.index ?? 0) + solutionMatch[0].length);
70598
+ const nextSection = rest.match(/^#{2,3}\s+/m);
70599
+ const solutionBody = nextSection ? rest.slice(0, nextSection.index ?? 0) : rest;
70600
+ const rMatches = solutionBody.match(/\bR\d+\b/g);
70601
+ if (rMatches) {
70602
+ for (const r of [...new Set(rMatches)].sort()) {
70603
+ found.add(r);
70604
+ }
70605
+ }
70606
+ }
70607
+ return found.size > 0 ? [...found] : ["unknown \u2014 Solution empty and Plan checkboxes open"];
70608
+ }
69376
70609
  async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd) {
69377
70610
  try {
69378
70611
  const signal = traced.signal;
@@ -69383,6 +70616,31 @@ async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd
69383
70616
  const headerLine = model !== undefined ? `${agentLabel} (model: ${model})` : agentLabel;
69384
70617
  const inv = traced.invocation;
69385
70618
  const argvLine = inv ? `${inv.command} ${inv.argv.join(" ")}` : "(invocation not captured)";
70619
+ let completedSection = "";
70620
+ const wbs = String(context4.vars.wbs ?? "");
70621
+ if (wbs) {
70622
+ try {
70623
+ const fs4 = createNodeFileSystem3(cwd);
70624
+ const locator = TaskLocator.forDirs(fs4, [
70625
+ join15(cwd, "docs", "tasks3"),
70626
+ join15(cwd, "docs", "tasks2"),
70627
+ join15(cwd, "docs", "tasks")
70628
+ ]);
70629
+ const hit = await locator.findByWbs(wbs);
70630
+ if (hit) {
70631
+ const taskMarkdown = await fs4.readFile(hit.filePath);
70632
+ const completed = extractCompletedRequirementsHeuristic(taskMarkdown);
70633
+ completedSection = [
70634
+ "",
70635
+ "## completed requirements (heuristic)",
70636
+ "",
70637
+ ...completed.map((l) => l.startsWith("-") ? l : `- ${l}`),
70638
+ ""
70639
+ ].join(`
70640
+ `);
70641
+ }
70642
+ } catch {}
70643
+ }
69386
70644
  const body = [
69387
70645
  `# Partial-work handoff \u2014 ${headerLine}`,
69388
70646
  "",
@@ -69418,7 +70676,7 @@ async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd
69418
70676
  "```",
69419
70677
  stderrTail || "(empty)",
69420
70678
  "```",
69421
- ""
70679
+ completedSection
69422
70680
  ].join(`
69423
70681
  `);
69424
70682
  const target = join15(cwd, ".spur", "run", `${context4.runId}-${context4.stateOrNodeId}-partial.md`);
@@ -69442,11 +70700,12 @@ async function gitDiffStat(cwd) {
69442
70700
  return "";
69443
70701
  }
69444
70702
  }
69445
- async function gitHasNonCorpusChanges(cwd) {
70703
+ async function gitHasNonCorpusChanges(cwd, excludeGlobs = ["docs/tasks3/*", "docs/features/*"]) {
69446
70704
  try {
70705
+ const excludes = excludeGlobs.map((g) => `:(exclude)${g}`);
69447
70706
  const result = await new NodeProcessExecutor3().run({
69448
70707
  command: "git",
69449
- args: ["status", "--porcelain", "--", ".", ":(exclude)docs/tasks3/*", ":(exclude)docs/features/*"],
70708
+ args: ["status", "--porcelain", "--", ".", ...excludes],
69450
70709
  cwd,
69451
70710
  maxOutput: 1024 * 1024,
69452
70711
  forceBuffered: true,
@@ -69463,9 +70722,10 @@ function tail(text4, maxChars) {
69463
70722
  return `... (truncated) ...
69464
70723
  ${text4.slice(text4.length - maxChars)}`;
69465
70724
  }
69466
- var PARTIAL_ARTIFACT_TAIL_CHARS = 4000, KIND = "agent.run";
70725
+ var PARTIAL_ARTIFACT_TAIL_CHARS = 4000, AGENT_RUN_PROGRESS_INTERVAL_MS = 30000, KIND = "agent.run";
69467
70726
  var init_agent_run = __esm(() => {
69468
70727
  init_dist5();
70728
+ init_task_locator();
69469
70729
  init_steering();
69470
70730
  });
69471
70731
 
@@ -69937,7 +71197,7 @@ function asString6(value) {
69937
71197
  var KIND9 = "response.validate";
69938
71198
 
69939
71199
  // ../../packages/app/src/workflow/utils.ts
69940
- var identity6 = (s) => s, NO_COLOR;
71200
+ var identity6 = (s2) => s2, NO_COLOR;
69941
71201
  var init_utils3 = __esm(() => {
69942
71202
  NO_COLOR = {
69943
71203
  enabled: false,
@@ -70161,7 +71421,7 @@ var KIND12 = "shell";
70161
71421
  // ../../packages/app/src/workflow/builtins.ts
70162
71422
  function registerSpurBuiltins(host, options) {
70163
71423
  const fileSystem = options.fileSystem ?? createNodeFileSystem3();
70164
- host.registerAction(new AgentRunActionRunner(options.agentService, options.observabilityBus, options.steeringController), "builtin");
71424
+ host.registerAction(new AgentRunActionRunner(options.agentService, options.observabilityBus, options.steeringController, options.agentConfig), "builtin");
70165
71425
  host.registerAction(new StreamingShellActionRunner(options.processExecutor ?? new NodeProcessExecutor3, options.observabilityBus), "builtin");
70166
71426
  host.registerGuard(new EnvShellGuardRunner(options.processExecutor ?? new NodeProcessExecutor3), "builtin");
70167
71427
  host.registerAction(new RuleCheckActionRunner(options.ruleService), "builtin");
@@ -70271,6 +71531,30 @@ class WorkflowAppService {
70271
71531
  validateSchema: opts.validateSchema !== false,
70272
71532
  ...embedded !== undefined ? embedded : {}
70273
71533
  });
71534
+ const shellErrors = [];
71535
+ const commands = collectShellCommands(workflow);
71536
+ const executor = new NodeProcessExecutor3;
71537
+ for (const { stateId, kind, index: index2, command } of commands) {
71538
+ if (!command || command.trim().length === 0)
71539
+ continue;
71540
+ try {
71541
+ const result = await executor.run({
71542
+ command: "sh",
71543
+ args: ["-n", "-c", command],
71544
+ rejectOnError: false
71545
+ });
71546
+ if (result.exitCode !== 0) {
71547
+ const stderr = (result.stderr ?? "").trim();
71548
+ const location = stateId ? `${stateId}/${kind}[${index2}]` : `${kind}[${index2}]`;
71549
+ shellErrors.push(`Shell syntax error at ${location}: ${stderr || "non-zero exit"}`);
71550
+ }
71551
+ } catch {
71552
+ shellErrors.push(`Shell syntax check failed at ${stateId}/${kind}[${index2}]: process error`);
71553
+ }
71554
+ }
71555
+ if (shellErrors.length > 0) {
71556
+ return { ok: false, valid: false, file: file2, errors: shellErrors };
71557
+ }
70274
71558
  return { ok: true, valid: true, workflow };
70275
71559
  } catch (error51) {
70276
71560
  return {
@@ -70573,6 +71857,23 @@ class WorkflowAppService {
70573
71857
  const processExec = this.ctx.processExecutor?.();
70574
71858
  const host = createDefaultWorkflowEngineHost(processExec !== undefined ? { processExecutor: processExec } : {});
70575
71859
  const bus = this.ctx.observabilityBus?.();
71860
+ let agentSlice = {};
71861
+ try {
71862
+ const agent = (await loadSpurConfig(this.ctx.cwd)).agent;
71863
+ agentSlice = {
71864
+ ...agent?.default !== undefined ? { default: agent.default } : {},
71865
+ ...agent?.sessionAffinity !== undefined ? { sessionAffinity: agent.sessionAffinity } : {}
71866
+ };
71867
+ } catch {}
71868
+ try {
71869
+ const fs3 = createNodeFileSystem3(this.ctx.cwd);
71870
+ const { foldersConfig, featuresDir } = await resolvePlanningFolders(fs3);
71871
+ const folderGlobs = Object.keys(foldersConfig.folders).map((k) => `${k}/*`);
71872
+ agentSlice = {
71873
+ ...agentSlice,
71874
+ excludeGlobs: [...folderGlobs, `${featuresDir}/*`]
71875
+ };
71876
+ } catch {}
70576
71877
  registerSpurBuiltins(host, {
70577
71878
  agentService: this.ctx.agentService(),
70578
71879
  ruleService: this.ctx.ruleService(),
@@ -70581,7 +71882,8 @@ class WorkflowAppService {
70581
71882
  hostAllowlist: this.ctx.hostAllowlist?.(),
70582
71883
  ...bus !== undefined ? { observabilityBus: bus } : {},
70583
71884
  ...processExec !== undefined ? { processExecutor: processExec } : {},
70584
- ...opts.steeringController !== undefined ? { steeringController: opts.steeringController } : {}
71885
+ ...opts.steeringController !== undefined ? { steeringController: opts.steeringController } : {},
71886
+ agentConfig: agentSlice
70585
71887
  });
70586
71888
  const db2 = await this.ctx.getDb();
70587
71889
  let persistence2 = new DbWorkflowPersistenceAdapter(db2);
@@ -70592,6 +71894,55 @@ class WorkflowAppService {
70592
71894
  return new WorkflowService(host, adapter);
70593
71895
  }
70594
71896
  }
71897
+ function collectShellCommands(def) {
71898
+ const entries = [];
71899
+ const visitAction = (stateId, action, idx) => {
71900
+ if (action.kind === "shell") {
71901
+ const cmd = action.options?.command;
71902
+ if (typeof cmd === "string" && cmd.length > 0) {
71903
+ entries.push({ stateId, kind: "action", index: idx, command: cmd });
71904
+ }
71905
+ }
71906
+ };
71907
+ const visitGuard = (stateId, guard) => {
71908
+ if (guard.kind === "shell") {
71909
+ const cmd = guard.options?.command;
71910
+ if (typeof cmd === "string" && cmd.length > 0) {
71911
+ entries.push({ stateId, kind: "guard", index: 0, command: cmd });
71912
+ }
71913
+ }
71914
+ };
71915
+ if (def.kind === "transition-flow" || def.kind === undefined) {
71916
+ const flowDef = def;
71917
+ for (const node of flowDef.nodes ?? []) {
71918
+ if (node.action)
71919
+ visitAction(node.id, node.action, 0);
71920
+ }
71921
+ for (const edge of flowDef.edges ?? []) {
71922
+ if (edge.condition)
71923
+ visitGuard(edge.from, edge.condition);
71924
+ }
71925
+ } else {
71926
+ const smDef = def;
71927
+ for (const state of smDef.states ?? []) {
71928
+ if (state.onEnter) {
71929
+ state.onEnter.forEach((action, i2) => {
71930
+ visitAction(state.id, action, i2);
71931
+ });
71932
+ }
71933
+ if (state.onExit) {
71934
+ state.onExit.forEach((action, i2) => {
71935
+ visitAction(state.id, action, i2);
71936
+ });
71937
+ }
71938
+ }
71939
+ for (const trans of smDef.transitions ?? []) {
71940
+ if (trans.guard)
71941
+ visitGuard(`${trans.from}\u2192${trans.to}`, trans.guard);
71942
+ }
71943
+ }
71944
+ return entries;
71945
+ }
70595
71946
  async function fileExists(path9) {
70596
71947
  const fs3 = createNodeFileSystem3();
70597
71948
  return await fs3.exists(path9);
@@ -71163,19 +72514,19 @@ var {
71163
72514
  init_src();
71164
72515
  init_loader();
71165
72516
 
71166
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application-node.js
72517
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
71167
72518
  init_dist4();
71168
72519
  init_dist5();
71169
72520
  import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
71170
72521
  import { dirname as dirname5 } from "path";
71171
72522
 
71172
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application/index.js
72523
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/index.js
71173
72524
  init_default_observers();
71174
72525
  init_event_bus();
71175
72526
  init_file_observer();
71176
72527
  init_logger3();
71177
72528
 
71178
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
72529
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
71179
72530
  class NoopSchedulerAdapter {
71180
72531
  constructor() {}
71181
72532
  register(_cron, _action) {}
@@ -71183,7 +72534,7 @@ class NoopSchedulerAdapter {
71183
72534
  async stop() {}
71184
72535
  }
71185
72536
 
71186
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
72537
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
71187
72538
  function initScheduler(adapter, cronEntries) {
71188
72539
  const resolved = adapter ?? new NoopSchedulerAdapter;
71189
72540
  if (cronEntries) {
@@ -71194,7 +72545,7 @@ function initScheduler(adapter, cronEntries) {
71194
72545
  return resolved;
71195
72546
  }
71196
72547
 
71197
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
72548
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
71198
72549
  init_logger3();
71199
72550
  init_metrics();
71200
72551
  init_sdk();
@@ -71287,7 +72638,7 @@ function dbPlugin(db2) {
71287
72638
  };
71288
72639
  }
71289
72640
 
71290
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
72641
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
71291
72642
  init_logger3();
71292
72643
 
71293
72644
  class PluginHost {
@@ -71375,7 +72726,7 @@ class PluginHost {
71375
72726
  }
71376
72727
  }
71377
72728
 
71378
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application/index.js
72729
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/index.js
71379
72730
  async function performShutdown(state, reason) {
71380
72731
  if (state.stopped)
71381
72732
  return;
@@ -71486,10 +72837,10 @@ async function runApplication(options) {
71486
72837
  }
71487
72838
  }
71488
72839
 
71489
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application-node.js
72840
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
71490
72841
  init_scheduler_node();
71491
72842
 
71492
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
72843
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
71493
72844
  var import_api14 = __toESM(require_src(), 1);
71494
72845
 
71495
72846
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -74505,7 +75856,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
74505
75856
  }), JsonTraceSerializer));
74506
75857
  }
74507
75858
  }
74508
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
75859
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
74509
75860
  var import_resources2 = __toESM(require_src4(), 1);
74510
75861
  var import_sdk_trace_node = __toESM(require_src8(), 1);
74511
75862
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -74556,7 +75907,7 @@ async function shutdownNodeTelemetry() {
74556
75907
  await Promise.all(pending);
74557
75908
  }
74558
75909
 
74559
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.19+79868827d1ab596b/node_modules/@gobing-ai/ts-infra/dist/application-node.js
75910
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
74560
75911
  class ConfigValidationError extends Error {
74561
75912
  constructor(message) {
74562
75913
  super(message);
@@ -78982,6 +80333,9 @@ function registerFeatureCommand(program2, context4) {
78982
80333
  const resolved = await resolvePlanningFolders(context4.fs);
78983
80334
  const featuresDir = options.folder ?? context4.fs.resolve(resolved.featuresDir);
78984
80335
  const tasksDir = context4.fs.resolve(resolved.tasksDir);
80336
+ const tasksDirs = Object.keys(resolved.foldersConfig.folders).map((p) => context4.fs.resolve(p));
80337
+ if (!tasksDirs.includes(tasksDir))
80338
+ tasksDirs.unshift(tasksDir);
78985
80339
  const svc = new FeatureCheckService(context4.fs);
78986
80340
  const json3 = options.json === true;
78987
80341
  const strict = options.strict === true;
@@ -79000,6 +80354,7 @@ function registerFeatureCommand(program2, context4) {
79000
80354
  strict,
79001
80355
  featuresDir,
79002
80356
  tasksDir,
80357
+ tasksDirs,
79003
80358
  runDir: context4.fs.resolve(".spur/run"),
79004
80359
  severityOverrides: resolved.severityOverrides,
79005
80360
  asStatus: options.as
@@ -79095,6 +80450,9 @@ async function assertFeatureCheckPass(context4, id, folderOverride, strict, asSt
79095
80450
  const resolved = await resolvePlanningFolders(context4.fs);
79096
80451
  const featuresDir = folderOverride ?? context4.fs.resolve(resolved.featuresDir);
79097
80452
  const tasksDir = context4.fs.resolve(resolved.tasksDir);
80453
+ const tasksDirs = Object.keys(resolved.foldersConfig.folders).map((p) => context4.fs.resolve(p));
80454
+ if (!tasksDirs.includes(tasksDir))
80455
+ tasksDirs.unshift(tasksDir);
79098
80456
  const entries = await context4.fs.readDir(featuresDir);
79099
80457
  const fileName = entries.find((name) => name.match(new RegExp(`^${id}_.+\\.md$`)));
79100
80458
  if (fileName === undefined) {
@@ -79104,6 +80462,7 @@ async function assertFeatureCheckPass(context4, id, folderOverride, strict, asSt
79104
80462
  strict,
79105
80463
  featuresDir,
79106
80464
  tasksDir,
80465
+ tasksDirs,
79107
80466
  asStatus
79108
80467
  });
79109
80468
  if (!result.pass) {
@@ -79117,7 +80476,7 @@ init_src3();
79117
80476
  init_src2();
79118
80477
  function registerHistoryCommand(program2, context4) {
79119
80478
  const noun = program2.command("history").summary("import and analyze coding-agent history");
79120
- noun.command("import").description("Import agent conversation JSONL.").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw", "pi").option("--file <path>", "Import one JSONL file").option("--root <path>", "Scan a history root").option("--mode <mode>", "full|incremental|force-file").option("--dry-run", "Scan without persisting imported records").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
80479
+ noun.command("import").description("Import agent conversation JSONL.").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw|omp|grok|agy", "pi").option("--file <path>", "Import one JSONL file").option("--root <path>", "Scan a history root").option("--mode <mode>", "full|incremental|force-file").option("--dry-run", "Scan without persisting imported records").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
79121
80480
  const svc = new HistoryService({ getDb: () => context4.getDb() });
79122
80481
  const r = await svc.import(options.source ?? "pi", {
79123
80482
  file: options.file || undefined,
@@ -79134,9 +80493,13 @@ function registerHistoryCommand(program2, context4) {
79134
80493
  const summary = await svc.analyze(options.since || undefined);
79135
80494
  context4.output.write(options.json ? toJson2(summary) : formatSummary(summary));
79136
80495
  });
79137
- noun.command("report").description("Reserved richer report surface; currently prints a TODO marker.").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
79138
- const message = "TODO: spur history report is reserved for the richer report surface.";
79139
- context4.output.write(options.json ? toJson2({ status: "todo", message }) : message);
80496
+ noun.command("report").description("Reserved richer report surface; not yet implemented (see docs/04_DESIGN.md \xA7spur history report).").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
80497
+ const message = `spur history report is reserved but not yet implemented (P8).
80498
+ ` + `See docs/04_DESIGN.md for the planned surface.
80499
+ ` + `Workaround: use "spur history analyze" for aggregate summaries, or
80500
+ ` + '"spur history import" to load session data, then query the database directly.';
80501
+ context4.output.write(options.json ? toJson2({ status: "not-implemented", message }) : message);
80502
+ context4.setExitCode(0);
79140
80503
  });
79141
80504
  }
79142
80505
  function formatImportResult(r) {
@@ -79147,6 +80510,7 @@ function formatImportResult(r) {
79147
80510
  `lines: ${r.processedLines}`,
79148
80511
  `imported: ${r.importedRecords}`,
79149
80512
  `duplicates: ${r.skippedDuplicates}`,
80513
+ `unknown: ${r.unknownRecords}`,
79150
80514
  `parse_errors: ${r.parseErrors.length}`,
79151
80515
  `validation_errors: ${r.validationErrors.length}`
79152
80516
  ].join(`
@@ -79164,7 +80528,7 @@ import { join as join19, resolve as resolve6 } from "path";
79164
80528
  var CLI_CONFIG = {
79165
80529
  binaryName: "spur",
79166
80530
  binaryLabel: "spur",
79167
- binaryVersion: "0.3.33",
80531
+ binaryVersion: "0.3.35",
79168
80532
  configDir: ".spur",
79169
80533
  configFile: ".spur/config.yaml",
79170
80534
  databaseFile: ".spur/spur.db"
@@ -82693,8 +84057,8 @@ function createRouter() {
82693
84057
  };
82694
84058
  }
82695
84059
  function splitPath(path9) {
82696
- const [_, ...s] = path9.split("/");
82697
- return s[s.length - 1] === "" ? s.slice(0, -1) : s;
84060
+ const [_, ...s2] = path9.split("/");
84061
+ return s2[s2.length - 1] === "" ? s2.slice(0, -1) : s2;
82698
84062
  }
82699
84063
  function getMatchParams(segments, paramsMap) {
82700
84064
  const params = new NullProtoObj2;
@@ -85378,7 +86742,7 @@ var requestLogger = (appRt) => async function requestLoggerMiddleware(c3, next)
85378
86742
  };
85379
86743
 
85380
86744
  // ../server/src/middleware/pipeline.ts
85381
- var trimOrigins = (origins) => origins.split(",").map((s) => s.trim()).filter(Boolean);
86745
+ var trimOrigins = (origins) => origins.split(",").map((s2) => s2.trim()).filter(Boolean);
85382
86746
  function mountMiddleware(app, appRt) {
85383
86747
  const corsOrigins = process.env.SPUR_CORS_ORIGINS ? trimOrigins(process.env.SPUR_CORS_ORIGINS) : [];
85384
86748
  app.use("*", secureHeaders());
@@ -85470,7 +86834,7 @@ function decodeHistoryCursor(encoded) {
85470
86834
  function parseHistoryNamesParam(raw2) {
85471
86835
  if (raw2 === undefined)
85472
86836
  return;
85473
- const parts = (Array.isArray(raw2) ? raw2 : [raw2]).flatMap((chunk) => chunk.split(",")).map((s) => s.trim()).filter((s) => s.length > 0);
86837
+ const parts = (Array.isArray(raw2) ? raw2 : [raw2]).flatMap((chunk) => chunk.split(",")).map((s2) => s2.trim()).filter((s2) => s2.length > 0);
85474
86838
  return parts.length > 0 ? parts : undefined;
85475
86839
  }
85476
86840
  function extractSystemEventActor2(event2) {
@@ -86131,7 +87495,9 @@ function createFeatureHandlers(ctx) {
86131
87495
  }),
86132
87496
  sync: os2.feature.sync.handler(async ({ input }) => {
86133
87497
  if (input.direction === "push") {
86134
- throw new Error("Push sync (feature->tasks cascade) is not implemented");
87498
+ throw new HTTPException(501, {
87499
+ message: "Push sync (feature->tasks cascade) is not implemented; use the pull direction or spur feature sync CLI"
87500
+ });
86135
87501
  }
86136
87502
  const svc = ctx.featureService();
86137
87503
  const res = await svc.syncFeature(input.id);
@@ -86939,8 +88305,8 @@ var TypeName;
86939
88305
 
86940
88306
  // ../../node_modules/.bun/@orpc+openapi@1.14.4+a904a9933278b24d/node_modules/@orpc/openapi/dist/shared/openapi.BwdtJjDu.mjs
86941
88307
  var OPERATION_EXTENDER_SYMBOL = Symbol("ORPC_OPERATION_EXTENDER");
86942
- function getCustomOpenAPIOperation(o2) {
86943
- return o2[OPERATION_EXTENDER_SYMBOL];
88308
+ function getCustomOpenAPIOperation(o3) {
88309
+ return o3[OPERATION_EXTENDER_SYMBOL];
86944
88310
  }
86945
88311
  function applyCustomOpenAPIOperation(operation, contract2) {
86946
88312
  const operationCustoms = [];
@@ -87107,7 +88473,7 @@ function filterSchemaBranches(schema4, check2, matches = []) {
87107
88473
  if (isObject5(schema4)) {
87108
88474
  for (const keyword of ["anyOf", "oneOf"]) {
87109
88475
  if (schema4[keyword] && Object.keys(schema4).every((k) => k === keyword || !LOGIC_KEYWORDS.includes(k))) {
87110
- const rest = schema4[keyword].map((s) => filterSchemaBranches(s, check2, matches)[1]).filter((v) => !!v);
88476
+ const rest = schema4[keyword].map((s2) => filterSchemaBranches(s2, check2, matches)[1]).filter((v) => !!v);
87111
88477
  if (rest.length === 1 && typeof rest[0] === "object") {
87112
88478
  return [matches, { ...schema4, [keyword]: undefined, ...rest[0] }];
87113
88479
  }
@@ -87132,7 +88498,7 @@ function expandUnionSchema(schema4) {
87132
88498
  if (typeof schema4 === "object") {
87133
88499
  for (const keyword of ["anyOf", "oneOf"]) {
87134
88500
  if (schema4[keyword] && Object.keys(schema4).every((k) => k === keyword || !LOGIC_KEYWORDS.includes(k))) {
87135
- return schema4[keyword].flatMap((s) => expandUnionSchema(s));
88501
+ return schema4[keyword].flatMap((s2) => expandUnionSchema(s2));
87136
88502
  }
87137
88503
  }
87138
88504
  }
@@ -87143,12 +88509,12 @@ function expandArrayableSchema(schema4) {
87143
88509
  if (schemas3.length !== 2) {
87144
88510
  return;
87145
88511
  }
87146
- const arraySchema = schemas3.find((s) => typeof s === "object" && s.type === "array" && Object.keys(s).filter((k) => LOGIC_KEYWORDS.includes(k)).every((k) => k === "type" || k === "items"));
88512
+ const arraySchema = schemas3.find((s2) => typeof s2 === "object" && s2.type === "array" && Object.keys(s2).filter((k) => LOGIC_KEYWORDS.includes(k)).every((k) => k === "type" || k === "items"));
87147
88513
  if (arraySchema === undefined) {
87148
88514
  return;
87149
88515
  }
87150
88516
  const items1 = arraySchema.items;
87151
- const items2 = schemas3.find((s) => s !== arraySchema);
88517
+ const items2 = schemas3.find((s2) => s2 !== arraySchema);
87152
88518
  if (stringifyJSON(items1) !== stringifyJSON(items2)) {
87153
88519
  return;
87154
88520
  }
@@ -87162,14 +88528,14 @@ var PRIMITIVE_SCHEMA_TYPES = /* @__PURE__ */ new Set([
87162
88528
  TypeName.Null
87163
88529
  ]);
87164
88530
  function isPrimitiveSchema(schema4) {
87165
- return expandUnionSchema(schema4).every((s) => {
87166
- if (typeof s === "boolean") {
88531
+ return expandUnionSchema(schema4).every((s2) => {
88532
+ if (typeof s2 === "boolean") {
87167
88533
  return false;
87168
88534
  }
87169
- if (typeof s.type === "string" && PRIMITIVE_SCHEMA_TYPES.has(s.type)) {
88535
+ if (typeof s2.type === "string" && PRIMITIVE_SCHEMA_TYPES.has(s2.type)) {
87170
88536
  return true;
87171
88537
  }
87172
- if (s.const !== undefined) {
88538
+ if (s2.const !== undefined) {
87173
88539
  return true;
87174
88540
  }
87175
88541
  return false;
@@ -87301,8 +88667,8 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
87301
88667
  return schema4;
87302
88668
  }
87303
88669
  const unionSchemas = [
87304
- ...toArray(schema4.anyOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2))),
87305
- ...toArray(schema4.oneOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2)))
88670
+ ...toArray(schema4.anyOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2))),
88671
+ ...toArray(schema4.oneOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2)))
87306
88672
  ];
87307
88673
  const objectUnionSchemas = [];
87308
88674
  for (const u2 of unionSchemas) {
@@ -87317,7 +88683,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
87317
88683
  for (const [key, value2] of Object.entries(u2.properties)) {
87318
88684
  let entry = mergedUnionPropertyMap.get(key);
87319
88685
  if (!entry) {
87320
- const required2 = objectUnionSchemas.every((s) => s.required?.includes(key));
88686
+ const required2 = objectUnionSchemas.every((s2) => s2.required?.includes(key));
87321
88687
  entry = { required: required2, schemas: [] };
87322
88688
  mergedUnionPropertyMap.set(key, entry);
87323
88689
  }
@@ -87325,7 +88691,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
87325
88691
  }
87326
88692
  }
87327
88693
  }
87328
- const intersectionSchemas = toArray(schema4.allOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2)));
88694
+ const intersectionSchemas = toArray(schema4.allOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2)));
87329
88695
  const objectIntersectionSchemas = [];
87330
88696
  for (const u2 of intersectionSchemas) {
87331
88697
  if (!isObjectSchema(u2)) {
@@ -87342,7 +88708,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
87342
88708
  for (const [key, value2] of Object.entries(u2.properties)) {
87343
88709
  let entry = mergedInteractionPropertyMap.get(key);
87344
88710
  if (!entry) {
87345
- const required2 = objectIntersectionSchemas.some((s) => s.required?.includes(key));
88711
+ const required2 = objectIntersectionSchemas.some((s2) => s2.required?.includes(key));
87346
88712
  entry = { required: required2, schemas: [] };
87347
88713
  mergedInteractionPropertyMap.set(key, entry);
87348
88714
  }
@@ -88191,8 +89557,8 @@ class experimental_ZodSmartCoercionPlugin {
88191
89557
  }
88192
89558
  if (Array.isArray(value2)) {
88193
89559
  return value2.map((v, i2) => {
88194
- const s = tuple2._zod.def.items[i2] ?? tuple2._zod.def.rest;
88195
- return s ? this.#coerce(s, v) : v;
89560
+ const s2 = tuple2._zod.def.items[i2] ?? tuple2._zod.def.rest;
89561
+ return s2 ? this.#coerce(s2, v) : v;
88196
89562
  });
88197
89563
  }
88198
89564
  return value2;
@@ -88222,8 +89588,8 @@ class experimental_ZodSmartCoercionPlugin {
88222
89588
  ...Object.keys(object3._zod.def.shape)
88223
89589
  ]);
88224
89590
  for (const k of keys) {
88225
- const s = object3._zod.def.shape[k] ?? object3._zod.def.catchall;
88226
- newObj[k] = s ? this.#coerce(s, value2[k]) : value2[k];
89591
+ const s2 = object3._zod.def.shape[k] ?? object3._zod.def.catchall;
89592
+ newObj[k] = s2 ? this.#coerce(s2, value2[k]) : value2[k];
88227
89593
  }
88228
89594
  return newObj;
88229
89595
  }
@@ -88831,7 +90197,7 @@ function createRouter2(ctx) {
88831
90197
  function serverBootstrapConfig(env) {
88832
90198
  const isTest = env.NODE_ENV === "test";
88833
90199
  const raw2 = env.SPUR_TEAM_AUTOSTART;
88834
- const teamAutostart = raw2 ? raw2.split(",").map((s) => s.trim()).filter((s) => s.length > 0) : [];
90200
+ const teamAutostart = raw2 ? raw2.split(",").map((s2) => s2.trim()).filter((s2) => s2.length > 0) : [];
88835
90201
  const diagnosticEvents = env.SPUR_DIAGNOSTIC_EVENTS === "1" || env.SPUR_DIAGNOSTIC_EVENTS === "true";
88836
90202
  const retentionDefault = parseRetentionNumber(env.SPUR_EVENT_RETENTION_DEFAULT);
88837
90203
  const retentionPrefixes = parseRetentionPrefixes(env);
@@ -89835,7 +91201,7 @@ var spur_config_schema_default = {
89835
91201
  },
89836
91202
  executors: {
89837
91203
  type: "array",
89838
- description: "Named executor profiles: each pairs a canonical agent with an optional model override. Referenced by name from `default` and `default-by-phase`.",
91204
+ description: "Named executor profiles: each pairs a canonical agent with an optional model override. Referenced by name from `agent.default` and stage model_policy (default-by-phase removed 0452).",
89839
91205
  items: {
89840
91206
  type: "object",
89841
91207
  required: ["name", "agent"],
@@ -89863,13 +91229,6 @@ var spur_config_schema_default = {
89863
91229
  }
89864
91230
  }
89865
91231
  },
89866
- "default-by-phase": {
89867
- type: "object",
89868
- description: "DEPRECATED (ADR-033). Backward-compat map of dev phase (e.g. dev-run, dev-review) to executor selector. Prefer executor `tier` + stage-registry model_policy. When present, a matching phase mapping is still authoritative (fail-fast; no fall back to `default`) and shadows stage routing for that phase.",
89869
- additionalProperties: {
89870
- type: "string"
89871
- }
89872
- },
89873
91232
  team: {
89874
91233
  type: "object",
89875
91234
  description: "Declarative agent teams keyed by team id (the map key is the teamId). Each team materializes a roster of agent specs (feature M). Mirrors @gobing-ai/spur-config TeamConfigSchema (Zod is SSOT).",
@@ -89897,7 +91256,10 @@ var spur_config_schema_default = {
89897
91256
  description: "Roster of member references (>= 1). A bare string is shorthand for { executor: <string> }; the composed agent id is <teamId>-<id ?? executor>.",
89898
91257
  items: {
89899
91258
  oneOf: [
89900
- { type: "string", minLength: 1 },
91259
+ {
91260
+ type: "string",
91261
+ minLength: 1
91262
+ },
89901
91263
  {
89902
91264
  type: "object",
89903
91265
  required: ["executor"],
@@ -89912,20 +91274,34 @@ var spur_config_schema_default = {
89912
91274
  minLength: 1,
89913
91275
  description: "Local member id; composed id is <teamId>-<id ?? executor> (must match ^[a-z][a-z0-9_-]{1,63}$)."
89914
91276
  },
89915
- purpose: { type: "string" },
91277
+ purpose: {
91278
+ type: "string"
91279
+ },
89916
91280
  workspace: {
89917
91281
  type: "string",
89918
91282
  minLength: 1,
89919
91283
  description: "Per-member workspace override. A leading `~` is tilde-expanded at load."
89920
91284
  },
89921
- model: { type: "string", minLength: 1 },
89922
- autonomy: { type: "string" },
89923
- systemPrompt: { type: "string" },
91285
+ model: {
91286
+ type: "string",
91287
+ minLength: 1
91288
+ },
91289
+ autonomy: {
91290
+ type: "string"
91291
+ },
91292
+ systemPrompt: {
91293
+ type: "string"
91294
+ },
89924
91295
  command: {
89925
91296
  type: "array",
89926
- items: { type: "string", minLength: 1 }
91297
+ items: {
91298
+ type: "string",
91299
+ minLength: 1
91300
+ }
89927
91301
  },
89928
- autostart: { type: "boolean" }
91302
+ autostart: {
91303
+ type: "boolean"
91304
+ }
89929
91305
  }
89930
91306
  }
89931
91307
  ]
@@ -89941,7 +91317,9 @@ var spur_config_schema_default = {
89941
91317
  properties: {
89942
91318
  paths: {
89943
91319
  type: "array",
89944
- items: { type: "string" },
91320
+ items: {
91321
+ type: "string"
91322
+ },
89945
91323
  description: "Glob paths to rule files."
89946
91324
  }
89947
91325
  }
@@ -89951,7 +91329,9 @@ var spur_config_schema_default = {
89951
91329
  properties: {
89952
91330
  paths: {
89953
91331
  type: "array",
89954
- items: { type: "string" },
91332
+ items: {
91333
+ type: "string"
91334
+ },
89955
91335
  description: "Glob paths to workflow directories."
89956
91336
  }
89957
91337
  }
@@ -90332,7 +91712,7 @@ ${result.content}`);
90332
91712
  context4.setExitCode(1);
90333
91713
  }
90334
91714
  });
90335
- task.command("update").summary("Update a task status or replace a section.").argument("<wbs>", "Task WBS number").argument("[status]", "New status (for lifecycle transition)").option("--section <name>", "Section name to replace").option("--from-file <path>", "File to read section body from (requires --section)").option("--feature <id>", "Set the feature_id frontmatter field (traceability edge)").option("--priority <p>", "Set the priority frontmatter field (P0\u2013P3)").option("--no-lifecycle", "Suppress lifecycle workflow run creation (use during pipeline runs to avoid orphaned lifecycle runs)").option("--force-done", "Allow transitioning to `done` even when the verify verdict is not PASS; records an override (task 0292)").option("--reason <text>", "Rationale for a forced-done override (paired with --force-done; persisted as done_reason)").option("--verdict-dir <path>", "Directory holding <wbs>-verdict.json artifacts (default: .spur/run)").option("--folder <path>", "Custom tasks folder").option("--json", "Output machine-readable JSON").action(async (wbs, status, options) => {
91715
+ task.command("update").summary("Update a task status or replace a section.").argument("<wbs>", "Task WBS number").argument("[status]", "New status (for lifecycle transition)").option("--section <name>", "Section name to replace").option("--from-file <path>", "File to read section body from (requires --section)").option("--feature <id>", "Set the feature_id frontmatter field (traceability edge)").option("--priority <p>", "Set the priority frontmatter field (P0\u2013P3)").option("--ac-numbering <mode>", "Set the ac_numbering frontmatter field (task-local) \u2014 opts the task into the Requirements\u2194AC coverage check").option("--no-lifecycle", "Suppress lifecycle workflow run creation (use during pipeline runs to avoid orphaned lifecycle runs)").option("--force-done", "Allow transitioning to `done` even when the verify verdict is not PASS; records an override (task 0292)").option("--reason <text>", "Rationale for a forced-done override (paired with --force-done; persisted as done_reason)").option("--verdict-dir <path>", "Directory holding <wbs>-verdict.json artifacts (default: .spur/run)").option("--folder <path>", "Custom tasks folder").option("--json", "Output machine-readable JSON").action(async (wbs, status, options) => {
90336
91716
  const svc = await makeService2(context4, options.folder, options.lifecycle === false);
90337
91717
  try {
90338
91718
  if (options.section !== undefined) {
@@ -90350,9 +91730,9 @@ ${result.content}`);
90350
91730
  }
90351
91731
  context4.output.write(`Updated section '${options.section}' in task ${result.ref.id}`);
90352
91732
  }
90353
- } else if (options.feature !== undefined || options.priority !== undefined) {
90354
- const key = options.feature !== undefined ? "feature_id" : "priority";
90355
- const value2 = options.feature ?? options.priority ?? "";
91733
+ } else if (options.feature !== undefined || options.priority !== undefined || options.acNumbering !== undefined) {
91734
+ const key = options.feature !== undefined ? "feature_id" : options.priority !== undefined ? "priority" : "ac_numbering";
91735
+ const value2 = options.feature ?? options.priority ?? options.acNumbering ?? "";
90356
91736
  const result = await svc.updateField(wbs, key, value2);
90357
91737
  if (options.json) {
90358
91738
  context4.output.write(toJson2(result));
@@ -90361,10 +91741,12 @@ ${result.content}`);
90361
91741
  }
90362
91742
  } else if (status !== undefined) {
90363
91743
  status = canonicalStatusOrRaw(status);
90364
- if (options.lifecycle !== false && (status === "done" || status === "testing")) {
90365
- const adapter = makeLifecycleAdapter(context4, TASK_LIFECYCLE_PROFILE);
91744
+ if (status === "done" || status === "testing") {
91745
+ const adapter = options.lifecycle === false ? undefined : makeLifecycleAdapter(context4, TASK_LIFECYCLE_PROFILE);
90366
91746
  if (adapter === undefined) {
90367
- context4.output.error(`warning: lifecycle adapter unavailable \u2014 running \`spur task check\` inline as the ${status} gate. ` + "Restore the bundled task-lifecycle workflow to re-enable the real guard.");
91747
+ if (options.lifecycle !== false) {
91748
+ context4.output.error(`warning: lifecycle adapter unavailable \u2014 running \`spur task check\` inline as the ${status} gate. ` + "Restore the bundled task-lifecycle workflow to re-enable the real guard.");
91749
+ }
90368
91750
  const ok = await runDoneGateCheck(context4, wbs, options.folder);
90369
91751
  if (!ok) {
90370
91752
  context4.output.error(`Lifecycle transition blocked: \`spur task check ${wbs}\` failed. Fix the findings before transitioning to ${status}.`);
@@ -92290,22 +93672,22 @@ function wrapAnsi(string4, columns2, options) {
92290
93672
 
92291
93673
  // ../../node_modules/.bun/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
92292
93674
  var import_sisteransi = __toESM(require_src9(), 1);
92293
- function findCursor(s, o2, l) {
93675
+ function findCursor(s2, o3, l) {
92294
93676
  if (!l.some((r2) => !r2.disabled))
92295
- return s;
92296
- const t = s + o2, n2 = Math.max(l.length - 1, 0), e = t < 0 ? n2 : t > n2 ? 0 : t;
92297
- return l[e].disabled ? findCursor(e, o2 < 0 ? -1 : 1, l) : e;
93677
+ return s2;
93678
+ const t = s2 + o3, n2 = Math.max(l.length - 1, 0), e = t < 0 ? n2 : t > n2 ? 0 : t;
93679
+ return l[e].disabled ? findCursor(e, o3 < 0 ? -1 : 1, l) : e;
92298
93680
  }
92299
- function findTextCursor(s, o2, l, i2) {
93681
+ function findTextCursor(s2, o3, l, i2) {
92300
93682
  const t = i2.split(`
92301
93683
  `);
92302
- let n2 = 0, e = s;
93684
+ let n2 = 0, e = s2;
92303
93685
  for (const r2 of t) {
92304
93686
  if (e <= r2.length)
92305
93687
  break;
92306
93688
  e -= r2.length + 1, n2++;
92307
93689
  }
92308
- for (n2 = Math.max(0, Math.min(t.length - 1, n2 + l)), e = Math.min(e, t[n2].length) + o2;e < 0 && n2 > 0; )
93690
+ for (n2 = Math.max(0, Math.min(t.length - 1, n2 + l)), e = Math.min(e, t[n2].length) + o3;e < 0 && n2 > 0; )
92309
93691
  n2--, e += t[n2].length + 1;
92310
93692
  for (;e > t[n2].length && n2 < t.length - 1; )
92311
93693
  e -= t[n2].length + 1, n2++;
@@ -92359,16 +93741,16 @@ var settings = {
92359
93741
  function isActionKey(n2, e) {
92360
93742
  if (typeof n2 == "string")
92361
93743
  return settings.aliases.get(n2) === e;
92362
- for (const s of n2)
92363
- if (s !== undefined && isActionKey(s, e))
93744
+ for (const s2 of n2)
93745
+ if (s2 !== undefined && isActionKey(s2, e))
92364
93746
  return true;
92365
93747
  return false;
92366
93748
  }
92367
- function diffLines(i2, s) {
92368
- if (i2 === s)
93749
+ function diffLines(i2, s2) {
93750
+ if (i2 === s2)
92369
93751
  return;
92370
93752
  const e = i2.split(`
92371
- `), t2 = s.split(`
93753
+ `), t2 = s2.split(`
92372
93754
  `), r2 = Math.max(e.length, t2.length), f = [];
92373
93755
  for (let n2 = 0;n2 < r2; n2++)
92374
93756
  e[n2] !== t2[n2] && f.push(n2);
@@ -92385,20 +93767,20 @@ function isCancel(e) {
92385
93767
  return e === CANCEL_SYMBOL;
92386
93768
  }
92387
93769
  function setRawMode(e, r2) {
92388
- const o2 = e;
92389
- o2.isTTY && o2.setRawMode(r2);
93770
+ const o3 = e;
93771
+ o3.isTTY && o3.setRawMode(r2);
92390
93772
  }
92391
93773
  var getColumns2 = (e) => ("columns" in e) && typeof e.columns == "number" ? e.columns : 80;
92392
93774
  var getRows = (e) => ("rows" in e) && typeof e.rows == "number" ? e.rows : 20;
92393
- function wrapTextWithPrefix(e, r2, o2, t2 = o2, s = o2, n2) {
93775
+ function wrapTextWithPrefix(e, r2, o3, t2 = o3, s2 = o3, n2) {
92394
93776
  const f = getColumns2(e ?? stdout);
92395
- return wrapAnsi(r2, f - o2.length, {
93777
+ return wrapAnsi(r2, f - o3.length, {
92396
93778
  hard: true,
92397
93779
  trim: false
92398
93780
  }).split(`
92399
93781
  `).map((c3, i2, m) => {
92400
93782
  const d = n2 ? n2(c3, i2) : c3;
92401
- return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o2}${d}`;
93783
+ return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s2}${d}` : `${o3}${d}`;
92402
93784
  }).join(`
92403
93785
  `);
92404
93786
  }
@@ -92428,8 +93810,8 @@ class V {
92428
93810
  value;
92429
93811
  userInput = "";
92430
93812
  constructor(t2, e = true) {
92431
- const { input: i2 = stdin, output: n2 = stdout, render: s, signal: r2, ...o2 } = t2;
92432
- this.opts = o2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n2;
93813
+ const { input: i2 = stdin, output: n2 = stdout, render: s2, signal: r2, ...o3 } = t2;
93814
+ this.opts = o3, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s2.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n2;
92433
93815
  }
92434
93816
  unsubscribe() {
92435
93817
  this._subscribers.clear();
@@ -92446,10 +93828,10 @@ class V {
92446
93828
  }
92447
93829
  emit(t2, ...e) {
92448
93830
  const i2 = this._subscribers.get(t2) ?? [], n2 = [];
92449
- for (const s of i2)
92450
- s.cb(...e), s.once && n2.push(() => i2.splice(i2.indexOf(s), 1));
92451
- for (const s of n2)
92452
- s();
93831
+ for (const s2 of i2)
93832
+ s2.cb(...e), s2.once && n2.push(() => i2.splice(i2.indexOf(s2), 1));
93833
+ for (const s2 of n2)
93834
+ s2();
92453
93835
  }
92454
93836
  prompt() {
92455
93837
  return new Promise((t2) => {
@@ -92518,23 +93900,23 @@ class V {
92518
93900
  else {
92519
93901
  const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
92520
93902
  if (this.restoreCursor(), e) {
92521
- const n2 = Math.max(0, e.numLinesAfter - i2), s = Math.max(0, e.numLinesBefore - i2);
92522
- let r2 = e.lines.find((o2) => o2 >= n2);
93903
+ const n2 = Math.max(0, e.numLinesAfter - i2), s2 = Math.max(0, e.numLinesBefore - i2);
93904
+ let r2 = e.lines.find((o3) => o3 >= n2);
92523
93905
  if (r2 === undefined) {
92524
93906
  this._prevFrame = t2;
92525
93907
  return;
92526
93908
  }
92527
93909
  if (e.lines.length === 1) {
92528
- this.output.write(import_sisteransi.cursor.move(0, r2 - s)), this.output.write(import_sisteransi.erase.lines(1));
92529
- const o2 = t2.split(`
93910
+ this.output.write(import_sisteransi.cursor.move(0, r2 - s2)), this.output.write(import_sisteransi.erase.lines(1));
93911
+ const o3 = t2.split(`
92530
93912
  `);
92531
- this.output.write(o2[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o2.length - r2 - 1));
93913
+ this.output.write(o3[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o3.length - r2 - 1));
92532
93914
  return;
92533
93915
  } else if (e.lines.length > 1) {
92534
- if (n2 < s)
93916
+ if (n2 < s2)
92535
93917
  r2 = n2;
92536
93918
  else {
92537
- const h2 = r2 - s;
93919
+ const h2 = r2 - s2;
92538
93920
  h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
92539
93921
  }
92540
93922
  this.output.write(import_sisteransi.erase.down());
@@ -92554,7 +93936,7 @@ class V {
92554
93936
  function p$1(l, e) {
92555
93937
  if (l === undefined || e.length === 0)
92556
93938
  return 0;
92557
- const i2 = e.findIndex((s) => s.value === l);
93939
+ const i2 = e.findIndex((s2) => s2.value === l);
92558
93940
  return i2 !== -1 ? i2 : 0;
92559
93941
  }
92560
93942
  function g2(l, e) {
@@ -92595,22 +93977,22 @@ var T$1 = class T extends V {
92595
93977
  this.filteredOptions = [...t2], this.multiple = e.multiple === true, this.#t = typeof e.options == "function" ? e.filter : e.filter ?? g2;
92596
93978
  let i2;
92597
93979
  if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i2 = e.initialValue : i2 = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i2 = [this.options[0].value]), i2)
92598
- for (const s of i2) {
92599
- const n2 = t2.findIndex((o2) => o2.value === s);
92600
- n2 !== -1 && (this.toggleSelected(s), this.#e = n2);
93980
+ for (const s2 of i2) {
93981
+ const n2 = t2.findIndex((o3) => o3.value === s2);
93982
+ n2 !== -1 && (this.toggleSelected(s2), this.#e = n2);
92601
93983
  }
92602
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (s, n2) => this.#l(s, n2)), this.on("userInput", (s) => this.#u(s));
93984
+ this.focusedValue = this.options[this.#e]?.value, this.on("key", (s2, n2) => this.#l(s2, n2)), this.on("userInput", (s2) => this.#u(s2));
92603
93985
  }
92604
93986
  _isActionKey(e, t2) {
92605
93987
  return e === "\t" || this.multiple && this.isNavigating && t2.name === "space" && e !== undefined && e !== "";
92606
93988
  }
92607
93989
  #l(e, t2) {
92608
- const i2 = t2.name === "up", s = t2.name === "down", n2 = t2.name === "return", o2 = this.userInput === "" || this.userInput === "\t", u2 = this.#n, h2 = this.options, f = u2 !== undefined && u2 !== "" && h2.some((r2) => !r2.disabled && (this.#t ? this.#t(u2, r2) : true));
92609
- if (t2.name === "tab" && o2 && f) {
93990
+ const i2 = t2.name === "up", s2 = t2.name === "down", n2 = t2.name === "return", o3 = this.userInput === "" || this.userInput === "\t", u2 = this.#n, h2 = this.options, f = u2 !== undefined && u2 !== "" && h2.some((r2) => !r2.disabled && (this.#t ? this.#t(u2, r2) : true));
93991
+ if (t2.name === "tab" && o3 && f) {
92610
93992
  this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u2, true), this.isNavigating = false;
92611
93993
  return;
92612
93994
  }
92613
- i2 || s ? (this.#e = findCursor(this.#e, i2 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n2 ? this.value = m(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t2.name === "tab" || this.isNavigating && t2.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
93995
+ i2 || s2 ? (this.#e = findCursor(this.#e, i2 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n2 ? this.value = m(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t2.name === "tab" || this.isNavigating && t2.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
92614
93996
  }
92615
93997
  deselectAll() {
92616
93998
  this.selectedValues = [];
@@ -92625,8 +94007,8 @@ var T$1 = class T extends V {
92625
94007
  e && this.#t ? this.filteredOptions = t2.filter((n2) => this.#t?.(e, n2)) : this.filteredOptions = [...t2];
92626
94008
  const i2 = p$1(this.focusedValue, this.filteredOptions);
92627
94009
  this.#e = findCursor(i2, 0, this.filteredOptions);
92628
- const s = this.filteredOptions[this.#e];
92629
- s && !s.disabled ? this.focusedValue = s.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
94010
+ const s2 = this.filteredOptions[this.#e];
94011
+ s2 && !s2.disabled ? this.focusedValue = s2.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
92630
94012
  }
92631
94013
  }
92632
94014
  };
@@ -92643,11 +94025,11 @@ function P(r2) {
92643
94025
  year: "numeric",
92644
94026
  month: "2-digit",
92645
94027
  day: "2-digit"
92646
- }).formatToParts(new Date(2000, 0, 15)), s = [];
94028
+ }).formatToParts(new Date(2000, 0, 15)), s2 = [];
92647
94029
  let n2 = "/";
92648
94030
  for (const e of i2)
92649
- e.type === "literal" ? n2 = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") && s.push({ type: e.type, len: e.type === "year" ? 4 : 2 });
92650
- return { segments: s, separator: n2 };
94031
+ e.type === "literal" ? n2 = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") && s2.push({ type: e.type, len: e.type === "year" ? 4 : 2 });
94032
+ return { segments: s2, separator: n2 };
92651
94033
  }
92652
94034
  function p2(r2) {
92653
94035
  return Number.parseInt((r2 || "0").replace(/_/g, "0"), 10) || 0;
@@ -92663,26 +94045,26 @@ function c3(r2, t2) {
92663
94045
  return new Date(r2 || 2001, t2 || 1, 0).getDate();
92664
94046
  }
92665
94047
  function b(r2) {
92666
- const { year: t2, month: i2, day: s } = f(r2);
92667
- if (!t2 || t2 < 0 || t2 > 9999 || !i2 || i2 < 1 || i2 > 12 || !s || s < 1)
94048
+ const { year: t2, month: i2, day: s2 } = f(r2);
94049
+ if (!t2 || t2 < 0 || t2 > 9999 || !i2 || i2 < 1 || i2 > 12 || !s2 || s2 < 1)
92668
94050
  return;
92669
- const n2 = new Date(Date.UTC(t2, i2 - 1, s));
92670
- if (!(n2.getUTCFullYear() !== t2 || n2.getUTCMonth() !== i2 - 1 || n2.getUTCDate() !== s))
92671
- return { year: t2, month: i2, day: s };
94051
+ const n2 = new Date(Date.UTC(t2, i2 - 1, s2));
94052
+ if (!(n2.getUTCFullYear() !== t2 || n2.getUTCMonth() !== i2 - 1 || n2.getUTCDate() !== s2))
94053
+ return { year: t2, month: i2, day: s2 };
92672
94054
  }
92673
94055
  function C(r2) {
92674
94056
  const t2 = b(r2);
92675
94057
  return t2 ? new Date(Date.UTC(t2.year, t2.month - 1, t2.day)) : undefined;
92676
94058
  }
92677
- function T2(r2, t2, i2, s) {
94059
+ function T2(r2, t2, i2, s2) {
92678
94060
  const n2 = i2 ? {
92679
94061
  year: i2.getUTCFullYear(),
92680
94062
  month: i2.getUTCMonth() + 1,
92681
94063
  day: i2.getUTCDate()
92682
- } : null, e = s ? {
92683
- year: s.getUTCFullYear(),
92684
- month: s.getUTCMonth() + 1,
92685
- day: s.getUTCDate()
94064
+ } : null, e = s2 ? {
94065
+ year: s2.getUTCFullYear(),
94066
+ month: s2.getUTCMonth() + 1,
94067
+ day: s2.getUTCDate()
92686
94068
  } : null;
92687
94069
  return r2 === "year" ? { min: n2?.year ?? 1, max: e?.year ?? 9999 } : r2 === "month" ? {
92688
94070
  min: n2 && t2.year === n2.year ? n2.month : 1,
@@ -92725,12 +94107,12 @@ class U extends V {
92725
94107
  this._setUserInput(this.#l(this.#t)), this._setValue(C(this.#t) ?? undefined);
92726
94108
  }
92727
94109
  constructor(t2) {
92728
- const i2 = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale), s = t2.separator ?? i2.separator, n2 = t2.format ? M(t2.format) : i2.segments, e = t2.initialValue ?? t2.defaultValue, m2 = e ? {
94110
+ const i2 = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale), s2 = t2.separator ?? i2.separator, n2 = t2.format ? M(t2.format) : i2.segments, e = t2.initialValue ?? t2.defaultValue, m2 = e ? {
92729
94111
  year: String(e.getUTCFullYear()).padStart(4, "0"),
92730
94112
  month: String(e.getUTCMonth() + 1).padStart(2, "0"),
92731
94113
  day: String(e.getUTCDate()).padStart(2, "0")
92732
- } : { year: "____", month: "__", day: "__" }, o2 = n2.map((a2) => m2[a2.type]).join(s);
92733
- super({ ...t2, initialUserInput: o2 }, false), this.#i = n2, this.#o = s, this.#t = m2, this.#h = t2.minDate, this.#u = t2.maxDate, this.#r(), this.on("cursor", (a2) => this.#f(a2)), this.on("key", (a2, u2) => this.#y(a2, u2)), this.on("finalize", () => this.#p(t2));
94114
+ } : { year: "____", month: "__", day: "__" }, o3 = n2.map((a2) => m2[a2.type]).join(s2);
94115
+ super({ ...t2, initialUserInput: o3 }, false), this.#i = n2, this.#o = s2, this.#t = m2, this.#h = t2.minDate, this.#u = t2.maxDate, this.#r(), this.on("cursor", (a2) => this.#f(a2)), this.on("key", (a2, u2) => this.#y(a2, u2)), this.on("finalize", () => this.#p(t2));
92734
94116
  }
92735
94117
  #a() {
92736
94118
  const t2 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i2 = this.#i[t2];
@@ -92746,11 +94128,11 @@ class U extends V {
92746
94128
  const i2 = this.#a();
92747
94129
  if (!i2)
92748
94130
  return;
92749
- const { segment: s } = i2, n2 = this.#t[s.type], e = !n2 || n2.replace(/_/g, "") === "", m2 = Number.parseInt((n2 || "0").replace(/_/g, "0"), 10) || 0, o2 = T2(s.type, f(this.#t), this.#h, this.#u);
94131
+ const { segment: s2 } = i2, n2 = this.#t[s2.type], e = !n2 || n2.replace(/_/g, "") === "", m2 = Number.parseInt((n2 || "0").replace(/_/g, "0"), 10) || 0, o3 = T2(s2.type, f(this.#t), this.#h, this.#u);
92750
94132
  let a2;
92751
- e ? a2 = t2 === 1 ? o2.min : o2.max : a2 = Math.max(Math.min(o2.max, m2 + t2), o2.min), this.#t = {
94133
+ e ? a2 = t2 === 1 ? o3.min : o3.max : a2 = Math.max(Math.min(o3.max, m2 + t2), o3.min), this.#t = {
92752
94134
  ...this.#t,
92753
- [s.type]: a2.toString().padStart(s.len, "0")
94135
+ [s2.type]: a2.toString().padStart(s2.len, "0")
92754
94136
  }, this.#n = true, this.#s = null, this.#r();
92755
94137
  }
92756
94138
  #f(t2) {
@@ -92803,15 +94185,15 @@ class U extends V {
92803
94185
  return;
92804
94186
  }
92805
94187
  this.#n && !m2 && (this.#t[e.type] = "_".repeat(e.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
92806
- const o2 = this.#t[e.type], a2 = o2.indexOf("_"), u2 = a2 >= 0 ? a2 : Math.min(this.#e.positionInSegment, e.len - 1);
94188
+ const o3 = this.#t[e.type], a2 = o3.indexOf("_"), u2 = a2 >= 0 ? a2 : Math.min(this.#e.positionInSegment, e.len - 1);
92807
94189
  if (u2 < 0 || u2 >= e.len)
92808
94190
  return;
92809
- let l = o2.slice(0, u2) + t2 + o2.slice(u2 + 1), D = false;
92810
- if (u2 === 0 && o2 === "__" && (e.type === "month" || e.type === "day")) {
94191
+ let l = o3.slice(0, u2) + t2 + o3.slice(u2 + 1), D = false;
94192
+ if (u2 === 0 && o3 === "__" && (e.type === "month" || e.type === "day")) {
92811
94193
  const h2 = Number.parseInt(t2, 10);
92812
94194
  l = `0${t2}`, D = h2 <= (e.type === "month" ? 1 : 2);
92813
94195
  }
92814
- if (e.type === "year" && (l = (o2.replace(/_/g, "") + t2).padStart(e.len, "_")), !l.includes("_")) {
94196
+ if (e.type === "year" && (l = (o3.replace(/_/g, "") + t2).padStart(e.len, "_")), !l.includes("_")) {
92815
94197
  const h2 = { ...this.#t, [e.type]: l }, d = this.#g(h2, e);
92816
94198
  if (d) {
92817
94199
  this.inlineError = d;
@@ -92834,16 +94216,16 @@ class U extends V {
92834
94216
  }
92835
94217
  }
92836
94218
  #g(t2, i2) {
92837
- const { month: s, day: n2 } = f(t2);
92838
- if (i2.type === "month" && (s < 0 || s > 12))
94219
+ const { month: s2, day: n2 } = f(t2);
94220
+ if (i2.type === "month" && (s2 < 0 || s2 > 12))
92839
94221
  return settings.date.messages.invalidMonth;
92840
94222
  if (i2.type === "day" && (n2 < 0 || n2 > 31))
92841
94223
  return settings.date.messages.invalidDay(31, "any month");
92842
94224
  }
92843
94225
  #p(t2) {
92844
- const { year: i2, month: s, day: n2 } = f(this.#t);
92845
- if (i2 && s && n2) {
92846
- const e = c3(i2, s);
94226
+ const { year: i2, month: s2, day: n2 } = f(this.#t);
94227
+ if (i2 && s2 && n2) {
94228
+ const e = c3(i2, s2);
92847
94229
  this.#t = {
92848
94230
  ...this.#t,
92849
94231
  day: String(Math.min(n2, e)).padStart(2, "0")
@@ -92861,13 +94243,13 @@ var u$1 = class u2 extends V {
92861
94243
  }
92862
94244
  isGroupSelected(t2) {
92863
94245
  const r2 = this.getGroupItems(t2), e = this.value;
92864
- return e === undefined ? false : r2.every((s) => e.includes(s.value));
94246
+ return e === undefined ? false : r2.every((s2) => e.includes(s2.value));
92865
94247
  }
92866
94248
  toggleValue() {
92867
94249
  const t2 = this.options[this.cursor];
92868
94250
  if (this.value === undefined && (this.value = []), t2.group === true) {
92869
94251
  const r2 = t2.value, e = this.getGroupItems(r2);
92870
- this.isGroupSelected(r2) ? this.value = this.value.filter((s) => e.findIndex((i2) => i2.value === s) === -1) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
94252
+ this.isGroupSelected(r2) ? this.value = this.value.filter((s2) => e.findIndex((i2) => i2.value === s2) === -1) : this.value = [...this.value, ...e.map((s2) => s2.value)], this.value = Array.from(new Set(this.value));
92871
94253
  } else {
92872
94254
  const r2 = this.value.includes(t2.value);
92873
94255
  this.value = r2 ? this.value.filter((e) => e !== t2.value) : [...this.value, t2.value];
@@ -92876,23 +94258,23 @@ var u$1 = class u2 extends V {
92876
94258
  constructor(t2) {
92877
94259
  super(t2, false);
92878
94260
  const { options: r2 } = t2;
92879
- this.#t = t2.selectableGroups !== false, this.options = Object.entries(r2).flatMap(([e, s]) => [
94261
+ this.#t = t2.selectableGroups !== false, this.options = Object.entries(r2).flatMap(([e, s2]) => [
92880
94262
  { value: e, group: true, label: e },
92881
- ...s.map((i2) => ({ ...i2, group: e }))
94263
+ ...s2.map((i2) => ({ ...i2, group: e }))
92882
94264
  ]), this.value = [...t2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t2.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e) => {
92883
94265
  switch (e) {
92884
94266
  case "left":
92885
94267
  case "up": {
92886
94268
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
92887
- const s = this.options[this.cursor]?.group === true;
92888
- !this.#t && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
94269
+ const s2 = this.options[this.cursor]?.group === true;
94270
+ !this.#t && s2 && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
92889
94271
  break;
92890
94272
  }
92891
94273
  case "down":
92892
94274
  case "right": {
92893
94275
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
92894
- const s = this.options[this.cursor]?.group === true;
92895
- !this.#t && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
94276
+ const s2 = this.options[this.cursor]?.group === true;
94277
+ !this.#t && s2 && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
92896
94278
  break;
92897
94279
  }
92898
94280
  case "space":
@@ -92914,10 +94296,10 @@ class h2 extends V {
92914
94296
  const t2 = this.userInput;
92915
94297
  if (this.cursor >= t2.length)
92916
94298
  return `${t2}\u2588`;
92917
- const s = t2.slice(0, this.cursor), r2 = t2[this.cursor], e = t2.slice(this.cursor + 1);
94299
+ const s2 = t2.slice(0, this.cursor), r2 = t2[this.cursor], e = t2.slice(this.cursor + 1);
92918
94300
  return r2 === `
92919
- ` ? `${s}\u2588
92920
- ${e}` : `${s}${styleText("inverse", r2)}${e}`;
94301
+ ` ? `${s2}\u2588
94302
+ ${e}` : `${s2}${styleText("inverse", r2)}${e}`;
92921
94303
  }
92922
94304
  get cursor() {
92923
94305
  return this._cursor;
@@ -92930,23 +94312,23 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
92930
94312
  this._setUserInput(this.userInput.slice(0, this.cursor) + t2 + this.userInput.slice(this.cursor));
92931
94313
  }
92932
94314
  #i(t2) {
92933
- const s = this.value ?? "";
94315
+ const s2 = this.value ?? "";
92934
94316
  switch (t2) {
92935
94317
  case "up":
92936
- this._cursor = findTextCursor(this._cursor, 0, -1, s);
94318
+ this._cursor = findTextCursor(this._cursor, 0, -1, s2);
92937
94319
  return;
92938
94320
  case "down":
92939
- this._cursor = findTextCursor(this._cursor, 0, 1, s);
94321
+ this._cursor = findTextCursor(this._cursor, 0, 1, s2);
92940
94322
  return;
92941
94323
  case "left":
92942
- this._cursor = findTextCursor(this._cursor, -1, 0, s);
94324
+ this._cursor = findTextCursor(this._cursor, -1, 0, s2);
92943
94325
  return;
92944
94326
  case "right":
92945
- this._cursor = findTextCursor(this._cursor, 1, 0, s);
94327
+ this._cursor = findTextCursor(this._cursor, 1, 0, s2);
92946
94328
  return;
92947
94329
  }
92948
94330
  }
92949
- _shouldSubmit(t2, s) {
94331
+ _shouldSubmit(t2, s2) {
92950
94332
  if (this.#t)
92951
94333
  return this.focused === "submit" ? true : (this.#r(`
92952
94334
  `), this._cursor++, false);
@@ -92956,12 +94338,12 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
92956
94338
  `), this._cursor++, false);
92957
94339
  }
92958
94340
  constructor(t2) {
92959
- super(t2, false), this.#t = t2.showSubmit ?? false, this.on("key", (s, r2) => {
94341
+ super(t2, false), this.#t = t2.showSubmit ?? false, this.on("key", (s2, r2) => {
92960
94342
  if (r2?.name && o$1.has(r2.name)) {
92961
94343
  this.#i(r2.name);
92962
94344
  return;
92963
94345
  }
92964
- if (s === "\t" && this.#t) {
94346
+ if (s2 === "\t" && this.#t) {
92965
94347
  this.focused = this.focused === "editor" ? "submit" : "editor";
92966
94348
  return;
92967
94349
  }
@@ -92974,10 +94356,10 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
92974
94356
  this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
92975
94357
  return;
92976
94358
  }
92977
- s && (this.#t && this.focused === "submit" && (this.focused = "editor"), this.#r(s ?? ""), this._cursor++);
94359
+ s2 && (this.#t && this.focused === "submit" && (this.focused = "editor"), this.#r(s2 ?? ""), this._cursor++);
92978
94360
  }
92979
- }), this.on("userInput", (s) => {
92980
- this._setValue(s);
94361
+ }), this.on("userInput", (s2) => {
94362
+ this._setValue(s2);
92981
94363
  }), this.on("finalize", () => {
92982
94364
  this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
92983
94365
  });
@@ -92994,9 +94376,9 @@ class a2 extends V {
92994
94376
  }
92995
94377
  constructor(t2) {
92996
94378
  super(t2, false), this.options = t2.options;
92997
- const i2 = this.options.findIndex(({ value: s }) => s === t2.initialValue), e = i2 === -1 ? 0 : i2;
92998
- this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (s) => {
92999
- switch (s) {
94379
+ const i2 = this.options.findIndex(({ value: s2 }) => s2 === t2.initialValue), e = i2 === -1 ? 0 : i2;
94380
+ this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (s2) => {
94381
+ switch (s2) {
93000
94382
  case "left":
93001
94383
  case "up":
93002
94384
  this.cursor = findCursor(this.cursor, -1, this.options);
@@ -93017,8 +94399,8 @@ class n2 extends V {
93017
94399
  const t2 = this.userInput;
93018
94400
  if (this.cursor >= t2.length)
93019
94401
  return `${this.userInput}\u2588`;
93020
- const e = t2.slice(0, this.cursor), [s, ...r2] = t2.slice(this.cursor);
93021
- return `${e}${styleText("inverse", s)}${r2.join("")}`;
94402
+ const e = t2.slice(0, this.cursor), [s2, ...r2] = t2.slice(this.cursor);
94403
+ return `${e}${styleText("inverse", s2)}${r2.join("")}`;
93022
94404
  }
93023
94405
  get cursor() {
93024
94406
  return this._cursor;
@@ -93046,7 +94428,7 @@ function isUnicodeSupported2() {
93046
94428
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
93047
94429
  }
93048
94430
  var unicode = isUnicodeSupported2();
93049
- var unicodeOr = (e, o3) => unicode ? e : o3;
94431
+ var unicodeOr = (e, o4) => unicode ? e : o4;
93050
94432
  var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
93051
94433
  var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
93052
94434
  var S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -93098,8 +94480,8 @@ var symbolBar = (e) => {
93098
94480
  return styleText2("green", S_BAR);
93099
94481
  }
93100
94482
  };
93101
- var E$1 = (l, o3, g3, c4, h3, O = false) => {
93102
- let r3 = o3, w = 0;
94483
+ var E$1 = (l, o4, g3, c4, h3, O = false) => {
94484
+ let r3 = o4, w = 0;
93103
94485
  if (O)
93104
94486
  for (let i2 = c4 - 1;i2 >= g3 && (r3 -= l[i2].length, w++, !(r3 <= h3)); i2--)
93105
94487
  ;
@@ -93110,7 +94492,7 @@ var E$1 = (l, o3, g3, c4, h3, O = false) => {
93110
94492
  };
93111
94493
  var limitOptions = ({
93112
94494
  cursor: l,
93113
- options: o3,
94495
+ options: o4,
93114
94496
  style: g3,
93115
94497
  output: c4 = process.stdout,
93116
94498
  maxItems: h3 = Number.POSITIVE_INFINITY,
@@ -93119,14 +94501,14 @@ var limitOptions = ({
93119
94501
  }) => {
93120
94502
  const i2 = getColumns2(c4) - O, I = getRows(c4), C2 = styleText2("dim", "..."), x = Math.max(I - r3, 0), m2 = Math.max(Math.min(h3, x), 5);
93121
94503
  let p3 = 0;
93122
- l >= m2 - 3 && (p3 = Math.max(Math.min(l - m2 + 3, o3.length - m2), 0));
93123
- let f2 = m2 < o3.length && p3 > 0, u4 = m2 < o3.length && p3 + m2 < o3.length;
93124
- const W = Math.min(p3 + m2, o3.length), e = [];
94504
+ l >= m2 - 3 && (p3 = Math.max(Math.min(l - m2 + 3, o4.length - m2), 0));
94505
+ let f2 = m2 < o4.length && p3 > 0, u4 = m2 < o4.length && p3 + m2 < o4.length;
94506
+ const W = Math.min(p3 + m2, o4.length), e = [];
93125
94507
  let d = 0;
93126
94508
  f2 && d++, u4 && d++;
93127
94509
  const v = p3 + (f2 ? 1 : 0), P2 = W - (u4 ? 1 : 0);
93128
94510
  for (let t2 = v;t2 < P2; t2++) {
93129
- const n3 = wrapAnsi(g3(o3[t2], t2 === l), i2, {
94511
+ const n3 = wrapAnsi(g3(o4[t2], t2 === l), i2, {
93130
94512
  hard: true,
93131
94513
  trim: false
93132
94514
  }).split(`
@@ -93134,11 +94516,11 @@ var limitOptions = ({
93134
94516
  e.push(n3), d += n3.length;
93135
94517
  }
93136
94518
  if (d > x) {
93137
- let t2 = 0, n3 = 0, s = d;
94519
+ let t2 = 0, n3 = 0, s2 = d;
93138
94520
  const M2 = l - v;
93139
94521
  let a3 = x;
93140
- const T3 = () => E$1(e, s, 0, M2, a3), L = () => E$1(e, s, M2 + 1, e.length, a3, true);
93141
- f2 ? ({ lineCount: s, removals: t2 } = T3(), s > a3 && (u4 || (a3 -= 1), { lineCount: s, removals: n3 } = L())) : (u4 || (a3 -= 1), { lineCount: s, removals: n3 } = L(), s > a3 && (a3 -= 1, { lineCount: s, removals: t2 } = T3())), t2 > 0 && (f2 = true, e.splice(0, t2)), n3 > 0 && (u4 = true, e.splice(e.length - n3, n3));
94522
+ const T3 = () => E$1(e, s2, 0, M2, a3), L = () => E$1(e, s2, M2 + 1, e.length, a3, true);
94523
+ f2 ? ({ lineCount: s2, removals: t2 } = T3(), s2 > a3 && (u4 || (a3 -= 1), { lineCount: s2, removals: n3 } = L())) : (u4 || (a3 -= 1), { lineCount: s2, removals: n3 } = L(), s2 > a3 && (a3 -= 1, { lineCount: s2, removals: t2 } = T3())), t2 > 0 && (f2 = true, e.splice(0, t2)), n3 > 0 && (u4 = true, e.splice(e.length - n3, n3));
93142
94524
  }
93143
94525
  const b2 = [];
93144
94526
  f2 && b2.push(C2);
@@ -93158,18 +94540,18 @@ var c4 = (e, a3) => e.includes(`
93158
94540
  `) : a3(e);
93159
94541
  var select3 = (e) => {
93160
94542
  const a3 = (t2, d) => {
93161
- const s = t2.label ?? String(t2.value);
94543
+ const s2 = t2.label ?? String(t2.value);
93162
94544
  switch (d) {
93163
94545
  case "disabled":
93164
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(s, (n3) => styleText2("gray", n3))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}`;
94546
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(s2, (n3) => styleText2("gray", n3))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}`;
93165
94547
  case "selected":
93166
- return `${c4(s, (n3) => styleText2("dim", n3))}`;
94548
+ return `${c4(s2, (n3) => styleText2("dim", n3))}`;
93167
94549
  case "active":
93168
- return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}`;
94550
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}`;
93169
94551
  case "cancelled":
93170
- return `${c4(s, (n3) => styleText2(["strikethrough", "dim"], n3))}`;
94552
+ return `${c4(s2, (n3) => styleText2(["strikethrough", "dim"], n3))}`;
93171
94553
  default:
93172
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(s, (n3) => styleText2("dim", n3))}`;
94554
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(s2, (n3) => styleText2("dim", n3))}`;
93173
94555
  }
93174
94556
  };
93175
94557
  return new a2({
@@ -93179,7 +94561,7 @@ var select3 = (e) => {
93179
94561
  output: e.output,
93180
94562
  initialValue: e.initialValue,
93181
94563
  render() {
93182
- const t2 = e.withGuide ?? settings.withGuide, d = `${symbol2(this.state)} `, s = `${symbolBar(this.state)} `, n3 = wrapTextWithPrefix(e.output, e.message, s, d), u5 = `${t2 ? `${styleText2("gray", S_BAR)}
94564
+ const t2 = e.withGuide ?? settings.withGuide, d = `${symbol2(this.state)} `, s2 = `${symbolBar(this.state)} `, n3 = wrapTextWithPrefix(e.output, e.message, s2, d), u5 = `${t2 ? `${styleText2("gray", S_BAR)}
93183
94565
  ` : ""}${n3}
93184
94566
  `;
93185
94567
  switch (this.state) {
@@ -93222,29 +94604,29 @@ var text4 = (t2) => new n2({
93222
94604
  signal: t2.signal,
93223
94605
  input: t2.input,
93224
94606
  render() {
93225
- const i3 = t2?.withGuide ?? settings.withGuide, s = `${`${i3 ? `${styleText2("gray", S_BAR)}
94607
+ const i3 = t2?.withGuide ?? settings.withGuide, s2 = `${`${i3 ? `${styleText2("gray", S_BAR)}
93226
94608
  ` : ""}${symbol2(this.state)} `}${t2.message}
93227
- `, c5 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o3 = this.userInput ? this.userInputWithCursor : c5, a3 = this.value ?? "";
94609
+ `, c5 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o4 = this.userInput ? this.userInputWithCursor : c5, a3 = this.value ?? "";
93228
94610
  switch (this.state) {
93229
94611
  case "error": {
93230
94612
  const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r3 = i3 ? `${styleText2("yellow", S_BAR)} ` : "", d = i3 ? styleText2("yellow", S_BAR_END) : "";
93231
- return `${s.trim()}
93232
- ${r3}${o3}
94613
+ return `${s2.trim()}
94614
+ ${r3}${o4}
93233
94615
  ${d}${n3}
93234
94616
  `;
93235
94617
  }
93236
94618
  case "submit": {
93237
94619
  const n3 = a3 ? ` ${styleText2("dim", a3)}` : "", r3 = i3 ? styleText2("gray", S_BAR) : "";
93238
- return `${s}${r3}${n3}`;
94620
+ return `${s2}${r3}${n3}`;
93239
94621
  }
93240
94622
  case "cancel": {
93241
94623
  const n3 = a3 ? ` ${styleText2(["strikethrough", "dim"], a3)}` : "", r3 = i3 ? styleText2("gray", S_BAR) : "";
93242
- return `${s}${r3}${n3}${a3.trim() ? `
94624
+ return `${s2}${r3}${n3}${a3.trim() ? `
93243
94625
  ${r3}` : ""}`;
93244
94626
  }
93245
94627
  default: {
93246
94628
  const n3 = i3 ? `${styleText2("cyan", S_BAR)} ` : "", r3 = i3 ? styleText2("cyan", S_BAR_END) : "";
93247
- return `${s}${n3}${o3}
94629
+ return `${s2}${n3}${o4}
93248
94630
  ${r3}
93249
94631
  `;
93250
94632
  }