docuking-mcp 2.5.7 → 2.8.0

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/lib/utils.js ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * DocuKing MCP - 유틸리티 모듈
3
+ */
4
+
5
+ import fs from 'fs';
6
+ import path from 'path';
7
+
8
+ /**
9
+ * 날짜 기반 파일명 생성
10
+ * @param {string} title - 제목
11
+ * @param {string} prefix - 접두사 ('T' for Talk, 'P' for Plan)
12
+ */
13
+ export function generateDateFileName(title, prefix = '') {
14
+ const now = new Date();
15
+ const year = now.getFullYear();
16
+ const month = String(now.getMonth() + 1).padStart(2, '0');
17
+ const day = String(now.getDate()).padStart(2, '0');
18
+ const hour = String(now.getHours()).padStart(2, '0');
19
+ const minute = String(now.getMinutes()).padStart(2, '0');
20
+
21
+ // 제목에서 파일명으로 사용 가능한 slug 생성
22
+ const slug = title
23
+ .replace(/[^\w\s가-힣-]/g, '') // 특수문자 제거
24
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
25
+ .substring(0, 50); // 50자 제한
26
+
27
+ const prefixStr = prefix ? `${prefix}_` : '';
28
+
29
+ return {
30
+ fileName: `${prefixStr}${year}-${month}-${day}_${hour}${minute}__${slug}.md`,
31
+ yearMonth: `${year}/${month}`,
32
+ timestamp: `${year}-${month}-${day} ${hour}:${minute}`,
33
+ };
34
+ }
35
+
36
+ /**
37
+ * 계획 ID 생성 (8자리 랜덤)
38
+ */
39
+ export function generatePlanId() {
40
+ const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
41
+ let id = '';
42
+ for (let i = 0; i < 8; i++) {
43
+ id += chars.charAt(Math.floor(Math.random() * chars.length));
44
+ }
45
+ return id;
46
+ }
47
+
48
+ /**
49
+ * 계획 파일 찾기 (planId로 검색)
50
+ */
51
+ export function findPlanFiles(basePath, planId) {
52
+ const planDir = path.join(basePath, 'zz_ai_3_Plan');
53
+ if (!fs.existsSync(planDir)) return [];
54
+
55
+ const results = [];
56
+
57
+ function searchDir(dirPath) {
58
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
59
+ for (const entry of entries) {
60
+ const fullPath = path.join(dirPath, entry.name);
61
+ if (entry.isDirectory()) {
62
+ searchDir(fullPath);
63
+ } else if (entry.isFile() && entry.name.endsWith('.md')) {
64
+ // 파일명에 planId가 포함되어 있으면 매치
65
+ if (entry.name.includes(planId)) {
66
+ results.push(fullPath);
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ searchDir(planDir);
73
+ return results;
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docuking-mcp",
3
- "version": "2.5.7",
3
+ "version": "2.8.0",
4
4
  "description": "DocuKing MCP Server - AI 시대의 문서 협업 플랫폼",
5
5
  "type": "module",
6
6
  "main": "index.js",