zen-gitsync 2.16.1 → 2.16.3

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.
Files changed (85) hide show
  1. package/README.md +28 -3
  2. package/package.json +1 -1
  3. package/src/cli/ai/agent.js +181 -21
  4. package/src/cli/ai/agent.test.js +77 -1
  5. package/src/cli/ai/modelSetup.js +594 -0
  6. package/src/cli/ai/modelSetup.test.js +496 -0
  7. package/src/cli/ai/platformGuard.js +200 -0
  8. package/src/cli/ai/platformGuard.test.js +253 -0
  9. package/src/cli/ai/termui.js +135 -37
  10. package/src/cli/ai/termui.test.js +48 -8
  11. package/src/cli/ai/tools.js +8 -0
  12. package/src/gitCommit.js +484 -484
  13. package/src/ui/public/assets/AppVersionBadge-nwlsGMPO.js +2 -0
  14. package/src/ui/public/assets/BranchSelector-bUBqRWF2.js +1 -0
  15. package/src/ui/public/assets/CommitForm-DyHOStnk.js +6 -0
  16. package/src/ui/public/assets/CommonDialog-BA4xg5l3.js +1 -0
  17. package/src/ui/public/assets/EditorView-D939kLwW.js +0 -0
  18. package/src/ui/public/assets/{FlowExecutionViewer-CPblwVA1.js → FlowExecutionViewer-CZdF1f1e.js} +1 -1
  19. package/src/ui/public/assets/FlowOrchestrationWorkspace-BOn17akW.js +21 -0
  20. package/src/ui/public/assets/LogList-xk8W-v1F.js +15 -0
  21. package/src/ui/public/assets/{MindmapView-C_9P5ijq.js → MindmapView-CU3tXgbR.js} +1 -1
  22. package/src/ui/public/assets/MonitorView-CSAqU7oV.js +1 -0
  23. package/src/ui/public/assets/ProjectStartupButton-2By0-fuq.js +1 -0
  24. package/src/ui/public/assets/{RemoteRepoCard-C_cBtHcN.js → RemoteRepoCard-Cx5q9Yxb.js} +2 -2
  25. package/src/ui/public/assets/SourceMapView-uEieIRHF.js +3 -0
  26. package/src/ui/public/assets/{SvgIcon-C9YQSvGU.js → SvgIcon-BqWp2WS8.js} +1 -1
  27. package/src/ui/public/assets/UserInputNode-Ccnh0e-0.js +1 -0
  28. package/src/ui/public/assets/WorkbenchView-DBoFN37v.js +28 -0
  29. package/src/ui/public/assets/{_plugin-vue_export-helper-CHQqCylN.js → _plugin-vue_export-helper-BQRl7WAH.js} +1 -1
  30. package/src/ui/public/assets/configStore-BkxDLXGa.js +1 -0
  31. package/src/ui/public/assets/{css.worker-CvXBzhp8.js → css.worker-BKx7BC4h.js} +7 -7
  32. package/src/ui/public/assets/dagre-CTEVx1fc.js +1 -0
  33. package/src/ui/public/assets/editor.worker-DQJwLooG.js +26 -0
  34. package/src/ui/public/assets/element-plus-CQrjg9us.css +1 -0
  35. package/src/ui/public/assets/element-plus-DNnePjco.js +32 -0
  36. package/src/ui/public/assets/{flow-mindmap-CUvJaYn2.js → flow-mindmap-DRmzYE4F.js} +6 -6
  37. package/src/ui/public/assets/{html.worker-BO6WuOEO.js → html.worker-ChRLLxCa.js} +4 -4
  38. package/src/ui/public/assets/index-Dh9-lDzZ.js +68 -0
  39. package/src/ui/public/assets/{json.worker-BkJRGcCJ.js → json.worker-DR52qCex.js} +5 -5
  40. package/src/ui/public/assets/{monaco-BFLoT2VD.js → monaco-BvgtFLbw.js} +30 -30
  41. package/src/ui/public/assets/rolldown-runtime-DAXXjFlN.js +1 -0
  42. package/src/ui/public/assets/{socket-io-BSgn8Jx2.js → socket-io-pmu5tRPo.js} +1 -1
  43. package/src/ui/public/assets/{ts.worker-B0J26iPs.js → ts.worker-Cqvg7802.js} +18 -18
  44. package/src/ui/public/assets/{vendor-CU5NYUKJ.js → vendor-CcK8n8T4.js} +10 -10
  45. package/src/ui/public/assets/vue-flow-pAz--378.js +39 -0
  46. package/src/ui/public/favicon.svg +75 -75
  47. package/src/ui/public/index.html +30 -30
  48. package/src/ui/public/logo.svg +74 -74
  49. package/src/ui/server/.claude/codediff.txt +8 -0
  50. package/src/ui/server/middleware/requestLogger.js +53 -53
  51. package/src/ui/server/routes/branchStatus.js +105 -105
  52. package/src/ui/server/routes/fs.js +791 -791
  53. package/src/ui/server/routes/git/diff.js +426 -426
  54. package/src/ui/server/routes/git/diffUtils.js +149 -149
  55. package/src/ui/server/routes/git/stash.js +550 -550
  56. package/src/ui/server/routes/git/tags.js +176 -176
  57. package/src/ui/server/routes/git.js +181 -181
  58. package/src/ui/server/routes/gitOps.js +1255 -1255
  59. package/src/ui/server/routes/process.js +86 -86
  60. package/src/ui/server/routes/status.js +67 -67
  61. package/src/ui/server/routes/workbench/pdfText.js +145 -145
  62. package/src/ui/server/utils/createSavePortToFile.js +48 -48
  63. package/src/ui/server/utils/instanceRegistry.js +282 -282
  64. package/src/ui/server/utils/startServerOnAvailablePort.js +116 -116
  65. package/src/utils/index.js +1173 -1173
  66. package/src/ui/public/assets/AppVersionBadge-DJyfXR_Q.js +0 -2
  67. package/src/ui/public/assets/BranchSelector-ClnVPC0Q.js +0 -1
  68. package/src/ui/public/assets/CommitForm-BihM26_4.js +0 -6
  69. package/src/ui/public/assets/CommonDialog-CYoIF2fg.js +0 -1
  70. package/src/ui/public/assets/EditorView-DYJQT-Xj.js +0 -0
  71. package/src/ui/public/assets/FlowOrchestrationWorkspace-Cc-Tnhng.js +0 -21
  72. package/src/ui/public/assets/LogList-va6ANtbL.js +0 -15
  73. package/src/ui/public/assets/MonitorView-DRPECOVW.js +0 -1
  74. package/src/ui/public/assets/ProjectStartupButton-DSovbKPE.js +0 -1
  75. package/src/ui/public/assets/SourceMapView-ZiCL8mS8.js +0 -3
  76. package/src/ui/public/assets/UserInputNode-CR6o8zJG.js +0 -1
  77. package/src/ui/public/assets/WorkbenchView-CJJrBqBH.js +0 -28
  78. package/src/ui/public/assets/configStore-Bw9U4AHx.js +0 -1
  79. package/src/ui/public/assets/dagre-CWIGcX9d.js +0 -1
  80. package/src/ui/public/assets/editor.worker-Cn2oRESe.js +0 -26
  81. package/src/ui/public/assets/element-plus-CyGhXd7X.js +0 -25
  82. package/src/ui/public/assets/element-plus-D3Dn7nX0.css +0 -1
  83. package/src/ui/public/assets/index-BzNpkvm5.js +0 -68
  84. package/src/ui/public/assets/rolldown-runtime-CMxvf4Kt.js +0 -1
  85. package/src/ui/public/assets/vue-flow-CWmfpfPN.js +0 -39
@@ -1,176 +1,176 @@
1
- // Copyright 2026 xz333221
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- //
15
- import { asyncRoute, HttpError } from '../../utils/asyncRoute.js'
16
-
17
- import logger from '../../utils/logger.js'
18
-
19
- export function registerGitTagRoutes({ app, execGitCommand, clearCommandHistory }) {
20
- // ============ Git Tag 相关接口 ============
21
-
22
- // 创建标签
23
- app.post('/api/create-tag', asyncRoute(async (req, res) => {
24
- try {
25
- const { tagName, message, type, commit } = req.body;
26
-
27
- if (!tagName) {
28
- throw new HttpError(400, '缺少标签名称');
29
- }
30
-
31
- const tagArgs = ['tag'];
32
-
33
- if (type === 'annotated') {
34
- // 附注标签
35
- if (!message) {
36
- throw new HttpError(400, '附注标签需要提供说明信息');
37
- }
38
- tagArgs.push('-a', tagName, '-m', message);
39
- } else {
40
- // 轻量标签
41
- tagArgs.push(tagName);
42
- }
43
-
44
- // 如果指定了commit,添加到命令中
45
- if (commit && commit.trim()) {
46
- tagArgs.push(commit.trim());
47
- }
48
-
49
- const { stdout } = await execGitCommand(tagArgs);
50
-
51
- res.json({
52
- success: true,
53
- message: '标签创建成功',
54
- output: stdout
55
- });
56
- } catch (error) {
57
- logger.error('创建标签失败:', error);
58
- res.status(500).json({ success: false, error: error.message });
59
- }
60
- }));
61
-
62
- // 获取标签列表
63
- app.get('/api/list-tags', asyncRoute(async (req, res) => {
64
- try {
65
- // 使用 git tag -n --format 获取详细信息
66
- const { stdout } = await execGitCommand(
67
- ['tag', '-n', '--format=%(refname:short)|%(objectname:short)|%(creatordate:iso8601)|%(subject)']
68
- );
69
-
70
- if (!stdout.trim()) {
71
- return res.json({ success: true, tags: [] });
72
- }
73
-
74
- const tags = stdout.trim().split('\n').map(line => {
75
- const [name, commit, date, message] = line.split('|');
76
- return {
77
- name: name || '',
78
- commit: commit || '',
79
- date: date || '',
80
- message: message || '',
81
- type: 'lightweight' // 默认为轻量标签
82
- };
83
- });
84
-
85
- // 检测哪些是附注标签
86
- for (const tag of tags) {
87
- try {
88
- const { stdout: typeCheck } = await execGitCommand(
89
- ['cat-file', '-t', tag.name],
90
- { log: false }
91
- );
92
- if (typeCheck.trim() === 'tag') {
93
- tag.type = 'annotated';
94
- }
95
- } catch (error) {
96
- // 忽略错误,保持默认值
97
- }
98
- }
99
-
100
- res.json({ success: true, tags });
101
- } catch (error) {
102
- logger.error('获取标签列表失败:', error);
103
- res.status(500).json({ success: false, error: error.message });
104
- }
105
- }));
106
-
107
- // 推送标签到远程
108
- app.post('/api/push-tag', asyncRoute(async (req, res) => {
109
- try {
110
- const { tagName } = req.body;
111
-
112
- if (!tagName) {
113
- throw new HttpError(400, '缺少标签名称');
114
- }
115
-
116
- const { stdout } = await execGitCommand(['push', 'origin', tagName]);
117
-
118
- res.json({
119
- success: true,
120
- message: '标签推送成功',
121
- output: stdout
122
- });
123
- } catch (error) {
124
- logger.error('推送标签失败:', error);
125
- res.status(500).json({ success: false, error: error.message });
126
- }
127
- }));
128
-
129
- // 推送所有标签到远程
130
- app.post('/api/push-all-tags', asyncRoute(async (req, res) => {
131
- try {
132
- const { stdout } = await execGitCommand(['push', 'origin', '--tags']);
133
-
134
- res.json({
135
- success: true,
136
- message: '所有标签推送成功',
137
- output: stdout
138
- });
139
- } catch (error) {
140
- logger.error('推送所有标签失败:', error);
141
- res.status(500).json({ success: false, error: error.message });
142
- }
143
- }));
144
-
145
- // 删除标签
146
- app.post('/api/delete-tag', asyncRoute(async (req, res) => {
147
- try {
148
- const { tagName } = req.body;
149
-
150
- if (!tagName) {
151
- throw new HttpError(400, '缺少标签名称');
152
- }
153
-
154
- const { stdout } = await execGitCommand(['tag', '-d', tagName]);
155
-
156
- res.json({
157
- success: true,
158
- message: '标签删除成功',
159
- output: stdout
160
- });
161
- } catch (error) {
162
- logger.error('删除标签失败:', error);
163
- res.status(500).json({ success: false, error: error.message });
164
- }
165
- }));
166
-
167
- // 添加命令历史的清空API
168
- app.post('/api/clear-command-history', asyncRoute(async (req, res) => {
169
- try {
170
- const result = clearCommandHistory();
171
- res.json({ success: result });
172
- } catch (error) {
173
- res.status(500).json({ success: false, error: error.message });
174
- }
175
- }));
176
- }
1
+ // Copyright 2026 xz333221
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ import { asyncRoute, HttpError } from '../../utils/asyncRoute.js'
16
+
17
+ import logger from '../../utils/logger.js'
18
+
19
+ export function registerGitTagRoutes({ app, execGitCommand, clearCommandHistory }) {
20
+ // ============ Git Tag 相关接口 ============
21
+
22
+ // 创建标签
23
+ app.post('/api/create-tag', asyncRoute(async (req, res) => {
24
+ try {
25
+ const { tagName, message, type, commit } = req.body;
26
+
27
+ if (!tagName) {
28
+ throw new HttpError(400, '缺少标签名称');
29
+ }
30
+
31
+ const tagArgs = ['tag'];
32
+
33
+ if (type === 'annotated') {
34
+ // 附注标签
35
+ if (!message) {
36
+ throw new HttpError(400, '附注标签需要提供说明信息');
37
+ }
38
+ tagArgs.push('-a', tagName, '-m', message);
39
+ } else {
40
+ // 轻量标签
41
+ tagArgs.push(tagName);
42
+ }
43
+
44
+ // 如果指定了commit,添加到命令中
45
+ if (commit && commit.trim()) {
46
+ tagArgs.push(commit.trim());
47
+ }
48
+
49
+ const { stdout } = await execGitCommand(tagArgs);
50
+
51
+ res.json({
52
+ success: true,
53
+ message: '标签创建成功',
54
+ output: stdout
55
+ });
56
+ } catch (error) {
57
+ logger.error('创建标签失败:', error);
58
+ res.status(500).json({ success: false, error: error.message });
59
+ }
60
+ }));
61
+
62
+ // 获取标签列表
63
+ app.get('/api/list-tags', asyncRoute(async (req, res) => {
64
+ try {
65
+ // 使用 git tag -n --format 获取详细信息
66
+ const { stdout } = await execGitCommand(
67
+ ['tag', '-n', '--format=%(refname:short)|%(objectname:short)|%(creatordate:iso8601)|%(subject)']
68
+ );
69
+
70
+ if (!stdout.trim()) {
71
+ return res.json({ success: true, tags: [] });
72
+ }
73
+
74
+ const tags = stdout.trim().split('\n').map(line => {
75
+ const [name, commit, date, message] = line.split('|');
76
+ return {
77
+ name: name || '',
78
+ commit: commit || '',
79
+ date: date || '',
80
+ message: message || '',
81
+ type: 'lightweight' // 默认为轻量标签
82
+ };
83
+ });
84
+
85
+ // 检测哪些是附注标签
86
+ for (const tag of tags) {
87
+ try {
88
+ const { stdout: typeCheck } = await execGitCommand(
89
+ ['cat-file', '-t', tag.name],
90
+ { log: false }
91
+ );
92
+ if (typeCheck.trim() === 'tag') {
93
+ tag.type = 'annotated';
94
+ }
95
+ } catch (error) {
96
+ // 忽略错误,保持默认值
97
+ }
98
+ }
99
+
100
+ res.json({ success: true, tags });
101
+ } catch (error) {
102
+ logger.error('获取标签列表失败:', error);
103
+ res.status(500).json({ success: false, error: error.message });
104
+ }
105
+ }));
106
+
107
+ // 推送标签到远程
108
+ app.post('/api/push-tag', asyncRoute(async (req, res) => {
109
+ try {
110
+ const { tagName } = req.body;
111
+
112
+ if (!tagName) {
113
+ throw new HttpError(400, '缺少标签名称');
114
+ }
115
+
116
+ const { stdout } = await execGitCommand(['push', 'origin', tagName]);
117
+
118
+ res.json({
119
+ success: true,
120
+ message: '标签推送成功',
121
+ output: stdout
122
+ });
123
+ } catch (error) {
124
+ logger.error('推送标签失败:', error);
125
+ res.status(500).json({ success: false, error: error.message });
126
+ }
127
+ }));
128
+
129
+ // 推送所有标签到远程
130
+ app.post('/api/push-all-tags', asyncRoute(async (req, res) => {
131
+ try {
132
+ const { stdout } = await execGitCommand(['push', 'origin', '--tags']);
133
+
134
+ res.json({
135
+ success: true,
136
+ message: '所有标签推送成功',
137
+ output: stdout
138
+ });
139
+ } catch (error) {
140
+ logger.error('推送所有标签失败:', error);
141
+ res.status(500).json({ success: false, error: error.message });
142
+ }
143
+ }));
144
+
145
+ // 删除标签
146
+ app.post('/api/delete-tag', asyncRoute(async (req, res) => {
147
+ try {
148
+ const { tagName } = req.body;
149
+
150
+ if (!tagName) {
151
+ throw new HttpError(400, '缺少标签名称');
152
+ }
153
+
154
+ const { stdout } = await execGitCommand(['tag', '-d', tagName]);
155
+
156
+ res.json({
157
+ success: true,
158
+ message: '标签删除成功',
159
+ output: stdout
160
+ });
161
+ } catch (error) {
162
+ logger.error('删除标签失败:', error);
163
+ res.status(500).json({ success: false, error: error.message });
164
+ }
165
+ }));
166
+
167
+ // 添加命令历史的清空API
168
+ app.post('/api/clear-command-history', asyncRoute(async (req, res) => {
169
+ try {
170
+ const result = clearCommandHistory();
171
+ res.json({ success: result });
172
+ } catch (error) {
173
+ res.status(500).json({ success: false, error: error.message });
174
+ }
175
+ }));
176
+ }