docuking-mcp 2.0.0 → 2.0.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/README.md +35 -74
- package/index.js +120 -69
- package/package.json +1 -1
- package/DEPLOY_TASK.md +0 -33
package/README.md
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# docuking-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI가 문서를 Push/Pull 할 수 있게 해주는 MCP 서버
|
|
4
4
|
|
|
5
5
|
## 설치
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx
|
|
8
|
+
npx docuking-mcp
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## MCP 설정
|
|
12
12
|
|
|
13
|
-
### Claude Code
|
|
14
|
-
|
|
15
|
-
`~/.claude.json` 또는 프로젝트의 `.claude/settings.json`에 추가:
|
|
13
|
+
### Claude Code
|
|
16
14
|
|
|
17
15
|
```json
|
|
18
16
|
{
|
|
19
17
|
"mcpServers": {
|
|
20
|
-
"
|
|
18
|
+
"docuking": {
|
|
21
19
|
"command": "npx",
|
|
22
|
-
"args": ["
|
|
23
|
-
"env": {
|
|
24
|
-
"DOCUREPO_API_KEY": "sk_xxx",
|
|
25
|
-
"DOCUREPO_REPOS": "{\"C:/my-project\":\"project-uuid\"}"
|
|
26
|
-
}
|
|
20
|
+
"args": ["-y", "docuking-mcp"]
|
|
27
21
|
}
|
|
28
22
|
}
|
|
29
23
|
}
|
|
@@ -36,13 +30,9 @@ npx docurepo-mcp
|
|
|
36
30
|
```json
|
|
37
31
|
{
|
|
38
32
|
"mcpServers": {
|
|
39
|
-
"
|
|
33
|
+
"docuking": {
|
|
40
34
|
"command": "npx",
|
|
41
|
-
"args": ["
|
|
42
|
-
"env": {
|
|
43
|
-
"DOCUREPO_API_KEY": "sk_xxx",
|
|
44
|
-
"DOCUREPO_REPOS": "{\"C:/my-project\":\"project-uuid\"}"
|
|
45
|
-
}
|
|
35
|
+
"args": ["-y", "docuking-mcp"]
|
|
46
36
|
}
|
|
47
37
|
}
|
|
48
38
|
}
|
|
@@ -50,68 +40,39 @@ npx docurepo-mcp
|
|
|
50
40
|
|
|
51
41
|
## 도구
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
프로젝트를 DocuRepo에 연결합니다.
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
docurepo_init(projectId, localPath)
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
- Z_DocuRepo/ 폴더 생성
|
|
62
|
-
- 레포 매핑 추가 안내
|
|
63
|
-
|
|
64
|
-
### docurepo_push
|
|
65
|
-
|
|
66
|
-
Z_DocuRepo/ 폴더의 문서를 서버에 업로드합니다.
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
docurepo_push(localPath, [filePath])
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
- "피터해" 요청 시 사용
|
|
73
|
-
- filePath 생략 시 전체 동기화
|
|
74
|
-
|
|
75
|
-
### docurepo_pull
|
|
76
|
-
|
|
77
|
-
서버에서 문서를 다운로드합니다.
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
docurepo_pull(localPath, [filePath])
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
- "피터에서 가져와" 요청 시 사용
|
|
84
|
-
- filePath 생략 시 전체 동기화
|
|
85
|
-
|
|
86
|
-
### docurepo_list
|
|
87
|
-
|
|
88
|
-
서버에 저장된 파일 목록을 조회합니다.
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
docurepo_list(localPath)
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## 환경변수
|
|
95
|
-
|
|
96
|
-
| 변수 | 설명 |
|
|
43
|
+
| 도구 | 설명 |
|
|
97
44
|
|------|------|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
|
|
45
|
+
| docuking_init | 프로젝트 연결, yy_All_Docu/ 및 zz_ai_* 폴더 생성 |
|
|
46
|
+
| docuking_push | yy_All_Docu/ → 서버 업로드 |
|
|
47
|
+
| docuking_pull | 서버 → yy_All_Docu/ 다운로드 |
|
|
48
|
+
| docuking_status | 동기화 상태 확인 |
|
|
49
|
+
| docuking_list | 서버 파일 목록 조회 |
|
|
50
|
+
| docuking_log | 커밋 히스토리 조회 |
|
|
51
|
+
| docuking_diff | 버전 간 차이 비교 |
|
|
52
|
+
| docuking_rollback | 특정 커밋으로 롤백 |
|
|
53
|
+
| docuking_talk | AI 대화록 저장 (zz_ai_Talk/) |
|
|
54
|
+
| docuking_plan | 작업 계획 관리 (zzz_ai_Plan/) |
|
|
55
|
+
| docuking_done | 작업 완료 처리 |
|
|
56
|
+
| docuking_todo | 킹투두 관리 (zz_ai_Todo/) |
|
|
57
|
+
|
|
58
|
+
## 폴더 구조
|
|
103
59
|
|
|
104
60
|
```
|
|
105
61
|
프로젝트/
|
|
106
|
-
├──
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
└── 뭐든지/
|
|
62
|
+
├── yy_All_Docu/ ← 동기화 대상 (Push/Pull)
|
|
63
|
+
│ └── yy_Coworker_{이름}/ ← 협업자 작업 폴더
|
|
64
|
+
├── zz_ai_Talk/ ← AI 대화록 (로컬 전용)
|
|
65
|
+
├── zz_ai_Todo/ ← AI 투두 (로컬 전용)
|
|
66
|
+
└── zzz_ai_Plan/ ← AI 플랜 (로컬 전용)
|
|
112
67
|
```
|
|
113
68
|
|
|
114
|
-
|
|
69
|
+
**접두사 규칙:**
|
|
70
|
+
- `yy_*`: 동기화 대상
|
|
71
|
+
- `zz_*`: 로컬 전용 (Push 제외)
|
|
72
|
+
|
|
73
|
+
## 웹사이트
|
|
74
|
+
|
|
75
|
+
https://docuking.ai
|
|
115
76
|
|
|
116
77
|
## 라이센스
|
|
117
78
|
|
package/index.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* 폴더 구조:
|
|
9
9
|
* - yy_All_Docu/ : 킹폴더와 동기화 (Push/Pull 대상)
|
|
10
10
|
* - yy_All_Docu/yy_{이름}/ : 협업자 폴더 (동기화 대상)
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
11
|
+
* - zz_ai_Talk/ : AI 대화록 (로컬 전용, 킹톡)
|
|
12
|
+
* - zz_ai_Todo/ : AI 투두 (로컬 전용, 킹투두)
|
|
13
|
+
* - zzz_ai_Plan/ : AI 플랜 (로컬 전용, 킹플랜)
|
|
14
14
|
*
|
|
15
15
|
* 접두사 규칙:
|
|
16
16
|
* - yy_* : 동기화 대상 (Push/Pull)
|
|
@@ -37,6 +37,10 @@ import crypto from 'crypto';
|
|
|
37
37
|
// 환경변수에서 API 엔드포인트 설정 (키는 로컬 config에서 읽음)
|
|
38
38
|
const API_ENDPOINT = process.env.DOCUKING_API_ENDPOINT || 'https://docuking.ai/api';
|
|
39
39
|
|
|
40
|
+
// 파일 크기 제한 (50MB) - Base64 인코딩 시 66MB, 서버 제한 200MB 이내
|
|
41
|
+
const MAX_FILE_SIZE_MB = 50;
|
|
42
|
+
const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
43
|
+
|
|
40
44
|
/**
|
|
41
45
|
* 로컬 프로젝트의 .docuking/config.json에서 설정 읽기
|
|
42
46
|
*
|
|
@@ -141,7 +145,7 @@ docuking_done({
|
|
|
141
145
|
### 절대 규칙
|
|
142
146
|
- **작업 시작 전 반드시 \`docuking_plan\` 호출**
|
|
143
147
|
- **작업 완료 후 반드시 \`docuking_done\` 호출**
|
|
144
|
-
- 결과는 \`
|
|
148
|
+
- 결과는 \`zzz_ai_Plan/\`에 자동 저장됨 (로컬 전용)
|
|
145
149
|
`;
|
|
146
150
|
|
|
147
151
|
try {
|
|
@@ -423,7 +427,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
423
427
|
},
|
|
424
428
|
{
|
|
425
429
|
name: 'docuking_talk',
|
|
426
|
-
description: '의미 있는 대화 내용을
|
|
430
|
+
description: '의미 있는 대화 내용을 zz_ai_Talk/ 폴더에 기록합니다 (로컬 전용, 킹톡). AI가 중요한 논의/결정이라고 판단하거나, 사용자가 "이거 기록해줘"라고 요청할 때 사용.',
|
|
427
431
|
inputSchema: {
|
|
428
432
|
type: 'object',
|
|
429
433
|
properties: {
|
|
@@ -450,7 +454,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
450
454
|
},
|
|
451
455
|
{
|
|
452
456
|
name: 'docuking_plan',
|
|
453
|
-
description: '작업 계획 문서를
|
|
457
|
+
description: '작업 계획 문서를 zzz_ai_Plan/ 폴더에 생성/업데이트합니다 (로컬 전용, 킹플랜). 작업 시작 시 계획을 작성하고, 진행하면서 결과를 upsert합니다.',
|
|
454
458
|
inputSchema: {
|
|
455
459
|
type: 'object',
|
|
456
460
|
properties: {
|
|
@@ -519,7 +523,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
519
523
|
},
|
|
520
524
|
{
|
|
521
525
|
name: 'docuking_todo',
|
|
522
|
-
description: `킹투두(King Todo) - 프로젝트 공식 할일을
|
|
526
|
+
description: `킹투두(King Todo) - 프로젝트 공식 할일을 zz_ai_Todo/z_King_Todo.md에 관리합니다 (로컬 전용).
|
|
523
527
|
|
|
524
528
|
**AI 내장 TodoWrite와 다름!** 킹투두는 웹에 동기화되고 팀과 공유됩니다.
|
|
525
529
|
|
|
@@ -593,7 +597,7 @@ DocuKing은 문서 버전 관리 시스템입니다. Git이 코드를 관리하
|
|
|
593
597
|
- **로컬**: 사용자의 yy_All_Docu/ 폴더 (동기화 대상)
|
|
594
598
|
- **웹탐색기**: DocuKing 서버의 파일 저장소 (킹폴더)
|
|
595
599
|
- **캔버스**: 선택된 파일을 시각화하는 작업 공간
|
|
596
|
-
- **AI 작업 폴더**:
|
|
600
|
+
- **AI 작업 폴더**: zz_ai_Talk/, zz_ai_Todo/, zzz_ai_Plan/ (로컬 전용)
|
|
597
601
|
|
|
598
602
|
작동 방식: 로컬 yy_All_Docu/ → Push → 킹폴더 → 캔버스에서 시각화
|
|
599
603
|
|
|
@@ -628,9 +632,9 @@ DocuKing 문서 폴더는 git에서 제외해야 합니다. 코드는 git으로,
|
|
|
628
632
|
\`\`\`gitignore
|
|
629
633
|
# DocuKing 문서 폴더 (문서는 DocuKing으로 관리)
|
|
630
634
|
yy_All_Docu/
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
635
|
+
zz_ai_Talk/
|
|
636
|
+
zz_ai_Todo/
|
|
637
|
+
zzz_ai_Plan/
|
|
634
638
|
\`\`\`
|
|
635
639
|
|
|
636
640
|
**왜 gitignore에 등록해야 하나요?**
|
|
@@ -666,12 +670,12 @@ zz_AI_Plan/
|
|
|
666
670
|
특정 커밋으로 되돌립니다. (웹 탐색기에서 사용 가능)
|
|
667
671
|
|
|
668
672
|
### 9. docuking_talk
|
|
669
|
-
의미 있는 대화 내용을 \`
|
|
673
|
+
의미 있는 대화 내용을 \`zz_ai_Talk/\` 폴더에 기록합니다 (로컬 전용, 킹톡).
|
|
670
674
|
- AI가 중요한 논의/결정이라고 판단할 때
|
|
671
675
|
- 사용자가 "이거 기록해줘"라고 요청할 때
|
|
672
676
|
|
|
673
677
|
### 10. docuking_plan
|
|
674
|
-
작업 계획을 \`
|
|
678
|
+
작업 계획을 \`zzz_ai_Plan/\` 폴더에 생성/업데이트합니다 (로컬 전용, 킹플랜).
|
|
675
679
|
- 작업 시작 시 계획 생성
|
|
676
680
|
- 진행하면서 단계별 결과 upsert
|
|
677
681
|
- planId로 기존 계획 찾아서 업데이트
|
|
@@ -743,7 +747,7 @@ DocuKing에는 **오너(Owner)**와 **참여자(Co-worker)** 두 가지 권한
|
|
|
743
747
|
|
|
744
748
|
**예시:**
|
|
745
749
|
\`\`\`
|
|
746
|
-
|
|
750
|
+
yy_All_Docu/
|
|
747
751
|
├── 정책/
|
|
748
752
|
│ └── README.md ← 오너가 작성
|
|
749
753
|
├── 기획/
|
|
@@ -757,7 +761,7 @@ z_DocuKing/
|
|
|
757
761
|
**특징:**
|
|
758
762
|
- 프로젝트에 초대받아 참여한 사람
|
|
759
763
|
- **읽기**: 전체 문서 Pull 가능 (오너의 문서도 볼 수 있음)
|
|
760
|
-
- **쓰기**: 자신의 폴더(\`
|
|
764
|
+
- **쓰기**: 자신의 폴더(\`yy_All_Docu/yy_Coworker_{이름}/\`)에만 Push 가능
|
|
761
765
|
- API Key: \`sk_cw_\`로 시작
|
|
762
766
|
- 프로젝트 설정 변경 불가능
|
|
763
767
|
|
|
@@ -766,36 +770,39 @@ z_DocuKing/
|
|
|
766
770
|
2. MCP 설정 (한 번만)
|
|
767
771
|
3. 프로젝트 연결 (\`docuking_init\`)
|
|
768
772
|
4. Pull로 오너의 문서 가져오기 (\`docuking_pull\`)
|
|
769
|
-
5. 내 폴더에 문서 작성 (\`
|
|
773
|
+
5. 내 폴더에 문서 작성 (\`yy_All_Docu/yy_Coworker_{이름}/\`)
|
|
770
774
|
6. Push (\`docuking_push\`)
|
|
771
775
|
|
|
772
|
-
**폴더
|
|
776
|
+
**폴더 구조:**
|
|
773
777
|
\`\`\`
|
|
774
778
|
프로젝트/
|
|
775
|
-
├── src/
|
|
776
|
-
├──
|
|
779
|
+
├── src/ ← 소스 코드 (git 관리)
|
|
780
|
+
├── yy_All_Docu/ ← 동기화 대상 (Push/Pull)
|
|
777
781
|
│ ├── 정책/
|
|
778
|
-
│ │ └── README.md
|
|
779
|
-
│
|
|
780
|
-
│
|
|
781
|
-
└──
|
|
782
|
-
|
|
783
|
-
|
|
782
|
+
│ │ └── README.md ← 오너의 파일 (읽기만 가능)
|
|
783
|
+
│ ├── 기획/
|
|
784
|
+
│ │ └── 요구사항.md ← 오너의 파일 (읽기만 가능)
|
|
785
|
+
│ └── yy_Coworker_김개발/ ← 참여자 "김개발"의 폴더
|
|
786
|
+
│ ├── 제안서.md ← 여기에만 Push 가능
|
|
787
|
+
│ └── 수정안.md ← 여기에만 Push 가능
|
|
788
|
+
├── zz_ai_Talk/ ← AI 대화록 (로컬 전용)
|
|
789
|
+
├── zz_ai_Todo/ ← AI 투두 (로컬 전용)
|
|
790
|
+
└── zzz_ai_Plan/ ← AI 플랜 (로컬 전용)
|
|
784
791
|
\`\`\`
|
|
785
792
|
|
|
786
793
|
**중요 규칙:**
|
|
787
|
-
- 코워커 폴더(\`
|
|
788
|
-
- 참여자는 Pull로
|
|
794
|
+
- 코워커 폴더(\`yy_Coworker_{이름}/\`)는 yy_All_Docu/ 안에 생성됨
|
|
795
|
+
- 참여자는 Pull로 yy_All_Docu/ 폴더의 오너 문서를 볼 수 있음
|
|
789
796
|
- 참여자는 자신의 폴더에만 Push 가능
|
|
790
797
|
- \`docuking_status\`로 현재 권한과 작업 폴더 확인 가능
|
|
791
798
|
|
|
792
799
|
**참여자가 오너의 파일을 수정하고 싶을 때:**
|
|
793
|
-
1. Pull로 오너의 파일을 로컬에 가져옴 (
|
|
800
|
+
1. Pull로 오너의 파일을 로컬에 가져옴 (yy_All_Docu/에 저장됨)
|
|
794
801
|
2. 내용을 참고하여 자신의 폴더에 수정 제안 작성
|
|
795
|
-
- 예: \`
|
|
802
|
+
- 예: \`yy_All_Docu/yy_Coworker_김개발/정책_README_수정제안.md\`로 작성 후 Push
|
|
796
803
|
|
|
797
804
|
**AI가 참여자에게 안내해야 할 내용:**
|
|
798
|
-
- 참여자의 작업 폴더는 \`
|
|
805
|
+
- 참여자의 작업 폴더는 \`yy_All_Docu/yy_Coworker_{이름}/\`
|
|
799
806
|
- 오너의 파일을 직접 수정할 수 없으므로, 제안서 형태로 작성하도록 안내
|
|
800
807
|
|
|
801
808
|
## AI 응답 가이드 (중요!)
|
|
@@ -849,7 +856,7 @@ Push 완료! 총 10개 파일 중 3개 업로드, 6개 스킵(변경 없음), 1
|
|
|
849
856
|
### 핵심 원칙 (AI 행동 지침)
|
|
850
857
|
|
|
851
858
|
1. **프로젝트 = 폴더**: 하나의 폴더가 하나의 프로젝트
|
|
852
|
-
2. **각 폴더마다
|
|
859
|
+
2. **각 폴더마다 yy_All_Docu/ 생성**: 여러 폴더를 각각 연결 가능
|
|
853
860
|
3. **현재 열려있는 폴더 기준**: 명령어는 현재 작업 중인 폴더에 적용
|
|
854
861
|
4. **커밋 메시지 필수**: push 시 반드시 message 파라미터 포함
|
|
855
862
|
5. **변경 없는 파일 자동 스킵**: 해시 비교로 변경 감지, 스킵된 파일은 결과에 명시
|
|
@@ -879,7 +886,7 @@ AI: (결정이 내려졌으므로 docuking_talk 호출)
|
|
|
879
886
|
})
|
|
880
887
|
\`\`\`
|
|
881
888
|
|
|
882
|
-
**저장 위치:** \`
|
|
889
|
+
**저장 위치:** \`zz_ai_Talk/YYYY-MM-DD_HHMM__제목.md\` (플랫 구조, 로컬 전용)
|
|
883
890
|
|
|
884
891
|
### 작업 계획 관리 (docuking_plan, docuking_done)
|
|
885
892
|
|
|
@@ -930,7 +937,7 @@ AI: docuking_done({
|
|
|
930
937
|
})
|
|
931
938
|
\`\`\`
|
|
932
939
|
|
|
933
|
-
**저장 위치:** \`
|
|
940
|
+
**저장 위치:** \`zzz_ai_Plan/YYYY-MM-DD_HHMM__제목__planId.md\` (플랫 구조, 로컬 전용)
|
|
934
941
|
|
|
935
942
|
**핵심 가치:**
|
|
936
943
|
- AI 세션이 끊겨도 (컴팩션, 세션 종료) 다음 AI가 계획 문서를 보고 이어서 작업 가능
|
|
@@ -985,7 +992,7 @@ AI: docuking_done({
|
|
|
985
992
|
2. 프로젝트 ID, 이름, API 키 확인 (사용자가 제공하거나 요청)
|
|
986
993
|
3. \`docuking_init(projectId, projectName, apiKey, localPath)\` 호출
|
|
987
994
|
4. 연결 완료 메시지 전달:
|
|
988
|
-
- "DocuKing 연결 완료! 📁
|
|
995
|
+
- "DocuKing 연결 완료! 📁 yy_All_Docu/ 폴더가 생성되었습니다."
|
|
989
996
|
- "이제 'DocuKing에 올려줘' 명령을 사용할 수 있습니다."
|
|
990
997
|
|
|
991
998
|
**⚠️ 매우 중요:**
|
|
@@ -998,28 +1005,28 @@ AI: docuking_done({
|
|
|
998
1005
|
**핵심 개념:**
|
|
999
1006
|
- **프로젝트 = 하나의 폴더**
|
|
1000
1007
|
- 한 컴퓨터에서 여러 폴더를 각각 다른 DocuKing 프로젝트와 연결 가능
|
|
1001
|
-
- 각 폴더마다 \`
|
|
1008
|
+
- 각 폴더마다 \`yy_All_Docu/\` 폴더가 독립적으로 생성됨
|
|
1002
1009
|
|
|
1003
1010
|
**예시:**
|
|
1004
1011
|
\`\`\`
|
|
1005
1012
|
C:\\Projects\\MyApp\\
|
|
1006
1013
|
├── src/
|
|
1007
1014
|
├── package.json
|
|
1008
|
-
|
|
1015
|
+
├── yy_All_Docu/ ← 프로젝트 A와 연결 (동기화)
|
|
1016
|
+
├── zz_ai_Talk/ ← AI 대화록 (로컬 전용)
|
|
1017
|
+
├── zz_ai_Todo/ ← AI 투두 (로컬 전용)
|
|
1018
|
+
└── zzz_ai_Plan/ ← AI 플랜 (로컬 전용)
|
|
1009
1019
|
|
|
1010
1020
|
C:\\Projects\\MyWebsite\\
|
|
1011
1021
|
├── pages/
|
|
1012
1022
|
├── components/
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
D:\\Work\\ClientProject\\
|
|
1016
|
-
├── docs/
|
|
1017
|
-
└── z_DocuKing/ ← 프로젝트 C와 연결
|
|
1023
|
+
├── yy_All_Docu/ ← 프로젝트 B와 연결
|
|
1024
|
+
└── zz_ai_*/ ← 로컬 전용 폴더들
|
|
1018
1025
|
\`\`\`
|
|
1019
1026
|
|
|
1020
1027
|
**AI가 해야 할 일:**
|
|
1021
1028
|
- 각 폴더에서 \`docuking_init\`을 호출하면 해당 폴더만 연결됨
|
|
1022
|
-
- 다른 폴더로 이동하면 해당 폴더의 \`
|
|
1029
|
+
- 다른 폴더로 이동하면 해당 폴더의 \`yy_All_Docu/\`가 사용됨
|
|
1023
1030
|
- 여러 프로젝트를 동시에 관리할 수 있음을 인지하고, 현재 작업 중인 폴더 기준으로 동작
|
|
1024
1031
|
|
|
1025
1032
|
**고급: DOCUKING_REPOS 환경변수 (선택사항)**
|
|
@@ -1136,12 +1143,21 @@ docuking_init 호출 시 apiKey 파라미터를 포함해주세요.`,
|
|
|
1136
1143
|
fs.mkdirSync(mainFolderPath, { recursive: true });
|
|
1137
1144
|
}
|
|
1138
1145
|
|
|
1146
|
+
// zz_ai_* 폴더도 함께 생성 (로컬 전용)
|
|
1147
|
+
const aiFolders = ['zz_ai_Talk', 'zz_ai_Todo', 'zzz_ai_Plan'];
|
|
1148
|
+
for (const folder of aiFolders) {
|
|
1149
|
+
const folderPath = path.join(localPath, folder);
|
|
1150
|
+
if (!fs.existsSync(folderPath)) {
|
|
1151
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1139
1155
|
let coworkerFolderName = null;
|
|
1140
1156
|
let coworkerFolderPath = null;
|
|
1141
1157
|
|
|
1142
1158
|
if (isCoworker) {
|
|
1143
|
-
// 협업자: yy_All_Docu/
|
|
1144
|
-
coworkerFolderName = `
|
|
1159
|
+
// 협업자: yy_All_Docu/yy_Coworker_{이름}/ 폴더 추가 생성
|
|
1160
|
+
coworkerFolderName = `yy_Coworker_${coworkerName}`;
|
|
1145
1161
|
coworkerFolderPath = path.join(mainFolderPath, coworkerFolderName);
|
|
1146
1162
|
if (!fs.existsSync(coworkerFolderPath)) {
|
|
1147
1163
|
fs.mkdirSync(coworkerFolderPath, { recursive: true });
|
|
@@ -1193,9 +1209,9 @@ docuking_init 호출 시 apiKey 파라미터를 포함해주세요.`,
|
|
|
1193
1209
|
|
|
1194
1210
|
폴더 구조:
|
|
1195
1211
|
- yy_All_Docu/ : 동기화 대상 (킹폴더)
|
|
1196
|
-
-
|
|
1197
|
-
-
|
|
1198
|
-
-
|
|
1212
|
+
- zz_ai_Talk/ : AI 대화록 (로컬 전용, 킹톡)
|
|
1213
|
+
- zz_ai_Todo/ : AI 투두 (로컬 전용, 킹투두)
|
|
1214
|
+
- zzz_ai_Plan/ : AI 플랜 (로컬 전용, 킹플랜)`,
|
|
1199
1215
|
},
|
|
1200
1216
|
],
|
|
1201
1217
|
};
|
|
@@ -1255,15 +1271,15 @@ Git처럼 무엇을 변경했는지 명확히 작성해주세요.
|
|
|
1255
1271
|
const coworkerMatch = apiKey.match(/^sk_[a-f0-9]+_cw_([^_]+)_/);
|
|
1256
1272
|
const isCoworker = !!coworkerMatch;
|
|
1257
1273
|
const coworkerName = coworkerMatch ? coworkerMatch[1] : null;
|
|
1258
|
-
const coworkerFolderName = isCoworker ? `
|
|
1274
|
+
const coworkerFolderName = isCoworker ? `yy_Coworker_${coworkerName}` : null;
|
|
1259
1275
|
|
|
1260
|
-
// 작업 폴더 결정: 모두 yy_All_Docu/ 사용, 협업자는 yy_All_Docu/
|
|
1276
|
+
// 작업 폴더 결정: 모두 yy_All_Docu/ 사용, 협업자는 yy_All_Docu/yy_Coworker_{이름}/ 에서 작업
|
|
1261
1277
|
const mainFolderPath = path.join(localPath, 'yy_All_Docu');
|
|
1262
1278
|
let workingPath;
|
|
1263
1279
|
let serverPathPrefix = ''; // 서버에 저장될 때 경로 접두사
|
|
1264
1280
|
|
|
1265
1281
|
if (isCoworker) {
|
|
1266
|
-
// 협업자: yy_All_Docu/
|
|
1282
|
+
// 협업자: yy_All_Docu/yy_Coworker_{이름}/ 폴더에서 Push
|
|
1267
1283
|
workingPath = path.join(mainFolderPath, coworkerFolderName);
|
|
1268
1284
|
serverPathPrefix = `${coworkerFolderName}/`;
|
|
1269
1285
|
|
|
@@ -1308,13 +1324,14 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1308
1324
|
};
|
|
1309
1325
|
}
|
|
1310
1326
|
|
|
1311
|
-
// 서버 경로: 코워커는
|
|
1327
|
+
// 서버 경로: 코워커는 yy_Coworker_{이름}/파일경로, 오너는 파일경로
|
|
1312
1328
|
const serverFilePath = serverPathPrefix + filePath;
|
|
1313
1329
|
filesToPush.push({ path: filePath, serverPath: serverFilePath, fullPath, fileType });
|
|
1314
1330
|
}
|
|
1315
1331
|
} else {
|
|
1316
|
-
// 전체 파일 - 제외된 파일 목록도 수집
|
|
1317
|
-
|
|
1332
|
+
// 전체 파일 - 제외된 파일 및 대용량 파일 목록도 수집
|
|
1333
|
+
const largeFiles = [];
|
|
1334
|
+
collectFiles(workingPath, '', filesToPush, excludedFiles, largeFiles);
|
|
1318
1335
|
|
|
1319
1336
|
// 서버 경로 추가
|
|
1320
1337
|
for (const file of filesToPush) {
|
|
@@ -1324,6 +1341,15 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1324
1341
|
if (isCoworker) {
|
|
1325
1342
|
console.log(`[DocuKing] 코워커 Push: ${filesToPush.length}개 파일 (${coworkerFolderName}/)`);
|
|
1326
1343
|
}
|
|
1344
|
+
|
|
1345
|
+
// 대용량 파일 경고
|
|
1346
|
+
if (largeFiles.length > 0) {
|
|
1347
|
+
console.error(`\n[DocuKing] ⚠️ 대용량 파일 ${largeFiles.length}개 제외됨 (${MAX_FILE_SIZE_MB}MB 초과):`);
|
|
1348
|
+
for (const f of largeFiles) {
|
|
1349
|
+
console.error(` - ${f.path} (${f.sizeMB}MB)`);
|
|
1350
|
+
}
|
|
1351
|
+
console.error(`💡 대용량 파일은 Google Drive, NAS 등 별도 방법으로 공유하세요.\n`);
|
|
1352
|
+
}
|
|
1327
1353
|
}
|
|
1328
1354
|
|
|
1329
1355
|
if (filesToPush.length === 0) {
|
|
@@ -1337,6 +1363,9 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1337
1363
|
};
|
|
1338
1364
|
}
|
|
1339
1365
|
|
|
1366
|
+
// 총 용량 계산
|
|
1367
|
+
const totalSizeMB = filesToPush.reduce((sum, f) => sum + (f.sizeMB || 0), 0);
|
|
1368
|
+
|
|
1340
1369
|
// 파일 업로드 (진행률 표시)
|
|
1341
1370
|
const results = [];
|
|
1342
1371
|
const total = filesToPush.length;
|
|
@@ -1344,7 +1373,7 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1344
1373
|
let skipped = 0;
|
|
1345
1374
|
|
|
1346
1375
|
// 시작 안내 메시지 출력 (AI가 사용자에게 전달할 수 있도록)
|
|
1347
|
-
console.error(`[DocuKing] Push 시작: ${total}개
|
|
1376
|
+
console.error(`[DocuKing] Push 시작: ${total}개 파일 (총 ${totalSizeMB.toFixed(1)}MB)`);
|
|
1348
1377
|
console.error(`[DocuKing] 💡 실시간 진행상황은 DocuKing 웹(https://docuking.ai)에서 확인하세요`);
|
|
1349
1378
|
|
|
1350
1379
|
// Sync 시작 알림 (웹에서 프로그레스바 표시용)
|
|
@@ -1392,8 +1421,14 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1392
1421
|
for (const file of filesToPush) {
|
|
1393
1422
|
current++;
|
|
1394
1423
|
const progress = `${current}/${total}`;
|
|
1424
|
+
const sizeInfo = file.sizeMB >= 1 ? ` (${file.sizeMB.toFixed(1)}MB)` : '';
|
|
1395
1425
|
processedLocalPaths.add(file.serverPath);
|
|
1396
1426
|
|
|
1427
|
+
// 1MB 이상 파일은 업로드 시작 시 로그 출력 (사용자가 진행 상황 파악 가능)
|
|
1428
|
+
if (file.sizeMB >= 1) {
|
|
1429
|
+
console.error(`[DocuKing] ${progress} 업로드 중: ${file.path}${sizeInfo}`);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1397
1432
|
try {
|
|
1398
1433
|
// 파일 해시 계산 (변경 감지)
|
|
1399
1434
|
let fileHash;
|
|
@@ -1475,7 +1510,7 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1475
1510
|
},
|
|
1476
1511
|
body: JSON.stringify({
|
|
1477
1512
|
projectId,
|
|
1478
|
-
path: file.serverPath, // 서버 경로 (코워커는
|
|
1513
|
+
path: file.serverPath, // 서버 경로 (코워커는 yy_Coworker_{이름}/파일경로)
|
|
1479
1514
|
content,
|
|
1480
1515
|
encoding, // 'utf-8' 또는 'base64'
|
|
1481
1516
|
message, // 커밋 메시지
|
|
@@ -1966,8 +2001,9 @@ function hasAllDocuFolder(projectPath) {
|
|
|
1966
2001
|
|
|
1967
2002
|
// 유틸: 디렉토리 재귀 탐색
|
|
1968
2003
|
// excludedFiles: 제외된 파일 목록을 수집할 배열 (선택)
|
|
2004
|
+
// largeFiles: 대용량 파일 목록을 수집할 배열 (선택)
|
|
1969
2005
|
// zz_* 폴더는 로컬 전용이므로 동기화에서 제외
|
|
1970
|
-
function collectFiles(basePath, relativePath, results, excludedFiles = null) {
|
|
2006
|
+
function collectFiles(basePath, relativePath, results, excludedFiles = null, largeFiles = null) {
|
|
1971
2007
|
const fullPath = path.join(basePath, relativePath);
|
|
1972
2008
|
const entries = fs.readdirSync(fullPath, { withFileTypes: true });
|
|
1973
2009
|
|
|
@@ -1980,7 +2016,7 @@ function collectFiles(basePath, relativePath, results, excludedFiles = null) {
|
|
|
1980
2016
|
console.error(`[DocuKing] 제외됨: ${entryRelPath}/ (zz_* 폴더 - 로컬 전용)`);
|
|
1981
2017
|
continue;
|
|
1982
2018
|
}
|
|
1983
|
-
collectFiles(basePath, entryRelPath, results, excludedFiles);
|
|
2019
|
+
collectFiles(basePath, entryRelPath, results, excludedFiles, largeFiles);
|
|
1984
2020
|
} else if (entry.isFile()) {
|
|
1985
2021
|
const fileType = getFileType(entry.name);
|
|
1986
2022
|
|
|
@@ -1993,10 +2029,25 @@ function collectFiles(basePath, relativePath, results, excludedFiles = null) {
|
|
|
1993
2029
|
continue;
|
|
1994
2030
|
}
|
|
1995
2031
|
|
|
2032
|
+
// 파일 크기 확인
|
|
2033
|
+
const fileFullPath = path.join(fullPath, entry.name);
|
|
2034
|
+
const stats = fs.statSync(fileFullPath);
|
|
2035
|
+
const fileSizeMB = stats.size / (1024 * 1024);
|
|
2036
|
+
|
|
2037
|
+
// 대용량 파일은 별도 추적
|
|
2038
|
+
if (stats.size > MAX_FILE_SIZE_BYTES) {
|
|
2039
|
+
console.error(`[DocuKing] ⚠️ 대용량 파일 제외: ${entryRelPath} (${fileSizeMB.toFixed(1)}MB > ${MAX_FILE_SIZE_MB}MB)`);
|
|
2040
|
+
if (largeFiles) {
|
|
2041
|
+
largeFiles.push({ path: entryRelPath, sizeMB: fileSizeMB.toFixed(1) });
|
|
2042
|
+
}
|
|
2043
|
+
continue;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
1996
2046
|
results.push({
|
|
1997
2047
|
path: entryRelPath,
|
|
1998
|
-
fullPath:
|
|
2048
|
+
fullPath: fileFullPath,
|
|
1999
2049
|
fileType, // 'text' 또는 'binary'
|
|
2050
|
+
sizeMB: fileSizeMB, // 진행률 표시용
|
|
2000
2051
|
});
|
|
2001
2052
|
}
|
|
2002
2053
|
}
|
|
@@ -2057,7 +2108,7 @@ async function handleStatus(args) {
|
|
|
2057
2108
|
const coworkerMatch = apiKey.match(/^sk_[a-f0-9]+_cw_([^_]+)_/);
|
|
2058
2109
|
const isCoworker = !!coworkerMatch;
|
|
2059
2110
|
const coworkerName = coworkerMatch ? coworkerMatch[1] : null;
|
|
2060
|
-
const coworkerFolderName = isCoworker ? `
|
|
2111
|
+
const coworkerFolderName = isCoworker ? `yy_Coworker_${coworkerName}` : null;
|
|
2061
2112
|
|
|
2062
2113
|
// 권한 정보 구성
|
|
2063
2114
|
let permissionInfo = '';
|
|
@@ -2252,8 +2303,8 @@ function generatePlanId() {
|
|
|
2252
2303
|
async function handleTodo(args) {
|
|
2253
2304
|
const { localPath, action, todo, todoId } = args;
|
|
2254
2305
|
|
|
2255
|
-
//
|
|
2256
|
-
const todoBasePath = path.join(localPath, '
|
|
2306
|
+
// zz_ai_Todo 폴더 경로 (로컬 전용, 킹투두)
|
|
2307
|
+
const todoBasePath = path.join(localPath, 'zz_ai_Todo');
|
|
2257
2308
|
const todoFilePath = path.join(todoBasePath, 'z_King_Todo.md');
|
|
2258
2309
|
|
|
2259
2310
|
// 폴더 생성
|
|
@@ -2414,7 +2465,7 @@ async function handleTodo(args) {
|
|
|
2414
2465
|
text: `📋 킹투두 미결: 없음
|
|
2415
2466
|
|
|
2416
2467
|
✅ 완료: ${completedCount}개
|
|
2417
|
-
📁 전체 기록:
|
|
2468
|
+
📁 전체 기록: zz_ai_Todo/z_King_Todo.md`,
|
|
2418
2469
|
}],
|
|
2419
2470
|
};
|
|
2420
2471
|
}
|
|
@@ -2429,7 +2480,7 @@ async function handleTodo(args) {
|
|
|
2429
2480
|
${listText}
|
|
2430
2481
|
|
|
2431
2482
|
✅ 완료: ${completedCount}개
|
|
2432
|
-
📁 전체 기록:
|
|
2483
|
+
📁 전체 기록: zz_ai_Todo/z_King_Todo.md`,
|
|
2433
2484
|
}],
|
|
2434
2485
|
};
|
|
2435
2486
|
}
|
|
@@ -2443,8 +2494,8 @@ ${listText}
|
|
|
2443
2494
|
async function handleTalk(args) {
|
|
2444
2495
|
const { localPath, title, content, tags = [] } = args;
|
|
2445
2496
|
|
|
2446
|
-
//
|
|
2447
|
-
const talkBasePath = path.join(localPath, '
|
|
2497
|
+
// zz_ai_Talk 폴더 경로 (로컬 전용, 킹톡)
|
|
2498
|
+
const talkBasePath = path.join(localPath, 'zz_ai_Talk');
|
|
2448
2499
|
|
|
2449
2500
|
// 날짜 기반 파일명 생성
|
|
2450
2501
|
const { fileName, timestamp } = generateDateFileName(title);
|
|
@@ -2496,8 +2547,8 @@ ${content}
|
|
|
2496
2547
|
async function handlePlan(args) {
|
|
2497
2548
|
const { localPath, planId, title, goal, steps = [], notes } = args;
|
|
2498
2549
|
|
|
2499
|
-
//
|
|
2500
|
-
const planBasePath = path.join(localPath, '
|
|
2550
|
+
// zzz_ai_Plan 폴더 경로 (로컬 전용, 킹플랜)
|
|
2551
|
+
const planBasePath = path.join(localPath, 'zzz_ai_Plan');
|
|
2501
2552
|
|
|
2502
2553
|
// 기존 계획 업데이트 또는 새 계획 생성
|
|
2503
2554
|
let targetPlanId = planId;
|
|
@@ -2646,8 +2697,8 @@ function findPlanFiles(basePath, planId) {
|
|
|
2646
2697
|
async function handleDone(args) {
|
|
2647
2698
|
const { localPath, planId, summary, artifacts = [] } = args;
|
|
2648
2699
|
|
|
2649
|
-
//
|
|
2650
|
-
const planBasePath = path.join(localPath, '
|
|
2700
|
+
// zzz_ai_Plan 폴더 경로 (로컬 전용, 킹플랜)
|
|
2701
|
+
const planBasePath = path.join(localPath, 'zzz_ai_Plan');
|
|
2651
2702
|
|
|
2652
2703
|
// 계획 파일 찾기
|
|
2653
2704
|
const planFiles = findPlanFiles(planBasePath, planId);
|
package/package.json
CHANGED
package/DEPLOY_TASK.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# MCP 패키지 배포 작업지시
|
|
2
|
-
|
|
3
|
-
## 작업 개요
|
|
4
|
-
docurepo-mcp 패키지 v1.0.5를 npm에 배포
|
|
5
|
-
|
|
6
|
-
## 변경 사항
|
|
7
|
-
- Push 시 Sync 상태 API 호출 추가
|
|
8
|
-
- 시작: `POST /projects/:id/sync/start` (totalFiles 전달)
|
|
9
|
-
- 진행: `POST /projects/:id/sync/progress` (5개마다)
|
|
10
|
-
- 완료: `POST /projects/:id/sync/complete`
|
|
11
|
-
|
|
12
|
-
## 배포 절차
|
|
13
|
-
|
|
14
|
-
### 1. npm 로그인 확인
|
|
15
|
-
```bash
|
|
16
|
-
cd c:\2025_Project\docurepo\docurepo-mcp
|
|
17
|
-
npm whoami
|
|
18
|
-
```
|
|
19
|
-
- 로그인 안되어 있으면: `npm login`
|
|
20
|
-
|
|
21
|
-
### 2. 패키지 배포
|
|
22
|
-
```bash
|
|
23
|
-
npm publish
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 3. 배포 확인
|
|
27
|
-
```bash
|
|
28
|
-
npm view docurepo-mcp version
|
|
29
|
-
```
|
|
30
|
-
- 1.0.5가 나오면 성공
|
|
31
|
-
|
|
32
|
-
## 완료 후
|
|
33
|
-
- 사용자가 `npx docurepo-mcp` 재실행하면 새 버전 적용됨
|