claude-mem 13.34.2 → 13.36.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.
Files changed (40) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.qoder-plugin/plugin.json +15 -0
  5. package/README.md +5 -16
  6. package/dist/bug-report/index.js +68 -68
  7. package/dist/npx-cli/index.js +371 -336
  8. package/dist/opencode-plugin/index.js +43 -41
  9. package/dsh/package.json +1 -1
  10. package/openclaw/openclaw.plugin.json +1 -1
  11. package/package.json +4 -1
  12. package/plugin/.claude-plugin/plugin.json +1 -1
  13. package/plugin/.codex-plugin/plugin.json +1 -1
  14. package/plugin/.qoder-plugin/plugin.json +15 -0
  15. package/plugin/hooks/codex-hooks.json +1 -1
  16. package/plugin/hooks/hooks.json +1 -1
  17. package/plugin/hooks/qoder-hooks.json +97 -0
  18. package/plugin/hooks/qoder-repo-hooks.json +97 -0
  19. package/plugin/package.json +1 -1
  20. package/plugin/qoder.mcp.json +12 -0
  21. package/plugin/scripts/bun-runner.js +24 -5
  22. package/plugin/scripts/context-generator.cjs +59 -58
  23. package/plugin/scripts/context-generator.cjs.map +2 -2
  24. package/plugin/scripts/mcp-server.cjs +101 -57
  25. package/plugin/scripts/mcp-server.cjs.map +3 -3
  26. package/plugin/scripts/qoder-hook-launcher.cjs +114 -0
  27. package/plugin/scripts/server-service.cjs +197 -162
  28. package/plugin/scripts/server-service.cjs.map +3 -3
  29. package/plugin/scripts/transcript-watcher.cjs +27 -28
  30. package/plugin/scripts/transcript-watcher.cjs.map +3 -3
  31. package/plugin/scripts/worker-service.cjs +605 -534
  32. package/plugin/scripts/worker-service.cjs.map +3 -3
  33. package/plugin/skills/mem-search/SKILL.md +81 -128
  34. package/plugin/skills/screenpipe/SKILL.md +80 -0
  35. package/plugin/skills/screenpipe/screenpipe.mjs +157 -0
  36. package/plugin/sqlite/SessionStore.js +181 -176
  37. package/plugin/sqlite/SessionStore.js.map +3 -3
  38. package/plugin/sqlite/observations/files.js +7 -7
  39. package/plugin/sqlite/observations/files.js.map +2 -2
  40. package/plugin/ui/viewer-bundle.js +12 -12
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const fs = require('fs');
4
+ const { createRequire } = require('module');
5
+ const path = require('path');
6
+
7
+ const event = process.argv[2];
8
+ const allowed = new Set(['context', 'session-init', 'file-context', 'observation', 'summarize']);
9
+ if (!allowed.has(event)) {
10
+ process.stderr.write('claude-mem: unknown Qoder hook event\n');
11
+ process.exit(1);
12
+ }
13
+
14
+ const scripts = __dirname;
15
+ const pluginRoot = path.dirname(scripts);
16
+ const childEnv = {
17
+ ...process.env,
18
+ CLAUDE_PLUGIN_ROOT: pluginRoot,
19
+ CLAUDE_MEM_CODEX_HOOK: '1',
20
+ };
21
+
22
+ function dependencyClosureComplete(root) {
23
+ try {
24
+ const packageJson = JSON.parse(
25
+ fs.readFileSync(path.join(root, 'package.json'), 'utf-8'),
26
+ );
27
+ const dependencies = Object.keys(packageJson.dependencies || {});
28
+ const nodeModules = path.join(root, 'node_modules');
29
+
30
+ for (const dependency of dependencies) {
31
+ if (!fs.existsSync(path.join(nodeModules, ...dependency.split('/'), 'package.json'))) {
32
+ return false;
33
+ }
34
+ }
35
+
36
+ if (dependencies.includes('zod')) {
37
+ const requireFromPlugin = createRequire(path.join(nodeModules, 'noop.js'));
38
+ const zodRoot = fs.realpathSync(path.join(nodeModules, 'zod'));
39
+ for (const specifier of ['zod/v3', 'zod/v4', 'zod/v4-mini']) {
40
+ const resolved = fs.realpathSync(requireFromPlugin.resolve(specifier));
41
+ const relative = path.relative(zodRoot, resolved);
42
+ if (!relative || relative.startsWith('..') || path.isAbsolute(relative)) {
43
+ return false;
44
+ }
45
+ }
46
+ }
47
+
48
+ return true;
49
+ } catch {
50
+ return false;
51
+ }
52
+ }
53
+
54
+ function emitNoop(reason) {
55
+ process.stderr.write(`claude-mem: ${reason}; continuing without memory\n`);
56
+ const output = { continue: true, suppressOutput: true };
57
+ if (event === 'context') {
58
+ output.hookSpecificOutput = {
59
+ hookEventName: 'SessionStart',
60
+ additionalContext: '',
61
+ };
62
+ }
63
+ process.stdout.write(JSON.stringify(output) + '\n');
64
+ }
65
+
66
+ // Qoder has no Claude-style Setup event. Materialize the plugin dependency
67
+ // closure on the first SessionStart before the worker is invoked; subsequent
68
+ // starts are a fast marker/completeness check inside version-check.js.
69
+ if (event === 'context') {
70
+ const setup = spawnSync(
71
+ process.execPath,
72
+ [path.join(scripts, 'version-check.js')],
73
+ {
74
+ stdio: ['ignore', 'ignore', 'inherit'],
75
+ windowsHide: true,
76
+ env: { ...childEnv, CLAUDE_MEM_CODEX_HOOK: '0' },
77
+ },
78
+ );
79
+ if (setup.error || (setup.status != null && setup.status !== 0)) {
80
+ emitNoop('Qoder dependency setup failed');
81
+ process.exit(0);
82
+ }
83
+ }
84
+
85
+ // version-check.js deliberately exits zero after a failed download so Claude
86
+ // Code's Setup event remains non-blocking. Qoder has no Setup event, therefore
87
+ // its launcher must verify the declared dependency closure itself before it
88
+ // may start the worker. Check every event so a failed SessionStart cannot be
89
+ // followed by a crashing UserPromptSubmit or tool hook.
90
+ if (!dependencyClosureComplete(pluginRoot)) {
91
+ emitNoop('Qoder plugin dependencies remain incomplete');
92
+ process.exit(0);
93
+ }
94
+
95
+ const result = spawnSync(
96
+ process.execPath,
97
+ [
98
+ path.join(scripts, 'bun-runner.js'),
99
+ path.join(scripts, 'worker-service.cjs'),
100
+ 'hook',
101
+ 'codex',
102
+ event,
103
+ ],
104
+ {
105
+ stdio: 'inherit',
106
+ windowsHide: true,
107
+ env: childEnv,
108
+ },
109
+ );
110
+ if (result.error) {
111
+ process.stderr.write(String(result.error.message || result.error) + '\n');
112
+ process.exit(1);
113
+ }
114
+ process.exit(result.status == null ? 0 : result.status);