docuking-mcp 1.2.1 → 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 +53 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -885,24 +885,62 @@ MCP 설정에 다음을 추가하세요:
|
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
//
|
|
889
|
-
const
|
|
890
|
-
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;
|
|
892
|
+
|
|
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
|
+
}
|
|
891
904
|
|
|
892
|
-
if (!fs.existsSync(
|
|
893
|
-
fs.mkdirSync(
|
|
905
|
+
if (!fs.existsSync(workingPath)) {
|
|
906
|
+
fs.mkdirSync(workingPath, { recursive: true });
|
|
894
907
|
}
|
|
895
908
|
|
|
896
909
|
// JSON 이스케이프 처리
|
|
897
910
|
const escapedPath = localPath.replace(/\\/g, '\\\\');
|
|
898
911
|
const repoConfig = `{\\"${escapedPath}\\":{\\"id\\":\\"${projectId}\\",\\"name\\":\\"${projectName}\\"}}`;
|
|
899
912
|
|
|
900
|
-
// 연결 완료 안내
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
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 연결 완료!
|
|
906
944
|
|
|
907
945
|
📁 프로젝트: ${projectName}
|
|
908
946
|
📂 z_DocuKing/ 폴더가 생성되었습니다.
|
|
@@ -917,9 +955,10 @@ MCP 설정에 다음을 추가하세요:
|
|
|
917
955
|
|
|
918
956
|
MCP 설정에 레포 매핑 추가 필요:
|
|
919
957
|
"DOCUKING_REPOS": "${repoConfig}"`,
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
958
|
+
},
|
|
959
|
+
],
|
|
960
|
+
};
|
|
961
|
+
}
|
|
923
962
|
}
|
|
924
963
|
|
|
925
964
|
// docuking_push 구현
|