zcode-pro 0.16.0__tar.gz
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.
- zcode_pro-0.16.0/.gitignore +7 -0
- zcode_pro-0.16.0/LICENSE +201 -0
- zcode_pro-0.16.0/PKG-INFO +45 -0
- zcode_pro-0.16.0/README.en.md +130 -0
- zcode_pro-0.16.0/README.md +130 -0
- zcode_pro-0.16.0/README_PYPI.md +25 -0
- zcode_pro-0.16.0/bin/zcode-pro +52 -0
- zcode_pro-0.16.0/bin/zcode-pro.cmd +24 -0
- zcode_pro-0.16.0/bin/zcode-pro.mjs +33 -0
- zcode_pro-0.16.0/bin/zcode-pro.vbs +16 -0
- zcode_pro-0.16.0/cli.mjs +9 -0
- zcode_pro-0.16.0/dist/inject.js +5821 -0
- zcode_pro-0.16.0/package.json +45 -0
- zcode_pro-0.16.0/pyproject.toml +60 -0
- zcode_pro-0.16.0/src/host/cdp.mjs +126 -0
- zcode_pro-0.16.0/src/host/helper.mjs +2134 -0
- zcode_pro-0.16.0/src/host/main.mjs +262 -0
- zcode_pro-0.16.0/src/host/paths.mjs +73 -0
- zcode_pro-0.16.0/src/host/pickFolder.mjs +152 -0
- zcode_pro-0.16.0/src/host/settings.mjs +61 -0
- zcode_pro-0.16.0/src/host/taskIndex.mjs +255 -0
- zcode_pro-0.16.0/src/host/taskOrder.mjs +117 -0
- zcode_pro-0.16.0/src/host/webdav.mjs +105 -0
- zcode_pro-0.16.0/src/inject/core.js +751 -0
- zcode_pro-0.16.0/src/inject/features/alias.js +211 -0
- zcode_pro-0.16.0/src/inject/features/copy-path.js +78 -0
- zcode_pro-0.16.0/src/inject/features/file-menu.js +147 -0
- zcode_pro-0.16.0/src/inject/features/idle-reclaim.js +179 -0
- zcode_pro-0.16.0/src/inject/features/image-menu.js +215 -0
- zcode_pro-0.16.0/src/inject/features/open-folder.js +43 -0
- zcode_pro-0.16.0/src/inject/features/pinned-collapse.js +132 -0
- zcode_pro-0.16.0/src/inject/features/pinned-expand.js +142 -0
- zcode_pro-0.16.0/src/inject/features/plugin-updates.js +28 -0
- zcode_pro-0.16.0/src/inject/features/project-menu.js +58 -0
- zcode_pro-0.16.0/src/inject/features/relocate-dialog.js +156 -0
- zcode_pro-0.16.0/src/inject/features/session-switch.js +244 -0
- zcode_pro-0.16.0/src/inject/features/settings-dialog.js +1503 -0
- zcode_pro-0.16.0/src/inject/features/settings-entry.js +21 -0
- zcode_pro-0.16.0/src/inject/features/styles.js +311 -0
- zcode_pro-0.16.0/src/inject/features/task-order.js +78 -0
- zcode_pro-0.16.0/src/inject/features/title-lock.js +242 -0
- zcode_pro-0.16.0/src/inject/features/toolbar-icons.js +243 -0
- zcode_pro-0.16.0/src/inject/features/ws-running.js +472 -0
- zcode_pro-0.16.0/src/inject/index.js +55 -0
- zcode_pro-0.16.0/src/inject/ui.js +734 -0
- zcode_pro-0.16.0/zcode_pro/__init__.py +3 -0
- zcode_pro-0.16.0/zcode_pro/__main__.py +4 -0
- zcode_pro-0.16.0/zcode_pro/cli.py +71 -0
zcode_pro-0.16.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 z
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: zcode-pro
|
|
3
|
+
Version: 0.16.0
|
|
4
|
+
Summary: ZCode Pro — ZCode 桌面版界面增强启动器(不修改客户端文件),核心功能:项目自定义别名
|
|
5
|
+
Project-URL: Homepage, https://github.com/duanluan/zcode-pro
|
|
6
|
+
Project-URL: Repository, https://github.com/duanluan/zcode-pro
|
|
7
|
+
Project-URL: Issues, https://github.com/duanluan/zcode-pro/issues
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: enhancement,launcher,zcode,zcode-pro
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# ZCode Pro
|
|
22
|
+
|
|
23
|
+
ZCode 桌面版界面增强工具,不修改客户端文件。核心功能:项目自定义别名。
|
|
24
|
+
|
|
25
|
+
## 安装
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pip install zcode-pro
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
前提:本机已安装 ZCode 桌面版(优先复用其自带的运行时,无需另装 Node.js);未安装 ZCode 时需要 Node.js >= 22。
|
|
32
|
+
|
|
33
|
+
也可以通过 npm 安装:`npm install -g zcode-pro`
|
|
34
|
+
|
|
35
|
+
## 使用
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
zcode-pro # 启动带增强的 ZCode
|
|
39
|
+
zcode-pro --help # 查看全部选项
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 链接
|
|
43
|
+
|
|
44
|
+
- 主页与文档:https://github.com/duanluan/zcode-pro
|
|
45
|
+
- 问题反馈:https://github.com/duanluan/zcode-pro/issues
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ZCode Pro
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
ZCode Pro enhances the ZCode desktop UI. No client files are modified; just launch via the ZCode Pro shortcut.
|
|
6
|
+
|
|
7
|
+
 
|
|
8
|
+
|
|
9
|
+
> **Opening settings: after launching ZCode Pro, right-click the settings button (gear) at the bottom of the ZCode sidebar to open the ZCode Pro settings window.**
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
12
|
+
|
|
13
|
+
| Feature | Description |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Custom project alias | Show a custom name for a project in the sidebar; UI-only, revert anytime |
|
|
16
|
+
| Switch project folder | Point a project at another folder; sidebar, tabs and task history follow. Stop running tasks before switching; historical checkpoints still reference the original path |
|
|
17
|
+
| Open folder / Copy path | Project "More" menu: open the project directory in the file manager, or copy its path |
|
|
18
|
+
| Session drag ordering | Reorder sessions in Pinned, Projects and Groups; persists across refreshes |
|
|
19
|
+
| Session quick switch | `alt+z` toggles between the current and the last session; hold `alt` and press `x` / `c` to pick from recent sessions, release `alt` to switch (like `alt+tab`) |
|
|
20
|
+
| Keep renamed session titles | Sessions you renamed keep their custom title; auto-generated titles no longer overwrite it in the sidebar |
|
|
21
|
+
| Running indicator on collapsed projects | Spins a collapsed project's icon while any of its sessions is still running; stops when they all finish |
|
|
22
|
+
| Idle project memory reclaim | Projects unused for a while with no running tasks release their memory automatically, and unused ones are reclaimed once after startup; sessions are untouched and reload when reopened (durations adjustable) |
|
|
23
|
+
| Sidebar menu in the top bar | Turns the sidebar menu (New task / Search / Automations / Plugin store) into icon buttons next to the top-bar arrows: hover shows the name, highlighted while its view is open, shortcuts still work |
|
|
24
|
+
| Collapsible Pinned section | The sidebar "Pinned" header collapses/expands its task list; the state is remembered |
|
|
25
|
+
| File menu actions | Adds "Open with default app" and "Reveal in file manager" to file links in chat |
|
|
26
|
+
| Copy image | Right-click an image in chat or the enlarged preview to copy it to the clipboard |
|
|
27
|
+
| UI style adjustments | Fine-tune paragraph spacing, content width, line heights, list/quote/table spacing and cell padding; focusing an input highlights the affected areas; applies instantly |
|
|
28
|
+
| Sidebar spacing | Fine-tune sidebar project spacing and task spacing; applies instantly |
|
|
29
|
+
| Font adjustment | Custom UI font (all interface text except the terminal), question font and answer font; applies instantly |
|
|
30
|
+
| Global prompt | Edit default instructions shared by all projects; applies to new sessions |
|
|
31
|
+
| Software proxy | Set an HTTP proxy for plugin updates/installs and tool upgrades, with connectivity test |
|
|
32
|
+
| Settings sync | Manually back up ZCode Pro settings and model settings to WebDAV, or restore them on a new computer; transfers only on click |
|
|
33
|
+
| Vision proxy | Automatically hand images to vision models for recognition when the main model cannot see them, and feed the descriptions to the main model; visual chain editor (zcode-vision plugin) |
|
|
34
|
+
| rtk compression | Manage rewrite hints and the command whitelist; check and upgrade the rtk program (rtk plugin) |
|
|
35
|
+
| Headroom | Manage compression device, power-save switching and proxy status; check and upgrade the headroom program (headroom plugin) |
|
|
36
|
+
| Plugin updates | Check and update zcode-plugins marketplace plugins in one click, optional auto-update on startup |
|
|
37
|
+
|
|
38
|
+
All features can be toggled or adjusted in the settings window.
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
Once installed, launch ZCode via the "ZCode Pro" shortcut in your app menu / Start menu, or the `zcode-pro` command in a terminal — the enhancements are enabled automatically in this mode; launching ZCode through its original entry does not load them. After launching, right-click the settings button at the bottom of the ZCode sidebar to open the ZCode Pro settings window.
|
|
43
|
+
|
|
44
|
+
### 🐧 Linux / macOS
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/duanluan/zcode-pro.git
|
|
48
|
+
cd zcode-pro && ./scripts/install.sh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Installs to `~/.local`; use `PREFIX=` to choose another location;
|
|
52
|
+
- On Linux, registers an app-menu shortcut "ZCode Pro" (icon reused from the installed ZCode);
|
|
53
|
+
- Do not use this script while the AUR package is installed (the script detects this and refuses): the user-level install would shadow the system-wide one;
|
|
54
|
+
- Uninstall: `./scripts/install.sh --uninstall`.
|
|
55
|
+
|
|
56
|
+
### 🪟 Windows
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
git clone https://github.com/duanluan/zcode-pro.git
|
|
60
|
+
cd zcode-pro
|
|
61
|
+
powershell -ExecutionPolicy Bypass -File scripts\install.ps1 # Start menu shortcut
|
|
62
|
+
powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Desktop # plus a desktop shortcut
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Installs to `%LOCALAPPDATA%\ZCodePro`; shortcuts launch silently without a console window;
|
|
66
|
+
- Uninstall: `powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Uninstall`.
|
|
67
|
+
|
|
68
|
+
### 📦 AUR (Arch / Manjaro)
|
|
69
|
+
|
|
70
|
+
Installs `/usr/bin/zcode-pro` and a system-level app-menu shortcut. Depends on the [zcode](https://aur.archlinux.org/packages/zcode) package from the AUR.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
yay -S zcode-pro
|
|
74
|
+
paru -S zcode-pro
|
|
75
|
+
# Manual installation
|
|
76
|
+
git clone https://aur.archlinux.org/zcode-pro.git && cd zcode-pro && makepkg -si
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If you previously installed via `install.sh`, run `./scripts/install.sh --uninstall` in that repository clone before switching to the AUR package. Leftover user-level files would keep shadowing the system-wide entry, and you would keep launching the old version.
|
|
80
|
+
|
|
81
|
+
### 🚀 Run without installing
|
|
82
|
+
|
|
83
|
+
No standalone Node.js required: when a system Node is missing, the runtime bundled with ZCode is used.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/duanluan/zcode-pro.git && cd zcode-pro
|
|
87
|
+
./bin/zcode-pro # Linux / macOS (auto-detects /opt/ZCode, /Applications/ZCode.app)
|
|
88
|
+
bin\zcode-pro.cmd # Windows (auto-detects %LOCALAPPDATA%\Programs\ZCode\ZCode.exe)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 📖 Reference
|
|
92
|
+
|
|
93
|
+
Command-line options (see `zcode-pro --help` for all):
|
|
94
|
+
|
|
95
|
+
| Option | Description |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `--cdp-port` | Debug port, default 9333 |
|
|
98
|
+
| `--helper-port` | Local helper port, default 47889 |
|
|
99
|
+
| `--zcode-path` | Explicit path to the ZCode executable |
|
|
100
|
+
| `--inject-only` | Attach to a running instance only; do not launch a new one |
|
|
101
|
+
| `--verbose` | Verbose logging |
|
|
102
|
+
|
|
103
|
+
Each option can also be overridden with a `ZCODEPRO_*` environment variable.
|
|
104
|
+
|
|
105
|
+
Configuration and data locations:
|
|
106
|
+
|
|
107
|
+
| Content | Location |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| Feature switches, aliases, software proxy | `~/.zcode/zcodepro.json` |
|
|
110
|
+
| Global prompt | `~/.zcode/AGENTS.md` |
|
|
111
|
+
| Vision proxy (zcode-vision plugin) | `~/.zcode/zcode-vision.json` |
|
|
112
|
+
| rtk compression (rtk plugin) | `~/.zcode-rtk/` |
|
|
113
|
+
| Headroom (headroom plugin) | `~/.zcode/headroom.json` |
|
|
114
|
+
|
|
115
|
+
After uninstalling, just start ZCode from the official entry; no system cleanup is needed.
|
|
116
|
+
|
|
117
|
+
## 🔌 Plugin recommendation
|
|
118
|
+
|
|
119
|
+
[duanluan/zcode-plugins](https://github.com/duanluan/zcode-plugins) is a companion plugin marketplace for ZCode: AI code review, request compression and command-output compression plugins that save tokens. To install: ZCode → Plugin Marketplace → "Add" (top right) → Add plugin marketplace, and enter `duanluan/zcode-plugins`. Installed plugins can be checked and updated from ZCode Pro settings.
|
|
120
|
+
|
|
121
|
+
## 💬 Community
|
|
122
|
+
|
|
123
|
+
- QQ group: **428403354** ([join](https://qm.qq.com/q/WXuISJK3ug))
|
|
124
|
+
- WeChat group: add **ai4only** on WeChat to be invited
|
|
125
|
+
|
|
126
|
+
<p>
|
|
127
|
+
<img src="assets/qq-group.png" width="200" alt="QQ group QR code" />
|
|
128
|
+
|
|
129
|
+
<img src="assets/wechat-ai4only.png" width="200" alt="WeChat QR code (ai4only)" />
|
|
130
|
+
</p>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ZCode Pro
|
|
2
|
+
|
|
3
|
+
[English](README.en.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
ZCode 桌面版界面增强工具。不修改客户端文件,通过 ZCode Pro 快捷方式启动即可。
|
|
6
|
+
|
|
7
|
+
 
|
|
8
|
+
|
|
9
|
+
> ⚙️ **打开设置:启动 ZCode Pro 后,右键点击 ZCode 侧边栏底部的设置按钮(齿轮)即可打开 ZCode Pro 设置窗口。**
|
|
10
|
+
|
|
11
|
+
## ✨ 功能
|
|
12
|
+
|
|
13
|
+
| 功能 | 说明 |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| 项目自定义别名 | 侧边栏显示自定义名称,仅界面显示,随时恢复 |
|
|
16
|
+
| 切换文件夹 | 将项目指向另一个文件夹,侧边栏、标签页与任务历史一并迁移;切换前建议先停止运行中的任务,历史检查点仍引用原路径 |
|
|
17
|
+
| 打开文件夹 / 复制路径 | 项目“更多”菜单:在系统文件管理器中打开项目目录,或复制项目路径 |
|
|
18
|
+
| 会话拖动排序 | 拖动置顶、项目与分组中的会话调整顺序,刷新后保持 |
|
|
19
|
+
| 会话快捷切换 | `alt+z` 在当前与上次会话间来回切换;按住 `alt` 按 `x` / `c` 弹出最近会话列表选择,松开 `alt` 切换(类 `alt+tab`) |
|
|
20
|
+
| 重命名会话名锁定 | 手动重命名过的会话不再被自动标题覆盖,侧栏始终显示重命名后的名字 |
|
|
21
|
+
| 折叠项目运行提示 | 折叠的项目里仍有会话在运行时,项目图标旋转提示,全部结束后恢复 |
|
|
22
|
+
| 空闲项目内存回收 | 长时间未使用且无任务运行的项目自动释放其占用的内存,启动后也会自动回收一次未使用的项目;会话记录不受影响,再次打开时自动恢复(时长可调) |
|
|
23
|
+
| 侧栏菜单并入顶栏 | “新建任务 / 搜索 / 自动化 / 插件市场”收成顶部导航栏的图标按钮:悬停显示名称,对应界面打开时高亮,快捷键照常可用 |
|
|
24
|
+
| 已置顶分区可折叠 | 侧边栏“已置顶”标题可点击折叠/展开其任务列表,状态记住 |
|
|
25
|
+
| 文件菜单增强 | 会话中文件链接的右键菜单新增“默认应用打开”“打开所在目录” |
|
|
26
|
+
| 复制图片 | 右键会话中的图片或放大的预览图,复制到剪贴板 |
|
|
27
|
+
| 界面样式调整 | 微调段落间距、内容宽度、各类行高、列表/引用块/表格间距与单元格边距;聚焦输入框时高亮预览受影响区域,即改即生效 |
|
|
28
|
+
| 侧栏间距调整 | 微调侧边栏项目间距与任务间距,即改即生效 |
|
|
29
|
+
| 字体调整 | 自定义界面字体(除终端外全部界面文字)、提问字体与回答字体,即改即生效 |
|
|
30
|
+
| 全局提示词 | 编辑所有项目共享的默认指令,新会话起生效 |
|
|
31
|
+
| 软件代理 | 为插件更新安装与本体升级设置 HTTP 代理,附连通性检测 |
|
|
32
|
+
| 设置同步 | 手动把 ZCode Pro 设置与模型设置备份到 WebDAV,或在新电脑上恢复;仅在点击时传输 |
|
|
33
|
+
| 视觉代理 | 主模型不识图时自动交给视觉模型识别图片,识别描述带给主模型;可视化编辑代理链(zcode-vision 插件) |
|
|
34
|
+
| rtk 压缩 | 管理改写提醒与命令白名单,rtk 本体检查更新与一键升级(rtk 插件) |
|
|
35
|
+
| Headroom | 管理压缩设备、省电切换与代理运行状态,headroom 本体检查更新与升级(headroom 插件) |
|
|
36
|
+
| 插件更新 | 一键检查并更新 zcode-plugins 市场插件,可选启动时自动更新 |
|
|
37
|
+
|
|
38
|
+
各项功能均可在设置弹窗中开关或调整。
|
|
39
|
+
|
|
40
|
+
## 📦 安装与使用
|
|
41
|
+
|
|
42
|
+
安装后,通过应用菜单 / 开始菜单中的“ZCode Pro”快捷方式或终端命令 `zcode-pro` 启动 ZCode,增强在该方式下自动生效;使用原有 ZCode 入口启动时不加载增强。
|
|
43
|
+
|
|
44
|
+
### 🐧 Linux / macOS
|
|
45
|
+
|
|
46
|
+
- 安装至 `~/.local`,可通过 `PREFIX=` 指定其他位置;
|
|
47
|
+
- Linux 会注册应用菜单快捷方式“ZCode Pro”(图标复用已安装的 ZCode);
|
|
48
|
+
- 已通过 AUR 安装时请勿再使用本脚本(脚本会检测并拒绝),用户级安装会遮蔽系统级入口;
|
|
49
|
+
- 卸载:`./scripts/install.sh --uninstall`。
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/duanluan/zcode-pro.git
|
|
53
|
+
cd zcode-pro && ./scripts/install.sh
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 🪟 Windows
|
|
57
|
+
|
|
58
|
+
- 程序安装至 `%LOCALAPPDATA%\ZCodePro`,快捷方式静默启动,不显示控制台窗口;
|
|
59
|
+
- 卸载:`powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Uninstall`。
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
git clone https://github.com/duanluan/zcode-pro.git
|
|
63
|
+
cd zcode-pro
|
|
64
|
+
powershell -ExecutionPolicy Bypass -File scripts\install.ps1 # 开始菜单快捷方式
|
|
65
|
+
powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Desktop # 加桌面快捷方式
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 📦 AUR
|
|
69
|
+
|
|
70
|
+
安装 `/usr/bin/zcode-pro` 与系统级应用菜单快捷方式,依赖 AUR 的 [zcode](https://aur.archlinux.org/packages/zcode) 包。
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
yay -S zcode-pro
|
|
74
|
+
paru -S zcode-pro
|
|
75
|
+
# 手动安装方式
|
|
76
|
+
git clone https://aur.archlinux.org/zcode-pro.git && cd zcode-pro && makepkg -si
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
从手动安装(`install.sh`)迁移到 AUR 前,请先在原仓库执行 `./scripts/install.sh --uninstall` 清理 `~/.local` 下的旧文件,再安装本包;否则旧的用户级快捷方式会一直遮蔽系统级入口,实际运行的仍是旧版本。
|
|
80
|
+
|
|
81
|
+
### 🚀 手动运行(不安装)
|
|
82
|
+
|
|
83
|
+
无需单独安装 Node.js:缺少系统 Node 时自动使用 ZCode 内置运行时。
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/duanluan/zcode-pro.git && cd zcode-pro
|
|
87
|
+
./bin/zcode-pro # Linux / macOS(自动探测 /opt/ZCode、/Applications/ZCode.app)
|
|
88
|
+
bin\zcode-pro.cmd # Windows(自动探测 %LOCALAPPDATA%\Programs\ZCode\ZCode.exe)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 📖 参考
|
|
92
|
+
|
|
93
|
+
命令行选项(`zcode-pro --help` 查看全部):
|
|
94
|
+
|
|
95
|
+
| 选项 | 说明 |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `--cdp-port` | 调试端口,默认 9333 |
|
|
98
|
+
| `--helper-port` | 本地辅助服务端口,默认 47889 |
|
|
99
|
+
| `--zcode-path` | 显式指定 ZCode 可执行文件 |
|
|
100
|
+
| `--inject-only` | 只接管已在运行的实例,不启动新实例 |
|
|
101
|
+
| `--verbose` | 详细日志 |
|
|
102
|
+
|
|
103
|
+
各选项也可用环境变量 `ZCODEPRO_*` 覆盖。
|
|
104
|
+
|
|
105
|
+
配置与数据位置:
|
|
106
|
+
|
|
107
|
+
| 内容 | 位置 |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| 功能开关、项目别名、软件代理 | `~/.zcode/zcodepro.json` |
|
|
110
|
+
| 全局提示词 | `~/.zcode/AGENTS.md` |
|
|
111
|
+
| 视觉代理(zcode-vision 插件) | `~/.zcode/zcode-vision.json` |
|
|
112
|
+
| rtk 压缩(rtk 插件) | `~/.zcode-rtk/` |
|
|
113
|
+
| Headroom(headroom 插件) | `~/.zcode/headroom.json` |
|
|
114
|
+
|
|
115
|
+
卸载后直接使用官方 ZCode 入口启动即可,无需清理系统位置。
|
|
116
|
+
|
|
117
|
+
## 🔌 插件推荐
|
|
118
|
+
|
|
119
|
+
[duanluan/zcode-plugins](https://github.com/duanluan/zcode-plugins) 是配套的 ZCode 插件市场,提供 AI 代码评审、对话请求压缩、命令输出压缩等插件,可显著节省 token。安装方式:ZCode → 插件市场 → 右上角“添加”→ 添加插件市场,填写 `duanluan/zcode-plugins`。已安装的插件可在 ZCode Pro 设置中一键检查并更新。
|
|
120
|
+
|
|
121
|
+
## 💬 交流与反馈
|
|
122
|
+
|
|
123
|
+
- QQ 群:**428403354**([点击加入](https://qm.qq.com/q/WXuISJK3ug))
|
|
124
|
+
- 微信群:添加微信 **ai4only** 邀请进群
|
|
125
|
+
|
|
126
|
+
<p>
|
|
127
|
+
<img src="assets/qq-group.png" width="200" alt="QQ 群二维码" />
|
|
128
|
+
|
|
129
|
+
<img src="assets/wechat-ai4only.png" width="200" alt="微信二维码(ai4only)" />
|
|
130
|
+
</p>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ZCode Pro
|
|
2
|
+
|
|
3
|
+
ZCode 桌面版界面增强工具,不修改客户端文件。核心功能:项目自定义别名。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install zcode-pro
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
前提:本机已安装 ZCode 桌面版(优先复用其自带的运行时,无需另装 Node.js);未安装 ZCode 时需要 Node.js >= 22。
|
|
12
|
+
|
|
13
|
+
也可以通过 npm 安装:`npm install -g zcode-pro`
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
zcode-pro # 启动带增强的 ZCode
|
|
19
|
+
zcode-pro --help # 查看全部选项
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 链接
|
|
23
|
+
|
|
24
|
+
- 主页与文档:https://github.com/duanluan/zcode-pro
|
|
25
|
+
- 问题反馈:https://github.com/duanluan/zcode-pro/issues
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ZCode Pro 启动器(Linux / macOS)
|
|
3
|
+
# 优先用 ZCode 自带的 Node 运行时(ELECTRON_RUN_AS_NODE),无需安装 Node.js。
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# 解析符号链接得到脚本真实路径(如 /usr/bin/zcode-pro → /usr/lib/zcode-pro/bin/zcode-pro),
|
|
7
|
+
# 否则经 symlink 调用时 $0 目录不是安装目录,找不到 cli.mjs。
|
|
8
|
+
SELF=$(readlink -f -- "$0" 2>/dev/null || printf '%s' "$0")
|
|
9
|
+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$SELF")" && pwd)
|
|
10
|
+
APP_DIR=$(dirname -- "$SCRIPT_DIR")
|
|
11
|
+
ENTRY="$APP_DIR/cli.mjs"
|
|
12
|
+
|
|
13
|
+
# 系统级安装(AUR / PREFIX=/opt)时提醒清理 ~/.local 下的手动安装残留:
|
|
14
|
+
# 残留的同名快捷方式优先级更高、~/.local/bin 在 PATH 更靠前,会让菜单与终端一直运行旧版。
|
|
15
|
+
case "$APP_DIR" in
|
|
16
|
+
"$HOME"/*) ;; # 自身就是手动安装(默认装在 ~/.local),无需提醒
|
|
17
|
+
*)
|
|
18
|
+
if [ -e "$HOME/.local/share/zcode-pro" ] || [ -e "$HOME/.local/bin/zcode-pro" ] \
|
|
19
|
+
|| [ -e "$HOME/.local/share/applications/zcode-pro.desktop" ]; then
|
|
20
|
+
echo "[zcodepro] 检测到 ~/.local 下有旧版手动安装残留,可能遮蔽本命令与快捷方式(表现为一直运行旧版)。" >&2
|
|
21
|
+
echo " 清理:rm -f ~/.local/bin/zcode-pro ~/.local/share/applications/zcode-pro.desktop && rm -rf ~/.local/share/zcode-pro" >&2
|
|
22
|
+
fi
|
|
23
|
+
;;
|
|
24
|
+
esac
|
|
25
|
+
|
|
26
|
+
find_zcode_binary() {
|
|
27
|
+
if [ -n "$ZCODEPRO_ZCODE_PATH" ] && [ -x "$ZCODEPRO_ZCODE_PATH" ]; then
|
|
28
|
+
printf '%s' "$ZCODEPRO_ZCODE_PATH"
|
|
29
|
+
return 0
|
|
30
|
+
fi
|
|
31
|
+
for c in /opt/ZCode/zcode /usr/lib/zcode/zcode /usr/share/zcode/zcode /usr/local/ZCode/zcode \
|
|
32
|
+
"/Applications/ZCode.app/Contents/MacOS/ZCode" "$HOME/Applications/ZCode.app/Contents/MacOS/ZCode"; do
|
|
33
|
+
if [ -x "$c" ]; then
|
|
34
|
+
printf '%s' "$c"
|
|
35
|
+
return 0
|
|
36
|
+
fi
|
|
37
|
+
done
|
|
38
|
+
return 1
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# 优先用 ZCode 内置的 Node 运行时(版本恒与 ZCode 匹配,含 node:sqlite/全局 WebSocket),
|
|
42
|
+
# 避免系统 node 过旧(<22.5 缺 node:sqlite、<22 缺全局 WebSocket)时启动失败;
|
|
43
|
+
# 找不到 ZCode 可执行文件时才退回系统 node。
|
|
44
|
+
ZCODE_BIN=$(find_zcode_binary) || {
|
|
45
|
+
if command -v node >/dev/null 2>&1; then
|
|
46
|
+
exec node "$ENTRY" "$@"
|
|
47
|
+
fi
|
|
48
|
+
echo "[zcodepro] 未找到 node,也未找到 ZCode 可执行文件。请安装 Node.js >= 22 或设置 ZCODEPRO_ZCODE_PATH。" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
}
|
|
51
|
+
# 用 ZCode 内置的 Node 运行时执行启动器(ELECTRON_RUN_AS_NODE 使其表现为纯 Node)
|
|
52
|
+
ELECTRON_RUN_AS_NODE=1 exec "$ZCODE_BIN" "$ENTRY" "$@"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem ZCode Pro 启动器(Windows)
|
|
3
|
+
rem 优先用 ZCode 自带的 Node 运行时(ELECTRON_RUN_AS_NODE),无需安装 Node.js。
|
|
4
|
+
setlocal
|
|
5
|
+
set "SCRIPT_DIR=%~dp0"
|
|
6
|
+
set "APP_DIR=%SCRIPT_DIR%.."
|
|
7
|
+
set "ENTRY=%APP_DIR%\cli.mjs"
|
|
8
|
+
|
|
9
|
+
where node >nul 2>nul
|
|
10
|
+
if %errorlevel%==0 (
|
|
11
|
+
node "%ENTRY%" %*
|
|
12
|
+
exit /b %errorlevel%
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
set "ZCODE_BIN=%ZCODEPRO_ZCODE_PATH%"
|
|
16
|
+
if not exist "%ZCODE_BIN%" set "ZCODE_BIN=%LOCALAPPDATA%\Programs\ZCode\ZCode.exe"
|
|
17
|
+
if not exist "%ZCODE_BIN%" set "ZCODE_BIN=%PROGRAMFILES%\ZCode\ZCode.exe"
|
|
18
|
+
if not exist "%ZCODE_BIN%" (
|
|
19
|
+
echo [zcodepro] 未找到 node,也未找到 ZCode 可执行文件。请安装 Node.js ^>= 22 或设置 ZCODEPRO_ZCODE_PATH。 1>&2
|
|
20
|
+
exit /b 1
|
|
21
|
+
)
|
|
22
|
+
set "ELECTRON_RUN_AS_NODE=1"
|
|
23
|
+
"%ZCODE_BIN%" "%ENTRY%" %*
|
|
24
|
+
exit /b %errorlevel%
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ZCode Pro 启动器(npm 全局安装用,跨平台 Node 版;查找逻辑与 bin/zcode-pro shell 版一致)。
|
|
3
|
+
// 优先用 ZCode 自带的 Node 运行时(ELECTRON_RUN_AS_NODE),避免系统 node 过旧
|
|
4
|
+
// (<22.5 缺 node:sqlite、<22 缺全局 WebSocket)时启动失败;
|
|
5
|
+
// 找不到 ZCode 可执行文件时回退当前 node 进程(npm 环境必有 node)。
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const cliPath = fileURLToPath(new URL('../cli.mjs', import.meta.url));
|
|
10
|
+
const argv = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
async function runWithZcodeRuntime() {
|
|
13
|
+
const { resolveZcodeExecutable } = await import('../src/host/paths.mjs');
|
|
14
|
+
const zcodeBin = resolveZcodeExecutable('');
|
|
15
|
+
await new Promise((resolve, reject) => {
|
|
16
|
+
const child = spawn(zcodeBin, [cliPath, ...argv], {
|
|
17
|
+
stdio: 'inherit',
|
|
18
|
+
env: { ...process.env, ELECTRON_RUN_AS_NODE: '1' },
|
|
19
|
+
});
|
|
20
|
+
child.on('error', reject);
|
|
21
|
+
child.on('exit', (code, signal) => {
|
|
22
|
+
if (signal) process.kill(process.pid, signal);
|
|
23
|
+
else process.exit(code ?? 0);
|
|
24
|
+
});
|
|
25
|
+
resolve();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
await runWithZcodeRuntime();
|
|
31
|
+
} catch {
|
|
32
|
+
await import(cliPath);
|
|
33
|
+
}
|