@gobing-ai/spur 0.3.69 → 0.3.70
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/task-pipeline.yaml +32 -3
- package/package.json +9 -9
- 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 +386 -0
- 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/spur-cli/references/history.md +1 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +16 -0
- package/spur.js +1262 -260
- package/web/_astro/BoardApp.DHj-03Dp.js +1 -0
- package/web/_astro/{BoardApp.BQFbkeqq.js → BoardApp.DOadeEJV.js} +77 -77
- package/web/_astro/{TaskDetail.Dl2Eaj1w.js → TaskDetail.DKzpkDj5.js} +1 -1
- package/web/_astro/{arc.uG14rp8A.js → arc.Bsa0gprH.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.Dye6uD_x.js → architectureDiagram-3BPJPVTR.LOUZCDBC.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.B9Pkh7Hb.js → blockDiagram-GPEHLZMM.CGee4isG.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.C2x7SC_X.js → c4Diagram-AAUBKEIU.B2CrQJ_O.js} +1 -1
- package/web/_astro/channel.BGL7KSHC.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.D2p4-nWk.js → chunk-2J33WTMH.DJvf8RiP.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.S-6jf33o.js → chunk-4BX2VUAB.B_l35O-Y.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.DVXj4Fdh.js → chunk-55IACEB6.DqbxMswU.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.Dz689FMN.js → chunk-727SXJPM.D_7ZGNjE.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.KxYj5TnI.js → chunk-AQP2D5EJ.Cq6yZ0s8.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.itTQyHQB.js → chunk-FMBD7UC4.BWrlUPYi.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.euSrbJf5.js → chunk-ND2GUHAM.BPLaXFZH.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.OWASJRQy.js → chunk-QZHKN3VN.BtmAEAwZ.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.BLvrlpNO.js → classDiagram-4FO5ZUOK.CWycT7Ia.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.BLvrlpNO.js → classDiagram-v2-Q7XG4LA2.CWycT7Ia.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.XBF-rmyD.js → cose-bilkent-S5V4N54A.DyxjSWon.js} +1 -1
- package/web/_astro/{cynefin-OW5HDTMX.DlCx762Z.js → cynefin-OW5HDTMX.DnNfLBpX.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.D17Rshxv.js → dagre-BM42HDAG.BFAvnjKD.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.AhBIVJC8.js → diagram-2AECGRRQ.BAoNCFeB.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.C9ximjyC.js → diagram-5GNKFQAL.DiiKe7BP.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.CZb7Ru_9.js → diagram-KO2AKTUF.t_uOQWVP.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.BW7LwqoS.js → diagram-LMA3HP47.SB9997cP.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.XC025W0V.js → diagram-OG6HWLK6.Bgsxgf5G.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.CpMXmBDP.js → erDiagram-TEJ5UH35.DO9OAOAc.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.D2ednJWg.js → flowDiagram-I6XJVG4X.CIb41ZyL.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.BjL9FGKO.js → ganttDiagram-6RSMTGT7.Dc8Lk0fV.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.B90g1VGk.js → gitGraphDiagram-PVQCEYII.CpPmMWrl.js} +1 -1
- package/web/_astro/index.C-t8kB0T.css +1 -0
- package/web/_astro/{infoDiagram-5YYISTIA.RqgycKtQ.js → infoDiagram-5YYISTIA.DxBXfQSf.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.Ctn-zt6a.js → ishikawaDiagram-YF4QCWOH.gA6OKtXq.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.DJhT8Ctp.js → journeyDiagram-JHISSGLW.CMEyLMmm.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.BY1QdejI.js → kanban-definition-UN3LZRKU.CKXlUNCr.js} +1 -1
- package/web/_astro/{linear.Di7YObSt.js → linear.CpTGdVx3.js} +1 -1
- package/web/_astro/{mermaid.core.CbxtJS3Q.js → mermaid.core.c8SSCsE5.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.CxvR4g_J.js → mindmap-definition-RKZ34NQL.BH59HDw6.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.jNWqnBHH.js → pieDiagram-4H26LBE5.DmgFXkZR.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.BCp12MbA.js → quadrantDiagram-W4KKPZXB.DyfB7N4J.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.Dxhm4TyR.js → requirementDiagram-4Y6WPE33.DosszoFo.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.BtQXp4J9.js → sankeyDiagram-5OEKKPKP.pBkHhvVN.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.BWEM1R_Q.js → sequenceDiagram-3UESZ5HK.BE8tmkNR.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.BG3wUkWB.js → stateDiagram-AJRCARHV.C4n7vDiG.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.BLtMeFVP.js → stateDiagram-v2-BHNVJYJU.BpgwYlRy.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.D5fHo0az.js → timeline-definition-PNZ67QCA.DvcVKc-W.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.0DcuMluU.js → vennDiagram-CIIHVFJN.BLOk-UOl.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.BZ-dxgHm.js → wardleyDiagram-YWT4CUSO.CIzB7M2o.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.Bg-XWF7z.js → xychartDiagram-2RQKCTM6.CGC_lZ19.js} +1 -1
- package/web/index.html +2 -2
- 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.49/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.49/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.49/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.49/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.49/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.49/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.49/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+bb68c2431f6fedc6/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+4d63c5444243fb3e/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+25494994f190a870/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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.49+8b32b93dff378592/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,6 +51545,67 @@ 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
|
|
@@ -52175,6 +52244,52 @@ var MESSAGE_DEDUP2 = `(m.rowid IN (
|
|
|
52175
52244
|
ELSE ''
|
|
52176
52245
|
END`, HISTORY_BOARD_ROLLUP_VERSION = 2;
|
|
52177
52246
|
|
|
52247
|
+
// ../../packages/domain/src/analytics/history-reset.ts
|
|
52248
|
+
async function resetHistoryTables(db2) {
|
|
52249
|
+
const rows = await db2.queryAll("SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE 'history\\_%' ESCAPE '\\'");
|
|
52250
|
+
const existing = new Set(rows.map((r) => r.name));
|
|
52251
|
+
const cleared = HISTORY_RESET_TABLES.filter((t) => existing.has(t));
|
|
52252
|
+
const skipped = HISTORY_RESET_TABLES.filter((t) => !existing.has(t));
|
|
52253
|
+
const known = new Set(HISTORY_RESET_TABLES);
|
|
52254
|
+
const unknown2 = rows.map((r) => r.name).filter((t) => !known.has(t));
|
|
52255
|
+
if (cleared.length > 0) {
|
|
52256
|
+
await db2.batch(cleared.map((table3) => ({ sql: `DELETE FROM "${table3}"`, params: [] })));
|
|
52257
|
+
}
|
|
52258
|
+
return { cleared, skipped, unknown: unknown2 };
|
|
52259
|
+
}
|
|
52260
|
+
var HISTORY_RESET_TABLES;
|
|
52261
|
+
var init_history_reset = __esm(() => {
|
|
52262
|
+
HISTORY_RESET_TABLES = [
|
|
52263
|
+
"history_message",
|
|
52264
|
+
"history_tool_call",
|
|
52265
|
+
"history_run_session",
|
|
52266
|
+
"history_task_session",
|
|
52267
|
+
"history_etl_agy",
|
|
52268
|
+
"history_etl_antigravity",
|
|
52269
|
+
"history_etl_claude",
|
|
52270
|
+
"history_etl_codex",
|
|
52271
|
+
"history_etl_gemini",
|
|
52272
|
+
"history_etl_grok",
|
|
52273
|
+
"history_etl_omp",
|
|
52274
|
+
"history_etl_openclaw",
|
|
52275
|
+
"history_etl_opencode",
|
|
52276
|
+
"history_etl_pi",
|
|
52277
|
+
"history_daily_stats",
|
|
52278
|
+
"history_board_loop_findings",
|
|
52279
|
+
"history_board_message_5m",
|
|
52280
|
+
"history_board_model_stats",
|
|
52281
|
+
"history_board_ranked_steps",
|
|
52282
|
+
"history_board_rollup_meta",
|
|
52283
|
+
"history_board_session_stats",
|
|
52284
|
+
"history_board_source_daily",
|
|
52285
|
+
"history_board_source_stats",
|
|
52286
|
+
"history_board_tool_5m",
|
|
52287
|
+
"history_board_tool_stats",
|
|
52288
|
+
"history_import_checkpoint",
|
|
52289
|
+
"history_import_ledger"
|
|
52290
|
+
];
|
|
52291
|
+
});
|
|
52292
|
+
|
|
52178
52293
|
// ../../packages/domain/src/analytics/narrow-artifact.ts
|
|
52179
52294
|
function narrowArtifact(artifact, opts, artifactPath) {
|
|
52180
52295
|
const parts = [];
|
|
@@ -53729,6 +53844,135 @@ var init_run_cost = __esm(() => {
|
|
|
53729
53844
|
init_costs();
|
|
53730
53845
|
});
|
|
53731
53846
|
|
|
53847
|
+
// ../../packages/domain/src/analytics/task-attribution.ts
|
|
53848
|
+
function evidenceRefOf(record2) {
|
|
53849
|
+
const base2 = record2.sourceFile.replaceAll("\\", "/").split("/").pop() ?? record2.sourceFile;
|
|
53850
|
+
return `${base2}#${record2.sourceLine}`.slice(0, EVIDENCE_REF_MAX);
|
|
53851
|
+
}
|
|
53852
|
+
function slashWbsSet(line) {
|
|
53853
|
+
return new Set(line.match(WBS_RE) ?? []);
|
|
53854
|
+
}
|
|
53855
|
+
function spurTaskWbsSet(text3) {
|
|
53856
|
+
const hits = new Set;
|
|
53857
|
+
for (const match of text3.matchAll(SPUR_TASK_RE))
|
|
53858
|
+
hits.add(match[1]);
|
|
53859
|
+
return hits;
|
|
53860
|
+
}
|
|
53861
|
+
function classifyTaskAttribution(records) {
|
|
53862
|
+
const decision = { candidates: [], skipped: 0, ambiguous: 0 };
|
|
53863
|
+
for (const record2 of records) {
|
|
53864
|
+
if (record2.kind === "user-message") {
|
|
53865
|
+
const slash = new Set;
|
|
53866
|
+
for (const line of record2.text.split(`
|
|
53867
|
+
`)) {
|
|
53868
|
+
if (!SLASH_COMMAND_RE.test(line))
|
|
53869
|
+
continue;
|
|
53870
|
+
for (const wbs of slashWbsSet(line))
|
|
53871
|
+
slash.add(wbs);
|
|
53872
|
+
}
|
|
53873
|
+
if (slash.size === 0) {
|
|
53874
|
+
if (PLAIN_MENTION_RE.test(record2.text))
|
|
53875
|
+
decision.skipped += 1;
|
|
53876
|
+
continue;
|
|
53877
|
+
}
|
|
53878
|
+
for (const wbs of slash) {
|
|
53879
|
+
decision.candidates.push({
|
|
53880
|
+
wbs,
|
|
53881
|
+
mechanism: "slash-command",
|
|
53882
|
+
evidenceKind: "user-command",
|
|
53883
|
+
evidenceRef: evidenceRefOf(record2)
|
|
53884
|
+
});
|
|
53885
|
+
}
|
|
53886
|
+
continue;
|
|
53887
|
+
}
|
|
53888
|
+
for (const wbs of spurTaskWbsSet(record2.text)) {
|
|
53889
|
+
decision.candidates.push({
|
|
53890
|
+
wbs,
|
|
53891
|
+
mechanism: "spur-cli",
|
|
53892
|
+
evidenceKind: "cli-tool",
|
|
53893
|
+
evidenceRef: evidenceRefOf(record2)
|
|
53894
|
+
});
|
|
53895
|
+
}
|
|
53896
|
+
}
|
|
53897
|
+
return decision;
|
|
53898
|
+
}
|
|
53899
|
+
async function listAttributionSessions(db2, source, opts) {
|
|
53900
|
+
const params = [source];
|
|
53901
|
+
let whereExtra = "";
|
|
53902
|
+
if (opts.scope === "changed") {
|
|
53903
|
+
whereExtra = " AND imported_at >= ?";
|
|
53904
|
+
params.push(opts.changedSince ?? "");
|
|
53905
|
+
}
|
|
53906
|
+
params.push(ATTRIBUTION_SESSION_LIMIT);
|
|
53907
|
+
try {
|
|
53908
|
+
const rows = await db2.queryAll(`SELECT DISTINCT session_id AS sessionId FROM history_message
|
|
53909
|
+
WHERE source = ? AND session_id NOT IN ('', 'unknown', 'session')${whereExtra}
|
|
53910
|
+
ORDER BY session_id
|
|
53911
|
+
LIMIT ?`, ...params);
|
|
53912
|
+
return rows.map((r) => r.sessionId);
|
|
53913
|
+
} catch (error51) {
|
|
53914
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_message"))
|
|
53915
|
+
return [];
|
|
53916
|
+
throw error51;
|
|
53917
|
+
}
|
|
53918
|
+
}
|
|
53919
|
+
async function loadAttributionEvidence(db2, source, sessionId) {
|
|
53920
|
+
try {
|
|
53921
|
+
const userRows = await db2.queryAll(`SELECT record_hash AS recordHash, source_file AS sourceFile, source_line AS sourceLine,
|
|
53922
|
+
content_text AS text
|
|
53923
|
+
FROM history_message
|
|
53924
|
+
WHERE source = ? AND session_id = ? AND role = 'user'
|
|
53925
|
+
AND (content_text LIKE '%/sp%' OR content_text LIKE '%spur task%')
|
|
53926
|
+
LIMIT ?`, source, sessionId, ATTRIBUTION_EVIDENCE_LIMIT);
|
|
53927
|
+
const toolRows = await db2.queryAll(`SELECT record_hash AS recordHash, source_file AS sourceFile, source_line AS sourceLine,
|
|
53928
|
+
args_raw AS text
|
|
53929
|
+
FROM history_tool_call
|
|
53930
|
+
WHERE source = ? AND session_id = ?
|
|
53931
|
+
AND (args_raw LIKE '%spur task%' OR args_raw LIKE '%index.ts task%')
|
|
53932
|
+
LIMIT ?`, source, sessionId, ATTRIBUTION_EVIDENCE_LIMIT);
|
|
53933
|
+
const evidence = [];
|
|
53934
|
+
for (const row of userRows) {
|
|
53935
|
+
if (row.text != null && row.text.length > 0) {
|
|
53936
|
+
evidence.push({
|
|
53937
|
+
kind: "user-message",
|
|
53938
|
+
text: row.text,
|
|
53939
|
+
recordHash: row.recordHash,
|
|
53940
|
+
sourceFile: row.sourceFile,
|
|
53941
|
+
sourceLine: row.sourceLine
|
|
53942
|
+
});
|
|
53943
|
+
}
|
|
53944
|
+
}
|
|
53945
|
+
for (const row of toolRows) {
|
|
53946
|
+
if (row.text != null && row.text.length > 0) {
|
|
53947
|
+
evidence.push({
|
|
53948
|
+
kind: "tool-call",
|
|
53949
|
+
text: row.text,
|
|
53950
|
+
recordHash: row.recordHash,
|
|
53951
|
+
sourceFile: row.sourceFile,
|
|
53952
|
+
sourceLine: row.sourceLine
|
|
53953
|
+
});
|
|
53954
|
+
}
|
|
53955
|
+
}
|
|
53956
|
+
return evidence;
|
|
53957
|
+
} catch (error51) {
|
|
53958
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_message"))
|
|
53959
|
+
return [];
|
|
53960
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_tool_call"))
|
|
53961
|
+
return [];
|
|
53962
|
+
throw error51;
|
|
53963
|
+
}
|
|
53964
|
+
}
|
|
53965
|
+
function emptyAttributionSummary() {
|
|
53966
|
+
return { sessionsEvaluated: 0, linksCreated: 0, linksAlreadyPresent: 0, skippedEvidence: 0, ambiguousEvidence: 0 };
|
|
53967
|
+
}
|
|
53968
|
+
var SLASH_COMMAND_RE, SPUR_TASK_RE, WBS_RE, PLAIN_MENTION_RE, EVIDENCE_REF_MAX = 200, ATTRIBUTION_SESSION_LIMIT = 5000, ATTRIBUTION_EVIDENCE_LIMIT = 500;
|
|
53969
|
+
var init_task_attribution = __esm(() => {
|
|
53970
|
+
SLASH_COMMAND_RE = /^[\s>]*\/sp[:_-]dev\S*/;
|
|
53971
|
+
SPUR_TASK_RE = /(?:^|[\s;&|(])(?:spur|apps\/cli\/src\/index\.ts)\s+task\s+\S+\s+(\d{4})(?![\w.\-/:%])/g;
|
|
53972
|
+
WBS_RE = /(?<![\w.\-/:%])\d{4}(?![\w.\-/:%])/g;
|
|
53973
|
+
PLAIN_MENTION_RE = /\b\d{4}\b/;
|
|
53974
|
+
});
|
|
53975
|
+
|
|
53732
53976
|
// ../../packages/domain/src/analytics/verified-outcome.ts
|
|
53733
53977
|
function deriveVerifiedOutcomeStat(inputs, window2) {
|
|
53734
53978
|
const byWbs = new Map;
|
|
@@ -53824,6 +54068,7 @@ var init_analytics = __esm(() => {
|
|
|
53824
54068
|
init_assistant_duration();
|
|
53825
54069
|
init_costs();
|
|
53826
54070
|
init_forensic_query();
|
|
54071
|
+
init_history_reset();
|
|
53827
54072
|
init_models();
|
|
53828
54073
|
init_narrow_artifact();
|
|
53829
54074
|
init_render_forensics();
|
|
@@ -53833,6 +54078,7 @@ var init_analytics = __esm(() => {
|
|
|
53833
54078
|
init_retro_correlation();
|
|
53834
54079
|
init_role_tokens();
|
|
53835
54080
|
init_run_cost();
|
|
54081
|
+
init_task_attribution();
|
|
53836
54082
|
init_watermark();
|
|
53837
54083
|
});
|
|
53838
54084
|
|
|
@@ -54551,7 +54797,7 @@ class ActionRunDao {
|
|
|
54551
54797
|
}
|
|
54552
54798
|
}
|
|
54553
54799
|
|
|
54554
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
54800
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.49+4d63c5444243fb3e/node_modules/@gobing-ai/ts-db/dist/schema/drizzle-internals.js
|
|
54555
54801
|
function sqlExpressionToText(value) {
|
|
54556
54802
|
if (typeof value !== "object" || value === null || !("queryChunks" in value)) {
|
|
54557
54803
|
return;
|
|
@@ -54574,7 +54820,7 @@ function getDrizzleTableName(table3) {
|
|
|
54574
54820
|
return String(table3[nameSym]);
|
|
54575
54821
|
}
|
|
54576
54822
|
|
|
54577
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
54823
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.49+4d63c5444243fb3e/node_modules/@gobing-ai/ts-db/dist/schema/ddl.js
|
|
54578
54824
|
function quoteIdent(name) {
|
|
54579
54825
|
return `"${name.replace(/"/g, '""')}"`;
|
|
54580
54826
|
}
|
|
@@ -54946,7 +55192,7 @@ var init_drizzle_zod = __esm(() => {
|
|
|
54946
55192
|
};
|
|
54947
55193
|
});
|
|
54948
55194
|
|
|
54949
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
55195
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.49+4d63c5444243fb3e/node_modules/@gobing-ai/ts-db/dist/schema/define-table.js
|
|
54950
55196
|
function defineTable(name, columns2) {
|
|
54951
55197
|
const table3 = sqliteTable(name, columns2);
|
|
54952
55198
|
let insert2;
|
|
@@ -54980,7 +55226,7 @@ var init_define_table = __esm(() => {
|
|
|
54980
55226
|
init_ddl();
|
|
54981
55227
|
});
|
|
54982
55228
|
|
|
54983
|
-
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.
|
|
55229
|
+
// ../../node_modules/.bun/@gobing-ai+ts-db@0.4.49+4d63c5444243fb3e/node_modules/@gobing-ai/ts-db/dist/schema/index.js
|
|
54984
55230
|
var exports_schema = {};
|
|
54985
55231
|
__export(exports_schema, {
|
|
54986
55232
|
text: () => text,
|
|
@@ -55488,6 +55734,59 @@ class TaskRunLinkDao {
|
|
|
55488
55734
|
}
|
|
55489
55735
|
}
|
|
55490
55736
|
|
|
55737
|
+
// ../../packages/domain/src/dao/task-session-dao.ts
|
|
55738
|
+
class TaskSessionDao {
|
|
55739
|
+
db;
|
|
55740
|
+
constructor(db2) {
|
|
55741
|
+
this.db = db2;
|
|
55742
|
+
}
|
|
55743
|
+
async insert(input) {
|
|
55744
|
+
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);
|
|
55745
|
+
if (existing != null) {
|
|
55746
|
+
if (input.exactness === "exact" && existing.exactness !== "exact") {
|
|
55747
|
+
await this.db.run(`UPDATE history_task_session
|
|
55748
|
+
SET exactness = ?, mechanism = ?, evidence_kind = ?, evidence_ref = ?, resolved_at = ?
|
|
55749
|
+
WHERE wbs = ? AND source = ? AND session_id = ?`, input.exactness, input.mechanism, input.evidenceKind, input.evidenceRef, input.resolvedAt, input.wbs, input.source, input.sessionId);
|
|
55750
|
+
return "created";
|
|
55751
|
+
}
|
|
55752
|
+
return "present";
|
|
55753
|
+
}
|
|
55754
|
+
await this.db.run(`INSERT INTO history_task_session (wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at)
|
|
55755
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, input.wbs, input.source, input.sessionId, input.exactness, input.mechanism, input.evidenceKind, input.evidenceRef, input.resolvedAt);
|
|
55756
|
+
return "created";
|
|
55757
|
+
}
|
|
55758
|
+
async hasLink(wbs, source, sessionId) {
|
|
55759
|
+
const row = await this.db.queryFirst(`SELECT COUNT(*) AS n FROM history_task_session WHERE wbs = ? AND source = ? AND session_id = ?`, wbs, source, sessionId);
|
|
55760
|
+
return (row?.n ?? 0) > 0;
|
|
55761
|
+
}
|
|
55762
|
+
async listByWbs(wbs) {
|
|
55763
|
+
try {
|
|
55764
|
+
return await this.db.queryAll(`SELECT wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at
|
|
55765
|
+
FROM history_task_session WHERE wbs = ? ORDER BY resolved_at, source, session_id`, wbs);
|
|
55766
|
+
} catch (error51) {
|
|
55767
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_task_session"))
|
|
55768
|
+
return [];
|
|
55769
|
+
throw error51;
|
|
55770
|
+
}
|
|
55771
|
+
}
|
|
55772
|
+
async listBySession(source, sessionId) {
|
|
55773
|
+
try {
|
|
55774
|
+
return await this.db.queryAll(`SELECT wbs, source, session_id, exactness, mechanism, evidence_kind, evidence_ref, resolved_at
|
|
55775
|
+
FROM history_task_session WHERE source = ? AND session_id = ? ORDER BY resolved_at, wbs`, source, sessionId);
|
|
55776
|
+
} catch (error51) {
|
|
55777
|
+
if (error51 instanceof Error && error51.message.includes("no such table: history_task_session"))
|
|
55778
|
+
return [];
|
|
55779
|
+
throw error51;
|
|
55780
|
+
}
|
|
55781
|
+
}
|
|
55782
|
+
async deleteAll() {
|
|
55783
|
+
await this.db.run("DELETE FROM history_task_session");
|
|
55784
|
+
}
|
|
55785
|
+
async deleteBySource(source) {
|
|
55786
|
+
await this.db.run("DELETE FROM history_task_session WHERE source = ?", [source]);
|
|
55787
|
+
}
|
|
55788
|
+
}
|
|
55789
|
+
|
|
55491
55790
|
// ../../packages/domain/src/schema/transition-runs.ts
|
|
55492
55791
|
var transitionRunsTable, transitionRuns;
|
|
55493
55792
|
var init_transition_runs = __esm(() => {
|
|
@@ -55608,7 +55907,7 @@ var init_dao = __esm(() => {
|
|
|
55608
55907
|
init_workspace_dao();
|
|
55609
55908
|
});
|
|
55610
55909
|
|
|
55611
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
55910
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/errors.js
|
|
55612
55911
|
var WorkflowValidationError, FSMError, RunCollisionError, WorkflowResumeError;
|
|
55613
55912
|
var init_errors5 = __esm(() => {
|
|
55614
55913
|
WorkflowValidationError = class WorkflowValidationError extends Error {
|
|
@@ -55643,12 +55942,12 @@ var init_errors5 = __esm(() => {
|
|
|
55643
55942
|
};
|
|
55644
55943
|
});
|
|
55645
55944
|
|
|
55646
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
55945
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/event-bus/index.js
|
|
55647
55946
|
var init_event_bus2 = __esm(() => {
|
|
55648
55947
|
init_event_bus();
|
|
55649
55948
|
});
|
|
55650
55949
|
|
|
55651
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
55950
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/api-client.js
|
|
55652
55951
|
function sanitizeUrlForObservability(url2) {
|
|
55653
55952
|
try {
|
|
55654
55953
|
const parsed = new URL(url2);
|
|
@@ -55879,12 +56178,12 @@ var init_api_client = __esm(() => {
|
|
|
55879
56178
|
};
|
|
55880
56179
|
});
|
|
55881
56180
|
|
|
55882
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
56181
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/telemetry/index.js
|
|
55883
56182
|
var init_telemetry = __esm(() => {
|
|
55884
56183
|
init_tracing2();
|
|
55885
56184
|
});
|
|
55886
56185
|
|
|
55887
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
56186
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/index.js
|
|
55888
56187
|
var init_dist6 = __esm(() => {
|
|
55889
56188
|
init_api_client();
|
|
55890
56189
|
init_event_bus2();
|
|
@@ -55892,7 +56191,7 @@ var init_dist6 = __esm(() => {
|
|
|
55892
56191
|
init_telemetry();
|
|
55893
56192
|
});
|
|
55894
56193
|
|
|
55895
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56194
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/run-lifecycle.js
|
|
55896
56195
|
function runtimeBuiltins(workflowName, stateOrNodeId, runId, transitionsTaken, mode) {
|
|
55897
56196
|
return {
|
|
55898
56197
|
workflow: workflowName,
|
|
@@ -56176,7 +56475,7 @@ var init_run_lifecycle = __esm(() => {
|
|
|
56176
56475
|
];
|
|
56177
56476
|
});
|
|
56178
56477
|
|
|
56179
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56478
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.49+25494994f190a870/node_modules/@gobing-ai/ts-runtime/dist/extension/capability-registry.js
|
|
56180
56479
|
class CapabilityRegistry {
|
|
56181
56480
|
kind;
|
|
56182
56481
|
capabilities = new Map;
|
|
@@ -56207,7 +56506,7 @@ class CapabilityRegistry {
|
|
|
56207
56506
|
}
|
|
56208
56507
|
}
|
|
56209
56508
|
|
|
56210
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56509
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.49+25494994f190a870/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-path.js
|
|
56211
56510
|
function assertRelativeExtensionPath(path9, options = {}) {
|
|
56212
56511
|
const where = options.sourceName !== undefined ? ` declared by "${options.sourceName}"` : "";
|
|
56213
56512
|
if (/^([/\\]|[A-Za-z]:[/\\])/.test(path9)) {
|
|
@@ -56218,7 +56517,7 @@ function assertRelativeExtensionPath(path9, options = {}) {
|
|
|
56218
56517
|
}
|
|
56219
56518
|
}
|
|
56220
56519
|
|
|
56221
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56520
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.49+25494994f190a870/node_modules/@gobing-ai/ts-runtime/dist/extension/extension-loader.js
|
|
56222
56521
|
import { isAbsolute, resolve } from "path";
|
|
56223
56522
|
async function loadExtensionModules(refs, options, register) {
|
|
56224
56523
|
if (refs.length === 0)
|
|
@@ -56257,17 +56556,17 @@ async function loadExtensionModules(refs, options, register) {
|
|
|
56257
56556
|
}
|
|
56258
56557
|
var init_extension_loader = () => {};
|
|
56259
56558
|
|
|
56260
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56559
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.49+25494994f190a870/node_modules/@gobing-ai/ts-runtime/dist/extension/index.js
|
|
56261
56560
|
var init_extension = __esm(() => {
|
|
56262
56561
|
init_extension_loader();
|
|
56263
56562
|
});
|
|
56264
56563
|
|
|
56265
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.
|
|
56564
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.49+25494994f190a870/node_modules/@gobing-ai/ts-runtime/dist/extension.js
|
|
56266
56565
|
var init_extension2 = __esm(() => {
|
|
56267
56566
|
init_extension();
|
|
56268
56567
|
});
|
|
56269
56568
|
|
|
56270
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56569
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema.js
|
|
56271
56570
|
var RESERVED_VAR_NAMES, IDENTIFIER, VarsSchema, EnvSchema, relativeExtensionPath, WorkflowExtensionsSchema, ActionDefSchema, GuardDefSchema, StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema, WorkflowDefSchema;
|
|
56272
56571
|
var init_schema2 = __esm(() => {
|
|
56273
56572
|
init_extension2();
|
|
@@ -56369,7 +56668,7 @@ var init_schema2 = __esm(() => {
|
|
|
56369
56668
|
WorkflowDefSchema = exports_external.union([StateMachineWorkflowDefSchema, TransitionFlowWorkflowDefSchema]);
|
|
56370
56669
|
});
|
|
56371
56670
|
|
|
56372
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56671
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/config.js
|
|
56373
56672
|
async function loadWorkflowDef(path9, options = {}) {
|
|
56374
56673
|
return parseWorkflowDef(await loadStructuredConfig(path9, options), path9);
|
|
56375
56674
|
}
|
|
@@ -56536,7 +56835,7 @@ var init_config4 = __esm(() => {
|
|
|
56536
56835
|
RUNTIME_TEMPLATE_NAMESPACES = new Set(RUNTIME_BUILTIN_KEYS);
|
|
56537
56836
|
});
|
|
56538
56837
|
|
|
56539
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56838
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/extensions.js
|
|
56540
56839
|
function collectWorkflowExtensions(sourceName, sourceDir, extensions) {
|
|
56541
56840
|
if (extensions === undefined)
|
|
56542
56841
|
return [];
|
|
@@ -56600,7 +56899,7 @@ var init_extensions = __esm(() => {
|
|
|
56600
56899
|
init_errors5();
|
|
56601
56900
|
});
|
|
56602
56901
|
|
|
56603
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
56902
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/host.js
|
|
56604
56903
|
class WorkflowEngineHost {
|
|
56605
56904
|
lifecycleBus;
|
|
56606
56905
|
actions = new CapabilityRegistry("workflow action");
|
|
@@ -56770,7 +57069,7 @@ var init_host = __esm(() => {
|
|
|
56770
57069
|
init_errors5();
|
|
56771
57070
|
});
|
|
56772
57071
|
|
|
56773
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57072
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/schema-sql.js
|
|
56774
57073
|
var WORKFLOW_ENGINE_SCHEMA_SQL;
|
|
56775
57074
|
var init_schema_sql = __esm(() => {
|
|
56776
57075
|
WORKFLOW_ENGINE_SCHEMA_SQL = `
|
|
@@ -56843,7 +57142,7 @@ CREATE TABLE IF NOT EXISTS action_runs (
|
|
|
56843
57142
|
`.trim();
|
|
56844
57143
|
});
|
|
56845
57144
|
|
|
56846
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57145
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/persistence.js
|
|
56847
57146
|
async function applyWorkflowEngineSchema(db2) {
|
|
56848
57147
|
for (const statement of WORKFLOW_ENGINE_SCHEMA_SQL.split(";")) {
|
|
56849
57148
|
const sql4 = statement.trim();
|
|
@@ -57159,7 +57458,7 @@ var init_persistence = __esm(() => {
|
|
|
57159
57458
|
init_schema_sql();
|
|
57160
57459
|
});
|
|
57161
57460
|
|
|
57162
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57461
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/variables.js
|
|
57163
57462
|
function mergeVars(workflowVars = {}, overrideVars = {}) {
|
|
57164
57463
|
return { ...workflowVars, ...overrideVars };
|
|
57165
57464
|
}
|
|
@@ -57219,7 +57518,7 @@ var init_variables = __esm(() => {
|
|
|
57219
57518
|
TEMPLATE_REF = /\$\{([^}]+)\}/g;
|
|
57220
57519
|
});
|
|
57221
57520
|
|
|
57222
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57521
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/action-step.js
|
|
57223
57522
|
async function runActionStep(action, vars, deps) {
|
|
57224
57523
|
const { host, persistence, lifecycle, stateOrNodeId, runId } = deps;
|
|
57225
57524
|
const resolved = resolveTemplates(action.options ?? {}, {
|
|
@@ -57283,7 +57582,7 @@ var init_action_step = __esm(() => {
|
|
|
57283
57582
|
init_variables();
|
|
57284
57583
|
});
|
|
57285
57584
|
|
|
57286
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57585
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/state-machine.js
|
|
57287
57586
|
class StateMachineDriver {
|
|
57288
57587
|
options;
|
|
57289
57588
|
constructor(options) {
|
|
@@ -57419,7 +57718,7 @@ var init_state_machine = __esm(() => {
|
|
|
57419
57718
|
EMPTY_OUTCOME = { outcome: "completed", result: undefined, setVars: undefined };
|
|
57420
57719
|
});
|
|
57421
57720
|
|
|
57422
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57721
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/transition-flow.js
|
|
57423
57722
|
class TransitionFlowDriver {
|
|
57424
57723
|
options;
|
|
57425
57724
|
constructor(options) {
|
|
@@ -57538,7 +57837,7 @@ var init_transition_flow = __esm(() => {
|
|
|
57538
57837
|
init_variables();
|
|
57539
57838
|
});
|
|
57540
57839
|
|
|
57541
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
57840
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/service.js
|
|
57542
57841
|
class WorkflowService {
|
|
57543
57842
|
host;
|
|
57544
57843
|
persistence;
|
|
@@ -57763,7 +58062,7 @@ var init_service = __esm(() => {
|
|
|
57763
58062
|
init_variables();
|
|
57764
58063
|
});
|
|
57765
58064
|
|
|
57766
|
-
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.
|
|
58065
|
+
// ../../node_modules/.bun/@gobing-ai+ts-dual-workflow-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-dual-workflow-engine/dist/index.js
|
|
57767
58066
|
var init_dist7 = __esm(() => {
|
|
57768
58067
|
init_config4();
|
|
57769
58068
|
init_extensions();
|
|
@@ -57773,7 +58072,7 @@ var init_dist7 = __esm(() => {
|
|
|
57773
58072
|
init_service();
|
|
57774
58073
|
});
|
|
57775
58074
|
|
|
57776
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58075
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/hash.js
|
|
57777
58076
|
import { createHash as createHash3 } from "crypto";
|
|
57778
58077
|
function stableJson(value) {
|
|
57779
58078
|
if (Array.isArray(value)) {
|
|
@@ -57790,7 +58089,7 @@ function sha256(value) {
|
|
|
57790
58089
|
}
|
|
57791
58090
|
var init_hash = () => {};
|
|
57792
58091
|
|
|
57793
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58092
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/errors.js
|
|
57794
58093
|
var HistoryImportError;
|
|
57795
58094
|
var init_errors6 = __esm(() => {
|
|
57796
58095
|
HistoryImportError = class HistoryImportError extends Error {
|
|
@@ -57803,7 +58102,7 @@ var init_errors6 = __esm(() => {
|
|
|
57803
58102
|
};
|
|
57804
58103
|
});
|
|
57805
58104
|
|
|
57806
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58105
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/schema-sql.js
|
|
57807
58106
|
var HISTORY_IMPORT_SCHEMA_SQL;
|
|
57808
58107
|
var init_schema_sql2 = __esm(() => {
|
|
57809
58108
|
HISTORY_IMPORT_SCHEMA_SQL = `
|
|
@@ -57890,7 +58189,7 @@ CREATE INDEX IF NOT EXISTS idx_history_tool_call_message_hash
|
|
|
57890
58189
|
`.trim();
|
|
57891
58190
|
});
|
|
57892
58191
|
|
|
57893
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
58192
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/mappers.js
|
|
57894
58193
|
function identityFieldMap(keys) {
|
|
57895
58194
|
const map2 = {};
|
|
57896
58195
|
for (const key of keys) {
|
|
@@ -57921,15 +58220,33 @@ function redactArgs(args) {
|
|
|
57921
58220
|
}
|
|
57922
58221
|
return args;
|
|
57923
58222
|
}
|
|
57924
|
-
function
|
|
57925
|
-
|
|
57926
|
-
if (allow === undefined || !allow.includes(toolName))
|
|
58223
|
+
function bashCommandOf(args) {
|
|
58224
|
+
if (args === null || typeof args !== "object")
|
|
57927
58225
|
return;
|
|
57928
|
-
|
|
57929
|
-
|
|
57930
|
-
|
|
57931
|
-
|
|
57932
|
-
|
|
58226
|
+
const command = args.command;
|
|
58227
|
+
if (typeof command === "string")
|
|
58228
|
+
return command;
|
|
58229
|
+
if (Array.isArray(command))
|
|
58230
|
+
return command.map(String).join(" ");
|
|
58231
|
+
return;
|
|
58232
|
+
}
|
|
58233
|
+
function maybeArgsRaw(source, toolName, args) {
|
|
58234
|
+
const todo = TODO_TOOL_ALLOWLIST[source];
|
|
58235
|
+
if (todo?.includes(toolName)) {
|
|
58236
|
+
if (typeof args === "string")
|
|
58237
|
+
return args;
|
|
58238
|
+
if (args === undefined || args === null)
|
|
58239
|
+
return;
|
|
58240
|
+
return JSON.stringify(args);
|
|
58241
|
+
}
|
|
58242
|
+
const bash = BASH_TOOL_ALLOWLIST[source];
|
|
58243
|
+
if (bash?.includes(toolName)) {
|
|
58244
|
+
const command = bashCommandOf(args);
|
|
58245
|
+
if (command === undefined)
|
|
58246
|
+
return;
|
|
58247
|
+
return command.length > BASH_COMMAND_MAX_CHARS ? command.slice(0, BASH_COMMAND_MAX_CHARS) : command;
|
|
58248
|
+
}
|
|
58249
|
+
return;
|
|
57933
58250
|
}
|
|
57934
58251
|
function claudeSplit(raw) {
|
|
57935
58252
|
const entries = [];
|
|
@@ -58423,63 +58740,71 @@ function codexSplit(raw, context4) {
|
|
|
58423
58740
|
function agySplit(raw, context4) {
|
|
58424
58741
|
const entries = [];
|
|
58425
58742
|
const recordType = String(raw.type ?? "");
|
|
58426
|
-
const explicitSessionId = s(raw.session_id, raw.conversation_id);
|
|
58743
|
+
const explicitSessionId = s(raw.session_id, raw.conversation_id, raw.conversationId);
|
|
58427
58744
|
const pathSessionId = context4?.sourceFile ? sessionIdFromSourcePath("agy", context4.sourceFile) : undefined;
|
|
58428
58745
|
const sessionId = explicitSessionId ?? pathSessionId ?? "unknown";
|
|
58429
|
-
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : 0;
|
|
58746
|
+
const seq = typeof raw.seq === "number" ? raw.seq : typeof raw.step_index === "number" ? raw.step_index : context4?.sourceLine ?? 0;
|
|
58430
58747
|
const ts = timestampOf(raw.created_at, raw.timestamp, raw.ts);
|
|
58431
58748
|
let role;
|
|
58432
58749
|
let disposition;
|
|
58433
58750
|
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 {
|
|
58751
|
+
let messageRecordType = recordType;
|
|
58752
|
+
if (raw.display !== undefined) {
|
|
58753
|
+
role = "user";
|
|
58754
|
+
disposition = "keep";
|
|
58755
|
+
contentText = s(raw.display) ?? null;
|
|
58756
|
+
messageRecordType = recordType.length > 0 ? recordType : "USER_INPUT";
|
|
58757
|
+
} else {
|
|
58758
|
+
switch (recordType) {
|
|
58759
|
+
case "USER_INPUT":
|
|
58760
|
+
case "ASK_QUESTION":
|
|
58761
|
+
role = "user";
|
|
58762
|
+
disposition = "keep";
|
|
58763
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
58764
|
+
break;
|
|
58765
|
+
case "PLANNER_RESPONSE":
|
|
58766
|
+
role = "assistant";
|
|
58767
|
+
disposition = "keep";
|
|
58768
|
+
contentText = s(raw.content, raw.text, raw.message, raw.plan) ?? null;
|
|
58769
|
+
break;
|
|
58770
|
+
case "ERROR_MESSAGE":
|
|
58771
|
+
role = "system";
|
|
58772
|
+
disposition = "keep";
|
|
58773
|
+
contentText = s(raw.content, raw.text, raw.message) ?? null;
|
|
58774
|
+
break;
|
|
58775
|
+
case "RUN_COMMAND":
|
|
58776
|
+
case "VIEW_FILE":
|
|
58777
|
+
case "GREP_SEARCH":
|
|
58778
|
+
case "LIST_DIRECTORY":
|
|
58779
|
+
case "READ_URL_CONTENT":
|
|
58780
|
+
role = "tool";
|
|
58781
|
+
disposition = "keep";
|
|
58782
|
+
contentText = s(raw.content, raw.command, raw.file_path, raw.pattern) ?? null;
|
|
58783
|
+
break;
|
|
58784
|
+
case "CODE_ACTION":
|
|
58785
|
+
case "INVOKE_SUBAGENT":
|
|
58786
|
+
role = "tool";
|
|
58787
|
+
disposition = "keep";
|
|
58788
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
58789
|
+
break;
|
|
58790
|
+
case "CONVERSATION_HISTORY":
|
|
58791
|
+
case "CHECKPOINT":
|
|
58792
|
+
case "GENERIC":
|
|
58478
58793
|
role = "meta";
|
|
58479
58794
|
disposition = "meta";
|
|
58480
58795
|
contentText = s(raw.content, raw.text) ?? null;
|
|
58481
|
-
|
|
58482
|
-
|
|
58796
|
+
break;
|
|
58797
|
+
default:
|
|
58798
|
+
if (recordType.length === 0) {
|
|
58799
|
+
role = "unknown";
|
|
58800
|
+
disposition = "unknown";
|
|
58801
|
+
} else {
|
|
58802
|
+
role = "meta";
|
|
58803
|
+
disposition = "meta";
|
|
58804
|
+
contentText = s(raw.content, raw.text) ?? null;
|
|
58805
|
+
}
|
|
58806
|
+
break;
|
|
58807
|
+
}
|
|
58483
58808
|
}
|
|
58484
58809
|
const messageSplitIndex = entries.length;
|
|
58485
58810
|
entries.push({
|
|
@@ -58488,7 +58813,7 @@ function agySplit(raw, context4) {
|
|
|
58488
58813
|
session_id: sessionId,
|
|
58489
58814
|
seq,
|
|
58490
58815
|
role,
|
|
58491
|
-
record_type:
|
|
58816
|
+
record_type: messageRecordType,
|
|
58492
58817
|
disposition,
|
|
58493
58818
|
ts,
|
|
58494
58819
|
duration_ms: undefined,
|
|
@@ -58499,7 +58824,7 @@ function agySplit(raw, context4) {
|
|
|
58499
58824
|
cache_write_tokens: null,
|
|
58500
58825
|
cost_usd: null,
|
|
58501
58826
|
content_text: contentText,
|
|
58502
|
-
cwd: null,
|
|
58827
|
+
cwd: s(raw.workspace, raw.cwd) ?? null,
|
|
58503
58828
|
provenance: "ambient"
|
|
58504
58829
|
}
|
|
58505
58830
|
});
|
|
@@ -59054,7 +59379,7 @@ function extractContentText(content) {
|
|
|
59054
59379
|
function stableFieldShape(raw) {
|
|
59055
59380
|
return Object.keys(raw).map((k) => k.toLowerCase()).sort().join("+");
|
|
59056
59381
|
}
|
|
59057
|
-
var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, TODO_TOOL_ALLOWLIST, 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;
|
|
59382
|
+
var MESSAGE_MAPPER_KEYS, TOOL_CALL_MAPPER_KEYS, TODO_TOOL_ALLOWLIST, BASH_TOOL_ALLOWLIST, BASH_COMMAND_MAX_CHARS = 8192, 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
59383
|
var init_mappers = __esm(() => {
|
|
59059
59384
|
init_zod();
|
|
59060
59385
|
init_hash();
|
|
@@ -59106,6 +59431,16 @@ var init_mappers = __esm(() => {
|
|
|
59106
59431
|
agy: [],
|
|
59107
59432
|
gemini: []
|
|
59108
59433
|
};
|
|
59434
|
+
BASH_TOOL_ALLOWLIST = {
|
|
59435
|
+
claude: ["Bash"],
|
|
59436
|
+
opencode: ["bash"],
|
|
59437
|
+
codex: [],
|
|
59438
|
+
omp: [],
|
|
59439
|
+
grok: [],
|
|
59440
|
+
pi: ["bash"],
|
|
59441
|
+
agy: [],
|
|
59442
|
+
gemini: []
|
|
59443
|
+
};
|
|
59109
59444
|
AGY_BRAIN_REGEX = new RegExp(`(?:^|\\/)brain\\/(${UUID_PATTERN})(?:\\/|$)`, "i");
|
|
59110
59445
|
CODEX_ROLLOUT_REGEX = new RegExp(`(?:^|-|_)(${UUID_PATTERN})$`, "i");
|
|
59111
59446
|
GROK_META_TYPES = new Set([
|
|
@@ -59155,7 +59490,7 @@ var init_mappers = __esm(() => {
|
|
|
59155
59490
|
GEMINI_SCHEMA = passthroughSchema;
|
|
59156
59491
|
});
|
|
59157
59492
|
|
|
59158
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
59493
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/sources.js
|
|
59159
59494
|
function firstString(...values) {
|
|
59160
59495
|
for (const value of values) {
|
|
59161
59496
|
if (typeof value === "string" && value.length > 0)
|
|
@@ -59302,7 +59637,7 @@ var init_sources = __esm(() => {
|
|
|
59302
59637
|
omp: customSourceDefinition("omp", "OMP", [".omp/agent/sessions"], ["*.jsonl"], ompSplit, OMP_FIELD_MAP, OMP_SCHEMA),
|
|
59303
59638
|
grok: customSourceDefinition("grok", "Grok", [".grok/sessions"], ["*.jsonl"], grokSplit, GROK_FIELD_MAP, GROK_SCHEMA),
|
|
59304
59639
|
agy: {
|
|
59305
|
-
...customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli
|
|
59640
|
+
...customSourceDefinition("agy", "Antigravity CLI", [".gemini/antigravity-cli"], ["*.jsonl"], agySplit, AGY_FIELD_MAP, AGY_SCHEMA),
|
|
59306
59641
|
corruptLinePolicy: "skip"
|
|
59307
59642
|
},
|
|
59308
59643
|
gemini: customSourceDefinition("gemini", "Gemini CLI", [".gemini/tmp", ".config/gemini"], ["*.jsonl"], geminiSplit, GEMINI_FIELD_MAP, GEMINI_SCHEMA),
|
|
@@ -59312,7 +59647,7 @@ var init_sources = __esm(() => {
|
|
|
59312
59647
|
};
|
|
59313
59648
|
});
|
|
59314
59649
|
|
|
59315
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
59650
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/jsonl-importer-dao.js
|
|
59316
59651
|
function targetTableFor(table3) {
|
|
59317
59652
|
if (!VALID_TABLE_NAME.test(table3)) {
|
|
59318
59653
|
throw new HistoryImportError(`Invalid history ETL target table: ${table3}`, { table: table3 });
|
|
@@ -59644,7 +59979,7 @@ var init_jsonl_importer_dao = __esm(() => {
|
|
|
59644
59979
|
TYPED_IGNORED_KEYS = new Set(["_meta", "split_index"]);
|
|
59645
59980
|
});
|
|
59646
59981
|
|
|
59647
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
59982
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/redaction.js
|
|
59648
59983
|
function redactValue(value, rules = DEFAULT_REDACTION_RULES) {
|
|
59649
59984
|
if (typeof value === "string") {
|
|
59650
59985
|
return rules.reduce((current, rule) => current.replace(rule.pattern, rule.replacement), value);
|
|
@@ -59696,7 +60031,7 @@ var init_redaction = __esm(() => {
|
|
|
59696
60031
|
];
|
|
59697
60032
|
});
|
|
59698
60033
|
|
|
59699
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60034
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/importer.js
|
|
59700
60035
|
function toolCallKey(source, sessionId, callId) {
|
|
59701
60036
|
return `${source}${TOOL_CALL_KEY_SEP}${sessionId}${TOOL_CALL_KEY_SEP}${callId}`;
|
|
59702
60037
|
}
|
|
@@ -60100,7 +60435,7 @@ var init_importer = __esm(() => {
|
|
|
60100
60435
|
init_sources();
|
|
60101
60436
|
});
|
|
60102
60437
|
|
|
60103
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60438
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/opencode-importer.js
|
|
60104
60439
|
async function runOpenCodeImport(options) {
|
|
60105
60440
|
const paths = options.paths ?? ambientRuntimePaths2();
|
|
60106
60441
|
const sourceDatabase = options.sourceDatabase ?? joinPath2(paths.home, ".local/share/opencode/opencode.db");
|
|
@@ -60357,7 +60692,7 @@ var init_opencode_importer = __esm(() => {
|
|
|
60357
60692
|
init_redaction();
|
|
60358
60693
|
});
|
|
60359
60694
|
|
|
60360
|
-
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.
|
|
60695
|
+
// ../../node_modules/.bun/@gobing-ai+ts-llm-jsonl-importer@0.4.49+f66f1d7f0d37c145/node_modules/@gobing-ai/ts-llm-jsonl-importer/dist/index.js
|
|
60361
60696
|
var init_dist8 = __esm(() => {
|
|
60362
60697
|
init_importer();
|
|
60363
60698
|
init_mappers();
|
|
@@ -60366,7 +60701,7 @@ var init_dist8 = __esm(() => {
|
|
|
60366
60701
|
init_sources();
|
|
60367
60702
|
});
|
|
60368
60703
|
|
|
60369
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60704
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/extensions.js
|
|
60370
60705
|
function collectExtensions(sourceName, sourceDir, extensions) {
|
|
60371
60706
|
if (extensions === undefined)
|
|
60372
60707
|
return [];
|
|
@@ -60380,7 +60715,7 @@ function collectExtensions(sourceName, sourceDir, extensions) {
|
|
|
60380
60715
|
}
|
|
60381
60716
|
var init_extensions2 = () => {};
|
|
60382
60717
|
|
|
60383
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60718
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/types.js
|
|
60384
60719
|
function createFinding(rule, message, filePath, extras = {}) {
|
|
60385
60720
|
return {
|
|
60386
60721
|
ruleId: rule.id,
|
|
@@ -60451,7 +60786,7 @@ var init_types3 = __esm(() => {
|
|
|
60451
60786
|
});
|
|
60452
60787
|
});
|
|
60453
60788
|
|
|
60454
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
60789
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/config/loader.js
|
|
60455
60790
|
async function loadPreset(name, options) {
|
|
60456
60791
|
const merged = await buildMergedRoots(options.roots.map((root) => resolvePath4(root)), options.fileSystem);
|
|
60457
60792
|
const presetPath = findMergedPreset(merged, name);
|
|
@@ -60666,7 +61001,7 @@ var init_loader2 = __esm(() => {
|
|
|
60666
61001
|
FIX_MODE_AUTHORITY = { none: 0, suggest: 1, auto: 2 };
|
|
60667
61002
|
});
|
|
60668
61003
|
|
|
60669
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
61004
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/test-stub-fixer.js
|
|
60670
61005
|
function normalizeFindingPath(filePath) {
|
|
60671
61006
|
if (!filePath || isAbsolutePath2(filePath))
|
|
60672
61007
|
return null;
|
|
@@ -60731,7 +61066,7 @@ var init_test_stub_fixer = __esm(() => {
|
|
|
60731
61066
|
realFileSystem = createNodeFileSystem3();
|
|
60732
61067
|
});
|
|
60733
61068
|
|
|
60734
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
61069
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/fixers/fixers.js
|
|
60735
61070
|
function registerBuiltinFixers(host, exec) {
|
|
60736
61071
|
const regexFixer = new RegexFixerProvider;
|
|
60737
61072
|
const pathFixer = new PathFixerProvider;
|
|
@@ -60934,7 +61269,7 @@ var init_fixers = __esm(() => {
|
|
|
60934
61269
|
};
|
|
60935
61270
|
});
|
|
60936
61271
|
|
|
60937
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61272
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/agents/shims.js
|
|
60938
61273
|
function getAgentSessionCapability(agent) {
|
|
60939
61274
|
return AGENT_SESSION_CAPABILITY[agent];
|
|
60940
61275
|
}
|
|
@@ -61230,7 +61565,7 @@ var init_shims = __esm(() => {
|
|
|
61230
61565
|
ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias3) => [alias3, shim.name])));
|
|
61231
61566
|
});
|
|
61232
61567
|
|
|
61233
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61568
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/identity.js
|
|
61234
61569
|
function buildIdentityPreamble(ctx) {
|
|
61235
61570
|
const sections = [
|
|
61236
61571
|
`You are agent \`${ctx.agentId}\` (${ctx.agentType}) in workspace \`${ctx.workspace}\`.`
|
|
@@ -61306,12 +61641,12 @@ var init_identity = __esm(() => {
|
|
|
61306
61641
|
init_dist5();
|
|
61307
61642
|
});
|
|
61308
61643
|
|
|
61309
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61644
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/slash-command.js
|
|
61310
61645
|
function isClaudeStyleSlashCommand(input) {
|
|
61311
|
-
return
|
|
61646
|
+
return SLASH_COMMAND_RE2.test(input);
|
|
61312
61647
|
}
|
|
61313
61648
|
function translateSlashCommand(agent, input) {
|
|
61314
|
-
const match =
|
|
61649
|
+
const match = SLASH_COMMAND_RE2.exec(input);
|
|
61315
61650
|
if (!match)
|
|
61316
61651
|
return input;
|
|
61317
61652
|
const [, plugin, command, rest = ""] = match;
|
|
@@ -61329,12 +61664,12 @@ function translateSlashCommand(agent, input) {
|
|
|
61329
61664
|
return `/${plugin}-${command}${suffix}`;
|
|
61330
61665
|
}
|
|
61331
61666
|
}
|
|
61332
|
-
var
|
|
61667
|
+
var SLASH_COMMAND_RE2;
|
|
61333
61668
|
var init_slash_command = __esm(() => {
|
|
61334
|
-
|
|
61669
|
+
SLASH_COMMAND_RE2 = /^\/([a-zA-Z0-9._-]+):([a-zA-Z0-9._-]+)(\s.*)?$/;
|
|
61335
61670
|
});
|
|
61336
61671
|
|
|
61337
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61672
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/ai-runner.js
|
|
61338
61673
|
function buildCorrelationEnv(correlation) {
|
|
61339
61674
|
return {
|
|
61340
61675
|
[AGENT_RUN_ID_ENV]: correlation.runId,
|
|
@@ -61478,7 +61813,7 @@ var init_ai_runner = __esm(() => {
|
|
|
61478
61813
|
init_slash_command();
|
|
61479
61814
|
});
|
|
61480
61815
|
|
|
61481
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61816
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/agent-detector.js
|
|
61482
61817
|
class AgentDetector {
|
|
61483
61818
|
runner;
|
|
61484
61819
|
timeout;
|
|
@@ -61554,7 +61889,7 @@ var init_agent_detector = __esm(() => {
|
|
|
61554
61889
|
VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
|
|
61555
61890
|
});
|
|
61556
61891
|
|
|
61557
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61892
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/agent-spec.js
|
|
61558
61893
|
function validateAgentId(id) {
|
|
61559
61894
|
if (!/^[a-z][a-z0-9_-]{1,63}$/.test(id)) {
|
|
61560
61895
|
throw new ValueError(`Invalid agent id "${id}": expected 2-64 chars, lowercase alphanumeric, "_" or "-"`);
|
|
@@ -61653,7 +61988,7 @@ var init_agent_spec = __esm(() => {
|
|
|
61653
61988
|
};
|
|
61654
61989
|
});
|
|
61655
61990
|
|
|
61656
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
61991
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/agents/auth-shims.js
|
|
61657
61992
|
function isNonEmpty(value) {
|
|
61658
61993
|
return value !== undefined && value.trim().length > 0;
|
|
61659
61994
|
}
|
|
@@ -61778,7 +62113,7 @@ var init_auth_shims = __esm(() => {
|
|
|
61778
62113
|
};
|
|
61779
62114
|
});
|
|
61780
62115
|
|
|
61781
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62116
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/model-health-probe.js
|
|
61782
62117
|
class ModelHealthProbeRegistry {
|
|
61783
62118
|
probes = new Map;
|
|
61784
62119
|
register(providerPrefix, probe) {
|
|
@@ -61886,7 +62221,7 @@ var init_model_health_probe = __esm(() => {
|
|
|
61886
62221
|
};
|
|
61887
62222
|
});
|
|
61888
62223
|
|
|
61889
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62224
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/doctor-runner.js
|
|
61890
62225
|
class DoctorRunner {
|
|
61891
62226
|
detector;
|
|
61892
62227
|
runner;
|
|
@@ -62026,15 +62361,15 @@ var init_doctor_runner = __esm(() => {
|
|
|
62026
62361
|
init_model_health_probe();
|
|
62027
62362
|
});
|
|
62028
62363
|
|
|
62029
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62364
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/events.js
|
|
62030
62365
|
var init_events = () => {};
|
|
62031
62366
|
|
|
62032
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62367
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/messages.js
|
|
62033
62368
|
function formatMessage(msg) {
|
|
62034
62369
|
return `[task from=${msg.fromId ?? "operator"} id=${msg.id}] ${msg.body}`;
|
|
62035
62370
|
}
|
|
62036
62371
|
|
|
62037
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62372
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/team-agent-process.js
|
|
62038
62373
|
import { Buffer as Buffer5 } from "buffer";
|
|
62039
62374
|
|
|
62040
62375
|
class TeamAgentProcess {
|
|
@@ -62168,7 +62503,7 @@ var init_team_agent_process = __esm(() => {
|
|
|
62168
62503
|
init_dist5();
|
|
62169
62504
|
});
|
|
62170
62505
|
|
|
62171
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62506
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/team-orchestrator.js
|
|
62172
62507
|
class TeamOrchestrator {
|
|
62173
62508
|
configDir;
|
|
62174
62509
|
inbox;
|
|
@@ -62309,7 +62644,7 @@ var init_team_orchestrator = __esm(() => {
|
|
|
62309
62644
|
init_team_agent_process();
|
|
62310
62645
|
});
|
|
62311
62646
|
|
|
62312
|
-
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.
|
|
62647
|
+
// ../../node_modules/.bun/@gobing-ai+ts-ai-runner@0.4.49+c0cc17f5724c5012/node_modules/@gobing-ai/ts-ai-runner/dist/index.js
|
|
62313
62648
|
var exports_dist3 = {};
|
|
62314
62649
|
__export(exports_dist3, {
|
|
62315
62650
|
validateAgentId: () => validateAgentId,
|
|
@@ -62362,7 +62697,7 @@ var init_dist9 = __esm(() => {
|
|
|
62362
62697
|
init_team_orchestrator();
|
|
62363
62698
|
});
|
|
62364
62699
|
|
|
62365
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62700
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/config-access.js
|
|
62366
62701
|
function stringArray(value) {
|
|
62367
62702
|
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
|
|
62368
62703
|
}
|
|
@@ -62400,7 +62735,7 @@ function parseInlineFlags(source) {
|
|
|
62400
62735
|
return { flags, rest: source.slice(match[0].length) };
|
|
62401
62736
|
}
|
|
62402
62737
|
|
|
62403
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62738
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/glob-match.js
|
|
62404
62739
|
function matchesAny(path9, patterns) {
|
|
62405
62740
|
if (patterns === undefined || patterns.length === 0)
|
|
62406
62741
|
return true;
|
|
@@ -62448,7 +62783,7 @@ function escapeRegExp(value) {
|
|
|
62448
62783
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
62449
62784
|
}
|
|
62450
62785
|
|
|
62451
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62786
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-discovery.js
|
|
62452
62787
|
async function discoverFiles2(options) {
|
|
62453
62788
|
const fs3 = options.fs ?? createNodeFileSystem3();
|
|
62454
62789
|
const allFiles = await walkDir2(options.workdir, fs3, DEFAULT_EXCLUDES);
|
|
@@ -62479,12 +62814,12 @@ var init_file_discovery = __esm(() => {
|
|
|
62479
62814
|
DEFAULT_EXCLUDES = new Set([".git", "node_modules", "dist", ".coverage", ".astro", ".wrangler"]);
|
|
62480
62815
|
});
|
|
62481
62816
|
|
|
62482
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62817
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/file-utils.js
|
|
62483
62818
|
var init_file_utils = __esm(() => {
|
|
62484
62819
|
init_file_discovery();
|
|
62485
62820
|
});
|
|
62486
62821
|
|
|
62487
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62822
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/agent-detection-evaluator.js
|
|
62488
62823
|
class AgentDetectionEvaluator {
|
|
62489
62824
|
detector;
|
|
62490
62825
|
constructor(detector = new AgentDetector) {
|
|
@@ -62512,7 +62847,7 @@ var init_agent_detection_evaluator = __esm(() => {
|
|
|
62512
62847
|
init_file_utils();
|
|
62513
62848
|
});
|
|
62514
62849
|
|
|
62515
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62850
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/coverage-gate-evaluator.js
|
|
62516
62851
|
class CoverageGateEvaluator {
|
|
62517
62852
|
constructor() {}
|
|
62518
62853
|
async evaluate(rule, context4) {
|
|
@@ -62596,7 +62931,7 @@ var init_coverage_gate_evaluator = __esm(() => {
|
|
|
62596
62931
|
init_file_utils();
|
|
62597
62932
|
});
|
|
62598
62933
|
|
|
62599
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62934
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/exit-code-evaluator.js
|
|
62600
62935
|
class ExitCodeEvaluator {
|
|
62601
62936
|
executor;
|
|
62602
62937
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -62632,7 +62967,7 @@ var init_exit_code_evaluator = __esm(() => {
|
|
|
62632
62967
|
init_file_utils();
|
|
62633
62968
|
});
|
|
62634
62969
|
|
|
62635
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
62970
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/forbidden-import-evaluator.js
|
|
62636
62971
|
class ForbiddenImportEvaluator {
|
|
62637
62972
|
constructor() {}
|
|
62638
62973
|
async evaluate(rule, context4) {
|
|
@@ -62713,7 +63048,7 @@ var init_forbidden_import_evaluator = __esm(() => {
|
|
|
62713
63048
|
init_file_utils();
|
|
62714
63049
|
});
|
|
62715
63050
|
|
|
62716
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63051
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/import-boundary-evaluator.js
|
|
62717
63052
|
class ImportBoundaryEvaluator {
|
|
62718
63053
|
async evaluate(rule, context4) {
|
|
62719
63054
|
const config4 = rule.evaluator.config ?? {};
|
|
@@ -62806,7 +63141,7 @@ var init_import_boundary_evaluator = __esm(() => {
|
|
|
62806
63141
|
init_file_utils();
|
|
62807
63142
|
});
|
|
62808
63143
|
|
|
62809
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63144
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/path-evaluator.js
|
|
62810
63145
|
class PathEvaluator {
|
|
62811
63146
|
constructor() {}
|
|
62812
63147
|
async evaluate(rule, context4) {
|
|
@@ -62867,7 +63202,7 @@ var init_path_evaluator = __esm(() => {
|
|
|
62867
63202
|
init_file_utils();
|
|
62868
63203
|
});
|
|
62869
63204
|
|
|
62870
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63205
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/regex-evaluator.js
|
|
62871
63206
|
class RegexEvaluator {
|
|
62872
63207
|
constructor() {}
|
|
62873
63208
|
async evaluate(rule, context4) {
|
|
@@ -62945,7 +63280,7 @@ var init_regex_evaluator = __esm(() => {
|
|
|
62945
63280
|
init_file_utils();
|
|
62946
63281
|
});
|
|
62947
63282
|
|
|
62948
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63283
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/ripgrep-evaluator.js
|
|
62949
63284
|
class RipgrepEvaluator {
|
|
62950
63285
|
executor;
|
|
62951
63286
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -63038,7 +63373,7 @@ var init_ripgrep_evaluator = __esm(() => {
|
|
|
63038
63373
|
init_file_utils();
|
|
63039
63374
|
});
|
|
63040
63375
|
|
|
63041
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63376
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/schema-artifact-evaluator.js
|
|
63042
63377
|
class SchemaArtifactEvaluator {
|
|
63043
63378
|
constructor() {}
|
|
63044
63379
|
async evaluate(rule, context4) {
|
|
@@ -63116,7 +63451,7 @@ var init_schema_artifact_evaluator = __esm(() => {
|
|
|
63116
63451
|
init_file_utils();
|
|
63117
63452
|
});
|
|
63118
63453
|
|
|
63119
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63454
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/secrets-scanner-evaluator.js
|
|
63120
63455
|
class SecretsScannerEvaluator {
|
|
63121
63456
|
constructor() {}
|
|
63122
63457
|
async evaluate(rule, context4) {
|
|
@@ -63184,7 +63519,7 @@ var init_secrets_scanner_evaluator = __esm(() => {
|
|
|
63184
63519
|
ALL_CATEGORIES = Object.keys(BUILTIN_PATTERNS);
|
|
63185
63520
|
});
|
|
63186
63521
|
|
|
63187
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63522
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/sg-evaluator.js
|
|
63188
63523
|
class SgEvaluator {
|
|
63189
63524
|
executor;
|
|
63190
63525
|
constructor(executor = nodeBunFactory3.createProcessExecutor()) {
|
|
@@ -63281,7 +63616,7 @@ var init_sg_evaluator = __esm(() => {
|
|
|
63281
63616
|
init_file_utils();
|
|
63282
63617
|
});
|
|
63283
63618
|
|
|
63284
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63619
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/resolvers/test-path-resolver.js
|
|
63285
63620
|
class TypeScriptTestPathResolver {
|
|
63286
63621
|
name = "typescript";
|
|
63287
63622
|
constructor() {}
|
|
@@ -63364,7 +63699,7 @@ function testify(rel) {
|
|
|
63364
63699
|
return `${dir}test_${base2}`;
|
|
63365
63700
|
}
|
|
63366
63701
|
|
|
63367
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63702
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/test-location-evaluator.js
|
|
63368
63703
|
class TestLocationEvaluator {
|
|
63369
63704
|
resolvers;
|
|
63370
63705
|
constructor(resolvers) {
|
|
@@ -63439,7 +63774,7 @@ var init_test_location_evaluator = __esm(() => {
|
|
|
63439
63774
|
TYPESCRIPT_FALLBACK = new TypeScriptTestPathResolver;
|
|
63440
63775
|
});
|
|
63441
63776
|
|
|
63442
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63777
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/evaluators/tsdoc-export-evaluator.js
|
|
63443
63778
|
class TsdocExportEvaluator {
|
|
63444
63779
|
constructor() {}
|
|
63445
63780
|
async evaluate(rule, context4) {
|
|
@@ -63524,7 +63859,7 @@ var init_tsdoc_export_evaluator = __esm(() => {
|
|
|
63524
63859
|
};
|
|
63525
63860
|
});
|
|
63526
63861
|
|
|
63527
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63862
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/json.js
|
|
63528
63863
|
class JsonFormatter {
|
|
63529
63864
|
constructor() {}
|
|
63530
63865
|
format(result) {
|
|
@@ -63532,7 +63867,7 @@ class JsonFormatter {
|
|
|
63532
63867
|
}
|
|
63533
63868
|
}
|
|
63534
63869
|
|
|
63535
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63870
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/formatters/text.js
|
|
63536
63871
|
class TextFormatter {
|
|
63537
63872
|
constructor() {}
|
|
63538
63873
|
format(result) {
|
|
@@ -63546,7 +63881,7 @@ class TextFormatter {
|
|
|
63546
63881
|
}
|
|
63547
63882
|
}
|
|
63548
63883
|
|
|
63549
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63884
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/builtins.js
|
|
63550
63885
|
function registerBuiltins(host, executor) {
|
|
63551
63886
|
const path9 = new PathEvaluator;
|
|
63552
63887
|
host.evaluators.register("regex", new RegexEvaluator, "builtin");
|
|
@@ -63586,7 +63921,7 @@ var init_builtins = __esm(() => {
|
|
|
63586
63921
|
init_tsdoc_export_evaluator();
|
|
63587
63922
|
});
|
|
63588
63923
|
|
|
63589
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63924
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/rule-engine-host.js
|
|
63590
63925
|
class RuleEngineHost {
|
|
63591
63926
|
evaluators;
|
|
63592
63927
|
formatters;
|
|
@@ -63603,7 +63938,7 @@ var init_rule_engine_host = __esm(() => {
|
|
|
63603
63938
|
init_extension2();
|
|
63604
63939
|
});
|
|
63605
63940
|
|
|
63606
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
63941
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/engine.js
|
|
63607
63942
|
class RuleEngine {
|
|
63608
63943
|
host;
|
|
63609
63944
|
events;
|
|
@@ -63789,7 +64124,7 @@ var init_engine = __esm(() => {
|
|
|
63789
64124
|
init_types3();
|
|
63790
64125
|
});
|
|
63791
64126
|
|
|
63792
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64127
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/host/bundled-rules.js
|
|
63793
64128
|
async function bundledRulesRoot() {
|
|
63794
64129
|
if (cachedRoot2 !== undefined)
|
|
63795
64130
|
return cachedRoot2;
|
|
@@ -63840,7 +64175,7 @@ var init_bundled_rules = __esm(() => {
|
|
|
63840
64175
|
init_dist5();
|
|
63841
64176
|
});
|
|
63842
64177
|
|
|
63843
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64178
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/db-adapter.js
|
|
63844
64179
|
class DbRulePersistenceAdapter {
|
|
63845
64180
|
db;
|
|
63846
64181
|
constructor(db2) {
|
|
@@ -63874,7 +64209,7 @@ class DbRulePersistenceAdapter {
|
|
|
63874
64209
|
}
|
|
63875
64210
|
}
|
|
63876
64211
|
|
|
63877
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64212
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/schema.js
|
|
63878
64213
|
var RULE_ENGINE_SCHEMA_SQL = `
|
|
63879
64214
|
CREATE TABLE IF NOT EXISTS rule_runs (
|
|
63880
64215
|
id TEXT PRIMARY KEY,
|
|
@@ -63920,10 +64255,10 @@ CREATE TABLE IF NOT EXISTS rule_eval_runs (
|
|
|
63920
64255
|
CREATE INDEX IF NOT EXISTS idx_rule_eval_runs_run_id ON rule_eval_runs (run_id);
|
|
63921
64256
|
`;
|
|
63922
64257
|
|
|
63923
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64258
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/persistence/index.js
|
|
63924
64259
|
var init_persistence2 = () => {};
|
|
63925
64260
|
|
|
63926
|
-
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.
|
|
64261
|
+
// ../../node_modules/.bun/@gobing-ai+ts-rule-engine@0.4.49+df32fe902834add3/node_modules/@gobing-ai/ts-rule-engine/dist/index.js
|
|
63927
64262
|
var init_dist10 = __esm(() => {
|
|
63928
64263
|
init_extensions2();
|
|
63929
64264
|
init_loader2();
|
|
@@ -63993,7 +64328,18 @@ var init_schema3 = __esm(() => {
|
|
|
63993
64328
|
|
|
63994
64329
|
// ../../packages/domain/src/migrations.ts
|
|
63995
64330
|
import { join as join5 } from "path";
|
|
64331
|
+
async function allMigrationsJournaled(adapter, migrations) {
|
|
64332
|
+
if (migrations.length === 0)
|
|
64333
|
+
return true;
|
|
64334
|
+
if (!await tableExists(adapter, "__spur_cli_migrations"))
|
|
64335
|
+
return false;
|
|
64336
|
+
const placeholders = migrations.map(() => "?").join(", ");
|
|
64337
|
+
const row = await adapter.queryFirst(`SELECT COUNT(*) AS n FROM "__spur_cli_migrations" WHERE id IN (${placeholders})`, ...migrations.map((m) => m.id));
|
|
64338
|
+
return (row?.n ?? 0) === migrations.length;
|
|
64339
|
+
}
|
|
63996
64340
|
async function applyCliMigrations(adapter, migrations = CLI_MIGRATIONS) {
|
|
64341
|
+
if (await allMigrationsJournaled(adapter, migrations))
|
|
64342
|
+
return 0;
|
|
63997
64343
|
await adapter.exec('CREATE TABLE IF NOT EXISTS "__spur_cli_migrations" (id TEXT PRIMARY KEY, applied_at INTEGER NOT NULL)');
|
|
63998
64344
|
let applied = 0;
|
|
63999
64345
|
for (const migration of migrations) {
|
|
@@ -64148,6 +64494,20 @@ CREATE TABLE IF NOT EXISTS history_run_session (
|
|
|
64148
64494
|
|
|
64149
64495
|
CREATE INDEX IF NOT EXISTS idx_history_run_session_run ON history_run_session (run_id);
|
|
64150
64496
|
CREATE INDEX IF NOT EXISTS idx_history_run_session_source_session ON history_run_session (source, session_id);
|
|
64497
|
+
`, HISTORY_TASK_SESSION_SCHEMA_SQL = `
|
|
64498
|
+
CREATE TABLE IF NOT EXISTS history_task_session (
|
|
64499
|
+
wbs TEXT NOT NULL,
|
|
64500
|
+
source TEXT NOT NULL,
|
|
64501
|
+
session_id TEXT NOT NULL,
|
|
64502
|
+
exactness TEXT NOT NULL,
|
|
64503
|
+
mechanism TEXT NOT NULL,
|
|
64504
|
+
evidence_kind TEXT NOT NULL,
|
|
64505
|
+
evidence_ref TEXT,
|
|
64506
|
+
resolved_at TEXT NOT NULL,
|
|
64507
|
+
PRIMARY KEY (wbs, source, session_id)
|
|
64508
|
+
);
|
|
64509
|
+
|
|
64510
|
+
CREATE INDEX IF NOT EXISTS idx_history_task_session_source_session ON history_task_session (source, session_id);
|
|
64151
64511
|
`, CLI_SCHEMA_SQL, RUN_PID_COLUMN_SCHEMA_SQL = `
|
|
64152
64512
|
ALTER TABLE runs ADD COLUMN pid INTEGER;
|
|
64153
64513
|
`, RUNS_EXTERNAL_KEY_COLUMN_SCHEMA_SQL = `
|
|
@@ -64486,6 +64846,8 @@ ${SYSTEM_EVENTS_SCHEMA_SQL}
|
|
|
64486
64846
|
${COORDINATION_RUNS_SCHEMA_SQL}
|
|
64487
64847
|
|
|
64488
64848
|
${HISTORY_RUN_SESSION_SCHEMA_SQL}
|
|
64849
|
+
|
|
64850
|
+
${HISTORY_TASK_SESSION_SCHEMA_SQL}
|
|
64489
64851
|
`;
|
|
64490
64852
|
CLI_MIGRATIONS = [
|
|
64491
64853
|
{ id: "0000_spur_cli_foundation", sql: CLI_SCHEMA_SQL },
|
|
@@ -64569,11 +64931,15 @@ ${HISTORY_RUN_SESSION_SCHEMA_SQL}
|
|
|
64569
64931
|
{
|
|
64570
64932
|
id: "0027_spur_cli_history_refresh_active_unique",
|
|
64571
64933
|
sql: HISTORY_REFRESH_ACTIVE_UNIQUE_SCHEMA_SQL
|
|
64934
|
+
},
|
|
64935
|
+
{
|
|
64936
|
+
id: "0028_spur_cli_history_task_session",
|
|
64937
|
+
sql: HISTORY_TASK_SESSION_SCHEMA_SQL
|
|
64572
64938
|
}
|
|
64573
64939
|
];
|
|
64574
64940
|
});
|
|
64575
64941
|
|
|
64576
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
64942
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/job-queue/db-job-queue.js
|
|
64577
64943
|
function queueLogger() {
|
|
64578
64944
|
if (!_queueLogger)
|
|
64579
64945
|
_queueLogger = getLogger2("job-queue");
|
|
@@ -64876,7 +65242,7 @@ var init_db_job_queue = __esm(() => {
|
|
|
64876
65242
|
init_tracing2();
|
|
64877
65243
|
});
|
|
64878
65244
|
|
|
64879
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
65245
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/job-queue-db.js
|
|
64880
65246
|
var exports_job_queue_db = {};
|
|
64881
65247
|
__export(exports_job_queue_db, {
|
|
64882
65248
|
DBQueueConsumer: () => DBQueueConsumer,
|
|
@@ -64890,7 +65256,7 @@ var init_job_queue_db = __esm(() => {
|
|
|
64890
65256
|
async function createMigratedDb(options) {
|
|
64891
65257
|
const { createDbAdapter: createDbAdapter2 } = await Promise.resolve().then(() => (init_dist4(), exports_dist));
|
|
64892
65258
|
const adapter = await createDbAdapter2({ driver: "bun-sqlite", url: options.url });
|
|
64893
|
-
await adapter.exec(
|
|
65259
|
+
await adapter.exec(`PRAGMA busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
|
|
64894
65260
|
await applyCliMigrations(adapter);
|
|
64895
65261
|
return adapter;
|
|
64896
65262
|
}
|
|
@@ -64898,7 +65264,7 @@ async function createMigratedDbViaRuntime(config4) {
|
|
|
64898
65264
|
const { loadRuntimeFactory: loadRuntimeFactory3 } = await Promise.resolve().then(() => (init_dist5(), exports_dist2));
|
|
64899
65265
|
const factory = await loadRuntimeFactory3();
|
|
64900
65266
|
const runtimeAdapter = await factory.createDbAdapter(config4);
|
|
64901
|
-
await runtimeAdapter.exec(
|
|
65267
|
+
await runtimeAdapter.exec(`PRAGMA busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
|
|
64902
65268
|
await applyCliMigrations(runtimeAdapter);
|
|
64903
65269
|
return runtimeAdapter;
|
|
64904
65270
|
}
|
|
@@ -64995,6 +65361,7 @@ async function enqueueCoalesced(db2, spec) {
|
|
|
64995
65361
|
}
|
|
64996
65362
|
return { status: "enqueued", jobId: fallback.id, payload: spec.payload };
|
|
64997
65363
|
}
|
|
65364
|
+
var SQLITE_BUSY_TIMEOUT_MS = 30000;
|
|
64998
65365
|
var init_db2 = __esm(() => {
|
|
64999
65366
|
init_migrations();
|
|
65000
65367
|
});
|
|
@@ -67127,6 +67494,7 @@ __export(exports_src, {
|
|
|
67127
67494
|
topStepsByTokens: () => topStepsByTokens,
|
|
67128
67495
|
topStepsByDuration: () => topStepsByDuration,
|
|
67129
67496
|
topCacheWasteSteps: () => topCacheWasteSteps,
|
|
67497
|
+
toolSequenceQuery: () => toolSequenceQuery,
|
|
67130
67498
|
toolRollup: () => toolRollup,
|
|
67131
67499
|
todoToolCalls: () => todoToolCalls,
|
|
67132
67500
|
taskStatusIcon: () => taskStatusIcon,
|
|
@@ -67165,6 +67533,7 @@ __export(exports_src, {
|
|
|
67165
67533
|
roleTokenSummary: () => roleTokenSummary,
|
|
67166
67534
|
resolveReportMode: () => resolveReportMode,
|
|
67167
67535
|
resolvePricing: () => resolvePricing,
|
|
67536
|
+
resetHistoryTables: () => resetHistoryTables,
|
|
67168
67537
|
replaceHistoryBoardRollups: () => replaceHistoryBoardRollups,
|
|
67169
67538
|
renderTaskTemplate: () => renderTaskTemplate,
|
|
67170
67539
|
renderScenarioStub: () => renderScenarioStub,
|
|
@@ -67198,6 +67567,8 @@ __export(exports_src, {
|
|
|
67198
67567
|
loops: () => loops,
|
|
67199
67568
|
looksLikeGherkinAc: () => looksLikeGherkinAc,
|
|
67200
67569
|
loadSqlMigrations: () => loadSqlMigrations,
|
|
67570
|
+
loadAttributionEvidence: () => loadAttributionEvidence,
|
|
67571
|
+
listAttributionSessions: () => listAttributionSessions,
|
|
67201
67572
|
isTierEligible: () => isTierEligible,
|
|
67202
67573
|
isStale: () => isStale,
|
|
67203
67574
|
isCompatibleStageVersion: () => isCompatibleStageVersion,
|
|
@@ -67246,6 +67617,7 @@ __export(exports_src, {
|
|
|
67246
67617
|
envelopeLayerSchema: () => envelopeLayerSchema,
|
|
67247
67618
|
enqueueCoalesced: () => enqueueCoalesced,
|
|
67248
67619
|
emptyDerived: () => emptyDerived,
|
|
67620
|
+
emptyAttributionSummary: () => emptyAttributionSummary,
|
|
67249
67621
|
drift: () => drift,
|
|
67250
67622
|
deterministicExecutionSchema: () => deterministicExecutionSchema,
|
|
67251
67623
|
derivedWarnings: () => derivedWarnings,
|
|
@@ -67270,6 +67642,7 @@ __export(exports_src, {
|
|
|
67270
67642
|
computeDerived: () => computeDerived,
|
|
67271
67643
|
computeContentHash: () => computeContentHash,
|
|
67272
67644
|
cleanupTempFiles: () => cleanupTempFiles,
|
|
67645
|
+
classifyTaskAttribution: () => classifyTaskAttribution,
|
|
67273
67646
|
checkLayerStale: () => checkLayerStale,
|
|
67274
67647
|
checkAcCoverage: () => checkAcCoverage,
|
|
67275
67648
|
capabilityTierSchema: () => capabilityTierSchema,
|
|
@@ -67310,6 +67683,7 @@ __export(exports_src, {
|
|
|
67310
67683
|
UNKNOWN_MODEL_PRICING: () => UNKNOWN_MODEL_PRICING,
|
|
67311
67684
|
UNIVERSAL_SECTIONS: () => UNIVERSAL_SECTIONS,
|
|
67312
67685
|
TransitionRunDao: () => TransitionRunDao,
|
|
67686
|
+
TaskSessionDao: () => TaskSessionDao,
|
|
67313
67687
|
TaskRunLinkDao: () => TaskRunLinkDao,
|
|
67314
67688
|
TIER_RANK: () => TIER_RANK,
|
|
67315
67689
|
TASK_VARIANTS: () => TASK_VARIANTS,
|
|
@@ -67353,6 +67727,7 @@ __export(exports_src, {
|
|
|
67353
67727
|
InboxMessageDao: () => InboxMessageDao,
|
|
67354
67728
|
INBOX_MESSAGES_SCHEMA_SQL: () => INBOX_MESSAGES_SCHEMA_SQL,
|
|
67355
67729
|
HISTORY_RUN_SESSION_SCHEMA_SQL: () => HISTORY_RUN_SESSION_SCHEMA_SQL,
|
|
67730
|
+
HISTORY_RESET_TABLES: () => HISTORY_RESET_TABLES,
|
|
67356
67731
|
HISTORY_BOARD_ROLLUPS_SCHEMA_SQL: () => HISTORY_BOARD_ROLLUPS_SCHEMA_SQL,
|
|
67357
67732
|
HISTORY_BOARD_QUERY_INDEXES_SCHEMA_SQL: () => HISTORY_BOARD_QUERY_INDEXES_SCHEMA_SQL,
|
|
67358
67733
|
HISTORY_ARTIFACT_SCHEMA_VERSION: () => HISTORY_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -67379,6 +67754,8 @@ __export(exports_src, {
|
|
|
67379
67754
|
ArtifactDao: () => ArtifactDao,
|
|
67380
67755
|
ActionRunDao: () => ActionRunDao,
|
|
67381
67756
|
AUTHORITY_LANES: () => AUTHORITY_LANES,
|
|
67757
|
+
ATTRIBUTION_SESSION_LIMIT: () => ATTRIBUTION_SESSION_LIMIT,
|
|
67758
|
+
ATTRIBUTION_EVIDENCE_LIMIT: () => ATTRIBUTION_EVIDENCE_LIMIT,
|
|
67382
67759
|
ARTIFACT_DIRECTIONS: () => ARTIFACT_DIRECTIONS,
|
|
67383
67760
|
ARTIFACT_ARRAY_CLASSIFICATION: () => ARTIFACT_ARRAY_CLASSIFICATION,
|
|
67384
67761
|
AGENT_INSTANCES_MIGRATION_ID_DRAFT: () => AGENT_INSTANCES_MIGRATION_ID_DRAFT,
|
|
@@ -70745,6 +71122,9 @@ function checkRowName(row) {
|
|
|
70745
71122
|
function isTaskCheckRow(row) {
|
|
70746
71123
|
return /task[ _-]?check/i.test(checkRowName(row));
|
|
70747
71124
|
}
|
|
71125
|
+
function isHollowMet(row) {
|
|
71126
|
+
return NORM(row.status) === "MET" && !(typeof row.evidence === "string" && row.evidence.trim() !== "");
|
|
71127
|
+
}
|
|
70748
71128
|
function aggregateVerifyVerdict(input) {
|
|
70749
71129
|
const reqs = Array.isArray(input.requirements) ? input.requirements : [];
|
|
70750
71130
|
const acs = Array.isArray(input.acceptanceCriteria) ? input.acceptanceCriteria : [];
|
|
@@ -70768,7 +71148,7 @@ function aggregateVerifyVerdict(input) {
|
|
|
70768
71148
|
}
|
|
70769
71149
|
if (majorBlocked)
|
|
70770
71150
|
return "PARTIAL";
|
|
70771
|
-
if (reqs.some((r) => NORM(r.status) === "PARTIAL") || acs.some((a2) => NORM(a2.status) === "PARTIAL"))
|
|
71151
|
+
if (reqs.some((r) => NORM(r.status) === "PARTIAL" || isHollowMet(r)) || acs.some((a2) => NORM(a2.status) === "PARTIAL" || isHollowMet(a2)))
|
|
70772
71152
|
return "PARTIAL";
|
|
70773
71153
|
if (input.taskCheckPassed === false)
|
|
70774
71154
|
return "PARTIAL";
|
|
@@ -71605,7 +71985,7 @@ function renderReview(v) {
|
|
|
71605
71985
|
} else {
|
|
71606
71986
|
for (const check2 of v.checks) {
|
|
71607
71987
|
const finding = escapeTablePipe(check2.evidence.replace(/\n/g, " "));
|
|
71608
|
-
const priority = /^P[1-4]$/.test(check2.status) ? check2.status : check2.status === "fail" ? "P1" : "P4";
|
|
71988
|
+
const priority = SEVERITY_PRIORITY[check2.severity ?? ""] ?? (/^P[1-4]$/.test(check2.status) ? check2.status : check2.status === "fail" ? "P1" : "P4");
|
|
71609
71989
|
lines.push(`| ${priority} | ${check2.name} | \u2014 | ${finding} |`);
|
|
71610
71990
|
}
|
|
71611
71991
|
}
|
|
@@ -71687,12 +72067,18 @@ function gitDiffU0(cwd) {
|
|
|
71687
72067
|
return "";
|
|
71688
72068
|
}
|
|
71689
72069
|
}
|
|
71690
|
-
var RECORD_REVIEW_MARKER = "<!-- spur:record-review -->", LEGACY_RECORD_REVIEW_RE;
|
|
72070
|
+
var RECORD_REVIEW_MARKER = "<!-- spur:record-review -->", LEGACY_RECORD_REVIEW_RE, SEVERITY_PRIORITY;
|
|
71691
72071
|
var init_task_record = __esm(() => {
|
|
71692
72072
|
init_src2();
|
|
71693
72073
|
init_dist5();
|
|
71694
72074
|
init_verify_verdict();
|
|
71695
72075
|
LEGACY_RECORD_REVIEW_RE = /^\*\*SECU findings\*\* \(pipeline verify step \u2014 verdict: [A-Z]+\)/;
|
|
72076
|
+
SEVERITY_PRIORITY = {
|
|
72077
|
+
blocker: "P1",
|
|
72078
|
+
major: "P2",
|
|
72079
|
+
minor: "P3",
|
|
72080
|
+
advisory: "P4"
|
|
72081
|
+
};
|
|
71696
72082
|
});
|
|
71697
72083
|
|
|
71698
72084
|
// ../../packages/app/src/services/feature-check.ts
|
|
@@ -77183,7 +77569,11 @@ class MockHistoryBoardService {
|
|
|
77183
77569
|
const now2 = new Date("2026-08-21T20:00:00.000Z").getTime();
|
|
77184
77570
|
let minTime = 0;
|
|
77185
77571
|
let maxTime = Number.POSITIVE_INFINITY;
|
|
77186
|
-
if (filter.range === "
|
|
77572
|
+
if (filter.range === "1h") {
|
|
77573
|
+
minTime = now2 - 1 * 3600 * 1000;
|
|
77574
|
+
} else if (filter.range === "4h") {
|
|
77575
|
+
minTime = now2 - 4 * 3600 * 1000;
|
|
77576
|
+
} else if (filter.range === "24h") {
|
|
77187
77577
|
minTime = now2 - 24 * 3600 * 1000;
|
|
77188
77578
|
} else if (filter.range === "7d") {
|
|
77189
77579
|
minTime = now2 - 7 * 86400 * 1000;
|
|
@@ -77248,7 +77638,7 @@ class MockHistoryBoardService {
|
|
|
77248
77638
|
const totalTokensWithCache = totalBilled + totalCacheSaved;
|
|
77249
77639
|
const cacheSavedPercent = totalTokensWithCache > 0 ? Math.round(totalCacheSaved / totalTokensWithCache * 100) : 0;
|
|
77250
77640
|
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;
|
|
77641
|
+
const bucket = filter?.bucket === "auto" || filter?.bucket === undefined ? filter?.range === "1h" ? "5m" : filter?.range === "4h" || filter?.range === "24h" ? "10m" : filter?.range === "7d" ? "30m" : "1d" : filter.bucket;
|
|
77252
77642
|
const bucketInterval = {
|
|
77253
77643
|
"5m": 5 * 60000,
|
|
77254
77644
|
"10m": 10 * 60000,
|
|
@@ -77799,6 +78189,132 @@ System components and dataflow...`,
|
|
|
77799
78189
|
message: `Mock import completed in ${mode} mode: 9 sources checked, 0 new transcripts found.`
|
|
77800
78190
|
};
|
|
77801
78191
|
}
|
|
78192
|
+
async getToolSequence(input) {
|
|
78193
|
+
const sessions = input.mode === "session" ? this.sessions.filter((s3) => s3.id === input.sessionId) : this.filterSessions(input.filter);
|
|
78194
|
+
if (input.mode === "session" && sessions.length === 0) {
|
|
78195
|
+
throw new Error(`History session not found: ${input.sessionId}`);
|
|
78196
|
+
}
|
|
78197
|
+
const rawItems = [];
|
|
78198
|
+
let globalSeq = 1;
|
|
78199
|
+
const defaultMockTools = [
|
|
78200
|
+
{ name: "Glob", cat: "search", dur: 120, args: '{"pattern":"**/*.ts"}' },
|
|
78201
|
+
{ name: "Read", cat: "read", dur: 450, args: '{"file":"src/index.ts"}' },
|
|
78202
|
+
{ name: "Write", cat: "write", dur: 310, args: '{"file":"src/test.ts"}' },
|
|
78203
|
+
{ name: "RunCommand", cat: "bash", dur: 1200, args: '{"cmd":"bun test"}' },
|
|
78204
|
+
{ name: "mcp__context__search", cat: "mcp", dur: 280, args: '{"q":"history"}' }
|
|
78205
|
+
];
|
|
78206
|
+
for (const session4 of sessions) {
|
|
78207
|
+
let toolSeq = 1;
|
|
78208
|
+
for (const [toolName, count3] of Object.entries(session4.toolMix)) {
|
|
78209
|
+
for (let i2 = 0;i2 < count3; i2++) {
|
|
78210
|
+
const preset = defaultMockTools.find((t) => t.name === toolName) ?? {
|
|
78211
|
+
name: toolName,
|
|
78212
|
+
cat: "other",
|
|
78213
|
+
dur: 250,
|
|
78214
|
+
args: `{"action":"${toolName}"}`
|
|
78215
|
+
};
|
|
78216
|
+
const isError = i2 === 0 && session4.errors > 0;
|
|
78217
|
+
rawItems.push({
|
|
78218
|
+
seq: globalSeq++,
|
|
78219
|
+
toolSeq: toolSeq++,
|
|
78220
|
+
ts: new Date(session4.start + toolSeq * 1000).toISOString(),
|
|
78221
|
+
toolName: preset.name,
|
|
78222
|
+
category: preset.cat,
|
|
78223
|
+
status: isError ? "error" : "ok",
|
|
78224
|
+
durationMs: preset.dur,
|
|
78225
|
+
durationSource: "measured",
|
|
78226
|
+
resultBytes: 1024,
|
|
78227
|
+
argsRaw: preset.args,
|
|
78228
|
+
argsDigest: `args(${preset.name})`,
|
|
78229
|
+
errorText: isError ? `Tool execution failed: ${toolName} error` : null,
|
|
78230
|
+
callId: `call-${globalSeq}`,
|
|
78231
|
+
messageHash: `hash-${session4.id}-${toolSeq}`,
|
|
78232
|
+
sessionId: session4.id,
|
|
78233
|
+
source: session4.source,
|
|
78234
|
+
model: session4.model,
|
|
78235
|
+
tokens: {
|
|
78236
|
+
billedTokens: 500,
|
|
78237
|
+
cacheSavedTokens: 400,
|
|
78238
|
+
cacheReadTokens: 400,
|
|
78239
|
+
freshInputTokens: 100,
|
|
78240
|
+
outputTokens: 400
|
|
78241
|
+
}
|
|
78242
|
+
});
|
|
78243
|
+
}
|
|
78244
|
+
}
|
|
78245
|
+
}
|
|
78246
|
+
let filtered = rawItems;
|
|
78247
|
+
if (input.toolNames && input.toolNames.length > 0) {
|
|
78248
|
+
const set2 = new Set(input.toolNames);
|
|
78249
|
+
filtered = filtered.filter((item) => set2.has(item.toolName));
|
|
78250
|
+
}
|
|
78251
|
+
if (input.status && input.status !== "all") {
|
|
78252
|
+
filtered = filtered.filter((item) => item.status === input.status);
|
|
78253
|
+
}
|
|
78254
|
+
if (input.search && input.search.trim().length > 0) {
|
|
78255
|
+
const q = input.search.trim().toLowerCase();
|
|
78256
|
+
filtered = filtered.filter((item) => item.toolName.toLowerCase().includes(q) || (item.argsRaw?.toLowerCase().includes(q) ?? false) || (item.errorText?.toLowerCase().includes(q) ?? false));
|
|
78257
|
+
}
|
|
78258
|
+
const items = filtered.map((item, idx) => ({ ...item, seq: idx + 1 }));
|
|
78259
|
+
let totalDurationMs = 0;
|
|
78260
|
+
let measuredCount = 0;
|
|
78261
|
+
let unmeasuredCount = 0;
|
|
78262
|
+
let errorCount = 0;
|
|
78263
|
+
const uniqueToolsSet = new Set;
|
|
78264
|
+
const sessionsSet = new Set;
|
|
78265
|
+
let billedTokensTotal = 0;
|
|
78266
|
+
let cacheSavedTokensTotal = 0;
|
|
78267
|
+
let cacheReadTokensTotal = 0;
|
|
78268
|
+
let freshInputTokensTotal = 0;
|
|
78269
|
+
let outputTokensTotal = 0;
|
|
78270
|
+
for (const item of items) {
|
|
78271
|
+
uniqueToolsSet.add(item.toolName);
|
|
78272
|
+
sessionsSet.add(item.sessionId);
|
|
78273
|
+
if (item.status === "error")
|
|
78274
|
+
errorCount++;
|
|
78275
|
+
if (item.durationMs != null && item.durationMs > 0) {
|
|
78276
|
+
totalDurationMs += item.durationMs;
|
|
78277
|
+
measuredCount++;
|
|
78278
|
+
} else {
|
|
78279
|
+
unmeasuredCount++;
|
|
78280
|
+
}
|
|
78281
|
+
billedTokensTotal += item.tokens.billedTokens;
|
|
78282
|
+
cacheSavedTokensTotal += item.tokens.cacheSavedTokens;
|
|
78283
|
+
cacheReadTokensTotal += item.tokens.cacheReadTokens;
|
|
78284
|
+
freshInputTokensTotal += item.tokens.freshInputTokens;
|
|
78285
|
+
outputTokensTotal += item.tokens.outputTokens;
|
|
78286
|
+
}
|
|
78287
|
+
const totalCalls = items.length;
|
|
78288
|
+
const errorRate = totalCalls > 0 ? Math.round(errorCount / totalCalls * 1000) / 1000 : 0;
|
|
78289
|
+
const meanDurationMs = measuredCount > 0 ? Math.round(totalDurationMs / measuredCount) : 0;
|
|
78290
|
+
return {
|
|
78291
|
+
mode: input.mode,
|
|
78292
|
+
scope: {
|
|
78293
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
78294
|
+
source: input.mode === "session" ? input.source : null,
|
|
78295
|
+
model: sessions.length === 1 ? sessions[0]?.model ?? null : null,
|
|
78296
|
+
start: items.length > 0 ? items[0]?.ts ?? null : null,
|
|
78297
|
+
end: items.length > 0 ? items[items.length - 1]?.ts ?? null : null,
|
|
78298
|
+
totalCalls,
|
|
78299
|
+
uniqueTools: uniqueToolsSet.size,
|
|
78300
|
+
errorCount,
|
|
78301
|
+
errorRate,
|
|
78302
|
+
totalDurationMs,
|
|
78303
|
+
meanDurationMs,
|
|
78304
|
+
durationUnmeasured: unmeasuredCount,
|
|
78305
|
+
sessionCount: sessionsSet.size,
|
|
78306
|
+
tokens: {
|
|
78307
|
+
billedTokens: billedTokensTotal,
|
|
78308
|
+
cacheSavedTokens: cacheSavedTokensTotal,
|
|
78309
|
+
cacheReadTokens: cacheReadTokensTotal,
|
|
78310
|
+
freshInputTokens: freshInputTokensTotal,
|
|
78311
|
+
outputTokens: outputTokensTotal
|
|
78312
|
+
}
|
|
78313
|
+
},
|
|
78314
|
+
truncated: false,
|
|
78315
|
+
items
|
|
78316
|
+
};
|
|
78317
|
+
}
|
|
77802
78318
|
}
|
|
77803
78319
|
var SOURCES_CATALOG, MODELS_CATALOG, TOOLS_CATALOG, SKILLS_CATALOG;
|
|
77804
78320
|
var init_history_board_mock_service = __esm(() => {
|
|
@@ -77938,7 +78454,11 @@ function toArtifactSelector(filter) {
|
|
|
77938
78454
|
const until = filter.to ?? null;
|
|
77939
78455
|
if (!since && filter.range && filter.range !== "all" && filter.range !== "custom") {
|
|
77940
78456
|
const now2 = Date.now();
|
|
77941
|
-
if (filter.range === "
|
|
78457
|
+
if (filter.range === "1h") {
|
|
78458
|
+
since = new Date(now2 - 1 * 60 * 60 * 1000).toISOString();
|
|
78459
|
+
} else if (filter.range === "4h") {
|
|
78460
|
+
since = new Date(now2 - 4 * 60 * 60 * 1000).toISOString();
|
|
78461
|
+
} else if (filter.range === "24h") {
|
|
77942
78462
|
since = new Date(now2 - 24 * 60 * 60 * 1000).toISOString();
|
|
77943
78463
|
} else if (filter.range === "7d") {
|
|
77944
78464
|
since = new Date(now2 - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
@@ -77958,11 +78478,13 @@ function toArtifactSelector(filter) {
|
|
|
77958
78478
|
taskWbs: null
|
|
77959
78479
|
};
|
|
77960
78480
|
}
|
|
77961
|
-
function resolveBucket(bucket, range = "
|
|
78481
|
+
function resolveBucket(bucket, range = "4h") {
|
|
77962
78482
|
if (bucket && bucket !== "auto") {
|
|
77963
78483
|
return bucket;
|
|
77964
78484
|
}
|
|
77965
|
-
if (range === "
|
|
78485
|
+
if (range === "1h")
|
|
78486
|
+
return "5m";
|
|
78487
|
+
if (range === "4h" || range === "24h")
|
|
77966
78488
|
return "10m";
|
|
77967
78489
|
if (range === "7d")
|
|
77968
78490
|
return "30m";
|
|
@@ -78255,6 +78777,20 @@ function projectSources(sources, daily, databaseBytes) {
|
|
|
78255
78777
|
})
|
|
78256
78778
|
};
|
|
78257
78779
|
}
|
|
78780
|
+
function toolCategory(toolName) {
|
|
78781
|
+
const lower = toolName.toLowerCase();
|
|
78782
|
+
if (/mcp|task|agent|subagent|skill/.test(lower))
|
|
78783
|
+
return "mcp";
|
|
78784
|
+
if (/grep|glob|search|find|webfetch|websearch/.test(lower))
|
|
78785
|
+
return "search";
|
|
78786
|
+
if (/write|edit|patch|apply|notebook/.test(lower))
|
|
78787
|
+
return "write";
|
|
78788
|
+
if (/read|cat|view|open/.test(lower))
|
|
78789
|
+
return "read";
|
|
78790
|
+
if (/bash|shell|exec|run|command|terminal/.test(lower))
|
|
78791
|
+
return "bash";
|
|
78792
|
+
return "other";
|
|
78793
|
+
}
|
|
78258
78794
|
|
|
78259
78795
|
class LiveHistoryBoardService {
|
|
78260
78796
|
deps;
|
|
@@ -78292,7 +78828,7 @@ class LiveHistoryBoardService {
|
|
|
78292
78828
|
};
|
|
78293
78829
|
}
|
|
78294
78830
|
const sel = toArtifactSelector(filter);
|
|
78295
|
-
const bucket = resolveBucket(filter?.bucket, filter?.range ?? "
|
|
78831
|
+
const bucket = resolveBucket(filter?.bucket, filter?.range ?? "4h");
|
|
78296
78832
|
const dimension = filter?.dimension ?? "model";
|
|
78297
78833
|
const exactSummaryRollup = (sel.tools?.length ?? 0) === 0 && (sel.skills?.length ?? 0) === 0;
|
|
78298
78834
|
if (exactSummaryRollup && await historyBoardRollupsFresh(db2)) {
|
|
@@ -78582,6 +79118,178 @@ class LiveHistoryBoardService {
|
|
|
78582
79118
|
blocks: sortedBlocks
|
|
78583
79119
|
};
|
|
78584
79120
|
}
|
|
79121
|
+
static toolCategory(toolName) {
|
|
79122
|
+
const lower = toolName.toLowerCase();
|
|
79123
|
+
if (/mcp|task|agent|subagent|skill/.test(lower))
|
|
79124
|
+
return "mcp";
|
|
79125
|
+
if (/grep|glob|search|find|webfetch|websearch/.test(lower))
|
|
79126
|
+
return "search";
|
|
79127
|
+
if (/write|edit|patch|apply|notebook/.test(lower))
|
|
79128
|
+
return "write";
|
|
79129
|
+
if (/read|cat|view|open/.test(lower))
|
|
79130
|
+
return "read";
|
|
79131
|
+
if (/bash|shell|exec|run|command|terminal/.test(lower))
|
|
79132
|
+
return "bash";
|
|
79133
|
+
return "other";
|
|
79134
|
+
}
|
|
79135
|
+
async getToolSequence(input) {
|
|
79136
|
+
const db2 = await this.resolveDb();
|
|
79137
|
+
if (!db2) {
|
|
79138
|
+
return {
|
|
79139
|
+
mode: input.mode,
|
|
79140
|
+
scope: {
|
|
79141
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
79142
|
+
source: input.mode === "session" ? input.source : null,
|
|
79143
|
+
model: null,
|
|
79144
|
+
start: null,
|
|
79145
|
+
end: null,
|
|
79146
|
+
totalCalls: 0,
|
|
79147
|
+
uniqueTools: 0,
|
|
79148
|
+
errorCount: 0,
|
|
79149
|
+
errorRate: 0,
|
|
79150
|
+
totalDurationMs: 0,
|
|
79151
|
+
meanDurationMs: 0,
|
|
79152
|
+
durationUnmeasured: 0,
|
|
79153
|
+
sessionCount: 0,
|
|
79154
|
+
tokens: {
|
|
79155
|
+
billedTokens: 0,
|
|
79156
|
+
cacheSavedTokens: 0,
|
|
79157
|
+
cacheReadTokens: 0,
|
|
79158
|
+
freshInputTokens: 0,
|
|
79159
|
+
outputTokens: 0
|
|
79160
|
+
}
|
|
79161
|
+
},
|
|
79162
|
+
truncated: false,
|
|
79163
|
+
items: []
|
|
79164
|
+
};
|
|
79165
|
+
}
|
|
79166
|
+
let scope;
|
|
79167
|
+
if (input.mode === "session") {
|
|
79168
|
+
if (input.sessionId === "" || input.sessionId === "unknown" || input.sessionId === "session") {
|
|
79169
|
+
throw new Error(`History session not found: ${input.sessionId || "(empty)"}`);
|
|
79170
|
+
}
|
|
79171
|
+
if (input.source === "" || input.source === "unknown") {
|
|
79172
|
+
throw new Error(`History source not found: ${input.source || "(empty)"}`);
|
|
79173
|
+
}
|
|
79174
|
+
scope = { mode: "session", source: input.source, sessionId: input.sessionId };
|
|
79175
|
+
} else {
|
|
79176
|
+
const sel = toArtifactSelector(input.filter);
|
|
79177
|
+
scope = { mode: "consolidated", sel };
|
|
79178
|
+
}
|
|
79179
|
+
const filters = {
|
|
79180
|
+
toolNames: input.toolNames,
|
|
79181
|
+
status: input.status,
|
|
79182
|
+
search: input.search
|
|
79183
|
+
};
|
|
79184
|
+
const queryResult = await toolSequenceQuery(db2, scope, filters, 5000);
|
|
79185
|
+
const rows = queryResult.rows;
|
|
79186
|
+
let totalDurationMs = 0;
|
|
79187
|
+
let measuredCount = 0;
|
|
79188
|
+
let unmeasuredCount = 0;
|
|
79189
|
+
let errorCount = 0;
|
|
79190
|
+
const uniqueToolsSet = new Set;
|
|
79191
|
+
const sessionsSet = new Set;
|
|
79192
|
+
let freshTokensTotal = 0;
|
|
79193
|
+
let cacheReadTokensTotal = 0;
|
|
79194
|
+
let outputTokensTotal = 0;
|
|
79195
|
+
let firstTs = null;
|
|
79196
|
+
let lastTs = null;
|
|
79197
|
+
let commonModel = null;
|
|
79198
|
+
let modelMixed = false;
|
|
79199
|
+
const items = rows.map((row, index2) => {
|
|
79200
|
+
const category = toolCategory(row.toolName);
|
|
79201
|
+
uniqueToolsSet.add(row.toolName);
|
|
79202
|
+
sessionsSet.add(row.sessionId);
|
|
79203
|
+
if (index2 === 0) {
|
|
79204
|
+
firstTs = row.ts;
|
|
79205
|
+
commonModel = row.model;
|
|
79206
|
+
} else {
|
|
79207
|
+
if (row.model !== commonModel) {
|
|
79208
|
+
modelMixed = true;
|
|
79209
|
+
}
|
|
79210
|
+
}
|
|
79211
|
+
if (row.ts) {
|
|
79212
|
+
lastTs = row.ts;
|
|
79213
|
+
}
|
|
79214
|
+
const isError = row.status === "error";
|
|
79215
|
+
if (isError) {
|
|
79216
|
+
errorCount++;
|
|
79217
|
+
}
|
|
79218
|
+
let durationSource = "unmeasured";
|
|
79219
|
+
if (row.durationMs != null && row.durationMs > 0) {
|
|
79220
|
+
durationSource = "measured";
|
|
79221
|
+
totalDurationMs += row.durationMs;
|
|
79222
|
+
measuredCount++;
|
|
79223
|
+
} else {
|
|
79224
|
+
unmeasuredCount++;
|
|
79225
|
+
}
|
|
79226
|
+
const linkCount = Math.max(row.links, 1);
|
|
79227
|
+
const fresh = (row.inputTokens ?? 0) / linkCount;
|
|
79228
|
+
const cacheRead = (row.cacheReadTokens ?? 0) / linkCount;
|
|
79229
|
+
const output2 = (row.outputTokens ?? 0) / linkCount;
|
|
79230
|
+
const billed = fresh + output2;
|
|
79231
|
+
const cacheSaved = cacheRead;
|
|
79232
|
+
freshTokensTotal += fresh;
|
|
79233
|
+
cacheReadTokensTotal += cacheRead;
|
|
79234
|
+
outputTokensTotal += output2;
|
|
79235
|
+
return {
|
|
79236
|
+
seq: index2 + 1,
|
|
79237
|
+
toolSeq: row.toolSeq,
|
|
79238
|
+
ts: row.ts,
|
|
79239
|
+
toolName: row.toolName,
|
|
79240
|
+
category,
|
|
79241
|
+
status: row.status === "ok" || row.status === "error" ? row.status : "unknown",
|
|
79242
|
+
durationMs: durationSource === "measured" ? row.durationMs : null,
|
|
79243
|
+
durationSource,
|
|
79244
|
+
resultBytes: row.resultBytes,
|
|
79245
|
+
argsRaw: row.argsRaw,
|
|
79246
|
+
argsDigest: row.argsDigest,
|
|
79247
|
+
errorText: row.errorText,
|
|
79248
|
+
callId: row.callId,
|
|
79249
|
+
messageHash: row.messageHash,
|
|
79250
|
+
sessionId: row.sessionId,
|
|
79251
|
+
source: row.source,
|
|
79252
|
+
model: row.model,
|
|
79253
|
+
tokens: {
|
|
79254
|
+
billedTokens: billed,
|
|
79255
|
+
cacheSavedTokens: cacheSaved,
|
|
79256
|
+
cacheReadTokens: cacheRead,
|
|
79257
|
+
freshInputTokens: fresh,
|
|
79258
|
+
outputTokens: output2
|
|
79259
|
+
}
|
|
79260
|
+
};
|
|
79261
|
+
});
|
|
79262
|
+
const totalCalls = rows.length;
|
|
79263
|
+
const errorRate = totalCalls > 0 ? Math.round(errorCount / totalCalls * 1000) / 1000 : 0;
|
|
79264
|
+
const meanDurationMs = measuredCount > 0 ? Math.round(totalDurationMs / measuredCount) : 0;
|
|
79265
|
+
return {
|
|
79266
|
+
mode: input.mode,
|
|
79267
|
+
scope: {
|
|
79268
|
+
sessionId: input.mode === "session" ? input.sessionId : null,
|
|
79269
|
+
source: input.mode === "session" ? input.source : null,
|
|
79270
|
+
model: modelMixed ? null : commonModel,
|
|
79271
|
+
start: firstTs,
|
|
79272
|
+
end: lastTs,
|
|
79273
|
+
totalCalls,
|
|
79274
|
+
uniqueTools: uniqueToolsSet.size,
|
|
79275
|
+
errorCount,
|
|
79276
|
+
errorRate,
|
|
79277
|
+
totalDurationMs,
|
|
79278
|
+
meanDurationMs,
|
|
79279
|
+
durationUnmeasured: unmeasuredCount,
|
|
79280
|
+
sessionCount: sessionsSet.size,
|
|
79281
|
+
tokens: {
|
|
79282
|
+
billedTokens: freshTokensTotal + outputTokensTotal,
|
|
79283
|
+
cacheSavedTokens: cacheReadTokensTotal,
|
|
79284
|
+
cacheReadTokens: cacheReadTokensTotal,
|
|
79285
|
+
freshInputTokens: freshTokensTotal,
|
|
79286
|
+
outputTokens: outputTokensTotal
|
|
79287
|
+
}
|
|
79288
|
+
},
|
|
79289
|
+
truncated: queryResult.truncated,
|
|
79290
|
+
items
|
|
79291
|
+
};
|
|
79292
|
+
}
|
|
78585
79293
|
async getSessions(input) {
|
|
78586
79294
|
const db2 = await this.resolveDb();
|
|
78587
79295
|
if (!db2) {
|
|
@@ -79035,6 +79743,62 @@ var init_history_refresh_service = __esm(() => {
|
|
|
79035
79743
|
init_split_launch_command();
|
|
79036
79744
|
});
|
|
79037
79745
|
|
|
79746
|
+
// ../../packages/app/src/services/task-attribution.ts
|
|
79747
|
+
async function attributeSessions(input) {
|
|
79748
|
+
const dao2 = new TaskSessionDao(input.db);
|
|
79749
|
+
const summary = emptyAttributionSummary();
|
|
79750
|
+
const known = new Map;
|
|
79751
|
+
if (input.reconcile === true && input.dryRun !== true) {
|
|
79752
|
+
await dao2.deleteBySource(input.source);
|
|
79753
|
+
}
|
|
79754
|
+
for (const sessionId of input.sessionIds) {
|
|
79755
|
+
summary.sessionsEvaluated += 1;
|
|
79756
|
+
const evidence = await loadAttributionEvidence(input.db, input.source, sessionId);
|
|
79757
|
+
if (evidence.length === 0)
|
|
79758
|
+
continue;
|
|
79759
|
+
const decision = classifyTaskAttribution(evidence);
|
|
79760
|
+
summary.skippedEvidence += decision.skipped;
|
|
79761
|
+
summary.ambiguousEvidence += decision.ambiguous;
|
|
79762
|
+
for (const candidate of decision.candidates) {
|
|
79763
|
+
let valid = known.get(candidate.wbs);
|
|
79764
|
+
if (valid === undefined) {
|
|
79765
|
+
valid = await input.isKnownWbs(candidate.wbs);
|
|
79766
|
+
known.set(candidate.wbs, valid);
|
|
79767
|
+
}
|
|
79768
|
+
if (!valid) {
|
|
79769
|
+
summary.skippedEvidence += 1;
|
|
79770
|
+
continue;
|
|
79771
|
+
}
|
|
79772
|
+
if (input.dryRun === true) {
|
|
79773
|
+
const present = await dao2.hasLink(candidate.wbs, input.source, sessionId);
|
|
79774
|
+
if (present)
|
|
79775
|
+
summary.linksAlreadyPresent += 1;
|
|
79776
|
+
else
|
|
79777
|
+
summary.linksCreated += 1;
|
|
79778
|
+
continue;
|
|
79779
|
+
}
|
|
79780
|
+
const outcome = await dao2.insert({
|
|
79781
|
+
wbs: candidate.wbs,
|
|
79782
|
+
source: input.source,
|
|
79783
|
+
sessionId,
|
|
79784
|
+
exactness: "estimated",
|
|
79785
|
+
mechanism: candidate.mechanism,
|
|
79786
|
+
evidenceKind: candidate.evidenceKind,
|
|
79787
|
+
evidenceRef: candidate.evidenceRef,
|
|
79788
|
+
resolvedAt: input.resolvedAt
|
|
79789
|
+
});
|
|
79790
|
+
if (outcome === "created")
|
|
79791
|
+
summary.linksCreated += 1;
|
|
79792
|
+
else
|
|
79793
|
+
summary.linksAlreadyPresent += 1;
|
|
79794
|
+
}
|
|
79795
|
+
}
|
|
79796
|
+
return summary;
|
|
79797
|
+
}
|
|
79798
|
+
var init_task_attribution2 = __esm(() => {
|
|
79799
|
+
init_src2();
|
|
79800
|
+
});
|
|
79801
|
+
|
|
79038
79802
|
// ../../packages/app/src/services/verified-outcome.ts
|
|
79039
79803
|
async function deriveVerifiedOutcome(deps, window2 = {}) {
|
|
79040
79804
|
let linkRows;
|
|
@@ -79190,6 +79954,37 @@ import {
|
|
|
79190
79954
|
} from "fs";
|
|
79191
79955
|
import { homedir as homedir5 } from "os";
|
|
79192
79956
|
import { dirname as dirname11, isAbsolute as isAbsolute3, join as join15, resolve as resolve4, sep } from "path";
|
|
79957
|
+
function parseImporterVersion(version3) {
|
|
79958
|
+
if (version3 === undefined) {
|
|
79959
|
+
return null;
|
|
79960
|
+
}
|
|
79961
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version3.trim());
|
|
79962
|
+
if (match === null) {
|
|
79963
|
+
return null;
|
|
79964
|
+
}
|
|
79965
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
79966
|
+
}
|
|
79967
|
+
function compareVersionTriples(a2, b) {
|
|
79968
|
+
for (let i2 = 0;i2 < 3; i2++) {
|
|
79969
|
+
const ai = a2[i2];
|
|
79970
|
+
const bi = b[i2];
|
|
79971
|
+
if (ai !== bi) {
|
|
79972
|
+
return ai < bi ? -1 : 1;
|
|
79973
|
+
}
|
|
79974
|
+
}
|
|
79975
|
+
return 0;
|
|
79976
|
+
}
|
|
79977
|
+
function assertPiImporterSafe(input) {
|
|
79978
|
+
if (input.dryRun || input.mode !== "full" || !input.sources.includes("pi")) {
|
|
79979
|
+
return;
|
|
79980
|
+
}
|
|
79981
|
+
const minSafe = parseImporterVersion(MIN_SAFE_PI_BASH_IMPORTER_VERSION);
|
|
79982
|
+
const installed = parseImporterVersion(input.importerVersion);
|
|
79983
|
+
if (minSafe !== null && installed !== null && compareVersionTriples(installed, minSafe) >= 0) {
|
|
79984
|
+
return;
|
|
79985
|
+
}
|
|
79986
|
+
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");
|
|
79987
|
+
}
|
|
79193
79988
|
async function buildRefreshCoverage(db2, selector, fanOut) {
|
|
79194
79989
|
const statusBySource = new Map(fanOut.entries.map((e) => [e.source, e.status]));
|
|
79195
79990
|
const refreshed = FULL_FIDELITY_SOURCES.filter((s3) => statusBySource.has(s3) && statusBySource.get(s3) !== "failed");
|
|
@@ -79235,6 +80030,8 @@ class HistoryService {
|
|
|
79235
80030
|
const parsedSource = parseSource(source);
|
|
79236
80031
|
const mode = parseMode(opts.mode ?? (opts.file !== undefined ? "force-file" : "incremental"));
|
|
79237
80032
|
const dryRun = opts.dryRun ?? false;
|
|
80033
|
+
assertPiImporterSafe({ importerVersion: this.ctx.importerVersion, mode, dryRun, sources: [parsedSource] });
|
|
80034
|
+
const startedAt = new Date().toISOString();
|
|
79238
80035
|
const db2 = await this.ctx.getDb();
|
|
79239
80036
|
const dao2 = new RunSessionDao(db2);
|
|
79240
80037
|
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 +80059,45 @@ class HistoryService {
|
|
|
79262
80059
|
await dao2.alignMessageProvenance();
|
|
79263
80060
|
await deriveAssistantDurations(db2);
|
|
79264
80061
|
}
|
|
79265
|
-
|
|
80062
|
+
const attribution2 = await this.attributeSource({
|
|
80063
|
+
source: parsedSource,
|
|
80064
|
+
mode: mode === "full" || dryRun ? "all" : "changed",
|
|
80065
|
+
changedSince: startedAt,
|
|
80066
|
+
dryRun
|
|
80067
|
+
});
|
|
80068
|
+
return {
|
|
80069
|
+
...result,
|
|
80070
|
+
attribution: attribution2.summary,
|
|
80071
|
+
...attribution2.error !== null ? { attributionError: attribution2.error } : {}
|
|
80072
|
+
};
|
|
80073
|
+
}
|
|
80074
|
+
async attributeSource(input) {
|
|
80075
|
+
const locator = this.ctx.taskLocator;
|
|
80076
|
+
if (locator === undefined)
|
|
80077
|
+
return { summary: null, error: null };
|
|
80078
|
+
try {
|
|
80079
|
+
const db2 = await this.ctx.getDb();
|
|
80080
|
+
const sessionIds = await listAttributionSessions(db2, input.source, {
|
|
80081
|
+
scope: input.mode === "all" ? "all" : "changed",
|
|
80082
|
+
changedSince: input.changedSince
|
|
80083
|
+
});
|
|
80084
|
+
const summary = await attributeSessions({
|
|
80085
|
+
db: db2,
|
|
80086
|
+
source: input.source,
|
|
80087
|
+
sessionIds,
|
|
80088
|
+
isKnownWbs: async (wbs) => await locator.findByWbs(wbs) !== null,
|
|
80089
|
+
resolvedAt: new Date().toISOString(),
|
|
80090
|
+
dryRun: input.dryRun,
|
|
80091
|
+
reconcile: input.mode === "all" && !input.dryRun
|
|
80092
|
+
});
|
|
80093
|
+
return { summary, error: null };
|
|
80094
|
+
} catch (e) {
|
|
80095
|
+
return { summary: null, error: e.message };
|
|
80096
|
+
}
|
|
80097
|
+
}
|
|
80098
|
+
async resetHistory() {
|
|
80099
|
+
const db2 = await this.ctx.getDb();
|
|
80100
|
+
return resetHistoryTables(db2);
|
|
79266
80101
|
}
|
|
79267
80102
|
async analyze(selector, opts = {}) {
|
|
79268
80103
|
const top = opts.top ?? 20;
|
|
@@ -79394,16 +80229,30 @@ class HistoryService {
|
|
|
79394
80229
|
}
|
|
79395
80230
|
async importAll(opts = {}) {
|
|
79396
80231
|
const sources = (opts.sources ?? SOURCES).map((s3) => parseSource(s3));
|
|
80232
|
+
assertPiImporterSafe({
|
|
80233
|
+
importerVersion: this.ctx.importerVersion,
|
|
80234
|
+
mode: opts.mode ?? (opts.file !== undefined && opts.file.length > 0 ? "force-file" : "incremental"),
|
|
80235
|
+
dryRun: opts.dryRun === true,
|
|
80236
|
+
sources
|
|
80237
|
+
});
|
|
79397
80238
|
const timeoutMs = opts.sourceTimeout ?? DEFAULT_SOURCE_TIMEOUT_MS;
|
|
79398
80239
|
const entries = [];
|
|
79399
80240
|
const warnings = [];
|
|
80241
|
+
const attribution2 = emptyAttributionSummary();
|
|
79400
80242
|
const runStartedAt = new Date().toISOString();
|
|
79401
80243
|
for (const source of sources) {
|
|
79402
|
-
const { coverageEntry, sourceWarnings } = await this.importOneIsolated(source, opts, timeoutMs, runStartedAt);
|
|
80244
|
+
const { coverageEntry, sourceWarnings, sourceAttribution } = await this.importOneIsolated(source, opts, timeoutMs, runStartedAt);
|
|
79403
80245
|
entries.push(coverageEntry);
|
|
79404
80246
|
warnings.push(...sourceWarnings);
|
|
80247
|
+
if (sourceAttribution !== null) {
|
|
80248
|
+
attribution2.sessionsEvaluated += sourceAttribution.sessionsEvaluated;
|
|
80249
|
+
attribution2.linksCreated += sourceAttribution.linksCreated;
|
|
80250
|
+
attribution2.linksAlreadyPresent += sourceAttribution.linksAlreadyPresent;
|
|
80251
|
+
attribution2.skippedEvidence += sourceAttribution.skippedEvidence;
|
|
80252
|
+
attribution2.ambiguousEvidence += sourceAttribution.ambiguousEvidence;
|
|
80253
|
+
}
|
|
79405
80254
|
}
|
|
79406
|
-
return { entries, exitCode: computeExitCode(entries), warnings };
|
|
80255
|
+
return { entries, exitCode: computeExitCode(entries), warnings, attribution: attribution2 };
|
|
79407
80256
|
}
|
|
79408
80257
|
async daily(opts = {}) {
|
|
79409
80258
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -79478,6 +80327,13 @@ class HistoryService {
|
|
|
79478
80327
|
detail: `source '${source}' previously had checkpoint rows but discovered 0 files`
|
|
79479
80328
|
});
|
|
79480
80329
|
}
|
|
80330
|
+
if (result.attributionError != null) {
|
|
80331
|
+
sourceWarnings.push({
|
|
80332
|
+
code: "attribution-failed",
|
|
80333
|
+
source,
|
|
80334
|
+
detail: `task attribution failed: ${result.attributionError}`
|
|
80335
|
+
});
|
|
80336
|
+
}
|
|
79481
80337
|
const toolCalls = opts.dryRun ? 0 : await countToolCallsSince(db2, source, runStartedAt);
|
|
79482
80338
|
const coverageEntry = {
|
|
79483
80339
|
source,
|
|
@@ -79493,7 +80349,7 @@ class HistoryService {
|
|
|
79493
80349
|
validationErrorSamples: result.validationErrors.slice(0, MAX_ERROR_SAMPLES2).map(formatIssue),
|
|
79494
80350
|
...result.reconciliation ? { reconciliation: result.reconciliation } : {}
|
|
79495
80351
|
};
|
|
79496
|
-
return { coverageEntry, sourceWarnings };
|
|
80352
|
+
return { coverageEntry, sourceWarnings, sourceAttribution: result.attribution ?? null };
|
|
79497
80353
|
} catch (e) {
|
|
79498
80354
|
const detail = e.message;
|
|
79499
80355
|
sourceWarnings.push({ code: "source-failed", source, detail });
|
|
@@ -79511,7 +80367,8 @@ class HistoryService {
|
|
|
79511
80367
|
parseErrorSamples: [],
|
|
79512
80368
|
validationErrorSamples: []
|
|
79513
80369
|
},
|
|
79514
|
-
sourceWarnings
|
|
80370
|
+
sourceWarnings,
|
|
80371
|
+
sourceAttribution: null
|
|
79515
80372
|
};
|
|
79516
80373
|
}
|
|
79517
80374
|
}
|
|
@@ -79799,13 +80656,25 @@ function pruneReports(cwd, retentionDays = REPORT_RETENTION_DAYS, now2 = new Dat
|
|
|
79799
80656
|
}
|
|
79800
80657
|
return pruned.sort((a2, b) => a2.localeCompare(b));
|
|
79801
80658
|
}
|
|
79802
|
-
var SOURCES, FULL_FIDELITY_SOURCES, DEFERRED_SOURCES, MODES, MAX_ERROR_SAMPLES2 = 20, DEFAULT_SOURCE_TIMEOUT_MS = 600000, REPORT_RETENTION_DAYS = 90;
|
|
80659
|
+
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
80660
|
var init_history_service = __esm(() => {
|
|
79804
80661
|
init_src2();
|
|
79805
80662
|
init_dist8();
|
|
79806
80663
|
init_agent_service();
|
|
79807
80664
|
init_history_analysis_service();
|
|
80665
|
+
init_task_attribution2();
|
|
79808
80666
|
init_verified_outcome();
|
|
80667
|
+
UnsafeHistoryImporterError = class UnsafeHistoryImporterError extends Error {
|
|
80668
|
+
installedVersion;
|
|
80669
|
+
minSafeVersion;
|
|
80670
|
+
code = "unsafe-history-importer";
|
|
80671
|
+
constructor(message, installedVersion, minSafeVersion = MIN_SAFE_PI_BASH_IMPORTER_VERSION) {
|
|
80672
|
+
super(message);
|
|
80673
|
+
this.installedVersion = installedVersion;
|
|
80674
|
+
this.minSafeVersion = minSafeVersion;
|
|
80675
|
+
this.name = "UnsafeHistoryImporterError";
|
|
80676
|
+
}
|
|
80677
|
+
};
|
|
79809
80678
|
SOURCES = [
|
|
79810
80679
|
"pi",
|
|
79811
80680
|
"claude",
|
|
@@ -83371,7 +84240,7 @@ function deriveVerdict(answerText, taskCheckPassed) {
|
|
|
83371
84240
|
const requirements = extractRequirements(answerText);
|
|
83372
84241
|
const parsedAc = extractAcceptanceCriteria(answerText);
|
|
83373
84242
|
const acceptanceCriteria = applyAcceptanceCriteriaEvidenceRule(parsedAc.rows);
|
|
83374
|
-
const checks4 = extractChecks(answerText, taskCheckPassed, acceptanceCriteria, parsedAc.dropped);
|
|
84243
|
+
const checks4 = extractChecks(answerText, taskCheckPassed, requirements, acceptanceCriteria, parsedAc.dropped);
|
|
83375
84244
|
if (requirements.length === 0) {
|
|
83376
84245
|
return { verdict: "UNKNOWN", requirements, acceptanceCriteria, checks: checks4 };
|
|
83377
84246
|
}
|
|
@@ -83478,16 +84347,17 @@ function extractAcceptanceCriteria(text4) {
|
|
|
83478
84347
|
}
|
|
83479
84348
|
if (/^[-:]+$/.test(cells[0] ?? ""))
|
|
83480
84349
|
continue;
|
|
83481
|
-
if (inTable && cells.length >=
|
|
84350
|
+
if (inTable && cells.length >= 3) {
|
|
83482
84351
|
const id = cells[0] ?? "";
|
|
83483
84352
|
const statusRaw = cells[1] ?? "";
|
|
83484
84353
|
const evidenceTypeRaw = cells[2] ?? "";
|
|
83485
84354
|
const status = normalizeAcceptanceCriteriaStatus(statusRaw);
|
|
83486
84355
|
const evidenceType = normalizeEvidenceType(evidenceTypeRaw);
|
|
84356
|
+
const acShaped = cells.length >= 4 || id.length > 0 && status !== null;
|
|
83487
84357
|
const evidence = cells[3] ?? "";
|
|
83488
|
-
if (status !== null && evidenceType !== null && id.length > 0) {
|
|
84358
|
+
if (acShaped && status !== null && evidenceType !== null && id.length > 0) {
|
|
83489
84359
|
rows.push({ id, status, evidenceType, evidence });
|
|
83490
|
-
} else if (id.length > 0) {
|
|
84360
|
+
} else if (acShaped && id.length > 0) {
|
|
83491
84361
|
dropped.push(evidenceType === null && status !== null ? `${id} (unrecognised evidence type "${evidenceTypeRaw}")` : `${id} (unrecognised status "${statusRaw}")`);
|
|
83492
84362
|
}
|
|
83493
84363
|
}
|
|
@@ -83547,7 +84417,7 @@ function requiresExecutableEvidence(id) {
|
|
|
83547
84417
|
const nonBehavior = normalized.includes("[non-behavior]") || normalized.includes("[docs-only]") || normalized.includes("[doc-only]");
|
|
83548
84418
|
return !nonCore && !nonBehavior;
|
|
83549
84419
|
}
|
|
83550
|
-
function extractChecks(_text, taskCheckPassed, acceptanceCriteria, droppedAcRows = []) {
|
|
84420
|
+
function extractChecks(_text, taskCheckPassed, requirements, acceptanceCriteria, droppedAcRows = []) {
|
|
83551
84421
|
const checks4 = [
|
|
83552
84422
|
{
|
|
83553
84423
|
name: "spur task check",
|
|
@@ -83586,6 +84456,18 @@ function extractChecks(_text, taskCheckPassed, acceptanceCriteria, droppedAcRows
|
|
|
83586
84456
|
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
84457
|
});
|
|
83588
84458
|
}
|
|
84459
|
+
const hollowMet = [
|
|
84460
|
+
...requirements.filter((r) => r.status === "MET" && r.evidence.trim() === "").map((r) => r.id),
|
|
84461
|
+
...acceptanceCriteria.filter((r) => r.status === "MET" && r.evidence.trim() === "").map((r) => r.id)
|
|
84462
|
+
];
|
|
84463
|
+
if (hollowMet.length > 0) {
|
|
84464
|
+
checks4.push({
|
|
84465
|
+
name: "hollow-met-evidence",
|
|
84466
|
+
status: "fail",
|
|
84467
|
+
severity: "major",
|
|
84468
|
+
evidence: `${hollowMet.length} MET row(s) carry no recorded evidence and cannot support PASS: ` + `${hollowMet.join(", ")}. Re-run verify with populated evidence per row.`
|
|
84469
|
+
});
|
|
84470
|
+
}
|
|
83589
84471
|
if (acceptanceCriteria.length > 0) {
|
|
83590
84472
|
const downgraded = acceptanceCriteria.filter((row) => row.status === "PARTIAL" && requiresExecutableEvidence(row.id) && row.evidenceType !== "test" && row.evidenceType !== "command");
|
|
83591
84473
|
checks4.push({
|
|
@@ -89091,6 +89973,7 @@ __export(exports_src2, {
|
|
|
89091
89973
|
parseSteeringPolicy: () => parseSteeringPolicy,
|
|
89092
89974
|
parsePsOutput: () => parsePsOutput,
|
|
89093
89975
|
parseLedgerLine: () => parseLedgerLine,
|
|
89976
|
+
parseImporterVersion: () => parseImporterVersion,
|
|
89094
89977
|
parseHistoryRefreshContext: () => parseHistoryRefreshContext,
|
|
89095
89978
|
parseEtimeToSeconds: () => parseEtimeToSeconds,
|
|
89096
89979
|
normalizeSystemEventPayload: () => normalizeSystemEventPayload,
|
|
@@ -89156,6 +90039,8 @@ __export(exports_src2, {
|
|
|
89156
90039
|
buildEscalationPacket: () => buildEscalationPacket,
|
|
89157
90040
|
bridgeEventBus: () => bridgeEventBus,
|
|
89158
90041
|
baselineSeverity: () => baselineSeverity,
|
|
90042
|
+
attributeSessions: () => attributeSessions,
|
|
90043
|
+
assertPiImporterSafe: () => assertPiImporterSafe,
|
|
89159
90044
|
anchorQualify: () => anchorQualify,
|
|
89160
90045
|
aggregateBatchVerdicts: () => aggregateBatchVerdicts,
|
|
89161
90046
|
_resetAgentServiceShimsForTest: () => _resetAgentServiceShimsForTest,
|
|
@@ -89166,6 +90051,7 @@ __export(exports_src2, {
|
|
|
89166
90051
|
WbsCollisionError: () => WbsCollisionError,
|
|
89167
90052
|
WaitError: () => WaitError,
|
|
89168
90053
|
UnsupportedProcessPlatformError: () => UnsupportedProcessPlatformError,
|
|
90054
|
+
UnsafeHistoryImporterError: () => UnsafeHistoryImporterError,
|
|
89169
90055
|
TokenLedgerWatcher: () => TokenLedgerWatcher,
|
|
89170
90056
|
TokenLedgerService: () => TokenLedgerService,
|
|
89171
90057
|
TeamService: () => TeamService,
|
|
@@ -89212,6 +90098,7 @@ __export(exports_src2, {
|
|
|
89212
90098
|
PLANNING_EVENT_NAMES: () => PLANNING_EVENT_NAMES,
|
|
89213
90099
|
ObservableWorkflowAdapter: () => ObservableWorkflowAdapter,
|
|
89214
90100
|
MockHistoryBoardService: () => MockHistoryBoardService,
|
|
90101
|
+
MIN_SAFE_PI_BASH_IMPORTER_VERSION: () => MIN_SAFE_PI_BASH_IMPORTER_VERSION,
|
|
89215
90102
|
LockTimeoutError: () => LockTimeoutError,
|
|
89216
90103
|
LiveHistoryBoardService: () => LiveHistoryBoardService,
|
|
89217
90104
|
LifecycleAdapter: () => LifecycleAdapter,
|
|
@@ -89291,6 +90178,7 @@ var init_src3 = __esm(async () => {
|
|
|
89291
90178
|
init_system_event_follow();
|
|
89292
90179
|
init_system_event_retention();
|
|
89293
90180
|
init_system_event_tap();
|
|
90181
|
+
init_task_attribution2();
|
|
89294
90182
|
init_task_check();
|
|
89295
90183
|
init_task_locator();
|
|
89296
90184
|
init_task_record();
|
|
@@ -89399,19 +90287,19 @@ var {
|
|
|
89399
90287
|
// src/index.ts
|
|
89400
90288
|
init_loader();
|
|
89401
90289
|
|
|
89402
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90290
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
89403
90291
|
init_dist4();
|
|
89404
90292
|
init_dist5();
|
|
89405
90293
|
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
|
|
89406
90294
|
import { dirname as dirname5 } from "path";
|
|
89407
90295
|
|
|
89408
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90296
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
89409
90297
|
init_default_observers();
|
|
89410
90298
|
init_event_bus();
|
|
89411
90299
|
init_file_observer();
|
|
89412
90300
|
init_logger3();
|
|
89413
90301
|
|
|
89414
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90302
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/scheduler/noop.js
|
|
89415
90303
|
class NoopSchedulerAdapter {
|
|
89416
90304
|
constructor() {}
|
|
89417
90305
|
register(_cron, _action) {}
|
|
@@ -89419,7 +90307,7 @@ class NoopSchedulerAdapter {
|
|
|
89419
90307
|
async stop() {}
|
|
89420
90308
|
}
|
|
89421
90309
|
|
|
89422
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90310
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/scheduler/factory.js
|
|
89423
90311
|
function initScheduler(adapter, cronEntries) {
|
|
89424
90312
|
const resolved = adapter ?? new NoopSchedulerAdapter;
|
|
89425
90313
|
if (cronEntries) {
|
|
@@ -89430,7 +90318,7 @@ function initScheduler(adapter, cronEntries) {
|
|
|
89430
90318
|
return resolved;
|
|
89431
90319
|
}
|
|
89432
90320
|
|
|
89433
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90321
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application/plugins/builtins.js
|
|
89434
90322
|
init_logger3();
|
|
89435
90323
|
init_metrics();
|
|
89436
90324
|
init_sdk();
|
|
@@ -89523,7 +90411,7 @@ function dbPlugin(db2) {
|
|
|
89523
90411
|
};
|
|
89524
90412
|
}
|
|
89525
90413
|
|
|
89526
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90414
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application/plugins/host.js
|
|
89527
90415
|
init_logger3();
|
|
89528
90416
|
|
|
89529
90417
|
class PluginHost {
|
|
@@ -89611,7 +90499,7 @@ class PluginHost {
|
|
|
89611
90499
|
}
|
|
89612
90500
|
}
|
|
89613
90501
|
|
|
89614
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90502
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application/index.js
|
|
89615
90503
|
async function performShutdown(state, reason) {
|
|
89616
90504
|
if (state.stopped)
|
|
89617
90505
|
return;
|
|
@@ -89722,10 +90610,10 @@ async function runApplication(options) {
|
|
|
89722
90610
|
}
|
|
89723
90611
|
}
|
|
89724
90612
|
|
|
89725
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90613
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
89726
90614
|
init_scheduler_node();
|
|
89727
90615
|
|
|
89728
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
90616
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
89729
90617
|
var import_api14 = __toESM(require_src(), 1);
|
|
89730
90618
|
|
|
89731
90619
|
// ../../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 +93629,7 @@ class OTLPTraceExporter extends import_otlp_exporter_base2.OTLPExporterBase {
|
|
|
92741
93629
|
}), JsonTraceSerializer));
|
|
92742
93630
|
}
|
|
92743
93631
|
}
|
|
92744
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
93632
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/telemetry/otel-node.js
|
|
92745
93633
|
var import_resources2 = __toESM(require_src4(), 1);
|
|
92746
93634
|
var import_sdk_trace_node = __toESM(require_src8(), 1);
|
|
92747
93635
|
var import_semantic_conventions = __toESM(require_src2(), 1);
|
|
@@ -92792,7 +93680,7 @@ async function shutdownNodeTelemetry() {
|
|
|
92792
93680
|
await Promise.all(pending);
|
|
92793
93681
|
}
|
|
92794
93682
|
|
|
92795
|
-
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.
|
|
93683
|
+
// ../../node_modules/.bun/@gobing-ai+ts-infra@0.4.49+8b32b93dff378592/node_modules/@gobing-ai/ts-infra/dist/application-node.js
|
|
92796
93684
|
class ConfigValidationError extends Error {
|
|
92797
93685
|
constructor(message) {
|
|
92798
93686
|
super(message);
|
|
@@ -98227,7 +99115,7 @@ import { createRequire } from "module";
|
|
|
98227
99115
|
var CLI_CONFIG = {
|
|
98228
99116
|
binaryName: "spur",
|
|
98229
99117
|
binaryLabel: "spur",
|
|
98230
|
-
binaryVersion: "0.3.
|
|
99118
|
+
binaryVersion: "0.3.70",
|
|
98231
99119
|
configDir: ".spur",
|
|
98232
99120
|
configFile: ".spur/config.yaml",
|
|
98233
99121
|
databaseFile: ".spur/spur.db"
|
|
@@ -98264,10 +99152,12 @@ function registerHistoryCommand(program2, context4) {
|
|
|
98264
99152
|
} catch {
|
|
98265
99153
|
taskLocator = undefined;
|
|
98266
99154
|
}
|
|
99155
|
+
const provenance = await resolveImportProvenance(context4.fs);
|
|
98267
99156
|
return new HistoryService({
|
|
98268
99157
|
getDb: () => context4.getDb(),
|
|
98269
99158
|
agentConfig: context4.agentConfig,
|
|
98270
99159
|
...taskLocator ? { taskLocator } : {},
|
|
99160
|
+
importerVersion: provenance.importer,
|
|
98271
99161
|
fs: context4.fs,
|
|
98272
99162
|
cwd: context4.cwd
|
|
98273
99163
|
});
|
|
@@ -98311,14 +99201,36 @@ function registerHistoryCommand(program2, context4) {
|
|
|
98311
99201
|
return;
|
|
98312
99202
|
}
|
|
98313
99203
|
const svc = await makeService2();
|
|
98314
|
-
|
|
98315
|
-
|
|
98316
|
-
|
|
98317
|
-
|
|
98318
|
-
|
|
98319
|
-
|
|
98320
|
-
|
|
98321
|
-
|
|
99204
|
+
let fanOut;
|
|
99205
|
+
try {
|
|
99206
|
+
fanOut = await svc.importAll({
|
|
99207
|
+
sources: source === "all" ? undefined : [source],
|
|
99208
|
+
file: options.file || undefined,
|
|
99209
|
+
root: options.root || undefined,
|
|
99210
|
+
mode,
|
|
99211
|
+
dryRun: options.dryRun === true,
|
|
99212
|
+
sourceTimeout
|
|
99213
|
+
});
|
|
99214
|
+
} catch (e) {
|
|
99215
|
+
if (e instanceof UnsafeHistoryImporterError) {
|
|
99216
|
+
const msg = `spur history import: ${e.code}: ${e.message}`;
|
|
99217
|
+
context4.output.write(options.json ? toEnvelopeJson({ status: "error", message: msg }, {
|
|
99218
|
+
enveloped: options.jsonEnvelope,
|
|
99219
|
+
error: {
|
|
99220
|
+
code: "INTERNAL_ERROR",
|
|
99221
|
+
message: msg,
|
|
99222
|
+
details: {
|
|
99223
|
+
cliCode: e.code,
|
|
99224
|
+
installedVersion: e.installedVersion,
|
|
99225
|
+
minSafeVersion: e.minSafeVersion
|
|
99226
|
+
}
|
|
99227
|
+
}
|
|
99228
|
+
}) : msg);
|
|
99229
|
+
context4.setExitCode(1);
|
|
99230
|
+
return;
|
|
99231
|
+
}
|
|
99232
|
+
throw e;
|
|
99233
|
+
}
|
|
98322
99234
|
const provenance = await resolveImportProvenance(context4.fs);
|
|
98323
99235
|
context4.output.write(options.json ? toEnvelopeJson({ ...fanOut, provenance }, { enveloped: options.jsonEnvelope }) : `${formatProvenance(provenance)}
|
|
98324
99236
|
${formatFanOutResult(fanOut)}`);
|
|
@@ -98348,6 +99260,29 @@ ${formatFanOutResult(fanOut)}`);
|
|
|
98348
99260
|
daily: artifact.daily
|
|
98349
99261
|
}));
|
|
98350
99262
|
});
|
|
99263
|
+
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) => {
|
|
99264
|
+
if (!options.yes) {
|
|
99265
|
+
context4.output.write(options.json ? toEnvelopeJson({ status: "error", message: "Refusing to wipe history tables without --yes." }, {
|
|
99266
|
+
enveloped: options.jsonEnvelope,
|
|
99267
|
+
error: {
|
|
99268
|
+
code: "INTERNAL_ERROR",
|
|
99269
|
+
message: "Refusing to wipe history tables without --yes.",
|
|
99270
|
+
details: { cliCode: "usage" }
|
|
99271
|
+
}
|
|
99272
|
+
}) : "spur history reset: refusing to wipe history tables without --yes.");
|
|
99273
|
+
context4.setExitCode(1);
|
|
99274
|
+
return;
|
|
99275
|
+
}
|
|
99276
|
+
const svc = await makeService2();
|
|
99277
|
+
const result = await svc.resetHistory();
|
|
99278
|
+
const note = result.unknown.length > 0 ? ` WARNING: ${result.unknown.length} unlisted history_* table(s) left intact: ${result.unknown.join(", ")}` : "";
|
|
99279
|
+
context4.output.write(options.json ? toEnvelopeJson({
|
|
99280
|
+
cleared: result.cleared,
|
|
99281
|
+
skipped: result.skipped,
|
|
99282
|
+
unknown: result.unknown,
|
|
99283
|
+
clearedCount: result.cleared.length
|
|
99284
|
+
}, { enveloped: options.jsonEnvelope }) : `cleared ${result.cleared.length} history tables` + (result.skipped.length > 0 ? ` (${result.skipped.length} not present)` : "") + note);
|
|
99285
|
+
});
|
|
98351
99286
|
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
99287
|
try {
|
|
98353
99288
|
const top = parseTopOrThrow(options.top);
|
|
@@ -98522,6 +99457,8 @@ function formatFanOutResult(r) {
|
|
|
98522
99457
|
for (const e of r.entries) {
|
|
98523
99458
|
lines.push(` ${e.source}: ${e.status} (files=${e.files} scanned, new-messages=${e.messages}, tool-calls=${e.toolCalls})`);
|
|
98524
99459
|
}
|
|
99460
|
+
const a2 = r.attribution;
|
|
99461
|
+
lines.push(`attribution: sessions=${a2.sessionsEvaluated} links-created=${a2.linksCreated} ` + `links-present=${a2.linksAlreadyPresent} skipped=${a2.skippedEvidence} ambiguous=${a2.ambiguousEvidence}`);
|
|
98525
99462
|
if (r.warnings.length > 0) {
|
|
98526
99463
|
lines.push("warnings:");
|
|
98527
99464
|
for (const w of r.warnings) {
|
|
@@ -98544,6 +99481,8 @@ function formatDailyResult(r) {
|
|
|
98544
99481
|
lines.push(` [${w.code}] ${w.source ?? "-"}: ${w.detail}`);
|
|
98545
99482
|
}
|
|
98546
99483
|
}
|
|
99484
|
+
const a2 = r.fanOut.attribution;
|
|
99485
|
+
lines.push(`attribution: sessions=${a2.sessionsEvaluated} links-created=${a2.linksCreated} ` + `links-present=${a2.linksAlreadyPresent} skipped=${a2.skippedEvidence} ambiguous=${a2.ambiguousEvidence}`);
|
|
98547
99486
|
lines.push(`artifact totals: messages=${r.artifact.totals.messages} toolCalls=${r.artifact.totals.toolCalls}`);
|
|
98548
99487
|
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
99488
|
if (r.reportPath !== undefined) {
|
|
@@ -105595,11 +106534,11 @@ var featureContract = {
|
|
|
105595
106534
|
|
|
105596
106535
|
// ../../packages/contracts/src/history.ts
|
|
105597
106536
|
init_zod();
|
|
105598
|
-
var historyRangeEnum = exports_external.enum(["24h", "7d", "30d", "all", "custom"]);
|
|
106537
|
+
var historyRangeEnum = exports_external.enum(["1h", "4h", "24h", "7d", "30d", "all", "custom"]);
|
|
105599
106538
|
var historyBucketEnum = exports_external.enum(["auto", "5m", "10m", "30m", "1h", "4h", "1d"]);
|
|
105600
106539
|
var historyDimensionEnum = exports_external.enum(["model", "source", "tool", "skill"]);
|
|
105601
106540
|
var historyFilterSchema = exports_external.object({
|
|
105602
|
-
range: historyRangeEnum.default("
|
|
106541
|
+
range: historyRangeEnum.default("4h"),
|
|
105603
106542
|
from: exports_external.string().datetime().optional(),
|
|
105604
106543
|
to: exports_external.string().datetime().optional(),
|
|
105605
106544
|
sources: exports_external.array(exports_external.string()).optional(),
|
|
@@ -105779,6 +106718,59 @@ var historySessionsInputSchema = exports_external.object({
|
|
|
105779
106718
|
sortBy: exports_external.enum(["start", "duration", "messages", "toolCalls", "billedTokens", "cacheRead", "freshInput"]).default("start"),
|
|
105780
106719
|
sortDir: exports_external.enum(["asc", "desc"]).default("desc")
|
|
105781
106720
|
});
|
|
106721
|
+
var historyToolCategoryEnum = exports_external.enum(["read", "write", "bash", "search", "mcp", "other"]);
|
|
106722
|
+
var historyToolStatusFilterEnum = exports_external.enum(["all", "ok", "error"]);
|
|
106723
|
+
var historyToolCallItemSchema = exports_external.object({
|
|
106724
|
+
seq: exports_external.number(),
|
|
106725
|
+
toolSeq: exports_external.number(),
|
|
106726
|
+
ts: exports_external.string().nullable(),
|
|
106727
|
+
toolName: exports_external.string(),
|
|
106728
|
+
category: historyToolCategoryEnum,
|
|
106729
|
+
status: exports_external.enum(["ok", "error", "unknown"]),
|
|
106730
|
+
durationMs: exports_external.number().nullable(),
|
|
106731
|
+
durationSource: historyDurationSourceEnum,
|
|
106732
|
+
resultBytes: exports_external.number().nullable(),
|
|
106733
|
+
argsRaw: exports_external.string().nullable(),
|
|
106734
|
+
argsDigest: exports_external.string().nullable(),
|
|
106735
|
+
errorText: exports_external.string().nullable(),
|
|
106736
|
+
callId: exports_external.string().nullable(),
|
|
106737
|
+
messageHash: exports_external.string(),
|
|
106738
|
+
sessionId: exports_external.string(),
|
|
106739
|
+
source: exports_external.string(),
|
|
106740
|
+
model: exports_external.string().nullable(),
|
|
106741
|
+
tokens: historyTokensSchema
|
|
106742
|
+
});
|
|
106743
|
+
var historyToolSequenceScopeSchema = exports_external.object({
|
|
106744
|
+
sessionId: exports_external.string().nullable(),
|
|
106745
|
+
source: exports_external.string().nullable(),
|
|
106746
|
+
model: exports_external.string().nullable(),
|
|
106747
|
+
start: exports_external.string().nullable(),
|
|
106748
|
+
end: exports_external.string().nullable(),
|
|
106749
|
+
totalCalls: exports_external.number(),
|
|
106750
|
+
uniqueTools: exports_external.number(),
|
|
106751
|
+
errorCount: exports_external.number(),
|
|
106752
|
+
errorRate: exports_external.number(),
|
|
106753
|
+
totalDurationMs: exports_external.number(),
|
|
106754
|
+
meanDurationMs: exports_external.number(),
|
|
106755
|
+
durationUnmeasured: exports_external.number(),
|
|
106756
|
+
sessionCount: exports_external.number(),
|
|
106757
|
+
tokens: historyTokensSchema
|
|
106758
|
+
});
|
|
106759
|
+
var historyToolSequenceInputSchema = exports_external.intersection(exports_external.discriminatedUnion("mode", [
|
|
106760
|
+
exports_external.object({ mode: exports_external.literal("session"), source: exports_external.string().min(1), sessionId: exports_external.string().min(1) }),
|
|
106761
|
+
exports_external.object({ mode: exports_external.literal("consolidated"), filter: historyFilterSchema.optional() })
|
|
106762
|
+
]), exports_external.object({
|
|
106763
|
+
toolNames: exports_external.array(exports_external.string()).optional(),
|
|
106764
|
+
status: historyToolStatusFilterEnum.default("all"),
|
|
106765
|
+
search: exports_external.string().optional()
|
|
106766
|
+
}));
|
|
106767
|
+
var historyToolSequenceResponseDataSchema = exports_external.object({
|
|
106768
|
+
mode: exports_external.enum(["session", "consolidated"]),
|
|
106769
|
+
scope: historyToolSequenceScopeSchema,
|
|
106770
|
+
truncated: exports_external.boolean(),
|
|
106771
|
+
items: exports_external.array(historyToolCallItemSchema)
|
|
106772
|
+
});
|
|
106773
|
+
var historyToolSequenceResponseSchema = apiSuccessSchema(historyToolSequenceResponseDataSchema);
|
|
105782
106774
|
var historyLoopFindingSchema = exports_external.object({
|
|
105783
106775
|
tool: exports_external.string(),
|
|
105784
106776
|
argsHint: exports_external.string(),
|
|
@@ -105895,6 +106887,12 @@ var historyContract = {
|
|
|
105895
106887
|
summary: "Get chronological session or consolidated execution timeline",
|
|
105896
106888
|
tags: ["history"]
|
|
105897
106889
|
}).input(historyTimelineInputSchema).output(historyTimelineResponseSchema),
|
|
106890
|
+
getToolSequence: oc.route({
|
|
106891
|
+
method: "POST",
|
|
106892
|
+
path: "/history/tool-sequence",
|
|
106893
|
+
summary: "Get ordered tool invocation sequence for a session or filtered scope",
|
|
106894
|
+
tags: ["history"]
|
|
106895
|
+
}).input(historyToolSequenceInputSchema).output(historyToolSequenceResponseSchema),
|
|
105898
106896
|
getSessions: oc.route({
|
|
105899
106897
|
method: "POST",
|
|
105900
106898
|
path: "/history/sessions",
|
|
@@ -106307,6 +107305,10 @@ function createHistoryHandlers(ctx) {
|
|
|
106307
107305
|
const data = await ctx.historyBoardService().getTimeline(input);
|
|
106308
107306
|
return { ok: true, data };
|
|
106309
107307
|
}),
|
|
107308
|
+
getToolSequence: os3.history.getToolSequence.handler(async ({ input }) => {
|
|
107309
|
+
const data = await ctx.historyBoardService().getToolSequence(input);
|
|
107310
|
+
return { ok: true, data };
|
|
107311
|
+
}),
|
|
106310
107312
|
getSessions: os3.history.getSessions.handler(async ({ input }) => {
|
|
106311
107313
|
const data = await ctx.historyBoardService().getSessions(input);
|
|
106312
107314
|
return { ok: true, data };
|