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.
@@ -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 평소처럼 사용한다. 사용자가 별도 명령을 실행하지 않아도 agent 필요한 wiki 조회와 정리를 수행하되, 현재 사용자 답변을 지연시키지 않는다.',
375
- '- durable 기록은 중요도와 동의 흐름에 따라 선택적으로 승격한다. 오래 지식은 승인된 경우 기존 wiki/architecture, wiki/debugging, wiki/decisions, wiki/concepts, procedures 문서에 합친다.',
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 lines = [
405
- 'LLM Wiki context (functional compact):',
406
- '- Priority: answer the current user request first; use wiki context when it helps.',
407
- '- 기능 유지: hook memory/search/capture/maintenance/update signals are active.',
408
- '- Durable project knowledge belongs in llm-wiki/wiki; never store credentials, tokens, private keys, or .env contents.',
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('', 'Memory focus:', '- See llm-wiki/wiki/memory.md and llm-wiki/wiki/index.md when project context is needed.');
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('', 'Relevant wiki pages:', '- No directly relevant durable wiki page found; answer normally and inspect files/wiki only if needed.');
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);