agentroam-runtime-darwin-arm64 0.2.0-preview.75 → 0.2.0-preview.76
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 +9 -9
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +5 -5
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/routes-manifest.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/abort/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/runtime-health/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +4 -4
- package/runtime/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js.nft.json +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/business/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/calendar/route.js +2 -3
- package/runtime/.next/server/app/api/calendar/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +9 -9
- package/runtime/.next/server/app/api/collaboration/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
- package/runtime/.next/server/app/api/engine-threads/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/engine-threads.body +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js.nft.json +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]/cancel/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +4 -0
- package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -0
- package/runtime/.next/server/app/api/internal/todo-mcp/route.js.nft.json +1 -0
- 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/mcp/servers.body +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/messaging/route.js +1 -1
- package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -0
- package/runtime/.next/server/app/api/notifications/[id]/ack/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -0
- package/runtime/.next/server/app/api/notifications/[id]/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/notifications/route.js +1 -0
- package/runtime/.next/server/app/api/notifications/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/notifications/stream/route.js +4 -0
- package/runtime/.next/server/app/api/notifications/stream/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js.nft.json +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/subscribe/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
- 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/remote-tools/register/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -0
- package/runtime/.next/server/app/api/session-images/[id]/route.js.nft.json +1 -0
- 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]/route.js.nft.json +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/[jobId]/stop/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/parallel/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js.nft.json +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/todos/[id]/commands/route.js +1 -0
- package/runtime/.next/server/app/api/todos/[id]/commands/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -0
- package/runtime/.next/server/app/api/todos/[id]/executions/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/todos/[id]/route.js +1 -0
- package/runtime/.next/server/app/api/todos/[id]/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/todos/route.js +1 -0
- package/runtime/.next/server/app/api/todos/route.js.nft.json +1 -0
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js.nft.json +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/api/workspace-changes/route.js +1 -0
- package/runtime/.next/server/app/api/workspace-changes/route.js.nft.json +1 -0
- 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 +38 -26
- package/runtime/.next/server/chunks/1298.js +1 -0
- package/runtime/.next/server/chunks/1973.js +1 -0
- package/runtime/.next/server/chunks/2480.js +4 -0
- package/runtime/.next/server/chunks/3604.js +4 -0
- package/runtime/.next/server/chunks/4621.js +1 -1
- package/runtime/.next/server/chunks/5303.js +1 -1
- package/runtime/.next/server/chunks/5762.js +1 -1
- package/runtime/.next/server/chunks/5801.js +1 -0
- package/runtime/.next/server/chunks/6977.js +1 -1
- package/runtime/.next/server/chunks/732.js +1 -1
- package/runtime/.next/server/chunks/7788.js +1 -1
- package/runtime/.next/server/chunks/9119.js +15 -0
- package/runtime/.next/server/chunks/9457.js +4 -0
- 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/753-90c7dd1ba08be9be.js +1 -0
- package/runtime/.next/static/chunks/app/web/{error-3cae58f0f14f0b4f.js → error-828d278147a0619d.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-a8b7565989c1c063.js +1 -0
- package/runtime/.next/static/chunks/app/web/page-8ff95d45a0160843.js +1 -0
- package/runtime/.next/static/chunks/{main-d8ef9def37924b01.js → main-7240085c0ba42e9a.js} +1 -1
- package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +1 -0
- package/runtime/lib/desktop-discovery.mjs +12 -3
- package/runtime/lib/service-identity.mjs +17 -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 +11 -11
- package/runtime/node_modules/@agent/core/dist/index.js +857 -4
- package/runtime/node_modules/@agent/native-runtime/dist/index.js +37982 -19298
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +74 -78
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +52 -51
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-rn7tc54w.mjs → core-25bstexa.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-4ps8vwh1.mjs +42 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9a7zb9bm.mjs +53 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ba5rrckm.mjs → core-a8ty0dnc.mjs} +2 -2
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-2h2qc9qv.mjs → core-ae73vzp2.mjs} +4 -4
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ya1m7gzj.mjs → core-dsa3p77h.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-h6r54bwv.mjs → core-e93r8awg.mjs} +2 -2
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-eqz9ara6.mjs +18 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-td7rt8zt.mjs → core-esw7xtkz.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-k67vj6j9.mjs → core-ey906mbk.mjs} +5 -5
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-x4kwpwv9.mjs → core-k19jejpn.mjs} +2 -2
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-tf03rfab.mjs → core-kag24kjr.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-qbjntcdf.mjs → core-mhczx7zp.mjs} +4 -4
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-qj4dtgyt.mjs → core-nfa6p2rw.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-sstebd83.mjs → core-v6sp3qjw.mjs} +4 -4
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -11
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +25 -25
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +80 -84
- package/runtime/package-lock.json +35 -35
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/AIHubView-DF0D5qd2.js +1 -0
- package/runtime/webapp/dist/assets/{AgentManager-CrN2B-tH.js → AgentManager-Ccj6ZefC.js} +2 -2
- package/runtime/webapp/dist/assets/{AiHubPane-Du6ajSsx.js → AiHubPane-3PRSxzO0.js} +1 -1
- package/runtime/webapp/dist/assets/App-CtLZIOFu.css +1 -0
- package/runtime/webapp/dist/assets/App-HomcUet2.js +63 -0
- package/runtime/webapp/dist/assets/BrowserLivePanel-BZDtF0ne.js +66 -0
- package/runtime/webapp/dist/assets/CalendarPage-B8Jo-3Da.js +1 -0
- package/runtime/webapp/dist/assets/CalendarView-BD7GhA0i.js +36 -0
- package/runtime/webapp/dist/assets/CalendarView-DHi-mzjY.css +1 -0
- package/runtime/webapp/dist/assets/CollaborationCreateDialog-CU1t0iYL.js +1 -0
- package/runtime/webapp/dist/assets/CollaborationDashboard-BZhWQXzn.js +1 -0
- package/runtime/webapp/dist/assets/CollaborationPage-BwRJN55v.js +6 -0
- package/runtime/webapp/dist/assets/{FilePreview-CevPpP6E.js → FilePreview-Oo8sZH0t.js} +5 -5
- package/runtime/webapp/dist/assets/FileTree-qJTRdDPQ.js +6 -0
- package/runtime/webapp/dist/assets/FileWorkspaceDrawer-D40WNAqC.js +1 -0
- package/runtime/webapp/dist/assets/FlowStudioPane-C1tgSbGo.js +5 -0
- package/runtime/webapp/dist/assets/HostProjectPicker-BEfXuqxT.js +1 -0
- package/runtime/webapp/dist/assets/{LSPServerList-BMY6dFfG.js → LSPServerList-DQRv04aP.js} +1 -1
- package/runtime/webapp/dist/assets/{MCPServerList-c91QNM-g.js → MCPServerList-BmsejJC9.js} +1 -1
- package/runtime/webapp/dist/assets/{MemoryViewer-C9IfWwzW.js → MemoryViewer-qZMdVrli.js} +1 -1
- package/runtime/webapp/dist/assets/NewSessionWindow-BOCZ0mXT.css +1 -0
- package/runtime/webapp/dist/assets/NewSessionWindow-uzVK5LVS.js +1 -0
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-w8aL061W.js → RemoteDesktopPage-Dz_6-rOL.js} +1 -1
- package/runtime/webapp/dist/assets/{RunningSessionsIcon-B8Cr2-hp.js → RunningSessionsIcon-DJxTmxZn.js} +5 -5
- package/runtime/webapp/dist/assets/SessionDashboard-DuR9r_ZP.js +16 -0
- package/runtime/webapp/dist/assets/{SessionDashboardBridge-Bx4EXtos.js → SessionDashboardBridge-BHVjvDHa.js} +1 -1
- package/runtime/webapp/dist/assets/{SettingsPanel-CS4XL2sd.js → SettingsPanel-B-g919uV.js} +2 -2
- package/runtime/webapp/dist/assets/{SkillManager-5FZnR9My.js → SkillManager-nrWIOtEO.js} +1 -1
- package/runtime/webapp/dist/assets/{TerminalPane-CRrbd0i4.js → TerminalPane-C4HiD2IC.js} +2 -2
- package/runtime/webapp/dist/assets/TodoPage-Bn6j6kR6.js +1 -0
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-DBioGYiE.js → abnfDiagram-VCTEODGH-BXRYzdBT.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-BRj_RXHL.js → arc-BeG7yjCw.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-CoCdq67U.js → architectureDiagram-5GKGNRK7-DIQbpqn7.js} +1 -1
- package/runtime/webapp/dist/assets/{arrow-right-Cqqb1zqH.js → arrow-right-B03zMFiC.js} +1 -1
- package/runtime/webapp/dist/assets/artifact-links-4m1A00GO.js +2 -0
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-CLisIPjq.js → blockDiagram-I7D4REHJ-DvgKV01C.js} +3 -3
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-BoLCIVW8.js → c4Diagram-7LVT6UL2-DIr7nDIg.js} +1 -1
- package/runtime/webapp/dist/assets/calendar-days-D1OJEOKr.js +6 -0
- package/runtime/webapp/dist/assets/channel-Cchxg6Fx.js +1 -0
- package/runtime/webapp/dist/assets/check-BDiCDSY5.js +6 -0
- package/runtime/webapp/dist/assets/{chevron-down-DhZV290h.js → chevron-down-DIt_NscV.js} +1 -1
- package/runtime/webapp/dist/assets/chevron-right-DVhYkZeF.js +6 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-CIQxwzU0.js → chunk-2Q5K7J3B-Cykdc4to.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-Buiv0MCN.js → chunk-5VM5RSS4-DL-gBU30.js} +1 -1
- package/runtime/webapp/dist/assets/chunk-F27PBJKO-z0F9O96j.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-C0NrkJOc.js → chunk-IMKFNOWR-DcSgatN1.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-CGON_UvB.js → chunk-JWPE2WC7-BmG1ozp9.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-BXvOsc9g.js → chunk-POPQ4Y6H-BK2jifSN.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-ZD_qn-NK.js → chunk-SVP7TREG-DtInGjiG.js} +3 -3
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-DrB8f6RG.js → chunk-TICWLB2K-DWdiL4Y6.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CYgLMn5t.js → chunk-XXDRQBXY-w8UYxZUB.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BGv4sK1I.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BGv4sK1I.js +1 -0
- package/runtime/webapp/dist/assets/{codeSyntax-DfQ5rLir.js → codeSyntax-Cprr1Nm9.js} +3 -3
- package/runtime/webapp/dist/assets/{collaboration-CQhzjwS_.js → collaboration-acdqOxaY.js} +1 -1
- package/runtime/webapp/dist/assets/composer-file-routing-BsSxfxUa.js +6 -0
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-CDPnTlcy.js → cose-bilkent-JH36ORCC-BJgwy7Y5.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-DDCxhkA5.js → cynefin-OW5HDTMX-BssWa1kU.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-CIJ1KBPA.js → cynefinDiagram-5FMLGOSQ-Bv_-fuG_.js} +2 -2
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-CFX8O3IJ.js → dagre-GXQ25YYZ-BjA5n2Zi.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-B8UX2IBH.js → diagram-S7CK7UJ4-CCT38L0E.js} +3 -3
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-Ce34DNrv.js → diagram-UQ7AKVKN-4fLw8kje.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-CVL_erWD.js → diagram-VSXAHHWV-43_Qj0Se.js} +3 -3
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DBFHI7Dk.js → diagram-VX7I27RA-BHEXgMDZ.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-Bw_QcSQY.js → diagram-Z3DM3KII-BRTSiXVr.js} +2 -2
- package/runtime/webapp/dist/assets/{download-D3xZPWnZ.js → download-CuYS63Ny.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-DRly04dj.js → ebnfDiagram-PWID7BFC-B4GImY-o.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DTm817hG.js → erDiagram-RLTQ6QDP-EmEsAxWS.js} +1 -1
- package/runtime/webapp/dist/assets/{external-link-Cwu5rEgp.js → external-link-Baeyco26.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-DKkhMnUV.js → file-types-CykGmGsd.js} +2 -2
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-tc8ygZtG.js → flowDiagram-HODETNUW-sky_wmbX.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-CsQFf1IN.js → ganttDiagram-EL5Y4UJY-Cc71xV1j.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-DAIxbmPX.js → gitGraphDiagram-WWUBYQGX-z7uQ8-8z.js} +7 -7
- package/runtime/webapp/dist/assets/history-C7WUwl_W.js +6 -0
- package/runtime/webapp/dist/assets/{image-plus-nplydLA5.js → image-plus-B2RK1ogI.js} +1 -1
- package/runtime/webapp/dist/assets/index-B_fTpc5K.css +1 -0
- package/runtime/webapp/dist/assets/index-d8fS3JdV.js +489 -0
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-CVcMW4UM.js → infoDiagram-27XIBGKW-DXLEePz0.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-zzlEtZ1l.js → ishikawaDiagram-5VMMS53U-DCFXm_zQ.js} +4 -4
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-q7NuIMSl.js → journeyDiagram-3NMN7TZE-DHWCpvY6.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DLYFZlKO.js → kanban-definition-UXKFOSKX-D_uP81aw.js} +7 -7
- package/runtime/webapp/dist/assets/{layout-PFWssIkE.js → layout-Bcu83-1p.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-ZRVcojb1.js → linear-CPim5SQa.js} +1 -1
- package/runtime/webapp/dist/assets/list-todo-F1W4yBLx.js +6 -0
- package/runtime/webapp/dist/assets/{loader-circle-DIW9tlEz.js → loader-circle-DesEGpVH.js} +1 -1
- package/runtime/webapp/dist/assets/locate-fixed-UXM91vCS.js +6 -0
- package/runtime/webapp/dist/assets/{mermaid.core-C8Dl0Nah.js → mermaid.core-CyzKk3O2.js} +6 -6
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-BcbqtwVk.js → mindmap-definition-YA3MSWOX-0MHQpQro.js} +1 -1
- package/runtime/webapp/dist/assets/new-session-window-B4BJYrds.css +1 -0
- package/runtime/webapp/dist/assets/new-session-window-fsYu53Ht.js +188 -0
- package/runtime/webapp/dist/assets/page-C2e368Dx.js +86 -0
- package/runtime/webapp/dist/assets/pause-_h6c8qPD.js +6 -0
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BQN3zQuy.js → pegDiagram-XKGWAZYB-BNinoE-7.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-pOgxh3os.js → pieDiagram-E7YTZNPT-CfPzV9yb.js} +3 -3
- package/runtime/webapp/dist/assets/pin-BcXr5230.js +6 -0
- package/runtime/webapp/dist/assets/play-BdB0D0rZ.js +6 -0
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-BOg7ujzG.js → quadrantDiagram-AXDQQJYC-0qLb33lM.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CWsN3juJ.js → railroadDiagram-O6MQD6OU-DNU4eRJt.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-B0yrO7Oy.js → requirementDiagram-BXWQKSXE-BWJRwKX8.js} +3 -3
- package/runtime/webapp/dist/assets/{rotate-ccw-O4wnfQP7.js → rotate-ccw-BdZpOTYP.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-CCJtlAtB.js → rotate-cw-D-zPMe4i.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-5MS_e-3E.js → sankeyDiagram-P5KCCOFB-CGW9pvun.js} +2 -2
- package/runtime/webapp/dist/assets/{send-Cdg4ZVlp.js → send-DCVOqOap.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-C1w8qYSu.js → sequenceDiagram-WJ2MYXX4-CeVAD519.js} +4 -4
- package/runtime/webapp/dist/assets/session-dashboard-BAYi5acZ.js +1 -0
- package/runtime/webapp/dist/assets/{shield-check-CrjI2wPR.js → shield-check-DrxVJwVC.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-BonKTynC.js → sizeCapture-INFHLROL-Dj5SukiO.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D3mn6ZK5.js → stateDiagram-D77RDMKH-UtRSslyd.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Se3lznH6.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-Bn9KWChU.js → swimlanes-42K2YHIH-DKbrz8SF.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-C-Zsmae7.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-BfuhI7EF.js → timeline-definition-24CTP7MA-mtVdMOBL.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-BrfgMjfL.js → trash-2-Bbhd8-xd.js} +4 -9
- package/runtime/webapp/dist/assets/{types-VnQ_cKrp.js → types-CMhUwzwJ.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CUFs5JyR.js → vennDiagram-4TSXK5OY-ZcuGEhJx.js} +5 -5
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-C27HHz1A.js → wardleyDiagram-VM6X3IG4-CnAYI2ZE.js} +1 -1
- package/runtime/webapp/dist/assets/{web-CeCHmdwO.js → web-BH9JgWsL.js} +1 -1
- package/runtime/webapp/dist/assets/{web-BOzkL-0Z.js → web-CBiaPgEe.js} +1 -1
- package/runtime/webapp/dist/assets/{x-DP1nC4qG.js → x-1GQMVfza.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CQwRrSTf.js → xychartDiagram-S5SC5T6Z-B_uJt0Bg.js} +3 -3
- package/runtime/webapp/dist/assets/zoom-out-BNKdrTFD.js +11 -0
- package/runtime/webapp/dist/index.html +2 -2
- package/runtime/ws-server.mjs +12 -4
- package/runtime/.next/server/chunks/1614.js +0 -1
- package/runtime/.next/server/chunks/7519.js +0 -15
- package/runtime/.next/static/chunks/333-9881c3d2c558a28d.js +0 -1
- package/runtime/.next/static/chunks/app/web/layout-d5d7d1c5c74eef3c.js +0 -1
- package/runtime/.next/static/chunks/app/web/page-7afa4cb0119e90b7.js +0 -1
- package/runtime/.next/static/chunks/main-app-7a6902a607752446.js +0 -1
- package/runtime/lib/voice-tts-gateway.mjs +0 -96
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9sxfsmzx.mjs +0 -18
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-dnsvg8nc.mjs +0 -53
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y6bhrwmk.mjs +0 -47
- package/runtime/webapp/dist/assets/AIHubView-BMeOfqfm.js +0 -1
- package/runtime/webapp/dist/assets/App-CrZstnCH.css +0 -1
- package/runtime/webapp/dist/assets/App-zihaYk1L.js +0 -179
- package/runtime/webapp/dist/assets/BrowserLivePanel-CU_X6OU2.js +0 -56
- package/runtime/webapp/dist/assets/CollaborationCreateDialog-BmgYdwe7.js +0 -1
- package/runtime/webapp/dist/assets/CollaborationDashboard-mHU8iJYg.js +0 -1
- package/runtime/webapp/dist/assets/CollaborationPage-Br5fhNce.js +0 -6
- package/runtime/webapp/dist/assets/FileTree-CagcHV1N.js +0 -11
- package/runtime/webapp/dist/assets/FileWorkspaceDrawer-CWVndCXp.js +0 -1
- package/runtime/webapp/dist/assets/FlowStudioPane-BZA-qvBj.js +0 -5
- package/runtime/webapp/dist/assets/SessionDashboard-CFXXTm_4.js +0 -21
- package/runtime/webapp/dist/assets/artifact-links-73OZyi5W.js +0 -7
- package/runtime/webapp/dist/assets/channel-JGVZzkSo.js +0 -1
- package/runtime/webapp/dist/assets/chunk-F27PBJKO-XBMwIl6X.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BnctJ00R.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BnctJ00R.js +0 -1
- package/runtime/webapp/dist/assets/composer-file-routing-D9orqwzY.js +0 -11
- package/runtime/webapp/dist/assets/index-B-d1Vs9E.css +0 -1
- package/runtime/webapp/dist/assets/index-DKm9ESDq.js +0 -489
- package/runtime/webapp/dist/assets/page-BG97oPXr.js +0 -91
- package/runtime/webapp/dist/assets/session-dashboard-BigU92sz.js +0 -6
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-WEfEW-mH.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-D26_Nmko.js +0 -8
- package/runtime/webapp/dist/assets/zoom-out-Dg7YyzcP.js +0 -21
- package/runtime/webapp/dist/pcm-audio-worklet.js +0 -126
- /package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → q4ez_w8bVMUW1e57Cd7GC}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → q4ez_w8bVMUW1e57Cd7GC}/_ssgManifest.js +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TerminalPane-CRrbd0i4.js","./index-DKm9ESDq.js","./index-B-d1Vs9E.css","./clipboard-BvwmdR4z.js","./RunningSessionsIcon-B8Cr2-hp.js","./x-DP1nC4qG.js","./chevron-down-DhZV290h.js","./artifact-links-73OZyi5W.js","./trash-2-BrfgMjfL.js","./external-link-Cwu5rEgp.js","./CollaborationTabBridge-Dxq4G1Uk.js","./SessionDashboardBridge-Bx4EXtos.js","./RemoteDesktopTabBridge-Cp9mLtcY.js","./TerminalPane-6GBZ9nXN.css","./FileTree-CagcHV1N.js","./file-types-DKkhMnUV.js","./loader-circle-DIW9tlEz.js","./FilePreview-CevPpP6E.js","./rotate-ccw-O4wnfQP7.js","./download-D3xZPWnZ.js","./FilePreview-B7Ab2X_E.css","./AiHubPane-Du6ajSsx.js","./image-plus-nplydLA5.js","./send-Cdg4ZVlp.js","./FlowStudioPane-BZA-qvBj.js","./rotate-cw-CCJtlAtB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Cn,r as n,j as e,P as Ve,d as Ae,R as we,o as ar,p as sr,q as Me,s as Rn,t as cr,b as Oe,v as He,w as lr,x as dr,y as an,z as ur,D as pr,U as gt,n as it,e as Nn,E as mr,L as Ln,F as bt,G as fr,I as hr,J as sn,K as gr,N as br,O as wr,Q as xr,S as yr,T as vr,V as at,X as kr,Y as st,Z as Er,_ as ct,$ as jr,a0 as rt,a1 as Sr,a2 as Tr,a3 as Cr,a4 as Rr,a5 as Nr,a6 as cn,a7 as _e}from"./index-DKm9ESDq.js";import{S as Pn,M as ln,G as lt,a as Lr,R as In,b as Pr,C as Ir,P as Ar}from"./RunningSessionsIcon-B8Cr2-hp.js";import{X as Te}from"./x-DP1nC4qG.js";import{C as Dr}from"./chevron-down-DhZV290h.js";import{C as dt,a as Mr,r as Or,i as dn}from"./artifact-links-73OZyi5W.js";import{T as wt,P as ut,C as _r,A as zr,F as Wr}from"./trash-2-BrfgMjfL.js";import{E as xt}from"./external-link-Cwu5rEgp.js";import{c as Fr}from"./clipboard-BvwmdR4z.js";import{r as $r,d as Ur,e as Br}from"./CollaborationTabBridge-Dxq4G1Uk.js";import{b as qr,r as Hr,c as un}from"./SessionDashboardBridge-Bx4EXtos.js";import{c as Vr,d as Kr,R as Yr,b as Gr}from"./RemoteDesktopTabBridge-Cp9mLtcY.js";/**
|
|
3
|
-
* @license lucide-react v0.468.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const Jr=Cn("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
|
|
8
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const Xr=Cn("TextCursorInput",[["path",{d:"M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1",key:"18xjzo"}],["path",{d:"M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5",key:"fj48gi"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M9 7v10",key:"1vc8ob"}]]);function ze(t,o){const a=n.lazy(t);return function(c){var u;return e.jsx(n.Suspense,{fallback:((u=o==null?void 0:o.loading)==null?void 0:u.call(o))??null,children:e.jsx(a,{...c})})}}const Qr={background:"color-mix(in srgb, var(--ui-tab-accent) 88%, var(--ui-text))",borderColor:"color-mix(in srgb, var(--ui-tab-accent) 88%, var(--ui-text))",color:"var(--ui-primary-text)"};function Zr(){const[t,o]=n.useState(!1),[a,s]=n.useState(!1),[c,u]=n.useState(null),p=n.useRef(null);return n.useEffect(()=>{u(document.querySelector(".web-root")??document.body);const d=g=>{var C;return o(!!((C=g.detail)!=null&&C.installed))},T=()=>s(!0);return window.addEventListener("agentroam:pwa-state",d),window.addEventListener("agentroam:pwa-guide",T),window.dispatchEvent(new Event("agentroam:pwa-query")),()=>{window.removeEventListener("agentroam:pwa-state",d),window.removeEventListener("agentroam:pwa-guide",T)}},[]),n.useEffect(()=>{var d,T;a&&!((d=p.current)!=null&&d.open)&&((T=p.current)==null||T.showModal())},[a]),e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"file-drawer-toggle pwa-install-button",title:t?"已添加到主屏幕":"添加到主屏幕","aria-label":t?"已添加到主屏幕":"添加到主屏幕",onClick:()=>t?s(!0):window.dispatchEvent(new Event("agentroam:pwa-install")),children:e.jsxs("span",{style:{position:"relative",display:"flex"},children:[e.jsx(Pn,{size:17,"aria-hidden":"true"}),e.jsx(Ve,{size:9,strokeWidth:3,"aria-hidden":"true",style:{position:"absolute",right:-4,bottom:-2}})]})}),a&&c&&Ae.createPortal(e.jsxs("dialog",{ref:p,"data-toolbar-overlay":!0,onClose:()=>s(!1),"aria-labelledby":"pwa-install-title",style:{maxWidth:340,width:"calc(100% - 40px)",margin:"auto",padding:24,borderRadius:16,border:"1px solid var(--ui-tabbar-border)",background:"var(--ui-root-bg)",color:"var(--ui-text)",whiteSpace:"normal",font:"14px/1.8 system-ui"},children:[e.jsx("h2",{id:"pwa-install-title",style:{margin:"0 0 12px",fontSize:18},children:t?"已添加到主屏幕":"添加到主屏幕"}),t&&e.jsx("p",{children:"当前已在主屏幕应用中打开。"}),e.jsx("p",{children:"iPhone / iPad:在 Safari 点击分享按钮,选择“添加到主屏幕”,再点“添加”。"}),e.jsx("p",{children:"Android:打开浏览器菜单,选择“安装应用”或“添加到主屏幕”。"}),e.jsx("p",{style:{color:"var(--ui-muted-text)"},children:"浏览器需要你确认,网页无法自动添加。从主屏幕打开后,如提示未配对,请重新扫码。"}),e.jsx("button",{type:"button",style:{...Qr,width:"100%",padding:"10px 14px",borderStyle:"solid",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:()=>{var d;return(d=p.current)==null?void 0:d.close()},children:"知道了"})]}),c)]})}const pn={shared:"已共享",independent:"独立后台",failed:"连接失败",stopped:"桌面未启动","not-installed":"桌面未安装",unsupported:"暂不支持"};function eo({csrfToken:t}){const[o,a]=n.useState(null),[s,c]=n.useState(!1),u=n.useRef(!1),p=n.useRef(0),d=n.useCallback(async(l=!1,v=!1,E=!1)=>{var f;if(u.current)return;u.current=!0;const L=p.current;c(!0);try{const x=await fetch("/api/agent/codex-sharing",{method:l||v?"POST":"GET",credentials:"same-origin",cache:"no-store",headers:l||v?{"x-csrf-token":t,...v?{"content-type":"application/json"}:{}}:void 0,body:v?JSON.stringify({action:"share",restartConfirmed:E}):void 0,signal:AbortSignal.timeout(18e4)}),h=await x.json();if(!x.ok||!Object.hasOwn(pn,h==null?void 0:h.state))throw new Error(((f=h==null?void 0:h.error)==null?void 0:f.message)||"共享状态读取失败,请重试。");if(L!==p.current)return;a(h)}catch(x){if(L!==p.current)return;a({state:"failed",configured:!1,autoStart:!1,daemonReachable:!1,runtimeMode:null,message:x instanceof Error?x.message:"无法连接当前电脑。"})}finally{u.current=!1,L===p.current&&c(!1)}},[t]);n.useEffect(()=>{d();const l=()=>{document.hidden||d()},v=window.setInterval(l,15e3);return window.addEventListener("online",l),()=>{p.current++,window.clearInterval(v),window.removeEventListener("online",l)}},[d]);const T=o?pn[o.state]:"检查中",g=()=>{const l=(o==null?void 0:o.state)!=="stopped";l&&!window.confirm("切换将强制重启 Codex 桌面,中断桌面任务并可能丢失未发送内容,不再显示 Codex 退出确认框。共享后端和手机会话不会被结束。是否继续?")||d(!1,!0,l)},C=o&&o.state!=="unsupported"&&(o.state!=="shared"||!o.configured||!o.autoStart||!o.daemonReachable);return e.jsxs("div",{className:"codex-sharing",children:[e.jsx("style",{children:to}),e.jsxs("div",{className:"codex-sharing-title",role:"status",children:[e.jsx("span",{className:"codex-sharing-indicator","aria-hidden":"true",children:e.jsx("span",{className:"codex-sharing-dot","data-state":o==null?void 0:o.state})}),e.jsxs("span",{children:["Codex · ",T]})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:o.state==="shared"?"共享连接可用,启动配置需要修复。":o.message}),e.jsxs("div",{className:"codex-sharing-actions",children:[e.jsxs("button",{type:"button",disabled:s,onClick:()=>{d()},"aria-label":"刷新 Codex 共享状态",children:[e.jsx(we,{size:12}),"刷新"]}),e.jsx("button",{type:"button",disabled:s,onClick:()=>{d(!0)},children:s?"正在修复…":"检查并修复"}),!["shared","not-installed"].includes(o.state)&&e.jsx("button",{type:"button",disabled:s,onClick:g,children:s?"正在处理…":o.state==="stopped"?"以共享模式启动 Codex":"切换到共享后端"})]})]})]})}const to=`
|
|
13
|
-
.codex-sharing{padding:10px 14px;margin-bottom:6px;border-bottom:1px solid var(--ui-tabbar-border,#303442);color:var(--ui-text,#e8e8ee);font-size:13px;line-height:20px}
|
|
14
|
-
.codex-sharing-title{display:flex;align-items:center;gap:10px}
|
|
15
|
-
.codex-sharing-indicator{display:grid;place-items:center;flex:0 0 17px;height:17px}
|
|
16
|
-
.codex-sharing-dot{width:6px;height:6px;border-radius:50%;background:var(--ui-muted-text,#999dab)}
|
|
17
|
-
.codex-sharing-dot[data-state=shared]{background:var(--ui-success,#22c55e)}
|
|
18
|
-
.codex-sharing-dot[data-state=failed]{background:var(--ui-danger,#ef4444)}
|
|
19
|
-
.codex-sharing-dot[data-state=independent]{background:var(--ui-warning,#f59e0b)}
|
|
20
|
-
.codex-sharing p{margin:6px 0 0;color:var(--ui-muted-text,#999dab);font-size:12px;line-height:18px;overflow-wrap:anywhere}
|
|
21
|
-
.codex-sharing-actions{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:4px}
|
|
22
|
-
.codex-sharing-actions button{display:flex;align-items:center;gap:5px;min-height:32px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}
|
|
23
|
-
.codex-sharing-actions button:focus-visible{outline:2px solid var(--ui-tab-accent,#7aa2f7);outline-offset:3px}
|
|
24
|
-
.codex-sharing-actions button:disabled{opacity:.5;cursor:wait}
|
|
25
|
-
@media(pointer:coarse){.codex-sharing-actions button{min-height:44px}}
|
|
26
|
-
`;function no({computerName:t,page:o,onClose:a,onSave:s}){const[c,u]=n.useState((o==null?void 0:o.name)??""),[p,d]=n.useState((o==null?void 0:o.url)??""),[T,g]=n.useState((o==null?void 0:o.openMode)??"current"),[C,l]=n.useState(!!o),[v,E]=n.useState(""),[L,f]=n.useState(!1),x=n.useRef(!1),h=n.useRef(null);return n.useEffect(()=>{var R,N;(N=(R=h.current)==null?void 0:R.querySelector("input"))==null||N.focus();const w=D=>{var J;if(D.key==="Escape"&&!x.current&&a(),D.key!=="Tab")return;const F=(J=h.current)==null?void 0:J.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled)");if(!(F!=null&&F.length))return;const Q=F[0],ne=F[F.length-1];D.shiftKey&&document.activeElement===Q?(D.preventDefault(),ne.focus()):!D.shiftKey&&document.activeElement===ne&&(D.preventDefault(),Q.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:w=>{w.target===w.currentTarget&&!x.current&&a()},children:e.jsxs("section",{ref:h,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-page-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-page-title",children:o?"编辑页面":"添加页面"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",disabled:L,onClick:a,children:e.jsx(Te,{size:20})})]}),e.jsxs("p",{className:"computer-hint",children:["所属电脑:",t]}),e.jsxs("form",{onSubmit:async w=>{if(w.preventDefault(),!x.current){x.current=!0,f(!0),E("");try{const R=sr(p),N=(o==null?void 0:o.id)??Array.from(crypto.getRandomValues(new Uint8Array(16)),D=>D.toString(16).padStart(2,"0")).join("");await s({id:N,name:c.trim(),url:R,openMode:T})}catch(R){E(R.message)}finally{x.current=!1,f(!1)}}},children:[e.jsx("label",{htmlFor:"computer-page-name",children:"页面名称"}),e.jsx("input",{id:"computer-page-name",maxLength:60,required:!0,disabled:L,value:c,onChange:w=>u(w.target.value),placeholder:"例如:Zcode / Qoder",autoComplete:"off"}),e.jsx("label",{htmlFor:"computer-page-url",children:"页面地址"}),e.jsx("input",{id:"computer-page-url",required:!0,disabled:L,value:p,onChange:w=>{d(w.target.value),C||g(ar(w.target.value))},placeholder:"https://…",autoComplete:"off",spellCheck:!1}),e.jsx("label",{htmlFor:"computer-page-mode",children:"打开方式"}),e.jsxs("select",{id:"computer-page-mode",disabled:L,value:T,onChange:w=>{g(w.target.value),l(!0)},children:[e.jsx("option",{value:"current",children:"当前页面打开,保留顶部图标栏"}),e.jsx("option",{value:"new-tab",children:"新页面打开,保留原会话页"})]}),e.jsx("p",{className:"computer-hint",children:"当前页面会显示网站自己的界面。若网站禁止内嵌(如 Qoder),可改为新页面打开。"}),v&&e.jsx("p",{className:"computer-error",role:"alert",children:v}),e.jsx("button",{type:"submit",className:"computer-action computer-primary",disabled:L||!c.trim()||!p.trim(),children:L?"正在保存…":"保存页面"})]})]})})}async function ro(t,o){const a=new AbortController,s=()=>a.abort();if(o!=null&&o.aborted)return"offline";o==null||o.addEventListener("abort",s,{once:!0});const c=setTimeout(s,4e3);try{const u=new URL("/pwa/icon-192.png",t);u.searchParams.set("online",String(Date.now()));const p=await fetch(u,{mode:"no-cors",credentials:"omit",cache:"no-store",referrerPolicy:"no-referrer",signal:a.signal});return p.type==="opaque"||p.ok?"online":"offline"}catch{return"offline"}finally{clearTimeout(c),o==null||o.removeEventListener("abort",s)}}const oo=20;function pt(t){if(!Array.isArray(t)||t.length>oo)throw new Error("最多可添加 20 台电脑。");const o=new Set;return t.map(a=>{if(!a||typeof a!="object"||Array.isArray(a)||Object.keys(a).some(c=>!["origin","name"].includes(c))||typeof a.origin!="string"||a.origin.length>2048)throw new Error("电脑地址无效。");let s;try{s=new URL(a.origin)}catch{throw new Error("电脑地址无效。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password||s.pathname!=="/"||s.search||s.hash||o.has(s.origin))throw new Error("电脑地址无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("电脑名称需为 1–60 个字符。");return o.add(s.origin),{origin:s.origin,name:a.name.trim()}})}async function mn(t,o="GET",a){var u;const s=await fetch("/api/web-console/computers",{method:o,credentials:"same-origin",cache:"no-store",headers:a?{"content-type":"application/json","x-csrf-token":t}:void 0,body:a?JSON.stringify(a):void 0,signal:AbortSignal.timeout(15e3)}).catch(()=>{throw new Error("无法连接当前电脑,请检查连接后重试。")}),c=await s.json().catch(()=>null);if(!s.ok)throw new Error(((u=c==null?void 0:c.error)==null?void 0:u.message)??"电脑列表保存失败,请重试。");return pt(c==null?void 0:c.computers)}function io(t){const[o,a]=n.useState([]),[s,c]=n.useState(!1),[u,p]=n.useState(!1),[d,T]=n.useState(""),g=n.useRef(!0),C=n.useRef(!1),l=n.useRef(0),v=n.useRef(!1),E=n.useCallback(R=>{if(g.current){a(N=>N.length===R.length&&N.every((D,F)=>D.origin===R[F].origin&&D.name===R[F].name)?N:R),c(!0);try{const N=Me();Rn(R.map(D=>({...N.find(F=>F.origin===D.origin),...D})))}catch{}}},[]),L=n.useCallback(async()=>{if(C.current)return;const R=++l.current;try{const N=v.current?void 0:cr(Oe(),void 0).map(({origin:F,name:Q})=>({origin:F,name:Q})),D=await mn(t,N?"POST":"GET",N?{computers:N}:void 0);if(!g.current||R!==l.current)return;v.current=!0,E(D),T("")}catch(N){g.current&&R===l.current&&T(N instanceof Error?N.message:"无法读取电脑列表。")}},[E,t]);n.useEffect(()=>{g.current=!0,L();const R=()=>{document.hidden||L()};window.addEventListener("focus",R),window.addEventListener("pageshow",R);const N=window.setInterval(R,15e3);return()=>{g.current=!1,l.current++,window.removeEventListener("focus",R),window.removeEventListener("pageshow",R),window.clearInterval(N)}},[L]);const f=n.useCallback(async(R,N)=>{if(!s||C.current)throw new Error("电脑列表尚未就绪,请稍后重试。");C.current=!0,l.current++,p(!0),T("");try{E(await mn(t,R,N))}catch(D){const F=D instanceof Error?D.message:"电脑列表保存失败,请重试。";throw g.current&&T(F),new Error(F)}finally{C.current=!1,g.current&&p(!1)}},[E,t,s]),x=n.useCallback((R,N)=>f("PATCH",pt([{origin:R,name:N}])[0]),[f]),h=n.useCallback(async R=>{if(new URL(R).origin===Oe())throw new Error("不能删除当前连接的电脑。");await f("DELETE",{origin:R})},[f]),w=n.useCallback((R,N)=>f("POST",{computers:pt([{origin:R,name:N}]),restore:!0}),[f]);return{computers:o,loaded:s,saving:u,error:d,reload:L,rename:x,remove:h,add:w}}let fn;function An(){return window.jsQR?Promise.resolve():fn||(fn=new Promise((t,o)=>{const a=document.createElement("script");a.src="/pwa/qr-decoder.js";const s=()=>{clearTimeout(c),fn=null,a.remove(),o(new Error("二维码识别器加载失败,请重试。"))},c=setTimeout(s,1e4);a.onload=()=>{clearTimeout(c),t()},a.onerror=s,document.head.append(a)}))}function mt(){var t;return!!(window.isSecureContext&&((t=navigator.mediaDevices)!=null&&t.getUserMedia))}async function ao(t){if(!t||t.type&&!t.type.startsWith("image/"))throw new Error("请选择二维码照片。");if(t.size>20*1024*1024)throw new Error("照片过大,请重新拍摄二维码。");await An();const o=new Image,a=URL.createObjectURL(t);try{await new Promise((u,p)=>{const d=setTimeout(()=>p(new Error("照片加载超时,请重新拍摄。")),1e4);o.onload=()=>{clearTimeout(d),u()},o.onerror=()=>{clearTimeout(d),p(new Error("无法读取照片,请重新拍摄二维码。"))},o.src=a});const s=document.createElement("canvas"),c=s.getContext("2d",{willReadFrequently:!0});for(const u of[1600,1024,640]){const p=Math.min(1,u/Math.max(o.naturalWidth,o.naturalHeight));s.width=Math.max(1,Math.round(o.naturalWidth*p)),s.height=Math.max(1,Math.round(o.naturalHeight*p)),c.drawImage(o,0,0,s.width,s.height);const d=c.getImageData(0,0,s.width,s.height),T=window.jsQR(d.data,d.width,d.height);if(T)return T.data}throw new Error("照片中没有识别到二维码,请靠近电脑屏幕重新拍摄。")}finally{o.onload=null,o.onerror=null,URL.revokeObjectURL(a)}}function so(t,o,a){let s,c=0,u;const p=()=>{c++,clearTimeout(u),s==null||s.getTracks().forEach(C=>C.stop()),s=null,t.srcObject=null},d=(C,l)=>{C===c&&(p(),a((l==null?void 0:l.name)==="NotAllowedError"?"相机权限未开启,请允许相机或粘贴二维码链接。":(l==null?void 0:l.message)||"无法启动扫码,请重试。"))},T=async()=>{p();const C=c;if(!mt()){a("实时扫码需要 HTTPS,请使用拍照扫码。");return}try{if(await An(),C!==c)return;const l=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1});if(C!==c){l.getTracks().forEach(x=>x.stop());return}s=l,t.srcObject=l;let v;try{await Promise.race([t.play(),new Promise((x,h)=>{v=setTimeout(()=>h(new Error("相机没有返回画面,请重试。")),1e4)})])}finally{clearTimeout(v)}if(C!==c)return;const E=document.createElement("canvas"),L=E.getContext("2d",{willReadFrequently:!0}),f=()=>{if(C===c)try{if(t.videoWidth&&t.videoHeight){E.width=Math.min(t.videoWidth,640),E.height=Math.round(t.videoHeight*E.width/t.videoWidth),L.drawImage(t,0,0,E.width,E.height);const x=L.getImageData(0,0,E.width,E.height),h=window.jsQR(x.data,x.width,x.height);if(h){p(),o(h.data);return}}u=setTimeout(f,250)}catch(x){p(),a((x==null?void 0:x.message)||"二维码识别失败,请重试。")}};f()}catch(l){d(C,l)}},g=()=>{document.hidden&&p()};return window.addEventListener("pagehide",p),document.addEventListener("visibilitychange",g),{start:T,stop:p,dispose(){p(),window.removeEventListener("pagehide",p),document.removeEventListener("visibilitychange",g)}}}const co=[{id:"refresh",name:"刷新",Icon:we},{id:"dashboard",name:"进行中的会话",Icon:In},{id:"collaboration",name:"群聊列表",Icon:gt},{id:"remote",name:"远程桌面",Icon:it},{id:"theme",name:"皮肤",Icon:Nn},{id:"files",name:"文件树",Icon:mr},{id:"ai-hub",name:"AI Hub",Icon:Ln},{id:"flow",name:"数字人",Icon:bt},{id:"install",name:"添加到主屏幕",Icon:Pn}];function lo({username:t,connected:o,accent:a,accentText:s,selectedPageId:c,onSelectPage:u,onUpdatePage:p,configuration:d,csrfToken:T}){const g=n.useRef(null),C=n.useRef(null),l=io(T),v=l.computers,[E,L]=n.useState(""),[f,x]=n.useState(null),[h,w]=n.useState(!1),[R,N]=n.useState("home"),[D,F]=n.useState(!1),[Q,ne]=n.useState({top:48,right:12}),[J,X]=n.useState(null),[_,k]=n.useState(null),[A,U]=n.useState(""),[q,M]=n.useState({}),P=v.find(b=>b.origin===E),I=d.settings.savedPages??[];n.useEffect(()=>{var b;d.loaded&&c&&p(((b=d.settings.savedPages)==null?void 0:b.find(z=>z.id===c))??null)},[d.loaded,d.settings.savedPages,c,p]),n.useEffect(()=>{var V;L(Oe()),x(((V=g.current)==null?void 0:V.closest(".web-root"))??document.body);const b=window.matchMedia("(max-width: 600px)"),z=()=>F(b.matches);return z(),b.addEventListener("change",z),()=>{b.removeEventListener("change",z)}},[]),n.useEffect(()=>{if(!h)return;const b=B=>{var Y,Z;!((Y=C.current)!=null&&Y.contains(B.target))&&!((Z=g.current)!=null&&Z.contains(B.target))&&w(!1)},z=B=>{var he,Ce;if(B.key==="Escape"&&(w(!1),(he=g.current)==null||he.focus()),!D||B.key!=="Tab")return;const Y=(Ce=C.current)==null?void 0:Ce.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(Y!=null&&Y.length))return;const Z=Y[0],xe=Y[Y.length-1];B.shiftKey&&document.activeElement===Z?(B.preventDefault(),xe.focus()):!B.shiftKey&&document.activeElement===xe&&(B.preventDefault(),Z.focus())},V=()=>{var Z;const B=(Z=g.current)==null?void 0:Z.getBoundingClientRect();if(!B)return;const Y=Math.min(292,innerWidth-24);ne({top:B.bottom+8,right:Math.max(12,Math.min(innerWidth-Y-12,innerWidth-B.right))})};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",z),window.addEventListener("resize",V),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",z),window.removeEventListener("resize",V)}},[h,D]),n.useEffect(()=>{var b,z;h&&((z=(b=C.current)==null?void 0:b.querySelector("button"))==null||z.focus())},[h,R]),n.useEffect(()=>{if(!h)return;const b=new AbortController,z=()=>{for(const B of v)B.origin!==E&&ro(B.origin,b.signal).then(Y=>{b.signal.aborted||M(Z=>({...Z,[B.origin]:Y}))})};z();const V=window.setInterval(z,15e3);return window.addEventListener("online",z),()=>{b.abort(),window.clearInterval(V),window.removeEventListener("online",z)}},[h,v,E]);const O=n.useCallback(()=>{var b;X(null),(b=g.current)==null||b.focus()},[]),oe=n.useCallback(()=>{var b;k(null),(b=g.current)==null||b.focus()},[]),j=n.useCallback(async(b,z)=>{var Z;if(He()){await He().pair(b);return}const V=lr(b),B={origin:V.origin,name:z.trim()||((Z=v.find(xe=>xe.origin===V.origin))==null?void 0:Z.name)||V.hostname},Y=dr(b,an(Me(),v,[B]),z);await l.add(B.origin,B.name),location.assign(Y)},[v,l.add]),H=n.useCallback(async b=>{await l.rename(Oe(),b),O()},[O,l.rename]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:po}),e.jsxs("div",{className:"theme-avatar-with-status",children:[e.jsx("button",{ref:g,type:"button",className:"theme-avatar","aria-label":`电脑与连接状态(${t})`,title:t,style:{border:`1px solid ${a}`,background:a,color:s},"aria-expanded":h,"aria-haspopup":"true",onClick:()=>{const b=g.current.getBoundingClientRect(),z=Math.min(292,innerWidth-24);ne({top:b.bottom+8,right:Math.max(12,Math.min(innerWidth-z-12,innerWidth-b.right))}),h||(N("home"),U(""),d.reload(),l.reload()),w(V=>!V)},children:(t.trim()[0]??"?").toUpperCase()}),e.jsx("span",{className:"theme-avatar-status","data-connected":o,"aria-label":o?"已连接":"未连接"})]}),h&&f&&Ae.createPortal(e.jsx("div",{className:"computer-menu-backdrop","data-toolbar-overlay":!0,children:e.jsxs("div",{ref:C,className:"computer-menu",style:D?void 0:Q,role:"dialog","aria-modal":D,"aria-label":R==="tools"?"配置顶部工具":R==="computers"?"选择电脑":"电脑与保存页面",children:[e.jsx("div",{className:"computer-menu-grip","aria-hidden":"true"}),e.jsxs("div",{className:"computer-menu-heading",children:[R!=="home"&&e.jsx("button",{type:"button",className:"computer-close","aria-label":"返回电脑菜单",onClick:()=>N("home"),children:e.jsx(ur,{size:20})}),R==="home"?e.jsxs("button",{type:"button",className:"computer-menu-item computer-current","aria-label":"选择电脑",onClick:()=>N("computers"),children:[e.jsx(ln,{size:17}),e.jsxs("span",{children:[e.jsx("strong",{children:(P==null?void 0:P.name)||"当前电脑"}),e.jsx("small",{children:o?"当前 · 在线":"当前 · 未连接"})]}),e.jsx(Dr,{size:16})]}):e.jsx("strong",{children:R==="tools"?`${(P==null?void 0:P.name)||"当前电脑"} · 顶部工具`:"选择电脑"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭电脑菜单",onClick:()=>{var b;w(!1),(b=g.current)==null||b.focus()},children:e.jsx(Te,{size:20})})]}),R==="computers"&&e.jsxs(e.Fragment,{children:[!l.loaded&&e.jsx("p",{className:"computer-save-status",role:"status",children:l.error?"电脑列表尚未加载":"正在读取电脑列表…"}),v.map(b=>{const z=b.origin===E?o?"online":"offline":q[b.origin]??"checking",V=z==="online"?"在线":z==="offline"?"无法连接":"检测中";return e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","data-computer-origin":b.origin,"aria-label":`${b.name},${V}${b.origin===E?",当前电脑":""}`,"aria-current":b.origin===E?"true":void 0,onClick:()=>{if(b.origin===E)N("home");else try{const B=He();B?B.switchComputer(b.origin).catch(Y=>U(Y.message)):location.assign(pr(b.origin,an(Me(),v)))}catch(B){U(B.message)}},children:[e.jsx(ln,{size:17,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsx("small",{children:b.origin})]}),e.jsx("span",{className:"computer-status-dot","data-status":z,role:"img","aria-label":V,title:V}),b.origin===E&&e.jsx(dt,{size:16,"aria-label":"当前电脑"})]}),b.origin!==E&&e.jsx("button",{type:"button",className:"computer-page-control computer-delete-control","aria-label":`删除电脑:${b.name}`,title:`删除电脑:${b.name}`,disabled:l.saving,onClick:()=>{l.remove(b.origin).catch(()=>{})},children:e.jsx(wt,{size:15})})]},b.origin)}),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!l.loaded||l.saving,onClick:()=>{const b=He();b?b.scan().catch(z=>U(z.message)):(w(!1),X("add"))},children:[e.jsx(Ve,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:"扫码添加电脑"})]}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!l.loaded||l.saving||!P,onClick:()=>{w(!1),X("rename")},children:[e.jsx(ut,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:"修改当前电脑名称"})]}),l.error&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:l.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{l.reload()},children:[e.jsx(we,{size:16}),e.jsx("span",{children:"重新加载电脑列表"})]})]})]}),R==="home"&&e.jsxs(e.Fragment,{children:[e.jsx(eo,{csrfToken:T}),e.jsxs("div",{className:"computer-menu-label computer-pages-heading",children:[e.jsx("span",{children:"保存的页面"}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":"添加页面",disabled:!d.loaded||d.saving,onClick:()=>{w(!1),k({computer:P??{origin:E,name:"当前电脑"}})},children:e.jsx(Ve,{size:17})})]}),e.jsxs("button",{type:"button",className:"computer-menu-item","aria-current":c?void 0:"true",onClick:()=>{w(!1),u(null)},children:[e.jsx(Jr,{size:17}),e.jsx("span",{children:"电脑会话"}),!c&&e.jsx(dt,{size:16})]}),I.map(b=>e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","aria-label":`打开 ${b.name}`,"aria-current":c===b.id?"true":void 0,onClick:()=>{w(!1),u(b)},children:[e.jsx(lt,{size:15,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsxs("small",{children:[b.openMode==="current"?"当前页面":"新页面"," · ",new URL(b.url).hostname]})]}),b.openMode==="new-tab"&&e.jsx(xt,{size:13,"aria-hidden":"true"})]}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`编辑 ${b.name}`,disabled:d.saving,onClick:()=>{w(!1),k({computer:P??{origin:E,name:"当前电脑"},page:b})},children:e.jsx(ut,{size:14})}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`删除 ${b.name}`,disabled:d.saving,onClick:()=>{d.setSavedPages(I.filter(z=>z.id!==b.id)).catch(()=>{})},children:e.jsx(Te,{size:15})})]},b.id)),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>N("tools"),children:[e.jsx(Lr,{size:17}),e.jsx("span",{children:"配置顶部工具"}),e.jsx(_r,{size:16})]})]}),R==="tools"&&e.jsx("div",{className:"computer-tools-list",children:co.map(({id:b,name:z,Icon:V})=>e.jsxs("label",{className:"computer-tool-option",children:[e.jsx(V,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:z}),e.jsx("input",{type:"checkbox","aria-label":`显示${z}`,checked:d.settings.visibleTools.includes(b),disabled:!d.loaded||d.saving,onChange:B=>{const Y=d.settings.visibleTools;d.setVisibleTools(B.target.checked?[...Y,b]:Y.filter(Z=>Z!==b)).catch(()=>{})}})]},b))}),R!=="computers"&&e.jsx("p",{className:"computer-save-status",role:"status",children:d.loaded?d.saving?"正在保存…":d.notice:d.error?"配置尚未加载":"正在读取电脑配置…"}),d.error&&R!=="computers"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:d.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{d.reload()},children:[e.jsx(we,{size:16}),e.jsx("span",{children:"重新加载配置"})]})]}),A&&e.jsx("p",{className:"computer-error",role:"alert",children:A})]})}),f),J&&f&&Ae.createPortal(e.jsx(uo,{mode:J,currentName:(P==null?void 0:P.name)||"",onClose:O,onNavigate:j,onRename:H}),f),_&&f&&Ae.createPortal(e.jsx(no,{computerName:_.computer.name,page:_.page,onClose:oe,onSave:async b=>{if(_.page&&!I.some(z=>z.id===b.id))throw new Error("这个页面已在其他设备删除,请重新添加。");await d.setSavedPages(_.page?I.map(z=>z.id===b.id?b:z):[...I,b]),oe()}}),f)]})}function uo({mode:t,currentName:o,onClose:a,onNavigate:s,onRename:c}){const[u,p]=n.useState(t==="rename"?o:""),d=n.useRef(u);d.current=u;const[T,g]=n.useState(""),[C,l]=n.useState(""),[v,E]=n.useState(!1),[L,f]=n.useState(!1),[x,h]=n.useState(!1),[w,R]=n.useState(!1),N=n.useRef(null),D=n.useRef(null),F=n.useRef(0),Q=n.useRef(null),ne=n.useRef(null),J=n.useRef(null),X=n.useCallback(async _=>{var k;E(!0),(k=J.current)==null||k.stop(),f(!1),l("");try{await s(_,d.current)}catch(A){l(A.message)}finally{E(!1)}},[s]);return n.useEffect(()=>{var A,U,q;h(mt()),t==="rename"?(A=Q.current)==null||A.focus():(q=(U=ne.current)==null?void 0:U.querySelector("button"))==null||q.focus();const _=M=>{var oe;if(M.key==="Escape"&&a(),M.key!=="Tab")return;const P=(oe=ne.current)==null?void 0:oe.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(P!=null&&P.length))return;const I=P[0],O=P[P.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),O.focus()):!M.shiftKey&&document.activeElement===O&&(M.preventDefault(),I.focus())},k=()=>{document.hidden&&f(!1)};return document.addEventListener("keydown",_),document.addEventListener("visibilitychange",k),t==="add"&&N.current&&(J.current=so(N.current,X,M=>{f(!1),l(M)})),()=>{var M;F.current++,document.removeEventListener("keydown",_),document.removeEventListener("visibilitychange",k),(M=J.current)==null||M.dispose(),J.current=null}},[t,X,a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:_=>{_.target===_.currentTarget&&a()},children:e.jsxs("section",{ref:ne,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-dialog-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-dialog-title",children:t==="add"?"添加电脑":"修改电脑名称"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",onClick:a,children:e.jsx(Te,{size:20})})]}),e.jsxs("form",{onSubmit:async _=>{if(_.preventDefault(),!v)if(t==="add")await X(T);else{E(!0);try{await c(u.trim())}catch(k){l(k.message)}finally{E(!1)}}},children:[e.jsxs("label",{htmlFor:"computer-name",children:["电脑名称",t==="add"?"(选填)":""]}),e.jsx("input",{ref:Q,id:"computer-name",maxLength:60,value:u,required:t==="rename",disabled:v,onChange:_=>p(_.target.value),placeholder:"例如:A 电脑 / 家里的电脑",autoComplete:"off"}),t==="add"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-hint",children:"扫描另一台电脑上的 AgentRoam 授权二维码,连接后会保留已有电脑。"}),e.jsx("input",{ref:D,type:"file",accept:"image/*",capture:"environment",hidden:!0,"aria-label":"拍摄授权二维码",onChange:async _=>{var U,q;const k=(U=_.currentTarget.files)==null?void 0:U[0];if(_.currentTarget.value="",!k)return;const A=++F.current;(q=J.current)==null||q.stop(),f(!1),R(!0),l("");try{const M=await ao(k);A===F.current&&X(M)}catch(M){A===F.current&&l(M.message)}finally{A===F.current&&R(!1)}}}),e.jsx("video",{ref:N,playsInline:!0,muted:!0,hidden:!L,"aria-label":"扫码相机画面"}),e.jsxs("button",{className:"computer-action",type:"button",disabled:w,onClick:()=>{var _,k,A;l(""),L?((_=J.current)==null||_.stop(),f(!1)):mt()?(f(!0),(A=J.current)==null||A.start()):(k=D.current)==null||k.click()},children:[e.jsx(fr,{size:17,"aria-hidden":"true"}),w?"正在识别二维码…":L?"取消扫码":x?"打开相机扫码":"拍照扫码"]}),x&&e.jsx("button",{className:"computer-action",type:"button",disabled:w,onClick:()=>{var _,k;(_=J.current)==null||_.stop(),f(!1),(k=D.current)==null||k.click()},children:"拍照识别二维码"}),e.jsx("label",{htmlFor:"computer-link",children:"或粘贴授权二维码链接"}),e.jsx("input",{id:"computer-link",value:T,onChange:_=>g(_.target.value),placeholder:"http(s)://…/pair#pair=…",autoComplete:"off",spellCheck:!1})]}),C&&e.jsx("p",{className:"computer-error",role:"alert",children:C}),e.jsx("button",{className:"computer-action computer-primary",type:"submit",disabled:v||(t==="add"?!T.trim()||w:!u.trim()),children:t==="add"?"连接这台电脑":v?"正在保存…":"保存名称"})]})]})})}const po=`
|
|
27
|
-
.computer-menu-backdrop{position:fixed;inset:0;z-index:10000}
|
|
28
|
-
.computer-menu-heading{display:flex;align-items:center;gap:4px;padding:2px 4px}.computer-menu-heading>strong{flex:1;min-width:0;font-size:14px;font-weight:500;overflow-wrap:anywhere}.computer-menu-heading>.computer-current{flex:1;min-width:0}.computer-menu-heading>.computer-close{flex-shrink:0}
|
|
29
|
-
.computer-menu-grip{display:none}.computer-pages-heading{display:flex;align-items:center;justify-content:space-between}.computer-tool-option{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px;cursor:pointer}.computer-tool-option span{flex:1;font-size:14px}.computer-tool-option input{width:18px;height:18px;accent-color:var(--ui-tab-accent,#7aa2f7)}.computer-tool-option svg{flex-shrink:0}.computer-save-status{margin:6px 10px 2px;line-height:18px;color:var(--ui-muted-text,#999dab);font-size:12px}.computer-save-status:empty{display:none}.computer-menu button:disabled,.computer-tool-option:has(input:disabled){opacity:.55;cursor:default}
|
|
30
|
-
@media(max-width:600px){.computer-menu-backdrop{background:#0006}.computer-menu-backdrop .computer-menu{top:auto;bottom:0;left:0;right:0;width:100%;max-height:calc(100dvh - 64px);border-radius:18px 18px 0 0;padding:9px 10px calc(14px + env(safe-area-inset-bottom,0px));overscroll-behavior:contain}.computer-menu-grip{display:block;width:32px;height:4px;border-radius:4px;background:var(--ui-tabbar-border,#303442);margin:0 auto 10px}.computer-menu .computer-page-control,.computer-menu .computer-close{width:44px;height:44px;flex-basis:44px}.computer-menu .computer-menu-item{min-height:44px}}
|
|
31
|
-
.computer-menu,.computer-dialog{background:var(--ui-tree-bg,#121218);color:var(--ui-text,#e8e8ee);border:1px solid var(--ui-tabbar-border,#303442);border-radius:12px;box-shadow:0 12px 40px #0006;font-family:system-ui,sans-serif}
|
|
32
|
-
.computer-menu{position:fixed;z-index:10000;width:min(292px,calc(100vw - 24px));padding:7px;box-sizing:border-box;max-height:calc(100dvh - 76px);overflow-y:auto}
|
|
33
|
-
.computer-menu-label{padding:7px 9px;color:var(--ui-muted-text,#999dab);font-size:12px}.computer-menu-divider{height:1px;background:var(--ui-tabbar-border,#303442);margin:6px}
|
|
34
|
-
.computer-menu-row{display:flex;align-items:center;min-width:0;border-radius:8px}
|
|
35
|
-
.computer-page-row{padding-left:20px}
|
|
36
|
-
.computer-page-control{display:grid;place-items:center;flex:0 0 30px;width:30px;height:36px;border:0;border-radius:6px;color:var(--ui-muted-text,#999dab);background:transparent;cursor:pointer}
|
|
37
|
-
.computer-delete-control{margin-inline-end:8px}
|
|
38
|
-
.computer-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
|
|
39
|
-
.computer-menu-item svg{flex-shrink:0}.computer-menu-item span{flex:1;min-width:0;font-size:13px}.computer-menu-item strong{display:block;font-weight:500;overflow-wrap:anywhere}.computer-menu-item small{display:block;color:var(--ui-muted-text,#999dab);font-size:11px;font-weight:400;overflow-wrap:anywhere;margin-top:3px}
|
|
40
|
-
.computer-menu-item[aria-current=true],.computer-menu-row:has(>.computer-menu-item[aria-current=true]){background:color-mix(in srgb,var(--ui-tab-accent,#7aa2f7) 9%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-tab-accent,#7aa2f7) 22%,transparent)}
|
|
41
|
-
.computer-menu-item[aria-current=true]>svg{color:var(--ui-tab-accent,#7aa2f7)}.computer-menu-item[aria-current=true]>span{font-weight:600}
|
|
42
|
-
.computer-menu-row>.computer-menu-item{flex:1;min-width:0;background:transparent;box-shadow:none}
|
|
43
|
-
.computer-menu-item:focus-visible,.computer-page-control:focus-visible,.computer-close:focus-visible{outline:2px solid var(--ui-tab-accent,#7aa2f7);outline-offset:-2px}
|
|
44
|
-
@media(hover:hover){
|
|
45
|
-
.computer-menu-item:hover,.computer-menu-row:hover{background:color-mix(in srgb,var(--ui-text,#e8e8ee) 5%,transparent)}
|
|
46
|
-
.computer-menu-item[aria-current=true]:hover,.computer-menu-row:has(>.computer-menu-item[aria-current=true]):hover{background:color-mix(in srgb,var(--ui-tab-accent,#7aa2f7) 12%,transparent)}
|
|
47
|
-
.computer-menu-row>.computer-menu-item:hover{background:transparent}
|
|
48
|
-
.computer-page-control:hover{background:color-mix(in srgb,var(--ui-text,#e8e8ee) 7%,transparent);color:var(--ui-text,#e8e8ee)}
|
|
49
|
-
}
|
|
50
|
-
.computer-menu-item .computer-status-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:var(--ui-connection-text,#777b8c)}.computer-status-dot[data-status=online]{background:var(--ui-success,#7dcf96)}.computer-status-dot[data-status=offline]{background:var(--ui-error,#f7768e)}
|
|
51
|
-
.computer-dialog-backdrop{position:fixed;inset:0;z-index:10001;background:#0008;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}
|
|
52
|
-
.computer-dialog{width:100%;max-width:400px;max-height:calc(100dvh - 32px);overflow-y:auto;padding:20px;box-sizing:border-box}.computer-dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.computer-dialog h2{margin:0;font-size:18px;font-weight:500}.computer-close{display:grid;place-items:center;border:0;background:transparent;color:inherit;width:36px;height:36px;cursor:pointer}
|
|
53
|
-
.computer-dialog label{display:block;font-size:13px;margin:16px 0 8px}.computer-dialog input{width:100%;box-sizing:border-box;padding:11px 12px;border:1px solid var(--ui-panel-input-border,#30303a);border-radius:8px;background:var(--ui-panel-input-bg,#0f0f15);color:inherit;font:inherit;font-size:16px}.computer-dialog video{width:100%;max-height:240px;border-radius:8px;background:#000;margin:4px 0}.computer-dialog video[hidden]{display:none}
|
|
54
|
-
.computer-dialog select{width:100%;padding:11px 8px;border:1px solid var(--ui-panel-input-border,#30303a);border-radius:8px;background:var(--ui-panel-input-bg,#0f0f15);color:inherit;font:inherit;font-size:14px}
|
|
55
|
-
.computer-hint{color:var(--ui-muted-text,#999dab);font-size:13px;line-height:1.7}.computer-action{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px;margin-top:12px;border:1px solid var(--ui-panel-input-border,#30303a);border-radius:8px;background:var(--ui-tab-bg,#1b1e28);color:inherit;font:inherit;cursor:pointer}.computer-primary{background:var(--ui-tab-accent,#7aa2f7);color:var(--ui-root-bg,#0b0b10);border-color:transparent}.computer-action:disabled{opacity:.45;cursor:default}.computer-error{font-size:13px;line-height:1.6;color:var(--ui-danger,#ffb2a7);padding:0 8px}
|
|
56
|
-
@media(pointer:coarse){.computer-menu-item{min-height:44px}.computer-close{width:44px;height:44px}.computer-page-control{height:44px;flex-basis:36px;width:36px}}
|
|
57
|
-
`;function Ye({label:t="FLOW STUDIO",title:o="正在打开 Flow Studio",caption:a="即将进入你的创作空间",icon:s=e.jsx(bt,{size:36,strokeWidth:1.5})}={}){return e.jsxs("div",{className:"flow-loading",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"flow-loader-art","aria-hidden":"true",children:[e.jsx("div",{className:"flow-loader-halo"}),e.jsx("div",{className:"flow-loader-orbit orbit-outer",children:e.jsx("i",{})}),e.jsx("div",{className:"flow-loader-orbit orbit-inner",children:e.jsx("i",{})}),e.jsx("div",{className:"flow-loader-core",children:s}),e.jsx("span",{className:"flow-loader-node node-one"}),e.jsx("span",{className:"flow-loader-node node-two"}),e.jsx("span",{className:"flow-loader-node node-three"})]}),e.jsxs("div",{className:"flow-loader-copy",children:[e.jsx("span",{className:"flow-loader-label",children:t}),e.jsx("strong",{children:o}),e.jsx("span",{className:"flow-loader-caption",children:a})]}),e.jsx("div",{className:"flow-loader-track","aria-hidden":"true",children:e.jsx("span",{})}),e.jsx("style",{jsx:!0,children:`
|
|
58
|
-
.flow-loading { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden; gap:26px; color:var(--ui-text, #e5e7eb); background:var(--ui-term-col-bg, #101014); animation:flow-appear 280ms ease-out both; }
|
|
59
|
-
.flow-loader-art { position:relative; width:200px; height:200px; flex-shrink:0; }
|
|
60
|
-
.flow-loader-halo { position:absolute; inset:-40px; border-radius:50%; background:radial-gradient(circle, #54e5cf26, #54e5cf08 45%, transparent 70%); animation:flow-breathe 3s ease-in-out infinite; }
|
|
61
|
-
.flow-loader-orbit { position:absolute; border-radius:50%; border:1px solid #54e5cf26; }
|
|
62
|
-
.orbit-outer { inset:8px; border-top-color:#54e5cf; border-right-color:#54e5cf70; animation:flow-orbit 3.2s linear infinite; }
|
|
63
|
-
.orbit-inner { inset:30px; border-bottom-color:#8bbcff; border-left-color:#8bbcff60; animation:flow-orbit 2.4s linear infinite reverse; }
|
|
64
|
-
.flow-loader-orbit i { position:absolute; top:13%; left:13%; width:7px; height:7px; border-radius:50%; background:#77f8df; box-shadow:0 0 14px #54e5cf; }
|
|
65
|
-
.orbit-inner i { background:#8bbcff; box-shadow:0 0 14px #8bbcff; }
|
|
66
|
-
.flow-loader-core { position:absolute; inset:62px; display:grid; place-items:center; border-radius:24px; color:#64e9d3; border:1px solid #54e5cf66; background:linear-gradient(145deg, #54e5cf20, #8bbcff0d); box-shadow:0 0 35px #54e5cf15, inset 0 0 18px #54e5cf0d; animation:flow-breathe 3s ease-in-out infinite; }
|
|
67
|
-
.flow-loader-node { position:absolute; width:5px; height:5px; border-radius:50%; background:#8bbcff; animation:flow-node 2s ease-in-out infinite; }
|
|
68
|
-
.node-one { left:0; top:100px; } .node-two { right:17px; top:38px; animation-delay:.5s; } .node-three { bottom:9px; right:57px; animation-delay:1s; }
|
|
69
|
-
.flow-loader-copy { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; padding:0 20px; }
|
|
70
|
-
.flow-loader-label { font:10px ui-monospace, monospace; letter-spacing:.3em; color:#64cbbb; }
|
|
71
|
-
.flow-loader-copy strong { font-size:18px; font-weight:500; letter-spacing:.02em; }
|
|
72
|
-
.flow-loader-caption { font-size:12px; color:var(--ui-text-muted, #9399aa); }
|
|
73
|
-
.flow-loader-track { width:128px; height:2px; overflow:hidden; background:#54e5cf20; border-radius:2px; }
|
|
74
|
-
.flow-loader-track span { display:block; width:45%; height:100%; background:linear-gradient(90deg, transparent, #64e9d3, #8bbcff); animation:flow-travel 1.8s ease-in-out infinite; }
|
|
75
|
-
@keyframes flow-orbit { to { transform:rotate(360deg); } }
|
|
76
|
-
@keyframes flow-breathe { 50% { transform:scale(1.05); opacity:.7; } }
|
|
77
|
-
@keyframes flow-node { 50% { opacity:.25; transform:scale(.65); } }
|
|
78
|
-
@keyframes flow-travel { from { transform:translateX(-110%); } to { transform:translateX(330%); } }
|
|
79
|
-
@keyframes flow-appear { from { opacity:0; } to { opacity:1; } }
|
|
80
|
-
@media (max-height:420px) { .flow-loading { gap:12px; } .flow-loader-art { width:200px; height:200px; zoom:.65; } }
|
|
81
|
-
@media (prefers-reduced-motion:reduce) { .flow-loading, .flow-loader-halo, .flow-loader-orbit, .flow-loader-core, .flow-loader-node, .flow-loader-track span { animation:none; } }
|
|
82
|
-
`})]})}function mo(t){const o=new URL(t).hostname;return o==="qoder.com"||o.endsWith(".qoder.com")}function fo({page:t,reloadKey:o}){const[a,s]=n.useState(!0),[c,u]=n.useState(!1);return n.useEffect(()=>{s(!0),u(!1);const p=window.setTimeout(()=>u(!0),12e3);return()=>window.clearTimeout(p)},[t.id,t.url,o]),mo(t.url)?e.jsxs("main",{className:"computer-page-blocked",children:[e.jsx(lt,{size:36,strokeWidth:1.5,"aria-hidden":"true"}),e.jsxs("h2",{children:[t.name," 不允许内嵌"]}),e.jsx("p",{children:"这个网站限制了当前页面打开。可以在新页面使用,也可以在电脑菜单中修改打开方式。"}),e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(xt,{size:16,"aria-hidden":"true"}),"打开新页面"]})]}):e.jsxs("main",{className:"computer-page-pane","aria-label":t.name,"aria-busy":a,children:[e.jsx("iframe",{title:t.name,src:t.url,referrerPolicy:"no-referrer",allow:"clipboard-read; clipboard-write; microphone; camera",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals",onLoad:()=>s(!1),onError:()=>{s(!1),u(!0)},style:{visibility:a?"hidden":"visible"}},`${t.id}:${o}`),a&&e.jsx(Ye,{label:"REMOTE PAGE",title:`正在打开 ${t.name}`,caption:"正在连接页面",icon:e.jsx(lt,{size:36,strokeWidth:1.5})}),c&&e.jsx("a",{className:"computer-page-fallback",href:t.url,target:"_blank",rel:"noopener noreferrer",children:"打开原页面"})]})}function ho(t,o,a){const s=t.indexOf(o),c=t.indexOf(a);if(s<0||c<0||s===c)return[...t];const u=[...t];return u.splice(s,1),u.splice(c,0,o),u}const hn=["refresh","dashboard","collaboration","remote","theme","files","ai-hub","flow","install","calendar"],go=["refresh","remote","theme","files","calendar"];function bo(t){return{userId:t,revision:0,visibleTools:[...go],savedPages:null,updatedAt:""}}function Dn(t){if(!Array.isArray(t)||t.length>hn.length+1||t.some(o=>o!=="messaging"&&!hn.includes(o)))throw new Error("顶部工具包含未知选项。");if(new Set(t).size!==t.length)throw new Error("顶部工具不能重复。");return t.filter(o=>o!=="messaging")}function Mn(t){if(!Array.isArray(t)||t.length>20)throw new Error("每台电脑最多可添加 20 个页面。");const o=new Set;return t.map(a=>{if(!a||typeof a.id!="string"||!/^[A-Za-z0-9_-]{1,80}$/.test(a.id)||o.has(a.id))throw new Error("页面标识无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("页面名称需为 1–60 个字符。");if(!["current","new-tab"].includes(a.openMode))throw new Error("页面打开方式无效。");if(typeof a.url!="string"||a.url.length>8192)throw new Error("请填写有效的 http(s) 页面地址。");let s;try{s=new URL(a.url.trim())}catch{throw new Error("请填写有效的 http(s) 页面地址。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password)throw new Error("请填写无账号密码的 http(s) 页面地址。");return o.add(a.id),{id:a.id,name:a.name.trim(),url:s.href,openMode:a.openMode}})}class ft extends Error{constructor(o,a){super(o),this.status=a}}async function Ie(t,o){var c;const a=await fetch("/api/web-console/computer-settings",{method:o?"PATCH":"GET",credentials:"same-origin",cache:"no-store",headers:o?{"content-type":"application/json","x-csrf-token":t}:void 0,body:o?JSON.stringify(o):void 0,signal:AbortSignal.timeout(15e3)}).catch(u=>{throw new Error((u==null?void 0:u.name)==="TimeoutError"?"电脑响应超时,请检查连接后重试。":"无法连接当前电脑,请检查连接后重试。")}),s=await a.json().catch(()=>null);if(!a.ok)throw new ft(((c=s==null?void 0:s.error)==null?void 0:c.message)??"电脑配置保存失败,请检查连接后重试。",a.status);if(!(s!=null&&s.settings)||!Number.isSafeInteger(s.settings.revision))throw new Error("无法读取电脑配置,请重新加载。");return{...s.settings,visibleTools:Dn(s.settings.visibleTools),savedPages:s.settings.savedPages===null?null:Mn(s.settings.savedPages)}}function wo(t){const[o,a]=n.useState(()=>bo("")),s=n.useRef(o),[c,u]=n.useState(!1),[p,d]=n.useState(!1),T=n.useRef(!1),g=n.useRef(!0),C=n.useRef(0),[l,v]=n.useState(""),[E,L]=n.useState(""),f=n.useCallback(w=>{s.current=w,g.current&&a(w)},[]),x=n.useCallback(async()=>{var R;if(T.current)return;const w=++C.current;v(""),L("");try{let N=await Ie(t);if(N.savedPages===null){const D=((R=Me().find(F=>F.origin===location.origin))==null?void 0:R.pages)??[];try{N=await Ie(t,{expectedRevision:N.revision,initializePages:D})}catch(F){if(!(F instanceof ft)||F.status!==409)throw F;if(N=await Ie(t),N.savedPages===null)throw new Error("电脑配置已更新,请重试旧页面导入。")}}if(!g.current||w!==C.current)return;f(N),u(!0);try{Rn(Me().map(D=>{if(D.origin!==location.origin)return D;const{pages:F,...Q}=D;return{...Q,pagesMigrated:!0}}))}catch{}}catch(N){g.current&&w===C.current&&v(N instanceof Error?N.message:"无法读取电脑配置。")}},[f,t]);n.useEffect(()=>{g.current=!0,x();const w=()=>{x()};return window.addEventListener("focus",w),()=>{g.current=!1,C.current++,window.removeEventListener("focus",w)}},[x]);const h=n.useCallback(async w=>{if(!c||T.current)throw new Error("配置尚未就绪,请稍后重试。");T.current=!0,C.current++,d(!0),v(""),L("");const R=s.current;w.visibleTools&&f({...R,visibleTools:w.visibleTools});try{f(await Ie(t,{...w,expectedRevision:R.revision})),g.current&&L("已保存到当前电脑")}catch(N){if(f(R),N instanceof ft&&N.status===409)try{f(await Ie(t))}catch{}const D=N instanceof Error?N.message:"电脑配置保存失败,请重试。";throw g.current&&v(D),new Error(D)}finally{T.current=!1,g.current&&d(!1)}},[f,t,c]);return{settings:o,loaded:c,saving:p,error:l,notice:E,reload:x,setVisibleTools:w=>h({visibleTools:Dn(w)}),setSavedPages:w=>h({savedPages:Mn(w)})}}const xo=["codex","claude agents","opencode","agent-tui"];function yo(){return xo.map((t,o)=>({id:`default-${o+1}`,command:t}))}async function vo(t,o,a,s){const c=a.find(p=>p&&p===t.source);if(!c)return!1;const u=hr(t,o,c);if(!u)return!1;try{const p=await s(u.method,u.payload);c.postMessage({type:sn,id:u.id,ok:!0,result:p},o)}catch(p){const d=p;c.postMessage({type:sn,id:u.id,ok:!1,error:d.message||"项目操作失败",code:d.code},o)}return!0}const ko=1,ht={watcherFrame:4,producerFrame:5},gn=10;function Eo(t){const o=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(o.byteLength<gn||o[0]!==ko||o[1]!==ht.watcherFrame&&o[1]!==ht.producerFrame)return null;const a=new DataView(o.buffer,o.byteOffset,o.byteLength);return{type:o[1],channelId:a.getUint32(2,!1),sequence:a.getUint32(6,!1),payload:o.subarray(gn)}}function jo(){return br()}function So(t,o,a){const[s,c]=n.useState({connected:!1,error:null}),[u,p]=n.useState(0),d=n.useRef(null),T=n.useRef(0),g=n.useRef(new Map),C=n.useRef([]),l=n.useRef(0),v=n.useRef(new Map),E=n.useRef(new Map),L=n.useRef(new Map),f=n.useRef(1e3),x=n.useRef(!1),h=n.useRef(null),w=n.useRef(t),R=n.useRef(o),N=n.useRef(a);w.current=t,R.current=o,N.current=a;const D=n.useCallback((k,A)=>{let U=v.current.get(k);return U||v.current.set(k,U=new Set),U.add(A),()=>U.delete(A)},[]),F=n.useCallback((k,A)=>{let U=E.current.get(k);return U||E.current.set(k,U=new Set),U.add(A),()=>U.delete(A)},[]),Q=n.useCallback((k,A)=>{let U=L.current.get(k);return U||L.current.set(k,U=new Set),U.add(A),()=>U.delete(A)},[]),ne=n.useCallback((k,A)=>{const U=d.current;if(!U||U.readyState!==WebSocket.OPEN)return!1;const q=new TextEncoder().encode(A),M=new Uint8Array(6+q.byteLength),P=new DataView(M.buffer);return M[0]=1,M[1]=1,P.setUint32(2,k),M.set(q,6),U.send(M),!0},[]),J=n.useCallback(k=>{const A=d.current;(A==null?void 0:A.readyState)===WebSocket.OPEN?A.send(k):C.current.push(k)},[]),X=n.useCallback((k,A={},U=15e3)=>new Promise((q,M)=>{var O;if(k.startsWith("browser:")&&((O=d.current)==null?void 0:O.readyState)!==WebSocket.OPEN){M(Object.assign(new Error("远程连接已断开,请等待重新连接"),{code:"EOFFLINE"}));return}const P=++l.current,I=setTimeout(()=>{g.current.delete(P),M(new Error(`${k} timeout`))},U);g.current.set(P,{resolve:q,reject:M,timer:I,type:k}),J(JSON.stringify({type:k,_req:P,...A}))}),[J]),_=n.useCallback(async()=>{x.current=!1;const k=++T.current;h.current&&(clearInterval(h.current),h.current=null);const A=d.current;if(A){A.onopen=A.onmessage=A.onerror=A.onclose=null;try{A.close()}catch{}}let U;try{U=await R.current()}catch{k===T.current&&N.current();return}if(k!==T.current||x.current)return;let q;try{q=new WebSocket(`${jo()}?nonce=${encodeURIComponent(U)}`)}catch(M){c({connected:!1,error:String(M)});return}q.binaryType="arraybuffer",d.current=q,q.onopen=()=>{if(k!==T.current||d.current!==q)return;f.current=1e3,c({connected:!0,error:null}),p(O=>O+1);const M=C.current.splice(0);for(const O of M)q.send(O);let P=Date.now();h.current=setInterval(()=>{if(d.current!==q||q.readyState!==WebSocket.OPEN){clearInterval(h.current),h.current=null;return}if(Date.now()-P>25e3){try{q.close()}catch{}return}try{q.send(JSON.stringify({type:"ping"}))}catch{}},1e4);const I=()=>{P=Date.now()};q.addEventListener("message",I),q.addEventListener("close",()=>q.removeEventListener("message",I),{once:!0})},q.onmessage=M=>{var I,O,oe;if(k!==T.current||d.current!==q)return;if(typeof M.data!="string"){const j=new Uint8Array(M.data);if(j.byteLength>=6&&j[0]===1&&(j[1]===2||j[1]===6)){const H=new DataView(j.buffer,j.byteOffset,j.byteLength).getUint32(2);(I=E.current.get(H))==null||I.forEach(b=>b(j.subarray(6),j[1]===6))}else if(j.byteLength>=6&&j[0]===1&&j[1]===3){const H=new DataView(j.buffer,j.byteOffset,j.byteLength).getUint32(2);(O=L.current.get(H))==null||O.forEach(b=>b())}else w.current(j);return}let P;try{P=JSON.parse(M.data)}catch{return}if(P.type==="error"&&P.id!=null){const j=g.current.get(P.id);if(j){g.current.delete(P.id),clearTimeout(j.timer);const H=Object.assign(new Error(P.error||"gateway error"),{code:P.code});j.reject(H)}return}if(P.id!=null&&typeof P.type=="string"&&P.type.endsWith(":result")){const j=g.current.get(P.id);(j==null?void 0:j.type)==="fs:preview-open"&&typeof P.url=="string"&&(P.url=gr(P.url)),j&&(g.current.delete(P.id),clearTimeout(j.timer),j.resolve(P));return}(oe=v.current.get(P.type))==null||oe.forEach(j=>j(P))},q.onclose=M=>{if(k!==T.current||d.current!==q)return;h.current&&(clearInterval(h.current),h.current=null),d.current=null;for(const[I,O]of g.current)O.type.startsWith("browser:")&&(clearTimeout(O.timer),g.current.delete(I),O.reject(Object.assign(new Error("远程连接已断开,请重新接管"),{code:"EOFFLINE"})));if(c({connected:!1,error:null}),M.code===4001||M.code===4003){N.current();return}if(x.current)return;const P=f.current;f.current=Math.min(P*2,8e3),setTimeout(()=>{!x.current&&k===T.current&&_()},P)},q.onerror=()=>{}},[]);return n.useEffect(()=>(_(),()=>{x.current=!0,T.current++,h.current&&(clearInterval(h.current),h.current=null);const k=d.current;if(d.current=null,k){k.onopen=k.onmessage=k.onerror=k.onclose=null;try{k.close()}catch{}}}),[_]),{state:s,epoch:u,rpc:X,onEvent:D,onTerminalData:F,onTerminalReset:Q,sendTerminalInput:ne,reconnect:_}}function To(t,o,a){n.useEffect(()=>{const s=()=>{var d;return Array.from(((d=t.current)==null?void 0:d.querySelectorAll("iframe"))??[])},c=d=>{var g,C;const T=a&&!document.hidden&&((g=d.closest("[data-console-tab]"))==null?void 0:g.dataset.consoleTab)===o;(C=d.contentWindow)==null||C.postMessage({type:xr,active:T},window.location.origin)},u=()=>s().forEach(c),p=d=>{var g;if(d.origin!==window.location.origin||((g=d.data)==null?void 0:g.type)!==wr)return;const T=s().find(C=>C.contentWindow===d.source);T&&c(T)};return window.addEventListener("message",p),document.addEventListener("visibilitychange",u),u(),()=>{window.removeEventListener("message",p),document.removeEventListener("visibilitychange",u)}},[t,o,a])}function Co(){const[t,o]=n.useState("loading"),[a,s]=n.useState(null),[c]=n.useState("same-origin"),[u,p]=n.useState(null),d=n.useCallback(async()=>{o("loading"),p(null);try{const l=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if(l.status===401||l.status===423){window.location.reload();return}if(!l.ok)throw new Error(`HTTP ${l.status}`);const v=await l.json();s(v.user),o("authenticated")}catch{p("无法连接远程控制台"),o("needsLogin")}},[]);n.useEffect(()=>{d()},[d]);const T=n.useCallback(async()=>{const l=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if((l.status===401||l.status===423)&&window.location.reload(),!l.ok)throw new Error("bootstrap failed");const v=await l.json();return s(v.user),o("authenticated"),v.wsNonce},[]),g=n.useCallback(async()=>(window.location.reload(),!1),[]),C=n.useCallback(async()=>{const l=await fetch("/api/pairing/logout",{method:"POST",credentials:"same-origin"});l.ok||l.status===401||l.status===423?window.location.reload():p("退出失败,请重试")},[]);return{status:t,user:a,error:u,csrfToken:c,setup:g,login:g,logout:C,refresh:d,getWsNonce:T}}function Ro({children:t}){const o=Co(),[a,s]=n.useState(!1),c=o.status==="authenticated",u=n.useCallback(()=>s(!0),[]);return n.useEffect(()=>{c||s(!1)},[c]),e.jsxs(e.Fragment,{children:[c?t(o,u):null,e.jsx(yr,{ready:c&&a,error:o.error,onRetry:()=>void o.refresh()})]})}function bn(t,o,a){const s=t.findIndex(d=>d.id===o),c=t.findIndex(d=>d.id===a);if(s<0||c<0||s===c)return[...t];const u=[...t],[p]=u.splice(s,1);return u.splice(c,0,p),u}function No(){return typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function On(t,o=No()){return{id:o,command:t.trim()}}function Lo({commands:t,onChange:o,onExecute:a}){const[s,c]=n.useState(null),[u,p]=n.useState(""),[d,T]=n.useState(null),g=n.useRef(null),C=()=>{if(!s)return;const f=s.value.trim();if(!f)return p("命令不能为空");if(f.length>1e3)return p("命令最多 1000 个字符");if(/[\r\n\0]/.test(f))return p("命令只能包含一行");s.id?o(t.map(x=>x.id===s.id?{...x,command:f}:x)):o([...t,On(f)]),c(null),p("")},l=(f,x)=>{f.preventDefault(),f.stopPropagation(),g.current=x,T(x),f.currentTarget.setPointerCapture(f.pointerId)},v=f=>{var w;if(!g.current)return;const x=(w=document.elementFromPoint(f.clientX,f.clientY))==null?void 0:w.closest("[data-pinned-id]"),h=x==null?void 0:x.dataset.pinnedId;h&&h!==g.current&&o(bn(t,g.current,h))},E=f=>{f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),g.current=null,T(null)},L=(f,x)=>{if(f.key!=="ArrowUp"&&f.key!=="ArrowDown")return;f.preventDefault();const h=t.findIndex(R=>R.id===x),w=t[h+(f.key==="ArrowUp"?-1:1)];w&&o(bn(t,x,w.id))};return e.jsxs("section",{className:"pinned-commands","aria-labelledby":"pinned-command-title",children:[e.jsxs("div",{className:"pinned-command-head",children:[e.jsx("span",{id:"pinned-command-title",children:"置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:()=>{c({id:null,value:""}),p("")},"aria-label":"新增置顶命令",title:"新增置顶命令",children:e.jsx(Ve,{size:14,"aria-hidden":"true"})})]}),t.map(f=>(s==null?void 0:s.id)===f.id?e.jsx(wn,{editor:s,error:u,onChange:x=>{c({...s,value:x}),p("")},onSave:C,onCancel:()=>{c(null),p("")}},f.id):e.jsxs("div",{className:`pinned-command-row${d===f.id?" pinned-command-dragging":""}`,"data-pinned-id":f.id,role:"button",tabIndex:0,onClick:()=>a(f.command),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a(f.command))},children:[e.jsx("button",{className:"pinned-command-grip",onPointerDown:x=>l(x,f.id),onPointerMove:v,onPointerUp:E,onPointerCancel:E,onKeyDown:x=>L(x,f.id),onClick:x=>x.stopPropagation(),"aria-label":`调整 ${f.command} 的顺序`,title:"拖动排序,或按上下方向键",children:e.jsx(Pr,{size:14,"aria-hidden":"true"})}),e.jsx("code",{children:f.command}),e.jsxs("div",{className:"pinned-command-actions",onClick:x=>x.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>{c({id:f.id,value:f.command}),p("")},"aria-label":`编辑 ${f.command}`,title:"编辑",children:e.jsx(ut,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>o(t.filter(x=>x.id!==f.id)),"aria-label":`删除 ${f.command}`,title:"删除",children:e.jsx(wt,{size:12,"aria-hidden":"true"})})]})]},f.id)),(s==null?void 0:s.id)===null&&e.jsx(wn,{editor:s,error:u,onChange:f=>{c({...s,value:f}),p("")},onSave:C,onCancel:()=>{c(null),p("")}})]})}function wn({editor:t,error:o,onChange:a,onSave:s,onCancel:c}){return e.jsxs("div",{className:"pinned-command-editor",children:[e.jsx("input",{autoFocus:!0,value:t.value,maxLength:1e3,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Enter"&&s(),u.key==="Escape"&&c()},"aria-label":t.id?"编辑置顶命令":"新增置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:s,"aria-label":"保存命令",title:"保存",children:e.jsx(dt,{size:13,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",onClick:c,"aria-label":"取消编辑",title:"取消",children:e.jsx(Te,{size:13,"aria-hidden":"true"})}),o&&e.jsx("small",{role:"alert",children:o})]})}function Po({csrfToken:t,terminalId:o,pinnedCommands:a,onPinnedCommandsChange:s,onFill:c,onExecute:u}){const[p,d]=n.useState([]),[T,g]=n.useState(""),[C,l]=n.useState(""),v=n.useCallback(async()=>{const h=new URLSearchParams({q:T,limit:"200"}),w=await fetch(`/api/web-console/history?${h}`,{credentials:"same-origin"});w.ok&&d((await w.json()).history)},[T]);n.useEffect(()=>{const h=setTimeout(v,200);return()=>clearTimeout(h)},[v]);const E=async h=>{await fetch("/api/web-console/history",{method:"DELETE",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":t},body:JSON.stringify({id:h})}),v()},L=h=>{o&&c(h)},f=n.useCallback(h=>{h==="[REDACTED]"||a.some(w=>w.command===h)||s([...a,On(h)])},[s,a]),x=async h=>{const w=await Fr(h);l(w?"已复制命令":"复制失败,请长按命令手动复制")};return e.jsxs("div",{className:"history-panel",children:[e.jsx(Lo,{commands:a,onChange:s,onExecute:u}),e.jsxs("div",{className:"history-search",children:[e.jsx("input",{value:T,onChange:h=>g(h.target.value),placeholder:"搜索命令"}),e.jsx("button",{className:"history-icon-button",onClick:v,"aria-label":"刷新历史",title:"刷新历史",children:e.jsx(we,{size:13,"aria-hidden":"true"})})]}),C&&e.jsx("div",{className:"terminal-clipboard-notice",role:"status",children:C}),p.map(h=>e.jsxs("div",{className:`history-item${o?"":" history-item-disabled"}`,role:"button",tabIndex:o?0:-1,onClick:()=>L(h.command),onKeyDown:w=>{w.target===w.currentTarget&&(w.key==="Enter"||w.key===" ")&&o&&(w.preventDefault(),L(h.command))},children:[e.jsx("code",{children:h.command}),e.jsxs("small",{children:[h.cwd," · ",new Date(h.executedAt).toLocaleString()]}),e.jsxs("div",{className:"history-item-actions",onClick:w=>w.stopPropagation(),onPointerDown:w=>w.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>void x(h.command),"aria-label":"复制命令",title:"复制",children:e.jsx(Ir,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:!o,onClick:()=>L(h.command),"aria-label":"填入命令",title:"填入",children:e.jsx(Xr,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:h.command==="[REDACTED]"||a.some(w=>w.command===h.command),onClick:()=>f(h.command),"aria-label":"置顶命令",title:"置顶",children:e.jsx(Ar,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>E(h.id),"aria-label":"删除历史",title:"删除",children:e.jsx(wt,{size:12,"aria-hidden":"true"})})]})]},h.id)),!p.length&&e.jsx("div",{className:"history-empty",children:"暂无 Shell 命令历史"}),!o&&!!p.length&&e.jsx("div",{className:"history-empty",children:"请先打开一个终端页签"})]})}function Io(t,o,a){const s=t.bottom+6,c=s+o<=a-8?s:t.top-o-6;return Math.max(8,Math.min(c,a-o-8))}function Ao({themeId:t,onThemeChange:o}){const[a,s]=n.useState(!1),c=n.useRef(null),u=n.useRef(null),p=n.useRef(null),[d,T]=n.useState(null),[g,C]=n.useState({top:-1e3,left:0});return n.useEffect(()=>{var l;T(((l=c.current)==null?void 0:l.closest(".web-root"))??document.body)},[]),n.useLayoutEffect(()=>{if(!a)return;const l=()=>{var x,h,w;const E=(x=u.current)==null?void 0:x.getBoundingClientRect();if(!E)return;const L=Math.min(176,innerWidth-16),f=(h=c.current)!=null&&h.closest(".compact-tools-panel, .glass-tools-sheet")?Io(E,((w=p.current)==null?void 0:w.offsetHeight)??0,innerHeight):E.bottom+6;C({top:f,left:Math.max(8,Math.min(innerWidth-L-8,E.right-L))})};l();const v=new ResizeObserver(l);return p.current&&v.observe(p.current),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),()=>{v.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}},[a]),n.useEffect(()=>{if(!a)return;const l=E=>{var L,f;!((L=c.current)!=null&&L.contains(E.target))&&!((f=p.current)!=null&&f.contains(E.target))&&s(!1)},v=E=>{var L;E.key==="Escape"&&(s(!1),(L=u.current)==null||L.focus())};return document.addEventListener("pointerdown",l),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",l),document.removeEventListener("keydown",v)}},[a]),e.jsxs("div",{ref:c,className:"theme-picker",children:[e.jsx("button",{ref:u,type:"button",className:"file-drawer-toggle","aria-label":"换肤",title:"换肤","aria-expanded":a,"aria-haspopup":"dialog",onClick:()=>s(l=>!l),children:e.jsx(Nn,{size:17,"aria-hidden":"true"})}),a&&d&&Ae.createPortal(e.jsxs("div",{ref:p,className:"theme-popover",role:"dialog","aria-label":"选择皮肤","data-toolbar-overlay":!0,style:{position:"fixed",...g,zIndex:210,width:Math.min(176,innerWidth-16),maxHeight:"calc(100dvh - 16px)",overflowY:"auto",boxSizing:"border-box",padding:8,borderRadius:10,border:"1px solid var(--ui-tabbar-border, #282b36)",background:"var(--ui-tab-active-bg, #262b38)",boxShadow:"0 10px 28px rgba(0,0,0,.45)"},children:[e.jsx("div",{style:{fontSize:10,color:"var(--ui-connection-text, #777b8c)",margin:"2px 4px 6px",letterSpacing:.5},children:"皮肤"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:vr.map(l=>{const v=l.id===t;return e.jsxs("button",{type:"button",className:"theme-popover-item","aria-label":l.label,"aria-pressed":v,onPointerDown:E=>E.stopPropagation(),onClick:()=>{o(l.id),s(!1)},style:{background:v?"color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 14%, transparent)":"transparent"},children:[e.jsx("span",{style:{width:18,height:18,borderRadius:5,flexShrink:0,background:`linear-gradient(135deg, ${l.preview[0]} 55%, ${l.preview[1]} 55%)`,boxShadow:"inset 0 0 0 1px rgba(128,128,160,.25)"}}),e.jsx("span",{style:{flex:1,textAlign:"left",fontSize:12,fontWeight:v?600:400,color:v?"var(--ui-tab-active-text, #edf0f7)":"var(--ui-tab-text, #8f93a4)"},children:l.label}),v&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--ui-tab-accent, #7aa2f7)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m5 12 4 4L19 6"})})]},l.id)})})]}),d)]})}const _n="agent-ui-prefs";function Do(t){var o;try{const a=JSON.parse((t==null?void 0:t.getItem(_n))??"null");return kr((o=a==null?void 0:a.state)==null?void 0:o.navigationLayout)?a.state.navigationLayout:at}catch{return at}}function Mo(t,o){return{height:Math.round((t==null?void 0:t.height)??o.height),width:Math.round((t==null?void 0:t.width)??o.width),top:Math.round((t==null?void 0:t.offsetTop)??0),left:Math.round((t==null?void 0:t.offsetLeft)??0)}}function Oo(t){t&&(t.scrollLeft=0)}const _o="agent-webapp:tab-swipe:v1";function zo(t){if(!t||typeof t!="object")return null;const o=t;return o.type!==_o||o.phase!=="move"&&o.phase!=="end"&&o.phase!=="cancel"||typeof o.deltaX!="number"||!Number.isFinite(o.deltaX)?null:o}function Wo(t,o,a){return t.origin!==o||t.source!==a?null:zo(t.data)}const xn="agent-webapp:ready:v1";function Fo(t){return!t||typeof t!="object"||t.type!==xn?null:{type:xn}}function yn(t,o,a){return t.origin!==o||t.source!==a?null:Fo(t.data)}function ot({groupId:t,title:o,onFrame:a,onLoad:s,view:c,discussionId:u}){const p=n.useRef(null),[d,T]=n.useState("loading"),[g,C]=n.useState(0),l=t===void 0;return n.useEffect(()=>{const v=E=>{var L,f,x;if(c==="sessions"){E.origin===window.location.origin&&E.source===((L=p.current)==null?void 0:L.contentWindow)&&((f=E.data)==null?void 0:f.type)===qr&&T("ready");return}$r(E,window.location.origin,((x=p.current)==null?void 0:x.contentWindow)??null,t??null)&&T("ready")};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[t,c]),n.useEffect(()=>{if(d!=="loading")return;const v=window.setTimeout(()=>T(E=>E==="loading"?"error":E),3e4);return()=>window.clearTimeout(v)},[d,g]),e.jsxs("div",{className:"collaboration-pane","aria-busy":d==="loading",children:[e.jsx("iframe",{ref:v=>{p.current=v,a(v)},className:`webapp-frame collaboration-frame${d==="ready"?" is-ready":""}`,style:{visibility:d==="ready"?"visible":"hidden"},src:st(c==="sessions"?"/app/?view=session-dashboard":l?"/app/?view=collaboration-dashboard":`/app/?view=collaboration&groupId=${encodeURIComponent(t)}${u?`&discussionId=${encodeURIComponent(u)}`:""}`),title:o,onLoad:s,onError:()=>T("error")},g),d==="loading"&&e.jsx(Ye,{label:"AGENT COLLABORATION",title:c==="sessions"?"正在打开会话 Dashboard":l?"正在打开群聊列表":"正在进入群聊",caption:c==="sessions"?"正在核对运行会话与待决策事项":l?"正在加载已保存的群聊":"正在加载群成员与聊天记录",icon:e.jsx(gt,{size:36,strokeWidth:1.5})}),d==="error"&&e.jsxs("div",{className:"collaboration-load-error",role:"alert",children:[e.jsx("strong",{children:c==="sessions"?"暂时无法打开会话 Dashboard":l?"暂时无法打开群聊列表":"暂时无法打开群聊"}),e.jsx("span",{children:"请检查连接后重试。"}),e.jsxs("button",{onClick:()=>{T("loading"),C(v=>v+1)},children:[e.jsx(we,{size:15}),"重新加载"]})]}),e.jsx("style",{jsx:!0,children:`
|
|
83
|
-
.collaboration-pane { position:relative; height:100%; background:var(--ui-term-col-bg, #101014); }
|
|
84
|
-
.collaboration-frame.is-ready { animation:collaboration-appear 220ms ease-out both; }
|
|
85
|
-
.collaboration-load-error { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--ui-text, #e5e7eb); background:var(--ui-term-col-bg, #101014); padding:20px; text-align:center; }
|
|
86
|
-
.collaboration-load-error span { font-size:13px; color:var(--ui-text-muted, #9399aa); }
|
|
87
|
-
.collaboration-load-error button { display:inline-flex; align-items:center; gap:8px; margin-top:6px; min-height:44px; padding:10px 16px; border:1px solid var(--ui-muted-border, #ffffff24); border-radius:9px; background:transparent; color:inherit; font:inherit; cursor:pointer; }
|
|
88
|
-
.collaboration-load-error button:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
|
|
89
|
-
@keyframes collaboration-appear { from { opacity:0; } to { opacity:1; } }
|
|
90
|
-
@media (prefers-reduced-motion:reduce) { .collaboration-frame.is-ready { animation:none; } }
|
|
91
|
-
`})]})}function $o({active:t,children:o}){const[a,s]=n.useState(t);return n.useEffect(()=>{t&&s(!0)},[t]),t||a?o:null}function vn(t){try{const o=JSON.parse(t||"null");if(!o||!Array.isArray(o.tabs))return null;const a=new Set,s=new Set(["webapp","aihub","flowstudio","remote-desktop","collaboration","collaboration-dashboard","session-dashboard"]),c=[];for(const u of o.tabs.slice(0,100))!u||typeof u.id!="string"||typeof u.title!="string"||a.has(u.id)||u.kind!==void 0&&!s.has(u.kind)||u.kind==="collaboration"&&typeof u.groupId!="string"||(a.add(u.id),c.push({id:u.id,title:u.title,...u.kind?{kind:u.kind}:{},...typeof u.groupId=="string"?{groupId:u.groupId}:{},...typeof u.discussionId=="string"&&/^[\w-]{1,200}$/.test(u.discussionId)?{discussionId:u.discussionId}:{}}));return{tabs:c,activeTerminalId:typeof o.activeTerminalId=="string"&&o.activeTerminalId!=="messaging"?o.activeTerminalId:null}}catch{return null}}function Uo(t,o,a){const s=new Map(o.filter(p=>p.status==="active"||p.status==="detached").map(p=>[p.id,{id:p.id,title:p.title}])),c=[],u=new Set;for(const p of[...(t==null?void 0:t.tabs)??[],...a,...s.values()])u.has(p.id)||!p.kind&&!s.has(p.id)||(u.add(p.id),c.push(p.kind?p:s.get(p.id)));return c}const Se={id:"remote-desktop",title:"远程桌面",kind:"remote-desktop"};function kn(t){const o=t.find(a=>a.kind==="remote-desktop");return o?t.map(a=>a===o?{...Se}:a):[...t,{...Se}]}const De={id:"collaboration-dashboard",title:"群聊列表",kind:"collaboration-dashboard"};function En(t){return t.some(o=>o.id===De.id)?t:[...t,{...De}]}const Ke={id:"session-dashboard",title:"Dashboard",kind:"session-dashboard"};function jn(t){return t.some(o=>o.id===Ke.id)?t:[...t,{...Ke}]}const Bo=ze(()=>_e(()=>import("./TerminalPane-CRrbd0i4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),{ssr:!1}),qo=ze(()=>_e(()=>import("./FileTree-CagcHV1N.js"),__vite__mapDeps([14,1,2,15,5,16,6,8]),import.meta.url),{ssr:!1}),Ho=ze(()=>_e(()=>import("./FilePreview-CevPpP6E.js").then(t=>t.b),__vite__mapDeps([17,1,2,7,18,16,8,19,5,20]),import.meta.url),{ssr:!1}),Vo=ze(()=>_e(()=>import("./AiHubPane-Du6ajSsx.js"),__vite__mapDeps([21,1,2,5,6,22,16,23]),import.meta.url),{ssr:!1}),Ko=ze(()=>_e(()=>import("./FlowStudioPane-BZA-qvBj.js"),__vite__mapDeps([24,1,2,25,4,5,6,7,8,9,3,10,11,12]),import.meta.url),{ssr:!1,loading:()=>e.jsx(Ye,{})});function Yo(){return e.jsx(Ro,{children:(t,o)=>e.jsx(Xo,{auth:t,onWorkspaceReady:o})})}const ae={id:"webapp-agent",title:"智能助手",kind:"webapp"},Sn={id:"ai-hub",title:"AI Hub",kind:"aihub"},Tn={id:"flow-studio",title:"Flow Studio",kind:"flowstudio"};function Go(){var t;return typeof document>"u"?Cr:ct((t=document.getElementById("web-theme-root"))==null?void 0:t.dataset.webTheme).id}const Jo="agent-web-shell:skin:v1";function Xo({auth:t,onWorkspaceReady:o}){var _t,zt,Wt,Ft;const[a,s]=n.useState(null),c=n.useRef(null),[u,p]=n.useState(0),d=n.useCallback(r=>{if((r==null?void 0:r.openMode)==="new-tab"){window.open(r.url,"_blank","noopener,noreferrer");return}s(r)},[]),T=n.useCallback(r=>s((r==null?void 0:r.openMode)==="current"?r:null),[]),g=n.useRef(null),C=n.useRef(null),l=n.useRef(null),v=n.useRef(null),E=n.useRef(null),L=n.useRef(!1),[f,x]=n.useState({}),h=n.useRef(new Map),[w,R]=n.useState(0),[N,D]=n.useState(!1),[F,Q]=n.useState(!1),ne=n.useRef(()=>{}),J=n.useCallback(r=>{var m;const i=Eo(r);if(!(!i||i.type!==ht.watcherFrame)){ne.current(i.channelId,i.sequence);for(const y of[g,C]){if(!((m=y.current)!=null&&m.contentWindow))continue;const S=i.payload.slice().buffer;y.current.contentWindow.postMessage({type:Er,channelId:i.channelId,sequence:i.sequence,data:S},window.location.origin,[S])}}},[]),{state:X,epoch:_,rpc:k,onEvent:A,onTerminalData:U,onTerminalReset:q,sendTerminalInput:M}=So(J,t.getWsNonce,t.refresh),P=n.useMemo(()=>({request:(r,i,m)=>k(r,i,m),subscribe:(r,i)=>A("fs:event",i)}),[A,k]);ne.current=(r,i)=>{k("browser:frame-ack",{channelId:r,sequence:i}).catch(()=>{})};const[I,O]=n.useState([{...ae}]),oe=n.useRef(I);oe.current=I;const[j,H]=n.useState(ae.id);To(c,j,!a);const[b,z]=n.useState({}),V=n.useRef(!1),[B,Y]=n.useState(!1),[Z,xe]=n.useState(0),he=`agentroam:workspace:${typeof window>"u"?"":Oe()}:${((_t=t.user)==null?void 0:_t.id)??""}`,Ce=n.useRef(null),ye=n.useRef(new Map),We=n.useRef(new Map),zn=n.useCallback((r,i)=>{ye.current.set(r,i);const m=window.setTimeout(()=>{if(ye.current.get(r)!==i)return;const y=We.current.get(r);y&&(We.current.delete(r),i(y,!0))},180);return()=>{window.clearTimeout(m),ye.current.get(r)===i&&ye.current.delete(r)}},[]),Wn=n.useCallback(r=>{var m;if(!j||(m=I.find(y=>y.id===j))!=null&&m.kind)return;const i=ye.current.get(j);i?i(r):k("term:input",{id:j,data:`${r}`}).catch(()=>{}),le(!1)},[j,k,I]),[ve,Fn]=n.useState(!1),[Re,Ge]=n.useState({}),[de,Fe]=n.useState(null),[ce,le]=n.useState(!1),[ge,$e]=n.useState("files"),[Ne,yt]=n.useState(null),[Le,vt]=n.useState(!0),[$n,Un]=n.useState(null),[Je,kt]=n.useState(!1),[Xe,Et]=n.useState([]),[Qe,jt]=n.useState(yo()),[ke,St]=n.useState(Go),[Tt,Bn]=n.useState(at),[Ct,qn]=n.useState(!1);n.useEffect(()=>{const r=()=>{try{Bn(Do(window.localStorage))}catch{}qn(!0)},i=m=>{(m.key===_n||m.key===null)&&r()};return r(),window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]);const[Rt,Hn]=n.useState(!1),ue=wo(t.csrfToken),[Nt,Vn]=n.useState(!1),re=ct(ke),Ee=n.useRef(null),[Kn,Ze]=n.useState(0),[Yn,et]=n.useState(!1),tt=n.useRef(null),Lt=n.useRef(null),Pt=n.useCallback(r=>{var m;const i=[g.current,C.current,l.current,v.current,...h.current.values()];for(const y of i)(m=y==null?void 0:y.contentWindow)==null||m.postMessage({type:Jo,skin:r},window.location.origin)},[]),ie=n.useCallback(()=>{var i;if(Pt(ke),!Ct)return;const r=[g.current,C.current,l.current,v.current,...h.current.values()];for(const m of r)(i=m==null?void 0:m.contentWindow)==null||i.postMessage({type:jr,navigationLayout:Tt},window.location.origin)},[ke,Tt,Ct,Pt]);n.useEffect(()=>{ie()},[ie]),n.useEffect(()=>{const r=re.cssVars["--ui-root-bg"],i=re.cssVars["--ui-color-scheme"],m=document.getElementById("web-theme-root");for(const[S,$]of Object.entries(re.cssVars))m==null||m.style.setProperty(S,$);m&&(m.dataset.webTheme=re.id),document.documentElement.style.background=r,document.documentElement.style.colorScheme=i,document.body.style.background=r,document.body.style.colorScheme=i;let y=document.querySelector('meta[name="theme-color"]');y||(y=document.createElement("meta"),y.name="theme-color",document.head.append(y)),y.content=re.cssVars["--ui-tabbar-bg"]},[re]),n.useEffect(()=>{const r=i=>{var $t,Ut,Bt,qt,Ht,Vt,Kt,Yt,Gt,Jt,Xt,Qt,Zt,en,tn,nn,rn,on;const m=(($t=l.current)==null?void 0:$t.contentWindow)??null,y=[(Ut=g.current)==null?void 0:Ut.contentWindow,m,(Bt=v.current)==null?void 0:Bt.contentWindow,...[...h.current.values()].map(W=>W.contentWindow)].find(W=>W&&W===i.source)??null,S=Hr(i,window.location.origin,y);if(S){if(s(null),S.kind==="dashboard")O(jn),H(Ke.id);else if(S.kind==="groups")O(En),H(De.id);else if(S.kind==="group"){const W=`collaboration-${S.groupId}`,G={id:W,title:S.title,kind:"collaboration",groupId:S.groupId,discussionId:S.discussionId};O(fe=>fe.some(qe=>qe.id===W)?fe.map(qe=>qe.id===W?G:qe):[...fe,G]),H(W)}else L.current?(Ht=(qt=g.current)==null?void 0:qt.contentWindow)==null||Ht.postMessage({type:un,intent:S},window.location.origin):E.current=S,H(ae.id);return}const $=Ur(i,window.location.origin,m);if($){O(W=>$.deleted?W.filter(G=>G.groupId!==$.groupId):W.map(G=>G.groupId===$.groupId?{...G,title:$.title}:G)),$.deleted?H(W=>W===`collaboration-${$.groupId}`?De.id:W):x(W=>({...W,[$.groupId]:(W[$.groupId]||0)+1}));return}const K=Br(i,window.location.origin,i.source===m?m:((Vt=g.current)==null?void 0:Vt.contentWindow)??null);if(K){const W=`collaboration-${K.groupId}`;O(G=>G.some(fe=>fe.id===W)?G:[...G,{id:W,title:K.title,kind:"collaboration",groupId:K.groupId}]),H(W);return}const ee=((Kt=C.current)==null?void 0:Kt.contentWindow)??null,te=Kr(i,window.location.origin,ee);if(te!==null){D(te);return}if(yn(i,window.location.origin,ee)){D(!1),R(W=>W+1),Q(!1),ie();return}if(ee&&i.origin===window.location.origin&&i.source===ee&&((Yt=i.data)==null?void 0:Yt.type)===Yr){Q(!0);return}if(i.origin===window.location.origin&&i.source===ee&&ee&&((Gt=i.data)==null?void 0:Gt.type)===Gr){D(!1),k("browser:unwatch").catch(()=>{}),O(W=>W.filter(G=>G.kind!=="remote-desktop")),R(0),Q(!1),H(ae.id);return}if(Rr(i,window.location.origin,((Jt=g.current)==null?void 0:Jt.contentWindow)??null)){O(kn),H(Se.id);return}if(yn(i,window.location.origin,((Xt=g.current)==null?void 0:Xt.contentWindow)??null)){L.current=!0,Vn(!0),ie(),o(),E.current&&((Zt=(Qt=g.current)==null?void 0:Qt.contentWindow)==null||Zt.postMessage({type:un,intent:E.current},window.location.origin),E.current=null);return}const ir=(en=[...h.current.values()].find(W=>W.contentWindow===i.source))==null?void 0:en.contentWindow,Pe=Mr(i,window.location.origin,ir??((tn=g.current)==null?void 0:tn.contentWindow)??null);if(Pe){const W=G=>{$e("files"),le(!dn(G)),Fe(G),dn(G)||Un({...Pe,path:G})};Pe.path.startsWith("~/")?k("hello").then(({home:G})=>{const fe=Or(Pe.path,null,G);fe&&W(fe)}).catch(()=>{}):W(Pe.path);return}const be=i.source===ee&&ee?ee:((nn=g.current)==null?void 0:nn.contentWindow)??null,je=Nr(i,window.location.origin,be);if(je){k(je.method,{...je.payload,...je.method==="browser:watch"?{frameAck:!0}:{}}).then(W=>{be==null||be.postMessage({type:cn,id:je.id,ok:!0,result:W},window.location.origin)},W=>{be==null||be.postMessage({type:cn,id:je.id,ok:!1,error:W.message||"浏览器操作失败",code:W.code},window.location.origin)});return}vo(i,window.location.origin,[((rn=g.current)==null?void 0:rn.contentWindow)??null,m,((on=v.current)==null?void 0:on.contentWindow)??null,...[...h.current.values()].map(W=>W.contentWindow)],k)};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[o,k,ie]),n.useEffect(()=>{const r=y=>{var S,$;for(const K of[g,C])($=(S=K.current)==null?void 0:S.contentWindow)==null||$.postMessage({type:rt,event:y},window.location.origin)},m=["browser:session","browser:frame","browser:state","browser:closed","browser:webrtc"].map(y=>A(y,r));return()=>m.forEach(y=>y())},[A]),n.useEffect(()=>{var r,i;Nt&&((i=(r=g.current)==null?void 0:r.contentWindow)==null||i.postMessage({type:rt,event:{type:"browser:connection",connected:X.connected,epoch:_}},window.location.origin))},[X.connected,_,Nt]),n.useEffect(()=>{var r,i;w&&((i=(r=C.current)==null?void 0:r.contentWindow)==null||i.postMessage({type:Vr,visible:j===Se.id},window.location.origin))},[j,w]),n.useEffect(()=>{var r,i;w&&((i=(r=C.current)==null?void 0:r.contentWindow)==null||i.postMessage({type:rt,event:{type:"browser:connection",connected:X.connected,epoch:_}},window.location.origin))},[X.connected,_,w]);const It=n.useRef(0),At=j?b[j]??null:null;n.useEffect(()=>{const r=window.visualViewport;let i=null,m="";const y=()=>{const S=Mo(r,{height:window.innerHeight,width:window.innerWidth}),$=`${S.width}x${S.height}+${S.top}+${S.left}`;$!==m&&(m=$,document.documentElement.style.setProperty("--vv-height",`${S.height}px`),document.documentElement.style.setProperty("--vv-width",`${S.width}px`),document.documentElement.style.setProperty("--vv-top",`${S.top}px`),document.documentElement.style.setProperty("--vv-left",`${S.left}px`),i&&window.clearTimeout(i),i=window.setTimeout(y,250))};return y(),r==null||r.addEventListener("resize",y),r==null||r.addEventListener("scroll",y),window.addEventListener("orientationchange",y),window.addEventListener("resize",y),document.addEventListener("visibilitychange",y),window.addEventListener("pageshow",y),()=>{r==null||r.removeEventListener("resize",y),r==null||r.removeEventListener("scroll",y),window.removeEventListener("orientationchange",y),window.removeEventListener("resize",y),document.removeEventListener("visibilitychange",y),window.removeEventListener("pageshow",y),i&&window.clearTimeout(i),document.documentElement.style.removeProperty("--vv-height"),document.documentElement.style.removeProperty("--vv-width"),document.documentElement.style.removeProperty("--vv-top"),document.documentElement.style.removeProperty("--vv-left")}},[]),n.useEffect(()=>{fetch("/api/web-console/preferences",{credentials:"same-origin"}).then(r=>r.json()).then(r=>{var i,m,y,S;typeof((i=r.preferences)==null?void 0:i.keybarHidden)=="boolean"&&kt(r.preferences.keybarHidden),Array.isArray((m=r.preferences)==null?void 0:m.keyOrder)&&Et(r.preferences.keyOrder),Array.isArray((y=r.preferences)==null?void 0:y.pinnedCommands)&&jt(r.preferences.pinnedCommands),(S=r.preferences)!=null&&S.theme&&St(ct(r.preferences.theme).id)}).catch(()=>{}).finally(()=>Hn(!0)),fetch("/api/web-console/device-state",{credentials:"same-origin"}).then(r=>r.json()).then(r=>{const i=r.deviceState;i!=null&&i.drawerTab&&$e(i.drawerTab),i!=null&&i.activeTerminalId&&(Ce.current=i.activeTerminalId),typeof(i==null?void 0:i.drawerOpen)=="boolean"&&le(i.drawerOpen),i!=null&&i.fileTreeRoot&&yt(i.fileTreeRoot),typeof(i==null?void 0:i.fileTreeFollowMode)=="boolean"&&vt(i.fileTreeFollowMode),i!=null&&i.selectedFile&&Fe(i.selectedFile),i!=null&&i.terminalScroll&&typeof i.terminalScroll=="object"&&Ge(i.terminalScroll)}).catch(()=>{}).finally(()=>Fn(!0))},[]);const Dt=n.useCallback(r=>{fetch("/api/web-console/preferences",{method:"PATCH",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":t.csrfToken},body:JSON.stringify(r)}).catch(()=>{})},[t.csrfToken]);n.useEffect(()=>{if(!Rt)return;const r=setTimeout(()=>Dt({keybarHidden:Je,keyOrder:Xe,pinnedCommands:Qe,theme:ke}),500);return()=>clearTimeout(r)},[Je,Xe,Qe,ke,Rt,Dt]);const Ue=n.useCallback(r=>{t.csrfToken&&fetch("/api/web-console/device-state",{method:"PUT",credentials:"same-origin",keepalive:!0,headers:{"content-type":"application/json","x-csrf-token":t.csrfToken},body:JSON.stringify(r)}).catch(()=>{})},[t.csrfToken]);n.useEffect(()=>{if(!t.csrfToken||!B||!ve)return;const r=setTimeout(()=>Ue({activeTerminalId:j,drawerOpen:ce,drawerTab:ge,fileTreeRoot:Ne,fileTreeFollowMode:Le,selectedFile:de,terminalScroll:Re}),500);return()=>clearTimeout(r)},[j,ce,ge,Ne,Le,de,Re,t.csrfToken,Ue,B,ve]),n.useEffect(()=>{if(!t.csrfToken||!B||!ve)return;const r=()=>Ue({activeTerminalId:j,drawerOpen:ce,drawerTab:ge,fileTreeRoot:Ne,fileTreeFollowMode:Le,selectedFile:de,terminalScroll:Re});return window.addEventListener("pagehide",r),()=>window.removeEventListener("pagehide",r)},[j,ce,ge,Ne,Le,de,Re,t.csrfToken,Ue,B,ve]);const Gn=n.useCallback(r=>{Fe(r),le(!1)},[]),Jn=n.useCallback(()=>{if(I.length>=8)return;const r=`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;O(i=>i.length>=8?i:[...i,{id:r,title:`Terminal ${i.length+1}`}]),H(r)},[I.length]),Xn=n.useCallback(r=>{const i=I.find(S=>S.id===j);if(i!=null&&i.kind&&i.kind!=="webapp")return;if(i&&!i.kind){const S=ye.current.get(i.id);S?S(r,!0):We.current.set(i.id,r),le(!1);return}const m=I.length>=8?I.find(S=>!S.kind):null,y=(m==null?void 0:m.id)??`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;m?We.current.set(y,r):O(S=>[...S,{id:y,title:`Terminal ${S.length+1}`,initialCommand:r}]),H(y),le(!1)},[j,I]);n.useEffect(()=>{if(!X.connected||!ve||V.current)return;V.current=!0;let r=!1,i=!1,m;return k("term:list").then(y=>{if(r)return;let S=null;try{S=vn(localStorage.getItem(he))}catch{}const $=Uo(S,y.tabs,oe.current);O($),H(K=>{const ee=oe.current.find(me=>me.id===K&&me.kind&&me.kind!=="webapp");if(ee)return ee.id;const te=(S==null?void 0:S.activeTerminalId)||Ce.current||K||ae.id;return te===ae.id?ae.id:$.some(me=>me.id===te)?te:ae.id}),i=!0,Y(!0)}).catch(()=>{r||(V.current=!1,m=setTimeout(()=>xe(y=>y+1),2e3))}),()=>{r=!0,clearTimeout(m),i||(V.current=!1)}},[X.connected,ve,k,he,Z]),n.useLayoutEffect(()=>{if(B)try{const r=vn(JSON.stringify({tabs:I,activeTerminalId:j}));localStorage.setItem(he,JSON.stringify(r))}catch{}},[I,j,B,he]);const Qn=r=>{var m;if(r===ae.id)return;const i=(m=I.find(y=>y.id===r))==null?void 0:m.kind;i==="remote-desktop"&&(R(0),Q(!1),k("browser:unwatch").catch(()=>{})),!(!i&&!window.confirm("关闭页签会终止该终端进程,确认关闭?"))&&(O(y=>{var $;const S=y.filter(K=>K.id!==r);return j===r&&H((($=S[0])==null?void 0:$.id)??null),S}),i||k("term:kill",{id:r}).catch(()=>{}))},Zn=n.useCallback(()=>{O(r=>{const i=r.find(m=>m.kind==="aihub");return i?(H(i.id),r):(H(Sn.id),[...r,{...Sn}])})},[]),er=n.useCallback(()=>{O(r=>{const i=r.find(m=>m.kind==="flowstudio");return i?(H(i.id),r):(H(Tn.id),[...r,{...Tn}])})},[]),tr=n.useCallback(()=>{O(kn),H(Se.id)},[]);n.useEffect(()=>{const r=A("term:exited",i=>{const m=i==null?void 0:i.id;m&&(O(y=>{const S=y.filter($=>$.id!==m);return H($=>{var K;return $===m?((K=S[0])==null?void 0:K.id)??null:$}),S}),Ge(y=>{if(!(m in y))return y;const S={...y};return delete S[m],S}))});return()=>{r()}},[A]);const Mt=n.useCallback(r=>{if(!j||I.length<2)return;const m=(I.findIndex(y=>y.id===j)+r+I.length)%I.length;H(I[m].id)},[j,I]),Ot=Math.max(0,I.findIndex(r=>r.id===j)),nr=((zt=I[Ot])==null?void 0:zt.kind)==="webapp"?re.cssVars["--ui-term-col-bg"]:re.termHostBg,rr={...se.root,...re.cssVars,"--ui-active-content-bg":nr,"--ui-terminal-bg":re.termHostBg,"--ui-primary-text":re.keybar.accentText,background:"var(--ui-root-bg)",color:"var(--ui-text)"},pe=n.useCallback(()=>{Ee.current=null,Ze(0),et(!1)},[]),nt=n.useCallback(r=>{Math.abs(r)>=64&&I.length>1&&Mt(r<0?1:-1),pe()},[I.length,Mt,pe]),or=r=>r instanceof Element&&!!r.closest(".terminal-screen");n.useEffect(()=>{const r=i=>{var y;if(j!==ae.id)return;const m=Wo(i,window.location.origin,((y=g.current)==null?void 0:y.contentWindow)??null);m&&(m.phase==="move"?(et(!0),Ze(m.deltaX)):m.phase==="end"?nt(m.deltaX):pe())};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[j,nt,pe]);const Be=n.useCallback((r="smooth")=>{const i=Lt.current;if(!i||!j)return;const m=i.querySelector(`[data-terminal-id="${j}"]`);if(!m)return;if(m===i.querySelector("[data-terminal-id]")){Oo(i);return}const y=i.querySelector(".terminal-connection"),S=(y==null?void 0:y.offsetWidth)??0,$=8,K=m.offsetLeft,ee=K+m.offsetWidth,te=i.scrollLeft,me=te+i.clientWidth-S;K<te+$?i.scrollTo({left:Math.max(0,K-$),behavior:r}):ee>me-$&&i.scrollTo({left:ee-i.clientWidth+S+$,behavior:r})},[j]);return n.useLayoutEffect(()=>{if(!j)return;const r=I.length>It.current;It.current=I.length,Be(r?"auto":"smooth")},[j,I.length,Be]),n.useEffect(()=>{const r=()=>requestAnimationFrame(()=>Be("auto"));return window.addEventListener("pageshow",r),()=>window.removeEventListener("pageshow",r)},[Be]),e.jsxs("div",{className:`web-root ${N&&j===Se.id&&!a?"is-remote-fullscreen":""}`,style:rr,children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:Sr}}),e.jsxs("div",{className:"terminal-tabs",children:[a&&e.jsxs("div",{className:"computer-page-heading",children:[e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"返回电脑会话",title:"返回电脑会话",onClick:()=>s(null),children:e.jsx(zr,{size:18})}),e.jsx("span",{children:a.name}),e.jsx("a",{className:"file-drawer-toggle",href:a.url,target:"_blank",rel:"noopener noreferrer","aria-label":"在新页面打开当前页面",title:"打开原页面",children:e.jsx(xt,{size:16})})]}),e.jsx("div",{className:"terminal-tab-list",ref:Lt,hidden:!!a,children:I.map(r=>e.jsxs("div",{"data-terminal-id":r.id,draggable:!0,className:`terminal-tab ${r.id===j?"active":""}`,onDragStart:()=>{tt.current=r.id},onDragOver:i=>i.preventDefault(),onDrop:i=>{i.preventDefault();const m=tt.current;tt.current=null,!(!m||m===r.id)&&O(y=>{const S=y.findIndex(te=>te.id===m),$=y.findIndex(te=>te.id===r.id);if(S<0||$<0)return y;const K=[...y],[ee]=K.splice(S,1);return K.splice($,0,ee),k("term:reorder",{ids:K.filter(te=>!te.kind).map(te=>te.id)}).catch(()=>{}),K})},onClick:()=>H(r.id),onDoubleClick:()=>{var m;if(r.kind)return;const i=(m=window.prompt("页签名称",r.title))==null?void 0:m.trim();i&&k("term:rename",{id:r.id,title:i}).then(()=>O(y=>y.map(S=>S.id===r.id?{...S,title:i}:S))).catch(()=>{})},children:[e.jsx("span",{children:r.title}),r.kind!=="webapp"&&e.jsx("button",{tabIndex:-1,onClick:i=>{i.stopPropagation(),Qn(r.id)},children:"×"})]},r.id))}),e.jsx("button",{className:"terminal-add","aria-label":"新建终端页签",hidden:!!a,disabled:I.length>=8,onClick:Jn,children:"+"}),e.jsx("div",{className:"terminal-connection",children:e.jsx(Tr,{sortingDisabled:!ue.loaded||ue.saving,onReorder:(r,i)=>{const m=ue.settings.visibleTools;return ue.setVisibleTools(ho(m,r,i))},avatar:e.jsx(lo,{username:((Wt=t.user)==null?void 0:Wt.username)??"?",connected:X.connected,accent:re.keybar.accent,accentText:re.keybar.accentText,selectedPageId:a==null?void 0:a.id,onSelectPage:d,onUpdatePage:T,configuration:ue,csrfToken:t.csrfToken}),items:[{id:"refresh",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"刷新页面",title:"刷新页面",onClick:()=>a?p(r=>r+1):window.location.reload(),children:e.jsx(we,{size:17,"aria-hidden":"true"})})},{id:"dashboard",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开进行中的 Agent 会话",title:"进行中的 Agent 会话",onClick:()=>{s(null),O(jn),H(Ke.id)},children:e.jsx(In,{size:17,"aria-hidden":"true"})})},{id:"collaboration",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开群聊列表",title:"群聊列表",onClick:()=>{s(null),O(En),H(De.id)},children:e.jsx(gt,{size:17,"aria-hidden":"true"})})},{id:"install",content:e.jsx(Zr,{})},{id:"remote",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开远程桌面",title:"远程桌面 · 浏览器直播",onClick:()=>{s(null),tr()},children:e.jsx(it,{size:17,"aria-hidden":"true"})})},{id:"ai-hub",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开 AI Hub",title:"AI Hub · 多模型对比",onClick:()=>{s(null),Zn()},children:e.jsx(Ln,{size:17,"aria-hidden":"true"})})},{id:"flow",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开数字人",title:"数字人 · Flow Studio",onClick:()=>{s(null),er()},children:e.jsx(bt,{size:17,"aria-hidden":"true"})})},{id:"theme",content:e.jsx(Ao,{themeId:ke,onThemeChange:St})},{id:"files",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":ce?"关闭我的文件":"打开我的文件",title:"我的文件","aria-expanded":ce,onClick:()=>{s(null),le(r=>!r)},children:e.jsx(Wr,{size:17,"aria-hidden":"true"})})}].filter(r=>ue.settings.visibleTools.some(i=>i===r.id)).sort((r,i)=>ue.settings.visibleTools.findIndex(m=>m===r.id)-ue.settings.visibleTools.findIndex(m=>m===i.id))})})]}),e.jsxs("main",{className:`workspace ${ce?"show-tree":""} ${de?"has-preview":""}`,hidden:!!a,style:se.workspace,children:[e.jsx("section",{className:"term-col",style:se.termCol,onPointerDownCapture:r=>{r.pointerType!=="touch"||!or(r.target)||(pe(),Ee.current={x:r.clientX,y:r.clientY,axis:"pending",pointerId:r.pointerId})},onPointerMoveCapture:r=>{const i=Ee.current;if(!i||r.pointerId!==i.pointerId||r.pointerType!=="touch")return;const m=r.clientX-i.x,y=r.clientY-i.y;if(i.axis==="pending"){if(Math.max(Math.abs(m),Math.abs(y))<=8)return;if(Math.abs(y)>=Math.abs(m)*1.2){Ee.current=null;return}i.axis="horizontal",et(!0);const S=$=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),Ee.current===i&&pe()};window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)}i.axis==="horizontal"&&(r.preventDefault(),Ze(m))},onPointerUpCapture:r=>{const i=Ee.current;if(!i||r.pointerId!==i.pointerId)return;const m=r.clientX-i.x;i.axis==="horizontal"&&Math.abs(m)>=64?nt(m):pe()},onPointerCancelCapture:pe,children:e.jsx("div",{ref:c,className:"terminal-track",style:{transform:`translate3d(calc(${-Ot*100}% + ${Kn}px),0,0)`,transition:Yn?"none":"transform 260ms cubic-bezier(.22,.8,.32,1)"},children:I.map(r=>e.jsx("div",{className:"terminal-slide","data-console-tab":r.id,style:{position:"relative"},children:e.jsx($o,{active:r.kind==="webapp"||!r.kind||r.id===j,children:r.kind==="webapp"?e.jsx("iframe",{ref:g,className:"webapp-frame",src:st("/app/"),title:r.title,onLoad:ie}):r.kind==="session-dashboard"?e.jsx(ot,{view:"sessions",title:"会话 Dashboard",onFrame:i=>{v.current=i},onLoad:ie}):r.kind==="collaboration-dashboard"?e.jsx(ot,{title:"群聊列表",onFrame:i=>{l.current=i},onLoad:ie}):r.kind==="collaboration"?e.jsx(ot,{groupId:r.groupId||"",discussionId:r.discussionId,title:r.title,onFrame:i=>{i?h.current.set(r.id,i):h.current.delete(r.id)},onLoad:ie},`${r.id}-${r.discussionId??""}-${f[r.groupId||""]||0}`):r.kind==="remote-desktop"?e.jsxs("div",{style:{height:"100%",background:"var(--ui-term-col-bg, #101014)"},"aria-busy":!F,children:[e.jsx("iframe",{ref:C,className:"webapp-frame",style:{visibility:F?"visible":"hidden"},src:st("/app/?view=remote-desktop"),title:"远程桌面",onLoad:ie}),!F&&e.jsx(Ye,{label:"REMOTE DESKTOP",title:"正在打开远程桌面",caption:"正在准备桌面与连接",icon:e.jsx(it,{size:36,strokeWidth:1.5})})]}):r.kind==="aihub"?e.jsx(Vo,{visible:r.id===j,rpc:k}):r.kind==="flowstudio"?e.jsx(Ko,{visible:r.id===j}):e.jsx(Bo,{terminalId:r.id,title:r.title,initialCommand:r.initialCommand,visible:r.id===j,state:X,rpc:k,onEvent:A,onTerminalData:U,onTerminalReset:q,sendTerminalInput:M,keyOrder:Xe,keybarHidden:Je,onKeyOrderChange:Et,onKeybarHiddenChange:kt,terminalTheme:re,initialScrollLine:Re[r.id]??null,onScrollLineChange:i=>Ge(m=>m[r.id]===i?m:{...m,[r.id]:i}),onRegisterFill:i=>zn(r.id,i),onCwdChange:i=>i&&z(m=>({...m,[r.id]:i}))})})},r.id))})}),ce&&e.jsx("div",{className:"drawer-mask",onClick:()=>le(!1)}),e.jsxs("aside",{className:`tree-col ${ce?"tree-col-open":""}`,style:se.treeCol,children:[e.jsxs("div",{className:"tree-head",style:se.treeHead,children:[e.jsx("button",{className:ge==="files"?"drawer-tab-active":"",onClick:()=>$e("files"),children:"文件"}),e.jsx("button",{className:ge==="history"?"drawer-tab-active":"",onClick:()=>$e("history"),children:"历史"}),e.jsx("span",{className:"tree-cwd",style:se.treeCwd,children:At??""}),e.jsx("button",{style:{...se.iconBtn,marginLeft:"auto",flexShrink:0},onClick:()=>le(!1),"aria-label":"close drawer",children:e.jsx(Te,{size:15,"aria-hidden":"true"})})]}),ge==="files"?e.jsx(qo,{ready:_>0,followCwd:!0,cwd:At,gateway:P,onOpenFile:Gn,selectedPath:de,initialRoot:Ne,initialFollow:Le,revealRequest:$n,onTreeStateChange:(r,i)=>{yt(r),vt(i)}}):e.jsx(Po,{csrfToken:t.csrfToken,terminalId:((Ft=I.find(r=>r.id===j))==null?void 0:Ft.kind)==="webapp"?null:j,pinnedCommands:Qe,onPinnedCommandsChange:jt,onFill:Wn,onExecute:Xn}),e.jsxs("div",{className:"tree-foot",style:se.treeFoot,children:[e.jsx("span",{style:se.treeFootDot}),e.jsx("span",{children:"实时同步"})]})]}),de&&e.jsx("section",{className:"preview-col",style:se.previewCol,children:e.jsx(Ho,{path:de,gateway:P,onClose:()=>Fe(null)})})]}),a&&e.jsx(fo,{page:a,reloadKey:u},a.id)]})}const se={root:{height:"100dvh",display:"flex",flexDirection:"column",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif',overflow:"hidden"},iconBtn:{minWidth:28,height:28,borderRadius:7,border:"1px solid var(--ui-tabbar-border, #303442)",background:"var(--ui-tab-bg, #202029)",color:"var(--ui-tab-text, #aaaab8)",fontSize:13},workspace:{flex:1,minHeight:0,display:"grid",position:"relative"},treeCol:{background:"var(--ui-tree-bg, #121218)",minHeight:0,flexDirection:"column"},treeHead:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px 4px",fontSize:11,textTransform:"uppercase",letterSpacing:1,color:"#778",flexShrink:0},treeCwd:{fontSize:10,color:"#556",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:150,textTransform:"none",letterSpacing:0},treeFoot:{display:"flex",alignItems:"center",gap:7,minHeight:31,padding:"6px 11px calc(env(safe-area-inset-bottom) + 6px)",borderTop:"1px solid var(--ui-tabbar-border, #282832)",boxShadow:"0 -5px 16px rgba(0,0,0,.22)",background:"var(--ui-tab-bg, #15151c)",color:"var(--ui-connection-text, #777789)",fontSize:10.5,flexShrink:0},treeFootDot:{width:6,height:6,borderRadius:99,background:"var(--ui-success, #9ece6a)",boxShadow:"0 0 0 2px color-mix(in srgb, var(--ui-success, #9ece6a) 12%, transparent)",flexShrink:0},termCol:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",background:"var(--ui-term-col-bg, #101014)",gridColumn:1,overflow:"hidden"},previewCol:{minWidth:0,minHeight:0}},li=Object.freeze(Object.defineProperty({__proto__:null,default:Yo},Symbol.toStringTag,{value:"Module"}));export{Ye as F,li as p,Oo as r};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as E,r as p,j as s}from"./index-DKm9ESDq.js";import{p as D,S as A,a as k,r as N}from"./SessionDashboardBridge-Bx4EXtos.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 _=E("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);let c;function v(d){if(c==null||c(),d.kind==="session"&&window.parent!==window&&document.body.dataset.agentroamChatNavigation!=="ready"){const r=window.parent,l=window.location.origin,h=new Set,t=()=>{r.removeEventListener("message",b),window.removeEventListener("pagehide",t),clearTimeout(f),c===t&&(c=void 0)},b=e=>{var u,o;e.origin!==l||!e.source||e.source===window||!Array.from({length:r.frames.length},(y,n)=>r.frames[n]).includes(e.source)||(((u=e.data)==null?void 0:u.type)===A&&e.data.sessionId===d.session.id?t():((o=e.data)==null?void 0:o.type)===k&&typeof e.data.instanceId=="string"&&!h.has(e.data.instanceId)?(h.add(e.data.instanceId),D(d)):N(e,l,e.source)&&t())},f=setTimeout(t,3e4);c=t,r.addEventListener("message",b),window.addEventListener("pagehide",t,{once:!0})}D(d)}function P({text:d,options:r,recommendation:l,multiSelect:h,sourceOnly:t,onAnswer:b,onSource:f}){const[e,u]=p.useState(""),[o,y]=p.useState([]),[n,j]=p.useState(!1),[w,x]=p.useState(""),g=async(a,i)=>{if(!(!a.trim()||n)){j(!0),x("");try{await b(a,i),u("")}catch(m){x(m instanceof Error?m.message:"答复失败,请刷新核对")}finally{j(!1)}}};return s.jsxs("section",{className:"session-dashboard-decision","aria-label":"待处理决策",children:[s.jsx("p",{children:d}),l&&s.jsxs("p",{className:"session-dashboard-recommendation",children:["建议:",l]}),!t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"session-dashboard-options",children:r==null?void 0:r.map((a,i)=>h?s.jsxs("label",{title:a.description,children:[s.jsx("input",{type:"checkbox",checked:o.includes(i),disabled:n,onChange:m=>y(S=>m.target.checked?[...S,i]:S.filter(I=>I!==i))}),a.label,s.jsx("small",{children:a.description})]},i):s.jsx("button",{type:"button",disabled:n,title:a.description,onClick:()=>void g(a.label,[i]),children:a.label},i))}),h&&!!o.length&&s.jsx("button",{type:"button",disabled:n,onClick:()=>void g(o.map(a=>r[a].label).join("、"),o),children:"确认所选"}),s.jsxs("form",{onSubmit:a=>{a.preventDefault(),g(e)},children:[s.jsx("input",{"aria-label":"答复此决策",value:e,maxLength:1e4,placeholder:"输入你的决定",onChange:a=>u(a.target.value)}),s.jsx("button",{disabled:n||!e.trim(),children:n?"处理中…":"答复"})]})]}),w&&s.jsx("p",{role:"alert",className:"collab-error",children:w}),s.jsx("button",{type:"button",className:"session-dashboard-source",onClick:f,children:t?"进入原会话填写":"查看来源会话"})]})}export{P as D,_ as P,v as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as r,b as e,a,S as s}from"./chunk-IMKFNOWR-C0NrkJOc.js";import{_ as i}from"./mermaid.core-C8Dl0Nah.js";import"./chunk-XXDRQBXY-CYgLMn5t.js";import"./chunk-POPQ4Y6H-BXvOsc9g.js";import"./chunk-F27PBJKO-XBMwIl6X.js";import"./index-DKm9ESDq.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as r,s as e}from"./flowDiagram-HODETNUW-tc8ygZtG.js";import{_ as a}from"./mermaid.core-C8Dl0Nah.js";import"./chunk-5VM5RSS4-Buiv0MCN.js";import"./chunk-XXDRQBXY-CYgLMn5t.js";import"./chunk-POPQ4Y6H-BXvOsc9g.js";import"./chunk-F27PBJKO-XBMwIl6X.js";import"./channel-JGVZzkSo.js";import"./index-DKm9ESDq.js";var o=a(t=>`${e(t)}
|
|
2
|
-
.swimlane.cluster rect {
|
|
3
|
-
stroke: ${t.clusterBorder} !important;
|
|
4
|
-
}
|
|
5
|
-
[data-look="neo"].cluster rect {
|
|
6
|
-
filter: none;
|
|
7
|
-
}
|
|
8
|
-
`,"getStyles"),s=o,n=r({defaultLayout:"swimlane",styles:s});export{n as diagram};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-DKm9ESDq.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 a=e("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
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 c=e("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
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 o=e("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
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=e("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);export{a as M,c as V,k as Z,o as a};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
class PcmStreamProcessor extends AudioWorkletProcessor {
|
|
2
|
-
constructor() {
|
|
3
|
-
super();
|
|
4
|
-
this.ring = new Float32Array(1);
|
|
5
|
-
this.capacity = 1;
|
|
6
|
-
this.readIndex = 0;
|
|
7
|
-
this.writeIndex = 0;
|
|
8
|
-
this.size = 0;
|
|
9
|
-
this.phase = 0;
|
|
10
|
-
this.inputSampleRate = 24000;
|
|
11
|
-
this.startThreshold = 2880;
|
|
12
|
-
this.generation = null;
|
|
13
|
-
this.playing = false;
|
|
14
|
-
this.inputEnded = false;
|
|
15
|
-
this.underrunReported = false;
|
|
16
|
-
this.terminalReported = false;
|
|
17
|
-
this.port.onmessage = (event) => this.handleMessage(event.data);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
resetBuffer() {
|
|
21
|
-
this.readIndex = 0;
|
|
22
|
-
this.writeIndex = 0;
|
|
23
|
-
this.size = 0;
|
|
24
|
-
this.phase = 0;
|
|
25
|
-
this.playing = false;
|
|
26
|
-
this.inputEnded = false;
|
|
27
|
-
this.underrunReported = false;
|
|
28
|
-
this.terminalReported = false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
handleMessage(message) {
|
|
32
|
-
if (message.type === "start") {
|
|
33
|
-
this.inputSampleRate = message.sampleRate;
|
|
34
|
-
this.capacity = message.sampleRate;
|
|
35
|
-
this.startThreshold = Math.ceil(message.sampleRate * 0.12);
|
|
36
|
-
this.ring = new Float32Array(this.capacity);
|
|
37
|
-
this.generation = message.generation;
|
|
38
|
-
this.resetBuffer();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (message.generation !== this.generation) return;
|
|
42
|
-
if (message.type === "chunk") {
|
|
43
|
-
const samples = message.samples;
|
|
44
|
-
if (!(samples instanceof Float32Array) || samples.length > this.capacity - this.size) {
|
|
45
|
-
const generation = this.generation;
|
|
46
|
-
this.resetBuffer();
|
|
47
|
-
this.generation = null;
|
|
48
|
-
this.port.postMessage({ type: "overflow", generation });
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
for (let index = 0; index < samples.length; index += 1) {
|
|
52
|
-
this.ring[this.writeIndex] = samples[index];
|
|
53
|
-
this.writeIndex = (this.writeIndex + 1) % this.capacity;
|
|
54
|
-
}
|
|
55
|
-
this.size += samples.length;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (message.type === "finish") {
|
|
59
|
-
this.inputEnded = true;
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (message.type === "flush") {
|
|
63
|
-
const generation = this.generation;
|
|
64
|
-
this.resetBuffer();
|
|
65
|
-
this.generation = null;
|
|
66
|
-
this.port.postMessage({ type: "stopped", generation });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
sampleAt(offset) {
|
|
71
|
-
return this.ring[(this.readIndex + offset) % this.capacity];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
reportDrained() {
|
|
75
|
-
if (this.terminalReported || this.generation === null) return;
|
|
76
|
-
this.terminalReported = true;
|
|
77
|
-
const generation = this.generation;
|
|
78
|
-
this.generation = null;
|
|
79
|
-
this.port.postMessage({ type: "drained", generation });
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
process(_inputs, outputs) {
|
|
83
|
-
const output = outputs[0][0];
|
|
84
|
-
output.fill(0);
|
|
85
|
-
if (this.generation === null) return true;
|
|
86
|
-
if (!this.playing) {
|
|
87
|
-
if (this.size >= this.startThreshold || (this.inputEnded && this.size > 0)) {
|
|
88
|
-
this.playing = true;
|
|
89
|
-
this.underrunReported = false;
|
|
90
|
-
} else if (this.inputEnded && this.size === 0) {
|
|
91
|
-
this.reportDrained();
|
|
92
|
-
return true;
|
|
93
|
-
} else {
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const ratio = this.inputSampleRate / sampleRate;
|
|
99
|
-
for (let index = 0; index < output.length; index += 1) {
|
|
100
|
-
if (this.size === 0) {
|
|
101
|
-
if (this.inputEnded) this.reportDrained();
|
|
102
|
-
else {
|
|
103
|
-
this.playing = false;
|
|
104
|
-
if (!this.underrunReported) {
|
|
105
|
-
this.underrunReported = true;
|
|
106
|
-
this.port.postMessage({ type: "underrun", generation: this.generation });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
const first = this.sampleAt(0);
|
|
112
|
-
const second = this.size > 1 ? this.sampleAt(1) : first;
|
|
113
|
-
output[index] = first + (second - first) * this.phase;
|
|
114
|
-
this.phase += ratio;
|
|
115
|
-
const consumed = Math.min(Math.floor(this.phase), this.size);
|
|
116
|
-
if (consumed > 0) {
|
|
117
|
-
this.readIndex = (this.readIndex + consumed) % this.capacity;
|
|
118
|
-
this.size -= consumed;
|
|
119
|
-
this.phase -= consumed;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
registerProcessor("pcm-stream-player", PcmStreamProcessor);
|
/package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → q4ez_w8bVMUW1e57Cd7GC}/_buildManifest.js
RENAMED
|
File without changes
|
/package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → q4ez_w8bVMUW1e57Cd7GC}/_ssgManifest.js
RENAMED
|
File without changes
|