llm-wiki-kit 0.2.2 → 0.2.3

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 CHANGED
@@ -104,7 +104,7 @@ Most users should not need these during daily Claude Code/Codex work. They exist
104
104
 
105
105
  `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` 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.
106
106
 
107
- 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, the injected hook context tells the active agent to mention the available update and offer `llm-wiki update --workspace <project-or-search-root>`. Set `LLM_WIKI_KIT_UPDATE_NOTICE=0` only when diagnosing or suppressing that reminder.
107
+ 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, the injected hook context gives the active agent a Korean update reminder and tells it to offer `llm-wiki update --workspace <project-or-search-root>`. 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 reminder.
108
108
 
109
109
  `llm-wiki post-update --workspace <project>` reapplies the current runtime's hook entries and safe managed template updates without running `npm install -g`. Use `post-update --all --workspace <search-root>` to reapply templates across discovered project roots.
110
110
 
@@ -40,7 +40,7 @@ when no project `CLAUDE.md` exists. Existing `CLAUDE.md` files are not overwritt
40
40
 
41
41
  The hook records redacted turn summaries but does not deny tool calls only because an input looks sensitive. Hook payloads are stored as small redacted event envelopes rather than full transcripts, and context output is redacted field by field before it is returned to Claude Code.
42
42
 
43
- 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 `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, recent log context, operating rules, a one-item maintenance summary when needed, any update notice, and any maintenance note for outdated or customized managed rules. 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 context set. Maintenance reminders are shown only when the prompt is wiki/maintenance related or matches a queue topic.
43
+ 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 `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, recent log context, operating rules, a one-item maintenance summary when needed, any Korean update notice, and any maintenance note for outdated or customized managed rules. 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 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.
44
44
 
45
45
  `PostToolUse` and `PostToolBatch` record redacted tool summaries in the same turn buffer. `PreCompact` records a compaction note, and `PostCompact` records the note and returns fresh wiki context. In the default `answer-first` mode, `SubagentStop` does not create live Q&A, query, decision, or maintenance files. `Stop` and `SessionEnd` append live Q&A only for meaningful work 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.
46
46
 
@@ -29,8 +29,8 @@ Handled events:
29
29
 
30
30
  Expected behavior:
31
31
 
32
- - `SessionStart` 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 `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, recent log context, operating rules, a one-item maintenance summary when needed, any update notice, and any maintenance note for outdated or customized managed rules.
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 context set. Maintenance reminders are shown only when the prompt is wiki/maintenance related or matches a queue topic.
32
+ - `SessionStart` 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 `llm-wiki/wiki/memory.md`, `llm-wiki/wiki/index.md`, recent log context, operating rules, a one-item maintenance summary when needed, any Korean update notice, and any maintenance note for outdated or customized managed rules.
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 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
34
  - `PreToolUse` records redacted tool summaries without blocking tool calls.
35
35
  - `PostToolUse` records redacted tool summaries in a turn buffer.
36
36
  - `PreCompact` records a compaction note; `PostCompact` records the note and returns fresh wiki context.
package/docs/manual.md CHANGED
@@ -149,7 +149,7 @@ llm-wiki update --workspace /path/to/project --dry-run
149
149
 
150
150
  `update`는 source checkout에서 self-update하지 않는다. source checkout 개발 중에는 npm package나 local tarball로 global install한 뒤 update behavior를 테스트한다.
151
151
 
152
- global npm runtime으로 설치된 경우 hook은 사용 흐름 중 cached update notice check를 수행한다. 자동 설치는 하지 않는다. 새 npm release가 감지되면 hook context가 active agent에게 “업데이트 가능”을 짧게 알리고 `llm-wiki update --workspace <project-or-search-root>` 실행을 제안하게 한다. `LLM_WIKI_KIT_UPDATE_NOTICE=0`으로 이 reminder만 끌 수 있다.
152
+ global npm runtime으로 설치된 경우 hook은 사용 흐름 중 cached update notice check를 수행한다. 자동 설치는 하지 않는다. 새 npm release가 감지되면 hook context가 active agent에게 한국어로 “업데이트 가능”을 짧게 알리고 `llm-wiki update --workspace <project-or-search-root>` 실행을 제안하게 한다. cache는 lookup에 사용한 npm command별로 분리되어 test/fake npm 결과가 일반 hook session에 섞이지 않는다. `LLM_WIKI_KIT_UPDATE_NOTICE=0`으로 이 reminder만 끌 수 있다.
153
153
 
154
154
  ### `llm-wiki post-update`
155
155
 
@@ -101,7 +101,7 @@ llm-wiki maintenance --workspace /path/to/project
101
101
 
102
102
  `update --check [--to <version-or-tag>]` is online and asks npm for the target version. It reports `update available` only when that registry target is newer than the installed version, so it does not suggest downgrades.
103
103
 
104
- Installed npm runtimes also run a cached hook-side update notice check while the user works. It never installs automatically. If npm has a newer release, `SessionStart`/`InstructionsLoaded`/`UserPromptSubmit` context tells the active agent to mention the available update and offer `llm-wiki update --workspace <project-or-search-root>`. Set `LLM_WIKI_KIT_UPDATE_NOTICE=0` to suppress this reminder while diagnosing.
104
+ Installed npm runtimes also run a cached hook-side update notice check while the user works. It never installs automatically. If npm has a newer release, `SessionStart`/`InstructionsLoaded`/`UserPromptSubmit` context gives the active agent a Korean update reminder and tells it to offer `llm-wiki update --workspace <project-or-search-root>`. 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` to suppress this reminder while diagnosing.
105
105
 
106
106
  `projects --workspace <search-root>` lists discovered project roots that have `llm-wiki/.kit-state.json` or an older `llm-wiki/wiki/index.md`, reports whether their managed templates are current, and prints the update commands for the search root.
107
107
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-wiki-kit",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Hook-first living LLM Wiki runtime for Codex and Claude Code.",
5
5
  "type": "module",
6
6
  "files": [
@@ -148,15 +148,16 @@ export function formatDurableCaptureGuidance(query) {
148
148
  if (!text) return '';
149
149
  if (explicitDurableRequested(text)) {
150
150
  return [
151
- 'LLM Wiki durable documentation request detected:',
151
+ 'LLM Wiki 문서화 요청 감지:',
152
152
  '- 현재 사용자 요청을 먼저 처리하되, 사용자가 기록/문서화를 요청했으므로 기존 durable wiki 문서를 찾아 갱신한다.',
153
153
  '- 새 문서는 관련 기존 문서가 없을 때만 만들고, credentials/private data는 저장하지 않는다.',
154
154
  ].join('\n');
155
155
  }
156
156
  if (hasDurableKeyword(text)) {
157
157
  return [
158
- 'LLM Wiki durable knowledge note:',
159
- '- 현재 답변을 먼저 한다. 다음 세션에도 쓸 결론이면 답변 끝에서 짧게 wiki 문서화 여부를 물어본다.',
158
+ 'LLM Wiki 저장 후보 알림:',
159
+ '- 현재 답변을 먼저 한다.',
160
+ '- 다음 세션에도 재사용할 만한 내용(결정, 정책, 디버깅 결과, 운영 절차, 검증된 상태 등)이 있으면 답변 끝에서 짧게 wiki 문서화 여부를 물어본다.',
160
161
  ].join('\n');
161
162
  }
162
163
  return '';
package/src/cli.js CHANGED
@@ -279,7 +279,7 @@ function formatUpdate(value) {
279
279
  `- installed: ${value.installedVersion}`,
280
280
  `- latest: ${value.latestVersion}`,
281
281
  `- update available: ${value.updateAvailable ? 'yes' : 'no'}`,
282
- ...(value.updateAvailable ? [`- recommended action: ${commandForProject('update', value.workspace)}`] : []),
282
+ ...(value.updateAvailable ? [`- 권장 실행: ${commandForProject('update', value.workspace)}`] : []),
283
283
  `- project applied runtime: ${value.project?.lastRuntimeVersionApplied || 'unknown'}`,
284
284
  ].join('\n');
285
285
  }
@@ -296,7 +296,7 @@ function formatUpdate(value) {
296
296
  `- installed: ${value.installedVersion}`,
297
297
  `- latest: ${value.latestVersion}`,
298
298
  `- update available: ${value.updateAvailable ? 'yes' : 'no'}`,
299
- ...(value.updateAvailable ? [`- recommended action: ${commandForProject('update', value.workspace)}`] : []),
299
+ ...(value.updateAvailable ? [`- 권장 실행: ${commandForProject('update', value.workspace)}`] : []),
300
300
  `- scope: ${value.scope || 'current'}`,
301
301
  ...(projects.length > 0 ? [`- projects checked: ${projects.length}`] : []),
302
302
  `- project template changes: ${changed}`,
package/src/hook.js CHANGED
@@ -75,7 +75,7 @@ async function handleAnswerFirstStop(projectRoot, eventName, payload, entry) {
75
75
  const archiveEntry = {
76
76
  ...entry,
77
77
  followUp: classification.suggestDurable
78
- ? '이 결론은 다음 세션에도 있어 보입니다. 사용자가 승인하면 기존 durable wiki 문서에 합친다.'
78
+ ? '이 turn에 저장할 만한 내용이 있어 보입니다. 사용자가 승인하면 기존 durable wiki 문서에 합친다.'
79
79
  : entry.followUp,
80
80
  };
81
81
  const liveQaPath = await appendLiveQa(projectRoot, archiveEntry);
package/src/templates.js CHANGED
@@ -17,7 +17,7 @@ This repository uses llm-wiki-kit as a hook-first living Markdown wiki for Codex
17
17
  - hook은 redacted raw envelope와 필요한 live Q&A를 안전하게 남긴다. \`wiki/queries\`/\`wiki/decisions\` 자동 승격은 기본값이 아니며, durable 지식은 중요도와 동의 흐름에 따라 agent가 기존 정식 wiki 문서에 합친다.
18
18
  - hook은 종료/시작 경계에서 정말 필요한 정리 후보를 \`llm-wiki/outputs/maintenance/queue.md\`에 남길 수 있다. pending 항목은 현재 응답을 지연시키지 않는 범위에서 agent가 병합하거나 done/skipped로 표시한다.
19
19
  - 새 문서를 만들기 전에 기존 wiki 문서를 먼저 찾아 갱신한다. 반복해서 쓸 사실은 \`outputs/questions/\`에만 두지 말고 적절한 wiki 문서에 합친다.
20
- - 일회성 작업 기록은 필요할 때 \`llm-wiki/outputs/questions/\`에 보존하고, 재사용 가능한 결론은 승인된 경우 \`wiki/architecture/\`, \`wiki/debugging/\`, \`wiki/decisions/\`, \`wiki/concepts/\`, \`procedures/\`에 반영한다.
20
+ - 일회성 작업 기록은 필요할 때 \`llm-wiki/outputs/questions/\`에 보존하고, 재사용 가능한 사실/지식은 승인된 경우 \`wiki/architecture/\`, \`wiki/debugging/\`, \`wiki/decisions/\`, \`wiki/concepts/\`, \`procedures/\`에 반영한다.
21
21
  - 검증 명령, 근거 파일, 불확실한 점을 함께 남긴다. 추론은 추론이라고 표시하고, 모순은 지우지 말고 Open Questions 또는 Contradictions에 남긴다.
22
22
  - 인증값, token, password, private key, \`.env\` 원문은 저장하지 않는다. 필요한 경우 redacted summary만 남긴다.
23
23
 
@@ -107,7 +107,7 @@ Generated by llm-wiki-kit.
107
107
 
108
108
  - 넓은 질문은 memory와 이 index에서 시작한다.
109
109
  - 새 문서를 만들기 전에 관련 기존 문서 3-7개를 먼저 확인한다.
110
- - 오래 쓸 결론은 기존 정식 문서에 합치고, 일회성 기록은 outputs/questions에 둔다.
110
+ - 오래 쓸 사실/지식은 기존 정식 문서에 합치고, 일회성 기록은 outputs/questions에 둔다.
111
111
  - 관련 페이지가 생기면 \`[[page-or-topic]]\` 링크를 추가한다.
112
112
 
113
113
  <!-- llm-wiki-kit:index-start -->
@@ -184,7 +184,7 @@ export function procedure(name) {
184
184
  5. 검증된 사실과 추론을 분리한다.
185
185
  6. 수동 확인이 필요할 때만 \`llm-wiki context "<query>"\`를 쓴다. 과거 episodic query까지 봐야 할 때는 \`--include-episodic\`을 붙인다.
186
186
  7. 일회성 답변은 durable wiki로 승격하지 않는다. 필요한 작업 turn만 \`outputs/questions/\`에 남긴다.
187
- 8. 반복해서 쓸 결론은 중요도와 동의 흐름에 따라 \`wiki/architecture/\`, \`wiki/debugging/\`, \`wiki/decisions/\`, \`wiki/concepts/\`, \`procedures/\`에 합친다.
187
+ 8. 반복해서 쓸 사실/지식은 중요도와 동의 흐름에 따라 \`wiki/architecture/\`, \`wiki/debugging/\`, \`wiki/decisions/\`, \`wiki/concepts/\`, \`procedures/\`에 합친다.
188
188
  `,
189
189
  'lint.md': `# Lint Procedure
190
190
 
@@ -48,10 +48,11 @@ function freshEnough(record, now = Date.now()) {
48
48
  return Number.isFinite(checkedAt) && now - checkedAt < intervalMs();
49
49
  }
50
50
 
51
- function cacheMatches(record, target, installedVersion) {
51
+ function cacheMatches(record, target, installedVersion, npm) {
52
52
  return record?.schemaVersion === NOTICE_SCHEMA_VERSION &&
53
53
  record.target === target &&
54
- record.installedVersion === installedVersion;
54
+ record.installedVersion === installedVersion &&
55
+ record.npmCommand === npm;
55
56
  }
56
57
 
57
58
  function trimDetail(value) {
@@ -82,9 +83,10 @@ export async function checkUpdateNotice(options = {}) {
82
83
  if (!noticeEnabled()) return null;
83
84
  const target = options.to || process.env.LLM_WIKI_KIT_UPDATE_NOTICE_TARGET || 'latest';
84
85
  const installedVersion = runtimeVersion();
86
+ const npm = npmCommand();
85
87
  const cachePath = noticeCachePath();
86
88
  const cached = await readJson(cachePath, null);
87
- if (!options.force && cacheMatches(cached, target, installedVersion) && freshEnough(cached)) {
89
+ if (!options.force && cacheMatches(cached, target, installedVersion, npm) && freshEnough(cached)) {
88
90
  return cached;
89
91
  }
90
92
 
@@ -95,6 +97,7 @@ export async function checkUpdateNotice(options = {}) {
95
97
  checkedAt,
96
98
  target,
97
99
  installedVersion,
100
+ npmCommand: npm,
98
101
  ...registry,
99
102
  };
100
103
  await writeJson(cachePath, record).catch(() => {});
@@ -109,12 +112,12 @@ export async function updateNoticeContext(projectRoot, eventName, options = {})
109
112
  const workspace = resolve(projectRoot || process.cwd());
110
113
  const updateCommand = commandForProject('update', workspace);
111
114
  return [
112
- 'LLM Wiki update notice:',
113
- `- Installed llm-wiki-kit: ${notice.installedVersion}`,
114
- `- Latest npm release: ${notice.latestVersion}`,
115
- `- A newer llm-wiki-kit release was detected automatically while the user was using the hooks.`,
116
- `- Briefly tell the user an update is available and offer to run: \`${updateCommand}\``,
117
- '- If the user wants every known project root updated, use the broader search root in the same command, for example `--workspace /apps`.',
118
- '- Do not install automatically unless the user asks for the update.',
115
+ 'LLM Wiki 업데이트 알림:',
116
+ `- 설치된 llm-wiki-kit: ${notice.installedVersion}`,
117
+ `- npm 최신 릴리스: ${notice.latestVersion}`,
118
+ '- hook 사용 중 더 새로운 llm-wiki-kit 릴리스가 자동 감지되었습니다.',
119
+ `- 사용자에게 업데이트 가능 사실을 짧게 알리고 다음 명령 실행을 제안하세요: \`${updateCommand}\``,
120
+ '- 알려진 모든 프로젝트 root를 업데이트하려면 같은 명령에서 넓은 search root 사용합니다. 예: `--workspace /apps`.',
121
+ '- 사용자가 요청하기 전에는 자동 설치하지 마세요.',
119
122
  ].join('\n');
120
123
  }