llm-wiki-kit 0.2.11 → 0.2.13
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 +19 -7
- package/docs/integrations/claude-code.md +2 -0
- package/docs/integrations/codex.md +1 -0
- package/docs/manual.md +135 -396
- package/docs/operations.md +3 -1
- package/docs/troubleshooting.md +2 -0
- package/package.json +12 -2
- package/src/capture-policy.js +11 -4
- package/src/cli.js +17 -4
- package/src/hook.js +15 -7
- package/src/language.js +73 -0
- package/src/live-qa.js +1 -1
- package/src/maintenance.js +13 -8
- package/src/project-state.js +20 -9
- package/src/project.js +5 -3
- package/src/templates.js +89 -82
- package/src/update-notice.js +14 -4
- package/src/update.js +168 -3
- package/src/wiki-search.js +35 -13
package/README.md
CHANGED
|
@@ -4,14 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
The goal is not to make users run `ingest` or `record` commands. After install, normal Claude Code/Codex work should naturally become a project-local Markdown wiki under `llm-wiki/`.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Language Behavior
|
|
8
|
+
|
|
9
|
+
`llm-wiki-kit` is designed for mixed Korean and English teams:
|
|
10
|
+
|
|
11
|
+
- Korean user prompt -> Korean hook guidance.
|
|
12
|
+
- English user prompt -> English hook guidance.
|
|
13
|
+
- If there is no clear current prompt language, Claude Code `settings.json` `language` is used when present.
|
|
14
|
+
- If that setting is missing, local `CLAUDE.md` and `AGENTS.md` language signals are used.
|
|
15
|
+
- The fallback is English.
|
|
16
|
+
- Commands, paths, code identifiers, package names, logs, and original error text are not translated.
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
Codex and Claude Code users do not need different commands for Korean or English projects.
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
10
21
|
|
|
11
22
|
```bash
|
|
12
|
-
npm install -g llm-wiki-kit
|
|
13
|
-
llm-wiki install --workspace /
|
|
14
|
-
llm-wiki doctor --workspace /
|
|
23
|
+
npm install -g llm-wiki-kit@latest
|
|
24
|
+
llm-wiki install --workspace /path/to/project --profile standard
|
|
25
|
+
llm-wiki doctor --workspace /path/to/project
|
|
15
26
|
```
|
|
16
27
|
|
|
17
28
|
Restart Claude Code and Codex sessions after installation.
|
|
@@ -87,6 +98,7 @@ Use Claude Code or Codex normally.
|
|
|
87
98
|
The installed hooks:
|
|
88
99
|
|
|
89
100
|
- inject functional compact context at session start, instructions loaded, and prompt submit. The hook still uses `wiki/memory.md`, `wiki/index.md`, relevant wiki search results, maintenance signals, update status, and any compact recovery packet; it formats only the useful parts so user-visible hook context does not look like a raw debug dump.
|
|
101
|
+
- automatically choose Korean or English hook guidance from the current user prompt, then fall back to Claude Code `language`, local `CLAUDE.md`/`AGENTS.md`, and English.
|
|
90
102
|
- remove Codex-facing legacy `oh-my-codex:wiki`/`omx_wiki` surfaces at session start so `llm-wiki/` remains the active wiki implementation
|
|
91
103
|
- record small redacted raw event envelopes and per-turn state
|
|
92
104
|
- capture meaningful work and structured decision points, including tool evidence, changed files, and verification notes
|
|
@@ -121,7 +133,7 @@ Most users should not need these during daily Claude Code/Codex work. They exist
|
|
|
121
133
|
|
|
122
134
|
`llm-wiki update --check [--to <version-or-tag>]` is the online update check. It compares the installed package version with the npm registry target without changing files, and reports an available update only when the target version is newer than the installed version.
|
|
123
135
|
|
|
124
|
-
`llm-wiki update` upgrades the global npm package when npm has a newer target, reinstalls the hook entries, and reapplies safe managed template updates across known project roots. If the installed runtime already satisfies the registry target, it skips `npm install -g
|
|
136
|
+
`llm-wiki update` upgrades the global npm package when npm has a newer target, reinstalls the hook entries, and reapplies safe managed template updates across known project roots. Before installing, it checks whether `npm root -g` points at the active runtime package root; after installing, it verifies the active runtime and `post-update` runtime reached the registry target. If either check fails, it exits nonzero and prints the exact runtime/npm roots plus the manual install/post-update commands to run. If the installed runtime already satisfies the registry target, it prints an already-current result, skips `npm install -g`, and still runs post-update maintenance. Use `--current-only` when you intentionally want to update only the supplied workspace. Existing wiki content is not overwritten. The command prints step progress to stderr, including registry lookup, npm root/prefix checks, npm install, post-update, and project discovery. Use `--timeout-ms <ms>` to bound external commands and `--max-dirs <n>` to bound project discovery under large or slow roots such as WSL `/mnt/*` trees.
|
|
125
137
|
|
|
126
138
|
Installed npm runtimes also perform a cached update notice check from hooks while the user works. This does not install anything automatically. When a newer npm release is detected, Codex and Claude receive the same passive runtime update status in hook context: current runtime, npm registry target, and the manual command to use when the user asks for update or maintenance work. It is not an instruction to interrupt the current answer or to sell the update to the user. The cache is scoped to the npm command used for lookup so test/fake npm checks do not leak into normal hook sessions. Set `LLM_WIKI_KIT_UPDATE_NOTICE=0` only when diagnosing or suppressing that status block.
|
|
127
139
|
|
|
@@ -141,7 +153,7 @@ Installed npm runtimes also perform a cached update notice check from hooks whil
|
|
|
141
153
|
|
|
142
154
|
For `llm-wiki-kit` code releases, source tests are not enough. After code changes, publish the package, install the newly published version, and verify the installed CLI and hooks with `version`, `status`, `doctor`, `update`, `lint`, and hook smoke checks before calling the release complete.
|
|
143
155
|
|
|
144
|
-
Native Windows changes require a real Windows smoke before release. The release gate is: install the packed candidate on a Windows host, run `llm-wiki install`, `llm-wiki status`, and `llm-wiki doctor` against a temporary Windows project, inspect `%USERPROFILE%\.codex\hooks.json` and `%USERPROFILE%\.claude\settings.json`, then repeat the minimal smoke after `npm install -g llm-wiki-kit@latest` once published. Simulated unit tests are not enough for the Windows support claim.
|
|
156
|
+
Native Windows changes require a real Windows smoke before release. The release gate is: install the packed candidate or published package on a Windows host, run `llm-wiki install`, `llm-wiki status`, and `llm-wiki doctor` against a temporary Windows project, inspect `%USERPROFILE%\.codex\hooks.json` and `%USERPROFILE%\.claude\settings.json`, then repeat the minimal smoke after `npm install -g llm-wiki-kit@latest` once published. Simulated unit tests are not enough for the Windows support claim.
|
|
145
157
|
|
|
146
158
|
After a plain `npm install -g llm-wiki-kit@latest`, existing hooks keep working when they already point at the global npm package path. The next `SessionStart`/`InstructionsLoaded` hook automatically reapplies safe managed template updates for the active project root. Clearly generated older `llm-wiki/AGENTS.md` and procedure files are refreshed even when old state is missing; user-edited files are not overwritten and are surfaced to the active agent as cleanup work. If hooks point at a source checkout or stale shim, run `llm-wiki post-update --workspace <project>` or `llm-wiki install --workspace <project>` once to reconnect them.
|
|
147
159
|
|
|
@@ -44,6 +44,8 @@ The hook records redacted turn summaries but does not deny tool calls only becau
|
|
|
44
44
|
|
|
45
45
|
At `SessionStart`/`InstructionsLoaded`, the hook first attempts a safe managed-template refresh, recovers stale turn state into `outputs/maintenance/queue.md`, performs a cached npm update notice check for npm installs, then injects functional compact context. The context still uses `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, relevant wiki/search state, operating rules, maintenance signals, passive runtime update status, and managed-template cleanup notes; the hook formats those signals so they are usable if shown in the Claude Code UI. At `UserPromptSubmit`, it recovers stale turn state, searches wiki pages with MiniSearch or substring fallback, expands one-hop wikilinks, redacts context fields, performs the same cached update notice check, and injects the smallest useful functional compact context set. Update notice cache is scoped by npm command, and maintenance reminders are shown only when the prompt is wiki/maintenance related or matches a queue topic.
|
|
46
46
|
|
|
47
|
+
Hook-visible language is selected from the current user prompt first. Korean prompts get Korean guidance, English prompts get English guidance. If no prompt language is clear, the hook checks Claude Code `settings.json` `language` when it exists, then local `CLAUDE.md`/`AGENTS.md` language signals, then English. The kit does not require Claude Code to expose a language setting.
|
|
48
|
+
|
|
47
49
|
`PostToolUse` and `PostToolBatch` record redacted tool summaries in the same turn buffer. `PreCompact` classifies the current turn before compaction: simple turns record only a context note, work-evidence or structured-decision turns write a chunked live Q&A checkpoint, and explicit durable candidates write a maintenance queue item only when no durable wiki update is detected. The checkpoint can include only a bounded redacted transcript tail, never the full raw transcript or raw `transcript_path`. Compaction is not blocked; if checkpoint storage fails, the hook records a compact recovery packet for the next legal context-injection event. `PostCompact` stores the redacted compact summary as a context note and prepares any pending recovery packet without returning model-visible context directly. In the default `answer-first` mode, `SubagentStop` does not create live Q&A, query, decision, or maintenance files. `Stop` and `SessionEnd` append chunked live Q&A only for work-evidence or structured-decision turns and do not auto-create `wiki/queries/` or `wiki/decisions/`. If the user explicitly asked to record or document durable knowledge and no durable wiki update is detected, `Stop`/`SessionEnd` queue a pending maintenance item for agent review. `Stop` and `SessionEnd` then clear the per-session turn buffer; `SubagentStop` does not.
|
|
48
50
|
|
|
49
51
|
Set `LLM_WIKI_KIT_AUTO_PROJECT_UPDATE=0` only while diagnosing automatic managed-template refresh behavior.
|
|
@@ -31,6 +31,7 @@ Expected behavior:
|
|
|
31
31
|
|
|
32
32
|
- `SessionStart` first attempts a safe managed-template refresh, removes Codex-facing legacy `oh-my-codex:wiki`/`omx_wiki` surfaces when they reappear, recovers stale turn state into `outputs/maintenance/queue.md`, performs a cached npm update notice check for npm installs, then injects functional compact context. The context still uses `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, relevant wiki/search state, operating rules, maintenance signals, passive runtime update status, and managed-template cleanup notes; the hook formats those signals so they are usable if shown in the Codex UI.
|
|
33
33
|
- `UserPromptSubmit` recovers stale turn state, searches project wiki pages with MiniSearch or substring fallback, expands one-hop wikilinks, redacts context fields, performs the same cached update notice check, and injects the smallest useful functional compact context set. Update notice cache is scoped by npm command, and maintenance reminders are shown only when the prompt is wiki/maintenance related or matches a queue topic.
|
|
34
|
+
- Hook-visible language is selected from the current user prompt first. Korean prompts get Korean guidance, English prompts get English guidance. If no prompt language is clear, Codex falls back to local `CLAUDE.md`/`AGENTS.md` language signals, then English.
|
|
34
35
|
- `PreToolUse` records redacted tool summaries without blocking tool calls.
|
|
35
36
|
- `PostToolUse` records redacted tool summaries in a turn buffer.
|
|
36
37
|
- `PreCompact` classifies the current turn before compaction. Simple turns record only a context note; work-evidence or structured-decision turns write a chunked live Q&A checkpoint; explicit durable candidates write a maintenance queue item only when no durable wiki update is detected. The checkpoint can include only a bounded redacted transcript tail, never the full raw transcript or raw `transcript_path`. Compaction is not blocked; if checkpoint storage fails, the hook records a compact recovery packet for the next legal context-injection event.
|