docuking-mcp 1.2.3 → 1.2.4
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 +75 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1082,16 +1082,47 @@ docuking_init을 먼저 실행하세요.`,
|
|
|
1082
1082
|
filesToPush.push({ path: filePath, serverPath: serverFilePath, fullPath, fileType });
|
|
1083
1083
|
}
|
|
1084
1084
|
} else {
|
|
1085
|
-
// 전체 파일 - 제외된 파일 목록도 수집
|
|
1086
|
-
collectFiles(workingPath, '', filesToPush, excludedFiles);
|
|
1087
|
-
|
|
1088
|
-
// 서버 경로 추가
|
|
1089
|
-
for (const file of filesToPush) {
|
|
1090
|
-
file.serverPath = serverPathPrefix + file.path;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
1085
|
if (isCoworker) {
|
|
1086
|
+
// 코워커: 본인 폴더만 수집
|
|
1087
|
+
collectFiles(workingPath, '', filesToPush, excludedFiles);
|
|
1088
|
+
|
|
1089
|
+
// 서버 경로 추가
|
|
1090
|
+
for (const file of filesToPush) {
|
|
1091
|
+
file.serverPath = serverPathPrefix + file.path;
|
|
1092
|
+
}
|
|
1094
1093
|
console.log(`[DocuKing] 코워커 Push: ${filesToPush.length}개 파일 (${coworkerFolderName}/)`);
|
|
1094
|
+
} else {
|
|
1095
|
+
// 오너: z_DocuKing/ + 모든 zz_Coworker_*/ 폴더 수집
|
|
1096
|
+
const docuKingFolderName = findDocuKingFolder(localPath);
|
|
1097
|
+
|
|
1098
|
+
// 1. z_DocuKing/ 폴더 수집
|
|
1099
|
+
if (docuKingFolderName) {
|
|
1100
|
+
const docuKingPath = path.join(localPath, docuKingFolderName);
|
|
1101
|
+
const docuKingFiles = [];
|
|
1102
|
+
collectFiles(docuKingPath, '', docuKingFiles, excludedFiles);
|
|
1103
|
+
|
|
1104
|
+
for (const file of docuKingFiles) {
|
|
1105
|
+
file.serverPath = file.path; // 오너 폴더는 서버 경로 = 파일 경로
|
|
1106
|
+
filesToPush.push(file);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// 2. 모든 zz_Coworker_*/ 폴더 수집
|
|
1111
|
+
const coworkerFolders = findCoworkerFolders(localPath);
|
|
1112
|
+
for (const cwFolder of coworkerFolders) {
|
|
1113
|
+
const cwPath = path.join(localPath, cwFolder);
|
|
1114
|
+
const cwFiles = [];
|
|
1115
|
+
collectFiles(cwPath, '', cwFiles, excludedFiles);
|
|
1116
|
+
|
|
1117
|
+
for (const file of cwFiles) {
|
|
1118
|
+
file.serverPath = `${cwFolder}/${file.path}`; // 코워커 폴더명 포함
|
|
1119
|
+
file.path = `${cwFolder}/${file.path}`; // 로컬 경로도 폴더명 포함
|
|
1120
|
+
file.fullPath = path.join(cwPath, file.path.replace(`${cwFolder}/`, ''));
|
|
1121
|
+
filesToPush.push(file);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
console.log(`[DocuKing] 오너 Push: ${filesToPush.length}개 파일 (z_DocuKing/ + ${coworkerFolders.length}개 코워커 폴더)`);
|
|
1095
1126
|
}
|
|
1096
1127
|
}
|
|
1097
1128
|
|
|
@@ -1612,10 +1643,29 @@ function getFileType(fileName) {
|
|
|
1612
1643
|
return 'binary';
|
|
1613
1644
|
}
|
|
1614
1645
|
|
|
1615
|
-
// 유틸: DocuKing 폴더 찾기
|
|
1646
|
+
// 유틸: DocuKing 폴더 찾기
|
|
1647
|
+
// 우선순위: z_DocuKing > Z_DocuKing > 기타 docuking 포함 폴더
|
|
1616
1648
|
function findDocuKingFolder(projectPath) {
|
|
1617
1649
|
try {
|
|
1618
1650
|
const entries = fs.readdirSync(projectPath, { withFileTypes: true });
|
|
1651
|
+
|
|
1652
|
+
// 1순위: z_DocuKing 또는 Z_DocuKing (정확한 이름)
|
|
1653
|
+
for (const entry of entries) {
|
|
1654
|
+
if (entry.isDirectory() && (entry.name === 'z_DocuKing' || entry.name === 'Z_DocuKing')) {
|
|
1655
|
+
return entry.name;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// 2순위: z_ 또는 Z_로 시작하고 docuking 포함
|
|
1660
|
+
for (const entry of entries) {
|
|
1661
|
+
if (entry.isDirectory() &&
|
|
1662
|
+
(entry.name.startsWith('z_') || entry.name.startsWith('Z_')) &&
|
|
1663
|
+
entry.name.toLowerCase().includes('docuking')) {
|
|
1664
|
+
return entry.name;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
// 3순위: docuking 포함하는 아무 폴더 (하위 호환)
|
|
1619
1669
|
for (const entry of entries) {
|
|
1620
1670
|
if (entry.isDirectory() && entry.name.toLowerCase().includes('docuking')) {
|
|
1621
1671
|
return entry.name;
|
|
@@ -1627,6 +1677,22 @@ function findDocuKingFolder(projectPath) {
|
|
|
1627
1677
|
return null;
|
|
1628
1678
|
}
|
|
1629
1679
|
|
|
1680
|
+
// 유틸: 모든 zz_Coworker_* 폴더 찾기
|
|
1681
|
+
function findCoworkerFolders(projectPath) {
|
|
1682
|
+
const folders = [];
|
|
1683
|
+
try {
|
|
1684
|
+
const entries = fs.readdirSync(projectPath, { withFileTypes: true });
|
|
1685
|
+
for (const entry of entries) {
|
|
1686
|
+
if (entry.isDirectory() && entry.name.startsWith('zz_Coworker_')) {
|
|
1687
|
+
folders.push(entry.name);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
} catch (e) {
|
|
1691
|
+
// 디렉토리 읽기 실패
|
|
1692
|
+
}
|
|
1693
|
+
return folders;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1630
1696
|
// 유틸: 디렉토리 재귀 탐색
|
|
1631
1697
|
// excludedFiles: 제외된 파일 목록을 수집할 배열 (선택)
|
|
1632
1698
|
function collectFiles(basePath, relativePath, results, excludedFiles = null) {
|