@dod/planax-mcp 0.2.0 → 0.3.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/README.md +3 -2
- package/dist/tools/document.tools.js +46 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ env = { PLANAX_ACCESS_TOKEN = "your_token_here" }
|
|
|
132
132
|
</details>
|
|
133
133
|
|
|
134
134
|
<details>
|
|
135
|
-
<summary><b>Document</b> (
|
|
135
|
+
<summary><b>Document</b> (20)</summary>
|
|
136
136
|
|
|
137
137
|
- `document_list` - 프로젝트의 문서 목록 (상태 · 종류 · 담당자 · 마감일 · 루트만 등 필터)
|
|
138
138
|
- `document_get` - 문서 상세 정보
|
|
@@ -152,7 +152,8 @@ env = { PLANAX_ACCESS_TOKEN = "your_token_here" }
|
|
|
152
152
|
- `document_restore` - 휴지통의 문서 복원
|
|
153
153
|
- `document_get_versions` - 문서 버전 이력 조회 (서명 상태 · 유효기간 포함)
|
|
154
154
|
- `document_update_version_validity` - 문서 버전의 유효기간(시작일 · 종료일 · 다음 검토일) 설정
|
|
155
|
-
- `document_get_download_url` - 파일 문서의 내려받기 · 미리보기 주소 (현재 또는 특정 버전)
|
|
155
|
+
- `document_get_download_url` - 파일 문서의 내려받기 · 미리보기 주소 (현재 또는 특정 버전) — 원본 파일
|
|
156
|
+
- `document_get_signed_download_url` - 서명본 PDF(서명 · 감사 기록 페이지 포함) 내려받기 주소 (특정 버전 또는 최신 버전)
|
|
156
157
|
|
|
157
158
|
</details>
|
|
158
159
|
|
|
@@ -470,7 +470,8 @@ Each row:
|
|
|
470
470
|
- versionSignatureStatus, requiredSignatureCount, signedRequiredSignatureCount, signedDocumentStatus, signedDocumentId
|
|
471
471
|
- validity { effectiveDate, effectiveEndDate, nextReviewDate, validityStatus: NONE | SCHEDULED | ACTIVE | EXPIRED, validityDays } (workspace timezone)
|
|
472
472
|
|
|
473
|
-
content (markdown body of each version) and signedUrl (download URL) are left out unless includeContent: true, because they make the response very large
|
|
473
|
+
content (markdown body of each version) and signedUrl (download URL) are left out unless includeContent: true, because they make the response very large.
|
|
474
|
+
To download the signed PDF of a version use document_get_signed_download_url with its signedDocumentId.`,
|
|
474
475
|
inputSchema: {
|
|
475
476
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
476
477
|
documentId: z.string().uuid().describe('Document ID (UUID)'),
|
|
@@ -974,6 +975,7 @@ Status in responses: NONE (no period), SCHEDULED (before start), ACTIVE, EXPIRED
|
|
|
974
975
|
**When to use:**
|
|
975
976
|
- Read or download the file of a document (current version, or a specific version from document_get_versions)
|
|
976
977
|
- MARKDOWN documents: use document_get_markdown_content instead
|
|
978
|
+
- This returns the ORIGINAL file. For the signed PDF use document_get_signed_download_url
|
|
977
979
|
|
|
978
980
|
**Examples:**
|
|
979
981
|
1. Current version: { projectId: "...", documentId: "..." }
|
|
@@ -1001,4 +1003,47 @@ Status in responses: NONE (no period), SCHEDULED (before start), ACTIVE, EXPIRED
|
|
|
1001
1003
|
return errorResponse(error);
|
|
1002
1004
|
}
|
|
1003
1005
|
});
|
|
1006
|
+
// ===== Signed PDF Download URL =====
|
|
1007
|
+
server.registerTool('document_get_signed_download_url', {
|
|
1008
|
+
description: `Get a temporary download URL for a SIGNED PDF (the PDF with signatures and the audit log page), not the original file.
|
|
1009
|
+
|
|
1010
|
+
**When to use:**
|
|
1011
|
+
- Download the signed PDF of a document after its signature process completed
|
|
1012
|
+
- document_get_download_url returns the ORIGINAL file; use this tool for the signed one
|
|
1013
|
+
|
|
1014
|
+
**Flow:** document_list -> document_get_versions -> pick a row whose signedDocumentStatus is COMPLETED and use its signedDocumentId -> this tool.
|
|
1015
|
+
Omit signedDocumentId to get the signed PDF of the current (latest) version.
|
|
1016
|
+
|
|
1017
|
+
**Examples:**
|
|
1018
|
+
1. Signed PDF of a specific version: { projectId: "...", documentId: "...", signedDocumentId: "..." }
|
|
1019
|
+
2. Signed PDF of the current version: { projectId: "...", documentId: "..." }
|
|
1020
|
+
|
|
1021
|
+
**Errors:** 404 when that version has no completed signed PDF yet (signedDocumentStatus NONE / GENERATING / FAILED).
|
|
1022
|
+
|
|
1023
|
+
**Returns:** { url, fileName, fileSize, expiresIn } — the URL expires after expiresIn seconds (1 hour). fileName and fileSize are only known when signedDocumentId is given.`,
|
|
1024
|
+
inputSchema: {
|
|
1025
|
+
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
1026
|
+
documentId: z.string().uuid().describe('Document ID (UUID)'),
|
|
1027
|
+
signedDocumentId: z
|
|
1028
|
+
.string()
|
|
1029
|
+
.uuid()
|
|
1030
|
+
.optional()
|
|
1031
|
+
.describe('signedDocumentId from a document_get_versions row (COMPLETED); omit for the current version'),
|
|
1032
|
+
},
|
|
1033
|
+
}, async ({ projectId, documentId, signedDocumentId }) => {
|
|
1034
|
+
try {
|
|
1035
|
+
const base = `/projects/${projectId}/documents/${documentId}`;
|
|
1036
|
+
if (signedDocumentId) {
|
|
1037
|
+
// 응답: { downloadUrl, expiresIn, fileName, fileSize }
|
|
1038
|
+
const r = await apiClient.get(`${base}/signed-versions/${signedDocumentId}/download`);
|
|
1039
|
+
return successResponse({ url: r?.downloadUrl, fileName: r?.fileName, fileSize: r?.fileSize, expiresIn: r?.expiresIn });
|
|
1040
|
+
}
|
|
1041
|
+
// 응답: { url } — 최신 버전에서 완료된 서명 절차의 서명본
|
|
1042
|
+
const r = await apiClient.get(`${base}/signed-pdf-url`);
|
|
1043
|
+
return successResponse({ url: r?.url, fileName: null, fileSize: null, expiresIn: 3600 });
|
|
1044
|
+
}
|
|
1045
|
+
catch (error) {
|
|
1046
|
+
return errorResponse(error);
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1004
1049
|
}
|