@causyne/agent 1.20.124 → 1.20.128

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 (254) hide show
  1. package/bin/causyne.js +1 -1
  2. package/docs/THIRD_PARTY_NOTICES.md +36 -2
  3. package/package.json +6 -4
  4. package/src/acp/protocol.ts +19 -1
  5. package/src/acp/server.js +282 -8
  6. package/src/acp/server.ts +284 -8
  7. package/src/agent/abortableDelay.js +2 -2
  8. package/src/agent/abortableDelay.ts +2 -2
  9. package/src/agent/errorClassifier.js +9 -1
  10. package/src/agent/errorClassifier.ts +8 -1
  11. package/src/agentLoop.js +142 -53
  12. package/src/agentLoop.ts +151 -50
  13. package/src/approvalPolicy.js +34 -10
  14. package/src/approvalPolicy.ts +42 -11
  15. package/src/browser/causyneBrowser.js +61 -3
  16. package/src/browser/causyneBrowser.ts +65 -3
  17. package/src/browser/urlPolicy.js +14 -1
  18. package/src/browser/urlPolicy.ts +12 -1
  19. package/src/cliMode.js +21 -9
  20. package/src/cliMode.ts +20 -8
  21. package/src/commands.js +365 -45
  22. package/src/commands.ts +403 -45
  23. package/src/config.js +19 -4
  24. package/src/config.ts +18 -4
  25. package/src/core/contextCompactor.js +54 -7
  26. package/src/core/contextCompactor.ts +63 -7
  27. package/src/core/goalLoop.js +257 -0
  28. package/src/core/goalLoop.ts +310 -0
  29. package/src/entrypoint.js +135 -3
  30. package/src/entrypoint.ts +136 -3
  31. package/src/game/causyneCoreBridge.js +686 -0
  32. package/src/game/causyneCoreBridge.ts +702 -0
  33. package/src/game/gameLauncher.js +287 -0
  34. package/src/game/gameLauncher.ts +352 -0
  35. package/src/game/gameProvisioner.js +425 -0
  36. package/src/game/gameProvisioner.ts +488 -0
  37. package/src/headlessCli.js +19 -12
  38. package/src/headlessCli.ts +22 -8
  39. package/src/infra/atomicWriter.js +40 -4
  40. package/src/infra/atomicWriter.ts +36 -4
  41. package/src/launchIntent.js +73 -3
  42. package/src/launchIntent.ts +76 -3
  43. package/src/lsp/lspClient.js +83 -12
  44. package/src/lsp/lspClient.ts +75 -12
  45. package/src/mcp/mcpRegistry.js +75 -8
  46. package/src/mcp/mcpRegistry.ts +70 -7
  47. package/src/memory/contextBudget.js +2 -0
  48. package/src/memory/contextBudget.ts +1 -0
  49. package/src/memory/episodicStore.js +40 -0
  50. package/src/memory/episodicStore.ts +46 -0
  51. package/src/memory.js +67 -0
  52. package/src/memory.ts +65 -0
  53. package/src/modelVariants.js +45 -0
  54. package/src/modelVariants.ts +54 -0
  55. package/src/outputRecovery.js +3 -2
  56. package/src/outputRecovery.ts +4 -2
  57. package/src/permissionPresets.js +327 -0
  58. package/src/permissionPresets.ts +361 -0
  59. package/src/personalization.js +365 -0
  60. package/src/personalization.ts +471 -0
  61. package/src/projectInstructions.js +30 -10
  62. package/src/projectInstructions.ts +31 -12
  63. package/src/providers/acp.js +3 -2
  64. package/src/providers/acp.ts +3 -2
  65. package/src/providers/antigravity.js +64 -9
  66. package/src/providers/antigravity.ts +75 -9
  67. package/src/providers/byokHttp.js +7 -1
  68. package/src/providers/byokHttp.ts +6 -1
  69. package/src/providers/byokStream.js +21 -8
  70. package/src/providers/byokStream.ts +17 -7
  71. package/src/providers/dashscope-byok.js +21 -5
  72. package/src/providers/dashscope-byok.ts +29 -11
  73. package/src/providers/moonshot.js +26 -7
  74. package/src/providers/moonshot.ts +34 -13
  75. package/src/providers/muse.js +6 -0
  76. package/src/providers/muse.ts +8 -0
  77. package/src/providers/ollama.js +39 -7
  78. package/src/providers/ollama.ts +36 -7
  79. package/src/providers/openai-compatible.js +16 -3
  80. package/src/providers/openai-compatible.ts +13 -3
  81. package/src/providers/openai.js +62 -4
  82. package/src/providers/openai.ts +50 -4
  83. package/src/providers/openrouter.js +19 -4
  84. package/src/providers/openrouter.ts +21 -4
  85. package/src/providers/qwen-byok.js +21 -5
  86. package/src/providers/qwen-byok.ts +29 -11
  87. package/src/providers/xai.js +26 -10
  88. package/src/providers/xai.ts +34 -16
  89. package/src/reporting.js +4 -2
  90. package/src/reporting.ts +4 -2
  91. package/src/sandbox.js +34 -0
  92. package/src/sandbox.ts +43 -0
  93. package/src/scheduler/scheduler.js +372 -0
  94. package/src/scheduler/scheduler.ts +433 -0
  95. package/src/sessionSearchIndex.js +267 -0
  96. package/src/sessionSearchIndex.ts +311 -0
  97. package/src/skillsManager.js +2 -3
  98. package/src/skillsManager.ts +2 -3
  99. package/src/toolPacks.js +6 -0
  100. package/src/toolPacks.ts +6 -0
  101. package/src/tools/applyPatch.js +1 -1
  102. package/src/tools/applyPatch.ts +1 -1
  103. package/src/tools/generateMediaViaApi.js +4 -3
  104. package/src/tools/generateMediaViaApi.ts +4 -3
  105. package/src/tools/memoryWrite.js +15 -1
  106. package/src/tools/memoryWrite.ts +16 -1
  107. package/src/tools/nativeEngine.js +2 -2
  108. package/src/tools/nativeEngine.ts +2 -2
  109. package/src/tools/openSourceToolProvisioner.js +2 -2
  110. package/src/tools/openSourceToolProvisioner.ts +2 -2
  111. package/src/tools/osSandbox.js +1 -1
  112. package/src/tools/osSandbox.ts +1 -1
  113. package/src/tools/payloadSanitizer.js +0 -1
  114. package/src/tools/payloadSanitizer.ts +0 -1
  115. package/src/tools/pdfReader.js +122 -20
  116. package/src/tools/pdfReader.ts +111 -20
  117. package/src/tools/presentDeliverable.js +103 -0
  118. package/src/tools/presentDeliverable.ts +127 -0
  119. package/src/tools/ptcRuntime.js +444 -0
  120. package/src/tools/ptcRuntime.ts +490 -0
  121. package/src/tools/ptyTerminal.js +1108 -0
  122. package/src/tools/ptyTerminal.ts +1245 -0
  123. package/src/tools/registry.js +21 -12
  124. package/src/tools/registry.ts +21 -12
  125. package/src/tools/toolOutputStore.js +26 -4
  126. package/src/tools/toolOutputStore.ts +22 -4
  127. package/src/tools/webFetch.js +158 -11
  128. package/src/tools/webFetch.ts +145 -11
  129. package/src/tools/webSearch.js +123 -36
  130. package/src/tools/webSearch.ts +124 -33
  131. package/src/tui/banner.js +5 -1
  132. package/src/tui/banner.ts +6 -1
  133. package/src/tui/chatRenderer.js +1 -2
  134. package/src/tui/chatRenderer.ts +1 -2
  135. package/src/tui/completion.js +1 -0
  136. package/src/tui/completion.ts +1 -0
  137. package/src/tui/composerControls.js +111 -27
  138. package/src/tui/composerControls.ts +124 -28
  139. package/src/tui/dialogs.js +3 -16
  140. package/src/tui/dialogs.ts +3 -16
  141. package/src/tui/home.js +1 -0
  142. package/src/tui/home.ts +1 -0
  143. package/src/tui/invocation.js +1 -2
  144. package/src/tui/invocation.ts +1 -2
  145. package/src/tui/modelPicker.js +22 -12
  146. package/src/tui/modelPicker.ts +22 -12
  147. package/src/tui/overlay.js +2 -5
  148. package/src/tui/overlay.ts +2 -5
  149. package/src/tui/prompt.js +6 -4
  150. package/src/tui/prompt.ts +6 -4
  151. package/src/tui/selectList.js +4 -12
  152. package/src/tui/selectList.ts +4 -12
  153. package/src/tui/setup.js +22 -9
  154. package/src/tui/setup.ts +26 -9
  155. package/src/tui/statusLine.ts +2 -0
  156. package/src/web/client/browserPanel.js +905 -0
  157. package/src/web/client/browserPanel.ts +872 -0
  158. package/src/web/client/chatStream.js +321 -0
  159. package/src/web/client/chatStream.ts +297 -0
  160. package/src/web/client/cliPanel.js +165 -0
  161. package/src/web/client/cliPanel.ts +171 -0
  162. package/src/web/client/composer.js +204 -0
  163. package/src/web/client/composer.ts +209 -0
  164. package/src/web/client/diffPanel.js +176 -0
  165. package/src/web/client/diffPanel.ts +203 -0
  166. package/src/web/client/dom.js +271 -0
  167. package/src/web/client/dom.ts +272 -0
  168. package/src/web/client/filesAndCanvas.js +233 -0
  169. package/src/web/client/filesAndCanvas.ts +240 -0
  170. package/src/web/client/gameLauncherUi.js +78 -0
  171. package/src/web/client/gameLauncherUi.ts +78 -0
  172. package/src/web/client/main.js +316 -0
  173. package/src/web/client/main.ts +391 -0
  174. package/src/web/client/markdown.js +364 -0
  175. package/src/web/client/markdown.ts +373 -0
  176. package/src/web/client/modelPicker.js +455 -0
  177. package/src/web/client/modelPicker.ts +451 -0
  178. package/src/web/client/permissionPresetsUi.js +307 -0
  179. package/src/web/client/permissionPresetsUi.ts +333 -0
  180. package/src/web/client/sessions.js +353 -0
  181. package/src/web/client/sessions.ts +372 -0
  182. package/src/web/client/settingsModal.js +824 -0
  183. package/src/web/client/settingsModal.ts +959 -0
  184. package/src/web/client/state.js +280 -0
  185. package/src/web/client/state.ts +259 -0
  186. package/src/web/client/streamSmoother.js +127 -0
  187. package/src/web/client/streamSmoother.ts +119 -0
  188. package/src/web/client/studioLayout.js +89 -0
  189. package/src/web/client/studioLayout.ts +103 -0
  190. package/src/web/client/studioShell.js +660 -0
  191. package/src/web/client/studioShell.ts +672 -0
  192. package/src/web/client/studioStart.js +77 -0
  193. package/src/web/client/studioStart.ts +89 -0
  194. package/src/web/client/terminalPanel.js +606 -0
  195. package/src/web/client/terminalPanel.ts +632 -0
  196. package/src/web/client/terminalTheme.js +249 -0
  197. package/src/web/client/terminalTheme.ts +258 -0
  198. package/src/web/client/turnView.js +934 -0
  199. package/src/web/client/turnView.ts +981 -0
  200. package/src/web/client/types.js +1 -0
  201. package/src/web/client/types.ts +322 -0
  202. package/src/web/client/validators.js +147 -0
  203. package/src/web/client/validators.ts +140 -0
  204. package/src/web/server/activeRuns.js +152 -0
  205. package/src/web/server/activeRuns.ts +171 -0
  206. package/src/web/server/routesBrowser.js +409 -0
  207. package/src/web/server/routesBrowser.ts +435 -0
  208. package/src/web/server/routesChat.js +304 -0
  209. package/src/web/server/routesChat.ts +347 -0
  210. package/src/web/server/routesCore.js +472 -0
  211. package/src/web/server/routesCore.ts +522 -0
  212. package/src/web/server/routesSettings.js +344 -0
  213. package/src/web/server/routesSettings.ts +397 -0
  214. package/src/web/server/routesTerminal.js +162 -0
  215. package/src/web/server/routesTerminal.ts +182 -0
  216. package/src/web/server/routesWorkspace.js +510 -0
  217. package/src/web/server/routesWorkspace.ts +546 -0
  218. package/src/web/server/security.js +98 -0
  219. package/src/web/server/security.ts +108 -0
  220. package/src/web/server/sessionTranscript.js +586 -0
  221. package/src/web/server/sessionTranscript.ts +566 -0
  222. package/src/web/server/staticAssets.js +104 -0
  223. package/src/web/server/staticAssets.ts +116 -0
  224. package/src/web/server/types.js +1 -0
  225. package/src/web/server/types.ts +135 -0
  226. package/src/web/server/workspaceFiles.js +368 -0
  227. package/src/web/server/workspaceFiles.ts +363 -0
  228. package/src/web/skybridgeServer.js +78 -2448
  229. package/src/web/skybridgeServer.ts +120 -2600
  230. package/src/web/skybridgeUi.js +20 -450
  231. package/src/web/skybridgeUi.ts +24 -455
  232. package/src/web/styles/agent.css +380 -0
  233. package/src/web/styles/composer.css +193 -0
  234. package/src/web/styles/overlays.css +935 -0
  235. package/src/web/styles/shell.css +387 -0
  236. package/src/web/styles/studio.css +951 -0
  237. package/src/web/styles/thread.css +221 -0
  238. package/src/web/styles/tokens.css +94 -0
  239. package/src/web/ui/brandMark.js +73 -0
  240. package/src/web/ui/brandMark.ts +82 -0
  241. package/src/web/ui/modalsTemplate.js +388 -0
  242. package/src/web/ui/modalsTemplate.ts +388 -0
  243. package/src/web/ui/sidebarTemplate.js +63 -0
  244. package/src/web/ui/sidebarTemplate.ts +64 -0
  245. package/src/web/ui/studioTemplate.js +256 -0
  246. package/src/web/ui/studioTemplate.ts +256 -0
  247. package/src/web/ui/workspaceTemplate.js +72 -0
  248. package/src/web/ui/workspaceTemplate.ts +73 -0
  249. package/src/worktreeManager.js +16 -1
  250. package/src/worktreeManager.ts +22 -1
  251. package/src/web/skybridgeClientScript.js +0 -3951
  252. package/src/web/skybridgeClientScript.ts +0 -3952
  253. package/src/web/skybridgeStyles.js +0 -827
  254. package/src/web/skybridgeStyles.ts +0 -828
@@ -0,0 +1,256 @@
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-strip-left">',
7
+ ' <div id="studio-tabs" class="studio-tabs" role="tablist" aria-label="Open workspace tabs"></div>',
8
+ ' <button id="studio-new-tab-btn" class="studio-add-tab-btn" type="button" aria-label="Open Start launcher" title="Open Start launcher">',
9
+ ' <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>',
10
+ ' </button>',
11
+ ' </div>',
12
+ ' <div class="studio-head-actions">',
13
+ ' <button id="studio-split-btn" class="icon-btn" type="button" aria-label="Split pane" title="Split pane (⌘\\)" aria-pressed="false">',
14
+ ' <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>',
15
+ ' </button>',
16
+ ' <button id="studio-expand-btn" class="icon-btn" type="button" aria-label="Expand panel" title="Expand panel (⌘⌥↵)">',
17
+ ' <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>',
18
+ ' </button>',
19
+ ' <button id="studio-close-btn" class="icon-btn" type="button" aria-label="Close panel" title="Close panel">',
20
+ ' <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>',
21
+ ' </button>',
22
+ ' </div>',
23
+ ' </div>',
24
+ ' <div id="studio-split-bar" class="studio-split-bar">',
25
+ ' <span class="studio-split-label">Split view</span>',
26
+ ' <div class="studio-split-controls">',
27
+ ' <label class="pop-sub" for="studio-secondary-select">Right pane</label>',
28
+ ' <select id="studio-secondary-select" class="pop-select" aria-label="Secondary split pane">',
29
+ ' <option value="terminal">Terminal</option>',
30
+ ' <option value="browser">Browser</option>',
31
+ ' <option value="files">Files</option>',
32
+ ' <option value="canvas">Editor</option>',
33
+ ' <option value="diff">Changes</option>',
34
+ ' <option value="cli">Commands</option>',
35
+ ' <option value="start">Start</option>',
36
+ ' </select>',
37
+ ' <button id="studio-split-swap-btn" class="btn-ghost" type="button" title="Swap split panes">Swap</button>',
38
+ ' <button id="studio-split-close-btn" class="btn-ghost" type="button" title="Close split pane">Single</button>',
39
+ ' </div>',
40
+ ' </div>',
41
+ ' <div id="studio-panes-grid" class="studio-panes-grid">',
42
+ ' <div id="studio-split-divider" class="studio-split-divider" role="separator" aria-orientation="vertical" aria-label="Resize split panes"></div>',
43
+ ' <div class="studio-pane" data-pane="start">',
44
+ ' <div class="studio-start-wrap">',
45
+ ' <div class="studio-start-emblem" aria-hidden="true">',
46
+ ' <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>',
47
+ ' </div>',
48
+ ' <div class="studio-start-list">',
49
+ ' <button id="start-files-btn" class="start-card" type="button">',
50
+ ' <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>',
51
+ ' <span class="start-card-body">',
52
+ ' <span class="start-card-title">Workspace files</span>',
53
+ ' <span class="start-card-sub">Browse files in this session\'s workspace</span>',
54
+ ' </span>',
55
+ ' <span id="start-kbd-files" class="start-card-kbd">⌘P</span>',
56
+ ' </button>',
57
+ ' <div class="start-card start-card-terminal-row">',
58
+ ' <button id="start-terminal-btn" class="start-card-main-btn" type="button">',
59
+ ' <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>',
60
+ ' <span class="start-card-body">',
61
+ ' <span class="start-card-title">New terminal</span>',
62
+ ' <span class="start-card-sub">Run commands in the Session workspace</span>',
63
+ ' </span>',
64
+ ' </button>',
65
+ ' <select id="start-shell-select" class="start-shell-select" aria-label="Select shell"></select>',
66
+ ' <span id="start-kbd-terminal" class="start-card-kbd">⌃`</span>',
67
+ ' </div>',
68
+ ' <button id="start-browser-btn" class="start-card" type="button">',
69
+ ' <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>',
70
+ ' <span class="start-card-body">',
71
+ ' <span class="start-card-title">Browser</span>',
72
+ ' <span class="start-card-sub">Browse web pages</span>',
73
+ ' </span>',
74
+ ' <span id="start-kbd-browser" class="start-card-kbd">⌘T</span>',
75
+ ' </button>',
76
+ ' <button id="start-more-btn" class="start-card start-card-compact" type="button" aria-expanded="false">',
77
+ ' <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>',
78
+ ' <span class="start-card-body"><span class="start-card-title">More tools</span></span>',
79
+ ' </button>',
80
+ ' <div id="start-more-shelf" class="start-more-shelf">',
81
+ ' <button id="start-editor-btn" class="start-mini-btn" type="button">Editor &amp; Preview</button>',
82
+ ' <button id="start-diff-btn" class="start-mini-btn" type="button">Workspace Changes</button>',
83
+ ' <button id="start-cli-btn" class="start-mini-btn" type="button">Slash Commands</button>',
84
+ ' <button id="start-game-btn" class="start-mini-btn" type="button">Causyne Game</button>',
85
+ ' <button id="start-settings-btn" class="start-mini-btn" type="button">Settings</button>',
86
+ ' </div>',
87
+ ' </div>',
88
+ ' </div>',
89
+ ' </div>',
90
+ ' <div class="studio-pane active" data-pane="files">',
91
+ ' <div class="studio-bar">',
92
+ ' <button id="file-up-btn" class="btn-ghost" type="button" disabled>..</button>',
93
+ ' <input id="file-filter" type="search" placeholder="Filter files" aria-label="Filter files">',
94
+ ' <button id="refresh-files" class="btn-ghost" type="button">Refresh</button>',
95
+ ' </div>',
96
+ ' <div id="file-list" class="studio-scroll"></div>',
97
+ ' </div>',
98
+ ' <div class="studio-pane" data-pane="canvas">',
99
+ ' <div class="studio-bar">',
100
+ ' <input id="file-path-input" type="text" placeholder="notes.md" aria-label="File path">',
101
+ ' <select id="artifact-version-select" class="pop-select" style="display:none" aria-label="Version"></select>',
102
+ ' <div class="seg-group" role="group" aria-label="View mode">',
103
+ ' <button id="canvas-code-btn" class="seg-btn active" type="button">Code</button>',
104
+ ' <button id="canvas-mode-btn" class="seg-btn" type="button">Preview</button>',
105
+ ' </div>',
106
+ ' <button id="save-file-btn" class="btn-primary" type="button">Save</button>',
107
+ ' </div>',
108
+ ' <textarea id="file-content-input" class="canvas-editor" placeholder="Open a file or start writing..."></textarea>',
109
+ ' <div id="canvas-preview" class="canvas-preview assistant-prose"></div>',
110
+ ' <iframe id="canvas-html-frame" class="canvas-iframe" sandbox="allow-scripts" title="Document preview"></iframe>',
111
+ ' <div class="canvas-foot">',
112
+ ' <span id="file-status">Ready</span>',
113
+ ' <div style="display:flex; gap:6px">',
114
+ ' <button id="canvas-download-btn" class="btn-ghost" type="button">Download</button>',
115
+ ' <button id="canvas-refine-btn" class="btn-ghost" type="button">Ask Causyne</button>',
116
+ ' </div>',
117
+ ' </div>',
118
+ ' </div>',
119
+ ' <div class="studio-pane" data-pane="terminal">',
120
+ ' <div class="term-tabs-row">',
121
+ ' <div id="term-tabs" class="browser-tabs">',
122
+ ' <button id="term-new-btn" class="btab" type="button" title="New terminal session">+</button>',
123
+ ' </div>',
124
+ ' <div class="browser-tab-actions">',
125
+ ' <select id="term-shell-select" class="pop-select" aria-label="Terminal shell"></select>',
126
+ ' <button id="term-sigint-btn" class="btn-ghost" type="button" title="Send Ctrl+C (SIGINT)">^C</button>',
127
+ ' <button id="term-clear-btn" class="btn-ghost" type="button" title="Clear viewport">Clear</button>',
128
+ ' </div>',
129
+ ' </div>',
130
+ ' <div id="term-control-banner" class="term-control-banner">',
131
+ ' <span id="term-control-text">Causyne is running a terminal session</span>',
132
+ ' <button id="term-take-control-btn" class="btn-primary" type="button">Take control</button>',
133
+ ' </div>',
134
+ ' <div id="term-empty" class="browser-empty">',
135
+ ' <div class="browser-empty-title">Workspace Terminal</div>',
136
+ ' <div class="browser-empty-sub">Run live interactive shell sessions scoped to this workspace.</div>',
137
+ ' <button id="term-empty-start-btn" class="btn-primary" type="button">New terminal</button>',
138
+ ' </div>',
139
+ ' <div id="term-viewport" class="term-screen" aria-label="Interactive terminal"></div>',
140
+ ' <div class="canvas-foot">',
141
+ ' <span id="term-status">No active terminal</span>',
142
+ ' <span id="term-meta" class="pop-sub"></span>',
143
+ ' </div>',
144
+ ' </div>',
145
+ ' <div class="studio-pane" data-pane="browser">',
146
+ ' <div id="browser-tabs-row" class="browser-tabs-row">',
147
+ ' <div id="browser-tabs" class="browser-tabs">',
148
+ ' <button id="browser-new-tab-btn" class="btab" type="button" title="New tab">+</button>',
149
+ ' </div>',
150
+ ' <div class="browser-tab-actions">',
151
+ ' <button id="browser-native-win-btn" class="icon-btn" type="button" title="Open in desktop window" aria-label="Open in desktop window">',
152
+ ' <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>',
153
+ ' </button>',
154
+ ' <button id="browser-sync-toggle-btn" class="icon-btn" type="button" title="Import from Chrome" aria-label="Import from Chrome">',
155
+ ' <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>',
156
+ ' </button>',
157
+ ' <button id="browser-more-btn" class="icon-btn" type="button" title="Browser options" aria-label="Browser options" aria-haspopup="menu" aria-expanded="false">',
158
+ ' <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>',
159
+ ' </button>',
160
+ ' <button id="browser-close-btn" class="icon-btn browser-close-btn" type="button" title="Close browser" aria-label="Close browser" style="display:none">',
161
+ ' <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>',
162
+ ' </button>',
163
+ ' </div>',
164
+ ' </div>',
165
+ ' <div class="browser-bar">',
166
+ ' <button id="browser-back-btn" class="icon-btn" type="button" title="Back" aria-label="Back">',
167
+ ' <svg viewBox="0 0 24 24"><polyline points="15 18 9 12 15 6"/></svg>',
168
+ ' </button>',
169
+ ' <button id="browser-fwd-btn" class="icon-btn" type="button" title="Forward" aria-label="Forward">',
170
+ ' <svg viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"/></svg>',
171
+ ' </button>',
172
+ ' <button id="browser-reload-btn" class="icon-btn" type="button" title="Reload" aria-label="Reload">',
173
+ ' <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>',
174
+ ' </button>',
175
+ ' <div class="browser-url-wrap">',
176
+ ' <input id="browser-url-input" class="browser-url-input" type="text" placeholder="Search or enter URL" aria-label="Address bar">',
177
+ ' <button id="browser-go-btn" class="browser-go-btn" type="button" title="Go" aria-label="Navigate">',
178
+ ' <svg viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"/></svg>',
179
+ ' </button>',
180
+ ' </div>',
181
+ ' <button id="browser-sandbox-btn" class="icon-btn" type="button" title="Frame sandbox policy" aria-label="Frame sandbox policy" aria-pressed="false" style="display:none">',
182
+ ' <svg viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
183
+ ' </button>',
184
+ ' <span id="browser-origin-badge" class="browser-origin-badge" title="Page navigated inside embedded frame">URL changed</span>',
185
+ ' </div>',
186
+ ' <div id="browser-sync-drawer" class="sync-drawer">',
187
+ ' <div class="vault-row">',
188
+ ' <span class="pop-sub">Chrome port</span>',
189
+ ' <input id="cdp-port-input" type="number" value="9222" style="width:82px;flex:0 0 82px">',
190
+ ' <button id="cdp-scan-btn" class="btn-primary" type="button">Find tabs</button>',
191
+ ' </div>',
192
+ ' <div id="cdp-tabs-list" style="display:flex;flex-direction:column;gap:5px"></div>',
193
+ ' <div class="pop-sub">Or paste URLs, Bookmarks HTML, or Playwright storageState JSON</div>',
194
+ ' <textarea id="browser-import-input" class="sync-textarea" placeholder="Paste URLs, Bookmarks.html, or storageState JSON"></textarea>',
195
+ ' <div style="display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap">',
196
+ ' <span id="cdp-sync-status" class="pop-sub">Transfers only the tabs or data you choose.</span>',
197
+ ' <button id="browser-import-btn" class="btn-ghost" type="button">Import</button>',
198
+ ' </div>',
199
+ ' </div>',
200
+ ' <div id="browser-stage" class="browser-stage">',
201
+ ' <div id="browser-restore-card" class="browser-restore-card">',
202
+ ' <div class="browser-empty-title">Previously opened</div>',
203
+ ' <div id="browser-restore-url" class="browser-empty-sub"></div>',
204
+ ' <div style="display:flex;gap:8px;justify-content:center">',
205
+ ' <button id="browser-restore-btn" class="btn-primary" type="button">Restore page</button>',
206
+ ' <button id="browser-restore-dismiss-btn" class="btn-ghost" type="button">Dismiss</button>',
207
+ ' </div>',
208
+ ' </div>',
209
+ ' <div id="browser-empty" class="browser-empty">',
210
+ ' <div class="browser-empty-title">Browser</div>',
211
+ ' <div class="browser-empty-sub">Browse pages alongside Causyne or open a native desktop window.</div>',
212
+ ' <div style="display:flex;gap:8px;flex-wrap:wrap;justify-content:center">',
213
+ ' <button id="browser-start-btn" class="btn-primary" type="button">Open browser</button>',
214
+ ' <button id="browser-start-native-btn" class="btn-ghost" type="button">Open in window</button>',
215
+ ' </div>',
216
+ ' </div>',
217
+ ' <div id="live-viewport-surface" class="live-viewport-wrap" tabindex="0" aria-label="Browser viewport">',
218
+ ' <div id="browser-agent-banner" class="agent-browser-banner">',
219
+ ' <span class="pulse-dot"></span>',
220
+ ' <span id="browser-agent-banner-text">Causyne is browsing</span>',
221
+ ' <button id="banner-take-control-btn" class="btn-primary" type="button">Take over</button>',
222
+ ' </div>',
223
+ ' <img id="live-browser-img" class="live-browser-img" draggable="false" alt="Browser viewport">',
224
+ ' </div>',
225
+ ' <iframe id="browser-frame" class="browser-frame" sandbox="allow-scripts allow-forms" style="display:none" title="Local preview"></iframe>',
226
+ ' </div>',
227
+ ' </div>',
228
+ ' <div class="studio-pane" data-pane="diff">',
229
+ ' <div class="studio-bar">',
230
+ ' <div class="seg-group" role="group" aria-label="Diff scope">',
231
+ ' <button id="diff-scope-session" class="seg-btn active" type="button">This chat</button>',
232
+ ' <button id="diff-scope-workspace" class="seg-btn" type="button">Workspace</button>',
233
+ ' </div>',
234
+ ' <button id="diff-staged-toggle" class="btn-ghost" type="button" style="display:none">Working</button>',
235
+ ' <span id="diff-summary" class="pop-sub" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">No changes</span>',
236
+ ' <button id="refresh-diff-btn" class="btn-ghost" type="button">Refresh</button>',
237
+ ' </div>',
238
+ ' <div id="diff-list" class="studio-scroll"></div>',
239
+ ' </div>',
240
+ ' <div class="studio-pane" data-pane="cli">',
241
+ ' <div class="studio-bar">',
242
+ ' <input id="cli-cmd-input" type="text" placeholder="Run a command, e.g. /status or /doctor" aria-label="Run command">',
243
+ ' <button id="cli-run-btn" class="btn-primary" type="button">Run</button>',
244
+ ' </div>',
245
+ ' <div id="cli-stats" class="cli-stats">Loading workspace...</div>',
246
+ ' <div id="cli-quick-grid" class="cli-grid"></div>',
247
+ ' <pre id="cli-console" class="cli-console">Select a command above or type /help.</pre>',
248
+ ' <div class="canvas-foot">',
249
+ ' <span id="cli-status">Ready</span>',
250
+ ' <button id="cli-probe-btn" class="btn-ghost" type="button">Test connections</button>',
251
+ ' </div>',
252
+ ' </div>',
253
+ ' </div>',
254
+ ' </aside>'
255
+ ].join('\n');
256
+ }
@@ -0,0 +1,256 @@
1
+ export function renderStudioHtml(): string {
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-strip-left">',
7
+ ' <div id="studio-tabs" class="studio-tabs" role="tablist" aria-label="Open workspace tabs"></div>',
8
+ ' <button id="studio-new-tab-btn" class="studio-add-tab-btn" type="button" aria-label="Open Start launcher" title="Open Start launcher">',
9
+ ' <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>',
10
+ ' </button>',
11
+ ' </div>',
12
+ ' <div class="studio-head-actions">',
13
+ ' <button id="studio-split-btn" class="icon-btn" type="button" aria-label="Split pane" title="Split pane (⌘\\)" aria-pressed="false">',
14
+ ' <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>',
15
+ ' </button>',
16
+ ' <button id="studio-expand-btn" class="icon-btn" type="button" aria-label="Expand panel" title="Expand panel (⌘⌥↵)">',
17
+ ' <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>',
18
+ ' </button>',
19
+ ' <button id="studio-close-btn" class="icon-btn" type="button" aria-label="Close panel" title="Close panel">',
20
+ ' <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>',
21
+ ' </button>',
22
+ ' </div>',
23
+ ' </div>',
24
+ ' <div id="studio-split-bar" class="studio-split-bar">',
25
+ ' <span class="studio-split-label">Split view</span>',
26
+ ' <div class="studio-split-controls">',
27
+ ' <label class="pop-sub" for="studio-secondary-select">Right pane</label>',
28
+ ' <select id="studio-secondary-select" class="pop-select" aria-label="Secondary split pane">',
29
+ ' <option value="terminal">Terminal</option>',
30
+ ' <option value="browser">Browser</option>',
31
+ ' <option value="files">Files</option>',
32
+ ' <option value="canvas">Editor</option>',
33
+ ' <option value="diff">Changes</option>',
34
+ ' <option value="cli">Commands</option>',
35
+ ' <option value="start">Start</option>',
36
+ ' </select>',
37
+ ' <button id="studio-split-swap-btn" class="btn-ghost" type="button" title="Swap split panes">Swap</button>',
38
+ ' <button id="studio-split-close-btn" class="btn-ghost" type="button" title="Close split pane">Single</button>',
39
+ ' </div>',
40
+ ' </div>',
41
+ ' <div id="studio-panes-grid" class="studio-panes-grid">',
42
+ ' <div id="studio-split-divider" class="studio-split-divider" role="separator" aria-orientation="vertical" aria-label="Resize split panes"></div>',
43
+ ' <div class="studio-pane" data-pane="start">',
44
+ ' <div class="studio-start-wrap">',
45
+ ' <div class="studio-start-emblem" aria-hidden="true">',
46
+ ' <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>',
47
+ ' </div>',
48
+ ' <div class="studio-start-list">',
49
+ ' <button id="start-files-btn" class="start-card" type="button">',
50
+ ' <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>',
51
+ ' <span class="start-card-body">',
52
+ ' <span class="start-card-title">Workspace files</span>',
53
+ ' <span class="start-card-sub">Browse files in this session\'s workspace</span>',
54
+ ' </span>',
55
+ ' <span id="start-kbd-files" class="start-card-kbd">⌘P</span>',
56
+ ' </button>',
57
+ ' <div class="start-card start-card-terminal-row">',
58
+ ' <button id="start-terminal-btn" class="start-card-main-btn" type="button">',
59
+ ' <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>',
60
+ ' <span class="start-card-body">',
61
+ ' <span class="start-card-title">New terminal</span>',
62
+ ' <span class="start-card-sub">Run commands in the Session workspace</span>',
63
+ ' </span>',
64
+ ' </button>',
65
+ ' <select id="start-shell-select" class="start-shell-select" aria-label="Select shell"></select>',
66
+ ' <span id="start-kbd-terminal" class="start-card-kbd">⌃`</span>',
67
+ ' </div>',
68
+ ' <button id="start-browser-btn" class="start-card" type="button">',
69
+ ' <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>',
70
+ ' <span class="start-card-body">',
71
+ ' <span class="start-card-title">Browser</span>',
72
+ ' <span class="start-card-sub">Browse web pages</span>',
73
+ ' </span>',
74
+ ' <span id="start-kbd-browser" class="start-card-kbd">⌘T</span>',
75
+ ' </button>',
76
+ ' <button id="start-more-btn" class="start-card start-card-compact" type="button" aria-expanded="false">',
77
+ ' <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>',
78
+ ' <span class="start-card-body"><span class="start-card-title">More tools</span></span>',
79
+ ' </button>',
80
+ ' <div id="start-more-shelf" class="start-more-shelf">',
81
+ ' <button id="start-editor-btn" class="start-mini-btn" type="button">Editor &amp; Preview</button>',
82
+ ' <button id="start-diff-btn" class="start-mini-btn" type="button">Workspace Changes</button>',
83
+ ' <button id="start-cli-btn" class="start-mini-btn" type="button">Slash Commands</button>',
84
+ ' <button id="start-game-btn" class="start-mini-btn" type="button">Causyne Game</button>',
85
+ ' <button id="start-settings-btn" class="start-mini-btn" type="button">Settings</button>',
86
+ ' </div>',
87
+ ' </div>',
88
+ ' </div>',
89
+ ' </div>',
90
+ ' <div class="studio-pane active" data-pane="files">',
91
+ ' <div class="studio-bar">',
92
+ ' <button id="file-up-btn" class="btn-ghost" type="button" disabled>..</button>',
93
+ ' <input id="file-filter" type="search" placeholder="Filter files" aria-label="Filter files">',
94
+ ' <button id="refresh-files" class="btn-ghost" type="button">Refresh</button>',
95
+ ' </div>',
96
+ ' <div id="file-list" class="studio-scroll"></div>',
97
+ ' </div>',
98
+ ' <div class="studio-pane" data-pane="canvas">',
99
+ ' <div class="studio-bar">',
100
+ ' <input id="file-path-input" type="text" placeholder="notes.md" aria-label="File path">',
101
+ ' <select id="artifact-version-select" class="pop-select" style="display:none" aria-label="Version"></select>',
102
+ ' <div class="seg-group" role="group" aria-label="View mode">',
103
+ ' <button id="canvas-code-btn" class="seg-btn active" type="button">Code</button>',
104
+ ' <button id="canvas-mode-btn" class="seg-btn" type="button">Preview</button>',
105
+ ' </div>',
106
+ ' <button id="save-file-btn" class="btn-primary" type="button">Save</button>',
107
+ ' </div>',
108
+ ' <textarea id="file-content-input" class="canvas-editor" placeholder="Open a file or start writing..."></textarea>',
109
+ ' <div id="canvas-preview" class="canvas-preview assistant-prose"></div>',
110
+ ' <iframe id="canvas-html-frame" class="canvas-iframe" sandbox="allow-scripts" title="Document preview"></iframe>',
111
+ ' <div class="canvas-foot">',
112
+ ' <span id="file-status">Ready</span>',
113
+ ' <div style="display:flex; gap:6px">',
114
+ ' <button id="canvas-download-btn" class="btn-ghost" type="button">Download</button>',
115
+ ' <button id="canvas-refine-btn" class="btn-ghost" type="button">Ask Causyne</button>',
116
+ ' </div>',
117
+ ' </div>',
118
+ ' </div>',
119
+ ' <div class="studio-pane" data-pane="terminal">',
120
+ ' <div class="term-tabs-row">',
121
+ ' <div id="term-tabs" class="browser-tabs">',
122
+ ' <button id="term-new-btn" class="btab" type="button" title="New terminal session">+</button>',
123
+ ' </div>',
124
+ ' <div class="browser-tab-actions">',
125
+ ' <select id="term-shell-select" class="pop-select" aria-label="Terminal shell"></select>',
126
+ ' <button id="term-sigint-btn" class="btn-ghost" type="button" title="Send Ctrl+C (SIGINT)">^C</button>',
127
+ ' <button id="term-clear-btn" class="btn-ghost" type="button" title="Clear viewport">Clear</button>',
128
+ ' </div>',
129
+ ' </div>',
130
+ ' <div id="term-control-banner" class="term-control-banner">',
131
+ ' <span id="term-control-text">Causyne is running a terminal session</span>',
132
+ ' <button id="term-take-control-btn" class="btn-primary" type="button">Take control</button>',
133
+ ' </div>',
134
+ ' <div id="term-empty" class="browser-empty">',
135
+ ' <div class="browser-empty-title">Workspace Terminal</div>',
136
+ ' <div class="browser-empty-sub">Run live interactive shell sessions scoped to this workspace.</div>',
137
+ ' <button id="term-empty-start-btn" class="btn-primary" type="button">New terminal</button>',
138
+ ' </div>',
139
+ ' <div id="term-viewport" class="term-screen" aria-label="Interactive terminal"></div>',
140
+ ' <div class="canvas-foot">',
141
+ ' <span id="term-status">No active terminal</span>',
142
+ ' <span id="term-meta" class="pop-sub"></span>',
143
+ ' </div>',
144
+ ' </div>',
145
+ ' <div class="studio-pane" data-pane="browser">',
146
+ ' <div id="browser-tabs-row" class="browser-tabs-row">',
147
+ ' <div id="browser-tabs" class="browser-tabs">',
148
+ ' <button id="browser-new-tab-btn" class="btab" type="button" title="New tab">+</button>',
149
+ ' </div>',
150
+ ' <div class="browser-tab-actions">',
151
+ ' <button id="browser-native-win-btn" class="icon-btn" type="button" title="Open in desktop window" aria-label="Open in desktop window">',
152
+ ' <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>',
153
+ ' </button>',
154
+ ' <button id="browser-sync-toggle-btn" class="icon-btn" type="button" title="Import from Chrome" aria-label="Import from Chrome">',
155
+ ' <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>',
156
+ ' </button>',
157
+ ' <button id="browser-more-btn" class="icon-btn" type="button" title="Browser options" aria-label="Browser options" aria-haspopup="menu" aria-expanded="false">',
158
+ ' <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>',
159
+ ' </button>',
160
+ ' <button id="browser-close-btn" class="icon-btn browser-close-btn" type="button" title="Close browser" aria-label="Close browser" style="display:none">',
161
+ ' <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>',
162
+ ' </button>',
163
+ ' </div>',
164
+ ' </div>',
165
+ ' <div class="browser-bar">',
166
+ ' <button id="browser-back-btn" class="icon-btn" type="button" title="Back" aria-label="Back">',
167
+ ' <svg viewBox="0 0 24 24"><polyline points="15 18 9 12 15 6"/></svg>',
168
+ ' </button>',
169
+ ' <button id="browser-fwd-btn" class="icon-btn" type="button" title="Forward" aria-label="Forward">',
170
+ ' <svg viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"/></svg>',
171
+ ' </button>',
172
+ ' <button id="browser-reload-btn" class="icon-btn" type="button" title="Reload" aria-label="Reload">',
173
+ ' <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>',
174
+ ' </button>',
175
+ ' <div class="browser-url-wrap">',
176
+ ' <input id="browser-url-input" class="browser-url-input" type="text" placeholder="Search or enter URL" aria-label="Address bar">',
177
+ ' <button id="browser-go-btn" class="browser-go-btn" type="button" title="Go" aria-label="Navigate">',
178
+ ' <svg viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"/></svg>',
179
+ ' </button>',
180
+ ' </div>',
181
+ ' <button id="browser-sandbox-btn" class="icon-btn" type="button" title="Frame sandbox policy" aria-label="Frame sandbox policy" aria-pressed="false" style="display:none">',
182
+ ' <svg viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
183
+ ' </button>',
184
+ ' <span id="browser-origin-badge" class="browser-origin-badge" title="Page navigated inside embedded frame">URL changed</span>',
185
+ ' </div>',
186
+ ' <div id="browser-sync-drawer" class="sync-drawer">',
187
+ ' <div class="vault-row">',
188
+ ' <span class="pop-sub">Chrome port</span>',
189
+ ' <input id="cdp-port-input" type="number" value="9222" style="width:82px;flex:0 0 82px">',
190
+ ' <button id="cdp-scan-btn" class="btn-primary" type="button">Find tabs</button>',
191
+ ' </div>',
192
+ ' <div id="cdp-tabs-list" style="display:flex;flex-direction:column;gap:5px"></div>',
193
+ ' <div class="pop-sub">Or paste URLs, Bookmarks HTML, or Playwright storageState JSON</div>',
194
+ ' <textarea id="browser-import-input" class="sync-textarea" placeholder="Paste URLs, Bookmarks.html, or storageState JSON"></textarea>',
195
+ ' <div style="display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap">',
196
+ ' <span id="cdp-sync-status" class="pop-sub">Transfers only the tabs or data you choose.</span>',
197
+ ' <button id="browser-import-btn" class="btn-ghost" type="button">Import</button>',
198
+ ' </div>',
199
+ ' </div>',
200
+ ' <div id="browser-stage" class="browser-stage">',
201
+ ' <div id="browser-restore-card" class="browser-restore-card">',
202
+ ' <div class="browser-empty-title">Previously opened</div>',
203
+ ' <div id="browser-restore-url" class="browser-empty-sub"></div>',
204
+ ' <div style="display:flex;gap:8px;justify-content:center">',
205
+ ' <button id="browser-restore-btn" class="btn-primary" type="button">Restore page</button>',
206
+ ' <button id="browser-restore-dismiss-btn" class="btn-ghost" type="button">Dismiss</button>',
207
+ ' </div>',
208
+ ' </div>',
209
+ ' <div id="browser-empty" class="browser-empty">',
210
+ ' <div class="browser-empty-title">Browser</div>',
211
+ ' <div class="browser-empty-sub">Browse pages alongside Causyne or open a native desktop window.</div>',
212
+ ' <div style="display:flex;gap:8px;flex-wrap:wrap;justify-content:center">',
213
+ ' <button id="browser-start-btn" class="btn-primary" type="button">Open browser</button>',
214
+ ' <button id="browser-start-native-btn" class="btn-ghost" type="button">Open in window</button>',
215
+ ' </div>',
216
+ ' </div>',
217
+ ' <div id="live-viewport-surface" class="live-viewport-wrap" tabindex="0" aria-label="Browser viewport">',
218
+ ' <div id="browser-agent-banner" class="agent-browser-banner">',
219
+ ' <span class="pulse-dot"></span>',
220
+ ' <span id="browser-agent-banner-text">Causyne is browsing</span>',
221
+ ' <button id="banner-take-control-btn" class="btn-primary" type="button">Take over</button>',
222
+ ' </div>',
223
+ ' <img id="live-browser-img" class="live-browser-img" draggable="false" alt="Browser viewport">',
224
+ ' </div>',
225
+ ' <iframe id="browser-frame" class="browser-frame" sandbox="allow-scripts allow-forms" style="display:none" title="Local preview"></iframe>',
226
+ ' </div>',
227
+ ' </div>',
228
+ ' <div class="studio-pane" data-pane="diff">',
229
+ ' <div class="studio-bar">',
230
+ ' <div class="seg-group" role="group" aria-label="Diff scope">',
231
+ ' <button id="diff-scope-session" class="seg-btn active" type="button">This chat</button>',
232
+ ' <button id="diff-scope-workspace" class="seg-btn" type="button">Workspace</button>',
233
+ ' </div>',
234
+ ' <button id="diff-staged-toggle" class="btn-ghost" type="button" style="display:none">Working</button>',
235
+ ' <span id="diff-summary" class="pop-sub" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">No changes</span>',
236
+ ' <button id="refresh-diff-btn" class="btn-ghost" type="button">Refresh</button>',
237
+ ' </div>',
238
+ ' <div id="diff-list" class="studio-scroll"></div>',
239
+ ' </div>',
240
+ ' <div class="studio-pane" data-pane="cli">',
241
+ ' <div class="studio-bar">',
242
+ ' <input id="cli-cmd-input" type="text" placeholder="Run a command, e.g. /status or /doctor" aria-label="Run command">',
243
+ ' <button id="cli-run-btn" class="btn-primary" type="button">Run</button>',
244
+ ' </div>',
245
+ ' <div id="cli-stats" class="cli-stats">Loading workspace...</div>',
246
+ ' <div id="cli-quick-grid" class="cli-grid"></div>',
247
+ ' <pre id="cli-console" class="cli-console">Select a command above or type /help.</pre>',
248
+ ' <div class="canvas-foot">',
249
+ ' <span id="cli-status">Ready</span>',
250
+ ' <button id="cli-probe-btn" class="btn-ghost" type="button">Test connections</button>',
251
+ ' </div>',
252
+ ' </div>',
253
+ ' </div>',
254
+ ' </aside>'
255
+ ].join('\n');
256
+ }