@mnemonik/claude-code-hooks 0.9.22 → 0.9.23

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/install.js CHANGED
@@ -4,7 +4,8 @@
4
4
  * Claude Code settings without clobbering the user's existing config.
5
5
  *
6
6
  * What it does:
7
- * 1. Resolves the dispatcher path (this package's dist/hook.js).
7
+ * 1. Copies the dispatcher and its shared runtime dependency to a stable,
8
+ * content-addressed ~/.mnemonik/hooks directory.
8
9
  * 2. Reads (or creates) ~/.claude/settings.json by default.
9
10
  * Use --scope=project to target .claude/settings.json at the cwd.
10
11
  * 3. Merges PreToolUse/PostToolUse entries pointing at `node <dispatcher>`,
@@ -12,13 +13,17 @@
12
13
  * installer is idempotent.
13
14
  * 4. Writes the file back, preserving any unrelated user config.
14
15
  *
15
- * No npm dependencies — uses Node 20 builtins only.
16
+ * Installer mechanics use Node 20 builtins only; the copied dispatcher keeps
17
+ * its exact resolved @mnemonik/shared dependency.
16
18
  */
17
19
  import { existsSync, realpathSync } from 'node:fs';
18
- import { mkdir, readFile, writeFile } from 'node:fs/promises';
19
20
  import { dirname, join, resolve } from 'node:path';
20
21
  import { fileURLToPath } from 'node:url';
22
+ import { atomicWriteTransaction, buildManagedCommand, canonicalizeConfigTargets, installerConfigLockPath, installDurableRuntime, isManagedCommand, parseManagedCommand, readTextIfExists, resolvePackageRoot, resolveRuntimeParent, withFileLocks, } from './lib/installerSupport.js';
21
23
  const HOOK_TAG = 'mnemonik-claude-code-hooks';
24
+ const HOOK_OWNER = 'claude-code-hooks';
25
+ const STATUSLINE_OWNER = 'claude-code-statusline';
26
+ const PACKAGE_NAME = '@mnemonik/claude-code-hooks';
22
27
  function resolveDispatcherPath() {
23
28
  // dist/install.js → dist/hook.js
24
29
  const here = fileURLToPath(import.meta.url);
@@ -31,40 +36,45 @@ function resolveStatuslinePath() {
31
36
  }
32
37
  /**
33
38
  * Decide the statusLine wiring without touching disk. NEVER clobbers a user's
34
- * existing statusline: only returns an entry to write when the key is absent
35
- * and our executable is built. `set` is the new config (or null to leave the
36
- * settings untouched); `note` is the human-readable install-output line.
39
+ * existing custom statusline: writes when the key is absent or when the old
40
+ * value is explicitly Mnemonik-owned, and only when the executable is built.
41
+ * `set` is the new config (or null to leave settings untouched).
37
42
  */
38
43
  function statusLineDecision(existing, statuslinePath, built) {
39
44
  if (!built)
40
45
  return { set: null, note: ` statusLine → skipped (statusline.js not built)` };
41
- if (existing !== undefined) {
46
+ if (existing !== undefined &&
47
+ !isManagedCommand(existing.command, STATUSLINE_OWNER, PACKAGE_NAME, 'statusline.js', statuslinePath)) {
42
48
  return {
43
49
  set: null,
44
50
  note: ` statusLine → left unchanged (existing custom statusline preserved)`,
45
51
  };
46
52
  }
47
53
  return {
48
- set: { type: 'command', command: `node ${JSON.stringify(statuslinePath)}` },
54
+ set: { type: 'command', command: buildManagedCommand(statuslinePath, STATUSLINE_OWNER) },
49
55
  note: ` statusLine → node ${statuslinePath}`,
50
56
  };
51
57
  }
52
58
  function buildHookEntry(dispatcher) {
53
59
  return {
54
60
  type: 'command',
55
- command: `node ${JSON.stringify(dispatcher)}`,
61
+ command: buildManagedCommand(dispatcher, HOOK_OWNER),
56
62
  timeout: 5,
57
63
  };
58
64
  }
59
- function isMnemonikEntry(entry) {
60
- // We tag both via the matcher and the dispatcher path so re-runs find us
61
- // even if the user changed the matcher manually.
65
+ function isMnemonikHookCommand(command, currentDispatcher) {
66
+ return isManagedCommand(command, HOOK_OWNER, PACKAGE_NAME, 'hook.js', currentDispatcher);
67
+ }
68
+ function isMnemonikEntry(entry, currentDispatcher) {
62
69
  if (entry.matcher === HOOK_TAG)
63
70
  return true;
64
- return Boolean(entry.hooks?.some((h) => typeof h.command === 'string' && h.command.includes('claude-code-hooks')));
71
+ return Boolean(entry.hooks?.some((hook) => typeof hook.command === 'string'
72
+ ? isMnemonikHookCommand(hook.command, currentDispatcher)
73
+ : false));
65
74
  }
66
75
  function patchHookGroup(groups, matcher, entry) {
67
- const filtered = (groups ?? []).filter((g) => !isMnemonikEntry(g));
76
+ const currentDispatcher = parseManagedCommand(entry.command, HOOK_OWNER) ?? undefined;
77
+ const filtered = removeMnemonikHookGroups(groups, currentDispatcher);
68
78
  // Lifecycle hooks (SessionStart, Stop, PreCompact, SessionEnd,
69
79
  // UserPromptSubmit) don't use a matcher — they fire on every event of
70
80
  // that name. PreToolUse / PostToolUse use the regex matcher to scope by
@@ -77,32 +87,110 @@ function patchHookGroup(groups, matcher, entry) {
77
87
  }
78
88
  return filtered;
79
89
  }
90
+ function removeMnemonikHookGroups(groups, currentDispatcher) {
91
+ const filtered = [];
92
+ for (const group of groups ?? []) {
93
+ const originalHooks = group.hooks ?? [];
94
+ const remainingHooks = originalHooks.filter((hook) => typeof hook.command !== 'string' || !isMnemonikHookCommand(hook.command, currentDispatcher));
95
+ const removedManagedHook = remainingHooks.length !== originalHooks.length;
96
+ if (removedManagedHook) {
97
+ if (remainingHooks.length > 0)
98
+ filtered.push({ ...group, hooks: remainingHooks });
99
+ }
100
+ else if (!(group.matcher === HOOK_TAG && originalHooks.length === 0)) {
101
+ filtered.push(group);
102
+ }
103
+ }
104
+ return filtered;
105
+ }
106
+ function isRecord(value) {
107
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
108
+ }
109
+ function validateSettings(parsed) {
110
+ if (!isRecord(parsed))
111
+ throw new Error('expected a top-level JSON object');
112
+ if (parsed.hooks !== undefined) {
113
+ if (!isRecord(parsed.hooks))
114
+ throw new Error('expected "hooks" to be a JSON object');
115
+ for (const [event, groups] of Object.entries(parsed.hooks)) {
116
+ if (!Array.isArray(groups) || !groups.every(isRecord)) {
117
+ throw new Error(`expected "hooks.${event}" to be an array of hook groups`);
118
+ }
119
+ for (const group of groups) {
120
+ if (group.hooks !== undefined) {
121
+ if (!Array.isArray(group.hooks) || !group.hooks.every(isRecord)) {
122
+ throw new Error(`expected "hooks.${event}[].hooks" to be an array of hook objects`);
123
+ }
124
+ for (const hook of group.hooks) {
125
+ if (hook.command !== undefined && typeof hook.command !== 'string') {
126
+ throw new Error(`expected "hooks.${event}[].hooks[].command" to be a string`);
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ if (parsed.statusLine !== undefined) {
134
+ if (!isRecord(parsed.statusLine) || typeof parsed.statusLine.command !== 'string') {
135
+ throw new Error('expected "statusLine" to be a command object');
136
+ }
137
+ }
138
+ return parsed;
139
+ }
80
140
  async function readSettings(path) {
81
- if (!existsSync(path))
82
- return {};
141
+ const raw = await readTextIfExists(path);
142
+ if (raw === null)
143
+ return { settings: {}, raw: null };
83
144
  try {
84
- const raw = await readFile(path, 'utf8');
85
- return JSON.parse(raw);
145
+ return { settings: validateSettings(JSON.parse(raw)), raw };
86
146
  }
87
147
  catch (err) {
88
148
  throw new Error(`Could not parse ${path}: ${err instanceof Error ? err.message : String(err)}`);
89
149
  }
90
150
  }
91
- async function writeSettings(path, settings) {
92
- await mkdir(dirname(path), { recursive: true });
93
- // Preserve a trailing newline since prettier-style users rely on it.
94
- await writeFile(path, JSON.stringify(settings, null, 2) + '\n', 'utf8');
95
- }
96
151
  function parseArgs(argv) {
97
152
  let target = 'host';
153
+ let explicitTarget = null;
154
+ let sawInstall = false;
98
155
  for (const arg of argv) {
156
+ if (arg === 'install' && !sawInstall) {
157
+ sawInstall = true;
158
+ continue;
159
+ }
160
+ let parsedTarget = null;
99
161
  if (arg === '--scope=project')
100
- target = 'project';
162
+ parsedTarget = 'project';
101
163
  else if (arg === '--scope=user' || arg === '--scope=host')
102
- target = 'host';
164
+ parsedTarget = 'host';
165
+ else
166
+ throw new Error(`Unknown installer argument: ${arg}`);
167
+ if (explicitTarget && explicitTarget !== parsedTarget) {
168
+ throw new Error('Conflicting --scope arguments');
169
+ }
170
+ explicitTarget = parsedTarget;
171
+ target = parsedTarget;
103
172
  }
104
173
  return { target };
105
174
  }
175
+ function removeMnemonikHooks(settings, currentDispatcher) {
176
+ if (!settings.hooks)
177
+ return false;
178
+ let changed = false;
179
+ for (const [event, value] of Object.entries(settings.hooks)) {
180
+ const groups = value;
181
+ const remaining = removeMnemonikHookGroups(groups, currentDispatcher);
182
+ const eventChanged = remaining.length !== groups.length ||
183
+ remaining.some((group, index) => group !== groups[index]);
184
+ if (!eventChanged)
185
+ continue;
186
+ changed = true;
187
+ if (remaining.length === 0)
188
+ delete settings.hooks[event];
189
+ else
190
+ settings.hooks[event] = remaining;
191
+ }
192
+ return changed;
193
+ }
106
194
  function resolveTargetPath(target, cwd, env = process.env) {
107
195
  if (target === 'project')
108
196
  return join(cwd, '.claude', 'settings.json');
@@ -115,58 +203,104 @@ function resolveTargetPath(target, cwd, env = process.env) {
115
203
  async function main(argv) {
116
204
  const { target } = parseArgs(argv);
117
205
  const cwd = process.cwd();
118
- const settingsPath = resolveTargetPath(target, cwd);
206
+ const requestedSettingsPath = resolveTargetPath(target, cwd);
207
+ const requestedAlternatePath = resolveTargetPath(target === 'host' ? 'project' : 'host', cwd);
208
+ const [settingsPath, alternatePath] = await canonicalizeConfigTargets([
209
+ requestedSettingsPath,
210
+ requestedAlternatePath,
211
+ ]);
212
+ const runtimeParent = resolveRuntimeParent();
119
213
  const dispatcher = resolveDispatcherPath();
120
214
  if (!existsSync(dispatcher)) {
121
215
  console.error(`mnemonik-claude-code-hooks: dispatcher not found at ${dispatcher}. Did the package install correctly?`);
122
216
  return 1;
123
217
  }
124
- const settings = await readSettings(settingsPath);
125
- const hooks = (settings.hooks ?? {});
126
- const entry = buildHookEntry(dispatcher);
127
- // PreToolUse guard Edit / Write / NotebookEdit / Bash, plus the
128
- // Mnemonik MCP namespace for server-side ordering-rule precheck
129
- // (cursor-hooks.plan.md §16). Grep is count-only (v1.1): it never blocks,
130
- // it just lets handlePreGrep ping the server so native Grep calls count
131
- // toward the code_search_reminder nudge the same way shell grep/rg/ag do.
132
- hooks.PreToolUse = patchHookGroup(hooks.PreToolUse, 'Edit|Write|NotebookEdit|Bash|Grep|mcp__mnemonik__.*', entry);
133
- // PostToolUse keep filesEdited fresh after edits, and mirror Mnemonik MCP
134
- // results back to the server so checkpoint/context state can clear hook gates.
135
- hooks.PostToolUse = patchHookGroup(hooks.PostToolUse, 'Edit|Write|NotebookEdit|mcp__mnemonik__.*', entry);
136
- // Lifecycle hooks (P5) — bootstrap pre-injection, checkpoint gate,
137
- // pre-compaction snapshot, end-of-session save, and user-prompt context.
138
- // No matcher: each fires on every event of that name.
139
- hooks.SessionStart = patchHookGroup(hooks.SessionStart, null, entry);
140
- hooks.Stop = patchHookGroup(hooks.Stop, null, entry);
141
- hooks.PreCompact = patchHookGroup(hooks.PreCompact, null, entry);
142
- hooks.SessionEnd = patchHookGroup(hooks.SessionEnd, null, entry);
143
- hooks.UserPromptSubmit = patchHookGroup(hooks.UserPromptSubmit, null, entry);
144
- settings.hooks = hooks;
145
- // statusLine (temporal-grounding config-C) — NEVER clobber a user's existing
146
- // statusline. Only wire ours when the key is absent; a custom command stays.
147
- const statusline = resolveStatuslinePath();
148
- const { set: statusLineSet, note: statusLineNote } = statusLineDecision(settings.statusLine, statusline, existsSync(statusline));
149
- if (statusLineSet)
150
- settings.statusLine = statusLineSet;
151
- await writeSettings(settingsPath, settings);
218
+ let installedDispatcher = dispatcher;
219
+ let installedStatusline = resolveStatuslinePath();
220
+ let statusLineNote = '';
221
+ let alternateMigrated = false;
222
+ await withFileLocks([
223
+ installerConfigLockPath(settingsPath, runtimeParent),
224
+ installerConfigLockPath(alternatePath, runtimeParent),
225
+ ], async () => {
226
+ const { settings, raw } = await readSettings(settingsPath);
227
+ const alternate = alternatePath === settingsPath ? null : await readSettings(alternatePath);
228
+ // Both scopes are parsed and validated before installing the runtime or
229
+ // changing either file. A malformed alternate scope is never ignored.
230
+ const runtime = await installDurableRuntime({
231
+ sourcePackageRoot: resolvePackageRoot(import.meta.url),
232
+ runtimeParent,
233
+ runtimeName: HOOK_OWNER,
234
+ entrypoints: ['hook.js', 'statusline.js'],
235
+ });
236
+ installedDispatcher = runtime.entrypoints['hook.js'];
237
+ installedStatusline = runtime.entrypoints['statusline.js'];
238
+ const hooks = (settings.hooks ?? {});
239
+ const entry = buildHookEntry(installedDispatcher);
240
+ // PreToolUse guard Edit / Write / NotebookEdit / Bash, plus the
241
+ // Mnemonik MCP namespace for server-side ordering-rule precheck
242
+ // (cursor-hooks.plan.md §16). Grep is count-only (v1.1): it never blocks,
243
+ // it just lets handlePreGrep ping the server so native Grep calls count
244
+ // toward the code_search_reminder nudge the same way shell grep/rg/ag do.
245
+ hooks.PreToolUse = patchHookGroup(hooks.PreToolUse, 'Edit|Write|NotebookEdit|Bash|Grep|mcp__mnemonik__.*', entry);
246
+ // PostToolUse — keep filesEdited fresh after edits, and mirror Mnemonik MCP
247
+ // results back to the server so checkpoint/context state can clear hook gates.
248
+ hooks.PostToolUse = patchHookGroup(hooks.PostToolUse, 'Edit|Write|NotebookEdit|mcp__mnemonik__.*', entry);
249
+ // Lifecycle hooks (P5) — bootstrap pre-injection, clean Stop,
250
+ // pre-compaction snapshot, end-of-session save, and user-prompt context.
251
+ // No matcher: each fires on every event of that name.
252
+ hooks.SessionStart = patchHookGroup(hooks.SessionStart, null, entry);
253
+ hooks.Stop = patchHookGroup(hooks.Stop, null, entry);
254
+ hooks.PreCompact = patchHookGroup(hooks.PreCompact, null, entry);
255
+ hooks.SessionEnd = patchHookGroup(hooks.SessionEnd, null, entry);
256
+ hooks.UserPromptSubmit = patchHookGroup(hooks.UserPromptSubmit, null, entry);
257
+ settings.hooks = hooks;
258
+ // statusLine (temporal-grounding config-C) — NEVER clobber a user's existing
259
+ // statusline. Only wire ours when the key is absent; a custom command stays.
260
+ const decision = statusLineDecision(settings.statusLine, installedStatusline, true);
261
+ statusLineNote = decision.note;
262
+ if (decision.set)
263
+ settings.statusLine = decision.set;
264
+ const changes = [
265
+ {
266
+ path: settingsPath,
267
+ expected: raw,
268
+ next: `${JSON.stringify(settings, null, 2)}\n`,
269
+ },
270
+ ];
271
+ if (alternate !== null && alternate.raw !== null) {
272
+ alternateMigrated = removeMnemonikHooks(alternate.settings, dispatcher);
273
+ if (alternateMigrated) {
274
+ changes.push({
275
+ path: alternatePath,
276
+ expected: alternate.raw,
277
+ next: `${JSON.stringify(alternate.settings, null, 2)}\n`,
278
+ });
279
+ }
280
+ }
281
+ await atomicWriteTransaction(changes);
282
+ });
152
283
  console.log([
153
- `mnemonik-claude-code-hooks: wired into ${settingsPath}`,
284
+ `mnemonik-claude-code-hooks: wired into ${requestedSettingsPath}`,
154
285
  ` target → ${target}`,
286
+ ...(alternateMigrated
287
+ ? [` migration → removed duplicate Mnemonik hooks from ${requestedAlternatePath}`]
288
+ : []),
155
289
  ` PreToolUse → Edit|Write|NotebookEdit|Bash|Grep|mcp__mnemonik__.*`,
156
290
  ` PostToolUse → Edit|Write|NotebookEdit`,
157
291
  ` SessionStart → bootstrap pre-injection`,
158
- ` Stop → checkpoint gate (advisory)`,
292
+ ` Stop → clean allow (checkpoint pressure rides PostToolUse)`,
159
293
  ` PreCompact → context_snapshot pre-injection`,
160
- ` SessionEnd → fire-and-forget save`,
294
+ ` SessionEnd → bounded save + per-session cleanup`,
161
295
  ` UserPromptSubmit → prompt-context inject`,
162
296
  statusLineNote,
163
- ` dispatcher → ${dispatcher}`,
297
+ ` dispatcher → ${installedDispatcher}`,
164
298
  ``,
165
299
  `Behavior is package-level, not per-project config:`,
166
300
  ` Bash policy reminders are server-driven. The dispatcher posts the`,
167
- ` command to /api/v1/hooks/policy-reminder; the server tokenizes,`,
168
- ` intersects with the project's policy index, and returns matched`,
169
- ` policies. The dispatcher emits them as additionalContext so the`,
301
+ ` command to /api/v1/hooks/injections; the server evaluates the`,
302
+ ` project's indexed policies and returns typed bus envelopes. The`,
303
+ ` dispatcher emits approved nudges as additionalContext so the`,
170
304
  ` agent reads them at the moment of action. There is no per-kind`,
171
305
  ` "advisory vs enforce" knob in the dispatcher anymore — that's`,
172
306
  ` decided server-side per policy.`,
@@ -175,11 +309,11 @@ async function main(argv) {
175
309
  ` dd of=<whole-disk>, mkfs <whole-disk>. These exist because we`,
176
310
  ` cannot trust the server to be reachable for "your machine is`,
177
311
  ` bricked" decisions. Bypass envelope still works.`,
178
- ` Other gate modes (preEdit, Stop checkpoint, lifecycle handlers)`,
312
+ ` Other gate modes (preEdit and lifecycle handlers)`,
179
313
  ` are package constants — they ship with sensible defaults that`,
180
314
  ` mature across versions. There are no JSON settings to flip.`,
181
315
  ``,
182
- `Bypass for trivial edits / stops / one-off catastrophic runs:`,
316
+ `Bypass for exceptional gated tool calls:`,
183
317
  ` MNEMONIK_BYPASS_HOOKS=1 MNEMONIK_BYPASS_TYPE=typo claude ...`,
184
318
  ].join('\n'));
185
319
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAmC9C,SAAS,qBAAqB;IAC5B,iCAAiC;IACjC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,qBAAqB;IAC5B,uCAAuC;IACvC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;AACjD,CAAC;AAED;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AC"}
@@ -62,11 +62,10 @@ export declare const PRE_EDIT_ADVISORY_AUTO_FETCH = true;
62
62
  * change, not a client one.
63
63
  */
64
64
  /**
65
- * Stop checkpoint gate (P5).
65
+ * Checkpoint-pressure rendering kill switch (legacy constant name).
66
66
  *
67
- * Currently advisory: emits a system-reminder nudge when the agent
68
- * tries to end its turn after meaningful edits without a checkpoint.
69
- * Will flip to enforce when telemetry warrants.
67
+ * Stop itself is always a clean allow because Stop output re-invokes the
68
+ * agent. This setting controls the discreet PostToolUse checkpoint context.
70
69
  */
71
70
  export declare const STOP_CHECKPOINT_GATE: GateMode;
72
71
  /**
@@ -83,7 +82,7 @@ export declare const PRE_MCP_GATE: GateMode;
83
82
  export declare const SESSION_START_BOOTSTRAP: SideEffectMode;
84
83
  /** PreCompact context_snapshot pre-injection. */
85
84
  export declare const PRE_COMPACT_SNAPSHOT: SideEffectMode;
86
- /** SessionEnd fire-and-forget save. */
85
+ /** SessionEnd lifecycle handling (legacy constant name); exact-session cleanup is bounded. */
87
86
  export declare const SESSION_END_SAVE: SideEffectMode;
88
87
  /** UserPromptSubmit prompt-context inject. */
89
88
  export declare const USER_PROMPT_CONTEXT: SideEffectMode;
@@ -58,11 +58,10 @@ export const PRE_EDIT_ADVISORY_AUTO_FETCH = true;
58
58
  * change, not a client one.
59
59
  */
60
60
  /**
61
- * Stop checkpoint gate (P5).
61
+ * Checkpoint-pressure rendering kill switch (legacy constant name).
62
62
  *
63
- * Currently advisory: emits a system-reminder nudge when the agent
64
- * tries to end its turn after meaningful edits without a checkpoint.
65
- * Will flip to enforce when telemetry warrants.
63
+ * Stop itself is always a clean allow because Stop output re-invokes the
64
+ * agent. This setting controls the discreet PostToolUse checkpoint context.
66
65
  */
67
66
  export const STOP_CHECKPOINT_GATE = 'advisory';
68
67
  /**
@@ -79,7 +78,7 @@ export const PRE_MCP_GATE = 'advisory';
79
78
  export const SESSION_START_BOOTSTRAP = 'on';
80
79
  /** PreCompact context_snapshot pre-injection. */
81
80
  export const PRE_COMPACT_SNAPSHOT = 'on';
82
- /** SessionEnd fire-and-forget save. */
81
+ /** SessionEnd lifecycle handling (legacy constant name); exact-session cleanup is bounded. */
83
82
  export const SESSION_END_SAVE = 'on';
84
83
  /** UserPromptSubmit prompt-context inject. */
85
84
  export const USER_PROMPT_CONTEXT = 'on';
@@ -1 +1 @@
1
- {"version":3,"file":"behavior.js","sourceRoot":"","sources":["../../src/lib/behavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAQH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAa,UAAU,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAa,UAAU,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa,UAAU,CAAC;AAEjD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,uBAAuB,GAAmB,IAAI,CAAC;AAE5D,iDAAiD;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAmB,IAAI,CAAC;AAEzD,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAmB,IAAI,CAAC;AAErD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAmB,IAAI,CAAC"}
1
+ {"version":3,"file":"behavior.js","sourceRoot":"","sources":["../../src/lib/behavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAQH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAa,UAAU,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAa,UAAU,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa,UAAU,CAAC;AAEjD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,uBAAuB,GAAmB,IAAI,CAAC;AAE5D,iDAAiD;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAmB,IAAI,CAAC;AAEzD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,gBAAgB,GAAmB,IAAI,CAAC;AAErD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAmB,IAAI,CAAC"}
@@ -36,12 +36,14 @@ export function renderVisibleMnemonikText(text) {
36
36
  const source = text.includes('&lt;mnemonik:') ? decodeXmlEntities(text) : text;
37
37
  const envelopeRe = /<mnemonik:(directive|nudge|ambient)\b([^>]*)>([\s\S]*?)<\/mnemonik:\1>/g;
38
38
  let matched = false;
39
- const rendered = source.replace(envelopeRe, (_all, _kind, attrs, body) => {
39
+ const rendered = source.replace(envelopeRe, (_all, kind, attrs, body) => {
40
40
  matched = true;
41
41
  const signal = attrs.match(/\bsignal="([^"]+)"/)?.[1];
42
42
  const title = `Mnemonik ${humanSignal(signal)}${signal ? ` (${signal})` : ''}`;
43
43
  const decodedBody = decodeXmlEntities(body).trim();
44
- return decodedBody ? `${title}\n\n${decodedBody}` : title;
44
+ const visible = decodedBody ? `${title}\n\n${decodedBody}` : title;
45
+ const budgetMarker = kind === 'nudge' && signal ? `<!-- mnemonik-nudge:${signal} -->\n\n` : '';
46
+ return budgetMarker + visible;
45
47
  });
46
48
  return matched ? rendered.trim() : text;
47
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"envelopeDisplay.js","sourceRoot":"","sources":["../../src/lib/envelopeDisplay.ts"],"names":[],"mappings":"AAAA,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,IAAI;SACR,OAAO,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,GAAW,EAAE,EAAE,CAChD,MAAM,CAAC,aAAa,CA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CAAC,IAAI,EAAE,IAAY,EAAE,KAAa,EAAE,IAAY,EAAE,EAAE;QAC9F,OAAO,GAAG,IAAI,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,YAAY,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC/E,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QACnE,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,uBAAuB,MAAM,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/F,OAAO,YAAY,GAAG,OAAO,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC"}
@@ -41,6 +41,9 @@ export interface FetchInjectionsInput {
41
41
  prompt?: string;
42
42
  toolName?: string;
43
43
  toolArgs?: Record<string, unknown>;
44
+ eventId?: string;
45
+ toolSucceeded?: boolean;
46
+ observeOnly?: boolean;
44
47
  stopHookActive?: boolean;
45
48
  /** Edit-style PreToolUse: absolute paths the host is about to write to. */
46
49
  filePaths?: string[];
@@ -48,6 +51,14 @@ export interface FetchInjectionsInput {
48
51
  tz?: string;
49
52
  }
50
53
  export declare function fetchInjections(input: FetchInjectionsInput): Promise<InjectionsResponse | null>;
54
+ export declare function trackIdeEdit(input: {
55
+ server: string;
56
+ apiKey: string | null;
57
+ sessionId: string;
58
+ filePath: string;
59
+ cwd?: string;
60
+ eventId?: string;
61
+ }): Promise<boolean>;
51
62
  /**
52
63
  * JIT Knowledge Injector — Ph3 hook-side caller. Posts the user prompt
53
64
  * to /api/v1/hooks/jit and returns the gate result (envelope + memoryIds
@@ -158,6 +169,7 @@ export interface ReportNativeGrepInput {
158
169
  cwd: string;
159
170
  projectId?: string;
160
171
  sessionId: string;
172
+ eventId?: string;
161
173
  }
162
174
  export declare function reportNativeGrepObserved(input: ReportNativeGrepInput): Promise<InjectionsResponse | null>;
163
175
  interface BaseHookInput {
@@ -176,9 +188,10 @@ interface BaseHookInput {
176
188
  * the proxy's own compaction-marker clear covers non-clean-exit paths.
177
189
  */
178
190
  /** SessionStart coord — tells the proxy bootstrap was hook-preloaded. */
179
- export declare function postSessionStart(input: BaseHookInput): Promise<void>;
191
+ export declare function postSessionStart(input: BaseHookInput): Promise<boolean>;
180
192
  export declare function postProxySuppressionClear(input: BaseHookInput): Promise<void>;
181
193
  export interface CreatePreCompactSnapshotInput extends BaseHookInput {
194
+ eventId?: string;
182
195
  summary?: string;
183
196
  nextSteps?: string[];
184
197
  filesInProgress?: string[];
@@ -192,9 +205,10 @@ export interface CreatePreCompactSnapshotInput extends BaseHookInput {
192
205
  export declare function createPreCompactSnapshot(input: CreatePreCompactSnapshotInput): Promise<PreCompactResponse | null>;
193
206
  export interface PostSessionEndInput extends BaseHookInput {
194
207
  reason?: string;
208
+ invocationStartedAt: number;
195
209
  }
196
- /** SessionEnd save — fire-and-forget; the session is closing anyway. */
197
- export declare function postSessionEnd(input: PostSessionEndInput): Promise<void>;
210
+ /** SessionEnd save — caller awaits this bounded request before process exit. */
211
+ export declare function postSessionEnd(input: PostSessionEndInput): Promise<boolean>;
198
212
  /**
199
213
  * Statusline digest (task 2f57b87d). Small GET the statusline issues each
200
214
  * refresh to render `mnk[tasks=N|ckpt=12m|scan=ok|policy=M]`. Bounded on the