docuking-mcp 1.2.0 → 1.2.2
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/index.js +70 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -396,6 +396,23 @@ DocuKing은 문서 버전 관리 시스템입니다. Git이 코드를 관리하
|
|
|
396
396
|
2. 프로젝트 연결은 각 폴더마다 (폴더별로 다른 프로젝트 ID)
|
|
397
397
|
3. 이미 MCP가 작동 중이면 재시작 없이 바로 프로젝트 연결 가능
|
|
398
398
|
|
|
399
|
+
## .gitignore 설정 (중요!)
|
|
400
|
+
|
|
401
|
+
DocuKing 문서 폴더는 git에서 제외해야 합니다. 코드는 git으로, 문서는 DocuKing으로 분리 관리합니다.
|
|
402
|
+
|
|
403
|
+
\`\`\`gitignore
|
|
404
|
+
# DocuKing 문서 폴더 (문서는 DocuKing으로 관리)
|
|
405
|
+
*_DocuKing_*
|
|
406
|
+
*_Docuking_*
|
|
407
|
+
z_DocuKing/
|
|
408
|
+
zz_Coworker_*/
|
|
409
|
+
\`\`\`
|
|
410
|
+
|
|
411
|
+
**왜 gitignore에 등록해야 하나요?**
|
|
412
|
+
- 문서와 코드의 버전 관리를 분리
|
|
413
|
+
- git 저장소 크기 최적화 (대용량 문서 제외)
|
|
414
|
+
- DocuKing이 문서 버전 관리를 전담
|
|
415
|
+
|
|
399
416
|
## MCP 도구 목록
|
|
400
417
|
|
|
401
418
|
### 1. docuking_init
|
|
@@ -868,24 +885,62 @@ MCP 설정에 다음을 추가하세요:
|
|
|
868
885
|
};
|
|
869
886
|
}
|
|
870
887
|
|
|
871
|
-
//
|
|
872
|
-
const
|
|
873
|
-
const
|
|
888
|
+
// Co-worker 권한은 API Key 형식에서 판단 (sk_xxx_cw_이름_)
|
|
889
|
+
const coworkerMatch = API_KEY.match(/^sk_[a-f0-9]+_cw_([^_]+)_/);
|
|
890
|
+
const isCoworker = !!coworkerMatch;
|
|
891
|
+
const coworkerName = coworkerMatch ? coworkerMatch[1] : null;
|
|
874
892
|
|
|
875
|
-
|
|
876
|
-
|
|
893
|
+
// 폴더 생성: 코워커는 zz_Coworker_{이름}/, 오너는 z_DocuKing/
|
|
894
|
+
let folderName;
|
|
895
|
+
let workingPath;
|
|
896
|
+
|
|
897
|
+
if (isCoworker) {
|
|
898
|
+
folderName = `zz_Coworker_${coworkerName}`;
|
|
899
|
+
workingPath = path.join(localPath, folderName);
|
|
900
|
+
} else {
|
|
901
|
+
folderName = 'z_DocuKing';
|
|
902
|
+
workingPath = path.join(localPath, folderName);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
if (!fs.existsSync(workingPath)) {
|
|
906
|
+
fs.mkdirSync(workingPath, { recursive: true });
|
|
877
907
|
}
|
|
878
908
|
|
|
879
909
|
// JSON 이스케이프 처리
|
|
880
910
|
const escapedPath = localPath.replace(/\\/g, '\\\\');
|
|
881
911
|
const repoConfig = `{\\"${escapedPath}\\":{\\"id\\":\\"${projectId}\\",\\"name\\":\\"${projectName}\\"}}`;
|
|
882
912
|
|
|
883
|
-
// 연결 완료 안내
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
913
|
+
// 연결 완료 안내 (오너/코워커에 따라 다른 메시지)
|
|
914
|
+
if (isCoworker) {
|
|
915
|
+
return {
|
|
916
|
+
content: [
|
|
917
|
+
{
|
|
918
|
+
type: 'text',
|
|
919
|
+
text: `DocuKing 연결 완료! (참여자)
|
|
920
|
+
|
|
921
|
+
📁 프로젝트: ${projectName}
|
|
922
|
+
📂 ${folderName}/ 폴더가 생성되었습니다.
|
|
923
|
+
👤 참여자: ${coworkerName}
|
|
924
|
+
|
|
925
|
+
참여자 사용법:
|
|
926
|
+
- "DocuKing에서 가져와" → 오너의 문서를 z_DocuKing/에 Pull
|
|
927
|
+
- ${folderName}/ 폴더에 문서 작성
|
|
928
|
+
- "DocuKing에 올려줘" → 내 문서를 서버에 Push
|
|
929
|
+
|
|
930
|
+
💡 참여자는 ${folderName}/ 폴더에만 Push할 수 있습니다.
|
|
931
|
+
오너의 문서는 Pull로 읽을 수 있지만 수정은 제안서 형태로 작성하세요.
|
|
932
|
+
|
|
933
|
+
MCP 설정에 레포 매핑 추가 필요:
|
|
934
|
+
"DOCUKING_REPOS": "${repoConfig}"`,
|
|
935
|
+
},
|
|
936
|
+
],
|
|
937
|
+
};
|
|
938
|
+
} else {
|
|
939
|
+
return {
|
|
940
|
+
content: [
|
|
941
|
+
{
|
|
942
|
+
type: 'text',
|
|
943
|
+
text: `DocuKing 연결 완료!
|
|
889
944
|
|
|
890
945
|
📁 프로젝트: ${projectName}
|
|
891
946
|
📂 z_DocuKing/ 폴더가 생성되었습니다.
|
|
@@ -900,9 +955,10 @@ MCP 설정에 다음을 추가하세요:
|
|
|
900
955
|
|
|
901
956
|
MCP 설정에 레포 매핑 추가 필요:
|
|
902
957
|
"DOCUKING_REPOS": "${repoConfig}"`,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
958
|
+
},
|
|
959
|
+
],
|
|
960
|
+
};
|
|
961
|
+
}
|
|
906
962
|
}
|
|
907
963
|
|
|
908
964
|
// docuking_push 구현
|