wps-multitool-mcp 0.0.0-stage → 1.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 +3 -3
- package/dist/bridge/cancellable.d.ts +36 -0
- package/dist/bridge/cancellable.d.ts.map +1 -0
- package/dist/bridge/cancellable.js +155 -0
- package/dist/bridge/cancellable.js.map +1 -0
- package/dist/bridge/index.d.ts +37 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +383 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/ps-child.d.ts +155 -0
- package/dist/bridge/ps-child.d.ts.map +1 -0
- package/dist/bridge/ps-child.js +578 -0
- package/dist/bridge/ps-child.js.map +1 -0
- package/dist/cli/install.d.ts +58 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +301 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/client/action-routes.d.ts +32 -0
- package/dist/client/action-routes.d.ts.map +1 -0
- package/dist/client/action-routes.generated.d.ts +10 -0
- package/dist/client/action-routes.generated.d.ts.map +1 -0
- package/dist/client/action-routes.generated.js +327 -0
- package/dist/client/action-routes.generated.js.map +1 -0
- package/dist/client/action-routes.js +57 -0
- package/dist/client/action-routes.js.map +1 -0
- package/dist/client/ps-daemon.d.ts +95 -0
- package/dist/client/ps-daemon.d.ts.map +1 -0
- package/dist/client/ps-daemon.js +424 -0
- package/dist/client/ps-daemon.js.map +1 -0
- package/dist/client/wps-client.d.ts +69 -0
- package/dist/client/wps-client.d.ts.map +1 -0
- package/dist/client/wps-client.js +442 -0
- package/dist/client/wps-client.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +173 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime-identity.d.ts +23 -0
- package/dist/runtime-identity.d.ts.map +1 -0
- package/dist/runtime-identity.js +26 -0
- package/dist/runtime-identity.js.map +1 -0
- package/dist/server/auto-snapshot.d.ts +58 -0
- package/dist/server/auto-snapshot.d.ts.map +1 -0
- package/dist/server/auto-snapshot.js +150 -0
- package/dist/server/auto-snapshot.js.map +1 -0
- package/dist/server/cancel-context.d.ts +30 -0
- package/dist/server/cancel-context.d.ts.map +1 -0
- package/dist/server/cancel-context.js +38 -0
- package/dist/server/cancel-context.js.map +1 -0
- package/dist/server/mcp-server.d.ts +74 -0
- package/dist/server/mcp-server.d.ts.map +1 -0
- package/dist/server/mcp-server.js +592 -0
- package/dist/server/mcp-server.js.map +1 -0
- package/dist/server/server-info.d.ts +21 -0
- package/dist/server/server-info.d.ts.map +1 -0
- package/dist/server/server-info.js +56 -0
- package/dist/server/server-info.js.map +1 -0
- package/dist/server/tool-aliases.generated.d.ts +41 -0
- package/dist/server/tool-aliases.generated.d.ts.map +1 -0
- package/dist/server/tool-aliases.generated.js +88 -0
- package/dist/server/tool-aliases.generated.js.map +1 -0
- package/dist/server/tool-annotations.d.ts +55 -0
- package/dist/server/tool-annotations.d.ts.map +1 -0
- package/dist/server/tool-annotations.generated.d.ts +14 -0
- package/dist/server/tool-annotations.generated.d.ts.map +1 -0
- package/dist/server/tool-annotations.generated.js +302 -0
- package/dist/server/tool-annotations.generated.js.map +1 -0
- package/dist/server/tool-annotations.js +192 -0
- package/dist/server/tool-annotations.js.map +1 -0
- package/dist/server/tool-group-events.d.ts +23 -0
- package/dist/server/tool-group-events.d.ts.map +1 -0
- package/dist/server/tool-group-events.js +44 -0
- package/dist/server/tool-group-events.js.map +1 -0
- package/dist/server/tool-metadata.d.ts +68 -0
- package/dist/server/tool-metadata.d.ts.map +1 -0
- package/dist/server/tool-metadata.js +834 -0
- package/dist/server/tool-metadata.js.map +1 -0
- package/dist/server/tool-registry.d.ts +186 -0
- package/dist/server/tool-registry.d.ts.map +1 -0
- package/dist/server/tool-registry.js +615 -0
- package/dist/server/tool-registry.js.map +1 -0
- package/dist/server/tool-tiers.d.ts +58 -0
- package/dist/server/tool-tiers.d.ts.map +1 -0
- package/dist/server/tool-tiers.js +128 -0
- package/dist/server/tool-tiers.js.map +1 -0
- package/dist/server/tool-verification.d.ts +35 -0
- package/dist/server/tool-verification.d.ts.map +1 -0
- package/dist/server/tool-verification.generated.d.ts +17 -0
- package/dist/server/tool-verification.generated.d.ts.map +1 -0
- package/dist/server/tool-verification.generated.js +293 -0
- package/dist/server/tool-verification.generated.js.map +1 -0
- package/dist/server/tool-verification.js +43 -0
- package/dist/server/tool-verification.js.map +1 -0
- package/dist/tools/common/batch.d.ts +33 -0
- package/dist/tools/common/batch.d.ts.map +1 -0
- package/dist/tools/common/batch.js +273 -0
- package/dist/tools/common/batch.js.map +1 -0
- package/dist/tools/common/convert.d.ts +41 -0
- package/dist/tools/common/convert.d.ts.map +1 -0
- package/dist/tools/common/convert.js +299 -0
- package/dist/tools/common/convert.js.map +1 -0
- package/dist/tools/common/general.d.ts +36 -0
- package/dist/tools/common/general.d.ts.map +1 -0
- package/dist/tools/common/general.js +582 -0
- package/dist/tools/common/general.js.map +1 -0
- package/dist/tools/common/index.d.ts +38 -0
- package/dist/tools/common/index.d.ts.map +1 -0
- package/dist/tools/common/index.js +116 -0
- package/dist/tools/common/index.js.map +1 -0
- package/dist/tools/common/intent.d.ts +48 -0
- package/dist/tools/common/intent.d.ts.map +1 -0
- package/dist/tools/common/intent.js +221 -0
- package/dist/tools/common/intent.js.map +1 -0
- package/dist/tools/common/repair.d.ts +29 -0
- package/dist/tools/common/repair.d.ts.map +1 -0
- package/dist/tools/common/repair.js +140 -0
- package/dist/tools/common/repair.js.map +1 -0
- package/dist/tools/common/snapshot.d.ts +77 -0
- package/dist/tools/common/snapshot.d.ts.map +1 -0
- package/dist/tools/common/snapshot.js +497 -0
- package/dist/tools/common/snapshot.js.map +1 -0
- package/dist/tools/common/status.d.ts +27 -0
- package/dist/tools/common/status.d.ts.map +1 -0
- package/dist/tools/common/status.js +139 -0
- package/dist/tools/common/status.js.map +1 -0
- package/dist/tools/common/toolgroups.d.ts +38 -0
- package/dist/tools/common/toolgroups.d.ts.map +1 -0
- package/dist/tools/common/toolgroups.js +254 -0
- package/dist/tools/common/toolgroups.js.map +1 -0
- package/dist/tools/excel/chart.d.ts +86 -0
- package/dist/tools/excel/chart.d.ts.map +1 -0
- package/dist/tools/excel/chart.js +659 -0
- package/dist/tools/excel/chart.js.map +1 -0
- package/dist/tools/excel/comment-protect.d.ts +58 -0
- package/dist/tools/excel/comment-protect.d.ts.map +1 -0
- package/dist/tools/excel/comment-protect.js +274 -0
- package/dist/tools/excel/comment-protect.js.map +1 -0
- package/dist/tools/excel/data-advanced.d.ts +47 -0
- package/dist/tools/excel/data-advanced.d.ts.map +1 -0
- package/dist/tools/excel/data-advanced.js +263 -0
- package/dist/tools/excel/data-advanced.js.map +1 -0
- package/dist/tools/excel/data.d.ts +86 -0
- package/dist/tools/excel/data.d.ts.map +1 -0
- package/dist/tools/excel/data.js +606 -0
- package/dist/tools/excel/data.js.map +1 -0
- package/dist/tools/excel/format.d.ts +42 -0
- package/dist/tools/excel/format.d.ts.map +1 -0
- package/dist/tools/excel/format.js +717 -0
- package/dist/tools/excel/format.js.map +1 -0
- package/dist/tools/excel/formula.d.ts +55 -0
- package/dist/tools/excel/formula.d.ts.map +1 -0
- package/dist/tools/excel/formula.js +316 -0
- package/dist/tools/excel/formula.js.map +1 -0
- package/dist/tools/excel/index.d.ts +44 -0
- package/dist/tools/excel/index.d.ts.map +1 -0
- package/dist/tools/excel/index.js +241 -0
- package/dist/tools/excel/index.js.map +1 -0
- package/dist/tools/excel/pivot.d.ts +39 -0
- package/dist/tools/excel/pivot.d.ts.map +1 -0
- package/dist/tools/excel/pivot.js +455 -0
- package/dist/tools/excel/pivot.js.map +1 -0
- package/dist/tools/excel/row-column.d.ts +64 -0
- package/dist/tools/excel/row-column.d.ts.map +1 -0
- package/dist/tools/excel/row-column.js +299 -0
- package/dist/tools/excel/row-column.js.map +1 -0
- package/dist/tools/excel/sheet-gaps.d.ts +50 -0
- package/dist/tools/excel/sheet-gaps.d.ts.map +1 -0
- package/dist/tools/excel/sheet-gaps.js +373 -0
- package/dist/tools/excel/sheet-gaps.js.map +1 -0
- package/dist/tools/excel/sheet.d.ts +102 -0
- package/dist/tools/excel/sheet.d.ts.map +1 -0
- package/dist/tools/excel/sheet.js +827 -0
- package/dist/tools/excel/sheet.js.map +1 -0
- package/dist/tools/excel/workbook.d.ts +62 -0
- package/dist/tools/excel/workbook.d.ts.map +1 -0
- package/dist/tools/excel/workbook.js +371 -0
- package/dist/tools/excel/workbook.js.map +1 -0
- package/dist/tools/index.d.ts +48 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +113 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/ppt/animation.d.ts +36 -0
- package/dist/tools/ppt/animation.d.ts.map +1 -0
- package/dist/tools/ppt/animation.js +190 -0
- package/dist/tools/ppt/animation.js.map +1 -0
- package/dist/tools/ppt/background.d.ts +54 -0
- package/dist/tools/ppt/background.d.ts.map +1 -0
- package/dist/tools/ppt/background.js +389 -0
- package/dist/tools/ppt/background.js.map +1 -0
- package/dist/tools/ppt/beautify-advanced.d.ts +66 -0
- package/dist/tools/ppt/beautify-advanced.d.ts.map +1 -0
- package/dist/tools/ppt/beautify-advanced.js +600 -0
- package/dist/tools/ppt/beautify-advanced.js.map +1 -0
- package/dist/tools/ppt/chart-flow.d.ts +58 -0
- package/dist/tools/ppt/chart-flow.d.ts.map +1 -0
- package/dist/tools/ppt/chart-flow.js +523 -0
- package/dist/tools/ppt/chart-flow.js.map +1 -0
- package/dist/tools/ppt/data-viz.d.ts +64 -0
- package/dist/tools/ppt/data-viz.d.ts.map +1 -0
- package/dist/tools/ppt/data-viz.js +514 -0
- package/dist/tools/ppt/data-viz.js.map +1 -0
- package/dist/tools/ppt/image.d.ts +30 -0
- package/dist/tools/ppt/image.d.ts.map +1 -0
- package/dist/tools/ppt/image.js +447 -0
- package/dist/tools/ppt/image.js.map +1 -0
- package/dist/tools/ppt/index.d.ts +72 -0
- package/dist/tools/ppt/index.d.ts.map +1 -0
- package/dist/tools/ppt/index.js +320 -0
- package/dist/tools/ppt/index.js.map +1 -0
- package/dist/tools/ppt/misc.d.ts +93 -0
- package/dist/tools/ppt/misc.d.ts.map +1 -0
- package/dist/tools/ppt/misc.js +817 -0
- package/dist/tools/ppt/misc.js.map +1 -0
- package/dist/tools/ppt/presentation.d.ts +72 -0
- package/dist/tools/ppt/presentation.d.ts.map +1 -0
- package/dist/tools/ppt/presentation.js +694 -0
- package/dist/tools/ppt/presentation.js.map +1 -0
- package/dist/tools/ppt/shape-basic.d.ts +46 -0
- package/dist/tools/ppt/shape-basic.d.ts.map +1 -0
- package/dist/tools/ppt/shape-basic.js +756 -0
- package/dist/tools/ppt/shape-basic.js.map +1 -0
- package/dist/tools/ppt/slide-ops.d.ts +73 -0
- package/dist/tools/ppt/slide-ops.d.ts.map +1 -0
- package/dist/tools/ppt/slide-ops.js +1740 -0
- package/dist/tools/ppt/slide-ops.js.map +1 -0
- package/dist/tools/ppt/slide.d.ts +51 -0
- package/dist/tools/ppt/slide.d.ts.map +1 -0
- package/dist/tools/ppt/slide.js +484 -0
- package/dist/tools/ppt/slide.js.map +1 -0
- package/dist/tools/ppt/table.d.ts +58 -0
- package/dist/tools/ppt/table.d.ts.map +1 -0
- package/dist/tools/ppt/table.js +514 -0
- package/dist/tools/ppt/table.js.map +1 -0
- package/dist/tools/ppt/textbox.d.ts +47 -0
- package/dist/tools/ppt/textbox.d.ts.map +1 -0
- package/dist/tools/ppt/textbox.js +249 -0
- package/dist/tools/ppt/textbox.js.map +1 -0
- package/dist/tools/word/academic.d.ts +50 -0
- package/dist/tools/word/academic.d.ts.map +1 -0
- package/dist/tools/word/academic.js +500 -0
- package/dist/tools/word/academic.js.map +1 -0
- package/dist/tools/word/content.d.ts +97 -0
- package/dist/tools/word/content.d.ts.map +1 -0
- package/dist/tools/word/content.js +843 -0
- package/dist/tools/word/content.js.map +1 -0
- package/dist/tools/word/document.d.ts +65 -0
- package/dist/tools/word/document.d.ts.map +1 -0
- package/dist/tools/word/document.js +576 -0
- package/dist/tools/word/document.js.map +1 -0
- package/dist/tools/word/format.d.ts +50 -0
- package/dist/tools/word/format.d.ts.map +1 -0
- package/dist/tools/word/format.js +462 -0
- package/dist/tools/word/format.js.map +1 -0
- package/dist/tools/word/gaps.d.ts +58 -0
- package/dist/tools/word/gaps.d.ts.map +1 -0
- package/dist/tools/word/gaps.js +431 -0
- package/dist/tools/word/gaps.js.map +1 -0
- package/dist/tools/word/index.d.ts +34 -0
- package/dist/tools/word/index.d.ts.map +1 -0
- package/dist/tools/word/index.js +122 -0
- package/dist/tools/word/index.js.map +1 -0
- package/dist/tools/word/professional.d.ts +48 -0
- package/dist/tools/word/professional.d.ts.map +1 -0
- package/dist/tools/word/professional.js +657 -0
- package/dist/tools/word/professional.js.map +1 -0
- package/dist/tools/word/proofread.d.ts +25 -0
- package/dist/tools/word/proofread.d.ts.map +1 -0
- package/dist/tools/word/proofread.js +718 -0
- package/dist/tools/word/proofread.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/tools.d.ts +174 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +45 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/wps.d.ts +190 -0
- package/dist/types/wps.d.ts.map +1 -0
- package/dist/types/wps.js +23 -0
- package/dist/types/wps.js.map +1 -0
- package/dist/utils/error.d.ts +147 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +417 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/logger.d.ts +56 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +155 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/version.d.ts +22 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +101 -0
- package/dist/version.js.map +1 -0
- package/package.json +66 -6
- package/scripts/wps-com.ps1 +8255 -0
- package/scripts/wps-comd.ps1 +123 -0
- package/skills/wps-multitool/SKILL.md +129 -0
- package/skills/wps-multitool/references/errors.md +62 -0
- package/skills/wps-multitool/references/recipes.md +83 -0
- package/skills/wps-multitool/references/routing.md +88 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Input: 文档管理工具参数
|
|
4
|
+
* Output: 文档操作结果
|
|
5
|
+
* Pos: Word 文档管理工具实现。一旦我被修改,请更新我的头部注释,以及所属文件夹的md。
|
|
6
|
+
* Word文档管理Tools
|
|
7
|
+
* 处理文档的打开、切换、获取列表等管理操作
|
|
8
|
+
*
|
|
9
|
+
* 包含:
|
|
10
|
+
* - wps_word_get_open_documents: 获取所有已打开的文档列表
|
|
11
|
+
* - wps_word_switch_document: 切换到指定文档
|
|
12
|
+
* - wps_word_open_document: 打开指定路径的文档
|
|
13
|
+
* - wps_word_get_document_text: 获取文档文本内容
|
|
14
|
+
* - wps_word_insert_header: 设置页眉内容
|
|
15
|
+
* - wps_word_insert_footer: 设置页脚内容
|
|
16
|
+
* - wps_word_generate_doc_toc: 自动生成文档目录
|
|
17
|
+
* - wps_word_insert_section_break: 插入分节符
|
|
18
|
+
* - wps_word_set_line_spacing: 设置行距
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.documentTools = exports.setLineSpacingHandler = exports.setLineSpacingDefinition = exports.insertSectionBreakHandler = exports.insertSectionBreakDefinition = exports.insertFooterHandler = exports.insertFooterDefinition = exports.insertHeaderHandler = exports.insertHeaderDefinition = exports.getDocumentTextHandler = exports.getDocumentTextDefinition = exports.openDocumentHandler = exports.openDocumentDefinition = exports.switchDocumentHandler = exports.switchDocumentDefinition = exports.getOpenDocumentsHandler = exports.getOpenDocumentsDefinition = void 0;
|
|
22
|
+
const uuid_1 = require("uuid");
|
|
23
|
+
const tools_1 = require("../../types/tools");
|
|
24
|
+
const wps_client_1 = require("../../client/wps-client");
|
|
25
|
+
const wps_1 = require("../../types/wps");
|
|
26
|
+
/**
|
|
27
|
+
* 获取所有已打开的文档列表
|
|
28
|
+
*/
|
|
29
|
+
exports.getOpenDocumentsDefinition = {
|
|
30
|
+
name: 'wps_word_get_open_documents',
|
|
31
|
+
description: `获取当前WPS Writer中所有已打开的文档列表。
|
|
32
|
+
|
|
33
|
+
使用场景:
|
|
34
|
+
- "看看现在打开了哪些文档"
|
|
35
|
+
- "列出所有打开的Word文件"
|
|
36
|
+
- "查看当前文档列表"`,
|
|
37
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const getOpenDocumentsHandler = async (_args) => {
|
|
44
|
+
try {
|
|
45
|
+
const response = await wps_client_1.wpsClient.executeMethod('getOpenDocuments', {}, wps_1.WpsAppType.WRITER);
|
|
46
|
+
if (response.success && response.data) {
|
|
47
|
+
const docs = response.data.documents;
|
|
48
|
+
if (!docs || docs.length === 0) {
|
|
49
|
+
return {
|
|
50
|
+
id: (0, uuid_1.v4)(),
|
|
51
|
+
success: true,
|
|
52
|
+
content: [{ type: 'text', text: '当前没有打开任何文档' }],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const docList = docs
|
|
56
|
+
.map((doc, i) => `${i + 1}. ${doc.name}${doc.active ? ' (当前活动)' : ''}\n 路径: ${doc.path}`)
|
|
57
|
+
.join('\n');
|
|
58
|
+
return {
|
|
59
|
+
id: (0, uuid_1.v4)(),
|
|
60
|
+
success: true,
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: 'text',
|
|
64
|
+
text: `已打开的文档列表 (共${docs.length}个):\n${docList}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return {
|
|
71
|
+
id: (0, uuid_1.v4)(),
|
|
72
|
+
success: false,
|
|
73
|
+
content: [{ type: 'text', text: `获取文档列表失败: ${response.error}` }],
|
|
74
|
+
error: response.error,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
80
|
+
return {
|
|
81
|
+
id: (0, uuid_1.v4)(),
|
|
82
|
+
success: false,
|
|
83
|
+
content: [{ type: 'text', text: `获取文档列表出错: ${errMsg}` }],
|
|
84
|
+
error: errMsg,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.getOpenDocumentsHandler = getOpenDocumentsHandler;
|
|
89
|
+
/**
|
|
90
|
+
* 切换到指定文档
|
|
91
|
+
*/
|
|
92
|
+
exports.switchDocumentDefinition = {
|
|
93
|
+
name: 'wps_word_switch_document',
|
|
94
|
+
description: `切换到指定名称的文档。
|
|
95
|
+
|
|
96
|
+
使用场景:
|
|
97
|
+
- "切换到报告.docx"
|
|
98
|
+
- "打开另一个文档窗口"
|
|
99
|
+
- "切换到那个合同文档"`,
|
|
100
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
name: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
description: '要切换到的文档名称',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
required: ['name'],
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
const switchDocumentHandler = async (args) => {
|
|
113
|
+
const { name } = args;
|
|
114
|
+
if (!name || name.trim() === '') {
|
|
115
|
+
return {
|
|
116
|
+
id: (0, uuid_1.v4)(),
|
|
117
|
+
success: false,
|
|
118
|
+
content: [{ type: 'text', text: '文档名称不能为空!' }],
|
|
119
|
+
error: '文档名称为空',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
const response = await wps_client_1.wpsClient.executeMethod('switchDocument', { name }, wps_1.WpsAppType.WRITER);
|
|
124
|
+
if (response.success) {
|
|
125
|
+
// 锁定目标:之后所有 word 调用都会自动带上 documentName,
|
|
126
|
+
// 避免 ActiveDocument 在多文档场景下漂移/返回空壳。
|
|
127
|
+
(0, wps_client_1.setWordTarget)(name);
|
|
128
|
+
return {
|
|
129
|
+
id: (0, uuid_1.v4)(),
|
|
130
|
+
success: true,
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: 'text',
|
|
134
|
+
text: `已切换到文档: ${name}(后续 word 操作将锁定此文档)`,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return {
|
|
141
|
+
id: (0, uuid_1.v4)(),
|
|
142
|
+
success: false,
|
|
143
|
+
content: [{ type: 'text', text: `切换文档失败: ${response.error}` }],
|
|
144
|
+
error: response.error,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
150
|
+
return {
|
|
151
|
+
id: (0, uuid_1.v4)(),
|
|
152
|
+
success: false,
|
|
153
|
+
content: [{ type: 'text', text: `切换文档出错: ${errMsg}` }],
|
|
154
|
+
error: errMsg,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
exports.switchDocumentHandler = switchDocumentHandler;
|
|
159
|
+
/**
|
|
160
|
+
* 打开指定路径的文档
|
|
161
|
+
*/
|
|
162
|
+
exports.openDocumentDefinition = {
|
|
163
|
+
name: 'wps_word_open_document',
|
|
164
|
+
description: `打开指定路径的Word文档。
|
|
165
|
+
|
|
166
|
+
使用场景:
|
|
167
|
+
- "打开桌面上的报告.docx"
|
|
168
|
+
- "帮我打开这个文件路径的文档"
|
|
169
|
+
- "加载指定位置的Word文件"`,
|
|
170
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
filePath: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: '要打开的文档文件路径',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
required: ['filePath'],
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
const openDocumentHandler = async (args) => {
|
|
183
|
+
const { filePath } = args;
|
|
184
|
+
if (!filePath || filePath.trim() === '') {
|
|
185
|
+
return {
|
|
186
|
+
id: (0, uuid_1.v4)(),
|
|
187
|
+
success: false,
|
|
188
|
+
content: [{ type: 'text', text: '文件路径不能为空!' }],
|
|
189
|
+
error: '文件路径为空',
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
const params = {
|
|
194
|
+
filePath,
|
|
195
|
+
path: filePath,
|
|
196
|
+
};
|
|
197
|
+
const response = await wps_client_1.wpsClient.executeMethod('openDocument', params, wps_1.WpsAppType.WRITER);
|
|
198
|
+
if (response.success && response.data) {
|
|
199
|
+
return {
|
|
200
|
+
id: (0, uuid_1.v4)(),
|
|
201
|
+
success: true,
|
|
202
|
+
content: [
|
|
203
|
+
{
|
|
204
|
+
type: 'text',
|
|
205
|
+
text: `文档打开成功!\n文件: ${response.data.documentName || filePath}`,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
return {
|
|
212
|
+
id: (0, uuid_1.v4)(),
|
|
213
|
+
success: false,
|
|
214
|
+
content: [{ type: 'text', text: `打开文档失败: ${response.error}` }],
|
|
215
|
+
error: response.error,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
221
|
+
return {
|
|
222
|
+
id: (0, uuid_1.v4)(),
|
|
223
|
+
success: false,
|
|
224
|
+
content: [{ type: 'text', text: `打开文档出错: ${errMsg}` }],
|
|
225
|
+
error: errMsg,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
exports.openDocumentHandler = openDocumentHandler;
|
|
230
|
+
/**
|
|
231
|
+
* 获取文档文本内容
|
|
232
|
+
*/
|
|
233
|
+
exports.getDocumentTextDefinition = {
|
|
234
|
+
name: 'wps_word_get_document_text',
|
|
235
|
+
description: `获取当前Word文档的文本内容。
|
|
236
|
+
|
|
237
|
+
使用场景:
|
|
238
|
+
- "读取文档内容"
|
|
239
|
+
- "获取文档的前100个字符"
|
|
240
|
+
- "查看文档从第50到第200个字符的内容"
|
|
241
|
+
|
|
242
|
+
可指定起始和结束位置来获取部分文本。`,
|
|
243
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: 'object',
|
|
246
|
+
properties: {
|
|
247
|
+
start: {
|
|
248
|
+
type: 'number',
|
|
249
|
+
description: '起始位置(字符索引),默认从头开始',
|
|
250
|
+
},
|
|
251
|
+
end: {
|
|
252
|
+
type: 'number',
|
|
253
|
+
description: '结束位置(字符索引),默认到文档末尾',
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
const getDocumentTextHandler = async (args) => {
|
|
259
|
+
const { start, end } = args;
|
|
260
|
+
try {
|
|
261
|
+
const params = {};
|
|
262
|
+
if (start !== undefined)
|
|
263
|
+
params.start = start;
|
|
264
|
+
if (end !== undefined)
|
|
265
|
+
params.end = end;
|
|
266
|
+
const response = await wps_client_1.wpsClient.executeMethod('getDocumentText', params, wps_1.WpsAppType.WRITER);
|
|
267
|
+
if (response.success && response.data) {
|
|
268
|
+
const rangeInfo = start !== undefined || end !== undefined
|
|
269
|
+
? `\n范围: ${start ?? 0} - ${end ?? '末尾'}`
|
|
270
|
+
: '';
|
|
271
|
+
return {
|
|
272
|
+
id: (0, uuid_1.v4)(),
|
|
273
|
+
success: true,
|
|
274
|
+
content: [
|
|
275
|
+
{
|
|
276
|
+
type: 'text',
|
|
277
|
+
text: `文档文本内容 (${response.data.length}字符)${rangeInfo}:\n\n${response.data.text}`,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return {
|
|
284
|
+
id: (0, uuid_1.v4)(),
|
|
285
|
+
success: false,
|
|
286
|
+
content: [{ type: 'text', text: `获取文档文本失败: ${response.error}` }],
|
|
287
|
+
error: response.error,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
293
|
+
return {
|
|
294
|
+
id: (0, uuid_1.v4)(),
|
|
295
|
+
success: false,
|
|
296
|
+
content: [{ type: 'text', text: `获取文档文本出错: ${errMsg}` }],
|
|
297
|
+
error: errMsg,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
exports.getDocumentTextHandler = getDocumentTextHandler;
|
|
302
|
+
/**
|
|
303
|
+
* 设置页眉内容
|
|
304
|
+
*/
|
|
305
|
+
exports.insertHeaderDefinition = {
|
|
306
|
+
name: 'wps_word_insert_header',
|
|
307
|
+
description: `设置页眉内容。
|
|
308
|
+
|
|
309
|
+
使用场景:
|
|
310
|
+
- "给文档加个页眉"
|
|
311
|
+
- "设置页眉为公司名称"
|
|
312
|
+
- "修改第2节的页眉"`,
|
|
313
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
314
|
+
inputSchema: {
|
|
315
|
+
type: 'object',
|
|
316
|
+
properties: {
|
|
317
|
+
text: {
|
|
318
|
+
type: 'string',
|
|
319
|
+
description: '页眉文本内容',
|
|
320
|
+
},
|
|
321
|
+
section: {
|
|
322
|
+
type: 'number',
|
|
323
|
+
description: '节编号(从1开始),默认1',
|
|
324
|
+
default: 1,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
required: ['text'],
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
const insertHeaderHandler = async (args) => {
|
|
331
|
+
const { text, section = 1 } = args;
|
|
332
|
+
if (!text) {
|
|
333
|
+
return {
|
|
334
|
+
id: (0, uuid_1.v4)(),
|
|
335
|
+
success: false,
|
|
336
|
+
content: [{ type: 'text', text: '页眉文本不能为空!' }],
|
|
337
|
+
error: '页眉文本为空',
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
const response = await wps_client_1.wpsClient.executeMethod('insertHeader', { text, section }, wps_1.WpsAppType.WRITER);
|
|
342
|
+
if (response.success) {
|
|
343
|
+
return {
|
|
344
|
+
id: (0, uuid_1.v4)(),
|
|
345
|
+
success: true,
|
|
346
|
+
content: [{ type: 'text', text: `页眉已设置: "${text}" (第${section}节)` }],
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
return {
|
|
351
|
+
id: (0, uuid_1.v4)(),
|
|
352
|
+
success: false,
|
|
353
|
+
content: [{ type: 'text', text: `设置页眉失败: ${response.error}` }],
|
|
354
|
+
error: response.error,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
360
|
+
return {
|
|
361
|
+
id: (0, uuid_1.v4)(),
|
|
362
|
+
success: false,
|
|
363
|
+
content: [{ type: 'text', text: `设置页眉出错: ${errMsg}` }],
|
|
364
|
+
error: errMsg,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
exports.insertHeaderHandler = insertHeaderHandler;
|
|
369
|
+
/**
|
|
370
|
+
* 设置页脚内容
|
|
371
|
+
*/
|
|
372
|
+
exports.insertFooterDefinition = {
|
|
373
|
+
name: 'wps_word_insert_footer',
|
|
374
|
+
description: `设置页脚内容。
|
|
375
|
+
|
|
376
|
+
使用场景:
|
|
377
|
+
- "给文档加个页脚"
|
|
378
|
+
- "设置页脚为页码"
|
|
379
|
+
- "修改第1节的页脚"`,
|
|
380
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
381
|
+
inputSchema: {
|
|
382
|
+
type: 'object',
|
|
383
|
+
properties: {
|
|
384
|
+
text: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description: '页脚文本内容',
|
|
387
|
+
},
|
|
388
|
+
section: {
|
|
389
|
+
type: 'number',
|
|
390
|
+
description: '节编号(从1开始),默认1',
|
|
391
|
+
default: 1,
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
required: ['text'],
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
const insertFooterHandler = async (args) => {
|
|
398
|
+
const { text, section = 1 } = args;
|
|
399
|
+
if (!text) {
|
|
400
|
+
return {
|
|
401
|
+
id: (0, uuid_1.v4)(),
|
|
402
|
+
success: false,
|
|
403
|
+
content: [{ type: 'text', text: '页脚文本不能为空!' }],
|
|
404
|
+
error: '页脚文本为空',
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
const response = await wps_client_1.wpsClient.executeMethod('insertFooter', { text, section }, wps_1.WpsAppType.WRITER);
|
|
409
|
+
if (response.success) {
|
|
410
|
+
return {
|
|
411
|
+
id: (0, uuid_1.v4)(),
|
|
412
|
+
success: true,
|
|
413
|
+
content: [{ type: 'text', text: `页脚已设置: "${text}" (第${section}节)` }],
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
return {
|
|
418
|
+
id: (0, uuid_1.v4)(),
|
|
419
|
+
success: false,
|
|
420
|
+
content: [{ type: 'text', text: `设置页脚失败: ${response.error}` }],
|
|
421
|
+
error: response.error,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
427
|
+
return {
|
|
428
|
+
id: (0, uuid_1.v4)(),
|
|
429
|
+
success: false,
|
|
430
|
+
content: [{ type: 'text', text: `设置页脚出错: ${errMsg}` }],
|
|
431
|
+
error: errMsg,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
exports.insertFooterHandler = insertFooterHandler;
|
|
436
|
+
/**
|
|
437
|
+
* 插入分节符
|
|
438
|
+
*/
|
|
439
|
+
exports.insertSectionBreakDefinition = {
|
|
440
|
+
name: 'wps_word_insert_section_break',
|
|
441
|
+
description: `插入分节符,用于将文档分为不同的节,以便对各节应用不同的页面设置。
|
|
442
|
+
|
|
443
|
+
使用场景:
|
|
444
|
+
- "插入一个分节符"
|
|
445
|
+
- "从下一页开始新的一节"
|
|
446
|
+
- "在这里分节"`,
|
|
447
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
448
|
+
inputSchema: {
|
|
449
|
+
type: 'object',
|
|
450
|
+
properties: {
|
|
451
|
+
breakType: {
|
|
452
|
+
type: 'string',
|
|
453
|
+
description: '分节符类型:nextPage(下一页)、continuous(连续)、evenPage(偶数页)、oddPage(奇数页),默认nextPage',
|
|
454
|
+
default: 'nextPage',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
};
|
|
459
|
+
const insertSectionBreakHandler = async (args) => {
|
|
460
|
+
const { breakType = 'nextPage' } = args;
|
|
461
|
+
try {
|
|
462
|
+
const response = await wps_client_1.wpsClient.executeMethod('insertSectionBreak', // NOTE: 仅Windows支持
|
|
463
|
+
{ breakType }, wps_1.WpsAppType.WRITER);
|
|
464
|
+
if (response.success) {
|
|
465
|
+
return {
|
|
466
|
+
id: (0, uuid_1.v4)(),
|
|
467
|
+
success: true,
|
|
468
|
+
content: [{ type: 'text', text: `分节符已插入(类型: ${breakType})` }],
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
return {
|
|
473
|
+
id: (0, uuid_1.v4)(),
|
|
474
|
+
success: false,
|
|
475
|
+
content: [{ type: 'text', text: `插入分节符失败: ${response.error}` }],
|
|
476
|
+
error: response.error,
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
catch (error) {
|
|
481
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
482
|
+
return {
|
|
483
|
+
id: (0, uuid_1.v4)(),
|
|
484
|
+
success: false,
|
|
485
|
+
content: [{ type: 'text', text: `插入分节符出错: ${errMsg}` }],
|
|
486
|
+
error: errMsg,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
exports.insertSectionBreakHandler = insertSectionBreakHandler;
|
|
491
|
+
/**
|
|
492
|
+
* 设置行距
|
|
493
|
+
*/
|
|
494
|
+
exports.setLineSpacingDefinition = {
|
|
495
|
+
name: 'wps_word_set_line_spacing',
|
|
496
|
+
description: `设置段落行距。
|
|
497
|
+
|
|
498
|
+
使用场景:
|
|
499
|
+
- "把行距设为1.5倍"
|
|
500
|
+
- "设置第3段的行距为2倍"
|
|
501
|
+
- "调整行距"`,
|
|
502
|
+
category: tools_1.ToolCategory.DOCUMENT,
|
|
503
|
+
inputSchema: {
|
|
504
|
+
type: 'object',
|
|
505
|
+
properties: {
|
|
506
|
+
lineSpacing: {
|
|
507
|
+
type: 'number',
|
|
508
|
+
description: '行距值(如1.0、1.5、2.0等)',
|
|
509
|
+
},
|
|
510
|
+
paragraphIndex: {
|
|
511
|
+
type: 'number',
|
|
512
|
+
description: '段落索引(从0开始),不指定则应用于当前段落或全文',
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
required: ['lineSpacing'],
|
|
516
|
+
},
|
|
517
|
+
};
|
|
518
|
+
const setLineSpacingHandler = async (args) => {
|
|
519
|
+
const { lineSpacing, paragraphIndex } = args;
|
|
520
|
+
if (lineSpacing === undefined || lineSpacing <= 0) {
|
|
521
|
+
return {
|
|
522
|
+
id: (0, uuid_1.v4)(),
|
|
523
|
+
success: false,
|
|
524
|
+
content: [{ type: 'text', text: '行距值必须为正数!' }],
|
|
525
|
+
error: '行距值无效',
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
try {
|
|
529
|
+
const params = { lineSpacing };
|
|
530
|
+
if (paragraphIndex !== undefined)
|
|
531
|
+
params.paragraphIndex = paragraphIndex;
|
|
532
|
+
const response = await wps_client_1.wpsClient.executeMethod('setLineSpacing', // NOTE: 仅Windows支持
|
|
533
|
+
params, wps_1.WpsAppType.WRITER);
|
|
534
|
+
if (response.success) {
|
|
535
|
+
const target = paragraphIndex !== undefined ? `第${paragraphIndex}段` : '当前段落';
|
|
536
|
+
return {
|
|
537
|
+
id: (0, uuid_1.v4)(),
|
|
538
|
+
success: true,
|
|
539
|
+
content: [{ type: 'text', text: `行距已设置为 ${lineSpacing} 倍(${target})` }],
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
return {
|
|
544
|
+
id: (0, uuid_1.v4)(),
|
|
545
|
+
success: false,
|
|
546
|
+
content: [{ type: 'text', text: `设置行距失败: ${response.error}` }],
|
|
547
|
+
error: response.error,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
catch (error) {
|
|
552
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
553
|
+
return {
|
|
554
|
+
id: (0, uuid_1.v4)(),
|
|
555
|
+
success: false,
|
|
556
|
+
content: [{ type: 'text', text: `设置行距出错: ${errMsg}` }],
|
|
557
|
+
error: errMsg,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
exports.setLineSpacingHandler = setLineSpacingHandler;
|
|
562
|
+
/**
|
|
563
|
+
* 导出所有文档管理相关的Tools
|
|
564
|
+
*/
|
|
565
|
+
exports.documentTools = [
|
|
566
|
+
{ definition: exports.getOpenDocumentsDefinition, handler: exports.getOpenDocumentsHandler },
|
|
567
|
+
{ definition: exports.switchDocumentDefinition, handler: exports.switchDocumentHandler },
|
|
568
|
+
{ definition: exports.openDocumentDefinition, handler: exports.openDocumentHandler },
|
|
569
|
+
{ definition: exports.getDocumentTextDefinition, handler: exports.getDocumentTextHandler },
|
|
570
|
+
{ definition: exports.insertHeaderDefinition, handler: exports.insertHeaderHandler },
|
|
571
|
+
{ definition: exports.insertFooterDefinition, handler: exports.insertFooterHandler },
|
|
572
|
+
{ definition: exports.insertSectionBreakDefinition, handler: exports.insertSectionBreakHandler },
|
|
573
|
+
{ definition: exports.setLineSpacingDefinition, handler: exports.setLineSpacingHandler },
|
|
574
|
+
];
|
|
575
|
+
exports.default = exports.documentTools;
|
|
576
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/tools/word/document.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,+BAAoC;AACpC,6CAM2B;AAC3B,wDAAmE;AACnE,yCAA6C;AAE7C;;GAEG;AACU,QAAA,0BAA0B,GAAmB;IACxD,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE;;;;;aAKF;IACX,QAAQ,EAAE,oBAAY,CAAC,QAAQ;IAC/B,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEK,MAAM,uBAAuB,GAAgB,KAAK,EACvD,KAA8B,EACL,EAAE;IAC3B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,sBAAS,CAAC,aAAa,CAK5C,kBAAkB,EAClB,EAAE,EACF,gBAAU,CAAC,MAAM,CAClB,CAAC;QAEF,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YACrC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC/B,OAAO;oBACL,EAAE,EAAE,IAAA,SAAM,G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AE;IAC1E,EAAE,UAAU,EAAE,8BAAsB,EAAE,OAAO,EAAE,2BAAmB,EAAE;IACpE,EAAE,UAAU,EAAE,8BAAsB,EAAE,OAAO,EAAE,2BAAmB,EAAE;IACpE,EAAE,UAAU,EAAE,oCAA4B,EAAE,OAAO,EAAE,iCAAyB,EAAE;IAChF,EAAE,UAAU,EAAE,gCAAwB,EAAE,OAAO,EAAE,6BAAqB,EAAE;CACzE,CAAC;AAEF,kBAAe,qBAAa,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input: Word 格式化参数
|
|
3
|
+
* Output: 样式与字体设置结果
|
|
4
|
+
* Pos: Word 格式化工具实现。一旦我被修改,请更新我的头部注释,以及所属文件夹的md。
|
|
5
|
+
* Word格式化Tools - 排版格式化模块
|
|
6
|
+
* 处理文档样式、字体、目录等格式化需求
|
|
7
|
+
*
|
|
8
|
+
* 包含:
|
|
9
|
+
* - wps_word_apply_style: 应用样式到选中区域
|
|
10
|
+
* - wps_word_set_font: 设置字体格式
|
|
11
|
+
* - wps_word_generate_toc: 生成目录
|
|
12
|
+
* - wps_word_insert_bookmark: 插入书签
|
|
13
|
+
* - wps_word_set_page_setup: 设置页面布局
|
|
14
|
+
*/
|
|
15
|
+
import { ToolDefinition, ToolHandler, RegisteredTool } from '../../types/tools';
|
|
16
|
+
/**
|
|
17
|
+
* 应用样式到选中区域
|
|
18
|
+
* 快速应用Word内置样式,比如标题1、标题2、正文等
|
|
19
|
+
*/
|
|
20
|
+
export declare const applyStyleDefinition: ToolDefinition;
|
|
21
|
+
export declare const applyStyleHandler: ToolHandler;
|
|
22
|
+
/**
|
|
23
|
+
* 设置字体格式
|
|
24
|
+
*/
|
|
25
|
+
export declare const setFontDefinition: ToolDefinition;
|
|
26
|
+
export declare const setFontHandler: ToolHandler;
|
|
27
|
+
/**
|
|
28
|
+
* 生成目录
|
|
29
|
+
* 自动根据文档中的标题样式生成目录
|
|
30
|
+
*/
|
|
31
|
+
export declare const generateTocDefinition: ToolDefinition;
|
|
32
|
+
export declare const generateTocHandler: ToolHandler;
|
|
33
|
+
/**
|
|
34
|
+
* 插入书签
|
|
35
|
+
* 在当前光标位置插入书签,方便交叉引用和导航
|
|
36
|
+
*/
|
|
37
|
+
export declare const insertBookmarkDefinition: ToolDefinition;
|
|
38
|
+
export declare const insertBookmarkHandler: ToolHandler;
|
|
39
|
+
/**
|
|
40
|
+
* 设置页面布局
|
|
41
|
+
* 调整页面方向、边距等页面设置
|
|
42
|
+
*/
|
|
43
|
+
export declare const setPageSetupDefinition: ToolDefinition;
|
|
44
|
+
export declare const setPageSetupHandler: ToolHandler;
|
|
45
|
+
/**
|
|
46
|
+
* 导出所有格式化相关的Tools
|
|
47
|
+
*/
|
|
48
|
+
export declare const formatTools: RegisteredTool[];
|
|
49
|
+
export default formatTools;
|
|
50
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/tools/word/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,cAAc,EACd,WAAW,EAGX,cAAc,EACf,MAAM,mBAAmB,CAAC;AAI3B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAsClC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WA+C/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,cA4C/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WA+E5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,cA6BnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAoDhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAuBtC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,WA2CnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAoCpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,WAoEjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,cAAc,EAMvC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|