llm-wiki-kit 0.1.4 → 0.1.5

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.
@@ -71,6 +71,32 @@ sudo npm install -g llm-wiki-kit@latest
71
71
 
72
72
  If the proxy performs TLS inspection, install the organization's CA and set `cafile` instead of disabling TLS verification. As a temporary diagnostic only, `sudo npm config set strict-ssl false` can confirm that the failure is CA-related, but do not keep that setting in production.
73
73
 
74
+ ## npm install -g Succeeds But llm-wiki Is Still Old
75
+
76
+ If `npm install -g llm-wiki-kit@latest` succeeds but `llm-wiki --help` does not show newer commands such as `projects` or `version`, the shell is probably executing an older source checkout or stale shim before the npm global binary.
77
+
78
+ Confirm what is actually running:
79
+
80
+ ```bash
81
+ which -a llm-wiki
82
+ readlink -f "$(command -v llm-wiki)"
83
+ npm ls -g llm-wiki-kit --depth=0
84
+ npm root -g
85
+ node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version
86
+ ```
87
+
88
+ If the direct `node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version` command prints the latest version but plain `llm-wiki` is old, fix `PATH` or replace the stale shim:
89
+
90
+ ```bash
91
+ mkdir -p "$HOME/.local/bin"
92
+ ln -sfn "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" "$HOME/.local/bin/llm-wiki"
93
+ export PATH="$HOME/.local/bin:$PATH"
94
+ hash -r
95
+ llm-wiki status
96
+ ```
97
+
98
+ If `readlink -f "$(command -v llm-wiki)"` points at a repository checkout such as `/mnt/d/dev_proj/llm-wiki-kit/bin/llm-wiki.js`, `npm install -g` is not updating that checkout. Either switch the shim to the npm package as above, or update the checkout itself with `git pull` and run it intentionally as source.
99
+
74
100
  ## npm install -g Fails With EACCES
75
101
 
76
102
  If npm tries to write under `/usr` and fails with `EACCES`, use sudo when the server policy allows system-wide global packages:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-wiki-kit",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Hook-first living LLM Wiki runtime for Codex and Claude Code.",
5
5
  "type": "module",
6
6
  "files": [
package/src/cli.js CHANGED
@@ -183,6 +183,8 @@ function formatStatus(value) {
183
183
  `- version: ${value.runtimeVersion}`,
184
184
  `- runtime: ${value.runtimeVersion} (${value.installSource})`,
185
185
  `- bin: ${value.binPath}`,
186
+ `- command: ${value.commandPath || 'not found'}`,
187
+ `- command matches runtime: ${value.commandMatchesRuntime ? 'yes' : 'no'}`,
186
188
  `- hooks current: ${value.hooksCurrent ? 'yes' : 'no'}`,
187
189
  `- codex hook: ${value.codexInstalled ? 'current' : 'missing/outdated'}`,
188
190
  `- claude hook: ${value.claudeInstalled ? 'current' : 'missing/outdated'}`,
package/src/doctor.js CHANGED
@@ -17,6 +17,8 @@ export async function runDoctor() {
17
17
  add('node >= 20', nodeMajor() >= 20, process.version);
18
18
  add('runtime version detected', Boolean(stat.runtimeVersion), stat.runtimeVersion || 'unknown');
19
19
  add('llm-wiki bin exists', await exists(stat.binPath), stat.binPath);
20
+ add('runtime installed from npm', stat.installSource === 'npm', `${stat.installSource}; npm install -g does not update source checkouts`);
21
+ add('llm-wiki command resolves to current runtime', stat.commandMatchesRuntime, stat.commandPath ? `command=${stat.commandPath}; runtime=${stat.binPath}` : 'command not found on PATH');
20
22
  add('Codex hook installed', stat.codexInstalled, stat.codexHooksPath);
21
23
  add('Claude hook installed', stat.claudeInstalled, stat.claudeSettingsPath);
22
24
  add('project templates current', stat.project.managedFilesCurrent, stat.project.statePath);
package/src/install.js CHANGED
@@ -1,4 +1,6 @@
1
+ import { realpathSync } from 'fs';
1
2
  import { chmod } from 'fs/promises';
3
+ import { spawnSync } from 'child_process';
2
4
  import { join, resolve } from 'path';
3
5
  import { CLAUDE_EVENTS, CODEX_EVENTS, KIT_NAME } from './constants.js';
4
6
  import { backupFile, ensureDir, exists, homeDir, readJson, safeSymlink, writeJson } from './fs-utils.js';
@@ -15,6 +17,23 @@ export function hookCommand(provider, eventName) {
15
17
  return `${shellQuote(process.execPath)} ${shellQuote(binPath)} hook ${provider} ${eventName}`;
16
18
  }
17
19
 
20
+ function llmWikiCommandPaths() {
21
+ const result = spawnSync('sh', ['-lc', 'which -a llm-wiki 2>/dev/null || true'], {
22
+ encoding: 'utf8',
23
+ });
24
+ if (result.error) return [];
25
+ return [...new Set(result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean))];
26
+ }
27
+
28
+ function realpathOrOriginal(path) {
29
+ if (!path) return null;
30
+ try {
31
+ return realpathSync(path);
32
+ } catch {
33
+ return path;
34
+ }
35
+ }
36
+
18
37
  function addHook(hooks, eventName, command, options = {}) {
19
38
  hooks[eventName] = Array.isArray(hooks[eventName]) ? hooks[eventName] : [];
20
39
  const already = JSON.stringify(hooks[eventName]).includes(command);
@@ -151,11 +170,18 @@ export async function status(options = {}) {
151
170
  const claude = await readJson(claudeSettingsPath, {});
152
171
  const codexInstalled = JSON.stringify(codex.hooks || {}).includes(binPath);
153
172
  const claudeInstalled = JSON.stringify(claude.hooks || {}).includes(binPath);
173
+ const commandPaths = llmWikiCommandPaths();
174
+ const commandPath = commandPaths[0] || null;
175
+ const resolvedCommandPath = realpathOrOriginal(commandPath);
176
+ const resolvedBinPath = realpathOrOriginal(binPath);
154
177
  return {
155
178
  runtimeVersion: runtimeVersion(),
156
179
  packageRoot,
157
180
  installSource: detectInstallSource(),
158
181
  binPath,
182
+ commandPath,
183
+ commandPaths,
184
+ commandMatchesRuntime: Boolean(resolvedCommandPath && resolvedBinPath && resolvedCommandPath === resolvedBinPath),
159
185
  codexInstalled,
160
186
  claudeInstalled,
161
187
  hooksCurrent: codexInstalled && claudeInstalled,