dorkos 0.115.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +130 -69
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-Cz8ijNrK.js → AboutPage-KW-6Y7Wm.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BzmfwxSZ.js → ActivityErrorState-C5xbcrFo.js} +1 -1
- package/dist/client/assets/{ActivityPage-BK7T3OiI.js → ActivityPage-DIeicP6l.js} +1 -1
- package/dist/client/assets/{ActivityRow-Ig5atv15.js → ActivityRow-Drxrnyea.js} +1 -1
- package/dist/client/assets/{AdapterIcon-BXPv5J8h.js → AdapterIcon-BEuzKbC6.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-BEziztL3.js → AdapterSetupWizard-z_agWfDl.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-BqFQvFeN.js → AgentOptionRow-DEwQwnKr.js} +1 -1
- package/dist/client/assets/{AgentPicker-dCfEIsU-.js → AgentPicker-CmyF25Oi.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BAhfGJxx.js → AgentRequestCard-BWtE34Nr.js} +3 -3
- package/dist/client/assets/{AppearancePage-7qHhFeEv.js → AppearancePage-BJO-Q3a4.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-jqOFh0d1.js → ApplyToOverridesDialog-CsmbPbTh.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-3CgglXkd.js → AttentionSignalRow-2-aDCEdR.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMKtHI0D.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CL7e4dO8.js} +1 -1
- package/dist/client/assets/{BindingDialog-DSBxRyzA.js → BindingDialog-CirNTa_m.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-CyRuqAJV.js → BlintzCanvas-bfmQpoVE.js} +1 -1
- package/dist/client/assets/{CanvasCsvContent-Bd1c6TGx.js → CanvasCsvContent-x86ueAZo.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-DelYwSH8.js → CanvasFileContent-DIQbKII9.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-BExIu4RY.js → CanvasModel3dContent-DTAWG8IS.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-SWemSaUp.js → ChatAppsOff-BQiTfHe3.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-0WF4ITRZ.js → CodeMirrorDiff-DhNTAsQl.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-Bg7wC_Q8.js → CodeMirrorEditor-BpIF0kLM.js} +1 -1
- package/dist/client/assets/{CommitmentList-CTvEGUV3.js → CommitmentList-B-B3E6yN.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-C68etoLe.js → CommitmentsPage-BNoKIW7z.js} +1 -1
- package/dist/client/assets/ComputerResourceView-NMA65a8a.js +6 -0
- package/dist/client/assets/ComputerViewer-BjU1hfpc.js +1 -0
- package/dist/client/assets/{ConnectionAccessLists-9oeVn_GK.js → ConnectionAccessLists-Iy_T25Rw.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CJOY4-kp.js → ConnectionsPage-DPfoPshS.js} +2 -2
- package/dist/client/assets/{ConventionPage-DD-f5o6y.js → ConventionPage-CoLB6WVs.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-C6fW17AG.js → ExtensionPageRoute-Y_Na63mr.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-Zccd0fv6.js → FloatingTanStackRouterDevtools-CqogiFob-DCj2Id-d.js} +1 -1
- package/dist/client/assets/HandlePage-WyPrFOtj.js +1 -0
- package/dist/client/assets/{HeartbeatPage-cJM6NuTD.js → HeartbeatPage-zzL8W_zA.js} +1 -1
- package/dist/client/assets/{KeyEntry-K5k_3TfU.js → KeyEntry-DCATqdIG.js} +2 -2
- package/dist/client/assets/{LexicalField-DB5V20zv.js → LexicalField-B7d9UWFk.js} +1 -1
- package/dist/client/assets/{ManagesPage-Cj0-hwfr.js → ManagesPage-CKTb1w3G.js} +1 -1
- package/dist/client/assets/{Marketplace-eWEtLmd9.js → Marketplace-Deq-aTM6.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-B1h70C20.js → MarketplaceSourcesView-B2qLtCVG.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BaJ_r-QR.js → McpAppFrame-BKgYSUH-.js} +1 -1
- package/dist/client/assets/{McpSigninBody-Coaq5Fkf.js → McpSigninBody-Begd1UNn.js} +1 -1
- package/dist/client/assets/{Model3dViewer-cKa-Jnbl.js → Model3dViewer-CK6siI6q.js} +1 -1
- package/dist/client/assets/NamePage-DxDcIFAo.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-C4zNIv9x.js → NewDirectMessageMenu-D4ORE1Lo.js} +1 -1
- package/dist/client/assets/{NotificationsPage-gKNClvNU.js → NotificationsPage-CjRyxKXv.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-RzB2u6-Q.js → OpenMeshSwitch-C0C-f-dF.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-B_78Vqh8.js → OperatorIdentityForm-I9zvI2go.js} +1 -1
- package/dist/client/assets/{PermissionHistory-DrtlA4YM.js → PermissionHistory-C9vTiyw5.js} +1 -1
- package/dist/client/assets/{PermissionsPage-O7kUVaQv.js → PermissionsPage-BR9LM1Bo.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DiNuuoWu.js → PersonalityPopover-BhFUSfRe.js} +1 -1
- package/dist/client/assets/PhotoPage-C4OhoBR2.js +1 -0
- package/dist/client/assets/{PresetPicker-BUFwg8RS.js → PresetPicker-CpTnkeZt.js} +3 -3
- package/dist/client/assets/{PreviewRefusedNotice-DXZp669C.js → PreviewRefusedNotice-R5LB9PuV.js} +1 -1
- package/dist/client/assets/{ProfileFields-BCfMzNcT.js → ProfileFields-8fFud5gT.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-BzC2MGdi.js → ProfilePanelContainer-BJFOrUov.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-f0FKXLtu.js → ProfileRolePicker-C8hpW08c.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-EgeMFibt.js → PromptSuggestionChips-1su17rvx.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-CQ4Xxslu.js → ReportsToPopover-7H3_8Brz.js} +1 -1
- package/dist/client/assets/{RoomSurface-oDbc6jnO.js → RoomSurface-BkoesTVz.js} +5 -5
- package/dist/client/assets/{RoomsPage-D_EbiSZ3.js → RoomsPage-BrMOJQpt.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-LtmmbIsD.js → RunsOnPopover-BB7T1Zln.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-Kv2ytk2m.js → RuntimeConnectFlow-oHwqp_fn.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-CiWxlcPc.js → RuntimeSetupDialog-BTT2-FM8.js} +1 -1
- package/dist/client/assets/{SessionsPage-1rDO0SGV.js → SessionsPage-PpKG9Phd.js} +1 -1
- package/dist/client/assets/{SettingsDialog-_ctp2AfE.js → SettingsDialog-Dxtq0E9R.js} +4 -4
- package/dist/client/assets/{SkillsPage-gPuQHKps.js → SkillsPage-CzzuhGH2.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-BPFpCgsN.js → TaskDialogWrapper-DWVo-1P7.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-D0Jlzmed.js → TasksEmptyState-DfR9p54p.js} +2 -2
- package/dist/client/assets/{TasksPage-DvGfg5Bk.js → TasksPage-5_XngIV9.js} +1 -1
- package/dist/client/assets/TeamComputerEntry-BE_gamkp.js +1 -0
- package/dist/client/assets/{ToolsPage-B0qZ85pR.js → ToolsPage-CefworrO.js} +2 -2
- package/dist/client/assets/{TopologyGraph-q1ammgpG.js → TopologyGraph-C1DaL02H.js} +2 -2
- package/dist/client/assets/{TourHost-Dc8qw1Ef.js → TourHost-pT1tIPF7.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DXdrLsGV.js → UnlinkDialog-oMOr8e6G.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-ChDNC060.js → WidgetErrorCard-CBFo1SMe.js} +7 -7
- package/dist/client/assets/_shell-BiAMGu0F.js +90 -0
- package/dist/client/assets/{_shell._home-DjGunhLV.js → _shell._home-Cx7ZsoQO.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-B014dET1.js → _shell._home.activity-C3fnNXgc.js} +1 -1
- package/dist/client/assets/{_shell._home.index-DEmtTHZg.js → _shell._home.index-CixksaeD.js} +2 -2
- package/dist/client/assets/{_shell._home.tasks-CnDEbUOd.js → _shell._home.tasks-DZWUHfK_.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-AQtMUWuu.js → _shell._home.workspaces-y-DAPB_X.js} +1 -1
- package/dist/client/assets/{_shell.channels-C8NOhmJd.js → _shell.channels-DEErD0f0.js} +4 -4
- package/dist/client/assets/{_shell.connections-Bxe0wxOB.js → _shell.connections-B36f6FWi.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-C6ku9F5_.js → _shell.feedback-requests-B0QiSuDC.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CardBSA_.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-CVK8YKDA.js +1 -0
- package/dist/client/assets/{_shell.session-Dn0C0mEZ.js → _shell.session-Cl7qfi1Z.js} +3 -3
- package/dist/client/assets/_shell.team-DIdgc_vn.js +28 -0
- package/dist/client/assets/_shell.x._extensionId-BEPW8hvh.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-BEPW8hvh.js +1 -0
- package/dist/client/assets/{access-copy-CBGtcTk0.js → access-copy-CE5oc1d9.js} +1 -1
- package/dist/client/assets/{agent-browser-DbcLtsAx.js → agent-browser-DV76U8Ny.js} +1 -1
- package/dist/client/assets/{banner-rPsz3suJ.js → banner-DIVQNO0O.js} +1 -1
- package/dist/client/assets/{card-BqN3lfJn.js → card-DVdPY08b.js} +1 -1
- package/dist/client/assets/{command-ZTLTCj0l.js → command-BhZ8sKG4.js} +1 -1
- package/dist/client/assets/{cpu-D70xMHl2.js → cpu-CtmIFRqs.js} +1 -1
- package/dist/client/assets/{empty-state-yl1dLwLN.js → empty-state-DHuumxZB.js} +1 -1
- package/dist/client/assets/{execution-config-BbBEe6FO.js → execution-config-JdnxoV1P.js} +1 -1
- package/dist/client/assets/{file-CGg2M6ED.js → file-Bc34j1rj.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DZrVsShR.js → file-exclamation-point-dxJUSR3k.js} +1 -1
- package/dist/client/assets/{file-text-BYq_4IAt.js → file-text-BNSVr0Hh.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CWs9nr10.js → find-latest-widget-fence-oI6Sl7rV.js} +1 -1
- package/dist/client/assets/{form-vPuXuaYT.js → form-FbjLEM3I.js} +1 -1
- package/dist/client/assets/{format-cron-D02Tnupo.js → format-cron-BaE7qyNN.js} +1 -1
- package/dist/client/assets/{git-branch-DbjXDO_F.js → git-branch-BBKObhlk.js} +1 -1
- package/dist/client/assets/{heart-Dblp_miM.js → heart-BdbxexAy.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CaMXMak-.js → highlighted-body-KPVGNVTW-R3x8mG02.js} +1 -1
- package/dist/client/assets/{index-vRc1D4KI.js → index-0AgY877T.js} +1 -1
- package/dist/client/assets/{index-D16KF-iC.js → index-1-RB7sXm.js} +3 -3
- package/dist/client/assets/{index-BW98owO8.js → index-4irOzx9Q.js} +1 -1
- package/dist/client/assets/{index-P5j6zmcN.js → index-6ZmBCm_d.js} +1 -1
- package/dist/client/assets/{index-DzeYt-GT.js → index-7xf1fyHe.js} +1 -1
- package/dist/client/assets/{index-BxqUb-n7.js → index-BCT0tkN4.js} +1 -1
- package/dist/client/assets/{index-BKuzoeSn.js → index-BFh_VGhh.js} +1 -1
- package/dist/client/assets/{index-B-WvQ24u.js → index-BKnIV8YQ.js} +6 -6
- package/dist/client/assets/{index-D6m2SWHr.js → index-BQgJVNUB.js} +1 -1
- package/dist/client/assets/{index-BiIbMZ6d.js → index-BV0RP90y.js} +1 -1
- package/dist/client/assets/{index-BV0tZnYg.js → index-BWHsw5Qn.js} +1 -1
- package/dist/client/assets/{index-CMWMhbec.js → index-BbUZazTt.js} +1 -1
- package/dist/client/assets/{index-CWNsRK97.js → index-BcPMhqQ_.js} +1 -1
- package/dist/client/assets/{index-DwUdUliR.js → index-BeKz0Z7i.js} +1 -1
- package/dist/client/assets/index-C481yCZ2.js +1 -0
- package/dist/client/assets/{index-Db2EOzA3.js → index-C4vL5hUU.js} +1 -1
- package/dist/client/assets/{index-DDYi817r.js → index-C5n3OkTH.js} +1 -1
- package/dist/client/assets/{index-Z8YcKwIB.js → index-C76UofV4.js} +1 -1
- package/dist/client/assets/index-CB-aY4BF.js +1 -0
- package/dist/client/assets/{index-CN9fywRC.js → index-CDx26Vyr.js} +1 -1
- package/dist/client/assets/{index-Dg_bax15.js → index-CJW9tZhq.js} +5 -5
- package/dist/client/assets/{index-BPwUl0Bz.js → index-CJw16oEF.js} +1 -1
- package/dist/client/assets/{index-CaLw69VE.js → index-C_Pquyu-.js} +1 -1
- package/dist/client/assets/{index-Gq3gqBhY.js → index-CpAdYUxX.js} +1 -1
- package/dist/client/assets/{index-XE46wAj9.js → index-D1bAoT3D.js} +1 -1
- package/dist/client/assets/{index-Bd23EYYT.js → index-D7MytHQN.js} +2 -2
- package/dist/client/assets/index-DKubbEZd.css +1 -0
- package/dist/client/assets/{index-BOL391En.js → index-DShpGK7T.js} +1 -1
- package/dist/client/assets/{index-C88NZagl.js → index-DlWFe9SD.js} +1 -1
- package/dist/client/assets/{index-oWLYcpm4.js → index-DluIa1Dv.js} +1 -1
- package/dist/client/assets/index-Dm1Ngy2r.js +38 -0
- package/dist/client/assets/{index-CdKpQ1hI.js → index-DxTOTFWT.js} +280 -280
- package/dist/client/assets/{index-lNMJBFB0.js → index-DzRQN8yx.js} +1 -1
- package/dist/client/assets/index-Fl8NxGfN.js +119 -0
- package/dist/client/assets/{index-CrK4rKAq.js → index-fe27h49h.js} +1 -1
- package/dist/client/assets/{index-DdbHrvr0.js → index-hIJdyL6m.js} +1 -1
- package/dist/client/assets/{index-BPqkuMIa.js → index-hLWqos0I.js} +1 -1
- package/dist/client/assets/{index-CRZXSh_q.js → index-pKhRsSRA.js} +1 -1
- package/dist/client/assets/{index-CHvi6xUU.js → index-sRPmoNhi.js} +1 -1
- package/dist/client/assets/{index-BdVOtoFr.js → index-tPf4Bia7.js} +1 -1
- package/dist/client/assets/{index-Bi7Um5RU.js → index-vHt--4jg.js} +1 -1
- package/dist/client/assets/{inline-code-Cvn43Gqu.js → inline-code-CrAiSiKW.js} +1 -1
- package/dist/client/assets/{layers-Bmz62WF4.js → layers-QYiauDIw.js} +1 -1
- package/dist/client/assets/{lightbulb-CAd6slmc.js → lightbulb-Dc3wEED9.js} +1 -1
- package/dist/client/assets/{link-2-C0mn8T24.js → link-2-BUnfBMCd.js} +1 -1
- package/dist/client/assets/{list-runtime-types-DxwGcKLx.js → list-runtime-types-H-N7VUS4.js} +1 -1
- package/dist/client/assets/{markdown-content-1-B7PdbY.js → markdown-content-fIydDTfa.js} +1 -1
- package/dist/client/assets/{mention-pill-D_-KXznh.js → mention-pill-CONiQ9Xs.js} +1 -1
- package/dist/client/assets/{message-square-off-Di7kQvfe.js → message-square-off-BMD4bxOr.js} +1 -1
- package/dist/client/assets/{more-details-C6UGVeDE.js → more-details-DMD6Pqb5.js} +1 -1
- package/dist/client/assets/{owner-notice-CudDDBX4.js → owner-notice-BRcpYvJk.js} +1 -1
- package/dist/client/assets/{package-D2eMoFCI.js → package-CGgpgsfC.js} +1 -1
- package/dist/client/assets/{page-container-CDHAACRA.js → page-container-uyGtbP6Z.js} +1 -1
- package/dist/client/assets/{paperclip-p0W24D54.js → paperclip-CUxIVlMU.js} +1 -1
- package/dist/client/assets/{path-input-j04LMj9z.js → path-input-CeMu6ytc.js} +1 -1
- package/dist/client/assets/{primer-trigger-DkCcHf2Q.js → primer-trigger-x8IfRd6U.js} +2 -2
- package/dist/client/assets/{profile-errors-CqflLCzu.js → profile-errors-DyrpY2ry.js} +1 -1
- package/dist/client/assets/{progress-BcuH4Eod.js → progress-2cuTo9I-.js} +1 -1
- package/dist/client/assets/{query-error-state-CEZs7dhg.js → query-error-state-Cq1O4FGq.js} +1 -1
- package/dist/client/assets/{radio-DGWfQ5Rf.js → radio-H5ktIFzD.js} +1 -1
- package/dist/client/assets/registry-DNRE0Em-.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-y0nd8fzi.js → relay-trace-schemas-Crc4Iceb.js} +2 -2
- package/dist/client/assets/{room-files-source-C1TCg4W_.js → room-files-source-thCvGi0E.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-DcBojy-0.js → rotate-ccw-clock-DKP7zbQr.js} +1 -1
- package/dist/client/assets/{rotate-cw-D0vUyeR2.js → rotate-cw-Cwv_uaU3.js} +1 -1
- package/dist/client/assets/{scroll-area-CQ9lO56h.js → scroll-area-CaJ1TwhG.js} +1 -1
- package/dist/client/assets/{search-x-EJGj73JB.js → search-x-D-Un20jR.js} +2 -2
- package/dist/client/assets/{shield-check-Bp58y9u7.js → shield-check-CMhrOu-d.js} +1 -1
- package/dist/client/assets/{shield-x-jF_NCCvp.js → shield-x-DlaUufPM.js} +1 -1
- package/dist/client/assets/{soul-file-Cag2i87x.js → soul-file-C5-nKCwV.js} +1 -1
- package/dist/client/assets/{table-D89CWVJX.js → table-C7pi-jkJ.js} +1 -1
- package/dist/client/assets/{terminal-BUhNMZAt.js → terminal-IYkyS2eR.js} +1 -1
- package/dist/client/assets/{trust-posture-15DMDZTA.js → trust-posture-BxFTuKAo.js} +1 -1
- package/dist/client/assets/{unplug-opnrSXAi.js → unplug-Bv5BESa4.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-DHM5Coia.js → unverified-catalog-notice-B9dzvyVq.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-ClMqVelU.js → use-adapter-catalog-DDD8zCQo.js} +1 -1
- package/dist/client/assets/{use-bindings-Ch6UUBvz.js → use-bindings-BXHWfTB2.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-Qn7KRpYe.js → use-composer-prefs-DG8dQD3D.js} +1 -1
- package/dist/client/assets/{use-connector-management-dX_4x0d3.js → use-connector-management-l6Ii6UIU.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-BV2fY4gy.js → use-deep-link-scroll-CPgyWLMM.js} +1 -1
- package/dist/client/assets/{use-delete-binding-BklxjB_c.js → use-delete-binding-NPl-TzUw.js} +1 -1
- package/dist/client/assets/{use-dev-links-D4Bqam6F.js → use-dev-links-DYaUSRn0.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-nHiD8BKZ.js → use-external-adapter-catalog-BrmKSNvG.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-vYU7wQWT.js → use-full-activity-feed-CEvmRK6d.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-Cx2BL1BK.js +1 -0
- package/dist/client/assets/{use-jump-back-in-BVunjzyr.js → use-jump-back-in-BMgpYhK-.js} +2 -2
- package/dist/client/assets/{use-mesh-topology-NaUKSKol.js → use-mesh-topology-D82_pOi9.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-BWpQ8f91.js → use-mounted-ref-Bs5osknq.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-qO1zRRFN.js → use-notification-prefs-Bpzt57w3.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-Db6p2vLD.js → use-panel-tab-placements-COBgt4Uh.js} +1 -1
- package/dist/client/assets/use-pending-read-DpJbidPK.js +1 -0
- package/dist/client/assets/{use-personality-commit-DUEKxHt_.js → use-personality-commit-D8Fqsrzc.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CnGaw39P.js → use-promo-activation-sHnkQjl-.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-bkSHhGhj.js → use-promo-dismissals-BW_429t4.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-Oc_1gs-Y.js → use-pulse-freshness-BkYMwuUb.js} +1 -1
- package/dist/client/assets/{use-relay-config-Ba-S4wxY.js → use-relay-config-CsB8Q0cK.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DqE5b95Z.js → use-room-follow-claim-DqvqzwBA.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-DnMqliqf.js → use-roving-tab-list-iDj1p8tT.js} +1 -1
- package/dist/client/assets/{use-session-canvas-OdljtBE8.js → use-session-canvas-DrKA7UHs.js} +4 -4
- package/dist/client/assets/{use-session-diagnostics-CtjxsM8_.js → use-session-diagnostics-D6wJVzUG.js} +2 -2
- package/dist/client/assets/{use-unclaimed-chats-5RCD5wIp.js → use-unclaimed-chats-bLDQhIiU.js} +1 -1
- package/dist/client/assets/use-update-config-Dk0MthxZ.js +1 -0
- package/dist/client/assets/{useMutationState-Mjr_y4xX.js → useMutationState-eZMPCch6.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/extension-child.cjs +772 -36
- package/dist/server/index.js +5533 -4697
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -5
- package/dist/client/assets/HandlePage-DOxlquWl.js +0 -1
- package/dist/client/assets/NamePage-W7Frb1yy.js +0 -1
- package/dist/client/assets/PhotoPage-DdBke3yj.js +0 -1
- package/dist/client/assets/_shell-BxPza3Lx.js +0 -88
- package/dist/client/assets/_shell.marketplace-CEnzWFmI.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-BZq1d2ih.js +0 -1
- package/dist/client/assets/_shell.team-DoLdOMoC.js +0 -28
- package/dist/client/assets/_shell.x._extensionId-DhE3OYMF.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DhE3OYMF.js +0 -1
- package/dist/client/assets/index-BzczIyv5.js +0 -119
- package/dist/client/assets/index-C6NUjpzQ.js +0 -38
- package/dist/client/assets/index-O_HMols_.js +0 -1
- package/dist/client/assets/index-kktlr1TJ.css +0 -1
- package/dist/client/assets/registry-ChxwU0f4.js +0 -1
- package/dist/client/assets/use-is-below-desktop-G-mTu2Ga.js +0 -1
- package/dist/client/assets/use-pending-read-DUqJZUza.js +0 -1
- package/dist/client/assets/use-update-config-xkznZMHr.js +0 -1
|
@@ -19133,14 +19133,14 @@ var require_etag = __commonJS({
|
|
|
19133
19133
|
"../../node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js"(exports2, module2) {
|
|
19134
19134
|
"use strict";
|
|
19135
19135
|
module2.exports = etag;
|
|
19136
|
-
var
|
|
19136
|
+
var crypto2 = require("crypto");
|
|
19137
19137
|
var Stats = require("fs").Stats;
|
|
19138
19138
|
var toString = Object.prototype.toString;
|
|
19139
19139
|
function entitytag(entity) {
|
|
19140
19140
|
if (entity.length === 0) {
|
|
19141
19141
|
return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';
|
|
19142
19142
|
}
|
|
19143
|
-
var hash2 =
|
|
19143
|
+
var hash2 = crypto2.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
|
|
19144
19144
|
var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length;
|
|
19145
19145
|
return '"' + len.toString(16) + "-" + hash2 + '"';
|
|
19146
19146
|
}
|
|
@@ -20202,9 +20202,9 @@ var require_once = __commonJS({
|
|
|
20202
20202
|
// ../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js
|
|
20203
20203
|
var require_is_promise = __commonJS({
|
|
20204
20204
|
"../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js"(exports2, module2) {
|
|
20205
|
-
module2.exports =
|
|
20206
|
-
module2.exports.default =
|
|
20207
|
-
function
|
|
20205
|
+
module2.exports = isPromise2;
|
|
20206
|
+
module2.exports.default = isPromise2;
|
|
20207
|
+
function isPromise2(obj) {
|
|
20208
20208
|
return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
|
|
20209
20209
|
}
|
|
20210
20210
|
}
|
|
@@ -20583,7 +20583,7 @@ var require_dist2 = __commonJS({
|
|
|
20583
20583
|
var require_layer = __commonJS({
|
|
20584
20584
|
"../../node_modules/.pnpm/router@2.2.0/node_modules/router/lib/layer.js"(exports2, module2) {
|
|
20585
20585
|
"use strict";
|
|
20586
|
-
var
|
|
20586
|
+
var isPromise2 = require_is_promise();
|
|
20587
20587
|
var pathRegexp = require_dist2();
|
|
20588
20588
|
var debug = require_src()("router:layer");
|
|
20589
20589
|
var deprecate = require_depd()("router");
|
|
@@ -20649,7 +20649,7 @@ var require_layer = __commonJS({
|
|
|
20649
20649
|
}
|
|
20650
20650
|
try {
|
|
20651
20651
|
const ret = fn(error62, req, res, next);
|
|
20652
|
-
if (
|
|
20652
|
+
if (isPromise2(ret)) {
|
|
20653
20653
|
if (!(ret instanceof Promise)) {
|
|
20654
20654
|
deprecate("handlers that are Promise-like are deprecated, use a native Promise instead");
|
|
20655
20655
|
}
|
|
@@ -20668,7 +20668,7 @@ var require_layer = __commonJS({
|
|
|
20668
20668
|
}
|
|
20669
20669
|
try {
|
|
20670
20670
|
const ret = fn(req, res, next);
|
|
20671
|
-
if (
|
|
20671
|
+
if (isPromise2(ret)) {
|
|
20672
20672
|
if (!(ret instanceof Promise)) {
|
|
20673
20673
|
deprecate("handlers that are Promise-like are deprecated, use a native Promise instead");
|
|
20674
20674
|
}
|
|
@@ -20853,7 +20853,7 @@ var require_route = __commonJS({
|
|
|
20853
20853
|
var require_router = __commonJS({
|
|
20854
20854
|
"../../node_modules/.pnpm/router@2.2.0/node_modules/router/index.js"(exports2, module2) {
|
|
20855
20855
|
"use strict";
|
|
20856
|
-
var
|
|
20856
|
+
var isPromise2 = require_is_promise();
|
|
20857
20857
|
var Layer = require_layer();
|
|
20858
20858
|
var { METHODS } = require("node:http");
|
|
20859
20859
|
var parseUrl = require_parseurl();
|
|
@@ -21187,7 +21187,7 @@ var require_router = __commonJS({
|
|
|
21187
21187
|
if (!fn) return param();
|
|
21188
21188
|
try {
|
|
21189
21189
|
const ret = fn(req, res, paramCallback, paramVal, key);
|
|
21190
|
-
if (
|
|
21190
|
+
if (isPromise2(ret)) {
|
|
21191
21191
|
if (!(ret instanceof Promise)) {
|
|
21192
21192
|
deprecate("parameters that are Promise-like are deprecated, use a native Promise instead");
|
|
21193
21193
|
}
|
|
@@ -22569,17 +22569,17 @@ var require_content_disposition = __commonJS({
|
|
|
22569
22569
|
// ../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js
|
|
22570
22570
|
var require_cookie_signature = __commonJS({
|
|
22571
22571
|
"../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js"(exports2) {
|
|
22572
|
-
var
|
|
22572
|
+
var crypto2 = require("crypto");
|
|
22573
22573
|
exports2.sign = function(val, secret) {
|
|
22574
22574
|
if ("string" != typeof val) throw new TypeError("Cookie value must be provided as a string.");
|
|
22575
22575
|
if (null == secret) throw new TypeError("Secret key must be provided.");
|
|
22576
|
-
return val + "." +
|
|
22576
|
+
return val + "." + crypto2.createHmac("sha256", secret).update(val).digest("base64").replace(/\=+$/, "");
|
|
22577
22577
|
};
|
|
22578
22578
|
exports2.unsign = function(input2, secret) {
|
|
22579
22579
|
if ("string" != typeof input2) throw new TypeError("Signed cookie string must be provided.");
|
|
22580
22580
|
if (null == secret) throw new TypeError("Secret key must be provided.");
|
|
22581
22581
|
var tentativeValue = input2.slice(0, input2.lastIndexOf(".")), expectedInput = exports2.sign(tentativeValue, secret), expectedBuffer = Buffer.from(expectedInput), inputBuffer = Buffer.from(input2);
|
|
22582
|
-
return expectedBuffer.length === inputBuffer.length &&
|
|
22582
|
+
return expectedBuffer.length === inputBuffer.length && crypto2.timingSafeEqual(expectedBuffer, inputBuffer) ? tentativeValue : false;
|
|
22583
22583
|
};
|
|
22584
22584
|
}
|
|
22585
22585
|
});
|
|
@@ -44341,7 +44341,9 @@ __export(server_extension_api_exports, {
|
|
|
44341
44341
|
InboxLimitError: () => InboxLimitError,
|
|
44342
44342
|
InboxLinkError: () => InboxLinkError,
|
|
44343
44343
|
StartWorkError: () => StartWorkError,
|
|
44344
|
+
checkPerson: () => checkPerson,
|
|
44344
44345
|
readRegisterResult: () => readRegisterResult,
|
|
44346
|
+
requirePerson: () => requirePerson,
|
|
44345
44347
|
serverEntryRegister: () => serverEntryRegister
|
|
44346
44348
|
});
|
|
44347
44349
|
|
|
@@ -44367,7 +44369,7 @@ function serverEntryRegister(exported) {
|
|
|
44367
44369
|
const candidate = exported && typeof exported === "object" && "default" in exported ? exported.default : exported;
|
|
44368
44370
|
if (typeof candidate === "function") return candidate;
|
|
44369
44371
|
if (hasFetch(candidate)) {
|
|
44370
|
-
return () => ({ fetch: (request) => candidate.fetch(request) });
|
|
44372
|
+
return () => ({ fetch: (request, caller) => candidate.fetch(request, caller) });
|
|
44371
44373
|
}
|
|
44372
44374
|
return null;
|
|
44373
44375
|
}
|
|
@@ -44383,12 +44385,42 @@ function readRegisterResult(result) {
|
|
|
44383
44385
|
}
|
|
44384
44386
|
return {
|
|
44385
44387
|
cleanup: cleanup ? () => cleanup.call(result) : null,
|
|
44386
|
-
fetch: fetch ? (request) => fetch.call(result, request) : null
|
|
44388
|
+
fetch: fetch ? (request, caller) => fetch.call(result, request, caller) : null
|
|
44387
44389
|
};
|
|
44388
44390
|
}
|
|
44389
44391
|
function hasFetch(value) {
|
|
44390
44392
|
return !!value && typeof value === "object" && typeof value.fetch === "function";
|
|
44391
44393
|
}
|
|
44394
|
+
var UNKNOWN_CALLER = {
|
|
44395
|
+
ok: false,
|
|
44396
|
+
status: 403,
|
|
44397
|
+
body: {
|
|
44398
|
+
error: "Only a person can do this.",
|
|
44399
|
+
code: "extension_person_required",
|
|
44400
|
+
message: "DorkOS changed nothing. Only a person can do this. Ask them to do it in DorkOS."
|
|
44401
|
+
}
|
|
44402
|
+
};
|
|
44403
|
+
function checkPerson(caller) {
|
|
44404
|
+
const person = caller?.person;
|
|
44405
|
+
const check2 = isPersonCheck(person) ? person : UNKNOWN_CALLER;
|
|
44406
|
+
if (check2.ok) return null;
|
|
44407
|
+
return Response.json(check2.body, { status: check2.status });
|
|
44408
|
+
}
|
|
44409
|
+
function requirePerson() {
|
|
44410
|
+
return async (c, next) => {
|
|
44411
|
+
const refused = checkPerson(c.env);
|
|
44412
|
+
if (refused) return refused;
|
|
44413
|
+
await next();
|
|
44414
|
+
};
|
|
44415
|
+
}
|
|
44416
|
+
function isPersonCheck(value) {
|
|
44417
|
+
if (!value || typeof value !== "object") return false;
|
|
44418
|
+
const check2 = value;
|
|
44419
|
+
if (check2.ok === true) return true;
|
|
44420
|
+
if (check2.ok !== false) return false;
|
|
44421
|
+
const body = check2.body;
|
|
44422
|
+
return typeof check2.status === "number" && Number.isInteger(check2.status) && check2.status >= 400 && check2.status <= 599 && !!body && typeof body === "object" && typeof body.error === "string" && typeof body.code === "string" && typeof body.message === "string";
|
|
44423
|
+
}
|
|
44392
44424
|
|
|
44393
44425
|
// ../extension-api/src/server-extension-api.ts
|
|
44394
44426
|
var InboxLimitError = class extends Error {
|
|
@@ -44488,7 +44520,7 @@ var ISOLATION_LIMITS = {
|
|
|
44488
44520
|
var NET_DENIED_CODE = "ERR_EXTENSION_NET_DENIED";
|
|
44489
44521
|
var SYNC_RUN_REFUSAL = "Isolated extensions can't run programs synchronously; use the async form.";
|
|
44490
44522
|
function bundleDependencyRefusal(name) {
|
|
44491
|
-
return `
|
|
44523
|
+
return `Extensions must bundle their dependencies: ${name}`;
|
|
44492
44524
|
}
|
|
44493
44525
|
function isRecord(value) {
|
|
44494
44526
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -45097,7 +45129,7 @@ function createProxyCtx(deps) {
|
|
|
45097
45129
|
scheduled.add(cancel);
|
|
45098
45130
|
return cancel;
|
|
45099
45131
|
};
|
|
45100
|
-
const
|
|
45132
|
+
const requirePerson2 = (req, res, next) => {
|
|
45101
45133
|
const verdict = parsePersonVerdict(req.headers[PERSON_VERDICT_HEADER]);
|
|
45102
45134
|
if (verdict?.ok === true) {
|
|
45103
45135
|
next();
|
|
@@ -45112,7 +45144,7 @@ function createProxyCtx(deps) {
|
|
|
45112
45144
|
dorkHome: init.ctx.dorkHome,
|
|
45113
45145
|
filesDir: init.ctx.filesDir
|
|
45114
45146
|
};
|
|
45115
|
-
const locals = { schedule, requirePerson };
|
|
45147
|
+
const locals = { schedule, requirePerson: requirePerson2 };
|
|
45116
45148
|
const build = (members2, prefix) => {
|
|
45117
45149
|
const out = {};
|
|
45118
45150
|
for (const name of Object.keys(members2)) {
|
|
@@ -45284,6 +45316,641 @@ function createTrackedSend(raw) {
|
|
|
45284
45316
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
45285
45317
|
var import_node_stream3 = require("node:stream");
|
|
45286
45318
|
|
|
45319
|
+
// ../../node_modules/.pnpm/@hono+node-server@1.19.17_hono@4.13.12/node_modules/@hono/node-server/dist/index.mjs
|
|
45320
|
+
var import_http2 = require("http2");
|
|
45321
|
+
var import_http22 = require("http2");
|
|
45322
|
+
var import_stream = require("stream");
|
|
45323
|
+
var import_crypto = __toESM(require("crypto"), 1);
|
|
45324
|
+
var RequestError = class extends Error {
|
|
45325
|
+
constructor(message, options) {
|
|
45326
|
+
super(message, options);
|
|
45327
|
+
this.name = "RequestError";
|
|
45328
|
+
}
|
|
45329
|
+
};
|
|
45330
|
+
var toRequestError = (e) => {
|
|
45331
|
+
if (e instanceof RequestError) {
|
|
45332
|
+
return e;
|
|
45333
|
+
}
|
|
45334
|
+
return new RequestError(e.message, { cause: e });
|
|
45335
|
+
};
|
|
45336
|
+
var GlobalRequest = global.Request;
|
|
45337
|
+
var Request2 = class extends GlobalRequest {
|
|
45338
|
+
constructor(input2, options) {
|
|
45339
|
+
if (typeof input2 === "object" && getRequestCache in input2) {
|
|
45340
|
+
input2 = input2[getRequestCache]();
|
|
45341
|
+
}
|
|
45342
|
+
if (typeof options?.body?.getReader !== "undefined") {
|
|
45343
|
+
;
|
|
45344
|
+
options.duplex ??= "half";
|
|
45345
|
+
}
|
|
45346
|
+
super(input2, options);
|
|
45347
|
+
}
|
|
45348
|
+
};
|
|
45349
|
+
var newHeadersFromIncoming = (incoming) => {
|
|
45350
|
+
const headerRecord = [];
|
|
45351
|
+
const rawHeaders = incoming.rawHeaders;
|
|
45352
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
45353
|
+
const { [i]: key, [i + 1]: value } = rawHeaders;
|
|
45354
|
+
if (key.charCodeAt(0) !== /*:*/
|
|
45355
|
+
58) {
|
|
45356
|
+
headerRecord.push([key, value]);
|
|
45357
|
+
}
|
|
45358
|
+
}
|
|
45359
|
+
return new Headers(headerRecord);
|
|
45360
|
+
};
|
|
45361
|
+
var wrapBodyStream = /* @__PURE__ */ Symbol("wrapBodyStream");
|
|
45362
|
+
var newRequestFromIncoming = (method, url2, headers, incoming, abortController) => {
|
|
45363
|
+
const init = {
|
|
45364
|
+
method,
|
|
45365
|
+
headers,
|
|
45366
|
+
signal: abortController.signal
|
|
45367
|
+
};
|
|
45368
|
+
if (method === "TRACE") {
|
|
45369
|
+
init.method = "GET";
|
|
45370
|
+
const req = new Request2(url2, init);
|
|
45371
|
+
Object.defineProperty(req, "method", {
|
|
45372
|
+
get() {
|
|
45373
|
+
return "TRACE";
|
|
45374
|
+
}
|
|
45375
|
+
});
|
|
45376
|
+
return req;
|
|
45377
|
+
}
|
|
45378
|
+
if (!(method === "GET" || method === "HEAD")) {
|
|
45379
|
+
if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
|
|
45380
|
+
init.body = new ReadableStream({
|
|
45381
|
+
start(controller) {
|
|
45382
|
+
controller.enqueue(incoming.rawBody);
|
|
45383
|
+
controller.close();
|
|
45384
|
+
}
|
|
45385
|
+
});
|
|
45386
|
+
} else if (incoming[wrapBodyStream]) {
|
|
45387
|
+
let reader;
|
|
45388
|
+
init.body = new ReadableStream({
|
|
45389
|
+
async pull(controller) {
|
|
45390
|
+
try {
|
|
45391
|
+
reader ||= import_stream.Readable.toWeb(incoming).getReader();
|
|
45392
|
+
const { done, value } = await reader.read();
|
|
45393
|
+
if (done) {
|
|
45394
|
+
controller.close();
|
|
45395
|
+
} else {
|
|
45396
|
+
controller.enqueue(value);
|
|
45397
|
+
}
|
|
45398
|
+
} catch (error62) {
|
|
45399
|
+
controller.error(error62);
|
|
45400
|
+
}
|
|
45401
|
+
}
|
|
45402
|
+
});
|
|
45403
|
+
} else {
|
|
45404
|
+
init.body = import_stream.Readable.toWeb(incoming);
|
|
45405
|
+
}
|
|
45406
|
+
}
|
|
45407
|
+
return new Request2(url2, init);
|
|
45408
|
+
};
|
|
45409
|
+
var getRequestCache = /* @__PURE__ */ Symbol("getRequestCache");
|
|
45410
|
+
var requestCache = /* @__PURE__ */ Symbol("requestCache");
|
|
45411
|
+
var incomingKey = /* @__PURE__ */ Symbol("incomingKey");
|
|
45412
|
+
var urlKey = /* @__PURE__ */ Symbol("urlKey");
|
|
45413
|
+
var headersKey = /* @__PURE__ */ Symbol("headersKey");
|
|
45414
|
+
var abortControllerKey = /* @__PURE__ */ Symbol("abortControllerKey");
|
|
45415
|
+
var getAbortController = /* @__PURE__ */ Symbol("getAbortController");
|
|
45416
|
+
var requestPrototype = {
|
|
45417
|
+
get method() {
|
|
45418
|
+
return this[incomingKey].method || "GET";
|
|
45419
|
+
},
|
|
45420
|
+
get url() {
|
|
45421
|
+
return this[urlKey];
|
|
45422
|
+
},
|
|
45423
|
+
get headers() {
|
|
45424
|
+
return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);
|
|
45425
|
+
},
|
|
45426
|
+
[getAbortController]() {
|
|
45427
|
+
this[getRequestCache]();
|
|
45428
|
+
return this[abortControllerKey];
|
|
45429
|
+
},
|
|
45430
|
+
[getRequestCache]() {
|
|
45431
|
+
this[abortControllerKey] ||= new AbortController();
|
|
45432
|
+
return this[requestCache] ||= newRequestFromIncoming(
|
|
45433
|
+
this.method,
|
|
45434
|
+
this[urlKey],
|
|
45435
|
+
this.headers,
|
|
45436
|
+
this[incomingKey],
|
|
45437
|
+
this[abortControllerKey]
|
|
45438
|
+
);
|
|
45439
|
+
}
|
|
45440
|
+
};
|
|
45441
|
+
[
|
|
45442
|
+
"body",
|
|
45443
|
+
"bodyUsed",
|
|
45444
|
+
"cache",
|
|
45445
|
+
"credentials",
|
|
45446
|
+
"destination",
|
|
45447
|
+
"integrity",
|
|
45448
|
+
"mode",
|
|
45449
|
+
"redirect",
|
|
45450
|
+
"referrer",
|
|
45451
|
+
"referrerPolicy",
|
|
45452
|
+
"signal",
|
|
45453
|
+
"keepalive"
|
|
45454
|
+
].forEach((k) => {
|
|
45455
|
+
Object.defineProperty(requestPrototype, k, {
|
|
45456
|
+
get() {
|
|
45457
|
+
return this[getRequestCache]()[k];
|
|
45458
|
+
}
|
|
45459
|
+
});
|
|
45460
|
+
});
|
|
45461
|
+
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
45462
|
+
Object.defineProperty(requestPrototype, k, {
|
|
45463
|
+
value: function() {
|
|
45464
|
+
return this[getRequestCache]()[k]();
|
|
45465
|
+
}
|
|
45466
|
+
});
|
|
45467
|
+
});
|
|
45468
|
+
Object.defineProperty(requestPrototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
|
|
45469
|
+
value: function(depth, options, inspectFn) {
|
|
45470
|
+
const props = {
|
|
45471
|
+
method: this.method,
|
|
45472
|
+
url: this.url,
|
|
45473
|
+
headers: this.headers,
|
|
45474
|
+
nativeRequest: this[requestCache]
|
|
45475
|
+
};
|
|
45476
|
+
return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
|
|
45477
|
+
}
|
|
45478
|
+
});
|
|
45479
|
+
Object.setPrototypeOf(requestPrototype, Request2.prototype);
|
|
45480
|
+
var newRequest = (incoming, defaultHostname) => {
|
|
45481
|
+
const req = Object.create(requestPrototype);
|
|
45482
|
+
req[incomingKey] = incoming;
|
|
45483
|
+
const incomingUrl = incoming.url || "";
|
|
45484
|
+
if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL.
|
|
45485
|
+
(incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
|
|
45486
|
+
if (incoming instanceof import_http22.Http2ServerRequest) {
|
|
45487
|
+
throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
|
|
45488
|
+
}
|
|
45489
|
+
try {
|
|
45490
|
+
const url22 = new URL(incomingUrl);
|
|
45491
|
+
req[urlKey] = url22.href;
|
|
45492
|
+
} catch (e) {
|
|
45493
|
+
throw new RequestError("Invalid absolute URL", { cause: e });
|
|
45494
|
+
}
|
|
45495
|
+
return req;
|
|
45496
|
+
}
|
|
45497
|
+
const host = (incoming instanceof import_http22.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;
|
|
45498
|
+
if (!host) {
|
|
45499
|
+
throw new RequestError("Missing host header");
|
|
45500
|
+
}
|
|
45501
|
+
let scheme;
|
|
45502
|
+
if (incoming instanceof import_http22.Http2ServerRequest) {
|
|
45503
|
+
scheme = incoming.scheme;
|
|
45504
|
+
if (!(scheme === "http" || scheme === "https")) {
|
|
45505
|
+
throw new RequestError("Unsupported scheme");
|
|
45506
|
+
}
|
|
45507
|
+
} else {
|
|
45508
|
+
scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http";
|
|
45509
|
+
}
|
|
45510
|
+
const url2 = new URL(`${scheme}://${host}${incomingUrl}`);
|
|
45511
|
+
if (url2.hostname.length !== host.length && url2.hostname !== host.replace(/:\d+$/, "")) {
|
|
45512
|
+
throw new RequestError("Invalid host header");
|
|
45513
|
+
}
|
|
45514
|
+
req[urlKey] = url2.href;
|
|
45515
|
+
return req;
|
|
45516
|
+
};
|
|
45517
|
+
var responseCache = /* @__PURE__ */ Symbol("responseCache");
|
|
45518
|
+
var getResponseCache = /* @__PURE__ */ Symbol("getResponseCache");
|
|
45519
|
+
var cacheKey = /* @__PURE__ */ Symbol("cache");
|
|
45520
|
+
var GlobalResponse = global.Response;
|
|
45521
|
+
var Response2 = class _Response {
|
|
45522
|
+
#body;
|
|
45523
|
+
#init;
|
|
45524
|
+
[getResponseCache]() {
|
|
45525
|
+
delete this[cacheKey];
|
|
45526
|
+
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
|
|
45527
|
+
}
|
|
45528
|
+
constructor(body, init) {
|
|
45529
|
+
let headers;
|
|
45530
|
+
this.#body = body;
|
|
45531
|
+
if (init instanceof _Response) {
|
|
45532
|
+
const cachedGlobalResponse = init[responseCache];
|
|
45533
|
+
if (cachedGlobalResponse) {
|
|
45534
|
+
this.#init = cachedGlobalResponse;
|
|
45535
|
+
this[getResponseCache]();
|
|
45536
|
+
return;
|
|
45537
|
+
} else {
|
|
45538
|
+
this.#init = init.#init;
|
|
45539
|
+
headers = new Headers(init.#init.headers);
|
|
45540
|
+
}
|
|
45541
|
+
} else {
|
|
45542
|
+
this.#init = init;
|
|
45543
|
+
}
|
|
45544
|
+
if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
|
|
45545
|
+
;
|
|
45546
|
+
this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
|
|
45547
|
+
}
|
|
45548
|
+
}
|
|
45549
|
+
get headers() {
|
|
45550
|
+
const cache = this[cacheKey];
|
|
45551
|
+
if (cache) {
|
|
45552
|
+
if (!(cache[2] instanceof Headers)) {
|
|
45553
|
+
cache[2] = new Headers(
|
|
45554
|
+
cache[2] || { "content-type": "text/plain; charset=UTF-8" }
|
|
45555
|
+
);
|
|
45556
|
+
}
|
|
45557
|
+
return cache[2];
|
|
45558
|
+
}
|
|
45559
|
+
return this[getResponseCache]().headers;
|
|
45560
|
+
}
|
|
45561
|
+
get status() {
|
|
45562
|
+
return this[cacheKey]?.[0] ?? this[getResponseCache]().status;
|
|
45563
|
+
}
|
|
45564
|
+
get ok() {
|
|
45565
|
+
const status = this.status;
|
|
45566
|
+
return status >= 200 && status < 300;
|
|
45567
|
+
}
|
|
45568
|
+
};
|
|
45569
|
+
["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
|
|
45570
|
+
Object.defineProperty(Response2.prototype, k, {
|
|
45571
|
+
get() {
|
|
45572
|
+
return this[getResponseCache]()[k];
|
|
45573
|
+
}
|
|
45574
|
+
});
|
|
45575
|
+
});
|
|
45576
|
+
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
45577
|
+
Object.defineProperty(Response2.prototype, k, {
|
|
45578
|
+
value: function() {
|
|
45579
|
+
return this[getResponseCache]()[k]();
|
|
45580
|
+
}
|
|
45581
|
+
});
|
|
45582
|
+
});
|
|
45583
|
+
Object.defineProperty(Response2.prototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
|
|
45584
|
+
value: function(depth, options, inspectFn) {
|
|
45585
|
+
const props = {
|
|
45586
|
+
status: this.status,
|
|
45587
|
+
headers: this.headers,
|
|
45588
|
+
ok: this.ok,
|
|
45589
|
+
nativeResponse: this[responseCache]
|
|
45590
|
+
};
|
|
45591
|
+
return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
|
|
45592
|
+
}
|
|
45593
|
+
});
|
|
45594
|
+
Object.setPrototypeOf(Response2, GlobalResponse);
|
|
45595
|
+
Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
|
|
45596
|
+
async function readWithoutBlocking(readPromise) {
|
|
45597
|
+
return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);
|
|
45598
|
+
}
|
|
45599
|
+
function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) {
|
|
45600
|
+
const cancel = (error62) => {
|
|
45601
|
+
reader.cancel(error62).catch(() => {
|
|
45602
|
+
});
|
|
45603
|
+
};
|
|
45604
|
+
writable.on("close", cancel);
|
|
45605
|
+
writable.on("error", cancel);
|
|
45606
|
+
(currentReadPromise ?? reader.read()).then(flow, handleStreamError);
|
|
45607
|
+
return reader.closed.finally(() => {
|
|
45608
|
+
writable.off("close", cancel);
|
|
45609
|
+
writable.off("error", cancel);
|
|
45610
|
+
});
|
|
45611
|
+
function handleStreamError(error62) {
|
|
45612
|
+
if (error62) {
|
|
45613
|
+
writable.destroy(error62);
|
|
45614
|
+
}
|
|
45615
|
+
}
|
|
45616
|
+
function onDrain() {
|
|
45617
|
+
reader.read().then(flow, handleStreamError);
|
|
45618
|
+
}
|
|
45619
|
+
function flow({ done, value }) {
|
|
45620
|
+
try {
|
|
45621
|
+
if (done) {
|
|
45622
|
+
writable.end();
|
|
45623
|
+
} else if (!writable.write(value)) {
|
|
45624
|
+
writable.once("drain", onDrain);
|
|
45625
|
+
} else {
|
|
45626
|
+
return reader.read().then(flow, handleStreamError);
|
|
45627
|
+
}
|
|
45628
|
+
} catch (e) {
|
|
45629
|
+
handleStreamError(e);
|
|
45630
|
+
}
|
|
45631
|
+
}
|
|
45632
|
+
}
|
|
45633
|
+
function writeFromReadableStream(stream, writable) {
|
|
45634
|
+
if (stream.locked) {
|
|
45635
|
+
throw new TypeError("ReadableStream is locked.");
|
|
45636
|
+
} else if (writable.destroyed) {
|
|
45637
|
+
return;
|
|
45638
|
+
}
|
|
45639
|
+
return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
|
|
45640
|
+
}
|
|
45641
|
+
var buildOutgoingHttpHeaders = (headers) => {
|
|
45642
|
+
const res = {};
|
|
45643
|
+
if (!(headers instanceof Headers)) {
|
|
45644
|
+
headers = new Headers(headers ?? void 0);
|
|
45645
|
+
}
|
|
45646
|
+
const cookies = [];
|
|
45647
|
+
for (const [k, v] of headers) {
|
|
45648
|
+
if (k === "set-cookie") {
|
|
45649
|
+
cookies.push(v);
|
|
45650
|
+
} else {
|
|
45651
|
+
res[k] = v;
|
|
45652
|
+
}
|
|
45653
|
+
}
|
|
45654
|
+
if (cookies.length > 0) {
|
|
45655
|
+
res["set-cookie"] = cookies;
|
|
45656
|
+
}
|
|
45657
|
+
res["content-type"] ??= "text/plain; charset=UTF-8";
|
|
45658
|
+
return res;
|
|
45659
|
+
};
|
|
45660
|
+
var X_ALREADY_SENT = "x-hono-already-sent";
|
|
45661
|
+
if (typeof global.crypto === "undefined") {
|
|
45662
|
+
global.crypto = import_crypto.default;
|
|
45663
|
+
}
|
|
45664
|
+
var outgoingEnded = /* @__PURE__ */ Symbol("outgoingEnded");
|
|
45665
|
+
var incomingDraining = /* @__PURE__ */ Symbol("incomingDraining");
|
|
45666
|
+
var DRAIN_TIMEOUT_MS = 500;
|
|
45667
|
+
var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
|
|
45668
|
+
var drainIncoming = (incoming) => {
|
|
45669
|
+
const incomingWithDrainState = incoming;
|
|
45670
|
+
if (incoming.destroyed || incomingWithDrainState[incomingDraining]) {
|
|
45671
|
+
return;
|
|
45672
|
+
}
|
|
45673
|
+
incomingWithDrainState[incomingDraining] = true;
|
|
45674
|
+
if (incoming instanceof import_http2.Http2ServerRequest) {
|
|
45675
|
+
try {
|
|
45676
|
+
;
|
|
45677
|
+
incoming.stream?.close?.(import_http2.constants.NGHTTP2_NO_ERROR);
|
|
45678
|
+
} catch {
|
|
45679
|
+
}
|
|
45680
|
+
return;
|
|
45681
|
+
}
|
|
45682
|
+
let bytesRead = 0;
|
|
45683
|
+
const cleanup = () => {
|
|
45684
|
+
clearTimeout(timer);
|
|
45685
|
+
incoming.off("data", onData);
|
|
45686
|
+
incoming.off("end", cleanup);
|
|
45687
|
+
incoming.off("error", cleanup);
|
|
45688
|
+
};
|
|
45689
|
+
const forceClose = () => {
|
|
45690
|
+
cleanup();
|
|
45691
|
+
const socket = incoming.socket;
|
|
45692
|
+
if (socket && !socket.destroyed) {
|
|
45693
|
+
socket.destroySoon();
|
|
45694
|
+
}
|
|
45695
|
+
};
|
|
45696
|
+
const timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);
|
|
45697
|
+
timer.unref?.();
|
|
45698
|
+
const onData = (chunk) => {
|
|
45699
|
+
bytesRead += chunk.length;
|
|
45700
|
+
if (bytesRead > MAX_DRAIN_BYTES) {
|
|
45701
|
+
forceClose();
|
|
45702
|
+
}
|
|
45703
|
+
};
|
|
45704
|
+
incoming.on("data", onData);
|
|
45705
|
+
incoming.on("end", cleanup);
|
|
45706
|
+
incoming.on("error", cleanup);
|
|
45707
|
+
incoming.resume();
|
|
45708
|
+
};
|
|
45709
|
+
var handleRequestError = () => new Response(null, {
|
|
45710
|
+
status: 400
|
|
45711
|
+
});
|
|
45712
|
+
var handleFetchError = (e) => new Response(null, {
|
|
45713
|
+
status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500
|
|
45714
|
+
});
|
|
45715
|
+
var handleResponseError = (e, outgoing) => {
|
|
45716
|
+
const err = e instanceof Error ? e : new Error("unknown error", { cause: e });
|
|
45717
|
+
if (err.code === "ERR_STREAM_PREMATURE_CLOSE") {
|
|
45718
|
+
console.info("The user aborted a request.");
|
|
45719
|
+
} else {
|
|
45720
|
+
console.error(e);
|
|
45721
|
+
if (!outgoing.headersSent) {
|
|
45722
|
+
outgoing.writeHead(500, { "Content-Type": "text/plain" });
|
|
45723
|
+
}
|
|
45724
|
+
outgoing.end(`Error: ${err.message}`);
|
|
45725
|
+
outgoing.destroy(err);
|
|
45726
|
+
}
|
|
45727
|
+
};
|
|
45728
|
+
var flushHeaders = (outgoing) => {
|
|
45729
|
+
if ("flushHeaders" in outgoing && outgoing.writable) {
|
|
45730
|
+
outgoing.flushHeaders();
|
|
45731
|
+
}
|
|
45732
|
+
};
|
|
45733
|
+
var responseViaCache = async (res, outgoing) => {
|
|
45734
|
+
let [status, body, header] = res[cacheKey];
|
|
45735
|
+
let hasContentLength = false;
|
|
45736
|
+
if (!header) {
|
|
45737
|
+
header = { "content-type": "text/plain; charset=UTF-8" };
|
|
45738
|
+
} else if (header instanceof Headers) {
|
|
45739
|
+
hasContentLength = header.has("content-length");
|
|
45740
|
+
header = buildOutgoingHttpHeaders(header);
|
|
45741
|
+
} else if (Array.isArray(header)) {
|
|
45742
|
+
const headerObj = new Headers(header);
|
|
45743
|
+
hasContentLength = headerObj.has("content-length");
|
|
45744
|
+
header = buildOutgoingHttpHeaders(headerObj);
|
|
45745
|
+
} else {
|
|
45746
|
+
for (const key in header) {
|
|
45747
|
+
if (key.length === 14 && key.toLowerCase() === "content-length") {
|
|
45748
|
+
hasContentLength = true;
|
|
45749
|
+
break;
|
|
45750
|
+
}
|
|
45751
|
+
}
|
|
45752
|
+
}
|
|
45753
|
+
if (!hasContentLength) {
|
|
45754
|
+
if (typeof body === "string") {
|
|
45755
|
+
header["Content-Length"] = Buffer.byteLength(body);
|
|
45756
|
+
} else if (body instanceof Uint8Array) {
|
|
45757
|
+
header["Content-Length"] = body.byteLength;
|
|
45758
|
+
} else if (body instanceof Blob) {
|
|
45759
|
+
header["Content-Length"] = body.size;
|
|
45760
|
+
}
|
|
45761
|
+
}
|
|
45762
|
+
outgoing.writeHead(status, header);
|
|
45763
|
+
if (typeof body === "string" || body instanceof Uint8Array) {
|
|
45764
|
+
outgoing.end(body);
|
|
45765
|
+
} else if (body instanceof Blob) {
|
|
45766
|
+
outgoing.end(new Uint8Array(await body.arrayBuffer()));
|
|
45767
|
+
} else {
|
|
45768
|
+
flushHeaders(outgoing);
|
|
45769
|
+
await writeFromReadableStream(body, outgoing)?.catch(
|
|
45770
|
+
(e) => handleResponseError(e, outgoing)
|
|
45771
|
+
);
|
|
45772
|
+
}
|
|
45773
|
+
;
|
|
45774
|
+
outgoing[outgoingEnded]?.();
|
|
45775
|
+
};
|
|
45776
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
45777
|
+
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
45778
|
+
if (isPromise(res)) {
|
|
45779
|
+
if (options.errorHandler) {
|
|
45780
|
+
try {
|
|
45781
|
+
res = await res;
|
|
45782
|
+
} catch (err) {
|
|
45783
|
+
const errRes = await options.errorHandler(err);
|
|
45784
|
+
if (!errRes) {
|
|
45785
|
+
return;
|
|
45786
|
+
}
|
|
45787
|
+
res = errRes;
|
|
45788
|
+
}
|
|
45789
|
+
} else {
|
|
45790
|
+
res = await res.catch(handleFetchError);
|
|
45791
|
+
}
|
|
45792
|
+
}
|
|
45793
|
+
if (cacheKey in res) {
|
|
45794
|
+
return responseViaCache(res, outgoing);
|
|
45795
|
+
}
|
|
45796
|
+
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
45797
|
+
if (res.body) {
|
|
45798
|
+
const reader = res.body.getReader();
|
|
45799
|
+
const values = [];
|
|
45800
|
+
let done = false;
|
|
45801
|
+
let currentReadPromise = void 0;
|
|
45802
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
45803
|
+
let maxReadCount = 2;
|
|
45804
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
45805
|
+
currentReadPromise ||= reader.read();
|
|
45806
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
45807
|
+
console.error(e);
|
|
45808
|
+
done = true;
|
|
45809
|
+
});
|
|
45810
|
+
if (!chunk) {
|
|
45811
|
+
if (i === 1) {
|
|
45812
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
45813
|
+
maxReadCount = 3;
|
|
45814
|
+
continue;
|
|
45815
|
+
}
|
|
45816
|
+
break;
|
|
45817
|
+
}
|
|
45818
|
+
currentReadPromise = void 0;
|
|
45819
|
+
if (chunk.value) {
|
|
45820
|
+
values.push(chunk.value);
|
|
45821
|
+
}
|
|
45822
|
+
if (chunk.done) {
|
|
45823
|
+
done = true;
|
|
45824
|
+
break;
|
|
45825
|
+
}
|
|
45826
|
+
}
|
|
45827
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
45828
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
45829
|
+
}
|
|
45830
|
+
}
|
|
45831
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
45832
|
+
values.forEach((value) => {
|
|
45833
|
+
;
|
|
45834
|
+
outgoing.write(value);
|
|
45835
|
+
});
|
|
45836
|
+
if (done) {
|
|
45837
|
+
outgoing.end();
|
|
45838
|
+
} else {
|
|
45839
|
+
if (values.length === 0) {
|
|
45840
|
+
flushHeaders(outgoing);
|
|
45841
|
+
}
|
|
45842
|
+
await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);
|
|
45843
|
+
}
|
|
45844
|
+
} else if (resHeaderRecord[X_ALREADY_SENT]) {
|
|
45845
|
+
} else {
|
|
45846
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
45847
|
+
outgoing.end();
|
|
45848
|
+
}
|
|
45849
|
+
;
|
|
45850
|
+
outgoing[outgoingEnded]?.();
|
|
45851
|
+
};
|
|
45852
|
+
var getRequestListener = (fetchCallback, options = {}) => {
|
|
45853
|
+
const autoCleanupIncoming = options.autoCleanupIncoming ?? true;
|
|
45854
|
+
if (options.overrideGlobalObjects !== false && global.Request !== Request2) {
|
|
45855
|
+
Object.defineProperty(global, "Request", {
|
|
45856
|
+
value: Request2
|
|
45857
|
+
});
|
|
45858
|
+
Object.defineProperty(global, "Response", {
|
|
45859
|
+
value: Response2
|
|
45860
|
+
});
|
|
45861
|
+
}
|
|
45862
|
+
return async (incoming, outgoing) => {
|
|
45863
|
+
let res, req;
|
|
45864
|
+
try {
|
|
45865
|
+
req = newRequest(incoming, options.hostname);
|
|
45866
|
+
let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD";
|
|
45867
|
+
if (!incomingEnded) {
|
|
45868
|
+
;
|
|
45869
|
+
incoming[wrapBodyStream] = true;
|
|
45870
|
+
incoming.on("end", () => {
|
|
45871
|
+
incomingEnded = true;
|
|
45872
|
+
});
|
|
45873
|
+
if (incoming instanceof import_http2.Http2ServerRequest) {
|
|
45874
|
+
;
|
|
45875
|
+
outgoing[outgoingEnded] = () => {
|
|
45876
|
+
if (!incomingEnded) {
|
|
45877
|
+
setTimeout(() => {
|
|
45878
|
+
if (!incomingEnded) {
|
|
45879
|
+
setTimeout(() => {
|
|
45880
|
+
drainIncoming(incoming);
|
|
45881
|
+
});
|
|
45882
|
+
}
|
|
45883
|
+
});
|
|
45884
|
+
}
|
|
45885
|
+
};
|
|
45886
|
+
}
|
|
45887
|
+
outgoing.on("finish", () => {
|
|
45888
|
+
if (!incomingEnded) {
|
|
45889
|
+
drainIncoming(incoming);
|
|
45890
|
+
}
|
|
45891
|
+
});
|
|
45892
|
+
}
|
|
45893
|
+
outgoing.on("close", () => {
|
|
45894
|
+
const abortController = req[abortControllerKey];
|
|
45895
|
+
if (abortController) {
|
|
45896
|
+
if (incoming.errored) {
|
|
45897
|
+
req[abortControllerKey].abort(incoming.errored.toString());
|
|
45898
|
+
} else if (!outgoing.writableFinished) {
|
|
45899
|
+
req[abortControllerKey].abort("Client connection prematurely closed.");
|
|
45900
|
+
}
|
|
45901
|
+
}
|
|
45902
|
+
if (!incomingEnded) {
|
|
45903
|
+
setTimeout(() => {
|
|
45904
|
+
if (!incomingEnded) {
|
|
45905
|
+
setTimeout(() => {
|
|
45906
|
+
drainIncoming(incoming);
|
|
45907
|
+
});
|
|
45908
|
+
}
|
|
45909
|
+
});
|
|
45910
|
+
}
|
|
45911
|
+
});
|
|
45912
|
+
res = fetchCallback(req, { incoming, outgoing });
|
|
45913
|
+
if (cacheKey in res) {
|
|
45914
|
+
return responseViaCache(res, outgoing);
|
|
45915
|
+
}
|
|
45916
|
+
} catch (e) {
|
|
45917
|
+
if (!res) {
|
|
45918
|
+
if (options.errorHandler) {
|
|
45919
|
+
res = await options.errorHandler(req ? e : toRequestError(e));
|
|
45920
|
+
if (!res) {
|
|
45921
|
+
return;
|
|
45922
|
+
}
|
|
45923
|
+
} else if (!req) {
|
|
45924
|
+
res = handleRequestError();
|
|
45925
|
+
} else {
|
|
45926
|
+
res = handleFetchError(e);
|
|
45927
|
+
}
|
|
45928
|
+
} else {
|
|
45929
|
+
return handleResponseError(e, outgoing);
|
|
45930
|
+
}
|
|
45931
|
+
}
|
|
45932
|
+
try {
|
|
45933
|
+
return await responseViaResponseObject(res, outgoing, options);
|
|
45934
|
+
} catch (e) {
|
|
45935
|
+
return handleResponseError(e, outgoing);
|
|
45936
|
+
}
|
|
45937
|
+
};
|
|
45938
|
+
};
|
|
45939
|
+
|
|
45940
|
+
// ../../apps/server/src/services/extensions/http/reply-headers.ts
|
|
45941
|
+
function mountedLocation(value, handlerUrl, mount) {
|
|
45942
|
+
if (value.includes("\\")) return null;
|
|
45943
|
+
let target;
|
|
45944
|
+
try {
|
|
45945
|
+
target = new URL(value, handlerUrl);
|
|
45946
|
+
} catch {
|
|
45947
|
+
return null;
|
|
45948
|
+
}
|
|
45949
|
+
if (target.origin !== new URL(handlerUrl).origin) return value;
|
|
45950
|
+
const inMount = target.pathname === mount || target.pathname.startsWith(`${mount}/`);
|
|
45951
|
+
return `${inMount ? "" : mount}${target.pathname}${target.search}${target.hash}`;
|
|
45952
|
+
}
|
|
45953
|
+
|
|
45287
45954
|
// ../../apps/server/src/services/extensions/isolation/virtual-socket.ts
|
|
45288
45955
|
var import_node_stream2 = require("node:stream");
|
|
45289
45956
|
var VirtualSocket = class extends import_node_stream2.Duplex {
|
|
@@ -45445,10 +46112,19 @@ var VirtualSocket = class extends import_node_stream2.Duplex {
|
|
|
45445
46112
|
|
|
45446
46113
|
// ../../apps/server/src/services/extensions/isolation/child/virtual-server.ts
|
|
45447
46114
|
var BODILESS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
45448
|
-
|
|
46115
|
+
function callerFrom(raw, refusal) {
|
|
46116
|
+
const verdict = parsePersonVerdict(raw) ?? { ok: false, status: 403, body: refusal };
|
|
46117
|
+
return Object.freeze({ person: Object.freeze(verdict) });
|
|
46118
|
+
}
|
|
46119
|
+
function belowMount(pathname, mount) {
|
|
46120
|
+
if (pathname === mount) return "/";
|
|
46121
|
+
return pathname.startsWith(`${mount}/`) ? pathname.slice(mount.length) : null;
|
|
46122
|
+
}
|
|
46123
|
+
async function answerWithFetch(handler, req, res, refusal, mount) {
|
|
46124
|
+
const caller = callerFrom(req.headers[PERSON_VERDICT_HEADER], refusal);
|
|
45449
46125
|
const headers = new Headers();
|
|
45450
46126
|
for (const [name, value] of Object.entries(req.headers)) {
|
|
45451
|
-
if (value === void 0) continue;
|
|
46127
|
+
if (value === void 0 || name === PERSON_VERDICT_HEADER) continue;
|
|
45452
46128
|
for (const one of Array.isArray(value) ? value : [value]) headers.append(name, one);
|
|
45453
46129
|
}
|
|
45454
46130
|
let body = null;
|
|
@@ -45464,18 +46140,18 @@ async function answerWithFetch(handler, req, res) {
|
|
|
45464
46140
|
res.once("close", () => {
|
|
45465
46141
|
if (!res.writableFinished) abort.abort();
|
|
45466
46142
|
});
|
|
45467
|
-
const
|
|
45468
|
-
|
|
45469
|
-
|
|
45470
|
-
|
|
45471
|
-
|
|
45472
|
-
|
|
45473
|
-
|
|
45474
|
-
|
|
45475
|
-
)
|
|
45476
|
-
if (!(answer instanceof Response)) {
|
|
46143
|
+
const request = new Request(`http://${req.headers.host ?? "localhost"}${req.url}`, {
|
|
46144
|
+
method: req.method,
|
|
46145
|
+
headers,
|
|
46146
|
+
body,
|
|
46147
|
+
signal: abort.signal,
|
|
46148
|
+
duplex: "half"
|
|
46149
|
+
});
|
|
46150
|
+
const answered = await handler(request, caller);
|
|
46151
|
+
if (!(answered instanceof Response)) {
|
|
45477
46152
|
throw new Error("The fetch handler answered with something that is not a Response.");
|
|
45478
46153
|
}
|
|
46154
|
+
const answer = withMountedLocation(answered, request.url, mount);
|
|
45479
46155
|
res.status(answer.status);
|
|
45480
46156
|
answer.headers.forEach((value, name) => {
|
|
45481
46157
|
if (name !== "set-cookie") res.setHeader(name, value);
|
|
@@ -45486,18 +46162,69 @@ async function answerWithFetch(handler, req, res) {
|
|
|
45486
46162
|
}
|
|
45487
46163
|
import_node_stream3.Readable.fromWeb(answer.body).on("error", () => res.destroy()).pipe(res);
|
|
45488
46164
|
}
|
|
46165
|
+
function withMountedLocation(answer, handlerUrl, mount) {
|
|
46166
|
+
const location = answer.headers.get("location");
|
|
46167
|
+
if (location === null) return answer;
|
|
46168
|
+
const headers = new Headers(answer.headers);
|
|
46169
|
+
const mounted = mountedLocation(location, handlerUrl, mount);
|
|
46170
|
+
if (mounted === null) headers.delete("location");
|
|
46171
|
+
else headers.set("location", mounted);
|
|
46172
|
+
return new Response(answer.body, {
|
|
46173
|
+
status: answer.status,
|
|
46174
|
+
statusText: answer.statusText,
|
|
46175
|
+
headers
|
|
46176
|
+
});
|
|
46177
|
+
}
|
|
46178
|
+
function errorAnswer(status, error62) {
|
|
46179
|
+
return Response.json({ error: error62 }, { status });
|
|
46180
|
+
}
|
|
45489
46181
|
function createVirtualServer(deps) {
|
|
46182
|
+
const mount = `/api/ext/${deps.extensionId}`;
|
|
46183
|
+
let fetchHandler = null;
|
|
46184
|
+
const notFound = (path2) => errorAnswer(404, `Extension '${deps.extensionId}' has no route for ${path2}`);
|
|
46185
|
+
const serveFetchOnly = getRequestListener(
|
|
46186
|
+
async (incoming) => {
|
|
46187
|
+
const sent = new URL(incoming.url);
|
|
46188
|
+
const below = belowMount(sent.pathname, mount);
|
|
46189
|
+
if (below === null) return notFound(sent.pathname);
|
|
46190
|
+
const handler = fetchHandler;
|
|
46191
|
+
if (!handler) return notFound(below);
|
|
46192
|
+
const url2 = new URL(sent.origin);
|
|
46193
|
+
url2.pathname = below;
|
|
46194
|
+
url2.search = sent.search;
|
|
46195
|
+
const caller = callerFrom(incoming.headers.get(PERSON_VERDICT_HEADER), deps.personRefusal);
|
|
46196
|
+
const headers = new Headers(incoming.headers);
|
|
46197
|
+
headers.delete(PERSON_VERDICT_HEADER);
|
|
46198
|
+
const request = new Request(url2, {
|
|
46199
|
+
method: incoming.method,
|
|
46200
|
+
headers,
|
|
46201
|
+
body: BODILESS.has(incoming.method) ? null : incoming.body,
|
|
46202
|
+
signal: incoming.signal,
|
|
46203
|
+
duplex: "half"
|
|
46204
|
+
});
|
|
46205
|
+
try {
|
|
46206
|
+
const answer = await handler(request, caller);
|
|
46207
|
+
if (!(answer instanceof Response)) {
|
|
46208
|
+
throw new Error("The fetch handler answered with something that is not a Response.");
|
|
46209
|
+
}
|
|
46210
|
+
return withMountedLocation(answer, request.url, mount);
|
|
46211
|
+
} catch (err) {
|
|
46212
|
+
console.error("Route error:", err);
|
|
46213
|
+
return errorAnswer(500, err instanceof Error ? err.message : "Internal error");
|
|
46214
|
+
}
|
|
46215
|
+
},
|
|
46216
|
+
{ overrideGlobalObjects: false }
|
|
46217
|
+
);
|
|
45490
46218
|
const app = deps.express();
|
|
45491
46219
|
app.disable("x-powered-by");
|
|
45492
46220
|
app.use(deps.express.json({ limit: "1mb" }));
|
|
45493
|
-
app.use(
|
|
45494
|
-
|
|
45495
|
-
app.use(`/api/ext/${deps.extensionId}`, (req, res, next) => {
|
|
46221
|
+
app.use(mount, deps.router);
|
|
46222
|
+
app.use(mount, (req, res, next) => {
|
|
45496
46223
|
if (!fetchHandler) {
|
|
45497
46224
|
next();
|
|
45498
46225
|
return;
|
|
45499
46226
|
}
|
|
45500
|
-
answerWithFetch(fetchHandler, req, res).catch(next);
|
|
46227
|
+
answerWithFetch(fetchHandler, req, res, deps.personRefusal, mount).catch(next);
|
|
45501
46228
|
});
|
|
45502
46229
|
app.use((req, res) => {
|
|
45503
46230
|
res.status(404).json({ error: `Extension '${deps.extensionId}' has no route for ${req.path}` });
|
|
@@ -45512,7 +46239,10 @@ function createVirtualServer(deps) {
|
|
|
45512
46239
|
res.status(500).json({ error: err instanceof Error ? err.message : "Internal error" });
|
|
45513
46240
|
}
|
|
45514
46241
|
);
|
|
45515
|
-
const server = import_node_http.default.createServer(
|
|
46242
|
+
const server = import_node_http.default.createServer((req, res) => {
|
|
46243
|
+
if (deps.router.stack.length > 0) app(req, res);
|
|
46244
|
+
else void serveFetchOnly(req, res);
|
|
46245
|
+
});
|
|
45516
46246
|
server.requestTimeout = 0;
|
|
45517
46247
|
server.headersTimeout = 0;
|
|
45518
46248
|
server.keepAliveTimeout = 0;
|
|
@@ -46414,7 +47144,13 @@ function main() {
|
|
|
46414
47144
|
return;
|
|
46415
47145
|
}
|
|
46416
47146
|
const router = import_express.default.Router();
|
|
46417
|
-
const served = createVirtualServer({
|
|
47147
|
+
const served = createVirtualServer({
|
|
47148
|
+
extensionId: init.extensionId,
|
|
47149
|
+
express: import_express.default,
|
|
47150
|
+
router,
|
|
47151
|
+
send,
|
|
47152
|
+
personRefusal: init.personRefusal
|
|
47153
|
+
});
|
|
46418
47154
|
virtual = served;
|
|
46419
47155
|
const ctx = proxy.ctx;
|
|
46420
47156
|
const proxied = proxy;
|