@ycodium-ai/plugin-office 0.2.3510 → 0.2.3566
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 +84 -75
- package/assets/check_runtime.py +8 -0
- package/assets/run_office.py +34 -0
- package/dist/index.js +218 -669
- package/locales/en.json +16 -81
- package/locales/zh-CN.json +19 -84
- package/package.json +4 -6
- package/skills/office-docx/SKILL.md +3 -3
- package/skills/office-pptx/SKILL.md +3 -3
- package/skills/office-xlsx/SKILL.md +2 -2
- package/ui/ui.js +1 -1
package/locales/en.json
CHANGED
|
@@ -2,108 +2,43 @@
|
|
|
2
2
|
"settings": {
|
|
3
3
|
"card": {
|
|
4
4
|
"title": "Office",
|
|
5
|
-
"description": "
|
|
6
|
-
},
|
|
7
|
-
"npmRegistry": {
|
|
8
|
-
"label": "npm registry",
|
|
9
|
-
"description": "Where the Office engine is downloaded from. Leave empty for registry.npmjs.org; a mirror must serve the same packages."
|
|
10
|
-
},
|
|
11
|
-
"githubMirror": {
|
|
12
|
-
"label": "GitHub download prefix",
|
|
13
|
-
"description": "Put in front of GitHub download addresses for Python and fonts, for a proxy service. Leave empty to download directly."
|
|
14
|
-
},
|
|
15
|
-
"pypiMirror": {
|
|
16
|
-
"label": "PyPI files mirror",
|
|
17
|
-
"description": "Replaces https://files.pythonhosted.org/packages for the document libraries. Leave empty to use PyPI."
|
|
18
|
-
},
|
|
19
|
-
"localDir": {
|
|
20
|
-
"label": "Local folder",
|
|
21
|
-
"description": "A folder on this machine with files downloaded ahead of time. Files found there are used instead of downloading; they are checked the same way."
|
|
5
|
+
"description": "Create, edit, check, render, and convert Word, PowerPoint, and Excel files, and recalculate spreadsheet formulas. Everything is included with Ycodium and works without additional downloads. Check shows component status and versions. To restore missing or damaged files, reinstall the complete Ycodium package from an offline installer."
|
|
22
6
|
}
|
|
23
7
|
},
|
|
24
8
|
"actions": {
|
|
25
|
-
"installEngine": {
|
|
26
|
-
"label": "Install engine",
|
|
27
|
-
"description": "Downloads the LibreOffice-based engine (a 50–70 MB download, MPL-2.0) that renders and converts documents."
|
|
28
|
-
},
|
|
29
|
-
"installPython": {
|
|
30
|
-
"label": "Install Python",
|
|
31
|
-
"description": "Downloads Python 3.12 with python-docx, python-pptx, openpyxl, pandas, and Pillow for writing documents (about 60 MB)."
|
|
32
|
-
},
|
|
33
|
-
"installFonts": {
|
|
34
|
-
"label": "Install Chinese fonts",
|
|
35
|
-
"description": "Downloads Noto Sans SC and Noto Serif SC (about 40 MB, SIL OFL) for the engine only. System fonts are not changed."
|
|
36
|
-
},
|
|
37
9
|
"health": {
|
|
38
10
|
"label": "Check",
|
|
39
|
-
"description": "Checks
|
|
40
|
-
},
|
|
41
|
-
"remove": {
|
|
42
|
-
"label": "Delete engine",
|
|
43
|
-
"description": "Deletes the engine, Python, and fonts from this machine. You can install them again later."
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"progress": {
|
|
47
|
-
"step": {
|
|
48
|
-
"download": "Download and verify",
|
|
49
|
-
"unpack": "Unpack",
|
|
50
|
-
"check": "Check"
|
|
51
|
-
},
|
|
52
|
-
"downloading": "Downloading {{file}} ({{index}} of {{count}}): {{done}} of {{total}} MB",
|
|
53
|
-
"downloadingUnknown": "Downloading {{file}} ({{index}} of {{count}}): {{done}} MB",
|
|
54
|
-
"checking": "Checking this machine…",
|
|
55
|
-
"removing": "Deleting…",
|
|
56
|
-
"done": {
|
|
57
|
-
"engine": {
|
|
58
|
-
"native": "The engine is installed.",
|
|
59
|
-
"wasm": "The engine is installed. This machine runs its WebAssembly build, which needs more memory and starts more slowly."
|
|
60
|
-
},
|
|
61
|
-
"python": "Python and the document libraries are installed.",
|
|
62
|
-
"fonts": "Chinese fonts are installed for the engine.",
|
|
63
|
-
"removed": "The engine, Python, and fonts were deleted."
|
|
11
|
+
"description": "Checks the bundled engine, shared Python, isolated document libraries, and Chinese fonts, and reports their versions. No downloads are performed."
|
|
64
12
|
}
|
|
65
13
|
},
|
|
14
|
+
"progress": { "checking": "Checking bundled Office components…" },
|
|
66
15
|
"health": {
|
|
67
16
|
"summary": {
|
|
68
|
-
"ok": "Everything is ready.",
|
|
69
|
-
"issues": "Some
|
|
17
|
+
"ok": "Everything is ready for offline use.",
|
|
18
|
+
"issues": "Some bundled components need attention. Restore missing or damaged files by reinstalling the complete Ycodium package from an offline installer."
|
|
70
19
|
},
|
|
71
|
-
"unsupportedPlatform": "This machine's platform has no
|
|
20
|
+
"unsupportedPlatform": "This machine's platform has no bundled Office build.",
|
|
72
21
|
"engine": {
|
|
73
|
-
"ok": "Engine: ready ({{backend}}).",
|
|
74
|
-
"missing": "
|
|
75
|
-
"broken": "
|
|
22
|
+
"ok": "Engine {{version}}: ready ({{backend}}).",
|
|
23
|
+
"missing": "Bundled engine: missing, incomplete, or wrong version. Reinstall the complete Ycodium package.",
|
|
24
|
+
"broken": "Bundled engine: does not start. {{detail}}"
|
|
76
25
|
},
|
|
77
26
|
"python": {
|
|
78
|
-
"ok": "Python: ready.",
|
|
79
|
-
"missing": "Python:
|
|
80
|
-
"broken": "Python: the document libraries do not load. {{detail}}",
|
|
81
|
-
"unsupported": "Python: no build for this machine's platform."
|
|
27
|
+
"ok": "Shared Python {{version}} and isolated document libraries: ready.",
|
|
28
|
+
"missing": "Shared Python or bundled document libraries: missing, incomplete, or wrong version. Reinstall the complete Ycodium package.",
|
|
29
|
+
"broken": "Python: the bundled document libraries do not load. {{detail}}",
|
|
30
|
+
"unsupported": "Python: no bundled build for this machine's platform."
|
|
82
31
|
},
|
|
83
32
|
"fonts": {
|
|
84
|
-
"ok": "Chinese fonts: available.",
|
|
85
|
-
"missing": "Chinese fonts:
|
|
33
|
+
"ok": "Chinese fonts {{version}}: bundled and available.",
|
|
34
|
+
"missing": "Bundled Chinese fonts: missing, incomplete, or wrong version. Reinstall the complete Ycodium package."
|
|
86
35
|
}
|
|
87
36
|
},
|
|
88
|
-
"failure": {
|
|
89
|
-
"busy": "Another install or delete is still running. Try again when it finishes.",
|
|
90
|
-
"unsupported-platform": "This machine's platform has no engine build.",
|
|
91
|
-
"unpack-failed": "The download could not be unpacked.",
|
|
92
|
-
"engine-unavailable": "The engine was installed but does not start on this machine.",
|
|
93
|
-
"engine-unavailable-windows": "The engine does not start. Windows needs the Microsoft Visual C++ 2015–2022 Redistributable for this machine's architecture.",
|
|
94
|
-
"python-failed": "Python was downloaded but the document libraries could not be installed.",
|
|
95
|
-
"python-unsupported": "There is no Python build for this machine's platform.",
|
|
96
|
-
"download-network": "The download could not reach the server. Check this machine's internet access and proxy.",
|
|
97
|
-
"download-http": "The server refused the download.",
|
|
98
|
-
"download-integrity": "A downloaded file did not match its checksum and was discarded.",
|
|
99
|
-
"download-disk": "This machine ran out of disk space.",
|
|
100
|
-
"unknown": "Something went wrong."
|
|
101
|
-
},
|
|
102
37
|
"card": {
|
|
103
38
|
"page": "Page {{page}}",
|
|
104
39
|
"loading": "Loading…",
|
|
105
40
|
"imageUnavailable": "Image unavailable",
|
|
106
|
-
"noCjkFont": "
|
|
41
|
+
"noCjkFont": "The bundled Chinese fonts are unavailable, so Chinese text in these pages may show as boxes.",
|
|
107
42
|
"missingFonts": "Missing fonts, substituted: {{fonts}}"
|
|
108
43
|
}
|
|
109
44
|
}
|
package/locales/zh-CN.json
CHANGED
|
@@ -2,108 +2,43 @@
|
|
|
2
2
|
"settings": {
|
|
3
3
|
"card": {
|
|
4
4
|
"title": "Office",
|
|
5
|
-
"description": "
|
|
6
|
-
},
|
|
7
|
-
"npmRegistry": {
|
|
8
|
-
"label": "npm 源",
|
|
9
|
-
"description": "从哪里下载 Office 引擎。留空用 registry.npmjs.org;换成镜像也必须是同样的包。"
|
|
10
|
-
},
|
|
11
|
-
"githubMirror": {
|
|
12
|
-
"label": "GitHub 下载前缀",
|
|
13
|
-
"description": "加在 Python 与字体的 GitHub 下载地址前面,用于代理服务。留空表示直连。"
|
|
14
|
-
},
|
|
15
|
-
"pypiMirror": {
|
|
16
|
-
"label": "PyPI 文件镜像",
|
|
17
|
-
"description": "替换写文档的库的下载地址 https://files.pythonhosted.org/packages。留空用 PyPI。"
|
|
18
|
-
},
|
|
19
|
-
"localDir": {
|
|
20
|
-
"label": "本地文件夹",
|
|
21
|
-
"description": "这台机器上事先下好文件的文件夹。在这里找到的文件就不再下载,照样校验。"
|
|
5
|
+
"description": "创建、编辑、检查、渲染、转换 Word、PowerPoint、Excel 文件,并重算表格公式。所需组件随 Ycodium 提供,无需额外下载。点「检查」查看组件状态和版本。文件缺失或损坏时,请使用离线安装包重新安装完整的 Ycodium。"
|
|
22
6
|
}
|
|
23
7
|
},
|
|
24
8
|
"actions": {
|
|
25
|
-
"installEngine": {
|
|
26
|
-
"label": "安装引擎",
|
|
27
|
-
"description": "下载基于 LibreOffice 的引擎(约 50–70 MB,MPL-2.0),用来渲染和转换文档。"
|
|
28
|
-
},
|
|
29
|
-
"installPython": {
|
|
30
|
-
"label": "安装 Python",
|
|
31
|
-
"description": "下载 Python 3.12 以及 python-docx、python-pptx、openpyxl、pandas、Pillow,用来写文档(约 60 MB)。"
|
|
32
|
-
},
|
|
33
|
-
"installFonts": {
|
|
34
|
-
"label": "安装中文字体",
|
|
35
|
-
"description": "下载思源黑体与思源宋体的 Noto 版(约 40 MB,SIL OFL),只给引擎用,不改系统字体。"
|
|
36
|
-
},
|
|
37
9
|
"health": {
|
|
38
10
|
"label": "检查",
|
|
39
|
-
"description": "
|
|
40
|
-
},
|
|
41
|
-
"remove": {
|
|
42
|
-
"label": "删除引擎",
|
|
43
|
-
"description": "从这台机器上删掉引擎、Python 和字体,之后可以重新安装。"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"progress": {
|
|
47
|
-
"step": {
|
|
48
|
-
"download": "下载并校验",
|
|
49
|
-
"unpack": "解包",
|
|
50
|
-
"check": "检查"
|
|
51
|
-
},
|
|
52
|
-
"downloading": "正在下载 {{file}}({{index}}/{{count}}):{{done}} / {{total}} MB",
|
|
53
|
-
"downloadingUnknown": "正在下载 {{file}}({{index}}/{{count}}):{{done}} MB",
|
|
54
|
-
"checking": "正在检查这台机器……",
|
|
55
|
-
"removing": "正在删除……",
|
|
56
|
-
"done": {
|
|
57
|
-
"engine": {
|
|
58
|
-
"native": "引擎已安装。",
|
|
59
|
-
"wasm": "引擎已安装。这台机器用的是 WebAssembly 版,占内存更多,启动更慢。"
|
|
60
|
-
},
|
|
61
|
-
"python": "Python 与写文档的库已安装。",
|
|
62
|
-
"fonts": "已为引擎装好中文字体。",
|
|
63
|
-
"removed": "引擎、Python 和字体已删除。"
|
|
11
|
+
"description": "检查随包引擎、共享 Python、隔离的文档库和中文字体,并显示版本;不会下载文件。"
|
|
64
12
|
}
|
|
65
13
|
},
|
|
14
|
+
"progress": { "checking": "正在检查随包 Office 组件…" },
|
|
66
15
|
"health": {
|
|
67
16
|
"summary": {
|
|
68
|
-
"ok": "
|
|
69
|
-
"issues": "
|
|
17
|
+
"ok": "全部就绪,可离线使用。",
|
|
18
|
+
"issues": "部分随包组件需要处理。文件缺失或损坏时,请使用离线安装包重新安装完整的 Ycodium。"
|
|
70
19
|
},
|
|
71
|
-
"unsupportedPlatform": "
|
|
20
|
+
"unsupportedPlatform": "这台机器的平台没有随包 Office 构建。",
|
|
72
21
|
"engine": {
|
|
73
|
-
"ok": "
|
|
74
|
-
"missing": "
|
|
75
|
-
"broken": "
|
|
22
|
+
"ok": "引擎 {{version}}:就绪({{backend}})。",
|
|
23
|
+
"missing": "随包引擎缺失、不完整或版本不符,请重新安装完整的 Ycodium。",
|
|
24
|
+
"broken": "随包引擎无法启动。{{detail}}"
|
|
76
25
|
},
|
|
77
26
|
"python": {
|
|
78
|
-
"ok": "Python
|
|
79
|
-
"missing": "Python
|
|
80
|
-
"broken": "Python
|
|
81
|
-
"unsupported": "Python
|
|
27
|
+
"ok": "共享 Python {{version}} 和隔离的文档库:就绪。",
|
|
28
|
+
"missing": "共享 Python 或随包文档库缺失、不完整或版本不符,请重新安装完整的 Ycodium。",
|
|
29
|
+
"broken": "Python 无法加载随包文档库。{{detail}}",
|
|
30
|
+
"unsupported": "这台机器的平台没有随包 Python 构建。"
|
|
82
31
|
},
|
|
83
32
|
"fonts": {
|
|
84
|
-
"ok": "
|
|
85
|
-
"missing": "
|
|
33
|
+
"ok": "中文字体 {{version}}:随包提供,可用。",
|
|
34
|
+
"missing": "随包中文字体缺失、不完整或版本不符,请重新安装完整的 Ycodium。"
|
|
86
35
|
}
|
|
87
36
|
},
|
|
88
|
-
"failure": {
|
|
89
|
-
"busy": "另一个安装或删除还在进行,等它结束再试。",
|
|
90
|
-
"unsupported-platform": "这台机器的平台没有引擎可用。",
|
|
91
|
-
"unpack-failed": "下载的文件解不开。",
|
|
92
|
-
"engine-unavailable": "引擎装好了,但在这台机器上启动不了。",
|
|
93
|
-
"engine-unavailable-windows": "引擎启动不了。Windows 需要与这台机器架构相同的 Microsoft Visual C++ 2015–2022 运行库。",
|
|
94
|
-
"python-failed": "Python 下载好了,但写文档的库没能装上。",
|
|
95
|
-
"python-unsupported": "这台机器的平台没有可用的 Python。",
|
|
96
|
-
"download-network": "下载连不上服务器。请检查这台机器的网络和代理。",
|
|
97
|
-
"download-http": "服务器拒绝了下载。",
|
|
98
|
-
"download-integrity": "有个下载的文件与校验值对不上,已丢弃。",
|
|
99
|
-
"download-disk": "这台机器的磁盘空间不够了。",
|
|
100
|
-
"unknown": "出了点问题。"
|
|
101
|
-
},
|
|
102
37
|
"card": {
|
|
103
38
|
"page": "第 {{page}} 页",
|
|
104
|
-
"loading": "
|
|
105
|
-
"imageUnavailable": "
|
|
106
|
-
"noCjkFont": "
|
|
107
|
-
"missingFonts": "
|
|
39
|
+
"loading": "正在加载…",
|
|
40
|
+
"imageUnavailable": "图片不可用",
|
|
41
|
+
"noCjkFont": "随包中文字体不可用,这些页面中的中文可能显示为方块。",
|
|
42
|
+
"missingFonts": "缺失字体,已替换:{{fonts}}"
|
|
108
43
|
}
|
|
109
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-office",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3566",
|
|
4
4
|
"description": "Lets agents create, check, and render Word, PowerPoint, and Excel files, and previews Office files in the app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docx",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"assets",
|
|
18
18
|
"skills",
|
|
19
19
|
"locales",
|
|
20
|
+
"runtime",
|
|
20
21
|
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"type": "module",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"esbuild": "0.28.1",
|
|
29
30
|
"typescript": "~6.0.3",
|
|
30
31
|
"vite-plus": "0.2.2",
|
|
31
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
32
|
+
"@ycodium-ai/plugin-api": "0.2.3566"
|
|
32
33
|
},
|
|
33
34
|
"ycodium": {
|
|
34
35
|
"plugin": "./dist/index.js",
|
|
@@ -40,10 +41,7 @@
|
|
|
40
41
|
"kind": "process.spawn",
|
|
41
42
|
"programs": [
|
|
42
43
|
"host:node",
|
|
43
|
-
"
|
|
44
|
-
"fc-list",
|
|
45
|
-
"data:runtime/python/python.exe",
|
|
46
|
-
"data:runtime/python/bin/python3"
|
|
44
|
+
"host:python"
|
|
47
45
|
],
|
|
48
46
|
"maxConcurrent": 6
|
|
49
47
|
},
|
|
@@ -5,7 +5,7 @@ description: Create, read, edit, and check Word documents (.docx), including rep
|
|
|
5
5
|
|
|
6
6
|
# Word documents
|
|
7
7
|
|
|
8
|
-
Use `python-docx` for DOCX creation and ordinary edits. Follow an explicit user or applicable AGENTS.md requirement for a project environment or another library. Otherwise call `office_python` and execute the returned Python path with
|
|
8
|
+
Use `python-docx` for DOCX creation and ordinary edits. Follow an explicit user or applicable AGENTS.md requirement for a project environment or another library. Otherwise call `office_python` and execute the returned Python path with every returned `args` element, followed by your script path; apply any returned `env` entries. The arguments load this plugin's isolated document libraries. Do not install packages or discover a system Python for the default workflow. If the tool reports missing or damaged bundled components, report that failure and direct the user to Settings → Plugins → Office → Check; restore the complete Ycodium installation from an offline installer.
|
|
9
9
|
|
|
10
10
|
Keep source scripts, intermediate files, and final documents in the task workspace; the runtime is a read-only resource. Use the user's requested language and preserve an existing document's design unless a redesign is requested.
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ For existing files, inspect paragraphs, runs, tables, sections, headers, and foo
|
|
|
15
15
|
|
|
16
16
|
Use paragraph styles for headings and body text. Size tables for the section that contains them, and account for merged cells and nested tables. Chinese, Japanese, and Korean text may need an explicit `w:eastAsia` font assignment in addition to `run.font.name`; font names alone do not establish glyph availability or rendered appearance.
|
|
17
17
|
|
|
18
|
-
For a new document, use the
|
|
18
|
+
For a new document, use the returned executable and all returned arguments:
|
|
19
19
|
|
|
20
20
|
```python
|
|
21
21
|
from docx import Document
|
|
@@ -43,7 +43,7 @@ Render for a requested image/PDF deliverable or an actionable layout check. Befo
|
|
|
43
43
|
|
|
44
44
|
Use the `office_*` tools for every LibreOffice operation unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If a tool reports that the engine is not installed or fails, report that failure instead of substituting another executable.
|
|
45
45
|
|
|
46
|
-
`office_render` and `office_convert` run the engine
|
|
46
|
+
`office_render` and `office_convert` run the engine bundled for this machine from the task directory. Direct rendering avoids an intermediate PDF:
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
49
|
office_render({"path": "report.docx", "outputDir": "preview-v1", "pages": "1,3", "dpi": 144})
|
|
@@ -5,7 +5,7 @@ description: Create, read, edit, and check PowerPoint presentations (.pptx), inc
|
|
|
5
5
|
|
|
6
6
|
# PowerPoint presentations
|
|
7
7
|
|
|
8
|
-
Follow an explicit user or applicable AGENTS.md requirement for an environment or library. Otherwise call `office_python` and use its Python executable
|
|
8
|
+
Follow an explicit user or applicable AGENTS.md requirement for an environment or library. Otherwise call `office_python` and use its Python executable with every returned `args` element followed by your script path; apply any returned `env` entries. These arguments load the isolated presentation libraries. Do not install npm or pip packages or locate a system interpreter for the default workflow. If the tool reports missing or damaged bundled components, report that failure and direct the user to Settings → Plugins → Office → Check; restore the complete Ycodium installation from an offline installer.
|
|
9
9
|
|
|
10
10
|
Keep scripts and output files in the task workspace. The runtime contains shared read-only resources. Match the requested slide language and the supplied presentation's design when editing it.
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ Use `python-pptx` to inspect or modify an existing presentation. Inspect slide l
|
|
|
15
15
|
|
|
16
16
|
For a new deck, use `python-pptx` with editable text, tables, and charts. Use local image assets rather than network-dependent image URLs. Set slide dimensions, text sizes, and chart data explicitly.
|
|
17
17
|
|
|
18
|
-
A minimal editable deck, run with the
|
|
18
|
+
A minimal editable deck, run with the returned executable and all returned arguments:
|
|
19
19
|
|
|
20
20
|
```python
|
|
21
21
|
from pptx import Presentation
|
|
@@ -67,7 +67,7 @@ Render for requested images/PDFs or an actionable layout check. Before generatin
|
|
|
67
67
|
|
|
68
68
|
Use the `office_*` tools for every LibreOffice operation unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If a tool reports that the engine is not installed or fails, report that failure instead of substituting another executable.
|
|
69
69
|
|
|
70
|
-
`office_render` and `office_convert` run the engine
|
|
70
|
+
`office_render` and `office_convert` run the engine bundled for this machine from the task directory. Render slides directly:
|
|
71
71
|
|
|
72
72
|
```text
|
|
73
73
|
office_render({"path": "report.pptx", "outputDir": "preview-v1", "pages": "1,3,4", "dpi": 144})
|
|
@@ -5,7 +5,7 @@ description: Read, create, and modify Excel workbooks (.xlsx), including data, f
|
|
|
5
5
|
|
|
6
6
|
# Excel workbooks
|
|
7
7
|
|
|
8
|
-
Follow an explicit user or applicable AGENTS.md requirement for an environment or library. Otherwise call `office_python` and run its Python executable with
|
|
8
|
+
Follow an explicit user or applicable AGENTS.md requirement for an environment or library. Otherwise call `office_python` and run its Python executable with every returned `args` element followed by your script path; apply any returned `env` entries. These arguments load the isolated `openpyxl` and `pandas` libraries. Do not install packages or search for a system Python for the default workflow. If the tool reports missing or damaged bundled components, report that failure and direct the user to Settings → Plugins → Office → Check; restore the complete Ycodium installation from an offline installer.
|
|
9
9
|
|
|
10
10
|
Keep scripts, working files, and outputs in the task workspace. The runtime is a shared read-only resource. Save to a new workbook unless the user requests an in-place edit.
|
|
11
11
|
|
|
@@ -59,7 +59,7 @@ A successful command or image read does not prove that a preview contains workbo
|
|
|
59
59
|
|
|
60
60
|
Use the `office_*` tools for every LibreOffice operation unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If a tool reports that the engine is not installed or fails, report that failure instead of substituting another executable.
|
|
61
61
|
|
|
62
|
-
When recalculation, a requested export, or visual inspection is needed, `office_recalculate`, `office_convert`, and `office_render` run the engine
|
|
62
|
+
When recalculation, a requested export, or visual inspection is needed, `office_recalculate`, `office_convert`, and `office_render` run the engine bundled for this machine from the task directory. For worksheet rendering, select an exact sheet name and the relevant cell range:
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
office_render({"path": "report.xlsx", "outputDir": "preview-v1", "sheet": "Summary", "range": "A1:D20", "dpi": 144})
|
package/ui/ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/ui"];if(!p)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{PLUGIN_UI_BRIDGE_VERSION:
|
|
1
|
+
var p=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/ui"];if(!p)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{HOST_TEAM_VIEW_PREFIX:h,PLUGIN_UI_BRIDGE_VERSION:E,PLUGIN_UI_FLOATING_VIEW_PROP:R,PLUGIN_UI_GLOBAL_KEY:P,PLUGIN_UI_HOST_CAPABILITIES:w,PLUGIN_UI_HOST_COMMAND_PALETTE_UNAVAILABLE_MESSAGE:T,PLUGIN_UI_HOST_UPGRADE_MESSAGE:x,TEAM_VIEW_KEY_PATTERN:S,communicationRecordStage:U,defineTeamView:v,isTeamViewKey:N,pluginUiHostHasCapability:c}=p;var y=/^- page (\S+): (.+?)(?: \((\d+)x(\d+)\))?$/u,f=/^Missing fonts \(substituted\): (.+)\.$/u,m=a=>{let e=[],s=null,d=[];for(let i of a.split(/\r?\n/u)){let t=y.exec(i);if(t!==null){e.push({page:t[1],path:t[2],width:t[3]===void 0?null:Number(t[3]),height:t[4]===void 0?null:Number(t[4])});continue}i.startsWith("Warning:")&&(s=i);let n=f.exec(i);n!==null&&(d=n[1].split(", "))}return{pages:e,warning:s,missingFonts:d}};var I="render-result";function _(a){let e=a.react.createElement,s=c(a,"workspaceFileUrl");function d(n){let o=a.i18n.usePluginTranslation(),l=a.useWorkspaceFileUrl({environmentId:n.environmentId,threadId:n.threadId,path:n.page.path}),r=o("card.page",{page:n.page.page});return e("figure",{style:{margin:0,display:"flex",flexDirection:"column",gap:4,width:168}},l.status==="ready"?e("img",{src:l.url,alt:r,loading:"lazy",style:{width:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:6,background:"#fff"}}):e("div",{style:{height:120,display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed var(--border)",borderRadius:6,fontSize:12,color:"var(--muted-foreground)"}},l.status==="failed"?o("card.imageUnavailable"):o("card.loading")),e("figcaption",{style:{fontSize:12,color:"var(--muted-foreground)"}},r))}function i(n){return e("pre",{style:{margin:0,padding:8,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:12}},n.text)}function t(n){let o=a.i18n.usePluginTranslation(),l=n.details.output?.text??"",r=m(l),u=n.threadRef?.threadId;return!s||u===void 0||n.entry.displayFailed||r.pages.length===0?e(i,{text:l}):e("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:8}},r.warning===null?null:e("p",{role:"status",style:{margin:0,fontSize:12,color:"var(--destructive)"}},o("card.noCjkFont")),e("div",{style:{display:"flex",flexWrap:"wrap",gap:8}},...r.pages.map(g=>e(d,{key:g.path,environmentId:n.environmentId,threadId:u,page:g}))),r.missingFonts.length===0?null:e("p",{style:{margin:0,fontSize:12,color:"var(--muted-foreground)"}},o("card.missingFonts",{fonts:r.missingFonts.join(", ")})))}return{pages:{},panels:{},views:{[I]:t}}}export{I as RENDER_RESULT_VIEW,_ as default};
|