llm-wiki-kit 0.2.10 → 0.2.12
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 +24 -9
- package/docs/concepts.md +6 -5
- package/docs/integrations/claude-code.md +3 -1
- package/docs/integrations/codex.md +3 -2
- package/docs/manual.md +132 -383
- package/docs/operations.md +4 -1
- package/package.json +12 -2
- package/src/capture-policy.js +30 -23
- package/src/cli.js +17 -2
- package/src/hook.js +15 -7
- package/src/language.js +73 -0
- package/src/live-qa.js +321 -0
- package/src/maintenance.js +13 -8
- package/src/project-state.js +20 -9
- package/src/project.js +7 -29
- package/src/templates.js +89 -82
- package/src/update-notice.js +14 -4
- package/src/wiki-lint.js +49 -0
- package/src/wiki-search.js +35 -13
package/src/wiki-search.js
CHANGED
|
@@ -371,9 +371,9 @@ export function formatContextPack(pack) {
|
|
|
371
371
|
'- Treat chat memory as temporary; update project Markdown when knowledge should persist.',
|
|
372
372
|
'- Preserve raw/wiki separation. Do not store secrets, tokens, .env contents, private keys, or personal/customer identifiers.',
|
|
373
373
|
'- Prefer updating existing wiki pages over creating duplicate pages.',
|
|
374
|
-
'- Claude Code/Codex
|
|
375
|
-
'- durable
|
|
376
|
-
'- wiki/memory.md
|
|
374
|
+
'- Use Claude Code/Codex normally. The agent performs wiki lookup and maintenance without delaying the current answer.',
|
|
375
|
+
'- Promote durable records selectively by importance and user consent. Merge reusable knowledge into existing wiki/architecture, wiki/debugging, wiki/decisions, wiki/concepts, or procedures pages.',
|
|
376
|
+
'- Keep wiki/memory.md as short active memory and link to curated pages instead of copying long explanations.',
|
|
377
377
|
];
|
|
378
378
|
if (pack.query) {
|
|
379
379
|
lines.push(`- query: "${pack.query}"`);
|
|
@@ -401,12 +401,22 @@ export function formatContextPack(pack) {
|
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
export function formatHookContextPack(pack, options = {}) {
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
404
|
+
const language = options.language === 'ko' ? 'ko' : 'en';
|
|
405
|
+
const lines = language === 'ko'
|
|
406
|
+
? [
|
|
407
|
+
'LLM Wiki context (functional compact):',
|
|
408
|
+
'- 우선순위: 현재 사용자 요청에 먼저 답하고, wiki context는 도움이 될 때만 사용한다.',
|
|
409
|
+
'- 언어: 현재 사용자 입력 언어를 따른다. 경로, 명령어, 코드 식별자, 오류 원문은 원래 언어를 유지한다.',
|
|
410
|
+
'- 기능 유지: hook memory/search/capture/maintenance/update signals are active.',
|
|
411
|
+
'- 오래 남길 프로젝트 지식은 llm-wiki/wiki에 둔다. credentials, tokens, private keys, .env contents는 저장하지 않는다.',
|
|
412
|
+
]
|
|
413
|
+
: [
|
|
414
|
+
'LLM Wiki context (functional compact):',
|
|
415
|
+
'- Priority: answer the current user request first; use wiki context when it helps.',
|
|
416
|
+
'- Language: follow the current user prompt language. Keep paths, commands, code identifiers, and original error text unchanged.',
|
|
417
|
+
'- Functionality: hook memory/search/capture/maintenance/update signals are active.',
|
|
418
|
+
'- Durable project knowledge belongs in llm-wiki/wiki; never store credentials, tokens, private keys, or .env contents.',
|
|
419
|
+
];
|
|
410
420
|
if (pack.query) {
|
|
411
421
|
lines.push(`- query: "${compactText(pack.query, 180)}"`);
|
|
412
422
|
lines.push(`- search: ${pack.search}`);
|
|
@@ -414,15 +424,21 @@ export function formatHookContextPack(pack, options = {}) {
|
|
|
414
424
|
|
|
415
425
|
const memoryLines = memoryFocusLines(pack.memoryExcerpt, options.memoryLineLimit ?? 6);
|
|
416
426
|
if (memoryLines.length > 0) {
|
|
417
|
-
lines.push('', 'Memory focus:');
|
|
427
|
+
lines.push('', language === 'ko' ? 'Memory focus:' : 'Memory focus:');
|
|
418
428
|
lines.push(...memoryLines.map((line) => `- ${line.replace(/^-\s+/, '')}`));
|
|
419
429
|
} else {
|
|
420
|
-
lines.push(
|
|
430
|
+
lines.push(
|
|
431
|
+
'',
|
|
432
|
+
'Memory focus:',
|
|
433
|
+
language === 'ko'
|
|
434
|
+
? '- 프로젝트 맥락이 필요하면 llm-wiki/wiki/memory.md와 llm-wiki/wiki/index.md를 확인한다.'
|
|
435
|
+
: '- See llm-wiki/wiki/memory.md and llm-wiki/wiki/index.md when project context is needed.'
|
|
436
|
+
);
|
|
421
437
|
}
|
|
422
438
|
|
|
423
439
|
const hits = hookHits(pack, options);
|
|
424
440
|
if (hits.length > 0) {
|
|
425
|
-
lines.push('', 'Relevant wiki pages:');
|
|
441
|
+
lines.push('', language === 'ko' ? 'Relevant wiki pages:' : 'Relevant wiki pages:');
|
|
426
442
|
for (const hit of hits) {
|
|
427
443
|
const suffix = hit.source === 'linked' && hit.via.length > 0
|
|
428
444
|
? `, via ${hit.via.join(', ')}`
|
|
@@ -430,7 +446,13 @@ export function formatHookContextPack(pack, options = {}) {
|
|
|
430
446
|
lines.push(`- ${hit.path} (${hit.source}${suffix}): ${compactText(hit.snippet, HOOK_SNIPPET_CHARS)}`);
|
|
431
447
|
}
|
|
432
448
|
} else if (pack.query) {
|
|
433
|
-
lines.push(
|
|
449
|
+
lines.push(
|
|
450
|
+
'',
|
|
451
|
+
'Relevant wiki pages:',
|
|
452
|
+
language === 'ko'
|
|
453
|
+
? '- 직접 관련된 durable wiki 문서를 찾지 못했다. 정상적으로 답하고, 필요할 때만 파일/wiki를 확인한다.'
|
|
454
|
+
: '- No directly relevant durable wiki page found; answer normally and inspect files/wiki only if needed.'
|
|
455
|
+
);
|
|
434
456
|
}
|
|
435
457
|
|
|
436
458
|
const logLines = logFocusLines(pack.logExcerpt, options.logLineLimit ?? 2);
|