@causyne/agent 1.20.124 → 1.20.127

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 (235) hide show
  1. package/bin/causyne.js +1 -1
  2. package/package.json +4 -4
  3. package/src/acp/protocol.ts +19 -1
  4. package/src/acp/server.js +282 -8
  5. package/src/acp/server.ts +284 -8
  6. package/src/agent/abortableDelay.js +2 -2
  7. package/src/agent/abortableDelay.ts +2 -2
  8. package/src/agent/errorClassifier.js +9 -1
  9. package/src/agent/errorClassifier.ts +8 -1
  10. package/src/agentLoop.js +83 -27
  11. package/src/agentLoop.ts +92 -26
  12. package/src/approvalPolicy.js +34 -10
  13. package/src/approvalPolicy.ts +42 -11
  14. package/src/browser/causyneBrowser.js +30 -3
  15. package/src/browser/causyneBrowser.ts +33 -3
  16. package/src/browser/urlPolicy.js +14 -1
  17. package/src/browser/urlPolicy.ts +12 -1
  18. package/src/cliMode.js +21 -9
  19. package/src/cliMode.ts +20 -8
  20. package/src/commands.js +188 -32
  21. package/src/commands.ts +209 -32
  22. package/src/config.js +19 -4
  23. package/src/config.ts +18 -4
  24. package/src/core/contextCompactor.js +54 -7
  25. package/src/core/contextCompactor.ts +63 -7
  26. package/src/core/goalLoop.js +257 -0
  27. package/src/core/goalLoop.ts +310 -0
  28. package/src/entrypoint.js +135 -3
  29. package/src/entrypoint.ts +136 -3
  30. package/src/game/causyneCoreBridge.js +686 -0
  31. package/src/game/causyneCoreBridge.ts +702 -0
  32. package/src/game/gameLauncher.js +287 -0
  33. package/src/game/gameLauncher.ts +352 -0
  34. package/src/game/gameProvisioner.js +425 -0
  35. package/src/game/gameProvisioner.ts +488 -0
  36. package/src/headlessCli.js +19 -12
  37. package/src/headlessCli.ts +22 -8
  38. package/src/infra/atomicWriter.js +40 -4
  39. package/src/infra/atomicWriter.ts +36 -4
  40. package/src/launchIntent.js +73 -3
  41. package/src/launchIntent.ts +76 -3
  42. package/src/lsp/lspClient.js +83 -12
  43. package/src/lsp/lspClient.ts +75 -12
  44. package/src/mcp/mcpRegistry.js +75 -8
  45. package/src/mcp/mcpRegistry.ts +70 -7
  46. package/src/memory/contextBudget.js +2 -0
  47. package/src/memory/contextBudget.ts +1 -0
  48. package/src/modelVariants.js +45 -0
  49. package/src/modelVariants.ts +54 -0
  50. package/src/outputRecovery.js +3 -2
  51. package/src/outputRecovery.ts +4 -2
  52. package/src/permissionPresets.js +327 -0
  53. package/src/permissionPresets.ts +361 -0
  54. package/src/providers/antigravity.js +62 -9
  55. package/src/providers/antigravity.ts +73 -9
  56. package/src/providers/byokHttp.js +7 -1
  57. package/src/providers/byokHttp.ts +6 -1
  58. package/src/providers/byokStream.js +21 -8
  59. package/src/providers/byokStream.ts +17 -7
  60. package/src/providers/dashscope-byok.js +21 -5
  61. package/src/providers/dashscope-byok.ts +29 -11
  62. package/src/providers/moonshot.js +26 -7
  63. package/src/providers/moonshot.ts +34 -13
  64. package/src/providers/muse.js +6 -0
  65. package/src/providers/muse.ts +8 -0
  66. package/src/providers/ollama.js +39 -7
  67. package/src/providers/ollama.ts +36 -7
  68. package/src/providers/openai-compatible.js +16 -3
  69. package/src/providers/openai-compatible.ts +13 -3
  70. package/src/providers/openai.js +62 -4
  71. package/src/providers/openai.ts +50 -4
  72. package/src/providers/openrouter.js +19 -4
  73. package/src/providers/openrouter.ts +21 -4
  74. package/src/providers/qwen-byok.js +21 -5
  75. package/src/providers/qwen-byok.ts +29 -11
  76. package/src/providers/xai.js +26 -10
  77. package/src/providers/xai.ts +34 -16
  78. package/src/reporting.js +4 -2
  79. package/src/reporting.ts +4 -2
  80. package/src/sandbox.js +34 -0
  81. package/src/sandbox.ts +43 -0
  82. package/src/scheduler/scheduler.js +372 -0
  83. package/src/scheduler/scheduler.ts +433 -0
  84. package/src/sessionSearchIndex.js +267 -0
  85. package/src/sessionSearchIndex.ts +311 -0
  86. package/src/skillsManager.js +2 -3
  87. package/src/skillsManager.ts +2 -3
  88. package/src/toolPacks.js +6 -0
  89. package/src/toolPacks.ts +6 -0
  90. package/src/tools/applyPatch.js +1 -1
  91. package/src/tools/applyPatch.ts +1 -1
  92. package/src/tools/generateMediaViaApi.js +4 -3
  93. package/src/tools/generateMediaViaApi.ts +4 -3
  94. package/src/tools/nativeEngine.js +2 -2
  95. package/src/tools/nativeEngine.ts +2 -2
  96. package/src/tools/openSourceToolProvisioner.js +2 -2
  97. package/src/tools/openSourceToolProvisioner.ts +2 -2
  98. package/src/tools/payloadSanitizer.js +0 -1
  99. package/src/tools/payloadSanitizer.ts +0 -1
  100. package/src/tools/pdfReader.js +122 -20
  101. package/src/tools/pdfReader.ts +111 -20
  102. package/src/tools/presentDeliverable.js +103 -0
  103. package/src/tools/presentDeliverable.ts +127 -0
  104. package/src/tools/ptcRuntime.js +444 -0
  105. package/src/tools/ptcRuntime.ts +490 -0
  106. package/src/tools/ptyTerminal.js +1096 -0
  107. package/src/tools/ptyTerminal.ts +1231 -0
  108. package/src/tools/registry.js +21 -12
  109. package/src/tools/registry.ts +21 -12
  110. package/src/tools/toolOutputStore.js +26 -4
  111. package/src/tools/toolOutputStore.ts +22 -4
  112. package/src/tools/webFetch.js +158 -11
  113. package/src/tools/webFetch.ts +145 -11
  114. package/src/tools/webSearch.js +123 -36
  115. package/src/tools/webSearch.ts +124 -33
  116. package/src/tui/banner.js +5 -1
  117. package/src/tui/banner.ts +6 -1
  118. package/src/tui/chatRenderer.js +1 -2
  119. package/src/tui/chatRenderer.ts +1 -2
  120. package/src/tui/completion.js +1 -0
  121. package/src/tui/completion.ts +1 -0
  122. package/src/tui/composerControls.js +111 -27
  123. package/src/tui/composerControls.ts +124 -28
  124. package/src/tui/dialogs.js +3 -16
  125. package/src/tui/dialogs.ts +3 -16
  126. package/src/tui/home.js +1 -0
  127. package/src/tui/home.ts +1 -0
  128. package/src/tui/invocation.js +1 -2
  129. package/src/tui/invocation.ts +1 -2
  130. package/src/tui/modelPicker.js +22 -12
  131. package/src/tui/modelPicker.ts +22 -12
  132. package/src/tui/overlay.js +2 -5
  133. package/src/tui/overlay.ts +2 -5
  134. package/src/tui/prompt.js +6 -4
  135. package/src/tui/prompt.ts +6 -4
  136. package/src/tui/selectList.js +4 -12
  137. package/src/tui/selectList.ts +4 -12
  138. package/src/tui/setup.js +22 -9
  139. package/src/tui/setup.ts +26 -9
  140. package/src/tui/statusLine.ts +2 -0
  141. package/src/web/client/browserPanel.js +702 -0
  142. package/src/web/client/browserPanel.ts +663 -0
  143. package/src/web/client/chatStream.js +309 -0
  144. package/src/web/client/chatStream.ts +289 -0
  145. package/src/web/client/cliPanel.js +165 -0
  146. package/src/web/client/cliPanel.ts +171 -0
  147. package/src/web/client/composer.js +204 -0
  148. package/src/web/client/composer.ts +209 -0
  149. package/src/web/client/diffPanel.js +176 -0
  150. package/src/web/client/diffPanel.ts +203 -0
  151. package/src/web/client/dom.js +220 -0
  152. package/src/web/client/dom.ts +221 -0
  153. package/src/web/client/filesAndCanvas.js +231 -0
  154. package/src/web/client/filesAndCanvas.ts +238 -0
  155. package/src/web/client/gameLauncherUi.js +78 -0
  156. package/src/web/client/gameLauncherUi.ts +78 -0
  157. package/src/web/client/main.js +301 -0
  158. package/src/web/client/main.ts +368 -0
  159. package/src/web/client/markdown.js +364 -0
  160. package/src/web/client/markdown.ts +373 -0
  161. package/src/web/client/modelPicker.js +455 -0
  162. package/src/web/client/modelPicker.ts +451 -0
  163. package/src/web/client/permissionPresetsUi.js +307 -0
  164. package/src/web/client/permissionPresetsUi.ts +333 -0
  165. package/src/web/client/sessions.js +353 -0
  166. package/src/web/client/sessions.ts +372 -0
  167. package/src/web/client/settingsModal.js +191 -0
  168. package/src/web/client/settingsModal.ts +176 -0
  169. package/src/web/client/state.js +250 -0
  170. package/src/web/client/state.ts +233 -0
  171. package/src/web/client/streamSmoother.js +127 -0
  172. package/src/web/client/streamSmoother.ts +119 -0
  173. package/src/web/client/studioLayout.js +54 -0
  174. package/src/web/client/studioLayout.ts +60 -0
  175. package/src/web/client/studioShell.js +327 -0
  176. package/src/web/client/studioShell.ts +340 -0
  177. package/src/web/client/studioStart.js +77 -0
  178. package/src/web/client/studioStart.ts +89 -0
  179. package/src/web/client/terminalPanel.js +357 -0
  180. package/src/web/client/terminalPanel.ts +345 -0
  181. package/src/web/client/turnView.js +934 -0
  182. package/src/web/client/turnView.ts +981 -0
  183. package/src/web/client/types.js +1 -0
  184. package/src/web/client/types.ts +319 -0
  185. package/src/web/client/validators.js +106 -0
  186. package/src/web/client/validators.ts +96 -0
  187. package/src/web/server/activeRuns.js +152 -0
  188. package/src/web/server/activeRuns.ts +171 -0
  189. package/src/web/server/routesBrowser.js +355 -0
  190. package/src/web/server/routesBrowser.ts +386 -0
  191. package/src/web/server/routesChat.js +304 -0
  192. package/src/web/server/routesChat.ts +347 -0
  193. package/src/web/server/routesCore.js +472 -0
  194. package/src/web/server/routesCore.ts +522 -0
  195. package/src/web/server/routesTerminal.js +162 -0
  196. package/src/web/server/routesTerminal.ts +182 -0
  197. package/src/web/server/routesWorkspace.js +510 -0
  198. package/src/web/server/routesWorkspace.ts +546 -0
  199. package/src/web/server/security.js +98 -0
  200. package/src/web/server/security.ts +108 -0
  201. package/src/web/server/sessionTranscript.js +586 -0
  202. package/src/web/server/sessionTranscript.ts +566 -0
  203. package/src/web/server/staticAssets.js +80 -0
  204. package/src/web/server/staticAssets.ts +91 -0
  205. package/src/web/server/types.js +1 -0
  206. package/src/web/server/types.ts +135 -0
  207. package/src/web/server/workspaceFiles.js +368 -0
  208. package/src/web/server/workspaceFiles.ts +363 -0
  209. package/src/web/skybridgeServer.js +76 -2449
  210. package/src/web/skybridgeServer.ts +118 -2600
  211. package/src/web/skybridgeUi.js +16 -450
  212. package/src/web/skybridgeUi.ts +16 -454
  213. package/src/web/styles/agent.css +380 -0
  214. package/src/web/styles/composer.css +193 -0
  215. package/src/web/styles/overlays.css +436 -0
  216. package/src/web/styles/shell.css +387 -0
  217. package/src/web/styles/studio.css +723 -0
  218. package/src/web/styles/thread.css +221 -0
  219. package/src/web/styles/tokens.css +94 -0
  220. package/src/web/ui/brandMark.js +73 -0
  221. package/src/web/ui/brandMark.ts +82 -0
  222. package/src/web/ui/modalsTemplate.js +139 -0
  223. package/src/web/ui/modalsTemplate.ts +139 -0
  224. package/src/web/ui/sidebarTemplate.js +63 -0
  225. package/src/web/ui/sidebarTemplate.ts +64 -0
  226. package/src/web/ui/studioTemplate.js +258 -0
  227. package/src/web/ui/studioTemplate.ts +258 -0
  228. package/src/web/ui/workspaceTemplate.js +72 -0
  229. package/src/web/ui/workspaceTemplate.ts +73 -0
  230. package/src/worktreeManager.js +16 -1
  231. package/src/worktreeManager.ts +22 -1
  232. package/src/web/skybridgeClientScript.js +0 -3951
  233. package/src/web/skybridgeClientScript.ts +0 -3952
  234. package/src/web/skybridgeStyles.js +0 -827
  235. package/src/web/skybridgeStyles.ts +0 -828
@@ -0,0 +1,139 @@
1
+ export function renderModalsHtml(): string {
2
+ return [
3
+ '<div id="model-popover" class="popover model-popover" role="dialog" aria-label="Select model"></div>',
4
+ '<div id="browser-more-popover" class="popover" role="menu" aria-label="Browser options">',
5
+ ' <div class="pop-section">Mode</div>',
6
+ ' <button id="bmode-agent-btn" class="pop-item active" type="button"><span>Live browser</span><span class="pop-sub">Shared</span></button>',
7
+ ' <button id="bmode-frame-btn" class="pop-item" type="button"><span>Local HTML preview</span><span class="pop-sub">Static</span></button>',
8
+ ' <div class="pop-divider"></div>',
9
+ ' <div class="pop-row">',
10
+ ' <span>Engine</span>',
11
+ ' <select id="browser-engine-select" class="pop-select" aria-label="Browser engine">',
12
+ ' <option value="auto">Auto</option>',
13
+ ' <option value="camoufox">Camoufox</option>',
14
+ ' <option value="chromium">Chromium</option>',
15
+ ' </select>',
16
+ ' </div>',
17
+ ' <div class="pop-row">',
18
+ ' <span>Viewport</span>',
19
+ ' <div class="seg-group" role="group" aria-label="Viewport size">',
20
+ ' <button class="seg-btn active" data-vp="desktop" type="button">Desktop</button>',
21
+ ' <button class="seg-btn" data-vp="tablet" type="button">Tablet</button>',
22
+ ' <button class="seg-btn" data-vp="mobile" type="button">Mobile</button>',
23
+ ' </div>',
24
+ ' </div>',
25
+ ' <div class="pop-divider"></div>',
26
+ ' <button id="browser-handoff-btn" class="pop-item" type="button"><span>Let Causyne browse</span></button>',
27
+ ' <button id="browser-snapshot-btn" class="pop-item" type="button"><span>Inspect page structure</span></button>',
28
+ ' <button id="browser-demo-btn" class="pop-item" type="button"><span>Preview open document</span></button>',
29
+ ' <button id="browser-open-ext-btn" class="pop-item" type="button" style="display:none"><span>Open in external tab</span></button>',
30
+ ' <div class="pop-divider"></div>',
31
+ ' <button id="browser-close-engine-btn" class="pop-item" type="button" style="color:var(--err)"><span>Close browser</span></button>',
32
+ '</div>',
33
+ '<div id="plus-popover" class="popover" role="menu" aria-label="Add to message">',
34
+ ' <div class="pop-section">Workspace</div>',
35
+ ' <button id="plus-attach-file" class="pop-item" type="button"><span>Attach file</span><span class="pop-sub">@file</span></button>',
36
+ ' <button id="plus-new-idoc" class="pop-item" type="button"><span>New document</span><span class="pop-sub">Editor</span></button>',
37
+ ' <button id="plus-open-browser" class="pop-item" type="button"><span>Open browser</span><span class="pop-sub">Browser</span></button>',
38
+ ' <button id="plus-open-diff" class="pop-item" type="button"><span>Review changes</span><span class="pop-sub">Changes</span></button>',
39
+ ' <button id="plus-open-doctor" class="pop-item" type="button"><span>Run diagnostics</span><span class="pop-sub">/doctor</span></button>',
40
+ '</div>',
41
+ '<div id="perm-popover" class="popover perm-popover" role="menu" aria-label="Permission preset"></div>',
42
+ '<div id="perm-confirm-modal" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="perm-confirm-title">',
43
+ ' <div class="modal-card perm-confirm-card">',
44
+ ' <div class="modal-head">',
45
+ ' <h2 id="perm-confirm-title" class="modal-title">Enable Full access?</h2>',
46
+ ' <button id="perm-confirm-close" class="icon-btn" type="button" aria-label="Close confirmation">',
47
+ ' <svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',
48
+ ' </button>',
49
+ ' </div>',
50
+ ' <p id="perm-confirm-desc" class="perm-confirm-desc">Full access reduces confirmation steps and allows Causyne to edit workspace files and execute commands directly. Destructive command and credential safeguards remain enforced.</p>',
51
+ ' <label class="perm-confirm-check-row">',
52
+ ' <input id="perm-confirm-check" type="checkbox">',
53
+ ' <span>I understand the risks and want to continue</span>',
54
+ ' </label>',
55
+ ' <div class="perm-confirm-actions">',
56
+ ' <button id="perm-confirm-cancel" class="btn-ghost" type="button">Cancel</button>',
57
+ ' <button id="perm-confirm-ok" class="btn-danger" type="button" disabled>Enable Full access</button>',
58
+ ' </div>',
59
+ ' </div>',
60
+ '</div>',
61
+ '<div id="settings-modal" class="modal-backdrop" role="dialog" aria-modal="true" aria-label="Settings">',
62
+ ' <div class="modal-card">',
63
+ ' <div class="modal-head">',
64
+ ' <h2 class="modal-title">Settings</h2>',
65
+ ' <button id="settings-close-btn" class="icon-btn" type="button" aria-label="Close settings">',
66
+ ' <svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',
67
+ ' </button>',
68
+ ' </div>',
69
+ ' <div class="setting-row">',
70
+ ' <div><div class="setting-label">Theme</div><div class="setting-desc">Switch between dark and light appearance</div></div>',
71
+ ' <button id="theme-toggle-btn" class="btn-ghost" type="button">Light</button>',
72
+ ' </div>',
73
+ ' <div class="setting-row">',
74
+ ' <div><div class="setting-label">Permission</div><div class="setting-desc">Choose the default permission preset for new sessions</div></div>',
75
+ ' <select id="settings-perm-select" class="pop-select" aria-label="Default permission preset">',
76
+ ' <option value="read-only">Read Only</option>',
77
+ ' <option value="workspace-write" selected>Workspace Write</option>',
78
+ ' <option value="danger-full-access">Full access</option>',
79
+ ' </select>',
80
+ ' </div>',
81
+ ' <div class="setting-row">',
82
+ ' <div><div class="setting-label">Workspace</div><div id="settings-ws-path" class="setting-desc"></div></div>',
83
+ ' <span class="pop-sub">Local only</span>',
84
+ ' </div>',
85
+ ' <div class="license-section">',
86
+ ' <div class="license-head">',
87
+ ' <div><div class="setting-label">Plan &amp; Support</div><div id="license-summary" class="setting-desc">Checking plan status...</div></div>',
88
+ ' <span id="license-badge" class="license-badge">Free</span>',
89
+ ' </div>',
90
+ ' <div id="license-meter-wrap" class="license-meter"><div id="license-meter-fill" class="license-meter-fill"></div></div>',
91
+ ' <div id="license-support-note" class="license-support-note">Upgrade to Causyne Pro for unlimited daily usage and to support ongoing independent development for the Causyne community.</div>',
92
+ ' <div class="vault-row">',
93
+ ' <select id="license-plan-select" aria-label="Causyne plan">',
94
+ ' <option value="monthly">Causyne Pro Monthly ($12/mo)</option>',
95
+ ' <option value="annual">Causyne Pro Annual ($99/yr · Save 31%)</option>',
96
+ ' <option value="two_month_pass">2-Month Pass ($22 one-time)</option>',
97
+ ' <option value="two_year_pass">2-Year Pass ($179 one-time)</option>',
98
+ ' </select>',
99
+ ' <button id="license-upgrade-btn" class="btn-primary" type="button">Upgrade</button>',
100
+ ' <button id="license-portal-btn" class="btn-ghost" type="button" style="display:none">Manage billing</button>',
101
+ ' <button id="license-refresh-btn" class="btn-ghost" type="button">Refresh</button>',
102
+ ' </div>',
103
+ ' <div class="vault-row">',
104
+ ' <input id="license-recovery-input" type="text" autocomplete="off" placeholder="Link recovery code (CSYN-XXXX-XXXX-XXXX-XXXX)">',
105
+ ' <button id="license-recover-btn" class="btn-ghost" type="button">Link license</button>',
106
+ ' </div>',
107
+ ' <div id="license-status-msg" class="setting-desc"></div>',
108
+ ' </div>',
109
+ ' <div style="display:flex;flex-direction:column;gap:8px;padding:10px 0;border-bottom:1px solid var(--border)">',
110
+ ' <div><div class="setting-label">API keys</div><div class="setting-desc">Stored encrypted on this device and never echoed back.</div></div>',
111
+ ' <div class="vault-row">',
112
+ ' <select id="vault-provider-select" aria-label="Provider">',
113
+ ' <option value="deepseek">DeepSeek</option>',
114
+ ' <option value="qwen">Qwen</option>',
115
+ ' <option value="dashscope-byok">Alibaba DashScope</option>',
116
+ ' <option value="anthropic">Anthropic</option>',
117
+ ' <option value="openai">OpenAI</option>',
118
+ ' <option value="gemini">Gemini</option>',
119
+ ' <option value="moonshot">Moonshot</option>',
120
+ ' <option value="xai">xAI</option>',
121
+ ' <option value="openrouter">OpenRouter</option>',
122
+ ' <option value="groq">Groq</option>',
123
+ ' <option value="cerebras">Cerebras</option>',
124
+ ' <option value="mistral">Mistral</option>',
125
+ ' </select>',
126
+ ' <input id="vault-key-input" type="password" autocomplete="off" placeholder="Paste API key">',
127
+ ' <button id="vault-save-btn" class="btn-primary" type="button">Save key</button>',
128
+ ' </div>',
129
+ ' <div id="vault-status" class="setting-desc"></div>',
130
+ ' </div>',
131
+ ' <div class="setting-row" style="border-bottom:none; padding-bottom:0">',
132
+ ' <div><div class="setting-label">Diagnostics</div><div class="setting-desc">Keys and tokens are automatically redacted.</div></div>',
133
+ ' <button id="doctor-load-btn" class="btn-ghost" type="button">Refresh</button>',
134
+ ' </div>',
135
+ ' <pre id="doctor-pre" class="doctor-pre">Click Refresh to view diagnostics.</pre>',
136
+ ' </div>',
137
+ '</div>'
138
+ ].join('\n');
139
+ }
@@ -0,0 +1,63 @@
1
+ import { renderCausyneMarkSvg } from './brandMark.js';
2
+ export function renderSidebarHtml(escapedWorkspaceName, escapedVersion) {
3
+ return [
4
+ ' <div id="sidebar-backdrop" class="sidebar-backdrop"></div>',
5
+ ' <aside class="sidebar" role="complementary" aria-label="Sidebar">',
6
+ ' <div class="sidebar-head">',
7
+ ' <button id="brand-home-btn" class="brand-btn" type="button" aria-label="Causyne">',
8
+ ` ${renderCausyneMarkSvg('causyne-mark-svg')}`,
9
+ ' <span class="brand-word">CAUSYNE</span>',
10
+ ' </button>',
11
+ ' <button id="close-sidebar-btn" class="icon-btn" type="button" aria-label="Close sidebar" title="Toggle sidebar">',
12
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="9" y1="4" x2="9" y2="20"/></svg>',
13
+ ' </button>',
14
+ ' </div>',
15
+ ' <nav class="sidebar-nav" aria-label="Sidebar">',
16
+ ' <button id="new-chat-btn" class="nav-row" type="button">',
17
+ ' <svg viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg>',
18
+ ' <span>New chat</span><span class="nav-kbd">⇧O</span>',
19
+ ' </button>',
20
+ ' <button id="nav-files-btn" class="nav-row" type="button">',
21
+ ' <svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/></svg>',
22
+ ' <span>Files</span>',
23
+ ' </button>',
24
+ ' <button id="nav-canvas-btn" class="nav-row" type="button">',
25
+ ' <svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><polyline points="14 2 14 8 20 8"/></svg>',
26
+ ' <span>Documents</span>',
27
+ ' </button>',
28
+ ' <button id="nav-terminal-btn" class="nav-row" type="button">',
29
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><polyline points="7 15 10 12 7 9"/><line x1="12" y1="15" x2="17" y2="15"/></svg>',
30
+ ' <span>Terminal</span><span class="nav-kbd">⌃`</span>',
31
+ ' </button>',
32
+ ' <button id="nav-browser-btn" class="nav-row" type="button">',
33
+ ' <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><line x1="3" y1="12" x2="21" y2="12"/><path d="M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>',
34
+ ' <span>Browser</span>',
35
+ ' </button>',
36
+ ' <button id="nav-game-btn" class="nav-row" type="button" title="Launch Causyne Game Studio">',
37
+ ' <svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',
38
+ ' <span>Causyne Game</span><span id="nav-game-badge" class="nav-kbd"></span>',
39
+ ' </button>',
40
+ ' <button id="nav-cli-btn" class="nav-row" type="button">',
41
+ ' <svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',
42
+ ' <span>Commands</span>',
43
+ ' </button>',
44
+ ' <button id="nav-diff-btn" class="nav-row" type="button">',
45
+ ' <svg viewBox="0 0 24 24"><circle cx="6" cy="6" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path d="M6 8.5v7A2.5 2.5 0 0 0 8.5 18H15"/><path d="M18 15.5v-7A2.5 2.5 0 0 0 15.5 6H9"/></svg>',
46
+ ' <span>Changes</span>',
47
+ ' </button>',
48
+ ' <button id="nav-settings-btn" class="nav-row" type="button">',
49
+ ' <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 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 1 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 1 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 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.08a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 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 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.08a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"/></svg>',
50
+ ' <span>Settings</span>',
51
+ ' </button>',
52
+ ' </nav>',
53
+ ' <div class="sidebar-search">',
54
+ ' <input id="session-search" type="search" placeholder="Search chats" aria-label="Search chats">',
55
+ ' </div>',
56
+ ' <div id="session-list" class="session-scroll" aria-label="Conversation history"></div>',
57
+ ' <div class="sidebar-foot">',
58
+ ` <span id="ws-pill" class="ws-name">${escapedWorkspaceName}</span>`,
59
+ ` <span id="ws-meta" class="ws-meta">v${escapedVersion}</span>`,
60
+ ' </div>',
61
+ ' </aside>'
62
+ ].join('\n');
63
+ }
@@ -0,0 +1,64 @@
1
+ import { renderCausyneMarkSvg } from './brandMark.js';
2
+
3
+ export function renderSidebarHtml(escapedWorkspaceName: string, escapedVersion: string): string {
4
+ return [
5
+ ' <div id="sidebar-backdrop" class="sidebar-backdrop"></div>',
6
+ ' <aside class="sidebar" role="complementary" aria-label="Sidebar">',
7
+ ' <div class="sidebar-head">',
8
+ ' <button id="brand-home-btn" class="brand-btn" type="button" aria-label="Causyne">',
9
+ ` ${renderCausyneMarkSvg('causyne-mark-svg')}`,
10
+ ' <span class="brand-word">CAUSYNE</span>',
11
+ ' </button>',
12
+ ' <button id="close-sidebar-btn" class="icon-btn" type="button" aria-label="Close sidebar" title="Toggle sidebar">',
13
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="9" y1="4" x2="9" y2="20"/></svg>',
14
+ ' </button>',
15
+ ' </div>',
16
+ ' <nav class="sidebar-nav" aria-label="Sidebar">',
17
+ ' <button id="new-chat-btn" class="nav-row" type="button">',
18
+ ' <svg viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg>',
19
+ ' <span>New chat</span><span class="nav-kbd">⇧O</span>',
20
+ ' </button>',
21
+ ' <button id="nav-files-btn" class="nav-row" type="button">',
22
+ ' <svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/></svg>',
23
+ ' <span>Files</span>',
24
+ ' </button>',
25
+ ' <button id="nav-canvas-btn" class="nav-row" type="button">',
26
+ ' <svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><polyline points="14 2 14 8 20 8"/></svg>',
27
+ ' <span>Documents</span>',
28
+ ' </button>',
29
+ ' <button id="nav-terminal-btn" class="nav-row" type="button">',
30
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><polyline points="7 15 10 12 7 9"/><line x1="12" y1="15" x2="17" y2="15"/></svg>',
31
+ ' <span>Terminal</span><span class="nav-kbd">⌃`</span>',
32
+ ' </button>',
33
+ ' <button id="nav-browser-btn" class="nav-row" type="button">',
34
+ ' <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><line x1="3" y1="12" x2="21" y2="12"/><path d="M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>',
35
+ ' <span>Browser</span>',
36
+ ' </button>',
37
+ ' <button id="nav-game-btn" class="nav-row" type="button" title="Launch Causyne Game Studio">',
38
+ ' <svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',
39
+ ' <span>Causyne Game</span><span id="nav-game-badge" class="nav-kbd"></span>',
40
+ ' </button>',
41
+ ' <button id="nav-cli-btn" class="nav-row" type="button">',
42
+ ' <svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',
43
+ ' <span>Commands</span>',
44
+ ' </button>',
45
+ ' <button id="nav-diff-btn" class="nav-row" type="button">',
46
+ ' <svg viewBox="0 0 24 24"><circle cx="6" cy="6" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path d="M6 8.5v7A2.5 2.5 0 0 0 8.5 18H15"/><path d="M18 15.5v-7A2.5 2.5 0 0 0 15.5 6H9"/></svg>',
47
+ ' <span>Changes</span>',
48
+ ' </button>',
49
+ ' <button id="nav-settings-btn" class="nav-row" type="button">',
50
+ ' <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 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 1 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 1 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 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.08a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 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 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.08a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"/></svg>',
51
+ ' <span>Settings</span>',
52
+ ' </button>',
53
+ ' </nav>',
54
+ ' <div class="sidebar-search">',
55
+ ' <input id="session-search" type="search" placeholder="Search chats" aria-label="Search chats">',
56
+ ' </div>',
57
+ ' <div id="session-list" class="session-scroll" aria-label="Conversation history"></div>',
58
+ ' <div class="sidebar-foot">',
59
+ ` <span id="ws-pill" class="ws-name">${escapedWorkspaceName}</span>`,
60
+ ` <span id="ws-meta" class="ws-meta">v${escapedVersion}</span>`,
61
+ ' </div>',
62
+ ' </aside>'
63
+ ].join('\n');
64
+ }
@@ -0,0 +1,258 @@
1
+ export function renderStudioHtml() {
2
+ return [
3
+ ' <div id="studio-resizer" class="studio-resizer" role="separator" aria-orientation="vertical" aria-label="Resize panel"></div>',
4
+ ' <aside id="studio-pane-root" class="studio" aria-label="Workspace panel">',
5
+ ' <div class="studio-head">',
6
+ ' <div class="studio-tabs" role="tablist">',
7
+ ' <button class="studio-tab" data-tab="start" type="button" role="tab" title="Workspace tools launcher">',
8
+ ' <svg class="studio-tab-icon" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/></svg>',
9
+ ' <span>Start</span>',
10
+ ' </button>',
11
+ ' <button class="studio-tab active" data-tab="files" type="button" role="tab">Files</button>',
12
+ ' <button class="studio-tab" data-tab="canvas" type="button" role="tab">Editor</button>',
13
+ ' <button class="studio-tab" data-tab="terminal" type="button" role="tab">Terminal</button>',
14
+ ' <button class="studio-tab" data-tab="browser" type="button" role="tab">Browser</button>',
15
+ ' <button class="studio-tab" data-tab="diff" type="button" role="tab">Changes</button>',
16
+ ' <button class="studio-tab" data-tab="cli" type="button" role="tab">Commands</button>',
17
+ ' </div>',
18
+ ' <div class="studio-head-actions">',
19
+ ' <button id="studio-new-tab-btn" class="icon-btn" type="button" aria-label="Start launcher" title="Open Start launcher">',
20
+ ' <svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>',
21
+ ' </button>',
22
+ ' <button id="studio-split-btn" class="icon-btn" type="button" aria-label="Split pane" title="Split pane (⌘\\)" aria-pressed="false">',
23
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="12" y1="4" x2="12" y2="20"/></svg>',
24
+ ' </button>',
25
+ ' <button id="studio-expand-btn" class="icon-btn" type="button" aria-label="Expand panel" title="Expand panel (⌘⌥↵)">',
26
+ ' <svg viewBox="0 0 24 24"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',
27
+ ' </button>',
28
+ ' <button id="studio-close-btn" class="icon-btn" type="button" aria-label="Close panel" title="Close panel">',
29
+ ' <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="15" y1="4" x2="15" y2="20"/></svg>',
30
+ ' </button>',
31
+ ' </div>',
32
+ ' </div>',
33
+ ' <div id="studio-split-bar" class="studio-split-bar">',
34
+ ' <span class="studio-split-label">Split view</span>',
35
+ ' <div class="studio-split-controls">',
36
+ ' <label class="pop-sub" for="studio-secondary-select">Right pane</label>',
37
+ ' <select id="studio-secondary-select" class="pop-select" aria-label="Secondary split pane">',
38
+ ' <option value="terminal">Terminal</option>',
39
+ ' <option value="browser">Browser</option>',
40
+ ' <option value="files">Files</option>',
41
+ ' <option value="canvas">Editor</option>',
42
+ ' <option value="diff">Changes</option>',
43
+ ' <option value="cli">Commands</option>',
44
+ ' <option value="start">Start</option>',
45
+ ' </select>',
46
+ ' <button id="studio-split-swap-btn" class="btn-ghost" type="button" title="Swap split panes">Swap</button>',
47
+ ' <button id="studio-split-close-btn" class="btn-ghost" type="button" title="Close split pane">Single</button>',
48
+ ' </div>',
49
+ ' </div>',
50
+ ' <div id="studio-panes-grid" class="studio-panes-grid">',
51
+ ' <div class="studio-pane" data-pane="start">',
52
+ ' <div class="studio-start-wrap">',
53
+ ' <div class="studio-start-emblem" aria-hidden="true">',
54
+ ' <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/></svg>',
55
+ ' </div>',
56
+ ' <div class="studio-start-list">',
57
+ ' <button id="start-files-btn" class="start-card" type="button">',
58
+ ' <span class="start-card-icon start-icon-files"><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/></svg></span>',
59
+ ' <span class="start-card-body">',
60
+ ' <span class="start-card-title">Workspace files</span>',
61
+ ' <span class="start-card-sub">Browse files in this session\'s workspace</span>',
62
+ ' </span>',
63
+ ' <span id="start-kbd-files" class="start-card-kbd">⌘P</span>',
64
+ ' </button>',
65
+ ' <div class="start-card start-card-terminal-row">',
66
+ ' <button id="start-terminal-btn" class="start-card-main-btn" type="button">',
67
+ ' <span class="start-card-icon start-icon-terminal"><svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg></span>',
68
+ ' <span class="start-card-body">',
69
+ ' <span class="start-card-title">New terminal</span>',
70
+ ' <span class="start-card-sub">Run commands in the Session workspace</span>',
71
+ ' </span>',
72
+ ' </button>',
73
+ ' <select id="start-shell-select" class="start-shell-select" aria-label="Select shell"></select>',
74
+ ' <span id="start-kbd-terminal" class="start-card-kbd">⌃`</span>',
75
+ ' </div>',
76
+ ' <button id="start-browser-btn" class="start-card" type="button">',
77
+ ' <span class="start-card-icon start-icon-browser"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><line x1="3" y1="12" x2="21" y2="12"/><path d="M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg></span>',
78
+ ' <span class="start-card-body">',
79
+ ' <span class="start-card-title">Browser</span>',
80
+ ' <span class="start-card-sub">Browse web pages</span>',
81
+ ' </span>',
82
+ ' <span id="start-kbd-browser" class="start-card-kbd">⌘T</span>',
83
+ ' </button>',
84
+ ' <button id="start-more-btn" class="start-card start-card-compact" type="button" aria-expanded="false">',
85
+ ' <span class="start-card-icon start-icon-more"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/><line x1="17.5" y1="3.5" x2="17.5" y2="9.5"/><line x1="14.5" y1="6.5" x2="20.5" y2="6.5"/></svg></span>',
86
+ ' <span class="start-card-body"><span class="start-card-title">More tools</span></span>',
87
+ ' </button>',
88
+ ' <div id="start-more-shelf" class="start-more-shelf">',
89
+ ' <button id="start-editor-btn" class="start-mini-btn" type="button">Editor &amp; Preview</button>',
90
+ ' <button id="start-diff-btn" class="start-mini-btn" type="button">Workspace Changes</button>',
91
+ ' <button id="start-cli-btn" class="start-mini-btn" type="button">Slash Commands</button>',
92
+ ' <button id="start-game-btn" class="start-mini-btn" type="button">Causyne Game</button>',
93
+ ' <button id="start-settings-btn" class="start-mini-btn" type="button">Settings</button>',
94
+ ' </div>',
95
+ ' </div>',
96
+ ' </div>',
97
+ ' </div>',
98
+ ' <div class="studio-pane active" data-pane="files">',
99
+ ' <div class="studio-bar">',
100
+ ' <button id="file-up-btn" class="btn-ghost" type="button" disabled>..</button>',
101
+ ' <input id="file-filter" type="search" placeholder="Filter files" aria-label="Filter files">',
102
+ ' <button id="refresh-files" class="btn-ghost" type="button">Refresh</button>',
103
+ ' </div>',
104
+ ' <div id="file-list" class="studio-scroll"></div>',
105
+ ' </div>',
106
+ ' <div class="studio-pane" data-pane="canvas">',
107
+ ' <div class="studio-bar">',
108
+ ' <input id="file-path-input" type="text" placeholder="notes.md" aria-label="File path">',
109
+ ' <select id="artifact-version-select" class="pop-select" style="display:none" aria-label="Version"></select>',
110
+ ' <div class="seg-group" role="group" aria-label="View mode">',
111
+ ' <button id="canvas-code-btn" class="seg-btn active" type="button">Code</button>',
112
+ ' <button id="canvas-mode-btn" class="seg-btn" type="button">Preview</button>',
113
+ ' </div>',
114
+ ' <button id="save-file-btn" class="btn-primary" type="button">Save</button>',
115
+ ' </div>',
116
+ ' <textarea id="file-content-input" class="canvas-editor" placeholder="Open a file or start writing..."></textarea>',
117
+ ' <div id="canvas-preview" class="canvas-preview assistant-prose"></div>',
118
+ ' <iframe id="canvas-html-frame" class="canvas-iframe" sandbox="allow-scripts" title="Document preview"></iframe>',
119
+ ' <div class="canvas-foot">',
120
+ ' <span id="file-status">Ready</span>',
121
+ ' <div style="display:flex; gap:6px">',
122
+ ' <button id="canvas-download-btn" class="btn-ghost" type="button">Download</button>',
123
+ ' <button id="canvas-refine-btn" class="btn-ghost" type="button">Ask Causyne</button>',
124
+ ' </div>',
125
+ ' </div>',
126
+ ' </div>',
127
+ ' <div class="studio-pane" data-pane="terminal">',
128
+ ' <div class="term-tabs-row">',
129
+ ' <div id="term-tabs" class="browser-tabs">',
130
+ ' <button id="term-new-btn" class="btab" type="button" title="New terminal session">+</button>',
131
+ ' </div>',
132
+ ' <div class="browser-tab-actions">',
133
+ ' <select id="term-shell-select" class="pop-select" aria-label="Terminal shell"></select>',
134
+ ' <button id="term-sigint-btn" class="btn-ghost" type="button" title="Send Ctrl+C (SIGINT)">^C</button>',
135
+ ' <button id="term-clear-btn" class="btn-ghost" type="button" title="Clear viewport">Clear</button>',
136
+ ' </div>',
137
+ ' </div>',
138
+ ' <div id="term-control-banner" class="term-control-banner">',
139
+ ' <span id="term-control-text">Causyne is running a terminal session</span>',
140
+ ' <button id="term-take-control-btn" class="btn-primary" type="button">Take control</button>',
141
+ ' </div>',
142
+ ' <div id="term-empty" class="browser-empty">',
143
+ ' <div class="browser-empty-title">Workspace Terminal</div>',
144
+ ' <div class="browser-empty-sub">Run live interactive shell sessions scoped to this workspace.</div>',
145
+ ' <button id="term-empty-start-btn" class="btn-primary" type="button">New terminal</button>',
146
+ ' </div>',
147
+ ' <pre id="term-viewport" class="term-viewport" tabindex="0" aria-label="Interactive terminal output"></pre>',
148
+ ' <div class="term-input-bar">',
149
+ ' <span class="term-prompt-sig">$</span>',
150
+ ' <input id="term-input" class="term-input" type="text" placeholder="Type command and press Enter (or focus terminal above)" aria-label="Terminal command input">',
151
+ ' <button id="term-send-btn" class="btn-primary" type="button">Run</button>',
152
+ ' </div>',
153
+ ' <div class="canvas-foot">',
154
+ ' <span id="term-status">No active terminal</span>',
155
+ ' <span id="term-meta" class="pop-sub"></span>',
156
+ ' </div>',
157
+ ' </div>',
158
+ ' <div class="studio-pane" data-pane="browser">',
159
+ ' <div id="browser-tabs-row" class="browser-tabs-row">',
160
+ ' <div id="browser-tabs" class="browser-tabs">',
161
+ ' <button id="browser-new-tab-btn" class="btab" type="button" title="New tab">+</button>',
162
+ ' </div>',
163
+ ' <div class="browser-tab-actions">',
164
+ ' <button id="browser-native-win-btn" class="icon-btn" type="button" title="Open in desktop window" aria-label="Open in desktop window">',
165
+ ' <svg viewBox="0 0 24 24"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>',
166
+ ' </button>',
167
+ ' <button id="browser-sync-toggle-btn" class="icon-btn" type="button" title="Import from Chrome" aria-label="Import from Chrome">',
168
+ ' <svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
169
+ ' </button>',
170
+ ' <button id="browser-more-btn" class="icon-btn" type="button" title="Browser options" aria-label="Browser options" aria-haspopup="menu" aria-expanded="false">',
171
+ ' <svg viewBox="0 0 24 24"><circle cx="5" cy="12" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="19" cy="12" r="1.5"/></svg>',
172
+ ' </button>',
173
+ ' </div>',
174
+ ' </div>',
175
+ ' <div class="browser-bar">',
176
+ ' <button id="browser-back-btn" class="icon-btn" type="button" title="Back" aria-label="Back">',
177
+ ' <svg viewBox="0 0 24 24"><polyline points="15 18 9 12 15 6"/></svg>',
178
+ ' </button>',
179
+ ' <button id="browser-fwd-btn" class="icon-btn" type="button" title="Forward" aria-label="Forward">',
180
+ ' <svg viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"/></svg>',
181
+ ' </button>',
182
+ ' <button id="browser-reload-btn" class="icon-btn" type="button" title="Reload" aria-label="Reload">',
183
+ ' <svg viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>',
184
+ ' </button>',
185
+ ' <input id="browser-url-input" class="browser-url-input" type="text" placeholder="Search or enter URL" aria-label="Address bar">',
186
+ ' <span id="browser-origin-badge" class="browser-origin-badge" title="Page navigated inside embedded frame">URL changed</span>',
187
+ ' </div>',
188
+ ' <div id="browser-sync-drawer" class="sync-drawer">',
189
+ ' <div class="vault-row">',
190
+ ' <span class="pop-sub">Chrome port</span>',
191
+ ' <input id="cdp-port-input" type="number" value="9222" style="width:82px;flex:0 0 82px">',
192
+ ' <button id="cdp-scan-btn" class="btn-primary" type="button">Find tabs</button>',
193
+ ' </div>',
194
+ ' <div id="cdp-tabs-list" style="display:flex;flex-direction:column;gap:5px"></div>',
195
+ ' <div class="pop-sub">Or paste URLs, Bookmarks HTML, or Playwright storageState JSON</div>',
196
+ ' <textarea id="browser-import-input" class="sync-textarea" placeholder="Paste URLs, Bookmarks.html, or storageState JSON"></textarea>',
197
+ ' <div style="display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap">',
198
+ ' <span id="cdp-sync-status" class="pop-sub">Transfers only the tabs or data you choose.</span>',
199
+ ' <button id="browser-import-btn" class="btn-ghost" type="button">Import</button>',
200
+ ' </div>',
201
+ ' </div>',
202
+ ' <div class="browser-stage">',
203
+ ' <div id="browser-restore-card" class="browser-restore-card">',
204
+ ' <div class="browser-empty-title">Previously opened</div>',
205
+ ' <div id="browser-restore-url" class="browser-empty-sub"></div>',
206
+ ' <div style="display:flex;gap:8px;justify-content:center">',
207
+ ' <button id="browser-restore-btn" class="btn-primary" type="button">Restore page</button>',
208
+ ' <button id="browser-restore-dismiss-btn" class="btn-ghost" type="button">Dismiss</button>',
209
+ ' </div>',
210
+ ' </div>',
211
+ ' <div id="browser-empty" class="browser-empty">',
212
+ ' <div class="browser-empty-title">Browser</div>',
213
+ ' <div class="browser-empty-sub">Browse pages alongside Causyne or open a native desktop window.</div>',
214
+ ' <div style="display:flex;gap:8px;flex-wrap:wrap;justify-content:center">',
215
+ ' <button id="browser-start-btn" class="btn-primary" type="button">Open browser</button>',
216
+ ' <button id="browser-start-native-btn" class="btn-ghost" type="button">Open in window</button>',
217
+ ' </div>',
218
+ ' </div>',
219
+ ' <div id="live-viewport-surface" class="live-viewport-wrap" tabindex="0" aria-label="Browser viewport">',
220
+ ' <div id="browser-agent-banner" class="agent-browser-banner">',
221
+ ' <span class="pulse-dot"></span>',
222
+ ' <span id="browser-agent-banner-text">Causyne is browsing</span>',
223
+ ' <button id="banner-take-control-btn" class="btn-primary" type="button">Take over</button>',
224
+ ' </div>',
225
+ ' <img id="live-browser-img" class="live-browser-img" draggable="false" alt="Browser viewport">',
226
+ ' </div>',
227
+ ' <iframe id="browser-frame" class="browser-frame" sandbox="allow-scripts allow-forms" style="display:none" title="Local preview"></iframe>',
228
+ ' </div>',
229
+ ' </div>',
230
+ ' <div class="studio-pane" data-pane="diff">',
231
+ ' <div class="studio-bar">',
232
+ ' <div class="seg-group" role="group" aria-label="Diff scope">',
233
+ ' <button id="diff-scope-session" class="seg-btn active" type="button">This chat</button>',
234
+ ' <button id="diff-scope-workspace" class="seg-btn" type="button">Workspace</button>',
235
+ ' </div>',
236
+ ' <button id="diff-staged-toggle" class="btn-ghost" type="button" style="display:none">Working</button>',
237
+ ' <span id="diff-summary" class="pop-sub" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">No changes</span>',
238
+ ' <button id="refresh-diff-btn" class="btn-ghost" type="button">Refresh</button>',
239
+ ' </div>',
240
+ ' <div id="diff-list" class="studio-scroll"></div>',
241
+ ' </div>',
242
+ ' <div class="studio-pane" data-pane="cli">',
243
+ ' <div class="studio-bar">',
244
+ ' <input id="cli-cmd-input" type="text" placeholder="Run a command, e.g. /status or /doctor" aria-label="Run command">',
245
+ ' <button id="cli-run-btn" class="btn-primary" type="button">Run</button>',
246
+ ' </div>',
247
+ ' <div id="cli-stats" class="cli-stats">Loading workspace...</div>',
248
+ ' <div id="cli-quick-grid" class="cli-grid"></div>',
249
+ ' <pre id="cli-console" class="cli-console">Select a command above or type /help.</pre>',
250
+ ' <div class="canvas-foot">',
251
+ ' <span id="cli-status">Ready</span>',
252
+ ' <button id="cli-probe-btn" class="btn-ghost" type="button">Test connections</button>',
253
+ ' </div>',
254
+ ' </div>',
255
+ ' </div>',
256
+ ' </aside>'
257
+ ].join('\n');
258
+ }