@openscout/scout 0.2.92 → 0.2.95
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/NOTICE +14 -0
- package/README.md +164 -348
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/ActivityScreen--eANwuxa.js +1 -0
- package/dist/client/assets/{AddProjectForm-CpyytDf2.js → AddProjectForm-CcD6qvV8.js} +1 -1
- package/dist/client/assets/AgentAvatar-CYhf6twS.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-BTI24HQX.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-srmN6-vj.js +1 -0
- package/dist/client/assets/{AgentDetailCard-BTiOmh-a.js → AgentDetailCard-UqPNpcvB.js} +1 -1
- package/dist/client/assets/AgentFloorView-XXNgI5Cj.js +1 -0
- package/dist/client/assets/AgentInfoScreen-CimdOnZ9.js +1 -0
- package/dist/client/assets/{AgentLaneCard-lfRNb7JD.js → AgentLaneCard-Z-aOBR3W.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-Dlwrbq3g.js → AgentLaneChrome-CyhA1reW.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-BNzjMjIH.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-6SOEWUnr.js → AgentLaneSummaryResize-Box8-_rS.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-BmLnN4on.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-C3uOiOzd.js → AgentLanesPreflight-5B6sXvRB.js} +1 -1
- package/dist/client/assets/AgentLanesView-DHyzVBk6.js +2 -0
- package/dist/client/assets/{AgentLiveActions-BJ5dIfL3.js → AgentLiveActions-BwuzOE8h.js} +1 -1
- package/dist/client/assets/AgentSessions-CsZwoukw.js +6 -0
- package/dist/client/assets/AgentsConsole-KCao4XmX.js +1 -0
- package/dist/client/assets/AgentsScreen-CtPAmwRX.js +1 -0
- package/dist/client/assets/AgentsSubnav-CDMjKeYC.js +1 -0
- package/dist/client/assets/AstronautSuit-Ckx7lu7G.js +1 -0
- package/dist/client/assets/AtopView-DYlpgEHf.js +1 -0
- package/dist/client/assets/{BackToPicker-D1LV6Cqp.js → BackToPicker-4JaeRvDm.js} +1 -1
- package/dist/client/assets/BriefingDetailScreen-D6-xqrpo.js +1 -0
- package/dist/client/assets/BriefingsScreen-DKxSDEmk.js +1 -0
- package/dist/client/assets/{BrokerMetadataPanel-BhjECqOK.js → BrokerMetadataPanel-BbREmsbK.js} +1 -1
- package/dist/client/assets/BrokerScreen-fbPIouMw.js +5 -0
- package/dist/client/assets/CastPicker-BcA2vDDV.js +1 -0
- package/dist/client/assets/CastPicker-zXsnkTIy.css +1 -0
- package/dist/client/assets/ChatCollapsedStrip-Ycm0ecaX.js +1 -0
- package/dist/client/assets/{CodeDiffPane-Bx_2VAzv.js → CodeDiffPane-Cn8Y9hAt.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-C1yOJKvs.js → CodeProjectPicker-nPFktrco.js} +1 -1
- package/dist/client/assets/CodeScreen-BlAxtxE5.js +1 -0
- package/dist/client/assets/ConversationComposer-2HjbGPL9.js +1 -0
- package/dist/client/assets/ConversationFeedRows-C6wUqJrx.js +1 -0
- package/dist/client/assets/ConversationHeader-C8vfXaTF.js +1 -0
- package/dist/client/assets/ConversationPanels-CNCIbpqU.js +6 -0
- package/dist/client/assets/ConversationScreen-BNULZAp2.js +2 -0
- package/dist/client/assets/ConversationScreen-CkWnKXt6.css +1 -0
- package/dist/client/assets/ConversationStatus-DZuyKsWN.js +1 -0
- package/dist/client/assets/CrewAvatar-CTIuxp4G.js +1 -0
- package/dist/client/assets/CrewAvatar-D0c9z5Qr.css +1 -0
- package/dist/client/assets/CrewWorkspaces-CJhBKVoZ.css +1 -0
- package/dist/client/assets/CrewWorkspaces-CkPYIA46.js +1 -0
- package/dist/client/assets/{DataTable-CJbbgBdA.js → DataTable-6IDhanr5.js} +1 -1
- package/dist/client/assets/DispatchAftermath-DC1u9itO.js +1 -0
- package/dist/client/assets/DocumentFocusViewer-DZVhS7as.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-BdsYRDky.js → EmbeddableSurfacesLab-BKUFJMCV.js} +1 -1
- package/dist/client/assets/{EmptyState-BRY5jTpz.js → EmptyState-CeBl0iGd.js} +1 -1
- package/dist/client/assets/{FileViewerPane-9Bveqm9c.js → FileViewerPane-DQlpNt2S.js} +2 -2
- package/dist/client/assets/FlightObserveScreen-CDWGSKZg.js +1 -0
- package/dist/client/assets/FollowScreen-BXHOp3gb.js +1 -0
- package/dist/client/assets/{HarnessMark-BPAphNjx.js → HarnessMark-D5CA5uSp.js} +1 -1
- package/dist/client/assets/HarnessesScreen-DhFXq1qz.js +1 -0
- package/dist/client/assets/{HerdrSession-BujfGzrP.js → HerdrSession-BRhs5LIR.js} +1 -1
- package/dist/client/assets/HomeHero-7JwycwFY.css +1 -0
- package/dist/client/assets/HomeHero-DMABJuze.js +1 -0
- package/dist/client/assets/HostAdvisorView-RAociATV.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-B4ZY24xE.js → KnowledgeSearchInspector-CZPyVNSw.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-mGTKIg00.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-B7KdvQvf.js → LaneToolHoverCard-D_DMlBeT.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-BEHg3LmH.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-mkMw2wJU.js → LaneTraceEventFocus-DVimcizS.js} +1 -1
- package/dist/client/assets/{MeshCanvas-CpKcWxKy.js → MeshCanvas-BOuZx4AM.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-C9IoGHbe.js → MeshCanvasMinimap-wL-1N94e.js} +1 -1
- package/dist/client/assets/MeshScreen-DMY9Bmh5.js +1 -0
- package/dist/client/assets/{MeshTopologyView-DFzr0IZM.js → MeshTopologyView-DiDcX5f4.js} +2 -2
- package/dist/client/assets/MessagesScreen-Eulveud3.js +1 -0
- package/dist/client/assets/{MissionContextRail-Y8QxUZGE.js → MissionContextRail-DrNKXG5u.js} +1 -1
- package/dist/client/assets/MissionControlView-ByBlHVN8.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-D1i6R6Zt.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-DN9NcCML.js +1 -0
- package/dist/client/assets/MissionLogPane-DSeIv3Xo.js +1 -0
- package/dist/client/assets/NewAgentModal-V7yK6J6j.js +1 -0
- package/dist/client/assets/NewChatComposer-hlWT-nbR.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DmuJ32wa.js → NewChatOrigin-DdpzE4kz.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-l_Q3ts2q.js +2 -0
- package/dist/client/assets/ObserveTextFlow-BSEtYTxU.js +2 -0
- package/dist/client/assets/ObservedTopologyPanel-CdGUXxGR.js +2 -0
- package/dist/client/assets/OpenScoutAppShell-DN8dOSK4.js +79 -0
- package/dist/client/assets/OpsAgentsView-ntGr4pz4.js +1 -0
- package/dist/client/assets/OpsScreen-Ppen_Lmj.js +1 -0
- package/dist/client/assets/OpsSubnav-GAKsoSor.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-BLlp2e6t.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-BLVg5EeA.js → ProjectAgentProfileBar-BQET-qrY.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-Ck8mThtx.js +1 -0
- package/dist/client/assets/ProjectsInbox-Dlt8OQ8O.js +2 -0
- package/dist/client/assets/ProjectsRail-DCfNMmnW.js +1 -0
- package/dist/client/assets/ProjectsScreen-BP-hmI1m.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-CWpMjGIH.js +1 -0
- package/dist/client/assets/Provider-B2xuo3rf.js +1 -0
- package/dist/client/assets/RailRow-B-GycCBx.js +1 -0
- package/dist/client/assets/RailRow-B0sRaJc6.css +1 -0
- package/dist/client/assets/RawSessionsTable-AQThi6sm.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-D7zZHK_t.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-BCDXFE3D.js → RepoDiffEmbedScreen-DXWoRF_c.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-m62FiWXC.js → RepoDiffPageScreen-D_274ExO.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-DbedmHDX.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-C0--fPtk.js +2 -0
- package/dist/client/assets/ReposScreen-D39_YG4H.js +6 -0
- package/dist/client/assets/ScoutDeckSurface-CKT3qdqY.js +1 -0
- package/dist/client/assets/{ScoutSurface-CkgT7A-c.js → ScoutSurface-UsRy0t-I.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-D-kV5j4T.js → ScoutbotFxLab-Fmdfboxs.js} +1 -1
- package/dist/client/assets/{SecondaryNav-_wyKjwNf.js → SecondaryNav-o2RL9H8H.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-CJZmIBV7.js → SessionEmbedScreen-RD5XOx7R.js} +1 -1
- package/dist/client/assets/{SessionObserve-yYA8Gy5s.js → SessionObserve-Dsd0j05N.js} +9 -9
- package/dist/client/assets/{SessionObserveEvidence-cHdjYOJe.js → SessionObserveEvidence-DopQYDkD.js} +1 -1
- package/dist/client/assets/SessionRefScreen-B_cTv47v.js +1 -0
- package/dist/client/assets/SessionsScreen-Bq0Z77On.js +1 -0
- package/dist/client/assets/SettingsDrawer-R8a0TlJD.css +1 -0
- package/dist/client/assets/SettingsDrawer-_AwuopMS.js +3 -0
- package/dist/client/assets/SettingsScreen-Cw4DDfJP.js +1 -0
- package/dist/client/assets/{ShikiPane-dBS9hD-z.js → ShikiPane-BfHc_3pM.js} +1 -1
- package/dist/client/assets/{SlidePanel-CH-3-8_2.js → SlidePanel-C-q7XwTa.js} +1 -1
- package/dist/client/assets/SpriteAvatar-Bs68ZENy.js +1 -0
- package/dist/client/assets/{StatusPill-C8m9ZymF.js → StatusPill-ZZQwxB1a.js} +1 -1
- package/dist/client/assets/{TailView-B0BSopPs.js → TailView-Q4FVMsUH.js} +2 -2
- package/dist/client/assets/Terminal-D7zqHwHV.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-CXIJ7qv6.js +1 -0
- package/dist/client/assets/TerminalHeaderMount-BnBLOPbb.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-BWJCGBZf.js → TextDocumentSurface-CKQP-cBT.js} +1 -1
- package/dist/client/assets/{TmuxPeek-B4QdHbGm.js → TmuxPeek-V9dGESfO.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-Dd4ITJy_.js → VoicePermissionsPanel-k7sbLXx2.js} +1 -1
- package/dist/client/assets/WorkDetailScreen-60p9litn.js +5 -0
- package/dist/client/assets/WorkFilesViewer-BjJS7GyM.js +1 -0
- package/dist/client/assets/{activity-CC8JzJNH.js → activity-Bj3Hnbj3.js} +1 -1
- package/dist/client/assets/{addon-fit-CaZ-uLrg.js → addon-fit-BL-NTWRU.js} +1 -1
- package/dist/client/assets/{addon-webgl-B8utL3bM.js → addon-webgl-CIMgmNjg.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-CxtYZWPZ.css → agent-autocomplete-C7xwIcwd.css} +1 -1
- package/dist/client/assets/agent-autocomplete-DXlvdc4b.js +10 -0
- package/dist/client/assets/{agent-essentials-B3wcxg_v.js → agent-essentials-BOMHR0_U.js} +1 -1
- package/dist/client/assets/{agent-lane-card-model-q4cwzLX4.js → agent-lane-card-model-CTLxf3R4.js} +1 -1
- package/dist/client/assets/agent-lane-detail-ppJId6Jc.js +2 -0
- package/dist/client/assets/{agent-lane-preview-C33Dwpn7.js → agent-lane-preview-BhplDYGf.js} +1 -1
- package/dist/client/assets/{agent-lanes-BDNktFBZ.css → agent-lanes-DlqcEf0l.css} +1 -1
- package/dist/client/assets/{agent-lanes-model-VYQ5a68i.js → agent-lanes-model-AfrjRNK5.js} +2 -2
- package/dist/client/assets/agent-specialization-BIPIBW8u.js +1 -0
- package/dist/client/assets/api-Co9aQ2Jw.js +1 -0
- package/dist/client/assets/{api-BkjHJfgJ.js → api-HFH8wFyb.js} +1 -1
- package/dist/client/assets/{arc.es-uFv9UrHn.js → arc.es-IR5r6sj_.js} +1 -1
- package/dist/client/assets/archive-BjcGiAy8.js +1 -0
- package/dist/client/assets/{arrow-down-w1HPzDSE.js → arrow-down-BydciYFZ.js} +1 -1
- package/dist/client/assets/{arrow-left-B-3GJ7ct.js → arrow-left-CghA0kTw.js} +1 -1
- package/dist/client/assets/arrow-right-iJFv3jNh.js +1 -0
- package/dist/client/assets/{arrow-up-right-G6bJXxhK.js → arrow-up-right-CCfZXPqD.js} +1 -1
- package/dist/client/assets/{bot-DzCOGKi6.js → bot-B5sub1-i.js} +1 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +2 -0
- package/dist/client/assets/{cache-Dr0why2k.js → cache-CeWH_KzJ.js} +1 -1
- package/dist/client/assets/{check-BX8nRgop.js → check-C18YQC90.js} +1 -1
- package/dist/client/assets/{chevron-down-B3VVRJcV.js → chevron-down-Mp9mu_yd.js} +1 -1
- package/dist/client/assets/{chevron-right-BYMV1511.js → chevron-right-CzH-TaSF.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-dRd2eQMJ.js → chunk-HRAB3GC3-swV8PA2k.js} +1 -1
- package/dist/client/assets/{chunk-JTPDIGGW-BjX67kHU.js → chunk-JTPDIGGW-BKXqcLKw.js} +3 -3
- package/dist/client/assets/{chunk-T65CQEWV-kP6nJjkU.js → chunk-T65CQEWV-vYbNJ8E6.js} +1 -1
- package/dist/client/assets/{chunk-YOZR3KYS-C13bZPVd.js → chunk-YOZR3KYS-U65yUmqt.js} +1 -1
- package/dist/client/assets/{clock-B9ukVaVn.js → clock-B4PTFi5m.js} +1 -1
- package/dist/client/assets/{code-xml-BFc3TMSm.js → code-xml-Jtxsp5d1.js} +1 -1
- package/dist/client/assets/collapsed-strip-raJWthAH.css +1 -0
- package/dist/client/assets/compass-0_54-vz3.js +1 -0
- package/dist/client/assets/content-6RvWTrtk.js +1 -0
- package/dist/client/assets/content-BCgwMUqz.js +1 -0
- package/dist/client/assets/content-Bf2VLhx0.js +1 -0
- package/dist/client/assets/content-BrU_38-m.js +1 -0
- package/dist/client/assets/content-BvvJN8rN.js +1 -0
- package/dist/client/assets/content-CAeEqYPw.js +1 -0
- package/dist/client/assets/content-CHghn-rT.js +1 -0
- package/dist/client/assets/{content-Uqt8AG-s.css → content-CINHz-rZ.css} +1 -1
- package/dist/client/assets/content-CI_Z9DXk.js +1 -0
- package/dist/client/assets/content-CbyKONhW.js +1 -0
- package/dist/client/assets/content-Czogvp43.js +1 -0
- package/dist/client/assets/content-DFk0zNzX.js +1 -0
- package/dist/client/assets/content-DHe4DgkA.js +1 -0
- package/dist/client/assets/content-DMbawvqU.js +1 -0
- package/dist/client/assets/content-DTz7cKjo.js +1 -0
- package/dist/client/assets/content-E3kudY-W.js +1 -0
- package/dist/client/assets/content-LpO0aO_U.js +1 -0
- package/dist/client/assets/{conversation-icons-gpsv650H.js → conversation-icons-BV10B2Me.js} +1 -1
- package/dist/client/assets/conversation-model-CwF6Y9gx.js +1 -0
- package/dist/client/assets/conversation-motion-features-BKkCRaWR.js +1 -0
- package/dist/client/assets/{copy-BFmOcWof.js → copy-Dtpx4FOE.js} +1 -1
- package/dist/client/assets/cpu-BjVis9mc.js +1 -0
- package/dist/client/assets/{createLucideIcon-CFBn0Sdk.js → createLucideIcon-DXpqZP7I.js} +1 -1
- package/dist/client/assets/credentials-BTce3VP1.js +1 -0
- package/dist/client/assets/ctx-panel-D_HJ3nhb.css +1 -0
- package/dist/client/assets/discover-CHbrEItO.js +2 -0
- package/dist/client/assets/embed-entry-vil28MyU.js +2 -0
- package/dist/client/assets/{external-link-B1TI5yIt.js → external-link-Ckiyzjwo.js} +1 -1
- package/dist/client/assets/{eye-1J4yOUoG.js → eye-CpfyvdLq.js} +1 -1
- package/dist/client/assets/file-code-corner-7mo7EviR.js +1 -0
- package/dist/client/assets/{file-text-DcYSrI4v.js → file-text-KijGBnME.js} +1 -1
- package/dist/client/assets/gauge-y-Xg8Mrv.js +1 -0
- package/dist/client/assets/gestures-Bq9XnSqY.js +1 -0
- package/dist/client/assets/git-branch-BQ_x8KZL.js +1 -0
- package/dist/client/assets/harnesses-screen-2z36fJKE.css +1 -0
- package/dist/client/assets/home-moving-signal-DMguaRWR.css +1 -0
- package/dist/client/assets/home-moving-signal-DtRpiNa0.js +1 -0
- package/dist/client/assets/home-now-card-DFb4GOgM.js +1 -0
- package/dist/client/assets/{home-now-card-nano-y1EhBvVL.js → home-now-card-nano-D--m9jpq.js} +1 -1
- package/dist/client/assets/hooks-9d1SoaQA.js +2 -0
- package/dist/client/assets/host-advisor-B2Fqs5Dd.css +1 -0
- package/dist/client/assets/index-BVlMw8x_.js +1 -0
- package/dist/client/assets/index-CZ-05hKz.js +10 -0
- package/dist/client/assets/index-Cn0GR-q1.js +1 -0
- package/dist/client/assets/index-DosI4AG9.js +1 -0
- package/dist/client/assets/index-i7TMxlwW.css +1 -0
- package/dist/client/assets/index-wLwc74Pu.css +1 -0
- package/dist/client/assets/inspector-panel-C-EhEDYy.js +2 -0
- package/dist/client/assets/{keyboard-nav-h1IdakpD.js → keyboard-nav-DFhAJkW3.js} +1 -1
- package/dist/client/assets/{lane-observe-BA3g9aVd.js → lane-observe-vfyACHi0.js} +1 -1
- package/dist/client/assets/{lane-roster-store-71vFgAem.js → lane-roster-store-gUBsydNf.js} +1 -1
- package/dist/client/assets/layers-CGou-LwV.js +1 -0
- package/dist/client/assets/layout-grid-BrZt31QH.js +1 -0
- package/dist/client/assets/left-B_o51JV6.js +1 -0
- package/dist/client/assets/left-BpgWnaah.js +1 -0
- package/dist/client/assets/left-CwHZCGO3.js +2 -0
- package/dist/client/assets/left-CwLs0okF.js +1 -0
- package/dist/client/assets/left-Cx0kv6pe.js +1 -0
- package/dist/client/assets/left-DA0amyfu.js +1 -0
- package/dist/client/assets/left-DH44V4I_.css +1 -0
- package/dist/client/assets/left-R2OOE7VG.css +1 -0
- package/dist/client/assets/left-advisor-DU3s01gk.js +1 -0
- package/dist/client/assets/left-agents-qL5PpUY-.js +1 -0
- package/dist/client/assets/left-default-uvuvDmt0.js +1 -0
- package/dist/client/assets/left-lanes-DnNLgec8.js +1 -0
- package/dist/client/assets/left-mission-DN3-NLPC.js +1 -0
- package/dist/client/assets/left-z-6CkuBe.js +2 -0
- package/dist/client/assets/library-DIo5NiGP.js +1 -0
- package/dist/client/assets/{loader-circle-d6PKL_KD.js → loader-circle-BiohlpM3.js} +1 -1
- package/dist/client/assets/{local-agents-B5pq17tZ.js → local-agents-wUIaBcEr.js} +1 -1
- package/dist/client/assets/{mentions-agCGDgyA.js → mentions-CcPFMbmZ.js} +1 -1
- package/dist/client/assets/mesh-buckets-ByyFXdKT.js +1 -0
- package/dist/client/assets/{mesh-ops-5pZCYptW.js → mesh-ops-CvGyjK84.js} +1 -1
- package/dist/client/assets/mesh-roster-n2nDpEmA.js +1 -0
- package/dist/client/assets/{mesh-screen-BSDUjrnV.css → mesh-screen-D1Yvo8fU.css} +1 -1
- package/dist/client/assets/{mesh-view-store-KJzABIkN.js → mesh-view-store-BpxGm71b.js} +1 -1
- package/dist/client/assets/{message-circle-CJO-pi7b.js → message-circle-B2ddzBrX.js} +1 -1
- package/dist/client/assets/{message-markup-CyRDLdOn.js → message-markup-RkfmDfME.js} +1 -1
- package/dist/client/assets/{message-square-D1hMsMj_.js → message-square-D9YYWE0x.js} +1 -1
- package/dist/client/assets/message-visibility-DwxgcgYK.js +1 -0
- package/dist/client/assets/mission-control-CnU7dNt1.css +1 -0
- package/dist/client/assets/{mission-control-store-Ce6dOvnZ.js → mission-control-store-Bf4b54MV.js} +1 -1
- package/dist/client/assets/{observe-BSWVM8YA.js → observe-CJRIvOCn.js} +1 -1
- package/dist/client/assets/{operator-attention-BwSPeheT.js → operator-attention-RqieiSY8.js} +1 -1
- package/dist/client/assets/{page-status-D2FQLJOX.js → page-status-BptpTdQ-.js} +1 -1
- package/dist/client/assets/{paperclip-iZmDMOS5.js → paperclip-B1UNGl5d.js} +1 -1
- package/dist/client/assets/perf-PX8Rx0EP.js +1 -0
- package/dist/client/assets/persistent-state-YI-WHSCF.js +1 -0
- package/dist/client/assets/{plus-gZ0T0eBI.js → plus-CuU_X0-8.js} +1 -1
- package/dist/client/assets/profile-rY8jO38P.js +1 -0
- package/dist/client/assets/projects-inbox-BBs1hG13.css +1 -0
- package/dist/client/assets/projects-inbox-D-zAb9Gp.js +1 -0
- package/dist/client/assets/proxy-DnLpZIi9.js +1 -0
- package/dist/client/assets/{radio-RMLfV4EO.js → radio-Dm1ItnA4.js} +1 -1
- package/dist/client/assets/{refresh-cw-C4x1x6b_.js → refresh-cw-BRn9Oxxl.js} +1 -1
- package/dist/client/assets/resolve-panes-DO6LkwhQ.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-CIF288wY.js +1 -0
- package/dist/client/assets/right-BJltPRnd.js +1 -0
- package/dist/client/assets/right-BbyYdzHn.js +1 -0
- package/dist/client/assets/right-Beh3nCUB.js +1 -0
- package/dist/client/assets/right-C1yumXNx.js +1 -0
- package/dist/client/assets/{right-D-k9Z1Fe.js → right-CJnB_Bg7.js} +2 -2
- package/dist/client/assets/right-CPP7GyOm.js +1 -0
- package/dist/client/assets/right-D3aTKf1F.js +1 -0
- package/dist/client/assets/right-DI1B79nR.js +1 -0
- package/dist/client/assets/right-DtsRNX5b.js +1 -0
- package/dist/client/assets/right-Shpw_xDy.js +1 -0
- package/dist/client/assets/{rocket-CMM-IdLy.js → rocket-DOwXHKWA.js} +1 -1
- package/dist/client/assets/router-DJj2WbDg.js +1 -0
- package/dist/client/assets/{scope-views-BIfMTXU4.js → scope-views-A4_vP97W.js} +1 -1
- package/dist/client/assets/scout-voice-BhPzrc6P.js +1 -0
- package/dist/client/assets/{scoutbot-BTIErYHo.js → scoutbot-BJIamJOH.js} +2 -2
- package/dist/client/assets/scoutbot-markdown-jh7tzFB1.js +6 -0
- package/dist/client/assets/{scroll-text-DPPYrqB9.js → scroll-text-DO0GQzvN.js} +1 -1
- package/dist/client/assets/{search-DAyagUtF.js → search-D1tJSAWe.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-B9IF8wXl.js +1 -0
- package/dist/client/assets/{selection-bridge-BXw09aRF.js → selection-bridge-i2S9zpf8.js} +1 -1
- package/dist/client/assets/{send-horizontal-IcG46D2M.js → send-horizontal-CgLppsIC.js} +1 -1
- package/dist/client/assets/{server-BySujhDV.js → server-Dymv5Emh.js} +1 -1
- package/dist/client/assets/{session-catalog-ClS9xf6i.js → session-catalog-DNaOEzoQ.js} +1 -1
- package/dist/client/assets/{session-table-BdpHs1GN.js → session-table-PTQVoTyc.js} +1 -1
- package/dist/client/assets/settings-2fC_G9nX.js +1 -0
- package/dist/client/assets/{sliders-horizontal-R5pWUUcH.js → sliders-horizontal-BPSMHhbm.js} +1 -1
- package/dist/client/assets/{sparkles-DJOBD_8l.js → sparkles-Dy8p5xN8.js} +1 -1
- package/dist/client/assets/sse-CiOSzE5n.js +1 -0
- package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +1 -0
- package/dist/client/assets/{tail-display-BRcJltQa.js → tail-display-DcliDVkW.js} +1 -1
- package/dist/client/assets/{tail-events-BdvqZHLr.js → tail-events-BMQmSx1n.js} +1 -1
- package/dist/client/assets/{terminal-relay-TffuSPGs.js → terminal-relay-9lhzEp2V.js} +1 -1
- package/dist/client/assets/terminal-screen-BLk4PAYt.css +1 -0
- package/dist/client/assets/terminal-sessions-BQ6t92tJ.js +1 -0
- package/dist/client/assets/{terminal-takeover-BOFPRPjR.js → terminal-takeover-DANQfTcy.js} +1 -1
- package/dist/client/assets/{terminal-DJPUp_Qn.js → terminal-yN9xN-h9.js} +1 -1
- package/dist/client/assets/{runtime-picker--IW3cRry.js → text-CnZ0e1-V.js} +1 -1
- package/dist/client/assets/text-rLpBg4_z.css +1 -0
- package/dist/client/assets/use-conversation-list-D9BNLfnW.js +1 -0
- package/dist/client/assets/{use-fleet-active-asks-BHzeBZSW.js → use-fleet-active-asks-BeAdcl09.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-KmaauBr_.js → use-mesh-ops-items-BIvIHlqe.js} +1 -1
- package/dist/client/assets/use-reduced-motion-CKkhq9c5.js +1 -0
- package/dist/client/assets/{use-scout-dev-flags-BJbw87PK.js → use-scout-dev-flags-B2KCzPxn.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-C6o0tlat.js → useAgentHoverCard-CHBsxcbp.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-D0mUhxTF.js +1 -0
- package/dist/client/assets/{usePierreRuntime-Cm7-qdm0.js → usePierreRuntime-DUuXH5yp.js} +1 -1
- package/dist/client/assets/{wrench-CvRjjByE.js → wrench-YcXMlsh2.js} +1 -1
- package/dist/client/assets/{x-C8ayPBtj.js → x-e3h2hDsp.js} +1 -1
- package/dist/client/assets/{xterm-B0ci4Q9a.js → xterm-Byp1Hep_.js} +1 -1
- package/dist/client/assets/zap-nMcjPoWB.js +1 -0
- package/dist/client/favicon-16.png +0 -0
- package/dist/client/favicon-32.png +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.svg +20 -47
- package/dist/client/index.html +5 -5
- package/dist/client/openscout-icon.png +0 -0
- package/dist/client/site.webmanifest +2 -2
- package/dist/client/web-app-icon-192.png +0 -0
- package/dist/client/web-app-icon-512.png +0 -0
- package/dist/main.mjs +20095 -78203
- package/dist/node/main.mjs +322 -252
- package/dist/pairing-runtime-controller.mjs +1032 -804
- package/dist/runtime/base-daemon.mjs +49 -121
- package/dist/runtime/broker-daemon.mjs +1105 -281
- package/dist/runtime/broker-process-manager.mjs +6 -0
- package/dist/runtime/mesh-discover.mjs +6 -0
- package/dist/scout-control-plane-web.mjs +3326 -1912
- package/package.json +27 -5
- package/dist/client/assets/ActivityScreen-DkUP7V7M.js +0 -1
- package/dist/client/assets/AgentAvatar-D8ZtMluU.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BlGI6fuM.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-CfaDVCVt.js +0 -1
- package/dist/client/assets/AgentFloorView-DjNLILLt.js +0 -1
- package/dist/client/assets/AgentInfoScreen-DG5dlHb_.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-BzYzBfcW.js +0 -4
- package/dist/client/assets/AgentLanesEmbedScreen-Crxx1srt.js +0 -1
- package/dist/client/assets/AgentLanesView-ChNlmY-F.js +0 -2
- package/dist/client/assets/AgentSessions-DpY0htZV.js +0 -6
- package/dist/client/assets/AgentsConsole-CHyXrjhm.js +0 -1
- package/dist/client/assets/AgentsScreen-BhCjX2lD.js +0 -1
- package/dist/client/assets/AgentsSubnav-az_VDkri.js +0 -1
- package/dist/client/assets/AtopView-BjjPM8OX.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-B7qJ90Np.js +0 -6
- package/dist/client/assets/BriefingsScreen-CW6N829d.js +0 -1
- package/dist/client/assets/BrokerScreen-X3z50712.js +0 -5
- package/dist/client/assets/ChatCollapsedStrip-DNR9osDy.js +0 -1
- package/dist/client/assets/CodeScreen-CIKK1LcZ.js +0 -1
- package/dist/client/assets/ContextMenu-CHIuVKz7.js +0 -1
- package/dist/client/assets/ConversationComposer-Bf7Ga_49.js +0 -1
- package/dist/client/assets/ConversationFeedRows-Cm1Lgo43.js +0 -1
- package/dist/client/assets/ConversationHeader-B_GXrKR0.js +0 -1
- package/dist/client/assets/ConversationPanels-BTBbEvrP.js +0 -2
- package/dist/client/assets/ConversationScreen-B3l2m3JI.js +0 -1
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +0 -1
- package/dist/client/assets/ConversationStatus-BqhUHD85.js +0 -1
- package/dist/client/assets/DispatchAftermath-BDA9CrOd.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-B9vodVmG.js +0 -1
- package/dist/client/assets/FleetSearch-Bj9SCl2f.js +0 -1
- package/dist/client/assets/FleetSearch-EXOe8ulE.css +0 -1
- package/dist/client/assets/FlightObserveScreen-BVMdsiCC.js +0 -1
- package/dist/client/assets/FollowScreen-BifwHWOV.js +0 -1
- package/dist/client/assets/HarnessesScreen-fMnbnrD4.js +0 -1
- package/dist/client/assets/HomeHero-BgM6S39l.js +0 -1
- package/dist/client/assets/HomeHero-DEl-WBsT.css +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-Ch_WENUC.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-H3AnN-vN.js +0 -1
- package/dist/client/assets/MeshScreen-48QkJSDI.js +0 -1
- package/dist/client/assets/MessageComposerSuggestions-FdVHnT_q.js +0 -1
- package/dist/client/assets/MessagesScreen-BMOOfbWX.js +0 -1
- package/dist/client/assets/MissionControlView-BpsHKu1F.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-BPnAEA3F.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-iOZ6ds9L.js +0 -1
- package/dist/client/assets/MissionLogPane-B0csI89E.js +0 -1
- package/dist/client/assets/NewAgentModal-DBHJR9Qm.js +0 -1
- package/dist/client/assets/NewChatComposer-Hd7pI5Ac.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-DyArn7Id.js +0 -2
- package/dist/client/assets/ObserveTextFlow-CkMrtT8s.js +0 -2
- package/dist/client/assets/ObservedTopologyPanel-CaSZZP05.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-BtlKkiuF.js +0 -87
- package/dist/client/assets/OpsAgentsView-CnqrwbC2.js +0 -1
- package/dist/client/assets/OpsScreen-DOlmlVkP.js +0 -1
- package/dist/client/assets/OpsSubnav-Dj3ShAKv.js +0 -1
- package/dist/client/assets/PlanView-BLGdWDx6.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-Dv1sVnQl.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-0-GDhsPT.js +0 -1
- package/dist/client/assets/ProjectsInbox-B3DpAI5b.js +0 -2
- package/dist/client/assets/ProjectsRail-BDl7U9Jq.js +0 -1
- package/dist/client/assets/ProjectsScreen-Dl2FcGrR.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BcGC5mHE.js +0 -1
- package/dist/client/assets/Provider-cJCdHAxu.js +0 -1
- package/dist/client/assets/RailRow-CLcVmywd.js +0 -1
- package/dist/client/assets/RailRow-Cf9LOiEj.css +0 -1
- package/dist/client/assets/RawSessionsTable-DBto4Ts-.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-DXEU5v3g.js +0 -1
- package/dist/client/assets/RepoDiffViewer-PaNeZMhJ.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-CWE5GxMP.js +0 -2
- package/dist/client/assets/ReposScreen-Cksv1cAD.js +0 -6
- package/dist/client/assets/ScoutDeckSurface-BCjPl7C4.js +0 -1
- package/dist/client/assets/ScoutbotBroadcastChip-DkiRCHuK.js +0 -2
- package/dist/client/assets/ScoutbotRealtimeVoiceCall-1ixiEn1L.js +0 -1
- package/dist/client/assets/SessionRefScreen-OkTY7Szg.js +0 -1
- package/dist/client/assets/SessionsScreen-B-GFjxIA.js +0 -1
- package/dist/client/assets/SettingsDrawer-Co11RFX0.js +0 -3
- package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +0 -1
- package/dist/client/assets/SettingsScreen-Cn09nq5_.js +0 -1
- package/dist/client/assets/SpriteAvatar-DS6Tmyua.js +0 -1
- package/dist/client/assets/Terminal-U8gjIdm3.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-CTmdE7us.js +0 -1
- package/dist/client/assets/WorkDetailScreen-mJs0mb99.js +0 -5
- package/dist/client/assets/WorkFilesViewer-ODzLXKxj.js +0 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +0 -1
- package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +0 -2
- package/dist/client/assets/api-h5zurxmi.js +0 -1
- package/dist/client/assets/broker-display-pp33bLsu.js +0 -2
- package/dist/client/assets/collapsed-strip-Dz-of2SM.css +0 -1
- package/dist/client/assets/content-B8gahuBy.js +0 -1
- package/dist/client/assets/content-BIqX06OQ.js +0 -1
- package/dist/client/assets/content-BKDZ6Fxe.js +0 -1
- package/dist/client/assets/content-C15Ya-iu.js +0 -1
- package/dist/client/assets/content-CDE9tJDF.js +0 -1
- package/dist/client/assets/content-CSAfI-PX.js +0 -1
- package/dist/client/assets/content-CTF9D60D.js +0 -1
- package/dist/client/assets/content-CbAGkYQO.js +0 -1
- package/dist/client/assets/content-CtqLJOVp.js +0 -1
- package/dist/client/assets/content-Dvs1KRfo.js +0 -1
- package/dist/client/assets/content-DyJdVZjI.js +0 -1
- package/dist/client/assets/content-Ji7ATaf7.js +0 -1
- package/dist/client/assets/content-eqZXKWcP.js +0 -1
- package/dist/client/assets/content-iyyQKwvA.js +0 -1
- package/dist/client/assets/content-pDE7Fpb9.js +0 -1
- package/dist/client/assets/content-pPSd2dua.js +0 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +0 -1
- package/dist/client/assets/conversation-motion-features-DXtKlmuM.js +0 -1
- package/dist/client/assets/ctx-panel-B4s49N9e.css +0 -1
- package/dist/client/assets/discover-DKf0aTr_.js +0 -2
- package/dist/client/assets/embed-entry-RlQUTtc4.js +0 -2
- package/dist/client/assets/gestures-CcEOV6Sr.js +0 -1
- package/dist/client/assets/harnesses-screen-DBZoTZz8.css +0 -1
- package/dist/client/assets/home-moving-signal-Bh2FugbH.js +0 -1
- package/dist/client/assets/home-moving-signal-CAa0V91u.css +0 -1
- package/dist/client/assets/home-now-card-ByRH5fFx.js +0 -1
- package/dist/client/assets/hooks-DUZwL3Aq.js +0 -2
- package/dist/client/assets/index-BBznYVWk.css +0 -1
- package/dist/client/assets/index-BTuq-8Iv.js +0 -1
- package/dist/client/assets/index-CmwGCxUk.js +0 -1
- package/dist/client/assets/index-CvF09yvf.css +0 -1
- package/dist/client/assets/index-DmFAhGPj.js +0 -10
- package/dist/client/assets/index-Dtaswdsh.js +0 -1
- package/dist/client/assets/inspector-panel-DzgS5_Mv.js +0 -2
- package/dist/client/assets/left-8NITBvFX.js +0 -1
- package/dist/client/assets/left-B2HEqrTM.js +0 -2
- package/dist/client/assets/left-Bk3XnxPD.css +0 -1
- package/dist/client/assets/left-CCoobxPS.css +0 -1
- package/dist/client/assets/left-CTYUvXbe.js +0 -1
- package/dist/client/assets/left-CwDRT50z.js +0 -2
- package/dist/client/assets/left-CxlDLJlw.js +0 -1
- package/dist/client/assets/left-XFXxNd4g.js +0 -1
- package/dist/client/assets/left-agents-Ck4Xn-R8.js +0 -1
- package/dist/client/assets/left-default-BeOyS0bR.js +0 -1
- package/dist/client/assets/left-lanes-DZp3jJMo.js +0 -1
- package/dist/client/assets/left-mission-CuKFQ5xL.js +0 -1
- package/dist/client/assets/left-p1hkO6P0.js +0 -1
- package/dist/client/assets/left-plan-3rrFENhp.js +0 -2
- package/dist/client/assets/library-E--gKzEZ.js +0 -1
- package/dist/client/assets/mesh-buckets-CfAukILK.js +0 -1
- package/dist/client/assets/message-visibility-kJM8XcSG.js +0 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +0 -1
- package/dist/client/assets/model-Co0zkMIc.js +0 -1
- package/dist/client/assets/plan-view-D56fneVF.css +0 -1
- package/dist/client/assets/profile-Dxj3VVOM.js +0 -1
- package/dist/client/assets/projects-inbox-COZ23dLR.css +0 -1
- package/dist/client/assets/projects-inbox-Dzt_GQDv.js +0 -1
- package/dist/client/assets/resolve-panes-C9gF0w4e.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-DxbY5RCH.js +0 -1
- package/dist/client/assets/right-5L7Tn0zG.js +0 -1
- package/dist/client/assets/right-CYtkMmRu.js +0 -1
- package/dist/client/assets/right-CreoQzPP.js +0 -1
- package/dist/client/assets/right-D9xFfy2b.js +0 -1
- package/dist/client/assets/right-DI7zHADe.js +0 -1
- package/dist/client/assets/right-DUbJ3WVc.js +0 -1
- package/dist/client/assets/right-DiybhsiK.js +0 -1
- package/dist/client/assets/right-Jh_1Q88s.js +0 -1
- package/dist/client/assets/right-udr1qTJG.js +0 -1
- package/dist/client/assets/router-Cn_s9IGH.js +0 -1
- package/dist/client/assets/runtime-picker-vhm0gtLs.css +0 -1
- package/dist/client/assets/scout-voice-CwbOz6EN.js +0 -1
- package/dist/client/assets/secondaryNavConfig-Dw3gS1jR.js +0 -1
- package/dist/client/assets/sse-CxXt4tqI.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +0 -1
- package/dist/client/assets/terminal-screen-BqVnCwl0.css +0 -1
- package/dist/client/assets/terminal-sessions-AmSgHklm.js +0 -1
- package/dist/client/assets/text-DsBWV_4k.js +0 -1
- package/dist/client/assets/use-conversation-list-C-dPcjQe.js +0 -1
- package/dist/client/assets/use-reduced-motion-CYqhYqHO.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-DjHBrgnS.js +0 -1
- package/dist/highlights-eq9cgrbb.scm +0 -604
- package/dist/highlights-ghv9g403.scm +0 -205
- package/dist/highlights-hk7bwhj4.scm +0 -284
- package/dist/highlights-r812a2qc.scm +0 -150
- package/dist/highlights-x6tmsnaa.scm +0 -115
- package/dist/injections-73j83es3.scm +0 -27
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- /package/dist/client/assets/{document-focus-viewer-BSC_JwVE.css → DocumentFocusViewer-BSC_JwVE.css} +0 -0
|
@@ -123,28 +123,236 @@ function ensureOpenScoutCleanSlateSync() {
|
|
|
123
123
|
var OPENSCOUT_RPC_CUTOVER_MARKER = "rpc-runtime-cutover-v1";
|
|
124
124
|
var init_support_paths = () => {};
|
|
125
125
|
|
|
126
|
-
// ../runtime/src/
|
|
126
|
+
// ../runtime/src/node-identity.ts
|
|
127
|
+
import {
|
|
128
|
+
createHash,
|
|
129
|
+
createPrivateKey,
|
|
130
|
+
createPublicKey,
|
|
131
|
+
generateKeyPairSync,
|
|
132
|
+
randomBytes,
|
|
133
|
+
sign,
|
|
134
|
+
verify
|
|
135
|
+
} from "crypto";
|
|
127
136
|
import {
|
|
137
|
+
chmodSync,
|
|
128
138
|
existsSync as existsSync2,
|
|
129
139
|
mkdirSync as mkdirSync2,
|
|
130
140
|
readFileSync,
|
|
131
141
|
renameSync,
|
|
142
|
+
rmSync as rmSync2,
|
|
132
143
|
writeFileSync as writeFileSync2
|
|
133
144
|
} from "fs";
|
|
134
|
-
import { homedir as homedir2, hostname as osHostname } from "os";
|
|
135
145
|
import { dirname, join as join2 } from "path";
|
|
146
|
+
function stripBonjourCollisionSuffix(value) {
|
|
147
|
+
if (!value || typeof value !== "string")
|
|
148
|
+
return "";
|
|
149
|
+
let trimmed = value.trim();
|
|
150
|
+
const isDotLocal = /\.local\.?$/i.test(trimmed);
|
|
151
|
+
if (isDotLocal) {
|
|
152
|
+
trimmed = trimmed.replace(/\.local\.?$/i, "");
|
|
153
|
+
}
|
|
154
|
+
const isHyphenLocalOpenscout = /-local-openscout$/i.test(trimmed);
|
|
155
|
+
const isHyphenLocal = !isHyphenLocalOpenscout && /-local$/i.test(trimmed);
|
|
156
|
+
if (isHyphenLocalOpenscout) {
|
|
157
|
+
trimmed = trimmed.replace(/-local-openscout$/i, "");
|
|
158
|
+
} else if (isHyphenLocal) {
|
|
159
|
+
trimmed = trimmed.replace(/-local$/i, "");
|
|
160
|
+
}
|
|
161
|
+
if (!isDotLocal && !isHyphenLocalOpenscout && !isHyphenLocal) {
|
|
162
|
+
return trimmed;
|
|
163
|
+
}
|
|
164
|
+
trimmed = trimmed.replace(/(?<=[a-zA-Z].*?)(?:-\d+)+$/, "");
|
|
165
|
+
if (isDotLocal)
|
|
166
|
+
return `${trimmed}.local`;
|
|
167
|
+
if (isHyphenLocalOpenscout)
|
|
168
|
+
return `${trimmed}-local-openscout`;
|
|
169
|
+
if (isHyphenLocal)
|
|
170
|
+
return `${trimmed}-local`;
|
|
171
|
+
return trimmed;
|
|
172
|
+
}
|
|
173
|
+
function nodeIdentityPath(supportDirectory) {
|
|
174
|
+
const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
|
|
175
|
+
return join2(dir, NODE_IDENTITY_FILE);
|
|
176
|
+
}
|
|
177
|
+
function loadOrCreateNodeIdentity(supportDirectory) {
|
|
178
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
179
|
+
if (existsSync2(path)) {
|
|
180
|
+
return readAndValidateNodeIdentity(path);
|
|
181
|
+
}
|
|
182
|
+
return createNodeIdentity(supportDirectory);
|
|
183
|
+
}
|
|
184
|
+
function readStableNodeQualifier(supportDirectory) {
|
|
185
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
186
|
+
const cached = stableNodeQualifierCache.get(path);
|
|
187
|
+
if (cached) {
|
|
188
|
+
return cached;
|
|
189
|
+
}
|
|
190
|
+
if (!existsSync2(path)) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
const nodeQualifier = normalizeNodeQualifier(readAndValidateNodeIdentity(path).nodeQualifier);
|
|
194
|
+
if (nodeQualifier) {
|
|
195
|
+
stableNodeQualifierCache.set(path, nodeQualifier);
|
|
196
|
+
}
|
|
197
|
+
return nodeQualifier || null;
|
|
198
|
+
}
|
|
199
|
+
function readAndValidateNodeIdentity(path) {
|
|
200
|
+
let parsed;
|
|
201
|
+
try {
|
|
202
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
203
|
+
} catch {
|
|
204
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
205
|
+
}
|
|
206
|
+
if (parsed.version !== 1 || !parsed.publicKey || !parsed.privateKey) {
|
|
207
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
208
|
+
}
|
|
209
|
+
if (parsed.nodeQualifier !== undefined && normalizePersistedNodeQualifier(parsed.nodeQualifier) !== parsed.nodeQualifier) {
|
|
210
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
const derived = createPublicKey(importPrivateKey(parsed.privateKey)).export({ type: "spki", format: "der" }).toString("base64");
|
|
214
|
+
if (derived !== parsed.publicKey) {
|
|
215
|
+
throw new Error("mismatch");
|
|
216
|
+
}
|
|
217
|
+
} catch {
|
|
218
|
+
throw new Error(`Node identity at ${path} has mismatched or invalid keys; remove it to generate a fresh one.`);
|
|
219
|
+
}
|
|
220
|
+
return parsed;
|
|
221
|
+
}
|
|
222
|
+
function normalizePersistedNodeQualifier(value) {
|
|
223
|
+
return typeof value === "string" ? value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
224
|
+
}
|
|
225
|
+
function normalizeNodeQualifier(value) {
|
|
226
|
+
return stripBonjourCollisionSuffix(normalizePersistedNodeQualifier(value));
|
|
227
|
+
}
|
|
228
|
+
function createNodeIdentity(supportDirectory) {
|
|
229
|
+
if (!supportDirectory) {
|
|
230
|
+
assertTestIsolatedUserData("write the node identity", "OPENSCOUT_SUPPORT_DIRECTORY");
|
|
231
|
+
}
|
|
232
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
233
|
+
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
234
|
+
const identity = {
|
|
235
|
+
version: 1,
|
|
236
|
+
publicKey: publicKey.export({ type: "spki", format: "der" }).toString("base64"),
|
|
237
|
+
privateKey: privateKey.export({ type: "pkcs8", format: "der" }).toString("base64"),
|
|
238
|
+
createdAt: Date.now()
|
|
239
|
+
};
|
|
240
|
+
mkdirSync2(dirname(path), { recursive: true });
|
|
241
|
+
try {
|
|
242
|
+
writeFileSync2(path, `${JSON.stringify(identity, null, 2)}
|
|
243
|
+
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
244
|
+
} catch (error) {
|
|
245
|
+
if (error.code === "EEXIST") {
|
|
246
|
+
return readAndValidateNodeIdentity(path);
|
|
247
|
+
}
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
chmodSync(path, 384);
|
|
252
|
+
} catch {}
|
|
253
|
+
return identity;
|
|
254
|
+
}
|
|
255
|
+
function nodeKeyId(publicKeyBase64) {
|
|
256
|
+
return createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest("hex");
|
|
257
|
+
}
|
|
258
|
+
function nodeFingerprint(publicKeyBase64) {
|
|
259
|
+
const digest = createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest();
|
|
260
|
+
const encoded = base32Encode(digest.subarray(0, 10)).toLowerCase();
|
|
261
|
+
return `${NODE_FINGERPRINT_PREFIX}:${encoded.slice(0, 4)}-${encoded.slice(4, 8)}`;
|
|
262
|
+
}
|
|
263
|
+
function signNodePayload(identity, payload) {
|
|
264
|
+
const key = importPrivateKey(identity.privateKey);
|
|
265
|
+
return sign(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key).toString("base64");
|
|
266
|
+
}
|
|
267
|
+
function verifyNodeSignature(publicKeyBase64, payload, signatureBase64) {
|
|
268
|
+
try {
|
|
269
|
+
const key = importPublicKey(publicKeyBase64);
|
|
270
|
+
return verify(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key, Buffer.from(signatureBase64, "base64"));
|
|
271
|
+
} catch {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function canonicalJson(value) {
|
|
276
|
+
if (value === null || typeof value !== "object") {
|
|
277
|
+
return JSON.stringify(value);
|
|
278
|
+
}
|
|
279
|
+
if (Array.isArray(value)) {
|
|
280
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
281
|
+
}
|
|
282
|
+
const record = value;
|
|
283
|
+
const keys = Object.keys(record).sort();
|
|
284
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
|
|
285
|
+
}
|
|
286
|
+
function verifySignedNodeCard(card, now = Date.now()) {
|
|
287
|
+
if (nodeKeyId(card.publicKey) !== card.keyId) {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
if (nodeFingerprint(card.publicKey) !== card.fingerprint) {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
if (!Number.isFinite(card.expiresAt) || card.expiresAt <= now) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
if (card.tls !== undefined) {
|
|
297
|
+
if (typeof card.tls !== "object" || card.tls === null || typeof card.tls.spkiFingerprint !== "string" || !/^[0-9a-f]{64}$/.test(card.tls.spkiFingerprint)) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const { signature, ...unsigned } = card;
|
|
302
|
+
return verifyNodeSignature(card.publicKey, canonicalJson(unsigned), signature);
|
|
303
|
+
}
|
|
304
|
+
function base32Encode(input) {
|
|
305
|
+
let bits = 0;
|
|
306
|
+
let value = 0;
|
|
307
|
+
let output = "";
|
|
308
|
+
for (const byte of input) {
|
|
309
|
+
value = value << 8 | byte;
|
|
310
|
+
bits += 8;
|
|
311
|
+
while (bits >= 5) {
|
|
312
|
+
output += BASE32_ALPHABET[value >>> bits - 5 & 31];
|
|
313
|
+
bits -= 5;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (bits > 0) {
|
|
317
|
+
output += BASE32_ALPHABET[value << 5 - bits & 31];
|
|
318
|
+
}
|
|
319
|
+
return output;
|
|
320
|
+
}
|
|
321
|
+
function importPrivateKey(privateKeyBase64) {
|
|
322
|
+
return createPrivateKey({ key: Buffer.from(privateKeyBase64, "base64"), format: "der", type: "pkcs8" });
|
|
323
|
+
}
|
|
324
|
+
function importPublicKey(publicKeyBase64) {
|
|
325
|
+
return createPublicKey({ key: Buffer.from(publicKeyBase64, "base64"), format: "der", type: "spki" });
|
|
326
|
+
}
|
|
327
|
+
var NODE_IDENTITY_FILE = "node-identity.json", NODE_FINGERPRINT_PREFIX = "osc1", NODE_CARD_TTL_MS, stableNodeQualifierCache, BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
328
|
+
var init_node_identity = __esm(() => {
|
|
329
|
+
init_support_paths();
|
|
330
|
+
NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
331
|
+
stableNodeQualifierCache = new Map;
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
// ../runtime/src/local-config.ts
|
|
335
|
+
import {
|
|
336
|
+
existsSync as existsSync3,
|
|
337
|
+
mkdirSync as mkdirSync3,
|
|
338
|
+
readFileSync as readFileSync2,
|
|
339
|
+
renameSync as renameSync2,
|
|
340
|
+
writeFileSync as writeFileSync3
|
|
341
|
+
} from "fs";
|
|
342
|
+
import { homedir as homedir2, hostname as osHostname } from "os";
|
|
343
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
136
344
|
function localConfigHome() {
|
|
137
|
-
return process.env.OPENSCOUT_HOME ??
|
|
345
|
+
return process.env.OPENSCOUT_HOME ?? join3(homedir2(), ".openscout");
|
|
138
346
|
}
|
|
139
347
|
function localConfigPath() {
|
|
140
|
-
return
|
|
348
|
+
return join3(localConfigHome(), "config.json");
|
|
141
349
|
}
|
|
142
350
|
function loadLocalConfig() {
|
|
143
351
|
const configPath = localConfigPath();
|
|
144
|
-
if (!
|
|
352
|
+
if (!existsSync3(configPath))
|
|
145
353
|
return { version: LOCAL_CONFIG_VERSION };
|
|
146
354
|
try {
|
|
147
|
-
return validateLocalConfig(JSON.parse(
|
|
355
|
+
return validateLocalConfig(JSON.parse(readFileSync2(configPath, "utf8")));
|
|
148
356
|
} catch {
|
|
149
357
|
return { version: LOCAL_CONFIG_VERSION };
|
|
150
358
|
}
|
|
@@ -228,6 +436,7 @@ function resolveHost() {
|
|
|
228
436
|
var LOCAL_CONFIG_VERSION = 1, DEFAULT_SCOUT_WEB_PORTAL_HOST = "scout.local", DEFAULT_SCOUT_WEB_DEV_HOST, OPENSCOUT_PORTS, DEFAULT_LOCAL_CONFIG;
|
|
229
437
|
var init_local_config = __esm(() => {
|
|
230
438
|
init_support_paths();
|
|
439
|
+
init_node_identity();
|
|
231
440
|
DEFAULT_SCOUT_WEB_DEV_HOST = `dev.${DEFAULT_SCOUT_WEB_PORTAL_HOST}`;
|
|
232
441
|
OPENSCOUT_PORTS = {
|
|
233
442
|
broker: 43110,
|
|
@@ -252,7 +461,7 @@ var init_local_config = __esm(() => {
|
|
|
252
461
|
});
|
|
253
462
|
|
|
254
463
|
// ../runtime/src/open-scout-network.ts
|
|
255
|
-
import { readFileSync as
|
|
464
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
256
465
|
function defaultOpenScoutNetworkSettings() {
|
|
257
466
|
return {
|
|
258
467
|
discoveryEnabled: false,
|
|
@@ -273,7 +482,7 @@ function normalizeOpenScoutNetworkSettings(input) {
|
|
|
273
482
|
}
|
|
274
483
|
function readOpenScoutNetworkSettingsSync() {
|
|
275
484
|
try {
|
|
276
|
-
const raw =
|
|
485
|
+
const raw = readFileSync3(resolveOpenScoutSupportPaths().settingsPath, "utf8");
|
|
277
486
|
const parsed = JSON.parse(raw);
|
|
278
487
|
const network = isRecord(parsed) && isRecord(parsed.network) ? parsed.network : {};
|
|
279
488
|
return normalizeOpenScoutNetworkSettings(isRecord(network.openScoutNetwork) ? network.openScoutNetwork : {});
|
|
@@ -316,7 +525,7 @@ var init_open_scout_network = __esm(() => {
|
|
|
316
525
|
// ../agent-sessions/src/codex-executable.ts
|
|
317
526
|
import { execFileSync } from "child_process";
|
|
318
527
|
import { accessSync, constants } from "fs";
|
|
319
|
-
import { delimiter, join as
|
|
528
|
+
import { delimiter, join as join4 } from "path";
|
|
320
529
|
function isExecutable(filePath) {
|
|
321
530
|
if (!filePath)
|
|
322
531
|
return false;
|
|
@@ -360,11 +569,11 @@ function codexAppBundleCandidates(env) {
|
|
|
360
569
|
const appNames = ["Codex.app", "ChatGPT.app"];
|
|
361
570
|
const candidates = appNames.flatMap((appName) => [
|
|
362
571
|
{
|
|
363
|
-
path:
|
|
572
|
+
path: join4("/Applications", appName, "Contents", "Resources", "codex"),
|
|
364
573
|
source: "codex_app_bundle"
|
|
365
574
|
},
|
|
366
575
|
{
|
|
367
|
-
path:
|
|
576
|
+
path: join4(env.HOME ?? "", "Applications", appName, "Contents", "Resources", "codex"),
|
|
368
577
|
source: "codex_app_bundle"
|
|
369
578
|
}
|
|
370
579
|
]);
|
|
@@ -372,7 +581,7 @@ function codexAppBundleCandidates(env) {
|
|
|
372
581
|
}
|
|
373
582
|
function pathCandidates(env) {
|
|
374
583
|
return (env.PATH ?? "").split(delimiter).filter(Boolean).map((directory) => ({
|
|
375
|
-
path:
|
|
584
|
+
path: join4(directory, "codex"),
|
|
376
585
|
source: "path"
|
|
377
586
|
}));
|
|
378
587
|
}
|
|
@@ -383,7 +592,7 @@ function commonCandidates(env) {
|
|
|
383
592
|
"/opt/homebrew/bin",
|
|
384
593
|
"/usr/local/bin"
|
|
385
594
|
].filter(Boolean).map((directory) => ({
|
|
386
|
-
path:
|
|
595
|
+
path: join4(directory, "codex"),
|
|
387
596
|
source: "common"
|
|
388
597
|
}));
|
|
389
598
|
}
|
|
@@ -667,10 +876,10 @@ var init_auth = __esm(() => {
|
|
|
667
876
|
|
|
668
877
|
// ../runtime/src/harness-catalog.ts
|
|
669
878
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
670
|
-
import { existsSync as
|
|
879
|
+
import { existsSync as existsSync5, statSync } from "fs";
|
|
671
880
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
672
881
|
import { homedir as homedir4 } from "os";
|
|
673
|
-
import { dirname as
|
|
882
|
+
import { dirname as dirname3, join as join5 } from "path";
|
|
674
883
|
function readinessFromAuthModel(harness) {
|
|
675
884
|
const model = harnessAuthModel(harness);
|
|
676
885
|
if (!model)
|
|
@@ -703,7 +912,7 @@ function expandHomePath(value) {
|
|
|
703
912
|
if (value === "~")
|
|
704
913
|
return home;
|
|
705
914
|
if (value.startsWith("~/"))
|
|
706
|
-
return
|
|
915
|
+
return join5(home, value.slice(2));
|
|
707
916
|
return value;
|
|
708
917
|
}
|
|
709
918
|
function defaultWhichBinary(binary, platform) {
|
|
@@ -737,7 +946,7 @@ function defaultRunCommand(command, platform) {
|
|
|
737
946
|
}
|
|
738
947
|
function defaultRequirementExists(requirement) {
|
|
739
948
|
const expanded = expandHomePath(requirement.path);
|
|
740
|
-
if (!
|
|
949
|
+
if (!existsSync5(expanded))
|
|
741
950
|
return false;
|
|
742
951
|
if (requirement.fileType === "any" || !requirement.fileType)
|
|
743
952
|
return true;
|
|
@@ -966,7 +1175,7 @@ async function readHarnessCatalogOverrides(overridePath = resolveOpenScoutSuppor
|
|
|
966
1175
|
}
|
|
967
1176
|
}
|
|
968
1177
|
async function writeHarnessCatalogOverrides(overrides, overridePath = resolveOpenScoutSupportPaths().harnessCatalogPath) {
|
|
969
|
-
await mkdir(
|
|
1178
|
+
await mkdir(dirname3(overridePath), { recursive: true });
|
|
970
1179
|
const payload = {
|
|
971
1180
|
version: HARNESS_CATALOG_VERSION,
|
|
972
1181
|
entries: overrides,
|
|
@@ -976,7 +1185,7 @@ async function writeHarnessCatalogOverrides(overrides, overridePath = resolveOpe
|
|
|
976
1185
|
`, "utf8");
|
|
977
1186
|
}
|
|
978
1187
|
async function ensureHarnessCatalogOverrideFile(overridePath = resolveOpenScoutSupportPaths().harnessCatalogPath) {
|
|
979
|
-
if (
|
|
1188
|
+
if (existsSync5(overridePath))
|
|
980
1189
|
return;
|
|
981
1190
|
await writeHarnessCatalogOverrides({}, overridePath);
|
|
982
1191
|
}
|
|
@@ -2301,6 +2510,104 @@ var init_assigned_roles = () => {};
|
|
|
2301
2510
|
// ../protocol/src/orchestrator-prompt.ts
|
|
2302
2511
|
var init_orchestrator_prompt = () => {};
|
|
2303
2512
|
|
|
2513
|
+
// ../protocol/src/orchestration-provider-map.ts
|
|
2514
|
+
function runtimeDefinition(label, providerId, harness, model, effort, profile, capability, caution) {
|
|
2515
|
+
return {
|
|
2516
|
+
label,
|
|
2517
|
+
route: { providerId, harness, model, effort, profile },
|
|
2518
|
+
capability,
|
|
2519
|
+
caution
|
|
2520
|
+
};
|
|
2521
|
+
}
|
|
2522
|
+
function roleCandidate(runtimeId, fit, rationale) {
|
|
2523
|
+
return {
|
|
2524
|
+
...RUNTIMES[runtimeId],
|
|
2525
|
+
fit,
|
|
2526
|
+
taskRationale: rationale ?? RUNTIMES[runtimeId].capability
|
|
2527
|
+
};
|
|
2528
|
+
}
|
|
2529
|
+
var HOUR_MS, DAY_MS, RUNTIMES, ROLE_POLICIES;
|
|
2530
|
+
var init_orchestration_provider_map = __esm(() => {
|
|
2531
|
+
HOUR_MS = 60 * 60000;
|
|
2532
|
+
DAY_MS = 24 * HOUR_MS;
|
|
2533
|
+
RUNTIMES = {
|
|
2534
|
+
fable: runtimeDefinition("Fable 5", "claude", "claude", "claude-fable-5", "max", "Fable", "Premium product taste, rapid design iterations, and premise-level critique.", "Uses the premium shared Claude allowance; do not spend it on routine mechanical work."),
|
|
2535
|
+
sol: runtimeDefinition("GPT-5.6 Sol", "codex", "codex", "gpt-5.6-sol", "xhigh", null, "Load-bearing coding, debugging, integration, and technically grounded judgment.", "Highest Codex tier; reserve deep turns for work where failure is expensive."),
|
|
2536
|
+
grok: runtimeDefinition("Grok 4.6", "grok", "grok", "grok-4.6", null, "Grok", "Independent assumption checking, deletion pressure, and adversarial critique.", "Do not make it the sole implementation authority; verify conclusions against repository evidence."),
|
|
2537
|
+
kimi: runtimeDefinition("Kimi Code", "kimi", "kimi", null, null, "Kimi", "Dense repository and study synthesis through the native Kimi harness.", "The harness owns the concrete model and quota telemetry can be stale; probe before large fan-out."),
|
|
2538
|
+
opus: runtimeDefinition("Opus 5", "claude", "claude", "claude-opus-5", "high", "Opus", "Long-context synthesis, nuanced architecture, and coherent product reasoning.", "Premium shared Claude quota; avoid routine scans and repetitive verification."),
|
|
2539
|
+
glm: runtimeDefinition("GLM-5.2", "opencode", "opencode", "opencode-go/glm-5.2", null, "OpenCode", "Independent broad-context synthesis through OpenCode.", "OpenCode quota is not visible in Scout; use a bounded canary before scaling."),
|
|
2540
|
+
terra: runtimeDefinition("GPT-5.6 Terra", "codex", "codex", "gpt-5.6-terra", "high", null, "Balanced implementation, correctness review, and technical critique.", "Prefer Sol for the hardest integration boundary when its additional spend is justified."),
|
|
2541
|
+
minimax: runtimeDefinition("MiniMax M3", "minimax", "opencode", "opencode-go/minimax-m3", null, "OpenCode", "Cost-effective structured evidence collection and comparison.", "Verify load-bearing conclusions with a stronger reviewer before acceptance."),
|
|
2542
|
+
luna: runtimeDefinition("GPT-5.6 Luna", "codex", "codex", "gpt-5.6-luna", "medium", null, "Inexpensive source mapping, test enumeration, and mechanical audit work.", "Keep it out of sole high-stakes product judgment and final acceptance."),
|
|
2543
|
+
haiku: runtimeDefinition("Haiku 4.5", "claude", "claude", "claude-haiku-4-5", "low", null, "Fast narrow scans and classification inside the Claude harness.", "Lighter reasoning and a smaller context window make broad synthesis a poor fit."),
|
|
2544
|
+
sonnet: runtimeDefinition("Sonnet 4.6", "claude", "claude", "claude-sonnet-4-6", "high", null, "Strong generalist implementation with a large context window.", "Shares Claude's provider allowance and can become a poor choice when that pool is guarded."),
|
|
2545
|
+
deepseek: runtimeDefinition("DeepSeek V4 Pro", "opencode", "opencode", "opencode-go/deepseek-v4-pro", null, "OpenCode", "Code-centric review through an independent model lineage.", "Quota is opaque and findings should not be the sole acceptance authority.")
|
|
2546
|
+
};
|
|
2547
|
+
ROLE_POLICIES = {
|
|
2548
|
+
product_judgment: {
|
|
2549
|
+
label: "Product judgment",
|
|
2550
|
+
objective: "Strategic tradeoffs, UX prioritization, scope shaping, and high-level product decisions.",
|
|
2551
|
+
strategy: "Select models with high nuanced taste, product-level synthesis, and clear communication of architectural tradeoffs.",
|
|
2552
|
+
candidates: [
|
|
2553
|
+
roleCandidate("fable", 100, "Unmatched product taste, rapid design iteration synthesis, and high-fidelity UX direction."),
|
|
2554
|
+
roleCandidate("sol", 87, "Technically grounded product decisions with strong execution realism."),
|
|
2555
|
+
roleCandidate("grok", 82, "Unfiltered perspective on feature bloat and aggressive scope reduction.")
|
|
2556
|
+
]
|
|
2557
|
+
},
|
|
2558
|
+
large_context_synthesis: {
|
|
2559
|
+
label: "Large-context synthesis",
|
|
2560
|
+
objective: "Repository-wide investigations, deep architectural archaeology, and multi-file code synthesis.",
|
|
2561
|
+
strategy: "Select models with expansive effective context windows and high-density information compression.",
|
|
2562
|
+
candidates: [
|
|
2563
|
+
roleCandidate("kimi", 100, "Native long-context retrieval and dense codebase relationship synthesis."),
|
|
2564
|
+
roleCandidate("opus", 91, "Deep structural understanding across complex multi-package repositories."),
|
|
2565
|
+
roleCandidate("glm", 84, "Independent wide-window scanning and structural cross-referencing.")
|
|
2566
|
+
]
|
|
2567
|
+
},
|
|
2568
|
+
adversarial_critique: {
|
|
2569
|
+
label: "Adversarial critique",
|
|
2570
|
+
objective: "Challenging design assumptions, rapid design iteration critique, identifying UX/logic gaps, and applying deletion pressure.",
|
|
2571
|
+
strategy: "Select high-taste and contrarian model lineages that stress-test design iterations and probe corner cases without sycophantic approval.",
|
|
2572
|
+
candidates: [
|
|
2573
|
+
roleCandidate("fable", 100, "High-fidelity design critique, rapid UX/visual iteration stress-testing, and premise challenge."),
|
|
2574
|
+
roleCandidate("grok", 91, "Contrarian perspective, uncompromising edge-case discovery, and aggressive premise challenge."),
|
|
2575
|
+
roleCandidate("terra", 84, "Rigorous technical inspection of code correctness and runtime invariants.")
|
|
2576
|
+
]
|
|
2577
|
+
},
|
|
2578
|
+
evidence_inventory: {
|
|
2579
|
+
label: "Evidence inventory",
|
|
2580
|
+
objective: "Grep and AST inventory, reference tracing, log audit, and structured fact collection.",
|
|
2581
|
+
strategy: "Select fast, cost-effective models with high precision on structured evidence gathering.",
|
|
2582
|
+
candidates: [
|
|
2583
|
+
roleCandidate("minimax", 100, "Fast, cost-effective structured evidence indexing and pattern enumeration."),
|
|
2584
|
+
roleCandidate("luna", 95, "Low-latency source tracing, test inventory, and reference mapping."),
|
|
2585
|
+
roleCandidate("haiku", 87, "Rapid mechanical file scans and categorization.")
|
|
2586
|
+
]
|
|
2587
|
+
},
|
|
2588
|
+
implementation: {
|
|
2589
|
+
label: "Implementation",
|
|
2590
|
+
objective: "Code creation, refactoring, type checking, unit test writing, and bug fixing.",
|
|
2591
|
+
strategy: "Select code-generation champions with high instruction following and strong language typing skills.",
|
|
2592
|
+
candidates: [
|
|
2593
|
+
roleCandidate("sol", 100, "Deep technical accuracy, robust multi-file refactors, and complex logic execution."),
|
|
2594
|
+
roleCandidate("terra", 91, "Reliable structured implementation with strong type-system adherence."),
|
|
2595
|
+
roleCandidate("sonnet", 87, "Strong generalist coding with fast turn times and clear explanations.")
|
|
2596
|
+
]
|
|
2597
|
+
},
|
|
2598
|
+
code_review: {
|
|
2599
|
+
label: "Code review",
|
|
2600
|
+
objective: "Diff analysis, security audit, regression detection, and style conformity.",
|
|
2601
|
+
strategy: "Select models with high sensitivity to subtle bugs, invariant violations, and edge-case behaviors.",
|
|
2602
|
+
candidates: [
|
|
2603
|
+
roleCandidate("terra", 100, "Strict invariant checking, subtle logic flaw detection, and boundary test coverage."),
|
|
2604
|
+
roleCandidate("opus", 96, "High-level architectural consistency and API surface evolution review."),
|
|
2605
|
+
roleCandidate("deepseek", 87, "Independent second-opinion review focused on code-level edge cases.")
|
|
2606
|
+
]
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
});
|
|
2610
|
+
|
|
2304
2611
|
// ../protocol/src/permission-policy.ts
|
|
2305
2612
|
function normalizeScoutPermissionProfile(value) {
|
|
2306
2613
|
const normalized = value?.trim().replaceAll("-", "_");
|
|
@@ -3135,6 +3442,7 @@ var init_src = __esm(() => {
|
|
|
3135
3442
|
init_channel_identity();
|
|
3136
3443
|
init_assigned_roles();
|
|
3137
3444
|
init_orchestrator_prompt();
|
|
3445
|
+
init_orchestration_provider_map();
|
|
3138
3446
|
init_agent_runs();
|
|
3139
3447
|
init_budget();
|
|
3140
3448
|
init_host_integrations();
|
|
@@ -4731,7 +5039,7 @@ var init_model_window_registry = __esm(() => {
|
|
|
4731
5039
|
});
|
|
4732
5040
|
|
|
4733
5041
|
// ../agent-sessions/src/history.ts
|
|
4734
|
-
import { basename, dirname as
|
|
5042
|
+
import { basename, dirname as dirname4 } from "path";
|
|
4735
5043
|
function decodeClaudeProjectsSlug(name) {
|
|
4736
5044
|
if (!name || !name.startsWith("-")) {
|
|
4737
5045
|
return null;
|
|
@@ -4743,7 +5051,7 @@ function decodeClaudeProjectsSlug(name) {
|
|
|
4743
5051
|
return `/${tail.replace(/-/g, "/")}`;
|
|
4744
5052
|
}
|
|
4745
5053
|
function inferClaudeHistoryCwd(path2) {
|
|
4746
|
-
const parent = basename(
|
|
5054
|
+
const parent = basename(dirname4(path2));
|
|
4747
5055
|
return decodeClaudeProjectsSlug(parent);
|
|
4748
5056
|
}
|
|
4749
5057
|
function deriveHistoryName(path2) {
|
|
@@ -4751,7 +5059,7 @@ function deriveHistoryName(path2) {
|
|
|
4751
5059
|
if (claudeCwd) {
|
|
4752
5060
|
return basename(claudeCwd) || claudeCwd;
|
|
4753
5061
|
}
|
|
4754
|
-
const parent = basename(
|
|
5062
|
+
const parent = basename(dirname4(path2));
|
|
4755
5063
|
return parent || basename(path2) || "History Session";
|
|
4756
5064
|
}
|
|
4757
5065
|
function normalizeTimestamp(value) {
|
|
@@ -6653,9 +6961,9 @@ function createLiveNormalizerContext(sessionId) {
|
|
|
6653
6961
|
}
|
|
6654
6962
|
|
|
6655
6963
|
// ../agent-sessions/src/adapters/claude-code/team-topology.ts
|
|
6656
|
-
import { existsSync as
|
|
6964
|
+
import { existsSync as existsSync6, readdirSync, readFileSync as readFileSync5, statSync as statSync2 } from "fs";
|
|
6657
6965
|
import { homedir as homedir5 } from "os";
|
|
6658
|
-
import { basename as basename2, dirname as
|
|
6966
|
+
import { basename as basename2, dirname as dirname5, join as join6, relative } from "path";
|
|
6659
6967
|
function isObject(value) {
|
|
6660
6968
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
6661
6969
|
}
|
|
@@ -6678,7 +6986,7 @@ function sourceRefId(kind, value) {
|
|
|
6678
6986
|
}
|
|
6679
6987
|
function readJsonObject(path2) {
|
|
6680
6988
|
try {
|
|
6681
|
-
const parsed = JSON.parse(
|
|
6989
|
+
const parsed = JSON.parse(readFileSync5(path2, "utf8"));
|
|
6682
6990
|
return isObject(parsed) ? parsed : null;
|
|
6683
6991
|
} catch {
|
|
6684
6992
|
return null;
|
|
@@ -6699,17 +7007,17 @@ function statIsFile(path2) {
|
|
|
6699
7007
|
}
|
|
6700
7008
|
}
|
|
6701
7009
|
function readTeamConfigs(homeDir) {
|
|
6702
|
-
const teamsRoot =
|
|
6703
|
-
if (!
|
|
7010
|
+
const teamsRoot = join6(homeDir, ".claude", "teams");
|
|
7011
|
+
if (!existsSync6(teamsRoot) || !statIsDirectory(teamsRoot)) {
|
|
6704
7012
|
return [];
|
|
6705
7013
|
}
|
|
6706
7014
|
const teams = [];
|
|
6707
7015
|
for (const entry of readdirSync(teamsRoot)) {
|
|
6708
|
-
const teamDir =
|
|
7016
|
+
const teamDir = join6(teamsRoot, entry);
|
|
6709
7017
|
if (!statIsDirectory(teamDir)) {
|
|
6710
7018
|
continue;
|
|
6711
7019
|
}
|
|
6712
|
-
const configPath =
|
|
7020
|
+
const configPath = join6(teamDir, "config.json");
|
|
6713
7021
|
const config = readJsonObject(configPath);
|
|
6714
7022
|
if (!config) {
|
|
6715
7023
|
continue;
|
|
@@ -6847,8 +7155,8 @@ function membersFromConfig(team, groupId, configRefId) {
|
|
|
6847
7155
|
return { agents, relationships, agentByExternal };
|
|
6848
7156
|
}
|
|
6849
7157
|
function readTaskFiles(tasksRoot, teamName) {
|
|
6850
|
-
const teamTasksRoot =
|
|
6851
|
-
if (!
|
|
7158
|
+
const teamTasksRoot = join6(tasksRoot, teamName);
|
|
7159
|
+
if (!existsSync6(teamTasksRoot) || !statIsDirectory(teamTasksRoot)) {
|
|
6852
7160
|
return [];
|
|
6853
7161
|
}
|
|
6854
7162
|
const result = [];
|
|
@@ -6858,7 +7166,7 @@ function readTaskFiles(tasksRoot, teamName) {
|
|
|
6858
7166
|
if (!current)
|
|
6859
7167
|
continue;
|
|
6860
7168
|
for (const entry of readdirSync(current)) {
|
|
6861
|
-
const path2 =
|
|
7169
|
+
const path2 = join6(current, entry);
|
|
6862
7170
|
if (statIsDirectory(path2)) {
|
|
6863
7171
|
stack.push(path2);
|
|
6864
7172
|
} else if (statIsFile(path2)) {
|
|
@@ -6889,14 +7197,14 @@ function firstMarkdownTitle(raw) {
|
|
|
6889
7197
|
function parseTaskFile(taskPath, teamName, tasksRoot, sourceRef) {
|
|
6890
7198
|
let raw;
|
|
6891
7199
|
try {
|
|
6892
|
-
raw =
|
|
7200
|
+
raw = readFileSync5(taskPath, "utf8");
|
|
6893
7201
|
} catch {
|
|
6894
7202
|
return null;
|
|
6895
7203
|
}
|
|
6896
|
-
const relativePath = relative(
|
|
7204
|
+
const relativePath = relative(join6(tasksRoot, teamName), taskPath);
|
|
6897
7205
|
const fallbackId = relativePath.replace(/\.[^.]+$/u, "");
|
|
6898
7206
|
const fallbackTitle = firstMarkdownTitle(raw) ?? basename2(fallbackId);
|
|
6899
|
-
const inferredState = inferTaskStateFromPath(
|
|
7207
|
+
const inferredState = inferTaskStateFromPath(dirname5(relativePath));
|
|
6900
7208
|
let parsed = null;
|
|
6901
7209
|
try {
|
|
6902
7210
|
const json = JSON.parse(raw);
|
|
@@ -6927,7 +7235,7 @@ function parseTaskFile(taskPath, teamName, tasksRoot, sourceRef) {
|
|
|
6927
7235
|
};
|
|
6928
7236
|
}
|
|
6929
7237
|
function tasksFromFiles(homeDir, teamName, agentByExternal) {
|
|
6930
|
-
const tasksRoot =
|
|
7238
|
+
const tasksRoot = join6(homeDir, ".claude", "tasks");
|
|
6931
7239
|
const taskFiles = readTaskFiles(tasksRoot, teamName);
|
|
6932
7240
|
const sourceRefs = [];
|
|
6933
7241
|
const parsedTasks = [];
|
|
@@ -8141,9 +8449,9 @@ function flushLine(line, onLine) {
|
|
|
8141
8449
|
}
|
|
8142
8450
|
|
|
8143
8451
|
// ../agent-sessions/src/adapters/claude-code/adapter.ts
|
|
8144
|
-
import { existsSync as
|
|
8452
|
+
import { existsSync as existsSync7, readdirSync as readdirSync2, statSync as statSync3 } from "fs";
|
|
8145
8453
|
import { homedir as homedir6 } from "os";
|
|
8146
|
-
import { delimiter as delimiter2, join as
|
|
8454
|
+
import { delimiter as delimiter2, join as join7 } from "path";
|
|
8147
8455
|
function asRecord2(value) {
|
|
8148
8456
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
8149
8457
|
}
|
|
@@ -8156,8 +8464,8 @@ function resolveClaudeResumeContext(config) {
|
|
|
8156
8464
|
if (!resumeId) {
|
|
8157
8465
|
return null;
|
|
8158
8466
|
}
|
|
8159
|
-
const projectsRoot =
|
|
8160
|
-
if (!
|
|
8467
|
+
const projectsRoot = join7(homedir6(), ".claude", "projects");
|
|
8468
|
+
if (!existsSync7(projectsRoot)) {
|
|
8161
8469
|
return null;
|
|
8162
8470
|
}
|
|
8163
8471
|
let projectSlugs;
|
|
@@ -8167,8 +8475,8 @@ function resolveClaudeResumeContext(config) {
|
|
|
8167
8475
|
return null;
|
|
8168
8476
|
}
|
|
8169
8477
|
for (const slug of projectSlugs) {
|
|
8170
|
-
const sessionPath =
|
|
8171
|
-
if (!
|
|
8478
|
+
const sessionPath = join7(projectsRoot, slug, `${resumeId}.jsonl`);
|
|
8479
|
+
if (!existsSync7(sessionPath)) {
|
|
8172
8480
|
continue;
|
|
8173
8481
|
}
|
|
8174
8482
|
const cwd = decodeClaudeProjectsSlug2(slug);
|
|
@@ -8208,7 +8516,7 @@ function resolveExecutableFromPath(command, env) {
|
|
|
8208
8516
|
for (const directory of pathValue.split(delimiter2)) {
|
|
8209
8517
|
if (!directory)
|
|
8210
8518
|
continue;
|
|
8211
|
-
const candidate =
|
|
8519
|
+
const candidate = join7(directory, command);
|
|
8212
8520
|
try {
|
|
8213
8521
|
if (statSync3(candidate).isFile()) {
|
|
8214
8522
|
return candidate;
|
|
@@ -8515,9 +8823,9 @@ var init_claude_code = __esm(() => {
|
|
|
8515
8823
|
});
|
|
8516
8824
|
|
|
8517
8825
|
// ../agent-sessions/src/codex-launch-config.ts
|
|
8518
|
-
import { accessSync as accessSync2, constants as constants2, existsSync as
|
|
8826
|
+
import { accessSync as accessSync2, constants as constants2, existsSync as existsSync8 } from "fs";
|
|
8519
8827
|
import { homedir as homedir7 } from "os";
|
|
8520
|
-
import { basename as basename3, delimiter as delimiter3, dirname as
|
|
8828
|
+
import { basename as basename3, delimiter as delimiter3, dirname as dirname6, join as join8, resolve } from "path";
|
|
8521
8829
|
import { fileURLToPath } from "url";
|
|
8522
8830
|
function isExecutable2(filePath) {
|
|
8523
8831
|
if (!filePath) {
|
|
@@ -8538,7 +8846,7 @@ function ancestorChain(start) {
|
|
|
8538
8846
|
let current = resolve(start);
|
|
8539
8847
|
while (true) {
|
|
8540
8848
|
chain.push(current);
|
|
8541
|
-
const parent =
|
|
8849
|
+
const parent = dirname6(current);
|
|
8542
8850
|
if (parent === current) {
|
|
8543
8851
|
return chain;
|
|
8544
8852
|
}
|
|
@@ -8548,14 +8856,14 @@ function ancestorChain(start) {
|
|
|
8548
8856
|
function resolveExecutableFromSearchPath(names, env) {
|
|
8549
8857
|
const pathEntries = (env.PATH ?? "").split(delimiter3).filter(Boolean);
|
|
8550
8858
|
const commonDirectories = [
|
|
8551
|
-
|
|
8552
|
-
|
|
8859
|
+
join8(homedir7(), ".local", "bin"),
|
|
8860
|
+
join8(homedir7(), ".bun", "bin"),
|
|
8553
8861
|
"/opt/homebrew/bin",
|
|
8554
8862
|
"/usr/local/bin"
|
|
8555
8863
|
];
|
|
8556
8864
|
for (const directory of [...pathEntries, ...commonDirectories]) {
|
|
8557
8865
|
for (const name of names) {
|
|
8558
|
-
const candidate =
|
|
8866
|
+
const candidate = join8(directory, name);
|
|
8559
8867
|
if (isExecutable2(candidate)) {
|
|
8560
8868
|
return candidate;
|
|
8561
8869
|
}
|
|
@@ -8594,12 +8902,12 @@ function resolveScoutExecutable(env) {
|
|
|
8594
8902
|
return resolveExecutableFromSearchPath(["scout"], env);
|
|
8595
8903
|
}
|
|
8596
8904
|
function resolveRepoScoutScript(currentDirectory) {
|
|
8597
|
-
const moduleDirectory =
|
|
8905
|
+
const moduleDirectory = dirname6(fileURLToPath(import.meta.url));
|
|
8598
8906
|
const starts = uniquePaths([currentDirectory, moduleDirectory]);
|
|
8599
8907
|
for (const start of starts) {
|
|
8600
8908
|
for (const candidate of ancestorChain(start)) {
|
|
8601
|
-
const scriptPath =
|
|
8602
|
-
if (
|
|
8909
|
+
const scriptPath = join8(candidate, "apps", "desktop", "bin", "scout.ts");
|
|
8910
|
+
if (existsSync8(scriptPath)) {
|
|
8603
8911
|
return scriptPath;
|
|
8604
8912
|
}
|
|
8605
8913
|
}
|
|
@@ -8689,7 +8997,7 @@ var init_secret_redaction = __esm(() => {
|
|
|
8689
8997
|
// ../agent-sessions/src/local/transports/codex-app-server.ts
|
|
8690
8998
|
import { spawn } from "child_process";
|
|
8691
8999
|
import { appendFile, mkdir as mkdir2, readFile as readFile2, rm, stat, writeFile as writeFile2 } from "fs/promises";
|
|
8692
|
-
import { join as
|
|
9000
|
+
import { join as join9 } from "path";
|
|
8693
9001
|
function codexAppServerExitMessage(input) {
|
|
8694
9002
|
if (input.exitKind === "proactive_shutdown") {
|
|
8695
9003
|
return `Codex app-server session for ${input.agentName} was stopped by OpenScout` + (input.reason ? `: ${input.reason}` : "") + ".";
|
|
@@ -9004,7 +9312,7 @@ function parseCodexMaybeJson(value) {
|
|
|
9004
9312
|
}
|
|
9005
9313
|
}
|
|
9006
9314
|
async function readCodexSessionCatalog(runtimeDirectory) {
|
|
9007
|
-
const raw = await readOptionalFile(
|
|
9315
|
+
const raw = await readOptionalFile(join9(runtimeDirectory, SESSION_CATALOG_FILENAME));
|
|
9008
9316
|
if (!raw) {
|
|
9009
9317
|
return { activeSessionId: null, sessions: [] };
|
|
9010
9318
|
}
|
|
@@ -9019,7 +9327,7 @@ async function readCodexSessionCatalog(runtimeDirectory) {
|
|
|
9019
9327
|
}
|
|
9020
9328
|
async function writeCodexSessionCatalog(runtimeDirectory, catalog) {
|
|
9021
9329
|
await mkdir2(runtimeDirectory, { recursive: true });
|
|
9022
|
-
await writeFile2(
|
|
9330
|
+
await writeFile2(join9(runtimeDirectory, SESSION_CATALOG_FILENAME), JSON.stringify(catalog, null, 2) + `
|
|
9023
9331
|
`);
|
|
9024
9332
|
}
|
|
9025
9333
|
async function recordCodexSessionCatalog(runtimeDirectory, threadId, input) {
|
|
@@ -9066,6 +9374,10 @@ function isMissingCodexRolloutError(error) {
|
|
|
9066
9374
|
const message = errorMessage(error).toLowerCase();
|
|
9067
9375
|
return message.includes("no rollout found for thread id");
|
|
9068
9376
|
}
|
|
9377
|
+
function isCodexThreadWriterConflictError(error) {
|
|
9378
|
+
const message = errorMessage(error).toLowerCase();
|
|
9379
|
+
return message.includes("already has an active writer") || message.includes("thread-store conflict");
|
|
9380
|
+
}
|
|
9069
9381
|
|
|
9070
9382
|
class CodexAppServerTransport {
|
|
9071
9383
|
options;
|
|
@@ -9088,10 +9400,10 @@ class CodexAppServerTransport {
|
|
|
9088
9400
|
errorListeners = new Set;
|
|
9089
9401
|
constructor(options) {
|
|
9090
9402
|
this.options = options;
|
|
9091
|
-
this.threadIdPath =
|
|
9092
|
-
this.statePath =
|
|
9093
|
-
this.stdoutLogPath =
|
|
9094
|
-
this.stderrLogPath =
|
|
9403
|
+
this.threadIdPath = join9(options.runtimeDirectory, "codex-thread-id.txt");
|
|
9404
|
+
this.statePath = join9(options.runtimeDirectory, "state.json");
|
|
9405
|
+
this.stdoutLogPath = join9(options.logsDirectory, "stdout.log");
|
|
9406
|
+
this.stderrLogPath = join9(options.logsDirectory, "stderr.log");
|
|
9095
9407
|
this.lastConfigSignature = this.configSignature(options);
|
|
9096
9408
|
}
|
|
9097
9409
|
get currentThreadId() {
|
|
@@ -9100,6 +9412,9 @@ class CodexAppServerTransport {
|
|
|
9100
9412
|
get currentThreadPath() {
|
|
9101
9413
|
return this.threadPath;
|
|
9102
9414
|
}
|
|
9415
|
+
get currentDurableThreadId() {
|
|
9416
|
+
return this.durableThreadId;
|
|
9417
|
+
}
|
|
9103
9418
|
get stdoutLogFile() {
|
|
9104
9419
|
return this.stdoutLogPath;
|
|
9105
9420
|
}
|
|
@@ -9136,7 +9451,8 @@ class CodexAppServerTransport {
|
|
|
9136
9451
|
throw new Error(`Codex app-server session for ${this.options.agentName} has no active thread.`);
|
|
9137
9452
|
}
|
|
9138
9453
|
return {
|
|
9139
|
-
threadId: this.threadId
|
|
9454
|
+
threadId: this.threadId,
|
|
9455
|
+
durableThreadId: this.durableThreadId
|
|
9140
9456
|
};
|
|
9141
9457
|
}
|
|
9142
9458
|
async startTurn(prompt) {
|
|
@@ -9248,7 +9564,7 @@ class CodexAppServerTransport {
|
|
|
9248
9564
|
async startSession() {
|
|
9249
9565
|
await mkdir2(this.options.runtimeDirectory, { recursive: true });
|
|
9250
9566
|
await mkdir2(this.options.logsDirectory, { recursive: true });
|
|
9251
|
-
await writeFile2(
|
|
9567
|
+
await writeFile2(join9(this.options.runtimeDirectory, "prompt.txt"), this.options.systemPrompt);
|
|
9252
9568
|
this.proactiveShutdown = null;
|
|
9253
9569
|
try {
|
|
9254
9570
|
await assertCodexWorkingDirectory(this.options.cwd, this.options.agentName);
|
|
@@ -9354,6 +9670,13 @@ class CodexAppServerTransport {
|
|
|
9354
9670
|
await this.persistState();
|
|
9355
9671
|
}
|
|
9356
9672
|
if (requestedThreadId || this.options.requireExistingThread) {
|
|
9673
|
+
if (isCodexThreadWriterConflictError(error)) {
|
|
9674
|
+
throw new CodexThreadHeldExternallyError({
|
|
9675
|
+
agentName: this.options.agentName,
|
|
9676
|
+
threadId: storedThreadId,
|
|
9677
|
+
detail: errorMessage(error)
|
|
9678
|
+
});
|
|
9679
|
+
}
|
|
9357
9680
|
throw new Error(`Failed to resume ${threadOrigin} Codex thread ${storedThreadId}: ${errorMessage(error)}`);
|
|
9358
9681
|
}
|
|
9359
9682
|
}
|
|
@@ -9993,16 +10316,16 @@ async function shutdownCodexAppServerLocalAgent(options, shutdownOptions = {}) {
|
|
|
9993
10316
|
const session = codexAppServerClients.get(key);
|
|
9994
10317
|
if (!session) {
|
|
9995
10318
|
if (shutdownOptions.resetThread) {
|
|
9996
|
-
const threadId = await readOptionalFile(
|
|
10319
|
+
const threadId = await readOptionalFile(join9(options.runtimeDirectory, "codex-thread-id.txt"));
|
|
9997
10320
|
await closeCodexSessionCatalog(options.runtimeDirectory, threadId);
|
|
9998
|
-
await rm(
|
|
10321
|
+
await rm(join9(options.runtimeDirectory, "codex-thread-id.txt"), { force: true });
|
|
9999
10322
|
}
|
|
10000
10323
|
return;
|
|
10001
10324
|
}
|
|
10002
10325
|
codexAppServerClients.delete(key);
|
|
10003
10326
|
await session.shutdown(shutdownOptions);
|
|
10004
10327
|
}
|
|
10005
|
-
var CodexAppServerExitError, CodexAppServerRequesterTimeoutError, SESSION_CATALOG_FILENAME = "session-catalog.json", SESSION_CATALOG_MAX_ENTRIES = 64, codexAppServerClients;
|
|
10328
|
+
var CodexAppServerExitError, CodexAppServerRequesterTimeoutError, CodexThreadHeldExternallyError, SESSION_CATALOG_FILENAME = "session-catalog.json", SESSION_CATALOG_MAX_ENTRIES = 64, codexAppServerClients;
|
|
10006
10329
|
var init_codex_app_server = __esm(() => {
|
|
10007
10330
|
init_codex_launch_config();
|
|
10008
10331
|
init_codex_executable();
|
|
@@ -10041,6 +10364,17 @@ var init_codex_app_server = __esm(() => {
|
|
|
10041
10364
|
this.timeoutMs = input.timeoutMs;
|
|
10042
10365
|
}
|
|
10043
10366
|
};
|
|
10367
|
+
CodexThreadHeldExternallyError = class CodexThreadHeldExternallyError extends Error {
|
|
10368
|
+
code = "CODEX_THREAD_HELD_EXTERNALLY";
|
|
10369
|
+
threadId;
|
|
10370
|
+
agentName;
|
|
10371
|
+
constructor(input) {
|
|
10372
|
+
super(`Codex thread ${input.threadId} is open in another application` + (input.detail ? ` (${input.detail})` : "") + "; it will accept turns once that application releases it.");
|
|
10373
|
+
this.name = "CodexThreadHeldExternallyError";
|
|
10374
|
+
this.threadId = input.threadId;
|
|
10375
|
+
this.agentName = input.agentName;
|
|
10376
|
+
}
|
|
10377
|
+
};
|
|
10044
10378
|
codexAppServerClients = new Map;
|
|
10045
10379
|
});
|
|
10046
10380
|
|
|
@@ -10870,9 +11204,9 @@ var init_normalizer3 = __esm(() => {
|
|
|
10870
11204
|
});
|
|
10871
11205
|
|
|
10872
11206
|
// ../agent-sessions/src/adapters/codex/topology.ts
|
|
10873
|
-
import { existsSync as
|
|
11207
|
+
import { existsSync as existsSync9, readdirSync as readdirSync3, readFileSync as readFileSync6, statSync as statSync4 } from "fs";
|
|
10874
11208
|
import { homedir as homedir8 } from "os";
|
|
10875
|
-
import { basename as basename4, join as
|
|
11209
|
+
import { basename as basename4, join as join10 } from "path";
|
|
10876
11210
|
function isObject2(value) {
|
|
10877
11211
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
10878
11212
|
}
|
|
@@ -10989,7 +11323,7 @@ function parseTomlKeyValues(raw) {
|
|
|
10989
11323
|
}
|
|
10990
11324
|
function readTomlKeyValues(path2) {
|
|
10991
11325
|
try {
|
|
10992
|
-
return parseTomlKeyValues(
|
|
11326
|
+
return parseTomlKeyValues(readFileSync6(path2, "utf8"));
|
|
10993
11327
|
} catch {
|
|
10994
11328
|
return null;
|
|
10995
11329
|
}
|
|
@@ -11003,8 +11337,8 @@ function firstString2(record2, keys) {
|
|
|
11003
11337
|
return;
|
|
11004
11338
|
}
|
|
11005
11339
|
function readAgentDefinitions(root, scope) {
|
|
11006
|
-
const agentsDir =
|
|
11007
|
-
if (!
|
|
11340
|
+
const agentsDir = join10(root, ".codex", "agents");
|
|
11341
|
+
if (!existsSync9(agentsDir) || !statIsDirectory2(agentsDir)) {
|
|
11008
11342
|
return { agents: [], sourceRefs: [] };
|
|
11009
11343
|
}
|
|
11010
11344
|
const agents = [];
|
|
@@ -11012,7 +11346,7 @@ function readAgentDefinitions(root, scope) {
|
|
|
11012
11346
|
for (const entry of readdirSync3(agentsDir).sort()) {
|
|
11013
11347
|
if (!entry.endsWith(".toml"))
|
|
11014
11348
|
continue;
|
|
11015
|
-
const path2 =
|
|
11349
|
+
const path2 = join10(agentsDir, entry);
|
|
11016
11350
|
if (!statIsFile2(path2))
|
|
11017
11351
|
continue;
|
|
11018
11352
|
const parsed = readTomlKeyValues(path2);
|
|
@@ -11051,8 +11385,8 @@ function readAgentDefinitions(root, scope) {
|
|
|
11051
11385
|
function readProjectAgentsConfig(cwd) {
|
|
11052
11386
|
if (!cwd)
|
|
11053
11387
|
return {};
|
|
11054
|
-
const configPath =
|
|
11055
|
-
if (!
|
|
11388
|
+
const configPath = join10(cwd, ".codex", "config.toml");
|
|
11389
|
+
if (!existsSync9(configPath) || !statIsFile2(configPath)) {
|
|
11056
11390
|
return {};
|
|
11057
11391
|
}
|
|
11058
11392
|
const parsed = readTomlKeyValues(configPath);
|
|
@@ -11315,7 +11649,7 @@ var init_topology = () => {};
|
|
|
11315
11649
|
|
|
11316
11650
|
// ../agent-sessions/src/adapters/codex/adapter.ts
|
|
11317
11651
|
import { homedir as homedir9 } from "os";
|
|
11318
|
-
import { join as
|
|
11652
|
+
import { join as join11 } from "path";
|
|
11319
11653
|
function errorMessage2(error) {
|
|
11320
11654
|
if (error instanceof Error) {
|
|
11321
11655
|
return error.message;
|
|
@@ -11342,7 +11676,7 @@ var init_adapter2 = __esm(() => {
|
|
|
11342
11676
|
sequence = 0;
|
|
11343
11677
|
constructor(config) {
|
|
11344
11678
|
super(config);
|
|
11345
|
-
const runtimeRoot =
|
|
11679
|
+
const runtimeRoot = join11(homedir9(), ".scout/pairing", "codex", this.session.id);
|
|
11346
11680
|
this.observedTopology = new CodexObservedTopologyTracker({
|
|
11347
11681
|
cwd: config.cwd ?? process.cwd(),
|
|
11348
11682
|
homeDir: config.env?.HOME,
|
|
@@ -11354,8 +11688,8 @@ var init_adapter2 = __esm(() => {
|
|
|
11354
11688
|
model: this.session.model,
|
|
11355
11689
|
providerMeta: {
|
|
11356
11690
|
...this.session.providerMeta ?? {},
|
|
11357
|
-
stdoutLogFile:
|
|
11358
|
-
stderrLogFile:
|
|
11691
|
+
stdoutLogFile: join11(runtimeRoot, "logs/stdout.log"),
|
|
11692
|
+
stderrLogFile: join11(runtimeRoot, "logs/stderr.log")
|
|
11359
11693
|
}
|
|
11360
11694
|
});
|
|
11361
11695
|
}
|
|
@@ -11414,7 +11748,7 @@ var init_adapter2 = __esm(() => {
|
|
|
11414
11748
|
this.setStatus("closed");
|
|
11415
11749
|
}
|
|
11416
11750
|
get codexOptions() {
|
|
11417
|
-
const runtimeRoot =
|
|
11751
|
+
const runtimeRoot = join11(homedir9(), ".scout/pairing", "codex", this.session.id);
|
|
11418
11752
|
const configuredThreadId = this.config.options?.["threadId"];
|
|
11419
11753
|
const requireExistingThread = this.config.options?.["requireExistingThread"];
|
|
11420
11754
|
const rawLaunchArgs = this.config.options?.["launchArgs"];
|
|
@@ -11426,8 +11760,8 @@ var init_adapter2 = __esm(() => {
|
|
|
11426
11760
|
sessionId: this.session.id,
|
|
11427
11761
|
cwd: this.config.cwd ?? process.cwd(),
|
|
11428
11762
|
systemPrompt: this.systemPrompt,
|
|
11429
|
-
runtimeDirectory:
|
|
11430
|
-
logsDirectory:
|
|
11763
|
+
runtimeDirectory: join11(runtimeRoot, "runtime"),
|
|
11764
|
+
logsDirectory: join11(runtimeRoot, "logs"),
|
|
11431
11765
|
env: this.config.env,
|
|
11432
11766
|
launchArgs,
|
|
11433
11767
|
threadId: typeof configuredThreadId === "string" && configuredThreadId.trim().length > 0 ? configuredThreadId.trim() : undefined,
|
|
@@ -11446,10 +11780,10 @@ var init_adapter2 = __esm(() => {
|
|
|
11446
11780
|
return typeof raw === "string" && raw.trim().length > 0 ? raw : "You are a helpful agent working through Pairing.";
|
|
11447
11781
|
}
|
|
11448
11782
|
get stdoutLogPath() {
|
|
11449
|
-
return this.transport?.stdoutLogFile ??
|
|
11783
|
+
return this.transport?.stdoutLogFile ?? join11(this.codexOptions.logsDirectory, "stdout.log");
|
|
11450
11784
|
}
|
|
11451
11785
|
get stderrLogPath() {
|
|
11452
|
-
return this.transport?.stderrLogFile ??
|
|
11786
|
+
return this.transport?.stderrLogFile ?? join11(this.codexOptions.logsDirectory, "stderr.log");
|
|
11453
11787
|
}
|
|
11454
11788
|
enqueue(task) {
|
|
11455
11789
|
const next = this.serialized.then(task, task);
|
|
@@ -11617,9 +11951,9 @@ var init_codex = __esm(() => {
|
|
|
11617
11951
|
|
|
11618
11952
|
// ../agent-sessions/src/adapters/acp/adapter.ts
|
|
11619
11953
|
import { spawn as spawn2 } from "child_process";
|
|
11620
|
-
import { existsSync as
|
|
11954
|
+
import { existsSync as existsSync10 } from "fs";
|
|
11621
11955
|
import { mkdir as mkdir3, readFile as readFile3, writeFile as writeFile3 } from "fs/promises";
|
|
11622
|
-
import { dirname as
|
|
11956
|
+
import { dirname as dirname7, isAbsolute, relative as relative2, resolve as resolve2 } from "path";
|
|
11623
11957
|
import { pathToFileURL } from "url";
|
|
11624
11958
|
function isRecord3(value) {
|
|
11625
11959
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
@@ -11998,7 +12332,7 @@ var init_adapter3 = __esm(() => {
|
|
|
11998
12332
|
return;
|
|
11999
12333
|
}
|
|
12000
12334
|
const options = this.acpOptions;
|
|
12001
|
-
if (!
|
|
12335
|
+
if (!existsSync10(options.cwd)) {
|
|
12002
12336
|
const failure = new Error(`ACP agent working directory does not exist: ${options.cwd}` + ` (harness command: ${options.command})`);
|
|
12003
12337
|
this.failSession(failure);
|
|
12004
12338
|
throw failure;
|
|
@@ -12658,7 +12992,7 @@ ${plan}`,
|
|
|
12658
12992
|
return;
|
|
12659
12993
|
}
|
|
12660
12994
|
const filePath = this.resolveAllowedPath(requestedPath);
|
|
12661
|
-
await mkdir3(
|
|
12995
|
+
await mkdir3(dirname7(filePath), { recursive: true });
|
|
12662
12996
|
await writeFile3(filePath, params.content, "utf8");
|
|
12663
12997
|
this.writeResult(message.id, {});
|
|
12664
12998
|
}
|
|
@@ -12858,16 +13192,16 @@ var init_acp = __esm(() => {
|
|
|
12858
13192
|
});
|
|
12859
13193
|
|
|
12860
13194
|
// ../agent-sessions/src/adapters/grok-acp/adapter.ts
|
|
12861
|
-
import { existsSync as
|
|
13195
|
+
import { existsSync as existsSync11 } from "fs";
|
|
12862
13196
|
import { homedir as homedir10 } from "os";
|
|
12863
|
-
import { join as
|
|
13197
|
+
import { join as join12 } from "path";
|
|
12864
13198
|
function defaultGrokCommand(env) {
|
|
12865
13199
|
const override = firstNonEmptyString(env?.GROK_CLI_BIN, process.env.GROK_CLI_BIN);
|
|
12866
13200
|
if (override) {
|
|
12867
13201
|
return override;
|
|
12868
13202
|
}
|
|
12869
|
-
const installed =
|
|
12870
|
-
return
|
|
13203
|
+
const installed = join12(homedir10(), ".grok", "bin", "grok");
|
|
13204
|
+
return existsSync11(installed) ? installed : "grok";
|
|
12871
13205
|
}
|
|
12872
13206
|
function isRecord4(value) {
|
|
12873
13207
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
@@ -12942,9 +13276,9 @@ var init_grok_acp = __esm(() => {
|
|
|
12942
13276
|
});
|
|
12943
13277
|
|
|
12944
13278
|
// ../agent-sessions/src/adapters/kimi-acp/adapter.ts
|
|
12945
|
-
import { existsSync as
|
|
13279
|
+
import { existsSync as existsSync12 } from "fs";
|
|
12946
13280
|
import { homedir as homedir11 } from "os";
|
|
12947
|
-
import { join as
|
|
13281
|
+
import { join as join13 } from "path";
|
|
12948
13282
|
function isRecord5(value) {
|
|
12949
13283
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
12950
13284
|
}
|
|
@@ -12973,10 +13307,10 @@ function defaultKimiCommand(env) {
|
|
|
12973
13307
|
return override;
|
|
12974
13308
|
}
|
|
12975
13309
|
const installedCandidates = [
|
|
12976
|
-
|
|
12977
|
-
|
|
13310
|
+
join13(homedir11(), ".kimi-code", "bin", "kimi"),
|
|
13311
|
+
join13(homedir11(), ".local", "bin", "kimi")
|
|
12978
13312
|
];
|
|
12979
|
-
return installedCandidates.find((candidate) =>
|
|
13313
|
+
return installedCandidates.find((candidate) => existsSync12(candidate)) ?? "kimi";
|
|
12980
13314
|
}
|
|
12981
13315
|
var DEFAULT_KIMI_ARGS, DEFAULT_KIMI_STARTUP_TIMEOUT_MS = 60000, KIMI_ACP_ADAPTER_TYPE = "kimi-acp", createAdapter5 = (config) => {
|
|
12982
13316
|
const rawOptions = isRecord5(config.options) ? config.options : {};
|
|
@@ -15147,7 +15481,7 @@ var init_service = () => {};
|
|
|
15147
15481
|
import { readFile as readFile4 } from "fs/promises";
|
|
15148
15482
|
import { spawn as spawn3 } from "child_process";
|
|
15149
15483
|
import { homedir as homedir12 } from "os";
|
|
15150
|
-
import { join as
|
|
15484
|
+
import { join as join14 } from "path";
|
|
15151
15485
|
async function discover(options = {}) {
|
|
15152
15486
|
return (await discoverLocal(options))?.endpoint;
|
|
15153
15487
|
}
|
|
@@ -15259,7 +15593,7 @@ async function stop(options = {}) {
|
|
|
15259
15593
|
await kill(existing, options);
|
|
15260
15594
|
}
|
|
15261
15595
|
function fallback() {
|
|
15262
|
-
return
|
|
15596
|
+
return join14(process.env["XDG_STATE_HOME"] ?? join14(homedir12(), ".local", "state"), "opencode", "service.json");
|
|
15263
15597
|
}
|
|
15264
15598
|
function headers(endpoint) {
|
|
15265
15599
|
if (endpoint.auth === undefined)
|
|
@@ -16108,9 +16442,9 @@ var init_normalizer4 = __esm(() => {
|
|
|
16108
16442
|
});
|
|
16109
16443
|
|
|
16110
16444
|
// ../agent-sessions/src/adapters/opencode-v2/adapter.ts
|
|
16111
|
-
import { existsSync as
|
|
16445
|
+
import { existsSync as existsSync13 } from "fs";
|
|
16112
16446
|
import { homedir as homedir13 } from "os";
|
|
16113
|
-
import { basename as basename5, isAbsolute as isAbsolute2, join as
|
|
16447
|
+
import { basename as basename5, isAbsolute as isAbsolute2, join as join15, resolve as resolve3 } from "path";
|
|
16114
16448
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
16115
16449
|
function deferred() {
|
|
16116
16450
|
let resolvePromise;
|
|
@@ -16144,10 +16478,10 @@ function defaultOpenCodeV2Binary(env) {
|
|
|
16144
16478
|
const candidates = [
|
|
16145
16479
|
"/opt/homebrew/bin/opencode2",
|
|
16146
16480
|
"/usr/local/bin/opencode2",
|
|
16147
|
-
|
|
16148
|
-
|
|
16481
|
+
join15(home, ".opencode", "bin", "opencode2"),
|
|
16482
|
+
join15(home, ".local", "bin", "opencode2")
|
|
16149
16483
|
];
|
|
16150
|
-
return candidates.find((candidate) =>
|
|
16484
|
+
return candidates.find((candidate) => existsSync13(candidate)) ?? "opencode2";
|
|
16151
16485
|
}
|
|
16152
16486
|
function modelRef(value, variantValue) {
|
|
16153
16487
|
const raw = stringValue8(value);
|
|
@@ -17177,9 +17511,9 @@ var init_opencode_v2 = __esm(() => {
|
|
|
17177
17511
|
|
|
17178
17512
|
// ../agent-sessions/src/adapters/opencode-acp/adapter.ts
|
|
17179
17513
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
17180
|
-
import { existsSync as
|
|
17514
|
+
import { existsSync as existsSync14 } from "fs";
|
|
17181
17515
|
import { homedir as homedir14 } from "os";
|
|
17182
|
-
import { join as
|
|
17516
|
+
import { join as join16 } from "path";
|
|
17183
17517
|
function isRecord8(value) {
|
|
17184
17518
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
17185
17519
|
}
|
|
@@ -17210,10 +17544,10 @@ function defaultOpenCodeCommand(env) {
|
|
|
17210
17544
|
const installedCandidates = [
|
|
17211
17545
|
"/opt/homebrew/bin/opencode",
|
|
17212
17546
|
"/usr/local/bin/opencode",
|
|
17213
|
-
|
|
17214
|
-
|
|
17547
|
+
join16(homedir14(), ".opencode", "bin", "opencode"),
|
|
17548
|
+
join16(homedir14(), ".local", "bin", "opencode")
|
|
17215
17549
|
];
|
|
17216
|
-
return installedCandidates.find((candidate) =>
|
|
17550
|
+
return installedCandidates.find((candidate) => existsSync14(candidate)) ?? "opencode";
|
|
17217
17551
|
}
|
|
17218
17552
|
function configContentEnv(rawOptions, env) {
|
|
17219
17553
|
const model = stringValue9(rawOptions.model);
|
|
@@ -17230,7 +17564,7 @@ function configContentEnv(rawOptions, env) {
|
|
|
17230
17564
|
return { [OPENCODE_CONFIG_CONTENT_ENV]: JSON.stringify(overlay) };
|
|
17231
17565
|
}
|
|
17232
17566
|
function keychainSecret(name, commandOverride) {
|
|
17233
|
-
const candidates = commandOverride ? [commandOverride] : ["secret",
|
|
17567
|
+
const candidates = commandOverride ? [commandOverride] : ["secret", join16(homedir14(), ".local", "bin", "secret")];
|
|
17234
17568
|
for (const command of candidates) {
|
|
17235
17569
|
try {
|
|
17236
17570
|
const result = spawnSync2(command, ["get", name], { encoding: "utf8", timeout: 5000 });
|
|
@@ -18296,184 +18630,6 @@ var init_src2 = __esm(() => {
|
|
|
18296
18630
|
init_cost();
|
|
18297
18631
|
});
|
|
18298
18632
|
|
|
18299
|
-
// ../runtime/src/node-identity.ts
|
|
18300
|
-
import {
|
|
18301
|
-
createHash,
|
|
18302
|
-
createPrivateKey,
|
|
18303
|
-
createPublicKey,
|
|
18304
|
-
generateKeyPairSync,
|
|
18305
|
-
randomBytes,
|
|
18306
|
-
sign,
|
|
18307
|
-
verify
|
|
18308
|
-
} from "crypto";
|
|
18309
|
-
import {
|
|
18310
|
-
chmodSync,
|
|
18311
|
-
existsSync as existsSync14,
|
|
18312
|
-
mkdirSync as mkdirSync4,
|
|
18313
|
-
readFileSync as readFileSync6,
|
|
18314
|
-
renameSync as renameSync2,
|
|
18315
|
-
rmSync as rmSync2,
|
|
18316
|
-
writeFileSync as writeFileSync4
|
|
18317
|
-
} from "fs";
|
|
18318
|
-
import { dirname as dirname7, join as join16 } from "path";
|
|
18319
|
-
function nodeIdentityPath(supportDirectory) {
|
|
18320
|
-
const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
|
|
18321
|
-
return join16(dir, NODE_IDENTITY_FILE);
|
|
18322
|
-
}
|
|
18323
|
-
function loadOrCreateNodeIdentity(supportDirectory) {
|
|
18324
|
-
const path2 = nodeIdentityPath(supportDirectory);
|
|
18325
|
-
if (existsSync14(path2)) {
|
|
18326
|
-
return readAndValidateNodeIdentity(path2);
|
|
18327
|
-
}
|
|
18328
|
-
return createNodeIdentity(supportDirectory);
|
|
18329
|
-
}
|
|
18330
|
-
function readStableNodeQualifier(supportDirectory) {
|
|
18331
|
-
const path2 = nodeIdentityPath(supportDirectory);
|
|
18332
|
-
const cached = stableNodeQualifierCache.get(path2);
|
|
18333
|
-
if (cached) {
|
|
18334
|
-
return cached;
|
|
18335
|
-
}
|
|
18336
|
-
if (!existsSync14(path2)) {
|
|
18337
|
-
return null;
|
|
18338
|
-
}
|
|
18339
|
-
const nodeQualifier = normalizeNodeQualifier(readAndValidateNodeIdentity(path2).nodeQualifier);
|
|
18340
|
-
if (nodeQualifier) {
|
|
18341
|
-
stableNodeQualifierCache.set(path2, nodeQualifier);
|
|
18342
|
-
}
|
|
18343
|
-
return nodeQualifier || null;
|
|
18344
|
-
}
|
|
18345
|
-
function readAndValidateNodeIdentity(path2) {
|
|
18346
|
-
let parsed;
|
|
18347
|
-
try {
|
|
18348
|
-
parsed = JSON.parse(readFileSync6(path2, "utf8"));
|
|
18349
|
-
} catch {
|
|
18350
|
-
throw new Error(`Corrupt node identity at ${path2}; remove it to generate a fresh one.`);
|
|
18351
|
-
}
|
|
18352
|
-
if (parsed.version !== 1 || !parsed.publicKey || !parsed.privateKey) {
|
|
18353
|
-
throw new Error(`Corrupt node identity at ${path2}; remove it to generate a fresh one.`);
|
|
18354
|
-
}
|
|
18355
|
-
if (parsed.nodeQualifier !== undefined && normalizeNodeQualifier(parsed.nodeQualifier) !== parsed.nodeQualifier) {
|
|
18356
|
-
throw new Error(`Corrupt node identity at ${path2}; remove it to generate a fresh one.`);
|
|
18357
|
-
}
|
|
18358
|
-
try {
|
|
18359
|
-
const derived = createPublicKey(importPrivateKey(parsed.privateKey)).export({ type: "spki", format: "der" }).toString("base64");
|
|
18360
|
-
if (derived !== parsed.publicKey) {
|
|
18361
|
-
throw new Error("mismatch");
|
|
18362
|
-
}
|
|
18363
|
-
} catch {
|
|
18364
|
-
throw new Error(`Node identity at ${path2} has mismatched or invalid keys; remove it to generate a fresh one.`);
|
|
18365
|
-
}
|
|
18366
|
-
return parsed;
|
|
18367
|
-
}
|
|
18368
|
-
function normalizeNodeQualifier(value) {
|
|
18369
|
-
return typeof value === "string" ? value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
18370
|
-
}
|
|
18371
|
-
function createNodeIdentity(supportDirectory) {
|
|
18372
|
-
if (!supportDirectory) {
|
|
18373
|
-
assertTestIsolatedUserData("write the node identity", "OPENSCOUT_SUPPORT_DIRECTORY");
|
|
18374
|
-
}
|
|
18375
|
-
const path2 = nodeIdentityPath(supportDirectory);
|
|
18376
|
-
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
18377
|
-
const identity = {
|
|
18378
|
-
version: 1,
|
|
18379
|
-
publicKey: publicKey.export({ type: "spki", format: "der" }).toString("base64"),
|
|
18380
|
-
privateKey: privateKey.export({ type: "pkcs8", format: "der" }).toString("base64"),
|
|
18381
|
-
createdAt: Date.now()
|
|
18382
|
-
};
|
|
18383
|
-
mkdirSync4(dirname7(path2), { recursive: true });
|
|
18384
|
-
try {
|
|
18385
|
-
writeFileSync4(path2, `${JSON.stringify(identity, null, 2)}
|
|
18386
|
-
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
18387
|
-
} catch (error) {
|
|
18388
|
-
if (error.code === "EEXIST") {
|
|
18389
|
-
return readAndValidateNodeIdentity(path2);
|
|
18390
|
-
}
|
|
18391
|
-
throw error;
|
|
18392
|
-
}
|
|
18393
|
-
try {
|
|
18394
|
-
chmodSync(path2, 384);
|
|
18395
|
-
} catch {}
|
|
18396
|
-
return identity;
|
|
18397
|
-
}
|
|
18398
|
-
function nodeKeyId(publicKeyBase64) {
|
|
18399
|
-
return createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest("hex");
|
|
18400
|
-
}
|
|
18401
|
-
function nodeFingerprint(publicKeyBase64) {
|
|
18402
|
-
const digest = createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest();
|
|
18403
|
-
const encoded = base32Encode(digest.subarray(0, 10)).toLowerCase();
|
|
18404
|
-
return `${NODE_FINGERPRINT_PREFIX}:${encoded.slice(0, 4)}-${encoded.slice(4, 8)}`;
|
|
18405
|
-
}
|
|
18406
|
-
function signNodePayload(identity, payload) {
|
|
18407
|
-
const key = importPrivateKey(identity.privateKey);
|
|
18408
|
-
return sign(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key).toString("base64");
|
|
18409
|
-
}
|
|
18410
|
-
function verifyNodeSignature(publicKeyBase64, payload, signatureBase64) {
|
|
18411
|
-
try {
|
|
18412
|
-
const key = importPublicKey(publicKeyBase64);
|
|
18413
|
-
return verify(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key, Buffer.from(signatureBase64, "base64"));
|
|
18414
|
-
} catch {
|
|
18415
|
-
return false;
|
|
18416
|
-
}
|
|
18417
|
-
}
|
|
18418
|
-
function canonicalJson(value) {
|
|
18419
|
-
if (value === null || typeof value !== "object") {
|
|
18420
|
-
return JSON.stringify(value);
|
|
18421
|
-
}
|
|
18422
|
-
if (Array.isArray(value)) {
|
|
18423
|
-
return `[${value.map(canonicalJson).join(",")}]`;
|
|
18424
|
-
}
|
|
18425
|
-
const record2 = value;
|
|
18426
|
-
const keys = Object.keys(record2).sort();
|
|
18427
|
-
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record2[key])}`).join(",")}}`;
|
|
18428
|
-
}
|
|
18429
|
-
function verifySignedNodeCard(card, now = Date.now()) {
|
|
18430
|
-
if (nodeKeyId(card.publicKey) !== card.keyId) {
|
|
18431
|
-
return false;
|
|
18432
|
-
}
|
|
18433
|
-
if (nodeFingerprint(card.publicKey) !== card.fingerprint) {
|
|
18434
|
-
return false;
|
|
18435
|
-
}
|
|
18436
|
-
if (!Number.isFinite(card.expiresAt) || card.expiresAt <= now) {
|
|
18437
|
-
return false;
|
|
18438
|
-
}
|
|
18439
|
-
if (card.tls !== undefined) {
|
|
18440
|
-
if (typeof card.tls !== "object" || card.tls === null || typeof card.tls.spkiFingerprint !== "string" || !/^[0-9a-f]{64}$/.test(card.tls.spkiFingerprint)) {
|
|
18441
|
-
return false;
|
|
18442
|
-
}
|
|
18443
|
-
}
|
|
18444
|
-
const { signature, ...unsigned } = card;
|
|
18445
|
-
return verifyNodeSignature(card.publicKey, canonicalJson(unsigned), signature);
|
|
18446
|
-
}
|
|
18447
|
-
function base32Encode(input) {
|
|
18448
|
-
let bits = 0;
|
|
18449
|
-
let value = 0;
|
|
18450
|
-
let output = "";
|
|
18451
|
-
for (const byte of input) {
|
|
18452
|
-
value = value << 8 | byte;
|
|
18453
|
-
bits += 8;
|
|
18454
|
-
while (bits >= 5) {
|
|
18455
|
-
output += BASE32_ALPHABET[value >>> bits - 5 & 31];
|
|
18456
|
-
bits -= 5;
|
|
18457
|
-
}
|
|
18458
|
-
}
|
|
18459
|
-
if (bits > 0) {
|
|
18460
|
-
output += BASE32_ALPHABET[value << 5 - bits & 31];
|
|
18461
|
-
}
|
|
18462
|
-
return output;
|
|
18463
|
-
}
|
|
18464
|
-
function importPrivateKey(privateKeyBase64) {
|
|
18465
|
-
return createPrivateKey({ key: Buffer.from(privateKeyBase64, "base64"), format: "der", type: "pkcs8" });
|
|
18466
|
-
}
|
|
18467
|
-
function importPublicKey(publicKeyBase64) {
|
|
18468
|
-
return createPublicKey({ key: Buffer.from(publicKeyBase64, "base64"), format: "der", type: "spki" });
|
|
18469
|
-
}
|
|
18470
|
-
var NODE_IDENTITY_FILE = "node-identity.json", NODE_FINGERPRINT_PREFIX = "osc1", NODE_CARD_TTL_MS, stableNodeQualifierCache, BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
18471
|
-
var init_node_identity = __esm(() => {
|
|
18472
|
-
init_support_paths();
|
|
18473
|
-
NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
18474
|
-
stableNodeQualifierCache = new Map;
|
|
18475
|
-
});
|
|
18476
|
-
|
|
18477
18633
|
// ../../node_modules/.bun/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
18478
18634
|
var require_Reflect = __commonJS(() => {
|
|
18479
18635
|
/*! *****************************************************************************
|
|
@@ -28831,6 +28987,9 @@ function defaultSettings() {
|
|
|
28831
28987
|
quickHits: [],
|
|
28832
28988
|
preparedAt: null
|
|
28833
28989
|
},
|
|
28990
|
+
voice: {
|
|
28991
|
+
realtimeEnabled: false
|
|
28992
|
+
},
|
|
28834
28993
|
ui: {
|
|
28835
28994
|
scenes: [],
|
|
28836
28995
|
activeSceneIdBySurface: {}
|
|
@@ -29218,6 +29377,7 @@ async function normalizeSettingsRecord(value, options = {}) {
|
|
|
29218
29377
|
const telegram = typeof bridges.telegram === "object" && bridges.telegram ? bridges.telegram : {};
|
|
29219
29378
|
const network = typeof candidate.network === "object" && candidate.network ? candidate.network : {};
|
|
29220
29379
|
const phone = typeof candidate.phone === "object" && candidate.phone ? candidate.phone : {};
|
|
29380
|
+
const voice = typeof candidate.voice === "object" && candidate.voice ? candidate.voice : {};
|
|
29221
29381
|
const ui = typeof candidate.ui === "object" && candidate.ui ? candidate.ui : {};
|
|
29222
29382
|
const oldOperatorName = typeof candidate.operatorName === "string" ? candidate.operatorName : undefined;
|
|
29223
29383
|
const seededWorkspaceRoots = await seedWorkspaceRoots({
|
|
@@ -29290,6 +29450,9 @@ async function normalizeSettingsRecord(value, options = {}) {
|
|
|
29290
29450
|
quickHits: normalizeStringList(phone.quickHits),
|
|
29291
29451
|
preparedAt: normalizeOptionalTimestamp(phone.preparedAt)
|
|
29292
29452
|
},
|
|
29453
|
+
voice: {
|
|
29454
|
+
realtimeEnabled: typeof voice.realtimeEnabled === "boolean" ? voice.realtimeEnabled : base.voice.realtimeEnabled
|
|
29455
|
+
},
|
|
29293
29456
|
ui: normalizeUi(ui)
|
|
29294
29457
|
};
|
|
29295
29458
|
}
|
|
@@ -30482,21 +30645,45 @@ var init_permission_policy2 = __esm(() => {
|
|
|
30482
30645
|
});
|
|
30483
30646
|
|
|
30484
30647
|
// ../runtime/src/user-config.ts
|
|
30485
|
-
import { existsSync as existsSync26, readFileSync as readFileSync13, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "fs";
|
|
30648
|
+
import { existsSync as existsSync26, readFileSync as readFileSync13, statSync as statSync7, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "fs";
|
|
30486
30649
|
import { homedir as homedir24 } from "os";
|
|
30487
30650
|
import { dirname as dirname16, join as join30 } from "path";
|
|
30488
30651
|
function userConfigPath() {
|
|
30489
30652
|
return join30(process.env.OPENSCOUT_HOME ?? join30(homedir24(), ".openscout"), "user.json");
|
|
30490
30653
|
}
|
|
30491
|
-
function
|
|
30492
|
-
const configPath = userConfigPath();
|
|
30493
|
-
if (!existsSync26(configPath))
|
|
30494
|
-
return {};
|
|
30654
|
+
function userConfigFileKey(configPath) {
|
|
30495
30655
|
try {
|
|
30496
|
-
|
|
30656
|
+
const stats = statSync7(configPath);
|
|
30657
|
+
return `${stats.ino}:${stats.mtimeMs}:${stats.size}`;
|
|
30497
30658
|
} catch {
|
|
30498
|
-
return
|
|
30659
|
+
return "missing";
|
|
30660
|
+
}
|
|
30661
|
+
}
|
|
30662
|
+
function readUserConfigFromDisk(configPath, now) {
|
|
30663
|
+
const fileKey = userConfigFileKey(configPath);
|
|
30664
|
+
let value = {};
|
|
30665
|
+
if (existsSync26(configPath)) {
|
|
30666
|
+
try {
|
|
30667
|
+
value = JSON.parse(readFileSync13(configPath, "utf8"));
|
|
30668
|
+
} catch {
|
|
30669
|
+
value = {};
|
|
30670
|
+
}
|
|
30499
30671
|
}
|
|
30672
|
+
userConfigCache = { path: configPath, value, fileKey, statCheckedAt: now };
|
|
30673
|
+
return { ...value };
|
|
30674
|
+
}
|
|
30675
|
+
function loadUserConfig(now = Date.now()) {
|
|
30676
|
+
const configPath = userConfigPath();
|
|
30677
|
+
if (userConfigCache && userConfigCache.path === configPath) {
|
|
30678
|
+
if (now - userConfigCache.statCheckedAt < USER_CONFIG_STAT_INTERVAL_MS) {
|
|
30679
|
+
return { ...userConfigCache.value };
|
|
30680
|
+
}
|
|
30681
|
+
if (userConfigFileKey(configPath) === userConfigCache.fileKey) {
|
|
30682
|
+
userConfigCache.statCheckedAt = now;
|
|
30683
|
+
return { ...userConfigCache.value };
|
|
30684
|
+
}
|
|
30685
|
+
}
|
|
30686
|
+
return readUserConfigFromDisk(configPath, now);
|
|
30500
30687
|
}
|
|
30501
30688
|
function readSettingsOperatorName() {
|
|
30502
30689
|
const settingsPath = resolveOpenScoutSupportPaths().settingsPath;
|
|
@@ -30521,6 +30708,7 @@ function resolveOperatorHandle() {
|
|
|
30521
30708
|
const config = loadUserConfig();
|
|
30522
30709
|
return normalizeHandle(config.handle) || normalizeHandle(process.env.OPENSCOUT_OPERATOR_HANDLE) || normalizeHandle(config.name) || normalizeHandle(process.env.OPENSCOUT_OPERATOR_NAME) || normalizeHandle(process.env.USER) || "operator";
|
|
30523
30710
|
}
|
|
30711
|
+
var userConfigCache = null, USER_CONFIG_STAT_INTERVAL_MS = 100;
|
|
30524
30712
|
var init_user_config = __esm(() => {
|
|
30525
30713
|
init_support_paths();
|
|
30526
30714
|
});
|
|
@@ -30923,6 +31111,13 @@ async function readLocalAgentRegistry() {
|
|
|
30923
31111
|
localAgentRecordFromRelayAgentOverride(agentId, override)
|
|
30924
31112
|
]));
|
|
30925
31113
|
}
|
|
31114
|
+
function invalidateArchivedLocalAgentIdsCache() {
|
|
31115
|
+
archivedLocalAgentIdsCache = null;
|
|
31116
|
+
}
|
|
31117
|
+
async function writeRelayAgentOverrides2(overrides) {
|
|
31118
|
+
await writeRelayAgentOverrides(overrides);
|
|
31119
|
+
invalidateArchivedLocalAgentIdsCache();
|
|
31120
|
+
}
|
|
30926
31121
|
async function writeLocalAgentRegistry(registry2) {
|
|
30927
31122
|
const overrides = await readRelayAgentOverrides();
|
|
30928
31123
|
const nextOverrides = {
|
|
@@ -30931,7 +31126,7 @@ async function writeLocalAgentRegistry(registry2) {
|
|
|
30931
31126
|
for (const [agentId, record2] of Object.entries(registry2)) {
|
|
30932
31127
|
nextOverrides[agentId] = relayAgentOverrideFromLocalAgentRecord(agentId, record2, overrides[agentId]);
|
|
30933
31128
|
}
|
|
30934
|
-
await
|
|
31129
|
+
await writeRelayAgentOverrides2(nextOverrides);
|
|
30935
31130
|
}
|
|
30936
31131
|
function expandHomePath4(value) {
|
|
30937
31132
|
if (value === "~") {
|
|
@@ -31805,7 +32000,7 @@ async function updateLocalAgentCardLifecycle(agentId, input) {
|
|
|
31805
32000
|
...override,
|
|
31806
32001
|
card: lifecycle
|
|
31807
32002
|
};
|
|
31808
|
-
await
|
|
32003
|
+
await writeRelayAgentOverrides2(overrides);
|
|
31809
32004
|
return lifecycle;
|
|
31810
32005
|
}
|
|
31811
32006
|
function oneTimeCardCreatedAt(lifecycle) {
|
|
@@ -31858,7 +32053,7 @@ async function retireLocalAgentOverrides(overrides, agentIds) {
|
|
|
31858
32053
|
delete overrides[agentId];
|
|
31859
32054
|
}
|
|
31860
32055
|
if (retired.length > 0) {
|
|
31861
|
-
await
|
|
32056
|
+
await writeRelayAgentOverrides2(overrides);
|
|
31862
32057
|
}
|
|
31863
32058
|
return retired;
|
|
31864
32059
|
}
|
|
@@ -31903,7 +32098,7 @@ async function retireLocalAgent(agentId) {
|
|
|
31903
32098
|
await stopLocalAgent(agentId).catch(() => null);
|
|
31904
32099
|
const nextOverrides = { ...overrides };
|
|
31905
32100
|
delete nextOverrides[agentId];
|
|
31906
|
-
await
|
|
32101
|
+
await writeRelayAgentOverrides2(nextOverrides);
|
|
31907
32102
|
return {
|
|
31908
32103
|
...status,
|
|
31909
32104
|
isOnline: false
|
|
@@ -32557,7 +32752,7 @@ async function startLocalAgent(input) {
|
|
|
32557
32752
|
wakePolicy: "on_demand"
|
|
32558
32753
|
}
|
|
32559
32754
|
};
|
|
32560
|
-
await
|
|
32755
|
+
await writeRelayAgentOverrides2(overrides);
|
|
32561
32756
|
targetAgentId = instance2.id;
|
|
32562
32757
|
} else if (requestedDefinitionId && requestedDefinitionId !== matchingOverride.definitionId) {
|
|
32563
32758
|
const matchingProjectRoot = normalizeProjectPath(matchingOverride.projectRoot);
|
|
@@ -32609,7 +32804,7 @@ async function startLocalAgent(input) {
|
|
|
32609
32804
|
wakePolicy: "on_demand"
|
|
32610
32805
|
}
|
|
32611
32806
|
};
|
|
32612
|
-
await
|
|
32807
|
+
await writeRelayAgentOverrides2(overrides);
|
|
32613
32808
|
targetAgentId = instance2.id;
|
|
32614
32809
|
} else {
|
|
32615
32810
|
const operatorAugmentDefaults = operatorAugmentDefaultsForDefinitionId(matchingOverride.definitionId ?? requestedDefinitionId);
|
|
@@ -32646,7 +32841,7 @@ async function startLocalAgent(input) {
|
|
|
32646
32841
|
wakePolicy: "on_demand"
|
|
32647
32842
|
} : matchingOverride.runtime
|
|
32648
32843
|
};
|
|
32649
|
-
await
|
|
32844
|
+
await writeRelayAgentOverrides2(overrides);
|
|
32650
32845
|
}
|
|
32651
32846
|
targetAgentId = matchingAgentId;
|
|
32652
32847
|
}
|
|
@@ -33032,7 +33227,7 @@ async function ensureLocalAgentBindingOnline(agentId, nodeId, options = {}) {
|
|
|
33032
33227
|
const onlineRecord = await ensureLocalAgentOnline(agentId, recordForHarness(localAgentRecordFromRelayAgentOverride(agentId, override), options.harness));
|
|
33033
33228
|
return buildLocalAgentBinding(agentId, onlineRecord, isLocalAgentRecordOnline(agentId, onlineRecord), nodeId, "relay-agent-registry");
|
|
33034
33229
|
}
|
|
33035
|
-
var MODULE_DIRECTORY, OPENSCOUT_REPO_ROOT, DEFAULT_LOCAL_AGENT_CAPABILITIES, DEFAULT_LOCAL_AGENT_HARNESS = "claude", DEFAULT_ONE_TIME_LOCAL_AGENT_CARD_TTL_MS, SUPPORTED_SCOUT_HARNESSES, DEFAULT_CLAUDE_SCOUT_ALLOWED_TOOLS, localAgentOnlineFlights, TMUX_VERIFY_IDLE_DEADLINE_MS, TMUX_VERIFY_BUSY_DEADLINE_MS, TMUX_DEFAULT_COLUMNS, TMUX_DEFAULT_ROWS, TMUX_READY_TIMEOUT_MS = 20000, TMUX_READY_POLL_MS = 250, TMUX_READY_TAIL_LINES = 80;
|
|
33230
|
+
var MODULE_DIRECTORY, OPENSCOUT_REPO_ROOT, DEFAULT_LOCAL_AGENT_CAPABILITIES, DEFAULT_LOCAL_AGENT_HARNESS = "claude", DEFAULT_ONE_TIME_LOCAL_AGENT_CARD_TTL_MS, SUPPORTED_SCOUT_HARNESSES, archivedLocalAgentIdsCache = null, DEFAULT_CLAUDE_SCOUT_ALLOWED_TOOLS, localAgentOnlineFlights, TMUX_VERIFY_IDLE_DEADLINE_MS, TMUX_VERIFY_BUSY_DEADLINE_MS, TMUX_DEFAULT_COLUMNS, TMUX_DEFAULT_ROWS, TMUX_READY_TIMEOUT_MS = 20000, TMUX_READY_POLL_MS = 250, TMUX_READY_TAIL_LINES = 80;
|
|
33036
33231
|
var init_local_agents = __esm(() => {
|
|
33037
33232
|
init_secret_redaction();
|
|
33038
33233
|
init_codex_executable();
|
|
@@ -33090,7 +33285,7 @@ var init_local_agents = __esm(() => {
|
|
|
33090
33285
|
// ../web/server/core/pairing/runtime/config.ts
|
|
33091
33286
|
init_local_config();
|
|
33092
33287
|
init_open_scout_network();
|
|
33093
|
-
import { existsSync as
|
|
33288
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
33094
33289
|
import { homedir as homedir3 } from "os";
|
|
33095
33290
|
import path from "path";
|
|
33096
33291
|
var PAIRING_QR_TTL_MS = 5 * 60 * 1000;
|
|
@@ -33108,11 +33303,11 @@ function pairingPaths() {
|
|
|
33108
33303
|
}
|
|
33109
33304
|
function loadPairingConfig() {
|
|
33110
33305
|
const { configPath } = pairingPaths();
|
|
33111
|
-
if (!
|
|
33306
|
+
if (!existsSync4(configPath)) {
|
|
33112
33307
|
return {};
|
|
33113
33308
|
}
|
|
33114
33309
|
try {
|
|
33115
|
-
const payload = JSON.parse(
|
|
33310
|
+
const payload = JSON.parse(readFileSync4(configPath, "utf8"));
|
|
33116
33311
|
return typeof payload === "object" && payload ? payload : {};
|
|
33117
33312
|
} catch {
|
|
33118
33313
|
return {};
|
|
@@ -34476,7 +34671,7 @@ function sql(strings, ...params) {
|
|
|
34476
34671
|
return new SQL([new StringChunk(str)]);
|
|
34477
34672
|
}
|
|
34478
34673
|
sql2.raw = raw;
|
|
34479
|
-
function
|
|
34674
|
+
function join6(chunks, separator) {
|
|
34480
34675
|
const result = [];
|
|
34481
34676
|
for (const [i, chunk] of chunks.entries()) {
|
|
34482
34677
|
if (i > 0 && separator !== undefined) {
|
|
@@ -34486,7 +34681,7 @@ function sql(strings, ...params) {
|
|
|
34486
34681
|
}
|
|
34487
34682
|
return new SQL(result);
|
|
34488
34683
|
}
|
|
34489
|
-
sql2.join =
|
|
34684
|
+
sql2.join = join6;
|
|
34490
34685
|
function identifier(value) {
|
|
34491
34686
|
return new Name(value);
|
|
34492
34687
|
}
|
|
@@ -37428,10 +37623,12 @@ class InMemoryControlRuntime {
|
|
|
37428
37623
|
}
|
|
37429
37624
|
}
|
|
37430
37625
|
// ../runtime/src/sqlite-store.ts
|
|
37626
|
+
init_node_identity();
|
|
37431
37627
|
init_sqlite_adapter();
|
|
37432
37628
|
|
|
37433
37629
|
// ../runtime/src/control-plane-migrations.ts
|
|
37434
37630
|
init_support_paths();
|
|
37631
|
+
init_node_identity();
|
|
37435
37632
|
|
|
37436
37633
|
// ../runtime/src/budget-observations.ts
|
|
37437
37634
|
var QUOTA_HISTORY_BUCKET_MS = 60 * 60 * 1000;
|
|
@@ -57313,7 +57510,7 @@ function writeJsonAtomically(filePath, value) {
|
|
|
57313
57510
|
|
|
57314
57511
|
// ../web/server/core/pairing/runtime/runtime.ts
|
|
57315
57512
|
init_src2();
|
|
57316
|
-
import { homedir as
|
|
57513
|
+
import { homedir as homedir40 } from "os";
|
|
57317
57514
|
|
|
57318
57515
|
// ../web/server/core/pairing/runtime/bridge/bridge.ts
|
|
57319
57516
|
init_src2();
|
|
@@ -57488,7 +57685,7 @@ function resolveConfig() {
|
|
|
57488
57685
|
|
|
57489
57686
|
// ../web/server/core/pairing/runtime/bridge/fileserver.ts
|
|
57490
57687
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
57491
|
-
import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync20, realpathSync as realpathSync4, statSync as
|
|
57688
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync20, realpathSync as realpathSync4, statSync as statSync9, unlinkSync as unlinkSync2, writeFileSync as writeFileSync11 } from "fs";
|
|
57492
57689
|
import { BlockList, isIP } from "net";
|
|
57493
57690
|
import { isAbsolute as isAbsolute6, join as join38, relative as relative5, sep as sep2 } from "path";
|
|
57494
57691
|
import { homedir as homedir30 } from "os";
|
|
@@ -57554,7 +57751,7 @@ function readAuthorizedWebHandoff(token, scope) {
|
|
|
57554
57751
|
|
|
57555
57752
|
// ../web/server/core/pairing/runtime/bridge/artifact-presentation.ts
|
|
57556
57753
|
import { randomBytes as randomBytes7 } from "crypto";
|
|
57557
|
-
import { realpathSync as realpathSync3, statSync as
|
|
57754
|
+
import { realpathSync as realpathSync3, statSync as statSync8 } from "fs";
|
|
57558
57755
|
import { basename as basename11, dirname as dirname19, isAbsolute as isAbsolute5, relative as relative4, resolve as resolve14, sep } from "path";
|
|
57559
57756
|
var ARTIFACT_PRESENTATION_PATH_PREFIX = "/present/";
|
|
57560
57757
|
var ARTIFACT_PRESENTATION_DEFAULT_TTL_MS = 30 * 60 * 1000;
|
|
@@ -57571,14 +57768,14 @@ function createArtifactPresentation(input, options) {
|
|
|
57571
57768
|
if (!isPathInside2(allowedRoot, sourcePath)) {
|
|
57572
57769
|
throw new Error("sourcePath is outside the session workspace");
|
|
57573
57770
|
}
|
|
57574
|
-
const source =
|
|
57771
|
+
const source = statSync8(sourcePath);
|
|
57575
57772
|
const rootPath = source.isDirectory() ? sourcePath : dirname19(sourcePath);
|
|
57576
57773
|
const entryPath = normalizeRelativeEntry(source.isDirectory() ? input.entryPath?.trim() || "index.html" : basename11(sourcePath));
|
|
57577
57774
|
const entryTarget = requiredRealPath(resolve14(rootPath, entryPath), "entryPath");
|
|
57578
57775
|
if (!isPathInside2(rootPath, entryTarget)) {
|
|
57579
57776
|
throw new Error("entryPath leaves the presentation root");
|
|
57580
57777
|
}
|
|
57581
|
-
if (!
|
|
57778
|
+
if (!statSync8(entryTarget).isFile()) {
|
|
57582
57779
|
throw new Error("entryPath must name a file");
|
|
57583
57780
|
}
|
|
57584
57781
|
const id = `present-${randomBytes7(24).toString("base64url")}`;
|
|
@@ -57622,14 +57819,14 @@ function serveArtifactPresentation(req, url, now = Date.now()) {
|
|
|
57622
57819
|
if (!isPathInside2(grant.rootPath, target2)) {
|
|
57623
57820
|
return presentationResponse("Forbidden", 403);
|
|
57624
57821
|
}
|
|
57625
|
-
const targetStat =
|
|
57822
|
+
const targetStat = statSync8(target2);
|
|
57626
57823
|
if (targetStat.isDirectory()) {
|
|
57627
57824
|
try {
|
|
57628
57825
|
target2 = requiredRealPath(resolve14(target2, "index.html"), "artifact index");
|
|
57629
57826
|
} catch {
|
|
57630
57827
|
return presentationResponse("Not found", 404);
|
|
57631
57828
|
}
|
|
57632
|
-
if (!isPathInside2(grant.rootPath, target2) || !
|
|
57829
|
+
if (!isPathInside2(grant.rootPath, target2) || !statSync8(target2).isFile()) {
|
|
57633
57830
|
return presentationResponse("Not found", 404);
|
|
57634
57831
|
}
|
|
57635
57832
|
} else if (!targetStat.isFile()) {
|
|
@@ -57689,7 +57886,7 @@ function normalizeRelativeEntry(value) {
|
|
|
57689
57886
|
}
|
|
57690
57887
|
function requiredRealDirectory(path2, label) {
|
|
57691
57888
|
const real2 = requiredRealPath(path2, label);
|
|
57692
|
-
if (!
|
|
57889
|
+
if (!statSync8(real2).isDirectory()) {
|
|
57693
57890
|
throw new Error(`${label} must be a directory`);
|
|
57694
57891
|
}
|
|
57695
57892
|
return real2;
|
|
@@ -57937,7 +58134,7 @@ function resolveAllowedFile(filePath) {
|
|
|
57937
58134
|
return { status: "forbidden" };
|
|
57938
58135
|
}
|
|
57939
58136
|
try {
|
|
57940
|
-
return
|
|
58137
|
+
return statSync9(candidate).isFile() ? { status: "allowed", path: candidate } : { status: "missing" };
|
|
57941
58138
|
} catch {
|
|
57942
58139
|
return { status: "missing" };
|
|
57943
58140
|
}
|
|
@@ -58571,15 +58768,15 @@ function formatTimestamp(value) {
|
|
|
58571
58768
|
// ../web/server/core/pairing/runtime/bridge/server.ts
|
|
58572
58769
|
init_system_probes();
|
|
58573
58770
|
init_src2();
|
|
58574
|
-
import { readdirSync as readdirSync6, readFileSync as
|
|
58575
|
-
import { basename as basename13, isAbsolute as isAbsolute7, join as
|
|
58576
|
-
import { homedir as
|
|
58771
|
+
import { readdirSync as readdirSync6, readFileSync as readFileSync24, realpathSync as realpathSync5, statSync as statSync13 } from "fs";
|
|
58772
|
+
import { basename as basename13, isAbsolute as isAbsolute7, join as join46, relative as relative6, resolve as resolve18 } from "path";
|
|
58773
|
+
import { homedir as homedir37 } from "os";
|
|
58577
58774
|
|
|
58578
58775
|
// ../web/server/core/mobile/service.ts
|
|
58579
58776
|
init_src();
|
|
58580
58777
|
init_harness_catalog();
|
|
58581
58778
|
import { basename as basename12, resolve as resolve17 } from "path";
|
|
58582
|
-
import { statSync as
|
|
58779
|
+
import { statSync as statSync12 } from "fs";
|
|
58583
58780
|
init_setup();
|
|
58584
58781
|
|
|
58585
58782
|
// ../runtime/src/agent-workspace.ts
|
|
@@ -58649,6 +58846,372 @@ init_user_config();
|
|
|
58649
58846
|
// ../web/server/core/broker/paths.ts
|
|
58650
58847
|
init_src();
|
|
58651
58848
|
|
|
58849
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/url.js
|
|
58850
|
+
var splitPath = (path2) => {
|
|
58851
|
+
const paths2 = path2.split("/");
|
|
58852
|
+
if (paths2[0] === "") {
|
|
58853
|
+
paths2.shift();
|
|
58854
|
+
}
|
|
58855
|
+
return paths2;
|
|
58856
|
+
};
|
|
58857
|
+
var splitRoutingPath = (routePath) => {
|
|
58858
|
+
const { groups, path: path2 } = extractGroupsFromPath(routePath);
|
|
58859
|
+
const paths2 = splitPath(path2);
|
|
58860
|
+
return replaceGroupMarks(paths2, groups);
|
|
58861
|
+
};
|
|
58862
|
+
var extractGroupsFromPath = (path2) => {
|
|
58863
|
+
const groups = [];
|
|
58864
|
+
path2 = path2.replace(/\{[^}]+\}/g, (match, index2) => {
|
|
58865
|
+
const mark = `@${index2}`;
|
|
58866
|
+
groups.push([mark, match]);
|
|
58867
|
+
return mark;
|
|
58868
|
+
});
|
|
58869
|
+
return { groups, path: path2 };
|
|
58870
|
+
};
|
|
58871
|
+
var replaceGroupMarks = (paths2, groups) => {
|
|
58872
|
+
for (let i = groups.length - 1;i >= 0; i--) {
|
|
58873
|
+
const [mark] = groups[i];
|
|
58874
|
+
for (let j = paths2.length - 1;j >= 0; j--) {
|
|
58875
|
+
if (paths2[j].includes(mark)) {
|
|
58876
|
+
paths2[j] = paths2[j].replace(mark, groups[i][1]);
|
|
58877
|
+
break;
|
|
58878
|
+
}
|
|
58879
|
+
}
|
|
58880
|
+
}
|
|
58881
|
+
return paths2;
|
|
58882
|
+
};
|
|
58883
|
+
var patternCache = {};
|
|
58884
|
+
var getPattern = (label, next) => {
|
|
58885
|
+
if (label === "*") {
|
|
58886
|
+
return "*";
|
|
58887
|
+
}
|
|
58888
|
+
const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
58889
|
+
if (match) {
|
|
58890
|
+
const cacheKey = `${label}#${next}`;
|
|
58891
|
+
if (!patternCache[cacheKey]) {
|
|
58892
|
+
if (match[2]) {
|
|
58893
|
+
patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)];
|
|
58894
|
+
} else {
|
|
58895
|
+
patternCache[cacheKey] = [label, match[1], true];
|
|
58896
|
+
}
|
|
58897
|
+
}
|
|
58898
|
+
return patternCache[cacheKey];
|
|
58899
|
+
}
|
|
58900
|
+
return null;
|
|
58901
|
+
};
|
|
58902
|
+
var tryDecode = (str, decoder) => {
|
|
58903
|
+
try {
|
|
58904
|
+
return decoder(str);
|
|
58905
|
+
} catch {
|
|
58906
|
+
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
58907
|
+
try {
|
|
58908
|
+
return decoder(match);
|
|
58909
|
+
} catch {
|
|
58910
|
+
return match;
|
|
58911
|
+
}
|
|
58912
|
+
});
|
|
58913
|
+
}
|
|
58914
|
+
};
|
|
58915
|
+
var tryDecodeURI = (str) => tryDecode(str, decodeURI);
|
|
58916
|
+
var getPath = (request) => {
|
|
58917
|
+
const url = request.url;
|
|
58918
|
+
const start = url.indexOf("/", url.indexOf(":") + 4);
|
|
58919
|
+
let i = start;
|
|
58920
|
+
for (;i < url.length; i++) {
|
|
58921
|
+
const charCode = url.charCodeAt(i);
|
|
58922
|
+
if (charCode === 37) {
|
|
58923
|
+
const queryIndex = url.indexOf("?", i);
|
|
58924
|
+
const hashIndex = url.indexOf("#", i);
|
|
58925
|
+
const end = queryIndex === -1 ? hashIndex === -1 ? undefined : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
|
|
58926
|
+
const path2 = url.slice(start, end);
|
|
58927
|
+
return tryDecodeURI(path2.includes("%25") ? path2.replace(/%25/g, "%2525") : path2);
|
|
58928
|
+
} else if (charCode === 63 || charCode === 35) {
|
|
58929
|
+
break;
|
|
58930
|
+
}
|
|
58931
|
+
}
|
|
58932
|
+
return url.slice(start, i);
|
|
58933
|
+
};
|
|
58934
|
+
var getPathNoStrict = (request) => {
|
|
58935
|
+
const result = getPath(request);
|
|
58936
|
+
return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
|
|
58937
|
+
};
|
|
58938
|
+
var mergePath = (base, sub, ...rest) => {
|
|
58939
|
+
if (rest.length) {
|
|
58940
|
+
sub = mergePath(sub, ...rest);
|
|
58941
|
+
}
|
|
58942
|
+
return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
|
|
58943
|
+
};
|
|
58944
|
+
var checkOptionalParameter = (path2) => {
|
|
58945
|
+
if (path2.charCodeAt(path2.length - 1) !== 63 || !path2.includes(":")) {
|
|
58946
|
+
return null;
|
|
58947
|
+
}
|
|
58948
|
+
const segments = path2.split("/");
|
|
58949
|
+
const results = [];
|
|
58950
|
+
let basePath = "";
|
|
58951
|
+
segments.forEach((segment) => {
|
|
58952
|
+
if (segment !== "" && !/\:/.test(segment)) {
|
|
58953
|
+
basePath += "/" + segment;
|
|
58954
|
+
} else if (/\:/.test(segment)) {
|
|
58955
|
+
if (/\?/.test(segment)) {
|
|
58956
|
+
if (results.length === 0 && basePath === "") {
|
|
58957
|
+
results.push("/");
|
|
58958
|
+
} else {
|
|
58959
|
+
results.push(basePath);
|
|
58960
|
+
}
|
|
58961
|
+
const optionalSegment = segment.replace("?", "");
|
|
58962
|
+
basePath += "/" + optionalSegment;
|
|
58963
|
+
results.push(basePath);
|
|
58964
|
+
} else {
|
|
58965
|
+
basePath += "/" + segment;
|
|
58966
|
+
}
|
|
58967
|
+
}
|
|
58968
|
+
});
|
|
58969
|
+
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
58970
|
+
};
|
|
58971
|
+
var _decodeURI = (value) => {
|
|
58972
|
+
if (!/[%+]/.test(value)) {
|
|
58973
|
+
return value;
|
|
58974
|
+
}
|
|
58975
|
+
if (value.indexOf("+") !== -1) {
|
|
58976
|
+
value = value.replace(/\+/g, " ");
|
|
58977
|
+
}
|
|
58978
|
+
return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value;
|
|
58979
|
+
};
|
|
58980
|
+
var _getQueryParam = (url, key, multiple) => {
|
|
58981
|
+
let encoded;
|
|
58982
|
+
if (!multiple && key && !/[%+]/.test(key)) {
|
|
58983
|
+
let keyIndex2 = url.indexOf("?", 8);
|
|
58984
|
+
if (keyIndex2 === -1) {
|
|
58985
|
+
return;
|
|
58986
|
+
}
|
|
58987
|
+
if (!url.startsWith(key, keyIndex2 + 1)) {
|
|
58988
|
+
keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
|
|
58989
|
+
}
|
|
58990
|
+
while (keyIndex2 !== -1) {
|
|
58991
|
+
const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1);
|
|
58992
|
+
if (trailingKeyCode === 61) {
|
|
58993
|
+
const valueIndex = keyIndex2 + key.length + 2;
|
|
58994
|
+
const endIndex = url.indexOf("&", valueIndex);
|
|
58995
|
+
return _decodeURI(url.slice(valueIndex, endIndex === -1 ? undefined : endIndex));
|
|
58996
|
+
} else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) {
|
|
58997
|
+
return "";
|
|
58998
|
+
}
|
|
58999
|
+
keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
|
|
59000
|
+
}
|
|
59001
|
+
encoded = /[%+]/.test(url);
|
|
59002
|
+
if (!encoded) {
|
|
59003
|
+
return;
|
|
59004
|
+
}
|
|
59005
|
+
}
|
|
59006
|
+
const results = {};
|
|
59007
|
+
encoded ??= /[%+]/.test(url);
|
|
59008
|
+
let keyIndex = url.indexOf("?", 8);
|
|
59009
|
+
while (keyIndex !== -1) {
|
|
59010
|
+
const nextKeyIndex = url.indexOf("&", keyIndex + 1);
|
|
59011
|
+
let valueIndex = url.indexOf("=", keyIndex);
|
|
59012
|
+
if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) {
|
|
59013
|
+
valueIndex = -1;
|
|
59014
|
+
}
|
|
59015
|
+
let name2 = url.slice(keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? undefined : nextKeyIndex : valueIndex);
|
|
59016
|
+
if (encoded) {
|
|
59017
|
+
name2 = _decodeURI(name2);
|
|
59018
|
+
}
|
|
59019
|
+
keyIndex = nextKeyIndex;
|
|
59020
|
+
if (name2 === "") {
|
|
59021
|
+
continue;
|
|
59022
|
+
}
|
|
59023
|
+
let value;
|
|
59024
|
+
if (valueIndex === -1) {
|
|
59025
|
+
value = "";
|
|
59026
|
+
} else {
|
|
59027
|
+
value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? undefined : nextKeyIndex);
|
|
59028
|
+
if (encoded) {
|
|
59029
|
+
value = _decodeURI(value);
|
|
59030
|
+
}
|
|
59031
|
+
}
|
|
59032
|
+
if (multiple) {
|
|
59033
|
+
if (!(results[name2] && Array.isArray(results[name2]))) {
|
|
59034
|
+
results[name2] = [];
|
|
59035
|
+
}
|
|
59036
|
+
results[name2].push(value);
|
|
59037
|
+
} else {
|
|
59038
|
+
results[name2] ??= value;
|
|
59039
|
+
}
|
|
59040
|
+
}
|
|
59041
|
+
return key ? results[key] : results;
|
|
59042
|
+
};
|
|
59043
|
+
var getQueryParam = _getQueryParam;
|
|
59044
|
+
var getQueryParams = (url, key) => {
|
|
59045
|
+
return _getQueryParam(url, key, true);
|
|
59046
|
+
};
|
|
59047
|
+
var decodeURIComponent_ = decodeURIComponent;
|
|
59048
|
+
|
|
59049
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/middleware/serve-static/index.js
|
|
59050
|
+
var ENCODINGS = {
|
|
59051
|
+
br: ".br",
|
|
59052
|
+
zstd: ".zst",
|
|
59053
|
+
gzip: ".gz"
|
|
59054
|
+
};
|
|
59055
|
+
var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
|
|
59056
|
+
|
|
59057
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/router.js
|
|
59058
|
+
var METHOD_NAME_ALL = "ALL";
|
|
59059
|
+
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
59060
|
+
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
59061
|
+
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
59062
|
+
var UnsupportedPathError = class extends Error {
|
|
59063
|
+
};
|
|
59064
|
+
|
|
59065
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/constants.js
|
|
59066
|
+
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
59067
|
+
|
|
59068
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/helper/ssg/middleware.js
|
|
59069
|
+
var X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg";
|
|
59070
|
+
var SSG_DISABLED_RESPONSE = (() => {
|
|
59071
|
+
try {
|
|
59072
|
+
return new Response("SSG is disabled", {
|
|
59073
|
+
status: 404,
|
|
59074
|
+
headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" }
|
|
59075
|
+
});
|
|
59076
|
+
} catch {
|
|
59077
|
+
return null;
|
|
59078
|
+
}
|
|
59079
|
+
})();
|
|
59080
|
+
|
|
59081
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/html.js
|
|
59082
|
+
var HtmlEscapedCallbackPhase = {
|
|
59083
|
+
Stringify: 1,
|
|
59084
|
+
BeforeStream: 2,
|
|
59085
|
+
Stream: 3
|
|
59086
|
+
};
|
|
59087
|
+
var raw = (value, callbacks) => {
|
|
59088
|
+
const escapedString = new String(value);
|
|
59089
|
+
escapedString.isEscaped = true;
|
|
59090
|
+
escapedString.callbacks = callbacks;
|
|
59091
|
+
return escapedString;
|
|
59092
|
+
};
|
|
59093
|
+
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
59094
|
+
if (typeof str === "object" && !(str instanceof String)) {
|
|
59095
|
+
if (!(str instanceof Promise)) {
|
|
59096
|
+
str = str.toString();
|
|
59097
|
+
}
|
|
59098
|
+
if (str instanceof Promise) {
|
|
59099
|
+
str = await str;
|
|
59100
|
+
}
|
|
59101
|
+
}
|
|
59102
|
+
const callbacks = str.callbacks;
|
|
59103
|
+
if (!callbacks?.length) {
|
|
59104
|
+
return Promise.resolve(str);
|
|
59105
|
+
}
|
|
59106
|
+
if (buffer) {
|
|
59107
|
+
buffer[0] += str;
|
|
59108
|
+
} else {
|
|
59109
|
+
buffer = [str];
|
|
59110
|
+
}
|
|
59111
|
+
const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then((res) => Promise.all(res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))).then(() => buffer[0]));
|
|
59112
|
+
if (preserveCallbacks) {
|
|
59113
|
+
return raw(await resStr, callbacks);
|
|
59114
|
+
} else {
|
|
59115
|
+
return resStr;
|
|
59116
|
+
}
|
|
59117
|
+
};
|
|
59118
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/adapter/bun/ssg.js
|
|
59119
|
+
var { write: write3 } = Bun;
|
|
59120
|
+
|
|
59121
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/helper/websocket/index.js
|
|
59122
|
+
var WSContext = class {
|
|
59123
|
+
#init;
|
|
59124
|
+
constructor(init) {
|
|
59125
|
+
this.#init = init;
|
|
59126
|
+
this.raw = init.raw;
|
|
59127
|
+
this.url = init.url ? new URL(init.url) : null;
|
|
59128
|
+
this.protocol = init.protocol ?? null;
|
|
59129
|
+
}
|
|
59130
|
+
send(source, options) {
|
|
59131
|
+
this.#init.send(source, options ?? {});
|
|
59132
|
+
}
|
|
59133
|
+
raw;
|
|
59134
|
+
binaryType = "arraybuffer";
|
|
59135
|
+
get readyState() {
|
|
59136
|
+
return this.#init.readyState;
|
|
59137
|
+
}
|
|
59138
|
+
url;
|
|
59139
|
+
protocol;
|
|
59140
|
+
close(code, reason) {
|
|
59141
|
+
this.#init.close(code, reason);
|
|
59142
|
+
}
|
|
59143
|
+
};
|
|
59144
|
+
var defineWebSocketHelper = (handler) => {
|
|
59145
|
+
return (...args) => {
|
|
59146
|
+
if (typeof args[0] === "function") {
|
|
59147
|
+
const [createEvents, options] = args;
|
|
59148
|
+
return async function upgradeWebSocket(c, next) {
|
|
59149
|
+
const events2 = await createEvents(c);
|
|
59150
|
+
const result = await handler(c, events2, options);
|
|
59151
|
+
if (result) {
|
|
59152
|
+
return result;
|
|
59153
|
+
}
|
|
59154
|
+
await next();
|
|
59155
|
+
};
|
|
59156
|
+
} else {
|
|
59157
|
+
const [c, events2, options] = args;
|
|
59158
|
+
return (async () => {
|
|
59159
|
+
const upgraded = await handler(c, events2, options);
|
|
59160
|
+
if (!upgraded) {
|
|
59161
|
+
throw new Error("Failed to upgrade WebSocket");
|
|
59162
|
+
}
|
|
59163
|
+
return upgraded;
|
|
59164
|
+
})();
|
|
59165
|
+
}
|
|
59166
|
+
};
|
|
59167
|
+
};
|
|
59168
|
+
|
|
59169
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/adapter/bun/server.js
|
|
59170
|
+
var getBunServer = (c) => ("server" in c.env) ? c.env.server : c.env;
|
|
59171
|
+
|
|
59172
|
+
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/adapter/bun/websocket.js
|
|
59173
|
+
var upgradeWebSocket = defineWebSocketHelper((c, events2) => {
|
|
59174
|
+
const server = getBunServer(c);
|
|
59175
|
+
if (!server) {
|
|
59176
|
+
throw new TypeError("env has to include the 2nd argument of fetch.");
|
|
59177
|
+
}
|
|
59178
|
+
const upgradeResult = server.upgrade(c.req.raw, {
|
|
59179
|
+
data: {
|
|
59180
|
+
events: events2,
|
|
59181
|
+
url: new URL(c.req.url),
|
|
59182
|
+
protocol: c.req.url
|
|
59183
|
+
}
|
|
59184
|
+
});
|
|
59185
|
+
if (upgradeResult) {
|
|
59186
|
+
return new Response(null);
|
|
59187
|
+
}
|
|
59188
|
+
return;
|
|
59189
|
+
});
|
|
59190
|
+
|
|
59191
|
+
// ../web/server/server-core.ts
|
|
59192
|
+
function coalesce(fn, ttlMs = 2000) {
|
|
59193
|
+
let inflight = null;
|
|
59194
|
+
let cached = null;
|
|
59195
|
+
return () => {
|
|
59196
|
+
if (cached && Date.now() < cached.expiresAt) {
|
|
59197
|
+
return Promise.resolve(cached.value);
|
|
59198
|
+
}
|
|
59199
|
+
if (inflight) {
|
|
59200
|
+
return inflight;
|
|
59201
|
+
}
|
|
59202
|
+
inflight = fn().then((value) => {
|
|
59203
|
+
cached = { value, expiresAt: Date.now() + ttlMs };
|
|
59204
|
+
inflight = null;
|
|
59205
|
+
return value;
|
|
59206
|
+
}).catch((error) => {
|
|
59207
|
+
inflight = null;
|
|
59208
|
+
throw error;
|
|
59209
|
+
});
|
|
59210
|
+
return inflight;
|
|
59211
|
+
};
|
|
59212
|
+
}
|
|
59213
|
+
var SCOUT_API_LOG_ALL = process.env.SCOUT_PERF_LOG_API === "1";
|
|
59214
|
+
|
|
58652
59215
|
// ../web/server/core/broker/service.ts
|
|
58653
59216
|
var DEFAULT_SCOUT_BROKER_SNAPSHOT_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
58654
59217
|
var DEFAULT_SCOUT_BROKER_SNAPSHOT_BUCKET_MS = 60 * 1000;
|
|
@@ -58879,6 +59442,7 @@ async function readScoutBrokerHealth(baseUrl = resolveScoutBrokerUrl(), options
|
|
|
58879
59442
|
build: health.build ?? null,
|
|
58880
59443
|
services: health.services ?? null,
|
|
58881
59444
|
projection: health.projection ?? null,
|
|
59445
|
+
startup: health.startup ?? null,
|
|
58882
59446
|
counts: health.counts ? {
|
|
58883
59447
|
nodes: health.counts.nodes ?? 0,
|
|
58884
59448
|
actors: health.counts.actors ?? 0,
|
|
@@ -58911,6 +59475,7 @@ async function readScoutBrokerHealth(baseUrl = resolveScoutBrokerUrl(), options
|
|
|
58911
59475
|
build: null,
|
|
58912
59476
|
services: null,
|
|
58913
59477
|
projection: null,
|
|
59478
|
+
startup: null,
|
|
58914
59479
|
counts: null,
|
|
58915
59480
|
error: error instanceof Error ? error.message : null
|
|
58916
59481
|
};
|
|
@@ -58951,6 +59516,13 @@ async function readScoutBrokerTailRecent(limit = 50, baseUrl = resolveScoutBroke
|
|
|
58951
59516
|
return [];
|
|
58952
59517
|
}
|
|
58953
59518
|
}
|
|
59519
|
+
var readScoutBrokerNodeIdCoalesced = coalesce(async () => {
|
|
59520
|
+
const node = await brokerReadJson(resolveScoutBrokerUrl(), scoutBrokerPaths.v1.node);
|
|
59521
|
+
if (!node?.id) {
|
|
59522
|
+
throw new Error("broker /v1/node returned no node id");
|
|
59523
|
+
}
|
|
59524
|
+
return node.id;
|
|
59525
|
+
}, 30000);
|
|
58954
59526
|
async function recordScoutBrokerReadCursor(input, baseUrl = resolveScoutBrokerUrl()) {
|
|
58955
59527
|
const path2 = `${scoutBrokerPaths.v1.conversations}/${encodeURIComponent(input.conversationId)}/read-cursors`;
|
|
58956
59528
|
return brokerPostJson(baseUrl, path2, {
|
|
@@ -58961,7 +59533,15 @@ async function recordScoutBrokerReadCursor(input, baseUrl = resolveScoutBrokerUr
|
|
|
58961
59533
|
}
|
|
58962
59534
|
async function loadScoutBrokerContext(baseUrl = resolveScoutBrokerUrl(), options = {}) {
|
|
58963
59535
|
const since = options.since === undefined ? Math.floor((Date.now() - DEFAULT_SCOUT_BROKER_SNAPSHOT_WINDOW_MS) / DEFAULT_SCOUT_BROKER_SNAPSHOT_BUCKET_MS) * DEFAULT_SCOUT_BROKER_SNAPSHOT_BUCKET_MS : options.since;
|
|
58964
|
-
|
|
59536
|
+
if (options.force) {
|
|
59537
|
+
invalidateScoutBrokerContextCache(baseUrl);
|
|
59538
|
+
}
|
|
59539
|
+
const cacheKey = options.signal ? null : [
|
|
59540
|
+
baseUrl,
|
|
59541
|
+
resolveBrokerSocketPathForBaseUrl(baseUrl) ?? "http",
|
|
59542
|
+
since ?? "full",
|
|
59543
|
+
options.scope ?? "default"
|
|
59544
|
+
].join("\x00");
|
|
58965
59545
|
const now = Date.now();
|
|
58966
59546
|
for (const [key, entry] of scoutBrokerContextCache) {
|
|
58967
59547
|
if (entry.expiresAt <= now)
|
|
@@ -58976,7 +59556,13 @@ async function loadScoutBrokerContext(baseUrl = resolveScoutBrokerUrl(), options
|
|
|
58976
59556
|
if (!health.reachable || !health.ok) {
|
|
58977
59557
|
return null;
|
|
58978
59558
|
}
|
|
58979
|
-
const
|
|
59559
|
+
const snapshotQuery = new URLSearchParams;
|
|
59560
|
+
if (since && since > 0)
|
|
59561
|
+
snapshotQuery.set("since", String(Math.trunc(since)));
|
|
59562
|
+
if (options.scope)
|
|
59563
|
+
snapshotQuery.set("scope", options.scope);
|
|
59564
|
+
const queryString = snapshotQuery.toString();
|
|
59565
|
+
const snapshotPath = queryString ? `${scoutBrokerPaths.v1.snapshot}?${queryString}` : scoutBrokerPaths.v1.snapshot;
|
|
58980
59566
|
try {
|
|
58981
59567
|
const [node, snapshot] = await Promise.all([
|
|
58982
59568
|
brokerReadJson(baseUrl, scoutBrokerPaths.v1.node, { signal: options.signal }),
|
|
@@ -59756,8 +60342,8 @@ async function watchScoutMessages(options) {
|
|
|
59756
60342
|
const messagesById = new Map(Object.values(broker2.snapshot.messages ?? {}).map((message) => [message.id, message]));
|
|
59757
60343
|
const invocationsById = new Map(Object.values(broker2.snapshot.invocations ?? {}).map((invocation) => [invocation.id, invocation]));
|
|
59758
60344
|
const clientMessageIdFor = (message) => {
|
|
59759
|
-
const
|
|
59760
|
-
return typeof
|
|
60345
|
+
const raw2 = message?.metadata?.clientMessageId;
|
|
60346
|
+
return typeof raw2 === "string" && raw2.trim().length > 0 ? raw2.trim() : null;
|
|
59761
60347
|
};
|
|
59762
60348
|
const lifecycleStateForFlight = (state) => {
|
|
59763
60349
|
switch (state) {
|
|
@@ -60659,10 +61245,10 @@ init_claude_statusline();
|
|
|
60659
61245
|
init_pi_rpc();
|
|
60660
61246
|
init_system_probes();
|
|
60661
61247
|
import { createHash as createHash6 } from "crypto";
|
|
60662
|
-
import { existsSync as existsSync35, mkdirSync as mkdirSync16, readdirSync as readdirSync5, readFileSync as readFileSync21, renameSync as renameSync5, statSync as
|
|
61248
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync16, readdirSync as readdirSync5, readFileSync as readFileSync21, renameSync as renameSync5, statSync as statSync10, writeFileSync as writeFileSync12 } from "fs";
|
|
60663
61249
|
import { open } from "fs/promises";
|
|
60664
61250
|
import { homedir as homedir33 } from "os";
|
|
60665
|
-
import { dirname as
|
|
61251
|
+
import { dirname as dirname21, join as join41 } from "path";
|
|
60666
61252
|
import { createInterface as createInterface2 } from "readline";
|
|
60667
61253
|
import { Database as Database3 } from "bun:sqlite";
|
|
60668
61254
|
var CACHE_TTL_MS = 60 * 1000;
|
|
@@ -61205,6 +61791,7 @@ function storedQuotaWindowGauge(row, history = []) {
|
|
|
61205
61791
|
label: formatStoredQuotaWindowLabel(row),
|
|
61206
61792
|
...usage,
|
|
61207
61793
|
resetAt,
|
|
61794
|
+
...windowMs === undefined ? {} : { windowMs },
|
|
61208
61795
|
capturedAt: row.capturedAt,
|
|
61209
61796
|
source: quotaSnapshotSourceLabel(row),
|
|
61210
61797
|
...history.length === 0 ? {} : { history }
|
|
@@ -61430,13 +62017,13 @@ function kimiWindowMs(window2) {
|
|
|
61430
62017
|
return null;
|
|
61431
62018
|
}
|
|
61432
62019
|
function kimiMembershipPlan(payload) {
|
|
61433
|
-
const
|
|
61434
|
-
if (!
|
|
62020
|
+
const raw2 = stringValue10(payload.user?.membership?.level);
|
|
62021
|
+
if (!raw2)
|
|
61435
62022
|
return;
|
|
61436
|
-
return
|
|
62023
|
+
return raw2.replace(/^LEVEL_/u, "").toLowerCase().replace(/(^|_)([a-z])/gu, (_match, prefix, letter) => `${prefix ? " " : ""}${letter.toUpperCase()}`);
|
|
61437
62024
|
}
|
|
61438
62025
|
function dashboardImportPath() {
|
|
61439
|
-
return join41(
|
|
62026
|
+
return join41(dirname21(resolveDbPath()), "provider-usage-snapshots.json");
|
|
61440
62027
|
}
|
|
61441
62028
|
function readDashboardUsageStore() {
|
|
61442
62029
|
const record2 = readJsonRecord(dashboardImportPath());
|
|
@@ -62176,7 +62763,7 @@ function homeDir() {
|
|
|
62176
62763
|
}
|
|
62177
62764
|
function safeStat(path2) {
|
|
62178
62765
|
try {
|
|
62179
|
-
return
|
|
62766
|
+
return statSync10(path2);
|
|
62180
62767
|
} catch {
|
|
62181
62768
|
return null;
|
|
62182
62769
|
}
|
|
@@ -62419,7 +63006,7 @@ init_src();
|
|
|
62419
63006
|
init_support_paths();
|
|
62420
63007
|
import { mkdir as mkdir10, readFile as readFile11, writeFile as writeFile8 } from "fs/promises";
|
|
62421
63008
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
62422
|
-
import { dirname as
|
|
63009
|
+
import { dirname as dirname22, join as join42 } from "path";
|
|
62423
63010
|
class ScoutbotThreadMapStore {
|
|
62424
63011
|
filePath;
|
|
62425
63012
|
constructor(filePath = defaultScoutbotThreadMapPath()) {
|
|
@@ -62535,8 +63122,8 @@ class ScoutbotThreadMapStore {
|
|
|
62535
63122
|
}
|
|
62536
63123
|
async read() {
|
|
62537
63124
|
try {
|
|
62538
|
-
const
|
|
62539
|
-
const parsed = JSON.parse(
|
|
63125
|
+
const raw2 = await readFile11(this.filePath, "utf8");
|
|
63126
|
+
const parsed = JSON.parse(raw2);
|
|
62540
63127
|
const threads = Array.isArray(parsed.threads) ? parsed.threads.filter(isThreadRecord).map((thread) => ({
|
|
62541
63128
|
...thread,
|
|
62542
63129
|
transportSessionId: normalizeSessionId(thread.transportSessionId)
|
|
@@ -62554,7 +63141,7 @@ class ScoutbotThreadMapStore {
|
|
|
62554
63141
|
}
|
|
62555
63142
|
}
|
|
62556
63143
|
async write(map) {
|
|
62557
|
-
await mkdir10(
|
|
63144
|
+
await mkdir10(dirname22(this.filePath), { recursive: true });
|
|
62558
63145
|
await writeFile8(this.filePath, `${JSON.stringify(map, null, 2)}
|
|
62559
63146
|
`, "utf8");
|
|
62560
63147
|
}
|
|
@@ -62952,121 +63539,19 @@ function describeError(cause) {
|
|
|
62952
63539
|
|
|
62953
63540
|
// ../web/server/pairing.ts
|
|
62954
63541
|
import {
|
|
62955
|
-
|
|
62956
|
-
mkdirSync as mkdirSync18,
|
|
62957
|
-
readFileSync as readFileSync23,
|
|
62958
|
-
statSync as statSync10,
|
|
62959
|
-
unlinkSync as unlinkSync3,
|
|
62960
|
-
writeFileSync as writeFileSync14
|
|
62961
|
-
} from "fs";
|
|
62962
|
-
import { homedir as homedir35 } from "os";
|
|
62963
|
-
import { dirname as dirname23, join as join44, resolve as resolve15 } from "path";
|
|
62964
|
-
init_setup();
|
|
62965
|
-
|
|
62966
|
-
// ../runtime/src/pairing-supervisor.ts
|
|
62967
|
-
import { execFileSync as execFileSync6 } from "child_process";
|
|
62968
|
-
import { randomUUID as randomUUID6 } from "crypto";
|
|
62969
|
-
import {
|
|
63542
|
+
closeSync,
|
|
62970
63543
|
existsSync as existsSync36,
|
|
62971
63544
|
mkdirSync as mkdirSync17,
|
|
63545
|
+
openSync,
|
|
62972
63546
|
readFileSync as readFileSync22,
|
|
62973
|
-
|
|
62974
|
-
|
|
63547
|
+
readSync,
|
|
63548
|
+
statSync as statSync11,
|
|
63549
|
+
unlinkSync as unlinkSync3,
|
|
62975
63550
|
writeFileSync as writeFileSync13
|
|
62976
63551
|
} from "fs";
|
|
62977
63552
|
import { homedir as homedir34 } from "os";
|
|
62978
|
-
import { dirname as
|
|
62979
|
-
|
|
62980
|
-
var SCOUT_PAIRING_RUNTIME_PID_FILE = "runtime.pid";
|
|
62981
|
-
var SCOUT_PAIRING_RUNTIME_OWNER_FILE = "runtime-owner.json";
|
|
62982
|
-
var SCOUT_PAIRING_SUPERVISOR_PID_FILE = "supervisor.pid";
|
|
62983
|
-
var SCOUT_PAIRING_RUNTIME_PROCESS_MARKER = "pairing-runtime-controller";
|
|
62984
|
-
function resolveScoutPairingSupervisorPaths(env = process.env) {
|
|
62985
|
-
const configuredRoot = env.OPENSCOUT_PAIRING_HOME?.trim() || env.SCOUT_PAIRING_HOME?.trim();
|
|
62986
|
-
const rootDir = configuredRoot || join43(homedir34(), ".scout", "pairing");
|
|
62987
|
-
return {
|
|
62988
|
-
rootDir,
|
|
62989
|
-
intentPath: join43(rootDir, SCOUT_PAIRING_SUPERVISOR_INTENT_FILE),
|
|
62990
|
-
runtimePidPath: join43(rootDir, SCOUT_PAIRING_RUNTIME_PID_FILE),
|
|
62991
|
-
runtimeOwnerPath: join43(rootDir, SCOUT_PAIRING_RUNTIME_OWNER_FILE),
|
|
62992
|
-
supervisorPidPath: join43(rootDir, SCOUT_PAIRING_SUPERVISOR_PID_FILE)
|
|
62993
|
-
};
|
|
62994
|
-
}
|
|
62995
|
-
function inspectScoutPairingProcess(pid) {
|
|
62996
|
-
if (!Number.isInteger(pid) || pid <= 0)
|
|
62997
|
-
return null;
|
|
62998
|
-
try {
|
|
62999
|
-
const output = execFileSync6("ps", ["-p", String(pid), "-o", "lstart=", "-o", "command="], {
|
|
63000
|
-
encoding: "utf8",
|
|
63001
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
63002
|
-
}).trim();
|
|
63003
|
-
const startedAt = output.slice(0, 24).trim().replace(/\s+/g, " ");
|
|
63004
|
-
const command = output.slice(24).trim();
|
|
63005
|
-
return startedAt && command ? { pid, startedAt, command } : null;
|
|
63006
|
-
} catch {
|
|
63007
|
-
return null;
|
|
63008
|
-
}
|
|
63009
|
-
}
|
|
63010
|
-
function readScoutPairingRuntimeOwner(ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath) {
|
|
63011
|
-
if (!existsSync36(ownerPath))
|
|
63012
|
-
return null;
|
|
63013
|
-
try {
|
|
63014
|
-
const value = JSON.parse(readFileSync22(ownerPath, "utf8"));
|
|
63015
|
-
return value.version === 1 && Number.isInteger(value.pid) && (value.pid ?? 0) > 0 && typeof value.token === "string" && value.token.length >= 16 && typeof value.startedAt === "string" && value.startedAt.length > 0 && typeof value.command === "string" && value.command.includes(SCOUT_PAIRING_RUNTIME_PROCESS_MARKER) && typeof value.claimedAt === "number" && Number.isFinite(value.claimedAt) ? value : null;
|
|
63016
|
-
} catch {
|
|
63017
|
-
return null;
|
|
63018
|
-
}
|
|
63019
|
-
}
|
|
63020
|
-
function isScoutPairingRuntimeOwnerLive(owner, options = {}) {
|
|
63021
|
-
if (!owner || options.expectedToken && owner.token !== options.expectedToken)
|
|
63022
|
-
return false;
|
|
63023
|
-
const current = (options.inspect ?? inspectScoutPairingProcess)(owner.pid);
|
|
63024
|
-
return current !== null && current.startedAt === owner.startedAt && current.command === owner.command && current.command.includes(SCOUT_PAIRING_RUNTIME_PROCESS_MARKER);
|
|
63025
|
-
}
|
|
63026
|
-
function readLiveScoutPairingRuntimeOwner(ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath, options = {}) {
|
|
63027
|
-
const owner = readScoutPairingRuntimeOwner(ownerPath);
|
|
63028
|
-
return isScoutPairingRuntimeOwnerLive(owner, options) ? owner : null;
|
|
63029
|
-
}
|
|
63030
|
-
function claimScoutPairingRuntimeOwnership(options = {}) {
|
|
63031
|
-
const pid = options.pid ?? process.pid;
|
|
63032
|
-
const ownerPath = options.ownerPath ?? resolveScoutPairingSupervisorPaths().runtimeOwnerPath;
|
|
63033
|
-
const inspect = options.inspect ?? inspectScoutPairingProcess;
|
|
63034
|
-
const existing = readLiveScoutPairingRuntimeOwner(ownerPath, { inspect });
|
|
63035
|
-
if (existing && existing.pid !== pid) {
|
|
63036
|
-
throw new Error(`Scout pairing runtime is already owned by pid ${existing.pid}.`);
|
|
63037
|
-
}
|
|
63038
|
-
const identity = inspect(pid);
|
|
63039
|
-
if (!identity || !identity.command.includes(SCOUT_PAIRING_RUNTIME_PROCESS_MARKER)) {
|
|
63040
|
-
throw new Error(`Cannot prove Scout pairing runtime ownership for pid ${pid}.`);
|
|
63041
|
-
}
|
|
63042
|
-
const owner = {
|
|
63043
|
-
version: 1,
|
|
63044
|
-
...identity,
|
|
63045
|
-
token: options.token?.trim() || randomUUID6(),
|
|
63046
|
-
claimedAt: options.now ?? Date.now()
|
|
63047
|
-
};
|
|
63048
|
-
mkdirSync17(dirname22(ownerPath), { recursive: true });
|
|
63049
|
-
writeFileAtomically(ownerPath, `${JSON.stringify(owner, null, 2)}
|
|
63050
|
-
`);
|
|
63051
|
-
return owner;
|
|
63052
|
-
}
|
|
63053
|
-
function releaseScoutPairingRuntimeOwnership(owner, ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath) {
|
|
63054
|
-
const current = readScoutPairingRuntimeOwner(ownerPath);
|
|
63055
|
-
if (!current || current.pid !== owner.pid || current.token !== owner.token)
|
|
63056
|
-
return;
|
|
63057
|
-
rmSync4(ownerPath, { force: true });
|
|
63058
|
-
}
|
|
63059
|
-
function writeFileAtomically(path2, contents) {
|
|
63060
|
-
const temporaryPath = `${path2}.${process.pid}.${Date.now()}.tmp`;
|
|
63061
|
-
try {
|
|
63062
|
-
writeFileSync13(temporaryPath, contents);
|
|
63063
|
-
renameSync6(temporaryPath, path2);
|
|
63064
|
-
} finally {
|
|
63065
|
-
rmSync4(temporaryPath, { force: true });
|
|
63066
|
-
}
|
|
63067
|
-
}
|
|
63068
|
-
|
|
63069
|
-
// ../web/server/pairing.ts
|
|
63553
|
+
import { dirname as dirname23, join as join43, resolve as resolve15 } from "path";
|
|
63554
|
+
init_setup();
|
|
63070
63555
|
init_local_config();
|
|
63071
63556
|
init_tool_resolution();
|
|
63072
63557
|
var SCOUT_PAIRING_HOME_DIRECTORY = ".scout/pairing";
|
|
@@ -63075,25 +63560,25 @@ var SCOUT_PAIRING_IDENTITY_FILE = "identity.json";
|
|
|
63075
63560
|
var SCOUT_PAIRING_TRUSTED_PEERS_FILE = "trusted-peers.json";
|
|
63076
63561
|
var SCOUT_PAIRING_LOG_FILE = "bridge.log";
|
|
63077
63562
|
var SCOUT_PAIRING_RUNTIME_STATE_FILE = "runtime.json";
|
|
63078
|
-
var
|
|
63563
|
+
var SCOUT_PAIRING_RUNTIME_PID_FILE = "runtime.pid";
|
|
63079
63564
|
var SCOUT_PAIRING_DEFAULT_PORT = 7888;
|
|
63080
63565
|
var SCOUT_PAIRING_RUNTIME_VERSION = 1;
|
|
63081
63566
|
var SCOUT_PAIRING_BRIDGE_CONNECT_TIMEOUT_MS = 1500;
|
|
63082
63567
|
var SCOUT_PAIRING_BRIDGE_REQUEST_TIMEOUT_MS = 2500;
|
|
63083
63568
|
function resolveScoutPairingHomeDirectory() {
|
|
63084
63569
|
const configured = process.env.OPENSCOUT_PAIRING_HOME?.trim() || process.env.SCOUT_PAIRING_HOME?.trim();
|
|
63085
|
-
return configured ||
|
|
63570
|
+
return configured || join43(homedir34(), SCOUT_PAIRING_HOME_DIRECTORY);
|
|
63086
63571
|
}
|
|
63087
63572
|
function resolveScoutPairingPaths() {
|
|
63088
63573
|
const rootDir = resolveScoutPairingHomeDirectory();
|
|
63089
63574
|
return {
|
|
63090
63575
|
rootDir,
|
|
63091
|
-
configPath:
|
|
63092
|
-
identityPath:
|
|
63093
|
-
trustedPeersPath:
|
|
63094
|
-
logPath:
|
|
63095
|
-
runtimeStatePath:
|
|
63096
|
-
runtimePidPath:
|
|
63576
|
+
configPath: join43(rootDir, SCOUT_PAIRING_CONFIG_FILE),
|
|
63577
|
+
identityPath: join43(rootDir, SCOUT_PAIRING_IDENTITY_FILE),
|
|
63578
|
+
trustedPeersPath: join43(rootDir, SCOUT_PAIRING_TRUSTED_PEERS_FILE),
|
|
63579
|
+
logPath: join43(rootDir, SCOUT_PAIRING_LOG_FILE),
|
|
63580
|
+
runtimeStatePath: join43(rootDir, SCOUT_PAIRING_RUNTIME_STATE_FILE),
|
|
63581
|
+
runtimePidPath: join43(rootDir, SCOUT_PAIRING_RUNTIME_PID_FILE)
|
|
63097
63582
|
};
|
|
63098
63583
|
}
|
|
63099
63584
|
function createScoutPairingBridgeUrl(port) {
|
|
@@ -63132,10 +63617,10 @@ async function createScoutPairingBridgeClient(port) {
|
|
|
63132
63617
|
socket.addEventListener("error", handleError);
|
|
63133
63618
|
});
|
|
63134
63619
|
const handleMessage = (event) => {
|
|
63135
|
-
const
|
|
63620
|
+
const raw2 = typeof event.data === "string" ? event.data : String(event.data);
|
|
63136
63621
|
let payload;
|
|
63137
63622
|
try {
|
|
63138
|
-
payload = JSON.parse(
|
|
63623
|
+
payload = JSON.parse(raw2);
|
|
63139
63624
|
} catch {
|
|
63140
63625
|
return;
|
|
63141
63626
|
}
|
|
@@ -63234,11 +63719,11 @@ async function loadScoutPairingSessionSnapshots(port) {
|
|
|
63234
63719
|
}
|
|
63235
63720
|
function loadScoutPairingConfig() {
|
|
63236
63721
|
const { configPath } = resolveScoutPairingPaths();
|
|
63237
|
-
if (!
|
|
63722
|
+
if (!existsSync36(configPath)) {
|
|
63238
63723
|
return {};
|
|
63239
63724
|
}
|
|
63240
63725
|
try {
|
|
63241
|
-
const payload = JSON.parse(
|
|
63726
|
+
const payload = JSON.parse(readFileSync22(configPath, "utf8"));
|
|
63242
63727
|
return typeof payload === "object" && payload ? payload : {};
|
|
63243
63728
|
} catch {
|
|
63244
63729
|
return {};
|
|
@@ -63259,11 +63744,11 @@ function resolveScoutPairingConfig() {
|
|
|
63259
63744
|
}
|
|
63260
63745
|
function readScoutPairingRuntimeSnapshot() {
|
|
63261
63746
|
const { runtimeStatePath } = resolveScoutPairingPaths();
|
|
63262
|
-
if (!
|
|
63747
|
+
if (!existsSync36(runtimeStatePath)) {
|
|
63263
63748
|
return null;
|
|
63264
63749
|
}
|
|
63265
63750
|
try {
|
|
63266
|
-
const parsed = JSON.parse(
|
|
63751
|
+
const parsed = JSON.parse(readFileSync22(runtimeStatePath, "utf8"));
|
|
63267
63752
|
return parsed?.version === SCOUT_PAIRING_RUNTIME_VERSION ? parsed : null;
|
|
63268
63753
|
} catch {
|
|
63269
63754
|
return null;
|
|
@@ -63271,18 +63756,18 @@ function readScoutPairingRuntimeSnapshot() {
|
|
|
63271
63756
|
}
|
|
63272
63757
|
function readScoutPairingRuntimePid() {
|
|
63273
63758
|
const { runtimePidPath } = resolveScoutPairingPaths();
|
|
63274
|
-
if (!
|
|
63759
|
+
if (!existsSync36(runtimePidPath)) {
|
|
63275
63760
|
return null;
|
|
63276
63761
|
}
|
|
63277
63762
|
try {
|
|
63278
|
-
const
|
|
63279
|
-
const pid = Number(
|
|
63763
|
+
const raw2 = readFileSync22(runtimePidPath, "utf8").trim();
|
|
63764
|
+
const pid = Number(raw2);
|
|
63280
63765
|
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
63281
63766
|
} catch {
|
|
63282
63767
|
return null;
|
|
63283
63768
|
}
|
|
63284
63769
|
}
|
|
63285
|
-
function
|
|
63770
|
+
function isScoutPairingProcessRunning2(pid) {
|
|
63286
63771
|
if (!pid || !Number.isInteger(pid) || pid <= 0) {
|
|
63287
63772
|
return false;
|
|
63288
63773
|
}
|
|
@@ -63295,13 +63780,15 @@ function isScoutPairingProcessRunning(pid) {
|
|
|
63295
63780
|
}
|
|
63296
63781
|
function isScoutPairingRuntimeRunning() {
|
|
63297
63782
|
const pid = readScoutPairingRuntimePid();
|
|
63298
|
-
if (
|
|
63783
|
+
if (isScoutPairingProcessRunning2(pid)) {
|
|
63299
63784
|
return true;
|
|
63300
63785
|
}
|
|
63301
63786
|
const snapshot = readScoutPairingRuntimeSnapshot();
|
|
63302
|
-
return Boolean(snapshot &&
|
|
63787
|
+
return Boolean(snapshot && isScoutPairingProcessRunning2(snapshot.childPid ?? snapshot.pid));
|
|
63303
63788
|
}
|
|
63789
|
+
var SCOUT_PAIRING_LOG_TAIL_WINDOW_BYTES = 256 * 1024;
|
|
63304
63790
|
var pairingMutationChain = Promise.resolve();
|
|
63791
|
+
var coalescedPairingStateReads = new Map;
|
|
63305
63792
|
async function getScoutWebPairingSessionSnapshots() {
|
|
63306
63793
|
if (!isScoutPairingRuntimeRunning()) {
|
|
63307
63794
|
return [];
|
|
@@ -63312,8 +63799,8 @@ async function getScoutWebPairingSessionSnapshots() {
|
|
|
63312
63799
|
|
|
63313
63800
|
// ../web/server/core/agent-endpoints.ts
|
|
63314
63801
|
init_src();
|
|
63315
|
-
import { homedir as
|
|
63316
|
-
import { join as
|
|
63802
|
+
import { homedir as homedir35 } from "os";
|
|
63803
|
+
import { join as join44, resolve as resolve16 } from "path";
|
|
63317
63804
|
function endpointMetadataRecord(endpoint) {
|
|
63318
63805
|
return endpoint?.metadata && typeof endpoint.metadata === "object" && !Array.isArray(endpoint.metadata) ? endpoint.metadata : {};
|
|
63319
63806
|
}
|
|
@@ -63347,10 +63834,10 @@ function endpointSessionAliases(endpoint) {
|
|
|
63347
63834
|
}
|
|
63348
63835
|
function expandHomePath5(value) {
|
|
63349
63836
|
if (value === "~") {
|
|
63350
|
-
return
|
|
63837
|
+
return homedir35();
|
|
63351
63838
|
}
|
|
63352
63839
|
if (value.startsWith("~/")) {
|
|
63353
|
-
return
|
|
63840
|
+
return join44(homedir35(), value.slice(2));
|
|
63354
63841
|
}
|
|
63355
63842
|
return value;
|
|
63356
63843
|
}
|
|
@@ -63703,7 +64190,7 @@ async function loadMobileWorkspaceInventory(currentDirectory) {
|
|
|
63703
64190
|
}
|
|
63704
64191
|
function isDirectory2(path2) {
|
|
63705
64192
|
try {
|
|
63706
|
-
return
|
|
64193
|
+
return statSync12(path2).isDirectory();
|
|
63707
64194
|
} catch {
|
|
63708
64195
|
return false;
|
|
63709
64196
|
}
|
|
@@ -64656,17 +65143,17 @@ init_system_probes();
|
|
|
64656
65143
|
import { createHash as createHash9 } from "crypto";
|
|
64657
65144
|
import {
|
|
64658
65145
|
chmodSync as chmodSync2,
|
|
64659
|
-
closeSync,
|
|
64660
|
-
existsSync as
|
|
64661
|
-
mkdirSync as
|
|
64662
|
-
openSync,
|
|
64663
|
-
readFileSync as
|
|
64664
|
-
renameSync as
|
|
65146
|
+
closeSync as closeSync2,
|
|
65147
|
+
existsSync as existsSync37,
|
|
65148
|
+
mkdirSync as mkdirSync18,
|
|
65149
|
+
openSync as openSync2,
|
|
65150
|
+
readFileSync as readFileSync23,
|
|
65151
|
+
renameSync as renameSync6,
|
|
64665
65152
|
unlinkSync as unlinkSync4,
|
|
64666
|
-
writeFileSync as
|
|
65153
|
+
writeFileSync as writeFileSync14
|
|
64667
65154
|
} from "fs";
|
|
64668
|
-
import { homedir as
|
|
64669
|
-
import { join as
|
|
65155
|
+
import { homedir as homedir36, hostname as hostname3, userInfo as userInfo2 } from "os";
|
|
65156
|
+
import { join as join45 } from "path";
|
|
64670
65157
|
|
|
64671
65158
|
// ../web/server/core/pairing/runtime/bridge/ssh-terminal-access.ts
|
|
64672
65159
|
import { createHash as createHash7 } from "crypto";
|
|
@@ -64893,8 +65380,8 @@ function authorizedMobileTerminalSessionName(requestedSessionName, provisionedSe
|
|
|
64893
65380
|
|
|
64894
65381
|
// ../web/server/core/pairing/runtime/bridge/mobile-terminal-provision.ts
|
|
64895
65382
|
async function readMobileTerminalStatus(requestedSessionName, deviceId) {
|
|
64896
|
-
const authorizedKeysPath =
|
|
64897
|
-
const authorizedKeys =
|
|
65383
|
+
const authorizedKeysPath = join45(homedir36(), ".ssh", "authorized_keys");
|
|
65384
|
+
const authorizedKeys = existsSync37(authorizedKeysPath) ? readFileSync23(authorizedKeysPath, "utf8") : "";
|
|
64898
65385
|
const provisionedSessionName = findSshTerminalSessionForDevice(authorizedKeys, deviceId);
|
|
64899
65386
|
const sessionName = authorizedMobileTerminalSessionName(requestedSessionName, provisionedSessionName);
|
|
64900
65387
|
const base = {
|
|
@@ -64966,17 +65453,17 @@ async function readMobileTerminalStatus(requestedSessionName, deviceId) {
|
|
|
64966
65453
|
async function provisionMobileTerminalAccess(sshPublicKey, deviceId, deviceClass = undefined) {
|
|
64967
65454
|
const id = deviceId?.trim() || "scout-ios-device";
|
|
64968
65455
|
const sessionName = provisionedMobileTerminalSessionName(sshPublicKey, deviceClass);
|
|
64969
|
-
const sshDir =
|
|
64970
|
-
const authorizedKeysPath =
|
|
65456
|
+
const sshDir = join45(homedir36(), ".ssh");
|
|
65457
|
+
const authorizedKeysPath = join45(sshDir, "authorized_keys");
|
|
64971
65458
|
const hostKeyFingerprint = readRequiredHostKeyFingerprint();
|
|
64972
65459
|
const result = withAuthorizedKeysLock(sshDir, () => {
|
|
64973
|
-
if (!
|
|
64974
|
-
|
|
65460
|
+
if (!existsSync37(sshDir)) {
|
|
65461
|
+
mkdirSync18(sshDir, { recursive: true, mode: 448 });
|
|
64975
65462
|
}
|
|
64976
65463
|
try {
|
|
64977
65464
|
chmodSync2(sshDir, 448);
|
|
64978
65465
|
} catch {}
|
|
64979
|
-
const existing =
|
|
65466
|
+
const existing = existsSync37(authorizedKeysPath) ? readFileSync23(authorizedKeysPath, "utf8") : "";
|
|
64980
65467
|
const result2 = provisionSshTerminalAccess({
|
|
64981
65468
|
authorizedKeys: existing,
|
|
64982
65469
|
deviceId: id,
|
|
@@ -65024,7 +65511,7 @@ function resolveReachableHost() {
|
|
|
65024
65511
|
}
|
|
65025
65512
|
function readRequiredHostKeyFingerprint() {
|
|
65026
65513
|
try {
|
|
65027
|
-
const pub =
|
|
65514
|
+
const pub = readFileSync23("/etc/ssh/ssh_host_ed25519_key.pub", "utf8");
|
|
65028
65515
|
const keyData = pub.trim().split(/\s+/)[1];
|
|
65029
65516
|
if (!keyData)
|
|
65030
65517
|
throw new Error("missing key data");
|
|
@@ -65038,8 +65525,8 @@ function readRequiredHostKeyFingerprint() {
|
|
|
65038
65525
|
function writeAuthorizedKeysAtomically(path2, contents) {
|
|
65039
65526
|
const tmpPath = `${path2}.scout-${process.pid}-${Date.now()}.tmp`;
|
|
65040
65527
|
try {
|
|
65041
|
-
|
|
65042
|
-
|
|
65528
|
+
writeFileSync14(tmpPath, contents, { mode: 384, flag: "wx" });
|
|
65529
|
+
renameSync6(tmpPath, path2);
|
|
65043
65530
|
} catch (error) {
|
|
65044
65531
|
try {
|
|
65045
65532
|
unlinkSync4(tmpPath);
|
|
@@ -65048,15 +65535,15 @@ function writeAuthorizedKeysAtomically(path2, contents) {
|
|
|
65048
65535
|
}
|
|
65049
65536
|
}
|
|
65050
65537
|
function withAuthorizedKeysLock(sshDir, action) {
|
|
65051
|
-
if (!
|
|
65052
|
-
|
|
65538
|
+
if (!existsSync37(sshDir)) {
|
|
65539
|
+
mkdirSync18(sshDir, { recursive: true, mode: 448 });
|
|
65053
65540
|
}
|
|
65054
|
-
const lockPath =
|
|
65541
|
+
const lockPath = join45(sshDir, ".scout-authorized-keys.lock");
|
|
65055
65542
|
const deadline = Date.now() + 5000;
|
|
65056
65543
|
let fd = null;
|
|
65057
65544
|
while (fd === null) {
|
|
65058
65545
|
try {
|
|
65059
|
-
fd =
|
|
65546
|
+
fd = openSync2(lockPath, "wx", 384);
|
|
65060
65547
|
} catch (error) {
|
|
65061
65548
|
const code = typeof error === "object" && error && "code" in error ? String(error.code) : "";
|
|
65062
65549
|
if (code !== "EEXIST" || Date.now() >= deadline) {
|
|
@@ -65073,7 +65560,7 @@ function withAuthorizedKeysLock(sshDir, action) {
|
|
|
65073
65560
|
return action();
|
|
65074
65561
|
} finally {
|
|
65075
65562
|
try {
|
|
65076
|
-
|
|
65563
|
+
closeSync2(lockFd);
|
|
65077
65564
|
} finally {
|
|
65078
65565
|
try {
|
|
65079
65566
|
unlinkSync4(lockPath);
|
|
@@ -65290,7 +65777,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
65290
65777
|
if (dirName.startsWith("-")) {
|
|
65291
65778
|
const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
|
|
65292
65779
|
try {
|
|
65293
|
-
|
|
65780
|
+
statSync13(candidate);
|
|
65294
65781
|
cwd = candidate;
|
|
65295
65782
|
} catch {
|
|
65296
65783
|
const config = resolveConfig();
|
|
@@ -65347,7 +65834,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
65347
65834
|
}
|
|
65348
65835
|
const root = resolveWorkspaceRoot(configuredRoot);
|
|
65349
65836
|
const projectPath = resolveWorkspacePath(root, p.path);
|
|
65350
|
-
const stat6 =
|
|
65837
|
+
const stat6 = statSync13(projectPath);
|
|
65351
65838
|
if (!stat6.isDirectory()) {
|
|
65352
65839
|
return { id: req.id, error: { code: -32000, message: "Workspace target is not a directory" } };
|
|
65353
65840
|
}
|
|
@@ -65644,7 +66131,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
65644
66131
|
const config = resolveConfig();
|
|
65645
66132
|
const workspaceRoot = config.workspace?.root ? resolveWorkspaceRoot(config.workspace.root) : null;
|
|
65646
66133
|
const matches = await readSessionSearch({
|
|
65647
|
-
home:
|
|
66134
|
+
home: homedir37(),
|
|
65648
66135
|
workspaceRoot,
|
|
65649
66136
|
maxAgeDays: maxAge,
|
|
65650
66137
|
limit,
|
|
@@ -65659,7 +66146,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
65659
66146
|
return { id: req.id, error: { code: -32000, message: "Only .jsonl files can be read" } };
|
|
65660
66147
|
}
|
|
65661
66148
|
try {
|
|
65662
|
-
const content =
|
|
66149
|
+
const content = readFileSync24(p.path, "utf-8");
|
|
65663
66150
|
const lines = content.split(`
|
|
65664
66151
|
`).filter((l) => l.trim().length > 0);
|
|
65665
66152
|
const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
|
|
@@ -65780,13 +66267,13 @@ function resolveMobileCurrentDirectory() {
|
|
|
65780
66267
|
}
|
|
65781
66268
|
}
|
|
65782
66269
|
function resolveWorkspaceRoot(root) {
|
|
65783
|
-
const expandedRoot = root.replace(/^~/,
|
|
66270
|
+
const expandedRoot = root.replace(/^~/, homedir37());
|
|
65784
66271
|
return realpathSync5(expandedRoot);
|
|
65785
66272
|
}
|
|
65786
66273
|
function resolveWorkspacePath(root, requestedPath) {
|
|
65787
66274
|
const normalizedRoot = resolveWorkspaceRoot(root);
|
|
65788
|
-
const expandedPath = requestedPath?.replace(/^~/,
|
|
65789
|
-
const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath :
|
|
66275
|
+
const expandedPath = requestedPath?.replace(/^~/, homedir37());
|
|
66276
|
+
const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath : join46(normalizedRoot, expandedPath) : normalizedRoot;
|
|
65790
66277
|
const resolvedCandidate = realpathSync5(candidate);
|
|
65791
66278
|
const rel = relative6(normalizedRoot, resolvedCandidate);
|
|
65792
66279
|
if (rel === "" || !rel.startsWith("..") && !isAbsolute7(rel)) {
|
|
@@ -65816,9 +66303,9 @@ function listDirectories(dirPath) {
|
|
|
65816
66303
|
continue;
|
|
65817
66304
|
if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
|
|
65818
66305
|
continue;
|
|
65819
|
-
const fullPath =
|
|
66306
|
+
const fullPath = join46(dirPath, name2);
|
|
65820
66307
|
try {
|
|
65821
|
-
const stat6 =
|
|
66308
|
+
const stat6 = statSync13(fullPath);
|
|
65822
66309
|
if (!stat6.isDirectory())
|
|
65823
66310
|
continue;
|
|
65824
66311
|
const children = new Set(readdirSync6(fullPath));
|
|
@@ -65842,7 +66329,7 @@ async function discoverSessionFiles(maxAgeDays, limit) {
|
|
|
65842
66329
|
const config = resolveConfig();
|
|
65843
66330
|
const workspaceRoot = config.workspace?.root ? resolveWorkspaceRoot(config.workspace.root) : null;
|
|
65844
66331
|
const sessions4 = await readSessionFileScan({
|
|
65845
|
-
home:
|
|
66332
|
+
home: homedir37(),
|
|
65846
66333
|
workspaceRoot,
|
|
65847
66334
|
maxAgeDays,
|
|
65848
66335
|
limit
|
|
@@ -80248,9 +80735,9 @@ init_src2();
|
|
|
80248
80735
|
init_system_probes();
|
|
80249
80736
|
init_local_config();
|
|
80250
80737
|
init_local_agents();
|
|
80251
|
-
import { readFileSync as
|
|
80252
|
-
import { basename as basename14, isAbsolute as isAbsolute8, join as
|
|
80253
|
-
import { homedir as
|
|
80738
|
+
import { readFileSync as readFileSync25, readdirSync as readdirSync7, realpathSync as realpathSync6, statSync as statSync14 } from "fs";
|
|
80739
|
+
import { basename as basename14, isAbsolute as isAbsolute8, join as join47, relative as relative7, resolve as resolve19 } from "path";
|
|
80740
|
+
import { homedir as homedir38 } from "os";
|
|
80254
80741
|
var t = initTRPC.context().create();
|
|
80255
80742
|
var logged = t.middleware(async ({ path: path2, type, next }) => {
|
|
80256
80743
|
const start = Date.now();
|
|
@@ -80321,8 +80808,8 @@ var VOICE_LEG_HEALTH_TIMEOUT_MS = 300;
|
|
|
80321
80808
|
var VOICE_LEG_HEALTH_TTL_MS = 5000;
|
|
80322
80809
|
var voiceLegHealthCache = null;
|
|
80323
80810
|
function resolveVoiceLegPort() {
|
|
80324
|
-
const
|
|
80325
|
-
return Number.isInteger(
|
|
80811
|
+
const raw2 = Number(process.env.SCOUT_RTC_PORT);
|
|
80812
|
+
return Number.isInteger(raw2) && raw2 > 0 && raw2 < 65536 ? raw2 : 8090;
|
|
80326
80813
|
}
|
|
80327
80814
|
async function probeVoiceLegHealth(port) {
|
|
80328
80815
|
const now = Date.now();
|
|
@@ -80416,13 +80903,13 @@ function resolveMobileCurrentDirectory2() {
|
|
|
80416
80903
|
}
|
|
80417
80904
|
}
|
|
80418
80905
|
function resolveWorkspaceRoot2(root) {
|
|
80419
|
-
const expandedRoot = root.replace(/^~/,
|
|
80906
|
+
const expandedRoot = root.replace(/^~/, homedir38());
|
|
80420
80907
|
return realpathSync6(expandedRoot);
|
|
80421
80908
|
}
|
|
80422
80909
|
function resolveWorkspacePath2(root, requestedPath) {
|
|
80423
80910
|
const normalizedRoot = resolveWorkspaceRoot2(root);
|
|
80424
|
-
const expandedPath = requestedPath?.replace(/^~/,
|
|
80425
|
-
const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath :
|
|
80911
|
+
const expandedPath = requestedPath?.replace(/^~/, homedir38());
|
|
80912
|
+
const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath : join47(normalizedRoot, expandedPath) : normalizedRoot;
|
|
80426
80913
|
const resolvedCandidate = realpathSync6(candidate);
|
|
80427
80914
|
const rel = relative7(normalizedRoot, resolvedCandidate);
|
|
80428
80915
|
if (rel === "" || !rel.startsWith("..") && !isAbsolute8(rel)) {
|
|
@@ -80452,9 +80939,9 @@ function listDirectories2(dirPath) {
|
|
|
80452
80939
|
continue;
|
|
80453
80940
|
if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
|
|
80454
80941
|
continue;
|
|
80455
|
-
const fullPath =
|
|
80942
|
+
const fullPath = join47(dirPath, name2);
|
|
80456
80943
|
try {
|
|
80457
|
-
const stat6 =
|
|
80944
|
+
const stat6 = statSync14(fullPath);
|
|
80458
80945
|
if (!stat6.isDirectory())
|
|
80459
80946
|
continue;
|
|
80460
80947
|
const children = new Set(readdirSync7(fullPath));
|
|
@@ -80485,7 +80972,7 @@ async function discoverSessionFiles2(maxAgeDays, limit) {
|
|
|
80485
80972
|
const config2 = resolveConfig();
|
|
80486
80973
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
|
|
80487
80974
|
const sessions4 = await readSessionFileScan({
|
|
80488
|
-
home:
|
|
80975
|
+
home: homedir38(),
|
|
80489
80976
|
workspaceRoot,
|
|
80490
80977
|
maxAgeDays,
|
|
80491
80978
|
limit
|
|
@@ -80717,7 +81204,7 @@ var sessionRouter = t.router({
|
|
|
80717
81204
|
if (dirName.startsWith("-")) {
|
|
80718
81205
|
const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
|
|
80719
81206
|
try {
|
|
80720
|
-
|
|
81207
|
+
statSync14(candidate);
|
|
80721
81208
|
cwd = candidate;
|
|
80722
81209
|
} catch {
|
|
80723
81210
|
const config2 = resolveConfig();
|
|
@@ -81132,7 +81619,7 @@ var workspaceRouter = t.router({
|
|
|
81132
81619
|
}
|
|
81133
81620
|
const root = resolveWorkspaceRoot2(configuredRoot);
|
|
81134
81621
|
const projectPath = resolveWorkspacePath2(root, input.path);
|
|
81135
|
-
const stat6 =
|
|
81622
|
+
const stat6 = statSync14(projectPath);
|
|
81136
81623
|
if (!stat6.isDirectory()) {
|
|
81137
81624
|
throw new TRPCError({
|
|
81138
81625
|
code: "BAD_REQUEST",
|
|
@@ -81174,7 +81661,7 @@ var historyRouter = t.router({
|
|
|
81174
81661
|
const config2 = resolveConfig();
|
|
81175
81662
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
|
|
81176
81663
|
const matches = await readSessionSearch({
|
|
81177
|
-
home:
|
|
81664
|
+
home: homedir38(),
|
|
81178
81665
|
workspaceRoot,
|
|
81179
81666
|
maxAgeDays: maxAge,
|
|
81180
81667
|
limit,
|
|
@@ -81191,7 +81678,7 @@ var historyRouter = t.router({
|
|
|
81191
81678
|
});
|
|
81192
81679
|
}
|
|
81193
81680
|
try {
|
|
81194
|
-
const content =
|
|
81681
|
+
const content = readFileSync25(input.path, "utf-8");
|
|
81195
81682
|
const lines = content.split(`
|
|
81196
81683
|
`).filter((l) => l.trim().length > 0);
|
|
81197
81684
|
const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
|
|
@@ -81223,8 +81710,8 @@ var historyRouter = t.router({
|
|
|
81223
81710
|
});
|
|
81224
81711
|
}
|
|
81225
81712
|
try {
|
|
81226
|
-
const fileStat =
|
|
81227
|
-
const content =
|
|
81713
|
+
const fileStat = statSync14(input.path);
|
|
81714
|
+
const content = readFileSync25(input.path, "utf-8");
|
|
81228
81715
|
const replay = createHistorySessionSnapshot({
|
|
81229
81716
|
path: input.path,
|
|
81230
81717
|
content,
|
|
@@ -81528,14 +82015,14 @@ function connectToRelay(relayUrl, identity, bridge, options = {}) {
|
|
|
81528
82015
|
events2?.onError?.({ relayUrl: eventRelayUrl, room: qrPayload.room, error: error48 });
|
|
81529
82016
|
});
|
|
81530
82017
|
}
|
|
81531
|
-
function handleRelaySocketMessage(
|
|
81532
|
-
const envelope = parseRelayEnvelope2(
|
|
82018
|
+
function handleRelaySocketMessage(raw2) {
|
|
82019
|
+
const envelope = parseRelayEnvelope2(raw2);
|
|
81533
82020
|
if (!secure) {
|
|
81534
|
-
handlePlaintextRelayMessage(envelope,
|
|
82021
|
+
handlePlaintextRelayMessage(envelope, raw2);
|
|
81535
82022
|
return;
|
|
81536
82023
|
}
|
|
81537
82024
|
if (!envelope) {
|
|
81538
|
-
const payload = asStringPayload(
|
|
82025
|
+
const payload = asStringPayload(raw2);
|
|
81539
82026
|
if (!payload)
|
|
81540
82027
|
return;
|
|
81541
82028
|
routeSecurePayload(LEGACY_CLIENT_ID, payload);
|
|
@@ -81625,14 +82112,14 @@ function connectToRelay(relayUrl, identity, bridge, options = {}) {
|
|
|
81625
82112
|
securePeers.delete(clientId);
|
|
81626
82113
|
maybeReleaseMobileSubscriptions();
|
|
81627
82114
|
}
|
|
81628
|
-
function handlePlaintextRelayMessage(envelope,
|
|
82115
|
+
function handlePlaintextRelayMessage(envelope, raw2) {
|
|
81629
82116
|
if (envelope?.event === "close") {
|
|
81630
82117
|
plaintextClients.delete(envelope.clientId);
|
|
81631
82118
|
maybeReleaseMobileSubscriptions();
|
|
81632
82119
|
return;
|
|
81633
82120
|
}
|
|
81634
82121
|
const clientId = envelope?.clientId ?? LEGACY_CLIENT_ID;
|
|
81635
|
-
const payload = envelope?.payload ?? asStringPayload(
|
|
82122
|
+
const payload = envelope?.payload ?? asStringPayload(raw2);
|
|
81636
82123
|
if (!payload)
|
|
81637
82124
|
return;
|
|
81638
82125
|
const isNewClient = !plaintextClients.has(clientId);
|
|
@@ -81746,10 +82233,10 @@ function connectToRelay(relayUrl, identity, bridge, options = {}) {
|
|
|
81746
82233
|
}));
|
|
81747
82234
|
}
|
|
81748
82235
|
}
|
|
81749
|
-
function handlePlaintextMessage(clientId,
|
|
82236
|
+
function handlePlaintextMessage(clientId, raw2) {
|
|
81750
82237
|
let req;
|
|
81751
82238
|
try {
|
|
81752
|
-
req = JSON.parse(
|
|
82239
|
+
req = JSON.parse(raw2);
|
|
81753
82240
|
} catch {
|
|
81754
82241
|
sendRelayMessage(clientId, JSON.stringify({ id: null, error: { code: -32700, message: "Parse error" } }));
|
|
81755
82242
|
return;
|
|
@@ -81884,12 +82371,12 @@ function detectHandshakePattern(payload) {
|
|
|
81884
82371
|
return null;
|
|
81885
82372
|
}
|
|
81886
82373
|
}
|
|
81887
|
-
function parseRelayEnvelope2(
|
|
81888
|
-
if (typeof
|
|
82374
|
+
function parseRelayEnvelope2(raw2) {
|
|
82375
|
+
if (typeof raw2 !== "string") {
|
|
81889
82376
|
return null;
|
|
81890
82377
|
}
|
|
81891
82378
|
try {
|
|
81892
|
-
const parsed = JSON.parse(
|
|
82379
|
+
const parsed = JSON.parse(raw2);
|
|
81893
82380
|
if (parsed.phase !== "relay" || typeof parsed.clientId !== "string") {
|
|
81894
82381
|
return null;
|
|
81895
82382
|
}
|
|
@@ -81908,15 +82395,15 @@ function parseRelayEnvelope2(raw) {
|
|
|
81908
82395
|
return null;
|
|
81909
82396
|
}
|
|
81910
82397
|
}
|
|
81911
|
-
function asStringPayload(
|
|
81912
|
-
if (typeof
|
|
81913
|
-
return
|
|
82398
|
+
function asStringPayload(raw2) {
|
|
82399
|
+
if (typeof raw2 === "string") {
|
|
82400
|
+
return raw2;
|
|
81914
82401
|
}
|
|
81915
|
-
if (
|
|
81916
|
-
return new TextDecoder().decode(
|
|
82402
|
+
if (raw2 instanceof Uint8Array) {
|
|
82403
|
+
return new TextDecoder().decode(raw2);
|
|
81917
82404
|
}
|
|
81918
|
-
if (
|
|
81919
|
-
return new TextDecoder().decode(new Uint8Array(
|
|
82405
|
+
if (raw2 instanceof ArrayBuffer) {
|
|
82406
|
+
return new TextDecoder().decode(new Uint8Array(raw2));
|
|
81920
82407
|
}
|
|
81921
82408
|
return null;
|
|
81922
82409
|
}
|
|
@@ -82039,206 +82526,6 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
82039
82526
|
});
|
|
82040
82527
|
};
|
|
82041
82528
|
|
|
82042
|
-
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/url.js
|
|
82043
|
-
var splitPath = (path2) => {
|
|
82044
|
-
const paths2 = path2.split("/");
|
|
82045
|
-
if (paths2[0] === "") {
|
|
82046
|
-
paths2.shift();
|
|
82047
|
-
}
|
|
82048
|
-
return paths2;
|
|
82049
|
-
};
|
|
82050
|
-
var splitRoutingPath = (routePath) => {
|
|
82051
|
-
const { groups, path: path2 } = extractGroupsFromPath(routePath);
|
|
82052
|
-
const paths2 = splitPath(path2);
|
|
82053
|
-
return replaceGroupMarks(paths2, groups);
|
|
82054
|
-
};
|
|
82055
|
-
var extractGroupsFromPath = (path2) => {
|
|
82056
|
-
const groups = [];
|
|
82057
|
-
path2 = path2.replace(/\{[^}]+\}/g, (match, index2) => {
|
|
82058
|
-
const mark = `@${index2}`;
|
|
82059
|
-
groups.push([mark, match]);
|
|
82060
|
-
return mark;
|
|
82061
|
-
});
|
|
82062
|
-
return { groups, path: path2 };
|
|
82063
|
-
};
|
|
82064
|
-
var replaceGroupMarks = (paths2, groups) => {
|
|
82065
|
-
for (let i = groups.length - 1;i >= 0; i--) {
|
|
82066
|
-
const [mark] = groups[i];
|
|
82067
|
-
for (let j = paths2.length - 1;j >= 0; j--) {
|
|
82068
|
-
if (paths2[j].includes(mark)) {
|
|
82069
|
-
paths2[j] = paths2[j].replace(mark, groups[i][1]);
|
|
82070
|
-
break;
|
|
82071
|
-
}
|
|
82072
|
-
}
|
|
82073
|
-
}
|
|
82074
|
-
return paths2;
|
|
82075
|
-
};
|
|
82076
|
-
var patternCache = {};
|
|
82077
|
-
var getPattern = (label, next) => {
|
|
82078
|
-
if (label === "*") {
|
|
82079
|
-
return "*";
|
|
82080
|
-
}
|
|
82081
|
-
const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
82082
|
-
if (match) {
|
|
82083
|
-
const cacheKey = `${label}#${next}`;
|
|
82084
|
-
if (!patternCache[cacheKey]) {
|
|
82085
|
-
if (match[2]) {
|
|
82086
|
-
patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)];
|
|
82087
|
-
} else {
|
|
82088
|
-
patternCache[cacheKey] = [label, match[1], true];
|
|
82089
|
-
}
|
|
82090
|
-
}
|
|
82091
|
-
return patternCache[cacheKey];
|
|
82092
|
-
}
|
|
82093
|
-
return null;
|
|
82094
|
-
};
|
|
82095
|
-
var tryDecode = (str, decoder) => {
|
|
82096
|
-
try {
|
|
82097
|
-
return decoder(str);
|
|
82098
|
-
} catch {
|
|
82099
|
-
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
82100
|
-
try {
|
|
82101
|
-
return decoder(match);
|
|
82102
|
-
} catch {
|
|
82103
|
-
return match;
|
|
82104
|
-
}
|
|
82105
|
-
});
|
|
82106
|
-
}
|
|
82107
|
-
};
|
|
82108
|
-
var tryDecodeURI = (str) => tryDecode(str, decodeURI);
|
|
82109
|
-
var getPath = (request) => {
|
|
82110
|
-
const url2 = request.url;
|
|
82111
|
-
const start = url2.indexOf("/", url2.indexOf(":") + 4);
|
|
82112
|
-
let i = start;
|
|
82113
|
-
for (;i < url2.length; i++) {
|
|
82114
|
-
const charCode = url2.charCodeAt(i);
|
|
82115
|
-
if (charCode === 37) {
|
|
82116
|
-
const queryIndex = url2.indexOf("?", i);
|
|
82117
|
-
const hashIndex = url2.indexOf("#", i);
|
|
82118
|
-
const end = queryIndex === -1 ? hashIndex === -1 ? undefined : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
|
|
82119
|
-
const path2 = url2.slice(start, end);
|
|
82120
|
-
return tryDecodeURI(path2.includes("%25") ? path2.replace(/%25/g, "%2525") : path2);
|
|
82121
|
-
} else if (charCode === 63 || charCode === 35) {
|
|
82122
|
-
break;
|
|
82123
|
-
}
|
|
82124
|
-
}
|
|
82125
|
-
return url2.slice(start, i);
|
|
82126
|
-
};
|
|
82127
|
-
var getPathNoStrict = (request) => {
|
|
82128
|
-
const result = getPath(request);
|
|
82129
|
-
return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
|
|
82130
|
-
};
|
|
82131
|
-
var mergePath = (base, sub, ...rest) => {
|
|
82132
|
-
if (rest.length) {
|
|
82133
|
-
sub = mergePath(sub, ...rest);
|
|
82134
|
-
}
|
|
82135
|
-
return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
|
|
82136
|
-
};
|
|
82137
|
-
var checkOptionalParameter = (path2) => {
|
|
82138
|
-
if (path2.charCodeAt(path2.length - 1) !== 63 || !path2.includes(":")) {
|
|
82139
|
-
return null;
|
|
82140
|
-
}
|
|
82141
|
-
const segments = path2.split("/");
|
|
82142
|
-
const results = [];
|
|
82143
|
-
let basePath = "";
|
|
82144
|
-
segments.forEach((segment) => {
|
|
82145
|
-
if (segment !== "" && !/\:/.test(segment)) {
|
|
82146
|
-
basePath += "/" + segment;
|
|
82147
|
-
} else if (/\:/.test(segment)) {
|
|
82148
|
-
if (/\?/.test(segment)) {
|
|
82149
|
-
if (results.length === 0 && basePath === "") {
|
|
82150
|
-
results.push("/");
|
|
82151
|
-
} else {
|
|
82152
|
-
results.push(basePath);
|
|
82153
|
-
}
|
|
82154
|
-
const optionalSegment = segment.replace("?", "");
|
|
82155
|
-
basePath += "/" + optionalSegment;
|
|
82156
|
-
results.push(basePath);
|
|
82157
|
-
} else {
|
|
82158
|
-
basePath += "/" + segment;
|
|
82159
|
-
}
|
|
82160
|
-
}
|
|
82161
|
-
});
|
|
82162
|
-
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
82163
|
-
};
|
|
82164
|
-
var _decodeURI = (value) => {
|
|
82165
|
-
if (!/[%+]/.test(value)) {
|
|
82166
|
-
return value;
|
|
82167
|
-
}
|
|
82168
|
-
if (value.indexOf("+") !== -1) {
|
|
82169
|
-
value = value.replace(/\+/g, " ");
|
|
82170
|
-
}
|
|
82171
|
-
return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value;
|
|
82172
|
-
};
|
|
82173
|
-
var _getQueryParam = (url2, key, multiple) => {
|
|
82174
|
-
let encoded;
|
|
82175
|
-
if (!multiple && key && !/[%+]/.test(key)) {
|
|
82176
|
-
let keyIndex2 = url2.indexOf("?", 8);
|
|
82177
|
-
if (keyIndex2 === -1) {
|
|
82178
|
-
return;
|
|
82179
|
-
}
|
|
82180
|
-
if (!url2.startsWith(key, keyIndex2 + 1)) {
|
|
82181
|
-
keyIndex2 = url2.indexOf(`&${key}`, keyIndex2 + 1);
|
|
82182
|
-
}
|
|
82183
|
-
while (keyIndex2 !== -1) {
|
|
82184
|
-
const trailingKeyCode = url2.charCodeAt(keyIndex2 + key.length + 1);
|
|
82185
|
-
if (trailingKeyCode === 61) {
|
|
82186
|
-
const valueIndex = keyIndex2 + key.length + 2;
|
|
82187
|
-
const endIndex = url2.indexOf("&", valueIndex);
|
|
82188
|
-
return _decodeURI(url2.slice(valueIndex, endIndex === -1 ? undefined : endIndex));
|
|
82189
|
-
} else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) {
|
|
82190
|
-
return "";
|
|
82191
|
-
}
|
|
82192
|
-
keyIndex2 = url2.indexOf(`&${key}`, keyIndex2 + 1);
|
|
82193
|
-
}
|
|
82194
|
-
encoded = /[%+]/.test(url2);
|
|
82195
|
-
if (!encoded) {
|
|
82196
|
-
return;
|
|
82197
|
-
}
|
|
82198
|
-
}
|
|
82199
|
-
const results = {};
|
|
82200
|
-
encoded ??= /[%+]/.test(url2);
|
|
82201
|
-
let keyIndex = url2.indexOf("?", 8);
|
|
82202
|
-
while (keyIndex !== -1) {
|
|
82203
|
-
const nextKeyIndex = url2.indexOf("&", keyIndex + 1);
|
|
82204
|
-
let valueIndex = url2.indexOf("=", keyIndex);
|
|
82205
|
-
if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) {
|
|
82206
|
-
valueIndex = -1;
|
|
82207
|
-
}
|
|
82208
|
-
let name2 = url2.slice(keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? undefined : nextKeyIndex : valueIndex);
|
|
82209
|
-
if (encoded) {
|
|
82210
|
-
name2 = _decodeURI(name2);
|
|
82211
|
-
}
|
|
82212
|
-
keyIndex = nextKeyIndex;
|
|
82213
|
-
if (name2 === "") {
|
|
82214
|
-
continue;
|
|
82215
|
-
}
|
|
82216
|
-
let value;
|
|
82217
|
-
if (valueIndex === -1) {
|
|
82218
|
-
value = "";
|
|
82219
|
-
} else {
|
|
82220
|
-
value = url2.slice(valueIndex + 1, nextKeyIndex === -1 ? undefined : nextKeyIndex);
|
|
82221
|
-
if (encoded) {
|
|
82222
|
-
value = _decodeURI(value);
|
|
82223
|
-
}
|
|
82224
|
-
}
|
|
82225
|
-
if (multiple) {
|
|
82226
|
-
if (!(results[name2] && Array.isArray(results[name2]))) {
|
|
82227
|
-
results[name2] = [];
|
|
82228
|
-
}
|
|
82229
|
-
results[name2].push(value);
|
|
82230
|
-
} else {
|
|
82231
|
-
results[name2] ??= value;
|
|
82232
|
-
}
|
|
82233
|
-
}
|
|
82234
|
-
return key ? results[key] : results;
|
|
82235
|
-
};
|
|
82236
|
-
var getQueryParam = _getQueryParam;
|
|
82237
|
-
var getQueryParams = (url2, key) => {
|
|
82238
|
-
return _getQueryParam(url2, key, true);
|
|
82239
|
-
};
|
|
82240
|
-
var decodeURIComponent_ = decodeURIComponent;
|
|
82241
|
-
|
|
82242
82529
|
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/request.js
|
|
82243
82530
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
82244
82531
|
var HonoRequest = class {
|
|
@@ -82296,7 +82583,7 @@ var HonoRequest = class {
|
|
|
82296
82583
|
return parseBody(this, options);
|
|
82297
82584
|
}
|
|
82298
82585
|
#cachedBody = (key) => {
|
|
82299
|
-
const { bodyCache, raw } = this;
|
|
82586
|
+
const { bodyCache, raw: raw2 } = this;
|
|
82300
82587
|
const cachedBody = bodyCache[key];
|
|
82301
82588
|
if (cachedBody) {
|
|
82302
82589
|
return cachedBody;
|
|
@@ -82310,7 +82597,7 @@ var HonoRequest = class {
|
|
|
82310
82597
|
return new Response(body)[key]();
|
|
82311
82598
|
});
|
|
82312
82599
|
}
|
|
82313
|
-
return bodyCache[key] =
|
|
82600
|
+
return bodyCache[key] = raw2[key]();
|
|
82314
82601
|
};
|
|
82315
82602
|
json() {
|
|
82316
82603
|
return this.#cachedBody("text").then((text2) => JSON.parse(text2));
|
|
@@ -82350,44 +82637,6 @@ var HonoRequest = class {
|
|
|
82350
82637
|
}
|
|
82351
82638
|
};
|
|
82352
82639
|
|
|
82353
|
-
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/html.js
|
|
82354
|
-
var HtmlEscapedCallbackPhase = {
|
|
82355
|
-
Stringify: 1,
|
|
82356
|
-
BeforeStream: 2,
|
|
82357
|
-
Stream: 3
|
|
82358
|
-
};
|
|
82359
|
-
var raw = (value, callbacks) => {
|
|
82360
|
-
const escapedString = new String(value);
|
|
82361
|
-
escapedString.isEscaped = true;
|
|
82362
|
-
escapedString.callbacks = callbacks;
|
|
82363
|
-
return escapedString;
|
|
82364
|
-
};
|
|
82365
|
-
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
82366
|
-
if (typeof str === "object" && !(str instanceof String)) {
|
|
82367
|
-
if (!(str instanceof Promise)) {
|
|
82368
|
-
str = str.toString();
|
|
82369
|
-
}
|
|
82370
|
-
if (str instanceof Promise) {
|
|
82371
|
-
str = await str;
|
|
82372
|
-
}
|
|
82373
|
-
}
|
|
82374
|
-
const callbacks = str.callbacks;
|
|
82375
|
-
if (!callbacks?.length) {
|
|
82376
|
-
return Promise.resolve(str);
|
|
82377
|
-
}
|
|
82378
|
-
if (buffer) {
|
|
82379
|
-
buffer[0] += str;
|
|
82380
|
-
} else {
|
|
82381
|
-
buffer = [str];
|
|
82382
|
-
}
|
|
82383
|
-
const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then((res) => Promise.all(res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))).then(() => buffer[0]));
|
|
82384
|
-
if (preserveCallbacks) {
|
|
82385
|
-
return raw(await resStr, callbacks);
|
|
82386
|
-
} else {
|
|
82387
|
-
return resStr;
|
|
82388
|
-
}
|
|
82389
|
-
};
|
|
82390
|
-
|
|
82391
82640
|
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/context.js
|
|
82392
82641
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
82393
82642
|
var setDefaultContentType = (contentType, headers2) => {
|
|
@@ -82540,9 +82789,9 @@ var Context = class {
|
|
|
82540
82789
|
json = (object2, arg, headers2) => {
|
|
82541
82790
|
return this.#newResponse(JSON.stringify(object2), arg, setDefaultContentType("application/json", headers2));
|
|
82542
82791
|
};
|
|
82543
|
-
html = (
|
|
82544
|
-
const res = (
|
|
82545
|
-
return typeof
|
|
82792
|
+
html = (html2, arg, headers2) => {
|
|
82793
|
+
const res = (html22) => this.#newResponse(html22, arg, setDefaultContentType("text/html; charset=UTF-8", headers2));
|
|
82794
|
+
return typeof html2 === "object" ? resolveCallback(html2, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html2);
|
|
82546
82795
|
};
|
|
82547
82796
|
redirect = (location, status) => {
|
|
82548
82797
|
const locationString = String(location);
|
|
@@ -82555,17 +82804,6 @@ var Context = class {
|
|
|
82555
82804
|
};
|
|
82556
82805
|
};
|
|
82557
82806
|
|
|
82558
|
-
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/router.js
|
|
82559
|
-
var METHOD_NAME_ALL = "ALL";
|
|
82560
|
-
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
82561
|
-
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
82562
|
-
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
82563
|
-
var UnsupportedPathError = class extends Error {
|
|
82564
|
-
};
|
|
82565
|
-
|
|
82566
|
-
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/utils/constants.js
|
|
82567
|
-
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
82568
|
-
|
|
82569
82807
|
// ../../node_modules/.bun/hono@4.12.10/node_modules/hono/dist/hono-base.js
|
|
82570
82808
|
var notFoundHandler = (c) => {
|
|
82571
82809
|
return c.text("404 Not Found", 404);
|
|
@@ -83588,14 +83826,14 @@ function observableToAsyncIterable(observable$1, signal2) {
|
|
|
83588
83826
|
}
|
|
83589
83827
|
// ../web/server/core/pairing/runtime/bridge/server-trpc.ts
|
|
83590
83828
|
import { realpathSync as realpathSync7 } from "fs";
|
|
83591
|
-
import { homedir as
|
|
83829
|
+
import { homedir as homedir39 } from "os";
|
|
83592
83830
|
function resolveCurrentDirectory() {
|
|
83593
83831
|
try {
|
|
83594
83832
|
const config2 = resolveConfig();
|
|
83595
83833
|
const configuredRoot = config2.workspace?.root;
|
|
83596
83834
|
if (!configuredRoot)
|
|
83597
83835
|
return process.cwd();
|
|
83598
|
-
const expanded = configuredRoot.replace(/^~/,
|
|
83836
|
+
const expanded = configuredRoot.replace(/^~/, homedir39());
|
|
83599
83837
|
return realpathSync7(expanded);
|
|
83600
83838
|
} catch {
|
|
83601
83839
|
return process.cwd();
|
|
@@ -84250,7 +84488,7 @@ async function autoStartConfiguredSessions(bridge, sessions4) {
|
|
|
84250
84488
|
try {
|
|
84251
84489
|
const session = await bridge.createSession(entry.adapter, {
|
|
84252
84490
|
name: entry.name,
|
|
84253
|
-
cwd: entry.cwd?.replace(/^~/,
|
|
84491
|
+
cwd: entry.cwd?.replace(/^~/, homedir40()),
|
|
84254
84492
|
options: entry.options
|
|
84255
84493
|
});
|
|
84256
84494
|
console.log(`[bridge] session started: ${session.name} (${entry.adapter})`);
|
|
@@ -84269,19 +84507,10 @@ var BONJOUR_SERVICE_TYPE = "_oscout-pair._tcp";
|
|
|
84269
84507
|
async function runPairingRuntimeController() {
|
|
84270
84508
|
clearStalePairingRuntimeFiles();
|
|
84271
84509
|
const existingPid = readPairingRuntimePid();
|
|
84272
|
-
|
|
84273
|
-
if (!existingOwner && existingPid && existingPid !== process.pid) {
|
|
84274
|
-
try {
|
|
84275
|
-
existingOwner = claimScoutPairingRuntimeOwnership({ pid: existingPid });
|
|
84276
|
-
} catch {
|
|
84277
|
-
existingOwner = null;
|
|
84278
|
-
}
|
|
84279
|
-
}
|
|
84280
|
-
if (existingPid && existingPid !== process.pid && existingOwner?.pid === existingPid) {
|
|
84510
|
+
if (existingPid && existingPid !== process.pid && isProcessRunning(existingPid)) {
|
|
84281
84511
|
console.error(`Scout pairing runtime controller is already running (pid ${existingPid}).`);
|
|
84282
84512
|
process.exit(1);
|
|
84283
84513
|
}
|
|
84284
|
-
const runtimeOwner = claimScoutPairingRuntimeOwnership();
|
|
84285
84514
|
writePairingRuntimePid(process.pid);
|
|
84286
84515
|
const state = {
|
|
84287
84516
|
current: writePairingRuntimeSnapshot(createPairingRuntimeSnapshot({ pid: process.pid }, {
|
|
@@ -84321,7 +84550,6 @@ async function runPairingRuntimeController() {
|
|
|
84321
84550
|
childPid: null
|
|
84322
84551
|
});
|
|
84323
84552
|
clearPairingRuntimePid();
|
|
84324
|
-
releaseScoutPairingRuntimeOwnership(runtimeOwner);
|
|
84325
84553
|
process.exit(0);
|
|
84326
84554
|
};
|
|
84327
84555
|
process.on("SIGINT", () => void shutdown());
|