@openscout/scout 0.2.79 → 0.2.80
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/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/client/assets/ActivityScreen-BXm6nJ6L.js +1 -0
- package/dist/client/assets/{AddProjectForm-BoVtelSP.js → AddProjectForm-CtEiLQnm.js} +1 -1
- package/dist/client/assets/{AgentAvatar-CufDA4A-.js → AgentAvatar-CszU5eaU.js} +1 -1
- package/dist/client/assets/AgentConfigurationScreen-CfBXxrsD.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-4Z0aN8AR.js +1 -0
- package/dist/client/assets/{AgentDetailCard-DxxVkgT1.js → AgentDetailCard-sZuHl1de.js} +1 -1
- package/dist/client/assets/AgentFloorView-DMivAYHU.js +1 -0
- package/dist/client/assets/AgentInfoScreen-CPkLg1pK.js +1 -0
- package/dist/client/assets/{AgentLaneCard-DTUvE96I.js → AgentLaneCard-nB68f2CI.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-BfVygkgL.js → AgentLaneChrome-O9Yf0uR-.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-BfhpaEQ3.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-CMgzYvAA.js → AgentLaneSummaryResize-Ct3b0TQR.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-CjHMvy3v.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-KWfLcaNB.js → AgentLanesPreflight-DNGvZvjd.js} +1 -1
- package/dist/client/assets/{AgentLanesView-CxfbV8Kd.js → AgentLanesView-DqRK5-d2.js} +1 -1
- package/dist/client/assets/{AgentLiveActions-CZdAInEu.js → AgentLiveActions-DI4ooSHW.js} +1 -1
- package/dist/client/assets/{AgentSessions-Bkr0lyry.js → AgentSessions-BxWIPkWh.js} +1 -1
- package/dist/client/assets/{AgentsConsole-WtFVqaPJ.js → AgentsConsole-D6VHSCfZ.js} +1 -1
- package/dist/client/assets/AgentsScreen-zR6b2bUL.js +1 -0
- package/dist/client/assets/AgentsSubnav-q0xcZi6C.js +1 -0
- package/dist/client/assets/{AtopView-_OKDlZ1h.js → AtopView-VZkk40v0.js} +1 -1
- package/dist/client/assets/{BackToPicker-CkUmHuuo.js → BackToPicker-DZg_4nHL.js} +1 -1
- package/dist/client/assets/{BriefingDetailScreen-i54EtZKW.js → BriefingDetailScreen-BZU4qMwE.js} +1 -1
- package/dist/client/assets/{BriefingsScreen-CBrHojlQ.js → BriefingsScreen-Bfc3tqPp.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-opTLuZU6.js → BrokerMetadataPanel-CaFe6kdh.js} +1 -1
- package/dist/client/assets/BrokerScreen-Chh8sGen.js +5 -0
- package/dist/client/assets/{ChatCollapsedStrip-Dr2vmKXQ.js → ChatCollapsedStrip-Cov54p9V.js} +1 -1
- package/dist/client/assets/{CodeDiffPane-CLOGjwul.js → CodeDiffPane-C1ebFt-Y.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-DTV8hR6A.js → CodeProjectPicker-tsCly-f3.js} +1 -1
- package/dist/client/assets/CodeScreen-D0hpZNLP.js +1 -0
- package/dist/client/assets/{ContextMenu-BlBQhpax.js → ContextMenu-N-Z6X0Z1.js} +1 -1
- package/dist/client/assets/ConversationComposer-CiEF7dhd.js +1 -0
- package/dist/client/assets/ConversationFeedRows-5it6QNBV.js +1 -0
- package/dist/client/assets/ConversationHeader-BGgbITvr.js +1 -0
- package/dist/client/assets/ConversationPanels-vI9YuQJh.js +2 -0
- package/dist/client/assets/ConversationScreen-C-PrCRz1.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/{ConversationStatus-DSgdVofa.js → ConversationStatus-COEj5loj.js} +1 -1
- package/dist/client/assets/{DataTable-0DwuXyvW.js → DataTable-BoofV-_4.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-BrreQifA.js → DispatchAftermath-OXYlMbT1.js} +1 -1
- package/dist/client/assets/{DocumentFocusViewer-DU_9BHsD.js → DocumentFocusViewer-BCG2kOmd.js} +1 -1
- package/dist/client/assets/{EmbeddableSurfacesLab-DdaswbfI.js → EmbeddableSurfacesLab-C2SZvrHJ.js} +1 -1
- package/dist/client/assets/{EmptyState-CoL-QuUO.js → EmptyState-DypEjx0V.js} +1 -1
- package/dist/client/assets/{FileViewerPane-C9Ly01Ef.js → FileViewerPane-CXCq-oKj.js} +1 -1
- package/dist/client/assets/{FleetSearch-DlWTLl-v.js → FleetSearch-Dj7-CfNi.js} +1 -1
- package/dist/client/assets/FlightObserveScreen-Yq5NtQQJ.js +1 -0
- package/dist/client/assets/FollowScreen-DRgYuAvp.js +1 -0
- package/dist/client/assets/HarnessMark-BE-YSyci.js +1 -0
- package/dist/client/assets/HarnessesScreen-L-emPcXd.js +1 -0
- package/dist/client/assets/HerdrSession-DKFCJMst.js +4 -0
- package/dist/client/assets/{HomeHero-Cfsow7qL.js → HomeHero-CAEg8Yg5.js} +1 -1
- package/dist/client/assets/{KnowledgeSearchInspector-DKashKoH.js → KnowledgeSearchInspector-C2EZsQ5i.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-DvdOFh-b.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-BzehBmdi.js → LaneToolHoverCard-DrPXYZvQ.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-Dl7foF88.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-DYvHfs_3.js → LaneTraceEventFocus-X4-DDFEo.js} +1 -1
- package/dist/client/assets/{MeshCanvas-DIjlrMPU.js → MeshCanvas-rtCBD7s6.js} +1 -1
- package/dist/client/assets/{MeshCanvasMinimap-DEq-PkF0.js → MeshCanvasMinimap-CuvXOkc7.js} +1 -1
- package/dist/client/assets/MeshScreen-D5zzTn0o.js +1 -0
- package/dist/client/assets/{MeshTopologyView-BMHpH5BU.js → MeshTopologyView-CeTShs-U.js} +2 -2
- package/dist/client/assets/{MessageComposerSuggestions-zAUUcLOv.js → MessageComposerSuggestions-Cs9u-F_3.js} +1 -1
- package/dist/client/assets/MessagesScreen-BhOJ7_tj.js +1 -0
- package/dist/client/assets/MissionContextRail-0O-Zu1Tn.js +1 -0
- package/dist/client/assets/MissionControlView-D2JO9u-y.js +1 -0
- package/dist/client/assets/{MissionFocusOverlay-C7cPt6eU.js → MissionFocusOverlay-LnjmqBiW.js} +1 -1
- package/dist/client/assets/{MissionLeftAgentRow-CxlH3dON.js → MissionLeftAgentRow-nc1Jyq3D.js} +1 -1
- package/dist/client/assets/MissionLogPane-lZ9vUftY.js +1 -0
- package/dist/client/assets/{NewAgentModal-DprvD4EK.js → NewAgentModal-K1cvdmZr.js} +1 -1
- package/dist/client/assets/NewChatComposer-C5LT7MF7.css +1 -0
- package/dist/client/assets/NewChatComposer-DXDxV2Mh.js +19 -0
- package/dist/client/assets/{NewChatOrigin--pHWUb4V.js → NewChatOrigin-CnjoswTG.js} +1 -1
- package/dist/client/assets/{ObserveEmbedScreen-CfvrnOiZ.js → ObserveEmbedScreen-CRpzYf0Y.js} +1 -1
- package/dist/client/assets/{ObserveTextFlow-CBitljxi.js → ObserveTextFlow-DJxQc2H6.js} +2 -2
- package/dist/client/assets/{ObservedTopologyPanel-Dv6fbHzW.js → ObservedTopologyPanel-C1AQM0Mq.js} +1 -1
- package/dist/client/assets/OpenScoutAppShell-DrHYD_pd.js +87 -0
- package/dist/client/assets/OpsAgentsView-BnMX0vEY.js +1 -0
- package/dist/client/assets/OpsScreen-BeC0lieE.js +1 -0
- package/dist/client/assets/OpsSubnav-D5Bpowtk.js +1 -0
- package/dist/client/assets/{PlanView-DYtt8H37.js → PlanView-DDXdC19M.js} +1 -1
- package/dist/client/assets/ProjectAgentProfile-zE1cApxw.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-B3IvVbqS.js → ProjectAgentProfileBar-MODhG0P6.js} +1 -1
- package/dist/client/assets/{ProjectAgentProfileHero-D5E8yvDj.js → ProjectAgentProfileHero-C1ImgGDu.js} +1 -1
- package/dist/client/assets/ProjectsInbox-C3Jd6JTk.js +2 -0
- package/dist/client/assets/{ProjectsRail-DEDS-M1c.js → ProjectsRail-B1zrQLZe.js} +1 -1
- package/dist/client/assets/ProjectsScreen-PW_NH5VK.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DaCEUWN1.js +1 -0
- package/dist/client/assets/Provider-DSsb2gLR.js +1 -0
- package/dist/client/assets/{RailRow-BTlVAnHS.js → RailRow-DerXOXQS.js} +1 -1
- package/dist/client/assets/RawSessionsTable-LWEvXJzj.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-XtxbCjOs.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-CtTdlQ2A.js → RepoDiffEmbedScreen-C9oLCcZX.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-BRvaVYoC.js → RepoDiffPageScreen-CGEMAv2Z.js} +1 -1
- package/dist/client/assets/{RepoDiffViewer-Bo0gREMj.js → RepoDiffViewer-CB8PSVey.js} +1 -1
- package/dist/client/assets/RepoDiffViewerLazy-DIxkiMto.js +2 -0
- package/dist/client/assets/{ReposScreen-BBkJf8xT.js → ReposScreen-BN1lVjOj.js} +1 -1
- package/dist/client/assets/{ScoutDeckSurface-Bi9ov9Bm.js → ScoutDeckSurface-BCpl0QCx.js} +1 -1
- package/dist/client/assets/{ScoutSurface-DEQg_7Io.js → ScoutSurface-BEnDlynn.js} +1 -1
- package/dist/client/assets/{ScoutbotBroadcastChip-DJXuyn73.js → ScoutbotBroadcastChip-z9R_pC_U.js} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-BgsuLDjo.js → ScoutbotFxLab-fAROyIfz.js} +1 -1
- package/dist/client/assets/{ScoutbotRealtimeVoiceCall-Bzyl0BCS.js → ScoutbotRealtimeVoiceCall-CDyFJX8m.js} +1 -1
- package/dist/client/assets/{SecondaryNav-Bks0CO2h.js → SecondaryNav-Hv5AJ3Fv.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-b0Zgmfx5.js → SessionEmbedScreen-CDRpQc3g.js} +1 -1
- package/dist/client/assets/{SessionObserve-Dlx5vDaV.js → SessionObserve-BmmJ8dEh.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-ChBD1d4c.js → SessionObserveEvidence-CEedIk2a.js} +1 -1
- package/dist/client/assets/SessionRefScreen-Dk-O4OVt.js +1 -0
- package/dist/client/assets/SessionsScreen-BJEjuo2X.js +1 -0
- package/dist/client/assets/{SettingsDrawer-C587L1i1.js → SettingsDrawer-DL-SVLdd.js} +1 -1
- package/dist/client/assets/SettingsScreen-DJ-BhBwR.js +1 -0
- package/dist/client/assets/{ShikiPane-I_OTW5NO.js → ShikiPane-B7O4if20.js} +1 -1
- package/dist/client/assets/{SlidePanel-FCqT1zO3.js → SlidePanel-B3gc5HnM.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-CQs-jC-v.js → SpriteAvatar-BpQDpOkq.js} +1 -1
- package/dist/client/assets/{StatusPill-CbABggnQ.js → StatusPill-B33sQinT.js} +1 -1
- package/dist/client/assets/{TailView-C_MXVSum.js → TailView-DL3YZkzE.js} +2 -2
- package/dist/client/assets/Terminal-Dp1FSGIS.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-DP9IM4xf.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-C-9EtYqt.js → TextDocumentSurface-DRjctOIt.js} +1 -1
- package/dist/client/assets/{TmuxPeek-Dz1gJ2pU.js → TmuxPeek-DNC4uWky.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-MfICy9kk.js → VoicePermissionsPanel-WLN0V-Xv.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cs7kdllj.js → WorkDetailScreen-D2Yl0mYZ.js} +1 -1
- package/dist/client/assets/{WorkFilesViewer-CF-nhtZ4.js → WorkFilesViewer-BbVfcUN-.js} +1 -1
- package/dist/client/assets/{activity-WhBf3FXP.js → activity-BxwKkT8z.js} +1 -1
- package/dist/client/assets/{addon-fit-q-x_HytU.js → addon-fit-B9O2vJoh.js} +1 -1
- package/dist/client/assets/{addon-webgl-fhhvEA9h.js → addon-webgl-BhRZFDcn.js} +1 -1
- package/dist/client/assets/{agent-essentials-DyJiUGpZ.js → agent-essentials-SrzMYEXV.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-BCIwPjEh.js → agent-lane-card-model-DSWdGu-v.js} +1 -1
- package/dist/client/assets/agent-lane-detail-BNNm6FNu.js +2 -0
- package/dist/client/assets/{agent-lane-preview-BtnfNyFR.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-model-Bl6xfviL.js → agent-lanes-model-CPgQRenB.js} +2 -2
- package/dist/client/assets/{arc.es-DPJ0xRV6.js → arc.es-NlJw-19N.js} +1 -1
- package/dist/client/assets/{arrow-down-DsD-dYj-.js → arrow-down-D3-IbArq.js} +1 -1
- package/dist/client/assets/{arrow-left-WjQIN9J6.js → arrow-left-_vS7itsV.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CtTDrZJr.js → arrow-up-right-CcrWONpD.js} +1 -1
- package/dist/client/assets/{bot-B_Uzf4_O.js → bot-BRINYlC6.js} +1 -1
- package/dist/client/assets/{check-BbgHJX8u.js → check-COxArFXG.js} +1 -1
- package/dist/client/assets/{chevron-down-BFai6ZfE.js → chevron-down-DRCbnzyY.js} +1 -1
- package/dist/client/assets/{chevron-right-CyUa1zXx.js → chevron-right-CNE6QAVr.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-CvwpNg-G.js → chunk-HRAB3GC3-CAeEKaf5.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-s6WbxdjC.js +46 -0
- package/dist/client/assets/{chunk-T65CQEWV-DI4NKdNq.js → chunk-T65CQEWV-CiZ_ICHW.js} +1 -1
- package/dist/client/assets/chunk-YOZR3KYS-DLOc92uD.js +2 -0
- package/dist/client/assets/{clock-DviOalxA.js → clock-CyfvRmj6.js} +1 -1
- package/dist/client/assets/{code-xml-05TD3uOC.js → code-xml--LjSM4Mv.js} +1 -1
- package/dist/client/assets/content-7ZeCPAEt.js +1 -0
- package/dist/client/assets/content-BHUcUCH5.js +1 -0
- package/dist/client/assets/content-BUhvLPkv.js +1 -0
- package/dist/client/assets/content-BomQ5YWo.js +1 -0
- package/dist/client/assets/content-C39ELNgC.js +1 -0
- package/dist/client/assets/content-C4RYKHut.js +1 -0
- package/dist/client/assets/content-CCiZfG4H.js +1 -0
- package/dist/client/assets/content-CDpDtVI-.js +1 -0
- package/dist/client/assets/content-CO-9CeFd.js +1 -0
- package/dist/client/assets/content-CuOLxp1x.js +1 -0
- package/dist/client/assets/content-CvtLIjXS.js +1 -0
- package/dist/client/assets/content-CzwTUb9n.js +1 -0
- package/dist/client/assets/content-DQXbo2RO.js +1 -0
- package/dist/client/assets/content-DRTQ9QQb.js +1 -0
- package/dist/client/assets/content-LCELs6zg.js +1 -0
- package/dist/client/assets/content-Uqt8AG-s.css +1 -0
- package/dist/client/assets/content-qsDjA4Au.js +1 -0
- package/dist/client/assets/{conversation-icons-DohQL6GI.js → conversation-icons-c-hXv7hY.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-T8vF9zED.js +1 -0
- package/dist/client/assets/{copy-CwCAivnc.js → copy-4LfKIdQJ.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DlxlBfLC.js → createLucideIcon-ClCdc3F9.js} +1 -1
- package/dist/client/assets/discover-7Ks00w-M.js +2 -0
- package/dist/client/assets/embed-entry-n2ThmSSX.js +2 -0
- package/dist/client/assets/{external-link-CnjcXf32.js → external-link-CnaI1QFS.js} +1 -1
- package/dist/client/assets/{eye-So8tNNK6.js → eye-BFlhMzQL.js} +1 -1
- package/dist/client/assets/{file-text-i3xTDUjJ.js → file-text-DG-pufl1.js} +1 -1
- package/dist/client/assets/{gestures-CgvAMd6F.js → gestures-CxG3Dphs.js} +1 -1
- package/dist/client/assets/home-live-action-BkqGLVRY.js +1 -0
- package/dist/client/assets/home-moving-signal-aNJusIzL.js +1 -0
- package/dist/client/assets/home-now-card-BQK4EFHx.js +1 -0
- package/dist/client/assets/{home-now-card-nano-CkLHUQ4J.js → home-now-card-nano-CdtzqSIF.js} +1 -1
- package/dist/client/assets/hooks-Dst1TH7n.js +2 -0
- package/dist/client/assets/index-9as_JTUs.css +1 -0
- package/dist/client/assets/index-CU9dtwJk.js +1 -0
- package/dist/client/assets/{index-sUomXsrf.js → index-CzVeWScw.js} +2 -2
- package/dist/client/assets/index-Dewd56RX.js +1 -0
- package/dist/client/assets/index-_YQXKEhb.js +1 -0
- package/dist/client/assets/{inspector-panel-DhXd-YbT.js → inspector-panel-DgOM8nCo.js} +1 -1
- package/dist/client/assets/keyboard-nav-BJnFoFDP.js +1 -0
- package/dist/client/assets/{lane-observe-DrhKkQ3A.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-NE15Oe6M.js → lane-roster-store-pR4ZaYQm.js} +1 -1
- package/dist/client/assets/left-BhzPp-_E.js +1 -0
- package/dist/client/assets/left-CN1MABD0.js +2 -0
- package/dist/client/assets/left-DDgbsio7.js +1 -0
- package/dist/client/assets/left-Dpf2R9uD.js +1 -0
- package/dist/client/assets/left-HwwbMVtl.js +2 -0
- package/dist/client/assets/left-YfH0daht.js +1 -0
- package/dist/client/assets/left-agents-CYUwAy2Z.js +1 -0
- package/dist/client/assets/left-default-vEGZALPv.js +1 -0
- package/dist/client/assets/left-lanes-bphF-vlX.js +1 -0
- package/dist/client/assets/left-mission-B54-c3hq.js +1 -0
- package/dist/client/assets/left-np5USKqG.js +1 -0
- package/dist/client/assets/left-plan-BNBuDoPQ.js +2 -0
- package/dist/client/assets/library-DbCVJG_O.js +1 -0
- package/dist/client/assets/{loader-circle-lWOOKezu.js → loader-circle-Byb9kSFx.js} +1 -1
- package/dist/client/assets/{local-agents-C7fDHLVC.js → local-agents-DBaUbP-_.js} +1 -1
- package/dist/client/assets/{mentions-CY_wPZc5.js → mentions-fbQJ2mBI.js} +1 -1
- package/dist/client/assets/{mesh-ops-Kn8pCtyJ.js → mesh-ops-Cnw3vwAu.js} +1 -1
- package/dist/client/assets/{mesh-view-store-D14ihwkF.js → mesh-view-store-Btlyc7rW.js} +1 -1
- package/dist/client/assets/{message-circle-C5UZ6fO7.js → message-circle-aGOfQWm2.js} +1 -1
- package/dist/client/assets/{message-markup-C8Nx04sP.js → message-markup-mGF07emJ.js} +1 -1
- package/dist/client/assets/{message-square-BD-4UUdc.js → message-square-CIXda-Y7.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-xQHVQdm8.js → mission-control-store-CcoNeQHG.js} +1 -1
- package/dist/client/assets/mission-wall-CocIM1cF.js +1 -0
- package/dist/client/assets/{observe-uJfIlIUV.js → observe-BNFzh-7B.js} +1 -1
- package/dist/client/assets/openAgent-Dbv5wfuL.js +1 -0
- package/dist/client/assets/{page-status-BymFEFai.js → page-status-DDvNdA8s.js} +1 -1
- package/dist/client/assets/{paperclip-DL9BXPp2.js → paperclip-DfpJkR4s.js} +1 -1
- package/dist/client/assets/{plus-C9lTjsgd.js → plus-CmFQp9Uj.js} +1 -1
- package/dist/client/assets/profile-s3KRbip1.js +1 -0
- package/dist/client/assets/{projects-inbox-DfVmGFFk.js → projects-inbox-Diddml6e.js} +1 -1
- package/dist/client/assets/{radio-DedMyP8J.js → radio-PauJIekM.js} +1 -1
- package/dist/client/assets/{refresh-cw-D8PFyhUa.js → refresh-cw-4oeFn1Jn.js} +1 -1
- package/dist/client/assets/resolve-panes-cp6eNewO.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-Dbo-5PWx.js +1 -0
- package/dist/client/assets/right-09W2JJFg.js +1 -0
- package/dist/client/assets/right-B-MKhiJ6.js +1 -0
- package/dist/client/assets/right-B91Zl8lQ.js +1 -0
- package/dist/client/assets/{right-C1sIsSHR.js → right-BcFnuse9.js} +1 -1
- package/dist/client/assets/right-BdtMzn35.js +1 -0
- package/dist/client/assets/right-BqmKXLtf.js +1 -0
- package/dist/client/assets/right-BzeB-Dpt.js +1 -0
- package/dist/client/assets/right-CkGOs-sq.js +1 -0
- package/dist/client/assets/right-CzGiNBzB.js +1 -0
- package/dist/client/assets/right-Dc7uqv7l.js +1 -0
- package/dist/client/assets/{rocket-CriBwkHM.js → rocket-C-AskjZH.js} +1 -1
- package/dist/client/assets/router-B-K15T7B.js +1 -0
- package/dist/client/assets/{runtime-picker-DOZpZOlt.js → runtime-picker-BCQD7d4K.js} +1 -1
- package/dist/client/assets/{scope-views-BF_RvGKU.js → scope-views-BhkbIFPY.js} +1 -1
- package/dist/client/assets/{scout-voice-BZ4KqADJ.js → scout-voice-S5_YZ2v8.js} +1 -1
- package/dist/client/assets/{scroll-text-BIYf6g6N.js → scroll-text-BV-BB7v-.js} +1 -1
- package/dist/client/assets/{search-DCT_EvPr.js → search-C3bSJluv.js} +1 -1
- package/dist/client/assets/{secondaryNavConfig-Drb7wPG4.js → secondaryNavConfig-Bg4Tc0gT.js} +1 -1
- package/dist/client/assets/{selection-bridge-CJOTyYQs.js → selection-bridge-B1dmkX3P.js} +1 -1
- package/dist/client/assets/{send-horizontal-DDwOgEs3.js → send-horizontal-CqogPmbY.js} +1 -1
- package/dist/client/assets/{server-CHZCp3cF.js → server-Brw5Y1Gh.js} +1 -1
- package/dist/client/assets/{session-catalog-XhGxCtP-.js → session-catalog-9FqXmjBw.js} +1 -1
- package/dist/client/assets/session-table-1xdSxSXq.js +1 -0
- package/dist/client/assets/{sliders-horizontal-B9Nj-Y4J.js → sliders-horizontal-CUiOH26y.js} +1 -1
- package/dist/client/assets/{sparkles-up7pVlX-.js → sparkles-BjCA3Evu.js} +1 -1
- package/dist/client/assets/{sse-CVoGDiKW.js → sse-QcU9bikk.js} +1 -1
- package/dist/client/assets/synthetic-agent-routing-aduMYO7P.js +1 -0
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-BdyoLvzY.js → tail-display-BRcJltQa.js} +2 -2
- package/dist/client/assets/{tail-events-CTipUIli.js → tail-events-C6K7bCWB.js} +1 -1
- package/dist/client/assets/{terminal-DXQISjZn.js → terminal-DrTkVXIj.js} +1 -1
- package/dist/client/assets/{terminal-relay-B5Sma7fK.js → terminal-relay-BkXjjSkq.js} +1 -1
- package/dist/client/assets/{terminal-screen-19jAI0Cw.css → terminal-screen-BqVnCwl0.css} +1 -1
- package/dist/client/assets/terminal-sessions-C3qU8tnY.js +1 -0
- package/dist/client/assets/{terminal-takeover-X97KCSJk.js → terminal-takeover-KvmTwABa.js} +1 -1
- package/dist/client/assets/{use-conversation-list-B1T6J_qE.js → use-conversation-list-C5sF6WBR.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-DLofGhhK.js → use-fleet-active-asks-BOMPW0nl.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-ByGZk8rU.js → use-mesh-ops-items-Co05vcTV.js} +1 -1
- package/dist/client/assets/{use-reduced-motion-Cvk-HRKg.js → use-reduced-motion-Dla-G_Jz.js} +1 -1
- package/dist/client/assets/{use-scout-dev-flags-BHvg3G2c.js → use-scout-dev-flags-BOQF3fW2.js} +1 -1
- package/dist/client/assets/{useAgentHoverCard-D5e8Qg1z.js → useAgentHoverCard-FtCmY-b9.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-BX7Sq7vy.js +1 -0
- package/dist/client/assets/{usePierreRuntime-DIVunfX0.js → usePierreRuntime-Bo4lD7Ui.js} +1 -1
- package/dist/client/assets/{wrench-pEVd8JnN.js → wrench-CeCdjiPF.js} +1 -1
- package/dist/client/assets/{x-0XjXwGqq.js → x-D4X_y1j_.js} +1 -1
- package/dist/client/assets/{xterm-CRLlV1Xp.js → xterm-D2a5wrkJ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +1404 -356
- package/dist/node/main.mjs +63 -15
- package/dist/openscout-terminal-relay.mjs +16 -4
- package/dist/pairing-runtime-controller.mjs +3028 -2946
- package/dist/runtime/broker-daemon.mjs +356 -134
- package/dist/scout-control-plane-web.mjs +5631 -5183
- package/dist/scout-web-server.mjs +5631 -5183
- package/package.json +1 -1
- package/dist/client/assets/ActivityScreen-DnqqRSlS.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-CJqoMA0J.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-FpEkb-tu.js +0 -1
- package/dist/client/assets/AgentFloorView-CycUn0Lv.js +0 -1
- package/dist/client/assets/AgentInfoScreen-CAQAxpAK.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-CWs9wKWk.js +0 -5
- package/dist/client/assets/AgentLanesEmbedScreen-BUCW4nUj.js +0 -1
- package/dist/client/assets/AgentsScreen-BMXvuiA2.js +0 -1
- package/dist/client/assets/AgentsSubnav-BTNjPYoA.js +0 -1
- package/dist/client/assets/BrokerScreen-CObCQvoy.js +0 -5
- package/dist/client/assets/CodeScreen-BXqi72NK.js +0 -1
- package/dist/client/assets/ConversationComposer-BBNPa5S9.js +0 -1
- package/dist/client/assets/ConversationFeedRows-BuejHMCY.js +0 -1
- package/dist/client/assets/ConversationHeader-DXMT-YXv.js +0 -1
- package/dist/client/assets/ConversationPanels-DHCtilQF.js +0 -2
- package/dist/client/assets/ConversationScreen-DSxIt9pq.css +0 -1
- package/dist/client/assets/ConversationScreen-Dz2d_Z_F.js +0 -1
- package/dist/client/assets/FlightObserveScreen-C-9S0nA5.js +0 -1
- package/dist/client/assets/FollowScreen--Q04xSSE.js +0 -1
- package/dist/client/assets/HarnessMark-Dm_qm1Ku.js +0 -1
- package/dist/client/assets/HarnessesScreen-Y54viPX8.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-DsdDz8wY.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-CBf_aNZx.js +0 -1
- package/dist/client/assets/MeshScreen-TgDtz-1l.js +0 -1
- package/dist/client/assets/MessagesScreen-BTQL0UcE.js +0 -1
- package/dist/client/assets/MissionControlView-D59SPnAm.js +0 -1
- package/dist/client/assets/MissionLogPane-Ye3YlF9s.js +0 -1
- package/dist/client/assets/NewChatComposer-B5FnPyzS.js +0 -19
- package/dist/client/assets/NewChatComposer-W-t-L4oV.css +0 -1
- package/dist/client/assets/OpenScoutAppShell-BIp0WitK.js +0 -87
- package/dist/client/assets/OpsAgentsView-CoBfAigH.js +0 -1
- package/dist/client/assets/OpsScreen-Bbo0W64T.js +0 -1
- package/dist/client/assets/OpsSubnav-CoN8utF8.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-FiiIcB5R.js +0 -1
- package/dist/client/assets/ProjectsInbox-BWiXjGi7.js +0 -2
- package/dist/client/assets/ProjectsScreen-Cxk4CuYn.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-BF66ugT5.js +0 -1
- package/dist/client/assets/Provider-tFc3jqZ4.js +0 -1
- package/dist/client/assets/RawSessionsTable-BsGVgZB3.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-B0Bem5Rc.js +0 -1
- package/dist/client/assets/RepoDiffViewerLazy-C8UPk4oo.js +0 -2
- package/dist/client/assets/SessionRefScreen-D7TfPYPN.js +0 -1
- package/dist/client/assets/SessionsScreen-BlknOWAd.js +0 -1
- package/dist/client/assets/SettingsScreen-BIlYxv_a.js +0 -1
- package/dist/client/assets/Terminal-DwZyo8kA.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-Czp3tQyd.js +0 -1
- package/dist/client/assets/agent-chat-Bfjd9y6c.js +0 -1
- package/dist/client/assets/agent-identity-xQHedtLl.js +0 -1
- package/dist/client/assets/agent-lane-detail-Cw4QVAgH.js +0 -1
- package/dist/client/assets/chunk-YOZR3KYS-BW85tiCr.js +0 -47
- package/dist/client/assets/content-2u_eV3fX.js +0 -1
- package/dist/client/assets/content-5irOghrY.js +0 -1
- package/dist/client/assets/content-8Z_0CwtD.js +0 -1
- package/dist/client/assets/content-B38YRDBu.js +0 -1
- package/dist/client/assets/content-BE3uK0LB.js +0 -1
- package/dist/client/assets/content-BtIxSqVY.js +0 -1
- package/dist/client/assets/content-CFsPAihU.js +0 -1
- package/dist/client/assets/content-CHU0wwA3.css +0 -1
- package/dist/client/assets/content-CKj5g5tu.js +0 -1
- package/dist/client/assets/content-CLDWXf9Z.js +0 -1
- package/dist/client/assets/content-CRr73E0r.js +0 -1
- package/dist/client/assets/content-CVR75_Uj.js +0 -1
- package/dist/client/assets/content-Czdp7_JQ.js +0 -1
- package/dist/client/assets/content-D0_EJ6nP.js +0 -1
- package/dist/client/assets/content-DNmxpNhD.js +0 -1
- package/dist/client/assets/content-XpbI9uxd.js +0 -1
- package/dist/client/assets/content-cyxWdgKQ.js +0 -1
- package/dist/client/assets/conversation-model-C4yb6_FA.js +0 -1
- package/dist/client/assets/conversation-motion-features-CifSdJtm.js +0 -1
- package/dist/client/assets/discover-DoiAJo4Z.js +0 -2
- package/dist/client/assets/embed-entry-D1Or9S4d.js +0 -2
- package/dist/client/assets/home-live-action-B22u89j7.js +0 -1
- package/dist/client/assets/home-moving-signal-BdkERL6B.js +0 -1
- package/dist/client/assets/home-now-card-lLkv6nQs.js +0 -1
- package/dist/client/assets/hooks-BPLDD9yu.js +0 -2
- package/dist/client/assets/index-DGoLx89y.js +0 -1
- package/dist/client/assets/index-DITWsjFb.css +0 -1
- package/dist/client/assets/index-m6dFtY5f.js +0 -1
- package/dist/client/assets/index-pY8-Mz7y.js +0 -1
- package/dist/client/assets/keyboard-nav-BhZZ5HEq.js +0 -1
- package/dist/client/assets/left-B6eawimv.js +0 -1
- package/dist/client/assets/left-BL2uBHe0.js +0 -2
- package/dist/client/assets/left-BNJguPDG.js +0 -1
- package/dist/client/assets/left-BvCtvN0f.js +0 -1
- package/dist/client/assets/left-CfBb6bxM.js +0 -1
- package/dist/client/assets/left-DTrlBF0h.js +0 -2
- package/dist/client/assets/left-agents-DsOHgDCY.js +0 -1
- package/dist/client/assets/left-d4hlBBxY.js +0 -1
- package/dist/client/assets/left-default-BRCwoCJr.js +0 -1
- package/dist/client/assets/left-lanes-DNtoRzoV.js +0 -1
- package/dist/client/assets/left-mission-DsTu2X5Y.js +0 -1
- package/dist/client/assets/left-plan-CtySjsXC.js +0 -2
- package/dist/client/assets/library-CLpgWNJO.js +0 -1
- package/dist/client/assets/mission-control-D3ikEPND.css +0 -1
- package/dist/client/assets/openAgent-Bjt57GdM.js +0 -1
- package/dist/client/assets/profile-BqY5tesX.js +0 -1
- package/dist/client/assets/resolve-panes-1xeZMuaw.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-PLr32WHN.js +0 -1
- package/dist/client/assets/right-1x7HzabC.js +0 -1
- package/dist/client/assets/right-CFzPUzlF.js +0 -1
- package/dist/client/assets/right-CRKyeJDk.js +0 -1
- package/dist/client/assets/right-CagzkLWg.js +0 -1
- package/dist/client/assets/right-CsV149pN.js +0 -1
- package/dist/client/assets/right-DITNyG2s.js +0 -1
- package/dist/client/assets/right-E3nNcLE3.js +0 -1
- package/dist/client/assets/right-eUQvSjd7.js +0 -1
- package/dist/client/assets/right-ozp4nM44.js +0 -1
- package/dist/client/assets/router-Dja9_ygK.js +0 -1
- package/dist/client/assets/session-table-sAVe44a4.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-CD26LFc0.css +0 -1
- package/dist/client/assets/terminal-sessions-D5CIR2OL.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-ZfBNi3d4.js +0 -1
package/dist/main.mjs
CHANGED
|
@@ -354,9 +354,22 @@ function candidateAliases(candidate) {
|
|
|
354
354
|
return Array.from(new Set(aliases.map((alias) => trimIdentityPrefix(alias)).filter(Boolean)));
|
|
355
355
|
}
|
|
356
356
|
function explicitCandidateAliases(candidate) {
|
|
357
|
+
const cached = explicitAliasesCache.get(candidate);
|
|
358
|
+
if (cached)
|
|
359
|
+
return cached;
|
|
357
360
|
const canonical = candidateCanonicalIdentity(candidate);
|
|
358
361
|
const implicitAliases = canonical?.definitionId === OPENSCOUT_COORDINATOR_AGENT_ID ? [SCOUT_DISPATCHER_AGENT_ID] : [];
|
|
359
|
-
|
|
362
|
+
const aliases = Array.from(new Set([...candidate.aliases ?? [], ...implicitAliases].map((alias) => normalizeAgentIdentitySegment(trimIdentityPrefix(alias))).filter(Boolean)));
|
|
363
|
+
explicitAliasesCache.set(candidate, aliases);
|
|
364
|
+
return aliases;
|
|
365
|
+
}
|
|
366
|
+
function candidateAliasKeys(candidate) {
|
|
367
|
+
const cached = aliasKeysCache.get(candidate);
|
|
368
|
+
if (cached)
|
|
369
|
+
return cached;
|
|
370
|
+
const keys = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
|
|
371
|
+
aliasKeysCache.set(candidate, keys);
|
|
372
|
+
return keys;
|
|
360
373
|
}
|
|
361
374
|
function canonicalizeAliasValue(value) {
|
|
362
375
|
const parsed = parseAgentIdentity(value.startsWith("@") ? value : `@${value}`);
|
|
@@ -373,7 +386,10 @@ function identityAliasKeys(identity) {
|
|
|
373
386
|
].filter(Boolean)));
|
|
374
387
|
}
|
|
375
388
|
function candidateCanonicalIdentity(candidate) {
|
|
376
|
-
|
|
389
|
+
if (canonicalIdentityCache.has(candidate)) {
|
|
390
|
+
return canonicalIdentityCache.get(candidate) ?? null;
|
|
391
|
+
}
|
|
392
|
+
const canonical = constructAgentIdentity({
|
|
377
393
|
definitionId: candidate.definitionId || candidate.agentId,
|
|
378
394
|
nodeQualifier: candidate.nodeQualifier,
|
|
379
395
|
workspaceQualifier: candidate.workspaceQualifier,
|
|
@@ -381,6 +397,8 @@ function candidateCanonicalIdentity(candidate) {
|
|
|
381
397
|
harness: candidate.harness,
|
|
382
398
|
model: candidate.model
|
|
383
399
|
});
|
|
400
|
+
canonicalIdentityCache.set(candidate, canonical);
|
|
401
|
+
return canonical;
|
|
384
402
|
}
|
|
385
403
|
function candidateDimensionValue(candidate, dimension) {
|
|
386
404
|
const canonical = candidateCanonicalIdentity(candidate);
|
|
@@ -477,8 +495,8 @@ function definitionMatchesIdentity(identityDefinitionId, candidateDefinitionId)
|
|
|
477
495
|
}
|
|
478
496
|
function agentIdentityMatches(identity, candidate) {
|
|
479
497
|
const aliasKeys = identityAliasKeys(identity);
|
|
480
|
-
const
|
|
481
|
-
if (aliasKeys.some((key) =>
|
|
498
|
+
const candidateAliasKeys2 = explicitCandidateAliases(candidate).map(canonicalizeAliasValue);
|
|
499
|
+
if (aliasKeys.some((key) => candidateAliasKeys2.includes(key))) {
|
|
482
500
|
return true;
|
|
483
501
|
}
|
|
484
502
|
const canonical = canonicalizeIdentity({
|
|
@@ -516,8 +534,8 @@ function resolveAgentIdentity(identity, candidates) {
|
|
|
516
534
|
function diagnoseAgentIdentity(identity, candidates) {
|
|
517
535
|
const aliasKeys = identityAliasKeys(identity);
|
|
518
536
|
const exactAliasMatches = candidates.filter((candidate) => {
|
|
519
|
-
const
|
|
520
|
-
return aliasKeys.some((key) =>
|
|
537
|
+
const keys = candidateAliasKeys(candidate);
|
|
538
|
+
return keys.length > 0 && aliasKeys.some((key) => keys.includes(key));
|
|
521
539
|
});
|
|
522
540
|
if (exactAliasMatches.length === 1) {
|
|
523
541
|
return { kind: "resolved", match: exactAliasMatches[0] };
|
|
@@ -558,15 +576,31 @@ function buildIdentitySubset(candidate, dimensions) {
|
|
|
558
576
|
...dimensions.includes("node") && canonical.nodeQualifier ? { nodeQualifier: canonical.nodeQualifier } : {}
|
|
559
577
|
});
|
|
560
578
|
}
|
|
579
|
+
function peersByDefinitionId(candidates) {
|
|
580
|
+
const cached = peersByDefinitionCache.get(candidates);
|
|
581
|
+
if (cached)
|
|
582
|
+
return cached;
|
|
583
|
+
const groups = new Map;
|
|
584
|
+
for (const candidate of candidates) {
|
|
585
|
+
const canonical = candidateCanonicalIdentity(candidate);
|
|
586
|
+
if (!canonical)
|
|
587
|
+
continue;
|
|
588
|
+
const group = groups.get(canonical.definitionId);
|
|
589
|
+
if (group) {
|
|
590
|
+
group.push(candidate);
|
|
591
|
+
} else {
|
|
592
|
+
groups.set(canonical.definitionId, [candidate]);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
peersByDefinitionCache.set(candidates, groups);
|
|
596
|
+
return groups;
|
|
597
|
+
}
|
|
561
598
|
function formatMinimalAgentIdentity(candidate, candidates, options = {}) {
|
|
562
599
|
const canonical = candidateCanonicalIdentity(candidate);
|
|
563
600
|
if (!canonical) {
|
|
564
601
|
return options.includeSigil === false ? "" : "@";
|
|
565
602
|
}
|
|
566
|
-
const peers = candidates.
|
|
567
|
-
const peerCanonical = candidateCanonicalIdentity(peer);
|
|
568
|
-
return peerCanonical && peerCanonical.definitionId === canonical.definitionId;
|
|
569
|
-
});
|
|
603
|
+
const peers = peersByDefinitionId(candidates).get(canonical.definitionId) ?? [];
|
|
570
604
|
const aliasMatches = explicitCandidateAliases(candidate).map((alias) => ({ alias, identity: parseAgentIdentity(`@${alias}`) })).filter((entry) => Boolean(entry.identity)).filter((entry) => resolveAgentIdentity(entry.identity, candidates) === candidate).sort((left, right) => left.alias.length - right.alias.length || left.alias.localeCompare(right.alias));
|
|
571
605
|
if (aliasMatches.length > 0) {
|
|
572
606
|
return formatAgentIdentity({ definitionId: aliasMatches[0].alias }, options);
|
|
@@ -595,7 +629,7 @@ function formatMinimalAgentIdentity(candidate, candidates, options = {}) {
|
|
|
595
629
|
}
|
|
596
630
|
return formatAgentIdentity(canonical, options);
|
|
597
631
|
}
|
|
598
|
-
var DIMENSION_ALIASES, normalizeAgentSelectorSegment, SCOUT_DISPATCHER_AGENT_ID = "scout", OPENSCOUT_COORDINATOR_AGENT_ID = "openscout", BUILT_IN_AGENT_DEFINITION_IDS, RESERVED_AGENT_DEFINITION_IDS, parseAgentSelector, formatAgentSelector, extractAgentSelectors, resolveAgentSelector;
|
|
632
|
+
var DIMENSION_ALIASES, normalizeAgentSelectorSegment, SCOUT_DISPATCHER_AGENT_ID = "scout", OPENSCOUT_COORDINATOR_AGENT_ID = "openscout", BUILT_IN_AGENT_DEFINITION_IDS, RESERVED_AGENT_DEFINITION_IDS, explicitAliasesCache, aliasKeysCache, canonicalIdentityCache, peersByDefinitionCache, parseAgentSelector, formatAgentSelector, extractAgentSelectors, resolveAgentSelector;
|
|
599
633
|
var init_agent_identity = __esm(() => {
|
|
600
634
|
DIMENSION_ALIASES = {
|
|
601
635
|
workspace: "workspace",
|
|
@@ -619,6 +653,10 @@ var init_agent_identity = __esm(() => {
|
|
|
619
653
|
RESERVED_AGENT_DEFINITION_IDS = new Set([
|
|
620
654
|
SCOUT_DISPATCHER_AGENT_ID
|
|
621
655
|
]);
|
|
656
|
+
explicitAliasesCache = new WeakMap;
|
|
657
|
+
aliasKeysCache = new WeakMap;
|
|
658
|
+
canonicalIdentityCache = new WeakMap;
|
|
659
|
+
peersByDefinitionCache = new WeakMap;
|
|
622
660
|
parseAgentSelector = parseAgentIdentity;
|
|
623
661
|
formatAgentSelector = formatAgentIdentity;
|
|
624
662
|
extractAgentSelectors = extractAgentIdentities;
|
|
@@ -1089,7 +1127,7 @@ var SCOUT_RUNTIME_CATALOG_DATA;
|
|
|
1089
1127
|
var init_runtime_catalog_generated = __esm(() => {
|
|
1090
1128
|
SCOUT_RUNTIME_CATALOG_DATA = {
|
|
1091
1129
|
schemaVersion: "openscout.runtime-catalog.v1",
|
|
1092
|
-
revision: "2026-08-
|
|
1130
|
+
revision: "2026-08-18.1",
|
|
1093
1131
|
harnesses: [
|
|
1094
1132
|
{
|
|
1095
1133
|
id: "claude",
|
|
@@ -1218,6 +1256,7 @@ var init_runtime_catalog_generated = __esm(() => {
|
|
|
1218
1256
|
id: "grok",
|
|
1219
1257
|
label: "Grok CLI",
|
|
1220
1258
|
enabled: true,
|
|
1259
|
+
listed: false,
|
|
1221
1260
|
reasoningEfforts: [
|
|
1222
1261
|
"low",
|
|
1223
1262
|
"medium",
|
|
@@ -1253,7 +1292,7 @@ var init_runtime_catalog_generated = __esm(() => {
|
|
|
1253
1292
|
},
|
|
1254
1293
|
{
|
|
1255
1294
|
id: "grok-acp",
|
|
1256
|
-
label: "Grok
|
|
1295
|
+
label: "Grok",
|
|
1257
1296
|
enabled: true,
|
|
1258
1297
|
reasoningEfforts: null,
|
|
1259
1298
|
models: [
|
|
@@ -2075,7 +2114,7 @@ function validateScoutRendezvousCodename(codename) {
|
|
|
2075
2114
|
}
|
|
2076
2115
|
var SCOUT_RENDEZVOUS_GENERATED_CODENAME_LENGTH = 6, SCOUT_RENDEZVOUS_CODENAME_MAX_LENGTH = 32, SCOUT_RENDEZVOUS_INVITE_TTL_MS, SCOUT_RENDEZVOUS_MAX_WAIT_MS;
|
|
2077
2116
|
var init_rendezvous = __esm(() => {
|
|
2078
|
-
SCOUT_RENDEZVOUS_INVITE_TTL_MS =
|
|
2117
|
+
SCOUT_RENDEZVOUS_INVITE_TTL_MS = 4 * 60 * 60000;
|
|
2079
2118
|
SCOUT_RENDEZVOUS_MAX_WAIT_MS = 10 * 60000;
|
|
2080
2119
|
});
|
|
2081
2120
|
|
|
@@ -13762,14 +13801,20 @@ function herdrProbeTarget(env) {
|
|
|
13762
13801
|
return {
|
|
13763
13802
|
bin: herdrBin(env),
|
|
13764
13803
|
path: env.PATH ?? "",
|
|
13765
|
-
home: env.
|
|
13804
|
+
home: env.HOME?.trim() || homedir10(),
|
|
13805
|
+
xdgConfigHome: env.XDG_CONFIG_HOME?.trim() || null
|
|
13766
13806
|
};
|
|
13767
13807
|
}
|
|
13768
13808
|
function parseHerdrProbeKey(key) {
|
|
13769
13809
|
try {
|
|
13770
13810
|
const parsed = JSON.parse(key);
|
|
13771
13811
|
if (typeof parsed?.bin === "string" && typeof parsed.path === "string" && typeof parsed.home === "string") {
|
|
13772
|
-
return {
|
|
13812
|
+
return {
|
|
13813
|
+
bin: parsed.bin,
|
|
13814
|
+
path: parsed.path,
|
|
13815
|
+
home: parsed.home,
|
|
13816
|
+
xdgConfigHome: typeof parsed.xdgConfigHome === "string" && parsed.xdgConfigHome.trim() ? parsed.xdgConfigHome.trim() : null
|
|
13817
|
+
};
|
|
13773
13818
|
}
|
|
13774
13819
|
} catch {}
|
|
13775
13820
|
return herdrProbeTarget(process.env);
|
|
@@ -13811,8 +13856,13 @@ function parseHerdrSessionListJson(output) {
|
|
|
13811
13856
|
async function readHerdrSessionsLocal(key, ctx) {
|
|
13812
13857
|
const target = parseHerdrProbeKey(key);
|
|
13813
13858
|
try {
|
|
13859
|
+
const env = { ...process.env, PATH: target.path, HOME: target.home };
|
|
13860
|
+
if (target.xdgConfigHome)
|
|
13861
|
+
env.XDG_CONFIG_HOME = target.xdgConfigHome;
|
|
13862
|
+
else
|
|
13863
|
+
delete env.XDG_CONFIG_HOME;
|
|
13814
13864
|
const { stdout } = await execProbeFile(ctx, target.bin, ["session", "list", "--json"], {
|
|
13815
|
-
env
|
|
13865
|
+
env,
|
|
13816
13866
|
maxStdoutBytes: 512 * 1024,
|
|
13817
13867
|
maxStderrBytes: 64 * 1024
|
|
13818
13868
|
});
|
|
@@ -13823,7 +13873,7 @@ async function readHerdrSessionsLocal(key, ctx) {
|
|
|
13823
13873
|
throw error;
|
|
13824
13874
|
}
|
|
13825
13875
|
}
|
|
13826
|
-
var HERDR_TTL_MS = 5000, HERDR_TIMEOUT_MS = 2000, herdrSessionsProbe;
|
|
13876
|
+
var HERDR_TTL_MS = 5000, HERDR_TIMEOUT_MS = 2000, herdrSessionsProbe, herdrTopologyCache;
|
|
13827
13877
|
var init_herdr = __esm(() => {
|
|
13828
13878
|
init_registry();
|
|
13829
13879
|
init_exec();
|
|
@@ -13848,6 +13898,7 @@ var init_herdr = __esm(() => {
|
|
|
13848
13898
|
});
|
|
13849
13899
|
}
|
|
13850
13900
|
});
|
|
13901
|
+
herdrTopologyCache = new Map;
|
|
13851
13902
|
});
|
|
13852
13903
|
|
|
13853
13904
|
// ../runtime/src/system-probes/sessions.ts
|
|
@@ -28892,7 +28943,7 @@ function buildCollaborationContractPrompt(agentId) {
|
|
|
28892
28943
|
}
|
|
28893
28944
|
|
|
28894
28945
|
// ../runtime/src/pi-rpc.ts
|
|
28895
|
-
import { existsSync as existsSync23 } from "fs";
|
|
28946
|
+
import { existsSync as existsSync23, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
|
|
28896
28947
|
import { mkdir as mkdir9, writeFile as writeFile8 } from "fs/promises";
|
|
28897
28948
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
28898
28949
|
import { homedir as homedir22 } from "os";
|
|
@@ -28950,7 +29001,37 @@ function inferPiProvider(launch) {
|
|
|
28950
29001
|
}
|
|
28951
29002
|
return;
|
|
28952
29003
|
}
|
|
28953
|
-
function
|
|
29004
|
+
function readPiRpcCredentialFile(name, options = {}) {
|
|
29005
|
+
if (!/^[A-Z0-9_]+$/.test(name)) {
|
|
29006
|
+
return;
|
|
29007
|
+
}
|
|
29008
|
+
const env = options.env ?? process.env;
|
|
29009
|
+
const platform = options.platform ?? process.platform;
|
|
29010
|
+
const directory = normalizeOptionalString2(env.CREDENTIALS_DIRECTORY) ?? normalizeOptionalString2(env.OPENSCOUT_CREDENTIALS_DIRECTORY) ?? (platform === "linux" ? join27(normalizeOptionalString2(env.XDG_CONFIG_HOME) ?? join27(options.homedir ?? homedir22(), ".config"), "openscout", "credentials") : undefined);
|
|
29011
|
+
if (!directory) {
|
|
29012
|
+
return;
|
|
29013
|
+
}
|
|
29014
|
+
try {
|
|
29015
|
+
const directoryStat = statSync6(directory);
|
|
29016
|
+
if (!directoryStat.isDirectory() || (directoryStat.mode & 63) !== 0) {
|
|
29017
|
+
return;
|
|
29018
|
+
}
|
|
29019
|
+
const path = join27(directory, name);
|
|
29020
|
+
const stat5 = statSync6(path);
|
|
29021
|
+
if (!stat5.isFile() || (stat5.mode & 63) !== 0 || stat5.size > 16 * 1024) {
|
|
29022
|
+
return;
|
|
29023
|
+
}
|
|
29024
|
+
const value = readFileSync10(path, "utf8").trim();
|
|
29025
|
+
return value || undefined;
|
|
29026
|
+
} catch {
|
|
29027
|
+
return;
|
|
29028
|
+
}
|
|
29029
|
+
}
|
|
29030
|
+
function readSecretValue(name, commandOverride, env = process.env) {
|
|
29031
|
+
const credentialFile = readPiRpcCredentialFile(name, { env });
|
|
29032
|
+
if (credentialFile) {
|
|
29033
|
+
return credentialFile;
|
|
29034
|
+
}
|
|
28954
29035
|
try {
|
|
28955
29036
|
const output = execFileSync5(commandOverride || "secret", ["get", name], {
|
|
28956
29037
|
encoding: "utf8",
|
|
@@ -28984,7 +29065,7 @@ function buildPiRpcCredentialEnv(launch, sources = {}) {
|
|
|
28984
29065
|
}
|
|
28985
29066
|
const env = {};
|
|
28986
29067
|
const sourceEnv = sources.env ?? process.env;
|
|
28987
|
-
const readSecret = sources.readSecret ?? ((name) => readSecretValue(name, sources.secretCommand));
|
|
29068
|
+
const readSecret = sources.readSecret ?? ((name) => readSecretValue(name, sources.secretCommand, sourceEnv));
|
|
28988
29069
|
for (const mapping of mappings) {
|
|
28989
29070
|
const value = readMappedCredentialValue(mapping, sourceEnv, readSecret);
|
|
28990
29071
|
if (value) {
|
|
@@ -29361,7 +29442,7 @@ var init_local_agent_template = __esm(() => {
|
|
|
29361
29442
|
});
|
|
29362
29443
|
|
|
29363
29444
|
// ../runtime/src/relay-agent-process-leases.ts
|
|
29364
|
-
import { existsSync as existsSync24, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as
|
|
29445
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync11, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
|
|
29365
29446
|
import { join as join28 } from "path";
|
|
29366
29447
|
function processLeasesDirectory() {
|
|
29367
29448
|
return join28(resolveOpenScoutSupportPaths().runtimeDirectory, "process-leases");
|
|
@@ -29513,7 +29594,7 @@ var init_permission_policy2 = __esm(() => {
|
|
|
29513
29594
|
});
|
|
29514
29595
|
|
|
29515
29596
|
// ../runtime/src/user-config.ts
|
|
29516
|
-
import { existsSync as existsSync25, readFileSync as
|
|
29597
|
+
import { existsSync as existsSync25, readFileSync as readFileSync12, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6 } from "fs";
|
|
29517
29598
|
import { homedir as homedir23 } from "os";
|
|
29518
29599
|
import { dirname as dirname16, join as join30 } from "path";
|
|
29519
29600
|
function userConfigPath() {
|
|
@@ -29524,7 +29605,7 @@ function loadUserConfig() {
|
|
|
29524
29605
|
if (!existsSync25(configPath))
|
|
29525
29606
|
return {};
|
|
29526
29607
|
try {
|
|
29527
|
-
return JSON.parse(
|
|
29608
|
+
return JSON.parse(readFileSync12(configPath, "utf8"));
|
|
29528
29609
|
} catch {
|
|
29529
29610
|
return {};
|
|
29530
29611
|
}
|
|
@@ -29540,7 +29621,7 @@ function readSettingsOperatorName() {
|
|
|
29540
29621
|
if (!existsSync25(settingsPath))
|
|
29541
29622
|
return "";
|
|
29542
29623
|
try {
|
|
29543
|
-
const settings = JSON.parse(
|
|
29624
|
+
const settings = JSON.parse(readFileSync12(settingsPath, "utf8"));
|
|
29544
29625
|
const candidate = typeof settings.profile?.operatorName === "string" ? settings.profile.operatorName : typeof settings.operatorName === "string" ? settings.operatorName : "";
|
|
29545
29626
|
return candidate.trim();
|
|
29546
29627
|
} catch {
|
|
@@ -29563,7 +29644,7 @@ var init_user_config = __esm(() => {
|
|
|
29563
29644
|
});
|
|
29564
29645
|
|
|
29565
29646
|
// ../runtime/src/local-agents.ts
|
|
29566
|
-
import { existsSync as existsSync26, readFileSync as
|
|
29647
|
+
import { existsSync as existsSync26, readFileSync as readFileSync13 } from "fs";
|
|
29567
29648
|
import { mkdir as mkdir10, readFile as readFile13, rm as rm4, stat as stat5, writeFile as writeFile9 } from "fs/promises";
|
|
29568
29649
|
import { basename as basename9, dirname as dirname17, join as join31, resolve as resolve13 } from "path";
|
|
29569
29650
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
@@ -29579,7 +29660,7 @@ function resolveProjectsRoot(projectPath) {
|
|
|
29579
29660
|
if (!existsSync26(supportPaths.settingsPath)) {
|
|
29580
29661
|
return dirname17(projectPath);
|
|
29581
29662
|
}
|
|
29582
|
-
const raw = JSON.parse(
|
|
29663
|
+
const raw = JSON.parse(readFileSync13(supportPaths.settingsPath, "utf8"));
|
|
29583
29664
|
const workspaceRoot = raw.discovery?.workspaceRoots?.find((entry) => typeof entry === "string" && entry.trim().length > 0);
|
|
29584
29665
|
return workspaceRoot ? resolve13(workspaceRoot) : dirname17(projectPath);
|
|
29585
29666
|
} catch {
|
|
@@ -31408,7 +31489,7 @@ async function ensureLocalAgentOnlineOnce(agentName, record2) {
|
|
|
31408
31489
|
}
|
|
31409
31490
|
}
|
|
31410
31491
|
if (!sessionOnline) {
|
|
31411
|
-
const stderrTail = existsSync26(stderrLogFile) ?
|
|
31492
|
+
const stderrTail = existsSync26(stderrLogFile) ? readFileSync13(stderrLogFile, "utf8").trim().split(/\r?\n/).slice(-10).join(`
|
|
31412
31493
|
`).trim() : "";
|
|
31413
31494
|
throw new Error(stderrTail ? `Relay agent ${agentName} failed to stay online:
|
|
31414
31495
|
${redactSecrets(stderrTail)}` : `Relay agent ${agentName} failed to stay online.`);
|
|
@@ -31927,7 +32008,7 @@ function readPersistedSessionCatalogId(runtimeDir) {
|
|
|
31927
32008
|
try {
|
|
31928
32009
|
const catalogPath = join31(runtimeDir, "session-catalog.json");
|
|
31929
32010
|
if (existsSync26(catalogPath)) {
|
|
31930
|
-
const raw =
|
|
32011
|
+
const raw = readFileSync13(catalogPath, "utf8").trim();
|
|
31931
32012
|
if (raw) {
|
|
31932
32013
|
const catalog = JSON.parse(raw);
|
|
31933
32014
|
if (typeof catalog.activeSessionId === "string" && catalog.activeSessionId.trim()) {
|
|
@@ -31944,7 +32025,7 @@ function readPersistedLegacySessionId(runtimeDir, filename) {
|
|
|
31944
32025
|
try {
|
|
31945
32026
|
const legacyPath = join31(runtimeDir, filename);
|
|
31946
32027
|
if (existsSync26(legacyPath)) {
|
|
31947
|
-
const value =
|
|
32028
|
+
const value = readFileSync13(legacyPath, "utf8").trim();
|
|
31948
32029
|
return value || null;
|
|
31949
32030
|
}
|
|
31950
32031
|
return null;
|
|
@@ -32040,6 +32121,7 @@ function buildLocalAgentBinding(agentId, record2, alive, nodeId, source) {
|
|
|
32040
32121
|
labels: ["relay", "project", "agent", "local-agent"],
|
|
32041
32122
|
metadata: {
|
|
32042
32123
|
source,
|
|
32124
|
+
brokerRegistered: true,
|
|
32043
32125
|
...normalizedRecord.registrationSource ? { registrationSource: normalizedRecord.registrationSource } : {},
|
|
32044
32126
|
project: normalizedRecord.project,
|
|
32045
32127
|
projectRoot,
|
|
@@ -42214,15 +42296,6 @@ var init_sqlite_store = __esm(() => {
|
|
|
42214
42296
|
{ key: "pairingSessionId", kind: "pairing" }
|
|
42215
42297
|
];
|
|
42216
42298
|
});
|
|
42217
|
-
// ../runtime/src/mesh-discovery.ts
|
|
42218
|
-
var init_mesh_discovery = __esm(() => {
|
|
42219
|
-
init_tailscale();
|
|
42220
|
-
});
|
|
42221
|
-
|
|
42222
|
-
// ../runtime/src/iroh-bridge.ts
|
|
42223
|
-
var init_iroh_bridge = __esm(() => {
|
|
42224
|
-
init_support_paths();
|
|
42225
|
-
});
|
|
42226
42299
|
|
|
42227
42300
|
// ../runtime/src/mesh-peer-auth.ts
|
|
42228
42301
|
import { createHash as createHash5, randomBytes as randomBytes2 } from "crypto";
|
|
@@ -57862,6 +57935,17 @@ var init_mesh_peer_client = __esm(() => {
|
|
|
57862
57935
|
meshPeerFetch = createMeshPeerFetch();
|
|
57863
57936
|
});
|
|
57864
57937
|
|
|
57938
|
+
// ../runtime/src/mesh-discovery.ts
|
|
57939
|
+
var init_mesh_discovery = __esm(() => {
|
|
57940
|
+
init_mesh_peer_client();
|
|
57941
|
+
init_tailscale();
|
|
57942
|
+
});
|
|
57943
|
+
|
|
57944
|
+
// ../runtime/src/iroh-bridge.ts
|
|
57945
|
+
var init_iroh_bridge = __esm(() => {
|
|
57946
|
+
init_support_paths();
|
|
57947
|
+
});
|
|
57948
|
+
|
|
57865
57949
|
// ../runtime/src/mesh-forwarding.ts
|
|
57866
57950
|
var init_mesh_forwarding = __esm(() => {
|
|
57867
57951
|
init_iroh_bridge();
|
|
@@ -59803,10 +59887,7 @@ class BrokerRendezvousService {
|
|
|
59803
59887
|
suggestion: "choose_another_codename"
|
|
59804
59888
|
};
|
|
59805
59889
|
}
|
|
59806
|
-
|
|
59807
|
-
if (expiredInvite) {
|
|
59808
|
-
return expiredResponse(expiredInvite, participantId);
|
|
59809
|
-
}
|
|
59890
|
+
this.expiredInvites.delete(key);
|
|
59810
59891
|
return this.createPresence(projectRoot, participantId, requestedCodename, normalizedCodename, now);
|
|
59811
59892
|
}
|
|
59812
59893
|
for (let attempt = 0;attempt < MAX_CODENAME_GENERATION_ATTEMPTS; attempt += 1) {
|
|
@@ -60084,7 +60165,7 @@ var init_broker_rendezvous_service = __esm(() => {
|
|
|
60084
60165
|
});
|
|
60085
60166
|
|
|
60086
60167
|
// ../runtime/src/provisional-agent-names-config.ts
|
|
60087
|
-
import { existsSync as existsSync28, readFileSync as
|
|
60168
|
+
import { existsSync as existsSync28, readFileSync as readFileSync14, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8 } from "fs";
|
|
60088
60169
|
import { homedir as homedir24 } from "os";
|
|
60089
60170
|
import { isAbsolute as isAbsolute4, join as join33, resolve as resolve15 } from "path";
|
|
60090
60171
|
function openScoutHome() {
|
|
@@ -60120,7 +60201,7 @@ function resolvePoolFilePath(filePath) {
|
|
|
60120
60201
|
return isAbsolute4(trimmed) ? trimmed : resolve15(openScoutHome(), trimmed);
|
|
60121
60202
|
}
|
|
60122
60203
|
function readProvisionalAgentNamesJsonFile(filePath) {
|
|
60123
|
-
return parseProvisionalAgentNamesJson(
|
|
60204
|
+
return parseProvisionalAgentNamesJson(readFileSync14(filePath, "utf8"));
|
|
60124
60205
|
}
|
|
60125
60206
|
function loadInlineProvisionalAgentNames(config) {
|
|
60126
60207
|
const customNames = normalizeProvisionalAgentNamesSetting(config.provisionalAgentNames);
|
|
@@ -61880,7 +61961,7 @@ var init_thread_events = __esm(() => {
|
|
|
61880
61961
|
|
|
61881
61962
|
// ../runtime/src/mobile-push.ts
|
|
61882
61963
|
import { Database as Database2 } from "bun:sqlite";
|
|
61883
|
-
import { mkdirSync as mkdirSync9, readFileSync as
|
|
61964
|
+
import { mkdirSync as mkdirSync9, readFileSync as readFileSync15 } from "fs";
|
|
61884
61965
|
import { connect as connectHttp2 } from "http2";
|
|
61885
61966
|
import { createPrivateKey as createPrivateKey3, sign as signWithKey } from "crypto";
|
|
61886
61967
|
import { dirname as dirname20, join as join36 } from "path";
|
|
@@ -62199,7 +62280,7 @@ function loadApnsCredentials() {
|
|
|
62199
62280
|
privateKeyPem = Buffer.from(inlineBase64, "base64").toString("utf8");
|
|
62200
62281
|
}
|
|
62201
62282
|
if (!privateKeyPem && path) {
|
|
62202
|
-
privateKeyPem =
|
|
62283
|
+
privateKeyPem = readFileSync15(path, "utf8");
|
|
62203
62284
|
}
|
|
62204
62285
|
if (!teamId || !keyId || !privateKeyPem) {
|
|
62205
62286
|
return null;
|
|
@@ -62902,7 +62983,7 @@ var init_paths2 = __esm(() => {
|
|
|
62902
62983
|
});
|
|
62903
62984
|
|
|
62904
62985
|
// ../runtime/src/knowledge/store.ts
|
|
62905
|
-
import { existsSync as existsSync31, mkdirSync as mkdirSync10, statSync as
|
|
62986
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync10, statSync as statSync7 } from "fs";
|
|
62906
62987
|
import { createHash as createHash8, randomUUID as randomUUID4 } from "crypto";
|
|
62907
62988
|
import { dirname as dirname21 } from "path";
|
|
62908
62989
|
import { Database as Database3 } from "bun:sqlite";
|
|
@@ -63561,7 +63642,7 @@ class SQLiteKnowledgeStore {
|
|
|
63561
63642
|
const chunkCounts = this.db.query("SELECT COUNT(*) AS total FROM chunks").get();
|
|
63562
63643
|
let sqliteBytes = 0;
|
|
63563
63644
|
try {
|
|
63564
|
-
sqliteBytes =
|
|
63645
|
+
sqliteBytes = statSync7(this.paths.sqlitePath).size;
|
|
63565
63646
|
} catch {
|
|
63566
63647
|
sqliteBytes = 0;
|
|
63567
63648
|
}
|
|
@@ -63706,11 +63787,11 @@ import {
|
|
|
63706
63787
|
createReadStream as createReadStream2,
|
|
63707
63788
|
existsSync as existsSync32,
|
|
63708
63789
|
mkdirSync as mkdirSync11,
|
|
63709
|
-
readFileSync as
|
|
63790
|
+
readFileSync as readFileSync16,
|
|
63710
63791
|
readdirSync as readdirSync5,
|
|
63711
63792
|
renameSync as renameSync4,
|
|
63712
63793
|
rmSync as rmSync4,
|
|
63713
|
-
statSync as
|
|
63794
|
+
statSync as statSync8,
|
|
63714
63795
|
writeFileSync as writeFileSync8
|
|
63715
63796
|
} from "fs";
|
|
63716
63797
|
import { homedir as homedir27 } from "os";
|
|
@@ -63796,7 +63877,7 @@ function discoverRecentSessionFiles(cutoffMs, limit, harnessFilter) {
|
|
|
63796
63877
|
const path = join38(dir, entry);
|
|
63797
63878
|
let stats;
|
|
63798
63879
|
try {
|
|
63799
|
-
stats =
|
|
63880
|
+
stats = statSync8(path);
|
|
63800
63881
|
} catch {
|
|
63801
63882
|
continue;
|
|
63802
63883
|
}
|
|
@@ -64093,8 +64174,8 @@ function readKimiSessionState(wirePath) {
|
|
|
64093
64174
|
let cwd = null;
|
|
64094
64175
|
let title = null;
|
|
64095
64176
|
try {
|
|
64096
|
-
const state = recordValue2(JSON.parse(
|
|
64097
|
-
cwd = stringValue15(state?.workDir) ?? null;
|
|
64177
|
+
const state = recordValue2(JSON.parse(readFileSync16(join38(sessionDirectory, "state.json"), "utf8")));
|
|
64178
|
+
cwd = stringValue15(state?.cwd) ?? stringValue15(state?.workDir) ?? null;
|
|
64098
64179
|
title = stringValue15(state?.title) ?? null;
|
|
64099
64180
|
} catch {}
|
|
64100
64181
|
return { cwd, sessionId, title };
|
|
@@ -64850,6 +64931,7 @@ var init_src3 = __esm(() => {
|
|
|
64850
64931
|
init_sqlite_store();
|
|
64851
64932
|
init_mesh_discovery();
|
|
64852
64933
|
init_mesh_forwarding();
|
|
64934
|
+
init_mesh_peer_client();
|
|
64853
64935
|
init_mesh_rendezvous();
|
|
64854
64936
|
init_node_identity();
|
|
64855
64937
|
init_node_tls_identity();
|
|
@@ -65997,6 +66079,7 @@ function scoutBrokerAgentRegistrationFromConfig(config, nodeId) {
|
|
|
65997
66079
|
labels: ["relay", "project", "agent", "local-agent"],
|
|
65998
66080
|
metadata: {
|
|
65999
66081
|
...metadata,
|
|
66082
|
+
brokerRegistered: true,
|
|
66000
66083
|
summary: `${config.displayName} agent for ${config.projectName}.`,
|
|
66001
66084
|
role: "Agent"
|
|
66002
66085
|
},
|
|
@@ -66097,9 +66180,12 @@ async function resolveConversationActorId(baseUrl, snapshot, nodeId, actorId, cu
|
|
|
66097
66180
|
await syncBrokerAgentRegistration(baseUrl, snapshot, scoutBrokerAgentRegistrationFromConfig(configured, nodeId));
|
|
66098
66181
|
return configured.agentId;
|
|
66099
66182
|
}
|
|
66183
|
+
function isReusableBrokerRegisteredTargetAgent(agent) {
|
|
66184
|
+
return Boolean(agent && !metadataBoolean(agent.metadata, "staleLocalRegistration") && (metadataString5(agent.metadata, "source") !== "relay-agent-registry" || metadataBoolean(agent.metadata, "brokerRegistered")));
|
|
66185
|
+
}
|
|
66100
66186
|
async function ensureTargetRelayAgentRegistered(baseUrl, snapshot, nodeId, agentId, currentDirectory) {
|
|
66101
66187
|
const existingAgent = snapshot.agents[agentId];
|
|
66102
|
-
if (
|
|
66188
|
+
if (isReusableBrokerRegisteredTargetAgent(existingAgent)) {
|
|
66103
66189
|
return true;
|
|
66104
66190
|
}
|
|
66105
66191
|
const configured = await ensureRelayAgentConfigured(agentId, {
|
|
@@ -68682,7 +68768,7 @@ var init_ask2 = __esm(() => {
|
|
|
68682
68768
|
|
|
68683
68769
|
// ../../apps/desktop/src/cli/app-lifecycle.ts
|
|
68684
68770
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
68685
|
-
import { existsSync as existsSync33, statSync as
|
|
68771
|
+
import { existsSync as existsSync33, statSync as statSync9 } from "fs";
|
|
68686
68772
|
import { join as join40, resolve as resolve19 } from "path";
|
|
68687
68773
|
function resolveLaunchdLabel(env = process.env) {
|
|
68688
68774
|
const explicit = (env.OPENSCOUT_SERVICE_LABEL ?? "").trim() || (env.OPENSCOUT_BROKER_SERVICE_LABEL ?? "").trim();
|
|
@@ -68767,7 +68853,7 @@ function isSuperseded(record2, binaryPath, now = Date.now()) {
|
|
|
68767
68853
|
return false;
|
|
68768
68854
|
let modifiedAt;
|
|
68769
68855
|
try {
|
|
68770
|
-
modifiedAt =
|
|
68856
|
+
modifiedAt = statSync9(binaryPath).mtimeMs;
|
|
68771
68857
|
} catch {
|
|
68772
68858
|
return false;
|
|
68773
68859
|
}
|
|
@@ -99389,7 +99475,7 @@ var init_stdio2 = __esm(() => {
|
|
|
99389
99475
|
// ../../apps/desktop/src/shared/product.ts
|
|
99390
99476
|
var SCOUT_APP_VERSION;
|
|
99391
99477
|
var init_product = __esm(() => {
|
|
99392
|
-
SCOUT_APP_VERSION = process.env.SCOUT_APP_VERSION?.trim() || "0.2.
|
|
99478
|
+
SCOUT_APP_VERSION = process.env.SCOUT_APP_VERSION?.trim() || "0.2.80";
|
|
99393
99479
|
});
|
|
99394
99480
|
|
|
99395
99481
|
// ../../apps/desktop/src/core/mcp/stdio-server-lifecycle.ts
|
|
@@ -101731,7 +101817,7 @@ async function loadScoutRuntimesReport(currentDirectory) {
|
|
|
101731
101817
|
reasoningEffort: scoutRuntimeDefaultReasoningEffort(defaultHarness ?? "", defaultModel, runtimeCatalog)
|
|
101732
101818
|
},
|
|
101733
101819
|
defaultsByHarness: scoutRuntimeDefaultsByHarness(runtimeCatalog),
|
|
101734
|
-
harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled).map((entry) => {
|
|
101820
|
+
harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled && entry.listed !== false).map((entry) => {
|
|
101735
101821
|
const readiness = catalog.entries.find((candidate) => candidate.harness === entry.id);
|
|
101736
101822
|
return {
|
|
101737
101823
|
id: entry.id,
|
|
@@ -101771,7 +101857,7 @@ var init_service5 = __esm(() => {
|
|
|
101771
101857
|
});
|
|
101772
101858
|
|
|
101773
101859
|
// ../../apps/desktop/src/shared/paths.ts
|
|
101774
|
-
import { existsSync as existsSync37, readFileSync as
|
|
101860
|
+
import { existsSync as existsSync37, readFileSync as readFileSync17 } from "fs";
|
|
101775
101861
|
import { dirname as dirname27, join as join46, resolve as resolve26 } from "path";
|
|
101776
101862
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
101777
101863
|
function looksLikeWorkspaceRoot(candidate) {
|
|
@@ -101780,7 +101866,7 @@ function looksLikeWorkspaceRoot(candidate) {
|
|
|
101780
101866
|
return false;
|
|
101781
101867
|
}
|
|
101782
101868
|
try {
|
|
101783
|
-
const parsed = JSON.parse(
|
|
101869
|
+
const parsed = JSON.parse(readFileSync17(packageJsonPath, "utf8"));
|
|
101784
101870
|
return Array.isArray(parsed.workspaces);
|
|
101785
101871
|
} catch {
|
|
101786
101872
|
return false;
|
|
@@ -101792,7 +101878,7 @@ function looksLikePackagedAppRoot(candidate) {
|
|
|
101792
101878
|
return false;
|
|
101793
101879
|
}
|
|
101794
101880
|
try {
|
|
101795
|
-
const parsed = JSON.parse(
|
|
101881
|
+
const parsed = JSON.parse(readFileSync17(packageJsonPath, "utf8"));
|
|
101796
101882
|
return parsed.name === "@openscout/scout" || parsed.name === "@openscout/cli";
|
|
101797
101883
|
} catch {
|
|
101798
101884
|
return false;
|
|
@@ -104175,7 +104261,7 @@ function renderMatchCommandHelp() {
|
|
|
104175
104261
|
"The facilitator chooses a memorable codename, gives it to both sessions, and",
|
|
104176
104262
|
"runs `scout match new <codename>`. The other session runs",
|
|
104177
104263
|
"`scout match <codename>`. Codenames match case-insensitively within one project,",
|
|
104178
|
-
"expire after
|
|
104264
|
+
"expire after 4 hours, and match exactly two live sessions. With --message,",
|
|
104179
104265
|
"the creator sends one exact-session message only after the broker confirms the match.",
|
|
104180
104266
|
"",
|
|
104181
104267
|
"Examples:",
|
|
@@ -104428,7 +104514,7 @@ function renderMatchResponse(response) {
|
|
|
104428
104514
|
return `No active match ${response.codename} exists in ${projectName2}. Check the codename or create it with scout match new ${response.codename}.`;
|
|
104429
104515
|
}
|
|
104430
104516
|
if (response.status === "expired") {
|
|
104431
|
-
return `Match ${response.codename} expired in ${projectName2}.
|
|
104517
|
+
return `Match ${response.codename} expired in ${projectName2}. Recreate it with scout match new ${response.codename}.`;
|
|
104432
104518
|
}
|
|
104433
104519
|
if (response.status === "consumed") {
|
|
104434
104520
|
return `Match ${response.codename} was already used in ${projectName2}. Choose another codename.`;
|
|
@@ -107772,7 +107858,7 @@ var init_service6 = __esm(() => {
|
|
|
107772
107858
|
});
|
|
107773
107859
|
|
|
107774
107860
|
// ../../apps/desktop/src/core/mcp/scout-mcp.ts
|
|
107775
|
-
import { readFileSync as
|
|
107861
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
107776
107862
|
import { basename as basename17, resolve as resolve28 } from "path";
|
|
107777
107863
|
function normalizeSearchableAgentState(state, fallback2) {
|
|
107778
107864
|
if (!state || state === "registered") {
|
|
@@ -107832,7 +107918,7 @@ function parseScoutReplyContextFromEnv(env) {
|
|
|
107832
107918
|
const contextFile = env.OPENSCOUT_REPLY_CONTEXT_FILE?.trim();
|
|
107833
107919
|
if (contextFile) {
|
|
107834
107920
|
try {
|
|
107835
|
-
const rawFileJson =
|
|
107921
|
+
const rawFileJson = readFileSync18(contextFile, "utf8").trim();
|
|
107836
107922
|
if (rawFileJson) {
|
|
107837
107923
|
const parsed = JSON.parse(rawFileJson);
|
|
107838
107924
|
if (isScoutReplyContext(parsed)) {
|
|
@@ -108221,7 +108307,17 @@ function sendScoutReplyNotification(server, params) {
|
|
|
108221
108307
|
function scheduleScoutReplyNotification(input) {
|
|
108222
108308
|
(async () => {
|
|
108223
108309
|
try {
|
|
108224
|
-
|
|
108310
|
+
let completedFlight;
|
|
108311
|
+
for (let attempt = 0;; attempt += 1) {
|
|
108312
|
+
try {
|
|
108313
|
+
completedFlight = await input.deps.waitForFlight(input.brokerUrl, input.flight.id);
|
|
108314
|
+
break;
|
|
108315
|
+
} catch (error48) {
|
|
108316
|
+
if (attempt >= 2)
|
|
108317
|
+
throw error48;
|
|
108318
|
+
await new Promise((resolve29) => setTimeout(resolve29, 2000));
|
|
108319
|
+
}
|
|
108320
|
+
}
|
|
108225
108321
|
await sendScoutReplyNotification(input.server, {
|
|
108226
108322
|
...input.context,
|
|
108227
108323
|
status: "completed",
|
|
@@ -108508,15 +108604,14 @@ function buildIdentityCandidate(entry) {
|
|
|
108508
108604
|
aliases
|
|
108509
108605
|
};
|
|
108510
108606
|
}
|
|
108511
|
-
function
|
|
108607
|
+
function buildAgentCandidateDirectory(entries) {
|
|
108512
108608
|
const identityCandidates = entries.map((entry) => buildIdentityCandidate(entry));
|
|
108513
|
-
|
|
108514
|
-
|
|
108515
|
-
const label = formatMinimalAgentIdentity(identityCandidate, identityCandidates);
|
|
108609
|
+
const identityByCandidate = new Map;
|
|
108610
|
+
const candidates = entries.map((entry, index2) => {
|
|
108516
108611
|
const defaultLabel = entry.defaultSelector ? `@${entry.defaultSelector}` : null;
|
|
108517
|
-
|
|
108612
|
+
const candidate = {
|
|
108518
108613
|
agentId: entry.agentId,
|
|
108519
|
-
label
|
|
108614
|
+
label: defaultLabel ?? `@${entry.agentId}`,
|
|
108520
108615
|
defaultLabel,
|
|
108521
108616
|
displayName: entry.displayName,
|
|
108522
108617
|
handle: entry.handle,
|
|
@@ -108533,7 +108628,22 @@ function decorateAgentLabels(entries) {
|
|
|
108533
108628
|
transport: entry.transport,
|
|
108534
108629
|
sessionId: entry.sessionId
|
|
108535
108630
|
};
|
|
108631
|
+
identityByCandidate.set(candidate, identityCandidates[index2]);
|
|
108632
|
+
return candidate;
|
|
108536
108633
|
});
|
|
108634
|
+
return { candidates, identityCandidates, identityByCandidate };
|
|
108635
|
+
}
|
|
108636
|
+
function withMinimalLabel(candidate, directory) {
|
|
108637
|
+
const identity2 = directory.identityByCandidate.get(candidate);
|
|
108638
|
+
if (!identity2)
|
|
108639
|
+
return candidate;
|
|
108640
|
+
return {
|
|
108641
|
+
...candidate,
|
|
108642
|
+
label: formatMinimalAgentIdentity(identity2, directory.identityCandidates)
|
|
108643
|
+
};
|
|
108644
|
+
}
|
|
108645
|
+
function withMinimalLabels(candidates, directory) {
|
|
108646
|
+
return candidates.map((candidate, index2) => index2 < MAX_DECORATED_CANDIDATES ? withMinimalLabel(candidate, directory) : candidate);
|
|
108537
108647
|
}
|
|
108538
108648
|
function isOpenScoutNamedCandidate(candidate) {
|
|
108539
108649
|
const agentIdHead = normalizeSearchValue(candidate.agentId).split(".")[0] ?? "";
|
|
@@ -108713,11 +108823,24 @@ async function loadScoutAgentDirectory(currentDirectory) {
|
|
|
108713
108823
|
});
|
|
108714
108824
|
}
|
|
108715
108825
|
async function searchScoutAgentsForMcp(input) {
|
|
108716
|
-
const
|
|
108826
|
+
const debugTiming = process.env.OPENSCOUT_MCP_DEBUG_TIMING === "1";
|
|
108827
|
+
let mark = performance.now();
|
|
108828
|
+
const lap = (label) => {
|
|
108829
|
+
if (!debugTiming)
|
|
108830
|
+
return;
|
|
108831
|
+
console.error(`searchScoutAgentsForMcp ${label} ${Math.round(performance.now() - mark)}ms`);
|
|
108832
|
+
mark = performance.now();
|
|
108833
|
+
};
|
|
108834
|
+
const entries = await loadScoutAgentDirectory(input.currentDirectory);
|
|
108835
|
+
lap("load");
|
|
108836
|
+
const directory = buildAgentCandidateDirectory(entries);
|
|
108837
|
+
const candidates = directory.candidates;
|
|
108838
|
+
lap("candidates");
|
|
108717
108839
|
const normalizedQuery = normalizeSearchValue(input.query);
|
|
108718
108840
|
const currentProjectRoot = await findNearestProjectRoot(input.currentDirectory) ?? input.currentDirectory;
|
|
108841
|
+
lap("projectRoot");
|
|
108719
108842
|
const limit = Math.max(1, Math.min(input.limit ?? 10, 50));
|
|
108720
|
-
|
|
108843
|
+
const result = candidates.map((candidate) => ({
|
|
108721
108844
|
candidate,
|
|
108722
108845
|
score: scoreAgentCandidate(candidate, normalizedQuery) + Math.max(0, scoreProjectLocalCandidate(candidate, currentProjectRoot, normalizedQuery))
|
|
108723
108846
|
})).filter((entry) => normalizedQuery.length === 0 || entry.score >= 0).sort((left, right) => {
|
|
@@ -108728,7 +108851,9 @@ async function searchScoutAgentsForMcp(input) {
|
|
|
108728
108851
|
if (stateDelta !== 0)
|
|
108729
108852
|
return stateDelta;
|
|
108730
108853
|
return left.candidate.displayName.localeCompare(right.candidate.displayName);
|
|
108731
|
-
}).slice(0, limit).map((entry) => entry.candidate);
|
|
108854
|
+
}).slice(0, limit).map((entry) => withMinimalLabel(entry.candidate, directory));
|
|
108855
|
+
lap("score+sort+decorate");
|
|
108856
|
+
return result;
|
|
108732
108857
|
}
|
|
108733
108858
|
async function resolveScoutAgentForMcp(input) {
|
|
108734
108859
|
const rawLabel = input.label.trim();
|
|
@@ -108736,43 +108861,51 @@ async function resolveScoutAgentForMcp(input) {
|
|
|
108736
108861
|
return { kind: "unresolved", candidate: null, candidates: [] };
|
|
108737
108862
|
}
|
|
108738
108863
|
const entries = await loadScoutAgentDirectory(input.currentDirectory);
|
|
108739
|
-
const
|
|
108864
|
+
const directory = buildAgentCandidateDirectory(entries);
|
|
108865
|
+
const candidates = directory.candidates;
|
|
108740
108866
|
const exactMatches = candidates.filter((candidate) => exactCandidateMatches(candidate, rawLabel));
|
|
108741
108867
|
if (["scout", "openscout"].includes(normalizeSearchValue(rawLabel))) {
|
|
108742
108868
|
const preferredStableScoutCandidate = findPreferredStableScoutCandidate(candidates);
|
|
108743
108869
|
if (preferredStableScoutCandidate) {
|
|
108744
108870
|
return {
|
|
108745
108871
|
kind: "resolved",
|
|
108746
|
-
candidate: preferredStableScoutCandidate,
|
|
108872
|
+
candidate: withMinimalLabel(preferredStableScoutCandidate, directory),
|
|
108747
108873
|
candidates: []
|
|
108748
108874
|
};
|
|
108749
108875
|
}
|
|
108750
108876
|
}
|
|
108751
108877
|
if (exactMatches.length === 1) {
|
|
108752
|
-
return {
|
|
108878
|
+
return {
|
|
108879
|
+
kind: "resolved",
|
|
108880
|
+
candidate: withMinimalLabel(exactMatches[0], directory),
|
|
108881
|
+
candidates: []
|
|
108882
|
+
};
|
|
108753
108883
|
}
|
|
108754
108884
|
const preferredProjectLocalCandidate = await findPreferredProjectLocalCandidate(candidates, rawLabel, input.currentDirectory);
|
|
108755
108885
|
if (preferredProjectLocalCandidate) {
|
|
108756
108886
|
return {
|
|
108757
108887
|
kind: "resolved",
|
|
108758
|
-
candidate: preferredProjectLocalCandidate,
|
|
108888
|
+
candidate: withMinimalLabel(preferredProjectLocalCandidate, directory),
|
|
108759
108889
|
candidates: []
|
|
108760
108890
|
};
|
|
108761
108891
|
}
|
|
108762
108892
|
if (exactMatches.length > 1) {
|
|
108763
|
-
return {
|
|
108893
|
+
return {
|
|
108894
|
+
kind: "ambiguous",
|
|
108895
|
+
candidate: null,
|
|
108896
|
+
candidates: withMinimalLabels(exactMatches, directory)
|
|
108897
|
+
};
|
|
108764
108898
|
}
|
|
108765
108899
|
const selector = parseAgentIdentity(rawLabel.startsWith("@") ? rawLabel : `@${rawLabel}`);
|
|
108766
108900
|
if (!selector) {
|
|
108767
108901
|
return { kind: "unresolved", candidate: null, candidates: [] };
|
|
108768
108902
|
}
|
|
108769
|
-
const
|
|
108770
|
-
const diagnosis = diagnoseAgentIdentity(selector, identityCandidates);
|
|
108903
|
+
const diagnosis = diagnoseAgentIdentity(selector, directory.identityCandidates);
|
|
108771
108904
|
if (diagnosis.kind === "resolved") {
|
|
108772
108905
|
const match = candidates.find((candidate) => candidate.agentId === diagnosis.match.agentId) ?? null;
|
|
108773
108906
|
return {
|
|
108774
108907
|
kind: match ? "resolved" : "unresolved",
|
|
108775
|
-
candidate: match,
|
|
108908
|
+
candidate: match ? withMinimalLabel(match, directory) : null,
|
|
108776
108909
|
candidates: []
|
|
108777
108910
|
};
|
|
108778
108911
|
}
|
|
@@ -108782,11 +108915,15 @@ async function resolveScoutAgentForMcp(input) {
|
|
|
108782
108915
|
if (preferredAmbiguousCandidate) {
|
|
108783
108916
|
return {
|
|
108784
108917
|
kind: "resolved",
|
|
108785
|
-
candidate: preferredAmbiguousCandidate,
|
|
108918
|
+
candidate: withMinimalLabel(preferredAmbiguousCandidate, directory),
|
|
108786
108919
|
candidates: []
|
|
108787
108920
|
};
|
|
108788
108921
|
}
|
|
108789
|
-
return {
|
|
108922
|
+
return {
|
|
108923
|
+
kind: "ambiguous",
|
|
108924
|
+
candidate: null,
|
|
108925
|
+
candidates: withMinimalLabels(ambiguous, directory)
|
|
108926
|
+
};
|
|
108790
108927
|
}
|
|
108791
108928
|
return { kind: "unresolved", candidate: null, candidates: [] };
|
|
108792
108929
|
}
|
|
@@ -109019,6 +109156,15 @@ function createScoutMcpServer(options) {
|
|
|
109019
109156
|
name: "openscout",
|
|
109020
109157
|
version: SCOUT_APP_VERSION
|
|
109021
109158
|
});
|
|
109159
|
+
const toolFilter = options.toolFilter;
|
|
109160
|
+
if (toolFilter) {
|
|
109161
|
+
const registerTool = server.registerTool.bind(server);
|
|
109162
|
+
server.registerTool = (name2, ...rest) => {
|
|
109163
|
+
if (!toolFilter(name2))
|
|
109164
|
+
return;
|
|
109165
|
+
return registerTool(name2, ...rest);
|
|
109166
|
+
};
|
|
109167
|
+
}
|
|
109022
109168
|
const aliasBrokerRequest = async (path, init) => {
|
|
109023
109169
|
const response = await fetch(new URL(path, deps.resolveBrokerUrl()), {
|
|
109024
109170
|
...init,
|
|
@@ -109929,44 +110075,42 @@ function createScoutMcpServer(options) {
|
|
|
109929
110075
|
} catch {}
|
|
109930
110076
|
} else if (resolvedReplyMode === "notify" && replyNotificationsEnabled && structuredContent.ids.flightId) {
|
|
109931
110077
|
const flight = await deps.getFlight(deps.resolveBrokerUrl(), structuredContent.ids.flightId).catch(() => null);
|
|
109932
|
-
|
|
109933
|
-
|
|
109934
|
-
|
|
110078
|
+
const followArtifacts = buildScoutFollowArtifacts({
|
|
110079
|
+
flight,
|
|
110080
|
+
conversationId: structuredContent.ids.conversationId ?? null,
|
|
110081
|
+
workItem: null,
|
|
110082
|
+
targetAgentId: structuredContent.ids.targetAgentId ?? flight?.targetAgentId ?? null
|
|
110083
|
+
}, env);
|
|
110084
|
+
scheduleScoutReplyNotification({
|
|
110085
|
+
server,
|
|
110086
|
+
deps,
|
|
110087
|
+
brokerUrl: deps.resolveBrokerUrl(),
|
|
110088
|
+
flight: flight ?? { id: structuredContent.ids.flightId },
|
|
110089
|
+
context: {
|
|
110090
|
+
currentDirectory: resolvedCurrentDirectory,
|
|
110091
|
+
senderId: resolvedSenderId,
|
|
110092
|
+
targetAgentId: structuredContent.ids.targetAgentId ?? flight?.targetAgentId ?? null,
|
|
110093
|
+
targetLabel: targetTo ?? targetProjectPath ?? null,
|
|
109935
110094
|
conversationId: structuredContent.ids.conversationId ?? null,
|
|
110095
|
+
messageId: structuredContent.ids.messageId ?? null,
|
|
110096
|
+
bindingRef: structuredContent.ids.bindingRef ? `ref:${structuredContent.ids.bindingRef}` : null,
|
|
110097
|
+
flightId: structuredContent.ids.flightId,
|
|
109936
110098
|
workItem: null,
|
|
109937
|
-
|
|
109938
|
-
|
|
109939
|
-
|
|
109940
|
-
|
|
109941
|
-
|
|
109942
|
-
|
|
109943
|
-
|
|
109944
|
-
|
|
109945
|
-
|
|
109946
|
-
|
|
109947
|
-
|
|
109948
|
-
|
|
109949
|
-
|
|
109950
|
-
|
|
109951
|
-
|
|
109952
|
-
flightId: flight.id,
|
|
109953
|
-
workItem: null,
|
|
109954
|
-
workId: structuredContent.ids.workId ?? null,
|
|
109955
|
-
workUrl: null,
|
|
109956
|
-
ids: followArtifacts.ids,
|
|
109957
|
-
links: followArtifacts.links,
|
|
109958
|
-
followUrl: followArtifacts.followUrl
|
|
109959
|
-
}
|
|
109960
|
-
});
|
|
109961
|
-
structuredContent = {
|
|
109962
|
-
...structuredContent,
|
|
109963
|
-
delivery: "mcp_notification",
|
|
109964
|
-
notification: {
|
|
109965
|
-
method: "notifications/scout/reply",
|
|
109966
|
-
status: "scheduled"
|
|
109967
|
-
}
|
|
109968
|
-
};
|
|
109969
|
-
}
|
|
110099
|
+
workId: structuredContent.ids.workId ?? null,
|
|
110100
|
+
workUrl: null,
|
|
110101
|
+
ids: followArtifacts.ids,
|
|
110102
|
+
links: followArtifacts.links,
|
|
110103
|
+
followUrl: followArtifacts.followUrl
|
|
110104
|
+
}
|
|
110105
|
+
});
|
|
110106
|
+
structuredContent = {
|
|
110107
|
+
...structuredContent,
|
|
110108
|
+
delivery: "mcp_notification",
|
|
110109
|
+
notification: {
|
|
110110
|
+
method: "notifications/scout/reply",
|
|
110111
|
+
status: "scheduled"
|
|
110112
|
+
}
|
|
110113
|
+
};
|
|
109970
110114
|
}
|
|
109971
110115
|
if (structuredContent.ok && !structuredContent.delivery) {
|
|
109972
110116
|
structuredContent = {
|
|
@@ -110970,7 +111114,7 @@ async function runScoutMcpServer(options) {
|
|
|
110970
111114
|
await server.connect(transport);
|
|
110971
111115
|
await waitForStdioServerClosure({ server, transport });
|
|
110972
111116
|
}
|
|
110973
|
-
var AGENT_STATE_VALUES, REGISTRATION_KIND_VALUES, RESOLVE_KIND_VALUES, MESSAGE_ROUTE_KIND_VALUES, MESSAGE_ROUTING_ERROR_VALUES, REPLY_MODE_VALUES, REPLY_DELIVERY_VALUES, LOCAL_AGENT_HARNESS_VALUES, TAIL_EVENT_KIND_VALUES, DEFAULT_ASK_ACK_TIMEOUT_SECONDS2 = 30, SCOUT_MCP_UI_META_KEY = "openscout/ui", scoutAgentNameInputSchema, scoutAgentToolIconMeta, scoutAgentAvatarMeta, targetLabelInputSchema, targetAgentIdInputSchema, targetSessionIdInputSchema, projectPathInputSchema, mentionAgentIdsInputSchema, attachmentsInputSchema, flightSchema, invocationLifecycleSchema, labelBriefFlightSchema, labelBriefWorkItemSchema, labelBriefSchema, labelFeedEventSchema, labelFeedSchema, trackedWorkItemSchema, workItemInputSchema, waitingOnSchema, progressSchema, workItemUpdateSchema, agentCandidateSchema, scoutReturnAddressSchema, scoutAgentCardLifecycleSchema, scoutAgentCardSchema, localAgentStatusSchema, whoAmISchema, brokerMessageSchema, messagesInboxResultSchema, messagesChannelResultSchema, brokerFeedRecordSchema, brokerFeedItemSchema, brokerFeedSchema, tailEventSchema, tailEventsResultSchema, searchResultSchema, resolveResultSchema, startSuggestionSchema, followIdsSchema, followLinksSchema, sendRoutingAdviceSchema, sendResultSchema, operatorSignalResultSchema, nonBlankToolStringSchema, replyContextSchema, currentReplyContextResultSchema, replyResultSchema, cardCreateResultSchema, agentStartResultSchema, currentSessionAttachResultSchema, askResultSchema, askReceiptSchema, invocationLookupResultSchema, workUpdateResultSchema;
|
|
111117
|
+
var AGENT_STATE_VALUES, REGISTRATION_KIND_VALUES, RESOLVE_KIND_VALUES, MESSAGE_ROUTE_KIND_VALUES, MESSAGE_ROUTING_ERROR_VALUES, REPLY_MODE_VALUES, REPLY_DELIVERY_VALUES, LOCAL_AGENT_HARNESS_VALUES, TAIL_EVENT_KIND_VALUES, DEFAULT_ASK_ACK_TIMEOUT_SECONDS2 = 30, SCOUT_MCP_UI_META_KEY = "openscout/ui", scoutAgentNameInputSchema, scoutAgentToolIconMeta, scoutAgentAvatarMeta, targetLabelInputSchema, targetAgentIdInputSchema, targetSessionIdInputSchema, projectPathInputSchema, mentionAgentIdsInputSchema, attachmentsInputSchema, flightSchema, invocationLifecycleSchema, labelBriefFlightSchema, labelBriefWorkItemSchema, labelBriefSchema, labelFeedEventSchema, labelFeedSchema, trackedWorkItemSchema, workItemInputSchema, waitingOnSchema, progressSchema, workItemUpdateSchema, agentCandidateSchema, scoutReturnAddressSchema, scoutAgentCardLifecycleSchema, scoutAgentCardSchema, localAgentStatusSchema, whoAmISchema, brokerMessageSchema, messagesInboxResultSchema, messagesChannelResultSchema, brokerFeedRecordSchema, brokerFeedItemSchema, brokerFeedSchema, tailEventSchema, tailEventsResultSchema, searchResultSchema, resolveResultSchema, startSuggestionSchema, followIdsSchema, followLinksSchema, sendRoutingAdviceSchema, sendResultSchema, operatorSignalResultSchema, nonBlankToolStringSchema, replyContextSchema, currentReplyContextResultSchema, replyResultSchema, cardCreateResultSchema, agentStartResultSchema, currentSessionAttachResultSchema, askResultSchema, askReceiptSchema, invocationLookupResultSchema, workUpdateResultSchema, MAX_DECORATED_CANDIDATES = 50;
|
|
110974
111118
|
var init_scout_mcp = __esm(() => {
|
|
110975
111119
|
init_mcp();
|
|
110976
111120
|
init_stdio2();
|
|
@@ -112731,7 +112875,7 @@ async function runMeshPing(target2) {
|
|
|
112731
112875
|
try {
|
|
112732
112876
|
const controller = new AbortController;
|
|
112733
112877
|
const timeout = setTimeout(() => controller.abort(), 3000);
|
|
112734
|
-
const response = await
|
|
112878
|
+
const response = await meshPeerFetch(probeUrl, "/v1/node", {
|
|
112735
112879
|
signal: controller.signal,
|
|
112736
112880
|
headers: { accept: "application/json" }
|
|
112737
112881
|
});
|
|
@@ -112783,6 +112927,7 @@ async function loadMeshNodes() {
|
|
|
112783
112927
|
};
|
|
112784
112928
|
}
|
|
112785
112929
|
var init_service7 = __esm(() => {
|
|
112930
|
+
init_src3();
|
|
112786
112931
|
init_system_probes();
|
|
112787
112932
|
init_service3();
|
|
112788
112933
|
init_trust_service();
|
|
@@ -113107,7 +113252,7 @@ function renderMeshNodes(input) {
|
|
|
113107
113252
|
var init_mesh = () => {};
|
|
113108
113253
|
|
|
113109
113254
|
// ../../apps/desktop/src/core/mesh/enroll-pending.ts
|
|
113110
|
-
import { existsSync as existsSync42, mkdirSync as mkdirSync12, readFileSync as
|
|
113255
|
+
import { existsSync as existsSync42, mkdirSync as mkdirSync12, readFileSync as readFileSync19, rmSync as rmSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
113111
113256
|
import { dirname as dirname29, join as join51 } from "path";
|
|
113112
113257
|
function pendingMeshEnrollmentPath(supportDirectory) {
|
|
113113
113258
|
const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
|
|
@@ -113129,7 +113274,7 @@ function loadPendingMeshEnrollment(supportDirectory) {
|
|
|
113129
113274
|
}
|
|
113130
113275
|
let parsed;
|
|
113131
113276
|
try {
|
|
113132
|
-
parsed = JSON.parse(
|
|
113277
|
+
parsed = JSON.parse(readFileSync19(path, "utf8"));
|
|
113133
113278
|
} catch {
|
|
113134
113279
|
throw new Error(`Corrupt pending mesh enrollment at ${path}; remove it and start over.`);
|
|
113135
113280
|
}
|
|
@@ -113151,7 +113296,7 @@ var init_enroll_pending = __esm(() => {
|
|
|
113151
113296
|
|
|
113152
113297
|
// ../../apps/desktop/src/cli/commands/mesh-trust.ts
|
|
113153
113298
|
import { createInterface as createInterface3 } from "readline";
|
|
113154
|
-
import { readFileSync as
|
|
113299
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
113155
113300
|
function normalizeMeshKeyIdInput(value) {
|
|
113156
113301
|
const trimmed = value.trim().toLowerCase();
|
|
113157
113302
|
if (!KEY_ID_PATTERN.test(trimmed)) {
|
|
@@ -113497,9 +113642,9 @@ function parseMeshTrustInstallGrantArgs(args) {
|
|
|
113497
113642
|
}
|
|
113498
113643
|
function readCardSource(source) {
|
|
113499
113644
|
if (source === "-") {
|
|
113500
|
-
return
|
|
113645
|
+
return readFileSync20(0, "utf8");
|
|
113501
113646
|
}
|
|
113502
|
-
return
|
|
113647
|
+
return readFileSync20(source, "utf8");
|
|
113503
113648
|
}
|
|
113504
113649
|
function parseCardPayload(text3) {
|
|
113505
113650
|
const trimmed = text3.trim();
|
|
@@ -113575,6 +113720,551 @@ var init_mesh_trust = __esm(() => {
|
|
|
113575
113720
|
FINGERPRINT_PATTERN = /^osc1:[0-9a-z]{4}-[0-9a-z]{4}$/;
|
|
113576
113721
|
});
|
|
113577
113722
|
|
|
113723
|
+
// ../../apps/desktop/src/core/mcp/mesh-bridge.ts
|
|
113724
|
+
function parseBridgeBoundEnvelope(data) {
|
|
113725
|
+
if (typeof data !== "string")
|
|
113726
|
+
return null;
|
|
113727
|
+
try {
|
|
113728
|
+
const parsed = JSON.parse(data);
|
|
113729
|
+
if (parsed.v !== 1 || typeof parsed.id !== "string")
|
|
113730
|
+
return null;
|
|
113731
|
+
if (parsed.kind !== "mcp_request" && parsed.kind !== "mcp_cancel")
|
|
113732
|
+
return null;
|
|
113733
|
+
return {
|
|
113734
|
+
v: 1,
|
|
113735
|
+
kind: parsed.kind,
|
|
113736
|
+
id: parsed.id,
|
|
113737
|
+
agent: typeof parsed.agent === "string" ? parsed.agent : undefined,
|
|
113738
|
+
payload: typeof parsed.payload === "string" ? parsed.payload : undefined
|
|
113739
|
+
};
|
|
113740
|
+
} catch {
|
|
113741
|
+
return null;
|
|
113742
|
+
}
|
|
113743
|
+
}
|
|
113744
|
+
|
|
113745
|
+
class MeshRelayServerTransport {
|
|
113746
|
+
onclose;
|
|
113747
|
+
onerror;
|
|
113748
|
+
onmessage;
|
|
113749
|
+
emitEnvelope = () => {};
|
|
113750
|
+
envelopeIdByRequestId = new Map;
|
|
113751
|
+
bindEmitter(emit) {
|
|
113752
|
+
this.emitEnvelope = emit;
|
|
113753
|
+
}
|
|
113754
|
+
async start() {}
|
|
113755
|
+
deliver(envelope) {
|
|
113756
|
+
if (envelope.kind === "mcp_cancel") {
|
|
113757
|
+
for (const [requestId, envelopeId] of this.envelopeIdByRequestId) {
|
|
113758
|
+
if (envelopeId === envelope.id) {
|
|
113759
|
+
this.envelopeIdByRequestId.delete(requestId);
|
|
113760
|
+
}
|
|
113761
|
+
}
|
|
113762
|
+
return;
|
|
113763
|
+
}
|
|
113764
|
+
if (!envelope.payload) {
|
|
113765
|
+
this.emitEnvelope({ v: 1, kind: "mcp_error", id: envelope.id, status: 400, message: "empty payload" });
|
|
113766
|
+
return;
|
|
113767
|
+
}
|
|
113768
|
+
let message;
|
|
113769
|
+
try {
|
|
113770
|
+
message = JSON.parse(envelope.payload);
|
|
113771
|
+
} catch {
|
|
113772
|
+
this.emitEnvelope({ v: 1, kind: "mcp_error", id: envelope.id, status: 400, message: "invalid JSON-RPC payload" });
|
|
113773
|
+
return;
|
|
113774
|
+
}
|
|
113775
|
+
const record4 = message;
|
|
113776
|
+
const isRequest2 = record4.method !== undefined && record4.id !== undefined;
|
|
113777
|
+
if (isRequest2 && record4.id !== undefined) {
|
|
113778
|
+
this.envelopeIdByRequestId.set(record4.id, envelope.id);
|
|
113779
|
+
} else {
|
|
113780
|
+
this.emitEnvelope({ v: 1, kind: "mcp_accepted", id: envelope.id });
|
|
113781
|
+
}
|
|
113782
|
+
try {
|
|
113783
|
+
this.onmessage?.(message);
|
|
113784
|
+
} catch (error48) {
|
|
113785
|
+
if (isRequest2 && record4.id !== undefined) {
|
|
113786
|
+
this.envelopeIdByRequestId.delete(record4.id);
|
|
113787
|
+
}
|
|
113788
|
+
this.emitEnvelope({
|
|
113789
|
+
v: 1,
|
|
113790
|
+
kind: "mcp_error",
|
|
113791
|
+
id: envelope.id,
|
|
113792
|
+
status: 500,
|
|
113793
|
+
message: error48 instanceof Error ? error48.message : "handler failure"
|
|
113794
|
+
});
|
|
113795
|
+
}
|
|
113796
|
+
}
|
|
113797
|
+
async send(message) {
|
|
113798
|
+
const record4 = message;
|
|
113799
|
+
if (record4.id === undefined) {
|
|
113800
|
+
this.emitEnvelope({
|
|
113801
|
+
v: 1,
|
|
113802
|
+
kind: "mcp_notify",
|
|
113803
|
+
id: crypto.randomUUID(),
|
|
113804
|
+
payload: JSON.stringify(message)
|
|
113805
|
+
});
|
|
113806
|
+
return;
|
|
113807
|
+
}
|
|
113808
|
+
const envelopeId = this.envelopeIdByRequestId.get(record4.id);
|
|
113809
|
+
if (!envelopeId) {
|
|
113810
|
+
if (record4.method !== undefined) {
|
|
113811
|
+
this.onerror?.(new Error(`mesh bridge cannot deliver server-initiated request ${String(record4.method)}`));
|
|
113812
|
+
}
|
|
113813
|
+
return;
|
|
113814
|
+
}
|
|
113815
|
+
this.envelopeIdByRequestId.delete(record4.id);
|
|
113816
|
+
this.emitEnvelope({
|
|
113817
|
+
v: 1,
|
|
113818
|
+
kind: "mcp_response",
|
|
113819
|
+
id: envelopeId,
|
|
113820
|
+
payload: JSON.stringify(message)
|
|
113821
|
+
});
|
|
113822
|
+
}
|
|
113823
|
+
async close() {
|
|
113824
|
+
this.envelopeIdByRequestId.clear();
|
|
113825
|
+
this.onclose?.();
|
|
113826
|
+
}
|
|
113827
|
+
}
|
|
113828
|
+
function readKeychainSecret(service3) {
|
|
113829
|
+
const result = Bun.spawnSync(["security", "find-generic-password", "-s", service3, "-w"]);
|
|
113830
|
+
if (result.exitCode !== 0)
|
|
113831
|
+
return null;
|
|
113832
|
+
const value = result.stdout.toString().trim();
|
|
113833
|
+
return value || null;
|
|
113834
|
+
}
|
|
113835
|
+
function resolveBridgeTokenFromConfig(config2) {
|
|
113836
|
+
if (config2.token?.trim())
|
|
113837
|
+
return config2.token.trim();
|
|
113838
|
+
if (config2.tokenKeychainService?.trim()) {
|
|
113839
|
+
return readKeychainSecret(config2.tokenKeychainService.trim());
|
|
113840
|
+
}
|
|
113841
|
+
return null;
|
|
113842
|
+
}
|
|
113843
|
+
function resolveBridgeWebSocketUrl(relayUrl, token) {
|
|
113844
|
+
const url2 = new URL(relayUrl);
|
|
113845
|
+
if (url2.protocol === "https:")
|
|
113846
|
+
url2.protocol = "wss:";
|
|
113847
|
+
if (url2.protocol === "http:")
|
|
113848
|
+
url2.protocol = "ws:";
|
|
113849
|
+
if (!url2.pathname.endsWith("/bridge")) {
|
|
113850
|
+
url2.pathname = `${url2.pathname.replace(/\/$/, "")}/bridge`;
|
|
113851
|
+
}
|
|
113852
|
+
if (!url2.searchParams.get("access_token")) {
|
|
113853
|
+
url2.searchParams.set("access_token", token);
|
|
113854
|
+
}
|
|
113855
|
+
return url2.toString();
|
|
113856
|
+
}
|
|
113857
|
+
async function startScoutMeshMcpBridge(options) {
|
|
113858
|
+
const log = options.log ?? (() => {});
|
|
113859
|
+
const allowedTools = new Set(options.toolNames);
|
|
113860
|
+
let socket = null;
|
|
113861
|
+
let closed = false;
|
|
113862
|
+
let reconnectTimer = null;
|
|
113863
|
+
let attempt = 0;
|
|
113864
|
+
const sendRaw = (envelope) => {
|
|
113865
|
+
if (socket && socket.readyState === WebSocket.OPEN) {
|
|
113866
|
+
socket.send(JSON.stringify(envelope));
|
|
113867
|
+
} else {
|
|
113868
|
+
log(`bridge: dropped ${envelope.kind} for ${envelope.id} (socket not open)`);
|
|
113869
|
+
}
|
|
113870
|
+
};
|
|
113871
|
+
const instances = new Map;
|
|
113872
|
+
const getOrCreateInstance = async (agent) => {
|
|
113873
|
+
const existing = instances.get(agent);
|
|
113874
|
+
if (existing)
|
|
113875
|
+
return existing;
|
|
113876
|
+
if (instances.size >= MAX_IDENTITY_INSTANCES) {
|
|
113877
|
+
return null;
|
|
113878
|
+
}
|
|
113879
|
+
const transport = new MeshRelayServerTransport;
|
|
113880
|
+
transport.bindEmitter((envelope) => {
|
|
113881
|
+
sendRaw(envelope.kind === "mcp_notify" ? { ...envelope, agent } : envelope);
|
|
113882
|
+
});
|
|
113883
|
+
const server = createScoutMcpServer({
|
|
113884
|
+
defaultCurrentDirectory: options.currentDirectory,
|
|
113885
|
+
env: {
|
|
113886
|
+
...options.env ?? process.env,
|
|
113887
|
+
OPENSCOUT_MCP_ENABLE_NOTIFICATIONS: "1"
|
|
113888
|
+
},
|
|
113889
|
+
dependencies: {
|
|
113890
|
+
resolveSenderId: async () => agent
|
|
113891
|
+
},
|
|
113892
|
+
toolFilter: (name2) => allowedTools.has(name2)
|
|
113893
|
+
});
|
|
113894
|
+
await server.connect(transport);
|
|
113895
|
+
const instance2 = { server, transport };
|
|
113896
|
+
instances.set(agent, instance2);
|
|
113897
|
+
log(`bridge: serving identity ${agent} (${instances.size} active)`);
|
|
113898
|
+
return instance2;
|
|
113899
|
+
};
|
|
113900
|
+
const wsUrl = resolveBridgeWebSocketUrl(options.relayUrl, options.token);
|
|
113901
|
+
const scheduleReconnect = () => {
|
|
113902
|
+
const delay7 = Math.min(RECONNECT_MAX_DELAY_MS, 1000 * 2 ** attempt) + Math.floor(Math.random() * 500);
|
|
113903
|
+
attempt += 1;
|
|
113904
|
+
reconnectTimer = setTimeout(connect, delay7);
|
|
113905
|
+
return delay7;
|
|
113906
|
+
};
|
|
113907
|
+
const connect = () => {
|
|
113908
|
+
if (closed)
|
|
113909
|
+
return;
|
|
113910
|
+
const ws = new WebSocket(wsUrl, {
|
|
113911
|
+
headers: { authorization: `Bearer ${options.token}` }
|
|
113912
|
+
});
|
|
113913
|
+
socket = ws;
|
|
113914
|
+
let lastFrameAt = Date.now();
|
|
113915
|
+
let openedAt = Date.now();
|
|
113916
|
+
let abandoned = false;
|
|
113917
|
+
let pingCount = 0;
|
|
113918
|
+
const forceReconnect = (reason) => {
|
|
113919
|
+
if (closed || abandoned)
|
|
113920
|
+
return;
|
|
113921
|
+
abandoned = true;
|
|
113922
|
+
clearInterval(heartbeat);
|
|
113923
|
+
if (socket === ws)
|
|
113924
|
+
socket = null;
|
|
113925
|
+
try {
|
|
113926
|
+
ws.close(4002, "bridge reconnect");
|
|
113927
|
+
} catch {}
|
|
113928
|
+
const delay7 = scheduleReconnect();
|
|
113929
|
+
log(`bridge: ${reason}; reconnecting in ${Math.round(delay7 / 1000)}s`);
|
|
113930
|
+
};
|
|
113931
|
+
const heartbeat = setInterval(() => {
|
|
113932
|
+
if (closed || abandoned || socket !== ws) {
|
|
113933
|
+
clearInterval(heartbeat);
|
|
113934
|
+
return;
|
|
113935
|
+
}
|
|
113936
|
+
if (Date.now() - lastFrameAt > BRIDGE_STALE_MS) {
|
|
113937
|
+
forceReconnect(`relay silent for ${Math.round(BRIDGE_STALE_MS / 1000)}s`);
|
|
113938
|
+
return;
|
|
113939
|
+
}
|
|
113940
|
+
if (ws.readyState !== WebSocket.OPEN)
|
|
113941
|
+
return;
|
|
113942
|
+
ws.send('{"v":1,"kind":"bridge_ping","id":"hb"}');
|
|
113943
|
+
pingCount += 1;
|
|
113944
|
+
if (pingCount % 3 === 0 && Date.now() - openedAt > 45000) {
|
|
113945
|
+
fetch(`${new URL(options.relayUrl).origin}/healthz`, {
|
|
113946
|
+
headers: { authorization: `Bearer ${options.token}` }
|
|
113947
|
+
}).then(async (res) => {
|
|
113948
|
+
if (!res.ok || closed || abandoned || socket !== ws)
|
|
113949
|
+
return;
|
|
113950
|
+
const health = await res.json();
|
|
113951
|
+
if (health.bridgeConnected === false) {
|
|
113952
|
+
forceReconnect("relay no longer routes to this bridge socket");
|
|
113953
|
+
}
|
|
113954
|
+
}).catch(() => {});
|
|
113955
|
+
}
|
|
113956
|
+
}, BRIDGE_PING_INTERVAL_MS);
|
|
113957
|
+
ws.addEventListener("open", () => {
|
|
113958
|
+
attempt = 0;
|
|
113959
|
+
lastFrameAt = Date.now();
|
|
113960
|
+
openedAt = Date.now();
|
|
113961
|
+
log(`bridge: connected to relay (tools: ${options.toolNames.join(", ")}; fallback identity ${options.senderId})`);
|
|
113962
|
+
});
|
|
113963
|
+
ws.addEventListener("message", (event) => {
|
|
113964
|
+
lastFrameAt = Date.now();
|
|
113965
|
+
const envelope = parseBridgeBoundEnvelope(typeof event.data === "string" ? event.data : "");
|
|
113966
|
+
if (!envelope)
|
|
113967
|
+
return;
|
|
113968
|
+
const agent = envelope.agent?.trim() || options.senderId;
|
|
113969
|
+
getOrCreateInstance(agent).then((instance2) => {
|
|
113970
|
+
if (!instance2) {
|
|
113971
|
+
if (envelope.kind === "mcp_request") {
|
|
113972
|
+
sendRaw({
|
|
113973
|
+
v: 1,
|
|
113974
|
+
kind: "mcp_error",
|
|
113975
|
+
id: envelope.id,
|
|
113976
|
+
status: 503,
|
|
113977
|
+
message: "bridge identity capacity reached"
|
|
113978
|
+
});
|
|
113979
|
+
}
|
|
113980
|
+
return;
|
|
113981
|
+
}
|
|
113982
|
+
instance2.transport.deliver(envelope);
|
|
113983
|
+
}).catch((error48) => {
|
|
113984
|
+
if (envelope.kind === "mcp_request") {
|
|
113985
|
+
sendRaw({
|
|
113986
|
+
v: 1,
|
|
113987
|
+
kind: "mcp_error",
|
|
113988
|
+
id: envelope.id,
|
|
113989
|
+
status: 500,
|
|
113990
|
+
message: error48 instanceof Error ? error48.message : "instance failure"
|
|
113991
|
+
});
|
|
113992
|
+
}
|
|
113993
|
+
});
|
|
113994
|
+
});
|
|
113995
|
+
ws.addEventListener("close", (event) => {
|
|
113996
|
+
clearInterval(heartbeat);
|
|
113997
|
+
if (abandoned || socket !== ws)
|
|
113998
|
+
return;
|
|
113999
|
+
socket = null;
|
|
114000
|
+
if (closed)
|
|
114001
|
+
return;
|
|
114002
|
+
const delay7 = scheduleReconnect();
|
|
114003
|
+
log(`bridge: relay connection closed (${event.code}); reconnecting in ${Math.round(delay7 / 1000)}s`);
|
|
114004
|
+
});
|
|
114005
|
+
ws.addEventListener("error", () => {});
|
|
114006
|
+
};
|
|
114007
|
+
connect();
|
|
114008
|
+
return {
|
|
114009
|
+
close: async () => {
|
|
114010
|
+
closed = true;
|
|
114011
|
+
if (reconnectTimer)
|
|
114012
|
+
clearTimeout(reconnectTimer);
|
|
114013
|
+
socket?.close(1000, "bridge shutting down");
|
|
114014
|
+
socket = null;
|
|
114015
|
+
for (const [, instance2] of instances) {
|
|
114016
|
+
await instance2.server.close().catch(() => {});
|
|
114017
|
+
}
|
|
114018
|
+
instances.clear();
|
|
114019
|
+
}
|
|
114020
|
+
};
|
|
114021
|
+
}
|
|
114022
|
+
var SCOUT_MCP_CORE_TOOLS, RECONNECT_MAX_DELAY_MS = 30000, MAX_IDENTITY_INSTANCES = 16, BRIDGE_PING_INTERVAL_MS = 20000, BRIDGE_STALE_MS = 60000;
|
|
114023
|
+
var init_mesh_bridge = __esm(() => {
|
|
114024
|
+
init_scout_mcp();
|
|
114025
|
+
SCOUT_MCP_CORE_TOOLS = [
|
|
114026
|
+
"whoami",
|
|
114027
|
+
"ask",
|
|
114028
|
+
"messages_send",
|
|
114029
|
+
"messages_reply",
|
|
114030
|
+
"messages_inbox",
|
|
114031
|
+
"messages_channel",
|
|
114032
|
+
"broker_feed",
|
|
114033
|
+
"tail_events",
|
|
114034
|
+
"work_update",
|
|
114035
|
+
"notify_operator",
|
|
114036
|
+
"consult_operator",
|
|
114037
|
+
"current_reply_context",
|
|
114038
|
+
"invocations_get",
|
|
114039
|
+
"invocations_wait",
|
|
114040
|
+
"labels_brief",
|
|
114041
|
+
"labels_feed",
|
|
114042
|
+
"agents_search",
|
|
114043
|
+
"agents_resolve"
|
|
114044
|
+
];
|
|
114045
|
+
});
|
|
114046
|
+
|
|
114047
|
+
// ../../apps/desktop/src/cli/commands/mesh-bridge.ts
|
|
114048
|
+
var exports_mesh_bridge = {};
|
|
114049
|
+
__export(exports_mesh_bridge, {
|
|
114050
|
+
runMeshBridgeCommand: () => runMeshBridgeCommand
|
|
114051
|
+
});
|
|
114052
|
+
import { existsSync as existsSync43, mkdirSync as mkdirSync13, readFileSync as readFileSync21, unlinkSync, writeFileSync as writeFileSync11, chmodSync as chmodSync2 } from "fs";
|
|
114053
|
+
import { homedir as homedir33 } from "os";
|
|
114054
|
+
import { join as join52 } from "path";
|
|
114055
|
+
function supportDirectory() {
|
|
114056
|
+
return join52(homedir33(), "Library", "Application Support", "OpenScout");
|
|
114057
|
+
}
|
|
114058
|
+
function defaultConfigPath() {
|
|
114059
|
+
return join52(supportDirectory(), "mcp-bridge.json");
|
|
114060
|
+
}
|
|
114061
|
+
function launchAgentPlistPath2() {
|
|
114062
|
+
return join52(homedir33(), "Library", "LaunchAgents", `${LAUNCH_AGENT_LABEL}.plist`);
|
|
114063
|
+
}
|
|
114064
|
+
function readFlag(args, name2) {
|
|
114065
|
+
const index2 = args.indexOf(name2);
|
|
114066
|
+
if (index2 === -1)
|
|
114067
|
+
return;
|
|
114068
|
+
return args[index2 + 1]?.trim() || undefined;
|
|
114069
|
+
}
|
|
114070
|
+
function loadConfigFile(path) {
|
|
114071
|
+
if (!existsSync43(path))
|
|
114072
|
+
return null;
|
|
114073
|
+
return JSON.parse(readFileSync21(path, "utf8"));
|
|
114074
|
+
}
|
|
114075
|
+
function resolveRunOptions(context, args) {
|
|
114076
|
+
const configPath = readFlag(args, "--config") ?? defaultConfigPath();
|
|
114077
|
+
const fromFile = loadConfigFile(configPath) ?? { relayUrl: "https://mcp.oscout.net" };
|
|
114078
|
+
const config2 = {
|
|
114079
|
+
relayUrl: readFlag(args, "--relay") ?? fromFile.relayUrl ?? "https://mcp.oscout.net",
|
|
114080
|
+
token: readFlag(args, "--token") ?? fromFile.token,
|
|
114081
|
+
tokenKeychainService: readFlag(args, "--token-keychain") ?? fromFile.tokenKeychainService ?? (readFlag(args, "--token") || fromFile.token ? undefined : "OPENSCOUT_MCP_BRIDGE_TOKEN"),
|
|
114082
|
+
sender: readFlag(args, "--sender") ?? fromFile.sender ?? "grokbot.spike",
|
|
114083
|
+
node: readFlag(args, "--node") ?? fromFile.node ?? "default",
|
|
114084
|
+
tools: (() => {
|
|
114085
|
+
const flag = readFlag(args, "--tools");
|
|
114086
|
+
if (!flag)
|
|
114087
|
+
return fromFile.tools ?? "core";
|
|
114088
|
+
return flag === "core" ? "core" : flag.split(",").map((name2) => name2.trim()).filter(Boolean);
|
|
114089
|
+
})(),
|
|
114090
|
+
dir: readFlag(args, "--dir") ?? fromFile.dir
|
|
114091
|
+
};
|
|
114092
|
+
if (!config2.relayUrl) {
|
|
114093
|
+
return { error: "Missing relay URL: pass --relay or set relayUrl in the config file." };
|
|
114094
|
+
}
|
|
114095
|
+
return { config: config2, configPath };
|
|
114096
|
+
}
|
|
114097
|
+
async function runBridge(context, args) {
|
|
114098
|
+
const resolved = resolveRunOptions(context, args);
|
|
114099
|
+
if ("error" in resolved) {
|
|
114100
|
+
context.stderr(resolved.error);
|
|
114101
|
+
process.exitCode = 1;
|
|
114102
|
+
return;
|
|
114103
|
+
}
|
|
114104
|
+
const { config: config2 } = resolved;
|
|
114105
|
+
const token = resolveBridgeTokenFromConfig(config2) ?? context.env.OPENSCOUT_MCP_RELAY_TOKEN?.trim() ?? context.env.OPENSCOUT_MESH_RENDEZVOUS_TOKEN?.trim();
|
|
114106
|
+
if (!token) {
|
|
114107
|
+
context.stderr("No relay token found (flag, config, keychain, or env). See: scout mesh bridge --help");
|
|
114108
|
+
process.exitCode = 1;
|
|
114109
|
+
return;
|
|
114110
|
+
}
|
|
114111
|
+
const relayUrl = new URL(config2.relayUrl);
|
|
114112
|
+
if (config2.node && !relayUrl.searchParams.get("node")) {
|
|
114113
|
+
relayUrl.searchParams.set("node", config2.node);
|
|
114114
|
+
}
|
|
114115
|
+
const toolNames = config2.tools === "core" || !config2.tools ? [...SCOUT_MCP_CORE_TOOLS] : config2.tools;
|
|
114116
|
+
const handle = await startScoutMeshMcpBridge({
|
|
114117
|
+
relayUrl: relayUrl.toString(),
|
|
114118
|
+
token,
|
|
114119
|
+
senderId: config2.sender ?? "grokbot.spike",
|
|
114120
|
+
currentDirectory: config2.dir ?? defaultScoutContextDirectory(context),
|
|
114121
|
+
toolNames,
|
|
114122
|
+
env: context.env,
|
|
114123
|
+
log: (line) => context.stderr(line)
|
|
114124
|
+
});
|
|
114125
|
+
context.stderr(`bridge: node=${config2.node} relay=${config2.relayUrl}`);
|
|
114126
|
+
context.stderr("bridge: running \u2014 Ctrl-C to stop");
|
|
114127
|
+
await new Promise((resolve31) => {
|
|
114128
|
+
const stop2 = () => {
|
|
114129
|
+
const force = setTimeout(() => process.exit(0), 5000);
|
|
114130
|
+
handle.close().finally(() => {
|
|
114131
|
+
clearTimeout(force);
|
|
114132
|
+
resolve31();
|
|
114133
|
+
});
|
|
114134
|
+
};
|
|
114135
|
+
process.once("SIGINT", stop2);
|
|
114136
|
+
process.once("SIGTERM", stop2);
|
|
114137
|
+
});
|
|
114138
|
+
process.exit(process.exitCode ?? 0);
|
|
114139
|
+
}
|
|
114140
|
+
function launchctl(context, args) {
|
|
114141
|
+
const result = Bun.spawnSync(["launchctl", ...args]);
|
|
114142
|
+
const output = `${result.stdout.toString()}${result.stderr.toString()}`.trim();
|
|
114143
|
+
return { ok: result.exitCode === 0, output };
|
|
114144
|
+
}
|
|
114145
|
+
async function installBridge(context, args) {
|
|
114146
|
+
const resolved = resolveRunOptions(context, args);
|
|
114147
|
+
if ("error" in resolved) {
|
|
114148
|
+
context.stderr(resolved.error);
|
|
114149
|
+
process.exitCode = 1;
|
|
114150
|
+
return;
|
|
114151
|
+
}
|
|
114152
|
+
const { config: config2, configPath } = resolved;
|
|
114153
|
+
if (!resolveBridgeTokenFromConfig(config2)) {
|
|
114154
|
+
context.stderr(`No token reachable at install time (keychain service: ${config2.tokenKeychainService ?? "none"}). ` + "Add it first: security add-generic-password -a openscout -s OPENSCOUT_MCP_BRIDGE_TOKEN -w <token>");
|
|
114155
|
+
process.exitCode = 1;
|
|
114156
|
+
return;
|
|
114157
|
+
}
|
|
114158
|
+
mkdirSync13(supportDirectory(), { recursive: true });
|
|
114159
|
+
writeFileSync11(configPath, `${JSON.stringify(config2, null, 2)}
|
|
114160
|
+
`);
|
|
114161
|
+
chmodSync2(configPath, 384);
|
|
114162
|
+
const logDirectory = join52(supportDirectory(), "logs");
|
|
114163
|
+
mkdirSync13(logDirectory, { recursive: true });
|
|
114164
|
+
const logPath = join52(logDirectory, "mcp-bridge.log");
|
|
114165
|
+
const entry = Bun.main;
|
|
114166
|
+
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
114167
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
114168
|
+
<plist version="1.0">
|
|
114169
|
+
<dict>
|
|
114170
|
+
<key>Label</key><string>${LAUNCH_AGENT_LABEL}</string>
|
|
114171
|
+
<key>ProgramArguments</key>
|
|
114172
|
+
<array>
|
|
114173
|
+
<string>${process.execPath}</string>
|
|
114174
|
+
<string>${entry}</string>
|
|
114175
|
+
<string>mesh</string>
|
|
114176
|
+
<string>bridge</string>
|
|
114177
|
+
<string>--config</string>
|
|
114178
|
+
<string>${configPath}</string>
|
|
114179
|
+
</array>
|
|
114180
|
+
<key>RunAtLoad</key><true/>
|
|
114181
|
+
<key>KeepAlive</key><true/>
|
|
114182
|
+
<key>StandardOutPath</key><string>${logPath}</string>
|
|
114183
|
+
<key>StandardErrorPath</key><string>${logPath}</string>
|
|
114184
|
+
</dict>
|
|
114185
|
+
</plist>
|
|
114186
|
+
`;
|
|
114187
|
+
writeFileSync11(launchAgentPlistPath2(), plist);
|
|
114188
|
+
const domain2 = `gui/${process.getuid?.() ?? 501}`;
|
|
114189
|
+
launchctl(context, ["bootout", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
|
|
114190
|
+
const bootstrap = launchctl(context, ["bootstrap", domain2, launchAgentPlistPath2()]);
|
|
114191
|
+
if (!bootstrap.ok) {
|
|
114192
|
+
context.stderr(`launchctl bootstrap failed: ${bootstrap.output}`);
|
|
114193
|
+
process.exitCode = 1;
|
|
114194
|
+
return;
|
|
114195
|
+
}
|
|
114196
|
+
context.stdout(`Installed ${LAUNCH_AGENT_LABEL}`);
|
|
114197
|
+
context.stdout(` config: ${configPath}`);
|
|
114198
|
+
context.stdout(` logs: ${logPath}`);
|
|
114199
|
+
context.stdout(` runner: ${process.execPath} ${entry}`);
|
|
114200
|
+
}
|
|
114201
|
+
async function uninstallBridge(context) {
|
|
114202
|
+
const domain2 = `gui/${process.getuid?.() ?? 501}`;
|
|
114203
|
+
launchctl(context, ["bootout", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
|
|
114204
|
+
if (existsSync43(launchAgentPlistPath2())) {
|
|
114205
|
+
unlinkSync(launchAgentPlistPath2());
|
|
114206
|
+
}
|
|
114207
|
+
context.stdout(`Removed ${LAUNCH_AGENT_LABEL} (config file kept).`);
|
|
114208
|
+
}
|
|
114209
|
+
async function bridgeStatus(context) {
|
|
114210
|
+
const domain2 = `gui/${process.getuid?.() ?? 501}`;
|
|
114211
|
+
const result = launchctl(context, ["print", `${domain2}/${LAUNCH_AGENT_LABEL}`]);
|
|
114212
|
+
if (!result.ok) {
|
|
114213
|
+
context.stdout("mcp-bridge service: not installed");
|
|
114214
|
+
return;
|
|
114215
|
+
}
|
|
114216
|
+
const state = result.output.match(/state = (.+)/)?.[1] ?? "unknown";
|
|
114217
|
+
const pid = result.output.match(/pid = (\d+)/)?.[1];
|
|
114218
|
+
context.stdout(`mcp-bridge service: ${state}${pid ? ` (pid ${pid})` : ""}`);
|
|
114219
|
+
context.stdout(` logs: ${join52(supportDirectory(), "logs", "mcp-bridge.log")}`);
|
|
114220
|
+
}
|
|
114221
|
+
async function runMeshBridgeCommand(context, args) {
|
|
114222
|
+
const subcommand = args[0];
|
|
114223
|
+
if (subcommand === "--help" || subcommand === "-h" || subcommand === "help") {
|
|
114224
|
+
context.stdout(MESH_BRIDGE_HELP);
|
|
114225
|
+
return;
|
|
114226
|
+
}
|
|
114227
|
+
if (subcommand === "install") {
|
|
114228
|
+
return installBridge(context, args.slice(1));
|
|
114229
|
+
}
|
|
114230
|
+
if (subcommand === "uninstall") {
|
|
114231
|
+
return uninstallBridge(context);
|
|
114232
|
+
}
|
|
114233
|
+
if (subcommand === "status") {
|
|
114234
|
+
return bridgeStatus(context);
|
|
114235
|
+
}
|
|
114236
|
+
return runBridge(context, args);
|
|
114237
|
+
}
|
|
114238
|
+
var MESH_BRIDGE_HELP = `scout mesh bridge \u2014 Hold the outbound MCP relay connection for this node
|
|
114239
|
+
|
|
114240
|
+
Serves the Scout MCP tool surface to remote MCP clients via a mesh-front-door
|
|
114241
|
+
relay. Caller identity comes from the relay's agent tokens; each identity gets
|
|
114242
|
+
its own pinned server instance. Spec: docs/eng/sco-095-remote-mcp-gateway.md.
|
|
114243
|
+
|
|
114244
|
+
Usage:
|
|
114245
|
+
scout mesh bridge [--config <path>] [options] Run in the foreground
|
|
114246
|
+
scout mesh bridge install [options] Install as a LaunchAgent
|
|
114247
|
+
scout mesh bridge uninstall Remove the LaunchAgent
|
|
114248
|
+
scout mesh bridge status Show service state
|
|
114249
|
+
|
|
114250
|
+
Options (run + install):
|
|
114251
|
+
--relay <url> MCP relay base URL (default: https://mcp.oscout.net)
|
|
114252
|
+
--token <bearer> Relay infra token; prefer --token-keychain
|
|
114253
|
+
--token-keychain <service>
|
|
114254
|
+
Read the token from the macOS keychain (default:
|
|
114255
|
+
OPENSCOUT_MCP_BRIDGE_TOKEN)
|
|
114256
|
+
--sender <id> Fallback identity for tokenless envelopes
|
|
114257
|
+
(default: grokbot.spike)
|
|
114258
|
+
--node <id> Node name in the relay (default: default)
|
|
114259
|
+
--tools <csv> "core" (default) or explicit tool list
|
|
114260
|
+
--dir <path> currentDirectory for tool resolution
|
|
114261
|
+
--config <path> JSON config file; flags override its values
|
|
114262
|
+
`, LAUNCH_AGENT_LABEL = "app.openscout.mcp-bridge";
|
|
114263
|
+
var init_mesh_bridge2 = __esm(() => {
|
|
114264
|
+
init_context();
|
|
114265
|
+
init_mesh_bridge();
|
|
114266
|
+
});
|
|
114267
|
+
|
|
113578
114268
|
// ../../apps/desktop/src/cli/commands/mesh.ts
|
|
113579
114269
|
var exports_mesh = {};
|
|
113580
114270
|
__export(exports_mesh, {
|
|
@@ -113655,6 +114345,11 @@ async function runMeshCommand(context, args) {
|
|
|
113655
114345
|
});
|
|
113656
114346
|
return;
|
|
113657
114347
|
}
|
|
114348
|
+
case "bridge": {
|
|
114349
|
+
const { runMeshBridgeCommand: runMeshBridgeCommand2 } = await Promise.resolve().then(() => (init_mesh_bridge2(), exports_mesh_bridge));
|
|
114350
|
+
await runMeshBridgeCommand2(context, args.slice(1));
|
|
114351
|
+
return;
|
|
114352
|
+
}
|
|
113658
114353
|
case "peers":
|
|
113659
114354
|
await runMeshPeersCommand(context, args.slice(1));
|
|
113660
114355
|
return;
|
|
@@ -113699,6 +114394,9 @@ Presence (docs/proposals/mesh-trust-cone.md \xA711.5):
|
|
|
113699
114394
|
scout mesh bind mesh Same as announce
|
|
113700
114395
|
scout mesh bind local Withdraw mesh announcement (TLS/mDNS stand down)
|
|
113701
114396
|
|
|
114397
|
+
MCP gateway (docs/eng/sco-095-remote-mcp-gateway.md):
|
|
114398
|
+
scout mesh bridge Hold the outbound MCP relay connection (spike harness)
|
|
114399
|
+
|
|
113702
114400
|
Trust cone (docs/proposals/mesh-trust-cone.md):
|
|
113703
114401
|
scout mesh peers List trusted peers
|
|
113704
114402
|
scout mesh grant Adjust a peer's tier
|
|
@@ -113714,11 +114412,11 @@ var init_mesh2 = __esm(() => {
|
|
|
113714
114412
|
});
|
|
113715
114413
|
|
|
113716
114414
|
// ../../apps/desktop/src/core/pairing/runtime/config.ts
|
|
113717
|
-
import { existsSync as
|
|
113718
|
-
import { homedir as
|
|
114415
|
+
import { existsSync as existsSync44, mkdirSync as mkdirSync14, readFileSync as readFileSync22, writeFileSync as writeFileSync12 } from "fs";
|
|
114416
|
+
import { homedir as homedir34 } from "os";
|
|
113719
114417
|
import path from "path";
|
|
113720
114418
|
function pairingPaths() {
|
|
113721
|
-
const rootDir = path.join(
|
|
114419
|
+
const rootDir = path.join(homedir34(), ".scout/pairing");
|
|
113722
114420
|
return {
|
|
113723
114421
|
rootDir,
|
|
113724
114422
|
configPath: path.join(rootDir, "config.json"),
|
|
@@ -113731,11 +114429,11 @@ function pairingPaths() {
|
|
|
113731
114429
|
}
|
|
113732
114430
|
function loadPairingConfig() {
|
|
113733
114431
|
const { configPath } = pairingPaths();
|
|
113734
|
-
if (!
|
|
114432
|
+
if (!existsSync44(configPath)) {
|
|
113735
114433
|
return {};
|
|
113736
114434
|
}
|
|
113737
114435
|
try {
|
|
113738
|
-
const payload = JSON.parse(
|
|
114436
|
+
const payload = JSON.parse(readFileSync22(configPath, "utf8"));
|
|
113739
114437
|
return typeof payload === "object" && payload ? payload : {};
|
|
113740
114438
|
} catch {
|
|
113741
114439
|
return {};
|
|
@@ -115835,17 +116533,17 @@ var init_noise = __esm(() => {
|
|
|
115835
116533
|
});
|
|
115836
116534
|
|
|
115837
116535
|
// ../../apps/desktop/src/core/pairing/runtime/security/identity.ts
|
|
115838
|
-
import { existsSync as
|
|
115839
|
-
import { join as
|
|
115840
|
-
import { homedir as
|
|
116536
|
+
import { existsSync as existsSync45, mkdirSync as mkdirSync15, readFileSync as readFileSync23, writeFileSync as writeFileSync13 } from "fs";
|
|
116537
|
+
import { join as join53 } from "path";
|
|
116538
|
+
import { homedir as homedir35 } from "os";
|
|
115841
116539
|
function loadOrCreateIdentity() {
|
|
115842
|
-
if (
|
|
116540
|
+
if (existsSync45(IDENTITY_FILE)) {
|
|
115843
116541
|
return loadIdentity();
|
|
115844
116542
|
}
|
|
115845
116543
|
return createAndSaveIdentity();
|
|
115846
116544
|
}
|
|
115847
116545
|
function loadIdentity() {
|
|
115848
|
-
const data = JSON.parse(
|
|
116546
|
+
const data = JSON.parse(readFileSync23(IDENTITY_FILE, "utf8"));
|
|
115849
116547
|
return {
|
|
115850
116548
|
publicKey: hexToBytes2(data.publicKey),
|
|
115851
116549
|
privateKey: hexToBytes2(data.privateKey)
|
|
@@ -115853,26 +116551,26 @@ function loadIdentity() {
|
|
|
115853
116551
|
}
|
|
115854
116552
|
function createAndSaveIdentity() {
|
|
115855
116553
|
const keyPair = generateKeyPair();
|
|
115856
|
-
|
|
116554
|
+
mkdirSync15(PAIRING_DIR, { recursive: true });
|
|
115857
116555
|
const data = {
|
|
115858
116556
|
publicKey: bytesToHex2(keyPair.publicKey),
|
|
115859
116557
|
privateKey: bytesToHex2(keyPair.privateKey),
|
|
115860
116558
|
createdAt: new Date().toISOString()
|
|
115861
116559
|
};
|
|
115862
|
-
|
|
116560
|
+
writeFileSync13(IDENTITY_FILE, JSON.stringify(data, null, 2), { mode: 384 });
|
|
115863
116561
|
return keyPair;
|
|
115864
116562
|
}
|
|
115865
116563
|
function loadTrustedPeers() {
|
|
115866
|
-
if (!
|
|
116564
|
+
if (!existsSync45(TRUSTED_PEERS_FILE))
|
|
115867
116565
|
return new Map;
|
|
115868
|
-
const data = JSON.parse(
|
|
116566
|
+
const data = JSON.parse(readFileSync23(TRUSTED_PEERS_FILE, "utf8"));
|
|
115869
116567
|
return new Map(data.map((p) => [p.publicKey, p]));
|
|
115870
116568
|
}
|
|
115871
116569
|
function saveTrustedPeer(peer) {
|
|
115872
116570
|
const peers = loadTrustedPeers();
|
|
115873
116571
|
peers.set(peer.publicKey, peer);
|
|
115874
|
-
|
|
115875
|
-
|
|
116572
|
+
mkdirSync15(PAIRING_DIR, { recursive: true });
|
|
116573
|
+
writeFileSync13(TRUSTED_PEERS_FILE, JSON.stringify([...peers.values()], null, 2), { mode: 384 });
|
|
115876
116574
|
}
|
|
115877
116575
|
function isTrustedPeer(publicKeyHex) {
|
|
115878
116576
|
return loadTrustedPeers().has(publicKeyHex);
|
|
@@ -115914,9 +116612,9 @@ function hexToBytes2(hex4) {
|
|
|
115914
116612
|
var PAIRING_DIR, IDENTITY_FILE, TRUSTED_PEERS_FILE, QR_VERSION = 1, QR_EXPIRY_MS;
|
|
115915
116613
|
var init_identity = __esm(() => {
|
|
115916
116614
|
init_noise();
|
|
115917
|
-
PAIRING_DIR =
|
|
115918
|
-
IDENTITY_FILE =
|
|
115919
|
-
TRUSTED_PEERS_FILE =
|
|
116615
|
+
PAIRING_DIR = join53(homedir35(), ".scout/pairing");
|
|
116616
|
+
IDENTITY_FILE = join53(PAIRING_DIR, "identity.json");
|
|
116617
|
+
TRUSTED_PEERS_FILE = join53(PAIRING_DIR, "trusted-peers.json");
|
|
115920
116618
|
QR_EXPIRY_MS = 5 * 60 * 1000;
|
|
115921
116619
|
});
|
|
115922
116620
|
|
|
@@ -116077,14 +116775,14 @@ var init_security2 = __esm(() => {
|
|
|
116077
116775
|
});
|
|
116078
116776
|
|
|
116079
116777
|
// ../../apps/desktop/src/core/pairing/runtime/runtime-state.ts
|
|
116080
|
-
import { existsSync as
|
|
116778
|
+
import { existsSync as existsSync46, mkdirSync as mkdirSync16, readFileSync as readFileSync24, renameSync as renameSync5, unlinkSync as unlinkSync2, writeFileSync as writeFileSync14 } from "fs";
|
|
116081
116779
|
function readPairingRuntimeSnapshot() {
|
|
116082
116780
|
const { runtimeStatePath } = pairingPaths();
|
|
116083
|
-
if (!
|
|
116781
|
+
if (!existsSync46(runtimeStatePath)) {
|
|
116084
116782
|
return null;
|
|
116085
116783
|
}
|
|
116086
116784
|
try {
|
|
116087
|
-
const parsed = JSON.parse(
|
|
116785
|
+
const parsed = JSON.parse(readFileSync24(runtimeStatePath, "utf8"));
|
|
116088
116786
|
return parsed?.version === 1 ? { ...parsed, lanDiscoveryAdvertised: parsed.lanDiscoveryAdvertised === true } : null;
|
|
116089
116787
|
} catch {
|
|
116090
116788
|
return null;
|
|
@@ -116107,9 +116805,9 @@ var init_runtime_state = __esm(() => {
|
|
|
116107
116805
|
});
|
|
116108
116806
|
|
|
116109
116807
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/log.ts
|
|
116110
|
-
import { appendFileSync, mkdirSync as
|
|
116111
|
-
import { join as
|
|
116112
|
-
import { homedir as
|
|
116808
|
+
import { appendFileSync, mkdirSync as mkdirSync17 } from "fs";
|
|
116809
|
+
import { join as join54 } from "path";
|
|
116810
|
+
import { homedir as homedir36 } from "os";
|
|
116113
116811
|
function write(level, category, message, data) {
|
|
116114
116812
|
const ts = new Date().toISOString().slice(11, 23);
|
|
116115
116813
|
const lvl = level.toUpperCase().padEnd(5);
|
|
@@ -116125,9 +116823,9 @@ function write(level, category, message, data) {
|
|
|
116125
116823
|
}
|
|
116126
116824
|
var LOG_DIR, LOG_FILE, log;
|
|
116127
116825
|
var init_log = __esm(() => {
|
|
116128
|
-
LOG_DIR =
|
|
116129
|
-
LOG_FILE =
|
|
116130
|
-
|
|
116826
|
+
LOG_DIR = join54(homedir36(), ".scout/pairing");
|
|
116827
|
+
LOG_FILE = join54(LOG_DIR, "bridge.log");
|
|
116828
|
+
mkdirSync17(LOG_DIR, { recursive: true });
|
|
116131
116829
|
log = {
|
|
116132
116830
|
debug: (cat, msg, data) => write("debug", cat, msg, data),
|
|
116133
116831
|
info: (cat, msg, data) => write("info", cat, msg, data),
|
|
@@ -116202,15 +116900,15 @@ var init_bridge = __esm(() => {
|
|
|
116202
116900
|
});
|
|
116203
116901
|
|
|
116204
116902
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/config.ts
|
|
116205
|
-
import { existsSync as
|
|
116206
|
-
import { join as
|
|
116207
|
-
import { homedir as
|
|
116208
|
-
function
|
|
116209
|
-
if (!
|
|
116903
|
+
import { existsSync as existsSync47, readFileSync as readFileSync25 } from "fs";
|
|
116904
|
+
import { join as join55 } from "path";
|
|
116905
|
+
import { homedir as homedir37 } from "os";
|
|
116906
|
+
function loadConfigFile2() {
|
|
116907
|
+
if (!existsSync47(CONFIG_FILE)) {
|
|
116210
116908
|
return {};
|
|
116211
116909
|
}
|
|
116212
116910
|
try {
|
|
116213
|
-
const raw =
|
|
116911
|
+
const raw = readFileSync25(CONFIG_FILE, "utf8");
|
|
116214
116912
|
const parsed = JSON.parse(raw);
|
|
116215
116913
|
return parsed;
|
|
116216
116914
|
} catch (err) {
|
|
@@ -116269,7 +116967,7 @@ function isValidPort3(value) {
|
|
|
116269
116967
|
return typeof value === "number" && Number.isInteger(value) && value > 0 && value < 65536;
|
|
116270
116968
|
}
|
|
116271
116969
|
function resolveConfig() {
|
|
116272
|
-
const file2 =
|
|
116970
|
+
const file2 = loadConfigFile2();
|
|
116273
116971
|
const cli = parseCLIFlags();
|
|
116274
116972
|
return resolveConfigLayers(file2, cli);
|
|
116275
116973
|
}
|
|
@@ -116280,8 +116978,8 @@ var init_config3 = __esm(() => {
|
|
|
116280
116978
|
port: 43130,
|
|
116281
116979
|
secure: true
|
|
116282
116980
|
};
|
|
116283
|
-
CONFIG_DIR =
|
|
116284
|
-
CONFIG_FILE =
|
|
116981
|
+
CONFIG_DIR = join55(homedir37(), ".scout/pairing");
|
|
116982
|
+
CONFIG_FILE = join55(CONFIG_DIR, "config.json");
|
|
116285
116983
|
});
|
|
116286
116984
|
|
|
116287
116985
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/web-handoff.ts
|
|
@@ -116349,7 +117047,7 @@ var init_web_handoff = __esm(() => {
|
|
|
116349
117047
|
|
|
116350
117048
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/artifact-presentation.ts
|
|
116351
117049
|
import { randomBytes as randomBytes8 } from "crypto";
|
|
116352
|
-
import { realpathSync as realpathSync3, statSync as
|
|
117050
|
+
import { realpathSync as realpathSync3, statSync as statSync10 } from "fs";
|
|
116353
117051
|
import { basename as basename18, dirname as dirname30, isAbsolute as isAbsolute5, relative as relative5, resolve as resolve31, sep as sep3 } from "path";
|
|
116354
117052
|
function createArtifactPresentation(input, options) {
|
|
116355
117053
|
const now = options.now ?? Date.now();
|
|
@@ -116362,14 +117060,14 @@ function createArtifactPresentation(input, options) {
|
|
|
116362
117060
|
if (!isPathInside2(allowedRoot, sourcePath)) {
|
|
116363
117061
|
throw new Error("sourcePath is outside the session workspace");
|
|
116364
117062
|
}
|
|
116365
|
-
const source =
|
|
117063
|
+
const source = statSync10(sourcePath);
|
|
116366
117064
|
const rootPath = source.isDirectory() ? sourcePath : dirname30(sourcePath);
|
|
116367
117065
|
const entryPath = normalizeRelativeEntry(source.isDirectory() ? input.entryPath?.trim() || "index.html" : basename18(sourcePath));
|
|
116368
117066
|
const entryTarget = requiredRealPath(resolve31(rootPath, entryPath), "entryPath");
|
|
116369
117067
|
if (!isPathInside2(rootPath, entryTarget)) {
|
|
116370
117068
|
throw new Error("entryPath leaves the presentation root");
|
|
116371
117069
|
}
|
|
116372
|
-
if (!
|
|
117070
|
+
if (!statSync10(entryTarget).isFile()) {
|
|
116373
117071
|
throw new Error("entryPath must name a file");
|
|
116374
117072
|
}
|
|
116375
117073
|
const id = `present-${randomBytes8(24).toString("base64url")}`;
|
|
@@ -116413,14 +117111,14 @@ function serveArtifactPresentation(req, url2, now = Date.now()) {
|
|
|
116413
117111
|
if (!isPathInside2(grant.rootPath, target2)) {
|
|
116414
117112
|
return presentationResponse("Forbidden", 403);
|
|
116415
117113
|
}
|
|
116416
|
-
const targetStat =
|
|
117114
|
+
const targetStat = statSync10(target2);
|
|
116417
117115
|
if (targetStat.isDirectory()) {
|
|
116418
117116
|
try {
|
|
116419
117117
|
target2 = requiredRealPath(resolve31(target2, "index.html"), "artifact index");
|
|
116420
117118
|
} catch {
|
|
116421
117119
|
return presentationResponse("Not found", 404);
|
|
116422
117120
|
}
|
|
116423
|
-
if (!isPathInside2(grant.rootPath, target2) || !
|
|
117121
|
+
if (!isPathInside2(grant.rootPath, target2) || !statSync10(target2).isFile()) {
|
|
116424
117122
|
return presentationResponse("Not found", 404);
|
|
116425
117123
|
}
|
|
116426
117124
|
} else if (!targetStat.isFile()) {
|
|
@@ -116480,7 +117178,7 @@ function normalizeRelativeEntry(value) {
|
|
|
116480
117178
|
}
|
|
116481
117179
|
function requiredRealDirectory(path2, label) {
|
|
116482
117180
|
const real3 = requiredRealPath(path2, label);
|
|
116483
|
-
if (!
|
|
117181
|
+
if (!statSync10(real3).isDirectory()) {
|
|
116484
117182
|
throw new Error(`${label} must be a directory`);
|
|
116485
117183
|
}
|
|
116486
117184
|
return real3;
|
|
@@ -116538,10 +117236,10 @@ var init_artifact_presentation = __esm(() => {
|
|
|
116538
117236
|
|
|
116539
117237
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/fileserver.ts
|
|
116540
117238
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
116541
|
-
import { existsSync as
|
|
117239
|
+
import { existsSync as existsSync48, mkdirSync as mkdirSync18, readFileSync as readFileSync26, realpathSync as realpathSync4, statSync as statSync11, unlinkSync as unlinkSync3, writeFileSync as writeFileSync15 } from "fs";
|
|
116542
117240
|
import { BlockList, isIP } from "net";
|
|
116543
|
-
import { isAbsolute as isAbsolute6, join as
|
|
116544
|
-
import { homedir as
|
|
117241
|
+
import { isAbsolute as isAbsolute6, join as join56, relative as relative6, sep as sep4 } from "path";
|
|
117242
|
+
import { homedir as homedir38 } from "os";
|
|
116545
117243
|
function pairingFileServerOrigin(port, host = "127.0.0.1") {
|
|
116546
117244
|
return `http://${host}:${port}`;
|
|
116547
117245
|
}
|
|
@@ -116557,11 +117255,11 @@ function storePairingAttachmentBlob(input, options) {
|
|
|
116557
117255
|
if (data.length > PAIRING_ATTACHMENT_MAX_BYTES) {
|
|
116558
117256
|
throw new Error(`attachment exceeds ${PAIRING_ATTACHMENT_MAX_BYTES} bytes`);
|
|
116559
117257
|
}
|
|
116560
|
-
|
|
117258
|
+
mkdirSync18(PAIRING_ATTACHMENT_ROOT, { recursive: true, mode: 448 });
|
|
116561
117259
|
purgeExpiredPairingAttachments(options.now);
|
|
116562
117260
|
const id = `att-${randomUUID6()}`;
|
|
116563
|
-
const path2 =
|
|
116564
|
-
|
|
117261
|
+
const path2 = join56(PAIRING_ATTACHMENT_ROOT, id);
|
|
117262
|
+
writeFileSync15(path2, data, { mode: 384 });
|
|
116565
117263
|
const now = options.now ?? Date.now();
|
|
116566
117264
|
const entry = {
|
|
116567
117265
|
id,
|
|
@@ -116590,7 +117288,7 @@ function readPairingAttachmentBlob(id, now = Date.now()) {
|
|
|
116590
117288
|
}
|
|
116591
117289
|
let data;
|
|
116592
117290
|
try {
|
|
116593
|
-
data =
|
|
117291
|
+
data = readFileSync26(entry.path);
|
|
116594
117292
|
} catch {
|
|
116595
117293
|
forgetPairingAttachment(entry.id);
|
|
116596
117294
|
return null;
|
|
@@ -116609,25 +117307,25 @@ function resolvePairingAttachment(id, now) {
|
|
|
116609
117307
|
}
|
|
116610
117308
|
const known = attachmentBlobs.get(id);
|
|
116611
117309
|
if (known) {
|
|
116612
|
-
if (known.expiresAt <= now || !
|
|
117310
|
+
if (known.expiresAt <= now || !existsSync48(known.path)) {
|
|
116613
117311
|
forgetPairingAttachment(id);
|
|
116614
117312
|
return null;
|
|
116615
117313
|
}
|
|
116616
117314
|
return known;
|
|
116617
117315
|
}
|
|
116618
117316
|
const rehydrated = readAttachmentSidecar(id);
|
|
116619
|
-
if (!rehydrated || rehydrated.expiresAt <= now || !
|
|
117317
|
+
if (!rehydrated || rehydrated.expiresAt <= now || !existsSync48(rehydrated.path)) {
|
|
116620
117318
|
return null;
|
|
116621
117319
|
}
|
|
116622
117320
|
attachmentBlobs.set(id, rehydrated);
|
|
116623
117321
|
return rehydrated;
|
|
116624
117322
|
}
|
|
116625
117323
|
function attachmentSidecarPath(id) {
|
|
116626
|
-
return
|
|
117324
|
+
return join56(PAIRING_ATTACHMENT_ROOT, `${id}.json`);
|
|
116627
117325
|
}
|
|
116628
117326
|
function writeAttachmentSidecar(entry) {
|
|
116629
117327
|
try {
|
|
116630
|
-
|
|
117328
|
+
writeFileSync15(attachmentSidecarPath(entry.id), JSON.stringify({
|
|
116631
117329
|
id: entry.id,
|
|
116632
117330
|
mediaType: entry.mediaType,
|
|
116633
117331
|
fileName: entry.fileName,
|
|
@@ -116638,14 +117336,14 @@ function writeAttachmentSidecar(entry) {
|
|
|
116638
117336
|
}
|
|
116639
117337
|
function readAttachmentSidecar(id) {
|
|
116640
117338
|
try {
|
|
116641
|
-
const raw = JSON.parse(
|
|
117339
|
+
const raw = JSON.parse(readFileSync26(attachmentSidecarPath(id), "utf8"));
|
|
116642
117340
|
const mediaType = normalizeMediaType(raw.mediaType);
|
|
116643
117341
|
if (raw.id !== id || !mediaType || typeof raw.expiresAt !== "number") {
|
|
116644
117342
|
return null;
|
|
116645
117343
|
}
|
|
116646
117344
|
return {
|
|
116647
117345
|
id,
|
|
116648
|
-
path:
|
|
117346
|
+
path: join56(PAIRING_ATTACHMENT_ROOT, id),
|
|
116649
117347
|
mediaType,
|
|
116650
117348
|
fileName: sanitizeAttachmentFileName(raw.fileName),
|
|
116651
117349
|
size: typeof raw.size === "number" ? raw.size : 0,
|
|
@@ -116657,9 +117355,9 @@ function readAttachmentSidecar(id) {
|
|
|
116657
117355
|
}
|
|
116658
117356
|
function forgetPairingAttachment(id) {
|
|
116659
117357
|
attachmentBlobs.delete(id);
|
|
116660
|
-
for (const path2 of [
|
|
117358
|
+
for (const path2 of [join56(PAIRING_ATTACHMENT_ROOT, id), attachmentSidecarPath(id)]) {
|
|
116661
117359
|
try {
|
|
116662
|
-
|
|
117360
|
+
unlinkSync3(path2);
|
|
116663
117361
|
} catch {}
|
|
116664
117362
|
}
|
|
116665
117363
|
}
|
|
@@ -116709,7 +117407,7 @@ function isInsideRoot(root, candidate) {
|
|
|
116709
117407
|
function isAllowedHomeRelativePath(rel) {
|
|
116710
117408
|
if (!rel.startsWith("."))
|
|
116711
117409
|
return true;
|
|
116712
|
-
return rel === ".claude" || rel.startsWith(`.claude${sep4}`) || rel ===
|
|
117410
|
+
return rel === ".claude" || rel.startsWith(`.claude${sep4}`) || rel === join56(".scout", "pairing") || rel.startsWith(`${join56(".scout", "pairing")}${sep4}`);
|
|
116713
117411
|
}
|
|
116714
117412
|
function resolveAllowedFile(filePath) {
|
|
116715
117413
|
if (!isAbsolute6(filePath))
|
|
@@ -116720,7 +117418,7 @@ function resolveAllowedFile(filePath) {
|
|
|
116720
117418
|
} catch {
|
|
116721
117419
|
return { status: "missing" };
|
|
116722
117420
|
}
|
|
116723
|
-
const canonicalHome = realpathSync4(
|
|
117421
|
+
const canonicalHome = realpathSync4(homedir38());
|
|
116724
117422
|
for (const configuredRoot of ALLOWED_ROOTS) {
|
|
116725
117423
|
const root = realpathSync4(configuredRoot);
|
|
116726
117424
|
if (!isInsideRoot(root, candidate))
|
|
@@ -116729,7 +117427,7 @@ function resolveAllowedFile(filePath) {
|
|
|
116729
117427
|
return { status: "forbidden" };
|
|
116730
117428
|
}
|
|
116731
117429
|
try {
|
|
116732
|
-
return
|
|
117430
|
+
return statSync11(candidate).isFile() ? { status: "allowed", path: candidate } : { status: "missing" };
|
|
116733
117431
|
} catch {
|
|
116734
117432
|
return { status: "missing" };
|
|
116735
117433
|
}
|
|
@@ -117363,21 +118061,21 @@ var ALLOWED_ROOTS, LOOPBACK_PEERS, PAIRING_ATTACHMENT_ROOT, PAIRING_ATTACHMENT_T
|
|
|
117363
118061
|
var init_fileserver = __esm(() => {
|
|
117364
118062
|
init_web_handoff();
|
|
117365
118063
|
init_artifact_presentation();
|
|
117366
|
-
ALLOWED_ROOTS = [
|
|
118064
|
+
ALLOWED_ROOTS = [homedir38(), "/tmp"];
|
|
117367
118065
|
LOOPBACK_PEERS = new BlockList;
|
|
117368
118066
|
LOOPBACK_PEERS.addSubnet("127.0.0.0", 8, "ipv4");
|
|
117369
118067
|
LOOPBACK_PEERS.addAddress("::1", "ipv6");
|
|
117370
118068
|
LOOPBACK_PEERS.addSubnet("::ffff:127.0.0.0", 104, "ipv6");
|
|
117371
|
-
PAIRING_ATTACHMENT_ROOT =
|
|
118069
|
+
PAIRING_ATTACHMENT_ROOT = join56(homedir38(), ".scout", "pairing", "attachments");
|
|
117372
118070
|
PAIRING_ATTACHMENT_TTL_MS = 6 * 60 * 60 * 1000;
|
|
117373
118071
|
PAIRING_ATTACHMENT_MAX_BYTES = 25 * 1024 * 1024;
|
|
117374
118072
|
attachmentBlobs = new Map;
|
|
117375
118073
|
});
|
|
117376
118074
|
|
|
117377
118075
|
// ../runtime/src/agent-workspace.ts
|
|
117378
|
-
import { existsSync as
|
|
118076
|
+
import { existsSync as existsSync49 } from "fs";
|
|
117379
118077
|
import { mkdir as mkdir13 } from "fs/promises";
|
|
117380
|
-
import { join as
|
|
118078
|
+
import { join as join57 } from "path";
|
|
117381
118079
|
async function isGitRepo(projectRoot) {
|
|
117382
118080
|
try {
|
|
117383
118081
|
await execSystemFile("git", ["rev-parse", "--git-dir"], { cwd: projectRoot, timeoutMs: 2000 });
|
|
@@ -117397,9 +118095,9 @@ async function createAgentWorkspace(projectRoot, agentName, requestedBranch) {
|
|
|
117397
118095
|
}
|
|
117398
118096
|
const branch = requestedBranch?.trim() || `scout/${agentName}`;
|
|
117399
118097
|
validateWorktreeBranch(branch);
|
|
117400
|
-
const workspaceDir =
|
|
117401
|
-
const workspacePath =
|
|
117402
|
-
if (
|
|
118098
|
+
const workspaceDir = join57(projectRoot, SCOUT_WORKSPACES_DIRNAME);
|
|
118099
|
+
const workspacePath = join57(workspaceDir, agentName);
|
|
118100
|
+
if (existsSync49(workspacePath)) {
|
|
117403
118101
|
return { path: workspacePath, branch };
|
|
117404
118102
|
}
|
|
117405
118103
|
await mkdir13(workspaceDir, { recursive: true });
|
|
@@ -117422,11 +118120,11 @@ var init_agent_workspace = __esm(() => {
|
|
|
117422
118120
|
|
|
117423
118121
|
// ../../apps/desktop/src/server/db-queries.ts
|
|
117424
118122
|
import { Database as Database4 } from "bun:sqlite";
|
|
117425
|
-
import { homedir as
|
|
117426
|
-
import { join as
|
|
118123
|
+
import { homedir as homedir39 } from "os";
|
|
118124
|
+
import { join as join58 } from "path";
|
|
117427
118125
|
function resolveDbPath() {
|
|
117428
|
-
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ??
|
|
117429
|
-
return
|
|
118126
|
+
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join58(homedir39(), ".openscout", "control-plane");
|
|
118127
|
+
return join58(controlHome, "control-plane.sqlite");
|
|
117430
118128
|
}
|
|
117431
118129
|
function db2() {
|
|
117432
118130
|
if (!_db) {
|
|
@@ -117915,7 +118613,7 @@ var _db = null, HOME, LATEST_AGENT_ENDPOINT_JOIN = `LEFT JOIN agent_endpoints ep
|
|
|
117915
118613
|
)`, ACTIVE_FLIGHT_STATES_SQL, ACTIVE_FLIGHT_MAX_AGE_MS, ACTIVE_WORK_STATES_SQL;
|
|
117916
118614
|
var init_db_queries = __esm(() => {
|
|
117917
118615
|
init_src();
|
|
117918
|
-
HOME =
|
|
118616
|
+
HOME = homedir39();
|
|
117919
118617
|
ACTIVE_FLIGHT_STATES_SQL = sqlStringList(["running", "waking", "waiting", "queued"]);
|
|
117920
118618
|
ACTIVE_FLIGHT_MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
117921
118619
|
ACTIVE_WORK_STATES_SQL = sqlStringList(["open", "working", "waiting", "review"]);
|
|
@@ -117923,7 +118621,7 @@ var init_db_queries = __esm(() => {
|
|
|
117923
118621
|
|
|
117924
118622
|
// ../../apps/desktop/src/core/mobile/service.ts
|
|
117925
118623
|
import { basename as basename19, resolve as resolve32 } from "path";
|
|
117926
|
-
import { statSync as
|
|
118624
|
+
import { statSync as statSync12 } from "fs";
|
|
117927
118625
|
async function getScoutMobileRuntimeCapabilities(projectRoot) {
|
|
117928
118626
|
const normalizedProjectRoot = projectRoot?.trim() ? resolve32(projectRoot) : null;
|
|
117929
118627
|
const liveCatalog = await readScoutRuntimeCatalog();
|
|
@@ -117947,7 +118645,7 @@ async function getScoutMobileRuntimeCapabilities(projectRoot) {
|
|
|
117947
118645
|
reasoningEffort: scoutRuntimeDefaultReasoningEffort(defaultHarness ?? "", defaultModel, runtimeCatalog)
|
|
117948
118646
|
},
|
|
117949
118647
|
defaultsByHarness: scoutRuntimeDefaultsByHarness(runtimeCatalog),
|
|
117950
|
-
harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled).map((entry) => ({ id: entry.id, label: entry.label })),
|
|
118648
|
+
harnesses: runtimeCatalog.harnesses.filter((entry) => entry.enabled && entry.listed !== false).map((entry) => ({ id: entry.id, label: entry.label })),
|
|
117951
118649
|
models,
|
|
117952
118650
|
efforts: scoutRuntimeEffortCatalog(runtimeCatalog).map((effort) => ({
|
|
117953
118651
|
...effort,
|
|
@@ -118080,7 +118778,7 @@ async function loadMobileWorkspaceInventory(currentDirectory) {
|
|
|
118080
118778
|
}
|
|
118081
118779
|
function isDirectory2(path2) {
|
|
118082
118780
|
try {
|
|
118083
|
-
return
|
|
118781
|
+
return statSync12(path2).isDirectory();
|
|
118084
118782
|
} catch {
|
|
118085
118783
|
return false;
|
|
118086
118784
|
}
|
|
@@ -119242,21 +119940,21 @@ var init_mobile_terminal_session = __esm(() => {
|
|
|
119242
119940
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/mobile-terminal-provision.ts
|
|
119243
119941
|
import { createHash as createHash13 } from "crypto";
|
|
119244
119942
|
import {
|
|
119245
|
-
chmodSync as
|
|
119943
|
+
chmodSync as chmodSync3,
|
|
119246
119944
|
closeSync,
|
|
119247
|
-
existsSync as
|
|
119248
|
-
mkdirSync as
|
|
119945
|
+
existsSync as existsSync50,
|
|
119946
|
+
mkdirSync as mkdirSync19,
|
|
119249
119947
|
openSync,
|
|
119250
|
-
readFileSync as
|
|
119948
|
+
readFileSync as readFileSync27,
|
|
119251
119949
|
renameSync as renameSync6,
|
|
119252
|
-
unlinkSync as
|
|
119253
|
-
writeFileSync as
|
|
119950
|
+
unlinkSync as unlinkSync4,
|
|
119951
|
+
writeFileSync as writeFileSync16
|
|
119254
119952
|
} from "fs";
|
|
119255
|
-
import { homedir as
|
|
119256
|
-
import { join as
|
|
119953
|
+
import { homedir as homedir40, hostname as hostname5, userInfo as userInfo2 } from "os";
|
|
119954
|
+
import { join as join59 } from "path";
|
|
119257
119955
|
async function readMobileTerminalStatus(requestedSessionName, deviceId) {
|
|
119258
|
-
const authorizedKeysPath =
|
|
119259
|
-
const authorizedKeys =
|
|
119956
|
+
const authorizedKeysPath = join59(homedir40(), ".ssh", "authorized_keys");
|
|
119957
|
+
const authorizedKeys = existsSync50(authorizedKeysPath) ? readFileSync27(authorizedKeysPath, "utf8") : "";
|
|
119260
119958
|
const provisionedSessionName = findSshTerminalSessionForDevice(authorizedKeys, deviceId);
|
|
119261
119959
|
const sessionName = authorizedMobileTerminalSessionName(requestedSessionName, provisionedSessionName);
|
|
119262
119960
|
const base = {
|
|
@@ -119328,17 +120026,17 @@ async function readMobileTerminalStatus(requestedSessionName, deviceId) {
|
|
|
119328
120026
|
async function provisionMobileTerminalAccess(sshPublicKey, deviceId, deviceClass = undefined) {
|
|
119329
120027
|
const id = deviceId?.trim() || "scout-ios-device";
|
|
119330
120028
|
const sessionName = provisionedMobileTerminalSessionName(sshPublicKey, deviceClass);
|
|
119331
|
-
const sshDir =
|
|
119332
|
-
const authorizedKeysPath =
|
|
120029
|
+
const sshDir = join59(homedir40(), ".ssh");
|
|
120030
|
+
const authorizedKeysPath = join59(sshDir, "authorized_keys");
|
|
119333
120031
|
const hostKeyFingerprint = readRequiredHostKeyFingerprint();
|
|
119334
120032
|
const result = withAuthorizedKeysLock(sshDir, () => {
|
|
119335
|
-
if (!
|
|
119336
|
-
|
|
120033
|
+
if (!existsSync50(sshDir)) {
|
|
120034
|
+
mkdirSync19(sshDir, { recursive: true, mode: 448 });
|
|
119337
120035
|
}
|
|
119338
120036
|
try {
|
|
119339
|
-
|
|
120037
|
+
chmodSync3(sshDir, 448);
|
|
119340
120038
|
} catch {}
|
|
119341
|
-
const existing =
|
|
120039
|
+
const existing = existsSync50(authorizedKeysPath) ? readFileSync27(authorizedKeysPath, "utf8") : "";
|
|
119342
120040
|
const result2 = provisionSshTerminalAccess({
|
|
119343
120041
|
authorizedKeys: existing,
|
|
119344
120042
|
deviceId: id,
|
|
@@ -119352,7 +120050,7 @@ async function provisionMobileTerminalAccess(sshPublicKey, deviceId, deviceClass
|
|
|
119352
120050
|
log.info("terminal", `SSH key already authorized for device ${id}`);
|
|
119353
120051
|
}
|
|
119354
120052
|
try {
|
|
119355
|
-
|
|
120053
|
+
chmodSync3(authorizedKeysPath, 384);
|
|
119356
120054
|
} catch {}
|
|
119357
120055
|
return result2;
|
|
119358
120056
|
});
|
|
@@ -119386,7 +120084,7 @@ function resolveReachableHost() {
|
|
|
119386
120084
|
}
|
|
119387
120085
|
function readRequiredHostKeyFingerprint() {
|
|
119388
120086
|
try {
|
|
119389
|
-
const pub =
|
|
120087
|
+
const pub = readFileSync27("/etc/ssh/ssh_host_ed25519_key.pub", "utf8");
|
|
119390
120088
|
const keyData = pub.trim().split(/\s+/)[1];
|
|
119391
120089
|
if (!keyData)
|
|
119392
120090
|
throw new Error("missing key data");
|
|
@@ -119400,20 +120098,20 @@ function readRequiredHostKeyFingerprint() {
|
|
|
119400
120098
|
function writeAuthorizedKeysAtomically(path2, contents) {
|
|
119401
120099
|
const tmpPath = `${path2}.scout-${process.pid}-${Date.now()}.tmp`;
|
|
119402
120100
|
try {
|
|
119403
|
-
|
|
120101
|
+
writeFileSync16(tmpPath, contents, { mode: 384, flag: "wx" });
|
|
119404
120102
|
renameSync6(tmpPath, path2);
|
|
119405
120103
|
} catch (error48) {
|
|
119406
120104
|
try {
|
|
119407
|
-
|
|
120105
|
+
unlinkSync4(tmpPath);
|
|
119408
120106
|
} catch {}
|
|
119409
120107
|
throw error48;
|
|
119410
120108
|
}
|
|
119411
120109
|
}
|
|
119412
120110
|
function withAuthorizedKeysLock(sshDir, action) {
|
|
119413
|
-
if (!
|
|
119414
|
-
|
|
120111
|
+
if (!existsSync50(sshDir)) {
|
|
120112
|
+
mkdirSync19(sshDir, { recursive: true, mode: 448 });
|
|
119415
120113
|
}
|
|
119416
|
-
const lockPath =
|
|
120114
|
+
const lockPath = join59(sshDir, ".scout-authorized-keys.lock");
|
|
119417
120115
|
const deadline = Date.now() + 5000;
|
|
119418
120116
|
let fd = null;
|
|
119419
120117
|
while (fd === null) {
|
|
@@ -119438,7 +120136,7 @@ function withAuthorizedKeysLock(sshDir, action) {
|
|
|
119438
120136
|
closeSync(lockFd);
|
|
119439
120137
|
} finally {
|
|
119440
120138
|
try {
|
|
119441
|
-
|
|
120139
|
+
unlinkSync4(lockPath);
|
|
119442
120140
|
} catch {}
|
|
119443
120141
|
}
|
|
119444
120142
|
}
|
|
@@ -119455,9 +120153,9 @@ var init_mobile_terminal_provision = __esm(() => {
|
|
|
119455
120153
|
});
|
|
119456
120154
|
|
|
119457
120155
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/server.ts
|
|
119458
|
-
import { readdirSync as readdirSync6, readFileSync as
|
|
119459
|
-
import { basename as basename20, isAbsolute as isAbsolute7, join as
|
|
119460
|
-
import { homedir as
|
|
120156
|
+
import { readdirSync as readdirSync6, readFileSync as readFileSync28, realpathSync as realpathSync5, statSync as statSync13 } from "fs";
|
|
120157
|
+
import { basename as basename20, isAbsolute as isAbsolute7, join as join60, relative as relative7, resolve as resolve33 } from "path";
|
|
120158
|
+
import { homedir as homedir41 } from "os";
|
|
119461
120159
|
function replaySyncEvents(bridge, sessionId, lastSeq) {
|
|
119462
120160
|
return bridge.replay(sessionId, lastSeq);
|
|
119463
120161
|
}
|
|
@@ -119644,7 +120342,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
119644
120342
|
if (dirName.startsWith("-")) {
|
|
119645
120343
|
const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
|
|
119646
120344
|
try {
|
|
119647
|
-
|
|
120345
|
+
statSync13(candidate);
|
|
119648
120346
|
cwd = candidate;
|
|
119649
120347
|
} catch {
|
|
119650
120348
|
const config2 = resolveConfig();
|
|
@@ -119701,7 +120399,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
119701
120399
|
}
|
|
119702
120400
|
const root = resolveWorkspaceRoot(configuredRoot);
|
|
119703
120401
|
const projectPath = resolveWorkspacePath(root, p.path);
|
|
119704
|
-
const stat6 =
|
|
120402
|
+
const stat6 = statSync13(projectPath);
|
|
119705
120403
|
if (!stat6.isDirectory()) {
|
|
119706
120404
|
return { id: req.id, error: { code: -32000, message: "Workspace target is not a directory" } };
|
|
119707
120405
|
}
|
|
@@ -119973,7 +120671,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
119973
120671
|
const config2 = resolveConfig();
|
|
119974
120672
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot(config2.workspace.root) : null;
|
|
119975
120673
|
const matches = await readSessionSearch({
|
|
119976
|
-
home:
|
|
120674
|
+
home: homedir41(),
|
|
119977
120675
|
workspaceRoot,
|
|
119978
120676
|
maxAgeDays: maxAge,
|
|
119979
120677
|
limit,
|
|
@@ -119988,7 +120686,7 @@ async function handleRPCInner(bridge, req, rpcContext = {}) {
|
|
|
119988
120686
|
return { id: req.id, error: { code: -32000, message: "Only .jsonl files can be read" } };
|
|
119989
120687
|
}
|
|
119990
120688
|
try {
|
|
119991
|
-
const content =
|
|
120689
|
+
const content = readFileSync28(p.path, "utf-8");
|
|
119992
120690
|
const lines = content.split(`
|
|
119993
120691
|
`).filter((l) => l.trim().length > 0);
|
|
119994
120692
|
const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
|
|
@@ -120109,13 +120807,13 @@ function resolveMobileCurrentDirectory() {
|
|
|
120109
120807
|
}
|
|
120110
120808
|
}
|
|
120111
120809
|
function resolveWorkspaceRoot(root) {
|
|
120112
|
-
const expandedRoot = root.replace(/^~/,
|
|
120810
|
+
const expandedRoot = root.replace(/^~/, homedir41());
|
|
120113
120811
|
return realpathSync5(expandedRoot);
|
|
120114
120812
|
}
|
|
120115
120813
|
function resolveWorkspacePath(root, requestedPath) {
|
|
120116
120814
|
const normalizedRoot = resolveWorkspaceRoot(root);
|
|
120117
|
-
const expandedPath = requestedPath?.replace(/^~/,
|
|
120118
|
-
const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath :
|
|
120815
|
+
const expandedPath = requestedPath?.replace(/^~/, homedir41());
|
|
120816
|
+
const candidate = expandedPath ? isAbsolute7(expandedPath) ? expandedPath : join60(normalizedRoot, expandedPath) : normalizedRoot;
|
|
120119
120817
|
const resolvedCandidate = realpathSync5(candidate);
|
|
120120
120818
|
const rel = relative7(normalizedRoot, resolvedCandidate);
|
|
120121
120819
|
if (rel === "" || !rel.startsWith("..") && !isAbsolute7(rel)) {
|
|
@@ -120130,9 +120828,9 @@ function listDirectories(dirPath) {
|
|
|
120130
120828
|
continue;
|
|
120131
120829
|
if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
|
|
120132
120830
|
continue;
|
|
120133
|
-
const fullPath =
|
|
120831
|
+
const fullPath = join60(dirPath, name2);
|
|
120134
120832
|
try {
|
|
120135
|
-
const stat6 =
|
|
120833
|
+
const stat6 = statSync13(fullPath);
|
|
120136
120834
|
if (!stat6.isDirectory())
|
|
120137
120835
|
continue;
|
|
120138
120836
|
const children = new Set(readdirSync6(fullPath));
|
|
@@ -120156,7 +120854,7 @@ async function discoverSessionFiles(maxAgeDays, limit) {
|
|
|
120156
120854
|
const config2 = resolveConfig();
|
|
120157
120855
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot(config2.workspace.root) : null;
|
|
120158
120856
|
const sessions4 = await readSessionFileScan({
|
|
120159
|
-
home:
|
|
120857
|
+
home: homedir41(),
|
|
120160
120858
|
workspaceRoot,
|
|
120161
120859
|
maxAgeDays,
|
|
120162
120860
|
limit
|
|
@@ -120270,9 +120968,9 @@ var init_tail_fanout = __esm(() => {
|
|
|
120270
120968
|
});
|
|
120271
120969
|
|
|
120272
120970
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/router.ts
|
|
120273
|
-
import { readFileSync as
|
|
120274
|
-
import { basename as basename21, isAbsolute as isAbsolute8, join as
|
|
120275
|
-
import { homedir as
|
|
120971
|
+
import { readFileSync as readFileSync29, readdirSync as readdirSync7, realpathSync as realpathSync6, statSync as statSync14 } from "fs";
|
|
120972
|
+
import { basename as basename21, isAbsolute as isAbsolute8, join as join61, relative as relative8, resolve as resolve34 } from "path";
|
|
120973
|
+
import { homedir as homedir42 } from "os";
|
|
120276
120974
|
function resolveMobileCurrentDirectory2() {
|
|
120277
120975
|
const config2 = resolveConfig();
|
|
120278
120976
|
const configuredRoot = config2.workspace?.root;
|
|
@@ -120285,13 +120983,13 @@ function resolveMobileCurrentDirectory2() {
|
|
|
120285
120983
|
}
|
|
120286
120984
|
}
|
|
120287
120985
|
function resolveWorkspaceRoot2(root) {
|
|
120288
|
-
const expandedRoot = root.replace(/^~/,
|
|
120986
|
+
const expandedRoot = root.replace(/^~/, homedir42());
|
|
120289
120987
|
return realpathSync6(expandedRoot);
|
|
120290
120988
|
}
|
|
120291
120989
|
function resolveWorkspacePath2(root, requestedPath) {
|
|
120292
120990
|
const normalizedRoot = resolveWorkspaceRoot2(root);
|
|
120293
|
-
const expandedPath = requestedPath?.replace(/^~/,
|
|
120294
|
-
const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath :
|
|
120991
|
+
const expandedPath = requestedPath?.replace(/^~/, homedir42());
|
|
120992
|
+
const candidate = expandedPath ? isAbsolute8(expandedPath) ? expandedPath : join61(normalizedRoot, expandedPath) : normalizedRoot;
|
|
120295
120993
|
const resolvedCandidate = realpathSync6(candidate);
|
|
120296
120994
|
const rel = relative8(normalizedRoot, resolvedCandidate);
|
|
120297
120995
|
if (rel === "" || !rel.startsWith("..") && !isAbsolute8(rel)) {
|
|
@@ -120306,9 +121004,9 @@ function listDirectories2(dirPath) {
|
|
|
120306
121004
|
continue;
|
|
120307
121005
|
if (name2 === "node_modules" || name2 === ".build" || name2 === "target")
|
|
120308
121006
|
continue;
|
|
120309
|
-
const fullPath =
|
|
121007
|
+
const fullPath = join61(dirPath, name2);
|
|
120310
121008
|
try {
|
|
120311
|
-
const stat6 =
|
|
121009
|
+
const stat6 = statSync14(fullPath);
|
|
120312
121010
|
if (!stat6.isDirectory())
|
|
120313
121011
|
continue;
|
|
120314
121012
|
const children = new Set(readdirSync7(fullPath));
|
|
@@ -120339,7 +121037,7 @@ async function discoverSessionFiles2(maxAgeDays, limit) {
|
|
|
120339
121037
|
const config2 = resolveConfig();
|
|
120340
121038
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
|
|
120341
121039
|
const sessions4 = await readSessionFileScan({
|
|
120342
|
-
home:
|
|
121040
|
+
home: homedir42(),
|
|
120343
121041
|
workspaceRoot,
|
|
120344
121042
|
maxAgeDays,
|
|
120345
121043
|
limit
|
|
@@ -120725,7 +121423,7 @@ var init_router = __esm(() => {
|
|
|
120725
121423
|
if (dirName.startsWith("-")) {
|
|
120726
121424
|
const candidate = "/" + dirName.slice(1).replace(/-/g, "/");
|
|
120727
121425
|
try {
|
|
120728
|
-
|
|
121426
|
+
statSync14(candidate);
|
|
120729
121427
|
cwd = candidate;
|
|
120730
121428
|
} catch {
|
|
120731
121429
|
const config2 = resolveConfig();
|
|
@@ -121121,7 +121819,7 @@ var init_router = __esm(() => {
|
|
|
121121
121819
|
}
|
|
121122
121820
|
const root = resolveWorkspaceRoot2(configuredRoot);
|
|
121123
121821
|
const projectPath = resolveWorkspacePath2(root, input.path);
|
|
121124
|
-
const stat6 =
|
|
121822
|
+
const stat6 = statSync14(projectPath);
|
|
121125
121823
|
if (!stat6.isDirectory()) {
|
|
121126
121824
|
throw new TRPCError({
|
|
121127
121825
|
code: "BAD_REQUEST",
|
|
@@ -121163,7 +121861,7 @@ var init_router = __esm(() => {
|
|
|
121163
121861
|
const config2 = resolveConfig();
|
|
121164
121862
|
const workspaceRoot = config2.workspace?.root ? resolveWorkspaceRoot2(config2.workspace.root) : null;
|
|
121165
121863
|
const matches = await readSessionSearch({
|
|
121166
|
-
home:
|
|
121864
|
+
home: homedir42(),
|
|
121167
121865
|
workspaceRoot,
|
|
121168
121866
|
maxAgeDays: maxAge,
|
|
121169
121867
|
limit,
|
|
@@ -121180,7 +121878,7 @@ var init_router = __esm(() => {
|
|
|
121180
121878
|
});
|
|
121181
121879
|
}
|
|
121182
121880
|
try {
|
|
121183
|
-
const content =
|
|
121881
|
+
const content = readFileSync29(input.path, "utf-8");
|
|
121184
121882
|
const lines = content.split(`
|
|
121185
121883
|
`).filter((l) => l.trim().length > 0);
|
|
121186
121884
|
const trimmed = lines.length > 500 ? lines.slice(-500) : lines;
|
|
@@ -123427,14 +124125,14 @@ var init_dist4 = __esm(() => {
|
|
|
123427
124125
|
|
|
123428
124126
|
// ../../apps/desktop/src/core/pairing/runtime/bridge/server-trpc.ts
|
|
123429
124127
|
import { realpathSync as realpathSync7 } from "fs";
|
|
123430
|
-
import { homedir as
|
|
124128
|
+
import { homedir as homedir43 } from "os";
|
|
123431
124129
|
function resolveCurrentDirectory() {
|
|
123432
124130
|
try {
|
|
123433
124131
|
const config2 = resolveConfig();
|
|
123434
124132
|
const configuredRoot = config2.workspace?.root;
|
|
123435
124133
|
if (!configuredRoot)
|
|
123436
124134
|
return process.cwd();
|
|
123437
|
-
const expanded = configuredRoot.replace(/^~/,
|
|
124135
|
+
const expanded = configuredRoot.replace(/^~/, homedir43());
|
|
123438
124136
|
return realpathSync7(expanded);
|
|
123439
124137
|
} catch {
|
|
123440
124138
|
return process.cwd();
|
|
@@ -123957,7 +124655,7 @@ var init_server_trpc = __esm(() => {
|
|
|
123957
124655
|
});
|
|
123958
124656
|
|
|
123959
124657
|
// ../../apps/desktop/src/core/pairing/runtime/runtime.ts
|
|
123960
|
-
import { homedir as
|
|
124658
|
+
import { homedir as homedir44 } from "os";
|
|
123961
124659
|
function createPairingAdapterRegistry(configAdapters) {
|
|
123962
124660
|
const adapters = {
|
|
123963
124661
|
"claude-code": createAdapter6,
|
|
@@ -124112,7 +124810,7 @@ async function autoStartConfiguredSessions(bridge, sessions4) {
|
|
|
124112
124810
|
try {
|
|
124113
124811
|
const session3 = await bridge.createSession(entry.adapter, {
|
|
124114
124812
|
name: entry.name,
|
|
124115
|
-
cwd: entry.cwd?.replace(/^~/,
|
|
124813
|
+
cwd: entry.cwd?.replace(/^~/, homedir44()),
|
|
124116
124814
|
options: entry.options
|
|
124117
124815
|
});
|
|
124118
124816
|
console.log(`[bridge] session started: ${session3.name} (${entry.adapter})`);
|
|
@@ -124133,10 +124831,10 @@ var init_runtime = __esm(() => {
|
|
|
124133
124831
|
});
|
|
124134
124832
|
|
|
124135
124833
|
// ../../apps/desktop/src/core/pairing/runtime/log.ts
|
|
124136
|
-
import { appendFileSync as appendFileSync2, mkdirSync as
|
|
124834
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync20 } from "fs";
|
|
124137
124835
|
function write2(level, category, message, data) {
|
|
124138
124836
|
const { rootDir, logPath } = pairingPaths();
|
|
124139
|
-
|
|
124837
|
+
mkdirSync20(rootDir, { recursive: true });
|
|
124140
124838
|
const prefix = `${new Date().toISOString()} [${level.toUpperCase()}] [${category}]`;
|
|
124141
124839
|
const line = data === undefined ? `${prefix} ${message}
|
|
124142
124840
|
` : `${prefix} ${message} ${JSON.stringify(data)}
|
|
@@ -124381,16 +125079,16 @@ function parseRelayEnvelope2(data) {
|
|
|
124381
125079
|
var BRIDGE_ABSENCE_GRACE_MS = 30000, ROOM_IDLE_TIMEOUT_MS = 60000;
|
|
124382
125080
|
|
|
124383
125081
|
// ../../apps/desktop/src/core/pairing/runtime/relay-runtime.ts
|
|
124384
|
-
import { existsSync as
|
|
124385
|
-
import { homedir as
|
|
124386
|
-
import { join as
|
|
125082
|
+
import { existsSync as existsSync51, mkdirSync as mkdirSync21 } from "fs";
|
|
125083
|
+
import { homedir as homedir45, networkInterfaces as networkInterfaces2 } from "os";
|
|
125084
|
+
import { join as join62 } from "path";
|
|
124387
125085
|
async function findStoredTailscaleCert(hostname6) {
|
|
124388
|
-
if (!
|
|
125086
|
+
if (!existsSync51(PAIRING_DIR2)) {
|
|
124389
125087
|
return null;
|
|
124390
125088
|
}
|
|
124391
|
-
const certPath =
|
|
124392
|
-
const keyPath =
|
|
124393
|
-
if (!
|
|
125089
|
+
const certPath = join62(PAIRING_DIR2, `${hostname6}.crt`);
|
|
125090
|
+
const keyPath = join62(PAIRING_DIR2, `${hostname6}.key`);
|
|
125091
|
+
if (!existsSync51(certPath) || !existsSync51(keyPath)) {
|
|
124394
125092
|
return null;
|
|
124395
125093
|
}
|
|
124396
125094
|
if (!await storedCertificateLooksPubliclyTrusted(certPath)) {
|
|
@@ -124473,9 +125171,9 @@ function resolveRelayEndpointForTailscaleStatus(port, tailscale2, options = {})
|
|
|
124473
125171
|
};
|
|
124474
125172
|
}
|
|
124475
125173
|
async function generateTailscaleCerts(hostname6) {
|
|
124476
|
-
|
|
124477
|
-
const certPath =
|
|
124478
|
-
const keyPath =
|
|
125174
|
+
mkdirSync21(PAIRING_DIR2, { recursive: true });
|
|
125175
|
+
const certPath = join62(PAIRING_DIR2, `${hostname6}.crt`);
|
|
125176
|
+
const keyPath = join62(PAIRING_DIR2, `${hostname6}.key`);
|
|
124479
125177
|
try {
|
|
124480
125178
|
pairingLog.info("relay", "generating tailscale TLS cert", { hostname: hostname6 });
|
|
124481
125179
|
await execSystemFile("tailscale", ["cert", "--cert-file", certPath, "--key-file", keyPath, hostname6], {
|
|
@@ -124602,7 +125300,7 @@ var PAIRING_DIR2;
|
|
|
124602
125300
|
var init_relay_runtime = __esm(() => {
|
|
124603
125301
|
init_system_probes();
|
|
124604
125302
|
init_log2();
|
|
124605
|
-
PAIRING_DIR2 =
|
|
125303
|
+
PAIRING_DIR2 = join62(homedir45(), ".scout/pairing");
|
|
124606
125304
|
});
|
|
124607
125305
|
|
|
124608
125306
|
// ../../node_modules/.bun/uqr@0.1.3/node_modules/uqr/dist/index.mjs
|
|
@@ -126741,9 +127439,9 @@ __export(exports_session, {
|
|
|
126741
127439
|
});
|
|
126742
127440
|
import { spawnSync as spawnSync11 } from "child_process";
|
|
126743
127441
|
import { createHash as createHash14 } from "crypto";
|
|
126744
|
-
import { mkdirSync as
|
|
126745
|
-
import { homedir as
|
|
126746
|
-
import { basename as basename22, join as
|
|
127442
|
+
import { mkdirSync as mkdirSync22 } from "fs";
|
|
127443
|
+
import { homedir as homedir46 } from "os";
|
|
127444
|
+
import { basename as basename22, join as join63, resolve as resolve35 } from "path";
|
|
126747
127445
|
async function runSessionCommand(context, args) {
|
|
126748
127446
|
const action = args[0];
|
|
126749
127447
|
if (!action || action === "help" || action === "--help" || action === "-h") {
|
|
@@ -127035,7 +127733,7 @@ function readOptionValue(args, index2, flag) {
|
|
|
127035
127733
|
}
|
|
127036
127734
|
function resolveProjectPath2(context, projectPath) {
|
|
127037
127735
|
const rawPath = projectPath?.trim() || context.cwd;
|
|
127038
|
-
const expanded = rawPath === "~" ? context.env.HOME?.trim() ||
|
|
127736
|
+
const expanded = rawPath === "~" ? context.env.HOME?.trim() || homedir46() : rawPath.startsWith("~/") ? resolve35(context.env.HOME?.trim() || homedir46(), rawPath.slice(2)) : rawPath;
|
|
127039
127737
|
return resolve35(context.cwd, expanded);
|
|
127040
127738
|
}
|
|
127041
127739
|
function resolveControlPlaneDbPath2(context) {
|
|
@@ -127043,8 +127741,8 @@ function resolveControlPlaneDbPath2(context) {
|
|
|
127043
127741
|
if (explicitPath) {
|
|
127044
127742
|
return explicitPath;
|
|
127045
127743
|
}
|
|
127046
|
-
const controlHome = context.env.OPENSCOUT_CONTROL_HOME?.trim() ||
|
|
127047
|
-
return
|
|
127744
|
+
const controlHome = context.env.OPENSCOUT_CONTROL_HOME?.trim() || join63(context.env.HOME?.trim() || homedir46(), ".openscout", "control-plane");
|
|
127745
|
+
return join63(controlHome, "control-plane.sqlite");
|
|
127048
127746
|
}
|
|
127049
127747
|
function openTerminalSessionStore(context) {
|
|
127050
127748
|
return new SQLiteControlPlaneStore(resolveControlPlaneDbPath2(context));
|
|
@@ -127168,12 +127866,12 @@ function assertZellijAvailable(context) {
|
|
|
127168
127866
|
}
|
|
127169
127867
|
function resolveZellijSocketDir(context) {
|
|
127170
127868
|
const configured = context.env.ZELLIJ_SOCKET_DIR?.trim() || context.env.OPENSCOUT_ZELLIJ_SOCKET_DIR?.trim();
|
|
127171
|
-
return configured ||
|
|
127869
|
+
return configured || join63(context.env.HOME?.trim() || homedir46(), ".openscout", "zellij-sockets");
|
|
127172
127870
|
}
|
|
127173
127871
|
function zellijEnv(context) {
|
|
127174
127872
|
const socketDir = resolveZellijSocketDir(context);
|
|
127175
127873
|
try {
|
|
127176
|
-
|
|
127874
|
+
mkdirSync22(socketDir, { recursive: true });
|
|
127177
127875
|
} catch {
|
|
127178
127876
|
return context.env;
|
|
127179
127877
|
}
|
|
@@ -127474,9 +128172,9 @@ __export(exports_server, {
|
|
|
127474
128172
|
normalizeServerOpenPath: () => normalizeServerOpenPath
|
|
127475
128173
|
});
|
|
127476
128174
|
import { spawn as spawn10 } from "child_process";
|
|
127477
|
-
import { existsSync as
|
|
127478
|
-
import { homedir as
|
|
127479
|
-
import { dirname as dirname31, join as
|
|
128175
|
+
import { existsSync as existsSync52, mkdirSync as mkdirSync23, openSync as openSync2, writeFileSync as writeFileSync17 } from "fs";
|
|
128176
|
+
import { homedir as homedir47 } from "os";
|
|
128177
|
+
import { dirname as dirname31, join as join64, resolve as resolve36 } from "path";
|
|
127480
128178
|
import { fileURLToPath as fileURLToPath12 } from "url";
|
|
127481
128179
|
function renderServerCommandHelp() {
|
|
127482
128180
|
return [
|
|
@@ -127889,9 +128587,9 @@ async function openBrowser(url2) {
|
|
|
127889
128587
|
});
|
|
127890
128588
|
}
|
|
127891
128589
|
function resolveScoutLocalEdgeCaddyfilePath() {
|
|
127892
|
-
const dir =
|
|
127893
|
-
|
|
127894
|
-
return
|
|
128590
|
+
const dir = join64(homedir47(), ".scout", "local-edge");
|
|
128591
|
+
mkdirSync23(dir, { recursive: true });
|
|
128592
|
+
return join64(dir, "Caddyfile");
|
|
127895
128593
|
}
|
|
127896
128594
|
function resolveCaddyExecutable2(env) {
|
|
127897
128595
|
return env.OPENSCOUT_CADDY_BIN?.trim() || "caddy";
|
|
@@ -127914,7 +128612,7 @@ async function runScoutLocalEdge(env) {
|
|
|
127914
128612
|
const config3 = resolveServerLocalEdgeConfig(env);
|
|
127915
128613
|
const schemes = config3.scheme === "both" ? ["http", "https"] : [config3.scheme];
|
|
127916
128614
|
const caddyfilePath = resolveScoutLocalEdgeCaddyfilePath();
|
|
127917
|
-
|
|
128615
|
+
writeFileSync17(caddyfilePath, renderOpenScoutCaddyfile(config3), "utf8");
|
|
127918
128616
|
const mdnsProcesses = schemes.flatMap((scheme) => {
|
|
127919
128617
|
const edgePort = scheme === "https" ? 443 : 80;
|
|
127920
128618
|
const suffix = scheme.toUpperCase();
|
|
@@ -128056,14 +128754,14 @@ __export(exports_setup, {
|
|
|
128056
128754
|
runSetupCommand: () => runSetupCommand,
|
|
128057
128755
|
resolveSetupSourceRoots: () => resolveSetupSourceRoots
|
|
128058
128756
|
});
|
|
128059
|
-
import { existsSync as
|
|
128060
|
-
import { homedir as
|
|
128061
|
-
import { dirname as dirname32, join as
|
|
128757
|
+
import { existsSync as existsSync53 } from "fs";
|
|
128758
|
+
import { homedir as homedir48 } from "os";
|
|
128759
|
+
import { dirname as dirname32, join as join65, resolve as resolve37 } from "path";
|
|
128062
128760
|
import { createInterface as createInterface4 } from "readline/promises";
|
|
128063
128761
|
function findGitRoot2(startDirectory) {
|
|
128064
128762
|
let current = resolve37(startDirectory);
|
|
128065
128763
|
while (true) {
|
|
128066
|
-
if (
|
|
128764
|
+
if (existsSync53(join65(current, ".git")))
|
|
128067
128765
|
return current;
|
|
128068
128766
|
const parent = dirname32(current);
|
|
128069
128767
|
if (parent === current)
|
|
@@ -128071,25 +128769,25 @@ function findGitRoot2(startDirectory) {
|
|
|
128071
128769
|
current = parent;
|
|
128072
128770
|
}
|
|
128073
128771
|
}
|
|
128074
|
-
function suggestProjectSourceRoot(currentDirectory, homeDirectory =
|
|
128772
|
+
function suggestProjectSourceRoot(currentDirectory, homeDirectory = homedir48()) {
|
|
128075
128773
|
const gitRoot = findGitRoot2(currentDirectory);
|
|
128076
128774
|
if (gitRoot && resolve37(gitRoot) !== resolve37(homeDirectory))
|
|
128077
128775
|
return dirname32(gitRoot);
|
|
128078
128776
|
for (const candidate of [
|
|
128079
|
-
|
|
128080
|
-
|
|
128081
|
-
|
|
128777
|
+
join65(homeDirectory, "dev"),
|
|
128778
|
+
join65(homeDirectory, "Developer"),
|
|
128779
|
+
join65(homeDirectory, "Projects")
|
|
128082
128780
|
]) {
|
|
128083
|
-
if (
|
|
128781
|
+
if (existsSync53(candidate))
|
|
128084
128782
|
return candidate;
|
|
128085
128783
|
}
|
|
128086
128784
|
return resolve37(currentDirectory);
|
|
128087
128785
|
}
|
|
128088
|
-
function expandHome(value, homeDirectory =
|
|
128786
|
+
function expandHome(value, homeDirectory = homedir48()) {
|
|
128089
128787
|
if (value === "~")
|
|
128090
128788
|
return homeDirectory;
|
|
128091
128789
|
if (value.startsWith("~/"))
|
|
128092
|
-
return
|
|
128790
|
+
return join65(homeDirectory, value.slice(2));
|
|
128093
128791
|
return value;
|
|
128094
128792
|
}
|
|
128095
128793
|
async function promptForSourceRoot(suggestedRoot, additionalRootCount) {
|
|
@@ -128117,7 +128815,7 @@ async function resolveSetupSourceRoots(context, currentDirectory, sourceRoots, e
|
|
|
128117
128815
|
async function runSetupCommand(context, args) {
|
|
128118
128816
|
const options = parseSetupCommandOptions(args, defaultScoutContextDirectory(context));
|
|
128119
128817
|
const settings = await readOpenScoutSettings({ currentDirectory: options.currentDirectory });
|
|
128120
|
-
const hasSavedSettings =
|
|
128818
|
+
const hasSavedSettings = existsSync53(resolveOpenScoutSupportPaths().settingsPath);
|
|
128121
128819
|
options.sourceRoots = await resolveSetupSourceRoots({ ...context, isTty: context.isTty && Boolean(process.stdin.isTTY) }, options.currentDirectory, options.sourceRoots, {
|
|
128122
128820
|
roots: hasSavedSettings ? settings.discovery.workspaceRoots : [],
|
|
128123
128821
|
answeredAt: hasSavedSettings ? settings.onboarding.sourceRootsAnsweredAt : null
|
|
@@ -128273,6 +128971,206 @@ var init_statusline = __esm(() => {
|
|
|
128273
128971
|
MAX_DELEGATE_OUTPUT_BYTES = 64 * 1024;
|
|
128274
128972
|
});
|
|
128275
128973
|
|
|
128974
|
+
// ../runtime/src/tail/discover.ts
|
|
128975
|
+
function readNonNegativeIntEnv(name2, fallback2) {
|
|
128976
|
+
const raw2 = Number.parseInt(process.env[name2] ?? "", 10);
|
|
128977
|
+
return Number.isFinite(raw2) && raw2 >= 0 ? raw2 : fallback2;
|
|
128978
|
+
}
|
|
128979
|
+
var PROCESS_LIST_CACHE_MS;
|
|
128980
|
+
var init_discover = __esm(() => {
|
|
128981
|
+
init_ps();
|
|
128982
|
+
PROCESS_LIST_CACHE_MS = readNonNegativeIntEnv("OPENSCOUT_TAIL_PROCESS_CACHE_MS", 1000);
|
|
128983
|
+
});
|
|
128984
|
+
|
|
128985
|
+
// ../runtime/src/tail/tool-format.ts
|
|
128986
|
+
var init_tool_format = () => {};
|
|
128987
|
+
|
|
128988
|
+
// ../runtime/src/tail/claude-source.ts
|
|
128989
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS, DEFAULT_DEEP_DISCOVERY_WINDOW_MS, HEAD_READ_BYTES, TAIL_READ_BYTES, metadataCache;
|
|
128990
|
+
var init_claude_source = __esm(() => {
|
|
128991
|
+
init_user_config();
|
|
128992
|
+
init_discover();
|
|
128993
|
+
init_tool_format();
|
|
128994
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS = 10 * 60 * 1000;
|
|
128995
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
128996
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
128997
|
+
HEAD_READ_BYTES = 256 * 1024;
|
|
128998
|
+
TAIL_READ_BYTES = 512 * 1024;
|
|
128999
|
+
metadataCache = new Map;
|
|
129000
|
+
});
|
|
129001
|
+
|
|
129002
|
+
// ../runtime/src/tail/codex-source.ts
|
|
129003
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS2, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS2, DEFAULT_DEEP_DISCOVERY_WINDOW_MS2, HEAD_READ_BYTES2, metadataCache2;
|
|
129004
|
+
var init_codex_source = __esm(() => {
|
|
129005
|
+
init_discover();
|
|
129006
|
+
init_tool_format();
|
|
129007
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS2 = 10 * 60 * 1000;
|
|
129008
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS2 = 24 * 60 * 60 * 1000;
|
|
129009
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS2 = 24 * 60 * 60 * 1000;
|
|
129010
|
+
HEAD_READ_BYTES2 = 512 * 1024;
|
|
129011
|
+
metadataCache2 = new Map;
|
|
129012
|
+
});
|
|
129013
|
+
|
|
129014
|
+
// ../runtime/src/tail/cursor-source.ts
|
|
129015
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS3, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS3, DEFAULT_DEEP_DISCOVERY_WINDOW_MS3, HEAD_READ_BYTES3;
|
|
129016
|
+
var init_cursor_source = __esm(() => {
|
|
129017
|
+
init_discover();
|
|
129018
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS3 = 10 * 60 * 1000;
|
|
129019
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS3 = 24 * 60 * 60 * 1000;
|
|
129020
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS3 = 24 * 60 * 60 * 1000;
|
|
129021
|
+
HEAD_READ_BYTES3 = 512 * 1024;
|
|
129022
|
+
});
|
|
129023
|
+
|
|
129024
|
+
// ../runtime/src/tail/grok-source.ts
|
|
129025
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS4, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS4, DEFAULT_DEEP_DISCOVERY_WINDOW_MS4, HEAD_READ_BYTES4, grokToolCallMatchers, metadataCache3;
|
|
129026
|
+
var init_grok_source = __esm(() => {
|
|
129027
|
+
init_discover();
|
|
129028
|
+
init_tool_format();
|
|
129029
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS4 = 10 * 60 * 1000;
|
|
129030
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS4 = 24 * 60 * 60 * 1000;
|
|
129031
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS4 = 24 * 60 * 60 * 1000;
|
|
129032
|
+
HEAD_READ_BYTES4 = 256 * 1024;
|
|
129033
|
+
grokToolCallMatchers = new Map;
|
|
129034
|
+
metadataCache3 = new Map;
|
|
129035
|
+
});
|
|
129036
|
+
|
|
129037
|
+
// ../runtime/src/tail/kimi-source.ts
|
|
129038
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS5, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS5, DEFAULT_DEEP_DISCOVERY_WINDOW_MS5, metadataCache4;
|
|
129039
|
+
var init_kimi_source = __esm(() => {
|
|
129040
|
+
init_discover();
|
|
129041
|
+
init_tool_format();
|
|
129042
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS5 = 10 * 60 * 1000;
|
|
129043
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS5 = 24 * 60 * 60 * 1000;
|
|
129044
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS5 = 24 * 60 * 60 * 1000;
|
|
129045
|
+
metadataCache4 = new Map;
|
|
129046
|
+
});
|
|
129047
|
+
|
|
129048
|
+
// ../runtime/src/tail/opencode-source.ts
|
|
129049
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS6, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS6, DEFAULT_DEEP_DISCOVERY_WINDOW_MS6, HEAD_READ_BYTES5;
|
|
129050
|
+
var init_opencode_source = __esm(() => {
|
|
129051
|
+
init_discover();
|
|
129052
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS6 = 10 * 60 * 1000;
|
|
129053
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS6 = 24 * 60 * 60 * 1000;
|
|
129054
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS6 = 24 * 60 * 60 * 1000;
|
|
129055
|
+
HEAD_READ_BYTES5 = 128 * 1024;
|
|
129056
|
+
});
|
|
129057
|
+
|
|
129058
|
+
// ../runtime/src/tail/pi-source.ts
|
|
129059
|
+
var DEFAULT_HOT_DISCOVERY_WINDOW_MS7, DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS7, DEFAULT_DEEP_DISCOVERY_WINDOW_MS7, HEAD_READ_BYTES6, metadataCache5;
|
|
129060
|
+
var init_pi_source = __esm(() => {
|
|
129061
|
+
init_discover();
|
|
129062
|
+
init_tool_format();
|
|
129063
|
+
DEFAULT_HOT_DISCOVERY_WINDOW_MS7 = 10 * 60 * 1000;
|
|
129064
|
+
DEFAULT_SHALLOW_DISCOVERY_WINDOW_MS7 = 24 * 60 * 60 * 1000;
|
|
129065
|
+
DEFAULT_DEEP_DISCOVERY_WINDOW_MS7 = 24 * 60 * 60 * 1000;
|
|
129066
|
+
HEAD_READ_BYTES6 = 256 * 1024;
|
|
129067
|
+
metadataCache5 = new Map;
|
|
129068
|
+
});
|
|
129069
|
+
// ../runtime/src/tail/service.ts
|
|
129070
|
+
function readPositiveIntEnv(name2, fallback2) {
|
|
129071
|
+
const raw2 = Number.parseInt(process.env[name2] ?? "", 10);
|
|
129072
|
+
return Number.isFinite(raw2) && raw2 > 0 ? raw2 : fallback2;
|
|
129073
|
+
}
|
|
129074
|
+
var TAIL_POLL_INTERVAL_MS, HOT_DISCOVERY_INTERVAL_MS, DISCOVERY_CACHE_MAX_AGE_MS, SHALLOW_DISCOVERY_INTERVAL_MS, DEEP_DISCOVERY_INTERVAL_MS, QUIET_EVENT_COALESCE_WINDOW_MS, QUIET_EVENT_COALESCE_MAX_KEYS, RECENT_TRANSCRIPT_READ_BYTES, SESSION_TRANSCRIPT_READ_BYTES, RECENT_TRANSCRIPT_MAX_FILES, NATIVE_TAIL_SOURCES, watchers, perSessionBuffer, subscribers, knownTranscripts, quietEventLastSeen, GROK_QUIET_PHASES;
|
|
129075
|
+
var init_service10 = __esm(() => {
|
|
129076
|
+
init_claude_source();
|
|
129077
|
+
init_codex_source();
|
|
129078
|
+
init_cursor_source();
|
|
129079
|
+
init_grok_source();
|
|
129080
|
+
init_kimi_source();
|
|
129081
|
+
init_opencode_source();
|
|
129082
|
+
init_pi_source();
|
|
129083
|
+
TAIL_POLL_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_POLL_INTERVAL_MS", 500);
|
|
129084
|
+
HOT_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_HOT_DISCOVERY_INTERVAL_MS", 30000);
|
|
129085
|
+
DISCOVERY_CACHE_MAX_AGE_MS = readPositiveIntEnv("OPENSCOUT_TAIL_DISCOVERY_CACHE_MAX_AGE_MS", HOT_DISCOVERY_INTERVAL_MS);
|
|
129086
|
+
SHALLOW_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_SHALLOW_DISCOVERY_INTERVAL_MS", 10 * 60000);
|
|
129087
|
+
DEEP_DISCOVERY_INTERVAL_MS = readPositiveIntEnv("OPENSCOUT_TAIL_DEEP_DISCOVERY_INTERVAL_MS", 60 * 60000);
|
|
129088
|
+
QUIET_EVENT_COALESCE_WINDOW_MS = readPositiveIntEnv("OPENSCOUT_TAIL_QUIET_EVENT_COALESCE_WINDOW_MS", 5000);
|
|
129089
|
+
QUIET_EVENT_COALESCE_MAX_KEYS = readPositiveIntEnv("OPENSCOUT_TAIL_QUIET_EVENT_COALESCE_MAX_KEYS", 2000);
|
|
129090
|
+
RECENT_TRANSCRIPT_READ_BYTES = 512 * 1024;
|
|
129091
|
+
SESSION_TRANSCRIPT_READ_BYTES = 8 * 1024 * 1024;
|
|
129092
|
+
RECENT_TRANSCRIPT_MAX_FILES = readPositiveIntEnv("OPENSCOUT_TAIL_RECENT_TRANSCRIPT_MAX_FILES", 24);
|
|
129093
|
+
NATIVE_TAIL_SOURCES = new Set(["grok", "kimi", "opencode", "cursor"]);
|
|
129094
|
+
watchers = new Map;
|
|
129095
|
+
perSessionBuffer = new Map;
|
|
129096
|
+
subscribers = new Set;
|
|
129097
|
+
knownTranscripts = new Map;
|
|
129098
|
+
quietEventLastSeen = new Map;
|
|
129099
|
+
GROK_QUIET_PHASES = new Set([
|
|
129100
|
+
"streaming_reasoning",
|
|
129101
|
+
"streaming_text",
|
|
129102
|
+
"tool_execution",
|
|
129103
|
+
"permission_prompt"
|
|
129104
|
+
]);
|
|
129105
|
+
});
|
|
129106
|
+
|
|
129107
|
+
// ../runtime/src/tail/display.ts
|
|
129108
|
+
function isCodexChunkToolResult(summary) {
|
|
129109
|
+
const trimmed = summary.trim();
|
|
129110
|
+
return trimmed.startsWith("-> Chunk ID:") || /^->\s+Wall time:/u.test(trimmed);
|
|
129111
|
+
}
|
|
129112
|
+
function isCursorProcessSample(event) {
|
|
129113
|
+
if (event.source !== "cursor" || event.kind !== "system")
|
|
129114
|
+
return false;
|
|
129115
|
+
const summary = event.summary.trim().toLowerCase();
|
|
129116
|
+
return summary === "process sample" || summary.startsWith("process sample \xB7");
|
|
129117
|
+
}
|
|
129118
|
+
function isTailNoiseEvent(event) {
|
|
129119
|
+
if (isCursorProcessSample(event))
|
|
129120
|
+
return true;
|
|
129121
|
+
if (event.source === "grok") {
|
|
129122
|
+
const summary2 = event.summary.trim().toLowerCase();
|
|
129123
|
+
if (summary2 === "first token" || summary2.startsWith("loop ")) {
|
|
129124
|
+
return true;
|
|
129125
|
+
}
|
|
129126
|
+
if (!summary2.startsWith("phase \xB7"))
|
|
129127
|
+
return false;
|
|
129128
|
+
const phase = summary2.slice("phase \xB7".length).trim();
|
|
129129
|
+
return GROK_STREAMING_PHASES.has(phase);
|
|
129130
|
+
}
|
|
129131
|
+
if (event.source !== "codex")
|
|
129132
|
+
return false;
|
|
129133
|
+
if (event.kind === "tool-result") {
|
|
129134
|
+
const summary2 = event.summary.trim();
|
|
129135
|
+
if (isCodexChunkToolResult(summary2))
|
|
129136
|
+
return true;
|
|
129137
|
+
if (/_end \u00B7/u.test(summary2))
|
|
129138
|
+
return true;
|
|
129139
|
+
if (summary2.startsWith("->"))
|
|
129140
|
+
return true;
|
|
129141
|
+
}
|
|
129142
|
+
if (event.kind !== "system")
|
|
129143
|
+
return false;
|
|
129144
|
+
const summary = event.summary.trim().toLowerCase();
|
|
129145
|
+
if (summary === "user_message" || summary === "agent_message")
|
|
129146
|
+
return true;
|
|
129147
|
+
if (summary === "[reasoning]")
|
|
129148
|
+
return true;
|
|
129149
|
+
if (summary.startsWith("turn context"))
|
|
129150
|
+
return true;
|
|
129151
|
+
if (summary.startsWith("tokens \xB7"))
|
|
129152
|
+
return true;
|
|
129153
|
+
if (summary.startsWith("session "))
|
|
129154
|
+
return true;
|
|
129155
|
+
return false;
|
|
129156
|
+
}
|
|
129157
|
+
var GROK_STREAMING_PHASES;
|
|
129158
|
+
var init_display = __esm(() => {
|
|
129159
|
+
GROK_STREAMING_PHASES = new Set([
|
|
129160
|
+
"streaming_reasoning",
|
|
129161
|
+
"streaming_text",
|
|
129162
|
+
"tool_execution",
|
|
129163
|
+
"permission_prompt",
|
|
129164
|
+
"waiting_for_model"
|
|
129165
|
+
]);
|
|
129166
|
+
});
|
|
129167
|
+
|
|
129168
|
+
// ../runtime/src/tail/index.ts
|
|
129169
|
+
var init_tail = __esm(() => {
|
|
129170
|
+
init_service10();
|
|
129171
|
+
init_display();
|
|
129172
|
+
});
|
|
129173
|
+
|
|
128276
129174
|
// ../../apps/desktop/src/cli/commands/tail.ts
|
|
128277
129175
|
var exports_tail = {};
|
|
128278
129176
|
__export(exports_tail, {
|
|
@@ -128287,6 +129185,7 @@ function renderTailCommandHelp() {
|
|
|
128287
129185
|
"Usage: scout tail [options]",
|
|
128288
129186
|
"",
|
|
128289
129187
|
"Stream observed harness events from the broker tail firehose.",
|
|
129188
|
+
"Plain output hides harness lifecycle noise; --json stays complete.",
|
|
128290
129189
|
"",
|
|
128291
129190
|
"Filters:",
|
|
128292
129191
|
" --source <name> Runtime source such as claude or codex; repeatable",
|
|
@@ -128301,11 +129200,13 @@ function renderTailCommandHelp() {
|
|
|
128301
129200
|
" --since <event-id> Resume live streaming after a TailEvent id cursor",
|
|
128302
129201
|
" --once Print the backlog and exit",
|
|
128303
129202
|
" --transcripts Include recent file-backed transcript events in the initial backlog",
|
|
128304
|
-
" --
|
|
128305
|
-
" --
|
|
129203
|
+
" --verbose, --debug Show the full firehose including lifecycle noise",
|
|
129204
|
+
" --raw Unfiltered plain output plus bounded raw payload JSON",
|
|
129205
|
+
" --json Emit JSON (streaming mode uses NDJSON); complete events",
|
|
128306
129206
|
"",
|
|
128307
129207
|
"Examples:",
|
|
128308
129208
|
" scout tail",
|
|
129209
|
+
" scout tail --verbose",
|
|
128309
129210
|
" scout tail --source codex --kind tool-result",
|
|
128310
129211
|
" scout tail --project openscout --query permission --once",
|
|
128311
129212
|
" scout tail --transcripts --limit 200 --json"
|
|
@@ -128324,6 +129225,7 @@ function parseTailCommandOptions(args) {
|
|
|
128324
129225
|
let once2 = false;
|
|
128325
129226
|
let transcripts = false;
|
|
128326
129227
|
let raw2 = false;
|
|
129228
|
+
let verbose = false;
|
|
128327
129229
|
for (let index2 = 0;index2 < args.length; index2 += 1) {
|
|
128328
129230
|
const arg = args[index2] ?? "";
|
|
128329
129231
|
if (arg === "--once") {
|
|
@@ -128346,6 +129248,10 @@ function parseTailCommandOptions(args) {
|
|
|
128346
129248
|
raw2 = true;
|
|
128347
129249
|
continue;
|
|
128348
129250
|
}
|
|
129251
|
+
if (arg === "--verbose" || arg === "--debug") {
|
|
129252
|
+
verbose = true;
|
|
129253
|
+
continue;
|
|
129254
|
+
}
|
|
128349
129255
|
if (arg === "--source") {
|
|
128350
129256
|
sources.push(...parseCsvFlag(args[++index2], "--source"));
|
|
128351
129257
|
continue;
|
|
@@ -128430,7 +129336,8 @@ function parseTailCommandOptions(args) {
|
|
|
128430
129336
|
...since ? { since } : {},
|
|
128431
129337
|
once: once2,
|
|
128432
129338
|
transcripts,
|
|
128433
|
-
raw: raw2
|
|
129339
|
+
raw: raw2,
|
|
129340
|
+
verbose
|
|
128434
129341
|
};
|
|
128435
129342
|
}
|
|
128436
129343
|
async function runTailCommand(context, args) {
|
|
@@ -128449,8 +129356,18 @@ async function runTailCommand(context, args) {
|
|
|
128449
129356
|
query: options.query,
|
|
128450
129357
|
transcripts: options.transcripts
|
|
128451
129358
|
});
|
|
129359
|
+
const renderOptions = {
|
|
129360
|
+
raw: options.raw,
|
|
129361
|
+
verbose: options.verbose,
|
|
129362
|
+
color: process.stdout.isTTY === true
|
|
129363
|
+
};
|
|
128452
129364
|
if (options.once) {
|
|
128453
|
-
context.output.writeValue(initial, (value) =>
|
|
129365
|
+
context.output.writeValue(initial, (value) => {
|
|
129366
|
+
if (value.events.length === 0)
|
|
129367
|
+
return "No tail events found.";
|
|
129368
|
+
const rendered = renderTailEvents(value.events, renderOptions);
|
|
129369
|
+
return rendered || "No tail events found.";
|
|
129370
|
+
});
|
|
128454
129371
|
return;
|
|
128455
129372
|
}
|
|
128456
129373
|
const emitEvent = (event) => {
|
|
@@ -128460,7 +129377,9 @@ async function runTailCommand(context, args) {
|
|
|
128460
129377
|
context.stdout(JSON.stringify(event));
|
|
128461
129378
|
return;
|
|
128462
129379
|
}
|
|
128463
|
-
|
|
129380
|
+
if (!includeTailEvent(event, renderOptions))
|
|
129381
|
+
return;
|
|
129382
|
+
context.stdout(renderTailEvent(event, renderOptions));
|
|
128464
129383
|
};
|
|
128465
129384
|
for (const event of initial.events) {
|
|
128466
129385
|
emitEvent(event);
|
|
@@ -128469,10 +129388,6 @@ async function runTailCommand(context, args) {
|
|
|
128469
129388
|
const shutdown = () => controller.abort();
|
|
128470
129389
|
process.on("SIGINT", shutdown);
|
|
128471
129390
|
try {
|
|
128472
|
-
if (context.output.mode === "plain") {
|
|
128473
|
-
const sourceText = options.sources?.length ? options.sources.join(",") : "all sources";
|
|
128474
|
-
context.stderr(`Following tail (${sourceText})`);
|
|
128475
|
-
}
|
|
128476
129391
|
await watchScoutTailEvents({
|
|
128477
129392
|
since: options.since ?? initial.cursor ?? undefined,
|
|
128478
129393
|
sources: options.sources,
|
|
@@ -128484,24 +129399,38 @@ async function runTailCommand(context, args) {
|
|
|
128484
129399
|
}
|
|
128485
129400
|
}
|
|
128486
129401
|
function renderTailEvents(events2, options = {}) {
|
|
128487
|
-
|
|
129402
|
+
const visible = events2.filter((event) => includeTailEvent(event, options));
|
|
129403
|
+
return visible.map((event) => renderTailEvent(event, options)).join(`
|
|
128488
129404
|
`);
|
|
128489
129405
|
}
|
|
128490
129406
|
function renderTailEvent(event, options = {}) {
|
|
128491
|
-
const
|
|
128492
|
-
|
|
128493
|
-
|
|
128494
|
-
|
|
128495
|
-
|
|
128496
|
-
|
|
128497
|
-
|
|
128498
|
-
const line =
|
|
129407
|
+
const columns2 = resolveColumns(options.columns);
|
|
129408
|
+
const color = options.color ?? false;
|
|
129409
|
+
const clock = formatClock(event.ts);
|
|
129410
|
+
const name2 = event.source.slice(0, 6);
|
|
129411
|
+
const source = name2.padEnd(6, " ");
|
|
129412
|
+
const rest = options.verbose || options.raw ? compactTailSummary(event.summary, Math.max(8, columns2 - 16)) : sceneRest(event, Math.max(8, columns2 - 14));
|
|
129413
|
+
const painted = color ? `${dim(clock)} ${paint(sourceColor(event.source), name2)}${" ".repeat(Math.max(0, 6 - name2.length))} ${rest}` : `${clock} ${source} ${rest}`;
|
|
129414
|
+
const line = clipVisible(painted, columns2);
|
|
128499
129415
|
if (!options.raw || event.raw === undefined) {
|
|
128500
129416
|
return line;
|
|
128501
129417
|
}
|
|
128502
129418
|
return `${line}
|
|
128503
129419
|
${JSON.stringify(event.raw, null, 2)}`;
|
|
128504
129420
|
}
|
|
129421
|
+
function includeTailEvent(event, options) {
|
|
129422
|
+
if (options.verbose || options.raw)
|
|
129423
|
+
return true;
|
|
129424
|
+
if (isTailNoiseEvent(event))
|
|
129425
|
+
return false;
|
|
129426
|
+
const summary = event.summary.trim().toLowerCase();
|
|
129427
|
+
if (summary.startsWith("permission requested") || summary.startsWith("permission allow")) {
|
|
129428
|
+
return false;
|
|
129429
|
+
}
|
|
129430
|
+
if (event.kind === "tool")
|
|
129431
|
+
return false;
|
|
129432
|
+
return true;
|
|
129433
|
+
}
|
|
128505
129434
|
function tailEventMatches(event, options) {
|
|
128506
129435
|
if (options.sources?.length && !options.sources.includes(event.source))
|
|
128507
129436
|
return false;
|
|
@@ -128564,22 +129493,122 @@ function formatClock(ts) {
|
|
|
128564
129493
|
return new Date(ts).toLocaleTimeString("en-US", {
|
|
128565
129494
|
hour12: false,
|
|
128566
129495
|
hour: "2-digit",
|
|
128567
|
-
minute: "2-digit"
|
|
128568
|
-
second: "2-digit"
|
|
129496
|
+
minute: "2-digit"
|
|
128569
129497
|
});
|
|
128570
129498
|
}
|
|
129499
|
+
function resolveColumns(explicit) {
|
|
129500
|
+
if (typeof explicit === "number" && Number.isFinite(explicit) && explicit > 0) {
|
|
129501
|
+
return Math.floor(explicit);
|
|
129502
|
+
}
|
|
129503
|
+
const detected = process.stdout.columns;
|
|
129504
|
+
if (typeof detected === "number" && Number.isFinite(detected) && detected > 0) {
|
|
129505
|
+
return detected;
|
|
129506
|
+
}
|
|
129507
|
+
return FALLBACK_COLUMNS;
|
|
129508
|
+
}
|
|
129509
|
+
function compactTailSummary(summary, maxLength) {
|
|
129510
|
+
const normalized = flatten(summary).replace(/\/Users\/[^/\s]+\//g, "~/");
|
|
129511
|
+
const shortened = normalized.replace(/(?:~|\/)[^\s]+/g, shortenPathToken);
|
|
129512
|
+
return compact2(shortened, maxLength);
|
|
129513
|
+
}
|
|
129514
|
+
function sceneRest(event, maxLength) {
|
|
129515
|
+
if (event.kind === "assistant" || event.kind === "user") {
|
|
129516
|
+
return compact2(flatten(event.summary), maxLength);
|
|
129517
|
+
}
|
|
129518
|
+
const { verb, noun } = sceneWork(event.summary);
|
|
129519
|
+
if (!noun)
|
|
129520
|
+
return compact2(verb, maxLength);
|
|
129521
|
+
return compact2(`${verb} ${noun}`, maxLength);
|
|
129522
|
+
}
|
|
129523
|
+
function sceneWork(summary) {
|
|
129524
|
+
const normalized = flatten(summary).replace(/\s+\u00B7\s+(success|error|failed)$/i, "").replace(/\/Users\/[^/\s]+\//g, "~/");
|
|
129525
|
+
const [head = "", ...tail2] = normalized.split(/\s+\u00B7\s+/);
|
|
129526
|
+
const rawVerb = head.trim();
|
|
129527
|
+
const rest = tail2.join(" \xB7 ").trim();
|
|
129528
|
+
let verb = rawVerb.toLowerCase();
|
|
129529
|
+
for (const [pattern, name2] of WORK_VERBS) {
|
|
129530
|
+
if (pattern.test(rawVerb)) {
|
|
129531
|
+
verb = name2;
|
|
129532
|
+
break;
|
|
129533
|
+
}
|
|
129534
|
+
}
|
|
129535
|
+
return { verb, noun: sceneNoun(verb, rest || rawVerb) };
|
|
129536
|
+
}
|
|
129537
|
+
function sceneNoun(verb, rest) {
|
|
129538
|
+
const pathMatch = rest.match(/(\S+\.\w+)\b/);
|
|
129539
|
+
if (pathMatch?.[1]) {
|
|
129540
|
+
const parts = pathMatch[1].split(/[\\/]/);
|
|
129541
|
+
return parts.at(-1) ?? pathMatch[1];
|
|
129542
|
+
}
|
|
129543
|
+
if (verb === "run") {
|
|
129544
|
+
const tokens = rest.split(/\s+/).filter((token) => token.length > 0 && !token.includes("="));
|
|
129545
|
+
const cmd = tokens.find((token) => !token.startsWith("-")) ?? tokens[0];
|
|
129546
|
+
if (cmd && cmd !== "run" && cmd !== "run_terminal_command") {
|
|
129547
|
+
return cmd.replace(/^.*\//, "");
|
|
129548
|
+
}
|
|
129549
|
+
return "";
|
|
129550
|
+
}
|
|
129551
|
+
const shortened = rest.replace(/(?:~|\/)[^\s]+/g, shortenPathToken);
|
|
129552
|
+
if (shortened === verb)
|
|
129553
|
+
return "";
|
|
129554
|
+
return shortened;
|
|
129555
|
+
}
|
|
129556
|
+
function shortenPathToken(token) {
|
|
129557
|
+
const folded = token.replace(/\/Users\/[^/\s]+\//g, "~/");
|
|
129558
|
+
const segments = folded.split(/[\\/]/).filter(Boolean);
|
|
129559
|
+
if (segments.length <= 2)
|
|
129560
|
+
return folded;
|
|
129561
|
+
if (!folded.startsWith("~/") && !folded.startsWith("/"))
|
|
129562
|
+
return folded;
|
|
129563
|
+
return segments.slice(-2).join("/");
|
|
129564
|
+
}
|
|
129565
|
+
function flatten(value) {
|
|
129566
|
+
return value.replace(/\s+/g, " ").trim();
|
|
129567
|
+
}
|
|
129568
|
+
function sourceColor(source) {
|
|
129569
|
+
return SOURCE_COLOR[source.toLowerCase()] ?? "38;5;245";
|
|
129570
|
+
}
|
|
129571
|
+
function paint(code, text3) {
|
|
129572
|
+
return `\x1B[${code}m${text3}\x1B[0m`;
|
|
129573
|
+
}
|
|
129574
|
+
function dim(text3) {
|
|
129575
|
+
return paint("2", text3);
|
|
129576
|
+
}
|
|
129577
|
+
function visibleWidth(value) {
|
|
129578
|
+
return value.replace(ANSI_RE, "").length;
|
|
129579
|
+
}
|
|
129580
|
+
function clipVisible(line, columns2) {
|
|
129581
|
+
const budget2 = Math.max(1, columns2);
|
|
129582
|
+
if (visibleWidth(line) <= budget2)
|
|
129583
|
+
return line;
|
|
129584
|
+
const limit = Math.max(0, budget2 - 1);
|
|
129585
|
+
let width = 0;
|
|
129586
|
+
let out = "";
|
|
129587
|
+
let i = 0;
|
|
129588
|
+
while (i < line.length && width < limit) {
|
|
129589
|
+
if (line[i] === "\x1B") {
|
|
129590
|
+
const match2 = line.slice(i).match(/^\x1b\[[0-9;]*m/);
|
|
129591
|
+
if (match2) {
|
|
129592
|
+
out += match2[0];
|
|
129593
|
+
i += match2[0].length;
|
|
129594
|
+
continue;
|
|
129595
|
+
}
|
|
129596
|
+
}
|
|
129597
|
+
out += line[i];
|
|
129598
|
+
width += 1;
|
|
129599
|
+
i += 1;
|
|
129600
|
+
}
|
|
129601
|
+
return `${out}\u2026${out.includes("\x1B[") ? "\x1B[0m" : ""}`;
|
|
129602
|
+
}
|
|
128571
129603
|
function compact2(value, maxLength) {
|
|
128572
|
-
const normalized = value
|
|
129604
|
+
const normalized = flatten(value);
|
|
128573
129605
|
if (normalized.length <= maxLength)
|
|
128574
129606
|
return normalized;
|
|
128575
129607
|
return `${normalized.slice(0, Math.max(0, maxLength - 1))}\u2026`;
|
|
128576
129608
|
}
|
|
128577
|
-
|
|
128578
|
-
|
|
128579
|
-
|
|
128580
|
-
}
|
|
128581
|
-
var HELP_FLAGS20, TAIL_EVENT_KINDS;
|
|
128582
|
-
var init_tail = __esm(() => {
|
|
129609
|
+
var HELP_FLAGS20, TAIL_EVENT_KINDS, FALLBACK_COLUMNS = 80, ANSI_RE, SOURCE_COLOR, WORK_VERBS;
|
|
129610
|
+
var init_tail2 = __esm(() => {
|
|
129611
|
+
init_tail();
|
|
128583
129612
|
init_errors();
|
|
128584
129613
|
init_service6();
|
|
128585
129614
|
HELP_FLAGS20 = new Set(["--help", "-h"]);
|
|
@@ -128591,6 +129620,25 @@ var init_tail = __esm(() => {
|
|
|
128591
129620
|
"system",
|
|
128592
129621
|
"other"
|
|
128593
129622
|
]);
|
|
129623
|
+
ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
129624
|
+
SOURCE_COLOR = {
|
|
129625
|
+
grok: "38;5;216",
|
|
129626
|
+
claude: "38;5;173",
|
|
129627
|
+
kimi: "38;5;140",
|
|
129628
|
+
omp: "38;5;73",
|
|
129629
|
+
codex: "38;5;110",
|
|
129630
|
+
cursor: "38;5;108"
|
|
129631
|
+
};
|
|
129632
|
+
WORK_VERBS = [
|
|
129633
|
+
[/^(read_file|read)\b/i, "read"],
|
|
129634
|
+
[/^(search_replace|strreplace|edit)\b/i, "edit"],
|
|
129635
|
+
[/^(write_file|write)\b/i, "write"],
|
|
129636
|
+
[/^(run_terminal_command|bash|shell)\b/i, "run"],
|
|
129637
|
+
[/^(grep)\b/i, "grep"],
|
|
129638
|
+
[/^(glob|find)\b/i, "find"],
|
|
129639
|
+
[/^(web_search|websearch)\b/i, "search"],
|
|
129640
|
+
[/^(web_fetch|webfetch|open_page|open_page_with_find)\b/i, "fetch"]
|
|
129641
|
+
];
|
|
128594
129642
|
});
|
|
128595
129643
|
|
|
128596
129644
|
// ../../node_modules/.bun/@opentui+core@0.1.96+a7e4efcb39f2fc50/node_modules/@opentui/core/assets/javascript/highlights.scm
|
|
@@ -128645,8 +129693,8 @@ import { EventEmitter as EventEmitter2 } from "events";
|
|
|
128645
129693
|
import { resolve as resolve38, dirname as dirname33 } from "path";
|
|
128646
129694
|
import { fileURLToPath as fileURLToPath13 } from "url";
|
|
128647
129695
|
import { resolve as resolve210, isAbsolute as isAbsolute9, parse as parse8 } from "path";
|
|
128648
|
-
import { existsSync as
|
|
128649
|
-
import { basename as basename23, join as
|
|
129696
|
+
import { existsSync as existsSync54 } from "fs";
|
|
129697
|
+
import { basename as basename23, join as join66 } from "path";
|
|
128650
129698
|
import os from "os";
|
|
128651
129699
|
import path2 from "path";
|
|
128652
129700
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
@@ -128657,7 +129705,7 @@ import { mkdir as mkdir14, readFile as readFile17, writeFile as writeFile11 } fr
|
|
|
128657
129705
|
import * as path3 from "path";
|
|
128658
129706
|
import { readdir as readdir4 } from "fs/promises";
|
|
128659
129707
|
import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr4 } from "bun:ffi";
|
|
128660
|
-
import { existsSync as existsSync210, writeFileSync as
|
|
129708
|
+
import { existsSync as existsSync210, writeFileSync as writeFileSync18 } from "fs";
|
|
128661
129709
|
import { EventEmitter as EventEmitter4 } from "events";
|
|
128662
129710
|
import { toArrayBuffer as toArrayBuffer2, ptr } from "bun:ffi";
|
|
128663
129711
|
import { ptr as ptr2, toArrayBuffer as toArrayBuffer22 } from "bun:ffi";
|
|
@@ -129252,7 +130300,7 @@ function createTextAttributes({
|
|
|
129252
130300
|
bold = false,
|
|
129253
130301
|
italic = false,
|
|
129254
130302
|
underline = false,
|
|
129255
|
-
dim = false,
|
|
130303
|
+
dim: dim2 = false,
|
|
129256
130304
|
blink = false,
|
|
129257
130305
|
inverse = false,
|
|
129258
130306
|
hidden = false,
|
|
@@ -129265,7 +130313,7 @@ function createTextAttributes({
|
|
|
129265
130313
|
attributes3 |= TextAttributes.ITALIC;
|
|
129266
130314
|
if (underline)
|
|
129267
130315
|
attributes3 |= TextAttributes.UNDERLINE;
|
|
129268
|
-
if (
|
|
130316
|
+
if (dim2)
|
|
129269
130317
|
attributes3 |= TextAttributes.DIM;
|
|
129270
130318
|
if (blink)
|
|
129271
130319
|
attributes3 |= TextAttributes.BLINK;
|
|
@@ -131937,7 +132985,7 @@ function getBunfsRootPath() {
|
|
|
131937
132985
|
return process.platform === "win32" ? "B:\\~BUN\\root" : "/$bunfs/root";
|
|
131938
132986
|
}
|
|
131939
132987
|
function normalizeBunfsPath(fileName) {
|
|
131940
|
-
return
|
|
132988
|
+
return join66(getBunfsRootPath(), basename23(fileName));
|
|
131941
132989
|
}
|
|
131942
132990
|
function addDefaultParsers(parsers) {
|
|
131943
132991
|
for (const parser of parsers) {
|
|
@@ -135265,7 +136313,7 @@ function convertToDebugSymbols(symbols) {
|
|
|
135265
136313
|
if (env.OTUI_DEBUG_FFI && globalFFILogPath) {
|
|
135266
136314
|
const logPath = globalFFILogPath;
|
|
135267
136315
|
const writeSync = (msg) => {
|
|
135268
|
-
|
|
136316
|
+
writeFileSync18(logPath, msg + `
|
|
135269
136317
|
`, { flag: "a" });
|
|
135270
136318
|
};
|
|
135271
136319
|
Object.entries(symbols).forEach(([key, value]) => {
|
|
@@ -137691,7 +138739,7 @@ var __defProp4, __returnValue2 = (v) => v, __export2 = (target2, all) => {
|
|
|
137691
138739
|
configurable: true,
|
|
137692
138740
|
set: __exportSetter2.bind(all, name2)
|
|
137693
138741
|
});
|
|
137694
|
-
}, exports_src, loadYoga, yoga_wasm_base64_esm_default, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants5, YGEnums_default, Yoga, src_default, VALID_BORDER_STYLES, BorderChars, BorderCharArrays, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, ATTRIBUTE_BASE_BITS = 8, ATTRIBUTE_BASE_MASK = 255, DebugOverlayCorner, TargetChannel, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, black = (input) => applyStyle(input, { fg: "black" }), red = (input) => applyStyle(input, { fg: "red" }), green = (input) => applyStyle(input, { fg: "green" }), yellow = (input) => applyStyle(input, { fg: "yellow" }), blue = (input) => applyStyle(input, { fg: "blue" }), magenta = (input) => applyStyle(input, { fg: "magenta" }), cyan = (input) => applyStyle(input, { fg: "cyan" }), white = (input) => applyStyle(input, { fg: "white" }), brightBlack = (input) => applyStyle(input, { fg: "brightBlack" }), brightRed = (input) => applyStyle(input, { fg: "brightRed" }), brightGreen = (input) => applyStyle(input, { fg: "brightGreen" }), brightYellow = (input) => applyStyle(input, { fg: "brightYellow" }), brightBlue = (input) => applyStyle(input, { fg: "brightBlue" }), brightMagenta = (input) => applyStyle(input, { fg: "brightMagenta" }), brightCyan = (input) => applyStyle(input, { fg: "brightCyan" }), brightWhite = (input) => applyStyle(input, { fg: "brightWhite" }), bgBlack = (input) => applyStyle(input, { bg: "black" }), bgRed = (input) => applyStyle(input, { bg: "red" }), bgGreen = (input) => applyStyle(input, { bg: "green" }), bgYellow = (input) => applyStyle(input, { bg: "yellow" }), bgBlue = (input) => applyStyle(input, { bg: "blue" }), bgMagenta = (input) => applyStyle(input, { bg: "magenta" }), bgCyan = (input) => applyStyle(input, { bg: "cyan" }), bgWhite = (input) => applyStyle(input, { bg: "white" }), bold = (input) => applyStyle(input, { bold: true }), italic = (input) => applyStyle(input, { italic: true }), underline = (input) => applyStyle(input, { underline: true }), strikethrough = (input) => applyStyle(input, { strikethrough: true }),
|
|
138742
|
+
}, exports_src, loadYoga, yoga_wasm_base64_esm_default, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, constants5, YGEnums_default, Yoga, src_default, VALID_BORDER_STYLES, BorderChars, BorderCharArrays, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, ATTRIBUTE_BASE_BITS = 8, ATTRIBUTE_BASE_MASK = 255, DebugOverlayCorner, TargetChannel, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, black = (input) => applyStyle(input, { fg: "black" }), red = (input) => applyStyle(input, { fg: "red" }), green = (input) => applyStyle(input, { fg: "green" }), yellow = (input) => applyStyle(input, { fg: "yellow" }), blue = (input) => applyStyle(input, { fg: "blue" }), magenta = (input) => applyStyle(input, { fg: "magenta" }), cyan = (input) => applyStyle(input, { fg: "cyan" }), white = (input) => applyStyle(input, { fg: "white" }), brightBlack = (input) => applyStyle(input, { fg: "brightBlack" }), brightRed = (input) => applyStyle(input, { fg: "brightRed" }), brightGreen = (input) => applyStyle(input, { fg: "brightGreen" }), brightYellow = (input) => applyStyle(input, { fg: "brightYellow" }), brightBlue = (input) => applyStyle(input, { fg: "brightBlue" }), brightMagenta = (input) => applyStyle(input, { fg: "brightMagenta" }), brightCyan = (input) => applyStyle(input, { fg: "brightCyan" }), brightWhite = (input) => applyStyle(input, { fg: "brightWhite" }), bgBlack = (input) => applyStyle(input, { bg: "black" }), bgRed = (input) => applyStyle(input, { bg: "red" }), bgGreen = (input) => applyStyle(input, { bg: "green" }), bgYellow = (input) => applyStyle(input, { bg: "yellow" }), bgBlue = (input) => applyStyle(input, { bg: "blue" }), bgMagenta = (input) => applyStyle(input, { bg: "magenta" }), bgCyan = (input) => applyStyle(input, { bg: "cyan" }), bgWhite = (input) => applyStyle(input, { bg: "white" }), bold = (input) => applyStyle(input, { bold: true }), italic = (input) => applyStyle(input, { italic: true }), underline = (input) => applyStyle(input, { underline: true }), strikethrough = (input) => applyStyle(input, { strikethrough: true }), dim2 = (input) => applyStyle(input, { dim: true }), reverse = (input) => applyStyle(input, { reverse: true }), blink = (input) => applyStyle(input, { blink: true }), fg = (color) => (input) => applyStyle(input, { fg: color }), bg = (color) => (input) => applyStyle(input, { bg: color }), link = (url2) => (input) => {
|
|
137695
138743
|
const chunk = typeof input === "object" && "__isChunk" in input ? input : {
|
|
137696
138744
|
__isChunk: true,
|
|
137697
138745
|
text: String(input)
|
|
@@ -142859,7 +143907,7 @@ var init_index_vy1rm1x3 = __esm(async () => {
|
|
|
142859
143907
|
worker_path = this.options.workerPath;
|
|
142860
143908
|
} else {
|
|
142861
143909
|
worker_path = new URL("./parser.worker.js", import.meta.url).href;
|
|
142862
|
-
if (!
|
|
143910
|
+
if (!existsSync54(resolve210(import.meta.dirname, "parser.worker.js"))) {
|
|
142863
143911
|
worker_path = new URL("./parser.worker.ts", import.meta.url).href;
|
|
142864
143912
|
}
|
|
142865
143913
|
}
|
|
@@ -152734,7 +153782,7 @@ var init_index_dg6qsc3m = __esm(async () => {
|
|
|
152734
153782
|
envRegistry: () => envRegistry,
|
|
152735
153783
|
env: () => env,
|
|
152736
153784
|
engine: () => engine,
|
|
152737
|
-
dim: () =>
|
|
153785
|
+
dim: () => dim2,
|
|
152738
153786
|
detectLinks: () => detectLinks,
|
|
152739
153787
|
delegate: () => delegate,
|
|
152740
153788
|
decodePasteBytes: () => decodePasteBytes,
|
|
@@ -189142,7 +190190,7 @@ function offlineBrokerHealth(baseUrl, error48) {
|
|
|
189142
190190
|
};
|
|
189143
190191
|
}
|
|
189144
190192
|
var DEFAULT_MONITOR_CHANNEL = "shared", DEFAULT_MONITOR_MESSAGE_LIMIT = 64, SCOUT_MONITOR_ASSISTANT_ID = "scoutbot";
|
|
189145
|
-
var
|
|
190193
|
+
var init_service11 = __esm(() => {
|
|
189146
190194
|
init_service3();
|
|
189147
190195
|
init_service8();
|
|
189148
190196
|
init_service5();
|
|
@@ -192007,7 +193055,7 @@ var import_react13, C2, MONITOR_TABS, operatorName, MESSAGE_COMPOSER_KEY_BINDING
|
|
|
192007
193055
|
var init_app2 = __esm(async () => {
|
|
192008
193056
|
init_src();
|
|
192009
193057
|
init_user_config();
|
|
192010
|
-
|
|
193058
|
+
init_service11();
|
|
192011
193059
|
init_service3();
|
|
192012
193060
|
init_paths();
|
|
192013
193061
|
init_view2();
|
|
@@ -192223,7 +193271,7 @@ var exports_up = {};
|
|
|
192223
193271
|
__export(exports_up, {
|
|
192224
193272
|
runUpCommand: () => runUpCommand
|
|
192225
193273
|
});
|
|
192226
|
-
import { existsSync as
|
|
193274
|
+
import { existsSync as existsSync55 } from "fs";
|
|
192227
193275
|
import { resolve as resolve40 } from "path";
|
|
192228
193276
|
function looksLikePath(value) {
|
|
192229
193277
|
return value.includes("/") || value.startsWith(".") || value.startsWith("~");
|
|
@@ -192332,7 +193380,7 @@ async function runUpCommand(context, args) {
|
|
|
192332
193380
|
throw new ScoutCliError(`usage: scout up <name|path> [--name <alias>] [--harness <${SUPPORTED_LOCAL_AGENT_HARNESSES.join("|")}>] [--provider <provider>] [--model <model>] [--reasoning-effort <effort>] [--permission-profile <${formatScoutPermissionProfiles()}>]`);
|
|
192333
193381
|
}
|
|
192334
193382
|
let projectPath;
|
|
192335
|
-
if (looksLikePath(target2) ||
|
|
193383
|
+
if (looksLikePath(target2) || existsSync55(resolve40(target2))) {
|
|
192336
193384
|
projectPath = resolve40(target2);
|
|
192337
193385
|
} else {
|
|
192338
193386
|
const resolved = await resolveLocalAgentByName(target2);
|
|
@@ -192656,13 +193704,13 @@ __export(exports_whoami, {
|
|
|
192656
193704
|
renderWhoAmICommandHelp: () => renderWhoAmICommandHelp
|
|
192657
193705
|
});
|
|
192658
193706
|
import { access as access2 } from "fs/promises";
|
|
192659
|
-
import { join as
|
|
193707
|
+
import { join as join69 } from "path";
|
|
192660
193708
|
async function resolveProjectAgentsMd(projectRoot) {
|
|
192661
193709
|
if (!projectRoot) {
|
|
192662
193710
|
return null;
|
|
192663
193711
|
}
|
|
192664
193712
|
for (const candidate of PROJECT_AGENT_INSTRUCTION_CANDIDATES) {
|
|
192665
|
-
const path6 =
|
|
193713
|
+
const path6 = join69(projectRoot, candidate);
|
|
192666
193714
|
try {
|
|
192667
193715
|
await access2(path6);
|
|
192668
193716
|
return path6;
|
|
@@ -192742,10 +193790,10 @@ var init_whoami = __esm(() => {
|
|
|
192742
193790
|
});
|
|
192743
193791
|
|
|
192744
193792
|
// ../../apps/desktop/src/cli/main.ts
|
|
192745
|
-
import { existsSync as
|
|
192746
|
-
import { join as
|
|
193793
|
+
import { existsSync as existsSync56, statSync as statSync15 } from "fs";
|
|
193794
|
+
import { join as join71 } from "path";
|
|
192747
193795
|
import { spawnSync as spawnSync12 } from "child_process";
|
|
192748
|
-
import { homedir as
|
|
193796
|
+
import { homedir as homedir49 } from "os";
|
|
192749
193797
|
|
|
192750
193798
|
// ../../apps/desktop/src/cli/argv.ts
|
|
192751
193799
|
function parseScoutArgv(argv) {
|
|
@@ -192863,7 +193911,7 @@ async function loadScoutCommandHandler(name2) {
|
|
|
192863
193911
|
case "statusline":
|
|
192864
193912
|
return (await Promise.resolve().then(() => (init_statusline(), exports_statusline))).runStatuslineCommand;
|
|
192865
193913
|
case "tail":
|
|
192866
|
-
return (await Promise.resolve().then(() => (
|
|
193914
|
+
return (await Promise.resolve().then(() => (init_tail2(), exports_tail))).runTailCommand;
|
|
192867
193915
|
case "tui":
|
|
192868
193916
|
return (await init_tui().then(() => exports_tui)).runTuiCommand;
|
|
192869
193917
|
case "up":
|
|
@@ -193087,7 +194135,7 @@ init_options();
|
|
|
193087
194135
|
// ../../apps/desktop/src/cli/broker-update.ts
|
|
193088
194136
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
193089
194137
|
import { mkdir as mkdir15, readFile as readFile18, rename, rm as rm6, stat as stat6, writeFile as writeFile12 } from "fs/promises";
|
|
193090
|
-
import { basename as basename26, dirname as dirname36, join as
|
|
194138
|
+
import { basename as basename26, dirname as dirname36, join as join70 } from "path";
|
|
193091
194139
|
|
|
193092
194140
|
// ../../apps/desktop/src/cli/runtime-freshness.ts
|
|
193093
194141
|
function isRecord16(value) {
|
|
@@ -193159,7 +194207,7 @@ function lockPayloadsMatch(left, right) {
|
|
|
193159
194207
|
}
|
|
193160
194208
|
async function readLockPayload2(lockPath) {
|
|
193161
194209
|
try {
|
|
193162
|
-
const raw2 = JSON.parse(await readFile18(
|
|
194210
|
+
const raw2 = JSON.parse(await readFile18(join70(lockPath, "owner.json"), "utf8"));
|
|
193163
194211
|
if (Number.isInteger(raw2.pid) && typeof raw2.startedAt === "number" && Number.isFinite(raw2.startedAt) && typeof raw2.token === "string" && raw2.token.length > 0) {
|
|
193164
194212
|
return {
|
|
193165
194213
|
pid: raw2.pid,
|
|
@@ -193203,7 +194251,7 @@ async function tryCreateOwnedLock(lockPath) {
|
|
|
193203
194251
|
try {
|
|
193204
194252
|
await mkdir15(lockPath, { mode: 448 });
|
|
193205
194253
|
created = true;
|
|
193206
|
-
await writeFile12(
|
|
194254
|
+
await writeFile12(join70(lockPath, "owner.json"), `${JSON.stringify(owner)}
|
|
193207
194255
|
`, { encoding: "utf8", flag: "wx", mode: 384 });
|
|
193208
194256
|
} catch (error48) {
|
|
193209
194257
|
if (created) {
|
|
@@ -193227,7 +194275,7 @@ async function tryCreateOwnedLock(lockPath) {
|
|
|
193227
194275
|
};
|
|
193228
194276
|
}
|
|
193229
194277
|
async function tryReclaimDeadLock(lockPath, observedOwner) {
|
|
193230
|
-
const reclaimPath =
|
|
194278
|
+
const reclaimPath = join70(dirname36(lockPath), BROKER_UPDATE_RECLAIM_DIRECTORY);
|
|
193231
194279
|
const reclaimGuard = await tryCreateOwnedLock(reclaimPath);
|
|
193232
194280
|
if (!reclaimGuard.acquired) {
|
|
193233
194281
|
return false;
|
|
@@ -193298,7 +194346,7 @@ async function acquireBrokerUpdateLock(lockPath, waitTimeoutMs) {
|
|
|
193298
194346
|
async function writeCliMtimeCheckpointAtomically(checkpointPath, mtime) {
|
|
193299
194347
|
const checkpointDirectory = dirname36(checkpointPath);
|
|
193300
194348
|
await mkdir15(checkpointDirectory, { recursive: true });
|
|
193301
|
-
const temporaryPath =
|
|
194349
|
+
const temporaryPath = join70(checkpointDirectory, `.${basename26(checkpointPath)}.${process.pid}.${randomUUID7()}.tmp`);
|
|
193302
194350
|
try {
|
|
193303
194351
|
await writeFile12(temporaryPath, String(mtime), {
|
|
193304
194352
|
encoding: "utf8",
|
|
@@ -193333,7 +194381,7 @@ async function ensureBrokerUptodate(options) {
|
|
|
193333
194381
|
const report = options.report ?? (() => {
|
|
193334
194382
|
return;
|
|
193335
194383
|
});
|
|
193336
|
-
const lockPath =
|
|
194384
|
+
const lockPath = join70(dirname36(options.checkpointPath), BROKER_UPDATE_LOCK_DIRECTORY);
|
|
193337
194385
|
let lock;
|
|
193338
194386
|
try {
|
|
193339
194387
|
lock = await acquireBrokerUpdateLock(lockPath, options.lockWaitTimeoutMs ?? BROKER_UPDATE_LOCK_WAIT_MS);
|
|
@@ -193447,21 +194495,21 @@ var _scoutBinPath = null;
|
|
|
193447
194495
|
function getScoutBinPath() {
|
|
193448
194496
|
if (_scoutBinPath)
|
|
193449
194497
|
return _scoutBinPath;
|
|
193450
|
-
_scoutBinPath =
|
|
193451
|
-
if (!
|
|
194498
|
+
_scoutBinPath = join71(homedir49(), ".bun", "bin", "scout");
|
|
194499
|
+
if (!existsSync56(_scoutBinPath)) {
|
|
193452
194500
|
_scoutBinPath = spawnSync12("which", ["scout"], { encoding: "utf8" }).stdout.trim();
|
|
193453
194501
|
}
|
|
193454
194502
|
return _scoutBinPath;
|
|
193455
194503
|
}
|
|
193456
194504
|
function readCurrentCliMtime() {
|
|
193457
194505
|
try {
|
|
193458
|
-
return normalizeCliBinaryMtimeMs(
|
|
194506
|
+
return normalizeCliBinaryMtimeMs(statSync15(getScoutBinPath()).mtimeMs);
|
|
193459
194507
|
} catch {
|
|
193460
194508
|
return null;
|
|
193461
194509
|
}
|
|
193462
194510
|
}
|
|
193463
194511
|
function cliMtimeCheckpointPath() {
|
|
193464
|
-
return
|
|
194512
|
+
return join71(homedir49(), ".scout", "cli-mtime");
|
|
193465
194513
|
}
|
|
193466
194514
|
try {
|
|
193467
194515
|
await main3();
|