@aoagents/ao-web 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +137 -137
  3. package/.next/app-path-routes-manifest.json +8 -8
  4. package/.next/build-manifest.json +6 -6
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +31 -31
  7. package/.next/react-loadable-manifest.json +3 -3
  8. package/.next/required-server-files.json +3 -3
  9. package/.next/server/app/_not-found/page.js +2 -2
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +7 -7
  14. package/.next/server/app/api/backlog/route.js +1 -1
  15. package/.next/server/app/api/backlog/route.js.nft.json +1 -1
  16. package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/browse-directory/route.js +1 -1
  18. package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/filesystem/browse/route.js +1 -1
  20. package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/issues/route.js +1 -1
  22. package/.next/server/app/api/issues/route.js.nft.json +1 -1
  23. package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/observability/route.js +1 -1
  25. package/.next/server/app/api/observability/route.js.nft.json +1 -1
  26. package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/orchestrators/route.js +1 -1
  28. package/.next/server/app/api/orchestrators/route.js.nft.json +1 -1
  29. package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/projects/[id]/route.js +1 -1
  31. package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/projects/reload/route.js +1 -1
  34. package/.next/server/app/api/projects/reload/route.js.nft.json +1 -1
  35. package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/projects/route.js +1 -1
  37. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  38. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
  40. package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
  41. package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/runtime/terminal/route.js +1 -1
  43. package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
  45. package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  46. package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
  48. package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
  49. package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
  51. package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
  52. package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
  54. package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  55. package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  57. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
  60. package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  61. package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/sessions/patches/route.js +1 -1
  63. package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -1
  64. package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/sessions/route.js +1 -1
  66. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  67. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/setup-labels/route.js +1 -1
  69. package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
  70. package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/spawn/route.js +1 -1
  72. package/.next/server/app/api/spawn/route.js.nft.json +1 -1
  73. package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/verify/route.js +1 -1
  75. package/.next/server/app/api/verify/route.js.nft.json +1 -1
  76. package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
  78. package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
  79. package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/apple-icon/route.js +1 -1
  81. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/dev/terminal-test/page.js +3 -3
  83. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  84. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/dev/terminal-test.html +1 -1
  86. package/.next/server/app/dev/terminal-test.rsc +8 -8
  87. package/.next/server/app/icon/route.js +1 -1
  88. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/icon-192/route.js +1 -1
  90. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  91. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/icon-512/route.js +1 -1
  93. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  94. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  96. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  97. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/orchestrators/page.js +2 -2
  99. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  100. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/page.js +2 -2
  102. package/.next/server/app/page.js.nft.json +1 -1
  103. package/.next/server/app/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/projects/[projectId]/page.js +2 -2
  105. package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  106. package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -2
  108. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -1
  109. package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/projects/[projectId]/settings/page.js +2 -2
  111. package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -1
  112. package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/prs/page.js +2 -2
  114. package/.next/server/app/prs/page.js.nft.json +1 -1
  115. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/sessions/[id]/page.js +2 -2
  117. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  118. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  119. package/.next/server/app/test-direct/page.js +2 -2
  120. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  121. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  122. package/.next/server/app/test-direct.html +1 -1
  123. package/.next/server/app/test-direct.rsc +8 -8
  124. package/.next/server/app-paths-manifest.json +8 -8
  125. package/.next/server/chunks/1172.js +1 -1
  126. package/.next/server/chunks/1876.js +2 -2
  127. package/.next/server/chunks/4520.js +1 -1
  128. package/.next/server/chunks/6811.js +3 -0
  129. package/.next/server/chunks/7173.js +1 -1
  130. package/.next/server/chunks/801.js +5 -5
  131. package/.next/server/chunks/9223.js +2 -2
  132. package/.next/server/middleware-build-manifest.js +1 -1
  133. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  134. package/.next/server/pages/404.html +1 -1
  135. package/.next/server/pages/500.html +1 -1
  136. package/.next/server/server-reference-manifest.json +1 -1
  137. package/.next/static/chunks/{1383.c891a8ba72ee600c.js → 1383.8f5f7d4606d356cc.js} +1 -1
  138. package/.next/static/chunks/3764.88619fb0d047cae8.js +1 -0
  139. package/.next/static/chunks/app/dev/terminal-test/page-59decd1aad4e02ad.js +1 -0
  140. package/.next/static/chunks/app/{error-da1d10c96ff5dd29.js → error-684a1c5596fa1e14.js} +1 -1
  141. package/.next/static/chunks/app/{global-error-ca06d2b1be2d4ae0.js → global-error-1a79bacfbd9b1ba4.js} +1 -1
  142. package/.next/static/chunks/app/layout-0cda720d75f111b8.js +1 -0
  143. package/.next/static/chunks/app/not-found-315f4e5c106b425d.js +1 -0
  144. package/.next/static/chunks/app/orchestrators/{page-f07983413ed1a44b.js → page-e3a2c53b57dd8391.js} +1 -1
  145. package/.next/static/chunks/app/page-e2e589ea11a0780a.js +1 -0
  146. package/.next/static/chunks/app/projects/[projectId]/{page-49eb5b990c74ca8f.js → page-19a6d4cc9951a9e4.js} +1 -1
  147. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-75c536c9755754f7.js +1 -0
  148. package/.next/static/chunks/app/projects/[projectId]/settings/{page-d1da671e72a7bd5e.js → page-f8c323b91978efff.js} +1 -1
  149. package/.next/static/chunks/app/prs/page-08f17d7dc341b6f1.js +1 -0
  150. package/.next/static/chunks/app/sessions/[id]/{error-8de5b24e86eeae7b.js → error-62e9972b39d9cd16.js} +1 -1
  151. package/.next/static/chunks/app/sessions/[id]/not-found-315f4e5c106b425d.js +1 -0
  152. package/.next/static/chunks/app/sessions/[id]/page-d0b08722dec5a04a.js +1 -0
  153. package/.next/static/chunks/app/test-direct/{page-eb366dde03fab6a7.js → page-ee0944bcd355194e.js} +1 -1
  154. package/.next/static/chunks/main-app-b95f197c38e3b0a3.js +1 -0
  155. package/.next/static/chunks/{webpack-d2dfbd3e9262b74e.js → webpack-83d2d8248a30259c.js} +1 -1
  156. package/.next/static/css/cf9226160e230bf4.css +1 -0
  157. package/dist-server/mux-websocket.js +49 -6
  158. package/package.json +12 -12
  159. package/.next/server/chunks/3131.js +0 -3
  160. package/.next/static/chunks/3764.89a5955e46eb74b4.js +0 -1
  161. package/.next/static/chunks/app/dev/terminal-test/page-5819e40b3d4754ef.js +0 -1
  162. package/.next/static/chunks/app/layout-bb6db479523cb3d6.js +0 -1
  163. package/.next/static/chunks/app/not-found-824d5d3c6e296eeb.js +0 -1
  164. package/.next/static/chunks/app/page-6aa506a579ac9949.js +0 -1
  165. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-2450704c6b66a4b4.js +0 -1
  166. package/.next/static/chunks/app/prs/page-2332a7180a47f28c.js +0 -1
  167. package/.next/static/chunks/app/sessions/[id]/not-found-824d5d3c6e296eeb.js +0 -1
  168. package/.next/static/chunks/app/sessions/[id]/page-b60b49ccbafe51c9.js +0 -1
  169. package/.next/static/chunks/main-app-690acf9d5d2050c9.js +0 -1
  170. package/.next/static/css/fcafd381715071b8.css +0 -1
  171. /package/.next/static/{YR6Xi4DC5A7S7E2PoZuif → h0RXs0prE87a8wlbEXQKM}/_buildManifest.js +0 -0
  172. /package/.next/static/{YR6Xi4DC5A7S7E2PoZuif → h0RXs0prE87a8wlbEXQKM}/_ssgManifest.js +0 -0
@@ -1,8 +1,8 @@
1
1
  "use strict";exports.id=9223,exports.ids=[9223],exports.modules={89223:(a,b,c)=>{c.d(b,{ix:()=>bC,wp:()=>bE,Z1:()=>bs,uj:()=>bD,g8:()=>bt,Az:()=>bx});var d=c(35217),e=c(31421),f=c(57975),g=c(58500),h=c(77598),i=c(73024),j=c(48161),k=c(76760);let l=(0,f.promisify)(e.execFile),m=/^[a-zA-Z0-9_-]+$/;async function n(...a){let{stdout:b}=await l("tmux",a,{timeout:5e3});return b.trimEnd()}let o={manifest:{name:"tmux",slot:"runtime",description:"Runtime plugin: tmux sessions",version:"0.1.0"},create:function(){return{name:"tmux",async create(a){var b=a.sessionId;if(!m.test(b))throw Error(`Invalid session ID "${b}": must match ${m}`);let c=a.sessionId,e=[];for(let[b,c]of Object.entries(a.environment??{}))e.push("-e",`${b}=${c}`);await n("new-session","-d","-s",c,"-c",a.workspacePath,...e);let f=a.environment?.PATH,l=a.launchCommand;f&&(l=`export PATH=$(printf '%s' ${JSON.stringify(f)})
2
- ${l}`);try{if(l.length>200){let a=function(a){let b=(0,k.join)((0,j.tmpdir)(),`ao-launch-${(0,h.randomUUID)()}.sh`),c=`#!/usr/bin/env bash
2
+ ${l}`);try{if(await n("set-option","-t",c,"status","off"),l.length>200){let a=function(a){let b=(0,k.join)((0,j.tmpdir)(),`ao-launch-${(0,h.randomUUID)()}.sh`),c=`#!/usr/bin/env bash
3
3
  rm -- "$0" 2>/dev/null || true
4
4
  ${a}
5
- `;return(0,i.writeFileSync)(b,c,{encoding:"utf-8",mode:448}),`bash ${(0,d.kct)(b)}`}(l);await n("send-keys","-t",c,"-l",a),await (0,g.setTimeout)(300),await n("send-keys","-t",c,"Enter")}else await n("send-keys","-t",c,l,"Enter")}catch(b){try{await n("kill-session","-t",c)}catch{}let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send launch command to session "${c}": ${a}`,{cause:b})}return{id:c,runtimeName:"tmux",data:{createdAt:Date.now(),workspacePath:a.workspacePath}}},async destroy(a){try{await n("kill-session","-t",a.id)}catch{}},async sendMessage(a,b){if(await n("send-keys","-t",a.id,"C-u"),b.includes("\n")||b.length>200){let c=`ao-${(0,h.randomUUID)()}`,d=(0,k.join)((0,j.tmpdir)(),`ao-send-${(0,h.randomUUID)()}.txt`);(0,i.writeFileSync)(d,b,{encoding:"utf-8",mode:384});try{await n("load-buffer","-b",c,d),await n("paste-buffer","-b",c,"-t",a.id,"-d")}finally{try{(0,i.unlinkSync)(d)}catch{}try{await n("delete-buffer","-b",c)}catch{}}}else await n("send-keys","-t",a.id,"-l",b);await (0,g.setTimeout)(300),await n("send-keys","-t",a.id,"Enter")},async getOutput(a,b=50){try{return await n("capture-pane","-t",a.id,"-p","-S",`-${b}`)}catch{return""}},async isAlive(a){try{return await n("has-session","-t",a.id),!0}catch{return!1}},async getMetrics(a){let b=a.data.createdAt??Date.now();return{uptimeMs:Date.now()-b}},getAttachInfo:async a=>({type:"tmux",target:a.id,command:`tmux attach -t ${a.id}`}),async preflight(){try{await l("tmux",["-V"],{timeout:5e3})}catch{let a="darwin"===process.platform?"brew install tmux":"win32"===process.platform?"tmux is not available on Windows. Use WSL: wsl --install, then: sudo apt install tmux":"sudo apt install tmux (Debian/Ubuntu) or sudo dnf install tmux (Fedora)";throw Error(`tmux is not installed. Install it: ${a}`)}}}}};var p=c(51455);let q=(0,f.promisify)(e.execFile),r=`#!/usr/bin/env bash
5
+ `;return(0,i.writeFileSync)(b,c,{encoding:"utf-8",mode:448}),`bash ${(0,d.kct)(b)}`}(l);await n("send-keys","-t",c,"-l",a),await (0,g.setTimeout)(300),await n("send-keys","-t",c,"Enter")}else await n("send-keys","-t",c,l,"Enter")}catch(b){try{await n("kill-session","-t",c)}catch{}let a=b instanceof Error?b.message:String(b);throw Error(`Failed to configure or launch session "${c}": ${a}`,{cause:b})}return{id:c,runtimeName:"tmux",data:{createdAt:Date.now(),workspacePath:a.workspacePath}}},async destroy(a){try{await n("kill-session","-t",a.id)}catch{}},async sendMessage(a,b){if(await n("send-keys","-t",a.id,"C-u"),b.includes("\n")||b.length>200){let c=`ao-${(0,h.randomUUID)()}`,d=(0,k.join)((0,j.tmpdir)(),`ao-send-${(0,h.randomUUID)()}.txt`);(0,i.writeFileSync)(d,b,{encoding:"utf-8",mode:384});try{await n("load-buffer","-b",c,d),await n("paste-buffer","-b",c,"-t",a.id,"-d")}finally{try{(0,i.unlinkSync)(d)}catch{}try{await n("delete-buffer","-b",c)}catch{}}}else await n("send-keys","-t",a.id,"-l",b);await (0,g.setTimeout)(300),await n("send-keys","-t",a.id,"Enter")},async getOutput(a,b=50){try{return await n("capture-pane","-t",a.id,"-p","-S",`-${b}`)}catch{return""}},async isAlive(a){try{return await n("has-session","-t",a.id),!0}catch{return!1}},async getMetrics(a){let b=a.data.createdAt??Date.now();return{uptimeMs:Date.now()-b}},getAttachInfo:async a=>({type:"tmux",target:a.id,command:`tmux attach -t ${a.id}`}),async preflight(){try{await l("tmux",["-V"],{timeout:5e3})}catch{let a="darwin"===process.platform?"brew install tmux":"win32"===process.platform?"tmux is not available on Windows. Use WSL: wsl --install, then: sudo apt install tmux":"sudo apt install tmux (Debian/Ubuntu) or sudo dnf install tmux (Fedora)";throw Error(`tmux is not installed. Install it: ${a}`)}}}}};var p=c(51455);let q=(0,f.promisify)(e.execFile),r=`#!/usr/bin/env bash
6
6
  # Metadata Updater Hook for Agent Orchestrator
7
7
  #
8
8
  # This PostToolUse hook automatically updates session metadata when:
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-d2dfbd3e9262b74e.js","static/chunks/88a6fc35-f836b4b72df5eafa.js","static/chunks/1461-af7c54935f21d56d.js","static/chunks/main-app-690acf9d5d2050c9.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-d2dfbd3e9262b74e.js","static/chunks/framework-7060e2ac4971c604.js","static/chunks/main-ed1610689fbd6f0d.js","static/chunks/pages/_app-f4baf4dbe88f6f54.js"],"/_error":["static/chunks/webpack-d2dfbd3e9262b74e.js","static/chunks/framework-7060e2ac4971c604.js","static/chunks/main-ed1610689fbd6f0d.js","static/chunks/pages/_error-a7f6723f42093f29.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-83d2d8248a30259c.js","static/chunks/88a6fc35-f836b4b72df5eafa.js","static/chunks/1461-af7c54935f21d56d.js","static/chunks/main-app-b95f197c38e3b0a3.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-83d2d8248a30259c.js","static/chunks/framework-7060e2ac4971c604.js","static/chunks/main-ed1610689fbd6f0d.js","static/chunks/pages/_app-f4baf4dbe88f6f54.js"],"/_error":["static/chunks/webpack-83d2d8248a30259c.js","static/chunks/framework-7060e2ac4971c604.js","static/chunks/main-ed1610689fbd6f0d.js","static/chunks/pages/_error-a7f6723f42093f29.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
@@ -1 +1 @@
1
- self.__REACT_LOADABLE_MANIFEST='{"app/dev/terminal-test/page.tsx -> @/components/DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/3764.89a5955e46eb74b4.js"]},"app/dev/terminal-test/page.tsx -> @/components/Terminal":{"id":7317,"files":["static/chunks/7317.685aa5231218e8d3.js"]},"app/test-direct/page.tsx -> @/components/DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/3764.89a5955e46eb74b4.js"]},"components/SessionDetail.tsx -> ./DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/1383.c891a8ba72ee600c.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/addon-fit":{"id":2529,"files":["static/chunks/2529.32352c1ce5253e3e.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/addon-web-links":{"id":5491,"files":["static/chunks/5491.fd98884d48631149.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/xterm":{"id":5627,"files":["static/chunks/1d2d5650.1ef8611b5325bd83.js"]}}';
1
+ self.__REACT_LOADABLE_MANIFEST='{"app/dev/terminal-test/page.tsx -> @/components/DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/3764.88619fb0d047cae8.js"]},"app/dev/terminal-test/page.tsx -> @/components/Terminal":{"id":7317,"files":["static/chunks/7317.685aa5231218e8d3.js"]},"app/test-direct/page.tsx -> @/components/DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/3764.88619fb0d047cae8.js"]},"components/SessionDetail.tsx -> ./DirectTerminal":{"id":3764,"files":["static/css/659eccb5db697b76.css","static/chunks/1383.8f5f7d4606d356cc.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/addon-fit":{"id":2529,"files":["static/chunks/2529.32352c1ce5253e3e.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/addon-web-links":{"id":5491,"files":["static/chunks/5491.fd98884d48631149.js"]},"components/terminal/useXtermTerminal.ts -> @xterm/xterm":{"id":5627,"files":["static/chunks/1d2d5650.1ef8611b5325bd83.js"]}}';
@@ -1 +1 @@
1
- <!DOCTYPE html><!--YR6Xi4DC5A7S7E2PoZuif--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="/_next/static/css/fcafd381715071b8.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d2dfbd3e9262b74e.js"/><script src="/_next/static/chunks/88a6fc35-f836b4b72df5eafa.js" async=""></script><script src="/_next/static/chunks/1461-af7c54935f21d56d.js" async=""></script><script src="/_next/static/chunks/main-app-690acf9d5d2050c9.js" async=""></script><script src="/_next/static/chunks/app/layout-bb6db479523cb3d6.js" async=""></script><script src="/_next/static/chunks/8713-d3d663f55dc00e48.js" async=""></script><script src="/_next/static/chunks/app/error-da1d10c96ff5dd29.js" async=""></script><script src="/_next/static/chunks/app/not-found-824d5d3c6e296eeb.js" async=""></script><script src="/_next/static/chunks/app/global-error-ca06d2b1be2d4ae0.js" async=""></script><meta name="robots" content="noindex"/><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f5f3f0"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#121110"/><title>ao | integrator</title><meta name="description" content="Dashboard for managing parallel AI coding agents"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="ao | integrator"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon?fde4afff4688df3a" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon?95aeb60ec7acf330" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","dark",null,["light","dark"],null,false,true)</script><!--$--><div class="flex w-full items-center justify-center px-6 py-10 min-h-screen" style="background:radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)"><div class="w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8" style="background:linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%);border-color:var(--color-border-default);box-shadow:var(--detail-card-shadow)"><div class="flex flex-col gap-6"><div class="flex flex-col gap-4 sm:flex-row sm:items-start"><div class="flex h-14 w-14 items-center justify-center rounded-2xl border" style="background:linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%);border-color:color-mix(in srgb, var(--color-accent) 18%, var(--color-border-default));box-shadow:var(--detail-card-shadow)"><svg class="h-7 w-7" fill="none" stroke="currentColor" stroke-width="1.6" style="color:var(--color-accent)" viewBox="0 0 24 24"><rect x="2.5" y="4.5" width="19" height="15" rx="3"></rect><path d="M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"></path></svg></div><div class="min-w-0 flex-1"><div class="mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]" style="color:var(--color-accent);background:var(--color-tint-blue);border-color:color-mix(in srgb, var(--color-accent) 24%, transparent)">missing</div><h1 class="text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]">Page not found</h1><p class="mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]">This route does not exist in the dashboard. Return to the main view to pick an active project or session.</p></div></div><div class="flex flex-wrap gap-3"><a class="inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline" style="background:var(--color-accent);color:var(--color-text-inverse);border-color:color-mix(in srgb, var(--color-accent) 72%, transparent)" href="/">Back to dashboard</a></div></div></div></div><!--$--><!--/$--><!--/$--><script src="/_next/static/chunks/webpack-d2dfbd3e9262b74e.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1012,[\"7177\",\"static/chunks/app/layout-bb6db479523cb3d6.js\"],\"Providers\"]\n3:I[1992,[],\"\"]\n4:I[3464,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"8039\",\"static/chunks/app/error-da1d10c96ff5dd29.js\"],\"default\"]\n5:I[7678,[],\"\"]\n6:I[9789,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"4345\",\"static/chunks/app/not-found-824d5d3c6e296eeb.js\"],\"ErrorDisplay\"]\n7:I[7285,[\"7177\",\"static/chunks/app/layout-bb6db479523cb3d6.js\"],\"ServiceWorkerRegistrar\"]\n8:I[2901,[],\"OutletBoundary\"]\na:I[9904,[],\"AsyncMetadataOutlet\"]\nc:I[2901,[],\"ViewportBoundary\"]\ne:I[2901,[],\"MetadataBoundary\"]\nf:\"$Sreact.suspense\"\n11:I[7494,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"4219\",\"static/chunks/app/global-error-ca06d2b1be2d4ae0.js\"],\"default\"]\n:HL[\"/_next/static/css/fcafd381715071b8.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"YR6Xi4DC5A7S7E2PoZuif\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/fcafd381715071b8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased\",\"children\":[[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$4\",\"errorStyles\":[],\"errorScripts\":[],\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L6\",null,{\"title\":\"Page not found\",\"message\":\"This route does not exist in the dashboard. Return to the main view to pick an active project or session.\",\"tone\":\"not-found\",\"primaryAction\":{\"label\":\"Back to dashboard\",\"href\":\"/\"}}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L7\",null,{}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L6\",null,{\"title\":\"Page not found\",\"message\":\"This route does not exist in the dashboard. Return to the main view to pick an active project or session.\",\"tone\":\"not-found\",\"primaryAction\":{\"label\":\"Back to dashboard\",\"href\":\"/\"}}],null,[\"$\",\"$L8\",null,{\"children\":[\"$L9\",[\"$\",\"$La\",null,{\"promise\":\"$@b\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-screen items-center justify-center bg-[var(--color-bg-base)]\",\"children\":[\"$\",\"div\",null,{\"className\":\"flex flex-col items-center gap-3\",\"children\":[[\"$\",\"svg\",null,{\"className\":\"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":\"2\",\"viewBox\":\"0 0 24 24\",\"children\":[\"$\",\"path\",null,{\"d\":\"M12 3a9 9 0 1 0 9 9\"}]}],[\"$\",\"p\",null,{\"className\":\"text-[13px] text-[var(--color-text-tertiary)]\",\"children\":\"Loading…\"}]]}]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],null],[\"$\",\"$Le\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$f\",null,{\"fallback\":null,\"children\":\"$L10\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, viewport-fit=cover\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#f5f3f0\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#121110\"}]]\n9:null\n"])</script><script>self.__next_f.push([1,"12:I[7184,[],\"IconMark\"]\n"])</script><script>self.__next_f.push([1,"b:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"ao | integrator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Dashboard for managing parallel AI coding agents\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"ao | integrator\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon?fde4afff4688df3a\",\"alt\":\"$undefined\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon?95aeb60ec7acf330\",\"alt\":\"$undefined\",\"type\":\"image/png\",\"sizes\":\"180x180\"}],[\"$\",\"$L12\",\"8\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"10:\"$b:metadata\"\n"])</script></body></html>
1
+ <!DOCTYPE html><!--h0RXs0prE87a8wlbEXQKM--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="/_next/static/css/cf9226160e230bf4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-83d2d8248a30259c.js"/><script src="/_next/static/chunks/88a6fc35-f836b4b72df5eafa.js" async=""></script><script src="/_next/static/chunks/1461-af7c54935f21d56d.js" async=""></script><script src="/_next/static/chunks/main-app-b95f197c38e3b0a3.js" async=""></script><script src="/_next/static/chunks/app/layout-0cda720d75f111b8.js" async=""></script><script src="/_next/static/chunks/8713-d3d663f55dc00e48.js" async=""></script><script src="/_next/static/chunks/app/error-684a1c5596fa1e14.js" async=""></script><script src="/_next/static/chunks/app/not-found-315f4e5c106b425d.js" async=""></script><script src="/_next/static/chunks/app/global-error-1a79bacfbd9b1ba4.js" async=""></script><meta name="robots" content="noindex"/><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f5f3f0"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#121110"/><title>ao | integrator</title><meta name="description" content="Dashboard for managing parallel AI coding agents"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="ao | integrator"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon?fde4afff4688df3a" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon?95aeb60ec7acf330" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","dark",null,["light","dark"],null,false,true)</script><!--$--><div class="flex w-full items-center justify-center px-6 py-10 min-h-screen" style="background:radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)"><div class="w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8" style="background:linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%);border-color:var(--color-border-default);box-shadow:var(--detail-card-shadow)"><div class="flex flex-col gap-6"><div class="flex flex-col gap-4 sm:flex-row sm:items-start"><div class="flex h-14 w-14 items-center justify-center rounded-2xl border" style="background:linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%);border-color:color-mix(in srgb, var(--color-accent) 18%, var(--color-border-default));box-shadow:var(--detail-card-shadow)"><svg class="h-7 w-7" fill="none" stroke="currentColor" stroke-width="1.6" style="color:var(--color-accent)" viewBox="0 0 24 24"><rect x="2.5" y="4.5" width="19" height="15" rx="3"></rect><path d="M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"></path></svg></div><div class="min-w-0 flex-1"><div class="mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]" style="color:var(--color-accent);background:var(--color-tint-blue);border-color:color-mix(in srgb, var(--color-accent) 24%, transparent)">missing</div><h1 class="text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]">Page not found</h1><p class="mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]">This route does not exist in the dashboard. Return to the main view to pick an active project or session.</p></div></div><div class="flex flex-wrap gap-3"><a class="inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline" style="background:var(--color-accent);color:var(--color-text-inverse);border-color:color-mix(in srgb, var(--color-accent) 72%, transparent)" href="/">Back to dashboard</a></div></div></div></div><!--$--><!--/$--><!--/$--><script src="/_next/static/chunks/webpack-83d2d8248a30259c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1012,[\"7177\",\"static/chunks/app/layout-0cda720d75f111b8.js\"],\"Providers\"]\n3:I[1992,[],\"\"]\n4:I[3464,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"8039\",\"static/chunks/app/error-684a1c5596fa1e14.js\"],\"default\"]\n5:I[7678,[],\"\"]\n6:I[9789,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"4345\",\"static/chunks/app/not-found-315f4e5c106b425d.js\"],\"ErrorDisplay\"]\n7:I[7285,[\"7177\",\"static/chunks/app/layout-0cda720d75f111b8.js\"],\"ServiceWorkerRegistrar\"]\n8:I[2901,[],\"OutletBoundary\"]\na:I[9904,[],\"AsyncMetadataOutlet\"]\nc:I[2901,[],\"ViewportBoundary\"]\ne:I[2901,[],\"MetadataBoundary\"]\nf:\"$Sreact.suspense\"\n11:I[7494,[\"8713\",\"static/chunks/8713-d3d663f55dc00e48.js\",\"4219\",\"static/chunks/app/global-error-1a79bacfbd9b1ba4.js\"],\"default\"]\n:HL[\"/_next/static/css/cf9226160e230bf4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"h0RXs0prE87a8wlbEXQKM\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/cf9226160e230bf4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased\",\"children\":[[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$4\",\"errorStyles\":[],\"errorScripts\":[],\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L6\",null,{\"title\":\"Page not found\",\"message\":\"This route does not exist in the dashboard. Return to the main view to pick an active project or session.\",\"tone\":\"not-found\",\"primaryAction\":{\"label\":\"Back to dashboard\",\"href\":\"/\"}}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"$L7\",null,{}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L6\",null,{\"title\":\"Page not found\",\"message\":\"This route does not exist in the dashboard. Return to the main view to pick an active project or session.\",\"tone\":\"not-found\",\"primaryAction\":{\"label\":\"Back to dashboard\",\"href\":\"/\"}}],null,[\"$\",\"$L8\",null,{\"children\":[\"$L9\",[\"$\",\"$La\",null,{\"promise\":\"$@b\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-screen items-center justify-center bg-[var(--color-bg-base)]\",\"children\":[\"$\",\"div\",null,{\"className\":\"flex flex-col items-center gap-3\",\"children\":[[\"$\",\"svg\",null,{\"className\":\"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":\"2\",\"viewBox\":\"0 0 24 24\",\"children\":[\"$\",\"path\",null,{\"d\":\"M12 3a9 9 0 1 0 9 9\"}]}],[\"$\",\"p\",null,{\"className\":\"text-[13px] text-[var(--color-text-tertiary)]\",\"children\":\"Loading…\"}]]}]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],null],[\"$\",\"$Le\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$f\",null,{\"fallback\":null,\"children\":\"$L10\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, viewport-fit=cover\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#f5f3f0\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#121110\"}]]\n9:null\n"])</script><script>self.__next_f.push([1,"12:I[7184,[],\"IconMark\"]\n"])</script><script>self.__next_f.push([1,"b:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"ao | integrator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Dashboard for managing parallel AI coding agents\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"ao | integrator\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon?fde4afff4688df3a\",\"alt\":\"$undefined\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon?95aeb60ec7acf330\",\"alt\":\"$undefined\",\"type\":\"image/png\",\"sizes\":\"180x180\"}],[\"$\",\"$L12\",\"8\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"10:\"$b:metadata\"\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-d2dfbd3e9262b74e.js" defer=""></script><script src="/_next/static/chunks/framework-7060e2ac4971c604.js" defer=""></script><script src="/_next/static/chunks/main-ed1610689fbd6f0d.js" defer=""></script><script src="/_next/static/chunks/pages/_app-f4baf4dbe88f6f54.js" defer=""></script><script src="/_next/static/chunks/pages/_error-a7f6723f42093f29.js" defer=""></script><script src="/_next/static/YR6Xi4DC5A7S7E2PoZuif/_buildManifest.js" defer=""></script><script src="/_next/static/YR6Xi4DC5A7S7E2PoZuif/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"YR6Xi4DC5A7S7E2PoZuif","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-83d2d8248a30259c.js" defer=""></script><script src="/_next/static/chunks/framework-7060e2ac4971c604.js" defer=""></script><script src="/_next/static/chunks/main-ed1610689fbd6f0d.js" defer=""></script><script src="/_next/static/chunks/pages/_app-f4baf4dbe88f6f54.js" defer=""></script><script src="/_next/static/chunks/pages/_error-a7f6723f42093f29.js" defer=""></script><script src="/_next/static/h0RXs0prE87a8wlbEXQKM/_buildManifest.js" defer=""></script><script src="/_next/static/h0RXs0prE87a8wlbEXQKM/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"h0RXs0prE87a8wlbEXQKM","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"F/u90xmUJhIRUJ98ZJ63FyJTTNLMGVaRm9KdoECfQ6c="}
1
+ {"node":{},"edge":{},"encryptionKey":"jSGvVEzLArrKsmVk8tcqgk7m/SVSkfzDLHUkQ7jmnD0="}
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1383],{3764:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DirectTerminal:()=>p,buildTerminalThemes:()=>h,resolveMonoFontFamily:()=>d});var n=r(3817),o=r(6749),l=r(7594),a=r(2286),s=r(4901);let i="ao-terminal-font-size",c='"JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace';function d(){try{let e=getComputedStyle(document.documentElement).getPropertyValue("--font-jetbrains-mono").trim();return e?"".concat(e,", ").concat(c):c}catch(e){return c}}function u(e){let{sessionId:t,chromeless:r,isOpenCodeSession:l,reloadCommand:a,fontSize:i,setFontSize:c,fullscreen:d,toggleFullscreen:u,muxStatus:m,error:f}=e,[h,p]=(0,o.useState)(!1),[x,b]=(0,o.useState)(null);async function v(){if(l&&!h){b(null),p(!0);try{let e=a;if(!e){let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/remap"),{method:"POST"});if(!r.ok)throw Error("Failed to remap OpenCode session: ".concat(r.status));let n=await r.json();if("string"!=typeof n.opencodeSessionId||0===n.opencodeSessionId.length)throw Error("Missing OpenCode session id after remap");e="/exit\nopencode --session ".concat(n.opencodeSessionId,"\n")}let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})});if(!r.ok)throw Error("Failed to send reload command: ".concat(r.status))}catch(e){b(e instanceof Error?e.message:"Failed to reload OpenCode session")}finally{p(!1)}}}let g=f?"error":m,y="var(--color-accent)",w=(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>c(e=>Math.max(9,e-1)),disabled:i<=9,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Decrease font size",children:"−"}),(0,n.jsxs)("span",{className:"w-9 text-center text-xs font-medium text-[var(--color-text-secondary)]",children:[i,"px"]}),(0,n.jsx)("button",{onClick:()=>c(e=>Math.min(18,e+1)),disabled:i>=18,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Increase font size",children:"+"})]}),k=l?(0,n.jsx)("button",{onClick:v,disabled:h||"connected"!==m,title:"Restart OpenCode session (/exit then resume mapped session)","aria-label":"Restart OpenCode session",className:"flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)] disabled:cursor-not-allowed disabled:opacity-70",children:h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3 animate-spin",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 3a9 9 0 109 9"})}),"restarting"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 11-2.64-6.36"}),(0,n.jsx)("path",{d:"M21 3v6h-6"})]}),"restart"]})}):null,j=(0,n.jsx)("button",{onClick:u,className:(0,s.cn)("flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",!l&&!r&&"ml-auto"),"aria-label":d?"exit fullscreen":"fullscreen",children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}),"exit fullscreen"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})}),"fullscreen"]})});return r?(0,n.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-[6px] border border-[var(--color-border-subtle)] bg-[color-mix(in_srgb,var(--color-bg-elevated)_92%,transparent)] px-1.5 py-1 shadow-[0_8px_24px_rgba(0,0,0,0.18)] backdrop-blur-sm",children:[k,j]}):(0,n.jsxs)("div",{className:"terminal-chrome-bar flex items-center gap-2 border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)] px-3 py-2",children:[(0,n.jsx)("span",{className:"terminal-chrome-pane-label",children:"TERMINAL"}),(0,n.jsxs)("div",{className:"terminal-chrome-identity",children:[(0,n.jsx)("span",{className:"terminal-chrome-session-id font-[var(--font-mono)] text-[11px]",style:{color:y},children:t}),(0,n.jsxs)("div",{className:"terminal-chrome-status-row",children:[(0,n.jsx)("div",{className:(0,s.cn)("h-2 w-2 shrink-0 rounded-full","connected"===g?"bg-[var(--color-status-ready)]":"error"===g||"disconnected"===g?"bg-[var(--color-status-error)]":"bg-[var(--color-status-attention)] animate-[pulse_1.5s_ease-in-out_infinite]")}),(0,n.jsx)("span",{className:(0,s.cn)("text-[10px] font-medium uppercase tracking-[0.06em]","connected"===g?"text-[var(--color-status-ready)]":"error"===g||"disconnected"===g?"text-[var(--color-status-error)]":"text-[var(--color-text-tertiary)]"),children:"connected"===g?"Connected":"error"===g?null!=f?f:"Error":"disconnected"===g?"Disconnected":"Connecting…"}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-[0.06em]",style:{color:y,background:"color-mix(in srgb, ".concat(y," 12%, transparent)")},children:"XDA"})]})]}),(0,n.jsx)("div",{className:"flex-1"}),w,k,x?(0,n.jsx)("span",{className:"max-w-[40ch] truncate text-[10px] font-medium text-[var(--color-status-error)]",title:x,children:x}):null,j]})}var m=r(5184);r(5611);let f={deadZone:8,verticalDominance:1.5,maxLinesPerEvent:6,speedMultiplier:3,tmuxPrefix:"\x02"};function h(e){let t="#5b7ef8";return{dark:{background:"#0a0a0f",foreground:"#d4d4d8",cursor:t,cursorAccent:"#0a0a0f",selectionBackground:"rgba(91, 126, 248, 0.30)",selectionInactiveBackground:"rgba(128, 128, 128, 0.2)",black:"#1a1a24",red:"#ef4444",green:"#22c55e",yellow:"#f59e0b",blue:"#5b7ef8",magenta:"#a371f7",cyan:"#22d3ee",white:"#d4d4d8",brightBlack:"#50506a",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#fbbf24",brightBlue:"#7b9cfb",brightMagenta:"#c084fc",brightCyan:"#67e8f9",brightWhite:"#eeeef5"},light:{background:"#fafafa",foreground:"#24292f",cursor:t,cursorAccent:"#fafafa",selectionBackground:"rgba(91, 126, 248, 0.25)",selectionInactiveBackground:"rgba(128, 128, 128, 0.15)",black:"#24292f",red:"#b42318",green:"#1f7a3d",yellow:"#8a5a00",blue:"#175cd3",magenta:"#8e24aa",cyan:"#0b7285",white:"#4b5563",brightBlack:"#374151",brightRed:"#912018",brightGreen:"#176639",brightYellow:"#6f4a00",brightBlue:"#1d4ed8",brightMagenta:"#7b1fa2",brightCyan:"#155e75",brightWhite:"#374151"}}}function p(e){let{sessionId:t,projectId:c,tmuxName:p,startFullscreen:x=!1,variant:b="agent",appearance:v="theme",height:g="max(440px, calc(100dvh - 440px))",isOpenCodeSession:y=!1,reloadCommand:w,chromeless:k=!1,autoFocus:j=!1}=e,S=(0,l.useRouter)(),C=(0,l.usePathname)(),E=(0,l.useSearchParams)(),{resolvedTheme:N}=(0,a.D)(),T=(0,o.useRef)(null),[M,L]=(0,o.useState)(x),[A,F]=(0,o.useState)(function(){try{let e=localStorage.getItem(i);if(e){let t=parseInt(e,10);if(!Number.isNaN(t))return Math.max(9,Math.min(18,t))}}catch(e){}return 13}()),{error:B,followOutput:P,scrollToLatest:R,muxStatus:z,terminalInstance:I,fitAddon:D}=function(e,t,n){let{appearance:l,variant:s,fontSize:c,autoFocus:u,projectId:p,tmuxName:x}=n,{resolvedTheme:b}=(0,a.D)(),v=(0,o.useMemo)(()=>h(s),[s]),{subscribeTerminal:g,writeTerminal:y,resizeTerminal:w,openTerminal:k,closeTerminal:j,status:S}=(0,m.Ug)(),C=(0,o.useRef)(null),E=(0,o.useRef)(null),[N,T]=(0,o.useState)(null),M=(0,o.useRef)(!0),[L,A]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{if(!e.current)return;T(null);let n=!0,o=null,a=null,s=null;return Promise.all([r.e(4560).then(r.bind(r,5627)).then(e=>e.Terminal),r.e(2529).then(r.bind(r,2529)).then(e=>e.FitAddon),r.e(5491).then(r.bind(r,5491)).then(e=>e.WebLinksAddon),document.fonts.ready]).then(r=>{let[i,m,h]=r;if(!n||!e.current)return;let S="dark"===l||"light"!==b,N=S?v.dark:v.light,T=new i({cursorBlink:!0,fontSize:c,fontFamily:d(),lineHeight:1.2,theme:N,minimumContrastRatio:S?1:7,scrollback:1e4,allowProposedApi:!0,fastScrollSensitivity:3,scrollSensitivity:1}),L=new m;T.loadAddon(L),E.current=L;let F=new h;T.loadAddon(F),T.parser.registerCsiHandler({prefix:">",final:"q"},()=>(T.write("\x1bP>|XTerm(370)\x1b\\"),!0)),T.parser.registerOscHandler(52,e=>{let t=e.split(";");if(t.length<2)return!1;let r=t[t.length-1];try{var n;let e=atob(r),t=Uint8Array.from(e,e=>e.charCodeAt(0)),o=new TextDecoder().decode(t);null==(n=navigator.clipboard)||n.writeText(o).catch(()=>{})}catch(e){}return!0}),T.attachCustomKeyEventHandler(e=>{if("keydown"!==e.type)return!0;if((e.metaKey&&!e.ctrlKey&&!e.altKey&&"KeyC"===e.code||e.ctrlKey&&e.shiftKey&&"KeyC"===e.code)&&T.hasSelection()){var t;return null==(t=navigator.clipboard)||t.writeText(T.getSelection()).catch(()=>{}),T.clearSelection(),!1}return!0}),T.open(e.current),C.current=T,u&&T.focus(),L.fit();let B=setTimeout(()=>{if(n&&E.current)try{E.current.fit(),w(t,T.cols,T.rows,p)}catch(e){}},100),P=()=>{if(n&&E.current&&C.current)try{var e,r;C.current.options.fontFamily=d(),null==(e=(r=C.current).clearTextureAtlas)||e.call(r),E.current.fit(),w(t,C.current.cols,C.current.rows,p)}catch(e){}},R="undefined"!=typeof document?document.fonts:void 0,z=!!R&&"function"==typeof R.addEventListener;z&&R.addEventListener("loadingdone",P);let I=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={...f,...r},o=e.element;if(!o)return()=>{};let l=o.style.touchAction;o.style.touchAction="none";let a=o.querySelector(".xterm-viewport");a&&(a.style.touchAction="none");let s=0,i=0,c=0,d=null,u=!1,m=e=>{"touch"===e.pointerType&&(s=e.clientX,i=e.clientY,c=e.clientY,d=null,u=!1)},h=l=>{var a,m,f;if("touch"!==l.pointerType)return;let h=l.clientX-s,p=l.clientY-i,x=Math.abs(h),b=Math.abs(p);if(null===d){if(Math.max(x,b)<n.deadZone)return;if(b<n.verticalDominance*x){d=!1;return}d=!0;try{o.setPointerCapture(l.pointerId)}catch(e){}}if(!0!==d)return;l.preventDefault();let v=Math.round((l.clientY-c)/((null!=(f=e.options.fontSize)?f:13)*1.2));if(v>n.maxLinesPerEvent&&(v=n.maxLinesPerEvent),v<-n.maxLinesPerEvent&&(v=-n.maxLinesPerEvent),0===v)return;c=l.clientY;let g=v*n.speedMultiplier;if(v>0?null==(a=r.onScrollAway)||a.call(r):null==(m=r.onScrollTowardLatest)||m.call(r),"normal"===e.buffer.active.type)e.scrollLines(-g);else{u||(u=!0,t(n.tmuxPrefix+"["));let e=v>0?"\x1b[A":"\x1b[B",r=Math.abs(g);for(let n=0;n<r;n++)t(e)}},p=e=>{if("touch"===e.pointerType){try{o.hasPointerCapture(e.pointerId)&&o.releasePointerCapture(e.pointerId)}catch(e){}d=null}},x={capture:!0},b={capture:!0,passive:!1};return o.addEventListener("pointerdown",m,x),o.addEventListener("pointermove",h,b),o.addEventListener("pointerup",p,x),o.addEventListener("pointercancel",p,x),()=>{o.removeEventListener("pointerdown",m,x),o.removeEventListener("pointermove",h,b),o.removeEventListener("pointerup",p,x),o.removeEventListener("pointercancel",p,x),o.style.touchAction=l}}(T,e=>{y(t,e,p)},{onScrollAway:()=>{M.current=!1,A(!1)}}),D=null;e.current&&(D=new ResizeObserver(()=>{if(n&&E.current)try{E.current.fit(),w(t,T.cols,T.rows,p)}catch(e){}})).observe(e.current);let _=[],O=!1,K=null,W=0,Y=()=>{K&&(clearTimeout(K),K=null),_.length>0&&(T.write(_.join("")),_.length=0,W=0)},q=T.onSelectionChange(()=>{T.hasSelection()?(O=!0,K||(K=setTimeout(()=>{O=!1,Y()},5e3))):(O=!1,Y())}),H=!1;k(t,p,x),s=g(t,e=>{O?(_.push(e),(W+=e.length)>1048576&&(O=!1,Y())):(T.write(e),M.current&&(H=!0,T.scrollToBottom()))},p);let U=T.onScroll(()=>{if(H){H=!1;return}let e=T.buffer.active;e.viewportY+T.rows>=e.length?(M.current=!0,A(!0)):(M.current=!1,A(!1))}),J=()=>{L&&(L.fit(),w(t,T.cols,T.rows,p))};window.addEventListener("resize",J),a=T.onData(e=>{y(t,e,p)}),w(t,T.cols,T.rows,p),o=()=>{clearTimeout(B),null==D||D.disconnect(),I(),q.dispose(),K&&clearTimeout(K),window.removeEventListener("resize",J),z&&R&&R.removeEventListener("loadingdone",P),U.dispose(),null==a||a.dispose(),a=null,null==s||s(),j(t,p),T.dispose()}}).catch(e=>{console.error("[DirectTerminal] Failed to load xterm.js:",e),T("Failed to load terminal")}),()=>{n=!1,null==o||o()}},[l,t,p,x,s,b,v,g,y,w,k,j]),(0,o.useEffect)(()=>{if("connected"!==S)return;let e=E.current,r=C.current;e&&r&&(e.fit(),w(t,r.cols,r.rows,p))},[S,t,p,w]),(0,o.useEffect)(()=>{let e=C.current;if(!e)return;let t="dark"===l||"light"!==b;e.options.theme=t?v.dark:v.light,e.options.minimumContrastRatio=t?1:7},[l,b,v]),(0,o.useEffect)(()=>{let e=C.current,r=E.current;if(e&&r){e.options.fontSize=c;try{localStorage.setItem(i,String(c))}catch(e){}r.fit(),w(t,e.cols,e.rows,p)}},[c,t,p,w]),{error:N,followOutput:L,scrollToLatest:()=>{let e=C.current;e&&("normal"===e.buffer.active.type?e.scrollToBottom():y(t,"q",p)),M.current=!0,A(!0)},muxStatus:S,terminalInstance:C,fitAddon:E}}(T,t,{appearance:v,variant:b,fontSize:A,autoFocus:j,projectId:c,tmuxName:p}),{resizeTerminal:_,status:O}=(0,m.Ug)(),K=(0,o.useRef)(O);K.current=O,(0,o.useEffect)(()=>{let e=D.current,r=I.current,n=T.current;if(!e||!r||"connected"!==K.current||!n)return;let o=0,l=!1,a=0,s=-1,i=()=>{if(l)return;o++;let d=n.getBoundingClientRect().height,u=s>=0&&1>Math.abs(d-s);if(s=d,!u&&o<60){a=requestAnimationFrame(i);return}r.refresh(0,r.rows-1),e.fit(),r.refresh(0,r.rows-1),_(t,r.cols,r.rows,c)};a=requestAnimationFrame(i);let d=e=>{l||e.target===n.parentElement&&(o=0,s=-1,setTimeout(()=>{l||(a=requestAnimationFrame(i))},50))},u=n.parentElement;null==u||u.addEventListener("transitionend",d);let m=setTimeout(()=>{l||(o=0,s=-1,i())},300),f=setTimeout(()=>{l||(o=0,s=-1,i())},600);return()=>{l=!0,cancelAnimationFrame(a),null==u||u.removeEventListener("transitionend",d),clearTimeout(m),clearTimeout(f)}},[M,t,c,_,T,D,I]),(0,o.useEffect)(()=>{let e=new URLSearchParams(E.toString());M?e.set("fullscreen","true"):e.delete("fullscreen");let t=e.toString()?"".concat(C,"?").concat(e.toString()):C;S.replace(t,{scroll:!1})},[M,C,S,E]);let W="dark"===v||"light"!==N;return(0,n.jsxs)("div",{className:(0,s.cn)("overflow-hidden border border-[var(--color-border-default)] flex flex-col",M?"fixed inset-0 z-50 rounded-none border-0":"relative h-full",W?"bg-[#0a0a0f]":"bg-[#fafafa]",k&&"border-0"),children:[(0,n.jsx)(u,{sessionId:t,chromeless:k,isOpenCodeSession:y,reloadCommand:w,fontSize:A,setFontSize:F,fullscreen:M,toggleFullscreen:()=>L(e=>!e),muxStatus:z,error:B}),(0,n.jsxs)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[P?null:(0,n.jsx)("button",{type:"button",onClick:R,className:"absolute bottom-3 right-3 z-20 flex h-8 w-8 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] shadow-md active:scale-95","aria-label":"Jump to latest",title:"Jump to latest",children:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),(0,n.jsx)("div",{ref:T,className:"w-full flex flex-col flex-1 min-h-0 overflow-hidden"})]})]})}},5611:()=>{}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1383],{3764:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DirectTerminal:()=>p,buildTerminalThemes:()=>h,resolveMonoFontFamily:()=>d});var n=r(3817),o=r(6749),l=r(7594),a=r(2286),s=r(4901);let i="ao-terminal-font-size",c='"JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace';function d(){try{let e=getComputedStyle(document.documentElement).getPropertyValue("--font-jetbrains-mono").trim();return e?"".concat(e,", ").concat(c):c}catch(e){return c}}function u(e){let{sessionId:t,chromeless:r,isOpenCodeSession:l,reloadCommand:a,fontSize:i,setFontSize:c,fullscreen:d,toggleFullscreen:u,muxStatus:m,error:f}=e,[h,p]=(0,o.useState)(!1),[x,b]=(0,o.useState)(null);async function v(){if(l&&!h){b(null),p(!0);try{let e=a;if(!e){let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/remap"),{method:"POST"});if(!r.ok)throw Error("Failed to remap OpenCode session: ".concat(r.status));let n=await r.json();if("string"!=typeof n.opencodeSessionId||0===n.opencodeSessionId.length)throw Error("Missing OpenCode session id after remap");e="/exit\nopencode --session ".concat(n.opencodeSessionId,"\n")}let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})});if(!r.ok)throw Error("Failed to send reload command: ".concat(r.status))}catch(e){b(e instanceof Error?e.message:"Failed to reload OpenCode session")}finally{p(!1)}}}let g=f?"error":m,y="var(--color-accent)",w=(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>c(e=>Math.max(9,e-1)),disabled:i<=9,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Decrease font size",children:"−"}),(0,n.jsxs)("span",{className:"w-9 text-center text-xs font-medium text-[var(--color-text-secondary)]",children:[i,"px"]}),(0,n.jsx)("button",{onClick:()=>c(e=>Math.min(18,e+1)),disabled:i>=18,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Increase font size",children:"+"})]}),k=l?(0,n.jsx)("button",{onClick:v,disabled:h||"connected"!==m,title:"Restart OpenCode session (/exit then resume mapped session)","aria-label":"Restart OpenCode session",className:"flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)] disabled:cursor-not-allowed disabled:opacity-70",children:h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3 animate-spin",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 3a9 9 0 109 9"})}),"restarting"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 11-2.64-6.36"}),(0,n.jsx)("path",{d:"M21 3v6h-6"})]}),"restart"]})}):null,j=(0,n.jsx)("button",{onClick:u,className:(0,s.cn)("flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",!l&&!r&&"ml-auto"),"aria-label":d?"exit fullscreen":"fullscreen",children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}),"exit fullscreen"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})}),"fullscreen"]})});return r?(0,n.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-[6px] border border-[var(--color-border-subtle)] bg-[color-mix(in_srgb,var(--color-bg-elevated)_92%,transparent)] px-1.5 py-1 shadow-[0_8px_24px_rgba(0,0,0,0.18)] backdrop-blur-sm",children:[k,j]}):(0,n.jsxs)("div",{className:"terminal-chrome-bar flex items-center gap-2 border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)] px-3 py-2",children:[(0,n.jsx)("span",{className:"terminal-chrome-pane-label",children:"TERMINAL"}),(0,n.jsxs)("div",{className:"terminal-chrome-identity",children:[(0,n.jsx)("span",{className:"terminal-chrome-session-id font-[var(--font-mono)] text-[11px]",style:{color:y},children:t}),(0,n.jsxs)("div",{className:"terminal-chrome-status-row",children:[(0,n.jsx)("div",{className:(0,s.cn)("h-2 w-2 shrink-0 rounded-full","connected"===g?"bg-[var(--color-status-ready)]":"error"===g||"disconnected"===g?"bg-[var(--color-status-error)]":"bg-[var(--color-status-attention)] animate-[pulse_1.5s_ease-in-out_infinite]")}),(0,n.jsx)("span",{className:(0,s.cn)("text-[10px] font-medium uppercase tracking-[0.06em]","connected"===g?"text-[var(--color-status-ready)]":"error"===g||"disconnected"===g?"text-[var(--color-status-error)]":"text-[var(--color-text-tertiary)]"),children:"connected"===g?"Connected":"error"===g?null!=f?f:"Error":"disconnected"===g?"Disconnected":"Connecting…"}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-[0.06em]",style:{color:y,background:"color-mix(in srgb, ".concat(y," 12%, transparent)")},children:"XDA"})]})]}),(0,n.jsx)("div",{className:"flex-1"}),w,k,x?(0,n.jsx)("span",{className:"max-w-[40ch] truncate text-[10px] font-medium text-[var(--color-status-error)]",title:x,children:x}):null,j]})}var m=r(5184);r(5611);let f={deadZone:8,verticalDominance:1.5,maxLinesPerEvent:6,speedMultiplier:3,tmuxPrefix:"\x02"};function h(e){let t="#5b7ef8";return{dark:{background:"#0a0a0f",foreground:"#d4d4d8",cursor:t,cursorAccent:"#0a0a0f",selectionBackground:"rgba(91, 126, 248, 0.30)",selectionInactiveBackground:"rgba(128, 128, 128, 0.2)",black:"#1a1a24",red:"#ef4444",green:"#22c55e",yellow:"#f59e0b",blue:"#5b7ef8",magenta:"#a371f7",cyan:"#22d3ee",white:"#d4d4d8",brightBlack:"#50506a",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#fbbf24",brightBlue:"#7b9cfb",brightMagenta:"#c084fc",brightCyan:"#67e8f9",brightWhite:"#eeeef5"},light:{background:"#fafafa",foreground:"#24292f",cursor:t,cursorAccent:"#fafafa",selectionBackground:"rgba(91, 126, 248, 0.25)",selectionInactiveBackground:"rgba(128, 128, 128, 0.15)",black:"#24292f",red:"#b42318",green:"#1f7a3d",yellow:"#8a5a00",blue:"#175cd3",magenta:"#8e24aa",cyan:"#0b7285",white:"#4b5563",brightBlack:"#374151",brightRed:"#912018",brightGreen:"#176639",brightYellow:"#6f4a00",brightBlue:"#1d4ed8",brightMagenta:"#7b1fa2",brightCyan:"#155e75",brightWhite:"#374151"}}}function p(e){let{sessionId:t,projectId:c,tmuxName:p,startFullscreen:x=!1,variant:b="agent",appearance:v="theme",height:g="max(440px, calc(100dvh - 440px))",isOpenCodeSession:y=!1,reloadCommand:w,chromeless:k=!1,autoFocus:j=!1}=e,S=(0,l.useRouter)(),C=(0,l.usePathname)(),E=(0,l.useSearchParams)(),{resolvedTheme:N}=(0,a.D)(),T=(0,o.useRef)(null),[M,L]=(0,o.useState)(x),[A,F]=(0,o.useState)(function(){try{let e=localStorage.getItem(i);if(e){let t=parseInt(e,10);if(!Number.isNaN(t))return Math.max(9,Math.min(18,t))}}catch(e){}return 13}()),{error:B,followOutput:P,scrollToLatest:R,muxStatus:z,terminalInstance:I,fitAddon:D}=function(e,t,n){let{appearance:l,variant:s,fontSize:c,autoFocus:u,projectId:p,tmuxName:x}=n,{resolvedTheme:b}=(0,a.D)(),v=(0,o.useMemo)(()=>h(s),[s]),{subscribeTerminal:g,writeTerminal:y,resizeTerminal:w,openTerminal:k,closeTerminal:j,status:S}=(0,m.Ug)(),C=(0,o.useRef)(null),E=(0,o.useRef)(null),[N,T]=(0,o.useState)(null),M=(0,o.useRef)(!0),[L,A]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{if(!e.current)return;T(null);let n=!0,o=null,a=null,s=null;return Promise.all([r.e(4560).then(r.bind(r,5627)).then(e=>e.Terminal),r.e(2529).then(r.bind(r,2529)).then(e=>e.FitAddon),r.e(5491).then(r.bind(r,5491)).then(e=>e.WebLinksAddon),document.fonts.ready]).then(r=>{let[i,m,h]=r;if(!n||!e.current)return;let S="dark"===l||"light"!==b,N=S?v.dark:v.light,T=new i({cursorBlink:!0,fontSize:c,fontFamily:d(),lineHeight:1.2,theme:N,minimumContrastRatio:S?1:7,scrollback:0,allowProposedApi:!0,fastScrollSensitivity:3,scrollSensitivity:1}),L=new m;T.loadAddon(L),E.current=L;let F=new h;T.loadAddon(F),T.parser.registerCsiHandler({prefix:">",final:"q"},()=>(T.write("\x1bP>|XTerm(370)\x1b\\"),!0)),T.parser.registerOscHandler(52,e=>{let t=e.split(";");if(t.length<2)return!1;let r=t[t.length-1];try{var n;let e=atob(r),t=Uint8Array.from(e,e=>e.charCodeAt(0)),o=new TextDecoder().decode(t);null==(n=navigator.clipboard)||n.writeText(o).catch(()=>{})}catch(e){}return!0}),T.attachCustomKeyEventHandler(e=>{if("keydown"!==e.type)return!0;if((e.metaKey&&!e.ctrlKey&&!e.altKey&&"KeyC"===e.code||e.ctrlKey&&e.shiftKey&&"KeyC"===e.code)&&T.hasSelection()){var t;return null==(t=navigator.clipboard)||t.writeText(T.getSelection()).catch(()=>{}),T.clearSelection(),!1}return!0}),T.open(e.current),C.current=T,u&&T.focus(),L.fit();let B=setTimeout(()=>{if(n&&E.current)try{E.current.fit(),w(t,T.cols,T.rows,p)}catch(e){}},100),P=()=>{if(n&&E.current&&C.current)try{var e,r;C.current.options.fontFamily=d(),null==(e=(r=C.current).clearTextureAtlas)||e.call(r),E.current.fit(),w(t,C.current.cols,C.current.rows,p)}catch(e){}},R="undefined"!=typeof document?document.fonts:void 0,z=!!R&&"function"==typeof R.addEventListener;z&&R.addEventListener("loadingdone",P);let I=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={...f,...r},o=e.element;if(!o)return()=>{};let l=o.style.touchAction;o.style.touchAction="none";let a=o.querySelector(".xterm-viewport");a&&(a.style.touchAction="none");let s=0,i=0,c=0,d=null,u=!1,m=e=>{"touch"===e.pointerType&&(s=e.clientX,i=e.clientY,c=e.clientY,d=null,u=!1)},h=l=>{var a,m,f;if("touch"!==l.pointerType)return;let h=l.clientX-s,p=l.clientY-i,x=Math.abs(h),b=Math.abs(p);if(null===d){if(Math.max(x,b)<n.deadZone)return;if(b<n.verticalDominance*x){d=!1;return}d=!0;try{o.setPointerCapture(l.pointerId)}catch(e){}}if(!0!==d)return;l.preventDefault();let v=Math.round((l.clientY-c)/((null!=(f=e.options.fontSize)?f:13)*1.2));if(v>n.maxLinesPerEvent&&(v=n.maxLinesPerEvent),v<-n.maxLinesPerEvent&&(v=-n.maxLinesPerEvent),0===v)return;c=l.clientY;let g=v*n.speedMultiplier;if(v>0?null==(a=r.onScrollAway)||a.call(r):null==(m=r.onScrollTowardLatest)||m.call(r),"normal"===e.buffer.active.type)e.scrollLines(-g);else{u||(u=!0,t(n.tmuxPrefix+"["));let e=v>0?"\x1b[A":"\x1b[B",r=Math.abs(g);for(let n=0;n<r;n++)t(e)}},p=e=>{if("touch"===e.pointerType){try{o.hasPointerCapture(e.pointerId)&&o.releasePointerCapture(e.pointerId)}catch(e){}d=null}},x={capture:!0},b={capture:!0,passive:!1};return o.addEventListener("pointerdown",m,x),o.addEventListener("pointermove",h,b),o.addEventListener("pointerup",p,x),o.addEventListener("pointercancel",p,x),()=>{o.removeEventListener("pointerdown",m,x),o.removeEventListener("pointermove",h,b),o.removeEventListener("pointerup",p,x),o.removeEventListener("pointercancel",p,x),o.style.touchAction=l}}(T,e=>{y(t,e,p)},{onScrollAway:()=>{M.current=!1,A(!1)}}),D=null;e.current&&(D=new ResizeObserver(()=>{if(n&&E.current)try{E.current.fit(),w(t,T.cols,T.rows,p)}catch(e){}})).observe(e.current);let _=[],O=!1,K=null,W=0,Y=()=>{K&&(clearTimeout(K),K=null),_.length>0&&(T.write(_.join("")),_.length=0,W=0)},q=T.onSelectionChange(()=>{T.hasSelection()?(O=!0,K||(K=setTimeout(()=>{O=!1,Y()},5e3))):(O=!1,Y())}),H=!1;k(t,p,x),s=g(t,e=>{O?(_.push(e),(W+=e.length)>1048576&&(O=!1,Y())):(T.write(e),M.current&&(H=!0,T.scrollToBottom()))},p);let U=T.onScroll(()=>{if(H){H=!1;return}let e=T.buffer.active;e.viewportY+T.rows>=e.length?(M.current=!0,A(!0)):(M.current=!1,A(!1))}),J=()=>{L&&(L.fit(),w(t,T.cols,T.rows,p))};window.addEventListener("resize",J),a=T.onData(e=>{y(t,e,p)}),w(t,T.cols,T.rows,p),o=()=>{clearTimeout(B),null==D||D.disconnect(),I(),q.dispose(),K&&clearTimeout(K),window.removeEventListener("resize",J),z&&R&&R.removeEventListener("loadingdone",P),U.dispose(),null==a||a.dispose(),a=null,null==s||s(),j(t,p),T.dispose()}}).catch(e=>{console.error("[DirectTerminal] Failed to load xterm.js:",e),T("Failed to load terminal")}),()=>{n=!1,null==o||o()}},[l,t,p,x,s,b,v,g,y,w,k,j]),(0,o.useEffect)(()=>{if("connected"!==S)return;let e=E.current,r=C.current;e&&r&&(e.fit(),w(t,r.cols,r.rows,p))},[S,t,p,w]),(0,o.useEffect)(()=>{let e=C.current;if(!e)return;let t="dark"===l||"light"!==b;e.options.theme=t?v.dark:v.light,e.options.minimumContrastRatio=t?1:7},[l,b,v]),(0,o.useEffect)(()=>{let e=C.current,r=E.current;if(e&&r){e.options.fontSize=c;try{localStorage.setItem(i,String(c))}catch(e){}r.fit(),w(t,e.cols,e.rows,p)}},[c,t,p,w]),{error:N,followOutput:L,scrollToLatest:()=>{let e=C.current;e&&("normal"===e.buffer.active.type?e.scrollToBottom():y(t,"q",p)),M.current=!0,A(!0)},muxStatus:S,terminalInstance:C,fitAddon:E}}(T,t,{appearance:v,variant:b,fontSize:A,autoFocus:j,projectId:c,tmuxName:p}),{resizeTerminal:_,status:O}=(0,m.Ug)(),K=(0,o.useRef)(O);K.current=O,(0,o.useEffect)(()=>{let e=D.current,r=I.current,n=T.current;if(!e||!r||"connected"!==K.current||!n)return;let o=0,l=!1,a=0,s=-1,i=()=>{if(l)return;o++;let d=n.getBoundingClientRect().height,u=s>=0&&1>Math.abs(d-s);if(s=d,!u&&o<60){a=requestAnimationFrame(i);return}r.refresh(0,r.rows-1),e.fit(),r.refresh(0,r.rows-1),_(t,r.cols,r.rows,c)};a=requestAnimationFrame(i);let d=e=>{l||e.target===n.parentElement&&(o=0,s=-1,setTimeout(()=>{l||(a=requestAnimationFrame(i))},50))},u=n.parentElement;null==u||u.addEventListener("transitionend",d);let m=setTimeout(()=>{l||(o=0,s=-1,i())},300),f=setTimeout(()=>{l||(o=0,s=-1,i())},600);return()=>{l=!0,cancelAnimationFrame(a),null==u||u.removeEventListener("transitionend",d),clearTimeout(m),clearTimeout(f)}},[M,t,c,_,T,D,I]),(0,o.useEffect)(()=>{let e=new URLSearchParams(E.toString());M?e.set("fullscreen","true"):e.delete("fullscreen");let t=e.toString()?"".concat(C,"?").concat(e.toString()):C;S.replace(t,{scroll:!1})},[M,C,S,E]);let W="dark"===v||"light"!==N;return(0,n.jsxs)("div",{className:(0,s.cn)("overflow-hidden border border-[var(--color-border-default)] flex flex-col",M?"fixed inset-0 z-50 rounded-none border-0":"relative h-full",W?"bg-[#0a0a0f]":"bg-[#fafafa]",k&&"border-0"),children:[(0,n.jsx)(u,{sessionId:t,chromeless:k,isOpenCodeSession:y,reloadCommand:w,fontSize:A,setFontSize:F,fullscreen:M,toggleFullscreen:()=>L(e=>!e),muxStatus:z,error:B}),(0,n.jsxs)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[P?null:(0,n.jsx)("button",{type:"button",onClick:R,className:"absolute bottom-3 right-3 z-20 flex h-8 w-8 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] shadow-md active:scale-95","aria-label":"Jump to latest",title:"Jump to latest",children:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),(0,n.jsx)("div",{ref:T,className:"w-full flex flex-col flex-1 min-h-0 overflow-hidden"})]})]})}},5611:()=>{}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1383,3764],{2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,a,l,s)=>{let i=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&a?o.map(e=>a[e]||e):o;r?(i.classList.remove(...n),i.classList.add(a&&a[t]?a[t]:t)):i.setAttribute(e,t)}),r=t,s&&c.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},a=["light","dark"],l="(prefers-color-scheme: dark)",s="undefined"==typeof window,i=n.createContext(void 0),c={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:c},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:s=!0,storageKey:c="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:x,nonce:y,scriptProps:w}=e,[S,k]=n.useState(()=>p(c,d)),[E,C]=n.useState(()=>"system"===S?b():S),T=g?Object.values(g):u,N=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=b());let n=g?g[t]:t,l=r?v(y):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(c):c(f),s){let e=a.includes(d)?d:null,r=a.includes(t)?t:e;i.style.colorScheme=r}null==l||l()},[y]),j=n.useCallback(e=>{let t="function"==typeof e?e(S):e;k(t);try{localStorage.setItem(c,t)}catch(e){}},[S]),M=n.useCallback(e=>{C(b(e)),"system"===S&&o&&!t&&N("system")},[S,t]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?k(e.newValue):j(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[j]),n.useEffect(()=>{N(null!=t?t:S)},[t,S]);let P=n.useMemo(()=>({theme:S,setTheme:j,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:o?[...u,"system"]:u,systemTheme:o?E:void 0}),[S,j,t,E,o,u]);return n.createElement(i.Provider,{value:P},n.createElement(h,{forcedTheme:t,storageKey:c,attribute:f,enableSystem:o,enableColorScheme:s,defaultTheme:d,value:g,themes:u,nonce:y,scriptProps:w}),x)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:a,enableSystem:l,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([a,r,i,t,u,c,l,s]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},v=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},3764:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DirectTerminal:()=>p,buildTerminalThemes:()=>h,resolveMonoFontFamily:()=>u});var n=r(3817),o=r(6749),a=r(7594),l=r(2286),s=r(4901);let i="ao-terminal-font-size",c='"JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace';function u(){try{let e=getComputedStyle(document.documentElement).getPropertyValue("--font-jetbrains-mono").trim();return e?"".concat(e,", ").concat(c):c}catch(e){return c}}function d(e){let{sessionId:t,chromeless:r,isOpenCodeSession:a,reloadCommand:l,fontSize:i,setFontSize:c,fullscreen:u,toggleFullscreen:d,muxStatus:m,error:f}=e,[h,p]=(0,o.useState)(!1),[v,b]=(0,o.useState)(null);async function g(){if(a&&!h){b(null),p(!0);try{let e=l;if(!e){let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/remap"),{method:"POST"});if(!r.ok)throw Error("Failed to remap OpenCode session: ".concat(r.status));let n=await r.json();if("string"!=typeof n.opencodeSessionId||0===n.opencodeSessionId.length)throw Error("Missing OpenCode session id after remap");e="/exit\nopencode --session ".concat(n.opencodeSessionId,"\n")}let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})});if(!r.ok)throw Error("Failed to send reload command: ".concat(r.status))}catch(e){b(e instanceof Error?e.message:"Failed to reload OpenCode session")}finally{p(!1)}}}let x=f?"error":m,y="var(--color-accent)",w=(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>c(e=>Math.max(9,e-1)),disabled:i<=9,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Decrease font size",children:"−"}),(0,n.jsxs)("span",{className:"w-9 text-center text-xs font-medium text-[var(--color-text-secondary)]",children:[i,"px"]}),(0,n.jsx)("button",{onClick:()=>c(e=>Math.min(18,e+1)),disabled:i>=18,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Increase font size",children:"+"})]}),S=a?(0,n.jsx)("button",{onClick:g,disabled:h||"connected"!==m,title:"Restart OpenCode session (/exit then resume mapped session)","aria-label":"Restart OpenCode session",className:"flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)] disabled:cursor-not-allowed disabled:opacity-70",children:h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3 animate-spin",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 3a9 9 0 109 9"})}),"restarting"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 11-2.64-6.36"}),(0,n.jsx)("path",{d:"M21 3v6h-6"})]}),"restart"]})}):null,k=(0,n.jsx)("button",{onClick:d,className:(0,s.cn)("flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",!a&&!r&&"ml-auto"),"aria-label":u?"exit fullscreen":"fullscreen",children:u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}),"exit fullscreen"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})}),"fullscreen"]})});return r?(0,n.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-[6px] border border-[var(--color-border-subtle)] bg-[color-mix(in_srgb,var(--color-bg-elevated)_92%,transparent)] px-1.5 py-1 shadow-[0_8px_24px_rgba(0,0,0,0.18)] backdrop-blur-sm",children:[S,k]}):(0,n.jsxs)("div",{className:"terminal-chrome-bar flex items-center gap-2 border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)] px-3 py-2",children:[(0,n.jsx)("span",{className:"terminal-chrome-pane-label",children:"TERMINAL"}),(0,n.jsxs)("div",{className:"terminal-chrome-identity",children:[(0,n.jsx)("span",{className:"terminal-chrome-session-id font-[var(--font-mono)] text-[11px]",style:{color:y},children:t}),(0,n.jsxs)("div",{className:"terminal-chrome-status-row",children:[(0,n.jsx)("div",{className:(0,s.cn)("h-2 w-2 shrink-0 rounded-full","connected"===x?"bg-[var(--color-status-ready)]":"error"===x||"disconnected"===x?"bg-[var(--color-status-error)]":"bg-[var(--color-status-attention)] animate-[pulse_1.5s_ease-in-out_infinite]")}),(0,n.jsx)("span",{className:(0,s.cn)("text-[10px] font-medium uppercase tracking-[0.06em]","connected"===x?"text-[var(--color-status-ready)]":"error"===x||"disconnected"===x?"text-[var(--color-status-error)]":"text-[var(--color-text-tertiary)]"),children:"connected"===x?"Connected":"error"===x?null!=f?f:"Error":"disconnected"===x?"Disconnected":"Connecting…"}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-[0.06em]",style:{color:y,background:"color-mix(in srgb, ".concat(y," 12%, transparent)")},children:"XDA"})]})]}),(0,n.jsx)("div",{className:"flex-1"}),w,S,v?(0,n.jsx)("span",{className:"max-w-[40ch] truncate text-[10px] font-medium text-[var(--color-status-error)]",title:v,children:v}):null,k]})}var m=r(5184);r(5611);let f={deadZone:8,verticalDominance:1.5,maxLinesPerEvent:6,speedMultiplier:3,tmuxPrefix:"\x02"};function h(e){let t="#5b7ef8";return{dark:{background:"#0a0a0f",foreground:"#d4d4d8",cursor:t,cursorAccent:"#0a0a0f",selectionBackground:"rgba(91, 126, 248, 0.30)",selectionInactiveBackground:"rgba(128, 128, 128, 0.2)",black:"#1a1a24",red:"#ef4444",green:"#22c55e",yellow:"#f59e0b",blue:"#5b7ef8",magenta:"#a371f7",cyan:"#22d3ee",white:"#d4d4d8",brightBlack:"#50506a",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#fbbf24",brightBlue:"#7b9cfb",brightMagenta:"#c084fc",brightCyan:"#67e8f9",brightWhite:"#eeeef5"},light:{background:"#fafafa",foreground:"#24292f",cursor:t,cursorAccent:"#fafafa",selectionBackground:"rgba(91, 126, 248, 0.25)",selectionInactiveBackground:"rgba(128, 128, 128, 0.15)",black:"#24292f",red:"#b42318",green:"#1f7a3d",yellow:"#8a5a00",blue:"#175cd3",magenta:"#8e24aa",cyan:"#0b7285",white:"#4b5563",brightBlack:"#374151",brightRed:"#912018",brightGreen:"#176639",brightYellow:"#6f4a00",brightBlue:"#1d4ed8",brightMagenta:"#7b1fa2",brightCyan:"#155e75",brightWhite:"#374151"}}}function p(e){let{sessionId:t,projectId:c,tmuxName:p,startFullscreen:v=!1,variant:b="agent",appearance:g="theme",height:x="max(440px, calc(100dvh - 440px))",isOpenCodeSession:y=!1,reloadCommand:w,chromeless:S=!1,autoFocus:k=!1}=e,E=(0,a.useRouter)(),C=(0,a.usePathname)(),T=(0,a.useSearchParams)(),{resolvedTheme:N}=(0,l.D)(),j=(0,o.useRef)(null),[M,P]=(0,o.useState)(v),[L,I]=(0,o.useState)(function(){try{let e=localStorage.getItem(i);if(e){let t=parseInt(e,10);if(!Number.isNaN(t))return Math.max(9,Math.min(18,t))}}catch(e){}return 13}()),{error:A,followOutput:R,scrollToLatest:O,muxStatus:F,terminalInstance:W,fitAddon:B}=function(e,t,n){let{appearance:a,variant:s,fontSize:c,autoFocus:d,projectId:p,tmuxName:v}=n,{resolvedTheme:b}=(0,l.D)(),g=(0,o.useMemo)(()=>h(s),[s]),{subscribeTerminal:x,writeTerminal:y,resizeTerminal:w,openTerminal:S,closeTerminal:k,status:E}=(0,m.Ug)(),C=(0,o.useRef)(null),T=(0,o.useRef)(null),[N,j]=(0,o.useState)(null),M=(0,o.useRef)(!0),[P,L]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{if(!e.current)return;j(null);let n=!0,o=null,l=null,s=null;return Promise.all([r.e(4560).then(r.bind(r,5627)).then(e=>e.Terminal),r.e(2529).then(r.bind(r,2529)).then(e=>e.FitAddon),r.e(5491).then(r.bind(r,5491)).then(e=>e.WebLinksAddon),document.fonts.ready]).then(r=>{let[i,m,h]=r;if(!n||!e.current)return;let E="dark"===a||"light"!==b,N=E?g.dark:g.light,j=new i({cursorBlink:!0,fontSize:c,fontFamily:u(),lineHeight:1.2,theme:N,minimumContrastRatio:E?1:7,scrollback:0,allowProposedApi:!0,fastScrollSensitivity:3,scrollSensitivity:1}),P=new m;j.loadAddon(P),T.current=P;let I=new h;j.loadAddon(I),j.parser.registerCsiHandler({prefix:">",final:"q"},()=>(j.write("\x1bP>|XTerm(370)\x1b\\"),!0)),j.parser.registerOscHandler(52,e=>{let t=e.split(";");if(t.length<2)return!1;let r=t[t.length-1];try{var n;let e=atob(r),t=Uint8Array.from(e,e=>e.charCodeAt(0)),o=new TextDecoder().decode(t);null==(n=navigator.clipboard)||n.writeText(o).catch(()=>{})}catch(e){}return!0}),j.attachCustomKeyEventHandler(e=>{if("keydown"!==e.type)return!0;if((e.metaKey&&!e.ctrlKey&&!e.altKey&&"KeyC"===e.code||e.ctrlKey&&e.shiftKey&&"KeyC"===e.code)&&j.hasSelection()){var t;return null==(t=navigator.clipboard)||t.writeText(j.getSelection()).catch(()=>{}),j.clearSelection(),!1}return!0}),j.open(e.current),C.current=j,d&&j.focus(),P.fit();let A=setTimeout(()=>{if(n&&T.current)try{T.current.fit(),w(t,j.cols,j.rows,p)}catch(e){}},100),R=()=>{if(n&&T.current&&C.current)try{var e,r;C.current.options.fontFamily=u(),null==(e=(r=C.current).clearTextureAtlas)||e.call(r),T.current.fit(),w(t,C.current.cols,C.current.rows,p)}catch(e){}},O="undefined"!=typeof document?document.fonts:void 0,F=!!O&&"function"==typeof O.addEventListener;F&&O.addEventListener("loadingdone",R);let W=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={...f,...r},o=e.element;if(!o)return()=>{};let a=o.style.touchAction;o.style.touchAction="none";let l=o.querySelector(".xterm-viewport");l&&(l.style.touchAction="none");let s=0,i=0,c=0,u=null,d=!1,m=e=>{"touch"===e.pointerType&&(s=e.clientX,i=e.clientY,c=e.clientY,u=null,d=!1)},h=a=>{var l,m,f;if("touch"!==a.pointerType)return;let h=a.clientX-s,p=a.clientY-i,v=Math.abs(h),b=Math.abs(p);if(null===u){if(Math.max(v,b)<n.deadZone)return;if(b<n.verticalDominance*v){u=!1;return}u=!0;try{o.setPointerCapture(a.pointerId)}catch(e){}}if(!0!==u)return;a.preventDefault();let g=Math.round((a.clientY-c)/((null!=(f=e.options.fontSize)?f:13)*1.2));if(g>n.maxLinesPerEvent&&(g=n.maxLinesPerEvent),g<-n.maxLinesPerEvent&&(g=-n.maxLinesPerEvent),0===g)return;c=a.clientY;let x=g*n.speedMultiplier;if(g>0?null==(l=r.onScrollAway)||l.call(r):null==(m=r.onScrollTowardLatest)||m.call(r),"normal"===e.buffer.active.type)e.scrollLines(-x);else{d||(d=!0,t(n.tmuxPrefix+"["));let e=g>0?"\x1b[A":"\x1b[B",r=Math.abs(x);for(let n=0;n<r;n++)t(e)}},p=e=>{if("touch"===e.pointerType){try{o.hasPointerCapture(e.pointerId)&&o.releasePointerCapture(e.pointerId)}catch(e){}u=null}},v={capture:!0},b={capture:!0,passive:!1};return o.addEventListener("pointerdown",m,v),o.addEventListener("pointermove",h,b),o.addEventListener("pointerup",p,v),o.addEventListener("pointercancel",p,v),()=>{o.removeEventListener("pointerdown",m,v),o.removeEventListener("pointermove",h,b),o.removeEventListener("pointerup",p,v),o.removeEventListener("pointercancel",p,v),o.style.touchAction=a}}(j,e=>{y(t,e,p)},{onScrollAway:()=>{M.current=!1,L(!1)}}),B=null;e.current&&(B=new ResizeObserver(()=>{if(n&&T.current)try{T.current.fit(),w(t,j.cols,j.rows,p)}catch(e){}})).observe(e.current);let _=[],z=!1,D=null,J=0,K=()=>{D&&(clearTimeout(D),D=null),_.length>0&&(j.write(_.join("")),_.length=0,J=0)},H=j.onSelectionChange(()=>{j.hasSelection()?(z=!0,D||(D=setTimeout(()=>{z=!1,K()},5e3))):(z=!1,K())}),U=!1;S(t,p,v),s=x(t,e=>{z?(_.push(e),(J+=e.length)>1048576&&(z=!1,K())):(j.write(e),M.current&&(U=!0,j.scrollToBottom()))},p);let Y=j.onScroll(()=>{if(U){U=!1;return}let e=j.buffer.active;e.viewportY+j.rows>=e.length?(M.current=!0,L(!0)):(M.current=!1,L(!1))}),q=()=>{P&&(P.fit(),w(t,j.cols,j.rows,p))};window.addEventListener("resize",q),l=j.onData(e=>{y(t,e,p)}),w(t,j.cols,j.rows,p),o=()=>{clearTimeout(A),null==B||B.disconnect(),W(),H.dispose(),D&&clearTimeout(D),window.removeEventListener("resize",q),F&&O&&O.removeEventListener("loadingdone",R),Y.dispose(),null==l||l.dispose(),l=null,null==s||s(),k(t,p),j.dispose()}}).catch(e=>{console.error("[DirectTerminal] Failed to load xterm.js:",e),j("Failed to load terminal")}),()=>{n=!1,null==o||o()}},[a,t,p,v,s,b,g,x,y,w,S,k]),(0,o.useEffect)(()=>{if("connected"!==E)return;let e=T.current,r=C.current;e&&r&&(e.fit(),w(t,r.cols,r.rows,p))},[E,t,p,w]),(0,o.useEffect)(()=>{let e=C.current;if(!e)return;let t="dark"===a||"light"!==b;e.options.theme=t?g.dark:g.light,e.options.minimumContrastRatio=t?1:7},[a,b,g]),(0,o.useEffect)(()=>{let e=C.current,r=T.current;if(e&&r){e.options.fontSize=c;try{localStorage.setItem(i,String(c))}catch(e){}r.fit(),w(t,e.cols,e.rows,p)}},[c,t,p,w]),{error:N,followOutput:P,scrollToLatest:()=>{let e=C.current;e&&("normal"===e.buffer.active.type?e.scrollToBottom():y(t,"q",p)),M.current=!0,L(!0)},muxStatus:E,terminalInstance:C,fitAddon:T}}(j,t,{appearance:g,variant:b,fontSize:L,autoFocus:k,projectId:c,tmuxName:p}),{resizeTerminal:_,status:z}=(0,m.Ug)(),D=(0,o.useRef)(z);D.current=z,(0,o.useEffect)(()=>{let e=B.current,r=W.current,n=j.current;if(!e||!r||"connected"!==D.current||!n)return;let o=0,a=!1,l=0,s=-1,i=()=>{if(a)return;o++;let u=n.getBoundingClientRect().height,d=s>=0&&1>Math.abs(u-s);if(s=u,!d&&o<60){l=requestAnimationFrame(i);return}r.refresh(0,r.rows-1),e.fit(),r.refresh(0,r.rows-1),_(t,r.cols,r.rows,c)};l=requestAnimationFrame(i);let u=e=>{a||e.target===n.parentElement&&(o=0,s=-1,setTimeout(()=>{a||(l=requestAnimationFrame(i))},50))},d=n.parentElement;null==d||d.addEventListener("transitionend",u);let m=setTimeout(()=>{a||(o=0,s=-1,i())},300),f=setTimeout(()=>{a||(o=0,s=-1,i())},600);return()=>{a=!0,cancelAnimationFrame(l),null==d||d.removeEventListener("transitionend",u),clearTimeout(m),clearTimeout(f)}},[M,t,c,_,j,B,W]),(0,o.useEffect)(()=>{let e=new URLSearchParams(T.toString());M?e.set("fullscreen","true"):e.delete("fullscreen");let t=e.toString()?"".concat(C,"?").concat(e.toString()):C;E.replace(t,{scroll:!1})},[M,C,E,T]);let J="dark"===g||"light"!==N;return(0,n.jsxs)("div",{className:(0,s.cn)("overflow-hidden border border-[var(--color-border-default)] flex flex-col",M?"fixed inset-0 z-50 rounded-none border-0":"relative h-full",J?"bg-[#0a0a0f]":"bg-[#fafafa]",S&&"border-0"),children:[(0,n.jsx)(d,{sessionId:t,chromeless:S,isOpenCodeSession:y,reloadCommand:w,fontSize:L,setFontSize:I,fullscreen:M,toggleFullscreen:()=>P(e=>!e),muxStatus:F,error:A}),(0,n.jsxs)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[R?null:(0,n.jsx)("button",{type:"button",onClick:O,className:"absolute bottom-3 right-3 z-20 flex h-8 w-8 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] shadow-md active:scale-95","aria-label":"Jump to latest",title:"Jump to latest",children:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),(0,n.jsx)("div",{ref:j,className:"w-full flex flex-col flex-1 min-h-0 overflow-hidden"})]})]})}},4901:(e,t,r)=>{"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}r.d(t,{cn:()=>n})},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>s,eT:()=>i,i2:()=>u});var n=r(3817),o=r(6749),a=r(1806);let l=o.createContext(void 0);function s(){let e=o.useContext(l);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return o.useContext(l)}function c(e,t){return t?"".concat(t,":").concat(e):e}function u(e){let{children:t}=e,r=(0,o.useRef)(null),s=(0,o.useRef)(new Map),i=(0,o.useRef)(new Map),[u,d]=(0,o.useState)("connecting"),[m,f]=(0,o.useState)([]),[h,p]=(0,o.useState)(null),v=(0,o.useRef)(0),b=(0,o.useRef)(null),g=(0,o.useRef)({}),x=(0,o.useRef)(!1),y=(0,o.useCallback)(()=>{if(!r.current){d("connecting");try{let e=function(e){var t,r,n;let o=window.location,l="https:"===o.protocol?"wss:":"ws:",s=null!=(t=e.proxyWsPath)?t:a.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(s){let e=s.replace(/\/ws\/?$/,"");return"".concat(l,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(l,"//").concat(o.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:a.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(l,"//").concat(o.hostname,":").concat(i,"/mux")}(g.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(x.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),d("connected"),v.current=0,i.current.values())){let r={ch:"terminal",id:e.id,type:"open",...e.projectId&&{projectId:e.projectId},...e.tmuxName&&{tmuxName:e.tmuxName}};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch){let e=c(t.id,"projectId"in t?t.projectId:void 0);if("data"===t.type){let r=s.current.get(e);if(r)for(let e of r)e(t.data)}else if("opened"===t.type)i.current.has(e)||i.current.set(e,{id:t.id,..."projectId"in t&&t.projectId?{projectId:t.projectId}:{}});else if("exited"===t.type){i.current.delete(e);let r=s.current.get(e);if(r){let e="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of r)t(e)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message)}else"sessions"===t.ch&&("snapshot"===t.type?(f(t.sessions),p(null)):"error"===t.type&&p(t.error))}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),x.current)return;let e=Math.min(1e3*Math.pow(2,v.current),3e4);v.current+=1,d("reconnecting"),b.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(v.current,")...")),y()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),d("disconnected")}}},[]);(0,o.useEffect)(()=>{x.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();g.current={directTerminalPort:function(e){if("string"!=typeof e&&"number"!=typeof e)return;let t=Number.parseInt(String(e),10);if(Number.isInteger(t)&&!(t<=0)&&!(t>65535))return String(t)}(t.directTerminalPort),proxyWsPath:function(e){if("string"!=typeof e)return;let t=e.trim();if(t.startsWith("/"))return t}(t.proxyWsPath)}}}catch(e){}e||y()})(),()=>{var t;e=!0,x.current=!0,b.current&&clearTimeout(b.current),null==(t=r.current)||t.close()}},[y]);let w=(0,o.useCallback)((e,t,n)=>{var o;let a=c(e,n),l=s.current.get(a);if(l||(l=new Set,s.current.set(a,l)),l.add(t),!i.current.has(a)&&(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let t={ch:"terminal",id:e,type:"open",...n&&{projectId:n}};r.current.send(JSON.stringify(t))}return()=>{let e=s.current.get(a);e&&(e.delete(t),0===e.size&&s.current.delete(a))}},[]),S=(0,o.useCallback)((e,t,n)=>{var o;if((null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"data",data:t,...n&&{projectId:n}};r.current.send(JSON.stringify(o))}},[]),k=(0,o.useCallback)((e,t,n)=>{var o;if(i.current.set(c(e,t),{id:e,projectId:t,tmuxName:n}),(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"open",...t&&{projectId:t},...n&&{tmuxName:n}};r.current.send(JSON.stringify(o))}},[]),E=(0,o.useCallback)((e,t)=>{var n;if(i.current.delete(c(e,t)),(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN){let n={ch:"terminal",id:e,type:"close",...t&&{projectId:t}};r.current.send(JSON.stringify(n))}},[]),C=(0,o.useCallback)((e,t,n,o)=>{var a;if((null==(a=r.current)?void 0:a.readyState)===WebSocket.OPEN){let a={ch:"terminal",id:e,type:"resize",cols:t,rows:n,...o&&{projectId:o}};r.current.send(JSON.stringify(a))}},[]),T=(0,o.useMemo)(()=>({subscribeTerminal:w,writeTerminal:S,openTerminal:k,closeTerminal:E,resizeTerminal:C,status:u,sessions:m,lastError:h}),[w,S,k,E,C,u,m,h]);return(0,n.jsx)(l.Provider,{value:T,children:t})}},5611:()=>{}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{1712:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},4255:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>x,dynamic:()=>c});var t=s(3817),a=s(9891),n=s(7594),l=s(6749);let i=(0,a.default)(()=>Promise.all([s.e(8944),s.e(3764)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1}),o=(0,a.default)(()=>s.e(7317).then(s.bind(s,7317)).then(e=>({default:e.Terminal})),{loadableGenerated:{webpack:()=>[7317]},ssr:!1}),c="force-dynamic";function d(){let e=(0,n.useSearchParams)(),[r,s]=(0,l.useState)([]),[a,c]=(0,l.useState)(!0);(0,l.useEffect)(()=>{fetch("/api/sessions?active=true").then(e=>e.json()).then(e=>{e.sessions&&Array.isArray(e.sessions)&&s(e.sessions.map(e=>e.id))}).catch(e=>{console.error("Failed to fetch sessions:",e)})},[]);let d=e.get("session"),x=e.get("old_session"),m=e.get("new_session"),h=r[0]||"ao-orchestrator",p=r[1]||r[0]||"ao-orchestrator",u=x||d||h,b=m||d||p;return(0,t.jsx)("div",{className:"min-h-screen bg-[var(--color-bg-primary)] p-8",children:(0,t.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"mb-2 text-3xl font-bold text-[var(--color-text-primary)]",children:"Terminal Implementation Test & Documentation"}),(0,t.jsxs)("p",{className:"text-sm text-[var(--color-text-muted)]",children:["Comparing sessions:",(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-red)]",children:["OLD: ",u]}),(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-green)]",children:["NEW: ",b]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDC1B The Problem"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Issue:"})," Browser clipboard (Cmd+C/Ctrl+C) only worked when an iTerm2 client was attached to the tmux session."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Impact:"})," Users had to keep iTerm2 tabs open in the background for clipboard to work in the web dashboard."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Investigation time:"})," 12+ hours of debugging across tmux, ttyd, xterm.js, and macOS clipboard systems."]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD0D Root Cause Analysis"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"1. How tmux Clipboard Works (OSC 52)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux uses OSC 52 escape sequences to synchronize clipboard with terminals"}),(0,t.jsxs)("li",{children:["Format:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"\\x1b]52;c;<base64>\\x07"})]}),(0,t.jsx)("li",{children:"Terminal must support OSC 52 and have proper capabilities declared"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"2. tmux Capability Detection (XDA)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux queries terminal capabilities using Device Attributes (DA/XDA)"}),(0,t.jsxs)("li",{children:["XDA query: ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," ","(also called XTVERSION)"]}),(0,t.jsx)("li",{children:'Terminal responds with identification string containing terminal type (e.g., "XTerm(370)", "iTerm2 ")'}),(0,t.jsx)("li",{children:"Based on response, tmux enables features like TTYC_MS (clipboard support)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"3. The Missing Piece"}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-red)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"xterm.js does NOT implement XDA (Extended Device Attributes)"}),(0,t.jsxs)("ul",{className:"ml-6 mt-2 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["XDA is marked as TODO in xterm.js codebase:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsx)("li",{children:"Without XDA response, tmux doesn't recognize the terminal as clipboard-capable"}),(0,t.jsx)("li",{children:"tmux never emits OSC 52 sequences → clipboard doesn't work"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:'4. Why iTerm2 "Fixed" It'}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["iTerm2 sends proper XDA response identifying itself as"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:'"iTerm2 "'})]}),(0,t.jsx)("li",{children:"tmux detects this and enables clipboard for the entire session"}),(0,t.jsx)("li",{children:"OSC 52 sequences are then sent to ALL clients, including browser (ttyd/xterm.js)"}),(0,t.jsx)("li",{children:'This is why clipboard "magically worked" when iTerm2 was attached'})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"✅ The Solution"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal Implementation"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Created custom terminal component that registers an XDA handler using xterm.js parser API:"}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-[2px] bg-black p-4 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" }, // CSI > q is XDA query\n () => {\n // Respond with XTerm identification\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"What This Does"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Intercepts XDA queries from tmux"}),(0,t.jsxs)("li",{children:["Responds with"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"XTerm(370)"})," ","identification"]}),(0,t.jsx)("li",{children:'tmux detects "XTerm(" in response and enables TTYC_MS capability'}),(0,t.jsx)("li",{children:"OSC 52 sequences now flow: tmux → WebSocket → xterm.js → navigator.clipboard"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-accent-green)]",children:"Clipboard works without iTerm2!"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Architecture Changes"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Old:"})," Browser → ttyd (iframe) → tmux"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"New:"})," Browser → Custom WebSocket (node-pty) → tmux"]}),(0,t.jsx)("li",{children:"Bypasses ttyd for direct control over terminal initialization"}),(0,t.jsx)("li",{children:"Full control over escape sequence handling and capabilities"})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"⚠️ Node Version Requirement"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsx)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-orange)]",children:"CRITICAL: This implementation requires Node 20.x (currently 20.20.0)"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Why Node 20?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:(0,t.jsx)("strong",{children:"node-pty 1.1.0 is incompatible with Node 25+"})}),(0,t.jsxs)("li",{children:["Error on Node 25.6.1:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})]}),(0,t.jsx)("li",{children:"Root cause: node-pty's native module (darwin-arm64 prebuild) fails to spawn processes on Node 25"}),(0,t.jsx)("li",{children:"No darwin-arm64 prebuilds available that work with Node 25"}),(0,t.jsx)("li",{children:"Building from source also fails with the same error"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"When Can We Upgrade?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Wait for node-pty 1.2.0 stable release with Node 25+ support"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Test node-pty beta versions (currently 1.2.0-beta.11)"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 3:"})," Switch to alternative PTY library (e.g., xterm-pty, node-child-pty)"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ Testing Instructions for Upgrades"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Before upgrading Node or node-pty:"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["Test node-pty directly:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"node -e \"const pty = require('node-pty'); pty.spawn('/bin/bash', [], {})\""})]}),(0,t.jsxs)("li",{children:["If no"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})," ","error, proceed"]}),(0,t.jsx)("li",{children:"Start dev servers and open this page"}),(0,t.jsx)("li",{children:"Test DirectTerminal: verify connection, clipboard, resize"}),(0,t.jsx)("li",{children:"Test multiple sessions to ensure stability"}),(0,t.jsx)("li",{children:"If all tests pass, upgrade is safe"})]})]})]})]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("button",{onClick:()=>c(!a),className:"rounded-[2px] bg-[var(--color-accent-blue)] px-4 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-80",children:[a?"Hide":"Show"," Side-by-Side Comparison"]}),(0,t.jsx)("span",{className:"text-sm text-[var(--color-text-secondary)]",children:"Compare old (ttyd iframe) vs new (DirectTerminal with XDA)"})]}),u===b&&(0,t.jsxs)("div",{className:"mt-2 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["⚠️ Using same session for both terminals. To avoid port conflicts, use different sessions:",(0,t.jsx)("code",{className:"ml-1 rounded-[2px] bg-black px-1",children:"?old_session=ao-orchestrator&new_session=ao-20"})]})]}),a&&(0,t.jsxs)("section",{className:"mb-8",children:[(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-red)] px-2 py-1 text-xs font-semibold text-white",children:"OLD"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"ttyd iframe (no XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["❌ Clipboard requires iTerm2 attached",(0,t.jsx)("br",{}),"✅ Battle-tested (ttyd)",(0,t.jsx)("br",{}),"❌ No control over capabilities"]}),(0,t.jsx)(o,{sessionId:u})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-green)] px-2 py-1 text-xs font-semibold text-white",children:"NEW"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal (with XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["✅ Clipboard works standalone",(0,t.jsx)("br",{}),"✅ Full control over terminal",(0,t.jsx)("br",{}),"⚠️ Requires Node 20.x (node-pty)"]}),(0,t.jsx)(i,{sessionId:b,tmuxName:b})]})]}),(0,t.jsxs)("div",{className:"mt-4 rounded-[2px] border border-[var(--color-accent-blue)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:"\uD83E\uDDEA How to Test Clipboard"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Drag-select text in BOTH terminals above"}),(0,t.jsx)("li",{children:"Press Cmd+C (macOS) or Ctrl+Shift+C (Linux/Windows)"}),(0,t.jsx)("li",{children:"Paste in another application (Notes, VS Code, etc.)"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Expected: RIGHT terminal works, LEFT may not (unless iTerm2 is attached)"})})]})]})]}),(0,t.jsxs)("section",{className:"rounded-[2px] border border-[var(--color-accent)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD2C The Debugging Journey"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"Total Time Wasted: 12+ hours across Feb 15-16, 2026"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"❌ What We Tried (That Didn't Work)"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected ttyd clipboard handling"})," - Spent hours analyzing ttyd source code, checking OSC 52 passthrough. ttyd was innocent - it passes escape sequences correctly."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Blamed xterm.js configuration"})," - Tried every possible xterm.js option, clipboard addon configurations, terminal type settings. None made a difference."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Investigated macOS clipboard permissions"})," - Checked browser permissions, sandbox attributes, navigator.clipboard API. All were correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected WebSocket encoding issues"})," - Checked binary vs text mode, UTF-8 encoding, base64 handling. All correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Tried force-enabling tmux clipboard"})," - Used"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"set-option -s set-clipboard on"})," ","in tmux.conf. Didn't help - tmux needs the terminal to declare support."]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCA1 The Breakthrough"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"What finally worked:"})," Registering an XDA (Extended Device Attributes) handler in xterm.js using"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"terminal.parser.registerCsiHandler()"})]}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-[2px] bg-black p-3 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" },\n () => {\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})}),(0,t.jsx)("p",{className:"mt-2",children:"This single handler made tmux recognize our terminal as clipboard-capable. Clipboard immediately started working."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83C\uDFAF How We Finally Figured It Out"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Deep-dive into tmux source code"})," - Used DeepWiki.com to analyze tmux's terminal capability detection logic in"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"})," and"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty.c"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Discovered XDA queries"})," - Found that tmux sends"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," (XTVERSION) to detect terminal type"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:'Traced the "iTerm2 magic"'})," - Realized why clipboard worked when iTerm2 was attached: iTerm2 responds to XDA queries, enabling clipboard for the entire tmux session"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Checked xterm.js implementation"})," - Found that XDA is marked as TODO in xterm.js tests:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Implemented custom handler"})," - Used xterm.js parser API to register our own XDA handler"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ How We Could Have Figured It Out Faster"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Start with tmux source code first"})," - Instead of debugging xterm.js and ttyd, we should have immediately checked how tmux detects terminal capabilities"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Monitor escape sequences"})," - Running"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tmux -vvv"})," or using a terminal protocol analyzer would have revealed the XDA queries being sent"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Compare working vs broken scenarios"})," - Should have captured and diffed the escape sequences when iTerm2 was attached vs not attached earlier"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Check xterm.js issues/limitations first"}),' - A GitHub search for "xterm.js XDA" or "xterm.js device attributes" would have revealed it\'s unimplemented']}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Read tmux documentation on terminal types"})," - tmux man page mentions terminal capability detection, but we focused on clipboard settings instead"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCDA Key Resources"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,t.jsx)("li",{children:"tmux source analysis: DeepWiki.com (Feb 15, 2026)"}),(0,t.jsx)("li",{children:"xterm.js parser API documentation"}),(0,t.jsx)("li",{children:"XTerm Control Sequences: XTVERSION / Device Attributes"}),(0,t.jsxs)("li",{children:["tmux ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"}),": Terminal type detection logic"]})]})]})]})]}),(0,t.jsxs)("section",{className:"mt-6 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDCC1 Implementation Files"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/components/DirectTerminal.tsx"})," ","- Main component with XDA handler"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/server/direct-terminal-ws.ts"})," ","- WebSocket server using node-pty"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/app/dev/terminal-test/page.tsx"})," ","- This test page"]})]})]}),(0,t.jsxs)("div",{className:"mt-8 border-t border-[var(--color-border-default)] pt-4 text-center text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsx)("p",{children:"Investigation: Feb 15-16, 2026 • Duration: 12+ hours • Status: ✅ Resolved"}),(0,t.jsx)("p",{className:"mt-1",children:"Node 20.20.0 • node-pty 1.1.0 • xterm.js 5.3.0"})]})]})})}function x(){return(0,t.jsx)(l.Suspense,{fallback:(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:"Loading..."}),children:(0,t.jsx)(d,{})})}},5468:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return i}});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class t{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return a?new a:new t}function l(e){return a?a.bind(e):t.bind(e)}function i(){return a?a.snapshot():function(e,...r){return e(...r)}}},5864:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let t=s(3817),a=s(6749),n=s(6943);function l(e){return{default:e&&"default"in e?e.default:e}}s(6418);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let r={...i,...e},s=(0,a.lazy)(()=>r.loader().then(l)),o=r.loading;function c(e){let l=o?(0,t.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!r.ssr||!!r.loading,c=i?a.Suspense:a.Fragment,d=r.ssr?(0,t.jsxs)(t.Fragment,{children:[null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{"use strict";function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{"use strict";function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},7594:(e,r,s)=>{"use strict";var t=s(9582);s.o(t,"useParams")&&s.d(r,{useParams:function(){return t.useParams}}),s.o(t,"usePathname")&&s.d(r,{usePathname:function(){return t.usePathname}}),s.o(t,"useRouter")&&s.d(r,{useRouter:function(){return t.useRouter}}),s.o(t,"useSearchParams")&&s.d(r,{useSearchParams:function(){return t.useSearchParams}})},8394:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9891:(e,r,s)=>{"use strict";s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)},9937:(e,r,s)=>{Promise.resolve().then(s.bind(s,4255))}},e=>{e.O(0,[131,1461,7358],()=>e(e.s=9937)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},6514:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var a=o(9582);o.o(a,"useParams")&&o.d(e,{useParams:function(){return a.useParams}}),o.o(a,"usePathname")&&o.d(e,{usePathname:function(){return a.usePathname}}),o.o(a,"useRouter")&&o.d(e,{useRouter:function(){return a.useRouter}}),o.o(a,"useSearchParams")&&o.d(e,{useSearchParams:function(){return a.useSearchParams}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var a=o(3817),t=o(8713),l=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,a.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,a.jsx)(l(),{href:e.href,className:t,style:n,children:e.label}):(0,a.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:l="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=n[t],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,a.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(x?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,a.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(s,{accent:v.accent}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,a.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,a.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,a.jsx)(c,{action:d,primary:!0}):null,u?(0,a.jsx)(c,{action:u}):null]}),b,h?(0,a.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:l}),(0,a.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,a.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,a.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=6514)),_N_E=r.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},5308:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var a=o(9582);o.o(a,"useParams")&&o.d(e,{useParams:function(){return a.useParams}}),o.o(a,"usePathname")&&o.d(e,{usePathname:function(){return a.usePathname}}),o.o(a,"useRouter")&&o.d(e,{useRouter:function(){return a.useRouter}}),o.o(a,"useSearchParams")&&o.d(e,{useSearchParams:function(){return a.useSearchParams}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var a=o(3817),t=o(8713),l=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,a.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,a.jsx)(l(),{href:e.href,className:t,style:n,children:e.label}):(0,a.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:l="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=n[t],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,a.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(x?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,a.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(s,{accent:v.accent}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,a.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,a.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,a.jsx)(c,{action:d,primary:!0}):null,u?(0,a.jsx)(c,{action:u}):null]}),b,h?(0,a.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:l}),(0,a.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,a.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,a.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=5308)),_N_E=r.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},9576:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9576)),_N_E=r.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},7930:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=7930)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{533:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,2490,23)),Promise.resolve().then(r.bind(r,1012)),Promise.resolve().then(r.bind(r,7285))},1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(3817),o=r(2286),c=r(5184);function s(e){let{children:t}=e;return(0,n.jsx)(o.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,n.jsx)(c.i2,{children:t})})}},2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,c,s,a)=>{let i=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&c?o.map(e=>c[e]||e):o;r?(i.classList.remove(...n),i.classList.add(c&&c[t]?c[t]:t)):i.setAttribute(e,t)}),r=t,a&&l.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},c=["light","dark"],s="(prefers-color-scheme: dark)",a="undefined"==typeof window,i=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:l},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:b,nonce:S,scriptProps:w}=e,[k,E]=n.useState(()=>p(l,d)),[x,P]=n.useState(()=>"system"===k?v():k),T=g?Object.values(g):u,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=v());let n=g?g[t]:t,s=r?y(S):null,i=document.documentElement,l=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),a){let e=c.includes(d)?d:null,r=c.includes(t)?t:e;i.style.colorScheme=r}null==s||s()},[S]),N=n.useCallback(e=>{let t="function"==typeof e?e(k):e;E(t);try{localStorage.setItem(l,t)}catch(e){}},[k]),M=n.useCallback(e=>{P(v(e)),"system"===k&&o&&!t&&C("system")},[k,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?E(e.newValue):N(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),n.useEffect(()=>{C(null!=t?t:k)},[t,k]);let I=n.useMemo(()=>({theme:k,setTheme:N,forcedTheme:t,resolvedTheme:"system"===k?x:k,themes:o?[...u,"system"]:u,systemTheme:o?x:void 0}),[k,N,t,x,o,u]);return n.createElement(i.Provider,{value:I},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:g,themes:u,nonce:S,scriptProps:w}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:c,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([c,r,i,t,u,l,s,a]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},2490:()=>{},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>a,eT:()=>i,i2:()=>u});var n=r(3817),o=r(6749),c=r(1806);let s=o.createContext(void 0);function a(){let e=o.useContext(s);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return o.useContext(s)}function l(e,t){return t?"".concat(t,":").concat(e):e}function u(e){let{children:t}=e,r=(0,o.useRef)(null),a=(0,o.useRef)(new Map),i=(0,o.useRef)(new Map),[u,d]=(0,o.useState)("connecting"),[m,f]=(0,o.useState)([]),[h,p]=(0,o.useState)(null),y=(0,o.useRef)(0),v=(0,o.useRef)(null),g=(0,o.useRef)({}),b=(0,o.useRef)(!1),S=(0,o.useCallback)(()=>{if(!r.current){d("connecting");try{let e=function(e){var t,r,n;let o=window.location,s="https:"===o.protocol?"wss:":"ws:",a=null!=(t=e.proxyWsPath)?t:c.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(a){let e=a.replace(/\/ws\/?$/,"");return"".concat(s,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(s,"//").concat(o.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:c.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(s,"//").concat(o.hostname,":").concat(i,"/mux")}(g.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(b.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),d("connected"),y.current=0,i.current.values())){let r={ch:"terminal",id:e.id,type:"open",...e.projectId&&{projectId:e.projectId},...e.tmuxName&&{tmuxName:e.tmuxName}};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch){let e=l(t.id,"projectId"in t?t.projectId:void 0);if("data"===t.type){let r=a.current.get(e);if(r)for(let e of r)e(t.data)}else if("opened"===t.type)i.current.has(e)||i.current.set(e,{id:t.id,..."projectId"in t&&t.projectId?{projectId:t.projectId}:{}});else if("exited"===t.type){i.current.delete(e);let r=a.current.get(e);if(r){let e="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of r)t(e)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message)}else"sessions"===t.ch&&("snapshot"===t.type?(f(t.sessions),p(null)):"error"===t.type&&p(t.error))}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),b.current)return;let e=Math.min(1e3*Math.pow(2,y.current),3e4);y.current+=1,d("reconnecting"),v.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(y.current,")...")),S()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),d("disconnected")}}},[]);(0,o.useEffect)(()=>{b.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();g.current={directTerminalPort:function(e){if("string"!=typeof e&&"number"!=typeof e)return;let t=Number.parseInt(String(e),10);if(Number.isInteger(t)&&!(t<=0)&&!(t>65535))return String(t)}(t.directTerminalPort),proxyWsPath:function(e){if("string"!=typeof e)return;let t=e.trim();if(t.startsWith("/"))return t}(t.proxyWsPath)}}}catch(e){}e||S()})(),()=>{var t;e=!0,b.current=!0,v.current&&clearTimeout(v.current),null==(t=r.current)||t.close()}},[S]);let w=(0,o.useCallback)((e,t,n)=>{var o;let c=l(e,n),s=a.current.get(c);if(s||(s=new Set,a.current.set(c,s)),s.add(t),!i.current.has(c)&&(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let t={ch:"terminal",id:e,type:"open",...n&&{projectId:n}};r.current.send(JSON.stringify(t))}return()=>{let e=a.current.get(c);e&&(e.delete(t),0===e.size&&a.current.delete(c))}},[]),k=(0,o.useCallback)((e,t,n)=>{var o;if((null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"data",data:t,...n&&{projectId:n}};r.current.send(JSON.stringify(o))}},[]),E=(0,o.useCallback)((e,t,n)=>{var o;if(i.current.set(l(e,t),{id:e,projectId:t,tmuxName:n}),(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"open",...t&&{projectId:t},...n&&{tmuxName:n}};r.current.send(JSON.stringify(o))}},[]),x=(0,o.useCallback)((e,t)=>{var n;if(i.current.delete(l(e,t)),(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN){let n={ch:"terminal",id:e,type:"close",...t&&{projectId:t}};r.current.send(JSON.stringify(n))}},[]),P=(0,o.useCallback)((e,t,n,o)=>{var c;if((null==(c=r.current)?void 0:c.readyState)===WebSocket.OPEN){let c={ch:"terminal",id:e,type:"resize",cols:t,rows:n,...o&&{projectId:o}};r.current.send(JSON.stringify(c))}},[]),T=(0,o.useMemo)(()=>({subscribeTerminal:w,writeTerminal:k,openTerminal:E,closeTerminal:x,resizeTerminal:P,status:u,sessions:m,lastError:h}),[w,k,E,x,P,u,m,h]);return(0,n.jsx)(s.Provider,{value:T,children:t})}},7285:(e,t,r)=>{"use strict";r.d(t,{ServiceWorkerRegistrar:()=>o});var n=r(6749);function o(){return(0,n.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed:",e)})},[]),null}}},e=>{e.O(0,[3906,131,1461,7358],()=>e(e.s=533)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{529:(r,e,o)=>{Promise.resolve().then(o.bind(o,9789))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:u="page",children:m}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===u?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),m,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=529)),_N_E=r.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{2900:(e,r,t)=>{Promise.resolve().then(t.bind(t,9574))},4901:(e,r,t)=>{"use strict";function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}t.d(r,{cn:()=>s})},7594:(e,r,t)=>{"use strict";var s=t(9582);t.o(s,"useParams")&&t.d(r,{useParams:function(){return s.useParams}}),t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(r,{useSearchParams:function(){return s.useSearchParams}})},8450:(e,r,t)=>{"use strict";function s(e){return"/projects/".concat(encodeURIComponent(e))}function a(e,r){return"".concat(s(e),"/sessions/").concat(encodeURIComponent(r))}function c(e,r,t){return"".concat(a(e,r)).concat(t)}t.d(r,{$l:()=>c,Nc:()=>a,bn:()=>s})},9574:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>u});var s=t(3817),a=t(6749),c=t(7594),n=t(8713),o=t.n(n),i=t(4901),l=t(8450);function d(e){if(!e)return"Unknown";let r=new Date(e).getTime();if(!Number.isFinite(r))return"Unknown";let t=new Date().getTime()-r;if(t<0)return"Just now";let s=Math.floor(t/6e4),a=Math.floor(s/60),c=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(c,"d ago")}function u(e){let{orchestrators:r,projectId:t,projectName:n,error:u}=e,x=(0,c.useRouter)(),[m,h]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),f=(0,a.useRef)(!1),b=async()=>{if(!f.current){f.current=!0,h(!0),v(null);try{let e=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t})});if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to spawn orchestrator")}let r=await e.json();x.push((0,l.Nc)(t,r.orchestrator.id))}catch(e){v(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{h(!1),f.current=!1}}};return u?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-[var(--color-text-primary)]",children:"Error"}),(0,s.jsx)("p",{className:"mt-2 text-[var(--color-text-secondary)]",children:u}),(0,s.jsx)(o(),{href:"/",className:"orchestrator-btn mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium",children:"Go to Dashboard"})]})}):(0,s.jsxs)("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg-base)]",children:[(0,s.jsx)("header",{className:"nav-glass sticky top-0 z-10 border-b border-[var(--color-border-subtle)] px-6 py-4",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold text-[var(--color-text-primary)]",children:n}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Project orchestrator"})]}),(0,s.jsx)(o(),{href:(0,l.bn)(t),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",children:"Dashboard"})]})}),(0,s.jsx)("main",{className:"flex-1 px-6 py-8",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4",children:(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"AO keeps one main orchestrator per project. Opening or spawning here reuses that canonical session instead of creating another duplicate."})}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Main Session"}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,s.jsxs)(o(),{href:(0,l.Nc)(e.projectId,e.id),className:(0,i.cn)("flex items-center justify-between rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4","transition-all hover:border-[var(--color-border-default)] hover:shadow-sm"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:function(e){switch(e){case"working":return"var(--color-status-working)";case"spawning":return"var(--color-status-attention)";case"pr_open":case"review_pending":case"approved":case"mergeable":return"var(--color-status-ready)";case"ci_failed":case"changes_requested":return"var(--color-status-error)";case"merged":case"done":case"killed":case"terminated":return"var(--color-text-tertiary)";default:return"var(--color-text-secondary)"}}(e.status)}}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-[var(--color-text-primary)]",children:e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-secondary)]",children:[(0,s.jsx)("span",{className:"capitalize",children:e.status.replace(/_/g," ")}),e.activity&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,s.jsx)("span",{children:function(e){if(!e)return"";switch(e){case"active":return"Active";case"ready":return"Ready";case"idle":return"Idle";case"waiting_input":return"Waiting";case"blocked":return"Blocked";case"exited":return"Exited";default:return e}}(e.activity)})]})]})]})]}),(0,s.jsxs)("div",{className:"text-right text-xs text-[var(--color-text-tertiary)]",children:[(0,s.jsxs)("div",{children:["Created ",d(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",d(e.lastActivityAt)]})]})]},e.id))})]}),(0,s.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Open Orchestrator"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:m,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:m?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Opening orchestrator..."]}):"Open Orchestrator"}),p&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:p})]})]})})]})}}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=2900)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{1705:(e,r,t)=>{Promise.resolve().then(t.bind(t,9574))},4901:(e,r,t)=>{"use strict";function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}t.d(r,{cn:()=>s})},7594:(e,r,t)=>{"use strict";var s=t(9582);t.o(s,"useParams")&&t.d(r,{useParams:function(){return s.useParams}}),t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(r,{useSearchParams:function(){return s.useSearchParams}})},8450:(e,r,t)=>{"use strict";function s(e){return"/projects/".concat(encodeURIComponent(e))}function a(e,r){return"".concat(s(e),"/sessions/").concat(encodeURIComponent(r))}function c(e,r,t){return"".concat(a(e,r)).concat(t)}t.d(r,{$l:()=>c,Nc:()=>a,bn:()=>s})},9574:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>u});var s=t(3817),a=t(6749),c=t(7594),n=t(8713),o=t.n(n),i=t(4901),l=t(8450);function d(e){if(!e)return"Unknown";let r=new Date(e).getTime();if(!Number.isFinite(r))return"Unknown";let t=new Date().getTime()-r;if(t<0)return"Just now";let s=Math.floor(t/6e4),a=Math.floor(s/60),c=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(c,"d ago")}function u(e){let{orchestrators:r,projectId:t,projectName:n,error:u}=e,x=(0,c.useRouter)(),[m,h]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),f=(0,a.useRef)(!1),b=async()=>{if(!f.current){f.current=!0,h(!0),v(null);try{let e=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t})});if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to spawn orchestrator")}let r=await e.json();x.push((0,l.Nc)(t,r.orchestrator.id))}catch(e){v(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{h(!1),f.current=!1}}};return u?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-[var(--color-text-primary)]",children:"Error"}),(0,s.jsx)("p",{className:"mt-2 text-[var(--color-text-secondary)]",children:u}),(0,s.jsx)(o(),{href:"/",className:"orchestrator-btn mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium",children:"Go to Dashboard"})]})}):(0,s.jsxs)("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg-base)]",children:[(0,s.jsx)("header",{className:"nav-glass sticky top-0 z-10 border-b border-[var(--color-border-subtle)] px-6 py-4",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold text-[var(--color-text-primary)]",children:n}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Project orchestrator"})]}),(0,s.jsx)(o(),{href:(0,l.bn)(t),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",children:"Dashboard"})]})}),(0,s.jsx)("main",{className:"flex-1 px-6 py-8",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4",children:(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"AO keeps one main orchestrator per project. Opening or spawning here reuses that canonical session instead of creating another duplicate."})}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Main Session"}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,s.jsxs)(o(),{href:(0,l.Nc)(e.projectId,e.id),className:(0,i.cn)("flex items-center justify-between rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4","transition-all hover:border-[var(--color-border-default)] hover:shadow-sm"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:function(e){switch(e){case"working":return"var(--color-status-working)";case"spawning":return"var(--color-status-attention)";case"pr_open":case"review_pending":case"approved":case"mergeable":return"var(--color-status-ready)";case"ci_failed":case"changes_requested":return"var(--color-status-error)";case"merged":case"done":case"killed":case"terminated":return"var(--color-text-tertiary)";default:return"var(--color-text-secondary)"}}(e.status)}}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-[var(--color-text-primary)]",children:e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-secondary)]",children:[(0,s.jsx)("span",{className:"capitalize",children:e.status.replace(/_/g," ")}),e.activity&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,s.jsx)("span",{children:function(e){if(!e)return"";switch(e){case"active":return"Active";case"ready":return"Ready";case"idle":return"Idle";case"waiting_input":return"Waiting";case"blocked":return"Blocked";case"exited":return"Exited";default:return e}}(e.activity)})]})]})]})]}),(0,s.jsxs)("div",{className:"text-right text-xs text-[var(--color-text-tertiary)]",children:[(0,s.jsxs)("div",{children:["Created ",d(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",d(e.lastActivityAt)]})]})]},e.id))})]}),(0,s.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Open Orchestrator"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:m,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:m?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Opening orchestrator..."]}):"Open Orchestrator"}),p&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:p})]})]})})]})}}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=1705)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{7197:(e,s,_)=>{Promise.resolve().then(_.bind(_,4465))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=7197)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1332],{5275:(e,r,t)=>{"use strict";t.d(r,{RepairDegradedProjectButton:()=>l});var o=t(3817),n=t(6749),a=t(7594);function l(e){let{projectId:r}=e,t=(0,a.useRouter)(),[l,c]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),d=async()=>{c(!0),s(null);try{let o=await fetch("/api/projects/".concat(encodeURIComponent(r)),{method:"POST"}),n=await o.json().catch(()=>null);if(!o.ok){var e;s(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}t.refresh()}catch(e){s("Network error while repairing project config.")}finally{c(!1)}};return(0,o.jsxs)("div",{className:"mt-6",children:[(0,o.jsx)("button",{type:"button",onClick:()=>void d(),disabled:l,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:l?"Repairing...":"Repair config"}),i?(0,o.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:i}):null]})}},7242:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,4465)),Promise.resolve().then(t.bind(t,5275))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=7242)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1332],{5275:(e,r,t)=>{"use strict";t.d(r,{RepairDegradedProjectButton:()=>l});var o=t(3817),n=t(6749),a=t(7594);function l(e){let{projectId:r}=e,t=(0,a.useRouter)(),[l,c]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),d=async()=>{c(!0),s(null);try{let o=await fetch("/api/projects/".concat(encodeURIComponent(r)),{method:"POST"}),n=await o.json().catch(()=>null);if(!o.ok){var e;s(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}t.refresh()}catch(e){s("Network error while repairing project config.")}finally{c(!1)}};return(0,o.jsxs)("div",{className:"mt-6",children:[(0,o.jsx)("button",{type:"button",onClick:()=>void d(),disabled:l,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:l?"Repairing...":"Repair config"}),i?(0,o.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:i}):null]})}},6424:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,4465)),Promise.resolve().then(t.bind(t,5275))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=6424)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3610],{9368:(e,s,_)=>{Promise.resolve().then(_.bind(_,5795))}},e=>{e.O(0,[8713,3780,5795,131,1461,7358],()=>e(e.s=9368)),_N_E=e.O()}]);