@jingyi0605/codingns 1.0.0-beta.1 → 1.0.0-beta.3

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 (123) hide show
  1. package/dist/public/assets/AdaptiveButlerPage-CLHLiZSY.js +2 -0
  2. package/dist/public/assets/{App-CHsm-VrM.js → App-FYuZfAoO.js} +6 -6
  3. package/dist/public/assets/{BootstrapPage-Bp0KfySv.js → BootstrapPage-3xpnsG-A.js} +1 -1
  4. package/dist/public/assets/ConversationPage-C5_ZqhU3.js +9 -0
  5. package/dist/public/assets/{DesktopDetachPreviewPage-DlDSb_tf.js → DesktopDetachPreviewPage-B77MG82y.js} +1 -1
  6. package/dist/public/assets/{DesktopModal-Csj5AdAN.js → DesktopModal-K5bEcj38.js} +1 -1
  7. package/dist/public/assets/{DesktopWindowPage-CacXiWjV.js → DesktopWindowPage-DbG-RBAf.js} +1 -1
  8. package/dist/public/assets/{FileContextPanel-DzMUQvE5.js → FileContextPanel-C-1yOton.js} +1 -1
  9. package/dist/public/assets/{GitSidebar-C8IC18GH.js → GitSidebar-DFHAPT3S.js} +1 -1
  10. package/dist/public/assets/{MobileCreateSessionSheet-BtqR_hKc.js → MobileCreateSessionSheet-gOyAZ857.js} +1 -1
  11. package/dist/public/assets/{MobileSheet-Co-qPMBD.js → MobileSheet-D0MfNkTv.js} +1 -1
  12. package/dist/public/assets/{PluginAccessOverview-D-KXkcyj.js → PluginAccessOverview-IrYIPLg3.js} +1 -1
  13. package/dist/public/assets/{PluginContainerPage-BKwCIs4r.js → PluginContainerPage-b9LQVuqG.js} +1 -1
  14. package/dist/public/assets/{PluginDetailPage-Djv_swcO.js → PluginDetailPage-BX7gohai.js} +1 -1
  15. package/dist/public/assets/{PluginsListPage-DAECNoN6.js → PluginsListPage-R0SibHMi.js} +1 -1
  16. package/dist/public/assets/{PureConversationPage-DP1X7Hix.js → PureConversationPage-CcakFvo0.js} +1 -1
  17. package/dist/public/assets/{RelayConnectEntryPage-xL_IPH8a.js → RelayConnectEntryPage-cAVq_kNM.js} +1 -1
  18. package/dist/public/assets/{ServerSettingsModal-CyhMgk10.js → ServerSettingsModal-BJwYHdKD.js} +1 -1
  19. package/dist/public/assets/{SessionIndexPage-CVEz50tc.js → SessionIndexPage-CJKRHB_F.js} +1 -1
  20. package/dist/public/assets/SettingsPage-Csp7wEBC.js +2 -0
  21. package/dist/public/assets/{TerminalManagerPanel-wVnoRA8u.js → TerminalManagerPanel-2HG-NyfR.js} +1 -1
  22. package/dist/public/assets/{ToolFilesPage-BospXumK.js → ToolFilesPage-BAZdjNaF.js} +1 -1
  23. package/dist/public/assets/{ToolGitPage-B2zOeCAD.js → ToolGitPage-CGkPmgsz.js} +1 -1
  24. package/dist/public/assets/{ToolProcessesPage-BDShao4b.js → ToolProcessesPage-BHpS7-VH.js} +1 -1
  25. package/dist/public/assets/{ToolsHomePage-s4zH7D9M.js → ToolsHomePage-DDGqYwYU.js} +1 -1
  26. package/dist/public/assets/{WorkbenchLandingPage-D51QCU_u.js → WorkbenchLandingPage-B4aooEYJ.js} +1 -1
  27. package/dist/public/assets/WorkbenchLayout-DrAvGjGK.js +1083 -0
  28. package/dist/public/assets/{WorkbenchModal-YsyEdJ_m.js → WorkbenchModal-BK5ix8YI.js} +1 -1
  29. package/dist/public/assets/WorkbenchShellRoute-DpycFsbp.css +1 -0
  30. package/dist/public/assets/WorkbenchShellRoute-p1FvkoPN.js +1 -0
  31. package/dist/public/assets/{WorkspaceDebugDetailPage-CMjNLqFq.js → WorkspaceDebugDetailPage-CPgAe8dd.js} +1 -1
  32. package/dist/public/assets/{WorkspaceDetailPage-CKxTbPKh.js → WorkspaceDetailPage-YM85dTGg.js} +1 -1
  33. package/dist/public/assets/{WorkspaceHomePage-CEy4ShCu.js → WorkspaceHomePage-DPPvwM93.js} +1 -1
  34. package/dist/public/assets/{client-runtime-manager-BFXU9DmS.js → client-runtime-manager-Clq-8rWh.js} +1 -1
  35. package/dist/public/assets/{host-alias-Zb2xyVrf.js → host-alias-BxzpRYrt.js} +1 -1
  36. package/dist/public/assets/index-BArTKWXk.js +50 -0
  37. package/dist/public/assets/index-CqKepLbu.css +1 -0
  38. package/dist/public/assets/{login-direct-candidate-resolver-DL8DS-Si.js → login-direct-candidate-resolver-BiWwFKnk.js} +1 -1
  39. package/dist/public/assets/peer-host-config-sync-kTom1_pp.js +1 -0
  40. package/dist/public/assets/{plugin-permission-copy-DrLk22m5.js → plugin-permission-copy-1_1wViri.js} +1 -1
  41. package/dist/public/assets/{plugins-api-COF4oh24.js → plugins-api-C0JqR2-W.js} +1 -1
  42. package/dist/public/assets/{preferences-service-CEWNV1w9.js → preferences-service-DWeLWZST.js} +1 -1
  43. package/dist/public/assets/{relay-entry-Cmc8vTlE.js → relay-entry-ClEd3cjN.js} +1 -1
  44. package/dist/public/assets/{useRegisteredDebugTemplates-FdmHG2S4.js → useRegisteredDebugTemplates-wJGOYam9.js} +1 -1
  45. package/dist/public/assets/{workbench-navigation-ED0157V-.js → workbench-navigation-vIWt3Rv_.js} +1 -1
  46. package/dist/public/index.html +2 -2
  47. package/dist/server/modules/client/client-controller.d.ts +1 -0
  48. package/dist/server/modules/client/client-controller.js +4 -0
  49. package/dist/server/modules/client/client-controller.js.map +1 -1
  50. package/dist/server/modules/client/client-service.d.ts +3 -0
  51. package/dist/server/modules/client/client-service.js +3 -0
  52. package/dist/server/modules/client/client-service.js.map +1 -1
  53. package/dist/server/modules/client/npm-global-package-service.js +32 -7
  54. package/dist/server/modules/client/npm-global-package-service.js.map +1 -1
  55. package/dist/server/modules/peer-host/host-ws-proxy-service.js +73 -12
  56. package/dist/server/modules/peer-host/host-ws-proxy-service.js.map +1 -1
  57. package/dist/server/modules/provider/provider-discovery-helper-client.d.ts +2 -0
  58. package/dist/server/modules/provider/provider-discovery-helper-client.js.map +1 -1
  59. package/dist/server/modules/provider/provider-discovery-helper-process.js +6 -3
  60. package/dist/server/modules/provider/provider-discovery-helper-process.js.map +1 -1
  61. package/dist/server/modules/provider/provider-discovery-runtime.js +4 -1
  62. package/dist/server/modules/provider/provider-discovery-runtime.js.map +1 -1
  63. package/dist/server/modules/sessions/codex-app-server-helper-process.js +84 -20
  64. package/dist/server/modules/sessions/codex-app-server-helper-process.js.map +1 -1
  65. package/dist/server/modules/sessions/session-controller.js +2 -1
  66. package/dist/server/modules/sessions/session-controller.js.map +1 -1
  67. package/dist/server/modules/sessions/session-history-service.d.ts +8 -0
  68. package/dist/server/modules/sessions/session-history-service.js +123 -5
  69. package/dist/server/modules/sessions/session-history-service.js.map +1 -1
  70. package/dist/server/modules/sessions/session-live-runtime-service.d.ts +27 -0
  71. package/dist/server/modules/sessions/session-live-runtime-service.js +457 -9
  72. package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
  73. package/dist/server/modules/sessions/session-permission-request-service.d.ts +17 -1
  74. package/dist/server/modules/sessions/session-permission-request-service.js +397 -9
  75. package/dist/server/modules/sessions/session-permission-request-service.js.map +1 -1
  76. package/dist/server/modules/sessions/session-provider-config-service.js +1 -0
  77. package/dist/server/modules/sessions/session-provider-config-service.js.map +1 -1
  78. package/dist/server/modules/sessions/workspace-session-runtime-context-service.js +15 -1
  79. package/dist/server/modules/sessions/workspace-session-runtime-context-service.js.map +1 -1
  80. package/dist/server/modules/tasks/task-helper-process-handlers.d.ts +1 -0
  81. package/dist/server/modules/tasks/task-helper-process-handlers.js +4 -1
  82. package/dist/server/modules/tasks/task-helper-process-handlers.js.map +1 -1
  83. package/dist/server/modules/workbench/workbench-service.js +7 -4
  84. package/dist/server/modules/workbench/workbench-service.js.map +1 -1
  85. package/dist/server/routes/client.js +1 -0
  86. package/dist/server/routes/client.js.map +1 -1
  87. package/dist/server/shared/utils/peer-host-proxy-log.d.ts +3 -0
  88. package/dist/server/shared/utils/peer-host-proxy-log.js +48 -0
  89. package/dist/server/shared/utils/peer-host-proxy-log.js.map +1 -0
  90. package/dist/server/storage/repositories/session-send-queue-repository.d.ts +1 -0
  91. package/dist/server/storage/repositories/session-send-queue-repository.js +23 -0
  92. package/dist/server/storage/repositories/session-send-queue-repository.js.map +1 -1
  93. package/node_modules/@codingns/session-sync-core/dist/index.d.ts +1 -0
  94. package/node_modules/@codingns/session-sync-core/dist/index.js +1 -0
  95. package/node_modules/@codingns/session-sync-core/dist/index.js.map +1 -1
  96. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.d.ts +2 -0
  97. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js +93 -12
  98. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js.map +1 -1
  99. package/node_modules/@codingns/session-sync-core/dist/providers/codex.d.ts +3 -0
  100. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +116 -2
  101. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -1
  102. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.d.ts +1 -0
  103. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js +19 -8
  104. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js.map +1 -1
  105. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.d.ts +27 -1
  106. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js +48 -4
  107. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js.map +1 -1
  108. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +53 -15
  109. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -1
  110. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.d.ts +1 -0
  111. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js +30 -2
  112. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js.map +1 -1
  113. package/package.json +2 -1
  114. package/scripts/claude-hook-bridge.cjs +167 -0
  115. package/dist/public/assets/AdaptiveButlerPage-BYETYaIe.js +0 -2
  116. package/dist/public/assets/ConversationPage-BCrNml1k.js +0 -9
  117. package/dist/public/assets/SettingsPage-CQNCrgaj.js +0 -2
  118. package/dist/public/assets/WorkbenchLayout-Bo2BbMY6.js +0 -1081
  119. package/dist/public/assets/WorkbenchShellRoute-D3l4aWJS.js +0 -1
  120. package/dist/public/assets/WorkbenchShellRoute-D5fnyF8z.css +0 -1
  121. package/dist/public/assets/index-BilHJjYU.js +0 -50
  122. package/dist/public/assets/index-OR7OITpQ.css +0 -1
  123. package/dist/public/assets/peer-host-config-sync-d2ZcPC5P.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as t}from"./index-BArTKWXk.js";import{a as m}from"./WorkbenchLayout-DrAvGjGK.js";import{e,r as p}from"./App-FYuZfAoO.js";import"./workbench-navigation-vIWt3Rv_.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-BxzpRYrt.js";import"./DesktopModal-K5bEcj38.js";import"./relay-entry-ClEd3cjN.js";import"./WorkbenchModal-BK5ix8YI.js";import"./MobileSheet-D0MfNkTv.js";function j(){const o=e(),r=p(o);return t.jsx(m,{shellMode:r})}export{j as WorkbenchShellRoute};
@@ -1 +1 @@
1
- import{b as c,j as e,t as s}from"./index-BilHJjYU.js";import{j as G,u as $,b as R,f as z,k as H,r as _,a as L,D as J,h as T,d as y,e as A,l as K,m as Q,c as U,g as X,i as Y}from"./useRegisteredDebugTemplates-FdmHG2S4.js";import{b as Z,q as C,A as I,C as ee}from"./WorkbenchLayout-Bo2BbMY6.js";import{h as se,g as ae}from"./workbench-navigation-ED0157V-.js";import{c as le,u as te,f as ne}from"./App-CHsm-VrM.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-Zb2xyVrf.js";import"./DesktopModal-Csj5AdAN.js";import"./relay-entry-Cmc8vTlE.js";import"./WorkbenchModal-YsyEdJ_m.js";import"./MobileSheet-Co-qPMBD.js";function xe(){var S;const{workspaceId:u=""}=le(),j=te(),{showToast:d}=ne(),{navigationGroups:E,selectWorkspace:f}=Z(),r=((S=E.find(a=>a.workspace.id===u))==null?void 0:S.workspace)??null,[h,m]=c.useState(null),[N,o]=c.useState(null),[n,k]=c.useState(null),w=c.useRef(null);c.useEffect(()=>{u&&f(u)},[f,u]);const P=c.useMemo(()=>r?{id:r.id,path:r.path,name:r.name}:null,[r]),l=G(P),b=$(P),g=c.useMemo(()=>n??R(l.templates,l.runtimeStatuses),[n,l.runtimeStatuses,l.templates]),M=c.useMemo(()=>(n==null?void 0:n.items.some(a=>{var t;return(t=a.planItem)==null?void 0:t.missingRequirements.includes("service_discovery")}))??!1,[n]),O=c.useMemo(()=>new Map(l.runtimeStatuses.map(a=>[a.templateId,a])),[l.runtimeStatuses]);if(c.useEffect(()=>{!n||!w.current||typeof w.current.scrollIntoView=="function"&&w.current.scrollIntoView({behavior:"smooth",block:"start"})},[n]),!r)return e.jsx("main",{className:"workbench-page conversation-page-shell debug-readiness-page-shell",children:e.jsxs("div",{className:"workbench-empty-guide surface-card",children:[e.jsx("h1",{children:s("shell.workspaceDetailMissingTitle")}),e.jsx("p",{children:s("shell.workspaceDetailMissingBody")})]})});return e.jsx("main",{className:"workbench-page conversation-page-shell debug-readiness-page-shell",children:e.jsxs("div",{className:"debug-readiness-page",children:[e.jsxs("section",{className:"debug-readiness-hero surface-card",children:[e.jsx("div",{className:"debug-readiness-hero-header",children:e.jsxs("div",{className:"debug-readiness-hero-copy",children:[e.jsx("h2",{children:s("shell.workspaceDetailDebugPageTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugPageDescription")})]})}),e.jsxs("div",{className:"debug-readiness-hero-toolbar",children:[e.jsxs("div",{className:"workbench-modal-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>j(se(r.id)),children:s("shell.goBack")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{B()},children:h==="sync"?s("shell.workspaceDetailRegisteredDebugActionSyncingTemplates"):s("shell.workspaceDetailRegisteredDebugActionSyncTemplates")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{F()},children:h==="plan"?s("shell.workspaceDetailDebugActionPlanning"):s("shell.workspaceDetailDebugActionPlan")}),e.jsx("button",{type:"button",className:"primary-button",disabled:h!==null,onClick:()=>{W()},children:h==="run"?s("shell.workspaceDetailRegisteredDebugActionRunningRegistered"):s("shell.workspaceDetailRegisteredDebugActionRunRegistered")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{V()},children:h==="refresh"?s("shell.workspaceDetailDebugActionRefreshing"):s("shell.workspaceDetailDebugActionRefresh")})]}),N?e.jsx("p",{className:"workbench-manage-status status-text","data-tone":"error",children:N}):null]}),e.jsxs("div",{className:"debug-readiness-summary-grid debug-readiness-summary-grid-hero",children:[e.jsxs("article",{className:"debug-readiness-summary-card","data-tone":_(g,l.templates.length),children:[e.jsx("span",{children:s("shell.workspaceDetailDebugOverallStatusLabel")}),e.jsx("strong",{children:z(g,l.templates.length)}),e.jsx("small",{children:H(g,l.templates.length)})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRegisteredCountLabel")}),e.jsx("strong",{children:l.templates.length})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryConfiguredPortLabel")}),e.jsx("strong",{children:l.templates.filter(a=>a.port!==null).length}),e.jsx("small",{children:s("shell.workspaceDetailRegisteredDebugRuntimeScopeNote")})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRunnableCountLabel")}),e.jsx("strong",{children:g.runnableCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryOrchestratedCountLabel")}),e.jsx("strong",{children:g.orchestratedCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryBlockedCountLabel")}),e.jsx("strong",{children:g.blockedCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryLastRefreshLabel")}),e.jsx("strong",{children:L(l.lastRefreshedAt)}),e.jsx("small",{children:r.path})]})]})]}),e.jsx(J,{workspace:{id:r.id,path:r.path,name:r.name},state:b,variant:"page"}),n?e.jsxs("section",{ref:w,className:"debug-readiness-section surface-card",children:[e.jsxs("div",{className:"debug-readiness-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:s("shell.workspaceDetailDebugLaunchPlanTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanDescription")})]}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>k(null),children:s("shell.workspaceDetailDebugLaunchPlanDismissAction")})]}),e.jsxs("div",{className:"workbench-manage-kv-list",children:[e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanGeneratedAtLabel")}),e.jsx("span",{children:L(n.generatedAt)})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailDebugLaunchPlanAutoStartLabel")}),e.jsx("span",{children:n.autoStartAllowed?s("shell.workspaceDetailDebugLaunchPlanAutoStartAllowed"):s("shell.workspaceDetailDebugLaunchPlanAutoStartBlocked")})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanRunnableLabel")}),e.jsx("span",{children:n.runnableCount})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanOrchestratedLabel")}),e.jsx("span",{children:n.orchestratedCount})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanBlockedLabel")}),e.jsx("span",{children:n.blockedCount})]})]}),e.jsx("p",{className:"workbench-manage-hint",children:s("shell.workspaceDetailRegisteredDebugLaunchPlanNote")}),M?e.jsx("p",{className:"workbench-manage-hint",children:s("shell.workspaceDetailRegisteredDebugLaunchPlanServiceDiscoveryHelp")}):null,n.items.length>0?e.jsx("div",{className:"debug-readiness-runtime-list",children:n.items.map(a=>e.jsxs("article",{className:"debug-readiness-runtime-item",children:[e.jsxs("div",{className:"debug-readiness-runtime-item-header",children:[e.jsx("strong",{children:a.template.name}),e.jsx("span",{children:T(a.template)})]}),e.jsxs("div",{className:"debug-readiness-runtime-item-grid",children:[e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:a.template.cwd,children:y(a.template.cwd,r.path)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:A(a.assignedPort)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemRuntimeLabel")}),e.jsx("strong",{children:C(a.template.runtimeType)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemActionLabel")}),e.jsx("strong",{children:K(a.decision)})]})]}),e.jsxs("p",{className:"workbench-manage-hint",children:[s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel"),": ",a.reason]})]},a.template.id))}):e.jsx("p",{className:"workbench-section-empty",children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")})]}):null,e.jsxs("section",{className:"debug-readiness-section surface-card",children:[e.jsxs("div",{className:"debug-readiness-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:s("shell.workspaceDetailRegisteredDebugTemplatesTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugTemplatesDescription")})]}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>j(ae(r.id)),children:s("shell.workspaceDetailRegisteredDebugOpenProcessManagerAction")})]}),l.loading&&l.templates.length===0?e.jsx("p",{className:"workbench-section-empty",children:s("common.loading")}):null,l.error&&l.templates.length===0?e.jsx("p",{className:"workbench-manage-status status-text","data-tone":"error",children:l.error}):null,!l.loading&&l.templates.length===0?e.jsx("p",{className:"workbench-section-empty",children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")}):null,l.templates.length>0?e.jsx("div",{className:"debug-readiness-service-grid",children:l.templates.map(a=>{const t=O.get(a.id)??null,p=Q(a,t);return e.jsxs("article",{className:"debug-readiness-service-card",children:[e.jsxs("div",{className:"debug-readiness-service-card-header",children:[e.jsxs("div",{children:[e.jsx("strong",{children:a.name}),e.jsx("p",{title:a.cwd,children:y(a.cwd,r.path)})]}),e.jsx("span",{className:"debug-readiness-chip","data-tone":p,children:U(a,t)})]}),e.jsxs("div",{className:"debug-readiness-service-card-grid",children:[e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:a.cwd,children:y(a.cwd,r.path)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:A(a.port)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplateRuntimeTypeLabel")}),e.jsx("strong",{children:C(a.runtimeType)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugRuntimeProcessLabel")}),e.jsx("strong",{children:X(t)})]})]}),e.jsxs("div",{className:"debug-readiness-service-card-list",children:[e.jsxs("p",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemCommandLabel")}),e.jsx("strong",{children:T(a)})]}),e.jsxs("p",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel")}),e.jsx("strong",{children:Y(a,t)})]})]})]},a.id)})}):null]})]})});async function B(){m("sync"),o(null);try{await l.refreshAll(),k(null),d({title:s("shell.workspaceDetailRegisteredDebugActionSyncTemplatesSuccess"),tone:"success"})}catch(a){const t=x(a,s("shell.workspaceDetailRegisteredDebugActionSyncTemplatesFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}async function F(){m("plan"),o(null);try{if(!b.targetId)throw new Error(s("shell.workspaceDetailDebugActionTargetMissing"));const a=await I(b.targetId),t=R(l.templates,l.runtimeStatuses,a);k(t),d({title:s("shell.workspaceDetailDebugActionPlanSuccess"),tone:"info"})}catch(a){const t=x(a,s("shell.workspaceDetailDebugActionPlanFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}async function W(){var a,t;m("run"),o(null);try{const p=n??(b.targetId?R(l.templates,l.runtimeStatuses,await I(b.targetId)):R(l.templates,l.runtimeStatuses));k(p);const D=p.items.filter(i=>i.decision!=="blocked");if(D.length===0){const i=s("shell.workspaceDetailRegisteredDebugActionRunRegisteredSkipped");o(i),d({title:i,tone:"info"});return}const v=[];for(const i of D)try{await ee(i.template.id,{runtimeType:i.template.runtimeType??void 0,argsOverride:(a=i.planItem)==null?void 0:a.args,envPatch:(t=i.planItem)==null?void 0:t.envPatch,portOverride:i.assignedPort})}catch(q){v.push(`${i.template.name}: ${x(q,s("shell.workspaceDetailRegisteredDebugActionRunRegisteredFailed"))}`)}if(await l.refreshRuntime(),v.length>0)throw new Error(v.join(";"));d({title:s("shell.workspaceDetailRegisteredDebugActionRunRegisteredSuccess"),tone:"success"})}catch(p){const D=x(p,s("shell.workspaceDetailRegisteredDebugActionRunRegisteredFailed"));o(D),d({title:D,tone:"error"})}finally{m(null)}}async function V(){m("refresh"),o(null);try{await l.refreshRuntime(),d({title:s("shell.workspaceDetailDebugActionRefreshSuccess"),tone:"success"})}catch(a){const t=x(a,s("shell.workspaceDetailRegisteredDebugActionRefreshFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}}function x(u,j){return u instanceof Error&&u.message.trim()?u.message:j}export{xe as WorkspaceDebugDetailPage};
1
+ import{b as c,j as e,t as s}from"./index-BArTKWXk.js";import{j as G,u as $,b as R,f as z,k as H,r as _,a as L,D as J,h as T,d as y,e as A,l as K,m as Q,c as U,g as X,i as Y}from"./useRegisteredDebugTemplates-wJGOYam9.js";import{b as Z,q as C,A as I,C as ee}from"./WorkbenchLayout-DrAvGjGK.js";import{h as se,g as ae}from"./workbench-navigation-vIWt3Rv_.js";import{c as le,u as te,f as ne}from"./App-FYuZfAoO.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-BxzpRYrt.js";import"./DesktopModal-K5bEcj38.js";import"./relay-entry-ClEd3cjN.js";import"./WorkbenchModal-BK5ix8YI.js";import"./MobileSheet-D0MfNkTv.js";function xe(){var S;const{workspaceId:u=""}=le(),j=te(),{showToast:d}=ne(),{navigationGroups:E,selectWorkspace:f}=Z(),r=((S=E.find(a=>a.workspace.id===u))==null?void 0:S.workspace)??null,[h,m]=c.useState(null),[N,o]=c.useState(null),[n,k]=c.useState(null),w=c.useRef(null);c.useEffect(()=>{u&&f(u)},[f,u]);const P=c.useMemo(()=>r?{id:r.id,path:r.path,name:r.name}:null,[r]),l=G(P),b=$(P),g=c.useMemo(()=>n??R(l.templates,l.runtimeStatuses),[n,l.runtimeStatuses,l.templates]),M=c.useMemo(()=>(n==null?void 0:n.items.some(a=>{var t;return(t=a.planItem)==null?void 0:t.missingRequirements.includes("service_discovery")}))??!1,[n]),O=c.useMemo(()=>new Map(l.runtimeStatuses.map(a=>[a.templateId,a])),[l.runtimeStatuses]);if(c.useEffect(()=>{!n||!w.current||typeof w.current.scrollIntoView=="function"&&w.current.scrollIntoView({behavior:"smooth",block:"start"})},[n]),!r)return e.jsx("main",{className:"workbench-page conversation-page-shell debug-readiness-page-shell",children:e.jsxs("div",{className:"workbench-empty-guide surface-card",children:[e.jsx("h1",{children:s("shell.workspaceDetailMissingTitle")}),e.jsx("p",{children:s("shell.workspaceDetailMissingBody")})]})});return e.jsx("main",{className:"workbench-page conversation-page-shell debug-readiness-page-shell",children:e.jsxs("div",{className:"debug-readiness-page",children:[e.jsxs("section",{className:"debug-readiness-hero surface-card",children:[e.jsx("div",{className:"debug-readiness-hero-header",children:e.jsxs("div",{className:"debug-readiness-hero-copy",children:[e.jsx("h2",{children:s("shell.workspaceDetailDebugPageTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugPageDescription")})]})}),e.jsxs("div",{className:"debug-readiness-hero-toolbar",children:[e.jsxs("div",{className:"workbench-modal-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>j(se(r.id)),children:s("shell.goBack")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{B()},children:h==="sync"?s("shell.workspaceDetailRegisteredDebugActionSyncingTemplates"):s("shell.workspaceDetailRegisteredDebugActionSyncTemplates")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{F()},children:h==="plan"?s("shell.workspaceDetailDebugActionPlanning"):s("shell.workspaceDetailDebugActionPlan")}),e.jsx("button",{type:"button",className:"primary-button",disabled:h!==null,onClick:()=>{W()},children:h==="run"?s("shell.workspaceDetailRegisteredDebugActionRunningRegistered"):s("shell.workspaceDetailRegisteredDebugActionRunRegistered")}),e.jsx("button",{type:"button",className:"secondary-button",disabled:h!==null,onClick:()=>{V()},children:h==="refresh"?s("shell.workspaceDetailDebugActionRefreshing"):s("shell.workspaceDetailDebugActionRefresh")})]}),N?e.jsx("p",{className:"workbench-manage-status status-text","data-tone":"error",children:N}):null]}),e.jsxs("div",{className:"debug-readiness-summary-grid debug-readiness-summary-grid-hero",children:[e.jsxs("article",{className:"debug-readiness-summary-card","data-tone":_(g,l.templates.length),children:[e.jsx("span",{children:s("shell.workspaceDetailDebugOverallStatusLabel")}),e.jsx("strong",{children:z(g,l.templates.length)}),e.jsx("small",{children:H(g,l.templates.length)})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRegisteredCountLabel")}),e.jsx("strong",{children:l.templates.length})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryConfiguredPortLabel")}),e.jsx("strong",{children:l.templates.filter(a=>a.port!==null).length}),e.jsx("small",{children:s("shell.workspaceDetailRegisteredDebugRuntimeScopeNote")})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRunnableCountLabel")}),e.jsx("strong",{children:g.runnableCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryOrchestratedCountLabel")}),e.jsx("strong",{children:g.orchestratedCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryBlockedCountLabel")}),e.jsx("strong",{children:g.blockedCount})]}),e.jsxs("article",{className:"debug-readiness-summary-card",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryLastRefreshLabel")}),e.jsx("strong",{children:L(l.lastRefreshedAt)}),e.jsx("small",{children:r.path})]})]})]}),e.jsx(J,{workspace:{id:r.id,path:r.path,name:r.name},state:b,variant:"page"}),n?e.jsxs("section",{ref:w,className:"debug-readiness-section surface-card",children:[e.jsxs("div",{className:"debug-readiness-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:s("shell.workspaceDetailDebugLaunchPlanTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanDescription")})]}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>k(null),children:s("shell.workspaceDetailDebugLaunchPlanDismissAction")})]}),e.jsxs("div",{className:"workbench-manage-kv-list",children:[e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanGeneratedAtLabel")}),e.jsx("span",{children:L(n.generatedAt)})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailDebugLaunchPlanAutoStartLabel")}),e.jsx("span",{children:n.autoStartAllowed?s("shell.workspaceDetailDebugLaunchPlanAutoStartAllowed"):s("shell.workspaceDetailDebugLaunchPlanAutoStartBlocked")})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanRunnableLabel")}),e.jsx("span",{children:n.runnableCount})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanOrchestratedLabel")}),e.jsx("span",{children:n.orchestratedCount})]}),e.jsxs("div",{className:"workbench-manage-kv-item",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugLaunchPlanBlockedLabel")}),e.jsx("span",{children:n.blockedCount})]})]}),e.jsx("p",{className:"workbench-manage-hint",children:s("shell.workspaceDetailRegisteredDebugLaunchPlanNote")}),M?e.jsx("p",{className:"workbench-manage-hint",children:s("shell.workspaceDetailRegisteredDebugLaunchPlanServiceDiscoveryHelp")}):null,n.items.length>0?e.jsx("div",{className:"debug-readiness-runtime-list",children:n.items.map(a=>e.jsxs("article",{className:"debug-readiness-runtime-item",children:[e.jsxs("div",{className:"debug-readiness-runtime-item-header",children:[e.jsx("strong",{children:a.template.name}),e.jsx("span",{children:T(a.template)})]}),e.jsxs("div",{className:"debug-readiness-runtime-item-grid",children:[e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:a.template.cwd,children:y(a.template.cwd,r.path)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:A(a.assignedPort)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemRuntimeLabel")}),e.jsx("strong",{children:C(a.template.runtimeType)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemActionLabel")}),e.jsx("strong",{children:K(a.decision)})]})]}),e.jsxs("p",{className:"workbench-manage-hint",children:[s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel"),": ",a.reason]})]},a.template.id))}):e.jsx("p",{className:"workbench-section-empty",children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")})]}):null,e.jsxs("section",{className:"debug-readiness-section surface-card",children:[e.jsxs("div",{className:"debug-readiness-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:s("shell.workspaceDetailRegisteredDebugTemplatesTitle")}),e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugTemplatesDescription")})]}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>j(ae(r.id)),children:s("shell.workspaceDetailRegisteredDebugOpenProcessManagerAction")})]}),l.loading&&l.templates.length===0?e.jsx("p",{className:"workbench-section-empty",children:s("common.loading")}):null,l.error&&l.templates.length===0?e.jsx("p",{className:"workbench-manage-status status-text","data-tone":"error",children:l.error}):null,!l.loading&&l.templates.length===0?e.jsx("p",{className:"workbench-section-empty",children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")}):null,l.templates.length>0?e.jsx("div",{className:"debug-readiness-service-grid",children:l.templates.map(a=>{const t=O.get(a.id)??null,p=Q(a,t);return e.jsxs("article",{className:"debug-readiness-service-card",children:[e.jsxs("div",{className:"debug-readiness-service-card-header",children:[e.jsxs("div",{children:[e.jsx("strong",{children:a.name}),e.jsx("p",{title:a.cwd,children:y(a.cwd,r.path)})]}),e.jsx("span",{className:"debug-readiness-chip","data-tone":p,children:U(a,t)})]}),e.jsxs("div",{className:"debug-readiness-service-card-grid",children:[e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:a.cwd,children:y(a.cwd,r.path)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:A(a.port)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplateRuntimeTypeLabel")}),e.jsx("strong",{children:C(a.runtimeType)})]}),e.jsxs("div",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugRuntimeProcessLabel")}),e.jsx("strong",{children:X(t)})]})]}),e.jsxs("div",{className:"debug-readiness-service-card-list",children:[e.jsxs("p",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemCommandLabel")}),e.jsx("strong",{children:T(a)})]}),e.jsxs("p",{children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel")}),e.jsx("strong",{children:Y(a,t)})]})]})]},a.id)})}):null]})]})});async function B(){m("sync"),o(null);try{await l.refreshAll(),k(null),d({title:s("shell.workspaceDetailRegisteredDebugActionSyncTemplatesSuccess"),tone:"success"})}catch(a){const t=x(a,s("shell.workspaceDetailRegisteredDebugActionSyncTemplatesFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}async function F(){m("plan"),o(null);try{if(!b.targetId)throw new Error(s("shell.workspaceDetailDebugActionTargetMissing"));const a=await I(b.targetId),t=R(l.templates,l.runtimeStatuses,a);k(t),d({title:s("shell.workspaceDetailDebugActionPlanSuccess"),tone:"info"})}catch(a){const t=x(a,s("shell.workspaceDetailDebugActionPlanFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}async function W(){var a,t;m("run"),o(null);try{const p=n??(b.targetId?R(l.templates,l.runtimeStatuses,await I(b.targetId)):R(l.templates,l.runtimeStatuses));k(p);const D=p.items.filter(i=>i.decision!=="blocked");if(D.length===0){const i=s("shell.workspaceDetailRegisteredDebugActionRunRegisteredSkipped");o(i),d({title:i,tone:"info"});return}const v=[];for(const i of D)try{await ee(i.template.id,{runtimeType:i.template.runtimeType??void 0,argsOverride:(a=i.planItem)==null?void 0:a.args,envPatch:(t=i.planItem)==null?void 0:t.envPatch,portOverride:i.assignedPort})}catch(q){v.push(`${i.template.name}: ${x(q,s("shell.workspaceDetailRegisteredDebugActionRunRegisteredFailed"))}`)}if(await l.refreshRuntime(),v.length>0)throw new Error(v.join(";"));d({title:s("shell.workspaceDetailRegisteredDebugActionRunRegisteredSuccess"),tone:"success"})}catch(p){const D=x(p,s("shell.workspaceDetailRegisteredDebugActionRunRegisteredFailed"));o(D),d({title:D,tone:"error"})}finally{m(null)}}async function V(){m("refresh"),o(null);try{await l.refreshRuntime(),d({title:s("shell.workspaceDetailDebugActionRefreshSuccess"),tone:"success"})}catch(a){const t=x(a,s("shell.workspaceDetailRegisteredDebugActionRefreshFailed"));o(t),d({title:t,tone:"error"})}finally{m(null)}}}function x(u,j){return u instanceof Error&&u.message.trim()?u.message:j}export{xe as WorkspaceDebugDetailPage};
@@ -1 +1 @@
1
- import{b as d,j as e,t as s,E as N}from"./index-BilHJjYU.js";import{q as X,b as J,f as Q,c as U,s as Y,t as ee,M as se,v as ae,w as le,d as L,x as ie,k as oe,y as ne,z as te}from"./WorkbenchLayout-Bo2BbMY6.js";import{b as re,f as ce,a as de,c as me,d as he,e as ue,g as pe,h as be,i as je,u as ge,j as ke,D as xe}from"./useRegisteredDebugTemplates-FdmHG2S4.js";import{M as fe}from"./MobileCreateSessionSheet-BtqR_hKc.js";import{i as ve,d as we,h as Ne,j as Ce,g as B,c as ye}from"./workbench-navigation-ED0157V-.js";import{c as Re,u as De,f as We}from"./App-CHsm-VrM.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-Zb2xyVrf.js";import"./DesktopModal-Csj5AdAN.js";import"./relay-entry-Cmc8vTlE.js";import"./WorkbenchModal-YsyEdJ_m.js";import"./MobileSheet-Co-qPMBD.js";function Me({workspaceId:l,workspacePath:o,state:r,onOpenProcessManager:b}){const u=d.useMemo(()=>re(r.templates,r.runtimeStatuses),[r.runtimeStatuses,r.templates]),x=d.useMemo(()=>new Map(r.runtimeStatuses.map(c=>[c.templateId,c])),[r.runtimeStatuses]);return e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-composition-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.workspaceDetailRegisteredDebugTemplatesTitle")})}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>b(l),children:s("shell.workspaceDetailRegisteredDebugOpenProcessManagerAction")})]}),e.jsx("p",{className:"mobile-workspace-composition-note",children:s("shell.workspaceDetailRegisteredDebugTemplatesDescription")}),e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailDebugOverallStatusLabel")}),e.jsx("strong",{children:ce(u,r.templates.length)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRegisteredCountLabel")}),e.jsx("strong",{children:r.templates.length})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRunnableCountLabel")}),e.jsx("strong",{children:u.runnableCount})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryOrchestratedCountLabel")}),e.jsx("strong",{children:u.orchestratedCount})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryBlockedCountLabel")}),e.jsx("strong",{children:u.blockedCount})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryLastRefreshLabel")}),e.jsx("strong",{children:de(r.lastRefreshedAt)})]})]}),r.loading&&r.templates.length===0?e.jsx("p",{children:s("common.loading")}):null,r.error&&r.templates.length===0?e.jsx("p",{className:"status-text","data-tone":"error",children:r.error}):null,!r.loading&&r.templates.length===0?e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")}):null,r.templates.length>0?e.jsx("div",{className:"mobile-feature-stack",children:r.templates.map(c=>{const m=x.get(c.id)??null;return e.jsxs("article",{className:"surface-card mobile-session-row",children:[e.jsxs("div",{className:"mobile-session-row-primary mobile-session-row-primary-static",children:[e.jsx("span",{className:"mobile-session-row-title",children:c.name}),e.jsx("span",{className:"mobile-session-row-provider",children:me(c,m)})]}),e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:c.cwd,children:he(c.cwd,o)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:ue(c.port)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplateRuntimeTypeLabel")}),e.jsx("strong",{children:X(c.runtimeType)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugRuntimeProcessLabel")}),e.jsx("strong",{children:pe(m)})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemCommandLabel")}),e.jsx("strong",{children:be(c)})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel")}),e.jsx("strong",{children:je(c,m)})]})]})]},c.id)})}):null]})}function Se(l){return l.isArchived!==!0&&!oe(l)}function Ae(l){return ne(l)}const C=60*1e3,y=10;function Je(){var E;const{workspaceId:l=""}=Re(),o=De(),{showToast:r}=We(),{navigationGroups:b,currentWorkspaceId:u,favoriteSessionIds:x,workspaceManagementStateById:c,selectWorkspace:m,subscribeGitSnapshot:R,requestGitRefresh:D,subscribeWorkspaceManagementSnapshot:W,requestWorkspaceManagementRefresh:M,toggleFavoriteSession:O,archiveSession:_,unarchiveSession:G,startDraftSession:V}=J(),[S,A]=d.useState(!1),[H,f]=d.useState(!1),[T,P]=d.useState(y),v=Q(b),h=U(b,l),i=(h==null?void 0:h.workspace)??null,p=v.find(a=>a.workspace.id===(i==null?void 0:i.id))??(i?{workspace:i,label:i.name,subtitle:i.path}:null),w=d.useMemo(()=>[...(h==null?void 0:h.sessions)??[]].filter(Se),[h]),g=d.useMemo(()=>[...(h==null?void 0:h.sessions)??[]].filter(Ae),[h]);d.useEffect(()=>{l&&m(l)},[m,l]),d.useEffect(()=>{if(!l)return;const a=N(Ie(l),C),t=N(F(l),C);R(l,{knownRevision:(a==null?void 0:a.revision)??null}),W(l,{knownRevision:(t==null?void 0:t.revision)??null}),a||D(l),t||M(l)},[D,M,R,W,l]),d.useEffect(()=>{P(y)},[l]);const n=d.useMemo(()=>{if(!l)return{loading:!1,error:null,hasMeaningfulSummary:!1,summary:null};const a=N(F(l),C),t=c[l]??null,j=(t==null?void 0:t.detail)??(i?Ee(i,a):a??null);return{loading:(t==null?void 0:t.loading)??!1,error:(t==null?void 0:t.error)??null,hasMeaningfulSummary:Le(j),summary:j}},[i,l,c]),k=d.useMemo(()=>n.summary?Y(n.summary.codeComposition.items,s("shell.manageWorkspaceCodeCompositionOther")):[],[n.summary]),Z=d.useMemo(()=>k.length>0?ee(k):void 0,[k]),I=d.useMemo(()=>g.slice(0,T),[g,T]),q=ge(i?{id:i.id,path:i.path,name:i.name}:null),K=ke(i?{id:i.id,path:i.path,name:i.name}:null);async function $(){if(!(!i||!(typeof window>"u"||window.confirm(s("shell.manageWorkspaceRemoveConfirmTarget",{name:i.name}))))){A(!0);try{await te(i.id),r({title:s("shell.manageWorkspaceRemoveSuccess"),tone:"success"}),o("/workspaces",{replace:!0})}catch(t){r({title:t instanceof Error?t.message:s("shell.manageWorkspaceRemoveFailed"),tone:"error"})}finally{A(!1)}}}function z(a,t){f(!1),V(a,t)}return i?e.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-detail-page",children:[e.jsx(se,{currentWorkspace:p?{id:p.workspace.id,name:p.label,path:p.subtitle}:null,workspaces:b.map(a=>a.workspace),workspaceOptions:v,heading:s("shell.workspaceDetailTitle"),triggerLabel:(p==null?void 0:p.label)??i.name,onSelectWorkspace:a=>{m(a),o(Ne(a))},content:e.jsxs("div",{className:"mobile-workspace-detail-header-actions",children:[e.jsx("button",{type:"button",className:"primary-button",onClick:()=>f(!0),children:s("shell.createSession")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(ve(i.id))},children:s("shell.filesEntry")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(we(i.id))},children:s("shell.terminalsEntry")})]})}),e.jsxs("div",{className:"mobile-page-top-body mobile-workspace-detail-body",children:[e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-detail-summary-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.workspaceDetailSummaryTitle")})}),u!==i.id?e.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-switch-button",onClick:()=>m(i.id),children:s("shell.switchWorkspace")}):null]}),n.loading&&n.summary===null?e.jsx("p",{children:s("common.loading")}):null,n.error?e.jsx("p",{className:"status-text","data-tone":"error",children:n.error}):null,n.summary?e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.manageWorkspacePathLabel")}),e.jsx("strong",{title:n.summary.path,children:n.summary.path})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceCurrentBranch")}),e.jsx("strong",{title:n.summary.git.currentBranch??s("common.unknown"),children:n.summary.git.currentBranch??s("common.unknown")})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceGitCommitCount")}),e.jsx("strong",{children:n.hasMeaningfulSummary?n.summary.git.commitCount??0:"—"})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceCodeCompositionFiles")}),e.jsx("strong",{children:n.hasMeaningfulSummary?n.summary.codeComposition.scannedFileCount:"—"})]})]}):null,e.jsxs("div",{className:"mobile-feature-inline-actions mobile-workspace-detail-summary-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(Ce(i.id))},children:s("shell.gitEntry")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(B(i.id))},children:s("shell.terminalManagerEntry")}),e.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:S,onClick:()=>{$()},children:S?s("shell.manageWorkspaceRemoving"):s("shell.manageWorkspaceRemoveAction")})]})]}),e.jsx(xe,{workspace:i?{id:i.id,path:i.path,name:i.name}:null,state:q,variant:"mobile"}),i?e.jsx(Me,{workspaceId:i.id,workspacePath:i.path,state:K,onOpenProcessManager:a=>{m(a),o(B(a))}}):null,e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-composition-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.manageWorkspaceCodeCompositionLabel")})}),n.summary?e.jsx("span",{className:"mobile-feature-counter",children:n.summary.codeComposition.scannedFileCount}):null]}),n.loading&&n.summary===null?e.jsx("p",{children:s("common.loading")}):null,n.summary?k.length>0?e.jsxs("div",{className:"workbench-manage-type-chart",children:[e.jsxs("div",{className:"workbench-manage-type-chart-ring",style:Z,"aria-hidden":"true",children:[e.jsx("strong",{className:"workbench-manage-type-chart-total",children:n.summary.codeComposition.scannedFileCount}),e.jsx("span",{className:"workbench-manage-type-chart-caption",children:s("shell.manageWorkspaceCodeCompositionFiles")})]}),e.jsx("div",{className:"workbench-manage-type-list",children:k.map(a=>e.jsxs("div",{className:"workbench-manage-type-item",children:[e.jsxs("span",{className:"workbench-manage-type-meta",children:[e.jsx("span",{className:"workbench-manage-type-swatch",style:{backgroundColor:a.color},"aria-hidden":"true"}),e.jsx("span",{className:"workbench-manage-type-name",children:a.type})]}),e.jsxs("span",{children:[a.count," · ",ae(a)]})]},a.key))})]}):e.jsx("p",{children:n.summary.codeComposition.error??s("shell.manageWorkspaceNoCodeComposition")}):null,(E=n.summary)!=null&&E.codeComposition.truncated?e.jsx("p",{className:"mobile-workspace-composition-note",children:s("shell.manageWorkspaceCodeTruncated",{count:n.summary.codeComposition.scannedFileCount})}):null]}),e.jsxs("section",{className:"mobile-feature-section",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.recentSessionsSectionTitle")})}),e.jsx("span",{className:"mobile-feature-counter",children:w.length})]}),e.jsx("div",{className:"mobile-feature-stack",children:w.length===0?e.jsx("article",{className:"mobile-feature-empty surface-card",children:e.jsx("p",{children:s("shell.emptyWorkspaceSessions")})}):w.map(a=>{const t=le(a.title,s("common.unknown")),j=x.includes(a.sessionId);return e.jsxs("article",{className:"mobile-session-row surface-card",children:[e.jsxs("button",{type:"button",className:"mobile-session-row-primary",onClick:()=>o(ye(i.id,a.sessionId)),children:[e.jsx("span",{className:"mobile-session-row-title",title:t.fullTitle,children:t.displayTitle}),e.jsx("span",{className:"mobile-session-row-provider",children:L(a.provider)})]}),e.jsxs("div",{className:"mobile-session-row-actions",children:[e.jsx("span",{className:"mobile-feature-badge mobile-session-row-count",children:a.messageCount}),e.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":j?s("shell.unfavoriteAction"):s("shell.favoriteAction"),title:j?s("shell.unfavoriteAction"):s("shell.favoriteAction"),onClick:()=>{O(a.sessionId)},children:e.jsx(Te,{active:j})}),e.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":s("shell.archiveAction"),title:s("shell.archiveAction"),onClick:()=>{_(a.sessionId)},children:e.jsx(Pe,{})})]})]},a.sessionId)})})]}),g.length>0?e.jsxs("section",{className:"mobile-feature-section",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.archiveModalTitle")})}),e.jsx("span",{className:"mobile-feature-counter",children:g.length})]}),e.jsx("div",{className:"mobile-feature-stack",children:I.map(a=>{const t=ie(a);return e.jsxs("article",{className:"mobile-session-row surface-card",children:[e.jsxs("div",{className:"mobile-session-row-primary mobile-session-row-primary-static",children:[e.jsxs("span",{className:"mobile-session-row-title",title:a.title,children:[a.title,t?e.jsx("span",{className:"session-fork-badge archive-child",children:t}):null]}),e.jsx("span",{className:"mobile-session-row-provider",children:L(a.provider)})]}),e.jsx("div",{className:"mobile-session-row-actions",children:e.jsx("button",{type:"button",className:"secondary-button mobile-session-row-restore",onClick:()=>{G(a.sessionId)},children:s("shell.unarchiveAction")})})]},a.sessionId)})}),I.length<g.length?e.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-expand-button",onClick:()=>{P(a=>a+y)},children:s("shell.archiveExpandMore")}):null]}):null]}),e.jsx(fe,{open:H,workspaces:b.map(a=>a.workspace),workspaceOptions:v,initialWorkspaceId:u??i.id,onClose:()=>f(!1),onSelect:z})]}):e.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:e.jsxs("article",{className:"mobile-feature-empty surface-card",children:[e.jsx("h1",{children:s("shell.workspaceDetailMissingTitle")}),e.jsx("p",{children:s("shell.workspaceDetailMissingBody")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>o("/workspaces"),children:s("shell.mobileWorkspacesEntry")})]})})}function Te({active:l}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.8",children:e.jsx("path",{d:"m12 3.6 2.6 5.2 5.7.8-4.1 4 1 5.7L12 16.5 6.8 19.3l1-5.7-4.1-4 5.7-.8Z"})})}function Pe(){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("path",{d:"M4 7.5h16"}),e.jsx("path",{d:"M6.4 7.5h11.2l-.9 10.2a2 2 0 0 1-2 1.8H9.3a2 2 0 0 1-2-1.8Z"}),e.jsx("path",{d:"M8 4.5h8a1.5 1.5 0 0 1 1.5 1.5v1.5h-11V6A1.5 1.5 0 0 1 8 4.5Z"}),e.jsx("path",{d:"M10 11.5h4"})]})}function F(l){return`workspace-management.summary.${l}`}function Ie(l){return`git-sidebar.snapshot.${l}`}function Ee(l,o){const r=(o==null?void 0:o.git.repoRoot)??l.repoRoot??null;return{workspaceId:l.id,name:l.name,path:l.path,git:{isRepository:(o==null?void 0:o.git.isRepository)??!!r,repoRoot:r,currentBranch:(o==null?void 0:o.git.currentBranch)??null,commitCount:(o==null?void 0:o.git.commitCount)??null,remotes:(o==null?void 0:o.git.remotes)??[],error:(o==null?void 0:o.git.error)??null},codeComposition:(o==null?void 0:o.codeComposition)??{scannedFileCount:0,truncated:!1,items:[],error:null}}}function Le(l){return l?l.git.isRepository||l.git.repoRoot!==null||l.git.currentBranch!==null||l.git.commitCount!==null||l.git.remotes.length>0||l.codeComposition.scannedFileCount>0||l.codeComposition.items.length>0||l.codeComposition.error!==null:!1}export{Je as WorkspaceDetailPage};
1
+ import{b as d,j as e,t as s,E as N}from"./index-BArTKWXk.js";import{q as X,b as J,f as Q,c as U,s as Y,t as ee,M as se,v as ae,w as le,d as L,x as ie,k as oe,y as ne,z as te}from"./WorkbenchLayout-DrAvGjGK.js";import{b as re,f as ce,a as de,c as me,d as he,e as ue,g as pe,h as be,i as je,u as ge,j as ke,D as xe}from"./useRegisteredDebugTemplates-wJGOYam9.js";import{M as fe}from"./MobileCreateSessionSheet-gOyAZ857.js";import{i as ve,d as we,h as Ne,j as Ce,g as B,c as ye}from"./workbench-navigation-vIWt3Rv_.js";import{c as Re,u as De,f as We}from"./App-FYuZfAoO.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-BxzpRYrt.js";import"./DesktopModal-K5bEcj38.js";import"./relay-entry-ClEd3cjN.js";import"./WorkbenchModal-BK5ix8YI.js";import"./MobileSheet-D0MfNkTv.js";function Me({workspaceId:l,workspacePath:o,state:r,onOpenProcessManager:b}){const u=d.useMemo(()=>re(r.templates,r.runtimeStatuses),[r.runtimeStatuses,r.templates]),x=d.useMemo(()=>new Map(r.runtimeStatuses.map(c=>[c.templateId,c])),[r.runtimeStatuses]);return e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-composition-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.workspaceDetailRegisteredDebugTemplatesTitle")})}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>b(l),children:s("shell.workspaceDetailRegisteredDebugOpenProcessManagerAction")})]}),e.jsx("p",{className:"mobile-workspace-composition-note",children:s("shell.workspaceDetailRegisteredDebugTemplatesDescription")}),e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailDebugOverallStatusLabel")}),e.jsx("strong",{children:ce(u,r.templates.length)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRegisteredCountLabel")}),e.jsx("strong",{children:r.templates.length})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryRunnableCountLabel")}),e.jsx("strong",{children:u.runnableCount})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryOrchestratedCountLabel")}),e.jsx("strong",{children:u.orchestratedCount})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryBlockedCountLabel")}),e.jsx("strong",{children:u.blockedCount})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugSummaryLastRefreshLabel")}),e.jsx("strong",{children:de(r.lastRefreshedAt)})]})]}),r.loading&&r.templates.length===0?e.jsx("p",{children:s("common.loading")}):null,r.error&&r.templates.length===0?e.jsx("p",{className:"status-text","data-tone":"error",children:r.error}):null,!r.loading&&r.templates.length===0?e.jsx("p",{children:s("shell.workspaceDetailRegisteredDebugTemplatesEmpty")}):null,r.templates.length>0?e.jsx("div",{className:"mobile-feature-stack",children:r.templates.map(c=>{const m=x.get(c.id)??null;return e.jsxs("article",{className:"surface-card mobile-session-row",children:[e.jsxs("div",{className:"mobile-session-row-primary mobile-session-row-primary-static",children:[e.jsx("span",{className:"mobile-session-row-title",children:c.name}),e.jsx("span",{className:"mobile-session-row-provider",children:me(c,m)})]}),e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePathLabel")}),e.jsx("strong",{title:c.cwd,children:he(c.cwd,o)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplatePortLabel")}),e.jsx("strong",{children:ue(c.port)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugTemplateRuntimeTypeLabel")}),e.jsx("strong",{children:X(c.runtimeType)})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugRuntimeProcessLabel")}),e.jsx("strong",{children:pe(m)})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemCommandLabel")}),e.jsx("strong",{children:be(c)})]}),e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.workspaceDetailRegisteredDebugPlanItemReasonLabel")}),e.jsx("strong",{children:je(c,m)})]})]})]},c.id)})}):null]})}function Se(l){return l.isArchived!==!0&&!oe(l)}function Ae(l){return ne(l)}const C=60*1e3,y=10;function Je(){var E;const{workspaceId:l=""}=Re(),o=De(),{showToast:r}=We(),{navigationGroups:b,currentWorkspaceId:u,favoriteSessionIds:x,workspaceManagementStateById:c,selectWorkspace:m,subscribeGitSnapshot:R,requestGitRefresh:D,subscribeWorkspaceManagementSnapshot:W,requestWorkspaceManagementRefresh:M,toggleFavoriteSession:O,archiveSession:_,unarchiveSession:G,startDraftSession:V}=J(),[S,A]=d.useState(!1),[H,f]=d.useState(!1),[T,P]=d.useState(y),v=Q(b),h=U(b,l),i=(h==null?void 0:h.workspace)??null,p=v.find(a=>a.workspace.id===(i==null?void 0:i.id))??(i?{workspace:i,label:i.name,subtitle:i.path}:null),w=d.useMemo(()=>[...(h==null?void 0:h.sessions)??[]].filter(Se),[h]),g=d.useMemo(()=>[...(h==null?void 0:h.sessions)??[]].filter(Ae),[h]);d.useEffect(()=>{l&&m(l)},[m,l]),d.useEffect(()=>{if(!l)return;const a=N(Ie(l),C),t=N(F(l),C);R(l,{knownRevision:(a==null?void 0:a.revision)??null}),W(l,{knownRevision:(t==null?void 0:t.revision)??null}),a||D(l),t||M(l)},[D,M,R,W,l]),d.useEffect(()=>{P(y)},[l]);const n=d.useMemo(()=>{if(!l)return{loading:!1,error:null,hasMeaningfulSummary:!1,summary:null};const a=N(F(l),C),t=c[l]??null,j=(t==null?void 0:t.detail)??(i?Ee(i,a):a??null);return{loading:(t==null?void 0:t.loading)??!1,error:(t==null?void 0:t.error)??null,hasMeaningfulSummary:Le(j),summary:j}},[i,l,c]),k=d.useMemo(()=>n.summary?Y(n.summary.codeComposition.items,s("shell.manageWorkspaceCodeCompositionOther")):[],[n.summary]),Z=d.useMemo(()=>k.length>0?ee(k):void 0,[k]),I=d.useMemo(()=>g.slice(0,T),[g,T]),q=ge(i?{id:i.id,path:i.path,name:i.name}:null),K=ke(i?{id:i.id,path:i.path,name:i.name}:null);async function $(){if(!(!i||!(typeof window>"u"||window.confirm(s("shell.manageWorkspaceRemoveConfirmTarget",{name:i.name}))))){A(!0);try{await te(i.id),r({title:s("shell.manageWorkspaceRemoveSuccess"),tone:"success"}),o("/workspaces",{replace:!0})}catch(t){r({title:t instanceof Error?t.message:s("shell.manageWorkspaceRemoveFailed"),tone:"error"})}finally{A(!1)}}}function z(a,t){f(!1),V(a,t)}return i?e.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-detail-page",children:[e.jsx(se,{currentWorkspace:p?{id:p.workspace.id,name:p.label,path:p.subtitle}:null,workspaces:b.map(a=>a.workspace),workspaceOptions:v,heading:s("shell.workspaceDetailTitle"),triggerLabel:(p==null?void 0:p.label)??i.name,onSelectWorkspace:a=>{m(a),o(Ne(a))},content:e.jsxs("div",{className:"mobile-workspace-detail-header-actions",children:[e.jsx("button",{type:"button",className:"primary-button",onClick:()=>f(!0),children:s("shell.createSession")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(ve(i.id))},children:s("shell.filesEntry")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(we(i.id))},children:s("shell.terminalsEntry")})]})}),e.jsxs("div",{className:"mobile-page-top-body mobile-workspace-detail-body",children:[e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-detail-summary-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.workspaceDetailSummaryTitle")})}),u!==i.id?e.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-switch-button",onClick:()=>m(i.id),children:s("shell.switchWorkspace")}):null]}),n.loading&&n.summary===null?e.jsx("p",{children:s("common.loading")}):null,n.error?e.jsx("p",{className:"status-text","data-tone":"error",children:n.error}):null,n.summary?e.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[e.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[e.jsx("span",{children:s("shell.manageWorkspacePathLabel")}),e.jsx("strong",{title:n.summary.path,children:n.summary.path})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceCurrentBranch")}),e.jsx("strong",{title:n.summary.git.currentBranch??s("common.unknown"),children:n.summary.git.currentBranch??s("common.unknown")})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceGitCommitCount")}),e.jsx("strong",{children:n.hasMeaningfulSummary?n.summary.git.commitCount??0:"—"})]}),e.jsxs("div",{className:"mobile-detail-metric",children:[e.jsx("span",{children:s("shell.manageWorkspaceCodeCompositionFiles")}),e.jsx("strong",{children:n.hasMeaningfulSummary?n.summary.codeComposition.scannedFileCount:"—"})]})]}):null,e.jsxs("div",{className:"mobile-feature-inline-actions mobile-workspace-detail-summary-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(Ce(i.id))},children:s("shell.gitEntry")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{m(i.id),o(B(i.id))},children:s("shell.terminalManagerEntry")}),e.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:S,onClick:()=>{$()},children:S?s("shell.manageWorkspaceRemoving"):s("shell.manageWorkspaceRemoveAction")})]})]}),e.jsx(xe,{workspace:i?{id:i.id,path:i.path,name:i.name}:null,state:q,variant:"mobile"}),i?e.jsx(Me,{workspaceId:i.id,workspacePath:i.path,state:K,onOpenProcessManager:a=>{m(a),o(B(a))}}):null,e.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-composition-panel",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.manageWorkspaceCodeCompositionLabel")})}),n.summary?e.jsx("span",{className:"mobile-feature-counter",children:n.summary.codeComposition.scannedFileCount}):null]}),n.loading&&n.summary===null?e.jsx("p",{children:s("common.loading")}):null,n.summary?k.length>0?e.jsxs("div",{className:"workbench-manage-type-chart",children:[e.jsxs("div",{className:"workbench-manage-type-chart-ring",style:Z,"aria-hidden":"true",children:[e.jsx("strong",{className:"workbench-manage-type-chart-total",children:n.summary.codeComposition.scannedFileCount}),e.jsx("span",{className:"workbench-manage-type-chart-caption",children:s("shell.manageWorkspaceCodeCompositionFiles")})]}),e.jsx("div",{className:"workbench-manage-type-list",children:k.map(a=>e.jsxs("div",{className:"workbench-manage-type-item",children:[e.jsxs("span",{className:"workbench-manage-type-meta",children:[e.jsx("span",{className:"workbench-manage-type-swatch",style:{backgroundColor:a.color},"aria-hidden":"true"}),e.jsx("span",{className:"workbench-manage-type-name",children:a.type})]}),e.jsxs("span",{children:[a.count," · ",ae(a)]})]},a.key))})]}):e.jsx("p",{children:n.summary.codeComposition.error??s("shell.manageWorkspaceNoCodeComposition")}):null,(E=n.summary)!=null&&E.codeComposition.truncated?e.jsx("p",{className:"mobile-workspace-composition-note",children:s("shell.manageWorkspaceCodeTruncated",{count:n.summary.codeComposition.scannedFileCount})}):null]}),e.jsxs("section",{className:"mobile-feature-section",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.recentSessionsSectionTitle")})}),e.jsx("span",{className:"mobile-feature-counter",children:w.length})]}),e.jsx("div",{className:"mobile-feature-stack",children:w.length===0?e.jsx("article",{className:"mobile-feature-empty surface-card",children:e.jsx("p",{children:s("shell.emptyWorkspaceSessions")})}):w.map(a=>{const t=le(a.title,s("common.unknown")),j=x.includes(a.sessionId);return e.jsxs("article",{className:"mobile-session-row surface-card",children:[e.jsxs("button",{type:"button",className:"mobile-session-row-primary",onClick:()=>o(ye(i.id,a.sessionId)),children:[e.jsx("span",{className:"mobile-session-row-title",title:t.fullTitle,children:t.displayTitle}),e.jsx("span",{className:"mobile-session-row-provider",children:L(a.provider)})]}),e.jsxs("div",{className:"mobile-session-row-actions",children:[e.jsx("span",{className:"mobile-feature-badge mobile-session-row-count",children:a.messageCount}),e.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":j?s("shell.unfavoriteAction"):s("shell.favoriteAction"),title:j?s("shell.unfavoriteAction"):s("shell.favoriteAction"),onClick:()=>{O(a.sessionId)},children:e.jsx(Te,{active:j})}),e.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":s("shell.archiveAction"),title:s("shell.archiveAction"),onClick:()=>{_(a.sessionId)},children:e.jsx(Pe,{})})]})]},a.sessionId)})})]}),g.length>0?e.jsxs("section",{className:"mobile-feature-section",children:[e.jsxs("div",{className:"mobile-feature-section-header",children:[e.jsx("div",{children:e.jsx("h2",{children:s("shell.archiveModalTitle")})}),e.jsx("span",{className:"mobile-feature-counter",children:g.length})]}),e.jsx("div",{className:"mobile-feature-stack",children:I.map(a=>{const t=ie(a);return e.jsxs("article",{className:"mobile-session-row surface-card",children:[e.jsxs("div",{className:"mobile-session-row-primary mobile-session-row-primary-static",children:[e.jsxs("span",{className:"mobile-session-row-title",title:a.title,children:[a.title,t?e.jsx("span",{className:"session-fork-badge archive-child",children:t}):null]}),e.jsx("span",{className:"mobile-session-row-provider",children:L(a.provider)})]}),e.jsx("div",{className:"mobile-session-row-actions",children:e.jsx("button",{type:"button",className:"secondary-button mobile-session-row-restore",onClick:()=>{G(a.sessionId)},children:s("shell.unarchiveAction")})})]},a.sessionId)})}),I.length<g.length?e.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-expand-button",onClick:()=>{P(a=>a+y)},children:s("shell.archiveExpandMore")}):null]}):null]}),e.jsx(fe,{open:H,workspaces:b.map(a=>a.workspace),workspaceOptions:v,initialWorkspaceId:u??i.id,onClose:()=>f(!1),onSelect:z})]}):e.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:e.jsxs("article",{className:"mobile-feature-empty surface-card",children:[e.jsx("h1",{children:s("shell.workspaceDetailMissingTitle")}),e.jsx("p",{children:s("shell.workspaceDetailMissingBody")}),e.jsx("button",{type:"button",className:"secondary-button",onClick:()=>o("/workspaces"),children:s("shell.mobileWorkspacesEntry")})]})})}function Te({active:l}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.8",children:e.jsx("path",{d:"m12 3.6 2.6 5.2 5.7.8-4.1 4 1 5.7L12 16.5 6.8 19.3l1-5.7-4.1-4 5.7-.8Z"})})}function Pe(){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("path",{d:"M4 7.5h16"}),e.jsx("path",{d:"M6.4 7.5h11.2l-.9 10.2a2 2 0 0 1-2 1.8H9.3a2 2 0 0 1-2-1.8Z"}),e.jsx("path",{d:"M8 4.5h8a1.5 1.5 0 0 1 1.5 1.5v1.5h-11V6A1.5 1.5 0 0 1 8 4.5Z"}),e.jsx("path",{d:"M10 11.5h4"})]})}function F(l){return`workspace-management.summary.${l}`}function Ie(l){return`git-sidebar.snapshot.${l}`}function Ee(l,o){const r=(o==null?void 0:o.git.repoRoot)??l.repoRoot??null;return{workspaceId:l.id,name:l.name,path:l.path,git:{isRepository:(o==null?void 0:o.git.isRepository)??!!r,repoRoot:r,currentBranch:(o==null?void 0:o.git.currentBranch)??null,commitCount:(o==null?void 0:o.git.commitCount)??null,remotes:(o==null?void 0:o.git.remotes)??[],error:(o==null?void 0:o.git.error)??null},codeComposition:(o==null?void 0:o.codeComposition)??{scannedFileCount:0,truncated:!1,items:[],error:null}}}function Le(l){return l?l.git.isRepository||l.git.repoRoot!==null||l.git.currentBranch!==null||l.git.commitCount!==null||l.git.remotes.length>0||l.codeComposition.scannedFileCount>0||l.codeComposition.items.length>0||l.codeComposition.error!==null:!1}export{Je as WorkspaceDetailPage};
@@ -1 +1 @@
1
- import{b as r,j as e,t,E as y,F as ie}from"./index-BilHJjYU.js";import{b as He,f as Be,c as oe,i as re,B as ne,M as Oe,d as se,e as Ue,h as qe,j as De,k as Ve,l as Ke,n as Ge,o as We,p as Qe}from"./WorkbenchLayout-Bo2BbMY6.js";import{s as Xe}from"./butler-records-events-DgWCG364.js";import{c as te,b as $e,d as ze,e as Je,f as Ye,g as Ze,h as F}from"./workbench-navigation-ED0157V-.js";import{u as ei,f as ii}from"./App-CHsm-VrM.js";import{M as oi}from"./MobileCreateSessionSheet-BtqR_hKc.js";import{W as ni}from"./WorkbenchModal-YsyEdJ_m.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-Zb2xyVrf.js";import"./DesktopModal-Csj5AdAN.js";import"./relay-entry-Cmc8vTlE.js";import"./MobileSheet-Co-qPMBD.js";function si(n){return n.status==="active"}function ti(n){return n.status==="queued"||n.status==="running"}function ai(n,m){return n.filter(si).length+m.filter(ti).length}function li(n){const m=r.useMemo(()=>n.notifications.filter(a=>n.showArchivedNotifications||!n.archivedNotificationIds.has(a.id)),[n.archivedNotificationIds,n.notifications,n.showArchivedNotifications]);return e.jsx(ni,{open:n.open,title:t("shell.globalNotificationsPanelTitle"),description:t("shell.globalNotificationsPanelDescription"),className:"workbench-notification-modal-card mobile-notification-modal-card",onClose:n.onClose,children:e.jsxs("div",{className:"workbench-notification-pane mobile-notification-pane",role:"tabpanel","aria-label":t("shell.globalNotificationsAction"),children:[e.jsx("div",{className:"workbench-notification-toolbar",children:e.jsxs("label",{className:"workbench-notification-filter",children:[e.jsx("input",{type:"checkbox",checked:n.showArchivedNotifications,onChange:a=>n.onToggleShowArchivedNotifications(a.target.checked)}),e.jsx("span",{children:t("shell.globalNotificationsShowArchived")})]})}),m.length>0?e.jsx("div",{className:"workbench-notification-list",children:m.map(a=>{const u=n.archivedNotificationIds.has(a.id);return e.jsxs("article",{className:"workbench-notification-item","data-archived":u,children:[e.jsxs("button",{type:"button",className:"workbench-notification-item-content",onClick:()=>{n.onSelectNotification(a)},children:[e.jsx("span",{className:"workbench-notification-item-kind",children:ci(a.kind)}),e.jsx("strong",{children:a.title}),e.jsx("p",{children:a.body})]}),e.jsxs("div",{className:"workbench-notification-item-side",children:[e.jsx("time",{children:ri(a.createdAt)}),e.jsx("button",{type:"button",className:"secondary-button workbench-notification-item-action-button",onClick:()=>{if(u){n.onUnarchiveNotification(a.id);return}n.onArchiveNotification(a.id)},children:u?t("shell.globalNotificationsRemoveArchiveAction"):t("shell.globalNotificationsArchiveAction")})]})]},a.id)})}):e.jsx("p",{className:"workbench-notification-empty",children:t("shell.globalNotificationsEmpty")})]})})}function ci(n){switch(n){case"follow_up_waiting_user":return t("shell.globalNotificationKindWaitingUser");case"follow_up_completed":return t("shell.globalNotificationKindFollowUpCompleted");case"follow_up_failed":return t("shell.globalNotificationKindFollowUpFailed");case"verification_failed":return t("shell.globalNotificationKindVerificationFailed");default:return t("shell.globalNotificationsPanelTitle")}}function ri(n){const m=new Date(n);return Number.isNaN(m.getTime())?n:new Intl.DateTimeFormat(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(m)}function di(n){return n.isArchived!==!0&&!Ve(n)}function mi(n){return n.activityState==="idle"&&re(n)===!1}function ae(n){return n==="creating"||n==="running"}function le(n){return n.lastEventAt??n.lastMessageAt??n.updatedAt??n.createdAt}function ce(n){return n?new Date(n).toLocaleString(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):t("common.unknown")}function x(n){return n!==null&&n>0}const A=60*1e3,ui=15e3;function Ii(){var ee;const n=ei(),{showToast:m}=ii(),a=He(),{navigationGroups:u,currentWorkspaceId:O,refreshNavigation:U,selectWorkspace:p,startDraftSession:de,subscribeGitSnapshot:q,requestGitRefresh:D,addGitSnapshotListener:V,subscribeTerminalManagerSnapshot:K,requestTerminalManagerRefresh:G,addTerminalManagerSnapshotListener:W}=a,me=a.globalNotifications??[],ue=new Set(a.archivedNotificationIds??[]),he=a.showArchivedNotifications??!1,Q=a.unreadNotificationCount??0,pe=a.setShowArchivedNotifications??(()=>{}),be=a.archiveNotification??(()=>{}),fe=a.unarchiveNotification??(()=>{}),[X,b]=r.useState(null),[we,R]=r.useState(!1),[ke,$]=r.useState(!1),[ge,M]=r.useState(!1),[d,g]=r.useState({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null}),[f,C]=r.useState({loading:!0,activeTaskCount:0,pendingInboxCount:0}),E=Be(u),j=oe(u,O)??oe(u,((ee=u[0])==null?void 0:ee.workspace.id)??null),i=(j==null?void 0:j.workspace)??null,I=E.find(o=>o.workspace.id===(i==null?void 0:i.id))??(i?{workspace:i,label:i.name,subtitle:i.path}:null),S=[...(j==null?void 0:j.sessions)??[]].filter(di),P=S.filter(re),z=S.filter(mi),ve=S.filter(o=>o.isFavorite===!0),J=P.slice(0,6),Y=ve.slice(0,6),Ne=d.quickLaunchRunning===null?"…":d.quickLaunchRunning?t("shell.workspaceHomeQuickLaunchRunning"):t("shell.workspaceHomeQuickLaunchStopped");r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null});return}const s=y(H(o),A);g(c=>{var l,v,w;return{...c,gitLoading:s===null,branch:((l=s==null?void 0:s.status)==null?void 0:l.snapshot.enabled)===!1?null:((v=s==null?void 0:s.status)==null?void 0:v.snapshot.branch)??null,changedFileCount:((w=s==null?void 0:s.status)==null?void 0:w.changes.length)??null}})},[i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(o)return V(s=>{s.workspaceId===o&&(ie(H(o),s),g(c=>{var l,v,w,T;return{...c,gitLoading:!1,branch:((l=s.status)==null?void 0:l.snapshot.enabled)===!1?null:((v=s.status)==null?void 0:v.snapshot.branch)??((w=s.branches)==null?void 0:w.currentBranch)??null,changedFileCount:((T=s.status)==null?void 0:T.changes.length)??null}}))})},[V,i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g(c=>({...c,gitLoading:!1,branch:null,changedFileCount:null}));return}const s=y(B(o),A);g(c=>({...c,terminalLoading:s===null,activeTerminalCount:s?s.terminals.filter(l=>ae(l.status)).length:null,quickLaunchRunning:s?s.templateStatuses.some(l=>l.occupied):null}))},[i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g(s=>({...s,terminalLoading:!1,activeTerminalCount:null,quickLaunchRunning:null}));return}return W(s=>{s.workspaceId===o&&(ie(B(o),{revision:s.revision??null,terminals:s.terminals,templates:s.templates,templateStatuses:s.templateStatuses}),g(c=>({...c,terminalLoading:!1,activeTerminalCount:s.terminals.filter(l=>ae(l.status)).length,quickLaunchRunning:s.templateStatuses.some(l=>l.occupied)})))})},[W,i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o)return;const s=y(H(o),A);q(o,{knownRevision:(s==null?void 0:s.revision)??null}),!s&&D(o)},[i==null?void 0:i.id,D,q]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o)return;const s=y(B(o),A);K(o,{knownRevision:(s==null?void 0:s.revision)??null}),!s&&G(o)},[i==null?void 0:i.id,G,K]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){C({loading:!1,activeTaskCount:0,pendingInboxCount:0});return}let s=!1;async function c(T){C(N=>({...N,loading:!0}));try{const N=await Ke();if(!N.initialized||!N.profile){s||C({loading:!1,activeTaskCount:0,pendingInboxCount:0});return}const[L,Ee,Pe]=await Promise.all([Ge(),We(),Qe({workspaceId:o})]);if(s)return;const _e=new Set(L.overview.projects.filter(h=>h.workspaceId===o).map(h=>h.id)),Fe=L.overview.verifications.filter(h=>h.projectId?_e.has(h.projectId):!1);C({loading:!1,activeTaskCount:ai(Ee.items.filter(h=>h.workspaceId===o),Fe),pendingInboxCount:Pe.items.filter(h=>h.status!=="closed").length})}catch(N){if(s)return;C(L=>({...L,loading:!1})),T&&m({title:t("shell.butlerLoadFailed"),description:N instanceof Error?N.message:void 0,tone:"error"})}}c(!0);const l=window.setInterval(()=>{c(!1)},ui),v=Xe(()=>{c(!1)}),w=()=>{c(!1)};return window.addEventListener(ne,w),()=>{s=!0,window.clearInterval(l),v(),window.removeEventListener(ne,w)}},[i==null?void 0:i.id,m]);async function xe(o){await U(),p(o.id),b(null),n(F(o.id))}async function je(o){await U(),p(o.id),b(null),n(F(o.id))}function Ce(){i&&(p(i.id),n(Je(i.id,"git")))}function Se(){i&&(p(i.id),n(ze(i.id)))}function Ie(){i&&(p(i.id),n(Ze(i.id)))}function Te(){i&&(p(i.id),n(Ye(i.id)))}function _(){i&&n($e(i.id))}function Z(){i&&R(!0)}function Le(o,s){R(!1),de(o,s)}function ye(){i&&(p(i.id),n(F(i.id)))}function Ae(o){p(o)}const Re=[{label:t("shell.workspaceHomeMetricActive"),value:P.length,accent:x(P.length),onClick:S.length>0?_:void 0},{label:t("shell.workspaceHomeMetricUnread"),value:Q,accent:x(Q),onClick:()=>M(!0)},{label:t("shell.workspaceHomeMetricTerminal"),value:d.terminalLoading?"…":d.activeTerminalCount??"—",accent:d.terminalLoading===!1&&x(d.activeTerminalCount),onClick:i?Se:void 0},{label:t("shell.workspaceHomeMetricChanges"),value:d.gitLoading?"…":d.changedFileCount??"—",accent:d.gitLoading===!1&&x(d.changedFileCount),onClick:i?Ce:void 0}],Me=[{label:t("shell.workspaceHomeWaitingInputLabel"),value:z.length,accent:x(z.length),onClick:S.length>0?_:void 0},{label:t("shell.workspaceHomeButlerLabel"),value:f.loading?"…":f.activeTaskCount,accent:f.loading===!1&&x(f.activeTaskCount),onClick:i?Te:void 0},{label:t("shell.workspaceHomeQuickLaunchStatusLabel"),value:Ne,accent:d.quickLaunchRunning===!0,onClick:i?Ie:void 0},{label:t("shell.butlerInboxAction"),value:f.loading?"…":f.pendingInboxCount,accent:f.loading===!1&&x(f.pendingInboxCount),onClick:i?()=>$(!0):void 0}];return e.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-home-page",children:[e.jsx(Oe,{currentWorkspace:I?{id:I.workspace.id,name:I.label,path:I.subtitle}:null,workspaces:u.map(o=>o.workspace),workspaceOptions:E,onSelectWorkspace:Ae,sheetContent:o=>e.jsxs("div",{className:"mobile-workspace-home-group mobile-workspace-home-sheet-group",children:[e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{o(),b("import")},children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.importWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}),e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{o(),b("clone")},children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.cloneWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]})]})}),i?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:[e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsx("div",{className:"mobile-workspace-home-metrics-card","aria-label":t("shell.workspaceHomeStatusSectionTitle"),children:e.jsx("div",{className:"mobile-workspace-home-toolbar-summary",children:Re.map(o=>o.onClick?e.jsxs("button",{type:"button",className:"mobile-workspace-home-toolbar-metric","data-accent":o.accent?"true":void 0,onClick:o.onClick,children:[e.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:o.value}),e.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:o.label})]},o.label):e.jsxs("div",{className:"mobile-workspace-home-toolbar-metric","data-accent":o.accent?"true":void 0,role:"listitem",children:[e.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:o.value}),e.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:o.label})]},o.label))})})}),e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsxs("div",{className:"mobile-workspace-home-primary-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:ye,children:t("shell.workspaceDetailTitle")}),e.jsx("button",{type:"button",className:"primary-button",onClick:Z,children:t("shell.createSession")})]})}),e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsx("div",{className:"mobile-workspace-home-group",children:Me.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row","data-accent":o.accent?"true":void 0,onClick:o.onClick,children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:o.label}),e.jsxs("span",{className:"mobile-workspace-home-row-trailing",children:[e.jsx("strong",{children:o.value}),e.jsx(k,{})]})]},o.label))})}),e.jsxs("section",{className:"mobile-workspace-home-section",children:[e.jsxs("div",{className:"mobile-workspace-home-section-header",children:[e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.workspaceHomeActiveSessionsSectionTitle")}),i?e.jsx("button",{type:"button",className:"mobile-workspace-home-link-button",onClick:_,children:t("shell.workspaceHomeViewAllAction")}):null]}),e.jsx("div",{className:"mobile-workspace-home-group",children:J.length===0?e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-empty-row",onClick:Z,children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:t("shell.createSession")}),e.jsx("span",{className:"mobile-workspace-home-session-meta",children:i.name})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}):J.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>n(te(i.id,o.sessionId)),children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:o.title||t("common.unknown")}),e.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[se(o.provider,"full")," · ",ce(le(o))]})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]},o.sessionId))})]}),Y.length>0?e.jsxs("section",{className:"mobile-workspace-home-section",children:[e.jsx("div",{className:"mobile-workspace-home-section-header",children:e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.favoriteSectionTitle")})}),e.jsx("div",{className:"mobile-workspace-home-group",children:Y.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>n(te(i.id,o.sessionId)),children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:o.title||t("common.unknown")}),e.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[se(o.provider,"full")," · ",ce(le(o))]})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]},o.sessionId))})]}):null]})}):e.jsx("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:e.jsxs("section",{className:"mobile-workspace-home-section mobile-workspace-home-empty",children:[e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.workspaceHomeSwitcherTitle")}),e.jsxs("div",{className:"mobile-workspace-home-group",children:[e.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>b("import"),children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.importWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}),e.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>b("clone"),children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.cloneWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]})]})]})}),e.jsx(Ue,{open:X==="import",onClose:()=>b(null),onImported:xe}),e.jsx(qe,{open:X==="clone",onClose:()=>b(null),onCloned:je}),e.jsx(oi,{open:we,workspaces:u.map(o=>o.workspace),workspaceOptions:E,initialWorkspaceId:(i==null?void 0:i.id)??O??null,onClose:()=>R(!1),onSelect:Le}),e.jsx(De,{open:ke,preferredWorkspaceId:(i==null?void 0:i.id)??null,compactComposer:!0,onClose:()=>$(!1)}),e.jsx(li,{open:ge,notifications:me,archivedNotificationIds:ue,showArchivedNotifications:he,onClose:()=>M(!1),onToggleShowArchivedNotifications:pe,onArchiveNotification:be,onUnarchiveNotification:fe,onSelectNotification:o=>{M(!1),o.routePath&&n(o.routePath)}})]})}function H(n){return`git-sidebar.snapshot.${n}`}function B(n){return`terminal-manager.snapshot.${n}`}function k(){return e.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}export{Ii as WorkspaceHomePage};
1
+ import{b as r,j as e,t,E as y,F as ie}from"./index-BArTKWXk.js";import{b as He,f as Be,c as oe,i as re,B as ne,M as Oe,d as se,e as Ue,h as qe,j as De,k as Ve,l as Ke,n as Ge,o as We,p as Qe}from"./WorkbenchLayout-DrAvGjGK.js";import{s as Xe}from"./butler-records-events-DgWCG364.js";import{c as te,b as $e,d as ze,e as Je,f as Ye,g as Ze,h as F}from"./workbench-navigation-vIWt3Rv_.js";import{u as ei,f as ii}from"./App-FYuZfAoO.js";import{M as oi}from"./MobileCreateSessionSheet-gOyAZ857.js";import{W as ni}from"./WorkbenchModal-BK5ix8YI.js";import"./window-BVUB8gMK.js";import"./event-DvH9tcej.js";import"./host-alias-BxzpRYrt.js";import"./DesktopModal-K5bEcj38.js";import"./relay-entry-ClEd3cjN.js";import"./MobileSheet-D0MfNkTv.js";function si(n){return n.status==="active"}function ti(n){return n.status==="queued"||n.status==="running"}function ai(n,m){return n.filter(si).length+m.filter(ti).length}function li(n){const m=r.useMemo(()=>n.notifications.filter(a=>n.showArchivedNotifications||!n.archivedNotificationIds.has(a.id)),[n.archivedNotificationIds,n.notifications,n.showArchivedNotifications]);return e.jsx(ni,{open:n.open,title:t("shell.globalNotificationsPanelTitle"),description:t("shell.globalNotificationsPanelDescription"),className:"workbench-notification-modal-card mobile-notification-modal-card",onClose:n.onClose,children:e.jsxs("div",{className:"workbench-notification-pane mobile-notification-pane",role:"tabpanel","aria-label":t("shell.globalNotificationsAction"),children:[e.jsx("div",{className:"workbench-notification-toolbar",children:e.jsxs("label",{className:"workbench-notification-filter",children:[e.jsx("input",{type:"checkbox",checked:n.showArchivedNotifications,onChange:a=>n.onToggleShowArchivedNotifications(a.target.checked)}),e.jsx("span",{children:t("shell.globalNotificationsShowArchived")})]})}),m.length>0?e.jsx("div",{className:"workbench-notification-list",children:m.map(a=>{const u=n.archivedNotificationIds.has(a.id);return e.jsxs("article",{className:"workbench-notification-item","data-archived":u,children:[e.jsxs("button",{type:"button",className:"workbench-notification-item-content",onClick:()=>{n.onSelectNotification(a)},children:[e.jsx("span",{className:"workbench-notification-item-kind",children:ci(a.kind)}),e.jsx("strong",{children:a.title}),e.jsx("p",{children:a.body})]}),e.jsxs("div",{className:"workbench-notification-item-side",children:[e.jsx("time",{children:ri(a.createdAt)}),e.jsx("button",{type:"button",className:"secondary-button workbench-notification-item-action-button",onClick:()=>{if(u){n.onUnarchiveNotification(a.id);return}n.onArchiveNotification(a.id)},children:u?t("shell.globalNotificationsRemoveArchiveAction"):t("shell.globalNotificationsArchiveAction")})]})]},a.id)})}):e.jsx("p",{className:"workbench-notification-empty",children:t("shell.globalNotificationsEmpty")})]})})}function ci(n){switch(n){case"follow_up_waiting_user":return t("shell.globalNotificationKindWaitingUser");case"follow_up_completed":return t("shell.globalNotificationKindFollowUpCompleted");case"follow_up_failed":return t("shell.globalNotificationKindFollowUpFailed");case"verification_failed":return t("shell.globalNotificationKindVerificationFailed");default:return t("shell.globalNotificationsPanelTitle")}}function ri(n){const m=new Date(n);return Number.isNaN(m.getTime())?n:new Intl.DateTimeFormat(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(m)}function di(n){return n.isArchived!==!0&&!Ve(n)}function mi(n){return n.activityState==="idle"&&re(n)===!1}function ae(n){return n==="creating"||n==="running"}function le(n){return n.lastEventAt??n.lastMessageAt??n.updatedAt??n.createdAt}function ce(n){return n?new Date(n).toLocaleString(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):t("common.unknown")}function x(n){return n!==null&&n>0}const A=60*1e3,ui=15e3;function Ii(){var ee;const n=ei(),{showToast:m}=ii(),a=He(),{navigationGroups:u,currentWorkspaceId:O,refreshNavigation:U,selectWorkspace:p,startDraftSession:de,subscribeGitSnapshot:q,requestGitRefresh:D,addGitSnapshotListener:V,subscribeTerminalManagerSnapshot:K,requestTerminalManagerRefresh:G,addTerminalManagerSnapshotListener:W}=a,me=a.globalNotifications??[],ue=new Set(a.archivedNotificationIds??[]),he=a.showArchivedNotifications??!1,Q=a.unreadNotificationCount??0,pe=a.setShowArchivedNotifications??(()=>{}),be=a.archiveNotification??(()=>{}),fe=a.unarchiveNotification??(()=>{}),[X,b]=r.useState(null),[we,R]=r.useState(!1),[ke,$]=r.useState(!1),[ge,M]=r.useState(!1),[d,g]=r.useState({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null}),[f,C]=r.useState({loading:!0,activeTaskCount:0,pendingInboxCount:0}),E=Be(u),j=oe(u,O)??oe(u,((ee=u[0])==null?void 0:ee.workspace.id)??null),i=(j==null?void 0:j.workspace)??null,I=E.find(o=>o.workspace.id===(i==null?void 0:i.id))??(i?{workspace:i,label:i.name,subtitle:i.path}:null),S=[...(j==null?void 0:j.sessions)??[]].filter(di),P=S.filter(re),z=S.filter(mi),ve=S.filter(o=>o.isFavorite===!0),J=P.slice(0,6),Y=ve.slice(0,6),Ne=d.quickLaunchRunning===null?"…":d.quickLaunchRunning?t("shell.workspaceHomeQuickLaunchRunning"):t("shell.workspaceHomeQuickLaunchStopped");r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null});return}const s=y(H(o),A);g(c=>{var l,v,w;return{...c,gitLoading:s===null,branch:((l=s==null?void 0:s.status)==null?void 0:l.snapshot.enabled)===!1?null:((v=s==null?void 0:s.status)==null?void 0:v.snapshot.branch)??null,changedFileCount:((w=s==null?void 0:s.status)==null?void 0:w.changes.length)??null}})},[i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(o)return V(s=>{s.workspaceId===o&&(ie(H(o),s),g(c=>{var l,v,w,T;return{...c,gitLoading:!1,branch:((l=s.status)==null?void 0:l.snapshot.enabled)===!1?null:((v=s.status)==null?void 0:v.snapshot.branch)??((w=s.branches)==null?void 0:w.currentBranch)??null,changedFileCount:((T=s.status)==null?void 0:T.changes.length)??null}}))})},[V,i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g(c=>({...c,gitLoading:!1,branch:null,changedFileCount:null}));return}const s=y(B(o),A);g(c=>({...c,terminalLoading:s===null,activeTerminalCount:s?s.terminals.filter(l=>ae(l.status)).length:null,quickLaunchRunning:s?s.templateStatuses.some(l=>l.occupied):null}))},[i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){g(s=>({...s,terminalLoading:!1,activeTerminalCount:null,quickLaunchRunning:null}));return}return W(s=>{s.workspaceId===o&&(ie(B(o),{revision:s.revision??null,terminals:s.terminals,templates:s.templates,templateStatuses:s.templateStatuses}),g(c=>({...c,terminalLoading:!1,activeTerminalCount:s.terminals.filter(l=>ae(l.status)).length,quickLaunchRunning:s.templateStatuses.some(l=>l.occupied)})))})},[W,i==null?void 0:i.id]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o)return;const s=y(H(o),A);q(o,{knownRevision:(s==null?void 0:s.revision)??null}),!s&&D(o)},[i==null?void 0:i.id,D,q]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o)return;const s=y(B(o),A);K(o,{knownRevision:(s==null?void 0:s.revision)??null}),!s&&G(o)},[i==null?void 0:i.id,G,K]),r.useEffect(()=>{const o=(i==null?void 0:i.id)??null;if(!o){C({loading:!1,activeTaskCount:0,pendingInboxCount:0});return}let s=!1;async function c(T){C(N=>({...N,loading:!0}));try{const N=await Ke();if(!N.initialized||!N.profile){s||C({loading:!1,activeTaskCount:0,pendingInboxCount:0});return}const[L,Ee,Pe]=await Promise.all([Ge(),We(),Qe({workspaceId:o})]);if(s)return;const _e=new Set(L.overview.projects.filter(h=>h.workspaceId===o).map(h=>h.id)),Fe=L.overview.verifications.filter(h=>h.projectId?_e.has(h.projectId):!1);C({loading:!1,activeTaskCount:ai(Ee.items.filter(h=>h.workspaceId===o),Fe),pendingInboxCount:Pe.items.filter(h=>h.status!=="closed").length})}catch(N){if(s)return;C(L=>({...L,loading:!1})),T&&m({title:t("shell.butlerLoadFailed"),description:N instanceof Error?N.message:void 0,tone:"error"})}}c(!0);const l=window.setInterval(()=>{c(!1)},ui),v=Xe(()=>{c(!1)}),w=()=>{c(!1)};return window.addEventListener(ne,w),()=>{s=!0,window.clearInterval(l),v(),window.removeEventListener(ne,w)}},[i==null?void 0:i.id,m]);async function xe(o){await U(),p(o.id),b(null),n(F(o.id))}async function je(o){await U(),p(o.id),b(null),n(F(o.id))}function Ce(){i&&(p(i.id),n(Je(i.id,"git")))}function Se(){i&&(p(i.id),n(ze(i.id)))}function Ie(){i&&(p(i.id),n(Ze(i.id)))}function Te(){i&&(p(i.id),n(Ye(i.id)))}function _(){i&&n($e(i.id))}function Z(){i&&R(!0)}function Le(o,s){R(!1),de(o,s)}function ye(){i&&(p(i.id),n(F(i.id)))}function Ae(o){p(o)}const Re=[{label:t("shell.workspaceHomeMetricActive"),value:P.length,accent:x(P.length),onClick:S.length>0?_:void 0},{label:t("shell.workspaceHomeMetricUnread"),value:Q,accent:x(Q),onClick:()=>M(!0)},{label:t("shell.workspaceHomeMetricTerminal"),value:d.terminalLoading?"…":d.activeTerminalCount??"—",accent:d.terminalLoading===!1&&x(d.activeTerminalCount),onClick:i?Se:void 0},{label:t("shell.workspaceHomeMetricChanges"),value:d.gitLoading?"…":d.changedFileCount??"—",accent:d.gitLoading===!1&&x(d.changedFileCount),onClick:i?Ce:void 0}],Me=[{label:t("shell.workspaceHomeWaitingInputLabel"),value:z.length,accent:x(z.length),onClick:S.length>0?_:void 0},{label:t("shell.workspaceHomeButlerLabel"),value:f.loading?"…":f.activeTaskCount,accent:f.loading===!1&&x(f.activeTaskCount),onClick:i?Te:void 0},{label:t("shell.workspaceHomeQuickLaunchStatusLabel"),value:Ne,accent:d.quickLaunchRunning===!0,onClick:i?Ie:void 0},{label:t("shell.butlerInboxAction"),value:f.loading?"…":f.pendingInboxCount,accent:f.loading===!1&&x(f.pendingInboxCount),onClick:i?()=>$(!0):void 0}];return e.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-home-page",children:[e.jsx(Oe,{currentWorkspace:I?{id:I.workspace.id,name:I.label,path:I.subtitle}:null,workspaces:u.map(o=>o.workspace),workspaceOptions:E,onSelectWorkspace:Ae,sheetContent:o=>e.jsxs("div",{className:"mobile-workspace-home-group mobile-workspace-home-sheet-group",children:[e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{o(),b("import")},children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.importWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}),e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{o(),b("clone")},children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.cloneWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]})]})}),i?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:[e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsx("div",{className:"mobile-workspace-home-metrics-card","aria-label":t("shell.workspaceHomeStatusSectionTitle"),children:e.jsx("div",{className:"mobile-workspace-home-toolbar-summary",children:Re.map(o=>o.onClick?e.jsxs("button",{type:"button",className:"mobile-workspace-home-toolbar-metric","data-accent":o.accent?"true":void 0,onClick:o.onClick,children:[e.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:o.value}),e.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:o.label})]},o.label):e.jsxs("div",{className:"mobile-workspace-home-toolbar-metric","data-accent":o.accent?"true":void 0,role:"listitem",children:[e.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:o.value}),e.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:o.label})]},o.label))})})}),e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsxs("div",{className:"mobile-workspace-home-primary-actions",children:[e.jsx("button",{type:"button",className:"secondary-button",onClick:ye,children:t("shell.workspaceDetailTitle")}),e.jsx("button",{type:"button",className:"primary-button",onClick:Z,children:t("shell.createSession")})]})}),e.jsx("section",{className:"mobile-workspace-home-section",children:e.jsx("div",{className:"mobile-workspace-home-group",children:Me.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row","data-accent":o.accent?"true":void 0,onClick:o.onClick,children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:o.label}),e.jsxs("span",{className:"mobile-workspace-home-row-trailing",children:[e.jsx("strong",{children:o.value}),e.jsx(k,{})]})]},o.label))})}),e.jsxs("section",{className:"mobile-workspace-home-section",children:[e.jsxs("div",{className:"mobile-workspace-home-section-header",children:[e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.workspaceHomeActiveSessionsSectionTitle")}),i?e.jsx("button",{type:"button",className:"mobile-workspace-home-link-button",onClick:_,children:t("shell.workspaceHomeViewAllAction")}):null]}),e.jsx("div",{className:"mobile-workspace-home-group",children:J.length===0?e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-empty-row",onClick:Z,children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:t("shell.createSession")}),e.jsx("span",{className:"mobile-workspace-home-session-meta",children:i.name})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}):J.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>n(te(i.id,o.sessionId)),children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:o.title||t("common.unknown")}),e.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[se(o.provider,"full")," · ",ce(le(o))]})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]},o.sessionId))})]}),Y.length>0?e.jsxs("section",{className:"mobile-workspace-home-section",children:[e.jsx("div",{className:"mobile-workspace-home-section-header",children:e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.favoriteSectionTitle")})}),e.jsx("div",{className:"mobile-workspace-home-group",children:Y.map(o=>e.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>n(te(i.id,o.sessionId)),children:[e.jsxs("div",{className:"mobile-workspace-home-session-main",children:[e.jsx("span",{className:"mobile-workspace-home-session-title",children:o.title||t("common.unknown")}),e.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[se(o.provider,"full")," · ",ce(le(o))]})]}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]},o.sessionId))})]}):null]})}):e.jsx("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:e.jsxs("section",{className:"mobile-workspace-home-section mobile-workspace-home-empty",children:[e.jsx("p",{className:"mobile-workspace-home-section-title",children:t("shell.workspaceHomeSwitcherTitle")}),e.jsxs("div",{className:"mobile-workspace-home-group",children:[e.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>b("import"),children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.importWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]}),e.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>b("clone"),children:[e.jsx("span",{className:"mobile-workspace-home-row-label",children:t("shell.cloneWorkspaceTitle")}),e.jsx("span",{className:"mobile-workspace-home-row-trailing",children:e.jsx(k,{})})]})]})]})}),e.jsx(Ue,{open:X==="import",onClose:()=>b(null),onImported:xe}),e.jsx(qe,{open:X==="clone",onClose:()=>b(null),onCloned:je}),e.jsx(oi,{open:we,workspaces:u.map(o=>o.workspace),workspaceOptions:E,initialWorkspaceId:(i==null?void 0:i.id)??O??null,onClose:()=>R(!1),onSelect:Le}),e.jsx(De,{open:ke,preferredWorkspaceId:(i==null?void 0:i.id)??null,compactComposer:!0,onClose:()=>$(!1)}),e.jsx(li,{open:ge,notifications:me,archivedNotificationIds:ue,showArchivedNotifications:he,onClose:()=>M(!1),onToggleShowArchivedNotifications:pe,onArchiveNotification:be,onUnarchiveNotification:fe,onSelectNotification:o=>{M(!1),o.routePath&&n(o.routePath)}})]})}function H(n){return`git-sidebar.snapshot.${n}`}function B(n){return`terminal-manager.snapshot.${n}`}function k(){return e.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}export{Ii as WorkspaceHomePage};
@@ -1 +1 @@
1
- import{e as d,h as a,i as u,k as c}from"./index-BilHJjYU.js";async function l(){const t=d.getState().platform==="web"?"web":"desktop";return await a.request(`/api/client/runtime-config?platform=${encodeURIComponent(t)}`)}async function g(){const n=d.getState(),t=u(n);if(!t)return;const s=await l(),r=p(s.relayTunnel);if(m(t.relayTunnel??null,r))return;const e=new Date().toISOString();if(c(t)){d.updateRuntime({discoveredHosts:n.discoveredHosts.map(i=>i.id===t.id?{...i,relayTunnel:r,updatedAt:e}:i)});return}await d.update({hosts:n.hosts.map(i=>i.id===t.id?{...i,relayTunnel:r,updatedAt:e}:i)})}function p(n){return!n||n.provider!=="codingns_relay"||!n.controlBaseUrl||!n.tunnelDomain||!n.bindingId?null:{provider:n.provider,enabled:n.enabled,controlBaseUrl:n.controlBaseUrl,tunnelDomain:n.tunnelDomain.trim().toLowerCase(),bindingId:n.bindingId,hostFingerprint:n.hostFingerprint,candidateEndpoints:n.candidateEndpoints}}function m(n,t){if(n===t)return!0;if(!n||!t)return n===t;if(n.provider!==t.provider||n.enabled!==t.enabled||n.controlBaseUrl!==t.controlBaseUrl||n.tunnelDomain!==t.tunnelDomain||(n.bindingId??null)!==(t.bindingId??null)||(n.hostFingerprint??null)!==(t.hostFingerprint??null))return!1;const s=n.candidateEndpoints??[],r=t.candidateEndpoints??[];return s.length!==r.length?!1:s.every((e,i)=>{const o=r[i];return e.endpointId===(o==null?void 0:o.endpointId)&&e.kind===o.kind&&e.url===o.url&&e.priority===o.priority&&e.expiresAt===o.expiresAt&&e.source===o.source})}export{l as fetchAuthenticatedClientRuntimeConfig,g as syncActiveHostAuthenticatedRuntimeConfig};
1
+ import{e as d,h as a,i as u,k as c}from"./index-BArTKWXk.js";async function l(){const t=d.getState().platform==="web"?"web":"desktop";return await a.request(`/api/client/runtime-config?platform=${encodeURIComponent(t)}`)}async function g(){const n=d.getState(),t=u(n);if(!t)return;const s=await l(),r=p(s.relayTunnel);if(m(t.relayTunnel??null,r))return;const e=new Date().toISOString();if(c(t)){d.updateRuntime({discoveredHosts:n.discoveredHosts.map(i=>i.id===t.id?{...i,relayTunnel:r,updatedAt:e}:i)});return}await d.update({hosts:n.hosts.map(i=>i.id===t.id?{...i,relayTunnel:r,updatedAt:e}:i)})}function p(n){return!n||n.provider!=="codingns_relay"||!n.controlBaseUrl||!n.tunnelDomain||!n.bindingId?null:{provider:n.provider,enabled:n.enabled,controlBaseUrl:n.controlBaseUrl,tunnelDomain:n.tunnelDomain.trim().toLowerCase(),bindingId:n.bindingId,hostFingerprint:n.hostFingerprint,candidateEndpoints:n.candidateEndpoints}}function m(n,t){if(n===t)return!0;if(!n||!t)return n===t;if(n.provider!==t.provider||n.enabled!==t.enabled||n.controlBaseUrl!==t.controlBaseUrl||n.tunnelDomain!==t.tunnelDomain||(n.bindingId??null)!==(t.bindingId??null)||(n.hostFingerprint??null)!==(t.hostFingerprint??null))return!1;const s=n.candidateEndpoints??[],r=t.candidateEndpoints??[];return s.length!==r.length?!1:s.every((e,i)=>{const o=r[i];return e.endpointId===(o==null?void 0:o.endpointId)&&e.kind===o.kind&&e.url===o.url&&e.priority===o.priority&&e.expiresAt===o.expiresAt&&e.source===o.source})}export{l as fetchAuthenticatedClientRuntimeConfig,g as syncActiveHostAuthenticatedRuntimeConfig};
@@ -1 +1 @@
1
- import{h as n}from"./index-BilHJjYU.js";function u(){return n.request("/api/peer-hosts")}function d(e){return n.request("/api/peer-hosts",{method:"POST",body:JSON.stringify(e)})}function h(e,t){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function f(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}function m(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/check`,{method:"POST"})}function l(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/reconnect`,{method:"POST"})}function H(e,t){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/login`,{method:"POST",body:JSON.stringify(t)})}function S(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/session`,{method:"DELETE"})}function C(){return n.request("/api/peer-hosts/workspace-bindings")}function T(e,t){return n.request(`/api/peer-hosts/workspace-bindings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}const r=4,i="HOST",s=["#0EA5E9","#22C55E","#F59E0B","#EC4899","#8B5CF6","#14B8A6","#F97316","#6366F1"];function a(e){var o;const t=(o=e==null?void 0:e.match(/[A-Za-z]/g))==null?void 0:o.join("").toUpperCase().slice(0,r);return t||i}function g(e){return e?{label:a(e.alias||e.name),color:s[c(e.id)%s.length]}:null}function c(e){let t=0;for(const o of e)t=t*31+o.charCodeAt(0)>>>0;return t}export{H as a,d as b,m as c,f as d,S as e,l as f,C as g,u as l,a as n,g as r,T as s,h as u};
1
+ import{h as n}from"./index-BArTKWXk.js";function u(){return n.request("/api/peer-hosts")}function d(e){return n.request("/api/peer-hosts",{method:"POST",body:JSON.stringify(e)})}function h(e,t){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function f(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}function m(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/check`,{method:"POST"})}function l(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/reconnect`,{method:"POST"})}function H(e,t){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/login`,{method:"POST",body:JSON.stringify(t)})}function S(e){return n.request(`/api/peer-hosts/${encodeURIComponent(e)}/session`,{method:"DELETE"})}function C(){return n.request("/api/peer-hosts/workspace-bindings")}function T(e,t){return n.request(`/api/peer-hosts/workspace-bindings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}const r=4,i="HOST",s=["#0EA5E9","#22C55E","#F59E0B","#EC4899","#8B5CF6","#14B8A6","#F97316","#6366F1"];function a(e){var o;const t=(o=e==null?void 0:e.match(/[A-Za-z]/g))==null?void 0:o.join("").toUpperCase().slice(0,r);return t||i}function g(e){return e?{label:a(e.alias||e.name),color:s[c(e.id)%s.length]}:null}function c(e){let t=0;for(const o of e)t=t*31+o.charCodeAt(0)>>>0;return t}export{H as a,d as b,m as c,f as d,S as e,l as f,C as g,u as l,a as n,g as r,T as s,h as u};