chat-recall 0.7.30 → 0.7.31
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 +0 -2
- package/dist/board-hooks.d.ts +7 -0
- package/dist/board-hooks.d.ts.map +1 -1
- package/dist/board-hooks.js +9 -3
- package/dist/board-hooks.js.map +1 -1
- package/dist/cli.js +21 -21
- package/dist/cli.js.map +1 -1
- package/dist/install-hooks.d.ts +3 -3
- package/dist/install-hooks.d.ts.map +1 -1
- package/dist/install-hooks.js +23 -14
- package/dist/install-hooks.js.map +1 -1
- package/dist/mcp-relay.js +1 -1
- package/dist/mcp.js +19 -18
- package/dist/message-hook.js +1 -1
- package/dist/watch.js +5 -6
- package/package.json +1 -1
- package/hooks/chat_recall_save_hook.sh +0 -260
package/README.md
CHANGED
|
@@ -234,8 +234,6 @@ After `--uninstall` the MCP server does not put them back.
|
|
|
234
234
|
|---|---|---|
|
|
235
235
|
| `SessionStart` | New session (`startup` / `clear`) | Injects the project-scoped wake-up bundle |
|
|
236
236
|
| `UserPromptSubmit` | When you type a prompt | Searches past sessions; if a similar one exists, injects "you've worked on this before" into the agent's context |
|
|
237
|
-
| `Stop` | After every assistant turn | Auto-saves topics, decisions, and tools to `~/.chat-recall/memory/` |
|
|
238
|
-
| `PreCompact` | Before Claude Code compacts context | Emergency save so nothing is lost to compaction |
|
|
239
237
|
| `SessionEnd` | When the session closes | Escalates the session's learnings in the background, so nothing is delayed |
|
|
240
238
|
| `SessionStart`, `UserPromptSubmit`, `Stop`, `SessionEnd` | Each turn | Messages between sessions: tells the session its id, delivers what waits for it, reports its state |
|
|
241
239
|
| `SessionStart`, `UserPromptSubmit`, `Stop` (background) | Until a message arrives | Waits for a message from another session and wakes this one, also when it is idle |
|
package/dist/board-hooks.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `timeout` of every command hook this module registers, in seconds.
|
|
3
|
+
* Claude Code applies 60 seconds to a command hook that has none. The value is
|
|
4
|
+
* written into settings.json so the bound is visible in the file.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HOOK_TIMEOUT_SECONDS = 60;
|
|
1
7
|
type HookEntry = {
|
|
2
8
|
matcher: string;
|
|
3
9
|
hooks: Array<{
|
|
4
10
|
type: string;
|
|
5
11
|
command: string;
|
|
12
|
+
timeout?: number;
|
|
6
13
|
}>;
|
|
7
14
|
};
|
|
8
15
|
/** The two events the board loop needs, and the flag each one passes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-hooks.d.ts","sourceRoot":"","sources":["../src/board-hooks.ts"],"names":[],"mappings":"AA0BA,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"board-hooks.d.ts","sourceRoot":"","sources":["../src/board-hooks.ts"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAQxG,yEAAyE;AACzE,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,CAGjF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAEpG;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EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,gEAAgE;AAChE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
package/dist/board-hooks.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The commands for the two board hooks and the message hook, on every
|
|
3
3
|
* platform. install-hooks.ts writes them into each profile's settings.json.
|
|
4
4
|
*
|
|
5
|
-
* The other
|
|
5
|
+
* The other four hooks are POSIX shell scripts, and `install-hooks` refuses to
|
|
6
6
|
* register any of them on Windows: Claude Code runs a hook command through
|
|
7
7
|
* cmd.exe, which cannot execute a `.sh`. Registering them there put an error on
|
|
8
8
|
* every interaction.
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { existsSync } from 'node:fs';
|
|
25
25
|
import { join } from 'node:path';
|
|
26
|
+
/**
|
|
27
|
+
* The `timeout` of every command hook this module registers, in seconds.
|
|
28
|
+
* Claude Code applies 60 seconds to a command hook that has none. The value is
|
|
29
|
+
* written into settings.json so the bound is visible in the file.
|
|
30
|
+
*/
|
|
31
|
+
export const HOOK_TIMEOUT_SECONDS = 60;
|
|
26
32
|
/** The command string of a hook entry, or null for a malformed one. */
|
|
27
33
|
function entryCommand(entry) {
|
|
28
34
|
const cmd = entry?.hooks?.[0]?.command;
|
|
@@ -64,7 +70,7 @@ export function isBoardHookEntry(entry) {
|
|
|
64
70
|
export function boardHookEntries(execPath, cliEntry) {
|
|
65
71
|
return BOARD_HOOKS.map(({ event, mode }) => [
|
|
66
72
|
event,
|
|
67
|
-
{ matcher: '', hooks: [{ type: 'command', command: boardHookCommand(execPath, cliEntry, mode) }] },
|
|
73
|
+
{ matcher: '', hooks: [{ type: 'command', command: boardHookCommand(execPath, cliEntry, mode), timeout: HOOK_TIMEOUT_SECONDS }] },
|
|
68
74
|
]);
|
|
69
75
|
}
|
|
70
76
|
/**
|
|
@@ -121,7 +127,7 @@ export function messageHookEntries(execPath, hookEntry) {
|
|
|
121
127
|
const turn = messageHookCommand(execPath, hookEntry);
|
|
122
128
|
const waiter = messageHookCommand(execPath, hookEntry, true);
|
|
123
129
|
return [
|
|
124
|
-
...MESSAGE_HOOK_EVENTS.map((event) => [event, { matcher: '', hooks: [{ type: 'command', command: turn }] }]),
|
|
130
|
+
...MESSAGE_HOOK_EVENTS.map((event) => [event, { matcher: '', hooks: [{ type: 'command', command: turn, timeout: HOOK_TIMEOUT_SECONDS }] }]),
|
|
125
131
|
...MESSAGE_WAITER_EVENTS.map((event) => [event, {
|
|
126
132
|
matcher: '',
|
|
127
133
|
hooks: [{ type: 'command', command: waiter, asyncRewake: true, timeout: MESSAGE_WAITER_TIMEOUT_SECONDS }],
|
package/dist/board-hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-hooks.js","sourceRoot":"","sources":["../src/board-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"board-hooks.js","sourceRoot":"","sources":["../src/board-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAIvC,uEAAuE;AACvE,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,GAAG,GAAI,KAAkD,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;IACrF,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,yEAAyE;A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db"), isDir: false },
|
|
4486
4486
|
{ legacyPath: join2(root, "chat-recall-index"), newPath: join2(newRoot, "index"), isDir: true },
|
|
4487
|
-
{ legacyPath: join2(root, "chat-recall-memory"), newPath: join2(newRoot, "memory"), isDir: true },
|
|
4488
4487
|
{ legacyPath: join2(root, "chat-recall-identity.txt"), newPath: join2(newRoot, "identity.txt"), isDir: false },
|
|
4489
4488
|
{ legacyPath: join2(root, "chat-recall-hooks"), newPath: join2(newRoot, "hooks"), isDir: true },
|
|
4490
4489
|
// The legacy settings directory was named just "chat-recall" (no
|
|
@@ -28164,7 +28163,7 @@ var init_http = __esm({
|
|
|
28164
28163
|
CLI_VERSION = JSON.parse(readFileSync34(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
28165
28164
|
} catch {
|
|
28166
28165
|
try {
|
|
28167
|
-
if (true) CLI_VERSION = "0.7.
|
|
28166
|
+
if (true) CLI_VERSION = "0.7.31";
|
|
28168
28167
|
} catch {
|
|
28169
28168
|
}
|
|
28170
28169
|
}
|
|
@@ -28662,7 +28661,7 @@ var init_telemetry = __esm({
|
|
|
28662
28661
|
init_sync_client();
|
|
28663
28662
|
cliVersion2 = () => {
|
|
28664
28663
|
try {
|
|
28665
|
-
return true ? "0.7.
|
|
28664
|
+
return true ? "0.7.31" : "dev";
|
|
28666
28665
|
} catch {
|
|
28667
28666
|
return "dev";
|
|
28668
28667
|
}
|
|
@@ -31275,7 +31274,7 @@ var init_sync_client = __esm({
|
|
|
31275
31274
|
ownVersion = JSON.parse(readFileSync39(join46(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
31276
31275
|
} catch {
|
|
31277
31276
|
try {
|
|
31278
|
-
if (true) ownVersion = "0.7.
|
|
31277
|
+
if (true) ownVersion = "0.7.31";
|
|
31279
31278
|
} catch {
|
|
31280
31279
|
}
|
|
31281
31280
|
}
|
|
@@ -34583,6 +34582,7 @@ var init_init_progress = __esm({
|
|
|
34583
34582
|
var board_hooks_exports = {};
|
|
34584
34583
|
__export(board_hooks_exports, {
|
|
34585
34584
|
BOARD_HOOKS: () => BOARD_HOOKS,
|
|
34585
|
+
HOOK_TIMEOUT_SECONDS: () => HOOK_TIMEOUT_SECONDS,
|
|
34586
34586
|
MESSAGE_HOOK_EVENTS: () => MESSAGE_HOOK_EVENTS,
|
|
34587
34587
|
MESSAGE_WAITER_EVENTS: () => MESSAGE_WAITER_EVENTS,
|
|
34588
34588
|
MESSAGE_WAITER_TIMEOUT_SECONDS: () => MESSAGE_WAITER_TIMEOUT_SECONDS,
|
|
@@ -34615,7 +34615,7 @@ function isBoardHookEntry(entry) {
|
|
|
34615
34615
|
function boardHookEntries(execPath, cliEntry) {
|
|
34616
34616
|
return BOARD_HOOKS.map(({ event, mode }) => [
|
|
34617
34617
|
event,
|
|
34618
|
-
{ matcher: "", hooks: [{ type: "command", command: boardHookCommand(execPath, cliEntry, mode) }] }
|
|
34618
|
+
{ matcher: "", hooks: [{ type: "command", command: boardHookCommand(execPath, cliEntry, mode), timeout: HOOK_TIMEOUT_SECONDS }] }
|
|
34619
34619
|
]);
|
|
34620
34620
|
}
|
|
34621
34621
|
function messageHookCommand(execPath, hookEntry, waiter = false) {
|
|
@@ -34636,7 +34636,7 @@ function messageHookEntries(execPath, hookEntry) {
|
|
|
34636
34636
|
const turn = messageHookCommand(execPath, hookEntry);
|
|
34637
34637
|
const waiter = messageHookCommand(execPath, hookEntry, true);
|
|
34638
34638
|
return [
|
|
34639
|
-
...MESSAGE_HOOK_EVENTS.map((event) => [event, { matcher: "", hooks: [{ type: "command", command: turn }] }]),
|
|
34639
|
+
...MESSAGE_HOOK_EVENTS.map((event) => [event, { matcher: "", hooks: [{ type: "command", command: turn, timeout: HOOK_TIMEOUT_SECONDS }] }]),
|
|
34640
34640
|
...MESSAGE_WAITER_EVENTS.map((event) => [event, {
|
|
34641
34641
|
matcher: "",
|
|
34642
34642
|
hooks: [{ type: "command", command: waiter, asyncRewake: true, timeout: MESSAGE_WAITER_TIMEOUT_SECONDS }]
|
|
@@ -34651,10 +34651,11 @@ function resolveMessageHookEntry(distDir) {
|
|
|
34651
34651
|
const bundled = join59(distDir, "message-hook.js");
|
|
34652
34652
|
return existsSync52(bundled) ? bundled : join59(distDir, "message-hook.ts");
|
|
34653
34653
|
}
|
|
34654
|
-
var BOARD_HOOKS, MESSAGE_HOOK_EVENTS, MESSAGE_WAITER_EVENTS, MESSAGE_WAITER_TIMEOUT_SECONDS;
|
|
34654
|
+
var HOOK_TIMEOUT_SECONDS, BOARD_HOOKS, MESSAGE_HOOK_EVENTS, MESSAGE_WAITER_EVENTS, MESSAGE_WAITER_TIMEOUT_SECONDS;
|
|
34655
34655
|
var init_board_hooks = __esm({
|
|
34656
34656
|
"src/board-hooks.ts"() {
|
|
34657
34657
|
"use strict";
|
|
34658
|
+
HOOK_TIMEOUT_SECONDS = 60;
|
|
34658
34659
|
BOARD_HOOKS = [
|
|
34659
34660
|
{ event: "UserPromptSubmit", mode: "claim" },
|
|
34660
34661
|
{ event: "SessionEnd", mode: "close" }
|
|
@@ -34674,6 +34675,7 @@ __export(install_hooks_exports, {
|
|
|
34674
34675
|
ensureHooks: () => ensureHooks,
|
|
34675
34676
|
hookEntries: () => hookEntries,
|
|
34676
34677
|
installHooks: () => installHooks,
|
|
34678
|
+
isLegacyEntry: () => isLegacyEntry,
|
|
34677
34679
|
isOurEntry: () => isOurEntry,
|
|
34678
34680
|
mergeOurEntries: () => mergeOurEntries,
|
|
34679
34681
|
removeOurEntries: () => removeOurEntries,
|
|
@@ -34684,7 +34686,11 @@ import { dirname as dirname24, join as join60 } from "node:path";
|
|
|
34684
34686
|
function isOurEntry(entry) {
|
|
34685
34687
|
const cmd = entry?.hooks?.[0]?.command;
|
|
34686
34688
|
if (typeof cmd !== "string") return false;
|
|
34687
|
-
return Object.values(SCRIPTS).some((s) => cmd.includes(s)) || isBoardHookEntry(entry) || isMessageHookEntry(entry);
|
|
34689
|
+
return Object.values(SCRIPTS).some((s) => cmd.includes(s)) || isLegacyEntry(entry) || isBoardHookEntry(entry) || isMessageHookEntry(entry);
|
|
34690
|
+
}
|
|
34691
|
+
function isLegacyEntry(entry) {
|
|
34692
|
+
const cmd = entry?.hooks?.[0]?.command;
|
|
34693
|
+
return typeof cmd === "string" && LEGACY_SCRIPTS.some((s) => cmd.includes(s));
|
|
34688
34694
|
}
|
|
34689
34695
|
function claudeSettingsFiles() {
|
|
34690
34696
|
const out = [];
|
|
@@ -34713,14 +34719,10 @@ function findScript(distDir, name) {
|
|
|
34713
34719
|
].find((p) => existsSync53(p));
|
|
34714
34720
|
}
|
|
34715
34721
|
function hookEntries(sel, paths) {
|
|
34716
|
-
const cmd = (command, extra = {}) => [{ type: "command", command, ...extra }];
|
|
34722
|
+
const cmd = (command, extra = {}) => [{ type: "command", command, timeout: HOOK_TIMEOUT_SECONDS, ...extra }];
|
|
34717
34723
|
const q = (p) => `"${p}"`;
|
|
34718
34724
|
const out = [];
|
|
34719
34725
|
const s = paths.scripts;
|
|
34720
|
-
if (sel.save && s.save) {
|
|
34721
|
-
out.push(["Stop", { matcher: "", hooks: cmd(q(s.save)) }]);
|
|
34722
|
-
out.push(["PreCompact", { matcher: "", hooks: cmd(`${q(s.save)} --precompact`) }]);
|
|
34723
|
-
}
|
|
34724
34726
|
if (sel.resume && s.resume) out.push(["UserPromptSubmit", { matcher: "", hooks: cmd(q(s.resume)) }]);
|
|
34725
34727
|
if (sel.escalate && s.escalate) out.push(["SessionEnd", { matcher: "", hooks: cmd(q(s.escalate)) }]);
|
|
34726
34728
|
if (sel.wakeup && s.wakeup) out.push(["SessionStart", { matcher: "startup|clear", hooks: cmd(q(s.wakeup)) }]);
|
|
@@ -34786,6 +34788,7 @@ function readState() {
|
|
|
34786
34788
|
async function installHooks(distDir, sel = ALL_HOOKS) {
|
|
34787
34789
|
const shellSkipped = process.platform === "win32";
|
|
34788
34790
|
const scriptsDir = getHooksDir();
|
|
34791
|
+
for (const name of LEGACY_SCRIPTS) rmSync10(join60(scriptsDir, name), { force: true });
|
|
34789
34792
|
const scripts = {};
|
|
34790
34793
|
if (!shellSkipped) {
|
|
34791
34794
|
for (const key2 of Object.keys(SCRIPTS)) {
|
|
@@ -34868,7 +34871,7 @@ function profileMissingHooks(settingsFile, sel) {
|
|
|
34868
34871
|
const has = (event, test) => (Array.isArray(config2.hooks?.[event]) ? config2.hooks[event] : []).some(test);
|
|
34869
34872
|
if (sel.messages && !(has("Stop", isCurrentMessageWaiterEntry) && has("SessionStart", isMessageHookEntry))) return true;
|
|
34870
34873
|
if (sel.taskBoard && !has("UserPromptSubmit", isBoardHookEntry)) return true;
|
|
34871
|
-
if (
|
|
34874
|
+
if (Object.values(config2.hooks ?? {}).some((list) => Array.isArray(list) && list.some(isLegacyEntry))) return true;
|
|
34872
34875
|
return false;
|
|
34873
34876
|
}
|
|
34874
34877
|
async function ensureHooks(distDir) {
|
|
@@ -34982,7 +34985,7 @@ async function removeMessagesFromOtherTools() {
|
|
|
34982
34985
|
}
|
|
34983
34986
|
return out;
|
|
34984
34987
|
}
|
|
34985
|
-
var ALL_HOOKS, SCRIPTS, HOOK_EVENTS;
|
|
34988
|
+
var ALL_HOOKS, SCRIPTS, LEGACY_SCRIPTS, HOOK_EVENTS;
|
|
34986
34989
|
var init_install_hooks = __esm({
|
|
34987
34990
|
"src/install-hooks.ts"() {
|
|
34988
34991
|
"use strict";
|
|
@@ -34993,7 +34996,6 @@ var init_install_hooks = __esm({
|
|
|
34993
34996
|
init_http();
|
|
34994
34997
|
init_opencode_tui_config();
|
|
34995
34998
|
ALL_HOOKS = {
|
|
34996
|
-
save: true,
|
|
34997
34999
|
resume: true,
|
|
34998
35000
|
escalate: true,
|
|
34999
35001
|
wakeup: true,
|
|
@@ -35002,12 +35004,12 @@ var init_install_hooks = __esm({
|
|
|
35002
35004
|
messages: true
|
|
35003
35005
|
};
|
|
35004
35006
|
SCRIPTS = {
|
|
35005
|
-
save: "chat_recall_save_hook.sh",
|
|
35006
35007
|
resume: "chat_recall_resume_hook.sh",
|
|
35007
35008
|
escalate: "chat_recall_escalate_hook.sh",
|
|
35008
35009
|
wakeup: "chat_recall_wakeup_hook.sh",
|
|
35009
35010
|
guard: "chat_recall_guard_hook.sh"
|
|
35010
35011
|
};
|
|
35012
|
+
LEGACY_SCRIPTS = ["chat_recall_save_hook.sh"];
|
|
35011
35013
|
HOOK_EVENTS = ["Stop", "PreCompact", "UserPromptSubmit", "SessionEnd", "SessionStart", "PreToolUse", "PostToolUse"];
|
|
35012
35014
|
}
|
|
35013
35015
|
});
|
|
@@ -37017,7 +37019,7 @@ var init_intent_drain = __esm({
|
|
|
37017
37019
|
ownVersion2 = JSON.parse(readFileSync50(join63(dir, "../package.json"), "utf-8")).version || ownVersion2;
|
|
37018
37020
|
} catch {
|
|
37019
37021
|
try {
|
|
37020
|
-
if (true) ownVersion2 = "0.7.
|
|
37022
|
+
if (true) ownVersion2 = "0.7.31";
|
|
37021
37023
|
} catch {
|
|
37022
37024
|
}
|
|
37023
37025
|
}
|
|
@@ -40342,7 +40344,6 @@ program.command("doctor").description("Quick health check across login, server,
|
|
|
40342
40344
|
const on = (ev, test) => (Array.isArray(hooks[ev]) ? hooks[ev] : []).some(test);
|
|
40343
40345
|
const shell = (script) => (h) => String(h?.hooks?.[0]?.command || "").includes(script);
|
|
40344
40346
|
const checks = [
|
|
40345
|
-
["save", on("Stop", shell("chat_recall_save_hook.sh"))],
|
|
40346
40347
|
["wake-up", on("SessionStart", shell("chat_recall_wakeup_hook.sh"))],
|
|
40347
40348
|
["resume hint", on("UserPromptSubmit", shell("chat_recall_resume_hook.sh"))],
|
|
40348
40349
|
["task board", on("UserPromptSubmit", isBoardHookEntry2) && on("SessionEnd", isBoardHookEntry2)],
|
|
@@ -41671,7 +41672,6 @@ program.command("install-hooks").description("Install the chat-recall hooks into
|
|
|
41671
41672
|
return;
|
|
41672
41673
|
}
|
|
41673
41674
|
const r = await installHooks2(here, {
|
|
41674
|
-
save: true,
|
|
41675
41675
|
resume: opts.resumeHint !== false,
|
|
41676
41676
|
escalate: opts.escalate !== false,
|
|
41677
41677
|
wakeup: opts.wakeup !== false,
|
|
@@ -41691,7 +41691,7 @@ program.command("install-hooks").description("Install the chat-recall hooks into
|
|
|
41691
41691
|
if (m.note) console.log(chalk2.yellow(` ! ${m.note}`));
|
|
41692
41692
|
}
|
|
41693
41693
|
if (r.shellSkipped) {
|
|
41694
|
-
console.log(chalk2.yellow("The
|
|
41694
|
+
console.log(chalk2.yellow("The four shell hooks are not installed on Windows: Claude Code runs hooks through cmd.exe, which cannot run them."));
|
|
41695
41695
|
console.log(chalk2.dim(" The task-board and message hooks are installed. Under WSL, run this inside the WSL shell to get all of them."));
|
|
41696
41696
|
}
|
|
41697
41697
|
console.log(chalk2.dim(` scripts: ${r.scriptsDir}`));
|