dorkos 0.127.0 → 0.127.1
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 +1059 -729
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BnnwvwU1.js → AboutPage-CwNzli7O.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DW-plne9.js → ActivityErrorState-D9UR9aYX.js} +1 -1
- package/dist/client/assets/{ActivityPage-BMrtNC9t.js → ActivityPage-DeL7N0Rt.js} +1 -1
- package/dist/client/assets/{ActivityRow-BnBDxJqK.js → ActivityRow-DuuG4S5E.js} +1 -1
- package/dist/client/assets/{AdapterIcon-J2UUIfEX.js → AdapterIcon-bYKCnumH.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-MDV6zwYC.js → AdapterSetupWizard-ByQU3Ryd.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-Dj2MlE6E.js → AgentOptionRow-CN9dDSeG.js} +1 -1
- package/dist/client/assets/{AgentPicker-D6MsFN_H.js → AgentPicker-Bbvnww9v.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BTyuNOhU.js → AgentRequestCard-DmLUHbGa.js} +1 -1
- package/dist/client/assets/{AppearancePage-DJfJUAkw.js → AppearancePage-CS6bwH4x.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-Akw0_458.js → ApplyToOverridesDialog-DG6pYkhN.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-Cx9-sStN.js → AttentionSignalRow-ByeDJweR.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CRlmlore.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CSaHAO1F.js} +1 -1
- package/dist/client/assets/{BindingDialog-ZAX-h6D4.js → BindingDialog-nNZW4-SF.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-fEMJgpNx.js → BlintzCanvas-BXwncq3A.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-CUoIFG7g.js → CanvasCsvContent-Dt7ko9e1.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-Cg2jcXse.js → CanvasFileContent-TO3VAFTI.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-BL-UiHAj.js → CanvasModel3dContent-DNK3EY5W.js} +2 -2
- package/dist/client/assets/{ChannelComposer-BHxXoQwT.js → ChannelComposer-Bfi3hAgy.js} +12 -12
- package/dist/client/assets/{ChatAppsOff-CSSu_yVC.js → ChatAppsOff-BxUf0caI.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-dfcDpguR.js → CodeMirrorDiff-C78KCVkj.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-C1YQ35ki.js → CodeMirrorEditor-BWSTKK9s.js} +1 -1
- package/dist/client/assets/{CommitmentList-B6RG_hWB.js → CommitmentList-oKrIigLt.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-CDFvo1lt.js → CommitmentsPage-DKtyvmFd.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-vJ8UfRNm.js → ComputerResourceView-DjtpGKRB.js} +1 -1
- package/dist/client/assets/{ComputerViewer-BTqPuZyh.js → ComputerViewer-B7a77fXa.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-DPnmOuiA.js → ConnectionAccessLists-BxLNtKdv.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CSHnGkha.js → ConnectionsPage-DQEOL79u.js} +1 -1
- package/dist/client/assets/{ConventionPage-C6WsAvm4.js → ConventionPage-BJ1Fkt7H.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-CGjw2Cwy.js → ExtensionPageRoute-DMbNbOMW.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-CKlmwuIc.js → FloatingTanStackRouterDevtools-CqogiFob-BmisG40-.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-D8rVtTRp.js → ForwardConsentHost-DdEYtIvk.js} +1 -1
- package/dist/client/assets/HandlePage-rhsJ5LBy.js +1 -0
- package/dist/client/assets/{HeartbeatPage-DQImR4dY.js → HeartbeatPage-DsVZLbVN.js} +1 -1
- package/dist/client/assets/{KeyEntry-BerpQFQT.js → KeyEntry-B9twGZOd.js} +1 -1
- package/dist/client/assets/{LexicalField-CkcKNJGL.js → LexicalField-CBm1TZpt.js} +1 -1
- package/dist/client/assets/{ManagesPage-CV4xieFk.js → ManagesPage-bAtPePVC.js} +1 -1
- package/dist/client/assets/{Marketplace-Cp0e4Nv8.js → Marketplace-DRaPW5c2.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-ZBNnVSuv.js → MarketplaceSourcesView-lYEkmUGJ.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BtKAUDBg.js → McpAppFrame-BzZqyRxQ.js} +1 -1
- package/dist/client/assets/{McpSigninBody-DjGrp_sO.js → McpSigninBody-oVPX3ZDZ.js} +1 -1
- package/dist/client/assets/{Model3dViewer-BSX1QGsE.js → Model3dViewer-DrS3qYW1.js} +1 -1
- package/dist/client/assets/NamePage-BvRDf9r1.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-DTQ7vFsa.js → NewDirectMessageMenu-BkPbuzx8.js} +1 -1
- package/dist/client/assets/{NotificationsPage-q7BDVKOz.js → NotificationsPage-CKU37E34.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-aAMKDAyc.js → OpenMeshSwitch-B7z7XHNR.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-CCAvadEZ.js → OperatorIdentityForm-BzZoS4KD.js} +1 -1
- package/dist/client/assets/{PermissionHistory-_8m4ohGq.js → PermissionHistory-D_WFGZtw.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DHl8sCfQ.js → PermissionsPage-15DeeKpE.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DOql0nWB.js → PersonalityPopover-CQ-iLQpo.js} +1 -1
- package/dist/client/assets/PhotoPage-CDCmTcmR.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-BfvSYL-w.js → PreviewRefusedNotice-DzvwQvMr.js} +1 -1
- package/dist/client/assets/{ProfileFields-CX2mdPAV.js → ProfileFields-EgcVDViF.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-Cj_57NEG.js → ProfilePanelContainer-zAOmdAo9.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-D7F0PDw9.js → ProfileRolePicker-D5ScObov.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-BopMvYe7.js → PromptSuggestionChips-DlajKFMJ.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-CG_hjT_U.js → ReportsToPopover-BZBQY9rT.js} +1 -1
- package/dist/client/assets/{RoomSurface-Mt3dk4_6.js → RoomSurface-YZW_jtGD.js} +1 -1
- package/dist/client/assets/{RoomsPage-ByHhS_HA.js → RoomsPage-BY2Yzdxs.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DS8_Au0B.js → RunsOnPopover-CeQJLljM.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-hhvWVRMu.js → RuntimeConnectFlow-BgLzK2Pf.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-NKy3mLEH.js → RuntimeSetupDialog-B9dgB_DN.js} +1 -1
- package/dist/client/assets/{SeenDevices-65oxnxk6.js → SeenDevices-C-4m1c9h.js} +1 -1
- package/dist/client/assets/{SessionsPage-WbWf0huR.js → SessionsPage-B5PdbDLK.js} +1 -1
- package/dist/client/assets/{SettingsDialog-e33ltTb6.js → SettingsDialog-C8TP1x7g.js} +1 -1
- package/dist/client/assets/{SkillsPage-Cj3XrV8s.js → SkillsPage-D5GNx64I.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-DJAGQuab.js → TaskDialogWrapper-DOpxfrLl.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-DNI1C274.js → TasksEmptyState-sW-pmnOm.js} +1 -1
- package/dist/client/assets/{TasksPage-Dc1j_X1K.js → TasksPage-BGtTF442.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-DWenh1bP.js → TeamComputerEntry-BCW51xMv.js} +1 -1
- package/dist/client/assets/{ToolsPage-CXKq_axq.js → ToolsPage-Craa3-78.js} +1 -1
- package/dist/client/assets/{TopologyGraph-DgTGLoaA.js → TopologyGraph-BVbPyC0W.js} +1 -1
- package/dist/client/assets/{TourHost-C4KKDX9k.js → TourHost-ChgzKB0c.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-GfsbP91q.js → UnlinkDialog-BtQvTzCP.js} +1 -1
- package/dist/client/assets/{UnreadDivider-C52_nmrB.js → UnreadDivider-qMUA2rFP.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-BZkAK-Ke.js → WidgetErrorCard-DcsOHVds.js} +1 -1
- package/dist/client/assets/{WithheldExtensionsNotice-Dt51QZLT.js → WithheldExtensionsNotice-Cts8hGJP.js} +1 -1
- package/dist/client/assets/{WorkView-YozVoXhb.js → WorkView-ynqZVa-o.js} +1 -1
- package/dist/client/assets/{_shell-BScdINMH.js → _shell-DOg4Lmhv.js} +1 -1
- package/dist/client/assets/{_shell._home-CUusDXBM.js → _shell._home-BZpx4Mbk.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-DPjJ1_vZ.js → _shell._home.activity-Dk3nKLHQ.js} +1 -1
- package/dist/client/assets/{_shell._home.index-CTBWy5Au.js → _shell._home.index-B9rvWnn_.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-DWFh5Qbq.js → _shell._home.tasks-BCPd5sNc.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-DWjB1sCd.js → _shell._home.workspaces-BVBkkkT0.js} +1 -1
- package/dist/client/assets/{_shell.channels-C6v3yOzH.js → _shell.channels-myIv11W5.js} +1 -1
- package/dist/client/assets/{_shell.connections-jXaP35mN.js → _shell.connections-DFZFVHNc.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-CyV-aboj.js → _shell.feedback-requests-tPcWZDaV.js} +1 -1
- package/dist/client/assets/_shell.marketplace-DIC-vQZq.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-Dk7fKhJ6.js +1 -0
- package/dist/client/assets/_shell.session-BAq7SnHK.js +1 -0
- package/dist/client/assets/{_shell.team-BPevCu33.js → _shell.team-IofNRuKL.js} +3 -3
- package/dist/client/assets/{_shell.threads-gzYSpt7x.js → _shell.threads-B-nWDy_6.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-B9CWzm8d.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-B9CWzm8d.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-iUnN9Com.js → abnfDiagram-WEYOIA3C-COAdUrvu.js} +1 -1
- package/dist/client/assets/{access-copy-CP0B1ZT9.js → access-copy-laAy9--H.js} +1 -1
- package/dist/client/assets/{arc-BVSQ4HBO.js → arc-2_zvZ-gp.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-_zlUU8PS.js → architectureDiagram-ZHVYKT53-D2vJp2ju.js} +1 -1
- package/dist/client/assets/{banner-DTCBttcQ.js → banner-Dq7DY4At.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-COqNq2ny.js → blockDiagram-RJAE7QA3-CxjfUYKV.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-Caa3QxQ_.js → c4Diagram-XDPPPE54-DBtTwidp.js} +1 -1
- package/dist/client/assets/{card-D9DO5nt4.js → card-fYp8lOoT.js} +1 -1
- package/dist/client/assets/channel-ByM_gaT3.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-BqirxZIN.js → chunk-2E7WHVMD-BAzBaRVY.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-CYGt3XQf.js → chunk-2Q5K7J3B-0_0KxG0G.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Bx234GPP.js → chunk-4EMNKR2T-DmpZgXUr.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-CAA7du3_.js → chunk-55XCU76K-DOa5mrA1.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-Dxl-FvVz.js → chunk-5VM5RSS4-BqzmE_oJ.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-CjcTenhr.js → chunk-JWPE2WC7-C2F-qKzA.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-COdK9J2i.js → chunk-VQ5W62QI-Cj9J_zab.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-DeXzMeSy.js → chunk-XXDRQBXY-Cyiza8Ap.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-C7r0u2k6.js → chunk-ZCHMQSOR-ITupr164.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-BSI2Eza3.js → classDiagram-v2-4MYWR3UA-BH0_3wSx.js} +1 -1
- package/dist/client/assets/{command-C7Cl56dV.js → command-tbegvEE8.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-CLzQXbOG.js → cose-bilkent-JH36ORCC-sZqlNAZ4.js} +1 -1
- package/dist/client/assets/{cpu-CLfYM0zq.js → cpu-DDplcjVv.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-e_0nKhb5.js → cynefin-EF2NZ3EQ-6Kjz5H9v.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-Cflfw_GE.js → cynefinDiagram-WF24UDRP-DK7-moDM.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-D66Simjb.js → dagre-NK4GIZVX-C---Yw3S.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-CJEeUCUY.js → diagram-CBK3MWTC-BZo3ih_3.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-BPSiDLoN.js → diagram-I5XIIV2D-DsHN5Ikp.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-DJptgW_s.js → diagram-ODIL2UCW-CVtFfjkm.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BECklqVg.js → diagram-PFBEJUXE-RrxvbTzz.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-B-veBl7Z.js → diagram-RJA3I4VV-T4vRcsqE.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-U8kleemE.js → diagram-TYUNFSNR-DvgDENOh.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DlwBfJCe.js → ebnfDiagram-V4P3TTPT-CT_Ykhnb.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-DnFzEb3y.js → elk-QONTBCTQ-1cHLrAbL.js} +1 -1
- package/dist/client/assets/{empty-state-2mQX7azC.js → empty-state-BuerUR2L.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-CYTM37Ws.js → erDiagram-KYQIGQAA-sKNWkMEB.js} +1 -1
- package/dist/client/assets/{execution-config-COqY7hHn.js → execution-config-b_HoE2gl.js} +1 -1
- package/dist/client/assets/{file-CKSjJRX5.js → file-CG3ZGubn.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-ad7FedZ9.js → file-exclamation-point-CVXN_udI.js} +1 -1
- package/dist/client/assets/{file-text-DXPPkxAL.js → file-text-iUPjXTFV.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-BsDq4SYp.js → find-latest-widget-fence-DF1tpWBU.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-DD259OPj.js → flowDiagram-IUGLLWBU-Dpro5XJ_.js} +1 -1
- package/dist/client/assets/{form-C9cPRNOV.js → form-CiD71zin.js} +1 -1
- package/dist/client/assets/{format-cron-DIw9_M6c.js → format-cron-B88ttX8j.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-BmoAVY6N.js → ganttDiagram-R7GPNTJY-CtR4oMUH.js} +1 -1
- package/dist/client/assets/{git-branch-DlUQMA-U.js → git-branch-DZBdAsc0.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-Db8GGxGr.js → gitGraphDiagram-PDYL7XHY--euaveVk.js} +1 -1
- package/dist/client/assets/{graph-BqwkokGk.js → graph-jzPQScij.js} +1 -1
- package/dist/client/assets/{heart-CRoafWCm.js → heart-CNrKCfIZ.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-D-QIuqsv.js → highlighted-body-KPVGNVTW-3HmPoqzm.js} +1 -1
- package/dist/client/assets/{image-lightbox-BZBT_ptW.js → image-lightbox-CV8y6iVA.js} +1 -1
- package/dist/client/assets/{image-off-Bc6AP3w0.js → image-off-0A5Y9ekR.js} +1 -1
- package/dist/client/assets/{index-jIAsl-Y5.js → index-1z7QYB4x.js} +2 -2
- package/dist/client/assets/{index-BeCzlnZ3.js → index-B2dE15Nh.js} +1 -1
- package/dist/client/assets/{index-CWfreKgt.js → index-BBSooI6P.js} +1 -1
- package/dist/client/assets/{index-Dtb34mrg.js → index-BKDTRodW.js} +1 -1
- package/dist/client/assets/{index-CNsZn6QE.js → index-BL3de6b2.js} +1 -1
- package/dist/client/assets/{index-bSzhhjtG.js → index-BLHGc7hd.js} +1 -1
- package/dist/client/assets/{index-ByyXrDny.js → index-BP95cLC1.js} +1 -1
- package/dist/client/assets/{index-CTFwtIJP.js → index-BU6kskMP.js} +1 -1
- package/dist/client/assets/index-BUTqV5Hw.js +1 -0
- package/dist/client/assets/{index-Clr1ssap.js → index-BZkrahcw.js} +1 -1
- package/dist/client/assets/{index-BHNwprrd.js → index-B_ScMg0T.js} +1 -1
- package/dist/client/assets/{index-CZ4wx2F3.js → index-Bgo2UMWk.js} +1 -1
- package/dist/client/assets/{index-zIfhHvVv.js → index-BihGQXHU.js} +1 -1
- package/dist/client/assets/index-BuLpfIsj.js +1 -0
- package/dist/client/assets/{index-Bw1l5I4w.js → index-BwqobvEU.js} +1 -1
- package/dist/client/assets/{index-CptdhVbC.js → index-C2NwvhhG.js} +1 -1
- package/dist/client/assets/{index-AxYQRAoO.js → index-COAKEYxS.js} +1 -1
- package/dist/client/assets/{index-CWx_JEio.js → index-CeqxJyr2.js} +1 -1
- package/dist/client/assets/{index-zSj20f3H.js → index-ClIWAc6a.js} +1 -1
- package/dist/client/assets/{index-CMWttCLt.js → index-CsGjmUNs.js} +1 -1
- package/dist/client/assets/{index-a8LKmWxN.js → index-Cu4ctkPn.js} +1 -1
- package/dist/client/assets/{index-CoFRHepD.js → index-D0wnu6mZ.js} +1 -1
- package/dist/client/assets/{index-DDGc0Nfu.js → index-D6lfnwuN.js} +1 -1
- package/dist/client/assets/{index-Cs9yQ5zH.js → index-D7HEC8Yo.js} +1 -1
- package/dist/client/assets/{index-Hf3kLtiJ.js → index-DFSOBVsY.js} +1 -1
- package/dist/client/assets/{index-y1yAU07O.js → index-DGl_kpd1.js} +1 -1
- package/dist/client/assets/{index-CFV7Ggyj.js → index-DKxKfg7Y.js} +1 -1
- package/dist/client/assets/{index-Be3_cvW0.js → index-DTmOp_1r.js} +1 -1
- package/dist/client/assets/{index-BwOvHDL2.js → index-DdHstbQU.js} +1 -1
- package/dist/client/assets/{index-mrbr3BaJ.js → index-DdLM7r4n.js} +1 -1
- package/dist/client/assets/{index-x0XGESNQ.js → index-DjmZGH7V.js} +1 -1
- package/dist/client/assets/{index-DV5hFlfw.js → index-DloK7L_D.js} +1 -1
- package/dist/client/assets/{index-Cx2slDvh.js → index-DxYiYBCN.js} +1 -1
- package/dist/client/assets/{index-B_i3pTpf.js → index-DyyjN4h7.js} +1 -1
- package/dist/client/assets/{index-DwyVu2Mh.js → index-GPUOanO_.js} +1 -1
- package/dist/client/assets/{index-DMlo5rLX.js → index-JGRdQWAP.js} +1 -1
- package/dist/client/assets/{index-Cpy9wOYc.js → index-KUHF1hd1.js} +1 -1
- package/dist/client/assets/{index-eF6QtmU6.js → index-PQ9ky1pb.js} +1 -1
- package/dist/client/assets/{index-DfWZORsm.js → index-ZV77GAWw.js} +1 -1
- package/dist/client/assets/{index-B48IJBNm.js → index-_8SHxs8S.js} +247 -247
- package/dist/client/assets/{index-78G8l1M7.js → index-mG1tkeJL.js} +1 -1
- package/dist/client/assets/{index-sCJ7YWzB.js → index-qgNv3Cxj.js} +3 -3
- package/dist/client/assets/{index-okP_lDUw.js → index-zQs7Z5os.js} +1 -1
- package/dist/client/assets/{index.esm-uC5dql6Q.js → index.esm-C41qhCJ5.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-y6U3OQ5m.js → infoDiagram-MVDRKAX5-DrdZIXXy.js} +1 -1
- package/dist/client/assets/{inline-code-BCFlKPIb.js → inline-code-AHNJTNEg.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D32SA0vX.js → ishikawaDiagram-HPEHV2GE-DUbSK1_E.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-D1X0dI8X.js → journeyDiagram-BOSHW7O7-BR52zXJU.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-gU9KcKa4.js → kanban-definition-FNSA4HC5-_Wcjt7SY.js} +1 -1
- package/dist/client/assets/{layers-A4MxcGWV.js → layers-IVPemhwp.js} +1 -1
- package/dist/client/assets/{lightbulb-Dh2dYHMS.js → lightbulb-DrVZQcOf.js} +1 -1
- package/dist/client/assets/{link-2-qEUih2FP.js → link-2-Irbj23wB.js} +1 -1
- package/dist/client/assets/{list-runtime-types-B1J9AtqH.js → list-runtime-types-BtXx3u9w.js} +1 -1
- package/dist/client/assets/{markdown-content-BA0KEJH_.js → markdown-content-DBXaMyx0.js} +1 -1
- package/dist/client/assets/{mention-pill-0aHe3D1A.js → mention-pill-BjC9bceV.js} +1 -1
- package/dist/client/assets/{mermaid.core-Birdr1kF.js → mermaid.core-BwsoL8Cm.js} +4 -4
- package/dist/client/assets/{message-square-off-DvVenheW.js → message-square-off-CIYKFEKw.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-CLlh3nSF.js → mindmap-definition-6OY57UG3-1IqhYOl3.js} +1 -1
- package/dist/client/assets/{more-details-Bo2AAXHj.js → more-details-CEMEkDUz.js} +1 -1
- package/dist/client/assets/{owner-notice-DReCUEf1.js → owner-notice-BJY5v-87.js} +1 -1
- package/dist/client/assets/{package-CxZe6vve.js → package-CTn_hN2S.js} +1 -1
- package/dist/client/assets/{page-container-Bx1sr900.js → page-container-Cde6fRTi.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-ojhYGmDs.js → pane-resize-handle-CyT6JG8q.js} +1 -1
- package/dist/client/assets/{paperclip-D3-8ygf1.js → paperclip-szlXSQSk.js} +1 -1
- package/dist/client/assets/{path-input-D_o1_pAa.js → path-input-AlewPslD.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-BeMd_oXJ.js → pegDiagram-ECIUJNBX-Djw-8h2r.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CXUXnp_A.js → pieDiagram-GNMPY74T-DsZyw9x9.js} +1 -1
- package/dist/client/assets/{plug-Du5LK0oZ.js → plug-CgD9bf2Y.js} +1 -1
- package/dist/client/assets/{primer-trigger-BxofQe1n.js → primer-trigger-ZBFgqPeY.js} +1 -1
- package/dist/client/assets/{profile-errors-C0BgTjzk.js → profile-errors-Lfs66dvr.js} +1 -1
- package/dist/client/assets/{progress-AKcr8opu.js → progress-BKspNOdx.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-FTkKRlZm.js → quadrantDiagram-D57K4MC3-D_Vi6U-2.js} +1 -1
- package/dist/client/assets/{query-error-state-CRmZMMkL.js → query-error-state-B9bR1eRh.js} +1 -1
- package/dist/client/assets/{radio-DQHR6Su5.js → radio-CmZ30mVT.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-D5TdGrPg.js → railroadDiagram-Y72NRBL7-C6PgeQHt.js} +1 -1
- package/dist/client/assets/{registry-BxY1lah6.js → registry-CSe_ncC2.js} +4 -4
- package/dist/client/assets/registry-D10b3VBA.js +1 -0
- package/dist/client/assets/{relay-trace-schemas---fuhTF2.js → relay-trace-schemas-CdZnmG6_.js} +1 -1
- package/dist/client/assets/{repeat-zL9y24zY.js → repeat-DmCgFtjt.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-Dxiv9lE0.js → requirementDiagram-EQYSW5RA-CnNYn7qe.js} +1 -1
- package/dist/client/assets/{room-files-source-B0WR4gIC.js → room-files-source-BbEFTxX0.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-BUhy2_cF.js → rotate-ccw-clock-k0vIMOao.js} +1 -1
- package/dist/client/assets/{rotate-cw-CCrNd4eJ.js → rotate-cw-OJ7jzj3C.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-C3jjstXq.js → sankeyDiagram-SY24JHO5-0KFthF8u.js} +1 -1
- package/dist/client/assets/{scroll-area-D6gNpFjK.js → scroll-area-vYE-OvYe.js} +1 -1
- package/dist/client/assets/{search-x-CUZ1LRYe.js → search-x-mbqB9SFV.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CIDmjz0x.js → sequenceDiagram-BLEHNHQU-BD3TzBXD.js} +1 -1
- package/dist/client/assets/{shield-x-Ch7sY2XD.js → shield-x-By16ILlp.js} +1 -1
- package/dist/client/assets/{signed-in-BQ44fFH5.js → signed-in-DNUF_3Fa.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-Dkp-75Wy.js → sizeCapture-INFHLROL-BIJvrYdE.js} +1 -1
- package/dist/client/assets/{soul-file-CTFcpRMh.js → soul-file-C81l7z8x.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-L_51UnwV.js → stateDiagram-v2-A6IESKWZ-CtigYKfx.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-D-etAQQd.js → swimlanes-B3ENRKFQ-CPMK7lCN.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-C24DKoiY.js +8 -0
- package/dist/client/assets/{table-D6BUawIb.js → table-jPIEjPov.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-DNxnC3VG.js → timeline-definition-JXYKGLGB-CtihfrW4.js} +1 -1
- package/dist/client/assets/{trust-posture-5IWBJmA5.js → trust-posture-olfknSP7.js} +1 -1
- package/dist/client/assets/{unplug-BVIT6OSL.js → unplug-Bm7nHhBA.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BA7_V-80.js → unverified-catalog-notice-DogkKIUJ.js} +1 -1
- package/dist/client/assets/{use-bindings-DdWRXvtd.js → use-bindings-C0bBY5jd.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-DC5w4eWw.js → use-composer-prefs-V6vxLUUc.js} +1 -1
- package/dist/client/assets/{use-connector-management-DDlpD6tk.js → use-connector-management-DLOJoz45.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Cvv0VcXx.js → use-deep-link-scroll-ODQAWdEP.js} +1 -1
- package/dist/client/assets/{use-delete-binding-D585ISkL.js → use-delete-binding-BL0OOgo0.js} +1 -1
- package/dist/client/assets/{use-dev-links-BwS5hgur.js → use-dev-links-DmzL_awM.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel--unflmj8.js → use-direct-message-panel-7DpsxnS_.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-DUyh1bH1.js → use-external-adapter-catalog-D7yXhN3U.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-DsNOIkL8.js → use-full-activity-feed-CnShEfSU.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-C1nTBNsP.js +1 -0
- package/dist/client/assets/{use-local-browser-DGIut7R4.js → use-local-browser-Ba-XDxE0.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-DNXD7seM.js → use-mesh-topology-DhUhzu7Y.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-7xoMthh4.js → use-mounted-ref-Vm8D40hS.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-CzibxpTZ.js → use-notification-prefs-Cjb26GhZ.js} +1 -1
- package/dist/client/assets/use-pending-read-r81zBhY9.js +1 -0
- package/dist/client/assets/{use-personality-commit-isaMS7W5.js → use-personality-commit-D1SSZI1q.js} +1 -1
- package/dist/client/assets/{use-promo-activation-DesLEeyi.js → use-promo-activation-D1DYLKS8.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-DQi8tey8.js → use-promo-dismissals-ByGIekeo.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-DPplpvcq.js → use-pulse-freshness-CDqh0_k8.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-C4UikQzz.js → use-room-follow-claim-ysyr_uyD.js} +1 -1
- package/dist/client/assets/{use-room-sessions-C6wsszcG.js → use-room-sessions-_zhdKcKj.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-DEh387tR.js → use-roving-tab-list-CoJ0aHCJ.js} +1 -1
- package/dist/client/assets/{use-session-canvas-B2CM1KZu.js → use-session-canvas-IKy8PO1l.js} +3 -3
- package/dist/client/assets/{use-status-budget-CltxSIUD.js → use-status-budget-yYQ7GR9y.js} +1 -1
- package/dist/client/assets/{use-transform-CNLqlc2h.js → use-transform-B5MsPCLG.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-DJyl7A1E.js → use-unclaimed-chats-CjOWILFh.js} +1 -1
- package/dist/client/assets/use-update-config-B49bVEOw.js +1 -0
- package/dist/client/assets/{useMutationState-BX-ggHVY.js → useMutationState-4dFTMb_f.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-2l6yZUUH.js → usecaseDiagram-WPOLBNNX-DD4D-089.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-DIOfjNDq.js → vennDiagram-Q3Y3IDCW-DjVDYX3w.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-B5Hx1we8.js → wardleyDiagram-IVAIDKWA-bupKx7P8.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-sy90CqIK.js → xychartDiagram-4URNHDU4-DoCyS7MC.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/drizzle/20261030041403_dor3376_project_only_schedules.sql +1 -0
- package/dist/drizzle/meta/20261030041403_snapshot.json +14101 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +16905 -15493
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/HandlePage-BciCIffv.js +0 -1
- package/dist/client/assets/NamePage-tBV32PJI.js +0 -1
- package/dist/client/assets/PhotoPage-DtX2GEvQ.js +0 -1
- package/dist/client/assets/_shell.marketplace-Cp2Udmlv.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-Dg0YgG-u.js +0 -1
- package/dist/client/assets/_shell.session-DyKnijqi.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-BA0u_ZTU.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BA0u_ZTU.js +0 -1
- package/dist/client/assets/channel-CenDG0-I.js +0 -1
- package/dist/client/assets/index-DSt16Y0s.js +0 -1
- package/dist/client/assets/index-sZ8Dddnp.js +0 -1
- package/dist/client/assets/registry-CWK5lzYs.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-zjIBWGY4.js +0 -8
- package/dist/client/assets/use-is-below-desktop-C-4kc5lS.js +0 -1
- package/dist/client/assets/use-pending-read-BTR5-HXf.js +0 -1
- package/dist/client/assets/use-update-config-B2rsDnxk.js +0 -1
package/dist/bin/cli.js
CHANGED
|
@@ -345,10 +345,10 @@ function mergeDefs(...defs) {
|
|
|
345
345
|
function cloneDef(schema3) {
|
|
346
346
|
return mergeDefs(schema3._zod.def);
|
|
347
347
|
}
|
|
348
|
-
function getElementAtPath(obj,
|
|
349
|
-
if (!
|
|
348
|
+
function getElementAtPath(obj, path74) {
|
|
349
|
+
if (!path74)
|
|
350
350
|
return obj;
|
|
351
|
-
return
|
|
351
|
+
return path74.reduce((acc, key) => acc?.[key], obj);
|
|
352
352
|
}
|
|
353
353
|
function promiseAllObject(promisesObj) {
|
|
354
354
|
const keys = Object.keys(promisesObj);
|
|
@@ -607,11 +607,11 @@ function explicitlyAborted(x2, startIndex = 0) {
|
|
|
607
607
|
}
|
|
608
608
|
return false;
|
|
609
609
|
}
|
|
610
|
-
function prefixIssues(
|
|
610
|
+
function prefixIssues(path74, issues) {
|
|
611
611
|
return issues.map((iss) => {
|
|
612
612
|
var _a7;
|
|
613
613
|
(_a7 = iss).path ?? (_a7.path = []);
|
|
614
|
-
iss.path.unshift(
|
|
614
|
+
iss.path.unshift(path74);
|
|
615
615
|
return iss;
|
|
616
616
|
});
|
|
617
617
|
}
|
|
@@ -1144,16 +1144,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
1146
1146
|
const fieldErrors = { _errors: [] };
|
|
1147
|
-
const processError = (error64,
|
|
1147
|
+
const processError = (error64, path74 = []) => {
|
|
1148
1148
|
for (const issue2 of error64.issues) {
|
|
1149
1149
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1150
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1150
|
+
issue2.errors.map((issues) => processError({ issues }, [...path74, ...issue2.path]));
|
|
1151
1151
|
} else if (issue2.code === "invalid_key") {
|
|
1152
|
-
processError({ issues: issue2.issues }, [...
|
|
1152
|
+
processError({ issues: issue2.issues }, [...path74, ...issue2.path]);
|
|
1153
1153
|
} else if (issue2.code === "invalid_element") {
|
|
1154
|
-
processError({ issues: issue2.issues }, [...
|
|
1154
|
+
processError({ issues: issue2.issues }, [...path74, ...issue2.path]);
|
|
1155
1155
|
} else {
|
|
1156
|
-
const fullpath = [...
|
|
1156
|
+
const fullpath = [...path74, ...issue2.path];
|
|
1157
1157
|
if (fullpath.length === 0) {
|
|
1158
1158
|
fieldErrors._errors.push(mapper(issue2));
|
|
1159
1159
|
} else {
|
|
@@ -1192,17 +1192,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
1194
1194
|
const result2 = { errors: [] };
|
|
1195
|
-
const processError = (error64,
|
|
1195
|
+
const processError = (error64, path74 = []) => {
|
|
1196
1196
|
var _a7;
|
|
1197
1197
|
for (const issue2 of error64.issues) {
|
|
1198
1198
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1199
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1199
|
+
issue2.errors.map((issues) => processError({ issues }, [...path74, ...issue2.path]));
|
|
1200
1200
|
} else if (issue2.code === "invalid_key") {
|
|
1201
|
-
processError({ issues: issue2.issues }, [...
|
|
1201
|
+
processError({ issues: issue2.issues }, [...path74, ...issue2.path]);
|
|
1202
1202
|
} else if (issue2.code === "invalid_element") {
|
|
1203
|
-
processError({ issues: issue2.issues }, [...
|
|
1203
|
+
processError({ issues: issue2.issues }, [...path74, ...issue2.path]);
|
|
1204
1204
|
} else {
|
|
1205
|
-
const fullpath = [...
|
|
1205
|
+
const fullpath = [...path74, ...issue2.path];
|
|
1206
1206
|
if (fullpath.length === 0) {
|
|
1207
1207
|
result2.errors.push(mapper(issue2));
|
|
1208
1208
|
continue;
|
|
@@ -1241,8 +1241,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
function toDotPath(_path) {
|
|
1243
1243
|
const segs = [];
|
|
1244
|
-
const
|
|
1245
|
-
for (const seg of
|
|
1244
|
+
const path74 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1245
|
+
for (const seg of path74) {
|
|
1246
1246
|
if (typeof seg === "number")
|
|
1247
1247
|
segs.push(`[${seg}]`);
|
|
1248
1248
|
else if (typeof seg === "symbol")
|
|
@@ -19274,13 +19274,13 @@ function resolveRef(ref, ctx) {
|
|
|
19274
19274
|
if (!ref.startsWith("#")) {
|
|
19275
19275
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
19276
19276
|
}
|
|
19277
|
-
const
|
|
19278
|
-
if (
|
|
19277
|
+
const path74 = ref.slice(1).split("/").filter(Boolean);
|
|
19278
|
+
if (path74.length === 0) {
|
|
19279
19279
|
return ctx.rootSchema;
|
|
19280
19280
|
}
|
|
19281
19281
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
19282
|
-
if (
|
|
19283
|
-
const key =
|
|
19282
|
+
if (path74[0] === defsKey) {
|
|
19283
|
+
const key = path74[1] === void 0 ? void 0 : decodeJSONPointerSegment(path74[1]);
|
|
19284
19284
|
if (!key || !ctx.defs[key]) {
|
|
19285
19285
|
throw new Error(`Reference not found: ${ref}`);
|
|
19286
19286
|
}
|
|
@@ -26844,23 +26844,22 @@ var init_config_schema = __esm({
|
|
|
26844
26844
|
});
|
|
26845
26845
|
|
|
26846
26846
|
// ../shared/src/links.ts
|
|
26847
|
-
function join(base,
|
|
26848
|
-
if (
|
|
26849
|
-
return `${base}/${
|
|
26847
|
+
function join(base, path74) {
|
|
26848
|
+
if (path74 === "" || /^[/?#]/.test(path74)) return `${base}${path74}`;
|
|
26849
|
+
return `${base}/${path74}`;
|
|
26850
26850
|
}
|
|
26851
|
-
function siteUrl(
|
|
26852
|
-
return join(links.site,
|
|
26851
|
+
function siteUrl(path74 = "") {
|
|
26852
|
+
return join(links.site, path74);
|
|
26853
26853
|
}
|
|
26854
|
-
function docsUrl(
|
|
26855
|
-
return join(links.docs,
|
|
26854
|
+
function docsUrl(path74 = "") {
|
|
26855
|
+
return join(links.docs, path74);
|
|
26856
26856
|
}
|
|
26857
|
-
function repoUrl(
|
|
26858
|
-
return join(links.repo,
|
|
26857
|
+
function repoUrl(path74 = "") {
|
|
26858
|
+
return join(links.repo, path74);
|
|
26859
26859
|
}
|
|
26860
26860
|
var GITHUB_ORG, links;
|
|
26861
26861
|
var init_links = __esm({
|
|
26862
26862
|
"../shared/src/links.ts"() {
|
|
26863
|
-
"use strict";
|
|
26864
26863
|
GITHUB_ORG = "dork-labs";
|
|
26865
26864
|
links = {
|
|
26866
26865
|
/** The public origin of the marketing site, the docs and DorkOS Cloud. */
|
|
@@ -27289,7 +27288,7 @@ import path3 from "path";
|
|
|
27289
27288
|
import { fileURLToPath } from "url";
|
|
27290
27289
|
function resolveVersion() {
|
|
27291
27290
|
if (env2.DORKOS_VERSION_OVERRIDE) return env2.DORKOS_VERSION_OVERRIDE;
|
|
27292
|
-
if (true) return "0.127.
|
|
27291
|
+
if (true) return "0.127.1";
|
|
27293
27292
|
const pkgPath = path3.join(path3.dirname(fileURLToPath(import.meta.url)), "../../package.json");
|
|
27294
27293
|
return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
27295
27294
|
}
|
|
@@ -27492,8 +27491,8 @@ and your settings stay in the file you renamed.`;
|
|
|
27492
27491
|
});
|
|
27493
27492
|
|
|
27494
27493
|
// ../../apps/server/src/services/core/config/browser-setting.ts
|
|
27495
|
-
function browserSettingRefusal(
|
|
27496
|
-
const enabled3 =
|
|
27494
|
+
function browserSettingRefusal(path74, value) {
|
|
27495
|
+
const enabled3 = path74 === "browser.enabled" ? value : path74 === "browser" && value !== null && typeof value === "object" ? value.enabled : void 0;
|
|
27497
27496
|
return enabled3 === true ? BROWSER_SETTING_UNAVAILABLE : null;
|
|
27498
27497
|
}
|
|
27499
27498
|
var BROWSER_SETTING_UNAVAILABLE;
|
|
@@ -27525,9 +27524,9 @@ function hubPinnedRead(key, value) {
|
|
|
27525
27524
|
}
|
|
27526
27525
|
return value;
|
|
27527
27526
|
}
|
|
27528
|
-
function hubSettingRefusal(
|
|
27527
|
+
function hubSettingRefusal(path74, value) {
|
|
27529
27528
|
if (currentServerRole() !== "hub") return null;
|
|
27530
|
-
const enabled3 =
|
|
27529
|
+
const enabled3 = path74 === "auth.enabled" ? value : path74 === "auth" && value !== null && typeof value === "object" ? value.enabled : true;
|
|
27531
27530
|
return enabled3 === false ? HUB_LOGIN_ALWAYS_ON : null;
|
|
27532
27531
|
}
|
|
27533
27532
|
var HUB_LOGIN_ALWAYS_ON;
|
|
@@ -27607,9 +27606,9 @@ var init_trusted_carryovers = __esm({
|
|
|
27607
27606
|
});
|
|
27608
27607
|
|
|
27609
27608
|
// ../../apps/server/src/services/core/safe-defaults/protected-state.ts
|
|
27610
|
-
function readPath(root,
|
|
27609
|
+
function readPath(root, path74) {
|
|
27611
27610
|
let cursor = root;
|
|
27612
|
-
for (const part of
|
|
27611
|
+
for (const part of path74.split(".")) {
|
|
27613
27612
|
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
27614
27613
|
cursor = cursor[part];
|
|
27615
27614
|
}
|
|
@@ -27621,8 +27620,8 @@ function sectionSchemaAccepts(section, draft) {
|
|
|
27621
27620
|
if (!schema3) return false;
|
|
27622
27621
|
return schema3.safeParse(draft).success;
|
|
27623
27622
|
}
|
|
27624
|
-
function writePath(root,
|
|
27625
|
-
const parts =
|
|
27623
|
+
function writePath(root, path74, value) {
|
|
27624
|
+
const parts = path74.split(".");
|
|
27626
27625
|
const leaf = parts.pop();
|
|
27627
27626
|
if (leaf === void 0) return;
|
|
27628
27627
|
let cursor = root;
|
|
@@ -27755,13 +27754,13 @@ function applyProtectedState(store, salvaged) {
|
|
|
27755
27754
|
sections.set("telemetry", { ...section("telemetry"), ...salvaged.telemetry });
|
|
27756
27755
|
label("telemetry", "telemetry (your consent choice)");
|
|
27757
27756
|
}
|
|
27758
|
-
for (const [
|
|
27759
|
-
const [top, ...rest] =
|
|
27757
|
+
for (const [path74, value] of Object.entries(salvaged.leaves)) {
|
|
27758
|
+
const [top, ...rest] = path74.split(".");
|
|
27760
27759
|
if (top === void 0) continue;
|
|
27761
27760
|
const draft = section(top);
|
|
27762
27761
|
if (rest.length === 0) continue;
|
|
27763
27762
|
writePath(draft, rest.join("."), value);
|
|
27764
|
-
label(top,
|
|
27763
|
+
label(top, path74);
|
|
27765
27764
|
}
|
|
27766
27765
|
const restored = [];
|
|
27767
27766
|
for (const [name2, value] of sections) {
|
|
@@ -27787,9 +27786,9 @@ function restoreProtectedState(store, stored, context2) {
|
|
|
27787
27786
|
if (restored.length > 0) {
|
|
27788
27787
|
logger.warn(`[Config] ${context2}: kept your safer settings \u2014 ${restored.join(", ")}`);
|
|
27789
27788
|
}
|
|
27790
|
-
for (const { path:
|
|
27789
|
+
for (const { path: path74, reason } of salvaged.dropped) {
|
|
27791
27790
|
logger.warn(
|
|
27792
|
-
`[Config] Could not keep your ${
|
|
27791
|
+
`[Config] Could not keep your ${path74} setting: ${reason}. It is back at the default.`
|
|
27793
27792
|
);
|
|
27794
27793
|
}
|
|
27795
27794
|
}
|
|
@@ -28140,16 +28139,16 @@ function processSegment(segment, parts) {
|
|
|
28140
28139
|
}
|
|
28141
28140
|
return true;
|
|
28142
28141
|
}
|
|
28143
|
-
function parsePath(
|
|
28144
|
-
if (typeof
|
|
28145
|
-
throw new TypeError(`Expected a string, got ${typeof
|
|
28142
|
+
function parsePath(path74) {
|
|
28143
|
+
if (typeof path74 !== "string") {
|
|
28144
|
+
throw new TypeError(`Expected a string, got ${typeof path74}`);
|
|
28146
28145
|
}
|
|
28147
28146
|
const parts = [];
|
|
28148
28147
|
let currentSegment = "";
|
|
28149
28148
|
let currentPart = "start";
|
|
28150
28149
|
let isEscaping = false;
|
|
28151
28150
|
let position = 0;
|
|
28152
|
-
for (const character of
|
|
28151
|
+
for (const character of path74) {
|
|
28153
28152
|
position++;
|
|
28154
28153
|
if (isEscaping) {
|
|
28155
28154
|
currentSegment += character;
|
|
@@ -28259,13 +28258,13 @@ function parsePath(path73) {
|
|
|
28259
28258
|
}
|
|
28260
28259
|
return parts;
|
|
28261
28260
|
}
|
|
28262
|
-
function normalizePath(
|
|
28263
|
-
if (typeof
|
|
28264
|
-
return parsePath(
|
|
28261
|
+
function normalizePath(path74) {
|
|
28262
|
+
if (typeof path74 === "string") {
|
|
28263
|
+
return parsePath(path74);
|
|
28265
28264
|
}
|
|
28266
|
-
if (Array.isArray(
|
|
28265
|
+
if (Array.isArray(path74)) {
|
|
28267
28266
|
const normalized = [];
|
|
28268
|
-
for (const [index2, segment] of
|
|
28267
|
+
for (const [index2, segment] of path74.entries()) {
|
|
28269
28268
|
if (typeof segment !== "string" && typeof segment !== "number") {
|
|
28270
28269
|
throw new TypeError(`Expected a string or number for path segment at index ${index2}, got ${typeof segment}`);
|
|
28271
28270
|
}
|
|
@@ -28285,11 +28284,11 @@ function normalizePath(path73) {
|
|
|
28285
28284
|
}
|
|
28286
28285
|
return [];
|
|
28287
28286
|
}
|
|
28288
|
-
function getProperty(object2,
|
|
28289
|
-
if (!isObject2(object2) || typeof
|
|
28287
|
+
function getProperty(object2, path74, value) {
|
|
28288
|
+
if (!isObject2(object2) || typeof path74 !== "string" && !Array.isArray(path74)) {
|
|
28290
28289
|
return value === void 0 ? object2 : value;
|
|
28291
28290
|
}
|
|
28292
|
-
const pathArray = normalizePath(
|
|
28291
|
+
const pathArray = normalizePath(path74);
|
|
28293
28292
|
if (pathArray.length === 0) {
|
|
28294
28293
|
return value;
|
|
28295
28294
|
}
|
|
@@ -28305,12 +28304,12 @@ function getProperty(object2, path73, value) {
|
|
|
28305
28304
|
}
|
|
28306
28305
|
return object2 === void 0 ? value : object2;
|
|
28307
28306
|
}
|
|
28308
|
-
function setProperty(object2,
|
|
28309
|
-
if (!isObject2(object2) || typeof
|
|
28307
|
+
function setProperty(object2, path74, value) {
|
|
28308
|
+
if (!isObject2(object2) || typeof path74 !== "string" && !Array.isArray(path74)) {
|
|
28310
28309
|
return object2;
|
|
28311
28310
|
}
|
|
28312
28311
|
const root = object2;
|
|
28313
|
-
const pathArray = normalizePath(
|
|
28312
|
+
const pathArray = normalizePath(path74);
|
|
28314
28313
|
if (pathArray.length === 0) {
|
|
28315
28314
|
return object2;
|
|
28316
28315
|
}
|
|
@@ -28327,11 +28326,11 @@ function setProperty(object2, path73, value) {
|
|
|
28327
28326
|
}
|
|
28328
28327
|
return root;
|
|
28329
28328
|
}
|
|
28330
|
-
function deleteProperty(object2,
|
|
28331
|
-
if (!isObject2(object2) || typeof
|
|
28329
|
+
function deleteProperty(object2, path74) {
|
|
28330
|
+
if (!isObject2(object2) || typeof path74 !== "string" && !Array.isArray(path74)) {
|
|
28332
28331
|
return false;
|
|
28333
28332
|
}
|
|
28334
|
-
const pathArray = normalizePath(
|
|
28333
|
+
const pathArray = normalizePath(path74);
|
|
28335
28334
|
if (pathArray.length === 0) {
|
|
28336
28335
|
return false;
|
|
28337
28336
|
}
|
|
@@ -28351,11 +28350,11 @@ function deleteProperty(object2, path73) {
|
|
|
28351
28350
|
}
|
|
28352
28351
|
}
|
|
28353
28352
|
}
|
|
28354
|
-
function hasProperty(object2,
|
|
28355
|
-
if (!isObject2(object2) || typeof
|
|
28353
|
+
function hasProperty(object2, path74) {
|
|
28354
|
+
if (!isObject2(object2) || typeof path74 !== "string" && !Array.isArray(path74)) {
|
|
28356
28355
|
return false;
|
|
28357
28356
|
}
|
|
28358
|
-
const pathArray = normalizePath(
|
|
28357
|
+
const pathArray = normalizePath(path74);
|
|
28359
28358
|
if (pathArray.length === 0) {
|
|
28360
28359
|
return false;
|
|
28361
28360
|
}
|
|
@@ -32174,8 +32173,8 @@ var require_utils = __commonJS({
|
|
|
32174
32173
|
}
|
|
32175
32174
|
return ind;
|
|
32176
32175
|
}
|
|
32177
|
-
function removeDotSegments(
|
|
32178
|
-
let input4 =
|
|
32176
|
+
function removeDotSegments(path74) {
|
|
32177
|
+
let input4 = path74;
|
|
32179
32178
|
const output2 = [];
|
|
32180
32179
|
let nextSlash = -1;
|
|
32181
32180
|
let len = 0;
|
|
@@ -32584,8 +32583,8 @@ var require_schemes = __commonJS({
|
|
|
32584
32583
|
}
|
|
32585
32584
|
if (wsComponent.resourceName) {
|
|
32586
32585
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
32587
|
-
const
|
|
32588
|
-
wsComponent.path =
|
|
32586
|
+
const path74 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
32587
|
+
wsComponent.path = path74 && path74 !== "/" ? path74 : void 0;
|
|
32589
32588
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
32590
32589
|
wsComponent.resourceName = void 0;
|
|
32591
32590
|
}
|
|
@@ -36922,12 +36921,12 @@ var require_dist = __commonJS({
|
|
|
36922
36921
|
throw new Error(`Unknown format "${name2}"`);
|
|
36923
36922
|
return f3;
|
|
36924
36923
|
};
|
|
36925
|
-
function addFormats(ajv, list,
|
|
36924
|
+
function addFormats(ajv, list, fs43, exportName) {
|
|
36926
36925
|
var _a7;
|
|
36927
36926
|
var _b;
|
|
36928
36927
|
(_a7 = (_b = ajv.opts.code).formats) !== null && _a7 !== void 0 ? _a7 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
36929
36928
|
for (const f3 of list)
|
|
36930
|
-
ajv.addFormat(f3,
|
|
36929
|
+
ajv.addFormat(f3, fs43[f3]);
|
|
36931
36930
|
}
|
|
36932
36931
|
module.exports = exports = formatsPlugin;
|
|
36933
36932
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -40144,22 +40143,22 @@ function withPath(root, segments, value) {
|
|
|
40144
40143
|
if (!isPlainObject4(root)) return root;
|
|
40145
40144
|
return { ...root, [head]: withPath(root[head], rest, value) };
|
|
40146
40145
|
}
|
|
40147
|
-
function leavesUnder(
|
|
40148
|
-
const section =
|
|
40146
|
+
function leavesUnder(path74, policy2) {
|
|
40147
|
+
const section = path74.split(".")[0];
|
|
40149
40148
|
const candidates = policy2.bySection.get(section);
|
|
40150
40149
|
if (candidates === void 0) return NO_RELAXED;
|
|
40151
|
-
if (
|
|
40152
|
-
return candidates.filter((leaf) => leaf.path ===
|
|
40150
|
+
if (path74 === section) return candidates;
|
|
40151
|
+
return candidates.filter((leaf) => leaf.path === path74 || leaf.path.startsWith(`${path74}.`));
|
|
40153
40152
|
}
|
|
40154
|
-
function relativeSegments(
|
|
40155
|
-
return leafPath ===
|
|
40153
|
+
function relativeSegments(path74, leafPath) {
|
|
40154
|
+
return leafPath === path74 ? [] : leafPath.slice(path74.length + 1).split(".");
|
|
40156
40155
|
}
|
|
40157
|
-
function repairWidenedLeaves(
|
|
40158
|
-
const leaves = leavesUnder(
|
|
40156
|
+
function repairWidenedLeaves(path74, value, policy2) {
|
|
40157
|
+
const leaves = leavesUnder(path74, policy2);
|
|
40159
40158
|
let repaired = value;
|
|
40160
40159
|
let skewed;
|
|
40161
40160
|
for (const leaf of leaves) {
|
|
40162
|
-
const relative12 = relativeSegments(
|
|
40161
|
+
const relative12 = relativeSegments(path74, leaf.path);
|
|
40163
40162
|
const stored = relative12.length === 0 ? value : valueAt(value, relative12);
|
|
40164
40163
|
if (stored === MISSING) continue;
|
|
40165
40164
|
if (stored === leaf.fallback) continue;
|
|
@@ -45008,6 +45007,11 @@ var init_yaml_boolean = __esm({
|
|
|
45008
45007
|
});
|
|
45009
45008
|
|
|
45010
45009
|
// ../skills/src/schedule-schema.ts
|
|
45010
|
+
function isProjectRelativePath(value) {
|
|
45011
|
+
if (value.startsWith("/") || value.startsWith("\\") || value.startsWith("~")) return false;
|
|
45012
|
+
if (/^[A-Za-z]:/.test(value)) return false;
|
|
45013
|
+
return !value.split(/[\\/]/).includes("..");
|
|
45014
|
+
}
|
|
45011
45015
|
function isInvalidSchedule(field) {
|
|
45012
45016
|
return field !== void 0 && "invalid" in field;
|
|
45013
45017
|
}
|
|
@@ -45196,7 +45200,37 @@ var init_schedule_schema = __esm({
|
|
|
45196
45200
|
* accounts are the machine's, and an id nobody registered falls through the
|
|
45197
45201
|
* ladder at run time with a warning rather than making the file unreadable.
|
|
45198
45202
|
*/
|
|
45199
|
-
account: external_exports.string().min(1).optional().catch(void 0)
|
|
45203
|
+
account: external_exports.string().min(1).optional().catch(void 0),
|
|
45204
|
+
/**
|
|
45205
|
+
* Where this schedule belongs (DOR-3376). Absent means where its file is,
|
|
45206
|
+
* which is how every schedule worked before this key.
|
|
45207
|
+
*
|
|
45208
|
+
* `project`: the schedule only makes sense inside a project. From a global
|
|
45209
|
+
* package (`~/.dork/skills`), DorkOS never lists it as a global schedule and
|
|
45210
|
+
* never asks to approve it there; each registered project gets its own copy,
|
|
45211
|
+
* switched off, that runs in that project's folder. From a project's own
|
|
45212
|
+
* skills, it behaves exactly as if the key were absent.
|
|
45213
|
+
*
|
|
45214
|
+
* **An enum with one value, and an unknown value is an error rather than a
|
|
45215
|
+
* fallback.** More values may come later; a file naming one this build does
|
|
45216
|
+
* not know must not quietly run as a global schedule, so the block parks with
|
|
45217
|
+
* a complaint instead.
|
|
45218
|
+
*/
|
|
45219
|
+
scope: external_exports.enum(["project"]).optional(),
|
|
45220
|
+
/**
|
|
45221
|
+
* With `scope: project` from a global package: the file whose presence says
|
|
45222
|
+
* a project uses the package, as a path relative to the project's root
|
|
45223
|
+
* (DOR-3376). Only a project holding it gets a copy, and with no
|
|
45224
|
+
* `projectFile` no project does: when DorkOS cannot tell, it makes none.
|
|
45225
|
+
*
|
|
45226
|
+
* Relative and inside the project, or the block is unreadable and parks
|
|
45227
|
+
* with a complaint: an absolute path, a `~`, or any `..` segment is refused
|
|
45228
|
+
* here, and one that resolves outside the project (a symlink pointing out)
|
|
45229
|
+
* reads as missing where it is checked.
|
|
45230
|
+
*/
|
|
45231
|
+
projectFile: external_exports.string().min(1).refine(isProjectRelativePath, {
|
|
45232
|
+
message: "must be a path inside the project, like .agents/flow/config.json"
|
|
45233
|
+
}).optional()
|
|
45200
45234
|
});
|
|
45201
45235
|
}
|
|
45202
45236
|
});
|
|
@@ -46046,16 +46080,16 @@ function resolveRelativePath(source, context2) {
|
|
|
46046
46080
|
throw new ResolvePluginSourceError('Relative paths must not contain ".."');
|
|
46047
46081
|
}
|
|
46048
46082
|
const startsWithDotSlash = source.startsWith("./");
|
|
46049
|
-
let
|
|
46083
|
+
let path74;
|
|
46050
46084
|
if (startsWithDotSlash) {
|
|
46051
|
-
|
|
46085
|
+
path74 = stripLeadingDotSlash(source);
|
|
46052
46086
|
} else {
|
|
46053
46087
|
const pluginRoot = normalizePluginRoot(context2.pluginRoot);
|
|
46054
|
-
|
|
46088
|
+
path74 = pluginRoot ? `${pluginRoot}/${source}` : source;
|
|
46055
46089
|
}
|
|
46056
46090
|
return {
|
|
46057
46091
|
type: "relative-path",
|
|
46058
|
-
path:
|
|
46092
|
+
path: path74,
|
|
46059
46093
|
marketplaceRoot: context2.marketplaceRoot
|
|
46060
46094
|
};
|
|
46061
46095
|
}
|
|
@@ -50075,7 +50109,6 @@ function parseSkillFile(filePath, content, schema3, options) {
|
|
|
50075
50109
|
}
|
|
50076
50110
|
var init_parser = __esm({
|
|
50077
50111
|
"../skills/src/parser.ts"() {
|
|
50078
|
-
"use strict";
|
|
50079
50112
|
init_constants7();
|
|
50080
50113
|
init_frontmatter();
|
|
50081
50114
|
}
|
|
@@ -51546,11 +51579,11 @@ var require_dist2 = __commonJS({
|
|
|
51546
51579
|
return schema3;
|
|
51547
51580
|
}
|
|
51548
51581
|
generatePath(route) {
|
|
51549
|
-
const { method, path:
|
|
51582
|
+
const { method, path: path74, request, responses } = route, pathItemConfig = __rest(route, ["method", "path", "request", "responses"]);
|
|
51550
51583
|
const generatedResponses = mapValues(responses, (response) => {
|
|
51551
51584
|
return this.getResponse(response);
|
|
51552
51585
|
});
|
|
51553
|
-
const parameters = enhanceMissingParametersError(() => this.getParameters(request), { route: `${method} ${
|
|
51586
|
+
const parameters = enhanceMissingParametersError(() => this.getParameters(request), { route: `${method} ${path74}` });
|
|
51554
51587
|
const requestBody = this.getRequestBody(request === null || request === void 0 ? void 0 : request.body);
|
|
51555
51588
|
const routeDoc = {
|
|
51556
51589
|
[method]: Object.assign(Object.assign(Object.assign(Object.assign({}, pathItemConfig), parameters.length > 0 ? {
|
|
@@ -52017,10 +52050,10 @@ var init_canvas_channel_schemas = __esm({
|
|
|
52017
52050
|
});
|
|
52018
52051
|
});
|
|
52019
52052
|
CanvasChannelPointerSchema = external_exports.string().max(4096).refine(
|
|
52020
|
-
(
|
|
52021
|
-
if (
|
|
52022
|
-
if (!
|
|
52023
|
-
return
|
|
52053
|
+
(path74) => {
|
|
52054
|
+
if (path74 === "") return true;
|
|
52055
|
+
if (!path74.startsWith("/")) return false;
|
|
52056
|
+
return path74.slice(1).split("/").every(
|
|
52024
52057
|
(segment) => !/~(?![01])/u.test(segment) && !unsafeKeys.has(segment.replaceAll("~1", "/").replaceAll("~0", "~"))
|
|
52025
52058
|
);
|
|
52026
52059
|
},
|
|
@@ -54081,7 +54114,6 @@ var init_capabilities = __esm({
|
|
|
54081
54114
|
var PROJECT_NAME_PATTERN, ProjectRefSchema, ProjectInfoSchema, ProjectListResponseSchema, ProjectResolveQuerySchema, ProjectResolveResponseSchema, AccountEligibilityRowSchema, AccountEligibilityQuerySchema, AccountEligibilityResponseSchema, ProjectAccountsRequestSchema, ProjectWithoutCreditsRequestSchema, OnlyProjectsRequestSchema, OnlyProjectsResponseSchema, NoAutoMoveSchema;
|
|
54082
54115
|
var init_project_schemas = __esm({
|
|
54083
54116
|
"../shared/src/project-schemas.ts"() {
|
|
54084
|
-
"use strict";
|
|
54085
54117
|
init_zod();
|
|
54086
54118
|
init_zod_openapi();
|
|
54087
54119
|
extendZodWithOpenApiOnce();
|
|
@@ -57879,6 +57911,15 @@ var init_schemas4 = __esm({
|
|
|
57879
57911
|
packageOwned: external_exports.enum(["record", "legacy"]).nullable().default(null).openapi({
|
|
57880
57912
|
description: "Whether an installed package owns this schedule's file: 'record' (the package lists it), 'legacy' (installed before DorkOS kept file lists), or null (the person's own)."
|
|
57881
57913
|
}),
|
|
57914
|
+
/**
|
|
57915
|
+
* Whether this is one project's copy of a global schedule marked
|
|
57916
|
+
* `scope: project` (DOR-3376). Its switch and timing belong to this project
|
|
57917
|
+
* alone; what it does is the shared file's, which DorkOS never rewrites for
|
|
57918
|
+
* one project. Absent reads as false.
|
|
57919
|
+
*/
|
|
57920
|
+
projectOnly: external_exports.boolean().optional().openapi({
|
|
57921
|
+
description: "True when this is one project's copy of a global schedule that only runs inside a project. Its switch and timing are this project's; its file is shared. Absent means false."
|
|
57922
|
+
}),
|
|
57882
57923
|
/**
|
|
57883
57924
|
* What changed since this schedule was last approved, for a schedule
|
|
57884
57925
|
* waiting again (DOR-2323): each part of the approved work that differs,
|
|
@@ -59599,9 +59640,9 @@ function substitutePlaceholders(value) {
|
|
|
59599
59640
|
}
|
|
59600
59641
|
return value;
|
|
59601
59642
|
}
|
|
59602
|
-
function getValueAtPath(value,
|
|
59643
|
+
function getValueAtPath(value, path74) {
|
|
59603
59644
|
let current3 = value;
|
|
59604
|
-
for (const segment of
|
|
59645
|
+
for (const segment of path74) {
|
|
59605
59646
|
if (current3 === null || typeof current3 !== "object") return void 0;
|
|
59606
59647
|
current3 = current3[segment];
|
|
59607
59648
|
}
|
|
@@ -59630,12 +59671,12 @@ var init_ui_template = __esm({
|
|
|
59630
59671
|
const result2 = WidgetDocumentSchema.safeParse(substitutePlaceholders(value));
|
|
59631
59672
|
if (result2.success) return;
|
|
59632
59673
|
for (const issue2 of result2.error.issues) {
|
|
59633
|
-
const
|
|
59674
|
+
const path74 = issue2.path.filter(
|
|
59634
59675
|
(segment) => segment !== void 0 && typeof segment !== "symbol"
|
|
59635
59676
|
);
|
|
59636
|
-
const original = getValueAtPath(value,
|
|
59637
|
-
const message2 = typeof original === "string" && WHOLE_PLACEHOLDER_PATTERN.test(original) ? `Placeholder "${original}" is not allowed in field "${
|
|
59638
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
59677
|
+
const original = getValueAtPath(value, path74);
|
|
59678
|
+
const message2 = typeof original === "string" && WHOLE_PLACEHOLDER_PATTERN.test(original) ? `Placeholder "${original}" is not allowed in field "${path74.join(".")}" \u2014 placeholders may only fill free-form string fields, not number or enum fields` : issue2.message;
|
|
59679
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path74, message: message2 });
|
|
59639
59680
|
}
|
|
59640
59681
|
}).transform((value) => value)
|
|
59641
59682
|
});
|
|
@@ -62733,7 +62774,7 @@ var init_context = __esm({
|
|
|
62733
62774
|
init_utils();
|
|
62734
62775
|
init_cookies();
|
|
62735
62776
|
init_validator2();
|
|
62736
|
-
createInternalContext = async (context2, { options, path:
|
|
62777
|
+
createInternalContext = async (context2, { options, path: path74 }) => {
|
|
62737
62778
|
const headers = new Headers();
|
|
62738
62779
|
let responseStatus = void 0;
|
|
62739
62780
|
const { data, error: error63 } = await runValidation(options, context2);
|
|
@@ -62745,7 +62786,7 @@ var init_context = __esm({
|
|
|
62745
62786
|
...context2,
|
|
62746
62787
|
body: data.body,
|
|
62747
62788
|
query: data.query,
|
|
62748
|
-
path: context2.path ||
|
|
62789
|
+
path: context2.path || path74 || "virtual:",
|
|
62749
62790
|
context: "context" in context2 && context2.context ? context2.context : {},
|
|
62750
62791
|
returned: void 0,
|
|
62751
62792
|
headers: context2?.headers,
|
|
@@ -62972,16 +63013,16 @@ var init_to_response = __esm({
|
|
|
62972
63013
|
|
|
62973
63014
|
// ../../node_modules/.pnpm/better-call@1.4.0_zod@4.6.7/node_modules/better-call/dist/endpoint.mjs
|
|
62974
63015
|
function createEndpoint(pathOrOptions, handlerOrOptions, handlerOrNever) {
|
|
62975
|
-
const
|
|
63016
|
+
const path74 = typeof pathOrOptions === "string" ? pathOrOptions : void 0;
|
|
62976
63017
|
const options = typeof handlerOrOptions === "object" ? handlerOrOptions : pathOrOptions;
|
|
62977
63018
|
const handler = typeof handlerOrOptions === "function" ? handlerOrOptions : handlerOrNever;
|
|
62978
63019
|
if ((options.method === "GET" || options.method === "HEAD") && options.body) throw new BetterCallError("Body is not allowed with GET or HEAD methods");
|
|
62979
|
-
if (
|
|
63020
|
+
if (path74 && /\/{2,}/.test(path74)) throw new BetterCallError("Path cannot contain consecutive slashes");
|
|
62980
63021
|
const internalHandler = async (...inputCtx) => {
|
|
62981
63022
|
const context2 = inputCtx[0] || {};
|
|
62982
63023
|
const { data: internalContext, error: validationError } = await tryCatch(createInternalContext(context2, {
|
|
62983
63024
|
options,
|
|
62984
|
-
path:
|
|
63025
|
+
path: path74
|
|
62985
63026
|
}));
|
|
62986
63027
|
if (validationError) {
|
|
62987
63028
|
if (!(validationError instanceof ValidationError)) throw validationError;
|
|
@@ -63020,7 +63061,7 @@ function createEndpoint(pathOrOptions, handlerOrOptions, handlerOrNever) {
|
|
|
63020
63061
|
} : response;
|
|
63021
63062
|
};
|
|
63022
63063
|
internalHandler.options = options;
|
|
63023
|
-
internalHandler.path =
|
|
63064
|
+
internalHandler.path = path74;
|
|
63024
63065
|
return internalHandler;
|
|
63025
63066
|
}
|
|
63026
63067
|
function combineMiddleware(local, configured) {
|
|
@@ -63035,8 +63076,8 @@ var init_endpoint = __esm({
|
|
|
63035
63076
|
createEndpoint.create = (opts) => {
|
|
63036
63077
|
function createConfiguredEndpoint(...args) {
|
|
63037
63078
|
if (args.length === 3) {
|
|
63038
|
-
const [
|
|
63039
|
-
return createEndpoint(
|
|
63079
|
+
const [path74, options2, handler2] = args;
|
|
63080
|
+
return createEndpoint(path74, {
|
|
63040
63081
|
...options2,
|
|
63041
63082
|
use: combineMiddleware(options2.use, opts?.use)
|
|
63042
63083
|
}, handler2);
|
|
@@ -63306,39 +63347,39 @@ function createRouter() {
|
|
|
63306
63347
|
static: new NullProtoObj()
|
|
63307
63348
|
};
|
|
63308
63349
|
}
|
|
63309
|
-
function scanFirstGroup(
|
|
63350
|
+
function scanFirstGroup(path74) {
|
|
63310
63351
|
let i2 = 0;
|
|
63311
63352
|
let depth = 0;
|
|
63312
|
-
for (; i2 <
|
|
63313
|
-
const c3 =
|
|
63353
|
+
for (; i2 < path74.length; i2++) {
|
|
63354
|
+
const c3 = path74.charCodeAt(i2);
|
|
63314
63355
|
if (c3 === 92) i2++;
|
|
63315
63356
|
else if (c3 === 40) depth++;
|
|
63316
63357
|
else if (c3 === 41 && depth > 0) depth--;
|
|
63317
63358
|
else if (c3 === 123 && depth === 0) break;
|
|
63318
63359
|
}
|
|
63319
|
-
if (i2 >=
|
|
63360
|
+
if (i2 >= path74.length) return;
|
|
63320
63361
|
let j = i2 + 1;
|
|
63321
63362
|
depth = 0;
|
|
63322
|
-
for (; j <
|
|
63323
|
-
const c3 =
|
|
63363
|
+
for (; j < path74.length; j++) {
|
|
63364
|
+
const c3 = path74.charCodeAt(j);
|
|
63324
63365
|
if (c3 === 92) j++;
|
|
63325
63366
|
else if (c3 === 40) depth++;
|
|
63326
63367
|
else if (c3 === 41 && depth > 0) depth--;
|
|
63327
63368
|
else if (c3 === 125 && depth === 0) break;
|
|
63328
63369
|
}
|
|
63329
|
-
if (j >=
|
|
63330
|
-
const mod =
|
|
63370
|
+
if (j >= path74.length) return;
|
|
63371
|
+
const mod = path74[j + 1];
|
|
63331
63372
|
const hasMod = mod === "?" || mod === "+" || mod === "*";
|
|
63332
63373
|
return [
|
|
63333
|
-
|
|
63334
|
-
|
|
63335
|
-
|
|
63374
|
+
path74.slice(0, i2),
|
|
63375
|
+
path74.slice(i2 + 1, j),
|
|
63376
|
+
path74.slice(j + (hasMod ? 2 : 1)),
|
|
63336
63377
|
hasMod ? mod : void 0
|
|
63337
63378
|
];
|
|
63338
63379
|
}
|
|
63339
|
-
function expandGroupDelimiters(
|
|
63340
|
-
if (!
|
|
63341
|
-
const group = scanFirstGroup(
|
|
63380
|
+
function expandGroupDelimiters(path74) {
|
|
63381
|
+
if (!path74.includes("{")) return;
|
|
63382
|
+
const group = scanFirstGroup(path74);
|
|
63342
63383
|
if (!group) return;
|
|
63343
63384
|
const [pre, body, suf, mod] = group;
|
|
63344
63385
|
if (!mod) return [pre + body + suf];
|
|
@@ -63406,9 +63447,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
|
|
|
63406
63447
|
}
|
|
63407
63448
|
return [replaced, nextIndex];
|
|
63408
63449
|
}
|
|
63409
|
-
function encodeEscapes(
|
|
63410
|
-
if (!
|
|
63411
|
-
return
|
|
63450
|
+
function encodeEscapes(path74) {
|
|
63451
|
+
if (!path74.includes("\\")) return path74;
|
|
63452
|
+
return path74.replace(/\\([:(){}])/g, (_3, c3) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c3)]);
|
|
63412
63453
|
}
|
|
63413
63454
|
function segmentKey(segment) {
|
|
63414
63455
|
if (segment.startsWith("**")) return 2;
|
|
@@ -63437,22 +63478,22 @@ function expandModifiers(segments) {
|
|
|
63437
63478
|
return m2[2] === "+" ? [wc] : [wc, without];
|
|
63438
63479
|
}
|
|
63439
63480
|
}
|
|
63440
|
-
function normalizePath2(
|
|
63441
|
-
if (!
|
|
63481
|
+
function normalizePath2(path74) {
|
|
63482
|
+
if (!path74.includes("/.")) return path74;
|
|
63442
63483
|
const r3 = [];
|
|
63443
|
-
for (const s2 of
|
|
63484
|
+
for (const s2 of path74.split("/")) if (s2 === ".") continue;
|
|
63444
63485
|
else if (s2 === ".." && r3.length > 1) r3.pop();
|
|
63445
63486
|
else r3.push(s2);
|
|
63446
63487
|
return r3.join("/") || "/";
|
|
63447
63488
|
}
|
|
63448
|
-
function splitPath(
|
|
63449
|
-
const s2 =
|
|
63489
|
+
function splitPath(path74) {
|
|
63490
|
+
const s2 = path74.split("/");
|
|
63450
63491
|
s2.shift();
|
|
63451
63492
|
if (s2[s2.length - 1] === "") s2.pop();
|
|
63452
63493
|
return s2;
|
|
63453
63494
|
}
|
|
63454
|
-
function splitRoute(
|
|
63455
|
-
const s2 = splitPath(
|
|
63495
|
+
function splitRoute(path74) {
|
|
63496
|
+
const s2 = splitPath(path74);
|
|
63456
63497
|
while (s2[s2.length - 1] === "") s2.pop();
|
|
63457
63498
|
return s2;
|
|
63458
63499
|
}
|
|
@@ -63468,16 +63509,16 @@ function getMatchParams(segments, paramsMap) {
|
|
|
63468
63509
|
}
|
|
63469
63510
|
return params;
|
|
63470
63511
|
}
|
|
63471
|
-
function addRoute(ctx, method = "",
|
|
63512
|
+
function addRoute(ctx, method = "", path74, data) {
|
|
63472
63513
|
method = method.toUpperCase();
|
|
63473
|
-
if (
|
|
63474
|
-
const groupExpanded = expandGroupDelimiters(
|
|
63514
|
+
if (path74.charCodeAt(0) !== 47) path74 = `/${path74}`;
|
|
63515
|
+
const groupExpanded = expandGroupDelimiters(path74);
|
|
63475
63516
|
if (groupExpanded) {
|
|
63476
63517
|
for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
|
|
63477
63518
|
return;
|
|
63478
63519
|
}
|
|
63479
|
-
|
|
63480
|
-
const segments = splitRoute(
|
|
63520
|
+
path74 = encodeEscapes(path74);
|
|
63521
|
+
const segments = splitRoute(path74);
|
|
63481
63522
|
const expanded = expandModifiers(segments);
|
|
63482
63523
|
if (expanded) {
|
|
63483
63524
|
for (const p of expanded) addRoute(ctx, method, p, data);
|
|
@@ -63568,15 +63609,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
|
|
|
63568
63609
|
const regex2 = _s.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_3, id, p) => `(?<${toGroupName(id)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i++)}>`).replace(/\uFFFE(.)/g, (_3, c3) => /[.*+?^${}()|[\]\\]/.test(c3) ? `\\${c3}` : c3);
|
|
63569
63610
|
return [new RegExp(`^${regex2}$`), _i];
|
|
63570
63611
|
}
|
|
63571
|
-
function findRoute(ctx, method = "",
|
|
63572
|
-
if (opts?.normalize)
|
|
63573
|
-
if (
|
|
63574
|
-
const staticNode = ctx.static[
|
|
63612
|
+
function findRoute(ctx, method = "", path74, opts) {
|
|
63613
|
+
if (opts?.normalize) path74 = normalizePath2(path74);
|
|
63614
|
+
if (path74.charCodeAt(path74.length - 1) === 47) path74 = path74.slice(0, -1);
|
|
63615
|
+
const staticNode = ctx.static[path74];
|
|
63575
63616
|
if (staticNode && staticNode.methods) {
|
|
63576
63617
|
const staticMatch = staticNode.methods[method] || staticNode.methods[""];
|
|
63577
63618
|
if (staticMatch !== void 0) return staticMatch[0];
|
|
63578
63619
|
}
|
|
63579
|
-
const segments = splitPath(
|
|
63620
|
+
const segments = splitPath(path74);
|
|
63580
63621
|
const match = _lookupTree(ctx.root, method, segments, 0);
|
|
63581
63622
|
if (match === void 0) return;
|
|
63582
63623
|
if (opts?.params === false) return match;
|
|
@@ -63638,10 +63679,10 @@ function _selectMatcher(methods2, method, segments, dynamicTerminal, optionalOnl
|
|
|
63638
63679
|
}
|
|
63639
63680
|
return best;
|
|
63640
63681
|
}
|
|
63641
|
-
function findAllRoutes(ctx, method = "",
|
|
63642
|
-
if (opts?.normalize)
|
|
63643
|
-
if (
|
|
63644
|
-
const segments = splitPath(
|
|
63682
|
+
function findAllRoutes(ctx, method = "", path74, opts) {
|
|
63683
|
+
if (opts?.normalize) path74 = normalizePath2(path74);
|
|
63684
|
+
if (path74.charCodeAt(path74.length - 1) === 47) path74 = path74.slice(0, -1);
|
|
63685
|
+
const segments = splitPath(path74);
|
|
63645
63686
|
const matches = _findAll(ctx.root, method, segments, 0);
|
|
63646
63687
|
if (opts?.params === false) return matches;
|
|
63647
63688
|
return matches.map((m2) => {
|
|
@@ -63745,25 +63786,25 @@ var init_router = __esm({
|
|
|
63745
63786
|
const methods2 = Array.isArray(endpoint.options?.method) ? endpoint.options.method : [endpoint.options?.method];
|
|
63746
63787
|
for (const method of methods2) addRoute(router2, method, endpoint.path, endpoint);
|
|
63747
63788
|
}
|
|
63748
|
-
if (config3?.routerMiddleware?.length) for (const { path:
|
|
63789
|
+
if (config3?.routerMiddleware?.length) for (const { path: path74, middleware } of config3.routerMiddleware) addRoute(middlewareRouter, "*", path74, middleware);
|
|
63749
63790
|
const basePath = config3?.basePath && config3.basePath !== "/" ? config3.basePath.replace(/\/+$/, "") : "";
|
|
63750
63791
|
const processRequest = async (request) => {
|
|
63751
63792
|
const url2 = new URL(request.url);
|
|
63752
63793
|
const pathname = url2.pathname;
|
|
63753
|
-
let
|
|
63794
|
+
let path74;
|
|
63754
63795
|
if (basePath) {
|
|
63755
63796
|
if (!pathname.startsWith(`${basePath}/`)) return new Response(null, {
|
|
63756
63797
|
status: 404,
|
|
63757
63798
|
statusText: "Not Found"
|
|
63758
63799
|
});
|
|
63759
|
-
|
|
63760
|
-
} else
|
|
63761
|
-
if (
|
|
63800
|
+
path74 = pathname.slice(basePath.length);
|
|
63801
|
+
} else path74 = pathname;
|
|
63802
|
+
if (path74.length === 0 || /\/{2,}/.test(path74)) return new Response(null, {
|
|
63762
63803
|
status: 404,
|
|
63763
63804
|
statusText: "Not Found"
|
|
63764
63805
|
});
|
|
63765
|
-
const route = findRoute(router2, request.method,
|
|
63766
|
-
if (
|
|
63806
|
+
const route = findRoute(router2, request.method, path74);
|
|
63807
|
+
if (path74.endsWith("/") !== route?.data?.path?.endsWith("/") && !config3?.skipTrailingSlashes) return new Response(null, {
|
|
63767
63808
|
status: 404,
|
|
63768
63809
|
statusText: "Not Found"
|
|
63769
63810
|
});
|
|
@@ -63781,7 +63822,7 @@ var init_router = __esm({
|
|
|
63781
63822
|
try {
|
|
63782
63823
|
const allowedMediaTypes = handler.options.metadata?.allowedMediaTypes || config3?.allowedMediaTypes;
|
|
63783
63824
|
const context2 = {
|
|
63784
|
-
path:
|
|
63825
|
+
path: path74,
|
|
63785
63826
|
method: request.method,
|
|
63786
63827
|
headers: request.headers,
|
|
63787
63828
|
params: route.params ? { ...route.params } : {},
|
|
@@ -63792,7 +63833,7 @@ var init_router = __esm({
|
|
|
63792
63833
|
asResponse: true,
|
|
63793
63834
|
context: config3?.routerContext
|
|
63794
63835
|
};
|
|
63795
|
-
const middlewareRoutes = findAllRoutes(middlewareRouter, "*",
|
|
63836
|
+
const middlewareRoutes = findAllRoutes(middlewareRouter, "*", path74);
|
|
63796
63837
|
if (middlewareRoutes?.length) for (const { data: middleware, params } of middlewareRoutes) {
|
|
63797
63838
|
const res = await middleware({
|
|
63798
63839
|
...context2,
|
|
@@ -63978,8 +64019,8 @@ function wrapEndpointHandler(handler, options) {
|
|
|
63978
64019
|
}
|
|
63979
64020
|
function createAuthEndpoint(...args) {
|
|
63980
64021
|
if (args.length === 3) {
|
|
63981
|
-
const [
|
|
63982
|
-
return createEndpointWithAuthContext(
|
|
64022
|
+
const [path74, options2, handler2] = args;
|
|
64023
|
+
return createEndpointWithAuthContext(path74, options2, wrapEndpointHandler(handler2, options2));
|
|
63983
64024
|
}
|
|
63984
64025
|
const [options, handler] = args;
|
|
63985
64026
|
return createEndpointWithAuthContext(options, wrapEndpointHandler(handler, options));
|
|
@@ -64488,8 +64529,8 @@ function getIP(req, options) {
|
|
|
64488
64529
|
if (isTest() || isDevelopment()) return LOCALHOST_IP;
|
|
64489
64530
|
return null;
|
|
64490
64531
|
}
|
|
64491
|
-
function createRateLimitKey(ip,
|
|
64492
|
-
return `${ip}|${
|
|
64532
|
+
function createRateLimitKey(ip, path74) {
|
|
64533
|
+
return `${ip}|${path74}`;
|
|
64493
64534
|
}
|
|
64494
64535
|
var ipv4Schema, ipv6Schema, CIDR_PREFIX_PATTERN, LOCALHOST_IP, DEFAULT_IP_HEADERS;
|
|
64495
64536
|
var init_ip = __esm({
|
|
@@ -71382,20 +71423,20 @@ function createRetryStrategy(options) {
|
|
|
71382
71423
|
throw new Error("Invalid retry strategy");
|
|
71383
71424
|
}
|
|
71384
71425
|
}
|
|
71385
|
-
function parseMethodModifier(
|
|
71386
|
-
if (!
|
|
71426
|
+
function parseMethodModifier(path74) {
|
|
71427
|
+
if (!path74.startsWith("@")) return {
|
|
71387
71428
|
method: void 0,
|
|
71388
|
-
path:
|
|
71429
|
+
path: path74
|
|
71389
71430
|
};
|
|
71390
|
-
const separator =
|
|
71391
|
-
const method =
|
|
71431
|
+
const separator = path74.indexOf("/");
|
|
71432
|
+
const method = path74.slice(1, separator === -1 ? void 0 : separator);
|
|
71392
71433
|
if (!methods.includes(method)) return {
|
|
71393
71434
|
method: void 0,
|
|
71394
|
-
path:
|
|
71435
|
+
path: path74
|
|
71395
71436
|
};
|
|
71396
71437
|
return {
|
|
71397
71438
|
method,
|
|
71398
|
-
path: separator === -1 ?
|
|
71439
|
+
path: separator === -1 ? path74 : path74.slice(separator + 1)
|
|
71399
71440
|
};
|
|
71400
71441
|
}
|
|
71401
71442
|
function resolvePathSegment(segment, pathParams) {
|
|
@@ -71414,7 +71455,7 @@ function getURL$1(url2, option) {
|
|
|
71414
71455
|
const { path: requestPath } = parseMethodModifier(url2);
|
|
71415
71456
|
if (requestPath !== url2) url2 = `/${requestPath}`;
|
|
71416
71457
|
if (!basePath.endsWith("/")) basePath += "/";
|
|
71417
|
-
let [
|
|
71458
|
+
let [path74, urlQuery] = url2.replace(basePath, "").split("?");
|
|
71418
71459
|
const queryParams = new URLSearchParams(urlQuery);
|
|
71419
71460
|
for (const [key, value] of Object.entries(query || {})) {
|
|
71420
71461
|
if (value == null) continue;
|
|
@@ -71428,18 +71469,18 @@ function getURL$1(url2, option) {
|
|
|
71428
71469
|
}
|
|
71429
71470
|
const pathParams = /* @__PURE__ */ new Map();
|
|
71430
71471
|
if (params) if (Array.isArray(params)) {
|
|
71431
|
-
const paramPaths =
|
|
71472
|
+
const paramPaths = path74.split("/").filter((p) => p.startsWith(":"));
|
|
71432
71473
|
for (const [index2, key] of paramPaths.entries()) {
|
|
71433
71474
|
const value = params[index2];
|
|
71434
71475
|
pathParams.set(key, String(value));
|
|
71435
71476
|
}
|
|
71436
71477
|
} else for (const [key, value] of Object.entries(params)) pathParams.set(`:${key}`, String(value));
|
|
71437
|
-
|
|
71438
|
-
|
|
71478
|
+
path74 = path74.split("/").map((segment) => resolvePathSegment(segment, pathParams)).join("/");
|
|
71479
|
+
path74 = path74.replace(/^\/+/, "");
|
|
71439
71480
|
let queryParamString = queryParams.toString();
|
|
71440
71481
|
queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\+/g, "%20") : "";
|
|
71441
|
-
if (!basePath.startsWith("http")) return `${basePath}${
|
|
71442
|
-
return new URL(`${
|
|
71482
|
+
if (!basePath.startsWith("http")) return `${basePath}${path74}${queryParamString}`;
|
|
71483
|
+
return new URL(`${path74}${queryParamString}`, basePath);
|
|
71443
71484
|
}
|
|
71444
71485
|
function detectResponseType(request) {
|
|
71445
71486
|
const _contentType = request.headers.get("content-type");
|
|
@@ -99092,7 +99133,7 @@ var init_query_promise = __esm({
|
|
|
99092
99133
|
function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
99093
99134
|
const nullifyMap = {};
|
|
99094
99135
|
const result2 = columns.reduce(
|
|
99095
|
-
(result22, { path:
|
|
99136
|
+
(result22, { path: path74, field }, columnIndex) => {
|
|
99096
99137
|
let decoder2;
|
|
99097
99138
|
if (is(field, Column)) {
|
|
99098
99139
|
decoder2 = field;
|
|
@@ -99104,8 +99145,8 @@ function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
|
99104
99145
|
decoder2 = field.sql.decoder;
|
|
99105
99146
|
}
|
|
99106
99147
|
let node2 = result22;
|
|
99107
|
-
for (const [pathChunkIndex, pathChunk] of
|
|
99108
|
-
if (pathChunkIndex <
|
|
99148
|
+
for (const [pathChunkIndex, pathChunk] of path74.entries()) {
|
|
99149
|
+
if (pathChunkIndex < path74.length - 1) {
|
|
99109
99150
|
if (!(pathChunk in node2)) {
|
|
99110
99151
|
node2[pathChunk] = {};
|
|
99111
99152
|
}
|
|
@@ -99113,8 +99154,8 @@ function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
|
99113
99154
|
} else {
|
|
99114
99155
|
const rawValue = row2[columnIndex];
|
|
99115
99156
|
const value = node2[pathChunk] = rawValue === null ? null : decoder2.mapFromDriverValue(rawValue);
|
|
99116
|
-
if (joinsNotNullableMap && is(field, Column) &&
|
|
99117
|
-
const objectName =
|
|
99157
|
+
if (joinsNotNullableMap && is(field, Column) && path74.length === 2) {
|
|
99158
|
+
const objectName = path74[0];
|
|
99118
99159
|
if (!(objectName in nullifyMap)) {
|
|
99119
99160
|
nullifyMap[objectName] = value === null ? getTableName(field.table) : false;
|
|
99120
99161
|
} else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) {
|
|
@@ -102110,6 +102151,13 @@ var init_desktop_sign_in = __esm({
|
|
|
102110
102151
|
}
|
|
102111
102152
|
});
|
|
102112
102153
|
|
|
102154
|
+
// ../../apps/server/src/services/core/auth/person-step-up.ts
|
|
102155
|
+
var init_person_step_up = __esm({
|
|
102156
|
+
"../../apps/server/src/services/core/auth/person-step-up.ts"() {
|
|
102157
|
+
"use strict";
|
|
102158
|
+
}
|
|
102159
|
+
});
|
|
102160
|
+
|
|
102113
102161
|
// ../../node_modules/.pnpm/@better-auth+core@1.7.7_@better-auth+utils@0.5.0_@better-fetch+fetch@1.3.2_@opentelemet_2ccd551e618bc3d9345b7bdfc16326c8/node_modules/@better-auth/core/dist/utils/async.mjs
|
|
102114
102162
|
async function mapConcurrent(items, fn, options) {
|
|
102115
102163
|
const n2 = items.length;
|
|
@@ -106819,6 +106867,13 @@ var init_tasks = __esm({
|
|
|
106819
106867
|
* app, which shows ownership before a person tries an edit.
|
|
106820
106868
|
*/
|
|
106821
106869
|
packageOwned: text("package_owned", { enum: ["record", "legacy", "unknown"] }),
|
|
106870
|
+
/**
|
|
106871
|
+
* Whether this row is one project's copy of a global schedule marked
|
|
106872
|
+
* `scope: project` (DOR-3376). One file then backs one row per project, so
|
|
106873
|
+
* a row is found by its file AND its agent, its switch lives on the row
|
|
106874
|
+
* alone, and DorkOS never writes the shared file for it.
|
|
106875
|
+
*/
|
|
106876
|
+
projectOnly: integer2("project_only", { mode: "boolean" }).notNull().default(false),
|
|
106822
106877
|
prompt: text("prompt").notNull(),
|
|
106823
106878
|
agentId: text("agent_id"),
|
|
106824
106879
|
/**
|
|
@@ -113471,6 +113526,31 @@ var init_session_relay_link = __esm({
|
|
|
113471
113526
|
}
|
|
113472
113527
|
});
|
|
113473
113528
|
|
|
113529
|
+
// ../../apps/server/src/services/core/auth/person-proof.ts
|
|
113530
|
+
var init_person_proof = __esm({
|
|
113531
|
+
"../../apps/server/src/services/core/auth/person-proof.ts"() {
|
|
113532
|
+
"use strict";
|
|
113533
|
+
init_auth2();
|
|
113534
|
+
}
|
|
113535
|
+
});
|
|
113536
|
+
|
|
113537
|
+
// ../shared/src/person-session.ts
|
|
113538
|
+
var PersonSessionResponseSchema, PersonSessionRequestSchema;
|
|
113539
|
+
var init_person_session = __esm({
|
|
113540
|
+
"../shared/src/person-session.ts"() {
|
|
113541
|
+
init_zod();
|
|
113542
|
+
PersonSessionResponseSchema = external_exports.object({
|
|
113543
|
+
ok: external_exports.literal(true),
|
|
113544
|
+
/** The person proof to send in {@link PERSON_PROOF_HEADER}. */
|
|
113545
|
+
proof: external_exports.string().min(1)
|
|
113546
|
+
});
|
|
113547
|
+
PersonSessionRequestSchema = external_exports.object({
|
|
113548
|
+
/** The owner's password. Never logged or stored. */
|
|
113549
|
+
password: external_exports.string().min(1).max(1024)
|
|
113550
|
+
});
|
|
113551
|
+
}
|
|
113552
|
+
});
|
|
113553
|
+
|
|
113474
113554
|
// ../../apps/server/src/services/core/auth/session-gate.ts
|
|
113475
113555
|
var init_session_gate = __esm({
|
|
113476
113556
|
"../../apps/server/src/services/core/auth/session-gate.ts"() {
|
|
@@ -113485,6 +113565,8 @@ var init_session_gate = __esm({
|
|
|
113485
113565
|
init_session_relay_link();
|
|
113486
113566
|
init_session_route();
|
|
113487
113567
|
init_live_connections();
|
|
113568
|
+
init_person_proof();
|
|
113569
|
+
init_person_session();
|
|
113488
113570
|
}
|
|
113489
113571
|
});
|
|
113490
113572
|
|
|
@@ -113516,6 +113598,7 @@ var init_auth2 = __esm({
|
|
|
113516
113598
|
init_auth_audit();
|
|
113517
113599
|
init_hub_sign_in();
|
|
113518
113600
|
init_desktop_sign_in();
|
|
113601
|
+
init_person_step_up();
|
|
113519
113602
|
init_src2();
|
|
113520
113603
|
init_env();
|
|
113521
113604
|
init_logger();
|
|
@@ -113577,6 +113660,7 @@ function defuseSystemTags(text3, tagNames) {
|
|
|
113577
113660
|
var IDENTITY_MAX_LENGTH, INVISIBLE_FORMAT, CONTROL_CHARS, PATTERN_CACHE;
|
|
113578
113661
|
var init_untrusted_text = __esm({
|
|
113579
113662
|
"../shared/src/untrusted-text.ts"() {
|
|
113663
|
+
"use strict";
|
|
113580
113664
|
IDENTITY_MAX_LENGTH = 80;
|
|
113581
113665
|
INVISIBLE_FORMAT = /[\u00ad\u200b-\u200f\u202a-\u202e\u2060-\u2064\ufeff\ufff9-\ufffb]/g;
|
|
113582
113666
|
CONTROL_CHARS = /[\u0000-\u001f\u007f-\u009f]/g;
|
|
@@ -114160,17 +114244,17 @@ function patchPaths(value, prefix = "") {
|
|
|
114160
114244
|
if (entries.length === 0) return prefix ? [prefix] : [];
|
|
114161
114245
|
return entries.flatMap(([key, child]) => patchPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
114162
114246
|
}
|
|
114163
|
-
function withoutArrayMarkers(
|
|
114164
|
-
return
|
|
114247
|
+
function withoutArrayMarkers(path74) {
|
|
114248
|
+
return path74.replaceAll("[]", "");
|
|
114165
114249
|
}
|
|
114166
114250
|
function prepareGuardedPaths(paths2) {
|
|
114167
|
-
return paths2.map((
|
|
114251
|
+
return paths2.map((path74) => ({ path: path74, plain: withoutArrayMarkers(path74) }));
|
|
114168
114252
|
}
|
|
114169
114253
|
function matchGuardedPaths(touched, guarded) {
|
|
114170
114254
|
const hits = /* @__PURE__ */ new Set();
|
|
114171
|
-
for (const
|
|
114255
|
+
for (const path74 of new Set(touched)) {
|
|
114172
114256
|
for (const { path: guardedPath, plain } of guarded) {
|
|
114173
|
-
if (
|
|
114257
|
+
if (path74 === plain || path74.startsWith(`${plain}.`) || plain.startsWith(`${path74}.`)) {
|
|
114174
114258
|
hits.add(guardedPath);
|
|
114175
114259
|
}
|
|
114176
114260
|
}
|
|
@@ -114206,8 +114290,8 @@ var init_remote_config_policy = __esm({
|
|
|
114206
114290
|
"cloud.remote.edgeProofRef"
|
|
114207
114291
|
];
|
|
114208
114292
|
CLOUD_REMOTE_WRITE_POLICY = Object.fromEntries(
|
|
114209
|
-
[...CLOUD_REMOTE_REACH_PATHS, ...CLOUD_REMOTE_CREDENTIAL_PATHS].map((
|
|
114210
|
-
|
|
114293
|
+
[...CLOUD_REMOTE_REACH_PATHS, ...CLOUD_REMOTE_CREDENTIAL_PATHS].map((path74) => [
|
|
114294
|
+
path74,
|
|
114211
114295
|
"operator-only"
|
|
114212
114296
|
])
|
|
114213
114297
|
);
|
|
@@ -116034,17 +116118,17 @@ var init_agent_binding = __esm({
|
|
|
116034
116118
|
if (!this.runtimes || !this.defaultRuntime) throw new Error("COMPUTER_REGISTRY_UNAVAILABLE");
|
|
116035
116119
|
return resolveRegisteredAgentRuntime(id, mesh, this.runtimes, this.defaultRuntime, this);
|
|
116036
116120
|
}
|
|
116037
|
-
configure(id,
|
|
116038
|
-
if (!id || id.length > 128 || !
|
|
116121
|
+
configure(id, path74) {
|
|
116122
|
+
if (!id || id.length > 128 || !path74.startsWith("/") || canonicalDirectory(path74) !== path74) {
|
|
116039
116123
|
throw new Error("COMPUTER_AGENT_BINDING_REFUSED");
|
|
116040
116124
|
}
|
|
116041
|
-
if (this.binding && (this.binding.id !== id || this.binding.path !==
|
|
116125
|
+
if (this.binding && (this.binding.id !== id || this.binding.path !== path74)) {
|
|
116042
116126
|
throw new Error("COMPUTER_AGENT_BINDING_REFUSED");
|
|
116043
116127
|
}
|
|
116044
|
-
this.binding = { id, path:
|
|
116128
|
+
this.binding = { id, path: path74 };
|
|
116045
116129
|
}
|
|
116046
|
-
forPath(
|
|
116047
|
-
return this.binding?.path ===
|
|
116130
|
+
forPath(path74) {
|
|
116131
|
+
return this.binding?.path === path74 ? "computer-local" : void 0;
|
|
116048
116132
|
}
|
|
116049
116133
|
forId(id) {
|
|
116050
116134
|
return this.binding?.id === id ? "computer-local" : void 0;
|
|
@@ -120328,9 +120412,9 @@ var init_windows_execution_state = __esm({
|
|
|
120328
120412
|
|
|
120329
120413
|
// ../keep-awake/src/environment.ts
|
|
120330
120414
|
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
120331
|
-
function readFileOrNull(
|
|
120415
|
+
function readFileOrNull(path74) {
|
|
120332
120416
|
try {
|
|
120333
|
-
return readFileSync4(
|
|
120417
|
+
return readFileSync4(path74, "utf8");
|
|
120334
120418
|
} catch {
|
|
120335
120419
|
return null;
|
|
120336
120420
|
}
|
|
@@ -121292,9 +121376,9 @@ async function boundTurnOpts(runtime, sessionId, incoming, deps) {
|
|
|
121292
121376
|
}
|
|
121293
121377
|
const { agentPath } = agent;
|
|
121294
121378
|
const read = deps.levelOf ?? resolveAgentLaunchLevel;
|
|
121295
|
-
const modeOf = async (
|
|
121379
|
+
const modeOf = async (path74) => {
|
|
121296
121380
|
try {
|
|
121297
|
-
return (await read({ agentPath:
|
|
121381
|
+
return (await read({ agentPath: path74, capabilities })).mode ?? null;
|
|
121298
121382
|
} catch (err) {
|
|
121299
121383
|
logger.warn(
|
|
121300
121384
|
"[agent-level] could not read the agent\u2019s level; holding the turn to the default",
|
|
@@ -123891,55 +123975,285 @@ var init_session_visibility = __esm({
|
|
|
123891
123975
|
}
|
|
123892
123976
|
});
|
|
123893
123977
|
|
|
123894
|
-
//
|
|
123978
|
+
// ../shared/src/safe-git.ts
|
|
123895
123979
|
import { execFile } from "node:child_process";
|
|
123896
|
-
import
|
|
123897
|
-
|
|
123898
|
-
|
|
123899
|
-
|
|
123900
|
-
|
|
123901
|
-
|
|
123902
|
-
|
|
123903
|
-
|
|
123904
|
-
|
|
123905
|
-
|
|
123906
|
-
|
|
123907
|
-
|
|
123980
|
+
import fs23 from "node:fs";
|
|
123981
|
+
import path42 from "node:path";
|
|
123982
|
+
function findGitPlaces(dir) {
|
|
123983
|
+
const resolved = path42.resolve(dir);
|
|
123984
|
+
const folders = /* @__PURE__ */ new Set([resolved]);
|
|
123985
|
+
const gitDirs = /* @__PURE__ */ new Set();
|
|
123986
|
+
const commonDirs = /* @__PURE__ */ new Set();
|
|
123987
|
+
for (const start of /* @__PURE__ */ new Set([resolved, nativeRealPath(resolved)])) {
|
|
123988
|
+
if (start.split(path42.sep).includes(".git")) return null;
|
|
123989
|
+
folders.add(start);
|
|
123990
|
+
for (let current3 = start; ; current3 = path42.dirname(current3)) {
|
|
123991
|
+
if (looksLikeGitDir(current3)) gitDirs.add(current3);
|
|
123992
|
+
const dotGit = path42.join(current3, ".git");
|
|
123993
|
+
const stat5 = fs23.lstatSync(dotGit, { throwIfNoEntry: false });
|
|
123994
|
+
if (stat5) {
|
|
123995
|
+
folders.add(current3);
|
|
123996
|
+
const common2 = stat5.isDirectory() ? dotGit : addPointer(current3, dotGit, gitDirs);
|
|
123997
|
+
if (common2 === null) return null;
|
|
123998
|
+
gitDirs.add(common2);
|
|
123999
|
+
commonDirs.add(common2);
|
|
124000
|
+
}
|
|
124001
|
+
if (path42.dirname(current3) === current3) break;
|
|
124002
|
+
}
|
|
124003
|
+
}
|
|
124004
|
+
const worktrees = /* @__PURE__ */ new Set();
|
|
124005
|
+
for (const common2 of commonDirs) addLinkedWorktrees(common2, worktrees);
|
|
124006
|
+
return { folders: [...folders], gitDirs: [...gitDirs], worktrees: [...worktrees] };
|
|
124007
|
+
}
|
|
124008
|
+
function addPointer(top, dotGit, gitDirs) {
|
|
124009
|
+
const text3 = readGitFile(dotGit);
|
|
124010
|
+
if (text3 === null || !text3.startsWith("gitdir: ")) return null;
|
|
124011
|
+
const gitDir = path42.resolve(top, text3.slice("gitdir: ".length));
|
|
124012
|
+
if (!isDirectory(gitDir)) return null;
|
|
124013
|
+
gitDirs.add(gitDir);
|
|
124014
|
+
const common2 = readGitFile(path42.join(gitDir, "commondir"));
|
|
124015
|
+
if (common2 === null) return gitDir;
|
|
124016
|
+
const commonDir = path42.resolve(gitDir, common2);
|
|
124017
|
+
return isDirectory(commonDir) ? commonDir : null;
|
|
124018
|
+
}
|
|
124019
|
+
function readGitFile(file2) {
|
|
124020
|
+
try {
|
|
124021
|
+
return fs23.readFileSync(file2, "utf8").replace(/[\r\n]+$/, "");
|
|
124022
|
+
} catch {
|
|
124023
|
+
return null;
|
|
124024
|
+
}
|
|
124025
|
+
}
|
|
124026
|
+
function isDirectory(dir) {
|
|
124027
|
+
return fs23.statSync(dir, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
124028
|
+
}
|
|
124029
|
+
function looksLikeGitDir(dir) {
|
|
124030
|
+
return fs23.existsSync(path42.join(dir, "HEAD")) && isDirectory(path42.join(dir, "objects")) && isDirectory(path42.join(dir, "refs"));
|
|
124031
|
+
}
|
|
124032
|
+
function addLinkedWorktrees(common2, worktrees) {
|
|
124033
|
+
const admin = path42.join(common2, "worktrees");
|
|
124034
|
+
let names;
|
|
124035
|
+
try {
|
|
124036
|
+
names = fs23.readdirSync(admin);
|
|
124037
|
+
} catch {
|
|
124038
|
+
return;
|
|
124039
|
+
}
|
|
124040
|
+
for (const name2 of names) {
|
|
124041
|
+
const dotGit = readGitFile(path42.join(admin, name2, "gitdir"));
|
|
124042
|
+
if (dotGit) worktrees.add(path42.dirname(path42.resolve(admin, name2, dotGit)));
|
|
124043
|
+
}
|
|
124044
|
+
}
|
|
124045
|
+
function nativeRealPath(dir) {
|
|
124046
|
+
try {
|
|
124047
|
+
return fs23.realpathSync.native(dir);
|
|
124048
|
+
} catch {
|
|
124049
|
+
return dir;
|
|
124050
|
+
}
|
|
124051
|
+
}
|
|
124052
|
+
function minimalGitEnv(locale = {}) {
|
|
124053
|
+
const parent = process.env;
|
|
124054
|
+
const env6 = {};
|
|
124055
|
+
if (locale.LC_ALL !== void 0) env6.LC_ALL = locale.LC_ALL;
|
|
124056
|
+
if (locale.LANG !== void 0) env6.LANG = locale.LANG;
|
|
124057
|
+
for (const name2 of [
|
|
124058
|
+
"PATH",
|
|
124059
|
+
"HOME",
|
|
124060
|
+
"LANG",
|
|
124061
|
+
"LC_ALL",
|
|
124062
|
+
"TMPDIR",
|
|
124063
|
+
"TMP",
|
|
124064
|
+
"TEMP",
|
|
124065
|
+
"SystemRoot",
|
|
124066
|
+
"SYSTEMROOT",
|
|
124067
|
+
"USERPROFILE",
|
|
124068
|
+
"PATHEXT",
|
|
124069
|
+
"ComSpec"
|
|
124070
|
+
]) {
|
|
124071
|
+
if (parent[name2] !== void 0 && env6[name2] === void 0) env6[name2] = parent[name2];
|
|
124072
|
+
}
|
|
124073
|
+
return {
|
|
124074
|
+
...env6,
|
|
124075
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
124076
|
+
GIT_CONFIG_GLOBAL: process.platform === "win32" ? "NUL" : "/dev/null",
|
|
124077
|
+
GIT_NO_LAZY_FETCH: "1",
|
|
124078
|
+
GIT_ALLOW_PROTOCOL: "",
|
|
124079
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
124080
|
+
// No GIT_OPTIONAL_LOCKS=0: `status` must be free to write back its
|
|
124081
|
+
// refreshed index, as git always does. Without that, every file in a fresh
|
|
124082
|
+
// checkout stays "racily clean" and each status re-reads all of them (on a
|
|
124083
|
+
// fresh 20k-file checkout, 0.6 s every time against 0.09 s once written).
|
|
124084
|
+
// A caller reading someone else's live worktree passes `--no-optional-locks`
|
|
124085
|
+
// itself (the Workspaces scan does).
|
|
124086
|
+
GIT_PAGER: "cat"
|
|
124087
|
+
};
|
|
124088
|
+
}
|
|
124089
|
+
function keysIn(file2) {
|
|
124090
|
+
return new Promise((resolve14, reject) => {
|
|
124091
|
+
execFile(
|
|
124092
|
+
"git",
|
|
124093
|
+
["config", "--file", file2, "--no-includes", "--name-only", "--list", "-z"],
|
|
124094
|
+
// Run from the file system root: `--file` reads only that file, and no
|
|
124095
|
+
// repository is found above `/` to add its own settings.
|
|
124096
|
+
{ cwd: path42.parse(file2).root, timeout: AUDIT_TIMEOUT_MS, env: minimalGitEnv() },
|
|
124097
|
+
(err, stdout3) => {
|
|
124098
|
+
if (err) return reject(new GitRepoConfigUnsafeError(file2, []));
|
|
124099
|
+
resolve14([
|
|
124100
|
+
...new Set(
|
|
124101
|
+
stdout3.split("\0").map((key) => key.trim().toLowerCase()).filter((key) => key !== "")
|
|
124102
|
+
)
|
|
124103
|
+
]);
|
|
124104
|
+
}
|
|
124105
|
+
);
|
|
123908
124106
|
});
|
|
123909
|
-
return stdout3;
|
|
123910
124107
|
}
|
|
123911
|
-
|
|
123912
|
-
|
|
123913
|
-
"
|
|
123914
|
-
|
|
124108
|
+
async function assertRepoConfigSafe(cwd, { allowHooksPath = false } = {}) {
|
|
124109
|
+
const places = findGitPlaces(cwd);
|
|
124110
|
+
if (places === null) throw new GitRepoConfigUnsafeError(path42.join(cwd, ".git"), []);
|
|
124111
|
+
let worktreeConfigOn = false;
|
|
124112
|
+
for (const gitDir of places.gitDirs) {
|
|
124113
|
+
const passed = await auditFile(path42.join(gitDir, "config"), allowHooksPath);
|
|
124114
|
+
worktreeConfigOn ||= passed.worktreeConfig;
|
|
124115
|
+
}
|
|
124116
|
+
if (!worktreeConfigOn) return;
|
|
124117
|
+
for (const gitDir of places.gitDirs) {
|
|
124118
|
+
await auditFile(path42.join(gitDir, "config.worktree"), allowHooksPath);
|
|
124119
|
+
}
|
|
124120
|
+
}
|
|
124121
|
+
async function auditFile(file2, allowHooksPath) {
|
|
124122
|
+
const stat5 = fs23.statSync(file2, { throwIfNoEntry: false });
|
|
124123
|
+
if (!stat5) return { worktreeConfig: false };
|
|
124124
|
+
const stamp2 = `${stat5.size}:${stat5.mtimeMs}:${stat5.ctimeMs}:${stat5.ino}`;
|
|
124125
|
+
const cacheKey = allowHooksPath ? `${file2}\0read` : file2;
|
|
124126
|
+
const cached2 = auditedAt.get(cacheKey);
|
|
124127
|
+
if (cached2?.stamp === stamp2) return { worktreeConfig: cached2.worktreeConfig };
|
|
124128
|
+
const keys = await keysIn(file2);
|
|
124129
|
+
const unsafe = keys.filter(
|
|
124130
|
+
(key) => !SAFE_REPO_CONFIG_KEY.test(key) && !(allowHooksPath && key === "core.hookspath")
|
|
124131
|
+
);
|
|
124132
|
+
if (unsafe.length > 0) {
|
|
124133
|
+
auditedAt.delete(cacheKey);
|
|
124134
|
+
throw new GitRepoConfigUnsafeError(file2, unsafe);
|
|
124135
|
+
}
|
|
124136
|
+
const worktreeConfig = keys.includes("extensions.worktreeconfig");
|
|
124137
|
+
auditedAt.set(cacheKey, { stamp: stamp2, worktreeConfig });
|
|
124138
|
+
return { worktreeConfig };
|
|
124139
|
+
}
|
|
124140
|
+
async function runSafeGit(args, cwd, options = {}) {
|
|
124141
|
+
const out = await spawnSafeGit(args, cwd, options, "utf8");
|
|
124142
|
+
return out;
|
|
124143
|
+
}
|
|
124144
|
+
async function spawnSafeGit(args, cwd, options, encoding) {
|
|
124145
|
+
await assertRepoConfigSafe(cwd, { allowHooksPath: true });
|
|
124146
|
+
return new Promise((resolve14, reject) => {
|
|
124147
|
+
execFile(
|
|
124148
|
+
"git",
|
|
124149
|
+
[...SAFE_GIT_ARGS, ...args],
|
|
124150
|
+
{
|
|
124151
|
+
cwd,
|
|
124152
|
+
timeout: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
124153
|
+
maxBuffer: options.maxBuffer ?? DEFAULT_MAX_BUFFER,
|
|
124154
|
+
signal: options.signal,
|
|
124155
|
+
env: minimalGitEnv(options.env),
|
|
124156
|
+
encoding
|
|
124157
|
+
},
|
|
124158
|
+
(err, stdout3, stderr) => {
|
|
124159
|
+
if (err) {
|
|
124160
|
+
Object.assign(err, { stdout: stdout3, stderr });
|
|
124161
|
+
return reject(err);
|
|
124162
|
+
}
|
|
124163
|
+
resolve14(stdout3);
|
|
124164
|
+
}
|
|
124165
|
+
);
|
|
124166
|
+
});
|
|
124167
|
+
}
|
|
124168
|
+
var SAFE_REPO_CONFIG_KEY, SAFE_GIT_ARGS, GitRepoConfigUnsafeError, DEFAULT_TIMEOUT_MS, DEFAULT_MAX_BUFFER, AUDIT_TIMEOUT_MS, auditedAt;
|
|
124169
|
+
var init_safe_git = __esm({
|
|
124170
|
+
"../shared/src/safe-git.ts"() {
|
|
123915
124171
|
init_git_hardening();
|
|
123916
|
-
|
|
123917
|
-
|
|
123918
|
-
|
|
124172
|
+
SAFE_REPO_CONFIG_KEY = new RegExp(
|
|
124173
|
+
"^(?:" + [
|
|
124174
|
+
"core\\.(?:repositoryformatversion|filemode|bare|logallrefupdates|ignorecase|precomposeunicode|symlinks)",
|
|
124175
|
+
"remote\\.[a-z0-9._-]+\\.(?:url|pushurl|fetch|push|tagopt|prune|gh-resolved)",
|
|
124176
|
+
// Git never runs a command from a `branch.*` key.
|
|
124177
|
+
"branch\\.[a-z0-9._/-]+\\.[a-z0-9-]+",
|
|
124178
|
+
"extensions\\.(?:worktreeconfig|objectformat)",
|
|
124179
|
+
"blame\\.ignorerevsfile",
|
|
124180
|
+
"rerere\\.enabled",
|
|
124181
|
+
"lfs\\.repositoryformatversion",
|
|
124182
|
+
"gtr\\.[a-z.]+",
|
|
124183
|
+
"gc\\.[a-z]+",
|
|
124184
|
+
"maintenance\\.[a-z.]+",
|
|
124185
|
+
"fetch\\.(?:prune|writecommitgraph)",
|
|
124186
|
+
"pull\\.rebase",
|
|
124187
|
+
"user\\.(?:name|email)"
|
|
124188
|
+
].join("|") + ")$"
|
|
124189
|
+
);
|
|
124190
|
+
SAFE_GIT_ARGS = [
|
|
124191
|
+
...gitConfigArgs(internalGitConfig()),
|
|
124192
|
+
"-c",
|
|
124193
|
+
"protocol.allow=never",
|
|
124194
|
+
"-c",
|
|
124195
|
+
"core.sshCommand=",
|
|
124196
|
+
"-c",
|
|
124197
|
+
"core.askPass=",
|
|
124198
|
+
"-c",
|
|
124199
|
+
"credential.helper=",
|
|
124200
|
+
"-c",
|
|
124201
|
+
"diff.external=",
|
|
124202
|
+
"-c",
|
|
124203
|
+
"core.pager=cat",
|
|
124204
|
+
"-c",
|
|
124205
|
+
"diff.ignoreSubmodules=all",
|
|
124206
|
+
"-c",
|
|
124207
|
+
"status.submoduleSummary=false",
|
|
124208
|
+
"-c",
|
|
124209
|
+
"submodule.recurse=false"
|
|
124210
|
+
];
|
|
124211
|
+
GitRepoConfigUnsafeError = class extends Error {
|
|
124212
|
+
/**
|
|
124213
|
+
* Build the error.
|
|
124214
|
+
*
|
|
124215
|
+
* @param file - The settings file that holds the keys.
|
|
124216
|
+
* @param keys - The keys off the safe list (empty when the file was unreadable).
|
|
124217
|
+
*/
|
|
124218
|
+
constructor(file2, keys) {
|
|
124219
|
+
super(
|
|
124220
|
+
keys.length > 0 ? `DorkOS won't read this repository with git: ${file2} sets ${keys.join(", ")}.` : `DorkOS won't read this repository with git: ${file2} can't be read.`
|
|
124221
|
+
);
|
|
124222
|
+
this.file = file2;
|
|
124223
|
+
this.keys = keys;
|
|
124224
|
+
this.name = "GitRepoConfigUnsafeError";
|
|
124225
|
+
}
|
|
124226
|
+
file;
|
|
124227
|
+
keys;
|
|
124228
|
+
};
|
|
124229
|
+
DEFAULT_TIMEOUT_MS = 1e4;
|
|
124230
|
+
DEFAULT_MAX_BUFFER = 10 * 1024 * 1024;
|
|
124231
|
+
AUDIT_TIMEOUT_MS = 5e3;
|
|
124232
|
+
auditedAt = /* @__PURE__ */ new Map();
|
|
123919
124233
|
}
|
|
123920
124234
|
});
|
|
123921
124235
|
|
|
123922
124236
|
// ../../apps/server/src/services/projects/extension-copy.ts
|
|
123923
|
-
import { promises as
|
|
123924
|
-
import
|
|
124237
|
+
import { promises as fs24 } from "node:fs";
|
|
124238
|
+
import path43 from "node:path";
|
|
123925
124239
|
async function folderExists(dir) {
|
|
123926
124240
|
try {
|
|
123927
|
-
return (await
|
|
124241
|
+
return (await fs24.stat(dir)).isDirectory();
|
|
123928
124242
|
} catch {
|
|
123929
124243
|
return false;
|
|
123930
124244
|
}
|
|
123931
124245
|
}
|
|
123932
124246
|
async function holdsExtensionCopy(root, extensionId) {
|
|
123933
|
-
if (await folderExists(
|
|
124247
|
+
if (await folderExists(path43.join(root, ".dork", "extensions", extensionId))) return true;
|
|
123934
124248
|
let plugins;
|
|
123935
124249
|
try {
|
|
123936
|
-
plugins = await
|
|
124250
|
+
plugins = await fs24.readdir(path43.join(root, ".dork", "plugins"));
|
|
123937
124251
|
} catch {
|
|
123938
124252
|
return false;
|
|
123939
124253
|
}
|
|
123940
124254
|
for (const plugin of plugins) {
|
|
123941
124255
|
if (isInstallSiblingName(plugin)) continue;
|
|
123942
|
-
const copy2 =
|
|
124256
|
+
const copy2 = path43.join(root, ".dork", "plugins", plugin, ".dork", "extensions", extensionId);
|
|
123943
124257
|
if (await folderExists(copy2)) return true;
|
|
123944
124258
|
}
|
|
123945
124259
|
return false;
|
|
@@ -123973,14 +124287,14 @@ var init_origin_repo = __esm({
|
|
|
123973
124287
|
});
|
|
123974
124288
|
|
|
123975
124289
|
// ../../apps/server/src/services/projects/project-names.ts
|
|
123976
|
-
import
|
|
124290
|
+
import path44 from "node:path";
|
|
123977
124291
|
function sanitizeNameSegment(segment) {
|
|
123978
124292
|
return segment.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
123979
124293
|
}
|
|
123980
124294
|
function assignProjectName(root, isTaken) {
|
|
123981
|
-
const base = sanitizeNameSegment(
|
|
124295
|
+
const base = sanitizeNameSegment(path44.basename(root)) || "project";
|
|
123982
124296
|
if (!isTaken(base)) return base;
|
|
123983
|
-
const parent = sanitizeNameSegment(
|
|
124297
|
+
const parent = sanitizeNameSegment(path44.basename(path44.dirname(root))) || "root";
|
|
123984
124298
|
const withParent = `${base}~${parent}`;
|
|
123985
124299
|
if (!isTaken(withParent)) return withParent;
|
|
123986
124300
|
for (let n2 = 2; ; n2++) {
|
|
@@ -124032,17 +124346,19 @@ var init_slots = __esm({
|
|
|
124032
124346
|
});
|
|
124033
124347
|
|
|
124034
124348
|
// ../../apps/server/src/services/projects/resolve-project-root.ts
|
|
124035
|
-
import
|
|
124349
|
+
import path45 from "node:path";
|
|
124036
124350
|
function projectRootFromCommonDir(commonDir) {
|
|
124037
124351
|
const trimmed = commonDir.trim();
|
|
124038
124352
|
if (trimmed.length === 0) return null;
|
|
124039
|
-
return
|
|
124353
|
+
return path45.basename(trimmed) === ".git" ? path45.dirname(trimmed) : trimmed;
|
|
124040
124354
|
}
|
|
124041
124355
|
function isNotARepository(err) {
|
|
124042
124356
|
if (typeof err !== "object" || err === null) return false;
|
|
124043
|
-
const
|
|
124044
|
-
|
|
124045
|
-
|
|
124357
|
+
const { code, killed } = err;
|
|
124358
|
+
return code === 128 && killed !== true;
|
|
124359
|
+
}
|
|
124360
|
+
function rootOf(found) {
|
|
124361
|
+
return found.kind === "project" ? found.root : null;
|
|
124046
124362
|
}
|
|
124047
124363
|
function negativeTtl(misses) {
|
|
124048
124364
|
return Math.min(NEGATIVE_ROOT_TTL_MS * 2 ** Math.max(0, misses - 1), MAX_NEGATIVE_ROOT_TTL_MS);
|
|
@@ -124053,21 +124369,26 @@ function createProjectRootResolver(overrides = {}) {
|
|
|
124053
124369
|
const byCwd = /* @__PURE__ */ new Map();
|
|
124054
124370
|
async function lookUp(cwd) {
|
|
124055
124371
|
const dir = deps.canonical(cwd);
|
|
124056
|
-
if (!
|
|
124372
|
+
if (!path45.isAbsolute(dir)) return { found: { kind: "none" }, answered: true };
|
|
124057
124373
|
try {
|
|
124058
124374
|
const commonDir = await deps.runGit(
|
|
124059
124375
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
124060
124376
|
dir,
|
|
124061
|
-
{ timeoutMs:
|
|
124377
|
+
{ timeoutMs: GIT_TIMEOUT_MS, env: ROOT_LOOKUP_GIT_ENV }
|
|
124062
124378
|
);
|
|
124063
124379
|
const root = projectRootFromCommonDir(commonDir);
|
|
124064
|
-
return {
|
|
124380
|
+
return {
|
|
124381
|
+
found: root === null ? { kind: "none" } : { kind: "project", root: deps.canonical(root) },
|
|
124382
|
+
answered: true
|
|
124383
|
+
};
|
|
124065
124384
|
} catch (err) {
|
|
124066
|
-
|
|
124385
|
+
if (err instanceof GitRepoConfigUnsafeError)
|
|
124386
|
+
return { found: { kind: "refused" }, answered: true };
|
|
124387
|
+
return { found: { kind: "none" }, answered: isNotARepository(err) };
|
|
124067
124388
|
}
|
|
124068
124389
|
}
|
|
124069
124390
|
async function readUncached(cwd) {
|
|
124070
|
-
return (await lookUp(cwd)).
|
|
124391
|
+
return rootOf((await lookUp(cwd)).found);
|
|
124071
124392
|
}
|
|
124072
124393
|
function live(cwd) {
|
|
124073
124394
|
const entry = byCwd.get(cwd);
|
|
@@ -124075,29 +124396,33 @@ function createProjectRootResolver(overrides = {}) {
|
|
|
124075
124396
|
if (entry.retryAt !== void 0 && deps.now() >= entry.retryAt) return void 0;
|
|
124076
124397
|
return entry;
|
|
124077
124398
|
}
|
|
124078
|
-
function
|
|
124399
|
+
function lookup(cwd) {
|
|
124079
124400
|
const key = deps.canonical(cwd);
|
|
124080
124401
|
const cached2 = live(key);
|
|
124081
|
-
if (cached2) return cached2.
|
|
124402
|
+
if (cached2) return cached2.found;
|
|
124082
124403
|
const previousMisses = byCwd.get(key)?.misses ?? 0;
|
|
124083
124404
|
const entry = {
|
|
124084
124405
|
misses: previousMisses,
|
|
124085
|
-
|
|
124406
|
+
found: lookups.run(() => lookUp(key)).then(({ found, answered: answered2 }) => {
|
|
124407
|
+
const root = rootOf(found);
|
|
124086
124408
|
entry.settled = { root };
|
|
124087
124409
|
if (root === null) {
|
|
124088
124410
|
if (answered2) entry.misses = previousMisses + 1;
|
|
124089
124411
|
entry.retryAt = deps.now() + (answered2 ? negativeTtl(entry.misses) : NEGATIVE_ROOT_TTL_MS);
|
|
124090
124412
|
}
|
|
124091
|
-
return
|
|
124413
|
+
return found;
|
|
124092
124414
|
})
|
|
124093
124415
|
};
|
|
124094
124416
|
byCwd.set(key, entry);
|
|
124095
|
-
return entry.
|
|
124417
|
+
return entry.found;
|
|
124418
|
+
}
|
|
124419
|
+
function resolve14(cwd) {
|
|
124420
|
+
return lookup(cwd).then(rootOf);
|
|
124096
124421
|
}
|
|
124097
124422
|
function peek(cwd) {
|
|
124098
124423
|
return live(deps.canonical(cwd))?.settled?.root;
|
|
124099
124424
|
}
|
|
124100
|
-
return { resolve: resolve14, peek, readUncached };
|
|
124425
|
+
return { resolve: resolve14, lookup, peek, readUncached };
|
|
124101
124426
|
}
|
|
124102
124427
|
function resolveProjectRoot(cwd) {
|
|
124103
124428
|
return defaultResolver.resolve(cwd);
|
|
@@ -124105,20 +124430,20 @@ function resolveProjectRoot(cwd) {
|
|
|
124105
124430
|
function peekProjectRoot(cwd) {
|
|
124106
124431
|
return defaultResolver.peek(cwd);
|
|
124107
124432
|
}
|
|
124108
|
-
var NEGATIVE_ROOT_TTL_MS, MAX_NEGATIVE_ROOT_TTL_MS, MAX_CONCURRENT_ROOT_LOOKUPS, ROOT_LOOKUP_GIT_ENV,
|
|
124433
|
+
var NEGATIVE_ROOT_TTL_MS, MAX_NEGATIVE_ROOT_TTL_MS, MAX_CONCURRENT_ROOT_LOOKUPS, ROOT_LOOKUP_GIT_ENV, GIT_TIMEOUT_MS, defaultDeps, defaultResolver;
|
|
124109
124434
|
var init_resolve_project_root = __esm({
|
|
124110
124435
|
"../../apps/server/src/services/projects/resolve-project-root.ts"() {
|
|
124111
124436
|
"use strict";
|
|
124112
124437
|
init_canonical_directory();
|
|
124113
124438
|
init_slots();
|
|
124114
|
-
|
|
124439
|
+
init_safe_git();
|
|
124115
124440
|
NEGATIVE_ROOT_TTL_MS = 6e4;
|
|
124116
124441
|
MAX_NEGATIVE_ROOT_TTL_MS = 10 * 6e4;
|
|
124117
124442
|
MAX_CONCURRENT_ROOT_LOOKUPS = 4;
|
|
124118
124443
|
ROOT_LOOKUP_GIT_ENV = { LC_ALL: "C", LANG: "C" };
|
|
124119
|
-
|
|
124444
|
+
GIT_TIMEOUT_MS = 5e3;
|
|
124120
124445
|
defaultDeps = {
|
|
124121
|
-
runGit,
|
|
124446
|
+
runGit: runSafeGit,
|
|
124122
124447
|
now: Date.now,
|
|
124123
124448
|
canonical: canonicalDirectory
|
|
124124
124449
|
};
|
|
@@ -124127,11 +124452,11 @@ var init_resolve_project_root = __esm({
|
|
|
124127
124452
|
});
|
|
124128
124453
|
|
|
124129
124454
|
// ../../apps/server/src/services/projects/project-registry.ts
|
|
124130
|
-
import
|
|
124455
|
+
import path46 from "node:path";
|
|
124131
124456
|
async function readOriginRepoFromGit(root) {
|
|
124132
124457
|
try {
|
|
124133
124458
|
return parseOriginRepo(
|
|
124134
|
-
await
|
|
124459
|
+
await runSafeGit(["remote", "get-url", "origin"], root, { timeoutMs: ORIGIN_GIT_TIMEOUT_MS })
|
|
124135
124460
|
);
|
|
124136
124461
|
} catch {
|
|
124137
124462
|
return null;
|
|
@@ -124157,7 +124482,7 @@ var init_project_registry = __esm({
|
|
|
124157
124482
|
"use strict";
|
|
124158
124483
|
init_boundary();
|
|
124159
124484
|
init_logger();
|
|
124160
|
-
|
|
124485
|
+
init_safe_git();
|
|
124161
124486
|
init_extension_copy();
|
|
124162
124487
|
init_origin_repo();
|
|
124163
124488
|
init_project_names();
|
|
@@ -124599,7 +124924,7 @@ var init_project_registry = __esm({
|
|
|
124599
124924
|
this.sourcesReadAt = now3;
|
|
124600
124925
|
this.sourcesRead = (async () => {
|
|
124601
124926
|
try {
|
|
124602
|
-
const folders = [...new Set(await sources2())].filter((dir) =>
|
|
124927
|
+
const folders = [...new Set(await sources2())].filter((dir) => path46.isAbsolute(dir));
|
|
124603
124928
|
await this.seedBatch(folders);
|
|
124604
124929
|
} catch (err) {
|
|
124605
124930
|
this.warn("could not read the folders to seed projects from", err);
|
|
@@ -125317,6 +125642,8 @@ var init_account_eligibility = __esm({
|
|
|
125317
125642
|
init_config_schema();
|
|
125318
125643
|
init_project_schemas();
|
|
125319
125644
|
init_project_registry();
|
|
125645
|
+
init_resolve_project_root();
|
|
125646
|
+
init_config_manager();
|
|
125320
125647
|
}
|
|
125321
125648
|
});
|
|
125322
125649
|
|
|
@@ -125392,13 +125719,13 @@ var init_account_ranking = __esm({
|
|
|
125392
125719
|
});
|
|
125393
125720
|
|
|
125394
125721
|
// ../../apps/server/src/services/runtimes/claude-code/claude-config-dir.ts
|
|
125395
|
-
import
|
|
125722
|
+
import path47 from "path";
|
|
125396
125723
|
import os7 from "os";
|
|
125397
125724
|
function expandClaudeAccountHome(dir) {
|
|
125398
125725
|
return dir === "~" || dir.startsWith("~/") ? expandAccountPath(dir, os7.homedir()) : dir;
|
|
125399
125726
|
}
|
|
125400
125727
|
function inheritedClaudeRoot() {
|
|
125401
|
-
return ambientClaudeConfigDir() ??
|
|
125728
|
+
return ambientClaudeConfigDir() ?? path47.join(os7.homedir(), ".claude");
|
|
125402
125729
|
}
|
|
125403
125730
|
var init_claude_config_dir = __esm({
|
|
125404
125731
|
"../../apps/server/src/services/runtimes/claude-code/claude-config-dir.ts"() {
|
|
@@ -125583,13 +125910,13 @@ function sameLeaf(a2, b2) {
|
|
|
125583
125910
|
function collectChangedPaths(before, after, prefix, out) {
|
|
125584
125911
|
for (const key of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
125585
125912
|
if (DANGEROUS_KEYS.has(key)) continue;
|
|
125586
|
-
const
|
|
125913
|
+
const path74 = prefix ? `${prefix}.${key}` : key;
|
|
125587
125914
|
const a2 = before[key];
|
|
125588
125915
|
const b2 = after[key];
|
|
125589
125916
|
if (isPlainObject6(a2) && isPlainObject6(b2)) {
|
|
125590
|
-
collectChangedPaths(a2, b2,
|
|
125917
|
+
collectChangedPaths(a2, b2, path74, out);
|
|
125591
125918
|
} else if (!sameLeaf(a2, b2)) {
|
|
125592
|
-
out.push(
|
|
125919
|
+
out.push(path74);
|
|
125593
125920
|
}
|
|
125594
125921
|
}
|
|
125595
125922
|
}
|
|
@@ -125601,9 +125928,9 @@ function renderSegment(segment) {
|
|
|
125601
125928
|
(char) => `\\u${char.codePointAt(0).toString(16).padStart(4, "0")}`
|
|
125602
125929
|
);
|
|
125603
125930
|
}
|
|
125604
|
-
function isOperatorOnlyPath(
|
|
125931
|
+
function isOperatorOnlyPath(path74) {
|
|
125605
125932
|
return OPERATOR_ONLY_CONFIG_PATHS.some(
|
|
125606
|
-
(guarded) =>
|
|
125933
|
+
(guarded) => path74 === guarded || path74.startsWith(`${guarded}.`)
|
|
125607
125934
|
);
|
|
125608
125935
|
}
|
|
125609
125936
|
function describeConfigWrite(before, after) {
|
|
@@ -125613,14 +125940,14 @@ function describeConfigWrite(before, after) {
|
|
|
125613
125940
|
if (changed.length === 0) return "";
|
|
125614
125941
|
const ordered = [
|
|
125615
125942
|
...changed.filter(isOperatorOnlyPath).sort(),
|
|
125616
|
-
...changed.filter((
|
|
125943
|
+
...changed.filter((path74) => !isOperatorOnlyPath(path74)).sort()
|
|
125617
125944
|
];
|
|
125618
|
-
const named3 = ordered.slice(0, LOGGED_PATH_LIMIT).map((
|
|
125945
|
+
const named3 = ordered.slice(0, LOGGED_PATH_LIMIT).map((path74) => path74.split(".").map(renderSegment).join(".")).join(", ");
|
|
125619
125946
|
return ordered.length <= LOGGED_PATH_LIMIT ? named3 : `${named3}, and ${ordered.length - LOGGED_PATH_LIMIT} more`;
|
|
125620
125947
|
}
|
|
125621
|
-
function valueAtPath(root,
|
|
125948
|
+
function valueAtPath(root, path74) {
|
|
125622
125949
|
let node2 = root;
|
|
125623
|
-
for (const key of
|
|
125950
|
+
for (const key of path74.split(".")) {
|
|
125624
125951
|
if (!isPlainObject6(node2)) return void 0;
|
|
125625
125952
|
node2 = node2[key];
|
|
125626
125953
|
}
|
|
@@ -125751,9 +126078,9 @@ function describeOperatorOnlyRefusal(paths2) {
|
|
|
125751
126078
|
const remaining = new Set(paths2);
|
|
125752
126079
|
const clauses = [];
|
|
125753
126080
|
for (const group of OPERATOR_ONLY_STAKES) {
|
|
125754
|
-
const matched = paths2.filter((
|
|
126081
|
+
const matched = paths2.filter((path74) => group.paths.includes(path74));
|
|
125755
126082
|
if (matched.length === 0) continue;
|
|
125756
|
-
for (const
|
|
126083
|
+
for (const path74 of matched) remaining.delete(path74);
|
|
125757
126084
|
clauses.push(`${group.description}: ${matched.join(", ")}.`);
|
|
125758
126085
|
}
|
|
125759
126086
|
if (remaining.size > 0) {
|
|
@@ -125792,7 +126119,7 @@ __export(config_write_exports, {
|
|
|
125792
126119
|
function personApprovedAuthority(decidedByUserId, isLoginEnabled = () => decidedByUserId !== void 0 || configManager.get("auth")?.enabled === true, isOwner = (userId) => isInstallOwner(userId === void 0 ? void 0 : { userId })) {
|
|
125793
126120
|
return {
|
|
125794
126121
|
refuseOperatorOnly: (paths2) => {
|
|
125795
|
-
const cloudPaths = paths2.filter((
|
|
126122
|
+
const cloudPaths = paths2.filter((path74) => path74.startsWith("cloud."));
|
|
125796
126123
|
if (cloudPaths.length === 0 || !isLoginEnabled() || isOwner(decidedByUserId)) {
|
|
125797
126124
|
return void 0;
|
|
125798
126125
|
}
|
|
@@ -125806,9 +126133,9 @@ function personApprovedAuthority(decidedByUserId, isLoginEnabled = () => decided
|
|
|
125806
126133
|
}
|
|
125807
126134
|
};
|
|
125808
126135
|
}
|
|
125809
|
-
function leafAt(config3,
|
|
126136
|
+
function leafAt(config3, path74) {
|
|
125810
126137
|
let current3 = config3;
|
|
125811
|
-
for (const key of
|
|
126138
|
+
for (const key of path74) {
|
|
125812
126139
|
if (current3 === null || typeof current3 !== "object") return null;
|
|
125813
126140
|
current3 = current3[key];
|
|
125814
126141
|
}
|
|
@@ -125819,9 +126146,9 @@ function onTrustStopChange(listener) {
|
|
|
125819
126146
|
}
|
|
125820
126147
|
function reportTrustStopMoves(before, after, write) {
|
|
125821
126148
|
if (!trustStopListener) return;
|
|
125822
|
-
const moves = TRUST_STOP_LEAVES.flatMap(({ path:
|
|
125823
|
-
const was = leafAt(before,
|
|
125824
|
-
const now3 = leafAt(after,
|
|
126149
|
+
const moves = TRUST_STOP_LEAVES.flatMap(({ path: path74, runtime }) => {
|
|
126150
|
+
const was = leafAt(before, path74);
|
|
126151
|
+
const now3 = leafAt(after, path74);
|
|
125825
126152
|
return was === now3 ? [] : [{ ...runtime ? { runtime } : {}, before: was, after: now3 }];
|
|
125826
126153
|
});
|
|
125827
126154
|
if (moves.length === 0) return;
|
|
@@ -132027,8 +132354,8 @@ var init_manifest_edit = __esm({
|
|
|
132027
132354
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
132028
132355
|
import { join as join30 } from "node:path";
|
|
132029
132356
|
function enableHarnessInManifest(repoRoot, harness) {
|
|
132030
|
-
const
|
|
132031
|
-
const abs = join30(repoRoot,
|
|
132357
|
+
const path74 = HARNESS_MANIFEST_PATH;
|
|
132358
|
+
const abs = join30(repoRoot, path74);
|
|
132032
132359
|
const before = readFileSync9(abs, "utf8");
|
|
132033
132360
|
let parsed;
|
|
132034
132361
|
try {
|
|
@@ -132037,7 +132364,7 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
132037
132364
|
return {
|
|
132038
132365
|
outcome: "unwritable",
|
|
132039
132366
|
harness,
|
|
132040
|
-
path:
|
|
132367
|
+
path: path74,
|
|
132041
132368
|
reason: `it is not valid JSON (${err instanceof Error ? err.message : String(err)})`
|
|
132042
132369
|
};
|
|
132043
132370
|
}
|
|
@@ -132045,16 +132372,16 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
132045
132372
|
try {
|
|
132046
132373
|
manifest = parseHarnessManifest(parsed);
|
|
132047
132374
|
} catch (err) {
|
|
132048
|
-
return { outcome: "unwritable", harness, path:
|
|
132375
|
+
return { outcome: "unwritable", harness, path: path74, reason: manifestSchemaReason(err) };
|
|
132049
132376
|
}
|
|
132050
132377
|
const existing = manifest.harnesses;
|
|
132051
|
-
if (existing.includes(harness)) return { outcome: "already-enabled", harness, path:
|
|
132378
|
+
if (existing.includes(harness)) return { outcome: "already-enabled", harness, path: path74 };
|
|
132052
132379
|
const edit = plannedEdit(before, existing, harness);
|
|
132053
132380
|
if (!edit) {
|
|
132054
132381
|
return {
|
|
132055
132382
|
outcome: "unwritable",
|
|
132056
132383
|
harness,
|
|
132057
|
-
path:
|
|
132384
|
+
path: path74,
|
|
132058
132385
|
reason: 'its "harnesses" list could not be located in the file as written'
|
|
132059
132386
|
};
|
|
132060
132387
|
}
|
|
@@ -132063,12 +132390,12 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
132063
132390
|
return {
|
|
132064
132391
|
outcome: "unwritable",
|
|
132065
132392
|
harness,
|
|
132066
|
-
path:
|
|
132393
|
+
path: path74,
|
|
132067
132394
|
reason: "adding the harness would have changed something else in the file"
|
|
132068
132395
|
};
|
|
132069
132396
|
}
|
|
132070
132397
|
writeFileAtomic(abs, after);
|
|
132071
|
-
return { outcome: "enabled", harness, path:
|
|
132398
|
+
return { outcome: "enabled", harness, path: path74, inserted };
|
|
132072
132399
|
}
|
|
132073
132400
|
function plannedEdit(text3, existing, harness) {
|
|
132074
132401
|
const array2 = findValueSpan(text3, "harnesses", "[");
|
|
@@ -132103,8 +132430,8 @@ var init_enable_harness = __esm({
|
|
|
132103
132430
|
import { readFileSync as readFileSync10 } from "node:fs";
|
|
132104
132431
|
import { join as join31 } from "node:path";
|
|
132105
132432
|
function declareClaudeOnlySkill(repoRoot, entry) {
|
|
132106
|
-
const
|
|
132107
|
-
const abs = join31(repoRoot,
|
|
132433
|
+
const path74 = HARNESS_MANIFEST_PATH;
|
|
132434
|
+
const abs = join31(repoRoot, path74);
|
|
132108
132435
|
const before = readFileSync10(abs, "utf8");
|
|
132109
132436
|
let parsed;
|
|
132110
132437
|
try {
|
|
@@ -132112,7 +132439,7 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
132112
132439
|
} catch (err) {
|
|
132113
132440
|
return {
|
|
132114
132441
|
outcome: "unwritable",
|
|
132115
|
-
path:
|
|
132442
|
+
path: path74,
|
|
132116
132443
|
reason: `it is not valid JSON (${err instanceof Error ? err.message : String(err)})`
|
|
132117
132444
|
};
|
|
132118
132445
|
}
|
|
@@ -132120,10 +132447,10 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
132120
132447
|
try {
|
|
132121
132448
|
manifest = parseHarnessManifest(parsed);
|
|
132122
132449
|
} catch (err) {
|
|
132123
|
-
return { outcome: "unwritable", path:
|
|
132450
|
+
return { outcome: "unwritable", path: path74, reason: manifestSchemaReason(err) };
|
|
132124
132451
|
}
|
|
132125
132452
|
if (manifest.claudeOnlySkills.some((declared) => declared.name === entry.name)) {
|
|
132126
|
-
return { outcome: "already-declared", path:
|
|
132453
|
+
return { outcome: "already-declared", path: path74 };
|
|
132127
132454
|
}
|
|
132128
132455
|
const raw = parsed.claudeOnlySkills;
|
|
132129
132456
|
const rawEntries = Array.isArray(raw) ? raw : [];
|
|
@@ -132132,7 +132459,7 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
132132
132459
|
if (!edit) {
|
|
132133
132460
|
return {
|
|
132134
132461
|
outcome: "unwritable",
|
|
132135
|
-
path:
|
|
132462
|
+
path: path74,
|
|
132136
132463
|
reason: 'its "claudeOnlySkills" list could not be located in the file as written'
|
|
132137
132464
|
};
|
|
132138
132465
|
}
|
|
@@ -132140,12 +132467,12 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
132140
132467
|
if (!isExactlyOneSkillDeclared(after, parsed, rawEntries, entry)) {
|
|
132141
132468
|
return {
|
|
132142
132469
|
outcome: "unwritable",
|
|
132143
|
-
path:
|
|
132470
|
+
path: path74,
|
|
132144
132471
|
reason: "recording the skill would have changed something else in the file"
|
|
132145
132472
|
};
|
|
132146
132473
|
}
|
|
132147
132474
|
writeFileAtomic(abs, after);
|
|
132148
|
-
return { outcome: "declared", path:
|
|
132475
|
+
return { outcome: "declared", path: path74, inserted };
|
|
132149
132476
|
}
|
|
132150
132477
|
function editAddingTheKey(text3, existing, entry) {
|
|
132151
132478
|
const root = findRootObject(text3);
|
|
@@ -134132,14 +134459,14 @@ function ignoringLayer(layers, relPath2, leafKind) {
|
|
|
134132
134459
|
}
|
|
134133
134460
|
return decided;
|
|
134134
134461
|
}
|
|
134135
|
-
function pathWithin(dir,
|
|
134136
|
-
if (dir === "") return
|
|
134137
|
-
return
|
|
134462
|
+
function pathWithin(dir, path74) {
|
|
134463
|
+
if (dir === "") return path74;
|
|
134464
|
+
return path74.startsWith(`${dir}/`) ? path74.slice(dir.length + 1) : void 0;
|
|
134138
134465
|
}
|
|
134139
134466
|
function gitignorePatternMatches(pattern, relPath2, leafKind = "file") {
|
|
134140
134467
|
return isPathIgnored([pattern], relPath2, leafKind);
|
|
134141
134468
|
}
|
|
134142
|
-
function decidePattern(pattern,
|
|
134469
|
+
function decidePattern(pattern, path74, isDir) {
|
|
134143
134470
|
const trimmed = pattern.trim();
|
|
134144
134471
|
if (trimmed === "" || trimmed.startsWith("#")) return void 0;
|
|
134145
134472
|
const negated = trimmed.startsWith("!");
|
|
@@ -134152,7 +134479,7 @@ function decidePattern(pattern, path73, isDir) {
|
|
|
134152
134479
|
if (body === "") return void 0;
|
|
134153
134480
|
const anchored = !anyDepth && (rule.startsWith("/") || body.includes("/"));
|
|
134154
134481
|
const prefix = anchored ? "^" : "^(?:.*/)?";
|
|
134155
|
-
return new RegExp(`${prefix}${globToRegExpBody(body)}$`).test(
|
|
134482
|
+
return new RegExp(`${prefix}${globToRegExpBody(body)}$`).test(path74) ? !negated : void 0;
|
|
134156
134483
|
}
|
|
134157
134484
|
function globToRegExpBody(body) {
|
|
134158
134485
|
let out = "";
|
|
@@ -134188,11 +134515,11 @@ function gitCheckoutRoot(projectRoot) {
|
|
|
134188
134515
|
dir = parent;
|
|
134189
134516
|
}
|
|
134190
134517
|
}
|
|
134191
|
-
function physicalPath(
|
|
134518
|
+
function physicalPath(path74) {
|
|
134192
134519
|
try {
|
|
134193
|
-
return realpathSync8.native(
|
|
134520
|
+
return realpathSync8.native(path74);
|
|
134194
134521
|
} catch {
|
|
134195
|
-
return resolve4(
|
|
134522
|
+
return resolve4(path74);
|
|
134196
134523
|
}
|
|
134197
134524
|
}
|
|
134198
134525
|
function projectPrefix(checkoutRoot, projectRoot) {
|
|
@@ -134249,7 +134576,7 @@ function ephemeralPaths(plan, repoRoot) {
|
|
|
134249
134576
|
}
|
|
134250
134577
|
}
|
|
134251
134578
|
if (existsSync10(join32(repoRoot, PROJECT_PLUGINS_DIR))) paths2.set(INSTALL_ROOT_PROBE, "dir");
|
|
134252
|
-
return [...paths2].map(([
|
|
134579
|
+
return [...paths2].map(([path74, kind]) => ({ path: path74, kind }));
|
|
134253
134580
|
}
|
|
134254
134581
|
function onDiskKind(repoRoot, relPath2, fallback) {
|
|
134255
134582
|
try {
|
|
@@ -134278,13 +134605,13 @@ function missingGitignoreLines(repoRoot, plan) {
|
|
|
134278
134605
|
const checkout = checkoutContext(repoRoot);
|
|
134279
134606
|
if (checkout === void 0) return [];
|
|
134280
134607
|
const missing = /* @__PURE__ */ new Set();
|
|
134281
|
-
for (const { path:
|
|
134282
|
-
if (ignoredBy(checkout.root, underPrefix(checkout.prefix,
|
|
134283
|
-
if (selfIgnored(plan,
|
|
134608
|
+
for (const { path: path74, kind } of ephemeralPaths(plan, repoRoot)) {
|
|
134609
|
+
if (ignoredBy(checkout.root, underPrefix(checkout.prefix, path74), kind) !== void 0) continue;
|
|
134610
|
+
if (selfIgnored(plan, path74)) continue;
|
|
134284
134611
|
const covering = EPHEMERAL_GITIGNORE_PATTERNS.filter(
|
|
134285
|
-
(pattern) => gitignorePatternMatches(pattern,
|
|
134612
|
+
(pattern) => gitignorePatternMatches(pattern, path74, kind)
|
|
134286
134613
|
);
|
|
134287
|
-
if (covering.length === 0) missing.add(
|
|
134614
|
+
if (covering.length === 0) missing.add(path74);
|
|
134288
134615
|
else for (const pattern of covering) missing.add(pattern);
|
|
134289
134616
|
}
|
|
134290
134617
|
const declared = EPHEMERAL_GITIGNORE_PATTERNS;
|
|
@@ -134463,10 +134790,10 @@ var init_read2 = __esm({
|
|
|
134463
134790
|
// ../harness/src/apply/sweep-reasons.ts
|
|
134464
134791
|
import { basename as basename4 } from "node:path";
|
|
134465
134792
|
function explainSweep(paths2, cause) {
|
|
134466
|
-
return paths2.map((
|
|
134793
|
+
return paths2.map((path74) => ({ path: path74, reason: sweepReason(path74, cause) }));
|
|
134467
134794
|
}
|
|
134468
|
-
function sweepReason(
|
|
134469
|
-
if (cause === "command-wrapper" && isAtomicTempName(basename4(
|
|
134795
|
+
function sweepReason(path74, cause) {
|
|
134796
|
+
if (cause === "command-wrapper" && isAtomicTempName(basename4(path74))) {
|
|
134470
134797
|
return SWEEP_REASONS["stale-temp"];
|
|
134471
134798
|
}
|
|
134472
134799
|
return SWEEP_REASONS[cause];
|
|
@@ -134543,10 +134870,10 @@ function partitionRemovable(repoRoot, paths2) {
|
|
|
134543
134870
|
const removable = [];
|
|
134544
134871
|
const warnings = [];
|
|
134545
134872
|
const probed = /* @__PURE__ */ new Map();
|
|
134546
|
-
for (const
|
|
134547
|
-
const absDir = unwritableParent(join34(repoRoot,
|
|
134548
|
-
if (absDir === void 0) removable.push(
|
|
134549
|
-
else warnings.push(blockedRemovalWarning(
|
|
134873
|
+
for (const path74 of paths2) {
|
|
134874
|
+
const absDir = unwritableParent(join34(repoRoot, path74), probed);
|
|
134875
|
+
if (absDir === void 0) removable.push(path74);
|
|
134876
|
+
else warnings.push(blockedRemovalWarning(path74, spell(repoRoot, absDir)));
|
|
134550
134877
|
}
|
|
134551
134878
|
return { removable, warnings };
|
|
134552
134879
|
}
|
|
@@ -134624,8 +134951,8 @@ var init_authored_orphans = __esm({
|
|
|
134624
134951
|
// ../harness/src/apply/symlink-occupants.ts
|
|
134625
134952
|
import { readdirSync as readdirSync7, readFileSync as readFileSync14, readlinkSync as readlinkSync3, realpathSync as realpathSync9, statSync as statSync8 } from "node:fs";
|
|
134626
134953
|
import { basename as basename5, dirname as dirname10 } from "node:path";
|
|
134627
|
-
function withForwardSlashes(
|
|
134628
|
-
return
|
|
134954
|
+
function withForwardSlashes(path74) {
|
|
134955
|
+
return path74.split("\\").join("/");
|
|
134629
134956
|
}
|
|
134630
134957
|
function holdsOwnLinkText(absTarget, linkText) {
|
|
134631
134958
|
try {
|
|
@@ -135272,7 +135599,7 @@ function applyPlan(repoRoot, plan, opts) {
|
|
|
135272
135599
|
return {
|
|
135273
135600
|
applied,
|
|
135274
135601
|
conflicts,
|
|
135275
|
-
swept: removals.map(({ path:
|
|
135602
|
+
swept: removals.map(({ path: path74 }) => path74),
|
|
135276
135603
|
removals,
|
|
135277
135604
|
leftAlone,
|
|
135278
135605
|
// Three subjects, one list, and the junction one sits OUTSIDE the sweep
|
|
@@ -135390,7 +135717,7 @@ function checkPlan(repoRoot, plan) {
|
|
|
135390
135717
|
return {
|
|
135391
135718
|
drifted,
|
|
135392
135719
|
blocked,
|
|
135393
|
-
orphans: removals.map(({ path:
|
|
135720
|
+
orphans: removals.map(({ path: path74 }) => path74),
|
|
135394
135721
|
removals,
|
|
135395
135722
|
leftAlone: findLeftAloneGeneratedHookFiles(repoRoot, plan),
|
|
135396
135723
|
// Not drift, and the first two are never an exit code either: a junction
|
|
@@ -135658,7 +135985,7 @@ function globalOrphanCandidates(plan, roots) {
|
|
|
135658
135985
|
function findGlobalOrphans(plan, roots) {
|
|
135659
135986
|
const orphans = globalOrphanCandidates(plan, roots);
|
|
135660
135987
|
const removable = new Set(removableOf("", [...orphans.keys()]));
|
|
135661
|
-
return [...orphans.entries()].filter(([
|
|
135988
|
+
return [...orphans.entries()].filter(([path74]) => removable.has(path74)).sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0).map(([path74, reason]) => ({ path: path74, reason }));
|
|
135662
135989
|
}
|
|
135663
135990
|
function findBlockedGlobalRemovals(plan, roots) {
|
|
135664
135991
|
if (plan.unreadableRoot !== void 0) return [];
|
|
@@ -135669,7 +135996,7 @@ function rawGlobalOrphanPaths(plan, roots) {
|
|
|
135669
135996
|
}
|
|
135670
135997
|
function sweepGlobalOrphans(plan, roots) {
|
|
135671
135998
|
const orphans = findGlobalOrphans(plan, roots);
|
|
135672
|
-
for (const { path:
|
|
135999
|
+
for (const { path: path74 } of orphans) rmSync8(path74, { force: true });
|
|
135673
136000
|
return orphans;
|
|
135674
136001
|
}
|
|
135675
136002
|
function globalLinkText(action) {
|
|
@@ -135771,7 +136098,7 @@ function applyGlobalPlan(plan, roots, opts) {
|
|
|
135771
136098
|
return {
|
|
135772
136099
|
applied,
|
|
135773
136100
|
conflicts,
|
|
135774
|
-
swept: removals.map(({ path:
|
|
136101
|
+
swept: removals.map(({ path: path74 }) => path74),
|
|
135775
136102
|
removals,
|
|
135776
136103
|
leftAlone: [],
|
|
135777
136104
|
// A global run has no folder to be BLIND inside — `findGlobalOrphans` walks
|
|
@@ -135804,7 +136131,7 @@ function checkGlobalPlan(plan, roots) {
|
|
|
135804
136131
|
return {
|
|
135805
136132
|
drifted,
|
|
135806
136133
|
blocked,
|
|
135807
|
-
orphans: removals.map(({ path:
|
|
136134
|
+
orphans: removals.map(({ path: path74 }) => path74),
|
|
135808
136135
|
removals,
|
|
135809
136136
|
leftAlone: [],
|
|
135810
136137
|
// The junction family cannot reach a global plan at all, and by nature
|
|
@@ -135974,16 +136301,16 @@ import {
|
|
|
135974
136301
|
statSync as statSync10
|
|
135975
136302
|
} from "node:fs";
|
|
135976
136303
|
import { basename as basename7, isAbsolute as isAbsolute7, join as join42, relative as relative8, resolve as resolve7, sep as sep9 } from "node:path";
|
|
135977
|
-
function statOrUndefined(
|
|
136304
|
+
function statOrUndefined(path74) {
|
|
135978
136305
|
try {
|
|
135979
|
-
return statSync10(
|
|
136306
|
+
return statSync10(path74, { throwIfNoEntry: false });
|
|
135980
136307
|
} catch {
|
|
135981
136308
|
return void 0;
|
|
135982
136309
|
}
|
|
135983
136310
|
}
|
|
135984
|
-
function lstatOrUndefined(
|
|
136311
|
+
function lstatOrUndefined(path74) {
|
|
135985
136312
|
try {
|
|
135986
|
-
return lstatSync14(
|
|
136313
|
+
return lstatSync14(path74, { throwIfNoEntry: false });
|
|
135987
136314
|
} catch {
|
|
135988
136315
|
return void 0;
|
|
135989
136316
|
}
|
|
@@ -136207,13 +136534,13 @@ function scanClaudeOnlySkills(repoRoot, manifest) {
|
|
|
136207
136534
|
const resolved = /* @__PURE__ */ new Map();
|
|
136208
136535
|
for (const entry of manifest.claudeOnlySkills) {
|
|
136209
136536
|
const defaultPath = `${CLAUDE_SKILLS_DIR}/${entry.name}`;
|
|
136210
|
-
const
|
|
136211
|
-
const abs = join43(repoRoot,
|
|
136537
|
+
const path74 = entry.path.trim() === "" ? defaultPath : entry.path;
|
|
136538
|
+
const abs = join43(repoRoot, path74);
|
|
136212
136539
|
let kind = "missing";
|
|
136213
136540
|
const stats2 = lstatSync15(abs, { throwIfNoEntry: false });
|
|
136214
136541
|
if (stats2?.isSymbolicLink()) kind = "symlink";
|
|
136215
136542
|
else if (stats2?.isDirectory() && existsSync15(join43(abs, "SKILL.md"))) kind = "directory";
|
|
136216
|
-
resolved.set(entry.name, { path:
|
|
136543
|
+
resolved.set(entry.name, { path: path74, kind, atProjectionTarget: path74 === defaultPath });
|
|
136217
136544
|
}
|
|
136218
136545
|
return resolved;
|
|
136219
136546
|
}
|
|
@@ -136862,9 +137189,9 @@ var init_harness_sync_allow_hooks = __esm({
|
|
|
136862
137189
|
|
|
136863
137190
|
// ../../apps/server/src/services/harness/agents-user-home.ts
|
|
136864
137191
|
import os8 from "os";
|
|
136865
|
-
import
|
|
137192
|
+
import path48 from "path";
|
|
136866
137193
|
function agentsUserSkillsDir() {
|
|
136867
|
-
return
|
|
137194
|
+
return path48.join(os8.homedir(), ".agents", "skills");
|
|
136868
137195
|
}
|
|
136869
137196
|
var init_agents_user_home = __esm({
|
|
136870
137197
|
"../../apps/server/src/services/harness/agents-user-home.ts"() {
|
|
@@ -137098,7 +137425,7 @@ async function listSharing(dorkHome) {
|
|
|
137098
137425
|
function removalLines(removals, about) {
|
|
137099
137426
|
if (removals.length === 0) return [];
|
|
137100
137427
|
const heading = about === "will" ? `Removing ${removals.length} link(s):` : `Removed ${removals.length} link(s):`;
|
|
137101
|
-
return ["", heading, ...removals.map(({ path:
|
|
137428
|
+
return ["", heading, ...removals.map(({ path: path74, reason }) => ` ${path74} \u2014 ${reason}`)];
|
|
137102
137429
|
}
|
|
137103
137430
|
async function enableTool(dorkHome, tool) {
|
|
137104
137431
|
const {
|
|
@@ -137307,7 +137634,7 @@ function globalActionLine(action) {
|
|
|
137307
137634
|
function removalPreview(removals, about) {
|
|
137308
137635
|
if (removals.length === 0) return [];
|
|
137309
137636
|
const heading = about === "will" ? `Removing ${removals.length} link(s):` : `Removed ${removals.length} link(s):`;
|
|
137310
|
-
return ["", heading, ...removals.map(({ path:
|
|
137637
|
+
return ["", heading, ...removals.map(({ path: path74, reason }) => ` ${path74} \u2014 ${reason}`)];
|
|
137311
137638
|
}
|
|
137312
137639
|
function linkNamesIn(plan) {
|
|
137313
137640
|
return [...new Set(plan.actions.map((action) => action.name))];
|
|
@@ -137542,31 +137869,31 @@ var init_harness_sync_claude_only = __esm({
|
|
|
137542
137869
|
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-scripts.ts
|
|
137543
137870
|
import { createHash as createHash4 } from "node:crypto";
|
|
137544
137871
|
import { lstatSync as lstatSync16, readdirSync as readdirSync10, readFileSync as readFileSync21, statSync as statSync11 } from "node:fs";
|
|
137545
|
-
import
|
|
137872
|
+
import path49 from "node:path";
|
|
137546
137873
|
function isInside4(base, target) {
|
|
137547
|
-
const rel =
|
|
137548
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
137874
|
+
const rel = path49.relative(base, target);
|
|
137875
|
+
return rel !== "" && !rel.startsWith("..") && !path49.isAbsolute(rel);
|
|
137549
137876
|
}
|
|
137550
137877
|
function sha2562(content) {
|
|
137551
137878
|
return createHash4("sha256").update(content).digest("hex");
|
|
137552
137879
|
}
|
|
137553
137880
|
function namedTargets(root, pluginsRoot, commands) {
|
|
137554
137881
|
const found = /* @__PURE__ */ new Set();
|
|
137555
|
-
const pluginSegment = `${
|
|
137882
|
+
const pluginSegment = `${path49.sep}.dork${path49.sep}plugins${path49.sep}`;
|
|
137556
137883
|
for (const command of commands) {
|
|
137557
137884
|
const words = command.replace(/["']/g, "").replace(OUTPUT_REDIRECT, " ").replace(PROJECT_DIR_VAR, HOME_MARK).split(WORD_BREAK);
|
|
137558
137885
|
for (const word of words) {
|
|
137559
137886
|
if (!word) continue;
|
|
137560
137887
|
if (word.startsWith(HOME_MARK)) {
|
|
137561
|
-
const target =
|
|
137888
|
+
const target = path49.join(root, word.slice(HOME_MARK.length).split(HOME_MARK).join(root));
|
|
137562
137889
|
if (isInside4(root, target)) found.add(target);
|
|
137563
|
-
} else if (
|
|
137564
|
-
const target =
|
|
137890
|
+
} else if (path49.isAbsolute(word)) {
|
|
137891
|
+
const target = path49.resolve(word);
|
|
137565
137892
|
if (isInside4(root, target) || isInside4(pluginsRoot, target) || target.includes(pluginSegment)) {
|
|
137566
137893
|
found.add(target);
|
|
137567
137894
|
}
|
|
137568
137895
|
} else if (!word.startsWith("~") && !word.startsWith("$") && !word.startsWith("-") && PATH_LIKE.test(word)) {
|
|
137569
|
-
const target =
|
|
137896
|
+
const target = path49.resolve(root, word);
|
|
137570
137897
|
if (isInside4(root, target)) found.add(target);
|
|
137571
137898
|
}
|
|
137572
137899
|
}
|
|
@@ -137574,7 +137901,7 @@ function namedTargets(root, pluginsRoot, commands) {
|
|
|
137574
137901
|
return [...found];
|
|
137575
137902
|
}
|
|
137576
137903
|
function hookScriptFiles(home2, commands, dorkHome) {
|
|
137577
|
-
const root =
|
|
137904
|
+
const root = path49.resolve(home2);
|
|
137578
137905
|
const entries = /* @__PURE__ */ new Map();
|
|
137579
137906
|
let files = 0;
|
|
137580
137907
|
const hash3 = (abs) => {
|
|
@@ -137617,7 +137944,7 @@ function hookScriptFiles(home2, commands, dorkHome) {
|
|
|
137617
137944
|
return false;
|
|
137618
137945
|
}
|
|
137619
137946
|
for (const name2 of names) {
|
|
137620
|
-
const child =
|
|
137947
|
+
const child = path49.join(abs, name2);
|
|
137621
137948
|
let childStat;
|
|
137622
137949
|
try {
|
|
137623
137950
|
childStat = lstatSync16(child);
|
|
@@ -137628,15 +137955,15 @@ function hookScriptFiles(home2, commands, dorkHome) {
|
|
|
137628
137955
|
}
|
|
137629
137956
|
return true;
|
|
137630
137957
|
};
|
|
137631
|
-
if (!walk(
|
|
137632
|
-
for (const target of namedTargets(root,
|
|
137958
|
+
if (!walk(path49.join(root, ".claude", "hooks"), 1)) return void 0;
|
|
137959
|
+
for (const target of namedTargets(root, path49.resolve(dorkHome, "plugins"), commands)) {
|
|
137633
137960
|
if (!hash3(target)) return void 0;
|
|
137634
137961
|
}
|
|
137635
137962
|
return sortedByPath(root, entries);
|
|
137636
137963
|
}
|
|
137637
137964
|
function sortedByPath(root, entries) {
|
|
137638
137965
|
return [...entries].map(([abs, value]) => [
|
|
137639
|
-
isInside4(root, abs) ?
|
|
137966
|
+
isInside4(root, abs) ? path49.relative(root, abs).split(path49.sep).join("/") : abs,
|
|
137640
137967
|
value
|
|
137641
137968
|
]).sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
|
|
137642
137969
|
}
|
|
@@ -137654,7 +137981,7 @@ function pickAgentFileFields(text3) {
|
|
|
137654
137981
|
}
|
|
137655
137982
|
}
|
|
137656
137983
|
function agentFileHooks(home2) {
|
|
137657
|
-
const root =
|
|
137984
|
+
const root = path49.resolve(home2);
|
|
137658
137985
|
const entries = /* @__PURE__ */ new Map();
|
|
137659
137986
|
let files = 0;
|
|
137660
137987
|
const read = (abs) => {
|
|
@@ -137690,7 +138017,7 @@ function agentFileHooks(home2) {
|
|
|
137690
138017
|
if (names === null) return true;
|
|
137691
138018
|
if (names === void 0) return false;
|
|
137692
138019
|
for (const name2 of names) {
|
|
137693
|
-
const child =
|
|
138020
|
+
const child = path49.join(abs, name2);
|
|
137694
138021
|
const sub = listDir2(child);
|
|
137695
138022
|
if (sub !== void 0 && sub !== null) {
|
|
137696
138023
|
if (!walkAgents(child, depth + 1)) return false;
|
|
@@ -137700,14 +138027,14 @@ function agentFileHooks(home2) {
|
|
|
137700
138027
|
}
|
|
137701
138028
|
return true;
|
|
137702
138029
|
};
|
|
137703
|
-
if (!walkAgents(
|
|
137704
|
-
if (!walkAgents(
|
|
137705
|
-
const skillsDir =
|
|
138030
|
+
if (!walkAgents(path49.join(root, ".claude", "agents"), 1)) return void 0;
|
|
138031
|
+
if (!walkAgents(path49.join(root, ".claude", "commands"), 1)) return void 0;
|
|
138032
|
+
const skillsDir = path49.join(root, ".claude", "skills");
|
|
137706
138033
|
const skills = listDir2(skillsDir);
|
|
137707
138034
|
if (skills === void 0) return void 0;
|
|
137708
138035
|
for (const name2 of skills ?? []) {
|
|
137709
|
-
if (!read(
|
|
137710
|
-
if (listDir2(
|
|
138036
|
+
if (!read(path49.join(skillsDir, name2, "SKILL.md"))) {
|
|
138037
|
+
if (listDir2(path49.join(skillsDir, name2)) !== void 0) return void 0;
|
|
137711
138038
|
}
|
|
137712
138039
|
}
|
|
137713
138040
|
return sortedByPath(root, entries);
|
|
@@ -137741,10 +138068,10 @@ var init_folder_config_scripts = __esm({
|
|
|
137741
138068
|
// ../../apps/server/src/services/harness/hook-script-pins.ts
|
|
137742
138069
|
import { createHash as createHash5 } from "node:crypto";
|
|
137743
138070
|
import { readFileSync as readFileSync22, statSync as statSync12 } from "node:fs";
|
|
137744
|
-
import
|
|
138071
|
+
import path50 from "node:path";
|
|
137745
138072
|
function isInside5(base, target) {
|
|
137746
|
-
const rel =
|
|
137747
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
138073
|
+
const rel = path50.relative(base, target);
|
|
138074
|
+
return rel !== "" && !rel.startsWith("..") && !path50.isAbsolute(rel);
|
|
137748
138075
|
}
|
|
137749
138076
|
function fileFingerprint(abs) {
|
|
137750
138077
|
let stat5;
|
|
@@ -137763,10 +138090,10 @@ function fileFingerprint(abs) {
|
|
|
137763
138090
|
}
|
|
137764
138091
|
}
|
|
137765
138092
|
function hookScriptPins(projectPath, commands, dorkHome) {
|
|
137766
|
-
const root =
|
|
138093
|
+
const root = path50.resolve(projectPath);
|
|
137767
138094
|
const local = commands.map((command) => command.replace(URL_WORD, " "));
|
|
137768
|
-
return namedTargets(root,
|
|
137769
|
-
isInside5(root, abs) ?
|
|
138095
|
+
return namedTargets(root, path50.resolve(dorkHome, "plugins"), local).map((abs) => [
|
|
138096
|
+
isInside5(root, abs) ? path50.relative(root, abs).split(path50.sep).join("/") : abs,
|
|
137770
138097
|
fileFingerprint(abs)
|
|
137771
138098
|
]).sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
|
|
137772
138099
|
}
|
|
@@ -137783,7 +138110,7 @@ var init_hook_script_pins = __esm({
|
|
|
137783
138110
|
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-pin.ts
|
|
137784
138111
|
import { createHash as createHash6 } from "node:crypto";
|
|
137785
138112
|
import { readFileSync as readFileSync23, statSync as statSync13 } from "node:fs";
|
|
137786
|
-
import
|
|
138113
|
+
import path51 from "node:path";
|
|
137787
138114
|
function readJsonFile2(file2) {
|
|
137788
138115
|
let size;
|
|
137789
138116
|
try {
|
|
@@ -137852,7 +138179,7 @@ function hooksPart(home2, dorkHome) {
|
|
|
137852
138179
|
let verifiable = true;
|
|
137853
138180
|
const commands = [];
|
|
137854
138181
|
for (const name2 of SETTINGS_FILES) {
|
|
137855
|
-
const read = readJsonFile2(
|
|
138182
|
+
const read = readJsonFile2(path51.join(home2, ".claude", name2));
|
|
137856
138183
|
if (read.kind === "unverifiable") verifiable = false;
|
|
137857
138184
|
const picked = read.kind === "parsed" ? pick2(read.value, CODE_SETTINGS_KEYS) : void 0;
|
|
137858
138185
|
if (picked !== void 0) collectCommands2(picked, commands);
|
|
@@ -137880,13 +138207,13 @@ function collectCommands2(value, out) {
|
|
|
137880
138207
|
}
|
|
137881
138208
|
}
|
|
137882
138209
|
function mcpJsonPart(home2) {
|
|
137883
|
-
const read = readJsonFile2(
|
|
138210
|
+
const read = readJsonFile2(path51.join(home2, ".mcp.json"));
|
|
137884
138211
|
if (read.kind === "unverifiable") return { value: { unverifiable: true }, verifiable: false };
|
|
137885
138212
|
if (read.kind === "malformed") return { value: malformed(read.text), verifiable: true };
|
|
137886
138213
|
return { value: read.kind === "parsed" ? read.value : null, verifiable: true };
|
|
137887
138214
|
}
|
|
137888
138215
|
function manifestPart(home2) {
|
|
137889
|
-
const read = readJsonFile2(
|
|
138216
|
+
const read = readJsonFile2(path51.join(home2, ".dork", "agent.json"));
|
|
137890
138217
|
if (read.kind === "unverifiable") return { value: { unverifiable: true }, verifiable: false };
|
|
137891
138218
|
if (read.kind === "malformed") return { value: malformed(read.text), verifiable: true };
|
|
137892
138219
|
if (read.kind === "absent") return { value: null, verifiable: true };
|
|
@@ -137988,14 +138315,14 @@ var init_folder_config_pin = __esm({
|
|
|
137988
138315
|
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-consent.ts
|
|
137989
138316
|
import { createHash as createHash7 } from "node:crypto";
|
|
137990
138317
|
import { realpathSync as realpathSync12 } from "node:fs";
|
|
137991
|
-
import
|
|
138318
|
+
import path52 from "node:path";
|
|
137992
138319
|
function folderConfigEntry(state) {
|
|
137993
138320
|
const parts = Object.fromEntries(FOLDER_CONFIG_PARTS.map((p) => [p, state.digests[p]]));
|
|
137994
138321
|
const digest2 = createHash7("sha256").update(JSON.stringify({ home: canonicalHome2(state.home), parts })).digest("hex");
|
|
137995
138322
|
return `${state.agentId}${FOLDER_CONFIG_ENTRY_MARKER}${digest2}`;
|
|
137996
138323
|
}
|
|
137997
138324
|
function canonicalHome2(home2) {
|
|
137998
|
-
const resolved =
|
|
138325
|
+
const resolved = path52.resolve(home2);
|
|
137999
138326
|
try {
|
|
138000
138327
|
return realpathSync12.native(resolved);
|
|
138001
138328
|
} catch {
|
|
@@ -138295,11 +138622,11 @@ var init_atomic_write2 = __esm({
|
|
|
138295
138622
|
});
|
|
138296
138623
|
|
|
138297
138624
|
// ../../apps/server/src/services/marketplace/lib/package-paths.ts
|
|
138298
|
-
import
|
|
138625
|
+
import path53 from "node:path";
|
|
138299
138626
|
function assertContainedIn(root, candidate) {
|
|
138300
|
-
const resolvedRoot =
|
|
138301
|
-
const resolved =
|
|
138302
|
-
if (!resolved.startsWith(resolvedRoot +
|
|
138627
|
+
const resolvedRoot = path53.resolve(root);
|
|
138628
|
+
const resolved = path53.resolve(candidate);
|
|
138629
|
+
if (!resolved.startsWith(resolvedRoot + path53.sep)) {
|
|
138303
138630
|
throw new PathEscapeError(root, candidate);
|
|
138304
138631
|
}
|
|
138305
138632
|
return candidate;
|
|
@@ -138468,13 +138795,13 @@ function subpathDigest(subpath) {
|
|
|
138468
138795
|
if (subpath === "") return "";
|
|
138469
138796
|
return createHash8("sha256").update(subpath).digest("hex").slice(0, 12);
|
|
138470
138797
|
}
|
|
138471
|
-
async function stampUsed(
|
|
138798
|
+
async function stampUsed(path74) {
|
|
138472
138799
|
const now3 = /* @__PURE__ */ new Date();
|
|
138473
138800
|
try {
|
|
138474
|
-
await utimes(
|
|
138801
|
+
await utimes(path74, now3, now3);
|
|
138475
138802
|
return now3;
|
|
138476
138803
|
} catch {
|
|
138477
|
-
return (await stat2(
|
|
138804
|
+
return (await stat2(path74)).mtime;
|
|
138478
138805
|
}
|
|
138479
138806
|
}
|
|
138480
138807
|
function parsePackageDirName(entry) {
|
|
@@ -138715,14 +139042,14 @@ var init_marketplace_cache = __esm({
|
|
|
138715
139042
|
* @returns A descriptor when a non-empty entry is present, `null` otherwise.
|
|
138716
139043
|
*/
|
|
138717
139044
|
async getPackage(packageName, commitSha, subpath) {
|
|
138718
|
-
const
|
|
138719
|
-
const usedAt = await this.stampIfPresent(
|
|
139045
|
+
const path74 = this.packageDir(packageName, commitSha, subpath);
|
|
139046
|
+
const usedAt = await this.stampIfPresent(path74);
|
|
138720
139047
|
if (usedAt === null) return null;
|
|
138721
139048
|
return {
|
|
138722
139049
|
packageName,
|
|
138723
139050
|
commitSha,
|
|
138724
139051
|
subpathDigest: subpathDigest(subpath),
|
|
138725
|
-
path:
|
|
139052
|
+
path: path74,
|
|
138726
139053
|
lastUsedAt: usedAt
|
|
138727
139054
|
};
|
|
138728
139055
|
}
|
|
@@ -138914,10 +139241,10 @@ var init_marketplace_cache = __esm({
|
|
|
138914
139241
|
* @returns When it was stamped, or `null` when there is no valid entry.
|
|
138915
139242
|
* @internal
|
|
138916
139243
|
*/
|
|
138917
|
-
stampIfPresent(
|
|
139244
|
+
stampIfPresent(path74) {
|
|
138918
139245
|
return this.exclusive(async () => {
|
|
138919
|
-
if (!await isNonEmptyDir(
|
|
138920
|
-
return stampUsed(
|
|
139246
|
+
if (!await isNonEmptyDir(path74)) return null;
|
|
139247
|
+
return stampUsed(path74);
|
|
138921
139248
|
});
|
|
138922
139249
|
}
|
|
138923
139250
|
/**
|
|
@@ -138955,9 +139282,9 @@ var init_marketplace_cache = __esm({
|
|
|
138955
139282
|
if (!parsed) {
|
|
138956
139283
|
continue;
|
|
138957
139284
|
}
|
|
138958
|
-
const
|
|
139285
|
+
const path74 = join51(root, entry);
|
|
138959
139286
|
try {
|
|
138960
|
-
const info2 = await stat2(
|
|
139287
|
+
const info2 = await stat2(path74);
|
|
138961
139288
|
if (!info2.isDirectory()) {
|
|
138962
139289
|
continue;
|
|
138963
139290
|
}
|
|
@@ -138965,7 +139292,7 @@ var init_marketplace_cache = __esm({
|
|
|
138965
139292
|
packageName: parsed.packageName,
|
|
138966
139293
|
commitSha: parsed.commitSha,
|
|
138967
139294
|
subpathDigest: parsed.subpathDigest,
|
|
138968
|
-
path:
|
|
139295
|
+
path: path74,
|
|
138969
139296
|
lastUsedAt: info2.mtime
|
|
138970
139297
|
});
|
|
138971
139298
|
} catch {
|
|
@@ -139333,7 +139660,7 @@ __export(claude_enabled_plugins_exports, {
|
|
|
139333
139660
|
readClaudeOnlyPlugins: () => readClaudeOnlyPlugins
|
|
139334
139661
|
});
|
|
139335
139662
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
139336
|
-
import
|
|
139663
|
+
import path54 from "node:path";
|
|
139337
139664
|
function causeOf(err) {
|
|
139338
139665
|
return err instanceof Error ? err.message : String(err);
|
|
139339
139666
|
}
|
|
@@ -139432,7 +139759,7 @@ function splitPluginKey(key) {
|
|
|
139432
139759
|
}
|
|
139433
139760
|
async function readDorkosSources(dorkHome) {
|
|
139434
139761
|
let sources2;
|
|
139435
|
-
const sourcesPath =
|
|
139762
|
+
const sourcesPath = path54.join(dorkHome, "marketplaces.json");
|
|
139436
139763
|
try {
|
|
139437
139764
|
sources2 = await new MarketplaceSourceManager(dorkHome).list();
|
|
139438
139765
|
} catch {
|
|
@@ -139468,7 +139795,7 @@ function classifyOffer(repo, name2, dorkos) {
|
|
|
139468
139795
|
async function readClaudeOnlyPlugins(input4) {
|
|
139469
139796
|
const { claudeRoot, projectPath, dorkHome } = input4;
|
|
139470
139797
|
const base = { root: claudeRoot, readAt: (/* @__PURE__ */ new Date()).toISOString(), mayBeOverridden: true };
|
|
139471
|
-
const user2 = await readSettingsSlice(
|
|
139798
|
+
const user2 = await readSettingsSlice(path54.join(claudeRoot, "settings.json"));
|
|
139472
139799
|
if (user2.slice === void 0) {
|
|
139473
139800
|
return {
|
|
139474
139801
|
...base,
|
|
@@ -139478,8 +139805,8 @@ async function readClaudeOnlyPlugins(input4) {
|
|
|
139478
139805
|
personalHookCommands: 0
|
|
139479
139806
|
};
|
|
139480
139807
|
}
|
|
139481
|
-
const project2 = await readSettingsSlice(
|
|
139482
|
-
const local = await readSettingsSlice(
|
|
139808
|
+
const project2 = await readSettingsSlice(path54.join(projectPath, ".claude", "settings.json"));
|
|
139809
|
+
const local = await readSettingsSlice(path54.join(projectPath, ".claude", "settings.local.json"));
|
|
139483
139810
|
const merged = mergeSettings([user2.slice, project2.slice ?? {}, local.slice ?? {}]);
|
|
139484
139811
|
const hooks = countHookCommands(user2.slice.hooks);
|
|
139485
139812
|
const partial2 = {
|
|
@@ -139621,9 +139948,9 @@ function parseHarnessSyncArgs(rawArgs) {
|
|
|
139621
139948
|
};
|
|
139622
139949
|
}
|
|
139623
139950
|
function formatAction2(action) {
|
|
139624
|
-
const
|
|
139951
|
+
const path74 = action.target ?? action.source ?? "(no path)";
|
|
139625
139952
|
const note = action.reason ? ` \u2014 ${action.reason}` : "";
|
|
139626
|
-
return ` [${action.kind}] ${action.artifact} "${action.name}" -> ${
|
|
139953
|
+
return ` [${action.kind}] ${action.artifact} "${action.name}" -> ${path74} (${action.harness})${note}`;
|
|
139627
139954
|
}
|
|
139628
139955
|
function formatAdoptable(repoRoot, manifest) {
|
|
139629
139956
|
const { candidates } = readAdoptCandidates(repoRoot, inventorySourceTree(repoRoot), manifest);
|
|
@@ -139649,26 +139976,26 @@ function formatAutoAdoptInert(inert) {
|
|
|
139649
139976
|
return inert ? ["", ADOPT_SENTENCES.S8()] : [];
|
|
139650
139977
|
}
|
|
139651
139978
|
function formatLeftAlone(leftAlone, manifest, harnessFilter) {
|
|
139652
|
-
const shown2 = harnessFilter ? leftAlone.filter((
|
|
139979
|
+
const shown2 = harnessFilter ? leftAlone.filter((path74) => harnessOf(path74) === harnessFilter) : leftAlone;
|
|
139653
139980
|
if (shown2.length === 0) return [];
|
|
139654
139981
|
const stopped = new Set(pluginHookReach(manifest).suppressed.map((s2) => s2.harness));
|
|
139655
|
-
const carried = shown2.filter((
|
|
139656
|
-
const harness = harnessOf(
|
|
139982
|
+
const carried = shown2.filter((path74) => {
|
|
139983
|
+
const harness = harnessOf(path74);
|
|
139657
139984
|
return harness === void 0 || !stopped.has(harness);
|
|
139658
139985
|
});
|
|
139659
139986
|
return [
|
|
139660
139987
|
"",
|
|
139661
139988
|
"Left alone \u2014 files DorkOS did not write, at paths it would otherwise generate:",
|
|
139662
|
-
...shown2.map((
|
|
139663
|
-
const harness = harnessOf(
|
|
139989
|
+
...shown2.map((path74) => {
|
|
139990
|
+
const harness = harnessOf(path74);
|
|
139664
139991
|
const note = harness && stopped.has(harness) ? " \u2014 your manifest's hookPolicies says not to write here" : "";
|
|
139665
|
-
return ` ${
|
|
139992
|
+
return ` ${path74} (${harness})${note}`;
|
|
139666
139993
|
}),
|
|
139667
139994
|
carried.length > 0 ? " Nothing to fix. Put these hooks in .claude/settings.json if you want DorkOS to carry them to every harness." : " Nothing to fix, and nothing to move: your manifest tells DorkOS not to write these files."
|
|
139668
139995
|
];
|
|
139669
139996
|
}
|
|
139670
|
-
function harnessOf(
|
|
139671
|
-
return GENERATED_HOOK_TARGET_HARNESSES[
|
|
139997
|
+
function harnessOf(path74) {
|
|
139998
|
+
return GENERATED_HOOK_TARGET_HARNESSES[path74];
|
|
139672
139999
|
}
|
|
139673
140000
|
function summarizeActions(actions, withheld, enabled3) {
|
|
139674
140001
|
const withheldLine = withheldSummaryLine(withheld);
|
|
@@ -139766,8 +140093,8 @@ function formatIgnoredCanonicalLayer(repoRoot) {
|
|
|
139766
140093
|
" on purpose."
|
|
139767
140094
|
];
|
|
139768
140095
|
}
|
|
139769
|
-
function orphanLine({ path:
|
|
139770
|
-
return ` ${
|
|
140096
|
+
function orphanLine({ path: path74, reason }) {
|
|
140097
|
+
return ` ${path74} \u2014 ${reason}`;
|
|
139771
140098
|
}
|
|
139772
140099
|
function reportCheck(repoRoot, plan, withheld, dorkHome, manifest, claudeOnly, autoAdoptInert, harnessFilter) {
|
|
139773
140100
|
const drift = checkPlan(repoRoot, plan);
|
|
@@ -140487,8 +140814,8 @@ Examples:
|
|
|
140487
140814
|
});
|
|
140488
140815
|
|
|
140489
140816
|
// src/lib/api-client.ts
|
|
140490
|
-
import
|
|
140491
|
-
import
|
|
140817
|
+
import fs25 from "node:fs";
|
|
140818
|
+
import path55 from "node:path";
|
|
140492
140819
|
function getServerBaseUrl() {
|
|
140493
140820
|
const envPort = process.env.DORKOS_PORT;
|
|
140494
140821
|
if (envPort && /^\d+$/.test(envPort)) {
|
|
@@ -140500,7 +140827,7 @@ function getServerBaseUrl() {
|
|
|
140500
140827
|
function readConfigPort() {
|
|
140501
140828
|
const dorkHome = resolveDorkHome2();
|
|
140502
140829
|
try {
|
|
140503
|
-
const raw =
|
|
140830
|
+
const raw = fs25.readFileSync(path55.join(dorkHome, "config.json"), "utf-8");
|
|
140504
140831
|
const config3 = JSON.parse(raw);
|
|
140505
140832
|
const port2 = config3?.server?.port;
|
|
140506
140833
|
if (typeof port2 === "number" && port2 > 0) return port2;
|
|
@@ -140513,13 +140840,13 @@ function agentIdentityHeaders() {
|
|
|
140513
140840
|
return token ? { "X-DorkOS-Agent": token } : {};
|
|
140514
140841
|
}
|
|
140515
140842
|
function apiKeyFilePath() {
|
|
140516
|
-
return
|
|
140843
|
+
return path55.join(resolveDorkHome2(), API_KEY_FILE_NAME);
|
|
140517
140844
|
}
|
|
140518
140845
|
function resolveApiKey() {
|
|
140519
140846
|
const fromEnv = process.env[API_KEY_ENV_VAR]?.trim();
|
|
140520
140847
|
if (fromEnv) return fromEnv;
|
|
140521
140848
|
try {
|
|
140522
|
-
const fromFile =
|
|
140849
|
+
const fromFile = fs25.readFileSync(apiKeyFilePath(), "utf-8").trim();
|
|
140523
140850
|
if (fromFile) return fromFile;
|
|
140524
140851
|
} catch {
|
|
140525
140852
|
}
|
|
@@ -141507,8 +141834,8 @@ var init_contracts = __esm({
|
|
|
141507
141834
|
// ../browser/src/runtime/installation/filesystem.ts
|
|
141508
141835
|
import { createHash as createHash10, randomUUID as randomUUID5 } from "node:crypto";
|
|
141509
141836
|
import { constants as constants5 } from "node:fs";
|
|
141510
|
-
import * as
|
|
141511
|
-
import
|
|
141837
|
+
import * as fs26 from "node:fs/promises";
|
|
141838
|
+
import path56 from "node:path";
|
|
141512
141839
|
function requireFact(value, code) {
|
|
141513
141840
|
if (!value) throw new InstallationFailure(code);
|
|
141514
141841
|
}
|
|
@@ -141629,16 +141956,16 @@ var init_filesystem = __esm({
|
|
|
141629
141956
|
}
|
|
141630
141957
|
async ancestors(name2, missing = false) {
|
|
141631
141958
|
requireFact(
|
|
141632
|
-
|
|
141959
|
+
path56.isAbsolute(name2) && path56.normalize(name2) === name2,
|
|
141633
141960
|
"INVALID_INSTALL_CONFIGURATION"
|
|
141634
141961
|
);
|
|
141635
141962
|
const result2 = [];
|
|
141636
|
-
let current3 =
|
|
141637
|
-
const parts =
|
|
141963
|
+
let current3 = path56.parse(name2).root;
|
|
141964
|
+
const parts = path56.relative(current3, name2).split(path56.sep).filter(Boolean);
|
|
141638
141965
|
for (const part of ["", ...parts]) {
|
|
141639
|
-
if (part) current3 =
|
|
141966
|
+
if (part) current3 = path56.join(current3, part);
|
|
141640
141967
|
try {
|
|
141641
|
-
const stat5 = await
|
|
141968
|
+
const stat5 = await fs26.lstat(current3, { bigint: true });
|
|
141642
141969
|
this.directorySecure(stat5);
|
|
141643
141970
|
result2.push({ path: current3, identity: identity(stat5) });
|
|
141644
141971
|
} catch (error63) {
|
|
@@ -141650,7 +141977,7 @@ var init_filesystem = __esm({
|
|
|
141650
141977
|
}
|
|
141651
141978
|
async recheckParents(parents) {
|
|
141652
141979
|
for (const parent of parents) {
|
|
141653
|
-
const stat5 = await
|
|
141980
|
+
const stat5 = await fs26.lstat(parent.path, { bigint: true });
|
|
141654
141981
|
this.directorySecure(stat5);
|
|
141655
141982
|
requireFact(directoryIdentity(parent.identity, identity(stat5)), "ROOT_CHANGED");
|
|
141656
141983
|
}
|
|
@@ -141659,7 +141986,7 @@ var init_filesystem = __esm({
|
|
|
141659
141986
|
const duty = { path: name2, original: null, state: "acquiring", lease };
|
|
141660
141987
|
this.duties.add(duty);
|
|
141661
141988
|
try {
|
|
141662
|
-
duty.original = await
|
|
141989
|
+
duty.original = await fs26.open(name2, flags, mode);
|
|
141663
141990
|
duty.state = "open";
|
|
141664
141991
|
return duty;
|
|
141665
141992
|
} catch (error63) {
|
|
@@ -141727,7 +142054,7 @@ var init_filesystem = __esm({
|
|
|
141727
142054
|
}
|
|
141728
142055
|
}
|
|
141729
142056
|
async checkDirectory(directory) {
|
|
141730
|
-
const named3 = identity(await
|
|
142057
|
+
const named3 = identity(await fs26.lstat(directory.path, { bigint: true }));
|
|
141731
142058
|
const held2 = identity(await directory.handle.stat({ bigint: true }));
|
|
141732
142059
|
requireFact(
|
|
141733
142060
|
directoryIdentity(directory.identity, named3) && directoryIdentity(named3, held2),
|
|
@@ -141743,41 +142070,41 @@ var init_filesystem = __esm({
|
|
|
141743
142070
|
});
|
|
141744
142071
|
}
|
|
141745
142072
|
async ensureDirectories(name2) {
|
|
141746
|
-
let current3 =
|
|
141747
|
-
for (const part of
|
|
142073
|
+
let current3 = path56.parse(name2).root;
|
|
142074
|
+
for (const part of path56.relative(current3, name2).split(path56.sep).filter(Boolean)) {
|
|
141748
142075
|
const parent = current3;
|
|
141749
|
-
current3 =
|
|
142076
|
+
current3 = path56.join(current3, part);
|
|
141750
142077
|
try {
|
|
141751
|
-
this.directorySecure(await
|
|
142078
|
+
this.directorySecure(await fs26.lstat(current3, { bigint: true }));
|
|
141752
142079
|
} catch (error63) {
|
|
141753
142080
|
if (!isMissing(error63)) throw error63;
|
|
141754
142081
|
await this.ancestors(parent);
|
|
141755
142082
|
try {
|
|
141756
|
-
await
|
|
142083
|
+
await fs26.mkdir(current3, { mode: 448 });
|
|
141757
142084
|
} catch (mkdirError) {
|
|
141758
142085
|
if (!isExists(mkdirError)) throw mkdirError;
|
|
141759
142086
|
}
|
|
141760
|
-
this.directorySecure(await
|
|
142087
|
+
this.directorySecure(await fs26.lstat(current3, { bigint: true }));
|
|
141761
142088
|
await this.syncDirectory(current3);
|
|
141762
142089
|
await this.syncDirectory(parent);
|
|
141763
142090
|
}
|
|
141764
142091
|
}
|
|
141765
142092
|
}
|
|
141766
142093
|
async exclusiveDirectory(name2) {
|
|
141767
|
-
await this.ancestors(
|
|
141768
|
-
await
|
|
141769
|
-
const stat5 = await
|
|
142094
|
+
await this.ancestors(path56.dirname(name2));
|
|
142095
|
+
await fs26.mkdir(name2, { mode: 448 });
|
|
142096
|
+
const stat5 = await fs26.lstat(name2, { bigint: true });
|
|
141770
142097
|
this.directorySecure(stat5);
|
|
141771
142098
|
requireFact(
|
|
141772
142099
|
Number(stat5.uid) === process.getuid?.() && (Number(stat5.mode) & 63) === 0,
|
|
141773
142100
|
"OWNERSHIP_UNCERTAIN"
|
|
141774
142101
|
);
|
|
141775
142102
|
await this.syncDirectory(name2);
|
|
141776
|
-
await this.syncDirectory(
|
|
142103
|
+
await this.syncDirectory(path56.dirname(name2));
|
|
141777
142104
|
}
|
|
141778
142105
|
async read(name2, cap, retain = 0) {
|
|
141779
|
-
const parents = await this.ancestors(
|
|
141780
|
-
const named3 = identity(await
|
|
142106
|
+
const parents = await this.ancestors(path56.dirname(name2));
|
|
142107
|
+
const named3 = identity(await fs26.lstat(name2, { bigint: true }));
|
|
141781
142108
|
requireFact(named3.type === "file" && BigInt(named3.size) <= BigInt(cap), "INSTALLATION_INVALID");
|
|
141782
142109
|
const duty = await this.acquire(
|
|
141783
142110
|
name2,
|
|
@@ -141807,7 +142134,7 @@ var init_filesystem = __esm({
|
|
|
141807
142134
|
}
|
|
141808
142135
|
}
|
|
141809
142136
|
requireFact(
|
|
141810
|
-
bytes === Number(acquired.size) && sameFileIdentity(acquired, identity(await handle.stat({ bigint: true }))) && sameFileIdentity(acquired, identity(await
|
|
142137
|
+
bytes === Number(acquired.size) && sameFileIdentity(acquired, identity(await handle.stat({ bigint: true }))) && sameFileIdentity(acquired, identity(await fs26.lstat(name2, { bigint: true }))),
|
|
141811
142138
|
"ROOT_CHANGED"
|
|
141812
142139
|
);
|
|
141813
142140
|
await this.recheckParents(parents);
|
|
@@ -141823,7 +142150,7 @@ var init_filesystem = __esm({
|
|
|
141823
142150
|
this.duties.add(duty);
|
|
141824
142151
|
return this.closeAfter([duty, directory.duty], async () => {
|
|
141825
142152
|
try {
|
|
141826
|
-
duty.original = await
|
|
142153
|
+
duty.original = await fs26.opendir(name2, { bufferSize: 1 });
|
|
141827
142154
|
duty.state = "open";
|
|
141828
142155
|
} catch (error63) {
|
|
141829
142156
|
duty.state = "uncertain";
|
|
@@ -141845,27 +142172,27 @@ var init_filesystem = __esm({
|
|
|
141845
142172
|
});
|
|
141846
142173
|
}
|
|
141847
142174
|
async libraryBinMetadata(root, directory) {
|
|
141848
|
-
const parents = await this.ancestors(directory), bins =
|
|
141849
|
-
const before = identity(await
|
|
142175
|
+
const parents = await this.ancestors(directory), bins = path56.join(directory, ".bin");
|
|
142176
|
+
const before = identity(await fs26.lstat(directory, { bigint: true }));
|
|
141850
142177
|
requireFact(
|
|
141851
142178
|
(await this.names(directory, INSTALLATION_LIMITS.libraryEntries)).join(",") === ".bin",
|
|
141852
142179
|
"LIBRARY_MISMATCH"
|
|
141853
142180
|
);
|
|
141854
|
-
const binParents = await this.ancestors(bins), binBefore = identity(await
|
|
142181
|
+
const binParents = await this.ancestors(bins), binBefore = identity(await fs26.lstat(bins, { bigint: true }));
|
|
141855
142182
|
requireFact(
|
|
141856
142183
|
(await this.names(bins, INSTALLATION_LIMITS.libraryEntries)).join(",") === "playwright-core",
|
|
141857
142184
|
"LIBRARY_MISMATCH"
|
|
141858
142185
|
);
|
|
141859
|
-
const shim =
|
|
142186
|
+
const shim = path56.join(bins, "playwright-core"), stat5 = await fs26.lstat(shim, { bigint: true });
|
|
141860
142187
|
if (stat5.isSymbolicLink()) {
|
|
141861
|
-
const link3 = await
|
|
142188
|
+
const link3 = await fs26.readlink(shim);
|
|
141862
142189
|
requireFact(
|
|
141863
|
-
Buffer.byteLength(link3) <= INSTALLATION_LIMITS.bufferBytes && await
|
|
142190
|
+
Buffer.byteLength(link3) <= INSTALLATION_LIMITS.bufferBytes && await fs26.realpath(shim) === path56.join(root, "cli.js"),
|
|
141864
142191
|
"LIBRARY_MISMATCH"
|
|
141865
142192
|
);
|
|
141866
|
-
const after = await
|
|
142193
|
+
const after = await fs26.lstat(shim, { bigint: true });
|
|
141867
142194
|
requireFact(
|
|
141868
|
-
after.isSymbolicLink() && stat5.dev === after.dev && stat5.ino === after.ino && stat5.size === after.size && stat5.mode === after.mode && stat5.uid === after.uid && stat5.mtimeNs === after.mtimeNs && stat5.ctimeNs === after.ctimeNs && link3 === await
|
|
142195
|
+
after.isSymbolicLink() && stat5.dev === after.dev && stat5.ino === after.ino && stat5.size === after.size && stat5.mode === after.mode && stat5.uid === after.uid && stat5.mtimeNs === after.mtimeNs && stat5.ctimeNs === after.ctimeNs && link3 === await fs26.readlink(shim),
|
|
141869
142196
|
"ROOT_CHANGED"
|
|
141870
142197
|
);
|
|
141871
142198
|
} else {
|
|
@@ -141874,7 +142201,7 @@ var init_filesystem = __esm({
|
|
|
141874
142201
|
requireFact(sameFileIdentity(identity(stat5), read.file.identity), "ROOT_CHANGED");
|
|
141875
142202
|
}
|
|
141876
142203
|
requireFact(
|
|
141877
|
-
sameFileIdentity(before, identity(await
|
|
142204
|
+
sameFileIdentity(before, identity(await fs26.lstat(directory, { bigint: true }))) && sameFileIdentity(binBefore, identity(await fs26.lstat(bins, { bigint: true }))),
|
|
141878
142205
|
"ROOT_CHANGED"
|
|
141879
142206
|
);
|
|
141880
142207
|
await this.recheckParents(binParents);
|
|
@@ -141887,19 +142214,19 @@ var init_filesystem = __esm({
|
|
|
141887
142214
|
const totalLimit = library ? INSTALLATION_LIMITS.libraryBytes : INSTALLATION_LIMITS.payloadBytes;
|
|
141888
142215
|
const visit2 = async (directory, depth) => {
|
|
141889
142216
|
requireFact(depth <= INSTALLATION_LIMITS.payloadDepth, "RETENTION_EXCEEDED");
|
|
141890
|
-
const dirIdentity = identity(await
|
|
142217
|
+
const dirIdentity = identity(await fs26.lstat(directory, { bigint: true }));
|
|
141891
142218
|
requireFact(dirIdentity.type === "directory", "ROOT_CHANGED");
|
|
141892
142219
|
result2.directories.push({ path: directory, identity: dirIdentity });
|
|
141893
142220
|
result2.rows.push({
|
|
141894
|
-
path:
|
|
142221
|
+
path: path56.relative(root, directory).split(path56.sep).join("/"),
|
|
141895
142222
|
type: "directory",
|
|
141896
142223
|
identity: dirIdentity
|
|
141897
142224
|
});
|
|
141898
142225
|
for (const name2 of await this.names(directory, entryLimit)) {
|
|
141899
142226
|
requireFact(++result2.entries <= entryLimit, "RETENTION_EXCEEDED");
|
|
141900
|
-
const absolute =
|
|
142227
|
+
const absolute = path56.join(directory, name2), relative12 = path56.relative(root, absolute).split(path56.sep).join("/");
|
|
141901
142228
|
requireFact(relativePath.safeParse(relative12).success, "INSTALLATION_INVALID");
|
|
141902
|
-
const stat5 = await
|
|
142229
|
+
const stat5 = await fs26.lstat(absolute, { bigint: true });
|
|
141903
142230
|
if (library && relative12 === "node_modules") {
|
|
141904
142231
|
requireFact(stat5.isDirectory() && !stat5.isSymbolicLink(), "LIBRARY_MISMATCH");
|
|
141905
142232
|
await this.libraryBinMetadata(root, absolute);
|
|
@@ -141907,13 +142234,13 @@ var init_filesystem = __esm({
|
|
|
141907
142234
|
}
|
|
141908
142235
|
if (stat5.isSymbolicLink()) {
|
|
141909
142236
|
requireFact(!library, "LIBRARY_MISMATCH");
|
|
141910
|
-
const link3 = await
|
|
141911
|
-
requireFact(resolved.startsWith(root +
|
|
141912
|
-
const target = await
|
|
142237
|
+
const link3 = await fs26.readlink(absolute), resolved = await fs26.realpath(absolute);
|
|
142238
|
+
requireFact(resolved.startsWith(root + path56.sep), "ROOT_CHANGED");
|
|
142239
|
+
const target = await fs26.stat(resolved, { bigint: true });
|
|
141913
142240
|
requireFact(target.isFile() || target.isDirectory(), "ROOT_CHANGED");
|
|
141914
|
-
const after = await
|
|
142241
|
+
const after = await fs26.lstat(absolute, { bigint: true });
|
|
141915
142242
|
requireFact(
|
|
141916
|
-
stat5.dev === after.dev && stat5.ino === after.ino && stat5.mtimeNs === after.mtimeNs && stat5.ctimeNs === after.ctimeNs && link3 === await
|
|
142243
|
+
stat5.dev === after.dev && stat5.ino === after.ino && stat5.mtimeNs === after.mtimeNs && stat5.ctimeNs === after.ctimeNs && link3 === await fs26.readlink(absolute),
|
|
141917
142244
|
"ROOT_CHANGED"
|
|
141918
142245
|
);
|
|
141919
142246
|
result2.rows.push({
|
|
@@ -141946,7 +142273,7 @@ var init_filesystem = __esm({
|
|
|
141946
142273
|
}
|
|
141947
142274
|
}
|
|
141948
142275
|
requireFact(
|
|
141949
|
-
sameFileIdentity(dirIdentity, identity(await
|
|
142276
|
+
sameFileIdentity(dirIdentity, identity(await fs26.lstat(directory, { bigint: true }))),
|
|
141950
142277
|
"ROOT_CHANGED"
|
|
141951
142278
|
);
|
|
141952
142279
|
};
|
|
@@ -141983,13 +142310,13 @@ var init_filesystem = __esm({
|
|
|
141983
142310
|
(a2, b2) => a2.path < b2.path ? -1 : a2.path > b2.path ? 1 : 0
|
|
141984
142311
|
))
|
|
141985
142312
|
distribution.update(
|
|
141986
|
-
|
|
142313
|
+
path56.relative(this.configuration.libraryRoot, file2.path).split(path56.sep).join("/") + "\0" + file2.sha256 + "\n"
|
|
141987
142314
|
);
|
|
141988
142315
|
const distributionSHA256 = distribution.digest("hex");
|
|
141989
142316
|
requireFact(distributionSHA256 === INSTALLATION_TARGET.libraryDistributionSHA256, "LIBRARY_MISMATCH");
|
|
141990
142317
|
const find = (name2) => {
|
|
141991
142318
|
const file2 = tree.files.find(
|
|
141992
|
-
(f3) => f3.path ===
|
|
142319
|
+
(f3) => f3.path === path56.join(this.configuration.libraryRoot, name2)
|
|
141993
142320
|
);
|
|
141994
142321
|
requireFact(file2, "LIBRARY_MISMATCH");
|
|
141995
142322
|
return file2;
|
|
@@ -142070,7 +142397,7 @@ var init_filesystem = __esm({
|
|
|
142070
142397
|
requireFact(!this.active || this.active.state === "released", "PUBLICATION_BUSY");
|
|
142071
142398
|
await this.ensureDirectories(this.configuration.cacheRoot);
|
|
142072
142399
|
const root = await this.directory(this.configuration.cacheRoot);
|
|
142073
|
-
const name2 =
|
|
142400
|
+
const name2 = path56.join(root.path, "reservation");
|
|
142074
142401
|
try {
|
|
142075
142402
|
await this.exclusiveDirectory(name2);
|
|
142076
142403
|
} catch (error63) {
|
|
@@ -142122,7 +142449,7 @@ var init_filesystem = __esm({
|
|
|
142122
142449
|
directory.duty.lease = true;
|
|
142123
142450
|
try {
|
|
142124
142451
|
reservation.ownerFile = await this.atomicRecord(
|
|
142125
|
-
|
|
142452
|
+
path56.join(name2, "owner.json"),
|
|
142126
142453
|
owner,
|
|
142127
142454
|
INSTALLATION_LIMITS.journalBytes,
|
|
142128
142455
|
false
|
|
@@ -142142,43 +142469,43 @@ var init_filesystem = __esm({
|
|
|
142142
142469
|
await this.checkReservation(reservation);
|
|
142143
142470
|
this.checkEnd(reservation);
|
|
142144
142471
|
requireFact(reservation.attempt === null, "BINDING_MISMATCH");
|
|
142145
|
-
const parent =
|
|
142472
|
+
const parent = path56.join(this.configuration.cacheRoot, "attempts");
|
|
142146
142473
|
await this.ensureDirectories(parent);
|
|
142147
|
-
const root =
|
|
142474
|
+
const root = path56.join(parent, handle.binding.attemptId);
|
|
142148
142475
|
await this.exclusiveDirectory(root);
|
|
142149
142476
|
for (const child of ["home", "tmp", "diagnostics"])
|
|
142150
|
-
await this.exclusiveDirectory(
|
|
142477
|
+
await this.exclusiveDirectory(path56.join(root, child));
|
|
142151
142478
|
await this.syncDirectory(root);
|
|
142152
142479
|
await this.syncDirectory(parent);
|
|
142153
|
-
const stat5 = identity(await
|
|
142480
|
+
const stat5 = identity(await fs26.lstat(root, { bigint: true }));
|
|
142154
142481
|
const attempt = Object.freeze({
|
|
142155
142482
|
kind: "installation-attempt",
|
|
142156
142483
|
binding: handle.binding,
|
|
142157
142484
|
attemptRoot: root,
|
|
142158
|
-
homeRoot:
|
|
142159
|
-
temporaryRoot:
|
|
142485
|
+
homeRoot: path56.join(root, "home"),
|
|
142486
|
+
temporaryRoot: path56.join(root, "tmp"),
|
|
142160
142487
|
identity: stat5
|
|
142161
142488
|
});
|
|
142162
142489
|
this.attempts.set(attempt, {
|
|
142163
142490
|
reservation,
|
|
142164
142491
|
handle: attempt,
|
|
142165
|
-
diagnostics:
|
|
142492
|
+
diagnostics: path56.join(root, "diagnostics")
|
|
142166
142493
|
});
|
|
142167
142494
|
reservation.attempt = attempt;
|
|
142168
142495
|
return attempt;
|
|
142169
142496
|
});
|
|
142170
142497
|
}
|
|
142171
142498
|
async atomicRecord(name2, record2, cap, replace) {
|
|
142172
|
-
const bytes = recordBytes(record2, cap), parent =
|
|
142499
|
+
const bytes = recordBytes(record2, cap), parent = path56.dirname(name2), parents = await this.ancestors(parent);
|
|
142173
142500
|
if (!replace) {
|
|
142174
142501
|
try {
|
|
142175
|
-
await
|
|
142502
|
+
await fs26.lstat(name2);
|
|
142176
142503
|
throw new InstallationFailure("RECORD_FAILED");
|
|
142177
142504
|
} catch (error63) {
|
|
142178
142505
|
if (!isMissing(error63)) throw error63;
|
|
142179
142506
|
}
|
|
142180
142507
|
}
|
|
142181
|
-
const temporary =
|
|
142508
|
+
const temporary = path56.join(parent, ".installation-" + randomUUID5() + ".tmp");
|
|
142182
142509
|
const duty = await this.acquire(
|
|
142183
142510
|
temporary,
|
|
142184
142511
|
constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | constants5.O_NOFOLLOW
|
|
@@ -142197,7 +142524,7 @@ var init_filesystem = __esm({
|
|
|
142197
142524
|
requireFact(
|
|
142198
142525
|
sameFileIdentity(
|
|
142199
142526
|
identity(await handle.stat({ bigint: true })),
|
|
142200
|
-
identity(await
|
|
142527
|
+
identity(await fs26.lstat(temporary, { bigint: true }))
|
|
142201
142528
|
),
|
|
142202
142529
|
"ROOT_CHANGED"
|
|
142203
142530
|
);
|
|
@@ -142205,14 +142532,14 @@ var init_filesystem = __esm({
|
|
|
142205
142532
|
});
|
|
142206
142533
|
if (!replace) {
|
|
142207
142534
|
try {
|
|
142208
|
-
await
|
|
142535
|
+
await fs26.lstat(name2);
|
|
142209
142536
|
throw new InstallationFailure("RECORD_FAILED");
|
|
142210
142537
|
} catch (error63) {
|
|
142211
142538
|
if (!isMissing(error63)) throw error63;
|
|
142212
142539
|
}
|
|
142213
142540
|
}
|
|
142214
142541
|
await this.recheckParents(parents);
|
|
142215
|
-
await
|
|
142542
|
+
await fs26.rename(temporary, name2);
|
|
142216
142543
|
await this.syncDirectory(parent);
|
|
142217
142544
|
const result2 = await this.read(name2, cap, cap);
|
|
142218
142545
|
requireFact(result2.file.sha256 === sha2564(bytes), "RECORD_FAILED");
|
|
@@ -142238,7 +142565,7 @@ var init_filesystem = __esm({
|
|
|
142238
142565
|
await this.checkReservation(reservation);
|
|
142239
142566
|
this.checkEnd(reservation);
|
|
142240
142567
|
const old = await this.read(
|
|
142241
|
-
|
|
142568
|
+
path56.join(reservation.directory.path, "owner.json"),
|
|
142242
142569
|
INSTALLATION_LIMITS.journalBytes,
|
|
142243
142570
|
INSTALLATION_LIMITS.journalBytes
|
|
142244
142571
|
);
|
|
@@ -142261,11 +142588,11 @@ var init_filesystem = __esm({
|
|
|
142261
142588
|
requireFact(reservation.candidate === null, "BINDING_MISMATCH");
|
|
142262
142589
|
await this.checkReservation(reservation);
|
|
142263
142590
|
this.checkEnd(reservation);
|
|
142264
|
-
const parent =
|
|
142591
|
+
const parent = path56.join(this.configuration.cacheRoot, "candidates");
|
|
142265
142592
|
await this.ensureDirectories(parent);
|
|
142266
|
-
const candidateRoot =
|
|
142593
|
+
const candidateRoot = path56.join(parent, handle.binding.installationId);
|
|
142267
142594
|
await this.exclusiveDirectory(candidateRoot);
|
|
142268
|
-
const payloadRoot =
|
|
142595
|
+
const payloadRoot = path56.join(candidateRoot, "payload");
|
|
142269
142596
|
await this.exclusiveDirectory(payloadRoot);
|
|
142270
142597
|
const candidate = Object.freeze({
|
|
142271
142598
|
kind: "installation-candidate",
|
|
@@ -142303,8 +142630,8 @@ var init_filesystem = __esm({
|
|
|
142303
142630
|
});
|
|
142304
142631
|
}
|
|
142305
142632
|
async snapshot(installationId, candidateRoot) {
|
|
142306
|
-
const payloadRoot =
|
|
142307
|
-
const executablePath =
|
|
142633
|
+
const payloadRoot = path56.join(candidateRoot, "payload"), tree = await this.tree(payloadRoot);
|
|
142634
|
+
const executablePath = path56.join(candidateRoot, INSTALLATION_TARGET.executablePath);
|
|
142308
142635
|
const executable = await this.read(executablePath, INSTALLATION_LIMITS.executableBytes);
|
|
142309
142636
|
const observed = tree.files.find((file2) => file2.path === executablePath);
|
|
142310
142637
|
requireFact(
|
|
@@ -142341,7 +142668,7 @@ var init_filesystem = __esm({
|
|
|
142341
142668
|
async current() {
|
|
142342
142669
|
try {
|
|
142343
142670
|
const value = await this.read(
|
|
142344
|
-
|
|
142671
|
+
path56.join(this.configuration.cacheRoot, "current.json"),
|
|
142345
142672
|
INSTALLATION_LIMITS.pointerBytes,
|
|
142346
142673
|
INSTALLATION_LIMITS.pointerBytes
|
|
142347
142674
|
);
|
|
@@ -142387,13 +142714,13 @@ var init_filesystem = __esm({
|
|
|
142387
142714
|
installation: null
|
|
142388
142715
|
};
|
|
142389
142716
|
requireFact(current3.state === "present", "INSTALLATION_INVALID");
|
|
142390
|
-
const root =
|
|
142717
|
+
const root = path56.join(
|
|
142391
142718
|
this.configuration.cacheRoot,
|
|
142392
142719
|
"candidates",
|
|
142393
142720
|
current3.pointer.installationId
|
|
142394
142721
|
);
|
|
142395
142722
|
const manifestRead = await this.read(
|
|
142396
|
-
|
|
142723
|
+
path56.join(root, "manifest.json"),
|
|
142397
142724
|
INSTALLATION_LIMITS.manifestBytes,
|
|
142398
142725
|
INSTALLATION_LIMITS.manifestBytes
|
|
142399
142726
|
);
|
|
@@ -142403,7 +142730,7 @@ var init_filesystem = __esm({
|
|
|
142403
142730
|
);
|
|
142404
142731
|
const manifest = parseRecord(manifestRead.bytes, ManifestSchema, INSTALLATION_LIMITS.manifestBytes);
|
|
142405
142732
|
const verificationRead = await this.read(
|
|
142406
|
-
|
|
142733
|
+
path56.join(root, "verification.json"),
|
|
142407
142734
|
INSTALLATION_LIMITS.journalBytes,
|
|
142408
142735
|
INSTALLATION_LIMITS.journalBytes
|
|
142409
142736
|
);
|
|
@@ -142481,7 +142808,7 @@ var init_filesystem = __esm({
|
|
|
142481
142808
|
requireFact(
|
|
142482
142809
|
sameFileIdentity(file2.identity, identity(await original.stat({ bigint: true }))) && sameFileIdentity(
|
|
142483
142810
|
file2.identity,
|
|
142484
|
-
identity(await
|
|
142811
|
+
identity(await fs26.lstat(file2.path, { bigint: true }))
|
|
142485
142812
|
),
|
|
142486
142813
|
"ROOT_CHANGED"
|
|
142487
142814
|
);
|
|
@@ -142491,7 +142818,7 @@ var init_filesystem = __esm({
|
|
|
142491
142818
|
for (const directory of [...tree.directories].reverse())
|
|
142492
142819
|
await this.syncDirectory(directory.path);
|
|
142493
142820
|
await this.syncDirectory(handle.candidateRoot);
|
|
142494
|
-
await this.syncDirectory(
|
|
142821
|
+
await this.syncDirectory(path56.dirname(handle.candidateRoot));
|
|
142495
142822
|
await this.syncDirectory(this.configuration.cacheRoot);
|
|
142496
142823
|
await this.revalidateCandidate(handle, expected);
|
|
142497
142824
|
candidate.durable = await this.observeCandidate(handle);
|
|
@@ -142561,18 +142888,18 @@ var init_filesystem = __esm({
|
|
|
142561
142888
|
await this.revalidateCandidate(candidateHandle, candidate.durable);
|
|
142562
142889
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
142563
142890
|
await this.atomicRecord(
|
|
142564
|
-
|
|
142891
|
+
path56.join(candidateHandle.candidateRoot, "verification.json"),
|
|
142565
142892
|
parsedVerification,
|
|
142566
142893
|
INSTALLATION_LIMITS.journalBytes,
|
|
142567
142894
|
false
|
|
142568
142895
|
);
|
|
142569
142896
|
await this.atomicRecord(
|
|
142570
|
-
|
|
142897
|
+
path56.join(candidateHandle.candidateRoot, "manifest.json"),
|
|
142571
142898
|
parsedManifest,
|
|
142572
142899
|
INSTALLATION_LIMITS.manifestBytes,
|
|
142573
142900
|
false
|
|
142574
142901
|
);
|
|
142575
|
-
await this.syncDirectory(
|
|
142902
|
+
await this.syncDirectory(path56.dirname(candidateHandle.candidateRoot));
|
|
142576
142903
|
await this.revalidateCandidate(candidateHandle, candidate.durable);
|
|
142577
142904
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
142578
142905
|
this.checkEnd(reservation);
|
|
@@ -142580,7 +142907,7 @@ var init_filesystem = __esm({
|
|
|
142580
142907
|
{ schemaVersion: 1, installationId: parsedManifest.installationId, manifestDigest },
|
|
142581
142908
|
INSTALLATION_LIMITS.pointerBytes
|
|
142582
142909
|
);
|
|
142583
|
-
const temporary =
|
|
142910
|
+
const temporary = path56.join(
|
|
142584
142911
|
this.configuration.cacheRoot,
|
|
142585
142912
|
".current-" + randomUUID5() + ".json"
|
|
142586
142913
|
);
|
|
@@ -142595,7 +142922,7 @@ var init_filesystem = __esm({
|
|
|
142595
142922
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
142596
142923
|
this.checkEnd(reservation);
|
|
142597
142924
|
replacementAttempted = true;
|
|
142598
|
-
await
|
|
142925
|
+
await fs26.rename(temporary, path56.join(this.configuration.cacheRoot, "current.json"));
|
|
142599
142926
|
pointerReplaced = true;
|
|
142600
142927
|
await this.syncDirectory(this.configuration.cacheRoot);
|
|
142601
142928
|
after = await this.current();
|
|
@@ -142662,7 +142989,7 @@ var init_filesystem = __esm({
|
|
|
142662
142989
|
throw error63;
|
|
142663
142990
|
}
|
|
142664
142991
|
const oldVerification = await this.read(
|
|
142665
|
-
|
|
142992
|
+
path56.join(
|
|
142666
142993
|
this.configuration.cacheRoot,
|
|
142667
142994
|
"candidates",
|
|
142668
142995
|
handle.binding.installationId,
|
|
@@ -142675,18 +143002,18 @@ var init_filesystem = __esm({
|
|
|
142675
143002
|
"BINDING_MISMATCH"
|
|
142676
143003
|
);
|
|
142677
143004
|
const file2 = await this.atomicRecord(
|
|
142678
|
-
|
|
143005
|
+
path56.join(attempt.handle.attemptRoot, "reuse.json"),
|
|
142679
143006
|
parsed,
|
|
142680
143007
|
INSTALLATION_LIMITS.journalBytes,
|
|
142681
143008
|
false
|
|
142682
143009
|
);
|
|
142683
|
-
await this.syncDirectory(
|
|
143010
|
+
await this.syncDirectory(path56.dirname(attempt.handle.attemptRoot));
|
|
142684
143011
|
requireFact(compareCurrent(current3, await this.current()), "ROOT_CHANGED");
|
|
142685
143012
|
return file2;
|
|
142686
143013
|
});
|
|
142687
143014
|
}
|
|
142688
143015
|
async writer(name2, reservation, diagnosticBudget) {
|
|
142689
|
-
const parents = await this.ancestors(
|
|
143016
|
+
const parents = await this.ancestors(path56.dirname(name2));
|
|
142690
143017
|
const duty = await this.acquire(
|
|
142691
143018
|
name2,
|
|
142692
143019
|
constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | constants5.O_NOFOLLOW
|
|
@@ -142697,7 +143024,7 @@ var init_filesystem = __esm({
|
|
|
142697
143024
|
let expected;
|
|
142698
143025
|
let hash3;
|
|
142699
143026
|
const observe = async (size, growth = false) => {
|
|
142700
|
-
const held2 = identity(await original.stat({ bigint: true })), named3 = identity(await
|
|
143027
|
+
const held2 = identity(await original.stat({ bigint: true })), named3 = identity(await fs26.lstat(name2, { bigint: true }));
|
|
142701
143028
|
requireFact(
|
|
142702
143029
|
held2.type === "file" && held2.size === String(size) && sameFileIdentity(held2, named3),
|
|
142703
143030
|
"ROOT_CHANGED"
|
|
@@ -142806,7 +143133,7 @@ var init_filesystem = __esm({
|
|
|
142806
143133
|
first ??= error63;
|
|
142807
143134
|
}
|
|
142808
143135
|
try {
|
|
142809
|
-
await this.syncDirectory(
|
|
143136
|
+
await this.syncDirectory(path56.dirname(name2));
|
|
142810
143137
|
} catch (error63) {
|
|
142811
143138
|
first ??= error63;
|
|
142812
143139
|
this.fault(error63);
|
|
@@ -142854,13 +143181,13 @@ var init_filesystem = __esm({
|
|
|
142854
143181
|
}
|
|
142855
143182
|
sink(attempt, reservation, probe2) {
|
|
142856
143183
|
const jobs = reservation?.jobs ?? /* @__PURE__ */ new Map(), budget = reservation?.diagnosticBudget ?? { bytes: 0, reserved: 0 };
|
|
142857
|
-
const diagnostics =
|
|
143184
|
+
const diagnostics = path56.join(attempt.attemptRoot, "diagnostics");
|
|
142858
143185
|
const reobserve = async () => {
|
|
142859
143186
|
if (reservation) await this.checkReservation(reservation);
|
|
142860
143187
|
requireFact(
|
|
142861
143188
|
sameFileIdentity(
|
|
142862
143189
|
attempt.identity,
|
|
142863
|
-
identity(await
|
|
143190
|
+
identity(await fs26.lstat(attempt.attemptRoot, { bigint: true }))
|
|
142864
143191
|
),
|
|
142865
143192
|
"ROOT_CHANGED"
|
|
142866
143193
|
);
|
|
@@ -142880,7 +143207,7 @@ var init_filesystem = __esm({
|
|
|
142880
143207
|
);
|
|
142881
143208
|
requireFact(!jobs.has(parsed.jobId), "BINDING_MISMATCH");
|
|
142882
143209
|
await reobserve();
|
|
142883
|
-
const prefix =
|
|
143210
|
+
const prefix = path56.join(diagnostics, (probe2 ? "probe_" : "") + parsed.jobId);
|
|
142884
143211
|
const job = {
|
|
142885
143212
|
intent: parsed,
|
|
142886
143213
|
prefix,
|
|
@@ -142966,18 +143293,18 @@ var init_filesystem = __esm({
|
|
|
142966
143293
|
requireFact(!this.freshAdmissionStarted, "BINDING_MISMATCH");
|
|
142967
143294
|
this.freshAdmissionStarted = true;
|
|
142968
143295
|
requireFact(
|
|
142969
|
-
parsed.cacheRoot === c3.cacheRoot && parsed.libraryRoot === c3.libraryRoot && parsed.nodeExecutable === c3.nodeExecutable && parsed.nodeExecutableSHA256 === c3.nodeExecutableSHA256 && parsed.verifierEntry === c3.verifierEntry && parsed.controllerEntry === c3.controllerEntry && parsed.sourceManifestPath === c3.sourceManifestPath && canonicalDigest(parsed.sourceVintage) === canonicalDigest(c3.sourceVintage) &&
|
|
143296
|
+
parsed.cacheRoot === c3.cacheRoot && parsed.libraryRoot === c3.libraryRoot && parsed.nodeExecutable === c3.nodeExecutable && parsed.nodeExecutableSHA256 === c3.nodeExecutableSHA256 && parsed.verifierEntry === c3.verifierEntry && parsed.controllerEntry === c3.controllerEntry && parsed.sourceManifestPath === c3.sourceManifestPath && canonicalDigest(parsed.sourceVintage) === canonicalDigest(c3.sourceVintage) && path56.resolve(process.execPath) === c3.nodeExecutable && process.argv[1] && path56.resolve(process.argv[1]) === c3.verifierEntry,
|
|
142970
143297
|
"SOURCE_MISMATCH"
|
|
142971
143298
|
);
|
|
142972
143299
|
requireFact(
|
|
142973
|
-
parsed.attemptRoot ===
|
|
143300
|
+
parsed.attemptRoot === path56.join(c3.cacheRoot, "attempts", parsed.binding.attemptId) && parsed.candidateRoot === path56.join(c3.cacheRoot, "candidates", parsed.binding.installationId) && parsed.executablePath === INSTALLATION_TARGET.executablePath,
|
|
142974
143301
|
"BINDING_MISMATCH"
|
|
142975
143302
|
);
|
|
142976
|
-
const attempt = identity(await
|
|
143303
|
+
const attempt = identity(await fs26.lstat(parsed.attemptRoot, { bigint: true }));
|
|
142977
143304
|
requireFact(sameFileIdentity(attempt, parsed.attemptIdentity), "ROOT_CHANGED");
|
|
142978
143305
|
await this.ancestors(parsed.attemptRoot);
|
|
142979
143306
|
const ownerRead = await this.read(
|
|
142980
|
-
|
|
143307
|
+
path56.join(c3.cacheRoot, "reservation", "owner.json"),
|
|
142981
143308
|
INSTALLATION_LIMITS.journalBytes,
|
|
142982
143309
|
INSTALLATION_LIMITS.journalBytes
|
|
142983
143310
|
);
|
|
@@ -142993,7 +143320,7 @@ var init_filesystem = __esm({
|
|
|
142993
143320
|
birth && birth.executable === c3.nodeExecutable && birth.argv.includes(c3.verifierEntry),
|
|
142994
143321
|
"BINDING_MISMATCH"
|
|
142995
143322
|
);
|
|
142996
|
-
const prefix =
|
|
143323
|
+
const prefix = path56.join(parsed.attemptRoot, "diagnostics", birth.jobId);
|
|
142997
143324
|
const intentRead = await this.read(
|
|
142998
143325
|
prefix + ".intent.json",
|
|
142999
143326
|
INSTALLATION_LIMITS.journalBytes,
|
|
@@ -143019,7 +143346,7 @@ var init_filesystem = __esm({
|
|
|
143019
143346
|
"HASH_MISMATCH"
|
|
143020
143347
|
);
|
|
143021
143348
|
requireFact(
|
|
143022
|
-
sameFileIdentity(attempt, identity(await
|
|
143349
|
+
sameFileIdentity(attempt, identity(await fs26.lstat(parsed.attemptRoot, { bigint: true }))),
|
|
143023
143350
|
"ROOT_CHANGED"
|
|
143024
143351
|
);
|
|
143025
143352
|
this.fresh.set(request, {
|
|
@@ -143038,8 +143365,8 @@ var init_filesystem = __esm({
|
|
|
143038
143365
|
kind: "installation-attempt",
|
|
143039
143366
|
binding: admitted.request.binding,
|
|
143040
143367
|
attemptRoot: admitted.request.attemptRoot,
|
|
143041
|
-
homeRoot:
|
|
143042
|
-
temporaryRoot:
|
|
143368
|
+
homeRoot: path56.join(admitted.request.attemptRoot, "home"),
|
|
143369
|
+
temporaryRoot: path56.join(admitted.request.attemptRoot, "tmp"),
|
|
143043
143370
|
identity: admitted.attempt
|
|
143044
143371
|
});
|
|
143045
143372
|
admitted.sink ??= this.sink(attempt, null, admitted);
|
|
@@ -143056,7 +143383,7 @@ var init_filesystem = __esm({
|
|
|
143056
143383
|
"CUSTODY_UNCERTAIN"
|
|
143057
143384
|
);
|
|
143058
143385
|
const owner = await this.read(
|
|
143059
|
-
|
|
143386
|
+
path56.join(reservation.directory.path, "owner.json"),
|
|
143060
143387
|
INSTALLATION_LIMITS.journalBytes
|
|
143061
143388
|
);
|
|
143062
143389
|
requireFact(
|
|
@@ -143068,11 +143395,11 @@ var init_filesystem = __esm({
|
|
|
143068
143395
|
"OWNERSHIP_UNCERTAIN"
|
|
143069
143396
|
);
|
|
143070
143397
|
try {
|
|
143071
|
-
await
|
|
143398
|
+
await fs26.unlink(owner.file.path);
|
|
143072
143399
|
await reservation.directory.handle.sync();
|
|
143073
143400
|
await this.checkDirectory(reservation.directory);
|
|
143074
143401
|
await this.close(reservation.directory.duty);
|
|
143075
|
-
await
|
|
143402
|
+
await fs26.rmdir(reservation.directory.path);
|
|
143076
143403
|
await reservation.root.handle.sync();
|
|
143077
143404
|
await this.checkDirectory(reservation.root);
|
|
143078
143405
|
await this.close(reservation.root.duty);
|
|
@@ -143120,8 +143447,8 @@ function identity2(s2) {
|
|
|
143120
143447
|
type: s2.isFile() ? "file" : "directory"
|
|
143121
143448
|
});
|
|
143122
143449
|
}
|
|
143123
|
-
function within(root,
|
|
143124
|
-
const name2 = relative11(root,
|
|
143450
|
+
function within(root, path74) {
|
|
143451
|
+
const name2 = relative11(root, path74);
|
|
143125
143452
|
return name2 !== "" && !name2.startsWith("../") && name2 !== ".." && !isAbsolute10(name2);
|
|
143126
143453
|
}
|
|
143127
143454
|
function streamFacts(s2) {
|
|
@@ -143267,26 +143594,26 @@ function createInstallationJobs(configuration, options = { ownerKind: "controlle
|
|
|
143267
143594
|
originals.push(slot);
|
|
143268
143595
|
return slot;
|
|
143269
143596
|
}
|
|
143270
|
-
async function assertDirectory(
|
|
143271
|
-
requireFact2(isAbsolute10(
|
|
143272
|
-
const s2 = await lstat5(
|
|
143597
|
+
async function assertDirectory(path74, expected) {
|
|
143598
|
+
requireFact2(isAbsolute10(path74) && resolve12(path74) === path74, "ROOT_CHANGED");
|
|
143599
|
+
const s2 = await lstat5(path74, { bigint: true });
|
|
143273
143600
|
requireFact2(
|
|
143274
|
-
s2.isDirectory() && !s2.isSymbolicLink() && await realpath4(
|
|
143601
|
+
s2.isDirectory() && !s2.isSymbolicLink() && await realpath4(path74) === path74,
|
|
143275
143602
|
"ROOT_CHANGED"
|
|
143276
143603
|
);
|
|
143277
143604
|
requireFact2(!expected || sameFileIdentity(identity2(s2), expected), "ROOT_CHANGED");
|
|
143278
143605
|
}
|
|
143279
|
-
async function readPinned(slot,
|
|
143280
|
-
const before = await lstat5(
|
|
143606
|
+
async function readPinned(slot, path74, digest2, cap, expected, keep2 = false) {
|
|
143607
|
+
const before = await lstat5(path74, { bigint: true });
|
|
143281
143608
|
requireFact2(
|
|
143282
143609
|
before.isFile() && !before.isSymbolicLink() && before.size <= BigInt(cap),
|
|
143283
143610
|
"SOURCE_MISMATCH"
|
|
143284
143611
|
);
|
|
143285
|
-
requireFact2(await realpath4(
|
|
143612
|
+
requireFact2(await realpath4(path74) === path74, "ROOT_CHANGED");
|
|
143286
143613
|
const beforeIdentity = identity2(before);
|
|
143287
143614
|
requireFact2(!expected || sameFileIdentity(beforeIdentity, expected), "HASH_MISMATCH");
|
|
143288
143615
|
const original = await open4(
|
|
143289
|
-
|
|
143616
|
+
path74,
|
|
143290
143617
|
constants6.O_RDONLY | constants6.O_NOFOLLOW | constants6.O_NONBLOCK
|
|
143291
143618
|
);
|
|
143292
143619
|
heldReads.add(original);
|
|
@@ -143315,7 +143642,7 @@ function createInstallationJobs(configuration, options = { ownerKind: "controlle
|
|
|
143315
143642
|
if (keep2) chunks.push(buffer.slice(0, result3.bytesRead));
|
|
143316
143643
|
}
|
|
143317
143644
|
requireFact2(
|
|
143318
|
-
sameFileIdentity(beforeIdentity, identity2(await original.stat({ bigint: true }))) && sameFileIdentity(beforeIdentity, identity2(await lstat5(
|
|
143645
|
+
sameFileIdentity(beforeIdentity, identity2(await original.stat({ bigint: true }))) && sameFileIdentity(beforeIdentity, identity2(await lstat5(path74, { bigint: true }))),
|
|
143319
143646
|
"ROOT_CHANGED"
|
|
143320
143647
|
);
|
|
143321
143648
|
requireFact2(hash3.digest("hex") === digest2 && bytes === Number(before.size), "HASH_MISMATCH");
|
|
@@ -143861,7 +144188,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
143861
144188
|
...parsed.data,
|
|
143862
144189
|
sourceVintage: Object.freeze(parsed.data.sourceVintage)
|
|
143863
144190
|
});
|
|
143864
|
-
const { filesystem:
|
|
144191
|
+
const { filesystem: fs43, jobs } = dependencies;
|
|
143865
144192
|
const now3 = dependencies.now;
|
|
143866
144193
|
const createId = dependencies.createId;
|
|
143867
144194
|
let active3 = null;
|
|
@@ -143894,7 +144221,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
143894
144221
|
};
|
|
143895
144222
|
const id = () => IdSchema2.parse(Reflect.apply(createId, dependencies, []));
|
|
143896
144223
|
const fsReturned = () => {
|
|
143897
|
-
const custody =
|
|
144224
|
+
const custody = fs43.custody(reservation);
|
|
143898
144225
|
require2(custody.pendingOperations === 0 && custody.unresolvedHandles === 0, "CUSTODY_UNCERTAIN");
|
|
143899
144226
|
require2(custody.firstCause === null, custody.firstCause ?? "CUSTODY_UNCERTAIN");
|
|
143900
144227
|
require2(custody.reservation === "held", "OWNERSHIP_UNCERTAIN");
|
|
@@ -143950,7 +144277,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
143950
144277
|
finalEnd: origin + config3.finalMilliseconds
|
|
143951
144278
|
})
|
|
143952
144279
|
);
|
|
143953
|
-
const before = await
|
|
144280
|
+
const before = await fs43.inspectExisting({ signal: options.signal });
|
|
143954
144281
|
check4(bounds, options.signal);
|
|
143955
144282
|
require2(before.current.state !== "unknown" && before.status.state !== "unverified", "OWNERSHIP_UNCERTAIN");
|
|
143956
144283
|
const existing = before.installation;
|
|
@@ -143972,18 +144299,18 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
143972
144299
|
binding.nonce,
|
|
143973
144300
|
...reuse ? [] : [binding.installationId]
|
|
143974
144301
|
])).size === (reuse ? 3 : 4), "BINDING_MISMATCH");
|
|
143975
|
-
reservation = await
|
|
144302
|
+
reservation = await fs43.acquireReservation(binding, bounds);
|
|
143976
144303
|
check4(bounds, options.signal);
|
|
143977
|
-
const reserved = await
|
|
144304
|
+
const reserved = await fs43.inspectExisting({ signal: options.signal });
|
|
143978
144305
|
require2(canonicalDigest(reserved.current) === canonicalDigest(before.current), "ROOT_CHANGED");
|
|
143979
144306
|
require2(reserved.status.state !== "unverified", "OWNERSHIP_UNCERTAIN");
|
|
143980
144307
|
if (reuse)
|
|
143981
144308
|
require2(reserved.installation && canonicalDigest(reserved.installation) === canonicalDigest(existing), "ROOT_CHANGED");
|
|
143982
144309
|
check4(bounds, options.signal);
|
|
143983
|
-
const attempt = await
|
|
144310
|
+
const attempt = await fs43.createAttempt(reservation);
|
|
143984
144311
|
require2(sameBinding(attempt.binding, binding), "BINDING_MISMATCH");
|
|
143985
144312
|
const owner = async (phase) => {
|
|
143986
|
-
await
|
|
144313
|
+
await fs43.writeOwner(
|
|
143987
144314
|
reservation,
|
|
143988
144315
|
attempt,
|
|
143989
144316
|
Object.freeze({
|
|
@@ -143998,12 +144325,12 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
143998
144325
|
};
|
|
143999
144326
|
await owner("reserved");
|
|
144000
144327
|
check4(bounds, options.signal);
|
|
144001
|
-
const library = await
|
|
144328
|
+
const library = await fs43.validateLibrary();
|
|
144002
144329
|
validateLibrary(library);
|
|
144003
144330
|
check4(bounds, options.signal);
|
|
144004
|
-
const candidate = reuse ? await
|
|
144331
|
+
const candidate = reuse ? await fs43.bindExistingCandidate(reservation, attempt, reserved.installation) : await fs43.stageCandidate(reservation, attempt);
|
|
144005
144332
|
require2(sameBinding(candidate.binding, binding) && candidate.reuse === reuse, "BINDING_MISMATCH");
|
|
144006
|
-
const sink3 =
|
|
144333
|
+
const sink3 = fs43.createJobSink(reservation, attempt);
|
|
144007
144334
|
let installer = {
|
|
144008
144335
|
kind: "not-invoked"
|
|
144009
144336
|
};
|
|
@@ -144029,7 +144356,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144029
144356
|
installer = { kind: "invoked", jobId: facts2.jobId, receiptDigest: canonicalDigest(facts2) };
|
|
144030
144357
|
check4(bounds, options.signal);
|
|
144031
144358
|
}
|
|
144032
|
-
const snapshot = await
|
|
144359
|
+
const snapshot = await fs43.observeCandidate(candidate);
|
|
144033
144360
|
validateCandidate(snapshot, binding);
|
|
144034
144361
|
check4(bounds, options.signal);
|
|
144035
144362
|
await owner("verifying");
|
|
@@ -144083,7 +144410,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144083
144410
|
require2(reply.libraryDistributionSHA256 === library.distributionSHA256, "LIBRARY_MISMATCH");
|
|
144084
144411
|
require2(reply.sourceManifestSHA256 === config3.sourceVintage.sourceManifestSHA256, "SOURCE_MISMATCH");
|
|
144085
144412
|
require2(reply.machOCPU === snapshot.machOCPU, "INSTALLATION_INVALID");
|
|
144086
|
-
await
|
|
144413
|
+
await fs43.revalidateCandidate(candidate, snapshot);
|
|
144087
144414
|
check4(bounds, options.signal);
|
|
144088
144415
|
allJobsReturned();
|
|
144089
144416
|
fsReturned();
|
|
@@ -144117,17 +144444,17 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144117
144444
|
});
|
|
144118
144445
|
recordBytes(journal, INSTALLATION_LIMITS.journalBytes);
|
|
144119
144446
|
check4(bounds, options.signal);
|
|
144120
|
-
const written2 = await
|
|
144447
|
+
const written2 = await fs43.writeReuseJournal(reservation, attempt, journal);
|
|
144121
144448
|
require2(written2.path === join56(attempt.attemptRoot, "reuse.json") && written2.sha256 === sha2564(recordBytes(journal, INSTALLATION_LIMITS.journalBytes)), "OWNERSHIP_UNCERTAIN");
|
|
144122
|
-
const unchanged = await
|
|
144449
|
+
const unchanged = await fs43.inspectExisting({ signal: options.signal });
|
|
144123
144450
|
require2(canonicalDigest(unchanged.current) === canonicalDigest(reserved.current) && canonicalDigest(unchanged.installation) === canonicalDigest(reserved.installation), "ROOT_CHANGED");
|
|
144124
144451
|
journalDigest = written2.sha256;
|
|
144125
144452
|
currentManifestDigest = reserved.installation.current.pointer.manifestDigest;
|
|
144126
144453
|
} else {
|
|
144127
144454
|
await owner("publishing");
|
|
144128
144455
|
check4(bounds, options.signal);
|
|
144129
|
-
await
|
|
144130
|
-
await
|
|
144456
|
+
await fs43.makeCandidateDurable(candidate, snapshot);
|
|
144457
|
+
await fs43.revalidateCandidate(candidate, snapshot);
|
|
144131
144458
|
check4(bounds, options.signal);
|
|
144132
144459
|
allJobsReturned();
|
|
144133
144460
|
fsReturned();
|
|
@@ -144150,7 +144477,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144150
144477
|
}
|
|
144151
144478
|
});
|
|
144152
144479
|
recordBytes(manifest, INSTALLATION_LIMITS.manifestBytes);
|
|
144153
|
-
const published = await
|
|
144480
|
+
const published = await fs43.publish(
|
|
144154
144481
|
reservation,
|
|
144155
144482
|
candidate,
|
|
144156
144483
|
manifest,
|
|
@@ -144170,9 +144497,9 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144170
144497
|
check4(bounds, options.signal, true);
|
|
144171
144498
|
allJobsReturned();
|
|
144172
144499
|
fsReturned();
|
|
144173
|
-
await
|
|
144500
|
+
await fs43.releaseReservation(reservation);
|
|
144174
144501
|
check4(bounds, options.signal, true);
|
|
144175
|
-
const final =
|
|
144502
|
+
const final = fs43.custody(reservation);
|
|
144176
144503
|
require2(final.reservation === "released" && final.pendingOperations === 0 && final.unresolvedHandles === 0 && final.firstCause === null, "CUSTODY_UNCERTAIN");
|
|
144177
144504
|
return Object.freeze({
|
|
144178
144505
|
state: reuse ? "verified-reused" : "verified-installed",
|
|
@@ -144192,7 +144519,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
144192
144519
|
fail(error63);
|
|
144193
144520
|
let uncertain = !!reservation || publicationMayHaveChanged;
|
|
144194
144521
|
try {
|
|
144195
|
-
const files =
|
|
144522
|
+
const files = fs43.custody(reservation);
|
|
144196
144523
|
const processes = jobs.custody();
|
|
144197
144524
|
uncertain ||= files.reservation !== "released" || files.pendingOperations !== 0 || files.unresolvedHandles !== 0 || files.firstCause !== null || processes.pending !== 0 || processes.firstCause !== null;
|
|
144198
144525
|
} catch {
|
|
@@ -144873,7 +145200,7 @@ var init_operator_output = __esm({
|
|
|
144873
145200
|
});
|
|
144874
145201
|
|
|
144875
145202
|
// src/lib/agent-browser/chrome-locator.ts
|
|
144876
|
-
import
|
|
145203
|
+
import path57 from "node:path";
|
|
144877
145204
|
function chromeCandidates(env6) {
|
|
144878
145205
|
if (env6.platform === "darwin") {
|
|
144879
145206
|
const apps = [
|
|
@@ -144881,8 +145208,8 @@ function chromeCandidates(env6) {
|
|
|
144881
145208
|
["Chromium.app", "Chromium"]
|
|
144882
145209
|
];
|
|
144883
145210
|
return apps.flatMap(([app, binary3]) => [
|
|
144884
|
-
|
|
144885
|
-
|
|
145211
|
+
path57.posix.join("/Applications", app, "Contents", "MacOS", binary3),
|
|
145212
|
+
path57.posix.join(env6.homeDir, "Applications", app, "Contents", "MacOS", binary3)
|
|
144886
145213
|
]);
|
|
144887
145214
|
}
|
|
144888
145215
|
if (env6.platform === "win32") {
|
|
@@ -144891,15 +145218,15 @@ function chromeCandidates(env6) {
|
|
|
144891
145218
|
);
|
|
144892
145219
|
return [
|
|
144893
145220
|
...roots.map(
|
|
144894
|
-
(root) =>
|
|
145221
|
+
(root) => path57.win32.join(root, "Google", "Chrome", "Application", "chrome.exe")
|
|
144895
145222
|
),
|
|
144896
|
-
...roots.map((root) =>
|
|
145223
|
+
...roots.map((root) => path57.win32.join(root, "Chromium", "Application", "chrome.exe"))
|
|
144897
145224
|
];
|
|
144898
145225
|
}
|
|
144899
145226
|
const names = ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"];
|
|
144900
|
-
const dirs = (env6.pathVar ?? "").split(
|
|
145227
|
+
const dirs = (env6.pathVar ?? "").split(path57.posix.delimiter).filter(Boolean);
|
|
144901
145228
|
return [
|
|
144902
|
-
...names.flatMap((name2) => dirs.map((dir) =>
|
|
145229
|
+
...names.flatMap((name2) => dirs.map((dir) => path57.posix.join(dir, name2))),
|
|
144903
145230
|
"/opt/google/chrome/chrome"
|
|
144904
145231
|
];
|
|
144905
145232
|
}
|
|
@@ -145064,8 +145391,8 @@ var init_process_liveness = __esm({
|
|
|
145064
145391
|
});
|
|
145065
145392
|
|
|
145066
145393
|
// src/lib/agent-browser/profile.ts
|
|
145067
|
-
import
|
|
145068
|
-
import
|
|
145394
|
+
import fs27 from "node:fs";
|
|
145395
|
+
import path58 from "node:path";
|
|
145069
145396
|
function themePreferences() {
|
|
145070
145397
|
const color = AGENT_BROWSER_THEME_COLOR;
|
|
145071
145398
|
return {
|
|
@@ -145109,7 +145436,7 @@ function deepMerge2(base, patch) {
|
|
|
145109
145436
|
}
|
|
145110
145437
|
function readJsonObject(file2) {
|
|
145111
145438
|
try {
|
|
145112
|
-
const parsed = JSON.parse(
|
|
145439
|
+
const parsed = JSON.parse(fs27.readFileSync(file2, "utf8"));
|
|
145113
145440
|
return isObject6(parsed) ? parsed : {};
|
|
145114
145441
|
} catch {
|
|
145115
145442
|
return {};
|
|
@@ -145124,26 +145451,26 @@ function hasOwnThemeColor(prefs) {
|
|
|
145124
145451
|
return isObject6(extensions) && typeof extensions.id === "string" && extensions.id !== "";
|
|
145125
145452
|
}
|
|
145126
145453
|
function ensureAgentProfile(profileDir, now3 = /* @__PURE__ */ new Date()) {
|
|
145127
|
-
const created = !
|
|
145128
|
-
|
|
145129
|
-
|
|
145130
|
-
|
|
145131
|
-
const marker =
|
|
145132
|
-
if (
|
|
145133
|
-
const prefsFile =
|
|
145454
|
+
const created = !fs27.existsSync(profileDir);
|
|
145455
|
+
fs27.mkdirSync(path58.dirname(profileDir), { recursive: true, mode: 448 });
|
|
145456
|
+
fs27.chmodSync(path58.dirname(profileDir), 448);
|
|
145457
|
+
fs27.mkdirSync(profileDir, { recursive: true, mode: 448 });
|
|
145458
|
+
const marker = path58.join(profileDir, THEME_MARKER_FILE);
|
|
145459
|
+
if (fs27.existsSync(marker)) return { created, themed: false };
|
|
145460
|
+
const prefsFile = path58.join(profileDir, "Default", "Preferences");
|
|
145134
145461
|
const prefs = readJsonObject(prefsFile);
|
|
145135
145462
|
const themed = !hasOwnThemeColor(prefs);
|
|
145136
145463
|
if (themed) {
|
|
145137
|
-
|
|
145138
|
-
|
|
145139
|
-
const localStateFile =
|
|
145464
|
+
fs27.mkdirSync(path58.dirname(prefsFile), { recursive: true, mode: 448 });
|
|
145465
|
+
fs27.writeFileSync(prefsFile, JSON.stringify(deepMerge2(prefs, themePreferences())));
|
|
145466
|
+
const localStateFile = path58.join(profileDir, "Local State");
|
|
145140
145467
|
const localState = readJsonObject(localStateFile);
|
|
145141
|
-
|
|
145468
|
+
fs27.writeFileSync(
|
|
145142
145469
|
localStateFile,
|
|
145143
145470
|
JSON.stringify(deepMerge2(localState, localStateProfileInfo()))
|
|
145144
145471
|
);
|
|
145145
145472
|
}
|
|
145146
|
-
|
|
145473
|
+
fs27.writeFileSync(
|
|
145147
145474
|
marker,
|
|
145148
145475
|
`${JSON.stringify({ themeAppliedAt: now3.toISOString(), themed }, null, 2)}
|
|
145149
145476
|
`
|
|
@@ -145152,10 +145479,10 @@ function ensureAgentProfile(profileDir, now3 = /* @__PURE__ */ new Date()) {
|
|
|
145152
145479
|
}
|
|
145153
145480
|
function profileLock(profileDir, platform3 = process.platform) {
|
|
145154
145481
|
if (platform3 === "win32") {
|
|
145155
|
-
const lockfile =
|
|
145156
|
-
if (!
|
|
145482
|
+
const lockfile = path58.join(profileDir, "lockfile");
|
|
145483
|
+
if (!fs27.existsSync(lockfile)) return { inUse: false };
|
|
145157
145484
|
try {
|
|
145158
|
-
|
|
145485
|
+
fs27.rmSync(lockfile);
|
|
145159
145486
|
return { inUse: false };
|
|
145160
145487
|
} catch {
|
|
145161
145488
|
return { inUse: true };
|
|
@@ -145163,7 +145490,7 @@ function profileLock(profileDir, platform3 = process.platform) {
|
|
|
145163
145490
|
}
|
|
145164
145491
|
let target;
|
|
145165
145492
|
try {
|
|
145166
|
-
target =
|
|
145493
|
+
target = fs27.readlinkSync(path58.join(profileDir, "SingletonLock"));
|
|
145167
145494
|
} catch {
|
|
145168
145495
|
return { inUse: false };
|
|
145169
145496
|
}
|
|
@@ -145265,8 +145592,8 @@ var init_cloud_origin = __esm({
|
|
|
145265
145592
|
});
|
|
145266
145593
|
|
|
145267
145594
|
// src/lib/agent-browser/storage-state.ts
|
|
145268
|
-
import
|
|
145269
|
-
import
|
|
145595
|
+
import fs28 from "node:fs";
|
|
145596
|
+
import path59 from "node:path";
|
|
145270
145597
|
function toStorageStateCookie(cookie) {
|
|
145271
145598
|
const copy2 = {
|
|
145272
145599
|
name: cookie.name,
|
|
@@ -145337,7 +145664,7 @@ function cliCloudOrigins() {
|
|
|
145337
145664
|
}
|
|
145338
145665
|
async function writeStorageState(file2, state) {
|
|
145339
145666
|
const saved = withoutCloudOrigin(state, cliCloudOrigins()).state;
|
|
145340
|
-
|
|
145667
|
+
fs28.mkdirSync(path59.dirname(file2), { recursive: true, mode: 448 });
|
|
145341
145668
|
await writeFileAtomic2(file2, `${JSON.stringify(saved, null, 2)}
|
|
145342
145669
|
`, { mode: 384 });
|
|
145343
145670
|
return saved;
|
|
@@ -145345,7 +145672,7 @@ async function writeStorageState(file2, state) {
|
|
|
145345
145672
|
function readStorageState(file2) {
|
|
145346
145673
|
let raw;
|
|
145347
145674
|
try {
|
|
145348
|
-
raw =
|
|
145675
|
+
raw = fs28.readFileSync(file2, "utf8");
|
|
145349
145676
|
} catch (err) {
|
|
145350
145677
|
if (err.code === "ENOENT") return null;
|
|
145351
145678
|
throw err;
|
|
@@ -145455,13 +145782,13 @@ __export(browser_commands_exports, {
|
|
|
145455
145782
|
runBrowserLogin: () => runBrowserLogin,
|
|
145456
145783
|
runBrowserStatus: () => runBrowserStatus
|
|
145457
145784
|
});
|
|
145458
|
-
import
|
|
145459
|
-
import
|
|
145785
|
+
import fs29 from "node:fs";
|
|
145786
|
+
import path60 from "node:path";
|
|
145460
145787
|
import { parseArgs as parseArgs8 } from "node:util";
|
|
145461
145788
|
function agentBrowserPaths(dorkHome) {
|
|
145462
145789
|
return {
|
|
145463
|
-
profileDir:
|
|
145464
|
-
stateFile:
|
|
145790
|
+
profileDir: path60.join(dorkHome, ...AGENT_BROWSER_PROFILE_SEGMENTS),
|
|
145791
|
+
stateFile: path60.join(dorkHome, ...AGENT_BROWSER_STATE_SEGMENTS)
|
|
145465
145792
|
};
|
|
145466
145793
|
}
|
|
145467
145794
|
function profileFlags(profileDir) {
|
|
@@ -145651,7 +145978,7 @@ function parseBrowserStatusArgs(rawArgs) {
|
|
|
145651
145978
|
async function runBrowserStatus(args, deps) {
|
|
145652
145979
|
const { stateFile } = agentBrowserPaths(deps.dorkHome);
|
|
145653
145980
|
const state = readStorageState(stateFile);
|
|
145654
|
-
const savedAt = state ?
|
|
145981
|
+
const savedAt = state ? fs29.statSync(stateFile).mtime : null;
|
|
145655
145982
|
const sites = state ? summarizeStorageState(state, deps.now().getTime() / 1e3) : [];
|
|
145656
145983
|
if (args.json) {
|
|
145657
145984
|
printJson({
|
|
@@ -145728,7 +146055,7 @@ ${FORGET_USAGE}`);
|
|
|
145728
146055
|
};
|
|
145729
146056
|
}
|
|
145730
146057
|
async function cleanProfile(deps, profileDir, target, knownOrigins, chromeFlag) {
|
|
145731
|
-
if (!
|
|
146058
|
+
if (!fs29.existsSync(profileDir)) return null;
|
|
145732
146059
|
const what = target === "all" ? "those sites are" : `${target.site} is`;
|
|
145733
146060
|
const nextSave = "the next `dorkos browser login` will save it again";
|
|
145734
146061
|
if (deps.profileLock(profileDir).inUse) {
|
|
@@ -145824,7 +146151,7 @@ var browser_deps_exports = {};
|
|
|
145824
146151
|
__export(browser_deps_exports, {
|
|
145825
146152
|
defaultBrowserDeps: () => defaultBrowserDeps
|
|
145826
146153
|
});
|
|
145827
|
-
import
|
|
146154
|
+
import fs30 from "node:fs";
|
|
145828
146155
|
import { homedir as homedir3 } from "node:os";
|
|
145829
146156
|
import { spawn as spawn3, spawnSync } from "node:child_process";
|
|
145830
146157
|
import { createInterface as createInterface2 } from "node:readline";
|
|
@@ -145880,7 +146207,7 @@ function defaultBrowserDeps() {
|
|
|
145880
146207
|
programFilesX86: env4["PROGRAMFILES(X86)"],
|
|
145881
146208
|
exists: (file2) => {
|
|
145882
146209
|
try {
|
|
145883
|
-
return
|
|
146210
|
+
return fs30.statSync(file2).isFile();
|
|
145884
146211
|
} catch {
|
|
145885
146212
|
return false;
|
|
145886
146213
|
}
|
|
@@ -146014,9 +146341,9 @@ var init_installation_label = __esm({
|
|
|
146014
146341
|
});
|
|
146015
146342
|
|
|
146016
146343
|
// src/lib/package-commands.ts
|
|
146017
|
-
import
|
|
146344
|
+
import path61 from "node:path";
|
|
146018
146345
|
function resolveProjectFlag(value) {
|
|
146019
|
-
return typeof value === "string" ?
|
|
146346
|
+
return typeof value === "string" ? path61.resolve(process.cwd(), value) : void 0;
|
|
146020
146347
|
}
|
|
146021
146348
|
function shellWord(value) {
|
|
146022
146349
|
return /^[A-Za-z0-9_./,:@%+=-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
@@ -146805,8 +147132,8 @@ async function runUninstall(args) {
|
|
|
146805
147132
|
console.log(
|
|
146806
147133
|
result2.unproven && result2.unproven.length > 0 ? "Kept these files:" : "Kept the files you and your agents added or changed:"
|
|
146807
147134
|
);
|
|
146808
|
-
for (const
|
|
146809
|
-
console.log(` ${
|
|
147135
|
+
for (const path74 of result2.preservedData) {
|
|
147136
|
+
console.log(` ${path74}`);
|
|
146810
147137
|
}
|
|
146811
147138
|
}
|
|
146812
147139
|
if (result2.agentRemoved) {
|
|
@@ -147038,8 +147365,8 @@ function filesOf(pkg) {
|
|
|
147038
147365
|
}
|
|
147039
147366
|
function devLinkNoteOf(pkg) {
|
|
147040
147367
|
if (!pkg.devLink) return void 0;
|
|
147041
|
-
const { path:
|
|
147042
|
-
return state === "active" ? `dev link \u2192 ${
|
|
147368
|
+
const { path: path74, state } = pkg.devLink;
|
|
147369
|
+
return state === "active" ? `dev link \u2192 ${path74}` : `dev link \u2192 ${path74} (${DEV_LINK_TROUBLE[state]})`;
|
|
147043
147370
|
}
|
|
147044
147371
|
function notesOf(pkg) {
|
|
147045
147372
|
return [
|
|
@@ -147386,8 +147713,8 @@ __export(marketplace_link_exports, {
|
|
|
147386
147713
|
parseMarketplaceLinkArgs: () => parseMarketplaceLinkArgs,
|
|
147387
147714
|
runMarketplaceLink: () => runMarketplaceLink
|
|
147388
147715
|
});
|
|
147389
|
-
import
|
|
147390
|
-
import
|
|
147716
|
+
import fs31 from "node:fs";
|
|
147717
|
+
import path62 from "node:path";
|
|
147391
147718
|
import { parseArgs as parseArgs17 } from "node:util";
|
|
147392
147719
|
function parseMarketplaceLinkArgs(rawArgs) {
|
|
147393
147720
|
let parsed;
|
|
@@ -147414,7 +147741,7 @@ ${USAGE_LINE16}`);
|
|
|
147414
147741
|
if (positionals2.length > 1) throw new Error(`Link one folder at a time.
|
|
147415
147742
|
${USAGE_LINE16}`);
|
|
147416
147743
|
return {
|
|
147417
|
-
folder:
|
|
147744
|
+
folder: path62.resolve(process.cwd(), folder),
|
|
147418
147745
|
projectPath: resolveProjectFlag(values2.project),
|
|
147419
147746
|
replaceInstalled: Boolean(values2["replace-installed"]),
|
|
147420
147747
|
yes: Boolean(values2.yes),
|
|
@@ -147428,7 +147755,7 @@ function runningAsAgent() {
|
|
|
147428
147755
|
function describeUnreadableFolder(typed, err) {
|
|
147429
147756
|
const code = err?.code;
|
|
147430
147757
|
const reason = code === "ENOENT" ? `No folder at ${typed}.` : code === "EACCES" || code === "EPERM" ? `Can't read ${typed}: permission denied (${code}).` : `Can't read ${typed}${code ? ` (${code})` : ""}.`;
|
|
147431
|
-
const tilde = typed.split(
|
|
147758
|
+
const tilde = typed.split(path62.sep).includes("~") ? " The shell does not expand ~ inside quotes; use the full path." : "";
|
|
147432
147759
|
return `Error: ${reason}${tilde}`;
|
|
147433
147760
|
}
|
|
147434
147761
|
function describeLinkPreview(preview) {
|
|
@@ -147448,7 +147775,7 @@ function describeLinkPreview(preview) {
|
|
|
147448
147775
|
async function runMarketplaceLink(args) {
|
|
147449
147776
|
let folder;
|
|
147450
147777
|
try {
|
|
147451
|
-
folder =
|
|
147778
|
+
folder = fs31.realpathSync(args.folder);
|
|
147452
147779
|
} catch (err) {
|
|
147453
147780
|
console.error(describeUnreadableFolder(args.folder, err));
|
|
147454
147781
|
return 1;
|
|
@@ -147711,7 +148038,9 @@ Run \`dorkos marketplace refresh ${created.name}\` to try again.`
|
|
|
147711
148038
|
return 0;
|
|
147712
148039
|
} catch (err) {
|
|
147713
148040
|
if (err instanceof ApiError) {
|
|
147714
|
-
if (err.
|
|
148041
|
+
if (err.body.code === SOURCE_NEEDS_APP) {
|
|
148042
|
+
console.error(String(err.body.error ?? err.message));
|
|
148043
|
+
} else if (err.status === 409) {
|
|
147715
148044
|
console.error(
|
|
147716
148045
|
`Error: marketplace '${name2}' already exists. Pass --name to choose another.`
|
|
147717
148046
|
);
|
|
@@ -147727,13 +148056,14 @@ ${err.body.message}`);
|
|
|
147727
148056
|
return 1;
|
|
147728
148057
|
}
|
|
147729
148058
|
}
|
|
147730
|
-
var USAGE_LINE18;
|
|
148059
|
+
var USAGE_LINE18, SOURCE_NEEDS_APP;
|
|
147731
148060
|
var init_marketplace_add = __esm({
|
|
147732
148061
|
"src/commands/marketplace-add.ts"() {
|
|
147733
148062
|
"use strict";
|
|
147734
148063
|
init_api_client();
|
|
147735
148064
|
init_parse_args_error();
|
|
147736
148065
|
USAGE_LINE18 = "Usage: dorkos marketplace add <url> [--name <name>]";
|
|
148066
|
+
SOURCE_NEEDS_APP = "marketplace_source_needs_app";
|
|
147737
148067
|
}
|
|
147738
148068
|
});
|
|
147739
148069
|
|
|
@@ -148782,10 +149112,10 @@ function createGitHubCommunityReleaseSource(options) {
|
|
|
148782
149112
|
},
|
|
148783
149113
|
verifyManifest: async (bytes, trusted) => {
|
|
148784
149114
|
const directory = await mkdtemp2(join58(tmpdir3(), "dorkos-community-manifest-"));
|
|
148785
|
-
const
|
|
149115
|
+
const path74 = join58(directory, "manifest.json");
|
|
148786
149116
|
try {
|
|
148787
|
-
await writeFile5(
|
|
148788
|
-
return await verify(
|
|
149117
|
+
await writeFile5(path74, bytes, { mode: 384, flag: "wx" });
|
|
149118
|
+
return await verify(path74, trusted);
|
|
148789
149119
|
} finally {
|
|
148790
149120
|
await rm3(directory, { recursive: true, force: true });
|
|
148791
149121
|
}
|
|
@@ -150424,7 +150754,7 @@ function flyGraphqlAuthorization(token) {
|
|
|
150424
150754
|
const macaroon = token.split(",").some((part) => ["fm1r", "fm1a", "fm2"].includes(part.trim().split("_", 1)[0]));
|
|
150425
150755
|
return `${macaroon ? "FlyV1" : "Bearer"} ${token}`;
|
|
150426
150756
|
}
|
|
150427
|
-
var FLY_GRAPHQL_ENDPOINT,
|
|
150757
|
+
var FLY_GRAPHQL_ENDPOINT, DEFAULT_TIMEOUT_MS2, DEFAULT_MAX_RESPONSE_BYTES, MAX_TIMEOUT_MS, MAX_RESPONSE_BYTES, FlyGraphqlClientError, FlyTigrisGraphqlClient;
|
|
150428
150758
|
var init_fly_graphql_client = __esm({
|
|
150429
150759
|
"src/commands/community-deploy/fly-graphql-client.ts"() {
|
|
150430
150760
|
"use strict";
|
|
@@ -150432,7 +150762,7 @@ var init_fly_graphql_client = __esm({
|
|
|
150432
150762
|
init_provider_identifiers();
|
|
150433
150763
|
init_provider_mutation();
|
|
150434
150764
|
FLY_GRAPHQL_ENDPOINT = "https://api.fly.io/graphql";
|
|
150435
|
-
|
|
150765
|
+
DEFAULT_TIMEOUT_MS2 = 3e4;
|
|
150436
150766
|
DEFAULT_MAX_RESPONSE_BYTES = 1024 * 1024;
|
|
150437
150767
|
MAX_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
150438
150768
|
MAX_RESPONSE_BYTES = 16 * 1024 * 1024;
|
|
@@ -150465,14 +150795,14 @@ var init_fly_graphql_client = __esm({
|
|
|
150465
150795
|
if (options.accessToken.length < 1 || options.accessToken.length > 4096 || !/^[\x21-\x7e]+$/u.test(options.accessToken)) {
|
|
150466
150796
|
throw new FlyGraphqlClientError("AUTH_REQUIRED");
|
|
150467
150797
|
}
|
|
150468
|
-
if (!Number.isSafeInteger(options.timeoutMs ??
|
|
150798
|
+
if (!Number.isSafeInteger(options.timeoutMs ?? DEFAULT_TIMEOUT_MS2) || (options.timeoutMs ?? DEFAULT_TIMEOUT_MS2) < 1 || (options.timeoutMs ?? DEFAULT_TIMEOUT_MS2) > MAX_TIMEOUT_MS) {
|
|
150469
150799
|
throw new FlyGraphqlClientError("INVALID_RESPONSE");
|
|
150470
150800
|
}
|
|
150471
150801
|
if (!Number.isSafeInteger(options.maxResponseBytes ?? DEFAULT_MAX_RESPONSE_BYTES) || (options.maxResponseBytes ?? DEFAULT_MAX_RESPONSE_BYTES) < 1 || (options.maxResponseBytes ?? DEFAULT_MAX_RESPONSE_BYTES) > MAX_RESPONSE_BYTES) {
|
|
150472
150802
|
throw new FlyGraphqlClientError("INVALID_RESPONSE");
|
|
150473
150803
|
}
|
|
150474
150804
|
this.accessToken = options.accessToken;
|
|
150475
|
-
this.timeoutMs = options.timeoutMs ??
|
|
150805
|
+
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS2;
|
|
150476
150806
|
this.maxResponseBytes = options.maxResponseBytes ?? DEFAULT_MAX_RESPONSE_BYTES;
|
|
150477
150807
|
this.fetch = options.fetch ?? fetch;
|
|
150478
150808
|
this.signal = options.signal;
|
|
@@ -151590,10 +151920,10 @@ kill_timeout = "30s"
|
|
|
151590
151920
|
}
|
|
151591
151921
|
async function withCommunityFlyConfig(plan, consumer) {
|
|
151592
151922
|
const directory = await mkdtemp3(join59(tmpdir4(), "dorkos-community-fly-"));
|
|
151593
|
-
const
|
|
151923
|
+
const path74 = join59(directory, "fly.toml");
|
|
151594
151924
|
try {
|
|
151595
|
-
await writeFile6(
|
|
151596
|
-
return await consumer(
|
|
151925
|
+
await writeFile6(path74, renderCommunityFlyConfig(plan), { mode: 384, flag: "wx" });
|
|
151926
|
+
return await consumer(path74);
|
|
151597
151927
|
} finally {
|
|
151598
151928
|
await rm4(directory, { recursive: true, force: true });
|
|
151599
151929
|
}
|
|
@@ -151731,7 +152061,7 @@ async function resolvePlatformImageDigest(input4) {
|
|
|
151731
152061
|
if (!match || !REGISTRY_ALLOW_LIST.has(match[1]) || !Sha256DigestSchema2.safeParse(input4.digest).success) {
|
|
151732
152062
|
throw invalid2();
|
|
151733
152063
|
}
|
|
151734
|
-
const [, host,
|
|
152064
|
+
const [, host, path74] = match;
|
|
151735
152065
|
const request = input4.fetch ?? fetch;
|
|
151736
152066
|
const signal = AbortSignal.any([
|
|
151737
152067
|
AbortSignal.timeout(input4.timeoutMs),
|
|
@@ -151741,14 +152071,14 @@ async function resolvePlatformImageDigest(input4) {
|
|
|
151741
152071
|
let mediaType;
|
|
151742
152072
|
try {
|
|
151743
152073
|
const tokenResponse = await request(
|
|
151744
|
-
`https://${host}/token?scope=${encodeURIComponent(`repository:${
|
|
152074
|
+
`https://${host}/token?scope=${encodeURIComponent(`repository:${path74}:pull`)}&service=${host}`,
|
|
151745
152075
|
{ signal, redirect: "error" }
|
|
151746
152076
|
);
|
|
151747
152077
|
if (!tokenResponse.ok) throw invalid2();
|
|
151748
152078
|
const token = external_exports.object({ token: external_exports.string().min(1).max(8192) }).passthrough().parse(
|
|
151749
152079
|
JSON.parse(Buffer.from(await readBounded2(tokenResponse, MAX_TOKEN_BYTES)).toString("utf8"))
|
|
151750
152080
|
).token;
|
|
151751
|
-
const response = await request(`https://${host}/v2/${
|
|
152081
|
+
const response = await request(`https://${host}/v2/${path74}/manifests/${input4.digest}`, {
|
|
151752
152082
|
signal,
|
|
151753
152083
|
redirect: "error",
|
|
151754
152084
|
headers: {
|
|
@@ -152063,8 +152393,8 @@ function handoffCommands(system) {
|
|
|
152063
152393
|
browser: { executable: "xdg-open", args: (origin) => [origin] }
|
|
152064
152394
|
};
|
|
152065
152395
|
}
|
|
152066
|
-
async function executableOnPath(executable,
|
|
152067
|
-
for (const directory of
|
|
152396
|
+
async function executableOnPath(executable, path74) {
|
|
152397
|
+
for (const directory of path74.split(delimiter).filter(Boolean)) {
|
|
152068
152398
|
try {
|
|
152069
152399
|
await access2(join60(directory, executable), constants9.X_OK);
|
|
152070
152400
|
return true;
|
|
@@ -152078,11 +152408,11 @@ async function assertOwnerHandoffPrerequisites(env6, system = platform2()) {
|
|
|
152078
152408
|
throw new Error(`Owner handoff is unsupported on this platform. See ${FLY_GUIDE_URL}`);
|
|
152079
152409
|
}
|
|
152080
152410
|
const commands = handoffCommands(system);
|
|
152081
|
-
const
|
|
152411
|
+
const path74 = env6.PATH ?? "";
|
|
152082
152412
|
const missing = (await Promise.all(
|
|
152083
152413
|
[commands.clipboard.executable].map(async (executable) => ({
|
|
152084
152414
|
executable,
|
|
152085
|
-
found: await executableOnPath(executable,
|
|
152415
|
+
found: await executableOnPath(executable, path74)
|
|
152086
152416
|
}))
|
|
152087
152417
|
)).filter(({ found }) => !found);
|
|
152088
152418
|
if (missing.length > 0) {
|
|
@@ -152288,9 +152618,9 @@ function launchJournalPath(dorkHome, runId) {
|
|
|
152288
152618
|
const safeRunId = external_exports.uuid().parse(runId);
|
|
152289
152619
|
return join61(dorkHome, "launches", "community", `${safeRunId}.json`);
|
|
152290
152620
|
}
|
|
152291
|
-
async function rejectSymlink(
|
|
152621
|
+
async function rejectSymlink(path74) {
|
|
152292
152622
|
try {
|
|
152293
|
-
if ((await lstat7(
|
|
152623
|
+
if ((await lstat7(path74)).isSymbolicLink()) throw new Error(`Refusing symbolic link: ${path74}`);
|
|
152294
152624
|
} catch (error63) {
|
|
152295
152625
|
if (error63.code !== "ENOENT") throw error63;
|
|
152296
152626
|
}
|
|
@@ -152312,9 +152642,9 @@ async function prepareDirectory(filePath) {
|
|
|
152312
152642
|
await rejectSymlink(directory);
|
|
152313
152643
|
}
|
|
152314
152644
|
}
|
|
152315
|
-
async function exists2(
|
|
152645
|
+
async function exists2(path74) {
|
|
152316
152646
|
try {
|
|
152317
|
-
await lstat7(
|
|
152647
|
+
await lstat7(path74);
|
|
152318
152648
|
return true;
|
|
152319
152649
|
} catch (error63) {
|
|
152320
152650
|
if (error63.code === "ENOENT") return false;
|
|
@@ -155247,8 +155577,8 @@ There is no --yes mode. Before the first write, type the generated app name in a
|
|
|
155247
155577
|
// src/commands/doctor-checks.ts
|
|
155248
155578
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
155249
155579
|
import net from "node:net";
|
|
155250
|
-
import
|
|
155251
|
-
import
|
|
155580
|
+
import fs32 from "node:fs";
|
|
155581
|
+
import path63 from "node:path";
|
|
155252
155582
|
function checkNode() {
|
|
155253
155583
|
const issue2 = checkNodeVersion();
|
|
155254
155584
|
if (issue2) {
|
|
@@ -155257,11 +155587,11 @@ function checkNode() {
|
|
|
155257
155587
|
return { label: `Node.js ${process.versions.node}`, status: "pass" };
|
|
155258
155588
|
}
|
|
155259
155589
|
function checkDorkHomeWritable(dorkHome) {
|
|
155260
|
-
const probe2 =
|
|
155590
|
+
const probe2 = path63.join(dorkHome, `.doctor-write-${process.pid}`);
|
|
155261
155591
|
try {
|
|
155262
|
-
|
|
155263
|
-
|
|
155264
|
-
|
|
155592
|
+
fs32.mkdirSync(dorkHome, { recursive: true });
|
|
155593
|
+
fs32.writeFileSync(probe2, "ok");
|
|
155594
|
+
fs32.rmSync(probe2, { force: true });
|
|
155265
155595
|
return { label: `Data directory is writable`, status: "pass", detail: dorkHome };
|
|
155266
155596
|
} catch (err) {
|
|
155267
155597
|
return {
|
|
@@ -155310,8 +155640,8 @@ function readGitVersion() {
|
|
|
155310
155640
|
return execFileSync3("git", ["--version"], { encoding: "utf-8", stdio: "pipe", timeout: 1e4 });
|
|
155311
155641
|
}
|
|
155312
155642
|
function checkClaudeAuth(homeDir) {
|
|
155313
|
-
const claudeDir =
|
|
155314
|
-
if (
|
|
155643
|
+
const claudeDir = path63.join(homeDir, ".claude");
|
|
155644
|
+
if (fs32.existsSync(claudeDir)) {
|
|
155315
155645
|
return { label: "Claude looks configured", status: "info", detail: claudeDir };
|
|
155316
155646
|
}
|
|
155317
155647
|
return {
|
|
@@ -155401,10 +155731,10 @@ function checkFileDescriptors(softLimit) {
|
|
|
155401
155731
|
};
|
|
155402
155732
|
}
|
|
155403
155733
|
function checkDevLinks(dorkHome) {
|
|
155404
|
-
const file2 =
|
|
155734
|
+
const file2 = path63.join(dorkHome, DEV_LINKS_FILE);
|
|
155405
155735
|
let text3;
|
|
155406
155736
|
try {
|
|
155407
|
-
text3 =
|
|
155737
|
+
text3 = fs32.readFileSync(file2, "utf-8");
|
|
155408
155738
|
} catch (err) {
|
|
155409
155739
|
if (err.code === "ENOENT") {
|
|
155410
155740
|
return judgeDevLinks({ entries: [] }, { paths: true });
|
|
@@ -155430,7 +155760,7 @@ function devLinkStateSync(record2) {
|
|
|
155430
155760
|
let lstatIsLink = false;
|
|
155431
155761
|
let present = false;
|
|
155432
155762
|
try {
|
|
155433
|
-
lstatIsLink =
|
|
155763
|
+
lstatIsLink = fs32.lstatSync(record2.slot).isSymbolicLink();
|
|
155434
155764
|
present = true;
|
|
155435
155765
|
} catch (err) {
|
|
155436
155766
|
const code = err.code;
|
|
@@ -155438,15 +155768,15 @@ function devLinkStateSync(record2) {
|
|
|
155438
155768
|
}
|
|
155439
155769
|
let realpathOfSlot = null;
|
|
155440
155770
|
try {
|
|
155441
|
-
realpathOfSlot =
|
|
155771
|
+
realpathOfSlot = fs32.realpathSync(record2.slot);
|
|
155442
155772
|
} catch {
|
|
155443
155773
|
}
|
|
155444
155774
|
if (isActiveDevLink(record2, { lstatIsLink, realpathOfSlot })) return "active";
|
|
155445
155775
|
if (!present) return "link-missing";
|
|
155446
155776
|
if (lstatIsLink && realpathOfSlot === null) {
|
|
155447
155777
|
try {
|
|
155448
|
-
const text3 =
|
|
155449
|
-
if (
|
|
155778
|
+
const text3 = fs32.readlinkSync(record2.slot);
|
|
155779
|
+
if (path63.resolve(path63.dirname(record2.slot), text3) === record2.target) return "folder-missing";
|
|
155450
155780
|
} catch {
|
|
155451
155781
|
}
|
|
155452
155782
|
}
|
|
@@ -155566,9 +155896,9 @@ __export(doctor_exports, {
|
|
|
155566
155896
|
runDoctor: () => runDoctor,
|
|
155567
155897
|
withCleanStdout: () => withCleanStdout
|
|
155568
155898
|
});
|
|
155569
|
-
import
|
|
155899
|
+
import fs33 from "node:fs";
|
|
155570
155900
|
import os9 from "node:os";
|
|
155571
|
-
import
|
|
155901
|
+
import path64 from "node:path";
|
|
155572
155902
|
function parseDoctorArgs(rawArgs) {
|
|
155573
155903
|
const usage = "Usage: dorkos doctor [--json] [--deep]";
|
|
155574
155904
|
const args = { json: false, deep: false };
|
|
@@ -155625,7 +155955,7 @@ function configFailureCheck(err, dorkHome) {
|
|
|
155625
155955
|
label: "Your settings could not be used",
|
|
155626
155956
|
status: "fail",
|
|
155627
155957
|
detail: describeConfigFailure(err),
|
|
155628
|
-
fix: `DorkOS did not replace or delete the file: ${
|
|
155958
|
+
fix: `DorkOS did not replace or delete the file: ${path64.join(dorkHome, "config.json")}
|
|
155629
155959
|
Everything below was checked against the built-in defaults instead.
|
|
155630
155960
|
` + adviceFrom(err)
|
|
155631
155961
|
};
|
|
@@ -155671,7 +156001,7 @@ async function gatherResults(dorkHome, store) {
|
|
|
155671
156001
|
checkDevLinks(dorkHome),
|
|
155672
156002
|
checkAuthConfig({
|
|
155673
156003
|
authEnabled: readBool(store, "auth.enabled", false),
|
|
155674
|
-
secretFileExists:
|
|
156004
|
+
secretFileExists: fs33.existsSync(path64.join(dorkHome, SECRET_FILE_NAME2)),
|
|
155675
156005
|
// eslint-disable-next-line no-restricted-syntax -- reading an operator env override, matching secret.ts
|
|
155676
156006
|
secretEnvSet: Boolean(process.env.BETTER_AUTH_SECRET?.trim())
|
|
155677
156007
|
}),
|
|
@@ -156121,13 +156451,13 @@ function assertHasProtocol(url2) {
|
|
|
156121
156451
|
throw new BetterAuthError(`Invalid base URL: ${url2}. Please provide a valid base URL.`, { cause: error63 });
|
|
156122
156452
|
}
|
|
156123
156453
|
}
|
|
156124
|
-
function withPath2(url2,
|
|
156454
|
+
function withPath2(url2, path74 = "/api/auth") {
|
|
156125
156455
|
assertHasProtocol(url2);
|
|
156126
156456
|
if (checkHasPath(url2)) return url2;
|
|
156127
156457
|
const trimmedUrl = trimTrailingSlashes(url2);
|
|
156128
|
-
if (!
|
|
156129
|
-
|
|
156130
|
-
return `${trimmedUrl}${
|
|
156458
|
+
if (!path74 || path74 === "/") return trimmedUrl;
|
|
156459
|
+
path74 = path74.startsWith("/") ? path74 : `/${path74}`;
|
|
156460
|
+
return `${trimmedUrl}${path74}`;
|
|
156131
156461
|
}
|
|
156132
156462
|
function validateProxyHeader(header, type2) {
|
|
156133
156463
|
if (!header || header.trim() === "") return false;
|
|
@@ -156147,26 +156477,26 @@ function validateProxyHeader(header, type2) {
|
|
|
156147
156477
|
}
|
|
156148
156478
|
return false;
|
|
156149
156479
|
}
|
|
156150
|
-
function getBaseURL(url2,
|
|
156151
|
-
if (url2) return withPath2(url2,
|
|
156480
|
+
function getBaseURL(url2, path74, request, loadEnv, trustedProxyHeaders) {
|
|
156481
|
+
if (url2) return withPath2(url2, path74);
|
|
156152
156482
|
if (loadEnv !== false) {
|
|
156153
156483
|
const fromEnv = env5.BETTER_AUTH_URL || env5.NEXT_PUBLIC_BETTER_AUTH_URL || env5.PUBLIC_BETTER_AUTH_URL || env5.NUXT_PUBLIC_BETTER_AUTH_URL || env5.NUXT_PUBLIC_AUTH_URL || (env5.BASE_URL !== "/" ? env5.BASE_URL : void 0);
|
|
156154
|
-
if (fromEnv) return withPath2(fromEnv,
|
|
156484
|
+
if (fromEnv) return withPath2(fromEnv, path74);
|
|
156155
156485
|
}
|
|
156156
156486
|
const fromRequest = request?.headers.get("x-forwarded-host");
|
|
156157
156487
|
const fromRequestProto = request?.headers.get("x-forwarded-proto");
|
|
156158
156488
|
if (fromRequest && fromRequestProto && trustedProxyHeaders) {
|
|
156159
156489
|
if (validateProxyHeader(fromRequestProto, "proto") && validateProxyHeader(fromRequest, "host")) try {
|
|
156160
|
-
return withPath2(`${fromRequestProto}://${fromRequest}`,
|
|
156490
|
+
return withPath2(`${fromRequestProto}://${fromRequest}`, path74);
|
|
156161
156491
|
} catch (_error) {
|
|
156162
156492
|
}
|
|
156163
156493
|
}
|
|
156164
156494
|
if (request) {
|
|
156165
156495
|
const url3 = getOrigin(request.url);
|
|
156166
156496
|
if (!url3) throw new BetterAuthError("Could not get origin from request. Please provide a valid base URL.");
|
|
156167
|
-
return withPath2(url3,
|
|
156497
|
+
return withPath2(url3, path74);
|
|
156168
156498
|
}
|
|
156169
|
-
if (typeof window !== "undefined" && window.location) return withPath2(window.location.origin,
|
|
156499
|
+
if (typeof window !== "undefined" && window.location) return withPath2(window.location.origin, path74);
|
|
156170
156500
|
}
|
|
156171
156501
|
function getOrigin(url2) {
|
|
156172
156502
|
try {
|
|
@@ -156757,9 +157087,9 @@ function parseCookieCachePayload(value) {
|
|
|
156757
157087
|
if (parsed === null) return null;
|
|
156758
157088
|
const result2 = cookieCachePayloadSchema.safeParse(parsed);
|
|
156759
157089
|
if (result2.success) return result2.data;
|
|
156760
|
-
logger2.warn("Cookie cache payload failed schema validation", { issues: result2.error.issues.map(({ code, path:
|
|
157090
|
+
logger2.warn("Cookie cache payload failed schema validation", { issues: result2.error.issues.map(({ code, path: path74 }) => ({
|
|
156761
157091
|
code,
|
|
156762
|
-
path:
|
|
157092
|
+
path: path74
|
|
156763
157093
|
})) });
|
|
156764
157094
|
return null;
|
|
156765
157095
|
}
|
|
@@ -157556,10 +157886,10 @@ var init_trusted_origins2 = __esm({
|
|
|
157556
157886
|
CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f-\u009f]/;
|
|
157557
157887
|
RELATIVE_URL_PARSER_ORIGIN = "https://better-auth.invalid";
|
|
157558
157888
|
ENCODED_PATH_SEPARATOR_PATTERN = /%2[fF]|%5[cC]/;
|
|
157559
|
-
normalizePath3 = (
|
|
157560
|
-
let decoded =
|
|
157889
|
+
normalizePath3 = (path74) => {
|
|
157890
|
+
let decoded = path74;
|
|
157561
157891
|
try {
|
|
157562
|
-
decoded = decodeURIComponent(
|
|
157892
|
+
decoded = decodeURIComponent(path74);
|
|
157563
157893
|
} catch {
|
|
157564
157894
|
}
|
|
157565
157895
|
const segments = [];
|
|
@@ -157586,18 +157916,18 @@ var init_trusted_origins2 = __esm({
|
|
|
157586
157916
|
}
|
|
157587
157917
|
}
|
|
157588
157918
|
const pathEnd = rest.search(/[?#]/);
|
|
157589
|
-
const
|
|
157919
|
+
const path74 = normalizePath3(pathEnd === -1 ? rest : rest.slice(0, pathEnd));
|
|
157590
157920
|
return {
|
|
157591
157921
|
scheme,
|
|
157592
157922
|
authority: authority.toLowerCase(),
|
|
157593
|
-
path:
|
|
157923
|
+
path: path74
|
|
157594
157924
|
};
|
|
157595
157925
|
};
|
|
157596
157926
|
isSafeRelativeURL = (value) => {
|
|
157597
157927
|
if (!value.startsWith("/") || value.startsWith("//") || value.includes("\\") || CONTROL_CHARACTER_PATTERN.test(value)) return false;
|
|
157598
157928
|
const pathEnd = value.search(/[?#]/);
|
|
157599
|
-
const
|
|
157600
|
-
if (ENCODED_PATH_SEPARATOR_PATTERN.test(
|
|
157929
|
+
const path74 = pathEnd === -1 ? value : value.slice(0, pathEnd);
|
|
157930
|
+
if (ENCODED_PATH_SEPARATOR_PATTERN.test(path74)) return false;
|
|
157601
157931
|
try {
|
|
157602
157932
|
return new URL(value, RELATIVE_URL_PARSER_ORIGIN).origin === RELATIVE_URL_PARSER_ORIGIN;
|
|
157603
157933
|
} catch {
|
|
@@ -157981,7 +158311,7 @@ function getRateLimitStorage(ctx, rateLimitSettings) {
|
|
|
157981
158311
|
}
|
|
157982
158312
|
async function resolveRateLimitConfig(req, ctx) {
|
|
157983
158313
|
const basePath = new URL(ctx.baseURL).pathname;
|
|
157984
|
-
const
|
|
158314
|
+
const path74 = normalizePathname(req.url, basePath);
|
|
157985
158315
|
let currentWindow = ctx.rateLimit.window;
|
|
157986
158316
|
let currentMax = ctx.rateLimit.max;
|
|
157987
158317
|
const ip = getIP(req, ctx.options);
|
|
@@ -157990,14 +158320,14 @@ async function resolveRateLimitConfig(req, ctx) {
|
|
|
157990
158320
|
ctx.logger.warn("Rate limiting could not determine a client IP and is falling back to a single shared per-path bucket. Ensure your runtime forwards a trusted client IP header, then set `advanced.ipAddress.ipAddressHeaders` or `advanced.ipAddress.trustedProxies` so the address can be resolved.");
|
|
157991
158321
|
ipWarningLogged = true;
|
|
157992
158322
|
}
|
|
157993
|
-
const key = createRateLimitKey(ip ?? NO_TRUSTED_IP_KEY,
|
|
157994
|
-
const specialRule = getDefaultSpecialRules().find((rule) => rule.pathMatcher(
|
|
158323
|
+
const key = createRateLimitKey(ip ?? NO_TRUSTED_IP_KEY, path74);
|
|
158324
|
+
const specialRule = getDefaultSpecialRules().find((rule) => rule.pathMatcher(path74));
|
|
157995
158325
|
if (specialRule) {
|
|
157996
158326
|
currentWindow = specialRule.window;
|
|
157997
158327
|
currentMax = specialRule.max;
|
|
157998
158328
|
}
|
|
157999
158329
|
for (const plugin of ctx.options.plugins || []) if (plugin.rateLimit) {
|
|
158000
|
-
const matchedRule = plugin.rateLimit.find((rule) => rule.pathMatcher(
|
|
158330
|
+
const matchedRule = plugin.rateLimit.find((rule) => rule.pathMatcher(path74));
|
|
158001
158331
|
if (matchedRule) {
|
|
158002
158332
|
currentWindow = matchedRule.window;
|
|
158003
158333
|
currentMax = matchedRule.max;
|
|
@@ -158006,8 +158336,8 @@ async function resolveRateLimitConfig(req, ctx) {
|
|
|
158006
158336
|
}
|
|
158007
158337
|
if (ctx.rateLimit.customRules) {
|
|
158008
158338
|
const _path = Object.keys(ctx.rateLimit.customRules).find((p) => {
|
|
158009
|
-
if (p.includes("*")) return wildcardMatch(p)(
|
|
158010
|
-
return p ===
|
|
158339
|
+
if (p.includes("*")) return wildcardMatch(p)(path74);
|
|
158340
|
+
return p === path74;
|
|
158011
158341
|
});
|
|
158012
158342
|
if (_path) {
|
|
158013
158343
|
const customRule = ctx.rateLimit.customRules[_path];
|
|
@@ -158043,14 +158373,14 @@ async function onRequestRateLimit(req, ctx) {
|
|
|
158043
158373
|
}
|
|
158044
158374
|
function getDefaultSpecialRules() {
|
|
158045
158375
|
return [{
|
|
158046
|
-
pathMatcher(
|
|
158047
|
-
return
|
|
158376
|
+
pathMatcher(path74) {
|
|
158377
|
+
return path74.startsWith("/sign-in") || path74.startsWith("/sign-up") || path74.startsWith("/change-password") || path74.startsWith("/change-email");
|
|
158048
158378
|
},
|
|
158049
158379
|
window: 10,
|
|
158050
158380
|
max: 3
|
|
158051
158381
|
}, {
|
|
158052
|
-
pathMatcher(
|
|
158053
|
-
return
|
|
158382
|
+
pathMatcher(path74) {
|
|
158383
|
+
return path74 === "/request-password-reset" || path74 === "/send-verification-email" || path74.startsWith("/forget-password") || path74 === "/email-otp/send-verification-otp" || path74 === "/email-otp/request-password-reset";
|
|
158054
158384
|
},
|
|
158055
158385
|
window: 60,
|
|
158056
158386
|
max: 3
|
|
@@ -163756,15 +164086,15 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
163756
164086
|
options.plugins?.forEach((plugin) => {
|
|
163757
164087
|
if (plugin.endpoints) {
|
|
163758
164088
|
for (const [key, endpoint] of Object.entries(plugin.endpoints)) if (endpoint && "path" in endpoint && typeof endpoint.path === "string") {
|
|
163759
|
-
const
|
|
164089
|
+
const path74 = endpoint.path;
|
|
163760
164090
|
let methods2 = [];
|
|
163761
164091
|
if (endpoint.options && "method" in endpoint.options) {
|
|
163762
164092
|
if (Array.isArray(endpoint.options.method)) methods2 = endpoint.options.method;
|
|
163763
164093
|
else if (typeof endpoint.options.method === "string") methods2 = [endpoint.options.method];
|
|
163764
164094
|
}
|
|
163765
164095
|
if (methods2.length === 0) methods2 = ["*"];
|
|
163766
|
-
if (!endpointRegistry.has(
|
|
163767
|
-
endpointRegistry.get(
|
|
164096
|
+
if (!endpointRegistry.has(path74)) endpointRegistry.set(path74, []);
|
|
164097
|
+
endpointRegistry.get(path74).push({
|
|
163768
164098
|
pluginId: plugin.id,
|
|
163769
164099
|
endpointKey: key,
|
|
163770
164100
|
methods: methods2
|
|
@@ -163773,7 +164103,7 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
163773
164103
|
}
|
|
163774
164104
|
});
|
|
163775
164105
|
const conflicts = [];
|
|
163776
|
-
for (const [
|
|
164106
|
+
for (const [path74, entries] of endpointRegistry.entries()) if (entries.length > 1) {
|
|
163777
164107
|
const methodMap = /* @__PURE__ */ new Map();
|
|
163778
164108
|
let hasConflict = false;
|
|
163779
164109
|
for (const entry of entries) for (const method of entry.methods) {
|
|
@@ -163788,7 +164118,7 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
163788
164118
|
const conflictingMethods = [];
|
|
163789
164119
|
for (const [method, plugins] of methodMap.entries()) if (plugins.length > 1 || method === "*" && entries.length > 1 || method !== "*" && methodMap.has("*")) conflictingMethods.push(method);
|
|
163790
164120
|
conflicts.push({
|
|
163791
|
-
path:
|
|
164121
|
+
path: path74,
|
|
163792
164122
|
plugins: uniquePlugins,
|
|
163793
164123
|
conflictingMethods
|
|
163794
164124
|
});
|
|
@@ -173376,13 +173706,13 @@ __export(ended_standing_grants_exports, {
|
|
|
173376
173706
|
readStandingGrantLicence: () => readStandingGrantLicence,
|
|
173377
173707
|
recordEndedStandingGrants: () => recordEndedStandingGrants
|
|
173378
173708
|
});
|
|
173379
|
-
import
|
|
173709
|
+
import fs34 from "node:fs/promises";
|
|
173380
173710
|
import { readFileSync as readFileSync25, writeFileSync as writeFileSync4, renameSync as renameSync4 } from "node:fs";
|
|
173381
|
-
import
|
|
173711
|
+
import path65 from "node:path";
|
|
173382
173712
|
function readStandingGrantLicence(dorkHome) {
|
|
173383
173713
|
let config3;
|
|
173384
173714
|
try {
|
|
173385
|
-
config3 = JSON.parse(readFileSync25(
|
|
173715
|
+
config3 = JSON.parse(readFileSync25(path65.join(dorkHome, "config.json"), "utf-8"));
|
|
173386
173716
|
} catch {
|
|
173387
173717
|
return NO_LICENCE;
|
|
173388
173718
|
}
|
|
@@ -173425,7 +173755,7 @@ function captureLiveStandingGrants(db2, dorkHome, logger3, licence, now3 = /* @_
|
|
|
173425
173755
|
capabilityId: row2.capability_id,
|
|
173426
173756
|
expiresAt: row2.expires_at
|
|
173427
173757
|
}));
|
|
173428
|
-
const file2 =
|
|
173758
|
+
const file2 = path65.join(dorkHome, ENDED_STANDING_GRANTS_FILE);
|
|
173429
173759
|
const existing = readCaptured(file2);
|
|
173430
173760
|
const byId = new Map([...existing, ...grants].map((grant) => [grant.id, grant]));
|
|
173431
173761
|
const tmp = `${file2}.tmp`;
|
|
@@ -173457,16 +173787,16 @@ function readCaptured(file2) {
|
|
|
173457
173787
|
}
|
|
173458
173788
|
}
|
|
173459
173789
|
async function recordEndedStandingGrants(deps) {
|
|
173460
|
-
const file2 =
|
|
173790
|
+
const file2 = path65.join(deps.dorkHome, ENDED_STANDING_GRANTS_FILE);
|
|
173461
173791
|
const grants = readCaptured(file2);
|
|
173462
173792
|
if (grants.length === 0) {
|
|
173463
|
-
await
|
|
173793
|
+
await fs34.rm(file2, { force: true });
|
|
173464
173794
|
return 0;
|
|
173465
173795
|
}
|
|
173466
173796
|
const agents2 = new Map(deps.agents().map((agent) => [agent.projectPath, agent]));
|
|
173467
173797
|
for (const grant of grants) {
|
|
173468
173798
|
const agent = agents2.get(grant.agentPath);
|
|
173469
|
-
const name2 = agent ? agent.displayName || agent.name :
|
|
173799
|
+
const name2 = agent ? agent.displayName || agent.name : path65.basename(grant.agentPath);
|
|
173470
173800
|
const title = deps.actionTitle(grant.capabilityId);
|
|
173471
173801
|
await deps.activity.emit({
|
|
173472
173802
|
actorType: UPGRADE_WRITER.actorType,
|
|
@@ -173490,7 +173820,7 @@ async function recordEndedStandingGrants(deps) {
|
|
|
173490
173820
|
});
|
|
173491
173821
|
}
|
|
173492
173822
|
try {
|
|
173493
|
-
await
|
|
173823
|
+
await fs34.rm(file2, { force: true });
|
|
173494
173824
|
} catch (err) {
|
|
173495
173825
|
deps.logger.warn("[Permissions] could not remove the ended standing permissions file", {
|
|
173496
173826
|
err: err instanceof Error ? err.message : String(err)
|
|
@@ -173509,12 +173839,12 @@ var init_ended_standing_grants = __esm({
|
|
|
173509
173839
|
});
|
|
173510
173840
|
|
|
173511
173841
|
// src/commands/auth-runtime.ts
|
|
173512
|
-
import
|
|
173842
|
+
import path66 from "node:path";
|
|
173513
173843
|
import { mkdirSync as mkdirSync8, readFileSync as readFileSync26 } from "node:fs";
|
|
173514
173844
|
import { input as input2, password as passwordPrompt } from "@inquirer/prompts";
|
|
173515
173845
|
async function buildAuthRuntime(dorkHome) {
|
|
173516
173846
|
mkdirSync8(dorkHome, { recursive: true });
|
|
173517
|
-
const db2 = createDb(
|
|
173847
|
+
const db2 = createDb(path66.join(dorkHome, "dork.db"));
|
|
173518
173848
|
const { captureLiveStandingGrants: captureLiveStandingGrants2, readStandingGrantLicence: readStandingGrantLicence2 } = await Promise.resolve().then(() => (init_ended_standing_grants(), ended_standing_grants_exports));
|
|
173519
173849
|
captureLiveStandingGrants2(db2, dorkHome, console, readStandingGrantLicence2(dorkHome));
|
|
173520
173850
|
runMigrations(db2);
|
|
@@ -175603,19 +175933,19 @@ var init_cloud_link_client = __esm({
|
|
|
175603
175933
|
|
|
175604
175934
|
// ../../apps/server/src/lib/instance-id.ts
|
|
175605
175935
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
175606
|
-
import
|
|
175607
|
-
import
|
|
175936
|
+
import fs35 from "node:fs/promises";
|
|
175937
|
+
import path67 from "node:path";
|
|
175608
175938
|
async function getOrCreateInstanceId(dorkHome) {
|
|
175609
|
-
const filePath =
|
|
175939
|
+
const filePath = path67.join(dorkHome, INSTANCE_ID_FILENAME2);
|
|
175610
175940
|
try {
|
|
175611
|
-
const existing = await
|
|
175941
|
+
const existing = await fs35.readFile(filePath, "utf8");
|
|
175612
175942
|
const trimmed = existing.trim();
|
|
175613
175943
|
if (trimmed) return trimmed;
|
|
175614
175944
|
} catch {
|
|
175615
175945
|
}
|
|
175616
175946
|
const id = randomUUID8();
|
|
175617
|
-
await
|
|
175618
|
-
await
|
|
175947
|
+
await fs35.mkdir(dorkHome, { recursive: true });
|
|
175948
|
+
await fs35.writeFile(filePath, id, "utf8");
|
|
175619
175949
|
return id;
|
|
175620
175950
|
}
|
|
175621
175951
|
var INSTANCE_ID_FILENAME2;
|
|
@@ -176486,14 +176816,14 @@ function parseAgentCreateArgs(rawArgs) {
|
|
|
176486
176816
|
}
|
|
176487
176817
|
const { values: values2 } = parsed;
|
|
176488
176818
|
const name2 = typeof values2.name === "string" ? values2.name : void 0;
|
|
176489
|
-
const
|
|
176819
|
+
const path74 = typeof values2.path === "string" ? values2.path : void 0;
|
|
176490
176820
|
if (!name2) throw new Error(`Missing required --name.
|
|
176491
176821
|
${usage}`);
|
|
176492
|
-
if (!
|
|
176822
|
+
if (!path74) throw new Error(`Missing required --path.
|
|
176493
176823
|
${usage}`);
|
|
176494
176824
|
return {
|
|
176495
176825
|
name: name2,
|
|
176496
|
-
path:
|
|
176826
|
+
path: path74,
|
|
176497
176827
|
template: typeof values2.template === "string" ? values2.template : void 0,
|
|
176498
176828
|
displayName: typeof values2["display-name"] === "string" ? values2["display-name"] : void 0,
|
|
176499
176829
|
description: typeof values2.description === "string" ? values2.description : void 0,
|
|
@@ -176543,12 +176873,12 @@ function parseAgentUpdateArgs(rawArgs) {
|
|
|
176543
176873
|
rethrowUnknownOption(err, "agent update", usage);
|
|
176544
176874
|
}
|
|
176545
176875
|
const { values: values2 } = parsed;
|
|
176546
|
-
const
|
|
176547
|
-
if (!
|
|
176876
|
+
const path74 = typeof values2.path === "string" ? values2.path : void 0;
|
|
176877
|
+
if (!path74) throw new Error(`Missing required --path.
|
|
176548
176878
|
${usage}`);
|
|
176549
176879
|
const clearable = (v2) => typeof v2 === "string" ? v2.length === 0 ? null : v2 : void 0;
|
|
176550
176880
|
return {
|
|
176551
|
-
path:
|
|
176881
|
+
path: path74,
|
|
176552
176882
|
displayName: typeof values2["display-name"] === "string" ? values2["display-name"] : void 0,
|
|
176553
176883
|
description: typeof values2.description === "string" ? values2.description : void 0,
|
|
176554
176884
|
color: clearable(values2.color),
|
|
@@ -177122,8 +177452,8 @@ __export(room_exports, {
|
|
|
177122
177452
|
runRoomExport: () => runRoomExport
|
|
177123
177453
|
});
|
|
177124
177454
|
import { parseArgs as parseArgs30 } from "node:util";
|
|
177125
|
-
import
|
|
177126
|
-
import
|
|
177455
|
+
import fs36 from "node:fs";
|
|
177456
|
+
import path68 from "node:path";
|
|
177127
177457
|
import { Readable } from "node:stream";
|
|
177128
177458
|
import { finished as finished2, pipeline } from "node:stream/promises";
|
|
177129
177459
|
function parseRoomExportArgs(rawArgs) {
|
|
@@ -177175,7 +177505,7 @@ async function resolveRoomId(reference) {
|
|
|
177175
177505
|
}
|
|
177176
177506
|
function suggestedFilename(disposition, roomId) {
|
|
177177
177507
|
const match = disposition?.match(/filename="([^"]+)"/);
|
|
177178
|
-
const name2 = match ?
|
|
177508
|
+
const name2 = match ? path68.basename(match[1]) : "";
|
|
177179
177509
|
return name2 && name2 !== "." && name2 !== ".." ? name2 : `room-${roomId}.jsonl`;
|
|
177180
177510
|
}
|
|
177181
177511
|
async function streamExport(body, destination, closeDestination) {
|
|
@@ -177209,18 +177539,18 @@ async function streamExport(body, destination, closeDestination) {
|
|
|
177209
177539
|
return { entryCount: null, reason };
|
|
177210
177540
|
}
|
|
177211
177541
|
async function writeExportFile(body, target) {
|
|
177212
|
-
const staging =
|
|
177213
|
-
const scratch =
|
|
177542
|
+
const staging = fs36.mkdtempSync(path68.join(path68.dirname(target), ".dorkos-export-"));
|
|
177543
|
+
const scratch = path68.join(staging, path68.basename(target));
|
|
177214
177544
|
let file2;
|
|
177215
177545
|
try {
|
|
177216
|
-
file2 =
|
|
177546
|
+
file2 = fs36.createWriteStream(scratch);
|
|
177217
177547
|
const outcome = await streamExport(body, file2, true);
|
|
177218
|
-
if (outcome.entryCount !== null)
|
|
177548
|
+
if (outcome.entryCount !== null) fs36.renameSync(scratch, target);
|
|
177219
177549
|
return outcome;
|
|
177220
177550
|
} finally {
|
|
177221
177551
|
if (file2) await finished2(file2).catch(() => {
|
|
177222
177552
|
});
|
|
177223
|
-
|
|
177553
|
+
fs36.rmSync(staging, { recursive: true, force: true });
|
|
177224
177554
|
}
|
|
177225
177555
|
}
|
|
177226
177556
|
async function runRoomExport(args) {
|
|
@@ -177231,10 +177561,10 @@ async function runRoomExport(args) {
|
|
|
177231
177561
|
const toStdout = args.out === STDOUT_TARGET;
|
|
177232
177562
|
let target = null;
|
|
177233
177563
|
if (!toStdout) {
|
|
177234
|
-
target =
|
|
177564
|
+
target = path68.resolve(
|
|
177235
177565
|
args.out ?? suggestedFilename(res.headers.get("content-disposition"), roomId)
|
|
177236
177566
|
);
|
|
177237
|
-
if (!args.force &&
|
|
177567
|
+
if (!args.force && fs36.existsSync(target)) {
|
|
177238
177568
|
console.error(`Error: ${target} already exists. Pass --force to replace it.`);
|
|
177239
177569
|
return 1;
|
|
177240
177570
|
}
|
|
@@ -177428,7 +177758,7 @@ var init_connector_schemas2 = __esm({
|
|
|
177428
177758
|
});
|
|
177429
177759
|
|
|
177430
177760
|
// src/commands/connections-args.ts
|
|
177431
|
-
import
|
|
177761
|
+
import fs37 from "node:fs";
|
|
177432
177762
|
function requireNonblank(value, flag, usage) {
|
|
177433
177763
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
177434
177764
|
throw new Error(`Missing required ${flag} value.
|
|
@@ -177451,7 +177781,7 @@ ${usage}`);
|
|
|
177451
177781
|
if (typeof inline === "string") raw = inline;
|
|
177452
177782
|
if (typeof file2 === "string") {
|
|
177453
177783
|
try {
|
|
177454
|
-
raw =
|
|
177784
|
+
raw = fs37.readFileSync(file2 === "-" ? 0 : file2, "utf8");
|
|
177455
177785
|
} catch (error63) {
|
|
177456
177786
|
throw new Error(
|
|
177457
177787
|
`Cannot read ${fileFlag} '${file2}': ${error63 instanceof Error ? error63.message : String(error63)}`,
|
|
@@ -178413,7 +178743,7 @@ __export(call_exports, {
|
|
|
178413
178743
|
parseCallArgs: () => parseCallArgs2,
|
|
178414
178744
|
runCall: () => runCall2
|
|
178415
178745
|
});
|
|
178416
|
-
import
|
|
178746
|
+
import fs38 from "node:fs";
|
|
178417
178747
|
import { parseArgs as parseArgs34 } from "node:util";
|
|
178418
178748
|
function parseCallArgs2(rawArgs) {
|
|
178419
178749
|
const usage = "Usage: dorkos call <capability-id> [--input <json> | --input-file <path>]";
|
|
@@ -178450,7 +178780,7 @@ ${usage}`);
|
|
|
178450
178780
|
rawInput = inline;
|
|
178451
178781
|
} else if (file2 !== void 0) {
|
|
178452
178782
|
try {
|
|
178453
|
-
rawInput =
|
|
178783
|
+
rawInput = fs38.readFileSync(file2 === "-" ? 0 : file2, "utf-8");
|
|
178454
178784
|
} catch (err) {
|
|
178455
178785
|
throw new Error(
|
|
178456
178786
|
`Cannot read --input-file '${file2}': ${err instanceof Error ? err.message : String(err)}`,
|
|
@@ -178554,8 +178884,8 @@ __export(version_exports, {
|
|
|
178554
178884
|
runVersionCheck: () => runVersionCheck,
|
|
178555
178885
|
runVersionDispatcher: () => runVersionDispatcher
|
|
178556
178886
|
});
|
|
178557
|
-
import
|
|
178558
|
-
import
|
|
178887
|
+
import fs39 from "node:fs";
|
|
178888
|
+
import path69 from "node:path";
|
|
178559
178889
|
import { parseArgs as parseArgs35 } from "node:util";
|
|
178560
178890
|
function parseVersionArgs(rawArgs) {
|
|
178561
178891
|
const usage = "Usage: dorkos version [--check] [--json]";
|
|
@@ -178577,7 +178907,7 @@ function parseVersionArgs(rawArgs) {
|
|
|
178577
178907
|
}
|
|
178578
178908
|
function readCachedLatest(dorkHome) {
|
|
178579
178909
|
try {
|
|
178580
|
-
const raw =
|
|
178910
|
+
const raw = fs39.readFileSync(path69.join(dorkHome, "cache", "update-check.json"), "utf-8");
|
|
178581
178911
|
const cache3 = JSON.parse(raw);
|
|
178582
178912
|
return typeof cache3.latestVersion === "string" ? cache3.latestVersion : null;
|
|
178583
178913
|
} catch {
|
|
@@ -178671,12 +179001,12 @@ __export(cleanup_command_exports, {
|
|
|
178671
179001
|
runCleanup: () => runCleanup
|
|
178672
179002
|
});
|
|
178673
179003
|
import { confirm as confirm2 } from "@inquirer/prompts";
|
|
178674
|
-
import
|
|
178675
|
-
import
|
|
179004
|
+
import fs40 from "fs";
|
|
179005
|
+
import path70 from "path";
|
|
178676
179006
|
import http from "node:http";
|
|
178677
179007
|
function readPort(dorkHome) {
|
|
178678
179008
|
try {
|
|
178679
|
-
const raw =
|
|
179009
|
+
const raw = fs40.readFileSync(path70.join(dorkHome, "config.json"), "utf-8");
|
|
178680
179010
|
const config3 = JSON.parse(raw);
|
|
178681
179011
|
const port2 = config3?.server?.port;
|
|
178682
179012
|
if (typeof port2 === "number" && port2 > 0) return port2;
|
|
@@ -178703,7 +179033,7 @@ async function findProjectPaths(dbPath) {
|
|
|
178703
179033
|
const db2 = new Database3(dbPath, { readonly: true });
|
|
178704
179034
|
try {
|
|
178705
179035
|
const rows = db2.prepare("SELECT DISTINCT project_path FROM agents").all();
|
|
178706
|
-
return rows.map((r3) => r3.project_path).filter((p) =>
|
|
179036
|
+
return rows.map((r3) => r3.project_path).filter((p) => fs40.existsSync(path70.join(p, ".dork")));
|
|
178707
179037
|
} finally {
|
|
178708
179038
|
db2.close();
|
|
178709
179039
|
}
|
|
@@ -178713,7 +179043,7 @@ async function findProjectPaths(dbPath) {
|
|
|
178713
179043
|
}
|
|
178714
179044
|
async function runCleanup(options) {
|
|
178715
179045
|
const { dorkHome } = options;
|
|
178716
|
-
if (!
|
|
179046
|
+
if (!fs40.existsSync(dorkHome)) {
|
|
178717
179047
|
console.log("\nNo DorkOS data found. Nothing to clean up.\n");
|
|
178718
179048
|
return;
|
|
178719
179049
|
}
|
|
@@ -178726,7 +179056,7 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
178726
179056
|
return;
|
|
178727
179057
|
}
|
|
178728
179058
|
console.log("\nDorkOS Cleanup\n");
|
|
178729
|
-
const entries =
|
|
179059
|
+
const entries = fs40.readdirSync(dorkHome);
|
|
178730
179060
|
if (entries.length === 0) {
|
|
178731
179061
|
console.log("No DorkOS data found. Nothing to clean up.\n");
|
|
178732
179062
|
return;
|
|
@@ -178737,8 +179067,8 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
178737
179067
|
console.log(` ${entry.padEnd(20)} (${description})`);
|
|
178738
179068
|
}
|
|
178739
179069
|
console.log("");
|
|
178740
|
-
const dbPath =
|
|
178741
|
-
const projectPaths =
|
|
179070
|
+
const dbPath = path70.join(dorkHome, "dork.db");
|
|
179071
|
+
const projectPaths = fs40.existsSync(dbPath) ? await findProjectPaths(dbPath) : [];
|
|
178742
179072
|
const removeGlobal = await confirm2({
|
|
178743
179073
|
message: `Remove global DorkOS data (${dorkHome})?`,
|
|
178744
179074
|
default: false
|
|
@@ -178747,7 +179077,7 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
178747
179077
|
console.log("\n Aborted.\n");
|
|
178748
179078
|
return;
|
|
178749
179079
|
}
|
|
178750
|
-
|
|
179080
|
+
fs40.rmSync(dorkHome, { recursive: true, force: true });
|
|
178751
179081
|
console.log(`
|
|
178752
179082
|
Removed ${dorkHome}
|
|
178753
179083
|
`);
|
|
@@ -178763,8 +179093,8 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
178763
179093
|
});
|
|
178764
179094
|
if (removeProjects) {
|
|
178765
179095
|
for (const p of projectPaths) {
|
|
178766
|
-
const dorkDir =
|
|
178767
|
-
|
|
179096
|
+
const dorkDir = path70.join(p, ".dork");
|
|
179097
|
+
fs40.rmSync(dorkDir, { recursive: true, force: true });
|
|
178768
179098
|
console.log(` Removed ${dorkDir}`);
|
|
178769
179099
|
}
|
|
178770
179100
|
console.log("");
|
|
@@ -178799,9 +179129,9 @@ __export(config_write_exports2, {
|
|
|
178799
179129
|
createServerConfigWriter: () => createServerConfigWriter,
|
|
178800
179130
|
writeOrExplain: () => writeOrExplain
|
|
178801
179131
|
});
|
|
178802
|
-
import
|
|
179132
|
+
import path71 from "path";
|
|
178803
179133
|
async function openAuditLog(dorkHome, level) {
|
|
178804
|
-
const logDir2 =
|
|
179134
|
+
const logDir2 = path71.join(dorkHome, "logs");
|
|
178805
179135
|
try {
|
|
178806
179136
|
const { initLogger: initLogger2 } = await Promise.resolve().then(() => (init_logger(), logger_exports));
|
|
178807
179137
|
initLogger2({ logDir: logDir2, level });
|
|
@@ -179090,17 +179420,17 @@ __export(init_wizard_exports, {
|
|
|
179090
179420
|
runInitWizard: () => runInitWizard
|
|
179091
179421
|
});
|
|
179092
179422
|
import { input as input3, select, confirm as confirm3 } from "@inquirer/prompts";
|
|
179093
|
-
import
|
|
179094
|
-
import
|
|
179423
|
+
import fs41 from "fs";
|
|
179424
|
+
import path72 from "path";
|
|
179095
179425
|
async function runInitWizard(options) {
|
|
179096
179426
|
const { yes, dorkHome, store } = options;
|
|
179097
|
-
const configPath =
|
|
179427
|
+
const configPath = path72.join(dorkHome, "config.json");
|
|
179098
179428
|
if (yes) {
|
|
179099
179429
|
store.reset();
|
|
179100
179430
|
console.log(`Config initialized with defaults at ${configPath}`);
|
|
179101
179431
|
return;
|
|
179102
179432
|
}
|
|
179103
|
-
if (
|
|
179433
|
+
if (fs41.existsSync(configPath)) {
|
|
179104
179434
|
const overwrite = await confirm3({
|
|
179105
179435
|
message: "Config already exists. Overwrite with new settings?",
|
|
179106
179436
|
default: false
|
|
@@ -179144,7 +179474,7 @@ async function runInitWizard(options) {
|
|
|
179144
179474
|
store.setDot("ui.theme", theme);
|
|
179145
179475
|
store.setDot("tunnel.enabled", tunnelEnabled);
|
|
179146
179476
|
if (cwd && cwd.trim() !== "") {
|
|
179147
|
-
store.setDot("server.cwd",
|
|
179477
|
+
store.setDot("server.cwd", path72.resolve(cwd));
|
|
179148
179478
|
}
|
|
179149
179479
|
console.log(`
|
|
179150
179480
|
Config saved to ${configPath}`);
|
|
@@ -179161,9 +179491,9 @@ init_check_claude();
|
|
|
179161
179491
|
init_check_core_extensions();
|
|
179162
179492
|
init_check_extension_compilation();
|
|
179163
179493
|
import os11, { networkInterfaces } from "os";
|
|
179164
|
-
import
|
|
179494
|
+
import path73 from "path";
|
|
179165
179495
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
179166
|
-
import
|
|
179496
|
+
import fs42 from "fs";
|
|
179167
179497
|
|
|
179168
179498
|
// src/update-check.ts
|
|
179169
179499
|
init_dork_home2();
|
|
@@ -179235,9 +179565,9 @@ async function alreadyShown() {
|
|
|
179235
179565
|
}
|
|
179236
179566
|
}
|
|
179237
179567
|
async function markShown() {
|
|
179238
|
-
const
|
|
179239
|
-
await mkdir2(dirname2(
|
|
179240
|
-
await writeFile2(
|
|
179568
|
+
const path74 = getMarkerPath();
|
|
179569
|
+
await mkdir2(dirname2(path74), { recursive: true });
|
|
179570
|
+
await writeFile2(path74, JSON.stringify({ shownAt: Date.now() }));
|
|
179241
179571
|
}
|
|
179242
179572
|
async function maybeShowNewsletterTip() {
|
|
179243
179573
|
try {
|
|
@@ -179953,7 +180283,7 @@ if (nodeVersionIssue) {
|
|
|
179953
180283
|
console.error(formatDiagnostic(nodeVersionIssue));
|
|
179954
180284
|
process.exit(1);
|
|
179955
180285
|
}
|
|
179956
|
-
var __dirname2 =
|
|
180286
|
+
var __dirname2 = path73.dirname(fileURLToPath7(import.meta.url));
|
|
179957
180287
|
var knownCommands = /* @__PURE__ */ new Set([
|
|
179958
180288
|
"package",
|
|
179959
180289
|
"harness",
|
|
@@ -180107,7 +180437,7 @@ if (process.argv[2] === "community") {
|
|
|
180107
180437
|
);
|
|
180108
180438
|
Object.assign(childEnv, credentialEnv.pickCommunityCredentialEnv(rawProcessEnv));
|
|
180109
180439
|
const exitCode = await dispatcher.runCommunityDispatcher(process.argv.slice(3), {
|
|
180110
|
-
cliVersion: "0.127.
|
|
180440
|
+
cliVersion: "0.127.1",
|
|
180111
180441
|
dorkHome: DORK_HOME,
|
|
180112
180442
|
processEnv: childEnv,
|
|
180113
180443
|
parseRelease: (bytes) => releaseContract.parseCompatibleCommunityReleaseManifest(
|
|
@@ -180125,7 +180455,7 @@ if (process.argv[2] === "community") {
|
|
|
180125
180455
|
process.exit(1);
|
|
180126
180456
|
}
|
|
180127
180457
|
}
|
|
180128
|
-
var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.127.
|
|
180458
|
+
var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.127.1" });
|
|
180129
180459
|
var uninstallCliErrorHandlers = cliErrorReporter ? installCliErrorHandlers(cliErrorReporter) : void 0;
|
|
180130
180460
|
if (process.argv[2] === "doctor") {
|
|
180131
180461
|
process.env.DORK_HOME = DORK_HOME;
|
|
@@ -180135,7 +180465,7 @@ if (process.argv[2] === "doctor") {
|
|
|
180135
180465
|
if (process.argv[2] === "feedback") {
|
|
180136
180466
|
process.env.DORK_HOME = DORK_HOME;
|
|
180137
180467
|
const { runFeedback: runFeedback2 } = await Promise.resolve().then(() => (init_feedback2(), feedback_exports));
|
|
180138
|
-
process.exit(await runFeedback2(DORK_HOME, "0.127.
|
|
180468
|
+
process.exit(await runFeedback2(DORK_HOME, "0.127.1", process.argv.slice(3)));
|
|
180139
180469
|
}
|
|
180140
180470
|
if (process.argv[2] === "auth") {
|
|
180141
180471
|
process.env.DORK_HOME = DORK_HOME;
|
|
@@ -180144,13 +180474,13 @@ if (process.argv[2] === "auth") {
|
|
|
180144
180474
|
}
|
|
180145
180475
|
if (process.argv[2] === "cloud") {
|
|
180146
180476
|
process.env.DORK_HOME = DORK_HOME;
|
|
180147
|
-
|
|
180477
|
+
fs42.mkdirSync(DORK_HOME, { recursive: true });
|
|
180148
180478
|
const { runCloudDispatcher: runCloudDispatcher2 } = await Promise.resolve().then(() => (init_cloud_dispatcher(), cloud_dispatcher_exports));
|
|
180149
180479
|
process.exit(await runCloudDispatcher2(DORK_HOME, process.argv[3], process.argv.slice(4)));
|
|
180150
180480
|
}
|
|
180151
180481
|
if (process.argv[2] === "telemetry") {
|
|
180152
180482
|
process.env.DORK_HOME = DORK_HOME;
|
|
180153
|
-
|
|
180483
|
+
fs42.mkdirSync(DORK_HOME, { recursive: true });
|
|
180154
180484
|
const { runTelemetryDispatcher: runTelemetryDispatcher2 } = await Promise.resolve().then(() => (init_telemetry(), telemetry_exports));
|
|
180155
180485
|
process.exit(await runTelemetryDispatcher2(DORK_HOME, process.argv[3], process.argv.slice(4)));
|
|
180156
180486
|
}
|
|
@@ -180234,7 +180564,7 @@ if (process.argv[2] === "agent" || process.argv[2] === "task" || process.argv[2]
|
|
|
180234
180564
|
}
|
|
180235
180565
|
}
|
|
180236
180566
|
const { runVersionDispatcher: runVersionDispatcher2 } = await Promise.resolve().then(() => (init_version5(), version_exports));
|
|
180237
|
-
process.exit(await runVersionDispatcher2("0.127.
|
|
180567
|
+
process.exit(await runVersionDispatcher2("0.127.1", DORK_HOME, subArgs));
|
|
180238
180568
|
}
|
|
180239
180569
|
var { values, positionals } = parseCliArgs();
|
|
180240
180570
|
if (positionals[0] && !knownCommands.has(positionals[0])) {
|
|
@@ -180328,14 +180658,14 @@ Examples:
|
|
|
180328
180658
|
process.exit(0);
|
|
180329
180659
|
}
|
|
180330
180660
|
if (values.version) {
|
|
180331
|
-
console.log("0.127.
|
|
180661
|
+
console.log("0.127.1");
|
|
180332
180662
|
process.exit(0);
|
|
180333
180663
|
}
|
|
180334
180664
|
if (values["post-install-check"]) {
|
|
180335
180665
|
const claudeFound = checkClaude();
|
|
180336
180666
|
const coreExtensionsFound = checkCoreExtensions();
|
|
180337
180667
|
const extensionsCompile = await checkExtensionCompilation();
|
|
180338
|
-
console.log(`dorkos ${"0.127.
|
|
180668
|
+
console.log(`dorkos ${"0.127.1"}`);
|
|
180339
180669
|
if (!coreExtensionsFound) {
|
|
180340
180670
|
console.log("Installation incomplete \u2014 bundled core extensions are missing.");
|
|
180341
180671
|
}
|
|
@@ -180358,7 +180688,7 @@ if (subcommand === "cleanup") {
|
|
|
180358
180688
|
process.exit(process.exitCode ?? 0);
|
|
180359
180689
|
}
|
|
180360
180690
|
try {
|
|
180361
|
-
|
|
180691
|
+
fs42.mkdirSync(DORK_HOME, { recursive: true });
|
|
180362
180692
|
} catch (err) {
|
|
180363
180693
|
const reason = err instanceof Error ? err.message : String(err);
|
|
180364
180694
|
console.error(`\u26A0 DorkOS could not set up ${DORK_HOME}: ${reason}`);
|
|
@@ -180412,7 +180742,7 @@ if (cliPort) {
|
|
|
180412
180742
|
process.env.DORKOS_PORT = configPort ? String(configPort) : String(DEFAULT_PORT);
|
|
180413
180743
|
}
|
|
180414
180744
|
process.env.NODE_ENV = "production";
|
|
180415
|
-
process.env.CLIENT_DIST_PATH =
|
|
180745
|
+
process.env.CLIENT_DIST_PATH = path73.join(__dirname2, "../client");
|
|
180416
180746
|
if (values.tunnel) process.env.TUNNEL_ENABLED = "true";
|
|
180417
180747
|
var tunnelAuthtoken = cfgMgr.getDot("tunnel.authtoken");
|
|
180418
180748
|
if (tunnelAuthtoken && !process.env.NGROK_AUTHTOKEN) {
|
|
@@ -180445,18 +180775,18 @@ if (values.open !== void 0) {
|
|
|
180445
180775
|
}
|
|
180446
180776
|
var cliDir = values.dir;
|
|
180447
180777
|
if (cliDir) {
|
|
180448
|
-
process.env.DORKOS_DEFAULT_CWD =
|
|
180778
|
+
process.env.DORKOS_DEFAULT_CWD = path73.resolve(cliDir);
|
|
180449
180779
|
} else if (!process.env.DORKOS_DEFAULT_CWD) {
|
|
180450
180780
|
const configCwd = cfgMgr.getDot("server.cwd");
|
|
180451
|
-
process.env.DORKOS_DEFAULT_CWD = configCwd ?
|
|
180781
|
+
process.env.DORKOS_DEFAULT_CWD = configCwd ? path73.resolve(configCwd) : process.cwd();
|
|
180452
180782
|
}
|
|
180453
180783
|
var cliBoundary = values.boundary;
|
|
180454
180784
|
if (cliBoundary) {
|
|
180455
|
-
process.env.DORKOS_BOUNDARY =
|
|
180785
|
+
process.env.DORKOS_BOUNDARY = path73.resolve(cliBoundary);
|
|
180456
180786
|
} else if (!process.env.DORKOS_BOUNDARY) {
|
|
180457
180787
|
const configBoundary = cfgMgr.getDot("server.boundary");
|
|
180458
180788
|
if (configBoundary) {
|
|
180459
|
-
process.env.DORKOS_BOUNDARY =
|
|
180789
|
+
process.env.DORKOS_BOUNDARY = path73.resolve(configBoundary);
|
|
180460
180790
|
}
|
|
180461
180791
|
}
|
|
180462
180792
|
var boundaryVal = process.env.DORKOS_BOUNDARY;
|
|
@@ -180468,7 +180798,7 @@ if (boundaryVal) {
|
|
|
180468
180798
|
}
|
|
180469
180799
|
var effectiveBoundary = process.env.DORKOS_BOUNDARY || home;
|
|
180470
180800
|
var resolvedDir = process.env.DORKOS_DEFAULT_CWD;
|
|
180471
|
-
if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary +
|
|
180801
|
+
if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary + path73.sep)) {
|
|
180472
180802
|
console.warn(
|
|
180473
180803
|
`[Warning] Default CWD "${resolvedDir}" is outside boundary "${effectiveBoundary}". Falling back to boundary root.`
|
|
180474
180804
|
);
|
|
@@ -180476,13 +180806,13 @@ if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBounda
|
|
|
180476
180806
|
}
|
|
180477
180807
|
var logLevelName = values["log-level"] || env4.LOG_LEVEL || cfgMgr.getDot("logging.level") || (env4.NODE_ENV === "production" ? "info" : "debug");
|
|
180478
180808
|
process.env.DORKOS_LOG_LEVEL = String(LOG_LEVEL_MAP[logLevelName] ?? 3);
|
|
180479
|
-
var envPath =
|
|
180480
|
-
if (
|
|
180809
|
+
var envPath = path73.join(process.env.DORKOS_DEFAULT_CWD, ".env");
|
|
180810
|
+
if (fs42.existsSync(envPath)) {
|
|
180481
180811
|
const dotenv = await import("dotenv");
|
|
180482
180812
|
dotenv.config({ path: envPath, override: false });
|
|
180483
180813
|
}
|
|
180484
180814
|
uninstallCliErrorHandlers?.();
|
|
180485
|
-
stampCliLaunch(process.env, fileURLToPath7(import.meta.url), "0.127.
|
|
180815
|
+
stampCliLaunch(process.env, fileURLToPath7(import.meta.url), "0.127.1");
|
|
180486
180816
|
var server;
|
|
180487
180817
|
try {
|
|
180488
180818
|
server = await import("../server/index.js");
|
|
@@ -180507,7 +180837,7 @@ var ansiReset = "\x1B[0m";
|
|
|
180507
180837
|
console.log("");
|
|
180508
180838
|
console.log(`${purple}${logo}${ansiReset}`);
|
|
180509
180839
|
console.log("");
|
|
180510
|
-
console.log(` DorkOS v${"0.127.
|
|
180840
|
+
console.log(` DorkOS v${"0.127.1"}`);
|
|
180511
180841
|
console.log(` Local: ${link(localUrl, localUrl)}`);
|
|
180512
180842
|
var nets = networkInterfaces();
|
|
180513
180843
|
var networkUrl = null;
|
|
@@ -180533,9 +180863,9 @@ if (shouldOpenBrowser && process.stdin.isTTY) {
|
|
|
180533
180863
|
const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
180534
180864
|
exec(`${openCmd} ${localUrl}`);
|
|
180535
180865
|
}
|
|
180536
|
-
checkForUpdate("0.127.
|
|
180866
|
+
checkForUpdate("0.127.1").then((latestVersion) => {
|
|
180537
180867
|
if (latestVersion) {
|
|
180538
|
-
const msg = `Update available: ${"0.127.
|
|
180868
|
+
const msg = `Update available: ${"0.127.1"} \u2192 ${latestVersion}`;
|
|
180539
180869
|
const cmd = "Run npm install -g dorkos@latest to update";
|
|
180540
180870
|
const width = Math.max(msg.length, cmd.length) + 6;
|
|
180541
180871
|
const pad2 = (s2) => `\u2502 ${s2}${" ".repeat(width - s2.length - 6)} \u2502`;
|