zen-gitsync 2.11.11 → 2.11.12

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.
@@ -10,10 +10,10 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index-E1drpG4m.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-BWl1xzuJ.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/vendor-BtihdyTS.js">
15
15
  <link rel="stylesheet" crossorigin href="/assets/vendor-CeElb63i.css">
16
- <link rel="stylesheet" crossorigin href="/assets/index-DqUSf7QD.css">
16
+ <link rel="stylesheet" crossorigin href="/assets/index-BVWHnypR.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="app"></div>
@@ -726,7 +726,7 @@ export function registerConfigRoutes({
726
726
  }
727
727
  })
728
728
 
729
- // 保存 AI 模型配置
729
+ // 保存 AI 模型配置(models 是全局配置,存在配置文件顶层,跨项目共享)
730
730
  app.post('/api/config/save-models', express.json(), async (req, res) => {
731
731
  try {
732
732
  const { models } = req.body
@@ -937,6 +937,23 @@ export function registerGitOpsRoutes({
937
937
  }
938
938
  });
939
939
 
940
+ // 获取提交完整 diff(用于复制提交内容)
941
+ app.get('/api/commit-diff-full', async (req, res) => {
942
+ try {
943
+ const hash = req.query.hash;
944
+ if (!hash) {
945
+ return res.status(400).json({ success: false, error: '缺少提交哈希参数' });
946
+ }
947
+ const { stdout } = await execGitCommand(`git show ${hash}`);
948
+ // 限制最大 200KB 防止内容过大
949
+ const MAX = 200 * 1024;
950
+ const content = stdout.length > MAX ? stdout.slice(0, MAX) + '\n\n[内容过大,已截断]' : stdout;
951
+ res.json({ success: true, content });
952
+ } catch (error) {
953
+ res.status(500).json({ success: false, error: `获取提交内容失败: ${error.message}` });
954
+ }
955
+ });
956
+
940
957
  // 添加清理Git锁定文件的接口
941
958
  app.post('/api/remove-lock', async (req, res) => {
942
959
  try {