@inerrata-corporation/errata 2.0.2-dev.556 → 2.0.2-dev.558
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/errata.mjs +44 -5
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -47578,9 +47578,18 @@ function currentOsName() {
|
|
|
47578
47578
|
}
|
|
47579
47579
|
function extractExecutables(command) {
|
|
47580
47580
|
const out2 = [];
|
|
47581
|
-
for (const segment of command.split(SEGMENT_SPLIT)) {
|
|
47581
|
+
outer: for (const segment of command.split(SEGMENT_SPLIT)) {
|
|
47582
47582
|
const tokens = segment.trim().split(/\s+/);
|
|
47583
47583
|
let i2 = 0;
|
|
47584
|
+
while (i2 < tokens.length) {
|
|
47585
|
+
const t = tokens[i2];
|
|
47586
|
+
if (SHELL_HEADERS.has(t)) continue outer;
|
|
47587
|
+
if (SHELL_CONNECTORS.has(t) || SHELL_CONDITIONS.has(t)) {
|
|
47588
|
+
i2++;
|
|
47589
|
+
continue;
|
|
47590
|
+
}
|
|
47591
|
+
break;
|
|
47592
|
+
}
|
|
47584
47593
|
while (i2 < tokens.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[i2])) i2++;
|
|
47585
47594
|
let steps = 0;
|
|
47586
47595
|
while (i2 < tokens.length && steps < 3) {
|
|
@@ -47657,7 +47666,7 @@ function observeCommandTools(store, command, ts) {
|
|
|
47657
47666
|
}
|
|
47658
47667
|
return result;
|
|
47659
47668
|
}
|
|
47660
|
-
var PUBLIC_TOOLS, PLUMBING, PASSTHROUGH, SEGMENT_SPLIT;
|
|
47669
|
+
var PUBLIC_TOOLS, PLUMBING, PASSTHROUGH, SEGMENT_SPLIT, SHELL_CONNECTORS, SHELL_CONDITIONS, SHELL_HEADERS;
|
|
47661
47670
|
var init_tool_index = __esm({
|
|
47662
47671
|
"src/tool-index.ts"() {
|
|
47663
47672
|
"use strict";
|
|
@@ -47692,6 +47701,23 @@ var init_tool_index = __esm({
|
|
|
47692
47701
|
]);
|
|
47693
47702
|
PASSTHROUGH = /* @__PURE__ */ new Set(["sudo", "npx", "pnpx", "bunx", "uvx", "time", "nohup", "xargs", "watch"]);
|
|
47694
47703
|
SEGMENT_SPLIT = /\|\|?|&&|;|\r?\n/;
|
|
47704
|
+
SHELL_CONNECTORS = /* @__PURE__ */ new Set([
|
|
47705
|
+
"do",
|
|
47706
|
+
"done",
|
|
47707
|
+
"then",
|
|
47708
|
+
"else",
|
|
47709
|
+
"fi",
|
|
47710
|
+
"esac",
|
|
47711
|
+
"in",
|
|
47712
|
+
"function",
|
|
47713
|
+
"coproc",
|
|
47714
|
+
"time",
|
|
47715
|
+
"!",
|
|
47716
|
+
"{",
|
|
47717
|
+
"}"
|
|
47718
|
+
]);
|
|
47719
|
+
SHELL_CONDITIONS = /* @__PURE__ */ new Set(["while", "until", "if", "elif"]);
|
|
47720
|
+
SHELL_HEADERS = /* @__PURE__ */ new Set(["for", "case", "select"]);
|
|
47695
47721
|
}
|
|
47696
47722
|
});
|
|
47697
47723
|
|
|
@@ -48095,7 +48121,12 @@ function buildWebUi(deps) {
|
|
|
48095
48121
|
});
|
|
48096
48122
|
try {
|
|
48097
48123
|
const observed = observeCommandTools(deps.store, input["command"], Date.now());
|
|
48098
|
-
|
|
48124
|
+
const toolSid = String(body2["session_id"] ?? "");
|
|
48125
|
+
if (observed.nodeIds.length > 0 && !loggedToolSessions.has(toolSid)) {
|
|
48126
|
+
loggedToolSessions.add(toolSid);
|
|
48127
|
+
console.log(`[errata] tool-run recorded: session ${toolSid.slice(0, 8) || "(empty)"} +${observed.nodeIds.length}`);
|
|
48128
|
+
}
|
|
48129
|
+
deps.onToolsObserved?.(toolSid, observed.nodeIds);
|
|
48099
48130
|
} catch {
|
|
48100
48131
|
}
|
|
48101
48132
|
if (failed) recallCtx = recallForError(deps.store, stderr || combined);
|
|
@@ -48399,7 +48430,7 @@ function proposalToIngest(p, profile, daemonVersion) {
|
|
|
48399
48430
|
payloadDigest: p.id
|
|
48400
48431
|
};
|
|
48401
48432
|
}
|
|
48402
|
-
var wsPackagesCache, WS_PACKAGES_TTL_MS, META_LABELS;
|
|
48433
|
+
var wsPackagesCache, WS_PACKAGES_TTL_MS, loggedToolSessions, META_LABELS;
|
|
48403
48434
|
var init_webui = __esm({
|
|
48404
48435
|
"src/webui.ts"() {
|
|
48405
48436
|
"use strict";
|
|
@@ -48413,6 +48444,7 @@ var init_webui = __esm({
|
|
|
48413
48444
|
init_outbox();
|
|
48414
48445
|
wsPackagesCache = /* @__PURE__ */ new WeakMap();
|
|
48415
48446
|
WS_PACKAGES_TTL_MS = 6e4;
|
|
48447
|
+
loggedToolSessions = /* @__PURE__ */ new Set();
|
|
48416
48448
|
META_LABELS = /* @__PURE__ */ new Set([
|
|
48417
48449
|
"Pattern",
|
|
48418
48450
|
"Technique",
|
|
@@ -53852,6 +53884,9 @@ function createToolRunState() {
|
|
|
53852
53884
|
},
|
|
53853
53885
|
get(sessionId) {
|
|
53854
53886
|
return bySession.get(sessionId) ?? /* @__PURE__ */ new Set();
|
|
53887
|
+
},
|
|
53888
|
+
sessions() {
|
|
53889
|
+
return bySession.size;
|
|
53855
53890
|
}
|
|
53856
53891
|
};
|
|
53857
53892
|
}
|
|
@@ -54374,7 +54409,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
54374
54409
|
}
|
|
54375
54410
|
|
|
54376
54411
|
// src/engine.ts
|
|
54377
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
54412
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.558" : "2.0.0-alpha.0";
|
|
54378
54413
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
54379
54414
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
54380
54415
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -55584,6 +55619,10 @@ function createWorkspaceEngine(opts) {
|
|
|
55584
55619
|
corroboratedEdges,
|
|
55585
55620
|
touchedFileTurns,
|
|
55586
55621
|
touchedToolTurns,
|
|
55622
|
+
// Seam diagnostic: sessions holding tool-run records at harvest time.
|
|
55623
|
+
// touchedToolTurns 0 with this >0 = the hook and harvest disagree on
|
|
55624
|
+
// the session key; 0 with 0 = records never happen.
|
|
55625
|
+
toolSessionsTracked: toolRuns.sessions(),
|
|
55587
55626
|
seqAdvanced: store.currentIngestSeq() - seqAtStart
|
|
55588
55627
|
});
|
|
55589
55628
|
}
|