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.
Files changed (2) hide show
  1. package/index.js +53 -14
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -885,24 +885,62 @@ MCP 설정에 다음을 추가하세요:
885
885
  };
886
886
  }
887
887
 
888
- // z_DocuKing 폴더 생성 (항상 새로 만듦)
889
- const folderName = 'z_DocuKing';
890
- const docuKingPath = path.join(localPath, folderName);
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(docuKingPath)) {
893
- fs.mkdirSync(docuKingPath, { recursive: true });
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
- return {
902
- content: [
903
- {
904
- type: 'text',
905
- text: `DocuKing 연결 완료!
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 구현
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docuking-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "DocuKing MCP Server - AI 시대의 문서 협업 플랫폼",
5
5
  "type": "module",
6
6
  "main": "index.js",