@openchamber/web 1.20.0 → 1.21.1

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 (174) hide show
  1. package/bin/cli.test.js +35 -0
  2. package/bin/lib/DOCUMENTATION.md +12 -0
  3. package/bin/lib/cli-settings-accessors.js +111 -0
  4. package/bin/lib/cli-settings-accessors.test.js +189 -0
  5. package/bin/lib/cli-startup.js +29 -9
  6. package/bin/lib/commands-connect-url.js +12 -14
  7. package/dist/assets/{CodeMirrorCommentWidgets-C36E738Y.js → CodeMirrorCommentWidgets-BGj8TJxW.js} +1 -1
  8. package/dist/assets/CommitSection-DwGiXyjf.js +1 -0
  9. package/dist/assets/DiffView-Db6bjVv1.js +4 -0
  10. package/dist/assets/FilesView-DQOa7Lgz.js +17 -0
  11. package/dist/assets/GitView-CHzJxTi0.js +6 -0
  12. package/dist/assets/{JsonTreeView-KnXFN2A-.js → JsonTreeView-CggOsLot.js} +1 -1
  13. package/dist/assets/MarkdownImageGallery-DoZpaHev.js +1 -0
  14. package/dist/assets/MarkdownRendererImpl-B5Y5xCOz.js +12 -0
  15. package/dist/assets/OnboardingScreen-C98d69Fp.js +1 -0
  16. package/dist/assets/{PatchDiff-BzVOVog8.js → PatchDiff-DJYMUiXA.js} +1 -1
  17. package/dist/assets/PierreDiffViewer-CY2bx_SB.js +157 -0
  18. package/dist/assets/PlanView-PkiOY_9H.js +5 -0
  19. package/dist/assets/SettingsView-D-K3ELCM.js +28 -0
  20. package/dist/assets/SettingsWindow-oyOm2fHR.js +1 -0
  21. package/dist/assets/{ToolOutputDialog-BB1c--Zr.js → ToolOutputDialog-lKyeQTPL.js} +6 -6
  22. package/dist/assets/{ToolPartDiffPreview-DaOIDISD.js → ToolPartDiffPreview-C7kBQNAA.js} +2 -2
  23. package/dist/assets/{VirtualizedFileDiff-lESMT-2b.js → VirtualizedFileDiff-BP7ebDFF.js} +4 -4
  24. package/dist/assets/{Virtualizer-X_7XPoTH.js → Virtualizer-CZlLSacm.js} +1 -1
  25. package/dist/assets/Virtualizer-D_a8gKmg.js +1 -0
  26. package/dist/assets/{WalkthroughView-CaSYE0lw.js → WalkthroughView-MuJodAHD.js} +2 -2
  27. package/dist/assets/{computeVirtualFileMetrics-DkRR5b75.js → computeVirtualFileMetrics-CZ0xPeaT.js} +2 -2
  28. package/dist/assets/contextPanelEmbeddedChat-C9abMBTb.js +1 -0
  29. package/dist/assets/de-CEoCz3j6.js +9 -0
  30. package/dist/assets/es-DwyXCqaL.js +15 -0
  31. package/dist/assets/fr-CS7Csln9.js +13 -0
  32. package/dist/assets/index-CUKcHnUA.css +1 -0
  33. package/dist/assets/index-CaPAjwXQ.js +1 -0
  34. package/dist/assets/index-DIvDEKE-.js +7 -0
  35. package/dist/assets/{isDiffPlainText-BG53Ixxy.js → isDiffPlainText-ZBvDxhVB.js} +1 -1
  36. package/dist/assets/{isFilePlainText-BbV-39jl.js → isFilePlainText-DiLRrkJr.js} +1 -1
  37. package/dist/assets/ja-vnwqLcx6.js +15 -0
  38. package/dist/assets/ko-CXuSfZv5.js +15 -0
  39. package/dist/assets/main-D5RWr6sJ.js +2 -0
  40. package/dist/assets/main-DLlfDjQ_.js +926 -0
  41. package/dist/assets/{markdown-shiki.worker-CKGJ1J33.js → markdown-shiki.worker-D5fBU-lw.js} +5 -5
  42. package/dist/assets/markdownCore-CcTcLsQF.js +3 -0
  43. package/dist/assets/{miniChat-ldEghBLB.js → miniChat-CqR3icsk.js} +2 -2
  44. package/dist/assets/mobile-RN_UTTlB.js +2 -0
  45. package/dist/assets/{patchFileDiff-BcFaMtMu.js → patchFileDiff-CjRR5ESs.js} +1 -1
  46. package/dist/assets/pl-BJxry0Mi.js +15 -0
  47. package/dist/assets/pt-BR-DxLmkhdv.js +15 -0
  48. package/dist/assets/renderElectronMiniChatApp-1wC94fQK.js +2 -0
  49. package/dist/assets/renderMobileApp-ltva2Plg.js +25 -0
  50. package/dist/assets/runtimeEndpointReset-D6SmNZaP.js +15 -0
  51. package/dist/assets/scheduledTasksApi-mjMDet_H.js +1 -0
  52. package/dist/assets/{shikiHighlight-DCT2Sq_z.js → shikiHighlight-fGmFkxAM.js} +1 -1
  53. package/dist/assets/tr-5Mk_hQ2Q.js +6 -0
  54. package/dist/assets/uk-ClgQjmlw.js +15 -0
  55. package/dist/assets/{useAppFontEffects-B53Rb6m7.js → useAppFontEffects-KP8_yiGW.js} +176 -184
  56. package/dist/assets/useInlineCommentController-HIjtuhxD.js +2 -0
  57. package/dist/assets/useRootScrollLock-BSiQ5F75.js +1 -0
  58. package/dist/assets/{vendor-base-ui-DsHmyMwp.js → vendor-base-ui-BeMD8X_w.js} +1 -1
  59. package/dist/assets/{vendor-codemirror-language-data-vch3tJ4c.js → vendor-codemirror-language-data-DrTPkHl4.js} +2 -2
  60. package/dist/assets/{vendor-floating-ui-core-CXmKXOXc.js → vendor-floating-ui-core-PuGzNPnN.js} +1 -1
  61. package/dist/assets/{vendor-floating-ui-dom-WyXykhNi.js → vendor-floating-ui-dom-BTvzWks8.js} +1 -1
  62. package/dist/assets/{vendor-floating-ui-react-dom-DKpLs02S.js → vendor-floating-ui-react-dom-DxYCWdHj.js} +1 -1
  63. package/dist/assets/{vendor-floating-ui-utils-BzXdqYpP.js → vendor-floating-ui-utils-D6FqdtJt.js} +1 -1
  64. package/dist/assets/{vendor-framer-motion-CRSgBxjL.js → vendor-framer-motion-livSKyyV.js} +1 -1
  65. package/dist/assets/vendor-legendapp-list-gg7YLRW7.js +1 -0
  66. package/dist/assets/vendor-linkify-it-DZCzzDkK.js +1 -0
  67. package/dist/assets/vendor-marked-linkify-it-CXI_LHIE.js +1 -0
  68. package/dist/assets/{vendor-motion-dom-DJLgZh4Q.js → vendor-motion-dom-D_o3BTI3.js} +1 -1
  69. package/dist/assets/vendor-uc.micro-BAd0H0z4.js +1 -0
  70. package/dist/assets/vendor-zod-BLfBSgBh.js +39 -0
  71. package/dist/assets/{web-components-pcwCTWjC.js → web-components-DOXvU-tB.js} +4 -4
  72. package/dist/assets/zh-CN-Ba6y8H-i.js +15 -0
  73. package/dist/assets/zh-TW-Dv8yyhN1.js +15 -0
  74. package/dist/index.html +7 -7
  75. package/dist/mini-chat.html +5 -5
  76. package/dist/mobile.html +5 -5
  77. package/dist/site.webmanifest +1 -1
  78. package/dist/sw.js +1 -1
  79. package/package.json +4 -4
  80. package/public/site.webmanifest +1 -1
  81. package/server/index.js +10 -2
  82. package/server/lib/client-auth/pairing.js +8 -7
  83. package/server/lib/client-auth/pairing.test.js +5 -1
  84. package/server/lib/client-auth/remote-clients.js +9 -1
  85. package/server/lib/client-auth/remote-clients.test.js +17 -0
  86. package/server/lib/cloudflare-tunnel.js +1 -1
  87. package/server/lib/fs/DOCUMENTATION.md +1 -0
  88. package/server/lib/fs/routes.js +21 -0
  89. package/server/lib/fs/routes.test.js +89 -3
  90. package/server/lib/git/DOCUMENTATION.md +4 -3
  91. package/server/lib/git/service.js +128 -6
  92. package/server/lib/git/service.test.js +191 -1
  93. package/server/lib/github/pr-status.js +10 -1
  94. package/server/lib/markdown-image-grants/DOCUMENTATION.md +4 -0
  95. package/server/lib/markdown-image-grants/routes.js +3 -1
  96. package/server/lib/markdown-image-grants/routes.test.js +14 -0
  97. package/server/lib/openchamber-sessions/routes.js +4 -1
  98. package/server/lib/openchamber-sessions/routes.test.js +23 -0
  99. package/server/lib/opencode/env-runtime.js +17 -1
  100. package/server/lib/opencode/env-runtime.test.js +56 -0
  101. package/server/lib/opencode/lifecycle.js +48 -9
  102. package/server/lib/opencode/lifecycle.test.js +125 -1
  103. package/server/lib/opencode/managed-process-registry.d.ts +13 -0
  104. package/server/lib/opencode/managed-process-registry.js +213 -163
  105. package/server/lib/opencode/managed-process-registry.test.mjs +285 -0
  106. package/server/lib/opencode/project-directory-runtime.js +16 -11
  107. package/server/lib/opencode/project-directory-runtime.test.js +32 -12
  108. package/server/lib/opencode/pwa-manifest-routes.js +1 -1
  109. package/server/lib/opencode/routes-upgrade.test.js +96 -12
  110. package/server/lib/opencode/routes.js +53 -5
  111. package/server/lib/opencode/settings-helpers.js +3 -0
  112. package/server/lib/opencode/settings-helpers.test.js +10 -0
  113. package/server/lib/opencode/theme-runtime.js +1 -1
  114. package/server/lib/opencode/theme-runtime.test.js +129 -0
  115. package/server/lib/quota/DOCUMENTATION.md +19 -0
  116. package/server/lib/quota/providers/copilot.js +26 -10
  117. package/server/lib/quota/providers/copilot.test.js +78 -0
  118. package/server/lib/quota/providers/index.js +4 -18
  119. package/server/lib/relay/DOCUMENTATION.md +1 -1
  120. package/server/lib/relay/service.js +34 -2
  121. package/server/lib/relay/service.test.js +69 -0
  122. package/server/lib/session-goal/runtime.js +2 -1
  123. package/server/lib/session-goal/runtime.test.js +4 -2
  124. package/server/lib/small-model/DOCUMENTATION.md +11 -5
  125. package/server/lib/small-model/call.js +64 -20
  126. package/server/lib/small-model/call.test.js +184 -2
  127. package/server/lib/terminal/DOCUMENTATION.md +2 -0
  128. package/server/lib/terminal/runtime.js +29 -1
  129. package/server/lib/terminal/runtime.test.js +26 -0
  130. package/server/lib/tunnels/install-help.js +2 -2
  131. package/server/lib/tunnels/install-help.test.js +9 -0
  132. package/server/lib/ui-auth/ui-auth.js +2 -2
  133. package/server/lib/ui-auth/ui-auth.test.js +2 -2
  134. package/server/lib/walkthrough/languages.js +1 -0
  135. package/dist/assets/CommitSection-C-F3AX6D.js +0 -1
  136. package/dist/assets/DiagramEditor-BPECg1jS.js +0 -1
  137. package/dist/assets/DiagramView-D0YNMix8.js +0 -1
  138. package/dist/assets/DiffView-BHWaMYCC.js +0 -4
  139. package/dist/assets/FilesView-NMBCW2Tm.js +0 -14
  140. package/dist/assets/GitView-Rp8P1KEI.js +0 -6
  141. package/dist/assets/MarkdownImageGallery-BMn3mtor.js +0 -1
  142. package/dist/assets/MarkdownRendererImpl-kD6N03pH.js +0 -12
  143. package/dist/assets/OnboardingScreen-CenIeD4v.js +0 -1
  144. package/dist/assets/PierreDiffViewer-Dlby4XqT.js +0 -136
  145. package/dist/assets/PlanView-Czu1KMJa.js +0 -4
  146. package/dist/assets/SessionSwitcherDropdown-IETz58DB.js +0 -1
  147. package/dist/assets/SettingsView-B6vmuf-c.js +0 -28
  148. package/dist/assets/SettingsWindow-CauZpdD3.js +0 -1
  149. package/dist/assets/contextPanelEmbeddedChat-BEARQjgn.js +0 -1
  150. package/dist/assets/de-DFdX3ABv.js +0 -9
  151. package/dist/assets/es-iC-FKvV9.js +0 -15
  152. package/dist/assets/fr-BBbi_1AL.js +0 -13
  153. package/dist/assets/index-BiEgzzkg.js +0 -1
  154. package/dist/assets/index-Cwmuwk3V.js +0 -7
  155. package/dist/assets/index-GNm1wgUH.css +0 -1
  156. package/dist/assets/ja-DQLQJL2J.js +0 -15
  157. package/dist/assets/ko-BeElEB4Y.js +0 -15
  158. package/dist/assets/main-Dpzo18z7.js +0 -2
  159. package/dist/assets/main-WMjtYzJs.js +0 -921
  160. package/dist/assets/markdownCore--tDmyI_v.js +0 -2
  161. package/dist/assets/mobile-Dk-VGreF.js +0 -2
  162. package/dist/assets/pl-CLHt2_vV.js +0 -15
  163. package/dist/assets/pt-BR-C_MPUq7e.js +0 -15
  164. package/dist/assets/renderElectronMiniChatApp-DIgCOmXY.js +0 -2
  165. package/dist/assets/renderMobileApp-CDfHS5rr.js +0 -25
  166. package/dist/assets/runtimeEndpointReset-ovNbaZ-x.js +0 -15
  167. package/dist/assets/scheduledTasksApi-BFSlqgnG.js +0 -1
  168. package/dist/assets/uk-PhsC-c4-.js +0 -15
  169. package/dist/assets/useInlineCommentController-DSfrIBKT.js +0 -2
  170. package/dist/assets/vendor-zod-C9ioTTSo.js +0 -39
  171. package/dist/assets/zh-CN-wF-NOFHM.js +0 -15
  172. package/dist/assets/zh-TW-4m4-A7rT.js +0 -15
  173. package/server/lib/quota/providers/command-code.js +0 -90
  174. package/server/lib/quota/providers/command-code.test.js +0 -85
package/bin/cli.test.js CHANGED
@@ -43,6 +43,7 @@ import {
43
43
  resolveServeHost,
44
44
  resolveServeUiPassword,
45
45
  } from './cli.js';
46
+ import { buildWindowsStartupTaskCommand } from './lib/cli-startup.js';
46
47
 
47
48
  async function withTempOpenChamberDataDir(fn) {
48
49
  const previous = process.env.OPENCHAMBER_DATA_DIR;
@@ -1421,3 +1422,37 @@ describe('lifecycle commands with unmanaged explicit ports', () => {
1421
1422
  });
1422
1423
  });
1423
1424
  });
1425
+
1426
+ describe('Windows startup task command builder', () => {
1427
+ it('default-path length stays under 200 chars', () => {
1428
+ const cmd = buildWindowsStartupTaskCommand(
1429
+ 'C:\\Users\\test\\.config\\openchamber\\bin\\OpenChamber.ps1'
1430
+ );
1431
+ expect(cmd).toMatch(/^powershell\.exe -NoProfile -ExecutionPolicy Bypass -File /);
1432
+ expect(cmd.length).toBeLessThan(200);
1433
+ });
1434
+
1435
+ it('worst-case long path stays under 261-char Task Scheduler ceiling', () => {
1436
+ // Build a wrapper path >= 180 chars (simulates long OPENCHAMBER_DATA_DIR)
1437
+ // Overhead = 57 chars (prefix + closing quote), so max wrapper for <261 total is 203
1438
+ const longPath =
1439
+ 'C:\\Users\\' +
1440
+ 'a'.repeat(139) +
1441
+ '\\.config\\openchamber\\bin\\OpenChamber.ps1';
1442
+ expect(longPath.length).toBeGreaterThanOrEqual(180);
1443
+
1444
+ const cmd = buildWindowsStartupTaskCommand(longPath);
1445
+ expect(cmd.length).toBeLessThan(261);
1446
+ });
1447
+
1448
+ it('does NOT inline SetEnvironmentVariable (externalization invariant)', () => {
1449
+ const cmd = buildWindowsStartupTaskCommand('C:\\wrapper.ps1');
1450
+ expect(cmd).not.toContain('SetEnvironmentVariable');
1451
+ });
1452
+
1453
+ it('uses -File form, not -Command', () => {
1454
+ const cmd = buildWindowsStartupTaskCommand('C:\\wrapper.ps1');
1455
+ expect(cmd).toContain('-File ');
1456
+ expect(cmd).not.toContain('-Command ');
1457
+ });
1458
+ });
@@ -78,6 +78,18 @@ These modules hold reusable, non-presentational logic for commands.
78
78
  - `cli-paths.js`
79
79
  - Data, run, log, settings, tunnel profile, and managed-local config paths.
80
80
 
81
+ - `cli-settings-accessors.js`
82
+ - Minimal settings.json read/write for CLI contexts that must not load the
83
+ full web settings runtime (`connect-url` relay identity resolution).
84
+ - Mirrors the settings runtime's guarantees so a CLI read-modify-write can
85
+ never corrupt shared state: atomic tmp+rename writes (no concurrent reader
86
+ in the running app can observe a torn file), a strict read that throws on
87
+ corrupt/unreadable payloads, and the same `0600` file mode.
88
+ - The strict read gates relay identity regeneration exactly like the server
89
+ runtime: a swallowed read failure can never mint a replacement signing or
90
+ encryption keypair, which would change `serverId` and orphan every paired
91
+ device and push binding.
92
+
81
93
  - `cli-process.js`
82
94
  - PID files, instance registry files, process identity checks, runtime metadata checks, and process termination helpers.
83
95
 
@@ -0,0 +1,111 @@
1
+ // Minimal settings.json access for CLI contexts (connect-url, pairing
2
+ // candidate building) that must not load the full web settings runtime.
3
+ //
4
+ // The running app already treats settings.json as a shared store — the relay
5
+ // identity, tunnels, notifications, the Electron main, and ssh-manager all
6
+ // read-modify-write it. This accessor must therefore mirror the settings
7
+ // runtime's guarantees or it will corrupt or regenerate shared state:
8
+ //
9
+ // - ATOMIC writes (write tmp, rename into place). A plain writeFile can
10
+ // interleave with a concurrent reader in the running app; the reader sees
11
+ // a half-written file, its lenient read maps it to `{}`, and relay
12
+ // identity logic then mints a NEW serverId — orphaning every paired
13
+ // device. The tmp+rename below means no reader can ever observe a partial
14
+ // file.
15
+ //
16
+ // - A STRICT read that THROWS on corrupt/unreadable payloads, gating relay
17
+ // identity regeneration. Only a genuinely missing file means "no
18
+ // settings"; any other failure (corrupt JSON, EACCES, transient I/O,
19
+ // non-object payload) must propagate so callers never confuse a broken
20
+ // read with first run and mint a replacement signing/encryption keypair.
21
+
22
+ export const createSettingsAccessors = ({ fsPromises, path, dataDir, settingsFileName }) => {
23
+ const settingsPath = path.join(dataDir, settingsFileName);
24
+
25
+ const readSettingsFromDiskMigrated = async () => {
26
+ try {
27
+ return JSON.parse(await fsPromises.readFile(settingsPath, 'utf8'));
28
+ } catch {
29
+ return {};
30
+ }
31
+ };
32
+
33
+ const readSettingsStrict = async () => {
34
+ let raw;
35
+ try {
36
+ raw = await fsPromises.readFile(settingsPath, 'utf8');
37
+ } catch (error) {
38
+ if (error && typeof error === 'object' && error.code === 'ENOENT') {
39
+ return {};
40
+ }
41
+ throw error;
42
+ }
43
+ const corruptSettingsError = (cause) =>
44
+ new Error(`Settings file is corrupt or unreadable: ${settingsPath} (fix or remove it, then retry)`, { cause });
45
+
46
+ let parsed;
47
+ try {
48
+ parsed = JSON.parse(raw);
49
+ } catch (error) {
50
+ throw corruptSettingsError(error);
51
+ }
52
+ if (!parsed || typeof parsed !== 'object') {
53
+ throw corruptSettingsError(new Error('non-object payload'));
54
+ }
55
+ return parsed;
56
+ };
57
+
58
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
59
+
60
+ const isTransientWindowsReplaceError = (error) => {
61
+ if (process.platform !== 'win32' || !error || typeof error !== 'object') {
62
+ return false;
63
+ }
64
+ return error.code === 'EPERM' || error.code === 'EACCES' || error.code === 'EBUSY';
65
+ };
66
+
67
+ const replaceFile = async (tmp, target) => {
68
+ const maxAttempts = process.platform === 'win32' ? 6 : 1;
69
+ let lastError = null;
70
+
71
+ for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
72
+ try {
73
+ await fsPromises.rename(tmp, target);
74
+ return;
75
+ } catch (error) {
76
+ lastError = error;
77
+ if (!isTransientWindowsReplaceError(error) || attempt === maxAttempts) {
78
+ break;
79
+ }
80
+ await sleep(25 * attempt);
81
+ }
82
+ }
83
+
84
+ if (!isTransientWindowsReplaceError(lastError)) {
85
+ throw lastError;
86
+ }
87
+
88
+ // Windows can transiently reject the atomic replace while another process
89
+ // briefly holds the target open. Fall back to copying the COMPLETE tmp file
90
+ // so persistence never wedges. Note: copyFile is NOT atomic — this is a
91
+ // last-resort path confined to Windows, matching the settings runtime's
92
+ // fallback, not a substitute for the atomic rename used everywhere else.
93
+ await fsPromises.copyFile(tmp, target);
94
+ await fsPromises.rm(tmp, { force: true });
95
+ };
96
+
97
+ const writeSettingsToDisk = async (settings) => {
98
+ await fsPromises.mkdir(path.dirname(settingsPath), { recursive: true });
99
+ const tmp = `${settingsPath}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
100
+ await fsPromises.writeFile(tmp, JSON.stringify(settings, null, 2), { encoding: 'utf8', mode: 0o600 });
101
+ if (process.platform !== 'win32') {
102
+ await fsPromises.chmod(tmp, 0o600);
103
+ }
104
+ await replaceFile(tmp, settingsPath);
105
+ if (process.platform !== 'win32') {
106
+ await fsPromises.chmod(settingsPath, 0o600);
107
+ }
108
+ };
109
+
110
+ return { readSettingsFromDiskMigrated, readSettingsStrict, writeSettingsToDisk };
111
+ };
@@ -0,0 +1,189 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import fs from 'fs';
3
+ import os from 'os';
4
+ import path from 'path';
5
+ import crypto from 'crypto';
6
+
7
+ import { createSettingsAccessors } from './cli-settings-accessors.js';
8
+ import { createRelayIdentityRuntime } from '../../server/lib/relay/identity.js';
9
+
10
+ const withTempDir = async (fn) => {
11
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'oc-settings-accessors-'));
12
+ try {
13
+ return await fn(dir);
14
+ } finally {
15
+ fs.rmSync(dir, { recursive: true, force: true });
16
+ }
17
+ };
18
+
19
+ const makeAccessors = (dir, overrides = {}) =>
20
+ createSettingsAccessors({
21
+ fsPromises: fs.promises,
22
+ path,
23
+ dataDir: dir,
24
+ settingsFileName: 'settings.json',
25
+ ...overrides,
26
+ });
27
+
28
+ // Wraps writeFile so each write lands in two chunks with a pause in between —
29
+ // a stand-in for a large, slow write on a real disk (one open handle, so the
30
+ // file grows from the prefix to the full payload). With a non-atomic writer a
31
+ // concurrent reader deterministically catches the half-written file in that
32
+ // window; with the atomic tmp+rename writer the target only ever changes via a
33
+ // complete rename, so the window is never observable.
34
+ const makeSlowWriteFs = () => {
35
+ const realFs = fs.promises;
36
+ const slowWriteFile = async (filePath, data) => {
37
+ const handle = await realFs.open(filePath, 'w');
38
+ try {
39
+ const half = Math.floor(data.length / 2);
40
+ await handle.writeFile(data.slice(0, half), 'utf8');
41
+ await new Promise((resolve) => setTimeout(resolve, 30));
42
+ await handle.writeFile(data.slice(half), 'utf8');
43
+ } finally {
44
+ await handle.close();
45
+ }
46
+ };
47
+ return { slowWriteFile, fsPromises: { ...realFs, writeFile: slowWriteFile } };
48
+ };
49
+
50
+ // Runs `writer` against filePath while a concurrent reader hammers it; returns
51
+ // how many times the reader observed an unparseable (torn) payload. ENOENT
52
+ // during the very first write is not a tear and is excluded.
53
+ const countTornReads = async (filePath, writer, iterations) => {
54
+ const big = { theme: 'dark', filler: 'x'.repeat(4096) };
55
+ let torn = 0;
56
+ let stop = false;
57
+ const reader = (async () => {
58
+ while (!stop) {
59
+ try {
60
+ const parsed = JSON.parse(await fs.promises.readFile(filePath, 'utf8'));
61
+ if (parsed && typeof parsed === 'object') {
62
+ expect(parsed.theme).toBe('dark');
63
+ }
64
+ } catch (error) {
65
+ if (error?.code !== 'ENOENT') {
66
+ torn += 1;
67
+ }
68
+ }
69
+ await new Promise((resolve) => setTimeout(resolve, 0));
70
+ }
71
+ })();
72
+ for (let i = 0; i < iterations; i += 1) {
73
+ await writer({ ...big, n: i });
74
+ }
75
+ stop = true;
76
+ await reader;
77
+ return torn;
78
+ };
79
+
80
+ describe('cli settings accessors', () => {
81
+ it('persists the full object atomically and cleans up its tmp file', async () => {
82
+ await withTempDir(async (dir) => {
83
+ const accessors = makeAccessors(dir);
84
+ await accessors.writeSettingsToDisk({ theme: 'dark', count: 3 });
85
+
86
+ const raw = JSON.parse(fs.readFileSync(path.join(dir, 'settings.json'), 'utf8'));
87
+ expect(raw).toEqual({ theme: 'dark', count: 3 });
88
+
89
+ const leftovers = fs.readdirSync(dir).filter((name) => name.startsWith('settings.json.tmp-'));
90
+ expect(leftovers).toEqual([]);
91
+ });
92
+ });
93
+
94
+ it('atomic writes: concurrent readers never observe a torn file, even under slow writes', async () => {
95
+ await withTempDir(async (dir) => {
96
+ const { fsPromises } = makeSlowWriteFs();
97
+ const accessors = makeAccessors(dir, { fsPromises });
98
+ const filePath = path.join(dir, 'settings.json');
99
+
100
+ // Each write is chunked with a pause, yet the reader must never see a
101
+ // partial payload: the target only changes via a complete atomic rename.
102
+ const torn = await countTornReads(filePath, (settings) => accessors.writeSettingsToDisk(settings), 20);
103
+ expect(torn).toBe(0);
104
+
105
+ const leftovers = fs.readdirSync(dir).filter((name) => name.startsWith('settings.json.tmp-'));
106
+ expect(leftovers).toEqual([]);
107
+ });
108
+ });
109
+
110
+ it('demonstrates the protected failure mode: a naive direct writer tears under the same slow write', async () => {
111
+ await withTempDir(async (dir) => {
112
+ const { slowWriteFile } = makeSlowWriteFs();
113
+ const filePath = path.join(dir, 'settings.json');
114
+
115
+ // The old CLI accessor wrote straight to settings.json with writeFile.
116
+ // The same slow-write load therefore MUST produce torn reads — proving
117
+ // the concurrency test above can actually fail on the pre-fix writer.
118
+ const torn = await countTornReads(
119
+ filePath,
120
+ (settings) => slowWriteFile(filePath, JSON.stringify(settings)),
121
+ 20,
122
+ );
123
+ expect(torn).toBeGreaterThan(0);
124
+ });
125
+ });
126
+
127
+ it('lenient read maps a corrupt file to {} for config lookup', async () => {
128
+ await withTempDir(async (dir) => {
129
+ const accessors = makeAccessors(dir);
130
+ fs.writeFileSync(path.join(dir, 'settings.json'), '{"unfinished": "trunc');
131
+ expect(await accessors.readSettingsFromDiskMigrated()).toEqual({});
132
+ });
133
+ });
134
+
135
+ it('strict read throws on a corrupt file instead of reporting "no settings"', async () => {
136
+ await withTempDir(async (dir) => {
137
+ const accessors = makeAccessors(dir);
138
+ fs.writeFileSync(path.join(dir, 'settings.json'), '{"unfinished": "trunc');
139
+ await expect(accessors.readSettingsStrict()).rejects.toThrow();
140
+ });
141
+ });
142
+
143
+ it('strict read throws on a non-object payload', async () => {
144
+ await withTempDir(async (dir) => {
145
+ const accessors = makeAccessors(dir);
146
+ fs.writeFileSync(path.join(dir, 'settings.json'), '"just a string"');
147
+ await expect(accessors.readSettingsStrict()).rejects.toThrow(/corrupt or unreadable/);
148
+ });
149
+ });
150
+
151
+ it('names the settings file in the strict read failure', async () => {
152
+ await withTempDir(async (dir) => {
153
+ const accessors = makeAccessors(dir);
154
+ const filePath = path.join(dir, 'settings.json');
155
+ fs.writeFileSync(filePath, '{"unfinished": "trunc');
156
+ await expect(accessors.readSettingsStrict()).rejects.toThrow(filePath);
157
+ });
158
+ });
159
+
160
+ it('strict read treats only a genuinely missing file as no settings', async () => {
161
+ await withTempDir(async (dir) => {
162
+ const accessors = makeAccessors(dir);
163
+ expect(await accessors.readSettingsStrict()).toEqual({});
164
+ });
165
+ });
166
+
167
+ it('does not regenerate the relay identity off a corrupt settings file', async () => {
168
+ await withTempDir(async (dir) => {
169
+ const accessors = makeAccessors(dir);
170
+ fs.writeFileSync(
171
+ path.join(dir, 'settings.json'),
172
+ JSON.stringify({
173
+ relaySigningKey: {
174
+ privateJwk: crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' }).privateKey.export({ format: 'jwk' }),
175
+ publicJwk: crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' }).publicKey.export({ format: 'jwk' }),
176
+ },
177
+ }),
178
+ );
179
+ const identity = await createRelayIdentityRuntime({ crypto, ...accessors }).getRelayIdentity();
180
+ const serverIdBefore = identity.serverId;
181
+
182
+ // Corrupt the file, then ask for the identity again: the strict gate must
183
+ // make this FAIL rather than mint a replacement keypair.
184
+ fs.writeFileSync(path.join(dir, 'settings.json'), '{"relaySigningKey": {"unfinished');
185
+ await expect(createRelayIdentityRuntime({ crypto, ...accessors }).getRelayIdentity()).rejects.toThrow();
186
+ expect(serverIdBefore).toBeTruthy();
187
+ });
188
+ });
189
+ });
@@ -74,6 +74,10 @@ function getMacosStartupWrapperPath() {
74
74
  return path.join(getDataDir(), 'bin', 'OpenChamber');
75
75
  }
76
76
 
77
+ function getWindowsStartupWrapperPath() {
78
+ return path.join(getDataDir(), 'bin', 'OpenChamber.ps1');
79
+ }
80
+
77
81
  function collectStartupEnv(options = {}) {
78
82
  const env = options.envSnapshot === false ? {} : Object.fromEntries(
79
83
  Object.entries(process.env)
@@ -189,6 +193,24 @@ exec ${startupShellQuote(process.execPath)} ${args}
189
193
  return wrapperPath;
190
194
  }
191
195
 
196
+ function writeWindowsStartupWrapper(options = {}) {
197
+ const wrapperPath = getWindowsStartupWrapperPath();
198
+ const envFilePath = getStartupEnvFilePath();
199
+ const startupArgs = buildStartupArgs(options).map(powershellQuote).join(' ');
200
+ const ps1Content = [
201
+ `$envFile=${powershellQuote(envFilePath)}`,
202
+ `if (Test-Path $envFile) { Get-Content $envFile | ForEach-Object { if ($_ -match '^([^=]+)=(.*)$') { $v=$matches[2]; if ($v.StartsWith("'") -and $v.EndsWith("'")) { $v=$v.Substring(1,$v.Length-2).Replace("'\\''","'") }; [Environment]::SetEnvironmentVariable($matches[1], $v, 'Process') } } }`,
203
+ `& ${powershellQuote(process.execPath)} ${startupArgs}`,
204
+ ].join('; ');
205
+ fs.mkdirSync(path.dirname(wrapperPath), { recursive: true, mode: 0o700 });
206
+ fs.writeFileSync(wrapperPath, ps1Content, { mode: 0o700 });
207
+ return wrapperPath;
208
+ }
209
+
210
+ function buildWindowsStartupTaskCommand(wrapperPath) {
211
+ return `powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${wrapperPath}"`;
212
+ }
213
+
192
214
  function buildMacosLaunchAgent(options = {}) {
193
215
  const wrapperPath = writeMacosStartupWrapper(options);
194
216
  const args = [wrapperPath];
@@ -318,21 +340,16 @@ function enableStartupService(options = {}) {
318
340
  return getStartupStatus();
319
341
  }
320
342
 
321
- const envFilePath = writeStartupEnvFile(options);
322
- const startupArgs = buildStartupArgs(options).map(powershellQuote).join(', ');
323
- const powerShellCommand = [
324
- `$envFile=${powershellQuote(envFilePath)}`,
325
- `if (Test-Path $envFile) { Get-Content $envFile | ForEach-Object { if ($_ -match '^([^=]+)=(.*)$') { $v=$matches[2]; if ($v.StartsWith("'") -and $v.EndsWith("'")) { $v=$v.Substring(1,$v.Length-2).Replace("'\\''","'") }; [Environment]::SetEnvironmentVariable($matches[1], $v, 'Process') } } }`,
326
- `& ${powershellQuote(process.execPath)} ${startupArgs}`,
327
- ].join('; ');
328
- const taskArgs = `powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "${powerShellCommand.replace(/"/g, '\\"')}"`;
343
+ writeStartupEnvFile(options);
344
+ const wrapperPath = writeWindowsStartupWrapper(options);
345
+ const taskCommand = buildWindowsStartupTaskCommand(wrapperPath);
329
346
  runStartupCommand('schtasks.exe', [
330
347
  '/Create',
331
348
  '/TN', STARTUP_SERVICE_ID,
332
349
  '/SC', 'ONLOGON',
333
350
  '/RL', 'LIMITED',
334
351
  '/F',
335
- '/TR', taskArgs,
352
+ '/TR', taskCommand,
336
353
  ]);
337
354
  runStartupCommand('schtasks.exe', ['/Run', '/TN', STARTUP_SERVICE_ID], { allowFailure: true });
338
355
  return getStartupStatus();
@@ -359,6 +376,8 @@ function disableStartupService() {
359
376
 
360
377
  runStartupCommand('schtasks.exe', ['/End', '/TN', STARTUP_SERVICE_ID], { allowFailure: true });
361
378
  runStartupCommand('schtasks.exe', ['/Delete', '/TN', STARTUP_SERVICE_ID, '/F'], { allowFailure: true });
379
+ try { fs.unlinkSync(getWindowsStartupWrapperPath()); } catch {}
380
+ removeStartupEnvFile();
362
381
  return getStartupStatus();
363
382
  }
364
383
 
@@ -367,4 +386,5 @@ export {
367
386
  getStartupStatus,
368
387
  enableStartupService,
369
388
  disableStartupService,
389
+ buildWindowsStartupTaskCommand,
370
390
  };
@@ -17,6 +17,7 @@ import { createClientPairingRuntime } from '../../server/lib/client-auth/pairing
17
17
  import { createRelayIdentityRuntime } from '../../server/lib/relay/identity.js';
18
18
  import { DEFAULT_RELAY_URL } from '../../server/lib/relay/service.js';
19
19
  import { bytesToBase64Url } from '../../server/lib/relay/e2ee.js';
20
+ import { createSettingsAccessors as createSettingsAccessorsModule } from './cli-settings-accessors.js';
20
21
  import {
21
22
  intro as clackIntro,
22
23
  outro as clackOutro,
@@ -28,7 +29,6 @@ import {
28
29
  } from '../cli-output.js';
29
30
 
30
31
  const REMOTE_CLIENTS_FILE_NAME = 'remote-clients.json';
31
- const SETTINGS_FILE_NAME = 'settings.json';
32
32
  const PAIRING_SESSIONS_FILE_NAME = 'client-pairing-sessions.json';
33
33
 
34
34
  function isValidRelayUrl(value) {
@@ -55,20 +55,18 @@ function resolveRelayUrl(settings) {
55
55
  // Minimal settings.json read/write for the relay identity runtime. It reads the
56
56
  // whole object and writes it back with the relay keys added, so other settings
57
57
  // are preserved. Enough for the CLI without wiring the full settings runtime.
58
+ //
59
+ // Mirrors the settings runtime's guarantees: atomic writes (tmp + rename) so
60
+ // concurrent readers in the running app never observe a half-written file, and
61
+ // a STRICT reader gating relay identity regeneration so a swallowed read
62
+ // failure can never mint a new serverId and orphan paired devices.
58
63
  function createSettingsAccessors() {
59
- const settingsPath = path.join(getOpenChamberDataDir(), SETTINGS_FILE_NAME);
60
- const readSettingsFromDiskMigrated = async () => {
61
- try {
62
- return JSON.parse(await fs.promises.readFile(settingsPath, 'utf8'));
63
- } catch {
64
- return {};
65
- }
66
- };
67
- const writeSettingsToDisk = async (settings) => {
68
- await fs.promises.mkdir(path.dirname(settingsPath), { recursive: true });
69
- await fs.promises.writeFile(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
70
- };
71
- return { readSettingsFromDiskMigrated, writeSettingsToDisk };
64
+ return createSettingsAccessorsModule({
65
+ fsPromises: fs.promises,
66
+ path,
67
+ dataDir: getOpenChamberDataDir(),
68
+ settingsFileName: 'settings.json',
69
+ });
72
70
  }
73
71
 
74
72
  // Resolves the instance's relay identity (serverId + encryption public key,
@@ -1 +1 @@
1
- import{j as a}from"./vendor-react-BUCujlKS.js";import{I as l,a as I}from"./useInlineCommentController-DSfrIBKT.js";function E(g){const{drafts:x,editingDraftId:d,commentText:o,onTextChange:r,selection:n,isDragging:u,fileLabel:s,newWidgetId:f,mapDraftToRange:p,onSave:m,onCancel:c,onEdit:C,onDelete:h}=g,t=[];for(const e of x){const i=p(e);if(e.id===d){t.push({afterLine:i.end,id:`edit-${e.id}`,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:i,isEditing:!0,onSave:m,onCancel:c},`edit-${e.id}`)});continue}t.push({afterLine:i.end,id:`card-${e.id}`,content:a.jsx(I,{draft:e,onEdit:()=>C(e),onDelete:()=>h(e)},`card-${e.id}`)})}if(n&&!d&&!u){const e={...n,start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)};t.push({afterLine:e.end,id:f,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:e,isEditing:!1,onSave:m,onCancel:c},f)})}return t}export{E as b};
1
+ import{j as a}from"./vendor-react-BUCujlKS.js";import{I as l,a as I}from"./useInlineCommentController-HIjtuhxD.js";function E(g){const{drafts:x,editingDraftId:d,commentText:o,onTextChange:r,selection:n,isDragging:u,fileLabel:s,newWidgetId:f,mapDraftToRange:p,onSave:m,onCancel:c,onEdit:C,onDelete:h}=g,t=[];for(const e of x){const i=p(e);if(e.id===d){t.push({afterLine:i.end,id:`edit-${e.id}`,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:i,isEditing:!0,onSave:m,onCancel:c},`edit-${e.id}`)});continue}t.push({afterLine:i.end,id:`card-${e.id}`,content:a.jsx(I,{draft:e,onEdit:()=>C(e),onDelete:()=>h(e)},`card-${e.id}`)})}if(n&&!d&&!u){const e={...n,start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)};t.push({afterLine:e.end,id:f,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:e,isEditing:!1,onSave:m,onCancel:c},f)})}return t}export{E as b};
@@ -0,0 +1 @@
1
+ import{R as S,f as oe,j as s}from"./vendor-react-BUCujlKS.js";import{u as Ae}from"./vendor-tanstack-react-virtual-g05Cx3z9.js";import{f as Q,ao as Ee,a6 as fe,a7 as me,I as R,a8 as ue,h as Z,B as J,a1 as ze,gV as Ie,bE as pe,bF as ge,bG as xe,bH as be,bI as ye,bJ as ve,bo as Te}from"./useAppFontEffects-KP8_yiGW.js";import{u as Ce}from"./index-DIvDEKE-.js";const ke={"?":{code:"?",color:"var(--status-info)",description:"Untracked file"},A:{code:"A",color:"var(--status-success)",description:"New file"},D:{code:"D",color:"var(--status-error)",description:"Deleted file"},R:{code:"R",color:"var(--status-info)",description:"Renamed file"},C:{code:"C",color:"var(--status-info)",description:"Copied file"},M:{code:"M",color:"var(--status-warning)",description:"Modified file"}},Me=ke.M;function He(p){const e=p.index?.trim(),t=p.working_dir?.trim();return e&&e!=="?"?e.charAt(0):t?t.charAt(0):e?.charAt(0)||t?.charAt(0)||"M"}function Re(p){const e=He(p);return ke[e]??Me}const Fe=S.memo(function(e){const t=oe.c(58),{file:o,actionLabel:x,actionSymbol:b,onAction:m,onViewDiff:f,onRevert:l,isReverting:d,stats:E,rowPaddingClassName:g,indentPx:y,actionAtStart:A,showRevert:F}=e,j=y===void 0?0:y,r=A===void 0?!1:A,w=F===void 0?!0:F;let N;t[0]!==o?(N=Re(o),t[0]=o,t[1]=N):N=t[1];const h=N,{t:z}=Q(),$=h.description,M=E?.insertions??0,C=E?.deletions??0;let D;t[2]!==m||t[3]!==f?(D=U=>{U.key===" "?(U.preventDefault(),m()):U.key==="Enter"&&(U.preventDefault(),f())},t[2]=m,t[3]=f,t[4]=D):D=t[4];const V=D;let I;t[5]!==m?(I=U=>{U.preventDefault(),U.stopPropagation(),m()},t[5]=m,t[6]=I):I=t[6];const u=I;let P;t[7]!==l?(P=U=>{U.preventDefault(),U.stopPropagation(),l()},t[7]=l,t[8]=P):P=t[8];const W=P;let L;t[9]!==x||t[10]!==b||t[11]!==u?(L=s.jsx("button",{type:"button",onClick:u,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":x,title:x,children:b}),t[9]=x,t[10]=b,t[11]=u,t[12]=L):L=t[12];const H=L,X=`group flex items-center gap-2 py-1.5 cursor-pointer ${g??"px-3"}`;let T;t[13]!==j?(T=j>0?{paddingLeft:`${j}px`}:void 0,t[13]=j,t[14]=T):T=t[14];const Y=r?H:null;let K;t[15]!==h.color?(K={color:h.color},t[15]=h.color,t[16]=K):K=t[16];let G;t[17]!==h.code||t[18]!==$||t[19]!==K?(G=s.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:K,title:$,"aria-label":$,children:h.code}),t[17]=h.code,t[18]=$,t[19]=K,t[20]=G):G=t[20];let O;t[21]!==o.path?(O=s.jsx(Ee,{filePath:o.path,className:"h-3.5 w-3.5 shrink-0"}),t[21]=o.path,t[22]=O):O=t[22];let B;if(t[23]!==o.path){e:{const U=o.path.lastIndexOf("/");if(U===-1){let ne;t[25]===Symbol.for("react.memo_cache_sentinel")?(ne={direction:"rtl",textAlign:"left",unicodeBidi:"plaintext"},t[25]=ne):ne=t[25],B=s.jsx("span",{className:"flex-1 min-w-0 truncate typography-ui-label text-foreground",style:ne,title:o.path,children:o.path});break e}const De=o.path.slice(0,U),Ve=o.path.slice(U);let te;t[26]===Symbol.for("react.memo_cache_sentinel")?(te={direction:"rtl",textAlign:"left",unicodeBidi:"plaintext"},t[26]=te):te=t[26];let se;t[27]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx("span",{className:"text-muted-foreground",children:"/"}),t[27]=se):se=t[27];const re=s.jsx("span",{className:"text-foreground",children:Ve.slice(1)});let ie;t[28]!==re?(ie=s.jsxs("span",{className:"flex-shrink-0 typography-ui-label",children:[se,re]}),t[28]=re,t[29]=ie):ie=t[29],B=s.jsxs("span",{className:"flex-1 min-w-0 flex items-baseline overflow-hidden",title:o.path,children:[s.jsx("span",{className:"min-w-0 truncate typography-ui-label text-muted-foreground",style:te,children:De}),ie]})}t[23]=o.path,t[24]=B}else B=t[24];let q;t[30]===Symbol.for("react.memo_cache_sentinel")?(q={color:"var(--status-success)"},t[30]=q):q=t[30];let i;t[31]!==M?(i=s.jsxs("span",{style:q,children:["+",M]}),t[31]=M,t[32]=i):i=t[32];let n,a;t[33]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),a={color:"var(--status-error)"},t[33]=n,t[34]=a):(n=t[33],a=t[34]);let c;t[35]!==C?(c=s.jsxs("span",{style:a,children:["-",C]}),t[35]=C,t[36]=c):c=t[36];let k;t[37]!==i||t[38]!==c?(k=s.jsxs("span",{className:"shrink-0 typography-micro",children:[i,n,c]}),t[37]=i,t[38]=c,t[39]=k):k=t[39];let v;t[40]!==o.path||t[41]!==W||t[42]!==d||t[43]!==w||t[44]!==z?(v=w?s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx("button",{type:"button",onClick:W,disabled:d,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50","aria-label":z("gitView.changes.revertFileAria",{path:o.path}),children:d?s.jsx(R,{name:"loader-4",className:"size-3.5 animate-spin"}):s.jsx(R,{name:"arrow-go-back",className:"size-3.5"})})}),s.jsx(ue,{sideOffset:8,children:z("gitView.changes.revertFileTooltip")})]}):null,t[40]=o.path,t[41]=W,t[42]=d,t[43]=w,t[44]=z,t[45]=v):v=t[45];const _=r?null:H;let ee;return t[46]!==V||t[47]!==f||t[48]!==T||t[49]!==Y||t[50]!==G||t[51]!==O||t[52]!==B||t[53]!==k||t[54]!==v||t[55]!==_||t[56]!==X?(ee=s.jsxs("div",{className:X,role:"button",tabIndex:0,onClick:f,onKeyDown:V,style:T,children:[Y,G,O,B,k,v,_]}),t[46]=V,t[47]=f,t[48]=T,t[49]=Y,t[50]=G,t[51]=O,t[52]=B,t[53]=k,t[54]=v,t[55]=_,t[56]=X,t[57]=ee):ee=t[57],ee}),je=14,Se=p=>p.replace(/\\/g,"/").replace(/^\/+/,"").trim(),we=(p,e)=>({id:`dir:${p}`,path:p,name:e,children:new Map,directFiles:[],files:[]}),$e=p=>{const e=we("","");for(const t of p){const o=Se(t.path);if(!o)continue;const b=o.split("/").filter(Boolean).slice(0,-1);let m=e;if(m.files.push(t),b.length>0){let f="";for(const l of b){f=f?`${f}/${l}`:l;const d=m.children.get(l);if(d){d.files.push(t),m=d;continue}const E=we(f,l);E.files.push(t),m.children.set(l,E),m=E}}m.directFiles.push(t)}return e},Pe=(p,e)=>{const t=[],o=(x,b)=>{const m=Array.from(x.children.values()).sort((l,d)=>l.path.localeCompare(d.path));for(const l of m)t.push({key:l.id,kind:"directory",depth:b,directory:l}),e.has(l.path)&&o(l,b+1);const f=[...x.directFiles].sort((l,d)=>l.path.localeCompare(d.path));for(const l of f)t.push({key:`file:${Se(l.path)}`,kind:"file",depth:b,file:l})};return o(p,0),t},Le=1e3,Ne=34,ce=30,le="pl-0 pr-2",de=(p,e)=>`${p} ${e}`,Ye=({groups:p,diffStats:e,revertingPaths:t,isRevertingAll:o=!1,headerBackgroundClassName:x="bg-sidebar",onVisiblePathsChange:b,onRevertAll:m,onRevertDirectory:f})=>{const{t:l}=Q(),d=S.useRef(null),g=Ce(i=>i.gitChangesViewMode)==="tree",y=S.useMemo(()=>p.filter(i=>i.entries.length>0),[p]),[A,F]=S.useState(new Set),[j,r]=S.useState(new Set),[w,N]=S.useState(!1),[h,z]=S.useState(null),$=S.useMemo(()=>y.map(i=>$e(i.entries)),[y]),M=S.useMemo(()=>{const i=[];return y.forEach((n,a)=>{Array.from($[a]?.children.values()??[]).forEach(c=>{i.push(de(n.id,c.path))})}),i},[$,y]);S.useEffect(()=>{g&&r(i=>{const n=new Set,a=new Set(M);return i.forEach(c=>{(c.slice(c.indexOf(" ")+1).includes("/")||a.has(c))&&n.add(c)}),M.forEach(c=>n.add(c)),n})},[g,M]);const C=S.useMemo(()=>{const i=[];return y.forEach((n,a)=>{if(i.push({type:"header",key:`header:${n.id}`,groupIndex:a}),!A.has(n.id)){if(g){const c=new Set;j.forEach(v=>{v.startsWith(`${n.id} `)&&c.add(v.slice(n.id.length+1))}),Pe($[a],c).forEach(v=>{v.kind==="file"?i.push({type:"file",key:`${n.id}:${v.key}`,groupIndex:a,file:v.file,depth:v.depth}):i.push({type:"directory",key:`${n.id}:${v.key}`,groupIndex:a,directory:v.directory,depth:v.depth})});return}n.entries.forEach(c=>{i.push({type:"file",key:`${n.id}:file:${c.path}`,groupIndex:a,file:c,depth:0})})}}),m&&y.length>0&&i.push({type:"revert-all",key:"revert-all"}),i},[A,j,g,m,$,y]),D=C.length,V=D>=Le,I=Ae({count:D,enabled:V,getScrollElement:()=>d.current,estimateSize:()=>Ne,overscan:12,getItemKey:i=>C[i]?.key??i}),u=I.getVirtualItems(),P=S.useMemo(()=>{if(!V)return 0;const i=d.current?.scrollTop??0;return u.find(a=>a.end>i)?.index??0},[V,u,d]);S.useEffect(()=>{if(!b)return;const i=n=>n&&n.type==="file"?n.file.path:null;if(D===0){b([]);return}if(!V){const n=[];for(const a of C)if(a.type==="file"&&(n.push(a.file.path),n.length>=ce))break;b(n);return}b(C.slice(P,P+Math.ceil((d.current?.clientHeight??0)/Ne)+ce).map(n=>i(n)).filter(n=>!!n).slice(0,ce))},[b,D,C,V,P]);const W=S.useCallback(i=>{F(n=>{const a=new Set(n);return a.has(i)?a.delete(i):a.add(i),a})},[]),L=S.useCallback((i,n)=>{r(a=>{const c=new Set(a),k=de(i,n);return c.has(k)?c.delete(k):c.add(k),c})},[]),H=S.useMemo(()=>{const i=new Set;return y.forEach(n=>n.entries.forEach(a=>i.add(a.path))),Array.from(i)},[y]),X=H.length,T=h?o||h.paths.some(i=>t.has(i)):!1,Y=S.useCallback(async()=>{!m||o||H.length===0||(await m(H),N(!1))},[H,o,m]),K=S.useCallback(async()=>{!f||!h||T||(await f(h.paths),z(null))},[T,f,h]),G=S.useCallback((i,n)=>{const a=A.has(i.id),c=i.entries.length;return s.jsxs("div",{className:Z("sticky top-0 z-10 flex items-center gap-2 py-2",x,le,!n&&"mt-1 border-t border-border/40"),children:[s.jsx("button",{type:"button",onClick:()=>i.onActionAll(i.entries.map(k=>k.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":i.actionAllLabel,title:i.actionAllLabel,children:i.actionSymbol}),s.jsxs("button",{type:"button",onClick:()=>W(i.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!a,children:[s.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:i.title}),s.jsx("span",{className:"typography-meta text-muted-foreground",children:c}),s.jsx(R,{name:"arrow-down-s",className:Z("size-3.5 shrink-0 text-muted-foreground transition-transform",a&&"-rotate-90")})]})]})},[A,x,W]),O=S.useCallback((i,n,a)=>{const c=j.has(de(i.id,n.path)),k=n.files.map(_=>_.path),v=o||k.some(_=>t.has(_));return s.jsxs("div",{className:Z("group flex items-center gap-2 py-1.5",le),style:{paddingLeft:`${a*je}px`},children:[s.jsxs("button",{type:"button",onClick:()=>L(i.id,n.path),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary","aria-label":c?l("gitView.changes.collapseDirectoryAria",{path:n.path}):l("gitView.changes.expandDirectoryAria",{path:n.path}),children:[c?s.jsx(R,{name:"folder-open-fill",className:"h-4 w-4 flex-shrink-0 text-primary/60"}):s.jsx(R,{name:"folder-3-fill",className:"h-4 w-4 flex-shrink-0 text-primary/60"}),s.jsx("span",{className:"min-w-0 flex-1 truncate typography-ui-label text-foreground",title:n.path,children:n.name}),s.jsx("span",{className:"ml-auto shrink-0 typography-micro text-muted-foreground",children:n.files.length})]}),i.showRevertActions!==!1&&f?s.jsx("button",{type:"button",onClick:()=>z({path:n.path,paths:k,count:k.length}),disabled:v,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":l("gitView.changes.revertDirectoryAria",{path:n.path}),title:l("gitView.changes.revertDirectoryTooltip"),children:v?s.jsx(R,{name:"loader-4",className:"size-3.5 animate-spin"}):s.jsx(R,{name:"arrow-go-back",className:"size-3.5"})}):null,s.jsx("button",{type:"button",onClick:()=>i.onActionAll(n.files.map(_=>_.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":l(i.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:n.path}),title:l(i.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:n.path}),children:i.actionSymbol})]})},[j,o,f,t,l,L]),B=S.useCallback((i,n)=>{if(i.type==="revert-all")return s.jsx("div",{className:Z("flex justify-end py-2",le),children:s.jsxs(J,{variant:"ghost",size:"sm",onClick:()=>N(!0),disabled:o,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[s.jsx(R,{name:"arrow-go-back",className:"size-3.5"}),l("gitView.changes.revertAll")]})});const a=y[i.groupIndex];if(!a)return null;if(i.type==="header")return G(a,n);if(i.type==="directory")return O(a,i.directory,i.depth);const c=i.file;return s.jsx(Fe,{file:c,actionLabel:a.getActionLabel(c.path),actionSymbol:a.actionSymbol,onAction:()=>a.onActionFile(c.path),stats:e?.[c.path],onViewDiff:()=>a.onViewDiff(c.path),onRevert:()=>a.onRevertFile(c.path),isReverting:t.has(c.path)||o,rowPaddingClassName:le,indentPx:i.depth*je,actionAtStart:!g,showRevert:a.showRevertActions!==!1})},[e,o,g,O,G,t,l,y]),q=S.useCallback(i=>{const n=C[i],a=C[i-1];return!n||!a||n.type!=="file"&&n.type!=="directory"||a.type!=="file"&&a.type!=="directory"?!1:a.groupIndex===n.groupIndex},[C]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[s.jsx(ze,{ref:d,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:V?s.jsx("div",{style:{height:I.getTotalSize(),position:"relative"},children:u.map(i=>{const n=C[i.index];return n?s.jsx("div",{"data-index":i.index,ref:I.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${i.start}px)`},className:Z(q(i.index)&&"before:pointer-events-none before:absolute before:left-0 before:right-2 before:top-0 before:border-t before:border-border/60"),children:B(n,i.index===0)},n.key):null})}):s.jsx("div",{role:"list","aria-label":l("gitView.changes.changedFilesAria"),children:C.map((i,n)=>s.jsx("div",{className:Z("relative",q(n)&&"before:pointer-events-none before:absolute before:left-0 before:right-2 before:top-0 before:border-t before:border-border/60"),children:B(i,n===0)},i.key))})}),s.jsx(Ie,{containerRef:d,disableHorizontal:!0})]}),s.jsx(pe,{open:w,onOpenChange:i=>{!o&&!i&&N(!1)},children:s.jsxs(ge,{className:"max-w-md",children:[s.jsxs(xe,{children:[s.jsx(be,{children:l("gitView.changes.revertAllDialogTitle")}),s.jsx(ye,{children:X===1?l("gitView.changes.revertAllDescriptionSingle",{count:X}):l("gitView.changes.revertAllDescriptionPlural",{count:X})})]}),s.jsxs(ve,{children:[s.jsx(J,{variant:"outline",size:"sm",onClick:()=>N(!1),disabled:o,children:l("gitView.common.cancel")}),s.jsx(J,{variant:"destructive",size:"sm",onClick:()=>{Y()},disabled:o,children:l(o?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),s.jsx(pe,{open:!!h,onOpenChange:i=>{!T&&!i&&z(null)},children:s.jsxs(ge,{className:"max-w-md",children:[s.jsxs(xe,{children:[s.jsx(be,{children:l("gitView.changes.revertDirectoryDialogTitle")}),s.jsx(ye,{children:h?h.count===1?l("gitView.changes.revertDirectoryDescriptionSingle",{count:h.count,path:h.path}):l("gitView.changes.revertDirectoryDescriptionPlural",{count:h.count,path:h.path}):null})]}),s.jsxs(ve,{children:[s.jsx(J,{variant:"outline",size:"sm",onClick:()=>z(null),disabled:T,children:l("gitView.common.cancel")}),s.jsx(J,{variant:"destructive",size:"sm",onClick:()=>{K()},disabled:T||!h,children:l(T?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},he=38,ae=200,Ge=p=>{const e=oe.c(23),{value:t,onChange:o,onSubmit:x,placeholder:b,disabled:m,hasTouchInput:f,isMobile:l}=p,d=m===void 0?!1:m,E=f===void 0?!1:f,g=l===void 0?!1:l,{t:y}=Q(),A=S.useRef(null),F=Ce(Oe);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const u=A.current;if(!u)return;const P=document.activeElement===u,W=()=>{u.style.height=`${he}px`;const H=u.scrollHeight,X=Math.min(Math.max(H,he),ae);u.style.height=`${X}px`,u.style.overflowY=H>ae?"auto":"hidden",H>ae&&!P&&(u.scrollTop=u.scrollHeight)};W();const L=window.requestAnimationFrame(W);return()=>{window.cancelAnimationFrame(L)}},e[0]=j):j=e[0];let r;e[1]!==t?(r=[t],e[1]=t,e[2]=r):r=e[2],S.useLayoutEffect(j,r);let w;e[3]!==o?(w=u=>o(u.target.value),e[3]=o,e[4]=w):w=e[4];let N;e[5]!==x?(N=u=>{u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.shiftKey&&!u.altKey&&(u.preventDefault(),x?.())},e[5]=x,e[6]=N):N=e[6];let h;e[7]!==b||e[8]!==y?(h=b??y("gitView.commit.messagePlaceholder"),e[7]=b,e[8]=y,e[9]=h):h=e[9];const z=E?"on":"off",$=E?"sentences":"off",M=g||F,C=d&&"opacity-50";let D;e[10]!==C?(D=Z("w-full rounded-lg border border-border/60 bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none transition-[border-color,box-shadow] duration-150","focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]",C),e[10]=C,e[11]=D):D=e[11];let V;e[12]===Symbol.for("react.memo_cache_sentinel")?(V={minHeight:he,maxHeight:ae},e[12]=V):V=e[12];let I;return e[13]!==d||e[14]!==$||e[15]!==M||e[16]!==D||e[17]!==w||e[18]!==N||e[19]!==h||e[20]!==z||e[21]!==t?(I=s.jsx("textarea",{ref:A,value:t,onChange:w,onKeyDown:N,placeholder:h,rows:1,disabled:d,autoCorrect:z,autoCapitalize:$,spellCheck:M,className:D,style:V}),e[13]=d,e[14]=$,e[15]=M,e[16]=D,e[17]=w,e[18]=N,e[19]=h,e[20]=z,e[21]=t,e[22]=I):I=e[22],I};function Oe(p){return p.inputSpellcheckEnabled}const Ke=p=>{const e=oe.c(30),{highlights:t,onInsert:o}=p,{t:x}=Q();if(t.length===0)return null;let b;e[0]!==t||e[1]!==o?(b=()=>{o(t)},e[0]=t,e[1]=o,e[2]=b):b=e[2];const m=b;let f;e[3]!==x?(f=x("gitView.commit.aiHighlights.title"),e[3]=x,e[4]=f):f=e[4];let l;e[5]!==f?(l=s.jsx("p",{className:"typography-micro text-muted-foreground",children:f}),e[5]=f,e[6]=l):l=e[6];let d;e[7]!==x?(d=x("gitView.commit.aiHighlights.insertAria"),e[7]=x,e[8]=d):d=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(R,{name:"arrow-down",className:"size-4"}),e[9]=E):E=e[9];let g;e[10]!==m||e[11]!==d?(g=s.jsx(me,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"icon",className:"size-6",onClick:m,"aria-label":d,children:E})}),e[10]=m,e[11]=d,e[12]=g):g=e[12];let y;e[13]!==x?(y=x("gitView.commit.aiHighlights.insertTooltip"),e[13]=x,e[14]=y):y=e[14];let A;e[15]!==y?(A=s.jsx(ue,{sideOffset:8,children:y}),e[15]=y,e[16]=A):A=e[16];let F;e[17]!==g||e[18]!==A?(F=s.jsxs(fe,{children:[g,A]}),e[17]=g,e[18]=A,e[19]=F):F=e[19];let j;e[20]!==l||e[21]!==F?(j=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l,F]}),e[20]=l,e[21]=F,e[22]=j):j=e[22];let r;e[23]!==t?(r=t.map(Be),e[23]=t,e[24]=r):r=e[24];let w;e[25]!==r?(w=s.jsx("ul",{className:"space-y-1",children:r}),e[25]=r,e[26]=w):w=e[26];let N;return e[27]!==j||e[28]!==w?(N=s.jsxs("div",{className:"space-y-2 rounded-xl border border-border/60 bg-transparent px-3 py-2",children:[j,w]}),e[27]=j,e[28]=w,e[29]=N):N=e[29],N};function Be(p,e){return s.jsx("li",{className:"typography-meta text-foreground",children:p},`${p}-${e}`)}const qe=p=>{const e=oe.c(80),{stagedCount:t,commitMessage:o,onCommitMessageChange:x,generatedHighlights:b,onInsertHighlights:m,onGenerateMessage:f,isGeneratingMessage:l,onCommit:d,onCommitAndPush:E,commitAction:g,hasPendingIndexMutation:y,gitmojiEnabled:A,onOpenGitmojiPicker:F}=p,j=y===void 0?!1:y,{t:r}=Q(),w=t>0;let N;e[0]!==g||e[1]!==o||e[2]!==j||e[3]!==w?(N=o.trim()&&w&&g===null&&!j,e[0]=g,e[1]=o,e[2]=j,e[3]=w,e[4]=N):N=e[4];const h=N,{isMobile:z,hasTouchInput:$}=Te();let M;e[5]!==r?(M=r("gitView.commit.title"),e[5]=r,e[6]=M):M=e[6];let C;e[7]!==M?(C=s.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:M}),e[7]=M,e[8]=C):C=e[8];let D;e[9]!==w||e[10]!==r?(D=w?null:s.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:r("gitView.commit.stageFilesHint")}),e[9]=w,e[10]=r,e[11]=D):D=e[11];let V;e[12]!==C||e[13]!==D?(V=s.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[C,D]}),e[12]=C,e[13]=D,e[14]=V):V=e[14];let I;e[15]!==b||e[16]!==m?(I=s.jsx(Ke,{highlights:b,onInsert:m}),e[15]=b,e[16]=m,e[17]=I):I=e[17];let u;e[18]!==h||e[19]!==l||e[20]!==d?(u=()=>{h&&!l&&d()},e[18]=h,e[19]=l,e[20]=d,e[21]=u):u=e[21];let P;e[22]!==r?(P=r("gitView.commit.messagePlaceholder"),e[22]=r,e[23]=P):P=e[23];const W=g!==null;let L;e[24]!==o||e[25]!==$||e[26]!==z||e[27]!==x||e[28]!==W||e[29]!==u||e[30]!==P?(L=s.jsx(Ge,{value:o,onChange:x,onSubmit:u,placeholder:P,disabled:W,hasTouchInput:$,isMobile:z}),e[24]=o,e[25]=$,e[26]=z,e[27]=x,e[28]=W,e[29]=u,e[30]=P,e[31]=L):L=e[31];let H;e[32]!==A||e[33]!==F||e[34]!==r?(H=A&&s.jsxs(J,{variant:"outline",size:"sm",onClick:F,className:"w-fit",type:"button",children:[s.jsx(R,{name:"emotion-happy",className:"size-4"}),r("gitView.commit.addGitmoji")]}),e[32]=A,e[33]=F,e[34]=r,e[35]=H):H=e[35];const X=l||g!==null||j||t===0;let T;e[36]!==r?(T=r("gitView.commit.generateAria"),e[36]=r,e[37]=T):T=e[37];let Y;e[38]!==l?(Y=l?s.jsx(R,{name:"loader-4",className:"size-4 animate-spin"}):s.jsx(R,{name:"ai-generate-2",className:"size-4 text-primary"}),e[38]=l,e[39]=Y):Y=e[39];let K;e[40]!==r?(K=r("gitView.commit.generate"),e[40]=r,e[41]=K):K=e[41];let G;e[42]!==K?(G=s.jsx("span",{className:"commit-actions__label",children:K}),e[42]=K,e[43]=G):G=e[43];let O;e[44]!==f||e[45]!==X||e[46]!==T||e[47]!==Y||e[48]!==G?(O=s.jsxs(J,{variant:"outline",size:"sm",onClick:f,disabled:X,type:"button","aria-label":T,className:"commit-actions__btn",children:[Y,G]}),e[44]=f,e[45]=X,e[46]=T,e[47]=Y,e[48]=G,e[49]=O):O=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"flex-1"}),e[50]=B):B=e[50];const q=!h||l;let i;e[51]!==r?(i=r("gitView.commit.commitAria"),e[51]=r,e[52]=i):i=e[52];let n;e[53]!==g||e[54]!==r?(n=g==="commit"?s.jsxs(s.Fragment,{children:[s.jsx(R,{name:"loader-4",className:"size-4 animate-spin"}),s.jsx("span",{className:"commit-actions__label",children:r("gitView.commit.committing")})]}):s.jsxs(s.Fragment,{children:[s.jsx(R,{name:"git-commit",className:"size-4"}),s.jsx("span",{className:"commit-actions__label",children:r("gitView.commit.commit")})]}),e[53]=g,e[54]=r,e[55]=n):n=e[55];let a;e[56]!==d||e[57]!==q||e[58]!==i||e[59]!==n?(a=s.jsx(J,{size:"sm",variant:"outline",onClick:d,disabled:q,className:"commit-actions__btn whitespace-nowrap","aria-label":i,children:n}),e[56]=d,e[57]=q,e[58]=i,e[59]=n,e[60]=a):a=e[60];let c;e[61]!==h||e[62]!==g||e[63]!==l||e[64]!==z||e[65]!==E||e[66]!==r?(c=z?s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx(J,{variant:"default",size:"sm",onClick:()=>E(),disabled:!h||l,className:"h-7 w-7 p-0","aria-label":r("gitView.commit.pushAria"),children:g==="commitAndPush"?s.jsx(R,{name:"loader-4",className:"size-4 animate-spin"}):s.jsx(R,{name:"arrow-up",className:"size-3.5"})})}),s.jsx(ue,{side:"top",children:s.jsx("p",{children:r("gitView.commit.push")})})]}):s.jsx(J,{size:"sm",variant:"default",onClick:()=>E(),disabled:!h||l,className:"commit-actions__btn","aria-label":r("gitView.commit.pushAria"),children:g==="commitAndPush"?s.jsxs(s.Fragment,{children:[s.jsx(R,{name:"loader-4",className:"size-4 animate-spin"}),s.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:r("gitView.commit.pushing")})]}):s.jsxs(s.Fragment,{children:[s.jsx(R,{name:"arrow-up",className:"size-3.5"}),s.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:r("gitView.commit.push")})]})}),e[61]=h,e[62]=g,e[63]=l,e[64]=z,e[65]=E,e[66]=r,e[67]=c):c=e[67];let k;e[68]!==O||e[69]!==a||e[70]!==c?(k=s.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[O,B,a,c]}),e[68]=O,e[69]=a,e[70]=c,e[71]=k):k=e[71];let v;e[72]!==L||e[73]!==H||e[74]!==k||e[75]!==I?(v=s.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[I,L,H,k]}),e[72]=L,e[73]=H,e[74]=k,e[75]=I,e[76]=v):v=e[76];let _;return e[77]!==v||e[78]!==V?(_=s.jsxs("section",{className:"border-0 bg-transparent rounded-none",children:[V,v]}),e[77]=v,e[78]=V,e[79]=_):_=e[79],_};export{Ye as C,qe as a};