tide-commander 1.181.0 → 1.182.0

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 (151) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +21 -1
  3. package/dist/assets/{AudioPlayer-BAtnEqGO.js → AudioPlayer-BwhOjJ2c.js} +1 -1
  4. package/dist/assets/{BossLogsModal-DKPlKlOF.js → BossLogsModal-DAHZQ1pi.js} +1 -1
  5. package/dist/assets/BossSpawnModal-E7SGuXA2.js +1 -0
  6. package/dist/assets/ControlsModal-bAaYejMT.js +1 -0
  7. package/dist/assets/{DockerLogsModal-hn265l_A.js → DockerLogsModal-BJx8N4kK.js} +1 -1
  8. package/dist/assets/{EmbeddedEditor-Cj5jPNh6.js → EmbeddedEditor-Be-cO4-9.js} +1 -1
  9. package/dist/assets/{FcStdViewer-CFxBBNQq.js → FcStdViewer-DEwQ08Bb.js} +1 -1
  10. package/dist/assets/{GcodeViewer-3z7qkN29.js → GcodeViewer-ncf61wWb.js} +1 -1
  11. package/dist/assets/{GlbViewer-CaOGrb_f.js → GlbViewer-D12gmnGd.js} +1 -1
  12. package/dist/assets/{GmailOAuthSetup-Bk6jecTI.js → GmailOAuthSetup-C-GvDGQm.js} +1 -1
  13. package/dist/assets/{GoogleOAuthSetup-DVeeuuWe.js → GoogleOAuthSetup-BDjIAgur.js} +1 -1
  14. package/dist/assets/{IframeModal-wSJPMjiR.js → IframeModal-CCocGfa7.js} +1 -1
  15. package/dist/assets/{IntegrationsPanel-BorSz1f6.js → IntegrationsPanel-CBpaeiJG.js} +2 -2
  16. package/dist/assets/{LogViewerModal-Bc_8Tjwp.js → LogViewerModal-CaN7XU8z.js} +1 -1
  17. package/dist/assets/{MonitoringModal-_K-xK58O.js → MonitoringModal-I3nCNlbU.js} +1 -1
  18. package/dist/assets/{PM2LogsModal-RP5kh78y.js → PM2LogsModal-Bki_LCvj.js} +1 -1
  19. package/dist/assets/RestoreArchivedAreaModal-Ciy6t7et.js +1 -0
  20. package/dist/assets/{Scene2DCanvas-BD8gC5GG.js → Scene2DCanvas-DR56E5p7.js} +1 -1
  21. package/dist/assets/{SceneManager-B1FWKQrV.js → SceneManager-DKg8ugY_.js} +1 -1
  22. package/dist/assets/{SkillsPanel-B3sV8qgJ.js → SkillsPanel-C_dxzS6F.js} +2 -2
  23. package/dist/assets/{SlackMultiInstanceSetup-By9kD-7V.js → SlackMultiInstanceSetup-BwiTMMvL.js} +1 -1
  24. package/dist/assets/SpawnModal-DUMcIHoz.js +1 -0
  25. package/dist/assets/{StatisticsModal-k-Zow1Lc.js → StatisticsModal-BKXcBthy.js} +1 -1
  26. package/dist/assets/{StlViewer-CvwylgqD.js → StlViewer-DjdLvysP.js} +1 -1
  27. package/dist/assets/{SubordinateAssignmentModal-BgZoihF2.js → SubordinateAssignmentModal-Rl4cdHpe.js} +1 -1
  28. package/dist/assets/{ThreeAreaSelector-CBoLZACl.js → ThreeAreaSelector-C-9JJ1Hh.js} +1 -1
  29. package/dist/assets/{ThreeViewShortcuts-CwWPyQ1I.js → ThreeViewShortcuts-DL0Hmuj0.js} +1 -1
  30. package/dist/assets/{TriggerManagerPanel-8dCnF4zG.js → TriggerManagerPanel-BtCOoX1g.js} +1 -1
  31. package/dist/assets/{VideoPlayer-CFfNly_q.js → VideoPlayer-BoTr9gkT.js} +1 -1
  32. package/dist/assets/{WorkflowEditorPanel-DaoqmmDI.js → WorkflowEditorPanel-DlcSaDPD.js} +1 -1
  33. package/dist/assets/{abnfDiagram-VRR7QNED-AVCJRSGv.js → abnfDiagram-VRR7QNED-CEBRXYsw.js} +1 -1
  34. package/dist/assets/{arc-BozrtqGC.js → arc-COf9R405.js} +1 -1
  35. package/dist/assets/{architectureDiagram-ZJ3FMSHR-DIbqkKKH.js → architectureDiagram-ZJ3FMSHR-DGBRfu4B.js} +1 -1
  36. package/dist/assets/{area-logos-_xssrP4-.js → area-logos-BRuKyQ5J.js} +1 -1
  37. package/dist/assets/{blockDiagram-677ZJIJ3-cUooA8WG.js → blockDiagram-677ZJIJ3-CN0t4U2k.js} +1 -1
  38. package/dist/assets/{c4Diagram-LMCZKHZV-BN-pAlnh.js → c4Diagram-LMCZKHZV-Cq0IftW5.js} +1 -1
  39. package/dist/assets/channel-DF_pUJhw.js +1 -0
  40. package/dist/assets/{chunk-2Q5K7J3B-Df3QaYQM.js → chunk-2Q5K7J3B-adR2VoGA.js} +1 -1
  41. package/dist/assets/{chunk-32BRIVSS-eWsLMUAK.js → chunk-32BRIVSS-B6LCChZq.js} +1 -1
  42. package/dist/assets/{chunk-5VM5RSS4-D8L5MdGs.js → chunk-5VM5RSS4-CcH2c7y_.js} +1 -1
  43. package/dist/assets/{chunk-EX3LRPZG-D9F-m38t.js → chunk-EX3LRPZG-zBWa-mu2.js} +1 -1
  44. package/dist/assets/{chunk-JWPE2WC7-CTPQZilc.js → chunk-JWPE2WC7-DBQlYiWn.js} +1 -1
  45. package/dist/assets/{chunk-MOJQB5TN-BI5XLi89.js → chunk-MOJQB5TN-BjbsCplS.js} +1 -1
  46. package/dist/assets/{chunk-RYQCIY6F-aUw8CA0H.js → chunk-RYQCIY6F-B946ZxlN.js} +1 -1
  47. package/dist/assets/{chunk-V7JOEXUC-Bvn63xfp.js → chunk-V7JOEXUC-DEeYHnRT.js} +1 -1
  48. package/dist/assets/{chunk-VR4S4FIN-DuQCapS-.js → chunk-VR4S4FIN-B_QmrVGt.js} +1 -1
  49. package/dist/assets/{chunk-XXDRQBXY--Q2M75o8.js → chunk-XXDRQBXY-cgYh6YrW.js} +1 -1
  50. package/dist/assets/classDiagram-OUVF2IWQ-CeYNs9YM.js +1 -0
  51. package/dist/assets/classDiagram-v2-EOCWNBFH-CeYNs9YM.js +1 -0
  52. package/dist/assets/{cose-bilkent-JH36ORCC-CnOCRlHl.js → cose-bilkent-JH36ORCC-DJUmw0Ip.js} +1 -1
  53. package/dist/assets/{cynefin-VYW2F7L2-CVOENzFv.js → cynefin-VYW2F7L2-BUxR220i.js} +1 -1
  54. package/dist/assets/{cynefinDiagram-TSTJHNR4-BLe8BxZL.js → cynefinDiagram-TSTJHNR4-nYR1MwE2.js} +1 -1
  55. package/dist/assets/{dagre-VKFMJZFB-xtW7I5Nk.js → dagre-VKFMJZFB-A5VPim2l.js} +1 -1
  56. package/dist/assets/{diagram-FQU43EPY-BIr_QEk-.js → diagram-FQU43EPY-wdgwDoVg.js} +1 -1
  57. package/dist/assets/{diagram-G47NLZAW-BJd55qXW.js → diagram-G47NLZAW-CylyJQBQ.js} +1 -1
  58. package/dist/assets/{diagram-NH7WQ7WH-CZsKPct7.js → diagram-NH7WQ7WH-BOF1uKhH.js} +1 -1
  59. package/dist/assets/{diagram-OA4YK3LP-BaG39QNH.js → diagram-OA4YK3LP-B0B5zmh5.js} +1 -1
  60. package/dist/assets/{diagram-WEI45ONY-ShUVdCXz.js → diagram-WEI45ONY-vKP2IU9q.js} +1 -1
  61. package/dist/assets/{ebnfDiagram-CCIWWBDH-T9Sx10gP.js → ebnfDiagram-CCIWWBDH-DM8hIEJM.js} +1 -1
  62. package/dist/assets/{erDiagram-Q63AITRT-CwT0KHCH.js → erDiagram-Q63AITRT-iuRH3hWX.js} +1 -1
  63. package/dist/assets/{flowDiagram-23GEKE2U-DpfmSS0V.js → flowDiagram-23GEKE2U-CddCUoGB.js} +1 -1
  64. package/dist/assets/{ganttDiagram-NO4QXBWP-DFHqNARc.js → ganttDiagram-NO4QXBWP-CIfvQLcu.js} +1 -1
  65. package/dist/assets/{gitGraphDiagram-IHSO6WYX-DiG1nj1m.js → gitGraphDiagram-IHSO6WYX-CbW0FQci.js} +1 -1
  66. package/dist/assets/index-B4YklnOy.js +1 -0
  67. package/dist/assets/{index-CeUo--0k.js → index-BmD7ycmn.js} +1 -1
  68. package/dist/assets/{index-B8WCuK1N.js → index-CIcFjlRX.js} +2 -2
  69. package/dist/assets/{index-BMINDCB0.js → index-CRhUiTuD.js} +3 -3
  70. package/dist/assets/{index-COqQ_1sL.css → index-D1GfjaTN.css} +1 -1
  71. package/dist/assets/index-DHuT10Pa.js +1 -0
  72. package/dist/assets/{index-BmmzETKL.js → index-DoJdznbY.js} +5 -5
  73. package/dist/assets/index-Du8eK_OX.js +1 -0
  74. package/dist/assets/index-HYcYan1q.js +19 -0
  75. package/dist/assets/index-HhAZ3SIm.js +2 -0
  76. package/dist/assets/{infoDiagram-FWYZ7A6U-CT7RBQSN.js → infoDiagram-FWYZ7A6U-C0it9hLc.js} +1 -1
  77. package/dist/assets/{ishikawaDiagram-FXEZZL3T-Bv_eTPfi.js → ishikawaDiagram-FXEZZL3T-pKZnNgqp.js} +1 -1
  78. package/dist/assets/{journeyDiagram-5HDEW3XC-BwKya-ih.js → journeyDiagram-5HDEW3XC-Ib9FpXdB.js} +1 -1
  79. package/dist/assets/{kanban-definition-HUTT4EX6-VrWxcMn7.js → kanban-definition-HUTT4EX6-aOTfe6f6.js} +1 -1
  80. package/dist/assets/{linear-BsocX-C-.js → linear-B_ipWlyx.js} +1 -1
  81. package/dist/assets/main-Bvn8CMZc.css +1 -0
  82. package/dist/assets/{main-B9DphKOa.js → main-m3NNcAo4.js} +115 -115
  83. package/dist/assets/{mermaid.core-Uz36XO2-.js → mermaid.core-EY9hyXLz.js} +4 -4
  84. package/dist/assets/{mindmap-definition-LN4V7U3C-Bv9DlPAr.js → mindmap-definition-LN4V7U3C-B_p1LOAa.js} +1 -1
  85. package/dist/assets/{pegDiagram-2B236MQR-CRG-2pCa.js → pegDiagram-2B236MQR-BgCd9rWg.js} +1 -1
  86. package/dist/assets/{pieDiagram-ENE6RG2P-dkVFz981.js → pieDiagram-ENE6RG2P-d8ofNooq.js} +1 -1
  87. package/dist/assets/{quadrantDiagram-ABIIQ3AL-D6Y-oPfA.js → quadrantDiagram-ABIIQ3AL-27DPJdZF.js} +1 -1
  88. package/dist/assets/{railroadDiagram-RFXS5EU6-DnBPGcSS.js → railroadDiagram-RFXS5EU6-C7S8pppU.js} +1 -1
  89. package/dist/assets/{requirementDiagram-TGXJPOKE-BfXBQgDX.js → requirementDiagram-TGXJPOKE-BbTkDbLO.js} +1 -1
  90. package/dist/assets/{sankeyDiagram-HTMAVEWB-B2plq2xb.js → sankeyDiagram-HTMAVEWB-lU57KWVw.js} +1 -1
  91. package/dist/assets/{sequenceDiagram-DBY2YBRQ-5HYSSRy3.js → sequenceDiagram-DBY2YBRQ-Bg18P0LT.js} +1 -1
  92. package/dist/assets/{sizeCapture-X5ZJPWSS-Dhd1V1RM.js → sizeCapture-X5ZJPWSS-FDhyxAiu.js} +1 -1
  93. package/dist/assets/{stateDiagram-2N3HPSRC-BawpJoTz.js → stateDiagram-2N3HPSRC-pp9KUH2d.js} +1 -1
  94. package/dist/assets/stateDiagram-v2-6OUMAXLB-BmoS7QDQ.js +1 -0
  95. package/dist/assets/{swimlanes-5IMT3BWC-BYunKpK9.js → swimlanes-5IMT3BWC-BCUZKORl.js} +2 -2
  96. package/dist/assets/swimlanesDiagram-G3AALYLV-Da6QbdiL.js +8 -0
  97. package/dist/assets/{timeline-definition-FHXFAJF6-BA1n8ny7.js → timeline-definition-FHXFAJF6-BaeOwVlH.js} +1 -1
  98. package/dist/assets/{vennDiagram-L72KCM5P-DfSgfnDb.js → vennDiagram-L72KCM5P-BkhqU_hz.js} +1 -1
  99. package/dist/assets/{wardleyDiagram-EHGQE667-Ccum1Sj1.js → wardleyDiagram-EHGQE667-DvPxIC6q.js} +1 -1
  100. package/dist/assets/{web-24bQZmaT.js → web-BhVPxATx.js} +1 -1
  101. package/dist/assets/{web-CDfC-TTs.js → web-CR-app3U.js} +1 -1
  102. package/dist/assets/{web-C4jAxolp.js → web-DOiXCdVs.js} +1 -1
  103. package/dist/assets/{xychartDiagram-FW5EYKEG-CZKJCuVt.js → xychartDiagram-FW5EYKEG-B9MrBAD_.js} +1 -1
  104. package/dist/build-info.json +1 -1
  105. package/dist/index.html +2 -2
  106. package/dist/locales/de/config.json +5 -0
  107. package/dist/locales/de/terminal.json +1 -0
  108. package/dist/locales/en/config.json +5 -0
  109. package/dist/locales/en/terminal.json +2 -0
  110. package/dist/locales/es/config.json +5 -0
  111. package/dist/locales/es/terminal.json +11 -0
  112. package/dist/locales/fr/config.json +5 -0
  113. package/dist/locales/fr/terminal.json +1 -0
  114. package/dist/locales/hi/config.json +5 -0
  115. package/dist/locales/hi/terminal.json +1 -0
  116. package/dist/locales/it/config.json +5 -0
  117. package/dist/locales/it/terminal.json +1 -0
  118. package/dist/locales/ja/config.json +5 -0
  119. package/dist/locales/ja/terminal.json +1 -0
  120. package/dist/locales/pt/config.json +5 -0
  121. package/dist/locales/pt/terminal.json +1 -0
  122. package/dist/locales/ru/config.json +5 -0
  123. package/dist/locales/ru/terminal.json +1 -0
  124. package/dist/locales/zh-CN/config.json +5 -0
  125. package/dist/locales/zh-CN/terminal.json +1 -0
  126. package/dist/src/packages/server/data/builtin-skills/boss-instructions.js +1 -1
  127. package/dist/src/packages/server/grok/backend.js +7 -10
  128. package/dist/src/packages/server/index.js +61 -34
  129. package/dist/src/packages/server/routes/files.js +45 -19
  130. package/dist/src/packages/server/services/global-file-search.js +281 -0
  131. package/dist/src/packages/server/websocket/handler.js +16 -6
  132. package/dist/src/packages/server/websocket/listeners/runtime-listeners.js +7 -0
  133. package/dist/src/packages/shared/agent-types.js +56 -4
  134. package/dist/src/packages/shared/file-search.js +49 -0
  135. package/dist/src/packages/shared/types.js +1 -0
  136. package/package.json +1 -1
  137. package/dist/assets/BossSpawnModal-CvFw8BPQ.js +0 -1
  138. package/dist/assets/ControlsModal-f4JvuTMY.js +0 -1
  139. package/dist/assets/RestoreArchivedAreaModal-C_cQr4Ay.js +0 -1
  140. package/dist/assets/SpawnModal-yPfAItLC.js +0 -1
  141. package/dist/assets/channel-Dz9gemPm.js +0 -1
  142. package/dist/assets/classDiagram-OUVF2IWQ-D29jX9yn.js +0 -1
  143. package/dist/assets/classDiagram-v2-EOCWNBFH-D29jX9yn.js +0 -1
  144. package/dist/assets/index-B5DZivhj.js +0 -19
  145. package/dist/assets/index-B_A7-K2O.js +0 -1
  146. package/dist/assets/index-CzZH0S0F.js +0 -1
  147. package/dist/assets/index-DHN-Bqnw.js +0 -1
  148. package/dist/assets/index-Dhfk8xKP.js +0 -2
  149. package/dist/assets/main-4CZSv3SH.css +0 -1
  150. package/dist/assets/stateDiagram-v2-6OUMAXLB-ChimTXB4.js +0 -1
  151. package/dist/assets/swimlanesDiagram-G3AALYLV-4ZzygVvO.js +0 -8
@@ -161,6 +161,13 @@ export function setupRuntimeListeners(ctx) {
161
161
  ctx.sendActivity(agentId, 'Compacting context...');
162
162
  }
163
163
  else if (event.type === 'init') {
164
+ // The CLI names the model actually serving the session. Park it on the
165
+ // agent record: when `model` is unset (CLI default) this is the only
166
+ // truthful source for the header/info chips — they must not guess.
167
+ const initAgent = agentService.getAgent(agentId);
168
+ if (initAgent?.provider === 'claude' && event.model && event.model !== initAgent.detectedModel) {
169
+ agentService.updateAgent(agentId, { detectedModel: event.model }, false);
170
+ }
164
171
  ctx.sendActivity(agentId, `Session initialized (${event.model})`);
165
172
  }
166
173
  else if (event.type === 'tool_start') {
@@ -41,15 +41,67 @@ export function providerDisplayName(provider) {
41
41
  }
42
42
  }
43
43
  export const GROK_MODELS = {
44
- 'grok-4.5': {
45
- label: 'Grok 4.5',
46
- description: 'Default Grok Build model',
44
+ 'grok-4.6': {
45
+ label: 'Grok 4.6',
46
+ description: "SpaceXAI's latest frontier model — adds the xhigh reasoning tier",
47
47
  icon: '⚡',
48
48
  // Authoritative window from live Grok Build signals.json (contextWindowTokens).
49
49
  contextWindow: 500000,
50
+ efforts: ['low', 'medium', 'high', 'xhigh'],
51
+ },
52
+ 'grok-4.5': {
53
+ label: 'Grok 4.5',
54
+ description: 'Previous Grok Build generation (still supported)',
55
+ icon: '🌊',
56
+ contextWindow: 500000,
57
+ // 4.5 has no xhigh tier — the model catalog only lists low/medium/high.
58
+ efforts: ['low', 'medium', 'high'],
50
59
  },
51
60
  };
52
- export const DEFAULT_GROK_MODEL = 'grok-4.5';
61
+ export const DEFAULT_GROK_MODEL = 'grok-4.6';
62
+ /** Effort tiers a Grok model accepts; unknown models get the full modern set. */
63
+ export function grokEffortsFor(model) {
64
+ return GROK_MODELS[model || '']?.efforts || ['low', 'medium', 'high', 'xhigh'];
65
+ }
66
+ // Tide effort labels → Grok CLI values. Grok tops out at 'xhigh', so 'max'
67
+ // clamps down instead of being passed through as an unknown value.
68
+ const GROK_EFFORT_VALUES = {
69
+ low: 'low',
70
+ medium: 'medium',
71
+ high: 'high',
72
+ xHigh: 'xhigh',
73
+ max: 'xhigh',
74
+ };
75
+ /**
76
+ * Resolve a Tide effort label to the `--reasoning-effort` value for a Grok
77
+ * model, clamping to the highest tier that model actually supports (asking
78
+ * grok-4.5 for 'xhigh' would otherwise be rejected by the CLI).
79
+ */
80
+ export function resolveGrokReasoningEffort(model, effort) {
81
+ if (!effort)
82
+ return undefined;
83
+ const supported = grokEffortsFor(model);
84
+ const requested = GROK_EFFORT_VALUES[effort]
85
+ || effort.toLowerCase();
86
+ const order = ['low', 'medium', 'high', 'xhigh'];
87
+ const requestedRank = order.indexOf(requested);
88
+ if (requestedRank === -1)
89
+ return undefined;
90
+ for (let rank = requestedRank; rank >= 0; rank -= 1) {
91
+ if (supported.includes(order[rank]))
92
+ return order[rank];
93
+ }
94
+ return undefined;
95
+ }
96
+ /**
97
+ * Tide effort labels selectable for a Grok model (drives the effort pickers).
98
+ * 'max' is Claude-only — Grok's ceiling is X-High, so it never shows for Grok.
99
+ */
100
+ export function grokSupportsEffort(model, effort) {
101
+ if (effort === 'max')
102
+ return false;
103
+ return grokEffortsFor(model).includes(GROK_EFFORT_VALUES[effort]);
104
+ }
53
105
  export const DEFAULT_PI_MODEL = '';
54
106
  export const CODEX_REASONING_EFFORTS = {
55
107
  none: { label: 'None', description: 'No reasoning', icon: '⚪' },
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Shared defaults for Spotlight / file-explorer filename search.
3
+ * Folder *names* (not paths) skipped while walking area project trees.
4
+ */
5
+ export const DEFAULT_FILE_SEARCH_EXCLUDE_DIRS = [
6
+ 'node_modules',
7
+ 'vendor',
8
+ '.git',
9
+ 'dist',
10
+ 'build',
11
+ '.next',
12
+ 'target',
13
+ '.cache',
14
+ '.turbo',
15
+ '.venv',
16
+ '__pycache__',
17
+ 'venv',
18
+ ];
19
+ /** True when `name` is a safe directory basename (no path separators). */
20
+ export function isValidExcludeDirName(name) {
21
+ const trimmed = name.trim();
22
+ return trimmed.length > 0 && !trimmed.includes('/') && !trimmed.includes('\\') && trimmed !== '.' && trimmed !== '..';
23
+ }
24
+ /**
25
+ * Parse a query-string or settings value into a set of folder names.
26
+ * Accepts a comma-separated string, a string[], or undefined.
27
+ */
28
+ export function parseExcludeDirNames(raw) {
29
+ const parts = [];
30
+ if (Array.isArray(raw)) {
31
+ for (const item of raw) {
32
+ if (typeof item === 'string')
33
+ parts.push(item);
34
+ }
35
+ }
36
+ else if (typeof raw === 'string') {
37
+ parts.push(...raw.split(','));
38
+ }
39
+ const out = [];
40
+ const seen = new Set();
41
+ for (const part of parts) {
42
+ const name = part.trim();
43
+ if (!isValidExcludeDirName(name) || seen.has(name))
44
+ continue;
45
+ seen.add(name);
46
+ out.push(name);
47
+ }
48
+ return out;
49
+ }
@@ -16,3 +16,4 @@ export * from './websocket-messages.js';
16
16
  export * from './trigger-types.js';
17
17
  export * from './integration-types.js';
18
18
  export * from './workflow-types.js';
19
+ export * from './file-search.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tide-commander",
3
- "version": "1.181.0",
3
+ "version": "1.182.0",
4
4
  "description": "Visual multi-agent orchestrator and manager for Claude Code with 3D/2D interface",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- import{u as Be,y as Pe,k as Oe,i as Re,r as t,m as re,S as G,z as O,d as Fe,s as S,C as W,A as de,E as C,j as s,n as A,M as Te,F as ze,I as R,P as K,o as $,p as F,v as H,x as Ue}from"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";function pe(p){const w=C.filter(E=>!p.has(`Boss ${E}`));return w.length===0?`Boss ${C[Math.floor(Math.random()*C.length)]}-${Date.now()%1e3}`:`Boss ${w[Math.floor(Math.random()*w.length)]}`}function Ke({isOpen:p,onClose:w,onSpawnStart:E,onSpawnEnd:T,spawnPosition:ue,spawnAreaId:g}){const{t:n}=Be(["terminal","common"]),J=Pe(),o=Oe(),L=Re(),[u,m]=t.useState(""),[I,z]=t.useState(()=>re(G.LAST_CWD)),[d,_]=t.useState("boss"),[X,V]=t.useState(!1),[me,D]=t.useState(!1),[Y,he]=t.useState(!0),[Q,we]=t.useState("bypass"),[c,k]=t.useState("claude"),[f,N]=t.useState({fullAuto:!0,sandbox:"workspace-write",approvalMode:"on-request",search:!1}),[Z,xe]=t.useState("claude-opus-4-8[1m]"),[ee,fe]=t.useState("gpt-5.6-luna"),[M,B]=t.useState(new Set),[se,U]=t.useState(new Set),[h,be]=t.useState(""),[v,je]=t.useState(""),[ae,ge]=t.useState(""),P=t.useRef(null),q=t.useRef(!1),ne=t.useRef(!1),b=t.useMemo(()=>L.filter(e=>e.enabled),[L]),le=t.useMemo(()=>{if(!v.trim())return b;const e=v.toLowerCase();return b.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.slug.toLowerCase().includes(e))},[b,v]),Ne=t.useMemo(()=>{var a;const e=o.find(l=>l.id===d);return(a=e==null?void 0:e.defaultSkillIds)!=null&&a.length?L.filter(l=>e.defaultSkillIds.includes(l.id)):[]},[o,d,L]),ve=["full-notifications","streaming-exec","task-label","report-task-to-boss","agent-tracking","agent-memory","send-message-to-agent"];t.useEffect(()=>{if(p&&!ne.current){if(b.length>0){const l=b.filter(i=>ve.includes(i.slug)).map(i=>i.id);l.length>0&&U(new Set(l))}if(re(G.DEFAULT_AGENT_CLASS)==="random"){const i=[...Object.keys(O).filter(j=>j!=="boss"),...o.map(j=>j.id)];i.length>0&&_(i[Math.floor(Math.random()*i.length)])}}ne.current=p},[p,b,o]);const Se=t.useCallback(e=>{U(a=>{const l=new Set(a);return l.has(e)?l.delete(e):l.add(e),l})},[]),r=t.useMemo(()=>o.find(e=>e.id===d),[o,d]),Ce=t.useMemo(()=>{if(r!=null&&r.model)return r.model},[r]),ke=t.useMemo(()=>{if(r!=null&&r.customModelPath)return Fe(`/api/custom-models/${r.id}`)},[r]),Me=r==null?void 0:r.modelScale,ye=t.useMemo(()=>r?"scout":d==="boss"?"architect":d,[d,r]);t.useEffect(()=>{if(!p||!g)return;const e=S.getState().areas.get(g);if(e!=null&&e.directories&&e.directories.length>0){z(e.directories[0]);return}const a=Array.from(S.getState().agents.values()).filter(x=>{var y;return((y=S.getAreaForAgent(x.id))==null?void 0:y.id)===g&&x.cwd});if(a.length===0)return;const l=new Map;for(const x of a)l.set(x.cwd,(l.get(x.cwd)||0)+1);let i="",j=0;for(const[x,y]of l)y>j&&(i=x,j=y);i&&z(i)},[p,g]);const te=t.useMemo(()=>Array.from(J.values()).filter(e=>!e.isBoss&&e.class!=="boss"&&!e.bossId),[J]),ie=t.useMemo(()=>{if(!h.trim())return o;const e=h.toLowerCase();return o.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.id.toLowerCase().includes(e))},[o,h]),ce=t.useMemo(()=>{if(!h.trim())return W;const e=h.toLowerCase();return W.filter(a=>{const l=de[a.id];return l?a.name.toLowerCase().includes(e)||a.id.toLowerCase().includes(e)||l.description.toLowerCase().includes(e):!1})},[h]),oe=t.useMemo(()=>{if(!h.trim())return!0;const e=h.toLowerCase(),a=O.boss;return"boss".includes(e)||a.description.toLowerCase().includes(e)},[h]);t.useEffect(()=>{if(p&&!q.current){q.current=!0;const e=new Set(Array.from(S.getState().agents.values()).map(l=>l.name)),a=o.find(l=>l.id===d);if(a){const l=C.filter(i=>!e.has(`${a.name} ${i}`));if(l.length===0){const i=C[Math.floor(Math.random()*C.length)];m(`${a.name} ${i}-${Date.now()%1e3}`)}else m(`${a.name} ${l[Math.floor(Math.random()*l.length)]}`)}else m(pe(e));B(new Set),P.current&&(P.current.focus(),P.current.select())}else p||(q.current=!1)},[p]),t.useEffect(()=>{if(!p)return;const e=o.find(a=>a.id===d);if(e)if(u.startsWith("Boss ")){const a=u.substring(5);m(`${e.name} ${a}`)}else{const a=o.find(l=>u.startsWith(l.name+" "));if(a){const l=u.substring(a.name.length+1);m(`${e.name} ${l}`)}else m(`${e.name} ${u}`)}else{const a=o.find(l=>u.startsWith(l.name+" "));if(a){const l=u.substring(a.name.length+1);m(`Boss ${l}`)}else u.startsWith("Boss ")||m(`Boss ${u}`)}},[d]);const Ae=()=>{if(D(!1),!I.trim()){D(!0);return}if(!u.trim()){const l=new Set(Array.from(S.getState().agents.values()).map(i=>i.name));m(pe(l));return}Ue(G.LAST_CWD,I),E(),window.__spawnModalAreaContext=g?{areaId:g}:null;const e=ae.trim()||void 0,a=Array.from(se);S.spawnBossAgent(u.trim(),d,I.trim(),ue||void 0,Array.from(M),c==="claude"?Y:!1,Q,c,c==="codex"?f:void 0,c==="codex"?ee:void 0,c==="claude"?Z:void 0,e,a),m(""),B(new Set),U(new Set),T(),w()},$e=()=>{V(!1),m(""),B(new Set),T(),w()},Ee=()=>{V(!1),D(!0),T()};t.useEffect(()=>(window.__bossSpawnModalSuccess=$e,window.__bossSpawnModalError=Ee,()=>{delete window.__bossSpawnModalSuccess,delete window.__bossSpawnModalError}),[u]);const Le=e=>{e.target===e.currentTarget&&w()},Ie=e=>{e.key==="Escape"&&w()},_e=e=>{const a=new Set(M);a.has(e)?a.delete(e):a.add(e),B(a)};if(!p)return null;const De=O.boss;return s.jsx("div",{className:`modal-overlay ${p?"visible":""}`,onClick:Le,onKeyDown:Ie,children:s.jsxs("div",{className:"modal boss-spawn-modal",children:[s.jsxs("div",{className:"modal-header",children:[s.jsx(A,{classId:"boss",size:22,className:"boss-header-icon"}),n("terminal:spawn.deployBossTitle")]}),s.jsxs("div",{className:"modal-body spawn-modal-body",children:[s.jsxs("div",{className:"spawn-top-section",children:[s.jsx("div",{className:"spawn-preview-compact",children:s.jsx(Te,{agentClass:ye,modelFile:Ce,customModelUrl:ke,modelScale:Me,width:100,height:120})}),s.jsxs("div",{className:"spawn-class-section",children:[s.jsx("div",{className:"spawn-class-label",children:n("terminal:spawn.bossClass")}),o.length+W.length+1>6&&s.jsx("input",{type:"text",className:"spawn-input class-search-input",placeholder:n("terminal:spawn.filterClasses"),value:h,onChange:e=>be(e.target.value)}),s.jsxs("div",{className:"class-selector-inline",children:[ie.map(e=>s.jsxs("button",{className:`class-chip ${d===e.id?"selected":""}`,onClick:()=>_(e.id),title:e.description,children:[s.jsx(A,{classId:e.id,size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id)),oe&&s.jsxs("button",{className:`class-chip ${d==="boss"?"selected":""}`,onClick:()=>_("boss"),title:De.description,children:[s.jsx(A,{classId:"boss",size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:n("terminal:spawn.bossClassName")})]}),ce.map(e=>{const a=de[e.id];return a?s.jsxs("button",{className:`class-chip ${d===e.id?"selected":""}`,onClick:()=>_(e.id),title:a.description,children:[s.jsx(A,{classId:e.id,size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id):null}),h&&ie.length===0&&!oe&&ce.length===0&&s.jsx("div",{className:"class-search-empty",children:n("terminal:spawn.noClassesMatch",{query:h})})]})]})]}),s.jsxs("div",{className:"spawn-form-section",children:[s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.name")}),s.jsx("input",{ref:P,type:"text",className:"spawn-input",placeholder:n("terminal:spawn.bossNamePlaceholder"),value:u,onChange:e=>m(e.target.value)})]}),s.jsxs("div",{className:"spawn-field spawn-field-wide",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.workingDir")}),s.jsx(ze,{value:I,onChange:e=>{z(e),D(!1)},placeholder:n("terminal:spawn.workingDirPlaceholder"),className:"spawn-input",hasError:me,directoriesOnly:!0})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.runtime")}),s.jsxs("div",{className:"spawn-select-row",children:[s.jsxs("button",{className:`spawn-select-btn ${c==="claude"?"selected":""}`,onClick:()=>k("claude"),title:n("terminal:spawn.useClaudeCli"),children:[s.jsx("img",{src:"/assets/claude.ico",alt:"Claude",className:"spawn-provider-icon"}),s.jsx("span",{children:"Claude"})]}),s.jsxs("button",{className:`spawn-select-btn ${c==="codex"?"selected":""}`,onClick:()=>k("codex"),title:n("terminal:spawn.useCodexCli"),children:[s.jsx("img",{src:"/assets/codex.ico",alt:"Codex",className:"spawn-provider-icon"}),s.jsx("span",{children:"Codex"})]}),s.jsxs("button",{className:`spawn-select-btn spawn-select-btn--opencode ${c==="opencode"?"selected":""}`,onClick:()=>k("opencode"),title:"Use OpenCode CLI (multi-provider)",children:[s.jsx("span",{children:s.jsx(R,{name:"status-pending",size:14,weight:"fill",color:"#4ade80"})}),s.jsx("span",{children:"OpenCode"})]}),s.jsxs("button",{className:`spawn-select-btn spawn-select-btn--grok ${c==="grok"?"selected":""}`,onClick:()=>k("grok"),title:"Use Grok CLI (headless)",children:[s.jsx("img",{src:"/assets/grok.png",alt:"Grok",className:"spawn-provider-icon"}),s.jsx("span",{children:"Grok"})]}),s.jsxs("button",{className:`spawn-select-btn spawn-select-btn--pi ${c==="pi"?"selected":""}`,onClick:()=>k("pi"),title:"Use Pi coding agent CLI (multi-provider)",children:[s.jsx("img",{src:"/assets/pi.svg",alt:"Pi",className:"spawn-provider-icon"}),s.jsx("span",{children:"Pi"})]})]})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.permissions")}),s.jsx("div",{className:"spawn-select-row",children:Object.keys(K).map(e=>s.jsxs("button",{className:`spawn-select-btn ${Q===e?"selected":""}`,onClick:()=>we(e),title:K[e].description,children:[s.jsx("span",{children:s.jsx(R,{name:e==="bypass"?"bolt":"lock",size:14})}),s.jsx("span",{children:K[e].label})]},e))})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.model")}),c==="claude"?s.jsx("div",{className:"spawn-select-row spawn-select-row--wrap",children:Object.keys($).filter(e=>!$[e].deprecated).map(e=>s.jsxs("button",{className:`spawn-select-btn ${Z===e?"selected":""}`,onClick:()=>xe(e),title:$[e].description,children:[s.jsx("span",{children:$[e].icon}),s.jsx("span",{children:$[e].label})]},e))}):c==="codex"?s.jsx("div",{className:"spawn-select-row spawn-select-row--codex-models",children:Object.keys(F).map(e=>s.jsxs("button",{className:`spawn-select-btn ${ee===e?"selected":""}`,onClick:()=>fe(e),title:F[e].description,children:[s.jsx("span",{children:F[e].icon}),s.jsx("span",{children:F[e].label})]},e))}):c==="opencode"?s.jsx("input",{type:"text",className:"spawn-input",defaultValue:"minimax/MiniMax-M1-80k",placeholder:"provider/model (e.g., minimax/MiniMax-M1-80k)"}):c==="grok"?s.jsx("div",{className:"spawn-inline-hint",children:"grok-4.5"}):c==="pi"?s.jsx("div",{className:"spawn-inline-hint",children:"pi default (configure via agent edit)"}):s.jsx("div",{className:"spawn-inline-hint",children:n("terminal:spawn.codex.configuration")})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.browser")}),s.jsx("div",{className:"spawn-form-row spawn-options-row",children:s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:Y,onChange:e=>he(e.target.checked),disabled:c!=="claude"}),s.jsx("span",{children:n("terminal:spawn.chromeBrowser")})]})})]})]}),c==="codex"&&s.jsx("div",{className:"spawn-form-row",children:s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.codex.config")}),s.jsxs("div",{className:"spawn-options-row",style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:f.fullAuto!==!1,onChange:e=>N(a=>({...a,fullAuto:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.useFullAuto")})]}),s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:!!f.search,onChange:e=>N(a=>({...a,search:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.enableSearch")})]}),f.fullAuto===!1&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"spawn-input",value:f.sandbox||"workspace-write",onChange:e=>N(a=>({...a,sandbox:e.target.value})),children:[s.jsx("option",{value:"read-only",children:n("terminal:spawn.codex.sandboxReadOnly")}),s.jsx("option",{value:"workspace-write",children:n("terminal:spawn.codex.sandboxWorkspaceWrite")}),s.jsx("option",{value:"danger-full-access",children:n("terminal:spawn.codex.sandboxDangerFullAccess")})]}),s.jsxs("select",{className:"spawn-input",value:f.approvalMode||"on-request",onChange:e=>N(a=>({...a,approvalMode:e.target.value})),children:[s.jsx("option",{value:"untrusted",children:n("terminal:spawn.codex.approvalsUntrusted")}),s.jsx("option",{value:"on-failure",children:n("terminal:spawn.codex.approvalsOnFailure")}),s.jsx("option",{value:"on-request",children:n("terminal:spawn.codex.approvalsOnRequest")}),s.jsx("option",{value:"never",children:n("terminal:spawn.codex.approvalsNever")})]})]}),s.jsx("input",{type:"text",className:"spawn-input",placeholder:n("terminal:spawn.codex.profileOptional"),value:f.profile||"",onChange:e=>N(a=>({...a,profile:e.target.value||void 0}))}),s.jsxs("select",{className:"spawn-input",value:f.reasoningEffort||"",onChange:e=>N(a=>({...a,reasoningEffort:e.target.value||void 0})),children:[s.jsx("option",{value:"",children:n("terminal:spawn.codex.reasoningEffortDefault")}),Object.keys(H).map(e=>s.jsxs("option",{value:e,children:[H[e].icon," ",n("terminal:spawn.codex.reasoningEffort"),": ",H[e].label]},e))]})]})]})}),b.length>0&&s.jsxs("div",{className:"spawn-skills-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.skills")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),b.length>6&&s.jsx("input",{type:"text",className:"spawn-input skill-search-input",placeholder:n("terminal:spawn.filterSkills"),value:v,onChange:e=>je(e.target.value)}),s.jsxs("div",{className:"spawn-skills-inline",children:[le.map(e=>{const a=se.has(e.id);return Ne.some(i=>i.id===e.id)?null:s.jsxs("button",{className:`spawn-skill-chip ${a?"selected":""}`,onClick:()=>Se(e.id),title:e.description,children:[a&&s.jsx("span",{className:"spawn-skill-check",children:s.jsx(R,{name:"check",size:12})}),s.jsx("span",{children:e.name}),e.builtin&&s.jsx("span",{className:"spawn-skill-builtin",children:"TC"})]},e.id)}),v&&le.length===0&&s.jsx("div",{className:"skill-search-empty",children:n("terminal:spawn.noSkillsMatch",{query:v})})]})]}),s.jsxs("div",{className:"spawn-custom-instructions-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.customInstructions")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("textarea",{className:"spawn-input spawn-textarea",placeholder:n("terminal:spawn.customInstructionsBossPlaceholder"),value:ae,onChange:e=>ge(e.target.value),rows:3})]}),s.jsxs("div",{className:"spawn-subordinates-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.initialSubordinates")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("div",{className:"subordinates-selector-compact",children:te.length===0?s.jsx("div",{className:"subordinates-empty",children:n("terminal:spawn.noAvailableAgents")}):te.map(e=>{const a=M.has(e.id),l=O[e.class],i=o.find(x=>x.id===e.class),j=l||i||{color:"#888888"};return s.jsxs("button",{className:`subordinate-chip ${a?"selected":""}`,onClick:()=>_e(e.id),children:[a&&s.jsx("span",{className:"subordinate-check",children:s.jsx(R,{name:"check",size:12})}),s.jsx("span",{className:"subordinate-chip-icon",style:{color:j.color},children:s.jsx(A,{classId:e.class,size:16})}),s.jsx("span",{className:"subordinate-chip-name",children:e.name})]},e.id)})}),M.size>0&&s.jsxs("div",{className:"subordinates-count",children:[M.size," ",n("common:labels.selected").toLowerCase()]})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:w,children:n("common:buttons.cancel")}),s.jsx("button",{className:"btn btn-boss",onClick:Ae,disabled:X,children:n(X?"common:buttons.deploying":"common:buttons2.deployBoss")})]})]})})}export{Ke as BossSpawnModal};
@@ -1 +0,0 @@
1
- import{u as K,N as Q,y as J,Q as W,R as ee,r as u,T as se,g as te,U as D,V as z,W as ae,j as e,X as ne,Y as re,s as g,Z as R,_ as V}from"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";const G={global:"terminal:controls.contextGlobal",commander:"terminal:controls.contextCommander",toolbox:"terminal:controls.contextToolbox"},le={global:"terminal:controls.contextGlobalDesc",commander:"terminal:controls.contextCommanderDesc",toolbox:"terminal:controls.contextToolboxDesc"},U={camera:["camera-pan","camera-orbit","camera-rotate","camera-zoom","camera-tilt"],interaction:["primary-action","selection-box","context-menu","move-command"]},oe={camera:"terminal:controls.cameraControls",interaction:"terminal:controls.interaction"};function pe({isOpen:s,onClose:r}){const{t:a}=K(["terminal","common"]),l=Q(),o=J(),h=W(),N=ee(),[x,C]=u.useState("keyboard"),[b,v]=u.useState(""),[p,j]=u.useState("all"),[m,f]=u.useState(!1),[c,d]=u.useState(null),[k,w]=u.useState(null),Y=se.useRef(null),{handleMouseDown:X,handleClick:Z}=te(r);if(u.useEffect(()=>{if(!s||m)return;const t=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),r())};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,r,m]),u.useEffect(()=>{s||(v(""),f(!1),d(null))},[s]),u.useEffect(()=>{if(!s||!m)return;const t=n=>{if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),f(!1),d(null);return}if(["Control","Alt","Shift","Meta"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let i=n.key;n.code.startsWith("Key")&&n.code.length===4?i=n.code.charAt(3).toLowerCase():n.code.startsWith("Digit")&&n.code.length===6?i=n.code.charAt(5):n.code==="Space"&&(i="Space"),d({key:i,modifiers:{ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey,meta:n.metaKey}})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,m]),!s)return null;const F=l.filter(t=>{const n=a(`terminal:controls.shortcuts.${t.id}.name`,{defaultValue:t.name}),i=a(`terminal:controls.shortcuts.${t.id}.description`,{defaultValue:t.description});if(m&&c){const A=S=>S===" "||S==="Space"?"Space":S.length===1?S.toLowerCase():S,B=A(t.key),L=A(c.key);if(!(L.length===1&&/^[a-zA-Z]$/.test(B)?`Key${B.toUpperCase()}`==`Key${L.toUpperCase()}`:B===L))return!1;const M=t.modifiers,T=c.modifiers;return(M.ctrl||!1)===(T.ctrl||!1)&&(M.alt||!1)===(T.alt||!1)&&(M.shift||!1)===(T.shift||!1)&&(M.meta||!1)===(T.meta||!1)}if(!b)return!0;const y=b.toLowerCase();return n.toLowerCase().includes(y)||i.toLowerCase().includes(y)||D(t).toLowerCase().includes(y)}),E=Array.from(o.values()).map(t=>t).filter(t=>t.shortcut&&t.shortcut.trim().length>0).filter(t=>{const n=z(t.shortcut).toLowerCase();if(m&&c){const y={key:c.key,code:c.key.length===1&&/^[a-zA-Z]$/.test(c.key)?`Key${c.key.toUpperCase()}`:c.key.length===1&&/^[0-9]$/.test(c.key)?`Digit${c.key}`:c.key==="Space"?"Space":c.key,ctrlKey:!!c.modifiers.ctrl,altKey:!!c.modifiers.alt,shiftKey:!!c.modifiers.shift,metaKey:!!c.modifiers.meta};return ae(y,t.shortcut)}if(!b)return!0;const i=b.toLowerCase();return t.name.toLowerCase().includes(i)||n.toLowerCase().includes(i)}),P=F.reduce((t,n)=>(t[n.context]||(t[n.context]=[]),t[n.context].push(n),t),{}),_=(t,n)=>{g.updateShortcut(t,n)},$=()=>{w(x)},I=()=>{k==="keyboard"?g.resetShortcuts():(k==="mouse"||k==="trackpad")&&g.resetMouseControls()},q=k==="keyboard"?"terminal:controls.confirmResetKeyboard":k==="mouse"?"terminal:controls.confirmResetMouse":"terminal:controls.confirmResetTrackpad",O=["global","commander","toolbox"],H=h.bindings.reduce((t,n)=>(U.camera.includes(n.action)?t.camera.push(n):U.interaction.includes(n.action)&&t.interaction.push(n),t),{camera:[],interaction:[]});return e.jsxs("div",{className:"shortcuts-modal-overlay",onMouseDown:X,onClick:Z,children:[e.jsxs("div",{className:"shortcuts-modal controls-modal",children:[e.jsxs("div",{className:"shortcuts-modal-header",children:[e.jsxs("div",{className:"shortcuts-modal-title",children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("span",{children:a("terminal:controls.title")})]}),e.jsx("button",{className:"shortcuts-modal-close",onClick:r,children:"×"})]}),e.jsxs("div",{className:"controls-main-tabs",children:[e.jsxs("button",{className:`controls-main-tab ${x==="keyboard"?"active":""}`,onClick:()=>C("keyboard"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),a("terminal:controls.keyboard")]}),e.jsxs("button",{className:`controls-main-tab ${x==="mouse"?"active":""}`,onClick:()=>C("mouse"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]}),a("terminal:controls.mouse")]}),e.jsxs("button",{className:`controls-main-tab ${x==="trackpad"?"active":""}`,onClick:()=>C("trackpad"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a("terminal:controls.trackpad")]})]}),x==="keyboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[m?e.jsxs("div",{className:"shortcuts-search find-by-shortcut-active",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),c?e.jsxs("span",{className:"find-by-shortcut-display",children:[D({key:c.key,modifiers:c.modifiers}),e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>d(null),children:"×"})]}):e.jsx("span",{className:"find-by-shortcut-prompt",children:a("terminal:controls.pressKeyCombination")})]}):e.jsxs("div",{className:"shortcuts-search",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:Y,type:"text",placeholder:a("terminal:controls.searchShortcuts"),value:b,onChange:t=>v(t.target.value),autoFocus:!0}),b&&e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>v(""),children:"×"})]}),e.jsx("button",{className:`shortcuts-find-by-key-btn ${m?"active":""}`,onClick:()=>{f(!m),d(null),v("")},title:a(m?"terminal:controls.switchToTextSearch":"terminal:controls.findByPressingKeys"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]})}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:$,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-context-tabs",children:[e.jsxs("button",{className:`shortcuts-context-tab ${p==="all"?"active":""}`,onClick:()=>j("all"),children:[a("common:labels.all"),e.jsx("span",{className:"shortcuts-context-tab-count",children:F.length})]}),O.map(t=>{var i;const n=((i=P[t])==null?void 0:i.length)||0;return e.jsxs("button",{className:`shortcuts-context-tab ${p===t?"active":""}`,onClick:()=>j(t),children:[a(G[t]),e.jsx("span",{className:"shortcuts-context-tab-count",children:n})]},t)})]}),e.jsxs("div",{className:"shortcuts-modal-content",children:[O.map(t=>{const n=P[t]||[];return n.length===0||p!=="all"&&p!==t?null:e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a(G[t])}),e.jsx("span",{className:"shortcuts-context-description",children:a(le[t])})]}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:a(`terminal:controls.shortcuts.${i.id}.name`,{defaultValue:i.name})}),e.jsx("span",{className:"shortcut-item-description",children:a(`terminal:controls.shortcuts.${i.id}.description`,{defaultValue:i.description})})]}),e.jsx(ne,{shortcut:i,onUpdate:y=>_(i.id,y)})]},i.id))})]},t)}),F.length===0&&E.length===0&&e.jsx("div",{className:"shortcuts-empty",children:m?c?e.jsx("p",{children:a("terminal:controls.noShortcutBoundTo",{keys:D({key:c.key,modifiers:c.modifiers})})}):e.jsx("p",{children:a("terminal:controls.pressKeyCombinationToFind")}):e.jsx("p",{children:a("terminal:controls.noShortcutsFound",{query:b})})}),E.length>0&&(p==="all"||p==="global")&&e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:"Agent Terminal Shortcuts"}),e.jsx("span",{className:"shortcuts-context-description",children:"Per-agent global shortcuts that open the guake terminal"})]}),e.jsx("div",{className:"shortcuts-grid",children:E.map(t=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:t.name}),e.jsx("span",{className:"shortcut-item-description",children:"Open terminal for this agent"})]}),e.jsx("div",{className:"key-capture-container",children:e.jsx("button",{className:"key-capture-input disabled",disabled:!0,children:e.jsx("span",{className:"key-capture-value",children:z(t.shortcut)})})})]},t.id))})]})]})]}),x==="mouse"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.cameraAndInteraction")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:$,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-modal-content mouse-controls-content",children:[e.jsx("div",{className:"mouse-controls-bindings",children:Object.entries(H).map(([t,n])=>e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsx("div",{className:"shortcuts-context-header",children:e.jsx("span",{className:"shortcuts-context-label",children:a(oe[t])})}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsx(ce,{binding:i},i.id))})]},t))}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.adjustCameraSpeed")})]}),e.jsx(ie,{sensitivity:h.sensitivity})]})]})]}),x==="trackpad"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.trackpadGestureSettings")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:$,children:a("common:buttons.reset")})]}),e.jsx("div",{className:"shortcuts-modal-content trackpad-controls-content",children:e.jsx(de,{config:N})})]}),e.jsx("div",{className:"shortcuts-modal-footer",children:e.jsx("span",{className:"shortcuts-modal-hint",children:a(x==="keyboard"?m?"terminal:controls.hintFindByShortcut":"terminal:controls.hintKeyboard":x==="mouse"?"terminal:controls.hintMouse":"terminal:controls.hintTrackpad")})})]}),e.jsx(re,{isOpen:k!==null,title:a("common:buttons.resetToDefaults"),message:a(q),confirmLabel:a("common:buttons.reset"),cancelLabel:a("common:buttons.cancel"),variant:"danger",onConfirm:I,onClose:()=>w(null)})]})}function ce({binding:s}){const{t:r}=K(["terminal"]),a=W(),[l,o]=u.useState(!1),[h,N]=u.useState(null);u.useEffect(()=>{if(!l)return;const j=d=>{d.preventDefault(),d.stopPropagation();const w={0:"left",1:"middle",2:"right",3:"back",4:"forward"}[d.button];w&&N({button:w,modifiers:{ctrl:d.ctrlKey,alt:d.altKey,shift:d.shiftKey,meta:d.metaKey}})},m=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),o(!1),N(null))},f=()=>{h&&R(a.bindings,h,s.id).length===0&&g.updateMouseBinding(s.id,{button:h.button,modifiers:h.modifiers}),o(!1),N(null)},c=setTimeout(()=>{document.addEventListener("mousedown",j,!0),document.addEventListener("keydown",m,!0),document.addEventListener("click",f,!0)},100);return()=>{clearTimeout(c),document.removeEventListener("mousedown",j,!0),document.removeEventListener("keydown",m,!0),document.removeEventListener("click",f,!0)}},[l,h,s.id,a.bindings]);const x=h?R(a.bindings,h,s.id):[],C=r(`terminal:controls.mouseBindings.${s.id}.name`,{defaultValue:s.name}),b=r(`terminal:controls.mouseBindings.${s.id}.description`,{defaultValue:s.description}),v=j=>r(`terminal:controls.mouseButtons.${j}`,{defaultValue:j}),p=h?V({...s,...h},v):V(s,v);return e.jsxs("div",{className:`shortcut-item ${s.enabled?"":"disabled"}`,children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:C}),e.jsx("span",{className:"shortcut-item-description",children:b})]}),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{className:`key-capture-input ${l?"capturing":""} ${x.length>0?"conflict":""}`,onClick:()=>o(!0),children:l?h?e.jsx("span",{className:"key-capture-value",style:{color:"#f1fa8c"},children:p}):e.jsx("span",{style:{color:"#6272a4",fontStyle:"italic"},children:r("terminal:controls.clickToCapture")}):e.jsx("span",{className:"key-capture-value",children:p})}),x.length>0&&e.jsxs("span",{className:"key-capture-conflict",children:[r("terminal:controls.conflicts"),": ",x.map(j=>r(`terminal:controls.mouseBindings.${j.id}.name`,{defaultValue:j.name})).join(", ")]})]})]})}function ie({sensitivity:s}){const{t:r}=K(["terminal"]),a=u.useCallback((l,o)=>{g.updateCameraSensitivity({[l]:o})},[]);return e.jsxs("div",{className:"sensitivity-inline-settings",children:[e.jsxs("div",{className:"sensitivity-sliders",children:[e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.panSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.panSpeed,onChange:l=>a("panSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.panSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.orbitSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.orbitSpeed,onChange:l=>a("orbitSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.orbitSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.zoomSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.zoomSpeed,onChange:l=>a("zoomSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.zoomSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.smoothing")}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:s.smoothing,onChange:l=>a("smoothing",parseFloat(l.target.value))}),e.jsx("span",{className:"sensitivity-slider-value",children:s.smoothing.toFixed(1)})]})]}),e.jsxs("div",{className:"sensitivity-checkboxes-inline",children:[e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanX,onChange:l=>a("invertPanX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanY,onChange:l=>a("invertPanY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanY")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitX,onChange:l=>a("invertOrbitX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitY,onChange:l=>a("invertOrbitY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitY")})]})]})]})}function de({config:s}){const{t:r}=K(["terminal"]),a=u.useCallback((o,h)=>{g.updateTrackpadConfig({[o]:h})},[]),l=u.useCallback((o,h)=>{g.updateTrackpadConfig({sensitivity:{[o]:h}})},[]);return e.jsxs("div",{className:"trackpad-settings",children:[e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.trackpadGestures")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableTrackpadSupport")})]}),e.jsx("div",{className:"trackpad-toggle-row",children:e.jsxs("label",{className:"trackpad-toggle",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:o=>a("enabled",o.target.checked)}),e.jsx("span",{className:"trackpad-toggle-label",children:r("terminal:controls.enableTrackpadGestures")})]})})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.gestureControls")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableDisableGestures")})]}),e.jsxs("div",{className:"trackpad-gestures-grid",children:[e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.pinchToZoom,onChange:o=>a("pinchToZoom",o.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.pinchToZoom")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.pinchToZoomDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.twoFingerPan,onChange:o=>a("twoFingerPan",o.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.twoFingerPan")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.twoFingerPanDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.shiftTwoFingerOrbit,onChange:o=>a("shiftTwoFingerOrbit",o.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.shiftTwoFingerOrbit")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.shiftTwoFingerOrbitDesc")})]})]})]})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.adjustGestureSensitivity")})]}),e.jsxs("div",{className:"trackpad-sensitivity-sliders",children:[e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.pinchToZoom?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.zoom")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.zoom,onChange:o=>l("zoom",parseFloat(o.target.value)),disabled:!s.enabled||!s.pinchToZoom}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.zoom.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.twoFingerPan?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.pan")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.pan,onChange:o=>l("pan",parseFloat(o.target.value)),disabled:!s.enabled||!s.twoFingerPan}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.pan.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.shiftTwoFingerOrbit?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.orbit")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.orbit,onChange:o=>l("orbit",parseFloat(o.target.value)),disabled:!s.enabled||!s.shiftTwoFingerOrbit}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.orbit.toFixed(1),"x"]})]})]})]})]})}export{pe as ControlsModal};
@@ -1 +0,0 @@
1
- import{u as m,$ as f,j as e,I as N,s as d}from"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";function g(r){const t=Date.now()-r,i=Math.floor(t/1e3),a=Math.floor(i/60),c=Math.floor(a/60),n=Math.floor(c/24);return n>0?`${n} day${n>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"just now"}function k({isOpen:r,restorePosition:l,onClose:t,onRestored:i}){const{t:a}=m(["terminal","common"]),c=f(),n=Array.from(c.values()).filter(s=>s.archived===!0),o=(s,j)=>{const x=j?void 0:l||void 0;d.restoreArchivedArea(s,x),i==null||i(),t()},h=()=>{for(const s of n)d.restoreArchivedArea(s.id);i==null||i(),t()},v=s=>{s.target===s.currentTarget&&t()},u=s=>{s.key==="Escape"&&t()};return r?e.jsx("div",{className:`modal-overlay ${r?"visible":""}`,onClick:v,onKeyDown:u,children:e.jsxs("div",{className:"modal restore-archived-modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("span",{className:"header-icon",children:e.jsx(N,{name:"package",size:16})}),a("terminal:areas.restoreArchivedZone")]}),e.jsx("div",{className:"modal-body restore-archived-body",children:n.length===0?e.jsx("div",{className:"archived-empty",children:a("terminal:areas.noArchivedZones")}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"restore-info",children:a("terminal:areas.restoreInfo")}),e.jsx("div",{className:"archived-list",children:n.map(s=>e.jsx(p,{area:s,onRestoreHere:()=>o(s.id,!1),onRestoreOriginal:()=>o(s.id,!0),hasRestorePosition:!!l},s.id))}),n.length>1&&e.jsx("div",{className:"restore-all-section",children:e.jsx("button",{className:"btn btn-secondary",onClick:h,children:a("terminal:areas.restoreAllOriginal")})})]})}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn btn-secondary",onClick:t,children:a("common:buttons.cancel")})})]})}):null}function p({area:r,onRestoreHere:l,onRestoreOriginal:t,hasRestorePosition:i}){const{t:a}=m(["terminal","common"]),c=r.assignedAgentIds.length,n=r.directories.length;return e.jsxs("div",{className:"archived-item",children:[e.jsx("div",{className:"archived-item-color",style:{backgroundColor:r.color}}),e.jsxs("div",{className:"archived-item-info",children:[e.jsx("div",{className:"archived-item-name",children:r.name}),e.jsxs("div",{className:"archived-item-meta",children:[e.jsx("span",{className:"archived-item-type",children:r.type}),c>0&&e.jsx("span",{className:"archived-item-agents",children:a("terminal:areas.agentCount",{count:c})}),n>0&&e.jsx("span",{className:"archived-item-dirs",children:a("terminal:areas.folderCount",{count:n})}),r.archivedAt&&e.jsx("span",{className:"archived-item-time",children:g(r.archivedAt)})]})]}),e.jsxs("div",{className:"archived-item-actions",children:[i&&e.jsx("button",{className:"btn btn-small btn-primary",onClick:l,title:a("terminal:areas.placeAtClickedPosition"),children:a("terminal:areas.restoreHere")}),e.jsx("button",{className:"btn btn-small",onClick:t,title:a("terminal:areas.restoreToOriginal"),children:a(i?"terminal:areas.original":"terminal:areas.restore")})]})]})}export{k as RestoreArchivedAreaModal};
@@ -1 +0,0 @@
1
- import{u as ts,i as ls,k as is,l as os,B as cs,r as t,m as Ie,S as oe,D as rs,C as ce,A as Le,d as re,c as ds,s as b,g as ps,j as e,M as ms,n as _e,H as x,F as us,P as de,I as pe,o as T,p as H,O as hs,G as J,q as ws,t as me,v as ue,w as xs,x as fs}from"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";function $e(d,j){const S=j.filter(C=>!d.has(C));return S.length===0?`${j[Math.floor(Math.random()*j.length)]}-${Date.now()%1e3}`:S[Math.floor(Math.random()*S.length)]}function Ns({isOpen:d,onClose:j,onSpawnStart:S,onSpawnEnd:C,spawnPosition:Pe,spawnAreaId:v}){const{t:n}=ts(["terminal","common"]),F=ls(),p=is(),he=os(),X=he.length>0?he:cs,[m,N]=t.useState(""),[k,O]=t.useState(()=>Ie(oe.LAST_CWD)),[o,M]=t.useState("scout"),[we,I]=t.useState(!1),[Te,R]=t.useState(!1),[xe,Y]=t.useState(!1),[fe,ge]=t.useState(""),[y,Q]=t.useState([]),[E,U]=t.useState(null),[Fe,je]=t.useState(!1),[L,ve]=t.useState(""),[h,Oe]=t.useState(""),[z,Re]=t.useState(!1),[G,Ue]=t.useState("bypass"),[i,_]=t.useState("claude"),[f,A]=t.useState({fullAuto:!0,sandbox:"workspace-write",approvalMode:"on-request",search:!1}),[V,Z]=t.useState(new Set),[ee,Ne]=t.useState("claude-opus-4-8[1m]"),[se,be]=t.useState("xHigh"),[ne,ze]=t.useState("gpt-5.6-luna"),[ae,Ge]=t.useState("minimax/MiniMax-M1-80k"),[te,qe]=t.useState(rs),[le,We]=t.useState(""),[Se,Be]=t.useState(""),[D,Ke]=t.useState(""),q=t.useRef(null),Ce=t.useRef(!1),$=t.useCallback(()=>{window.__spawnModalAreaContext=null},[]),w=t.useMemo(()=>F.filter(s=>s.enabled),[F]),He=["full-notifications","streaming-exec","task-label","report-task-to-boss","agent-tracking","agent-memory","send-message-to-agent"];t.useEffect(()=>{if(d&&!Ce.current){if(w.length>0){const l=w.filter(r=>He.includes(r.slug)).map(r=>r.id);l.length>0&&Z(new Set(l))}const a=Ie(oe.DEFAULT_AGENT_CLASS);if(a==="random"){const r=[...Object.keys(xs),...p.map(u=>u.id)];M(r[Math.floor(Math.random()*r.length)])}else M(a||"scout")}Ce.current=d},[d,w,p]);const ke=t.useMemo(()=>{if(!D.trim())return w;const s=D.toLowerCase();return w.filter(a=>a.name.toLowerCase().includes(s)||a.description.toLowerCase().includes(s)||a.slug.toLowerCase().includes(s))},[w,D]),Je=t.useCallback(s=>{Z(a=>{const l=new Set(a);return l.has(s)?l.delete(s):l.add(s),l})},[]);t.useMemo(()=>w.filter(s=>s.assignedAgentClasses.includes(o)),[w,o]);const Xe=t.useMemo(()=>{var a;const s=p.find(l=>l.id===o);return(a=s==null?void 0:s.defaultSkillIds)!=null&&a.length?F.filter(l=>s.defaultSkillIds.includes(l.id)):[]},[p,o,F]),Me=t.useMemo(()=>{if(!L.trim())return y;const s=L.toLowerCase();return y.filter(a=>a.sessionId.toLowerCase().includes(s)||a.projectPath.toLowerCase().includes(s)||a.firstMessage&&a.firstMessage.toLowerCase().includes(s))},[y,L]),W=t.useMemo(()=>{if(!h.trim())return p;const s=h.toLowerCase();return p.filter(a=>a.name.toLowerCase().includes(s)||a.description.toLowerCase().includes(s)||a.id.toLowerCase().includes(s))},[p,h]),B=t.useMemo(()=>{if(!h.trim())return ce;const s=h.toLowerCase();return ce.filter(a=>{const l=Le[a.id];return a.name.toLowerCase().includes(s)||a.id.toLowerCase().includes(s)||l.description.toLowerCase().includes(s)})},[h]);t.useEffect(()=>{if(!d||!h.trim())return;const s=[...W.map(a=>a.id),...B.map(a=>a.id)];s.length===1&&s[0]!==o&&M(s[0])},[d,h,W,B,o]);const c=t.useMemo(()=>p.find(s=>s.id===o),[p,o]),Ye=t.useMemo(()=>{if(c!=null&&c.model)return c.model},[c]),Qe=t.useMemo(()=>{if(c!=null&&c.customModelPath)return re(`/api/custom-models/${c.id}`)},[c]),Ve=c==null?void 0:c.modelScale,Ze=t.useMemo(()=>c?"scout":o,[o,c]),K=t.useCallback(async s=>{je(!0);try{const a=s?re(`/api/agents/claude-sessions?cwd=${encodeURIComponent(s)}`):re("/api/agents/claude-sessions"),r=await(await ds(a)).json();Q(r.sessions||[])}catch(a){console.error("Failed to fetch sessions:",a),Q([])}finally{je(!1)}},[]);t.useEffect(()=>{d?K(k||void 0):(Q([]),U(null),ve(""))},[d,K]),t.useEffect(()=>{if(!d)return;const s=setTimeout(()=>{K(k||void 0),U(null)},300);return()=>clearTimeout(s)},[k,d,K]),t.useEffect(()=>{if(!d||!v)return;const s=b.getState().areas.get(v);if(s!=null&&s.directories&&s.directories.length>0){O(s.directories[0]);return}const a=Array.from(b.getState().agents.values()).filter(g=>{var P;return((P=b.getAreaForAgent(g.id))==null?void 0:P.id)===v&&g.cwd});if(a.length===0)return;const l=new Map;for(const g of a)l.set(g.cwd,(l.get(g.cwd)||0)+1);let r="",u=0;for(const[g,P]of l)P>u&&(r=g,u=P);r&&O(r)},[d,v]),t.useEffect(()=>{if(d){const s=new Set(Array.from(b.getState().agents.values()).map(u=>u.name)),a=$e(s,X),l=p.find(u=>u.id===o),r=l?`${l.name} ${a}`:a;N(r),q.current&&(q.current.focus(),q.current.select())}},[d,X]),t.useEffect(()=>{if(!d)return;const s=p.find(a=>a.id===o);if(s){const a=p.find(l=>m.startsWith(l.name+" "));if(a){const l=m.substring(a.name.length+1);N(`${s.name} ${l}`)}else N(`${s.name} ${m}`)}else{const a=p.find(l=>m.startsWith(l.name+" "));if(a){const l=m.substring(a.name.length+1);N(l)}}},[o]),t.useEffect(()=>{o==="boss"&&Ne("claude-opus-4-8[1m]")},[o]);const es=()=>{var r;console.log("[SpawnModal] handleSpawn called"),R(!1);const s=E&&((r=y.find(u=>u.sessionId===E))==null?void 0:r.projectPath)||k;if(console.log("[SpawnModal] Effective CWD:",s),console.log("[SpawnModal] Agent name:",m),console.log("[SpawnModal] Agent class:",o),console.log("[SpawnModal] Permission mode:",G),console.log("[SpawnModal] Provider:",i),console.log("[SpawnModal] Use Chrome:",z),console.log("[SpawnModal] Session ID:",E||"none"),!s.trim()){console.error("[SpawnModal] Empty CWD, showing error"),R(!0);return}if(!m.trim()){console.log("[SpawnModal] Empty name, regenerating");const u=new Set(Array.from(b.getState().agents.values()).map(g=>g.name));N($e(u,X));return}fs(oe.LAST_CWD,s),I(!0),S();const a=Array.from(V),l=Se.trim()||void 0;console.log("[SpawnModal] Calling store.spawnAgent with:",{name:m.trim(),class:o,cwd:s.trim(),sessionId:E||void 0,useChrome:i==="claude"?z:!1,permissionMode:G,provider:i,codexConfig:i==="codex"?f:void 0,codexModel:i==="codex"?ne:void 0,opencodeModel:i==="opencode"?ae:void 0,grokModel:i==="grok"?te:void 0,piModel:i==="pi"&&le||void 0,initialSkillIds:a,model:i==="claude"?ee:void 0,customInstructions:l?`${l.length} chars`:void 0,spawnAreaId:v||void 0}),window.__spawnModalAreaContext=v?{areaId:v}:null,b.spawnAgent(m.trim(),o,s.trim(),Pe||void 0,E||void 0,i==="claude"?z:!1,G,a,i,i==="codex"?f:void 0,i==="codex"?ne:void 0,i==="claude"?ee:void 0,l,i==="claude"||i==="grok"||i==="pi"?se:void 0,i==="opencode"?ae:void 0,i==="grok"?te:void 0,i==="pi"&&le||void 0)},ye=()=>{console.log("[SpawnModal] Agent creation successful"),I(!1),N(""),Z(new Set),$(),C(),j()},Ee=()=>{console.error("[SpawnModal] Agent creation failed"),I(!1),R(!0),$(),C()},Ae=s=>{console.log("[SpawnModal] Directory not found:",s),I(!1),ge(s),Y(!0),C()},De=()=>{Y(!1),I(!0),S(),b.createDirectoryAndSpawn(fe,m.trim(),o)},ie=()=>{Y(!1),ge(""),$()};t.useEffect(()=>(window.__spawnModalSuccess=ye,window.__spawnModalError=Ee,window.__spawnModalDirNotFound=Ae,()=>{$(),delete window.__spawnModalSuccess,delete window.__spawnModalError,delete window.__spawnModalDirNotFound}),[m,o,ye,Ee,Ae,$]);const{handleMouseDown:ss,handleClick:ns}=ps(j),as=s=>{s.key==="Escape"&&j()};return!d&&!xe?null:xe?e.jsx("div",{className:"modal-overlay visible",onClick:ie,onKeyDown:s=>{s.key==="Escape"&&ie(),s.key==="Enter"&&De()},children:e.jsxs("div",{className:"modal confirm-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"modal-header",children:n("terminal:spawn.directoryNotFound")}),e.jsxs("div",{className:"modal-body confirm-modal-body",children:[e.jsx("p",{children:n("terminal:spawn.directoryNotExist")}),e.jsx("code",{className:"confirm-modal-path",children:fe}),e.jsx("p",{children:n("terminal:spawn.wouldYouCreate")})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn btn-secondary",onClick:ie,children:n("common:buttons.cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:De,autoFocus:!0,children:n("terminal:spawn.createDirectory")})]})]})}):e.jsx("div",{className:`modal-overlay ${d?"visible":""}`,onMouseDown:ss,onClick:ns,onKeyDown:as,children:e.jsxs("div",{className:"modal spawn-modal",children:[e.jsx("div",{className:"modal-header",children:n("terminal:spawn.deployTitle")}),e.jsxs("div",{className:"modal-body spawn-modal-body",children:[e.jsxs("div",{className:"spawn-section",children:[e.jsxs("div",{className:"spawn-section-header",children:[e.jsx("h4",{className:"spawn-section-title",children:n("terminal:spawn.agentClass")}),e.jsx("span",{className:"spawn-section-hint",children:(c==null?void 0:c.name)||o})]}),e.jsxs("div",{className:"spawn-top-section",children:[e.jsxs("div",{className:"spawn-preview-compact",children:[e.jsx(ms,{agentClass:Ze,modelFile:Ye,customModelUrl:Qe,modelScale:Ve,width:110,height:130}),e.jsx("div",{className:"spawn-preview-label",children:(c==null?void 0:c.name)||o})]}),e.jsxs("div",{className:"spawn-class-section",children:[p.length+ce.length>6&&e.jsx("input",{type:"text",className:"spawn-input class-search-input",placeholder:n("terminal:spawn.filterClasses"),value:h,onChange:s=>Oe(s.target.value)}),e.jsxs("div",{className:"class-selector-inline",children:[W.map(s=>e.jsxs("button",{className:`class-chip ${o===s.id?"selected":""}`,onClick:()=>M(s.id),title:s.description,children:[e.jsx(_e,{classId:s.id,size:18,className:"class-chip-icon"}),e.jsx("span",{className:"class-chip-name",children:s.name})]},s.id)),B.map(s=>{const a=Le[s.id];return e.jsxs("button",{className:`class-chip ${o===s.id?"selected":""}`,onClick:()=>M(s.id),title:a.description,children:[e.jsx(_e,{classId:s.id,size:18,className:"class-chip-icon"}),e.jsx("span",{className:"class-chip-name",children:s.name})]},s.id)}),h&&W.length===0&&B.length===0&&e.jsx("div",{className:"class-search-empty",children:n("terminal:spawn.noClassesMatch",{query:h})})]})]})]}),e.jsxs("div",{className:"spawn-form-row",children:[e.jsxs("div",{className:"spawn-field",children:[e.jsx("label",{className:"spawn-label",children:n("common:labels.name")}),e.jsx("input",{ref:q,type:"text",className:"spawn-input",placeholder:n("terminal:spawn.agentNamePlaceholder"),value:m,onChange:s=>N(s.target.value)})]}),e.jsxs("div",{className:"spawn-field spawn-field-wide",children:[e.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.workingDir"),e.jsx(x,{text:n("terminal:spawn.helpWorkingDir"),title:n("terminal:spawn.workingDir"),position:"top",size:"sm"})]}),e.jsx(us,{value:k,onChange:s=>{O(s),R(!1)},placeholder:n("terminal:spawn.workingDirPlaceholder"),className:`spawn-input ${Te?"error":""}`,directoriesOnly:!0})]})]})]}),e.jsxs("div",{className:"spawn-section",children:[e.jsx("div",{className:"spawn-section-header",children:e.jsx("h4",{className:"spawn-section-title",children:n("terminal:spawn.selectRuntime")})}),e.jsxs("div",{className:"spawn-form-row",children:[e.jsxs("div",{className:"spawn-field",children:[e.jsxs("label",{className:"spawn-label",children:[n("common:labels.runtime"),e.jsx(x,{text:n("terminal:spawn.helpRuntime"),title:n("terminal:spawn.runtimeTitle"),position:"top",size:"sm"})]}),e.jsxs("div",{className:"spawn-select-row",children:[e.jsxs("button",{className:`spawn-select-btn ${i==="claude"?"selected":""}`,onClick:()=>_("claude"),title:n("terminal:spawn.useClaudeCli"),children:[e.jsx("img",{src:"/assets/claude.ico",alt:"Claude",className:"spawn-provider-icon"}),e.jsx("span",{children:"Claude"})]}),e.jsxs("button",{className:`spawn-select-btn ${i==="codex"?"selected":""}`,onClick:()=>_("codex"),title:n("terminal:spawn.useCodexCli"),children:[e.jsx("img",{src:"/assets/codex.ico",alt:"Codex",className:"spawn-provider-icon"}),e.jsx("span",{children:"Codex"})]}),e.jsxs("button",{className:`spawn-select-btn spawn-select-btn--opencode ${i==="opencode"?"selected":""}`,onClick:()=>_("opencode"),title:"Use OpenCode CLI (multi-provider)",children:[e.jsx("img",{src:"/assets/opencode.svg",alt:"OpenCode",className:"spawn-provider-icon"}),e.jsx("span",{children:"OpenCode"})]}),e.jsxs("button",{className:`spawn-select-btn spawn-select-btn--grok ${i==="grok"?"selected":""}`,onClick:()=>_("grok"),title:"Use Grok CLI (headless)",children:[e.jsx("img",{src:"/assets/grok.png",alt:"Grok",className:"spawn-provider-icon"}),e.jsx("span",{children:"Grok"})]}),e.jsxs("button",{className:`spawn-select-btn spawn-select-btn--pi ${i==="pi"?"selected":""}`,onClick:()=>_("pi"),title:"Use Pi coding agent CLI (multi-provider)",children:[e.jsx("img",{src:"/assets/pi.svg",alt:"Pi",className:"spawn-provider-icon"}),e.jsx("span",{children:"Pi"})]})]})]}),e.jsxs("div",{className:"spawn-field",children:[e.jsxs("label",{className:"spawn-label",children:[n("common:labels.permissions"),e.jsx(x,{text:n("terminal:spawn.helpPermission"),title:n("terminal:spawn.permissionMode"),position:"top",size:"sm"})]}),e.jsx("div",{className:"spawn-select-row",children:Object.keys(de).map(s=>e.jsxs("button",{className:`spawn-select-btn ${G===s?"selected":""}`,onClick:()=>Ue(s),title:de[s].description,children:[e.jsx("span",{children:e.jsx(pe,{name:s==="bypass"?"bolt":"lock",size:12})}),e.jsx("span",{children:de[s].label})]},s))})]})]}),e.jsx("div",{className:"spawn-form-row",children:e.jsxs("div",{className:"spawn-field",children:[e.jsxs("label",{className:"spawn-label",children:[n("common:labels.model"),e.jsx(x,{text:n("terminal:spawn.helpModel"),title:n("terminal:spawn.modelTitle"),position:"top",size:"sm"})]}),i==="claude"?e.jsx("div",{className:"spawn-select-row spawn-select-row--wrap",children:Object.keys(T).filter(s=>!T[s].deprecated).map(s=>e.jsxs("button",{className:`spawn-select-btn ${ee===s?"selected":""}`,onClick:()=>Ne(s),title:T[s].description,children:[e.jsx("span",{children:T[s].icon}),e.jsx("span",{children:T[s].label})]},s))}):i==="codex"?e.jsx("div",{className:"spawn-select-row spawn-select-row--codex-models",children:Object.keys(H).map(s=>e.jsxs("button",{className:`spawn-select-btn ${ne===s?"selected":""}`,onClick:()=>ze(s),title:H[s].description,children:[e.jsx("span",{children:H[s].icon}),e.jsx("span",{children:H[s].label})]},s))}):i==="opencode"?e.jsx(hs,{value:ae,onChange:Ge,inputId:"spawn-opencode-model"}):i==="grok"?e.jsx("div",{className:"spawn-select-row spawn-select-row--wrap",children:Object.keys(J).map(s=>e.jsxs("button",{className:`spawn-select-btn ${te===s?"selected":""}`,onClick:()=>qe(s),title:J[s].description,children:[e.jsx("span",{children:J[s].icon}),e.jsx("span",{children:J[s].label})]},s))}):i==="pi"?e.jsx(ws,{value:le,onChange:We,inputId:"spawn-pi-model"}):e.jsx("div",{className:"spawn-inline-hint",children:n("terminal:spawn.chooseCodexModel")})]})}),e.jsxs("div",{className:"spawn-form-row",children:[(i==="claude"||i==="grok"||i==="pi")&&e.jsxs("div",{className:"spawn-field",children:[e.jsx("label",{className:"spawn-label",children:"Effort"}),e.jsxs("div",{className:"spawn-select-row spawn-select-row--effort",children:[e.jsx("button",{className:`spawn-select-btn spawn-select-btn--compact ${se===void 0?"selected":""}`,onClick:()=>be(void 0),title:"Use default effort level",children:e.jsx("span",{children:"Default"})}),Object.keys(me).map(s=>e.jsx("button",{className:`spawn-select-btn spawn-select-btn--compact ${se===s?"selected":""}`,onClick:()=>be(s),title:me[s].description,children:e.jsx("span",{children:me[s].label})},s))]})]}),e.jsxs("div",{className:"spawn-field",children:[e.jsx("label",{className:"spawn-label",children:n("terminal:spawn.browser")}),e.jsxs("label",{className:"spawn-checkbox",children:[e.jsx("input",{type:"checkbox",checked:z,onChange:s=>Re(s.target.checked),disabled:i!=="claude"}),e.jsxs("span",{children:[e.jsx(pe,{name:"globe",size:12})," ",n("terminal:spawn.chromeBrowser")]}),e.jsx(x,{text:n(i==="claude"?"terminal:spawn.helpChrome":"terminal:spawn.helpChromeDisabled"),title:n("terminal:spawn.chromeBrowser"),position:"top",size:"sm"})]})]})]}),i==="codex"&&e.jsxs("div",{className:"codex-config-section",children:[e.jsx("div",{className:"codex-config-title",children:n("terminal:spawn.codex.configuration")}),e.jsxs("div",{className:"codex-config-options",children:[e.jsxs("div",{className:"codex-option-group",children:[e.jsxs("label",{className:"spawn-checkbox",children:[e.jsx("input",{type:"checkbox",checked:f.fullAuto!==!1,onChange:s=>A(a=>({...a,fullAuto:s.target.checked}))}),e.jsx("span",{children:n("terminal:spawn.codex.fullAuto")}),e.jsx(x,{text:n("terminal:spawn.helpFullAuto"),title:n("terminal:spawn.fullAutoTitle"),position:"top",size:"sm"})]}),e.jsxs("label",{className:"spawn-checkbox",children:[e.jsx("input",{type:"checkbox",checked:!!f.search,onChange:s=>A(a=>({...a,search:s.target.checked}))}),e.jsx("span",{children:n("terminal:spawn.codex.search")}),e.jsx(x,{text:n("terminal:spawn.helpSearch"),title:n("terminal:spawn.searchTitle"),position:"top",size:"sm"})]})]}),f.fullAuto===!1&&e.jsxs("div",{className:"codex-option-group",children:[e.jsx("div",{className:"codex-option-header",children:n("terminal:spawn.codex.restrictions")}),e.jsxs("select",{className:"spawn-input codex-select",value:f.sandbox||"workspace-write",onChange:s=>A(a=>({...a,sandbox:s.target.value})),children:[e.jsxs("option",{value:"read-only",children:["📖 ",n("terminal:spawn.codex.sandboxReadOnly")]}),e.jsxs("option",{value:"workspace-write",children:["✏️ ",n("terminal:spawn.codex.sandboxWorkspaceWrite")]}),e.jsxs("option",{value:"danger-full-access",children:["⚡ ",n("terminal:spawn.codex.sandboxDangerFullAccess")]})]}),e.jsxs("select",{className:"spawn-input codex-select",value:f.approvalMode||"on-request",onChange:s=>A(a=>({...a,approvalMode:s.target.value})),children:[e.jsxs("option",{value:"untrusted",children:["🔒 ",n("terminal:spawn.codex.approvalsUntrusted")]}),e.jsxs("option",{value:"on-failure",children:["⚠️ ",n("terminal:spawn.codex.approvalsOnFailure")]}),e.jsxs("option",{value:"on-request",children:["🤔 ",n("terminal:spawn.codex.approvalsOnRequest")]}),e.jsxs("option",{value:"never",children:["✅ ",n("terminal:spawn.codex.approvalsNever")]})]})]}),e.jsxs("div",{className:"codex-option-group",children:[e.jsx("div",{className:"codex-option-header",children:n("terminal:spawn.codex.profile")}),e.jsx("input",{type:"text",className:"spawn-input codex-profile-input",placeholder:n("terminal:spawn.codex.profilePlaceholder"),value:f.profile||"",onChange:s=>A(a=>({...a,profile:s.target.value||void 0}))})]}),e.jsxs("div",{className:"codex-option-group",children:[e.jsx("div",{className:"codex-option-header",children:n("terminal:spawn.codex.reasoningEffort")}),e.jsxs("select",{className:"spawn-input codex-select",value:f.reasoningEffort||"",onChange:s=>A(a=>({...a,reasoningEffort:s.target.value||void 0})),children:[e.jsx("option",{value:"",children:n("terminal:spawn.codex.reasoningEffortDefault")}),Object.keys(ue).map(s=>e.jsxs("option",{value:s,children:[ue[s].icon," ",ue[s].label]},s))]})]})]})]})]}),w.length>0&&e.jsxs("div",{className:"spawn-section spawn-skills-section",children:[e.jsxs("div",{className:"spawn-section-header",children:[e.jsxs("h4",{className:"spawn-section-title",children:[n("terminal:spawn.skills"),e.jsx(x,{text:n("terminal:spawn.helpSkills"),title:n("terminal:spawn.skillsTitle"),position:"top",size:"sm"})]}),e.jsxs("span",{className:"spawn-section-hint",children:[V.size," selected · ",n("common:labels.optional")]})]}),w.length>6&&e.jsx("input",{type:"text",className:"spawn-input skill-search-input",placeholder:n("terminal:spawn.filterSkills"),value:D,onChange:s=>Ke(s.target.value)}),e.jsxs("div",{className:"spawn-skills-inline",children:[ke.map(s=>{const a=V.has(s.id);return Xe.some(r=>r.id===s.id)?null:e.jsxs("button",{className:`spawn-skill-chip ${a?"selected":""}`,onClick:()=>Je(s.id),title:s.description,children:[a&&e.jsx("span",{className:"spawn-skill-check",children:e.jsx(pe,{name:"check",size:10})}),e.jsx("span",{children:s.name}),s.builtin&&e.jsx("span",{className:"spawn-skill-builtin",children:"TC"})]},s.id)}),D&&ke.length===0&&e.jsx("div",{className:"skill-search-empty",children:n("terminal:spawn.noSkillsMatch",{query:D})})]})]}),e.jsxs("details",{className:"spawn-advanced",children:[e.jsxs("summary",{children:[n("terminal:spawn.customInstructions")," & ",n("terminal:spawn.linkSession")]}),e.jsxs("div",{className:"spawn-advanced-body",children:[e.jsxs("div",{className:"spawn-custom-instructions-section",children:[e.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.customInstructions")," ",e.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]}),e.jsx(x,{text:n("terminal:spawn.helpCustomInstructions"),title:n("terminal:spawn.customInstructions"),position:"top",size:"sm"})]}),e.jsx("textarea",{className:"spawn-input spawn-textarea",placeholder:n("terminal:spawn.customInstructionsPlaceholder"),value:Se,onChange:s=>Be(s.target.value),rows:3})]}),e.jsxs("div",{className:"spawn-sessions-section",children:[e.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.linkSession")," ",e.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]}),e.jsx(x,{text:n("terminal:spawn.helpLinkSession"),title:n("terminal:spawn.linkSessionTitle"),position:"top",size:"sm"})]}),y.length>0&&e.jsx("input",{type:"text",className:"spawn-input session-search-input",placeholder:n("terminal:spawn.searchSessions"),value:L,onChange:s=>ve(s.target.value)}),e.jsx("div",{className:"sessions-list",children:Fe?e.jsx("div",{className:"sessions-loading",children:n("terminal:spawn.loadingSessions")}):y.length===0?e.jsx("div",{className:"sessions-empty",children:n("terminal:spawn.noSessions")}):Me.length===0?e.jsx("div",{className:"sessions-empty",children:n("terminal:spawn.noSessionsMatch",{query:L})}):Me.map(s=>{const a=E===s.sessionId,l=Date.now()-new Date(s.lastModified).getTime(),r=l<6e4?n("common:time.justNow"):l<36e5?n("common:time.minutesAgo",{count:Math.floor(l/6e4)}):l<864e5?n("common:time.hoursAgo",{count:Math.floor(l/36e5)}):n("common:time.daysAgo",{count:Math.floor(l/864e5)});return e.jsxs("div",{className:`session-item ${a?"selected":""}`,onClick:()=>{a?U(null):(U(s.sessionId),O(s.projectPath))},children:[e.jsxs("div",{className:"session-item-header",children:[e.jsx("span",{className:"session-item-path",children:s.projectPath}),e.jsx("span",{className:"session-item-age",children:r})]}),e.jsx("div",{className:"session-item-preview",children:s.firstMessage||n("terminal:spawn.messagesCount",{count:s.messageCount})})]},s.sessionId)})})]})]})]})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn btn-secondary",onClick:j,children:n("common:buttons.cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:es,disabled:we,children:n(we?"common:buttons.deploying":"common:buttons2.deploy")})]})]})})}export{Ns as SpawnModal};
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-Uz36XO2-.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Bvn63xfp.js";import{_ as i}from"./mermaid.core-Uz36XO2-.js";import"./chunk-5VM5RSS4-D8L5MdGs.js";import"./chunk-XXDRQBXY--Q2M75o8.js";import"./chunk-VR4S4FIN-DuQCapS-.js";import"./chunk-32BRIVSS-eWsLMUAK.js";import"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Bvn63xfp.js";import{_ as i}from"./mermaid.core-Uz36XO2-.js";import"./chunk-5VM5RSS4-D8L5MdGs.js";import"./chunk-XXDRQBXY--Q2M75o8.js";import"./chunk-VR4S4FIN-DuQCapS-.js";import"./chunk-32BRIVSS-eWsLMUAK.js";import"./main-B9DphKOa.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-CBPuP1jE.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};