docuking-mcp 2.8.0 → 2.8.1

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.
@@ -206,31 +206,10 @@ function updateLocalRules(localPath, currentFiles, changes, config) {
206
206
  }
207
207
 
208
208
  // ========================================
209
- // 1.5. xx_Infra_Config 파일들을 infra/ 서브폴더로 복사
209
+ // 1.5. xx_Infra_Config 복사하지 않음
210
+ // 이미 Pull 후 xx_Infra_Config/에 존재함
211
+ // AI가 변경 감지 시 직접 읽고 로컬 환경에 맞게 적용
210
212
  // ========================================
211
- const infraLocalPath = path.join(localRulesPath, 'infra');
212
- if (infraConfigFiles.length > 0) {
213
- fs.mkdirSync(infraLocalPath, { recursive: true });
214
-
215
- for (const file of infraConfigFiles) {
216
- // xx_Infra_Config/deploy.md → infra/deploy.md
217
- const relativePath = file.key.replace('xx_Infra_Config/', '');
218
- const targetPath = path.join(infraLocalPath, relativePath);
219
-
220
- // 디렉토리 생성
221
- fs.mkdirSync(path.dirname(targetPath), { recursive: true });
222
-
223
- // 파일 읽기 및 로컬화
224
- try {
225
- const content = fs.readFileSync(file.fullPath, 'utf-8');
226
- const localizedContent = localizeContent(content, config);
227
- fs.writeFileSync(targetPath, localizedContent, 'utf-8');
228
- createdFiles.push(`infra/${relativePath}`);
229
- } catch (e) {
230
- console.error(`[KingCast] 인프라 설정 파일 복사 실패: ${file.key} - ${e.message}`);
231
- }
232
- }
233
- }
234
213
 
235
214
  // ========================================
236
215
  // 2. 협업자용 설정 파일 생성 (_coworker_config.md)
@@ -347,12 +326,14 @@ git checkout -b coworker/${coworkerFolder}
347
326
  }
348
327
  }
349
328
 
350
- // 인프라 설정 파일 목록 추가
329
+ // 인프라 설정 파일 안내 (복사하지 않으므로 원본 경로 표시)
351
330
  if (infraConfigFiles.length > 0) {
352
- indexContent += '\n## 인프라 설정 (참조용)\n';
331
+ indexContent += '\n## 인프라 설정 (xx_Infra_Config/)\n';
332
+ indexContent += '> 아래 파일들은 복사되지 않습니다. 원본 경로에서 직접 읽으세요.\n';
333
+ indexContent += '> 변경 감지 시 AI가 내용을 읽고 로컬 환경에 맞게 적용해야 합니다.\n\n';
353
334
  for (const file of infraConfigFiles) {
354
335
  const relativePath = file.key.replace('xx_Infra_Config/', '');
355
- indexContent += `- [${relativePath}](./infra/${relativePath})\n`;
336
+ indexContent += `- xx_Infra_Config/${relativePath}\n`;
356
337
  }
357
338
  }
358
339
 
@@ -381,19 +362,8 @@ git checkout -b coworker/${coworkerFolder}
381
362
  }
382
363
  }
383
364
  }
384
- // xx_Infra_Config 삭제
385
- if (deletedKey.startsWith('xx_Infra_Config/')) {
386
- const relativePath = deletedKey.replace('xx_Infra_Config/', '');
387
- const targetPath = path.join(localRulesPath, 'infra', relativePath);
388
- if (fs.existsSync(targetPath)) {
389
- try {
390
- fs.unlinkSync(targetPath);
391
- console.error(`[KingCast] 삭제된 인프라 설정 제거: infra/${relativePath}`);
392
- } catch (e) {
393
- console.error(`[KingCast] 파일 삭제 실패: infra/${relativePath} - ${e.message}`);
394
- }
395
- }
396
- }
365
+ // xx_Infra_Config 복사하지 않으므로 삭제 처리 불필요
366
+ // Pull 시 자동으로 원본 폴더에서 제거됨
397
367
  }
398
368
  }
399
369
 
@@ -503,8 +473,23 @@ export async function executeKingcast(localPath) {
503
473
  message += `\n 📄 정책 파일 ${result.policyCount}개 → .claude/rules/local/`;
504
474
  }
505
475
 
476
+ // xx_Infra_Config 변경 감지 시 안내
477
+ const infraChanges = [
478
+ ...changes.added.filter(k => k.startsWith('xx_Infra_Config/')),
479
+ ...changes.modified.filter(k => k.startsWith('xx_Infra_Config/')),
480
+ ];
481
+ if (infraChanges.length > 0) {
482
+ message += `\n\n🔧 인프라 설정 변경 감지 (${infraChanges.length}개):`;
483
+ for (const file of infraChanges) {
484
+ message += `\n - ${file}`;
485
+ }
486
+ message += `\n\n 👉 AI는 위 파일들을 읽고 로컬 환경에 맞게 적용하세요.`;
487
+ message += `\n 👉 예: .env 변수 추가/변경, 배포 설정 확인 등`;
488
+ }
489
+
506
490
  // 정책 변경 시 경고 메시지 추가
507
- if (changes.modified.length > 0) {
491
+ const policyModified = changes.modified.filter(k => k.startsWith('xx_Policy/'));
492
+ if (policyModified.length > 0) {
508
493
  message += `\n\n⚠️ 중요: 정책이 변경되었습니다!`;
509
494
  message += `\n 기존 코드가 새 정책과 맞지 않을 수 있습니다.`;
510
495
  message += `\n 변경된 정책 파일을 읽고, 기존 코드에도 새 정책을 적용하세요.`;
package/index.js CHANGED
@@ -665,8 +665,8 @@ DocuKing 협업의 핵심 원칙입니다. **각자 자기 영역만 수정할
665
665
  \`\`\`
666
666
 
667
667
  ### 킹캐스트 대상 폴더
668
- - \`xx_Infra_Config/\` - 환경 설정 (.env 백업, 배포 정보 등) → .claude/rules/local/infra/에 로컬화
669
- - \`xx_Policy/\` - AI 행동 지침 → .claude/rules/local/에 로컬화
668
+ - \`xx_Infra_Config/\` - 환경 설정 (.env 백업, 배포 정보 등) → 변경 감지만 (복사X)
669
+ - \`xx_Policy/\` - AI 행동 지침 → .claude/rules/local/에 복사
670
670
 
671
671
  ### 정책 파일 작성 템플릿 (오너용)
672
672
  \`\`\`
@@ -684,9 +684,11 @@ xx_Policy/
684
684
  - \`.claude/rules/local/_coworker_config.md\` - 협업자 설정 (협업자만)
685
685
 
686
686
  ### AI 필독: 킹캐스트 후 행동
687
- 1. Pull 후 "📢 킹캐스트" 메시지가 표시되면, 정책 변경이 감지된 것
687
+ 1. Pull 후 "📢 킹캐스트" 메시지가 표시되면, 정책/환경 변경이 감지된 것
688
688
  2. \`.claude/rules/local/00_index.md\`를 읽고 정책 목록 확인
689
689
  3. 각 정책 파일을 **읽어서** 내용을 숙지하고 규칙을 따라 작업
690
+ 4. **xx_Infra_Config 변경 시**: 원본 경로(xx_Infra_Config/)에서 직접 읽고 로컬 환경에 맞게 적용
691
+ - 예: .env 변수 추가/수정, 배포 설정 확인 등
690
692
 
691
693
  웹 탐색기: https://docuking.ai
692
694
  `;
package/lib/init.js CHANGED
@@ -126,15 +126,15 @@ project/
126
126
  협업자가 Pull할 때 자동으로 \`.claude/rules/local/\`에 로컬화됩니다.
127
127
 
128
128
  ### 킹캐스트 대상 폴더
129
- - \`xx_Infra_Config/\` - 환경 설정 (.env 백업, 배포 정보 등) → 로컬화 대상
130
- - \`xx_Policy/\` - AI 행동 지침 → 로컬화 대상
129
+ - \`xx_Infra_Config/\` - 환경 설정 (.env 백업, 배포 정보 등) → 변경 감지만
130
+ - \`xx_Policy/\` - AI 행동 지침 → .claude/rules/local/에 복사
131
131
 
132
132
  ### 킹캐스트 동작
133
133
  1. Pull 실행
134
- 2. xx_Infra_Config/, xx_Policy/ 폴더 변경 감지
134
+ 2. xx_Infra_Config/, xx_Policy/ 폴더 변경 감지 (해시 비교)
135
135
  3. \`xx_Policy/\` 파일들을 \`.claude/rules/local/\`에 서브파일 구조로 복사
136
- 4. \`xx_Infra_Config/\` 파일들도 \`.claude/rules/local/infra/\`에 복사 (환경변수, 배포 설정 )
137
- 5. 협업자의 경우 변수 치환 (폴더명, 브랜치명 로컬화)
136
+ 4. \`xx_Infra_Config/\` 변경 AI에게 알림 (복사X, 원본 경로에서 직접 읽음)
137
+ 5. 협업자의 경우 AI가 내용을 읽고 로컬 환경에 맞게 적용
138
138
 
139
139
  ### Git 제외 정책
140
140
 
@@ -146,9 +146,11 @@ project/
146
146
  - \`.claude/rules/local/*.md\` - 정책 파일 (폴더구조, API규칙 등 민감정보 없음)
147
147
 
148
148
  ### AI 필독
149
- - Pull 후 "📢 킹캐스트" 메시지가 표시되면, 정책 파일의 내용을 읽어 변경사항을 확인하세요.
149
+ - Pull 후 "📢 킹캐스트" 메시지가 표시되면 반드시 확인하세요.
150
150
  - \`.claude/rules/local/00_index.md\`를 읽고 정책 문서 목록을 확인하세요.
151
151
  - 각 정책 파일의 내용을 읽고 규칙을 따라 작업하세요.
152
+ - **xx_Infra_Config 변경 감지 시**: 해당 파일을 직접 읽고 로컬 환경에 맞게 적용하세요.
153
+ - 예: .env 변수 추가/수정, 배포 설정 확인 등
152
154
  `;
153
155
 
154
156
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docuking-mcp",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "DocuKing MCP Server - AI 시대의 문서 협업 플랫폼",
5
5
  "type": "module",
6
6
  "main": "index.js",