claude-mem 13.4.0 → 13.4.1
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/.codex-plugin/plugin.json +1 -1
- package/dist/binaries/worker-service-v10.3.1-win-x64.exe +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/npx-cli/index.js +333 -304
- package/dist/opencode-plugin/index.js +1 -1
- package/dist/sdk/index.d.ts +109 -0
- package/dist/sdk/index.js +183 -0
- package/openclaw/openclaw.plugin.json +1 -1
- package/package.json +4 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +3 -3
- package/plugin/bun.lock +163 -0
- package/plugin/modes/code.json +16 -16
- package/plugin/package.json +2 -2
- package/plugin/scripts/bun-runner.js +76 -54
- package/plugin/scripts/context-generator.cjs +73 -60
- package/plugin/scripts/mcp-server.cjs +37 -30
- package/plugin/scripts/server-beta-service.cjs +175 -145
- package/plugin/scripts/transcript-watcher.cjs +26 -0
- package/plugin/scripts/version-check.js +125 -1
- package/plugin/scripts/worker-service.cjs +287 -251
- package/plugin/skills/smart-explore/SKILL.md +6 -3
- package/plugin/skills/standup/SKILL.md +157 -0
- package/plugin/skills/standup/agent-brief.md +47 -0
- package/plugin/skills/standup/standup.mjs +662 -0
- package/plugin/ui/viewer-bundle.js +13 -14
|
@@ -66,7 +66,15 @@ function isPluginDisabledInClaudeSettings() {
|
|
|
66
66
|
const settingsPath = join(configDir, 'settings.json');
|
|
67
67
|
if (!existsSync(settingsPath)) return false;
|
|
68
68
|
const settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
69
|
-
|
|
69
|
+
// No optional chaining (?.) here: this launcher must parse on the oldest
|
|
70
|
+
// Node that any host might invoke it with. Some Claude Code installs run
|
|
71
|
+
// hooks under a bundled pre-ES2020 Node whose ESM loader throws
|
|
72
|
+
// "SyntaxError: Unexpected token '.'" on `?.` (issue #2791).
|
|
73
|
+
return Boolean(
|
|
74
|
+
settings &&
|
|
75
|
+
settings.enabledPlugins &&
|
|
76
|
+
settings.enabledPlugins['claude-mem@thedotmack'] === false
|
|
77
|
+
);
|
|
70
78
|
} catch {
|
|
71
79
|
return false;
|
|
72
80
|
}
|
|
@@ -142,60 +150,74 @@ if (child.stdin) {
|
|
|
142
150
|
child.stdin.write(stdinData);
|
|
143
151
|
child.stdin.end();
|
|
144
152
|
} else {
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
153
|
+
// Lifecycle subcommands (start, stop, restart, status) never consume stdin —
|
|
154
|
+
// they manage the worker daemon, not hook payloads. Killing the child here
|
|
155
|
+
// prevents the daemon from starting/stopping on platforms where Claude Code
|
|
156
|
+
// doesn't pipe a payload for SessionStart (e.g. Windows CC ≤ 2.1.145).
|
|
157
|
+
const lifecycleCommands = ['start', 'stop', 'restart', 'status'];
|
|
158
|
+
const isLifecycle = lifecycleCommands.some(cmd => args.includes(cmd));
|
|
159
|
+
|
|
160
|
+
if (isLifecycle) {
|
|
161
|
+
// Lifecycle commands don't need stdin — close pipe and let child run.
|
|
162
|
+
try { child.stdin.end(); } catch {}
|
|
163
|
+
} else {
|
|
164
|
+
// Issue #2188: empty/missing stdin previously masked by `|| '{}'` fallback,
|
|
165
|
+
// which silently hid WSL bash failures (e.g. hooks invoked under a broken
|
|
166
|
+
// shell that never piped a payload). Surface the failure mode instead.
|
|
167
|
+
const dataDir = process.env.CLAUDE_MEM_DATA_DIR || join(homedir(), '.claude-mem');
|
|
168
|
+
const payloadType = stdinData === null
|
|
169
|
+
? 'null (no data event or stream error)'
|
|
170
|
+
: stdinData === undefined
|
|
171
|
+
? 'undefined'
|
|
172
|
+
: Buffer.isBuffer(stdinData) && stdinData.length === 0
|
|
173
|
+
? 'empty Buffer (zero bytes received)'
|
|
174
|
+
: `unexpected (${typeof stdinData})`;
|
|
175
|
+
const payloadByteLength = (stdinData && typeof stdinData.length === 'number')
|
|
176
|
+
? stdinData.length
|
|
177
|
+
: 0;
|
|
178
|
+
const diagnostic = [
|
|
179
|
+
`[bun-runner] empty stdin payload received — issue #2188`,
|
|
180
|
+
` script: ${args[0]}`,
|
|
181
|
+
` payload byte length: ${payloadByteLength}`,
|
|
182
|
+
` payload type: ${payloadType}`,
|
|
183
|
+
` platform: ${process.platform}`,
|
|
184
|
+
` shell: ${process.env.SHELL || 'n/a'}`,
|
|
185
|
+
` stdin TTY: ${process.stdin.isTTY === true ? 'true' : process.stdin.isTTY === false ? 'false' : 'undefined'}`,
|
|
186
|
+
` timestamp: ${new Date().toISOString()}`,
|
|
187
|
+
` CLAUDE_PLUGIN_ROOT: ${RESOLVED_PLUGIN_ROOT}`,
|
|
188
|
+
].join('\n');
|
|
189
|
+
|
|
190
|
+
// IO discipline (see src/shared/hook-io.ts intent vocabulary):
|
|
191
|
+
// - this stderr write is a USER_HINT (Claude Code surfaces it inline).
|
|
192
|
+
// - the CAPTURE_BROKEN marker file below is a DIAGNOSTIC durable signal for
|
|
193
|
+
// the next session-start hint.
|
|
194
|
+
// - exit 0 below is the EXIT_SIGNAL per CLAUDE.md (Windows Terminal tab
|
|
195
|
+
// management); the marker file, not the exit code, is the durable failure
|
|
196
|
+
// signal. bun-runner runs in its own node process BEFORE hookCommand's
|
|
197
|
+
// stderr buffer is installed, so this write is never swallowed.
|
|
198
|
+
|
|
199
|
+
// Write to stderr so Claude Code surfaces the diagnostic.
|
|
200
|
+
console.error(diagnostic);
|
|
201
|
+
|
|
202
|
+
// Persist diagnostic to the runner-errors log and drop a CAPTURE_BROKEN marker
|
|
203
|
+
// file so the next session-start hint can surface the failure. We exit 0 to
|
|
204
|
+
// honor the project's exit-code strategy (worker/hook errors exit 0 to
|
|
205
|
+
// prevent Windows Terminal tab pileup) — the marker file is the durable
|
|
206
|
+
// signal that something is wrong, not the exit code.
|
|
207
|
+
try {
|
|
208
|
+
const logsDir = join(dataDir, 'logs');
|
|
209
|
+
mkdirSync(logsDir, { recursive: true });
|
|
210
|
+
appendFileSync(join(logsDir, 'runner-errors.log'), diagnostic + '\n\n');
|
|
211
|
+
mkdirSync(dataDir, { recursive: true });
|
|
212
|
+
writeFileSync(join(dataDir, 'CAPTURE_BROKEN'), diagnostic + '\n');
|
|
213
|
+
} catch (writeErr) {
|
|
214
|
+
console.error(`[bun-runner] failed to persist diagnostic: ${writeErr && writeErr.message ? writeErr.message : writeErr}`);
|
|
215
|
+
}
|
|
195
216
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
try { child.stdin.end(); } catch {}
|
|
218
|
+
try { child.kill(); } catch {}
|
|
219
|
+
process.exit(0);
|
|
220
|
+
}
|
|
199
221
|
}
|
|
200
222
|
}
|
|
201
223
|
|