zen-gitsync 2.15.13 → 2.15.15

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 (48) hide show
  1. package/package.json +1 -1
  2. package/src/gitCommit.js +475 -475
  3. package/src/ui/public/assets/{AppVersionBadge-Czb2XhRX.js → AppVersionBadge-GQ3KuYcA.js} +2 -2
  4. package/src/ui/public/assets/{BranchSelector-DhIaOQr1.js → BranchSelector-pByERTmE.js} +1 -1
  5. package/src/ui/public/assets/{CommitForm-J-7I_T7Q.js → CommitForm-FTWnezWM.js} +1 -1
  6. package/src/ui/public/assets/{ConsoleView-DnGC_BWt.js → ConsoleView-Cz8Kbv2B.js} +2 -2
  7. package/src/ui/public/assets/CustomCommandManager-B_538_Rl.js +1 -0
  8. package/src/ui/public/assets/{EditorView-C7k_9fJ1.js → EditorView-C8XfaRy8.js} +0 -0
  9. package/src/ui/public/assets/{FlowExecutionViewer-Bub6cWrD.js → FlowExecutionViewer-BP1VPfCc.js} +1 -1
  10. package/src/ui/public/assets/{FlowOrchestrationWorkspace-B2y1kvWu.js → FlowOrchestrationWorkspace-BIzPmrSM.js} +1 -1
  11. package/src/ui/public/assets/{LogList-BjUXL3en.js → LogList-CF2WHBg3.js} +1 -1
  12. package/src/ui/public/assets/{MindmapView-pZdhSMc0.js → MindmapView-B9THTunP.js} +1 -1
  13. package/src/ui/public/assets/{MonitorView-BPxt9j25.js → MonitorView-Bn2kuo-k.js} +1 -1
  14. package/src/ui/public/assets/{ProjectStartupButton-DuUwQLoV.js → ProjectStartupButton-alzFCbA8.js} +1 -1
  15. package/src/ui/public/assets/{RemoteRepoCard-B_zf7yXa.js → RemoteRepoCard-CST09-5R.js} +1 -1
  16. package/src/ui/public/assets/{SourceMapView-BVbAVn7J.js → SourceMapView-5KXD5N8g.js} +1 -1
  17. package/src/ui/public/assets/{SvgIcon-CHzSz422.js → SvgIcon-DHi6rLHA.js} +1 -1
  18. package/src/ui/public/assets/{TemplateManager-BUPIk312.js → TemplateManager-Bhx3Sj3S.js} +1 -1
  19. package/src/ui/public/assets/{UserInputNode-BjfAYCwj.js → UserInputNode-DnXwmvFk.js} +1 -1
  20. package/src/ui/public/assets/{WorkbenchView-DB5yI6VF.js → WorkbenchView-CvUl3dcs.js} +1 -1
  21. package/src/ui/public/assets/{_plugin-vue_export-helper-CY5V2Yw-.js → _plugin-vue_export-helper-CD0okgho.js} +1 -1
  22. package/src/ui/public/assets/{configStore-DZCQzF2K.js → configStore-4lXiK7lp.js} +1 -1
  23. package/src/ui/public/assets/flow-mindmap-D_E5GXGj.css +1 -0
  24. package/src/ui/public/assets/{flow-mindmap-DqAN96kZ.js → flow-mindmap-bw6t6Bk2.js} +44 -40
  25. package/src/ui/public/assets/{index-DLdrteA1.js → index-heq6RsAy.js} +3 -3
  26. package/src/ui/public/assets/{vendor-B61L5s7z.js → vendor-Buos_0nQ.js} +37 -37
  27. package/src/ui/public/favicon.svg +75 -75
  28. package/src/ui/public/index.html +22 -22
  29. package/src/ui/public/logo.svg +74 -74
  30. package/src/ui/server/middleware/requestLogger.js +53 -53
  31. package/src/ui/server/routes/branchStatus.js +105 -105
  32. package/src/ui/server/routes/fileOpen.js +310 -310
  33. package/src/ui/server/routes/fs.js +791 -791
  34. package/src/ui/server/routes/git/diff.js +426 -426
  35. package/src/ui/server/routes/git/diffUtils.js +149 -149
  36. package/src/ui/server/routes/git/stash.js +550 -550
  37. package/src/ui/server/routes/git/tags.js +176 -176
  38. package/src/ui/server/routes/git.js +181 -181
  39. package/src/ui/server/routes/gitOps.js +1211 -1211
  40. package/src/ui/server/routes/process.js +86 -86
  41. package/src/ui/server/routes/status.js +67 -67
  42. package/src/ui/server/utils/createSavePortToFile.js +48 -48
  43. package/src/ui/server/utils/instanceRegistry.js +282 -282
  44. package/src/ui/server/utils/startServerOnAvailablePort.js +116 -116
  45. package/src/utils/index.js +1168 -1168
  46. package/src/ui/public/assets/CustomCommandManager-B2fSOQpx.js +0 -1
  47. package/src/ui/public/assets/flow-mindmap-CkdwufVI.css +0 -1
  48. package/src/ui/server/.claude/codediff.txt +0 -8
@@ -1,105 +1,105 @@
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 registerBranchStatusRoutes({
20
- app,
21
- execGitCommand,
22
- getIsGitRepo,
23
- getBranchStatusCache,
24
- setBranchStatusCache,
25
- getRecentPushStatus,
26
- setRecentPushStatus
27
- }) {
28
- // 获取当前分支 - 直接读取,不缓存(git symbolic-ref 极快,<5ms)
29
- app.get('/api/branch', asyncRoute(async (req, res) => {
30
- try {
31
- const { stdout } = await execGitCommand(['symbolic-ref', '--short', 'HEAD']);
32
- res.json({ branch: stdout.trim() });
33
- } catch (error) {
34
- res.status(500).json({ error: error.message });
35
- }
36
- }));
37
-
38
- // 获取分支与远程的差异状态(领先/落后提交数)
39
- app.get('/api/branch-status', asyncRoute(async (req, res) => {
40
- try {
41
- if (!getIsGitRepo()) {
42
- return res.json({ hasUpstream: false, ahead: 0, behind: 0 });
43
- }
44
-
45
- const now = Date.now();
46
- const forceRefresh = req.query.force === 'true';
47
-
48
- const recentPushStatus = getRecentPushStatus();
49
- const branchStatusCache = getBranchStatusCache();
50
-
51
- // push 后10秒内直接返回同步状态
52
- if (recentPushStatus.justPushed &&
53
- (now - recentPushStatus.pushTime) < recentPushStatus.validDuration) {
54
- logger.info('检测到最近推送过,直接返回同步状态');
55
- return res.json({
56
- hasUpstream: true,
57
- upstreamBranch: branchStatusCache.upstreamBranch || 'origin/main',
58
- ahead: 0,
59
- behind: 0
60
- });
61
- }
62
-
63
- // 5秒缓存分支名,防止短时间内重复执行 git symbolic-ref / git rev-parse
64
- const branchInfoCacheValid = !forceRefresh &&
65
- branchStatusCache.currentBranch &&
66
- branchStatusCache.upstreamBranch &&
67
- (now - branchStatusCache.lastUpdate) < branchStatusCache.cacheTimeout;
68
-
69
- let currentBranch, upstreamBranch;
70
-
71
- if (branchInfoCacheValid) {
72
- currentBranch = branchStatusCache.currentBranch;
73
- upstreamBranch = branchStatusCache.upstreamBranch;
74
- logger.info(`使用5秒缓存的分支名: ${currentBranch} -> ${upstreamBranch}`);
75
- } else {
76
- // 直接读取,不再走5分钟长缓存
77
- const { stdout: branchOut } = await execGitCommand(['symbolic-ref', '--short', 'HEAD']);
78
- currentBranch = branchOut.trim();
79
-
80
- const { stdout: upstreamOut } = await execGitCommand(
81
- ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}'],
82
- { ignoreError: true }
83
- );
84
- upstreamBranch = upstreamOut.trim() || null;
85
-
86
- if (!upstreamBranch) {
87
- setBranchStatusCache({ currentBranch: null, upstreamBranch: null, lastUpdate: 0, cacheTimeout: 5000 });
88
- return res.json({ hasUpstream: false, ahead: 0, behind: 0 });
89
- }
90
-
91
- setBranchStatusCache({ currentBranch, upstreamBranch, lastUpdate: now, cacheTimeout: 5000 });
92
- }
93
-
94
- const { stdout: aheadBehindOutput } = await execGitCommand(
95
- ['rev-list', '--left-right', '--count', `${currentBranch}...${upstreamBranch}`]
96
- );
97
- const [ahead, behind] = aheadBehindOutput.trim().split('\t').map(Number);
98
-
99
- res.json({ hasUpstream: true, upstreamBranch, ahead, behind });
100
- } catch (error) {
101
- logger.error('获取分支状态失败:', error);
102
- res.status(500).json({ error: error.message });
103
- }
104
- }));
105
- }
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 registerBranchStatusRoutes({
20
+ app,
21
+ execGitCommand,
22
+ getIsGitRepo,
23
+ getBranchStatusCache,
24
+ setBranchStatusCache,
25
+ getRecentPushStatus,
26
+ setRecentPushStatus
27
+ }) {
28
+ // 获取当前分支 - 直接读取,不缓存(git symbolic-ref 极快,<5ms)
29
+ app.get('/api/branch', asyncRoute(async (req, res) => {
30
+ try {
31
+ const { stdout } = await execGitCommand(['symbolic-ref', '--short', 'HEAD']);
32
+ res.json({ branch: stdout.trim() });
33
+ } catch (error) {
34
+ res.status(500).json({ error: error.message });
35
+ }
36
+ }));
37
+
38
+ // 获取分支与远程的差异状态(领先/落后提交数)
39
+ app.get('/api/branch-status', asyncRoute(async (req, res) => {
40
+ try {
41
+ if (!getIsGitRepo()) {
42
+ return res.json({ hasUpstream: false, ahead: 0, behind: 0 });
43
+ }
44
+
45
+ const now = Date.now();
46
+ const forceRefresh = req.query.force === 'true';
47
+
48
+ const recentPushStatus = getRecentPushStatus();
49
+ const branchStatusCache = getBranchStatusCache();
50
+
51
+ // push 后10秒内直接返回同步状态
52
+ if (recentPushStatus.justPushed &&
53
+ (now - recentPushStatus.pushTime) < recentPushStatus.validDuration) {
54
+ logger.info('检测到最近推送过,直接返回同步状态');
55
+ return res.json({
56
+ hasUpstream: true,
57
+ upstreamBranch: branchStatusCache.upstreamBranch || 'origin/main',
58
+ ahead: 0,
59
+ behind: 0
60
+ });
61
+ }
62
+
63
+ // 5秒缓存分支名,防止短时间内重复执行 git symbolic-ref / git rev-parse
64
+ const branchInfoCacheValid = !forceRefresh &&
65
+ branchStatusCache.currentBranch &&
66
+ branchStatusCache.upstreamBranch &&
67
+ (now - branchStatusCache.lastUpdate) < branchStatusCache.cacheTimeout;
68
+
69
+ let currentBranch, upstreamBranch;
70
+
71
+ if (branchInfoCacheValid) {
72
+ currentBranch = branchStatusCache.currentBranch;
73
+ upstreamBranch = branchStatusCache.upstreamBranch;
74
+ logger.info(`使用5秒缓存的分支名: ${currentBranch} -> ${upstreamBranch}`);
75
+ } else {
76
+ // 直接读取,不再走5分钟长缓存
77
+ const { stdout: branchOut } = await execGitCommand(['symbolic-ref', '--short', 'HEAD']);
78
+ currentBranch = branchOut.trim();
79
+
80
+ const { stdout: upstreamOut } = await execGitCommand(
81
+ ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}'],
82
+ { ignoreError: true }
83
+ );
84
+ upstreamBranch = upstreamOut.trim() || null;
85
+
86
+ if (!upstreamBranch) {
87
+ setBranchStatusCache({ currentBranch: null, upstreamBranch: null, lastUpdate: 0, cacheTimeout: 5000 });
88
+ return res.json({ hasUpstream: false, ahead: 0, behind: 0 });
89
+ }
90
+
91
+ setBranchStatusCache({ currentBranch, upstreamBranch, lastUpdate: now, cacheTimeout: 5000 });
92
+ }
93
+
94
+ const { stdout: aheadBehindOutput } = await execGitCommand(
95
+ ['rev-list', '--left-right', '--count', `${currentBranch}...${upstreamBranch}`]
96
+ );
97
+ const [ahead, behind] = aheadBehindOutput.trim().split('\t').map(Number);
98
+
99
+ res.json({ hasUpstream: true, upstreamBranch, ahead, behind });
100
+ } catch (error) {
101
+ logger.error('获取分支状态失败:', error);
102
+ res.status(500).json({ error: error.message });
103
+ }
104
+ }));
105
+ }