agentroam-runtime-darwin-arm64 0.2.0-preview.70 → 0.2.0-preview.71
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.
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +8 -8
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +3 -3
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +1 -1
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +4 -4
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +2 -2
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +3 -3
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +3 -3
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +4 -4
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +33 -33
- package/runtime/.next/server/chunks/5303.js +2 -2
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/pages/404.html +1 -1
- package/runtime/.next/server/pages/500.html +1 -1
- package/runtime/.next/server/server-reference-manifest.json +1 -1
- package/runtime/.next/static/chunks/app/web/{error-3acef50d100c88cd.js → error-6470e38a145095eb.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-ecfb758d244808a4.js +1 -0
- package/runtime/.next/static/chunks/app/web/{page-cd202c384ebf79be.js → page-27145471bd2171c2.js} +1 -1
- package/runtime/.next/static/chunks/{main-app-1722010a0ff567d7.js → main-app-41078426602904fd.js} +1 -1
- package/runtime/lib/tunnel-control.mjs +32 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
- package/runtime/node_modules/.package-lock.json +20 -20
- package/runtime/node_modules/@agent/core/dist/index.js +13 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +75 -73
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +42 -40
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-07pvccxf.mjs +43 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-kzw924e6.mjs → core-0rjxgk9e.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-fpeb751h.mjs +33 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-bb8r6h44.mjs → core-jf0rbr11.mjs} +1 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +9 -9
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +19 -21
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +23 -25
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +14 -14
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +61 -57
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +29701 -29485
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +20 -20
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +20 -20
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +29701 -29485
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +28904 -28688
- package/runtime/node_modules/mediabunny/dist/modules/src/codec-data.js +6 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/codec.js +35 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/conversion.js +90 -13
- package/runtime/node_modules/mediabunny/dist/modules/src/id3.js +6 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js +23 -3
- package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +12 -3
- package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-misc.js +1 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +29 -6
- package/runtime/node_modules/mediabunny/dist/modules/src/matroska/ebml.js +9 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +10 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-muxer.js +16 -2
- package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +59 -36
- package/runtime/node_modules/mediabunny/dist/modules/src/metadata.js +5 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/output-format.js +10 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/sample.js +1 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/wave/wave-muxer.js +1 -0
- package/runtime/node_modules/mediabunny/package.json +1 -1
- package/runtime/node_modules/mediabunny/src/codec-data.ts +4 -0
- package/runtime/node_modules/mediabunny/src/codec.ts +38 -0
- package/runtime/node_modules/mediabunny/src/conversion.ts +128 -16
- package/runtime/node_modules/mediabunny/src/id3.ts +4 -0
- package/runtime/node_modules/mediabunny/src/isobmff/isobmff-boxes.ts +24 -4
- package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +18 -3
- package/runtime/node_modules/mediabunny/src/isobmff/isobmff-misc.ts +2 -0
- package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +39 -7
- package/runtime/node_modules/mediabunny/src/matroska/ebml.ts +11 -0
- package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +11 -0
- package/runtime/node_modules/mediabunny/src/matroska/matroska-muxer.ts +20 -2
- package/runtime/node_modules/mediabunny/src/media-source.ts +77 -52
- package/runtime/node_modules/mediabunny/src/metadata.ts +13 -0
- package/runtime/node_modules/mediabunny/src/output-format.ts +13 -1
- package/runtime/node_modules/mediabunny/src/sample.ts +1 -1
- package/runtime/node_modules/mediabunny/src/version.ts +1 -1
- package/runtime/node_modules/mediabunny/src/wave/wave-muxer.ts +2 -1
- package/runtime/node_modules/tslib/README.md +3 -8
- package/runtime/node_modules/tslib/package.json +1 -1
- package/runtime/node_modules/tslib/tslib.es6.js +10 -1
- package/runtime/node_modules/tslib/tslib.es6.mjs +10 -1
- package/runtime/node_modules/tslib/tslib.js +10 -1
- package/runtime/node_modules/ws/README.md +21 -29
- package/runtime/node_modules/ws/lib/buffer-util.js +13 -2
- package/runtime/node_modules/ws/lib/sender.js +4 -1
- package/runtime/node_modules/ws/lib/websocket.js +8 -3
- package/runtime/node_modules/ws/package.json +1 -1
- package/runtime/package-lock.json +44 -44
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{AiHubPane-BQ8CJAQL.js → AiHubPane-Cp_tNJNR.js} +1 -1
- package/runtime/webapp/dist/assets/App-Cs8U1u-X.js +175 -0
- package/runtime/webapp/dist/assets/App-QWoPBMW0.css +1 -0
- package/runtime/webapp/dist/assets/{BrowserLivePanel-DxhSUu4j.js → BrowserLivePanel-B1zYRS_7.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationDashboard-c_iNusPf.js → CollaborationDashboard-DIVa26zk.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationPage-DRBPK_iH.js → CollaborationPage-Fsvkw8ZM.js} +1 -1
- package/runtime/webapp/dist/assets/{FilePreview-DScFSi_K.js → FilePreview-BjbfWw2s.js} +3 -3
- package/runtime/webapp/dist/assets/{FileTree-BB5xTMg6.js → FileTree-C6gg9p4m.js} +1 -1
- package/runtime/webapp/dist/assets/{FlowStudioPane-BBf0zyw1.js → FlowStudioPane-CCuxZBVJ.js} +1 -1
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-CWW4T1QF.js → RemoteDesktopPage-DpoYuKhA.js} +1 -1
- package/runtime/webapp/dist/assets/SessionDashboard-CAoW5-uN.css +1 -0
- package/runtime/webapp/dist/assets/SessionDashboard-DOWjUIY1.js +26 -0
- package/runtime/webapp/dist/assets/SessionDashboardBridge-DYsMZhuH.js +1 -0
- package/runtime/webapp/dist/assets/{TerminalPane-DkEyD1ge.js → TerminalPane-CPOiBcye.js} +1 -1
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-Dlsyu96y.js → abnfDiagram-VCTEODGH-DCFFqJUU.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-D0AvBRtK.js → arc-vjNW9DYV.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BLAHjBcI.js → architectureDiagram-5GKGNRK7-DoK3A_n1.js} +1 -1
- package/runtime/webapp/dist/assets/{arrow-right-B15rGLIR.js → arrow-right-B0uCZ1Pd.js} +1 -1
- package/runtime/webapp/dist/assets/{artifact-links-BkoUldDR.js → artifact-links-nzx7joYs.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-CqIb0xz-.js → blockDiagram-I7D4REHJ-DgXszyX7.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-CG98ZTHr.js → c4Diagram-7LVT6UL2-q7KO4v1Q.js} +1 -1
- package/runtime/webapp/dist/assets/channel-CsnhvX8S.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-DQh8kgcp.js → chunk-2Q5K7J3B-CH8lOKmL.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-BesfCxeX.js → chunk-5VM5RSS4-DwP7xEWd.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-BCXEjgx-.js → chunk-F27PBJKO-BV3TTaxI.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-ydMd7mT-.js → chunk-IMKFNOWR-BbaiG4yG.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-K3_myO-F.js → chunk-JWPE2WC7-Dv9x27hI.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-BtqLafwd.js → chunk-POPQ4Y6H-Uk-GiSLP.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-mKZUbHcv.js → chunk-SVP7TREG-lFcKEwyL.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-hDH9_eNh.js → chunk-TICWLB2K-DFZALWPC.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-B6wXA24N.js → chunk-XXDRQBXY-8jLPZkMb.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-Bed40USf.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-Bed40USf.js +1 -0
- package/runtime/webapp/dist/assets/{clipboard-CrmYgzo8.js → clipboard-BteN9-AC.js} +1 -1
- package/runtime/webapp/dist/assets/{codeSyntax-KyRYSqw_.js → codeSyntax-Dgv0FfoZ.js} +1 -1
- package/runtime/webapp/dist/assets/{collaboration-B7rPFZje.js → collaboration-f29NaKWy.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-MoeyZZ6x.js → cose-bilkent-JH36ORCC-86P-lxD4.js} +1 -1
- package/runtime/webapp/dist/assets/{crown-BKylWZLt.js → crown-y1qmM0NZ.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BWYtTqVq.js → cynefin-OW5HDTMX-mtRVdchl.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-CoqnJ7eo.js → cynefinDiagram-5FMLGOSQ-DhqAIoq6.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-DMwZ_7F7.js → dagre-GXQ25YYZ-DD9olCTy.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-DJ2BAyzP.js → diagram-S7CK7UJ4-CLGKipLp.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-ChujnpjG.js → diagram-UQ7AKVKN-Dm7uGpUO.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-CDSAKYID.js → diagram-VSXAHHWV-OZYfwAth.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DXvCy8w-.js → diagram-VX7I27RA-BpQqNFxQ.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-BWrKegI9.js → diagram-Z3DM3KII-BrWsMYCU.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-CqDhPmpp.js → ebnfDiagram-PWID7BFC-BRH-K-J7.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-D5HR9ddP.js → erDiagram-RLTQ6QDP-BDNSVr6H.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-D_egQYAD.js → file-types-XHMBkbNr.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-Bz89eEJ2.js → flowDiagram-HODETNUW-DseLK02Y.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-Bw1lo_RG.js → ganttDiagram-EL5Y4UJY-v_uNZx1g.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-CMxwIm3p.js → gitGraphDiagram-WWUBYQGX-EdvVYEMk.js} +1 -1
- package/runtime/webapp/dist/assets/{index-CkVSxxim.js → index--zKd3rTs.js} +49 -49
- package/runtime/webapp/dist/assets/{index-6B8SDnzK.css → index-D0gsdpeQ.css} +1 -1
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DEWyQUst.js → infoDiagram-27XIBGKW-Ck26xp1i.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-BfJdGhe_.js → ishikawaDiagram-5VMMS53U-DGnOVObq.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-C6gh2ejc.js → journeyDiagram-3NMN7TZE-S7oKAQs8.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-1UHi9Lfv.js → kanban-definition-UXKFOSKX-DcrYA4VY.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-CKq-cSTm.js → layout-CYHINS_I.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-DF4sJk10.js → linear-B-lEfto_.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-Dpjix4wZ.js → loader-circle-DMWQZenY.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-OAHUFl3p.js → mermaid.core-B3fzlEw9.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-JiyyEKeC.js → mindmap-definition-YA3MSWOX-wJkCh55V.js} +1 -1
- package/runtime/webapp/dist/assets/{page-DqgtSgo3.js → page-Cc56wyOt.js} +8 -13
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-CpBwPi33.js → pegDiagram-XKGWAZYB-H4uk2OUO.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-BjM_PcYH.js → pieDiagram-E7YTZNPT-yLnU_MCb.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-Vdz77obz.js → quadrantDiagram-AXDQQJYC-DyD93O4P.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-DsQjNf1f.js → railroadDiagram-O6MQD6OU-DZ833xbw.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-TpfT8TjT.js → requirementDiagram-BXWQKSXE-DJV4nGui.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-ccw-wJiVuYlm.js → rotate-ccw-CKqo62Ra.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-CtpBETpM.js → rotate-cw-D-M3ZDSa.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-Ckh_skQw.js → sankeyDiagram-P5KCCOFB-BeOYMFTR.js} +1 -1
- package/runtime/webapp/dist/assets/{send-DL0qj0xE.js → send-LvtpJMkk.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-CkKC0JEA.js → sequenceDiagram-WJ2MYXX4-BBcgqG33.js} +1 -1
- package/runtime/webapp/dist/assets/{shield-check-B5q8YhWs.js → shield-check-SeEkz1Nd.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-DB_NzdXU.js → sizeCapture-INFHLROL-B0GJZjw0.js} +1 -1
- package/runtime/webapp/dist/assets/{smartphone-DJEfFl42.js → smartphone-D7oS3YTz.js} +11 -6
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-Ch2r76jY.js → stateDiagram-D77RDMKH-BmSvB3vd.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-CQ9wpJCJ.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-BBMlDhHH.js → swimlanes-42K2YHIH-BAZdMUD6.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-8XTJp3Fr.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-BELJuISI.js → timeline-definition-24CTP7MA-BSgVFMNG.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-D4LqA3q5.js → trash-2-CHYPyYDY.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-NSlXdmyy.js → vennDiagram-4TSXK5OY-C-brvbkB.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-BVbNDhZr.js → wardleyDiagram-VM6X3IG4-CeqqVR1s.js} +1 -1
- package/runtime/webapp/dist/assets/{web-CoxxvfFh.js → web-Dzd7NW_F.js} +1 -1
- package/runtime/webapp/dist/assets/{web-BpA_VIiS.js → web-aLPH3xFw.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-Bt3XghTc.js → xychartDiagram-S5SC5T6Z-mPizwpXM.js} +1 -1
- package/runtime/webapp/dist/index.html +2 -2
- package/runtime/ws-server.mjs +4 -0
- package/runtime/.next/static/chunks/app/web/layout-8ec7c101bbab1dc2.js +0 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-a9vq6p1m.mjs +0 -31
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-t4mxrz5y.mjs +0 -43
- package/runtime/webapp/dist/assets/App-CdrKKs1h.css +0 -1
- package/runtime/webapp/dist/assets/App-GXFFBAhW.js +0 -174
- package/runtime/webapp/dist/assets/SessionDashboard-BdGlakPd.js +0 -26
- package/runtime/webapp/dist/assets/SessionDashboard-CUCEDkCI.css +0 -1
- package/runtime/webapp/dist/assets/SessionDashboardBridge-8zrk0Bub.js +0 -1
- package/runtime/webapp/dist/assets/channel-Bw3F6pJc.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-By2XJYuW.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-By2XJYuW.js +0 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-BCjtOHJv.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CYzCynNs.js +0 -8
- /package/runtime/.next/static/{Ow_KjPn75TzR7WqdD4P9x → mGwTFWK2dzlY3HjsjZGzh}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{Ow_KjPn75TzR7WqdD4P9x → mGwTFWK2dzlY3HjsjZGzh}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mermaid-block{min-width:0;max-width:100%;margin:8px 0;overflow:hidden;border:1px solid var(--border-subtle);border-radius:var(--radius-sm);background:var(--bg-surface);white-space:normal}.mermaid-block-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 10px;border-bottom:1px solid var(--border-subtle);background:var(--bg-deep);color:var(--text-muted);font-family:var(--font-mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.07em}.mermaid-block-header button{padding:4px 8px;border:1px solid var(--border-subtle);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--text-secondary);font:inherit;cursor:pointer}.mermaid-block-status{padding:8px 12px;color:var(--text-muted);font-size:12px}.mermaid-block-source{max-height:420px;margin:0;padding:10px 12px;overflow:auto;color:var(--text-secondary);font-family:var(--font-mono);font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.mermaid-block-preview{max-height:420px;min-width:0;padding:12px;overflow:auto;background:#fff;color:#222;color-scheme:light;touch-action:pan-x pan-y;cursor:grab}.mermaid-block-preview:active{cursor:grabbing}.mermaid-diagram-canvas{margin:0 auto;flex-shrink:0}.mermaid-diagram-canvas>svg{display:block;width:100%!important;height:100%!important;max-width:none!important;-webkit-user-select:none;user-select:none}.mermaid-viewer{min-width:0}.mermaid-toolbar{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:4px;padding:4px 8px;border-bottom:1px solid var(--border-subtle);background:var(--bg-surface)}.mermaid-control{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text-secondary);cursor:pointer;touch-action:manipulation}.mermaid-control:hover:not(:disabled){border-color:var(--border-subtle);background:var(--bg-deep)}.mermaid-control:disabled{opacity:.35;cursor:default}.mermaid-control:focus-visible,.mermaid-diagram-canvas:focus-visible,.mermaid-block-preview:focus-visible{outline:2px solid var(--accent, #526dff);outline-offset:-2px}.mermaid-zoom-value{min-width:38px;color:var(--text-muted);font:11px var(--font-mono);text-align:center;font-variant-numeric:tabular-nums}.mermaid-viewer-hint{padding:5px 12px;border-top:1px solid var(--border-subtle);color:var(--text-muted);font-size:11px;text-align:center}.mermaid-dialog{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;flex-direction:column;width:100%;height:100%;height:100dvh;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden;background:var(--bg-surface);color:var(--text-primary);white-space:normal}.mermaid-dialog-header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;min-height:48px;padding:4px 12px;border-bottom:1px solid var(--border-subtle);font-size:14px}.mermaid-viewer-fullscreen{display:flex;flex:1;flex-direction:column;min-height:0}.mermaid-viewer-fullscreen .mermaid-block-preview{flex:1;min-height:0;max-height:none;overscroll-behavior:contain}.mermaid-export-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:12px;color:var(--text-secondary);font-size:12px}.mermaid-export-actions a{padding:10px 14px;border-radius:8px;background:var(--accent, #526dff);color:#fff;text-decoration:none}.mermaid-export-preview{flex:1;min-height:0;padding:12px;overflow:auto;background:#e9ecf2}.mermaid-export-preview img{display:block;width:auto;max-width:100%;height:auto;margin:auto;background:#fff}.tunnel-connection{margin:16px 0;padding:12px;border:1px solid var(--border-default, #30434d);border-radius:10px;text-align:left;font-size:13px}.tunnel-connection-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}.tunnel-connection-heading span{display:inline-flex;align-items:center;gap:6px}.tunnel-connection-heading button{padding:6px 10px;border:1px solid var(--border-default, #405662);border-radius:7px;background:var(--bg-elevated, #1b2d37);color:inherit;cursor:pointer;font:inherit}.tunnel-connection-heading button:disabled{opacity:.55;cursor:default}.tunnel-connection .tunnel-connected{color:var(--text-success, #29a985)}.tunnel-connection p{margin:8px 0 0;font-size:12px;line-height:1.6;color:var(--text-secondary, #9eafb8)}.tunnel-connection p[role=alert]{color:var(--text-warning, #c9923d)}.tunnel-spin{animation:tunnel-spin 1s linear infinite}@keyframes tunnel-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.tunnel-spin{animation:none}}.all-sessions-search input{width:100%;min-width:0;border:0;outline:none;background:transparent;color:var(--text-primary);font:inherit}.all-sessions-search input::placeholder{color:var(--text-muted)}.all-sessions-sort-label{color:var(--text-muted);font-size:11px;white-space:nowrap}.all-sessions-list{min-height:0;flex:1;overflow:auto;padding:0 10px 12px}.sidebar-session-agent{display:inline-flex;flex-shrink:0;margin-left:auto;color:var(--text-secondary)}.all-sessions-list .sidebar-session-button{min-width:0}.all-sessions-list .sidebar-session-row{min-height:40px}.all-sessions-empty{padding:20px 10px;color:var(--text-muted);font-size:12px;text-align:center}.all-sessions-more{width:100%;padding:12px;border:0;background:transparent;color:var(--text-muted);cursor:pointer}.app-sidebar.has-agent-navigation{display:grid!important;grid-template-columns:56px minmax(0,1fr);grid-template-rows:66px auto auto minmax(0,1fr) auto;grid-template-areas:"agent-header agent-header" "agent-rail search" "agent-rail toolbar" "agent-rail sessions" "footer footer"}.has-agent-navigation>.sidebar-agent-header{grid-area:agent-header}.has-agent-navigation>.agent-workspace-switcher{grid-area:agent-rail}.has-agent-navigation>.sidebar-search-field{grid-area:search}.has-agent-navigation>.sidebar-project-toolbar{grid-area:toolbar}.has-agent-navigation>.app-sidebar-scroll{grid-area:sessions;min-width:0;min-height:0}.has-agent-navigation>.sidebar-bottom-action{grid-area:footer}.sidebar-agent-header{display:flex;align-items:center;gap:10px;min-width:0;padding:8px 14px 12px;border-bottom:0;color:var(--text-primary);-webkit-app-region:no-drag}.sidebar-agent-header-icon{display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:11px;color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent)}.sidebar-agent-header-identity{flex:1;min-width:0}.sidebar-agent-header-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;font-weight:600;letter-spacing:-.35px}.sidebar-agent-header-status{display:flex;align-items:center;gap:5px;margin-top:3px;color:var(--text-muted);font-size:11px}.sidebar-agent-header-status>i{width:5px;height:5px;border-radius:50%;background:var(--text-muted)}.sidebar-agent-header-status.is-ready>i{background:var(--success, #219274)}.sidebar-agent-header-status.is-unavailable>i{background:var(--warning, #c89137)}.sidebar-agent-header-close{flex-shrink:0}.has-agent-navigation>.agent-workspace-switcher.is-vertical{min-height:0;align-self:stretch;margin:0;padding:14px 7px;overflow-y:auto;overscroll-behavior:contain;border-right:1px solid var(--border-subtle);background:color-mix(in srgb,var(--bg-deepest) 65%,transparent);scrollbar-width:none}.has-agent-navigation .agent-workspace-switcher.is-vertical .agent-workspace-track{flex-shrink:0}.has-agent-navigation .agent-workspace-switcher.is-vertical .agent-workspace-more{display:none}.has-agent-navigation .agent-workspace-switcher.is-vertical button{min-width:40px;max-width:40px;height:42px;padding:8px;border-radius:12px}.has-agent-navigation .agent-workspace-switcher.is-vertical button.is-active{background:color-mix(in srgb,var(--accent) 9%,var(--bg-surface))}.has-agent-navigation>.sidebar-search-field{min-width:0;margin-top:12px;margin-left:12px;margin-right:12px}.has-agent-navigation>.sidebar-project-toolbar{min-width:0;padding-left:14px;padding-right:12px}body[data-web-shell-embedded="1"] .chat-header-action--navigation-layout{display:none}.header-action-menu-trigger{flex-shrink:0;border-radius:12px;-webkit-app-region:no-drag}.header-action-menu-trigger[aria-expanded=true]{background:var(--bg-hover);color:var(--text-primary)}.header-action-menu-panel{z-index:140;box-sizing:border-box;width:max-content;max-width:min(260px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow-y:auto;padding:10px;color:var(--text-primary);border:1px solid var(--border-subtle);border-radius:18px;background:color-mix(in srgb,var(--bg-surface) 88%,transparent);backdrop-filter:blur(22px) saturate(1.2);-webkit-backdrop-filter:blur(22px) saturate(1.2);box-shadow:0 8px 28px #29434e26;-webkit-app-region:no-drag}.header-action-menu-panel[hidden]{display:none}.header-action-menu-panel :is(.chat-header-actions,.desktop-app-actions){display:flex;flex-wrap:wrap;max-width:238px;gap:6px}.header-action-menu-panel .desktop-app-actions{margin-left:0}.header-action-menu-panel .ui-icon-button{width:44px;height:44px;border-radius:12px}.header-action-menu-panel .ui-icon-button svg{width:20px;height:20px}@media (pointer: coarse){.has-agent-navigation .agent-workspace-switcher.is-vertical button{min-height:44px}.sidebar-agent-header-close,.header-action-menu-trigger{min-width:44px;min-height:44px}}
|
package/runtime/webapp/dist/assets/{BrowserLivePanel-DxhSUu4j.js → BrowserLivePanel-B1zYRS_7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var en=i=>{throw TypeError(i)};var zn=(i,n,l)=>n.has(i)||en("Cannot "+l);var tn=(i,n,l)=>n.has(i)?en("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(i):n.set(i,l);var nn=(i,n,l)=>(zn(i,n,"access private method"),l);import{c as V,j as o,d as Dn,r as s,B as Nn,e as St,m as rn,X as Fn}from"./index
|
|
1
|
+
var en=i=>{throw TypeError(i)};var zn=(i,n,l)=>n.has(i)||en("Cannot "+l);var tn=(i,n,l)=>n.has(i)?en("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(i):n.set(i,l);var nn=(i,n,l)=>(zn(i,n,"access private method"),l);import{c as V,j as o,d as Dn,r as s,B as Nn,e as St,m as rn,X as Fn}from"./index--zKd3rTs.js";import{L as G}from"./loader-circle-DMWQZenY.js";import{r as In,E as Vn}from"./clipboard-BteN9-AC.js";import{R as qn}from"./rotate-ccw-CKqo62Ra.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,e as q,j as e,X as _,R as J,P as ee,A as Y,f as H,g as te,d as Q,u as ae}from"./index-CkVSxxim.js";import{C as se,a as le,b as re}from"./CollaborationTabBridge-Dxq4G1Uk.js";import{F as ne,D as oe,P as ce,a as ie,b as de,c as he,d as ue,N as je,e as be,f as me,g as xe,h as pe,i as V,j as fe,S as X}from"./file-types-D_egQYAD.js";import{A as ge,C as ve,F as ye,P as we,T as Ne}from"./trash-2-D4LqA3q5.js";import{c as F,A as L,U as K}from"./collaboration-B7rPFZje.js";import{C as Z}from"./crown-BKylWZLt.js";import{p as ke}from"./SessionDashboardBridge-8zrk0Bub.js";import{A as Ce}from"./arrow-right-B15rGLIR.js";const Se=["customer-agent","codex","claude-code","opencode","deepseek-harness"],Ee={folder:{icon:V,label:"文件夹"},code:{icon:pe,label:"代码文件"},style:{icon:ee,label:"样式文件"},image:{icon:xe,label:"图片文件"},video:{icon:me,label:"视频文件"},audio:{icon:be,label:"音频文件"},markdown:{icon:je,label:"Markdown 文件"},text:{icon:ue,label:"文本文件"},json:{icon:he,label:"JSON 文件"},archive:{icon:de,label:"压缩文件"},spreadsheet:{icon:ie,label:"表格文件"},presentation:{icon:ce,label:"演示文件"},database:{icon:oe,label:"数据库文件"},file:{icon:ne,label:"文件"}};function Te(a,s){return s==="directory"?"folder":fe(a)}const M=a=>a.replace(/\\/g,"/").replace(/\/+$/,"")||"/";function Ae(a,s){for(const v of s){if(!(v!=null&&v.trim()))continue;const p=M(v);if(p.split("/").some(u=>u==="."||u===".."))continue;const x=a.map(M).filter(u=>p===u||p.startsWith(u==="/"?"/":`${u}/`)).sort((u,j)=>j.length-u.length)[0];if(x)return{root:x,current:p}}const i=a[0]?M(a[0]):"";return{root:i,current:i}}function De(a,s){const i=M(a),v=M(s),x=[{label:i==="/"?"/":i.split("/").filter(Boolean).pop()||i,path:i}];if(v===i)return x;const u=v.slice(i==="/"?1:i.length+1);let j=i;for(const d of u.split("/").filter(Boolean))j=j==="/"?`/${d}`:`${j}/${d}`,x.push({label:d,path:j});return x}function $e({open:a,initialPath:s,onCancel:i,onConfirm:v}){const[p,x]=o.useState([]),[u,j]=o.useState(""),[d,b]=o.useState(""),[w,r]=o.useState([]),[h,f]=o.useState(!1),[k,y]=o.useState(""),[n,m]=o.useState(!1),[S,N]=o.useState(!1),T=o.useMemo(()=>u&&d?De(u,d):[],[u,d]),E=async t=>{if(window.agentApi){f(!0),N(!1),y(""),b(t),r([]);try{const g=await window.agentApi.listProjectDirectories(t);r(g),N(!0)}catch(g){y(g instanceof Error?g.message:"无法读取目录")}finally{f(!1)}}};if(o.useEffect(()=>{if(!a||!window.agentApi)return;let t=!1;return f(!0),y(""),j(""),b(""),N(!1),r([]),window.agentApi.getProjectPickerLocation().then(async({roots:g,initialPath:$})=>{if(t)return;x(g);const I=Ae(g,[s,$]);j(I.root),I.current?await E(I.current):y("未配置可用的宿主机目录")}).catch(g=>{t||y(g instanceof Error?g.message:"无法读取宿主机目录")}).finally(()=>{t||f(!1)}),()=>{t=!0}},[a,s]),o.useEffect(()=>{if(!a)return;const t=g=>{g.key==="Escape"&&i()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a,i]),!a)return null;const A=t=>{j(t),E(t)},D=()=>{T.length<=1||E(T[T.length-2].path)},l=async()=>{if(!(!d||!S||n)){m(!0),y("");try{await v(d)}catch(t){y(t instanceof Error?t.message:"项目导入失败")}finally{m(!1)}}};return q.createPortal(e.jsx("div",{className:"host-project-picker-backdrop",role:"presentation",onMouseDown:t=>{t.target===t.currentTarget&&i()},children:e.jsxs("section",{className:"host-project-picker",role:"dialog","aria-modal":"true","aria-labelledby":"host-project-picker-title",children:[e.jsxs("header",{className:"host-project-picker-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"host-project-picker-title",children:"选择宿主机项目"}),e.jsx("p",{children:"文件将直接在运行 AgentRoam 的机器上读写"})]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:i,"aria-label":"关闭目录选择器",title:"关闭",children:e.jsx(_,{size:16,"aria-hidden":"true"})})]}),p.length>1&&e.jsxs("label",{className:"host-project-picker-root",children:[e.jsx("span",{children:"根目录"}),e.jsx("select",{value:u,onChange:t=>A(t.target.value),children:p.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("nav",{className:"host-project-picker-nav","aria-label":"当前目录",children:[e.jsx("button",{type:"button",className:"ui-icon-button",onClick:D,disabled:T.length<=1,"aria-label":"返回上级目录",title:"返回上级目录",children:e.jsx(ge,{size:16,"aria-hidden":"true"})}),e.jsxs("div",{className:"host-project-picker-breadcrumbs",children:[!d&&e.jsx("span",{children:h?"正在定位工作目录…":"未能加载工作目录"}),T.map((t,g)=>e.jsxs("span",{children:[g>0&&e.jsx("i",{children:"/"}),e.jsx("button",{type:"button",onClick:()=>void E(t.path),children:t.label})]},t.path))]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>d&&void E(d),disabled:!d||h,"aria-label":"刷新目录",title:"刷新目录",children:e.jsx(J,{size:15,"aria-hidden":"true"})})]}),u==="/"&&e.jsx("div",{className:"host-project-picker-warning",children:"当前允许访问宿主机根目录,请谨慎选择项目。"}),e.jsx("div",{className:"host-project-picker-list","aria-busy":h,children:h?e.jsx("div",{className:"host-project-picker-state",children:"正在读取目录…"}):k?e.jsx("div",{className:"host-project-picker-state is-error",children:k}):w.length===0?e.jsx("div",{className:"host-project-picker-state",children:"此目录为空"}):w.map(t=>{const g=Te(t.name,t.kind),{icon:$,label:I}=Ee[g],B=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`host-project-picker-entry-icon is-${g}`,"aria-hidden":"true",children:e.jsx($,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"host-project-picker-name",children:t.name})]});return t.kind==="file"?e.jsx("div",{className:"host-project-picker-row is-file",title:I,children:B},`${t.name}:${t.path}`):e.jsxs("button",{type:"button",className:"host-project-picker-row is-directory",onClick:()=>void E(t.path),title:I,children:[B,t.hasChildren&&e.jsx("span",{className:"host-project-picker-chevron","aria-hidden":"true",children:e.jsx(ve,{size:16})})]},`${t.name}:${t.path}`)})}),e.jsxs("footer",{className:"host-project-picker-footer",children:[e.jsx("code",{title:d,children:d}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"host-project-picker-cancel",onClick:i,children:"取消"}),e.jsx("button",{type:"button",className:"host-project-picker-confirm",disabled:!d||!S||h||n,onClick:()=>void l(),children:n?"正在导入…":"选择此文件夹"})]})]})]})}),document.body)}function Ie(a,s){return[...new Map([...a,...s].map(i=>[i.id,i])).values()]}function ze({value:a,onChange:s}){const[i,v]=o.useState(""),[p,x]=o.useState({data:[],nextCursor:null,total:0}),[u,j]=o.useState(!0),[d,b]=o.useState(""),[w,r]=o.useState(0),h=o.useRef(0),f=o.useRef(!1);o.useEffect(()=>{const n=++h.current;let m=!0;f.current=!0,j(!0),b(""),x({data:[],nextCursor:null,total:0});const S=setTimeout(()=>{F({action:"sessionCatalog",query:i,limit:20}).then(N=>{m&&n===h.current&&x(N)}).catch(N=>{m&&n===h.current&&b(N instanceof Error?N.message:"无法加载会话")}).finally(()=>{m&&n===h.current&&(f.current=!1,j(!1))})},i?200:0);return()=>{m=!1,clearTimeout(S)}},[i,w]);const k=async()=>{if(f.current||!p.nextCursor)return;const n=h.current;f.current=!0,j(!0),b("");try{const m=await F({action:"sessionCatalog",query:i,limit:20,cursor:p.nextCursor});n===h.current&&x(S=>({...m,data:Ie(S.data,m.data)}))}catch(m){n===h.current&&b(m instanceof Error?m.message:"加载更多失败")}finally{n===h.current&&(f.current=!1,j(!1))}},y=new Set(a.map(n=>n.id));return e.jsxs("section",{className:"collab-monitor-picker","aria-label":"关联原始会话",children:[e.jsx("div",{className:"collab-monitor-heading",children:e.jsxs("strong",{children:["关联原始会话 ",e.jsxs("small",{children:["选填 · 已选 ",a.length]})]})}),e.jsx("p",{className:"collab-muted",children:"运行中的在前。关联后作为监控对象,恢复或交接时才介入。"}),a.length>0&&e.jsx("div",{className:"collab-monitor-selected","aria-label":"已选会话",children:a.map(n=>e.jsxs("span",{title:`${L[n.agentType]} · ${n.cwd}`,children:[e.jsx(Y,{agentType:n.agentType,size:14}),e.jsx("span",{children:n.title}),e.jsx("button",{type:"button","aria-label":`取消关联${n.title}`,onClick:()=>s(a.filter(m=>m.id!==n.id)),children:e.jsx(_,{size:13})})]},n.id))}),e.jsxs("label",{className:"collab-monitor-search",children:[e.jsx(X,{size:15}),e.jsx("input",{"aria-label":"搜索所有原始会话",placeholder:"搜索所有会话的标题、目录或 Agent",value:i,onChange:n=>v(n.target.value)})]}),e.jsxs("div",{className:"collab-monitor-results","aria-label":"原始会话候选","aria-busy":u,onScroll:n=>{const m=n.currentTarget;m.scrollHeight-m.scrollTop-m.clientHeight<64&&k()},children:[p.data.map(n=>e.jsxs("label",{className:"collab-monitor-row",children:[e.jsx("input",{type:"checkbox","aria-label":`关联${n.title}`,checked:y.has(n.id),disabled:!y.has(n.id)&&a.length>=200,onChange:m=>s(m.target.checked?[...a,{id:n.id,agentType:n.agentType,title:n.title,cwd:n.cwd,projectId:n.projectId}]:a.filter(S=>S.id!==n.id))}),e.jsx(Y,{agentType:n.agentType,size:18}),e.jsxs("span",{children:[e.jsx("strong",{children:n.title}),e.jsxs("small",{children:[L[n.agentType]," · ",n.cwd]})]}),e.jsx("em",{className:n.status==="running"?"is-running":"",children:n.status==="running"?"运行中":n.status==="failed"?"异常":n.status==="completed"?"已完成":"空闲"})]},n.id)),!u&&!d&&!p.data.length&&e.jsx("p",{className:"collab-muted",children:i?"没有匹配的会话":"暂无可接入会话"}),u&&e.jsx("p",{className:"collab-muted",role:"status",children:"正在加载会话…"}),p.nextCursor&&!d&&e.jsxs("button",{type:"button",className:"collab-monitor-more",disabled:u,onClick:()=>void k(),children:["加载更多(已显示 ",p.data.length," / ",p.total,")"]})]}),d&&e.jsxs("p",{className:"collab-error",role:"alert",children:[d," ",e.jsx("button",{type:"button",onClick:()=>r(n=>n+1),children:"重新加载"})]})]})}function P({children:a,...s}){return e.jsxs("span",{className:"collab-select",children:[e.jsx("select",{...s,children:a}),e.jsx(Q,{size:16,"aria-hidden":"true"})]})}function U(a){return{id:crypto.randomUUID(),name:a===0?"群主":`成员 ${a}`,agentType:"codex",role:""}}function Pe({member:a,index:s,owner:i,supervisor:v,health:p,onChange:x,onRemove:u}){const[j,d]=o.useState([]),[b,w]=o.useState([]);return o.useEffect(()=>{let r=!0;return d([]),w([]),a.agentType==="customer-agent"?(window.agentApi.getSettings().then(h=>{r&&w(h.profiles.map(({id:f,name:k,modelId:y})=>({id:f,name:k,modelId:y})))}).catch(()=>{}),()=>{r=!1}):(window.agentApi.listAgentModels(a.agentType).then(h=>{r&&d(h.models)}).catch(()=>{}),()=>{r=!1})},[a.agentType]),e.jsxs("fieldset",{className:"collab-member-editor",children:[e.jsxs("legend",{children:[i?e.jsx(Z,{size:14}):e.jsx(K,{size:14}),i?"群主":`成员 ${s}`,v?" · 监工":""]}),u&&e.jsx("button",{type:"button",className:"collab-remove","aria-label":`移除${a.name}`,onClick:u,children:e.jsx(_,{size:16})}),e.jsxs("div",{className:"collab-editor-fields",children:[e.jsxs("label",{children:["名称",e.jsx("input",{value:a.name,maxLength:100,onChange:r=>x({...a,name:r.target.value}),required:!0})]}),e.jsxs("label",{children:["Agent",e.jsx(P,{value:a.agentType,onChange:r=>x({...a,agentType:r.target.value,model:void 0,profileId:void 0}),children:Se.map(r=>{var h,f;return e.jsxs("option",{value:r,disabled:((h=p.find(k=>k.agentType===r))==null?void 0:h.available)===!1,children:[L[r],((f=p.find(k=>k.agentType===r))==null?void 0:f.available)===!1?" · 不可用":""]},r)})})]}),e.jsxs("label",{className:"collab-model-field",children:["模型",a.agentType==="customer-agent"?e.jsxs(P,{value:a.profileId||"",onChange:r=>{const h=b.find(f=>f.id===r.target.value);x({...a,profileId:h==null?void 0:h.id,model:h?{id:h.modelId}:void 0})},children:[e.jsx("option",{value:"",children:"沿用默认模型"}),b.map(r=>e.jsxs("option",{value:r.id,children:[r.name," · ",r.modelId]},r.id))]}):e.jsxs(P,{value:a.model?`${a.model.providerID||""}|${a.model.id}`:"",onChange:r=>{const h=j.find(f=>`${f.providerID||""}|${f.id}`===r.target.value);x({...a,model:h?{id:h.id,...h.providerID?{providerID:h.providerID}:{}}:void 0})},children:[e.jsx("option",{value:"",children:"沿用默认模型"}),j.map(r=>e.jsxs("option",{value:`${r.providerID||""}|${r.id}`,children:[r.displayName||r.id,r.providerDisplayName?` · ${r.providerDisplayName}`:""]},`${r.providerID}|${r.id}`))]})]})]}),e.jsxs("details",{className:"collab-role-options",open:v||void 0,children:[e.jsxs("summary",{children:[e.jsx("span",{children:"定位与职责"}),e.jsx("span",{className:"collab-muted",children:a.role.trim()?"已设置":i?"默认安排与汇总":"留空由群主分配"}),e.jsx(Q,{size:14})]}),e.jsx("textarea",{"aria-label":`${i?"群主":`成员 ${s}`}的定位与职责(选填)`,rows:2,maxLength:8e3,value:a.role,placeholder:v?"重点看什么:异常暂停、任务交接和交付。允许怎么处理:原任务内自动恢复、继续、协调交接;业务取舍或无法恢复时提醒我决策。":i?"负责拆解目标、分配任务、验收和汇总成果":"例如:负责实现接口;留空由群主自动分配",onChange:r=>x({...a,role:r.target.value})}),v&&e.jsx("p",{className:"collab-muted",children:"在职责中写明关注内容、判断标准、允许的恢复与交接,以及何时提醒你或等待决策。"})]})]})}function Le({cwd:a,initialGroup:s,health:i,onClose:v,onCreated:p}){var W;const[x,u]=o.useState((s==null?void 0:s.name)||""),[j,d]=o.useState((s==null?void 0:s.cwd)||a||""),[b,w]=o.useState(()=>s?structuredClone(s.members):[U(0),U(1)]),[r,h]=o.useState((s==null?void 0:s.ownerId)||b[0].id),[f,k]=o.useState((s==null?void 0:s.maxParallel)||3),[y,n]=o.useState(()=>{var c;return structuredClone(((c=s==null?void 0:s.monitoring)==null?void 0:c.targets)??[])}),[m,S]=o.useState(s?((W=s.monitoring)==null?void 0:W.supervisorId)??"":b[0].id),[N,T]=o.useState(!1),[E,A]=o.useState(""),[D,l]=o.useState(!1),[t,g]=o.useState(!!(s!=null&&s.cwd)),[$,I]=o.useState(!1),B=async()=>{if(A(""),te()){l(!0);return}I(!0);try{const c=await window.agentApi.openFileDialog();c&&(d(c),g(!0))}catch(c){A(c instanceof Error?c.message:"无法选择工作目录")}finally{I(!1)}};return o.useEffect(()=>{const c=C=>{C.key==="Escape"&&!N&&!D&&!$&&v()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[v,N,D,$]),e.jsxs("div",{className:"collab-modal-backdrop",onMouseDown:c=>{c.target===c.currentTarget&&!N&&v()},children:[e.jsxs("form",{className:"collab-create",role:"dialog","aria-modal":"true","aria-labelledby":"collab-create-title",onSubmit:async c=>{c.preventDefault(),T(!0),A("");try{if(!j.trim())throw new Error("请先选择工作目录");const C=b.find(R=>{var O;return((O=i.find(G=>G.agentType===R.agentType))==null?void 0:O.available)===!1});if(C&&!s)throw new Error(`${C.name} 选择的 Agent 当前不可用`);const z=await F({...s?{action:"updateGroup",groupId:s.id}:{action:"createGroup"},group:{name:x.trim()||"协作群",cwd:j.trim(),ownerId:r,members:b,maxParallel:Math.min(f,b.length),...y.length?{monitoring:{targets:y,...m?{supervisorId:m}:{}}}:{}}});p(z)}catch(C){A(C instanceof Error?C.message:String(C))}finally{T(!1)}},children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsx("span",{className:"collab-eyebrow",children:"一起完成一件事"}),e.jsx("h2",{id:"collab-create-title",children:s?"修改协作群":"拉个协作群"})]}),e.jsx("button",{type:"button","aria-label":"关闭群设置",onClick:v,disabled:N,children:e.jsx(_,{size:20})})]}),e.jsxs("div",{className:"collab-create-scroll",children:[e.jsxs("div",{className:"collab-group-fields",children:[e.jsxs("label",{children:[e.jsx("span",{children:"群名称"}),e.jsx("input",{autoFocus:!0,value:x,maxLength:100,placeholder:"例如:产品开发小组",onChange:c=>u(c.target.value)})]}),e.jsxs("label",{children:[e.jsx("span",{children:"工作目录"}),e.jsxs("button",{type:"button",className:"collab-directory-picker","aria-label":"选择工作目录","aria-haspopup":"dialog","aria-expanded":D,title:j||"选择工作目录",disabled:N||$,onClick:()=>void B(),children:[e.jsx(ye,{size:16,"aria-hidden":"true"}),e.jsx("span",{className:j?void 0:"collab-muted",children:$?"正在选择…":j||"选择工作目录"}),e.jsx(H,{size:16,"aria-hidden":"true"})]})]})]}),e.jsx("p",{className:"collab-create-hint collab-muted",children:s?"配置保存后用于新讨论,已有讨论和聊天记录保留。":"Agent 可重复加入,职责留空由群主分配。"}),b.map((c,C)=>e.jsx(Pe,{member:c,index:C,owner:c.id===r,supervisor:y.length>0&&c.id===m,health:i,onChange:z=>w(R=>R.map(O=>O.id===z.id?z:O)),onRemove:c.id!==r&&b.length>2?()=>{c.id===m&&S(""),w(z=>z.filter(R=>R.id!==c.id))}:void 0},c.id)),e.jsxs("div",{className:"collab-create-actions",children:[e.jsxs("label",{children:["群主",e.jsx(P,{value:r,onChange:c=>h(c.target.value),children:b.map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))})]}),e.jsxs("button",{type:"button",disabled:b.length>=20,onClick:()=>w(c=>[...c,U(c.length)]),children:[e.jsx(H,{size:16}),"添加成员"]}),e.jsxs("label",{children:["最多同时工作",e.jsx(P,{value:Math.min(f,b.length),onChange:c=>k(Number(c.target.value)),children:b.map((c,C)=>e.jsxs("option",{value:C+1,children:[C+1," 人"]},C+1))})]})]}),e.jsx(ze,{value:y,onChange:n}),y.length>0&&e.jsxs("label",{className:"collab-supervisor-select",children:["监工",e.jsxs(P,{"aria-label":"选择监工成员",value:m,onChange:c=>S(c.target.value),children:[e.jsx("option",{value:"",children:"仅关联,不启用监工"}),b.map(c=>e.jsxs("option",{value:c.id,children:[c.name," · ",L[c.agentType]]},c.id))]}),e.jsx("small",{className:"collab-muted",children:"复用该成员的 Agent、模型和职责,关闭看板后继续监管。"})]})]}),E&&e.jsx("p",{className:"collab-error",role:"alert",children:E}),e.jsxs("footer",{children:[e.jsx("span",{className:"collab-muted",children:"职责可以留空,发送任务后由群主分配。"}),e.jsx("button",{className:"collab-primary",disabled:N||$||!j.trim(),type:"submit",children:N?"正在保存…":s?"保存修改":"创建并打开群"})]})]}),e.jsx($e,{open:D,initialPath:t?j:void 0,onCancel:()=>l(!1),onConfirm:c=>{d(c),g(!0),l(!1),A("")}})]})}function Re(){const[a,s]=o.useState([]),[i,v]=o.useState(!0),[p,x]=o.useState(""),u=o.useRef(0),j=o.useCallback(async()=>{const d=++u.current;v(!0);try{const b=await F({action:"groups"});u.current===d&&(s(b),x(""))}catch(b){u.current===d&&x(b instanceof Error?b.message:String(b))}finally{u.current===d&&v(!1)}},[]);return o.useEffect(()=>{j();const d=()=>{j()};return window.addEventListener("focus",d),()=>{u.current++,window.removeEventListener("focus",d)}},[j]),{groups:a,loading:i,error:p,refresh:j}}function Oe({onOpen:a,onChanged:s,onClose:i,cwd:v}){const{groups:p,loading:x,error:u,refresh:j}=Re(),[d,b]=o.useState(""),[w,r]=o.useState(null),[h,f]=o.useState(null),[k,y]=o.useState(!1),[n,m]=o.useState(""),[S,N]=o.useState([]),T=ae(l=>l.skin);o.useEffect(()=>{!x&&window.parent!==window&&window.parent.postMessage({type:se},window.location.origin)},[x]),o.useEffect(()=>{document.documentElement.setAttribute("data-skin",T)},[T]),o.useEffect(()=>{let l=!0;return window.agentApi.getRuntimeHealth().then(t=>{l&&N(t)}).catch(()=>{}),()=>{l=!1}},[]);const E=l=>{a?a(l):window.parent!==window?window.parent.postMessage({type:le,groupId:l.id,title:l.name},window.location.origin):location.assign(`?view=collaboration&groupId=${encodeURIComponent(l.id)}`)},A=(l,t)=>{s==null||s(l,t),window.parent!==window&&window.parent.postMessage({type:re,groupId:l,...t?{title:t.name}:{deleted:!0}},window.location.origin),j()},D=p.filter(l=>`${l.name} ${l.cwd} ${l.members.map(t=>t.name).join(" ")}`.toLowerCase().includes(d.trim().toLowerCase()));return e.jsxs("main",{className:"collab-dashboard",children:[e.jsxs("header",{className:"collab-dashboard-heading",children:[e.jsxs("div",{children:[e.jsx("span",{className:"collab-eyebrow",children:"协作空间"}),e.jsxs("h1",{children:["群聊列表 ",e.jsx("small",{children:p.length})]}),e.jsx("p",{className:"collab-muted",children:"找到你的群,继续上次的协作。"})]}),e.jsxs("div",{className:"collab-dashboard-tools",children:[e.jsx("button",{onClick:()=>ke({kind:"dashboard"}),children:"Dashboard"}),e.jsx("button",{"aria-label":"刷新群列表",title:"刷新群列表",disabled:x,onClick:()=>void j(),children:e.jsx(J,{size:17})}),e.jsxs("button",{className:"collab-primary",onClick:()=>r("new"),children:[e.jsx(H,{size:17}),"新增群聊"]}),i&&e.jsx("button",{"aria-label":"关闭群看板",onClick:i,children:e.jsx(_,{size:18})})]})]}),e.jsxs("label",{className:"collab-dashboard-search",children:[e.jsx(X,{size:17}),e.jsx("input",{"aria-label":"搜索群聊",placeholder:"搜索群名、成员或工作目录",value:d,onChange:l=>b(l.target.value)})]}),u&&e.jsxs("div",{className:"collab-error",role:"alert",children:[u,e.jsx("button",{onClick:()=>void j(),children:"重试"})]}),x&&p.length===0?e.jsx("div",{className:"collab-dashboard-empty",role:"status",children:"正在加载已保存的群…"}):!u&&D.length===0?e.jsxs("div",{className:"collab-dashboard-empty",children:[e.jsx(K,{size:32}),e.jsx("h2",{children:d?"没有找到匹配的群":"还没有协作群"}),e.jsx("p",{children:d?"换个关键词试试。":"选一位群主和成员,一起完成任务。"}),!d&&e.jsxs("button",{className:"collab-primary",onClick:()=>r("new"),children:[e.jsx(H,{size:16}),"新建第一个群"]})]}):e.jsx("section",{className:"collab-dashboard-grid","aria-label":"已保存的群聊","aria-busy":x,children:D.map(l=>{const t=l.members.find(g=>g.id===l.ownerId);return e.jsxs("article",{className:"collab-group-card",children:[e.jsxs("div",{className:"collab-card-heading",children:[e.jsxs("button",{className:"collab-card-title",onClick:()=>E(l),title:l.name,children:[e.jsx(K,{size:20}),e.jsx("h2",{children:l.name})]}),e.jsxs("div",{className:"collab-card-actions",children:[e.jsx("button",{"aria-label":`修改${l.name}`,title:"修改群设置",onClick:()=>r(l),children:e.jsx(we,{size:16})}),e.jsx("button",{"aria-label":`删除${l.name}`,title:"删除群聊",onClick:()=>{m(""),f(l)},children:e.jsx(Ne,{size:16})})]})]}),e.jsxs("p",{className:"collab-card-owner",children:[e.jsx(Z,{size:14}),e.jsxs("span",{children:["群主 · ",t==null?void 0:t.name]}),e.jsx("span",{className:"collab-muted",children:t&&L[t.agentType]})]}),e.jsxs("div",{className:"collab-card-members","aria-label":`${l.members.length} 名群成员`,children:[l.members.slice(0,7).map(g=>e.jsx("span",{title:`${g.name} · ${L[g.agentType]}`,children:e.jsx(Y,{agentType:g.agentType,size:18})},g.id)),e.jsxs("small",{children:[l.members.length," 人 · 最多 ",l.maxParallel," 人并行"]})]}),e.jsxs("p",{className:"collab-card-path",title:l.cwd,children:[e.jsx(V,{size:14}),e.jsx("span",{children:l.cwd})]}),e.jsxs("footer",{children:[e.jsxs("time",{dateTime:l.createdAt,children:[new Date(l.createdAt).toLocaleDateString("zh-CN")," 创建"]}),e.jsxs("button",{onClick:()=>E(l),children:["进入群聊",e.jsx(Ce,{size:16})]})]})]},l.id)})}),w&&q.createPortal(e.jsx(Le,{cwd:v,initialGroup:w==="new"?void 0:w,health:S,onClose:()=>r(null),onCreated:l=>{const t=w==="new";r(null),A(l.id,l),t&&E(l)}},w==="new"?"new":w.id),document.body),h&&q.createPortal(e.jsx("div",{className:"collab-modal-backdrop",children:e.jsxs("section",{className:"collab-delete-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"collab-delete-title","aria-describedby":"collab-delete-description",children:[e.jsxs("h2",{id:"collab-delete-title",children:["删除“",h.name,"”?"]}),e.jsx("p",{id:"collab-delete-description",children:"删除后将从看板移除,工作目录中的文件不会删除。进行中的协作需要先停止。"}),n&&e.jsx("p",{className:"collab-error",role:"alert",children:n}),e.jsxs("footer",{children:[e.jsx("button",{autoFocus:!0,disabled:k,onClick:()=>f(null),children:"取消"}),e.jsx("button",{className:"collab-delete-confirm",disabled:k,onClick:async()=>{y(!0),m("");try{await F({action:"deleteGroup",groupId:h.id}),A(h.id),f(null)}catch(l){m(l instanceof Error?l.message:String(l))}finally{y(!1)}},children:k?"正在删除…":"确认删除"})]})]})}),document.body)]})}const Ke=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));export{Le as C,$e as H,Oe as a,Ke as b};
|
|
1
|
+
import{r as o,e as q,j as e,X as _,R as J,P as ee,A as Y,f as H,g as te,d as Q,u as ae}from"./index--zKd3rTs.js";import{C as se,a as le,b as re}from"./CollaborationTabBridge-Dxq4G1Uk.js";import{F as ne,D as oe,P as ce,a as ie,b as de,c as he,d as ue,N as je,e as be,f as me,g as xe,h as pe,i as V,j as fe,S as X}from"./file-types-XHMBkbNr.js";import{A as ge,C as ve,F as ye,P as we,T as Ne}from"./trash-2-CHYPyYDY.js";import{c as F,A as L,U as K}from"./collaboration-f29NaKWy.js";import{C as Z}from"./crown-y1qmM0NZ.js";import{p as ke}from"./SessionDashboardBridge-DYsMZhuH.js";import{A as Ce}from"./arrow-right-B0uCZ1Pd.js";const Se=["customer-agent","codex","claude-code","opencode","deepseek-harness"],Ee={folder:{icon:V,label:"文件夹"},code:{icon:pe,label:"代码文件"},style:{icon:ee,label:"样式文件"},image:{icon:xe,label:"图片文件"},video:{icon:me,label:"视频文件"},audio:{icon:be,label:"音频文件"},markdown:{icon:je,label:"Markdown 文件"},text:{icon:ue,label:"文本文件"},json:{icon:he,label:"JSON 文件"},archive:{icon:de,label:"压缩文件"},spreadsheet:{icon:ie,label:"表格文件"},presentation:{icon:ce,label:"演示文件"},database:{icon:oe,label:"数据库文件"},file:{icon:ne,label:"文件"}};function Te(a,s){return s==="directory"?"folder":fe(a)}const M=a=>a.replace(/\\/g,"/").replace(/\/+$/,"")||"/";function Ae(a,s){for(const v of s){if(!(v!=null&&v.trim()))continue;const p=M(v);if(p.split("/").some(u=>u==="."||u===".."))continue;const x=a.map(M).filter(u=>p===u||p.startsWith(u==="/"?"/":`${u}/`)).sort((u,j)=>j.length-u.length)[0];if(x)return{root:x,current:p}}const i=a[0]?M(a[0]):"";return{root:i,current:i}}function De(a,s){const i=M(a),v=M(s),x=[{label:i==="/"?"/":i.split("/").filter(Boolean).pop()||i,path:i}];if(v===i)return x;const u=v.slice(i==="/"?1:i.length+1);let j=i;for(const d of u.split("/").filter(Boolean))j=j==="/"?`/${d}`:`${j}/${d}`,x.push({label:d,path:j});return x}function $e({open:a,initialPath:s,onCancel:i,onConfirm:v}){const[p,x]=o.useState([]),[u,j]=o.useState(""),[d,b]=o.useState(""),[w,r]=o.useState([]),[h,f]=o.useState(!1),[k,y]=o.useState(""),[n,m]=o.useState(!1),[S,N]=o.useState(!1),T=o.useMemo(()=>u&&d?De(u,d):[],[u,d]),E=async t=>{if(window.agentApi){f(!0),N(!1),y(""),b(t),r([]);try{const g=await window.agentApi.listProjectDirectories(t);r(g),N(!0)}catch(g){y(g instanceof Error?g.message:"无法读取目录")}finally{f(!1)}}};if(o.useEffect(()=>{if(!a||!window.agentApi)return;let t=!1;return f(!0),y(""),j(""),b(""),N(!1),r([]),window.agentApi.getProjectPickerLocation().then(async({roots:g,initialPath:$})=>{if(t)return;x(g);const I=Ae(g,[s,$]);j(I.root),I.current?await E(I.current):y("未配置可用的宿主机目录")}).catch(g=>{t||y(g instanceof Error?g.message:"无法读取宿主机目录")}).finally(()=>{t||f(!1)}),()=>{t=!0}},[a,s]),o.useEffect(()=>{if(!a)return;const t=g=>{g.key==="Escape"&&i()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a,i]),!a)return null;const A=t=>{j(t),E(t)},D=()=>{T.length<=1||E(T[T.length-2].path)},l=async()=>{if(!(!d||!S||n)){m(!0),y("");try{await v(d)}catch(t){y(t instanceof Error?t.message:"项目导入失败")}finally{m(!1)}}};return q.createPortal(e.jsx("div",{className:"host-project-picker-backdrop",role:"presentation",onMouseDown:t=>{t.target===t.currentTarget&&i()},children:e.jsxs("section",{className:"host-project-picker",role:"dialog","aria-modal":"true","aria-labelledby":"host-project-picker-title",children:[e.jsxs("header",{className:"host-project-picker-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"host-project-picker-title",children:"选择宿主机项目"}),e.jsx("p",{children:"文件将直接在运行 AgentRoam 的机器上读写"})]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:i,"aria-label":"关闭目录选择器",title:"关闭",children:e.jsx(_,{size:16,"aria-hidden":"true"})})]}),p.length>1&&e.jsxs("label",{className:"host-project-picker-root",children:[e.jsx("span",{children:"根目录"}),e.jsx("select",{value:u,onChange:t=>A(t.target.value),children:p.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("nav",{className:"host-project-picker-nav","aria-label":"当前目录",children:[e.jsx("button",{type:"button",className:"ui-icon-button",onClick:D,disabled:T.length<=1,"aria-label":"返回上级目录",title:"返回上级目录",children:e.jsx(ge,{size:16,"aria-hidden":"true"})}),e.jsxs("div",{className:"host-project-picker-breadcrumbs",children:[!d&&e.jsx("span",{children:h?"正在定位工作目录…":"未能加载工作目录"}),T.map((t,g)=>e.jsxs("span",{children:[g>0&&e.jsx("i",{children:"/"}),e.jsx("button",{type:"button",onClick:()=>void E(t.path),children:t.label})]},t.path))]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>d&&void E(d),disabled:!d||h,"aria-label":"刷新目录",title:"刷新目录",children:e.jsx(J,{size:15,"aria-hidden":"true"})})]}),u==="/"&&e.jsx("div",{className:"host-project-picker-warning",children:"当前允许访问宿主机根目录,请谨慎选择项目。"}),e.jsx("div",{className:"host-project-picker-list","aria-busy":h,children:h?e.jsx("div",{className:"host-project-picker-state",children:"正在读取目录…"}):k?e.jsx("div",{className:"host-project-picker-state is-error",children:k}):w.length===0?e.jsx("div",{className:"host-project-picker-state",children:"此目录为空"}):w.map(t=>{const g=Te(t.name,t.kind),{icon:$,label:I}=Ee[g],B=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`host-project-picker-entry-icon is-${g}`,"aria-hidden":"true",children:e.jsx($,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"host-project-picker-name",children:t.name})]});return t.kind==="file"?e.jsx("div",{className:"host-project-picker-row is-file",title:I,children:B},`${t.name}:${t.path}`):e.jsxs("button",{type:"button",className:"host-project-picker-row is-directory",onClick:()=>void E(t.path),title:I,children:[B,t.hasChildren&&e.jsx("span",{className:"host-project-picker-chevron","aria-hidden":"true",children:e.jsx(ve,{size:16})})]},`${t.name}:${t.path}`)})}),e.jsxs("footer",{className:"host-project-picker-footer",children:[e.jsx("code",{title:d,children:d}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"host-project-picker-cancel",onClick:i,children:"取消"}),e.jsx("button",{type:"button",className:"host-project-picker-confirm",disabled:!d||!S||h||n,onClick:()=>void l(),children:n?"正在导入…":"选择此文件夹"})]})]})]})}),document.body)}function Ie(a,s){return[...new Map([...a,...s].map(i=>[i.id,i])).values()]}function ze({value:a,onChange:s}){const[i,v]=o.useState(""),[p,x]=o.useState({data:[],nextCursor:null,total:0}),[u,j]=o.useState(!0),[d,b]=o.useState(""),[w,r]=o.useState(0),h=o.useRef(0),f=o.useRef(!1);o.useEffect(()=>{const n=++h.current;let m=!0;f.current=!0,j(!0),b(""),x({data:[],nextCursor:null,total:0});const S=setTimeout(()=>{F({action:"sessionCatalog",query:i,limit:20}).then(N=>{m&&n===h.current&&x(N)}).catch(N=>{m&&n===h.current&&b(N instanceof Error?N.message:"无法加载会话")}).finally(()=>{m&&n===h.current&&(f.current=!1,j(!1))})},i?200:0);return()=>{m=!1,clearTimeout(S)}},[i,w]);const k=async()=>{if(f.current||!p.nextCursor)return;const n=h.current;f.current=!0,j(!0),b("");try{const m=await F({action:"sessionCatalog",query:i,limit:20,cursor:p.nextCursor});n===h.current&&x(S=>({...m,data:Ie(S.data,m.data)}))}catch(m){n===h.current&&b(m instanceof Error?m.message:"加载更多失败")}finally{n===h.current&&(f.current=!1,j(!1))}},y=new Set(a.map(n=>n.id));return e.jsxs("section",{className:"collab-monitor-picker","aria-label":"关联原始会话",children:[e.jsx("div",{className:"collab-monitor-heading",children:e.jsxs("strong",{children:["关联原始会话 ",e.jsxs("small",{children:["选填 · 已选 ",a.length]})]})}),e.jsx("p",{className:"collab-muted",children:"运行中的在前。关联后作为监控对象,恢复或交接时才介入。"}),a.length>0&&e.jsx("div",{className:"collab-monitor-selected","aria-label":"已选会话",children:a.map(n=>e.jsxs("span",{title:`${L[n.agentType]} · ${n.cwd}`,children:[e.jsx(Y,{agentType:n.agentType,size:14}),e.jsx("span",{children:n.title}),e.jsx("button",{type:"button","aria-label":`取消关联${n.title}`,onClick:()=>s(a.filter(m=>m.id!==n.id)),children:e.jsx(_,{size:13})})]},n.id))}),e.jsxs("label",{className:"collab-monitor-search",children:[e.jsx(X,{size:15}),e.jsx("input",{"aria-label":"搜索所有原始会话",placeholder:"搜索所有会话的标题、目录或 Agent",value:i,onChange:n=>v(n.target.value)})]}),e.jsxs("div",{className:"collab-monitor-results","aria-label":"原始会话候选","aria-busy":u,onScroll:n=>{const m=n.currentTarget;m.scrollHeight-m.scrollTop-m.clientHeight<64&&k()},children:[p.data.map(n=>e.jsxs("label",{className:"collab-monitor-row",children:[e.jsx("input",{type:"checkbox","aria-label":`关联${n.title}`,checked:y.has(n.id),disabled:!y.has(n.id)&&a.length>=200,onChange:m=>s(m.target.checked?[...a,{id:n.id,agentType:n.agentType,title:n.title,cwd:n.cwd,projectId:n.projectId}]:a.filter(S=>S.id!==n.id))}),e.jsx(Y,{agentType:n.agentType,size:18}),e.jsxs("span",{children:[e.jsx("strong",{children:n.title}),e.jsxs("small",{children:[L[n.agentType]," · ",n.cwd]})]}),e.jsx("em",{className:n.status==="running"?"is-running":"",children:n.status==="running"?"运行中":n.status==="failed"?"异常":n.status==="completed"?"已完成":"空闲"})]},n.id)),!u&&!d&&!p.data.length&&e.jsx("p",{className:"collab-muted",children:i?"没有匹配的会话":"暂无可接入会话"}),u&&e.jsx("p",{className:"collab-muted",role:"status",children:"正在加载会话…"}),p.nextCursor&&!d&&e.jsxs("button",{type:"button",className:"collab-monitor-more",disabled:u,onClick:()=>void k(),children:["加载更多(已显示 ",p.data.length," / ",p.total,")"]})]}),d&&e.jsxs("p",{className:"collab-error",role:"alert",children:[d," ",e.jsx("button",{type:"button",onClick:()=>r(n=>n+1),children:"重新加载"})]})]})}function P({children:a,...s}){return e.jsxs("span",{className:"collab-select",children:[e.jsx("select",{...s,children:a}),e.jsx(Q,{size:16,"aria-hidden":"true"})]})}function U(a){return{id:crypto.randomUUID(),name:a===0?"群主":`成员 ${a}`,agentType:"codex",role:""}}function Pe({member:a,index:s,owner:i,supervisor:v,health:p,onChange:x,onRemove:u}){const[j,d]=o.useState([]),[b,w]=o.useState([]);return o.useEffect(()=>{let r=!0;return d([]),w([]),a.agentType==="customer-agent"?(window.agentApi.getSettings().then(h=>{r&&w(h.profiles.map(({id:f,name:k,modelId:y})=>({id:f,name:k,modelId:y})))}).catch(()=>{}),()=>{r=!1}):(window.agentApi.listAgentModels(a.agentType).then(h=>{r&&d(h.models)}).catch(()=>{}),()=>{r=!1})},[a.agentType]),e.jsxs("fieldset",{className:"collab-member-editor",children:[e.jsxs("legend",{children:[i?e.jsx(Z,{size:14}):e.jsx(K,{size:14}),i?"群主":`成员 ${s}`,v?" · 监工":""]}),u&&e.jsx("button",{type:"button",className:"collab-remove","aria-label":`移除${a.name}`,onClick:u,children:e.jsx(_,{size:16})}),e.jsxs("div",{className:"collab-editor-fields",children:[e.jsxs("label",{children:["名称",e.jsx("input",{value:a.name,maxLength:100,onChange:r=>x({...a,name:r.target.value}),required:!0})]}),e.jsxs("label",{children:["Agent",e.jsx(P,{value:a.agentType,onChange:r=>x({...a,agentType:r.target.value,model:void 0,profileId:void 0}),children:Se.map(r=>{var h,f;return e.jsxs("option",{value:r,disabled:((h=p.find(k=>k.agentType===r))==null?void 0:h.available)===!1,children:[L[r],((f=p.find(k=>k.agentType===r))==null?void 0:f.available)===!1?" · 不可用":""]},r)})})]}),e.jsxs("label",{className:"collab-model-field",children:["模型",a.agentType==="customer-agent"?e.jsxs(P,{value:a.profileId||"",onChange:r=>{const h=b.find(f=>f.id===r.target.value);x({...a,profileId:h==null?void 0:h.id,model:h?{id:h.modelId}:void 0})},children:[e.jsx("option",{value:"",children:"沿用默认模型"}),b.map(r=>e.jsxs("option",{value:r.id,children:[r.name," · ",r.modelId]},r.id))]}):e.jsxs(P,{value:a.model?`${a.model.providerID||""}|${a.model.id}`:"",onChange:r=>{const h=j.find(f=>`${f.providerID||""}|${f.id}`===r.target.value);x({...a,model:h?{id:h.id,...h.providerID?{providerID:h.providerID}:{}}:void 0})},children:[e.jsx("option",{value:"",children:"沿用默认模型"}),j.map(r=>e.jsxs("option",{value:`${r.providerID||""}|${r.id}`,children:[r.displayName||r.id,r.providerDisplayName?` · ${r.providerDisplayName}`:""]},`${r.providerID}|${r.id}`))]})]})]}),e.jsxs("details",{className:"collab-role-options",open:v||void 0,children:[e.jsxs("summary",{children:[e.jsx("span",{children:"定位与职责"}),e.jsx("span",{className:"collab-muted",children:a.role.trim()?"已设置":i?"默认安排与汇总":"留空由群主分配"}),e.jsx(Q,{size:14})]}),e.jsx("textarea",{"aria-label":`${i?"群主":`成员 ${s}`}的定位与职责(选填)`,rows:2,maxLength:8e3,value:a.role,placeholder:v?"重点看什么:异常暂停、任务交接和交付。允许怎么处理:原任务内自动恢复、继续、协调交接;业务取舍或无法恢复时提醒我决策。":i?"负责拆解目标、分配任务、验收和汇总成果":"例如:负责实现接口;留空由群主自动分配",onChange:r=>x({...a,role:r.target.value})}),v&&e.jsx("p",{className:"collab-muted",children:"在职责中写明关注内容、判断标准、允许的恢复与交接,以及何时提醒你或等待决策。"})]})]})}function Le({cwd:a,initialGroup:s,health:i,onClose:v,onCreated:p}){var W;const[x,u]=o.useState((s==null?void 0:s.name)||""),[j,d]=o.useState((s==null?void 0:s.cwd)||a||""),[b,w]=o.useState(()=>s?structuredClone(s.members):[U(0),U(1)]),[r,h]=o.useState((s==null?void 0:s.ownerId)||b[0].id),[f,k]=o.useState((s==null?void 0:s.maxParallel)||3),[y,n]=o.useState(()=>{var c;return structuredClone(((c=s==null?void 0:s.monitoring)==null?void 0:c.targets)??[])}),[m,S]=o.useState(s?((W=s.monitoring)==null?void 0:W.supervisorId)??"":b[0].id),[N,T]=o.useState(!1),[E,A]=o.useState(""),[D,l]=o.useState(!1),[t,g]=o.useState(!!(s!=null&&s.cwd)),[$,I]=o.useState(!1),B=async()=>{if(A(""),te()){l(!0);return}I(!0);try{const c=await window.agentApi.openFileDialog();c&&(d(c),g(!0))}catch(c){A(c instanceof Error?c.message:"无法选择工作目录")}finally{I(!1)}};return o.useEffect(()=>{const c=C=>{C.key==="Escape"&&!N&&!D&&!$&&v()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[v,N,D,$]),e.jsxs("div",{className:"collab-modal-backdrop",onMouseDown:c=>{c.target===c.currentTarget&&!N&&v()},children:[e.jsxs("form",{className:"collab-create",role:"dialog","aria-modal":"true","aria-labelledby":"collab-create-title",onSubmit:async c=>{c.preventDefault(),T(!0),A("");try{if(!j.trim())throw new Error("请先选择工作目录");const C=b.find(R=>{var O;return((O=i.find(G=>G.agentType===R.agentType))==null?void 0:O.available)===!1});if(C&&!s)throw new Error(`${C.name} 选择的 Agent 当前不可用`);const z=await F({...s?{action:"updateGroup",groupId:s.id}:{action:"createGroup"},group:{name:x.trim()||"协作群",cwd:j.trim(),ownerId:r,members:b,maxParallel:Math.min(f,b.length),...y.length?{monitoring:{targets:y,...m?{supervisorId:m}:{}}}:{}}});p(z)}catch(C){A(C instanceof Error?C.message:String(C))}finally{T(!1)}},children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsx("span",{className:"collab-eyebrow",children:"一起完成一件事"}),e.jsx("h2",{id:"collab-create-title",children:s?"修改协作群":"拉个协作群"})]}),e.jsx("button",{type:"button","aria-label":"关闭群设置",onClick:v,disabled:N,children:e.jsx(_,{size:20})})]}),e.jsxs("div",{className:"collab-create-scroll",children:[e.jsxs("div",{className:"collab-group-fields",children:[e.jsxs("label",{children:[e.jsx("span",{children:"群名称"}),e.jsx("input",{autoFocus:!0,value:x,maxLength:100,placeholder:"例如:产品开发小组",onChange:c=>u(c.target.value)})]}),e.jsxs("label",{children:[e.jsx("span",{children:"工作目录"}),e.jsxs("button",{type:"button",className:"collab-directory-picker","aria-label":"选择工作目录","aria-haspopup":"dialog","aria-expanded":D,title:j||"选择工作目录",disabled:N||$,onClick:()=>void B(),children:[e.jsx(ye,{size:16,"aria-hidden":"true"}),e.jsx("span",{className:j?void 0:"collab-muted",children:$?"正在选择…":j||"选择工作目录"}),e.jsx(H,{size:16,"aria-hidden":"true"})]})]})]}),e.jsx("p",{className:"collab-create-hint collab-muted",children:s?"配置保存后用于新讨论,已有讨论和聊天记录保留。":"Agent 可重复加入,职责留空由群主分配。"}),b.map((c,C)=>e.jsx(Pe,{member:c,index:C,owner:c.id===r,supervisor:y.length>0&&c.id===m,health:i,onChange:z=>w(R=>R.map(O=>O.id===z.id?z:O)),onRemove:c.id!==r&&b.length>2?()=>{c.id===m&&S(""),w(z=>z.filter(R=>R.id!==c.id))}:void 0},c.id)),e.jsxs("div",{className:"collab-create-actions",children:[e.jsxs("label",{children:["群主",e.jsx(P,{value:r,onChange:c=>h(c.target.value),children:b.map(c=>e.jsx("option",{value:c.id,children:c.name},c.id))})]}),e.jsxs("button",{type:"button",disabled:b.length>=20,onClick:()=>w(c=>[...c,U(c.length)]),children:[e.jsx(H,{size:16}),"添加成员"]}),e.jsxs("label",{children:["最多同时工作",e.jsx(P,{value:Math.min(f,b.length),onChange:c=>k(Number(c.target.value)),children:b.map((c,C)=>e.jsxs("option",{value:C+1,children:[C+1," 人"]},C+1))})]})]}),e.jsx(ze,{value:y,onChange:n}),y.length>0&&e.jsxs("label",{className:"collab-supervisor-select",children:["监工",e.jsxs(P,{"aria-label":"选择监工成员",value:m,onChange:c=>S(c.target.value),children:[e.jsx("option",{value:"",children:"仅关联,不启用监工"}),b.map(c=>e.jsxs("option",{value:c.id,children:[c.name," · ",L[c.agentType]]},c.id))]}),e.jsx("small",{className:"collab-muted",children:"复用该成员的 Agent、模型和职责,关闭看板后继续监管。"})]})]}),E&&e.jsx("p",{className:"collab-error",role:"alert",children:E}),e.jsxs("footer",{children:[e.jsx("span",{className:"collab-muted",children:"职责可以留空,发送任务后由群主分配。"}),e.jsx("button",{className:"collab-primary",disabled:N||$||!j.trim(),type:"submit",children:N?"正在保存…":s?"保存修改":"创建并打开群"})]})]}),e.jsx($e,{open:D,initialPath:t?j:void 0,onCancel:()=>l(!1),onConfirm:c=>{d(c),g(!0),l(!1),A("")}})]})}function Re(){const[a,s]=o.useState([]),[i,v]=o.useState(!0),[p,x]=o.useState(""),u=o.useRef(0),j=o.useCallback(async()=>{const d=++u.current;v(!0);try{const b=await F({action:"groups"});u.current===d&&(s(b),x(""))}catch(b){u.current===d&&x(b instanceof Error?b.message:String(b))}finally{u.current===d&&v(!1)}},[]);return o.useEffect(()=>{j();const d=()=>{j()};return window.addEventListener("focus",d),()=>{u.current++,window.removeEventListener("focus",d)}},[j]),{groups:a,loading:i,error:p,refresh:j}}function Oe({onOpen:a,onChanged:s,onClose:i,cwd:v}){const{groups:p,loading:x,error:u,refresh:j}=Re(),[d,b]=o.useState(""),[w,r]=o.useState(null),[h,f]=o.useState(null),[k,y]=o.useState(!1),[n,m]=o.useState(""),[S,N]=o.useState([]),T=ae(l=>l.skin);o.useEffect(()=>{!x&&window.parent!==window&&window.parent.postMessage({type:se},window.location.origin)},[x]),o.useEffect(()=>{document.documentElement.setAttribute("data-skin",T)},[T]),o.useEffect(()=>{let l=!0;return window.agentApi.getRuntimeHealth().then(t=>{l&&N(t)}).catch(()=>{}),()=>{l=!1}},[]);const E=l=>{a?a(l):window.parent!==window?window.parent.postMessage({type:le,groupId:l.id,title:l.name},window.location.origin):location.assign(`?view=collaboration&groupId=${encodeURIComponent(l.id)}`)},A=(l,t)=>{s==null||s(l,t),window.parent!==window&&window.parent.postMessage({type:re,groupId:l,...t?{title:t.name}:{deleted:!0}},window.location.origin),j()},D=p.filter(l=>`${l.name} ${l.cwd} ${l.members.map(t=>t.name).join(" ")}`.toLowerCase().includes(d.trim().toLowerCase()));return e.jsxs("main",{className:"collab-dashboard",children:[e.jsxs("header",{className:"collab-dashboard-heading",children:[e.jsxs("div",{children:[e.jsx("span",{className:"collab-eyebrow",children:"协作空间"}),e.jsxs("h1",{children:["群聊列表 ",e.jsx("small",{children:p.length})]}),e.jsx("p",{className:"collab-muted",children:"找到你的群,继续上次的协作。"})]}),e.jsxs("div",{className:"collab-dashboard-tools",children:[e.jsx("button",{onClick:()=>ke({kind:"dashboard"}),children:"Dashboard"}),e.jsx("button",{"aria-label":"刷新群列表",title:"刷新群列表",disabled:x,onClick:()=>void j(),children:e.jsx(J,{size:17})}),e.jsxs("button",{className:"collab-primary",onClick:()=>r("new"),children:[e.jsx(H,{size:17}),"新增群聊"]}),i&&e.jsx("button",{"aria-label":"关闭群看板",onClick:i,children:e.jsx(_,{size:18})})]})]}),e.jsxs("label",{className:"collab-dashboard-search",children:[e.jsx(X,{size:17}),e.jsx("input",{"aria-label":"搜索群聊",placeholder:"搜索群名、成员或工作目录",value:d,onChange:l=>b(l.target.value)})]}),u&&e.jsxs("div",{className:"collab-error",role:"alert",children:[u,e.jsx("button",{onClick:()=>void j(),children:"重试"})]}),x&&p.length===0?e.jsx("div",{className:"collab-dashboard-empty",role:"status",children:"正在加载已保存的群…"}):!u&&D.length===0?e.jsxs("div",{className:"collab-dashboard-empty",children:[e.jsx(K,{size:32}),e.jsx("h2",{children:d?"没有找到匹配的群":"还没有协作群"}),e.jsx("p",{children:d?"换个关键词试试。":"选一位群主和成员,一起完成任务。"}),!d&&e.jsxs("button",{className:"collab-primary",onClick:()=>r("new"),children:[e.jsx(H,{size:16}),"新建第一个群"]})]}):e.jsx("section",{className:"collab-dashboard-grid","aria-label":"已保存的群聊","aria-busy":x,children:D.map(l=>{const t=l.members.find(g=>g.id===l.ownerId);return e.jsxs("article",{className:"collab-group-card",children:[e.jsxs("div",{className:"collab-card-heading",children:[e.jsxs("button",{className:"collab-card-title",onClick:()=>E(l),title:l.name,children:[e.jsx(K,{size:20}),e.jsx("h2",{children:l.name})]}),e.jsxs("div",{className:"collab-card-actions",children:[e.jsx("button",{"aria-label":`修改${l.name}`,title:"修改群设置",onClick:()=>r(l),children:e.jsx(we,{size:16})}),e.jsx("button",{"aria-label":`删除${l.name}`,title:"删除群聊",onClick:()=>{m(""),f(l)},children:e.jsx(Ne,{size:16})})]})]}),e.jsxs("p",{className:"collab-card-owner",children:[e.jsx(Z,{size:14}),e.jsxs("span",{children:["群主 · ",t==null?void 0:t.name]}),e.jsx("span",{className:"collab-muted",children:t&&L[t.agentType]})]}),e.jsxs("div",{className:"collab-card-members","aria-label":`${l.members.length} 名群成员`,children:[l.members.slice(0,7).map(g=>e.jsx("span",{title:`${g.name} · ${L[g.agentType]}`,children:e.jsx(Y,{agentType:g.agentType,size:18})},g.id)),e.jsxs("small",{children:[l.members.length," 人 · 最多 ",l.maxParallel," 人并行"]})]}),e.jsxs("p",{className:"collab-card-path",title:l.cwd,children:[e.jsx(V,{size:14}),e.jsx("span",{children:l.cwd})]}),e.jsxs("footer",{children:[e.jsxs("time",{dateTime:l.createdAt,children:[new Date(l.createdAt).toLocaleDateString("zh-CN")," 创建"]}),e.jsxs("button",{onClick:()=>E(l),children:["进入群聊",e.jsx(Ce,{size:16})]})]})]},l.id)})}),w&&q.createPortal(e.jsx(Le,{cwd:v,initialGroup:w==="new"?void 0:w,health:S,onClose:()=>r(null),onCreated:l=>{const t=w==="new";r(null),A(l.id,l),t&&E(l)}},w==="new"?"new":w.id),document.body),h&&q.createPortal(e.jsx("div",{className:"collab-modal-backdrop",children:e.jsxs("section",{className:"collab-delete-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"collab-delete-title","aria-describedby":"collab-delete-description",children:[e.jsxs("h2",{id:"collab-delete-title",children:["删除“",h.name,"”?"]}),e.jsx("p",{id:"collab-delete-description",children:"删除后将从看板移除,工作目录中的文件不会删除。进行中的协作需要先停止。"}),n&&e.jsx("p",{className:"collab-error",role:"alert",children:n}),e.jsxs("footer",{children:[e.jsx("button",{autoFocus:!0,disabled:k,onClick:()=>f(null),children:"取消"}),e.jsx("button",{className:"collab-delete-confirm",disabled:k,onClick:async()=>{y(!0),m("");try{await F({action:"deleteGroup",groupId:h.id}),A(h.id),f(null)}catch(l){m(l instanceof Error?l.message:String(l))}finally{y(!1)}},children:k?"正在删除…":"确认删除"})]})]})}),document.body)]})}const Ke=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));export{Le as C,$e as H,Oe as a,Ke as b};
|
package/runtime/webapp/dist/assets/{CollaborationPage-DRBPK_iH.js → CollaborationPage-Fsvkw8ZM.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as se,r as u,j as e,u as we,X as Ne,f as oe,M as ke,A as J,l as Se}from"./index
|
|
1
|
+
import{c as se,r as u,j as e,u as we,X as Ne,f as oe,M as ke,A as J,l as Se}from"./index--zKd3rTs.js";import{i as Y,r as me,p as Ae,C as Ce}from"./artifact-links-nzx7joYs.js";import{p as Ee}from"./SessionDashboardBridge-DYsMZhuH.js";import{S as Te}from"./shield-check-SeEkz1Nd.js";import{c as I,D as ue,U as ee,A as te}from"./collaboration-f29NaKWy.js";import{c as Ie}from"./CollaborationTabBridge-Dxq4G1Uk.js";import{L as de}from"./loader-circle-DMWQZenY.js";import{C as ze}from"./crown-y1qmM0NZ.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeSyntax-
|
|
2
|
-
import{c as ue,r,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeSyntax-Dgv0FfoZ.js","./index--zKd3rTs.js","./index-D0gsdpeQ.css","./artifact-links-nzx7joYs.js","./rotate-ccw-CKqo62Ra.js","./loader-circle-DMWQZenY.js","./trash-2-CHYPyYDY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ue,r,a7 as _t,j as t,X as Dt,R as Me}from"./index--zKd3rTs.js";import{i as de,C as rt}from"./artifact-links-nzx7joYs.js";import{R as It}from"./rotate-ccw-CKqo62Ra.js";import{L as Z}from"./loader-circle-DMWQZenY.js";import{P as Ht}from"./trash-2-CHYPyYDY.js";/**
|
|
3
3
|
* @license lucide-react v0.468.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -21,6 +21,6 @@ import{c as ue,r,a6 as _t,j as t,X as Dt,R as Me}from"./index-CkVSxxim.js";impor
|
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/const Ft=ue("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),At=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function Ot(e){if(!e.trim())return{rows:[],added:0,removed:0};const n=[];let l=0,a=0,x=!1,g=0,c=0;for(const f of e.replace(/\n$/,"").split(`
|
|
23
23
|
`)){const k=f.match(At);if(k){l=Number(k[1]),a=Number(k[2]),x=!0,n.push({kind:"hunk",text:f,oldLine:null,newLine:null});continue}if(!x){!f.startsWith("diff --git ")&&!f.startsWith("index ")&&!f.startsWith("--- ")&&!f.startsWith("+++ ")&&n.push({kind:"meta",text:f,oldLine:null,newLine:null});continue}f.startsWith("+")?(n.push({kind:"added",text:f.slice(1),oldLine:null,newLine:a}),a+=1,g+=1):f.startsWith("-")?(n.push({kind:"removed",text:f.slice(1),oldLine:l,newLine:null}),l+=1,c+=1):f.startsWith(" ")?(n.push({kind:"context",text:f.slice(1),oldLine:l,newLine:a}),l+=1,a+=1):n.push({kind:"note",text:f,oldLine:null,newLine:null})}return{rows:n,added:g,removed:c}}const it=256*1024,mn=16*1024,Bt={java:"java",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",py:"python",sh:"bash",bash:"bash",zsh:"bash",css:"css",scss:"scss",html:"xml",htm:"xml",xml:"xml",vue:"xml",svelte:"xml",astro:"xml",yml:"yaml",yaml:"yaml",toml:"ini",env:"ini",sql:"sql",c:"c",h:"c",cpp:"cpp",hpp:"cpp",go:"go",rs:"rust",kt:"kotlin",rb:"ruby",md:"markdown",markdown:"markdown",mdown:"markdown",mkdn:"markdown",mdx:"markdown",dockerfile:"dockerfile",gradle:"groovy",properties:"properties",graphql:"graphql",proto:"protobuf"};function Ut(e){var a;const n=((a=e.split(/[/\\]/).pop())==null?void 0:a.toLowerCase())??"";if(n==="dockerfile"||n.startsWith("dockerfile."))return"dockerfile";if(n===".env"||n.startsWith(".env."))return"ini";if(n===".bashrc"||n===".zshrc")return"bash";const l=n.includes(".")?n.slice(n.lastIndexOf(".")+1):"";return Bt[l]??null}function Xt(e){const n=[""];for(const l of e){const a=l.split(`
|
|
24
|
-
`);n[n.length-1]+=a[0];for(let x=1;x<a.length;x+=1)n.push(a[x])}return n}function $t({path:e,chunks:n,fileSize:l}){const[a,x]=r.useState(null),g=Ut(e),c=n.length>0&&g!==null&&(l===void 0||l<=it)&&n.reduce((w,u)=>w+u.length,0)<=it;r.useEffect(()=>{if(!c)return;let w=!1;return _t(async()=>{const{highlightCodeLines:u}=await import("./codeSyntax-
|
|
24
|
+
`);n[n.length-1]+=a[0];for(let x=1;x<a.length;x+=1)n.push(a[x])}return n}function $t({path:e,chunks:n,fileSize:l}){const[a,x]=r.useState(null),g=Ut(e),c=n.length>0&&g!==null&&(l===void 0||l<=it)&&n.reduce((w,u)=>w+u.length,0)<=it;r.useEffect(()=>{if(!c)return;let w=!1;return _t(async()=>{const{highlightCodeLines:u}=await import("./codeSyntax-Dgv0FfoZ.js");return{highlightCodeLines:u}},__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url).then(({highlightCodeLines:u})=>{w||x(()=>u)}).catch(()=>{}),()=>{w=!0}},[c]);const f=r.useMemo(()=>Xt(n),[n]),k=r.useMemo(()=>c&&a?a(e,n.join("")):null,[n,c,a,e]);return t.jsx("code",{className:"file-code-preview","data-language":g??void 0,children:f.map((w,u)=>{const C=u<f.length-1?`
|
|
25
25
|
`:"";return t.jsxs(r.Fragment,{children:[t.jsx("span",{className:"file-code-line-number","aria-hidden":"true","data-line-number":u+1}),k?t.jsx("span",{className:"file-code-line-content",dangerouslySetInnerHTML:{__html:k[u]+C}}):t.jsxs("span",{className:"file-code-line-content",children:[w,C]})]},u)})})}const at=new Set(["ts","tsx","js","jsx","mjs","cjs","json","md","markdown","mdown","mkdn","mdx","css","scss","html","htm","xml","yml","yaml","toml","sh","zsh","bash","py","rb","go","rs","java","kt","c","h","cpp","hpp","sql","env","gitignore","dockerfile","txt","log","conf","properties","gradle","lock","csv","vue","svelte","astro","graphql","prisma","proto"]),qt=new Set(["png","jpg","jpeg","gif","webp","bmp","ico","svg"]),Gt=new Set(["html","htm"]),Yt=new Set(["md","markdown","mdown","mkdn","mdx"]),Vt=new Set(at),Jt="allow-scripts allow-popups allow-forms allow-modals",Qt=new Set(["mp4","webm","mov","m4v"]),Zt=new Set(["mp3","wav","m4a","aac","ogg","flac"]),Kt=new Set(["pdf"]),en=8*1024*1024,tn=4096,nn=512*1024,lt=256*1024*1024,rn={aac:"audio/aac",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",gif:"image/gif",html:"text/html",jpeg:"image/jpeg",jpg:"image/jpeg",json:"application/json",m4a:"audio/mp4",m4v:"video/mp4",md:"text/markdown",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",ogg:"audio/ogg",pdf:"application/pdf",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",svg:"image/svg+xml",tar:"application/x-tar",txt:"text/plain",wav:"audio/wav",webm:"video/webm",webp:"image/webp",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"application/xml",zip:"application/zip"};function ct(e,n){return n?!e.share||!e.canShare?"unsupported-browser":"ready":"insecure-context"}function dt(e){const n=ut(e);return rn[n]??"application/octet-stream"}function ut(e){var l;return((l=(de(e)?new URL(e).pathname:e).split(".").pop())==null?void 0:l.toLowerCase())??""}async function ft(e,n){var l;if(!n.share||!((l=n.canShare)!=null&&l.call(n,{files:[e]})))return"unsupported";try{return await n.share({files:[e],title:e.name}),"shared"}catch(a){if(a&&typeof a=="object"&&"name"in a&&a.name==="AbortError")return"cancelled";throw a}}function Ie(e){return Uint8Array.from(atob(e),n=>n.charCodeAt(0))}function mt(e,n,l){return e.decode(Ie(n),{stream:!l})}async function Re(e,n,l=()=>{},a=nn){const x=await n("fs:stat",{path:e});if(x.dir)throw new Error("文件夹不能下载");if(x.size>lt)throw new Error("文件超过 256M,请通过终端传输");const g=[];let c=0;do{const f=await n("fs:read",{path:e,offset:c,length:a},6e4),k=Ie(f.data);if(k.byteLength!==f.bytes)throw new Error("文件分块长度不一致,请重试");g.push(k.slice().buffer);const w=f.offset+f.bytes;if(!f.eof&&w<=c)throw new Error("文件下载未取得进展,请重试");if(c=w,l(x.size===0?100:Math.min(100,Math.round(c/x.size*100))),f.eof)break}while(c<x.size);return new Blob(g,{type:"application/octet-stream"})}function pt(e){var l;const n=((l=e.split(".").pop())==null?void 0:l.toLowerCase())??"";return Gt.has(n)}function xt(e){var l;const n=((l=e.split(".").pop())==null?void 0:l.toLowerCase())??"";return Yt.has(n)}function _e(e){var l;const n=((l=e.split(".").pop())==null?void 0:l.toLowerCase())??"";return Vt.has(n)}function ht(e){const n=ut(e);return at.has(n)||!e.includes(".")?"text":qt.has(n)?"image":Qt.has(n)?"video":Zt.has(n)?"audio":Kt.has(n)?"pdf":"hex"}function sn({path:e,gateway:n,onClose:l}){const a=n.request,[x,g]=r.useState([]),[c,f]=r.useState(null),[k,w]=r.useState(""),[u,C]=r.useState(null),[z,v]=r.useState("initial-loading"),[gt,He]=r.useState(!1),[We,K]=r.useState(0),[fe,me]=r.useState(null),[S,T]=r.useState(null),[Pe,ee]=r.useState(null),[b,te]=r.useState(null),[vt,ne]=r.useState(!1),[Ne,I]=r.useState(null),[j,re]=r.useState(null),[bt,ie]=r.useState(!1),[pe,xe]=r.useState(!0),[se,Fe]=r.useState(null),[Ae,he]=r.useState("unavailable"),[ge,ve]=r.useState(!1),[Oe,be]=r.useState(null),[F,ye]=r.useState("file"),[M,Be]=r.useState(!1),[Ue,we]=r.useState(!1),[ke,Se]=r.useState(!1),[y,O]=r.useState(!1),[L,A]=r.useState(""),[_,Xe]=r.useState(!1),[$e,H]=r.useState(null),[yt,B]=r.useState(!1),qe=r.useRef(null),Ge=r.useRef(null),oe=r.useRef(0),W=r.useRef(!1),p=r.useRef(0),U=r.useRef(!1),je=r.useRef(new TextDecoder("utf-8",{fatal:!1})),Ee=r.useRef(null),X=r.useRef(null),Ce=r.useRef(!1),m=e?ht(e):"unsupported",Le=e?de(e):!1,Ye=e?pt(e):!1,Ve=e?xt(e):!1,wt=Ye||Ve,Je=e?_e(e):!1,D=r.useMemo(()=>x.join(""),[x]),P=r.useCallback(()=>{const i=Ee.current;Ee.current=null,i&&a("fs:preview-close",{ticketId:i}).catch(()=>{})},[a]),$=r.useCallback(async(i,o=!1,s=p.current)=>{if(!U.current){U.current=!0,v(o?"initial-loading":"loading-more"),me(null);try{const d=o?0:oe.current,h=await a("fs:read",{path:i,offset:d,length:256*1024});if(s!==p.current)return;const J=h.offset+h.bytes;if(!h.eof&&J<=d)throw new Error("文件加载未取得进展,请重试");o&&(je.current=new TextDecoder("utf-8",{fatal:!1}));const le=mt(je.current,h.data,h.eof);oe.current=J,xe(h.eof),K(J),g(E=>o?[le]:[...E,le]),C(E=>({size:h.size,mtime:(E==null?void 0:E.mtime)??0})),T(null),v("ready")}catch(d){if(s!==p.current)return;const h=d.message??String(d);o?(T(h),v("error")):(me(h),v("ready"))}finally{s===p.current&&(U.current=!1)}}},[a]),Qe=r.useCallback(async(i,o)=>{try{const s=await a("fs:inspect-text-status",{path:i});if(o!==p.current)return;C({size:s.size,mtime:s.mtime}),he(s.diffStatus),we(!s.tooLarge),B(!1),H(null)}catch{}},[a]),q=r.useCallback(async(i,o=p.current)=>{P(),v("initial-loading"),T(null);try{const s=await a("fs:preview-open",{path:i});if(o!==p.current){a("fs:preview-close",{ticketId:s.ticketId}).catch(()=>{});return}Ee.current=s.ticketId,X.current=s.url,f(s.url),C({size:s.size,mtime:s.mtime})}catch(s){if(o!==p.current)return;T(s.message??String(s)),v("error")}},[P,a]),Ze=r.useCallback(async(i,o=p.current)=>{v("initial-loading"),T(null);try{const s=await a("fs:read",{path:i,offset:0,length:tn});if(o!==p.current)return;kt(s.data),K(s.bytes),C(d=>({size:s.size,mtime:(d==null?void 0:d.mtime)??0})),v("ready")}catch(s){if(o!==p.current)return;T(s.message??String(s)),v("error")}},[a]);function kt(i){const o=atob(i),s=[];for(let d=0;d+16<=o.length||d===0;d+=16){const h=o.slice(d,d+16),J=[...h].map(E=>E.charCodeAt(0).toString(16).padStart(2,"0")).join(" ").padEnd(47," "),le=[...h].map(E=>E.charCodeAt(0)>=32&&E.charCodeAt(0)<127?E:".").join("");if(s.push(`${d.toString(16).padStart(8,"0")} ${J} |${le}|`),d+16>o.length)break}w(s.join(`
|
|
26
26
|
`))}const R=r.useCallback((i,o)=>{const s=++p.current,d=_e(i);if(U.current=!1,P(),X.current=null,g([]),f(null),w(""),C(null),T(null),me(null),K(0),ee(null),te(null),ne(!1),I(null),re(null),ie(!1),xe(!0),Fe(null),he("unavailable"),ve(!1),be(null),ye("file"),we(!1),Se(!1),O(!1),A(""),H(null),B(!1),v("initial-loading"),W.current=!1,oe.current=0,je.current=new TextDecoder("utf-8",{fatal:!1}),de(i)){X.current=i,f(i);return}a("fs:watch",{path:on(i)}).catch(()=>{}),o==="text"?(Qe(i,s),$(i,!0,s),d&&Ce.current&&q(i,s)):o==="image"||o==="video"||o==="audio"||o==="pdf"?q(i,s):o==="hex"&&(a("fs:stat",{path:i}).then(h=>{s===p.current&&C(h)}).catch(()=>{}),Ze(i,s))},[$,Ze,q,Qe,P,a]);r.useEffect(()=>{if(e)return Ce.current=!1,Be(!1),R(e,m),()=>{p.current++,U.current=!1,P()}},[e]),r.useEffect(()=>{let i=null;const o=s=>{const d=s.detail;!d||d!==e||(i!==null&&window.clearTimeout(i),i=window.setTimeout(()=>{m==="text"&&W.current?B(!0):e&&R(e,m)},350))};return window.addEventListener("file-changed",o),()=>{window.removeEventListener("file-changed",o),i!==null&&window.clearTimeout(i)}},[e,m,R]),r.useEffect(()=>{W.current=y},[y]),r.useEffect(()=>{if(z!=="initial-loading"){He(!1);return}const i=window.setTimeout(()=>He(!0),120);return()=>window.clearTimeout(i)},[e,z]),r.useEffect(()=>{const i=Ge.current,o=qe.current;if(!i||!o||!e||m!=="text"||pe||y||F!=="file"||z!=="ready"||fe)return;const s=new IntersectionObserver(d=>{d.some(h=>h.isIntersecting)&&$(e)},{root:o,rootMargin:"0px 0px 360px 0px"});return s.observe(i),()=>s.disconnect()},[y,pe,m,$,fe,e,z,F]);const Ke=r.useCallback((i,o)=>{const s=URL.createObjectURL(i),d=document.createElement("a");d.href=s,d.download=Q(o),d.style.display="none",document.body.appendChild(d),d.click(),d.remove(),window.setTimeout(()=>URL.revokeObjectURL(s),1e3)},[]),St=r.useCallback(async()=>{if(!e||b!==null||j!==null)return;if(de(e)){window.open(e,"_blank","noopener,noreferrer");return}const i=e;ee(null),I(null),ne(!1),te(0);try{const o=await Re(i,a,te);Ke(o,i),ne(!0),window.setTimeout(()=>ne(!1),1500)}catch(o){ee((o==null?void 0:o.message)??String(o))}finally{te(null)}},[Ke,b,e,a,j]),jt=r.useCallback(async()=>{if(!e||j!==null||b!==null)return;const i=e;ee(null),I(null),ie(!1);const o=ct(navigator,window.isSecureContext);if(o==="insecure-context"){I("当前页面是 HTTP,手机 Chrome 仅允许 HTTPS 页面分享文件,请改用 HTTPS 地址后重试");return}if(o==="unsupported-browser"){I("当前浏览器不支持分享文件,请使用最新版手机 Chrome 或系统浏览器");return}re(0);try{const s=await Re(i,a,re),d=new File([s],Q(i),{type:dt(i),lastModified:(u==null?void 0:u.mtime)??Date.now()}),h=await ft(d,navigator);h==="unsupported"?I("当前浏览器不支持分享此文件类型,请使用下载按钮"):h==="shared"&&(ie(!0),window.setTimeout(()=>ie(!1),1500))}catch(s){I((s==null?void 0:s.message)??String(s))}finally{re(null)}},[b,u==null?void 0:u.mtime,e,a,j]),ae=r.useCallback(async(i,o)=>{const s=await a("fs:inspect-text",{path:i},6e4);return o!==p.current?null:(C({size:s.size,mtime:s.mtime}),he(s.diffStatus),Fe(s.patch),we(!s.tooLarge&&s.validUtf8),s)},[a]),Et=r.useCallback(async()=>{if(!e||ke)return;const i=p.current;Se(!0),H(null);try{const o=await ae(e,i);if(!o)return;if(o.tooLarge||o.data===null)throw new Error("文件超过 8M,无法在线编辑");if(!o.validUtf8)throw new Error("此文件不是有效的 UTF-8 文本,无法在线编辑");const s=new TextDecoder("utf-8",{fatal:!1}).decode(Ie(o.data));g([s]),K(o.size),oe.current=o.size,xe(!0),A(s),B(!1),W.current=!0,O(!0)}catch(o){i===p.current&&H(o.message??String(o))}finally{i===p.current&&Se(!1)}},[ke,ae,e]),et=r.useCallback(async()=>{if(!e||ge||(ye("diff"),se!==null))return;const i=p.current;ve(!0),be(null);try{await ae(e,i)}catch(o){i===p.current&&be(o.message??String(o))}finally{i===p.current&&ve(!1)}},[ge,ae,se,e]),Ct=r.useCallback(()=>{if(!e)return;const i=!M;Ce.current=i,Be(i),i&&!c&&q(e,p.current)},[q,c,e,M]),G=r.useCallback(i=>{X.current===i&&(T(null),v("ready"))},[]),Y=r.useCallback(i=>{X.current===i&&(T("文件预览加载失败,请重试"),v("error"))},[]),Lt=r.useCallback(()=>{e&&R(e,m)},[m,e,R]),zt=r.useCallback(()=>{L!==D&&!window.confirm("放弃未保存的修改?")||(W.current=!1,O(!1),A(""),H(null),B(!1))},[L,D]),Tt=r.useCallback(()=>{y&&L!==D&&!window.confirm("放弃未保存的修改并关闭预览?")||(p.current++,P(),l())},[L,y,l,P,D]),Mt=r.useCallback(()=>{e&&(W.current=!1,O(!1),A(""),R(e,"text"))},[e,R]),Rt=r.useCallback(async()=>{if(!(!e||!u||_||L===D)){Xe(!0),H(null);try{await a("fs:write-text",{path:e,content:L,expectedSize:u.size,expectedMtime:u.mtime},6e4),W.current=!1,O(!1),A(""),R(e,"text")}catch(i){H((i==null?void 0:i.message)??String(i))}finally{Xe(!1)}}},[L,u,e,a,_,R,D]),V=r.useMemo(()=>Ot(se??""),[se]);if(!e)return null;const tt=((u==null?void 0:u.size)??0)>en,ze=!tt&&(Ae==="changed"||Ae==="untracked"),nt=m==="text"&&Ue&&z!=="initial-loading"&&!ke&&!S;return t.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"var(--ui-term-col-bg, #101014)",color:"var(--ui-text, #e8e8ee)",colorScheme:"var(--ui-color-scheme, dark)",accentColor:"var(--ui-tab-accent, #7aa2f7)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderBottom:"1px solid var(--ui-tree-border, #222)",background:"var(--ui-tree-bg, #121218)",flexShrink:0},children:[t.jsx("span",{className:"pv-name",style:{minWidth:0,flex:"1 1 auto",fontSize:12.5,color:"var(--ui-text, #e8e8ee)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Q(e)}),u&&t.jsx("span",{style:{fontSize:10.5,color:"var(--ui-history-meta, #666)",flexShrink:0},children:Te(u.size)}),y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:zt,disabled:_,style:N,"aria-label":"取消编辑",title:"取消编辑",children:t.jsx(It,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),t.jsx("button",{type:"button",onClick:Rt,disabled:_||L===D,style:{...N,color:"var(--ui-tab-accent, #7aa2f7)",opacity:_||L===D?.55:1},"aria-label":_?"正在保存":"保存修改",title:_?"正在保存":"保存修改",children:_?t.jsx(Z,{className:"tree-spin",size:15,strokeWidth:1.8,"aria-hidden":"true"}):t.jsx(Nt,{size:15,strokeWidth:1.8,"aria-hidden":"true"})})]}):t.jsxs(t.Fragment,{children:[m==="text"&&t.jsx("button",{type:"button",onClick:Et,disabled:!nt,style:{...N,opacity:nt?1:.45},"aria-label":"编辑文件",title:tt?"文件超过 8M,无法在线编辑":Ue?"编辑文件":"此文件不可编辑",children:t.jsx(Ht,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),t.jsx("button",{type:"button",onClick:St,disabled:b!==null||j!==null,style:{...N,opacity:b!==null||j!==null?.72:1},"aria-label":Le?"打开原始地址":b===null?"下载到当前设备":`正在下载 ${b}%`,title:Le?"打开原始地址":b===null?"下载到当前设备":`正在下载 ${b}%`,children:b!==null?t.jsx(Z,{className:"tree-spin",size:15,strokeWidth:1.8,"aria-hidden":"true"}):vt?t.jsx(rt,{size:15,strokeWidth:1.8,"aria-hidden":"true"}):t.jsx(Wt,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),!Le&&t.jsx("button",{type:"button",onClick:jt,disabled:j!==null||b!==null,style:{...N,opacity:j!==null||b!==null?.72:1},"aria-label":"分享文件",title:j===null?"分享文件":`正在准备 ${j}%`,children:j!==null?t.jsx(Z,{className:"tree-spin",size:15,strokeWidth:1.8,"aria-hidden":"true"}):bt?t.jsx(rt,{size:15,strokeWidth:1.8,"aria-hidden":"true"}):t.jsx(Ft,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),Je&&t.jsx("button",{type:"button",onClick:Ct,"aria-pressed":M,style:{...N,...M?{color:"var(--ui-tab-accent, #7aa2f7)",borderColor:"var(--ui-tab-accent, #7aa2f7)"}:{}},"aria-label":M?"退出浏览器预览":"浏览器预览",title:M?"退出浏览器预览":Ye?"在浏览器中预览渲染效果":Ve?"预览 Markdown 排版效果":"在浏览器中查看原始文件",children:t.jsx(Pt,{size:15,strokeWidth:1.8,"aria-hidden":"true"})})]}),t.jsx("button",{type:"button",onClick:Tt,style:N,"aria-label":"关闭预览",title:"关闭预览",children:t.jsx(Dt,{size:15,strokeWidth:1.8,"aria-hidden":"true"})})]}),m==="text"&&ze&&!y&&!M&&t.jsxs("div",{style:{display:"flex",alignItems:"center",minHeight:34,padding:"0 12px",borderBottom:"1px solid var(--ui-tree-border, #222)",background:"var(--ui-tree-bg, #121218)",flexShrink:0},children:[t.jsxs("div",{role:"tablist","aria-label":"文件预览模式",style:{display:"inline-flex",gap:2,padding:2,border:"1px solid var(--ui-panel-input-border, #333)",borderRadius:6,background:"var(--ui-muted-surface, #1b1b22)"},children:[t.jsx(st,{active:F==="diff",onClick:et,children:"变更"}),t.jsx(st,{active:F==="file",onClick:()=>ye("file"),children:"文件"})]}),t.jsxs("span",{style:{marginLeft:9,display:"inline-flex",gap:7,fontFamily:'"SF Mono", Menlo, Consolas, monospace',fontSize:10.5},children:[V.added>0&&t.jsxs("span",{style:{color:"var(--ui-success, #059669)"},children:["+",V.added]}),V.removed>0&&t.jsxs("span",{style:{color:"var(--ui-error, #dc2626)"},children:["-",V.removed]})]})]}),Ne&&t.jsxs("div",{role:"alert",style:{flexShrink:0,padding:"8px 12px",borderBottom:"1px solid var(--ui-tree-border, #222)",background:"var(--ui-tree-bg, #121218)",color:"var(--ui-error, #f7768e)",fontSize:12.5,lineHeight:1.5},children:["分享失败:",Ne]}),t.jsxs("div",{ref:qe,className:"pv-body",style:{position:"relative",flex:1,minHeight:0,overflow:"auto",background:"var(--ui-term-col-bg, #101014)",WebkitOverflowScrolling:"touch"},children:[Pe&&t.jsxs("div",{style:{padding:"10px 14px 0",color:"var(--ui-error, #f7768e)",fontSize:12.5},children:["下载失败:",Pe]}),$e&&t.jsx("div",{role:"alert",style:{padding:"10px 14px",color:"var(--ui-error, #f7768e)",fontSize:12.5},children:$e}),yt&&y&&t.jsxs("div",{role:"alert",style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:"1px solid var(--ui-tree-border, #222)",color:"var(--ui-error, #f7768e)",fontSize:12},children:[t.jsx("span",{style:{flex:1},children:"文件已在其他位置更新"}),t.jsxs("button",{type:"button",onClick:Mt,style:De,children:[t.jsx(Me,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),"重新加载"]})]}),c&&!S&&m==="image"&&t.jsx("img",{src:c,alt:e,onLoad:()=>G(c),onError:()=>Y(c),style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",margin:"0 auto"}}),c&&!S&&m==="video"&&t.jsx("video",{src:c,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:()=>G(c),onError:()=>Y(c),style:{maxWidth:"100%",maxHeight:"100%",display:"block",margin:"0 auto"}}),c&&!S&&m==="audio"&&t.jsx("div",{style:{display:"grid",placeItems:"center",height:"100%"},children:t.jsx("audio",{src:c,controls:!0,autoPlay:!0,onLoadedMetadata:()=>G(c),onError:()=>Y(c),style:{width:"min(420px, 88%)"}})}),c&&!S&&m==="pdf"&&t.jsx("iframe",{src:c,title:e,onLoad:()=>G(c),onError:()=>Y(c),style:{width:"100%",height:"100%",border:"none"}}),c&&!S&&m==="text"&&Je&&M&&!y&&t.jsx("iframe",{src:wt?`${c}/${encodeURIComponent(Q(e))}`:c,sandbox:Jt,title:e,onLoad:()=>G(c),onError:()=>Y(c),style:{width:"100%",height:"100%",border:"none",background:"#fff"}}),m==="text"&&y&&!S&&t.jsx("textarea",{value:L,onChange:i=>A(i.target.value),spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-label":`编辑 ${Q(e)}`,style:{width:"100%",minHeight:"100%",boxSizing:"border-box",resize:"none",margin:0,padding:"12px 14px calc(env(safe-area-inset-bottom) + 36px)",border:0,outline:0,background:"var(--ui-term-col-bg, #101014)",color:"var(--ui-history-item-text, var(--ui-text, #d6d6de))",fontFamily:'"SF Mono", Menlo, Consolas, monospace',fontSize:12,lineHeight:1.5,tabSize:2}}),m==="text"&&!y&&!S&&ze&&F==="diff"&&(Oe?t.jsx(ce,{label:Oe,actionLabel:"重试",onAction:()=>void et(),tone:"error"}):ge?t.jsx(ce,{label:"正在加载变更"}):t.jsx(an,{rows:V.rows})),(m==="hex"||m==="text"&&!y&&!M&&(!ze||F==="file"))&&!S&&t.jsxs(t.Fragment,{children:[t.jsx("pre",{style:{margin:0,padding:"11px 13px calc(env(safe-area-inset-bottom) + 36px)",fontFamily:'"SF Mono", Menlo, Consolas, monospace',fontSize:m==="hex"?10.5:12,lineHeight:1.45,color:m==="hex"?"var(--ui-muted-text, #9aa)":"var(--ui-history-item-text, var(--ui-text, #d6d6de))",whiteSpace:m==="hex"?"pre":"pre-wrap",wordBreak:m==="hex"?"normal":"break-word"},children:m==="hex"?k:t.jsx($t,{path:e,chunks:x,fileSize:u==null?void 0:u.size})}),m==="text"&&!pe&&t.jsxs("div",{ref:Ge,role:"status","aria-live":"polite",style:{minHeight:44,padding:"0 14px calc(env(safe-area-inset-bottom) + 8px)",display:"flex",alignItems:"center",justifyContent:"center",gap:7,color:"var(--ui-history-meta, #666)",fontSize:11.5},children:[z==="loading-more"&&t.jsx(Z,{className:"tree-spin",size:14,strokeWidth:1.8,"aria-hidden":"true",style:{color:"var(--ui-tab-accent, #7aa2f7)"}}),fe?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"加载失败"}),t.jsxs("button",{type:"button",onClick:()=>$(e),style:De,children:[t.jsx(Me,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),"重试"]})]}):t.jsx("span",{children:z==="loading-more"?"正在加载更多":`${Te(We)} / ${Te((u==null?void 0:u.size)??We)}`})]})]}),gt&&z==="initial-loading"&&t.jsx(ce,{label:"正在加载文件"}),S&&z==="error"&&t.jsx(ce,{label:S,actionLabel:"重试",onAction:Lt,tone:"error"})]})]})}function Q(e){return e.slice(e.lastIndexOf("/")+1)||e}function on(e){const n=e.lastIndexOf("/");return n>0?e.slice(0,n):"/"}function Te(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}K`:`${(e/1024/1024).toFixed(1)}M`}const N={width:28,height:28,borderRadius:7,border:"1px solid var(--ui-panel-input-border, #333)",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--ui-muted-surface, #1b1b22)",color:"var(--ui-muted-text, #ccc)",flexShrink:0,cursor:"pointer",WebkitAppRegion:"no-drag"},De={minHeight:28,padding:"0 9px",borderRadius:6,border:"1px solid var(--ui-panel-input-border, #333)",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:5,background:"var(--ui-muted-surface, #1b1b22)",color:"var(--ui-muted-text, #ccc)",cursor:"pointer",fontSize:11};function ce({label:e,actionLabel:n,onAction:l,tone:a="muted"}){return t.jsxs("div",{role:a==="error"?"alert":"status",style:{position:"absolute",inset:0,minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,color:a==="error"?"var(--ui-error, #f7768e)":"var(--ui-muted-text, #9aa)",fontSize:12.5},children:[a!=="error"&&t.jsx(Z,{className:"tree-spin",size:18,strokeWidth:1.8,"aria-hidden":"true",style:{color:"var(--ui-tab-accent, #7aa2f7)"}}),t.jsx("span",{children:e}),n&&l&&t.jsxs("button",{type:"button",onClick:l,style:De,children:[t.jsx(Me,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),n]})]})}function st({active:e,onClick:n,children:l}){return t.jsx("button",{type:"button",role:"tab","aria-selected":e,onClick:n,style:{minWidth:48,height:24,padding:"0 9px",border:0,borderRadius:4,background:e?"var(--ui-tab-accent, #7aa2f7)":"transparent",color:e?"var(--ui-tab-active-text, #fff)":"var(--ui-muted-text, #9aa)",fontSize:11,fontWeight:600,cursor:"pointer"},children:l})}function an({rows:e}){return t.jsx("div",{style:{minWidth:"100%",width:"max-content",paddingBottom:"calc(env(safe-area-inset-bottom) + 36px)",fontFamily:'"SF Mono", Menlo, Consolas, monospace',fontSize:11.5,lineHeight:1.55},children:e.map((n,l)=>{const a=n.kind==="added",x=n.kind==="removed",g=n.kind==="hunk"||n.kind==="meta"||n.kind==="note",c=a?"color-mix(in srgb, var(--ui-success, #059669) 12%, transparent)":x?"color-mix(in srgb, var(--ui-error, #dc2626) 11%, transparent)":n.kind==="hunk"?"color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 10%, transparent)":"transparent",f=a?"var(--ui-success, #059669)":x?"var(--ui-error, #dc2626)":g?"var(--ui-muted-text, #9aa)":"var(--ui-history-item-text, var(--ui-text, #d6d6de))";return t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"42px 42px 22px minmax(0, 1fr)",minHeight:18,background:c,color:f},children:[t.jsx("span",{style:ot,children:n.oldLine??""}),t.jsx("span",{style:ot,children:n.newLine??""}),t.jsx("span",{style:{textAlign:"center",userSelect:"none",color:f},children:a?"+":x?"-":" "}),t.jsx("span",{style:{padding:"0 12px 0 6px",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:n.text||" "})]},`${n.kind}-${l}`)})})}const ot={padding:"0 6px",borderRight:"1px solid var(--ui-tree-border, #222)",color:"var(--ui-history-meta, #666)",textAlign:"right",userSelect:"none"},pn=Object.freeze(Object.defineProperty({__proto__:null,MAX_CLIENT_DOWNLOAD_BYTES:lt,decodeTextChunk:mt,default:sn,isBrowserPreviewPath:_e,isHtmlPreviewPath:pt,isMarkdownPreviewPath:xt,kindOf:ht,mimeTypeForPath:dt,nativeFileShareReadiness:ct,readFileForClientDownload:Re,shareFileWithNativePicker:ft},Symbol.toStringTag,{value:"Module"}));export{Wt as D,sn as F,it as M,mn as a,pn as b,Ut as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as se,r as a,j as s,X as oe,d as Y,P as de}from"./index
|
|
1
|
+
import{c as se,r as a,j as s,X as oe,d as Y,P as de}from"./index--zKd3rTs.js";import{S as ue,i as Z,F as fe,D as pe,P as xe,a as he,b as me,c as je,d as be,N as ye,e as ve,f as ze,g as ke,h as Ne,j as Fe}from"./file-types-XHMBkbNr.js";import{L as _}from"./loader-circle-DMWQZenY.js";import{C as S,F as T}from"./trash-2-CHYPyYDY.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/runtime/webapp/dist/assets/{FlowStudioPane-BBf0zyw1.js → FlowStudioPane-CCuxZBVJ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,b as p,j as t}from"./index
|
|
1
|
+
import{r as a,b as p,j as t}from"./index--zKd3rTs.js";import{F as w}from"./page-Cc56wyOt.js";import{R as y}from"./rotate-cw-D-M3ZDSa.js";import"./smartphone-D7oS3YTz.js";import"./artifact-links-nzx7joYs.js";import"./trash-2-CHYPyYDY.js";import"./clipboard-BteN9-AC.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./SessionDashboardBridge-DYsMZhuH.js";import"./RemoteDesktopTabBridge-Cp9mLtcY.js";const g=new Set(["127.0.0.1","localhost","[::1]"]);function h(s,e){const o=new URL(s),r=new URL(e);return g.has(o.hostname)&&o.hostname!==r.hostname&&(o.hostname=r.hostname),o.toString()}function L({visible:s}){const[e,o]=a.useState(null),[r,n]=a.useState("loading"),[u,f]=a.useState(0);a.useEffect(()=>{if(!s||e)return;let i=!1;return n("loading"),fetch("/api/flow-studio/config",{credentials:"same-origin"}).then(async c=>{if(!c.ok)throw new Error("Flow Studio config request failed");const d=await c.json();if(!d.entryUrl)throw new Error("Flow Studio entry is not configured");const l=new URL(d.entryUrl);if(l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Flow Studio entry URL is invalid");i||o(h(l.toString(),p()))}).catch(()=>{i||n("error")}),()=>{i=!0}},[u,e,s]),a.useEffect(()=>{if(!e||r!=="loading")return;const i=window.setTimeout(()=>n("error"),3e4);return()=>window.clearTimeout(i)},[e,r]);const m=()=>{o(null),n("loading"),f(i=>i+1)};return t.jsxs("div",{style:{position:"absolute",inset:0,background:"var(--ui-term-col-bg, #101014)"},"aria-busy":r==="loading",children:[e&&t.jsx("iframe",{src:e,title:"Flow Studio 数字人",referrerPolicy:"no-referrer",allow:"camera; microphone; autoplay; clipboard-read; clipboard-write; fullscreen",allowFullScreen:!0,onLoad:()=>n("ready"),onError:()=>n("error"),className:r==="ready"?"flow-frame flow-frame-ready":"flow-frame",style:{display:"block",width:"100%",height:"100%",border:0,background:"var(--ui-term-col-bg, #101014)"}},e),r==="loading"&&t.jsx(w,{}),r==="error"&&t.jsxs("div",{role:r==="error"?"alert":"status","aria-live":"polite",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,color:"var(--ui-text, #e5e7eb)",background:"var(--ui-term-col-bg, #101014)"},children:[t.jsx("strong",{children:r==="error"?"无法打开 Flow Studio":"正在打开 Flow Studio"}),r==="error"&&t.jsxs("button",{type:"button","aria-label":"重试加载 Flow Studio",onClick:m,title:"重新加载 Flow Studio",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,width:"auto",height:32,padding:"0 10px",border:"1px solid var(--ui-muted-border, #3b3d46)",borderRadius:6,background:"transparent",color:"inherit",cursor:"pointer"},children:[t.jsx(y,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:"重试"})]})]}),t.jsx("style",{jsx:!0,children:`
|
|
2
2
|
.flow-frame { opacity: 0; transform: translateY(8px) scale(.995); transition: opacity 420ms ease, transform 520ms cubic-bezier(.2,.8,.2,1); }
|
|
3
3
|
.flow-frame-ready { opacity: 1; transform: none; }
|
|
4
4
|
@media (prefers-reduced-motion: reduce) { .flow-frame { transform: none; transition: none; } }
|
package/runtime/webapp/dist/assets/{RemoteDesktopPage-CWW4T1QF.js → RemoteDesktopPage-DpoYuKhA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,u as r,j as u}from"./index
|
|
1
|
+
import{r as t,u as r,j as u}from"./index--zKd3rTs.js";import{B as l}from"./BrowserLivePanel-B1zYRS_7.js";import{R as f,a as d,b as w,r as g}from"./RemoteDesktopTabBridge-Cp9mLtcY.js";import"./loader-circle-DMWQZenY.js";import"./clipboard-BteN9-AC.js";import"./rotate-ccw-CKqo62Ra.js";function b(){const[s,n]=t.useState(!1),[c,i]=t.useState(!1),[a,E]=t.useState(r.getState().skin);t.useEffect(()=>r.subscribe(e=>E(e.skin)),[]),t.useEffect(()=>{document.documentElement.dataset.skin=a,document.body.dataset.remoteDesktop="1"},[a]),t.useEffect(()=>{const e=p=>{const o=g(p,location.origin,window.parent);o!==null&&(n(o),o&&i(!0))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),t.useEffect(()=>{if(!s)return;const e=requestAnimationFrame(()=>{window.parent.postMessage({type:f},location.origin)});return()=>cancelAnimationFrame(e)},[s]);const m=t.useCallback(e=>{window.parent.postMessage({type:d,fullscreen:e},location.origin)},[]);return u.jsx(l,{onFullscreenChange:m,open:c,active:s,onClose:()=>{i(!1),n(!1),window.parent.postMessage({type:w},location.origin)}})}export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.session-dashboard{height:100%;overflow:auto;padding:28px clamp(16px,4vw,48px) 60px;box-sizing:border-box;color:var(--text-primary);background:var(--bg-deepest);font:14px var(--font-body,system-ui,sans-serif)}.session-dashboard button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 10px;border:1px solid var(--border-subtle);border-radius:8px;background:var(--bg-surface);color:inherit;font:inherit;font-size:12px;cursor:pointer}.session-dashboard button:hover{background:var(--control-hover)}.session-dashboard button:disabled{opacity:.5;cursor:default}.session-dashboard :is(button,input,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}.session-dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.session-dashboard h1{font-size:28px;margin:5px 0 7px;letter-spacing:-.035em;display:flex;align-items:center;gap:12px}.session-dashboard-heading p{margin:0;color:var(--text-secondary);font-size:12px}.session-dashboard-live{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--border-subtle);padding:4px 7px;border-radius:20px;color:var(--success,#328568);font-size:10px;letter-spacing:0;font-weight:500}.session-dashboard-live i,.session-dashboard-running-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--success,#328568);flex-shrink:0}.session-dashboard-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.session-dashboard-toolbar>button{white-space:nowrap}.session-dashboard-toolbar>button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}.session-dashboard .session-dashboard-new-session{border-color:var(--accent);background:var(--accent);color:var(--text-inverse);font-weight:600}.session-dashboard .session-dashboard-new-session:hover{border-color:color-mix(in srgb,var(--accent) 84%,#000);background:color-mix(in srgb,var(--accent) 84%,#000)}.session-dashboard-stats{display:flex;align-items:center;flex-wrap:wrap;gap:22px;padding:15px 17px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--bg-surface);margin-bottom:25px}.session-dashboard-stats>span{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-secondary)}.session-dashboard-stats strong{font-size:21px;color:var(--text-primary);font-weight:600}.session-dashboard-stats small{margin-left:auto;color:var(--text-tertiary,var(--text-secondary));font-size:11px}.session-dashboard .needs-attention,.session-dashboard .needs-attention strong{color:var(--warning,#b27820)}.session-dashboard-section-title{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px;gap:10px}.session-dashboard h2{display:flex;align-items:center;gap:8px;font-size:16px;margin:0}.session-dashboard h2 small{color:var(--text-secondary);font-size:11px;font-weight:400;margin-left:4px}.session-dashboard-section-title>button{border:0;background:transparent;color:var(--text-secondary)}.session-dashboard-group-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,335px),1fr));gap:13px;align-items:start}.session-dashboard-group-create{display:flex;justify-content:flex-start}.session-dashboard-group{min-width:0;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:13px;padding:15px;transition:border-color .16s}.session-dashboard-group:hover,.session-dashboard-group:focus-within{border-color:var(--accent)}.session-dashboard-group.is-waiting{border-color:color-mix(in srgb,var(--warning,#b27820) 45%,var(--border-subtle))}.session-dashboard-group>header{display:flex;justify-content:space-between;align-items:center;gap:8px}.session-dashboard button.session-dashboard-title{min-width:0;border:0;padding:0;background:transparent;text-align:left;justify-content:flex-start;font-size:15px}.session-dashboard-title svg{color:var(--accent);flex-shrink:0}.session-dashboard-title strong{overflow-wrap:anywhere}.session-dashboard-status{flex-shrink:0;font-size:10px;color:var(--text-secondary);padding:4px 7px;border-radius:6px;background:var(--bg-elevated)}.session-dashboard-status.is-running{color:var(--success,#328568)}.session-dashboard-status.is-waiting{color:var(--warning,#b27820)}.session-dashboard-progress{font-size:12px;line-height:1.7;color:var(--text-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px;margin:12px 0;overflow-wrap:anywhere}.session-dashboard-meta{display:flex;flex-wrap:wrap;gap:10px;font-size:10px;color:var(--text-secondary);margin-bottom:10px}.session-dashboard-meta span{display:inline-flex;align-items:center;gap:4px}.session-dashboard-linked{border-top:1px solid var(--border-subtle);border-bottom:1px solid var(--border-subtle);margin:10px 0}.session-dashboard summary{cursor:pointer;font-size:11px;color:var(--text-secondary);padding:9px 0}.session-dashboard-linked>summary{display:flex;justify-content:space-between;list-style:none}.session-dashboard-linked>summary::-webkit-details-marker{display:none}.session-dashboard-linked>summary svg{opacity:.25;transition:transform .15s,opacity .15s}.session-dashboard-group:is(:hover,:focus-within) .session-dashboard-linked>summary svg,.session-dashboard-linked[open]>summary svg{opacity:1}.session-dashboard-linked[open]>summary svg{transform:rotate(180deg)}.session-dashboard button.session-dashboard-session{width:100%;border:0;border-radius:5px;background:transparent;justify-content:flex-start;text-align:left;padding:8px 2px}.session-dashboard-session>span{min-width:0;flex:1}.session-dashboard-session strong,.session-dashboard-session small{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:11px}.session-dashboard-session small{font-size:10px;color:var(--text-secondary);margin-top:3px}.session-dashboard-session em{font-size:10px;color:var(--text-secondary);font-style:normal}.session-dashboard-policy p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;color:var(--text-secondary);line-height:1.7}.session-dashboard-config{font-size:11px;line-height:1.7;color:var(--warning,#b27820)}.session-dashboard-config button{margin-top:6px}.session-dashboard-decision{padding:11px;margin:12px 0;border-radius:9px;border:1px solid color-mix(in srgb,var(--warning,#b27820) 35%,var(--border-subtle));background:color-mix(in srgb,var(--warning,#b27820) 4%,var(--bg-surface))}.session-dashboard-decision>p{font-size:12px;line-height:1.7;margin:0 0 9px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:230px;overflow:auto}.session-dashboard-recommendation{color:var(--text-secondary)}.session-dashboard-options{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.session-dashboard-options label{display:flex;align-items:center;gap:5px;flex-wrap:wrap;font-size:11px}.session-dashboard-options small{color:var(--text-secondary)}.session-dashboard-decision form{display:flex;gap:6px}.session-dashboard-decision form>button{flex-shrink:0;white-space:nowrap}.session-dashboard-decision input:not([type=checkbox]){min-width:0;width:100%;padding:7px 8px;color:var(--text-primary);background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:7px;font:inherit;font-size:12px}.session-dashboard button.session-dashboard-source{border:0;background:transparent;color:var(--accent);font-size:10px;padding:5px 0;margin-top:4px}.session-dashboard-history p{font-size:11px;color:var(--text-secondary);line-height:1.6;padding-bottom:5px;overflow-wrap:anywhere;white-space:pre-wrap}.session-dashboard-history{max-height:260px;overflow:auto}.session-dashboard-history time,.session-dashboard-history small{font-size:10px;color:var(--text-tertiary,var(--text-secondary))}.session-dashboard-group>footer{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px}.session-dashboard-group>footer>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-secondary);font-size:10px}.session-dashboard-group>footer>button{border:0;background:transparent;flex-shrink:0;padding-right:0;color:var(--accent)}.session-dashboard-agent{margin-top:27px}.session-dashboard-agent-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,335px),1fr));gap:9px;align-items:start}.session-dashboard button.session-dashboard-agent-session{display:flex;gap:9px;padding:13px;justify-content:flex-start;text-align:left;min-width:0}.session-dashboard-session-brand{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--text-secondary)}.session-dashboard-agent-session>span:nth-child(2){flex:1;min-width:0}.session-dashboard-agent-session strong,.session-dashboard-agent-session small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-dashboard-agent-session strong{font-size:12px;font-weight:500}.session-dashboard-agent-session small{font-size:10px;color:var(--text-secondary);margin-top:5px}.session-dashboard-agent-session>span:nth-child(3){font-size:10px;color:var(--success,#328568)}.session-dashboard-agent-empty,.session-dashboard-empty{border:1px dashed var(--border-subtle);padding:16px;border-radius:9px;font-size:12px;color:var(--text-secondary);margin:0}.session-dashboard-empty button{margin-left:8px}.supervision-notice{position:fixed;right:20px;bottom:22px;z-index:1250;max-width:min(430px,calc(100vw - 30px));display:flex;align-items:center;gap:8px;border:1px solid var(--border-subtle);border-radius:11px;background:var(--bg-elevated);color:var(--text-primary);box-shadow:0 6px 24px #0002;padding:10px 12px;font-size:12px}.supervision-notice-heading button{border:0;background:transparent;color:inherit;cursor:pointer;font:inherit}.supervision-notice-heading button:first-child{display:flex;align-items:center;gap:7px;text-align:left}.supervision-notice{display:block}.supervision-notice-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.supervision-notice.is-expanded{width:min(410px,calc(100vw - 54px))}.session-dashboard.supervision-notice-content{padding:12px 0 0;height:auto;max-height:58vh;overflow:auto;background:transparent}.supervision-notice-content>strong{display:block;font-size:11px;color:var(--text-secondary);overflow-wrap:anywhere}@media (max-width:650px){.session-dashboard{padding:18px 12px 70px}.session-dashboard-heading{flex-wrap:wrap}.session-dashboard-toolbar{margin-left:auto}.session-dashboard h1{font-size:24px}.session-dashboard-stats{gap:12px}.session-dashboard-stats small{flex-basis:100%;margin:0}.session-dashboard h2{flex-wrap:wrap}.session-dashboard h2 small{font-size:10px}.session-dashboard button{min-height:42px}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{c as v,r as x,j as s,u as A,R as $,f as P,X as B,A as z,d as U}from"./index--zKd3rTs.js";import{p as D,S as G,a as H,r as q,b as V}from"./SessionDashboardBridge-DYsMZhuH.js";import{c as C,U as I,A as S,D as Y}from"./collaboration-f29NaKWy.js";import{A as k}from"./arrow-right-B0uCZ1Pd.js";import{S as F}from"./shield-check-SeEkz1Nd.js";/**
|
|
2
|
+
* @license lucide-react v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const T=v("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
7
|
+
* @license lucide-react v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const X=v("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
12
|
+
* @license lucide-react v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const J=v("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
17
|
+
* @license lucide-react v0.468.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const K=v("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
22
|
+
* @license lucide-react v0.468.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Q=v("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);let f;function w(e){if(f==null||f(),e.kind==="session"&&window.parent!==window&&document.body.dataset.agentroamChatNavigation!=="ready"){const n=window.parent,h=window.location.origin,o=new Set,d=()=>{n.removeEventListener("message",g),window.removeEventListener("pagehide",d),clearTimeout(u),f===d&&(f=void 0)},g=t=>{var a,l;t.origin!==h||!t.source||t.source===window||!Array.from({length:n.frames.length},(b,j)=>n.frames[j]).includes(t.source)||(((a=t.data)==null?void 0:a.type)===G&&t.data.sessionId===e.session.id?d():((l=t.data)==null?void 0:l.type)===H&&typeof t.data.instanceId=="string"&&!o.has(t.data.instanceId)?(o.add(t.data.instanceId),D(e)):q(t,h,t.source)&&d())},u=setTimeout(d,3e4);f=d,n.addEventListener("message",g),window.addEventListener("pagehide",d,{once:!0})}D(e)}function R({text:e,options:n,recommendation:h,multiSelect:o,sourceOnly:d,onAnswer:g,onSource:u}){const[t,a]=x.useState(""),[l,b]=x.useState([]),[j,m]=x.useState(!1),[i,p]=x.useState(""),r=async(c,y)=>{if(!(!c.trim()||j)){m(!0),p("");try{await g(c,y),a("")}catch(N){p(N instanceof Error?N.message:"答复失败,请刷新核对")}finally{m(!1)}}};return s.jsxs("section",{className:"session-dashboard-decision","aria-label":"待处理决策",children:[s.jsx("p",{children:e}),h&&s.jsxs("p",{className:"session-dashboard-recommendation",children:["建议:",h]}),!d&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"session-dashboard-options",children:n==null?void 0:n.map((c,y)=>o?s.jsxs("label",{title:c.description,children:[s.jsx("input",{type:"checkbox",checked:l.includes(y),disabled:j,onChange:N=>b(E=>N.target.checked?[...E,y]:E.filter(_=>_!==y))}),c.label,s.jsx("small",{children:c.description})]},y):s.jsx("button",{type:"button",disabled:j,title:c.description,onClick:()=>void r(c.label,[y]),children:c.label},y))}),o&&!!l.length&&s.jsx("button",{type:"button",disabled:j,onClick:()=>void r(l.map(c=>n[c].label).join("、"),l),children:"确认所选"}),s.jsxs("form",{onSubmit:c=>{c.preventDefault(),r(t)},children:[s.jsx("input",{"aria-label":"答复此决策",value:t,maxLength:1e4,placeholder:"输入你的决定",onChange:c=>a(c.target.value)}),s.jsx("button",{disabled:j||!t.trim(),children:j?"处理中…":"答复"})]})]}),i&&s.jsx("p",{role:"alert",className:"collab-error",children:i}),s.jsx("button",{type:"button",className:"session-dashboard-source",onClick:u,children:d?"进入原会话填写":"查看来源会话"})]})}function W(){const[e,n]=x.useState(null),[h,o]=x.useState(""),[d,g]=x.useState(!0),u=x.useRef(!1),t=x.useRef(!0),a=x.useCallback(async()=>{if(!u.current){u.current=!0;try{const l=await C({action:"dashboard"});t.current&&(n(l),o(""))}catch(l){t.current&&o(l instanceof Error?l.message:"无法加载看板")}finally{u.current=!1,t.current&&g(!1)}}},[]);return x.useEffect(()=>{t.current=!0,a();const l=setInterval(()=>{document.hidden||a()},5e3),b=()=>{a()};return window.addEventListener("focus",b),()=>{t.current=!1,clearInterval(l),window.removeEventListener("focus",b)}},[a]),{snapshot:e,error:h,loading:d,refresh:a}}function O({incident:e,target:n,refresh:h,onOpen:o}){var d,g,u;return s.jsx(R,{text:e.message,options:((d=e.question)==null?void 0:d.options)??e.options,recommendation:e.recommendation,multiSelect:(g=e.question)==null?void 0:g.multiSelect,sourceOnly:(u=e.question)==null?void 0:u.requiresSource,onSource:()=>o(n),onAnswer:async(t,a)=>{await C({action:"answerSupervision",groupId:e.groupId,incidentId:e.id,answer:t,selectedIndices:a}),await h()}})}function M({item:e,onOpenGroup:n,onOpenSession:h,refresh:o}){var m;const[d,g]=x.useState(""),[u,t]=x.useState(!1),a=e.supervision,l=((a==null?void 0:a.group)??e.group).members.find(i=>{var p;return i.id===((p=((a==null?void 0:a.group)??e.group).monitoring)==null?void 0:p.supervisorId)}),b=(a==null?void 0:a.incidents.filter(i=>i.status==="waiting"))??[],j=async i=>{t(!0),g("");try{await C(i==="apply"?{action:"applySupervision",groupId:e.group.id}:{action:"pauseSupervision",groupId:e.group.id,paused:!(a!=null&&a.paused)}),await o()}catch(p){g(p instanceof Error?p.message:"操作失败")}finally{t(!1)}};return s.jsxs("article",{className:`session-dashboard-group is-${e.status}`,children:[s.jsxs("header",{children:[s.jsxs("button",{className:"session-dashboard-title",onClick:()=>n(e),children:[s.jsx(I,{size:18}),s.jsx("strong",{children:e.group.name})]}),s.jsx("span",{className:`session-dashboard-status is-${e.status}`,children:Y[e.status]})]}),s.jsx("p",{className:"session-dashboard-progress",children:e.progress}),s.jsxs("div",{className:"session-dashboard-meta",children:[s.jsxs("span",{children:[e.runningCount," 运行中"]}),s.jsxs("span",{className:e.decisionCount?"needs-attention":"",children:[e.decisionCount," 待决策"]}),l&&s.jsxs("span",{children:[s.jsx(F,{size:13}),l.name,a!=null&&a.paused?" · 已暂停监管":" · 监工"]})]}),s.jsxs("details",{className:"session-dashboard-linked",children:[s.jsxs("summary",{children:[s.jsx("span",{children:e.sessions.length?`${e.sessions.length} 条${(m=((a==null?void 0:a.group)??e.group).monitoring)!=null&&m.targets.length?"原始":"群内"}会话`:"暂无工作会话"}),s.jsx(U,{size:15})]}),s.jsx("div",{children:e.sessions.map(i=>s.jsxs("button",{className:"session-dashboard-session",onClick:()=>h(i),children:[s.jsx(z,{agentType:i.agentType,size:17}),s.jsxs("span",{children:[s.jsx("strong",{children:i.title}),s.jsx("small",{children:S[i.agentType]})]}),s.jsx("em",{children:i.status==="running"?"运行中":i.status==="failed"?"异常":i.status==="unknown"?"待核对":"空闲"}),s.jsx(k,{size:14})]},i.id))})]}),l&&s.jsxs("details",{className:"session-dashboard-policy",children:[s.jsx("summary",{children:"监工职责"}),s.jsx("p",{children:l.role||"关注意外中断与交接断档,在原任务授权内恢复;业务选择交由你决策。"}),s.jsxs("button",{disabled:u,onClick:()=>void j("pause"),children:[a!=null&&a.paused?s.jsx(Q,{size:13}):s.jsx(K,{size:13})," ",a!=null&&a.paused?"恢复监管":"暂停监管"]})]}),e.configurationChanged&&s.jsxs("p",{className:"session-dashboard-config",children:["群配置已更新,当前监工沿用原配置。",s.jsx("button",{disabled:u,onClick:()=>void j("apply"),children:"应用最新监管配置"})]}),e.questions.map(i=>s.jsx(R,{text:i.text,options:i.options,onSource:()=>n({...e,discussionId:i.discussionId}),onAnswer:async(p,r)=>{await C(i.decisionRevision!==void 0?{action:"answerDecision",discussionId:i.discussionId,expectedRevision:i.decisionRevision,answer:p,messageId:crypto.randomUUID()}:{action:"answer",discussionId:i.discussionId,questionId:i.questionId,answer:p,selectedIndices:r}),await o()}},`${i.discussionId}:${i.questionId}`)),b.map(i=>{var r;const p=(r=a==null?void 0:a.group.monitoring)==null?void 0:r.targets.find(c=>c.id===i.sessionId);return p?s.jsx(O,{incident:i,target:p,refresh:o,onOpen:h},i.id):null}),!!(a!=null&&a.incidents.length)&&s.jsxs("details",{className:"session-dashboard-history",children:[s.jsx("summary",{children:"监工记录"}),a.incidents.slice(-6).reverse().map(i=>s.jsxs("p",{children:[s.jsx("time",{children:new Date(i.updatedAt).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})," ",i.message," ",s.jsx("small",{children:i.status==="verifying"?"核对新进度中":i.status==="resolved"?"已处理":i.status==="waiting"?"等你处理":i.status==="dismissed"?"已结束":"处理中"})]},i.id))]}),d&&s.jsx("p",{className:"collab-error",role:"alert",children:d}),s.jsxs("footer",{children:[s.jsx("span",{title:e.group.cwd,children:e.group.cwd.split(/[\\/]/).filter(Boolean).at(-1)||e.group.cwd}),s.jsxs("button",{onClick:()=>n(e),children:["进入群聊 ",s.jsx(k,{size:14})]})]})]})}function L({session:e,showAgent:n=!1,onOpen:h}){return s.jsxs("button",{className:"session-dashboard-agent-session",onClick:()=>h(e),children:[n?s.jsx("span",{className:"session-dashboard-session-brand",role:"img","aria-label":S[e.agentType],title:S[e.agentType],children:s.jsx(z,{agentType:e.agentType,size:20})}):s.jsx("span",{className:"session-dashboard-running-dot"}),s.jsxs("span",{children:[s.jsx("strong",{children:e.title}),s.jsx("small",{title:e.cwd,children:e.cwd})]}),s.jsx("span",{children:"运行中"}),s.jsx(k,{size:15})]})}function Z(e){const n=e.groups.map(o=>({kind:"group",id:`group:${o.group.id}`,updated:o.updated,item:o,priority:o.decisionCount>0||o.status==="waiting"?2:+(o.runningCount>0||o.status==="running")})),h=e.agents.flatMap(o=>o.sessions).map(o=>({kind:"session",id:`session:${o.id}`,updated:o.updated,priority:1,item:o}));return[...n,...h].sort((o,d)=>d.priority-o.priority||d.updated.localeCompare(o.updated)||o.id.localeCompare(d.id))}function ss(e){const{snapshot:n,error:h,loading:o,refresh:d}=W(),g=A(r=>r.skin),u=A(r=>r.dashboardSessionsMerged),t=A(r=>r.setDashboardSessionsMerged);x.useEffect(()=>{document.documentElement.setAttribute("data-skin",g)},[g]),x.useEffect(()=>{!o&&window.parent!==window&&window.parent.postMessage({type:V},window.location.origin)},[o]);const a=e.onOpenGroup??(r=>w({kind:"group",groupId:r.group.id,title:r.group.name,discussionId:r.discussionId})),l=e.onOpenSession??(r=>w({kind:"session",session:r})),b=e.onViewGroups??(()=>w({kind:"groups"})),j=e.onNewSession??(()=>w({kind:"new-session"})),m=(n==null?void 0:n.agents.reduce((r,c)=>r+c.sessions.length,0))??0,i=n&&u?Z(n):[],p=(n==null?void 0:n.decisionTotal)??(n==null?void 0:n.groups.reduce((r,c)=>r+c.decisionCount,0))??0;return s.jsxs("main",{className:"session-dashboard",children:[s.jsxs("header",{className:"session-dashboard-heading",children:[s.jsxs("div",{children:[s.jsx("span",{className:"collab-eyebrow",children:"会话总览"}),s.jsxs("h1",{children:["Dashboard ",s.jsxs("span",{className:"session-dashboard-live",children:[s.jsx("i",{}),"实时"]})]}),s.jsx("p",{children:"在一个地方查看运行、交接与需要你决定的事。"})]}),s.jsxs("div",{className:"session-dashboard-toolbar",children:[s.jsxs("button",{onClick:()=>t(!u),"aria-pressed":u,title:u?"恢复按 Agent 分组":"合并显示群聊和所有 Agent 的运行会话",children:[u?s.jsx(X,{size:16}):s.jsx(J,{size:16}),s.jsx("span",{children:u?"按 Agent 分组":"合并会话"})]}),s.jsx("button",{onClick:()=>void d(),"aria-label":"刷新会话看板",children:s.jsx($,{size:16})}),s.jsxs("button",{onClick:b,children:[s.jsx(I,{size:16}),"群聊列表"]}),s.jsxs("button",{className:"session-dashboard-new-session",onClick:j,children:[s.jsx(P,{size:16}),"创建会话"]}),e.onClose&&s.jsx("button",{onClick:e.onClose,"aria-label":"关闭会话看板",children:s.jsx(B,{size:17})})]})]}),s.jsxs("div",{className:"session-dashboard-stats",children:[s.jsxs("span",{children:[s.jsx(T,{size:16}),s.jsx("strong",{children:m}),"运行中的原始会话"]}),s.jsxs("span",{className:p?"needs-attention":"",children:[s.jsx("strong",{children:p}),"待你决策"]}),s.jsxs("span",{children:[s.jsx("strong",{children:(n==null?void 0:n.groupTotal)??0}),"协作群"]}),s.jsx("small",{children:"无变化时监工保持安静"})]}),h&&s.jsxs("p",{role:"alert",className:"collab-error",children:[h,s.jsx("button",{onClick:()=>void d(),children:"重试"})]}),(n==null?void 0:n.discoveryError)&&s.jsxs("p",{role:"alert",className:"collab-error",children:["原生会话状态暂时不可用:",n.discoveryError]}),o&&!n&&s.jsx("p",{role:"status",children:"正在加载会话总览…"}),n&&!u&&(n.groups.length?s.jsxs("section",{"aria-label":"群聊运行总览",children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(I,{size:18}),"群聊 ",s.jsx("small",{children:"Top 10 · 运行中和待决策优先"})]}),s.jsxs("button",{onClick:b,children:["查看全部 ",n.groupTotal," ",s.jsx(k,{size:14})]})]}),s.jsx("div",{className:"session-dashboard-group-grid",children:n.groups.map(r=>s.jsx(M,{item:r,onOpenGroup:a,onOpenSession:l,refresh:d},r.group.id))})]}):s.jsx("div",{className:"session-dashboard-group-create",children:s.jsxs("button",{onClick:b,children:[s.jsx(I,{size:16}),"创建群聊,配置监工"]})})),n&&(u?s.jsxs("section",{className:"session-dashboard-agent","aria-label":"合并会话",children:[s.jsx("div",{className:"session-dashboard-section-title",children:s.jsxs("h2",{children:[s.jsx(T,{size:20}),"会话 ",s.jsxs("small",{children:[m," 运行中 · ",n.groupTotal," 群聊"]})]})}),i.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:i.map(r=>r.kind==="group"?s.jsx(M,{item:r.item,onOpenGroup:a,onOpenSession:l,refresh:d},r.id):s.jsx(L,{session:r.item,showAgent:!0,onOpen:l},r.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]}):n.agents.map(r=>s.jsxs("section",{className:"session-dashboard-agent","aria-label":`${S[r.agentType]} 运行会话`,children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(z,{agentType:r.agentType,size:20}),S[r.agentType]," ",s.jsxs("small",{children:[r.sessions.length," 运行中"]})]}),s.jsxs("button",{onClick:()=>e.onViewAgent?e.onViewAgent(r.agentType):w({kind:"agent",agentType:r.agentType}),children:["查看全部 ",s.jsx(k,{size:14})]})]}),r.sessions.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:r.sessions.map(c=>s.jsx(L,{session:c,onOpen:l},c.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]},r.agentType)))]})}const os=Object.freeze(Object.defineProperty({__proto__:null,SupervisionIncidentDecision:O,default:ss},Symbol.toStringTag,{value:"Module"}));export{R as D,Q as P,ss as S,os as a,w as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as d}from"./index--zKd3rTs.js";const n="agentroam:session-dashboard-navigate:v1",p="agentroam:session-dashboard-ready:v1",c="agentroam:session-dashboard-chat-ready:v1",l="agentroam:session-dashboard-applied:v1",a=o=>typeof o=="string"&&/^[\w-]{1,200}$/.test(o);function I(o,r,i){var t;if(!i||o.source!==i||o.origin!==r||((t=o.data)==null?void 0:t.type)!==n)return null;const s=o.data.intent;if(!s)return null;if(s.kind==="dashboard"||s.kind==="groups"||s.kind==="new-session")return{kind:s.kind};if(s.kind==="agent"&&d(s.agentType))return{kind:"agent",agentType:s.agentType};if(s.kind==="group"&&a(s.groupId)&&typeof s.title=="string"&&s.title.length>0&&s.title.length<=100&&(s.discussionId===void 0||a(s.discussionId)))return{kind:"group",groupId:s.groupId,title:s.title,...s.discussionId?{discussionId:s.discussionId}:{}};if(s.kind==="session"&&s.session&&typeof s.session=="object"){const e=s.session;if(typeof e.id=="string"&&e.id.length>0&&e.id.length<=400&&d(e.agentType)&&typeof e.title=="string"&&e.title.length<=1e3&&typeof e.cwd=="string"&&e.cwd.length<=4e3&&(e.projectId===void 0||typeof e.projectId=="string"&&e.projectId.length<=400))return{kind:"session",session:{id:e.id,agentType:e.agentType,title:e.title,cwd:e.cwd,...e.projectId?{projectId:e.projectId}:{}}}}return null}function u(o){document.body.dataset.agentroamChatNavigation==="ready"?window.dispatchEvent(new CustomEvent(n,{detail:o})):window.parent!==window?window.parent.postMessage({type:n,intent:o},window.location.origin):o.kind==="group"?location.assign(`?view=collaboration&groupId=${encodeURIComponent(o.groupId)}${o.discussionId?`&discussionId=${encodeURIComponent(o.discussionId)}`:""}`):o.kind==="groups"?location.assign("?view=collaboration-dashboard"):o.kind==="dashboard"?location.assign("?view=session-dashboard"):o.kind==="agent"?location.assign(`?agent=${encodeURIComponent(o.agentType)}`):o.kind==="new-session"?location.assign("/app/?newSession=1"):location.assign(`?agent=${encodeURIComponent(o.session.agentType)}&session=${encodeURIComponent(o.session.id)}`)}export{l as S,c as a,p as b,n as c,u as p,I as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as O,j as He}from"./index
|
|
1
|
+
import{r as O,j as He}from"./index--zKd3rTs.js";import{r as Zn}from"./page-Cc56wyOt.js";import{c as Qn}from"./clipboard-BteN9-AC.js";import"./smartphone-D7oS3YTz.js";import"./artifact-links-nzx7joYs.js";import"./trash-2-CHYPyYDY.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./SessionDashboardBridge-DYsMZhuH.js";import"./RemoteDesktopTabBridge-Cp9mLtcY.js";/**
|
|
2
2
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
3
3
|
* @license MIT
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-SVP7TREG-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-SVP7TREG-lFcKEwyL.js";import{p as f}from"./chunk-JWPE2WC7-Dv9x27hI.js";import{_ as n,l as o}from"./mermaid.core-B3fzlEw9.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-mtRVdchl.js";import"./index--zKd3rTs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X as ln,Y as an,$ as C,a0 as q,a1 as $,a2 as un,a3 as y,a4 as tn,a5 as H,a6 as _,a7 as rn,a8 as o,a9 as on,aa as sn,ab as fn}from"./mermaid.core-
|
|
1
|
+
import{X as ln,Y as an,$ as C,a0 as q,a1 as $,a2 as un,a3 as y,a4 as tn,a5 as H,a6 as _,a7 as rn,a8 as o,a9 as on,aa as sn,ab as fn}from"./mermaid.core-B3fzlEw9.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,j,a){var O=I-l,i=D-h,n=j-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function Q(l,h,I,D,v,A,j){var a=l-I,O=h-D,i=(j?A:-A)/H(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,z=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*H(on(0,T*T*R-P*P)),X=(P*g-m*S)/R,Y=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=X-z,e=Y-t,r=w-z,B=p-t;return x*x+e*e>r*r+B*B&&(X=w,Y=p),{cx:X,cy:Y,x01:-n,y01:-d,x11:X*(v/T-1),y11:Y*(v/T-1)}}function hn(){var l=cn,h=yn,I=$(0),D=null,v=gn,A=dn,j=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,z=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(z>tn-y)a.moveTo(s*C(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*C(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=z,S=z,X=j.apply(this,arguments)/2,Y=X>y&&(D?+D.apply(this,arguments):H(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(Y>y){var B=sn(Y/u*q(X)),J=sn(Y/s*q(X));(P-=B*2)>y?(B*=t?1:-1,R+=B,T-=B):(P=0,R=T=(f+c)/2),(S-=J*2)>y?(J*=t?1:-1,m+=J,g-=J):(S=0,m=g=(f+c)/2)}var F=s*C(m),G=s*q(m),K=u*C(T),L=u*q(T);if(w>y){var M=s*C(g),N=s*q(g),U=u*C(R),V=u*q(R),E;if(z<an)if(E=pn(F,G,U,V,M,N,K,L)){var W=F-E[0],Z=G-E[1],b=M-E[0],k=N-E[1],nn=1/q(fn((W*b+Z*k)/(H(W*W+Z*Z)*H(b*b+k*k)))/2),en=H(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=Q(U,V,F,G,s,x,t),r=Q(M,N,K,L,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(F,G),a.arc(0,0,s,m,g,!t)):a.moveTo(F,G),!(u>y)||!(P>y)?a.lineTo(K,L):p>y?(e=Q(K,L,M,N,u,-p,t),r=Q(F,G,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[C(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:$(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:$(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:$(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:$(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:$(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:$(+n),i):A},i.padAngle=function(n){return arguments.length?(j=typeof n=="function"?n:$(+n),i):j},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|