@gobing-ai/spur 0.3.69 → 0.3.71
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/.claude-plugin/marketplace.json +1 -1
- package/config/corpus-baseline.json +0 -18
- package/config/plugin-scripts.json +8 -0
- package/config/workflow-composition-baseline.json +123 -377
- package/config/workflows/idea-pipeline.yaml +4 -3
- package/config/workflows/task-pipeline.yaml +58 -9
- package/config/workflows/wrapup-pipeline.yaml +10 -4
- package/package.json +9 -9
- package/plugins/sp/commands/dev-fixall.md +4 -3
- package/plugins/sp/plugin.json +1 -1
- package/plugins/sp/scripts/task-evidence-precheck.ts +181 -0
- package/plugins/sp/scripts/verify-answer-lint.ts +395 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +1 -1
- package/plugins/sp/skills/code-verification/SKILL.md +11 -10
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +10 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +1 -1
- package/plugins/sp/skills/spur-cli/references/history.md +8 -6
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +2 -2
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +8 -1
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +17 -1
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +25 -0
- package/spur.js +1385 -291
- package/web/_astro/BoardApp.BnjsI80-.js +178 -0
- package/web/_astro/BoardApp.SJcrHBZp.js +1 -0
- package/web/_astro/{TaskDetail.Dl2Eaj1w.js → TaskDetail.BvkKvo57.js} +1 -1
- package/web/_astro/{arc.uG14rp8A.js → arc.DuEIzPMi.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.Dye6uD_x.js → architectureDiagram-3BPJPVTR.D0dUxCjA.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.B9Pkh7Hb.js → blockDiagram-GPEHLZMM.Cv60iOpM.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.C2x7SC_X.js → c4Diagram-AAUBKEIU.Ddx7WGhb.js} +1 -1
- package/web/_astro/channel.tWfETQvX.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.D2p4-nWk.js → chunk-2J33WTMH.BGKzU_1t.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.S-6jf33o.js → chunk-4BX2VUAB.FlApjIIH.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.DVXj4Fdh.js → chunk-55IACEB6.CDfmvDeW.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.Dz689FMN.js → chunk-727SXJPM.T9bc-xir.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.KxYj5TnI.js → chunk-AQP2D5EJ.BiTc-MQo.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.itTQyHQB.js → chunk-FMBD7UC4.he4KrHni.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.euSrbJf5.js → chunk-ND2GUHAM.D05XuUuJ.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.OWASJRQy.js → chunk-QZHKN3VN.CA2NThIE.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.BLvrlpNO.js → classDiagram-4FO5ZUOK.Couj-zYZ.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.BLvrlpNO.js → classDiagram-v2-Q7XG4LA2.Couj-zYZ.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.XBF-rmyD.js → cose-bilkent-S5V4N54A.B8YYW7NG.js} +1 -1
- package/web/_astro/{cynefin-OW5HDTMX.DlCx762Z.js → cynefin-OW5HDTMX.BExFdiin.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.D17Rshxv.js → dagre-BM42HDAG.BybKbz3q.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.AhBIVJC8.js → diagram-2AECGRRQ.UyRTSl9n.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.C9ximjyC.js → diagram-5GNKFQAL.BrxCucBf.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.CZb7Ru_9.js → diagram-KO2AKTUF.CdE5oy5J.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.BW7LwqoS.js → diagram-LMA3HP47.BJLgdosK.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.XC025W0V.js → diagram-OG6HWLK6.CUynieTU.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.CpMXmBDP.js → erDiagram-TEJ5UH35.C0vS6DJv.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.D2ednJWg.js → flowDiagram-I6XJVG4X.T3QLi_en.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.BjL9FGKO.js → ganttDiagram-6RSMTGT7.BNsk3w9Z.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.B90g1VGk.js → gitGraphDiagram-PVQCEYII.Mwe2I4V6.js} +1 -1
- package/web/_astro/index.9npdrEIr.css +1 -0
- package/web/_astro/{infoDiagram-5YYISTIA.RqgycKtQ.js → infoDiagram-5YYISTIA.BlcjLmtc.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.Ctn-zt6a.js → ishikawaDiagram-YF4QCWOH.js8qeS0h.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.DJhT8Ctp.js → journeyDiagram-JHISSGLW.CM6UK0a4.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.BY1QdejI.js → kanban-definition-UN3LZRKU.a6ihOzMd.js} +1 -1
- package/web/_astro/{linear.Di7YObSt.js → linear.CsIB2jFu.js} +1 -1
- package/web/_astro/{mermaid.core.CbxtJS3Q.js → mermaid.core.Br2Fo22q.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.CxvR4g_J.js → mindmap-definition-RKZ34NQL.29inC1Mk.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.jNWqnBHH.js → pieDiagram-4H26LBE5.C9CxG_Kf.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.BCp12MbA.js → quadrantDiagram-W4KKPZXB.6qo9MOJM.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.Dxhm4TyR.js → requirementDiagram-4Y6WPE33.DN07zrP5.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.BtQXp4J9.js → sankeyDiagram-5OEKKPKP.BSw5o173.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.BWEM1R_Q.js → sequenceDiagram-3UESZ5HK.LJPzySKw.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.BG3wUkWB.js → stateDiagram-AJRCARHV.ClNjEiKV.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.BLtMeFVP.js → stateDiagram-v2-BHNVJYJU.c6Z-_WfX.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.D5fHo0az.js → timeline-definition-PNZ67QCA.CIMR-87j.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.0DcuMluU.js → vennDiagram-CIIHVFJN.BnRSRI9I.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.BZ-dxgHm.js → wardleyDiagram-YWT4CUSO.uN08C3gv.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.Bg-XWF7z.js → xychartDiagram-2RQKCTM6.BjbEvfuq.js} +1 -1
- package/web/index.html +2 -2
- package/web/_astro/BoardApp.BQFbkeqq.js +0 -178
- package/web/_astro/BoardApp.CTkqrhWd.js +0 -1
- package/web/_astro/channel.Dsvulp7W.js +0 -1
- package/web/_astro/index.BVXdIsZV.css +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.50/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.50/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,13 +81,13 @@ 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.50/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.50/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
|
|
88
88
|
var init_event_severity = () => {};
|
|
89
89
|
|
|
90
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
90
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.50/node_modules/@gobing-ai/ts-utils/dist/object.js
|
|
91
91
|
function isPlainObject(value) {
|
|
92
92
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
93
93
|
}
|
|
@@ -105,7 +105,7 @@ function deepMerge(target, source) {
|
|
|
105
105
|
return result;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
108
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.50/node_modules/@gobing-ai/ts-utils/dist/output.js
|
|
109
109
|
function processStream(name) {
|
|
110
110
|
const proc = globalThis.process;
|
|
111
111
|
const stream = proc?.[name];
|
|
@@ -126,7 +126,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
126
126
|
}
|
|
127
127
|
var defaultStdoutTarget, defaultStderrTarget;
|
|
128
128
|
|
|
129
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.
|
|
129
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.50/node_modules/@gobing-ai/ts-utils/dist/index.js
|
|
130
130
|
var init_dist = __esm(() => {
|
|
131
131
|
init_api_response();
|
|
132
132
|
init_cursor();
|
|
@@ -21749,7 +21749,7 @@ var init_zod = __esm(() => {
|
|
|
21749
21749
|
init_external();
|
|
21750
21750
|
});
|
|
21751
21751
|
|
|
21752
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21752
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
21753
21753
|
function getProcessEnv() {
|
|
21754
21754
|
return process.env;
|
|
21755
21755
|
}
|
|
@@ -21827,7 +21827,7 @@ var init_config = __esm(() => {
|
|
|
21827
21827
|
};
|
|
21828
21828
|
});
|
|
21829
21829
|
|
|
21830
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21830
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
21831
21831
|
import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
|
|
21832
21832
|
import { dirname, resolve as resolvePath } from "path";
|
|
21833
21833
|
function createNodeFileSystem(root, paths) {
|
|
@@ -21914,7 +21914,7 @@ function findProjectRoot(startDir) {
|
|
|
21914
21914
|
}
|
|
21915
21915
|
var init_file_system_node = () => {};
|
|
21916
21916
|
|
|
21917
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
21917
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
|
|
21918
21918
|
var DbModuleNotInstalledError;
|
|
21919
21919
|
var init_db_errors = __esm(() => {
|
|
21920
21920
|
DbModuleNotInstalledError = class DbModuleNotInstalledError extends Error {
|
|
@@ -29125,7 +29125,7 @@ var init_execa = __esm(() => {
|
|
|
29125
29125
|
} = getIpcExport());
|
|
29126
29126
|
});
|
|
29127
29127
|
|
|
29128
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29128
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
|
|
29129
29129
|
import { isatty } from "tty";
|
|
29130
29130
|
function processEventSeverity(reason, exitCode) {
|
|
29131
29131
|
if (reason === "error")
|
|
@@ -29489,7 +29489,7 @@ var init_process_executor = __esm(() => {
|
|
|
29489
29489
|
init_config();
|
|
29490
29490
|
});
|
|
29491
29491
|
|
|
29492
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29492
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
|
|
29493
29493
|
function getNodeFileSystem() {
|
|
29494
29494
|
if (!_nodeFileSystem)
|
|
29495
29495
|
_nodeFileSystem = createNodeFileSystem();
|
|
@@ -29549,7 +29549,7 @@ var init_runtime_node_bun = __esm(() => {
|
|
|
29549
29549
|
};
|
|
29550
29550
|
});
|
|
29551
29551
|
|
|
29552
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29552
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
29553
29553
|
class RuntimeContext {
|
|
29554
29554
|
scope;
|
|
29555
29555
|
runtimeName;
|
|
@@ -29619,7 +29619,7 @@ var init_context = __esm(() => {
|
|
|
29619
29619
|
init_runtime_node_bun();
|
|
29620
29620
|
});
|
|
29621
29621
|
|
|
29622
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29622
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
29623
29623
|
function normalizeSeparators(path6) {
|
|
29624
29624
|
return path6.replaceAll("\\", "/");
|
|
29625
29625
|
}
|
|
@@ -29680,17 +29680,17 @@ var init_path = __esm(() => {
|
|
|
29680
29680
|
SEP = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
29681
29681
|
});
|
|
29682
29682
|
|
|
29683
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29683
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
29684
29684
|
var REMOTE_SCHEMA_MAX_BYTES;
|
|
29685
29685
|
var init_schema_validation = __esm(() => {
|
|
29686
29686
|
init_dist2();
|
|
29687
29687
|
REMOTE_SCHEMA_MAX_BYTES = 5 * 1024 * 1024;
|
|
29688
29688
|
});
|
|
29689
29689
|
|
|
29690
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29690
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
29691
29691
|
var init_types = () => {};
|
|
29692
29692
|
|
|
29693
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29693
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
29694
29694
|
var init_dist3 = __esm(() => {
|
|
29695
29695
|
init_config();
|
|
29696
29696
|
init_context();
|
|
@@ -29699,7 +29699,7 @@ var init_dist3 = __esm(() => {
|
|
|
29699
29699
|
init_types();
|
|
29700
29700
|
});
|
|
29701
29701
|
|
|
29702
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
29702
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+2749503d16def146/node_modules/@gobing-ai/ts-runtime/dist/bun-sqlite.js
|
|
29703
29703
|
import { Database } from "bun:sqlite";
|
|
29704
29704
|
var init_bun_sqlite = () => {};
|
|
29705
29705
|
|
|
@@ -34129,7 +34129,7 @@ var init_bun_sqlite2 = __esm(() => {
|
|
|
34129
34129
|
init_session2();
|
|
34130
34130
|
});
|
|
34131
34131
|
|
|
34132
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34132
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/inbox-messages.js
|
|
34133
34133
|
var inboxMessages;
|
|
34134
34134
|
var init_inbox_messages = __esm(() => {
|
|
34135
34135
|
init_sqlite_core();
|
|
@@ -34148,7 +34148,7 @@ var init_inbox_messages = __esm(() => {
|
|
|
34148
34148
|
}, (table2) => [index("idx_inbox_messages_to_status").on(table2.toId, table2.status)]);
|
|
34149
34149
|
});
|
|
34150
34150
|
|
|
34151
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34151
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/common.js
|
|
34152
34152
|
function nowTimestamp() {
|
|
34153
34153
|
return Date.now();
|
|
34154
34154
|
}
|
|
@@ -34177,7 +34177,7 @@ var init_common3 = __esm(() => {
|
|
|
34177
34177
|
appendOnlyColumns = buildAppendOnlyColumns();
|
|
34178
34178
|
});
|
|
34179
34179
|
|
|
34180
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34180
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/queue-jobs.js
|
|
34181
34181
|
var queueJobs;
|
|
34182
34182
|
var init_queue_jobs = __esm(() => {
|
|
34183
34183
|
init_sqlite_core();
|
|
@@ -34197,7 +34197,7 @@ var init_queue_jobs = __esm(() => {
|
|
|
34197
34197
|
}, (table2) => [index("queue_jobs_ready_idx").on(table2.status, table2.nextRetryAt, table2.createdAt)]);
|
|
34198
34198
|
});
|
|
34199
34199
|
|
|
34200
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34200
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/runtime.js
|
|
34201
34201
|
var exports_runtime = {};
|
|
34202
34202
|
__export(exports_runtime, {
|
|
34203
34203
|
queueJobs: () => queueJobs,
|
|
@@ -34208,7 +34208,7 @@ var init_runtime = __esm(() => {
|
|
|
34208
34208
|
init_queue_jobs();
|
|
34209
34209
|
});
|
|
34210
34210
|
|
|
34211
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34211
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/adapters/bun-sqlite.js
|
|
34212
34212
|
var exports_bun_sqlite = {};
|
|
34213
34213
|
__export(exports_bun_sqlite, {
|
|
34214
34214
|
BunSqliteAdapter: () => BunSqliteAdapter
|
|
@@ -34519,7 +34519,7 @@ var init_d1 = __esm(() => {
|
|
|
34519
34519
|
init_session3();
|
|
34520
34520
|
});
|
|
34521
34521
|
|
|
34522
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34522
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/adapters/d1.js
|
|
34523
34523
|
var exports_d1 = {};
|
|
34524
34524
|
__export(exports_d1, {
|
|
34525
34525
|
D1Adapter: () => D1Adapter
|
|
@@ -34583,7 +34583,7 @@ var init_d12 = __esm(() => {
|
|
|
34583
34583
|
init_runtime();
|
|
34584
34584
|
});
|
|
34585
34585
|
|
|
34586
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34586
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/adapter.js
|
|
34587
34587
|
async function createDbAdapter(config3) {
|
|
34588
34588
|
switch (config3.driver) {
|
|
34589
34589
|
case "bun-sqlite": {
|
|
@@ -34617,7 +34617,7 @@ var init_drizzle_orm = __esm(() => {
|
|
|
34617
34617
|
init_view_common();
|
|
34618
34618
|
});
|
|
34619
34619
|
|
|
34620
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34620
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/query-spec.js
|
|
34621
34621
|
function compilePredicate(predicate) {
|
|
34622
34622
|
if ("and" in predicate) {
|
|
34623
34623
|
const parts = predicate.and.map(compilePredicate).filter((p) => p !== undefined);
|
|
@@ -34655,7 +34655,7 @@ var init_query_spec = __esm(() => {
|
|
|
34655
34655
|
};
|
|
34656
34656
|
});
|
|
34657
34657
|
|
|
34658
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34658
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/base-dao.js
|
|
34659
34659
|
function asSelectQuery(query) {
|
|
34660
34660
|
return query;
|
|
34661
34661
|
}
|
|
@@ -34697,7 +34697,7 @@ var init_base_dao = __esm(() => {
|
|
|
34697
34697
|
init_query_spec();
|
|
34698
34698
|
});
|
|
34699
34699
|
|
|
34700
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34700
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/embedded-migrations.js
|
|
34701
34701
|
var embeddedMigrations;
|
|
34702
34702
|
var init_embedded_migrations = __esm(() => {
|
|
34703
34703
|
embeddedMigrations = [
|
|
@@ -34729,7 +34729,7 @@ var init_embedded_migrations = __esm(() => {
|
|
|
34729
34729
|
];
|
|
34730
34730
|
});
|
|
34731
34731
|
|
|
34732
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34732
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/entity-dao.js
|
|
34733
34733
|
var EntityDao;
|
|
34734
34734
|
var init_entity_dao = __esm(() => {
|
|
34735
34735
|
init_drizzle_orm();
|
|
@@ -34891,7 +34891,7 @@ var init_entity_dao = __esm(() => {
|
|
|
34891
34891
|
};
|
|
34892
34892
|
});
|
|
34893
34893
|
|
|
34894
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
34894
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/inbox-message-dao.js
|
|
34895
34895
|
function isPromiseLike(value) {
|
|
34896
34896
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
34897
34897
|
}
|
|
@@ -35069,7 +35069,7 @@ var init_migrator2 = __esm(() => {
|
|
|
35069
35069
|
init_migrator();
|
|
35070
35070
|
});
|
|
35071
35071
|
|
|
35072
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
35072
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/migrate.js
|
|
35073
35073
|
async function ensureJournalTable(adapter, table3) {
|
|
35074
35074
|
await adapter.exec(`CREATE TABLE IF NOT EXISTS "${table3}" (` + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "hash text NOT NULL, " + "created_at numeric" + ")");
|
|
35075
35075
|
}
|
|
@@ -35144,7 +35144,7 @@ var init_migrate = __esm(() => {
|
|
|
35144
35144
|
init_embedded_migrations();
|
|
35145
35145
|
});
|
|
35146
35146
|
|
|
35147
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
35147
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/queue-job-dao.js
|
|
35148
35148
|
var QueueJobDao;
|
|
35149
35149
|
var init_queue_job_dao = __esm(() => {
|
|
35150
35150
|
init_drizzle_orm();
|
|
@@ -35285,7 +35285,7 @@ var init_queue_job_dao = __esm(() => {
|
|
|
35285
35285
|
};
|
|
35286
35286
|
});
|
|
35287
35287
|
|
|
35288
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
35288
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/index.js
|
|
35289
35289
|
var exports_dist = {};
|
|
35290
35290
|
__export(exports_dist, {
|
|
35291
35291
|
embeddedMigrations: () => embeddedMigrations,
|
|
@@ -37418,7 +37418,7 @@ var require_extra_typings = __commonJS((exports, module) => {
|
|
|
37418
37418
|
exports.createArgument = (name, description) => new commander.Argument(name, description);
|
|
37419
37419
|
});
|
|
37420
37420
|
|
|
37421
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37421
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
37422
37422
|
function parseYamlObject(text3) {
|
|
37423
37423
|
let parsed;
|
|
37424
37424
|
try {
|
|
@@ -37545,7 +37545,7 @@ var init_config2 = __esm(() => {
|
|
|
37545
37545
|
};
|
|
37546
37546
|
});
|
|
37547
37547
|
|
|
37548
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37548
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
37549
37549
|
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";
|
|
37550
37550
|
import { dirname as dirname2, resolve as resolvePath3 } from "path";
|
|
37551
37551
|
function createNodeFileSystem3(root, paths) {
|
|
@@ -37632,7 +37632,7 @@ function findProjectRoot3(startDir) {
|
|
|
37632
37632
|
}
|
|
37633
37633
|
var init_file_system_node2 = () => {};
|
|
37634
37634
|
|
|
37635
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37635
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/db-errors.js
|
|
37636
37636
|
var D1NotConfiguredError2, DbModuleNotInstalledError3;
|
|
37637
37637
|
var init_db_errors2 = __esm(() => {
|
|
37638
37638
|
D1NotConfiguredError2 = class D1NotConfiguredError2 extends Error {
|
|
@@ -37649,7 +37649,7 @@ var init_db_errors2 = __esm(() => {
|
|
|
37649
37649
|
};
|
|
37650
37650
|
});
|
|
37651
37651
|
|
|
37652
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37652
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/file-system-cf.js
|
|
37653
37653
|
function createCfFileSystem2() {
|
|
37654
37654
|
return {
|
|
37655
37655
|
getProjectRoot: () => "/bundle",
|
|
@@ -37688,7 +37688,7 @@ function createCfFileSystem2() {
|
|
|
37688
37688
|
}
|
|
37689
37689
|
var UNSUPPORTED = "FileSystem is not available on Cloudflare Workers. Use D1, KV, or R2 for persistent storage.";
|
|
37690
37690
|
|
|
37691
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37691
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/runtime-cf.js
|
|
37692
37692
|
var exports_runtime_cf = {};
|
|
37693
37693
|
__export(exports_runtime_cf, {
|
|
37694
37694
|
cloudflareWorkersFactory: () => cloudflareWorkersFactory2
|
|
@@ -37726,7 +37726,7 @@ var init_runtime_cf = __esm(() => {
|
|
|
37726
37726
|
};
|
|
37727
37727
|
});
|
|
37728
37728
|
|
|
37729
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
37729
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/process-executor.js
|
|
37730
37730
|
import { isatty as isatty2 } from "tty";
|
|
37731
37731
|
function processEventSeverity2(reason, exitCode) {
|
|
37732
37732
|
if (reason === "error")
|
|
@@ -38137,7 +38137,7 @@ var init_process_executor2 = __esm(() => {
|
|
|
38137
38137
|
ProcessExecutor2 = NodeProcessExecutor3;
|
|
38138
38138
|
});
|
|
38139
38139
|
|
|
38140
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38140
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/runtime-node-bun.js
|
|
38141
38141
|
var exports_runtime_node_bun = {};
|
|
38142
38142
|
__export(exports_runtime_node_bun, {
|
|
38143
38143
|
nodeBunFactory: () => nodeBunFactory3,
|
|
@@ -38205,7 +38205,7 @@ var init_runtime_node_bun2 = __esm(() => {
|
|
|
38205
38205
|
};
|
|
38206
38206
|
});
|
|
38207
38207
|
|
|
38208
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38208
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/platform.js
|
|
38209
38209
|
function isCloudflareWorkerRuntime2() {
|
|
38210
38210
|
return globalThis.navigator?.userAgent?.startsWith("Cloudflare-Workers") ?? false;
|
|
38211
38211
|
}
|
|
@@ -38235,7 +38235,7 @@ function _resetRuntimeFactory2() {
|
|
|
38235
38235
|
}
|
|
38236
38236
|
var _factory, _runtimeName;
|
|
38237
38237
|
|
|
38238
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38238
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/context.js
|
|
38239
38239
|
class RuntimeContext2 {
|
|
38240
38240
|
scope;
|
|
38241
38241
|
runtimeName;
|
|
@@ -38325,7 +38325,7 @@ var init_context2 = __esm(() => {
|
|
|
38325
38325
|
init_runtime_node_bun2();
|
|
38326
38326
|
});
|
|
38327
38327
|
|
|
38328
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38328
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
38329
38329
|
function normalizeSeparators2(path7) {
|
|
38330
38330
|
return path7.replaceAll("\\", "/");
|
|
38331
38331
|
}
|
|
@@ -38448,7 +38448,7 @@ var init_path2 = __esm(() => {
|
|
|
38448
38448
|
SEP2 = globalThis.process?.platform === "win32" ? "\\" : "/";
|
|
38449
38449
|
});
|
|
38450
38450
|
|
|
38451
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38451
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/fs.js
|
|
38452
38452
|
async function ensureDirForFile2(path7, fs2 = createNodeFileSystem3()) {
|
|
38453
38453
|
await fs2.ensureDir(dirnamePath(path7));
|
|
38454
38454
|
}
|
|
@@ -38516,7 +38516,7 @@ var init_fs = __esm(() => {
|
|
|
38516
38516
|
init_path2();
|
|
38517
38517
|
});
|
|
38518
38518
|
|
|
38519
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38519
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/process-registry.js
|
|
38520
38520
|
function allocateId() {
|
|
38521
38521
|
nextIdSeq += 1;
|
|
38522
38522
|
return `pe_${Date.now().toString(36)}_${nextIdSeq.toString(36)}`;
|
|
@@ -38640,7 +38640,7 @@ function createInMemoryProcessRegistry2(options) {
|
|
|
38640
38640
|
}
|
|
38641
38641
|
var nextIdSeq = 0;
|
|
38642
38642
|
|
|
38643
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38643
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/runtime-paths.js
|
|
38644
38644
|
function ambientRuntimePaths2() {
|
|
38645
38645
|
const cwd = getProcessCwd2();
|
|
38646
38646
|
return { cwd, home: getHomeDir() ?? cwd };
|
|
@@ -38650,7 +38650,7 @@ var init_runtime_paths = __esm(() => {
|
|
|
38650
38650
|
init_path2();
|
|
38651
38651
|
});
|
|
38652
38652
|
|
|
38653
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38653
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/schema-validation.js
|
|
38654
38654
|
async function loadStructuredConfig(path7, options = {}) {
|
|
38655
38655
|
const content = await (options.fileSystem ?? createNodeFileSystem3()).readFile(path7);
|
|
38656
38656
|
return await parseStructuredConfig(content, path7, options);
|
|
@@ -38933,10 +38933,10 @@ var init_schema_validation2 = __esm(() => {
|
|
|
38933
38933
|
defaultResolve = typeof Bun !== "undefined" ? (specifier, from) => Bun.resolveSync(specifier, from) : undefined;
|
|
38934
38934
|
});
|
|
38935
38935
|
|
|
38936
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38936
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/types.js
|
|
38937
38937
|
var init_types2 = () => {};
|
|
38938
38938
|
|
|
38939
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
38939
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
38940
38940
|
var exports_dist2 = {};
|
|
38941
38941
|
__export(exports_dist2, {
|
|
38942
38942
|
writeJsonFile: () => writeJsonFile2,
|
|
@@ -41821,7 +41821,7 @@ var init_mod = __esm(() => {
|
|
|
41821
41821
|
init_config3();
|
|
41822
41822
|
});
|
|
41823
41823
|
|
|
41824
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
41824
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/logger.js
|
|
41825
41825
|
function toLogTapeLevel(level) {
|
|
41826
41826
|
return level === "warn" ? "warning" : level;
|
|
41827
41827
|
}
|
|
@@ -43374,7 +43374,7 @@ var require_src = __commonJS((exports) => {
|
|
|
43374
43374
|
};
|
|
43375
43375
|
});
|
|
43376
43376
|
|
|
43377
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43377
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/sdk.js
|
|
43378
43378
|
function getTelemetryConfig(configPartial = {}) {
|
|
43379
43379
|
return {
|
|
43380
43380
|
enabled: configPartial.enabled ?? CONFIG_DEFAULTS.enabled,
|
|
@@ -43410,7 +43410,7 @@ var init_sdk = __esm(() => {
|
|
|
43410
43410
|
resolvedConfig = getTelemetryConfig();
|
|
43411
43411
|
});
|
|
43412
43412
|
|
|
43413
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43413
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/tracing.js
|
|
43414
43414
|
function isSuppressed(tracer2) {
|
|
43415
43415
|
return tracer2 === undefined && !getResolvedConfig().enabled;
|
|
43416
43416
|
}
|
|
@@ -43450,7 +43450,7 @@ var init_tracing2 = __esm(() => {
|
|
|
43450
43450
|
import_api2 = __toESM(require_src(), 1);
|
|
43451
43451
|
});
|
|
43452
43452
|
|
|
43453
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43453
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/metrics.js
|
|
43454
43454
|
function getMeter() {
|
|
43455
43455
|
return import_api3.metrics.getMeter(METER_NAME, METER_VERSION);
|
|
43456
43456
|
}
|
|
@@ -43547,7 +43547,7 @@ var init_metrics = __esm(() => {
|
|
|
43547
43547
|
instruments = {};
|
|
43548
43548
|
});
|
|
43549
43549
|
|
|
43550
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43550
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/event-bus/event-bus.js
|
|
43551
43551
|
function busLogger() {
|
|
43552
43552
|
if (!_busLogger)
|
|
43553
43553
|
_busLogger = getLogger2("event-bus");
|
|
@@ -43800,7 +43800,7 @@ var init_event_bus = __esm(() => {
|
|
|
43800
43800
|
init_metrics();
|
|
43801
43801
|
});
|
|
43802
43802
|
|
|
43803
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43803
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/event-bus/default-observers.js
|
|
43804
43804
|
function obsLogger() {
|
|
43805
43805
|
if (!_obsLogger)
|
|
43806
43806
|
_obsLogger = getLogger2("event-bus.observers");
|
|
@@ -43864,7 +43864,7 @@ var init_default_observers = __esm(() => {
|
|
|
43864
43864
|
init_event_bus();
|
|
43865
43865
|
});
|
|
43866
43866
|
|
|
43867
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43867
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/event-bus/file-observer.js
|
|
43868
43868
|
function parentDir(filePath) {
|
|
43869
43869
|
const idx = filePath.lastIndexOf("/");
|
|
43870
43870
|
return idx <= 0 ? "." : filePath.slice(0, idx);
|
|
@@ -43962,7 +43962,7 @@ var init_file_observer = __esm(() => {
|
|
|
43962
43962
|
init_logger3();
|
|
43963
43963
|
});
|
|
43964
43964
|
|
|
43965
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43965
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/internals/drain.js
|
|
43966
43966
|
function settleWithin(promise2, deadline) {
|
|
43967
43967
|
const remaining = deadline - Date.now();
|
|
43968
43968
|
if (remaining <= 0)
|
|
@@ -43977,7 +43977,7 @@ function settleWithin(promise2, deadline) {
|
|
|
43977
43977
|
return settled;
|
|
43978
43978
|
}
|
|
43979
43979
|
|
|
43980
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
43980
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/scheduler/node.js
|
|
43981
43981
|
function parseInterval(cron) {
|
|
43982
43982
|
const trimmed = cron.trim();
|
|
43983
43983
|
const num = Number(trimmed);
|
|
@@ -44071,7 +44071,7 @@ var init_node3 = __esm(() => {
|
|
|
44071
44071
|
init_metrics();
|
|
44072
44072
|
});
|
|
44073
44073
|
|
|
44074
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
44074
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/scheduler-node.js
|
|
44075
44075
|
var exports_scheduler_node = {};
|
|
44076
44076
|
__export(exports_scheduler_node, {
|
|
44077
44077
|
NodeSchedulerAdapter: () => NodeSchedulerAdapter
|
|
@@ -50873,14 +50873,22 @@ function buildMessageWhereClauses(sel, alias3) {
|
|
|
50873
50873
|
)`);
|
|
50874
50874
|
params.push(sel.runId);
|
|
50875
50875
|
} else if (sel.taskWbs != null) {
|
|
50876
|
-
clauses.push(`
|
|
50877
|
-
|
|
50878
|
-
|
|
50879
|
-
|
|
50880
|
-
|
|
50881
|
-
|
|
50876
|
+
clauses.push(`(
|
|
50877
|
+
EXISTS (
|
|
50878
|
+
SELECT 1 FROM task_run_links trl_scope
|
|
50879
|
+
JOIN history_run_session hrs_scope ON hrs_scope.run_id = trl_scope.run_id
|
|
50880
|
+
WHERE trl_scope.wbs = ? AND hrs_scope.session_id IS NOT NULL
|
|
50881
|
+
AND hrs_scope.source = ${alias3}.source
|
|
50882
|
+
AND hrs_scope.session_id = ${alias3}.session_id
|
|
50883
|
+
)
|
|
50884
|
+
OR EXISTS (
|
|
50885
|
+
SELECT 1 FROM history_task_session hts_scope
|
|
50886
|
+
WHERE hts_scope.wbs = ?
|
|
50887
|
+
AND hts_scope.source = ${alias3}.source
|
|
50888
|
+
AND hts_scope.session_id = ${alias3}.session_id
|
|
50889
|
+
)
|
|
50882
50890
|
)`);
|
|
50883
|
-
params.push(sel.taskWbs);
|
|
50891
|
+
params.push(sel.taskWbs, sel.taskWbs);
|
|
50884
50892
|
}
|
|
50885
50893
|
return { clauses, params };
|
|
50886
50894
|
}
|
|
@@ -51537,14 +51545,78 @@ async function historyKpiTrend(db2, sel, opts) {
|
|
|
51537
51545
|
GROUP BY DATE(s.ts)
|
|
51538
51546
|
ORDER BY day ASC`, ...params, ...wm.params);
|
|
51539
51547
|
}
|
|
51548
|
+
async function toolSequenceQuery(db2, scope, filters = {}, limit = 5000) {
|
|
51549
|
+
const fetchLimit = limit + 1;
|
|
51550
|
+
const params = [];
|
|
51551
|
+
const clauses = [];
|
|
51552
|
+
if (scope.mode === "session") {
|
|
51553
|
+
clauses.push("tc.source = ? AND tc.session_id = ?");
|
|
51554
|
+
params.push(scope.source, scope.sessionId);
|
|
51555
|
+
} else {
|
|
51556
|
+
const { where, params: selParams } = buildMessageWhere(scope.sel, "m");
|
|
51557
|
+
if (where !== "") {
|
|
51558
|
+
clauses.push(where.startsWith("WHERE ") ? where.slice(6) : where);
|
|
51559
|
+
params.push(...selParams);
|
|
51560
|
+
}
|
|
51561
|
+
}
|
|
51562
|
+
if (filters.toolNames && filters.toolNames.length > 0) {
|
|
51563
|
+
const placeholders = filters.toolNames.map(() => "?").join(", ");
|
|
51564
|
+
clauses.push(`tc.tool_name IN (${placeholders})`);
|
|
51565
|
+
params.push(...filters.toolNames);
|
|
51566
|
+
}
|
|
51567
|
+
if (filters.status && filters.status !== "all") {
|
|
51568
|
+
clauses.push("tc.status = ?");
|
|
51569
|
+
params.push(filters.status);
|
|
51570
|
+
}
|
|
51571
|
+
if (filters.search && filters.search.trim().length > 0) {
|
|
51572
|
+
const searchPattern = `%${escapeLike(filters.search.trim())}%`;
|
|
51573
|
+
clauses.push("(tc.args_raw LIKE ? ESCAPE '!' OR tc.error_text LIKE ? ESCAPE '!' OR tc.tool_name LIKE ? ESCAPE '!')");
|
|
51574
|
+
params.push(searchPattern, searchPattern, searchPattern);
|
|
51575
|
+
}
|
|
51576
|
+
const whereCombined = clauses.length > 0 ? `WHERE ${clauses.join(" AND ")}` : "";
|
|
51577
|
+
const folded = withMessageDedup(whereCombined);
|
|
51578
|
+
params.push(fetchLimit);
|
|
51579
|
+
const rows = await db2.queryAll(`SELECT tc.seq AS toolSeq,
|
|
51580
|
+
COALESCE(tc.started_at, m.ts) AS ts,
|
|
51581
|
+
tc.tool_name AS toolName,
|
|
51582
|
+
tc.status AS status,
|
|
51583
|
+
tc.duration_ms AS durationMs,
|
|
51584
|
+
tc.result_bytes AS resultBytes,
|
|
51585
|
+
tc.args_raw AS argsRaw,
|
|
51586
|
+
tc.args_digest AS argsDigest,
|
|
51587
|
+
tc.error_text AS errorText,
|
|
51588
|
+
tc.call_id AS callId,
|
|
51589
|
+
tc.message_hash AS messageHash,
|
|
51590
|
+
tc.session_id AS sessionId,
|
|
51591
|
+
tc.source AS source,
|
|
51592
|
+
m.model AS model,
|
|
51593
|
+
(SELECT COUNT(*) FROM history_tool_call l WHERE l.message_hash = m.record_hash) AS links,
|
|
51594
|
+
m.input_tokens AS inputTokens,
|
|
51595
|
+
m.cache_read_tokens AS cacheReadTokens,
|
|
51596
|
+
m.output_tokens AS outputTokens
|
|
51597
|
+
FROM history_tool_call tc
|
|
51598
|
+
JOIN history_message m ON m.record_hash = tc.message_hash
|
|
51599
|
+
${folded}
|
|
51600
|
+
ORDER BY COALESCE(tc.started_at, m.ts), tc.source, tc.session_id, tc.seq
|
|
51601
|
+
LIMIT ?`, ...params);
|
|
51602
|
+
const truncated = rows.length > limit;
|
|
51603
|
+
const finalRows = truncated ? rows.slice(0, limit) : rows;
|
|
51604
|
+
return {
|
|
51605
|
+
truncated,
|
|
51606
|
+
rows: finalRows
|
|
51607
|
+
};
|
|
51608
|
+
}
|
|
51540
51609
|
var MESSAGE_DEDUP = `(m.rowid IN (
|
|
51541
51610
|
SELECT MAX(rowid) FROM history_message WHERE request_id IS NOT NULL GROUP BY request_id
|
|
51542
51611
|
) OR m.request_id IS NULL)`, CACHE_WASTE_MIN_INPUT_TOKENS = 1e5, CACHE_WASTE_MAX_REUSE_FRACTION = 0.1, BUCKET_SECONDS, HISTORY_SKILL_NAME_SQL = `CASE
|
|
51543
|
-
WHEN LOWER(tc.tool_name) IN ('skill', 'use_skill', 'invoke_skill') AND json_valid(tc.args_raw)
|
|
51612
|
+
WHEN LOWER(tc.tool_name) IN ('skill', 'use_skill', 'invoke_skill', 'slashcommand', 'slash_command', 'run_skill', 'call_skill', 'execute_skill') AND json_valid(tc.args_raw)
|
|
51544
51613
|
THEN COALESCE(
|
|
51545
51614
|
CAST(json_extract(tc.args_raw, '$.skill') AS TEXT),
|
|
51546
51615
|
CAST(json_extract(tc.args_raw, '$.skill_name') AS TEXT),
|
|
51616
|
+
CAST(json_extract(tc.args_raw, '$.skillName') AS TEXT),
|
|
51547
51617
|
CAST(json_extract(tc.args_raw, '$.name') AS TEXT),
|
|
51618
|
+
CAST(json_extract(tc.args_raw, '$.command') AS TEXT),
|
|
51619
|
+
CAST(json_extract(tc.args_raw, '$.command_name') AS TEXT),
|
|
51548
51620
|
CAST(json_extract(tc.args_raw, '$') AS TEXT),
|
|
51549
51621
|
''
|
|
51550
51622
|
)
|
|
@@ -52164,17 +52236,66 @@ async function historyBoardKpiTrendFromRollup(db2, sel) {
|
|
|
52164
52236
|
var MESSAGE_DEDUP2 = `(m.rowid IN (
|
|
52165
52237
|
SELECT MIN(rowid) FROM history_message WHERE request_id IS NOT NULL GROUP BY request_id
|
|
52166
52238
|
) OR m.request_id IS NULL)`, SKILL_NAME_SQL = `CASE
|
|
52167
|
-
WHEN LOWER(tc.tool_name) IN ('skill', 'use_skill', 'invoke_skill') AND json_valid(tc.args_raw)
|
|
52239
|
+
WHEN LOWER(tc.tool_name) IN ('skill', 'use_skill', 'invoke_skill', 'slashcommand', 'slash_command', 'run_skill', 'call_skill', 'execute_skill') AND json_valid(tc.args_raw)
|
|
52168
52240
|
THEN COALESCE(
|
|
52169
52241
|
CAST(json_extract(tc.args_raw, '$.skill') AS TEXT),
|
|
52170
52242
|
CAST(json_extract(tc.args_raw, '$.skill_name') AS TEXT),
|
|
52243
|
+
CAST(json_extract(tc.args_raw, '$.skillName') AS TEXT),
|
|
52171
52244
|
CAST(json_extract(tc.args_raw, '$.name') AS TEXT),
|
|
52245
|
+
CAST(json_extract(tc.args_raw, '$.command') AS TEXT),
|
|
52246
|
+
CAST(json_extract(tc.args_raw, '$.command_name') AS TEXT),
|
|
52172
52247
|
CAST(json_extract(tc.args_raw, '$') AS TEXT),
|
|
52173
52248
|
''
|
|
52174
52249
|
)
|
|
52175
52250
|
ELSE ''
|
|
52176
52251
|
END`, HISTORY_BOARD_ROLLUP_VERSION = 2;
|
|
52177
52252
|
|
|
52253
|
+
// ../../packages/domain/src/analytics/history-reset.ts
|
|
52254
|
+
async function resetHistoryTables(db2) {
|
|
52255
|
+
const rows = await db2.queryAll("SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE 'history\\_%' ESCAPE '\\'");
|
|
52256
|
+
const existing = new Set(rows.map((r) => r.name));
|
|
52257
|
+
const cleared = HISTORY_RESET_TABLES.filter((t) => existing.has(t));
|
|
52258
|
+
const skipped = HISTORY_RESET_TABLES.filter((t) => !existing.has(t));
|
|
52259
|
+
const known = new Set(HISTORY_RESET_TABLES);
|
|
52260
|
+
const unknown2 = rows.map((r) => r.name).filter((t) => !known.has(t));
|
|
52261
|
+
if (cleared.length > 0) {
|
|
52262
|
+
await db2.batch(cleared.map((table3) => ({ sql: `DELETE FROM "${table3}"`, params: [] })));
|
|
52263
|
+
}
|
|
52264
|
+
return { cleared, skipped, unknown: unknown2 };
|
|
52265
|
+
}
|
|
52266
|
+
var HISTORY_RESET_TABLES;
|
|
52267
|
+
var init_history_reset = __esm(() => {
|
|
52268
|
+
HISTORY_RESET_TABLES = [
|
|
52269
|
+
"history_message",
|
|
52270
|
+
"history_tool_call",
|
|
52271
|
+
"history_run_session",
|
|
52272
|
+
"history_task_session",
|
|
52273
|
+
"history_etl_agy",
|
|
52274
|
+
"history_etl_antigravity",
|
|
52275
|
+
"history_etl_claude",
|
|
52276
|
+
"history_etl_codex",
|
|
52277
|
+
"history_etl_gemini",
|
|
52278
|
+
"history_etl_grok",
|
|
52279
|
+
"history_etl_omp",
|
|
52280
|
+
"history_etl_openclaw",
|
|
52281
|
+
"history_etl_opencode",
|
|
52282
|
+
"history_etl_pi",
|
|
52283
|
+
"history_daily_stats",
|
|
52284
|
+
"history_board_loop_findings",
|
|
52285
|
+
"history_board_message_5m",
|
|
52286
|
+
"history_board_model_stats",
|
|
52287
|
+
"history_board_ranked_steps",
|
|
52288
|
+
"history_board_rollup_meta",
|
|
52289
|
+
"history_board_session_stats",
|
|
52290
|
+
"history_board_source_daily",
|
|
52291
|
+
"history_board_source_stats",
|
|
52292
|
+
"history_board_tool_5m",
|
|
52293
|
+
"history_board_tool_stats",
|
|
52294
|
+
"history_import_checkpoint",
|
|
52295
|
+
"history_import_ledger"
|
|
52296
|
+
];
|
|
52297
|
+
});
|
|
52298
|
+
|
|
52178
52299
|
// ../../packages/domain/src/analytics/narrow-artifact.ts
|
|
52179
52300
|
function narrowArtifact(artifact, opts, artifactPath) {
|
|
52180
52301
|
const parts = [];
|
|
@@ -53729,6 +53850,135 @@ var init_run_cost = __esm(() => {
|
|
|
53729
53850
|
init_costs();
|
|
53730
53851
|
});
|
|
53731
53852
|
|
|
53853
|
+
// ../../packages/domain/src/analytics/task-attribution.ts
|
|
53854
|
+
function evidenceRefOf(record2) {
|
|
53855
|
+
const base2 = record2.sourceFile.replaceAll("\\", "/").split("/").pop() ?? record2.sourceFile;
|
|
53856
|
+
return `${base2}#${record2.sourceLine}`.slice(0, EVIDENCE_REF_MAX);
|
|
53857
|
+
}
|
|
53858
|
+
function slashWbsSet(line) {
|
|
53859
|
+
return new Set(line.match(WBS_RE) ?? []);
|
|
53860
|
+
}
|
|
53861
|
+
function spurTaskWbsSet(text3) {
|
|
53862
|
+
const hits = new Set;
|
|
53863
|
+
for (const match of text3.matchAll(SPUR_TASK_RE))
|
|
53864
|
+
hits.add(match[1]);
|
|
53865
|
+
return hits;
|
|
53866
|
+
}
|
|
53867
|
+
function classifyTaskAttribution(records) {
|
|
53868
|
+
const decision = { candidates: [], skipped: 0, ambiguous: 0 };
|
|
53869
|
+
for (const record2 of records) {
|
|
53870
|
+
if (record2.kind === "user-message") {
|
|
53871
|
+
const slash = new Set;
|
|
53872
|
+
for (const line of record2.text.split(`
|
|
53873
|
+
`)) {
|
|
53874
|
+
if (!SLASH_COMMAND_RE.test(line))
|
|
53875
|
+
continue;
|
|
53876
|
+
for (const wbs of slashWbsSet(line))
|
|
53877
|
+
slash.add(wbs);
|
|
53878
|
+
}
|
|
53879
|
+
if (slash.size === 0) {
|
|
53880
|
+
if (PLAIN_MENTION_RE.test(record2.text))
|
|
53881
|
+
decision.skipped += 1;
|
|
53882
|
+
continue;
|
|
53883
|
+
}
|
|
53884
|
+
for (const wbs of slash) {
|
|
53885
|
+
decision.candidates.push({
|
|
53886
|
+
wbs,
|
|
53887
|
+
mechanism: "slash-command",
|
|
53888
|
+
evidenceKind: "user-command",
|
|
53889
|
+
evidenceRef: evidenceRefOf(record2)
|
|
53890
|
+
});
|
|
53891
|
+
}
|
|
53892
|
+
continue;
|
|
53893
|
+
}
|
|
53894
|
+
for (const wbs of spurTaskWbsSet(record2.text)) {
|
|
53895
|
+
decision.candidates.push({
|
|
53896
|
+
wbs,
|
|
53897
|
+
mechanism: "spur-cli",
|
|
53898
|
+
evidenceKind: "cli-tool",
|
|
53899
|
+
evidenceRef: evidenceRefOf(record2)
|
|
53900
|
+
});
|
|
53901
|
+
}
|
|
53902
|
+
}
|
|
53903
|
+
return decision;
|
|
53904
|
+
}
|
|
53905
|
+
async function listAttributionSessions(db2, source, opts) {
|
|
53906
|
+
const params = [source];
|
|
53907
|
+
let whereExtra = "";
|
|
53908
|
+
if (opts.scope === "changed") {
|
|
53909
|
+
whereExtra = " AND imported_at >= ?";
|
|
53910
|
+
params.push(opts.changedSince ?? "");
|
|
53911
|
+
}
|
|
53912
|
+
params.push(ATTRIBUTION_SESSION_LIMIT);
|
|
53913
|
+
try {
|
|
53914
|
+
const rows = await db2.queryAll(`SELECT DISTINCT session_id AS sessionId FROM history_message
|
|
53915
|
+
WHERE source = ? AND session_id NOT IN ('', 'unknown', 'session')${whereExtra}
|
|
53916
|
+
ORDER BY session_id
|
|
53917
|
+
LIMIT ?`, ...params);
|
|
53918
|
+
return rows.map((r) => r.sessionId);
|
|
53919
|
+
} catch (error51) {
|
|
53920
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_message"))
|
|
53921
|
+
return [];
|
|
53922
|
+
throw error51;
|
|
53923
|
+
}
|
|
53924
|
+
}
|
|
53925
|
+
async function loadAttributionEvidence(db2, source, sessionId) {
|
|
53926
|
+
try {
|
|
53927
|
+
const userRows = await db2.queryAll(`SELECT record_hash AS recordHash, source_file AS sourceFile, source_line AS sourceLine,
|
|
53928
|
+
content_text AS text
|
|
53929
|
+
FROM history_message
|
|
53930
|
+
WHERE source = ? AND session_id = ? AND role = 'user'
|
|
53931
|
+
AND (content_text LIKE '%/sp%' OR content_text LIKE '%spur task%')
|
|
53932
|
+
LIMIT ?`, source, sessionId, ATTRIBUTION_EVIDENCE_LIMIT);
|
|
53933
|
+
const toolRows = await db2.queryAll(`SELECT record_hash AS recordHash, source_file AS sourceFile, source_line AS sourceLine,
|
|
53934
|
+
args_raw AS text
|
|
53935
|
+
FROM history_tool_call
|
|
53936
|
+
WHERE source = ? AND session_id = ?
|
|
53937
|
+
AND (args_raw LIKE '%spur task%' OR args_raw LIKE '%index.ts task%')
|
|
53938
|
+
LIMIT ?`, source, sessionId, ATTRIBUTION_EVIDENCE_LIMIT);
|
|
53939
|
+
const evidence = [];
|
|
53940
|
+
for (const row of userRows) {
|
|
53941
|
+
if (row.text != null && row.text.length > 0) {
|
|
53942
|
+
evidence.push({
|
|
53943
|
+
kind: "user-message",
|
|
53944
|
+
text: row.text,
|
|
53945
|
+
recordHash: row.recordHash,
|
|
53946
|
+
sourceFile: row.sourceFile,
|
|
53947
|
+
sourceLine: row.sourceLine
|
|
53948
|
+
});
|
|
53949
|
+
}
|
|
53950
|
+
}
|
|
53951
|
+
for (const row of toolRows) {
|
|
53952
|
+
if (row.text != null && row.text.length > 0) {
|
|
53953
|
+
evidence.push({
|
|
53954
|
+
kind: "tool-call",
|
|
53955
|
+
text: row.text,
|
|
53956
|
+
recordHash: row.recordHash,
|
|
53957
|
+
sourceFile: row.sourceFile,
|
|
53958
|
+
sourceLine: row.sourceLine
|
|
53959
|
+
});
|
|
53960
|
+
}
|
|
53961
|
+
}
|
|
53962
|
+
return evidence;
|
|
53963
|
+
} catch (error51) {
|
|
53964
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_message"))
|
|
53965
|
+
return [];
|
|
53966
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_tool_call"))
|
|
53967
|
+
return [];
|
|
53968
|
+
throw error51;
|
|
53969
|
+
}
|
|
53970
|
+
}
|
|
53971
|
+
function emptyAttributionSummary() {
|
|
53972
|
+
return { sessionsEvaluated: 0, linksCreated: 0, linksAlreadyPresent: 0, skippedEvidence: 0, ambiguousEvidence: 0 };
|
|
53973
|
+
}
|
|
53974
|
+
var SLASH_COMMAND_RE, SPUR_TASK_RE, WBS_RE, PLAIN_MENTION_RE, EVIDENCE_REF_MAX = 200, ATTRIBUTION_SESSION_LIMIT = 5000, ATTRIBUTION_EVIDENCE_LIMIT = 500;
|
|
53975
|
+
var init_task_attribution = __esm(() => {
|
|
53976
|
+
SLASH_COMMAND_RE = /^[\s>]*\/sp[:_-]dev\S*/;
|
|
53977
|
+
SPUR_TASK_RE = /(?:^|[\s;&|(])(?:spur|apps\/cli\/src\/index\.ts)\s+task\s+\S+\s+(\d{4})(?![\w.\-/:%])/g;
|
|
53978
|
+
WBS_RE = /(?<![\w.\-/:%])\d{4}(?![\w.\-/:%])/g;
|
|
53979
|
+
PLAIN_MENTION_RE = /\b\d{4}\b/;
|
|
53980
|
+
});
|
|
53981
|
+
|
|
53732
53982
|
// ../../packages/domain/src/analytics/verified-outcome.ts
|
|
53733
53983
|
function deriveVerifiedOutcomeStat(inputs, window2) {
|
|
53734
53984
|
const byWbs = new Map;
|
|
@@ -53824,6 +54074,7 @@ var init_analytics = __esm(() => {
|
|
|
53824
54074
|
init_assistant_duration();
|
|
53825
54075
|
init_costs();
|
|
53826
54076
|
init_forensic_query();
|
|
54077
|
+
init_history_reset();
|
|
53827
54078
|
init_models();
|
|
53828
54079
|
init_narrow_artifact();
|
|
53829
54080
|
init_render_forensics();
|
|
@@ -53833,6 +54084,7 @@ var init_analytics = __esm(() => {
|
|
|
53833
54084
|
init_retro_correlation();
|
|
53834
54085
|
init_role_tokens();
|
|
53835
54086
|
init_run_cost();
|
|
54087
|
+
init_task_attribution();
|
|
53836
54088
|
init_watermark();
|
|
53837
54089
|
});
|
|
53838
54090
|
|
|
@@ -54551,7 +54803,7 @@ class ActionRunDao {
|
|
|
54551
54803
|
}
|
|
54552
54804
|
}
|
|
54553
54805
|
|
|
54554
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
54806
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
|
|
54555
54807
|
function sqlExpressionToText(value) {
|
|
54556
54808
|
if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
|
|
54557
54809
|
return;
|
|
@@ -54574,7 +54826,7 @@ function getDrizzleTableName(table3) {
|
|
|
54574
54826
|
return String(table3[nameSym]);
|
|
54575
54827
|
}
|
|
54576
54828
|
|
|
54577
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
54829
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
|
|
54578
54830
|
function quoteIdent(name) {
|
|
54579
54831
|
return `"${name.replace(/"/g, '""')}"`;
|
|
54580
54832
|
}
|
|
@@ -54946,7 +55198,7 @@ var init_drizzle_zod = __esm(() => {
|
|
|
54946
55198
|
};
|
|
54947
55199
|
});
|
|
54948
55200
|
|
|
54949
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
55201
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
|
|
54950
55202
|
function defineTable(name, columns2) {
|
|
54951
55203
|
const table3 = sqliteTable(name, columns2);
|
|
54952
55204
|
let insert2;
|
|
@@ -54980,7 +55232,7 @@ var init_define_table = __esm(() => {
|
|
|
54980
55232
|
init_ddl();
|
|
54981
55233
|
});
|
|
54982
55234
|
|
|
54983
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
55235
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.50+dad0306531cee459/node_modules/@gobing-ai/ts-db/dist/schema/index.js
|
|
54984
55236
|
var exports_schema = {};
|
|
54985
55237
|
__export(exports_schema, {
|
|
54986
55238
|
text: () => text,
|
|
@@ -55488,6 +55740,59 @@ class TaskRunLinkDao {
|
|
|
55488
55740
|
}
|
|
55489
55741
|
}
|
|
55490
55742
|
|
|
55743
|
+
// ../../packages/domain/src/dao/task-session-dao.ts
|
|
55744
|
+
class TaskSessionDao {
|
|
55745
|
+
db;
|
|
55746
|
+
constructor(db2) {
|
|
55747
|
+
this.db = db2;
|
|
55748
|
+
}
|
|
55749
|
+
async insert(input) {
|
|
55750
|
+
const existing = await this.db.queryFirst(`SELECT exactness FROM history_task_session WHERE wbs = ? AND source = ? AND session_id = ?`, input.wbs, input.source, input.sessionId);
|
|
55751
|
+
if (existing != null) {
|
|
55752
|
+
if (input.exactness === "exact" && existing.exactness !== "exact") {
|
|
55753
|
+
await this.db.run(`UPDATE history_task_session
|
|
55754
|
+
SET exactness = ?, mechanism = ?, evidence_kind = ?, evidence_ref = ?, resolved_at = ?
|
|
55755
|
+
WHERE wbs = ? AND source = ? AND session_id = ?`, input.exactness, input.mechanism, input.evidenceKind, input.evidenceRef, input.resolvedAt, input.wbs, input.source, input.sessionId);
|
|
55756
|
+
return "created";
|
|
55757
|
+
}
|
|
55758
|
+
return "present";
|
|
55759
|
+
}
|
|
55760
|
+
await this.db.run(`INSERT INTO history_task_session (wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at)
|
|
55761
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, input.wbs, input.source, input.sessionId, input.exactness, input.mechanism, input.evidenceKind, input.evidenceRef, input.resolvedAt);
|
|
55762
|
+
return "created";
|
|
55763
|
+
}
|
|
55764
|
+
async hasLink(wbs, source, sessionId) {
|
|
55765
|
+
const row = await this.db.queryFirst(`SELECT COUNT(*) AS n FROM history_task_session WHERE wbs = ? AND source = ? AND session_id = ?`, wbs, source, sessionId);
|
|
55766
|
+
return (row?.n ?? 0) > 0;
|
|
55767
|
+
}
|
|
55768
|
+
async listByWbs(wbs) {
|
|
55769
|
+
try {
|
|
55770
|
+
return await this.db.queryAll(`SELECT wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at
|
|
55771
|
+
FROM history_task_session WHERE wbs = ? ORDER BY resolved_at, source, session_id`, wbs);
|
|
55772
|
+
} catch (error51) {
|
|
55773
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_task_session"))
|
|
55774
|
+
return [];
|
|
55775
|
+
throw error51;
|
|
55776
|
+
}
|
|
55777
|
+
}
|
|
55778
|
+
async listBySession(source, sessionId) {
|
|
55779
|
+
try {
|
|
55780
|
+
return await this.db.queryAll(`SELECT wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at
|
|
55781
|
+
FROM history_task_session WHERE source = ? AND session_id = ? ORDER BY resolved_at, wbs`, source, sessionId);
|
|
55782
|
+
} catch (error51) {
|
|
55783
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_task_session"))
|
|
55784
|
+
return [];
|
|
55785
|
+
throw error51;
|
|
55786
|
+
}
|
|
55787
|
+
}
|
|
55788
|
+
async deleteAll() {
|
|
55789
|
+
await this.db.run("DELETE FROM history_task_session");
|
|
55790
|
+
}
|
|
55791
|
+
async deleteBySource(source) {
|
|
55792
|
+
await this.db.run("DELETE FROM history_task_session WHERE source = ?", [source]);
|
|
55793
|
+
}
|
|
55794
|
+
}
|
|
55795
|
+
|
|
55491
55796
|
// ../../packages/domain/src/schema/transition-runs.ts
|
|
55492
55797
|
var transitionRunsTable, transitionRuns;
|
|
55493
55798
|
var init_transition_runs = __esm(() => {
|
|
@@ -55608,7 +55913,7 @@ var init_dao = __esm(() => {
|
|
|
55608
55913
|
init_workspace_dao();
|
|
55609
55914
|
});
|
|
55610
55915
|
|
|
55611
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
55916
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
|
|
55612
55917
|
var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
|
|
55613
55918
|
var init_errors5 = __esm(() => {
|
|
55614
55919
|
WorkflowValidationError = class WorkflowValidationError extends Error {
|
|
@@ -55643,12 +55948,12 @@ var init_errors5 = __esm(() => {
|
|
|
55643
55948
|
};
|
|
55644
55949
|
});
|
|
55645
55950
|
|
|
55646
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
55951
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
|
|
55647
55952
|
var init_event_bus2 = __esm(() => {
|
|
55648
55953
|
init_event_bus();
|
|
55649
55954
|
});
|
|
55650
55955
|
|
|
55651
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
55956
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/api-client.js
|
|
55652
55957
|
function sanitizeUrlForObservability(url2) {
|
|
55653
55958
|
try {
|
|
55654
55959
|
const parsed = new URL(url2);
|
|
@@ -55879,12 +56184,12 @@ var init_api_client = __esm(() => {
|
|
|
55879
56184
|
};
|
|
55880
56185
|
});
|
|
55881
56186
|
|
|
55882
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
56187
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
|
|
55883
56188
|
var init_telemetry = __esm(() => {
|
|
55884
56189
|
init_tracing2();
|
|
55885
56190
|
});
|
|
55886
56191
|
|
|
55887
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
56192
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/index.js
|
|
55888
56193
|
var init_dist6 = __esm(() => {
|
|
55889
56194
|
init_api_client();
|
|
55890
56195
|
init_event_bus2();
|
|
@@ -55892,7 +56197,7 @@ var init_dist6 = __esm(() => {
|
|
|
55892
56197
|
init_telemetry();
|
|
55893
56198
|
});
|
|
55894
56199
|
|
|
55895
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56200
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
|
|
55896
56201
|
function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
|
|
55897
56202
|
return {
|
|
55898
56203
|
workflow: workflowName,
|
|
@@ -56176,7 +56481,7 @@ var init_run_lifecycle = __esm(() => {
|
|
|
56176
56481
|
];
|
|
56177
56482
|
});
|
|
56178
56483
|
|
|
56179
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56484
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
|
|
56180
56485
|
class CapabilityRegistry {
|
|
56181
56486
|
kind;
|
|
56182
56487
|
capabilities = new Map;
|
|
@@ -56207,7 +56512,7 @@ class CapabilityRegistry {
|
|
|
56207
56512
|
}
|
|
56208
56513
|
}
|
|
56209
56514
|
|
|
56210
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56515
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
|
|
56211
56516
|
function assertRelativeExtensionPath(path9, options = {}) {
|
|
56212
56517
|
const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
|
|
56213
56518
|
if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
|
|
@@ -56218,7 +56523,7 @@ function assertRelativeExtensionPath(path9, options = {}) {
|
|
|
56218
56523
|
}
|
|
56219
56524
|
}
|
|
56220
56525
|
|
|
56221
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56526
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
|
|
56222
56527
|
import { isAbsolute, resolve } from "path";
|
|
56223
56528
|
async function loadExtensionModules(refs, options, register) {
|
|
56224
56529
|
if (refs.length === 0)
|
|
@@ -56257,17 +56562,17 @@ async function loadExtensionModules(refs, options, register) {
|
|
|
56257
56562
|
}
|
|
56258
56563
|
var init_extension_loader = () => {};
|
|
56259
56564
|
|
|
56260
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56565
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
|
|
56261
56566
|
var init_extension = __esm(() => {
|
|
56262
56567
|
init_extension_loader();
|
|
56263
56568
|
});
|
|
56264
56569
|
|
|
56265
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56570
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.50+abb1690621baaa2b/node_modules/@gobing-ai/ts-runtime/dist/extension.js
|
|
56266
56571
|
var init_extension2 = __esm(() => {
|
|
56267
56572
|
init_extension();
|
|
56268
56573
|
});
|
|
56269
56574
|
|
|
56270
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56575
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
|
|
56271
56576
|
var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, relativeExtensionPath, WorkflowExtensionsSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
|
|
56272
56577
|
var init_schema2 = __esm(() => {
|
|
56273
56578
|
init_extension2();
|
|
@@ -56369,7 +56674,7 @@ var init_schema2 = __esm(() => {
|
|
|
56369
56674
|
WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
|
|
56370
56675
|
});
|
|
56371
56676
|
|
|
56372
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56677
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
|
|
56373
56678
|
async function loadWorkflowDef(path9, options = {}) {
|
|
56374
56679
|
return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
|
|
56375
56680
|
}
|
|
@@ -56536,7 +56841,7 @@ var init_config4 = __esm(() => {
|
|
|
56536
56841
|
RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
|
|
56537
56842
|
});
|
|
56538
56843
|
|
|
56539
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56844
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
|
|
56540
56845
|
function collectWorkflowExtensions(sourceName, sourceDir, extensions) {
|
|
56541
56846
|
if (extensions === undefined)
|
|
56542
56847
|
return [];
|
|
@@ -56600,7 +56905,7 @@ var init_extensions = __esm(() => {
|
|
|
56600
56905
|
init_errors5();
|
|
56601
56906
|
});
|
|
56602
56907
|
|
|
56603
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56908
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
|
|
56604
56909
|
class WorkflowEngineHost {
|
|
56605
56910
|
lifecycleBus;
|
|
56606
56911
|
actions = new CapabilityRegistry("workflow action");
|
|
@@ -56770,7 +57075,7 @@ var init_host = __esm(() => {
|
|
|
56770
57075
|
init_errors5();
|
|
56771
57076
|
});
|
|
56772
57077
|
|
|
56773
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57078
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
|
|
56774
57079
|
var WORKFLOW_ENGINE_SCHEMA_SQL;
|
|
56775
57080
|
var init_schema_sql = __esm(() => {
|
|
56776
57081
|
WORKFLOW_ENGINE_SCHEMA_SQL = `
|
|
@@ -56843,7 +57148,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
|
|
|
56843
57148
|
`.trim();
|
|
56844
57149
|
});
|
|
56845
57150
|
|
|
56846
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57151
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
|
|
56847
57152
|
async function applyWorkflowEngineSchema(db2) {
|
|
56848
57153
|
for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
|
|
56849
57154
|
const sql4 = statement.trim();
|
|
@@ -57159,7 +57464,7 @@ var init_persistence = __esm(() => {
|
|
|
57159
57464
|
init_schema_sql();
|
|
57160
57465
|
});
|
|
57161
57466
|
|
|
57162
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57467
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
|
|
57163
57468
|
function mergeVars(workflowVars = {}, overrideVars = {}) {
|
|
57164
57469
|
return { ...workflowVars, ...overrideVars };
|
|
57165
57470
|
}
|
|
@@ -57219,7 +57524,7 @@ var init_variables = __esm(() => {
|
|
|
57219
57524
|
TEMPLATE_REF = /\$\{([^}]+)\}/g;
|
|
57220
57525
|
});
|
|
57221
57526
|
|
|
57222
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57527
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
|
|
57223
57528
|
async function runActionStep(action, vars, deps) {
|
|
57224
57529
|
const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
|
|
57225
57530
|
const resolved = resolveTemplates(action.options ?? {}, {
|
|
@@ -57283,7 +57588,7 @@ var init_action_step = __esm(() => {
|
|
|
57283
57588
|
init_variables();
|
|
57284
57589
|
});
|
|
57285
57590
|
|
|
57286
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57591
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
|
|
57287
57592
|
class StateMachineDriver {
|
|
57288
57593
|
options;
|
|
57289
57594
|
constructor(options) {
|
|
@@ -57419,7 +57724,7 @@ var init_state_machine = __esm(() => {
|
|
|
57419
57724
|
EMPTY_OUTCOME = { outcome: "completed", result: undefined, setVars: undefined };
|
|
57420
57725
|
});
|
|
57421
57726
|
|
|
57422
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57727
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
|
|
57423
57728
|
class TransitionFlowDriver {
|
|
57424
57729
|
options;
|
|
57425
57730
|
constructor(options) {
|
|
@@ -57538,7 +57843,7 @@ var init_transition_flow = __esm(() => {
|
|
|
57538
57843
|
init_variables();
|
|
57539
57844
|
});
|
|
57540
57845
|
|
|
57541
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57846
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
|
|
57542
57847
|
class WorkflowService {
|
|
57543
57848
|
host;
|
|
57544
57849
|
persistence;
|
|
@@ -57763,7 +58068,7 @@ var init_service = __esm(() => {
|
|
|
57763
58068
|
init_variables();
|
|
57764
58069
|
});
|
|
57765
58070
|
|
|
57766
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
58071
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
|
|
57767
58072
|
var init_dist7 = __esm(() => {
|
|
57768
58073
|
init_config4();
|
|
57769
58074
|
init_extensions();
|
|
@@ -57773,7 +58078,7 @@ var init_dist7 = __esm(() => {
|
|
|
57773
58078
|
init_service();
|
|
57774
58079
|
});
|
|
57775
58080
|
|
|
57776
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58081
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
|
|
57777
58082
|
import { createHash as createHash3 } from "crypto";
|
|
57778
58083
|
function stableJson(value) {
|
|
57779
58084
|
if (Array.isArray(value)) {
|
|
@@ -57790,7 +58095,7 @@ function sha256(value) {
|
|
|
57790
58095
|
}
|
|
57791
58096
|
var init_hash = () => {};
|
|
57792
58097
|
|
|
57793
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58098
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
|
|
57794
58099
|
var HistoryImportError;
|
|
57795
58100
|
var init_errors6 = __esm(() => {
|
|
57796
58101
|
HistoryImportError = class HistoryImportError extends Error {
|
|
@@ -57803,7 +58108,7 @@ var init_errors6 = __esm(() => {
|
|
|
57803
58108
|
};
|
|
57804
58109
|
});
|
|
57805
58110
|
|
|
57806
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58111
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
|
|
57807
58112
|
var HISTORY_IMPORT_SCHEMA_SQL;
|
|
57808
58113
|
var init_schema_sql2 = __esm(() => {
|
|
57809
58114
|
HISTORY_IMPORT_SCHEMA_SQL = `
|
|
@@ -57890,7 +58195,7 @@ CREATE INDEX IF NOT EXISTS idx_history_tool_call_message_hash
|
|
|
57890
58195
|
`.trim();
|
|
57891
58196
|
});
|
|
57892
58197
|
|
|
57893
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58198
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
|
|
57894
58199
|
function identityFieldMap(keys) {
|
|
57895
58200
|
const map2 = {};
|
|
57896
58201
|
for (const key of keys) {
|
|
@@ -57921,15 +58226,73 @@ function redactArgs(args) {
|
|
|
57921
58226
|
}
|
|
57922
58227
|
return args;
|
|
57923
58228
|
}
|
|
57924
|
-
function
|
|
57925
|
-
|
|
57926
|
-
if (allow === undefined || !allow.includes(toolName))
|
|
58229
|
+
function bashCommandOf(args) {
|
|
58230
|
+
if (args === null || typeof args !== "object")
|
|
57927
58231
|
return;
|
|
57928
|
-
|
|
57929
|
-
|
|
58232
|
+
const rec = args;
|
|
58233
|
+
const command = rec.command ?? rec.CommandLine ?? rec.cmd ?? rec.script;
|
|
58234
|
+
if (typeof command === "string")
|
|
58235
|
+
return command;
|
|
58236
|
+
if (Array.isArray(command))
|
|
58237
|
+
return command.map(String).join(" ");
|
|
58238
|
+
return;
|
|
58239
|
+
}
|
|
58240
|
+
function normalizeKey(key) {
|
|
58241
|
+
return key.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
58242
|
+
}
|
|
58243
|
+
function isShellTool(toolName) {
|
|
58244
|
+
return /^(?:bash|shell|cmd|command|exec|execcommand|executecommand|runcommand|shellcommand|runshellcommand)$/.test(normalizeKey(toolName));
|
|
58245
|
+
}
|
|
58246
|
+
function sanitizeValue(value) {
|
|
58247
|
+
if (typeof value === "string") {
|
|
58248
|
+
return value.length > 1000 ? `${value.slice(0, 1000)}[truncated ${value.length} chars]` : value;
|
|
58249
|
+
}
|
|
58250
|
+
if (Array.isArray(value))
|
|
58251
|
+
return value.map(sanitizeValue);
|
|
58252
|
+
if (value !== null && typeof value === "object") {
|
|
58253
|
+
const out = {};
|
|
58254
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
58255
|
+
out[key] = typeof entry === "string" && entry.length > 120 && BULKY_PAYLOAD_KEYS.has(normalizeKey(key)) ? `[omitted ${entry.length} chars]` : sanitizeValue(entry);
|
|
58256
|
+
}
|
|
58257
|
+
return out;
|
|
58258
|
+
}
|
|
58259
|
+
return value;
|
|
58260
|
+
}
|
|
58261
|
+
function serializeBounded(value) {
|
|
58262
|
+
const serialized = JSON.stringify(sanitizeValue(value));
|
|
58263
|
+
if (serialized.length <= GENERIC_ARGS_MAX_CHARS)
|
|
58264
|
+
return serialized;
|
|
58265
|
+
let preview = serialized;
|
|
58266
|
+
for (;; ) {
|
|
58267
|
+
const wrapper = JSON.stringify({
|
|
58268
|
+
_truncated: true,
|
|
58269
|
+
omittedChars: serialized.length - preview.length,
|
|
58270
|
+
preview
|
|
58271
|
+
});
|
|
58272
|
+
if (wrapper.length <= GENERIC_ARGS_MAX_CHARS)
|
|
58273
|
+
return wrapper;
|
|
58274
|
+
preview = preview.slice(0, preview.length - (wrapper.length - GENERIC_ARGS_MAX_CHARS));
|
|
58275
|
+
}
|
|
58276
|
+
}
|
|
58277
|
+
function maybeArgsRaw(_source, toolName, args) {
|
|
57930
58278
|
if (args === undefined || args === null)
|
|
57931
58279
|
return;
|
|
57932
|
-
|
|
58280
|
+
let value = args;
|
|
58281
|
+
if (typeof args === "string") {
|
|
58282
|
+
try {
|
|
58283
|
+
value = JSON.parse(args);
|
|
58284
|
+
} catch {
|
|
58285
|
+
return args.length > BASH_COMMAND_MAX_CHARS ? args.slice(0, BASH_COMMAND_MAX_CHARS) : args;
|
|
58286
|
+
}
|
|
58287
|
+
}
|
|
58288
|
+
if (value !== null && typeof value === "object") {
|
|
58289
|
+
const cmd = bashCommandOf(value);
|
|
58290
|
+
if (cmd !== undefined && isShellTool(toolName)) {
|
|
58291
|
+
return cmd.length > BASH_COMMAND_MAX_CHARS ? cmd.slice(0, BASH_COMMAND_MAX_CHARS) : cmd;
|
|
58292
|
+
}
|
|
58293
|
+
return serializeBounded(value);
|
|
58294
|
+
}
|
|
58295
|
+
return JSON.stringify(value);
|
|
57933
58296
|
}
|
|
57934
58297
|
function claudeSplit(raw) {
|
|
57935
58298
|
const entries = [];
|
|
@@ -58423,63 +58786,71 @@ function codexSplit(raw, context4) {
|
|
|
58423
58786
|
function agySplit(raw, context4) {
|
|
58424
58787
|
const entries = [];
|
|
58425
58788
|
const recordType = String(raw.type ?? "");
|
|
58426
|
-
const explicitSessionId = s(raw.session_id, raw.conversation_id);
|
|
58789
|
+
const explicitSessionId = s(raw.session_id, raw.conversation_id, raw.conversationId);
|
|
58427
58790
|
const pathSessionId = context4?.sourceFile ? sessionIdFromSourcePath("agy", context4.sourceFile) : undefined;
|
|
58428
58791
|
const sessionId = explicitSessionId ?? pathSessionId ?? "unknown";
|
|
58429
|
-
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : 0;
|
|
58792
|
+
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : context4?.sourceLine ?? 0;
|
|
58430
58793
|
const ts = timestampOf(raw.created_at, raw.timestamp, raw.ts);
|
|
58431
58794
|
let role;
|
|
58432
58795
|
let disposition;
|
|
58433
58796
|
let contentText = null;
|
|
58434
|
-
|
|
58435
|
-
|
|
58436
|
-
|
|
58437
|
-
|
|
58438
|
-
|
|
58439
|
-
|
|
58440
|
-
|
|
58441
|
-
|
|
58442
|
-
|
|
58443
|
-
|
|
58444
|
-
|
|
58445
|
-
|
|
58446
|
-
|
|
58447
|
-
|
|
58448
|
-
|
|
58449
|
-
|
|
58450
|
-
|
|
58451
|
-
|
|
58452
|
-
|
|
58453
|
-
|
|
58454
|
-
|
|
58455
|
-
|
|
58456
|
-
|
|
58457
|
-
|
|
58458
|
-
|
|
58459
|
-
|
|
58460
|
-
|
|
58461
|
-
|
|
58462
|
-
|
|
58463
|
-
|
|
58464
|
-
|
|
58465
|
-
|
|
58466
|
-
|
|
58467
|
-
|
|
58468
|
-
|
|
58469
|
-
|
|
58470
|
-
|
|
58471
|
-
|
|
58472
|
-
|
|
58473
|
-
|
|
58474
|
-
|
|
58475
|
-
|
|
58476
|
-
disposition = "unknown";
|
|
58477
|
-
} else {
|
|
58797
|
+
let messageRecordType = recordType;
|
|
58798
|
+
if (raw.display !== undefined) {
|
|
58799
|
+
role = "user";
|
|
58800
|
+
disposition = "keep";
|
|
58801
|
+
contentText = s(raw.display) ?? null;
|
|
58802
|
+
messageRecordType = recordType.length > 0 ? recordType : "USER_INPUT";
|
|
58803
|
+
} else {
|
|
58804
|
+
switch (recordType) {
|
|
58805
|
+
case "USER_INPUT":
|
|
58806
|
+
case "ASK_QUESTION":
|
|
58807
|
+
role = "user";
|
|
58808
|
+
disposition = "keep";
|
|
58809
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
58810
|
+
break;
|
|
58811
|
+
case "PLANNER_RESPONSE":
|
|
58812
|
+
role = "assistant";
|
|
58813
|
+
disposition = "keep";
|
|
58814
|
+
contentText = s(raw.content, raw.text, raw.message, raw.plan) ?? null;
|
|
58815
|
+
break;
|
|
58816
|
+
case "ERROR_MESSAGE":
|
|
58817
|
+
role = "system";
|
|
58818
|
+
disposition = "keep";
|
|
58819
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
58820
|
+
break;
|
|
58821
|
+
case "RUN_COMMAND":
|
|
58822
|
+
case "VIEW_FILE":
|
|
58823
|
+
case "GREP_SEARCH":
|
|
58824
|
+
case "LIST_DIRECTORY":
|
|
58825
|
+
case "READ_URL_CONTENT":
|
|
58826
|
+
role = "tool";
|
|
58827
|
+
disposition = "keep";
|
|
58828
|
+
contentText = s(raw.content, raw.command, raw.file_path, raw.pattern) ?? null;
|
|
58829
|
+
break;
|
|
58830
|
+
case "CODE_ACTION":
|
|
58831
|
+
case "INVOKE_SUBAGENT":
|
|
58832
|
+
role = "tool";
|
|
58833
|
+
disposition = "keep";
|
|
58834
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
58835
|
+
break;
|
|
58836
|
+
case "CONVERSATION_HISTORY":
|
|
58837
|
+
case "CHECKPOINT":
|
|
58838
|
+
case "GENERIC":
|
|
58478
58839
|
role = "meta";
|
|
58479
58840
|
disposition = "meta";
|
|
58480
58841
|
contentText = s(raw.content, raw.text) ?? null;
|
|
58481
|
-
|
|
58482
|
-
|
|
58842
|
+
break;
|
|
58843
|
+
default:
|
|
58844
|
+
if (recordType.length === 0) {
|
|
58845
|
+
role = "unknown";
|
|
58846
|
+
disposition = "unknown";
|
|
58847
|
+
} else {
|
|
58848
|
+
role = "meta";
|
|
58849
|
+
disposition = "meta";
|
|
58850
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
58851
|
+
}
|
|
58852
|
+
break;
|
|
58853
|
+
}
|
|
58483
58854
|
}
|
|
58484
58855
|
const messageSplitIndex = entries.length;
|
|
58485
58856
|
entries.push({
|
|
@@ -58488,7 +58859,7 @@ function agySplit(raw, context4) {
|
|
|
58488
58859
|
session_id: sessionId,
|
|
58489
58860
|
seq,
|
|
58490
58861
|
role,
|
|
58491
|
-
record_type:
|
|
58862
|
+
record_type: messageRecordType,
|
|
58492
58863
|
disposition,
|
|
58493
58864
|
ts,
|
|
58494
58865
|
duration_ms: undefined,
|
|
@@ -58499,7 +58870,7 @@ function agySplit(raw, context4) {
|
|
|
58499
58870
|
cache_write_tokens: null,
|
|
58500
58871
|
cost_usd: null,
|
|
58501
58872
|
content_text: contentText,
|
|
58502
|
-
cwd: null,
|
|
58873
|
+
cwd: s(raw.workspace, raw.cwd) ?? null,
|
|
58503
58874
|
provenance: "ambient"
|
|
58504
58875
|
}
|
|
58505
58876
|
});
|
|
@@ -59054,7 +59425,7 @@ function extractContentText(content) {
|
|
|
59054
59425
|
function stableFieldShape(raw) {
|
|
59055
59426
|
return Object.keys(raw).map((k) => k.toLowerCase()).sort().join("+");
|
|
59056
59427
|
}
|
|
59057
|
-
var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS,
|
|
59428
|
+
var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, BASH_COMMAND_MAX_CHARS = 8192, GENERIC_ARGS_MAX_CHARS = 8192, BULKY_PAYLOAD_KEYS, UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", AGY_BRAIN_REGEX, CODEX_ROLLOUT_REGEX, GROK_META_TYPES, CLAUDE_FIELD_MAP, PI_FIELD_MAP, OMP_FIELD_MAP, CODEX_FIELD_MAP, AGY_FIELD_MAP, GROK_FIELD_MAP, GEMINI_FIELD_MAP, passthroughSchema, CLAUDE_SCHEMA, PI_SCHEMA, OMP_SCHEMA, CODEX_SCHEMA, AGY_SCHEMA, GROK_SCHEMA, GEMINI_SCHEMA;
|
|
59058
59429
|
var init_mappers = __esm(() => {
|
|
59059
59430
|
init_zod();
|
|
59060
59431
|
init_hash();
|
|
@@ -59096,16 +59467,17 @@ var init_mappers = __esm(() => {
|
|
|
59096
59467
|
"result_bytes",
|
|
59097
59468
|
"error_text"
|
|
59098
59469
|
];
|
|
59099
|
-
|
|
59100
|
-
|
|
59101
|
-
|
|
59102
|
-
|
|
59103
|
-
|
|
59104
|
-
|
|
59105
|
-
|
|
59106
|
-
|
|
59107
|
-
|
|
59108
|
-
|
|
59470
|
+
BULKY_PAYLOAD_KEYS = new Set([
|
|
59471
|
+
"content",
|
|
59472
|
+
"codecontent",
|
|
59473
|
+
"replacementcontent",
|
|
59474
|
+
"targetcontent",
|
|
59475
|
+
"filedata",
|
|
59476
|
+
"buffer",
|
|
59477
|
+
"blob",
|
|
59478
|
+
"image",
|
|
59479
|
+
"imagebase64"
|
|
59480
|
+
]);
|
|
59109
59481
|
AGY_BRAIN_REGEX = new RegExp(`(?:^|\\/)brain\\/(${UUID_PATTERN})(?:\\/|$)`, "i");
|
|
59110
59482
|
CODEX_ROLLOUT_REGEX = new RegExp(`(?:^|-|_)(${UUID_PATTERN})$`, "i");
|
|
59111
59483
|
GROK_META_TYPES = new Set([
|
|
@@ -59155,7 +59527,7 @@ var init_mappers = __esm(() => {
|
|
|
59155
59527
|
GEMINI_SCHEMA = passthroughSchema;
|
|
59156
59528
|
});
|
|
59157
59529
|
|
|
59158
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
59530
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
|
|
59159
59531
|
function firstString(...values) {
|
|
59160
59532
|
for (const value of values) {
|
|
59161
59533
|
if (typeof value === "string" && value.length > 0)
|
|
@@ -59302,7 +59674,7 @@ var init_sources = __esm(() => {
|
|
|
59302
59674
|
omp: customSourceDefinition("omp", "OMP", [".omp/agent/sessions"], ["*.jsonl"], ompSplit, OMP_FIELD_MAP, OMP_SCHEMA),
|
|
59303
59675
|
grok: customSourceDefinition("grok", "Grok", [".grok/sessions"], ["*.jsonl"], grokSplit, GROK_FIELD_MAP, GROK_SCHEMA),
|
|
59304
59676
|
agy: {
|
|
59305
|
-
...customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli
|
|
59677
|
+
...customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli"], ["*.jsonl"], agySplit, AGY_FIELD_MAP, AGY_SCHEMA),
|
|
59306
59678
|
corruptLinePolicy: "skip"
|
|
59307
59679
|
},
|
|
59308
59680
|
gemini: customSourceDefinition("gemini", "Gemini CLI", [".gemini/tmp", ".config/gemini"], ["*.jsonl"], geminiSplit, GEMINI_FIELD_MAP, GEMINI_SCHEMA),
|
|
@@ -59312,7 +59684,7 @@ var init_sources = __esm(() => {
|
|
|
59312
59684
|
};
|
|
59313
59685
|
});
|
|
59314
59686
|
|
|
59315
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
59687
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
|
|
59316
59688
|
function targetTableFor(table3) {
|
|
59317
59689
|
if (!VALID_TABLE_NAME.test(table3)) {
|
|
59318
59690
|
throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
|
|
@@ -59644,7 +60016,7 @@ var init_jsonl_importer_dao = __esm(() => {
|
|
|
59644
60016
|
TYPED_IGNORED_KEYS = new Set(["_meta", "split_index"]);
|
|
59645
60017
|
});
|
|
59646
60018
|
|
|
59647
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60019
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
|
|
59648
60020
|
function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
|
|
59649
60021
|
if (typeof value === "string") {
|
|
59650
60022
|
return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
|
|
@@ -59696,7 +60068,7 @@ var init_redaction = __esm(() => {
|
|
|
59696
60068
|
];
|
|
59697
60069
|
});
|
|
59698
60070
|
|
|
59699
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60071
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
|
|
59700
60072
|
function toolCallKey(source, sessionId, callId) {
|
|
59701
60073
|
return `${source}${TOOL_CALL_KEY_SEP}${sessionId}${TOOL_CALL_KEY_SEP}${callId}`;
|
|
59702
60074
|
}
|
|
@@ -60100,7 +60472,7 @@ var init_importer = __esm(() => {
|
|
|
60100
60472
|
init_sources();
|
|
60101
60473
|
});
|
|
60102
60474
|
|
|
60103
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60475
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
|
|
60104
60476
|
async function runOpenCodeImport(options) {
|
|
60105
60477
|
const paths = options.paths ?? ambientRuntimePaths2();
|
|
60106
60478
|
const sourceDatabase = options.sourceDatabase ?? joinPath2(paths.home, ".local/share/opencode/opencode.db");
|
|
@@ -60357,7 +60729,7 @@ var init_opencode_importer = __esm(() => {
|
|
|
60357
60729
|
init_redaction();
|
|
60358
60730
|
});
|
|
60359
60731
|
|
|
60360
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60732
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.50+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
|
|
60361
60733
|
var init_dist8 = __esm(() => {
|
|
60362
60734
|
init_importer();
|
|
60363
60735
|
init_mappers();
|
|
@@ -60366,7 +60738,7 @@ var init_dist8 = __esm(() => {
|
|
|
60366
60738
|
init_sources();
|
|
60367
60739
|
});
|
|
60368
60740
|
|
|
60369
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60741
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
|
|
60370
60742
|
function collectExtensions(sourceName, sourceDir, extensions) {
|
|
60371
60743
|
if (extensions === undefined)
|
|
60372
60744
|
return [];
|
|
@@ -60380,7 +60752,7 @@ function collectExtensions(sourceName, sourceDir, extensions) {
|
|
|
60380
60752
|
}
|
|
60381
60753
|
var init_extensions2 = () => {};
|
|
60382
60754
|
|
|
60383
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60755
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
|
|
60384
60756
|
function createFinding(rule, message, filePath, extras = {}) {
|
|
60385
60757
|
return {
|
|
60386
60758
|
ruleId: rule.id,
|
|
@@ -60451,7 +60823,7 @@ var init_types3 = __esm(() => {
|
|
|
60451
60823
|
});
|
|
60452
60824
|
});
|
|
60453
60825
|
|
|
60454
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60826
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
|
|
60455
60827
|
async function loadPreset(name, options) {
|
|
60456
60828
|
const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
|
|
60457
60829
|
const presetPath = findMergedPreset(merged, name);
|
|
@@ -60666,7 +61038,7 @@ var init_loader2 = __esm(() => {
|
|
|
60666
61038
|
FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
|
|
60667
61039
|
});
|
|
60668
61040
|
|
|
60669
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
61041
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
|
|
60670
61042
|
function normalizeFindingPath(filePath) {
|
|
60671
61043
|
if (!filePath || isAbsolutePath2(filePath))
|
|
60672
61044
|
return null;
|
|
@@ -60731,7 +61103,7 @@ var init_test_stub_fixer = __esm(() => {
|
|
|
60731
61103
|
realFileSystem = createNodeFileSystem3();
|
|
60732
61104
|
});
|
|
60733
61105
|
|
|
60734
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
61106
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
|
|
60735
61107
|
function registerBuiltinFixers(host, exec) {
|
|
60736
61108
|
const regexFixer = new RegexFixerProvider;
|
|
60737
61109
|
const pathFixer = new PathFixerProvider;
|
|
@@ -60934,7 +61306,7 @@ var init_fixers = __esm(() => {
|
|
|
60934
61306
|
};
|
|
60935
61307
|
});
|
|
60936
61308
|
|
|
60937
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61309
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
|
|
60938
61310
|
function getAgentSessionCapability(agent) {
|
|
60939
61311
|
return AGENT_SESSION_CAPABILITY[agent];
|
|
60940
61312
|
}
|
|
@@ -61230,7 +61602,7 @@ var init_shims = __esm(() => {
|
|
|
61230
61602
|
ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
|
|
61231
61603
|
});
|
|
61232
61604
|
|
|
61233
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61605
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
|
|
61234
61606
|
function buildIdentityPreamble(ctx) {
|
|
61235
61607
|
const sections = [
|
|
61236
61608
|
`You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
|
|
@@ -61306,12 +61678,12 @@ var init_identity = __esm(() => {
|
|
|
61306
61678
|
init_dist5();
|
|
61307
61679
|
});
|
|
61308
61680
|
|
|
61309
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61681
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
|
|
61310
61682
|
function isClaudeStyleSlashCommand(input) {
|
|
61311
|
-
return
|
|
61683
|
+
return SLASH_COMMAND_RE2.test(input);
|
|
61312
61684
|
}
|
|
61313
61685
|
function translateSlashCommand(agent, input) {
|
|
61314
|
-
const match =
|
|
61686
|
+
const match = SLASH_COMMAND_RE2.exec(input);
|
|
61315
61687
|
if (!match)
|
|
61316
61688
|
return input;
|
|
61317
61689
|
const [, plugin, command, rest = ""] = match;
|
|
@@ -61329,12 +61701,12 @@ function translateSlashCommand(agent, input) {
|
|
|
61329
61701
|
return `/${plugin}-${command}${suffix}`;
|
|
61330
61702
|
}
|
|
61331
61703
|
}
|
|
61332
|
-
var
|
|
61704
|
+
var SLASH_COMMAND_RE2;
|
|
61333
61705
|
var init_slash_command = __esm(() => {
|
|
61334
|
-
|
|
61706
|
+
SLASH_COMMAND_RE2 = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
|
|
61335
61707
|
});
|
|
61336
61708
|
|
|
61337
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61709
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
|
|
61338
61710
|
function buildCorrelationEnv(correlation) {
|
|
61339
61711
|
return {
|
|
61340
61712
|
[AGENT_RUN_ID_ENV]: correlation.runId,
|
|
@@ -61478,7 +61850,7 @@ var init_ai_runner = __esm(() => {
|
|
|
61478
61850
|
init_slash_command();
|
|
61479
61851
|
});
|
|
61480
61852
|
|
|
61481
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61853
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
|
|
61482
61854
|
class AgentDetector {
|
|
61483
61855
|
runner;
|
|
61484
61856
|
timeout;
|
|
@@ -61554,7 +61926,7 @@ var init_agent_detector = __esm(() => {
|
|
|
61554
61926
|
VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
|
|
61555
61927
|
});
|
|
61556
61928
|
|
|
61557
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61929
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
|
|
61558
61930
|
function validateAgentId(id) {
|
|
61559
61931
|
if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
|
|
61560
61932
|
throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
|
|
@@ -61653,7 +62025,7 @@ var init_agent_spec = __esm(() => {
|
|
|
61653
62025
|
};
|
|
61654
62026
|
});
|
|
61655
62027
|
|
|
61656
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62028
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
|
|
61657
62029
|
function isNonEmpty(value) {
|
|
61658
62030
|
return value !== undefined && value.trim().length > 0;
|
|
61659
62031
|
}
|
|
@@ -61778,7 +62150,7 @@ var init_auth_shims = __esm(() => {
|
|
|
61778
62150
|
};
|
|
61779
62151
|
});
|
|
61780
62152
|
|
|
61781
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62153
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
|
|
61782
62154
|
class ModelHealthProbeRegistry {
|
|
61783
62155
|
probes = new Map;
|
|
61784
62156
|
register(providerPrefix, probe) {
|
|
@@ -61886,7 +62258,7 @@ var init_model_health_probe = __esm(() => {
|
|
|
61886
62258
|
};
|
|
61887
62259
|
});
|
|
61888
62260
|
|
|
61889
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62261
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
|
|
61890
62262
|
class DoctorRunner {
|
|
61891
62263
|
detector;
|
|
61892
62264
|
runner;
|
|
@@ -62026,15 +62398,15 @@ var init_doctor_runner = __esm(() => {
|
|
|
62026
62398
|
init_model_health_probe();
|
|
62027
62399
|
});
|
|
62028
62400
|
|
|
62029
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62401
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
|
|
62030
62402
|
var init_events = () => {};
|
|
62031
62403
|
|
|
62032
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62404
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
|
|
62033
62405
|
function formatMessage(msg) {
|
|
62034
62406
|
return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
|
|
62035
62407
|
}
|
|
62036
62408
|
|
|
62037
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62409
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
|
|
62038
62410
|
import { Buffer as Buffer5 } from "buffer";
|
|
62039
62411
|
|
|
62040
62412
|
class TeamAgentProcess {
|
|
@@ -62168,7 +62540,7 @@ var init_team_agent_process = __esm(() => {
|
|
|
62168
62540
|
init_dist5();
|
|
62169
62541
|
});
|
|
62170
62542
|
|
|
62171
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62543
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
|
|
62172
62544
|
class TeamOrchestrator {
|
|
62173
62545
|
configDir;
|
|
62174
62546
|
inbox;
|
|
@@ -62309,7 +62681,7 @@ var init_team_orchestrator = __esm(() => {
|
|
|
62309
62681
|
init_team_agent_process();
|
|
62310
62682
|
});
|
|
62311
62683
|
|
|
62312
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62684
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.50+b8485e60079be134/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
|
|
62313
62685
|
var exports_dist3 = {};
|
|
62314
62686
|
__export(exports_dist3, {
|
|
62315
62687
|
validateAgentId: () => validateAgentId,
|
|
@@ -62362,7 +62734,7 @@ var init_dist9 = __esm(() => {
|
|
|
62362
62734
|
init_team_orchestrator();
|
|
62363
62735
|
});
|
|
62364
62736
|
|
|
62365
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62737
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
|
|
62366
62738
|
function stringArray(value) {
|
|
62367
62739
|
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
|
|
62368
62740
|
}
|
|
@@ -62400,7 +62772,7 @@ function parseInlineFlags(source) {
|
|
|
62400
62772
|
return { flags, rest: source.slice(match[0].length) };
|
|
62401
62773
|
}
|
|
62402
62774
|
|
|
62403
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62775
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
|
|
62404
62776
|
function matchesAny(path9, patterns) {
|
|
62405
62777
|
if (patterns === undefined || patterns.length === 0)
|
|
62406
62778
|
return true;
|
|
@@ -62448,7 +62820,7 @@ function escapeRegExp(value) {
|
|
|
62448
62820
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
62449
62821
|
}
|
|
62450
62822
|
|
|
62451
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62823
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
|
|
62452
62824
|
async function discoverFiles2(options) {
|
|
62453
62825
|
const fs3 = options.fs ?? createNodeFileSystem3();
|
|
62454
62826
|
const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
|
|
@@ -62479,12 +62851,12 @@ var init_file_discovery = __esm(() => {
|
|
|
62479
62851
|
DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
|
|
62480
62852
|
});
|
|
62481
62853
|
|
|
62482
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62854
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
|
|
62483
62855
|
var init_file_utils = __esm(() => {
|
|
62484
62856
|
init_file_discovery();
|
|
62485
62857
|
});
|
|
62486
62858
|
|
|
62487
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62859
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
|
|
62488
62860
|
class AgentDetectionEvaluator {
|
|
62489
62861
|
detector;
|
|
62490
62862
|
constructor(detector = new AgentDetector) {
|
|
@@ -62512,7 +62884,7 @@ var init_agent_detection_evaluator = __esm(() => {
|
|
|
62512
62884
|
init_file_utils();
|
|
62513
62885
|
});
|
|
62514
62886
|
|
|
62515
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62887
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
|
|
62516
62888
|
class CoverageGateEvaluator {
|
|
62517
62889
|
constructor() {}
|
|
62518
62890
|
async evaluate(rule, context4) {
|
|
@@ -62596,7 +62968,7 @@ var init_coverage_gate_evaluator = __esm(() => {
|
|
|
62596
62968
|
init_file_utils();
|
|
62597
62969
|
});
|
|
62598
62970
|
|
|
62599
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62971
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
|
|
62600
62972
|
class ExitCodeEvaluator {
|
|
62601
62973
|
executor;
|
|
62602
62974
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -62632,7 +63004,7 @@ var init_exit_code_evaluator = __esm(() => {
|
|
|
62632
63004
|
init_file_utils();
|
|
62633
63005
|
});
|
|
62634
63006
|
|
|
62635
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63007
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
|
|
62636
63008
|
class ForbiddenImportEvaluator {
|
|
62637
63009
|
constructor() {}
|
|
62638
63010
|
async evaluate(rule, context4) {
|
|
@@ -62713,7 +63085,7 @@ var init_forbidden_import_evaluator = __esm(() => {
|
|
|
62713
63085
|
init_file_utils();
|
|
62714
63086
|
});
|
|
62715
63087
|
|
|
62716
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63088
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
|
|
62717
63089
|
class ImportBoundaryEvaluator {
|
|
62718
63090
|
async evaluate(rule, context4) {
|
|
62719
63091
|
const config4 = rule.evaluator.config ?? {};
|
|
@@ -62806,7 +63178,7 @@ var init_import_boundary_evaluator = __esm(() => {
|
|
|
62806
63178
|
init_file_utils();
|
|
62807
63179
|
});
|
|
62808
63180
|
|
|
62809
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63181
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
|
|
62810
63182
|
class PathEvaluator {
|
|
62811
63183
|
constructor() {}
|
|
62812
63184
|
async evaluate(rule, context4) {
|
|
@@ -62867,7 +63239,7 @@ var init_path_evaluator = __esm(() => {
|
|
|
62867
63239
|
init_file_utils();
|
|
62868
63240
|
});
|
|
62869
63241
|
|
|
62870
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63242
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
|
|
62871
63243
|
class RegexEvaluator {
|
|
62872
63244
|
constructor() {}
|
|
62873
63245
|
async evaluate(rule, context4) {
|
|
@@ -62945,7 +63317,7 @@ var init_regex_evaluator = __esm(() => {
|
|
|
62945
63317
|
init_file_utils();
|
|
62946
63318
|
});
|
|
62947
63319
|
|
|
62948
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63320
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
|
|
62949
63321
|
class RipgrepEvaluator {
|
|
62950
63322
|
executor;
|
|
62951
63323
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -63038,7 +63410,7 @@ var init_ripgrep_evaluator = __esm(() => {
|
|
|
63038
63410
|
init_file_utils();
|
|
63039
63411
|
});
|
|
63040
63412
|
|
|
63041
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63413
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
|
|
63042
63414
|
class SchemaArtifactEvaluator {
|
|
63043
63415
|
constructor() {}
|
|
63044
63416
|
async evaluate(rule, context4) {
|
|
@@ -63116,7 +63488,7 @@ var init_schema_artifact_evaluator = __esm(() => {
|
|
|
63116
63488
|
init_file_utils();
|
|
63117
63489
|
});
|
|
63118
63490
|
|
|
63119
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63491
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
|
|
63120
63492
|
class SecretsScannerEvaluator {
|
|
63121
63493
|
constructor() {}
|
|
63122
63494
|
async evaluate(rule, context4) {
|
|
@@ -63184,7 +63556,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
|
|
|
63184
63556
|
ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
|
|
63185
63557
|
});
|
|
63186
63558
|
|
|
63187
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63559
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
|
|
63188
63560
|
class SgEvaluator {
|
|
63189
63561
|
executor;
|
|
63190
63562
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -63281,7 +63653,7 @@ var init_sg_evaluator = __esm(() => {
|
|
|
63281
63653
|
init_file_utils();
|
|
63282
63654
|
});
|
|
63283
63655
|
|
|
63284
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63656
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
|
|
63285
63657
|
class TypeScriptTestPathResolver {
|
|
63286
63658
|
name = "typescript";
|
|
63287
63659
|
constructor() {}
|
|
@@ -63364,7 +63736,7 @@ function testify(rel) {
|
|
|
63364
63736
|
return `${dir}test_${base2}`;
|
|
63365
63737
|
}
|
|
63366
63738
|
|
|
63367
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63739
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
|
|
63368
63740
|
class TestLocationEvaluator {
|
|
63369
63741
|
resolvers;
|
|
63370
63742
|
constructor(resolvers) {
|
|
@@ -63439,7 +63811,7 @@ var init_test_location_evaluator = __esm(() => {
|
|
|
63439
63811
|
TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
|
|
63440
63812
|
});
|
|
63441
63813
|
|
|
63442
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63814
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
|
|
63443
63815
|
class TsdocExportEvaluator {
|
|
63444
63816
|
constructor() {}
|
|
63445
63817
|
async evaluate(rule, context4) {
|
|
@@ -63524,7 +63896,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
|
|
|
63524
63896
|
};
|
|
63525
63897
|
});
|
|
63526
63898
|
|
|
63527
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63899
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
|
|
63528
63900
|
class JsonFormatter {
|
|
63529
63901
|
constructor() {}
|
|
63530
63902
|
format(result) {
|
|
@@ -63532,7 +63904,7 @@ class JsonFormatter {
|
|
|
63532
63904
|
}
|
|
63533
63905
|
}
|
|
63534
63906
|
|
|
63535
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63907
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
|
|
63536
63908
|
class TextFormatter {
|
|
63537
63909
|
constructor() {}
|
|
63538
63910
|
format(result) {
|
|
@@ -63546,7 +63918,7 @@ class TextFormatter {
|
|
|
63546
63918
|
}
|
|
63547
63919
|
}
|
|
63548
63920
|
|
|
63549
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63921
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
|
|
63550
63922
|
function registerBuiltins(host, executor) {
|
|
63551
63923
|
const path9 = new PathEvaluator;
|
|
63552
63924
|
host.evaluators.register("regex", new RegexEvaluator, "builtin");
|
|
@@ -63586,7 +63958,7 @@ var init_builtins = __esm(() => {
|
|
|
63586
63958
|
init_tsdoc_export_evaluator();
|
|
63587
63959
|
});
|
|
63588
63960
|
|
|
63589
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63961
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
|
|
63590
63962
|
class RuleEngineHost {
|
|
63591
63963
|
evaluators;
|
|
63592
63964
|
formatters;
|
|
@@ -63603,7 +63975,7 @@ var init_rule_engine_host = __esm(() => {
|
|
|
63603
63975
|
init_extension2();
|
|
63604
63976
|
});
|
|
63605
63977
|
|
|
63606
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63978
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
|
|
63607
63979
|
class RuleEngine {
|
|
63608
63980
|
host;
|
|
63609
63981
|
events;
|
|
@@ -63789,7 +64161,7 @@ var init_engine = __esm(() => {
|
|
|
63789
64161
|
init_types3();
|
|
63790
64162
|
});
|
|
63791
64163
|
|
|
63792
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64164
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
|
|
63793
64165
|
async function bundledRulesRoot() {
|
|
63794
64166
|
if (cachedRoot2 !== undefined)
|
|
63795
64167
|
return cachedRoot2;
|
|
@@ -63840,7 +64212,7 @@ var init_bundled_rules = __esm(() => {
|
|
|
63840
64212
|
init_dist5();
|
|
63841
64213
|
});
|
|
63842
64214
|
|
|
63843
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64215
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
|
|
63844
64216
|
class DbRulePersistenceAdapter {
|
|
63845
64217
|
db;
|
|
63846
64218
|
constructor(db2) {
|
|
@@ -63874,7 +64246,7 @@ class DbRulePersistenceAdapter {
|
|
|
63874
64246
|
}
|
|
63875
64247
|
}
|
|
63876
64248
|
|
|
63877
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64249
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
|
|
63878
64250
|
var RULE_ENGINE_SCHEMA_SQL = `
|
|
63879
64251
|
CREATE TABLE IF NOT EXISTS rule_runs (
|
|
63880
64252
|
id TEXT PRIMARY KEY,
|
|
@@ -63920,10 +64292,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
|
|
|
63920
64292
|
CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
|
|
63921
64293
|
`;
|
|
63922
64294
|
|
|
63923
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64295
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
|
|
63924
64296
|
var init_persistence2 = () => {};
|
|
63925
64297
|
|
|
63926
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64298
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.50+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
|
|
63927
64299
|
var init_dist10 = __esm(() => {
|
|
63928
64300
|
init_extensions2();
|
|
63929
64301
|
init_loader2();
|
|
@@ -63993,7 +64365,18 @@ var init_schema3 = __esm(() => {
|
|
|
63993
64365
|
|
|
63994
64366
|
// ../../packages/domain/src/migrations.ts
|
|
63995
64367
|
import { join as join5 } from "path";
|
|
64368
|
+
async function allMigrationsJournaled(adapter, migrations) {
|
|
64369
|
+
if (migrations.length === 0)
|
|
64370
|
+
return true;
|
|
64371
|
+
if (!await tableExists(adapter, "__spur_cli_migrations"))
|
|
64372
|
+
return false;
|
|
64373
|
+
const placeholders = migrations.map(() => "?").join(", ");
|
|
64374
|
+
const row = await adapter.queryFirst(`SELECT COUNT(*) AS n FROM "__spur_cli_migrations" WHERE id IN (${placeholders})`, ...migrations.map((m) => m.id));
|
|
64375
|
+
return (row?.n ?? 0) === migrations.length;
|
|
64376
|
+
}
|
|
63996
64377
|
async function applyCliMigrations(adapter, migrations = CLI_MIGRATIONS) {
|
|
64378
|
+
if (await allMigrationsJournaled(adapter, migrations))
|
|
64379
|
+
return 0;
|
|
63997
64380
|
await adapter.exec('CREATE TABLE IF NOT EXISTS "__spur_cli_migrations" (id TEXT PRIMARY KEY, applied_at INTEGER NOT NULL)');
|
|
63998
64381
|
let applied = 0;
|
|
63999
64382
|
for (const migration of migrations) {
|
|
@@ -64148,6 +64531,20 @@ CREATE TABLE IF NOT EXISTS history_run_session (
|
|
|
64148
64531
|
|
|
64149
64532
|
CREATE INDEX IF NOT EXISTS idx_history_run_session_run ON history_run_session (run_id);
|
|
64150
64533
|
CREATE INDEX IF NOT EXISTS idx_history_run_session_source_session ON history_run_session (source, session_id);
|
|
64534
|
+
`, HISTORY_TASK_SESSION_SCHEMA_SQL = `
|
|
64535
|
+
CREATE TABLE IF NOT EXISTS history_task_session (
|
|
64536
|
+
wbs TEXT NOT NULL,
|
|
64537
|
+
source TEXT NOT NULL,
|
|
64538
|
+
session_id TEXT NOT NULL,
|
|
64539
|
+
exactness TEXT NOT NULL,
|
|
64540
|
+
mechanism TEXT NOT NULL,
|
|
64541
|
+
evidence_kind TEXT NOT NULL,
|
|
64542
|
+
evidence_ref TEXT,
|
|
64543
|
+
resolved_at TEXT NOT NULL,
|
|
64544
|
+
PRIMARY KEY (wbs, source, session_id)
|
|
64545
|
+
);
|
|
64546
|
+
|
|
64547
|
+
CREATE INDEX IF NOT EXISTS idx_history_task_session_source_session ON history_task_session (source, session_id);
|
|
64151
64548
|
`, CLI_SCHEMA_SQL, RUN_PID_COLUMN_SCHEMA_SQL = `
|
|
64152
64549
|
ALTER TABLE runs ADD COLUMN pid INTEGER;
|
|
64153
64550
|
`, RUNS_EXTERNAL_KEY_COLUMN_SCHEMA_SQL = `
|
|
@@ -64486,6 +64883,8 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
|
|
|
64486
64883
|
${COORDINATION_RUNS_SCHEMA_SQL}
|
|
64487
64884
|
|
|
64488
64885
|
${HISTORY_RUN_SESSION_SCHEMA_SQL}
|
|
64886
|
+
|
|
64887
|
+
${HISTORY_TASK_SESSION_SCHEMA_SQL}
|
|
64489
64888
|
`;
|
|
64490
64889
|
CLI_MIGRATIONS = [
|
|
64491
64890
|
{ id: "0000_spur_cli_foundation", sql: CLI_SCHEMA_SQL },
|
|
@@ -64569,11 +64968,15 @@ ${HISTORY_RUN_SESSION_SCHEMA_SQL}
|
|
|
64569
64968
|
{
|
|
64570
64969
|
id: "0027_spur_cli_history_refresh_active_unique",
|
|
64571
64970
|
sql: HISTORY_REFRESH_ACTIVE_UNIQUE_SCHEMA_SQL
|
|
64971
|
+
},
|
|
64972
|
+
{
|
|
64973
|
+
id: "0028_spur_cli_history_task_session",
|
|
64974
|
+
sql: HISTORY_TASK_SESSION_SCHEMA_SQL
|
|
64572
64975
|
}
|
|
64573
64976
|
];
|
|
64574
64977
|
});
|
|
64575
64978
|
|
|
64576
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
64979
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
|
|
64577
64980
|
function queueLogger() {
|
|
64578
64981
|
if (!_queueLogger)
|
|
64579
64982
|
_queueLogger = getLogger2("job-queue");
|
|
@@ -64876,7 +65279,7 @@ var init_db_job_queue = __esm(() => {
|
|
|
64876
65279
|
init_tracing2();
|
|
64877
65280
|
});
|
|
64878
65281
|
|
|
64879
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
65282
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
|
|
64880
65283
|
var exports_job_queue_db = {};
|
|
64881
65284
|
__export(exports_job_queue_db, {
|
|
64882
65285
|
DBQueueConsumer: () => DBQueueConsumer,
|
|
@@ -64890,7 +65293,7 @@ var init_job_queue_db = __esm(() => {
|
|
|
64890
65293
|
async function createMigratedDb(options) {
|
|
64891
65294
|
const { createDbAdapter: createDbAdapter2 } = await Promise.resolve().then(() => (init_dist4(), exports_dist));
|
|
64892
65295
|
const adapter = await createDbAdapter2({ driver: "bun-sqlite", url: options.url });
|
|
64893
|
-
await adapter.exec(
|
|
65296
|
+
await adapter.exec(`PRAGMA busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
|
|
64894
65297
|
await applyCliMigrations(adapter);
|
|
64895
65298
|
return adapter;
|
|
64896
65299
|
}
|
|
@@ -64898,7 +65301,7 @@ async function createMigratedDbViaRuntime(config4) {
|
|
|
64898
65301
|
const { loadRuntimeFactory: loadRuntimeFactory3 } = await Promise.resolve().then(() => (init_dist5(), exports_dist2));
|
|
64899
65302
|
const factory = await loadRuntimeFactory3();
|
|
64900
65303
|
const runtimeAdapter = await factory.createDbAdapter(config4);
|
|
64901
|
-
await runtimeAdapter.exec(
|
|
65304
|
+
await runtimeAdapter.exec(`PRAGMA busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
|
|
64902
65305
|
await applyCliMigrations(runtimeAdapter);
|
|
64903
65306
|
return runtimeAdapter;
|
|
64904
65307
|
}
|
|
@@ -64995,6 +65398,7 @@ async function enqueueCoalesced(db2, spec) {
|
|
|
64995
65398
|
}
|
|
64996
65399
|
return { status: "enqueued", jobId: fallback.id, payload: spec.payload };
|
|
64997
65400
|
}
|
|
65401
|
+
var SQLITE_BUSY_TIMEOUT_MS = 30000;
|
|
64998
65402
|
var init_db2 = __esm(() => {
|
|
64999
65403
|
init_migrations();
|
|
65000
65404
|
});
|
|
@@ -67127,6 +67531,7 @@ __export(exports_src, {
|
|
|
67127
67531
|
topStepsByTokens: () => topStepsByTokens,
|
|
67128
67532
|
topStepsByDuration: () => topStepsByDuration,
|
|
67129
67533
|
topCacheWasteSteps: () => topCacheWasteSteps,
|
|
67534
|
+
toolSequenceQuery: () => toolSequenceQuery,
|
|
67130
67535
|
toolRollup: () => toolRollup,
|
|
67131
67536
|
todoToolCalls: () => todoToolCalls,
|
|
67132
67537
|
taskStatusIcon: () => taskStatusIcon,
|
|
@@ -67165,6 +67570,7 @@ __export(exports_src, {
|
|
|
67165
67570
|
roleTokenSummary: () => roleTokenSummary,
|
|
67166
67571
|
resolveReportMode: () => resolveReportMode,
|
|
67167
67572
|
resolvePricing: () => resolvePricing,
|
|
67573
|
+
resetHistoryTables: () => resetHistoryTables,
|
|
67168
67574
|
replaceHistoryBoardRollups: () => replaceHistoryBoardRollups,
|
|
67169
67575
|
renderTaskTemplate: () => renderTaskTemplate,
|
|
67170
67576
|
renderScenarioStub: () => renderScenarioStub,
|
|
@@ -67198,6 +67604,8 @@ __export(exports_src, {
|
|
|
67198
67604
|
loops: () => loops,
|
|
67199
67605
|
looksLikeGherkinAc: () => looksLikeGherkinAc,
|
|
67200
67606
|
loadSqlMigrations: () => loadSqlMigrations,
|
|
67607
|
+
loadAttributionEvidence: () => loadAttributionEvidence,
|
|
67608
|
+
listAttributionSessions: () => listAttributionSessions,
|
|
67201
67609
|
isTierEligible: () => isTierEligible,
|
|
67202
67610
|
isStale: () => isStale,
|
|
67203
67611
|
isCompatibleStageVersion: () => isCompatibleStageVersion,
|
|
@@ -67246,6 +67654,7 @@ __export(exports_src, {
|
|
|
67246
67654
|
envelopeLayerSchema: () => envelopeLayerSchema,
|
|
67247
67655
|
enqueueCoalesced: () => enqueueCoalesced,
|
|
67248
67656
|
emptyDerived: () => emptyDerived,
|
|
67657
|
+
emptyAttributionSummary: () => emptyAttributionSummary,
|
|
67249
67658
|
drift: () => drift,
|
|
67250
67659
|
deterministicExecutionSchema: () => deterministicExecutionSchema,
|
|
67251
67660
|
derivedWarnings: () => derivedWarnings,
|
|
@@ -67270,6 +67679,7 @@ __export(exports_src, {
|
|
|
67270
67679
|
computeDerived: () => computeDerived,
|
|
67271
67680
|
computeContentHash: () => computeContentHash,
|
|
67272
67681
|
cleanupTempFiles: () => cleanupTempFiles,
|
|
67682
|
+
classifyTaskAttribution: () => classifyTaskAttribution,
|
|
67273
67683
|
checkLayerStale: () => checkLayerStale,
|
|
67274
67684
|
checkAcCoverage: () => checkAcCoverage,
|
|
67275
67685
|
capabilityTierSchema: () => capabilityTierSchema,
|
|
@@ -67310,6 +67720,7 @@ __export(exports_src, {
|
|
|
67310
67720
|
UNKNOWN_MODEL_PRICING: () => UNKNOWN_MODEL_PRICING,
|
|
67311
67721
|
UNIVERSAL_SECTIONS: () => UNIVERSAL_SECTIONS,
|
|
67312
67722
|
TransitionRunDao: () => TransitionRunDao,
|
|
67723
|
+
TaskSessionDao: () => TaskSessionDao,
|
|
67313
67724
|
TaskRunLinkDao: () => TaskRunLinkDao,
|
|
67314
67725
|
TIER_RANK: () => TIER_RANK,
|
|
67315
67726
|
TASK_VARIANTS: () => TASK_VARIANTS,
|
|
@@ -67353,6 +67764,7 @@ __export(exports_src, {
|
|
|
67353
67764
|
InboxMessageDao: () => InboxMessageDao,
|
|
67354
67765
|
INBOX_MESSAGES_SCHEMA_SQL: () => INBOX_MESSAGES_SCHEMA_SQL,
|
|
67355
67766
|
HISTORY_RUN_SESSION_SCHEMA_SQL: () => HISTORY_RUN_SESSION_SCHEMA_SQL,
|
|
67767
|
+
HISTORY_RESET_TABLES: () => HISTORY_RESET_TABLES,
|
|
67356
67768
|
HISTORY_BOARD_ROLLUPS_SCHEMA_SQL: () => HISTORY_BOARD_ROLLUPS_SCHEMA_SQL,
|
|
67357
67769
|
HISTORY_BOARD_QUERY_INDEXES_SCHEMA_SQL: () => HISTORY_BOARD_QUERY_INDEXES_SCHEMA_SQL,
|
|
67358
67770
|
HISTORY_ARTIFACT_SCHEMA_VERSION: () => HISTORY_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -67379,6 +67791,8 @@ __export(exports_src, {
|
|
|
67379
67791
|
ArtifactDao: () => ArtifactDao,
|
|
67380
67792
|
ActionRunDao: () => ActionRunDao,
|
|
67381
67793
|
AUTHORITY_LANES: () => AUTHORITY_LANES,
|
|
67794
|
+
ATTRIBUTION_SESSION_LIMIT: () => ATTRIBUTION_SESSION_LIMIT,
|
|
67795
|
+
ATTRIBUTION_EVIDENCE_LIMIT: () => ATTRIBUTION_EVIDENCE_LIMIT,
|
|
67382
67796
|
ARTIFACT_DIRECTIONS: () => ARTIFACT_DIRECTIONS,
|
|
67383
67797
|
ARTIFACT_ARRAY_CLASSIFICATION: () => ARTIFACT_ARRAY_CLASSIFICATION,
|
|
67384
67798
|
AGENT_INSTANCES_MIGRATION_ID_DRAFT: () => AGENT_INSTANCES_MIGRATION_ID_DRAFT,
|
|
@@ -70745,6 +71159,9 @@ function checkRowName(row) {
|
|
|
70745
71159
|
function isTaskCheckRow(row) {
|
|
70746
71160
|
return /task[ _-]?check/i.test(checkRowName(row));
|
|
70747
71161
|
}
|
|
71162
|
+
function isHollowMet(row) {
|
|
71163
|
+
return NORM(row.status) === "MET" && !(typeof row.evidence === "string" && row.evidence.trim() !== "");
|
|
71164
|
+
}
|
|
70748
71165
|
function aggregateVerifyVerdict(input) {
|
|
70749
71166
|
const reqs = Array.isArray(input.requirements) ? input.requirements : [];
|
|
70750
71167
|
const acs = Array.isArray(input.acceptanceCriteria) ? input.acceptanceCriteria : [];
|
|
@@ -70768,7 +71185,7 @@ function aggregateVerifyVerdict(input) {
|
|
|
70768
71185
|
}
|
|
70769
71186
|
if (majorBlocked)
|
|
70770
71187
|
return "PARTIAL";
|
|
70771
|
-
if (reqs.some((r) => NORM(r.status) === "PARTIAL") || acs.some((a2) => NORM(a2.status) === "PARTIAL"))
|
|
71188
|
+
if (reqs.some((r) => NORM(r.status) === "PARTIAL" || isHollowMet(r)) || acs.some((a2) => NORM(a2.status) === "PARTIAL" || isHollowMet(a2)))
|
|
70772
71189
|
return "PARTIAL";
|
|
70773
71190
|
if (input.taskCheckPassed === false)
|
|
70774
71191
|
return "PARTIAL";
|
|
@@ -71605,7 +72022,7 @@ function renderReview(v) {
|
|
|
71605
72022
|
} else {
|
|
71606
72023
|
for (const check2 of v.checks) {
|
|
71607
72024
|
const finding = escapeTablePipe(check2.evidence.replace(/\n/g, " "));
|
|
71608
|
-
const priority = /^P[1-4]$/.test(check2.status) ? check2.status : check2.status === "fail" ? "P1" : "P4";
|
|
72025
|
+
const priority = SEVERITY_PRIORITY[check2.severity ?? ""] ?? (/^P[1-4]$/.test(check2.status) ? check2.status : check2.status === "fail" ? "P1" : "P4");
|
|
71609
72026
|
lines.push(`| ${priority} | ${check2.name} | \u2014 | ${finding} |`);
|
|
71610
72027
|
}
|
|
71611
72028
|
}
|
|
@@ -71687,12 +72104,18 @@ function gitDiffU0(cwd) {
|
|
|
71687
72104
|
return "";
|
|
71688
72105
|
}
|
|
71689
72106
|
}
|
|
71690
|
-
var RECORD_REVIEW_MARKER = "<!-- spur:record-review -->", LEGACY_RECORD_REVIEW_RE;
|
|
72107
|
+
var RECORD_REVIEW_MARKER = "<!-- spur:record-review -->", LEGACY_RECORD_REVIEW_RE, SEVERITY_PRIORITY;
|
|
71691
72108
|
var init_task_record = __esm(() => {
|
|
71692
72109
|
init_src2();
|
|
71693
72110
|
init_dist5();
|
|
71694
72111
|
init_verify_verdict();
|
|
71695
72112
|
LEGACY_RECORD_REVIEW_RE = /^\*\*SECU findings\*\* \(pipeline verify step \u2014 verdict: [A-Z]+\)/;
|
|
72113
|
+
SEVERITY_PRIORITY = {
|
|
72114
|
+
blocker: "P1",
|
|
72115
|
+
major: "P2",
|
|
72116
|
+
minor: "P3",
|
|
72117
|
+
advisory: "P4"
|
|
72118
|
+
};
|
|
71696
72119
|
});
|
|
71697
72120
|
|
|
71698
72121
|
// ../../packages/app/src/services/feature-check.ts
|
|
@@ -77183,7 +77606,11 @@ class MockHistoryBoardService {
|
|
|
77183
77606
|
const now2 = new Date("2026-08-21T20:00:00.000Z").getTime();
|
|
77184
77607
|
let minTime = 0;
|
|
77185
77608
|
let maxTime = Number.POSITIVE_INFINITY;
|
|
77186
|
-
if (filter.range === "
|
|
77609
|
+
if (filter.range === "1h") {
|
|
77610
|
+
minTime = now2 - 1 * 3600 * 1000;
|
|
77611
|
+
} else if (filter.range === "4h") {
|
|
77612
|
+
minTime = now2 - 4 * 3600 * 1000;
|
|
77613
|
+
} else if (filter.range === "24h") {
|
|
77187
77614
|
minTime = now2 - 24 * 3600 * 1000;
|
|
77188
77615
|
} else if (filter.range === "7d") {
|
|
77189
77616
|
minTime = now2 - 7 * 86400 * 1000;
|
|
@@ -77248,7 +77675,7 @@ class MockHistoryBoardService {
|
|
|
77248
77675
|
const totalTokensWithCache = totalBilled + totalCacheSaved;
|
|
77249
77676
|
const cacheSavedPercent = totalTokensWithCache > 0 ? Math.round(totalCacheSaved / totalTokensWithCache * 100) : 0;
|
|
77250
77677
|
const errorRate = totalTools > 0 ? Math.round(totalErrors / totalTools * 1000) / 10 : 0;
|
|
77251
|
-
const bucket = filter?.bucket === "auto" || filter?.bucket === undefined ? filter?.range === "24h" ? "10m" : filter?.range === "7d" ? "30m" : "1d" : filter.bucket;
|
|
77678
|
+
const bucket = filter?.bucket === "auto" || filter?.bucket === undefined ? filter?.range === "1h" || filter?.range === "4h" ? "5m" : filter?.range === "24h" ? "10m" : filter?.range === "7d" ? "30m" : "1d" : filter.bucket;
|
|
77252
77679
|
const bucketInterval = {
|
|
77253
77680
|
"5m": 5 * 60000,
|
|
77254
77681
|
"10m": 10 * 60000,
|
|
@@ -77259,17 +77686,42 @@ class MockHistoryBoardService {
|
|
|
77259
77686
|
}[bucket];
|
|
77260
77687
|
const dimension = filter?.dimension ?? "model";
|
|
77261
77688
|
const buckets = {};
|
|
77689
|
+
const modelBuckets = {};
|
|
77690
|
+
const sourceBuckets = {};
|
|
77691
|
+
const toolBuckets = {};
|
|
77262
77692
|
const skillBuckets = {};
|
|
77263
77693
|
for (const s3 of matching) {
|
|
77264
77694
|
const bKey = new Date(Math.floor(s3.start / bucketInterval) * bucketInterval).toISOString();
|
|
77265
77695
|
if (!buckets[bKey])
|
|
77266
77696
|
buckets[bKey] = { total: 0, cacheRead: 0, series: {} };
|
|
77697
|
+
if (!modelBuckets[bKey])
|
|
77698
|
+
modelBuckets[bKey] = { total: 0, cacheRead: 0, series: {} };
|
|
77699
|
+
if (!sourceBuckets[bKey])
|
|
77700
|
+
sourceBuckets[bKey] = { total: 0, cacheRead: 0, series: {} };
|
|
77701
|
+
if (!toolBuckets[bKey])
|
|
77702
|
+
toolBuckets[bKey] = { total: 0, cacheRead: 0, series: {} };
|
|
77267
77703
|
if (!skillBuckets[bKey])
|
|
77268
77704
|
skillBuckets[bKey] = { total: 0, cacheRead: 0, series: {} };
|
|
77269
77705
|
buckets[bKey].total += s3.tokens.billedTokens;
|
|
77270
77706
|
buckets[bKey].cacheRead += s3.tokens.cacheReadTokens;
|
|
77707
|
+
modelBuckets[bKey].total += s3.tokens.billedTokens;
|
|
77708
|
+
modelBuckets[bKey].cacheRead += s3.tokens.cacheReadTokens;
|
|
77709
|
+
sourceBuckets[bKey].total += s3.tokens.billedTokens;
|
|
77710
|
+
sourceBuckets[bKey].cacheRead += s3.tokens.cacheReadTokens;
|
|
77711
|
+
toolBuckets[bKey].total += s3.tokens.billedTokens;
|
|
77712
|
+
toolBuckets[bKey].cacheRead += s3.tokens.cacheReadTokens;
|
|
77271
77713
|
skillBuckets[bKey].total += s3.tokens.billedTokens;
|
|
77272
77714
|
skillBuckets[bKey].cacheRead += s3.tokens.cacheReadTokens;
|
|
77715
|
+
modelBuckets[bKey].series[s3.model] = (modelBuckets[bKey].series[s3.model] ?? 0) + s3.tokens.billedTokens;
|
|
77716
|
+
sourceBuckets[bKey].series[s3.source] = (sourceBuckets[bKey].series[s3.source] ?? 0) + s3.tokens.billedTokens;
|
|
77717
|
+
const toolWeight = Object.values(s3.toolMix).reduce((sum, count3) => sum + count3, 0);
|
|
77718
|
+
for (const [tool, count3] of Object.entries(s3.toolMix)) {
|
|
77719
|
+
toolBuckets[bKey].series[tool] = (toolBuckets[bKey].series[tool] ?? 0) + (toolWeight > 0 ? s3.tokens.billedTokens * count3 / toolWeight : 0);
|
|
77720
|
+
}
|
|
77721
|
+
const skillWeight = Object.values(s3.skillMix).reduce((sum, count3) => sum + count3, 0);
|
|
77722
|
+
for (const [skill, count3] of Object.entries(s3.skillMix)) {
|
|
77723
|
+
skillBuckets[bKey].series[skill] = (skillBuckets[bKey].series[skill] ?? 0) + (skillWeight > 0 ? s3.tokens.billedTokens * count3 / skillWeight : 0);
|
|
77724
|
+
}
|
|
77273
77725
|
const dimensions = dimension === "model" ? [[s3.model, s3.tokens.billedTokens]] : dimension === "source" ? [[s3.source, s3.tokens.billedTokens]] : Object.entries(dimension === "tool" ? s3.toolMix : s3.skillMix).map(([key2, count3]) => [
|
|
77274
77726
|
key2,
|
|
77275
77727
|
count3
|
|
@@ -77279,12 +77731,8 @@ class MockHistoryBoardService {
|
|
|
77279
77731
|
const tokens = dimension === "model" || dimension === "source" ? count3 : weight > 0 ? s3.tokens.billedTokens * count3 / weight : 0;
|
|
77280
77732
|
buckets[bKey].series[key2] = (buckets[bKey].series[key2] ?? 0) + tokens;
|
|
77281
77733
|
}
|
|
77282
|
-
const skillWeight = Object.values(s3.skillMix).reduce((sum, count3) => sum + count3, 0);
|
|
77283
|
-
for (const [skill, count3] of Object.entries(s3.skillMix)) {
|
|
77284
|
-
skillBuckets[bKey].series[skill] = (skillBuckets[bKey].series[skill] ?? 0) + (skillWeight > 0 ? s3.tokens.billedTokens * count3 / skillWeight : 0);
|
|
77285
|
-
}
|
|
77286
77734
|
}
|
|
77287
|
-
const
|
|
77735
|
+
const toTimeSeries = (map2) => Object.entries(map2).sort(([a2], [b]) => a2.localeCompare(b)).map(([bKey, bVal]) => {
|
|
77288
77736
|
const denom = bVal.total + bVal.cacheRead;
|
|
77289
77737
|
const ratio = denom > 0 ? Math.round(bVal.cacheRead / denom * 100) : 0;
|
|
77290
77738
|
return {
|
|
@@ -77293,11 +77741,11 @@ class MockHistoryBoardService {
|
|
|
77293
77741
|
series: bVal.series
|
|
77294
77742
|
};
|
|
77295
77743
|
});
|
|
77296
|
-
const
|
|
77297
|
-
|
|
77298
|
-
|
|
77299
|
-
|
|
77300
|
-
|
|
77744
|
+
const timeSeries = toTimeSeries(buckets);
|
|
77745
|
+
const modelTimeSeries = toTimeSeries(modelBuckets);
|
|
77746
|
+
const sourceTimeSeries = toTimeSeries(sourceBuckets);
|
|
77747
|
+
const toolTimeSeries = toTimeSeries(toolBuckets);
|
|
77748
|
+
const skillTimeSeries = toTimeSeries(skillBuckets);
|
|
77301
77749
|
const topModels = MODELS_CATALOG.map((m) => {
|
|
77302
77750
|
const tokens = modelTokens[m.id] ?? 0;
|
|
77303
77751
|
const share = totalBilled > 0 ? Math.round(tokens / totalBilled * 100) : 0;
|
|
@@ -77342,7 +77790,10 @@ class MockHistoryBoardService {
|
|
|
77342
77790
|
},
|
|
77343
77791
|
kpiTrend: this.buildKpiTrend(matching),
|
|
77344
77792
|
previousKpis: null,
|
|
77345
|
-
skillTimeSeries
|
|
77793
|
+
skillTimeSeries,
|
|
77794
|
+
modelTimeSeries,
|
|
77795
|
+
sourceTimeSeries,
|
|
77796
|
+
toolTimeSeries
|
|
77346
77797
|
};
|
|
77347
77798
|
}
|
|
77348
77799
|
buildKpiTrend(sessions) {
|
|
@@ -77799,6 +78250,132 @@ System components and dataflow...`,
|
|
|
77799
78250
|
message: `Mock import completed in ${mode} mode: 9 sources checked, 0 new transcripts found.`
|
|
77800
78251
|
};
|
|
77801
78252
|
}
|
|
78253
|
+
async getToolSequence(input) {
|
|
78254
|
+
const sessions = input.mode === "session" ? this.sessions.filter((s3) => s3.id === input.sessionId) : this.filterSessions(input.filter);
|
|
78255
|
+
if (input.mode === "session" && sessions.length === 0) {
|
|
78256
|
+
throw new Error(`History session not found: ${input.sessionId}`);
|
|
78257
|
+
}
|
|
78258
|
+
const rawItems = [];
|
|
78259
|
+
let globalSeq = 1;
|
|
78260
|
+
const defaultMockTools = [
|
|
78261
|
+
{ name: "Glob", cat: "search", dur: 120, args: '{"pattern":"**/*.ts"}' },
|
|
78262
|
+
{ name: "Read", cat: "read", dur: 450, args: '{"file":"src/index.ts"}' },
|
|
78263
|
+
{ name: "Write", cat: "write", dur: 310, args: '{"file":"src/test.ts"}' },
|
|
78264
|
+
{ name: "RunCommand", cat: "bash", dur: 1200, args: '{"cmd":"bun test"}' },
|
|
78265
|
+
{ name: "mcp__context__search", cat: "mcp", dur: 280, args: '{"q":"history"}' }
|
|
78266
|
+
];
|
|
78267
|
+
for (const session4 of sessions) {
|
|
78268
|
+
let toolSeq = 1;
|
|
78269
|
+
for (const [toolName, count3] of Object.entries(session4.toolMix)) {
|
|
78270
|
+
for (let i2 = 0;i2 < count3; i2++) {
|
|
78271
|
+
const preset = defaultMockTools.find((t) => t.name === toolName) ?? {
|
|
78272
|
+
name: toolName,
|
|
78273
|
+
cat: "other",
|
|
78274
|
+
dur: 250,
|
|
78275
|
+
args: `{"action":"${toolName}"}`
|
|
78276
|
+
};
|
|
78277
|
+
const isError = i2 === 0 && session4.errors > 0;
|
|
78278
|
+
rawItems.push({
|
|
78279
|
+
seq: globalSeq++,
|
|
78280
|
+
toolSeq: toolSeq++,
|
|
78281
|
+
ts: new Date(session4.start + toolSeq * 1000).toISOString(),
|
|
78282
|
+
toolName: preset.name,
|
|
78283
|
+
category: preset.cat,
|
|
78284
|
+
status: isError ? "error" : "ok",
|
|
78285
|
+
durationMs: preset.dur,
|
|
78286
|
+
durationSource: "measured",
|
|
78287
|
+
resultBytes: 1024,
|
|
78288
|
+
argsRaw: preset.args,
|
|
78289
|
+
argsDigest: `args(${preset.name})`,
|
|
78290
|
+
errorText: isError ? `Tool execution failed: ${toolName} error` : null,
|
|
78291
|
+
callId: `call-${globalSeq}`,
|
|
78292
|
+
messageHash: `hash-${session4.id}-${toolSeq}`,
|
|
78293
|
+
sessionId: session4.id,
|
|
78294
|
+
source: session4.source,
|
|
78295
|
+
model: session4.model,
|
|
78296
|
+
tokens: {
|
|
78297
|
+
billedTokens: 500,
|
|
78298
|
+
cacheSavedTokens: 400,
|
|
78299
|
+
cacheReadTokens: 400,
|
|
78300
|
+
freshInputTokens: 100,
|
|
78301
|
+
outputTokens: 400
|
|
78302
|
+
}
|
|
78303
|
+
});
|
|
78304
|
+
}
|
|
78305
|
+
}
|
|
78306
|
+
}
|
|
78307
|
+
let filtered = rawItems;
|
|
78308
|
+
if (input.toolNames && input.toolNames.length > 0) {
|
|
78309
|
+
const set2 = new Set(input.toolNames);
|
|
78310
|
+
filtered = filtered.filter((item) => set2.has(item.toolName));
|
|
78311
|
+
}
|
|
78312
|
+
if (input.status && input.status !== "all") {
|
|
78313
|
+
filtered = filtered.filter((item) => item.status === input.status);
|
|
78314
|
+
}
|
|
78315
|
+
if (input.search && input.search.trim().length > 0) {
|
|
78316
|
+
const q = input.search.trim().toLowerCase();
|
|
78317
|
+
filtered = filtered.filter((item) => item.toolName.toLowerCase().includes(q) || (item.argsRaw?.toLowerCase().includes(q) ?? false) || (item.errorText?.toLowerCase().includes(q) ?? false));
|
|
78318
|
+
}
|
|
78319
|
+
const items = filtered.map((item, idx) => ({ ...item, seq: idx + 1 }));
|
|
78320
|
+
let totalDurationMs = 0;
|
|
78321
|
+
let measuredCount = 0;
|
|
78322
|
+
let unmeasuredCount = 0;
|
|
78323
|
+
let errorCount = 0;
|
|
78324
|
+
const uniqueToolsSet = new Set;
|
|
78325
|
+
const sessionsSet = new Set;
|
|
78326
|
+
let billedTokensTotal = 0;
|
|
78327
|
+
let cacheSavedTokensTotal = 0;
|
|
78328
|
+
let cacheReadTokensTotal = 0;
|
|
78329
|
+
let freshInputTokensTotal = 0;
|
|
78330
|
+
let outputTokensTotal = 0;
|
|
78331
|
+
for (const item of items) {
|
|
78332
|
+
uniqueToolsSet.add(item.toolName);
|
|
78333
|
+
sessionsSet.add(item.sessionId);
|
|
78334
|
+
if (item.status === "error")
|
|
78335
|
+
errorCount++;
|
|
78336
|
+
if (item.durationMs != null && item.durationMs > 0) {
|
|
78337
|
+
totalDurationMs += item.durationMs;
|
|
78338
|
+
measuredCount++;
|
|
78339
|
+
} else {
|
|
78340
|
+
unmeasuredCount++;
|
|
78341
|
+
}
|
|
78342
|
+
billedTokensTotal += item.tokens.billedTokens;
|
|
78343
|
+
cacheSavedTokensTotal += item.tokens.cacheSavedTokens;
|
|
78344
|
+
cacheReadTokensTotal += item.tokens.cacheReadTokens;
|
|
78345
|
+
freshInputTokensTotal += item.tokens.freshInputTokens;
|
|
78346
|
+
outputTokensTotal += item.tokens.outputTokens;
|
|
78347
|
+
}
|
|
78348
|
+
const totalCalls = items.length;
|
|
78349
|
+
const errorRate = totalCalls > 0 ? Math.round(errorCount / totalCalls * 1000) / 1000 : 0;
|
|
78350
|
+
const meanDurationMs = measuredCount > 0 ? Math.round(totalDurationMs / measuredCount) : 0;
|
|
78351
|
+
return {
|
|
78352
|
+
mode: input.mode,
|
|
78353
|
+
scope: {
|
|
78354
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
78355
|
+
source: input.mode === "session" ? input.source : null,
|
|
78356
|
+
model: sessions.length === 1 ? sessions[0]?.model ?? null : null,
|
|
78357
|
+
start: items.length > 0 ? items[0]?.ts ?? null : null,
|
|
78358
|
+
end: items.length > 0 ? items[items.length - 1]?.ts ?? null : null,
|
|
78359
|
+
totalCalls,
|
|
78360
|
+
uniqueTools: uniqueToolsSet.size,
|
|
78361
|
+
errorCount,
|
|
78362
|
+
errorRate,
|
|
78363
|
+
totalDurationMs,
|
|
78364
|
+
meanDurationMs,
|
|
78365
|
+
durationUnmeasured: unmeasuredCount,
|
|
78366
|
+
sessionCount: sessionsSet.size,
|
|
78367
|
+
tokens: {
|
|
78368
|
+
billedTokens: billedTokensTotal,
|
|
78369
|
+
cacheSavedTokens: cacheSavedTokensTotal,
|
|
78370
|
+
cacheReadTokens: cacheReadTokensTotal,
|
|
78371
|
+
freshInputTokens: freshInputTokensTotal,
|
|
78372
|
+
outputTokens: outputTokensTotal
|
|
78373
|
+
}
|
|
78374
|
+
},
|
|
78375
|
+
truncated: false,
|
|
78376
|
+
items
|
|
78377
|
+
};
|
|
78378
|
+
}
|
|
77802
78379
|
}
|
|
77803
78380
|
var SOURCES_CATALOG, MODELS_CATALOG, TOOLS_CATALOG, SKILLS_CATALOG;
|
|
77804
78381
|
var init_history_board_mock_service = __esm(() => {
|
|
@@ -77938,7 +78515,11 @@ function toArtifactSelector(filter) {
|
|
|
77938
78515
|
const until = filter.to ?? null;
|
|
77939
78516
|
if (!since && filter.range && filter.range !== "all" && filter.range !== "custom") {
|
|
77940
78517
|
const now2 = Date.now();
|
|
77941
|
-
if (filter.range === "
|
|
78518
|
+
if (filter.range === "1h") {
|
|
78519
|
+
since = new Date(now2 - 1 * 60 * 60 * 1000).toISOString();
|
|
78520
|
+
} else if (filter.range === "4h") {
|
|
78521
|
+
since = new Date(now2 - 4 * 60 * 60 * 1000).toISOString();
|
|
78522
|
+
} else if (filter.range === "24h") {
|
|
77942
78523
|
since = new Date(now2 - 24 * 60 * 60 * 1000).toISOString();
|
|
77943
78524
|
} else if (filter.range === "7d") {
|
|
77944
78525
|
since = new Date(now2 - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
@@ -77958,10 +78539,12 @@ function toArtifactSelector(filter) {
|
|
|
77958
78539
|
taskWbs: null
|
|
77959
78540
|
};
|
|
77960
78541
|
}
|
|
77961
|
-
function resolveBucket(bucket, range = "
|
|
78542
|
+
function resolveBucket(bucket, range = "4h") {
|
|
77962
78543
|
if (bucket && bucket !== "auto") {
|
|
77963
78544
|
return bucket;
|
|
77964
78545
|
}
|
|
78546
|
+
if (range === "1h" || range === "4h")
|
|
78547
|
+
return "5m";
|
|
77965
78548
|
if (range === "24h")
|
|
77966
78549
|
return "10m";
|
|
77967
78550
|
if (range === "7d")
|
|
@@ -78070,7 +78653,10 @@ function projectSummary(rows, extras) {
|
|
|
78070
78653
|
},
|
|
78071
78654
|
kpiTrend: extras.kpiTrend,
|
|
78072
78655
|
previousKpis: extras.previousKpis,
|
|
78073
|
-
skillTimeSeries: extras.skillTimeSeries
|
|
78656
|
+
skillTimeSeries: extras.skillTimeSeries,
|
|
78657
|
+
modelTimeSeries: extras.modelTimeSeries,
|
|
78658
|
+
sourceTimeSeries: extras.sourceTimeSeries,
|
|
78659
|
+
toolTimeSeries: extras.toolTimeSeries
|
|
78074
78660
|
};
|
|
78075
78661
|
}
|
|
78076
78662
|
function resolveTrendSelector(sel) {
|
|
@@ -78172,7 +78758,7 @@ async function computeSummaryExtras(db2, sel, bucket, dimension, exact, activeBu
|
|
|
78172
78758
|
const trendSel = resolveTrendSelector(sel);
|
|
78173
78759
|
const endDay = trendSel.until.slice(0, 10);
|
|
78174
78760
|
const previousSel = previousWindowSelector(sel);
|
|
78175
|
-
const [trendRows, previousKpis, skillBuckets] = await Promise.all([
|
|
78761
|
+
const [trendRows, previousKpis, modelBuckets, sourceBuckets, toolBuckets, skillBuckets] = await Promise.all([
|
|
78176
78762
|
exact ? historyKpiTrend(db2, trendSel) : historyBoardKpiTrendFromRollup(db2, trendSel),
|
|
78177
78763
|
(async () => {
|
|
78178
78764
|
if (previousSel === null)
|
|
@@ -78182,8 +78768,29 @@ async function computeSummaryExtras(db2, sel, bucket, dimension, exact, activeBu
|
|
|
78182
78768
|
return projectPreviousKpis(await historyBoardSummaryFromRollup(db2, previousSel, "1d", "model"));
|
|
78183
78769
|
})(),
|
|
78184
78770
|
(async () => {
|
|
78185
|
-
if (dimension === "
|
|
78186
|
-
return activeBuckets
|
|
78771
|
+
if (dimension === "model" && activeBuckets && activeBuckets.length > 0)
|
|
78772
|
+
return activeBuckets;
|
|
78773
|
+
if (exact)
|
|
78774
|
+
return await bucketedTokenSeries(db2, sel, bucket, "model");
|
|
78775
|
+
return (await historyBoardSummaryFromRollup(db2, sel, bucket, "model")).buckets;
|
|
78776
|
+
})(),
|
|
78777
|
+
(async () => {
|
|
78778
|
+
if (dimension === "source" && activeBuckets && activeBuckets.length > 0)
|
|
78779
|
+
return activeBuckets;
|
|
78780
|
+
if (exact)
|
|
78781
|
+
return await bucketedTokenSeries(db2, sel, bucket, "source");
|
|
78782
|
+
return (await historyBoardSummaryFromRollup(db2, sel, bucket, "source")).buckets;
|
|
78783
|
+
})(),
|
|
78784
|
+
(async () => {
|
|
78785
|
+
if (dimension === "tool" && activeBuckets && activeBuckets.length > 0)
|
|
78786
|
+
return activeBuckets;
|
|
78787
|
+
if (exact)
|
|
78788
|
+
return await bucketedTokenSeries(db2, sel, bucket, "tool");
|
|
78789
|
+
return (await historyBoardSummaryFromRollup(db2, sel, bucket, "tool")).buckets;
|
|
78790
|
+
})(),
|
|
78791
|
+
(async () => {
|
|
78792
|
+
if (dimension === "skill" && activeBuckets && activeBuckets.length > 0)
|
|
78793
|
+
return activeBuckets;
|
|
78187
78794
|
if (exact)
|
|
78188
78795
|
return await bucketedTokenSeries(db2, sel, bucket, "skill");
|
|
78189
78796
|
return (await historyBoardSummaryFromRollup(db2, sel, bucket, "skill")).buckets;
|
|
@@ -78192,6 +78799,9 @@ async function computeSummaryExtras(db2, sel, bucket, dimension, exact, activeBu
|
|
|
78192
78799
|
return {
|
|
78193
78800
|
kpiTrend: projectKpiTrend(trendRows, endDay),
|
|
78194
78801
|
previousKpis,
|
|
78802
|
+
modelTimeSeries: projectSkillTimeSeries(modelBuckets),
|
|
78803
|
+
sourceTimeSeries: projectSkillTimeSeries(sourceBuckets),
|
|
78804
|
+
toolTimeSeries: projectSkillTimeSeries(toolBuckets),
|
|
78195
78805
|
skillTimeSeries: projectSkillTimeSeries(skillBuckets)
|
|
78196
78806
|
};
|
|
78197
78807
|
}
|
|
@@ -78255,6 +78865,20 @@ function projectSources(sources, daily, databaseBytes) {
|
|
|
78255
78865
|
})
|
|
78256
78866
|
};
|
|
78257
78867
|
}
|
|
78868
|
+
function toolCategory(toolName) {
|
|
78869
|
+
const lower = toolName.toLowerCase();
|
|
78870
|
+
if (/mcp|task|agent|subagent|skill/.test(lower))
|
|
78871
|
+
return "mcp";
|
|
78872
|
+
if (/grep|glob|search|find|webfetch|websearch/.test(lower))
|
|
78873
|
+
return "search";
|
|
78874
|
+
if (/write|edit|patch|apply|notebook/.test(lower))
|
|
78875
|
+
return "write";
|
|
78876
|
+
if (/read|cat|view|open/.test(lower))
|
|
78877
|
+
return "read";
|
|
78878
|
+
if (/bash|shell|exec|run|command|terminal/.test(lower))
|
|
78879
|
+
return "bash";
|
|
78880
|
+
return "other";
|
|
78881
|
+
}
|
|
78258
78882
|
|
|
78259
78883
|
class LiveHistoryBoardService {
|
|
78260
78884
|
deps;
|
|
@@ -78288,11 +78912,14 @@ class LiveHistoryBoardService {
|
|
|
78288
78912
|
cacheEfficiency: { hitRatio: 0, savedTokens: 0, totalRead: 0 },
|
|
78289
78913
|
kpiTrend: [],
|
|
78290
78914
|
previousKpis: null,
|
|
78291
|
-
skillTimeSeries: []
|
|
78915
|
+
skillTimeSeries: [],
|
|
78916
|
+
modelTimeSeries: [],
|
|
78917
|
+
sourceTimeSeries: [],
|
|
78918
|
+
toolTimeSeries: []
|
|
78292
78919
|
};
|
|
78293
78920
|
}
|
|
78294
78921
|
const sel = toArtifactSelector(filter);
|
|
78295
|
-
const bucket = resolveBucket(filter?.bucket, filter?.range ?? "
|
|
78922
|
+
const bucket = resolveBucket(filter?.bucket, filter?.range ?? "4h");
|
|
78296
78923
|
const dimension = filter?.dimension ?? "model";
|
|
78297
78924
|
const exactSummaryRollup = (sel.tools?.length ?? 0) === 0 && (sel.skills?.length ?? 0) === 0;
|
|
78298
78925
|
if (exactSummaryRollup && await historyBoardRollupsFresh(db2)) {
|
|
@@ -78321,7 +78948,7 @@ class LiveHistoryBoardService {
|
|
|
78321
78948
|
target.set(key2, aggregate2);
|
|
78322
78949
|
}
|
|
78323
78950
|
}
|
|
78324
|
-
const extras = await computeSummaryExtras(db2, sel, bucket, dimension, true,
|
|
78951
|
+
const extras = await computeSummaryExtras(db2, sel, bucket, dimension, true, bucketRows);
|
|
78325
78952
|
return projectSummary({
|
|
78326
78953
|
buckets: bucketRows,
|
|
78327
78954
|
models: Array.from(models, ([key2, value]) => ({ key: key2, ...value })).sort((a2, b) => b.freshInputTokens + b.outputTokens - a2.freshInputTokens - a2.outputTokens),
|
|
@@ -78582,6 +79209,178 @@ class LiveHistoryBoardService {
|
|
|
78582
79209
|
blocks: sortedBlocks
|
|
78583
79210
|
};
|
|
78584
79211
|
}
|
|
79212
|
+
static toolCategory(toolName) {
|
|
79213
|
+
const lower = toolName.toLowerCase();
|
|
79214
|
+
if (/mcp|task|agent|subagent|skill/.test(lower))
|
|
79215
|
+
return "mcp";
|
|
79216
|
+
if (/grep|glob|search|find|webfetch|websearch/.test(lower))
|
|
79217
|
+
return "search";
|
|
79218
|
+
if (/write|edit|patch|apply|notebook/.test(lower))
|
|
79219
|
+
return "write";
|
|
79220
|
+
if (/read|cat|view|open/.test(lower))
|
|
79221
|
+
return "read";
|
|
79222
|
+
if (/bash|shell|exec|run|command|terminal/.test(lower))
|
|
79223
|
+
return "bash";
|
|
79224
|
+
return "other";
|
|
79225
|
+
}
|
|
79226
|
+
async getToolSequence(input) {
|
|
79227
|
+
const db2 = await this.resolveDb();
|
|
79228
|
+
if (!db2) {
|
|
79229
|
+
return {
|
|
79230
|
+
mode: input.mode,
|
|
79231
|
+
scope: {
|
|
79232
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
79233
|
+
source: input.mode === "session" ? input.source : null,
|
|
79234
|
+
model: null,
|
|
79235
|
+
start: null,
|
|
79236
|
+
end: null,
|
|
79237
|
+
totalCalls: 0,
|
|
79238
|
+
uniqueTools: 0,
|
|
79239
|
+
errorCount: 0,
|
|
79240
|
+
errorRate: 0,
|
|
79241
|
+
totalDurationMs: 0,
|
|
79242
|
+
meanDurationMs: 0,
|
|
79243
|
+
durationUnmeasured: 0,
|
|
79244
|
+
sessionCount: 0,
|
|
79245
|
+
tokens: {
|
|
79246
|
+
billedTokens: 0,
|
|
79247
|
+
cacheSavedTokens: 0,
|
|
79248
|
+
cacheReadTokens: 0,
|
|
79249
|
+
freshInputTokens: 0,
|
|
79250
|
+
outputTokens: 0
|
|
79251
|
+
}
|
|
79252
|
+
},
|
|
79253
|
+
truncated: false,
|
|
79254
|
+
items: []
|
|
79255
|
+
};
|
|
79256
|
+
}
|
|
79257
|
+
let scope;
|
|
79258
|
+
if (input.mode === "session") {
|
|
79259
|
+
if (input.sessionId === "" || input.sessionId === "unknown" || input.sessionId === "session") {
|
|
79260
|
+
throw new Error(`History session not found: ${input.sessionId || "(empty)"}`);
|
|
79261
|
+
}
|
|
79262
|
+
if (input.source === "" || input.source === "unknown") {
|
|
79263
|
+
throw new Error(`History source not found: ${input.source || "(empty)"}`);
|
|
79264
|
+
}
|
|
79265
|
+
scope = { mode: "session", source: input.source, sessionId: input.sessionId };
|
|
79266
|
+
} else {
|
|
79267
|
+
const sel = toArtifactSelector(input.filter);
|
|
79268
|
+
scope = { mode: "consolidated", sel };
|
|
79269
|
+
}
|
|
79270
|
+
const filters = {
|
|
79271
|
+
toolNames: input.toolNames,
|
|
79272
|
+
status: input.status,
|
|
79273
|
+
search: input.search
|
|
79274
|
+
};
|
|
79275
|
+
const queryResult = await toolSequenceQuery(db2, scope, filters, 5000);
|
|
79276
|
+
const rows = queryResult.rows;
|
|
79277
|
+
let totalDurationMs = 0;
|
|
79278
|
+
let measuredCount = 0;
|
|
79279
|
+
let unmeasuredCount = 0;
|
|
79280
|
+
let errorCount = 0;
|
|
79281
|
+
const uniqueToolsSet = new Set;
|
|
79282
|
+
const sessionsSet = new Set;
|
|
79283
|
+
let freshTokensTotal = 0;
|
|
79284
|
+
let cacheReadTokensTotal = 0;
|
|
79285
|
+
let outputTokensTotal = 0;
|
|
79286
|
+
let firstTs = null;
|
|
79287
|
+
let lastTs = null;
|
|
79288
|
+
let commonModel = null;
|
|
79289
|
+
let modelMixed = false;
|
|
79290
|
+
const items = rows.map((row, index2) => {
|
|
79291
|
+
const category = toolCategory(row.toolName);
|
|
79292
|
+
uniqueToolsSet.add(row.toolName);
|
|
79293
|
+
sessionsSet.add(row.sessionId);
|
|
79294
|
+
if (index2 === 0) {
|
|
79295
|
+
firstTs = row.ts;
|
|
79296
|
+
commonModel = row.model;
|
|
79297
|
+
} else {
|
|
79298
|
+
if (row.model !== commonModel) {
|
|
79299
|
+
modelMixed = true;
|
|
79300
|
+
}
|
|
79301
|
+
}
|
|
79302
|
+
if (row.ts) {
|
|
79303
|
+
lastTs = row.ts;
|
|
79304
|
+
}
|
|
79305
|
+
const isError = row.status === "error";
|
|
79306
|
+
if (isError) {
|
|
79307
|
+
errorCount++;
|
|
79308
|
+
}
|
|
79309
|
+
let durationSource = "unmeasured";
|
|
79310
|
+
if (row.durationMs != null && row.durationMs > 0) {
|
|
79311
|
+
durationSource = "measured";
|
|
79312
|
+
totalDurationMs += row.durationMs;
|
|
79313
|
+
measuredCount++;
|
|
79314
|
+
} else {
|
|
79315
|
+
unmeasuredCount++;
|
|
79316
|
+
}
|
|
79317
|
+
const linkCount = Math.max(row.links, 1);
|
|
79318
|
+
const fresh = (row.inputTokens ?? 0) / linkCount;
|
|
79319
|
+
const cacheRead = (row.cacheReadTokens ?? 0) / linkCount;
|
|
79320
|
+
const output2 = (row.outputTokens ?? 0) / linkCount;
|
|
79321
|
+
const billed = fresh + output2;
|
|
79322
|
+
const cacheSaved = cacheRead;
|
|
79323
|
+
freshTokensTotal += fresh;
|
|
79324
|
+
cacheReadTokensTotal += cacheRead;
|
|
79325
|
+
outputTokensTotal += output2;
|
|
79326
|
+
return {
|
|
79327
|
+
seq: index2 + 1,
|
|
79328
|
+
toolSeq: row.toolSeq,
|
|
79329
|
+
ts: row.ts,
|
|
79330
|
+
toolName: row.toolName,
|
|
79331
|
+
category,
|
|
79332
|
+
status: row.status === "ok" || row.status === "error" ? row.status : "unknown",
|
|
79333
|
+
durationMs: durationSource === "measured" ? row.durationMs : null,
|
|
79334
|
+
durationSource,
|
|
79335
|
+
resultBytes: row.resultBytes,
|
|
79336
|
+
argsRaw: row.argsRaw,
|
|
79337
|
+
argsDigest: row.argsDigest,
|
|
79338
|
+
errorText: row.errorText,
|
|
79339
|
+
callId: row.callId,
|
|
79340
|
+
messageHash: row.messageHash,
|
|
79341
|
+
sessionId: row.sessionId,
|
|
79342
|
+
source: row.source,
|
|
79343
|
+
model: row.model,
|
|
79344
|
+
tokens: {
|
|
79345
|
+
billedTokens: billed,
|
|
79346
|
+
cacheSavedTokens: cacheSaved,
|
|
79347
|
+
cacheReadTokens: cacheRead,
|
|
79348
|
+
freshInputTokens: fresh,
|
|
79349
|
+
outputTokens: output2
|
|
79350
|
+
}
|
|
79351
|
+
};
|
|
79352
|
+
});
|
|
79353
|
+
const totalCalls = rows.length;
|
|
79354
|
+
const errorRate = totalCalls > 0 ? Math.round(errorCount / totalCalls * 1000) / 1000 : 0;
|
|
79355
|
+
const meanDurationMs = measuredCount > 0 ? Math.round(totalDurationMs / measuredCount) : 0;
|
|
79356
|
+
return {
|
|
79357
|
+
mode: input.mode,
|
|
79358
|
+
scope: {
|
|
79359
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
79360
|
+
source: input.mode === "session" ? input.source : null,
|
|
79361
|
+
model: modelMixed ? null : commonModel,
|
|
79362
|
+
start: firstTs,
|
|
79363
|
+
end: lastTs,
|
|
79364
|
+
totalCalls,
|
|
79365
|
+
uniqueTools: uniqueToolsSet.size,
|
|
79366
|
+
errorCount,
|
|
79367
|
+
errorRate,
|
|
79368
|
+
totalDurationMs,
|
|
79369
|
+
meanDurationMs,
|
|
79370
|
+
durationUnmeasured: unmeasuredCount,
|
|
79371
|
+
sessionCount: sessionsSet.size,
|
|
79372
|
+
tokens: {
|
|
79373
|
+
billedTokens: freshTokensTotal + outputTokensTotal,
|
|
79374
|
+
cacheSavedTokens: cacheReadTokensTotal,
|
|
79375
|
+
cacheReadTokens: cacheReadTokensTotal,
|
|
79376
|
+
freshInputTokens: freshTokensTotal,
|
|
79377
|
+
outputTokens: outputTokensTotal
|
|
79378
|
+
}
|
|
79379
|
+
},
|
|
79380
|
+
truncated: queryResult.truncated,
|
|
79381
|
+
items
|
|
79382
|
+
};
|
|
79383
|
+
}
|
|
78585
79384
|
async getSessions(input) {
|
|
78586
79385
|
const db2 = await this.resolveDb();
|
|
78587
79386
|
if (!db2) {
|
|
@@ -79035,6 +79834,62 @@ var init_history_refresh_service = __esm(() => {
|
|
|
79035
79834
|
init_split_launch_command();
|
|
79036
79835
|
});
|
|
79037
79836
|
|
|
79837
|
+
// ../../packages/app/src/services/task-attribution.ts
|
|
79838
|
+
async function attributeSessions(input) {
|
|
79839
|
+
const dao2 = new TaskSessionDao(input.db);
|
|
79840
|
+
const summary = emptyAttributionSummary();
|
|
79841
|
+
const known = new Map;
|
|
79842
|
+
if (input.reconcile === true && input.dryRun !== true) {
|
|
79843
|
+
await dao2.deleteBySource(input.source);
|
|
79844
|
+
}
|
|
79845
|
+
for (const sessionId of input.sessionIds) {
|
|
79846
|
+
summary.sessionsEvaluated += 1;
|
|
79847
|
+
const evidence = await loadAttributionEvidence(input.db, input.source, sessionId);
|
|
79848
|
+
if (evidence.length === 0)
|
|
79849
|
+
continue;
|
|
79850
|
+
const decision = classifyTaskAttribution(evidence);
|
|
79851
|
+
summary.skippedEvidence += decision.skipped;
|
|
79852
|
+
summary.ambiguousEvidence += decision.ambiguous;
|
|
79853
|
+
for (const candidate of decision.candidates) {
|
|
79854
|
+
let valid = known.get(candidate.wbs);
|
|
79855
|
+
if (valid === undefined) {
|
|
79856
|
+
valid = await input.isKnownWbs(candidate.wbs);
|
|
79857
|
+
known.set(candidate.wbs, valid);
|
|
79858
|
+
}
|
|
79859
|
+
if (!valid) {
|
|
79860
|
+
summary.skippedEvidence += 1;
|
|
79861
|
+
continue;
|
|
79862
|
+
}
|
|
79863
|
+
if (input.dryRun === true) {
|
|
79864
|
+
const present = await dao2.hasLink(candidate.wbs, input.source, sessionId);
|
|
79865
|
+
if (present)
|
|
79866
|
+
summary.linksAlreadyPresent += 1;
|
|
79867
|
+
else
|
|
79868
|
+
summary.linksCreated += 1;
|
|
79869
|
+
continue;
|
|
79870
|
+
}
|
|
79871
|
+
const outcome = await dao2.insert({
|
|
79872
|
+
wbs: candidate.wbs,
|
|
79873
|
+
source: input.source,
|
|
79874
|
+
sessionId,
|
|
79875
|
+
exactness: "estimated",
|
|
79876
|
+
mechanism: candidate.mechanism,
|
|
79877
|
+
evidenceKind: candidate.evidenceKind,
|
|
79878
|
+
evidenceRef: candidate.evidenceRef,
|
|
79879
|
+
resolvedAt: input.resolvedAt
|
|
79880
|
+
});
|
|
79881
|
+
if (outcome === "created")
|
|
79882
|
+
summary.linksCreated += 1;
|
|
79883
|
+
else
|
|
79884
|
+
summary.linksAlreadyPresent += 1;
|
|
79885
|
+
}
|
|
79886
|
+
}
|
|
79887
|
+
return summary;
|
|
79888
|
+
}
|
|
79889
|
+
var init_task_attribution2 = __esm(() => {
|
|
79890
|
+
init_src2();
|
|
79891
|
+
});
|
|
79892
|
+
|
|
79038
79893
|
// ../../packages/app/src/services/verified-outcome.ts
|
|
79039
79894
|
async function deriveVerifiedOutcome(deps, window2 = {}) {
|
|
79040
79895
|
let linkRows;
|
|
@@ -79190,6 +80045,37 @@ import {
|
|
|
79190
80045
|
} from "fs";
|
|
79191
80046
|
import { homedir as homedir5 } from "os";
|
|
79192
80047
|
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join15, resolve as resolve4, sep } from "path";
|
|
80048
|
+
function parseImporterVersion(version3) {
|
|
80049
|
+
if (version3 === undefined) {
|
|
80050
|
+
return null;
|
|
80051
|
+
}
|
|
80052
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version3.trim());
|
|
80053
|
+
if (match === null) {
|
|
80054
|
+
return null;
|
|
80055
|
+
}
|
|
80056
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
80057
|
+
}
|
|
80058
|
+
function compareVersionTriples(a2, b) {
|
|
80059
|
+
for (let i2 = 0;i2 < 3; i2++) {
|
|
80060
|
+
const ai = a2[i2];
|
|
80061
|
+
const bi = b[i2];
|
|
80062
|
+
if (ai !== bi) {
|
|
80063
|
+
return ai < bi ? -1 : 1;
|
|
80064
|
+
}
|
|
80065
|
+
}
|
|
80066
|
+
return 0;
|
|
80067
|
+
}
|
|
80068
|
+
function assertPiImporterSafe(input) {
|
|
80069
|
+
if (input.dryRun || input.mode !== "full" || !input.sources.includes("pi")) {
|
|
80070
|
+
return;
|
|
80071
|
+
}
|
|
80072
|
+
const minSafe = parseImporterVersion(MIN_SAFE_PI_BASH_IMPORTER_VERSION);
|
|
80073
|
+
const installed = parseImporterVersion(input.importerVersion);
|
|
80074
|
+
if (minSafe !== null && installed !== null && compareVersionTriples(installed, minSafe) >= 0) {
|
|
80075
|
+
return;
|
|
80076
|
+
}
|
|
80077
|
+
throw new UnsafeHistoryImporterError(`refusing full pi history import \u2014 installed @gobing-ai/ts-llm-jsonl-importer version ` + `${input.importerVersion ?? "unknown"} destroys history_tool_call.args_raw on pi imports ` + `(todo-tool arguments collapse to their first line; bash commands are lost). ` + `Minimum safe version: ${MIN_SAFE_PI_BASH_IMPORTER_VERSION}. ` + `Remedy: upgrade or relink @gobing-ai/ts-libs to a release containing ts-libs commit 96762d5, ` + `or preview the import with --dry-run.`, input.importerVersion ?? "unknown");
|
|
80078
|
+
}
|
|
79193
80079
|
async function buildRefreshCoverage(db2, selector, fanOut) {
|
|
79194
80080
|
const statusBySource = new Map(fanOut.entries.map((e) => [e.source, e.status]));
|
|
79195
80081
|
const refreshed = FULL_FIDELITY_SOURCES.filter((s3) => statusBySource.has(s3) && statusBySource.get(s3) !== "failed");
|
|
@@ -79235,6 +80121,8 @@ class HistoryService {
|
|
|
79235
80121
|
const parsedSource = parseSource(source);
|
|
79236
80122
|
const mode = parseMode(opts.mode ?? (opts.file !== undefined ? "force-file" : "incremental"));
|
|
79237
80123
|
const dryRun = opts.dryRun ?? false;
|
|
80124
|
+
assertPiImporterSafe({ importerVersion: this.ctx.importerVersion, mode, dryRun, sources: [parsedSource] });
|
|
80125
|
+
const startedAt = new Date().toISOString();
|
|
79238
80126
|
const db2 = await this.ctx.getDb();
|
|
79239
80127
|
const dao2 = new RunSessionDao(db2);
|
|
79240
80128
|
const discovery = parsedSource !== "opencode" && opts.file === undefined && opts.root === undefined ? await runSessionAugmentedRoots(parsedSource, this.ctx.historyHome ?? homedir5(), this.ctx.cwd ?? process.cwd(), dao2) : undefined;
|
|
@@ -79262,7 +80150,45 @@ class HistoryService {
|
|
|
79262
80150
|
await dao2.alignMessageProvenance();
|
|
79263
80151
|
await deriveAssistantDurations(db2);
|
|
79264
80152
|
}
|
|
79265
|
-
|
|
80153
|
+
const attribution2 = await this.attributeSource({
|
|
80154
|
+
source: parsedSource,
|
|
80155
|
+
mode: mode === "full" || dryRun ? "all" : "changed",
|
|
80156
|
+
changedSince: startedAt,
|
|
80157
|
+
dryRun
|
|
80158
|
+
});
|
|
80159
|
+
return {
|
|
80160
|
+
...result,
|
|
80161
|
+
attribution: attribution2.summary,
|
|
80162
|
+
...attribution2.error !== null ? { attributionError: attribution2.error } : {}
|
|
80163
|
+
};
|
|
80164
|
+
}
|
|
80165
|
+
async attributeSource(input) {
|
|
80166
|
+
const locator = this.ctx.taskLocator;
|
|
80167
|
+
if (locator === undefined)
|
|
80168
|
+
return { summary: null, error: null };
|
|
80169
|
+
try {
|
|
80170
|
+
const db2 = await this.ctx.getDb();
|
|
80171
|
+
const sessionIds = await listAttributionSessions(db2, input.source, {
|
|
80172
|
+
scope: input.mode === "all" ? "all" : "changed",
|
|
80173
|
+
changedSince: input.changedSince
|
|
80174
|
+
});
|
|
80175
|
+
const summary = await attributeSessions({
|
|
80176
|
+
db: db2,
|
|
80177
|
+
source: input.source,
|
|
80178
|
+
sessionIds,
|
|
80179
|
+
isKnownWbs: async (wbs) => await locator.findByWbs(wbs) !== null,
|
|
80180
|
+
resolvedAt: new Date().toISOString(),
|
|
80181
|
+
dryRun: input.dryRun,
|
|
80182
|
+
reconcile: input.mode === "all" && !input.dryRun
|
|
80183
|
+
});
|
|
80184
|
+
return { summary, error: null };
|
|
80185
|
+
} catch (e) {
|
|
80186
|
+
return { summary: null, error: e.message };
|
|
80187
|
+
}
|
|
80188
|
+
}
|
|
80189
|
+
async resetHistory() {
|
|
80190
|
+
const db2 = await this.ctx.getDb();
|
|
80191
|
+
return resetHistoryTables(db2);
|
|
79266
80192
|
}
|
|
79267
80193
|
async analyze(selector, opts = {}) {
|
|
79268
80194
|
const top = opts.top ?? 20;
|
|
@@ -79394,16 +80320,30 @@ class HistoryService {
|
|
|
79394
80320
|
}
|
|
79395
80321
|
async importAll(opts = {}) {
|
|
79396
80322
|
const sources = (opts.sources ?? SOURCES).map((s3) => parseSource(s3));
|
|
80323
|
+
assertPiImporterSafe({
|
|
80324
|
+
importerVersion: this.ctx.importerVersion,
|
|
80325
|
+
mode: opts.mode ?? (opts.file !== undefined && opts.file.length > 0 ? "force-file" : "incremental"),
|
|
80326
|
+
dryRun: opts.dryRun === true,
|
|
80327
|
+
sources
|
|
80328
|
+
});
|
|
79397
80329
|
const timeoutMs = opts.sourceTimeout ?? DEFAULT_SOURCE_TIMEOUT_MS;
|
|
79398
80330
|
const entries = [];
|
|
79399
80331
|
const warnings = [];
|
|
80332
|
+
const attribution2 = emptyAttributionSummary();
|
|
79400
80333
|
const runStartedAt = new Date().toISOString();
|
|
79401
80334
|
for (const source of sources) {
|
|
79402
|
-
const { coverageEntry, sourceWarnings } = await this.importOneIsolated(source, opts, timeoutMs, runStartedAt);
|
|
80335
|
+
const { coverageEntry, sourceWarnings, sourceAttribution } = await this.importOneIsolated(source, opts, timeoutMs, runStartedAt);
|
|
79403
80336
|
entries.push(coverageEntry);
|
|
79404
80337
|
warnings.push(...sourceWarnings);
|
|
80338
|
+
if (sourceAttribution !== null) {
|
|
80339
|
+
attribution2.sessionsEvaluated += sourceAttribution.sessionsEvaluated;
|
|
80340
|
+
attribution2.linksCreated += sourceAttribution.linksCreated;
|
|
80341
|
+
attribution2.linksAlreadyPresent += sourceAttribution.linksAlreadyPresent;
|
|
80342
|
+
attribution2.skippedEvidence += sourceAttribution.skippedEvidence;
|
|
80343
|
+
attribution2.ambiguousEvidence += sourceAttribution.ambiguousEvidence;
|
|
80344
|
+
}
|
|
79405
80345
|
}
|
|
79406
|
-
return { entries, exitCode: computeExitCode(entries), warnings };
|
|
80346
|
+
return { entries, exitCode: computeExitCode(entries), warnings, attribution: attribution2 };
|
|
79407
80347
|
}
|
|
79408
80348
|
async daily(opts = {}) {
|
|
79409
80349
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -79478,6 +80418,13 @@ class HistoryService {
|
|
|
79478
80418
|
detail: `source '${source}' previously had checkpoint rows but discovered 0 files`
|
|
79479
80419
|
});
|
|
79480
80420
|
}
|
|
80421
|
+
if (result.attributionError != null) {
|
|
80422
|
+
sourceWarnings.push({
|
|
80423
|
+
code: "attribution-failed",
|
|
80424
|
+
source,
|
|
80425
|
+
detail: `task attribution failed: ${result.attributionError}`
|
|
80426
|
+
});
|
|
80427
|
+
}
|
|
79481
80428
|
const toolCalls = opts.dryRun ? 0 : await countToolCallsSince(db2, source, runStartedAt);
|
|
79482
80429
|
const coverageEntry = {
|
|
79483
80430
|
source,
|
|
@@ -79493,7 +80440,7 @@ class HistoryService {
|
|
|
79493
80440
|
validationErrorSamples: result.validationErrors.slice(0, MAX_ERROR_SAMPLES2).map(formatIssue),
|
|
79494
80441
|
...result.reconciliation ? { reconciliation: result.reconciliation } : {}
|
|
79495
80442
|
};
|
|
79496
|
-
return { coverageEntry, sourceWarnings };
|
|
80443
|
+
return { coverageEntry, sourceWarnings, sourceAttribution: result.attribution ?? null };
|
|
79497
80444
|
} catch (e) {
|
|
79498
80445
|
const detail = e.message;
|
|
79499
80446
|
sourceWarnings.push({ code: "source-failed", source, detail });
|
|
@@ -79511,7 +80458,8 @@ class HistoryService {
|
|
|
79511
80458
|
parseErrorSamples: [],
|
|
79512
80459
|
validationErrorSamples: []
|
|
79513
80460
|
},
|
|
79514
|
-
sourceWarnings
|
|
80461
|
+
sourceWarnings,
|
|
80462
|
+
sourceAttribution: null
|
|
79515
80463
|
};
|
|
79516
80464
|
}
|
|
79517
80465
|
}
|
|
@@ -79799,13 +80747,25 @@ function pruneReports(cwd, retentionDays = REPORT_RETENTION_DAYS, now2 = new Dat
|
|
|
79799
80747
|
}
|
|
79800
80748
|
return pruned.sort((a2, b) => a2.localeCompare(b));
|
|
79801
80749
|
}
|
|
79802
|
-
var SOURCES, FULL_FIDELITY_SOURCES, DEFERRED_SOURCES, MODES, MAX_ERROR_SAMPLES2 = 20, DEFAULT_SOURCE_TIMEOUT_MS = 600000, REPORT_RETENTION_DAYS = 90;
|
|
80750
|
+
var MIN_SAFE_PI_BASH_IMPORTER_VERSION = "0.4.49", UnsafeHistoryImporterError, SOURCES, FULL_FIDELITY_SOURCES, DEFERRED_SOURCES, MODES, MAX_ERROR_SAMPLES2 = 20, DEFAULT_SOURCE_TIMEOUT_MS = 600000, REPORT_RETENTION_DAYS = 90;
|
|
79803
80751
|
var init_history_service = __esm(() => {
|
|
79804
80752
|
init_src2();
|
|
79805
80753
|
init_dist8();
|
|
79806
80754
|
init_agent_service();
|
|
79807
80755
|
init_history_analysis_service();
|
|
80756
|
+
init_task_attribution2();
|
|
79808
80757
|
init_verified_outcome();
|
|
80758
|
+
UnsafeHistoryImporterError = class UnsafeHistoryImporterError extends Error {
|
|
80759
|
+
installedVersion;
|
|
80760
|
+
minSafeVersion;
|
|
80761
|
+
code = "unsafe-history-importer";
|
|
80762
|
+
constructor(message, installedVersion, minSafeVersion = MIN_SAFE_PI_BASH_IMPORTER_VERSION) {
|
|
80763
|
+
super(message);
|
|
80764
|
+
this.installedVersion = installedVersion;
|
|
80765
|
+
this.minSafeVersion = minSafeVersion;
|
|
80766
|
+
this.name = "UnsafeHistoryImporterError";
|
|
80767
|
+
}
|
|
80768
|
+
};
|
|
79809
80769
|
SOURCES = [
|
|
79810
80770
|
"pi",
|
|
79811
80771
|
"claude",
|
|
@@ -83371,7 +84331,7 @@ function deriveVerdict(answerText, taskCheckPassed) {
|
|
|
83371
84331
|
const requirements = extractRequirements(answerText);
|
|
83372
84332
|
const parsedAc = extractAcceptanceCriteria(answerText);
|
|
83373
84333
|
const acceptanceCriteria = applyAcceptanceCriteriaEvidenceRule(parsedAc.rows);
|
|
83374
|
-
const checks4 = extractChecks(answerText, taskCheckPassed, acceptanceCriteria, parsedAc.dropped);
|
|
84334
|
+
const checks4 = extractChecks(answerText, taskCheckPassed, requirements, acceptanceCriteria, parsedAc.dropped);
|
|
83375
84335
|
if (requirements.length === 0) {
|
|
83376
84336
|
return { verdict: "UNKNOWN", requirements, acceptanceCriteria, checks: checks4 };
|
|
83377
84337
|
}
|
|
@@ -83478,16 +84438,17 @@ function extractAcceptanceCriteria(text4) {
|
|
|
83478
84438
|
}
|
|
83479
84439
|
if (/^[-:]+$/.test(cells[0] ?? ""))
|
|
83480
84440
|
continue;
|
|
83481
|
-
if (inTable && cells.length >=
|
|
84441
|
+
if (inTable && cells.length >= 3) {
|
|
83482
84442
|
const id = cells[0] ?? "";
|
|
83483
84443
|
const statusRaw = cells[1] ?? "";
|
|
83484
84444
|
const evidenceTypeRaw = cells[2] ?? "";
|
|
83485
84445
|
const status = normalizeAcceptanceCriteriaStatus(statusRaw);
|
|
83486
84446
|
const evidenceType = normalizeEvidenceType(evidenceTypeRaw);
|
|
84447
|
+
const acShaped = cells.length >= 4 || id.length > 0 && status !== null;
|
|
83487
84448
|
const evidence = cells[3] ?? "";
|
|
83488
|
-
if (status !== null && evidenceType !== null && id.length > 0) {
|
|
84449
|
+
if (acShaped && status !== null && evidenceType !== null && id.length > 0) {
|
|
83489
84450
|
rows.push({ id, status, evidenceType, evidence });
|
|
83490
|
-
} else if (id.length > 0) {
|
|
84451
|
+
} else if (acShaped && id.length > 0) {
|
|
83491
84452
|
dropped.push(evidenceType === null && status !== null ? `${id} (unrecognised evidence type "${evidenceTypeRaw}")` : `${id} (unrecognised status "${statusRaw}")`);
|
|
83492
84453
|
}
|
|
83493
84454
|
}
|
|
@@ -83547,7 +84508,7 @@ function requiresExecutableEvidence(id) {
|
|
|
83547
84508
|
const nonBehavior = normalized.includes("[non-behavior]") || normalized.includes("[docs-only]") || normalized.includes("[doc-only]");
|
|
83548
84509
|
return !nonCore && !nonBehavior;
|
|
83549
84510
|
}
|
|
83550
|
-
function extractChecks(_text, taskCheckPassed, acceptanceCriteria, droppedAcRows = []) {
|
|
84511
|
+
function extractChecks(_text, taskCheckPassed, requirements, acceptanceCriteria, droppedAcRows = []) {
|
|
83551
84512
|
const checks4 = [
|
|
83552
84513
|
{
|
|
83553
84514
|
name: "spur task check",
|
|
@@ -83586,6 +84547,18 @@ function extractChecks(_text, taskCheckPassed, acceptanceCriteria, droppedAcRows
|
|
|
83586
84547
|
evidence: `${droppedAcRows.length} AC row(s) could not be parsed and were omitted from the verdict: ` + `${droppedAcRows.join("; ")}. Accepted evidence types: test, command, static-ref (aliases: ` + "static, doc, docs, documentation), manual-review, llm-judge, n/a. Accepted statuses: " + "MET, PARTIAL, UNMET, N/A."
|
|
83587
84548
|
});
|
|
83588
84549
|
}
|
|
84550
|
+
const hollowMet = [
|
|
84551
|
+
...requirements.filter((r) => r.status === "MET" && r.evidence.trim() === "").map((r) => r.id),
|
|
84552
|
+
...acceptanceCriteria.filter((r) => r.status === "MET" && r.evidence.trim() === "").map((r) => r.id)
|
|
84553
|
+
];
|
|
84554
|
+
if (hollowMet.length > 0) {
|
|
84555
|
+
checks4.push({
|
|
84556
|
+
name: "hollow-met-evidence",
|
|
84557
|
+
status: "fail",
|
|
84558
|
+
severity: "major",
|
|
84559
|
+
evidence: `${hollowMet.length} MET row(s) carry no recorded evidence and cannot support PASS: ` + `${hollowMet.join(", ")}. Re-run verify with populated evidence per row.`
|
|
84560
|
+
});
|
|
84561
|
+
}
|
|
83589
84562
|
if (acceptanceCriteria.length > 0) {
|
|
83590
84563
|
const downgraded = acceptanceCriteria.filter((row) => row.status === "PARTIAL" && requiresExecutableEvidence(row.id) && row.evidenceType !== "test" && row.evidenceType !== "command");
|
|
83591
84564
|
checks4.push({
|
|
@@ -88764,7 +89737,6 @@ async function projectWorkflowProgress(runId, options) {
|
|
|
88764
89737
|
if (!currentState) {
|
|
88765
89738
|
currentState = normalizedStatus === "pending" || normalizedStatus === "running" ? initialState : null;
|
|
88766
89739
|
}
|
|
88767
|
-
const baselineWorkflow = options.baseline?.workflows[smDef.name || workflowName];
|
|
88768
89740
|
const stateVisits = [];
|
|
88769
89741
|
const visitCounter = {};
|
|
88770
89742
|
const recordVisit = (stateId) => {
|
|
@@ -88831,9 +89803,8 @@ async function projectWorkflowProgress(runId, options) {
|
|
|
88831
89803
|
for (const item of defActionList) {
|
|
88832
89804
|
const actionKey = `${stateId}:${item.type}:${item.idx}`;
|
|
88833
89805
|
const kind = item.action.kind;
|
|
88834
|
-
const
|
|
88835
|
-
const
|
|
88836
|
-
const evidenceEffect = baselineAction?.evidenceEffect ?? "none";
|
|
89806
|
+
const stateEffect = "may-write";
|
|
89807
|
+
const evidenceEffect = "none";
|
|
88837
89808
|
const candidateRows = stateActionRows.filter((r) => r.kind === kind && !usedActionRowIds.has(r.id));
|
|
88838
89809
|
let actionStatus = "pending";
|
|
88839
89810
|
const attempts = [];
|
|
@@ -89091,6 +90062,7 @@ __export(exports_src2, {
|
|
|
89091
90062
|
parseSteeringPolicy: () => parseSteeringPolicy,
|
|
89092
90063
|
parsePsOutput: () => parsePsOutput,
|
|
89093
90064
|
parseLedgerLine: () => parseLedgerLine,
|
|
90065
|
+
parseImporterVersion: () => parseImporterVersion,
|
|
89094
90066
|
parseHistoryRefreshContext: () => parseHistoryRefreshContext,
|
|
89095
90067
|
parseEtimeToSeconds: () => parseEtimeToSeconds,
|
|
89096
90068
|
normalizeSystemEventPayload: () => normalizeSystemEventPayload,
|
|
@@ -89156,6 +90128,8 @@ __export(exports_src2, {
|
|
|
89156
90128
|
buildEscalationPacket: () => buildEscalationPacket,
|
|
89157
90129
|
bridgeEventBus: () => bridgeEventBus,
|
|
89158
90130
|
baselineSeverity: () => baselineSeverity,
|
|
90131
|
+
attributeSessions: () => attributeSessions,
|
|
90132
|
+
assertPiImporterSafe: () => assertPiImporterSafe,
|
|
89159
90133
|
anchorQualify: () => anchorQualify,
|
|
89160
90134
|
aggregateBatchVerdicts: () => aggregateBatchVerdicts,
|
|
89161
90135
|
_resetAgentServiceShimsForTest: () => _resetAgentServiceShimsForTest,
|
|
@@ -89166,6 +90140,7 @@ __export(exports_src2, {
|
|
|
89166
90140
|
WbsCollisionError: () => WbsCollisionError,
|
|
89167
90141
|
WaitError: () => WaitError,
|
|
89168
90142
|
UnsupportedProcessPlatformError: () => UnsupportedProcessPlatformError,
|
|
90143
|
+
UnsafeHistoryImporterError: () => UnsafeHistoryImporterError,
|
|
89169
90144
|
TokenLedgerWatcher: () => TokenLedgerWatcher,
|
|
89170
90145
|
TokenLedgerService: () => TokenLedgerService,
|
|
89171
90146
|
TeamService: () => TeamService,
|
|
@@ -89212,6 +90187,7 @@ __export(exports_src2, {
|
|
|
89212
90187
|
PLANNING_EVENT_NAMES: () => PLANNING_EVENT_NAMES,
|
|
89213
90188
|
ObservableWorkflowAdapter: () => ObservableWorkflowAdapter,
|
|
89214
90189
|
MockHistoryBoardService: () => MockHistoryBoardService,
|
|
90190
|
+
MIN_SAFE_PI_BASH_IMPORTER_VERSION: () => MIN_SAFE_PI_BASH_IMPORTER_VERSION,
|
|
89215
90191
|
LockTimeoutError: () => LockTimeoutError,
|
|
89216
90192
|
LiveHistoryBoardService: () => LiveHistoryBoardService,
|
|
89217
90193
|
LifecycleAdapter: () => LifecycleAdapter,
|
|
@@ -89291,6 +90267,7 @@ var init_src3 = __esm(async () => {
|
|
|
89291
90267
|
init_system_event_follow();
|
|
89292
90268
|
init_system_event_retention();
|
|
89293
90269
|
init_system_event_tap();
|
|
90270
|
+
init_task_attribution2();
|
|
89294
90271
|
init_task_check();
|
|
89295
90272
|
init_task_locator();
|
|
89296
90273
|
init_task_record();
|
|
@@ -89399,19 +90376,19 @@ var {
|
|
|
89399
90376
|
// src/index.ts
|
|
89400
90377
|
init_loader();
|
|
89401
90378
|
|
|
89402
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90379
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
89403
90380
|
init_dist4();
|
|
89404
90381
|
init_dist5();
|
|
89405
90382
|
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
|
|
89406
90383
|
import { dirname as dirname5 } from "path";
|
|
89407
90384
|
|
|
89408
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90385
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
89409
90386
|
init_default_observers();
|
|
89410
90387
|
init_event_bus();
|
|
89411
90388
|
init_file_observer();
|
|
89412
90389
|
init_logger3();
|
|
89413
90390
|
|
|
89414
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90391
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
|
|
89415
90392
|
class NoopSchedulerAdapter {
|
|
89416
90393
|
constructor() {}
|
|
89417
90394
|
register(_cron, _action) {}
|
|
@@ -89419,7 +90396,7 @@ class NoopSchedulerAdapter {
|
|
|
89419
90396
|
async stop() {}
|
|
89420
90397
|
}
|
|
89421
90398
|
|
|
89422
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90399
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
|
|
89423
90400
|
function initScheduler(adapter, cronEntries) {
|
|
89424
90401
|
const resolved = adapter ?? new NoopSchedulerAdapter;
|
|
89425
90402
|
if (cronEntries) {
|
|
@@ -89430,7 +90407,7 @@ function initScheduler(adapter, cronEntries) {
|
|
|
89430
90407
|
return resolved;
|
|
89431
90408
|
}
|
|
89432
90409
|
|
|
89433
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90410
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
|
|
89434
90411
|
init_logger3();
|
|
89435
90412
|
init_metrics();
|
|
89436
90413
|
init_sdk();
|
|
@@ -89523,7 +90500,7 @@ function dbPlugin(db2) {
|
|
|
89523
90500
|
};
|
|
89524
90501
|
}
|
|
89525
90502
|
|
|
89526
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90503
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
|
|
89527
90504
|
init_logger3();
|
|
89528
90505
|
|
|
89529
90506
|
class PluginHost {
|
|
@@ -89611,7 +90588,7 @@ class PluginHost {
|
|
|
89611
90588
|
}
|
|
89612
90589
|
}
|
|
89613
90590
|
|
|
89614
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90591
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
89615
90592
|
async function performShutdown(state, reason) {
|
|
89616
90593
|
if (state.stopped)
|
|
89617
90594
|
return;
|
|
@@ -89722,10 +90699,10 @@ async function runApplication(options) {
|
|
|
89722
90699
|
}
|
|
89723
90700
|
}
|
|
89724
90701
|
|
|
89725
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90702
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
89726
90703
|
init_scheduler_node();
|
|
89727
90704
|
|
|
89728
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90705
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
89729
90706
|
var import_api14 = __toESM(require_src(), 1);
|
|
89730
90707
|
|
|
89731
90708
|
// ../../node_modules/.bun/@opentelemetry+exporter-metrics-otlp-http@0.218.0+e40b0dfdd726a224/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/esm/OTLPMetricExporterBase.js
|
|
@@ -92741,7 +93718,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
|
|
|
92741
93718
|
}), JsonTraceSerializer));
|
|
92742
93719
|
}
|
|
92743
93720
|
}
|
|
92744
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
93721
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
92745
93722
|
var import_resources2 = __toESM(require_src4(), 1);
|
|
92746
93723
|
var import_sdk_trace_node = __toESM(require_src8(), 1);
|
|
92747
93724
|
var import_semantic_conventions = __toESM(require_src2(), 1);
|
|
@@ -92792,7 +93769,7 @@ async function shutdownNodeTelemetry() {
|
|
|
92792
93769
|
await Promise.all(pending);
|
|
92793
93770
|
}
|
|
92794
93771
|
|
|
92795
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
93772
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.50+9eb4261f6cde6fd4/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
92796
93773
|
class ConfigValidationError extends Error {
|
|
92797
93774
|
constructor(message) {
|
|
92798
93775
|
super(message);
|
|
@@ -98227,7 +99204,7 @@ import { createRequire } from "module";
|
|
|
98227
99204
|
var CLI_CONFIG = {
|
|
98228
99205
|
binaryName: "spur",
|
|
98229
99206
|
binaryLabel: "spur",
|
|
98230
|
-
binaryVersion: "0.3.
|
|
99207
|
+
binaryVersion: "0.3.71",
|
|
98231
99208
|
configDir: ".spur",
|
|
98232
99209
|
configFile: ".spur/config.yaml",
|
|
98233
99210
|
databaseFile: ".spur/spur.db"
|
|
@@ -98264,10 +99241,12 @@ function registerHistoryCommand(program2, context4) {
|
|
|
98264
99241
|
} catch {
|
|
98265
99242
|
taskLocator = undefined;
|
|
98266
99243
|
}
|
|
99244
|
+
const provenance = await resolveImportProvenance(context4.fs);
|
|
98267
99245
|
return new HistoryService({
|
|
98268
99246
|
getDb: () => context4.getDb(),
|
|
98269
99247
|
agentConfig: context4.agentConfig,
|
|
98270
99248
|
...taskLocator ? { taskLocator } : {},
|
|
99249
|
+
importerVersion: provenance.importer,
|
|
98271
99250
|
fs: context4.fs,
|
|
98272
99251
|
cwd: context4.cwd
|
|
98273
99252
|
});
|
|
@@ -98311,14 +99290,36 @@ function registerHistoryCommand(program2, context4) {
|
|
|
98311
99290
|
return;
|
|
98312
99291
|
}
|
|
98313
99292
|
const svc = await makeService2();
|
|
98314
|
-
|
|
98315
|
-
|
|
98316
|
-
|
|
98317
|
-
|
|
98318
|
-
|
|
98319
|
-
|
|
98320
|
-
|
|
98321
|
-
|
|
99293
|
+
let fanOut;
|
|
99294
|
+
try {
|
|
99295
|
+
fanOut = await svc.importAll({
|
|
99296
|
+
sources: source === "all" ? undefined : [source],
|
|
99297
|
+
file: options.file || undefined,
|
|
99298
|
+
root: options.root || undefined,
|
|
99299
|
+
mode,
|
|
99300
|
+
dryRun: options.dryRun === true,
|
|
99301
|
+
sourceTimeout
|
|
99302
|
+
});
|
|
99303
|
+
} catch (e) {
|
|
99304
|
+
if (e instanceof UnsafeHistoryImporterError) {
|
|
99305
|
+
const msg = `spur history import: ${e.code}: ${e.message}`;
|
|
99306
|
+
context4.output.write(options.json ? toEnvelopeJson({ status: "error", message: msg }, {
|
|
99307
|
+
enveloped: options.jsonEnvelope,
|
|
99308
|
+
error: {
|
|
99309
|
+
code: "INTERNAL_ERROR",
|
|
99310
|
+
message: msg,
|
|
99311
|
+
details: {
|
|
99312
|
+
cliCode: e.code,
|
|
99313
|
+
installedVersion: e.installedVersion,
|
|
99314
|
+
minSafeVersion: e.minSafeVersion
|
|
99315
|
+
}
|
|
99316
|
+
}
|
|
99317
|
+
}) : msg);
|
|
99318
|
+
context4.setExitCode(1);
|
|
99319
|
+
return;
|
|
99320
|
+
}
|
|
99321
|
+
throw e;
|
|
99322
|
+
}
|
|
98322
99323
|
const provenance = await resolveImportProvenance(context4.fs);
|
|
98323
99324
|
context4.output.write(options.json ? toEnvelopeJson({ ...fanOut, provenance }, { enveloped: options.jsonEnvelope }) : `${formatProvenance(provenance)}
|
|
98324
99325
|
${formatFanOutResult(fanOut)}`);
|
|
@@ -98348,6 +99349,29 @@ ${formatFanOutResult(fanOut)}`);
|
|
|
98348
99349
|
daily: artifact.daily
|
|
98349
99350
|
}));
|
|
98350
99351
|
});
|
|
99352
|
+
noun.command("reset").description("Destructively wipe every history_* table: normalized rows, per-source ETL, board rollups, " + "daily stats, and importer checkpoints/ledger. Requires --yes. Task corpus and run " + "provenance (task_run_links) are untouched; a full `spur history import` rebuilds everything.").option("--yes", "Confirm the destructive wipe", false).option(...SHARED_OPTIONS.jsonSupported).option(...SHARED_OPTIONS.jsonEnvelope).action(async (options) => {
|
|
99353
|
+
if (!options.yes) {
|
|
99354
|
+
context4.output.write(options.json ? toEnvelopeJson({ status: "error", message: "Refusing to wipe history tables without --yes." }, {
|
|
99355
|
+
enveloped: options.jsonEnvelope,
|
|
99356
|
+
error: {
|
|
99357
|
+
code: "INTERNAL_ERROR",
|
|
99358
|
+
message: "Refusing to wipe history tables without --yes.",
|
|
99359
|
+
details: { cliCode: "usage" }
|
|
99360
|
+
}
|
|
99361
|
+
}) : "spur history reset: refusing to wipe history tables without --yes.");
|
|
99362
|
+
context4.setExitCode(1);
|
|
99363
|
+
return;
|
|
99364
|
+
}
|
|
99365
|
+
const svc = await makeService2();
|
|
99366
|
+
const result = await svc.resetHistory();
|
|
99367
|
+
const note = result.unknown.length > 0 ? ` WARNING: ${result.unknown.length} unlisted history_* table(s) left intact: ${result.unknown.join(", ")}` : "";
|
|
99368
|
+
context4.output.write(options.json ? toEnvelopeJson({
|
|
99369
|
+
cleared: result.cleared,
|
|
99370
|
+
skipped: result.skipped,
|
|
99371
|
+
unknown: result.unknown,
|
|
99372
|
+
clearedCount: result.cleared.length
|
|
99373
|
+
}, { enveloped: options.jsonEnvelope }) : `cleared ${result.cleared.length} history tables` + (result.skipped.length > 0 ? ` (${result.skipped.length} not present)` : "") + note);
|
|
99374
|
+
});
|
|
98351
99375
|
noun.command("report").description("Render a previously-generated history artifact as a spend + forensic report. " + "Never opens the database \u2014 pure renderer of the analyze JSON. " + "--task / --top narrow the already-loaded artifact client-side (0564 R3).").argument("[path]", "Artifact JSON path (defaults to the latest.json pointer)").option(...SHARED_OPTIONS.jsonParsedArtifact).option(...SHARED_OPTIONS.jsonEnvelope).option("--mode <name>", "Report mode: default | forensics (registry-resolved; unknown names fail)").option("--task <wbs>", "Narrow to a single task WBS the artifact was analyzed with").option("--top <n>", "Leaderboard depth for byTool/bySession (re-slices the artifact)").action(async (pathArg, options) => {
|
|
98352
99376
|
try {
|
|
98353
99377
|
const top = parseTopOrThrow(options.top);
|
|
@@ -98522,6 +99546,8 @@ function formatFanOutResult(r) {
|
|
|
98522
99546
|
for (const e of r.entries) {
|
|
98523
99547
|
lines.push(` ${e.source}: ${e.status} (files=${e.files} scanned, new-messages=${e.messages}, tool-calls=${e.toolCalls})`);
|
|
98524
99548
|
}
|
|
99549
|
+
const a2 = r.attribution;
|
|
99550
|
+
lines.push(`attribution: sessions=${a2.sessionsEvaluated} links-created=${a2.linksCreated} ` + `links-present=${a2.linksAlreadyPresent} skipped=${a2.skippedEvidence} ambiguous=${a2.ambiguousEvidence}`);
|
|
98525
99551
|
if (r.warnings.length > 0) {
|
|
98526
99552
|
lines.push("warnings:");
|
|
98527
99553
|
for (const w of r.warnings) {
|
|
@@ -98544,6 +99570,8 @@ function formatDailyResult(r) {
|
|
|
98544
99570
|
lines.push(` [${w.code}] ${w.source ?? "-"}: ${w.detail}`);
|
|
98545
99571
|
}
|
|
98546
99572
|
}
|
|
99573
|
+
const a2 = r.fanOut.attribution;
|
|
99574
|
+
lines.push(`attribution: sessions=${a2.sessionsEvaluated} links-created=${a2.linksCreated} ` + `links-present=${a2.linksAlreadyPresent} skipped=${a2.skippedEvidence} ambiguous=${a2.ambiguousEvidence}`);
|
|
98547
99575
|
lines.push(`artifact totals: messages=${r.artifact.totals.messages} toolCalls=${r.artifact.totals.toolCalls}`);
|
|
98548
99576
|
lines.push(`coverage: refreshed=[${r.coverage.refreshed.join(", ")}] skipped=[${r.coverage.skipped.join(", ")}] ` + `window=${r.coverage.window.since ?? "\u2026"} \u2192 ${r.coverage.window.until ?? "\u2026"}`);
|
|
98549
99577
|
if (r.reportPath !== undefined) {
|
|
@@ -105595,11 +106623,11 @@ var featureContract = {
|
|
|
105595
106623
|
|
|
105596
106624
|
// ../../packages/contracts/src/history.ts
|
|
105597
106625
|
init_zod();
|
|
105598
|
-
var historyRangeEnum = exports_external.enum(["24h", "7d", "30d", "all", "custom"]);
|
|
106626
|
+
var historyRangeEnum = exports_external.enum(["1h", "4h", "24h", "7d", "30d", "all", "custom"]);
|
|
105599
106627
|
var historyBucketEnum = exports_external.enum(["auto", "5m", "10m", "30m", "1h", "4h", "1d"]);
|
|
105600
106628
|
var historyDimensionEnum = exports_external.enum(["model", "source", "tool", "skill"]);
|
|
105601
106629
|
var historyFilterSchema = exports_external.object({
|
|
105602
|
-
range: historyRangeEnum.default("
|
|
106630
|
+
range: historyRangeEnum.default("4h"),
|
|
105603
106631
|
from: exports_external.string().datetime().optional(),
|
|
105604
106632
|
to: exports_external.string().datetime().optional(),
|
|
105605
106633
|
sources: exports_external.array(exports_external.string()).optional(),
|
|
@@ -105671,7 +106699,10 @@ var historySummaryResponseDataSchema = exports_external.object({
|
|
|
105671
106699
|
cacheEfficiency: historyCacheEfficiencySchema,
|
|
105672
106700
|
kpiTrend: exports_external.array(historyKpiTrendPointSchema),
|
|
105673
106701
|
previousKpis: historySummaryKpisSchema.nullable(),
|
|
105674
|
-
skillTimeSeries: exports_external.array(historyTimeSeriesPointSchema)
|
|
106702
|
+
skillTimeSeries: exports_external.array(historyTimeSeriesPointSchema),
|
|
106703
|
+
modelTimeSeries: exports_external.array(historyTimeSeriesPointSchema).optional(),
|
|
106704
|
+
sourceTimeSeries: exports_external.array(historyTimeSeriesPointSchema).optional(),
|
|
106705
|
+
toolTimeSeries: exports_external.array(historyTimeSeriesPointSchema).optional()
|
|
105675
106706
|
});
|
|
105676
106707
|
var historySummaryResponseSchema = apiSuccessSchema(historySummaryResponseDataSchema);
|
|
105677
106708
|
var historyTimelineEventKindEnum = exports_external.enum([
|
|
@@ -105779,6 +106810,59 @@ var historySessionsInputSchema = exports_external.object({
|
|
|
105779
106810
|
sortBy: exports_external.enum(["start", "duration", "messages", "toolCalls", "billedTokens", "cacheRead", "freshInput"]).default("start"),
|
|
105780
106811
|
sortDir: exports_external.enum(["asc", "desc"]).default("desc")
|
|
105781
106812
|
});
|
|
106813
|
+
var historyToolCategoryEnum = exports_external.enum(["read", "write", "bash", "search", "mcp", "other"]);
|
|
106814
|
+
var historyToolStatusFilterEnum = exports_external.enum(["all", "ok", "error"]);
|
|
106815
|
+
var historyToolCallItemSchema = exports_external.object({
|
|
106816
|
+
seq: exports_external.number(),
|
|
106817
|
+
toolSeq: exports_external.number(),
|
|
106818
|
+
ts: exports_external.string().nullable(),
|
|
106819
|
+
toolName: exports_external.string(),
|
|
106820
|
+
category: historyToolCategoryEnum,
|
|
106821
|
+
status: exports_external.enum(["ok", "error", "unknown"]),
|
|
106822
|
+
durationMs: exports_external.number().nullable(),
|
|
106823
|
+
durationSource: historyDurationSourceEnum,
|
|
106824
|
+
resultBytes: exports_external.number().nullable(),
|
|
106825
|
+
argsRaw: exports_external.string().nullable(),
|
|
106826
|
+
argsDigest: exports_external.string().nullable(),
|
|
106827
|
+
errorText: exports_external.string().nullable(),
|
|
106828
|
+
callId: exports_external.string().nullable(),
|
|
106829
|
+
messageHash: exports_external.string(),
|
|
106830
|
+
sessionId: exports_external.string(),
|
|
106831
|
+
source: exports_external.string(),
|
|
106832
|
+
model: exports_external.string().nullable(),
|
|
106833
|
+
tokens: historyTokensSchema
|
|
106834
|
+
});
|
|
106835
|
+
var historyToolSequenceScopeSchema = exports_external.object({
|
|
106836
|
+
sessionId: exports_external.string().nullable(),
|
|
106837
|
+
source: exports_external.string().nullable(),
|
|
106838
|
+
model: exports_external.string().nullable(),
|
|
106839
|
+
start: exports_external.string().nullable(),
|
|
106840
|
+
end: exports_external.string().nullable(),
|
|
106841
|
+
totalCalls: exports_external.number(),
|
|
106842
|
+
uniqueTools: exports_external.number(),
|
|
106843
|
+
errorCount: exports_external.number(),
|
|
106844
|
+
errorRate: exports_external.number(),
|
|
106845
|
+
totalDurationMs: exports_external.number(),
|
|
106846
|
+
meanDurationMs: exports_external.number(),
|
|
106847
|
+
durationUnmeasured: exports_external.number(),
|
|
106848
|
+
sessionCount: exports_external.number(),
|
|
106849
|
+
tokens: historyTokensSchema
|
|
106850
|
+
});
|
|
106851
|
+
var historyToolSequenceInputSchema = exports_external.intersection(exports_external.discriminatedUnion("mode", [
|
|
106852
|
+
exports_external.object({ mode: exports_external.literal("session"), source: exports_external.string().min(1), sessionId: exports_external.string().min(1) }),
|
|
106853
|
+
exports_external.object({ mode: exports_external.literal("consolidated"), filter: historyFilterSchema.optional() })
|
|
106854
|
+
]), exports_external.object({
|
|
106855
|
+
toolNames: exports_external.array(exports_external.string()).optional(),
|
|
106856
|
+
status: historyToolStatusFilterEnum.default("all"),
|
|
106857
|
+
search: exports_external.string().optional()
|
|
106858
|
+
}));
|
|
106859
|
+
var historyToolSequenceResponseDataSchema = exports_external.object({
|
|
106860
|
+
mode: exports_external.enum(["session", "consolidated"]),
|
|
106861
|
+
scope: historyToolSequenceScopeSchema,
|
|
106862
|
+
truncated: exports_external.boolean(),
|
|
106863
|
+
items: exports_external.array(historyToolCallItemSchema)
|
|
106864
|
+
});
|
|
106865
|
+
var historyToolSequenceResponseSchema = apiSuccessSchema(historyToolSequenceResponseDataSchema);
|
|
105782
106866
|
var historyLoopFindingSchema = exports_external.object({
|
|
105783
106867
|
tool: exports_external.string(),
|
|
105784
106868
|
argsHint: exports_external.string(),
|
|
@@ -105895,6 +106979,12 @@ var historyContract = {
|
|
|
105895
106979
|
summary: "Get chronological session or consolidated execution timeline",
|
|
105896
106980
|
tags: ["history"]
|
|
105897
106981
|
}).input(historyTimelineInputSchema).output(historyTimelineResponseSchema),
|
|
106982
|
+
getToolSequence: oc.route({
|
|
106983
|
+
method: "POST",
|
|
106984
|
+
path: "/history/tool-sequence",
|
|
106985
|
+
summary: "Get ordered tool invocation sequence for a session or filtered scope",
|
|
106986
|
+
tags: ["history"]
|
|
106987
|
+
}).input(historyToolSequenceInputSchema).output(historyToolSequenceResponseSchema),
|
|
105898
106988
|
getSessions: oc.route({
|
|
105899
106989
|
method: "POST",
|
|
105900
106990
|
path: "/history/sessions",
|
|
@@ -106307,6 +107397,10 @@ function createHistoryHandlers(ctx) {
|
|
|
106307
107397
|
const data = await ctx.historyBoardService().getTimeline(input);
|
|
106308
107398
|
return { ok: true, data };
|
|
106309
107399
|
}),
|
|
107400
|
+
getToolSequence: os3.history.getToolSequence.handler(async ({ input }) => {
|
|
107401
|
+
const data = await ctx.historyBoardService().getToolSequence(input);
|
|
107402
|
+
return { ok: true, data };
|
|
107403
|
+
}),
|
|
106310
107404
|
getSessions: os3.history.getSessions.handler(async ({ input }) => {
|
|
106311
107405
|
const data = await ctx.historyBoardService().getSessions(input);
|
|
106312
107406
|
return { ok: true, data };
|