@gobing-ai/spur 0.3.98 → 0.3.99

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 (77) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/config/plugin-scripts.json +5 -0
  3. package/config/templates/task/brainstorm.md +1 -1
  4. package/config/templates/task/feature-impl.md +1 -1
  5. package/config/templates/task/issue.md +1 -1
  6. package/config/templates/task/meta.md +1 -1
  7. package/config/templates/task/review.md +1 -1
  8. package/config/templates/task/standard.md +1 -1
  9. package/package.json +9 -9
  10. package/plugins/sp/lib/idea-handoff.generated.mjs +37 -4
  11. package/plugins/sp/lib/inline-run.generated.mjs +38 -5
  12. package/plugins/sp/lib/residual-scan.generated.d.mts +5 -0
  13. package/plugins/sp/lib/residual-scan.generated.mjs +45 -5
  14. package/plugins/sp/plugin.json +1 -1
  15. package/plugins/sp/scripts/persist-out-check.mjs +164 -0
  16. package/plugins/sp/scripts/persist-out-check.ts +185 -0
  17. package/plugins/sp/scripts/residual-scan.mjs +50 -8
  18. package/plugins/sp/scripts/residual-scan.ts +4 -3
  19. package/plugins/sp/scripts/task-diffstat.mjs +17 -5
  20. package/plugins/sp/scripts/task-diffstat.ts +25 -4
  21. package/plugins/sp/skills/code-verification/SKILL.md +3 -0
  22. package/plugins/sp/skills/code-verification/references/verdict-schema.md +17 -1
  23. package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +40 -7
  24. package/plugins/sp/skills/spur-dev/references/execution-batch.md +216 -37
  25. package/plugins/sp/skills/spur-dev/references/execution-workflow.md +3 -1
  26. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +107 -3
  27. package/spur.js +1662 -386
  28. package/web/_astro/{BoardApp.CYbe-OTb.js → BoardApp.BVp-LYi6.js} +101 -101
  29. package/web/_astro/{BoardApp.Dflq5a8x.js → BoardApp.i4eh_fHA.js} +1 -1
  30. package/web/_astro/{TaskDetail.CK7oXddP.js → TaskDetail.C5Cu8LdB.js} +1 -1
  31. package/web/_astro/{arc.BIqkDATc.js → arc.Bu5XpBEz.js} +1 -1
  32. package/web/_astro/{architectureDiagram-3BPJPVTR.D0B3SvWv.js → architectureDiagram-3BPJPVTR.9vHQTvhF.js} +1 -1
  33. package/web/_astro/{blockDiagram-GPEHLZMM.C2YyKQmL.js → blockDiagram-GPEHLZMM.Cn2Xl7D6.js} +1 -1
  34. package/web/_astro/{c4Diagram-AAUBKEIU.DmtTYrt_.js → c4Diagram-AAUBKEIU.7o0P_QDo.js} +1 -1
  35. package/web/_astro/channel.6IFIKBhu.js +1 -0
  36. package/web/_astro/{chunk-2J33WTMH.HsRXbh7l.js → chunk-2J33WTMH.C3zZFsNt.js} +1 -1
  37. package/web/_astro/{chunk-4BX2VUAB.obE_P-R3.js → chunk-4BX2VUAB.CNy_M7fO.js} +1 -1
  38. package/web/_astro/{chunk-55IACEB6.CjWTF5mz.js → chunk-55IACEB6.2TiPnLBL.js} +1 -1
  39. package/web/_astro/{chunk-727SXJPM.DMo799Ax.js → chunk-727SXJPM.5CGSyKAp.js} +1 -1
  40. package/web/_astro/{chunk-AQP2D5EJ.-cE6JOKZ.js → chunk-AQP2D5EJ.w-ZIgfsK.js} +1 -1
  41. package/web/_astro/{chunk-FMBD7UC4.D6Rw6HIk.js → chunk-FMBD7UC4.BkcEyhKa.js} +1 -1
  42. package/web/_astro/{chunk-ND2GUHAM.d5rBD73Z.js → chunk-ND2GUHAM.mxKKbBG4.js} +1 -1
  43. package/web/_astro/{chunk-QZHKN3VN.r3ox40Q3.js → chunk-QZHKN3VN.cyA0z9aT.js} +1 -1
  44. package/web/_astro/{classDiagram-4FO5ZUOK.CGGbvjjJ.js → classDiagram-4FO5ZUOK.CqtUzwhX.js} +1 -1
  45. package/web/_astro/{classDiagram-v2-Q7XG4LA2.CGGbvjjJ.js → classDiagram-v2-Q7XG4LA2.CqtUzwhX.js} +1 -1
  46. package/web/_astro/{cose-bilkent-S5V4N54A.CmKtPd4l.js → cose-bilkent-S5V4N54A.BExPTopI.js} +1 -1
  47. package/web/_astro/{cynefin-OW5HDTMX.QNg5GXs8.js → cynefin-OW5HDTMX.Bq2i10Cn.js} +1 -1
  48. package/web/_astro/{dagre-BM42HDAG.B1SabsjC.js → dagre-BM42HDAG.By_HsOuv.js} +1 -1
  49. package/web/_astro/{diagram-2AECGRRQ.RtDbNj89.js → diagram-2AECGRRQ.BtU0b7hz.js} +1 -1
  50. package/web/_astro/{diagram-5GNKFQAL.IzZpuM-Y.js → diagram-5GNKFQAL.D00ztMdT.js} +1 -1
  51. package/web/_astro/{diagram-KO2AKTUF.DPTF_fgv.js → diagram-KO2AKTUF.DMVJWaUN.js} +1 -1
  52. package/web/_astro/{diagram-LMA3HP47.CCyza39P.js → diagram-LMA3HP47.Cxqrjg5-.js} +1 -1
  53. package/web/_astro/{diagram-OG6HWLK6.BXAi8zcZ.js → diagram-OG6HWLK6.2lz_1B5h.js} +1 -1
  54. package/web/_astro/{erDiagram-TEJ5UH35.DUDX7_MR.js → erDiagram-TEJ5UH35.BVQEuJ3T.js} +1 -1
  55. package/web/_astro/{flowDiagram-I6XJVG4X.C63QTh3N.js → flowDiagram-I6XJVG4X.Qlyo90ky.js} +1 -1
  56. package/web/_astro/{ganttDiagram-6RSMTGT7.CnlZJSwG.js → ganttDiagram-6RSMTGT7.DRwb8HHZ.js} +1 -1
  57. package/web/_astro/{gitGraphDiagram-PVQCEYII.CTqIrOPC.js → gitGraphDiagram-PVQCEYII.YfoPthfS.js} +1 -1
  58. package/web/_astro/{infoDiagram-5YYISTIA.BYMiDFh9.js → infoDiagram-5YYISTIA.DvFREck1.js} +1 -1
  59. package/web/_astro/{ishikawaDiagram-YF4QCWOH.CRiQmI-z.js → ishikawaDiagram-YF4QCWOH.BzCj9Q0-.js} +1 -1
  60. package/web/_astro/{journeyDiagram-JHISSGLW.YQgWBsEU.js → journeyDiagram-JHISSGLW.BDMT_AFb.js} +1 -1
  61. package/web/_astro/{kanban-definition-UN3LZRKU.1ECnrrK1.js → kanban-definition-UN3LZRKU.D6Fh3gj9.js} +1 -1
  62. package/web/_astro/{linear.DzVA71yT.js → linear.Dxw00fGQ.js} +1 -1
  63. package/web/_astro/{mermaid.core.BK7P2Sr_.js → mermaid.core.CsoxUWa0.js} +4 -4
  64. package/web/_astro/{mindmap-definition-RKZ34NQL.BvXyWZK7.js → mindmap-definition-RKZ34NQL.CN8oeHLu.js} +1 -1
  65. package/web/_astro/{pieDiagram-4H26LBE5.BiXk1TW3.js → pieDiagram-4H26LBE5.C7ADqQ_7.js} +1 -1
  66. package/web/_astro/{quadrantDiagram-W4KKPZXB.krvBH8lh.js → quadrantDiagram-W4KKPZXB.Cw9lKyHP.js} +1 -1
  67. package/web/_astro/{requirementDiagram-4Y6WPE33.ih1gL25c.js → requirementDiagram-4Y6WPE33.B1ni-z4q.js} +1 -1
  68. package/web/_astro/{sankeyDiagram-5OEKKPKP.CpUxkv4u.js → sankeyDiagram-5OEKKPKP.BhexdjVr.js} +1 -1
  69. package/web/_astro/{sequenceDiagram-3UESZ5HK.clAfeN7y.js → sequenceDiagram-3UESZ5HK.C3Rm7dpQ.js} +1 -1
  70. package/web/_astro/{stateDiagram-AJRCARHV.DpXWb8-m.js → stateDiagram-AJRCARHV.CkuMt27u.js} +1 -1
  71. package/web/_astro/{stateDiagram-v2-BHNVJYJU.ClZb9GIH.js → stateDiagram-v2-BHNVJYJU.Dc_aazUA.js} +1 -1
  72. package/web/_astro/{timeline-definition-PNZ67QCA.BLcX5dh7.js → timeline-definition-PNZ67QCA.ja7sUFhH.js} +1 -1
  73. package/web/_astro/{vennDiagram-CIIHVFJN.oGgpKMpx.js → vennDiagram-CIIHVFJN.BxIshX_K.js} +1 -1
  74. package/web/_astro/{wardleyDiagram-YWT4CUSO.BPHtMtt-.js → wardleyDiagram-YWT4CUSO.DfHlC0sh.js} +1 -1
  75. package/web/_astro/{xychartDiagram-2RQKCTM6.BNZOPYSk.js → xychartDiagram-2RQKCTM6.DSnhHwCh.js} +1 -1
  76. package/web/index.html +1 -1
  77. package/web/_astro/channel.JuKVyuhZ.js +0 -1
package/spur.js CHANGED
@@ -48,7 +48,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
48
48
  var __promiseAll = (args) => Promise.all(args);
49
49
  var __require = import.meta.require;
50
50
 
51
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/errors.js
51
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/errors.js
52
52
  var ErrorCode, AppError, ValidationError;
53
53
  var init_errors = __esm(() => {
54
54
  ErrorCode = {
@@ -73,7 +73,7 @@ var init_errors = __esm(() => {
73
73
  };
74
74
  });
75
75
 
76
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/api-response.js
76
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/api-response.js
77
77
  var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
78
78
  var init_api_response = __esm(() => {
79
79
  init_errors();
@@ -96,10 +96,10 @@ var init_api_response = __esm(() => {
96
96
  CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
97
97
  });
98
98
 
99
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/cursor.js
99
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/cursor.js
100
100
  var init_cursor = () => {};
101
101
 
102
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/env.js
102
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/env.js
103
103
  function getEnvVar(name, fallback) {
104
104
  const raw = process.env[name];
105
105
  return raw === undefined ? fallback : raw;
@@ -121,10 +121,10 @@ function getAppOptions(config, key, fallback) {
121
121
  return value === undefined || value === null ? fallback : value;
122
122
  }
123
123
 
124
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
124
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
125
125
  var init_event_severity = () => {};
126
126
 
127
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/object.js
127
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/object.js
128
128
  function isPlainObject(value) {
129
129
  return typeof value === "object" && value !== null && !Array.isArray(value);
130
130
  }
@@ -142,7 +142,7 @@ function deepMerge(target, source) {
142
142
  return result;
143
143
  }
144
144
 
145
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/output.js
145
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/output.js
146
146
  function processStream(name) {
147
147
  const proc = globalThis.process;
148
148
  const stream = proc?.[name];
@@ -163,7 +163,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
163
163
  }
164
164
  var defaultStdoutTarget, defaultStderrTarget;
165
165
 
166
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/node_modules/@gobing-ai/ts-utils/dist/index.js
166
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.12/node_modules/@gobing-ai/ts-utils/dist/index.js
167
167
  var init_dist = __esm(() => {
168
168
  init_api_response();
169
169
  init_cursor();
@@ -22435,7 +22435,7 @@ var init_dist2 = __esm(() => {
22435
22435
  $visitAsync = visit.visitAsync;
22436
22436
  });
22437
22437
 
22438
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/config.js
22438
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/config.js
22439
22439
  function getProcessEnv() {
22440
22440
  return getEnvVars();
22441
22441
  }
@@ -22513,7 +22513,7 @@ var init_config = __esm(() => {
22513
22513
  };
22514
22514
  });
22515
22515
 
22516
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
22516
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
22517
22517
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
22518
22518
  import { dirname, resolve as resolvePath } from "path";
22519
22519
  function createNodeFileSystem(root, paths) {
@@ -22600,7 +22600,7 @@ function findProjectRoot(startDir) {
22600
22600
  }
22601
22601
  var init_file_system_node = () => {};
22602
22602
 
22603
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
22603
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
22604
22604
  var DbModuleNotInstalledError;
22605
22605
  var init_db_errors = __esm(() => {
22606
22606
  DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
@@ -29812,7 +29812,7 @@ var init_execa = __esm(() => {
29812
29812
  } = getIpcExport());
29813
29813
  });
29814
29814
 
29815
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/process-group.js
29815
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/process-group.js
29816
29816
  function resolveDeadline(optionTimeout, defaultTimeout) {
29817
29817
  if (optionTimeout === null)
29818
29818
  return null;
@@ -29904,7 +29904,7 @@ function ownProcessGroupLifecycle(ownership) {
29904
29904
  }
29905
29905
  var MAX_TIMEOUT_MS = 2147483647, DEFAULT_KILL_GRACE_MS = 5000, GROUP_POLL_INTERVAL_MS = 25, GROUP_KILL_PATIENCE_MS = 2000;
29906
29906
 
29907
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29907
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
29908
29908
  import { isatty } from "tty";
29909
29909
  function processEventSeverity(reason, exitCode) {
29910
29910
  if (reason === "error")
@@ -30276,7 +30276,7 @@ var init_process_executor = __esm(() => {
30276
30276
  init_config();
30277
30277
  });
30278
30278
 
30279
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
30279
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
30280
30280
  function getNodeFileSystem() {
30281
30281
  if (!_nodeFileSystem)
30282
30282
  _nodeFileSystem = createNodeFileSystem();
@@ -30336,7 +30336,7 @@ var init_runtime_node_bun = __esm(() => {
30336
30336
  };
30337
30337
  });
30338
30338
 
30339
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/context.js
30339
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/context.js
30340
30340
  class RuntimeContext {
30341
30341
  scope;
30342
30342
  runtimeName;
@@ -30406,7 +30406,7 @@ var init_context = __esm(() => {
30406
30406
  init_runtime_node_bun();
30407
30407
  });
30408
30408
 
30409
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/path.js
30409
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/path.js
30410
30410
  function normalizeSeparators(path6) {
30411
30411
  return path6.replaceAll("\\", "/");
30412
30412
  }
@@ -30467,17 +30467,17 @@ var init_path = __esm(() => {
30467
30467
  SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
30468
30468
  });
30469
30469
 
30470
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
30470
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
30471
30471
  var REMOTE_SCHEMA_MAX_BYTES;
30472
30472
  var init_schema_validation = __esm(() => {
30473
30473
  init_dist2();
30474
30474
  REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
30475
30475
  });
30476
30476
 
30477
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/types.js
30477
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/types.js
30478
30478
  var init_types = () => {};
30479
30479
 
30480
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/index.js
30480
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/index.js
30481
30481
  var init_dist3 = __esm(() => {
30482
30482
  init_config();
30483
30483
  init_context();
@@ -30486,7 +30486,7 @@ var init_dist3 = __esm(() => {
30486
30486
  init_types();
30487
30487
  });
30488
30488
 
30489
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+b4a8ba4c78531495/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
30489
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+8e0df62f596ab344/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
30490
30490
  import { Database } from "bun:sqlite";
30491
30491
  var init_bun_sqlite = () => {};
30492
30492
 
@@ -34916,7 +34916,7 @@ var init_bun_sqlite2 = __esm(() => {
34916
34916
  init_session2();
34917
34917
  });
34918
34918
 
34919
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
34919
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
34920
34920
  var inboxMessages;
34921
34921
  var init_inbox_messages = __esm(() => {
34922
34922
  init_sqlite_core();
@@ -34936,7 +34936,7 @@ var init_inbox_messages = __esm(() => {
34936
34936
  }, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
34937
34937
  });
34938
34938
 
34939
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/common.js
34939
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/common.js
34940
34940
  function nowTimestamp() {
34941
34941
  return Date.now();
34942
34942
  }
@@ -34965,7 +34965,7 @@ var init_common3 = __esm(() => {
34965
34965
  appendOnlyColumns = buildAppendOnlyColumns();
34966
34966
  });
34967
34967
 
34968
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
34968
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
34969
34969
  var queueJobs;
34970
34970
  var init_queue_jobs = __esm(() => {
34971
34971
  init_sqlite_core();
@@ -34989,7 +34989,7 @@ var init_queue_jobs = __esm(() => {
34989
34989
  }, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
34990
34990
  });
34991
34991
 
34992
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
34992
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
34993
34993
  var exports_runtime = {};
34994
34994
  __export(exports_runtime, {
34995
34995
  queueJobs: () => queueJobs,
@@ -35000,7 +35000,7 @@ var init_runtime = __esm(() => {
35000
35000
  init_queue_jobs();
35001
35001
  });
35002
35002
 
35003
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
35003
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
35004
35004
  var exports_bun_sqlite = {};
35005
35005
  __export(exports_bun_sqlite, {
35006
35006
  BunSqliteAdapter: () => BunSqliteAdapter
@@ -35311,7 +35311,7 @@ var init_d1 = __esm(() => {
35311
35311
  init_session3();
35312
35312
  });
35313
35313
 
35314
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
35314
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
35315
35315
  var exports_d1 = {};
35316
35316
  __export(exports_d1, {
35317
35317
  D1Adapter: () => D1Adapter
@@ -35375,7 +35375,7 @@ var init_d12 = __esm(() => {
35375
35375
  init_runtime();
35376
35376
  });
35377
35377
 
35378
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/adapter.js
35378
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/adapter.js
35379
35379
  async function createDbAdapter(config3) {
35380
35380
  switch (config3.driver) {
35381
35381
  case "bun-sqlite": {
@@ -35409,7 +35409,7 @@ var init_drizzle_orm = __esm(() => {
35409
35409
  init_view_common();
35410
35410
  });
35411
35411
 
35412
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/query-spec.js
35412
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/query-spec.js
35413
35413
  function compilePredicate(predicate) {
35414
35414
  if ("and" in predicate) {
35415
35415
  const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
@@ -35447,7 +35447,7 @@ var init_query_spec = __esm(() => {
35447
35447
  };
35448
35448
  });
35449
35449
 
35450
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/base-dao.js
35450
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/base-dao.js
35451
35451
  function asSelectQuery(query) {
35452
35452
  return query;
35453
35453
  }
@@ -35489,7 +35489,7 @@ var init_base_dao = __esm(() => {
35489
35489
  init_query_spec();
35490
35490
  });
35491
35491
 
35492
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
35492
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
35493
35493
  var embeddedMigrations;
35494
35494
  var init_embedded_migrations = __esm(() => {
35495
35495
  embeddedMigrations = [
@@ -35531,7 +35531,7 @@ var init_embedded_migrations = __esm(() => {
35531
35531
  ];
35532
35532
  });
35533
35533
 
35534
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
35534
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
35535
35535
  var EntityDao;
35536
35536
  var init_entity_dao = __esm(() => {
35537
35537
  init_drizzle_orm();
@@ -35693,7 +35693,7 @@ var init_entity_dao = __esm(() => {
35693
35693
  };
35694
35694
  });
35695
35695
 
35696
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
35696
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
35697
35697
  function isPromiseLike(value) {
35698
35698
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
35699
35699
  }
@@ -35935,7 +35935,7 @@ var init_migrator2 = __esm(() => {
35935
35935
  init_migrator();
35936
35936
  });
35937
35937
 
35938
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/migrate.js
35938
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/migrate.js
35939
35939
  async function ensureJournalTable(adapter, table3) {
35940
35940
  await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
35941
35941
  }
@@ -36010,7 +36010,7 @@ var init_migrate = __esm(() => {
36010
36010
  init_embedded_migrations();
36011
36011
  });
36012
36012
 
36013
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
36013
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
36014
36014
  function assertValidTimeoutMs(value) {
36015
36015
  if (value === undefined || value === null)
36016
36016
  return;
@@ -36233,7 +36233,7 @@ var init_queue_job_dao = __esm(() => {
36233
36233
  };
36234
36234
  });
36235
36235
 
36236
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/index.js
36236
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/index.js
36237
36237
  var exports_dist = {};
36238
36238
  __export(exports_dist, {
36239
36239
  embeddedMigrations: () => embeddedMigrations,
@@ -38367,7 +38367,7 @@ var require_extra_typings = __commonJS((exports, module) => {
38367
38367
  exports.createArgument = (name, description) => new commander.Argument(name, description);
38368
38368
  });
38369
38369
 
38370
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/config.js
38370
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/config.js
38371
38371
  function parseYamlObject(text3) {
38372
38372
  let parsed;
38373
38373
  try {
@@ -38494,7 +38494,7 @@ var init_config2 = __esm(() => {
38494
38494
  };
38495
38495
  });
38496
38496
 
38497
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
38497
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
38498
38498
  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";
38499
38499
  import { dirname as dirname2, resolve as resolvePath3 } from "path";
38500
38500
  function createNodeFileSystem3(root, paths) {
@@ -38581,7 +38581,7 @@ function findProjectRoot3(startDir) {
38581
38581
  }
38582
38582
  var init_file_system_node2 = () => {};
38583
38583
 
38584
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
38584
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
38585
38585
  var D1NotConfiguredError2, DbModuleNotInstalledError3;
38586
38586
  var init_db_errors2 = __esm(() => {
38587
38587
  D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
@@ -38598,7 +38598,7 @@ var init_db_errors2 = __esm(() => {
38598
38598
  };
38599
38599
  });
38600
38600
 
38601
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
38601
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
38602
38602
  function createCfFileSystem2() {
38603
38603
  return {
38604
38604
  getProjectRoot: () => "/bundle",
@@ -38637,7 +38637,7 @@ function createCfFileSystem2() {
38637
38637
  }
38638
38638
  var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
38639
38639
 
38640
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
38640
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
38641
38641
  var exports_runtime_cf = {};
38642
38642
  __export(exports_runtime_cf, {
38643
38643
  cloudflareWorkersFactory: () => cloudflareWorkersFactory2
@@ -38675,7 +38675,7 @@ var init_runtime_cf = __esm(() => {
38675
38675
  };
38676
38676
  });
38677
38677
 
38678
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/process-group.js
38678
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/process-group.js
38679
38679
  function resolveDeadline2(optionTimeout, defaultTimeout) {
38680
38680
  if (optionTimeout === null)
38681
38681
  return null;
@@ -38767,7 +38767,7 @@ function ownProcessGroupLifecycle2(ownership) {
38767
38767
  }
38768
38768
  var MAX_TIMEOUT_MS2 = 2147483647, DEFAULT_KILL_GRACE_MS2 = 5000, GROUP_POLL_INTERVAL_MS2 = 25, GROUP_KILL_PATIENCE_MS2 = 2000;
38769
38769
 
38770
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
38770
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
38771
38771
  import { spawnSync as spawnSync2 } from "child_process";
38772
38772
  import { isatty as isatty2 } from "tty";
38773
38773
  function processEventSeverity2(reason, exitCode) {
@@ -39211,7 +39211,7 @@ var init_process_executor2 = __esm(() => {
39211
39211
  ProcessExecutor2 = NodeProcessExecutor3;
39212
39212
  });
39213
39213
 
39214
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
39214
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
39215
39215
  var exports_runtime_node_bun = {};
39216
39216
  __export(exports_runtime_node_bun, {
39217
39217
  nodeBunFactory: () => nodeBunFactory3,
@@ -39279,7 +39279,7 @@ var init_runtime_node_bun2 = __esm(() => {
39279
39279
  };
39280
39280
  });
39281
39281
 
39282
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/platform.js
39282
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/platform.js
39283
39283
  function isCloudflareWorkerRuntime2() {
39284
39284
  return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
39285
39285
  }
@@ -39309,7 +39309,7 @@ function _resetRuntimeFactory2() {
39309
39309
  }
39310
39310
  var _factory, _runtimeName;
39311
39311
 
39312
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/context.js
39312
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/context.js
39313
39313
  class RuntimeContext2 {
39314
39314
  scope;
39315
39315
  runtimeName;
@@ -39399,7 +39399,7 @@ var init_context2 = __esm(() => {
39399
39399
  init_runtime_node_bun2();
39400
39400
  });
39401
39401
 
39402
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/path.js
39402
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/path.js
39403
39403
  function normalizeSeparators2(path7) {
39404
39404
  return path7.replaceAll("\\", "/");
39405
39405
  }
@@ -39522,7 +39522,7 @@ var init_path2 = __esm(() => {
39522
39522
  SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
39523
39523
  });
39524
39524
 
39525
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/fs.js
39525
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/fs.js
39526
39526
  async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
39527
39527
  await fs2.ensureDir(dirnamePath(path7));
39528
39528
  }
@@ -39590,7 +39590,7 @@ var init_fs = __esm(() => {
39590
39590
  init_path2();
39591
39591
  });
39592
39592
 
39593
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
39593
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
39594
39594
  function allocateId() {
39595
39595
  nextIdSeq += 1;
39596
39596
  return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
@@ -39714,7 +39714,7 @@ function createInMemoryProcessRegistry2(options) {
39714
39714
  }
39715
39715
  var nextIdSeq = 0;
39716
39716
 
39717
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
39717
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
39718
39718
  function ambientRuntimePaths2() {
39719
39719
  const cwd = getProcessCwd2();
39720
39720
  return { cwd, home: getHomeDir() ?? cwd };
@@ -39724,7 +39724,7 @@ var init_runtime_paths = __esm(() => {
39724
39724
  init_path2();
39725
39725
  });
39726
39726
 
39727
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
39727
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
39728
39728
  async function loadStructuredConfig(path7, options = {}) {
39729
39729
  const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
39730
39730
  return await parseStructuredConfig(content, path7, options);
@@ -40007,10 +40007,10 @@ var init_schema_validation2 = __esm(() => {
40007
40007
  defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
40008
40008
  });
40009
40009
 
40010
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/types.js
40010
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/types.js
40011
40011
  var init_types2 = () => {};
40012
40012
 
40013
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/index.js
40013
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/index.js
40014
40014
  var exports_dist2 = {};
40015
40015
  __export(exports_dist2, {
40016
40016
  writeJsonFile: () => writeJsonFile2,
@@ -42608,7 +42608,7 @@ var init_mod = __esm(() => {
42608
42608
  init_config3();
42609
42609
  });
42610
42610
 
42611
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/logger.js
42611
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/logger.js
42612
42612
  function toLogTapeLevel(level) {
42613
42613
  return level === "warn" ? "warning" : level;
42614
42614
  }
@@ -44161,7 +44161,7 @@ var require_src = __commonJS((exports) => {
44161
44161
  };
44162
44162
  });
44163
44163
 
44164
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
44164
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
44165
44165
  function getTelemetryConfig(configPartial = {}) {
44166
44166
  return {
44167
44167
  enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
@@ -44197,7 +44197,7 @@ var init_sdk = __esm(() => {
44197
44197
  resolvedConfig = getTelemetryConfig();
44198
44198
  });
44199
44199
 
44200
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
44200
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
44201
44201
  function isSuppressed(tracer2) {
44202
44202
  return tracer2 === undefined && !getResolvedConfig().enabled;
44203
44203
  }
@@ -44237,7 +44237,7 @@ var init_tracing2 = __esm(() => {
44237
44237
  import_api2 = __toESM(require_src(), 1);
44238
44238
  });
44239
44239
 
44240
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
44240
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
44241
44241
  function getMeter() {
44242
44242
  return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
44243
44243
  }
@@ -44334,7 +44334,7 @@ var init_metrics = __esm(() => {
44334
44334
  instruments = {};
44335
44335
  });
44336
44336
 
44337
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
44337
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
44338
44338
  function busLogger() {
44339
44339
  if (!_busLogger)
44340
44340
  _busLogger = getLogger2("event-bus");
@@ -44587,7 +44587,7 @@ var init_event_bus = __esm(() => {
44587
44587
  init_metrics();
44588
44588
  });
44589
44589
 
44590
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
44590
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
44591
44591
  function obsLogger() {
44592
44592
  if (!_obsLogger)
44593
44593
  _obsLogger = getLogger2("event-bus.observers");
@@ -44651,7 +44651,7 @@ var init_default_observers = __esm(() => {
44651
44651
  init_event_bus();
44652
44652
  });
44653
44653
 
44654
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
44654
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
44655
44655
  function parentDir(filePath) {
44656
44656
  const sep = filePath.includes("\\") ? "\\" : "/";
44657
44657
  const idx = filePath.lastIndexOf(sep);
@@ -44750,7 +44750,7 @@ var init_file_observer = __esm(() => {
44750
44750
  init_logger3();
44751
44751
  });
44752
44752
 
44753
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/execution-policy.js
44753
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/execution-policy.js
44754
44754
  function resolveExecutionTimeoutMs(scope, value, inherited) {
44755
44755
  if (value === undefined) {
44756
44756
  return inherited ?? null;
@@ -44827,7 +44827,7 @@ async function runWithExecutionDeadline(action, options) {
44827
44827
  return { outcome: "completed", result, elapsedMs, timedOut };
44828
44828
  }
44829
44829
 
44830
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
44830
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
44831
44831
  function settleWithin(promise2, deadline) {
44832
44832
  const remaining = deadline - Date.now();
44833
44833
  if (remaining <= 0)
@@ -53197,9 +53197,11 @@ function deriveDimensionMartsOps(days) {
53197
53197
  WHERE ${TOOL_DAY_PRED}
53198
53198
  GROUP BY t.source
53199
53199
  ), skills AS (
53200
+ -- E93 1029: confirmed loads only \u2014 requests and unclassified rows are
53201
+ -- separate materialized classes and must not inflate the source mart.
53200
53202
  SELECT s.source, SUM(s.calls) AS skill_calls
53201
53203
  FROM history_board_skill_5m s
53202
- WHERE ${SKILL_DAY_PRED}
53204
+ WHERE ${SKILL_DAY_PRED} AND s.evidence_kind = 'load' AND s.status = 'ok'
53203
53205
  GROUP BY s.source
53204
53206
  )
53205
53207
  SELECT 'source', msg.source, ?, msg.messages, COALESCE(tools.tool_calls, 0),
@@ -53569,7 +53571,7 @@ async function rollupTableFreshness(db2) {
53569
53571
  }
53570
53572
  return result;
53571
53573
  }
53572
- var ROLLUP_DEFINITION_VERSION = "v6", EMPTY_ROLLUP_WATERMARK, BUCKETED_ROLLUP_TABLES, KEYED_ROLLUP_TABLES, GLOBAL_RANKED_ROLLUP_TABLES, ALL_ROLLUP_TABLES, MSG_BUCKET_5M = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', m.ts) / 60 * 60 AS INTEGER), 'unixepoch')`, SKILL_BUCKET_5M = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', sc.started_at) / 60 * 60 AS INTEGER), 'unixepoch')`, MSG_DAY;
53574
+ var ROLLUP_DEFINITION_VERSION = "v7", EMPTY_ROLLUP_WATERMARK, BUCKETED_ROLLUP_TABLES, KEYED_ROLLUP_TABLES, GLOBAL_RANKED_ROLLUP_TABLES, ALL_ROLLUP_TABLES, MSG_BUCKET_5M = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', m.ts) / 60 * 60 AS INTEGER), 'unixepoch')`, SKILL_BUCKET_5M = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', sc.started_at) / 60 * 60 AS INTEGER), 'unixepoch')`, MSG_DAY;
53573
53575
  var init_rollup_watermark = __esm(() => {
53574
53576
  EMPTY_ROLLUP_WATERMARK = {
53575
53577
  importedAtWatermark: "",
@@ -53615,15 +53617,7 @@ async function markHistoryBoardRollupsRefreshed(db2, historyVersion) {
53615
53617
  ON CONFLICT(id) DO UPDATE SET history_version = excluded.history_version, refreshed_at = excluded.refreshed_at`, historyVersion, new Date().toISOString());
53616
53618
  }
53617
53619
  async function skillCallRollup(db2) {
53618
- return db2.queryAll(`SELECT strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', started_at) / 60 * 60 AS INTEGER), 'unixepoch') AS bucketStart,
53619
- source,
53620
- skill_name AS skillName,
53621
- invocation_kind AS invocationKind,
53622
- COUNT(*) AS calls
53623
- FROM history_skill_call
53624
- WHERE started_at IS NOT NULL
53625
- GROUP BY bucketStart, source, skillName, invocationKind
53626
- ORDER BY bucketStart ASC, source ASC`);
53620
+ return db2.queryAll(SKILL_ROLLUP_REP_SQL);
53627
53621
  }
53628
53622
  async function historyBoardRollupsFresh(db2) {
53629
53623
  const freshness = await rollupTableFreshness(db2);
@@ -53863,10 +53857,17 @@ async function replaceHistoryBoardRollups(db2, seed) {
53863
53857
  appendRankedSteps(operations2, "cache-waste", seed.cacheWasteSteps);
53864
53858
  for (const row of seed.skill5m ?? []) {
53865
53859
  operations2.push({
53866
- sql: `INSERT INTO history_board_skill_5m (
53867
- bucket_start, source, skill_name, invocation_kind, calls
53868
- ) VALUES (?, ?, ?, ?, ?)`,
53869
- params: [row.bucketStart, row.source, row.skillName, row.invocationKind, row.calls]
53860
+ sql: SKILL_5M_INSERT_SQL,
53861
+ params: [
53862
+ row.bucketStart,
53863
+ row.source,
53864
+ row.skillName,
53865
+ row.invocationKind,
53866
+ row.capabilityKind,
53867
+ row.evidenceKind,
53868
+ row.status,
53869
+ row.calls
53870
+ ]
53870
53871
  });
53871
53872
  }
53872
53873
  for (const row of seed.sourceRows) {
@@ -54275,24 +54276,36 @@ async function historyBoardSkillBreakdownFromRollup(db2, sel, bucket) {
54275
54276
  clauses.push(`r.skill_name IN (${validSkills.map(() => "?").join(", ")})`);
54276
54277
  params.push(...validSkills);
54277
54278
  }
54278
- const where = clauses.length > 0 ? ` WHERE ${clauses.join(" AND ")}` : "";
54279
- const skillWhere = `${where}${where ? " AND" : " WHERE"} r.skill_name <> '' AND r.skill_name <> 'unknown'`;
54280
- const [bySkill2, bySource, byInvocationKind, trend] = await Promise.all([
54279
+ const selectorWhere = clauses.length > 0 ? ` WHERE ${clauses.join(" AND ")}` : "";
54280
+ const confirmedWhere = `${selectorWhere}${selectorWhere ? " AND" : " WHERE"} r.evidence_kind = 'load' AND r.status = 'ok'`;
54281
+ const skillWhere = `${confirmedWhere} AND r.skill_name <> '' AND r.skill_name <> 'unknown'`;
54282
+ const capabilityWhere = `${selectorWhere}${selectorWhere ? " AND" : " WHERE"} r.skill_name <> '' AND r.skill_name <> 'unknown'`;
54283
+ const [bySkill2, bySource, byInvocationKind, byCapability, trend] = await Promise.all([
54281
54284
  db2.queryAll(`SELECT r.skill_name AS skillName, SUM(r.calls) AS calls
54282
54285
  FROM history_board_skill_5m r${skillWhere}
54283
54286
  GROUP BY r.skill_name ORDER BY calls DESC, r.skill_name ASC LIMIT 10`, ...params),
54284
54287
  db2.queryAll(`SELECT r.source AS source, SUM(r.calls) AS calls
54285
- FROM history_board_skill_5m r${where}
54288
+ FROM history_board_skill_5m r${confirmedWhere}
54286
54289
  GROUP BY r.source ORDER BY calls DESC, r.source ASC`, ...params),
54287
54290
  db2.queryAll(`SELECT r.invocation_kind AS invocationKind, SUM(r.calls) AS calls
54288
- FROM history_board_skill_5m r${where}
54291
+ FROM history_board_skill_5m r${confirmedWhere}
54289
54292
  GROUP BY r.invocation_kind ORDER BY calls DESC, r.invocation_kind ASC`, ...params),
54293
+ db2.queryAll(`SELECT r.skill_name AS skillName,
54294
+ NULLIF(r.capability_kind, '') AS capabilityKind,
54295
+ r.invocation_kind AS invocationKind,
54296
+ NULLIF(r.evidence_kind, '') AS evidenceKind,
54297
+ NULLIF(r.status, '') AS status,
54298
+ SUM(r.calls) AS calls
54299
+ FROM history_board_skill_5m r${capabilityWhere}
54300
+ GROUP BY r.skill_name, r.capability_kind, r.invocation_kind, r.evidence_kind, r.status
54301
+ ORDER BY calls DESC, r.skill_name ASC, r.invocation_kind ASC, r.evidence_kind ASC, r.status ASC
54302
+ LIMIT 10`, ...params),
54290
54303
  db2.queryAll(`SELECT ${bucketExpression(bucket, "r")} AS bucketStart, r.skill_name AS key,
54291
54304
  SUM(r.calls) AS calls, 0 AS freshInputTokens, 0 AS cacheReadTokens, 0 AS outputTokens
54292
54305
  FROM history_board_skill_5m r${skillWhere}
54293
54306
  GROUP BY bucketStart, r.skill_name ORDER BY bucketStart ASC`, ...params)
54294
54307
  ]);
54295
- return { bySkill: bySkill2, bySource, byInvocationKind, trend };
54308
+ return { bySkill: bySkill2, bySource, byInvocationKind, byCapability, trend };
54296
54309
  }
54297
54310
  async function historyBoardDatabaseBytes(db2) {
54298
54311
  const [pageCount, pageSize] = await Promise.all([
@@ -54485,18 +54498,75 @@ function tool5mBucketOps(bucket) {
54485
54498
  ];
54486
54499
  }
54487
54500
  function skill5mBucketOps(bucket) {
54501
+ const partition = `PARTITION BY scoped.source, scoped.session_id, scoped.invocation_key,
54502
+ scoped.invocation_kind, scoped.capability_kind, scoped.evidence_kind`;
54488
54503
  return [
54489
54504
  { sql: "DELETE FROM history_board_skill_5m WHERE bucket_start = ?", params: [bucket] },
54490
54505
  {
54491
- sql: `INSERT INTO history_board_skill_5m (bucket_start, source, skill_name, invocation_kind, calls)
54492
- SELECT ${SKILL_BUCKET_5M_SQL} AS bucket_start, source, skill_name, invocation_kind, COUNT(*) AS calls
54493
- FROM history_skill_call
54494
- WHERE started_at IS NOT NULL AND ${bucketWindow("started_at")} AND ${SKILL_BUCKET_5M_SQL} = ?
54495
- GROUP BY bucket_start, source, skill_name, invocation_kind`,
54496
- params: [bucket, bucket, bucket]
54506
+ sql: `INSERT INTO history_board_skill_5m (
54507
+ bucket_start, source, skill_name, invocation_kind, capability_kind, evidence_kind, status, calls
54508
+ )
54509
+ WITH scoped AS (
54510
+ SELECT record_hash, source, skill_name, session_id, invocation_kind, started_at, status,
54511
+ COALESCE(NULLIF(invocation_id, ''), 'h:' || record_hash) AS invocation_key,
54512
+ COALESCE(capability_kind, '') AS capability_kind,
54513
+ COALESCE(evidence_kind, '') AS evidence_kind
54514
+ FROM history_skill_call
54515
+ WHERE started_at IS NOT NULL
54516
+ ),
54517
+ touched AS (
54518
+ SELECT DISTINCT source, session_id, invocation_key, invocation_kind,
54519
+ capability_kind, evidence_kind
54520
+ FROM scoped
54521
+ WHERE ${bucketWindow("started_at")} AND ${SKILL_BUCKET_5M_SQL} = ?
54522
+ ),
54523
+ repped AS (
54524
+ SELECT scoped.*,
54525
+ ROW_NUMBER() OVER (${partition}
54526
+ ORDER BY scoped.started_at ASC, scoped.record_hash ASC) AS rep_rank,
54527
+ CASE
54528
+ WHEN SUM(scoped.status = 'ok') OVER (${partition}) > 0 THEN 'ok'
54529
+ WHEN SUM(scoped.status = 'error') OVER (${partition}) > 0 THEN 'error'
54530
+ ELSE 'unknown'
54531
+ END AS class_status
54532
+ FROM scoped
54533
+ JOIN touched
54534
+ ON touched.source = scoped.source
54535
+ AND touched.session_id = scoped.session_id
54536
+ AND touched.invocation_key = scoped.invocation_key
54537
+ AND touched.invocation_kind = scoped.invocation_kind
54538
+ AND touched.capability_kind = scoped.capability_kind
54539
+ AND touched.evidence_kind = scoped.evidence_kind
54540
+ )
54541
+ SELECT ${SKILL_BUCKET_5M_SQL} AS bucket_start, source, skill_name, invocation_kind,
54542
+ capability_kind, evidence_kind, class_status AS status, COUNT(*) AS calls
54543
+ FROM repped
54544
+ WHERE rep_rank = 1 AND ${SKILL_BUCKET_5M_SQL} = ?
54545
+ GROUP BY bucket_start, source, skill_name, invocation_kind, capability_kind, evidence_kind, status`,
54546
+ params: [bucket, bucket, bucket, bucket]
54497
54547
  }
54498
54548
  ];
54499
54549
  }
54550
+ async function rebuildSkill5mAll(db2) {
54551
+ const rows = await skillCallRollup(db2);
54552
+ const ops = [{ sql: "DELETE FROM history_board_skill_5m", params: [] }];
54553
+ for (const row of rows) {
54554
+ ops.push({
54555
+ sql: SKILL_5M_INSERT_SQL,
54556
+ params: [
54557
+ row.bucketStart,
54558
+ row.source,
54559
+ row.skillName,
54560
+ row.invocationKind,
54561
+ row.capabilityKind,
54562
+ row.evidenceKind,
54563
+ row.status,
54564
+ row.calls
54565
+ ]
54566
+ });
54567
+ }
54568
+ await db2.batch(ops);
54569
+ }
54500
54570
  async function recomputeDailyAndSourceDaily(db2, days) {
54501
54571
  if (days.length === 0)
54502
54572
  return;
@@ -54835,6 +54905,22 @@ async function allMaterializedDays(db2) {
54835
54905
  const rows = await db2.queryAll("SELECT DISTINCT SUBSTR(bucket_start, 1, 10) AS day FROM history_board_message_5m");
54836
54906
  return rows.map((row) => row.day);
54837
54907
  }
54908
+ async function lateSkillResultBuckets(db2, watermark, alreadyAffected) {
54909
+ const sessions = await deltaSessionScope(db2, watermark);
54910
+ if (sessions === null)
54911
+ return { buckets: [], fullRebuild: true };
54912
+ if (sessions.length === 0)
54913
+ return { buckets: [], fullRebuild: false };
54914
+ const placeholders = sessions.map(() => "?").join(", ");
54915
+ const rows = await db2.queryAll(`SELECT DISTINCT ${SKILL_BUCKET_5M_SQL} AS bucketStart
54916
+ FROM history_skill_call sc
54917
+ WHERE sc.started_at IS NOT NULL AND sc.session_id IN (${placeholders})
54918
+ LIMIT ${SKILL_LATE_BUCKET_LIMIT + 1}`, ...sessions);
54919
+ if (rows.length > SKILL_LATE_BUCKET_LIMIT)
54920
+ return { buckets: [], fullRebuild: true };
54921
+ const buckets = [...new Set(rows.map((row) => row.bucketStart))].filter((b) => b !== "" && !alreadyAffected.has(b)).sort();
54922
+ return { buckets, fullRebuild: false };
54923
+ }
54838
54924
  async function postPassLags(db2, bucketWatermark) {
54839
54925
  const watermarks = await readRollupWatermarks(db2);
54840
54926
  for (const table3 of POST_WATERMARK_TABLES) {
@@ -54857,6 +54943,14 @@ async function refreshHistoryBoardRollupsIncremental(db2) {
54857
54943
  await applyToolAliases(db2, { sources: deltaSources, since: messageWm.importedAtWatermark });
54858
54944
  }
54859
54945
  const affected = await affectedBucketsWithRange(db2, messageWm.importedAtWatermark);
54946
+ const skillLate = await lateSkillResultBuckets(db2, messageWm.importedAtWatermark, new Set(affected.map((a2) => a2.bucket)));
54947
+ if (skillLate.fullRebuild) {
54948
+ await rebuildSkill5mAll(db2);
54949
+ } else {
54950
+ for (const skillBucket of skillLate.buckets) {
54951
+ await db2.batch(skill5mBucketOps(skillBucket));
54952
+ }
54953
+ }
54860
54954
  let advanced = messageWm.importedAtWatermark;
54861
54955
  if (affected.length > 0) {
54862
54956
  const newMask = affected.map((a2) => a2.maxImportedAt > messageWm.importedAtWatermark);
@@ -54935,7 +55029,49 @@ async function hasHistoryBoardRollupRows(db2, table3) {
54935
55029
  var MESSAGE_DEDUP2 = `(m.request_id IS NULL OR NOT EXISTS (
54936
55030
  SELECT 1 FROM history_message o
54937
55031
  WHERE o.request_id = m.request_id AND o.rowid > m.rowid
54938
- ))`, ROLLUP_SOURCE_TABLES, SKILL_NAME_SQL, HISTORY_BOARD_ROLLUP_VERSION = 2, SESSION_ORDER_COLUMNS, ALL_HISTORY, RANK_DEPTH = 1000, MSG_BUCKET_5M_SQL = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', m.ts) / 60 * 60 AS INTEGER), 'unixepoch')`, SKILL_BUCKET_5M_SQL = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', started_at) / 60 * 60 AS INTEGER), 'unixepoch')`, NULL_TS_BUCKET = "", BUCKET_LEVEL_WATERMARK_TABLES, POST_WATERMARK_TABLES, SESSION_SCOPE_LIMIT = 1000, DELTA_ROW_SCAN_LIMIT = 200000;
55032
+ ))`, ROLLUP_SOURCE_TABLES, SKILL_NAME_SQL, HISTORY_BOARD_ROLLUP_VERSION = 2, SKILL_ROLLUP_REP_SQL = `
55033
+ WITH scoped AS (
55034
+ SELECT record_hash, source, skill_name, session_id, invocation_kind, started_at, status,
55035
+ COALESCE(NULLIF(invocation_id, ''), 'h:' || record_hash) AS invocation_key,
55036
+ COALESCE(capability_kind, '') AS capability_kind,
55037
+ COALESCE(evidence_kind, '') AS evidence_kind
55038
+ FROM history_skill_call
55039
+ WHERE started_at IS NOT NULL
55040
+ ),
55041
+ repped AS (
55042
+ SELECT scoped.*,
55043
+ ROW_NUMBER() OVER (
55044
+ PARTITION BY scoped.source, scoped.session_id, scoped.invocation_key,
55045
+ scoped.invocation_kind, scoped.capability_kind, scoped.evidence_kind
55046
+ ORDER BY scoped.started_at ASC, scoped.record_hash ASC
55047
+ ) AS rep_rank,
55048
+ CASE
55049
+ WHEN SUM(scoped.status = 'ok') OVER (
55050
+ PARTITION BY scoped.source, scoped.session_id, scoped.invocation_key,
55051
+ scoped.invocation_kind, scoped.capability_kind, scoped.evidence_kind
55052
+ ) > 0 THEN 'ok'
55053
+ WHEN SUM(scoped.status = 'error') OVER (
55054
+ PARTITION BY scoped.source, scoped.session_id, scoped.invocation_key,
55055
+ scoped.invocation_kind, scoped.capability_kind, scoped.evidence_kind
55056
+ ) > 0 THEN 'error'
55057
+ ELSE 'unknown'
55058
+ END AS class_status
55059
+ FROM scoped
55060
+ )
55061
+ SELECT strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', started_at) / 60 * 60 AS INTEGER), 'unixepoch') AS bucketStart,
55062
+ source,
55063
+ skill_name AS skillName,
55064
+ invocation_kind AS invocationKind,
55065
+ capability_kind AS capabilityKind,
55066
+ evidence_kind AS evidenceKind,
55067
+ class_status AS status,
55068
+ COUNT(*) AS calls
55069
+ FROM repped
55070
+ WHERE rep_rank = 1
55071
+ GROUP BY bucketStart, source, skillName, invocationKind, capabilityKind, evidenceKind, status
55072
+ ORDER BY bucketStart ASC, source ASC`, SKILL_5M_INSERT_SQL = `INSERT INTO history_board_skill_5m (
55073
+ bucket_start, source, skill_name, invocation_kind, capability_kind, evidence_kind, status, calls
55074
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, SESSION_ORDER_COLUMNS, ALL_HISTORY, RANK_DEPTH = 1000, MSG_BUCKET_5M_SQL = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', m.ts) / 60 * 60 AS INTEGER), 'unixepoch')`, SKILL_BUCKET_5M_SQL = `strftime('%Y-%m-%dT%H:%M:00Z', CAST(strftime('%s', started_at) / 60 * 60 AS INTEGER), 'unixepoch')`, NULL_TS_BUCKET = "", BUCKET_LEVEL_WATERMARK_TABLES, POST_WATERMARK_TABLES, SESSION_SCOPE_LIMIT = 1000, DELTA_ROW_SCAN_LIMIT = 200000, SKILL_LATE_BUCKET_LIMIT = 500;
54939
55075
  var init_history_board_rollup = __esm(() => {
54940
55076
  init_forensic_query();
54941
55077
  init_history_board_marts();
@@ -54992,7 +55128,7 @@ END`;
54992
55128
  ];
54993
55129
  });
54994
55130
 
54995
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
55131
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
54996
55132
  var HistoryImportError, ImportCancelledError;
54997
55133
  var init_errors5 = __esm(() => {
54998
55134
  HistoryImportError = class HistoryImportError extends Error {
@@ -55013,7 +55149,7 @@ var init_errors5 = __esm(() => {
55013
55149
  };
55014
55150
  });
55015
55151
 
55016
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/cancellation.js
55152
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/cancellation.js
55017
55153
  function throwIfImportAborted(signal) {
55018
55154
  if (signal?.aborted) {
55019
55155
  throw new ImportCancelledError("Import cancelled by abort signal", signal.reason);
@@ -55023,7 +55159,7 @@ var init_cancellation = __esm(() => {
55023
55159
  init_errors5();
55024
55160
  });
55025
55161
 
55026
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
55162
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
55027
55163
  import { createHash as createHash3 } from "crypto";
55028
55164
  function stableJson(value) {
55029
55165
  if (Array.isArray(value)) {
@@ -55038,10 +55174,322 @@ function stableJson(value) {
55038
55174
  function sha256(value) {
55039
55175
  return createHash3("sha256").update(stableJson(value)).digest("hex");
55040
55176
  }
55177
+ function sha256Text(text3) {
55178
+ return createHash3("sha256").update(text3, "utf8").digest("hex");
55179
+ }
55041
55180
  var init_hash = () => {};
55042
55181
 
55043
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
55044
- var HISTORY_IMPORT_SCHEMA_VERSION = "0.5.11", HISTORY_IMPORT_SCHEMA_SQL;
55182
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/capability.js
55183
+ function validateCapabilityOrigins(input) {
55184
+ if (input === undefined)
55185
+ return [];
55186
+ if (!Array.isArray(input)) {
55187
+ throw new HistoryImportError("capabilityOrigins must be an array of CapabilityOrigin objects.", {
55188
+ option: "capabilityOrigins"
55189
+ });
55190
+ }
55191
+ return input.map((origin2, index2) => {
55192
+ const fail = (reason) => {
55193
+ throw new HistoryImportError(`capabilityOrigins[${index2}]: ${reason}`, {
55194
+ option: "capabilityOrigins",
55195
+ index: index2
55196
+ });
55197
+ };
55198
+ if (typeof origin2 !== "object" || origin2 === null)
55199
+ fail("entry must be an object.");
55200
+ if (typeof origin2.source !== "string" || origin2.source.trim() === "")
55201
+ fail("source must be a non-empty string.");
55202
+ if (typeof origin2.skillName !== "string" || origin2.skillName.trim() === "") {
55203
+ fail("skillName must be a non-empty string.");
55204
+ }
55205
+ if (typeof origin2.artifactDigest !== "string" || !DIGEST_PATTERN.test(origin2.artifactDigest)) {
55206
+ fail("artifactDigest must be a 64-character lowercase hex SHA-256 string.");
55207
+ }
55208
+ if (!CAPABILITY_KINDS.includes(origin2.capabilityKind)) {
55209
+ fail(`capabilityKind must be one of ${CAPABILITY_KINDS.map((k) => `'${k}'`).join(", ")}.`);
55210
+ }
55211
+ if (typeof origin2.originIdentity !== "string" || origin2.originIdentity.trim() === "") {
55212
+ fail("originIdentity must be a non-empty string.");
55213
+ }
55214
+ if (origin2.skillPath !== undefined && (typeof origin2.skillPath !== "string" || origin2.skillPath.trim() === "")) {
55215
+ fail("skillPath must be a non-empty string when present.");
55216
+ }
55217
+ return origin2;
55218
+ });
55219
+ }
55220
+ function matchCapabilityOrigin(origins, source, canonicalName, observable) {
55221
+ let candidates = origins.filter((origin2) => origin2.source === source && origin2.skillName === canonicalName);
55222
+ if (candidates.length === 0)
55223
+ return { origin: undefined, conflict: null };
55224
+ if (observable.skillPath != null && observable.skillPath !== "") {
55225
+ const byPath = candidates.filter((origin2) => origin2.skillPath !== undefined && origin2.skillPath === observable.skillPath);
55226
+ if (byPath.length > 0)
55227
+ candidates = byPath;
55228
+ }
55229
+ if (observable.artifactDigest != null && observable.artifactDigest !== "") {
55230
+ const byDigest = candidates.filter((origin2) => origin2.artifactDigest === observable.artifactDigest);
55231
+ if (byDigest.length === 1)
55232
+ return { origin: byDigest[0], conflict: null };
55233
+ if (byDigest.length > 1) {
55234
+ return {
55235
+ origin: undefined,
55236
+ conflict: `capabilityOrigins: ${byDigest.length} origins agree on digest for '${canonicalName}'.`
55237
+ };
55238
+ }
55239
+ return {
55240
+ origin: undefined,
55241
+ conflict: `capabilityOrigins: observed artifact digest does not match the supplied origin for '${canonicalName}'.`
55242
+ };
55243
+ }
55244
+ if (candidates.length === 1)
55245
+ return { origin: candidates[0], conflict: null };
55246
+ return {
55247
+ origin: undefined,
55248
+ conflict: `capabilityOrigins: ${candidates.length} origins match '${canonicalName}' without distinguishing evidence.`
55249
+ };
55250
+ }
55251
+ function capabilityInvocationId(parts) {
55252
+ return sha256Text(JSON.stringify({
55253
+ domain: "capability-invocation",
55254
+ v: 1,
55255
+ source: parts.source,
55256
+ sessionId: parts.sessionId,
55257
+ kind: parts.kind,
55258
+ id: parts.id ?? null,
55259
+ ordinal: parts.ordinal ?? null,
55260
+ file: parts.file ?? null,
55261
+ line: parts.line ?? null
55262
+ }, Object.keys({
55263
+ domain: 0,
55264
+ v: 0,
55265
+ source: 0,
55266
+ sessionId: 0,
55267
+ kind: 0,
55268
+ id: 0,
55269
+ ordinal: 0,
55270
+ file: 0,
55271
+ line: 0
55272
+ }).sort()));
55273
+ }
55274
+ function scanShellSegment(segment) {
55275
+ const tokens = [];
55276
+ let current = "";
55277
+ let quote = null;
55278
+ let dynamic = false;
55279
+ for (let i2 = 0;i2 < segment.length; i2 += 1) {
55280
+ const ch = segment[i2];
55281
+ if (quote === "'") {
55282
+ if (ch === "'")
55283
+ quote = null;
55284
+ else
55285
+ current += ch;
55286
+ continue;
55287
+ }
55288
+ if (quote === '"') {
55289
+ if (ch === '"')
55290
+ quote = null;
55291
+ else if (ch === "$" || ch === "`")
55292
+ dynamic = true;
55293
+ else
55294
+ current += ch;
55295
+ continue;
55296
+ }
55297
+ if (ch === "'" || ch === '"') {
55298
+ quote = ch;
55299
+ continue;
55300
+ }
55301
+ if (ch === "\\" || ch === "$" || ch === "`") {
55302
+ dynamic = true;
55303
+ continue;
55304
+ }
55305
+ if (ch === " " || ch === "\t" || ch === `
55306
+ `) {
55307
+ if (current !== "")
55308
+ tokens.push(current);
55309
+ current = "";
55310
+ continue;
55311
+ }
55312
+ current += ch;
55313
+ }
55314
+ if (quote !== null)
55315
+ dynamic = true;
55316
+ if (current !== "")
55317
+ tokens.push(current);
55318
+ return { tokens, dynamic };
55319
+ }
55320
+ function splitShellSegments(command) {
55321
+ const segments = [];
55322
+ let current = "";
55323
+ let quote = null;
55324
+ for (let i2 = 0;i2 < command.length; i2 += 1) {
55325
+ const ch = command[i2];
55326
+ if (quote !== null) {
55327
+ current += ch;
55328
+ if (ch === quote)
55329
+ quote = null;
55330
+ continue;
55331
+ }
55332
+ if (ch === "'" || ch === '"') {
55333
+ quote = ch;
55334
+ current += ch;
55335
+ continue;
55336
+ }
55337
+ if (ch === ";") {
55338
+ segments.push(current);
55339
+ current = "";
55340
+ continue;
55341
+ }
55342
+ if (ch === "|" || ch === "&") {
55343
+ if (command[i2 + 1] === ch) {
55344
+ segments.push(current);
55345
+ current = "";
55346
+ i2 += 1;
55347
+ continue;
55348
+ }
55349
+ segments.push(current);
55350
+ current = "";
55351
+ continue;
55352
+ }
55353
+ current += ch;
55354
+ }
55355
+ segments.push(current);
55356
+ return segments;
55357
+ }
55358
+ function lastPathSegment(path9) {
55359
+ const trimmed = path9.replace(/\/+$/, "");
55360
+ const idx = trimmed.lastIndexOf("/");
55361
+ return idx === -1 ? trimmed : trimmed.slice(idx + 1);
55362
+ }
55363
+ function isSedPrintRange(token) {
55364
+ return /^\$?[0-9]+(\s*,\s*(\$|[0-9]+))?p$/.test(token) || /^\$p$/.test(token);
55365
+ }
55366
+ function hasRedirection(segment) {
55367
+ let quote = null;
55368
+ for (let i2 = 0;i2 < segment.length; i2 += 1) {
55369
+ const ch = segment[i2];
55370
+ if (quote !== null) {
55371
+ if (ch === quote)
55372
+ quote = null;
55373
+ continue;
55374
+ }
55375
+ if (ch === "'" || ch === '"') {
55376
+ quote = ch;
55377
+ continue;
55378
+ }
55379
+ if (ch === ">" || ch === "<")
55380
+ return true;
55381
+ }
55382
+ return false;
55383
+ }
55384
+ function parseLiteralReadTargets(command) {
55385
+ if (typeof command !== "string" || command.trim() === "")
55386
+ return [];
55387
+ const targets = [];
55388
+ for (const segment of splitShellSegments(command)) {
55389
+ if (segment.trim() === "" || hasRedirection(segment))
55390
+ continue;
55391
+ const trimmed = segment.trim();
55392
+ if (trimmed.startsWith("#"))
55393
+ continue;
55394
+ const scan = scanShellSegment(trimmed);
55395
+ if (scan.dynamic || scan.tokens.length === 0)
55396
+ continue;
55397
+ const [cmd, ...args] = scan.tokens;
55398
+ if (cmd === "cat") {
55399
+ for (const arg of args) {
55400
+ if (arg === "--")
55401
+ continue;
55402
+ if (arg.startsWith("-"))
55403
+ continue;
55404
+ if (lastPathSegment(arg) === "SKILL.md")
55405
+ targets.push(arg);
55406
+ }
55407
+ continue;
55408
+ }
55409
+ if (cmd === "sed") {
55410
+ let sawNoPrint = false;
55411
+ const rangeArgs = [];
55412
+ for (const arg of args) {
55413
+ if (arg === "--")
55414
+ continue;
55415
+ if (arg === "-n" || arg === "--quiet" || arg === "--silent") {
55416
+ sawNoPrint = true;
55417
+ continue;
55418
+ }
55419
+ if (arg.startsWith("-")) {
55420
+ sawNoPrint = false;
55421
+ break;
55422
+ }
55423
+ if (isSedPrintRange(arg)) {
55424
+ rangeArgs.push(arg);
55425
+ continue;
55426
+ }
55427
+ if (rangeArgs.length === 0) {
55428
+ sawNoPrint = false;
55429
+ break;
55430
+ }
55431
+ if (lastPathSegment(arg) === "SKILL.md")
55432
+ targets.push(arg);
55433
+ break;
55434
+ }
55435
+ if (!sawNoPrint)
55436
+ continue;
55437
+ }
55438
+ }
55439
+ return targets;
55440
+ }
55441
+ function extractNestedExecCommandLiterals(payloadText) {
55442
+ if (typeof payloadText !== "string" || payloadText.trim() === "")
55443
+ return [];
55444
+ const literals = [];
55445
+ const shape = /tools\.exec_command\(\s*\{\s*cmd:\s*("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')((?:\s*,\s*[A-Za-z_][A-Za-z0-9_]*\s*:\s*(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[-0-9.eE+]+|true|false|null))*)\s*\}\s*\)/g;
55446
+ let inBlockComment = false;
55447
+ for (const rawLine of payloadText.split(/\r?\n/)) {
55448
+ let line = rawLine;
55449
+ if (inBlockComment) {
55450
+ const end = line.indexOf("*/");
55451
+ if (end === -1)
55452
+ continue;
55453
+ line = line.slice(end + 2);
55454
+ inBlockComment = false;
55455
+ }
55456
+ const trimmedStart = line.trimStart();
55457
+ if (trimmedStart.startsWith("//"))
55458
+ continue;
55459
+ const blockStart = line.indexOf("/*");
55460
+ if (blockStart !== -1) {
55461
+ const end = line.indexOf("*/", blockStart + 2);
55462
+ line = end === -1 ? line.slice(0, blockStart) : line.slice(0, blockStart) + line.slice(end + 2);
55463
+ if (end === -1)
55464
+ inBlockComment = true;
55465
+ }
55466
+ const statementStart = /(?:^|[{};]\s*)$/;
55467
+ shape.lastIndex = 0;
55468
+ let match = shape.exec(line);
55469
+ while (match !== null) {
55470
+ const before = line.slice(0, match.index);
55471
+ if (statementStart.test(before)) {
55472
+ const literal2 = match[1] ?? "";
55473
+ const quote = literal2[0] ?? '"';
55474
+ const body = literal2.slice(1, -1).replaceAll(`\\${quote}`, quote).replaceAll("\\\\", "\\").replaceAll("\\n", `
55475
+ `).replaceAll("\\t", "\t");
55476
+ literals.push(body);
55477
+ }
55478
+ match = shape.exec(line);
55479
+ }
55480
+ }
55481
+ return literals;
55482
+ }
55483
+ var CAPABILITY_KINDS, DIGEST_PATTERN;
55484
+ var init_capability = __esm(() => {
55485
+ init_errors5();
55486
+ init_hash();
55487
+ CAPABILITY_KINDS = ["command", "subagent", "skill"];
55488
+ DIGEST_PATTERN = /^[0-9a-f]{64}$/;
55489
+ });
55490
+
55491
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
55492
+ var HISTORY_IMPORT_SCHEMA_VERSION = "0.5.12", HISTORY_IMPORT_SCHEMA_SQL;
55045
55493
  var init_schema_sql = __esm(() => {
55046
55494
  HISTORY_IMPORT_SCHEMA_SQL = `
55047
55495
  CREATE TABLE IF NOT EXISTS history_import_checkpoint (
@@ -55150,7 +55598,14 @@ CREATE TABLE IF NOT EXISTS history_skill_call (
55150
55598
  started_at TEXT,
55151
55599
  completed_at TEXT,
55152
55600
  duration_ms REAL,
55153
- imported_at TEXT NOT NULL
55601
+ imported_at TEXT NOT NULL,
55602
+ -- Capability facts (E93 task 1028). Nullable on every row: legacy rows and rows
55603
+ -- whose classification could not be established store NULL. Column order after
55604
+ -- imported_at converges with the guarded standalone upgrade in the DAO.
55605
+ capability_kind TEXT,
55606
+ evidence_kind TEXT,
55607
+ invocation_id TEXT,
55608
+ origin_identity TEXT
55154
55609
  );
55155
55610
  CREATE INDEX IF NOT EXISTS idx_history_skill_call_session
55156
55611
  ON history_skill_call(source, session_id, seq);
@@ -55163,7 +55618,7 @@ CREATE INDEX IF NOT EXISTS idx_history_skill_call_invocation_kind
55163
55618
  `.trim();
55164
55619
  });
55165
55620
 
55166
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
55621
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
55167
55622
  function identityFieldMap(keys) {
55168
55623
  const map2 = {};
55169
55624
  for (const key of keys) {
@@ -55188,19 +55643,19 @@ function canonicalizeSkillName(raw) {
55188
55643
  function extractSkillCalls(raw, context4, identity5) {
55189
55644
  switch (context4?.source) {
55190
55645
  case "claude":
55191
- return detectClaudeSkillCalls(raw, identity5);
55646
+ return detectClaudeSkillCalls(raw, identity5, context4);
55192
55647
  case "pi":
55193
- return detectPiSkillCalls(raw, identity5);
55648
+ return detectPiSkillCalls(raw, identity5, context4);
55194
55649
  case "omp":
55195
- return detectOmpSkillCalls(raw, identity5);
55650
+ return detectOmpSkillCalls(raw, identity5, context4);
55196
55651
  case "codex":
55197
- return detectCodexSkillCalls(raw, identity5);
55652
+ return detectCodexSkillCalls(raw, identity5, context4);
55198
55653
  case "agy":
55199
- return detectAgySkillCalls(raw, identity5);
55654
+ return detectAgySkillCalls(raw, identity5, context4);
55200
55655
  case "gemini":
55201
- return detectGeminiSkillCalls(raw, identity5);
55656
+ return detectGeminiSkillCalls(raw, identity5, context4);
55202
55657
  case "grok":
55203
- return detectGrokSkillCalls(raw, identity5);
55658
+ return detectGrokSkillCalls(raw, identity5, context4);
55204
55659
  default:
55205
55660
  return [];
55206
55661
  }
@@ -55219,13 +55674,66 @@ function skillRecord(identity5, skillName, invocationKind, extra = {}) {
55219
55674
  args_raw: null,
55220
55675
  args_digest: null,
55221
55676
  call_id: null,
55222
- status: "ok",
55677
+ status: "unknown",
55223
55678
  started_at: null,
55224
55679
  completed_at: null,
55225
55680
  duration_ms: null,
55681
+ capability_kind: null,
55682
+ evidence_kind: null,
55683
+ invocation_id: null,
55684
+ origin_identity: null,
55226
55685
  ...extra
55227
55686
  };
55228
55687
  }
55688
+ function createOrdinalAllocator() {
55689
+ const ordinals = new Map;
55690
+ return (key) => {
55691
+ const existing = ordinals.get(key);
55692
+ if (existing !== undefined)
55693
+ return existing;
55694
+ const ordinal = ordinals.size;
55695
+ ordinals.set(key, ordinal);
55696
+ return ordinal;
55697
+ };
55698
+ }
55699
+ function originFields(context4, canonicalName, observable) {
55700
+ const origins = context4?.capabilityOrigins;
55701
+ if (origins === undefined || origins.length === 0) {
55702
+ return { capability_kind: null, origin_identity: null, _capabilityConflict: undefined };
55703
+ }
55704
+ const match = matchCapabilityOrigin(origins, context4?.source ?? "", canonicalName, observable);
55705
+ return {
55706
+ capability_kind: match.origin?.capabilityKind ?? null,
55707
+ origin_identity: match.origin?.originIdentity ?? null,
55708
+ _capabilityConflict: match.conflict ?? undefined
55709
+ };
55710
+ }
55711
+ function invocationIdFor(context4, sessionId, ref) {
55712
+ const source = context4?.source ?? "unknown";
55713
+ if (ref.invocationId !== undefined) {
55714
+ return capabilityInvocationId({ source, sessionId, kind: "invocation", id: ref.invocationId });
55715
+ }
55716
+ if (ref.callId !== undefined) {
55717
+ return capabilityInvocationId({
55718
+ source,
55719
+ sessionId,
55720
+ kind: "call",
55721
+ id: ref.callId,
55722
+ ordinal: ref.ordinal > 0 ? ref.ordinal : undefined
55723
+ });
55724
+ }
55725
+ if (ref.recordId !== undefined) {
55726
+ return capabilityInvocationId({ source, sessionId, kind: "record", id: ref.recordId, ordinal: ref.ordinal });
55727
+ }
55728
+ return capabilityInvocationId({
55729
+ source,
55730
+ sessionId,
55731
+ kind: "line",
55732
+ file: context4?.sourceFile ?? "",
55733
+ line: context4?.sourceLine ?? 0,
55734
+ ordinal: ref.ordinal
55735
+ });
55736
+ }
55229
55737
  function skillNameFromPath(path9) {
55230
55738
  const normalized = path9.replace(/\\/g, "/");
55231
55739
  const bySkillsSegment = normalized.match(/\/skills\/([^/]+)\/SKILL\.md$/i);
@@ -55234,73 +55742,348 @@ function skillNameFromPath(path9) {
55234
55742
  const stem = normalized.slice(0, normalized.length - "/SKILL.md".length);
55235
55743
  return stem.split("/").pop() ?? stem;
55236
55744
  }
55237
- function detectClaudeSkillCalls(raw, identity5) {
55745
+ function detectClaudeSkillCalls(raw, identity5, context4) {
55238
55746
  const contentBlocks = raw.content ?? o2(raw.message).content;
55239
55747
  if (!Array.isArray(contentBlocks))
55240
55748
  return [];
55241
55749
  const rows = [];
55750
+ const role = mapRole(raw.type ?? o2(raw.message).role);
55751
+ const recordId = s(raw.uuid, raw.id, raw.requestId);
55752
+ const ts = timestampOf(raw.timestamp, raw.ts, o2(raw.message).timestamp) ?? null;
55753
+ const ordinal = createOrdinalAllocator();
55242
55754
  for (const block of contentBlocks) {
55243
55755
  if (typeof block !== "object" || block === null)
55244
55756
  continue;
55245
55757
  const b = block;
55246
- if (b.type !== "tool_use" || b.name !== "Skill")
55758
+ if (b.type !== "tool_use")
55247
55759
  continue;
55248
55760
  const input = b.input ?? {};
55249
- const skill = s(input.skill);
55250
- if (skill === undefined)
55761
+ const callId = s(b.id);
55762
+ const invocation = callId !== undefined ? { callId, ordinal: 0 } : { recordId, ordinal: ordinal(`tool:${rows.length}`) };
55763
+ if (b.name === "Skill") {
55764
+ const skill = s(input.skill);
55765
+ if (skill === undefined)
55766
+ continue;
55767
+ const canonical = canonicalizeSkillName(skill);
55768
+ rows.push(skillRecord(identity5, skill, s(o2(b.caller).type) === "direct" ? "user" : "model", {
55769
+ args_raw: maybeArgsRaw("claude", "Skill", input) ?? null,
55770
+ args_digest: argsDigest(input),
55771
+ call_id: callId ?? null,
55772
+ started_at: ts,
55773
+ evidence_kind: "load",
55774
+ status: "unknown",
55775
+ invocation_id: invocationIdFor(context4, identity5.sessionId, invocation),
55776
+ ...originFields(context4, canonical, {})
55777
+ }));
55251
55778
  continue;
55252
- rows.push(skillRecord(identity5, skill, s(o2(b.caller).type) === "direct" ? "user" : "model", {
55253
- args_raw: maybeArgsRaw("claude", "Skill", input) ?? null,
55254
- args_digest: argsDigest(input),
55255
- call_id: s(b.id) ?? null
55256
- }));
55779
+ }
55780
+ if (b.name === "Task") {
55781
+ const subagent = s(input.subagent_type, input.agent_type, input.agent) ?? "subagent";
55782
+ rows.push(skillRecord(identity5, subagent, "model", {
55783
+ args_raw: maybeArgsRaw("claude", "Task", input) ?? null,
55784
+ args_digest: argsDigest(input),
55785
+ call_id: callId ?? null,
55786
+ started_at: ts,
55787
+ ...originFields(context4, canonicalizeSkillName(subagent), {}),
55788
+ capability_kind: "subagent",
55789
+ evidence_kind: "delegation",
55790
+ status: "unknown",
55791
+ invocation_id: invocationIdFor(context4, identity5.sessionId, invocation)
55792
+ }));
55793
+ continue;
55794
+ }
55795
+ if (b.name === "Read") {
55796
+ const filePath = s(input.file_path, input.path);
55797
+ if (filePath === undefined || lastPathSegmentNorm(filePath) !== "SKILL.md")
55798
+ continue;
55799
+ const canonical = canonicalizeSkillName(skillNameFromPath(filePath));
55800
+ rows.push(skillRecord(identity5, skillNameFromPath(filePath), "model", {
55801
+ skill_path: filePath,
55802
+ args_raw: maybeArgsRaw("claude", "Read", input) ?? null,
55803
+ args_digest: argsDigest(input),
55804
+ call_id: callId ?? null,
55805
+ started_at: ts,
55806
+ evidence_kind: "load",
55807
+ status: "unknown",
55808
+ invocation_id: invocationIdFor(context4, identity5.sessionId, invocation),
55809
+ ...originFields(context4, canonical, { skillPath: filePath })
55810
+ }));
55811
+ continue;
55812
+ }
55813
+ if (b.name === "Bash") {
55814
+ const command = s(input.command);
55815
+ if (command === undefined)
55816
+ continue;
55817
+ const targets = parseLiteralReadTargets(command);
55818
+ for (let i2 = 0;i2 < targets.length; i2 += 1) {
55819
+ const target = targets[i2] ?? "";
55820
+ const canonical = canonicalizeSkillName(skillNameFromPath(target));
55821
+ rows.push(skillRecord(identity5, skillNameFromPath(target), "model", {
55822
+ skill_path: target,
55823
+ args_raw: maybeArgsRaw("claude", "Bash", input) ?? null,
55824
+ args_digest: argsDigest(input),
55825
+ call_id: callId ?? null,
55826
+ started_at: ts,
55827
+ evidence_kind: "load",
55828
+ status: "unknown",
55829
+ invocation_id: invocationIdFor(context4, identity5.sessionId, { ...invocation, ordinal: i2 }),
55830
+ ...originFields(context4, canonical, { skillPath: target })
55831
+ }));
55832
+ }
55833
+ }
55834
+ }
55835
+ if (role === "user") {
55836
+ const text3 = extractUserTextClaude(contentBlocks);
55837
+ if (text3 !== undefined) {
55838
+ const envelope = leadingInjectionMatch(text3, CLAUDE_COMMAND_NAME_ANCHORED);
55839
+ const rawName = envelope?.[1] ?? "";
55840
+ if (rawName.length > 0) {
55841
+ const canonical = canonicalizeSkillName(rawName);
55842
+ if (canonical.length > 0) {
55843
+ rows.push(skillRecord(identity5, canonical, "user", {
55844
+ args_raw: text3.match(CLAUDE_COMMAND_ARGS)?.[1]?.trim() || null,
55845
+ started_at: ts,
55846
+ capability_kind: "command",
55847
+ evidence_kind: "request",
55848
+ status: "unknown",
55849
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
55850
+ recordId,
55851
+ ordinal: ordinal(`cmd:${canonical}`)
55852
+ })
55853
+ }));
55854
+ }
55855
+ }
55856
+ }
55257
55857
  }
55258
55858
  return rows;
55259
55859
  }
55260
- function detectPiSkillCalls(raw, identity5) {
55860
+ function extractUserTextClaude(contentBlocks) {
55861
+ const parts = [];
55862
+ for (const block of contentBlocks) {
55863
+ if (typeof block !== "object" || block === null)
55864
+ continue;
55865
+ const b = block;
55866
+ if (b.type === "tool_result")
55867
+ continue;
55868
+ if (typeof b.text === "string")
55869
+ parts.push(b.text);
55870
+ }
55871
+ return parts.length > 0 ? parts.join(`
55872
+ `) : undefined;
55873
+ }
55874
+ function lastPathSegmentNorm(path9) {
55875
+ const normalized = path9.replace(/\\/g, "/");
55876
+ const idx = normalized.lastIndexOf("/");
55877
+ return idx === -1 ? normalized : normalized.slice(idx + 1);
55878
+ }
55879
+ function isQuotedSignatureContext(text3, matchIndex) {
55880
+ const lineStart = text3.lastIndexOf(`
55881
+ `, matchIndex - 1) + 1;
55882
+ if (text3.slice(lineStart, matchIndex).trim().length > 0)
55883
+ return true;
55884
+ let openFence = "";
55885
+ for (const line of text3.slice(0, lineStart).split(`
55886
+ `)) {
55887
+ const fence = /^\s{0,3}(`{3,}|~{3,})/.exec(line);
55888
+ if (fence === null)
55889
+ continue;
55890
+ const run = fence[1] ?? "";
55891
+ if (openFence === "")
55892
+ openFence = run;
55893
+ else if (run[0] === openFence[0] && run.length >= openFence.length)
55894
+ openFence = "";
55895
+ }
55896
+ return openFence !== "";
55897
+ }
55898
+ function isCodexMarkerLine(line) {
55899
+ const trimmed = line.trim();
55900
+ return CODEX_DOLLAR_MARKER.test(trimmed) || CODEX_SLASH_MARKER.test(trimmed) || /^-\s+skill:\s*\S+/.test(trimmed);
55901
+ }
55902
+ function isCodexWrapperLeadPosition(text3, matchIndex, chainStart) {
55903
+ const before = text3.slice(0, matchIndex);
55904
+ if (before.trim().length === 0)
55905
+ return true;
55906
+ if (chainStart !== undefined && text3.slice(chainStart, matchIndex).trim().length === 0)
55907
+ return true;
55908
+ const lines = before.split(`
55909
+ `);
55910
+ if ((lines[lines.length - 1] ?? "").trim().length > 0)
55911
+ return false;
55912
+ if (lines.length < 2)
55913
+ return false;
55914
+ return isCodexMarkerLine(lines[lines.length - 2] ?? "");
55915
+ }
55916
+ function leadingInjectionMatch(text3, pattern) {
55917
+ const trimmed = text3.trimStart();
55918
+ const offset = text3.length - trimmed.length;
55919
+ const match = trimmed.match(pattern);
55920
+ if (match === null || match.index === undefined)
55921
+ return null;
55922
+ if (isQuotedSignatureContext(text3, offset + match.index))
55923
+ return null;
55924
+ return match;
55925
+ }
55926
+ function detectPiSkillCalls(raw, identity5, context4) {
55261
55927
  const msg = raw.message;
55262
- if (piRole(msg?.role ?? raw.role ?? raw.recordType ?? raw.type) !== "user")
55263
- return [];
55264
- const text3 = extractContentText(msg?.content ?? raw.content);
55265
- if (text3 === undefined)
55266
- return [];
55928
+ const role = piRole(msg?.role ?? raw.role ?? raw.recordType ?? raw.type);
55929
+ const recordId = s(raw.id, raw.uuid, raw.requestId);
55930
+ const ts = timestampOf(raw.timestamp, raw.ts, o2(msg).timestamp) ?? null;
55267
55931
  const rows = [];
55268
- for (const match of text3.matchAll(PI_SKILL_WRAPPER)) {
55269
- rows.push(skillRecord(identity5, match[1] ?? "", "user", { skill_path: match[2] || null }));
55932
+ if (role === "user") {
55933
+ const text3 = extractContentText(msg?.content ?? raw.content);
55934
+ if (text3 === undefined)
55935
+ return [];
55936
+ const ordinal = createOrdinalAllocator();
55937
+ const wrapper = leadingInjectionMatch(text3, PI_SKILL_WRAPPER_ANCHORED);
55938
+ if (wrapper !== null) {
55939
+ const skillPath = wrapper[2] || null;
55940
+ const canonical = canonicalizeSkillName(wrapper[1] ?? "");
55941
+ if (canonical.length > 0) {
55942
+ rows.push(skillRecord(identity5, canonical, "user", {
55943
+ skill_path: skillPath,
55944
+ started_at: ts,
55945
+ evidence_kind: "load",
55946
+ status: "ok",
55947
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
55948
+ recordId,
55949
+ ordinal: ordinal(`skill:${canonical}`)
55950
+ }),
55951
+ ...originFields(context4, canonical, { skillPath })
55952
+ }));
55953
+ }
55954
+ }
55955
+ return rows;
55956
+ }
55957
+ if (role === "assistant") {
55958
+ const contentBlocks = msg?.content ?? raw.content;
55959
+ if (!Array.isArray(contentBlocks))
55960
+ return [];
55961
+ for (const block of contentBlocks) {
55962
+ if (typeof block !== "object" || block === null)
55963
+ continue;
55964
+ const call = normalizeOmpToolCall(block);
55965
+ if (call === null || !READ_FAMILY_TOOLS.has(String(call.name ?? "")))
55966
+ continue;
55967
+ const args = call.input ?? call.arguments ?? {};
55968
+ const filePath = s(args.filePath, args.file_path, args.path, args.target_file);
55969
+ if (filePath === undefined || lastPathSegmentNorm(filePath) !== "SKILL.md")
55970
+ continue;
55971
+ const callId = s(call.id);
55972
+ const canonical = canonicalizeSkillName(skillNameFromPath(filePath));
55973
+ rows.push(skillRecord(identity5, canonical, "model", {
55974
+ skill_path: filePath,
55975
+ args_raw: maybeArgsRaw("pi", String(call.name ?? "read"), args) ?? null,
55976
+ args_digest: argsDigest(args),
55977
+ call_id: callId ?? null,
55978
+ started_at: ts,
55979
+ evidence_kind: "load",
55980
+ status: "unknown",
55981
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
55982
+ callId,
55983
+ recordId: callId === undefined ? recordId : undefined,
55984
+ ordinal: rows.length
55985
+ }),
55986
+ ...originFields(context4, canonical, { skillPath: filePath })
55987
+ }));
55988
+ }
55270
55989
  }
55271
55990
  return rows;
55272
55991
  }
55273
- function detectOmpSkillCalls(raw, identity5) {
55992
+ function detectOmpSkillCalls(raw, identity5, context4) {
55274
55993
  const msg = raw.message;
55275
- if (mapRole(msg?.role ?? raw.type ?? raw.role) !== "assistant")
55276
- return [];
55277
- const contentBlocks = msg?.content ?? raw.content;
55278
- if (!Array.isArray(contentBlocks))
55279
- return [];
55994
+ const role = mapRole(msg?.role ?? raw.type ?? raw.role);
55995
+ const recordId = s(raw.id, raw.uuid, raw.requestId);
55996
+ const ts = timestampOf(raw.timestamp, raw.ts, o2(msg).timestamp) ?? null;
55280
55997
  const rows = [];
55281
- for (const block of contentBlocks) {
55282
- const call = normalizeOmpToolCall(block);
55283
- if (call === null || call.name !== "Skill")
55284
- continue;
55285
- const input = call.input ?? call.arguments;
55286
- const skill = s(input?.skill);
55287
- if (skill === undefined)
55288
- continue;
55289
- rows.push(skillRecord(identity5, skill, "model", {
55290
- args_raw: maybeArgsRaw("omp", "Skill", input) ?? null,
55291
- args_digest: argsDigest(input),
55292
- call_id: s(call.id) ?? null
55293
- }));
55998
+ if (role === "assistant") {
55999
+ const contentBlocks = msg?.content ?? raw.content;
56000
+ if (!Array.isArray(contentBlocks))
56001
+ return [];
56002
+ for (const block of contentBlocks) {
56003
+ const call = normalizeOmpToolCall(block);
56004
+ if (call === null)
56005
+ continue;
56006
+ const input = call.input ?? call.arguments;
56007
+ if (call.name === "Skill") {
56008
+ const skill = s(input?.skill);
56009
+ if (skill === undefined)
56010
+ continue;
56011
+ const callId = s(call.id);
56012
+ rows.push(skillRecord(identity5, skill, "model", {
56013
+ args_raw: maybeArgsRaw("omp", "Skill", input) ?? null,
56014
+ args_digest: argsDigest(input),
56015
+ call_id: callId ?? null,
56016
+ started_at: ts,
56017
+ evidence_kind: "load",
56018
+ status: "unknown",
56019
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56020
+ callId,
56021
+ recordId: callId === undefined ? recordId : undefined,
56022
+ ordinal: rows.length
56023
+ }),
56024
+ ...originFields(context4, canonicalizeSkillName(skill), {})
56025
+ }));
56026
+ continue;
56027
+ }
56028
+ if (READ_FAMILY_TOOLS.has(String(call.name ?? ""))) {
56029
+ const args = input ?? {};
56030
+ const filePath = s(args.filePath, args.file_path, args.path, args.target_file);
56031
+ if (filePath === undefined || lastPathSegmentNorm(filePath) !== "SKILL.md")
56032
+ continue;
56033
+ const callId = s(call.id);
56034
+ const canonical = canonicalizeSkillName(skillNameFromPath(filePath));
56035
+ rows.push(skillRecord(identity5, canonical, "model", {
56036
+ skill_path: filePath,
56037
+ args_raw: maybeArgsRaw("omp", String(call.name ?? "read"), args) ?? null,
56038
+ args_digest: argsDigest(args),
56039
+ call_id: callId ?? null,
56040
+ started_at: ts,
56041
+ evidence_kind: "load",
56042
+ status: "unknown",
56043
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56044
+ callId,
56045
+ recordId: callId === undefined ? recordId : undefined,
56046
+ ordinal: rows.length
56047
+ }),
56048
+ ...originFields(context4, canonical, { skillPath: filePath })
56049
+ }));
56050
+ }
56051
+ }
56052
+ return rows;
56053
+ }
56054
+ if (role === "user") {
56055
+ const text3 = extractContentText(msg?.content ?? raw.content);
56056
+ if (text3 === undefined)
56057
+ return [];
56058
+ const ordinal = createOrdinalAllocator();
56059
+ const wrapper = leadingInjectionMatch(text3, PI_SKILL_WRAPPER_ANCHORED);
56060
+ if (wrapper !== null) {
56061
+ const skillPath = wrapper[2] || null;
56062
+ const canonical = canonicalizeSkillName(wrapper[1] ?? "");
56063
+ if (canonical.length > 0) {
56064
+ rows.push(skillRecord(identity5, canonical, "user", {
56065
+ skill_path: skillPath,
56066
+ started_at: ts,
56067
+ evidence_kind: "load",
56068
+ status: "ok",
56069
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56070
+ recordId,
56071
+ ordinal: ordinal(`skill:${canonical}`)
56072
+ }),
56073
+ ...originFields(context4, canonical, { skillPath })
56074
+ }));
56075
+ }
56076
+ }
55294
56077
  }
55295
56078
  return rows;
55296
56079
  }
55297
- function detectCodexSkillCalls(raw, identity5) {
56080
+ function detectCodexSkillCalls(raw, identity5, context4) {
55298
56081
  const payload = raw.payload ?? raw;
55299
56082
  const recordType = String(raw.type ?? "");
55300
56083
  const payloadType = String(payload.type ?? "");
55301
56084
  let role;
55302
56085
  if (recordType === "response_item") {
55303
- role = payloadType === "message" ? mapRole(payload.role) : payloadType === "agent_message" ? "assistant" : "meta";
56086
+ role = payloadType === "message" ? mapRole(payload.role) : payloadType === "agent_message" ? "assistant" : payloadType === "function_call" || payloadType === "custom_tool_call" ? "tool" : "meta";
55304
56087
  } else if (recordType === "user" || recordType === "assistant") {
55305
56088
  role = mapRole(recordType);
55306
56089
  } else if (recordType === "message") {
@@ -55308,42 +56091,200 @@ function detectCodexSkillCalls(raw, identity5) {
55308
56091
  } else {
55309
56092
  return [];
55310
56093
  }
56094
+ if (role === "tool") {
56095
+ const toolName = String(payload.name ?? "");
56096
+ if (!CODEX_SHELL_TOOLS.has(toolName) && !toolName.endsWith(".exec"))
56097
+ return [];
56098
+ const callId = s(payload.call_id, payload.id);
56099
+ const argsText = s(payload.arguments, payload.input);
56100
+ if (argsText === undefined)
56101
+ return [];
56102
+ const rows2 = [];
56103
+ const ts2 = timestampOf(raw.timestamp, raw.ts, payload.created_at) ?? null;
56104
+ let command = null;
56105
+ try {
56106
+ const parsed = JSON.parse(argsText);
56107
+ if (typeof parsed === "object" && parsed !== null) {
56108
+ const cmd = parsed.command;
56109
+ if (typeof cmd === "string")
56110
+ command = cmd;
56111
+ else if (Array.isArray(cmd))
56112
+ command = cmd.filter((c3) => typeof c3 === "string").join(" ");
56113
+ }
56114
+ } catch {
56115
+ command = null;
56116
+ }
56117
+ const pushRead = (target, ordinal2) => {
56118
+ const canonical = canonicalizeSkillName(skillNameFromPath(target));
56119
+ rows2.push(skillRecord(identity5, canonical, "model", {
56120
+ skill_path: target,
56121
+ args_raw: argsText,
56122
+ args_digest: sha256Text(argsText),
56123
+ call_id: callId ?? null,
56124
+ started_at: ts2,
56125
+ evidence_kind: "load",
56126
+ status: "unknown",
56127
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56128
+ callId: callId ?? recordIdFallback(raw),
56129
+ ordinal: ordinal2
56130
+ }),
56131
+ ...originFields(context4, canonical, { skillPath: target })
56132
+ }));
56133
+ };
56134
+ if (command !== null) {
56135
+ for (let i2 = 0;i2 < parseLiteralReadTargets(command).length; i2 += 1) {
56136
+ pushRead(parseLiteralReadTargets(command)[i2] ?? "", i2);
56137
+ }
56138
+ }
56139
+ const nestedLiterals = extractNestedExecCommandLiterals(argsText);
56140
+ let nestedOrdinal = 0;
56141
+ for (const literal2 of nestedLiterals) {
56142
+ for (const target of parseLiteralReadTargets(literal2)) {
56143
+ pushRead(target, 1000 + nestedOrdinal);
56144
+ nestedOrdinal += 1;
56145
+ }
56146
+ }
56147
+ return rows2;
56148
+ }
55311
56149
  if (role !== "user")
55312
56150
  return [];
55313
56151
  const text3 = extractContentText(payload.content ?? raw.content) ?? s(payload.text, raw.text);
55314
56152
  if (text3 === undefined)
55315
56153
  return [];
55316
56154
  const rows = [];
56155
+ const recordId = s(raw.id, payload.id, raw.uuid);
56156
+ const ts = timestampOf(raw.timestamp, raw.ts) ?? null;
56157
+ const ordinal = createOrdinalAllocator();
56158
+ const wrappers = [];
56159
+ let acceptedWrapperEnd;
55317
56160
  for (const match of text3.matchAll(CODEX_SKILL_BLOCK)) {
55318
- rows.push(skillRecord(identity5, match[1] ?? "", "user", { skill_path: match[2] ?? null }));
56161
+ const start = match.index ?? 0;
56162
+ if (isQuotedSignatureContext(text3, start))
56163
+ continue;
56164
+ if (!isCodexWrapperLeadPosition(text3, start, acceptedWrapperEnd))
56165
+ continue;
56166
+ acceptedWrapperEnd = start + match[0].length;
56167
+ const body = (match[3] ?? "").trim();
56168
+ const skillPath = match[2] || null;
56169
+ wrappers.push({
56170
+ name: canonicalizeSkillName(match[1] ?? ""),
56171
+ path: skillPath,
56172
+ digest: body.length > 0 ? sha256Text(body) : null
56173
+ });
56174
+ }
56175
+ const wrapperOccurrences = new Map;
56176
+ for (const wrapper of wrappers) {
56177
+ const occurrence = (wrapperOccurrences.get(wrapper.name) ?? 0) + 1;
56178
+ wrapperOccurrences.set(wrapper.name, occurrence);
56179
+ const ordinalKey = occurrence === 1 ? `skill:${wrapper.name}` : `skill:${wrapper.name}#${occurrence}`;
56180
+ rows.push(skillRecord(identity5, wrapper.name, "user", {
56181
+ skill_path: wrapper.path,
56182
+ args_digest: wrapper.digest,
56183
+ started_at: ts,
56184
+ evidence_kind: "load",
56185
+ status: "ok",
56186
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56187
+ recordId,
56188
+ ordinal: ordinal(ordinalKey)
56189
+ }),
56190
+ ...originFields(context4, wrapper.name, { skillPath: wrapper.path, artifactDigest: wrapper.digest })
56191
+ }));
56192
+ }
56193
+ const leadingMarker = text3.match(CODEX_DOLLAR_MARKER) ?? text3.match(CODEX_SLASH_MARKER);
56194
+ if (leadingMarker !== null) {
56195
+ const markerName = canonicalizeSkillName(leadingMarker[1] ?? "");
56196
+ rows.push(skillRecord(identity5, markerName, "user", {
56197
+ started_at: ts,
56198
+ evidence_kind: "request",
56199
+ status: "unknown",
56200
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56201
+ recordId,
56202
+ ordinal: ordinal(`skill:${markerName}`)
56203
+ }),
56204
+ ...originFields(context4, markerName, {})
56205
+ }));
55319
56206
  }
55320
56207
  return rows;
55321
56208
  }
55322
- function detectAgySkillCalls(raw, identity5) {
55323
- if (String(raw.type ?? "") !== "PLANNER_RESPONSE" || !Array.isArray(raw.tool_calls))
55324
- return [];
56209
+ function recordIdFallback(raw) {
56210
+ return s(raw.id, raw.uuid) ?? "codex-record";
56211
+ }
56212
+ function detectAgySkillCalls(raw, identity5, context4) {
56213
+ const recordType = String(raw.type ?? "");
56214
+ const recordId = s(raw.id, raw.event_id, raw.request_id);
56215
+ const ts = timestampOf(raw.created_at, raw.timestamp, raw.ts) ?? null;
55325
56216
  const rows = [];
55326
- for (const tc of raw.tool_calls) {
55327
- const tool = s(tc.name, tc.tool_name);
55328
- if (tool !== "view_file")
55329
- continue;
55330
- const args = tc.args ?? tc.arguments ?? {};
55331
- if (args.toolAction !== "Viewing skill file")
55332
- continue;
55333
- const path9 = s(args.AbsolutePath, args.absolute_path);
55334
- if (path9 === undefined || !path9.replace(/\\/g, "/").endsWith("/SKILL.md"))
55335
- continue;
55336
- const summary = s(args.toolSummary);
55337
- const skillName = summary?.match(/SKILL\.md for (.+)$/)?.[1] ?? skillNameFromPath(path9);
55338
- rows.push(skillRecord(identity5, skillName, "model", {
55339
- skill_path: path9,
55340
- args_raw: maybeArgsRaw("agy", "view_file", args) ?? null,
55341
- args_digest: argsDigest(args)
55342
- }));
56217
+ if (recordType === "PLANNER_RESPONSE" && Array.isArray(raw.tool_calls)) {
56218
+ for (const tc of raw.tool_calls) {
56219
+ const tool = s(tc.name, tc.tool_name);
56220
+ if (tool === "view_file") {
56221
+ const args = tc.args ?? tc.arguments ?? {};
56222
+ if (args.toolAction !== "Viewing skill file")
56223
+ continue;
56224
+ const path9 = s(args.AbsolutePath, args.absolute_path);
56225
+ if (path9 === undefined || lastPathSegmentNorm(path9) !== "SKILL.md")
56226
+ continue;
56227
+ const summary = s(args.toolSummary);
56228
+ const skillName = summary?.match(/SKILL\.md for (.+)$/)?.[1] ?? skillNameFromPath(path9);
56229
+ const canonical = canonicalizeSkillName(skillName);
56230
+ const callId = s(tc.id, tc.call_id);
56231
+ rows.push(skillRecord(identity5, canonical, "model", {
56232
+ skill_path: path9,
56233
+ args_raw: maybeArgsRaw("agy", "view_file", args) ?? null,
56234
+ args_digest: argsDigest(args),
56235
+ call_id: callId ?? null,
56236
+ started_at: ts,
56237
+ evidence_kind: "load",
56238
+ status: "unknown",
56239
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56240
+ callId,
56241
+ recordId: callId === undefined ? recordId : undefined,
56242
+ ordinal: rows.length
56243
+ }),
56244
+ ...originFields(context4, canonical, { skillPath: path9 })
56245
+ }));
56246
+ continue;
56247
+ }
56248
+ if (tool === "INVOKE_SUBAGENT") {
56249
+ const args = tc.args ?? tc.arguments ?? {};
56250
+ const subagent = s(args.subagent_type, args.subagent, args.agent_name, args.agent, args.name) ?? "subagent";
56251
+ const callId = s(tc.id, tc.call_id);
56252
+ rows.push(skillRecord(identity5, subagent, "model", {
56253
+ args_raw: maybeArgsRaw("agy", "INVOKE_SUBAGENT", args) ?? null,
56254
+ args_digest: argsDigest(args),
56255
+ call_id: callId ?? null,
56256
+ started_at: ts,
56257
+ ...originFields(context4, canonicalizeSkillName(subagent), {}),
56258
+ capability_kind: "subagent",
56259
+ evidence_kind: "delegation",
56260
+ status: "unknown",
56261
+ invocation_id: invocationIdFor(context4, identity5.sessionId, {
56262
+ callId,
56263
+ recordId: callId === undefined ? recordId : undefined,
56264
+ ordinal: rows.length
56265
+ })
56266
+ }));
56267
+ }
56268
+ }
56269
+ }
56270
+ if (recordType === "slash_command") {
56271
+ const display = s(raw.display);
56272
+ if (display !== undefined) {
56273
+ const commandName = s(raw.command, raw.name) ?? display.match(/(?:^|\s)\/([a-z][a-z0-9:-]*)/)?.[1];
56274
+ if (commandName !== undefined) {
56275
+ rows.push(skillRecord(identity5, canonicalizeSkillName(commandName), "user", {
56276
+ started_at: ts,
56277
+ capability_kind: "command",
56278
+ evidence_kind: "request",
56279
+ status: "unknown",
56280
+ invocation_id: invocationIdFor(context4, identity5.sessionId, { recordId, ordinal: 0 })
56281
+ }));
56282
+ }
56283
+ }
55343
56284
  }
55344
56285
  return rows;
55345
56286
  }
55346
- function detectGeminiSkillCalls(raw, identity5) {
56287
+ function detectGeminiSkillCalls(raw, identity5, context4) {
55347
56288
  if (String(raw.type ?? "") !== "user")
55348
56289
  return [];
55349
56290
  const content = geminiContent(raw);
@@ -55352,9 +56293,20 @@ function detectGeminiSkillCalls(raw, identity5) {
55352
56293
  const match = content.match(GEMINI_L0_PREFIX);
55353
56294
  if (match === null)
55354
56295
  return [];
55355
- return [skillRecord(identity5, match[1] ?? "", "user")];
56296
+ const canonical = canonicalizeSkillName(match[1] ?? "");
56297
+ const recordId = s(raw.id, raw.uuid);
56298
+ const ts = timestampOf(raw.timestamp, raw.ts) ?? null;
56299
+ return [
56300
+ skillRecord(identity5, canonical, "user", {
56301
+ started_at: ts,
56302
+ evidence_kind: "request",
56303
+ status: "unknown",
56304
+ invocation_id: invocationIdFor(context4, identity5.sessionId, { recordId, ordinal: 0 }),
56305
+ ...originFields(context4, canonical, {})
56306
+ })
56307
+ ];
55356
56308
  }
55357
- function detectGrokSkillCalls(raw, identity5) {
56309
+ function detectGrokSkillCalls(raw, identity5, context4) {
55358
56310
  const n2 = normalizeGrokRecord(raw);
55359
56311
  if (n2.recordType !== "tool_call" || n2.toolName !== "read_file")
55360
56312
  return [];
@@ -55362,17 +56314,34 @@ function detectGrokSkillCalls(raw, identity5) {
55362
56314
  if (o2(meta3["x.ai/tool"]).namespace !== "grok_build")
55363
56315
  return [];
55364
56316
  const targetFile = s(o2(n2.toolArgs).target_file);
55365
- if (targetFile === undefined || !targetFile.replace(/\\/g, "/").endsWith("/SKILL.md"))
56317
+ if (targetFile === undefined || lastPathSegmentNorm(targetFile) !== "SKILL.md")
55366
56318
  return [];
56319
+ const canonical = canonicalizeSkillName(skillNameFromPath(targetFile));
56320
+ const recordId = s(n2.body.id, raw.id, raw.uuid);
56321
+ const callId = s(n2.body.call_id, n2.body.itemId, recordId);
56322
+ const status = grokOutcomeStatus(typeof n2.body.status === "string" ? n2.body.status : undefined);
55367
56323
  return [
55368
- skillRecord(identity5, skillNameFromPath(targetFile), "model", {
56324
+ skillRecord(identity5, canonical, "model", {
55369
56325
  skill_path: targetFile,
55370
56326
  args_raw: maybeArgsRaw("grok", "read_file", n2.toolArgs) ?? null,
55371
56327
  args_digest: argsDigest(n2.toolArgs),
55372
- started_at: n2.ts ?? null
56328
+ call_id: callId ?? null,
56329
+ started_at: n2.ts ?? null,
56330
+ status,
56331
+ evidence_kind: "load",
56332
+ invocation_id: invocationIdFor(context4, identity5.sessionId, { callId, ordinal: 0 }),
56333
+ ...originFields(context4, canonical, { skillPath: targetFile })
55373
56334
  })
55374
56335
  ];
55375
56336
  }
56337
+ function grokOutcomeStatus(toolStatus) {
56338
+ const value = String(toolStatus ?? "").toLowerCase();
56339
+ if (value === "ok" || value === "success" || value === "done" || value === "completed")
56340
+ return "ok";
56341
+ if (value === "error" || value === "failed")
56342
+ return "error";
56343
+ return "unknown";
56344
+ }
55376
56345
  function argsDigest(args) {
55377
56346
  const redacted = redactArgs(args);
55378
56347
  return sha256(redacted);
@@ -55785,7 +56754,12 @@ function ompToolResultTiming(raw) {
55785
56754
  return null;
55786
56755
  const details = o2(msg.details);
55787
56756
  const wallTimeMs = typeof details.wallTimeMs === "number" && Number.isFinite(details.wallTimeMs) ? details.wallTimeMs : undefined;
55788
- return { toolCallId, wallTimeMs, timestampMs: timestampToEpochMs(raw.timestamp ?? msg.timestamp) };
56757
+ return {
56758
+ toolCallId,
56759
+ isError: msg.isError === true,
56760
+ wallTimeMs,
56761
+ timestampMs: timestampToEpochMs(raw.timestamp ?? msg.timestamp)
56762
+ };
55789
56763
  }
55790
56764
  function claudeToolResultTiming(raw) {
55791
56765
  const content = o2(raw.message).content;
@@ -55807,6 +56781,7 @@ function claudeToolResultTiming(raw) {
55807
56781
  const resultBytes = JSON.stringify(payload ?? null)?.length ?? 2;
55808
56782
  return {
55809
56783
  toolCallId,
56784
+ isError: b.is_error === true,
55810
56785
  timestampMs: timestampToEpochMs(raw.timestamp),
55811
56786
  durationMs,
55812
56787
  resultBytes
@@ -56677,9 +57652,10 @@ function extractContentText(content) {
56677
57652
  function stableFieldShape(raw) {
56678
57653
  return Object.keys(raw).map((k) => k.toLowerCase()).sort().join("+");
56679
57654
  }
56680
- var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, SKILL_CALL_MAPPER_KEYS, HARNESS_SKILL_PACKAGES, PI_SKILL_WRAPPER, CODEX_SKILL_BLOCK, GEMINI_L0_PREFIX, BASH_COMMAND_MAX_CHARS = 8192, GENERIC_ARGS_MAX_CHARS = 8192, BULKY_PAYLOAD_KEYS, UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", AGY_BRAIN_REGEX, DSH_SESSION_REGEX, CODEX_ROLLOUT_REGEX, GROK_META_TYPES, CLAUDE_FIELD_MAP, PI_FIELD_MAP, OMP_FIELD_MAP, CODEX_FIELD_MAP, AGY_FIELD_MAP, GROK_FIELD_MAP, GEMINI_FIELD_MAP, DSH_FIELD_MAP, passthroughSchema, CLAUDE_SCHEMA, PI_SCHEMA, OMP_SCHEMA, CODEX_SCHEMA, AGY_SCHEMA, GROK_SCHEMA, GEMINI_SCHEMA, DSH_SCHEMA;
57655
+ var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, SKILL_CALL_MAPPER_KEYS, HARNESS_SKILL_PACKAGES, CLAUDE_COMMAND_NAME_ANCHORED, CLAUDE_COMMAND_ARGS, PI_SKILL_WRAPPER_ANCHORED, READ_FAMILY_TOOLS, CODEX_SKILL_BLOCK, CODEX_DOLLAR_MARKER, CODEX_SLASH_MARKER, CODEX_SHELL_TOOLS, GEMINI_L0_PREFIX, BASH_COMMAND_MAX_CHARS = 8192, GENERIC_ARGS_MAX_CHARS = 8192, BULKY_PAYLOAD_KEYS, UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", AGY_BRAIN_REGEX, DSH_SESSION_REGEX, CODEX_ROLLOUT_REGEX, GROK_META_TYPES, CLAUDE_FIELD_MAP, PI_FIELD_MAP, OMP_FIELD_MAP, CODEX_FIELD_MAP, AGY_FIELD_MAP, GROK_FIELD_MAP, GEMINI_FIELD_MAP, DSH_FIELD_MAP, passthroughSchema, CLAUDE_SCHEMA, PI_SCHEMA, OMP_SCHEMA, CODEX_SCHEMA, AGY_SCHEMA, GROK_SCHEMA, GEMINI_SCHEMA, DSH_SCHEMA;
56681
57656
  var init_mappers = __esm(() => {
56682
57657
  init_zod();
57658
+ init_capability();
56683
57659
  init_hash();
56684
57660
  MESSAGE_MAPPER_KEYS = [
56685
57661
  "_codexUsageCarrier",
@@ -56732,11 +57708,22 @@ var init_mappers = __esm(() => {
56732
57708
  "status",
56733
57709
  "started_at",
56734
57710
  "completed_at",
56735
- "duration_ms"
57711
+ "duration_ms",
57712
+ "capability_kind",
57713
+ "evidence_kind",
57714
+ "invocation_id",
57715
+ "origin_identity",
57716
+ "_capabilityConflict"
56736
57717
  ];
56737
57718
  HARNESS_SKILL_PACKAGES = new Set(["sp", "rd3"]);
56738
- PI_SKILL_WRAPPER = /<skill\s+name="([^"]+)"(?:\s+location="([^"]*)")?\s*>/g;
56739
- CODEX_SKILL_BLOCK = /<skill>\s*<name>([^<]+)<\/name>\s*<path>([^<]+)<\/path>\s*<\/skill>/g;
57719
+ CLAUDE_COMMAND_NAME_ANCHORED = /^<command-name>([^<]+)<\/command-name>/;
57720
+ CLAUDE_COMMAND_ARGS = /<command-args>([\s\S]*?)<\/command-args>/;
57721
+ PI_SKILL_WRAPPER_ANCHORED = /^<skill\s+name="([^"]+)"(?:\s+location="([^"]*)")?\s*>/;
57722
+ READ_FAMILY_TOOLS = new Set(["read", "read_file", "view"]);
57723
+ CODEX_SKILL_BLOCK = /<skill>\s*<name>([^<]+)<\/name>\s*<path>([^<]+)<\/path>([\s\S]*?)<\/skill>/g;
57724
+ CODEX_DOLLAR_MARKER = /^\$([a-z][a-z0-9]*(?:-[a-z0-9]+)*)(?![\w./:])/;
57725
+ CODEX_SLASH_MARKER = /^\/([a-z][a-z0-9]*(?:-[a-z0-9]+)*)(?![\w./:])/;
57726
+ CODEX_SHELL_TOOLS = new Set(["shell", "exec_command", "exec"]);
56740
57727
  GEMINI_L0_PREFIX = /^\s*\/((?:sp|rd3)-[a-z0-9-]+)/;
56741
57728
  BULKY_PAYLOAD_KEYS = new Set([
56742
57729
  "content",
@@ -56801,7 +57788,7 @@ var init_mappers = __esm(() => {
56801
57788
  DSH_SCHEMA = passthroughSchema;
56802
57789
  });
56803
57790
 
56804
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
57791
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
56805
57792
  function firstString(...values) {
56806
57793
  for (const value of values) {
56807
57794
  if (typeof value === "string" && value.length > 0)
@@ -56962,7 +57949,7 @@ var init_sources = __esm(() => {
56962
57949
  };
56963
57950
  });
56964
57951
 
56965
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
57952
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
56966
57953
  function targetTableFor(table3) {
56967
57954
  if (!VALID_TABLE_NAME.test(table3)) {
56968
57955
  throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
@@ -56989,6 +57976,34 @@ async function applyHistoryImportSchema(db2) {
56989
57976
  await db2.exec(sql4);
56990
57977
  }
56991
57978
  }
57979
+ await ensureSkillCallCapabilityColumns(db2);
57980
+ }
57981
+ async function ensureSkillCallCapabilityColumns(db2) {
57982
+ const existing = new Set;
57983
+ for (const row of await db2.queryAll("PRAGMA table_info(history_skill_call)")) {
57984
+ existing.add(row.name);
57985
+ }
57986
+ if (existing.size === 0)
57987
+ return;
57988
+ for (const [column2, type] of SKILL_CALL_CAPABILITY_COLUMNS) {
57989
+ if (!existing.has(column2)) {
57990
+ await db2.exec(`ALTER TABLE history_skill_call ADD COLUMN ${column2} ${type}`);
57991
+ }
57992
+ }
57993
+ }
57994
+ function skillCallOutcomeUpdateOp(recordHash, status, completedAt, durationMs) {
57995
+ return {
57996
+ sql: `UPDATE history_skill_call
57997
+ SET status = ?, completed_at = ?, duration_ms = ?
57998
+ WHERE record_hash = ?`,
57999
+ params: [status, completedAt, durationMs, recordHash]
58000
+ };
58001
+ }
58002
+ async function resolveSkillCallRows(db2, source, sessionId, callId) {
58003
+ const rows = await db2.queryAll(`SELECT record_hash FROM history_skill_call
58004
+ WHERE source = ? AND session_id = ? AND call_id = ?
58005
+ ORDER BY seq, record_hash`, source, sessionId, callId);
58006
+ return rows.map((row) => row.record_hash);
56992
58007
  }
56993
58008
  async function ensureTargetTable(db2, targetTable) {
56994
58009
  const table3 = targetTableFor(targetTable);
@@ -57355,7 +58370,7 @@ function openCodeBulkWriteOperations(entries, checkpointFiles, now) {
57355
58370
  }
57356
58371
  return operations2;
57357
58372
  }
57358
- var TYPED_HISTORY_TABLES, TYPED_TABLE_COLUMNS, TYPED_IGNORED_KEYS, CALL_ID_TOOL_PREFIXES, ARGS_TOOL_NAME_KEYS, TYPED_TABLE_COLUMNS_SOURCE_FILE, OPENCODE_SOURCE = "opencode";
58373
+ var TYPED_HISTORY_TABLES, TYPED_TABLE_COLUMNS, TYPED_IGNORED_KEYS, SKILL_CALL_CAPABILITY_COLUMNS, CALL_ID_TOOL_PREFIXES, ARGS_TOOL_NAME_KEYS, TYPED_TABLE_COLUMNS_SOURCE_FILE, OPENCODE_SOURCE = "opencode";
57359
58374
  var init_jsonl_importer_dao = __esm(() => {
57360
58375
  init_errors5();
57361
58376
  init_schema_sql();
@@ -57429,10 +58444,20 @@ var init_jsonl_importer_dao = __esm(() => {
57429
58444
  "started_at",
57430
58445
  "completed_at",
57431
58446
  "duration_ms",
57432
- "imported_at"
58447
+ "imported_at",
58448
+ "capability_kind",
58449
+ "evidence_kind",
58450
+ "invocation_id",
58451
+ "origin_identity"
57433
58452
  ]
57434
58453
  };
57435
- TYPED_IGNORED_KEYS = new Set(["_meta", "split_index", "source_record_id"]);
58454
+ TYPED_IGNORED_KEYS = new Set(["_meta", "split_index", "source_record_id", "_capabilityConflict"]);
58455
+ SKILL_CALL_CAPABILITY_COLUMNS = [
58456
+ ["capability_kind", "TEXT"],
58457
+ ["evidence_kind", "TEXT"],
58458
+ ["invocation_id", "TEXT"],
58459
+ ["origin_identity", "TEXT"]
58460
+ ];
57436
58461
  CALL_ID_TOOL_PREFIXES = [
57437
58462
  ["call_bash_", "bash"],
57438
58463
  ["call_read_", "read"],
@@ -57446,7 +58471,7 @@ var init_jsonl_importer_dao = __esm(() => {
57446
58471
  TYPED_TABLE_COLUMNS_SOURCE_FILE = ["history_message", "history_tool_call", "history_skill_call"];
57447
58472
  });
57448
58473
 
57449
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
58474
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
57450
58475
  function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
57451
58476
  if (typeof value === "string") {
57452
58477
  return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
@@ -57507,7 +58532,7 @@ var init_redaction = __esm(() => {
57507
58532
  SECRET_KEY = /^(?:api[_-]?key|apikey|api[_-]?secret|token|access[_-]?token|refresh[_-]?token|auth[_-]?token|secret|secret[_-]?key|client[_-]?secret|private[_-]?key|session[_-]?token|password|passwd|authorization)$/i;
57508
58533
  });
57509
58534
 
57510
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/zstd.js
58535
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/zstd.js
57511
58536
  async function zstdDecompress(file2, env2) {
57512
58537
  const result = await new NodeProcessExecutor3().run({
57513
58538
  command: "zstd",
@@ -57527,10 +58552,65 @@ var init_zstd = __esm(() => {
57527
58552
  init_errors5();
57528
58553
  });
57529
58554
 
57530
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
58555
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
57531
58556
  function toolCallKey(source, sessionId, callId) {
57532
58557
  return `${source}${TOOL_CALL_KEY_SEP}${sessionId}${TOOL_CALL_KEY_SEP}${callId}`;
57533
58558
  }
58559
+ function skillResultSignal(source, raw) {
58560
+ if (source === "omp" || source === "pi") {
58561
+ const timing = ompToolResultTiming(raw);
58562
+ if (timing === null)
58563
+ return null;
58564
+ return {
58565
+ callId: timing.toolCallId,
58566
+ status: timing.isError ? "error" : "ok",
58567
+ completedAtMs: timing.timestampMs,
58568
+ durationMs: timing.wallTimeMs
58569
+ };
58570
+ }
58571
+ if (source === "claude") {
58572
+ const timing = claudeToolResultTiming(raw);
58573
+ if (timing === null)
58574
+ return null;
58575
+ return {
58576
+ callId: timing.toolCallId,
58577
+ status: timing.isError ? "error" : "ok",
58578
+ completedAtMs: timing.timestampMs,
58579
+ durationMs: timing.durationMs
58580
+ };
58581
+ }
58582
+ if (source === "codex") {
58583
+ const payload = raw.payload ?? raw;
58584
+ if (String(payload.type ?? "") !== "function_call_output")
58585
+ return null;
58586
+ const callId = typeof payload.call_id === "string" ? payload.call_id : undefined;
58587
+ if (callId === undefined || callId.length === 0)
58588
+ return null;
58589
+ let status = "ok";
58590
+ const outputText = typeof payload.output === "string" ? payload.output : undefined;
58591
+ if (outputText !== undefined) {
58592
+ try {
58593
+ const parsed = JSON.parse(outputText);
58594
+ if (typeof parsed === "object" && parsed !== null) {
58595
+ const body = parsed;
58596
+ const meta3 = body.metadata;
58597
+ const exitCode = typeof meta3 === "object" && meta3 !== null ? meta3.exit_code : undefined;
58598
+ if (typeof exitCode === "number" && exitCode !== 0)
58599
+ status = "error";
58600
+ else if (body.is_error === true || body.error === true)
58601
+ status = "error";
58602
+ }
58603
+ } catch {}
58604
+ }
58605
+ return {
58606
+ callId,
58607
+ status,
58608
+ completedAtMs: timestampToEpochMs(raw.timestamp),
58609
+ durationMs: undefined
58610
+ };
58611
+ }
58612
+ return null;
58613
+ }
57534
58614
  async function resolveToolCallRow(db2, source, sessionId, callId) {
57535
58615
  const row = await db2.queryFirst(`SELECT tc.record_hash AS recordHash, m.ts AS messageTs
57536
58616
  FROM history_tool_call tc
@@ -57560,6 +58640,7 @@ async function runJsonlImport(source, options) {
57560
58640
  const definition = resolveSourceDefinition(source);
57561
58641
  const resolvedSource = definition.source;
57562
58642
  const fileSystem = options.fileSystem ?? createNodeFileSystem3();
58643
+ const capabilityOrigins = validateCapabilityOrigins(options.capabilityOrigins);
57563
58644
  await applyHistoryImportSchema(options.db);
57564
58645
  const mode = options.mode ?? "incremental";
57565
58646
  const files = await discoverFiles(definition, options.roots, options.files, fileSystem, options.paths);
@@ -57579,6 +58660,9 @@ async function runJsonlImport(source, options) {
57579
58660
  const ensuredTargetTables = new Set;
57580
58661
  const desiredHashes = new Set;
57581
58662
  const toolCallRows = new Map;
58663
+ const skillCallRows = new Map;
58664
+ const capabilityConflictSeen = new Set;
58665
+ let capabilityConflictFindings = 0;
57582
58666
  const codexLastAssistant = new Map;
57583
58667
  const checkpoints = mode === "incremental" ? await loadSourceCheckpoints(options.db, resolvedSource) : undefined;
57584
58668
  for (const file2 of files) {
@@ -57610,7 +58694,8 @@ async function runJsonlImport(source, options) {
57610
58694
  source: resolvedSource,
57611
58695
  sourceFile: file2,
57612
58696
  sourceLine: lineNumber,
57613
- splitIndex: 0
58697
+ splitIndex: 0,
58698
+ capabilityOrigins
57614
58699
  });
57615
58700
  let lineSucceeded = false;
57616
58701
  let lineRejected = false;
@@ -57623,7 +58708,8 @@ async function runJsonlImport(source, options) {
57623
58708
  source: resolvedSource,
57624
58709
  sourceFile: file2,
57625
58710
  sourceLine: lineNumber,
57626
- splitIndex
58711
+ splitIndex,
58712
+ capabilityOrigins
57627
58713
  });
57628
58714
  const parsed = definition.schema.safeParse(normalized);
57629
58715
  if (!parsed.success) {
@@ -57649,6 +58735,27 @@ async function runJsonlImport(source, options) {
57649
58735
  }
57650
58736
  if (lineRejected)
57651
58737
  continue;
58738
+ for (const entry2 of prepared) {
58739
+ if (entry2.split.targetTable !== "history_skill_call")
58740
+ continue;
58741
+ const conflict = entry2.normalized._capabilityConflict;
58742
+ if (typeof conflict !== "string" || conflict.length === 0)
58743
+ continue;
58744
+ if (capabilityConflictSeen.has(conflict) || capabilityConflictFindings >= 10)
58745
+ continue;
58746
+ capabilityConflictSeen.add(conflict);
58747
+ capabilityConflictFindings += 1;
58748
+ validationErrors.push({ sourceFile: file2, sourceLine: lineNumber, reason: conflict });
58749
+ }
58750
+ for (const entry2 of prepared) {
58751
+ const callId = entry2.normalized.call_id;
58752
+ if (entry2.split.targetTable === "history_skill_call" && typeof callId === "string" && callId.length > 0 && typeof entry2.normalized.session_id === "string") {
58753
+ const key = toolCallKey(resolvedSource, entry2.normalized.session_id, callId);
58754
+ const hashes = skillCallRows.get(key) ?? [];
58755
+ hashes.push(entry2.recordHash);
58756
+ skillCallRows.set(key, hashes);
58757
+ }
58758
+ }
57652
58759
  if (definition.source === "omp" || definition.source === "claude") {
57653
58760
  const assistantTs = definition.source === "omp" ? new Map : null;
57654
58761
  if (assistantTs !== null) {
@@ -57759,6 +58866,17 @@ async function runJsonlImport(source, options) {
57759
58866
  }
57760
58867
  }
57761
58868
  }
58869
+ const skillResult = skillResultSignal(definition.source, raw);
58870
+ if (skillResult !== null) {
58871
+ const sessionId = prepared.find((entry2) => typeof entry2.normalized.session_id === "string")?.normalized.session_id;
58872
+ if (typeof sessionId === "string") {
58873
+ const inRun = skillCallRows.get(toolCallKey(resolvedSource, sessionId, skillResult.callId));
58874
+ const hashes = inRun ?? await resolveSkillCallRows(options.db, resolvedSource, sessionId, skillResult.callId);
58875
+ for (const recordHash of hashes) {
58876
+ ops.push(skillCallOutcomeUpdateOp(recordHash, skillResult.status, skillResult.completedAtMs === undefined ? null : new Date(skillResult.completedAtMs).toISOString(), skillResult.durationMs === undefined ? null : skillResult.durationMs));
58877
+ }
58878
+ }
58879
+ }
57762
58880
  ops.push(checkpointUpsertOp(resolvedSource, file2, lineNumber, options.now));
57763
58881
  if (ops.length > 0) {
57764
58882
  await options.db.batch(ops);
@@ -57946,6 +59064,7 @@ var TOOL_CALL_KEY_SEP = "\x00";
57946
59064
  var init_importer = __esm(() => {
57947
59065
  init_dist5();
57948
59066
  init_cancellation();
59067
+ init_capability();
57949
59068
  init_hash();
57950
59069
  init_jsonl_importer_dao();
57951
59070
  init_mappers();
@@ -57954,7 +59073,7 @@ var init_importer = __esm(() => {
57954
59073
  init_zstd();
57955
59074
  });
57956
59075
 
57957
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
59076
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
57958
59077
  async function runOpenCodeImport(options) {
57959
59078
  throwIfImportAborted(options.signal);
57960
59079
  const paths = options.paths ?? ambientRuntimePaths2();
@@ -58246,7 +59365,7 @@ var init_opencode_importer = __esm(() => {
58246
59365
  init_redaction();
58247
59366
  });
58248
59367
 
58249
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/tables.js
59368
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/tables.js
58250
59369
  var BOOKKEEPING_HISTORY_TABLES, IMPORTER_OWNED_TABLES;
58251
59370
  var init_tables = __esm(() => {
58252
59371
  init_jsonl_importer_dao();
@@ -58259,7 +59378,7 @@ var init_tables = __esm(() => {
58259
59378
  ];
58260
59379
  });
58261
59380
 
58262
- // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.11+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
59381
+ // ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.5.12+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
58263
59382
  var init_dist6 = __esm(() => {
58264
59383
  init_importer();
58265
59384
  init_jsonl_importer_dao();
@@ -61171,7 +62290,7 @@ function observationIsNewer(leftAt, leftId, rightAt, rightId) {
61171
62290
  }
61172
62291
  var AGENT_EXECUTOR_UPDATE_COLUMNS = "project_id, executor_name, observation_id, observed_at, agent, model, disabled, owner, layer, skipped_reason, applied_observation_id, applied_at, attempts, retry_after, last_error";
61173
62292
 
61174
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
62293
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
61175
62294
  function sqlExpressionToText(value) {
61176
62295
  if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
61177
62296
  return;
@@ -61194,7 +62313,7 @@ function getDrizzleTableName(table3) {
61194
62313
  return String(table3[nameSym]);
61195
62314
  }
61196
62315
 
61197
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
62316
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
61198
62317
  function quoteIdent(name) {
61199
62318
  return `"${name.replace(/"/g, '""')}"`;
61200
62319
  }
@@ -61566,7 +62685,7 @@ var init_drizzle_zod = __esm(() => {
61566
62685
  };
61567
62686
  });
61568
62687
 
61569
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
62688
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
61570
62689
  function defineTable(name, columns2) {
61571
62690
  const table3 = sqliteTable(name, columns2);
61572
62691
  let insert2;
@@ -61600,7 +62719,7 @@ var init_define_table = __esm(() => {
61600
62719
  init_ddl();
61601
62720
  });
61602
62721
 
61603
- // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.11+41c6e59fd8764a51/node_modules/@gobing-ai/ts-db/dist/schema/index.js
62722
+ // ../../node_modules/.bun/@gobing-ai+ts-db@0.5.12+55e941c0ae44e2f6/node_modules/@gobing-ai/ts-db/dist/schema/index.js
61604
62723
  var exports_schema = {};
61605
62724
  __export(exports_schema, {
61606
62725
  text: () => text,
@@ -62661,7 +63780,7 @@ var init_dao = __esm(() => {
62661
63780
  init_workspace_dao();
62662
63781
  });
62663
63782
 
62664
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
63783
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
62665
63784
  var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
62666
63785
  var init_errors6 = __esm(() => {
62667
63786
  WorkflowValidationError = class WorkflowValidationError extends Error {
@@ -62696,12 +63815,12 @@ var init_errors6 = __esm(() => {
62696
63815
  };
62697
63816
  });
62698
63817
 
62699
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
63818
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
62700
63819
  var init_event_bus2 = __esm(() => {
62701
63820
  init_event_bus();
62702
63821
  });
62703
63822
 
62704
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/api-client.js
63823
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/api-client.js
62705
63824
  function truncateBody(text3) {
62706
63825
  return text3.length <= MAX_ERROR_BODY ? text3 : `${text3.slice(0, MAX_ERROR_BODY)}\u2026[truncated ${text3.length - MAX_ERROR_BODY} chars]`;
62707
63826
  }
@@ -62935,12 +64054,12 @@ var init_api_client = __esm(() => {
62935
64054
  };
62936
64055
  });
62937
64056
 
62938
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
64057
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
62939
64058
  var init_telemetry = __esm(() => {
62940
64059
  init_tracing2();
62941
64060
  });
62942
64061
 
62943
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/index.js
64062
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/index.js
62944
64063
  var init_dist7 = __esm(() => {
62945
64064
  init_api_client();
62946
64065
  init_event_bus2();
@@ -62948,7 +64067,7 @@ var init_dist7 = __esm(() => {
62948
64067
  init_telemetry();
62949
64068
  });
62950
64069
 
62951
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
64070
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
62952
64071
  function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
62953
64072
  return {
62954
64073
  workflow: workflowName,
@@ -63281,7 +64400,7 @@ var init_run_lifecycle = __esm(() => {
63281
64400
  ];
63282
64401
  });
63283
64402
 
63284
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
64403
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
63285
64404
  class CapabilityRegistry {
63286
64405
  kind;
63287
64406
  capabilities = new Map;
@@ -63312,7 +64431,7 @@ class CapabilityRegistry {
63312
64431
  }
63313
64432
  }
63314
64433
 
63315
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
64434
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
63316
64435
  function assertRelativeExtensionPath(path9, options = {}) {
63317
64436
  const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
63318
64437
  if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
@@ -63323,7 +64442,7 @@ function assertRelativeExtensionPath(path9, options = {}) {
63323
64442
  }
63324
64443
  }
63325
64444
 
63326
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
64445
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
63327
64446
  import { isAbsolute, resolve as resolve2 } from "path";
63328
64447
  async function loadExtensionModules(refs, options, register) {
63329
64448
  if (refs.length === 0)
@@ -63362,17 +64481,17 @@ async function loadExtensionModules(refs, options, register) {
63362
64481
  }
63363
64482
  var init_extension_loader = () => {};
63364
64483
 
63365
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
64484
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
63366
64485
  var init_extension = __esm(() => {
63367
64486
  init_extension_loader();
63368
64487
  });
63369
64488
 
63370
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11+ec1f0e5117227f1d/node_modules/@gobing-ai/ts-runtime/dist/extension.js
64489
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.12+994d710cf01a45d8/node_modules/@gobing-ai/ts-runtime/dist/extension.js
63371
64490
  var init_extension2 = __esm(() => {
63372
64491
  init_extension();
63373
64492
  });
63374
64493
 
63375
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
64494
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
63376
64495
  var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, relativeExtensionPath, WorkflowExtensionsSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
63377
64496
  var init_schema2 = __esm(() => {
63378
64497
  init_extension2();
@@ -63477,7 +64596,7 @@ var init_schema2 = __esm(() => {
63477
64596
  WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
63478
64597
  });
63479
64598
 
63480
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
64599
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
63481
64600
  async function loadWorkflowDef(path9, options = {}) {
63482
64601
  return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
63483
64602
  }
@@ -63658,7 +64777,7 @@ var init_config4 = __esm(() => {
63658
64777
  RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
63659
64778
  });
63660
64779
 
63661
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
64780
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
63662
64781
  function collectWorkflowExtensions(sourceName, sourceDir, extensions) {
63663
64782
  if (extensions === undefined)
63664
64783
  return [];
@@ -63722,7 +64841,7 @@ var init_extensions = __esm(() => {
63722
64841
  init_errors6();
63723
64842
  });
63724
64843
 
63725
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
64844
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
63726
64845
  function mergeVars(workflowVars = {}, overrideVars = {}) {
63727
64846
  return { ...workflowVars, ...overrideVars };
63728
64847
  }
@@ -63821,7 +64940,7 @@ var init_variables = __esm(() => {
63821
64940
  SHELL_BINDING_ANY = /\$\{__WF_\d+\}|\$__WF_\d+\b/;
63822
64941
  });
63823
64942
 
63824
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
64943
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
63825
64944
  class WorkflowEngineHost {
63826
64945
  lifecycleBus;
63827
64946
  actions = new CapabilityRegistry("workflow action");
@@ -64018,7 +65137,7 @@ var init_host = __esm(() => {
64018
65137
  init_variables();
64019
65138
  });
64020
65139
 
64021
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
65140
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
64022
65141
  var WORKFLOW_ENGINE_SCHEMA_SQL, WORKFLOW_ENGINE_MIGRATIONS_SQL;
64023
65142
  var init_schema_sql2 = __esm(() => {
64024
65143
  WORKFLOW_ENGINE_SCHEMA_SQL = `
@@ -64101,7 +65220,7 @@ ALTER TABLE runs ADD COLUMN terminal_reason TEXT;
64101
65220
  `.trim();
64102
65221
  });
64103
65222
 
64104
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
65223
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
64105
65224
  async function applyWorkflowEngineSchema(db2) {
64106
65225
  for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
64107
65226
  const sql4 = statement.trim();
@@ -64489,7 +65608,7 @@ var init_persistence = __esm(() => {
64489
65608
  init_schema_sql2();
64490
65609
  });
64491
65610
 
64492
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
65611
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
64493
65612
  async function runActionStep(action, vars, deps) {
64494
65613
  const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
64495
65614
  const templateContext = {
@@ -64555,7 +65674,7 @@ var init_action_step = __esm(() => {
64555
65674
  init_variables();
64556
65675
  });
64557
65676
 
64558
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
65677
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
64559
65678
  class StateMachineDriver {
64560
65679
  options;
64561
65680
  constructor(options) {
@@ -64707,7 +65826,7 @@ var init_state_machine = __esm(() => {
64707
65826
  EMPTY_OUTCOME = { outcome: "completed", result: undefined, setVars: undefined };
64708
65827
  });
64709
65828
 
64710
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
65829
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
64711
65830
  class TransitionFlowDriver {
64712
65831
  options;
64713
65832
  constructor(options) {
@@ -64835,7 +65954,7 @@ var init_transition_flow = __esm(() => {
64835
65954
  init_variables();
64836
65955
  });
64837
65956
 
64838
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
65957
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
64839
65958
  class WorkflowService {
64840
65959
  host;
64841
65960
  persistence;
@@ -65092,7 +66211,7 @@ var init_service = __esm(() => {
65092
66211
  init_variables();
65093
66212
  });
65094
66213
 
65095
- // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
66214
+ // ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
65096
66215
  var init_dist8 = __esm(() => {
65097
66216
  init_config4();
65098
66217
  init_extensions();
@@ -65102,7 +66221,7 @@ var init_dist8 = __esm(() => {
65102
66221
  init_service();
65103
66222
  });
65104
66223
 
65105
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
66224
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
65106
66225
  function collectExtensions(sourceName, sourceDir, extensions) {
65107
66226
  if (extensions === undefined)
65108
66227
  return [];
@@ -65116,7 +66235,7 @@ function collectExtensions(sourceName, sourceDir, extensions) {
65116
66235
  }
65117
66236
  var init_extensions2 = () => {};
65118
66237
 
65119
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
66238
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
65120
66239
  function createFinding(rule, message, filePath, extras = {}) {
65121
66240
  return {
65122
66241
  ruleId: rule.id,
@@ -65187,7 +66306,7 @@ var init_types3 = __esm(() => {
65187
66306
  });
65188
66307
  });
65189
66308
 
65190
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
66309
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
65191
66310
  async function loadPreset(name, options) {
65192
66311
  const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
65193
66312
  const presetPath = findMergedPreset(merged, name);
@@ -65402,7 +66521,7 @@ var init_loader2 = __esm(() => {
65402
66521
  FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
65403
66522
  });
65404
66523
 
65405
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
66524
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
65406
66525
  function normalizeFindingPath(filePath) {
65407
66526
  if (!filePath || isAbsolutePath2(filePath))
65408
66527
  return null;
@@ -65467,7 +66586,7 @@ var init_test_stub_fixer = __esm(() => {
65467
66586
  realFileSystem = createNodeFileSystem3();
65468
66587
  });
65469
66588
 
65470
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
66589
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
65471
66590
  function registerBuiltinFixers(host, exec) {
65472
66591
  const regexFixer = new RegexFixerProvider;
65473
66592
  const pathFixer = new PathFixerProvider;
@@ -65686,7 +66805,7 @@ var init_fixers = __esm(() => {
65686
66805
  };
65687
66806
  });
65688
66807
 
65689
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
66808
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
65690
66809
  function validateAgentId(id) {
65691
66810
  if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
65692
66811
  throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
@@ -65791,7 +66910,7 @@ var init_agent_spec = __esm(() => {
65791
66910
  };
65792
66911
  });
65793
66912
 
65794
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
66913
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
65795
66914
  function getAgentSessionCapability(agent) {
65796
66915
  return AGENT_SESSION_CAPABILITY[agent];
65797
66916
  }
@@ -66231,7 +67350,7 @@ var init_shims = __esm(() => {
66231
67350
  ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
66232
67351
  });
66233
67352
 
66234
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
67353
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
66235
67354
  function buildIdentityPreamble(ctx) {
66236
67355
  const sections = [
66237
67356
  `You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
@@ -66307,7 +67426,7 @@ var init_identity = __esm(() => {
66307
67426
  init_dist5();
66308
67427
  });
66309
67428
 
66310
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/quota.js
67429
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/quota.js
66311
67430
  import { createHash as createHash4 } from "crypto";
66312
67431
  function classifyQuotaErrorRecord(record2) {
66313
67432
  const bounded = record2.length > MAX_QUOTA_EVIDENCE_BYTES ? record2.slice(-MAX_QUOTA_EVIDENCE_BYTES) : record2;
@@ -66408,7 +67527,7 @@ var init_quota = __esm(() => {
66408
67527
  ]);
66409
67528
  });
66410
67529
 
66411
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
67530
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
66412
67531
  function isClaudeStyleSlashCommand(input) {
66413
67532
  return SLASH_COMMAND_RE2.test(input);
66414
67533
  }
@@ -66436,7 +67555,7 @@ var init_slash_command = __esm(() => {
66436
67555
  SLASH_COMMAND_RE2 = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
66437
67556
  });
66438
67557
 
66439
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
67558
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
66440
67559
  function buildCorrelationEnv(correlation) {
66441
67560
  return {
66442
67561
  [AGENT_RUN_ID_ENV]: correlation.runId,
@@ -66596,7 +67715,7 @@ var init_ai_runner = __esm(() => {
66596
67715
  init_slash_command();
66597
67716
  });
66598
67717
 
66599
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
67718
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
66600
67719
  class AgentDetector {
66601
67720
  runner;
66602
67721
  timeout;
@@ -66672,7 +67791,7 @@ var init_agent_detector = __esm(() => {
66672
67791
  VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
66673
67792
  });
66674
67793
 
66675
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
67794
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
66676
67795
  function isNonEmpty(value) {
66677
67796
  return value !== undefined && value.trim().length > 0;
66678
67797
  }
@@ -66801,7 +67920,7 @@ var init_auth_shims = __esm(() => {
66801
67920
  };
66802
67921
  });
66803
67922
 
66804
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/decision/errors.js
67923
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/decision/errors.js
66805
67924
  var DecisionError, DecisionConfigError, DecisionAuthError, DecisionRateLimitError, DecisionTimeoutError, DecisionConnectionError, DecisionRequestError, DecisionBackendError;
66806
67925
  var init_errors7 = __esm(() => {
66807
67926
  DecisionError = class DecisionError extends Error {
@@ -66863,7 +67982,7 @@ var init_errors7 = __esm(() => {
66863
67982
  };
66864
67983
  });
66865
67984
 
66866
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/decision/types.js
67985
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/decision/types.js
66867
67986
  var q;
66868
67987
  var init_types4 = __esm(() => {
66869
67988
  q = {
@@ -67453,7 +68572,7 @@ var init_dist9 = __esm(() => {
67453
68572
  RUNTIME = describeRuntime();
67454
68573
  });
67455
68574
 
67456
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/decision/validation.js
68575
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/decision/validation.js
67457
68576
  function record2(value) {
67458
68577
  return value !== null && typeof value === "object" && !Array.isArray(value);
67459
68578
  }
@@ -67537,7 +68656,7 @@ var init_validation2 = __esm(() => {
67537
68656
  init_errors7();
67538
68657
  });
67539
68658
 
67540
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/decision/typesafe-driver.js
68659
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/decision/typesafe-driver.js
67541
68660
  function createTypesafeDriver(config4) {
67542
68661
  let client;
67543
68662
  try {
@@ -67641,7 +68760,7 @@ var init_typesafe_driver = __esm(() => {
67641
68760
  init_validation2();
67642
68761
  });
67643
68762
 
67644
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/decision/decision-maker.js
68763
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/decision/decision-maker.js
67645
68764
  function resolveApiKey(options) {
67646
68765
  const env2 = options.env ?? getProcessEnv2();
67647
68766
  const apiKey = options.apiKey ?? env2.TYPESAFE_API_KEY;
@@ -67727,7 +68846,7 @@ var init_decision_maker = __esm(() => {
67727
68846
  init_validation2();
67728
68847
  });
67729
68848
 
67730
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
68849
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
67731
68850
  class ModelHealthProbeRegistry {
67732
68851
  probes = new Map;
67733
68852
  register(providerPrefix, probe) {
@@ -67851,7 +68970,7 @@ var init_model_health_probe = __esm(() => {
67851
68970
  };
67852
68971
  });
67853
68972
 
67854
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
68973
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
67855
68974
  class DoctorRunner {
67856
68975
  detector;
67857
68976
  runner;
@@ -67991,15 +69110,15 @@ var init_doctor_runner = __esm(() => {
67991
69110
  init_model_health_probe();
67992
69111
  });
67993
69112
 
67994
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
69113
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
67995
69114
  var init_events = () => {};
67996
69115
 
67997
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
69116
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
67998
69117
  function formatMessage(msg) {
67999
69118
  return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
68000
69119
  }
68001
69120
 
68002
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
69121
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
68003
69122
  import { Buffer as Buffer5 } from "buffer";
68004
69123
 
68005
69124
  class TeamAgentProcess {
@@ -68166,7 +69285,7 @@ var init_team_agent_process = __esm(() => {
68166
69285
  init_quota();
68167
69286
  });
68168
69287
 
68169
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
69288
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
68170
69289
  class TeamOrchestrator {
68171
69290
  configDir;
68172
69291
  inbox;
@@ -68307,7 +69426,7 @@ var init_team_orchestrator = __esm(() => {
68307
69426
  init_team_agent_process();
68308
69427
  });
68309
69428
 
68310
- // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.11+27db692546a772ce/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
69429
+ // ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.5.12+67036b5e25304b7f/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
68311
69430
  var exports_dist3 = {};
68312
69431
  __export(exports_dist3, {
68313
69432
  validateAgentId: () => validateAgentId,
@@ -68383,7 +69502,7 @@ var init_dist10 = __esm(() => {
68383
69502
  init_team_orchestrator();
68384
69503
  });
68385
69504
 
68386
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
69505
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
68387
69506
  function stringArray(value) {
68388
69507
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
68389
69508
  }
@@ -68421,7 +69540,7 @@ function parseInlineFlags(source) {
68421
69540
  return { flags, rest: source.slice(match[0].length) };
68422
69541
  }
68423
69542
 
68424
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
69543
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
68425
69544
  function matchesAny(path9, patterns) {
68426
69545
  if (patterns === undefined || patterns.length === 0)
68427
69546
  return true;
@@ -68469,7 +69588,7 @@ function escapeRegExp(value) {
68469
69588
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
68470
69589
  }
68471
69590
 
68472
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
69591
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
68473
69592
  async function discoverFiles2(options) {
68474
69593
  const fs3 = options.fs ?? createNodeFileSystem3();
68475
69594
  const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
@@ -68500,12 +69619,12 @@ var init_file_discovery = __esm(() => {
68500
69619
  DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
68501
69620
  });
68502
69621
 
68503
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
69622
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
68504
69623
  var init_file_utils = __esm(() => {
68505
69624
  init_file_discovery();
68506
69625
  });
68507
69626
 
68508
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
69627
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
68509
69628
  class AgentDetectionEvaluator {
68510
69629
  detector;
68511
69630
  constructor(detector = new AgentDetector) {
@@ -68533,7 +69652,7 @@ var init_agent_detection_evaluator = __esm(() => {
68533
69652
  init_file_utils();
68534
69653
  });
68535
69654
 
68536
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
69655
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
68537
69656
  class CoverageGateEvaluator {
68538
69657
  constructor() {}
68539
69658
  async evaluate(rule, context4) {
@@ -68617,7 +69736,7 @@ var init_coverage_gate_evaluator = __esm(() => {
68617
69736
  init_file_utils();
68618
69737
  });
68619
69738
 
68620
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
69739
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
68621
69740
  class ExitCodeEvaluator {
68622
69741
  executor;
68623
69742
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -68653,7 +69772,7 @@ var init_exit_code_evaluator = __esm(() => {
68653
69772
  init_file_utils();
68654
69773
  });
68655
69774
 
68656
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
69775
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
68657
69776
  class ForbiddenImportEvaluator {
68658
69777
  constructor() {}
68659
69778
  async evaluate(rule, context4) {
@@ -68734,7 +69853,7 @@ var init_forbidden_import_evaluator = __esm(() => {
68734
69853
  init_file_utils();
68735
69854
  });
68736
69855
 
68737
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
69856
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
68738
69857
  class ImportBoundaryEvaluator {
68739
69858
  async evaluate(rule, context4) {
68740
69859
  const config4 = rule.evaluator.config ?? {};
@@ -68827,7 +69946,7 @@ var init_import_boundary_evaluator = __esm(() => {
68827
69946
  init_file_utils();
68828
69947
  });
68829
69948
 
68830
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
69949
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
68831
69950
  class PathEvaluator {
68832
69951
  constructor() {}
68833
69952
  async evaluate(rule, context4) {
@@ -68888,7 +70007,7 @@ var init_path_evaluator = __esm(() => {
68888
70007
  init_file_utils();
68889
70008
  });
68890
70009
 
68891
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
70010
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
68892
70011
  class RegexEvaluator {
68893
70012
  constructor() {}
68894
70013
  async evaluate(rule, context4) {
@@ -68966,7 +70085,7 @@ var init_regex_evaluator = __esm(() => {
68966
70085
  init_file_utils();
68967
70086
  });
68968
70087
 
68969
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
70088
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
68970
70089
  class RipgrepEvaluator {
68971
70090
  executor;
68972
70091
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -69059,7 +70178,7 @@ var init_ripgrep_evaluator = __esm(() => {
69059
70178
  init_file_utils();
69060
70179
  });
69061
70180
 
69062
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
70181
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
69063
70182
  class SchemaArtifactEvaluator {
69064
70183
  constructor() {}
69065
70184
  async evaluate(rule, context4) {
@@ -69137,7 +70256,7 @@ var init_schema_artifact_evaluator = __esm(() => {
69137
70256
  init_file_utils();
69138
70257
  });
69139
70258
 
69140
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
70259
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
69141
70260
  class SecretsScannerEvaluator {
69142
70261
  constructor() {}
69143
70262
  async evaluate(rule, context4) {
@@ -69205,7 +70324,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
69205
70324
  ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
69206
70325
  });
69207
70326
 
69208
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
70327
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
69209
70328
  class SgEvaluator {
69210
70329
  executor;
69211
70330
  constructor(executor = nodeBunFactory3.createProcessExecutor()) {
@@ -69302,7 +70421,7 @@ var init_sg_evaluator = __esm(() => {
69302
70421
  init_file_utils();
69303
70422
  });
69304
70423
 
69305
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
70424
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
69306
70425
  class TypeScriptTestPathResolver {
69307
70426
  name = "typescript";
69308
70427
  constructor() {}
@@ -69385,7 +70504,7 @@ function testify(rel) {
69385
70504
  return `${dir}test_${base2}`;
69386
70505
  }
69387
70506
 
69388
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
70507
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
69389
70508
  class TestLocationEvaluator {
69390
70509
  resolvers;
69391
70510
  constructor(resolvers) {
@@ -69460,7 +70579,7 @@ var init_test_location_evaluator = __esm(() => {
69460
70579
  TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
69461
70580
  });
69462
70581
 
69463
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
70582
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
69464
70583
  class TsdocExportEvaluator {
69465
70584
  constructor() {}
69466
70585
  async evaluate(rule, context4) {
@@ -69545,7 +70664,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
69545
70664
  };
69546
70665
  });
69547
70666
 
69548
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
70667
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
69549
70668
  class JsonFormatter {
69550
70669
  constructor() {}
69551
70670
  format(result) {
@@ -69553,7 +70672,7 @@ class JsonFormatter {
69553
70672
  }
69554
70673
  }
69555
70674
 
69556
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
70675
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
69557
70676
  class TextFormatter {
69558
70677
  constructor() {}
69559
70678
  format(result) {
@@ -69567,7 +70686,7 @@ class TextFormatter {
69567
70686
  }
69568
70687
  }
69569
70688
 
69570
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
70689
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
69571
70690
  function registerBuiltins(host, executor) {
69572
70691
  const path9 = new PathEvaluator;
69573
70692
  host.evaluators.register("regex", new RegexEvaluator, "builtin");
@@ -69607,7 +70726,7 @@ var init_builtins = __esm(() => {
69607
70726
  init_tsdoc_export_evaluator();
69608
70727
  });
69609
70728
 
69610
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
70729
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
69611
70730
  class RuleEngineHost {
69612
70731
  evaluators;
69613
70732
  formatters;
@@ -69624,7 +70743,7 @@ var init_rule_engine_host = __esm(() => {
69624
70743
  init_extension2();
69625
70744
  });
69626
70745
 
69627
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
70746
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
69628
70747
  class RuleEngine {
69629
70748
  host;
69630
70749
  events;
@@ -69810,7 +70929,7 @@ var init_engine = __esm(() => {
69810
70929
  init_types3();
69811
70930
  });
69812
70931
 
69813
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
70932
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
69814
70933
  async function bundledRulesRoot() {
69815
70934
  if (cachedRoot2 !== undefined)
69816
70935
  return cachedRoot2;
@@ -69861,7 +70980,7 @@ var init_bundled_rules = __esm(() => {
69861
70980
  init_dist5();
69862
70981
  });
69863
70982
 
69864
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
70983
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
69865
70984
  class DbRulePersistenceAdapter {
69866
70985
  db;
69867
70986
  constructor(db2) {
@@ -69895,7 +71014,7 @@ class DbRulePersistenceAdapter {
69895
71014
  }
69896
71015
  }
69897
71016
 
69898
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
71017
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
69899
71018
  var RULE_ENGINE_SCHEMA_SQL = `
69900
71019
  CREATE TABLE IF NOT EXISTS rule_runs (
69901
71020
  id TEXT PRIMARY KEY,
@@ -69941,10 +71060,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
69941
71060
  CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
69942
71061
  `;
69943
71062
 
69944
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
71063
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
69945
71064
  var init_persistence2 = () => {};
69946
71065
 
69947
- // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.11+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
71066
+ // ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.5.12+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
69948
71067
  var init_dist11 = __esm(() => {
69949
71068
  init_extensions2();
69950
71069
  init_loader2();
@@ -70082,6 +71201,7 @@ async function applyCliMigrations(adapter, migrations = CLI_MIGRATIONS) {
70082
71201
  const schedulerCustomActiveIndexSkip = migration.id === "0047_spur_cli_scheduler_custom_active_unique" && !await tableExists2(adapter, "queue_jobs");
70083
71202
  const queueJobsDeadlineLeaseSkip = migration.id === "0041_spur_cli_queue_jobs_deadline_lease_columns" && !await tableExists2(adapter, "queue_jobs");
70084
71203
  const runsTerminalReasonSkip = migration.id === "0049_spur_cli_runs_terminal_reason" && !await tableExists2(adapter, "runs");
71204
+ const skillCapabilityGrainSkip = migration.id === "0050_spur_cli_history_board_skill_5m_capability_grain" && !await tableExists2(adapter, "history_board_skill_5m");
70085
71205
  const inboxRequestKeySkip = migration.id === "0043_spur_cli_inbox_messages_request_key" && !await tableExists2(adapter, "inbox_messages");
70086
71206
  const coordinationReceiptColumnsSkip = migration.id === "0044_spur_cli_coordination_runs_receipt_columns" && !await tableExists2(adapter, "coordination_runs");
70087
71207
  const historyToolIdentitySkip = migration.id === "0034_spur_cli_history_tool_identity" && !await tableExists2(adapter, "history_tool_call");
@@ -70089,7 +71209,7 @@ async function applyCliMigrations(adapter, migrations = CLI_MIGRATIONS) {
70089
71209
  const historyRollupWatermarkSkip = migration.id === "0036_spur_cli_history_rollup_watermark" && (await tableExists2(adapter, "history_board_rollup_watermark") || !await tableExists2(adapter, "history_message") || !await columnExists(adapter, "history_message", "imported_at"));
70090
71210
  const boundedRollupDerivationsSkip = migration.id === "0039_spur_cli_bounded_rollup_derivations" && (!await tableExists2(adapter, "history_message") || !await columnExists(adapter, "history_message", "source_file") || !await tableExists2(adapter, "history_board_source_daily"));
70091
71211
  const historyModelFallbackIndexSkip = migration.id === "0042_spur_cli_history_model_fallback_index" && (!await tableExists2(adapter, "history_message") || !await columnExists(adapter, "history_message", "model"));
70092
- if (shouldApplySql && !sequenceIndexSkip && !argsRawSkip && !runsStatusDoneSkip && !nameOccurredIndexSkip && !historyBoardQueryIndexesSkip && !historyPerformanceIndexesSkip && !historyToolCallIndexesSkip && !historyBoardCoveringIndexesSkip && !historyBoardToolStatsColumnsSkip && !callIdSkip && !tsNullableSkip && !queueJobsActiveIndexSkip && !schedulerCustomActiveIndexSkip && !queueJobsDeadlineLeaseSkip && !runsTerminalReasonSkip && !inboxRequestKeySkip && !coordinationReceiptColumnsSkip && !historyToolIdentitySkip && !historyMeasureVectorSkip && !historyRollupWatermarkSkip && !boundedRollupDerivationsSkip && !historyModelFallbackIndexSkip) {
71212
+ if (shouldApplySql && !sequenceIndexSkip && !argsRawSkip && !runsStatusDoneSkip && !nameOccurredIndexSkip && !historyBoardQueryIndexesSkip && !historyPerformanceIndexesSkip && !historyToolCallIndexesSkip && !historyBoardCoveringIndexesSkip && !historyBoardToolStatsColumnsSkip && !callIdSkip && !tsNullableSkip && !queueJobsActiveIndexSkip && !schedulerCustomActiveIndexSkip && !queueJobsDeadlineLeaseSkip && !runsTerminalReasonSkip && !skillCapabilityGrainSkip && !inboxRequestKeySkip && !coordinationReceiptColumnsSkip && !historyToolIdentitySkip && !historyMeasureVectorSkip && !historyRollupWatermarkSkip && !boundedRollupDerivationsSkip && !historyModelFallbackIndexSkip) {
70093
71213
  for (const statement of splitSqlStatements(migration.sql)) {
70094
71214
  await adapter.exec(statement);
70095
71215
  }
@@ -70602,6 +71722,26 @@ CREATE TABLE IF NOT EXISTS history_board_skill_5m (
70602
71722
  calls INTEGER NOT NULL,
70603
71723
  PRIMARY KEY (bucket_start, source, skill_name, invocation_kind)
70604
71724
  );
71725
+ CREATE INDEX IF NOT EXISTS idx_history_board_skill_5m_skill_bucket
71726
+ ON history_board_skill_5m (skill_name, bucket_start);
71727
+ `, HISTORY_BOARD_SKILL_5M_CAPABILITY_GRAIN_SCHEMA_SQL = `
71728
+ CREATE TABLE history_board_skill_5m_capability_grain (
71729
+ bucket_start TEXT NOT NULL,
71730
+ source TEXT NOT NULL,
71731
+ skill_name TEXT NOT NULL,
71732
+ invocation_kind TEXT NOT NULL,
71733
+ capability_kind TEXT NOT NULL DEFAULT '',
71734
+ evidence_kind TEXT NOT NULL DEFAULT '',
71735
+ status TEXT NOT NULL DEFAULT '',
71736
+ calls INTEGER NOT NULL,
71737
+ PRIMARY KEY (bucket_start, source, skill_name, invocation_kind, capability_kind, evidence_kind, status)
71738
+ );
71739
+ INSERT INTO history_board_skill_5m_capability_grain
71740
+ (bucket_start, source, skill_name, invocation_kind, capability_kind, evidence_kind, status, calls)
71741
+ SELECT bucket_start, source, skill_name, invocation_kind, '', '', '', calls
71742
+ FROM history_board_skill_5m;
71743
+ DROP TABLE history_board_skill_5m;
71744
+ ALTER TABLE history_board_skill_5m_capability_grain RENAME TO history_board_skill_5m;
70605
71745
  CREATE INDEX IF NOT EXISTS idx_history_board_skill_5m_skill_bucket
70606
71746
  ON history_board_skill_5m (skill_name, bucket_start);
70607
71747
  `, HISTORY_MESSAGE_TS_NULLABLE_SCHEMA_SQL = `
@@ -71096,11 +72236,15 @@ ${HISTORY_TASK_SESSION_SCHEMA_SQL}
71096
72236
  id: "0049_spur_cli_runs_terminal_reason",
71097
72237
  sql: CLI_RUNS_TERMINAL_REASON_SCHEMA_SQL,
71098
72238
  addColumnIfMissing: { table: "runs", column: "terminal_reason" }
72239
+ },
72240
+ {
72241
+ id: "0050_spur_cli_history_board_skill_5m_capability_grain",
72242
+ sql: HISTORY_BOARD_SKILL_5M_CAPABILITY_GRAIN_SCHEMA_SQL
71099
72243
  }
71100
72244
  ];
71101
72245
  });
71102
72246
 
71103
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
72247
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
71104
72248
  function queueLogger() {
71105
72249
  if (!_queueLogger)
71106
72250
  _queueLogger = getLogger2("job-queue");
@@ -71522,7 +72666,7 @@ var init_db_job_queue = __esm(() => {
71522
72666
  init_tracing2();
71523
72667
  });
71524
72668
 
71525
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
72669
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
71526
72670
  var exports_job_queue_db = {};
71527
72671
  __export(exports_job_queue_db, {
71528
72672
  DBQueueConsumer: () => DBQueueConsumer,
@@ -75623,7 +76767,7 @@ import {
75623
76767
  writeFileSync as writeFileSync4,
75624
76768
  writeSync as writeSync2
75625
76769
  } from "fs";
75626
- import { join as join11 } from "path";
76770
+ import { dirname as dirname9, join as join11 } from "path";
75627
76771
 
75628
76772
  class WorkflowRunLogSink {
75629
76773
  filePath;
@@ -75636,6 +76780,7 @@ class WorkflowRunLogSink {
75636
76780
  workflowName;
75637
76781
  startedAt;
75638
76782
  fd;
76783
+ openFailed = false;
75639
76784
  bytes = 0;
75640
76785
  lines = 0;
75641
76786
  truncated = false;
@@ -75651,12 +76796,6 @@ class WorkflowRunLogSink {
75651
76796
  this.planPreview = options.planPreview;
75652
76797
  this.secrets = options.secrets ?? [];
75653
76798
  this.runId = options.runId;
75654
- try {
75655
- mkdirSync5(options.dir, { recursive: true });
75656
- this.fd = openSync2(this.filePath, "a");
75657
- } catch {
75658
- this.fd = undefined;
75659
- }
75660
76799
  this.bus = options.bus;
75661
76800
  this.handlers = {
75662
76801
  "workflow.run.started": (event) => this.onRunStarted(event),
@@ -75674,9 +76813,6 @@ class WorkflowRunLogSink {
75674
76813
  };
75675
76814
  this.register(true);
75676
76815
  }
75677
- get isTruncated() {
75678
- return this.truncated;
75679
- }
75680
76816
  close() {
75681
76817
  if (this.closed)
75682
76818
  return;
@@ -75689,6 +76825,23 @@ class WorkflowRunLogSink {
75689
76825
  this.fd = undefined;
75690
76826
  }
75691
76827
  }
76828
+ get isTruncated() {
76829
+ return this.truncated;
76830
+ }
76831
+ ensureOpen() {
76832
+ if (this.fd !== undefined)
76833
+ return true;
76834
+ if (this.closed || this.openFailed)
76835
+ return false;
76836
+ try {
76837
+ mkdirSync5(dirname9(this.filePath), { recursive: true });
76838
+ this.fd = openSync2(this.filePath, "a");
76839
+ } catch {
76840
+ this.openFailed = true;
76841
+ return false;
76842
+ }
76843
+ return true;
76844
+ }
75692
76845
  register(attach) {
75693
76846
  for (const name of RUN_LOG_EVENT_NAMES) {
75694
76847
  const handler = this.handlers[name];
@@ -75767,7 +76920,7 @@ class WorkflowRunLogSink {
75767
76920
  `);
75768
76921
  }
75769
76922
  onAgent(event) {
75770
- if (this.fd === undefined || this.closed)
76923
+ if (this.closed || !this.ensureOpen())
75771
76924
  return;
75772
76925
  switch (event.kind) {
75773
76926
  case "output":
@@ -75801,7 +76954,7 @@ class WorkflowRunLogSink {
75801
76954
  }
75802
76955
  }
75803
76956
  onBudget(event) {
75804
- if (this.fd === undefined || this.closed)
76957
+ if (this.closed || !this.ensureOpen())
75805
76958
  return;
75806
76959
  const caps = [
75807
76960
  event.budget.maxTokens !== undefined ? `maxTokens=${event.budget.maxTokens}` : undefined,
@@ -75811,20 +76964,23 @@ class WorkflowRunLogSink {
75811
76964
  `);
75812
76965
  }
75813
76966
  onTripwire(event) {
75814
- if (this.fd === undefined || this.closed)
76967
+ if (this.closed || !this.ensureOpen())
75815
76968
  return;
75816
76969
  this.append(`[${event.at}] tripwire ${event.policy.id} (v${event.policy.version}) ${event.response} node=${event.node}: ${event.observed} \u2014 next: ${event.nextDecision}
75817
76970
  `);
75818
76971
  }
75819
76972
  onContractViolation(event) {
75820
- if (this.fd === undefined || this.closed)
76973
+ if (this.closed || !this.ensureOpen())
75821
76974
  return;
75822
76975
  const task = event.task !== undefined ? ` task=${event.task}` : "";
75823
76976
  this.append(`[${event.at}] contract-violation ${event.contract} observed=${event.observed} node=${event.node} agent=${event.agent}${task}
75824
76977
  `);
75825
76978
  }
75826
76979
  append(text4) {
75827
- if (this.fd === undefined || this.closed || this.truncated)
76980
+ if (this.closed || this.truncated || !this.ensureOpen())
76981
+ return;
76982
+ const fd = this.fd;
76983
+ if (fd === undefined)
75828
76984
  return;
75829
76985
  const redacted = redactAndBound(text4, this.secrets, Number.MAX_SAFE_INTEGER);
75830
76986
  const textBytes = Buffer.byteLength(redacted);
@@ -75832,12 +76988,12 @@ class WorkflowRunLogSink {
75832
76988
  if (this.bytes + textBytes > this.maxBytes || this.maxLines !== undefined && this.lines + textLines > this.maxLines) {
75833
76989
  this.truncated = true;
75834
76990
  try {
75835
- writeSync2(this.fd, TRUNCATION_MARKER);
76991
+ writeSync2(fd, TRUNCATION_MARKER);
75836
76992
  } catch {}
75837
76993
  return;
75838
76994
  }
75839
76995
  try {
75840
- writeSync2(this.fd, redacted);
76996
+ writeSync2(fd, redacted);
75841
76997
  this.bytes += textBytes;
75842
76998
  this.lines += textLines;
75843
76999
  } catch {}
@@ -75978,7 +77134,7 @@ var init_executor_tier = __esm(() => {
75978
77134
  import { existsSync as existsSync5, mkdirSync as mkdirSync6, readFileSync as readFileSync9, realpathSync as realpathSync3, renameSync as renameSync5, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "fs";
75979
77135
  import { connect, createServer } from "net";
75980
77136
  import { homedir as homedir4 } from "os";
75981
- import { dirname as dirname9, join as join12, resolve as resolve3 } from "path";
77137
+ import { dirname as dirname10, join as join12, resolve as resolve3 } from "path";
75982
77138
  function setProcessHelpersForTests(helpers) {
75983
77139
  testPidFinder = helpers?.pidFinder;
75984
77140
  testProcessKiller = helpers?.processKiller;
@@ -76137,7 +77293,7 @@ class ProjectRegistry {
76137
77293
  this.lockDir = `${this.filePath}.lock`;
76138
77294
  }
76139
77295
  async withLock(fn) {
76140
- const lockParent = dirname9(this.lockDir);
77296
+ const lockParent = dirname10(this.lockDir);
76141
77297
  if (!existsSync5(lockParent)) {
76142
77298
  try {
76143
77299
  mkdirSync6(lockParent, { recursive: true });
@@ -76196,7 +77352,7 @@ class ProjectRegistry {
76196
77352
  }
76197
77353
  }
76198
77354
  writeRaw(data) {
76199
- const parentDir2 = dirname9(this.filePath);
77355
+ const parentDir2 = dirname10(this.filePath);
76200
77356
  if (!existsSync5(parentDir2)) {
76201
77357
  mkdirSync6(parentDir2, { recursive: true });
76202
77358
  }
@@ -76400,7 +77556,7 @@ var init_project_registry = __esm(() => {
76400
77556
  });
76401
77557
 
76402
77558
  // ../../packages/app/src/services/fleet-service.ts
76403
- import { basename as basename2, dirname as dirname10, join as join13 } from "path";
77559
+ import { basename as basename2, dirname as dirname11, join as join13 } from "path";
76404
77560
  function resolveMemberExecutor(params) {
76405
77561
  const { member, index: index2, label, agentConfig, roles, roster } = params;
76406
77562
  if (member.executor !== undefined) {
@@ -76678,7 +77834,7 @@ class FleetService {
76678
77834
  const cwd = normalizeProjectPath(process.cwd());
76679
77835
  const storageRoot = normalizeProjectPath(this.fs.resolve(".spur"));
76680
77836
  const databasePath = this.ctx.openDb ? await new ProjectClaimDao(await this.ctx.openDb(expected)).databasePath() : "";
76681
- const databaseRoot = databasePath === "" ? expectedStorageRoot : normalizeProjectPath(dirname10(databasePath));
77837
+ const databaseRoot = databasePath === "" ? expectedStorageRoot : normalizeProjectPath(dirname11(databasePath));
76682
77838
  if (cwd !== expected || storageRoot !== expectedStorageRoot || databaseRoot !== expectedStorageRoot) {
76683
77839
  throw new Error(`Ground-truth mismatch for fleet at ${expected}: process cwd resolves to ${cwd}, storage root (.spur) resolves to ${storageRoot}, database root resolves to ${databaseRoot} \u2014 materialization only launches for the project it runs in; SPUR_* environment values are context, not proof (0835 R6)`);
76684
77840
  }
@@ -78439,7 +79595,7 @@ var init_run_session_observer = __esm(() => {
78439
79595
  });
78440
79596
 
78441
79597
  // ../../packages/app/src/workflow/actions/run-path.ts
78442
- import { dirname as dirname11, join as join16, normalize, relative, resolve as resolve5, sep as sep2 } from "path";
79598
+ import { dirname as dirname12, join as join16, normalize, relative, resolve as resolve5, sep as sep2 } from "path";
78443
79599
  function within(child, ancestor) {
78444
79600
  return child === ancestor || child.startsWith(`${ancestor}${sep2}`);
78445
79601
  }
@@ -78487,7 +79643,7 @@ async function resolveConfinedArtifactPath(fileSystem, workdir, pathRaw, root) {
78487
79643
  const stat2 = await fileSystem.stat(probe);
78488
79644
  if (stat2 !== null)
78489
79645
  break;
78490
- const parent = dirname11(probe);
79646
+ const parent = dirname12(probe);
78491
79647
  let listed;
78492
79648
  try {
78493
79649
  listed = await fileSystem.readDir(parent);
@@ -78601,7 +79757,7 @@ var init_composition_baseline = () => {};
78601
79757
  // ../../packages/app/src/workflow/proof-input-fingerprint.ts
78602
79758
  import crypto4 from "crypto";
78603
79759
  import { tmpdir } from "os";
78604
- import { dirname as dirname12, join as join17, resolve as resolve6, sep as sep3 } from "path";
79760
+ import { dirname as dirname13, join as join17, resolve as resolve6, sep as sep3 } from "path";
78605
79761
  function taskDocumentShapeError(content) {
78606
79762
  const doc2 = MarkdownDocument.parse(content, "task");
78607
79763
  const heading = CANONICAL_TASK_HEADING_RE.exec(doc2.bodyWithoutFrontmatter);
@@ -78678,7 +79834,7 @@ async function readProofInputContents(fileSystem = createNodeFileSystem3(), work
78678
79834
  async function createGitAlternateTree(cwd, excludeGlobs = DEFAULT_EXCLUDE_GLOBS, executor = new NodeProcessExecutor3, fs3 = createNodeFileSystem3()) {
78679
79835
  const indexFile = join17(tmpdir(), `spur-proof-fingerprint-${crypto4.randomUUID()}.index`);
78680
79836
  try {
78681
- await fs3.ensureDir(dirname12(indexFile));
79837
+ await fs3.ensureDir(dirname13(indexFile));
78682
79838
  const env2 = Object.fromEntries(Object.entries(getEnvVars()).filter((entry) => entry[1] !== undefined));
78683
79839
  env2.GIT_INDEX_FILE = indexFile;
78684
79840
  const common4 = { cwd, env: env2, forceBuffered: true, rejectOnError: false };
@@ -78802,7 +79958,7 @@ var init_proof_input_fingerprint = __esm(() => {
78802
79958
  });
78803
79959
 
78804
79960
  // ../../packages/app/src/workflow/feature-verification-receipt.ts
78805
- import { basename as basename4, dirname as dirname13, join as join18 } from "path";
79961
+ import { basename as basename4, dirname as dirname14, join as join18 } from "path";
78806
79962
  function assertReceiptId(kind, id) {
78807
79963
  if (!RECEIPT_ID_PATTERN.test(id) || id.includes("..")) {
78808
79964
  throw new Error(`invalid ${kind} for receipt path: ${JSON.stringify(id)}`);
@@ -78812,8 +79968,8 @@ function featureReceiptPaths(runDir, featureId2, runId) {
78812
79968
  assertReceiptId("featureId", featureId2);
78813
79969
  assertReceiptId("runId", runId);
78814
79970
  return {
78815
- runScoped: join18(dirname13(runDir), "memory", "evidence", `${runId}-feature-verification.json`),
78816
- featureScoped: join18(dirname13(runDir), "memory", "evidence", `${featureId2}-feature-verification.json`),
79971
+ runScoped: join18(dirname14(runDir), "memory", "evidence", `${runId}-feature-verification.json`),
79972
+ featureScoped: join18(dirname14(runDir), "memory", "evidence", `${featureId2}-feature-verification.json`),
78817
79973
  log: join18(runDir, `${runId}-feature-verification.log`),
78818
79974
  status: join18(runDir, `${runId}-feature-verification.status`)
78819
79975
  };
@@ -78821,7 +79977,7 @@ function featureReceiptPaths(runDir, featureId2, runId) {
78821
79977
  async function atomicWriteReceipt(fs3, path9, receipt) {
78822
79978
  path9 = await resolveDurableArtifactPath(fs3, receipt.workdir, path9, "evidence");
78823
79979
  ensureDurablePlaneIgnored(receipt.workdir);
78824
- await fs3.ensureDir(dirname13(path9));
79980
+ await fs3.ensureDir(dirname14(path9));
78825
79981
  const body = `${JSON.stringify(receipt, null, 4)}
78826
79982
  `;
78827
79983
  const tmp = `${path9}.tmp`;
@@ -79161,6 +80317,7 @@ var init_verify_verdict = __esm(() => {
79161
80317
  acceptanceCriteria: exports_external.array(coverageRowSchema).optional().default([]),
79162
80318
  checks: exports_external.array(checkSchema).optional().default([]),
79163
80319
  source: exports_external.string().optional(),
80320
+ confidence: exports_external.enum(["HIGH", "MEDIUM", "LOW"]).optional(),
79164
80321
  pipelineRunId: exports_external.string().optional(),
79165
80322
  recordedAt: exports_external.string().optional()
79166
80323
  });
@@ -79182,7 +80339,7 @@ import {
79182
80339
  writeFileSync as writeFileSync6
79183
80340
  } from "fs";
79184
80341
  import { tmpdir as tmpdir2 } from "os";
79185
- import { basename as basename5, dirname as dirname14, isAbsolute as isAbsolute3, join as join19, relative as relative2, resolve as resolve7, sep as sep4 } from "path";
80342
+ import { basename as basename5, dirname as dirname15, isAbsolute as isAbsolute3, join as join19, relative as relative2, resolve as resolve7, sep as sep4 } from "path";
79186
80343
  function runStoragePaths(cwd) {
79187
80344
  const projectRoot = resolveRunStorageRoot(cwd);
79188
80345
  return {
@@ -79634,7 +80791,7 @@ async function migrateRunStorage(input) {
79634
80791
  continue;
79635
80792
  }
79636
80793
  try {
79637
- mkdirSync7(dirname14(target), { recursive: true });
80794
+ mkdirSync7(dirname15(target), { recursive: true });
79638
80795
  if (input.atomicCopy)
79639
80796
  input.atomicCopy(file2, target);
79640
80797
  else
@@ -79704,7 +80861,7 @@ function ensureDurablePlaneIgnored(workdir) {
79704
80861
  }
79705
80862
  if (current.includes(DURABLE_PLANE_EXCLUDE))
79706
80863
  return;
79707
- mkdirSync7(dirname14(excludePath), { recursive: true });
80864
+ mkdirSync7(dirname15(excludePath), { recursive: true });
79708
80865
  const sep5 = current === "" || current.endsWith(`
79709
80866
  `) ? "" : `
79710
80867
  `;
@@ -81410,7 +82567,7 @@ var init_agent_service = __esm(() => {
81410
82567
  // ../../packages/app/src/services/agent-usage-producer.ts
81411
82568
  import { randomUUID as randomUUID5 } from "crypto";
81412
82569
  import { mkdir, rename as rename2, writeFile } from "fs/promises";
81413
- import { dirname as dirname15 } from "path";
82570
+ import { dirname as dirname16 } from "path";
81414
82571
  function classifyProviderUsage(usage) {
81415
82572
  for (const name of RATE_WINDOW_NAMES) {
81416
82573
  const window2 = usage[name];
@@ -81448,7 +82605,7 @@ function observationReason(provider, classification) {
81448
82605
  return `codexbar ${provider} headroom: all usage windows below 100%`;
81449
82606
  }
81450
82607
  async function writeSnapshotAtomic(path9, payload) {
81451
- await mkdir(dirname15(path9), { recursive: true });
82608
+ await mkdir(dirname16(path9), { recursive: true });
81452
82609
  const tmp = `${path9}.tmp-${randomUUID5()}`;
81453
82610
  await writeFile(tmp, `${JSON.stringify(payload, null, 2)}
81454
82611
  `);
@@ -82257,7 +83414,7 @@ var init_workflow_resolver = __esm(() => {
82257
83414
  });
82258
83415
 
82259
83416
  // ../../packages/app/src/services/done-transition-guard.ts
82260
- import { dirname as dirname16, join as join23 } from "path";
83417
+ import { dirname as dirname17, join as join23 } from "path";
82261
83418
  async function readVerdictFrom(fs3, path9, wbs) {
82262
83419
  let exists2;
82263
83420
  try {
@@ -82302,7 +83459,7 @@ async function readVerdictFrom(fs3, path9, wbs) {
82302
83459
  return { artifact: parsed, path: path9, missing: false };
82303
83460
  }
82304
83461
  async function readVerdictArtifact(fs3, runDir, wbs) {
82305
- const evidenceDir = join23(dirname16(runDir), "memory", "evidence");
83462
+ const evidenceDir = join23(dirname17(runDir), "memory", "evidence");
82306
83463
  const evidence = await readVerdictFrom(fs3, `${evidenceDir}/${wbs}-verdict.json`, wbs);
82307
83464
  if (!evidence.missing) {
82308
83465
  const { missing: _missing, ...result2 } = evidence;
@@ -83080,6 +84237,8 @@ function renderTesting(v) {
83080
84237
  lines.push("**Pipeline verify results**");
83081
84238
  lines.push("");
83082
84239
  lines.push(`- Verdict: ${v.verdict} (from verdict artifact)`);
84240
+ if (v.confidence !== undefined)
84241
+ lines.push(`- Confidence: ${v.confidence}`);
83083
84242
  lines.push("");
83084
84243
  if (v.requirements.length === 0) {
83085
84244
  lines.push("| Requirement | Status | Evidence |");
@@ -83437,6 +84596,11 @@ function lintVerifyAnswer(answerText, taskContent, featureContent) {
83437
84596
  } else if (!/^(PASS|PARTIAL|FAIL)$/i.test(tables.verdict.value)) {
83438
84597
  add(tables.verdict.line, "verdict-value", `invalid Verdict value "${tables.verdict.value}" (PASS | PARTIAL | FAIL)`);
83439
84598
  }
84599
+ if (tables.confidence === null) {
84600
+ add(0, "confidence-missing", "no `Confidence:` line (expected exactly one `Confidence: HIGH|MEDIUM|LOW` line)");
84601
+ } else if (!/^(HIGH|MEDIUM|LOW)$/i.test(tables.confidence.value)) {
84602
+ add(tables.confidence.line, "confidence-value", `invalid Confidence value "${tables.confidence.value}" (HIGH | MEDIUM | LOW)`);
84603
+ }
83440
84604
  const reqIds = extractRequirementIds(taskContent);
83441
84605
  const acIndex = buildAcIdentityIndex(taskContent, featureContent ?? null);
83442
84606
  const seenReq = new Set;
@@ -83450,6 +84614,9 @@ function lintVerifyAnswer(answerText, taskContent, featureContent) {
83450
84614
  add(row.line, "req-status", `"${row.id}" invalid status "${row.status}" (MET | PARTIAL | UNMET)`);
83451
84615
  if (!row.evidence.trim())
83452
84616
  add(row.line, "req-evidence", `"${row.id}" has empty evidence`);
84617
+ else if (hasClaimMarker(row.evidence) && !hasCitationForm(row.evidence)) {
84618
+ add(row.line, "evidence-citation", `"${row.id}" evidence asserts an external API/library/version claim without a citation ` + "(add a repo `path:line`, an external `@origin `path` line N`, or a URL in the same cell)");
84619
+ }
83453
84620
  }
83454
84621
  for (const id of reqIds) {
83455
84622
  if (!seenReq.has(id))
@@ -83476,9 +84643,18 @@ function lintVerifyAnswer(answerText, taskContent, featureContent) {
83476
84643
  add(row.line, "ac-evidence-type", `invalid evidence type "${row.evidenceType}" (test | command | static-ref | manual-review | llm-judge | n/a, or a + compound)`);
83477
84644
  if (!row.evidence.trim())
83478
84645
  add(row.line, "ac-evidence", `AC "${row.id.slice(0, 40)}" has empty evidence`);
84646
+ else if (hasClaimMarker(row.evidence) && !hasCitationForm(row.evidence)) {
84647
+ add(row.line, "evidence-citation", `AC "${row.id.slice(0, 40)}" evidence asserts an external API/library/version claim without a citation ` + "(add a repo `path:line`, an external `@origin `path` line N`, or a URL in the same cell)");
84648
+ }
83479
84649
  }
83480
84650
  return findings;
83481
84651
  }
84652
+ function hasClaimMarker(evidence) {
84653
+ return CLAIM_MARKERS.some((re) => re.test(evidence));
84654
+ }
84655
+ function hasCitationForm(evidence) {
84656
+ return CITATION_FORMS.some((re) => re.test(evidence));
84657
+ }
83482
84658
  function splitTableCells(line) {
83483
84659
  return line.split(/(?<!\\)\|/).map((c3) => c3.replace(/\\\|/g, "|").trim()).filter(Boolean);
83484
84660
  }
@@ -83530,7 +84706,7 @@ function normalizeEvidenceType(raw) {
83530
84706
  return EVIDENCE_TYPE_PRECEDENCE.find((candidate) => tokens.includes(candidate)) ?? null;
83531
84707
  }
83532
84708
  function parseAnswer(text4) {
83533
- const out = { verdict: null, reqs: [], acs: [] };
84709
+ const out = { verdict: null, confidence: null, reqs: [], acs: [] };
83534
84710
  const lines = text4.split(`
83535
84711
  `);
83536
84712
  let reqTable = false;
@@ -83590,11 +84766,26 @@ function parseAnswer(text4) {
83590
84766
  out.verdict = {
83591
84767
  value: verdictMatches[0]?.[1] ?? "",
83592
84768
  line: text4.slice(0, verdictMatches[0]?.index ?? 0).split(`
84769
+ `).length
84770
+ };
84771
+ }
84772
+ const confidenceMatches = [...text4.matchAll(/^\s*Confidence:\s*(\S+)\s*$/gim)];
84773
+ if (confidenceMatches.length === 1) {
84774
+ out.confidence = {
84775
+ value: confidenceMatches[0]?.[1] ?? "",
84776
+ line: text4.slice(0, confidenceMatches[0]?.index ?? 0).split(`
83593
84777
  `).length
83594
84778
  };
83595
84779
  }
83596
84780
  return out;
83597
84781
  }
84782
+ function extractAnswerConfidence(text4) {
84783
+ const matches = [...text4.matchAll(/^\s*Confidence:\s*(\S+)\s*$/gim)];
84784
+ if (matches.length !== 1)
84785
+ return;
84786
+ const value = (matches[0]?.[1] ?? "").toUpperCase();
84787
+ return CONFIDENCE_LEVELS.includes(value) ? value : undefined;
84788
+ }
83598
84789
  function sectionBetween(text4, heading) {
83599
84790
  const marker = new RegExp(`^#{1,6}\\s+${heading}\\s*$`, "im");
83600
84791
  const match = marker.exec(text4);
@@ -83701,9 +84892,22 @@ function resolveAcIdentity(rowId, index2) {
83701
84892
  }
83702
84893
  return { ok: false, error: "" };
83703
84894
  }
83704
- var ANSWER_LINT_MAX_FINDINGS = 10, EVIDENCE_TYPE_PRECEDENCE;
84895
+ var ANSWER_LINT_MAX_FINDINGS = 10, CLAIM_MARKERS, CITATION_FORMS, EVIDENCE_TYPE_PRECEDENCE, CONFIDENCE_LEVELS;
83705
84896
  var init_verify_answer_lint = __esm(() => {
84897
+ CLAIM_MARKERS = [
84898
+ /@[a-z0-9._-]+\/[a-z0-9._-]+/i,
84899
+ /\bnode_modules\//,
84900
+ /\b\d+\.\d+\.\d+\b/,
84901
+ /`[A-Za-z_$][\w.$]*\s*\([^`]*\)`/
84902
+ ];
84903
+ CITATION_FORMS = [
84904
+ /`[^`\s]+:\d+(?:-\d+)?`/,
84905
+ /`[^`]+`\s+lines?\s+\d+/i,
84906
+ /\b[\w./-]+\.[A-Za-z0-9]+:\d+(?:-\d+)?\b/,
84907
+ /https?:\/\/\S+/i
84908
+ ];
83706
84909
  EVIDENCE_TYPE_PRECEDENCE = ["test", "command", "static-ref", "manual-review", "llm-judge", "n/a"];
84910
+ CONFIDENCE_LEVELS = ["HIGH", "MEDIUM", "LOW"];
83707
84911
  });
83708
84912
 
83709
84913
  // ../../packages/app/src/services/feature-check.ts
@@ -83725,7 +84929,7 @@ __export(exports_feature_check, {
83725
84929
  FeatureCheckService: () => FeatureCheckService,
83726
84930
  DEFAULT_FEATURE_MATRIX: () => DEFAULT_FEATURE_MATRIX
83727
84931
  });
83728
- import { dirname as dirname17, join as join24 } from "path";
84932
+ import { dirname as dirname18, join as join24 } from "path";
83729
84933
  function isGroupFeature(fm) {
83730
84934
  const tags = fm.tags;
83731
84935
  return Array.isArray(tags) && tags.includes("group") ? "group" : "standard";
@@ -83823,9 +85027,9 @@ function decodeVerdictRows(source, sectionName, required2) {
83823
85027
  function defaultVerdictRunDir(tasksDir) {
83824
85028
  const norm = tasksDir.replace(/\\/g, "/");
83825
85029
  if (/\/docs\/tasks\d*$/.test(norm) || /\/docs\/tasks$/.test(norm)) {
83826
- return join24(dirname17(dirname17(tasksDir)), ".spur", "run");
85030
+ return join24(dirname18(dirname18(tasksDir)), ".spur", "run");
83827
85031
  }
83828
- return join24(dirname17(tasksDir), ".spur", "run");
85032
+ return join24(dirname18(tasksDir), ".spur", "run");
83829
85033
  }
83830
85034
  function scenarioKeys(scenarios) {
83831
85035
  return scenarios.map((s2, i2) => ({
@@ -84121,7 +85325,7 @@ var init_feature_check = __esm(() => {
84121
85325
  if (options?.asStatus === "done" && options?.runDir) {
84122
85326
  await this.checkFeatureVerificationReceipt(featureId2, raw, options.runDir, findings, options.receiptRunPort);
84123
85327
  }
84124
- const dogfoodDir = options?.dogfoodDir ?? (options?.featuresDir ? join24(dirname17(options.featuresDir), "dogfood") : undefined);
85328
+ const dogfoodDir = options?.dogfoodDir ?? (options?.featuresDir ? join24(dirname18(options.featuresDir), "dogfood") : undefined);
84125
85329
  const primaryTasksDir = options?.tasksDir ?? options?.tasksDirs?.[0];
84126
85330
  const runDir = options?.runDir ?? (primaryTasksDir ? defaultVerdictRunDir(primaryTasksDir) : undefined);
84127
85331
  const taskScanDirs = options?.tasksDirs && options.tasksDirs.length > 0 ? options.tasksDirs : options?.tasksDir ? [options.tasksDir] : [];
@@ -84725,7 +85929,7 @@ var init_task_size_precheck = __esm(() => {
84725
85929
  });
84726
85930
 
84727
85931
  // ../../packages/app/src/services/task-check.ts
84728
- import { basename as basename9, dirname as dirname18, join as join25 } from "path";
85932
+ import { basename as basename9, dirname as dirname19, join as join25 } from "path";
84729
85933
  function isPlaceholderBody(body) {
84730
85934
  const stripped = body.replace(/<!--[\s\S]*?-->/g, "").replace(/^\s*>\s*TBD\s*$/gim, "").trim();
84731
85935
  return stripped.length === 0;
@@ -84790,9 +85994,9 @@ function isProseOnlyReview(body) {
84790
85994
  function resolveProjectRootFromTasksDir(tasksDir) {
84791
85995
  const norm = tasksDir.replace(/\\/g, "/");
84792
85996
  if (/\/docs\/tasks\d*$/.test(norm) || /\/docs\/tasks$/.test(norm)) {
84793
- return dirname18(dirname18(tasksDir));
85997
+ return dirname19(dirname19(tasksDir));
84794
85998
  }
84795
- return dirname18(tasksDir);
85999
+ return dirname19(tasksDir);
84796
86000
  }
84797
86001
  function extractBacktickLineAnchors(body) {
84798
86002
  const out = [];
@@ -84992,8 +86196,8 @@ var init_task_check = __esm(() => {
84992
86196
  const entry = this.resolveMatrixEntry(variant, effectiveStatus);
84993
86197
  this.runL2(doc2, entry, findings, raw);
84994
86198
  this.runL3(doc2, entry, effectiveStatus, findings, isTransitionTarget);
84995
- const tasksDir = dirname18(filePath);
84996
- const featuresDir = join25(dirname18(tasksDir), "features");
86199
+ const tasksDir = dirname19(filePath);
86200
+ const featuresDir = join25(dirname19(tasksDir), "features");
84997
86201
  await this.runL4(doc2, fm, effectiveStatus, findings, featuresDir, tasksDir, wbs, status);
84998
86202
  await this.runL4Rollup(doc2, wbs, effectiveStatus, findings, tasksDir);
84999
86203
  if (effectiveStatus !== "done" && effectiveStatus !== "cancelled") {
@@ -85831,7 +87035,7 @@ var init_task_check = __esm(() => {
85831
87035
  });
85832
87036
 
85833
87037
  // ../../packages/app/src/services/corpus-check.ts
85834
- import { basename as basename10, dirname as dirname19, join as join26, relative as relative5, resolve as resolve10 } from "path";
87038
+ import { basename as basename10, dirname as dirname20, join as join26, relative as relative5, resolve as resolve10 } from "path";
85835
87039
  async function loadTaskMatrix(projectRoot) {
85836
87040
  const fs3 = createNodeFileSystem3(projectRoot);
85837
87041
  const candidates = [join26(projectRoot, ".spur", "tasks", "section-matrix.yaml")];
@@ -85984,7 +87188,7 @@ function resolveProjectRoot(cwd) {
85984
87188
  if (fs3.exists(join26(current, ".spur", "config.yaml"))) {
85985
87189
  return current;
85986
87190
  }
85987
- const parent = dirname19(current);
87191
+ const parent = dirname20(current);
85988
87192
  if (parent === current)
85989
87193
  return resolve10(cwd);
85990
87194
  current = parent;
@@ -88725,7 +89929,7 @@ var init_execution_policy = __esm(() => {
88725
89929
 
88726
89930
  // ../../packages/app/src/services/feature-sync-suppression.ts
88727
89931
  import { createHash as createHash10 } from "crypto";
88728
- import { dirname as dirname20, join as join28 } from "path";
89932
+ import { dirname as dirname21, join as join28 } from "path";
88729
89933
  function computeSyncFingerprint(input) {
88730
89934
  const material = [
88731
89935
  input.featureContentHash,
@@ -88757,7 +89961,7 @@ async function readVerdictMtimeVector(fs3, runDir) {
88757
89961
  const dir = runDir.replace(/\/$/, "");
88758
89962
  const vector2 = [];
88759
89963
  const seen = new Set;
88760
- for (const plane of [join28(dirname20(dir), "memory", "evidence"), dir]) {
89964
+ for (const plane of [join28(dirname21(dir), "memory", "evidence"), dir]) {
88761
89965
  let entries;
88762
89966
  try {
88763
89967
  entries = await fs3.readDir(plane);
@@ -89792,6 +90996,7 @@ async function computeSummaryExtrasFromMart(db2, sel, bucket, dimension, activeB
89792
90996
  bySkill: skillBreakdownRaw.bySkill,
89793
90997
  bySource: skillBreakdownRaw.bySource,
89794
90998
  byInvocationKind: skillBreakdownRaw.byInvocationKind,
90999
+ byCapability: skillBreakdownRaw.byCapability,
89795
91000
  trend: projectSkillTimeSeries(skillBreakdownRaw.trend),
89796
91001
  fresh: true
89797
91002
  }
@@ -90102,6 +91307,7 @@ async function computeSummaryExtras(db2, sel, bucket, dimension, exact, activeBu
90102
91307
  bySkill: skillBreakdownRaw.bySkill,
90103
91308
  bySource: skillBreakdownRaw.bySource,
90104
91309
  byInvocationKind: skillBreakdownRaw.byInvocationKind,
91310
+ byCapability: skillBreakdownRaw.byCapability,
90105
91311
  trend: projectSkillTimeSeries(skillBreakdownRaw.trend),
90106
91312
  fresh: !exact
90107
91313
  }
@@ -90295,6 +91501,7 @@ class LiveHistoryBoardService {
90295
91501
  bySkill: [],
90296
91502
  bySource: [],
90297
91503
  byInvocationKind: [],
91504
+ byCapability: [],
90298
91505
  trend: [],
90299
91506
  fresh: true
90300
91507
  }
@@ -91708,7 +92915,7 @@ import {
91708
92915
  writeFileSync as writeFileSync7
91709
92916
  } from "fs";
91710
92917
  import { homedir as homedir7 } from "os";
91711
- import { dirname as dirname21, isAbsolute as isAbsolute6, join as join29, resolve as resolve11, sep as sep6 } from "path";
92918
+ import { dirname as dirname22, isAbsolute as isAbsolute6, join as join29, resolve as resolve11, sep as sep6 } from "path";
91712
92919
  function parseImporterVersion(version3) {
91713
92920
  if (version3 === undefined) {
91714
92921
  return null;
@@ -91824,6 +93031,7 @@ class HistoryService {
91824
93031
  db: db2,
91825
93032
  mode,
91826
93033
  ...opts.file !== undefined && opts.file.length > 0 ? { files: [opts.file] } : opts.root !== undefined && opts.root.length > 0 ? { roots: [opts.root] } : { roots: discovery?.roots ?? [] },
93034
+ ...this.ctx.capabilityOrigins ? { capabilityOrigins: this.ctx.capabilityOrigins } : {},
91827
93035
  dryRun
91828
93036
  });
91829
93037
  if (!dryRun && result.importedRecords > 0) {
@@ -92370,10 +93578,10 @@ function buildLadderSnapshot(agentConfig) {
92370
93578
  function writeArtifact(artifact, opts) {
92371
93579
  const { artifactPath, sidecarPath } = resolveArtifactPaths(artifact, opts);
92372
93580
  const { bounded: bounded3, overflow } = boundCoverage(artifact.coverage);
92373
- mkdirSync8(dirname21(artifactPath), { recursive: true });
93581
+ mkdirSync8(dirname22(artifactPath), { recursive: true });
92374
93582
  writeFileSync7(artifactPath, JSON.stringify({ ...artifact, coverage: bounded3 }, null, 2));
92375
93583
  if (overflow.length > 0) {
92376
- mkdirSync8(dirname21(sidecarPath), { recursive: true });
93584
+ mkdirSync8(dirname22(sidecarPath), { recursive: true });
92377
93585
  writeFileSync7(sidecarPath, `${overflow.map((line) => JSON.stringify(line)).join(`
92378
93586
  `)}
92379
93587
  `);
@@ -92429,7 +93637,7 @@ function resolveArtifactPath(explicitPath, cwd) {
92429
93637
  throw new Error(`No artifact path given and no latest pointer at ${latest}. ` + "Run `spur history analyze` first, or pass an explicit artifact path.");
92430
93638
  }
92431
93639
  const target = readlinkSync(latest);
92432
- const resolved = isAbsolute6(target) ? target : resolve11(dirname21(latest), target);
93640
+ const resolved = isAbsolute6(target) ? target : resolve11(dirname22(latest), target);
92433
93641
  if (!existsSync8(resolved)) {
92434
93642
  throw new Error(`Latest pointer ${latest} \u2192 ${resolved}, but the target does not exist.`);
92435
93643
  }
@@ -93874,7 +95082,7 @@ var init_tripwire = __esm(() => {
93874
95082
 
93875
95083
  // ../../packages/app/src/workflow/actions/agent-run.ts
93876
95084
  import { tmpdir as tmpdir3 } from "os";
93877
- import { dirname as dirname22, isAbsolute as isAbsolute7, join as join32 } from "path";
95085
+ import { dirname as dirname23, isAbsolute as isAbsolute7, join as join32 } from "path";
93878
95086
  function parseExecutorPin(raw) {
93879
95087
  if (typeof raw !== "string" || raw.trim() === "")
93880
95088
  return;
@@ -94467,7 +95675,7 @@ Write the required artifact to this absolute path: ${join32(cwd, rel)}`;
94467
95675
  if (capture && answerFile !== undefined) {
94468
95676
  const target = isAbsolute7(answerFile) ? answerFile : join32(cwd, answerFile);
94469
95677
  const fs3 = createNodeFileSystem3(cwd);
94470
- await fs3.ensureDir(dirname22(target));
95678
+ await fs3.ensureDir(dirname23(target));
94471
95679
  await fs3.writeFile(target, answer);
94472
95680
  }
94473
95681
  if (ok && answerFile !== undefined && answer.trim() === "") {
@@ -94536,7 +95744,7 @@ ${traced.stdout ?? ""}`);
94536
95744
  try {
94537
95745
  const sidecarPath = join32(cwd, ".spur", "run", `${context4.runId}-agent-session.json`);
94538
95746
  const fs3 = createNodeFileSystem3(cwd);
94539
- await fs3.ensureDir(dirname22(sidecarPath));
95747
+ await fs3.ensureDir(dirname23(sidecarPath));
94540
95748
  await fs3.writeFile(sidecarPath, JSON.stringify({
94541
95749
  agent: resolvedAgent,
94542
95750
  sessionId: discoveredSessionId ?? null,
@@ -94792,9 +96000,9 @@ async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd
94792
96000
  const target = join32(cwd, ".spur", "run", `${context4.runId}-${context4.stateOrNodeId}-partial.md`);
94793
96001
  const retained = await resolveDurableArtifactPath(fs3, cwd, join32(runArtifactsDir(cwd, context4.runId), `${context4.runId}-${context4.stateOrNodeId}-partial.md`), "runs");
94794
96002
  ensureDurablePlaneIgnored(cwd);
94795
- await fs3.ensureDir(dirname22(retained));
96003
+ await fs3.ensureDir(dirname23(retained));
94796
96004
  await atomicWriteAsync(retained, body, context4.runId, fs3);
94797
- await fs3.ensureDir(dirname22(target));
96005
+ await fs3.ensureDir(dirname23(target));
94798
96006
  await fs3.writeFile(target, body);
94799
96007
  } catch {}
94800
96008
  }
@@ -94840,7 +96048,7 @@ async function createGitWorkingTreeSnapshot(cwd, excludeGlobs = ["docs/tasks3/*"
94840
96048
  const fs3 = createNodeFileSystem3(cwd);
94841
96049
  let keepIndex = false;
94842
96050
  try {
94843
- await fs3.ensureDir(dirname22(indexFile));
96051
+ await fs3.ensureDir(dirname23(indexFile));
94844
96052
  const env2 = Object.fromEntries(Object.entries(getEnvVars()).filter((entry) => entry[1] !== undefined));
94845
96053
  env2.GIT_INDEX_FILE = indexFile;
94846
96054
  const executor = new NodeProcessExecutor3;
@@ -94958,7 +96166,7 @@ function isInScope(change, allowlist) {
94958
96166
  return change.path === rule.path || change.path.startsWith(`${rule.path}/`);
94959
96167
  if (change.path === rule.path)
94960
96168
  return true;
94961
- return change.untracked && dirname22(change.path) === dirname22(rule.path);
96169
+ return change.untracked && dirname23(change.path) === dirname23(rule.path);
94962
96170
  });
94963
96171
  }
94964
96172
  async function findOutOfScopeChanges(cwd, wbs, changed) {
@@ -96056,7 +97264,7 @@ var init_rule_check = __esm(() => {
96056
97264
 
96057
97265
  // ../../packages/app/src/workflow/actions/run-artifact.ts
96058
97266
  import { createHash as createHash13, randomUUID as randomUUID6 } from "crypto";
96059
- import { basename as basename12, dirname as dirname23, join as join34, relative as relative7, resolve as resolve13, sep as sep8 } from "path";
97267
+ import { basename as basename12, dirname as dirname24, join as join34, relative as relative7, resolve as resolve13, sep as sep8 } from "path";
96060
97268
  async function sha256File(path9) {
96061
97269
  return createHash13("sha256").update(await readFile3(path9)).digest("hex");
96062
97270
  }
@@ -96077,7 +97285,7 @@ async function persistDurableArtifact(normalized, workdir, runId, fs3, allowMiss
96077
97285
  if (await fs3.stat(dest) && await fs3.stat(sourcePath) === null) {
96078
97286
  throw new Error(`durable artifact source identity is missing: ${dest}`);
96079
97287
  }
96080
- await mkdir2(dirname23(dest), { recursive: true });
97288
+ await mkdir2(dirname24(dest), { recursive: true });
96081
97289
  try {
96082
97290
  await writeFile2(sourcePath, sourceIdentity, { flag: "wx" });
96083
97291
  } catch (error51) {
@@ -97564,7 +98772,7 @@ var init_progress_projection = __esm(() => {
97564
98772
 
97565
98773
  // ../../packages/app/src/services/workflow-service.ts
97566
98774
  import { realpathSync as realpathSync6, statSync as statSync9 } from "fs";
97567
- import { basename as basename14, dirname as dirname24, isAbsolute as isAbsolute8, join as join35, relative as relative8, resolve as resolve14, sep as sep9 } from "path";
98775
+ import { basename as basename14, dirname as dirname25, isAbsolute as isAbsolute8, join as join35, relative as relative8, resolve as resolve14, sep as sep9 } from "path";
97568
98776
  function signalSubprocess(pid) {
97569
98777
  if (!Number.isInteger(pid) || pid <= 1)
97570
98778
  return false;
@@ -97876,7 +99084,7 @@ class WorkflowAppService {
97876
99084
  moves.set(entry.source, canonicalTarget);
97877
99085
  moves.set(realpathSync6(entry.source), canonicalTarget);
97878
99086
  moves.set(relative8(paths.projectRoot, entry.source), canonicalTarget);
97879
- for (let source = dirname24(entry.source), target = dirname24(canonicalTarget);source.startsWith(paths.scratchDir + sep9); source = dirname24(source), target = dirname24(target)) {
99087
+ for (let source = dirname25(entry.source), target = dirname25(canonicalTarget);source.startsWith(paths.scratchDir + sep9); source = dirname25(source), target = dirname25(target)) {
97880
99088
  moves.set(source, target);
97881
99089
  moves.set(realpathSync6(source), target);
97882
99090
  moves.set(relative8(paths.projectRoot, source), target);
@@ -98586,7 +99794,7 @@ class WorkflowAppService {
98586
99794
  };
98587
99795
  }
98588
99796
  async loadWorkflowExtensions(host, workflow, file2) {
98589
- const refs = collectWorkflowExtensions(workflow.name, dirname24(file2), workflow.extensions);
99797
+ const refs = collectWorkflowExtensions(workflow.name, dirname25(file2), workflow.extensions);
98590
99798
  if (refs.length === 0)
98591
99799
  return;
98592
99800
  const nodeFs = createNodeFileSystem3();
@@ -101710,7 +102918,7 @@ var init_section_matrix_loader = __esm(() => {
101710
102918
  // ../../packages/app/src/services/slash-commands-service.ts
101711
102919
  import { existsSync as existsSync11, mkdirSync as mkdirSync10, readdirSync as readdirSync8, readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "fs";
101712
102920
  import { homedir as homedir9 } from "os";
101713
- import { basename as basename17, dirname as dirname25, join as join39, resolve as resolve18 } from "path";
102921
+ import { basename as basename17, dirname as dirname26, join as join39, resolve as resolve18 } from "path";
101714
102922
  function getBuiltinClaudeCommands() {
101715
102923
  return BUILTIN_CLAUDE_COMMANDS.map((cmd) => ({ ...cmd }));
101716
102924
  }
@@ -101738,7 +102946,7 @@ function findPluginsSpCommandsDir(startDir = process.cwd()) {
101738
102946
  } catch {
101739
102947
  break;
101740
102948
  }
101741
- const parent = dirname25(current);
102949
+ const parent = dirname26(current);
101742
102950
  if (parent === current) {
101743
102951
  break;
101744
102952
  }
@@ -101757,7 +102965,7 @@ function findProjectClaudeCommandsDir(startDir = process.cwd()) {
101757
102965
  } catch {
101758
102966
  break;
101759
102967
  }
101760
- const parent = dirname25(current);
102968
+ const parent = dirname26(current);
101761
102969
  if (parent === current) {
101762
102970
  break;
101763
102971
  }
@@ -102088,7 +103296,7 @@ function generateSlashCommandsFile(targetPath = getSlashCommandsFilePath(), opti
102088
103296
  commands
102089
103297
  };
102090
103298
  try {
102091
- const dir = dirname25(targetPath);
103299
+ const dir = dirname26(targetPath);
102092
103300
  if (!existsSync11(dir)) {
102093
103301
  mkdirSync10(dir, { recursive: true });
102094
103302
  }
@@ -102622,7 +103830,7 @@ var init_strategy_runtime = __esm(() => {
102622
103830
  });
102623
103831
 
102624
103832
  // ../../packages/app/src/services/supervisor-service.ts
102625
- import { dirname as dirname26 } from "path";
103833
+ import { dirname as dirname27 } from "path";
102626
103834
  function defaultWrapperArgv(agentId) {
102627
103835
  return {
102628
103836
  command: process.execPath,
@@ -102682,7 +103890,7 @@ class SupervisorService {
102682
103890
  }
102683
103891
  if (spec.tags.some((tag) => tag.startsWith("fleet:"))) {
102684
103892
  await new FleetService({
102685
- fs: createNodeFileSystem3(dirname26(dirname26(this.configDir)))
103893
+ fs: createNodeFileSystem3(dirname27(dirname27(this.configDir)))
102686
103894
  }).assertLaunchGroundTruth(spec.workspace);
102687
103895
  }
102688
103896
  const { command, args } = this.resolveCommand(spec);
@@ -103421,7 +104629,7 @@ var init_task_readiness = __esm(() => {
103421
104629
  });
103422
104630
 
103423
104631
  // ../../packages/app/src/services/task-scaffold.ts
103424
- import { dirname as dirname27 } from "path";
104632
+ import { dirname as dirname28 } from "path";
103425
104633
 
103426
104634
  class TaskScaffoldService {
103427
104635
  ctx;
@@ -103464,7 +104672,7 @@ class TaskScaffoldService {
103464
104672
  fileExists2 = false;
103465
104673
  }
103466
104674
  const mergeResult = mergeStubs(existingContent, stubs);
103467
- const dir = dirname27(targetFile);
104675
+ const dir = dirname28(targetFile);
103468
104676
  await this.ctx.fs.ensureDir(dir);
103469
104677
  if (mergeResult.created > 0 || !fileExists2) {
103470
104678
  await this.ctx.fs.writeFile(targetFile, mergeResult.content);
@@ -103544,7 +104752,7 @@ class LifecycleAdapter {
103544
104752
  allowed: false,
103545
104753
  from: currentStatus,
103546
104754
  to,
103547
- report: `No pipeline run recorded for ${ref.id}. Run the pipeline first (` + `spur workflow run task-pipeline.yaml --vars '{"wbs":"${ref.id}"}'), ` + "or pass --provenance-bypass on `spur task update` to bypass (recorded)."
104755
+ report: `No pipeline run recorded for ${ref.id}. Run the pipeline first (` + `spur workflow run task-pipeline.yaml --vars '{"wbs":"${ref.id}"}'), ` + "or pass --provenance-bypass on `spur task update` to bypass (recorded). " + `Provenance DB checked: ${this.opts.cwd} (per-tree isolation \u2014 if the pipeline ` + `ran in another tree, e.g. a --worktree invoked from elsewhere, re-record ` + `\`spur task run-link ${ref.id}\` from this tree).`
103548
104756
  };
103549
104757
  }
103550
104758
  }
@@ -103806,7 +105014,7 @@ var init_task_transition = __esm(() => {
103806
105014
  });
103807
105015
 
103808
105016
  // ../../packages/app/src/services/task-service.ts
103809
- import { dirname as dirname28, isAbsolute as isAbsolute9, join as join40, relative as relative10 } from "path";
105017
+ import { dirname as dirname29, isAbsolute as isAbsolute9, join as join40, relative as relative10 } from "path";
103810
105018
  function renderRosterTable(rows) {
103811
105019
  const header = `| WBS | Sub-task | Status |
103812
105020
  | --- | -------- | ------ |`;
@@ -104351,7 +105559,7 @@ ${templateBackground}`;
104351
105559
  const featureId2 = fm.feature_id ?? fm["feature-id"];
104352
105560
  if (!featureId2 || featureId2.length === 0)
104353
105561
  return null;
104354
- const ac = await readFeatureAcBody(this.ctx.fs, join40(dirname28(taskFilePath), "..", "features"), featureId2);
105562
+ const ac = await readFeatureAcBody(this.ctx.fs, join40(dirname29(taskFilePath), "..", "features"), featureId2);
104355
105563
  if (ac === null)
104356
105564
  return null;
104357
105565
  return { featureId: featureId2, ac, taskAc: stripAcFence(doc2.getSection("Acceptance Criteria") ?? "") };
@@ -104393,7 +105601,7 @@ ${templateBackground}`;
104393
105601
  const durablePath = await resolveDurableArtifactPath(this.ctx.fs, paths.projectRoot, join40(paths.evidenceDir, `${wbs}-verdict.json`), "evidence");
104394
105602
  const bytes = await this.ctx.fs.readFile(verdictPath);
104395
105603
  ensureDurablePlaneIgnored(paths.projectRoot);
104396
- await this.ctx.fs.ensureDir(dirname28(durablePath));
105604
+ await this.ctx.fs.ensureDir(dirname29(durablePath));
104397
105605
  await atomicWriteAsync(durablePath, bytes, wbs, this.ctx.fs, this.ctx.projectName ?? "spur");
104398
105606
  }
104399
105607
  const result = {
@@ -104919,8 +106127,15 @@ function deriveVerdict(answerText, taskCheckPassed) {
104919
106127
  const parsedAc = extractAcceptanceCriteria(answerText);
104920
106128
  const acceptanceCriteria = applyAcceptanceCriteriaEvidenceRule(parsedAc.rows);
104921
106129
  const checks4 = extractChecks(answerText, taskCheckPassed, requirements, acceptanceCriteria, parsedAc.dropped);
106130
+ const confidence = extractAnswerConfidence(answerText);
104922
106131
  if (requirements.length === 0) {
104923
- return { verdict: "UNKNOWN", requirements, acceptanceCriteria, checks: checks4 };
106132
+ return {
106133
+ verdict: "UNKNOWN",
106134
+ ...confidence !== undefined ? { confidence } : {},
106135
+ requirements,
106136
+ acceptanceCriteria,
106137
+ checks: checks4
106138
+ };
104924
106139
  }
104925
106140
  const aggregate2 = aggregateVerifyVerdict({
104926
106141
  requirements,
@@ -104928,7 +106143,13 @@ function deriveVerdict(answerText, taskCheckPassed) {
104928
106143
  checks: [],
104929
106144
  taskCheckPassed
104930
106145
  });
104931
- return { verdict: aggregate2, requirements, acceptanceCriteria, checks: checks4 };
106146
+ return {
106147
+ verdict: aggregate2,
106148
+ ...confidence !== undefined ? { confidence } : {},
106149
+ requirements,
106150
+ acceptanceCriteria,
106151
+ checks: checks4
106152
+ };
104932
106153
  }
104933
106154
  function extractRequirements(text4) {
104934
106155
  const reqs = [];
@@ -105192,6 +106413,7 @@ function aggregateBatchVerdicts(results) {
105192
106413
  }
105193
106414
  var EVIDENCE_TYPE_PRECEDENCE2, NOT_STARTED_STATUSES;
105194
106415
  var init_task_verdict = __esm(() => {
106416
+ init_verify_answer_lint();
105195
106417
  init_verify_verdict();
105196
106418
  EVIDENCE_TYPE_PRECEDENCE2 = ["test", "command", "static-ref", "manual-review", "llm-judge", "n/a"];
105197
106419
  NOT_STARTED_STATUSES = {
@@ -106165,7 +107387,7 @@ var init_progress_follow = __esm(() => {
106165
107387
  });
106166
107388
 
106167
107389
  // ../../packages/app/src/workflow/trace-writer.ts
106168
- import { dirname as dirname29, join as join42 } from "path";
107390
+ import { dirname as dirname30, join as join42 } from "path";
106169
107391
 
106170
107392
  class WorkflowTraceWriter {
106171
107393
  path;
@@ -106199,7 +107421,7 @@ class WorkflowTraceWriter {
106199
107421
  `;
106200
107422
  this.pending = this.pending.then(async () => {
106201
107423
  const fs3 = createNodeFileSystem3();
106202
- await fs3.ensureDir(dirname29(this.path));
107424
+ await fs3.ensureDir(dirname30(this.path));
106203
107425
  await fs3.appendFile(this.path, line);
106204
107426
  });
106205
107427
  }
@@ -106794,19 +108016,19 @@ var {
106794
108016
  init_src();
106795
108017
  init_loader();
106796
108018
 
106797
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application-node.js
108019
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application-node.js
106798
108020
  init_dist4();
106799
108021
  init_dist5();
106800
108022
  import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
106801
108023
  import { dirname as dirname6 } from "path";
106802
108024
 
106803
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application/index.js
108025
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application/index.js
106804
108026
  init_default_observers();
106805
108027
  init_event_bus();
106806
108028
  init_file_observer();
106807
108029
  init_logger3();
106808
108030
 
106809
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
108031
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
106810
108032
  class NoopSchedulerAdapter {
106811
108033
  constructor() {}
106812
108034
  register(_cron, _action) {}
@@ -106814,7 +108036,7 @@ class NoopSchedulerAdapter {
106814
108036
  async stop() {}
106815
108037
  }
106816
108038
 
106817
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
108039
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
106818
108040
  function initScheduler(adapter, cronEntries) {
106819
108041
  const resolved = adapter ?? new NoopSchedulerAdapter;
106820
108042
  if (cronEntries) {
@@ -106825,7 +108047,7 @@ function initScheduler(adapter, cronEntries) {
106825
108047
  return resolved;
106826
108048
  }
106827
108049
 
106828
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
108050
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
106829
108051
  init_logger3();
106830
108052
  init_metrics();
106831
108053
  init_sdk();
@@ -106918,7 +108140,7 @@ function dbPlugin(db2) {
106918
108140
  };
106919
108141
  }
106920
108142
 
106921
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
108143
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
106922
108144
  init_logger3();
106923
108145
 
106924
108146
  class PluginHost {
@@ -107006,7 +108228,7 @@ class PluginHost {
107006
108228
  }
107007
108229
  }
107008
108230
 
107009
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application/index.js
108231
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application/index.js
107010
108232
  async function performShutdown(state, reason) {
107011
108233
  if (state.stopped)
107012
108234
  return;
@@ -107118,7 +108340,7 @@ async function runApplication(options) {
107118
108340
  throw error51;
107119
108341
  }
107120
108342
  }
107121
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/scheduler/cron.js
108343
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/scheduler/cron.js
107122
108344
  var MAX_SCAN_MINUTES = 8 * 366 * 24 * 60;
107123
108345
  var DAYS_OF_WEEK = 7;
107124
108346
  function parseField(raw, min, max) {
@@ -107232,7 +108454,7 @@ function nextCronTime(expr, nowMs) {
107232
108454
  throw new RangeError(`unsupported cron expression "${expr.source}": no matching time within 8 years`);
107233
108455
  }
107234
108456
 
107235
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
108457
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
107236
108458
  init_logger3();
107237
108459
  init_metrics();
107238
108460
  var MAX_TIMEOUT = 2147483647;
@@ -107386,7 +108608,7 @@ class NodeSchedulerAdapter {
107386
108608
  }
107387
108609
  }
107388
108610
  }
107389
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
108611
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
107390
108612
  var import_api14 = __toESM(require_src(), 1);
107391
108613
 
107392
108614
  // ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
@@ -110402,7 +111624,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
110402
111624
  }), JsonTraceSerializer));
110403
111625
  }
110404
111626
  }
110405
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
111627
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
110406
111628
  var import_resources2 = __toESM(require_src4(), 1);
110407
111629
  var import_sdk_trace_node = __toESM(require_src8(), 1);
110408
111630
  var import_semantic_conventions = __toESM(require_src2(), 1);
@@ -110453,7 +111675,7 @@ async function shutdownNodeTelemetry() {
110453
111675
  await Promise.all(pending);
110454
111676
  }
110455
111677
 
110456
- // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.11+9a4f23303b607509/node_modules/@gobing-ai/ts-infra/dist/application-node.js
111678
+ // ../../node_modules/.bun/@gobing-ai+ts-infra@0.5.12+13e68d4123a4a304/node_modules/@gobing-ai/ts-infra/dist/application-node.js
110457
111679
  class ConfigValidationError extends Error {
110458
111680
  constructor(message) {
110459
111681
  super(message);
@@ -114532,7 +115754,7 @@ await init_src3();
114532
115754
  import { existsSync as existsSync14, readFileSync as readFileSync15 } from "fs";
114533
115755
  import { rm, writeFile as writeFile3 } from "fs/promises";
114534
115756
  import { tmpdir as tmpdir4 } from "os";
114535
- import { dirname as dirname30, join as join44 } from "path";
115757
+ import { dirname as dirname31, join as join44 } from "path";
114536
115758
 
114537
115759
  // src/colors.ts
114538
115760
  var CODES = {
@@ -116096,7 +117318,7 @@ ${result.content}`);
116096
117318
  dryRun,
116097
117319
  projectRoot: context4.cwd,
116098
117320
  write: async (filePath, wbs, section, newBody) => {
116099
- const ref = { kind: "task", id: wbs, filePath, folder: dirname30(filePath) };
117321
+ const ref = { kind: "task", id: wbs, filePath, folder: dirname31(filePath) };
116100
117322
  const ws = new PlanningWriteService({ fs: context4.fs, emitter: makePlanningEmitter(context4) });
116101
117323
  await ws.updateSection(ref, section, newBody);
116102
117324
  }
@@ -118524,6 +119746,7 @@ async function assertFeatureCheckPass(context4, id, folderOverride, strict, asSt
118524
119746
  init_src();
118525
119747
  init_src2();
118526
119748
  init_dist7();
119749
+ init_dist6();
118527
119750
  await init_src3();
118528
119751
  import { createRequire } from "module";
118529
119752
 
@@ -118531,7 +119754,7 @@ import { createRequire } from "module";
118531
119754
  var CLI_CONFIG = {
118532
119755
  binaryName: "spur",
118533
119756
  binaryLabel: "spur",
118534
- binaryVersion: "0.3.98",
119757
+ binaryVersion: "0.3.99",
118535
119758
  configDir: ".spur",
118536
119759
  configFile: ".spur/config.yaml",
118537
119760
  databaseFile: ".spur/spur.db"
@@ -118560,9 +119783,32 @@ function formatProvenance(provenance) {
118560
119783
  return `binary: ${provenance.binary}
118561
119784
  importer: @gobing-ai/ts-llm-jsonl-importer@${provenance.importer}`;
118562
119785
  }
119786
+ var CAPABILITY_KINDS2 = new Set(["command", "subagent", "skill"]);
119787
+ function parseCapabilityOriginSpec(spec) {
119788
+ const parts = spec.split(":").map((part) => part.trim());
119789
+ const source = parts[0];
119790
+ const [artifactDigest, kind, originIdentity] = parts.slice(-3);
119791
+ const skillName = parts.slice(1, -3).join(":");
119792
+ if (parts.length < 5 || !source || !skillName || !artifactDigest || !kind || !originIdentity) {
119793
+ throw new Error(`--capability-origin expects source:skillName:artifactDigest:capabilityKind:originIdentity (got ${parts.length} parts)`);
119794
+ }
119795
+ if (!/^[0-9a-f]{64}$/.test(artifactDigest)) {
119796
+ throw new Error("--capability-origin: artifactDigest must be a 64-char lowercase sha-256 hex digest");
119797
+ }
119798
+ if (!CAPABILITY_KINDS2.has(kind)) {
119799
+ throw new Error(`--capability-origin: capabilityKind must be one of command|subagent|skill (got '${kind}')`);
119800
+ }
119801
+ return {
119802
+ source,
119803
+ skillName: canonicalizeSkillName(skillName),
119804
+ artifactDigest,
119805
+ capabilityKind: kind,
119806
+ originIdentity
119807
+ };
119808
+ }
118563
119809
  function registerHistoryCommand(program2, context4) {
118564
119810
  const noun = program2.command("history").summary("import and analyze coding-agent history");
118565
- const makeService3 = async () => {
119811
+ const makeService3 = async (capabilityOrigins) => {
118566
119812
  let taskLocator;
118567
119813
  try {
118568
119814
  const { foldersConfig } = await resolvePlanningFolders(context4.fs);
@@ -118579,11 +119825,12 @@ function registerHistoryCommand(program2, context4) {
118579
119825
  agentConfig: context4.agentConfig,
118580
119826
  ...taskLocator ? { taskLocator } : {},
118581
119827
  importerVersion: provenance.importer,
119828
+ ...capabilityOrigins ? { capabilityOrigins } : {},
118582
119829
  fs: context4.fs,
118583
119830
  cwd: context4.cwd
118584
119831
  });
118585
119832
  };
118586
- noun.command("import").description("Import agent conversation JSONL. `--source all` fans out across all sources with " + "per-source failure isolation (task 0470). A single source is the n=1 case of " + "the same contract \u2014 never two import paths.").option(...SHARED_OPTIONS.sourceHistory, "all").option(...SHARED_OPTIONS.fileHistoryJsonl).option("--root <path>", "Scan a history root").option(...SHARED_OPTIONS.modeHistory).option(...SHARED_OPTIONS.dryRunHistoryScan).option("--source-timeout <ms|none>", `Per-source timeout in milliseconds or 'none' (default ${DEFAULT_SOURCE_TIMEOUT_MS} = 10 min)`).option(...SHARED_OPTIONS.jsonSupported).option(...SHARED_OPTIONS.jsonEnvelope).action(async (options) => {
119833
+ noun.command("import").description("Import agent conversation JSONL. `--source all` fans out across all sources with " + "per-source failure isolation (task 0470). A single source is the n=1 case of " + "the same contract \u2014 never two import paths.").option(...SHARED_OPTIONS.sourceHistory, "all").option(...SHARED_OPTIONS.fileHistoryJsonl).option("--root <path>", "Scan a history root").option(...SHARED_OPTIONS.modeHistory).option(...SHARED_OPTIONS.dryRunHistoryScan).option("--source-timeout <ms|none>", `Per-source timeout in milliseconds or 'none' (default ${DEFAULT_SOURCE_TIMEOUT_MS} = 10 min)`).option(...SHARED_OPTIONS.jsonSupported).option(...SHARED_OPTIONS.jsonEnvelope).option("--capability-origin <spec>", "Classify skill calls against a released artifact: " + "source:skillName:artifactDigest:capabilityKind:originIdentity (repeatable).", (value, previous) => [...previous, value], []).action(async (options) => {
118587
119834
  const source = options.source ?? "all";
118588
119835
  if (options.file && source === "all") {
118589
119836
  context4.output.write(options.json ? toEnvelopeJson({ status: "error", message: '--file requires a single --source, not "all".' }, {
@@ -118632,7 +119879,21 @@ function registerHistoryCommand(program2, context4) {
118632
119879
  context4.setExitCode(1);
118633
119880
  return;
118634
119881
  }
118635
- const svc = await makeService3();
119882
+ let capabilityOrigins;
119883
+ if (options.capabilityOrigin.length > 0) {
119884
+ try {
119885
+ capabilityOrigins = options.capabilityOrigin.map(parseCapabilityOriginSpec);
119886
+ } catch (err) {
119887
+ const message = err instanceof Error ? err.message : String(err);
119888
+ context4.output.write(options.json ? toEnvelopeJson({ status: "error", message }, {
119889
+ enveloped: options.jsonEnvelope,
119890
+ error: { code: "INTERNAL_ERROR", message, details: { cliCode: "usage" } }
119891
+ }) : `spur history import: ${message}`);
119892
+ context4.setExitCode(1);
119893
+ return;
119894
+ }
119895
+ }
119896
+ const svc = await makeService3(capabilityOrigins);
118636
119897
  let fanOut;
118637
119898
  try {
118638
119899
  fanOut = await svc.importAll({
@@ -119722,7 +120983,7 @@ function registerMigrateCommand(program2, context4, options = {}) {
119722
120983
  init_src2();
119723
120984
  init_dist5();
119724
120985
  await init_src3();
119725
- import { basename as basename19, dirname as dirname31, join as join50, resolve as resolve21 } from "path";
120986
+ import { basename as basename19, dirname as dirname32, join as join50, resolve as resolve21 } from "path";
119726
120987
  function registerProjectsCommand(program2, context4) {
119727
120988
  const projectsCmd = program2.command("projects").summary("manage the Spur multi-project registry");
119728
120989
  projectsCmd.command("add").argument("<path>", "Project root directory path").option(...SHARED_OPTIONS.nameProjectDisplay).option(...SHARED_OPTIONS.jsonProjectsResponse).option(...SHARED_OPTIONS.jsonEnvelope).action(async (pathArg, options) => {
@@ -119818,7 +121079,7 @@ function registerProjectsCommand(program2, context4) {
119818
121079
  })));
119819
121080
  const openProjectDb = async (projectPath) => {
119820
121081
  const url2 = join50(projectPath, ".spur", "spur.db");
119821
- await context4.fs.ensureDir(dirname31(url2));
121082
+ await context4.fs.ensureDir(dirname32(url2));
119822
121083
  return createMigratedDb({ url: url2 });
119823
121084
  };
119824
121085
  const fleets = options.fleet ? await Promise.all(projects3.map(async (p) => {
@@ -120270,7 +121531,7 @@ init_src();
120270
121531
  init_loader();
120271
121532
  init_src2();
120272
121533
  await init_src3();
120273
- import { basename as basename21, dirname as dirname33, isAbsolute as isAbsolute10, join as join54 } from "path";
121534
+ import { basename as basename21, dirname as dirname34, isAbsolute as isAbsolute10, join as join54 } from "path";
120274
121535
  init_dist5();
120275
121536
 
120276
121537
  // ../server/src/bootstrap.ts
@@ -126592,10 +127853,19 @@ var historySkillItemSchema = exports_external.object({
126592
127853
  color: exports_external.string(),
126593
127854
  count: exports_external.number()
126594
127855
  });
127856
+ var historyCapabilityUsageSchema = exports_external.object({
127857
+ skillName: exports_external.string(),
127858
+ capabilityKind: exports_external.string().nullable(),
127859
+ invocationKind: exports_external.string(),
127860
+ evidenceKind: exports_external.string().nullable(),
127861
+ status: exports_external.string().nullable(),
127862
+ calls: exports_external.number()
127863
+ });
126595
127864
  var historySkillBreakdownSchema = exports_external.object({
126596
127865
  bySkill: exports_external.array(exports_external.object({ skillName: exports_external.string(), calls: exports_external.number() })),
126597
127866
  bySource: exports_external.array(exports_external.object({ source: exports_external.string(), calls: exports_external.number() })),
126598
127867
  byInvocationKind: exports_external.array(exports_external.object({ invocationKind: exports_external.string(), calls: exports_external.number() })),
127868
+ byCapability: exports_external.array(historyCapabilityUsageSchema).default([]),
126599
127869
  trend: exports_external.array(historyTimeSeriesPointSchema),
126600
127870
  fresh: exports_external.boolean().default(true)
126601
127871
  });
@@ -127358,7 +128628,7 @@ await init_src3();
127358
128628
  import { homedir as homedir12 } from "os";
127359
128629
  import { basename as basename20, join as join51, relative as relative11, resolve as resolve23 } from "path";
127360
128630
  // ../server/package.json
127361
- var version3 = "0.3.98";
128631
+ var version3 = "0.3.99";
127362
128632
 
127363
128633
  // ../server/src/modules/health/index.ts
127364
128634
  var startedAt = Date.now();
@@ -131138,7 +132408,7 @@ init_loader();
131138
132408
  init_src2();
131139
132409
  init_dist5();
131140
132410
  await init_src3();
131141
- import { dirname as dirname32, join as join53 } from "path";
132411
+ import { dirname as dirname33, join as join53 } from "path";
131142
132412
  var NOOP_OUTPUT = { write: (_s) => {}, error: (_s) => {} };
131143
132413
 
131144
132414
  class LazyPlanningEventEmitter {
@@ -131215,7 +132485,7 @@ function createServerContext(appRt, options) {
131215
132485
  if (!dbPromise) {
131216
132486
  const created = (async () => {
131217
132487
  if (dbUrl !== IN_MEMORY_DATABASE_URL) {
131218
- await fs3.ensureDir(dirname32(dbUrl));
132488
+ await fs3.ensureDir(dirname33(dbUrl));
131219
132489
  }
131220
132490
  return createMigratedDbViaRuntime({ url: dbUrl });
131221
132491
  })();
@@ -131802,8 +133072,8 @@ async function resolveWebDistPath(configuredPath, projectRoot = process.cwd()) {
131802
133072
  const candidates = configuredPath && configuredPath.trim() !== "" ? [isAbsolute10(configuredPath) ? configuredPath : join54(projectRoot, configuredPath)] : [
131803
133073
  join54(projectRoot, "dist/web"),
131804
133074
  join54(import.meta.dir, "web"),
131805
- join54(dirname33(process.execPath), "web"),
131806
- join54(dirname33(process.execPath), "../web"),
133075
+ join54(dirname34(process.execPath), "web"),
133076
+ join54(dirname34(process.execPath), "../web"),
131807
133077
  join54(import.meta.dir, "../../../dist/web")
131808
133078
  ];
131809
133079
  for (const candidate of candidates) {
@@ -131829,7 +133099,7 @@ async function startServer(options, deps = defaultDeps) {
131829
133099
  async start(appRt) {
131830
133100
  const fs3 = deps.createNodeFileSystem(projectRoot);
131831
133101
  if (options.dbUrl && options.dbUrl !== IN_MEMORY_DATABASE_URL) {
131832
- await fs3.ensureDir(dirname33(options.dbUrl));
133102
+ await fs3.ensureDir(dirname34(options.dbUrl));
131833
133103
  }
131834
133104
  const scheduler3 = appRt.config.scheduler.enabled ? appRt.scheduler : undefined;
131835
133105
  const webDistPath = await resolveWebDistPath(options.webDistPath, projectRoot);
@@ -132752,9 +134022,15 @@ Monitor with: spur workflow trace ${runId2} --follow`);
132752
134022
  });
132753
134023
  const escalationSink = await makeEscalationPacketSink(bus, context4);
132754
134024
  if (humanProgress) {
132755
- context4.output.write(`Run: ${runId}`);
132756
- if (planPreview !== undefined)
132757
- context4.output.write(planPreview);
134025
+ let headerPrinted = false;
134026
+ bus.on("workflow.run.started", (event) => {
134027
+ if (headerPrinted)
134028
+ return;
134029
+ headerPrinted = true;
134030
+ context4.output.write(`Run: ${event.runId}`);
134031
+ if (planPreview !== undefined)
134032
+ context4.output.write(planPreview);
134033
+ });
132758
134034
  const stepOptions = { detail, showRunId: false };
132759
134035
  const report = (event) => {
132760
134036
  const line = renderStepLine(event, stepOptions);
@@ -133586,7 +134862,7 @@ init_src();
133586
134862
  init_src2();
133587
134863
  init_dist5();
133588
134864
  await init_src3();
133589
- import { dirname as dirname34, join as join58, resolve as resolve25 } from "path";
134865
+ import { dirname as dirname35, join as join58, resolve as resolve25 } from "path";
133590
134866
  import { isatty as isatty4 } from "tty";
133591
134867
 
133592
134868
  // ../../node_modules/.bun/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
@@ -135026,7 +136302,7 @@ async function createMigratedDbAdapter(cwd = process.cwd(), env2 = getEnvVars(),
135026
136302
  const configuredUrl = env2.DATABASE_URL === undefined ? join58(cwd, DEFAULT_DATABASE_URL) : config4.database.url;
135027
136303
  const url2 = dbUrl ?? configuredUrl;
135028
136304
  if (url2 !== IN_MEMORY_DATABASE_URL) {
135029
- await createNodeFileSystem3().ensureDir(dirname34(url2));
136305
+ await createNodeFileSystem3().ensureDir(dirname35(url2));
135030
136306
  }
135031
136307
  return createMigratedDb({ url: url2 });
135032
136308
  }