agentroam-runtime-darwin-arm64 0.2.0-preview.48 → 0.2.0-preview.55
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 +5 -2
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +13 -13
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +6 -6
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/react-loadable-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +2 -2
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +47 -47
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +31 -31
- package/runtime/.next/server/chunks/1322.js +12 -12
- package/runtime/.next/server/chunks/1773.js +45 -45
- package/runtime/.next/server/chunks/5303.js +2 -2
- package/runtime/.next/server/chunks/6244.js +1 -1
- package/runtime/.next/server/chunks/6703.js +2 -2
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/middleware-react-loadable-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/326.46c95c57319be857.js +1 -0
- package/runtime/.next/static/chunks/app/web/error-bb3ae59f01cd6334.js +1 -0
- package/runtime/.next/static/chunks/app/web/{layout-6382c87cac6de8d3.js → layout-0645ff361837020f.js} +1 -1
- package/runtime/.next/static/chunks/app/web/page-37a417fa210a5072.js +1 -0
- package/runtime/.next/static/chunks/{main-app-03cbfb0621bc469a.js → main-app-f508b4b3ab30eea6.js} +1 -1
- package/runtime/.next/static/chunks/{webpack-d331689549804d1b.js → webpack-df5191d21627ba96.js} +1 -1
- package/runtime/lib/device-pairing-gateway.mjs +23 -3
- package/runtime/lib/device-pairing-store.mjs +14 -3
- package/runtime/lib/file-preview-service.mjs +18 -3
- package/runtime/lib/remote-control/helper-manager.mjs +17 -17
- package/runtime/lib/remote-control/macos-helper-app.mjs +181 -0
- package/runtime/lib/remote-control/remote-authorization.mjs +3 -1
- package/runtime/native/{AgentRoam Remote Desktop.app → 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 -0
- package/runtime/native/{AgentRoam Remote Desktop.app → Support.noindex/AgentRoam Remote Desktop.app}/Contents/_CodeSignature/CodeResources +11 -0
- package/runtime/node_modules/.package-lock.json +126 -126
- package/runtime/node_modules/@agent/core/dist/index.js +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +48 -48
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +41 -41
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-6z7brxfa.mjs +52 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x118ntbh.mjs +35 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +18 -18
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +19 -19
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +23 -23
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +12 -12
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +73 -73
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +84 -27
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +9 -9
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +9 -9
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +84 -27
- package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +84 -27
- package/runtime/node_modules/mediabunny/dist/modules/src/conversion.js +29 -12
- package/runtime/node_modules/mediabunny/dist/modules/src/encode.js +5 -2
- package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-segmented-input.js +1 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/input.js +4 -0
- package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +24 -12
- package/runtime/node_modules/mediabunny/dist/modules/src/sample.js +9 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/segmented-input.js +3 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/source.js +2 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
- package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
- package/runtime/node_modules/mediabunny/package.json +1 -1
- package/runtime/node_modules/mediabunny/src/conversion.ts +33 -12
- package/runtime/node_modules/mediabunny/src/encode.ts +5 -2
- package/runtime/node_modules/mediabunny/src/hls/hls-segmented-input.ts +1 -1
- package/runtime/node_modules/mediabunny/src/input.ts +5 -0
- package/runtime/node_modules/mediabunny/src/media-sink.ts +26 -13
- package/runtime/node_modules/mediabunny/src/sample.ts +10 -1
- package/runtime/node_modules/mediabunny/src/segmented-input.ts +3 -1
- package/runtime/node_modules/mediabunny/src/source.ts +2 -1
- package/runtime/node_modules/mediabunny/src/version.ts +1 -1
- package/runtime/package-lock.json +159 -159
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/AiHubPane-Cu92elLn.js +6 -0
- package/runtime/webapp/dist/assets/App-CIoUFqUR.js +169 -0
- package/runtime/webapp/dist/assets/{App-iUeP1CBo.css → App-CMOzoP5A.css} +1 -1
- package/runtime/webapp/dist/assets/BrowserLivePanel-BsthwY1a.js +76 -0
- package/runtime/webapp/dist/assets/CollaborationDashboard-DG7Y0h1s.js +6 -0
- package/runtime/webapp/dist/assets/CollaborationPage-DA902wqi.js +16 -0
- package/runtime/webapp/dist/assets/CollaborationTabBridge-Dqnn1SXm.js +1 -0
- package/runtime/webapp/dist/assets/FilePreview-CGjiY6Oh.js +24 -0
- package/runtime/webapp/dist/assets/FilePreview-Zls_kcY7.css +1 -0
- package/runtime/webapp/dist/assets/FileTree-BC45MKRL.js +11 -0
- package/runtime/webapp/dist/assets/FlowStudioPane-9TrQcObf.js +5 -0
- package/runtime/webapp/dist/assets/RemoteDesktopPage-DMnDxASQ.js +1 -0
- package/runtime/webapp/dist/assets/RemoteDesktopTabBridge-Cp9mLtcY.js +1 -0
- package/runtime/webapp/dist/assets/TerminalPane-6GBZ9nXN.css +32 -0
- package/runtime/webapp/dist/assets/TerminalPane-Ds9JxVMt.js +39 -0
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-CB1fNkHO.js → abnfDiagram-VCTEODGH-2YNJ76WG.js} +1 -1
- package/runtime/webapp/dist/assets/arc-CcKuP0ye.js +1 -0
- package/runtime/webapp/dist/assets/architectureDiagram-5GKGNRK7-Bw49xhZn.js +36 -0
- package/runtime/webapp/dist/assets/artifact-links-OG5Ksgyd.js +7 -0
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-BdsljUN8.js → blockDiagram-I7D4REHJ-Dqm_qfY7.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-BNQhbN8R.js → c4Diagram-7LVT6UL2-CASULDQ9.js} +1 -1
- package/runtime/webapp/dist/assets/channel-xKavBx6z.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-CIB6uwBd.js → chunk-2Q5K7J3B-yEnUXBZC.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-DG-dAGBX.js → chunk-5VM5RSS4-Djs5IDQf.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-Cz4FYtWI.js → chunk-F27PBJKO-CdLh9ewF.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-Bk387_M1.js → chunk-IMKFNOWR-I-pRrlxR.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-D1buI7qd.js → chunk-JWPE2WC7-BD2Gv69T.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-l81_q9Km.js → chunk-POPQ4Y6H-BhuerIJs.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-2n3fQ3px.js → chunk-SVP7TREG-AWEtUvjM.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-NC_W5srW.js → chunk-TICWLB2K-BiO_dQcW.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-Bn5fCkOc.js → chunk-XXDRQBXY-zkjO5GCv.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-B6zj-gda.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-B6zj-gda.js +1 -0
- package/runtime/webapp/dist/assets/clipboard-CvdeFLww.js +6 -0
- package/runtime/webapp/dist/assets/{codeSyntax-D9B2mCsG.js → codeSyntax-ByG7L1fi.js} +3 -3
- package/runtime/webapp/dist/assets/collaboration-Be_9WEiY.js +11 -0
- package/runtime/webapp/dist/assets/{collaboration-C85istc_.css → collaboration-CXGccxVl.css} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-BczBbE9_.js → cose-bilkent-JH36ORCC-CAxuJw-v.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BtTRes43.js → cynefin-OW5HDTMX-hLWhgC57.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-DZPPcnLM.js → cynefinDiagram-5FMLGOSQ-uelhySIx.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-D4Q4z3Tp.js → dagre-GXQ25YYZ-DPO7KxIX.js} +2 -2
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-Dq_78DD9.js → diagram-S7CK7UJ4-B8jQa5Lm.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-Df0rXRcJ.js → diagram-UQ7AKVKN-DdymRFf0.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-Dm580wSN.js → diagram-VSXAHHWV-BHAv1Uzp.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-RE2fdUPo.js → diagram-VX7I27RA-DlRev6E7.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-DJaYB2on.js → diagram-Z3DM3KII-DspqqK0b.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-4yKff59X.js → ebnfDiagram-PWID7BFC-BwStWg-O.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-7Yc4S5JM.js → erDiagram-RLTQ6QDP-jUH66GeO.js} +1 -1
- package/runtime/webapp/dist/assets/file-types-Bbr1oDan.js +76 -0
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-ArlsM9r6.js → flowDiagram-HODETNUW-b2JhyYZh.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-Dvvo__aq.js → ganttDiagram-EL5Y4UJY-k6xQA8nM.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-DKj9atxo.js → gitGraphDiagram-WWUBYQGX-Cg8O3XcX.js} +1 -1
- package/runtime/webapp/dist/assets/index-CQepZy15.js +480 -0
- package/runtime/webapp/dist/assets/index-JtFzay7w.css +1 -0
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DA1CNgP1.js → infoDiagram-27XIBGKW-BEZuUiUV.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Bzz8x4Zy.js → ishikawaDiagram-5VMMS53U-D8cPBWA9.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-Y3BH_n1g.js → journeyDiagram-3NMN7TZE-BiCIZoXl.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DS1Ve58t.js → kanban-definition-UXKFOSKX-DBGsdTe3.js} +7 -7
- package/runtime/webapp/dist/assets/{layout-CfOWc3sQ.js → layout-CESwBcoQ.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-DkUd48rz.js → linear-meicA11o.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-dsSVZMYq.js → loader-circle-gCGomGeo.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-CddJhkVB.js → mermaid.core-BsSrKkY-.js} +6 -6
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-DXx99HkU.js → mindmap-definition-YA3MSWOX-Ci76EHnj.js} +2 -2
- package/runtime/webapp/dist/assets/page-CaBcebHM.js +96 -0
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BwMLZ0tL.js → pegDiagram-XKGWAZYB-BJ9fzsRy.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-C8gUFc23.js → pieDiagram-E7YTZNPT-Dr_g_s7V.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-C-PtyMFL.js → quadrantDiagram-AXDQQJYC-DRUIkYzL.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-nslThfxz.js → railroadDiagram-O6MQD6OU-z_f3jTzL.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-if0DUYf7.js → requirementDiagram-BXWQKSXE-BZ9192zw.js} +1 -1
- package/runtime/webapp/dist/assets/rotate-ccw-CU6Ofovh.js +6 -0
- package/runtime/webapp/dist/assets/rotate-cw-CI-k2c-H.js +6 -0
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-CPb4_ZHM.js → sankeyDiagram-P5KCCOFB-D_bYtKCw.js} +1 -1
- package/runtime/webapp/dist/assets/send-B_L3JVTV.js +6 -0
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-Dn-9ZqfF.js → sequenceDiagram-WJ2MYXX4-BRPkyVwo.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-CjHPSk27.js → sizeCapture-INFHLROL-D0IXlEUO.js} +1 -1
- package/runtime/webapp/dist/assets/smartphone-BaM-cilR.js +31 -0
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-BL3baCEN.js → stateDiagram-D77RDMKH-DOPcJmKu.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-CosKh0dU.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-BN09MBkx.js → swimlanes-42K2YHIH-DkWPxpZR.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-eLjpgpHz.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-CgKAJKgu.js → timeline-definition-24CTP7MA-DSSrwQZc.js} +3 -3
- package/runtime/webapp/dist/assets/trash-2-CCZMuVfC.js +21 -0
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-DeEP3v2F.js → vennDiagram-4TSXK5OY-QRwqQ2e4.js} +5 -5
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-rTyuh5Av.js → wardleyDiagram-VM6X3IG4-BOSS_TSY.js} +1 -1
- package/runtime/webapp/dist/assets/{web-DG60RxuA.js → web-DX0wjWUS.js} +1 -1
- package/runtime/webapp/dist/assets/{web-Cei097ms.js → web-ebzGWnSw.js} +1 -1
- package/runtime/webapp/dist/assets/{chevron-down-CysQ4M-3.js → x-CbdLQm7m.js} +2 -2
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CjF5xx6A.js → xychartDiagram-S5SC5T6Z-D9Rp3n6B.js} +1 -1
- package/runtime/webapp/dist/index.html +2 -2
- package/runtime/ws-server.mjs +7 -3
- package/runtime/.next/static/chunks/326.567dcaf52a3fbf80.js +0 -1
- package/runtime/.next/static/chunks/app/web/error-c66f2c3664e334c6.js +0 -1
- package/runtime/.next/static/chunks/app/web/page-3c2c3c087cadf41d.js +0 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-3fs8zete.mjs +0 -35
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-5kpyasem.mjs +0 -52
- package/runtime/webapp/dist/assets/App-w6e9nZ-Q.js +0 -266
- package/runtime/webapp/dist/assets/BrowserLivePanel-DEuXJ4vq.js +0 -91
- package/runtime/webapp/dist/assets/CollaborationDashboard-CijhO-vK.js +0 -111
- package/runtime/webapp/dist/assets/CollaborationPage-Bg8j3u9c.js +0 -31
- package/runtime/webapp/dist/assets/RemoteDesktopPage-Cq9ApzsP.js +0 -1
- package/runtime/webapp/dist/assets/arc-DZuN4ixE.js +0 -1
- package/runtime/webapp/dist/assets/architectureDiagram-5GKGNRK7-Csigcp2o.js +0 -36
- package/runtime/webapp/dist/assets/channel-DwbF84Ym.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-DgDtTQpP.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-DgDtTQpP.js +0 -1
- package/runtime/webapp/dist/assets/collaboration-D6LevPPr.js +0 -16
- package/runtime/webapp/dist/assets/index-CbdPFz5M.css +0 -1
- package/runtime/webapp/dist/assets/index-FmZ6gYce.js +0 -90
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DOnqeVU9.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-TqEoufoH.js +0 -8
- package/runtime/webapp/dist/assets/x-Brs7xU6O.js +0 -26
- /package/runtime/.next/static/{i1_xTY2YavI2psYlT44Ps → lQstNMvvKpEl9ExIG_tUW}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{i1_xTY2YavI2psYlT44Ps → lQstNMvvKpEl9ExIG_tUW}/_ssgManifest.js +0 -0
- /package/runtime/native/{AgentRoam Remote Desktop.app → Support.noindex/AgentRoam Remote Desktop.app}/Contents/Info.plist +0 -0
- /package/runtime/native/{AgentRoam Remote Desktop.app → Support.noindex/AgentRoam Remote Desktop.app}/Contents/Resources/app-icon.icns +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=3760,e.ids=[3760],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=3760,e.ids=[3760],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},9430:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>q,requestAsyncStorage:()=>l,routeModule:()=>c,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var o={};t.r(o),t.d(o,{GET:()=>p,POST:()=>d});var s=t(7786),n=t(5042),i=t(2184),a=t(1890);let u=(0,t(4621).i)().memory;async function p(e){let r=new URL(e.url).searchParams.get("q");if(r){let e=await u.search(r);return a.NextResponse.json(e)}let t=await u.list();return a.NextResponse.json(t)}async function d(e){try{let r=await e.json();if(!r.name||!r.content)return a.NextResponse.json({error:"name and content are required"},{status:400});return await u.set(r),a.NextResponse.json({status:"saved"},{status:201})}catch(e){return a.NextResponse.json({error:e instanceof Error?e.message:"Save failed"},{status:500})}}let c=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/memory/route",pathname:"/api/memory",filename:"route",bundlePath:"app/api/memory/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/memory/route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:x}=c,v="/api/memory/route";function q(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}},785:(e,r,t)=>{t.d(r,{ME:()=>a,kO:()=>i,sr:()=>u});var o=t(9411);let s=function(){let e=process.argv[1];if(e){let r=(0,o.dirname)((0,o.resolve)(e)),t=`${o.sep}node_modules${o.sep}.bin`;return r.endsWith(t)?(0,o.resolve)(r,"..",".."):r}return(0,o.resolve)(process.cwd())}();function n(e=process.env,r=s){return(0,o.resolve)(e.AGENT_DATA_DIR?.trim()||r)}function i(){return n()}function a(e=process.env,r=n(e)){let t=e.AGENT_LOG_DIR?.trim();if(t)return(0,o.resolve)(t);let s=e.AGENTROAM_DATA_DIR?.trim();return s?(0,o.resolve)(s,"logs"):(0,o.join)(r,".agent-data","logs")}function u(){return function(e=process.env,r=s){return(0,o.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||r)}(process.env,i())}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[8375,6703,1322,4621],()=>t(9430));module.exports=o})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=2538,e.ids=[2538],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=2538,e.ids=[2538],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},5881:e=>{e.exports=require("node:util")},4494:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>q,requestAsyncStorage:()=>h,routeModule:()=>c,serverHooks:()=>x,staticGenerationAsyncStorage:()=>g});var s={};t.r(s),t.d(s,{POST:()=>l});var o=t(7786),i=t(5042),n=t(2184),a=t(1890),u=t(1322),p=t(7519);let d=new u.Q$d(p.agentHost.getBuilder().getToolRegistry(),p.agentHost.getBuilder().getSkillRegistry(),process.cwd());async function l(e){try{let r=await e.json();if(!r.dirPath)return a.NextResponse.json({error:"dirPath is required"},{status:400});let t=await d.loadPlugin(r.dirPath);return await d.activatePlugin(t.manifest.name),a.NextResponse.json({status:"loaded",plugin:{name:t.manifest.name,version:t.manifest.version,description:t.manifest.description}})}catch(e){return a.NextResponse.json({error:e instanceof Error?e.message:"Plugin load failed"},{status:500})}}let c=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/plugins/load/route",pathname:"/api/plugins/load",filename:"route",bundlePath:"app/api/plugins/load/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/plugins/load/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:h,staticGenerationAsyncStorage:g,serverHooks:x}=c,m="/api/plugins/load/route";function q(){return(0,n.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:g})}},1489:(e,r,t)=>{t.d(r,{N:()=>u});var s=t(1322),o=t(6279),i=t(785);class n{constructor(){this.tasks=new s.vo4((0,i.kO)()),this.scheduler=new o.ST(this.tasks,e=>{this.fire(e).catch(e=>console.error("Scheduled Customer Agent run failed",e))},()=>{}),this.scheduler.start()}async fire(e){let{agentHost:r}=await t.e(7519).then(t.bind(t,7519)),{getCustomerGoalCoordinator:s}=await Promise.all([t.e(7519),t.e(732)]).then(t.bind(t,732)),o=e.sessionId;o&&await r.getSessionStore().get(o)||(o=(await r.createSession(e.label||"定时任务")).id,this.tasks.update(e.id,{sessionId:o})),await s().enqueue(o,e.prompt)}call(e,r){let t=String(r[0]||"");switch(e){case"cronList":return this.tasks.list();case"cronCreate":{if("string"!=typeof r[0]||"string"!=typeof r[1]||!r[1].trim())throw Error("cron and prompt required");let e=r[2]&&"object"==typeof r[2]?r[2]:{};return this.tasks.create({cron:r[0],prompt:r[1],recurring:!1!==e.recurring,enabled:!0,durable:!0,..."string"==typeof e.sessionId?{sessionId:e.sessionId}:{},..."string"==typeof e.label?{label:e.label}:{}})}case"cronPause":return this.tasks.pause(t);case"cronResume":return this.tasks.resume(t);case"cronDelete":return this.tasks.delete(t);case"cronDeleteAll":return this.tasks.deleteAll(),{ok:!0};default:throw Error("Unsupported schedule operation")}}}let a=globalThis;function u(){return a.__sharedCronService??=new n}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8375,6703,6244,1322,1773,4621,7519],()=>t(4494));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=7361,e.ids=[7361],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=7361,e.ids=[7361],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},858:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>y,patchFetch:()=>f,requestAsyncStorage:()=>h,routeModule:()=>l,serverHooks:()=>v,staticGenerationAsyncStorage:()=>m});var s={};r.r(s),r.d(s,{DELETE:()=>d,GET:()=>u,PATCH:()=>p});var o=r(7786),n=r(5042),i=r(2184),a=r(1890),c=r(9142);async function u(e,{params:t}){try{return a.NextResponse.json(await c.a.get(t.id))}catch(t){let e=(0,c.r)(t);return a.NextResponse.json(e.body,{status:e.status})}}async function p(e,{params:t}){try{let r=await e.json();return a.NextResponse.json(await c.a.rename(t.id,r.name??""))}catch(t){let e=(0,c.r)(t);return a.NextResponse.json(e.body,{status:e.status})}}async function d(e,{params:t}){try{return await c.a.delete(t.id),a.NextResponse.json({deleted:!0,projectId:t.id})}catch(t){let e=(0,c.r)(t);return a.NextResponse.json(e.body,{status:e.status})}}let l=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/projects/[id]/route",pathname:"/api/projects/[id]",filename:"route",bundlePath:"app/api/projects/[id]/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/projects/[id]/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:h,staticGenerationAsyncStorage:m,serverHooks:v}=l,y="/api/projects/[id]/route";function f(){return(0,i.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:m})}},9142:(e,t,r)=>{r.d(t,{r:()=>l,a:()=>d});var s=r(612),o=r(1322),n=r(785),i=r(7561),a=r(9411),c=r(6005);class u extends Error{constructor(e,t,r){super(e),this.code=t,this.status=r,this.name="WebProjectError"}}class p{constructor(e,t,r=t.roots[0]){this.store=e,this.paths=t,this.installationDirectory=r}list(){return this.store.list()}async get(e){let t=await this.store.get(e);if(!t)throw new u("项目不存在","PROJECT_NOT_FOUND",404);return t}async create(e,t){let r=this.paths.assertDirectory(e);for(let e of(await this.store.list()))if(!e.id.startsWith("collaboration-"))try{if(this.paths.assertDirectory(e.description)===r)return e}catch{}let s=new Date().toISOString();return this.store.create({id:(0,c.randomUUID)(),name:t?.trim()||(0,a.basename)(r)||r,description:r,created:s,updated:s})}async rename(e,t){await this.get(e);let r=t.trim();if(!r)throw new u("项目名称不能为空","PROJECT_NAME_REQUIRED",400);return this.store.update(e,{name:r})}async delete(e){await this.get(e),await this.store.delete(e)}roots(){return this.paths.roots}pickerLocation(){return{roots:this.paths.roots,initialPath:this.paths.assertDirectory(this.installationDirectory)}}directories(e){return this.paths.listDirectories(e)}check(e){try{return this.paths.assertDirectory(e),!0}catch{return!1}}canonicalDirectory(e){return this.paths.assertDirectory(e)}}let d=new p(new o.XWE((0,n.kO)()),o.Tpv.fromEnvironment(process.env.AGENT_WEB_ROOTS,(0,s.homedir)()),function(e,t=process.env,r=(0,s.homedir)()){let o=t.AGENTROAM_DATA_DIR?.trim();if(o)return(0,a.resolve)(o);let n=(0,a.join)(r,".agentroam");try{if((0,i.statSync)(n).isDirectory())return n}catch{}return(0,a.resolve)(e)}((0,n.kO)()));function l(e){return e instanceof u?{status:e.status,body:{error:e.message,code:e.code}}:e instanceof o.TLe?{status:400,body:{error:e.message,code:e.code}}:{status:500,body:{error:e instanceof Error?e.message:"项目操作失败",code:"PROJECT_OPERATION_FAILED"}}}},785:(e,t,r)=>{r.d(t,{ME:()=>a,kO:()=>i,sr:()=>c});var s=r(9411);let o=function(){let e=process.argv[1];if(e){let t=(0,s.dirname)((0,s.resolve)(e)),r=`${s.sep}node_modules${s.sep}.bin`;return t.endsWith(r)?(0,s.resolve)(t,"..",".."):t}return(0,s.resolve)(process.cwd())}();function n(e=process.env,t=o){return(0,s.resolve)(e.AGENT_DATA_DIR?.trim()||t)}function i(){return n()}function a(e=process.env,t=n(e)){let r=e.AGENT_LOG_DIR?.trim();if(r)return(0,s.resolve)(r);let o=e.AGENTROAM_DATA_DIR?.trim();return o?(0,s.resolve)(o,"logs"):(0,s.join)(t,".agent-data","logs")}function c(){return function(e=process.env,t=o){return(0,s.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||t)}(process.env,i())}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8375,6703,1322],()=>r(858));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=6315,e.ids=[6315],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=6315,e.ids=[6315],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},4173:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>v,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>l,staticGenerationAsyncStorage:()=>h});var s={};t.r(s),t.d(s,{GET:()=>u});var o=t(7786),i=t(5042),n=t(2184),a=t(1890),c=t(9142);async function u(e){let r=new URL(e.url).searchParams.get("path")??"";return a.NextResponse.json({valid:c.a.check(r)},{headers:{"Cache-Control":"no-store"}})}let p=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/projects/check/route",pathname:"/api/projects/check",filename:"route",bundlePath:"app/api/projects/check/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/projects/check/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:h,serverHooks:l}=p,m="/api/projects/check/route";function v(){return(0,n.patchFetch)({serverHooks:l,staticGenerationAsyncStorage:h})}},9142:(e,r,t)=>{t.d(r,{r:()=>h,a:()=>d});var s=t(612),o=t(1322),i=t(785),n=t(7561),a=t(9411),c=t(6005);class u extends Error{constructor(e,r,t){super(e),this.code=r,this.status=t,this.name="WebProjectError"}}class p{constructor(e,r,t=r.roots[0]){this.store=e,this.paths=r,this.installationDirectory=t}list(){return this.store.list()}async get(e){let r=await this.store.get(e);if(!r)throw new u("项目不存在","PROJECT_NOT_FOUND",404);return r}async create(e,r){let t=this.paths.assertDirectory(e);for(let e of(await this.store.list()))if(!e.id.startsWith("collaboration-"))try{if(this.paths.assertDirectory(e.description)===t)return e}catch{}let s=new Date().toISOString();return this.store.create({id:(0,c.randomUUID)(),name:r?.trim()||(0,a.basename)(t)||t,description:t,created:s,updated:s})}async rename(e,r){await this.get(e);let t=r.trim();if(!t)throw new u("项目名称不能为空","PROJECT_NAME_REQUIRED",400);return this.store.update(e,{name:t})}async delete(e){await this.get(e),await this.store.delete(e)}roots(){return this.paths.roots}pickerLocation(){return{roots:this.paths.roots,initialPath:this.paths.assertDirectory(this.installationDirectory)}}directories(e){return this.paths.listDirectories(e)}check(e){try{return this.paths.assertDirectory(e),!0}catch{return!1}}canonicalDirectory(e){return this.paths.assertDirectory(e)}}let d=new p(new o.XWE((0,i.kO)()),o.Tpv.fromEnvironment(process.env.AGENT_WEB_ROOTS,(0,s.homedir)()),function(e,r=process.env,t=(0,s.homedir)()){let o=r.AGENTROAM_DATA_DIR?.trim();if(o)return(0,a.resolve)(o);let i=(0,a.join)(t,".agentroam");try{if((0,n.statSync)(i).isDirectory())return i}catch{}return(0,a.resolve)(e)}((0,i.kO)()));function h(e){return e instanceof u?{status:e.status,body:{error:e.message,code:e.code}}:e instanceof o.TLe?{status:400,body:{error:e.message,code:e.code}}:{status:500,body:{error:e instanceof Error?e.message:"项目操作失败",code:"PROJECT_OPERATION_FAILED"}}}},785:(e,r,t)=>{t.d(r,{ME:()=>a,kO:()=>n,sr:()=>c});var s=t(9411);let o=function(){let e=process.argv[1];if(e){let r=(0,s.dirname)((0,s.resolve)(e)),t=`${s.sep}node_modules${s.sep}.bin`;return r.endsWith(t)?(0,s.resolve)(r,"..",".."):r}return(0,s.resolve)(process.cwd())}();function i(e=process.env,r=o){return(0,s.resolve)(e.AGENT_DATA_DIR?.trim()||r)}function n(){return i()}function a(e=process.env,r=i(e)){let t=e.AGENT_LOG_DIR?.trim();if(t)return(0,s.resolve)(t);let o=e.AGENTROAM_DATA_DIR?.trim();return o?(0,s.resolve)(o,"logs"):(0,s.join)(r,".agent-data","logs")}function c(){return function(e=process.env,r=o){return(0,s.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||r)}(process.env,n())}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8375,6703,1322],()=>t(4173));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=4737,e.ids=[4737],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=4737,e.ids=[4737],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},5267:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>v,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>h,staticGenerationAsyncStorage:()=>l});var s={};t.r(s),t.d(s,{GET:()=>u});var o=t(7786),i=t(5042),n=t(2184),a=t(1890),c=t(9142);async function u(e){try{let r=new URL(e.url).searchParams.get("path")??"";return a.NextResponse.json(c.a.directories(r))}catch(r){let e=(0,c.r)(r);return a.NextResponse.json(e.body,{status:e.status})}}let p=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/projects/directories/route",pathname:"/api/projects/directories",filename:"route",bundlePath:"app/api/projects/directories/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/projects/directories/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:l,serverHooks:h}=p,m="/api/projects/directories/route";function v(){return(0,n.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:l})}},9142:(e,r,t)=>{t.d(r,{r:()=>l,a:()=>d});var s=t(612),o=t(1322),i=t(785),n=t(7561),a=t(9411),c=t(6005);class u extends Error{constructor(e,r,t){super(e),this.code=r,this.status=t,this.name="WebProjectError"}}class p{constructor(e,r,t=r.roots[0]){this.store=e,this.paths=r,this.installationDirectory=t}list(){return this.store.list()}async get(e){let r=await this.store.get(e);if(!r)throw new u("项目不存在","PROJECT_NOT_FOUND",404);return r}async create(e,r){let t=this.paths.assertDirectory(e);for(let e of(await this.store.list()))if(!e.id.startsWith("collaboration-"))try{if(this.paths.assertDirectory(e.description)===t)return e}catch{}let s=new Date().toISOString();return this.store.create({id:(0,c.randomUUID)(),name:r?.trim()||(0,a.basename)(t)||t,description:t,created:s,updated:s})}async rename(e,r){await this.get(e);let t=r.trim();if(!t)throw new u("项目名称不能为空","PROJECT_NAME_REQUIRED",400);return this.store.update(e,{name:t})}async delete(e){await this.get(e),await this.store.delete(e)}roots(){return this.paths.roots}pickerLocation(){return{roots:this.paths.roots,initialPath:this.paths.assertDirectory(this.installationDirectory)}}directories(e){return this.paths.listDirectories(e)}check(e){try{return this.paths.assertDirectory(e),!0}catch{return!1}}canonicalDirectory(e){return this.paths.assertDirectory(e)}}let d=new p(new o.XWE((0,i.kO)()),o.Tpv.fromEnvironment(process.env.AGENT_WEB_ROOTS,(0,s.homedir)()),function(e,r=process.env,t=(0,s.homedir)()){let o=r.AGENTROAM_DATA_DIR?.trim();if(o)return(0,a.resolve)(o);let i=(0,a.join)(t,".agentroam");try{if((0,n.statSync)(i).isDirectory())return i}catch{}return(0,a.resolve)(e)}((0,i.kO)()));function l(e){return e instanceof u?{status:e.status,body:{error:e.message,code:e.code}}:e instanceof o.TLe?{status:400,body:{error:e.message,code:e.code}}:{status:500,body:{error:e instanceof Error?e.message:"项目操作失败",code:"PROJECT_OPERATION_FAILED"}}}},785:(e,r,t)=>{t.d(r,{ME:()=>a,kO:()=>n,sr:()=>c});var s=t(9411);let o=function(){let e=process.argv[1];if(e){let r=(0,s.dirname)((0,s.resolve)(e)),t=`${s.sep}node_modules${s.sep}.bin`;return r.endsWith(t)?(0,s.resolve)(r,"..",".."):r}return(0,s.resolve)(process.cwd())}();function i(e=process.env,r=o){return(0,s.resolve)(e.AGENT_DATA_DIR?.trim()||r)}function n(){return i()}function a(e=process.env,r=i(e)){let t=e.AGENT_LOG_DIR?.trim();if(t)return(0,s.resolve)(t);let o=e.AGENTROAM_DATA_DIR?.trim();return o?(0,s.resolve)(o,"logs"):(0,s.join)(r,".agent-data","logs")}function c(){return function(e=process.env,r=o){return(0,s.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||r)}(process.env,n())}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8375,6703,1322],()=>t(5267));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=1199,e.ids=[1199],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=1199,e.ids=[1199],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},6910:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>v,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>h,staticGenerationAsyncStorage:()=>l});var s={};t.r(s),t.d(s,{GET:()=>u});var o=t(7786),i=t(5042),n=t(2184),a=t(1890),c=t(9142);async function u(e){try{return a.NextResponse.json(new URL(e.url).searchParams.has("picker")?c.a.pickerLocation():c.a.roots(),{headers:{"Cache-Control":"no-store"}})}catch(r){let e=(0,c.r)(r);return a.NextResponse.json(e.body,{status:e.status})}}let p=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/projects/roots/route",pathname:"/api/projects/roots",filename:"route",bundlePath:"app/api/projects/roots/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/projects/roots/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:l,serverHooks:h}=p,m="/api/projects/roots/route";function v(){return(0,n.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:l})}},9142:(e,r,t)=>{t.d(r,{r:()=>l,a:()=>d});var s=t(612),o=t(1322),i=t(785),n=t(7561),a=t(9411),c=t(6005);class u extends Error{constructor(e,r,t){super(e),this.code=r,this.status=t,this.name="WebProjectError"}}class p{constructor(e,r,t=r.roots[0]){this.store=e,this.paths=r,this.installationDirectory=t}list(){return this.store.list()}async get(e){let r=await this.store.get(e);if(!r)throw new u("项目不存在","PROJECT_NOT_FOUND",404);return r}async create(e,r){let t=this.paths.assertDirectory(e);for(let e of(await this.store.list()))if(!e.id.startsWith("collaboration-"))try{if(this.paths.assertDirectory(e.description)===t)return e}catch{}let s=new Date().toISOString();return this.store.create({id:(0,c.randomUUID)(),name:r?.trim()||(0,a.basename)(t)||t,description:t,created:s,updated:s})}async rename(e,r){await this.get(e);let t=r.trim();if(!t)throw new u("项目名称不能为空","PROJECT_NAME_REQUIRED",400);return this.store.update(e,{name:t})}async delete(e){await this.get(e),await this.store.delete(e)}roots(){return this.paths.roots}pickerLocation(){return{roots:this.paths.roots,initialPath:this.paths.assertDirectory(this.installationDirectory)}}directories(e){return this.paths.listDirectories(e)}check(e){try{return this.paths.assertDirectory(e),!0}catch{return!1}}canonicalDirectory(e){return this.paths.assertDirectory(e)}}let d=new p(new o.XWE((0,i.kO)()),o.Tpv.fromEnvironment(process.env.AGENT_WEB_ROOTS,(0,s.homedir)()),function(e,r=process.env,t=(0,s.homedir)()){let o=r.AGENTROAM_DATA_DIR?.trim();if(o)return(0,a.resolve)(o);let i=(0,a.join)(t,".agentroam");try{if((0,n.statSync)(i).isDirectory())return i}catch{}return(0,a.resolve)(e)}((0,i.kO)()));function l(e){return e instanceof u?{status:e.status,body:{error:e.message,code:e.code}}:e instanceof o.TLe?{status:400,body:{error:e.message,code:e.code}}:{status:500,body:{error:e instanceof Error?e.message:"项目操作失败",code:"PROJECT_OPERATION_FAILED"}}}},785:(e,r,t)=>{t.d(r,{ME:()=>a,kO:()=>n,sr:()=>c});var s=t(9411);let o=function(){let e=process.argv[1];if(e){let r=(0,s.dirname)((0,s.resolve)(e)),t=`${s.sep}node_modules${s.sep}.bin`;return r.endsWith(t)?(0,s.resolve)(r,"..",".."):r}return(0,s.resolve)(process.cwd())}();function i(e=process.env,r=o){return(0,s.resolve)(e.AGENT_DATA_DIR?.trim()||r)}function n(){return i()}function a(e=process.env,r=i(e)){let t=e.AGENT_LOG_DIR?.trim();if(t)return(0,s.resolve)(t);let o=e.AGENTROAM_DATA_DIR?.trim();return o?(0,s.resolve)(o,"logs"):(0,s.join)(r,".agent-data","logs")}function c(){return function(e=process.env,r=o){return(0,s.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||r)}(process.env,n())}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8375,6703,1322],()=>t(6910));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=4871,e.ids=[4871],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=4871,e.ids=[4871],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9801:e=>{e.exports=require("os")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},1041:e=>{e.exports=require("node:url")},6038:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>f,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>m,staticGenerationAsyncStorage:()=>h});var s={};r.r(s),r.d(s,{GET:()=>u,POST:()=>p});var o=r(7786),i=r(5042),n=r(2184),a=r(1890),c=r(9142);async function u(){return a.NextResponse.json((await c.a.list()).filter(e=>!e.id.startsWith("collaboration-")))}async function p(e){try{let t=await e.json();return a.NextResponse.json(await c.a.create(t.path??"",t.name),{status:201})}catch(t){let e=(0,c.r)(t);return a.NextResponse.json(e.body,{status:e.status})}}let d=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/projects/route",pathname:"/api/projects",filename:"route",bundlePath:"app/api/projects/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/projects/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:h,serverHooks:m}=d,v="/api/projects/route";function f(){return(0,n.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:h})}},9142:(e,t,r)=>{r.d(t,{r:()=>l,a:()=>d});var s=r(612),o=r(1322),i=r(785),n=r(7561),a=r(9411),c=r(6005);class u extends Error{constructor(e,t,r){super(e),this.code=t,this.status=r,this.name="WebProjectError"}}class p{constructor(e,t,r=t.roots[0]){this.store=e,this.paths=t,this.installationDirectory=r}list(){return this.store.list()}async get(e){let t=await this.store.get(e);if(!t)throw new u("项目不存在","PROJECT_NOT_FOUND",404);return t}async create(e,t){let r=this.paths.assertDirectory(e);for(let e of(await this.store.list()))if(!e.id.startsWith("collaboration-"))try{if(this.paths.assertDirectory(e.description)===r)return e}catch{}let s=new Date().toISOString();return this.store.create({id:(0,c.randomUUID)(),name:t?.trim()||(0,a.basename)(r)||r,description:r,created:s,updated:s})}async rename(e,t){await this.get(e);let r=t.trim();if(!r)throw new u("项目名称不能为空","PROJECT_NAME_REQUIRED",400);return this.store.update(e,{name:r})}async delete(e){await this.get(e),await this.store.delete(e)}roots(){return this.paths.roots}pickerLocation(){return{roots:this.paths.roots,initialPath:this.paths.assertDirectory(this.installationDirectory)}}directories(e){return this.paths.listDirectories(e)}check(e){try{return this.paths.assertDirectory(e),!0}catch{return!1}}canonicalDirectory(e){return this.paths.assertDirectory(e)}}let d=new p(new o.XWE((0,i.kO)()),o.Tpv.fromEnvironment(process.env.AGENT_WEB_ROOTS,(0,s.homedir)()),function(e,t=process.env,r=(0,s.homedir)()){let o=t.AGENTROAM_DATA_DIR?.trim();if(o)return(0,a.resolve)(o);let i=(0,a.join)(r,".agentroam");try{if((0,n.statSync)(i).isDirectory())return i}catch{}return(0,a.resolve)(e)}((0,i.kO)()));function l(e){return e instanceof u?{status:e.status,body:{error:e.message,code:e.code}}:e instanceof o.TLe?{status:400,body:{error:e.message,code:e.code}}:{status:500,body:{error:e instanceof Error?e.message:"项目操作失败",code:"PROJECT_OPERATION_FAILED"}}}},785:(e,t,r)=>{r.d(t,{ME:()=>a,kO:()=>n,sr:()=>c});var s=r(9411);let o=function(){let e=process.argv[1];if(e){let t=(0,s.dirname)((0,s.resolve)(e)),r=`${s.sep}node_modules${s.sep}.bin`;return t.endsWith(r)?(0,s.resolve)(t,"..",".."):t}return(0,s.resolve)(process.cwd())}();function i(e=process.env,t=o){return(0,s.resolve)(e.AGENT_DATA_DIR?.trim()||t)}function n(){return i()}function a(e=process.env,t=i(e)){let r=e.AGENT_LOG_DIR?.trim();if(r)return(0,s.resolve)(r);let o=e.AGENTROAM_DATA_DIR?.trim();return o?(0,s.resolve)(o,"logs"):(0,s.join)(t,".agent-data","logs")}function c(){return function(e=process.env,t=o){return(0,s.resolve)(e.AGENT_WORKING_DIRECTORY?.trim()||t)}(process.env,n())}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8375,6703,1322],()=>r(6038));module.exports=s})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=3611,e.ids=[3611],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=3611,e.ids=[3611],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},5881:e=>{e.exports=require("node:util")},1967:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>b,patchFetch:()=>f,requestAsyncStorage:()=>c,routeModule:()=>l,serverHooks:()=>y,staticGenerationAsyncStorage:()=>h});var s={};r.r(s),r.d(s,{POST:()=>d});var i=r(7786),n=r(5042),o=r(2184),a=r(1890),p=r(3931),u=r(1079);async function d(e){try{(0,u.j)();let t=await e.json(),r=e.headers.get("x-agentroam-device-id"),s=(0,p.i)().saveSubscription(r,{endpoint:t?.endpoint,keys:{p256dh:t?.keys?.p256dh,auth:t?.keys?.auth}});return a.NextResponse.json(s)}catch(t){let e=t?.status;return a.NextResponse.json({error:t instanceof Error?t.message:"Unable to save push subscription"},{status:e&&e>=400&&e<500?e:500})}}let l=new i.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/push/subscribe/route",pathname:"/api/push/subscribe",filename:"route",bundlePath:"app/api/push/subscribe/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/push/subscribe/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:c,staticGenerationAsyncStorage:h,serverHooks:y}=l,b="/api/push/subscribe/route";function f(){return(0,o.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:h})}},1079:(e,t,r)=>{r.d(t,{j:()=>d});var s=r(7519),i=r(3931),n=r(535),o=r(1322),a=r(1982);let p=!1,u=new o.sSf;function d(){p||(p=!0,s.agentHost.setGlobalEventObserver((e,t,r)=>{try{if("ask_user"===t.type){(0,i.i)().notifySession({notificationId:`${e}:${t.questionId}:approval`,sessionId:e,kind:"approval",title:"需要你的审批",body:"string"==typeof t.question&&t.question.trim()?t.question.trim().slice(0,160):"会话正在等待确认",url:"/app/"});return}if("done"===t.type){if("goal"===r.source)return;let s=(0,o.mDL)((0,a.dp)().read().taskNotifications),n=r.runId?(0,o.DXW)({sessionId:e,runId:r.runId,title:"任务已完成",finalText:t.finalText,outcome:"completed",source:"user"},s):null;n&&u.accept(n.notificationId)&&(0,i.i)().notifySession({...n,url:`/app/?session=${encodeURIComponent(e)}`});return}if("goal_updated"===t.type&&"complete"===t.goal.status){let r=(0,o.mDL)((0,a.dp)().read().taskNotifications),s=(0,o.DXW)({sessionId:e,runId:`goal:${t.goal.createdAt}`,title:"目标已完成",finalText:t.goal.objective,outcome:"completed",source:"goal",goalFinished:!0},r);s&&u.accept(s.notificationId)&&(0,i.i)().notifySession({...s,url:`/app/?session=${encodeURIComponent(e)}`});return}"error"===t.type&&(0,i.i)().notifySession({notificationId:`${e}:${r.runId??"unknown"}:error`,sessionId:e,kind:"error",title:"会话出错",body:"string"==typeof t.message&&t.message.trim()?t.message.trim().slice(0,160):"运行失败",url:"/app/"})}catch(t){(0,n.L)().warn("web push notify failed",{sessionId:e,error:t instanceof Error?t.message:String(t)})}}))}},1489:(e,t,r)=>{r.d(t,{N:()=>p});var s=r(1322),i=r(6279),n=r(785);class o{constructor(){this.tasks=new s.vo4((0,n.kO)()),this.scheduler=new i.ST(this.tasks,e=>{this.fire(e).catch(e=>console.error("Scheduled Customer Agent run failed",e))},()=>{}),this.scheduler.start()}async fire(e){let{agentHost:t}=await r.e(7519).then(r.bind(r,7519)),{getCustomerGoalCoordinator:s}=await Promise.all([r.e(7519),r.e(732)]).then(r.bind(r,732)),i=e.sessionId;i&&await t.getSessionStore().get(i)||(i=(await t.createSession(e.label||"定时任务")).id,this.tasks.update(e.id,{sessionId:i})),await s().enqueue(i,e.prompt)}call(e,t){let r=String(t[0]||"");switch(e){case"cronList":return this.tasks.list();case"cronCreate":{if("string"!=typeof t[0]||"string"!=typeof t[1]||!t[1].trim())throw Error("cron and prompt required");let e=t[2]&&"object"==typeof t[2]?t[2]:{};return this.tasks.create({cron:t[0],prompt:t[1],recurring:!1!==e.recurring,enabled:!0,durable:!0,..."string"==typeof e.sessionId?{sessionId:e.sessionId}:{},..."string"==typeof e.label?{label:e.label}:{}})}case"cronPause":return this.tasks.pause(r);case"cronResume":return this.tasks.resume(r);case"cronDelete":return this.tasks.delete(r);case"cronDeleteAll":return this.tasks.deleteAll(),{ok:!0};default:throw Error("Unsupported schedule operation")}}}let a=globalThis;function p(){return a.__sharedCronService??=new o}},3931:(e,t,r)=>{r.d(t,{i:()=>c});var s=r(6005),i=r(7561),n=r(9411),o=r(5890);let a=require("web-push"),p=e=>JSON.stringify(e??null);class u{constructor(e,t=Date.now){this.now=t;let r=(0,n.resolve)(e,".agentroam-auth");(0,i.mkdirSync)(r,{recursive:!0,mode:448});let s=(0,n.join)(r,"push.sqlite");this.db=new o(s),(0,i.chmodSync)(s,384),this.db.pragma("busy_timeout = 5000"),this.db.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS push_keys (id INTEGER PRIMARY KEY CHECK(id=1), public_key TEXT NOT NULL, private_key TEXT NOT NULL);
|
|
3
3
|
CREATE TABLE IF NOT EXISTS push_subscriptions (
|
|
4
4
|
endpoint_hash TEXT PRIMARY KEY,
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
INSERT INTO push_subscriptions (endpoint_hash, endpoint, p256dh, auth, device_id, created)
|
|
13
13
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
14
14
|
ON CONFLICT(endpoint_hash) DO UPDATE SET p256dh=excluded.p256dh, auth=excluded.auth, device_id=excluded.device_id
|
|
15
|
-
`).run(d(r),r,s,i,"string"==typeof e?e:null,this.now()),{ok:!0}}deleteSubscription(e){if("string"!=typeof e||!e)throw Object.assign(Error("Endpoint required"),{status:400});return this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e)),{ok:!0}}listSubscriptions(){return this.db.prepare("SELECT endpoint, p256dh, auth, device_id FROM push_subscriptions").all().map(e=>({endpoint:e.endpoint,keys:{p256dh:e.p256dh,auth:e.auth},deviceId:e.device_id}))}notifySession({notificationId:e,sessionId:t,title:r,body:s,url:i}){let
|
|
15
|
+
`).run(d(r),r,s,i,"string"==typeof e?e:null,this.now()),{ok:!0}}deleteSubscription(e){if("string"!=typeof e||!e)throw Object.assign(Error("Endpoint required"),{status:400});return this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e)),{ok:!0}}listSubscriptions(){return this.db.prepare("SELECT endpoint, p256dh, auth, device_id FROM push_subscriptions").all().map(e=>({endpoint:e.endpoint,keys:{p256dh:e.p256dh,auth:e.auth},deviceId:e.device_id}))}notifySession({notificationId:e,sessionId:t,title:r,body:s,url:i}){let n=e||`${t}:notification`;if(!this.delivered.has(n)){for(this.delivered.add(n);this.delivered.size>500;)this.delivered.delete(this.delivered.values().next().value);this.sendToAll({notificationId:n,sessionId:t,title:r,body:s,tag:n,url:i})}}async sendToAll(e){let t=this.listSubscriptions();await Promise.allSettled(t.map(t=>this.send(t,e)))}async send(e,t){try{a.setVapidDetails("mailto:agentroam@localhost",this.keys.publicKey,this.keys.privateKey),await a.sendNotification(e,p(t),{TTL:3600})}catch(r){let t=r?.statusCode;(404===t||410===t)&&this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e.endpoint))}}close(){this.db.close()}}function d(e){return(0,s.createHash)("sha256").update(e).digest("hex")}let l=null;function c(e=process.env.AGENT_DATA_DIR?.trim()||process.cwd()){return l??=new u(e)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8375,6703,6244,1322,1773,4621,7519],()=>r(1967));module.exports=s})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=6163,e.ids=[6163],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6005:e=>{e.exports=require("node:crypto")},7561:e=>{e.exports=require("node:fs")},9411:e=>{e.exports=require("node:path")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=6163,e.ids=[6163],e.modules={5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6005:e=>{e.exports=require("node:crypto")},7561:e=>{e.exports=require("node:fs")},9411:e=>{e.exports=require("node:path")},2109:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>b,patchFetch:()=>E,requestAsyncStorage:()=>h,routeModule:()=>d,serverHooks:()=>l,staticGenerationAsyncStorage:()=>c});var i={};s.r(i),s.d(i,{POST:()=>o});var r=s(7786),n=s(5042),p=s(2184),a=s(1890),u=s(3931);async function o(e){try{let t=await e.json();return a.NextResponse.json((0,u.i)().deleteSubscription(t?.endpoint))}catch(t){let e=t?.status;return a.NextResponse.json({error:t instanceof Error?t.message:"Unable to remove push subscription"},{status:e&&e>=400&&e<500?e:500})}}let d=new r.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/push/unsubscribe/route",pathname:"/api/push/unsubscribe",filename:"route",bundlePath:"app/api/push/unsubscribe/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/push/unsubscribe/route.ts",nextConfigOutput:"standalone",userland:i}),{requestAsyncStorage:h,staticGenerationAsyncStorage:c,serverHooks:l}=d,b="/api/push/unsubscribe/route";function E(){return(0,p.patchFetch)({serverHooks:l,staticGenerationAsyncStorage:c})}},3931:(e,t,s)=>{s.d(t,{i:()=>c});var i=s(6005),r=s(7561),n=s(9411),p=s(5890);let a=require("web-push"),u=e=>JSON.stringify(e??null);class o{constructor(e,t=Date.now){this.now=t;let s=(0,n.resolve)(e,".agentroam-auth");(0,r.mkdirSync)(s,{recursive:!0,mode:448});let i=(0,n.join)(s,"push.sqlite");this.db=new p(i),(0,r.chmodSync)(i,384),this.db.pragma("busy_timeout = 5000"),this.db.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS push_keys (id INTEGER PRIMARY KEY CHECK(id=1), public_key TEXT NOT NULL, private_key TEXT NOT NULL);
|
|
3
3
|
CREATE TABLE IF NOT EXISTS push_subscriptions (
|
|
4
4
|
endpoint_hash TEXT PRIMARY KEY,
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
INSERT INTO push_subscriptions (endpoint_hash, endpoint, p256dh, auth, device_id, created)
|
|
13
13
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
14
14
|
ON CONFLICT(endpoint_hash) DO UPDATE SET p256dh=excluded.p256dh, auth=excluded.auth, device_id=excluded.device_id
|
|
15
|
-
`).run(d(s),s,i,r,"string"==typeof e?e:null,this.now()),{ok:!0}}deleteSubscription(e){if("string"!=typeof e||!e)throw Object.assign(Error("Endpoint required"),{status:400});return this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e)),{ok:!0}}listSubscriptions(){return this.db.prepare("SELECT endpoint, p256dh, auth, device_id FROM push_subscriptions").all().map(e=>({endpoint:e.endpoint,keys:{p256dh:e.p256dh,auth:e.auth},deviceId:e.device_id}))}notifySession({notificationId:e,sessionId:t,title:s,body:i,url:r}){let n=e||`${t}:notification`;if(!this.delivered.has(n)){for(this.delivered.add(n);this.delivered.size>500;)this.delivered.delete(this.delivered.values().next().value);this.sendToAll({notificationId:n,sessionId:t,title:s,body:i,tag:n,url:r})}}async sendToAll(e){let t=this.listSubscriptions();await Promise.allSettled(t.map(t=>this.send(t,e)))}async send(e,t){try{a.setVapidDetails("mailto:agentroam@localhost",this.keys.publicKey,this.keys.privateKey),await a.sendNotification(e,
|
|
15
|
+
`).run(d(s),s,i,r,"string"==typeof e?e:null,this.now()),{ok:!0}}deleteSubscription(e){if("string"!=typeof e||!e)throw Object.assign(Error("Endpoint required"),{status:400});return this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e)),{ok:!0}}listSubscriptions(){return this.db.prepare("SELECT endpoint, p256dh, auth, device_id FROM push_subscriptions").all().map(e=>({endpoint:e.endpoint,keys:{p256dh:e.p256dh,auth:e.auth},deviceId:e.device_id}))}notifySession({notificationId:e,sessionId:t,title:s,body:i,url:r}){let n=e||`${t}:notification`;if(!this.delivered.has(n)){for(this.delivered.add(n);this.delivered.size>500;)this.delivered.delete(this.delivered.values().next().value);this.sendToAll({notificationId:n,sessionId:t,title:s,body:i,tag:n,url:r})}}async sendToAll(e){let t=this.listSubscriptions();await Promise.allSettled(t.map(t=>this.send(t,e)))}async send(e,t){try{a.setVapidDetails("mailto:agentroam@localhost",this.keys.publicKey,this.keys.privateKey),await a.sendNotification(e,u(t),{TTL:3600})}catch(s){let t=s?.statusCode;(404===t||410===t)&&this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e.endpoint))}}close(){this.db.close()}}function d(e){return(0,i.createHash)("sha256").update(e).digest("hex")}let h=null;function c(e=process.env.AGENT_DATA_DIR?.trim()||process.cwd()){return h??=new o(e)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),i=t.X(0,[8375,6703],()=>s(2109));module.exports=i})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=3807,e.ids=[3807],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=3807,e.ids=[3807],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},5881:e=>{e.exports=require("node:util")},7053:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>f,patchFetch:()=>v,requestAsyncStorage:()=>c,routeModule:()=>l,serverHooks:()=>y,staticGenerationAsyncStorage:()=>h});var s={};r.r(s),r.d(s,{GET:()=>d});var i=r(7786),o=r(5042),n=r(2184),a=r(1890),p=r(3931),u=r(1079);async function d(){try{return(0,u.j)(),a.NextResponse.json({publicKey:(0,p.i)().getPublicKey()})}catch(e){return a.NextResponse.json({error:e instanceof Error?e.message:"Push is unavailable"},{status:500})}}let l=new i.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/push/vapid/route",pathname:"/api/push/vapid",filename:"route",bundlePath:"app/api/push/vapid/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/push/vapid/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:c,staticGenerationAsyncStorage:h,serverHooks:y}=l,f="/api/push/vapid/route";function v(){return(0,n.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:h})}},1079:(e,t,r)=>{r.d(t,{j:()=>d});var s=r(7519),i=r(3931),o=r(535),n=r(1322),a=r(1982);let p=!1,u=new n.sSf;function d(){p||(p=!0,s.agentHost.setGlobalEventObserver((e,t,r)=>{try{if("ask_user"===t.type){(0,i.i)().notifySession({notificationId:`${e}:${t.questionId}:approval`,sessionId:e,kind:"approval",title:"需要你的审批",body:"string"==typeof t.question&&t.question.trim()?t.question.trim().slice(0,160):"会话正在等待确认",url:"/app/"});return}if("done"===t.type){if("goal"===r.source)return;let s=(0,n.mDL)((0,a.dp)().read().taskNotifications),o=r.runId?(0,n.DXW)({sessionId:e,runId:r.runId,title:"任务已完成",finalText:t.finalText,outcome:"completed",source:"user"},s):null;o&&u.accept(o.notificationId)&&(0,i.i)().notifySession({...o,url:`/app/?session=${encodeURIComponent(e)}`});return}if("goal_updated"===t.type&&"complete"===t.goal.status){let r=(0,n.mDL)((0,a.dp)().read().taskNotifications),s=(0,n.DXW)({sessionId:e,runId:`goal:${t.goal.createdAt}`,title:"目标已完成",finalText:t.goal.objective,outcome:"completed",source:"goal",goalFinished:!0},r);s&&u.accept(s.notificationId)&&(0,i.i)().notifySession({...s,url:`/app/?session=${encodeURIComponent(e)}`});return}"error"===t.type&&(0,i.i)().notifySession({notificationId:`${e}:${r.runId??"unknown"}:error`,sessionId:e,kind:"error",title:"会话出错",body:"string"==typeof t.message&&t.message.trim()?t.message.trim().slice(0,160):"运行失败",url:"/app/"})}catch(t){(0,o.L)().warn("web push notify failed",{sessionId:e,error:t instanceof Error?t.message:String(t)})}}))}},1489:(e,t,r)=>{r.d(t,{N:()=>p});var s=r(1322),i=r(6279),o=r(785);class n{constructor(){this.tasks=new s.vo4((0,o.kO)()),this.scheduler=new i.ST(this.tasks,e=>{this.fire(e).catch(e=>console.error("Scheduled Customer Agent run failed",e))},()=>{}),this.scheduler.start()}async fire(e){let{agentHost:t}=await r.e(7519).then(r.bind(r,7519)),{getCustomerGoalCoordinator:s}=await Promise.all([r.e(7519),r.e(732)]).then(r.bind(r,732)),i=e.sessionId;i&&await t.getSessionStore().get(i)||(i=(await t.createSession(e.label||"定时任务")).id,this.tasks.update(e.id,{sessionId:i})),await s().enqueue(i,e.prompt)}call(e,t){let r=String(t[0]||"");switch(e){case"cronList":return this.tasks.list();case"cronCreate":{if("string"!=typeof t[0]||"string"!=typeof t[1]||!t[1].trim())throw Error("cron and prompt required");let e=t[2]&&"object"==typeof t[2]?t[2]:{};return this.tasks.create({cron:t[0],prompt:t[1],recurring:!1!==e.recurring,enabled:!0,durable:!0,..."string"==typeof e.sessionId?{sessionId:e.sessionId}:{},..."string"==typeof e.label?{label:e.label}:{}})}case"cronPause":return this.tasks.pause(r);case"cronResume":return this.tasks.resume(r);case"cronDelete":return this.tasks.delete(r);case"cronDeleteAll":return this.tasks.deleteAll(),{ok:!0};default:throw Error("Unsupported schedule operation")}}}let a=globalThis;function p(){return a.__sharedCronService??=new n}},3931:(e,t,r)=>{r.d(t,{i:()=>c});var s=r(6005),i=r(7561),o=r(9411),n=r(5890);let a=require("web-push"),p=e=>JSON.stringify(e??null);class u{constructor(e,t=Date.now){this.now=t;let r=(0,o.resolve)(e,".agentroam-auth");(0,i.mkdirSync)(r,{recursive:!0,mode:448});let s=(0,o.join)(r,"push.sqlite");this.db=new n(s),(0,i.chmodSync)(s,384),this.db.pragma("busy_timeout = 5000"),this.db.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS push_keys (id INTEGER PRIMARY KEY CHECK(id=1), public_key TEXT NOT NULL, private_key TEXT NOT NULL);
|
|
3
3
|
CREATE TABLE IF NOT EXISTS push_subscriptions (
|
|
4
4
|
endpoint_hash TEXT PRIMARY KEY,
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
INSERT INTO push_subscriptions (endpoint_hash, endpoint, p256dh, auth, device_id, created)
|
|
13
13
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
14
14
|
ON CONFLICT(endpoint_hash) DO UPDATE SET p256dh=excluded.p256dh, auth=excluded.auth, device_id=excluded.device_id
|
|
15
|
-
`).run(
|
|
15
|
+
`).run(d(r),r,s,i,"string"==typeof e?e:null,this.now()),{ok:!0}}deleteSubscription(e){if("string"!=typeof e||!e)throw Object.assign(Error("Endpoint required"),{status:400});return this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e)),{ok:!0}}listSubscriptions(){return this.db.prepare("SELECT endpoint, p256dh, auth, device_id FROM push_subscriptions").all().map(e=>({endpoint:e.endpoint,keys:{p256dh:e.p256dh,auth:e.auth},deviceId:e.device_id}))}notifySession({notificationId:e,sessionId:t,title:r,body:s,url:i}){let o=e||`${t}:notification`;if(!this.delivered.has(o)){for(this.delivered.add(o);this.delivered.size>500;)this.delivered.delete(this.delivered.values().next().value);this.sendToAll({notificationId:o,sessionId:t,title:r,body:s,tag:o,url:i})}}async sendToAll(e){let t=this.listSubscriptions();await Promise.allSettled(t.map(t=>this.send(t,e)))}async send(e,t){try{a.setVapidDetails("mailto:agentroam@localhost",this.keys.publicKey,this.keys.privateKey),await a.sendNotification(e,p(t),{TTL:3600})}catch(r){let t=r?.statusCode;(404===t||410===t)&&this.db.prepare("DELETE FROM push_subscriptions WHERE endpoint_hash=?").run(d(e.endpoint))}}close(){this.db.close()}}function d(e){return(0,s.createHash)("sha256").update(e).digest("hex")}let l=null;function c(e=process.env.AGENT_DATA_DIR?.trim()||process.cwd()){return l??=new u(e)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8375,6703,6244,1322,1773,4621,7519],()=>r(7053));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"publicKey":"
|
|
1
|
+
{"publicKey":"BIJQS7DoG9EMdXGnZpnlc_6FZPdczR6fmxV5n9HhzAB4shktAZA_VXj83XS19Ob3ZOjG11HR_rpme-X7rbhd-wM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=2166,e.ids=[2166],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},
|
|
1
|
+
"use strict";(()=>{var e={};e.id=2166,e.ids=[2166],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},5881:e=>{e.exports=require("node:util")},9351:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>g,requestAsyncStorage:()=>d,routeModule:()=>l,serverHooks:()=>m,staticGenerationAsyncStorage:()=>h});var s={};t.r(s),t.d(s,{POST:()=>p});var o=t(7786),n=t(5042),u=t(2184),i=t(1890),a=t(7519);function c(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}async function p(e){let r;try{r=await e.json()}catch{return i.NextResponse.json({error:"Invalid JSON"},{status:400})}let t=function(e){if(!c(e))return{success:!1,error:"Request body must be an object"};if("string"!=typeof e.projectId||0===e.projectId.length)return{success:!1,error:"projectId is required"};if(!Array.isArray(e.tools)||0===e.tools.length)return{success:!1,error:"tools must contain at least one tool"};let r=[];for(let o of e.tools){var t,s;if(!c(o))return{success:!1,error:"tool must be an object"};if("string"!=typeof o.scheme||0===o.scheme.length)return{success:!1,error:"tool.scheme is required"};if("string"!=typeof o.purpose||0===o.purpose.length)return{success:!1,error:"tool.purpose is required"};if("string"!=typeof o.url)return{success:!1,error:"tool.url is required"};try{new URL(o.url)}catch{return{success:!1,error:"tool.url must be a valid URL"}}if(void 0!==o.method&&"POST"!==o.method)return{success:!1,error:"tool.method must be POST"};let e=void 0===o.headers?{}:c(t=o.headers)&&Object.values(t).every(e=>"string"==typeof e)?t:null,n=void 0===o.inputSchema?{}:o.inputSchema,u=void 0===o.outputSchema?{}:o.outputSchema,i=void 0===o.examples?[]:Array.isArray(s=o.examples)&&s.every(c)?s:null,a=void 0===o.auth?{}:o.auth;if(!e)return{success:!1,error:"tool.headers must be a string record"};if(!c(n))return{success:!1,error:"tool.inputSchema must be an object"};if(!c(u))return{success:!1,error:"tool.outputSchema must be an object"};if(!i)return{success:!1,error:"tool.examples must be an array of objects"};if(!c(a))return{success:!1,error:"tool.auth must be an object"};r.push({scheme:o.scheme,purpose:o.purpose,url:o.url,method:"POST",headers:e,inputSchema:n,outputSchema:u,examples:i,auth:a})}return{success:!0,data:{projectId:e.projectId,tools:r}}}(r);if(!t.success)return i.NextResponse.json({error:t.error},{status:400});if(!function(e,r){let t=e.headers.get("authorization");if([process.env.AGENT_REMOTE_TOOLS_REGISTER_TOKEN,process.env.AGENT_SDK_REGISTRATION_TOKEN].filter(e=>!!e).some(e=>t===`Bearer ${e}`))return!0;let s=process.env.AGENT_SDK_TOKEN;return!!s&&t===`Bearer ${s}`&&function(e,r){var t;let s;if(!process.env.AGENT_PROJECT_ID)return!1;let o=e.headers.get("origin");if(!o)return!1;try{s=new URL(o).origin}catch{return!1}let n=(t=r.projectId,process.env.AGENT_PROJECT_ID&&t===process.env.AGENT_PROJECT_ID?process.env.AGENT_SDK_ALLOWED_ORIGIN??process.env.AGENT_BROWSER_ORIGIN??null:null);if(n)try{if(new URL(n).origin!==s)return!1}catch{return!1}else if(process.env.AGENT_PROJECT_ID)return!1;return r.tools.every(e=>{try{return new URL(e.url).origin===s}catch{return!1}})}(e,r)}(e,t.data))return i.NextResponse.json({error:"UNAUTHORIZED"},{status:401});let s=a.agentHost.registerRemoteTools(t.data.projectId,t.data.tools);return i.NextResponse.json({ok:!0,tools:s.map(e=>({scheme:e.scheme,purpose:e.purpose}))})}let l=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/remote-tools/register/route",pathname:"/api/remote-tools/register",filename:"route",bundlePath:"app/api/remote-tools/register/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/remote-tools/register/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:h,serverHooks:m}=l,f="/api/remote-tools/register/route";function g(){return(0,u.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:h})}},1489:(e,r,t)=>{t.d(r,{N:()=>a});var s=t(1322),o=t(6279),n=t(785);class u{constructor(){this.tasks=new s.vo4((0,n.kO)()),this.scheduler=new o.ST(this.tasks,e=>{this.fire(e).catch(e=>console.error("Scheduled Customer Agent run failed",e))},()=>{}),this.scheduler.start()}async fire(e){let{agentHost:r}=await t.e(7519).then(t.bind(t,7519)),{getCustomerGoalCoordinator:s}=await Promise.all([t.e(7519),t.e(732)]).then(t.bind(t,732)),o=e.sessionId;o&&await r.getSessionStore().get(o)||(o=(await r.createSession(e.label||"定时任务")).id,this.tasks.update(e.id,{sessionId:o})),await s().enqueue(o,e.prompt)}call(e,r){let t=String(r[0]||"");switch(e){case"cronList":return this.tasks.list();case"cronCreate":{if("string"!=typeof r[0]||"string"!=typeof r[1]||!r[1].trim())throw Error("cron and prompt required");let e=r[2]&&"object"==typeof r[2]?r[2]:{};return this.tasks.create({cron:r[0],prompt:r[1],recurring:!1!==e.recurring,enabled:!0,durable:!0,..."string"==typeof e.sessionId?{sessionId:e.sessionId}:{},..."string"==typeof e.label?{label:e.label}:{}})}case"cronPause":return this.tasks.pause(t);case"cronResume":return this.tasks.resume(t);case"cronDelete":return this.tasks.delete(t);case"cronDeleteAll":return this.tasks.deleteAll(),{ok:!0};default:throw Error("Unsupported schedule operation")}}}let i=globalThis;function a(){return i.__sharedCronService??=new u}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8375,6703,6244,1322,1773,4621,7519],()=>t(9351));module.exports=s})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=8917,e.ids=[8917],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},7261:e=>{e.exports=require("node:util")},8674:(e,t,i)=>{i.r(t),i.d(t,{originalPathname:()=>eO,patchFetch:()=>eD,requestAsyncStorage:()=>eT,routeModule:()=>eR,serverHooks:()=>eI,staticGenerationAsyncStorage:()=>eN});var s={};i.r(s),i.d(s,{GET:()=>eb,dynamic:()=>ev,runtime:()=>ey});var r=i(7786),n=i(5042),a=i(2184),o=i(1322),h=i(785),l=i(1614),d=i(5673),c=i(7561),u=i(3977),p=i(9411),m=i(4492);let f={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},_={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:f.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(_);let w="READDIRP_RECURSIVE_ERROR",g=new Set(["ENOENT","EPERM","EACCES","ELOOP",w]),E=[f.DIR_TYPE,f.EVERYTHING_TYPE,f.FILE_DIR_TYPE,f.FILE_TYPE],v=new Set([f.DIR_TYPE,f.EVERYTHING_TYPE,f.FILE_DIR_TYPE]),y=new Set([f.EVERYTHING_TYPE,f.FILE_DIR_TYPE,f.FILE_TYPE]),P=e=>g.has(e.code),b="win32"===process.platform,R=e=>!0,T=e=>{if(void 0===e)return R;if("function"==typeof e)return e;if("string"==typeof e){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return R};class N extends m.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;_relStart;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark??_.highWaterMark});let t={..._,...e},i=t.root??_.root,s=t.type??_.type;this._fileFilter=T(t.fileFilter),this._directoryFilter=T(t.directoryFilter);let r=t.lstat?u.lstat:u.stat;b?this._stat=e=>r(e,{bigint:!0}):this._stat=r,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:_.depth,this._wantsDir=v.has(s),this._wantsFile=y.has(s),this._wantsEverything=s===f.EVERYTHING_TYPE,this._root=(0,p.resolve)(i),this._relStart=this._root.endsWith(p.sep)?this._root.length:this._root.length+1,this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};let n={path:this._root,depth:1};n.pending=this._exploreDir(this._root,1),this.parents=[n],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,i=t&&t.files;if(i&&i.length>0){let{path:s,depth:r}=t,n=i.splice(0,e).map(e=>this._formatEntry(e,s));for(let t of this._isDirent?n:await Promise.all(n)){if(!t)continue;if(this.destroyed)return;let i=this._getEntryType(t);"string"!=typeof i&&(i=await i),"directory"===i&&this._directoryFilter(t)?(r<=this._maxDepth&&this.parents.push({path:t.fullPath,depth:r+1}),this._wantsDir&&(this.push(t),e--)):("file"===i||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}let t=e.pending??this._exploreDir(e.path,e.depth),i=this.parents[this.parents.length-1];if(i&&!i.pending&&(i.pending=this._exploreDir(i.path,i.depth)),this.parent=await t,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let i;try{i=await (0,u.readdir)(e,this._rdOptions)}catch(e){this._onError(e)}return{files:i,depth:t,path:e}}_formatEntry(e,t){let i=this._isDirent?e.name:e,s=(0,p.join)(t,i),r={path:s.slice(this._relStart),fullPath:s,basename:i};return this._isDirent?(r.dirent=e,r):this._stat(s).then(e=>(r.stats=e,r),e=>{this._onError(e)})}_onError(e){P(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}_getEntryType(e){if(!e||!(this._statsProp in e))return"";let t=e[this._statsProp];return t.isFile()?"file":t.isDirectory()?"directory":t.isSymbolicLink()?this._getSymlinkEntryType(e):""}async _getSymlinkEntryType(e){let t=e.fullPath;try{let e=await (0,u.realpath)(t),i=await (0,u.lstat)(e);if(i.isFile())return"file";if(i.isDirectory()){let i=e.length;if(t.startsWith(e)&&t[i]===p.sep){let i=Error(`Circular symlink detected: "${t}" points to "${e}"`);return i.code=w,this._onError(i),""}return"directory"}}catch(e){this._onError(e)}return""}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}var I=i(612);let O=()=>{},D=process.platform,A="win32"===D,x="darwin"===D,S="linux"===D,C="freebsd"===D,k="OS400"===(0,I.type)(),M={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},W={lstat:u.lstat,stat:u.stat},L="listeners",F="errHandlers",j="rawEmitters",U=[L,F,j],q=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),G=e=>q.has(p.extname(e).slice(1).toLowerCase()),z=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},H=(e,t,i)=>{let s=e[t];s instanceof Set||(e[t]=s=new Set([s])),s.add(i)},V=e=>t=>{let i=e[t];i instanceof Set?i.clear():delete e[t]},Y=(e,t,i)=>{let s=e[t];s instanceof Set?s.delete(i):s===i&&delete e[t]},$=e=>e instanceof Set?0===e.size:!e,B=new Map;function X(e,t,i,s,r){try{return(0,c.watch)(e,{persistent:t.persistent},(t,s)=>{i(e),r(t,s,{watchedPath:e}),s&&e!==s&&K(p.resolve(e,s),L,p.join(e,s))})}catch(e){s(e);return}}let K=(e,t,i,s,r)=>{let n=B.get(e);n&&z(n[t],e=>{e(i,s,r)})},Q=(e,t,i,s)=>{let r;let{listener:n,errHandler:a,rawEmitter:o}=s,h=B.get(t);if(!i.persistent){if(!(r=X(e,i,n,a,o)))return;return r.close.bind(r)}if(h)H(h,L,n),H(h,F,a),H(h,j,o);else{if(!(r=X(e,i,K.bind(null,t,L),a,K.bind(null,t,j))))return;r.on(M.ERROR,async i=>{let s=K.bind(null,t,F);if(h&&(h.watcherUnusable=!0),A&&"EPERM"===i.code)try{let t=await (0,u.open)(e,"r");await t.close(),s(i)}catch(e){}else s(i)}),h={listeners:n,errHandlers:a,rawEmitters:o,watcher:r},B.set(t,h)}return()=>{Y(h,L,n),Y(h,F,a),Y(h,j,o),$(h.listeners)&&(h.watcher.close(),B.delete(t),U.forEach(V(h)),h.watcher=void 0,Object.freeze(h))}},J=new Map,Z=(e,t,i,s)=>{let{listener:r,rawEmitter:n}=s,a=J.get(t),o=a&&a.options;return o&&(o.persistent<i.persistent||o.interval>i.interval)&&((0,c.unwatchFile)(t),a=void 0),a?(H(a,L,r),H(a,j,n)):(a={listeners:r,rawEmitters:n,options:i,watcher:(0,c.watchFile)(t,i,(i,s)=>{z(a.rawEmitters,e=>{e(M.CHANGE,t,{curr:i,prev:s})});let r=i.mtimeMs;(i.size!==s.size||r>s.mtimeMs||0===r)&&z(a.listeners,t=>t(e,i))})},J.set(t,a)),()=>{Y(a,L,r),Y(a,j,n),$(a.listeners)&&(J.delete(t),(0,c.unwatchFile)(t),a.options=a.watcher=void 0,Object.freeze(a))}};class ee{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let i;let s=this.fsw.options,r=p.dirname(e),n=p.basename(e);this.fsw._getWatchedDir(r).add(n);let a=p.resolve(e),o={persistent:s.persistent};if(t||(t=O),s.usePolling){let r=s.interval!==s.binaryInterval;o.interval=r&&G(n)?s.binaryInterval:s.interval,i=Z(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})}else i=Q(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return i}_handleFile(e,t,i){if(this.fsw.closed)return;let s=p.dirname(e),r=p.basename(e),n=this.fsw._getWatchedDir(s),a=t;if(n.has(r))return;let o=async(t,i)=>{if(this.fsw._throttle("watch",e,5)){if(i&&0!==i.mtimeMs){if(n.has(r)){let t=i.atimeMs,s=i.mtimeMs;(!t||t<=s||s!==a.mtimeMs)&&this.fsw._emit(M.CHANGE,e,i),a=i}}else try{let i=await (0,u.stat)(e);if(this.fsw.closed)return;let s=i.atimeMs,r=i.mtimeMs;if((!s||s<=r||r!==a.mtimeMs)&&this.fsw._emit(M.CHANGE,e,i),(x||S||C)&&a.ino!==i.ino){this.fsw._closeFile(t),a=i;let s=this._watchWithNodeFs(e,o);s&&this.fsw._addPathCloser(t,s)}else a=i}catch(e){this.fsw._remove(s,r)}}},h=this._watchWithNodeFs(e,o);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(M.ADD,e,0))return;this.fsw._emit(M.ADD,e,t)}return h}async _handleSymlink(e,t,i,s){if(this.fsw.closed)return;let r=e.fullPath,n=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await (0,u.realpath)(i)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return n.has(s)?this.fsw._symlinkPaths.get(r)!==t&&(this.fsw._symlinkPaths.set(r,t),this.fsw._emit(M.CHANGE,i,e.stats)):(n.add(s),this.fsw._symlinkPaths.set(r,t),this.fsw._emit(M.ADD,i,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,t,i,s,r,n,a){e=p.join(e,"");let o=s?`${e}:${s}`:e;if(!(a=this.fsw._throttle("readdir",o,1e3)))return;let h=this.fsw._getWatchedDir(i.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>i.filterPath(e),directoryFilter:e=>i.filterDir(e)});if(d)return d.on("data",async a=>{if(this.fsw.closed){d=void 0;return}let o=a.path,c=p.join(e,o);if(l.add(o),!(a.stats.isSymbolicLink()&&await this._handleSymlink(a,e,c,o))){if(this.fsw.closed){d=void 0;return}o!==s&&(s||h.has(o))||(this.fsw._incrReadyCount(),c=p.join(r,p.relative(r,c)),this._addToNodeFs(c,t,i,n+1))}}).on(M.ERROR,this._boundHandleError),new Promise((t,o)=>{if(!d)return o();d.once("end",()=>{if(this.fsw.closed){d=void 0;return}let o=!!a&&a.clear();t(void 0),h.getChildren().filter(t=>t!==e&&!l.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,o&&this._handleRead(e,!1,i,s,r,n,a)})})}async _handleDir(e,t,i,s,r,n,a){let o,h;let l=this.fsw._getWatchedDir(p.dirname(e)),d=l.has(p.basename(e));i&&this.fsw.options.ignoreInitial||r||d||this.fsw._emit(M.ADD_DIR,e,t),l.add(p.basename(e)),this.fsw._getWatchedDir(e);let c=this.fsw.options.depth;if((null==c||s<=c)&&!this.fsw._symlinkPaths.has(a)){if(!r&&(await this._handleRead(e,i,n,r,e,s,o),this.fsw.closed))return;h=this._watchWithNodeFs(e,(t,i)=>{i&&0===i.mtimeMs||this._handleRead(t,!1,n,r,e,s,o)})}return h}async _addToNodeFs(e,t,i,s,r){let n=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return n(),!1;let a=this.fsw._getWatchHelpers(e);i&&(a.filterPath=e=>i.filterPath(e),a.filterDir=e=>i.filterDir(e));try{let i;let o=await W[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,o))return n(),!1;let h=this.fsw.options.followSymlinks;if(o.isDirectory()){let n=p.resolve(e),l=h?await (0,u.realpath)(e):e;if(this.fsw.closed||(i=await this._handleDir(a.watchPath,o,t,s,r,a,l),this.fsw.closed))return;n!==l&&void 0!==l&&this.fsw._symlinkPaths.set(n,l)}else if(o.isSymbolicLink()){let r=h?await (0,u.realpath)(e):e;if(this.fsw.closed)return;let n=p.dirname(a.watchPath);if(this.fsw._getWatchedDir(n).add(a.watchPath),this.fsw._emit(M.ADD,a.watchPath,o),i=await this._handleDir(n,o,t,s,e,a,r),this.fsw.closed)return;void 0!==r&&this.fsw._symlinkPaths.set(p.resolve(e),r)}else i=this._handleFile(a.watchPath,o,t);return n(),i&&this.fsw._addPathCloser(e,i),!1}catch(t){if(this.fsw._handleError(t))return n(),e}}}let et=/\\/g,ei=/\/\//g,es=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,er=/^\.[/\\]/;function en(e){return Array.isArray(e)?e:[e]}let ea=e=>"object"==typeof e&&null!==e&&!(e instanceof RegExp);function eo(e,t,i){let s=function(e){if("string"!=typeof e)throw Error("string expected");e=(e=p.normalize(e)).replace(/\\/g,"/");let t=!1;return e.startsWith("//")&&(t=!0),e=e.replace(ei,"/"),t&&(e="/"+e),e}(t);for(let t=0;t<e.length;t++)if((0,e[t])(s,i))return!0;return!1}let eh=e=>{let t=en(e).flat();if(!t.every(e=>"string"==typeof e))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(ed)},el=e=>{let t=e.replace(et,"/"),i=!1;return t.startsWith("//")&&(i=!0),t=t.replace(ei,"/"),i&&(t="/"+t),t},ed=e=>el(p.normalize(el(e))),ec=(e="")=>t=>"string"==typeof t?ed(p.isAbsolute(t)?t:p.join(e,t)):t,eu=(e,t)=>p.isAbsolute(e)?e:p.join(t,e),ep=Object.freeze(new Set);class em{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&"."!==e&&".."!==e&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let i=this.path;try{await (0,u.readdir)(i)}catch(e){this._removeWatcher&&this._removeWatcher(p.dirname(i),p.basename(i))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=O,this.items=ep,Object.freeze(this)}}class ef{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,t,i){this.fsw=i;let s=e;this.path=e=e.replace(er,""),this.watchPath=s,this.fullWatchPath=p.resolve(s),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?"stat":"lstat"}entryPath(e){return p.join(this.watchPath,p.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class e_ extends d.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},s={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?en(e.ignored):en([]),awaitWriteFinish:!0===t?i:"object"==typeof t&&{...i,...t}};k&&(s.usePolling=!0),void 0===s.atomic&&(s.atomic=!s.usePolling);let r=process.env.CHOKIDAR_USEPOLLING;if(void 0!==r){let e=r.toLowerCase();"false"===e||"0"===e?s.usePolling=!1:"true"===e||"1"===e?s.usePolling=!0:s.usePolling=!!e}let n=process.env.CHOKIDAR_INTERVAL;n&&(s.interval=Number.parseInt(n,10));let a=0;this._emitReady=()=>{++a>=this._readyCount&&(this._emitReady=O,this._readyEmitted=!0,process.nextTick(()=>this.emit(M.READY)))},this._emitRaw=(...e)=>this.emit(M.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=s,this._nodeFsHandler=new ee(this),Object.freeze(s)}_addIgnoredPath(e){if(ea(e)){for(let t of this._ignoredPaths)if(ea(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),"string"==typeof e)for(let t of this._ignoredPaths)ea(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,i){let{cwd:s}=this.options;this.closed=!1,this._closePromise=void 0;let r=eh(e);return s&&(r=r.map(e=>eu(e,s))),r.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=r.length,Promise.all(r.map(async e=>{let s=await this._nodeFsHandler._addToNodeFs(e,!i,void 0,0,t);return s&&this._emitReady(),s})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(p.dirname(e),p.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=eh(e),{cwd:i}=this.options;return t.forEach(e=>{p.isAbsolute(e)||this._closers.has(e)||(i&&(e=p.join(i,e)),e=p.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let i=t();i instanceof Promise&&e.push(i)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,i)=>{e[(this.options.cwd?p.relative(this.options.cwd,i):i)||"."]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==M.ERROR&&this.emit(M.ALL,e,...t)}async _emit(e,t,i){let s;if(this.closed)return;let r=this.options;A&&(t=p.normalize(t)),r.cwd&&(t=p.relative(r.cwd,t));let n=[t];null!=i&&n.push(i);let a=r.awaitWriteFinish;if(a&&(s=this._pendingWrites.get(t)))return s.lastChange=new Date,this;if(r.atomic){if(e===M.UNLINK)return this._pendingUnlinks.set(t,[e,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(M.ALL,...e),this._pendingUnlinks.delete(t)})},"number"==typeof r.atomic?r.atomic:100),this;e===M.ADD&&this._pendingUnlinks.has(t)&&(e=M.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===M.ADD||e===M.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,i)=>{t?(e=M.ERROR,n[0]=t,this.emitWithAll(e,n)):i&&(n.length>1?n[1]=i:n.push(i),this.emitWithAll(e,n))}),this;if(e===M.CHANGE&&!this._throttle(M.CHANGE,t,50))return this;if(r.alwaysStat&&void 0===i&&(e===M.ADD||e===M.ADD_DIR||e===M.CHANGE)){let e;let i=r.cwd?p.join(r.cwd,t):t;try{e=await (0,u.stat)(i)}catch(e){}if(!e||this.closed)return;n.push(e)}return this.emitWithAll(e,n),this}_handleError(e){let t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(M.ERROR,e),e||this.closed}_throttle(e,t,i){let s;this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error("invalid throttle");let n=r.get(t);if(n)return n.count++,!1;let a=()=>{let e=r.get(t),i=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),i},o={timeoutObject:s=setTimeout(a,i),clear:a,count:0};return r.set(t,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,s){let r;let n=this.options.awaitWriteFinish;if("object"!=typeof n)return;let a=n.pollInterval,o=e;this.options.cwd&&!p.isAbsolute(e)&&(o=p.join(this.options.cwd,e));let h=new Date,l=this._pendingWrites;l.has(e)||(l.set(e,{lastChange:h,cancelWait:()=>(l.delete(e),clearTimeout(r),i)}),r=setTimeout(function i(n){(0,c.stat)(o,(o,h)=>{if(o||!l.has(e)){o&&"ENOENT"!==o.code&&s(o);return}let d=Number(new Date);n&&h.size!==n.size&&(l.get(e).lastChange=d),d-l.get(e).lastChange>=t?(l.delete(e),s(void 0,h)):r=setTimeout(i,a,h)})},a))}_isIgnored(e,t){if(this.options.atomic&&es.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(ec(e)),i=[...[...this._ignoredPaths].map(ec(e)),...t];this._userIgnored=function(e,t){if(null==e)throw TypeError("anymatch: specify first argument");let i=en(e).map(e=>"function"==typeof e?e:"string"==typeof e?t=>e===t:e instanceof RegExp?t=>e.test(t):"object"==typeof e&&null!==e?t=>{if(e.path===t)return!0;if(e.recursive){let i=p.relative(e.path,t);return!!i&&!i.startsWith("..")&&!p.isAbsolute(i)}return!1}:()=>!1);return null==t?(e,t)=>eo(i,e,t):eo(i,t)}(i,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new ef(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=p.resolve(e);return this._watched.has(t)||this._watched.set(t,new em(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return!!this.options.ignorePermissionErrors||!!(256&Number(e.mode))}_remove(e,t,i){let s=p.join(e,t),r=p.resolve(s);if(i=null!=i?i:this._watched.has(s)||this._watched.has(r),!this._throttle("remove",s,100))return;i||1!==this._watched.size||this.add(e,t,!0),this._getWatchedDir(s).getChildren().forEach(e=>this._remove(s,e));let n=this._getWatchedDir(e),a=n.has(t);n.remove(t),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let o=s;if(this.options.cwd&&(o=p.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(o)&&this._pendingWrites.get(o).cancelWait()===M.ADD)return;this._watched.delete(s),this._watched.delete(r);let h=i?M.UNLINK_DIR:M.UNLINK;a&&!this._isIgnored(s)&&this._emit(h,s),this._closePath(s)}_closePath(e){this._closeFile(e);let t=p.dirname(e);this._getWatchedDir(t).remove(p.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(t)}_readdirp(e,t){if(this.closed)return;let i=function(e,t={}){let i=t.entryType||t.type;if("both"===i&&(i=f.FILE_DIR_TYPE),e){if("string"!=typeof e)throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(i&&!E.includes(i))throw Error(`readdirp: Invalid type passed. Use one of ${E.join(", ")}`)}else throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");let s={...t,root:e};return i&&(s.type=i),new N(s)}(e,{type:M.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(i),i.once("close",()=>{i=void 0}),i.once("end",()=>{i&&(this._streams.delete(i),i=void 0)}),i}}let ew=e=>(function(e,t={}){let i=new e_(t);return i.add(e),i})(e,{ignoreInitial:!0,persistent:!0});class eg{constructor(e=ew,t=150){this.watchFile=e,this.debounceMs=t,this.entries=new Map}subscribe(e,t,i){let s=`${e}\0${t}`,r=this.entries.get(s);if(!r){let e=this.watchFile(t);r={watcher:e,subscribers:new Set,revision:0,debounceTimer:null},e.on("add",()=>this.schedule(r)),e.on("change",()=>this.schedule(r)),this.entries.set(s,r)}r.subscribers.add(i);let n=!0;return()=>{if(!n)return;n=!1;let e=this.entries.get(s);e&&(e.subscribers.delete(i),0===e.subscribers.size&&this.releaseEntry(s,e))}}async dispose(){let e=[...this.entries.entries()];this.entries.clear(),await Promise.all(e.map(async([,e])=>{e.debounceTimer&&clearTimeout(e.debounceTimer),await e.watcher.close()}))}schedule(e){e.debounceTimer&&clearTimeout(e.debounceTimer),e.debounceTimer=setTimeout(()=>{e.debounceTimer=null,e.revision+=1;let t={type:"session_history_changed",revision:e.revision};for(let i of e.subscribers)try{i(t)}catch{}},this.debounceMs)}releaseEntry(e,t){this.entries.get(e)===t&&this.entries.delete(e),t.debounceTimer&&clearTimeout(t.debounceTimer),t.debounceTimer=null,t.watcher.close()}}let eE=globalThis,ev="force-dynamic",ey="nodejs",eP=new TextEncoder;async function eb(e,{params:t}){if(!(0,l.V_)(t.id))return function(e,t){let i=(0,o.N8n)((0,h.kO)()).db.prepare(`SELECT updated, status,
|
|
1
|
+
"use strict";(()=>{var e={};e.id=8917,e.ids=[8917],e.modules={7728:e=>{e.exports=require("@anthropic-ai/claude-agent-sdk")},5890:e=>{e.exports=require("better-sqlite3")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7718:e=>{e.exports=require("node:child_process")},6005:e=>{e.exports=require("node:crypto")},5673:e=>{e.exports=require("node:events")},7561:e=>{e.exports=require("node:fs")},3977:e=>{e.exports=require("node:fs/promises")},8849:e=>{e.exports=require("node:http")},2286:e=>{e.exports=require("node:https")},2033:e=>{e.exports=require("node:module")},7503:e=>{e.exports=require("node:net")},612:e=>{e.exports=require("node:os")},9411:e=>{e.exports=require("node:path")},1747:e=>{e.exports=require("node:readline")},4492:e=>{e.exports=require("node:stream")},6915:e=>{e.exports=require("node:string_decoder")},1041:e=>{e.exports=require("node:url")},5881:e=>{e.exports=require("node:util")},7227:(e,t,i)=>{i.r(t),i.d(t,{originalPathname:()=>eO,patchFetch:()=>eD,requestAsyncStorage:()=>eT,routeModule:()=>eR,serverHooks:()=>eI,staticGenerationAsyncStorage:()=>eN});var s={};i.r(s),i.d(s,{GET:()=>eb,dynamic:()=>ev,runtime:()=>ey});var r=i(7786),n=i(5042),a=i(2184),o=i(1322),h=i(785),l=i(1614),d=i(5673),c=i(7561),u=i(3977),p=i(9411),m=i(4492);let f={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},_={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:f.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(_);let w="READDIRP_RECURSIVE_ERROR",g=new Set(["ENOENT","EPERM","EACCES","ELOOP",w]),E=[f.DIR_TYPE,f.EVERYTHING_TYPE,f.FILE_DIR_TYPE,f.FILE_TYPE],v=new Set([f.DIR_TYPE,f.EVERYTHING_TYPE,f.FILE_DIR_TYPE]),y=new Set([f.EVERYTHING_TYPE,f.FILE_DIR_TYPE,f.FILE_TYPE]),P=e=>g.has(e.code),b="win32"===process.platform,R=e=>!0,T=e=>{if(void 0===e)return R;if("function"==typeof e)return e;if("string"==typeof e){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return R};class N extends m.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;_relStart;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark??_.highWaterMark});let t={..._,...e},i=t.root??_.root,s=t.type??_.type;this._fileFilter=T(t.fileFilter),this._directoryFilter=T(t.directoryFilter);let r=t.lstat?u.lstat:u.stat;b?this._stat=e=>r(e,{bigint:!0}):this._stat=r,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:_.depth,this._wantsDir=v.has(s),this._wantsFile=y.has(s),this._wantsEverything=s===f.EVERYTHING_TYPE,this._root=(0,p.resolve)(i),this._relStart=this._root.endsWith(p.sep)?this._root.length:this._root.length+1,this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};let n={path:this._root,depth:1};n.pending=this._exploreDir(this._root,1),this.parents=[n],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,i=t&&t.files;if(i&&i.length>0){let{path:s,depth:r}=t,n=i.splice(0,e).map(e=>this._formatEntry(e,s));for(let t of this._isDirent?n:await Promise.all(n)){if(!t)continue;if(this.destroyed)return;let i=this._getEntryType(t);"string"!=typeof i&&(i=await i),"directory"===i&&this._directoryFilter(t)?(r<=this._maxDepth&&this.parents.push({path:t.fullPath,depth:r+1}),this._wantsDir&&(this.push(t),e--)):("file"===i||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}let t=e.pending??this._exploreDir(e.path,e.depth),i=this.parents[this.parents.length-1];if(i&&!i.pending&&(i.pending=this._exploreDir(i.path,i.depth)),this.parent=await t,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let i;try{i=await (0,u.readdir)(e,this._rdOptions)}catch(e){this._onError(e)}return{files:i,depth:t,path:e}}_formatEntry(e,t){let i=this._isDirent?e.name:e,s=(0,p.join)(t,i),r={path:s.slice(this._relStart),fullPath:s,basename:i};return this._isDirent?(r.dirent=e,r):this._stat(s).then(e=>(r.stats=e,r),e=>{this._onError(e)})}_onError(e){P(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}_getEntryType(e){if(!e||!(this._statsProp in e))return"";let t=e[this._statsProp];return t.isFile()?"file":t.isDirectory()?"directory":t.isSymbolicLink()?this._getSymlinkEntryType(e):""}async _getSymlinkEntryType(e){let t=e.fullPath;try{let e=await (0,u.realpath)(t),i=await (0,u.lstat)(e);if(i.isFile())return"file";if(i.isDirectory()){let i=e.length;if(t.startsWith(e)&&t[i]===p.sep){let i=Error(`Circular symlink detected: "${t}" points to "${e}"`);return i.code=w,this._onError(i),""}return"directory"}}catch(e){this._onError(e)}return""}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}var I=i(612);let O=()=>{},D=process.platform,A="win32"===D,x="darwin"===D,S="linux"===D,C="freebsd"===D,M="OS400"===(0,I.type)(),k={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},W={lstat:u.lstat,stat:u.stat},L="listeners",F="errHandlers",j="rawEmitters",U=[L,F,j],q=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),G=e=>q.has(p.extname(e).slice(1).toLowerCase()),z=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},H=(e,t,i)=>{let s=e[t];s instanceof Set||(e[t]=s=new Set([s])),s.add(i)},V=e=>t=>{let i=e[t];i instanceof Set?i.clear():delete e[t]},Y=(e,t,i)=>{let s=e[t];s instanceof Set?s.delete(i):s===i&&delete e[t]},$=e=>e instanceof Set?0===e.size:!e,B=new Map;function X(e,t,i,s,r){try{return(0,c.watch)(e,{persistent:t.persistent},(t,s)=>{i(e),r(t,s,{watchedPath:e}),s&&e!==s&&K(p.resolve(e,s),L,p.join(e,s))})}catch(e){s(e);return}}let K=(e,t,i,s,r)=>{let n=B.get(e);n&&z(n[t],e=>{e(i,s,r)})},Q=(e,t,i,s)=>{let r;let{listener:n,errHandler:a,rawEmitter:o}=s,h=B.get(t);if(!i.persistent){if(!(r=X(e,i,n,a,o)))return;return r.close.bind(r)}if(h)H(h,L,n),H(h,F,a),H(h,j,o);else{if(!(r=X(e,i,K.bind(null,t,L),a,K.bind(null,t,j))))return;r.on(k.ERROR,async i=>{let s=K.bind(null,t,F);if(h&&(h.watcherUnusable=!0),A&&"EPERM"===i.code)try{let t=await (0,u.open)(e,"r");await t.close(),s(i)}catch(e){}else s(i)}),h={listeners:n,errHandlers:a,rawEmitters:o,watcher:r},B.set(t,h)}return()=>{Y(h,L,n),Y(h,F,a),Y(h,j,o),$(h.listeners)&&(h.watcher.close(),B.delete(t),U.forEach(V(h)),h.watcher=void 0,Object.freeze(h))}},J=new Map,Z=(e,t,i,s)=>{let{listener:r,rawEmitter:n}=s,a=J.get(t),o=a&&a.options;return o&&(o.persistent<i.persistent||o.interval>i.interval)&&((0,c.unwatchFile)(t),a=void 0),a?(H(a,L,r),H(a,j,n)):(a={listeners:r,rawEmitters:n,options:i,watcher:(0,c.watchFile)(t,i,(i,s)=>{z(a.rawEmitters,e=>{e(k.CHANGE,t,{curr:i,prev:s})});let r=i.mtimeMs;(i.size!==s.size||r>s.mtimeMs||0===r)&&z(a.listeners,t=>t(e,i))})},J.set(t,a)),()=>{Y(a,L,r),Y(a,j,n),$(a.listeners)&&(J.delete(t),(0,c.unwatchFile)(t),a.options=a.watcher=void 0,Object.freeze(a))}};class ee{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let i;let s=this.fsw.options,r=p.dirname(e),n=p.basename(e);this.fsw._getWatchedDir(r).add(n);let a=p.resolve(e),o={persistent:s.persistent};if(t||(t=O),s.usePolling){let r=s.interval!==s.binaryInterval;o.interval=r&&G(n)?s.binaryInterval:s.interval,i=Z(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})}else i=Q(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return i}_handleFile(e,t,i){if(this.fsw.closed)return;let s=p.dirname(e),r=p.basename(e),n=this.fsw._getWatchedDir(s),a=t;if(n.has(r))return;let o=async(t,i)=>{if(this.fsw._throttle("watch",e,5)){if(i&&0!==i.mtimeMs){if(n.has(r)){let t=i.atimeMs,s=i.mtimeMs;(!t||t<=s||s!==a.mtimeMs)&&this.fsw._emit(k.CHANGE,e,i),a=i}}else try{let i=await (0,u.stat)(e);if(this.fsw.closed)return;let s=i.atimeMs,r=i.mtimeMs;if((!s||s<=r||r!==a.mtimeMs)&&this.fsw._emit(k.CHANGE,e,i),(x||S||C)&&a.ino!==i.ino){this.fsw._closeFile(t),a=i;let s=this._watchWithNodeFs(e,o);s&&this.fsw._addPathCloser(t,s)}else a=i}catch(e){this.fsw._remove(s,r)}}},h=this._watchWithNodeFs(e,o);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(k.ADD,e,0))return;this.fsw._emit(k.ADD,e,t)}return h}async _handleSymlink(e,t,i,s){if(this.fsw.closed)return;let r=e.fullPath,n=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await (0,u.realpath)(i)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return n.has(s)?this.fsw._symlinkPaths.get(r)!==t&&(this.fsw._symlinkPaths.set(r,t),this.fsw._emit(k.CHANGE,i,e.stats)):(n.add(s),this.fsw._symlinkPaths.set(r,t),this.fsw._emit(k.ADD,i,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,t,i,s,r,n,a){e=p.join(e,"");let o=s?`${e}:${s}`:e;if(!(a=this.fsw._throttle("readdir",o,1e3)))return;let h=this.fsw._getWatchedDir(i.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>i.filterPath(e),directoryFilter:e=>i.filterDir(e)});if(d)return d.on("data",async a=>{if(this.fsw.closed){d=void 0;return}let o=a.path,c=p.join(e,o);if(l.add(o),!(a.stats.isSymbolicLink()&&await this._handleSymlink(a,e,c,o))){if(this.fsw.closed){d=void 0;return}o!==s&&(s||h.has(o))||(this.fsw._incrReadyCount(),c=p.join(r,p.relative(r,c)),this._addToNodeFs(c,t,i,n+1))}}).on(k.ERROR,this._boundHandleError),new Promise((t,o)=>{if(!d)return o();d.once("end",()=>{if(this.fsw.closed){d=void 0;return}let o=!!a&&a.clear();t(void 0),h.getChildren().filter(t=>t!==e&&!l.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,o&&this._handleRead(e,!1,i,s,r,n,a)})})}async _handleDir(e,t,i,s,r,n,a){let o,h;let l=this.fsw._getWatchedDir(p.dirname(e)),d=l.has(p.basename(e));i&&this.fsw.options.ignoreInitial||r||d||this.fsw._emit(k.ADD_DIR,e,t),l.add(p.basename(e)),this.fsw._getWatchedDir(e);let c=this.fsw.options.depth;if((null==c||s<=c)&&!this.fsw._symlinkPaths.has(a)){if(!r&&(await this._handleRead(e,i,n,r,e,s,o),this.fsw.closed))return;h=this._watchWithNodeFs(e,(t,i)=>{i&&0===i.mtimeMs||this._handleRead(t,!1,n,r,e,s,o)})}return h}async _addToNodeFs(e,t,i,s,r){let n=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return n(),!1;let a=this.fsw._getWatchHelpers(e);i&&(a.filterPath=e=>i.filterPath(e),a.filterDir=e=>i.filterDir(e));try{let i;let o=await W[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,o))return n(),!1;let h=this.fsw.options.followSymlinks;if(o.isDirectory()){let n=p.resolve(e),l=h?await (0,u.realpath)(e):e;if(this.fsw.closed||(i=await this._handleDir(a.watchPath,o,t,s,r,a,l),this.fsw.closed))return;n!==l&&void 0!==l&&this.fsw._symlinkPaths.set(n,l)}else if(o.isSymbolicLink()){let r=h?await (0,u.realpath)(e):e;if(this.fsw.closed)return;let n=p.dirname(a.watchPath);if(this.fsw._getWatchedDir(n).add(a.watchPath),this.fsw._emit(k.ADD,a.watchPath,o),i=await this._handleDir(n,o,t,s,e,a,r),this.fsw.closed)return;void 0!==r&&this.fsw._symlinkPaths.set(p.resolve(e),r)}else i=this._handleFile(a.watchPath,o,t);return n(),i&&this.fsw._addPathCloser(e,i),!1}catch(t){if(this.fsw._handleError(t))return n(),e}}}let et=/\\/g,ei=/\/\//g,es=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,er=/^\.[/\\]/;function en(e){return Array.isArray(e)?e:[e]}let ea=e=>"object"==typeof e&&null!==e&&!(e instanceof RegExp);function eo(e,t,i){let s=function(e){if("string"!=typeof e)throw Error("string expected");e=(e=p.normalize(e)).replace(/\\/g,"/");let t=!1;return e.startsWith("//")&&(t=!0),e=e.replace(ei,"/"),t&&(e="/"+e),e}(t);for(let t=0;t<e.length;t++)if((0,e[t])(s,i))return!0;return!1}let eh=e=>{let t=en(e).flat();if(!t.every(e=>"string"==typeof e))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(ed)},el=e=>{let t=e.replace(et,"/"),i=!1;return t.startsWith("//")&&(i=!0),t=t.replace(ei,"/"),i&&(t="/"+t),t},ed=e=>el(p.normalize(el(e))),ec=(e="")=>t=>"string"==typeof t?ed(p.isAbsolute(t)?t:p.join(e,t)):t,eu=(e,t)=>p.isAbsolute(e)?e:p.join(t,e),ep=Object.freeze(new Set);class em{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&"."!==e&&".."!==e&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let i=this.path;try{await (0,u.readdir)(i)}catch(e){this._removeWatcher&&this._removeWatcher(p.dirname(i),p.basename(i))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=O,this.items=ep,Object.freeze(this)}}class ef{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,t,i){this.fsw=i;let s=e;this.path=e=e.replace(er,""),this.watchPath=s,this.fullWatchPath=p.resolve(s),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?"stat":"lstat"}entryPath(e){return p.join(this.watchPath,p.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class e_ extends d.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},s={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?en(e.ignored):en([]),awaitWriteFinish:!0===t?i:"object"==typeof t&&{...i,...t}};M&&(s.usePolling=!0),void 0===s.atomic&&(s.atomic=!s.usePolling);let r=process.env.CHOKIDAR_USEPOLLING;if(void 0!==r){let e=r.toLowerCase();"false"===e||"0"===e?s.usePolling=!1:"true"===e||"1"===e?s.usePolling=!0:s.usePolling=!!e}let n=process.env.CHOKIDAR_INTERVAL;n&&(s.interval=Number.parseInt(n,10));let a=0;this._emitReady=()=>{++a>=this._readyCount&&(this._emitReady=O,this._readyEmitted=!0,process.nextTick(()=>this.emit(k.READY)))},this._emitRaw=(...e)=>this.emit(k.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=s,this._nodeFsHandler=new ee(this),Object.freeze(s)}_addIgnoredPath(e){if(ea(e)){for(let t of this._ignoredPaths)if(ea(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),"string"==typeof e)for(let t of this._ignoredPaths)ea(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,i){let{cwd:s}=this.options;this.closed=!1,this._closePromise=void 0;let r=eh(e);return s&&(r=r.map(e=>eu(e,s))),r.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=r.length,Promise.all(r.map(async e=>{let s=await this._nodeFsHandler._addToNodeFs(e,!i,void 0,0,t);return s&&this._emitReady(),s})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(p.dirname(e),p.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=eh(e),{cwd:i}=this.options;return t.forEach(e=>{p.isAbsolute(e)||this._closers.has(e)||(i&&(e=p.join(i,e)),e=p.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let i=t();i instanceof Promise&&e.push(i)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,i)=>{e[(this.options.cwd?p.relative(this.options.cwd,i):i)||"."]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==k.ERROR&&this.emit(k.ALL,e,...t)}async _emit(e,t,i){let s;if(this.closed)return;let r=this.options;A&&(t=p.normalize(t)),r.cwd&&(t=p.relative(r.cwd,t));let n=[t];null!=i&&n.push(i);let a=r.awaitWriteFinish;if(a&&(s=this._pendingWrites.get(t)))return s.lastChange=new Date,this;if(r.atomic){if(e===k.UNLINK)return this._pendingUnlinks.set(t,[e,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(k.ALL,...e),this._pendingUnlinks.delete(t)})},"number"==typeof r.atomic?r.atomic:100),this;e===k.ADD&&this._pendingUnlinks.has(t)&&(e=k.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===k.ADD||e===k.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,i)=>{t?(e=k.ERROR,n[0]=t,this.emitWithAll(e,n)):i&&(n.length>1?n[1]=i:n.push(i),this.emitWithAll(e,n))}),this;if(e===k.CHANGE&&!this._throttle(k.CHANGE,t,50))return this;if(r.alwaysStat&&void 0===i&&(e===k.ADD||e===k.ADD_DIR||e===k.CHANGE)){let e;let i=r.cwd?p.join(r.cwd,t):t;try{e=await (0,u.stat)(i)}catch(e){}if(!e||this.closed)return;n.push(e)}return this.emitWithAll(e,n),this}_handleError(e){let t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(k.ERROR,e),e||this.closed}_throttle(e,t,i){let s;this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error("invalid throttle");let n=r.get(t);if(n)return n.count++,!1;let a=()=>{let e=r.get(t),i=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),i},o={timeoutObject:s=setTimeout(a,i),clear:a,count:0};return r.set(t,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,s){let r;let n=this.options.awaitWriteFinish;if("object"!=typeof n)return;let a=n.pollInterval,o=e;this.options.cwd&&!p.isAbsolute(e)&&(o=p.join(this.options.cwd,e));let h=new Date,l=this._pendingWrites;l.has(e)||(l.set(e,{lastChange:h,cancelWait:()=>(l.delete(e),clearTimeout(r),i)}),r=setTimeout(function i(n){(0,c.stat)(o,(o,h)=>{if(o||!l.has(e)){o&&"ENOENT"!==o.code&&s(o);return}let d=Number(new Date);n&&h.size!==n.size&&(l.get(e).lastChange=d),d-l.get(e).lastChange>=t?(l.delete(e),s(void 0,h)):r=setTimeout(i,a,h)})},a))}_isIgnored(e,t){if(this.options.atomic&&es.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(ec(e)),i=[...[...this._ignoredPaths].map(ec(e)),...t];this._userIgnored=function(e,t){if(null==e)throw TypeError("anymatch: specify first argument");let i=en(e).map(e=>"function"==typeof e?e:"string"==typeof e?t=>e===t:e instanceof RegExp?t=>e.test(t):"object"==typeof e&&null!==e?t=>{if(e.path===t)return!0;if(e.recursive){let i=p.relative(e.path,t);return!!i&&!i.startsWith("..")&&!p.isAbsolute(i)}return!1}:()=>!1);return null==t?(e,t)=>eo(i,e,t):eo(i,t)}(i,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new ef(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=p.resolve(e);return this._watched.has(t)||this._watched.set(t,new em(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return!!this.options.ignorePermissionErrors||!!(256&Number(e.mode))}_remove(e,t,i){let s=p.join(e,t),r=p.resolve(s);if(i=null!=i?i:this._watched.has(s)||this._watched.has(r),!this._throttle("remove",s,100))return;i||1!==this._watched.size||this.add(e,t,!0),this._getWatchedDir(s).getChildren().forEach(e=>this._remove(s,e));let n=this._getWatchedDir(e),a=n.has(t);n.remove(t),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let o=s;if(this.options.cwd&&(o=p.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(o)&&this._pendingWrites.get(o).cancelWait()===k.ADD)return;this._watched.delete(s),this._watched.delete(r);let h=i?k.UNLINK_DIR:k.UNLINK;a&&!this._isIgnored(s)&&this._emit(h,s),this._closePath(s)}_closePath(e){this._closeFile(e);let t=p.dirname(e);this._getWatchedDir(t).remove(p.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(t)}_readdirp(e,t){if(this.closed)return;let i=function(e,t={}){let i=t.entryType||t.type;if("both"===i&&(i=f.FILE_DIR_TYPE),e){if("string"!=typeof e)throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(i&&!E.includes(i))throw Error(`readdirp: Invalid type passed. Use one of ${E.join(", ")}`)}else throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");let s={...t,root:e};return i&&(s.type=i),new N(s)}(e,{type:k.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(i),i.once("close",()=>{i=void 0}),i.once("end",()=>{i&&(this._streams.delete(i),i=void 0)}),i}}let ew=e=>(function(e,t={}){let i=new e_(t);return i.add(e),i})(e,{ignoreInitial:!0,persistent:!0});class eg{constructor(e=ew,t=150){this.watchFile=e,this.debounceMs=t,this.entries=new Map}subscribe(e,t,i){let s=`${e}\0${t}`,r=this.entries.get(s);if(!r){let e=this.watchFile(t);r={watcher:e,subscribers:new Set,revision:0,debounceTimer:null},e.on("add",()=>this.schedule(r)),e.on("change",()=>this.schedule(r)),this.entries.set(s,r)}r.subscribers.add(i);let n=!0;return()=>{if(!n)return;n=!1;let e=this.entries.get(s);e&&(e.subscribers.delete(i),0===e.subscribers.size&&this.releaseEntry(s,e))}}async dispose(){let e=[...this.entries.entries()];this.entries.clear(),await Promise.all(e.map(async([,e])=>{e.debounceTimer&&clearTimeout(e.debounceTimer),await e.watcher.close()}))}schedule(e){e.debounceTimer&&clearTimeout(e.debounceTimer),e.debounceTimer=setTimeout(()=>{e.debounceTimer=null,e.revision+=1;let t={type:"session_history_changed",revision:e.revision};for(let i of e.subscribers)try{i(t)}catch{}},this.debounceMs)}releaseEntry(e,t){this.entries.get(e)===t&&this.entries.delete(e),t.debounceTimer&&clearTimeout(t.debounceTimer),t.debounceTimer=null,t.watcher.close()}}let eE=globalThis,ev="force-dynamic",ey="nodejs",eP=new TextEncoder;async function eb(e,{params:t}){if(!(0,l.V_)(t.id))return function(e,t){let i=(0,o.N8n)((0,h.kO)()).db.prepare(`SELECT updated, status,
|
|
2
2
|
(SELECT MAX(id) FROM events WHERE session_id = sessions.id) AS eventId,
|
|
3
3
|
(SELECT MAX(id) FROM messages WHERE session_id = sessions.id) AS messageId
|
|
4
4
|
FROM sessions WHERE id = ?`),s=JSON.stringify(i.get(t));if(void 0===s)return Response.json({error:"Session not found"},{status:404});let r=()=>{};return new Response(new ReadableStream({start(n){let a=!1,o=new TextEncoder,h=setInterval(()=>{if(!a)try{let e=JSON.stringify(i.get(t));e!==s?(s=e,n.enqueue(o.encode(`data: ${JSON.stringify({type:"session_history_changed",revision:Date.now()})}
|
|
5
5
|
|
|
6
6
|
`))):n.enqueue(o.encode(": keep-alive\n\n"))}catch{r();try{n.close()}catch{}}},1e3);r=()=>{a||(a=!0,clearInterval(h),e.signal.removeEventListener("abort",r))},e.signal.addEventListener("abort",r,{once:!0}),e.signal.aborted?r():n.enqueue(o.encode(": connected\n\n"))},cancel(){r()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform","X-Accel-Buffering":"no"}})}(e,t.id);try{let i=await (0,l.NL)().getSessionWatchPath(t.id);if(!i)return Response.json({error:"Native session transcript is unavailable"},{status:404});let s=()=>void 0,r=new ReadableStream({start(r){let n=!1,a=(eE.__nativeSessionChangeMonitor||(eE.__nativeSessionChangeMonitor=new eg),eE.__nativeSessionChangeMonitor).subscribe(t.id,i,e=>{n||r.enqueue(eP.encode(`data: ${JSON.stringify(e)}
|
|
7
7
|
|
|
8
|
-
`))}),o=setInterval(()=>{n||r.enqueue(eP.encode(": keep-alive\n\n"))},15e3);s=()=>{n||(n=!0,clearInterval(o),a(),e.signal.removeEventListener("abort",s))},e.signal.addEventListener("abort",s,{once:!0}),r.enqueue(eP.encode(": connected\n\n"))},cancel(){s()}});return new Response(r,{headers:{"Cache-Control":"no-cache, no-transform",Connection:"keep-alive","Content-Type":"text/event-stream; charset=utf-8","X-Accel-Buffering":"no"}})}catch(e){return Response.json({error:e instanceof Error?e.message:"Internal error"},{status:(0,l.WW)(e)})}}let eR=new r.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/sessions/[id]/changes/route",pathname:"/api/sessions/[id]/changes",filename:"route",bundlePath:"app/api/sessions/[id]/changes/route"},resolvedPagePath:"/private/var/folders/6r/m9bbktwj1pvbr6hbzpxqkq3h0000gn/T/agentroam-release48-WLi1lw/repository/packages/server/app/api/sessions/[id]/changes/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:eT,staticGenerationAsyncStorage:eN,serverHooks:eI}=eR,eO="/api/sessions/[id]/changes/route";function eD(){return(0,a.patchFetch)({serverHooks:eI,staticGenerationAsyncStorage:eN})}},7786:(e,t,i)=>{e.exports=i(517)},535:(e,t,i)=>{i.d(t,{L:()=>a});var s=i(1322),r=i(785);let n=!1;function a(){let e=(0,s.Qfc)();if(e)return e;let t=(0,s.qZ_)({dir:(0,r.ME)(),source:"server",minLevel:"info",handlers:{exitOnUncaughtException:!1}});return n||(n=!0,t.info("server logger attached",{dir:t.dir,pid:process.pid})),t}},1614:(e,t,i)=>{i.d(t,{NL:()=>g,V_:()=>P,WW:()=>b});var s=i(7561),r=i(612),n=i(9411),a=i(7718),o=i(1322);function h(e){if(!e.trim())return!1;try{return(0,s.accessSync)(e,s.constants.X_OK),!0}catch{return!1}}function l(e){try{return(0,o.wyD)((0,a.execFileSync)(e,["--version"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","pipe"]}))}catch{return}}function d(e){let t=[],i=process.env[e.environmentVariable]?.trim();if(i){let s=h(i);t.push({source:"pin",path:i,executable:s,version:s?l(i):void 0,error:s?void 0:`${e.environmentVariable} "${i}" is not executable`})}let s=function(e){for(let t of(process.env.PATH??"").split(n.delimiter).filter(Boolean)){let i=(0,n.resolve)(t,e);if(h(i))return i}}(e.name);return s&&s!==i&&t.push({source:"path",path:s,executable:!0,version:l(s)}),(0,o.neJ)(t,{name:e.name,minimumVersion:e.minimumVersion})}var c=i(535),u=i(6279),p=i(785);let m=globalThis;class f{constructor(e,t=async()=>[],i=process.platform){this.runtime=e,this.listProjects=t,this.platform=i,this.pendingCreations=new Map}health(){return this.runtime.health()}listModels(e){return this.runtime.listModels(e)}listWorkspaces(e,t){return this.runtime.listWorkspaces(e,t)}importWorkspace(e,t,i){if(!this.runtime.importWorkspace)throw new u.no("Native workspace import is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.importWorkspace(e,t,i)}async listWorkspaceSessions(e,t,i){let s=await this.runtime.listWorkspaceSessions(e,t,i);if(i?.cursor)return s;let r=new Set(s.data.map(e=>e.id)),n=s.data.map(e=>{let t=this.pendingCreations.get(e.id);return t?(this.pendingCreations.delete(e.id),_(e,t)):e});for(let i of this.pendingCreations.values())i.agentType!==e||i.projectId!==t||r.has(i.id)||n.unshift(i);return{...s,data:n}}async list(e){let[t,i]=await Promise.all([this.runtime.list(),this.listProjects()]);return y(this.withPendingCreations(t).map(e=>E(e,i,this.platform)),e)}async refresh(e){let[t,i]=await Promise.all([this.runtime.refresh(),this.listProjects()]);return y(this.withPendingCreations(t).map(e=>E(e,i,this.platform)),e)}async create(e){let t=E(await this.runtime.create(e),await this.listProjects(),this.platform),i=e.projectId?{...t,projectId:e.projectId}:t;return this.pendingCreations.set(i.id,i),i}async fork(e,t){if(!P(e))throw new u.no("Customer Agent sessions do not support native forks","OPERATION_NOT_SUPPORTED");let i=E(t?await this.runtime.fork(e,t):await this.runtime.fork(e),await this.listProjects(),this.platform);return this.pendingCreations.set(i.id,i),i}async delete(e){await this.runtime.delete(e),this.pendingCreations.delete(e)}async get(e,t){let i;try{i=await this.runtime.get(e,t)}catch(s){let i=this.pendingCreations.get(e);if(!i)throw s;return t?{...i,messages:[],events:[],history:{nextCursor:null,hasMore:!1,pageSize:0,totalItems:0}}:{...i,messages:[],events:[]}}return E(i,await this.listProjects(),this.platform)}async getQueryIndex(e){if(this.runtime.getQueryIndex)return this.runtime.getQueryIndex(e);let t=await this.runtime.get(e),{buildSessionQueryIndex:s}=await Promise.resolve().then(i.bind(i,1322));return s(e,t.messages)}getSessionToolResult(e,t){return this.runtime.getSessionToolResult(e,t)}getSessionWatchPath(e){return this.runtime.getSessionWatchPath(e)}run(e,t,i,s,r){return this.runtime.run(e,t,i,s,r)}steer(e,t){return this.runtime.steer(e,t)}abort(e){return this.runtime.abort(e)}async release(e){if(!this.runtime.release)throw new u.no("Native runtime release is unavailable","RUNTIME_UNAVAILABLE");await this.runtime.release(e)}answerQuestion(e,t){return this.runtime.answerQuestion(e,t)}async startRun(e,t,i,s="web",r){if(!this.runtime.startRun)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.startRun(e,t,i,s,r)}async subscribe(e,t,i){if(!this.runtime.subscribe)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.subscribe(e,t,i)}async snapshot(e,t=0){if(!this.runtime.snapshot)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.snapshot(e,t)}async setPermissionMode(e,t){if(!this.runtime.setPermissionMode)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.setPermissionMode(e,t)}async setNativeMode(e,t){if(!this.runtime.setNativeMode)throw new u.no("Native permission presets are unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.setNativeMode(e,t)}async setNativePermissionPreset(e,t){if(!this.runtime.setNativePermissionPreset)throw new u.no("Native permission presets are unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.setNativePermissionPreset(e,t)}async getNativeGoal(e){if(!this.runtime.getNativeGoal)throw new u.no("此运行时未提供原生目标","OPERATION_NOT_SUPPORTED");return this.runtime.getNativeGoal(e)}async mutateNativeGoal(e,t){if(!this.runtime.mutateNativeGoal)throw new u.no("此运行时未提供原生目标","OPERATION_NOT_SUPPORTED");return this.runtime.mutateNativeGoal(e,t)}async handoff(e,t){if(!this.runtime.handoff)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.handoff(e,t)}async getGoals(e,t="web"){if(!this.runtime.getGoals)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.getGoals(e,t)}async enqueueGoal(e,t,i,s="web"){if(!this.runtime.enqueueGoal)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.enqueueGoal(e,t,i,s)}async reorderGoals(e,t){if(!this.runtime.reorderGoals)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.reorderGoals(e,t)}async cancelGoal(e,t){if(!this.runtime.cancelGoal)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.cancelGoal(e,t,"web")}async enqueueMessage(e,t,i="web"){if(!this.runtime.enqueueMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.enqueueMessage(e,t,i)}async reorderMessages(e,t){if(!this.runtime.reorderMessages)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.reorderMessages(e,t)}async updateMessage(e,t,i,s){if(!this.runtime.updateMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.updateMessage(e,t,i,s)}async cancelMessage(e,t){if(!this.runtime.cancelMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.cancelMessage(e,t)}async steerMessage(e,t){if(!this.runtime.steerMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.steerMessage(e,t)}withPendingCreations(e){let t=new Set,i=e.map(e=>{t.add(e.id);let i=this.pendingCreations.get(e.id);return this.pendingCreations.delete(e.id),i?_(e,i):e});return[...[...this.pendingCreations.values()].filter(e=>!t.has(e.id)).sort((e,t)=>t.updated.localeCompare(e.updated)),...i]}}function _(e,t){return{...e,cwd:e.cwd||t.cwd,projectId:e.projectId??t.projectId}}function w(e,t){t.executable?delete process.env[e]:process.env[e]=t.detail}function g(){if(!m.__nativeRuntimeService){!function(){let e=[(0,n.join)((0,r.homedir)(),".local","bin"),"/opt/homebrew/bin","/usr/local/bin"],t=(process.env.PATH??"").split(n.delimiter),i=e.filter(e=>(0,s.existsSync)(e)&&!t.includes(e));i.length>0&&(process.env.PATH=[...t,...i].join(n.delimiter))}();let e=new o.XWE((0,p.kO)());m.__nativeRuntimeService=new f((0,u.v6)({runtimeFactory:e=>{let t=d({name:"codex",environmentVariable:"AGENT_CODEX_BIN",minimumVersion:o.hix}),i=d({name:"opencode",environmentVariable:"AGENT_OPENCODE_BIN"});return process.pid,w("AGENT_CODEX_RUNTIME_ERROR",t),w("AGENT_OPENCODE_RUNTIME_ERROR",i),(0,c.L)().info("native runtime host elected",{pid:process.pid,codex:t.executable??null,codexSource:t.source??null,codexDetail:t.detail,opencode:i.executable??null,opencodeDetail:i.detail}),(0,u.WH)(t.executable??"codex",e,i.executable??"opencode")}}),()=>e.list())}return m.__nativeRuntimeService}function E(e,t,i=process.platform){let{projectId:s,...r}=e;if(!e.cwd)return r;let a=v(e.cwd,i),o="win32"===i?n.win32.sep:n.sep,h=t.filter(e=>e.description).map(e=>({project:e,path:v(e.description,i)})).filter(({path:e})=>a===e||a.startsWith(`${e}${o}`)).sort((e,t)=>t.path.length-e.path.length)[0];return h?{...r,projectId:h.project.id}:r}function v(e,t=process.platform){if("win32"!==t)return(0,n.resolve)(e);let i=n.win32.resolve(e),s=n.win32.parse(i).root;return(i.length>s.length?i.replace(/[\\/]+$/,""):i).toLowerCase()}function y(e,t){return void 0===t?e:e.filter(e=>e.projectId===t)}function P(e){try{return"customer-agent"!==(0,u.Vu)(e).agentType}catch{return!1}}function b(e){if(e instanceof u.no)switch(e.code){case"SESSION_NOT_FOUND":return 404;case"SESSION_OCCUPIED":case"SESSION_ALREADY_RUNNING":case"APPROVAL_EXPIRED":case"CODEX_SESSION_VERSION_INCOMPATIBLE":case"STALE_SESSION_ANCHOR":case"NATIVE_GOAL_CONFLICT":return 409;case"RUNTIME_UNAVAILABLE":return 503;case"OPERATION_NOT_SUPPORTED":return 405;default:return 400}return 500}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var i=e=>t(t.s=e),s=t.X(0,[8375,6244,1322,1773],()=>i(8674));module.exports=s})();
|
|
8
|
+
`))}),o=setInterval(()=>{n||r.enqueue(eP.encode(": keep-alive\n\n"))},15e3);s=()=>{n||(n=!0,clearInterval(o),a(),e.signal.removeEventListener("abort",s))},e.signal.addEventListener("abort",s,{once:!0}),r.enqueue(eP.encode(": connected\n\n"))},cancel(){s()}});return new Response(r,{headers:{"Cache-Control":"no-cache, no-transform",Connection:"keep-alive","Content-Type":"text/event-stream; charset=utf-8","X-Accel-Buffering":"no"}})}catch(e){return Response.json({error:e instanceof Error?e.message:"Internal error"},{status:(0,l.WW)(e)})}}let eR=new r.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/sessions/[id]/changes/route",pathname:"/api/sessions/[id]/changes",filename:"route",bundlePath:"app/api/sessions/[id]/changes/route"},resolvedPagePath:"/private/tmp/agentroam-npm-preview49.GAVmnh/source/packages/server/app/api/sessions/[id]/changes/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:eT,staticGenerationAsyncStorage:eN,serverHooks:eI}=eR,eO="/api/sessions/[id]/changes/route";function eD(){return(0,a.patchFetch)({serverHooks:eI,staticGenerationAsyncStorage:eN})}},7786:(e,t,i)=>{e.exports=i(517)},535:(e,t,i)=>{i.d(t,{L:()=>a});var s=i(1322),r=i(785);let n=!1;function a(){let e=(0,s.Qfc)();if(e)return e;let t=(0,s.qZ_)({dir:(0,r.ME)(),source:"server",minLevel:"info",handlers:{exitOnUncaughtException:!1}});return n||(n=!0,t.info("server logger attached",{dir:t.dir,pid:process.pid})),t}},1614:(e,t,i)=>{i.d(t,{NL:()=>g,V_:()=>P,WW:()=>b});var s=i(7561),r=i(612),n=i(9411),a=i(7718),o=i(1322);function h(e){if(!e.trim())return!1;try{return(0,s.accessSync)(e,s.constants.X_OK),!0}catch{return!1}}function l(e){try{return(0,o.wyD)((0,a.execFileSync)(e,["--version"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","pipe"]}))}catch{return}}function d(e){let t=[],i=process.env[e.environmentVariable]?.trim();if(i){let s=h(i);t.push({source:"pin",path:i,executable:s,version:s?l(i):void 0,error:s?void 0:`${e.environmentVariable} "${i}" is not executable`})}let s=function(e){for(let t of(process.env.PATH??"").split(n.delimiter).filter(Boolean)){let i=(0,n.resolve)(t,e);if(h(i))return i}}(e.name);return s&&s!==i&&t.push({source:"path",path:s,executable:!0,version:l(s)}),(0,o.neJ)(t,{name:e.name,minimumVersion:e.minimumVersion})}var c=i(535),u=i(6279),p=i(785);let m=globalThis;class f{constructor(e,t=async()=>[],i=process.platform){this.runtime=e,this.listProjects=t,this.platform=i,this.pendingCreations=new Map}health(){return this.runtime.health()}listModels(e){return this.runtime.listModels(e)}listWorkspaces(e,t){return this.runtime.listWorkspaces(e,t)}importWorkspace(e,t,i){if(!this.runtime.importWorkspace)throw new u.no("Native workspace import is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.importWorkspace(e,t,i)}async listWorkspaceSessions(e,t,i){let s=await this.runtime.listWorkspaceSessions(e,t,i);if(i?.cursor)return s;let r=new Set(s.data.map(e=>e.id)),n=s.data.map(e=>{let t=this.pendingCreations.get(e.id);return t?(this.pendingCreations.delete(e.id),_(e,t)):e});for(let i of this.pendingCreations.values())i.agentType!==e||i.projectId!==t||r.has(i.id)||n.unshift(i);return{...s,data:n}}async list(e){let[t,i]=await Promise.all([this.runtime.list(),this.listProjects()]);return y(this.withPendingCreations(t).map(e=>E(e,i,this.platform)),e)}async refresh(e){let[t,i]=await Promise.all([this.runtime.refresh(),this.listProjects()]);return y(this.withPendingCreations(t).map(e=>E(e,i,this.platform)),e)}async create(e){let t=E(await this.runtime.create(e),await this.listProjects(),this.platform),i=e.projectId?{...t,projectId:e.projectId}:t;return this.pendingCreations.set(i.id,i),i}async fork(e,t){if(!P(e))throw new u.no("Customer Agent sessions do not support native forks","OPERATION_NOT_SUPPORTED");let i=E(t?await this.runtime.fork(e,t):await this.runtime.fork(e),await this.listProjects(),this.platform);return this.pendingCreations.set(i.id,i),i}async delete(e){await this.runtime.delete(e),this.pendingCreations.delete(e)}async get(e,t){let i;try{i=await this.runtime.get(e,t)}catch(s){let i=this.pendingCreations.get(e);if(!i)throw s;return t?{...i,messages:[],events:[],history:{nextCursor:null,hasMore:!1,pageSize:0,totalItems:0}}:{...i,messages:[],events:[]}}return E(i,await this.listProjects(),this.platform)}async getQueryIndex(e){if(this.runtime.getQueryIndex)return this.runtime.getQueryIndex(e);let t=await this.runtime.get(e),{buildSessionQueryIndex:s}=await Promise.resolve().then(i.bind(i,1322));return s(e,t.messages)}getSessionToolResult(e,t){return this.runtime.getSessionToolResult(e,t)}getSessionWatchPath(e){return this.runtime.getSessionWatchPath(e)}run(e,t,i,s,r){return this.runtime.run(e,t,i,s,r)}steer(e,t){return this.runtime.steer(e,t)}abort(e){return this.runtime.abort(e)}async release(e){if(!this.runtime.release)throw new u.no("Native runtime release is unavailable","RUNTIME_UNAVAILABLE");await this.runtime.release(e)}answerQuestion(e,t){return this.runtime.answerQuestion(e,t)}async startRun(e,t,i,s="web",r){if(!this.runtime.startRun)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.startRun(e,t,i,s,r)}async subscribe(e,t,i){if(!this.runtime.subscribe)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.subscribe(e,t,i)}async snapshot(e,t=0){if(!this.runtime.snapshot)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.snapshot(e,t)}async setPermissionMode(e,t){if(!this.runtime.setPermissionMode)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.setPermissionMode(e,t)}async setNativeMode(e,t){if(!this.runtime.setNativeMode)throw new u.no("Native permission presets are unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.setNativeMode(e,t)}async setNativePermissionPreset(e,t){if(!this.runtime.setNativePermissionPreset)throw new u.no("Native permission presets are unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.setNativePermissionPreset(e,t)}async getNativeGoal(e){if(!this.runtime.getNativeGoal)throw new u.no("此运行时未提供原生目标","OPERATION_NOT_SUPPORTED");return this.runtime.getNativeGoal(e)}async mutateNativeGoal(e,t){if(!this.runtime.mutateNativeGoal)throw new u.no("此运行时未提供原生目标","OPERATION_NOT_SUPPORTED");return this.runtime.mutateNativeGoal(e,t)}async handoff(e,t){if(!this.runtime.handoff)throw new u.no("Native runtime broker is unavailable","RUNTIME_UNAVAILABLE");return this.runtime.handoff(e,t)}async getGoals(e,t="web"){if(!this.runtime.getGoals)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.getGoals(e,t)}async enqueueGoal(e,t,i,s="web"){if(!this.runtime.enqueueGoal)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.enqueueGoal(e,t,i,s)}async reorderGoals(e,t){if(!this.runtime.reorderGoals)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.reorderGoals(e,t)}async cancelGoal(e,t){if(!this.runtime.cancelGoal)throw new u.no("Goal mode is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.cancelGoal(e,t,"web")}async enqueueMessage(e,t,i="web"){if(!this.runtime.enqueueMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.enqueueMessage(e,t,i)}async reorderMessages(e,t){if(!this.runtime.reorderMessages)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.reorderMessages(e,t)}async updateMessage(e,t,i,s){if(!this.runtime.updateMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.updateMessage(e,t,i,s)}async cancelMessage(e,t){if(!this.runtime.cancelMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.cancelMessage(e,t)}async steerMessage(e,t){if(!this.runtime.steerMessage)throw new u.no("Message queue is unavailable","OPERATION_NOT_SUPPORTED");return this.runtime.steerMessage(e,t)}withPendingCreations(e){let t=new Set,i=e.map(e=>{t.add(e.id);let i=this.pendingCreations.get(e.id);return this.pendingCreations.delete(e.id),i?_(e,i):e});return[...[...this.pendingCreations.values()].filter(e=>!t.has(e.id)).sort((e,t)=>t.updated.localeCompare(e.updated)),...i]}}function _(e,t){return{...e,cwd:e.cwd||t.cwd,projectId:e.projectId??t.projectId}}function w(e,t){t.executable?delete process.env[e]:process.env[e]=t.detail}function g(){if(!m.__nativeRuntimeService){!function(){let e=[(0,n.join)((0,r.homedir)(),".local","bin"),"/opt/homebrew/bin","/usr/local/bin"],t=(process.env.PATH??"").split(n.delimiter),i=e.filter(e=>(0,s.existsSync)(e)&&!t.includes(e));i.length>0&&(process.env.PATH=[...t,...i].join(n.delimiter))}();let e=new o.XWE((0,p.kO)());m.__nativeRuntimeService=new f((0,u.v6)({runtimeFactory:e=>{let t=d({name:"codex",environmentVariable:"AGENT_CODEX_BIN",minimumVersion:o.hix}),i=d({name:"opencode",environmentVariable:"AGENT_OPENCODE_BIN"});return process.pid,w("AGENT_CODEX_RUNTIME_ERROR",t),w("AGENT_OPENCODE_RUNTIME_ERROR",i),(0,c.L)().info("native runtime host elected",{pid:process.pid,codex:t.executable??null,codexSource:t.source??null,codexDetail:t.detail,opencode:i.executable??null,opencodeDetail:i.detail}),(0,u.WH)(t.executable??"codex",e,i.executable??"opencode")}}),()=>e.list())}return m.__nativeRuntimeService}function E(e,t,i=process.platform){let{projectId:s,...r}=e;if(!e.cwd)return r;let a=v(e.cwd,i),o="win32"===i?n.win32.sep:n.sep,h=t.filter(e=>e.description).map(e=>({project:e,path:v(e.description,i)})).filter(({path:e})=>a===e||a.startsWith(`${e}${o}`)).sort((e,t)=>t.path.length-e.path.length)[0];return h?{...r,projectId:h.project.id}:r}function v(e,t=process.platform){if("win32"!==t)return(0,n.resolve)(e);let i=n.win32.resolve(e),s=n.win32.parse(i).root;return(i.length>s.length?i.replace(/[\\/]+$/,""):i).toLowerCase()}function y(e,t){return void 0===t?e:e.filter(e=>e.projectId===t)}function P(e){try{return"customer-agent"!==(0,u.Vu)(e).agentType}catch{return!1}}function b(e){if(e instanceof u.no)switch(e.code){case"SESSION_NOT_FOUND":return 404;case"SESSION_OCCUPIED":case"SESSION_ALREADY_RUNNING":case"APPROVAL_EXPIRED":case"CODEX_SESSION_VERSION_INCOMPATIBLE":case"STALE_SESSION_ANCHOR":case"NATIVE_GOAL_CONFLICT":return 409;case"RUNTIME_UNAVAILABLE":return 503;case"OPERATION_NOT_SUPPORTED":return 405;default:return 400}return 500}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var i=e=>t(t.s=e),s=t.X(0,[8375,6244,1322,1773],()=>i(7227));module.exports=s})();
|