chat-recall 0.7.81 → 0.7.82
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/dist/cli.js +129 -59
- package/dist/heavy-session-work.d.ts +49 -0
- package/dist/heavy-session-work.d.ts.map +1 -0
- package/dist/heavy-session-work.js +98 -0
- package/dist/heavy-session-work.js.map +1 -0
- package/dist/mcp.js +129 -59
- package/dist/scan-pool.d.ts +13 -1
- package/dist/scan-pool.d.ts.map +1 -1
- package/dist/scan-pool.js +17 -1
- package/dist/scan-pool.js.map +1 -1
- package/dist/scan-worker.d.ts +54 -0
- package/dist/scan-worker.d.ts.map +1 -1
- package/dist/scan-worker.js +375 -31
- package/dist/scan-worker.js.map +1 -1
- package/dist/sync-client.d.ts +2 -16
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +58 -83
- package/dist/sync-client.js.map +1 -1
- package/dist/watch.js +129 -59
- package/package.json +1 -1
package/dist/mcp.js
CHANGED
|
@@ -30011,7 +30011,7 @@ var init_scan_pool = __esm({
|
|
|
30011
30011
|
slot.pending = null;
|
|
30012
30012
|
this.slots = this.slots.filter((s) => s !== slot);
|
|
30013
30013
|
if (this.slots.length === 0) this.disabled = true;
|
|
30014
|
-
resolve3?.({ id: -1, findings: [], redactions: 0, rows: null, error: `scan worker died: ${err}` });
|
|
30014
|
+
resolve3?.({ id: -1, findings: [], redactions: 0, rows: null, archive: null, error: `scan worker died: ${err}` });
|
|
30015
30015
|
this.pump();
|
|
30016
30016
|
};
|
|
30017
30017
|
worker.on("error", die);
|
|
@@ -30088,6 +30088,22 @@ var init_scan_pool = __esm({
|
|
|
30088
30088
|
async runDerived(task) {
|
|
30089
30089
|
return this.dispatch({ ...task, task: "derived", id: 0 });
|
|
30090
30090
|
}
|
|
30091
|
+
/**
|
|
30092
|
+
* The secret scan of a session read in chunks, on a worker.
|
|
30093
|
+
*
|
|
30094
|
+
* The worker reads the session itself. Null means the caller scans inline.
|
|
30095
|
+
*/
|
|
30096
|
+
async runFindings(task) {
|
|
30097
|
+
return this.dispatch({ ...task, task: "findings", id: 0 });
|
|
30098
|
+
}
|
|
30099
|
+
/**
|
|
30100
|
+
* The redacted raw archive of a streamed session, written to a temp file on a worker.
|
|
30101
|
+
*
|
|
30102
|
+
* Null means the caller writes it inline.
|
|
30103
|
+
*/
|
|
30104
|
+
async runArchive(task) {
|
|
30105
|
+
return this.dispatch({ ...task, task: "archive", id: 0 });
|
|
30106
|
+
}
|
|
30091
30107
|
async dispatch(task) {
|
|
30092
30108
|
this.start();
|
|
30093
30109
|
if (this.disabled) return null;
|
|
@@ -30643,6 +30659,74 @@ var init_yield_loop = __esm({
|
|
|
30643
30659
|
}
|
|
30644
30660
|
});
|
|
30645
30661
|
|
|
30662
|
+
// src/heavy-session-work.ts
|
|
30663
|
+
async function scanTranscriptFindingsChunked(ref, tenantRules) {
|
|
30664
|
+
const backend = getBackendForId(ref.prefixedId);
|
|
30665
|
+
const findings = [];
|
|
30666
|
+
if (!backend?.readFromOffset) return findings;
|
|
30667
|
+
let offset = 0;
|
|
30668
|
+
let lineBase = 0;
|
|
30669
|
+
for (; ; ) {
|
|
30670
|
+
await yieldToEventLoop();
|
|
30671
|
+
const chunk = await backend.readFromOffset(ref.prefixedId, offset, SYNC_CHUNK_BYTES);
|
|
30672
|
+
if (chunk.newOffset <= offset) break;
|
|
30673
|
+
offset = chunk.newOffset;
|
|
30674
|
+
if (chunk.skippedBytes) {
|
|
30675
|
+
lineBase += 1;
|
|
30676
|
+
continue;
|
|
30677
|
+
}
|
|
30678
|
+
try {
|
|
30679
|
+
for (const f of scanTextForFindings(chunk.text)) {
|
|
30680
|
+
findings.push({ session_id: ref.prefixedId, detector: "builtin", rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
30681
|
+
}
|
|
30682
|
+
if (tenantRules && tenantRules.length > 0) {
|
|
30683
|
+
for (const f of scanTenantRules(chunk.text, tenantRules)) {
|
|
30684
|
+
findings.push({ session_id: ref.prefixedId, detector: f.detector, rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
30685
|
+
}
|
|
30686
|
+
}
|
|
30687
|
+
} catch {
|
|
30688
|
+
}
|
|
30689
|
+
for (let i = chunk.text.indexOf("\n"); i >= 0; i = chunk.text.indexOf("\n", i + 1)) lineBase++;
|
|
30690
|
+
}
|
|
30691
|
+
return dropFuzzyFindings(findings, (f) => ({ detector: f.detector, rule: f.rule }));
|
|
30692
|
+
}
|
|
30693
|
+
function diskArchiveSource(ref) {
|
|
30694
|
+
if (ref.toolId !== "claude") return null;
|
|
30695
|
+
const groups = resolveSessionContentGroups(ref.rawId);
|
|
30696
|
+
if (groups.length === 0 || groups.some((g) => g.paths.length !== 1)) return null;
|
|
30697
|
+
return {
|
|
30698
|
+
kind: "disk",
|
|
30699
|
+
files: groups.map((g) => ({ name: g.name === "main" ? `${ref.rawId}.jsonl` : g.name, path: g.paths[0] }))
|
|
30700
|
+
};
|
|
30701
|
+
}
|
|
30702
|
+
function streamedArchiveSource(ref) {
|
|
30703
|
+
const disk = diskArchiveSource(ref);
|
|
30704
|
+
if (disk) return disk;
|
|
30705
|
+
const backend = getBackendForId(ref.prefixedId);
|
|
30706
|
+
if (ref.toolId === "claude" || !backend?.iterateRawSessionLines) return null;
|
|
30707
|
+
return { kind: "lines", files: [{ name: `${ref.rawId}.dump.jsonl`, lines: () => backend.iterateRawSessionLines(ref.prefixedId) }] };
|
|
30708
|
+
}
|
|
30709
|
+
async function writeStreamedArchive(ref, redact) {
|
|
30710
|
+
const source = streamedArchiveSource(ref);
|
|
30711
|
+
if (!source) return null;
|
|
30712
|
+
return writeArchiveFile(source, { tool: ref.toolId, mtime: Math.floor(ref.mtime ?? 0) || 0 }, redact);
|
|
30713
|
+
}
|
|
30714
|
+
var SYNC_CHUNK_BYTES;
|
|
30715
|
+
var init_heavy_session_work = __esm({
|
|
30716
|
+
"src/heavy-session-work.ts"() {
|
|
30717
|
+
"use strict";
|
|
30718
|
+
init_backends();
|
|
30719
|
+
init_tool_backend();
|
|
30720
|
+
init_live_session_scan();
|
|
30721
|
+
init_secret_redactor();
|
|
30722
|
+
init_secret_scanner();
|
|
30723
|
+
init_secret_precision();
|
|
30724
|
+
init_raw_archive_parts();
|
|
30725
|
+
init_yield_loop();
|
|
30726
|
+
SYNC_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
30727
|
+
}
|
|
30728
|
+
});
|
|
30729
|
+
|
|
30646
30730
|
// src/server-probe.ts
|
|
30647
30731
|
var server_probe_exports = {};
|
|
30648
30732
|
__export(server_probe_exports, {
|
|
@@ -32187,7 +32271,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
32187
32271
|
await appendAdd(tail.conv, tail.bytes);
|
|
32188
32272
|
if (tail.findings.length > 0) {
|
|
32189
32273
|
await appendFlush();
|
|
32190
|
-
const all = await
|
|
32274
|
+
const all = await scanFindingsOffloaded(ref, tenantRules);
|
|
32191
32275
|
if (all.length > 0) await findingsBatch.add(all);
|
|
32192
32276
|
}
|
|
32193
32277
|
walked++;
|
|
@@ -32495,36 +32579,6 @@ function exportByteLength(exp) {
|
|
|
32495
32579
|
if (!exp) return 0;
|
|
32496
32580
|
return exp.files.reduce((n, f) => n + f.bytes.length, 0);
|
|
32497
32581
|
}
|
|
32498
|
-
async function scanTranscriptFindingsChunked(ref, tenantRules) {
|
|
32499
|
-
const backend = getBackendForId(ref.prefixedId);
|
|
32500
|
-
const findings = [];
|
|
32501
|
-
if (!backend?.readFromOffset) return findings;
|
|
32502
|
-
let offset = 0;
|
|
32503
|
-
let lineBase = 0;
|
|
32504
|
-
for (; ; ) {
|
|
32505
|
-
await yieldToEventLoop();
|
|
32506
|
-
const chunk = await backend.readFromOffset(ref.prefixedId, offset, SYNC_CHUNK_BYTES);
|
|
32507
|
-
if (chunk.newOffset <= offset) break;
|
|
32508
|
-
offset = chunk.newOffset;
|
|
32509
|
-
if (chunk.skippedBytes) {
|
|
32510
|
-
lineBase += 1;
|
|
32511
|
-
continue;
|
|
32512
|
-
}
|
|
32513
|
-
try {
|
|
32514
|
-
for (const f of scanTextForFindings(chunk.text)) {
|
|
32515
|
-
findings.push({ session_id: ref.prefixedId, detector: "builtin", rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
32516
|
-
}
|
|
32517
|
-
if (tenantRules && tenantRules.length > 0) {
|
|
32518
|
-
for (const f of scanTenantRules(chunk.text, tenantRules)) {
|
|
32519
|
-
findings.push({ session_id: ref.prefixedId, detector: f.detector, rule: f.rule, line: lineBase + f.line, preview: f.preview });
|
|
32520
|
-
}
|
|
32521
|
-
}
|
|
32522
|
-
} catch {
|
|
32523
|
-
}
|
|
32524
|
-
for (let i = chunk.text.indexOf("\n"); i >= 0; i = chunk.text.indexOf("\n", i + 1)) lineBase++;
|
|
32525
|
-
}
|
|
32526
|
-
return dropFuzzyFindings(findings, (f) => ({ detector: f.detector, rule: f.rule }));
|
|
32527
|
-
}
|
|
32528
32582
|
function sessionFileBytes(ref) {
|
|
32529
32583
|
const backend = getBackendForId(ref.prefixedId);
|
|
32530
32584
|
if (!backend?.isAppendOnly?.()) return 0;
|
|
@@ -32542,6 +32596,42 @@ function sessionBuildBytes(ref) {
|
|
|
32542
32596
|
if (main2 === 0) return 0;
|
|
32543
32597
|
return Math.max(main2, shadowUncompressedBytes(ref.toolId, ref.rawId));
|
|
32544
32598
|
}
|
|
32599
|
+
async function scanFindingsOffloaded(ref, tenantRules) {
|
|
32600
|
+
const pool = scanPool();
|
|
32601
|
+
if (pool.enabled) {
|
|
32602
|
+
const packVersion = lastServerPackSpec?.version ?? "";
|
|
32603
|
+
const sendPack = lastServerPackSpec !== null && pool.needsPack(packVersion);
|
|
32604
|
+
const result = await pool.runFindings({
|
|
32605
|
+
ref: { prefixedId: ref.prefixedId, rawId: ref.rawId, toolId: ref.toolId },
|
|
32606
|
+
tenantRules,
|
|
32607
|
+
pack: sendPack && lastServerPackSpec ? { version: packVersion, rules: lastServerPackSpec.rules } : void 0,
|
|
32608
|
+
packVersion
|
|
32609
|
+
});
|
|
32610
|
+
if (result) {
|
|
32611
|
+
if (sendPack) pool.markPackSent(packVersion);
|
|
32612
|
+
return result.findings;
|
|
32613
|
+
}
|
|
32614
|
+
}
|
|
32615
|
+
return scanTranscriptFindingsChunked(ref, tenantRules);
|
|
32616
|
+
}
|
|
32617
|
+
async function writeStreamedArchiveOffloaded(ref, count) {
|
|
32618
|
+
const pool = scanPool();
|
|
32619
|
+
if (pool.enabled) {
|
|
32620
|
+
const packVersion = lastServerPackSpec?.version ?? "";
|
|
32621
|
+
const sendPack = lastServerPackSpec !== null && pool.needsPack(packVersion);
|
|
32622
|
+
const result = await pool.runArchive({
|
|
32623
|
+
ref: { prefixedId: ref.prefixedId, rawId: ref.rawId, toolId: ref.toolId, mtime: ref.mtime },
|
|
32624
|
+
pack: sendPack && lastServerPackSpec ? { version: packVersion, rules: lastServerPackSpec.rules } : void 0,
|
|
32625
|
+
packVersion
|
|
32626
|
+
});
|
|
32627
|
+
if (result) {
|
|
32628
|
+
if (sendPack) pool.markPackSent(packVersion);
|
|
32629
|
+
count.redactions += result.redactions;
|
|
32630
|
+
return result.archive;
|
|
32631
|
+
}
|
|
32632
|
+
}
|
|
32633
|
+
return writeStreamedArchive(ref, (t) => redactSecrets(t, { force: true, count }));
|
|
32634
|
+
}
|
|
32545
32635
|
async function buildConversationSync(ref, mtime, opts = {}) {
|
|
32546
32636
|
const mapPath = opts.mapPath ?? ((p) => p);
|
|
32547
32637
|
let includeRaw = opts.includeRaw !== false;
|
|
@@ -32570,7 +32660,7 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32570
32660
|
} catch {
|
|
32571
32661
|
}
|
|
32572
32662
|
includeRaw = false;
|
|
32573
|
-
oversizedFindings = await
|
|
32663
|
+
oversizedFindings = await scanFindingsOffloaded(ref, opts.tenantRules);
|
|
32574
32664
|
} else {
|
|
32575
32665
|
try {
|
|
32576
32666
|
const backend = getBackendForId(ref.prefixedId) ?? getBackend("claude");
|
|
@@ -32831,17 +32921,13 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32831
32921
|
if (wantRaw && !raw_b64) {
|
|
32832
32922
|
try {
|
|
32833
32923
|
const redact = (t) => redactSecrets(t, { force: true, count });
|
|
32834
|
-
let source = null;
|
|
32835
|
-
let archiveMtime = Math.floor(ref.mtime) || 0;
|
|
32836
|
-
let archiveTool = ref.toolId;
|
|
32837
32924
|
if (container) {
|
|
32838
|
-
source = { kind: "memory", files: container.files };
|
|
32839
|
-
|
|
32840
|
-
archiveTool = container.tool;
|
|
32925
|
+
const source = { kind: "memory", files: container.files };
|
|
32926
|
+
archive = { file: await writeArchiveFile(source, { tool: container.tool, mtime: container.mtime }, redact), tool: container.tool, mtime: container.mtime };
|
|
32841
32927
|
} else if (oversized || exportOverCeiling) {
|
|
32842
|
-
|
|
32928
|
+
const file = await writeStreamedArchiveOffloaded(ref, count);
|
|
32929
|
+
if (file) archive = { file, tool: ref.toolId, mtime: Math.floor(ref.mtime) || 0 };
|
|
32843
32930
|
}
|
|
32844
|
-
if (source) archive = { file: await writeArchiveFile(source, { tool: archiveTool, mtime: archiveMtime }, redact), tool: archiveTool, mtime: archiveMtime };
|
|
32845
32931
|
} catch (err) {
|
|
32846
32932
|
console.error(`[sync] raw archive for ${ref.prefixedId} not written: ${err instanceof Error ? err.message : err}`);
|
|
32847
32933
|
}
|
|
@@ -32881,22 +32967,6 @@ async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
32881
32967
|
archive
|
|
32882
32968
|
};
|
|
32883
32969
|
}
|
|
32884
|
-
function streamedArchiveSource(ref) {
|
|
32885
|
-
const disk = diskArchiveSource(ref);
|
|
32886
|
-
if (disk) return disk;
|
|
32887
|
-
const backend = getBackendForId(ref.prefixedId);
|
|
32888
|
-
if (ref.toolId === "claude" || !backend?.iterateRawSessionLines) return null;
|
|
32889
|
-
return { kind: "lines", files: [{ name: `${ref.rawId}.dump.jsonl`, lines: () => backend.iterateRawSessionLines(ref.prefixedId) }] };
|
|
32890
|
-
}
|
|
32891
|
-
function diskArchiveSource(ref) {
|
|
32892
|
-
if (ref.toolId !== "claude") return null;
|
|
32893
|
-
const groups = resolveSessionContentGroups(ref.rawId);
|
|
32894
|
-
if (groups.length === 0 || groups.some((g) => g.paths.length !== 1)) return null;
|
|
32895
|
-
return {
|
|
32896
|
-
kind: "disk",
|
|
32897
|
-
files: groups.map((g) => ({ name: g.name === "main" ? `${ref.rawId}.jsonl` : g.name, path: g.paths[0] }))
|
|
32898
|
-
};
|
|
32899
|
-
}
|
|
32900
32970
|
function parseTailMessages(tool, text, backend = null) {
|
|
32901
32971
|
if (!text || !text.trim()) return [];
|
|
32902
32972
|
if (tool === "claude") return parseClaudeTranscriptText(text);
|
|
@@ -33014,7 +33084,7 @@ async function syncIncremental(opts = {}) {
|
|
|
33014
33084
|
lock.release();
|
|
33015
33085
|
}
|
|
33016
33086
|
}
|
|
33017
|
-
var ownVersion, ERROR_CLASS, STANDING_FAILURE, walkProgressForUpload, lastServerPackSpec, credPath, fileTarget, _securityConfigCache, SECURITY_CONFIG_TTL_MS, _syncConfigCache, EMPTY_SYNC_CONFIG, _fetchTenantSyncConfigForTests, SYNC_RULES_REFUSAL, hashPath, acceptedUploads, MAX_DERIVED_ROW_BYTES, isLocalHost, FULL_KEY, CAPS_TTL_MS, capsOk, advertisedIngestConc, advertisedGzipBody, FULL_BUILD_MAX_BYTES, DERIVED_MAX_BYTES,
|
|
33087
|
+
var ownVersion, ERROR_CLASS, STANDING_FAILURE, walkProgressForUpload, lastServerPackSpec, credPath, fileTarget, _securityConfigCache, SECURITY_CONFIG_TTL_MS, _syncConfigCache, EMPTY_SYNC_CONFIG, _fetchTenantSyncConfigForTests, SYNC_RULES_REFUSAL, hashPath, acceptedUploads, MAX_DERIVED_ROW_BYTES, isLocalHost, FULL_KEY, CAPS_TTL_MS, capsOk, advertisedIngestConc, advertisedGzipBody, FULL_BUILD_MAX_BYTES, DERIVED_MAX_BYTES, TOOLKIT_INVENTORY_TYPES, BATCH_SCAN_MAX_BYTES;
|
|
33018
33088
|
var init_sync_client = __esm({
|
|
33019
33089
|
"src/sync-client.ts"() {
|
|
33020
33090
|
"use strict";
|
|
@@ -33063,6 +33133,7 @@ var init_sync_client = __esm({
|
|
|
33063
33133
|
init_session_file_scan();
|
|
33064
33134
|
init_raw_archive_parts();
|
|
33065
33135
|
init_yield_loop();
|
|
33136
|
+
init_heavy_session_work();
|
|
33066
33137
|
init_backends();
|
|
33067
33138
|
ownVersion = "0.0.0";
|
|
33068
33139
|
try {
|
|
@@ -33101,7 +33172,6 @@ var init_sync_client = __esm({
|
|
|
33101
33172
|
advertisedGzipBody = /* @__PURE__ */ new Set();
|
|
33102
33173
|
FULL_BUILD_MAX_BYTES = Math.max(8, parseInt(process.env.CHAT_RECALL_FULL_BUILD_MAX_MB || "12", 10)) * 1024 * 1024;
|
|
33103
33174
|
DERIVED_MAX_BYTES = Math.max(8, parseInt(process.env.CHAT_RECALL_DERIVED_MAX_MB || "64", 10)) * 1024 * 1024;
|
|
33104
|
-
SYNC_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
33105
33175
|
TOOLKIT_INVENTORY_TYPES = /* @__PURE__ */ new Set(["skill", "mcp", "command", "agent", "plugin"]);
|
|
33106
33176
|
BATCH_SCAN_MAX_BYTES = Math.max(1, parseInt(process.env.CHAT_RECALL_BATCHSCAN_MAX_MB || "64", 10)) * 1024 * 1024;
|
|
33107
33177
|
}
|
package/dist/scan-pool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScanTask, ScanResult, DerivedTask, DerivedResult } from './scan-worker.js';
|
|
1
|
+
import type { ScanTask, ScanResult, DerivedTask, DerivedResult, FindingsTask, FindingsResult, ArchiveTask, ArchiveResult } from './scan-worker.js';
|
|
2
2
|
export declare class ScanPool {
|
|
3
3
|
private readonly size;
|
|
4
4
|
private readonly overrideScript?;
|
|
@@ -52,6 +52,18 @@ export declare class ScanPool {
|
|
|
52
52
|
* pools would mean two sets of workers competing for the same cores.
|
|
53
53
|
*/
|
|
54
54
|
runDerived(task: Omit<DerivedTask, 'id' | 'task'>): Promise<DerivedResult | null>;
|
|
55
|
+
/**
|
|
56
|
+
* The secret scan of a session read in chunks, on a worker.
|
|
57
|
+
*
|
|
58
|
+
* The worker reads the session itself. Null means the caller scans inline.
|
|
59
|
+
*/
|
|
60
|
+
runFindings(task: Omit<FindingsTask, 'id' | 'task'>): Promise<FindingsResult | null>;
|
|
61
|
+
/**
|
|
62
|
+
* The redacted raw archive of a streamed session, written to a temp file on a worker.
|
|
63
|
+
*
|
|
64
|
+
* Null means the caller writes it inline.
|
|
65
|
+
*/
|
|
66
|
+
runArchive(task: Omit<ArchiveTask, 'id' | 'task'>): Promise<ArchiveResult | null>;
|
|
55
67
|
private dispatch;
|
|
56
68
|
/**
|
|
57
69
|
* Has this pool already sent the current rule pack? Lets the caller omit the
|
package/dist/scan-pool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-pool.d.ts","sourceRoot":"","sources":["../src/scan-pool.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"scan-pool.d.ts","sourceRoot":"","sources":["../src/scan-pool.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAsEnJ,qBAAa,QAAQ;IAWP,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAe,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAVhF,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAiE;IAC9E,OAAO,CAAC,MAAM,CAAK;IACnB,OA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I,QAAQ,CAGnC;AAED,4CAA4C;AAC5C,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAInD"}
|
package/dist/scan-pool.js
CHANGED
|
@@ -164,7 +164,7 @@ export class ScanPool {
|
|
|
164
164
|
this.disabled = true;
|
|
165
165
|
// Shaped to satisfy both result types: the caller only reads `error`
|
|
166
166
|
// on this path and falls back inline either way.
|
|
167
|
-
resolve?.({ id: -1, findings: [], redactions: 0, rows: null, error: `scan worker died: ${err}` });
|
|
167
|
+
resolve?.({ id: -1, findings: [], redactions: 0, rows: null, archive: null, error: `scan worker died: ${err}` });
|
|
168
168
|
this.pump();
|
|
169
169
|
};
|
|
170
170
|
worker.on('error', die);
|
|
@@ -257,6 +257,22 @@ export class ScanPool {
|
|
|
257
257
|
async runDerived(task) {
|
|
258
258
|
return this.dispatch({ ...task, task: 'derived', id: 0 });
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The secret scan of a session read in chunks, on a worker.
|
|
262
|
+
*
|
|
263
|
+
* The worker reads the session itself. Null means the caller scans inline.
|
|
264
|
+
*/
|
|
265
|
+
async runFindings(task) {
|
|
266
|
+
return this.dispatch({ ...task, task: 'findings', id: 0 });
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* The redacted raw archive of a streamed session, written to a temp file on a worker.
|
|
270
|
+
*
|
|
271
|
+
* Null means the caller writes it inline.
|
|
272
|
+
*/
|
|
273
|
+
async runArchive(task) {
|
|
274
|
+
return this.dispatch({ ...task, task: 'archive', id: 0 });
|
|
275
|
+
}
|
|
260
276
|
async dispatch(task) {
|
|
261
277
|
this.start();
|
|
262
278
|
if (this.disabled)
|
package/dist/scan-pool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-pool.js","sourceRoot":"","sources":["../src/scan-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,MAAM,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EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnF,CAAC;CACF;AAED,6EAA6E;AAC7E,IAAI,MAAM,GAAoB,IAAI,CAAC;AACnC,MAAM,UAAU,QAAQ;IACtB,IAAI,CAAC,MAAM;QAAE,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4CAA4C;AAC5C,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,CAAC,GAAG,MAAM,CAAC;IACjB,MAAM,GAAG,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
package/dist/scan-worker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ServerRuleSpec, type RedactorFinding } from '@chat-recall/engine/core/secret-redactor.js';
|
|
2
|
+
import type { SessionHandle } from './heavy-session-work.js';
|
|
2
3
|
/** One file of a session transcript. Mirrors RawContainer.files. */
|
|
3
4
|
export interface ScanFile {
|
|
4
5
|
name: string;
|
|
@@ -44,6 +45,59 @@ export interface DerivedResult {
|
|
|
44
45
|
redactions: number;
|
|
45
46
|
error?: string;
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The secret scan of a session read in chunks. The worker reads the session
|
|
50
|
+
* itself, so nothing large crosses the boundary in either direction.
|
|
51
|
+
*/
|
|
52
|
+
export interface FindingsTask {
|
|
53
|
+
id: number;
|
|
54
|
+
task: 'findings';
|
|
55
|
+
ref: SessionHandle;
|
|
56
|
+
tenantRules?: Array<{
|
|
57
|
+
name: string;
|
|
58
|
+
regex: string;
|
|
59
|
+
}>;
|
|
60
|
+
pack?: {
|
|
61
|
+
version: string;
|
|
62
|
+
rules: ServerRuleSpec[];
|
|
63
|
+
};
|
|
64
|
+
packVersion: string;
|
|
65
|
+
}
|
|
66
|
+
export interface FindingsResult {
|
|
67
|
+
id: number;
|
|
68
|
+
findings: Array<{
|
|
69
|
+
session_id: string;
|
|
70
|
+
detector: string;
|
|
71
|
+
rule: string;
|
|
72
|
+
line: number;
|
|
73
|
+
preview: string;
|
|
74
|
+
}>;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The redacted raw archive of a session too large to export, written to a temp
|
|
79
|
+
* file. Only the path and the sizes come back.
|
|
80
|
+
*/
|
|
81
|
+
export interface ArchiveTask {
|
|
82
|
+
id: number;
|
|
83
|
+
task: 'archive';
|
|
84
|
+
ref: SessionHandle;
|
|
85
|
+
pack?: {
|
|
86
|
+
version: string;
|
|
87
|
+
rules: ServerRuleSpec[];
|
|
88
|
+
};
|
|
89
|
+
packVersion: string;
|
|
90
|
+
}
|
|
91
|
+
export interface ArchiveResult {
|
|
92
|
+
id: number;
|
|
93
|
+
archive: {
|
|
94
|
+
path: string;
|
|
95
|
+
gzSize: number;
|
|
96
|
+
size: number;
|
|
97
|
+
} | null;
|
|
98
|
+
redactions: number;
|
|
99
|
+
error?: string;
|
|
100
|
+
}
|
|
47
101
|
export interface ScanTask {
|
|
48
102
|
id: number;
|
|
49
103
|
task?: 'scan';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-worker.d.ts","sourceRoot":"","sources":["../src/scan-worker.ts"],"names":[],"mappings":"AA8BA,OA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