context-mode 1.0.107 → 1.0.109

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 (48) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.openclaw-plugin/openclaw.plugin.json +1 -1
  4. package/.openclaw-plugin/package.json +1 -1
  5. package/README.md +22 -18
  6. package/build/adapters/claude-code/index.js +26 -9
  7. package/build/adapters/opencode/index.js +5 -5
  8. package/build/cli.js +92 -12
  9. package/build/server.js +45 -3
  10. package/build/session/analytics.d.ts +7 -0
  11. package/build/session/analytics.js +75 -15
  12. package/build/session/db.d.ts +3 -1
  13. package/build/session/persist-tool-calls.d.ts +54 -0
  14. package/build/session/persist-tool-calls.js +105 -0
  15. package/build/session/project-attribution.d.ts +1 -1
  16. package/cli.bundle.mjs +123 -122
  17. package/hooks/ensure-deps.mjs +28 -12
  18. package/hooks/posttooluse.mjs +90 -80
  19. package/hooks/precompact.mjs +56 -46
  20. package/hooks/pretooluse.mjs +161 -167
  21. package/hooks/routing-block.mjs +2 -2
  22. package/hooks/run-hook.mjs +82 -0
  23. package/hooks/session-db.bundle.mjs +2 -2
  24. package/hooks/sessionstart.mjs +187 -155
  25. package/hooks/userpromptsubmit.mjs +69 -58
  26. package/openclaw.plugin.json +1 -1
  27. package/package.json +2 -1
  28. package/scripts/heal-better-sqlite3.mjs +108 -0
  29. package/scripts/postinstall.mjs +27 -0
  30. package/server.bundle.mjs +88 -88
  31. package/skills/UPSTREAM-CREDITS.md +51 -0
  32. package/skills/context-mode-ops/SKILL.md +147 -0
  33. package/skills/diagnose/SKILL.md +122 -0
  34. package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  35. package/skills/grill-me/SKILL.md +15 -0
  36. package/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  37. package/skills/grill-with-docs/CONTEXT-FORMAT.md +77 -0
  38. package/skills/grill-with-docs/SKILL.md +93 -0
  39. package/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  40. package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  41. package/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  42. package/skills/improve-codebase-architecture/SKILL.md +76 -0
  43. package/skills/tdd/SKILL.md +114 -0
  44. package/skills/tdd/deep-modules.md +33 -0
  45. package/skills/tdd/interface-design.md +31 -0
  46. package/skills/tdd/mocking.md +59 -0
  47. package/skills/tdd/refactoring.md +10 -0
  48. package/skills/tdd/tests.md +61 -0
@@ -13,6 +13,7 @@ import { execSync } from "node:child_process";
13
13
  import { dirname, resolve, join, sep } from "node:path";
14
14
  import { fileURLToPath } from "node:url";
15
15
  import { homedir } from "node:os";
16
+ import { healBetterSqlite3Binding } from "./heal-better-sqlite3.mjs";
16
17
 
17
18
  const __dirname = dirname(fileURLToPath(import.meta.url));
18
19
  const pkgRoot = resolve(__dirname, "..");
@@ -146,3 +147,29 @@ if (process.platform === "win32" && process.env.npm_config_global === "true") {
146
147
  // Best effort — don't block install. User can use npx as fallback.
147
148
  }
148
149
  }
150
+
151
+ // ── 3. Native binding self-heal — better-sqlite3 (#408) ──────────────
152
+ // On Windows, `npm rebuild` falls through to node-gyp without MSVC; bypass
153
+ // that by spawning prebuild-install directly. Cross-platform safety net —
154
+ // the binding can also go missing on macOS/Linux when prebuilds are stale
155
+ // or the install was interrupted.
156
+ //
157
+ // Logic lives in scripts/heal-better-sqlite3.mjs (shared with
158
+ // hooks/ensure-deps.mjs so there's one source of truth).
159
+ try { healBetterSqlite3Binding(pkgRoot); } catch { /* best effort — don't block install */ }
160
+
161
+ // ── 4. Hook normalization at install time (#414) ─────────────────────
162
+ // hooks/hooks.json + .claude-plugin/plugin.json ship with `${CLAUDE_PLUGIN_ROOT}`
163
+ // + bare `node` command. On Windows + Claude Code that combination triggers
164
+ // `cjs/loader:1479 MODULE_NOT_FOUND` (placeholder mangling, MSYS path issues,
165
+ // PATH lookup failure). start.mjs normalizes on every MCP boot, but normalizing
166
+ // here too closes the gap for the very first hook fire after a fresh install
167
+ // (before any MCP server has run).
168
+ try {
169
+ const { normalizeHooksOnStartup } = await import("../hooks/normalize-hooks.mjs");
170
+ normalizeHooksOnStartup({
171
+ pluginRoot: pkgRoot,
172
+ nodePath: process.execPath,
173
+ platform: process.platform,
174
+ });
175
+ } catch { /* best effort — never block install */ }