dorkos 0.126.0 → 0.126.2
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 +1225 -562
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-2c9n8B32.js → AboutPage-BQ66xWcJ.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-muwC_jif.js → ActivityErrorState-CPbfgXjw.js} +1 -1
- package/dist/client/assets/{ActivityPage-2aUz3zv0.js → ActivityPage-CesljfZn.js} +1 -1
- package/dist/client/assets/{ActivityRow-nQBqDCak.js → ActivityRow-DzhwE0ht.js} +1 -1
- package/dist/client/assets/{AdapterIcon-ChpyilnO.js → AdapterIcon-BXJkyF5g.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-DRKQp5Gh.js → AdapterSetupWizard-CwKYl1vG.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-CeVPhvTq.js → AgentOptionRow-0VdNzXCF.js} +1 -1
- package/dist/client/assets/{AgentPicker-D8YX1P_q.js → AgentPicker-Ldh64iOA.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-refCLvuV.js → AgentRequestCard-CmAlDGTr.js} +3 -3
- package/dist/client/assets/{AppearancePage-BDTIp3j0.js → AppearancePage-DmsZPHst.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-Ct1W283T.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-Dn4rP542.js → AttentionSignalRow-B7gezgzA.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-B0sy0nRk.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Nqvr65_g.js} +1 -1
- package/dist/client/assets/{BindingDialog-DMYB-vWm.js → BindingDialog-CpBZoSZU.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-D9ZLEDXc.js → BlintzCanvas-BCtfZPrs.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-DMqGpNWm.js → CanvasCsvContent-DYksqzaf.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-Bxhc86lv.js → CanvasFileContent-CqEqSxuJ.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-D783Ql7m.js → CanvasModel3dContent-vR6ze4IR.js} +2 -2
- package/dist/client/assets/{ChannelComposer-BNlD-d2W.js → ChannelComposer-BVACOdph.js} +5 -5
- package/dist/client/assets/{ChatAppsOff-eRAfqzJR.js → ChatAppsOff-VsPP2Hye.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-CqEUAG6G.js → CodeMirrorDiff-CmKjH03N.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BM1ANude.js → CodeMirrorEditor-BtNgazuc.js} +1 -1
- package/dist/client/assets/{CommitmentList-C3QvbbGF.js → CommitmentList-D9I-CmNy.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-bmqKNd-Z.js → CommitmentsPage-BORMYDZb.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-78falOZG.js → ComputerResourceView-BZ9BxgOi.js} +1 -1
- package/dist/client/assets/{ComputerViewer-DZ2RiDbn.js → ComputerViewer-CbuU9tXK.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-CXsNyR4U.js → ConnectionAccessLists-uE-Fzp6Y.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-bpkRfRRK.js → ConnectionsPage-D7QTHeQQ.js} +1 -1
- package/dist/client/assets/{ConventionPage-rYtICYjS.js → ConventionPage-PS2WWCyB.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-DXTqUrR4.js → ExtensionPageRoute-Cn7bYxGB.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-CCNB3_Gb.js → FloatingTanStackRouterDevtools-CqogiFob-DKGNSXVz.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-BfVnJ6oD.js → ForwardConsentHost-CLIHtWwq.js} +1 -1
- package/dist/client/assets/HandlePage-BjlcYr_l.js +1 -0
- package/dist/client/assets/{HeartbeatPage-DdAfcR81.js → HeartbeatPage-7MTowke-.js} +1 -1
- package/dist/client/assets/{KeyEntry-CR7GBqXf.js → KeyEntry-Cf7D0Oo6.js} +1 -1
- package/dist/client/assets/{LexicalField-RAoub3wq.js → LexicalField-DqvzeMr3.js} +1 -1
- package/dist/client/assets/{ManagesPage-CEhYj9ov.js → ManagesPage-DxR4zWMf.js} +1 -1
- package/dist/client/assets/{Marketplace-DtxHDbF4.js → Marketplace-V_92jKOn.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-CSFvFtV_.js → MarketplaceSourcesView-CjCVMP_d.js} +1 -1
- package/dist/client/assets/{McpAppFrame-1mPdRK9p.js → McpAppFrame-4JDJsrmg.js} +2 -2
- package/dist/client/assets/{McpSigninBody--HfjMnE1.js → McpSigninBody-DG1XX7XT.js} +1 -1
- package/dist/client/assets/{Model3dViewer-BT2SY67i.js → Model3dViewer-DedBFHsl.js} +1 -1
- package/dist/client/assets/NamePage-A8X09lY7.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-QUtJTzKI.js → NewDirectMessageMenu-C8t7x-sB.js} +1 -1
- package/dist/client/assets/{NotificationsPage-D3fleW0i.js → NotificationsPage-DwGFE3F6.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-8WEn0WrA.js → OpenMeshSwitch-DPmTA9eg.js} +2 -2
- package/dist/client/assets/OperatorIdentityForm-Cu0h8Xqy.js +1 -0
- package/dist/client/assets/{PermissionHistory-5stLHBu8.js → PermissionHistory-zD6ksrl2.js} +1 -1
- package/dist/client/assets/PermissionsPage-Durcnmie.js +1 -0
- package/dist/client/assets/{PersonalityPopover-DIbsJ6HP.js → PersonalityPopover-DuRjJuLj.js} +1 -1
- package/dist/client/assets/PhotoPage-DP5WoeFd.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-CjT7jQ45.js → PreviewRefusedNotice-hlYrFDQM.js} +1 -1
- package/dist/client/assets/{ProfileFields-gZNaFBow.js → ProfileFields-x-x8vgNo.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DYf7L8xJ.js → ProfilePanelContainer-8WxopRj2.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-DclYXFSP.js → ProfileRolePicker-BfciiNpr.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-k9HolS90.js → PromptSuggestionChips-D34Zeaq_.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-Bh5KrFbJ.js → ReportsToPopover-BhqA5qXi.js} +1 -1
- package/dist/client/assets/{RoomSurface-32U7Wl6Z.js → RoomSurface-BlMNuQsT.js} +1 -1
- package/dist/client/assets/{RoomsPage-sdMZgHla.js → RoomsPage-C52AOHIE.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-B5_Jz7ir.js → RunsOnPopover-DLhEKwXF.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-C_6ozpAK.js → RuntimeConnectFlow-D3H5Fpkc.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-BDvzruM4.js → RuntimeSetupDialog-DPU4QIY9.js} +1 -1
- package/dist/client/assets/{SeenDevices-CZ--8ljN.js → SeenDevices-CDSHTsL7.js} +2 -2
- package/dist/client/assets/{SessionsPage-BKyrJh1O.js → SessionsPage-Crh3D3Jj.js} +1 -1
- package/dist/client/assets/{SettingsDialog-E5hPag3F.js → SettingsDialog-D0Oh-ku1.js} +4 -4
- package/dist/client/assets/{SkillsPage-BeL6zfgw.js → SkillsPage-BPexZwnJ.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-B-IP5hYv.js → TaskDialogWrapper-D6RB8E59.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-BcftWVbk.js → TasksEmptyState-Di3SbhJM.js} +2 -2
- package/dist/client/assets/{TasksPage-CmroTI1v.js → TasksPage-CDLsY1Ww.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-DbfoZrZz.js → TeamComputerEntry-B_q-oVSs.js} +1 -1
- package/dist/client/assets/{ToolsPage-h-PS45fZ.js → ToolsPage-gvIVTnwf.js} +1 -1
- package/dist/client/assets/{TopologyGraph-Bk_0y0Yy.js → TopologyGraph-Bp8aL_qw.js} +1 -1
- package/dist/client/assets/{TourHost-D4La-1-E.js → TourHost-Cg8EHvod.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-CWd4fhT4.js → UnlinkDialog-Ddd1Yxfk.js} +1 -1
- package/dist/client/assets/{UnreadDivider-Bvg9QLn9.js → UnreadDivider-LL4_YtF0.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-DictdlWO.js → WidgetErrorCard-BA3P7hNv.js} +6 -6
- package/dist/client/assets/WithheldExtensionsNotice-quqWNbus.js +1 -0
- package/dist/client/assets/{WorkView-DxThzZ0w.js → WorkView-C_h8sclU.js} +1 -1
- package/dist/client/assets/_shell-D9q8zLfr.js +80 -0
- package/dist/client/assets/{_shell._home-CBNsPEH4.js → _shell._home-CrTxBB3h.js} +1 -1
- package/dist/client/assets/_shell._home.activity-2M0BJkbQ.js +1 -0
- package/dist/client/assets/_shell._home.index-BTJhhEWN.js +3 -0
- package/dist/client/assets/_shell._home.tasks-Dfrqv2nl.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-3R3VtH7x.js → _shell._home.workspaces-DPLQXDdH.js} +1 -1
- package/dist/client/assets/{_shell.channels-DRslcaiA.js → _shell.channels-CJqfUTZ1.js} +1 -1
- package/dist/client/assets/{_shell.connections-BPQxNUPD.js → _shell.connections-Cpe1hru3.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-DkXEk3qm.js → _shell.feedback-requests-BeWCqScf.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CzLqm8iR.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-DtraxnMx.js +1 -0
- package/dist/client/assets/_shell.session-72JEfodU.js +1 -0
- package/dist/client/assets/{_shell.team-CZu-l34d.js → _shell.team-EPvcS7RS.js} +3 -3
- package/dist/client/assets/{_shell.threads-Cz-EZQXr.js → _shell.threads-NJDzq9dv.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-CcJi8pKR.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-CcJi8pKR.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-4hI8_uRi.js → abnfDiagram-WEYOIA3C-DUHshdrR.js} +1 -1
- package/dist/client/assets/{access-copy-BegDAoeR.js → access-copy-DHfPjN3G.js} +1 -1
- package/dist/client/assets/{arc-DgydwPM5.js → arc-sP6zNsGB.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-4kexDkbn.js → architectureDiagram-ZHVYKT53-C8PTjsPx.js} +1 -1
- package/dist/client/assets/{banner-CYV5jQI0.js → banner-CVrzHqOT.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-BUP4L5_m.js → blockDiagram-RJAE7QA3-Cydde2fz.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-B4HK3S3o.js → c4Diagram-XDPPPE54-DbM6KAK7.js} +1 -1
- package/dist/client/assets/{card-6VNSI3kT.js → card-DA_Z-FYX.js} +1 -1
- package/dist/client/assets/channel-DMgpNBDz.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-Bhw5hCVI.js → chunk-2E7WHVMD-CEbspaNh.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-CeUgfCvO.js → chunk-2Q5K7J3B-DDP1SiE0.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-DqSZunXx.js → chunk-4EMNKR2T-BFjozJqd.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-Bigp9-bU.js → chunk-55XCU76K-0JSp6acZ.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DF1L8DrH.js → chunk-5VM5RSS4-DswTXnmp.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-lcFap_43.js → chunk-JWPE2WC7-D0PYncYV.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-Bgmsy9NF.js → chunk-VQ5W62QI-r5T-ZVBs.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-DFFzLm_u.js → chunk-XXDRQBXY-D8kkjktE.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-B4aJwBdo.js → chunk-ZCHMQSOR-D6XtRzln.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-BdUAMGnS.js → classDiagram-v2-4MYWR3UA-DUPDMGfm.js} +1 -1
- package/dist/client/assets/{command-Dz2pZLle.js → command-BvXBgZfv.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BdJxQmWe.js → cose-bilkent-JH36ORCC-tiQpE-Q8.js} +1 -1
- package/dist/client/assets/{cpu-CjKJ8pVl.js → cpu-mx7zDf7k.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-BvnDWKe0.js → cynefin-EF2NZ3EQ-BjAUxFfb.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DKL8UyvS.js → cynefinDiagram-WF24UDRP-PmlyltXR.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-CCuJpxlY.js → dagre-NK4GIZVX-DDePjPkn.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-C1jeuv8r.js → diagram-CBK3MWTC-D7N3T4Fx.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-CSnTyOU0.js → diagram-I5XIIV2D-BfZHSbR2.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-9w6q1YKi.js → diagram-ODIL2UCW-sXAa9bzN.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BMFBmD0P.js → diagram-PFBEJUXE-Dfd_61WO.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-D9Utl6qX.js → diagram-RJA3I4VV-BCzdEfnM.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-u_ogc51l.js → diagram-TYUNFSNR-BMqtz6sZ.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-Bg_smbFH.js → ebnfDiagram-V4P3TTPT-CyWj1615.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-CtuwbIK2.js → elk-QONTBCTQ-BkQMBXse.js} +1 -1
- package/dist/client/assets/{empty-state-CbFKhqwB.js → empty-state-Dv5iV4jb.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-MlvYHdZ7.js → erDiagram-KYQIGQAA-DiPsX7uU.js} +1 -1
- package/dist/client/assets/{execution-config-BjNjQoBp.js → execution-config-Bej0Ot8e.js} +1 -1
- package/dist/client/assets/{file-JokR8lB2.js → file-DXbyb23e.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-sl45DZYe.js → file-exclamation-point-C8XqHyzY.js} +1 -1
- package/dist/client/assets/{file-text-C4PxLfBm.js → file-text-CRTgqqkn.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-Bc1LICCy.js → find-latest-widget-fence-D1i7qNny.js} +5 -5
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BlrKbUnh.js → flowDiagram-IUGLLWBU-BSM44aJP.js} +1 -1
- package/dist/client/assets/{form-1NlezfMg.js → form-DYSiVEri.js} +1 -1
- package/dist/client/assets/{format-cron-C57sE3sK.js → format-cron-DYYwmo-o.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-BhCCQ-d7.js → ganttDiagram-R7GPNTJY-BWCjYexX.js} +1 -1
- package/dist/client/assets/{git-branch-BXEb1Sqq.js → git-branch-1zYKSuur.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-Chl1aqHg.js → gitGraphDiagram-PDYL7XHY-ULC7Zunc.js} +1 -1
- package/dist/client/assets/{graph-DIIpUxLd.js → graph-BsZzo5TN.js} +1 -1
- package/dist/client/assets/{heart-CUs7jdhV.js → heart-C4CSHUW7.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-DlDHGjld.js → highlighted-body-KPVGNVTW-CFECg7iB.js} +1 -1
- package/dist/client/assets/{image-lightbox-BczXKBTZ.js → image-lightbox-M9t3Wulc.js} +1 -1
- package/dist/client/assets/{image-off-Ch98GGBJ.js → image-off-c01kxBAm.js} +1 -1
- package/dist/client/assets/{index-D6NjBiAq.js → index-B-7P1Q9s.js} +1 -1
- package/dist/client/assets/{index-BAnl5kwm.js → index-B3xeyV6n.js} +1 -1
- package/dist/client/assets/{index-DwrBsA10.js → index-B6Scr7KJ.js} +213 -213
- package/dist/client/assets/{index-Ev7FZl9a.js → index-BIVIHPoe.js} +1 -1
- package/dist/client/assets/{index-hyqRnlFg.js → index-BRH6C3LJ.js} +1 -1
- package/dist/client/assets/{index-CQTeDD0B.js → index-BScgHCO_.js} +1 -1
- package/dist/client/assets/{index-pQstFziR.js → index-BSxkprTm.js} +3 -3
- package/dist/client/assets/{index-DaZdDh7o.js → index-BTGRc0hC.js} +1 -1
- package/dist/client/assets/{index-CaVP52c1.js → index-BYY8HEOz.js} +1 -1
- package/dist/client/assets/{index-Cn1ZEy3S.js → index-B_he44rF.js} +1 -1
- package/dist/client/assets/{index-rKEUwjq8.js → index-BnXWm8Db.js} +1 -1
- package/dist/client/assets/{index-BQlnEL5t.js → index-BqwCOIbF.js} +1 -1
- package/dist/client/assets/{index-8FrM4Unx.js → index-Br35Gqfz.js} +1 -1
- package/dist/client/assets/{index-BC41bN42.js → index-C1XazYWZ.js} +1 -1
- package/dist/client/assets/{index-DMfV6rUz.js → index-C3swXqWW.js} +1 -1
- package/dist/client/assets/{index-B0p2_o3r.js → index-CAAsqmfP.js} +1 -1
- package/dist/client/assets/{index-DzLIbXMR.js → index-CAjKQnAd.js} +1 -1
- package/dist/client/assets/{index-vU7itvE8.js → index-Ce3HZQem.js} +1 -1
- package/dist/client/assets/{index-CnNGTb8f.js → index-CnltS8ym.js} +1 -1
- package/dist/client/assets/{index-ByIDaFWv.js → index-D847rJXW.js} +1 -1
- package/dist/client/assets/{index-CYhf-E_N.js → index-DG13Cp5o.js} +1 -1
- package/dist/client/assets/{index-CoHeCySh.js → index-DIDUjTkq.js} +1 -1
- package/dist/client/assets/{index-slBSiB-H.js → index-DQTTC52E.js} +1 -1
- package/dist/client/assets/{index-BiyMpL0z.js → index-DhYnXLRT.js} +1 -1
- package/dist/client/assets/{index-HnW-eS5i.js → index-DhkfALZp.js} +1 -1
- package/dist/client/assets/{index-BVjrgWDa.js → index-DhoaVQXu.js} +1 -1
- package/dist/client/assets/{index-D1Be28yK.js → index-DrENuQdJ.js} +1 -1
- package/dist/client/assets/{index-B0q1o1JU.js → index-DrQqkQq_.js} +1 -1
- package/dist/client/assets/{index-0MDZSAdr.js → index-DsasLE1l.js} +1 -1
- package/dist/client/assets/{index-CSOhBvPV.js → index-Dt7RONID.js} +1 -1
- package/dist/client/assets/{index-Czar7aPT.js → index-Du4HX97h.js} +2 -2
- package/dist/client/assets/{index-37h1E-65.js → index-DyN65ufd.js} +1 -1
- package/dist/client/assets/{index-BNJa5z6K.js → index-DzHj8lCz.js} +6 -6
- package/dist/client/assets/{index-BwHCH3tE.js → index-FwAvbbet.js} +1 -1
- package/dist/client/assets/{index-DlZ77Qfj.js → index-JG_0k1NX.js} +1 -1
- package/dist/client/assets/{index-BRyEtRBO.js → index-LpaxG4VS.js} +1 -1
- package/dist/client/assets/{index-D_9H4FdK.js → index-UJq1qaku.js} +1 -1
- package/dist/client/assets/{index-Cnjpi7ar.js → index-XEE1k4cl.js} +1 -1
- package/dist/client/assets/{index-BzqkXlms.js → index-YXyEu3Ia.js} +1 -1
- package/dist/client/assets/index-e6oawwKv.js +1 -0
- package/dist/client/assets/index-j30EyYIU.js +1 -0
- package/dist/client/assets/{index-Cw0QRsnv.js → index-jLIoULQt.js} +1 -1
- package/dist/client/assets/{index-CFJcOzPD.js → index-uLbyd6YP.js} +1 -1
- package/dist/client/assets/{index.esm-DM8Bqi3n.js → index.esm-CZ68Qd2t.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-C0p1eP9j.js → infoDiagram-MVDRKAX5-BCjhXqIT.js} +1 -1
- package/dist/client/assets/{inline-code-CNmpgW3O.js → inline-code-BKPMIXZR.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-COdxgYUT.js → ishikawaDiagram-HPEHV2GE-C9rsv2nh.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-C84Ny9n9.js → journeyDiagram-BOSHW7O7-BRYr1XL1.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ECSXhFX0.js → kanban-definition-FNSA4HC5-2ey8FXEn.js} +1 -1
- package/dist/client/assets/{layers-JgRwJGyf.js → layers-DE3wjQuk.js} +1 -1
- package/dist/client/assets/{lightbulb-BhQB8sFP.js → lightbulb-BXJIRUdm.js} +1 -1
- package/dist/client/assets/{link-2-B4byjdgg.js → link-2-DzWm9OxA.js} +1 -1
- package/dist/client/assets/{list-runtime-types-M5_gxIg1.js → list-runtime-types-BhkZkTrB.js} +1 -1
- package/dist/client/assets/{markdown-content-C3qWcii6.js → markdown-content-Bk9lCksw.js} +1 -1
- package/dist/client/assets/{mention-pill-DUbgdKmA.js → mention-pill-os_7QQu2.js} +1 -1
- package/dist/client/assets/{mermaid.core-BQiwaVjZ.js → mermaid.core-BcRUBvZd.js} +4 -4
- package/dist/client/assets/{message-square-off-AjtFFe_u.js → message-square-off-DuOiETNI.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-BfA6EqgP.js → mindmap-definition-6OY57UG3-DBhXkS2i.js} +1 -1
- package/dist/client/assets/{more-details-itSF4Fah.js → more-details-Bt9nlPmS.js} +1 -1
- package/dist/client/assets/{owner-notice-B6JRjE_c.js → owner-notice-4ZSBxa2K.js} +1 -1
- package/dist/client/assets/{package-5YQSitlR.js → package-BmOMrNwc.js} +1 -1
- package/dist/client/assets/{page-container-DBPUOYYM.js → page-container-LomhzyuS.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-Kwb3zKa6.js → pane-resize-handle-BOtzx5Q4.js} +1 -1
- package/dist/client/assets/{paperclip-IRKZTEQw.js → paperclip-C1tkiT74.js} +1 -1
- package/dist/client/assets/{path-input-BHkA4fFw.js → path-input-JHTlL97W.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-CqIy9WDe.js → pegDiagram-ECIUJNBX-B01fb3t0.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-C5yI3cvV.js → pieDiagram-GNMPY74T-BJ7JYrTk.js} +1 -1
- package/dist/client/assets/{plug-CupdBXaG.js → plug-CsqfQsYq.js} +1 -1
- package/dist/client/assets/{primer-trigger-Ci_XRRfX.js → primer-trigger-DLdK7lVr.js} +2 -2
- package/dist/client/assets/{profile-errors-aEsWNifs.js → profile-errors-CpvSy5wY.js} +1 -1
- package/dist/client/assets/{progress-Bpmb837n.js → progress-qB87L0zJ.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-DyCDNvk7.js → quadrantDiagram-D57K4MC3-mJYGGmOV.js} +1 -1
- package/dist/client/assets/{query-error-state-s6AJaHa3.js → query-error-state-MyJ1ivia.js} +1 -1
- package/dist/client/assets/{radio-Ci6Ghks8.js → radio-DJV7l0fv.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-B3u1B937.js → railroadDiagram-Y72NRBL7-BlXWwQe2.js} +1 -1
- package/dist/client/assets/registry-BrjQCdmG.js +1 -0
- package/dist/client/assets/{registry-NGfn1R2_.js → registry-tJrGs7kB.js} +4 -4
- package/dist/client/assets/{relay-trace-schemas-hOFIzdY-.js → relay-trace-schemas-TH0-GYCB.js} +2 -2
- package/dist/client/assets/{repeat-B1S2ceC2.js → repeat-CBnopqBr.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-CdG-unip.js → requirementDiagram-EQYSW5RA-Dqr1Y74x.js} +1 -1
- package/dist/client/assets/{room-files-source-J7gnN1gx.js → room-files-source-BFo0FEUP.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-7Q2akPFi.js → rotate-ccw-clock-D9XRHj5E.js} +1 -1
- package/dist/client/assets/{rotate-cw-DK3Rzmlh.js → rotate-cw-DNa7ENG3.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-D3Z4Qk2b.js → sankeyDiagram-SY24JHO5-DGYZs_kW.js} +1 -1
- package/dist/client/assets/{scroll-area-6Gelypei.js → scroll-area-Bf6IGziJ.js} +1 -1
- package/dist/client/assets/search-x-DFBBEouE.js +6 -0
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-RXPgeLr6.js → sequenceDiagram-BLEHNHQU-BW3u4L9y.js} +1 -1
- package/dist/client/assets/{shield-x-D8lJ0Op0.js → shield-x-WGxwrtNV.js} +1 -1
- package/dist/client/assets/{signed-in-NOeTLLso.js → signed-in-eV4_EXuv.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-q7qki1pK.js → sizeCapture-INFHLROL-C1TpueOu.js} +1 -1
- package/dist/client/assets/{soul-file-DTEcjDxP.js → soul-file-e1iYX9IV.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DFs6IVbj.js → stateDiagram-v2-A6IESKWZ-DvrHUauN.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-D1A-3JE-.js → swimlanes-B3ENRKFQ-BUbTcoId.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-wkooBe_N.js +8 -0
- package/dist/client/assets/{table-CuBPM_bg.js → table-DsxLk3Gx.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-CLHy0rAb.js → timeline-definition-JXYKGLGB-CzbVpGxn.js} +1 -1
- package/dist/client/assets/{trust-posture-BXXe8F8n.js → trust-posture-Blofy7eE.js} +1 -1
- package/dist/client/assets/{unplug-Cuej6sM6.js → unplug-B6dUhqA7.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BbK4SCJp.js → unverified-catalog-notice-6pwZtIjx.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-Cy7ENVZN.js → use-adapter-catalog-J43bUHJu.js} +1 -1
- package/dist/client/assets/{use-bindings-Tj0BcF4m.js → use-bindings-BgXZ0D7k.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-BrQVpwRi.js → use-composer-prefs--zO2mm_M.js} +1 -1
- package/dist/client/assets/{use-connector-management-CLZQXgln.js → use-connector-management-9Q7wHb06.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-BeqtUhj2.js → use-deep-link-scroll-CXqwdwGr.js} +1 -1
- package/dist/client/assets/{use-delete-binding-d7ii9iFQ.js → use-delete-binding-BBQNMtUY.js} +1 -1
- package/dist/client/assets/{use-dev-links-MYOV3h2q.js → use-dev-links-C643CCcq.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-C_lXDYnB.js → use-direct-message-panel-BD_daG2E.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-kMFSEJGV.js → use-external-adapter-catalog-BjbC1V6t.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-MFSkvnza.js → use-full-activity-feed-DUH8r8jx.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-DAZnwJGB.js +1 -0
- package/dist/client/assets/{use-local-browser-1oVtlmXD.js → use-local-browser-P93oA-F5.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BJs6M6kh.js → use-mesh-topology-B0k0gLoW.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DitdlmSI.js → use-mounted-ref-DE7EQsBF.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-CXbRTRLF.js → use-notification-prefs-B8JtshQ0.js} +1 -1
- package/dist/client/assets/use-pending-read-DeGO1wGC.js +1 -0
- package/dist/client/assets/{use-personality-commit-DQrWyVGT.js → use-personality-commit-Dh5Sejj_.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CgdBHk2f.js → use-promo-activation-C9FWA7ru.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-DprcDmfs.js → use-promo-dismissals-BIfafj9f.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-BtMzHCs3.js → use-pulse-freshness-CxzVMmVK.js} +1 -1
- package/dist/client/assets/{use-relay-config-CGBlgXC2.js → use-relay-config-DQE3dmJ2.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Db5U7kWT.js → use-room-follow-claim-B1QPFaUb.js} +1 -1
- package/dist/client/assets/{use-room-sessions-K6mdH-Tb.js → use-room-sessions-CdjzO67_.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-B2zxa_F_.js → use-roving-tab-list-Nu-MIapD.js} +1 -1
- package/dist/client/assets/{use-session-canvas-D4G5fO_a.js → use-session-canvas-BfKGOpNy.js} +8 -8
- package/dist/client/assets/{use-status-budget-UccdTZ7o.js → use-status-budget-DgeTxC3h.js} +3 -3
- package/dist/client/assets/{use-transform-BBj2pwbo.js → use-transform-CiJqtMBf.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-BidDnyt8.js → use-unclaimed-chats-Blkq6U4D.js} +1 -1
- package/dist/client/assets/use-update-config-BFFW_6Mc.js +1 -0
- package/dist/client/assets/{useMutationState-RYxTf1aD.js → useMutationState-lbcdmnfE.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-Bjmcc2gK.js → usecaseDiagram-WPOLBNNX-BM36oESm.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Cd6C9CxW.js → vennDiagram-Q3Y3IDCW-Zrybcs91.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-CzWWmwUL.js → wardleyDiagram-IVAIDKWA-CO4pzGG0.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-DSUn9rhA.js → xychartDiagram-4URNHDU4-pi_wF1CM.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +70428 -68011
- package/dist/server/index.js.map +2 -2
- package/package.json +4 -4
- package/dist/client/assets/ApplyToOverridesDialog-C-XL9N4W.js +0 -1
- package/dist/client/assets/HandlePage-BH_G4sMV.js +0 -1
- package/dist/client/assets/NamePage-CaJsVRhh.js +0 -1
- package/dist/client/assets/OperatorIdentityForm-BRKAQS0D.js +0 -1
- package/dist/client/assets/PermissionsPage-C2pB1TCJ.js +0 -1
- package/dist/client/assets/PhotoPage-33Xh8sq1.js +0 -1
- package/dist/client/assets/_shell-CX_gaQPE.js +0 -80
- package/dist/client/assets/_shell._home.activity-DpSGWVSW.js +0 -1
- package/dist/client/assets/_shell._home.index-BWH93iWg.js +0 -3
- package/dist/client/assets/_shell._home.tasks-Ive4UW8c.js +0 -1
- package/dist/client/assets/_shell.marketplace-D8deZF5L.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-BHG9MqWR.js +0 -1
- package/dist/client/assets/_shell.session-CkdA2hgF.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-Cry6E5KK.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-Cry6E5KK.js +0 -1
- package/dist/client/assets/channel-Bf4e4rlX.js +0 -1
- package/dist/client/assets/index-BThp0Av1.js +0 -1
- package/dist/client/assets/index-Dv6HjbCS.js +0 -1
- package/dist/client/assets/registry-DatwH4jj.js +0 -1
- package/dist/client/assets/search-x-Be8VetKs.js +0 -6
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-hZFkkqUb.js +0 -8
- package/dist/client/assets/use-is-below-desktop-CJJ4zMQO.js +0 -1
- package/dist/client/assets/use-pending-read-CvX1lOb8.js +0 -1
- package/dist/client/assets/use-update-config-D8g4P42J.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, path71) {
|
|
349
|
+
if (!path71)
|
|
350
350
|
return obj;
|
|
351
|
-
return
|
|
351
|
+
return path71.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(path71, 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(path71);
|
|
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, path71 = []) => {
|
|
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 }, [...path71, ...issue2.path]));
|
|
1151
1151
|
} else if (issue2.code === "invalid_key") {
|
|
1152
|
-
processError({ issues: issue2.issues }, [...
|
|
1152
|
+
processError({ issues: issue2.issues }, [...path71, ...issue2.path]);
|
|
1153
1153
|
} else if (issue2.code === "invalid_element") {
|
|
1154
|
-
processError({ issues: issue2.issues }, [...
|
|
1154
|
+
processError({ issues: issue2.issues }, [...path71, ...issue2.path]);
|
|
1155
1155
|
} else {
|
|
1156
|
-
const fullpath = [...
|
|
1156
|
+
const fullpath = [...path71, ...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, path71 = []) => {
|
|
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 }, [...path71, ...issue2.path]));
|
|
1200
1200
|
} else if (issue2.code === "invalid_key") {
|
|
1201
|
-
processError({ issues: issue2.issues }, [...
|
|
1201
|
+
processError({ issues: issue2.issues }, [...path71, ...issue2.path]);
|
|
1202
1202
|
} else if (issue2.code === "invalid_element") {
|
|
1203
|
-
processError({ issues: issue2.issues }, [...
|
|
1203
|
+
processError({ issues: issue2.issues }, [...path71, ...issue2.path]);
|
|
1204
1204
|
} else {
|
|
1205
|
-
const fullpath = [...
|
|
1205
|
+
const fullpath = [...path71, ...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 path71 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1245
|
+
for (const seg of path71) {
|
|
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 path71 = ref.slice(1).split("/").filter(Boolean);
|
|
19278
|
+
if (path71.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 (path71[0] === defsKey) {
|
|
19283
|
+
const key = path71[1] === void 0 ? void 0 : decodeJSONPointerSegment(path71[1]);
|
|
19284
19284
|
if (!key || !ctx.defs[key]) {
|
|
19285
19285
|
throw new Error(`Reference not found: ${ref}`);
|
|
19286
19286
|
}
|
|
@@ -22684,11 +22684,47 @@ var init_extension_config_schemas = __esm({
|
|
|
22684
22684
|
*/
|
|
22685
22685
|
origin: ExtensionOriginSchema.optional(),
|
|
22686
22686
|
/**
|
|
22687
|
-
*
|
|
22688
|
-
*
|
|
22689
|
-
*
|
|
22687
|
+
* The folder digest the yes was given to (DOR-3068): the whole plugin
|
|
22688
|
+
* folder for a plugin-carried copy, the extension's own folder otherwise.
|
|
22689
|
+
* Any change to those files waits for a person, because a path alone no
|
|
22690
|
+
* longer says what is there. Absent only for a dev link, or for a copy
|
|
22691
|
+
* that keeps its path trust (`authorHome`).
|
|
22690
22692
|
*/
|
|
22691
22693
|
digest: external_exports.string().min(1).optional(),
|
|
22694
|
+
/**
|
|
22695
|
+
* The real path of the folder of the agent that created this extension
|
|
22696
|
+
* with `create_extension` (DOR-3068). Its edits keep loading without a
|
|
22697
|
+
* digest only while the copy runs separately, declares exactly `grants`,
|
|
22698
|
+
* and its real path stays inside this folder. Absent for a copy a person
|
|
22699
|
+
* approved by hand, which is always pinned by `digest`.
|
|
22700
|
+
*/
|
|
22701
|
+
authorHome: external_exports.string().min(1).optional(),
|
|
22702
|
+
/**
|
|
22703
|
+
* A digest of what the copy declared it may reach when the yes was given
|
|
22704
|
+
* (DOR-3068): where it runs, its `allow` lists, its secrets, its data
|
|
22705
|
+
* proxy and its server entry. Any change waits for a person.
|
|
22706
|
+
*/
|
|
22707
|
+
grants: external_exports.string().min(1).optional(),
|
|
22708
|
+
/**
|
|
22709
|
+
* When DorkOS pinned an approval given before approvals named content to
|
|
22710
|
+
* the files it found then (DOR-3068), once, on the first scan after the
|
|
22711
|
+
* upgrade. ISO 8601. Absent for every approval given since.
|
|
22712
|
+
*/
|
|
22713
|
+
pinnedOnFirstUse: external_exports.string().optional(),
|
|
22714
|
+
/**
|
|
22715
|
+
* Set once, by the `'0.126.1'` config migration, on an approval written
|
|
22716
|
+
* before approvals named content (DOR-3068). Only such an approval is pinned
|
|
22717
|
+
* to the files the next scan finds; a digest-less approval written since is
|
|
22718
|
+
* never pinned to whatever is on disk.
|
|
22719
|
+
*/
|
|
22720
|
+
legacyPathOnly: external_exports.boolean().optional(),
|
|
22721
|
+
/**
|
|
22722
|
+
* The digest of the exact screen code (the client bundle the app loads) the
|
|
22723
|
+
* yes was given to, for a copy that keeps path trust (DOR-3068). Path trust
|
|
22724
|
+
* covers the server half only: when the bundle the app would load differs,
|
|
22725
|
+
* the screen half stays off until a person approves again.
|
|
22726
|
+
*/
|
|
22727
|
+
clientDigest: external_exports.string().min(1).optional(),
|
|
22692
22728
|
/**
|
|
22693
22729
|
* The real path of the dev link this approval was given to (DOR-2696);
|
|
22694
22730
|
* absent for an installed copy. A dev link sits at its package's normal
|
|
@@ -22789,6 +22825,17 @@ var init_tooling = __esm({
|
|
|
22789
22825
|
* `operator-only` for the same reason as `approvedToRun`.
|
|
22790
22826
|
*/
|
|
22791
22827
|
approvedSources: external_exports.record(external_exports.string(), ExtensionApprovedSourceSchema).default(() => ({})),
|
|
22828
|
+
/**
|
|
22829
|
+
* The approved ids that named no copy when content pins arrived (DOR-3068),
|
|
22830
|
+
* written once by the `'0.126.1'` config migration. Only these are bound,
|
|
22831
|
+
* on a later scan, to the extension installed directly under
|
|
22832
|
+
* `{dorkHome}/extensions/<id>`; an id is dropped from here once bound. An
|
|
22833
|
+
* unsourced id not listed is never bound, so a folder an agent creates
|
|
22834
|
+
* later under an old approved name never inherits that approval.
|
|
22835
|
+
*
|
|
22836
|
+
* `operator-only` for the same reason as `approvedToRun`.
|
|
22837
|
+
*/
|
|
22838
|
+
legacyUnsourced: external_exports.array(external_exports.string()).optional(),
|
|
22792
22839
|
/**
|
|
22793
22840
|
* The permission set each approval covers, keyed by extension id
|
|
22794
22841
|
* (DOR-2686): what the extension declared when a person said yes.
|
|
@@ -22952,6 +22999,38 @@ var init_tooling = __esm({
|
|
|
22952
22999
|
* wants to run stops matching and is asked about again.
|
|
22953
23000
|
*/
|
|
22954
23001
|
refusedHooks: external_exports.array(external_exports.string()).default(() => []),
|
|
23002
|
+
/**
|
|
23003
|
+
* The state of each agent's own folder settings a person let run
|
|
23004
|
+
* (DOR-3068): its hooks and MCP choices in `.claude/settings*.json`, its
|
|
23005
|
+
* `.mcp.json`, and its agent file's MCP servers and account. Each entry is
|
|
23006
|
+
* `<agentId>@folder-config-<digest>`, where the digest covers the agent's
|
|
23007
|
+
* home and those three parts, so a change the agent makes waits for a person
|
|
23008
|
+
* instead of riding an old yes. An agent with no entry is pinned to what its
|
|
23009
|
+
* folder holds the first time it runs. Empty by default.
|
|
23010
|
+
*/
|
|
23011
|
+
approvedFolderConfig: external_exports.array(external_exports.string().min(1)).default(() => []),
|
|
23012
|
+
/**
|
|
23013
|
+
* The per-part digests behind each agent's yes in
|
|
23014
|
+
* {@link approvedFolderConfig}, by agent id, so a card can say which part
|
|
23015
|
+
* changed. Read only while a stored yes still digests to them.
|
|
23016
|
+
*/
|
|
23017
|
+
approvedFolderConfigParts: external_exports.record(
|
|
23018
|
+
external_exports.string(),
|
|
23019
|
+
external_exports.object({ hooks: external_exports.string(), mcpJson: external_exports.string(), manifest: external_exports.string() })
|
|
23020
|
+
).default(() => ({})),
|
|
23021
|
+
/**
|
|
23022
|
+
* The states a person turned down, in the same form as
|
|
23023
|
+
* {@link approvedFolderConfig}. Not asked about again until the settings
|
|
23024
|
+
* change again.
|
|
23025
|
+
*/
|
|
23026
|
+
refusedFolderConfig: external_exports.array(external_exports.string().min(1)).default(() => []),
|
|
23027
|
+
/**
|
|
23028
|
+
* Whether DorkOS has pinned the agents that already existed (DOR-3068). It
|
|
23029
|
+
* does that once, at the first start with the folder settings pin; after
|
|
23030
|
+
* that, an agent with no record whose home runs anything waits for a
|
|
23031
|
+
* person. Carried across a config wipe, so a wipe never re-pins.
|
|
23032
|
+
*/
|
|
23033
|
+
folderConfigPinned: external_exports.boolean().default(false),
|
|
22955
23034
|
/**
|
|
22956
23035
|
* The two decisions global scope records: which agent tools DorkOS shares
|
|
22957
23036
|
* your globally installed packages with, and when it last asked.
|
|
@@ -22988,6 +23067,10 @@ var init_tooling = __esm({
|
|
|
22988
23067
|
autoAdopt: false,
|
|
22989
23068
|
approvedHooks: [],
|
|
22990
23069
|
refusedHooks: [],
|
|
23070
|
+
approvedFolderConfig: [],
|
|
23071
|
+
approvedFolderConfigParts: {},
|
|
23072
|
+
refusedFolderConfig: [],
|
|
23073
|
+
folderConfigPinned: false,
|
|
22991
23074
|
global: { harnesses: [], askedAt: null }
|
|
22992
23075
|
}));
|
|
22993
23076
|
WorkbenchConfigSchema = external_exports.object({
|
|
@@ -26485,18 +26568,18 @@ var init_logger = __esm({
|
|
|
26485
26568
|
});
|
|
26486
26569
|
|
|
26487
26570
|
// ../shared/src/links.ts
|
|
26488
|
-
function join(base,
|
|
26489
|
-
if (
|
|
26490
|
-
return `${base}/${
|
|
26571
|
+
function join(base, path71) {
|
|
26572
|
+
if (path71 === "" || /^[/?#]/.test(path71)) return `${base}${path71}`;
|
|
26573
|
+
return `${base}/${path71}`;
|
|
26491
26574
|
}
|
|
26492
|
-
function siteUrl(
|
|
26493
|
-
return join(links.site,
|
|
26575
|
+
function siteUrl(path71 = "") {
|
|
26576
|
+
return join(links.site, path71);
|
|
26494
26577
|
}
|
|
26495
|
-
function docsUrl(
|
|
26496
|
-
return join(links.docs,
|
|
26578
|
+
function docsUrl(path71 = "") {
|
|
26579
|
+
return join(links.docs, path71);
|
|
26497
26580
|
}
|
|
26498
|
-
function repoUrl(
|
|
26499
|
-
return join(links.repo,
|
|
26581
|
+
function repoUrl(path71 = "") {
|
|
26582
|
+
return join(links.repo, path71);
|
|
26500
26583
|
}
|
|
26501
26584
|
var GITHUB_ORG, links;
|
|
26502
26585
|
var init_links = __esm({
|
|
@@ -26920,7 +27003,7 @@ import path2 from "path";
|
|
|
26920
27003
|
import { fileURLToPath } from "url";
|
|
26921
27004
|
function resolveVersion() {
|
|
26922
27005
|
if (env2.DORKOS_VERSION_OVERRIDE) return env2.DORKOS_VERSION_OVERRIDE;
|
|
26923
|
-
if (true) return "0.126.
|
|
27006
|
+
if (true) return "0.126.2";
|
|
26924
27007
|
const pkgPath = path2.join(path2.dirname(fileURLToPath(import.meta.url)), "../../package.json");
|
|
26925
27008
|
return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
26926
27009
|
}
|
|
@@ -27123,8 +27206,8 @@ and your settings stay in the file you renamed.`;
|
|
|
27123
27206
|
});
|
|
27124
27207
|
|
|
27125
27208
|
// ../../apps/server/src/services/core/config/browser-setting.ts
|
|
27126
|
-
function browserSettingRefusal(
|
|
27127
|
-
const enabled3 =
|
|
27209
|
+
function browserSettingRefusal(path71, value) {
|
|
27210
|
+
const enabled3 = path71 === "browser.enabled" ? value : path71 === "browser" && value !== null && typeof value === "object" ? value.enabled : void 0;
|
|
27128
27211
|
return enabled3 === true ? BROWSER_SETTING_UNAVAILABLE : null;
|
|
27129
27212
|
}
|
|
27130
27213
|
var BROWSER_SETTING_UNAVAILABLE;
|
|
@@ -27156,9 +27239,9 @@ function hubPinnedRead(key, value) {
|
|
|
27156
27239
|
}
|
|
27157
27240
|
return value;
|
|
27158
27241
|
}
|
|
27159
|
-
function hubSettingRefusal(
|
|
27242
|
+
function hubSettingRefusal(path71, value) {
|
|
27160
27243
|
if (currentServerRole() !== "hub") return null;
|
|
27161
|
-
const enabled3 =
|
|
27244
|
+
const enabled3 = path71 === "auth.enabled" ? value : path71 === "auth" && value !== null && typeof value === "object" ? value.enabled : true;
|
|
27162
27245
|
return enabled3 === false ? HUB_LOGIN_ALWAYS_ON : null;
|
|
27163
27246
|
}
|
|
27164
27247
|
var HUB_LOGIN_ALWAYS_ON;
|
|
@@ -27238,9 +27321,9 @@ var init_trusted_carryovers = __esm({
|
|
|
27238
27321
|
});
|
|
27239
27322
|
|
|
27240
27323
|
// ../../apps/server/src/services/core/safe-defaults/protected-state.ts
|
|
27241
|
-
function readPath(root,
|
|
27324
|
+
function readPath(root, path71) {
|
|
27242
27325
|
let cursor = root;
|
|
27243
|
-
for (const part of
|
|
27326
|
+
for (const part of path71.split(".")) {
|
|
27244
27327
|
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
27245
27328
|
cursor = cursor[part];
|
|
27246
27329
|
}
|
|
@@ -27252,8 +27335,8 @@ function sectionSchemaAccepts(section, draft) {
|
|
|
27252
27335
|
if (!schema3) return false;
|
|
27253
27336
|
return schema3.safeParse(draft).success;
|
|
27254
27337
|
}
|
|
27255
|
-
function writePath(root,
|
|
27256
|
-
const parts =
|
|
27338
|
+
function writePath(root, path71, value) {
|
|
27339
|
+
const parts = path71.split(".");
|
|
27257
27340
|
const leaf = parts.pop();
|
|
27258
27341
|
if (leaf === void 0) return;
|
|
27259
27342
|
let cursor = root;
|
|
@@ -27386,13 +27469,13 @@ function applyProtectedState(store, salvaged) {
|
|
|
27386
27469
|
sections.set("telemetry", { ...section("telemetry"), ...salvaged.telemetry });
|
|
27387
27470
|
label("telemetry", "telemetry (your consent choice)");
|
|
27388
27471
|
}
|
|
27389
|
-
for (const [
|
|
27390
|
-
const [top, ...rest] =
|
|
27472
|
+
for (const [path71, value] of Object.entries(salvaged.leaves)) {
|
|
27473
|
+
const [top, ...rest] = path71.split(".");
|
|
27391
27474
|
if (top === void 0) continue;
|
|
27392
27475
|
const draft = section(top);
|
|
27393
27476
|
if (rest.length === 0) continue;
|
|
27394
27477
|
writePath(draft, rest.join("."), value);
|
|
27395
|
-
label(top,
|
|
27478
|
+
label(top, path71);
|
|
27396
27479
|
}
|
|
27397
27480
|
const restored = [];
|
|
27398
27481
|
for (const [name2, value] of sections) {
|
|
@@ -27418,9 +27501,9 @@ function restoreProtectedState(store, stored, context2) {
|
|
|
27418
27501
|
if (restored.length > 0) {
|
|
27419
27502
|
logger.warn(`[Config] ${context2}: kept your safer settings \u2014 ${restored.join(", ")}`);
|
|
27420
27503
|
}
|
|
27421
|
-
for (const { path:
|
|
27504
|
+
for (const { path: path71, reason } of salvaged.dropped) {
|
|
27422
27505
|
logger.warn(
|
|
27423
|
-
`[Config] Could not keep your ${
|
|
27506
|
+
`[Config] Could not keep your ${path71} setting: ${reason}. It is back at the default.`
|
|
27424
27507
|
);
|
|
27425
27508
|
}
|
|
27426
27509
|
}
|
|
@@ -27458,6 +27541,12 @@ var init_protected_state = __esm({
|
|
|
27458
27541
|
protectiveValue: false,
|
|
27459
27542
|
reason: "The external /mcp tool endpoint defaults ON. Someone who closed it should not have it re-opened by a wipe."
|
|
27460
27543
|
},
|
|
27544
|
+
{
|
|
27545
|
+
path: "harness.folderConfigPinned",
|
|
27546
|
+
direction: "boolean",
|
|
27547
|
+
protectiveValue: true,
|
|
27548
|
+
reason: "The first start pins the agents DorkOS already had, as they stand (DOR-3068). After a wipe, an agent with no record should wait for a person, never be pinned again unasked."
|
|
27549
|
+
},
|
|
27461
27550
|
{
|
|
27462
27551
|
path: "harness.autoSync",
|
|
27463
27552
|
direction: "boolean",
|
|
@@ -27754,16 +27843,16 @@ function processSegment(segment, parts) {
|
|
|
27754
27843
|
}
|
|
27755
27844
|
return true;
|
|
27756
27845
|
}
|
|
27757
|
-
function parsePath(
|
|
27758
|
-
if (typeof
|
|
27759
|
-
throw new TypeError(`Expected a string, got ${typeof
|
|
27846
|
+
function parsePath(path71) {
|
|
27847
|
+
if (typeof path71 !== "string") {
|
|
27848
|
+
throw new TypeError(`Expected a string, got ${typeof path71}`);
|
|
27760
27849
|
}
|
|
27761
27850
|
const parts = [];
|
|
27762
27851
|
let currentSegment = "";
|
|
27763
27852
|
let currentPart = "start";
|
|
27764
27853
|
let isEscaping = false;
|
|
27765
27854
|
let position = 0;
|
|
27766
|
-
for (const character of
|
|
27855
|
+
for (const character of path71) {
|
|
27767
27856
|
position++;
|
|
27768
27857
|
if (isEscaping) {
|
|
27769
27858
|
currentSegment += character;
|
|
@@ -27873,13 +27962,13 @@ function parsePath(path68) {
|
|
|
27873
27962
|
}
|
|
27874
27963
|
return parts;
|
|
27875
27964
|
}
|
|
27876
|
-
function normalizePath(
|
|
27877
|
-
if (typeof
|
|
27878
|
-
return parsePath(
|
|
27965
|
+
function normalizePath(path71) {
|
|
27966
|
+
if (typeof path71 === "string") {
|
|
27967
|
+
return parsePath(path71);
|
|
27879
27968
|
}
|
|
27880
|
-
if (Array.isArray(
|
|
27969
|
+
if (Array.isArray(path71)) {
|
|
27881
27970
|
const normalized = [];
|
|
27882
|
-
for (const [index2, segment] of
|
|
27971
|
+
for (const [index2, segment] of path71.entries()) {
|
|
27883
27972
|
if (typeof segment !== "string" && typeof segment !== "number") {
|
|
27884
27973
|
throw new TypeError(`Expected a string or number for path segment at index ${index2}, got ${typeof segment}`);
|
|
27885
27974
|
}
|
|
@@ -27899,11 +27988,11 @@ function normalizePath(path68) {
|
|
|
27899
27988
|
}
|
|
27900
27989
|
return [];
|
|
27901
27990
|
}
|
|
27902
|
-
function getProperty(object2,
|
|
27903
|
-
if (!isObject2(object2) || typeof
|
|
27991
|
+
function getProperty(object2, path71, value) {
|
|
27992
|
+
if (!isObject2(object2) || typeof path71 !== "string" && !Array.isArray(path71)) {
|
|
27904
27993
|
return value === void 0 ? object2 : value;
|
|
27905
27994
|
}
|
|
27906
|
-
const pathArray = normalizePath(
|
|
27995
|
+
const pathArray = normalizePath(path71);
|
|
27907
27996
|
if (pathArray.length === 0) {
|
|
27908
27997
|
return value;
|
|
27909
27998
|
}
|
|
@@ -27919,12 +28008,12 @@ function getProperty(object2, path68, value) {
|
|
|
27919
28008
|
}
|
|
27920
28009
|
return object2 === void 0 ? value : object2;
|
|
27921
28010
|
}
|
|
27922
|
-
function setProperty(object2,
|
|
27923
|
-
if (!isObject2(object2) || typeof
|
|
28011
|
+
function setProperty(object2, path71, value) {
|
|
28012
|
+
if (!isObject2(object2) || typeof path71 !== "string" && !Array.isArray(path71)) {
|
|
27924
28013
|
return object2;
|
|
27925
28014
|
}
|
|
27926
28015
|
const root = object2;
|
|
27927
|
-
const pathArray = normalizePath(
|
|
28016
|
+
const pathArray = normalizePath(path71);
|
|
27928
28017
|
if (pathArray.length === 0) {
|
|
27929
28018
|
return object2;
|
|
27930
28019
|
}
|
|
@@ -27941,11 +28030,11 @@ function setProperty(object2, path68, value) {
|
|
|
27941
28030
|
}
|
|
27942
28031
|
return root;
|
|
27943
28032
|
}
|
|
27944
|
-
function deleteProperty(object2,
|
|
27945
|
-
if (!isObject2(object2) || typeof
|
|
28033
|
+
function deleteProperty(object2, path71) {
|
|
28034
|
+
if (!isObject2(object2) || typeof path71 !== "string" && !Array.isArray(path71)) {
|
|
27946
28035
|
return false;
|
|
27947
28036
|
}
|
|
27948
|
-
const pathArray = normalizePath(
|
|
28037
|
+
const pathArray = normalizePath(path71);
|
|
27949
28038
|
if (pathArray.length === 0) {
|
|
27950
28039
|
return false;
|
|
27951
28040
|
}
|
|
@@ -27965,11 +28054,11 @@ function deleteProperty(object2, path68) {
|
|
|
27965
28054
|
}
|
|
27966
28055
|
}
|
|
27967
28056
|
}
|
|
27968
|
-
function hasProperty(object2,
|
|
27969
|
-
if (!isObject2(object2) || typeof
|
|
28057
|
+
function hasProperty(object2, path71) {
|
|
28058
|
+
if (!isObject2(object2) || typeof path71 !== "string" && !Array.isArray(path71)) {
|
|
27970
28059
|
return false;
|
|
27971
28060
|
}
|
|
27972
|
-
const pathArray = normalizePath(
|
|
28061
|
+
const pathArray = normalizePath(path71);
|
|
27973
28062
|
if (pathArray.length === 0) {
|
|
27974
28063
|
return false;
|
|
27975
28064
|
}
|
|
@@ -31788,8 +31877,8 @@ var require_utils = __commonJS({
|
|
|
31788
31877
|
}
|
|
31789
31878
|
return ind;
|
|
31790
31879
|
}
|
|
31791
|
-
function removeDotSegments(
|
|
31792
|
-
let input4 =
|
|
31880
|
+
function removeDotSegments(path71) {
|
|
31881
|
+
let input4 = path71;
|
|
31793
31882
|
const output2 = [];
|
|
31794
31883
|
let nextSlash = -1;
|
|
31795
31884
|
let len = 0;
|
|
@@ -32198,8 +32287,8 @@ var require_schemes = __commonJS({
|
|
|
32198
32287
|
}
|
|
32199
32288
|
if (wsComponent.resourceName) {
|
|
32200
32289
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
32201
|
-
const
|
|
32202
|
-
wsComponent.path =
|
|
32290
|
+
const path71 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
32291
|
+
wsComponent.path = path71 && path71 !== "/" ? path71 : void 0;
|
|
32203
32292
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
32204
32293
|
wsComponent.resourceName = void 0;
|
|
32205
32294
|
}
|
|
@@ -39758,22 +39847,22 @@ function withPath(root, segments, value) {
|
|
|
39758
39847
|
if (!isPlainObject4(root)) return root;
|
|
39759
39848
|
return { ...root, [head]: withPath(root[head], rest, value) };
|
|
39760
39849
|
}
|
|
39761
|
-
function leavesUnder(
|
|
39762
|
-
const section =
|
|
39850
|
+
function leavesUnder(path71, policy) {
|
|
39851
|
+
const section = path71.split(".")[0];
|
|
39763
39852
|
const candidates = policy.bySection.get(section);
|
|
39764
39853
|
if (candidates === void 0) return NO_RELAXED;
|
|
39765
|
-
if (
|
|
39766
|
-
return candidates.filter((leaf) => leaf.path ===
|
|
39854
|
+
if (path71 === section) return candidates;
|
|
39855
|
+
return candidates.filter((leaf) => leaf.path === path71 || leaf.path.startsWith(`${path71}.`));
|
|
39767
39856
|
}
|
|
39768
|
-
function relativeSegments(
|
|
39769
|
-
return leafPath ===
|
|
39857
|
+
function relativeSegments(path71, leafPath) {
|
|
39858
|
+
return leafPath === path71 ? [] : leafPath.slice(path71.length + 1).split(".");
|
|
39770
39859
|
}
|
|
39771
|
-
function repairWidenedLeaves(
|
|
39772
|
-
const leaves = leavesUnder(
|
|
39860
|
+
function repairWidenedLeaves(path71, value, policy) {
|
|
39861
|
+
const leaves = leavesUnder(path71, policy);
|
|
39773
39862
|
let repaired = value;
|
|
39774
39863
|
let skewed;
|
|
39775
39864
|
for (const leaf of leaves) {
|
|
39776
|
-
const relative12 = relativeSegments(
|
|
39865
|
+
const relative12 = relativeSegments(path71, leaf.path);
|
|
39777
39866
|
const stored = relative12.length === 0 ? value : valueAt(value, relative12);
|
|
39778
39867
|
if (stored === MISSING) continue;
|
|
39779
39868
|
if (stored === leaf.fallback) continue;
|
|
@@ -40954,6 +41043,33 @@ function seedUiDmViewLeaves(store) {
|
|
|
40954
41043
|
...!("showSessions" in ui) && { showSessions: false }
|
|
40955
41044
|
});
|
|
40956
41045
|
}
|
|
41046
|
+
function markLegacyPathOnlyApprovals(store) {
|
|
41047
|
+
const extensions = store.get("extensions");
|
|
41048
|
+
if (extensions === null || typeof extensions !== "object" || Array.isArray(extensions)) return;
|
|
41049
|
+
const sources2 = extensions.approvedSources;
|
|
41050
|
+
if (sources2 === null || typeof sources2 !== "object" || Array.isArray(sources2)) return;
|
|
41051
|
+
const approvedToRun = extensions.approvedToRun;
|
|
41052
|
+
const unsourced = Array.isArray(approvedToRun) ? approvedToRun.filter(
|
|
41053
|
+
(id) => typeof id === "string" && !(id in sources2)
|
|
41054
|
+
) : [];
|
|
41055
|
+
const listed2 = extensions.legacyUnsourced;
|
|
41056
|
+
const needsList = unsourced.length > 0 && !Array.isArray(listed2);
|
|
41057
|
+
let changed = false;
|
|
41058
|
+
const next = {};
|
|
41059
|
+
for (const [id, source] of Object.entries(sources2)) {
|
|
41060
|
+
const entry = source;
|
|
41061
|
+
const pathOnly = entry !== null && typeof entry === "object" && !entry.digest && !entry.authorHome && !entry.grants && !entry.devLink && entry.legacyPathOnly !== true;
|
|
41062
|
+
next[id] = pathOnly ? { ...entry, legacyPathOnly: true } : source;
|
|
41063
|
+
changed ||= pathOnly;
|
|
41064
|
+
}
|
|
41065
|
+
if (changed || needsList) {
|
|
41066
|
+
store.set("extensions", {
|
|
41067
|
+
...extensions,
|
|
41068
|
+
approvedSources: next,
|
|
41069
|
+
...needsList ? { legacyUnsourced: unsourced } : {}
|
|
41070
|
+
});
|
|
41071
|
+
}
|
|
41072
|
+
}
|
|
40957
41073
|
var KEPT_FROM_AUTO_MOVES_ACCOUNT_ID;
|
|
40958
41074
|
var init_v0_90_onward = __esm({
|
|
40959
41075
|
"../../apps/server/src/services/core/config-migrations/v0-90-onward.ts"() {
|
|
@@ -41668,7 +41784,15 @@ var init_config_migrations = __esm({
|
|
|
41668
41784
|
// Writes `ui.dmView: false` and `ui.showSessions: false` where the stored
|
|
41669
41785
|
// `ui` section lacks them, and touches nothing else (DOR-3074). See
|
|
41670
41786
|
// `seedUiDmViewLeaves`.
|
|
41671
|
-
"0.125.0": seedUiDmViewLeaves
|
|
41787
|
+
"0.125.0": seedUiDmViewLeaves,
|
|
41788
|
+
// v0.126.0 is the newest tag, so this opens 0.126.1. Frozen from merge;
|
|
41789
|
+
// anything further opens `'0.127.0'`.
|
|
41790
|
+
//
|
|
41791
|
+
// Marks each extension approval that names no content with
|
|
41792
|
+
// `legacyPathOnly: true`, and touches nothing else (DOR-3068). Only a marked
|
|
41793
|
+
// approval is pinned to the files the next scan finds. See
|
|
41794
|
+
// `markLegacyPathOnlyApprovals`.
|
|
41795
|
+
"0.126.1": markLegacyPathOnlyApprovals
|
|
41672
41796
|
};
|
|
41673
41797
|
}
|
|
41674
41798
|
});
|
|
@@ -41733,6 +41857,7 @@ __export(config_manager_exports, {
|
|
|
41733
41857
|
generalizeTelemetryConsent: () => generalizeTelemetryConsent,
|
|
41734
41858
|
initConfigManager: () => initConfigManager,
|
|
41735
41859
|
keepAccountOutOfAutoMoves: () => keepAccountOutOfAutoMoves,
|
|
41860
|
+
markLegacyPathOnlyApprovals: () => markLegacyPathOnlyApprovals,
|
|
41736
41861
|
migrateClaudeAccountRegistry: () => migrateClaudeAccountRegistry,
|
|
41737
41862
|
migrateSidebarMembersToItemRefs: () => migrateSidebarMembersToItemRefs,
|
|
41738
41863
|
migrateSidebarSectionPrefs: () => migrateSidebarSectionPrefs,
|
|
@@ -45609,16 +45734,16 @@ function resolveRelativePath(source, context2) {
|
|
|
45609
45734
|
throw new ResolvePluginSourceError('Relative paths must not contain ".."');
|
|
45610
45735
|
}
|
|
45611
45736
|
const startsWithDotSlash = source.startsWith("./");
|
|
45612
|
-
let
|
|
45737
|
+
let path71;
|
|
45613
45738
|
if (startsWithDotSlash) {
|
|
45614
|
-
|
|
45739
|
+
path71 = stripLeadingDotSlash(source);
|
|
45615
45740
|
} else {
|
|
45616
45741
|
const pluginRoot = normalizePluginRoot(context2.pluginRoot);
|
|
45617
|
-
|
|
45742
|
+
path71 = pluginRoot ? `${pluginRoot}/${source}` : source;
|
|
45618
45743
|
}
|
|
45619
45744
|
return {
|
|
45620
45745
|
type: "relative-path",
|
|
45621
|
-
path:
|
|
45746
|
+
path: path71,
|
|
45622
45747
|
marketplaceRoot: context2.marketplaceRoot
|
|
45623
45748
|
};
|
|
45624
45749
|
}
|
|
@@ -46200,7 +46325,7 @@ var init_marketplace_schemas = __esm({
|
|
|
46200
46325
|
default: "runs at the most careful setting its agent offers",
|
|
46201
46326
|
plan: "can only read and plan, and cannot change anything",
|
|
46202
46327
|
acceptEdits: "can change files on its own, and on some agents run commands too",
|
|
46203
|
-
dontAsk: "
|
|
46328
|
+
dontAsk: "never asks, and refuses tools it is not allowed; it can still read its own folder",
|
|
46204
46329
|
bypassPermissions: "can run any command without a permission prompt",
|
|
46205
46330
|
auto: "decides for itself which actions are safe to take"
|
|
46206
46331
|
};
|
|
@@ -51109,11 +51234,11 @@ var require_dist2 = __commonJS({
|
|
|
51109
51234
|
return schema3;
|
|
51110
51235
|
}
|
|
51111
51236
|
generatePath(route) {
|
|
51112
|
-
const { method, path:
|
|
51237
|
+
const { method, path: path71, request, responses } = route, pathItemConfig = __rest(route, ["method", "path", "request", "responses"]);
|
|
51113
51238
|
const generatedResponses = mapValues(responses, (response) => {
|
|
51114
51239
|
return this.getResponse(response);
|
|
51115
51240
|
});
|
|
51116
|
-
const parameters = enhanceMissingParametersError(() => this.getParameters(request), { route: `${method} ${
|
|
51241
|
+
const parameters = enhanceMissingParametersError(() => this.getParameters(request), { route: `${method} ${path71}` });
|
|
51117
51242
|
const requestBody = this.getRequestBody(request === null || request === void 0 ? void 0 : request.body);
|
|
51118
51243
|
const routeDoc = {
|
|
51119
51244
|
[method]: Object.assign(Object.assign(Object.assign(Object.assign({}, pathItemConfig), parameters.length > 0 ? {
|
|
@@ -51580,10 +51705,10 @@ var init_canvas_channel_schemas = __esm({
|
|
|
51580
51705
|
});
|
|
51581
51706
|
});
|
|
51582
51707
|
CanvasChannelPointerSchema = external_exports.string().max(4096).refine(
|
|
51583
|
-
(
|
|
51584
|
-
if (
|
|
51585
|
-
if (!
|
|
51586
|
-
return
|
|
51708
|
+
(path71) => {
|
|
51709
|
+
if (path71 === "") return true;
|
|
51710
|
+
if (!path71.startsWith("/")) return false;
|
|
51711
|
+
return path71.slice(1).split("/").every(
|
|
51587
51712
|
(segment) => !/~(?![01])/u.test(segment) && !unsafeKeys.has(segment.replaceAll("~1", "/").replaceAll("~0", "~"))
|
|
51588
51713
|
);
|
|
51589
51714
|
},
|
|
@@ -59103,9 +59228,9 @@ function substitutePlaceholders(value) {
|
|
|
59103
59228
|
}
|
|
59104
59229
|
return value;
|
|
59105
59230
|
}
|
|
59106
|
-
function getValueAtPath(value,
|
|
59231
|
+
function getValueAtPath(value, path71) {
|
|
59107
59232
|
let current3 = value;
|
|
59108
|
-
for (const segment of
|
|
59233
|
+
for (const segment of path71) {
|
|
59109
59234
|
if (current3 === null || typeof current3 !== "object") return void 0;
|
|
59110
59235
|
current3 = current3[segment];
|
|
59111
59236
|
}
|
|
@@ -59134,12 +59259,12 @@ var init_ui_template = __esm({
|
|
|
59134
59259
|
const result2 = WidgetDocumentSchema.safeParse(substitutePlaceholders(value));
|
|
59135
59260
|
if (result2.success) return;
|
|
59136
59261
|
for (const issue2 of result2.error.issues) {
|
|
59137
|
-
const
|
|
59262
|
+
const path71 = issue2.path.filter(
|
|
59138
59263
|
(segment) => segment !== void 0 && typeof segment !== "symbol"
|
|
59139
59264
|
);
|
|
59140
|
-
const original = getValueAtPath(value,
|
|
59141
|
-
const message2 = typeof original === "string" && WHOLE_PLACEHOLDER_PATTERN.test(original) ? `Placeholder "${original}" is not allowed in field "${
|
|
59142
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path:
|
|
59265
|
+
const original = getValueAtPath(value, path71);
|
|
59266
|
+
const message2 = typeof original === "string" && WHOLE_PLACEHOLDER_PATTERN.test(original) ? `Placeholder "${original}" is not allowed in field "${path71.join(".")}" \u2014 placeholders may only fill free-form string fields, not number or enum fields` : issue2.message;
|
|
59267
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: path71, message: message2 });
|
|
59143
59268
|
}
|
|
59144
59269
|
}).transform((value) => value)
|
|
59145
59270
|
});
|
|
@@ -62237,7 +62362,7 @@ var init_context = __esm({
|
|
|
62237
62362
|
init_utils();
|
|
62238
62363
|
init_cookies();
|
|
62239
62364
|
init_validator2();
|
|
62240
|
-
createInternalContext = async (context2, { options, path:
|
|
62365
|
+
createInternalContext = async (context2, { options, path: path71 }) => {
|
|
62241
62366
|
const headers = new Headers();
|
|
62242
62367
|
let responseStatus = void 0;
|
|
62243
62368
|
const { data, error: error63 } = await runValidation(options, context2);
|
|
@@ -62249,7 +62374,7 @@ var init_context = __esm({
|
|
|
62249
62374
|
...context2,
|
|
62250
62375
|
body: data.body,
|
|
62251
62376
|
query: data.query,
|
|
62252
|
-
path: context2.path ||
|
|
62377
|
+
path: context2.path || path71 || "virtual:",
|
|
62253
62378
|
context: "context" in context2 && context2.context ? context2.context : {},
|
|
62254
62379
|
returned: void 0,
|
|
62255
62380
|
headers: context2?.headers,
|
|
@@ -62476,16 +62601,16 @@ var init_to_response = __esm({
|
|
|
62476
62601
|
|
|
62477
62602
|
// ../../node_modules/.pnpm/better-call@1.4.0_zod@4.6.7/node_modules/better-call/dist/endpoint.mjs
|
|
62478
62603
|
function createEndpoint(pathOrOptions, handlerOrOptions, handlerOrNever) {
|
|
62479
|
-
const
|
|
62604
|
+
const path71 = typeof pathOrOptions === "string" ? pathOrOptions : void 0;
|
|
62480
62605
|
const options = typeof handlerOrOptions === "object" ? handlerOrOptions : pathOrOptions;
|
|
62481
62606
|
const handler = typeof handlerOrOptions === "function" ? handlerOrOptions : handlerOrNever;
|
|
62482
62607
|
if ((options.method === "GET" || options.method === "HEAD") && options.body) throw new BetterCallError("Body is not allowed with GET or HEAD methods");
|
|
62483
|
-
if (
|
|
62608
|
+
if (path71 && /\/{2,}/.test(path71)) throw new BetterCallError("Path cannot contain consecutive slashes");
|
|
62484
62609
|
const internalHandler = async (...inputCtx) => {
|
|
62485
62610
|
const context2 = inputCtx[0] || {};
|
|
62486
62611
|
const { data: internalContext, error: validationError } = await tryCatch(createInternalContext(context2, {
|
|
62487
62612
|
options,
|
|
62488
|
-
path:
|
|
62613
|
+
path: path71
|
|
62489
62614
|
}));
|
|
62490
62615
|
if (validationError) {
|
|
62491
62616
|
if (!(validationError instanceof ValidationError)) throw validationError;
|
|
@@ -62524,7 +62649,7 @@ function createEndpoint(pathOrOptions, handlerOrOptions, handlerOrNever) {
|
|
|
62524
62649
|
} : response;
|
|
62525
62650
|
};
|
|
62526
62651
|
internalHandler.options = options;
|
|
62527
|
-
internalHandler.path =
|
|
62652
|
+
internalHandler.path = path71;
|
|
62528
62653
|
return internalHandler;
|
|
62529
62654
|
}
|
|
62530
62655
|
function combineMiddleware(local, configured) {
|
|
@@ -62539,8 +62664,8 @@ var init_endpoint = __esm({
|
|
|
62539
62664
|
createEndpoint.create = (opts) => {
|
|
62540
62665
|
function createConfiguredEndpoint(...args) {
|
|
62541
62666
|
if (args.length === 3) {
|
|
62542
|
-
const [
|
|
62543
|
-
return createEndpoint(
|
|
62667
|
+
const [path71, options2, handler2] = args;
|
|
62668
|
+
return createEndpoint(path71, {
|
|
62544
62669
|
...options2,
|
|
62545
62670
|
use: combineMiddleware(options2.use, opts?.use)
|
|
62546
62671
|
}, handler2);
|
|
@@ -62810,39 +62935,39 @@ function createRouter() {
|
|
|
62810
62935
|
static: new NullProtoObj()
|
|
62811
62936
|
};
|
|
62812
62937
|
}
|
|
62813
|
-
function scanFirstGroup(
|
|
62938
|
+
function scanFirstGroup(path71) {
|
|
62814
62939
|
let i2 = 0;
|
|
62815
62940
|
let depth = 0;
|
|
62816
|
-
for (; i2 <
|
|
62817
|
-
const c3 =
|
|
62941
|
+
for (; i2 < path71.length; i2++) {
|
|
62942
|
+
const c3 = path71.charCodeAt(i2);
|
|
62818
62943
|
if (c3 === 92) i2++;
|
|
62819
62944
|
else if (c3 === 40) depth++;
|
|
62820
62945
|
else if (c3 === 41 && depth > 0) depth--;
|
|
62821
62946
|
else if (c3 === 123 && depth === 0) break;
|
|
62822
62947
|
}
|
|
62823
|
-
if (i2 >=
|
|
62948
|
+
if (i2 >= path71.length) return;
|
|
62824
62949
|
let j = i2 + 1;
|
|
62825
62950
|
depth = 0;
|
|
62826
|
-
for (; j <
|
|
62827
|
-
const c3 =
|
|
62951
|
+
for (; j < path71.length; j++) {
|
|
62952
|
+
const c3 = path71.charCodeAt(j);
|
|
62828
62953
|
if (c3 === 92) j++;
|
|
62829
62954
|
else if (c3 === 40) depth++;
|
|
62830
62955
|
else if (c3 === 41 && depth > 0) depth--;
|
|
62831
62956
|
else if (c3 === 125 && depth === 0) break;
|
|
62832
62957
|
}
|
|
62833
|
-
if (j >=
|
|
62834
|
-
const mod =
|
|
62958
|
+
if (j >= path71.length) return;
|
|
62959
|
+
const mod = path71[j + 1];
|
|
62835
62960
|
const hasMod = mod === "?" || mod === "+" || mod === "*";
|
|
62836
62961
|
return [
|
|
62837
|
-
|
|
62838
|
-
|
|
62839
|
-
|
|
62962
|
+
path71.slice(0, i2),
|
|
62963
|
+
path71.slice(i2 + 1, j),
|
|
62964
|
+
path71.slice(j + (hasMod ? 2 : 1)),
|
|
62840
62965
|
hasMod ? mod : void 0
|
|
62841
62966
|
];
|
|
62842
62967
|
}
|
|
62843
|
-
function expandGroupDelimiters(
|
|
62844
|
-
if (!
|
|
62845
|
-
const group = scanFirstGroup(
|
|
62968
|
+
function expandGroupDelimiters(path71) {
|
|
62969
|
+
if (!path71.includes("{")) return;
|
|
62970
|
+
const group = scanFirstGroup(path71);
|
|
62846
62971
|
if (!group) return;
|
|
62847
62972
|
const [pre, body, suf, mod] = group;
|
|
62848
62973
|
if (!mod) return [pre + body + suf];
|
|
@@ -62910,9 +63035,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
|
|
|
62910
63035
|
}
|
|
62911
63036
|
return [replaced, nextIndex];
|
|
62912
63037
|
}
|
|
62913
|
-
function encodeEscapes(
|
|
62914
|
-
if (!
|
|
62915
|
-
return
|
|
63038
|
+
function encodeEscapes(path71) {
|
|
63039
|
+
if (!path71.includes("\\")) return path71;
|
|
63040
|
+
return path71.replace(/\\([:(){}])/g, (_3, c3) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c3)]);
|
|
62916
63041
|
}
|
|
62917
63042
|
function segmentKey(segment) {
|
|
62918
63043
|
if (segment.startsWith("**")) return 2;
|
|
@@ -62941,22 +63066,22 @@ function expandModifiers(segments) {
|
|
|
62941
63066
|
return m2[2] === "+" ? [wc] : [wc, without];
|
|
62942
63067
|
}
|
|
62943
63068
|
}
|
|
62944
|
-
function normalizePath2(
|
|
62945
|
-
if (!
|
|
63069
|
+
function normalizePath2(path71) {
|
|
63070
|
+
if (!path71.includes("/.")) return path71;
|
|
62946
63071
|
const r3 = [];
|
|
62947
|
-
for (const s2 of
|
|
63072
|
+
for (const s2 of path71.split("/")) if (s2 === ".") continue;
|
|
62948
63073
|
else if (s2 === ".." && r3.length > 1) r3.pop();
|
|
62949
63074
|
else r3.push(s2);
|
|
62950
63075
|
return r3.join("/") || "/";
|
|
62951
63076
|
}
|
|
62952
|
-
function splitPath(
|
|
62953
|
-
const s2 =
|
|
63077
|
+
function splitPath(path71) {
|
|
63078
|
+
const s2 = path71.split("/");
|
|
62954
63079
|
s2.shift();
|
|
62955
63080
|
if (s2[s2.length - 1] === "") s2.pop();
|
|
62956
63081
|
return s2;
|
|
62957
63082
|
}
|
|
62958
|
-
function splitRoute(
|
|
62959
|
-
const s2 = splitPath(
|
|
63083
|
+
function splitRoute(path71) {
|
|
63084
|
+
const s2 = splitPath(path71);
|
|
62960
63085
|
while (s2[s2.length - 1] === "") s2.pop();
|
|
62961
63086
|
return s2;
|
|
62962
63087
|
}
|
|
@@ -62972,16 +63097,16 @@ function getMatchParams(segments, paramsMap) {
|
|
|
62972
63097
|
}
|
|
62973
63098
|
return params;
|
|
62974
63099
|
}
|
|
62975
|
-
function addRoute(ctx, method = "",
|
|
63100
|
+
function addRoute(ctx, method = "", path71, data) {
|
|
62976
63101
|
method = method.toUpperCase();
|
|
62977
|
-
if (
|
|
62978
|
-
const groupExpanded = expandGroupDelimiters(
|
|
63102
|
+
if (path71.charCodeAt(0) !== 47) path71 = `/${path71}`;
|
|
63103
|
+
const groupExpanded = expandGroupDelimiters(path71);
|
|
62979
63104
|
if (groupExpanded) {
|
|
62980
63105
|
for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
|
|
62981
63106
|
return;
|
|
62982
63107
|
}
|
|
62983
|
-
|
|
62984
|
-
const segments = splitRoute(
|
|
63108
|
+
path71 = encodeEscapes(path71);
|
|
63109
|
+
const segments = splitRoute(path71);
|
|
62985
63110
|
const expanded = expandModifiers(segments);
|
|
62986
63111
|
if (expanded) {
|
|
62987
63112
|
for (const p of expanded) addRoute(ctx, method, p, data);
|
|
@@ -63072,15 +63197,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
|
|
|
63072
63197
|
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);
|
|
63073
63198
|
return [new RegExp(`^${regex2}$`), _i];
|
|
63074
63199
|
}
|
|
63075
|
-
function findRoute(ctx, method = "",
|
|
63076
|
-
if (opts?.normalize)
|
|
63077
|
-
if (
|
|
63078
|
-
const staticNode = ctx.static[
|
|
63200
|
+
function findRoute(ctx, method = "", path71, opts) {
|
|
63201
|
+
if (opts?.normalize) path71 = normalizePath2(path71);
|
|
63202
|
+
if (path71.charCodeAt(path71.length - 1) === 47) path71 = path71.slice(0, -1);
|
|
63203
|
+
const staticNode = ctx.static[path71];
|
|
63079
63204
|
if (staticNode && staticNode.methods) {
|
|
63080
63205
|
const staticMatch = staticNode.methods[method] || staticNode.methods[""];
|
|
63081
63206
|
if (staticMatch !== void 0) return staticMatch[0];
|
|
63082
63207
|
}
|
|
63083
|
-
const segments = splitPath(
|
|
63208
|
+
const segments = splitPath(path71);
|
|
63084
63209
|
const match = _lookupTree(ctx.root, method, segments, 0);
|
|
63085
63210
|
if (match === void 0) return;
|
|
63086
63211
|
if (opts?.params === false) return match;
|
|
@@ -63142,10 +63267,10 @@ function _selectMatcher(methods2, method, segments, dynamicTerminal, optionalOnl
|
|
|
63142
63267
|
}
|
|
63143
63268
|
return best;
|
|
63144
63269
|
}
|
|
63145
|
-
function findAllRoutes(ctx, method = "",
|
|
63146
|
-
if (opts?.normalize)
|
|
63147
|
-
if (
|
|
63148
|
-
const segments = splitPath(
|
|
63270
|
+
function findAllRoutes(ctx, method = "", path71, opts) {
|
|
63271
|
+
if (opts?.normalize) path71 = normalizePath2(path71);
|
|
63272
|
+
if (path71.charCodeAt(path71.length - 1) === 47) path71 = path71.slice(0, -1);
|
|
63273
|
+
const segments = splitPath(path71);
|
|
63149
63274
|
const matches = _findAll(ctx.root, method, segments, 0);
|
|
63150
63275
|
if (opts?.params === false) return matches;
|
|
63151
63276
|
return matches.map((m2) => {
|
|
@@ -63249,25 +63374,25 @@ var init_router = __esm({
|
|
|
63249
63374
|
const methods2 = Array.isArray(endpoint.options?.method) ? endpoint.options.method : [endpoint.options?.method];
|
|
63250
63375
|
for (const method of methods2) addRoute(router2, method, endpoint.path, endpoint);
|
|
63251
63376
|
}
|
|
63252
|
-
if (config3?.routerMiddleware?.length) for (const { path:
|
|
63377
|
+
if (config3?.routerMiddleware?.length) for (const { path: path71, middleware } of config3.routerMiddleware) addRoute(middlewareRouter, "*", path71, middleware);
|
|
63253
63378
|
const basePath = config3?.basePath && config3.basePath !== "/" ? config3.basePath.replace(/\/+$/, "") : "";
|
|
63254
63379
|
const processRequest = async (request) => {
|
|
63255
63380
|
const url2 = new URL(request.url);
|
|
63256
63381
|
const pathname = url2.pathname;
|
|
63257
|
-
let
|
|
63382
|
+
let path71;
|
|
63258
63383
|
if (basePath) {
|
|
63259
63384
|
if (!pathname.startsWith(`${basePath}/`)) return new Response(null, {
|
|
63260
63385
|
status: 404,
|
|
63261
63386
|
statusText: "Not Found"
|
|
63262
63387
|
});
|
|
63263
|
-
|
|
63264
|
-
} else
|
|
63265
|
-
if (
|
|
63388
|
+
path71 = pathname.slice(basePath.length);
|
|
63389
|
+
} else path71 = pathname;
|
|
63390
|
+
if (path71.length === 0 || /\/{2,}/.test(path71)) return new Response(null, {
|
|
63266
63391
|
status: 404,
|
|
63267
63392
|
statusText: "Not Found"
|
|
63268
63393
|
});
|
|
63269
|
-
const route = findRoute(router2, request.method,
|
|
63270
|
-
if (
|
|
63394
|
+
const route = findRoute(router2, request.method, path71);
|
|
63395
|
+
if (path71.endsWith("/") !== route?.data?.path?.endsWith("/") && !config3?.skipTrailingSlashes) return new Response(null, {
|
|
63271
63396
|
status: 404,
|
|
63272
63397
|
statusText: "Not Found"
|
|
63273
63398
|
});
|
|
@@ -63285,7 +63410,7 @@ var init_router = __esm({
|
|
|
63285
63410
|
try {
|
|
63286
63411
|
const allowedMediaTypes = handler.options.metadata?.allowedMediaTypes || config3?.allowedMediaTypes;
|
|
63287
63412
|
const context2 = {
|
|
63288
|
-
path:
|
|
63413
|
+
path: path71,
|
|
63289
63414
|
method: request.method,
|
|
63290
63415
|
headers: request.headers,
|
|
63291
63416
|
params: route.params ? { ...route.params } : {},
|
|
@@ -63296,7 +63421,7 @@ var init_router = __esm({
|
|
|
63296
63421
|
asResponse: true,
|
|
63297
63422
|
context: config3?.routerContext
|
|
63298
63423
|
};
|
|
63299
|
-
const middlewareRoutes = findAllRoutes(middlewareRouter, "*",
|
|
63424
|
+
const middlewareRoutes = findAllRoutes(middlewareRouter, "*", path71);
|
|
63300
63425
|
if (middlewareRoutes?.length) for (const { data: middleware, params } of middlewareRoutes) {
|
|
63301
63426
|
const res = await middleware({
|
|
63302
63427
|
...context2,
|
|
@@ -63482,8 +63607,8 @@ function wrapEndpointHandler(handler, options) {
|
|
|
63482
63607
|
}
|
|
63483
63608
|
function createAuthEndpoint(...args) {
|
|
63484
63609
|
if (args.length === 3) {
|
|
63485
|
-
const [
|
|
63486
|
-
return createEndpointWithAuthContext(
|
|
63610
|
+
const [path71, options2, handler2] = args;
|
|
63611
|
+
return createEndpointWithAuthContext(path71, options2, wrapEndpointHandler(handler2, options2));
|
|
63487
63612
|
}
|
|
63488
63613
|
const [options, handler] = args;
|
|
63489
63614
|
return createEndpointWithAuthContext(options, wrapEndpointHandler(handler, options));
|
|
@@ -63992,8 +64117,8 @@ function getIP(req, options) {
|
|
|
63992
64117
|
if (isTest() || isDevelopment()) return LOCALHOST_IP;
|
|
63993
64118
|
return null;
|
|
63994
64119
|
}
|
|
63995
|
-
function createRateLimitKey(ip,
|
|
63996
|
-
return `${ip}|${
|
|
64120
|
+
function createRateLimitKey(ip, path71) {
|
|
64121
|
+
return `${ip}|${path71}`;
|
|
63997
64122
|
}
|
|
63998
64123
|
var ipv4Schema, ipv6Schema, CIDR_PREFIX_PATTERN, LOCALHOST_IP, DEFAULT_IP_HEADERS;
|
|
63999
64124
|
var init_ip = __esm({
|
|
@@ -70865,20 +70990,20 @@ function createRetryStrategy(options) {
|
|
|
70865
70990
|
throw new Error("Invalid retry strategy");
|
|
70866
70991
|
}
|
|
70867
70992
|
}
|
|
70868
|
-
function parseMethodModifier(
|
|
70869
|
-
if (!
|
|
70993
|
+
function parseMethodModifier(path71) {
|
|
70994
|
+
if (!path71.startsWith("@")) return {
|
|
70870
70995
|
method: void 0,
|
|
70871
|
-
path:
|
|
70996
|
+
path: path71
|
|
70872
70997
|
};
|
|
70873
|
-
const separator =
|
|
70874
|
-
const method =
|
|
70998
|
+
const separator = path71.indexOf("/");
|
|
70999
|
+
const method = path71.slice(1, separator === -1 ? void 0 : separator);
|
|
70875
71000
|
if (!methods.includes(method)) return {
|
|
70876
71001
|
method: void 0,
|
|
70877
|
-
path:
|
|
71002
|
+
path: path71
|
|
70878
71003
|
};
|
|
70879
71004
|
return {
|
|
70880
71005
|
method,
|
|
70881
|
-
path: separator === -1 ?
|
|
71006
|
+
path: separator === -1 ? path71 : path71.slice(separator + 1)
|
|
70882
71007
|
};
|
|
70883
71008
|
}
|
|
70884
71009
|
function resolvePathSegment(segment, pathParams) {
|
|
@@ -70897,7 +71022,7 @@ function getURL$1(url2, option) {
|
|
|
70897
71022
|
const { path: requestPath } = parseMethodModifier(url2);
|
|
70898
71023
|
if (requestPath !== url2) url2 = `/${requestPath}`;
|
|
70899
71024
|
if (!basePath.endsWith("/")) basePath += "/";
|
|
70900
|
-
let [
|
|
71025
|
+
let [path71, urlQuery] = url2.replace(basePath, "").split("?");
|
|
70901
71026
|
const queryParams = new URLSearchParams(urlQuery);
|
|
70902
71027
|
for (const [key, value] of Object.entries(query || {})) {
|
|
70903
71028
|
if (value == null) continue;
|
|
@@ -70911,18 +71036,18 @@ function getURL$1(url2, option) {
|
|
|
70911
71036
|
}
|
|
70912
71037
|
const pathParams = /* @__PURE__ */ new Map();
|
|
70913
71038
|
if (params) if (Array.isArray(params)) {
|
|
70914
|
-
const paramPaths =
|
|
71039
|
+
const paramPaths = path71.split("/").filter((p) => p.startsWith(":"));
|
|
70915
71040
|
for (const [index2, key] of paramPaths.entries()) {
|
|
70916
71041
|
const value = params[index2];
|
|
70917
71042
|
pathParams.set(key, String(value));
|
|
70918
71043
|
}
|
|
70919
71044
|
} else for (const [key, value] of Object.entries(params)) pathParams.set(`:${key}`, String(value));
|
|
70920
|
-
|
|
70921
|
-
|
|
71045
|
+
path71 = path71.split("/").map((segment) => resolvePathSegment(segment, pathParams)).join("/");
|
|
71046
|
+
path71 = path71.replace(/^\/+/, "");
|
|
70922
71047
|
let queryParamString = queryParams.toString();
|
|
70923
71048
|
queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\+/g, "%20") : "";
|
|
70924
|
-
if (!basePath.startsWith("http")) return `${basePath}${
|
|
70925
|
-
return new URL(`${
|
|
71049
|
+
if (!basePath.startsWith("http")) return `${basePath}${path71}${queryParamString}`;
|
|
71050
|
+
return new URL(`${path71}${queryParamString}`, basePath);
|
|
70926
71051
|
}
|
|
70927
71052
|
function detectResponseType(request) {
|
|
70928
71053
|
const _contentType = request.headers.get("content-type");
|
|
@@ -98575,7 +98700,7 @@ var init_query_promise = __esm({
|
|
|
98575
98700
|
function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
98576
98701
|
const nullifyMap = {};
|
|
98577
98702
|
const result2 = columns.reduce(
|
|
98578
|
-
(result22, { path:
|
|
98703
|
+
(result22, { path: path71, field }, columnIndex) => {
|
|
98579
98704
|
let decoder2;
|
|
98580
98705
|
if (is(field, Column)) {
|
|
98581
98706
|
decoder2 = field;
|
|
@@ -98587,8 +98712,8 @@ function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
|
98587
98712
|
decoder2 = field.sql.decoder;
|
|
98588
98713
|
}
|
|
98589
98714
|
let node2 = result22;
|
|
98590
|
-
for (const [pathChunkIndex, pathChunk] of
|
|
98591
|
-
if (pathChunkIndex <
|
|
98715
|
+
for (const [pathChunkIndex, pathChunk] of path71.entries()) {
|
|
98716
|
+
if (pathChunkIndex < path71.length - 1) {
|
|
98592
98717
|
if (!(pathChunk in node2)) {
|
|
98593
98718
|
node2[pathChunk] = {};
|
|
98594
98719
|
}
|
|
@@ -98596,8 +98721,8 @@ function mapResultRow(columns, row2, joinsNotNullableMap) {
|
|
|
98596
98721
|
} else {
|
|
98597
98722
|
const rawValue = row2[columnIndex];
|
|
98598
98723
|
const value = node2[pathChunk] = rawValue === null ? null : decoder2.mapFromDriverValue(rawValue);
|
|
98599
|
-
if (joinsNotNullableMap && is(field, Column) &&
|
|
98600
|
-
const objectName =
|
|
98724
|
+
if (joinsNotNullableMap && is(field, Column) && path71.length === 2) {
|
|
98725
|
+
const objectName = path71[0];
|
|
98601
98726
|
if (!(objectName in nullifyMap)) {
|
|
98602
98727
|
nullifyMap[objectName] = value === null ? getTableName(field.table) : false;
|
|
98603
98728
|
} else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) {
|
|
@@ -109719,7 +109844,8 @@ var init_notifications = __esm({
|
|
|
109719
109844
|
"heartbeat.credits-offer",
|
|
109720
109845
|
"connector.destructive_pending",
|
|
109721
109846
|
"connector.destructive_executed",
|
|
109722
|
-
"web.new_device"
|
|
109847
|
+
"web.new_device",
|
|
109848
|
+
"agent.secret_files"
|
|
109723
109849
|
]
|
|
109724
109850
|
}).notNull(),
|
|
109725
109851
|
/** How loud this was allowed to be. Copied from the registry at write time. */
|
|
@@ -113058,7 +113184,6 @@ function defuseSystemTags(text3, tagNames) {
|
|
|
113058
113184
|
var IDENTITY_MAX_LENGTH, INVISIBLE_FORMAT, CONTROL_CHARS, PATTERN_CACHE;
|
|
113059
113185
|
var init_untrusted_text = __esm({
|
|
113060
113186
|
"../shared/src/untrusted-text.ts"() {
|
|
113061
|
-
"use strict";
|
|
113062
113187
|
IDENTITY_MAX_LENGTH = 80;
|
|
113063
113188
|
INVISIBLE_FORMAT = /[\u00ad\u200b-\u200f\u202a-\u202e\u2060-\u2064\ufeff\ufff9-\ufffb]/g;
|
|
113064
113189
|
CONTROL_CHARS = /[\u0000-\u001f\u007f-\u009f]/g;
|
|
@@ -113375,6 +113500,8 @@ var init_config_disclosure = __esm({
|
|
|
113375
113500
|
// including the home directory. An agent needs none of it — the refusal it
|
|
113376
113501
|
// reads already names the id to ask the person about — so it stays in.
|
|
113377
113502
|
"extensions.approvedSources": "withhold",
|
|
113503
|
+
// The old approvals still waiting for a copy (DOR-3068). Nothing an agent needs.
|
|
113504
|
+
"extensions.legacyUnsourced": "withhold",
|
|
113378
113505
|
// The permission set each approval covers (DOR-2686). Nothing an agent needs:
|
|
113379
113506
|
// the extension's own manifest says what it declares.
|
|
113380
113507
|
"extensions.approvedPermissions": "withhold",
|
|
@@ -113425,6 +113552,13 @@ var init_config_disclosure = __esm({
|
|
|
113425
113552
|
// The other half of the same record: which packages a person turned down.
|
|
113426
113553
|
// Same contents, same reasoning — package names and digests, no secrets.
|
|
113427
113554
|
"harness.refusedHooks": "expose",
|
|
113555
|
+
// Which state of each agent's own folder settings a person let run or turned
|
|
113556
|
+
// down (DOR-3068): agent ids and digests, no secrets. The part digests behind
|
|
113557
|
+
// each yes are nothing an agent needs.
|
|
113558
|
+
"harness.approvedFolderConfig": "expose",
|
|
113559
|
+
"harness.refusedFolderConfig": "expose",
|
|
113560
|
+
"harness.folderConfigPinned": "expose",
|
|
113561
|
+
"harness.approvedFolderConfigParts": "withhold",
|
|
113428
113562
|
// Which agent tools DorkOS shares your globally installed packages with, and
|
|
113429
113563
|
// when it last asked. Neither is a credential nor names one, and an agent that
|
|
113430
113564
|
// can say "your all-projects packages are not shared with Codex" is more
|
|
@@ -113619,17 +113753,17 @@ function patchPaths(value, prefix = "") {
|
|
|
113619
113753
|
if (entries.length === 0) return prefix ? [prefix] : [];
|
|
113620
113754
|
return entries.flatMap(([key, child]) => patchPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
113621
113755
|
}
|
|
113622
|
-
function withoutArrayMarkers(
|
|
113623
|
-
return
|
|
113756
|
+
function withoutArrayMarkers(path71) {
|
|
113757
|
+
return path71.replaceAll("[]", "");
|
|
113624
113758
|
}
|
|
113625
113759
|
function prepareGuardedPaths(paths2) {
|
|
113626
|
-
return paths2.map((
|
|
113760
|
+
return paths2.map((path71) => ({ path: path71, plain: withoutArrayMarkers(path71) }));
|
|
113627
113761
|
}
|
|
113628
113762
|
function matchGuardedPaths(touched, guarded) {
|
|
113629
113763
|
const hits = /* @__PURE__ */ new Set();
|
|
113630
|
-
for (const
|
|
113764
|
+
for (const path71 of new Set(touched)) {
|
|
113631
113765
|
for (const { path: guardedPath, plain } of guarded) {
|
|
113632
|
-
if (
|
|
113766
|
+
if (path71 === plain || path71.startsWith(`${plain}.`) || plain.startsWith(`${path71}.`)) {
|
|
113633
113767
|
hits.add(guardedPath);
|
|
113634
113768
|
}
|
|
113635
113769
|
}
|
|
@@ -113665,8 +113799,8 @@ var init_remote_config_policy = __esm({
|
|
|
113665
113799
|
"cloud.remote.edgeProofRef"
|
|
113666
113800
|
];
|
|
113667
113801
|
CLOUD_REMOTE_WRITE_POLICY = Object.fromEntries(
|
|
113668
|
-
[...CLOUD_REMOTE_REACH_PATHS, ...CLOUD_REMOTE_CREDENTIAL_PATHS].map((
|
|
113669
|
-
|
|
113802
|
+
[...CLOUD_REMOTE_REACH_PATHS, ...CLOUD_REMOTE_CREDENTIAL_PATHS].map((path71) => [
|
|
113803
|
+
path71,
|
|
113670
113804
|
"operator-only"
|
|
113671
113805
|
])
|
|
113672
113806
|
);
|
|
@@ -113830,6 +113964,7 @@ var init_operator_only_stakes = __esm({
|
|
|
113830
113964
|
"extensions.disabled",
|
|
113831
113965
|
"extensions.approvedToRun",
|
|
113832
113966
|
"extensions.approvedSources",
|
|
113967
|
+
"extensions.legacyUnsourced",
|
|
113833
113968
|
"extensions.approvedPermissions",
|
|
113834
113969
|
"extensions.dismissedApprovals",
|
|
113835
113970
|
"extensions.trustedSources[].source",
|
|
@@ -113838,6 +113973,10 @@ var init_operator_only_stakes = __esm({
|
|
|
113838
113973
|
"extensions.forwardAgents",
|
|
113839
113974
|
"harness.approvedHooks",
|
|
113840
113975
|
"harness.refusedHooks",
|
|
113976
|
+
"harness.approvedFolderConfig",
|
|
113977
|
+
"harness.approvedFolderConfigParts",
|
|
113978
|
+
"harness.refusedFolderConfig",
|
|
113979
|
+
"harness.folderConfigPinned",
|
|
113841
113980
|
"runtimes.opencode.binaryPath",
|
|
113842
113981
|
"runtimes.codex.binaryPath",
|
|
113843
113982
|
"runtimes.codex.transport",
|
|
@@ -114415,6 +114554,10 @@ var init_config_write_policy = __esm({
|
|
|
114415
114554
|
// the same record: a caller that could point an approved id at another copy
|
|
114416
114555
|
// would move a person's decision onto code they never saw.
|
|
114417
114556
|
"extensions.approvedSources": "operator-only",
|
|
114557
|
+
// The pre-DOR-2383 approvals still waiting to be bound to a copy (DOR-3068).
|
|
114558
|
+
// A caller that could add an id here would have the next scan bind an old
|
|
114559
|
+
// approval to whatever folder sits at that name.
|
|
114560
|
+
"extensions.legacyUnsourced": "operator-only",
|
|
114418
114561
|
// The permission set each of those approvals covers (DOR-2686). The third
|
|
114419
114562
|
// half of the record: a caller that could widen an entry would let an
|
|
114420
114563
|
// extension reach hosts, programs or agents a person never saw on its card.
|
|
@@ -114484,6 +114627,13 @@ var init_config_write_policy = __esm({
|
|
|
114484
114627
|
// record of somebody turning its package down, and the next sync would ask
|
|
114485
114628
|
// again instead of obeying the answer already given.
|
|
114486
114629
|
"harness.refusedHooks": "operator-only",
|
|
114630
|
+
// Which state of each agent's own hooks, MCP servers file and agent file a
|
|
114631
|
+
// person let run (DOR-3068). An agent that could write the yes would approve
|
|
114632
|
+
// the hooks it just wrote itself; one that could clear a no would be asked again.
|
|
114633
|
+
"harness.approvedFolderConfig": "operator-only",
|
|
114634
|
+
"harness.approvedFolderConfigParts": "operator-only",
|
|
114635
|
+
"harness.refusedFolderConfig": "operator-only",
|
|
114636
|
+
"harness.folderConfigPinned": "operator-only",
|
|
114487
114637
|
// Which agent tools DorkOS shares your globally installed packages with
|
|
114488
114638
|
// (DOR-1924). Adding an entry here is what lets DorkOS put links in somebody's
|
|
114489
114639
|
// home directory, which is the "how far DorkOS reaches on disk" line this
|
|
@@ -115504,17 +115654,17 @@ var init_agent_binding = __esm({
|
|
|
115504
115654
|
if (!this.runtimes || !this.defaultRuntime) throw new Error("COMPUTER_REGISTRY_UNAVAILABLE");
|
|
115505
115655
|
return resolveRegisteredAgentRuntime(id, mesh, this.runtimes, this.defaultRuntime, this);
|
|
115506
115656
|
}
|
|
115507
|
-
configure(id,
|
|
115508
|
-
if (!id || id.length > 128 || !
|
|
115657
|
+
configure(id, path71) {
|
|
115658
|
+
if (!id || id.length > 128 || !path71.startsWith("/") || canonicalDirectory(path71) !== path71) {
|
|
115509
115659
|
throw new Error("COMPUTER_AGENT_BINDING_REFUSED");
|
|
115510
115660
|
}
|
|
115511
|
-
if (this.binding && (this.binding.id !== id || this.binding.path !==
|
|
115661
|
+
if (this.binding && (this.binding.id !== id || this.binding.path !== path71)) {
|
|
115512
115662
|
throw new Error("COMPUTER_AGENT_BINDING_REFUSED");
|
|
115513
115663
|
}
|
|
115514
|
-
this.binding = { id, path:
|
|
115664
|
+
this.binding = { id, path: path71 };
|
|
115515
115665
|
}
|
|
115516
|
-
forPath(
|
|
115517
|
-
return this.binding?.path ===
|
|
115666
|
+
forPath(path71) {
|
|
115667
|
+
return this.binding?.path === path71 ? "computer-local" : void 0;
|
|
115518
115668
|
}
|
|
115519
115669
|
forId(id) {
|
|
115520
115670
|
return this.binding?.id === id ? "computer-local" : void 0;
|
|
@@ -119670,9 +119820,9 @@ var init_windows_execution_state = __esm({
|
|
|
119670
119820
|
|
|
119671
119821
|
// ../keep-awake/src/environment.ts
|
|
119672
119822
|
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
119673
|
-
function readFileOrNull(
|
|
119823
|
+
function readFileOrNull(path71) {
|
|
119674
119824
|
try {
|
|
119675
|
-
return readFileSync4(
|
|
119825
|
+
return readFileSync4(path71, "utf8");
|
|
119676
119826
|
} catch {
|
|
119677
119827
|
return null;
|
|
119678
119828
|
}
|
|
@@ -120632,9 +120782,9 @@ async function boundTurnOpts(runtime, sessionId, incoming, deps) {
|
|
|
120632
120782
|
}
|
|
120633
120783
|
const { agentPath } = agent;
|
|
120634
120784
|
const read = deps.levelOf ?? resolveAgentLaunchLevel;
|
|
120635
|
-
const modeOf = async (
|
|
120785
|
+
const modeOf = async (path71) => {
|
|
120636
120786
|
try {
|
|
120637
|
-
return (await read({ agentPath:
|
|
120787
|
+
return (await read({ agentPath: path71, capabilities })).mode ?? null;
|
|
120638
120788
|
} catch (err) {
|
|
120639
120789
|
logger.warn(
|
|
120640
120790
|
"[agent-level] could not read the agent\u2019s level; holding the turn to the default",
|
|
@@ -124900,13 +125050,13 @@ function sameLeaf(a2, b2) {
|
|
|
124900
125050
|
function collectChangedPaths(before, after, prefix, out) {
|
|
124901
125051
|
for (const key of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
124902
125052
|
if (DANGEROUS_KEYS.has(key)) continue;
|
|
124903
|
-
const
|
|
125053
|
+
const path71 = prefix ? `${prefix}.${key}` : key;
|
|
124904
125054
|
const a2 = before[key];
|
|
124905
125055
|
const b2 = after[key];
|
|
124906
125056
|
if (isPlainObject6(a2) && isPlainObject6(b2)) {
|
|
124907
|
-
collectChangedPaths(a2, b2,
|
|
125057
|
+
collectChangedPaths(a2, b2, path71, out);
|
|
124908
125058
|
} else if (!sameLeaf(a2, b2)) {
|
|
124909
|
-
out.push(
|
|
125059
|
+
out.push(path71);
|
|
124910
125060
|
}
|
|
124911
125061
|
}
|
|
124912
125062
|
}
|
|
@@ -124918,9 +125068,9 @@ function renderSegment(segment) {
|
|
|
124918
125068
|
(char) => `\\u${char.codePointAt(0).toString(16).padStart(4, "0")}`
|
|
124919
125069
|
);
|
|
124920
125070
|
}
|
|
124921
|
-
function isOperatorOnlyPath(
|
|
125071
|
+
function isOperatorOnlyPath(path71) {
|
|
124922
125072
|
return OPERATOR_ONLY_CONFIG_PATHS.some(
|
|
124923
|
-
(guarded) =>
|
|
125073
|
+
(guarded) => path71 === guarded || path71.startsWith(`${guarded}.`)
|
|
124924
125074
|
);
|
|
124925
125075
|
}
|
|
124926
125076
|
function describeConfigWrite(before, after) {
|
|
@@ -124930,14 +125080,14 @@ function describeConfigWrite(before, after) {
|
|
|
124930
125080
|
if (changed.length === 0) return "";
|
|
124931
125081
|
const ordered = [
|
|
124932
125082
|
...changed.filter(isOperatorOnlyPath).sort(),
|
|
124933
|
-
...changed.filter((
|
|
125083
|
+
...changed.filter((path71) => !isOperatorOnlyPath(path71)).sort()
|
|
124934
125084
|
];
|
|
124935
|
-
const named3 = ordered.slice(0, LOGGED_PATH_LIMIT).map((
|
|
125085
|
+
const named3 = ordered.slice(0, LOGGED_PATH_LIMIT).map((path71) => path71.split(".").map(renderSegment).join(".")).join(", ");
|
|
124936
125086
|
return ordered.length <= LOGGED_PATH_LIMIT ? named3 : `${named3}, and ${ordered.length - LOGGED_PATH_LIMIT} more`;
|
|
124937
125087
|
}
|
|
124938
|
-
function valueAtPath(root,
|
|
125088
|
+
function valueAtPath(root, path71) {
|
|
124939
125089
|
let node2 = root;
|
|
124940
|
-
for (const key of
|
|
125090
|
+
for (const key of path71.split(".")) {
|
|
124941
125091
|
if (!isPlainObject6(node2)) return void 0;
|
|
124942
125092
|
node2 = node2[key];
|
|
124943
125093
|
}
|
|
@@ -125068,9 +125218,9 @@ function describeOperatorOnlyRefusal(paths2) {
|
|
|
125068
125218
|
const remaining = new Set(paths2);
|
|
125069
125219
|
const clauses = [];
|
|
125070
125220
|
for (const group of OPERATOR_ONLY_STAKES) {
|
|
125071
|
-
const matched = paths2.filter((
|
|
125221
|
+
const matched = paths2.filter((path71) => group.paths.includes(path71));
|
|
125072
125222
|
if (matched.length === 0) continue;
|
|
125073
|
-
for (const
|
|
125223
|
+
for (const path71 of matched) remaining.delete(path71);
|
|
125074
125224
|
clauses.push(`${group.description}: ${matched.join(", ")}.`);
|
|
125075
125225
|
}
|
|
125076
125226
|
if (remaining.size > 0) {
|
|
@@ -125109,7 +125259,7 @@ __export(config_write_exports, {
|
|
|
125109
125259
|
function personApprovedAuthority(decidedByUserId, isLoginEnabled = () => decidedByUserId !== void 0 || configManager.get("auth")?.enabled === true, isOwner = (userId) => isInstallOwner(userId === void 0 ? void 0 : { userId })) {
|
|
125110
125260
|
return {
|
|
125111
125261
|
refuseOperatorOnly: (paths2) => {
|
|
125112
|
-
const cloudPaths = paths2.filter((
|
|
125262
|
+
const cloudPaths = paths2.filter((path71) => path71.startsWith("cloud."));
|
|
125113
125263
|
if (cloudPaths.length === 0 || !isLoginEnabled() || isOwner(decidedByUserId)) {
|
|
125114
125264
|
return void 0;
|
|
125115
125265
|
}
|
|
@@ -125123,9 +125273,9 @@ function personApprovedAuthority(decidedByUserId, isLoginEnabled = () => decided
|
|
|
125123
125273
|
}
|
|
125124
125274
|
};
|
|
125125
125275
|
}
|
|
125126
|
-
function leafAt(config3,
|
|
125276
|
+
function leafAt(config3, path71) {
|
|
125127
125277
|
let current3 = config3;
|
|
125128
|
-
for (const key of
|
|
125278
|
+
for (const key of path71) {
|
|
125129
125279
|
if (current3 === null || typeof current3 !== "object") return null;
|
|
125130
125280
|
current3 = current3[key];
|
|
125131
125281
|
}
|
|
@@ -125136,9 +125286,9 @@ function onTrustStopChange(listener) {
|
|
|
125136
125286
|
}
|
|
125137
125287
|
function reportTrustStopMoves(before, after, write) {
|
|
125138
125288
|
if (!trustStopListener) return;
|
|
125139
|
-
const moves = TRUST_STOP_LEAVES.flatMap(({ path:
|
|
125140
|
-
const was = leafAt(before,
|
|
125141
|
-
const now3 = leafAt(after,
|
|
125289
|
+
const moves = TRUST_STOP_LEAVES.flatMap(({ path: path71, runtime }) => {
|
|
125290
|
+
const was = leafAt(before, path71);
|
|
125291
|
+
const now3 = leafAt(after, path71);
|
|
125142
125292
|
return was === now3 ? [] : [{ ...runtime ? { runtime } : {}, before: was, after: now3 }];
|
|
125143
125293
|
});
|
|
125144
125294
|
if (moves.length === 0) return;
|
|
@@ -128292,9 +128442,9 @@ function inventoryMcpServers(repoRoot) {
|
|
|
128292
128442
|
);
|
|
128293
128443
|
if (unreadable) return { mcpServers: [], unreadable: [unreadable] };
|
|
128294
128444
|
if (value === void 0) return { mcpServers: [], unreadable: [] };
|
|
128295
|
-
const
|
|
128296
|
-
if (
|
|
128297
|
-
if (typeof
|
|
128445
|
+
const servers2 = value.mcpServers;
|
|
128446
|
+
if (servers2 === void 0) return { mcpServers: [], unreadable: [] };
|
|
128447
|
+
if (typeof servers2 !== "object" || servers2 === null || Array.isArray(servers2)) {
|
|
128298
128448
|
return {
|
|
128299
128449
|
mcpServers: [],
|
|
128300
128450
|
unreadable: [
|
|
@@ -128307,7 +128457,7 @@ function inventoryMcpServers(repoRoot) {
|
|
|
128307
128457
|
};
|
|
128308
128458
|
}
|
|
128309
128459
|
return {
|
|
128310
|
-
mcpServers: Object.keys(
|
|
128460
|
+
mcpServers: Object.keys(servers2).sort((a2, b2) => a2.localeCompare(b2)).map((name2) => ({
|
|
128311
128461
|
kind: "mcp",
|
|
128312
128462
|
name: name2,
|
|
128313
128463
|
source: MCP_CONFIG_SOURCE,
|
|
@@ -130004,14 +130154,14 @@ import { join as join24 } from "node:path";
|
|
|
130004
130154
|
function stripBom(text3) {
|
|
130005
130155
|
return text3.startsWith(BOM) ? text3.slice(BOM.length) : text3;
|
|
130006
130156
|
}
|
|
130007
|
-
function countTableKeys(
|
|
130008
|
-
if (
|
|
130009
|
-
if (typeof
|
|
130157
|
+
function countTableKeys(servers2, label, wrongShape) {
|
|
130158
|
+
if (servers2 === void 0) return {};
|
|
130159
|
+
if (typeof servers2 !== "object" || servers2 === null || Array.isArray(servers2)) {
|
|
130010
130160
|
return {
|
|
130011
130161
|
unreadable: `${label} has ${wrongShape}, so DorkOS could not count the MCP servers in it`
|
|
130012
130162
|
};
|
|
130013
130163
|
}
|
|
130014
|
-
return { servers: Object.keys(
|
|
130164
|
+
return { servers: Object.keys(servers2).length };
|
|
130015
130165
|
}
|
|
130016
130166
|
function countJsonServers(key, label) {
|
|
130017
130167
|
return (text3) => {
|
|
@@ -131293,8 +131443,8 @@ var init_manifest_edit = __esm({
|
|
|
131293
131443
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
131294
131444
|
import { join as join30 } from "node:path";
|
|
131295
131445
|
function enableHarnessInManifest(repoRoot, harness) {
|
|
131296
|
-
const
|
|
131297
|
-
const abs = join30(repoRoot,
|
|
131446
|
+
const path71 = HARNESS_MANIFEST_PATH;
|
|
131447
|
+
const abs = join30(repoRoot, path71);
|
|
131298
131448
|
const before = readFileSync9(abs, "utf8");
|
|
131299
131449
|
let parsed;
|
|
131300
131450
|
try {
|
|
@@ -131303,7 +131453,7 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
131303
131453
|
return {
|
|
131304
131454
|
outcome: "unwritable",
|
|
131305
131455
|
harness,
|
|
131306
|
-
path:
|
|
131456
|
+
path: path71,
|
|
131307
131457
|
reason: `it is not valid JSON (${err instanceof Error ? err.message : String(err)})`
|
|
131308
131458
|
};
|
|
131309
131459
|
}
|
|
@@ -131311,16 +131461,16 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
131311
131461
|
try {
|
|
131312
131462
|
manifest = parseHarnessManifest(parsed);
|
|
131313
131463
|
} catch (err) {
|
|
131314
|
-
return { outcome: "unwritable", harness, path:
|
|
131464
|
+
return { outcome: "unwritable", harness, path: path71, reason: manifestSchemaReason(err) };
|
|
131315
131465
|
}
|
|
131316
131466
|
const existing = manifest.harnesses;
|
|
131317
|
-
if (existing.includes(harness)) return { outcome: "already-enabled", harness, path:
|
|
131467
|
+
if (existing.includes(harness)) return { outcome: "already-enabled", harness, path: path71 };
|
|
131318
131468
|
const edit = plannedEdit(before, existing, harness);
|
|
131319
131469
|
if (!edit) {
|
|
131320
131470
|
return {
|
|
131321
131471
|
outcome: "unwritable",
|
|
131322
131472
|
harness,
|
|
131323
|
-
path:
|
|
131473
|
+
path: path71,
|
|
131324
131474
|
reason: 'its "harnesses" list could not be located in the file as written'
|
|
131325
131475
|
};
|
|
131326
131476
|
}
|
|
@@ -131329,12 +131479,12 @@ function enableHarnessInManifest(repoRoot, harness) {
|
|
|
131329
131479
|
return {
|
|
131330
131480
|
outcome: "unwritable",
|
|
131331
131481
|
harness,
|
|
131332
|
-
path:
|
|
131482
|
+
path: path71,
|
|
131333
131483
|
reason: "adding the harness would have changed something else in the file"
|
|
131334
131484
|
};
|
|
131335
131485
|
}
|
|
131336
131486
|
writeFileAtomic(abs, after);
|
|
131337
|
-
return { outcome: "enabled", harness, path:
|
|
131487
|
+
return { outcome: "enabled", harness, path: path71, inserted };
|
|
131338
131488
|
}
|
|
131339
131489
|
function plannedEdit(text3, existing, harness) {
|
|
131340
131490
|
const array2 = findValueSpan(text3, "harnesses", "[");
|
|
@@ -131369,8 +131519,8 @@ var init_enable_harness = __esm({
|
|
|
131369
131519
|
import { readFileSync as readFileSync10 } from "node:fs";
|
|
131370
131520
|
import { join as join31 } from "node:path";
|
|
131371
131521
|
function declareClaudeOnlySkill(repoRoot, entry) {
|
|
131372
|
-
const
|
|
131373
|
-
const abs = join31(repoRoot,
|
|
131522
|
+
const path71 = HARNESS_MANIFEST_PATH;
|
|
131523
|
+
const abs = join31(repoRoot, path71);
|
|
131374
131524
|
const before = readFileSync10(abs, "utf8");
|
|
131375
131525
|
let parsed;
|
|
131376
131526
|
try {
|
|
@@ -131378,7 +131528,7 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
131378
131528
|
} catch (err) {
|
|
131379
131529
|
return {
|
|
131380
131530
|
outcome: "unwritable",
|
|
131381
|
-
path:
|
|
131531
|
+
path: path71,
|
|
131382
131532
|
reason: `it is not valid JSON (${err instanceof Error ? err.message : String(err)})`
|
|
131383
131533
|
};
|
|
131384
131534
|
}
|
|
@@ -131386,10 +131536,10 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
131386
131536
|
try {
|
|
131387
131537
|
manifest = parseHarnessManifest(parsed);
|
|
131388
131538
|
} catch (err) {
|
|
131389
|
-
return { outcome: "unwritable", path:
|
|
131539
|
+
return { outcome: "unwritable", path: path71, reason: manifestSchemaReason(err) };
|
|
131390
131540
|
}
|
|
131391
131541
|
if (manifest.claudeOnlySkills.some((declared) => declared.name === entry.name)) {
|
|
131392
|
-
return { outcome: "already-declared", path:
|
|
131542
|
+
return { outcome: "already-declared", path: path71 };
|
|
131393
131543
|
}
|
|
131394
131544
|
const raw = parsed.claudeOnlySkills;
|
|
131395
131545
|
const rawEntries = Array.isArray(raw) ? raw : [];
|
|
@@ -131398,7 +131548,7 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
131398
131548
|
if (!edit) {
|
|
131399
131549
|
return {
|
|
131400
131550
|
outcome: "unwritable",
|
|
131401
|
-
path:
|
|
131551
|
+
path: path71,
|
|
131402
131552
|
reason: 'its "claudeOnlySkills" list could not be located in the file as written'
|
|
131403
131553
|
};
|
|
131404
131554
|
}
|
|
@@ -131406,12 +131556,12 @@ function declareClaudeOnlySkill(repoRoot, entry) {
|
|
|
131406
131556
|
if (!isExactlyOneSkillDeclared(after, parsed, rawEntries, entry)) {
|
|
131407
131557
|
return {
|
|
131408
131558
|
outcome: "unwritable",
|
|
131409
|
-
path:
|
|
131559
|
+
path: path71,
|
|
131410
131560
|
reason: "recording the skill would have changed something else in the file"
|
|
131411
131561
|
};
|
|
131412
131562
|
}
|
|
131413
131563
|
writeFileAtomic(abs, after);
|
|
131414
|
-
return { outcome: "declared", path:
|
|
131564
|
+
return { outcome: "declared", path: path71, inserted };
|
|
131415
131565
|
}
|
|
131416
131566
|
function editAddingTheKey(text3, existing, entry) {
|
|
131417
131567
|
const root = findRootObject(text3);
|
|
@@ -133398,14 +133548,14 @@ function ignoringLayer(layers, relPath2, leafKind) {
|
|
|
133398
133548
|
}
|
|
133399
133549
|
return decided;
|
|
133400
133550
|
}
|
|
133401
|
-
function pathWithin(dir,
|
|
133402
|
-
if (dir === "") return
|
|
133403
|
-
return
|
|
133551
|
+
function pathWithin(dir, path71) {
|
|
133552
|
+
if (dir === "") return path71;
|
|
133553
|
+
return path71.startsWith(`${dir}/`) ? path71.slice(dir.length + 1) : void 0;
|
|
133404
133554
|
}
|
|
133405
133555
|
function gitignorePatternMatches(pattern, relPath2, leafKind = "file") {
|
|
133406
133556
|
return isPathIgnored([pattern], relPath2, leafKind);
|
|
133407
133557
|
}
|
|
133408
|
-
function decidePattern(pattern,
|
|
133558
|
+
function decidePattern(pattern, path71, isDir) {
|
|
133409
133559
|
const trimmed = pattern.trim();
|
|
133410
133560
|
if (trimmed === "" || trimmed.startsWith("#")) return void 0;
|
|
133411
133561
|
const negated = trimmed.startsWith("!");
|
|
@@ -133418,7 +133568,7 @@ function decidePattern(pattern, path68, isDir) {
|
|
|
133418
133568
|
if (body === "") return void 0;
|
|
133419
133569
|
const anchored = !anyDepth && (rule.startsWith("/") || body.includes("/"));
|
|
133420
133570
|
const prefix = anchored ? "^" : "^(?:.*/)?";
|
|
133421
|
-
return new RegExp(`${prefix}${globToRegExpBody(body)}$`).test(
|
|
133571
|
+
return new RegExp(`${prefix}${globToRegExpBody(body)}$`).test(path71) ? !negated : void 0;
|
|
133422
133572
|
}
|
|
133423
133573
|
function globToRegExpBody(body) {
|
|
133424
133574
|
let out = "";
|
|
@@ -133454,11 +133604,11 @@ function gitCheckoutRoot(projectRoot) {
|
|
|
133454
133604
|
dir = parent;
|
|
133455
133605
|
}
|
|
133456
133606
|
}
|
|
133457
|
-
function physicalPath(
|
|
133607
|
+
function physicalPath(path71) {
|
|
133458
133608
|
try {
|
|
133459
|
-
return realpathSync8.native(
|
|
133609
|
+
return realpathSync8.native(path71);
|
|
133460
133610
|
} catch {
|
|
133461
|
-
return resolve4(
|
|
133611
|
+
return resolve4(path71);
|
|
133462
133612
|
}
|
|
133463
133613
|
}
|
|
133464
133614
|
function projectPrefix(checkoutRoot, projectRoot) {
|
|
@@ -133515,7 +133665,7 @@ function ephemeralPaths(plan, repoRoot) {
|
|
|
133515
133665
|
}
|
|
133516
133666
|
}
|
|
133517
133667
|
if (existsSync10(join32(repoRoot, PROJECT_PLUGINS_DIR))) paths2.set(INSTALL_ROOT_PROBE, "dir");
|
|
133518
|
-
return [...paths2].map(([
|
|
133668
|
+
return [...paths2].map(([path71, kind]) => ({ path: path71, kind }));
|
|
133519
133669
|
}
|
|
133520
133670
|
function onDiskKind(repoRoot, relPath2, fallback) {
|
|
133521
133671
|
try {
|
|
@@ -133544,13 +133694,13 @@ function missingGitignoreLines(repoRoot, plan) {
|
|
|
133544
133694
|
const checkout = checkoutContext(repoRoot);
|
|
133545
133695
|
if (checkout === void 0) return [];
|
|
133546
133696
|
const missing = /* @__PURE__ */ new Set();
|
|
133547
|
-
for (const { path:
|
|
133548
|
-
if (ignoredBy(checkout.root, underPrefix(checkout.prefix,
|
|
133549
|
-
if (selfIgnored(plan,
|
|
133697
|
+
for (const { path: path71, kind } of ephemeralPaths(plan, repoRoot)) {
|
|
133698
|
+
if (ignoredBy(checkout.root, underPrefix(checkout.prefix, path71), kind) !== void 0) continue;
|
|
133699
|
+
if (selfIgnored(plan, path71)) continue;
|
|
133550
133700
|
const covering = EPHEMERAL_GITIGNORE_PATTERNS.filter(
|
|
133551
|
-
(pattern) => gitignorePatternMatches(pattern,
|
|
133701
|
+
(pattern) => gitignorePatternMatches(pattern, path71, kind)
|
|
133552
133702
|
);
|
|
133553
|
-
if (covering.length === 0) missing.add(
|
|
133703
|
+
if (covering.length === 0) missing.add(path71);
|
|
133554
133704
|
else for (const pattern of covering) missing.add(pattern);
|
|
133555
133705
|
}
|
|
133556
133706
|
const declared = EPHEMERAL_GITIGNORE_PATTERNS;
|
|
@@ -133729,10 +133879,10 @@ var init_read2 = __esm({
|
|
|
133729
133879
|
// ../harness/src/apply/sweep-reasons.ts
|
|
133730
133880
|
import { basename as basename4 } from "node:path";
|
|
133731
133881
|
function explainSweep(paths2, cause) {
|
|
133732
|
-
return paths2.map((
|
|
133882
|
+
return paths2.map((path71) => ({ path: path71, reason: sweepReason(path71, cause) }));
|
|
133733
133883
|
}
|
|
133734
|
-
function sweepReason(
|
|
133735
|
-
if (cause === "command-wrapper" && isAtomicTempName(basename4(
|
|
133884
|
+
function sweepReason(path71, cause) {
|
|
133885
|
+
if (cause === "command-wrapper" && isAtomicTempName(basename4(path71))) {
|
|
133736
133886
|
return SWEEP_REASONS["stale-temp"];
|
|
133737
133887
|
}
|
|
133738
133888
|
return SWEEP_REASONS[cause];
|
|
@@ -133809,10 +133959,10 @@ function partitionRemovable(repoRoot, paths2) {
|
|
|
133809
133959
|
const removable = [];
|
|
133810
133960
|
const warnings = [];
|
|
133811
133961
|
const probed = /* @__PURE__ */ new Map();
|
|
133812
|
-
for (const
|
|
133813
|
-
const absDir = unwritableParent(join34(repoRoot,
|
|
133814
|
-
if (absDir === void 0) removable.push(
|
|
133815
|
-
else warnings.push(blockedRemovalWarning(
|
|
133962
|
+
for (const path71 of paths2) {
|
|
133963
|
+
const absDir = unwritableParent(join34(repoRoot, path71), probed);
|
|
133964
|
+
if (absDir === void 0) removable.push(path71);
|
|
133965
|
+
else warnings.push(blockedRemovalWarning(path71, spell(repoRoot, absDir)));
|
|
133816
133966
|
}
|
|
133817
133967
|
return { removable, warnings };
|
|
133818
133968
|
}
|
|
@@ -133890,8 +134040,8 @@ var init_authored_orphans = __esm({
|
|
|
133890
134040
|
// ../harness/src/apply/symlink-occupants.ts
|
|
133891
134041
|
import { readdirSync as readdirSync7, readFileSync as readFileSync14, readlinkSync as readlinkSync3, realpathSync as realpathSync9, statSync as statSync8 } from "node:fs";
|
|
133892
134042
|
import { basename as basename5, dirname as dirname10 } from "node:path";
|
|
133893
|
-
function withForwardSlashes(
|
|
133894
|
-
return
|
|
134043
|
+
function withForwardSlashes(path71) {
|
|
134044
|
+
return path71.split("\\").join("/");
|
|
133895
134045
|
}
|
|
133896
134046
|
function holdsOwnLinkText(absTarget, linkText) {
|
|
133897
134047
|
try {
|
|
@@ -134538,7 +134688,7 @@ function applyPlan(repoRoot, plan, opts) {
|
|
|
134538
134688
|
return {
|
|
134539
134689
|
applied,
|
|
134540
134690
|
conflicts,
|
|
134541
|
-
swept: removals.map(({ path:
|
|
134691
|
+
swept: removals.map(({ path: path71 }) => path71),
|
|
134542
134692
|
removals,
|
|
134543
134693
|
leftAlone,
|
|
134544
134694
|
// Three subjects, one list, and the junction one sits OUTSIDE the sweep
|
|
@@ -134656,7 +134806,7 @@ function checkPlan(repoRoot, plan) {
|
|
|
134656
134806
|
return {
|
|
134657
134807
|
drifted,
|
|
134658
134808
|
blocked,
|
|
134659
|
-
orphans: removals.map(({ path:
|
|
134809
|
+
orphans: removals.map(({ path: path71 }) => path71),
|
|
134660
134810
|
removals,
|
|
134661
134811
|
leftAlone: findLeftAloneGeneratedHookFiles(repoRoot, plan),
|
|
134662
134812
|
// Not drift, and the first two are never an exit code either: a junction
|
|
@@ -134924,7 +135074,7 @@ function globalOrphanCandidates(plan, roots) {
|
|
|
134924
135074
|
function findGlobalOrphans(plan, roots) {
|
|
134925
135075
|
const orphans = globalOrphanCandidates(plan, roots);
|
|
134926
135076
|
const removable = new Set(removableOf("", [...orphans.keys()]));
|
|
134927
|
-
return [...orphans.entries()].filter(([
|
|
135077
|
+
return [...orphans.entries()].filter(([path71]) => removable.has(path71)).sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0).map(([path71, reason]) => ({ path: path71, reason }));
|
|
134928
135078
|
}
|
|
134929
135079
|
function findBlockedGlobalRemovals(plan, roots) {
|
|
134930
135080
|
if (plan.unreadableRoot !== void 0) return [];
|
|
@@ -134935,7 +135085,7 @@ function rawGlobalOrphanPaths(plan, roots) {
|
|
|
134935
135085
|
}
|
|
134936
135086
|
function sweepGlobalOrphans(plan, roots) {
|
|
134937
135087
|
const orphans = findGlobalOrphans(plan, roots);
|
|
134938
|
-
for (const { path:
|
|
135088
|
+
for (const { path: path71 } of orphans) rmSync8(path71, { force: true });
|
|
134939
135089
|
return orphans;
|
|
134940
135090
|
}
|
|
134941
135091
|
function globalLinkText(action) {
|
|
@@ -135037,7 +135187,7 @@ function applyGlobalPlan(plan, roots, opts) {
|
|
|
135037
135187
|
return {
|
|
135038
135188
|
applied,
|
|
135039
135189
|
conflicts,
|
|
135040
|
-
swept: removals.map(({ path:
|
|
135190
|
+
swept: removals.map(({ path: path71 }) => path71),
|
|
135041
135191
|
removals,
|
|
135042
135192
|
leftAlone: [],
|
|
135043
135193
|
// A global run has no folder to be BLIND inside — `findGlobalOrphans` walks
|
|
@@ -135070,7 +135220,7 @@ function checkGlobalPlan(plan, roots) {
|
|
|
135070
135220
|
return {
|
|
135071
135221
|
drifted,
|
|
135072
135222
|
blocked,
|
|
135073
|
-
orphans: removals.map(({ path:
|
|
135223
|
+
orphans: removals.map(({ path: path71 }) => path71),
|
|
135074
135224
|
removals,
|
|
135075
135225
|
leftAlone: [],
|
|
135076
135226
|
// The junction family cannot reach a global plan at all, and by nature
|
|
@@ -135240,16 +135390,16 @@ import {
|
|
|
135240
135390
|
statSync as statSync10
|
|
135241
135391
|
} from "node:fs";
|
|
135242
135392
|
import { basename as basename7, isAbsolute as isAbsolute7, join as join42, relative as relative8, resolve as resolve7, sep as sep9 } from "node:path";
|
|
135243
|
-
function statOrUndefined(
|
|
135393
|
+
function statOrUndefined(path71) {
|
|
135244
135394
|
try {
|
|
135245
|
-
return statSync10(
|
|
135395
|
+
return statSync10(path71, { throwIfNoEntry: false });
|
|
135246
135396
|
} catch {
|
|
135247
135397
|
return void 0;
|
|
135248
135398
|
}
|
|
135249
135399
|
}
|
|
135250
|
-
function lstatOrUndefined(
|
|
135400
|
+
function lstatOrUndefined(path71) {
|
|
135251
135401
|
try {
|
|
135252
|
-
return lstatSync14(
|
|
135402
|
+
return lstatSync14(path71, { throwIfNoEntry: false });
|
|
135253
135403
|
} catch {
|
|
135254
135404
|
return void 0;
|
|
135255
135405
|
}
|
|
@@ -135473,13 +135623,13 @@ function scanClaudeOnlySkills(repoRoot, manifest) {
|
|
|
135473
135623
|
const resolved = /* @__PURE__ */ new Map();
|
|
135474
135624
|
for (const entry of manifest.claudeOnlySkills) {
|
|
135475
135625
|
const defaultPath = `${CLAUDE_SKILLS_DIR}/${entry.name}`;
|
|
135476
|
-
const
|
|
135477
|
-
const abs = join43(repoRoot,
|
|
135626
|
+
const path71 = entry.path.trim() === "" ? defaultPath : entry.path;
|
|
135627
|
+
const abs = join43(repoRoot, path71);
|
|
135478
135628
|
let kind = "missing";
|
|
135479
135629
|
const stats2 = lstatSync15(abs, { throwIfNoEntry: false });
|
|
135480
135630
|
if (stats2?.isSymbolicLink()) kind = "symlink";
|
|
135481
135631
|
else if (stats2?.isDirectory() && existsSync15(join43(abs, "SKILL.md"))) kind = "directory";
|
|
135482
|
-
resolved.set(entry.name, { path:
|
|
135632
|
+
resolved.set(entry.name, { path: path71, kind, atProjectionTarget: path71 === defaultPath });
|
|
135483
135633
|
}
|
|
135484
135634
|
return resolved;
|
|
135485
135635
|
}
|
|
@@ -136364,7 +136514,7 @@ async function listSharing(dorkHome) {
|
|
|
136364
136514
|
function removalLines(removals, about) {
|
|
136365
136515
|
if (removals.length === 0) return [];
|
|
136366
136516
|
const heading = about === "will" ? `Removing ${removals.length} link(s):` : `Removed ${removals.length} link(s):`;
|
|
136367
|
-
return ["", heading, ...removals.map(({ path:
|
|
136517
|
+
return ["", heading, ...removals.map(({ path: path71, reason }) => ` ${path71} \u2014 ${reason}`)];
|
|
136368
136518
|
}
|
|
136369
136519
|
async function enableTool(dorkHome, tool) {
|
|
136370
136520
|
const {
|
|
@@ -136573,7 +136723,7 @@ function globalActionLine(action) {
|
|
|
136573
136723
|
function removalPreview(removals, about) {
|
|
136574
136724
|
if (removals.length === 0) return [];
|
|
136575
136725
|
const heading = about === "will" ? `Removing ${removals.length} link(s):` : `Removed ${removals.length} link(s):`;
|
|
136576
|
-
return ["", heading, ...removals.map(({ path:
|
|
136726
|
+
return ["", heading, ...removals.map(({ path: path71, reason }) => ` ${path71} \u2014 ${reason}`)];
|
|
136577
136727
|
}
|
|
136578
136728
|
function linkNamesIn(plan) {
|
|
136579
136729
|
return [...new Set(plan.actions.map((action) => action.name))];
|
|
@@ -136805,6 +136955,516 @@ var init_harness_sync_claude_only = __esm({
|
|
|
136805
136955
|
}
|
|
136806
136956
|
});
|
|
136807
136957
|
|
|
136958
|
+
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-scripts.ts
|
|
136959
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
136960
|
+
import { lstatSync as lstatSync16, readdirSync as readdirSync10, readFileSync as readFileSync21, statSync as statSync11 } from "node:fs";
|
|
136961
|
+
import path47 from "node:path";
|
|
136962
|
+
function isInside4(base, target) {
|
|
136963
|
+
const rel = path47.relative(base, target);
|
|
136964
|
+
return rel !== "" && !rel.startsWith("..") && !path47.isAbsolute(rel);
|
|
136965
|
+
}
|
|
136966
|
+
function sha2562(content) {
|
|
136967
|
+
return createHash4("sha256").update(content).digest("hex");
|
|
136968
|
+
}
|
|
136969
|
+
function namedTargets(root, pluginsRoot, commands) {
|
|
136970
|
+
const found = /* @__PURE__ */ new Set();
|
|
136971
|
+
const pluginSegment = `${path47.sep}.dork${path47.sep}plugins${path47.sep}`;
|
|
136972
|
+
for (const command of commands) {
|
|
136973
|
+
const words = command.replace(/["']/g, "").replace(OUTPUT_REDIRECT, " ").replace(PROJECT_DIR_VAR, HOME_MARK).split(WORD_BREAK);
|
|
136974
|
+
for (const word of words) {
|
|
136975
|
+
if (!word) continue;
|
|
136976
|
+
if (word.startsWith(HOME_MARK)) {
|
|
136977
|
+
const target = path47.join(root, word.slice(HOME_MARK.length).split(HOME_MARK).join(root));
|
|
136978
|
+
if (isInside4(root, target)) found.add(target);
|
|
136979
|
+
} else if (path47.isAbsolute(word)) {
|
|
136980
|
+
const target = path47.resolve(word);
|
|
136981
|
+
if (isInside4(root, target) || isInside4(pluginsRoot, target) || target.includes(pluginSegment)) {
|
|
136982
|
+
found.add(target);
|
|
136983
|
+
}
|
|
136984
|
+
} else if (!word.startsWith("~") && !word.startsWith("$") && !word.startsWith("-") && PATH_LIKE.test(word)) {
|
|
136985
|
+
const target = path47.resolve(root, word);
|
|
136986
|
+
if (isInside4(root, target)) found.add(target);
|
|
136987
|
+
}
|
|
136988
|
+
}
|
|
136989
|
+
}
|
|
136990
|
+
return [...found];
|
|
136991
|
+
}
|
|
136992
|
+
function hookScriptFiles(home2, commands, dorkHome) {
|
|
136993
|
+
const root = path47.resolve(home2);
|
|
136994
|
+
const entries = /* @__PURE__ */ new Map();
|
|
136995
|
+
let files = 0;
|
|
136996
|
+
const hash3 = (abs) => {
|
|
136997
|
+
if (entries.has(abs)) return true;
|
|
136998
|
+
let stat5;
|
|
136999
|
+
try {
|
|
137000
|
+
stat5 = lstatSync16(abs);
|
|
137001
|
+
} catch (err) {
|
|
137002
|
+
if (err.code !== "ENOENT") return false;
|
|
137003
|
+
entries.set(abs, "absent");
|
|
137004
|
+
return true;
|
|
137005
|
+
}
|
|
137006
|
+
if (stat5.isDirectory()) {
|
|
137007
|
+
entries.set(abs, "dir");
|
|
137008
|
+
return true;
|
|
137009
|
+
}
|
|
137010
|
+
if (!stat5.isFile() || stat5.size > MAX_FILE_BYTES || files >= MAX_FILES) return false;
|
|
137011
|
+
try {
|
|
137012
|
+
const content = readFileSync21(abs);
|
|
137013
|
+
if (content.byteLength > MAX_FILE_BYTES) return false;
|
|
137014
|
+
files += 1;
|
|
137015
|
+
entries.set(abs, sha2562(content));
|
|
137016
|
+
return true;
|
|
137017
|
+
} catch {
|
|
137018
|
+
return false;
|
|
137019
|
+
}
|
|
137020
|
+
};
|
|
137021
|
+
const walk = (abs, depth) => {
|
|
137022
|
+
let stat5;
|
|
137023
|
+
try {
|
|
137024
|
+
stat5 = lstatSync16(abs);
|
|
137025
|
+
} catch (err) {
|
|
137026
|
+
return err.code === "ENOENT";
|
|
137027
|
+
}
|
|
137028
|
+
if (!stat5.isDirectory() || depth > MAX_DEPTH2) return false;
|
|
137029
|
+
let names;
|
|
137030
|
+
try {
|
|
137031
|
+
names = readdirSync10(abs);
|
|
137032
|
+
} catch {
|
|
137033
|
+
return false;
|
|
137034
|
+
}
|
|
137035
|
+
for (const name2 of names) {
|
|
137036
|
+
const child = path47.join(abs, name2);
|
|
137037
|
+
let childStat;
|
|
137038
|
+
try {
|
|
137039
|
+
childStat = lstatSync16(child);
|
|
137040
|
+
} catch {
|
|
137041
|
+
return false;
|
|
137042
|
+
}
|
|
137043
|
+
if (!(childStat.isDirectory() ? walk(child, depth + 1) : hash3(child))) return false;
|
|
137044
|
+
}
|
|
137045
|
+
return true;
|
|
137046
|
+
};
|
|
137047
|
+
if (!walk(path47.join(root, ".claude", "hooks"), 1)) return void 0;
|
|
137048
|
+
for (const target of namedTargets(root, path47.resolve(dorkHome, "plugins"), commands)) {
|
|
137049
|
+
if (!hash3(target)) return void 0;
|
|
137050
|
+
}
|
|
137051
|
+
return sortedByPath(root, entries);
|
|
137052
|
+
}
|
|
137053
|
+
function sortedByPath(root, entries) {
|
|
137054
|
+
return [...entries].map(([abs, value]) => [
|
|
137055
|
+
isInside4(root, abs) ? path47.relative(root, abs).split(path47.sep).join("/") : abs,
|
|
137056
|
+
value
|
|
137057
|
+
]).sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
|
|
137058
|
+
}
|
|
137059
|
+
function agentFileHooks(home2) {
|
|
137060
|
+
const root = path47.resolve(home2);
|
|
137061
|
+
const entries = /* @__PURE__ */ new Map();
|
|
137062
|
+
let files = 0;
|
|
137063
|
+
const read = (abs) => {
|
|
137064
|
+
let stat5;
|
|
137065
|
+
try {
|
|
137066
|
+
stat5 = statSync11(abs);
|
|
137067
|
+
} catch (err) {
|
|
137068
|
+
return err.code === "ENOENT";
|
|
137069
|
+
}
|
|
137070
|
+
if (!stat5.isFile() || stat5.size > MAX_FILE_BYTES || files >= MAX_FILES) return false;
|
|
137071
|
+
let text3;
|
|
137072
|
+
try {
|
|
137073
|
+
text3 = readFileSync21(abs, "utf8");
|
|
137074
|
+
} catch {
|
|
137075
|
+
return false;
|
|
137076
|
+
}
|
|
137077
|
+
files += 1;
|
|
137078
|
+
let picked;
|
|
137079
|
+
try {
|
|
137080
|
+
const { data } = parseFrontmatter(text3);
|
|
137081
|
+
picked = {};
|
|
137082
|
+
for (const field of AGENT_FILE_FIELDS) {
|
|
137083
|
+
if (Object.hasOwn(data, field)) picked[field] = data[field];
|
|
137084
|
+
}
|
|
137085
|
+
} catch {
|
|
137086
|
+
const block = /^---[^\n]*\n([\s\S]*?)\n---/.exec(text3)?.[1] ?? text3;
|
|
137087
|
+
picked = { unparseable: sha2562(block) };
|
|
137088
|
+
}
|
|
137089
|
+
if (Object.keys(picked).length > 0) entries.set(abs, picked);
|
|
137090
|
+
return true;
|
|
137091
|
+
};
|
|
137092
|
+
const listDir2 = (abs) => {
|
|
137093
|
+
try {
|
|
137094
|
+
if (!statSync11(abs).isDirectory()) return void 0;
|
|
137095
|
+
return readdirSync10(abs);
|
|
137096
|
+
} catch (err) {
|
|
137097
|
+
return err.code === "ENOENT" ? null : void 0;
|
|
137098
|
+
}
|
|
137099
|
+
};
|
|
137100
|
+
const walkAgents = (abs, depth) => {
|
|
137101
|
+
if (depth > MAX_DEPTH2) return false;
|
|
137102
|
+
const names = listDir2(abs);
|
|
137103
|
+
if (names === null) return true;
|
|
137104
|
+
if (names === void 0) return false;
|
|
137105
|
+
for (const name2 of names) {
|
|
137106
|
+
const child = path47.join(abs, name2);
|
|
137107
|
+
const sub = listDir2(child);
|
|
137108
|
+
if (sub !== void 0 && sub !== null) {
|
|
137109
|
+
if (!walkAgents(child, depth + 1)) return false;
|
|
137110
|
+
} else if (name2.endsWith(".md") && !read(child)) {
|
|
137111
|
+
return false;
|
|
137112
|
+
}
|
|
137113
|
+
}
|
|
137114
|
+
return true;
|
|
137115
|
+
};
|
|
137116
|
+
if (!walkAgents(path47.join(root, ".claude", "agents"), 1)) return void 0;
|
|
137117
|
+
if (!walkAgents(path47.join(root, ".claude", "commands"), 1)) return void 0;
|
|
137118
|
+
const skillsDir = path47.join(root, ".claude", "skills");
|
|
137119
|
+
const skills = listDir2(skillsDir);
|
|
137120
|
+
if (skills === void 0) return void 0;
|
|
137121
|
+
for (const name2 of skills ?? []) {
|
|
137122
|
+
if (!read(path47.join(skillsDir, name2, "SKILL.md"))) {
|
|
137123
|
+
if (listDir2(path47.join(skillsDir, name2)) !== void 0) return void 0;
|
|
137124
|
+
}
|
|
137125
|
+
}
|
|
137126
|
+
return sortedByPath(root, entries);
|
|
137127
|
+
}
|
|
137128
|
+
var MAX_FILE_BYTES, MAX_FILES, MAX_DEPTH2, HOME_MARK, PROJECT_DIR_VAR, OUTPUT_REDIRECT, WORD_BREAK, PATH_LIKE, AGENT_FILE_FIELDS;
|
|
137129
|
+
var init_folder_config_scripts = __esm({
|
|
137130
|
+
"../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-scripts.ts"() {
|
|
137131
|
+
"use strict";
|
|
137132
|
+
init_frontmatter();
|
|
137133
|
+
MAX_FILE_BYTES = 64 * 1024;
|
|
137134
|
+
MAX_FILES = 200;
|
|
137135
|
+
MAX_DEPTH2 = 4;
|
|
137136
|
+
HOME_MARK = "\0home\0";
|
|
137137
|
+
PROJECT_DIR_VAR = /\$\{CLAUDE_PROJECT_DIR\}|\$CLAUDE_PROJECT_DIR\b/g;
|
|
137138
|
+
OUTPUT_REDIRECT = /\d*>>?\s*\S+/g;
|
|
137139
|
+
WORD_BREAK = /[\s;&|<>()`=]+/;
|
|
137140
|
+
PATH_LIKE = /\/|\.[A-Za-z0-9]+$/;
|
|
137141
|
+
AGENT_FILE_FIELDS = [
|
|
137142
|
+
"hooks",
|
|
137143
|
+
"mcpServers",
|
|
137144
|
+
// Fields that let a skill, command or subagent skip DorkOS's permission
|
|
137145
|
+
// check or raise its own mode (DOR-3068 M2).
|
|
137146
|
+
"allowed-tools",
|
|
137147
|
+
"tools",
|
|
137148
|
+
"disallowedTools",
|
|
137149
|
+
"permissionMode"
|
|
137150
|
+
];
|
|
137151
|
+
}
|
|
137152
|
+
});
|
|
137153
|
+
|
|
137154
|
+
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-pin.ts
|
|
137155
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
137156
|
+
import { readFileSync as readFileSync22, statSync as statSync12 } from "node:fs";
|
|
137157
|
+
import path48 from "node:path";
|
|
137158
|
+
function readJsonFile2(file2) {
|
|
137159
|
+
let size;
|
|
137160
|
+
try {
|
|
137161
|
+
const stat5 = statSync12(file2);
|
|
137162
|
+
if (!stat5.isFile()) return { kind: "unverifiable" };
|
|
137163
|
+
size = stat5.size;
|
|
137164
|
+
} catch (err) {
|
|
137165
|
+
return err.code === "ENOENT" ? { kind: "absent" } : { kind: "unverifiable" };
|
|
137166
|
+
}
|
|
137167
|
+
if (size > MAX_FILE_BYTES2) return { kind: "unverifiable" };
|
|
137168
|
+
let text3;
|
|
137169
|
+
try {
|
|
137170
|
+
text3 = readFileSync22(file2, "utf8");
|
|
137171
|
+
} catch {
|
|
137172
|
+
return { kind: "unverifiable" };
|
|
137173
|
+
}
|
|
137174
|
+
if (Buffer.byteLength(text3) > MAX_FILE_BYTES2) return { kind: "unverifiable" };
|
|
137175
|
+
try {
|
|
137176
|
+
return { kind: "parsed", value: JSON.parse(text3) };
|
|
137177
|
+
} catch {
|
|
137178
|
+
return { kind: "malformed", text: text3 };
|
|
137179
|
+
}
|
|
137180
|
+
}
|
|
137181
|
+
function canonicalJson(value) {
|
|
137182
|
+
return JSON.stringify(sortKeys(value));
|
|
137183
|
+
}
|
|
137184
|
+
function sortKeys(value) {
|
|
137185
|
+
if (Array.isArray(value)) return value.map(sortKeys);
|
|
137186
|
+
if (value === null || typeof value !== "object") return value;
|
|
137187
|
+
const out = {};
|
|
137188
|
+
for (const key of Object.keys(value).sort()) {
|
|
137189
|
+
out[key] = sortKeys(value[key]);
|
|
137190
|
+
}
|
|
137191
|
+
return out;
|
|
137192
|
+
}
|
|
137193
|
+
function sha2563(text3) {
|
|
137194
|
+
return createHash5("sha256").update(text3).digest("hex");
|
|
137195
|
+
}
|
|
137196
|
+
function malformed(text3) {
|
|
137197
|
+
return { malformed: sha2563(text3) };
|
|
137198
|
+
}
|
|
137199
|
+
function pick2(value, keys) {
|
|
137200
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
137201
|
+
return { notAnObject: value };
|
|
137202
|
+
const out = {};
|
|
137203
|
+
for (const key of keys) {
|
|
137204
|
+
if (Object.hasOwn(value, key)) out[key] = value[key];
|
|
137205
|
+
}
|
|
137206
|
+
return out;
|
|
137207
|
+
}
|
|
137208
|
+
function servers(value) {
|
|
137209
|
+
if (!Array.isArray(value)) return value;
|
|
137210
|
+
return value.map((entry) => {
|
|
137211
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return entry;
|
|
137212
|
+
const { addedAt: _at, addedBy: _by, ...rest } = entry;
|
|
137213
|
+
const connection = rest.connection;
|
|
137214
|
+
if (connection !== null && typeof connection === "object" && !Array.isArray(connection)) {
|
|
137215
|
+
const { authKind: _kind, ...kept } = connection;
|
|
137216
|
+
return { ...rest, connection: kept };
|
|
137217
|
+
}
|
|
137218
|
+
return rest;
|
|
137219
|
+
});
|
|
137220
|
+
}
|
|
137221
|
+
function hooksPart(home2, dorkHome) {
|
|
137222
|
+
const value = {};
|
|
137223
|
+
let verifiable = true;
|
|
137224
|
+
const commands = [];
|
|
137225
|
+
for (const name2 of SETTINGS_FILES) {
|
|
137226
|
+
const read = readJsonFile2(path48.join(home2, ".claude", name2));
|
|
137227
|
+
if (read.kind === "unverifiable") verifiable = false;
|
|
137228
|
+
const picked = read.kind === "parsed" ? pick2(read.value, CODE_SETTINGS_KEYS) : void 0;
|
|
137229
|
+
if (picked !== void 0) collectCommands2(picked, commands);
|
|
137230
|
+
value[name2] = picked !== void 0 ? picked : read.kind === "malformed" ? malformed(read.text) : read.kind === "absent" ? null : { unverifiable: true };
|
|
137231
|
+
}
|
|
137232
|
+
const files = hookScriptFiles(home2, commands, dorkHome);
|
|
137233
|
+
const agentFiles = agentFileHooks(home2);
|
|
137234
|
+
if (files === void 0 || agentFiles === void 0) {
|
|
137235
|
+
return { value: { ...value, files: { unverifiable: true } }, verifiable: false };
|
|
137236
|
+
}
|
|
137237
|
+
return { value: { ...value, files, agentFiles }, verifiable };
|
|
137238
|
+
}
|
|
137239
|
+
function collectCommands2(value, out) {
|
|
137240
|
+
if (Array.isArray(value)) {
|
|
137241
|
+
for (const item of value) collectCommands2(item, out);
|
|
137242
|
+
return;
|
|
137243
|
+
}
|
|
137244
|
+
if (value === null || typeof value !== "object") return;
|
|
137245
|
+
for (const [key, child] of Object.entries(value)) {
|
|
137246
|
+
if ((key === "command" || HELPER_KEYS.includes(key)) && typeof child === "string") {
|
|
137247
|
+
out.push(child);
|
|
137248
|
+
} else {
|
|
137249
|
+
collectCommands2(child, out);
|
|
137250
|
+
}
|
|
137251
|
+
}
|
|
137252
|
+
}
|
|
137253
|
+
function mcpJsonPart(home2) {
|
|
137254
|
+
const read = readJsonFile2(path48.join(home2, ".mcp.json"));
|
|
137255
|
+
if (read.kind === "unverifiable") return { value: { unverifiable: true }, verifiable: false };
|
|
137256
|
+
if (read.kind === "malformed") return { value: malformed(read.text), verifiable: true };
|
|
137257
|
+
return { value: read.kind === "parsed" ? read.value : null, verifiable: true };
|
|
137258
|
+
}
|
|
137259
|
+
function manifestPart(home2) {
|
|
137260
|
+
const read = readJsonFile2(path48.join(home2, ".dork", "agent.json"));
|
|
137261
|
+
if (read.kind === "unverifiable") return { value: { unverifiable: true }, verifiable: false };
|
|
137262
|
+
if (read.kind === "malformed") return { value: malformed(read.text), verifiable: true };
|
|
137263
|
+
if (read.kind === "absent") return { value: null, verifiable: true };
|
|
137264
|
+
const manifest = read.value;
|
|
137265
|
+
if (manifest === null || typeof manifest !== "object" || Array.isArray(manifest)) {
|
|
137266
|
+
return { value: { notAnObject: manifest }, verifiable: true };
|
|
137267
|
+
}
|
|
137268
|
+
const fields = manifest;
|
|
137269
|
+
return {
|
|
137270
|
+
value: {
|
|
137271
|
+
id: Object.hasOwn(fields, "id") ? fields.id : null,
|
|
137272
|
+
runtime: Object.hasOwn(fields, "runtime") ? fields.runtime : null,
|
|
137273
|
+
mcpServers: Object.hasOwn(fields, "mcpServers") ? servers(fields.mcpServers) : null,
|
|
137274
|
+
account: Object.hasOwn(fields, "account") ? fields.account : null
|
|
137275
|
+
},
|
|
137276
|
+
verifiable: true
|
|
137277
|
+
};
|
|
137278
|
+
}
|
|
137279
|
+
function isEmptyValue(value) {
|
|
137280
|
+
if (value === null || value === void 0 || value === "") return true;
|
|
137281
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
137282
|
+
if (typeof value === "object") return Object.values(value).every(isEmptyValue);
|
|
137283
|
+
return false;
|
|
137284
|
+
}
|
|
137285
|
+
function hooksInert(value) {
|
|
137286
|
+
const { files, agentFiles, ...settings } = value ?? {};
|
|
137287
|
+
return isEmptyValue(settings) && isEmptyValue(files) && isEmptyValue(agentFiles);
|
|
137288
|
+
}
|
|
137289
|
+
function mcpJsonInert(value) {
|
|
137290
|
+
if (value === null) return true;
|
|
137291
|
+
const servers2 = value?.mcpServers;
|
|
137292
|
+
return typeof value === "object" && !Array.isArray(value) && isEmptyValue(servers2) && Object.keys(value).every((key) => key === "mcpServers");
|
|
137293
|
+
}
|
|
137294
|
+
function manifestInert(value) {
|
|
137295
|
+
if (value === null) return true;
|
|
137296
|
+
const fields = value;
|
|
137297
|
+
if (typeof value !== "object" || !Object.hasOwn(fields, "id")) return false;
|
|
137298
|
+
const runtimeInert = fields.runtime === null || fields.runtime === "claude-code";
|
|
137299
|
+
return runtimeInert && isEmptyValue(fields.mcpServers) && isEmptyValue(fields.account);
|
|
137300
|
+
}
|
|
137301
|
+
function readFolderConfigParts(home2, dorkHome = resolveDorkHome()) {
|
|
137302
|
+
const values2 = {
|
|
137303
|
+
hooks: hooksPart(home2, dorkHome),
|
|
137304
|
+
mcpJson: mcpJsonPart(home2),
|
|
137305
|
+
manifest: manifestPart(home2)
|
|
137306
|
+
};
|
|
137307
|
+
const digests = {};
|
|
137308
|
+
const unverifiable = [];
|
|
137309
|
+
for (const part of FOLDER_CONFIG_PARTS) {
|
|
137310
|
+
digests[part] = sha2563(canonicalJson(values2[part].value));
|
|
137311
|
+
if (!values2[part].verifiable) unverifiable.push(part);
|
|
137312
|
+
}
|
|
137313
|
+
const inert = unverifiable.length === 0 && hooksInert(values2.hooks.value) && mcpJsonInert(values2.mcpJson.value) && manifestInert(values2.manifest.value);
|
|
137314
|
+
return {
|
|
137315
|
+
digests,
|
|
137316
|
+
unverifiable,
|
|
137317
|
+
inert,
|
|
137318
|
+
values: {
|
|
137319
|
+
hooks: values2.hooks.value,
|
|
137320
|
+
mcpJson: values2.mcpJson.value,
|
|
137321
|
+
manifest: values2.manifest.value
|
|
137322
|
+
}
|
|
137323
|
+
};
|
|
137324
|
+
}
|
|
137325
|
+
var FOLDER_CONFIG_PARTS, CODE_SETTINGS_KEYS, SETTINGS_FILES, MAX_FILE_BYTES2, HELPER_KEYS;
|
|
137326
|
+
var init_folder_config_pin = __esm({
|
|
137327
|
+
"../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-pin.ts"() {
|
|
137328
|
+
"use strict";
|
|
137329
|
+
init_dork_home();
|
|
137330
|
+
init_folder_config_scripts();
|
|
137331
|
+
FOLDER_CONFIG_PARTS = ["hooks", "mcpJson", "manifest"];
|
|
137332
|
+
CODE_SETTINGS_KEYS = [
|
|
137333
|
+
"hooks",
|
|
137334
|
+
"statusLine",
|
|
137335
|
+
"enabledPlugins",
|
|
137336
|
+
"extraKnownMarketplaces",
|
|
137337
|
+
"enableAllProjectMcpServers",
|
|
137338
|
+
"enabledMcpjsonServers",
|
|
137339
|
+
"disabledMcpjsonServers",
|
|
137340
|
+
"apiKeyHelper",
|
|
137341
|
+
"awsAuthRefresh",
|
|
137342
|
+
"awsCredentialExport",
|
|
137343
|
+
"otelHeadersHelper",
|
|
137344
|
+
"env",
|
|
137345
|
+
// The rest of the CLI's own list of settings that run a command (DOR-3068 M1).
|
|
137346
|
+
"gcpAuthRefresh",
|
|
137347
|
+
"proxyAuthHelper",
|
|
137348
|
+
"subagentStatusLine",
|
|
137349
|
+
"fileSuggestion",
|
|
137350
|
+
// Which `.claude/agents` file the main thread runs as.
|
|
137351
|
+
"agent"
|
|
137352
|
+
];
|
|
137353
|
+
SETTINGS_FILES = ["settings.json", "settings.local.json"];
|
|
137354
|
+
MAX_FILE_BYTES2 = 64 * 1024;
|
|
137355
|
+
HELPER_KEYS = ["apiKeyHelper", "awsAuthRefresh", "awsCredentialExport", "otelHeadersHelper"];
|
|
137356
|
+
}
|
|
137357
|
+
});
|
|
137358
|
+
|
|
137359
|
+
// ../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-consent.ts
|
|
137360
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
137361
|
+
import { realpathSync as realpathSync12 } from "node:fs";
|
|
137362
|
+
import path49 from "node:path";
|
|
137363
|
+
function folderConfigEntry(state) {
|
|
137364
|
+
const parts = Object.fromEntries(FOLDER_CONFIG_PARTS.map((p) => [p, state.digests[p]]));
|
|
137365
|
+
const digest2 = createHash6("sha256").update(JSON.stringify({ home: canonicalHome2(state.home), parts })).digest("hex");
|
|
137366
|
+
return `${state.agentId}${FOLDER_CONFIG_ENTRY_MARKER}${digest2}`;
|
|
137367
|
+
}
|
|
137368
|
+
function canonicalHome2(home2) {
|
|
137369
|
+
const resolved = path49.resolve(home2);
|
|
137370
|
+
try {
|
|
137371
|
+
return realpathSync12.native(resolved);
|
|
137372
|
+
} catch {
|
|
137373
|
+
return resolved;
|
|
137374
|
+
}
|
|
137375
|
+
}
|
|
137376
|
+
function isAgentEntry(agentId) {
|
|
137377
|
+
return (stored) => stored.startsWith(`${agentId}${FOLDER_CONFIG_ENTRY_MARKER}`);
|
|
137378
|
+
}
|
|
137379
|
+
function storedDecisions() {
|
|
137380
|
+
const harness = configManager.get("harness") ?? {};
|
|
137381
|
+
return {
|
|
137382
|
+
approved: [...harness.approvedFolderConfig ?? []],
|
|
137383
|
+
refused: [...harness.refusedFolderConfig ?? []],
|
|
137384
|
+
parts: { ...harness.approvedFolderConfigParts ?? {} }
|
|
137385
|
+
};
|
|
137386
|
+
}
|
|
137387
|
+
function writeDecisions2(reason, next) {
|
|
137388
|
+
const harness = configManager.get("harness");
|
|
137389
|
+
const current3 = storedDecisions();
|
|
137390
|
+
if (JSON.stringify(next) === JSON.stringify(current3)) return;
|
|
137391
|
+
configManager.set("harness", {
|
|
137392
|
+
...harness,
|
|
137393
|
+
approvedFolderConfig: next.approved,
|
|
137394
|
+
refusedFolderConfig: next.refused,
|
|
137395
|
+
approvedFolderConfigParts: next.parts
|
|
137396
|
+
});
|
|
137397
|
+
logConfigWrite(reason, "harness", harness, configManager.get("harness"));
|
|
137398
|
+
}
|
|
137399
|
+
function lastApprovedParts(agentId, home2) {
|
|
137400
|
+
const { approved, parts } = storedDecisions();
|
|
137401
|
+
const previous = parts[agentId];
|
|
137402
|
+
if (!previous) return void 0;
|
|
137403
|
+
return approved.includes(folderConfigEntry({ agentId, home: home2, digests: previous })) ? { ...previous } : void 0;
|
|
137404
|
+
}
|
|
137405
|
+
function recordFolderConfigApproval(state, reason = "allowing an agent's folder settings") {
|
|
137406
|
+
const entry = folderConfigEntry(state);
|
|
137407
|
+
const { approved, refused: refused3, parts } = storedDecisions();
|
|
137408
|
+
writeDecisions2(reason, {
|
|
137409
|
+
approved: [...approved.filter((stored) => !isAgentEntry(state.agentId)(stored)), entry],
|
|
137410
|
+
refused: refused3.filter((stored) => stored !== entry),
|
|
137411
|
+
parts: { ...parts, [state.agentId]: { ...state.digests } }
|
|
137412
|
+
});
|
|
137413
|
+
}
|
|
137414
|
+
function repinFolderConfigPart(agentId, home2, part, before, after, reason) {
|
|
137415
|
+
const approved = lastApprovedParts(agentId, home2);
|
|
137416
|
+
if (!approved || approved[part] !== before) return false;
|
|
137417
|
+
if (before === after) return true;
|
|
137418
|
+
recordFolderConfigApproval({ agentId, home: home2, digests: { ...approved, [part]: after } }, reason);
|
|
137419
|
+
return true;
|
|
137420
|
+
}
|
|
137421
|
+
function withPersonRepinAtHome(home2, part, reason, write) {
|
|
137422
|
+
let agents2 = [];
|
|
137423
|
+
try {
|
|
137424
|
+
agents2 = Object.keys(storedDecisions().parts).filter(
|
|
137425
|
+
(agentId) => lastApprovedParts(agentId, home2) !== void 0
|
|
137426
|
+
);
|
|
137427
|
+
} catch {
|
|
137428
|
+
}
|
|
137429
|
+
if (agents2.length === 0) return write();
|
|
137430
|
+
const before = safeRead(home2, part);
|
|
137431
|
+
const result2 = write();
|
|
137432
|
+
const after = safeRead(home2, part);
|
|
137433
|
+
if (before !== void 0 && after !== void 0) {
|
|
137434
|
+
for (const agentId of agents2) {
|
|
137435
|
+
try {
|
|
137436
|
+
repinFolderConfigPart(agentId, home2, part, before, after, reason);
|
|
137437
|
+
} catch (err) {
|
|
137438
|
+
logger.warn("[FolderConfig] Could not move the pin after a projection", {
|
|
137439
|
+
agentId,
|
|
137440
|
+
part,
|
|
137441
|
+
error: err instanceof Error ? err.message : String(err)
|
|
137442
|
+
});
|
|
137443
|
+
}
|
|
137444
|
+
}
|
|
137445
|
+
}
|
|
137446
|
+
return result2;
|
|
137447
|
+
}
|
|
137448
|
+
function safeRead(home2, part) {
|
|
137449
|
+
try {
|
|
137450
|
+
const read = readFolderConfigParts(home2);
|
|
137451
|
+
return read.unverifiable.includes(part) ? void 0 : read.digests[part];
|
|
137452
|
+
} catch {
|
|
137453
|
+
return void 0;
|
|
137454
|
+
}
|
|
137455
|
+
}
|
|
137456
|
+
var FOLDER_CONFIG_ENTRY_MARKER;
|
|
137457
|
+
var init_folder_config_consent = __esm({
|
|
137458
|
+
"../../apps/server/src/services/runtimes/claude-code/folder-settings/folder-config-consent.ts"() {
|
|
137459
|
+
"use strict";
|
|
137460
|
+
init_logger();
|
|
137461
|
+
init_config_manager();
|
|
137462
|
+
init_config_write();
|
|
137463
|
+
init_folder_config_pin();
|
|
137464
|
+
FOLDER_CONFIG_ENTRY_MARKER = "@folder-config-";
|
|
137465
|
+
}
|
|
137466
|
+
});
|
|
137467
|
+
|
|
136808
137468
|
// ../../apps/server/src/services/harness/project-with-consent.ts
|
|
136809
137469
|
var project_with_consent_exports = {};
|
|
136810
137470
|
__export(project_with_consent_exports, {
|
|
@@ -136817,11 +137477,11 @@ __export(project_with_consent_exports, {
|
|
|
136817
137477
|
withProjectLock: () => withProjectLock
|
|
136818
137478
|
});
|
|
136819
137479
|
import { AsyncLocalStorage as AsyncLocalStorage6 } from "node:async_hooks";
|
|
136820
|
-
import { realpathSync as
|
|
137480
|
+
import { realpathSync as realpathSync13 } from "node:fs";
|
|
136821
137481
|
import { resolve as resolve9 } from "node:path";
|
|
136822
137482
|
function projectLockKey(projectPath) {
|
|
136823
137483
|
try {
|
|
136824
|
-
return
|
|
137484
|
+
return realpathSync13(projectPath);
|
|
136825
137485
|
} catch {
|
|
136826
137486
|
return resolve9(projectPath);
|
|
136827
137487
|
}
|
|
@@ -136907,10 +137567,11 @@ function projectWithConsent(projectPath, opts) {
|
|
|
136907
137567
|
);
|
|
136908
137568
|
}
|
|
136909
137569
|
const { plan, withheld } = planWithConsent(projectPath, opts);
|
|
136910
|
-
const { applied, conflicts, swept, removals, leftAlone, warnings } =
|
|
137570
|
+
const { applied, conflicts, swept, removals, leftAlone, warnings } = withPersonRepinAtHome(
|
|
136911
137571
|
projectPath,
|
|
136912
|
-
|
|
136913
|
-
|
|
137572
|
+
"hooks",
|
|
137573
|
+
"projecting hooks a person allowed",
|
|
137574
|
+
() => _internal.applyPlan(projectPath, plan, { sweepOrphans: opts.sweepOrphans })
|
|
136914
137575
|
);
|
|
136915
137576
|
return { plan, withheld, applied, conflicts, swept, removals, leftAlone, warnings };
|
|
136916
137577
|
}
|
|
@@ -136920,6 +137581,7 @@ var init_project_with_consent = __esm({
|
|
|
136920
137581
|
init_src5();
|
|
136921
137582
|
init_hook_consent();
|
|
136922
137583
|
init_global_scope();
|
|
137584
|
+
init_folder_config_consent();
|
|
136923
137585
|
_internal = {
|
|
136924
137586
|
project,
|
|
136925
137587
|
applyPlan,
|
|
@@ -136990,11 +137652,11 @@ var init_atomic_write2 = __esm({
|
|
|
136990
137652
|
});
|
|
136991
137653
|
|
|
136992
137654
|
// ../../apps/server/src/services/marketplace/lib/package-paths.ts
|
|
136993
|
-
import
|
|
137655
|
+
import path50 from "node:path";
|
|
136994
137656
|
function assertContainedIn(root, candidate) {
|
|
136995
|
-
const resolvedRoot =
|
|
136996
|
-
const resolved =
|
|
136997
|
-
if (!resolved.startsWith(resolvedRoot +
|
|
137657
|
+
const resolvedRoot = path50.resolve(root);
|
|
137658
|
+
const resolved = path50.resolve(candidate);
|
|
137659
|
+
if (!resolved.startsWith(resolvedRoot + path50.sep)) {
|
|
136998
137660
|
throw new PathEscapeError(root, candidate);
|
|
136999
137661
|
}
|
|
137000
137662
|
return candidate;
|
|
@@ -137109,7 +137771,7 @@ import { join as join50 } from "node:path";
|
|
|
137109
137771
|
async function directorySize(root) {
|
|
137110
137772
|
let total = 0;
|
|
137111
137773
|
const walk = async (dir, depth) => {
|
|
137112
|
-
if (depth >
|
|
137774
|
+
if (depth > MAX_DEPTH3) return;
|
|
137113
137775
|
let entries;
|
|
137114
137776
|
try {
|
|
137115
137777
|
entries = await readdir3(dir, { withFileTypes: true });
|
|
@@ -137131,16 +137793,16 @@ async function directorySize(root) {
|
|
|
137131
137793
|
await walk(root, 0);
|
|
137132
137794
|
return total;
|
|
137133
137795
|
}
|
|
137134
|
-
var
|
|
137796
|
+
var MAX_DEPTH3;
|
|
137135
137797
|
var init_directory_size = __esm({
|
|
137136
137798
|
"../../apps/server/src/services/marketplace/lib/directory-size.ts"() {
|
|
137137
137799
|
"use strict";
|
|
137138
|
-
|
|
137800
|
+
MAX_DEPTH3 = 256;
|
|
137139
137801
|
}
|
|
137140
137802
|
});
|
|
137141
137803
|
|
|
137142
137804
|
// ../../apps/server/src/services/marketplace/cache/marketplace-cache.ts
|
|
137143
|
-
import { createHash as
|
|
137805
|
+
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
137144
137806
|
import {
|
|
137145
137807
|
access,
|
|
137146
137808
|
mkdir as mkdir4,
|
|
@@ -137161,15 +137823,15 @@ function isFetchStatus(value) {
|
|
|
137161
137823
|
}
|
|
137162
137824
|
function subpathDigest(subpath) {
|
|
137163
137825
|
if (subpath === "") return "";
|
|
137164
|
-
return
|
|
137826
|
+
return createHash7("sha256").update(subpath).digest("hex").slice(0, 12);
|
|
137165
137827
|
}
|
|
137166
|
-
async function stampUsed(
|
|
137828
|
+
async function stampUsed(path71) {
|
|
137167
137829
|
const now3 = /* @__PURE__ */ new Date();
|
|
137168
137830
|
try {
|
|
137169
|
-
await utimes(
|
|
137831
|
+
await utimes(path71, now3, now3);
|
|
137170
137832
|
return now3;
|
|
137171
137833
|
} catch {
|
|
137172
|
-
return (await stat2(
|
|
137834
|
+
return (await stat2(path71)).mtime;
|
|
137173
137835
|
}
|
|
137174
137836
|
}
|
|
137175
137837
|
function parsePackageDirName(entry) {
|
|
@@ -137410,14 +138072,14 @@ var init_marketplace_cache = __esm({
|
|
|
137410
138072
|
* @returns A descriptor when a non-empty entry is present, `null` otherwise.
|
|
137411
138073
|
*/
|
|
137412
138074
|
async getPackage(packageName, commitSha, subpath) {
|
|
137413
|
-
const
|
|
137414
|
-
const usedAt = await this.stampIfPresent(
|
|
138075
|
+
const path71 = this.packageDir(packageName, commitSha, subpath);
|
|
138076
|
+
const usedAt = await this.stampIfPresent(path71);
|
|
137415
138077
|
if (usedAt === null) return null;
|
|
137416
138078
|
return {
|
|
137417
138079
|
packageName,
|
|
137418
138080
|
commitSha,
|
|
137419
138081
|
subpathDigest: subpathDigest(subpath),
|
|
137420
|
-
path:
|
|
138082
|
+
path: path71,
|
|
137421
138083
|
lastUsedAt: usedAt
|
|
137422
138084
|
};
|
|
137423
138085
|
}
|
|
@@ -137609,10 +138271,10 @@ var init_marketplace_cache = __esm({
|
|
|
137609
138271
|
* @returns When it was stamped, or `null` when there is no valid entry.
|
|
137610
138272
|
* @internal
|
|
137611
138273
|
*/
|
|
137612
|
-
stampIfPresent(
|
|
138274
|
+
stampIfPresent(path71) {
|
|
137613
138275
|
return this.exclusive(async () => {
|
|
137614
|
-
if (!await isNonEmptyDir(
|
|
137615
|
-
return stampUsed(
|
|
138276
|
+
if (!await isNonEmptyDir(path71)) return null;
|
|
138277
|
+
return stampUsed(path71);
|
|
137616
138278
|
});
|
|
137617
138279
|
}
|
|
137618
138280
|
/**
|
|
@@ -137650,9 +138312,9 @@ var init_marketplace_cache = __esm({
|
|
|
137650
138312
|
if (!parsed) {
|
|
137651
138313
|
continue;
|
|
137652
138314
|
}
|
|
137653
|
-
const
|
|
138315
|
+
const path71 = join51(root, entry);
|
|
137654
138316
|
try {
|
|
137655
|
-
const info2 = await stat2(
|
|
138317
|
+
const info2 = await stat2(path71);
|
|
137656
138318
|
if (!info2.isDirectory()) {
|
|
137657
138319
|
continue;
|
|
137658
138320
|
}
|
|
@@ -137660,7 +138322,7 @@ var init_marketplace_cache = __esm({
|
|
|
137660
138322
|
packageName: parsed.packageName,
|
|
137661
138323
|
commitSha: parsed.commitSha,
|
|
137662
138324
|
subpathDigest: parsed.subpathDigest,
|
|
137663
|
-
path:
|
|
138325
|
+
path: path71,
|
|
137664
138326
|
lastUsedAt: info2.mtime
|
|
137665
138327
|
});
|
|
137666
138328
|
} catch {
|
|
@@ -138028,7 +138690,7 @@ __export(claude_enabled_plugins_exports, {
|
|
|
138028
138690
|
readClaudeOnlyPlugins: () => readClaudeOnlyPlugins
|
|
138029
138691
|
});
|
|
138030
138692
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
138031
|
-
import
|
|
138693
|
+
import path51 from "node:path";
|
|
138032
138694
|
function causeOf(err) {
|
|
138033
138695
|
return err instanceof Error ? err.message : String(err);
|
|
138034
138696
|
}
|
|
@@ -138127,7 +138789,7 @@ function splitPluginKey(key) {
|
|
|
138127
138789
|
}
|
|
138128
138790
|
async function readDorkosSources(dorkHome) {
|
|
138129
138791
|
let sources2;
|
|
138130
|
-
const sourcesPath =
|
|
138792
|
+
const sourcesPath = path51.join(dorkHome, "marketplaces.json");
|
|
138131
138793
|
try {
|
|
138132
138794
|
sources2 = await new MarketplaceSourceManager(dorkHome).list();
|
|
138133
138795
|
} catch {
|
|
@@ -138163,7 +138825,7 @@ function classifyOffer(repo, name2, dorkos) {
|
|
|
138163
138825
|
async function readClaudeOnlyPlugins(input4) {
|
|
138164
138826
|
const { claudeRoot, projectPath, dorkHome } = input4;
|
|
138165
138827
|
const base = { root: claudeRoot, readAt: (/* @__PURE__ */ new Date()).toISOString(), mayBeOverridden: true };
|
|
138166
|
-
const user2 = await readSettingsSlice(
|
|
138828
|
+
const user2 = await readSettingsSlice(path51.join(claudeRoot, "settings.json"));
|
|
138167
138829
|
if (user2.slice === void 0) {
|
|
138168
138830
|
return {
|
|
138169
138831
|
...base,
|
|
@@ -138173,8 +138835,8 @@ async function readClaudeOnlyPlugins(input4) {
|
|
|
138173
138835
|
personalHookCommands: 0
|
|
138174
138836
|
};
|
|
138175
138837
|
}
|
|
138176
|
-
const project2 = await readSettingsSlice(
|
|
138177
|
-
const local = await readSettingsSlice(
|
|
138838
|
+
const project2 = await readSettingsSlice(path51.join(projectPath, ".claude", "settings.json"));
|
|
138839
|
+
const local = await readSettingsSlice(path51.join(projectPath, ".claude", "settings.local.json"));
|
|
138178
138840
|
const merged = mergeSettings([user2.slice, project2.slice ?? {}, local.slice ?? {}]);
|
|
138179
138841
|
const hooks = countHookCommands(user2.slice.hooks);
|
|
138180
138842
|
const partial2 = {
|
|
@@ -138279,7 +138941,7 @@ __export(harness_sync_command_exports, {
|
|
|
138279
138941
|
parseHarnessSyncArgs: () => parseHarnessSyncArgs,
|
|
138280
138942
|
runHarnessSync: () => runHarnessSync
|
|
138281
138943
|
});
|
|
138282
|
-
import { existsSync as existsSync18, readFileSync as
|
|
138944
|
+
import { existsSync as existsSync18, readFileSync as readFileSync23 } from "node:fs";
|
|
138283
138945
|
import { join as join53 } from "node:path";
|
|
138284
138946
|
import { parseArgs as parseArgs4 } from "node:util";
|
|
138285
138947
|
function parseHarnessSyncArgs(rawArgs) {
|
|
@@ -138316,9 +138978,9 @@ function parseHarnessSyncArgs(rawArgs) {
|
|
|
138316
138978
|
};
|
|
138317
138979
|
}
|
|
138318
138980
|
function formatAction2(action) {
|
|
138319
|
-
const
|
|
138981
|
+
const path71 = action.target ?? action.source ?? "(no path)";
|
|
138320
138982
|
const note = action.reason ? ` \u2014 ${action.reason}` : "";
|
|
138321
|
-
return ` [${action.kind}] ${action.artifact} "${action.name}" -> ${
|
|
138983
|
+
return ` [${action.kind}] ${action.artifact} "${action.name}" -> ${path71} (${action.harness})${note}`;
|
|
138322
138984
|
}
|
|
138323
138985
|
function formatAdoptable(repoRoot, manifest) {
|
|
138324
138986
|
const { candidates } = readAdoptCandidates(repoRoot, inventorySourceTree(repoRoot), manifest);
|
|
@@ -138344,26 +139006,26 @@ function formatAutoAdoptInert(inert) {
|
|
|
138344
139006
|
return inert ? ["", ADOPT_SENTENCES.S8()] : [];
|
|
138345
139007
|
}
|
|
138346
139008
|
function formatLeftAlone(leftAlone, manifest, harnessFilter) {
|
|
138347
|
-
const shown2 = harnessFilter ? leftAlone.filter((
|
|
139009
|
+
const shown2 = harnessFilter ? leftAlone.filter((path71) => harnessOf(path71) === harnessFilter) : leftAlone;
|
|
138348
139010
|
if (shown2.length === 0) return [];
|
|
138349
139011
|
const stopped = new Set(pluginHookReach(manifest).suppressed.map((s2) => s2.harness));
|
|
138350
|
-
const carried = shown2.filter((
|
|
138351
|
-
const harness = harnessOf(
|
|
139012
|
+
const carried = shown2.filter((path71) => {
|
|
139013
|
+
const harness = harnessOf(path71);
|
|
138352
139014
|
return harness === void 0 || !stopped.has(harness);
|
|
138353
139015
|
});
|
|
138354
139016
|
return [
|
|
138355
139017
|
"",
|
|
138356
139018
|
"Left alone \u2014 files DorkOS did not write, at paths it would otherwise generate:",
|
|
138357
|
-
...shown2.map((
|
|
138358
|
-
const harness = harnessOf(
|
|
139019
|
+
...shown2.map((path71) => {
|
|
139020
|
+
const harness = harnessOf(path71);
|
|
138359
139021
|
const note = harness && stopped.has(harness) ? " \u2014 your manifest's hookPolicies says not to write here" : "";
|
|
138360
|
-
return ` ${
|
|
139022
|
+
return ` ${path71} (${harness})${note}`;
|
|
138361
139023
|
}),
|
|
138362
139024
|
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."
|
|
138363
139025
|
];
|
|
138364
139026
|
}
|
|
138365
|
-
function harnessOf(
|
|
138366
|
-
return GENERATED_HOOK_TARGET_HARNESSES[
|
|
139027
|
+
function harnessOf(path71) {
|
|
139028
|
+
return GENERATED_HOOK_TARGET_HARNESSES[path71];
|
|
138367
139029
|
}
|
|
138368
139030
|
function summarizeActions(actions, withheld, enabled3) {
|
|
138369
139031
|
const withheldLine = withheldSummaryLine(withheld);
|
|
@@ -138418,7 +139080,7 @@ function reportClaudeSkillsRestart(existedBefore, repoRoot) {
|
|
|
138418
139080
|
}
|
|
138419
139081
|
function readIfPresent(repoRoot, rel) {
|
|
138420
139082
|
try {
|
|
138421
|
-
return
|
|
139083
|
+
return readFileSync23(join53(repoRoot, rel), "utf8");
|
|
138422
139084
|
} catch {
|
|
138423
139085
|
return void 0;
|
|
138424
139086
|
}
|
|
@@ -138461,8 +139123,8 @@ function formatIgnoredCanonicalLayer(repoRoot) {
|
|
|
138461
139123
|
" on purpose."
|
|
138462
139124
|
];
|
|
138463
139125
|
}
|
|
138464
|
-
function orphanLine({ path:
|
|
138465
|
-
return ` ${
|
|
139126
|
+
function orphanLine({ path: path71, reason }) {
|
|
139127
|
+
return ` ${path71} \u2014 ${reason}`;
|
|
138466
139128
|
}
|
|
138467
139129
|
function reportCheck(repoRoot, plan, withheld, dorkHome, manifest, claudeOnly, autoAdoptInert, harnessFilter) {
|
|
138468
139130
|
const drift = checkPlan(repoRoot, plan);
|
|
@@ -139181,7 +139843,7 @@ Examples:
|
|
|
139181
139843
|
|
|
139182
139844
|
// src/lib/api-client.ts
|
|
139183
139845
|
import fs23 from "node:fs";
|
|
139184
|
-
import
|
|
139846
|
+
import path52 from "node:path";
|
|
139185
139847
|
function getServerBaseUrl() {
|
|
139186
139848
|
const envPort = process.env.DORKOS_PORT;
|
|
139187
139849
|
if (envPort && /^\d+$/.test(envPort)) {
|
|
@@ -139193,7 +139855,7 @@ function getServerBaseUrl() {
|
|
|
139193
139855
|
function readConfigPort() {
|
|
139194
139856
|
const dorkHome = resolveDorkHome2();
|
|
139195
139857
|
try {
|
|
139196
|
-
const raw = fs23.readFileSync(
|
|
139858
|
+
const raw = fs23.readFileSync(path52.join(dorkHome, "config.json"), "utf-8");
|
|
139197
139859
|
const config3 = JSON.parse(raw);
|
|
139198
139860
|
const port2 = config3?.server?.port;
|
|
139199
139861
|
if (typeof port2 === "number" && port2 > 0) return port2;
|
|
@@ -139206,7 +139868,7 @@ function agentIdentityHeaders() {
|
|
|
139206
139868
|
return token ? { "X-DorkOS-Agent": token } : {};
|
|
139207
139869
|
}
|
|
139208
139870
|
function apiKeyFilePath() {
|
|
139209
|
-
return
|
|
139871
|
+
return path52.join(resolveDorkHome2(), API_KEY_FILE_NAME);
|
|
139210
139872
|
}
|
|
139211
139873
|
function resolveApiKey() {
|
|
139212
139874
|
const fromEnv = process.env[API_KEY_ENV_VAR]?.trim();
|
|
@@ -139918,7 +140580,7 @@ var init_scanner3 = __esm({
|
|
|
139918
140580
|
});
|
|
139919
140581
|
|
|
139920
140582
|
// ../browser/src/runtime/installation/contracts.ts
|
|
139921
|
-
import { createHash as
|
|
140583
|
+
import { createHash as createHash8 } from "node:crypto";
|
|
139922
140584
|
function failureCode(error63) {
|
|
139923
140585
|
return error63 instanceof InstallationFailure ? error63.code : "IO_FAILED";
|
|
139924
140586
|
}
|
|
@@ -139928,11 +140590,11 @@ function sameBinding(a2, b2) {
|
|
|
139928
140590
|
function sameFileIdentity(a2, b2) {
|
|
139929
140591
|
return a2.device === b2.device && a2.inode === b2.inode && a2.size === b2.size && a2.mtimeNs === b2.mtimeNs && a2.ctimeNs === b2.ctimeNs && a2.type === b2.type && a2.uid === b2.uid && a2.mode === b2.mode;
|
|
139930
140592
|
}
|
|
139931
|
-
function
|
|
139932
|
-
return
|
|
140593
|
+
function sha2564(bytes) {
|
|
140594
|
+
return createHash8("sha256").update(bytes).digest("hex");
|
|
139933
140595
|
}
|
|
139934
140596
|
function canonicalDigest(value) {
|
|
139935
|
-
const hash3 =
|
|
140597
|
+
const hash3 = createHash8("sha256");
|
|
139936
140598
|
const visit2 = (v2) => {
|
|
139937
140599
|
if (v2 === null) {
|
|
139938
140600
|
hash3.update("null;");
|
|
@@ -140198,10 +140860,10 @@ var init_contracts = __esm({
|
|
|
140198
140860
|
});
|
|
140199
140861
|
|
|
140200
140862
|
// ../browser/src/runtime/installation/filesystem.ts
|
|
140201
|
-
import { createHash as
|
|
140863
|
+
import { createHash as createHash9, randomUUID as randomUUID5 } from "node:crypto";
|
|
140202
140864
|
import { constants as constants5 } from "node:fs";
|
|
140203
140865
|
import * as fs24 from "node:fs/promises";
|
|
140204
|
-
import
|
|
140866
|
+
import path53 from "node:path";
|
|
140205
140867
|
function requireFact(value, code) {
|
|
140206
140868
|
if (!value) throw new InstallationFailure(code);
|
|
140207
140869
|
}
|
|
@@ -140322,14 +140984,14 @@ var init_filesystem = __esm({
|
|
|
140322
140984
|
}
|
|
140323
140985
|
async ancestors(name2, missing = false) {
|
|
140324
140986
|
requireFact(
|
|
140325
|
-
|
|
140987
|
+
path53.isAbsolute(name2) && path53.normalize(name2) === name2,
|
|
140326
140988
|
"INVALID_INSTALL_CONFIGURATION"
|
|
140327
140989
|
);
|
|
140328
140990
|
const result2 = [];
|
|
140329
|
-
let current3 =
|
|
140330
|
-
const parts =
|
|
140991
|
+
let current3 = path53.parse(name2).root;
|
|
140992
|
+
const parts = path53.relative(current3, name2).split(path53.sep).filter(Boolean);
|
|
140331
140993
|
for (const part of ["", ...parts]) {
|
|
140332
|
-
if (part) current3 =
|
|
140994
|
+
if (part) current3 = path53.join(current3, part);
|
|
140333
140995
|
try {
|
|
140334
140996
|
const stat5 = await fs24.lstat(current3, { bigint: true });
|
|
140335
140997
|
this.directorySecure(stat5);
|
|
@@ -140436,10 +141098,10 @@ var init_filesystem = __esm({
|
|
|
140436
141098
|
});
|
|
140437
141099
|
}
|
|
140438
141100
|
async ensureDirectories(name2) {
|
|
140439
|
-
let current3 =
|
|
140440
|
-
for (const part of
|
|
141101
|
+
let current3 = path53.parse(name2).root;
|
|
141102
|
+
for (const part of path53.relative(current3, name2).split(path53.sep).filter(Boolean)) {
|
|
140441
141103
|
const parent = current3;
|
|
140442
|
-
current3 =
|
|
141104
|
+
current3 = path53.join(current3, part);
|
|
140443
141105
|
try {
|
|
140444
141106
|
this.directorySecure(await fs24.lstat(current3, { bigint: true }));
|
|
140445
141107
|
} catch (error63) {
|
|
@@ -140457,7 +141119,7 @@ var init_filesystem = __esm({
|
|
|
140457
141119
|
}
|
|
140458
141120
|
}
|
|
140459
141121
|
async exclusiveDirectory(name2) {
|
|
140460
|
-
await this.ancestors(
|
|
141122
|
+
await this.ancestors(path53.dirname(name2));
|
|
140461
141123
|
await fs24.mkdir(name2, { mode: 448 });
|
|
140462
141124
|
const stat5 = await fs24.lstat(name2, { bigint: true });
|
|
140463
141125
|
this.directorySecure(stat5);
|
|
@@ -140466,10 +141128,10 @@ var init_filesystem = __esm({
|
|
|
140466
141128
|
"OWNERSHIP_UNCERTAIN"
|
|
140467
141129
|
);
|
|
140468
141130
|
await this.syncDirectory(name2);
|
|
140469
|
-
await this.syncDirectory(
|
|
141131
|
+
await this.syncDirectory(path53.dirname(name2));
|
|
140470
141132
|
}
|
|
140471
141133
|
async read(name2, cap, retain = 0) {
|
|
140472
|
-
const parents = await this.ancestors(
|
|
141134
|
+
const parents = await this.ancestors(path53.dirname(name2));
|
|
140473
141135
|
const named3 = identity(await fs24.lstat(name2, { bigint: true }));
|
|
140474
141136
|
requireFact(named3.type === "file" && BigInt(named3.size) <= BigInt(cap), "INSTALLATION_INVALID");
|
|
140475
141137
|
const duty = await this.acquire(
|
|
@@ -140480,7 +141142,7 @@ var init_filesystem = __esm({
|
|
|
140480
141142
|
return this.closeAfter([duty], async () => {
|
|
140481
141143
|
const acquired = identity(await handle.stat({ bigint: true }));
|
|
140482
141144
|
requireFact(sameFileIdentity(named3, acquired), "ROOT_CHANGED");
|
|
140483
|
-
const hash3 =
|
|
141145
|
+
const hash3 = createHash9("sha256"), chunks = [];
|
|
140484
141146
|
const buffer = Buffer.alloc(INSTALLATION_LIMITS.bufferBytes);
|
|
140485
141147
|
let bytes = 0, retained2 = 0;
|
|
140486
141148
|
let prefix = new Uint8Array();
|
|
@@ -140538,7 +141200,7 @@ var init_filesystem = __esm({
|
|
|
140538
141200
|
});
|
|
140539
141201
|
}
|
|
140540
141202
|
async libraryBinMetadata(root, directory) {
|
|
140541
|
-
const parents = await this.ancestors(directory), bins =
|
|
141203
|
+
const parents = await this.ancestors(directory), bins = path53.join(directory, ".bin");
|
|
140542
141204
|
const before = identity(await fs24.lstat(directory, { bigint: true }));
|
|
140543
141205
|
requireFact(
|
|
140544
141206
|
(await this.names(directory, INSTALLATION_LIMITS.libraryEntries)).join(",") === ".bin",
|
|
@@ -140549,11 +141211,11 @@ var init_filesystem = __esm({
|
|
|
140549
141211
|
(await this.names(bins, INSTALLATION_LIMITS.libraryEntries)).join(",") === "playwright-core",
|
|
140550
141212
|
"LIBRARY_MISMATCH"
|
|
140551
141213
|
);
|
|
140552
|
-
const shim =
|
|
141214
|
+
const shim = path53.join(bins, "playwright-core"), stat5 = await fs24.lstat(shim, { bigint: true });
|
|
140553
141215
|
if (stat5.isSymbolicLink()) {
|
|
140554
141216
|
const link3 = await fs24.readlink(shim);
|
|
140555
141217
|
requireFact(
|
|
140556
|
-
Buffer.byteLength(link3) <= INSTALLATION_LIMITS.bufferBytes && await fs24.realpath(shim) ===
|
|
141218
|
+
Buffer.byteLength(link3) <= INSTALLATION_LIMITS.bufferBytes && await fs24.realpath(shim) === path53.join(root, "cli.js"),
|
|
140557
141219
|
"LIBRARY_MISMATCH"
|
|
140558
141220
|
);
|
|
140559
141221
|
const after = await fs24.lstat(shim, { bigint: true });
|
|
@@ -140584,13 +141246,13 @@ var init_filesystem = __esm({
|
|
|
140584
141246
|
requireFact(dirIdentity.type === "directory", "ROOT_CHANGED");
|
|
140585
141247
|
result2.directories.push({ path: directory, identity: dirIdentity });
|
|
140586
141248
|
result2.rows.push({
|
|
140587
|
-
path:
|
|
141249
|
+
path: path53.relative(root, directory).split(path53.sep).join("/"),
|
|
140588
141250
|
type: "directory",
|
|
140589
141251
|
identity: dirIdentity
|
|
140590
141252
|
});
|
|
140591
141253
|
for (const name2 of await this.names(directory, entryLimit)) {
|
|
140592
141254
|
requireFact(++result2.entries <= entryLimit, "RETENTION_EXCEEDED");
|
|
140593
|
-
const absolute =
|
|
141255
|
+
const absolute = path53.join(directory, name2), relative12 = path53.relative(root, absolute).split(path53.sep).join("/");
|
|
140594
141256
|
requireFact(relativePath.safeParse(relative12).success, "INSTALLATION_INVALID");
|
|
140595
141257
|
const stat5 = await fs24.lstat(absolute, { bigint: true });
|
|
140596
141258
|
if (library && relative12 === "node_modules") {
|
|
@@ -140601,7 +141263,7 @@ var init_filesystem = __esm({
|
|
|
140601
141263
|
if (stat5.isSymbolicLink()) {
|
|
140602
141264
|
requireFact(!library, "LIBRARY_MISMATCH");
|
|
140603
141265
|
const link3 = await fs24.readlink(absolute), resolved = await fs24.realpath(absolute);
|
|
140604
|
-
requireFact(resolved.startsWith(root +
|
|
141266
|
+
requireFact(resolved.startsWith(root + path53.sep), "ROOT_CHANGED");
|
|
140605
141267
|
const target = await fs24.stat(resolved, { bigint: true });
|
|
140606
141268
|
requireFact(target.isFile() || target.isDirectory(), "ROOT_CHANGED");
|
|
140607
141269
|
const after = await fs24.lstat(absolute, { bigint: true });
|
|
@@ -140671,18 +141333,18 @@ var init_filesystem = __esm({
|
|
|
140671
141333
|
this.supported();
|
|
140672
141334
|
const tree = await this.tree(this.configuration.libraryRoot, true);
|
|
140673
141335
|
requireFact(tree.files.length === 114, "LIBRARY_MISMATCH");
|
|
140674
|
-
const distribution =
|
|
141336
|
+
const distribution = createHash9("sha256");
|
|
140675
141337
|
for (const file2 of [...tree.files].sort(
|
|
140676
141338
|
(a2, b2) => a2.path < b2.path ? -1 : a2.path > b2.path ? 1 : 0
|
|
140677
141339
|
))
|
|
140678
141340
|
distribution.update(
|
|
140679
|
-
|
|
141341
|
+
path53.relative(this.configuration.libraryRoot, file2.path).split(path53.sep).join("/") + "\0" + file2.sha256 + "\n"
|
|
140680
141342
|
);
|
|
140681
141343
|
const distributionSHA256 = distribution.digest("hex");
|
|
140682
141344
|
requireFact(distributionSHA256 === INSTALLATION_TARGET.libraryDistributionSHA256, "LIBRARY_MISMATCH");
|
|
140683
141345
|
const find = (name2) => {
|
|
140684
141346
|
const file2 = tree.files.find(
|
|
140685
|
-
(f3) => f3.path ===
|
|
141347
|
+
(f3) => f3.path === path53.join(this.configuration.libraryRoot, name2)
|
|
140686
141348
|
);
|
|
140687
141349
|
requireFact(file2, "LIBRARY_MISMATCH");
|
|
140688
141350
|
return file2;
|
|
@@ -140763,7 +141425,7 @@ var init_filesystem = __esm({
|
|
|
140763
141425
|
requireFact(!this.active || this.active.state === "released", "PUBLICATION_BUSY");
|
|
140764
141426
|
await this.ensureDirectories(this.configuration.cacheRoot);
|
|
140765
141427
|
const root = await this.directory(this.configuration.cacheRoot);
|
|
140766
|
-
const name2 =
|
|
141428
|
+
const name2 = path53.join(root.path, "reservation");
|
|
140767
141429
|
try {
|
|
140768
141430
|
await this.exclusiveDirectory(name2);
|
|
140769
141431
|
} catch (error63) {
|
|
@@ -140815,7 +141477,7 @@ var init_filesystem = __esm({
|
|
|
140815
141477
|
directory.duty.lease = true;
|
|
140816
141478
|
try {
|
|
140817
141479
|
reservation.ownerFile = await this.atomicRecord(
|
|
140818
|
-
|
|
141480
|
+
path53.join(name2, "owner.json"),
|
|
140819
141481
|
owner,
|
|
140820
141482
|
INSTALLATION_LIMITS.journalBytes,
|
|
140821
141483
|
false
|
|
@@ -140835,12 +141497,12 @@ var init_filesystem = __esm({
|
|
|
140835
141497
|
await this.checkReservation(reservation);
|
|
140836
141498
|
this.checkEnd(reservation);
|
|
140837
141499
|
requireFact(reservation.attempt === null, "BINDING_MISMATCH");
|
|
140838
|
-
const parent =
|
|
141500
|
+
const parent = path53.join(this.configuration.cacheRoot, "attempts");
|
|
140839
141501
|
await this.ensureDirectories(parent);
|
|
140840
|
-
const root =
|
|
141502
|
+
const root = path53.join(parent, handle.binding.attemptId);
|
|
140841
141503
|
await this.exclusiveDirectory(root);
|
|
140842
141504
|
for (const child of ["home", "tmp", "diagnostics"])
|
|
140843
|
-
await this.exclusiveDirectory(
|
|
141505
|
+
await this.exclusiveDirectory(path53.join(root, child));
|
|
140844
141506
|
await this.syncDirectory(root);
|
|
140845
141507
|
await this.syncDirectory(parent);
|
|
140846
141508
|
const stat5 = identity(await fs24.lstat(root, { bigint: true }));
|
|
@@ -140848,21 +141510,21 @@ var init_filesystem = __esm({
|
|
|
140848
141510
|
kind: "installation-attempt",
|
|
140849
141511
|
binding: handle.binding,
|
|
140850
141512
|
attemptRoot: root,
|
|
140851
|
-
homeRoot:
|
|
140852
|
-
temporaryRoot:
|
|
141513
|
+
homeRoot: path53.join(root, "home"),
|
|
141514
|
+
temporaryRoot: path53.join(root, "tmp"),
|
|
140853
141515
|
identity: stat5
|
|
140854
141516
|
});
|
|
140855
141517
|
this.attempts.set(attempt, {
|
|
140856
141518
|
reservation,
|
|
140857
141519
|
handle: attempt,
|
|
140858
|
-
diagnostics:
|
|
141520
|
+
diagnostics: path53.join(root, "diagnostics")
|
|
140859
141521
|
});
|
|
140860
141522
|
reservation.attempt = attempt;
|
|
140861
141523
|
return attempt;
|
|
140862
141524
|
});
|
|
140863
141525
|
}
|
|
140864
141526
|
async atomicRecord(name2, record2, cap, replace) {
|
|
140865
|
-
const bytes = recordBytes(record2, cap), parent =
|
|
141527
|
+
const bytes = recordBytes(record2, cap), parent = path53.dirname(name2), parents = await this.ancestors(parent);
|
|
140866
141528
|
if (!replace) {
|
|
140867
141529
|
try {
|
|
140868
141530
|
await fs24.lstat(name2);
|
|
@@ -140871,7 +141533,7 @@ var init_filesystem = __esm({
|
|
|
140871
141533
|
if (!isMissing(error63)) throw error63;
|
|
140872
141534
|
}
|
|
140873
141535
|
}
|
|
140874
|
-
const temporary =
|
|
141536
|
+
const temporary = path53.join(parent, ".installation-" + randomUUID5() + ".tmp");
|
|
140875
141537
|
const duty = await this.acquire(
|
|
140876
141538
|
temporary,
|
|
140877
141539
|
constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | constants5.O_NOFOLLOW
|
|
@@ -140908,7 +141570,7 @@ var init_filesystem = __esm({
|
|
|
140908
141570
|
await fs24.rename(temporary, name2);
|
|
140909
141571
|
await this.syncDirectory(parent);
|
|
140910
141572
|
const result2 = await this.read(name2, cap, cap);
|
|
140911
|
-
requireFact(result2.file.sha256 ===
|
|
141573
|
+
requireFact(result2.file.sha256 === sha2564(bytes), "RECORD_FAILED");
|
|
140912
141574
|
return result2.file;
|
|
140913
141575
|
}
|
|
140914
141576
|
async writeOwner(reservationHandle, attemptHandle, record2) {
|
|
@@ -140931,7 +141593,7 @@ var init_filesystem = __esm({
|
|
|
140931
141593
|
await this.checkReservation(reservation);
|
|
140932
141594
|
this.checkEnd(reservation);
|
|
140933
141595
|
const old = await this.read(
|
|
140934
|
-
|
|
141596
|
+
path53.join(reservation.directory.path, "owner.json"),
|
|
140935
141597
|
INSTALLATION_LIMITS.journalBytes,
|
|
140936
141598
|
INSTALLATION_LIMITS.journalBytes
|
|
140937
141599
|
);
|
|
@@ -140954,11 +141616,11 @@ var init_filesystem = __esm({
|
|
|
140954
141616
|
requireFact(reservation.candidate === null, "BINDING_MISMATCH");
|
|
140955
141617
|
await this.checkReservation(reservation);
|
|
140956
141618
|
this.checkEnd(reservation);
|
|
140957
|
-
const parent =
|
|
141619
|
+
const parent = path53.join(this.configuration.cacheRoot, "candidates");
|
|
140958
141620
|
await this.ensureDirectories(parent);
|
|
140959
|
-
const candidateRoot =
|
|
141621
|
+
const candidateRoot = path53.join(parent, handle.binding.installationId);
|
|
140960
141622
|
await this.exclusiveDirectory(candidateRoot);
|
|
140961
|
-
const payloadRoot =
|
|
141623
|
+
const payloadRoot = path53.join(candidateRoot, "payload");
|
|
140962
141624
|
await this.exclusiveDirectory(payloadRoot);
|
|
140963
141625
|
const candidate = Object.freeze({
|
|
140964
141626
|
kind: "installation-candidate",
|
|
@@ -140996,8 +141658,8 @@ var init_filesystem = __esm({
|
|
|
140996
141658
|
});
|
|
140997
141659
|
}
|
|
140998
141660
|
async snapshot(installationId, candidateRoot) {
|
|
140999
|
-
const payloadRoot =
|
|
141000
|
-
const executablePath =
|
|
141661
|
+
const payloadRoot = path53.join(candidateRoot, "payload"), tree = await this.tree(payloadRoot);
|
|
141662
|
+
const executablePath = path53.join(candidateRoot, INSTALLATION_TARGET.executablePath);
|
|
141001
141663
|
const executable = await this.read(executablePath, INSTALLATION_LIMITS.executableBytes);
|
|
141002
141664
|
const observed = tree.files.find((file2) => file2.path === executablePath);
|
|
141003
141665
|
requireFact(
|
|
@@ -141034,7 +141696,7 @@ var init_filesystem = __esm({
|
|
|
141034
141696
|
async current() {
|
|
141035
141697
|
try {
|
|
141036
141698
|
const value = await this.read(
|
|
141037
|
-
|
|
141699
|
+
path53.join(this.configuration.cacheRoot, "current.json"),
|
|
141038
141700
|
INSTALLATION_LIMITS.pointerBytes,
|
|
141039
141701
|
INSTALLATION_LIMITS.pointerBytes
|
|
141040
141702
|
);
|
|
@@ -141080,13 +141742,13 @@ var init_filesystem = __esm({
|
|
|
141080
141742
|
installation: null
|
|
141081
141743
|
};
|
|
141082
141744
|
requireFact(current3.state === "present", "INSTALLATION_INVALID");
|
|
141083
|
-
const root =
|
|
141745
|
+
const root = path53.join(
|
|
141084
141746
|
this.configuration.cacheRoot,
|
|
141085
141747
|
"candidates",
|
|
141086
141748
|
current3.pointer.installationId
|
|
141087
141749
|
);
|
|
141088
141750
|
const manifestRead = await this.read(
|
|
141089
|
-
|
|
141751
|
+
path53.join(root, "manifest.json"),
|
|
141090
141752
|
INSTALLATION_LIMITS.manifestBytes,
|
|
141091
141753
|
INSTALLATION_LIMITS.manifestBytes
|
|
141092
141754
|
);
|
|
@@ -141096,7 +141758,7 @@ var init_filesystem = __esm({
|
|
|
141096
141758
|
);
|
|
141097
141759
|
const manifest = parseRecord(manifestRead.bytes, ManifestSchema, INSTALLATION_LIMITS.manifestBytes);
|
|
141098
141760
|
const verificationRead = await this.read(
|
|
141099
|
-
|
|
141761
|
+
path53.join(root, "verification.json"),
|
|
141100
141762
|
INSTALLATION_LIMITS.journalBytes,
|
|
141101
141763
|
INSTALLATION_LIMITS.journalBytes
|
|
141102
141764
|
);
|
|
@@ -141184,7 +141846,7 @@ var init_filesystem = __esm({
|
|
|
141184
141846
|
for (const directory of [...tree.directories].reverse())
|
|
141185
141847
|
await this.syncDirectory(directory.path);
|
|
141186
141848
|
await this.syncDirectory(handle.candidateRoot);
|
|
141187
|
-
await this.syncDirectory(
|
|
141849
|
+
await this.syncDirectory(path53.dirname(handle.candidateRoot));
|
|
141188
141850
|
await this.syncDirectory(this.configuration.cacheRoot);
|
|
141189
141851
|
await this.revalidateCandidate(handle, expected);
|
|
141190
141852
|
candidate.durable = await this.observeCandidate(handle);
|
|
@@ -141246,7 +141908,7 @@ var init_filesystem = __esm({
|
|
|
141246
141908
|
throw error63;
|
|
141247
141909
|
}
|
|
141248
141910
|
const manifestBytes = recordBytes(parsedManifest, INSTALLATION_LIMITS.manifestBytes), verificationBytes = recordBytes(parsedVerification, INSTALLATION_LIMITS.journalBytes);
|
|
141249
|
-
const manifestDigest =
|
|
141911
|
+
const manifestDigest = sha2564(manifestBytes), verificationDigest = sha2564(verificationBytes);
|
|
141250
141912
|
let pointerReplaced = false, replacementAttempted = false, after = { state: "unknown" };
|
|
141251
141913
|
try {
|
|
141252
141914
|
await this.checkReservation(reservation);
|
|
@@ -141254,18 +141916,18 @@ var init_filesystem = __esm({
|
|
|
141254
141916
|
await this.revalidateCandidate(candidateHandle, candidate.durable);
|
|
141255
141917
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
141256
141918
|
await this.atomicRecord(
|
|
141257
|
-
|
|
141919
|
+
path53.join(candidateHandle.candidateRoot, "verification.json"),
|
|
141258
141920
|
parsedVerification,
|
|
141259
141921
|
INSTALLATION_LIMITS.journalBytes,
|
|
141260
141922
|
false
|
|
141261
141923
|
);
|
|
141262
141924
|
await this.atomicRecord(
|
|
141263
|
-
|
|
141925
|
+
path53.join(candidateHandle.candidateRoot, "manifest.json"),
|
|
141264
141926
|
parsedManifest,
|
|
141265
141927
|
INSTALLATION_LIMITS.manifestBytes,
|
|
141266
141928
|
false
|
|
141267
141929
|
);
|
|
141268
|
-
await this.syncDirectory(
|
|
141930
|
+
await this.syncDirectory(path53.dirname(candidateHandle.candidateRoot));
|
|
141269
141931
|
await this.revalidateCandidate(candidateHandle, candidate.durable);
|
|
141270
141932
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
141271
141933
|
this.checkEnd(reservation);
|
|
@@ -141273,7 +141935,7 @@ var init_filesystem = __esm({
|
|
|
141273
141935
|
{ schemaVersion: 1, installationId: parsedManifest.installationId, manifestDigest },
|
|
141274
141936
|
INSTALLATION_LIMITS.pointerBytes
|
|
141275
141937
|
);
|
|
141276
|
-
const temporary =
|
|
141938
|
+
const temporary = path53.join(
|
|
141277
141939
|
this.configuration.cacheRoot,
|
|
141278
141940
|
".current-" + randomUUID5() + ".json"
|
|
141279
141941
|
);
|
|
@@ -141283,12 +141945,12 @@ var init_filesystem = __esm({
|
|
|
141283
141945
|
INSTALLATION_LIMITS.pointerBytes,
|
|
141284
141946
|
false
|
|
141285
141947
|
);
|
|
141286
|
-
requireFact(file2.sha256 ===
|
|
141948
|
+
requireFact(file2.sha256 === sha2564(pointer), "RECORD_FAILED");
|
|
141287
141949
|
await this.checkReservation(reservation);
|
|
141288
141950
|
requireFact(compareCurrent(before, await this.current()), "ROOT_CHANGED");
|
|
141289
141951
|
this.checkEnd(reservation);
|
|
141290
141952
|
replacementAttempted = true;
|
|
141291
|
-
await fs24.rename(temporary,
|
|
141953
|
+
await fs24.rename(temporary, path53.join(this.configuration.cacheRoot, "current.json"));
|
|
141292
141954
|
pointerReplaced = true;
|
|
141293
141955
|
await this.syncDirectory(this.configuration.cacheRoot);
|
|
141294
141956
|
after = await this.current();
|
|
@@ -141355,7 +142017,7 @@ var init_filesystem = __esm({
|
|
|
141355
142017
|
throw error63;
|
|
141356
142018
|
}
|
|
141357
142019
|
const oldVerification = await this.read(
|
|
141358
|
-
|
|
142020
|
+
path53.join(
|
|
141359
142021
|
this.configuration.cacheRoot,
|
|
141360
142022
|
"candidates",
|
|
141361
142023
|
handle.binding.installationId,
|
|
@@ -141368,18 +142030,18 @@ var init_filesystem = __esm({
|
|
|
141368
142030
|
"BINDING_MISMATCH"
|
|
141369
142031
|
);
|
|
141370
142032
|
const file2 = await this.atomicRecord(
|
|
141371
|
-
|
|
142033
|
+
path53.join(attempt.handle.attemptRoot, "reuse.json"),
|
|
141372
142034
|
parsed,
|
|
141373
142035
|
INSTALLATION_LIMITS.journalBytes,
|
|
141374
142036
|
false
|
|
141375
142037
|
);
|
|
141376
|
-
await this.syncDirectory(
|
|
142038
|
+
await this.syncDirectory(path53.dirname(attempt.handle.attemptRoot));
|
|
141377
142039
|
requireFact(compareCurrent(current3, await this.current()), "ROOT_CHANGED");
|
|
141378
142040
|
return file2;
|
|
141379
142041
|
});
|
|
141380
142042
|
}
|
|
141381
142043
|
async writer(name2, reservation, diagnosticBudget) {
|
|
141382
|
-
const parents = await this.ancestors(
|
|
142044
|
+
const parents = await this.ancestors(path53.dirname(name2));
|
|
141383
142045
|
const duty = await this.acquire(
|
|
141384
142046
|
name2,
|
|
141385
142047
|
constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | constants5.O_NOFOLLOW
|
|
@@ -141409,7 +142071,7 @@ var init_filesystem = __esm({
|
|
|
141409
142071
|
"OWNERSHIP_UNCERTAIN"
|
|
141410
142072
|
);
|
|
141411
142073
|
expected = identity(stat5);
|
|
141412
|
-
hash3 =
|
|
142074
|
+
hash3 = createHash9("sha256");
|
|
141413
142075
|
await observe(0);
|
|
141414
142076
|
await original.sync();
|
|
141415
142077
|
await observe(0);
|
|
@@ -141499,7 +142161,7 @@ var init_filesystem = __esm({
|
|
|
141499
142161
|
first ??= error63;
|
|
141500
142162
|
}
|
|
141501
142163
|
try {
|
|
141502
|
-
await this.syncDirectory(
|
|
142164
|
+
await this.syncDirectory(path53.dirname(name2));
|
|
141503
142165
|
} catch (error63) {
|
|
141504
142166
|
first ??= error63;
|
|
141505
142167
|
this.fault(error63);
|
|
@@ -141547,7 +142209,7 @@ var init_filesystem = __esm({
|
|
|
141547
142209
|
}
|
|
141548
142210
|
sink(attempt, reservation, probe2) {
|
|
141549
142211
|
const jobs = reservation?.jobs ?? /* @__PURE__ */ new Map(), budget = reservation?.diagnosticBudget ?? { bytes: 0, reserved: 0 };
|
|
141550
|
-
const diagnostics =
|
|
142212
|
+
const diagnostics = path53.join(attempt.attemptRoot, "diagnostics");
|
|
141551
142213
|
const reobserve = async () => {
|
|
141552
142214
|
if (reservation) await this.checkReservation(reservation);
|
|
141553
142215
|
requireFact(
|
|
@@ -141573,7 +142235,7 @@ var init_filesystem = __esm({
|
|
|
141573
142235
|
);
|
|
141574
142236
|
requireFact(!jobs.has(parsed.jobId), "BINDING_MISMATCH");
|
|
141575
142237
|
await reobserve();
|
|
141576
|
-
const prefix =
|
|
142238
|
+
const prefix = path53.join(diagnostics, (probe2 ? "probe_" : "") + parsed.jobId);
|
|
141577
142239
|
const job = {
|
|
141578
142240
|
intent: parsed,
|
|
141579
142241
|
prefix,
|
|
@@ -141659,18 +142321,18 @@ var init_filesystem = __esm({
|
|
|
141659
142321
|
requireFact(!this.freshAdmissionStarted, "BINDING_MISMATCH");
|
|
141660
142322
|
this.freshAdmissionStarted = true;
|
|
141661
142323
|
requireFact(
|
|
141662
|
-
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) &&
|
|
142324
|
+
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) && path53.resolve(process.execPath) === c3.nodeExecutable && process.argv[1] && path53.resolve(process.argv[1]) === c3.verifierEntry,
|
|
141663
142325
|
"SOURCE_MISMATCH"
|
|
141664
142326
|
);
|
|
141665
142327
|
requireFact(
|
|
141666
|
-
parsed.attemptRoot ===
|
|
142328
|
+
parsed.attemptRoot === path53.join(c3.cacheRoot, "attempts", parsed.binding.attemptId) && parsed.candidateRoot === path53.join(c3.cacheRoot, "candidates", parsed.binding.installationId) && parsed.executablePath === INSTALLATION_TARGET.executablePath,
|
|
141667
142329
|
"BINDING_MISMATCH"
|
|
141668
142330
|
);
|
|
141669
142331
|
const attempt = identity(await fs24.lstat(parsed.attemptRoot, { bigint: true }));
|
|
141670
142332
|
requireFact(sameFileIdentity(attempt, parsed.attemptIdentity), "ROOT_CHANGED");
|
|
141671
142333
|
await this.ancestors(parsed.attemptRoot);
|
|
141672
142334
|
const ownerRead = await this.read(
|
|
141673
|
-
|
|
142335
|
+
path53.join(c3.cacheRoot, "reservation", "owner.json"),
|
|
141674
142336
|
INSTALLATION_LIMITS.journalBytes,
|
|
141675
142337
|
INSTALLATION_LIMITS.journalBytes
|
|
141676
142338
|
);
|
|
@@ -141686,7 +142348,7 @@ var init_filesystem = __esm({
|
|
|
141686
142348
|
birth && birth.executable === c3.nodeExecutable && birth.argv.includes(c3.verifierEntry),
|
|
141687
142349
|
"BINDING_MISMATCH"
|
|
141688
142350
|
);
|
|
141689
|
-
const prefix =
|
|
142351
|
+
const prefix = path53.join(parsed.attemptRoot, "diagnostics", birth.jobId);
|
|
141690
142352
|
const intentRead = await this.read(
|
|
141691
142353
|
prefix + ".intent.json",
|
|
141692
142354
|
INSTALLATION_LIMITS.journalBytes,
|
|
@@ -141731,8 +142393,8 @@ var init_filesystem = __esm({
|
|
|
141731
142393
|
kind: "installation-attempt",
|
|
141732
142394
|
binding: admitted.request.binding,
|
|
141733
142395
|
attemptRoot: admitted.request.attemptRoot,
|
|
141734
|
-
homeRoot:
|
|
141735
|
-
temporaryRoot:
|
|
142396
|
+
homeRoot: path53.join(admitted.request.attemptRoot, "home"),
|
|
142397
|
+
temporaryRoot: path53.join(admitted.request.attemptRoot, "tmp"),
|
|
141736
142398
|
identity: admitted.attempt
|
|
141737
142399
|
});
|
|
141738
142400
|
admitted.sink ??= this.sink(attempt, null, admitted);
|
|
@@ -141749,7 +142411,7 @@ var init_filesystem = __esm({
|
|
|
141749
142411
|
"CUSTODY_UNCERTAIN"
|
|
141750
142412
|
);
|
|
141751
142413
|
const owner = await this.read(
|
|
141752
|
-
|
|
142414
|
+
path53.join(reservation.directory.path, "owner.json"),
|
|
141753
142415
|
INSTALLATION_LIMITS.journalBytes
|
|
141754
142416
|
);
|
|
141755
142417
|
requireFact(
|
|
@@ -141794,7 +142456,7 @@ var init_filesystem = __esm({
|
|
|
141794
142456
|
|
|
141795
142457
|
// ../browser/src/runtime/installation/jobs.ts
|
|
141796
142458
|
import { spawn } from "node:child_process";
|
|
141797
|
-
import { randomBytes as randomBytes5, createHash as
|
|
142459
|
+
import { randomBytes as randomBytes5, createHash as createHash10 } from "node:crypto";
|
|
141798
142460
|
import { constants as constants6 } from "node:fs";
|
|
141799
142461
|
import { lstat as lstat5, open as open4, realpath as realpath4 } from "node:fs/promises";
|
|
141800
142462
|
import { join as join55, resolve as resolve12, relative as relative11, isAbsolute as isAbsolute10, dirname as dirname14 } from "node:path";
|
|
@@ -141813,8 +142475,8 @@ function identity2(s2) {
|
|
|
141813
142475
|
type: s2.isFile() ? "file" : "directory"
|
|
141814
142476
|
});
|
|
141815
142477
|
}
|
|
141816
|
-
function within(root,
|
|
141817
|
-
const name2 = relative11(root,
|
|
142478
|
+
function within(root, path71) {
|
|
142479
|
+
const name2 = relative11(root, path71);
|
|
141818
142480
|
return name2 !== "" && !name2.startsWith("../") && name2 !== ".." && !isAbsolute10(name2);
|
|
141819
142481
|
}
|
|
141820
142482
|
function streamFacts(s2) {
|
|
@@ -141960,30 +142622,30 @@ function createInstallationJobs(configuration, options = { ownerKind: "controlle
|
|
|
141960
142622
|
originals.push(slot);
|
|
141961
142623
|
return slot;
|
|
141962
142624
|
}
|
|
141963
|
-
async function assertDirectory(
|
|
141964
|
-
requireFact2(isAbsolute10(
|
|
141965
|
-
const s2 = await lstat5(
|
|
142625
|
+
async function assertDirectory(path71, expected) {
|
|
142626
|
+
requireFact2(isAbsolute10(path71) && resolve12(path71) === path71, "ROOT_CHANGED");
|
|
142627
|
+
const s2 = await lstat5(path71, { bigint: true });
|
|
141966
142628
|
requireFact2(
|
|
141967
|
-
s2.isDirectory() && !s2.isSymbolicLink() && await realpath4(
|
|
142629
|
+
s2.isDirectory() && !s2.isSymbolicLink() && await realpath4(path71) === path71,
|
|
141968
142630
|
"ROOT_CHANGED"
|
|
141969
142631
|
);
|
|
141970
142632
|
requireFact2(!expected || sameFileIdentity(identity2(s2), expected), "ROOT_CHANGED");
|
|
141971
142633
|
}
|
|
141972
|
-
async function readPinned(slot,
|
|
141973
|
-
const before = await lstat5(
|
|
142634
|
+
async function readPinned(slot, path71, digest2, cap, expected, keep = false) {
|
|
142635
|
+
const before = await lstat5(path71, { bigint: true });
|
|
141974
142636
|
requireFact2(
|
|
141975
142637
|
before.isFile() && !before.isSymbolicLink() && before.size <= BigInt(cap),
|
|
141976
142638
|
"SOURCE_MISMATCH"
|
|
141977
142639
|
);
|
|
141978
|
-
requireFact2(await realpath4(
|
|
142640
|
+
requireFact2(await realpath4(path71) === path71, "ROOT_CHANGED");
|
|
141979
142641
|
const beforeIdentity = identity2(before);
|
|
141980
142642
|
requireFact2(!expected || sameFileIdentity(beforeIdentity, expected), "HASH_MISMATCH");
|
|
141981
142643
|
const original = await open4(
|
|
141982
|
-
|
|
142644
|
+
path71,
|
|
141983
142645
|
constants6.O_RDONLY | constants6.O_NOFOLLOW | constants6.O_NONBLOCK
|
|
141984
142646
|
);
|
|
141985
142647
|
heldReads.add(original);
|
|
141986
|
-
const hash3 =
|
|
142648
|
+
const hash3 = createHash10("sha256");
|
|
141987
142649
|
const chunks = [];
|
|
141988
142650
|
let bytes = 0;
|
|
141989
142651
|
let failed = false;
|
|
@@ -142008,7 +142670,7 @@ function createInstallationJobs(configuration, options = { ownerKind: "controlle
|
|
|
142008
142670
|
if (keep) chunks.push(buffer.slice(0, result3.bytesRead));
|
|
142009
142671
|
}
|
|
142010
142672
|
requireFact2(
|
|
142011
|
-
sameFileIdentity(beforeIdentity, identity2(await original.stat({ bigint: true }))) && sameFileIdentity(beforeIdentity, identity2(await lstat5(
|
|
142673
|
+
sameFileIdentity(beforeIdentity, identity2(await original.stat({ bigint: true }))) && sameFileIdentity(beforeIdentity, identity2(await lstat5(path71, { bigint: true }))),
|
|
142012
142674
|
"ROOT_CHANGED"
|
|
142013
142675
|
);
|
|
142014
142676
|
requireFact2(hash3.digest("hex") === digest2 && bytes === Number(before.size), "HASH_MISMATCH");
|
|
@@ -142788,7 +143450,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
142788
143450
|
verifier: {
|
|
142789
143451
|
jobId: verifierFacts.jobId,
|
|
142790
143452
|
receiptDigest: canonicalDigest(verifierFacts),
|
|
142791
|
-
replyDigest:
|
|
143453
|
+
replyDigest: sha2564(verifier.stdout)
|
|
142792
143454
|
},
|
|
142793
143455
|
reply,
|
|
142794
143456
|
candidateInventoryDigest: snapshot.inventoryDigest,
|
|
@@ -142811,7 +143473,7 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
142811
143473
|
recordBytes(journal, INSTALLATION_LIMITS.journalBytes);
|
|
142812
143474
|
check4(bounds, options.signal);
|
|
142813
143475
|
const written2 = await fs41.writeReuseJournal(reservation, attempt, journal);
|
|
142814
|
-
require2(written2.path === join56(attempt.attemptRoot, "reuse.json") && written2.sha256 ===
|
|
143476
|
+
require2(written2.path === join56(attempt.attemptRoot, "reuse.json") && written2.sha256 === sha2564(recordBytes(journal, INSTALLATION_LIMITS.journalBytes)), "OWNERSHIP_UNCERTAIN");
|
|
142815
143477
|
const unchanged = await fs41.inspectExisting({ signal: options.signal });
|
|
142816
143478
|
require2(canonicalDigest(unchanged.current) === canonicalDigest(reserved.current) && canonicalDigest(unchanged.installation) === canonicalDigest(reserved.installation), "ROOT_CHANGED");
|
|
142817
143479
|
journalDigest = written2.sha256;
|
|
@@ -142853,8 +143515,8 @@ function createInstallationTransaction(configuration, dependencies, generation3)
|
|
|
142853
143515
|
publicationMayHaveChanged ||= published.pointerReplaced;
|
|
142854
143516
|
require2(published.state === "durable" && published.pointerReplaced && published.firstCause === null, published.firstCause ?? "PUBLICATION_UNCERTAIN");
|
|
142855
143517
|
require2(published.currentAfter.state === "present" && published.currentAfter.pointer.installationId === binding.installationId && published.currentAfter.pointer.manifestDigest === published.manifestDigest, "PUBLICATION_UNCERTAIN");
|
|
142856
|
-
require2(published.manifestDigest ===
|
|
142857
|
-
require2(published.verificationDigest ===
|
|
143518
|
+
require2(published.manifestDigest === sha2564(recordBytes(manifest, INSTALLATION_LIMITS.manifestBytes)) && canonicalDigest(published.currentBefore) === canonicalDigest(reserved.current), "PUBLICATION_UNCERTAIN");
|
|
143519
|
+
require2(published.verificationDigest === sha2564(
|
|
142858
143520
|
recordBytes(verification2, INSTALLATION_LIMITS.journalBytes)
|
|
142859
143521
|
), "PUBLICATION_UNCERTAIN");
|
|
142860
143522
|
currentManifestDigest = published.manifestDigest;
|
|
@@ -142915,7 +143577,7 @@ var init_transaction2 = __esm({
|
|
|
142915
143577
|
});
|
|
142916
143578
|
|
|
142917
143579
|
// ../browser/src/runtime/installation/packaged.ts
|
|
142918
|
-
import { createHash as
|
|
143580
|
+
import { createHash as createHash11 } from "node:crypto";
|
|
142919
143581
|
import { constants as constants7 } from "node:fs";
|
|
142920
143582
|
import { lstat as lstat6, open as open5, realpath as realpath5 } from "node:fs/promises";
|
|
142921
143583
|
import { createRequire as createRequire3 } from "node:module";
|
|
@@ -142939,7 +143601,7 @@ async function inspectFile(filename, cap, retainBytes = false) {
|
|
|
142939
143601
|
try {
|
|
142940
143602
|
if (!sameFile(before, await original.stat({ bigint: true })))
|
|
142941
143603
|
throw new Error("Browser package file changed.");
|
|
142942
|
-
const hash3 =
|
|
143604
|
+
const hash3 = createHash11("sha256"), chunks = [], buffer = Buffer.alloc(65536);
|
|
142943
143605
|
let total = 0;
|
|
142944
143606
|
while (true) {
|
|
142945
143607
|
const { bytesRead } = await original.read(
|
|
@@ -143566,7 +144228,7 @@ var init_operator_output = __esm({
|
|
|
143566
144228
|
});
|
|
143567
144229
|
|
|
143568
144230
|
// src/lib/agent-browser/chrome-locator.ts
|
|
143569
|
-
import
|
|
144231
|
+
import path54 from "node:path";
|
|
143570
144232
|
function chromeCandidates(env6) {
|
|
143571
144233
|
if (env6.platform === "darwin") {
|
|
143572
144234
|
const apps = [
|
|
@@ -143574,8 +144236,8 @@ function chromeCandidates(env6) {
|
|
|
143574
144236
|
["Chromium.app", "Chromium"]
|
|
143575
144237
|
];
|
|
143576
144238
|
return apps.flatMap(([app, binary3]) => [
|
|
143577
|
-
|
|
143578
|
-
|
|
144239
|
+
path54.posix.join("/Applications", app, "Contents", "MacOS", binary3),
|
|
144240
|
+
path54.posix.join(env6.homeDir, "Applications", app, "Contents", "MacOS", binary3)
|
|
143579
144241
|
]);
|
|
143580
144242
|
}
|
|
143581
144243
|
if (env6.platform === "win32") {
|
|
@@ -143584,15 +144246,15 @@ function chromeCandidates(env6) {
|
|
|
143584
144246
|
);
|
|
143585
144247
|
return [
|
|
143586
144248
|
...roots.map(
|
|
143587
|
-
(root) =>
|
|
144249
|
+
(root) => path54.win32.join(root, "Google", "Chrome", "Application", "chrome.exe")
|
|
143588
144250
|
),
|
|
143589
|
-
...roots.map((root) =>
|
|
144251
|
+
...roots.map((root) => path54.win32.join(root, "Chromium", "Application", "chrome.exe"))
|
|
143590
144252
|
];
|
|
143591
144253
|
}
|
|
143592
144254
|
const names = ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"];
|
|
143593
|
-
const dirs = (env6.pathVar ?? "").split(
|
|
144255
|
+
const dirs = (env6.pathVar ?? "").split(path54.posix.delimiter).filter(Boolean);
|
|
143594
144256
|
return [
|
|
143595
|
-
...names.flatMap((name2) => dirs.map((dir) =>
|
|
144257
|
+
...names.flatMap((name2) => dirs.map((dir) => path54.posix.join(dir, name2))),
|
|
143596
144258
|
"/opt/google/chrome/chrome"
|
|
143597
144259
|
];
|
|
143598
144260
|
}
|
|
@@ -143758,7 +144420,7 @@ var init_process_liveness = __esm({
|
|
|
143758
144420
|
|
|
143759
144421
|
// src/lib/agent-browser/profile.ts
|
|
143760
144422
|
import fs25 from "node:fs";
|
|
143761
|
-
import
|
|
144423
|
+
import path55 from "node:path";
|
|
143762
144424
|
function themePreferences() {
|
|
143763
144425
|
const color = AGENT_BROWSER_THEME_COLOR;
|
|
143764
144426
|
return {
|
|
@@ -143818,18 +144480,18 @@ function hasOwnThemeColor(prefs) {
|
|
|
143818
144480
|
}
|
|
143819
144481
|
function ensureAgentProfile(profileDir, now3 = /* @__PURE__ */ new Date()) {
|
|
143820
144482
|
const created = !fs25.existsSync(profileDir);
|
|
143821
|
-
fs25.mkdirSync(
|
|
143822
|
-
fs25.chmodSync(
|
|
144483
|
+
fs25.mkdirSync(path55.dirname(profileDir), { recursive: true, mode: 448 });
|
|
144484
|
+
fs25.chmodSync(path55.dirname(profileDir), 448);
|
|
143823
144485
|
fs25.mkdirSync(profileDir, { recursive: true, mode: 448 });
|
|
143824
|
-
const marker =
|
|
144486
|
+
const marker = path55.join(profileDir, THEME_MARKER_FILE);
|
|
143825
144487
|
if (fs25.existsSync(marker)) return { created, themed: false };
|
|
143826
|
-
const prefsFile =
|
|
144488
|
+
const prefsFile = path55.join(profileDir, "Default", "Preferences");
|
|
143827
144489
|
const prefs = readJsonObject(prefsFile);
|
|
143828
144490
|
const themed = !hasOwnThemeColor(prefs);
|
|
143829
144491
|
if (themed) {
|
|
143830
|
-
fs25.mkdirSync(
|
|
144492
|
+
fs25.mkdirSync(path55.dirname(prefsFile), { recursive: true, mode: 448 });
|
|
143831
144493
|
fs25.writeFileSync(prefsFile, JSON.stringify(deepMerge2(prefs, themePreferences())));
|
|
143832
|
-
const localStateFile =
|
|
144494
|
+
const localStateFile = path55.join(profileDir, "Local State");
|
|
143833
144495
|
const localState = readJsonObject(localStateFile);
|
|
143834
144496
|
fs25.writeFileSync(
|
|
143835
144497
|
localStateFile,
|
|
@@ -143845,7 +144507,7 @@ function ensureAgentProfile(profileDir, now3 = /* @__PURE__ */ new Date()) {
|
|
|
143845
144507
|
}
|
|
143846
144508
|
function profileLock(profileDir, platform3 = process.platform) {
|
|
143847
144509
|
if (platform3 === "win32") {
|
|
143848
|
-
const lockfile =
|
|
144510
|
+
const lockfile = path55.join(profileDir, "lockfile");
|
|
143849
144511
|
if (!fs25.existsSync(lockfile)) return { inUse: false };
|
|
143850
144512
|
try {
|
|
143851
144513
|
fs25.rmSync(lockfile);
|
|
@@ -143856,7 +144518,7 @@ function profileLock(profileDir, platform3 = process.platform) {
|
|
|
143856
144518
|
}
|
|
143857
144519
|
let target;
|
|
143858
144520
|
try {
|
|
143859
|
-
target = fs25.readlinkSync(
|
|
144521
|
+
target = fs25.readlinkSync(path55.join(profileDir, "SingletonLock"));
|
|
143860
144522
|
} catch {
|
|
143861
144523
|
return { inUse: false };
|
|
143862
144524
|
}
|
|
@@ -143959,7 +144621,7 @@ var init_cloud_origin = __esm({
|
|
|
143959
144621
|
|
|
143960
144622
|
// src/lib/agent-browser/storage-state.ts
|
|
143961
144623
|
import fs26 from "node:fs";
|
|
143962
|
-
import
|
|
144624
|
+
import path56 from "node:path";
|
|
143963
144625
|
function toStorageStateCookie(cookie) {
|
|
143964
144626
|
const copy2 = {
|
|
143965
144627
|
name: cookie.name,
|
|
@@ -144030,7 +144692,7 @@ function cliCloudOrigins() {
|
|
|
144030
144692
|
}
|
|
144031
144693
|
async function writeStorageState(file2, state) {
|
|
144032
144694
|
const saved = withoutCloudOrigin(state, cliCloudOrigins()).state;
|
|
144033
|
-
fs26.mkdirSync(
|
|
144695
|
+
fs26.mkdirSync(path56.dirname(file2), { recursive: true, mode: 448 });
|
|
144034
144696
|
await writeFileAtomic2(file2, `${JSON.stringify(saved, null, 2)}
|
|
144035
144697
|
`, { mode: 384 });
|
|
144036
144698
|
return saved;
|
|
@@ -144149,12 +144811,12 @@ __export(browser_commands_exports, {
|
|
|
144149
144811
|
runBrowserStatus: () => runBrowserStatus
|
|
144150
144812
|
});
|
|
144151
144813
|
import fs27 from "node:fs";
|
|
144152
|
-
import
|
|
144814
|
+
import path57 from "node:path";
|
|
144153
144815
|
import { parseArgs as parseArgs8 } from "node:util";
|
|
144154
144816
|
function agentBrowserPaths(dorkHome) {
|
|
144155
144817
|
return {
|
|
144156
|
-
profileDir:
|
|
144157
|
-
stateFile:
|
|
144818
|
+
profileDir: path57.join(dorkHome, ...AGENT_BROWSER_PROFILE_SEGMENTS),
|
|
144819
|
+
stateFile: path57.join(dorkHome, ...AGENT_BROWSER_STATE_SEGMENTS)
|
|
144158
144820
|
};
|
|
144159
144821
|
}
|
|
144160
144822
|
function profileFlags(profileDir) {
|
|
@@ -144707,9 +145369,9 @@ var init_installation_label = __esm({
|
|
|
144707
145369
|
});
|
|
144708
145370
|
|
|
144709
145371
|
// src/lib/package-commands.ts
|
|
144710
|
-
import
|
|
145372
|
+
import path58 from "node:path";
|
|
144711
145373
|
function resolveProjectFlag(value) {
|
|
144712
|
-
return typeof value === "string" ?
|
|
145374
|
+
return typeof value === "string" ? path58.resolve(process.cwd(), value) : void 0;
|
|
144713
145375
|
}
|
|
144714
145376
|
function shellWord(value) {
|
|
144715
145377
|
return /^[A-Za-z0-9_./,:@%+=-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
@@ -145498,8 +146160,8 @@ async function runUninstall(args) {
|
|
|
145498
146160
|
console.log(
|
|
145499
146161
|
result2.unproven && result2.unproven.length > 0 ? "Kept these files:" : "Kept the files you and your agents added or changed:"
|
|
145500
146162
|
);
|
|
145501
|
-
for (const
|
|
145502
|
-
console.log(` ${
|
|
146163
|
+
for (const path71 of result2.preservedData) {
|
|
146164
|
+
console.log(` ${path71}`);
|
|
145503
146165
|
}
|
|
145504
146166
|
}
|
|
145505
146167
|
if (result2.agentRemoved) {
|
|
@@ -145731,8 +146393,8 @@ function filesOf(pkg) {
|
|
|
145731
146393
|
}
|
|
145732
146394
|
function devLinkNoteOf(pkg) {
|
|
145733
146395
|
if (!pkg.devLink) return void 0;
|
|
145734
|
-
const { path:
|
|
145735
|
-
return state === "active" ? `dev link \u2192 ${
|
|
146396
|
+
const { path: path71, state } = pkg.devLink;
|
|
146397
|
+
return state === "active" ? `dev link \u2192 ${path71}` : `dev link \u2192 ${path71} (${DEV_LINK_TROUBLE[state]})`;
|
|
145736
146398
|
}
|
|
145737
146399
|
function notesOf(pkg) {
|
|
145738
146400
|
return [
|
|
@@ -146080,7 +146742,7 @@ __export(marketplace_link_exports, {
|
|
|
146080
146742
|
runMarketplaceLink: () => runMarketplaceLink
|
|
146081
146743
|
});
|
|
146082
146744
|
import fs29 from "node:fs";
|
|
146083
|
-
import
|
|
146745
|
+
import path59 from "node:path";
|
|
146084
146746
|
import { parseArgs as parseArgs17 } from "node:util";
|
|
146085
146747
|
function parseMarketplaceLinkArgs(rawArgs) {
|
|
146086
146748
|
let parsed;
|
|
@@ -146107,7 +146769,7 @@ ${USAGE_LINE16}`);
|
|
|
146107
146769
|
if (positionals2.length > 1) throw new Error(`Link one folder at a time.
|
|
146108
146770
|
${USAGE_LINE16}`);
|
|
146109
146771
|
return {
|
|
146110
|
-
folder:
|
|
146772
|
+
folder: path59.resolve(process.cwd(), folder),
|
|
146111
146773
|
projectPath: resolveProjectFlag(values2.project),
|
|
146112
146774
|
replaceInstalled: Boolean(values2["replace-installed"]),
|
|
146113
146775
|
yes: Boolean(values2.yes),
|
|
@@ -146121,7 +146783,7 @@ function runningAsAgent() {
|
|
|
146121
146783
|
function describeUnreadableFolder(typed, err) {
|
|
146122
146784
|
const code = err?.code;
|
|
146123
146785
|
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})` : ""}.`;
|
|
146124
|
-
const tilde = typed.split(
|
|
146786
|
+
const tilde = typed.split(path59.sep).includes("~") ? " The shell does not expand ~ inside quotes; use the full path." : "";
|
|
146125
146787
|
return `Error: ${reason}${tilde}`;
|
|
146126
146788
|
}
|
|
146127
146789
|
function describeLinkPreview(preview) {
|
|
@@ -147475,10 +148137,10 @@ function createGitHubCommunityReleaseSource(options) {
|
|
|
147475
148137
|
},
|
|
147476
148138
|
verifyManifest: async (bytes, trusted) => {
|
|
147477
148139
|
const directory = await mkdtemp2(join58(tmpdir3(), "dorkos-community-manifest-"));
|
|
147478
|
-
const
|
|
148140
|
+
const path71 = join58(directory, "manifest.json");
|
|
147479
148141
|
try {
|
|
147480
|
-
await writeFile5(
|
|
147481
|
-
return await verify(
|
|
148142
|
+
await writeFile5(path71, bytes, { mode: 384, flag: "wx" });
|
|
148143
|
+
return await verify(path71, trusted);
|
|
147482
148144
|
} finally {
|
|
147483
148145
|
await rm3(directory, { recursive: true, force: true });
|
|
147484
148146
|
}
|
|
@@ -147494,7 +148156,7 @@ var init_github_release_source = __esm({
|
|
|
147494
148156
|
});
|
|
147495
148157
|
|
|
147496
148158
|
// src/commands/community-deploy/plan.ts
|
|
147497
|
-
import { createHash as
|
|
148159
|
+
import { createHash as createHash12 } from "node:crypto";
|
|
147498
148160
|
function createLaunchPlan(input4) {
|
|
147499
148161
|
const parsed = LaunchPlanInputSchema.parse(input4);
|
|
147500
148162
|
Object.freeze(parsed.fly);
|
|
@@ -147524,7 +148186,7 @@ function hashLaunchPlan(plan) {
|
|
|
147524
148186
|
private: plan.tigris.private
|
|
147525
148187
|
}
|
|
147526
148188
|
});
|
|
147527
|
-
return
|
|
148189
|
+
return createHash12("sha256").update(canonical2, "utf8").digest("hex");
|
|
147528
148190
|
}
|
|
147529
148191
|
var SafeIdentifierSchema, DisplayNameSchema, RegionSchema, Sha256DigestSchema, LaunchPlanInputSchema;
|
|
147530
148192
|
var init_plan2 = __esm({
|
|
@@ -150283,10 +150945,10 @@ kill_timeout = "30s"
|
|
|
150283
150945
|
}
|
|
150284
150946
|
async function withCommunityFlyConfig(plan, consumer) {
|
|
150285
150947
|
const directory = await mkdtemp3(join59(tmpdir4(), "dorkos-community-fly-"));
|
|
150286
|
-
const
|
|
150948
|
+
const path71 = join59(directory, "fly.toml");
|
|
150287
150949
|
try {
|
|
150288
|
-
await writeFile6(
|
|
150289
|
-
return await consumer(
|
|
150950
|
+
await writeFile6(path71, renderCommunityFlyConfig(plan), { mode: 384, flag: "wx" });
|
|
150951
|
+
return await consumer(path71);
|
|
150290
150952
|
} finally {
|
|
150291
150953
|
await rm4(directory, { recursive: true, force: true });
|
|
150292
150954
|
}
|
|
@@ -150366,14 +151028,14 @@ var init_health = __esm({
|
|
|
150366
151028
|
});
|
|
150367
151029
|
|
|
150368
151030
|
// src/commands/community-deploy/runtime/image-platform.ts
|
|
150369
|
-
import { createHash as
|
|
151031
|
+
import { createHash as createHash13 } from "node:crypto";
|
|
150370
151032
|
function invalid2() {
|
|
150371
151033
|
return new ProviderMutationError("INVALID_RESPONSE");
|
|
150372
151034
|
}
|
|
150373
151035
|
function selectPlatformDigest(bytes, headerMediaType, attestedDigest, platform3 = FLY_MACHINE_PLATFORM) {
|
|
150374
151036
|
if (!Sha256DigestSchema2.safeParse(attestedDigest).success) throw invalid2();
|
|
150375
151037
|
if (bytes.byteLength > MAX_INDEX_BYTES) throw invalid2();
|
|
150376
|
-
if (`sha256:${
|
|
151038
|
+
if (`sha256:${createHash13("sha256").update(bytes).digest("hex")}` !== attestedDigest) {
|
|
150377
151039
|
throw invalid2();
|
|
150378
151040
|
}
|
|
150379
151041
|
let document;
|
|
@@ -150424,7 +151086,7 @@ async function resolvePlatformImageDigest(input4) {
|
|
|
150424
151086
|
if (!match || !REGISTRY_ALLOW_LIST.has(match[1]) || !Sha256DigestSchema2.safeParse(input4.digest).success) {
|
|
150425
151087
|
throw invalid2();
|
|
150426
151088
|
}
|
|
150427
|
-
const [, host,
|
|
151089
|
+
const [, host, path71] = match;
|
|
150428
151090
|
const request = input4.fetch ?? fetch;
|
|
150429
151091
|
const signal = AbortSignal.any([
|
|
150430
151092
|
AbortSignal.timeout(input4.timeoutMs),
|
|
@@ -150434,14 +151096,14 @@ async function resolvePlatformImageDigest(input4) {
|
|
|
150434
151096
|
let mediaType;
|
|
150435
151097
|
try {
|
|
150436
151098
|
const tokenResponse = await request(
|
|
150437
|
-
`https://${host}/token?scope=${encodeURIComponent(`repository:${
|
|
151099
|
+
`https://${host}/token?scope=${encodeURIComponent(`repository:${path71}:pull`)}&service=${host}`,
|
|
150438
151100
|
{ signal, redirect: "error" }
|
|
150439
151101
|
);
|
|
150440
151102
|
if (!tokenResponse.ok) throw invalid2();
|
|
150441
151103
|
const token = external_exports.object({ token: external_exports.string().min(1).max(8192) }).passthrough().parse(
|
|
150442
151104
|
JSON.parse(Buffer.from(await readBounded2(tokenResponse, MAX_TOKEN_BYTES)).toString("utf8"))
|
|
150443
151105
|
).token;
|
|
150444
|
-
const response = await request(`https://${host}/v2/${
|
|
151106
|
+
const response = await request(`https://${host}/v2/${path71}/manifests/${input4.digest}`, {
|
|
150445
151107
|
signal,
|
|
150446
151108
|
redirect: "error",
|
|
150447
151109
|
headers: {
|
|
@@ -150756,8 +151418,8 @@ function handoffCommands(system) {
|
|
|
150756
151418
|
browser: { executable: "xdg-open", args: (origin) => [origin] }
|
|
150757
151419
|
};
|
|
150758
151420
|
}
|
|
150759
|
-
async function executableOnPath(executable,
|
|
150760
|
-
for (const directory of
|
|
151421
|
+
async function executableOnPath(executable, path71) {
|
|
151422
|
+
for (const directory of path71.split(delimiter).filter(Boolean)) {
|
|
150761
151423
|
try {
|
|
150762
151424
|
await access2(join60(directory, executable), constants9.X_OK);
|
|
150763
151425
|
return true;
|
|
@@ -150771,11 +151433,11 @@ async function assertOwnerHandoffPrerequisites(env6, system = platform2()) {
|
|
|
150771
151433
|
throw new Error(`Owner handoff is unsupported on this platform. See ${FLY_GUIDE_URL}`);
|
|
150772
151434
|
}
|
|
150773
151435
|
const commands = handoffCommands(system);
|
|
150774
|
-
const
|
|
151436
|
+
const path71 = env6.PATH ?? "";
|
|
150775
151437
|
const missing = (await Promise.all(
|
|
150776
151438
|
[commands.clipboard.executable].map(async (executable) => ({
|
|
150777
151439
|
executable,
|
|
150778
|
-
found: await executableOnPath(executable,
|
|
151440
|
+
found: await executableOnPath(executable, path71)
|
|
150779
151441
|
}))
|
|
150780
151442
|
)).filter(({ found }) => !found);
|
|
150781
151443
|
if (missing.length > 0) {
|
|
@@ -150981,9 +151643,9 @@ function launchJournalPath(dorkHome, runId) {
|
|
|
150981
151643
|
const safeRunId = external_exports.uuid().parse(runId);
|
|
150982
151644
|
return join61(dorkHome, "launches", "community", `${safeRunId}.json`);
|
|
150983
151645
|
}
|
|
150984
|
-
async function rejectSymlink(
|
|
151646
|
+
async function rejectSymlink(path71) {
|
|
150985
151647
|
try {
|
|
150986
|
-
if ((await lstat7(
|
|
151648
|
+
if ((await lstat7(path71)).isSymbolicLink()) throw new Error(`Refusing symbolic link: ${path71}`);
|
|
150987
151649
|
} catch (error63) {
|
|
150988
151650
|
if (error63.code !== "ENOENT") throw error63;
|
|
150989
151651
|
}
|
|
@@ -151005,9 +151667,9 @@ async function prepareDirectory(filePath) {
|
|
|
151005
151667
|
await rejectSymlink(directory);
|
|
151006
151668
|
}
|
|
151007
151669
|
}
|
|
151008
|
-
async function exists2(
|
|
151670
|
+
async function exists2(path71) {
|
|
151009
151671
|
try {
|
|
151010
|
-
await lstat7(
|
|
151672
|
+
await lstat7(path71);
|
|
151011
151673
|
return true;
|
|
151012
151674
|
} catch (error63) {
|
|
151013
151675
|
if (error63.code === "ENOENT") return false;
|
|
@@ -153941,7 +154603,7 @@ There is no --yes mode. Before the first write, type the generated app name in a
|
|
|
153941
154603
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
153942
154604
|
import net from "node:net";
|
|
153943
154605
|
import fs30 from "node:fs";
|
|
153944
|
-
import
|
|
154606
|
+
import path60 from "node:path";
|
|
153945
154607
|
function checkNode() {
|
|
153946
154608
|
const issue2 = checkNodeVersion();
|
|
153947
154609
|
if (issue2) {
|
|
@@ -153950,7 +154612,7 @@ function checkNode() {
|
|
|
153950
154612
|
return { label: `Node.js ${process.versions.node}`, status: "pass" };
|
|
153951
154613
|
}
|
|
153952
154614
|
function checkDorkHomeWritable(dorkHome) {
|
|
153953
|
-
const probe2 =
|
|
154615
|
+
const probe2 = path60.join(dorkHome, `.doctor-write-${process.pid}`);
|
|
153954
154616
|
try {
|
|
153955
154617
|
fs30.mkdirSync(dorkHome, { recursive: true });
|
|
153956
154618
|
fs30.writeFileSync(probe2, "ok");
|
|
@@ -154003,7 +154665,7 @@ function readGitVersion() {
|
|
|
154003
154665
|
return execFileSync3("git", ["--version"], { encoding: "utf-8", stdio: "pipe", timeout: 1e4 });
|
|
154004
154666
|
}
|
|
154005
154667
|
function checkClaudeAuth(homeDir) {
|
|
154006
|
-
const claudeDir =
|
|
154668
|
+
const claudeDir = path60.join(homeDir, ".claude");
|
|
154007
154669
|
if (fs30.existsSync(claudeDir)) {
|
|
154008
154670
|
return { label: "Claude looks configured", status: "info", detail: claudeDir };
|
|
154009
154671
|
}
|
|
@@ -154094,7 +154756,7 @@ function checkFileDescriptors(softLimit) {
|
|
|
154094
154756
|
};
|
|
154095
154757
|
}
|
|
154096
154758
|
function checkDevLinks(dorkHome) {
|
|
154097
|
-
const file2 =
|
|
154759
|
+
const file2 = path60.join(dorkHome, DEV_LINKS_FILE);
|
|
154098
154760
|
let text3;
|
|
154099
154761
|
try {
|
|
154100
154762
|
text3 = fs30.readFileSync(file2, "utf-8");
|
|
@@ -154139,7 +154801,7 @@ function devLinkStateSync(record2) {
|
|
|
154139
154801
|
if (lstatIsLink && realpathOfSlot === null) {
|
|
154140
154802
|
try {
|
|
154141
154803
|
const text3 = fs30.readlinkSync(record2.slot);
|
|
154142
|
-
if (
|
|
154804
|
+
if (path60.resolve(path60.dirname(record2.slot), text3) === record2.target) return "folder-missing";
|
|
154143
154805
|
} catch {
|
|
154144
154806
|
}
|
|
154145
154807
|
}
|
|
@@ -154261,7 +154923,7 @@ __export(doctor_exports, {
|
|
|
154261
154923
|
});
|
|
154262
154924
|
import fs31 from "node:fs";
|
|
154263
154925
|
import os9 from "node:os";
|
|
154264
|
-
import
|
|
154926
|
+
import path61 from "node:path";
|
|
154265
154927
|
function parseDoctorArgs(rawArgs) {
|
|
154266
154928
|
const usage = "Usage: dorkos doctor [--json] [--deep]";
|
|
154267
154929
|
const args = { json: false, deep: false };
|
|
@@ -154318,7 +154980,7 @@ function configFailureCheck(err, dorkHome) {
|
|
|
154318
154980
|
label: "Your settings could not be used",
|
|
154319
154981
|
status: "fail",
|
|
154320
154982
|
detail: describeConfigFailure(err),
|
|
154321
|
-
fix: `DorkOS did not replace or delete the file: ${
|
|
154983
|
+
fix: `DorkOS did not replace or delete the file: ${path61.join(dorkHome, "config.json")}
|
|
154322
154984
|
Everything below was checked against the built-in defaults instead.
|
|
154323
154985
|
` + adviceFrom(err)
|
|
154324
154986
|
};
|
|
@@ -154364,7 +155026,7 @@ async function gatherResults(dorkHome, store) {
|
|
|
154364
155026
|
checkDevLinks(dorkHome),
|
|
154365
155027
|
checkAuthConfig({
|
|
154366
155028
|
authEnabled: readBool(store, "auth.enabled", false),
|
|
154367
|
-
secretFileExists: fs31.existsSync(
|
|
155029
|
+
secretFileExists: fs31.existsSync(path61.join(dorkHome, SECRET_FILE_NAME2)),
|
|
154368
155030
|
// eslint-disable-next-line no-restricted-syntax -- reading an operator env override, matching secret.ts
|
|
154369
155031
|
secretEnvSet: Boolean(process.env.BETTER_AUTH_SECRET?.trim())
|
|
154370
155032
|
}),
|
|
@@ -154814,13 +155476,13 @@ function assertHasProtocol(url2) {
|
|
|
154814
155476
|
throw new BetterAuthError(`Invalid base URL: ${url2}. Please provide a valid base URL.`, { cause: error63 });
|
|
154815
155477
|
}
|
|
154816
155478
|
}
|
|
154817
|
-
function withPath2(url2,
|
|
155479
|
+
function withPath2(url2, path71 = "/api/auth") {
|
|
154818
155480
|
assertHasProtocol(url2);
|
|
154819
155481
|
if (checkHasPath(url2)) return url2;
|
|
154820
155482
|
const trimmedUrl = trimTrailingSlashes(url2);
|
|
154821
|
-
if (!
|
|
154822
|
-
|
|
154823
|
-
return `${trimmedUrl}${
|
|
155483
|
+
if (!path71 || path71 === "/") return trimmedUrl;
|
|
155484
|
+
path71 = path71.startsWith("/") ? path71 : `/${path71}`;
|
|
155485
|
+
return `${trimmedUrl}${path71}`;
|
|
154824
155486
|
}
|
|
154825
155487
|
function validateProxyHeader(header, type2) {
|
|
154826
155488
|
if (!header || header.trim() === "") return false;
|
|
@@ -154840,26 +155502,26 @@ function validateProxyHeader(header, type2) {
|
|
|
154840
155502
|
}
|
|
154841
155503
|
return false;
|
|
154842
155504
|
}
|
|
154843
|
-
function getBaseURL(url2,
|
|
154844
|
-
if (url2) return withPath2(url2,
|
|
155505
|
+
function getBaseURL(url2, path71, request, loadEnv, trustedProxyHeaders) {
|
|
155506
|
+
if (url2) return withPath2(url2, path71);
|
|
154845
155507
|
if (loadEnv !== false) {
|
|
154846
155508
|
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);
|
|
154847
|
-
if (fromEnv) return withPath2(fromEnv,
|
|
155509
|
+
if (fromEnv) return withPath2(fromEnv, path71);
|
|
154848
155510
|
}
|
|
154849
155511
|
const fromRequest = request?.headers.get("x-forwarded-host");
|
|
154850
155512
|
const fromRequestProto = request?.headers.get("x-forwarded-proto");
|
|
154851
155513
|
if (fromRequest && fromRequestProto && trustedProxyHeaders) {
|
|
154852
155514
|
if (validateProxyHeader(fromRequestProto, "proto") && validateProxyHeader(fromRequest, "host")) try {
|
|
154853
|
-
return withPath2(`${fromRequestProto}://${fromRequest}`,
|
|
155515
|
+
return withPath2(`${fromRequestProto}://${fromRequest}`, path71);
|
|
154854
155516
|
} catch (_error) {
|
|
154855
155517
|
}
|
|
154856
155518
|
}
|
|
154857
155519
|
if (request) {
|
|
154858
155520
|
const url3 = getOrigin(request.url);
|
|
154859
155521
|
if (!url3) throw new BetterAuthError("Could not get origin from request. Please provide a valid base URL.");
|
|
154860
|
-
return withPath2(url3,
|
|
155522
|
+
return withPath2(url3, path71);
|
|
154861
155523
|
}
|
|
154862
|
-
if (typeof window !== "undefined" && window.location) return withPath2(window.location.origin,
|
|
155524
|
+
if (typeof window !== "undefined" && window.location) return withPath2(window.location.origin, path71);
|
|
154863
155525
|
}
|
|
154864
155526
|
function getOrigin(url2) {
|
|
154865
155527
|
try {
|
|
@@ -155450,9 +156112,9 @@ function parseCookieCachePayload(value) {
|
|
|
155450
156112
|
if (parsed === null) return null;
|
|
155451
156113
|
const result2 = cookieCachePayloadSchema.safeParse(parsed);
|
|
155452
156114
|
if (result2.success) return result2.data;
|
|
155453
|
-
logger2.warn("Cookie cache payload failed schema validation", { issues: result2.error.issues.map(({ code, path:
|
|
156115
|
+
logger2.warn("Cookie cache payload failed schema validation", { issues: result2.error.issues.map(({ code, path: path71 }) => ({
|
|
155454
156116
|
code,
|
|
155455
|
-
path:
|
|
156117
|
+
path: path71
|
|
155456
156118
|
})) });
|
|
155457
156119
|
return null;
|
|
155458
156120
|
}
|
|
@@ -156225,10 +156887,10 @@ var init_trusted_origins2 = __esm({
|
|
|
156225
156887
|
CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f-\u009f]/;
|
|
156226
156888
|
RELATIVE_URL_PARSER_ORIGIN = "https://better-auth.invalid";
|
|
156227
156889
|
ENCODED_PATH_SEPARATOR_PATTERN = /%2[fF]|%5[cC]/;
|
|
156228
|
-
normalizePath3 = (
|
|
156229
|
-
let decoded =
|
|
156890
|
+
normalizePath3 = (path71) => {
|
|
156891
|
+
let decoded = path71;
|
|
156230
156892
|
try {
|
|
156231
|
-
decoded = decodeURIComponent(
|
|
156893
|
+
decoded = decodeURIComponent(path71);
|
|
156232
156894
|
} catch {
|
|
156233
156895
|
}
|
|
156234
156896
|
const segments = [];
|
|
@@ -156255,18 +156917,18 @@ var init_trusted_origins2 = __esm({
|
|
|
156255
156917
|
}
|
|
156256
156918
|
}
|
|
156257
156919
|
const pathEnd = rest.search(/[?#]/);
|
|
156258
|
-
const
|
|
156920
|
+
const path71 = normalizePath3(pathEnd === -1 ? rest : rest.slice(0, pathEnd));
|
|
156259
156921
|
return {
|
|
156260
156922
|
scheme,
|
|
156261
156923
|
authority: authority.toLowerCase(),
|
|
156262
|
-
path:
|
|
156924
|
+
path: path71
|
|
156263
156925
|
};
|
|
156264
156926
|
};
|
|
156265
156927
|
isSafeRelativeURL = (value) => {
|
|
156266
156928
|
if (!value.startsWith("/") || value.startsWith("//") || value.includes("\\") || CONTROL_CHARACTER_PATTERN.test(value)) return false;
|
|
156267
156929
|
const pathEnd = value.search(/[?#]/);
|
|
156268
|
-
const
|
|
156269
|
-
if (ENCODED_PATH_SEPARATOR_PATTERN.test(
|
|
156930
|
+
const path71 = pathEnd === -1 ? value : value.slice(0, pathEnd);
|
|
156931
|
+
if (ENCODED_PATH_SEPARATOR_PATTERN.test(path71)) return false;
|
|
156270
156932
|
try {
|
|
156271
156933
|
return new URL(value, RELATIVE_URL_PARSER_ORIGIN).origin === RELATIVE_URL_PARSER_ORIGIN;
|
|
156272
156934
|
} catch {
|
|
@@ -156647,7 +157309,7 @@ function getRateLimitStorage(ctx, rateLimitSettings) {
|
|
|
156647
157309
|
}
|
|
156648
157310
|
async function resolveRateLimitConfig(req, ctx) {
|
|
156649
157311
|
const basePath = new URL(ctx.baseURL).pathname;
|
|
156650
|
-
const
|
|
157312
|
+
const path71 = normalizePathname(req.url, basePath);
|
|
156651
157313
|
let currentWindow = ctx.rateLimit.window;
|
|
156652
157314
|
let currentMax = ctx.rateLimit.max;
|
|
156653
157315
|
const ip = getIP(req, ctx.options);
|
|
@@ -156656,14 +157318,14 @@ async function resolveRateLimitConfig(req, ctx) {
|
|
|
156656
157318
|
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.");
|
|
156657
157319
|
ipWarningLogged = true;
|
|
156658
157320
|
}
|
|
156659
|
-
const key = createRateLimitKey(ip ?? NO_TRUSTED_IP_KEY,
|
|
156660
|
-
const specialRule = getDefaultSpecialRules().find((rule) => rule.pathMatcher(
|
|
157321
|
+
const key = createRateLimitKey(ip ?? NO_TRUSTED_IP_KEY, path71);
|
|
157322
|
+
const specialRule = getDefaultSpecialRules().find((rule) => rule.pathMatcher(path71));
|
|
156661
157323
|
if (specialRule) {
|
|
156662
157324
|
currentWindow = specialRule.window;
|
|
156663
157325
|
currentMax = specialRule.max;
|
|
156664
157326
|
}
|
|
156665
157327
|
for (const plugin of ctx.options.plugins || []) if (plugin.rateLimit) {
|
|
156666
|
-
const matchedRule = plugin.rateLimit.find((rule) => rule.pathMatcher(
|
|
157328
|
+
const matchedRule = plugin.rateLimit.find((rule) => rule.pathMatcher(path71));
|
|
156667
157329
|
if (matchedRule) {
|
|
156668
157330
|
currentWindow = matchedRule.window;
|
|
156669
157331
|
currentMax = matchedRule.max;
|
|
@@ -156672,8 +157334,8 @@ async function resolveRateLimitConfig(req, ctx) {
|
|
|
156672
157334
|
}
|
|
156673
157335
|
if (ctx.rateLimit.customRules) {
|
|
156674
157336
|
const _path = Object.keys(ctx.rateLimit.customRules).find((p) => {
|
|
156675
|
-
if (p.includes("*")) return wildcardMatch(p)(
|
|
156676
|
-
return p ===
|
|
157337
|
+
if (p.includes("*")) return wildcardMatch(p)(path71);
|
|
157338
|
+
return p === path71;
|
|
156677
157339
|
});
|
|
156678
157340
|
if (_path) {
|
|
156679
157341
|
const customRule = ctx.rateLimit.customRules[_path];
|
|
@@ -156709,14 +157371,14 @@ async function onRequestRateLimit(req, ctx) {
|
|
|
156709
157371
|
}
|
|
156710
157372
|
function getDefaultSpecialRules() {
|
|
156711
157373
|
return [{
|
|
156712
|
-
pathMatcher(
|
|
156713
|
-
return
|
|
157374
|
+
pathMatcher(path71) {
|
|
157375
|
+
return path71.startsWith("/sign-in") || path71.startsWith("/sign-up") || path71.startsWith("/change-password") || path71.startsWith("/change-email");
|
|
156714
157376
|
},
|
|
156715
157377
|
window: 10,
|
|
156716
157378
|
max: 3
|
|
156717
157379
|
}, {
|
|
156718
|
-
pathMatcher(
|
|
156719
|
-
return
|
|
157380
|
+
pathMatcher(path71) {
|
|
157381
|
+
return path71 === "/request-password-reset" || path71 === "/send-verification-email" || path71.startsWith("/forget-password") || path71 === "/email-otp/send-verification-otp" || path71 === "/email-otp/request-password-reset";
|
|
156720
157382
|
},
|
|
156721
157383
|
window: 60,
|
|
156722
157384
|
max: 3
|
|
@@ -162422,15 +163084,15 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
162422
163084
|
options.plugins?.forEach((plugin) => {
|
|
162423
163085
|
if (plugin.endpoints) {
|
|
162424
163086
|
for (const [key, endpoint] of Object.entries(plugin.endpoints)) if (endpoint && "path" in endpoint && typeof endpoint.path === "string") {
|
|
162425
|
-
const
|
|
163087
|
+
const path71 = endpoint.path;
|
|
162426
163088
|
let methods2 = [];
|
|
162427
163089
|
if (endpoint.options && "method" in endpoint.options) {
|
|
162428
163090
|
if (Array.isArray(endpoint.options.method)) methods2 = endpoint.options.method;
|
|
162429
163091
|
else if (typeof endpoint.options.method === "string") methods2 = [endpoint.options.method];
|
|
162430
163092
|
}
|
|
162431
163093
|
if (methods2.length === 0) methods2 = ["*"];
|
|
162432
|
-
if (!endpointRegistry.has(
|
|
162433
|
-
endpointRegistry.get(
|
|
163094
|
+
if (!endpointRegistry.has(path71)) endpointRegistry.set(path71, []);
|
|
163095
|
+
endpointRegistry.get(path71).push({
|
|
162434
163096
|
pluginId: plugin.id,
|
|
162435
163097
|
endpointKey: key,
|
|
162436
163098
|
methods: methods2
|
|
@@ -162439,7 +163101,7 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
162439
163101
|
}
|
|
162440
163102
|
});
|
|
162441
163103
|
const conflicts = [];
|
|
162442
|
-
for (const [
|
|
163104
|
+
for (const [path71, entries] of endpointRegistry.entries()) if (entries.length > 1) {
|
|
162443
163105
|
const methodMap = /* @__PURE__ */ new Map();
|
|
162444
163106
|
let hasConflict = false;
|
|
162445
163107
|
for (const entry of entries) for (const method of entry.methods) {
|
|
@@ -162454,7 +163116,7 @@ function checkEndpointConflicts(options, logger3) {
|
|
|
162454
163116
|
const conflictingMethods = [];
|
|
162455
163117
|
for (const [method, plugins] of methodMap.entries()) if (plugins.length > 1 || method === "*" && entries.length > 1 || method !== "*" && methodMap.has("*")) conflictingMethods.push(method);
|
|
162456
163118
|
conflicts.push({
|
|
162457
|
-
path:
|
|
163119
|
+
path: path71,
|
|
162458
163120
|
plugins: uniquePlugins,
|
|
162459
163121
|
conflictingMethods
|
|
162460
163122
|
});
|
|
@@ -172043,12 +172705,12 @@ __export(ended_standing_grants_exports, {
|
|
|
172043
172705
|
recordEndedStandingGrants: () => recordEndedStandingGrants
|
|
172044
172706
|
});
|
|
172045
172707
|
import fs32 from "node:fs/promises";
|
|
172046
|
-
import { readFileSync as
|
|
172047
|
-
import
|
|
172708
|
+
import { readFileSync as readFileSync24, writeFileSync as writeFileSync4, renameSync as renameSync4 } from "node:fs";
|
|
172709
|
+
import path62 from "node:path";
|
|
172048
172710
|
function readStandingGrantLicence(dorkHome) {
|
|
172049
172711
|
let config3;
|
|
172050
172712
|
try {
|
|
172051
|
-
config3 = JSON.parse(
|
|
172713
|
+
config3 = JSON.parse(readFileSync24(path62.join(dorkHome, "config.json"), "utf-8"));
|
|
172052
172714
|
} catch {
|
|
172053
172715
|
return NO_LICENCE;
|
|
172054
172716
|
}
|
|
@@ -172091,7 +172753,7 @@ function captureLiveStandingGrants(db2, dorkHome, logger3, licence, now3 = /* @_
|
|
|
172091
172753
|
capabilityId: row2.capability_id,
|
|
172092
172754
|
expiresAt: row2.expires_at
|
|
172093
172755
|
}));
|
|
172094
|
-
const file2 =
|
|
172756
|
+
const file2 = path62.join(dorkHome, ENDED_STANDING_GRANTS_FILE);
|
|
172095
172757
|
const existing = readCaptured(file2);
|
|
172096
172758
|
const byId = new Map([...existing, ...grants].map((grant) => [grant.id, grant]));
|
|
172097
172759
|
const tmp = `${file2}.tmp`;
|
|
@@ -172108,7 +172770,7 @@ function captureLiveStandingGrants(db2, dorkHome, logger3, licence, now3 = /* @_
|
|
|
172108
172770
|
function readCaptured(file2) {
|
|
172109
172771
|
let raw;
|
|
172110
172772
|
try {
|
|
172111
|
-
raw =
|
|
172773
|
+
raw = readFileSync24(file2, "utf-8");
|
|
172112
172774
|
} catch {
|
|
172113
172775
|
return [];
|
|
172114
172776
|
}
|
|
@@ -172123,7 +172785,7 @@ function readCaptured(file2) {
|
|
|
172123
172785
|
}
|
|
172124
172786
|
}
|
|
172125
172787
|
async function recordEndedStandingGrants(deps) {
|
|
172126
|
-
const file2 =
|
|
172788
|
+
const file2 = path62.join(deps.dorkHome, ENDED_STANDING_GRANTS_FILE);
|
|
172127
172789
|
const grants = readCaptured(file2);
|
|
172128
172790
|
if (grants.length === 0) {
|
|
172129
172791
|
await fs32.rm(file2, { force: true });
|
|
@@ -172132,7 +172794,7 @@ async function recordEndedStandingGrants(deps) {
|
|
|
172132
172794
|
const agents2 = new Map(deps.agents().map((agent) => [agent.projectPath, agent]));
|
|
172133
172795
|
for (const grant of grants) {
|
|
172134
172796
|
const agent = agents2.get(grant.agentPath);
|
|
172135
|
-
const name2 = agent ? agent.displayName || agent.name :
|
|
172797
|
+
const name2 = agent ? agent.displayName || agent.name : path62.basename(grant.agentPath);
|
|
172136
172798
|
const title = deps.actionTitle(grant.capabilityId);
|
|
172137
172799
|
await deps.activity.emit({
|
|
172138
172800
|
actorType: UPGRADE_WRITER.actorType,
|
|
@@ -172175,12 +172837,12 @@ var init_ended_standing_grants = __esm({
|
|
|
172175
172837
|
});
|
|
172176
172838
|
|
|
172177
172839
|
// src/commands/auth-runtime.ts
|
|
172178
|
-
import
|
|
172179
|
-
import { mkdirSync as mkdirSync8, readFileSync as
|
|
172840
|
+
import path63 from "node:path";
|
|
172841
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync25 } from "node:fs";
|
|
172180
172842
|
import { input as input2, password as passwordPrompt } from "@inquirer/prompts";
|
|
172181
172843
|
async function buildAuthRuntime(dorkHome) {
|
|
172182
172844
|
mkdirSync8(dorkHome, { recursive: true });
|
|
172183
|
-
const db2 = createDb(
|
|
172845
|
+
const db2 = createDb(path63.join(dorkHome, "dork.db"));
|
|
172184
172846
|
const { captureLiveStandingGrants: captureLiveStandingGrants2, readStandingGrantLicence: readStandingGrantLicence2 } = await Promise.resolve().then(() => (init_ended_standing_grants(), ended_standing_grants_exports));
|
|
172185
172847
|
captureLiveStandingGrants2(db2, dorkHome, console, readStandingGrantLicence2(dorkHome));
|
|
172186
172848
|
runMigrations(db2);
|
|
@@ -172214,7 +172876,7 @@ function resolveCredentialPrompt() {
|
|
|
172214
172876
|
if (!stdinPrompt) {
|
|
172215
172877
|
let raw = "";
|
|
172216
172878
|
try {
|
|
172217
|
-
raw =
|
|
172879
|
+
raw = readFileSync25(0, "utf8");
|
|
172218
172880
|
} catch {
|
|
172219
172881
|
}
|
|
172220
172882
|
stdinPrompt = createStdinPrompt(raw);
|
|
@@ -172556,6 +173218,7 @@ var init_connection_copy = __esm({
|
|
|
172556
173218
|
var CONNECTOR_OPERATION_SELECTION_LIMIT, CONNECTOR_AUTHENTICATION_FLOW_TTL_MS, CONNECTOR_EVENT_REVIEW_SCOPE_LIMIT, ConnectorJsonValueSchema, ConnectorJsonObjectSchema, ConnectorProviderInstanceIdSchema, ConnectionIdSchema, ConnectorExternalAccountRefSchema, ConnectorProviderModeSchema, ConnectorProviderHealthSchema, ConnectorGrantReconciliationStatusSchema, ConnectorOperationClassificationSchema, ConnectorAccessLevelSchema, ConnectorRetryPolicySchema, ConnectorOperationRevisionSchema, ConnectorOperationPageSchema, ConnectorCapabilityAvailabilitySchema, ConnectorUnsupportedResultSchema, ConnectorProviderCapabilitySetSchema, ConnectorToolkitVersionResultSchema, ConnectorProviderExecuteResultSchema, ConnectorAuthenticationFlowSchema, ConnectorExecutionTargetSchema, ConnectorProgramExecutionRequestSchema, ConnectorExecutionPublicResultSchema, ConnectorExecutionResponseSchema, ConnectionReadinessStateSchema, ConnectionReadinessReasonSchema, ConnectionFixActionSchema, ConnectionFixSchema, ConnectionReadinessSchema, AccessibleConnectorConnectionSchema, AccessibleConnectorOperationSchema, ConnectorAccessibleConnectionsResponseSchema, ConnectorAccessibleOperationsResponseSchema, ConnectorUsageItemSchema, ConnectorUsagePageSchema, ConnectorReconciliationPreviewRequestSchema, ConnectorReconciliationGrantSelectionSchema, ConnectorReconciliationEveryAgentSelectionSchema, ConnectorReconciliationEveryAgentStateSchema, ConnectorEveryAgentRevokeResponseSchema, ConnectorReconciliationAgentSchema, ConnectorReconciliationCandidateSchema, ConnectorReconciliationPreviewSchema, ConnectorReconciliationApplyRequestSchema, ConnectorReconciliationApplyResponseSchema, ReviewActionBaseSchema, ConnectionTargetSchema, ConnectorRequestAccessSchema, ConnectorReviewActionSchema, ConnectorAgentConnectionRequestInputSchema, ConnectorAgentRequestBaseSchema, ConnectorRequestNotGrantedSchema, ConnectorAgentRequestStatusSchema, ConnectorAgentRequestItemSchema, ConnectorAgentRequestListResponseSchema, ConnectorManagementConnectActionSchema, ConnectorManagementAppliedActionSchema, ConnectorManagementReviewActionSchema, ConnectorManagementReviewCreateRequestSchema, ConnectorManagementReviewOutcomeSchema, ConnectorManagementReviewOperationContextSchema, ConnectorManagementReviewConnectionContextSchema, ConnectorManagementReviewAgentContextSchema, ConnectorManagementReviewContextSchema, ManagementReviewItemBaseShape, ConnectorPendingManagementReviewItemSchema, ConnectorResolvingManagementReviewItemSchema, ConnectorExpiredManagementReviewItemSchema, ConnectorDeniedManagementReviewItemSchema, ConnectorApprovedAppliedManagementReviewItemSchema, ConnectorApprovedConnectManagementReviewItemSchema, ConnectorApprovedUnknownManagementReviewItemSchema, ConnectorManagementReviewItemSchema, ProgramReviewStatusBaseShape, ConnectorProgramReviewStatusSchema, ConnectorManagementReviewDecisionSchema, ConnectorManagementReviewDecisionResultSchema;
|
|
172557
173219
|
var init_connector_schemas = __esm({
|
|
172558
173220
|
"../connector-providers/src/connector-schemas.ts"() {
|
|
173221
|
+
"use strict";
|
|
172559
173222
|
init_zod();
|
|
172560
173223
|
init_connection_copy();
|
|
172561
173224
|
CONNECTOR_OPERATION_SELECTION_LIMIT = 1e5;
|
|
@@ -174230,9 +174893,9 @@ var init_cloud_link_client = __esm({
|
|
|
174230
174893
|
// ../../apps/server/src/lib/instance-id.ts
|
|
174231
174894
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
174232
174895
|
import fs33 from "node:fs/promises";
|
|
174233
|
-
import
|
|
174896
|
+
import path64 from "node:path";
|
|
174234
174897
|
async function getOrCreateInstanceId(dorkHome) {
|
|
174235
|
-
const filePath =
|
|
174898
|
+
const filePath = path64.join(dorkHome, INSTANCE_ID_FILENAME2);
|
|
174236
174899
|
try {
|
|
174237
174900
|
const existing = await fs33.readFile(filePath, "utf8");
|
|
174238
174901
|
const trimmed = existing.trim();
|
|
@@ -175112,14 +175775,14 @@ function parseAgentCreateArgs(rawArgs) {
|
|
|
175112
175775
|
}
|
|
175113
175776
|
const { values: values2 } = parsed;
|
|
175114
175777
|
const name2 = typeof values2.name === "string" ? values2.name : void 0;
|
|
175115
|
-
const
|
|
175778
|
+
const path71 = typeof values2.path === "string" ? values2.path : void 0;
|
|
175116
175779
|
if (!name2) throw new Error(`Missing required --name.
|
|
175117
175780
|
${usage}`);
|
|
175118
|
-
if (!
|
|
175781
|
+
if (!path71) throw new Error(`Missing required --path.
|
|
175119
175782
|
${usage}`);
|
|
175120
175783
|
return {
|
|
175121
175784
|
name: name2,
|
|
175122
|
-
path:
|
|
175785
|
+
path: path71,
|
|
175123
175786
|
template: typeof values2.template === "string" ? values2.template : void 0,
|
|
175124
175787
|
displayName: typeof values2["display-name"] === "string" ? values2["display-name"] : void 0,
|
|
175125
175788
|
description: typeof values2.description === "string" ? values2.description : void 0,
|
|
@@ -175169,12 +175832,12 @@ function parseAgentUpdateArgs(rawArgs) {
|
|
|
175169
175832
|
rethrowUnknownOption(err, "agent update", usage);
|
|
175170
175833
|
}
|
|
175171
175834
|
const { values: values2 } = parsed;
|
|
175172
|
-
const
|
|
175173
|
-
if (!
|
|
175835
|
+
const path71 = typeof values2.path === "string" ? values2.path : void 0;
|
|
175836
|
+
if (!path71) throw new Error(`Missing required --path.
|
|
175174
175837
|
${usage}`);
|
|
175175
175838
|
const clearable = (v2) => typeof v2 === "string" ? v2.length === 0 ? null : v2 : void 0;
|
|
175176
175839
|
return {
|
|
175177
|
-
path:
|
|
175840
|
+
path: path71,
|
|
175178
175841
|
displayName: typeof values2["display-name"] === "string" ? values2["display-name"] : void 0,
|
|
175179
175842
|
description: typeof values2.description === "string" ? values2.description : void 0,
|
|
175180
175843
|
color: clearable(values2.color),
|
|
@@ -175749,7 +176412,7 @@ __export(room_exports, {
|
|
|
175749
176412
|
});
|
|
175750
176413
|
import { parseArgs as parseArgs30 } from "node:util";
|
|
175751
176414
|
import fs34 from "node:fs";
|
|
175752
|
-
import
|
|
176415
|
+
import path65 from "node:path";
|
|
175753
176416
|
import { Readable } from "node:stream";
|
|
175754
176417
|
import { finished as finished2, pipeline } from "node:stream/promises";
|
|
175755
176418
|
function parseRoomExportArgs(rawArgs) {
|
|
@@ -175801,7 +176464,7 @@ async function resolveRoomId(reference) {
|
|
|
175801
176464
|
}
|
|
175802
176465
|
function suggestedFilename(disposition, roomId) {
|
|
175803
176466
|
const match = disposition?.match(/filename="([^"]+)"/);
|
|
175804
|
-
const name2 = match ?
|
|
176467
|
+
const name2 = match ? path65.basename(match[1]) : "";
|
|
175805
176468
|
return name2 && name2 !== "." && name2 !== ".." ? name2 : `room-${roomId}.jsonl`;
|
|
175806
176469
|
}
|
|
175807
176470
|
async function streamExport(body, destination, closeDestination) {
|
|
@@ -175835,8 +176498,8 @@ async function streamExport(body, destination, closeDestination) {
|
|
|
175835
176498
|
return { entryCount: null, reason };
|
|
175836
176499
|
}
|
|
175837
176500
|
async function writeExportFile(body, target) {
|
|
175838
|
-
const staging = fs34.mkdtempSync(
|
|
175839
|
-
const scratch =
|
|
176501
|
+
const staging = fs34.mkdtempSync(path65.join(path65.dirname(target), ".dorkos-export-"));
|
|
176502
|
+
const scratch = path65.join(staging, path65.basename(target));
|
|
175840
176503
|
let file2;
|
|
175841
176504
|
try {
|
|
175842
176505
|
file2 = fs34.createWriteStream(scratch);
|
|
@@ -175857,7 +176520,7 @@ async function runRoomExport(args) {
|
|
|
175857
176520
|
const toStdout = args.out === STDOUT_TARGET;
|
|
175858
176521
|
let target = null;
|
|
175859
176522
|
if (!toStdout) {
|
|
175860
|
-
target =
|
|
176523
|
+
target = path65.resolve(
|
|
175861
176524
|
args.out ?? suggestedFilename(res.headers.get("content-disposition"), roomId)
|
|
175862
176525
|
);
|
|
175863
176526
|
if (!args.force && fs34.existsSync(target)) {
|
|
@@ -177181,7 +177844,7 @@ __export(version_exports, {
|
|
|
177181
177844
|
runVersionDispatcher: () => runVersionDispatcher
|
|
177182
177845
|
});
|
|
177183
177846
|
import fs37 from "node:fs";
|
|
177184
|
-
import
|
|
177847
|
+
import path66 from "node:path";
|
|
177185
177848
|
import { parseArgs as parseArgs35 } from "node:util";
|
|
177186
177849
|
function parseVersionArgs(rawArgs) {
|
|
177187
177850
|
const usage = "Usage: dorkos version [--check] [--json]";
|
|
@@ -177203,7 +177866,7 @@ function parseVersionArgs(rawArgs) {
|
|
|
177203
177866
|
}
|
|
177204
177867
|
function readCachedLatest(dorkHome) {
|
|
177205
177868
|
try {
|
|
177206
|
-
const raw = fs37.readFileSync(
|
|
177869
|
+
const raw = fs37.readFileSync(path66.join(dorkHome, "cache", "update-check.json"), "utf-8");
|
|
177207
177870
|
const cache3 = JSON.parse(raw);
|
|
177208
177871
|
return typeof cache3.latestVersion === "string" ? cache3.latestVersion : null;
|
|
177209
177872
|
} catch {
|
|
@@ -177298,11 +177961,11 @@ __export(cleanup_command_exports, {
|
|
|
177298
177961
|
});
|
|
177299
177962
|
import { confirm as confirm2 } from "@inquirer/prompts";
|
|
177300
177963
|
import fs38 from "fs";
|
|
177301
|
-
import
|
|
177964
|
+
import path67 from "path";
|
|
177302
177965
|
import http from "node:http";
|
|
177303
177966
|
function readPort(dorkHome) {
|
|
177304
177967
|
try {
|
|
177305
|
-
const raw = fs38.readFileSync(
|
|
177968
|
+
const raw = fs38.readFileSync(path67.join(dorkHome, "config.json"), "utf-8");
|
|
177306
177969
|
const config3 = JSON.parse(raw);
|
|
177307
177970
|
const port2 = config3?.server?.port;
|
|
177308
177971
|
if (typeof port2 === "number" && port2 > 0) return port2;
|
|
@@ -177329,7 +177992,7 @@ async function findProjectPaths(dbPath) {
|
|
|
177329
177992
|
const db2 = new Database3(dbPath, { readonly: true });
|
|
177330
177993
|
try {
|
|
177331
177994
|
const rows = db2.prepare("SELECT DISTINCT project_path FROM agents").all();
|
|
177332
|
-
return rows.map((r3) => r3.project_path).filter((p) => fs38.existsSync(
|
|
177995
|
+
return rows.map((r3) => r3.project_path).filter((p) => fs38.existsSync(path67.join(p, ".dork")));
|
|
177333
177996
|
} finally {
|
|
177334
177997
|
db2.close();
|
|
177335
177998
|
}
|
|
@@ -177363,7 +178026,7 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
177363
178026
|
console.log(` ${entry.padEnd(20)} (${description})`);
|
|
177364
178027
|
}
|
|
177365
178028
|
console.log("");
|
|
177366
|
-
const dbPath =
|
|
178029
|
+
const dbPath = path67.join(dorkHome, "dork.db");
|
|
177367
178030
|
const projectPaths = fs38.existsSync(dbPath) ? await findProjectPaths(dbPath) : [];
|
|
177368
178031
|
const removeGlobal = await confirm2({
|
|
177369
178032
|
message: `Remove global DorkOS data (${dorkHome})?`,
|
|
@@ -177389,7 +178052,7 @@ DorkOS server is running on port ${port2}. Stop it before running cleanup.
|
|
|
177389
178052
|
});
|
|
177390
178053
|
if (removeProjects) {
|
|
177391
178054
|
for (const p of projectPaths) {
|
|
177392
|
-
const dorkDir =
|
|
178055
|
+
const dorkDir = path67.join(p, ".dork");
|
|
177393
178056
|
fs38.rmSync(dorkDir, { recursive: true, force: true });
|
|
177394
178057
|
console.log(` Removed ${dorkDir}`);
|
|
177395
178058
|
}
|
|
@@ -177425,9 +178088,9 @@ __export(config_write_exports2, {
|
|
|
177425
178088
|
createServerConfigWriter: () => createServerConfigWriter,
|
|
177426
178089
|
writeOrExplain: () => writeOrExplain
|
|
177427
178090
|
});
|
|
177428
|
-
import
|
|
178091
|
+
import path68 from "path";
|
|
177429
178092
|
async function openAuditLog(dorkHome, level) {
|
|
177430
|
-
const logDir2 =
|
|
178093
|
+
const logDir2 = path68.join(dorkHome, "logs");
|
|
177431
178094
|
try {
|
|
177432
178095
|
const { initLogger: initLogger2 } = await Promise.resolve().then(() => (init_logger(), logger_exports));
|
|
177433
178096
|
initLogger2({ logDir: logDir2, level });
|
|
@@ -177717,10 +178380,10 @@ __export(init_wizard_exports, {
|
|
|
177717
178380
|
});
|
|
177718
178381
|
import { input as input3, select, confirm as confirm3 } from "@inquirer/prompts";
|
|
177719
178382
|
import fs39 from "fs";
|
|
177720
|
-
import
|
|
178383
|
+
import path69 from "path";
|
|
177721
178384
|
async function runInitWizard(options) {
|
|
177722
178385
|
const { yes, dorkHome, store } = options;
|
|
177723
|
-
const configPath =
|
|
178386
|
+
const configPath = path69.join(dorkHome, "config.json");
|
|
177724
178387
|
if (yes) {
|
|
177725
178388
|
store.reset();
|
|
177726
178389
|
console.log(`Config initialized with defaults at ${configPath}`);
|
|
@@ -177770,7 +178433,7 @@ async function runInitWizard(options) {
|
|
|
177770
178433
|
store.setDot("ui.theme", theme);
|
|
177771
178434
|
store.setDot("tunnel.enabled", tunnelEnabled);
|
|
177772
178435
|
if (cwd && cwd.trim() !== "") {
|
|
177773
|
-
store.setDot("server.cwd",
|
|
178436
|
+
store.setDot("server.cwd", path69.resolve(cwd));
|
|
177774
178437
|
}
|
|
177775
178438
|
console.log(`
|
|
177776
178439
|
Config saved to ${configPath}`);
|
|
@@ -177787,7 +178450,7 @@ init_check_claude();
|
|
|
177787
178450
|
init_check_core_extensions();
|
|
177788
178451
|
init_check_extension_compilation();
|
|
177789
178452
|
import os11, { networkInterfaces } from "os";
|
|
177790
|
-
import
|
|
178453
|
+
import path70 from "path";
|
|
177791
178454
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
177792
178455
|
import fs40 from "fs";
|
|
177793
178456
|
|
|
@@ -177861,9 +178524,9 @@ async function alreadyShown() {
|
|
|
177861
178524
|
}
|
|
177862
178525
|
}
|
|
177863
178526
|
async function markShown() {
|
|
177864
|
-
const
|
|
177865
|
-
await mkdir2(dirname2(
|
|
177866
|
-
await writeFile2(
|
|
178527
|
+
const path71 = getMarkerPath();
|
|
178528
|
+
await mkdir2(dirname2(path71), { recursive: true });
|
|
178529
|
+
await writeFile2(path71, JSON.stringify({ shownAt: Date.now() }));
|
|
177867
178530
|
}
|
|
177868
178531
|
async function maybeShowNewsletterTip() {
|
|
177869
178532
|
try {
|
|
@@ -178564,7 +179227,7 @@ if (nodeVersionIssue) {
|
|
|
178564
179227
|
console.error(formatDiagnostic(nodeVersionIssue));
|
|
178565
179228
|
process.exit(1);
|
|
178566
179229
|
}
|
|
178567
|
-
var __dirname2 =
|
|
179230
|
+
var __dirname2 = path70.dirname(fileURLToPath7(import.meta.url));
|
|
178568
179231
|
var knownCommands = /* @__PURE__ */ new Set([
|
|
178569
179232
|
"package",
|
|
178570
179233
|
"harness",
|
|
@@ -178718,7 +179381,7 @@ if (process.argv[2] === "community") {
|
|
|
178718
179381
|
);
|
|
178719
179382
|
Object.assign(childEnv, credentialEnv.pickCommunityCredentialEnv(rawProcessEnv));
|
|
178720
179383
|
const exitCode = await dispatcher.runCommunityDispatcher(process.argv.slice(3), {
|
|
178721
|
-
cliVersion: "0.126.
|
|
179384
|
+
cliVersion: "0.126.2",
|
|
178722
179385
|
dorkHome: DORK_HOME,
|
|
178723
179386
|
processEnv: childEnv,
|
|
178724
179387
|
parseRelease: (bytes) => releaseContract.parseCompatibleCommunityReleaseManifest(
|
|
@@ -178736,7 +179399,7 @@ if (process.argv[2] === "community") {
|
|
|
178736
179399
|
process.exit(1);
|
|
178737
179400
|
}
|
|
178738
179401
|
}
|
|
178739
|
-
var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.126.
|
|
179402
|
+
var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.126.2" });
|
|
178740
179403
|
var uninstallCliErrorHandlers = cliErrorReporter ? installCliErrorHandlers(cliErrorReporter) : void 0;
|
|
178741
179404
|
if (process.argv[2] === "doctor") {
|
|
178742
179405
|
process.env.DORK_HOME = DORK_HOME;
|
|
@@ -178746,7 +179409,7 @@ if (process.argv[2] === "doctor") {
|
|
|
178746
179409
|
if (process.argv[2] === "feedback") {
|
|
178747
179410
|
process.env.DORK_HOME = DORK_HOME;
|
|
178748
179411
|
const { runFeedback: runFeedback2 } = await Promise.resolve().then(() => (init_feedback2(), feedback_exports));
|
|
178749
|
-
process.exit(await runFeedback2(DORK_HOME, "0.126.
|
|
179412
|
+
process.exit(await runFeedback2(DORK_HOME, "0.126.2", process.argv.slice(3)));
|
|
178750
179413
|
}
|
|
178751
179414
|
if (process.argv[2] === "auth") {
|
|
178752
179415
|
process.env.DORK_HOME = DORK_HOME;
|
|
@@ -178845,7 +179508,7 @@ if (process.argv[2] === "agent" || process.argv[2] === "task" || process.argv[2]
|
|
|
178845
179508
|
}
|
|
178846
179509
|
}
|
|
178847
179510
|
const { runVersionDispatcher: runVersionDispatcher2 } = await Promise.resolve().then(() => (init_version5(), version_exports));
|
|
178848
|
-
process.exit(await runVersionDispatcher2("0.126.
|
|
179511
|
+
process.exit(await runVersionDispatcher2("0.126.2", DORK_HOME, subArgs));
|
|
178849
179512
|
}
|
|
178850
179513
|
var { values, positionals } = parseCliArgs();
|
|
178851
179514
|
if (positionals[0] && !knownCommands.has(positionals[0])) {
|
|
@@ -178939,14 +179602,14 @@ Examples:
|
|
|
178939
179602
|
process.exit(0);
|
|
178940
179603
|
}
|
|
178941
179604
|
if (values.version) {
|
|
178942
|
-
console.log("0.126.
|
|
179605
|
+
console.log("0.126.2");
|
|
178943
179606
|
process.exit(0);
|
|
178944
179607
|
}
|
|
178945
179608
|
if (values["post-install-check"]) {
|
|
178946
179609
|
const claudeFound = checkClaude();
|
|
178947
179610
|
const coreExtensionsFound = checkCoreExtensions();
|
|
178948
179611
|
const extensionsCompile = await checkExtensionCompilation();
|
|
178949
|
-
console.log(`dorkos ${"0.126.
|
|
179612
|
+
console.log(`dorkos ${"0.126.2"}`);
|
|
178950
179613
|
if (!coreExtensionsFound) {
|
|
178951
179614
|
console.log("Installation incomplete \u2014 bundled core extensions are missing.");
|
|
178952
179615
|
}
|
|
@@ -179023,7 +179686,7 @@ if (cliPort) {
|
|
|
179023
179686
|
process.env.DORKOS_PORT = configPort ? String(configPort) : String(DEFAULT_PORT);
|
|
179024
179687
|
}
|
|
179025
179688
|
process.env.NODE_ENV = "production";
|
|
179026
|
-
process.env.CLIENT_DIST_PATH =
|
|
179689
|
+
process.env.CLIENT_DIST_PATH = path70.join(__dirname2, "../client");
|
|
179027
179690
|
if (values.tunnel) process.env.TUNNEL_ENABLED = "true";
|
|
179028
179691
|
var tunnelAuthtoken = cfgMgr.getDot("tunnel.authtoken");
|
|
179029
179692
|
if (tunnelAuthtoken && !process.env.NGROK_AUTHTOKEN) {
|
|
@@ -179056,18 +179719,18 @@ if (values.open !== void 0) {
|
|
|
179056
179719
|
}
|
|
179057
179720
|
var cliDir = values.dir;
|
|
179058
179721
|
if (cliDir) {
|
|
179059
|
-
process.env.DORKOS_DEFAULT_CWD =
|
|
179722
|
+
process.env.DORKOS_DEFAULT_CWD = path70.resolve(cliDir);
|
|
179060
179723
|
} else if (!process.env.DORKOS_DEFAULT_CWD) {
|
|
179061
179724
|
const configCwd = cfgMgr.getDot("server.cwd");
|
|
179062
|
-
process.env.DORKOS_DEFAULT_CWD = configCwd ?
|
|
179725
|
+
process.env.DORKOS_DEFAULT_CWD = configCwd ? path70.resolve(configCwd) : process.cwd();
|
|
179063
179726
|
}
|
|
179064
179727
|
var cliBoundary = values.boundary;
|
|
179065
179728
|
if (cliBoundary) {
|
|
179066
|
-
process.env.DORKOS_BOUNDARY =
|
|
179729
|
+
process.env.DORKOS_BOUNDARY = path70.resolve(cliBoundary);
|
|
179067
179730
|
} else if (!process.env.DORKOS_BOUNDARY) {
|
|
179068
179731
|
const configBoundary = cfgMgr.getDot("server.boundary");
|
|
179069
179732
|
if (configBoundary) {
|
|
179070
|
-
process.env.DORKOS_BOUNDARY =
|
|
179733
|
+
process.env.DORKOS_BOUNDARY = path70.resolve(configBoundary);
|
|
179071
179734
|
}
|
|
179072
179735
|
}
|
|
179073
179736
|
var boundaryVal = process.env.DORKOS_BOUNDARY;
|
|
@@ -179079,7 +179742,7 @@ if (boundaryVal) {
|
|
|
179079
179742
|
}
|
|
179080
179743
|
var effectiveBoundary = process.env.DORKOS_BOUNDARY || home;
|
|
179081
179744
|
var resolvedDir = process.env.DORKOS_DEFAULT_CWD;
|
|
179082
|
-
if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary +
|
|
179745
|
+
if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary + path70.sep)) {
|
|
179083
179746
|
console.warn(
|
|
179084
179747
|
`[Warning] Default CWD "${resolvedDir}" is outside boundary "${effectiveBoundary}". Falling back to boundary root.`
|
|
179085
179748
|
);
|
|
@@ -179087,14 +179750,14 @@ if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBounda
|
|
|
179087
179750
|
}
|
|
179088
179751
|
var logLevelName = values["log-level"] || env4.LOG_LEVEL || cfgMgr.getDot("logging.level") || (env4.NODE_ENV === "production" ? "info" : "debug");
|
|
179089
179752
|
process.env.DORKOS_LOG_LEVEL = String(LOG_LEVEL_MAP[logLevelName] ?? 3);
|
|
179090
|
-
var envPath =
|
|
179753
|
+
var envPath = path70.join(process.env.DORKOS_DEFAULT_CWD, ".env");
|
|
179091
179754
|
if (fs40.existsSync(envPath)) {
|
|
179092
179755
|
const dotenv = await import("dotenv");
|
|
179093
179756
|
dotenv.config({ path: envPath, override: false });
|
|
179094
179757
|
}
|
|
179095
179758
|
uninstallCliErrorHandlers?.();
|
|
179096
179759
|
process.env.DORKOS_CLI_ENTRYPOINT = fileURLToPath7(import.meta.url);
|
|
179097
|
-
process.env.DORKOS_CLI_VERSION = "0.126.
|
|
179760
|
+
process.env.DORKOS_CLI_VERSION = "0.126.2";
|
|
179098
179761
|
var server;
|
|
179099
179762
|
try {
|
|
179100
179763
|
server = await import("../server/index.js");
|
|
@@ -179119,7 +179782,7 @@ var ansiReset = "\x1B[0m";
|
|
|
179119
179782
|
console.log("");
|
|
179120
179783
|
console.log(`${purple}${logo}${ansiReset}`);
|
|
179121
179784
|
console.log("");
|
|
179122
|
-
console.log(` DorkOS v${"0.126.
|
|
179785
|
+
console.log(` DorkOS v${"0.126.2"}`);
|
|
179123
179786
|
console.log(` Local: ${link(localUrl, localUrl)}`);
|
|
179124
179787
|
var nets = networkInterfaces();
|
|
179125
179788
|
var networkUrl = null;
|
|
@@ -179145,9 +179808,9 @@ if (shouldOpenBrowser && process.stdin.isTTY) {
|
|
|
179145
179808
|
const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
179146
179809
|
exec(`${openCmd} ${localUrl}`);
|
|
179147
179810
|
}
|
|
179148
|
-
checkForUpdate("0.126.
|
|
179811
|
+
checkForUpdate("0.126.2").then((latestVersion) => {
|
|
179149
179812
|
if (latestVersion) {
|
|
179150
|
-
const msg = `Update available: ${"0.126.
|
|
179813
|
+
const msg = `Update available: ${"0.126.2"} \u2192 ${latestVersion}`;
|
|
179151
179814
|
const cmd = "Run npm install -g dorkos@latest to update";
|
|
179152
179815
|
const width = Math.max(msg.length, cmd.length) + 6;
|
|
179153
179816
|
const pad2 = (s2) => `\u2502 ${s2}${" ".repeat(width - s2.length - 6)} \u2502`;
|