@gobing-ai/spur 0.3.34 → 0.3.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/corpus-baseline.json +61 -0
- package/config/templates/task/brainstorm.md +1 -0
- package/config/templates/task/feature-impl.md +4 -1
- package/config/templates/task/issue.md +1 -0
- package/config/templates/task/meta.md +4 -1
- package/config/templates/task/review.md +1 -0
- package/config/templates/task/standard.md +4 -1
- package/config/workflows/idea-pipeline.yaml +1 -1
- package/config/workflows/task-pipeline.yaml +23 -2
- package/package.json +10 -10
- package/spur.js +1643 -381
- package/web/_astro/{BoardApp.CyyIiK76.js → BoardApp.8sc6Rb1t.js} +14 -14
- package/web/_astro/BoardApp.ChKnY1JD.js +1 -0
- package/web/_astro/{TaskDetail.BfUuRsfM.js → TaskDetail.DOKJP-Kp.js} +1 -1
- package/web/_astro/{arc.C7fql4LL.js → arc.CTqmqspU.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.IJPsRX-V.js → architectureDiagram-3BPJPVTR.B0iBdehs.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.B1AUwBxq.js → blockDiagram-GPEHLZMM.BHE5UFj5.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.BuSJPR3z.js → c4Diagram-AAUBKEIU.DQApkgGM.js} +1 -1
- package/web/_astro/channel.B0q9WGrH.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.CaOPTr9l.js → chunk-2J33WTMH.fPrKLM8v.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.DQzxExn8.js → chunk-4BX2VUAB.DExvwBhn.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.IIb103c7.js → chunk-55IACEB6.EjNkjuD6.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.DOYz1K1b.js → chunk-727SXJPM.Dl8xy5rT.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.CFcfW-wt.js → chunk-AQP2D5EJ.BSzMBgBs.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.C7Hn0jo3.js → chunk-FMBD7UC4.CAeOHpbb.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.Ba83VQ1m.js → chunk-ND2GUHAM.Bbeu_ZOH.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.CizNbIIP.js → chunk-QZHKN3VN.Da_GaIAZ.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.2NYYPXHq.js → classDiagram-4FO5ZUOK.sMfFYSQp.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.2NYYPXHq.js → classDiagram-v2-Q7XG4LA2.sMfFYSQp.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.DwBqVzml.js → cose-bilkent-S5V4N54A.PS3IwOH4.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.DqnYsHWG.js → dagre-BM42HDAG.EQCx8a6D.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.D8TKhgy-.js → diagram-2AECGRRQ.aEFQl8v8.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.BUD6Prj5.js → diagram-5GNKFQAL.jyN4tqFX.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.Cvg7hmND.js → diagram-KO2AKTUF.DaTVHnme.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.FUG_B9eS.js → diagram-LMA3HP47.DWsGRLAN.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.XsBZQ0hQ.js → diagram-OG6HWLK6.DYxmOViu.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.M_LSGgLQ.js → erDiagram-TEJ5UH35.BKM75coa.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.DZikZBRa.js → flowDiagram-I6XJVG4X.B7qpqDW5.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.DTKuEmXY.js → ganttDiagram-6RSMTGT7.CYBL-hwy.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.Dt-E9XmY.js → gitGraphDiagram-PVQCEYII.Cz4ly3Kq.js} +1 -1
- package/web/_astro/{infoDiagram-5YYISTIA.D5snevU1.js → infoDiagram-5YYISTIA.CIS7cXrJ.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.DmXdBf9W.js → ishikawaDiagram-YF4QCWOH.DQ-pmaOG.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.HPJSRkkU.js → journeyDiagram-JHISSGLW.DVS6F7UM.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.BxCqCnL1.js → kanban-definition-UN3LZRKU.D8t-G-U6.js} +1 -1
- package/web/_astro/{linear.BnXQUpS-.js → linear.IO8rTd_n.js} +1 -1
- package/web/_astro/{mermaid.core.D-ZeOmpg.js → mermaid.core.CjVnvFNf.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.DxrftiFR.js → mindmap-definition-RKZ34NQL.DZoEMTnU.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.D-ZcWxwg.js → pieDiagram-4H26LBE5.86r1QWnX.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.C-dVJ7GW.js → quadrantDiagram-W4KKPZXB.DzFA9uPk.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.lalE_R8X.js → requirementDiagram-4Y6WPE33.dQvdvfMr.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.C4uPynAF.js → sankeyDiagram-5OEKKPKP.BvC-VNI8.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.uBOenkqh.js → sequenceDiagram-3UESZ5HK.DDQNwHs8.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.CQOusSP2.js → stateDiagram-AJRCARHV.BKwYy-tQ.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.Bw0ZdjYb.js → stateDiagram-v2-BHNVJYJU.KxCiRYYf.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.DbkPA5ce.js → timeline-definition-PNZ67QCA.Bh9NDjOx.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.CIKhzwoA.js → vennDiagram-CIIHVFJN.DIM-n6us.js} +1 -1
- package/web/_astro/{wardley-L42UT6IY.0P-tqaFs.js → wardley-L42UT6IY.DW15qOFQ.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.DrwTvM_M.js → wardleyDiagram-YWT4CUSO.UTIvjsG9.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.BgJsQVms.js → xychartDiagram-2RQKCTM6.CQYhkVDS.js} +1 -1
- package/web/index.html +1 -1
- package/web/_astro/BoardApp.CBVEjvSW.js +0 -1
- package/web/_astro/channel.D3uZSASb.js +0 -1
package/spur.js
CHANGED
|
@@ -47,7 +47,7 @@ var __export = (target, all) => {
|
|
|
47
47
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
48
48
|
var __require = import.meta.require;
|
|
49
49
|
|
|
50
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
50
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/errors.js
|
|
51
51
|
var ErrorCode;
|
|
52
52
|
var init_errors = __esm(() => {
|
|
53
53
|
ErrorCode = {
|
|
@@ -58,7 +58,7 @@ var init_errors = __esm(() => {
|
|
|
58
58
|
};
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
61
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/api-response.js
|
|
62
62
|
var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
|
|
63
63
|
var init_api_response = __esm(() => {
|
|
64
64
|
init_errors();
|
|
@@ -81,10 +81,10 @@ var init_api_response = __esm(() => {
|
|
|
81
81
|
CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
84
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/cursor.js
|
|
85
85
|
var init_cursor = () => {};
|
|
86
86
|
|
|
87
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
87
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/object.js
|
|
88
88
|
function isPlainObject(value) {
|
|
89
89
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
90
90
|
}
|
|
@@ -102,7 +102,7 @@ function deepMerge(target, source) {
|
|
|
102
102
|
return result;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
105
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/output.js
|
|
106
106
|
function processStream(name) {
|
|
107
107
|
const proc = globalThis.process;
|
|
108
108
|
const stream = proc?.[name];
|
|
@@ -123,7 +123,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
123
123
|
}
|
|
124
124
|
var defaultStdoutTarget, defaultStderrTarget;
|
|
125
125
|
|
|
126
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
126
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.22/node_modules/@gobing-ai/ts-utils/dist/index.js
|
|
127
127
|
var init_dist = __esm(() => {
|
|
128
128
|
init_api_response();
|
|
129
129
|
init_cursor();
|
|
@@ -21745,7 +21745,7 @@ var init_zod = __esm(() => {
|
|
|
21745
21745
|
init_external();
|
|
21746
21746
|
});
|
|
21747
21747
|
|
|
21748
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21748
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
21749
21749
|
function getProcessEnv() {
|
|
21750
21750
|
return process.env;
|
|
21751
21751
|
}
|
|
@@ -21823,7 +21823,7 @@ var init_config = __esm(() => {
|
|
|
21823
21823
|
};
|
|
21824
21824
|
});
|
|
21825
21825
|
|
|
21826
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21826
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
21827
21827
|
import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
|
|
21828
21828
|
import { dirname, resolve as resolvePath } from "path";
|
|
21829
21829
|
function createNodeFileSystem(root, paths) {
|
|
@@ -21910,7 +21910,7 @@ function findProjectRoot(startDir) {
|
|
|
21910
21910
|
}
|
|
21911
21911
|
var init_file_system_node = () => {};
|
|
21912
21912
|
|
|
21913
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21913
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
|
|
21914
21914
|
var DbModuleNotInstalledError;
|
|
21915
21915
|
var init_db_errors = __esm(() => {
|
|
21916
21916
|
DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
|
|
@@ -22521,7 +22521,7 @@ var init_figures = __esm(() => {
|
|
|
22521
22521
|
replacements = Object.entries(specialMainSymbols);
|
|
22522
22522
|
});
|
|
22523
22523
|
|
|
22524
|
-
// ../../node_modules/.bun/yoctocolors@2.
|
|
22524
|
+
// ../../node_modules/.bun/yoctocolors@2.2.0/node_modules/yoctocolors/base.js
|
|
22525
22525
|
import tty from "tty";
|
|
22526
22526
|
var hasColors, format = (open, close) => {
|
|
22527
22527
|
if (!hasColors) {
|
|
@@ -22547,7 +22547,7 @@ var hasColors, format = (open, close) => {
|
|
|
22547
22547
|
result += string4.slice(lastIndex) + closeCode;
|
|
22548
22548
|
return result;
|
|
22549
22549
|
};
|
|
22550
|
-
}, reset, bold, dim, italic, underline, overline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright;
|
|
22550
|
+
}, reset, bold, dim, italic, underline, underlineDouble, underlineCurly, underlineDotted, underlineDashed, overline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright, underlineBlack, underlineRed, underlineGreen, underlineYellow, underlineBlue, underlineMagenta, underlineCyan, underlineWhite, underlineGray, underlineRedBright, underlineGreenBright, underlineYellowBright, underlineBlueBright, underlineMagentaBright, underlineCyanBright, underlineWhiteBright;
|
|
22551
22551
|
var init_base = __esm(() => {
|
|
22552
22552
|
hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
22553
22553
|
reset = format(0, 0);
|
|
@@ -22555,6 +22555,10 @@ var init_base = __esm(() => {
|
|
|
22555
22555
|
dim = format(2, 22);
|
|
22556
22556
|
italic = format(3, 23);
|
|
22557
22557
|
underline = format(4, 24);
|
|
22558
|
+
underlineDouble = format("4:2", 24);
|
|
22559
|
+
underlineCurly = format("4:3", 24);
|
|
22560
|
+
underlineDotted = format("4:4", 24);
|
|
22561
|
+
underlineDashed = format("4:5", 24);
|
|
22558
22562
|
overline = format(53, 55);
|
|
22559
22563
|
inverse = format(7, 27);
|
|
22560
22564
|
hidden = format(8, 28);
|
|
@@ -22591,9 +22595,25 @@ var init_base = __esm(() => {
|
|
|
22591
22595
|
bgMagentaBright = format(105, 49);
|
|
22592
22596
|
bgCyanBright = format(106, 49);
|
|
22593
22597
|
bgWhiteBright = format(107, 49);
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
|
|
22598
|
+
underlineBlack = format("58;5;0", 59);
|
|
22599
|
+
underlineRed = format("58;5;1", 59);
|
|
22600
|
+
underlineGreen = format("58;5;2", 59);
|
|
22601
|
+
underlineYellow = format("58;5;3", 59);
|
|
22602
|
+
underlineBlue = format("58;5;4", 59);
|
|
22603
|
+
underlineMagenta = format("58;5;5", 59);
|
|
22604
|
+
underlineCyan = format("58;5;6", 59);
|
|
22605
|
+
underlineWhite = format("58;5;7", 59);
|
|
22606
|
+
underlineGray = format("58;5;8", 59);
|
|
22607
|
+
underlineRedBright = format("58;5;9", 59);
|
|
22608
|
+
underlineGreenBright = format("58;5;10", 59);
|
|
22609
|
+
underlineYellowBright = format("58;5;11", 59);
|
|
22610
|
+
underlineBlueBright = format("58;5;12", 59);
|
|
22611
|
+
underlineMagentaBright = format("58;5;13", 59);
|
|
22612
|
+
underlineCyanBright = format("58;5;14", 59);
|
|
22613
|
+
underlineWhiteBright = format("58;5;15", 59);
|
|
22614
|
+
});
|
|
22615
|
+
|
|
22616
|
+
// ../../node_modules/.bun/yoctocolors@2.2.0/node_modules/yoctocolors/index.js
|
|
22597
22617
|
var init_yoctocolors = __esm(() => {
|
|
22598
22618
|
init_base();
|
|
22599
22619
|
});
|
|
@@ -29101,7 +29121,7 @@ var init_execa = __esm(() => {
|
|
|
29101
29121
|
} = getIpcExport());
|
|
29102
29122
|
});
|
|
29103
29123
|
|
|
29104
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29124
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
|
|
29105
29125
|
import { isatty } from "tty";
|
|
29106
29126
|
|
|
29107
29127
|
class NodeProcessExecutor {
|
|
@@ -29440,7 +29460,7 @@ var init_process_executor = __esm(() => {
|
|
|
29440
29460
|
init_execa();
|
|
29441
29461
|
});
|
|
29442
29462
|
|
|
29443
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29463
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
|
|
29444
29464
|
function getNodeFileSystem() {
|
|
29445
29465
|
if (!_nodeFileSystem)
|
|
29446
29466
|
_nodeFileSystem = createNodeFileSystem();
|
|
@@ -29500,7 +29520,7 @@ var init_runtime_node_bun = __esm(() => {
|
|
|
29500
29520
|
};
|
|
29501
29521
|
});
|
|
29502
29522
|
|
|
29503
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29523
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
29504
29524
|
class RuntimeContext {
|
|
29505
29525
|
scope;
|
|
29506
29526
|
runtimeName;
|
|
@@ -29570,7 +29590,7 @@ var init_context = __esm(() => {
|
|
|
29570
29590
|
init_runtime_node_bun();
|
|
29571
29591
|
});
|
|
29572
29592
|
|
|
29573
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29593
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
29574
29594
|
function normalizeSeparators(path6) {
|
|
29575
29595
|
return path6.replaceAll("\\", "/");
|
|
29576
29596
|
}
|
|
@@ -29631,17 +29651,17 @@ var init_path = __esm(() => {
|
|
|
29631
29651
|
SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
29632
29652
|
});
|
|
29633
29653
|
|
|
29634
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29654
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
29635
29655
|
var REMOTE_SCHEMA_MAX_BYTES;
|
|
29636
29656
|
var init_schema_validation = __esm(() => {
|
|
29637
29657
|
init_dist2();
|
|
29638
29658
|
REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
|
|
29639
29659
|
});
|
|
29640
29660
|
|
|
29641
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29661
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
29642
29662
|
var init_types = () => {};
|
|
29643
29663
|
|
|
29644
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29664
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
29645
29665
|
var init_dist3 = __esm(() => {
|
|
29646
29666
|
init_config();
|
|
29647
29667
|
init_context();
|
|
@@ -29650,7 +29670,7 @@ var init_dist3 = __esm(() => {
|
|
|
29650
29670
|
init_types();
|
|
29651
29671
|
});
|
|
29652
29672
|
|
|
29653
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29673
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+2fb2e08999400036/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
|
|
29654
29674
|
import { Database } from "bun:sqlite";
|
|
29655
29675
|
var init_bun_sqlite = () => {};
|
|
29656
29676
|
|
|
@@ -33842,7 +33862,7 @@ var init_bun_sqlite2 = __esm(() => {
|
|
|
33842
33862
|
init_session2();
|
|
33843
33863
|
});
|
|
33844
33864
|
|
|
33845
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
33865
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
|
|
33846
33866
|
var inboxMessages;
|
|
33847
33867
|
var init_inbox_messages = __esm(() => {
|
|
33848
33868
|
init_sqlite_core();
|
|
@@ -33861,7 +33881,7 @@ var init_inbox_messages = __esm(() => {
|
|
|
33861
33881
|
}, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
|
|
33862
33882
|
});
|
|
33863
33883
|
|
|
33864
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
33884
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/common.js
|
|
33865
33885
|
function nowTimestamp() {
|
|
33866
33886
|
return Date.now();
|
|
33867
33887
|
}
|
|
@@ -33890,7 +33910,7 @@ var init_common3 = __esm(() => {
|
|
|
33890
33910
|
appendOnlyColumns = buildAppendOnlyColumns();
|
|
33891
33911
|
});
|
|
33892
33912
|
|
|
33893
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
33913
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
|
|
33894
33914
|
var queueJobs;
|
|
33895
33915
|
var init_queue_jobs = __esm(() => {
|
|
33896
33916
|
init_sqlite_core();
|
|
@@ -33910,7 +33930,7 @@ var init_queue_jobs = __esm(() => {
|
|
|
33910
33930
|
}, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
|
|
33911
33931
|
});
|
|
33912
33932
|
|
|
33913
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
33933
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
|
|
33914
33934
|
var exports_runtime = {};
|
|
33915
33935
|
__export(exports_runtime, {
|
|
33916
33936
|
queueJobs: () => queueJobs,
|
|
@@ -33921,7 +33941,7 @@ var init_runtime = __esm(() => {
|
|
|
33921
33941
|
init_queue_jobs();
|
|
33922
33942
|
});
|
|
33923
33943
|
|
|
33924
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
33944
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
|
|
33925
33945
|
var exports_bun_sqlite = {};
|
|
33926
33946
|
__export(exports_bun_sqlite, {
|
|
33927
33947
|
BunSqliteAdapter: () => BunSqliteAdapter
|
|
@@ -34212,7 +34232,7 @@ var init_d1 = __esm(() => {
|
|
|
34212
34232
|
init_session3();
|
|
34213
34233
|
});
|
|
34214
34234
|
|
|
34215
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34235
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
|
|
34216
34236
|
var exports_d1 = {};
|
|
34217
34237
|
__export(exports_d1, {
|
|
34218
34238
|
D1Adapter: () => D1Adapter
|
|
@@ -34276,7 +34296,7 @@ var init_d12 = __esm(() => {
|
|
|
34276
34296
|
init_runtime();
|
|
34277
34297
|
});
|
|
34278
34298
|
|
|
34279
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34299
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/adapter.js
|
|
34280
34300
|
async function createDbAdapter(config3) {
|
|
34281
34301
|
switch (config3.driver) {
|
|
34282
34302
|
case "bun-sqlite": {
|
|
@@ -34316,7 +34336,7 @@ var init_drizzle_orm = __esm(() => {
|
|
|
34316
34336
|
init_view_common();
|
|
34317
34337
|
});
|
|
34318
34338
|
|
|
34319
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34339
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/query-spec.js
|
|
34320
34340
|
function compilePredicate(predicate) {
|
|
34321
34341
|
if ("and" in predicate) {
|
|
34322
34342
|
const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
|
|
@@ -34354,7 +34374,7 @@ var init_query_spec = __esm(() => {
|
|
|
34354
34374
|
};
|
|
34355
34375
|
});
|
|
34356
34376
|
|
|
34357
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34377
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/base-dao.js
|
|
34358
34378
|
function asSelectQuery(query) {
|
|
34359
34379
|
return query;
|
|
34360
34380
|
}
|
|
@@ -34396,7 +34416,7 @@ var init_base_dao = __esm(() => {
|
|
|
34396
34416
|
init_query_spec();
|
|
34397
34417
|
});
|
|
34398
34418
|
|
|
34399
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34419
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
|
|
34400
34420
|
var embeddedMigrations;
|
|
34401
34421
|
var init_embedded_migrations = __esm(() => {
|
|
34402
34422
|
embeddedMigrations = [
|
|
@@ -34428,7 +34448,7 @@ var init_embedded_migrations = __esm(() => {
|
|
|
34428
34448
|
];
|
|
34429
34449
|
});
|
|
34430
34450
|
|
|
34431
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34451
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
|
|
34432
34452
|
var EntityDao;
|
|
34433
34453
|
var init_entity_dao = __esm(() => {
|
|
34434
34454
|
init_drizzle_orm();
|
|
@@ -34590,7 +34610,7 @@ var init_entity_dao = __esm(() => {
|
|
|
34590
34610
|
};
|
|
34591
34611
|
});
|
|
34592
34612
|
|
|
34593
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34613
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
|
|
34594
34614
|
function isPromiseLike(value) {
|
|
34595
34615
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
34596
34616
|
}
|
|
@@ -34763,7 +34783,7 @@ var init_migrator2 = __esm(() => {
|
|
|
34763
34783
|
init_migrator();
|
|
34764
34784
|
});
|
|
34765
34785
|
|
|
34766
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34786
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/migrate.js
|
|
34767
34787
|
async function ensureJournalTable(adapter, table3) {
|
|
34768
34788
|
await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
|
|
34769
34789
|
}
|
|
@@ -34838,7 +34858,7 @@ var init_migrate = __esm(() => {
|
|
|
34838
34858
|
init_embedded_migrations();
|
|
34839
34859
|
});
|
|
34840
34860
|
|
|
34841
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34861
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
|
|
34842
34862
|
var QueueJobDao;
|
|
34843
34863
|
var init_queue_job_dao = __esm(() => {
|
|
34844
34864
|
init_drizzle_orm();
|
|
@@ -34979,7 +34999,7 @@ var init_queue_job_dao = __esm(() => {
|
|
|
34979
34999
|
};
|
|
34980
35000
|
});
|
|
34981
35001
|
|
|
34982
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
35002
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/index.js
|
|
34983
35003
|
var exports_dist = {};
|
|
34984
35004
|
__export(exports_dist, {
|
|
34985
35005
|
embeddedMigrations: () => embeddedMigrations,
|
|
@@ -37129,6 +37149,7 @@ var init_finding_codes = __esm(() => {
|
|
|
37129
37149
|
"L3.requirements-format",
|
|
37130
37150
|
"L3.requirements-empty",
|
|
37131
37151
|
"L3.ac-empty",
|
|
37152
|
+
"L3.ac-requirement-coverage",
|
|
37132
37153
|
"L3.solution-file-line",
|
|
37133
37154
|
"L3.review-priority-table",
|
|
37134
37155
|
"L3.testing-coverage",
|
|
@@ -37175,6 +37196,7 @@ var init_finding_codes = __esm(() => {
|
|
|
37175
37196
|
L3_REQUIREMENTS_FORMAT: "L3.requirements-format",
|
|
37176
37197
|
L3_REQUIREMENTS_EMPTY: "L3.requirements-empty",
|
|
37177
37198
|
L3_AC_EMPTY: "L3.ac-empty",
|
|
37199
|
+
L3_AC_REQUIREMENT_COVERAGE: "L3.ac-requirement-coverage",
|
|
37178
37200
|
L3_SOLUTION_FILE_LINE: "L3.solution-file-line",
|
|
37179
37201
|
L3_REVIEW_PRIORITY_TABLE: "L3.review-priority-table",
|
|
37180
37202
|
L3_TESTING_COVERAGE: "L3.testing-coverage",
|
|
@@ -37465,7 +37487,7 @@ var init_src = __esm(() => {
|
|
|
37465
37487
|
});
|
|
37466
37488
|
});
|
|
37467
37489
|
|
|
37468
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37490
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
37469
37491
|
function parseYamlObject(text3) {
|
|
37470
37492
|
let parsed;
|
|
37471
37493
|
try {
|
|
@@ -37592,7 +37614,7 @@ var init_config2 = __esm(() => {
|
|
|
37592
37614
|
};
|
|
37593
37615
|
});
|
|
37594
37616
|
|
|
37595
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37617
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
37596
37618
|
import { appendFileSync as appendFileSync3, cpSync as cpSync2, createReadStream as createReadStream3, createWriteStream as createWriteStream3, existsSync as existsSync2, mkdirSync as mkdirSync2, readdirSync as readdirSync2, readFileSync as readFileSync4, realpathSync as realpathSync2, renameSync as renameSync2, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
37597
37619
|
import { dirname as dirname2, resolve as resolvePath3 } from "path";
|
|
37598
37620
|
function createNodeFileSystem3(root, paths) {
|
|
@@ -37679,7 +37701,7 @@ function findProjectRoot3(startDir) {
|
|
|
37679
37701
|
}
|
|
37680
37702
|
var init_file_system_node2 = () => {};
|
|
37681
37703
|
|
|
37682
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37704
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
|
|
37683
37705
|
var D1NotConfiguredError2, DbModuleNotInstalledError3;
|
|
37684
37706
|
var init_db_errors2 = __esm(() => {
|
|
37685
37707
|
D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
|
|
@@ -37696,7 +37718,7 @@ var init_db_errors2 = __esm(() => {
|
|
|
37696
37718
|
};
|
|
37697
37719
|
});
|
|
37698
37720
|
|
|
37699
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37721
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
|
|
37700
37722
|
function createCfFileSystem2() {
|
|
37701
37723
|
return {
|
|
37702
37724
|
getProjectRoot: () => "/bundle",
|
|
@@ -37735,7 +37757,7 @@ function createCfFileSystem2() {
|
|
|
37735
37757
|
}
|
|
37736
37758
|
var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
|
|
37737
37759
|
|
|
37738
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37760
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
|
|
37739
37761
|
var exports_runtime_cf = {};
|
|
37740
37762
|
__export(exports_runtime_cf, {
|
|
37741
37763
|
cloudflareWorkersFactory: () => cloudflareWorkersFactory2
|
|
@@ -37773,7 +37795,7 @@ var init_runtime_cf = __esm(() => {
|
|
|
37773
37795
|
};
|
|
37774
37796
|
});
|
|
37775
37797
|
|
|
37776
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37798
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
|
|
37777
37799
|
import { isatty as isatty2 } from "tty";
|
|
37778
37800
|
|
|
37779
37801
|
class NodeProcessExecutor3 {
|
|
@@ -38159,7 +38181,7 @@ var init_process_executor2 = __esm(() => {
|
|
|
38159
38181
|
ProcessExecutor2 = NodeProcessExecutor3;
|
|
38160
38182
|
});
|
|
38161
38183
|
|
|
38162
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38184
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
|
|
38163
38185
|
var exports_runtime_node_bun = {};
|
|
38164
38186
|
__export(exports_runtime_node_bun, {
|
|
38165
38187
|
nodeBunFactory: () => nodeBunFactory3,
|
|
@@ -38227,7 +38249,7 @@ var init_runtime_node_bun2 = __esm(() => {
|
|
|
38227
38249
|
};
|
|
38228
38250
|
});
|
|
38229
38251
|
|
|
38230
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38252
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/platform.js
|
|
38231
38253
|
function isCloudflareWorkerRuntime2() {
|
|
38232
38254
|
return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
|
|
38233
38255
|
}
|
|
@@ -38257,7 +38279,7 @@ function _resetRuntimeFactory2() {
|
|
|
38257
38279
|
}
|
|
38258
38280
|
var _factory, _runtimeName;
|
|
38259
38281
|
|
|
38260
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38282
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
38261
38283
|
class RuntimeContext2 {
|
|
38262
38284
|
scope;
|
|
38263
38285
|
runtimeName;
|
|
@@ -38347,7 +38369,7 @@ var init_context2 = __esm(() => {
|
|
|
38347
38369
|
init_runtime_node_bun2();
|
|
38348
38370
|
});
|
|
38349
38371
|
|
|
38350
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38372
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
38351
38373
|
function normalizeSeparators2(path7) {
|
|
38352
38374
|
return path7.replaceAll("\\", "/");
|
|
38353
38375
|
}
|
|
@@ -38470,7 +38492,7 @@ var init_path2 = __esm(() => {
|
|
|
38470
38492
|
SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
38471
38493
|
});
|
|
38472
38494
|
|
|
38473
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38495
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/fs.js
|
|
38474
38496
|
async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
|
|
38475
38497
|
await fs2.ensureDir(dirnamePath(path7));
|
|
38476
38498
|
}
|
|
@@ -38521,7 +38543,7 @@ var init_fs = __esm(() => {
|
|
|
38521
38543
|
init_path2();
|
|
38522
38544
|
});
|
|
38523
38545
|
|
|
38524
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38546
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
|
|
38525
38547
|
function allocateId() {
|
|
38526
38548
|
nextIdSeq += 1;
|
|
38527
38549
|
return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
|
|
@@ -38645,7 +38667,7 @@ function createInMemoryProcessRegistry2(options) {
|
|
|
38645
38667
|
}
|
|
38646
38668
|
var nextIdSeq = 0;
|
|
38647
38669
|
|
|
38648
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38670
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
|
|
38649
38671
|
function ambientRuntimePaths2() {
|
|
38650
38672
|
const cwd = getProcessCwd2();
|
|
38651
38673
|
return { cwd, home: getHomeDir() ?? cwd };
|
|
@@ -38655,7 +38677,7 @@ var init_runtime_paths = __esm(() => {
|
|
|
38655
38677
|
init_path2();
|
|
38656
38678
|
});
|
|
38657
38679
|
|
|
38658
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38680
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
38659
38681
|
async function loadStructuredConfig(path7, options = {}) {
|
|
38660
38682
|
const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
|
|
38661
38683
|
return await parseStructuredConfig(content, path7, options);
|
|
@@ -38932,10 +38954,10 @@ var init_schema_validation2 = __esm(() => {
|
|
|
38932
38954
|
defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
|
|
38933
38955
|
});
|
|
38934
38956
|
|
|
38935
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38957
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
38936
38958
|
var init_types2 = () => {};
|
|
38937
38959
|
|
|
38938
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38960
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
38939
38961
|
var exports_dist2 = {};
|
|
38940
38962
|
__export(exports_dist2, {
|
|
38941
38963
|
writeJsonFile: () => writeJsonFile2,
|
|
@@ -41086,7 +41108,7 @@ var init_mod = __esm(() => {
|
|
|
41086
41108
|
init_config3();
|
|
41087
41109
|
});
|
|
41088
41110
|
|
|
41089
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
41111
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/logger.js
|
|
41090
41112
|
function toLogTapeLevel(level) {
|
|
41091
41113
|
return level === "warn" ? "warning" : level;
|
|
41092
41114
|
}
|
|
@@ -42639,7 +42661,7 @@ var require_src = __commonJS((exports) => {
|
|
|
42639
42661
|
};
|
|
42640
42662
|
});
|
|
42641
42663
|
|
|
42642
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
42664
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
|
|
42643
42665
|
function getTelemetryConfig(configPartial = {}) {
|
|
42644
42666
|
return {
|
|
42645
42667
|
enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
|
|
@@ -42675,7 +42697,7 @@ var init_sdk = __esm(() => {
|
|
|
42675
42697
|
resolvedConfig = getTelemetryConfig();
|
|
42676
42698
|
});
|
|
42677
42699
|
|
|
42678
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
42700
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
|
|
42679
42701
|
function isSuppressed(tracer2) {
|
|
42680
42702
|
return tracer2 === undefined && !getResolvedConfig().enabled;
|
|
42681
42703
|
}
|
|
@@ -42715,7 +42737,7 @@ var init_tracing2 = __esm(() => {
|
|
|
42715
42737
|
import_api2 = __toESM(require_src(), 1);
|
|
42716
42738
|
});
|
|
42717
42739
|
|
|
42718
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
42740
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
|
|
42719
42741
|
function getMeter() {
|
|
42720
42742
|
return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
|
|
42721
42743
|
}
|
|
@@ -42812,7 +42834,7 @@ var init_metrics = __esm(() => {
|
|
|
42812
42834
|
instruments = {};
|
|
42813
42835
|
});
|
|
42814
42836
|
|
|
42815
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
42837
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
|
|
42816
42838
|
function busLogger() {
|
|
42817
42839
|
if (!_busLogger)
|
|
42818
42840
|
_busLogger = getLogger2("event-bus");
|
|
@@ -43057,7 +43079,7 @@ var init_event_bus = __esm(() => {
|
|
|
43057
43079
|
init_metrics();
|
|
43058
43080
|
});
|
|
43059
43081
|
|
|
43060
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43082
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
|
|
43061
43083
|
function obsLogger() {
|
|
43062
43084
|
if (!_obsLogger)
|
|
43063
43085
|
_obsLogger = getLogger2("event-bus.observers");
|
|
@@ -43121,7 +43143,7 @@ var init_default_observers = __esm(() => {
|
|
|
43121
43143
|
init_event_bus();
|
|
43122
43144
|
});
|
|
43123
43145
|
|
|
43124
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43146
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
|
|
43125
43147
|
function parentDir(filePath) {
|
|
43126
43148
|
const idx = filePath.lastIndexOf("/");
|
|
43127
43149
|
return idx <= 0 ? "." : filePath.slice(0, idx);
|
|
@@ -43219,7 +43241,7 @@ var init_file_observer = __esm(() => {
|
|
|
43219
43241
|
init_logger3();
|
|
43220
43242
|
});
|
|
43221
43243
|
|
|
43222
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43244
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
|
|
43223
43245
|
function settleWithin(promise2, deadline) {
|
|
43224
43246
|
const remaining = deadline - Date.now();
|
|
43225
43247
|
if (remaining <= 0)
|
|
@@ -43234,7 +43256,7 @@ function settleWithin(promise2, deadline) {
|
|
|
43234
43256
|
return settled;
|
|
43235
43257
|
}
|
|
43236
43258
|
|
|
43237
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43259
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
|
|
43238
43260
|
function parseInterval(cron) {
|
|
43239
43261
|
const trimmed = cron.trim();
|
|
43240
43262
|
const num = Number(trimmed);
|
|
@@ -43327,7 +43349,7 @@ var init_node3 = __esm(() => {
|
|
|
43327
43349
|
init_metrics();
|
|
43328
43350
|
});
|
|
43329
43351
|
|
|
43330
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43352
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
|
|
43331
43353
|
var exports_scheduler_node = {};
|
|
43332
43354
|
__export(exports_scheduler_node, {
|
|
43333
43355
|
NodeSchedulerAdapter: () => NodeSchedulerAdapter
|
|
@@ -50131,6 +50153,12 @@ class WorkflowRunLogSink {
|
|
|
50131
50153
|
=== run ${event.outcome} (exit ${event.exitCode}) after ${event.durationMs}ms ===
|
|
50132
50154
|
`);
|
|
50133
50155
|
break;
|
|
50156
|
+
case "heartbeat": {
|
|
50157
|
+
const timeout = event.timeoutMs !== undefined ? ` timeoutMs=${event.timeoutMs}` : "";
|
|
50158
|
+
this.append(`[${event.at}] agent.run progress: elapsed=${event.elapsedMs}ms${timeout}
|
|
50159
|
+
`);
|
|
50160
|
+
break;
|
|
50161
|
+
}
|
|
50134
50162
|
default:
|
|
50135
50163
|
break;
|
|
50136
50164
|
}
|
|
@@ -51467,7 +51495,7 @@ var init_drizzle_zod = __esm(() => {
|
|
|
51467
51495
|
};
|
|
51468
51496
|
});
|
|
51469
51497
|
|
|
51470
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
51498
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
|
|
51471
51499
|
function sqlExpressionToText(value) {
|
|
51472
51500
|
if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
|
|
51473
51501
|
return;
|
|
@@ -51490,7 +51518,7 @@ function getDrizzleTableName(table3) {
|
|
|
51490
51518
|
return String(table3[nameSym]);
|
|
51491
51519
|
}
|
|
51492
51520
|
|
|
51493
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
51521
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
|
|
51494
51522
|
function quoteIdent(name) {
|
|
51495
51523
|
return `"${name.replace(/"/g, '""')}"`;
|
|
51496
51524
|
}
|
|
@@ -51584,7 +51612,7 @@ var init_ddl = __esm(() => {
|
|
|
51584
51612
|
init_sqlite_core();
|
|
51585
51613
|
});
|
|
51586
51614
|
|
|
51587
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
51615
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
|
|
51588
51616
|
function defineTable(name, columns2) {
|
|
51589
51617
|
const table3 = sqliteTable(name, columns2);
|
|
51590
51618
|
let insert2;
|
|
@@ -51618,7 +51646,7 @@ var init_define_table = __esm(() => {
|
|
|
51618
51646
|
init_ddl();
|
|
51619
51647
|
});
|
|
51620
51648
|
|
|
51621
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
51649
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.22+ba90974056df6a6a/node_modules/@gobing-ai/ts-db/dist/schema/index.js
|
|
51622
51650
|
var init_schema = __esm(() => {
|
|
51623
51651
|
init_sqlite_core();
|
|
51624
51652
|
init_define_table();
|
|
@@ -52243,7 +52271,7 @@ var init_dao = __esm(() => {
|
|
|
52243
52271
|
init_workspace_dao();
|
|
52244
52272
|
});
|
|
52245
52273
|
|
|
52246
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
52274
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
|
|
52247
52275
|
var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
|
|
52248
52276
|
var init_errors6 = __esm(() => {
|
|
52249
52277
|
WorkflowValidationError = class WorkflowValidationError extends Error {
|
|
@@ -52278,12 +52306,12 @@ var init_errors6 = __esm(() => {
|
|
|
52278
52306
|
};
|
|
52279
52307
|
});
|
|
52280
52308
|
|
|
52281
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
52309
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
|
|
52282
52310
|
var init_event_bus2 = __esm(() => {
|
|
52283
52311
|
init_event_bus();
|
|
52284
52312
|
});
|
|
52285
52313
|
|
|
52286
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
52314
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/api-client.js
|
|
52287
52315
|
function sanitizeUrlForObservability(url2) {
|
|
52288
52316
|
try {
|
|
52289
52317
|
const parsed = new URL(url2);
|
|
@@ -52513,12 +52541,12 @@ var init_api_client = __esm(() => {
|
|
|
52513
52541
|
};
|
|
52514
52542
|
});
|
|
52515
52543
|
|
|
52516
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
52544
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
|
|
52517
52545
|
var init_telemetry = __esm(() => {
|
|
52518
52546
|
init_tracing2();
|
|
52519
52547
|
});
|
|
52520
52548
|
|
|
52521
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
52549
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/index.js
|
|
52522
52550
|
var init_dist6 = __esm(() => {
|
|
52523
52551
|
init_api_client();
|
|
52524
52552
|
init_event_bus2();
|
|
@@ -52526,7 +52554,7 @@ var init_dist6 = __esm(() => {
|
|
|
52526
52554
|
init_telemetry();
|
|
52527
52555
|
});
|
|
52528
52556
|
|
|
52529
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
52557
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
|
|
52530
52558
|
function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
|
|
52531
52559
|
return {
|
|
52532
52560
|
workflow: workflowName,
|
|
@@ -52785,7 +52813,7 @@ var init_run_lifecycle = __esm(() => {
|
|
|
52785
52813
|
];
|
|
52786
52814
|
});
|
|
52787
52815
|
|
|
52788
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
52816
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
|
|
52789
52817
|
var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
|
|
52790
52818
|
var init_schema2 = __esm(() => {
|
|
52791
52819
|
init_zod();
|
|
@@ -52870,7 +52898,7 @@ var init_schema2 = __esm(() => {
|
|
|
52870
52898
|
WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
|
|
52871
52899
|
});
|
|
52872
52900
|
|
|
52873
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
52901
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
|
|
52874
52902
|
async function loadWorkflowDef(path9, options = {}) {
|
|
52875
52903
|
return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
|
|
52876
52904
|
}
|
|
@@ -53037,7 +53065,7 @@ var init_config4 = __esm(() => {
|
|
|
53037
53065
|
RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
|
|
53038
53066
|
});
|
|
53039
53067
|
|
|
53040
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
53068
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
|
|
53041
53069
|
class CapabilityRegistry {
|
|
53042
53070
|
kind;
|
|
53043
53071
|
capabilities = new Map;
|
|
@@ -53068,7 +53096,7 @@ class CapabilityRegistry {
|
|
|
53068
53096
|
}
|
|
53069
53097
|
}
|
|
53070
53098
|
|
|
53071
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
53099
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
|
|
53072
53100
|
function assertRelativeExtensionPath(path9, options = {}) {
|
|
53073
53101
|
const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
|
|
53074
53102
|
if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
|
|
@@ -53079,20 +53107,20 @@ function assertRelativeExtensionPath(path9, options = {}) {
|
|
|
53079
53107
|
}
|
|
53080
53108
|
}
|
|
53081
53109
|
|
|
53082
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
53110
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
|
|
53083
53111
|
var init_extension_loader = () => {};
|
|
53084
53112
|
|
|
53085
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
53113
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
|
|
53086
53114
|
var init_extension = __esm(() => {
|
|
53087
53115
|
init_extension_loader();
|
|
53088
53116
|
});
|
|
53089
53117
|
|
|
53090
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
53118
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.22+b5a3efec10d9c5ce/node_modules/@gobing-ai/ts-runtime/dist/extension.js
|
|
53091
53119
|
var init_extension2 = __esm(() => {
|
|
53092
53120
|
init_extension();
|
|
53093
53121
|
});
|
|
53094
53122
|
|
|
53095
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53123
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
|
|
53096
53124
|
class WorkflowEngineHost {
|
|
53097
53125
|
lifecycleBus;
|
|
53098
53126
|
actions = new CapabilityRegistry("workflow action");
|
|
@@ -53261,7 +53289,7 @@ var init_host = __esm(() => {
|
|
|
53261
53289
|
init_errors6();
|
|
53262
53290
|
});
|
|
53263
53291
|
|
|
53264
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53292
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
|
|
53265
53293
|
var WORKFLOW_ENGINE_SCHEMA_SQL;
|
|
53266
53294
|
var init_schema_sql = __esm(() => {
|
|
53267
53295
|
WORKFLOW_ENGINE_SCHEMA_SQL = `
|
|
@@ -53334,7 +53362,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
|
|
|
53334
53362
|
`.trim();
|
|
53335
53363
|
});
|
|
53336
53364
|
|
|
53337
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53365
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
|
|
53338
53366
|
async function applyWorkflowEngineSchema(db2) {
|
|
53339
53367
|
for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
|
|
53340
53368
|
const sql4 = statement.trim();
|
|
@@ -53623,7 +53651,7 @@ var init_persistence = __esm(() => {
|
|
|
53623
53651
|
init_schema_sql();
|
|
53624
53652
|
});
|
|
53625
53653
|
|
|
53626
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53654
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
|
|
53627
53655
|
function mergeVars(workflowVars = {}, overrideVars = {}) {
|
|
53628
53656
|
return { ...workflowVars, ...overrideVars };
|
|
53629
53657
|
}
|
|
@@ -53683,7 +53711,7 @@ var init_variables = __esm(() => {
|
|
|
53683
53711
|
TEMPLATE_REF = /\$\{([^}]+)\}/g;
|
|
53684
53712
|
});
|
|
53685
53713
|
|
|
53686
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53714
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
|
|
53687
53715
|
async function runActionStep(action, vars, deps) {
|
|
53688
53716
|
const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
|
|
53689
53717
|
const resolved = resolveTemplates(action.options ?? {}, {
|
|
@@ -53741,7 +53769,7 @@ var init_action_step = __esm(() => {
|
|
|
53741
53769
|
init_variables();
|
|
53742
53770
|
});
|
|
53743
53771
|
|
|
53744
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53772
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
|
|
53745
53773
|
class StateMachineDriver {
|
|
53746
53774
|
options;
|
|
53747
53775
|
constructor(options) {
|
|
@@ -53877,7 +53905,7 @@ var init_state_machine = __esm(() => {
|
|
|
53877
53905
|
EMPTY_OUTCOME = { outcome: "completed", result: undefined };
|
|
53878
53906
|
});
|
|
53879
53907
|
|
|
53880
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
53908
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
|
|
53881
53909
|
class TransitionFlowDriver {
|
|
53882
53910
|
options;
|
|
53883
53911
|
constructor(options) {
|
|
@@ -53996,7 +54024,7 @@ var init_transition_flow = __esm(() => {
|
|
|
53996
54024
|
init_variables();
|
|
53997
54025
|
});
|
|
53998
54026
|
|
|
53999
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
54027
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
|
|
54000
54028
|
class WorkflowService {
|
|
54001
54029
|
host;
|
|
54002
54030
|
persistence;
|
|
@@ -54213,7 +54241,7 @@ var init_service = __esm(() => {
|
|
|
54213
54241
|
init_variables();
|
|
54214
54242
|
});
|
|
54215
54243
|
|
|
54216
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
54244
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
|
|
54217
54245
|
var init_dist7 = __esm(() => {
|
|
54218
54246
|
init_config4();
|
|
54219
54247
|
init_host();
|
|
@@ -54222,7 +54250,7 @@ var init_dist7 = __esm(() => {
|
|
|
54222
54250
|
init_service();
|
|
54223
54251
|
});
|
|
54224
54252
|
|
|
54225
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
54253
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
|
|
54226
54254
|
import { createHash } from "crypto";
|
|
54227
54255
|
function stableJson(value) {
|
|
54228
54256
|
if (Array.isArray(value)) {
|
|
@@ -54239,7 +54267,7 @@ function sha256(value) {
|
|
|
54239
54267
|
}
|
|
54240
54268
|
var init_hash = () => {};
|
|
54241
54269
|
|
|
54242
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
54270
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
|
|
54243
54271
|
var HistoryImportError;
|
|
54244
54272
|
var init_errors7 = __esm(() => {
|
|
54245
54273
|
HistoryImportError = class HistoryImportError extends Error {
|
|
@@ -54252,7 +54280,7 @@ var init_errors7 = __esm(() => {
|
|
|
54252
54280
|
};
|
|
54253
54281
|
});
|
|
54254
54282
|
|
|
54255
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
54283
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
|
|
54256
54284
|
var HISTORY_IMPORT_SCHEMA_SQL;
|
|
54257
54285
|
var init_schema_sql2 = __esm(() => {
|
|
54258
54286
|
HISTORY_IMPORT_SCHEMA_SQL = `
|
|
@@ -54336,10 +54364,1000 @@ CREATE TABLE IF NOT EXISTS history_etl_openclaw (
|
|
|
54336
54364
|
payload_json TEXT NOT NULL,
|
|
54337
54365
|
imported_at TEXT NOT NULL
|
|
54338
54366
|
);
|
|
54367
|
+
|
|
54368
|
+
CREATE TABLE IF NOT EXISTS history_message (
|
|
54369
|
+
record_hash TEXT PRIMARY KEY,
|
|
54370
|
+
source TEXT NOT NULL,
|
|
54371
|
+
source_file TEXT NOT NULL,
|
|
54372
|
+
source_line INTEGER NOT NULL,
|
|
54373
|
+
session_id TEXT NOT NULL,
|
|
54374
|
+
seq INTEGER NOT NULL,
|
|
54375
|
+
turn_index INTEGER,
|
|
54376
|
+
role TEXT NOT NULL,
|
|
54377
|
+
record_type TEXT NOT NULL,
|
|
54378
|
+
disposition TEXT NOT NULL,
|
|
54379
|
+
ts TEXT NOT NULL,
|
|
54380
|
+
duration_ms INTEGER,
|
|
54381
|
+
model TEXT,
|
|
54382
|
+
input_tokens INTEGER,
|
|
54383
|
+
output_tokens INTEGER,
|
|
54384
|
+
cache_read_tokens INTEGER,
|
|
54385
|
+
cache_write_tokens INTEGER,
|
|
54386
|
+
cost_usd REAL,
|
|
54387
|
+
content_text TEXT,
|
|
54388
|
+
cwd TEXT,
|
|
54389
|
+
provenance TEXT NOT NULL,
|
|
54390
|
+
run_id TEXT,
|
|
54391
|
+
task_wbs TEXT,
|
|
54392
|
+
imported_at TEXT NOT NULL
|
|
54393
|
+
);
|
|
54394
|
+
|
|
54395
|
+
CREATE TABLE IF NOT EXISTS history_tool_call (
|
|
54396
|
+
record_hash TEXT PRIMARY KEY,
|
|
54397
|
+
message_hash TEXT NOT NULL,
|
|
54398
|
+
source TEXT NOT NULL,
|
|
54399
|
+
source_file TEXT NOT NULL,
|
|
54400
|
+
source_line INTEGER NOT NULL,
|
|
54401
|
+
session_id TEXT NOT NULL,
|
|
54402
|
+
seq INTEGER NOT NULL,
|
|
54403
|
+
tool_name TEXT NOT NULL,
|
|
54404
|
+
args_digest TEXT,
|
|
54405
|
+
status TEXT NOT NULL,
|
|
54406
|
+
started_at TEXT,
|
|
54407
|
+
completed_at TEXT,
|
|
54408
|
+
duration_ms INTEGER,
|
|
54409
|
+
result_bytes INTEGER,
|
|
54410
|
+
error_text TEXT,
|
|
54411
|
+
imported_at TEXT NOT NULL
|
|
54412
|
+
);
|
|
54413
|
+
|
|
54414
|
+
CREATE INDEX IF NOT EXISTS idx_history_message_session
|
|
54415
|
+
ON history_message(source, session_id, seq);
|
|
54416
|
+
CREATE INDEX IF NOT EXISTS idx_history_message_ts
|
|
54417
|
+
ON history_message(ts);
|
|
54418
|
+
CREATE INDEX IF NOT EXISTS idx_history_tool_call_session
|
|
54419
|
+
ON history_tool_call(source, session_id, seq);
|
|
54420
|
+
CREATE INDEX IF NOT EXISTS idx_history_tool_call_tool_name
|
|
54421
|
+
ON history_tool_call(tool_name);
|
|
54422
|
+
CREATE INDEX IF NOT EXISTS idx_history_tool_call_message_hash
|
|
54423
|
+
ON history_tool_call(message_hash);
|
|
54339
54424
|
`.trim();
|
|
54340
54425
|
});
|
|
54341
54426
|
|
|
54342
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
54427
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
|
|
54428
|
+
function identityFieldMap(keys) {
|
|
54429
|
+
const map2 = {};
|
|
54430
|
+
for (const key of keys) {
|
|
54431
|
+
map2[key] = key;
|
|
54432
|
+
}
|
|
54433
|
+
return map2;
|
|
54434
|
+
}
|
|
54435
|
+
function detectProvenance(cwd) {
|
|
54436
|
+
if (cwd === undefined)
|
|
54437
|
+
return "ambient";
|
|
54438
|
+
return cwd.includes("/spur") || cwd.includes("/spur-new") ? "spur-run" : "ambient";
|
|
54439
|
+
}
|
|
54440
|
+
function argsDigest(args) {
|
|
54441
|
+
const redacted = redactArgs(args);
|
|
54442
|
+
return sha256(redacted);
|
|
54443
|
+
}
|
|
54444
|
+
function redactArgs(args) {
|
|
54445
|
+
if (typeof args === "string") {
|
|
54446
|
+
if (args.length > 80)
|
|
54447
|
+
return "[REDACTED:long]";
|
|
54448
|
+
if (/[A-Za-z0-9+/]{40,}=*|[A-Za-z0-9_-]{20,}/.test(args))
|
|
54449
|
+
return "[REDACTED:secret]";
|
|
54450
|
+
return args;
|
|
54451
|
+
}
|
|
54452
|
+
if (Array.isArray(args))
|
|
54453
|
+
return args.map(redactArgs);
|
|
54454
|
+
if (args !== null && typeof args === "object") {
|
|
54455
|
+
const result = {};
|
|
54456
|
+
for (const [key, value] of Object.entries(args)) {
|
|
54457
|
+
result[key] = redactArgs(value);
|
|
54458
|
+
}
|
|
54459
|
+
return result;
|
|
54460
|
+
}
|
|
54461
|
+
return args;
|
|
54462
|
+
}
|
|
54463
|
+
function claudeSplit(raw) {
|
|
54464
|
+
const entries = [];
|
|
54465
|
+
const sessionId = s(raw.sessionId, raw.conversation_uuid) ?? "unknown";
|
|
54466
|
+
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.messageIndex === "number" ? raw.messageIndex : 0;
|
|
54467
|
+
const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
|
|
54468
|
+
const role = mapRole(raw.type ?? raw.role);
|
|
54469
|
+
const recordType = String(raw.type ?? "");
|
|
54470
|
+
const model = s(raw.model);
|
|
54471
|
+
const cwd = s(raw.cwd, raw.dir);
|
|
54472
|
+
if (raw.subtype === "turn_duration" && typeof raw.durationMs === "number") {
|
|
54473
|
+
entries.push({
|
|
54474
|
+
targetTable: "history_message",
|
|
54475
|
+
record: {
|
|
54476
|
+
session_id: sessionId,
|
|
54477
|
+
seq,
|
|
54478
|
+
role: "system",
|
|
54479
|
+
record_type: "turn_duration",
|
|
54480
|
+
disposition: "meta",
|
|
54481
|
+
ts,
|
|
54482
|
+
duration_ms: raw.durationMs,
|
|
54483
|
+
content_text: null,
|
|
54484
|
+
provenance: detectProvenance(cwd)
|
|
54485
|
+
}
|
|
54486
|
+
});
|
|
54487
|
+
return entries;
|
|
54488
|
+
}
|
|
54489
|
+
if (recordType === "attachment" || recordType.startsWith("file-history")) {
|
|
54490
|
+
entries.push({
|
|
54491
|
+
targetTable: "history_message",
|
|
54492
|
+
record: {
|
|
54493
|
+
session_id: sessionId,
|
|
54494
|
+
seq,
|
|
54495
|
+
role: "meta",
|
|
54496
|
+
record_type: recordType,
|
|
54497
|
+
disposition: "meta",
|
|
54498
|
+
ts,
|
|
54499
|
+
provenance: detectProvenance(cwd)
|
|
54500
|
+
}
|
|
54501
|
+
});
|
|
54502
|
+
return entries;
|
|
54503
|
+
}
|
|
54504
|
+
const hasUsage = typeof raw.usage === "object" && raw.usage !== null;
|
|
54505
|
+
const usage = hasUsage ? raw.usage : undefined;
|
|
54506
|
+
const inputTokens = typeof raw.inputTokens === "number" ? raw.inputTokens : undefined;
|
|
54507
|
+
const outputTokens = typeof raw.outputTokens === "number" ? raw.outputTokens : undefined;
|
|
54508
|
+
const cacheRead = usage?.cacheReadTokens ?? usage?.cache_read_tokens ?? undefined;
|
|
54509
|
+
const cacheWrite = usage?.cacheWriteTokens ?? usage?.cache_write_tokens ?? undefined;
|
|
54510
|
+
const costUsd = computeCost(inputTokens, outputTokens, model);
|
|
54511
|
+
const contentBlocks = raw.content;
|
|
54512
|
+
const contentText = extractContentText(contentBlocks);
|
|
54513
|
+
const messageSplitIndex = entries.length;
|
|
54514
|
+
entries.push({
|
|
54515
|
+
targetTable: "history_message",
|
|
54516
|
+
record: {
|
|
54517
|
+
session_id: sessionId,
|
|
54518
|
+
seq,
|
|
54519
|
+
turn_index: typeof raw.turnIndex === "number" ? raw.turnIndex : undefined,
|
|
54520
|
+
role,
|
|
54521
|
+
record_type: recordType,
|
|
54522
|
+
disposition: "keep",
|
|
54523
|
+
ts,
|
|
54524
|
+
duration_ms: undefined,
|
|
54525
|
+
model: model ?? null,
|
|
54526
|
+
input_tokens: inputTokens ?? null,
|
|
54527
|
+
output_tokens: outputTokens ?? null,
|
|
54528
|
+
cache_read_tokens: cacheRead ?? null,
|
|
54529
|
+
cache_write_tokens: cacheWrite ?? null,
|
|
54530
|
+
cost_usd: costUsd ?? null,
|
|
54531
|
+
content_text: contentText ?? null,
|
|
54532
|
+
cwd: cwd ?? null,
|
|
54533
|
+
provenance: detectProvenance(cwd)
|
|
54534
|
+
}
|
|
54535
|
+
});
|
|
54536
|
+
if (Array.isArray(contentBlocks) && role === "assistant") {
|
|
54537
|
+
for (const block of contentBlocks) {
|
|
54538
|
+
if (typeof block !== "object" || block === null)
|
|
54539
|
+
continue;
|
|
54540
|
+
const b = block;
|
|
54541
|
+
if (b.type === "tool_use") {
|
|
54542
|
+
entries.push({
|
|
54543
|
+
targetTable: "history_tool_call",
|
|
54544
|
+
record: {
|
|
54545
|
+
_messageSplitIndex: messageSplitIndex,
|
|
54546
|
+
session_id: sessionId,
|
|
54547
|
+
seq,
|
|
54548
|
+
tool_name: String(b.name ?? ""),
|
|
54549
|
+
args_digest: argsDigest(b.input),
|
|
54550
|
+
status: "ok",
|
|
54551
|
+
started_at: undefined,
|
|
54552
|
+
completed_at: undefined,
|
|
54553
|
+
duration_ms: undefined,
|
|
54554
|
+
result_bytes: undefined,
|
|
54555
|
+
error_text: undefined
|
|
54556
|
+
}
|
|
54557
|
+
});
|
|
54558
|
+
}
|
|
54559
|
+
}
|
|
54560
|
+
}
|
|
54561
|
+
return entries;
|
|
54562
|
+
}
|
|
54563
|
+
function piSplit(raw) {
|
|
54564
|
+
const entries = [];
|
|
54565
|
+
const r = raw;
|
|
54566
|
+
const sessionId = s(r.id, o2(r.session).id) ?? "unknown";
|
|
54567
|
+
const seq = typeof r.seq === "number" ? r.seq : 0;
|
|
54568
|
+
const ts = s(r.ts, r.timestamp, r.createdAt) ?? new Date(0).toISOString();
|
|
54569
|
+
const role = mapRole(r.type ?? r.role);
|
|
54570
|
+
const recordType = String(r.type ?? "");
|
|
54571
|
+
const model = s(r.model, o2(r.message).model);
|
|
54572
|
+
const cwd = s(r.cwd, r.dir);
|
|
54573
|
+
const msg = r.message;
|
|
54574
|
+
const usage = msg?.usage;
|
|
54575
|
+
const inputTokens = usage?.input ?? usage?.input_tokens ?? undefined;
|
|
54576
|
+
const outputTokens = usage?.output ?? usage?.output_tokens ?? undefined;
|
|
54577
|
+
const cacheRead = usage?.cacheRead ?? usage?.cache_read_tokens ?? undefined;
|
|
54578
|
+
const cacheWrite = usage?.cacheWrite ?? usage?.cache_write_tokens ?? undefined;
|
|
54579
|
+
const costObj = msg?.cost ?? r.cost;
|
|
54580
|
+
const costUsd = typeof costObj?.total === "number" ? costObj.total : computeCost(inputTokens, outputTokens, model);
|
|
54581
|
+
const messageSplitIndex = entries.length;
|
|
54582
|
+
entries.push({
|
|
54583
|
+
targetTable: "history_message",
|
|
54584
|
+
record: {
|
|
54585
|
+
session_id: sessionId,
|
|
54586
|
+
seq,
|
|
54587
|
+
role,
|
|
54588
|
+
record_type: recordType,
|
|
54589
|
+
disposition: "keep",
|
|
54590
|
+
ts,
|
|
54591
|
+
duration_ms: undefined,
|
|
54592
|
+
model: model ?? null,
|
|
54593
|
+
input_tokens: inputTokens ?? null,
|
|
54594
|
+
output_tokens: outputTokens ?? null,
|
|
54595
|
+
cache_read_tokens: cacheRead ?? null,
|
|
54596
|
+
cache_write_tokens: cacheWrite ?? null,
|
|
54597
|
+
cost_usd: costUsd ?? null,
|
|
54598
|
+
content_text: s(r.content, r.text, msg?.content) ?? null,
|
|
54599
|
+
cwd: cwd ?? null,
|
|
54600
|
+
provenance: detectProvenance(cwd)
|
|
54601
|
+
}
|
|
54602
|
+
});
|
|
54603
|
+
if (Array.isArray(r.content) && role === "assistant") {
|
|
54604
|
+
for (const block of r.content) {
|
|
54605
|
+
if (block?.toolCall) {
|
|
54606
|
+
const tc = block.toolCall;
|
|
54607
|
+
entries.push({
|
|
54608
|
+
targetTable: "history_tool_call",
|
|
54609
|
+
record: {
|
|
54610
|
+
_messageSplitIndex: messageSplitIndex,
|
|
54611
|
+
session_id: sessionId,
|
|
54612
|
+
seq,
|
|
54613
|
+
tool_name: String(tc.name ?? ""),
|
|
54614
|
+
args_digest: argsDigest(tc.input ?? tc.arguments),
|
|
54615
|
+
status: "ok",
|
|
54616
|
+
started_at: undefined,
|
|
54617
|
+
completed_at: undefined,
|
|
54618
|
+
duration_ms: undefined,
|
|
54619
|
+
result_bytes: undefined,
|
|
54620
|
+
error_text: undefined
|
|
54621
|
+
}
|
|
54622
|
+
});
|
|
54623
|
+
}
|
|
54624
|
+
}
|
|
54625
|
+
}
|
|
54626
|
+
return entries;
|
|
54627
|
+
}
|
|
54628
|
+
function ompSplit(raw) {
|
|
54629
|
+
const recordType = String(raw.type ?? "");
|
|
54630
|
+
if (recordType === "title" || recordType === "title_change" || recordType === "service_tier_change" || recordType === "ttsr_injection" || recordType === "session_init" || recordType === "compaction") {
|
|
54631
|
+
return [
|
|
54632
|
+
{
|
|
54633
|
+
targetTable: "history_message",
|
|
54634
|
+
record: {
|
|
54635
|
+
session_id: s(raw.id, o2(raw.session).id) ?? "unknown",
|
|
54636
|
+
seq: typeof raw.seq === "number" ? raw.seq : 0,
|
|
54637
|
+
role: "meta",
|
|
54638
|
+
record_type: recordType,
|
|
54639
|
+
disposition: "meta",
|
|
54640
|
+
ts: s(raw.ts, raw.timestamp) ?? new Date(0).toISOString(),
|
|
54641
|
+
provenance: "ambient"
|
|
54642
|
+
}
|
|
54643
|
+
}
|
|
54644
|
+
];
|
|
54645
|
+
}
|
|
54646
|
+
const entries = [];
|
|
54647
|
+
const sessionId = s(raw.id, o2(raw.session).id) ?? "unknown";
|
|
54648
|
+
const seq = typeof raw.seq === "number" ? raw.seq : 0;
|
|
54649
|
+
const ts = s(raw.ts, raw.timestamp, raw.createdAt) ?? new Date(0).toISOString();
|
|
54650
|
+
const role = mapRole(raw.type ?? raw.role);
|
|
54651
|
+
const model = s(raw.model, o2(raw.message).model);
|
|
54652
|
+
const cwd = s(raw.cwd, raw.dir);
|
|
54653
|
+
const msg = raw.message;
|
|
54654
|
+
const usage = msg?.usage;
|
|
54655
|
+
const inputTokens = usage?.input ?? usage?.input_tokens ?? undefined;
|
|
54656
|
+
const outputTokens = usage?.output ?? usage?.output_tokens ?? undefined;
|
|
54657
|
+
const cacheRead = usage?.cacheRead ?? usage?.cache_read_tokens ?? undefined;
|
|
54658
|
+
const cacheWrite = usage?.cacheWrite ?? usage?.cache_write_tokens ?? undefined;
|
|
54659
|
+
const costObj = msg?.cost ?? raw.cost;
|
|
54660
|
+
const costUsd = typeof costObj?.total === "number" ? costObj.total : computeCost(inputTokens, outputTokens, model);
|
|
54661
|
+
const messageSplitIndex = entries.length;
|
|
54662
|
+
entries.push({
|
|
54663
|
+
targetTable: "history_message",
|
|
54664
|
+
record: {
|
|
54665
|
+
session_id: sessionId,
|
|
54666
|
+
seq,
|
|
54667
|
+
role,
|
|
54668
|
+
record_type: recordType,
|
|
54669
|
+
disposition: "keep",
|
|
54670
|
+
ts,
|
|
54671
|
+
duration_ms: undefined,
|
|
54672
|
+
model: model ?? null,
|
|
54673
|
+
input_tokens: inputTokens ?? null,
|
|
54674
|
+
output_tokens: outputTokens ?? null,
|
|
54675
|
+
cache_read_tokens: cacheRead ?? null,
|
|
54676
|
+
cache_write_tokens: cacheWrite ?? null,
|
|
54677
|
+
cost_usd: costUsd ?? null,
|
|
54678
|
+
content_text: s(raw.content, raw.text, msg?.content) ?? null,
|
|
54679
|
+
cwd: cwd ?? null,
|
|
54680
|
+
provenance: detectProvenance(cwd)
|
|
54681
|
+
}
|
|
54682
|
+
});
|
|
54683
|
+
if (Array.isArray(raw.content) && role === "assistant") {
|
|
54684
|
+
for (const block of raw.content) {
|
|
54685
|
+
if (block?.toolCall) {
|
|
54686
|
+
const tc = block.toolCall;
|
|
54687
|
+
entries.push({
|
|
54688
|
+
targetTable: "history_tool_call",
|
|
54689
|
+
record: {
|
|
54690
|
+
_messageSplitIndex: messageSplitIndex,
|
|
54691
|
+
session_id: sessionId,
|
|
54692
|
+
seq,
|
|
54693
|
+
tool_name: String(tc.name ?? ""),
|
|
54694
|
+
args_digest: argsDigest(tc.input ?? tc.arguments),
|
|
54695
|
+
status: "ok",
|
|
54696
|
+
started_at: undefined,
|
|
54697
|
+
completed_at: undefined,
|
|
54698
|
+
duration_ms: undefined,
|
|
54699
|
+
result_bytes: undefined,
|
|
54700
|
+
error_text: undefined
|
|
54701
|
+
}
|
|
54702
|
+
});
|
|
54703
|
+
}
|
|
54704
|
+
}
|
|
54705
|
+
}
|
|
54706
|
+
return entries;
|
|
54707
|
+
}
|
|
54708
|
+
function codexSplit(raw) {
|
|
54709
|
+
const entries = [];
|
|
54710
|
+
const payload = raw.payload ?? raw;
|
|
54711
|
+
const sessionId = s(raw.session_id, o2(raw.session_meta).id, raw.id) ?? "unknown";
|
|
54712
|
+
const seq = typeof raw.seq === "number" ? raw.seq : 0;
|
|
54713
|
+
const ts = s(raw.timestamp, raw.ts, payload.ts) ?? new Date(0).toISOString();
|
|
54714
|
+
const recordType = String(raw.type ?? "");
|
|
54715
|
+
if (recordType === "" && raw.id && raw.timestamp && raw.instructions) {
|
|
54716
|
+
return [
|
|
54717
|
+
{
|
|
54718
|
+
targetTable: "history_message",
|
|
54719
|
+
record: {
|
|
54720
|
+
session_id: sessionId,
|
|
54721
|
+
seq,
|
|
54722
|
+
role: "unknown",
|
|
54723
|
+
record_type: "short_format",
|
|
54724
|
+
disposition: "unknown",
|
|
54725
|
+
ts,
|
|
54726
|
+
provenance: "ambient"
|
|
54727
|
+
}
|
|
54728
|
+
}
|
|
54729
|
+
];
|
|
54730
|
+
}
|
|
54731
|
+
const role = mapRole(recordType);
|
|
54732
|
+
const model = s(raw.model, payload.model, o2(o2(raw.turn_context).payload).model);
|
|
54733
|
+
const cwd = s(raw.cwd, raw.dir);
|
|
54734
|
+
const tokenCount = payload.token_count;
|
|
54735
|
+
const inputTokens = tokenCount?.input ?? tokenCount?.input_tokens ?? undefined;
|
|
54736
|
+
const outputTokens = tokenCount?.output ?? tokenCount?.output_tokens ?? undefined;
|
|
54737
|
+
const turnCtx = raw.turn_context;
|
|
54738
|
+
const turnPayload = turnCtx?.payload;
|
|
54739
|
+
const turnInputTokens = turnPayload?.input_tokens;
|
|
54740
|
+
const turnOutputTokens = turnPayload?.output_tokens;
|
|
54741
|
+
const finalInput = inputTokens !== undefined ? inputTokens : turnInputTokens;
|
|
54742
|
+
const finalOutput = outputTokens !== undefined ? outputTokens : turnOutputTokens;
|
|
54743
|
+
const costUsd = computeCost(finalInput, finalOutput, model);
|
|
54744
|
+
const messageSplitIndex = entries.length;
|
|
54745
|
+
entries.push({
|
|
54746
|
+
targetTable: "history_message",
|
|
54747
|
+
record: {
|
|
54748
|
+
session_id: sessionId,
|
|
54749
|
+
seq,
|
|
54750
|
+
role,
|
|
54751
|
+
record_type: recordType,
|
|
54752
|
+
disposition: "keep",
|
|
54753
|
+
ts,
|
|
54754
|
+
duration_ms: undefined,
|
|
54755
|
+
model: model ?? null,
|
|
54756
|
+
input_tokens: finalInput ?? null,
|
|
54757
|
+
output_tokens: finalOutput ?? null,
|
|
54758
|
+
cache_read_tokens: null,
|
|
54759
|
+
cache_write_tokens: null,
|
|
54760
|
+
cost_usd: costUsd ?? null,
|
|
54761
|
+
content_text: s(payload.content, payload.text, raw.content, raw.text) ?? null,
|
|
54762
|
+
cwd: cwd ?? null,
|
|
54763
|
+
provenance: detectProvenance(cwd)
|
|
54764
|
+
}
|
|
54765
|
+
});
|
|
54766
|
+
const responseItems = payload.response_item ? [payload.response_item] : Array.isArray(payload.response_items) ? payload.response_items : [];
|
|
54767
|
+
for (const item of responseItems) {
|
|
54768
|
+
if (item.function_call) {
|
|
54769
|
+
const fc = item.function_call;
|
|
54770
|
+
entries.push({
|
|
54771
|
+
targetTable: "history_tool_call",
|
|
54772
|
+
record: {
|
|
54773
|
+
_messageSplitIndex: messageSplitIndex,
|
|
54774
|
+
session_id: sessionId,
|
|
54775
|
+
seq,
|
|
54776
|
+
tool_name: String(fc.name ?? ""),
|
|
54777
|
+
args_digest: argsDigest(fc.arguments),
|
|
54778
|
+
status: "ok",
|
|
54779
|
+
started_at: undefined,
|
|
54780
|
+
completed_at: undefined,
|
|
54781
|
+
duration_ms: undefined,
|
|
54782
|
+
result_bytes: undefined,
|
|
54783
|
+
error_text: undefined
|
|
54784
|
+
}
|
|
54785
|
+
});
|
|
54786
|
+
}
|
|
54787
|
+
}
|
|
54788
|
+
return entries;
|
|
54789
|
+
}
|
|
54790
|
+
function agySplit(raw) {
|
|
54791
|
+
const entries = [];
|
|
54792
|
+
const recordType = String(raw.type ?? "");
|
|
54793
|
+
const sessionId = s(raw.session_id, raw.conversation_id) ?? "unknown";
|
|
54794
|
+
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : 0;
|
|
54795
|
+
const ts = s(raw.created_at, raw.timestamp, raw.ts) ?? new Date(0).toISOString();
|
|
54796
|
+
let role;
|
|
54797
|
+
let disposition;
|
|
54798
|
+
let contentText = null;
|
|
54799
|
+
switch (recordType) {
|
|
54800
|
+
case "USER_INPUT":
|
|
54801
|
+
case "ASK_QUESTION":
|
|
54802
|
+
role = "user";
|
|
54803
|
+
disposition = "keep";
|
|
54804
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
54805
|
+
break;
|
|
54806
|
+
case "PLANNER_RESPONSE":
|
|
54807
|
+
role = "assistant";
|
|
54808
|
+
disposition = "keep";
|
|
54809
|
+
contentText = s(raw.content, raw.text, raw.message, raw.plan) ?? null;
|
|
54810
|
+
break;
|
|
54811
|
+
case "ERROR_MESSAGE":
|
|
54812
|
+
role = "system";
|
|
54813
|
+
disposition = "keep";
|
|
54814
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
54815
|
+
break;
|
|
54816
|
+
case "RUN_COMMAND":
|
|
54817
|
+
case "VIEW_FILE":
|
|
54818
|
+
case "GREP_SEARCH":
|
|
54819
|
+
case "LIST_DIRECTORY":
|
|
54820
|
+
case "READ_URL_CONTENT":
|
|
54821
|
+
role = "tool";
|
|
54822
|
+
disposition = "keep";
|
|
54823
|
+
contentText = s(raw.content, raw.command, raw.file_path, raw.pattern) ?? null;
|
|
54824
|
+
break;
|
|
54825
|
+
case "CODE_ACTION":
|
|
54826
|
+
case "INVOKE_SUBAGENT":
|
|
54827
|
+
role = "tool";
|
|
54828
|
+
disposition = "keep";
|
|
54829
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
54830
|
+
break;
|
|
54831
|
+
case "CONVERSATION_HISTORY":
|
|
54832
|
+
case "CHECKPOINT":
|
|
54833
|
+
case "GENERIC":
|
|
54834
|
+
role = "meta";
|
|
54835
|
+
disposition = "meta";
|
|
54836
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
54837
|
+
break;
|
|
54838
|
+
default:
|
|
54839
|
+
if (recordType.length === 0) {
|
|
54840
|
+
role = "unknown";
|
|
54841
|
+
disposition = "unknown";
|
|
54842
|
+
} else {
|
|
54843
|
+
role = "meta";
|
|
54844
|
+
disposition = "meta";
|
|
54845
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
54846
|
+
}
|
|
54847
|
+
break;
|
|
54848
|
+
}
|
|
54849
|
+
const messageSplitIndex = entries.length;
|
|
54850
|
+
entries.push({
|
|
54851
|
+
targetTable: "history_message",
|
|
54852
|
+
record: {
|
|
54853
|
+
session_id: sessionId,
|
|
54854
|
+
seq,
|
|
54855
|
+
role,
|
|
54856
|
+
record_type: recordType,
|
|
54857
|
+
disposition,
|
|
54858
|
+
ts,
|
|
54859
|
+
duration_ms: undefined,
|
|
54860
|
+
model: null,
|
|
54861
|
+
input_tokens: null,
|
|
54862
|
+
output_tokens: null,
|
|
54863
|
+
cache_read_tokens: null,
|
|
54864
|
+
cache_write_tokens: null,
|
|
54865
|
+
cost_usd: null,
|
|
54866
|
+
content_text: contentText,
|
|
54867
|
+
cwd: null,
|
|
54868
|
+
provenance: "ambient"
|
|
54869
|
+
}
|
|
54870
|
+
});
|
|
54871
|
+
if (recordType === "PLANNER_RESPONSE" && Array.isArray(raw.tool_calls)) {
|
|
54872
|
+
for (const tc of raw.tool_calls) {
|
|
54873
|
+
entries.push({
|
|
54874
|
+
targetTable: "history_tool_call",
|
|
54875
|
+
record: {
|
|
54876
|
+
_messageSplitIndex: messageSplitIndex,
|
|
54877
|
+
session_id: sessionId,
|
|
54878
|
+
seq: typeof tc.step_index === "number" ? tc.step_index : seq,
|
|
54879
|
+
tool_name: String(tc.name ?? tc.tool_name ?? ""),
|
|
54880
|
+
args_digest: argsDigest(tc.input ?? tc.arguments),
|
|
54881
|
+
status: "ok",
|
|
54882
|
+
started_at: undefined,
|
|
54883
|
+
completed_at: undefined,
|
|
54884
|
+
duration_ms: undefined,
|
|
54885
|
+
result_bytes: undefined,
|
|
54886
|
+
error_text: undefined
|
|
54887
|
+
}
|
|
54888
|
+
});
|
|
54889
|
+
}
|
|
54890
|
+
}
|
|
54891
|
+
return entries;
|
|
54892
|
+
}
|
|
54893
|
+
function normalizeGrokRecord(raw) {
|
|
54894
|
+
const params = raw.params;
|
|
54895
|
+
const update2 = params?.update;
|
|
54896
|
+
const isUpdatesShape = typeof raw.method === "string" && params !== undefined && update2 !== undefined;
|
|
54897
|
+
const body = isUpdatesShape ? update2 : raw;
|
|
54898
|
+
const recordType = String((isUpdatesShape ? update2?.sessionUpdate : raw.type) ?? raw.sessionUpdate ?? "");
|
|
54899
|
+
const sessionId = s(params?.sessionId, raw.session_id, raw.sessionId, raw.params?.sessionId) ?? "unknown";
|
|
54900
|
+
const ts = normalizeTs(raw.ts ?? raw.timestamp ?? body.ts ?? body.timestamp);
|
|
54901
|
+
const seq = typeof raw.seq === "number" ? raw.seq : typeof body.seq === "number" ? body.seq : 0;
|
|
54902
|
+
const meta3 = body._meta ?? params?._meta ?? raw._meta;
|
|
54903
|
+
const model = s(meta3?.modelId, body.model, raw.model);
|
|
54904
|
+
const contentText = extractGrokContent(body.content ?? body.text ?? raw.content ?? raw.text);
|
|
54905
|
+
const usage = body.usage ?? raw.usage;
|
|
54906
|
+
const toolMeta = meta3?.["x.ai/tool"];
|
|
54907
|
+
const toolName = s(body.title, body.tool_name, body.name, toolMeta?.name, toolMeta?.label, raw.tool_name, raw.name) ?? "";
|
|
54908
|
+
const toolArgs = body.rawInput ?? body.input ?? body.arguments ?? toolMeta?.input ?? raw.input ?? raw.arguments;
|
|
54909
|
+
const toolStatus = s(body.status, raw.outcome, raw.status) ?? "ok";
|
|
54910
|
+
const durationMs = typeof body.duration_ms === "number" ? body.duration_ms : typeof raw.duration_ms === "number" ? raw.duration_ms : typeof usage?.apiDurationMs === "number" ? usage.apiDurationMs : undefined;
|
|
54911
|
+
const errorText = body.error !== undefined ? String(body.error) : raw.error !== undefined ? String(raw.error) : undefined;
|
|
54912
|
+
const hasTypeDiscriminator = recordType.length > 0 || isUpdatesShape;
|
|
54913
|
+
return {
|
|
54914
|
+
recordType,
|
|
54915
|
+
sessionId,
|
|
54916
|
+
ts,
|
|
54917
|
+
seq,
|
|
54918
|
+
body,
|
|
54919
|
+
model,
|
|
54920
|
+
contentText,
|
|
54921
|
+
usage,
|
|
54922
|
+
toolName,
|
|
54923
|
+
toolArgs,
|
|
54924
|
+
toolStatus,
|
|
54925
|
+
durationMs,
|
|
54926
|
+
errorText,
|
|
54927
|
+
hasTypeDiscriminator
|
|
54928
|
+
};
|
|
54929
|
+
}
|
|
54930
|
+
function normalizeTs(value) {
|
|
54931
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
54932
|
+
const ms = value > 1000000000000 ? value : value * 1000;
|
|
54933
|
+
return new Date(ms).toISOString();
|
|
54934
|
+
}
|
|
54935
|
+
if (typeof value === "string" && value.length > 0) {
|
|
54936
|
+
const asNum = Number(value);
|
|
54937
|
+
if (Number.isFinite(asNum) && /^\d+(\.\d+)?$/.test(value.trim())) {
|
|
54938
|
+
const ms = asNum > 1000000000000 ? asNum : asNum * 1000;
|
|
54939
|
+
return new Date(ms).toISOString();
|
|
54940
|
+
}
|
|
54941
|
+
return value;
|
|
54942
|
+
}
|
|
54943
|
+
return new Date(0).toISOString();
|
|
54944
|
+
}
|
|
54945
|
+
function extractGrokContent(content) {
|
|
54946
|
+
if (typeof content === "string")
|
|
54947
|
+
return content;
|
|
54948
|
+
if (content !== null && typeof content === "object" && !Array.isArray(content)) {
|
|
54949
|
+
const c3 = content;
|
|
54950
|
+
if (typeof c3.text === "string")
|
|
54951
|
+
return c3.text;
|
|
54952
|
+
if (typeof c3.content === "string")
|
|
54953
|
+
return c3.content;
|
|
54954
|
+
}
|
|
54955
|
+
if (Array.isArray(content)) {
|
|
54956
|
+
const parts = [];
|
|
54957
|
+
for (const block of content) {
|
|
54958
|
+
if (typeof block === "string")
|
|
54959
|
+
parts.push(block);
|
|
54960
|
+
else if (block !== null && typeof block === "object") {
|
|
54961
|
+
const b = block;
|
|
54962
|
+
if (typeof b.text === "string")
|
|
54963
|
+
parts.push(b.text);
|
|
54964
|
+
}
|
|
54965
|
+
}
|
|
54966
|
+
return parts.length > 0 ? parts.join(`
|
|
54967
|
+
`) : null;
|
|
54968
|
+
}
|
|
54969
|
+
return null;
|
|
54970
|
+
}
|
|
54971
|
+
function grokSplit(raw) {
|
|
54972
|
+
const entries = [];
|
|
54973
|
+
const n2 = normalizeGrokRecord(raw);
|
|
54974
|
+
const { recordType, sessionId, ts, seq } = n2;
|
|
54975
|
+
if (recordType === "turn_completed") {
|
|
54976
|
+
const usage = n2.usage;
|
|
54977
|
+
const modelUsage = usage?.modelUsage;
|
|
54978
|
+
const modelFromUsage = modelUsage !== null && typeof modelUsage === "object" ? Object.keys(modelUsage)[0] : undefined;
|
|
54979
|
+
const model = s(n2.model, modelFromUsage);
|
|
54980
|
+
const inputTokens = usage?.inputTokens ?? usage?.input ?? usage?.input_tokens;
|
|
54981
|
+
const outputTokens = usage?.outputTokens ?? usage?.output ?? usage?.output_tokens;
|
|
54982
|
+
const cacheRead = usage?.cachedReadTokens ?? usage?.cache_read_tokens;
|
|
54983
|
+
entries.push({
|
|
54984
|
+
targetTable: "history_message",
|
|
54985
|
+
record: {
|
|
54986
|
+
session_id: sessionId,
|
|
54987
|
+
seq,
|
|
54988
|
+
role: "assistant",
|
|
54989
|
+
record_type: recordType,
|
|
54990
|
+
disposition: "keep",
|
|
54991
|
+
ts,
|
|
54992
|
+
duration_ms: n2.durationMs ?? null,
|
|
54993
|
+
model: model ?? null,
|
|
54994
|
+
input_tokens: inputTokens ?? null,
|
|
54995
|
+
output_tokens: outputTokens ?? null,
|
|
54996
|
+
cache_read_tokens: cacheRead ?? null,
|
|
54997
|
+
cache_write_tokens: null,
|
|
54998
|
+
cost_usd: null,
|
|
54999
|
+
content_text: n2.contentText,
|
|
55000
|
+
cwd: null,
|
|
55001
|
+
provenance: "ambient"
|
|
55002
|
+
}
|
|
55003
|
+
});
|
|
55004
|
+
return entries;
|
|
55005
|
+
}
|
|
55006
|
+
if (recordType === "tool_started") {
|
|
55007
|
+
const messageSplitIndex = 0;
|
|
55008
|
+
entries.push({
|
|
55009
|
+
targetTable: "history_message",
|
|
55010
|
+
record: {
|
|
55011
|
+
session_id: sessionId,
|
|
55012
|
+
seq,
|
|
55013
|
+
role: "assistant",
|
|
55014
|
+
record_type: recordType,
|
|
55015
|
+
disposition: "keep",
|
|
55016
|
+
ts,
|
|
55017
|
+
duration_ms: undefined,
|
|
55018
|
+
model: n2.model ?? null,
|
|
55019
|
+
input_tokens: null,
|
|
55020
|
+
output_tokens: null,
|
|
55021
|
+
cache_read_tokens: null,
|
|
55022
|
+
cache_write_tokens: null,
|
|
55023
|
+
cost_usd: null,
|
|
55024
|
+
content_text: n2.contentText,
|
|
55025
|
+
cwd: null,
|
|
55026
|
+
provenance: "ambient"
|
|
55027
|
+
}
|
|
55028
|
+
});
|
|
55029
|
+
entries.push({
|
|
55030
|
+
targetTable: "history_tool_call",
|
|
55031
|
+
record: {
|
|
55032
|
+
_messageSplitIndex: messageSplitIndex,
|
|
55033
|
+
session_id: sessionId,
|
|
55034
|
+
seq,
|
|
55035
|
+
tool_name: n2.toolName,
|
|
55036
|
+
args_digest: argsDigest(n2.toolArgs),
|
|
55037
|
+
status: n2.toolStatus || "ok",
|
|
55038
|
+
started_at: ts,
|
|
55039
|
+
completed_at: undefined,
|
|
55040
|
+
duration_ms: undefined,
|
|
55041
|
+
result_bytes: undefined,
|
|
55042
|
+
error_text: n2.errorText
|
|
55043
|
+
}
|
|
55044
|
+
});
|
|
55045
|
+
return entries;
|
|
55046
|
+
}
|
|
55047
|
+
if (recordType === "tool_completed") {
|
|
55048
|
+
entries.push({
|
|
55049
|
+
targetTable: "history_tool_call",
|
|
55050
|
+
record: {
|
|
55051
|
+
_messageSplitIndex: 0,
|
|
55052
|
+
session_id: sessionId,
|
|
55053
|
+
seq,
|
|
55054
|
+
tool_name: n2.toolName,
|
|
55055
|
+
args_digest: null,
|
|
55056
|
+
status: n2.toolStatus || "ok",
|
|
55057
|
+
started_at: undefined,
|
|
55058
|
+
completed_at: ts,
|
|
55059
|
+
duration_ms: n2.durationMs,
|
|
55060
|
+
result_bytes: undefined,
|
|
55061
|
+
error_text: n2.errorText
|
|
55062
|
+
}
|
|
55063
|
+
});
|
|
55064
|
+
return entries;
|
|
55065
|
+
}
|
|
55066
|
+
if (recordType === "tool_call" || recordType === "tool_call_update") {
|
|
55067
|
+
const messageSplitIndex = 0;
|
|
55068
|
+
entries.push({
|
|
55069
|
+
targetTable: "history_message",
|
|
55070
|
+
record: {
|
|
55071
|
+
session_id: sessionId,
|
|
55072
|
+
seq,
|
|
55073
|
+
role: "assistant",
|
|
55074
|
+
record_type: recordType,
|
|
55075
|
+
disposition: "keep",
|
|
55076
|
+
ts,
|
|
55077
|
+
duration_ms: undefined,
|
|
55078
|
+
model: n2.model ?? null,
|
|
55079
|
+
input_tokens: null,
|
|
55080
|
+
output_tokens: null,
|
|
55081
|
+
cache_read_tokens: null,
|
|
55082
|
+
cache_write_tokens: null,
|
|
55083
|
+
cost_usd: null,
|
|
55084
|
+
content_text: n2.contentText,
|
|
55085
|
+
cwd: null,
|
|
55086
|
+
provenance: "ambient"
|
|
55087
|
+
}
|
|
55088
|
+
});
|
|
55089
|
+
entries.push({
|
|
55090
|
+
targetTable: "history_tool_call",
|
|
55091
|
+
record: {
|
|
55092
|
+
_messageSplitIndex: messageSplitIndex,
|
|
55093
|
+
session_id: sessionId,
|
|
55094
|
+
seq,
|
|
55095
|
+
tool_name: n2.toolName,
|
|
55096
|
+
args_digest: argsDigest(n2.toolArgs),
|
|
55097
|
+
status: n2.toolStatus || "ok",
|
|
55098
|
+
started_at: recordType === "tool_call" ? ts : undefined,
|
|
55099
|
+
completed_at: recordType === "tool_call_update" ? ts : undefined,
|
|
55100
|
+
duration_ms: n2.durationMs,
|
|
55101
|
+
result_bytes: undefined,
|
|
55102
|
+
error_text: n2.errorText
|
|
55103
|
+
}
|
|
55104
|
+
});
|
|
55105
|
+
return entries;
|
|
55106
|
+
}
|
|
55107
|
+
if (recordType === "user" || recordType === "user_message" || recordType === "user_message_chunk" || recordType === "message") {
|
|
55108
|
+
entries.push({
|
|
55109
|
+
targetTable: "history_message",
|
|
55110
|
+
record: {
|
|
55111
|
+
session_id: sessionId,
|
|
55112
|
+
seq,
|
|
55113
|
+
role: "user",
|
|
55114
|
+
record_type: recordType || "user_message",
|
|
55115
|
+
disposition: "keep",
|
|
55116
|
+
ts,
|
|
55117
|
+
duration_ms: undefined,
|
|
55118
|
+
model: null,
|
|
55119
|
+
input_tokens: null,
|
|
55120
|
+
output_tokens: null,
|
|
55121
|
+
cache_read_tokens: null,
|
|
55122
|
+
cache_write_tokens: null,
|
|
55123
|
+
cost_usd: null,
|
|
55124
|
+
content_text: n2.contentText,
|
|
55125
|
+
cwd: null,
|
|
55126
|
+
provenance: "ambient"
|
|
55127
|
+
}
|
|
55128
|
+
});
|
|
55129
|
+
return entries;
|
|
55130
|
+
}
|
|
55131
|
+
if (recordType === "assistant" || recordType === "agent_message_chunk") {
|
|
55132
|
+
entries.push({
|
|
55133
|
+
targetTable: "history_message",
|
|
55134
|
+
record: {
|
|
55135
|
+
session_id: sessionId,
|
|
55136
|
+
seq,
|
|
55137
|
+
role: "assistant",
|
|
55138
|
+
record_type: recordType,
|
|
55139
|
+
disposition: "keep",
|
|
55140
|
+
ts,
|
|
55141
|
+
duration_ms: undefined,
|
|
55142
|
+
model: n2.model ?? null,
|
|
55143
|
+
input_tokens: null,
|
|
55144
|
+
output_tokens: null,
|
|
55145
|
+
cache_read_tokens: null,
|
|
55146
|
+
cache_write_tokens: null,
|
|
55147
|
+
cost_usd: null,
|
|
55148
|
+
content_text: n2.contentText,
|
|
55149
|
+
cwd: null,
|
|
55150
|
+
provenance: "ambient"
|
|
55151
|
+
}
|
|
55152
|
+
});
|
|
55153
|
+
return entries;
|
|
55154
|
+
}
|
|
55155
|
+
if (GROK_META_TYPES.has(recordType)) {
|
|
55156
|
+
entries.push({
|
|
55157
|
+
targetTable: "history_message",
|
|
55158
|
+
record: {
|
|
55159
|
+
session_id: sessionId,
|
|
55160
|
+
seq,
|
|
55161
|
+
role: "meta",
|
|
55162
|
+
record_type: recordType,
|
|
55163
|
+
disposition: "meta",
|
|
55164
|
+
ts,
|
|
55165
|
+
duration_ms: n2.durationMs ?? null,
|
|
55166
|
+
model: n2.model ?? null,
|
|
55167
|
+
input_tokens: null,
|
|
55168
|
+
output_tokens: null,
|
|
55169
|
+
cache_read_tokens: null,
|
|
55170
|
+
cache_write_tokens: null,
|
|
55171
|
+
cost_usd: null,
|
|
55172
|
+
content_text: n2.contentText,
|
|
55173
|
+
cwd: null,
|
|
55174
|
+
provenance: "ambient"
|
|
55175
|
+
}
|
|
55176
|
+
});
|
|
55177
|
+
return entries;
|
|
55178
|
+
}
|
|
55179
|
+
if (!n2.hasTypeDiscriminator || recordType.length === 0) {
|
|
55180
|
+
entries.push({
|
|
55181
|
+
targetTable: "history_message",
|
|
55182
|
+
record: {
|
|
55183
|
+
session_id: sessionId,
|
|
55184
|
+
seq,
|
|
55185
|
+
role: "unknown",
|
|
55186
|
+
record_type: stableFieldShape(raw),
|
|
55187
|
+
disposition: "unknown",
|
|
55188
|
+
ts,
|
|
55189
|
+
duration_ms: undefined,
|
|
55190
|
+
model: null,
|
|
55191
|
+
input_tokens: null,
|
|
55192
|
+
output_tokens: null,
|
|
55193
|
+
cache_read_tokens: null,
|
|
55194
|
+
cache_write_tokens: null,
|
|
55195
|
+
cost_usd: null,
|
|
55196
|
+
content_text: n2.contentText,
|
|
55197
|
+
cwd: null,
|
|
55198
|
+
provenance: "ambient"
|
|
55199
|
+
}
|
|
55200
|
+
});
|
|
55201
|
+
return entries;
|
|
55202
|
+
}
|
|
55203
|
+
entries.push({
|
|
55204
|
+
targetTable: "history_message",
|
|
55205
|
+
record: {
|
|
55206
|
+
session_id: sessionId,
|
|
55207
|
+
seq,
|
|
55208
|
+
role: "meta",
|
|
55209
|
+
record_type: recordType,
|
|
55210
|
+
disposition: "meta",
|
|
55211
|
+
ts,
|
|
55212
|
+
duration_ms: n2.durationMs ?? null,
|
|
55213
|
+
model: n2.model ?? null,
|
|
55214
|
+
input_tokens: null,
|
|
55215
|
+
output_tokens: null,
|
|
55216
|
+
cache_read_tokens: null,
|
|
55217
|
+
cache_write_tokens: null,
|
|
55218
|
+
cost_usd: null,
|
|
55219
|
+
content_text: n2.contentText,
|
|
55220
|
+
cwd: null,
|
|
55221
|
+
provenance: "ambient"
|
|
55222
|
+
}
|
|
55223
|
+
});
|
|
55224
|
+
return entries;
|
|
55225
|
+
}
|
|
55226
|
+
function o2(value) {
|
|
55227
|
+
return typeof value === "object" && value !== null ? value : {};
|
|
55228
|
+
}
|
|
55229
|
+
function s(...values) {
|
|
55230
|
+
for (const value of values) {
|
|
55231
|
+
if (typeof value === "string" && value.length > 0)
|
|
55232
|
+
return value;
|
|
55233
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
55234
|
+
return String(value);
|
|
55235
|
+
}
|
|
55236
|
+
return;
|
|
55237
|
+
}
|
|
55238
|
+
function mapRole(type) {
|
|
55239
|
+
const t = String(type ?? "").toLowerCase();
|
|
55240
|
+
if (t === "user" || t === "human")
|
|
55241
|
+
return "user";
|
|
55242
|
+
if (t === "assistant" || t === "ai" || t === "model")
|
|
55243
|
+
return "assistant";
|
|
55244
|
+
if (t === "system" || t === "error")
|
|
55245
|
+
return "system";
|
|
55246
|
+
return t || "unknown";
|
|
55247
|
+
}
|
|
55248
|
+
function computeCost(inputTokens, outputTokens, model) {
|
|
55249
|
+
if (inputTokens === undefined || inputTokens === null)
|
|
55250
|
+
return;
|
|
55251
|
+
if (outputTokens === undefined || outputTokens === null)
|
|
55252
|
+
return;
|
|
55253
|
+
const inputRate = model?.toLowerCase().includes("claude") ? 3 : 1;
|
|
55254
|
+
const outputRate = model?.toLowerCase().includes("claude") ? 15 : 5;
|
|
55255
|
+
return (inputTokens * inputRate + outputTokens * outputRate) / 1e6;
|
|
55256
|
+
}
|
|
55257
|
+
function extractContentText(content) {
|
|
55258
|
+
if (typeof content === "string")
|
|
55259
|
+
return content;
|
|
55260
|
+
if (!Array.isArray(content))
|
|
55261
|
+
return;
|
|
55262
|
+
const parts = [];
|
|
55263
|
+
for (const block of content) {
|
|
55264
|
+
if (typeof block !== "object" || block === null)
|
|
55265
|
+
continue;
|
|
55266
|
+
const b = block;
|
|
55267
|
+
if (b.type === "text" && typeof b.text === "string") {
|
|
55268
|
+
parts.push(b.text);
|
|
55269
|
+
}
|
|
55270
|
+
}
|
|
55271
|
+
return parts.length > 0 ? parts.join(`
|
|
55272
|
+
`) : undefined;
|
|
55273
|
+
}
|
|
55274
|
+
function stableFieldShape(raw) {
|
|
55275
|
+
return Object.keys(raw).map((k) => k.toLowerCase()).sort().join("+");
|
|
55276
|
+
}
|
|
55277
|
+
var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, GROK_META_TYPES, CLAUDE_FIELD_MAP, PI_FIELD_MAP, OMP_FIELD_MAP, CODEX_FIELD_MAP, AGY_FIELD_MAP, GROK_FIELD_MAP, passthroughSchema, CLAUDE_SCHEMA, PI_SCHEMA, OMP_SCHEMA, CODEX_SCHEMA, AGY_SCHEMA, GROK_SCHEMA;
|
|
55278
|
+
var init_mappers = __esm(() => {
|
|
55279
|
+
init_zod();
|
|
55280
|
+
init_hash();
|
|
55281
|
+
MESSAGE_MAPPER_KEYS = [
|
|
55282
|
+
"session_id",
|
|
55283
|
+
"seq",
|
|
55284
|
+
"turn_index",
|
|
55285
|
+
"role",
|
|
55286
|
+
"record_type",
|
|
55287
|
+
"disposition",
|
|
55288
|
+
"ts",
|
|
55289
|
+
"duration_ms",
|
|
55290
|
+
"model",
|
|
55291
|
+
"input_tokens",
|
|
55292
|
+
"output_tokens",
|
|
55293
|
+
"cache_read_tokens",
|
|
55294
|
+
"cache_write_tokens",
|
|
55295
|
+
"cost_usd",
|
|
55296
|
+
"content_text",
|
|
55297
|
+
"cwd",
|
|
55298
|
+
"provenance",
|
|
55299
|
+
"run_id",
|
|
55300
|
+
"task_wbs"
|
|
55301
|
+
];
|
|
55302
|
+
TOOL_CALL_MAPPER_KEYS = [
|
|
55303
|
+
"_messageSplitIndex",
|
|
55304
|
+
"session_id",
|
|
55305
|
+
"seq",
|
|
55306
|
+
"tool_name",
|
|
55307
|
+
"args_digest",
|
|
55308
|
+
"status",
|
|
55309
|
+
"started_at",
|
|
55310
|
+
"completed_at",
|
|
55311
|
+
"duration_ms",
|
|
55312
|
+
"result_bytes",
|
|
55313
|
+
"error_text"
|
|
55314
|
+
];
|
|
55315
|
+
GROK_META_TYPES = new Set([
|
|
55316
|
+
"phase_changed",
|
|
55317
|
+
"permission_requested",
|
|
55318
|
+
"permission_resolved",
|
|
55319
|
+
"mcp_server_starting",
|
|
55320
|
+
"mcp_server_connected",
|
|
55321
|
+
"mcp_config_resolved",
|
|
55322
|
+
"mcp_managed_config_result",
|
|
55323
|
+
"mcp_transport_decode_error",
|
|
55324
|
+
"mcp_init_completed",
|
|
55325
|
+
"mcp_health_check",
|
|
55326
|
+
"loop_started",
|
|
55327
|
+
"first_token",
|
|
55328
|
+
"agent_thought_chunk",
|
|
55329
|
+
"hook_execution",
|
|
55330
|
+
"plan",
|
|
55331
|
+
"session_recap",
|
|
55332
|
+
"task_backgrounded",
|
|
55333
|
+
"task_completed",
|
|
55334
|
+
"retry_state",
|
|
55335
|
+
"auto_compact_started",
|
|
55336
|
+
"auto_compact_completed",
|
|
55337
|
+
"compaction_checkpoint",
|
|
55338
|
+
"image_compressed",
|
|
55339
|
+
"reasoning",
|
|
55340
|
+
"system",
|
|
55341
|
+
"turn_started",
|
|
55342
|
+
"turn_ended",
|
|
55343
|
+
"yolo_toggled"
|
|
55344
|
+
]);
|
|
55345
|
+
CLAUDE_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55346
|
+
PI_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55347
|
+
OMP_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55348
|
+
CODEX_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55349
|
+
AGY_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55350
|
+
GROK_FIELD_MAP = identityFieldMap(MESSAGE_MAPPER_KEYS.concat(TOOL_CALL_MAPPER_KEYS));
|
|
55351
|
+
passthroughSchema = exports_external.object({}).passthrough();
|
|
55352
|
+
CLAUDE_SCHEMA = passthroughSchema;
|
|
55353
|
+
PI_SCHEMA = passthroughSchema;
|
|
55354
|
+
OMP_SCHEMA = passthroughSchema;
|
|
55355
|
+
CODEX_SCHEMA = passthroughSchema;
|
|
55356
|
+
AGY_SCHEMA = passthroughSchema;
|
|
55357
|
+
GROK_SCHEMA = passthroughSchema;
|
|
55358
|
+
});
|
|
55359
|
+
|
|
55360
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
|
|
54343
55361
|
function firstString(...values) {
|
|
54344
55362
|
for (const value of values) {
|
|
54345
55363
|
if (typeof value === "string" && value.length > 0)
|
|
@@ -54403,6 +55421,19 @@ function sourceDefinition(source, displayName, defaultRoots, filePatterns) {
|
|
|
54403
55421
|
schema: sourceRecordSchema
|
|
54404
55422
|
};
|
|
54405
55423
|
}
|
|
55424
|
+
function customSourceDefinition(source, displayName, defaultRoots, filePatterns, split, fieldMap, schema) {
|
|
55425
|
+
return {
|
|
55426
|
+
source,
|
|
55427
|
+
displayName,
|
|
55428
|
+
defaultRoots,
|
|
55429
|
+
filePatterns,
|
|
55430
|
+
targetTable: `history_etl_${source}`,
|
|
55431
|
+
splitConfig: { mode: "custom", split },
|
|
55432
|
+
fieldMap,
|
|
55433
|
+
fieldTransforms: {},
|
|
55434
|
+
schema
|
|
55435
|
+
};
|
|
55436
|
+
}
|
|
54406
55437
|
function getSourceDefinition(source) {
|
|
54407
55438
|
const definition = SOURCE_DEFINITIONS[source];
|
|
54408
55439
|
if (definition === undefined) {
|
|
@@ -54450,13 +55481,14 @@ function resolveSourceDefinition(input) {
|
|
|
54450
55481
|
}
|
|
54451
55482
|
function assertValidTable(table3, source) {
|
|
54452
55483
|
if (!VALID_TABLE_NAME.test(table3)) {
|
|
54453
|
-
throw new HistoryImportError(`Invalid history
|
|
55484
|
+
throw new HistoryImportError(`Invalid history target table for source "${source}": ${table3}. Must match ${VALID_TABLE_NAME.source}.`, { source, table: table3 });
|
|
54454
55485
|
}
|
|
54455
55486
|
}
|
|
54456
55487
|
var sourceRecordSchema, VALID_TABLE_NAME, SOURCE_DEFINITIONS;
|
|
54457
55488
|
var init_sources = __esm(() => {
|
|
54458
55489
|
init_zod();
|
|
54459
55490
|
init_errors7();
|
|
55491
|
+
init_mappers();
|
|
54460
55492
|
sourceRecordSchema = exports_external.object({
|
|
54461
55493
|
source_record_id: exports_external.string().min(1),
|
|
54462
55494
|
created_at: exports_external.string().min(1),
|
|
@@ -54464,11 +55496,14 @@ var init_sources = __esm(() => {
|
|
|
54464
55496
|
role: exports_external.string().optional(),
|
|
54465
55497
|
model: exports_external.string().optional()
|
|
54466
55498
|
}).passthrough();
|
|
54467
|
-
VALID_TABLE_NAME = /^
|
|
55499
|
+
VALID_TABLE_NAME = /^history_[a-z_]+$/;
|
|
54468
55500
|
SOURCE_DEFINITIONS = {
|
|
54469
|
-
pi:
|
|
54470
|
-
claude:
|
|
54471
|
-
codex:
|
|
55501
|
+
pi: customSourceDefinition("pi", "Pi", [".pi/agent/sessions"], ["*.jsonl"], piSplit, PI_FIELD_MAP, PI_SCHEMA),
|
|
55502
|
+
claude: customSourceDefinition("claude", "Claude Code", [".claude/projects"], ["*.jsonl"], claudeSplit, CLAUDE_FIELD_MAP, CLAUDE_SCHEMA),
|
|
55503
|
+
codex: customSourceDefinition("codex", "Codex", [".codex/sessions"], ["*.jsonl"], codexSplit, CODEX_FIELD_MAP, CODEX_SCHEMA),
|
|
55504
|
+
omp: customSourceDefinition("omp", "OMP", [".omp/agent/sessions"], ["*.jsonl"], ompSplit, OMP_FIELD_MAP, OMP_SCHEMA),
|
|
55505
|
+
grok: customSourceDefinition("grok", "Grok", [".grok/sessions"], ["*.jsonl"], grokSplit, GROK_FIELD_MAP, GROK_SCHEMA),
|
|
55506
|
+
agy: customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli/brain"], ["*.jsonl"], agySplit, AGY_FIELD_MAP, AGY_SCHEMA),
|
|
54472
55507
|
gemini: sourceDefinition("gemini", "Gemini CLI", [".gemini", ".config/gemini"], ["*.jsonl"]),
|
|
54473
55508
|
opencode: sourceDefinition("opencode", "OpenCode", [".opencode", ".local/share/opencode"], ["*.jsonl"]),
|
|
54474
55509
|
antigravity: sourceDefinition("antigravity", "Antigravity", [".antigravity"], ["*.jsonl"]),
|
|
@@ -54476,7 +55511,7 @@ var init_sources = __esm(() => {
|
|
|
54476
55511
|
};
|
|
54477
55512
|
});
|
|
54478
55513
|
|
|
54479
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
55514
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
|
|
54480
55515
|
function targetTableFor(table3) {
|
|
54481
55516
|
if (!VALID_TABLE_NAME.test(table3)) {
|
|
54482
55517
|
throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
|
|
@@ -54510,6 +55545,8 @@ async function ensureTargetTables(db2, definition) {
|
|
|
54510
55545
|
tables.add(targetTableFor(definition.splitConfig.targetTable));
|
|
54511
55546
|
}
|
|
54512
55547
|
for (const table3 of tables) {
|
|
55548
|
+
if (TYPED_TABLE_COLUMNS[table3] !== undefined)
|
|
55549
|
+
continue;
|
|
54513
55550
|
await db2.exec(ETL_TABLE_DDL(table3));
|
|
54514
55551
|
}
|
|
54515
55552
|
}
|
|
@@ -54535,21 +55572,97 @@ async function ledgerExists(db2, recordHash) {
|
|
|
54535
55572
|
}
|
|
54536
55573
|
async function insertRecord(db2, targetTable, recordHash, sourceFile, sourceLine, splitIndex, payload, now2) {
|
|
54537
55574
|
const table3 = targetTableFor(targetTable);
|
|
54538
|
-
|
|
54539
|
-
|
|
54540
|
-
|
|
55575
|
+
const typedColumns = TYPED_TABLE_COLUMNS[table3];
|
|
55576
|
+
if (typedColumns !== undefined) {
|
|
55577
|
+
const unknownKeys = Object.keys(payload).filter((k) => !typedColumns.includes(k) && !TYPED_IGNORED_KEYS.has(k));
|
|
55578
|
+
if (unknownKeys.length > 0) {
|
|
55579
|
+
throw new HistoryImportError(`Typed table "${table3}" has unknown columns: ${unknownKeys.join(", ")}. ` + `Expected one of: ${typedColumns.join(", ")}.`, { table: table3, unknownKeys, knownColumns: typedColumns });
|
|
55580
|
+
}
|
|
55581
|
+
const ts = timestamp(now2);
|
|
55582
|
+
const values = typedColumns.map((col) => {
|
|
55583
|
+
if (col === "record_hash")
|
|
55584
|
+
return recordHash;
|
|
55585
|
+
if (col === "imported_at")
|
|
55586
|
+
return ts;
|
|
55587
|
+
const v = payload[col];
|
|
55588
|
+
return v === undefined ? null : v;
|
|
55589
|
+
});
|
|
55590
|
+
if (!_ensuredTables.has(table3)) {
|
|
55591
|
+
_ensuredTables.add(table3);
|
|
55592
|
+
}
|
|
55593
|
+
await db2.run(`INSERT INTO ${table3} (${typedColumns.join(", ")})
|
|
55594
|
+
VALUES (${typedColumns.map(() => "?").join(", ")})
|
|
55595
|
+
ON CONFLICT(record_hash) DO NOTHING`, ...values);
|
|
55596
|
+
} else {
|
|
55597
|
+
if (!_ensuredTables.has(table3)) {
|
|
55598
|
+
await db2.exec(ETL_TABLE_DDL(table3));
|
|
55599
|
+
_ensuredTables.add(table3);
|
|
55600
|
+
}
|
|
55601
|
+
await db2.run(`INSERT INTO ${table3} (record_hash, source_file, source_line, split_index, payload_json, imported_at)
|
|
55602
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
55603
|
+
ON CONFLICT(record_hash) DO NOTHING`, recordHash, sourceFile, sourceLine, splitIndex, JSON.stringify(payload), timestamp(now2));
|
|
55604
|
+
}
|
|
54541
55605
|
}
|
|
54542
55606
|
async function insertLedger(db2, recordHash, source, sourceFile, sourceLine, splitIndex, targetTable, now2) {
|
|
54543
55607
|
await db2.run(`INSERT INTO history_import_ledger (record_hash, source, source_file, source_line, split_index, target_table, imported_at)
|
|
54544
55608
|
VALUES (?, ?, ?, ?, ?, ?, ?)`, recordHash, source, sourceFile, sourceLine, splitIndex, targetTable, timestamp(now2));
|
|
54545
55609
|
}
|
|
55610
|
+
var TYPED_TABLE_COLUMNS, TYPED_IGNORED_KEYS, _ensuredTables;
|
|
54546
55611
|
var init_jsonl_importer_dao = __esm(() => {
|
|
54547
55612
|
init_errors7();
|
|
54548
55613
|
init_schema_sql2();
|
|
54549
55614
|
init_sources();
|
|
55615
|
+
TYPED_TABLE_COLUMNS = {
|
|
55616
|
+
history_message: [
|
|
55617
|
+
"record_hash",
|
|
55618
|
+
"source",
|
|
55619
|
+
"source_file",
|
|
55620
|
+
"source_line",
|
|
55621
|
+
"session_id",
|
|
55622
|
+
"seq",
|
|
55623
|
+
"turn_index",
|
|
55624
|
+
"role",
|
|
55625
|
+
"record_type",
|
|
55626
|
+
"disposition",
|
|
55627
|
+
"ts",
|
|
55628
|
+
"duration_ms",
|
|
55629
|
+
"model",
|
|
55630
|
+
"input_tokens",
|
|
55631
|
+
"output_tokens",
|
|
55632
|
+
"cache_read_tokens",
|
|
55633
|
+
"cache_write_tokens",
|
|
55634
|
+
"cost_usd",
|
|
55635
|
+
"content_text",
|
|
55636
|
+
"cwd",
|
|
55637
|
+
"provenance",
|
|
55638
|
+
"run_id",
|
|
55639
|
+
"task_wbs",
|
|
55640
|
+
"imported_at"
|
|
55641
|
+
],
|
|
55642
|
+
history_tool_call: [
|
|
55643
|
+
"record_hash",
|
|
55644
|
+
"message_hash",
|
|
55645
|
+
"source",
|
|
55646
|
+
"source_file",
|
|
55647
|
+
"source_line",
|
|
55648
|
+
"session_id",
|
|
55649
|
+
"seq",
|
|
55650
|
+
"tool_name",
|
|
55651
|
+
"args_digest",
|
|
55652
|
+
"status",
|
|
55653
|
+
"started_at",
|
|
55654
|
+
"completed_at",
|
|
55655
|
+
"duration_ms",
|
|
55656
|
+
"result_bytes",
|
|
55657
|
+
"error_text",
|
|
55658
|
+
"imported_at"
|
|
55659
|
+
]
|
|
55660
|
+
};
|
|
55661
|
+
TYPED_IGNORED_KEYS = new Set(["_meta", "split_index"]);
|
|
55662
|
+
_ensuredTables = new Set;
|
|
54550
55663
|
});
|
|
54551
55664
|
|
|
54552
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
55665
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
|
|
54553
55666
|
function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
|
|
54554
55667
|
if (typeof value === "string") {
|
|
54555
55668
|
return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
|
|
@@ -54586,7 +55699,7 @@ var init_redaction = __esm(() => {
|
|
|
54586
55699
|
];
|
|
54587
55700
|
});
|
|
54588
55701
|
|
|
54589
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
55702
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
|
|
54590
55703
|
async function runJsonlImport(source, options) {
|
|
54591
55704
|
const definition = resolveSourceDefinition(source);
|
|
54592
55705
|
const resolvedSource = definition.source;
|
|
@@ -54603,6 +55716,7 @@ async function runJsonlImport(source, options) {
|
|
|
54603
55716
|
let processedLines = 0;
|
|
54604
55717
|
let importedRecords = 0;
|
|
54605
55718
|
let skippedDuplicates = 0;
|
|
55719
|
+
let unknownRecords = 0;
|
|
54606
55720
|
let checkpointUpdates = 0;
|
|
54607
55721
|
for (const file2 of files) {
|
|
54608
55722
|
const checkpoint = mode === "incremental" ? await readCheckpoint(options.db, resolvedSource, file2) : 0;
|
|
@@ -54618,6 +55732,7 @@ async function runJsonlImport(source, options) {
|
|
|
54618
55732
|
continue;
|
|
54619
55733
|
const splitRecords = splitRawRecord(definition, raw);
|
|
54620
55734
|
let lineSucceeded = false;
|
|
55735
|
+
const prepared = [];
|
|
54621
55736
|
for (let splitIndex = 0;splitIndex < splitRecords.length; splitIndex += 1) {
|
|
54622
55737
|
const split = splitRecords[splitIndex];
|
|
54623
55738
|
if (split === undefined)
|
|
@@ -54650,8 +55765,24 @@ async function runJsonlImport(source, options) {
|
|
|
54650
55765
|
skippedDuplicates += 1;
|
|
54651
55766
|
continue;
|
|
54652
55767
|
}
|
|
55768
|
+
prepared.push({ split, splitIndex, normalized: redacted, recordHash });
|
|
55769
|
+
}
|
|
55770
|
+
const recordHashBySplitIndex = new Map(prepared.map((e) => [e.splitIndex, e.recordHash]));
|
|
55771
|
+
for (const entry of prepared) {
|
|
55772
|
+
const { split, splitIndex, normalized, recordHash } = entry;
|
|
55773
|
+
if (normalized.disposition === "unknown") {
|
|
55774
|
+
unknownRecords += 1;
|
|
55775
|
+
}
|
|
55776
|
+
const msgSplitIdx = normalized._messageSplitIndex;
|
|
55777
|
+
delete normalized._messageSplitIndex;
|
|
55778
|
+
if (msgSplitIdx !== undefined && typeof msgSplitIdx === "number") {
|
|
55779
|
+
const msgHash = recordHashBySplitIndex.get(msgSplitIdx);
|
|
55780
|
+
if (msgHash !== undefined) {
|
|
55781
|
+
normalized.message_hash = msgHash;
|
|
55782
|
+
}
|
|
55783
|
+
}
|
|
54653
55784
|
if (!options.dryRun) {
|
|
54654
|
-
await insertRecord(options.db, split.targetTable, recordHash, file2, lineNumber, splitIndex,
|
|
55785
|
+
await insertRecord(options.db, split.targetTable, recordHash, file2, lineNumber, splitIndex, normalized, options.now);
|
|
54655
55786
|
await insertLedger(options.db, recordHash, resolvedSource, file2, lineNumber, splitIndex, split.targetTable, options.now);
|
|
54656
55787
|
}
|
|
54657
55788
|
importedRecords += 1;
|
|
@@ -54669,6 +55800,7 @@ async function runJsonlImport(source, options) {
|
|
|
54669
55800
|
processedLines,
|
|
54670
55801
|
importedRecords,
|
|
54671
55802
|
skippedDuplicates,
|
|
55803
|
+
unknownRecords,
|
|
54672
55804
|
parseErrors,
|
|
54673
55805
|
validationErrors,
|
|
54674
55806
|
checkpointUpdates
|
|
@@ -54694,10 +55826,14 @@ function splitRawRecord(definition, raw) {
|
|
|
54694
55826
|
}
|
|
54695
55827
|
if (definition.splitConfig.mode === "custom") {
|
|
54696
55828
|
const config5 = definition.splitConfig;
|
|
54697
|
-
|
|
54698
|
-
|
|
54699
|
-
|
|
54700
|
-
|
|
55829
|
+
const configTable = config5.targetTable !== undefined ? targetTableFor(config5.targetTable) : undefined;
|
|
55830
|
+
return config5.split(raw).map((entry) => {
|
|
55831
|
+
const hasTargetTable = "targetTable" in entry && typeof entry.targetTable === "string";
|
|
55832
|
+
const record2 = hasTargetTable ? entry.record : entry;
|
|
55833
|
+
const entryTable = hasTargetTable ? entry.targetTable : undefined;
|
|
55834
|
+
const table3 = entryTable ?? configTable ?? targetTable;
|
|
55835
|
+
return { targetTable: targetTableFor(table3), raw: record2 };
|
|
55836
|
+
});
|
|
54701
55837
|
}
|
|
54702
55838
|
const config4 = definition.splitConfig;
|
|
54703
55839
|
const nested = raw[config4.field];
|
|
@@ -54776,13 +55912,13 @@ var init_importer = __esm(() => {
|
|
|
54776
55912
|
init_sources();
|
|
54777
55913
|
});
|
|
54778
55914
|
|
|
54779
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
55915
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.22+d5c29f764bf0e6e0/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
|
|
54780
55916
|
var init_dist8 = __esm(() => {
|
|
54781
55917
|
init_importer();
|
|
54782
55918
|
init_schema_sql2();
|
|
54783
55919
|
});
|
|
54784
55920
|
|
|
54785
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
55921
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
|
|
54786
55922
|
function collectExtensions(sourceName, sourceDir, extensions) {
|
|
54787
55923
|
if (extensions === undefined)
|
|
54788
55924
|
return [];
|
|
@@ -54798,7 +55934,7 @@ var init_extensions = __esm(() => {
|
|
|
54798
55934
|
init_dist5();
|
|
54799
55935
|
});
|
|
54800
55936
|
|
|
54801
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
55937
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
|
|
54802
55938
|
function createFinding(rule, message, filePath, extras = {}) {
|
|
54803
55939
|
return {
|
|
54804
55940
|
ruleId: rule.id,
|
|
@@ -54869,7 +56005,7 @@ var init_types3 = __esm(() => {
|
|
|
54869
56005
|
});
|
|
54870
56006
|
});
|
|
54871
56007
|
|
|
54872
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
56008
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
|
|
54873
56009
|
async function loadPreset(name, options) {
|
|
54874
56010
|
const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
|
|
54875
56011
|
const presetPath = findMergedPreset(merged, name);
|
|
@@ -55084,7 +56220,7 @@ var init_loader2 = __esm(() => {
|
|
|
55084
56220
|
FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
|
|
55085
56221
|
});
|
|
55086
56222
|
|
|
55087
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
56223
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
|
|
55088
56224
|
function normalizeFindingPath(filePath) {
|
|
55089
56225
|
if (!filePath || isAbsolutePath2(filePath))
|
|
55090
56226
|
return null;
|
|
@@ -55149,7 +56285,7 @@ var init_test_stub_fixer = __esm(() => {
|
|
|
55149
56285
|
realFileSystem = createNodeFileSystem3();
|
|
55150
56286
|
});
|
|
55151
56287
|
|
|
55152
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
56288
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
|
|
55153
56289
|
function registerBuiltinFixers(host, exec) {
|
|
55154
56290
|
const regexFixer = new RegexFixerProvider;
|
|
55155
56291
|
const pathFixer = new PathFixerProvider;
|
|
@@ -55352,7 +56488,7 @@ var init_fixers = __esm(() => {
|
|
|
55352
56488
|
};
|
|
55353
56489
|
});
|
|
55354
56490
|
|
|
55355
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
56491
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
|
|
55356
56492
|
function getAgentSessionCapability(agent) {
|
|
55357
56493
|
return AGENT_SESSION_CAPABILITY[agent];
|
|
55358
56494
|
}
|
|
@@ -55644,7 +56780,7 @@ var init_shims = __esm(() => {
|
|
|
55644
56780
|
ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
|
|
55645
56781
|
});
|
|
55646
56782
|
|
|
55647
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
56783
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
|
|
55648
56784
|
function buildIdentityPreamble(ctx) {
|
|
55649
56785
|
const sections = [
|
|
55650
56786
|
`You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
|
|
@@ -55704,7 +56840,7 @@ var init_identity = __esm(() => {
|
|
|
55704
56840
|
init_dist5();
|
|
55705
56841
|
});
|
|
55706
56842
|
|
|
55707
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
56843
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
|
|
55708
56844
|
function isClaudeStyleSlashCommand(input) {
|
|
55709
56845
|
return SLASH_COMMAND_RE.test(input);
|
|
55710
56846
|
}
|
|
@@ -55732,7 +56868,7 @@ var init_slash_command = __esm(() => {
|
|
|
55732
56868
|
SLASH_COMMAND_RE = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
|
|
55733
56869
|
});
|
|
55734
56870
|
|
|
55735
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
56871
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
|
|
55736
56872
|
function buildCorrelationEnv(correlation) {
|
|
55737
56873
|
return {
|
|
55738
56874
|
[AGENT_RUN_ID_ENV]: correlation.runId,
|
|
@@ -55868,7 +57004,7 @@ var init_ai_runner = __esm(() => {
|
|
|
55868
57004
|
init_slash_command();
|
|
55869
57005
|
});
|
|
55870
57006
|
|
|
55871
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57007
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
|
|
55872
57008
|
class AgentDetector {
|
|
55873
57009
|
runner;
|
|
55874
57010
|
timeout;
|
|
@@ -55944,7 +57080,7 @@ var init_agent_detector = __esm(() => {
|
|
|
55944
57080
|
VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
|
|
55945
57081
|
});
|
|
55946
57082
|
|
|
55947
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57083
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
|
|
55948
57084
|
function validateAgentId(id) {
|
|
55949
57085
|
if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
|
|
55950
57086
|
throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
|
|
@@ -56041,7 +57177,7 @@ var init_agent_spec = __esm(() => {
|
|
|
56041
57177
|
};
|
|
56042
57178
|
});
|
|
56043
57179
|
|
|
56044
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57180
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
|
|
56045
57181
|
function isNonEmpty(value) {
|
|
56046
57182
|
return value !== undefined && value.trim().length > 0;
|
|
56047
57183
|
}
|
|
@@ -56146,7 +57282,7 @@ var init_auth_shims = __esm(() => {
|
|
|
56146
57282
|
};
|
|
56147
57283
|
});
|
|
56148
57284
|
|
|
56149
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57285
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
|
|
56150
57286
|
class ModelHealthProbeRegistry {
|
|
56151
57287
|
probes = new Map;
|
|
56152
57288
|
register(providerPrefix, probe) {
|
|
@@ -56254,7 +57390,7 @@ var init_model_health_probe = __esm(() => {
|
|
|
56254
57390
|
};
|
|
56255
57391
|
});
|
|
56256
57392
|
|
|
56257
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57393
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
|
|
56258
57394
|
class DoctorRunner {
|
|
56259
57395
|
detector;
|
|
56260
57396
|
runner;
|
|
@@ -56391,15 +57527,15 @@ var init_doctor_runner = __esm(() => {
|
|
|
56391
57527
|
init_model_health_probe();
|
|
56392
57528
|
});
|
|
56393
57529
|
|
|
56394
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57530
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
|
|
56395
57531
|
var init_events = () => {};
|
|
56396
57532
|
|
|
56397
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57533
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
|
|
56398
57534
|
function formatMessage(msg) {
|
|
56399
57535
|
return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
|
|
56400
57536
|
}
|
|
56401
57537
|
|
|
56402
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57538
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
|
|
56403
57539
|
import { Buffer as Buffer5 } from "buffer";
|
|
56404
57540
|
|
|
56405
57541
|
class TeamAgentProcess {
|
|
@@ -56533,7 +57669,7 @@ var init_team_agent_process = __esm(() => {
|
|
|
56533
57669
|
init_dist5();
|
|
56534
57670
|
});
|
|
56535
57671
|
|
|
56536
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57672
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
|
|
56537
57673
|
class TeamOrchestrator {
|
|
56538
57674
|
configDir;
|
|
56539
57675
|
inbox;
|
|
@@ -56662,7 +57798,7 @@ var init_team_orchestrator = __esm(() => {
|
|
|
56662
57798
|
init_team_agent_process();
|
|
56663
57799
|
});
|
|
56664
57800
|
|
|
56665
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
57801
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.22+329d9eaeac30e7d8/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
|
|
56666
57802
|
var exports_dist3 = {};
|
|
56667
57803
|
__export(exports_dist3, {
|
|
56668
57804
|
validateAgentId: () => validateAgentId,
|
|
@@ -56714,7 +57850,7 @@ var init_dist9 = __esm(() => {
|
|
|
56714
57850
|
init_team_orchestrator();
|
|
56715
57851
|
});
|
|
56716
57852
|
|
|
56717
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
57853
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
|
|
56718
57854
|
function stringArray(value) {
|
|
56719
57855
|
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
|
|
56720
57856
|
}
|
|
@@ -56752,7 +57888,7 @@ function parseInlineFlags(source) {
|
|
|
56752
57888
|
return { flags, rest: source.slice(match[0].length) };
|
|
56753
57889
|
}
|
|
56754
57890
|
|
|
56755
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
57891
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
|
|
56756
57892
|
function matchesAny(path9, patterns) {
|
|
56757
57893
|
if (patterns === undefined || patterns.length === 0)
|
|
56758
57894
|
return true;
|
|
@@ -56800,7 +57936,7 @@ function escapeRegExp(value) {
|
|
|
56800
57936
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
56801
57937
|
}
|
|
56802
57938
|
|
|
56803
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
57939
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
|
|
56804
57940
|
async function discoverFiles2(options) {
|
|
56805
57941
|
const fs3 = options.fs ?? createNodeFileSystem3();
|
|
56806
57942
|
const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
|
|
@@ -56828,12 +57964,12 @@ var init_file_discovery = __esm(() => {
|
|
|
56828
57964
|
DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
|
|
56829
57965
|
});
|
|
56830
57966
|
|
|
56831
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
57967
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
|
|
56832
57968
|
var init_file_utils = __esm(() => {
|
|
56833
57969
|
init_file_discovery();
|
|
56834
57970
|
});
|
|
56835
57971
|
|
|
56836
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
57972
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
|
|
56837
57973
|
class AgentDetectionEvaluator {
|
|
56838
57974
|
detector;
|
|
56839
57975
|
constructor(detector = new AgentDetector) {
|
|
@@ -56861,7 +57997,7 @@ var init_agent_detection_evaluator = __esm(() => {
|
|
|
56861
57997
|
init_file_utils();
|
|
56862
57998
|
});
|
|
56863
57999
|
|
|
56864
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58000
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
|
|
56865
58001
|
class CoverageGateEvaluator {
|
|
56866
58002
|
constructor() {}
|
|
56867
58003
|
async evaluate(rule, context4) {
|
|
@@ -56945,7 +58081,7 @@ var init_coverage_gate_evaluator = __esm(() => {
|
|
|
56945
58081
|
init_file_utils();
|
|
56946
58082
|
});
|
|
56947
58083
|
|
|
56948
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58084
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
|
|
56949
58085
|
class ExitCodeEvaluator {
|
|
56950
58086
|
executor;
|
|
56951
58087
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -56981,7 +58117,7 @@ var init_exit_code_evaluator = __esm(() => {
|
|
|
56981
58117
|
init_file_utils();
|
|
56982
58118
|
});
|
|
56983
58119
|
|
|
56984
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58120
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
|
|
56985
58121
|
class ForbiddenImportEvaluator {
|
|
56986
58122
|
constructor() {}
|
|
56987
58123
|
async evaluate(rule, context4) {
|
|
@@ -57062,7 +58198,7 @@ var init_forbidden_import_evaluator = __esm(() => {
|
|
|
57062
58198
|
init_file_utils();
|
|
57063
58199
|
});
|
|
57064
58200
|
|
|
57065
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58201
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
|
|
57066
58202
|
class ImportBoundaryEvaluator {
|
|
57067
58203
|
async evaluate(rule, context4) {
|
|
57068
58204
|
const config4 = rule.evaluator.config ?? {};
|
|
@@ -57155,7 +58291,7 @@ var init_import_boundary_evaluator = __esm(() => {
|
|
|
57155
58291
|
init_file_utils();
|
|
57156
58292
|
});
|
|
57157
58293
|
|
|
57158
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58294
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
|
|
57159
58295
|
class PathEvaluator {
|
|
57160
58296
|
constructor() {}
|
|
57161
58297
|
async evaluate(rule, context4) {
|
|
@@ -57216,7 +58352,7 @@ var init_path_evaluator = __esm(() => {
|
|
|
57216
58352
|
init_file_utils();
|
|
57217
58353
|
});
|
|
57218
58354
|
|
|
57219
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58355
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
|
|
57220
58356
|
class RegexEvaluator {
|
|
57221
58357
|
constructor() {}
|
|
57222
58358
|
async evaluate(rule, context4) {
|
|
@@ -57294,7 +58430,7 @@ var init_regex_evaluator = __esm(() => {
|
|
|
57294
58430
|
init_file_utils();
|
|
57295
58431
|
});
|
|
57296
58432
|
|
|
57297
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58433
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
|
|
57298
58434
|
class RipgrepEvaluator {
|
|
57299
58435
|
executor;
|
|
57300
58436
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -57387,7 +58523,7 @@ var init_ripgrep_evaluator = __esm(() => {
|
|
|
57387
58523
|
init_file_utils();
|
|
57388
58524
|
});
|
|
57389
58525
|
|
|
57390
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58526
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
|
|
57391
58527
|
class SchemaArtifactEvaluator {
|
|
57392
58528
|
constructor() {}
|
|
57393
58529
|
async evaluate(rule, context4) {
|
|
@@ -57465,7 +58601,7 @@ var init_schema_artifact_evaluator = __esm(() => {
|
|
|
57465
58601
|
init_file_utils();
|
|
57466
58602
|
});
|
|
57467
58603
|
|
|
57468
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58604
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
|
|
57469
58605
|
class SecretsScannerEvaluator {
|
|
57470
58606
|
constructor() {}
|
|
57471
58607
|
async evaluate(rule, context4) {
|
|
@@ -57533,7 +58669,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
|
|
|
57533
58669
|
ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
|
|
57534
58670
|
});
|
|
57535
58671
|
|
|
57536
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58672
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
|
|
57537
58673
|
class SgEvaluator {
|
|
57538
58674
|
executor;
|
|
57539
58675
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -57630,7 +58766,7 @@ var init_sg_evaluator = __esm(() => {
|
|
|
57630
58766
|
init_file_utils();
|
|
57631
58767
|
});
|
|
57632
58768
|
|
|
57633
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58769
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
|
|
57634
58770
|
class TypeScriptTestPathResolver {
|
|
57635
58771
|
name = "typescript";
|
|
57636
58772
|
constructor() {}
|
|
@@ -57713,7 +58849,7 @@ function testify(rel) {
|
|
|
57713
58849
|
return `${dir}test_${base2}`;
|
|
57714
58850
|
}
|
|
57715
58851
|
|
|
57716
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58852
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
|
|
57717
58853
|
class TestLocationEvaluator {
|
|
57718
58854
|
resolvers;
|
|
57719
58855
|
constructor(resolvers) {
|
|
@@ -57788,7 +58924,7 @@ var init_test_location_evaluator = __esm(() => {
|
|
|
57788
58924
|
TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
|
|
57789
58925
|
});
|
|
57790
58926
|
|
|
57791
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
58927
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
|
|
57792
58928
|
class TsdocExportEvaluator {
|
|
57793
58929
|
constructor() {}
|
|
57794
58930
|
async evaluate(rule, context4) {
|
|
@@ -57873,7 +59009,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
|
|
|
57873
59009
|
};
|
|
57874
59010
|
});
|
|
57875
59011
|
|
|
57876
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59012
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
|
|
57877
59013
|
class JsonFormatter {
|
|
57878
59014
|
constructor() {}
|
|
57879
59015
|
format(result) {
|
|
@@ -57881,7 +59017,7 @@ class JsonFormatter {
|
|
|
57881
59017
|
}
|
|
57882
59018
|
}
|
|
57883
59019
|
|
|
57884
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59020
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
|
|
57885
59021
|
class TextFormatter {
|
|
57886
59022
|
constructor() {}
|
|
57887
59023
|
format(result) {
|
|
@@ -57895,7 +59031,7 @@ class TextFormatter {
|
|
|
57895
59031
|
}
|
|
57896
59032
|
}
|
|
57897
59033
|
|
|
57898
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59034
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
|
|
57899
59035
|
function registerBuiltins(host, executor) {
|
|
57900
59036
|
const path9 = new PathEvaluator;
|
|
57901
59037
|
host.evaluators.register("regex", new RegexEvaluator, "builtin");
|
|
@@ -57935,7 +59071,7 @@ var init_builtins = __esm(() => {
|
|
|
57935
59071
|
init_tsdoc_export_evaluator();
|
|
57936
59072
|
});
|
|
57937
59073
|
|
|
57938
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59074
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
|
|
57939
59075
|
class RuleEngineHost {
|
|
57940
59076
|
evaluators;
|
|
57941
59077
|
formatters;
|
|
@@ -57952,7 +59088,7 @@ var init_rule_engine_host = __esm(() => {
|
|
|
57952
59088
|
init_extension2();
|
|
57953
59089
|
});
|
|
57954
59090
|
|
|
57955
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59091
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
|
|
57956
59092
|
class RuleEngine {
|
|
57957
59093
|
host;
|
|
57958
59094
|
events;
|
|
@@ -58123,7 +59259,7 @@ var init_engine = __esm(() => {
|
|
|
58123
59259
|
init_types3();
|
|
58124
59260
|
});
|
|
58125
59261
|
|
|
58126
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59262
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
|
|
58127
59263
|
async function bundledRulesRoot() {
|
|
58128
59264
|
if (cachedRoot2 !== undefined)
|
|
58129
59265
|
return cachedRoot2;
|
|
@@ -58174,7 +59310,7 @@ var init_bundled_rules = __esm(() => {
|
|
|
58174
59310
|
init_dist5();
|
|
58175
59311
|
});
|
|
58176
59312
|
|
|
58177
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59313
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
|
|
58178
59314
|
class DbRulePersistenceAdapter {
|
|
58179
59315
|
db;
|
|
58180
59316
|
constructor(db2) {
|
|
@@ -58208,7 +59344,7 @@ class DbRulePersistenceAdapter {
|
|
|
58208
59344
|
}
|
|
58209
59345
|
}
|
|
58210
59346
|
|
|
58211
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59347
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
|
|
58212
59348
|
var RULE_ENGINE_SCHEMA_SQL = `
|
|
58213
59349
|
CREATE TABLE IF NOT EXISTS rule_runs (
|
|
58214
59350
|
id TEXT PRIMARY KEY,
|
|
@@ -58254,10 +59390,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
|
|
|
58254
59390
|
CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
|
|
58255
59391
|
`;
|
|
58256
59392
|
|
|
58257
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59393
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
|
|
58258
59394
|
var init_persistence2 = () => {};
|
|
58259
59395
|
|
|
58260
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
59396
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.22+eb8900f44f4776f9/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
|
|
58261
59397
|
var init_dist10 = __esm(() => {
|
|
58262
59398
|
init_extensions();
|
|
58263
59399
|
init_loader2();
|
|
@@ -58477,7 +59613,7 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
|
|
|
58477
59613
|
];
|
|
58478
59614
|
});
|
|
58479
59615
|
|
|
58480
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
59616
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
|
|
58481
59617
|
function queueLogger() {
|
|
58482
59618
|
if (!_queueLogger)
|
|
58483
59619
|
_queueLogger = getLogger2("job-queue");
|
|
@@ -58754,7 +59890,7 @@ var init_db_job_queue = __esm(() => {
|
|
|
58754
59890
|
init_tracing2();
|
|
58755
59891
|
});
|
|
58756
59892
|
|
|
58757
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
59893
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
|
|
58758
59894
|
var exports_job_queue_db = {};
|
|
58759
59895
|
__export(exports_job_queue_db, {
|
|
58760
59896
|
DBQueueConsumer: () => DBQueueConsumer,
|
|
@@ -59246,10 +60382,10 @@ var init_schema4 = __esm(() => {
|
|
|
59246
60382
|
}
|
|
59247
60383
|
];
|
|
59248
60384
|
CANONICAL_STAGE_BY_KEY = new Map;
|
|
59249
|
-
for (const
|
|
59250
|
-
CANONICAL_STAGE_BY_KEY.set(
|
|
59251
|
-
for (const a2 of
|
|
59252
|
-
CANONICAL_STAGE_BY_KEY.set(a2,
|
|
60385
|
+
for (const s2 of REGISTERED_CANONICAL_STAGES) {
|
|
60386
|
+
CANONICAL_STAGE_BY_KEY.set(s2.id, s2);
|
|
60387
|
+
for (const a2 of s2.aliases ?? []) {
|
|
60388
|
+
CANONICAL_STAGE_BY_KEY.set(a2, s2);
|
|
59253
60389
|
}
|
|
59254
60390
|
}
|
|
59255
60391
|
});
|
|
@@ -59973,12 +61109,12 @@ class MarkdownDocument {
|
|
|
59973
61109
|
const seen = new Set;
|
|
59974
61110
|
const sections = [];
|
|
59975
61111
|
const duplicateNames = [];
|
|
59976
|
-
for (const
|
|
59977
|
-
if (seen.has(
|
|
59978
|
-
duplicateNames.push(
|
|
61112
|
+
for (const s2 of allSections) {
|
|
61113
|
+
if (seen.has(s2.name)) {
|
|
61114
|
+
duplicateNames.push(s2.name);
|
|
59979
61115
|
} else {
|
|
59980
|
-
seen.add(
|
|
59981
|
-
sections.push(
|
|
61116
|
+
seen.add(s2.name);
|
|
61117
|
+
sections.push(s2);
|
|
59982
61118
|
}
|
|
59983
61119
|
}
|
|
59984
61120
|
const doc2 = new MarkdownDocument(domain2, frontmatterBlock, frontmatter, preamble, sections);
|
|
@@ -60008,7 +61144,7 @@ class MarkdownDocument {
|
|
|
60008
61144
|
return result;
|
|
60009
61145
|
}
|
|
60010
61146
|
get sectionNames() {
|
|
60011
|
-
return this._sections.map((
|
|
61147
|
+
return this._sections.map((s2) => s2.name);
|
|
60012
61148
|
}
|
|
60013
61149
|
get strippedHeadings() {
|
|
60014
61150
|
return this._strippedHeadings;
|
|
@@ -60018,7 +61154,7 @@ class MarkdownDocument {
|
|
|
60018
61154
|
}
|
|
60019
61155
|
get canonicalSections() {
|
|
60020
61156
|
const base2 = this._domain === "task" ? TASK_CANONICAL_SECTIONS : FEATURE_CANONICAL_SECTIONS;
|
|
60021
|
-
const extra = UNIVERSAL_SECTIONS.filter((
|
|
61157
|
+
const extra = UNIVERSAL_SECTIONS.filter((s2) => !base2.includes(s2));
|
|
60022
61158
|
return [...base2, ...extra];
|
|
60023
61159
|
}
|
|
60024
61160
|
validateSectionName(name) {
|
|
@@ -60027,7 +61163,7 @@ class MarkdownDocument {
|
|
|
60027
61163
|
}
|
|
60028
61164
|
}
|
|
60029
61165
|
findSection(name) {
|
|
60030
|
-
return this._sections.find((
|
|
61166
|
+
return this._sections.find((s2) => s2.name === name);
|
|
60031
61167
|
}
|
|
60032
61168
|
hasSection(name) {
|
|
60033
61169
|
return this.findSection(name) !== undefined;
|
|
@@ -60432,6 +61568,7 @@ var init_schema6 = __esm(() => {
|
|
|
60432
61568
|
priority: exports_external.enum(PRIORITIES).optional(),
|
|
60433
61569
|
tags: exports_external.array(exports_external.string()).optional(),
|
|
60434
61570
|
dependencies: exports_external.array(exports_external.string()).optional(),
|
|
61571
|
+
ac_numbering: exports_external.literal("task-local").optional(),
|
|
60435
61572
|
done_forced: exports_external.preprocess((v) => typeof v === "string" ? v === "true" : v, exports_external.boolean().optional()),
|
|
60436
61573
|
done_reason: exports_external.string().optional(),
|
|
60437
61574
|
feature_link_declined: exports_external.preprocess((v) => typeof v === "string" ? v === "true" : v, exports_external.boolean().optional()),
|
|
@@ -60545,7 +61682,7 @@ var init_task_skeleton = __esm(() => {
|
|
|
60545
61682
|
References: "Links to design docs, ADRs, related tasks/features.",
|
|
60546
61683
|
History: "Auto-appended transition log \u2014 leave empty at creation."
|
|
60547
61684
|
};
|
|
60548
|
-
CANONICAL_INDEX = new Map(TASK_CANONICAL_SECTIONS.map((
|
|
61685
|
+
CANONICAL_INDEX = new Map(TASK_CANONICAL_SECTIONS.map((s2, i2) => [s2, i2]));
|
|
60549
61686
|
});
|
|
60550
61687
|
|
|
60551
61688
|
// ../../packages/domain/src/stage-registry/validator.ts
|
|
@@ -62899,7 +64036,7 @@ var init_feature_check = __esm(() => {
|
|
|
62899
64036
|
if (stillOrphan.size === 0)
|
|
62900
64037
|
break;
|
|
62901
64038
|
const orphanedByThisTask = new Set(checkAcCoverage(acBody, taskAc, parseChecklist(taskAc)).orphans);
|
|
62902
|
-
stillOrphan = new Set([...stillOrphan].filter((
|
|
64039
|
+
stillOrphan = new Set([...stillOrphan].filter((o3) => orphanedByThisTask.has(o3)));
|
|
62903
64040
|
}
|
|
62904
64041
|
for (const orphan of stillOrphan) {
|
|
62905
64042
|
findings.push({
|
|
@@ -62955,9 +64092,9 @@ var init_feature_check = __esm(() => {
|
|
|
62955
64092
|
return;
|
|
62956
64093
|
if (parsed.scenarios.length === 0)
|
|
62957
64094
|
return;
|
|
62958
|
-
const scenarioAliases = parsed.scenarios.map((
|
|
62959
|
-
title:
|
|
62960
|
-
normalized: normalizeTitle(
|
|
64095
|
+
const scenarioAliases = parsed.scenarios.map((s2, i2) => ({
|
|
64096
|
+
title: s2.name,
|
|
64097
|
+
normalized: normalizeTitle(s2.name),
|
|
62961
64098
|
alias: `AC-${i2 + 1}`
|
|
62962
64099
|
}));
|
|
62963
64100
|
const covers = {};
|
|
@@ -63903,7 +65040,18 @@ var SOURCES, MODES;
|
|
|
63903
65040
|
var init_history_service = __esm(() => {
|
|
63904
65041
|
init_src2();
|
|
63905
65042
|
init_dist8();
|
|
63906
|
-
SOURCES = [
|
|
65043
|
+
SOURCES = [
|
|
65044
|
+
"pi",
|
|
65045
|
+
"claude",
|
|
65046
|
+
"codex",
|
|
65047
|
+
"gemini",
|
|
65048
|
+
"opencode",
|
|
65049
|
+
"antigravity",
|
|
65050
|
+
"openclaw",
|
|
65051
|
+
"omp",
|
|
65052
|
+
"grok",
|
|
65053
|
+
"agy"
|
|
65054
|
+
];
|
|
63907
65055
|
MODES = ["full", "incremental", "force-file"];
|
|
63908
65056
|
});
|
|
63909
65057
|
|
|
@@ -64273,8 +65421,8 @@ function parseEtimeToSeconds(etime) {
|
|
|
64273
65421
|
const d = Number(dayMatch[1]);
|
|
64274
65422
|
const h2 = Number(dayMatch[2]);
|
|
64275
65423
|
const m = Number(dayMatch[3]);
|
|
64276
|
-
const
|
|
64277
|
-
return d * 86400 + h2 * 3600 + m * 60 +
|
|
65424
|
+
const s2 = Number(dayMatch[4]);
|
|
65425
|
+
return d * 86400 + h2 * 3600 + m * 60 + s2;
|
|
64278
65426
|
}
|
|
64279
65427
|
const parts = t.split(":").map((p) => Number(p));
|
|
64280
65428
|
if (parts.some((n2) => !Number.isFinite(n2)))
|
|
@@ -64282,12 +65430,12 @@ function parseEtimeToSeconds(etime) {
|
|
|
64282
65430
|
if (parts.length === 1)
|
|
64283
65431
|
return parts[0] ?? null;
|
|
64284
65432
|
if (parts.length === 2) {
|
|
64285
|
-
const [m,
|
|
64286
|
-
return (m ?? 0) * 60 + (
|
|
65433
|
+
const [m, s2] = parts;
|
|
65434
|
+
return (m ?? 0) * 60 + (s2 ?? 0);
|
|
64287
65435
|
}
|
|
64288
65436
|
if (parts.length === 3) {
|
|
64289
|
-
const [h2, m,
|
|
64290
|
-
return (h2 ?? 0) * 3600 + (m ?? 0) * 60 + (
|
|
65437
|
+
const [h2, m, s2] = parts;
|
|
65438
|
+
return (h2 ?? 0) * 3600 + (m ?? 0) * 60 + (s2 ?? 0);
|
|
64291
65439
|
}
|
|
64292
65440
|
return null;
|
|
64293
65441
|
}
|
|
@@ -65107,7 +66255,7 @@ ${ruleIds.join(`
|
|
|
65107
66255
|
const counts = { error: 0, warning: 0, info: 0 };
|
|
65108
66256
|
for (const f of findings)
|
|
65109
66257
|
counts[f.severity] += 1;
|
|
65110
|
-
const parts = ["error", "warning", "info"].filter((
|
|
66258
|
+
const parts = ["error", "warning", "info"].filter((s2) => counts[s2] > 0).map((s2) => `${counts[s2]} ${s2}${counts[s2] === 1 ? "" : "s"}`);
|
|
65111
66259
|
const tint = counts.error > 0 ? color.red : counts.warning > 0 ? color.yellow : color.cyan;
|
|
65112
66260
|
return tint(`\u2717 ${parts.join(", ")}`);
|
|
65113
66261
|
}
|
|
@@ -65143,7 +66291,7 @@ ${ruleIds.join(`
|
|
|
65143
66291
|
const counts = { error: 0, warning: 0, info: 0 };
|
|
65144
66292
|
for (const f of violations)
|
|
65145
66293
|
counts[f.severity] += 1;
|
|
65146
|
-
const parts = ["error", "warning", "info"].filter((
|
|
66294
|
+
const parts = ["error", "warning", "info"].filter((s2) => counts[s2] > 0).map((s2) => `${counts[s2]} ${s2}${counts[s2] === 1 ? "" : "s"}`);
|
|
65147
66295
|
if (errored > 0)
|
|
65148
66296
|
parts.push(`${errored} misconfigured ${errored === 1 ? "rule" : "rules"}`);
|
|
65149
66297
|
return `${parts.join(", ")} across ${ruleCount} ${rulesNoun}.`;
|
|
@@ -65638,7 +66786,7 @@ class SupervisorService {
|
|
|
65638
66786
|
return existing.entry;
|
|
65639
66787
|
}
|
|
65640
66788
|
const specs = await this.loadSpecs();
|
|
65641
|
-
const spec = specs.find((
|
|
66789
|
+
const spec = specs.find((s2) => s2.id === agentId);
|
|
65642
66790
|
if (!spec) {
|
|
65643
66791
|
throw new Error(`No agent spec found for "${agentId}"`);
|
|
65644
66792
|
}
|
|
@@ -65765,7 +66913,7 @@ class SupervisorService {
|
|
|
65765
66913
|
async startAutostart(ids) {
|
|
65766
66914
|
const results = [];
|
|
65767
66915
|
const specs = await this.loadSpecs();
|
|
65768
|
-
const specIds = new Set(specs.map((
|
|
66916
|
+
const specIds = new Set(specs.map((s2) => s2.id));
|
|
65769
66917
|
for (const id of ids) {
|
|
65770
66918
|
if (!specIds.has(id)) {
|
|
65771
66919
|
throw new Error(`Autostart agent "${id}" not found \u2014 check .spur/agents/ and team.autostart config`);
|
|
@@ -66191,7 +67339,7 @@ var init_task_check = __esm(() => {
|
|
|
66191
67339
|
for (const block of blocks) {
|
|
66192
67340
|
const firstLine = block.trimStart().split(`
|
|
66193
67341
|
`)[0] ?? "";
|
|
66194
|
-
if (/^\s*[-*]?\s*(?:\[[ xX]\]\s*)?R\d
|
|
67342
|
+
if (/^\s*[-*]?\s*(?:\[[ xX]\]\s*)?[*_]{0,2}R\d+\.?[*_]{0,2}\s/.test(firstLine)) {
|
|
66195
67343
|
numbered++;
|
|
66196
67344
|
}
|
|
66197
67345
|
}
|
|
@@ -66205,6 +67353,59 @@ var init_task_check = __esm(() => {
|
|
|
66205
67353
|
});
|
|
66206
67354
|
}
|
|
66207
67355
|
}
|
|
67356
|
+
const acBodyForCoverage = doc2.getSection("Acceptance Criteria");
|
|
67357
|
+
if (doc2.frontmatterData?.ac_numbering === "task-local" && reqBody !== null && !isPlaceholderBody(reqBody) && acBodyForCoverage !== null && !isPlaceholderBody(stripAcFence(acBodyForCoverage))) {
|
|
67358
|
+
const reqIds = new Set;
|
|
67359
|
+
for (const line of reqBody.split(`
|
|
67360
|
+
`)) {
|
|
67361
|
+
const m = /^\s*[-*]?\s*(?:\[[ xX]\]\s*)?R(\d+)\.?\s/.exec(line);
|
|
67362
|
+
if (m?.[1] !== undefined)
|
|
67363
|
+
reqIds.add(m[1]);
|
|
67364
|
+
}
|
|
67365
|
+
const acIds = new Set;
|
|
67366
|
+
let scenarioCount = 0;
|
|
67367
|
+
for (const line of stripAcFence(acBodyForCoverage).split(`
|
|
67368
|
+
`)) {
|
|
67369
|
+
const s2 = /^\s*Scenario(?:\s+Outline)?:\s*(.*)$/.exec(line);
|
|
67370
|
+
if (s2 === null)
|
|
67371
|
+
continue;
|
|
67372
|
+
scenarioCount++;
|
|
67373
|
+
const id = /^R(\d+)\b/.exec((s2[1] ?? "").trim());
|
|
67374
|
+
if (id?.[1] !== undefined)
|
|
67375
|
+
acIds.add(id[1]);
|
|
67376
|
+
}
|
|
67377
|
+
const byNumber = (a2, b) => Number(a2) - Number(b);
|
|
67378
|
+
if (reqIds.size > 0 && scenarioCount > 0 && acIds.size === 0) {
|
|
67379
|
+
findings.push({
|
|
67380
|
+
layer: "L3",
|
|
67381
|
+
code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
|
|
67382
|
+
severity: "warning",
|
|
67383
|
+
section: "Acceptance Criteria",
|
|
67384
|
+
message: "ac_numbering is task-local but no scenario is R-numbered \u2014 prefix each scenario with the requirement it covers (Scenario: R1 \u2014 \u2026)"
|
|
67385
|
+
});
|
|
67386
|
+
} else if (reqIds.size > 0 && acIds.size > 0) {
|
|
67387
|
+
const uncovered = [...reqIds].filter((id) => !acIds.has(id)).sort(byNumber);
|
|
67388
|
+
const stale = [...acIds].filter((id) => !reqIds.has(id)).sort(byNumber);
|
|
67389
|
+
if (uncovered.length > 0) {
|
|
67390
|
+
findings.push({
|
|
67391
|
+
layer: "L3",
|
|
67392
|
+
code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
|
|
67393
|
+
severity: "warning",
|
|
67394
|
+
section: "Acceptance Criteria",
|
|
67395
|
+
message: `Requirements with no Acceptance Criteria scenario: ${uncovered.map((id) => `R${id}`).join(", ")} \u2014 add a scenario or drop the requirement`
|
|
67396
|
+
});
|
|
67397
|
+
}
|
|
67398
|
+
if (stale.length > 0) {
|
|
67399
|
+
findings.push({
|
|
67400
|
+
layer: "L3",
|
|
67401
|
+
code: FINDING_CODES.L3_AC_REQUIREMENT_COVERAGE,
|
|
67402
|
+
severity: "warning",
|
|
67403
|
+
section: "Acceptance Criteria",
|
|
67404
|
+
message: `Acceptance Criteria scenarios cite requirements that do not exist: ${stale.map((id) => `R${id}`).join(", ")} \u2014 the AC is stale relative to Requirements`
|
|
67405
|
+
});
|
|
67406
|
+
}
|
|
67407
|
+
}
|
|
67408
|
+
}
|
|
66208
67409
|
const solBody = doc2.getSection("Solution");
|
|
66209
67410
|
if (solBody !== null && !isPlaceholderBody(solBody)) {
|
|
66210
67411
|
const hasFileLine = /`[^`]+?:\d+(-\d+)?`/.test(solBody) || /[^\s`]\.\w+:\d+/.test(solBody);
|
|
@@ -66380,7 +67581,7 @@ var init_task_check = __esm(() => {
|
|
|
66380
67581
|
const kids = await this.findChildren(tasksDir, wbs);
|
|
66381
67582
|
if (kids.length === 0)
|
|
66382
67583
|
return;
|
|
66383
|
-
const closed = (
|
|
67584
|
+
const closed = (s2) => s2 === "done" || s2 === "cancelled";
|
|
66384
67585
|
const parentClosed = closed(status);
|
|
66385
67586
|
const openKids = kids.filter((c3) => !closed(c3.status));
|
|
66386
67587
|
if (parentClosed && openKids.length > 0) {
|
|
@@ -66670,8 +67871,8 @@ var init_task_check = __esm(() => {
|
|
|
66670
67871
|
});
|
|
66671
67872
|
|
|
66672
67873
|
// ../../packages/app/src/services/task-record.ts
|
|
66673
|
-
function escapeTablePipe(
|
|
66674
|
-
return
|
|
67874
|
+
function escapeTablePipe(s2) {
|
|
67875
|
+
return s2.replace(/\|/g, "\\|");
|
|
66675
67876
|
}
|
|
66676
67877
|
function parseVerdict(raw, fallbackWbs) {
|
|
66677
67878
|
if (raw.trim() === "") {
|
|
@@ -66970,8 +68171,8 @@ function patchFrontmatterField(rendered, key, value) {
|
|
|
66970
68171
|
return `${before}${key}: ${value}
|
|
66971
68172
|
${fm}${after}`;
|
|
66972
68173
|
}
|
|
66973
|
-
function escapeRegex2(
|
|
66974
|
-
return
|
|
68174
|
+
function escapeRegex2(s2) {
|
|
68175
|
+
return s2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
66975
68176
|
}
|
|
66976
68177
|
function renderCreatedTaskContent(params) {
|
|
66977
68178
|
let content = renderTaskTemplate(params.rawTemplate, {
|
|
@@ -67195,7 +68396,8 @@ class TaskService {
|
|
|
67195
68396
|
parent_wbs: true,
|
|
67196
68397
|
priority: true,
|
|
67197
68398
|
done_forced: true,
|
|
67198
|
-
done_reason: true
|
|
68399
|
+
done_reason: true,
|
|
68400
|
+
ac_numbering: true
|
|
67199
68401
|
};
|
|
67200
68402
|
if (!(key in allowed)) {
|
|
67201
68403
|
throw new Error(`Field "${key}" is not settable via update; allowed: ${Object.keys(allowed).join(", ")}.`);
|
|
@@ -67282,7 +68484,7 @@ class TaskService {
|
|
|
67282
68484
|
added: [],
|
|
67283
68485
|
matrix: { required: [...required2], optional: [...optional2], forbidden: [...forbidden] },
|
|
67284
68486
|
present,
|
|
67285
|
-
missing: required2.filter((
|
|
68487
|
+
missing: required2.filter((s2) => !present.includes(s2)),
|
|
67286
68488
|
warnings: []
|
|
67287
68489
|
};
|
|
67288
68490
|
}
|
|
@@ -67316,7 +68518,7 @@ class TaskService {
|
|
|
67316
68518
|
warnings: result.warnings ?? []
|
|
67317
68519
|
};
|
|
67318
68520
|
}
|
|
67319
|
-
const missing = required2.filter((
|
|
68521
|
+
const missing = required2.filter((s2) => !present.includes(s2));
|
|
67320
68522
|
if (missing.length === 0) {
|
|
67321
68523
|
return {
|
|
67322
68524
|
op: "init",
|
|
@@ -67329,15 +68531,15 @@ class TaskService {
|
|
|
67329
68531
|
}
|
|
67330
68532
|
const written = [];
|
|
67331
68533
|
let last;
|
|
67332
|
-
for (const
|
|
67333
|
-
const body = renderSectionGuidanceBody(
|
|
68534
|
+
for (const s2 of missing) {
|
|
68535
|
+
const body = renderSectionGuidanceBody(s2);
|
|
67334
68536
|
try {
|
|
67335
|
-
last = await this.writeService.updateSection(ref,
|
|
68537
|
+
last = await this.writeService.updateSection(ref, s2, body);
|
|
67336
68538
|
} catch (err) {
|
|
67337
68539
|
const landed = written.length > 0 ? written.join(", ") : "(none)";
|
|
67338
|
-
throw new Error(`init failed while writing section "${
|
|
68540
|
+
throw new Error(`init failed while writing section "${s2}"; sections already written: ${landed}. ` + `Re-run init to complete the rest (it is idempotent). Cause: ${String(err)}`);
|
|
67339
68541
|
}
|
|
67340
|
-
written.push(
|
|
68542
|
+
written.push(s2);
|
|
67341
68543
|
}
|
|
67342
68544
|
return {
|
|
67343
68545
|
op: "init",
|
|
@@ -68400,7 +69602,7 @@ class TeamService {
|
|
|
68400
69602
|
}
|
|
68401
69603
|
const agentConfig = config4?.agent;
|
|
68402
69604
|
const specs = await loadAgentSpecs(this.configDir);
|
|
68403
|
-
const existingTeamSpecs = specs.filter((
|
|
69605
|
+
const existingTeamSpecs = specs.filter((s2) => s2.tags?.includes(`team:${teamId}`) && s2.tags?.includes("spur:generated"));
|
|
68404
69606
|
const desiredMembers = teamConfig.members.map((m) => normalizeMember(m));
|
|
68405
69607
|
const desiredIds = new Set;
|
|
68406
69608
|
const toUpsert = [];
|
|
@@ -68408,7 +69610,7 @@ class TeamService {
|
|
|
68408
69610
|
const localId = member.id ?? member.executor;
|
|
68409
69611
|
const composedId = `${teamId}-${localId}`;
|
|
68410
69612
|
desiredIds.add(composedId);
|
|
68411
|
-
const existing = specs.find((
|
|
69613
|
+
const existing = specs.find((s2) => s2.id === composedId);
|
|
68412
69614
|
if (existing && !existing.tags?.includes("spur:generated"))
|
|
68413
69615
|
continue;
|
|
68414
69616
|
const resolved = resolveExecutor(member.executor, agentConfig);
|
|
@@ -68429,12 +69631,12 @@ class TeamService {
|
|
|
68429
69631
|
};
|
|
68430
69632
|
toUpsert.push(spec);
|
|
68431
69633
|
}
|
|
68432
|
-
const orphaned = existingTeamSpecs.filter((
|
|
69634
|
+
const orphaned = existingTeamSpecs.filter((s2) => !desiredIds.has(s2.id));
|
|
68433
69635
|
if (opts?.check) {
|
|
68434
69636
|
return {
|
|
68435
69637
|
teamId,
|
|
68436
|
-
upserted: toUpsert.map((
|
|
68437
|
-
orphaned: orphaned.map((
|
|
69638
|
+
upserted: toUpsert.map((s2) => s2.id),
|
|
69639
|
+
orphaned: orphaned.map((s2) => s2.id),
|
|
68438
69640
|
written: false
|
|
68439
69641
|
};
|
|
68440
69642
|
}
|
|
@@ -68446,8 +69648,8 @@ class TeamService {
|
|
|
68446
69648
|
}
|
|
68447
69649
|
const result = {
|
|
68448
69650
|
teamId,
|
|
68449
|
-
upserted: toUpsert.map((
|
|
68450
|
-
orphaned: orphaned.map((
|
|
69651
|
+
upserted: toUpsert.map((s2) => s2.id),
|
|
69652
|
+
orphaned: orphaned.map((s2) => s2.id),
|
|
68451
69653
|
written: true
|
|
68452
69654
|
};
|
|
68453
69655
|
this.emitTeamLifecycleEvent("team.up", {
|
|
@@ -68459,8 +69661,8 @@ class TeamService {
|
|
|
68459
69661
|
}
|
|
68460
69662
|
async teardownTeam(teamId, opts) {
|
|
68461
69663
|
const specs = await loadAgentSpecs(this.configDir);
|
|
68462
|
-
const teamSpecs = specs.filter((
|
|
68463
|
-
const generated = teamSpecs.filter((
|
|
69664
|
+
const teamSpecs = specs.filter((s2) => s2.tags?.includes(`team:${teamId}`));
|
|
69665
|
+
const generated = teamSpecs.filter((s2) => s2.tags?.includes("spur:generated"));
|
|
68464
69666
|
if (opts?.purge) {
|
|
68465
69667
|
for (const spec of generated) {
|
|
68466
69668
|
await deleteAgentSpec(spec.id, this.configDir);
|
|
@@ -68468,8 +69670,8 @@ class TeamService {
|
|
|
68468
69670
|
}
|
|
68469
69671
|
const result = {
|
|
68470
69672
|
teamId,
|
|
68471
|
-
purged: opts?.purge ? generated.map((
|
|
68472
|
-
stopped: teamSpecs.map((
|
|
69673
|
+
purged: opts?.purge ? generated.map((s2) => s2.id) : [],
|
|
69674
|
+
stopped: teamSpecs.map((s2) => s2.id)
|
|
68473
69675
|
};
|
|
68474
69676
|
this.emitTeamLifecycleEvent("team.down", {
|
|
68475
69677
|
teamId,
|
|
@@ -68516,7 +69718,7 @@ class TeamService {
|
|
|
68516
69718
|
async resolveMemberIdentity(agentId) {
|
|
68517
69719
|
try {
|
|
68518
69720
|
const specs = await loadAgentSpecs(this.configDir);
|
|
68519
|
-
const spec = specs.find((
|
|
69721
|
+
const spec = specs.find((s2) => s2.id === agentId);
|
|
68520
69722
|
if (!spec)
|
|
68521
69723
|
return { teamId: null, agentType: null };
|
|
68522
69724
|
const teamTag = spec.tags?.find((t) => t.startsWith("team:"));
|
|
@@ -68582,7 +69784,7 @@ function resolveAutostartSet(config4, envAutostart) {
|
|
|
68582
69784
|
}
|
|
68583
69785
|
}
|
|
68584
69786
|
if (envAutostart) {
|
|
68585
|
-
for (const id of envAutostart.split(",").map((
|
|
69787
|
+
for (const id of envAutostart.split(",").map((s2) => s2.trim()).filter(Boolean)) {
|
|
68586
69788
|
ids.add(id);
|
|
68587
69789
|
}
|
|
68588
69790
|
}
|
|
@@ -69211,6 +70413,7 @@ class AgentRunActionRunner {
|
|
|
69211
70413
|
actionId
|
|
69212
70414
|
},
|
|
69213
70415
|
...observer !== undefined ? { observer } : {},
|
|
70416
|
+
heartbeatMs: AGENT_RUN_PROGRESS_INTERVAL_MS,
|
|
69214
70417
|
...steeringSignal !== undefined ? { signal: steeringSignal } : {}
|
|
69215
70418
|
});
|
|
69216
70419
|
if (this.steeringController === undefined)
|
|
@@ -69373,6 +70576,36 @@ function asOptionalNumber(value) {
|
|
|
69373
70576
|
}
|
|
69374
70577
|
return;
|
|
69375
70578
|
}
|
|
70579
|
+
function extractCompletedRequirementsHeuristic(taskMarkdown) {
|
|
70580
|
+
const found = new Set;
|
|
70581
|
+
const planMatch = taskMarkdown.match(/^#{2,3}\s+Plan\s*$/m);
|
|
70582
|
+
if (planMatch) {
|
|
70583
|
+
const rest = taskMarkdown.slice((planMatch.index ?? 0) + planMatch[0].length);
|
|
70584
|
+
const nextSection = rest.match(/^#{2,3}\s+/m);
|
|
70585
|
+
const planBody = nextSection ? rest.slice(0, nextSection.index ?? 0) : rest;
|
|
70586
|
+
const xItems = planBody.match(/^\s*-\s*\[x\]\s*(.+)$/gim);
|
|
70587
|
+
if (xItems) {
|
|
70588
|
+
for (const item of xItems) {
|
|
70589
|
+
const text4 = item.replace(/^\s*-\s*\[x\]\s*/i, "").trim();
|
|
70590
|
+
if (text4)
|
|
70591
|
+
found.add(`- [x] ${text4}`);
|
|
70592
|
+
}
|
|
70593
|
+
}
|
|
70594
|
+
}
|
|
70595
|
+
const solutionMatch = taskMarkdown.match(/^#{2,3}\s+Solution\s*$/m);
|
|
70596
|
+
if (solutionMatch) {
|
|
70597
|
+
const rest = taskMarkdown.slice((solutionMatch.index ?? 0) + solutionMatch[0].length);
|
|
70598
|
+
const nextSection = rest.match(/^#{2,3}\s+/m);
|
|
70599
|
+
const solutionBody = nextSection ? rest.slice(0, nextSection.index ?? 0) : rest;
|
|
70600
|
+
const rMatches = solutionBody.match(/\bR\d+\b/g);
|
|
70601
|
+
if (rMatches) {
|
|
70602
|
+
for (const r of [...new Set(rMatches)].sort()) {
|
|
70603
|
+
found.add(r);
|
|
70604
|
+
}
|
|
70605
|
+
}
|
|
70606
|
+
}
|
|
70607
|
+
return found.size > 0 ? [...found] : ["unknown \u2014 Solution empty and Plan checkboxes open"];
|
|
70608
|
+
}
|
|
69376
70609
|
async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd) {
|
|
69377
70610
|
try {
|
|
69378
70611
|
const signal = traced.signal;
|
|
@@ -69383,6 +70616,31 @@ async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd
|
|
|
69383
70616
|
const headerLine = model !== undefined ? `${agentLabel} (model: ${model})` : agentLabel;
|
|
69384
70617
|
const inv = traced.invocation;
|
|
69385
70618
|
const argvLine = inv ? `${inv.command} ${inv.argv.join(" ")}` : "(invocation not captured)";
|
|
70619
|
+
let completedSection = "";
|
|
70620
|
+
const wbs = String(context4.vars.wbs ?? "");
|
|
70621
|
+
if (wbs) {
|
|
70622
|
+
try {
|
|
70623
|
+
const fs4 = createNodeFileSystem3(cwd);
|
|
70624
|
+
const locator = TaskLocator.forDirs(fs4, [
|
|
70625
|
+
join15(cwd, "docs", "tasks3"),
|
|
70626
|
+
join15(cwd, "docs", "tasks2"),
|
|
70627
|
+
join15(cwd, "docs", "tasks")
|
|
70628
|
+
]);
|
|
70629
|
+
const hit = await locator.findByWbs(wbs);
|
|
70630
|
+
if (hit) {
|
|
70631
|
+
const taskMarkdown = await fs4.readFile(hit.filePath);
|
|
70632
|
+
const completed = extractCompletedRequirementsHeuristic(taskMarkdown);
|
|
70633
|
+
completedSection = [
|
|
70634
|
+
"",
|
|
70635
|
+
"## completed requirements (heuristic)",
|
|
70636
|
+
"",
|
|
70637
|
+
...completed.map((l) => l.startsWith("-") ? l : `- ${l}`),
|
|
70638
|
+
""
|
|
70639
|
+
].join(`
|
|
70640
|
+
`);
|
|
70641
|
+
}
|
|
70642
|
+
} catch {}
|
|
70643
|
+
}
|
|
69386
70644
|
const body = [
|
|
69387
70645
|
`# Partial-work handoff \u2014 ${headerLine}`,
|
|
69388
70646
|
"",
|
|
@@ -69418,7 +70676,7 @@ async function writePartialWorkArtifact(context4, agentLabel, model, traced, cwd
|
|
|
69418
70676
|
"```",
|
|
69419
70677
|
stderrTail || "(empty)",
|
|
69420
70678
|
"```",
|
|
69421
|
-
|
|
70679
|
+
completedSection
|
|
69422
70680
|
].join(`
|
|
69423
70681
|
`);
|
|
69424
70682
|
const target = join15(cwd, ".spur", "run", `${context4.runId}-${context4.stateOrNodeId}-partial.md`);
|
|
@@ -69464,9 +70722,10 @@ function tail(text4, maxChars) {
|
|
|
69464
70722
|
return `... (truncated) ...
|
|
69465
70723
|
${text4.slice(text4.length - maxChars)}`;
|
|
69466
70724
|
}
|
|
69467
|
-
var PARTIAL_ARTIFACT_TAIL_CHARS = 4000, KIND = "agent.run";
|
|
70725
|
+
var PARTIAL_ARTIFACT_TAIL_CHARS = 4000, AGENT_RUN_PROGRESS_INTERVAL_MS = 30000, KIND = "agent.run";
|
|
69468
70726
|
var init_agent_run = __esm(() => {
|
|
69469
70727
|
init_dist5();
|
|
70728
|
+
init_task_locator();
|
|
69470
70729
|
init_steering();
|
|
69471
70730
|
});
|
|
69472
70731
|
|
|
@@ -69938,7 +71197,7 @@ function asString6(value) {
|
|
|
69938
71197
|
var KIND9 = "response.validate";
|
|
69939
71198
|
|
|
69940
71199
|
// ../../packages/app/src/workflow/utils.ts
|
|
69941
|
-
var identity6 = (
|
|
71200
|
+
var identity6 = (s2) => s2, NO_COLOR;
|
|
69942
71201
|
var init_utils3 = __esm(() => {
|
|
69943
71202
|
NO_COLOR = {
|
|
69944
71203
|
enabled: false,
|
|
@@ -71255,19 +72514,19 @@ var {
|
|
|
71255
72514
|
init_src();
|
|
71256
72515
|
init_loader();
|
|
71257
72516
|
|
|
71258
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72517
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
71259
72518
|
init_dist4();
|
|
71260
72519
|
init_dist5();
|
|
71261
72520
|
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
|
|
71262
72521
|
import { dirname as dirname5 } from "path";
|
|
71263
72522
|
|
|
71264
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72523
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
71265
72524
|
init_default_observers();
|
|
71266
72525
|
init_event_bus();
|
|
71267
72526
|
init_file_observer();
|
|
71268
72527
|
init_logger3();
|
|
71269
72528
|
|
|
71270
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72529
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
|
|
71271
72530
|
class NoopSchedulerAdapter {
|
|
71272
72531
|
constructor() {}
|
|
71273
72532
|
register(_cron, _action) {}
|
|
@@ -71275,7 +72534,7 @@ class NoopSchedulerAdapter {
|
|
|
71275
72534
|
async stop() {}
|
|
71276
72535
|
}
|
|
71277
72536
|
|
|
71278
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72537
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
|
|
71279
72538
|
function initScheduler(adapter, cronEntries) {
|
|
71280
72539
|
const resolved = adapter ?? new NoopSchedulerAdapter;
|
|
71281
72540
|
if (cronEntries) {
|
|
@@ -71286,7 +72545,7 @@ function initScheduler(adapter, cronEntries) {
|
|
|
71286
72545
|
return resolved;
|
|
71287
72546
|
}
|
|
71288
72547
|
|
|
71289
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72548
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
|
|
71290
72549
|
init_logger3();
|
|
71291
72550
|
init_metrics();
|
|
71292
72551
|
init_sdk();
|
|
@@ -71379,7 +72638,7 @@ function dbPlugin(db2) {
|
|
|
71379
72638
|
};
|
|
71380
72639
|
}
|
|
71381
72640
|
|
|
71382
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72641
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
|
|
71383
72642
|
init_logger3();
|
|
71384
72643
|
|
|
71385
72644
|
class PluginHost {
|
|
@@ -71467,7 +72726,7 @@ class PluginHost {
|
|
|
71467
72726
|
}
|
|
71468
72727
|
}
|
|
71469
72728
|
|
|
71470
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72729
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
71471
72730
|
async function performShutdown(state, reason) {
|
|
71472
72731
|
if (state.stopped)
|
|
71473
72732
|
return;
|
|
@@ -71578,10 +72837,10 @@ async function runApplication(options) {
|
|
|
71578
72837
|
}
|
|
71579
72838
|
}
|
|
71580
72839
|
|
|
71581
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72840
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
71582
72841
|
init_scheduler_node();
|
|
71583
72842
|
|
|
71584
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
72843
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
71585
72844
|
var import_api14 = __toESM(require_src(), 1);
|
|
71586
72845
|
|
|
71587
72846
|
// ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
|
|
@@ -74597,7 +75856,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
|
|
|
74597
75856
|
}), JsonTraceSerializer));
|
|
74598
75857
|
}
|
|
74599
75858
|
}
|
|
74600
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
75859
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
74601
75860
|
var import_resources2 = __toESM(require_src4(), 1);
|
|
74602
75861
|
var import_sdk_trace_node = __toESM(require_src8(), 1);
|
|
74603
75862
|
var import_semantic_conventions = __toESM(require_src2(), 1);
|
|
@@ -74648,7 +75907,7 @@ async function shutdownNodeTelemetry() {
|
|
|
74648
75907
|
await Promise.all(pending);
|
|
74649
75908
|
}
|
|
74650
75909
|
|
|
74651
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
75910
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.22+8dad431b1c8f298c/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
74652
75911
|
class ConfigValidationError extends Error {
|
|
74653
75912
|
constructor(message) {
|
|
74654
75913
|
super(message);
|
|
@@ -79217,7 +80476,7 @@ init_src3();
|
|
|
79217
80476
|
init_src2();
|
|
79218
80477
|
function registerHistoryCommand(program2, context4) {
|
|
79219
80478
|
const noun = program2.command("history").summary("import and analyze coding-agent history");
|
|
79220
|
-
noun.command("import").description("Import agent conversation JSONL.").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw", "pi").option("--file <path>", "Import one JSONL file").option("--root <path>", "Scan a history root").option("--mode <mode>", "full|incremental|force-file").option("--dry-run", "Scan without persisting imported records").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
|
|
80479
|
+
noun.command("import").description("Import agent conversation JSONL.").option("--source <source>", "pi|claude|codex|gemini|opencode|antigravity|openclaw|omp|grok|agy", "pi").option("--file <path>", "Import one JSONL file").option("--root <path>", "Scan a history root").option("--mode <mode>", "full|incremental|force-file").option("--dry-run", "Scan without persisting imported records").option("--json", "Output machine-readable JSON where supported").action(async (options) => {
|
|
79221
80480
|
const svc = new HistoryService({ getDb: () => context4.getDb() });
|
|
79222
80481
|
const r = await svc.import(options.source ?? "pi", {
|
|
79223
80482
|
file: options.file || undefined,
|
|
@@ -79251,6 +80510,7 @@ function formatImportResult(r) {
|
|
|
79251
80510
|
`lines: ${r.processedLines}`,
|
|
79252
80511
|
`imported: ${r.importedRecords}`,
|
|
79253
80512
|
`duplicates: ${r.skippedDuplicates}`,
|
|
80513
|
+
`unknown: ${r.unknownRecords}`,
|
|
79254
80514
|
`parse_errors: ${r.parseErrors.length}`,
|
|
79255
80515
|
`validation_errors: ${r.validationErrors.length}`
|
|
79256
80516
|
].join(`
|
|
@@ -79268,7 +80528,7 @@ import { join as join19, resolve as resolve6 } from "path";
|
|
|
79268
80528
|
var CLI_CONFIG = {
|
|
79269
80529
|
binaryName: "spur",
|
|
79270
80530
|
binaryLabel: "spur",
|
|
79271
|
-
binaryVersion: "0.3.
|
|
80531
|
+
binaryVersion: "0.3.35",
|
|
79272
80532
|
configDir: ".spur",
|
|
79273
80533
|
configFile: ".spur/config.yaml",
|
|
79274
80534
|
databaseFile: ".spur/spur.db"
|
|
@@ -82797,8 +84057,8 @@ function createRouter() {
|
|
|
82797
84057
|
};
|
|
82798
84058
|
}
|
|
82799
84059
|
function splitPath(path9) {
|
|
82800
|
-
const [_, ...
|
|
82801
|
-
return
|
|
84060
|
+
const [_, ...s2] = path9.split("/");
|
|
84061
|
+
return s2[s2.length - 1] === "" ? s2.slice(0, -1) : s2;
|
|
82802
84062
|
}
|
|
82803
84063
|
function getMatchParams(segments, paramsMap) {
|
|
82804
84064
|
const params = new NullProtoObj2;
|
|
@@ -85482,7 +86742,7 @@ var requestLogger = (appRt) => async function requestLoggerMiddleware(c3, next)
|
|
|
85482
86742
|
};
|
|
85483
86743
|
|
|
85484
86744
|
// ../server/src/middleware/pipeline.ts
|
|
85485
|
-
var trimOrigins = (origins) => origins.split(",").map((
|
|
86745
|
+
var trimOrigins = (origins) => origins.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
85486
86746
|
function mountMiddleware(app, appRt) {
|
|
85487
86747
|
const corsOrigins = process.env.SPUR_CORS_ORIGINS ? trimOrigins(process.env.SPUR_CORS_ORIGINS) : [];
|
|
85488
86748
|
app.use("*", secureHeaders());
|
|
@@ -85574,7 +86834,7 @@ function decodeHistoryCursor(encoded) {
|
|
|
85574
86834
|
function parseHistoryNamesParam(raw2) {
|
|
85575
86835
|
if (raw2 === undefined)
|
|
85576
86836
|
return;
|
|
85577
|
-
const parts = (Array.isArray(raw2) ? raw2 : [raw2]).flatMap((chunk) => chunk.split(",")).map((
|
|
86837
|
+
const parts = (Array.isArray(raw2) ? raw2 : [raw2]).flatMap((chunk) => chunk.split(",")).map((s2) => s2.trim()).filter((s2) => s2.length > 0);
|
|
85578
86838
|
return parts.length > 0 ? parts : undefined;
|
|
85579
86839
|
}
|
|
85580
86840
|
function extractSystemEventActor2(event2) {
|
|
@@ -87045,8 +88305,8 @@ var TypeName;
|
|
|
87045
88305
|
|
|
87046
88306
|
// ../../node_modules/.bun/@orpc+openapi@1.14.4+a904a9933278b24d/node_modules/@orpc/openapi/dist/shared/openapi.BwdtJjDu.mjs
|
|
87047
88307
|
var OPERATION_EXTENDER_SYMBOL = Symbol("ORPC_OPERATION_EXTENDER");
|
|
87048
|
-
function getCustomOpenAPIOperation(
|
|
87049
|
-
return
|
|
88308
|
+
function getCustomOpenAPIOperation(o3) {
|
|
88309
|
+
return o3[OPERATION_EXTENDER_SYMBOL];
|
|
87050
88310
|
}
|
|
87051
88311
|
function applyCustomOpenAPIOperation(operation, contract2) {
|
|
87052
88312
|
const operationCustoms = [];
|
|
@@ -87213,7 +88473,7 @@ function filterSchemaBranches(schema4, check2, matches = []) {
|
|
|
87213
88473
|
if (isObject5(schema4)) {
|
|
87214
88474
|
for (const keyword of ["anyOf", "oneOf"]) {
|
|
87215
88475
|
if (schema4[keyword] && Object.keys(schema4).every((k) => k === keyword || !LOGIC_KEYWORDS.includes(k))) {
|
|
87216
|
-
const rest = schema4[keyword].map((
|
|
88476
|
+
const rest = schema4[keyword].map((s2) => filterSchemaBranches(s2, check2, matches)[1]).filter((v) => !!v);
|
|
87217
88477
|
if (rest.length === 1 && typeof rest[0] === "object") {
|
|
87218
88478
|
return [matches, { ...schema4, [keyword]: undefined, ...rest[0] }];
|
|
87219
88479
|
}
|
|
@@ -87238,7 +88498,7 @@ function expandUnionSchema(schema4) {
|
|
|
87238
88498
|
if (typeof schema4 === "object") {
|
|
87239
88499
|
for (const keyword of ["anyOf", "oneOf"]) {
|
|
87240
88500
|
if (schema4[keyword] && Object.keys(schema4).every((k) => k === keyword || !LOGIC_KEYWORDS.includes(k))) {
|
|
87241
|
-
return schema4[keyword].flatMap((
|
|
88501
|
+
return schema4[keyword].flatMap((s2) => expandUnionSchema(s2));
|
|
87242
88502
|
}
|
|
87243
88503
|
}
|
|
87244
88504
|
}
|
|
@@ -87249,12 +88509,12 @@ function expandArrayableSchema(schema4) {
|
|
|
87249
88509
|
if (schemas3.length !== 2) {
|
|
87250
88510
|
return;
|
|
87251
88511
|
}
|
|
87252
|
-
const arraySchema = schemas3.find((
|
|
88512
|
+
const arraySchema = schemas3.find((s2) => typeof s2 === "object" && s2.type === "array" && Object.keys(s2).filter((k) => LOGIC_KEYWORDS.includes(k)).every((k) => k === "type" || k === "items"));
|
|
87253
88513
|
if (arraySchema === undefined) {
|
|
87254
88514
|
return;
|
|
87255
88515
|
}
|
|
87256
88516
|
const items1 = arraySchema.items;
|
|
87257
|
-
const items2 = schemas3.find((
|
|
88517
|
+
const items2 = schemas3.find((s2) => s2 !== arraySchema);
|
|
87258
88518
|
if (stringifyJSON(items1) !== stringifyJSON(items2)) {
|
|
87259
88519
|
return;
|
|
87260
88520
|
}
|
|
@@ -87268,14 +88528,14 @@ var PRIMITIVE_SCHEMA_TYPES = /* @__PURE__ */ new Set([
|
|
|
87268
88528
|
TypeName.Null
|
|
87269
88529
|
]);
|
|
87270
88530
|
function isPrimitiveSchema(schema4) {
|
|
87271
|
-
return expandUnionSchema(schema4).every((
|
|
87272
|
-
if (typeof
|
|
88531
|
+
return expandUnionSchema(schema4).every((s2) => {
|
|
88532
|
+
if (typeof s2 === "boolean") {
|
|
87273
88533
|
return false;
|
|
87274
88534
|
}
|
|
87275
|
-
if (typeof
|
|
88535
|
+
if (typeof s2.type === "string" && PRIMITIVE_SCHEMA_TYPES.has(s2.type)) {
|
|
87276
88536
|
return true;
|
|
87277
88537
|
}
|
|
87278
|
-
if (
|
|
88538
|
+
if (s2.const !== undefined) {
|
|
87279
88539
|
return true;
|
|
87280
88540
|
}
|
|
87281
88541
|
return false;
|
|
@@ -87407,8 +88667,8 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
|
|
|
87407
88667
|
return schema4;
|
|
87408
88668
|
}
|
|
87409
88669
|
const unionSchemas = [
|
|
87410
|
-
...toArray(schema4.anyOf?.map((
|
|
87411
|
-
...toArray(schema4.oneOf?.map((
|
|
88670
|
+
...toArray(schema4.anyOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2))),
|
|
88671
|
+
...toArray(schema4.oneOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2)))
|
|
87412
88672
|
];
|
|
87413
88673
|
const objectUnionSchemas = [];
|
|
87414
88674
|
for (const u2 of unionSchemas) {
|
|
@@ -87423,7 +88683,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
|
|
|
87423
88683
|
for (const [key, value2] of Object.entries(u2.properties)) {
|
|
87424
88684
|
let entry = mergedUnionPropertyMap.get(key);
|
|
87425
88685
|
if (!entry) {
|
|
87426
|
-
const required2 = objectUnionSchemas.every((
|
|
88686
|
+
const required2 = objectUnionSchemas.every((s2) => s2.required?.includes(key));
|
|
87427
88687
|
entry = { required: required2, schemas: [] };
|
|
87428
88688
|
mergedUnionPropertyMap.set(key, entry);
|
|
87429
88689
|
}
|
|
@@ -87431,7 +88691,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
|
|
|
87431
88691
|
}
|
|
87432
88692
|
}
|
|
87433
88693
|
}
|
|
87434
|
-
const intersectionSchemas = toArray(schema4.allOf?.map((
|
|
88694
|
+
const intersectionSchemas = toArray(schema4.allOf?.map((s2) => simplifyComposedObjectJsonSchemasAndRefs(s2, doc2)));
|
|
87435
88695
|
const objectIntersectionSchemas = [];
|
|
87436
88696
|
for (const u2 of intersectionSchemas) {
|
|
87437
88697
|
if (!isObjectSchema(u2)) {
|
|
@@ -87448,7 +88708,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema4, doc2) {
|
|
|
87448
88708
|
for (const [key, value2] of Object.entries(u2.properties)) {
|
|
87449
88709
|
let entry = mergedInteractionPropertyMap.get(key);
|
|
87450
88710
|
if (!entry) {
|
|
87451
|
-
const required2 = objectIntersectionSchemas.some((
|
|
88711
|
+
const required2 = objectIntersectionSchemas.some((s2) => s2.required?.includes(key));
|
|
87452
88712
|
entry = { required: required2, schemas: [] };
|
|
87453
88713
|
mergedInteractionPropertyMap.set(key, entry);
|
|
87454
88714
|
}
|
|
@@ -88297,8 +89557,8 @@ class experimental_ZodSmartCoercionPlugin {
|
|
|
88297
89557
|
}
|
|
88298
89558
|
if (Array.isArray(value2)) {
|
|
88299
89559
|
return value2.map((v, i2) => {
|
|
88300
|
-
const
|
|
88301
|
-
return
|
|
89560
|
+
const s2 = tuple2._zod.def.items[i2] ?? tuple2._zod.def.rest;
|
|
89561
|
+
return s2 ? this.#coerce(s2, v) : v;
|
|
88302
89562
|
});
|
|
88303
89563
|
}
|
|
88304
89564
|
return value2;
|
|
@@ -88328,8 +89588,8 @@ class experimental_ZodSmartCoercionPlugin {
|
|
|
88328
89588
|
...Object.keys(object3._zod.def.shape)
|
|
88329
89589
|
]);
|
|
88330
89590
|
for (const k of keys) {
|
|
88331
|
-
const
|
|
88332
|
-
newObj[k] =
|
|
89591
|
+
const s2 = object3._zod.def.shape[k] ?? object3._zod.def.catchall;
|
|
89592
|
+
newObj[k] = s2 ? this.#coerce(s2, value2[k]) : value2[k];
|
|
88333
89593
|
}
|
|
88334
89594
|
return newObj;
|
|
88335
89595
|
}
|
|
@@ -88937,7 +90197,7 @@ function createRouter2(ctx) {
|
|
|
88937
90197
|
function serverBootstrapConfig(env) {
|
|
88938
90198
|
const isTest = env.NODE_ENV === "test";
|
|
88939
90199
|
const raw2 = env.SPUR_TEAM_AUTOSTART;
|
|
88940
|
-
const teamAutostart = raw2 ? raw2.split(",").map((
|
|
90200
|
+
const teamAutostart = raw2 ? raw2.split(",").map((s2) => s2.trim()).filter((s2) => s2.length > 0) : [];
|
|
88941
90201
|
const diagnosticEvents = env.SPUR_DIAGNOSTIC_EVENTS === "1" || env.SPUR_DIAGNOSTIC_EVENTS === "true";
|
|
88942
90202
|
const retentionDefault = parseRetentionNumber(env.SPUR_EVENT_RETENTION_DEFAULT);
|
|
88943
90203
|
const retentionPrefixes = parseRetentionPrefixes(env);
|
|
@@ -90452,7 +91712,7 @@ ${result.content}`);
|
|
|
90452
91712
|
context4.setExitCode(1);
|
|
90453
91713
|
}
|
|
90454
91714
|
});
|
|
90455
|
-
task.command("update").summary("Update a task status or replace a section.").argument("<wbs>", "Task WBS number").argument("[status]", "New status (for lifecycle transition)").option("--section <name>", "Section name to replace").option("--from-file <path>", "File to read section body from (requires --section)").option("--feature <id>", "Set the feature_id frontmatter field (traceability edge)").option("--priority <p>", "Set the priority frontmatter field (P0\u2013P3)").option("--no-lifecycle", "Suppress lifecycle workflow run creation (use during pipeline runs to avoid orphaned lifecycle runs)").option("--force-done", "Allow transitioning to `done` even when the verify verdict is not PASS; records an override (task 0292)").option("--reason <text>", "Rationale for a forced-done override (paired with --force-done; persisted as done_reason)").option("--verdict-dir <path>", "Directory holding <wbs>-verdict.json artifacts (default: .spur/run)").option("--folder <path>", "Custom tasks folder").option("--json", "Output machine-readable JSON").action(async (wbs, status, options) => {
|
|
91715
|
+
task.command("update").summary("Update a task status or replace a section.").argument("<wbs>", "Task WBS number").argument("[status]", "New status (for lifecycle transition)").option("--section <name>", "Section name to replace").option("--from-file <path>", "File to read section body from (requires --section)").option("--feature <id>", "Set the feature_id frontmatter field (traceability edge)").option("--priority <p>", "Set the priority frontmatter field (P0\u2013P3)").option("--ac-numbering <mode>", "Set the ac_numbering frontmatter field (task-local) \u2014 opts the task into the Requirements\u2194AC coverage check").option("--no-lifecycle", "Suppress lifecycle workflow run creation (use during pipeline runs to avoid orphaned lifecycle runs)").option("--force-done", "Allow transitioning to `done` even when the verify verdict is not PASS; records an override (task 0292)").option("--reason <text>", "Rationale for a forced-done override (paired with --force-done; persisted as done_reason)").option("--verdict-dir <path>", "Directory holding <wbs>-verdict.json artifacts (default: .spur/run)").option("--folder <path>", "Custom tasks folder").option("--json", "Output machine-readable JSON").action(async (wbs, status, options) => {
|
|
90456
91716
|
const svc = await makeService2(context4, options.folder, options.lifecycle === false);
|
|
90457
91717
|
try {
|
|
90458
91718
|
if (options.section !== undefined) {
|
|
@@ -90470,9 +91730,9 @@ ${result.content}`);
|
|
|
90470
91730
|
}
|
|
90471
91731
|
context4.output.write(`Updated section '${options.section}' in task ${result.ref.id}`);
|
|
90472
91732
|
}
|
|
90473
|
-
} else if (options.feature !== undefined || options.priority !== undefined) {
|
|
90474
|
-
const key = options.feature !== undefined ? "feature_id" : "priority";
|
|
90475
|
-
const value2 = options.feature ?? options.priority ?? "";
|
|
91733
|
+
} else if (options.feature !== undefined || options.priority !== undefined || options.acNumbering !== undefined) {
|
|
91734
|
+
const key = options.feature !== undefined ? "feature_id" : options.priority !== undefined ? "priority" : "ac_numbering";
|
|
91735
|
+
const value2 = options.feature ?? options.priority ?? options.acNumbering ?? "";
|
|
90476
91736
|
const result = await svc.updateField(wbs, key, value2);
|
|
90477
91737
|
if (options.json) {
|
|
90478
91738
|
context4.output.write(toJson2(result));
|
|
@@ -90481,10 +91741,12 @@ ${result.content}`);
|
|
|
90481
91741
|
}
|
|
90482
91742
|
} else if (status !== undefined) {
|
|
90483
91743
|
status = canonicalStatusOrRaw(status);
|
|
90484
|
-
if (
|
|
90485
|
-
const adapter = makeLifecycleAdapter(context4, TASK_LIFECYCLE_PROFILE);
|
|
91744
|
+
if (status === "done" || status === "testing") {
|
|
91745
|
+
const adapter = options.lifecycle === false ? undefined : makeLifecycleAdapter(context4, TASK_LIFECYCLE_PROFILE);
|
|
90486
91746
|
if (adapter === undefined) {
|
|
90487
|
-
|
|
91747
|
+
if (options.lifecycle !== false) {
|
|
91748
|
+
context4.output.error(`warning: lifecycle adapter unavailable \u2014 running \`spur task check\` inline as the ${status} gate. ` + "Restore the bundled task-lifecycle workflow to re-enable the real guard.");
|
|
91749
|
+
}
|
|
90488
91750
|
const ok = await runDoneGateCheck(context4, wbs, options.folder);
|
|
90489
91751
|
if (!ok) {
|
|
90490
91752
|
context4.output.error(`Lifecycle transition blocked: \`spur task check ${wbs}\` failed. Fix the findings before transitioning to ${status}.`);
|
|
@@ -92410,22 +93672,22 @@ function wrapAnsi(string4, columns2, options) {
|
|
|
92410
93672
|
|
|
92411
93673
|
// ../../node_modules/.bun/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
|
|
92412
93674
|
var import_sisteransi = __toESM(require_src9(), 1);
|
|
92413
|
-
function findCursor(
|
|
93675
|
+
function findCursor(s2, o3, l) {
|
|
92414
93676
|
if (!l.some((r2) => !r2.disabled))
|
|
92415
|
-
return
|
|
92416
|
-
const t =
|
|
92417
|
-
return l[e].disabled ? findCursor(e,
|
|
93677
|
+
return s2;
|
|
93678
|
+
const t = s2 + o3, n2 = Math.max(l.length - 1, 0), e = t < 0 ? n2 : t > n2 ? 0 : t;
|
|
93679
|
+
return l[e].disabled ? findCursor(e, o3 < 0 ? -1 : 1, l) : e;
|
|
92418
93680
|
}
|
|
92419
|
-
function findTextCursor(
|
|
93681
|
+
function findTextCursor(s2, o3, l, i2) {
|
|
92420
93682
|
const t = i2.split(`
|
|
92421
93683
|
`);
|
|
92422
|
-
let n2 = 0, e =
|
|
93684
|
+
let n2 = 0, e = s2;
|
|
92423
93685
|
for (const r2 of t) {
|
|
92424
93686
|
if (e <= r2.length)
|
|
92425
93687
|
break;
|
|
92426
93688
|
e -= r2.length + 1, n2++;
|
|
92427
93689
|
}
|
|
92428
|
-
for (n2 = Math.max(0, Math.min(t.length - 1, n2 + l)), e = Math.min(e, t[n2].length) +
|
|
93690
|
+
for (n2 = Math.max(0, Math.min(t.length - 1, n2 + l)), e = Math.min(e, t[n2].length) + o3;e < 0 && n2 > 0; )
|
|
92429
93691
|
n2--, e += t[n2].length + 1;
|
|
92430
93692
|
for (;e > t[n2].length && n2 < t.length - 1; )
|
|
92431
93693
|
e -= t[n2].length + 1, n2++;
|
|
@@ -92479,16 +93741,16 @@ var settings = {
|
|
|
92479
93741
|
function isActionKey(n2, e) {
|
|
92480
93742
|
if (typeof n2 == "string")
|
|
92481
93743
|
return settings.aliases.get(n2) === e;
|
|
92482
|
-
for (const
|
|
92483
|
-
if (
|
|
93744
|
+
for (const s2 of n2)
|
|
93745
|
+
if (s2 !== undefined && isActionKey(s2, e))
|
|
92484
93746
|
return true;
|
|
92485
93747
|
return false;
|
|
92486
93748
|
}
|
|
92487
|
-
function diffLines(i2,
|
|
92488
|
-
if (i2 ===
|
|
93749
|
+
function diffLines(i2, s2) {
|
|
93750
|
+
if (i2 === s2)
|
|
92489
93751
|
return;
|
|
92490
93752
|
const e = i2.split(`
|
|
92491
|
-
`), t2 =
|
|
93753
|
+
`), t2 = s2.split(`
|
|
92492
93754
|
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
92493
93755
|
for (let n2 = 0;n2 < r2; n2++)
|
|
92494
93756
|
e[n2] !== t2[n2] && f.push(n2);
|
|
@@ -92505,20 +93767,20 @@ function isCancel(e) {
|
|
|
92505
93767
|
return e === CANCEL_SYMBOL;
|
|
92506
93768
|
}
|
|
92507
93769
|
function setRawMode(e, r2) {
|
|
92508
|
-
const
|
|
92509
|
-
|
|
93770
|
+
const o3 = e;
|
|
93771
|
+
o3.isTTY && o3.setRawMode(r2);
|
|
92510
93772
|
}
|
|
92511
93773
|
var getColumns2 = (e) => ("columns" in e) && typeof e.columns == "number" ? e.columns : 80;
|
|
92512
93774
|
var getRows = (e) => ("rows" in e) && typeof e.rows == "number" ? e.rows : 20;
|
|
92513
|
-
function wrapTextWithPrefix(e, r2,
|
|
93775
|
+
function wrapTextWithPrefix(e, r2, o3, t2 = o3, s2 = o3, n2) {
|
|
92514
93776
|
const f = getColumns2(e ?? stdout);
|
|
92515
|
-
return wrapAnsi(r2, f -
|
|
93777
|
+
return wrapAnsi(r2, f - o3.length, {
|
|
92516
93778
|
hard: true,
|
|
92517
93779
|
trim: false
|
|
92518
93780
|
}).split(`
|
|
92519
93781
|
`).map((c3, i2, m) => {
|
|
92520
93782
|
const d = n2 ? n2(c3, i2) : c3;
|
|
92521
|
-
return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${
|
|
93783
|
+
return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s2}${d}` : `${o3}${d}`;
|
|
92522
93784
|
}).join(`
|
|
92523
93785
|
`);
|
|
92524
93786
|
}
|
|
@@ -92548,8 +93810,8 @@ class V {
|
|
|
92548
93810
|
value;
|
|
92549
93811
|
userInput = "";
|
|
92550
93812
|
constructor(t2, e = true) {
|
|
92551
|
-
const { input: i2 = stdin, output: n2 = stdout, render:
|
|
92552
|
-
this.opts =
|
|
93813
|
+
const { input: i2 = stdin, output: n2 = stdout, render: s2, signal: r2, ...o3 } = t2;
|
|
93814
|
+
this.opts = o3, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s2.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n2;
|
|
92553
93815
|
}
|
|
92554
93816
|
unsubscribe() {
|
|
92555
93817
|
this._subscribers.clear();
|
|
@@ -92566,10 +93828,10 @@ class V {
|
|
|
92566
93828
|
}
|
|
92567
93829
|
emit(t2, ...e) {
|
|
92568
93830
|
const i2 = this._subscribers.get(t2) ?? [], n2 = [];
|
|
92569
|
-
for (const
|
|
92570
|
-
|
|
92571
|
-
for (const
|
|
92572
|
-
|
|
93831
|
+
for (const s2 of i2)
|
|
93832
|
+
s2.cb(...e), s2.once && n2.push(() => i2.splice(i2.indexOf(s2), 1));
|
|
93833
|
+
for (const s2 of n2)
|
|
93834
|
+
s2();
|
|
92573
93835
|
}
|
|
92574
93836
|
prompt() {
|
|
92575
93837
|
return new Promise((t2) => {
|
|
@@ -92638,23 +93900,23 @@ class V {
|
|
|
92638
93900
|
else {
|
|
92639
93901
|
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
92640
93902
|
if (this.restoreCursor(), e) {
|
|
92641
|
-
const n2 = Math.max(0, e.numLinesAfter - i2),
|
|
92642
|
-
let r2 = e.lines.find((
|
|
93903
|
+
const n2 = Math.max(0, e.numLinesAfter - i2), s2 = Math.max(0, e.numLinesBefore - i2);
|
|
93904
|
+
let r2 = e.lines.find((o3) => o3 >= n2);
|
|
92643
93905
|
if (r2 === undefined) {
|
|
92644
93906
|
this._prevFrame = t2;
|
|
92645
93907
|
return;
|
|
92646
93908
|
}
|
|
92647
93909
|
if (e.lines.length === 1) {
|
|
92648
|
-
this.output.write(import_sisteransi.cursor.move(0, r2 -
|
|
92649
|
-
const
|
|
93910
|
+
this.output.write(import_sisteransi.cursor.move(0, r2 - s2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
93911
|
+
const o3 = t2.split(`
|
|
92650
93912
|
`);
|
|
92651
|
-
this.output.write(
|
|
93913
|
+
this.output.write(o3[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o3.length - r2 - 1));
|
|
92652
93914
|
return;
|
|
92653
93915
|
} else if (e.lines.length > 1) {
|
|
92654
|
-
if (n2 <
|
|
93916
|
+
if (n2 < s2)
|
|
92655
93917
|
r2 = n2;
|
|
92656
93918
|
else {
|
|
92657
|
-
const h2 = r2 -
|
|
93919
|
+
const h2 = r2 - s2;
|
|
92658
93920
|
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
92659
93921
|
}
|
|
92660
93922
|
this.output.write(import_sisteransi.erase.down());
|
|
@@ -92674,7 +93936,7 @@ class V {
|
|
|
92674
93936
|
function p$1(l, e) {
|
|
92675
93937
|
if (l === undefined || e.length === 0)
|
|
92676
93938
|
return 0;
|
|
92677
|
-
const i2 = e.findIndex((
|
|
93939
|
+
const i2 = e.findIndex((s2) => s2.value === l);
|
|
92678
93940
|
return i2 !== -1 ? i2 : 0;
|
|
92679
93941
|
}
|
|
92680
93942
|
function g2(l, e) {
|
|
@@ -92715,22 +93977,22 @@ var T$1 = class T extends V {
|
|
|
92715
93977
|
this.filteredOptions = [...t2], this.multiple = e.multiple === true, this.#t = typeof e.options == "function" ? e.filter : e.filter ?? g2;
|
|
92716
93978
|
let i2;
|
|
92717
93979
|
if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i2 = e.initialValue : i2 = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i2 = [this.options[0].value]), i2)
|
|
92718
|
-
for (const
|
|
92719
|
-
const n2 = t2.findIndex((
|
|
92720
|
-
n2 !== -1 && (this.toggleSelected(
|
|
93980
|
+
for (const s2 of i2) {
|
|
93981
|
+
const n2 = t2.findIndex((o3) => o3.value === s2);
|
|
93982
|
+
n2 !== -1 && (this.toggleSelected(s2), this.#e = n2);
|
|
92721
93983
|
}
|
|
92722
|
-
this.focusedValue = this.options[this.#e]?.value, this.on("key", (
|
|
93984
|
+
this.focusedValue = this.options[this.#e]?.value, this.on("key", (s2, n2) => this.#l(s2, n2)), this.on("userInput", (s2) => this.#u(s2));
|
|
92723
93985
|
}
|
|
92724
93986
|
_isActionKey(e, t2) {
|
|
92725
93987
|
return e === "\t" || this.multiple && this.isNavigating && t2.name === "space" && e !== undefined && e !== "";
|
|
92726
93988
|
}
|
|
92727
93989
|
#l(e, t2) {
|
|
92728
|
-
const i2 = t2.name === "up",
|
|
92729
|
-
if (t2.name === "tab" &&
|
|
93990
|
+
const i2 = t2.name === "up", s2 = t2.name === "down", n2 = t2.name === "return", o3 = this.userInput === "" || this.userInput === "\t", u2 = this.#n, h2 = this.options, f = u2 !== undefined && u2 !== "" && h2.some((r2) => !r2.disabled && (this.#t ? this.#t(u2, r2) : true));
|
|
93991
|
+
if (t2.name === "tab" && o3 && f) {
|
|
92730
93992
|
this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u2, true), this.isNavigating = false;
|
|
92731
93993
|
return;
|
|
92732
93994
|
}
|
|
92733
|
-
i2 ||
|
|
93995
|
+
i2 || s2 ? (this.#e = findCursor(this.#e, i2 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n2 ? this.value = m(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t2.name === "tab" || this.isNavigating && t2.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
|
|
92734
93996
|
}
|
|
92735
93997
|
deselectAll() {
|
|
92736
93998
|
this.selectedValues = [];
|
|
@@ -92745,8 +94007,8 @@ var T$1 = class T extends V {
|
|
|
92745
94007
|
e && this.#t ? this.filteredOptions = t2.filter((n2) => this.#t?.(e, n2)) : this.filteredOptions = [...t2];
|
|
92746
94008
|
const i2 = p$1(this.focusedValue, this.filteredOptions);
|
|
92747
94009
|
this.#e = findCursor(i2, 0, this.filteredOptions);
|
|
92748
|
-
const
|
|
92749
|
-
|
|
94010
|
+
const s2 = this.filteredOptions[this.#e];
|
|
94011
|
+
s2 && !s2.disabled ? this.focusedValue = s2.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
92750
94012
|
}
|
|
92751
94013
|
}
|
|
92752
94014
|
};
|
|
@@ -92763,11 +94025,11 @@ function P(r2) {
|
|
|
92763
94025
|
year: "numeric",
|
|
92764
94026
|
month: "2-digit",
|
|
92765
94027
|
day: "2-digit"
|
|
92766
|
-
}).formatToParts(new Date(2000, 0, 15)),
|
|
94028
|
+
}).formatToParts(new Date(2000, 0, 15)), s2 = [];
|
|
92767
94029
|
let n2 = "/";
|
|
92768
94030
|
for (const e of i2)
|
|
92769
|
-
e.type === "literal" ? n2 = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") &&
|
|
92770
|
-
return { segments:
|
|
94031
|
+
e.type === "literal" ? n2 = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") && s2.push({ type: e.type, len: e.type === "year" ? 4 : 2 });
|
|
94032
|
+
return { segments: s2, separator: n2 };
|
|
92771
94033
|
}
|
|
92772
94034
|
function p2(r2) {
|
|
92773
94035
|
return Number.parseInt((r2 || "0").replace(/_/g, "0"), 10) || 0;
|
|
@@ -92783,26 +94045,26 @@ function c3(r2, t2) {
|
|
|
92783
94045
|
return new Date(r2 || 2001, t2 || 1, 0).getDate();
|
|
92784
94046
|
}
|
|
92785
94047
|
function b(r2) {
|
|
92786
|
-
const { year: t2, month: i2, day:
|
|
92787
|
-
if (!t2 || t2 < 0 || t2 > 9999 || !i2 || i2 < 1 || i2 > 12 || !
|
|
94048
|
+
const { year: t2, month: i2, day: s2 } = f(r2);
|
|
94049
|
+
if (!t2 || t2 < 0 || t2 > 9999 || !i2 || i2 < 1 || i2 > 12 || !s2 || s2 < 1)
|
|
92788
94050
|
return;
|
|
92789
|
-
const n2 = new Date(Date.UTC(t2, i2 - 1,
|
|
92790
|
-
if (!(n2.getUTCFullYear() !== t2 || n2.getUTCMonth() !== i2 - 1 || n2.getUTCDate() !==
|
|
92791
|
-
return { year: t2, month: i2, day:
|
|
94051
|
+
const n2 = new Date(Date.UTC(t2, i2 - 1, s2));
|
|
94052
|
+
if (!(n2.getUTCFullYear() !== t2 || n2.getUTCMonth() !== i2 - 1 || n2.getUTCDate() !== s2))
|
|
94053
|
+
return { year: t2, month: i2, day: s2 };
|
|
92792
94054
|
}
|
|
92793
94055
|
function C(r2) {
|
|
92794
94056
|
const t2 = b(r2);
|
|
92795
94057
|
return t2 ? new Date(Date.UTC(t2.year, t2.month - 1, t2.day)) : undefined;
|
|
92796
94058
|
}
|
|
92797
|
-
function T2(r2, t2, i2,
|
|
94059
|
+
function T2(r2, t2, i2, s2) {
|
|
92798
94060
|
const n2 = i2 ? {
|
|
92799
94061
|
year: i2.getUTCFullYear(),
|
|
92800
94062
|
month: i2.getUTCMonth() + 1,
|
|
92801
94063
|
day: i2.getUTCDate()
|
|
92802
|
-
} : null, e =
|
|
92803
|
-
year:
|
|
92804
|
-
month:
|
|
92805
|
-
day:
|
|
94064
|
+
} : null, e = s2 ? {
|
|
94065
|
+
year: s2.getUTCFullYear(),
|
|
94066
|
+
month: s2.getUTCMonth() + 1,
|
|
94067
|
+
day: s2.getUTCDate()
|
|
92806
94068
|
} : null;
|
|
92807
94069
|
return r2 === "year" ? { min: n2?.year ?? 1, max: e?.year ?? 9999 } : r2 === "month" ? {
|
|
92808
94070
|
min: n2 && t2.year === n2.year ? n2.month : 1,
|
|
@@ -92845,12 +94107,12 @@ class U extends V {
|
|
|
92845
94107
|
this._setUserInput(this.#l(this.#t)), this._setValue(C(this.#t) ?? undefined);
|
|
92846
94108
|
}
|
|
92847
94109
|
constructor(t2) {
|
|
92848
|
-
const i2 = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale),
|
|
94110
|
+
const i2 = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale), s2 = t2.separator ?? i2.separator, n2 = t2.format ? M(t2.format) : i2.segments, e = t2.initialValue ?? t2.defaultValue, m2 = e ? {
|
|
92849
94111
|
year: String(e.getUTCFullYear()).padStart(4, "0"),
|
|
92850
94112
|
month: String(e.getUTCMonth() + 1).padStart(2, "0"),
|
|
92851
94113
|
day: String(e.getUTCDate()).padStart(2, "0")
|
|
92852
|
-
} : { year: "____", month: "__", day: "__" },
|
|
92853
|
-
super({ ...t2, initialUserInput:
|
|
94114
|
+
} : { year: "____", month: "__", day: "__" }, o3 = n2.map((a2) => m2[a2.type]).join(s2);
|
|
94115
|
+
super({ ...t2, initialUserInput: o3 }, false), this.#i = n2, this.#o = s2, this.#t = m2, this.#h = t2.minDate, this.#u = t2.maxDate, this.#r(), this.on("cursor", (a2) => this.#f(a2)), this.on("key", (a2, u2) => this.#y(a2, u2)), this.on("finalize", () => this.#p(t2));
|
|
92854
94116
|
}
|
|
92855
94117
|
#a() {
|
|
92856
94118
|
const t2 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i2 = this.#i[t2];
|
|
@@ -92866,11 +94128,11 @@ class U extends V {
|
|
|
92866
94128
|
const i2 = this.#a();
|
|
92867
94129
|
if (!i2)
|
|
92868
94130
|
return;
|
|
92869
|
-
const { segment:
|
|
94131
|
+
const { segment: s2 } = i2, n2 = this.#t[s2.type], e = !n2 || n2.replace(/_/g, "") === "", m2 = Number.parseInt((n2 || "0").replace(/_/g, "0"), 10) || 0, o3 = T2(s2.type, f(this.#t), this.#h, this.#u);
|
|
92870
94132
|
let a2;
|
|
92871
|
-
e ? a2 = t2 === 1 ?
|
|
94133
|
+
e ? a2 = t2 === 1 ? o3.min : o3.max : a2 = Math.max(Math.min(o3.max, m2 + t2), o3.min), this.#t = {
|
|
92872
94134
|
...this.#t,
|
|
92873
|
-
[
|
|
94135
|
+
[s2.type]: a2.toString().padStart(s2.len, "0")
|
|
92874
94136
|
}, this.#n = true, this.#s = null, this.#r();
|
|
92875
94137
|
}
|
|
92876
94138
|
#f(t2) {
|
|
@@ -92923,15 +94185,15 @@ class U extends V {
|
|
|
92923
94185
|
return;
|
|
92924
94186
|
}
|
|
92925
94187
|
this.#n && !m2 && (this.#t[e.type] = "_".repeat(e.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
|
|
92926
|
-
const
|
|
94188
|
+
const o3 = this.#t[e.type], a2 = o3.indexOf("_"), u2 = a2 >= 0 ? a2 : Math.min(this.#e.positionInSegment, e.len - 1);
|
|
92927
94189
|
if (u2 < 0 || u2 >= e.len)
|
|
92928
94190
|
return;
|
|
92929
|
-
let l =
|
|
92930
|
-
if (u2 === 0 &&
|
|
94191
|
+
let l = o3.slice(0, u2) + t2 + o3.slice(u2 + 1), D = false;
|
|
94192
|
+
if (u2 === 0 && o3 === "__" && (e.type === "month" || e.type === "day")) {
|
|
92931
94193
|
const h2 = Number.parseInt(t2, 10);
|
|
92932
94194
|
l = `0${t2}`, D = h2 <= (e.type === "month" ? 1 : 2);
|
|
92933
94195
|
}
|
|
92934
|
-
if (e.type === "year" && (l = (
|
|
94196
|
+
if (e.type === "year" && (l = (o3.replace(/_/g, "") + t2).padStart(e.len, "_")), !l.includes("_")) {
|
|
92935
94197
|
const h2 = { ...this.#t, [e.type]: l }, d = this.#g(h2, e);
|
|
92936
94198
|
if (d) {
|
|
92937
94199
|
this.inlineError = d;
|
|
@@ -92954,16 +94216,16 @@ class U extends V {
|
|
|
92954
94216
|
}
|
|
92955
94217
|
}
|
|
92956
94218
|
#g(t2, i2) {
|
|
92957
|
-
const { month:
|
|
92958
|
-
if (i2.type === "month" && (
|
|
94219
|
+
const { month: s2, day: n2 } = f(t2);
|
|
94220
|
+
if (i2.type === "month" && (s2 < 0 || s2 > 12))
|
|
92959
94221
|
return settings.date.messages.invalidMonth;
|
|
92960
94222
|
if (i2.type === "day" && (n2 < 0 || n2 > 31))
|
|
92961
94223
|
return settings.date.messages.invalidDay(31, "any month");
|
|
92962
94224
|
}
|
|
92963
94225
|
#p(t2) {
|
|
92964
|
-
const { year: i2, month:
|
|
92965
|
-
if (i2 &&
|
|
92966
|
-
const e = c3(i2,
|
|
94226
|
+
const { year: i2, month: s2, day: n2 } = f(this.#t);
|
|
94227
|
+
if (i2 && s2 && n2) {
|
|
94228
|
+
const e = c3(i2, s2);
|
|
92967
94229
|
this.#t = {
|
|
92968
94230
|
...this.#t,
|
|
92969
94231
|
day: String(Math.min(n2, e)).padStart(2, "0")
|
|
@@ -92981,13 +94243,13 @@ var u$1 = class u2 extends V {
|
|
|
92981
94243
|
}
|
|
92982
94244
|
isGroupSelected(t2) {
|
|
92983
94245
|
const r2 = this.getGroupItems(t2), e = this.value;
|
|
92984
|
-
return e === undefined ? false : r2.every((
|
|
94246
|
+
return e === undefined ? false : r2.every((s2) => e.includes(s2.value));
|
|
92985
94247
|
}
|
|
92986
94248
|
toggleValue() {
|
|
92987
94249
|
const t2 = this.options[this.cursor];
|
|
92988
94250
|
if (this.value === undefined && (this.value = []), t2.group === true) {
|
|
92989
94251
|
const r2 = t2.value, e = this.getGroupItems(r2);
|
|
92990
|
-
this.isGroupSelected(r2) ? this.value = this.value.filter((
|
|
94252
|
+
this.isGroupSelected(r2) ? this.value = this.value.filter((s2) => e.findIndex((i2) => i2.value === s2) === -1) : this.value = [...this.value, ...e.map((s2) => s2.value)], this.value = Array.from(new Set(this.value));
|
|
92991
94253
|
} else {
|
|
92992
94254
|
const r2 = this.value.includes(t2.value);
|
|
92993
94255
|
this.value = r2 ? this.value.filter((e) => e !== t2.value) : [...this.value, t2.value];
|
|
@@ -92996,23 +94258,23 @@ var u$1 = class u2 extends V {
|
|
|
92996
94258
|
constructor(t2) {
|
|
92997
94259
|
super(t2, false);
|
|
92998
94260
|
const { options: r2 } = t2;
|
|
92999
|
-
this.#t = t2.selectableGroups !== false, this.options = Object.entries(r2).flatMap(([e,
|
|
94261
|
+
this.#t = t2.selectableGroups !== false, this.options = Object.entries(r2).flatMap(([e, s2]) => [
|
|
93000
94262
|
{ value: e, group: true, label: e },
|
|
93001
|
-
...
|
|
94263
|
+
...s2.map((i2) => ({ ...i2, group: e }))
|
|
93002
94264
|
]), this.value = [...t2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t2.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e) => {
|
|
93003
94265
|
switch (e) {
|
|
93004
94266
|
case "left":
|
|
93005
94267
|
case "up": {
|
|
93006
94268
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
93007
|
-
const
|
|
93008
|
-
!this.#t &&
|
|
94269
|
+
const s2 = this.options[this.cursor]?.group === true;
|
|
94270
|
+
!this.#t && s2 && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
93009
94271
|
break;
|
|
93010
94272
|
}
|
|
93011
94273
|
case "down":
|
|
93012
94274
|
case "right": {
|
|
93013
94275
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
93014
|
-
const
|
|
93015
|
-
!this.#t &&
|
|
94276
|
+
const s2 = this.options[this.cursor]?.group === true;
|
|
94277
|
+
!this.#t && s2 && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
93016
94278
|
break;
|
|
93017
94279
|
}
|
|
93018
94280
|
case "space":
|
|
@@ -93034,10 +94296,10 @@ class h2 extends V {
|
|
|
93034
94296
|
const t2 = this.userInput;
|
|
93035
94297
|
if (this.cursor >= t2.length)
|
|
93036
94298
|
return `${t2}\u2588`;
|
|
93037
|
-
const
|
|
94299
|
+
const s2 = t2.slice(0, this.cursor), r2 = t2[this.cursor], e = t2.slice(this.cursor + 1);
|
|
93038
94300
|
return r2 === `
|
|
93039
|
-
` ? `${
|
|
93040
|
-
${e}` : `${
|
|
94301
|
+
` ? `${s2}\u2588
|
|
94302
|
+
${e}` : `${s2}${styleText("inverse", r2)}${e}`;
|
|
93041
94303
|
}
|
|
93042
94304
|
get cursor() {
|
|
93043
94305
|
return this._cursor;
|
|
@@ -93050,23 +94312,23 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
|
|
|
93050
94312
|
this._setUserInput(this.userInput.slice(0, this.cursor) + t2 + this.userInput.slice(this.cursor));
|
|
93051
94313
|
}
|
|
93052
94314
|
#i(t2) {
|
|
93053
|
-
const
|
|
94315
|
+
const s2 = this.value ?? "";
|
|
93054
94316
|
switch (t2) {
|
|
93055
94317
|
case "up":
|
|
93056
|
-
this._cursor = findTextCursor(this._cursor, 0, -1,
|
|
94318
|
+
this._cursor = findTextCursor(this._cursor, 0, -1, s2);
|
|
93057
94319
|
return;
|
|
93058
94320
|
case "down":
|
|
93059
|
-
this._cursor = findTextCursor(this._cursor, 0, 1,
|
|
94321
|
+
this._cursor = findTextCursor(this._cursor, 0, 1, s2);
|
|
93060
94322
|
return;
|
|
93061
94323
|
case "left":
|
|
93062
|
-
this._cursor = findTextCursor(this._cursor, -1, 0,
|
|
94324
|
+
this._cursor = findTextCursor(this._cursor, -1, 0, s2);
|
|
93063
94325
|
return;
|
|
93064
94326
|
case "right":
|
|
93065
|
-
this._cursor = findTextCursor(this._cursor, 1, 0,
|
|
94327
|
+
this._cursor = findTextCursor(this._cursor, 1, 0, s2);
|
|
93066
94328
|
return;
|
|
93067
94329
|
}
|
|
93068
94330
|
}
|
|
93069
|
-
_shouldSubmit(t2,
|
|
94331
|
+
_shouldSubmit(t2, s2) {
|
|
93070
94332
|
if (this.#t)
|
|
93071
94333
|
return this.focused === "submit" ? true : (this.#r(`
|
|
93072
94334
|
`), this._cursor++, false);
|
|
@@ -93076,12 +94338,12 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
|
|
|
93076
94338
|
`), this._cursor++, false);
|
|
93077
94339
|
}
|
|
93078
94340
|
constructor(t2) {
|
|
93079
|
-
super(t2, false), this.#t = t2.showSubmit ?? false, this.on("key", (
|
|
94341
|
+
super(t2, false), this.#t = t2.showSubmit ?? false, this.on("key", (s2, r2) => {
|
|
93080
94342
|
if (r2?.name && o$1.has(r2.name)) {
|
|
93081
94343
|
this.#i(r2.name);
|
|
93082
94344
|
return;
|
|
93083
94345
|
}
|
|
93084
|
-
if (
|
|
94346
|
+
if (s2 === "\t" && this.#t) {
|
|
93085
94347
|
this.focused = this.focused === "editor" ? "submit" : "editor";
|
|
93086
94348
|
return;
|
|
93087
94349
|
}
|
|
@@ -93094,10 +94356,10 @@ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
|
|
|
93094
94356
|
this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
|
|
93095
94357
|
return;
|
|
93096
94358
|
}
|
|
93097
|
-
|
|
94359
|
+
s2 && (this.#t && this.focused === "submit" && (this.focused = "editor"), this.#r(s2 ?? ""), this._cursor++);
|
|
93098
94360
|
}
|
|
93099
|
-
}), this.on("userInput", (
|
|
93100
|
-
this._setValue(
|
|
94361
|
+
}), this.on("userInput", (s2) => {
|
|
94362
|
+
this._setValue(s2);
|
|
93101
94363
|
}), this.on("finalize", () => {
|
|
93102
94364
|
this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
|
|
93103
94365
|
});
|
|
@@ -93114,9 +94376,9 @@ class a2 extends V {
|
|
|
93114
94376
|
}
|
|
93115
94377
|
constructor(t2) {
|
|
93116
94378
|
super(t2, false), this.options = t2.options;
|
|
93117
|
-
const i2 = this.options.findIndex(({ value:
|
|
93118
|
-
this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (
|
|
93119
|
-
switch (
|
|
94379
|
+
const i2 = this.options.findIndex(({ value: s2 }) => s2 === t2.initialValue), e = i2 === -1 ? 0 : i2;
|
|
94380
|
+
this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (s2) => {
|
|
94381
|
+
switch (s2) {
|
|
93120
94382
|
case "left":
|
|
93121
94383
|
case "up":
|
|
93122
94384
|
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
@@ -93137,8 +94399,8 @@ class n2 extends V {
|
|
|
93137
94399
|
const t2 = this.userInput;
|
|
93138
94400
|
if (this.cursor >= t2.length)
|
|
93139
94401
|
return `${this.userInput}\u2588`;
|
|
93140
|
-
const e = t2.slice(0, this.cursor), [
|
|
93141
|
-
return `${e}${styleText("inverse",
|
|
94402
|
+
const e = t2.slice(0, this.cursor), [s2, ...r2] = t2.slice(this.cursor);
|
|
94403
|
+
return `${e}${styleText("inverse", s2)}${r2.join("")}`;
|
|
93142
94404
|
}
|
|
93143
94405
|
get cursor() {
|
|
93144
94406
|
return this._cursor;
|
|
@@ -93166,7 +94428,7 @@ function isUnicodeSupported2() {
|
|
|
93166
94428
|
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
93167
94429
|
}
|
|
93168
94430
|
var unicode = isUnicodeSupported2();
|
|
93169
|
-
var unicodeOr = (e,
|
|
94431
|
+
var unicodeOr = (e, o4) => unicode ? e : o4;
|
|
93170
94432
|
var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
93171
94433
|
var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
93172
94434
|
var S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
@@ -93218,8 +94480,8 @@ var symbolBar = (e) => {
|
|
|
93218
94480
|
return styleText2("green", S_BAR);
|
|
93219
94481
|
}
|
|
93220
94482
|
};
|
|
93221
|
-
var E$1 = (l,
|
|
93222
|
-
let r3 =
|
|
94483
|
+
var E$1 = (l, o4, g3, c4, h3, O = false) => {
|
|
94484
|
+
let r3 = o4, w = 0;
|
|
93223
94485
|
if (O)
|
|
93224
94486
|
for (let i2 = c4 - 1;i2 >= g3 && (r3 -= l[i2].length, w++, !(r3 <= h3)); i2--)
|
|
93225
94487
|
;
|
|
@@ -93230,7 +94492,7 @@ var E$1 = (l, o3, g3, c4, h3, O = false) => {
|
|
|
93230
94492
|
};
|
|
93231
94493
|
var limitOptions = ({
|
|
93232
94494
|
cursor: l,
|
|
93233
|
-
options:
|
|
94495
|
+
options: o4,
|
|
93234
94496
|
style: g3,
|
|
93235
94497
|
output: c4 = process.stdout,
|
|
93236
94498
|
maxItems: h3 = Number.POSITIVE_INFINITY,
|
|
@@ -93239,14 +94501,14 @@ var limitOptions = ({
|
|
|
93239
94501
|
}) => {
|
|
93240
94502
|
const i2 = getColumns2(c4) - O, I = getRows(c4), C2 = styleText2("dim", "..."), x = Math.max(I - r3, 0), m2 = Math.max(Math.min(h3, x), 5);
|
|
93241
94503
|
let p3 = 0;
|
|
93242
|
-
l >= m2 - 3 && (p3 = Math.max(Math.min(l - m2 + 3,
|
|
93243
|
-
let f2 = m2 <
|
|
93244
|
-
const W = Math.min(p3 + m2,
|
|
94504
|
+
l >= m2 - 3 && (p3 = Math.max(Math.min(l - m2 + 3, o4.length - m2), 0));
|
|
94505
|
+
let f2 = m2 < o4.length && p3 > 0, u4 = m2 < o4.length && p3 + m2 < o4.length;
|
|
94506
|
+
const W = Math.min(p3 + m2, o4.length), e = [];
|
|
93245
94507
|
let d = 0;
|
|
93246
94508
|
f2 && d++, u4 && d++;
|
|
93247
94509
|
const v = p3 + (f2 ? 1 : 0), P2 = W - (u4 ? 1 : 0);
|
|
93248
94510
|
for (let t2 = v;t2 < P2; t2++) {
|
|
93249
|
-
const n3 = wrapAnsi(g3(
|
|
94511
|
+
const n3 = wrapAnsi(g3(o4[t2], t2 === l), i2, {
|
|
93250
94512
|
hard: true,
|
|
93251
94513
|
trim: false
|
|
93252
94514
|
}).split(`
|
|
@@ -93254,11 +94516,11 @@ var limitOptions = ({
|
|
|
93254
94516
|
e.push(n3), d += n3.length;
|
|
93255
94517
|
}
|
|
93256
94518
|
if (d > x) {
|
|
93257
|
-
let t2 = 0, n3 = 0,
|
|
94519
|
+
let t2 = 0, n3 = 0, s2 = d;
|
|
93258
94520
|
const M2 = l - v;
|
|
93259
94521
|
let a3 = x;
|
|
93260
|
-
const T3 = () => E$1(e,
|
|
93261
|
-
f2 ? ({ lineCount:
|
|
94522
|
+
const T3 = () => E$1(e, s2, 0, M2, a3), L = () => E$1(e, s2, M2 + 1, e.length, a3, true);
|
|
94523
|
+
f2 ? ({ lineCount: s2, removals: t2 } = T3(), s2 > a3 && (u4 || (a3 -= 1), { lineCount: s2, removals: n3 } = L())) : (u4 || (a3 -= 1), { lineCount: s2, removals: n3 } = L(), s2 > a3 && (a3 -= 1, { lineCount: s2, removals: t2 } = T3())), t2 > 0 && (f2 = true, e.splice(0, t2)), n3 > 0 && (u4 = true, e.splice(e.length - n3, n3));
|
|
93262
94524
|
}
|
|
93263
94525
|
const b2 = [];
|
|
93264
94526
|
f2 && b2.push(C2);
|
|
@@ -93278,18 +94540,18 @@ var c4 = (e, a3) => e.includes(`
|
|
|
93278
94540
|
`) : a3(e);
|
|
93279
94541
|
var select3 = (e) => {
|
|
93280
94542
|
const a3 = (t2, d) => {
|
|
93281
|
-
const
|
|
94543
|
+
const s2 = t2.label ?? String(t2.value);
|
|
93282
94544
|
switch (d) {
|
|
93283
94545
|
case "disabled":
|
|
93284
|
-
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(
|
|
94546
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(s2, (n3) => styleText2("gray", n3))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}`;
|
|
93285
94547
|
case "selected":
|
|
93286
|
-
return `${c4(
|
|
94548
|
+
return `${c4(s2, (n3) => styleText2("dim", n3))}`;
|
|
93287
94549
|
case "active":
|
|
93288
|
-
return `${styleText2("green", S_RADIO_ACTIVE)} ${
|
|
94550
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}`;
|
|
93289
94551
|
case "cancelled":
|
|
93290
|
-
return `${c4(
|
|
94552
|
+
return `${c4(s2, (n3) => styleText2(["strikethrough", "dim"], n3))}`;
|
|
93291
94553
|
default:
|
|
93292
|
-
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(
|
|
94554
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(s2, (n3) => styleText2("dim", n3))}`;
|
|
93293
94555
|
}
|
|
93294
94556
|
};
|
|
93295
94557
|
return new a2({
|
|
@@ -93299,7 +94561,7 @@ var select3 = (e) => {
|
|
|
93299
94561
|
output: e.output,
|
|
93300
94562
|
initialValue: e.initialValue,
|
|
93301
94563
|
render() {
|
|
93302
|
-
const t2 = e.withGuide ?? settings.withGuide, d = `${symbol2(this.state)} `,
|
|
94564
|
+
const t2 = e.withGuide ?? settings.withGuide, d = `${symbol2(this.state)} `, s2 = `${symbolBar(this.state)} `, n3 = wrapTextWithPrefix(e.output, e.message, s2, d), u5 = `${t2 ? `${styleText2("gray", S_BAR)}
|
|
93303
94565
|
` : ""}${n3}
|
|
93304
94566
|
`;
|
|
93305
94567
|
switch (this.state) {
|
|
@@ -93342,29 +94604,29 @@ var text4 = (t2) => new n2({
|
|
|
93342
94604
|
signal: t2.signal,
|
|
93343
94605
|
input: t2.input,
|
|
93344
94606
|
render() {
|
|
93345
|
-
const i3 = t2?.withGuide ?? settings.withGuide,
|
|
94607
|
+
const i3 = t2?.withGuide ?? settings.withGuide, s2 = `${`${i3 ? `${styleText2("gray", S_BAR)}
|
|
93346
94608
|
` : ""}${symbol2(this.state)} `}${t2.message}
|
|
93347
|
-
`, c5 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"),
|
|
94609
|
+
`, c5 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o4 = this.userInput ? this.userInputWithCursor : c5, a3 = this.value ?? "";
|
|
93348
94610
|
switch (this.state) {
|
|
93349
94611
|
case "error": {
|
|
93350
94612
|
const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r3 = i3 ? `${styleText2("yellow", S_BAR)} ` : "", d = i3 ? styleText2("yellow", S_BAR_END) : "";
|
|
93351
|
-
return `${
|
|
93352
|
-
${r3}${
|
|
94613
|
+
return `${s2.trim()}
|
|
94614
|
+
${r3}${o4}
|
|
93353
94615
|
${d}${n3}
|
|
93354
94616
|
`;
|
|
93355
94617
|
}
|
|
93356
94618
|
case "submit": {
|
|
93357
94619
|
const n3 = a3 ? ` ${styleText2("dim", a3)}` : "", r3 = i3 ? styleText2("gray", S_BAR) : "";
|
|
93358
|
-
return `${
|
|
94620
|
+
return `${s2}${r3}${n3}`;
|
|
93359
94621
|
}
|
|
93360
94622
|
case "cancel": {
|
|
93361
94623
|
const n3 = a3 ? ` ${styleText2(["strikethrough", "dim"], a3)}` : "", r3 = i3 ? styleText2("gray", S_BAR) : "";
|
|
93362
|
-
return `${
|
|
94624
|
+
return `${s2}${r3}${n3}${a3.trim() ? `
|
|
93363
94625
|
${r3}` : ""}`;
|
|
93364
94626
|
}
|
|
93365
94627
|
default: {
|
|
93366
94628
|
const n3 = i3 ? `${styleText2("cyan", S_BAR)} ` : "", r3 = i3 ? styleText2("cyan", S_BAR_END) : "";
|
|
93367
|
-
return `${
|
|
94629
|
+
return `${s2}${n3}${o4}
|
|
93368
94630
|
${r3}
|
|
93369
94631
|
`;
|
|
93370
94632
|
}
|