@getengram/cli 0.6.1 → 0.7.0
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/README.md +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +38 -11
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/conversations.d.ts.map +1 -1
- package/dist/commands/conversations.js +8 -2
- package/dist/commands/conversations.js.map +1 -1
- package/dist/commands/exclude.d.ts.map +1 -1
- package/dist/commands/exclude.js +73 -21
- package/dist/commands/exclude.js.map +1 -1
- package/dist/commands/import.d.ts +30 -3
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +374 -45
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +144 -29
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/search.js +2 -2
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/status.d.ts +16 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +51 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/store.d.ts.map +1 -1
- package/dist/commands/store.js +19 -3
- package/dist/commands/store.js.map +1 -1
- package/dist/commands/upgrade.d.ts +24 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +64 -15
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/commands/usage.d.ts +44 -0
- package/dist/commands/usage.d.ts.map +1 -1
- package/dist/commands/usage.js +79 -19
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/vault.d.ts +11 -2
- package/dist/commands/vault.d.ts.map +1 -1
- package/dist/commands/vault.js +372 -53
- package/dist/commands/vault.js.map +1 -1
- package/dist/config-file.d.ts +74 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +152 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config-guard.d.ts +96 -0
- package/dist/config-guard.d.ts.map +1 -0
- package/dist/config-guard.js +184 -0
- package/dist/config-guard.js.map +1 -0
- package/dist/config.d.ts +48 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +101 -12
- package/dist/config.js.map +1 -1
- package/dist/daemon/as-root.d.ts +46 -0
- package/dist/daemon/as-root.d.ts.map +1 -0
- package/dist/daemon/as-root.js +64 -0
- package/dist/daemon/as-root.js.map +1 -0
- package/dist/daemon/backoff.d.ts +26 -0
- package/dist/daemon/backoff.d.ts.map +1 -0
- package/dist/daemon/backoff.js +37 -0
- package/dist/daemon/backoff.js.map +1 -0
- package/dist/daemon/codex-parser.d.ts +38 -4
- package/dist/daemon/codex-parser.d.ts.map +1 -1
- package/dist/daemon/codex-parser.js +111 -23
- package/dist/daemon/codex-parser.js.map +1 -1
- package/dist/daemon/command-path.d.ts +13 -0
- package/dist/daemon/command-path.d.ts.map +1 -0
- package/dist/daemon/command-path.js +35 -0
- package/dist/daemon/command-path.js.map +1 -0
- package/dist/daemon/commands.d.ts +146 -5
- package/dist/daemon/commands.d.ts.map +1 -1
- package/dist/daemon/commands.js +2766 -316
- package/dist/daemon/commands.js.map +1 -1
- package/dist/daemon/db.d.ts +255 -27
- package/dist/daemon/db.d.ts.map +1 -1
- package/dist/daemon/db.js +749 -53
- package/dist/daemon/db.js.map +1 -1
- package/dist/daemon/exclusions.d.ts +23 -3
- package/dist/daemon/exclusions.d.ts.map +1 -1
- package/dist/daemon/exclusions.js +91 -21
- package/dist/daemon/exclusions.js.map +1 -1
- package/dist/daemon/homebrew.d.ts +26 -0
- package/dist/daemon/homebrew.d.ts.map +1 -0
- package/dist/daemon/homebrew.js +43 -0
- package/dist/daemon/homebrew.js.map +1 -0
- package/dist/daemon/instance.d.ts +427 -0
- package/dist/daemon/instance.d.ts.map +1 -0
- package/dist/daemon/instance.js +1201 -0
- package/dist/daemon/instance.js.map +1 -0
- package/dist/daemon/key-source.d.ts +41 -0
- package/dist/daemon/key-source.d.ts.map +1 -0
- package/dist/daemon/key-source.js +89 -0
- package/dist/daemon/key-source.js.map +1 -0
- package/dist/daemon/launch.d.ts +56 -0
- package/dist/daemon/launch.d.ts.map +1 -0
- package/dist/daemon/launch.js +153 -0
- package/dist/daemon/launch.js.map +1 -0
- package/dist/daemon/launchd.d.ts +215 -0
- package/dist/daemon/launchd.d.ts.map +1 -0
- package/dist/daemon/launchd.js +527 -0
- package/dist/daemon/launchd.js.map +1 -0
- package/dist/daemon/login-start.d.ts +2 -0
- package/dist/daemon/login-start.d.ts.map +1 -0
- package/dist/daemon/login-start.js +25 -0
- package/dist/daemon/login-start.js.map +1 -0
- package/dist/daemon/ownership.d.ts +123 -0
- package/dist/daemon/ownership.d.ts.map +1 -0
- package/dist/daemon/ownership.js +245 -0
- package/dist/daemon/ownership.js.map +1 -0
- package/dist/daemon/package-runner.d.ts +28 -0
- package/dist/daemon/package-runner.d.ts.map +1 -0
- package/dist/daemon/package-runner.js +113 -0
- package/dist/daemon/package-runner.js.map +1 -0
- package/dist/daemon/parser.d.ts +45 -7
- package/dist/daemon/parser.d.ts.map +1 -1
- package/dist/daemon/parser.js +153 -53
- package/dist/daemon/parser.js.map +1 -1
- package/dist/daemon/powershell.d.ts +25 -0
- package/dist/daemon/powershell.d.ts.map +1 -0
- package/dist/daemon/powershell.js +30 -0
- package/dist/daemon/powershell.js.map +1 -0
- package/dist/daemon/preflight.d.ts.map +1 -1
- package/dist/daemon/preflight.js +5 -1
- package/dist/daemon/preflight.js.map +1 -1
- package/dist/daemon/prune.d.ts +101 -0
- package/dist/daemon/prune.d.ts.map +1 -0
- package/dist/daemon/prune.js +287 -0
- package/dist/daemon/prune.js.map +1 -0
- package/dist/daemon/queue-error.d.ts +47 -0
- package/dist/daemon/queue-error.d.ts.map +1 -0
- package/dist/daemon/queue-error.js +59 -0
- package/dist/daemon/queue-error.js.map +1 -0
- package/dist/daemon/root-daemon.d.ts +60 -0
- package/dist/daemon/root-daemon.d.ts.map +1 -0
- package/dist/daemon/root-daemon.js +86 -0
- package/dist/daemon/root-daemon.js.map +1 -0
- package/dist/daemon/scoop.d.ts +52 -0
- package/dist/daemon/scoop.d.ts.map +1 -0
- package/dist/daemon/scoop.js +84 -0
- package/dist/daemon/scoop.js.map +1 -0
- package/dist/daemon/scrubber.d.ts +396 -14
- package/dist/daemon/scrubber.d.ts.map +1 -1
- package/dist/daemon/scrubber.js +915 -52
- package/dist/daemon/scrubber.js.map +1 -1
- package/dist/daemon/status.d.ts +306 -11
- package/dist/daemon/status.d.ts.map +1 -1
- package/dist/daemon/status.js +568 -43
- package/dist/daemon/status.js.map +1 -1
- package/dist/daemon/supervise.d.ts +78 -0
- package/dist/daemon/supervise.d.ts.map +1 -0
- package/dist/daemon/supervise.js +121 -0
- package/dist/daemon/supervise.js.map +1 -0
- package/dist/daemon/supervisor.d.ts +18 -0
- package/dist/daemon/supervisor.d.ts.map +1 -0
- package/dist/daemon/supervisor.js +56 -0
- package/dist/daemon/supervisor.js.map +1 -0
- package/dist/daemon/syncer.d.ts +380 -21
- package/dist/daemon/syncer.d.ts.map +1 -1
- package/dist/daemon/syncer.js +1432 -182
- package/dist/daemon/syncer.js.map +1 -1
- package/dist/daemon/systemd.d.ts +109 -0
- package/dist/daemon/systemd.d.ts.map +1 -0
- package/dist/daemon/systemd.js +363 -0
- package/dist/daemon/systemd.js.map +1 -0
- package/dist/daemon/types.d.ts +58 -6
- package/dist/daemon/types.d.ts.map +1 -1
- package/dist/daemon/vault-changed.d.ts +29 -0
- package/dist/daemon/vault-changed.d.ts.map +1 -0
- package/dist/daemon/vault-changed.js +47 -0
- package/dist/daemon/vault-changed.js.map +1 -0
- package/dist/daemon/vault-key-missing.d.ts +70 -0
- package/dist/daemon/vault-key-missing.d.ts.map +1 -0
- package/dist/daemon/vault-key-missing.js +125 -0
- package/dist/daemon/vault-key-missing.js.map +1 -0
- package/dist/daemon/watcher.d.ts +87 -4
- package/dist/daemon/watcher.d.ts.map +1 -1
- package/dist/daemon/watcher.js +286 -36
- package/dist/daemon/watcher.js.map +1 -1
- package/dist/daemon/worker-main.js +352 -64
- package/dist/daemon/worker-main.js.map +1 -1
- package/dist/daemon/worker.js +19 -1
- package/dist/daemon/worker.js.map +1 -1
- package/dist/import-resume.d.ts +163 -0
- package/dist/import-resume.d.ts.map +1 -0
- package/dist/import-resume.js +267 -0
- package/dist/import-resume.js.map +1 -0
- package/dist/index.js +242 -33
- package/dist/index.js.map +1 -1
- package/dist/message-bounds.d.ts +52 -0
- package/dist/message-bounds.d.ts.map +1 -0
- package/dist/message-bounds.js +157 -0
- package/dist/message-bounds.js.map +1 -0
- package/dist/output.d.ts +14 -0
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +33 -5
- package/dist/output.js.map +1 -1
- package/dist/private-files.d.ts +126 -0
- package/dist/private-files.d.ts.map +1 -0
- package/dist/private-files.js +372 -0
- package/dist/private-files.js.map +1 -0
- package/dist/server-url.d.ts +31 -0
- package/dist/server-url.d.ts.map +1 -0
- package/dist/server-url.js +47 -0
- package/dist/server-url.js.map +1 -0
- package/dist/vault-key.d.ts +122 -0
- package/dist/vault-key.d.ts.map +1 -0
- package/dist/vault-key.js +273 -0
- package/dist/vault-key.js.map +1 -0
- package/package.json +2 -2
package/dist/daemon/parser.js
CHANGED
|
@@ -44,12 +44,26 @@ function describeImage(block) {
|
|
|
44
44
|
// get`, `npx engram vault get` and `./engram vault get` all print the same
|
|
45
45
|
// value. Withholding the output of some other tool's `vault get` by mistake
|
|
46
46
|
// is a harmless over-redaction; missing one of these is the leak.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
//
|
|
48
|
+
// The key file is matched by its name alone, without regard to case
|
|
49
|
+
// (engram#619): `type %USERPROFILE%\.Engram\vault-key`, `cd ~/.engram && cat
|
|
50
|
+
// vault-key` and a Read of its path all print the key, and macOS and Windows
|
|
51
|
+
// ignore case in file names. ENGRAM_VAULT_KEY is the same key, kept in the
|
|
52
|
+
// environment.
|
|
53
|
+
const REVEALS_SECRET = /\bvault\s+(?:get|keygen)\b|\bvault-key\b|\bENGRAM_VAULT_KEY\b/i;
|
|
54
|
+
/**
|
|
55
|
+
* Every string in a tool call's input, nested ones included: a shell
|
|
56
|
+
* command, a file-reading tool's path, an MCP tool's arguments. Looking only
|
|
57
|
+
* at `command` let a Read of the key file through (engram#619).
|
|
58
|
+
*/
|
|
59
|
+
function stringsOf(value, out = [], depth = 0) {
|
|
60
|
+
if (typeof value === "string")
|
|
61
|
+
out.push(value);
|
|
62
|
+
else if (value && typeof value === "object" && depth < 8) {
|
|
63
|
+
for (const v of Object.values(value))
|
|
64
|
+
stringsOf(v, out, depth + 1);
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
53
67
|
}
|
|
54
68
|
export const REDACTED_TOOL_OUTPUT = "[output withheld by engram: this command prints a secret]";
|
|
55
69
|
/**
|
|
@@ -59,22 +73,37 @@ export const REDACTED_TOOL_OUTPUT = "[output withheld by engram: this command pr
|
|
|
59
73
|
* response may span multiple lines sharing the same `message.id`. We
|
|
60
74
|
* accumulate blocks and flush when the message is complete (stop_reason
|
|
61
75
|
* is set) or a new message begins.
|
|
76
|
+
*
|
|
77
|
+
* One parser reads every transcript of the host, interleaved: a session's
|
|
78
|
+
* subagents and workflows write files of their own next to it. So the
|
|
79
|
+
* accumulator is kept per file, and a message is emitted under the session
|
|
80
|
+
* of its own lines (engram#579). It used to be a single accumulator emitted
|
|
81
|
+
* under whichever session the parser had seen last, from any file — a
|
|
82
|
+
* reply could be filed under another session, or dropped along with it when
|
|
83
|
+
* that session was opted out.
|
|
62
84
|
*/
|
|
63
85
|
export class Parser {
|
|
64
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Every line names its session, so resuming a file needs no context but
|
|
88
|
+
* the recent tool calls: a `vault get` whose output is still to come.
|
|
89
|
+
* Wide enough to reach back past parallel tool calls with large outputs;
|
|
90
|
+
* past it, the value-exact scrubber (scrubber.ts) still applies.
|
|
91
|
+
*/
|
|
92
|
+
resumeContext = { headBytes: 0, tailBytes: 2 * 1024 * 1024 };
|
|
93
|
+
/** The buffered assistant message of each file that has one. */
|
|
94
|
+
pending = new Map();
|
|
65
95
|
/**
|
|
66
96
|
* tool_use ids whose result must not be captured. Bounded: an id is
|
|
67
|
-
* removed
|
|
68
|
-
* hundred tool calls at most.
|
|
97
|
+
* removed once its result is queued, and a session produces a few
|
|
98
|
+
* hundred tool calls at most. Tool ids are unique, so one set serves
|
|
99
|
+
* every file.
|
|
69
100
|
*/
|
|
70
101
|
secretToolIds = new Set();
|
|
71
|
-
lastSessionId = null;
|
|
72
|
-
lastMeta = null;
|
|
73
102
|
onMessages;
|
|
74
103
|
constructor(onMessages) {
|
|
75
104
|
this.onMessages = onMessages;
|
|
76
105
|
}
|
|
77
|
-
processLine(line, filePath) {
|
|
106
|
+
processLine(line, filePath, offset) {
|
|
78
107
|
let data;
|
|
79
108
|
try {
|
|
80
109
|
data = JSON.parse(line);
|
|
@@ -82,6 +111,8 @@ export class Parser {
|
|
|
82
111
|
catch {
|
|
83
112
|
return; // malformed line, skip
|
|
84
113
|
}
|
|
114
|
+
if (!data || typeof data !== "object")
|
|
115
|
+
return; // valid JSON, not a record
|
|
85
116
|
// Skip noise
|
|
86
117
|
if (SKIP_TYPES.has(data.type))
|
|
87
118
|
return;
|
|
@@ -100,22 +131,61 @@ export class Parser {
|
|
|
100
131
|
version: data.version,
|
|
101
132
|
host: "claude-code",
|
|
102
133
|
};
|
|
103
|
-
this.lastSessionId = sessionId;
|
|
104
|
-
this.lastMeta = meta;
|
|
105
134
|
if (!data.message)
|
|
106
135
|
return;
|
|
107
136
|
if (data.type === "user") {
|
|
108
|
-
//
|
|
109
|
-
this.flushPending();
|
|
137
|
+
// A user turn ends this file's buffered assistant message
|
|
138
|
+
this.flushPending(filePath);
|
|
110
139
|
this.processUserLine(sessionId, meta, data);
|
|
111
140
|
}
|
|
112
141
|
else if (data.type === "assistant") {
|
|
113
|
-
this.processAssistantLine(sessionId, meta, data);
|
|
142
|
+
this.processAssistantLine(sessionId, meta, data, filePath, offset);
|
|
114
143
|
}
|
|
115
144
|
}
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Replays a line an earlier daemon process already handled — the watcher
|
|
147
|
+
* does this for the lines just before where it resumes a file. Only one
|
|
148
|
+
* thing spans lines across a restart: which tool calls print a secret.
|
|
149
|
+
* Without it, a `vault get` whose output was written after the daemon
|
|
150
|
+
* restarted had that output captured. Never emits.
|
|
151
|
+
*/
|
|
152
|
+
restoreLine(line, _filePath) {
|
|
153
|
+
// Cheap pre-check: only tool_use and tool_result lines matter here.
|
|
154
|
+
if (!line.includes("tool_"))
|
|
155
|
+
return;
|
|
156
|
+
let data;
|
|
157
|
+
try {
|
|
158
|
+
data = JSON.parse(line);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const content = data?.message?.content;
|
|
164
|
+
if (!Array.isArray(content))
|
|
165
|
+
return;
|
|
166
|
+
for (const block of content) {
|
|
167
|
+
if (data.type === "assistant" && block.type === "tool_use") {
|
|
168
|
+
this.trackSecretTool(block);
|
|
169
|
+
}
|
|
170
|
+
else if (data.type === "user" && block.type === "tool_result" && block.tool_use_id) {
|
|
171
|
+
this.secretToolIds.delete(block.tool_use_id);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
bufferedFrom(filePath) {
|
|
176
|
+
return this.pending.get(filePath)?.from ?? null;
|
|
177
|
+
}
|
|
178
|
+
discard(filePath) {
|
|
179
|
+
this.pending.delete(filePath);
|
|
180
|
+
}
|
|
181
|
+
/** Emit buffered assistant messages: one file's, or every file's. */
|
|
182
|
+
flush(filePath) {
|
|
183
|
+
if (filePath !== undefined) {
|
|
184
|
+
this.flushPending(filePath);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
for (const path of [...this.pending.keys()])
|
|
188
|
+
this.flushPending(path);
|
|
119
189
|
}
|
|
120
190
|
processUserLine(sessionId, meta, data) {
|
|
121
191
|
const content = data.message.content;
|
|
@@ -139,6 +209,10 @@ export class Parser {
|
|
|
139
209
|
return;
|
|
140
210
|
const messages = [];
|
|
141
211
|
const parts = [];
|
|
212
|
+
// Forgotten only once the withheld output is queued: when queuing
|
|
213
|
+
// fails, the watcher reads this line again, and the output must be
|
|
214
|
+
// withheld again (engram#584).
|
|
215
|
+
const withheldIds = [];
|
|
142
216
|
for (const block of content) {
|
|
143
217
|
if (block.type === "text" && block.text?.trim()) {
|
|
144
218
|
parts.push(block.text);
|
|
@@ -147,7 +221,11 @@ export class Parser {
|
|
|
147
221
|
parts.push(describeImage(block));
|
|
148
222
|
}
|
|
149
223
|
else if (block.type === "tool_result") {
|
|
150
|
-
|
|
224
|
+
let withheld = false;
|
|
225
|
+
if (block.tool_use_id && this.secretToolIds.has(block.tool_use_id)) {
|
|
226
|
+
withheld = true;
|
|
227
|
+
withheldIds.push(block.tool_use_id);
|
|
228
|
+
}
|
|
151
229
|
const text = withheld
|
|
152
230
|
? REDACTED_TOOL_OUTPUT
|
|
153
231
|
: typeof block.content === "string"
|
|
@@ -170,51 +248,65 @@ export class Parser {
|
|
|
170
248
|
if (messages.length > 0) {
|
|
171
249
|
this.onMessages(sessionId, meta, messages);
|
|
172
250
|
}
|
|
251
|
+
for (const id of withheldIds)
|
|
252
|
+
this.secretToolIds.delete(id);
|
|
173
253
|
}
|
|
174
|
-
processAssistantLine(sessionId, meta, data) {
|
|
254
|
+
processAssistantLine(sessionId, meta, data, filePath, offset) {
|
|
175
255
|
const msg = data.message;
|
|
176
256
|
const messageId = msg.id ?? "";
|
|
177
257
|
const content = msg.content;
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
|
|
258
|
+
// A new message ID in this file ends the previous one
|
|
259
|
+
let pending = this.pending.get(filePath);
|
|
260
|
+
if (pending && pending.messageId !== messageId) {
|
|
261
|
+
this.flushPending(filePath);
|
|
262
|
+
pending = undefined;
|
|
181
263
|
}
|
|
182
264
|
// Initialize accumulator if needed
|
|
183
|
-
if (!
|
|
184
|
-
|
|
265
|
+
if (!pending) {
|
|
266
|
+
pending = { messageId, textParts: [], toolUses: [], sessionId, meta, from: offset };
|
|
267
|
+
this.pending.set(filePath, pending);
|
|
185
268
|
}
|
|
269
|
+
pending.sessionId = sessionId;
|
|
270
|
+
pending.meta = meta;
|
|
186
271
|
// Accumulate content blocks
|
|
187
272
|
if (typeof content === "string") {
|
|
188
273
|
if (content.trim()) {
|
|
189
|
-
|
|
274
|
+
pending.textParts.push(content);
|
|
190
275
|
}
|
|
191
276
|
}
|
|
192
277
|
else if (Array.isArray(content)) {
|
|
193
278
|
for (const block of content) {
|
|
194
279
|
if (block.type === "text" && block.text?.trim()) {
|
|
195
|
-
|
|
280
|
+
pending.textParts.push(block.text);
|
|
196
281
|
}
|
|
197
|
-
else if (block.type === "tool_use"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.secretToolIds.add(block.id);
|
|
282
|
+
else if (block.type === "tool_use") {
|
|
283
|
+
if (block.name) {
|
|
284
|
+
pending.toolUses.push({
|
|
285
|
+
name: block.name,
|
|
286
|
+
input: block.input,
|
|
287
|
+
});
|
|
204
288
|
}
|
|
289
|
+
this.trackSecretTool(block);
|
|
205
290
|
}
|
|
206
291
|
// Skip thinking blocks — internal reasoning, not conversation
|
|
207
292
|
}
|
|
208
293
|
}
|
|
209
294
|
// If stop_reason is set, message is complete
|
|
210
295
|
if (msg.stop_reason) {
|
|
211
|
-
this.flushPending();
|
|
296
|
+
this.flushPending(filePath);
|
|
212
297
|
}
|
|
213
298
|
}
|
|
214
|
-
|
|
215
|
-
if (
|
|
299
|
+
trackSecretTool(block) {
|
|
300
|
+
if (block.id && stringsOf(block.input).some((s) => REVEALS_SECRET.test(s))) {
|
|
301
|
+
this.secretToolIds.add(block.id);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
flushPending(filePath) {
|
|
305
|
+
const pending = this.pending.get(filePath);
|
|
306
|
+
if (!pending)
|
|
216
307
|
return;
|
|
217
|
-
|
|
308
|
+
this.pending.delete(filePath);
|
|
309
|
+
const { textParts, toolUses, sessionId, meta } = pending;
|
|
218
310
|
const messages = [];
|
|
219
311
|
// Emit text content as assistant message
|
|
220
312
|
const text = textParts.join("\n\n").trim();
|
|
@@ -225,22 +317,30 @@ export class Parser {
|
|
|
225
317
|
messages.push({ role: "assistant", content: text, metadata });
|
|
226
318
|
}
|
|
227
319
|
if (messages.length > 0) {
|
|
228
|
-
this.onMessages(
|
|
320
|
+
this.onMessages(sessionId, meta, messages);
|
|
229
321
|
}
|
|
230
|
-
this.pending = null;
|
|
231
322
|
}
|
|
232
323
|
extractProjectDir(filePath) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
324
|
+
return claudeProjectDir(filePath);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Project name from a Claude Code transcript path:
|
|
329
|
+
* ~/.claude/projects/-Users-op-code-engram/session.jsonl → "engram"
|
|
330
|
+
* C:\Users\op\.claude\projects\C--Users-op-code-engram\session.jsonl → "engram"
|
|
331
|
+
* (the last segment of the hyphen-encoded project directory). Either
|
|
332
|
+
* separator: split on "/" alone, every Windows conversation was filed under
|
|
333
|
+
* "unknown" (engram#602).
|
|
334
|
+
*/
|
|
335
|
+
export function claudeProjectDir(filePath) {
|
|
336
|
+
const parts = filePath.split(/[\\/]/);
|
|
337
|
+
const projectsIdx = parts.indexOf("projects");
|
|
338
|
+
if (projectsIdx >= 0 && projectsIdx + 1 < parts.length) {
|
|
339
|
+
const dirName = parts[projectsIdx + 1];
|
|
340
|
+
// Take the last segment of the hyphenated path
|
|
341
|
+
const segments = dirName.split("-").filter(Boolean);
|
|
342
|
+
return segments[segments.length - 1] ?? dirName;
|
|
244
343
|
}
|
|
344
|
+
return "unknown";
|
|
245
345
|
}
|
|
246
346
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/daemon/parser.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,uBAAuB;IACvB,UAAU;IACV,iBAAiB;IACjB,aAAa;CACd,CAAC,CAAC;AAwBH;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,KAAmB;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/E,kEAAkE;IAClE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,IAAI,GAAG,KAAK,IAAI,SAAS;QAC7B,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;QACxC,CAAC,CAAC,KAAK,IAAI,IAAI;YACb,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;YAClC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,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,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,OAAO,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows PowerShell, for what Node can't do by itself on Windows: show a
|
|
3
|
+
* toast (status.ts, engram#614), and find out whose process a PID is and
|
|
4
|
+
* what it runs (instance.ts, engram#640).
|
|
5
|
+
*
|
|
6
|
+
* Whatever varies, such as a title or a PID, goes to the script in an
|
|
7
|
+
* environment variable, never into it, so nothing in it can become script.
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT: Node built-ins only. instance.ts imports this, and the worker
|
|
10
|
+
* claims its lock through instance.ts before the native-module preflight
|
|
11
|
+
* (see launch.ts).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Windows PowerShell by its full path under the system root, never a
|
|
15
|
+
* powershell.exe found on PATH or in the working directory. It ships with
|
|
16
|
+
* every Windows 10 and 11.
|
|
17
|
+
*/
|
|
18
|
+
export declare function windowsPowerShellPath(systemRoot?: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* The arguments that run `statements`, one PowerShell statement each, with
|
|
21
|
+
* no profile and never a prompt. The statements have no double quotes,
|
|
22
|
+
* which the Windows command line would have to escape.
|
|
23
|
+
*/
|
|
24
|
+
export declare function powerShellArgs(statements: readonly string[]): string[];
|
|
25
|
+
//# sourceMappingURL=powershell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powershell.d.ts","sourceRoot":"","sources":["../../src/daemon/powershell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,GAAE,MAAgD,GAAG,MAAM,CAE1G;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows PowerShell, for what Node can't do by itself on Windows: show a
|
|
3
|
+
* toast (status.ts, engram#614), and find out whose process a PID is and
|
|
4
|
+
* what it runs (instance.ts, engram#640).
|
|
5
|
+
*
|
|
6
|
+
* Whatever varies, such as a title or a PID, goes to the script in an
|
|
7
|
+
* environment variable, never into it, so nothing in it can become script.
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT: Node built-ins only. instance.ts imports this, and the worker
|
|
10
|
+
* claims its lock through instance.ts before the native-module preflight
|
|
11
|
+
* (see launch.ts).
|
|
12
|
+
*/
|
|
13
|
+
import { win32 } from "node:path";
|
|
14
|
+
/**
|
|
15
|
+
* Windows PowerShell by its full path under the system root, never a
|
|
16
|
+
* powershell.exe found on PATH or in the working directory. It ships with
|
|
17
|
+
* every Windows 10 and 11.
|
|
18
|
+
*/
|
|
19
|
+
export function windowsPowerShellPath(systemRoot = process.env.SystemRoot || "C:\\Windows") {
|
|
20
|
+
return win32.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The arguments that run `statements`, one PowerShell statement each, with
|
|
24
|
+
* no profile and never a prompt. The statements have no double quotes,
|
|
25
|
+
* which the Windows command line would have to escape.
|
|
26
|
+
*/
|
|
27
|
+
export function powerShellArgs(statements) {
|
|
28
|
+
return ["-NoProfile", "-NonInteractive", "-Command", statements.join("; ")];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=powershell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powershell.js","sourceRoot":"","sources":["../../src/daemon/powershell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAqB,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,aAAa;IAChG,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC3F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,UAA6B;IAC1D,OAAO,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/daemon/preflight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/daemon/preflight.ts"],"names":[],"mappings":"AAmDA,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAA8B,GACnD,OAAO,CAwCT"}
|
package/dist/daemon/preflight.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { execSync } from "node:child_process";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
|
+
import { engramCommand } from "./package-runner.js";
|
|
4
5
|
// IMPORTANT: this module must never import better-sqlite3 (or anything
|
|
5
6
|
// that does) statically — its whole job is to run before the native
|
|
6
7
|
// module loads and heal an ABI mismatch.
|
|
@@ -62,6 +63,9 @@ export function ensureNativeSqlite(log = (m) => console.error(m)) {
|
|
|
62
63
|
cwd: ownerDir,
|
|
63
64
|
stdio: "pipe",
|
|
64
65
|
timeout: 180_000,
|
|
66
|
+
// The daemon has no console; on Windows a rebuild would otherwise
|
|
67
|
+
// open one, and the compiler's, in front of the user (engram#602).
|
|
68
|
+
windowsHide: true,
|
|
65
69
|
});
|
|
66
70
|
// Re-probe, not re-require: the failed module stays in require's
|
|
67
71
|
// cache, so only a fresh open proves the rebuild took.
|
|
@@ -73,7 +77,7 @@ export function ensureNativeSqlite(log = (m) => console.error(m)) {
|
|
|
73
77
|
catch {
|
|
74
78
|
log("Automatic rebuild failed. Fix manually with:\n" +
|
|
75
79
|
` cd ${ownerDir || "<the directory containing node_modules/better-sqlite3>"} && npm rebuild better-sqlite3\n` +
|
|
76
|
-
|
|
80
|
+
`then run '${engramCommand("start")}' again.`);
|
|
77
81
|
return false;
|
|
78
82
|
}
|
|
79
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/daemon/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/daemon/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,uEAAuE;AACvE,oEAAoE;AACpE,yCAAyC;AAEzC,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE3C,MAAM,YAAY,GAChB,8IAA8I,CAAC;AAEjJ;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;;;;GAIG;AACH,SAAS,WAAW;IAClB,MAAM,QAAQ,GAAG,GAAG,CAAC,gBAAgB,CAA4C,CAAC;IAClF,MAAM,EAAE,GAAG,IAAI,QAAQ,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DAAgD;gBAC9C,QAAQ,QAAQ,IAAI,wDAAwD,kCAAkC;gBAC9G,aAAa,aAAa,CAAC,OAAO,CAAC,UAAU,CAChD,CAAC;YACF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clears sent messages out of the local queue (engram#598).
|
|
3
|
+
*
|
|
4
|
+
* daemon.db holds what the watcher reads until the server has it. When the
|
|
5
|
+
* server confirms it has stored a batch, the batch's rows are marked sent,
|
|
6
|
+
* and until now they stayed: the file kept a copy of every message ever
|
|
7
|
+
* captured, growing without end. Nothing reads a sent row again. The
|
|
8
|
+
* transcript it was read from is still where it was, and the server has it.
|
|
9
|
+
*
|
|
10
|
+
* Once an hour (the first time a couple of minutes after the daemon
|
|
11
|
+
* starts), rows sent more than SENT_RETENTION_DAYS days ago are deleted, a
|
|
12
|
+
* few hundred at a time with pauses in between, so capture and sending
|
|
13
|
+
* carry on as usual. A row that hasn't been sent is never deleted, however
|
|
14
|
+
* old it is. The days in between leave time to look into a problem with
|
|
15
|
+
* the local queue while its rows are still there.
|
|
16
|
+
*
|
|
17
|
+
* What is deleted leaves the file as well. secure_delete (see db.ts)
|
|
18
|
+
* writes zeros over it, the space it took goes back to the disk, and each
|
|
19
|
+
* pass ends by emptying the write-ahead log. A daemon.db made before this
|
|
20
|
+
* is rewritten once (DaemonDb.compact), when the disks it writes to have
|
|
21
|
+
* room for that, which also clears what earlier deletes left in its free
|
|
22
|
+
* pages.
|
|
23
|
+
*/
|
|
24
|
+
import type { DaemonDb } from "./db.js";
|
|
25
|
+
/** How long a sent message stays in the local queue. */
|
|
26
|
+
export declare const SENT_RETENTION_DAYS = 30;
|
|
27
|
+
export declare const SENT_RETENTION_MS: number;
|
|
28
|
+
/** The first pass waits this long after the daemon starts, past the busy
|
|
29
|
+
* first reads of the transcripts. */
|
|
30
|
+
export declare const FIRST_PASS_MS: number;
|
|
31
|
+
/** Then a pass every hour. */
|
|
32
|
+
export declare const PASS_INTERVAL_MS: number;
|
|
33
|
+
/** Rows deleted in one transaction. */
|
|
34
|
+
export declare const PRUNE_BATCH = 200;
|
|
35
|
+
/** Free pages given back to the disk in one step (8 MB of 4 KB pages). */
|
|
36
|
+
export declare const RELEASE_STEP_PAGES = 2048;
|
|
37
|
+
/** The pause between batches and steps, so the queue isn't held for long. */
|
|
38
|
+
export declare const STEP_PAUSE_MS = 50;
|
|
39
|
+
/** Compacting that was skipped or failed is tried again a day later. */
|
|
40
|
+
export declare const COMPACT_RETRY_MS: number;
|
|
41
|
+
/** Compacting writes a copy of the live data to a temporary file and
|
|
42
|
+
* again to the write-ahead log. It starts only when each disk it writes
|
|
43
|
+
* to has three times that free, and this much more. */
|
|
44
|
+
export declare const COMPACT_SPARE_BYTES: number;
|
|
45
|
+
/**
|
|
46
|
+
* The directory SQLite writes the temporary copy a VACUUM makes to: the
|
|
47
|
+
* first of these it can use, picked as SQLite itself picks it (os_unix.c,
|
|
48
|
+
* unixTempFileDir; on Windows, GetTempPathW's order). Null when none is.
|
|
49
|
+
*/
|
|
50
|
+
export declare function sqliteTempDir(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): string | null;
|
|
51
|
+
/** Bytes free to this user on the disk that holds `path`; null when that
|
|
52
|
+
* can't be told (fs.statfsSync came in Node 18.15). */
|
|
53
|
+
export declare function freeBytesAt(path: string): number | null;
|
|
54
|
+
export interface PrunerOptions {
|
|
55
|
+
/** Writes a line to the daemon log. */
|
|
56
|
+
log: (msg: string) => void;
|
|
57
|
+
now?: () => number;
|
|
58
|
+
pause?: (ms: number) => Promise<void>;
|
|
59
|
+
freeBytes?: (path: string) => number | null;
|
|
60
|
+
tempDir?: () => string | null;
|
|
61
|
+
}
|
|
62
|
+
export declare class Pruner {
|
|
63
|
+
private readonly db;
|
|
64
|
+
private readonly dbPath;
|
|
65
|
+
private readonly log;
|
|
66
|
+
private readonly now;
|
|
67
|
+
private readonly pause;
|
|
68
|
+
private readonly freeBytes;
|
|
69
|
+
private readonly tempDir;
|
|
70
|
+
private timer;
|
|
71
|
+
private running;
|
|
72
|
+
private stopped;
|
|
73
|
+
/** Compacting isn't tried again before this time. */
|
|
74
|
+
private compactAfter;
|
|
75
|
+
/** The last problem logged: the same one again isn't logged every hour. */
|
|
76
|
+
private lastProblem;
|
|
77
|
+
private problemThisPass;
|
|
78
|
+
constructor(db: DaemonDb, dbPath: string, opts: PrunerOptions);
|
|
79
|
+
start(): void;
|
|
80
|
+
/** No pass starts after this, and a pass in progress stops at its next
|
|
81
|
+
* step without touching the database again: close it after this. */
|
|
82
|
+
stop(): void;
|
|
83
|
+
/** Settles when no pass is running. */
|
|
84
|
+
idle(): Promise<void>;
|
|
85
|
+
private schedule;
|
|
86
|
+
/** One pass: delete the rows that are due, give the space they took
|
|
87
|
+
* back to the disk, and empty the write-ahead log. Never throws. */
|
|
88
|
+
pass(): Promise<void>;
|
|
89
|
+
/** Deletes the sent rows that are due, PRUNE_BATCH at a time, and
|
|
90
|
+
* returns how many went. */
|
|
91
|
+
private prune;
|
|
92
|
+
/** Gives the space that deleted rows took back to the disk. */
|
|
93
|
+
private reclaim;
|
|
94
|
+
private release;
|
|
95
|
+
/** Rewrites a daemon.db made before engram#598, once, when the disks it
|
|
96
|
+
* writes to have room. Tried at most once a day. */
|
|
97
|
+
private compact;
|
|
98
|
+
/** Logs a problem, unless it's the one logged last. */
|
|
99
|
+
private problem;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=prune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../src/daemon/prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,SAAS,CAAC;AAKnD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,iBAA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