@openscout/scout 0.2.86 → 0.2.90
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/README.md +10 -5
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
- package/dist/client/assets/{AddProjectForm-BNRpRPod.js → AddProjectForm-DtTfn4Zk.js} +1 -1
- package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
- package/dist/client/assets/{AgentDetailCard-FelCxQrT.js → AgentDetailCard-Dtc02KUO.js} +1 -1
- package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
- package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
- package/dist/client/assets/{AgentLaneCard-CRDG74C1.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CWFqUdch.js → AgentLaneChrome-T8QE5742.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-yTM4GQAJ.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-DJeDRTAN.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
- package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
- package/dist/client/assets/{AgentLiveActions-Bn3zeZBN.js → AgentLiveActions-DwScaVRF.js} +1 -1
- package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
- package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
- package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
- package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
- package/dist/client/assets/{AtopView-DymBCiXv.js → AtopView-ycxMrRwp.js} +1 -1
- package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
- package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
- package/dist/client/assets/{BriefingsScreen-CLvSOJjy.js → BriefingsScreen-BerYOoWS.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DFAH-NO6.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
- package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
- package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
- package/dist/client/assets/{CodeDiffPane-C9HT1dCT.js → CodeDiffPane-BjCOBLze.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-5Y3GvXkM.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
- package/dist/client/assets/{CodeScreen-DpN9kQvm.js → CodeScreen-CA9Sq6Dx.js} +1 -1
- package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
- package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
- package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
- package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
- package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
- package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
- package/dist/client/assets/{DataTable-oJP339bX.js → DataTable-Dzqiaha4.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CH02HAVw.js → DispatchAftermath-B0WMg_z3.js} +1 -1
- package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-84b9I3fy.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
- package/dist/client/assets/{EmptyState-BnDda92b.js → EmptyState-CYNJZMrZ.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Dg7_88pv.js → FileViewerPane-Fwt8_KmD.js} +1 -1
- package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
- package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
- package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
- package/dist/client/assets/{FollowScreen-DcFBqr6l.js → FollowScreen-Bb_rcrzi.js} +1 -1
- package/dist/client/assets/{HarnessMark-DGZ6o6Ct.js → HarnessMark-DrE57dUq.js} +1 -1
- package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
- package/dist/client/assets/{HerdrSession-DV2hD6Yh.js → HerdrSession-1eVu9Owj.js} +1 -1
- package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
- package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-DNQjeWZO.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-197xYmRp.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-C9cmqxnK.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
- package/dist/client/assets/{MeshCanvas-C3_2p9B6.js → MeshCanvas-DwkjsiJ5.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-ZTjYWXTZ.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
- package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
- package/dist/client/assets/{MeshTopologyView-CBjHbAZw.js → MeshTopologyView-BD2xLE2C.js} +2 -2
- package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
- package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
- package/dist/client/assets/{MissionContextRail-DXkrbcnZ.js → MissionContextRail-D5MEP2f4.js} +1 -1
- package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
- package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
- package/dist/client/assets/{NewAgentModal-C18Ajovd.js → NewAgentModal-Do9aVvan.js} +1 -1
- package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DpHS2Wmt.js → NewChatOrigin-DXPvX-hh.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
- package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
- package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
- package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
- package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
- package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
- package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
- package/dist/client/assets/PlanView-B6gKo543.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-IDEpKZvI.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
- package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
- package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
- package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
- package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
- package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
- package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
- package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-C97Euf4s.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DUKLzkrW.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
- package/dist/client/assets/{ReposScreen-BR1LqTf1.js → ReposScreen-CpaLC_NU.js} +6 -6
- package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
- package/dist/client/assets/{ScoutSurface-BMKW7hSu.js → ScoutSurface-BENBUt5-.js} +1 -1
- package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
- package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-0O2iDRrF.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
- package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
- package/dist/client/assets/{SecondaryNav-cYTw2p39.js → SecondaryNav-B4IsujYh.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-mNjT0R6j.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
- package/dist/client/assets/{SessionObserve-zAlFbwFn.js → SessionObserve-B-SkP3tu.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-BVawzqoE.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
- package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
- package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
- package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
- package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
- package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
- package/dist/client/assets/{ShikiPane-DyEJdcvb.js → ShikiPane-DH8yYDks.js} +1 -1
- package/dist/client/assets/{SlidePanel-Dg8_styW.js → SlidePanel-RFXJpfUa.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-DMrSssNZ.js → SpriteAvatar-CEYdCzem.js} +1 -1
- package/dist/client/assets/{StatusPill-NFFnphtx.js → StatusPill-9uy70ttd.js} +1 -1
- package/dist/client/assets/{TailView-BfObcZu3.js → TailView-6bIrgdxN.js} +2 -2
- package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-C7fGlzY8.js → TextDocumentSurface-BcP9vvji.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BSeKIjnX.js → TmuxPeek-IaWqCgyJ.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-BkIGTzgw.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cwe-KWK4.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
- package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
- package/dist/client/assets/{activity-D4W2XZY2.js → activity-DS0u0Itf.js} +1 -1
- package/dist/client/assets/{addon-fit-Celjj2yn.js → addon-fit-CN888B3D.js} +1 -1
- package/dist/client/assets/{addon-webgl-Cu4tJ21-.js → addon-webgl-CoAnanQS.js} +1 -1
- package/dist/client/assets/{agent-essentials-CngjUhQj.js → agent-essentials-CuK4G_zS.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
- package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
- package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
- package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
- package/dist/client/assets/api-h5zurxmi.js +1 -0
- package/dist/client/assets/{arc.es-DNT50Y-_.js → arc.es-BET9ev6q.js} +1 -1
- package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
- package/dist/client/assets/{arrow-left-i-h6JAgs.js → arrow-left-CXDkJuCg.js} +1 -1
- package/dist/client/assets/{arrow-up-right-RBC6k8nn.js → arrow-up-right-Bj8RjSqW.js} +1 -1
- package/dist/client/assets/{bot-r2IuAuJd.js → bot-BSGSicKC.js} +1 -1
- package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
- package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
- package/dist/client/assets/{check-Bfs7hMb1.js → check-BfA0T8UD.js} +1 -1
- package/dist/client/assets/{chevron-down-Da5tV19_.js → chevron-down-BVg09D6U.js} +1 -1
- package/dist/client/assets/{chevron-right-BMqtBds_.js → chevron-right-CaEwYkxE.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-BUVYXXAp.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
- package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
- package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
- package/dist/client/assets/{clock-DaKLp6Xd.js → clock-C3TUL7D7.js} +1 -1
- package/dist/client/assets/{code-xml-ByQsfOI_.js → code-xml-Dbvjk9Kw.js} +1 -1
- package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
- package/dist/client/assets/content-BQuEedeL.js +1 -0
- package/dist/client/assets/content-BUae-L_N.js +1 -0
- package/dist/client/assets/content-BfG98J1k.js +1 -0
- package/dist/client/assets/content-BkVTfkAC.js +1 -0
- package/dist/client/assets/content-BsNMos_d.js +1 -0
- package/dist/client/assets/content-C2TZOKSE.js +1 -0
- package/dist/client/assets/content-CCn98eSk.js +1 -0
- package/dist/client/assets/content-CJuH5cDP.js +1 -0
- package/dist/client/assets/content-CYnPp9yo.js +1 -0
- package/dist/client/assets/content-CcrUhm4P.js +1 -0
- package/dist/client/assets/content-CiOMtgQc.js +1 -0
- package/dist/client/assets/content-CxuVONeQ.js +1 -0
- package/dist/client/assets/content-Dmq9n1_L.js +1 -0
- package/dist/client/assets/content-DskHP2NI.js +1 -0
- package/dist/client/assets/content-DvvzL2HK.js +1 -0
- package/dist/client/assets/content-snCAUbwv.js +1 -0
- package/dist/client/assets/{conversation-icons-C4amK8Sa.js → conversation-icons-DmC_Ak3z.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
- package/dist/client/assets/{copy-De4s38o2.js → copy-C79v_7D-.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DLlxGjKt.js → createLucideIcon-DCq_3fQn.js} +1 -1
- package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
- package/dist/client/assets/discover-IEnbrH8_.js +2 -0
- package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
- package/dist/client/assets/{external-link-BGHC_naA.js → external-link-Dd8xaveL.js} +1 -1
- package/dist/client/assets/{eye-BeCSqJn1.js → eye-DkU59kfl.js} +1 -1
- package/dist/client/assets/{file-text-BVhkMWyC.js → file-text-BITQqGtF.js} +1 -1
- package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
- package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
- package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
- package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
- package/dist/client/assets/{home-now-card-nano-Djhy6ax0.js → home-now-card-nano-C06GMiwD.js} +1 -1
- package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
- package/dist/client/assets/index-9as_JTUs.css +1 -0
- package/dist/client/assets/index-BTj2MguM.js +1 -0
- package/dist/client/assets/index-BZovGpDk.js +10 -0
- package/dist/client/assets/index-CvF09yvf.css +1 -0
- package/dist/client/assets/index-DiiEQwdc.js +1 -0
- package/dist/client/assets/index-vbaJ8sin.js +1 -0
- package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
- package/dist/client/assets/{keyboard-nav-7iEtvu9P.js → keyboard-nav-CHo_xmjw.js} +1 -1
- package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-pHT3TAVs.js → lane-roster-store-B6ybJlHJ.js} +1 -1
- package/dist/client/assets/left-Bk3XnxPD.css +1 -0
- package/dist/client/assets/left-BuJ0wJW1.js +2 -0
- package/dist/client/assets/left-C6Zj3cR4.js +1 -0
- package/dist/client/assets/left-CCoobxPS.css +1 -0
- package/dist/client/assets/left-COMAiMfB.js +2 -0
- package/dist/client/assets/left-Ce4WKYPK.js +1 -0
- package/dist/client/assets/left-DMJkmJOF.js +1 -0
- package/dist/client/assets/left-DrCbY6ja.js +1 -0
- package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
- package/dist/client/assets/left-default-DRHywOKX.js +1 -0
- package/dist/client/assets/left-l92tw5Kc.js +1 -0
- package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
- package/dist/client/assets/left-mission-e849d_Td.js +1 -0
- package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
- package/dist/client/assets/library-DygjpA6u.js +1 -0
- package/dist/client/assets/{loader-circle-DoT8gpw6.js → loader-circle-B-l2Wj3-.js} +1 -1
- package/dist/client/assets/{local-agents-BMadXuP1.js → local-agents-Wof5knTJ.js} +1 -1
- package/dist/client/assets/{mentions-Cd6XticV.js → mentions-BjXfeF7t.js} +1 -1
- package/dist/client/assets/{mesh-ops-C0zCLTR8.js → mesh-ops-C1gq8zKf.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Cpqil_2D.js → mesh-view-store-B56D3f77.js} +1 -1
- package/dist/client/assets/{message-circle-44KSmbvQ.js → message-circle-BwVx5X0q.js} +1 -1
- package/dist/client/assets/{message-markup-DAnnGpWr.js → message-markup-DlVX-iuc.js} +1 -1
- package/dist/client/assets/{message-square-DlY4EneU.js → message-square-BnkG6tae.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-DtjtRs9Z.js → mission-control-store-CMgIVjLJ.js} +1 -1
- package/dist/client/assets/model-Co0zkMIc.js +1 -0
- package/dist/client/assets/{observe-DL5_8-Zj.js → observe-DVHAcIrv.js} +1 -1
- package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
- package/dist/client/assets/{page-status-CW8co39E.js → page-status-Bg2hd27j.js} +1 -1
- package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
- package/dist/client/assets/plan-view-D56fneVF.css +1 -0
- package/dist/client/assets/{plus-64n9qucr.js → plus-BAI0t5g9.js} +1 -1
- package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
- package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
- package/dist/client/assets/{radio-BjpQTKT0.js → radio-BGtkyCG9.js} +1 -1
- package/dist/client/assets/{refresh-cw-IgN2fZLM.js → refresh-cw-DtF8xPqX.js} +1 -1
- package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
- package/dist/client/assets/right-B8qg3JdB.js +1 -0
- package/dist/client/assets/{right-B96CBzrV.js → right-BU_W1kSH.js} +1 -1
- package/dist/client/assets/right-BlR7h0US.js +1 -0
- package/dist/client/assets/right-BwgwTGGd.js +1 -0
- package/dist/client/assets/right-ByptvkVX.js +1 -0
- package/dist/client/assets/right-CUP-NIDG.js +1 -0
- package/dist/client/assets/right-Ch_jrNe2.js +1 -0
- package/dist/client/assets/right-Dd2DscRz.js +1 -0
- package/dist/client/assets/right-DmVHd8Xj.js +1 -0
- package/dist/client/assets/{right-DqiVyo8v.js → right-c4PAdFYZ.js} +1 -1
- package/dist/client/assets/{rocket-DnmN_YOD.js → rocket-BWh18pt_.js} +1 -1
- package/dist/client/assets/router-63XV_E7f.js +1 -0
- package/dist/client/assets/{text-BR9Bap0E.js → runtime-picker-BXKJbLot.js} +1 -1
- package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
- package/dist/client/assets/{scope-views-Z8aoAmtU.js → scope-views-Dm2_-NPi.js} +1 -1
- package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
- package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
- package/dist/client/assets/{scroll-text-DRidbcse.js → scroll-text-DZb3mmYo.js} +1 -1
- package/dist/client/assets/{search-BbgsEMXa.js → search-1QMVOxF3.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
- package/dist/client/assets/{selection-bridge-CpzFGx3-.js → selection-bridge-O9C4kGfF.js} +1 -1
- package/dist/client/assets/{send-horizontal-BXo2uz3Z.js → send-horizontal-DbyEkGql.js} +1 -1
- package/dist/client/assets/{server-Dt3tpiBj.js → server-Bncn9S7r.js} +1 -1
- package/dist/client/assets/{session-catalog-CUQ8LUJY.js → session-catalog-DC6BlBBC.js} +1 -1
- package/dist/client/assets/{session-table-B4JOKevn.js → session-table-BUPq9Viy.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-7V8B3xsf.js → sliders-horizontal-CMe8Bay1.js} +1 -1
- package/dist/client/assets/{sparkles-ytTwpCbZ.js → sparkles-_7cTZsIH.js} +1 -1
- package/dist/client/assets/{sse-CSozY6mp.js → sse-Bb0EOcU9.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
- package/dist/client/assets/{tail-events-CrN-Rmxj.js → tail-events-C12pfUax.js} +1 -1
- package/dist/client/assets/{terminal-relay-pSm7_An6.js → terminal-relay-BgfVJXIL.js} +1 -1
- package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
- package/dist/client/assets/{terminal-takeover-CtA3wcXh.js → terminal-takeover--05EYhJm.js} +1 -1
- package/dist/client/assets/{terminal-BiNIXhna.js → terminal-xGf_F3y7.js} +1 -1
- package/dist/client/assets/text-DsBWV_4k.js +1 -0
- package/dist/client/assets/{use-conversation-list-C0bEXFeH.js → use-conversation-list-DWX02INv.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CK4aw-3G.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-QixBijmT.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
- package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
- package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-6N8b7qsU.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
- package/dist/client/assets/{usePierreRuntime-Bq6mXrgd.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
- package/dist/client/assets/{wrench-CQvdf7KT.js → wrench-_tHBGTop.js} +1 -1
- package/dist/client/assets/{x-BJyPzFnn.js → x-CrGUKNRv.js} +1 -1
- package/dist/client/assets/{xterm-D6dE_wMr.js → xterm-Ks-VlLTq.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +38 -169
- package/dist/node/main.mjs +240 -272
- package/dist/pairing-runtime-controller.mjs +476 -394
- package/dist/runtime/base-daemon.mjs +121 -49
- package/dist/runtime/broker-daemon.mjs +60 -171
- package/dist/runtime/broker-process-manager.mjs +0 -6
- package/dist/runtime/mesh-discover.mjs +0 -6
- package/dist/scout-control-plane-web.mjs +477 -672
- package/dist/scout-web-server.mjs +477 -672
- package/package.json +7 -6
- package/dist/client/assets/ActivityScreen-C7AwUogt.js +0 -1
- package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BoBQpyz5.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-rw3vh8Lm.js +0 -1
- package/dist/client/assets/AgentFloorView-Crdw8Uo5.js +0 -1
- package/dist/client/assets/AgentInfoScreen-Cge7HHbV.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-DCIIg3Zp.js +0 -4
- package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +0 -1
- package/dist/client/assets/AgentLanesView-CbY9qD0z.js +0 -2
- package/dist/client/assets/AgentSessions-czl5zT7A.js +0 -6
- package/dist/client/assets/AgentsConsole-CoT2crwq.js +0 -1
- package/dist/client/assets/AgentsScreen-BcPM-z1T.js +0 -1
- package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +0 -1
- package/dist/client/assets/AstronautSuit-BADl7m8x.js +0 -1
- package/dist/client/assets/BackToPicker-CqYhOaLB.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-DDfZ8ci1.js +0 -1
- package/dist/client/assets/BrokerScreen-Bkvu92jk.js +0 -5
- package/dist/client/assets/Canvas-KyTsDJlB.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Bjjqa30K.js +0 -1
- package/dist/client/assets/ConversationComposer-Ce7Byw48.js +0 -1
- package/dist/client/assets/ConversationFeedRows-DygDfQn_.js +0 -1
- package/dist/client/assets/ConversationHeader-C3sg0ULI.js +0 -1
- package/dist/client/assets/ConversationPanels-Dg4Y2GgX.js +0 -6
- package/dist/client/assets/ConversationScreen-BP5tdz2k.css +0 -1
- package/dist/client/assets/ConversationScreen-CjWWmuuh.js +0 -1
- package/dist/client/assets/ConversationStatus-BhVIYQza.js +0 -1
- package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-DmtFisY9.js +0 -1
- package/dist/client/assets/FlightObserveScreen-DL3Xhl0h.js +0 -1
- package/dist/client/assets/HarnessesScreen-DTDL-XaA.js +0 -1
- package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
- package/dist/client/assets/HomeHero-CENwVZ45.js +0 -1
- package/dist/client/assets/HostAdvisorView-PgiZUkd_.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-Bj80IgR0.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-BztwvOv9.js +0 -1
- package/dist/client/assets/MeshScreen-lJKaOyGB.js +0 -1
- package/dist/client/assets/MessagesScreen-D6MVLvdg.js +0 -1
- package/dist/client/assets/MissionControlView-BCH-Zsp4.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-DbAliOSF.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-Bx6Pg8_O.js +0 -1
- package/dist/client/assets/MissionLogPane-D06c29Y8.js +0 -1
- package/dist/client/assets/NewChatComposer-Bgqes0UQ.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-Cmhwai4X.js +0 -2
- package/dist/client/assets/ObserveTextFlow-C1f5oize.js +0 -2
- package/dist/client/assets/ObservedTopologyPanel-D85P6RAk.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-IDI4fuUE.js +0 -88
- package/dist/client/assets/OpsAgentsView-yt0JavoB.js +0 -1
- package/dist/client/assets/OpsScreen-C3yNQqJE.js +0 -1
- package/dist/client/assets/OpsSubnav-BijKI3yG.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-Bh_aISs-.js +0 -1
- package/dist/client/assets/ProjectsInbox-B8Srlklk.js +0 -2
- package/dist/client/assets/ProjectsRail-DqAbdvCf.js +0 -1
- package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-DpkjYLL2.js +0 -1
- package/dist/client/assets/Provider-Ve8yXaWR.js +0 -1
- package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
- package/dist/client/assets/RailRow-C4GNGR80.js +0 -1
- package/dist/client/assets/RawSessionsTable-Co3vzwsf.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-DMd1CBAf.js +0 -9
- package/dist/client/assets/RepoDiffViewer-CovKjSgb.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-zIiEmh-e.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-BGsVicc2.js +0 -1
- package/dist/client/assets/SessionRefScreen-BmKhf29o.js +0 -1
- package/dist/client/assets/SessionsScreen-CsSqjIY2.js +0 -1
- package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +0 -1
- package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +0 -3
- package/dist/client/assets/SettingsScreen-Btaku7YM.js +0 -1
- package/dist/client/assets/Terminal-Dr-M9U4u.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-BmyZkonh.js +0 -1
- package/dist/client/assets/TerminalRelay-lJ2KdMCW.js +0 -46
- package/dist/client/assets/WorkFilesViewer-BBtKRBPv.js +0 -1
- package/dist/client/assets/agent-autocomplete-Dv-_9dAw.js +0 -2
- package/dist/client/assets/agent-identity-DzHGhLdJ.js +0 -1
- package/dist/client/assets/agent-specialization-CNrsRbKA.js +0 -1
- package/dist/client/assets/api-DEHEgJ9m.js +0 -1
- package/dist/client/assets/archive-DH49QqFG.js +0 -1
- package/dist/client/assets/arrow-right-B0Yi01Zr.js +0 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
- package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
- package/dist/client/assets/compass-BepM5iWH.js +0 -1
- package/dist/client/assets/content-5hnDC9WE.js +0 -1
- package/dist/client/assets/content-BRFZ-a6m.js +0 -1
- package/dist/client/assets/content-BYykncDo.js +0 -1
- package/dist/client/assets/content-Be6yyWbJ.js +0 -1
- package/dist/client/assets/content-Bgl_X3ao.js +0 -1
- package/dist/client/assets/content-BopJW1Zx.js +0 -1
- package/dist/client/assets/content-Bv2sfg0w.js +0 -1
- package/dist/client/assets/content-CMBiIZTg.js +0 -1
- package/dist/client/assets/content-CPVqvf5o.js +0 -1
- package/dist/client/assets/content-CbwyFqdI.js +0 -1
- package/dist/client/assets/content-ClQjAWYi.js +0 -1
- package/dist/client/assets/content-Cv2tSAbv.js +0 -1
- package/dist/client/assets/content-DFFe3-Ot.js +0 -1
- package/dist/client/assets/content-DY5hwBmm.js +0 -1
- package/dist/client/assets/content-_IXoxGno.js +0 -1
- package/dist/client/assets/content-j_tewJdE.js +0 -1
- package/dist/client/assets/conversation-model-CigSPlKA.js +0 -1
- package/dist/client/assets/conversation-motion-features-_95aZx_1.js +0 -1
- package/dist/client/assets/cpu-Bc268H9Q.js +0 -1
- package/dist/client/assets/credentials-qwds23lv.js +0 -1
- package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
- package/dist/client/assets/discover-DOlk1hG7.js +0 -2
- package/dist/client/assets/embed-entry-BqDJfa87.js +0 -2
- package/dist/client/assets/file-code-corner-CX53Cd9y.js +0 -1
- package/dist/client/assets/gauge-CPcEPmNt.js +0 -1
- package/dist/client/assets/gestures-BXIGYk_p.js +0 -1
- package/dist/client/assets/git-branch-q8Ayc8py.js +0 -1
- package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
- package/dist/client/assets/home-moving-signal-Dm2Z2x0p.js +0 -1
- package/dist/client/assets/home-now-card-xU5LGP7q.js +0 -1
- package/dist/client/assets/hooks-CdKx1CxP.js +0 -2
- package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
- package/dist/client/assets/index-Bli6bTLU.js +0 -10
- package/dist/client/assets/index-D7UEHxaY.js +0 -1
- package/dist/client/assets/index-DFdlQs_c.js +0 -1
- package/dist/client/assets/index-DhfOMK0D.js +0 -1
- package/dist/client/assets/index-DzlEgstl.css +0 -1
- package/dist/client/assets/index-wLwc74Pu.css +0 -1
- package/dist/client/assets/inspector-panel-B8pigRsg.js +0 -2
- package/dist/client/assets/layers-BiZA-Clc.js +0 -1
- package/dist/client/assets/layout-grid-DMpv9CZM.js +0 -1
- package/dist/client/assets/left-BayK4ocL.js +0 -1
- package/dist/client/assets/left-BhZhSrS2.js +0 -1
- package/dist/client/assets/left-BhgU6NOA.js +0 -1
- package/dist/client/assets/left-CY_FGnN7.js +0 -1
- package/dist/client/assets/left-Cq8mjamr.js +0 -1
- package/dist/client/assets/left-DH44V4I_.css +0 -1
- package/dist/client/assets/left-Dnqla0b5.js +0 -2
- package/dist/client/assets/left-Dy403II2.js +0 -2
- package/dist/client/assets/left-R2OOE7VG.css +0 -1
- package/dist/client/assets/left-advisor-oOAtJ9YE.js +0 -1
- package/dist/client/assets/left-agents-TIKe8vW8.js +0 -1
- package/dist/client/assets/left-default-owH0Lwxo.js +0 -1
- package/dist/client/assets/left-lanes-BE_co2lP.js +0 -1
- package/dist/client/assets/left-mission-C_nWUtfA.js +0 -1
- package/dist/client/assets/library-BSVrjn_m.js +0 -1
- package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
- package/dist/client/assets/persistent-state-DYjP8lqN.js +0 -1
- package/dist/client/assets/profile-BkmuseW7.js +0 -1
- package/dist/client/assets/projects-inbox-C0umZMSY.js +0 -1
- package/dist/client/assets/provider-CX9EWecp.js +0 -1
- package/dist/client/assets/proxy-C35W-YHZ.js +0 -1
- package/dist/client/assets/resolve-panes-CCqRkQdM.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +0 -1
- package/dist/client/assets/right-B3PQUHd5.js +0 -1
- package/dist/client/assets/right-BPirlFC8.js +0 -1
- package/dist/client/assets/right-BUP2Ro_M.js +0 -1
- package/dist/client/assets/right-BVWYPIFX.js +0 -1
- package/dist/client/assets/right-BoAJxwA3.js +0 -1
- package/dist/client/assets/right-C2aOC2li.js +0 -1
- package/dist/client/assets/right-CtPJjgOV.js +0 -1
- package/dist/client/assets/right-SfSu0zHC.js +0 -1
- package/dist/client/assets/router-B0YclXYg.js +0 -1
- package/dist/client/assets/scout-voice-DvG_3stJ.js +0 -1
- package/dist/client/assets/scoutbot-markdown-BJJyaPu2.js +0 -6
- package/dist/client/assets/secondaryNavConfig-DyC_P9Wx.js +0 -1
- package/dist/client/assets/settings-BzWCF3NF.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
- package/dist/client/assets/text-rLpBg4_z.css +0 -1
- package/dist/client/assets/use-reduced-motion-BLn59zLn.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-JKb1EhFh.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +0 -1
- package/dist/client/assets/usePersistentState-DOEahRlt.js +0 -1
- package/dist/client/assets/zap-rw7uwZht.js +0 -1
- /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
|
@@ -10433,214 +10433,6 @@ var init_broker = __esm(() => {
|
|
|
10433
10433
|
init_registry();
|
|
10434
10434
|
});
|
|
10435
10435
|
|
|
10436
|
-
// packages/runtime/src/node-identity.ts
|
|
10437
|
-
import {
|
|
10438
|
-
createHash,
|
|
10439
|
-
createPrivateKey,
|
|
10440
|
-
createPublicKey,
|
|
10441
|
-
generateKeyPairSync,
|
|
10442
|
-
randomBytes,
|
|
10443
|
-
sign,
|
|
10444
|
-
verify
|
|
10445
|
-
} from "crypto";
|
|
10446
|
-
import {
|
|
10447
|
-
chmodSync,
|
|
10448
|
-
existsSync as existsSync3,
|
|
10449
|
-
mkdirSync as mkdirSync2,
|
|
10450
|
-
readFileSync,
|
|
10451
|
-
renameSync,
|
|
10452
|
-
rmSync as rmSync2,
|
|
10453
|
-
writeFileSync as writeFileSync2
|
|
10454
|
-
} from "fs";
|
|
10455
|
-
import { dirname as dirname2, join as join4 } from "path";
|
|
10456
|
-
function stripBonjourCollisionSuffix(value) {
|
|
10457
|
-
if (!value || typeof value !== "string")
|
|
10458
|
-
return "";
|
|
10459
|
-
let trimmed = value.trim();
|
|
10460
|
-
const isDotLocal = /\.local\.?$/i.test(trimmed);
|
|
10461
|
-
if (isDotLocal) {
|
|
10462
|
-
trimmed = trimmed.replace(/\.local\.?$/i, "");
|
|
10463
|
-
}
|
|
10464
|
-
const isHyphenLocalOpenscout = /-local-openscout$/i.test(trimmed);
|
|
10465
|
-
const isHyphenLocal = !isHyphenLocalOpenscout && /-local$/i.test(trimmed);
|
|
10466
|
-
if (isHyphenLocalOpenscout) {
|
|
10467
|
-
trimmed = trimmed.replace(/-local-openscout$/i, "");
|
|
10468
|
-
} else if (isHyphenLocal) {
|
|
10469
|
-
trimmed = trimmed.replace(/-local$/i, "");
|
|
10470
|
-
}
|
|
10471
|
-
if (!isDotLocal && !isHyphenLocalOpenscout && !isHyphenLocal) {
|
|
10472
|
-
return trimmed;
|
|
10473
|
-
}
|
|
10474
|
-
trimmed = trimmed.replace(/(?<=[a-zA-Z].*?)(?:-\d+)+$/, "");
|
|
10475
|
-
if (isDotLocal)
|
|
10476
|
-
return `${trimmed}.local`;
|
|
10477
|
-
if (isHyphenLocalOpenscout)
|
|
10478
|
-
return `${trimmed}-local-openscout`;
|
|
10479
|
-
if (isHyphenLocal)
|
|
10480
|
-
return `${trimmed}-local`;
|
|
10481
|
-
return trimmed;
|
|
10482
|
-
}
|
|
10483
|
-
function nodeIdentityPath(supportDirectory) {
|
|
10484
|
-
const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
|
|
10485
|
-
return join4(dir, NODE_IDENTITY_FILE);
|
|
10486
|
-
}
|
|
10487
|
-
function loadOrCreateNodeIdentity(supportDirectory) {
|
|
10488
|
-
const path = nodeIdentityPath(supportDirectory);
|
|
10489
|
-
if (existsSync3(path)) {
|
|
10490
|
-
return readAndValidateNodeIdentity(path);
|
|
10491
|
-
}
|
|
10492
|
-
return createNodeIdentity(supportDirectory);
|
|
10493
|
-
}
|
|
10494
|
-
function readStableNodeQualifier(supportDirectory) {
|
|
10495
|
-
const path = nodeIdentityPath(supportDirectory);
|
|
10496
|
-
const cached = stableNodeQualifierCache.get(path);
|
|
10497
|
-
if (cached) {
|
|
10498
|
-
return cached;
|
|
10499
|
-
}
|
|
10500
|
-
if (!existsSync3(path)) {
|
|
10501
|
-
return null;
|
|
10502
|
-
}
|
|
10503
|
-
const nodeQualifier = normalizeNodeQualifier(readAndValidateNodeIdentity(path).nodeQualifier);
|
|
10504
|
-
if (nodeQualifier) {
|
|
10505
|
-
stableNodeQualifierCache.set(path, nodeQualifier);
|
|
10506
|
-
}
|
|
10507
|
-
return nodeQualifier || null;
|
|
10508
|
-
}
|
|
10509
|
-
function readAndValidateNodeIdentity(path) {
|
|
10510
|
-
let parsed;
|
|
10511
|
-
try {
|
|
10512
|
-
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
10513
|
-
} catch {
|
|
10514
|
-
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
10515
|
-
}
|
|
10516
|
-
if (parsed.version !== 1 || !parsed.publicKey || !parsed.privateKey) {
|
|
10517
|
-
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
10518
|
-
}
|
|
10519
|
-
if (parsed.nodeQualifier !== undefined && normalizePersistedNodeQualifier(parsed.nodeQualifier) !== parsed.nodeQualifier) {
|
|
10520
|
-
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
10521
|
-
}
|
|
10522
|
-
try {
|
|
10523
|
-
const derived = createPublicKey(importPrivateKey(parsed.privateKey)).export({ type: "spki", format: "der" }).toString("base64");
|
|
10524
|
-
if (derived !== parsed.publicKey) {
|
|
10525
|
-
throw new Error("mismatch");
|
|
10526
|
-
}
|
|
10527
|
-
} catch {
|
|
10528
|
-
throw new Error(`Node identity at ${path} has mismatched or invalid keys; remove it to generate a fresh one.`);
|
|
10529
|
-
}
|
|
10530
|
-
return parsed;
|
|
10531
|
-
}
|
|
10532
|
-
function normalizePersistedNodeQualifier(value) {
|
|
10533
|
-
return typeof value === "string" ? value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
10534
|
-
}
|
|
10535
|
-
function normalizeNodeQualifier(value) {
|
|
10536
|
-
return stripBonjourCollisionSuffix(normalizePersistedNodeQualifier(value));
|
|
10537
|
-
}
|
|
10538
|
-
function createNodeIdentity(supportDirectory) {
|
|
10539
|
-
if (!supportDirectory) {
|
|
10540
|
-
assertTestIsolatedUserData("write the node identity", "OPENSCOUT_SUPPORT_DIRECTORY");
|
|
10541
|
-
}
|
|
10542
|
-
const path = nodeIdentityPath(supportDirectory);
|
|
10543
|
-
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
10544
|
-
const identity = {
|
|
10545
|
-
version: 1,
|
|
10546
|
-
publicKey: publicKey.export({ type: "spki", format: "der" }).toString("base64"),
|
|
10547
|
-
privateKey: privateKey.export({ type: "pkcs8", format: "der" }).toString("base64"),
|
|
10548
|
-
createdAt: Date.now()
|
|
10549
|
-
};
|
|
10550
|
-
mkdirSync2(dirname2(path), { recursive: true });
|
|
10551
|
-
try {
|
|
10552
|
-
writeFileSync2(path, `${JSON.stringify(identity, null, 2)}
|
|
10553
|
-
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
10554
|
-
} catch (error) {
|
|
10555
|
-
if (error.code === "EEXIST") {
|
|
10556
|
-
return readAndValidateNodeIdentity(path);
|
|
10557
|
-
}
|
|
10558
|
-
throw error;
|
|
10559
|
-
}
|
|
10560
|
-
try {
|
|
10561
|
-
chmodSync(path, 384);
|
|
10562
|
-
} catch {}
|
|
10563
|
-
return identity;
|
|
10564
|
-
}
|
|
10565
|
-
function nodeKeyId(publicKeyBase64) {
|
|
10566
|
-
return createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest("hex");
|
|
10567
|
-
}
|
|
10568
|
-
function nodeFingerprint(publicKeyBase64) {
|
|
10569
|
-
const digest = createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest();
|
|
10570
|
-
const encoded = base32Encode(digest.subarray(0, 10)).toLowerCase();
|
|
10571
|
-
return `${NODE_FINGERPRINT_PREFIX}:${encoded.slice(0, 4)}-${encoded.slice(4, 8)}`;
|
|
10572
|
-
}
|
|
10573
|
-
function signNodePayload(identity, payload) {
|
|
10574
|
-
const key = importPrivateKey(identity.privateKey);
|
|
10575
|
-
return sign(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key).toString("base64");
|
|
10576
|
-
}
|
|
10577
|
-
function verifyNodeSignature(publicKeyBase64, payload, signatureBase64) {
|
|
10578
|
-
try {
|
|
10579
|
-
const key = importPublicKey(publicKeyBase64);
|
|
10580
|
-
return verify(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key, Buffer.from(signatureBase64, "base64"));
|
|
10581
|
-
} catch {
|
|
10582
|
-
return false;
|
|
10583
|
-
}
|
|
10584
|
-
}
|
|
10585
|
-
function canonicalJson(value) {
|
|
10586
|
-
if (value === null || typeof value !== "object") {
|
|
10587
|
-
return JSON.stringify(value);
|
|
10588
|
-
}
|
|
10589
|
-
if (Array.isArray(value)) {
|
|
10590
|
-
return `[${value.map(canonicalJson).join(",")}]`;
|
|
10591
|
-
}
|
|
10592
|
-
const record2 = value;
|
|
10593
|
-
const keys = Object.keys(record2).sort();
|
|
10594
|
-
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record2[key])}`).join(",")}}`;
|
|
10595
|
-
}
|
|
10596
|
-
function verifySignedNodeCard(card, now = Date.now()) {
|
|
10597
|
-
if (nodeKeyId(card.publicKey) !== card.keyId) {
|
|
10598
|
-
return false;
|
|
10599
|
-
}
|
|
10600
|
-
if (nodeFingerprint(card.publicKey) !== card.fingerprint) {
|
|
10601
|
-
return false;
|
|
10602
|
-
}
|
|
10603
|
-
if (!Number.isFinite(card.expiresAt) || card.expiresAt <= now) {
|
|
10604
|
-
return false;
|
|
10605
|
-
}
|
|
10606
|
-
if (card.tls !== undefined) {
|
|
10607
|
-
if (typeof card.tls !== "object" || card.tls === null || typeof card.tls.spkiFingerprint !== "string" || !/^[0-9a-f]{64}$/.test(card.tls.spkiFingerprint)) {
|
|
10608
|
-
return false;
|
|
10609
|
-
}
|
|
10610
|
-
}
|
|
10611
|
-
const { signature, ...unsigned } = card;
|
|
10612
|
-
return verifyNodeSignature(card.publicKey, canonicalJson(unsigned), signature);
|
|
10613
|
-
}
|
|
10614
|
-
function base32Encode(input) {
|
|
10615
|
-
let bits = 0;
|
|
10616
|
-
let value = 0;
|
|
10617
|
-
let output = "";
|
|
10618
|
-
for (const byte of input) {
|
|
10619
|
-
value = value << 8 | byte;
|
|
10620
|
-
bits += 8;
|
|
10621
|
-
while (bits >= 5) {
|
|
10622
|
-
output += BASE32_ALPHABET[value >>> bits - 5 & 31];
|
|
10623
|
-
bits -= 5;
|
|
10624
|
-
}
|
|
10625
|
-
}
|
|
10626
|
-
if (bits > 0) {
|
|
10627
|
-
output += BASE32_ALPHABET[value << 5 - bits & 31];
|
|
10628
|
-
}
|
|
10629
|
-
return output;
|
|
10630
|
-
}
|
|
10631
|
-
function importPrivateKey(privateKeyBase64) {
|
|
10632
|
-
return createPrivateKey({ key: Buffer.from(privateKeyBase64, "base64"), format: "der", type: "pkcs8" });
|
|
10633
|
-
}
|
|
10634
|
-
function importPublicKey(publicKeyBase64) {
|
|
10635
|
-
return createPublicKey({ key: Buffer.from(publicKeyBase64, "base64"), format: "der", type: "spki" });
|
|
10636
|
-
}
|
|
10637
|
-
var NODE_IDENTITY_FILE = "node-identity.json", NODE_FINGERPRINT_PREFIX = "osc1", NODE_CARD_TTL_MS, stableNodeQualifierCache, BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
10638
|
-
var init_node_identity = __esm(() => {
|
|
10639
|
-
init_support_paths();
|
|
10640
|
-
NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
10641
|
-
stableNodeQualifierCache = new Map;
|
|
10642
|
-
});
|
|
10643
|
-
|
|
10644
10436
|
// node_modules/.bun/drizzle-orm@0.45.2+e80f9ee8788b3855/node_modules/drizzle-orm/bun-sqlite/session.js
|
|
10645
10437
|
var SQLiteBunSession, SQLiteBunTransaction, PreparedQuery;
|
|
10646
10438
|
var init_session2 = __esm(() => {
|
|
@@ -10997,7 +10789,6 @@ var init_sqlite_adapter = __esm(() => {
|
|
|
10997
10789
|
var init_control_plane_migrations = __esm(() => {
|
|
10998
10790
|
init_schema();
|
|
10999
10791
|
init_support_paths();
|
|
11000
|
-
init_node_identity();
|
|
11001
10792
|
});
|
|
11002
10793
|
|
|
11003
10794
|
// packages/runtime/src/conversations/api.ts
|
|
@@ -12029,7 +11820,7 @@ var init_model_window_registry = __esm(() => {
|
|
|
12029
11820
|
});
|
|
12030
11821
|
|
|
12031
11822
|
// packages/agent-sessions/src/history.ts
|
|
12032
|
-
import { basename, dirname as
|
|
11823
|
+
import { basename, dirname as dirname2 } from "path";
|
|
12033
11824
|
function decodeClaudeProjectsSlug(name) {
|
|
12034
11825
|
if (!name || !name.startsWith("-")) {
|
|
12035
11826
|
return null;
|
|
@@ -12041,7 +11832,7 @@ function decodeClaudeProjectsSlug(name) {
|
|
|
12041
11832
|
return `/${tail.replace(/-/g, "/")}`;
|
|
12042
11833
|
}
|
|
12043
11834
|
function inferClaudeHistoryCwd(path) {
|
|
12044
|
-
const parent = basename(
|
|
11835
|
+
const parent = basename(dirname2(path));
|
|
12045
11836
|
return decodeClaudeProjectsSlug(parent);
|
|
12046
11837
|
}
|
|
12047
11838
|
function deriveHistoryName(path) {
|
|
@@ -12049,7 +11840,7 @@ function deriveHistoryName(path) {
|
|
|
12049
11840
|
if (claudeCwd) {
|
|
12050
11841
|
return basename(claudeCwd) || claudeCwd;
|
|
12051
11842
|
}
|
|
12052
|
-
const parent = basename(
|
|
11843
|
+
const parent = basename(dirname2(path));
|
|
12053
11844
|
return parent || basename(path) || "History Session";
|
|
12054
11845
|
}
|
|
12055
11846
|
function normalizeTimestamp(value) {
|
|
@@ -15185,7 +14976,6 @@ var init_budget_observations = __esm(() => {
|
|
|
15185
14976
|
// packages/runtime/src/sqlite-store.ts
|
|
15186
14977
|
var RUNTIME_SESSION_RETENTION_MS;
|
|
15187
14978
|
var init_sqlite_store = __esm(() => {
|
|
15188
|
-
init_node_identity();
|
|
15189
14979
|
init_registry();
|
|
15190
14980
|
init_drizzle_client();
|
|
15191
14981
|
init_sqlite_adapter();
|
|
@@ -15196,6 +14986,184 @@ var init_sqlite_store = __esm(() => {
|
|
|
15196
14986
|
RUNTIME_SESSION_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
|
|
15197
14987
|
});
|
|
15198
14988
|
|
|
14989
|
+
// packages/runtime/src/node-identity.ts
|
|
14990
|
+
import {
|
|
14991
|
+
createHash,
|
|
14992
|
+
createPrivateKey,
|
|
14993
|
+
createPublicKey,
|
|
14994
|
+
generateKeyPairSync,
|
|
14995
|
+
randomBytes,
|
|
14996
|
+
sign,
|
|
14997
|
+
verify
|
|
14998
|
+
} from "crypto";
|
|
14999
|
+
import {
|
|
15000
|
+
chmodSync,
|
|
15001
|
+
existsSync as existsSync3,
|
|
15002
|
+
mkdirSync as mkdirSync2,
|
|
15003
|
+
readFileSync,
|
|
15004
|
+
renameSync,
|
|
15005
|
+
rmSync as rmSync2,
|
|
15006
|
+
writeFileSync as writeFileSync2
|
|
15007
|
+
} from "fs";
|
|
15008
|
+
import { dirname as dirname3, join as join4 } from "path";
|
|
15009
|
+
function nodeIdentityPath(supportDirectory) {
|
|
15010
|
+
const dir = supportDirectory ?? resolveOpenScoutSupportPaths().supportDirectory;
|
|
15011
|
+
return join4(dir, NODE_IDENTITY_FILE);
|
|
15012
|
+
}
|
|
15013
|
+
function loadOrCreateNodeIdentity(supportDirectory) {
|
|
15014
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
15015
|
+
if (existsSync3(path)) {
|
|
15016
|
+
return readAndValidateNodeIdentity(path);
|
|
15017
|
+
}
|
|
15018
|
+
return createNodeIdentity(supportDirectory);
|
|
15019
|
+
}
|
|
15020
|
+
function readStableNodeQualifier(supportDirectory) {
|
|
15021
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
15022
|
+
const cached = stableNodeQualifierCache.get(path);
|
|
15023
|
+
if (cached) {
|
|
15024
|
+
return cached;
|
|
15025
|
+
}
|
|
15026
|
+
if (!existsSync3(path)) {
|
|
15027
|
+
return null;
|
|
15028
|
+
}
|
|
15029
|
+
const nodeQualifier = normalizeNodeQualifier(readAndValidateNodeIdentity(path).nodeQualifier);
|
|
15030
|
+
if (nodeQualifier) {
|
|
15031
|
+
stableNodeQualifierCache.set(path, nodeQualifier);
|
|
15032
|
+
}
|
|
15033
|
+
return nodeQualifier || null;
|
|
15034
|
+
}
|
|
15035
|
+
function readAndValidateNodeIdentity(path) {
|
|
15036
|
+
let parsed;
|
|
15037
|
+
try {
|
|
15038
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
15039
|
+
} catch {
|
|
15040
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
15041
|
+
}
|
|
15042
|
+
if (parsed.version !== 1 || !parsed.publicKey || !parsed.privateKey) {
|
|
15043
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
15044
|
+
}
|
|
15045
|
+
if (parsed.nodeQualifier !== undefined && normalizeNodeQualifier(parsed.nodeQualifier) !== parsed.nodeQualifier) {
|
|
15046
|
+
throw new Error(`Corrupt node identity at ${path}; remove it to generate a fresh one.`);
|
|
15047
|
+
}
|
|
15048
|
+
try {
|
|
15049
|
+
const derived = createPublicKey(importPrivateKey(parsed.privateKey)).export({ type: "spki", format: "der" }).toString("base64");
|
|
15050
|
+
if (derived !== parsed.publicKey) {
|
|
15051
|
+
throw new Error("mismatch");
|
|
15052
|
+
}
|
|
15053
|
+
} catch {
|
|
15054
|
+
throw new Error(`Node identity at ${path} has mismatched or invalid keys; remove it to generate a fresh one.`);
|
|
15055
|
+
}
|
|
15056
|
+
return parsed;
|
|
15057
|
+
}
|
|
15058
|
+
function normalizeNodeQualifier(value) {
|
|
15059
|
+
return typeof value === "string" ? value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
15060
|
+
}
|
|
15061
|
+
function createNodeIdentity(supportDirectory) {
|
|
15062
|
+
if (!supportDirectory) {
|
|
15063
|
+
assertTestIsolatedUserData("write the node identity", "OPENSCOUT_SUPPORT_DIRECTORY");
|
|
15064
|
+
}
|
|
15065
|
+
const path = nodeIdentityPath(supportDirectory);
|
|
15066
|
+
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
|
|
15067
|
+
const identity = {
|
|
15068
|
+
version: 1,
|
|
15069
|
+
publicKey: publicKey.export({ type: "spki", format: "der" }).toString("base64"),
|
|
15070
|
+
privateKey: privateKey.export({ type: "pkcs8", format: "der" }).toString("base64"),
|
|
15071
|
+
createdAt: Date.now()
|
|
15072
|
+
};
|
|
15073
|
+
mkdirSync2(dirname3(path), { recursive: true });
|
|
15074
|
+
try {
|
|
15075
|
+
writeFileSync2(path, `${JSON.stringify(identity, null, 2)}
|
|
15076
|
+
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
15077
|
+
} catch (error) {
|
|
15078
|
+
if (error.code === "EEXIST") {
|
|
15079
|
+
return readAndValidateNodeIdentity(path);
|
|
15080
|
+
}
|
|
15081
|
+
throw error;
|
|
15082
|
+
}
|
|
15083
|
+
try {
|
|
15084
|
+
chmodSync(path, 384);
|
|
15085
|
+
} catch {}
|
|
15086
|
+
return identity;
|
|
15087
|
+
}
|
|
15088
|
+
function nodeKeyId(publicKeyBase64) {
|
|
15089
|
+
return createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest("hex");
|
|
15090
|
+
}
|
|
15091
|
+
function nodeFingerprint(publicKeyBase64) {
|
|
15092
|
+
const digest = createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest();
|
|
15093
|
+
const encoded = base32Encode(digest.subarray(0, 10)).toLowerCase();
|
|
15094
|
+
return `${NODE_FINGERPRINT_PREFIX}:${encoded.slice(0, 4)}-${encoded.slice(4, 8)}`;
|
|
15095
|
+
}
|
|
15096
|
+
function signNodePayload(identity, payload) {
|
|
15097
|
+
const key = importPrivateKey(identity.privateKey);
|
|
15098
|
+
return sign(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key).toString("base64");
|
|
15099
|
+
}
|
|
15100
|
+
function verifyNodeSignature(publicKeyBase64, payload, signatureBase64) {
|
|
15101
|
+
try {
|
|
15102
|
+
const key = importPublicKey(publicKeyBase64);
|
|
15103
|
+
return verify(null, typeof payload === "string" ? Buffer.from(payload, "utf8") : payload, key, Buffer.from(signatureBase64, "base64"));
|
|
15104
|
+
} catch {
|
|
15105
|
+
return false;
|
|
15106
|
+
}
|
|
15107
|
+
}
|
|
15108
|
+
function canonicalJson(value) {
|
|
15109
|
+
if (value === null || typeof value !== "object") {
|
|
15110
|
+
return JSON.stringify(value);
|
|
15111
|
+
}
|
|
15112
|
+
if (Array.isArray(value)) {
|
|
15113
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
15114
|
+
}
|
|
15115
|
+
const record2 = value;
|
|
15116
|
+
const keys = Object.keys(record2).sort();
|
|
15117
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record2[key])}`).join(",")}}`;
|
|
15118
|
+
}
|
|
15119
|
+
function verifySignedNodeCard(card, now = Date.now()) {
|
|
15120
|
+
if (nodeKeyId(card.publicKey) !== card.keyId) {
|
|
15121
|
+
return false;
|
|
15122
|
+
}
|
|
15123
|
+
if (nodeFingerprint(card.publicKey) !== card.fingerprint) {
|
|
15124
|
+
return false;
|
|
15125
|
+
}
|
|
15126
|
+
if (!Number.isFinite(card.expiresAt) || card.expiresAt <= now) {
|
|
15127
|
+
return false;
|
|
15128
|
+
}
|
|
15129
|
+
if (card.tls !== undefined) {
|
|
15130
|
+
if (typeof card.tls !== "object" || card.tls === null || typeof card.tls.spkiFingerprint !== "string" || !/^[0-9a-f]{64}$/.test(card.tls.spkiFingerprint)) {
|
|
15131
|
+
return false;
|
|
15132
|
+
}
|
|
15133
|
+
}
|
|
15134
|
+
const { signature, ...unsigned } = card;
|
|
15135
|
+
return verifyNodeSignature(card.publicKey, canonicalJson(unsigned), signature);
|
|
15136
|
+
}
|
|
15137
|
+
function base32Encode(input) {
|
|
15138
|
+
let bits = 0;
|
|
15139
|
+
let value = 0;
|
|
15140
|
+
let output = "";
|
|
15141
|
+
for (const byte of input) {
|
|
15142
|
+
value = value << 8 | byte;
|
|
15143
|
+
bits += 8;
|
|
15144
|
+
while (bits >= 5) {
|
|
15145
|
+
output += BASE32_ALPHABET[value >>> bits - 5 & 31];
|
|
15146
|
+
bits -= 5;
|
|
15147
|
+
}
|
|
15148
|
+
}
|
|
15149
|
+
if (bits > 0) {
|
|
15150
|
+
output += BASE32_ALPHABET[value << 5 - bits & 31];
|
|
15151
|
+
}
|
|
15152
|
+
return output;
|
|
15153
|
+
}
|
|
15154
|
+
function importPrivateKey(privateKeyBase64) {
|
|
15155
|
+
return createPrivateKey({ key: Buffer.from(privateKeyBase64, "base64"), format: "der", type: "pkcs8" });
|
|
15156
|
+
}
|
|
15157
|
+
function importPublicKey(publicKeyBase64) {
|
|
15158
|
+
return createPublicKey({ key: Buffer.from(publicKeyBase64, "base64"), format: "der", type: "spki" });
|
|
15159
|
+
}
|
|
15160
|
+
var NODE_IDENTITY_FILE = "node-identity.json", NODE_FINGERPRINT_PREFIX = "osc1", NODE_CARD_TTL_MS, stableNodeQualifierCache, BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
15161
|
+
var init_node_identity = __esm(() => {
|
|
15162
|
+
init_support_paths();
|
|
15163
|
+
NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
15164
|
+
stableNodeQualifierCache = new Map;
|
|
15165
|
+
});
|
|
15166
|
+
|
|
15199
15167
|
// packages/runtime/src/mesh-peer-auth.ts
|
|
15200
15168
|
import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
|
|
15201
15169
|
function assertNoNewlines(component, name) {
|
|
@@ -32764,18 +32732,15 @@ import {
|
|
|
32764
32732
|
renameSync as renameSync2,
|
|
32765
32733
|
writeFileSync as writeFileSync3
|
|
32766
32734
|
} from "fs";
|
|
32767
|
-
import { randomBytes as randomBytes4 } from "crypto";
|
|
32768
32735
|
import { homedir as homedir4, hostname as osHostname } from "os";
|
|
32769
32736
|
import { dirname as dirname4, join as join6 } from "path";
|
|
32770
32737
|
function normalizeLocalHostnameLabel(value) {
|
|
32771
|
-
const
|
|
32772
|
-
const firstLabel = stripped?.trim().replace(/\.local\.?$/i, "").split(".").find((part) => part.trim().length > 0)?.trim();
|
|
32738
|
+
const firstLabel = value?.trim().replace(/\.local\.?$/i, "").split(".").find((part) => part.trim().length > 0)?.trim();
|
|
32773
32739
|
const normalized = firstLabel?.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
|
|
32774
32740
|
return normalized || "localhost";
|
|
32775
32741
|
}
|
|
32776
32742
|
function normalizeLocalHostname(value) {
|
|
32777
|
-
const
|
|
32778
|
-
const trimmed = stripped?.trim().replace(/\.$/, "").toLowerCase();
|
|
32743
|
+
const trimmed = value?.trim().replace(/\.$/, "").toLowerCase();
|
|
32779
32744
|
const labels = trimmed?.split(".").map((label) => label.trim().replace(/[^a-z0-9-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-")).filter(Boolean);
|
|
32780
32745
|
return labels && labels.length > 0 ? labels.join(".") : "localhost";
|
|
32781
32746
|
}
|
|
@@ -32901,32 +32866,9 @@ function writeLocalConfig(config) {
|
|
|
32901
32866
|
function localConfigExists() {
|
|
32902
32867
|
return existsSync6(localConfigPath());
|
|
32903
32868
|
}
|
|
32904
|
-
function resolveWebAuthToken(env = process.env) {
|
|
32905
|
-
const envToken = env.OPENSCOUT_WEB_AUTH_TOKEN?.trim();
|
|
32906
|
-
if (envToken)
|
|
32907
|
-
return envToken;
|
|
32908
|
-
const supportDir = env.OPENSCOUT_SUPPORT_DIRECTORY ?? join6(homedir4(), "Library", "Application Support", "OpenScout");
|
|
32909
|
-
const tokenPath = join6(supportDir, "runtime", "web-auth-token");
|
|
32910
|
-
try {
|
|
32911
|
-
if (existsSync6(tokenPath)) {
|
|
32912
|
-
const stored = readFileSync4(tokenPath, "utf8").trim();
|
|
32913
|
-
if (stored)
|
|
32914
|
-
return stored;
|
|
32915
|
-
}
|
|
32916
|
-
} catch {}
|
|
32917
|
-
const generated = randomBytes4(32).toString("base64url");
|
|
32918
|
-
try {
|
|
32919
|
-
if (false) {}
|
|
32920
|
-
mkdirSync3(dirname4(tokenPath), { recursive: true });
|
|
32921
|
-
writeFileSync3(tokenPath, `${generated}
|
|
32922
|
-
`, { encoding: "utf8", mode: 384 });
|
|
32923
|
-
} catch {}
|
|
32924
|
-
return generated;
|
|
32925
|
-
}
|
|
32926
32869
|
var LOCAL_CONFIG_VERSION = 1, DEFAULT_SCOUT_WEB_PORTAL_HOST = "scout.local", DEFAULT_SCOUT_WEB_DEV_HOST, OPENSCOUT_PORTS, DEFAULT_LOCAL_CONFIG;
|
|
32927
32870
|
var init_local_config = __esm(() => {
|
|
32928
32871
|
init_support_paths();
|
|
32929
|
-
init_node_identity();
|
|
32930
32872
|
DEFAULT_SCOUT_WEB_DEV_HOST = `dev.${DEFAULT_SCOUT_WEB_PORTAL_HOST}`;
|
|
32931
32873
|
OPENSCOUT_PORTS = {
|
|
32932
32874
|
broker: 43110,
|
|
@@ -35361,7 +35303,7 @@ var init_mesh_sas = __esm(() => {
|
|
|
35361
35303
|
});
|
|
35362
35304
|
|
|
35363
35305
|
// packages/runtime/src/mesh-trust-enrollment.ts
|
|
35364
|
-
import { randomBytes as
|
|
35306
|
+
import { randomBytes as randomBytes4 } from "crypto";
|
|
35365
35307
|
|
|
35366
35308
|
class TrustEnrollmentService {
|
|
35367
35309
|
local;
|
|
@@ -35381,11 +35323,11 @@ class TrustEnrollmentService {
|
|
|
35381
35323
|
throw new TrustEnrollmentError("self-enrollment", "cannot enroll with self");
|
|
35382
35324
|
}
|
|
35383
35325
|
const session3 = {
|
|
35384
|
-
id:
|
|
35326
|
+
id: randomBytes4(9).toString("base64url"),
|
|
35385
35327
|
state: "pending",
|
|
35386
35328
|
remoteCard: input.card,
|
|
35387
35329
|
commitment: input.commitment,
|
|
35388
|
-
responderNonce:
|
|
35330
|
+
responderNonce: randomBytes4(32),
|
|
35389
35331
|
createdAt: now,
|
|
35390
35332
|
expiresAt: now + this.ttlMs
|
|
35391
35333
|
};
|
|
@@ -58289,6 +58231,7 @@ var init_service = __esm(() => {
|
|
|
58289
58231
|
});
|
|
58290
58232
|
|
|
58291
58233
|
// packages/runtime/src/pairing-supervisor.ts
|
|
58234
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
58292
58235
|
import {
|
|
58293
58236
|
existsSync as existsSync29,
|
|
58294
58237
|
mkdirSync as mkdirSync9,
|
|
@@ -58306,84 +58249,61 @@ function resolveScoutPairingSupervisorPaths(env = process.env) {
|
|
|
58306
58249
|
rootDir,
|
|
58307
58250
|
intentPath: join34(rootDir, SCOUT_PAIRING_SUPERVISOR_INTENT_FILE),
|
|
58308
58251
|
runtimePidPath: join34(rootDir, SCOUT_PAIRING_RUNTIME_PID_FILE),
|
|
58252
|
+
runtimeOwnerPath: join34(rootDir, SCOUT_PAIRING_RUNTIME_OWNER_FILE),
|
|
58309
58253
|
supervisorPidPath: join34(rootDir, SCOUT_PAIRING_SUPERVISOR_PID_FILE)
|
|
58310
58254
|
};
|
|
58311
58255
|
}
|
|
58312
|
-
function
|
|
58313
|
-
|
|
58314
|
-
|
|
58315
|
-
|
|
58316
|
-
|
|
58317
|
-
|
|
58318
|
-
|
|
58319
|
-
|
|
58320
|
-
|
|
58321
|
-
|
|
58322
|
-
|
|
58323
|
-
|
|
58256
|
+
function inspectScoutPairingProcess(pid) {
|
|
58257
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
58258
|
+
return null;
|
|
58259
|
+
try {
|
|
58260
|
+
const output = execFileSync6("ps", ["-p", String(pid), "-o", "lstart=", "-o", "command="], {
|
|
58261
|
+
encoding: "utf8",
|
|
58262
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
58263
|
+
}).trim();
|
|
58264
|
+
const startedAt = output.slice(0, 24).trim().replace(/\s+/g, " ");
|
|
58265
|
+
const command = output.slice(24).trim();
|
|
58266
|
+
return startedAt && command ? { pid, startedAt, command } : null;
|
|
58267
|
+
} catch {
|
|
58268
|
+
return null;
|
|
58324
58269
|
}
|
|
58325
|
-
writePairingIntent(intentPath, intent);
|
|
58326
|
-
return readScoutPairingSupervisorIntent(intentPath);
|
|
58327
58270
|
}
|
|
58328
|
-
function
|
|
58329
|
-
if (!existsSync29(
|
|
58271
|
+
function readScoutPairingRuntimeOwner(ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath) {
|
|
58272
|
+
if (!existsSync29(ownerPath))
|
|
58330
58273
|
return null;
|
|
58331
58274
|
try {
|
|
58332
|
-
const
|
|
58333
|
-
return Number.isInteger(pid) && pid > 0 ?
|
|
58275
|
+
const value = JSON.parse(readFileSync14(ownerPath, "utf8"));
|
|
58276
|
+
return value.version === 1 && Number.isInteger(value.pid) && (value.pid ?? 0) > 0 && typeof value.token === "string" && value.token.length >= 16 && typeof value.startedAt === "string" && value.startedAt.length > 0 && typeof value.command === "string" && value.command.includes(SCOUT_PAIRING_RUNTIME_PROCESS_MARKER) && typeof value.claimedAt === "number" && Number.isFinite(value.claimedAt) ? value : null;
|
|
58334
58277
|
} catch {
|
|
58335
58278
|
return null;
|
|
58336
58279
|
}
|
|
58337
58280
|
}
|
|
58338
|
-
function
|
|
58339
|
-
if (!
|
|
58281
|
+
function isScoutPairingRuntimeOwnerLive(owner, options = {}) {
|
|
58282
|
+
if (!owner || options.expectedToken && owner.token !== options.expectedToken)
|
|
58283
|
+
return false;
|
|
58284
|
+
const current = (options.inspect ?? inspectScoutPairingProcess)(owner.pid);
|
|
58285
|
+
return current !== null && current.startedAt === owner.startedAt && current.command === owner.command && current.command.includes(SCOUT_PAIRING_RUNTIME_PROCESS_MARKER);
|
|
58286
|
+
}
|
|
58287
|
+
function readLiveScoutPairingRuntimeOwner(ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath, options = {}) {
|
|
58288
|
+
const owner = readScoutPairingRuntimeOwner(ownerPath);
|
|
58289
|
+
return isScoutPairingRuntimeOwnerLive(owner, options) ? owner : null;
|
|
58290
|
+
}
|
|
58291
|
+
function signalScoutPairingRuntimeOwner(owner, signal, options = {}) {
|
|
58292
|
+
const ownerPath = options.ownerPath ?? resolveScoutPairingSupervisorPaths().runtimeOwnerPath;
|
|
58293
|
+
const current = readLiveScoutPairingRuntimeOwner(ownerPath, {
|
|
58294
|
+
expectedToken: owner.token,
|
|
58295
|
+
inspect: options.inspect
|
|
58296
|
+
});
|
|
58297
|
+
if (!current || current.pid !== owner.pid)
|
|
58340
58298
|
return false;
|
|
58341
58299
|
try {
|
|
58342
|
-
process.kill(pid,
|
|
58300
|
+
(options.kill ?? ((pid, nextSignal) => process.kill(pid, nextSignal)))(owner.pid, signal);
|
|
58343
58301
|
return true;
|
|
58344
|
-
} catch (error) {
|
|
58345
|
-
return error.code === "EPERM";
|
|
58346
|
-
}
|
|
58347
|
-
}
|
|
58348
|
-
function readLiveScoutPairingSupervisorPid(supervisorPidPath = resolveScoutPairingSupervisorPaths().supervisorPidPath) {
|
|
58349
|
-
const pid = readScoutPairingProcessPid(supervisorPidPath);
|
|
58350
|
-
return isScoutPairingProcessRunning(pid) ? pid : null;
|
|
58351
|
-
}
|
|
58352
|
-
function readPairingIntent(intentPath) {
|
|
58353
|
-
if (!existsSync29(intentPath))
|
|
58354
|
-
return {};
|
|
58355
|
-
try {
|
|
58356
|
-
const parsed = JSON.parse(readFileSync14(intentPath, "utf8"));
|
|
58357
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
58358
|
-
return { desiredState: "stopped" };
|
|
58359
|
-
}
|
|
58360
|
-
const intent = parsed;
|
|
58361
|
-
if (intent.desiredState !== "running" && intent.desiredState !== "stopped") {
|
|
58362
|
-
intent.desiredState = "stopped";
|
|
58363
|
-
}
|
|
58364
|
-
return intent;
|
|
58365
58302
|
} catch {
|
|
58366
|
-
return
|
|
58367
|
-
}
|
|
58368
|
-
}
|
|
58369
|
-
function writePairingIntent(intentPath, intent) {
|
|
58370
|
-
mkdirSync9(dirname22(intentPath), { recursive: true });
|
|
58371
|
-
writeFileAtomically(intentPath, `${JSON.stringify(intent, null, 2)}
|
|
58372
|
-
`);
|
|
58373
|
-
}
|
|
58374
|
-
function writeFileAtomically(path, contents) {
|
|
58375
|
-
const temporaryPath = `${path}.${process.pid}.${Date.now()}.tmp`;
|
|
58376
|
-
try {
|
|
58377
|
-
writeFileSync8(temporaryPath, contents);
|
|
58378
|
-
renameSync4(temporaryPath, path);
|
|
58379
|
-
} finally {
|
|
58380
|
-
rmSync4(temporaryPath, { force: true });
|
|
58303
|
+
return false;
|
|
58381
58304
|
}
|
|
58382
58305
|
}
|
|
58383
|
-
|
|
58384
|
-
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
|
|
58385
|
-
}
|
|
58386
|
-
var SCOUT_PAIRING_SUPERVISOR_INTENT_FILE = "supervisor.json", SCOUT_PAIRING_RUNTIME_PID_FILE = "runtime.pid", SCOUT_PAIRING_SUPERVISOR_PID_FILE = "supervisor.pid";
|
|
58306
|
+
var SCOUT_PAIRING_SUPERVISOR_INTENT_FILE = "supervisor.json", SCOUT_PAIRING_RUNTIME_PID_FILE = "runtime.pid", SCOUT_PAIRING_RUNTIME_OWNER_FILE = "runtime-owner.json", SCOUT_PAIRING_SUPERVISOR_PID_FILE = "supervisor.pid", SCOUT_PAIRING_RUNTIME_PROCESS_MARKER = "pairing-runtime-controller";
|
|
58387
58307
|
var init_pairing_supervisor = () => {};
|
|
58388
58308
|
|
|
58389
58309
|
// packages/web/server/pairing.ts
|
|
@@ -58629,7 +58549,7 @@ function clearScoutPairingRuntimePid() {
|
|
|
58629
58549
|
unlinkSync(runtimePidPath);
|
|
58630
58550
|
} catch {}
|
|
58631
58551
|
}
|
|
58632
|
-
function
|
|
58552
|
+
function isScoutPairingProcessRunning(pid) {
|
|
58633
58553
|
if (!pid || !Number.isInteger(pid) || pid <= 0) {
|
|
58634
58554
|
return false;
|
|
58635
58555
|
}
|
|
@@ -58645,15 +58565,15 @@ function staleScoutPairingRuntimeOwnerPid() {
|
|
|
58645
58565
|
if (!pid) {
|
|
58646
58566
|
return null;
|
|
58647
58567
|
}
|
|
58648
|
-
return
|
|
58568
|
+
return isScoutPairingProcessRunning(pid) ? null : pid;
|
|
58649
58569
|
}
|
|
58650
58570
|
function isScoutPairingRuntimeRunning() {
|
|
58651
58571
|
const pid = readScoutPairingRuntimePid();
|
|
58652
|
-
if (
|
|
58572
|
+
if (isScoutPairingProcessRunning(pid)) {
|
|
58653
58573
|
return true;
|
|
58654
58574
|
}
|
|
58655
58575
|
const snapshot = readScoutPairingRuntimeSnapshot();
|
|
58656
|
-
return Boolean(snapshot &&
|
|
58576
|
+
return Boolean(snapshot && isScoutPairingProcessRunning(snapshot.childPid ?? snapshot.pid));
|
|
58657
58577
|
}
|
|
58658
58578
|
function clearStaleScoutPairingRuntimeFiles() {
|
|
58659
58579
|
const staleOwnerPid = staleScoutPairingRuntimeOwnerPid();
|
|
@@ -58661,7 +58581,7 @@ function clearStaleScoutPairingRuntimeFiles() {
|
|
|
58661
58581
|
return;
|
|
58662
58582
|
}
|
|
58663
58583
|
const snapshot = readScoutPairingRuntimeSnapshot();
|
|
58664
|
-
if (snapshot &&
|
|
58584
|
+
if (snapshot && isScoutPairingProcessRunning(snapshot.childPid ?? snapshot.pid)) {
|
|
58665
58585
|
return;
|
|
58666
58586
|
}
|
|
58667
58587
|
clearScoutPairingRuntimePid();
|
|
@@ -58912,10 +58832,11 @@ async function ensureDefaultScoutPairingWorkspaceConfig(currentDirectory) {
|
|
|
58912
58832
|
}
|
|
58913
58833
|
});
|
|
58914
58834
|
}
|
|
58915
|
-
async function waitForScoutPairingProcessExit(
|
|
58835
|
+
async function waitForScoutPairingProcessExit(owner) {
|
|
58836
|
+
const ownerPath = resolveScoutPairingSupervisorPaths().runtimeOwnerPath;
|
|
58916
58837
|
const startedAt = Date.now();
|
|
58917
58838
|
while (Date.now() - startedAt < SCOUT_PAIRING_PROCESS_EXIT_TIMEOUT_MS) {
|
|
58918
|
-
if (!
|
|
58839
|
+
if (!readLiveScoutPairingRuntimeOwner(ownerPath, { expectedToken: owner.token })) {
|
|
58919
58840
|
return;
|
|
58920
58841
|
}
|
|
58921
58842
|
await sleep2(SCOUT_PAIRING_PROCESS_EXIT_POLL_MS);
|
|
@@ -58941,10 +58862,13 @@ async function startScoutPairingRuntime() {
|
|
|
58941
58862
|
await sleep2(SCOUT_PAIRING_RUNTIME_BOOTSTRAP_DELAY_MS);
|
|
58942
58863
|
}
|
|
58943
58864
|
async function stopScoutPairingRuntime() {
|
|
58865
|
+
const supervisorPaths = resolveScoutPairingSupervisorPaths();
|
|
58944
58866
|
const pid = readScoutPairingRuntimePid();
|
|
58945
|
-
|
|
58946
|
-
|
|
58947
|
-
|
|
58867
|
+
const owner = readLiveScoutPairingRuntimeOwner(supervisorPaths.runtimeOwnerPath);
|
|
58868
|
+
if (pid && owner?.pid === pid && signalScoutPairingRuntimeOwner(owner, "SIGTERM", {
|
|
58869
|
+
ownerPath: supervisorPaths.runtimeOwnerPath
|
|
58870
|
+
})) {
|
|
58871
|
+
await waitForScoutPairingProcessExit(owner);
|
|
58948
58872
|
}
|
|
58949
58873
|
}
|
|
58950
58874
|
async function restartScoutPairingRuntime() {
|
|
@@ -58957,24 +58881,6 @@ async function ensureScoutPairingRuntimeStarted() {
|
|
|
58957
58881
|
}
|
|
58958
58882
|
await startScoutPairingRuntime();
|
|
58959
58883
|
}
|
|
58960
|
-
async function requestPairingActionFromSupervisor(action) {
|
|
58961
|
-
const paths2 = resolveScoutPairingSupervisorPaths();
|
|
58962
|
-
const previousPid = readScoutPairingProcessPid(paths2.runtimePidPath);
|
|
58963
|
-
updateScoutPairingSupervisorIntent(action, paths2.intentPath);
|
|
58964
|
-
const supervisorPid = readLiveScoutPairingSupervisorPid(paths2.supervisorPidPath);
|
|
58965
|
-
if (!supervisorPid)
|
|
58966
|
-
return false;
|
|
58967
|
-
const deadline = Date.now() + SCOUT_PAIRING_SUPERVISOR_ACTION_TIMEOUT_MS;
|
|
58968
|
-
while (Date.now() < deadline) {
|
|
58969
|
-
const currentPid = readScoutPairingProcessPid(paths2.runtimePidPath);
|
|
58970
|
-
const running = isScoutPairingProcessRunning(currentPid);
|
|
58971
|
-
if (action === "stop" ? !running : running && (action !== "restart" || currentPid !== previousPid)) {
|
|
58972
|
-
return true;
|
|
58973
|
-
}
|
|
58974
|
-
await sleep2(SCOUT_PAIRING_PROCESS_EXIT_POLL_MS);
|
|
58975
|
-
}
|
|
58976
|
-
throw new Error(`Scout pairing supervisor ${supervisorPid} did not complete ${action} within ${SCOUT_PAIRING_SUPERVISOR_ACTION_TIMEOUT_MS}ms.`);
|
|
58977
|
-
}
|
|
58978
58884
|
function serializePairingMutation(fn) {
|
|
58979
58885
|
const next = pairingMutationChain.then(fn);
|
|
58980
58886
|
pairingMutationChain = next.catch(() => {
|
|
@@ -59011,20 +58917,14 @@ async function controlScoutWebPairingService(action, currentDirectory) {
|
|
|
59011
58917
|
switch (action) {
|
|
59012
58918
|
case "start":
|
|
59013
58919
|
await ensureDefaultScoutPairingWorkspaceConfig(currentDirectory);
|
|
59014
|
-
|
|
59015
|
-
await ensureScoutPairingRuntimeStarted();
|
|
59016
|
-
}
|
|
58920
|
+
await ensureScoutPairingRuntimeStarted();
|
|
59017
58921
|
break;
|
|
59018
58922
|
case "stop":
|
|
59019
|
-
|
|
59020
|
-
await stopScoutPairingRuntime();
|
|
59021
|
-
}
|
|
58923
|
+
await stopScoutPairingRuntime();
|
|
59022
58924
|
break;
|
|
59023
58925
|
case "restart":
|
|
59024
58926
|
await ensureDefaultScoutPairingWorkspaceConfig(currentDirectory);
|
|
59025
|
-
|
|
59026
|
-
await restartScoutPairingRuntime();
|
|
59027
|
-
}
|
|
58927
|
+
await restartScoutPairingRuntime();
|
|
59028
58928
|
break;
|
|
59029
58929
|
}
|
|
59030
58930
|
return readScoutPairingState(currentDirectory);
|
|
@@ -59044,7 +58944,7 @@ async function decideScoutWebPairingApproval(input, currentDirectory) {
|
|
|
59044
58944
|
});
|
|
59045
58945
|
return readScoutPairingState(currentDirectory);
|
|
59046
58946
|
}
|
|
59047
|
-
var SCOUT_PAIRING_HOME_DIRECTORY = ".scout/pairing", SCOUT_PAIRING_CONFIG_FILE = "config.json", SCOUT_PAIRING_IDENTITY_FILE = "identity.json", SCOUT_PAIRING_TRUSTED_PEERS_FILE = "trusted-peers.json", SCOUT_PAIRING_LOG_FILE = "bridge.log", SCOUT_PAIRING_RUNTIME_STATE_FILE = "runtime.json", SCOUT_PAIRING_RUNTIME_PID_FILE2 = "runtime.pid", SCOUT_PAIRING_DEFAULT_PORT = 7888, SCOUT_PAIRING_LOG_TAIL_LINE_LIMIT = 160, SCOUT_PAIRING_RUNTIME_BOOTSTRAP_DELAY_MS = 350, SCOUT_PAIRING_PROCESS_EXIT_TIMEOUT_MS = 5000,
|
|
58947
|
+
var SCOUT_PAIRING_HOME_DIRECTORY = ".scout/pairing", SCOUT_PAIRING_CONFIG_FILE = "config.json", SCOUT_PAIRING_IDENTITY_FILE = "identity.json", SCOUT_PAIRING_TRUSTED_PEERS_FILE = "trusted-peers.json", SCOUT_PAIRING_LOG_FILE = "bridge.log", SCOUT_PAIRING_RUNTIME_STATE_FILE = "runtime.json", SCOUT_PAIRING_RUNTIME_PID_FILE2 = "runtime.pid", SCOUT_PAIRING_DEFAULT_PORT = 7888, SCOUT_PAIRING_LOG_TAIL_LINE_LIMIT = 160, SCOUT_PAIRING_RUNTIME_BOOTSTRAP_DELAY_MS = 350, SCOUT_PAIRING_PROCESS_EXIT_TIMEOUT_MS = 5000, SCOUT_PAIRING_PROCESS_EXIT_POLL_MS = 100, SCOUT_PAIRING_COMMAND_LABEL = "openscout-web pair", SCOUT_PAIRING_RUNTIME_VERSION = 1, SCOUT_PAIRING_RUNTIME_SCRIPT = "pairing-runtime-controller.ts", SCOUT_PAIRING_BRIDGE_CONNECT_TIMEOUT_MS = 1500, SCOUT_PAIRING_BRIDGE_REQUEST_TIMEOUT_MS = 2500, pairingMutationChain;
|
|
59048
58948
|
var init_pairing = __esm(() => {
|
|
59049
58949
|
init_src2();
|
|
59050
58950
|
init_setup();
|
|
@@ -59223,10 +59123,10 @@ function metadataRecord6(value) {
|
|
|
59223
59123
|
// packages/web/server/db/internal/db.ts
|
|
59224
59124
|
import { Database as Database3 } from "bun:sqlite";
|
|
59225
59125
|
import { homedir as homedir32 } from "os";
|
|
59226
|
-
import { join as
|
|
59126
|
+
import { join as join43 } from "path";
|
|
59227
59127
|
function resolveDbPath() {
|
|
59228
|
-
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ??
|
|
59229
|
-
return
|
|
59128
|
+
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join43(homedir32(), ".openscout", "control-plane");
|
|
59129
|
+
return join43(controlHome, "control-plane.sqlite");
|
|
59230
59130
|
}
|
|
59231
59131
|
function configureReadonlyDb(db2) {
|
|
59232
59132
|
db2.exec(`PRAGMA busy_timeout = ${DB_BUSY_TIMEOUT_MS}`);
|
|
@@ -59276,7 +59176,7 @@ var init_parse2 = __esm(() => {
|
|
|
59276
59176
|
|
|
59277
59177
|
// packages/web/server/db/internal/paths.ts
|
|
59278
59178
|
import { homedir as homedir33 } from "os";
|
|
59279
|
-
import { join as
|
|
59179
|
+
import { join as join45 } from "path";
|
|
59280
59180
|
function compact(p) {
|
|
59281
59181
|
if (!p)
|
|
59282
59182
|
return null;
|
|
@@ -59288,10 +59188,10 @@ function pairingHarnessLogPath(adapterType, sessionId) {
|
|
|
59288
59188
|
if (!normalizedAdapter || !normalizedSessionId) {
|
|
59289
59189
|
return null;
|
|
59290
59190
|
}
|
|
59291
|
-
return
|
|
59191
|
+
return join45(HOME, ".scout", "pairing", normalizedAdapter, normalizedSessionId, "logs", "stdout.log");
|
|
59292
59192
|
}
|
|
59293
59193
|
function localAgentHarnessLogPath(agentId) {
|
|
59294
|
-
return
|
|
59194
|
+
return join45(localAgentLogsDirectory(agentId), "stdout.log");
|
|
59295
59195
|
}
|
|
59296
59196
|
function adapterLogNamespaceForTransport(transport) {
|
|
59297
59197
|
const normalized = transport?.trim();
|
|
@@ -63743,9 +63643,9 @@ var init_prefilter = __esm(() => {
|
|
|
63743
63643
|
});
|
|
63744
63644
|
|
|
63745
63645
|
// packages/web/server/scoutbot/thread-map.ts
|
|
63746
|
-
import { mkdir as mkdir13, readFile as
|
|
63646
|
+
import { mkdir as mkdir13, readFile as readFile15, writeFile as writeFile12 } from "fs/promises";
|
|
63747
63647
|
import { randomUUID as randomUUID10 } from "crypto";
|
|
63748
|
-
import { dirname as dirname32, join as
|
|
63648
|
+
import { dirname as dirname32, join as join58 } from "path";
|
|
63749
63649
|
|
|
63750
63650
|
class ScoutbotThreadMapStore {
|
|
63751
63651
|
filePath;
|
|
@@ -63862,7 +63762,7 @@ class ScoutbotThreadMapStore {
|
|
|
63862
63762
|
}
|
|
63863
63763
|
async read() {
|
|
63864
63764
|
try {
|
|
63865
|
-
const raw2 = await
|
|
63765
|
+
const raw2 = await readFile15(this.filePath, "utf8");
|
|
63866
63766
|
const parsed = JSON.parse(raw2);
|
|
63867
63767
|
const threads = Array.isArray(parsed.threads) ? parsed.threads.filter(isThreadRecord).map((thread) => ({
|
|
63868
63768
|
...thread,
|
|
@@ -63887,7 +63787,7 @@ class ScoutbotThreadMapStore {
|
|
|
63887
63787
|
}
|
|
63888
63788
|
}
|
|
63889
63789
|
function defaultScoutbotThreadMapPath() {
|
|
63890
|
-
return
|
|
63790
|
+
return join58(resolveOpenScoutSupportPaths().supportDirectory, "scoutbot-threads.json");
|
|
63891
63791
|
}
|
|
63892
63792
|
function chooseDefaultConversationId(snapshot) {
|
|
63893
63793
|
const existing = Object.values(snapshot?.conversations ?? {}).find((conversation) => conversation.metadata?.scoutbotThreadId === SCOUTBOT_DEFAULT_THREAD_ID && isOpaqueChannelId(conversation.id));
|
|
@@ -64713,7 +64613,7 @@ var init_runner = __esm(() => {
|
|
|
64713
64613
|
// packages/runtime/src/agent-workspace.ts
|
|
64714
64614
|
import { existsSync as existsSync44 } from "fs";
|
|
64715
64615
|
import { mkdir as mkdir14 } from "fs/promises";
|
|
64716
|
-
import { join as
|
|
64616
|
+
import { join as join61 } from "path";
|
|
64717
64617
|
async function isGitRepo(projectRoot) {
|
|
64718
64618
|
try {
|
|
64719
64619
|
await execSystemFile("git", ["rev-parse", "--git-dir"], { cwd: projectRoot, timeoutMs: 2000 });
|
|
@@ -64733,8 +64633,8 @@ async function createAgentWorkspace(projectRoot, agentName, requestedBranch) {
|
|
|
64733
64633
|
}
|
|
64734
64634
|
const branch = requestedBranch?.trim() || `scout/${agentName}`;
|
|
64735
64635
|
validateWorktreeBranch(branch);
|
|
64736
|
-
const workspaceDir =
|
|
64737
|
-
const workspacePath =
|
|
64636
|
+
const workspaceDir = join61(projectRoot, SCOUT_WORKSPACES_DIRNAME);
|
|
64637
|
+
const workspacePath = join61(workspaceDir, agentName);
|
|
64738
64638
|
if (existsSync44(workspacePath)) {
|
|
64739
64639
|
return { path: workspacePath, branch };
|
|
64740
64640
|
}
|
|
@@ -64785,7 +64685,7 @@ import { createHash as createHash8 } from "crypto";
|
|
|
64785
64685
|
import { existsSync as existsSync45, mkdirSync as mkdirSync19, readdirSync as readdirSync12, readFileSync as readFileSync27, renameSync as renameSync7, statSync as statSync17, writeFileSync as writeFileSync17 } from "fs";
|
|
64786
64686
|
import { open as open2 } from "fs/promises";
|
|
64787
64687
|
import { homedir as homedir45 } from "os";
|
|
64788
|
-
import { dirname as dirname35, join as
|
|
64688
|
+
import { dirname as dirname35, join as join62 } from "path";
|
|
64789
64689
|
import { createInterface as createInterface2 } from "readline";
|
|
64790
64690
|
import { Database as Database7 } from "bun:sqlite";
|
|
64791
64691
|
async function loadServiceBudgets(forceRefresh = false) {
|
|
@@ -64860,7 +64760,7 @@ async function loadCodexGauge(forceRefresh = false) {
|
|
|
64860
64760
|
harness: "codex",
|
|
64861
64761
|
maxAgeMs: WEEK_MS
|
|
64862
64762
|
});
|
|
64863
|
-
const root =
|
|
64763
|
+
const root = join62(homeDir(), ".codex", "sessions");
|
|
64864
64764
|
if (!existsSync45(root))
|
|
64865
64765
|
return fallback;
|
|
64866
64766
|
const recent = findRecentCodexJsonl(root, CODEX_LOOKBACK_DAYS);
|
|
@@ -64955,14 +64855,14 @@ function findRecentCodexJsonl(root, lookbackDays) {
|
|
|
64955
64855
|
return;
|
|
64956
64856
|
}
|
|
64957
64857
|
for (const entry of entries2) {
|
|
64958
|
-
const full =
|
|
64858
|
+
const full = join62(dir, entry.name);
|
|
64959
64859
|
if (entry.isDirectory()) {
|
|
64960
64860
|
walk(full);
|
|
64961
64861
|
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
64962
|
-
const
|
|
64963
|
-
if (!
|
|
64862
|
+
const stat9 = safeStat(full);
|
|
64863
|
+
if (!stat9 || stat9.mtimeMs < cutoffMs)
|
|
64964
64864
|
continue;
|
|
64965
|
-
paths2.push({ path: full, mtimeMs:
|
|
64865
|
+
paths2.push({ path: full, mtimeMs: stat9.mtimeMs });
|
|
64966
64866
|
}
|
|
64967
64867
|
}
|
|
64968
64868
|
};
|
|
@@ -65038,7 +64938,7 @@ function claudeStatuslineDir() {
|
|
|
65038
64938
|
return resolveClaudeStatuslineDirectory();
|
|
65039
64939
|
}
|
|
65040
64940
|
function readClaudeStatuslineLatest() {
|
|
65041
|
-
return readJsonRecord3(
|
|
64941
|
+
return readJsonRecord3(join62(claudeStatuslineDir(), "claude-latest.json"));
|
|
65042
64942
|
}
|
|
65043
64943
|
function loadClaudeStatuslineQuotaSnapshots() {
|
|
65044
64944
|
const now = Date.now();
|
|
@@ -65050,9 +64950,9 @@ function loadClaudeStatuslineQuotaSnapshots() {
|
|
|
65050
64950
|
].flatMap((record2) => claudeQuotaSnapshotsFromStatusline(record2)).sort((a, b) => b.capturedAt - a.capturedAt).slice(0, PERSISTED_QUOTA_ROW_LIMIT);
|
|
65051
64951
|
}
|
|
65052
64952
|
function readClaudeStatuslineHistory(minCapturedAt) {
|
|
65053
|
-
const path2 =
|
|
65054
|
-
const
|
|
65055
|
-
if (!
|
|
64953
|
+
const path2 = join62(claudeStatuslineDir(), "claude-history.jsonl");
|
|
64954
|
+
const stat9 = safeStat(path2);
|
|
64955
|
+
if (!stat9)
|
|
65056
64956
|
return [];
|
|
65057
64957
|
let content;
|
|
65058
64958
|
try {
|
|
@@ -65060,7 +64960,7 @@ function readClaudeStatuslineHistory(minCapturedAt) {
|
|
|
65060
64960
|
} catch {
|
|
65061
64961
|
return [];
|
|
65062
64962
|
}
|
|
65063
|
-
if (
|
|
64963
|
+
if (stat9.size > CLAUDE_STATUSLINE_HISTORY_MAX_BYTES) {
|
|
65064
64964
|
content = content.slice(-CLAUDE_STATUSLINE_HISTORY_MAX_BYTES);
|
|
65065
64965
|
const firstNewline = content.indexOf(`
|
|
65066
64966
|
`);
|
|
@@ -65443,12 +65343,12 @@ async function readKimiUsageResponse() {
|
|
|
65443
65343
|
}
|
|
65444
65344
|
}
|
|
65445
65345
|
function kimiCodeHome() {
|
|
65446
|
-
return process.env.KIMI_CODE_HOME?.trim() ||
|
|
65346
|
+
return process.env.KIMI_CODE_HOME?.trim() || join62(homeDir(), ".kimi-code");
|
|
65447
65347
|
}
|
|
65448
65348
|
function readKimiCredentials() {
|
|
65449
|
-
const candidates = [
|
|
65349
|
+
const candidates = [join62(kimiCodeHome(), "credentials", "kimi-code.json")];
|
|
65450
65350
|
if (!process.env.KIMI_CODE_HOME?.trim()) {
|
|
65451
|
-
candidates.push(
|
|
65351
|
+
candidates.push(join62(homeDir(), ".kimi", "credentials", "kimi-code.json"));
|
|
65452
65352
|
}
|
|
65453
65353
|
for (const path2 of candidates) {
|
|
65454
65354
|
const credentials = readJsonRecord3(path2);
|
|
@@ -65552,7 +65452,7 @@ function importProviderDashboardUsage(input) {
|
|
|
65552
65452
|
return gauge;
|
|
65553
65453
|
}
|
|
65554
65454
|
function dashboardImportPath() {
|
|
65555
|
-
return
|
|
65455
|
+
return join62(dirname35(resolveDbPath()), "provider-usage-snapshots.json");
|
|
65556
65456
|
}
|
|
65557
65457
|
function readDashboardUsageStore() {
|
|
65558
65458
|
const record2 = readJsonRecord3(dashboardImportPath());
|
|
@@ -65758,12 +65658,12 @@ async function loadGrokGauge() {
|
|
|
65758
65658
|
};
|
|
65759
65659
|
}
|
|
65760
65660
|
async function loadGrokBillingQuotaSnapshots() {
|
|
65761
|
-
const path2 =
|
|
65762
|
-
const
|
|
65763
|
-
if (!
|
|
65661
|
+
const path2 = join62(homeDir(), ".grok", "logs", "unified.jsonl");
|
|
65662
|
+
const stat9 = safeStat(path2);
|
|
65663
|
+
if (!stat9 || stat9.size <= 0)
|
|
65764
65664
|
return [];
|
|
65765
|
-
const length = Math.min(
|
|
65766
|
-
const start = Math.max(0,
|
|
65665
|
+
const length = Math.min(stat9.size, GROK_BILLING_LOG_MAX_BYTES);
|
|
65666
|
+
const start = Math.max(0, stat9.size - length);
|
|
65767
65667
|
let content = "";
|
|
65768
65668
|
let handle;
|
|
65769
65669
|
try {
|
|
@@ -65836,7 +65736,7 @@ function loadGrokLocalUsage() {
|
|
|
65836
65736
|
const usage = grokUsageFromRecord(parsed, Date.now());
|
|
65837
65737
|
return usage ? [usage] : [];
|
|
65838
65738
|
}
|
|
65839
|
-
const root =
|
|
65739
|
+
const root = join62(homeDir(), ".grok", "sessions");
|
|
65840
65740
|
if (!existsSync45(root))
|
|
65841
65741
|
return [];
|
|
65842
65742
|
const cutoff = Date.now() - WEEK_MS;
|
|
@@ -65849,7 +65749,7 @@ function loadGrokLocalUsage() {
|
|
|
65849
65749
|
return;
|
|
65850
65750
|
}
|
|
65851
65751
|
for (const entry of entries2) {
|
|
65852
|
-
const path2 =
|
|
65752
|
+
const path2 = join62(directory, entry.name);
|
|
65853
65753
|
if (entry.isDirectory())
|
|
65854
65754
|
walk(path2);
|
|
65855
65755
|
else if (entry.isFile() && entry.name === "updates.jsonl" && (safeStat(path2)?.mtimeMs ?? 0) >= cutoff)
|
|
@@ -65927,8 +65827,8 @@ function readCursorSubscriptionState() {
|
|
|
65927
65827
|
return parseJsonRecord9(fixtureJson);
|
|
65928
65828
|
}
|
|
65929
65829
|
const candidates = [
|
|
65930
|
-
|
|
65931
|
-
|
|
65830
|
+
join62(homeDir(), "Library", "Application Support", "Cursor", "User", "globalStorage", "state.vscdb"),
|
|
65831
|
+
join62(homeDir(), ".config", "Cursor", "User", "globalStorage", "state.vscdb")
|
|
65932
65832
|
];
|
|
65933
65833
|
for (const path2 of candidates) {
|
|
65934
65834
|
if (!existsSync45(path2))
|
|
@@ -66178,7 +66078,7 @@ function githubQuotaSnapshot(core, capturedAt) {
|
|
|
66178
66078
|
}
|
|
66179
66079
|
function detectCloudAccounts() {
|
|
66180
66080
|
const accounts = [];
|
|
66181
|
-
const declaredAccounts = readJsonRecord3(
|
|
66081
|
+
const declaredAccounts = readJsonRecord3(join62(homeDir(), ".scout", "provider-accounts.json"));
|
|
66182
66082
|
const exeAccount = recordValue4(declaredAccounts?.exe);
|
|
66183
66083
|
if (exeAccount && stringValue12(exeAccount.status)?.toLowerCase() !== "inactive") {
|
|
66184
66084
|
accounts.push({
|
|
@@ -66189,9 +66089,9 @@ function detectCloudAccounts() {
|
|
|
66189
66089
|
});
|
|
66190
66090
|
}
|
|
66191
66091
|
const cloudflareConfig = [
|
|
66192
|
-
|
|
66193
|
-
|
|
66194
|
-
|
|
66092
|
+
join62(homeDir(), "Library", "Preferences", ".wrangler", "config", "default.toml"),
|
|
66093
|
+
join62(homeDir(), ".wrangler", "config", "default.toml"),
|
|
66094
|
+
join62(homeDir(), ".config", ".wrangler", "config", "default.toml")
|
|
66195
66095
|
].find((path2) => fileContainsAny(path2, ["oauth_token", "api_token"]));
|
|
66196
66096
|
if (cloudflareConfig) {
|
|
66197
66097
|
accounts.push({
|
|
@@ -66202,10 +66102,10 @@ function detectCloudAccounts() {
|
|
|
66202
66102
|
});
|
|
66203
66103
|
}
|
|
66204
66104
|
const vercelConfig = [
|
|
66205
|
-
|
|
66206
|
-
|
|
66105
|
+
join62(homeDir(), "Library", "Application Support", "com.vercel.cli", "config.json"),
|
|
66106
|
+
join62(homeDir(), ".config", "com.vercel.cli", "config.json")
|
|
66207
66107
|
].map((path2) => readJsonRecord3(path2)).find((record2) => Boolean(stringValue12(record2?.currentTeam)));
|
|
66208
|
-
const vercelAuth = existsSync45(
|
|
66108
|
+
const vercelAuth = existsSync45(join62(homeDir(), ".local", "share", "com.vercel.cli", "auth.json"));
|
|
66209
66109
|
if (vercelConfig || vercelAuth) {
|
|
66210
66110
|
accounts.push({
|
|
66211
66111
|
id: "vercel",
|
|
@@ -67840,9 +67740,9 @@ function readFilePreview(input) {
|
|
|
67840
67740
|
}
|
|
67841
67741
|
const { realPath, root } = resolved;
|
|
67842
67742
|
try {
|
|
67843
|
-
const
|
|
67743
|
+
const stat10 = statSync21(realPath);
|
|
67844
67744
|
const title = realPath === "/" ? "/" : realPath.split("/").pop() || realPath;
|
|
67845
|
-
if (
|
|
67745
|
+
if (stat10.isDirectory()) {
|
|
67846
67746
|
return {
|
|
67847
67747
|
ok: true,
|
|
67848
67748
|
content: {
|
|
@@ -67858,7 +67758,7 @@ function readFilePreview(input) {
|
|
|
67858
67758
|
}
|
|
67859
67759
|
};
|
|
67860
67760
|
}
|
|
67861
|
-
if (!
|
|
67761
|
+
if (!stat10.isFile()) {
|
|
67862
67762
|
return { ok: false, status: 415, error: "path is not a file or directory" };
|
|
67863
67763
|
}
|
|
67864
67764
|
const mediaType = mediaTypeFor(realPath);
|
|
@@ -67875,14 +67775,14 @@ function readFilePreview(input) {
|
|
|
67875
67775
|
title,
|
|
67876
67776
|
mediaType,
|
|
67877
67777
|
rawUrl,
|
|
67878
|
-
sizeBytes:
|
|
67778
|
+
sizeBytes: stat10.size,
|
|
67879
67779
|
previewReason: previewReasonFor(mediaType),
|
|
67880
67780
|
generatedAt: Date.now()
|
|
67881
67781
|
}
|
|
67882
67782
|
};
|
|
67883
67783
|
}
|
|
67884
|
-
const truncated =
|
|
67885
|
-
const readable = readPreviewBuffer(realPath, Math.min(
|
|
67784
|
+
const truncated = stat10.size > MAX_PREVIEW_BYTES;
|
|
67785
|
+
const readable = readPreviewBuffer(realPath, Math.min(stat10.size, MAX_PREVIEW_BYTES));
|
|
67886
67786
|
if (!looksTextual2(realPath, readable)) {
|
|
67887
67787
|
return {
|
|
67888
67788
|
ok: true,
|
|
@@ -67895,7 +67795,7 @@ function readFilePreview(input) {
|
|
|
67895
67795
|
title,
|
|
67896
67796
|
mediaType,
|
|
67897
67797
|
rawUrl,
|
|
67898
|
-
sizeBytes:
|
|
67798
|
+
sizeBytes: stat10.size,
|
|
67899
67799
|
previewReason: previewReasonFor(mediaType),
|
|
67900
67800
|
generatedAt: Date.now()
|
|
67901
67801
|
}
|
|
@@ -67913,7 +67813,7 @@ function readFilePreview(input) {
|
|
|
67913
67813
|
mediaType,
|
|
67914
67814
|
rawUrl,
|
|
67915
67815
|
content: readable.toString("utf8"),
|
|
67916
|
-
sizeBytes:
|
|
67816
|
+
sizeBytes: stat10.size,
|
|
67917
67817
|
truncated,
|
|
67918
67818
|
generatedAt: Date.now()
|
|
67919
67819
|
}
|
|
@@ -67978,7 +67878,7 @@ var init_file_preview = __esm(() => {
|
|
|
67978
67878
|
// packages/agent-sessions/src/adapters/claude-code/team-topology.ts
|
|
67979
67879
|
import { existsSync as existsSync50, readdirSync as readdirSync14, readFileSync as readFileSync32, statSync as statSync22 } from "fs";
|
|
67980
67880
|
import { homedir as homedir51 } from "os";
|
|
67981
|
-
import { basename as basename26, dirname as dirname39, join as
|
|
67881
|
+
import { basename as basename26, dirname as dirname39, join as join66, relative as relative10 } from "path";
|
|
67982
67882
|
function isObject2(value) {
|
|
67983
67883
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
67984
67884
|
}
|
|
@@ -68022,17 +67922,17 @@ function statIsFile2(path2) {
|
|
|
68022
67922
|
}
|
|
68023
67923
|
}
|
|
68024
67924
|
function readTeamConfigs(homeDir2) {
|
|
68025
|
-
const teamsRoot =
|
|
67925
|
+
const teamsRoot = join66(homeDir2, ".claude", "teams");
|
|
68026
67926
|
if (!existsSync50(teamsRoot) || !statIsDirectory2(teamsRoot)) {
|
|
68027
67927
|
return [];
|
|
68028
67928
|
}
|
|
68029
67929
|
const teams = [];
|
|
68030
67930
|
for (const entry of readdirSync14(teamsRoot)) {
|
|
68031
|
-
const teamDir =
|
|
67931
|
+
const teamDir = join66(teamsRoot, entry);
|
|
68032
67932
|
if (!statIsDirectory2(teamDir)) {
|
|
68033
67933
|
continue;
|
|
68034
67934
|
}
|
|
68035
|
-
const configPath =
|
|
67935
|
+
const configPath = join66(teamDir, "config.json");
|
|
68036
67936
|
const config = readJsonObject(configPath);
|
|
68037
67937
|
if (!config) {
|
|
68038
67938
|
continue;
|
|
@@ -68170,7 +68070,7 @@ function membersFromConfig(team, groupId, configRefId) {
|
|
|
68170
68070
|
return { agents, relationships, agentByExternal };
|
|
68171
68071
|
}
|
|
68172
68072
|
function readTaskFiles(tasksRoot, teamName) {
|
|
68173
|
-
const teamTasksRoot =
|
|
68073
|
+
const teamTasksRoot = join66(tasksRoot, teamName);
|
|
68174
68074
|
if (!existsSync50(teamTasksRoot) || !statIsDirectory2(teamTasksRoot)) {
|
|
68175
68075
|
return [];
|
|
68176
68076
|
}
|
|
@@ -68181,7 +68081,7 @@ function readTaskFiles(tasksRoot, teamName) {
|
|
|
68181
68081
|
if (!current)
|
|
68182
68082
|
continue;
|
|
68183
68083
|
for (const entry of readdirSync14(current)) {
|
|
68184
|
-
const path2 =
|
|
68084
|
+
const path2 = join66(current, entry);
|
|
68185
68085
|
if (statIsDirectory2(path2)) {
|
|
68186
68086
|
stack.push(path2);
|
|
68187
68087
|
} else if (statIsFile2(path2)) {
|
|
@@ -68216,7 +68116,7 @@ function parseTaskFile(taskPath, teamName, tasksRoot, sourceRef) {
|
|
|
68216
68116
|
} catch {
|
|
68217
68117
|
return null;
|
|
68218
68118
|
}
|
|
68219
|
-
const relativePath = relative10(
|
|
68119
|
+
const relativePath = relative10(join66(tasksRoot, teamName), taskPath);
|
|
68220
68120
|
const fallbackId = relativePath.replace(/\.[^.]+$/u, "");
|
|
68221
68121
|
const fallbackTitle = firstMarkdownTitle(raw2) ?? basename26(fallbackId);
|
|
68222
68122
|
const inferredState = inferTaskStateFromPath(dirname39(relativePath));
|
|
@@ -68250,7 +68150,7 @@ function parseTaskFile(taskPath, teamName, tasksRoot, sourceRef) {
|
|
|
68250
68150
|
};
|
|
68251
68151
|
}
|
|
68252
68152
|
function tasksFromFiles(homeDir2, teamName, agentByExternal) {
|
|
68253
|
-
const tasksRoot =
|
|
68153
|
+
const tasksRoot = join66(homeDir2, ".claude", "tasks");
|
|
68254
68154
|
const taskFiles = readTaskFiles(tasksRoot, teamName);
|
|
68255
68155
|
const sourceRefs = [];
|
|
68256
68156
|
const parsedTasks = [];
|
|
@@ -68432,7 +68332,7 @@ var init_team_topology = __esm(() => {
|
|
|
68432
68332
|
// packages/agent-sessions/src/adapters/claude-code/subagent-topology.ts
|
|
68433
68333
|
import { existsSync as existsSync51, readdirSync as readdirSync15, readFileSync as readFileSync33, statSync as statSync23 } from "fs";
|
|
68434
68334
|
import { homedir as homedir52 } from "os";
|
|
68435
|
-
import { join as
|
|
68335
|
+
import { join as join67, normalize as normalize2, sep as sep3 } from "path";
|
|
68436
68336
|
function isObject3(value) {
|
|
68437
68337
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
68438
68338
|
}
|
|
@@ -68504,7 +68404,7 @@ function parseJsonLines(path2) {
|
|
|
68504
68404
|
return events2;
|
|
68505
68405
|
}
|
|
68506
68406
|
function projectsRoot3(homeDir2) {
|
|
68507
|
-
return
|
|
68407
|
+
return join67(homeDir2, ".claude", "projects");
|
|
68508
68408
|
}
|
|
68509
68409
|
function discoverParentSessionDirs(homeDir2, maxParentSessions, sessionFilter) {
|
|
68510
68410
|
const root = projectsRoot3(homeDir2);
|
|
@@ -68512,22 +68412,22 @@ function discoverParentSessionDirs(homeDir2, maxParentSessions, sessionFilter) {
|
|
|
68512
68412
|
return [];
|
|
68513
68413
|
const discovered = [];
|
|
68514
68414
|
for (const projectEntry of readdirSync15(root).sort()) {
|
|
68515
|
-
const projectDir =
|
|
68415
|
+
const projectDir = join67(root, projectEntry);
|
|
68516
68416
|
if (!statIsDirectory3(projectDir))
|
|
68517
68417
|
continue;
|
|
68518
68418
|
for (const sessionEntry of readdirSync15(projectDir).sort()) {
|
|
68519
68419
|
if (sessionFilter && sessionEntry !== sessionFilter)
|
|
68520
68420
|
continue;
|
|
68521
|
-
const sessionDir =
|
|
68421
|
+
const sessionDir = join67(projectDir, sessionEntry);
|
|
68522
68422
|
if (!statIsDirectory3(sessionDir))
|
|
68523
68423
|
continue;
|
|
68524
|
-
const subagentsDir =
|
|
68424
|
+
const subagentsDir = join67(sessionDir, "subagents");
|
|
68525
68425
|
if (!statIsDirectory3(subagentsDir))
|
|
68526
68426
|
continue;
|
|
68527
68427
|
const directSubagents = readdirSync15(subagentsDir).some((entry) => /^agent-[a-zA-Z0-9]+\.jsonl$/u.test(entry));
|
|
68528
68428
|
if (!directSubagents)
|
|
68529
68429
|
continue;
|
|
68530
|
-
const parentSessionPath =
|
|
68430
|
+
const parentSessionPath = join67(projectDir, `${sessionEntry}.jsonl`);
|
|
68531
68431
|
discovered.push({
|
|
68532
68432
|
sessionId: sessionEntry,
|
|
68533
68433
|
projectDir,
|
|
@@ -68721,8 +68621,8 @@ function readSubagentRecord(parent, parentSummary, file) {
|
|
|
68721
68621
|
if (!match2?.[1])
|
|
68722
68622
|
return null;
|
|
68723
68623
|
const agentId = match2[1];
|
|
68724
|
-
const transcriptPath =
|
|
68725
|
-
const metaPath =
|
|
68624
|
+
const transcriptPath = join67(parent.subagentsDir, file);
|
|
68625
|
+
const metaPath = join67(parent.subagentsDir, `agent-${agentId}.meta.json`);
|
|
68726
68626
|
const meta = statIsFile3(metaPath) ? parseSubagentMeta(metaPath) : undefined;
|
|
68727
68627
|
const toolUseId = meta?.toolUseId;
|
|
68728
68628
|
const parentToolUse = toolUseId ? parentSummary.toolUses.get(toolUseId) : undefined;
|
|
@@ -68950,7 +68850,7 @@ var init_subagent_topology = () => {};
|
|
|
68950
68850
|
// packages/agent-sessions/src/adapters/claude-code/workflow-topology.ts
|
|
68951
68851
|
import { existsSync as existsSync52, readdirSync as readdirSync16, readFileSync as readFileSync34, statSync as statSync24 } from "fs";
|
|
68952
68852
|
import { homedir as homedir53 } from "os";
|
|
68953
|
-
import { basename as basename28, join as
|
|
68853
|
+
import { basename as basename28, join as join68, normalize as normalize3, relative as relative11, sep as sep4 } from "path";
|
|
68954
68854
|
function isObject4(value) {
|
|
68955
68855
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
68956
68856
|
}
|
|
@@ -69022,33 +68922,33 @@ function parseJsonLines2(path2) {
|
|
|
69022
68922
|
return events2;
|
|
69023
68923
|
}
|
|
69024
68924
|
function discoverWorkflowDirs(homeDir2, maxRuns) {
|
|
69025
|
-
const projectsRoot4 =
|
|
68925
|
+
const projectsRoot4 = join68(homeDir2, ".claude", "projects");
|
|
69026
68926
|
if (!existsSync52(projectsRoot4) || !statIsDirectory4(projectsRoot4)) {
|
|
69027
68927
|
return [];
|
|
69028
68928
|
}
|
|
69029
68929
|
const discovered = [];
|
|
69030
68930
|
for (const projectEntry of readdirSync16(projectsRoot4).sort()) {
|
|
69031
|
-
const projectDir =
|
|
68931
|
+
const projectDir = join68(projectsRoot4, projectEntry);
|
|
69032
68932
|
if (!statIsDirectory4(projectDir))
|
|
69033
68933
|
continue;
|
|
69034
68934
|
for (const sessionEntry of readdirSync16(projectDir).sort()) {
|
|
69035
|
-
const sessionDir =
|
|
68935
|
+
const sessionDir = join68(projectDir, sessionEntry);
|
|
69036
68936
|
if (!statIsDirectory4(sessionDir))
|
|
69037
68937
|
continue;
|
|
69038
|
-
const workflowsRoot =
|
|
68938
|
+
const workflowsRoot = join68(sessionDir, "subagents", "workflows");
|
|
69039
68939
|
if (!statIsDirectory4(workflowsRoot))
|
|
69040
68940
|
continue;
|
|
69041
68941
|
for (const runEntry of readdirSync16(workflowsRoot).sort()) {
|
|
69042
68942
|
if (!runEntry.startsWith("wf_"))
|
|
69043
68943
|
continue;
|
|
69044
|
-
const workflowDir =
|
|
68944
|
+
const workflowDir = join68(workflowsRoot, runEntry);
|
|
69045
68945
|
if (!statIsDirectory4(workflowDir))
|
|
69046
68946
|
continue;
|
|
69047
68947
|
discovered.push({
|
|
69048
68948
|
runId: runEntry,
|
|
69049
68949
|
workflowDir,
|
|
69050
68950
|
parentSessionId: sessionEntry,
|
|
69051
|
-
parentSessionPath:
|
|
68951
|
+
parentSessionPath: join68(projectDir, `${sessionEntry}.jsonl`),
|
|
69052
68952
|
projectDir,
|
|
69053
68953
|
mtimeMs: statMtimeMs2(workflowDir)
|
|
69054
68954
|
});
|
|
@@ -69169,7 +69069,7 @@ function readWorkflowLaunch(parentSessionPath, runId) {
|
|
|
69169
69069
|
return;
|
|
69170
69070
|
}
|
|
69171
69071
|
function findGeneratedScriptForRun(homeDir2, runId) {
|
|
69172
|
-
const projectsRoot4 =
|
|
69072
|
+
const projectsRoot4 = join68(homeDir2, ".claude", "projects");
|
|
69173
69073
|
if (!statIsDirectory4(projectsRoot4))
|
|
69174
69074
|
return;
|
|
69175
69075
|
const stack = [{ path: projectsRoot4, depth: 0 }];
|
|
@@ -69178,7 +69078,7 @@ function findGeneratedScriptForRun(homeDir2, runId) {
|
|
|
69178
69078
|
if (!current || current.depth > 8)
|
|
69179
69079
|
continue;
|
|
69180
69080
|
for (const entry of readdirSync16(current.path).sort()) {
|
|
69181
|
-
const fullPath =
|
|
69081
|
+
const fullPath = join68(current.path, entry);
|
|
69182
69082
|
if (statIsDirectory4(fullPath)) {
|
|
69183
69083
|
stack.push({ path: fullPath, depth: current.depth + 1 });
|
|
69184
69084
|
} else if (statIsFile4(fullPath) && entry.endsWith(`${runId}.js`)) {
|
|
@@ -69249,7 +69149,7 @@ function readWorkflowScript(homeDir2, launch, runId) {
|
|
|
69249
69149
|
return parsed;
|
|
69250
69150
|
}
|
|
69251
69151
|
function readJournal(workflowDir) {
|
|
69252
|
-
const journalPath =
|
|
69152
|
+
const journalPath = join68(workflowDir, "journal.jsonl");
|
|
69253
69153
|
const events2 = parseJsonLines2(journalPath);
|
|
69254
69154
|
const startedByAgent = new Map;
|
|
69255
69155
|
const resultByAgent = new Map;
|
|
@@ -69358,8 +69258,8 @@ function readWorkflowAgents(run, journal, script) {
|
|
|
69358
69258
|
const files = statIsDirectory4(run.workflowDir) ? readdirSync16(run.workflowDir).sort() : [];
|
|
69359
69259
|
return files.map((file) => /^agent-([a-zA-Z0-9]+)\.jsonl$/u.exec(file)).filter((match2) => Boolean(match2)).map((match2) => {
|
|
69360
69260
|
const agentId = match2[1] ?? "unknown";
|
|
69361
|
-
const transcriptPath =
|
|
69362
|
-
const metaPath =
|
|
69261
|
+
const transcriptPath = join68(run.workflowDir, `agent-${agentId}.jsonl`);
|
|
69262
|
+
const metaPath = join68(run.workflowDir, `agent-${agentId}.meta.json`);
|
|
69363
69263
|
const events2 = parseJsonLines2(transcriptPath);
|
|
69364
69264
|
const meta = readJsonObject3(metaPath);
|
|
69365
69265
|
const result = resultObjectForAgent(journal, agentId);
|
|
@@ -69456,7 +69356,7 @@ function buildTopologyForRuns(runs, observedAt) {
|
|
|
69456
69356
|
const workflowGroupId = `claude-workflow:${runSegment}`;
|
|
69457
69357
|
const workflowRefId = sourceRefId4("claude-workflow-dir", run.workflowDir);
|
|
69458
69358
|
const parentSessionRefId = sourceRefId4("claude-workflow-parent-session", run.parentSessionPath);
|
|
69459
|
-
const journalPath =
|
|
69359
|
+
const journalPath = join68(run.workflowDir, "journal.jsonl");
|
|
69460
69360
|
const journalRefId = sourceRefId4("claude-workflow-journal", journalPath);
|
|
69461
69361
|
const scriptRefId = run.script?.scriptPath ? sourceRefId4("claude-workflow-script", run.script.scriptPath) : undefined;
|
|
69462
69362
|
appendSourceRef2(sourceRefs, sourceRefIds, {
|
|
@@ -69937,8 +69837,8 @@ var exports_project_overview = {};
|
|
|
69937
69837
|
__export(exports_project_overview, {
|
|
69938
69838
|
buildProjectOverview: () => buildProjectOverview
|
|
69939
69839
|
});
|
|
69940
|
-
import { access as access2, readFile as
|
|
69941
|
-
import { basename as basename29, join as
|
|
69840
|
+
import { access as access2, readFile as readFile17 } from "fs/promises";
|
|
69841
|
+
import { basename as basename29, join as join69 } from "path";
|
|
69942
69842
|
function excerptFromText(raw2) {
|
|
69943
69843
|
const trimmed = raw2.trim();
|
|
69944
69844
|
if (!trimmed)
|
|
@@ -69956,7 +69856,7 @@ function excerptFromText(raw2) {
|
|
|
69956
69856
|
}
|
|
69957
69857
|
async function readArtifactExcerpt(absolutePath, relativePath) {
|
|
69958
69858
|
try {
|
|
69959
|
-
const raw2 = await
|
|
69859
|
+
const raw2 = await readFile17(absolutePath, "utf8");
|
|
69960
69860
|
if (relativePath.endsWith(".json")) {
|
|
69961
69861
|
try {
|
|
69962
69862
|
const parsed = JSON.parse(raw2);
|
|
@@ -70012,7 +69912,7 @@ async function pathExists3(filePath) {
|
|
|
70012
69912
|
}
|
|
70013
69913
|
async function readPackageFacet(packagePath) {
|
|
70014
69914
|
try {
|
|
70015
|
-
const raw2 = await
|
|
69915
|
+
const raw2 = await readFile17(packagePath, "utf8");
|
|
70016
69916
|
const parsed = JSON.parse(raw2);
|
|
70017
69917
|
return {
|
|
70018
69918
|
name: typeof parsed.name === "string" ? parsed.name : null,
|
|
@@ -70033,7 +69933,7 @@ async function buildProjectOverview(input) {
|
|
|
70033
69933
|
const relativeArtifacts = buildArtifactList(root);
|
|
70034
69934
|
const artifacts = [];
|
|
70035
69935
|
for (const relativePath of relativeArtifacts) {
|
|
70036
|
-
const absolutePath =
|
|
69936
|
+
const absolutePath = join69(root, relativePath);
|
|
70037
69937
|
const exists2 = await pathExists3(absolutePath);
|
|
70038
69938
|
artifacts.push({
|
|
70039
69939
|
relativePath,
|
|
@@ -70043,9 +69943,9 @@ async function buildProjectOverview(input) {
|
|
|
70043
69943
|
excerpt: exists2 ? await readArtifactExcerpt(absolutePath, relativePath) : null
|
|
70044
69944
|
});
|
|
70045
69945
|
}
|
|
70046
|
-
const projectConfigPath3 =
|
|
69946
|
+
const projectConfigPath3 = join69(root, ".openscout", "project.json");
|
|
70047
69947
|
const projectConfigExists = await pathExists3(projectConfigPath3);
|
|
70048
|
-
const packagePath =
|
|
69948
|
+
const packagePath = join69(root, "package.json");
|
|
70049
69949
|
const packageFacet = await pathExists3(packagePath) ? await readPackageFacet(packagePath) : null;
|
|
70050
69950
|
return {
|
|
70051
69951
|
ok: true,
|
|
@@ -70095,8 +69995,8 @@ __export(exports_agent_definitions, {
|
|
|
70095
69995
|
resolveAgentProjectRoot: () => resolveAgentProjectRoot,
|
|
70096
69996
|
buildAgentDefinitions: () => buildAgentDefinitions
|
|
70097
69997
|
});
|
|
70098
|
-
import { access as access3, readdir as readdir5, readFile as
|
|
70099
|
-
import { join as
|
|
69998
|
+
import { access as access3, readdir as readdir5, readFile as readFile18 } from "fs/promises";
|
|
69999
|
+
import { join as join70 } from "path";
|
|
70100
70000
|
function excerptFromText2(raw2) {
|
|
70101
70001
|
const trimmed = raw2.trim();
|
|
70102
70002
|
if (!trimmed)
|
|
@@ -70114,7 +70014,7 @@ function excerptFromText2(raw2) {
|
|
|
70114
70014
|
}
|
|
70115
70015
|
async function readFileExcerpt(absolutePath, relativePath) {
|
|
70116
70016
|
try {
|
|
70117
|
-
const raw2 = await
|
|
70017
|
+
const raw2 = await readFile18(absolutePath, "utf8");
|
|
70118
70018
|
if (relativePath.endsWith(".json") || relativePath.endsWith(".yaml") || relativePath.endsWith(".yml")) {
|
|
70119
70019
|
return excerptFromText2(raw2);
|
|
70120
70020
|
}
|
|
@@ -70144,7 +70044,7 @@ async function listFolderFiles(folderPath, slug) {
|
|
|
70144
70044
|
for (const entry of entries2) {
|
|
70145
70045
|
if (!entry.isFile())
|
|
70146
70046
|
continue;
|
|
70147
|
-
const absolutePath =
|
|
70047
|
+
const absolutePath = join70(folderPath, entry.name);
|
|
70148
70048
|
const relativePath = `${slug}/${entry.name}`;
|
|
70149
70049
|
files.push({
|
|
70150
70050
|
name: entry.name,
|
|
@@ -70174,7 +70074,7 @@ async function buildAgentDefinitions(input) {
|
|
|
70174
70074
|
return { ok: false, status: resolved.status, error: resolved.error };
|
|
70175
70075
|
}
|
|
70176
70076
|
const projectRoot = resolved.realPath;
|
|
70177
|
-
const agentsRoot =
|
|
70077
|
+
const agentsRoot = join70(projectRoot, ".agents");
|
|
70178
70078
|
const agentsRootExists = await pathExists4(agentsRoot);
|
|
70179
70079
|
const selectedSlug = agentSlugFromHandle(input.agentHandle, input.agentName ?? "");
|
|
70180
70080
|
const folders = [];
|
|
@@ -70184,7 +70084,7 @@ async function buildAgentDefinitions(input) {
|
|
|
70184
70084
|
if (!entry.isDirectory() || SKIPPED_NAMES.has(entry.name) || entry.name.startsWith(".")) {
|
|
70185
70085
|
continue;
|
|
70186
70086
|
}
|
|
70187
|
-
const folderPath =
|
|
70087
|
+
const folderPath = join70(agentsRoot, entry.name);
|
|
70188
70088
|
const files = await listFolderFiles(folderPath, entry.name);
|
|
70189
70089
|
if (files.length === 0)
|
|
70190
70090
|
continue;
|
|
@@ -70234,7 +70134,8 @@ init_src3();
|
|
|
70234
70134
|
init_local_config();
|
|
70235
70135
|
init_setup();
|
|
70236
70136
|
import { existsSync as existsSync55 } from "fs";
|
|
70237
|
-
import {
|
|
70137
|
+
import { randomBytes as randomBytes7 } from "crypto";
|
|
70138
|
+
import { dirname as dirname43, join as join73, resolve as resolve31 } from "path";
|
|
70238
70139
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
70239
70140
|
|
|
70240
70141
|
// packages/web/shared/scope-integration.js
|
|
@@ -70340,7 +70241,7 @@ function serializeOpenScoutWebBootstrap(env = process.env) {
|
|
|
70340
70241
|
|
|
70341
70242
|
// packages/web/server/create-openscout-web-server.ts
|
|
70342
70243
|
import { createReadStream as createReadStream2, existsSync as existsSync53, readFileSync as readFileSync35, readdirSync as readdirSync17, realpathSync as realpathSync7, rmSync as rmSync7, statSync as statSync25 } from "fs";
|
|
70343
|
-
import { basename as basename31, dirname as dirname41, isAbsolute as isAbsolute12, join as
|
|
70244
|
+
import { basename as basename31, dirname as dirname41, isAbsolute as isAbsolute12, join as join71, relative as relative12, resolve as resolve29 } from "path";
|
|
70344
70245
|
import { createInterface as createInterface3 } from "readline";
|
|
70345
70246
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
70346
70247
|
import { homedir as homedir55 } from "os";
|
|
@@ -73612,50 +73513,6 @@ function errorReason(error) {
|
|
|
73612
73513
|
return null;
|
|
73613
73514
|
}
|
|
73614
73515
|
|
|
73615
|
-
// packages/web/server/terminal-hosts/herdr-session-state.ts
|
|
73616
|
-
init_system_probes();
|
|
73617
|
-
import { readFile as readFile15, stat as stat8 } from "fs/promises";
|
|
73618
|
-
import { join as join42 } from "path";
|
|
73619
|
-
var LAST_KNOWN_LIST_CAP = 8;
|
|
73620
|
-
function parseHerdrSessionState(value, savedAt) {
|
|
73621
|
-
const workspaces = parseHerdrPersistedTopology(value);
|
|
73622
|
-
if (workspaces === null)
|
|
73623
|
-
return null;
|
|
73624
|
-
let tabs = 0;
|
|
73625
|
-
let panes = 0;
|
|
73626
|
-
const cwds = [];
|
|
73627
|
-
const agents = [];
|
|
73628
|
-
for (const workspace of workspaces) {
|
|
73629
|
-
tabs += workspace.tabs.length;
|
|
73630
|
-
for (const tab of workspace.tabs) {
|
|
73631
|
-
panes += tab.panes.length;
|
|
73632
|
-
for (const pane of tab.panes) {
|
|
73633
|
-
if (pane.cwd && !cwds.includes(pane.cwd))
|
|
73634
|
-
cwds.push(pane.cwd);
|
|
73635
|
-
if (pane.agent && !agents.includes(pane.agent))
|
|
73636
|
-
agents.push(pane.agent);
|
|
73637
|
-
}
|
|
73638
|
-
}
|
|
73639
|
-
}
|
|
73640
|
-
return {
|
|
73641
|
-
savedAt,
|
|
73642
|
-
workspaces: workspaces.length,
|
|
73643
|
-
tabs,
|
|
73644
|
-
panes,
|
|
73645
|
-
cwds: cwds.slice(0, LAST_KNOWN_LIST_CAP),
|
|
73646
|
-
agents: agents.slice(0, LAST_KNOWN_LIST_CAP)
|
|
73647
|
-
};
|
|
73648
|
-
}
|
|
73649
|
-
async function readHerdrLastKnownState(sessionDir) {
|
|
73650
|
-
try {
|
|
73651
|
-
const path2 = join42(sessionDir, "session.json");
|
|
73652
|
-
const [raw2, stats] = await Promise.all([readFile15(path2, "utf8"), stat8(path2)]);
|
|
73653
|
-
return parseHerdrSessionState(JSON.parse(raw2), stats.mtimeMs);
|
|
73654
|
-
} catch {
|
|
73655
|
-
return null;
|
|
73656
|
-
}
|
|
73657
|
-
}
|
|
73658
|
-
|
|
73659
73516
|
// packages/web/server/terminal-hosts/herdr.ts
|
|
73660
73517
|
var HERDR_TIMEOUT_MS2 = 2000;
|
|
73661
73518
|
var herdrTerminalHost = {
|
|
@@ -73679,18 +73536,10 @@ var herdrTerminalHost = {
|
|
|
73679
73536
|
},
|
|
73680
73537
|
async list(context = {}) {
|
|
73681
73538
|
const snapshot = await herdrSessionsProbe.for({ env: context.env ?? process.env }).fresh();
|
|
73682
|
-
return
|
|
73683
|
-
|
|
73684
|
-
|
|
73685
|
-
|
|
73686
|
-
state: session3.running ? "live" : "detached",
|
|
73687
|
-
...lastKnown?.cwds[0] ? { cwd: lastKnown.cwds[0] } : {},
|
|
73688
|
-
metadata: {
|
|
73689
|
-
isDefault: session3.isDefault,
|
|
73690
|
-
running: session3.running,
|
|
73691
|
-
...lastKnown ? { lastKnownLayout: lastKnown } : {}
|
|
73692
|
-
}
|
|
73693
|
-
};
|
|
73539
|
+
return (snapshot.value ?? []).map((session3) => ({
|
|
73540
|
+
name: session3.name,
|
|
73541
|
+
state: session3.running ? "live" : "detached",
|
|
73542
|
+
metadata: { isDefault: session3.isDefault, running: session3.running }
|
|
73694
73543
|
}));
|
|
73695
73544
|
},
|
|
73696
73545
|
surface(session3) {
|
|
@@ -73810,12 +73659,12 @@ async function waitForHerdrSession(sessionName, env) {
|
|
|
73810
73659
|
init_system_probes();
|
|
73811
73660
|
init_src();
|
|
73812
73661
|
import { homedir as homedir31 } from "os";
|
|
73813
|
-
import { join as
|
|
73662
|
+
import { join as join42 } from "path";
|
|
73814
73663
|
var ZELLIJ_TIMEOUT_MS2 = 2000;
|
|
73815
73664
|
var CTRL_C = "3";
|
|
73816
73665
|
var CTRL_D = "4";
|
|
73817
73666
|
function resolveZellijSocketDir(env = process.env) {
|
|
73818
|
-
return env.ZELLIJ_SOCKET_DIR?.trim() || env.OPENSCOUT_ZELLIJ_SOCKET_DIR?.trim() ||
|
|
73667
|
+
return env.ZELLIJ_SOCKET_DIR?.trim() || env.OPENSCOUT_ZELLIJ_SOCKET_DIR?.trim() || join42(env.HOME?.trim() || homedir31(), ".openscout", "zellij-sockets");
|
|
73819
73668
|
}
|
|
73820
73669
|
function zellijEnv(context) {
|
|
73821
73670
|
const base = context.env ?? process.env;
|
|
@@ -74217,7 +74066,7 @@ function isMissingTerminalWorkspaceTable(error) {
|
|
|
74217
74066
|
import { mkdir as mkdir12, rm as rm5, writeFile as writeFile11 } from "fs/promises";
|
|
74218
74067
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
74219
74068
|
import { tmpdir } from "os";
|
|
74220
|
-
import { join as
|
|
74069
|
+
import { join as join44 } from "path";
|
|
74221
74070
|
|
|
74222
74071
|
// packages/web/client/lib/capture-attachments.ts
|
|
74223
74072
|
var MARKDOWN_EXTENSIONS = new Set([
|
|
@@ -74404,7 +74253,7 @@ function resolveTextCaptureMediaType(mediaType, fileName) {
|
|
|
74404
74253
|
}
|
|
74405
74254
|
|
|
74406
74255
|
// packages/web/server/image-blob-store.ts
|
|
74407
|
-
var BLOB_DIR =
|
|
74256
|
+
var BLOB_DIR = join44(tmpdir(), "openscout-image-blobs");
|
|
74408
74257
|
var BLOB_TTL_MS = 6 * 60 * 60 * 1000;
|
|
74409
74258
|
var SWEEP_INTERVAL_MS2 = 30 * 60 * 1000;
|
|
74410
74259
|
var MAX_BLOB_BYTES = 25 * 1024 * 1024;
|
|
@@ -74473,7 +74322,7 @@ async function putImageBlob(input) {
|
|
|
74473
74322
|
await ensureDir();
|
|
74474
74323
|
ensureSweeper();
|
|
74475
74324
|
const id = randomUUID7();
|
|
74476
|
-
const path2 =
|
|
74325
|
+
const path2 = join44(BLOB_DIR, id);
|
|
74477
74326
|
await writeFile11(path2, bytes);
|
|
74478
74327
|
const entry = {
|
|
74479
74328
|
id,
|
|
@@ -75542,18 +75391,18 @@ init_src2();
|
|
|
75542
75391
|
init_local_agents();
|
|
75543
75392
|
import { existsSync as existsSync40, readdirSync as readdirSync11, readFileSync as readFileSync23, statSync as statSync15 } from "fs";
|
|
75544
75393
|
import { homedir as homedir41 } from "os";
|
|
75545
|
-
import { basename as basename20, join as
|
|
75394
|
+
import { basename as basename20, join as join53, resolve as resolve20 } from "path";
|
|
75546
75395
|
|
|
75547
75396
|
// packages/runtime/src/tail/service.ts
|
|
75548
75397
|
init_secret_redaction();
|
|
75549
75398
|
import { basename as basename19 } from "path";
|
|
75550
|
-
import { open, stat as
|
|
75399
|
+
import { open, stat as stat8 } from "fs/promises";
|
|
75551
75400
|
|
|
75552
75401
|
// packages/runtime/src/tail/claude-source.ts
|
|
75553
75402
|
init_user_config();
|
|
75554
75403
|
import { closeSync, existsSync as existsSync33, openSync, readdirSync as readdirSync4, readSync, statSync as statSync8 } from "fs";
|
|
75555
75404
|
import { homedir as homedir34 } from "os";
|
|
75556
|
-
import { basename as basename12, join as
|
|
75405
|
+
import { basename as basename12, join as join46, relative as relative4 } from "path";
|
|
75557
75406
|
|
|
75558
75407
|
// packages/runtime/src/tail/discover.ts
|
|
75559
75408
|
init_ps();
|
|
@@ -75829,7 +75678,7 @@ function rememberMetadata(file, metadata) {
|
|
|
75829
75678
|
return metadata;
|
|
75830
75679
|
}
|
|
75831
75680
|
function projectsRoot() {
|
|
75832
|
-
return process.env.OPENSCOUT_TAIL_CLAUDE_PROJECTS_ROOT ??
|
|
75681
|
+
return process.env.OPENSCOUT_TAIL_CLAUDE_PROJECTS_ROOT ?? join46(homedir34(), ".claude", "projects");
|
|
75833
75682
|
}
|
|
75834
75683
|
function listJsonlFiles(dir) {
|
|
75835
75684
|
let entries2 = [];
|
|
@@ -75974,7 +75823,7 @@ function listRecentClaudeProjectTranscripts(root, scope) {
|
|
|
75974
75823
|
return [];
|
|
75975
75824
|
}
|
|
75976
75825
|
for (const entry of projectDirs) {
|
|
75977
|
-
const projectDir =
|
|
75826
|
+
const projectDir = join46(root, entry);
|
|
75978
75827
|
try {
|
|
75979
75828
|
if (!statSync8(projectDir).isDirectory())
|
|
75980
75829
|
continue;
|
|
@@ -75982,13 +75831,13 @@ function listRecentClaudeProjectTranscripts(root, scope) {
|
|
|
75982
75831
|
continue;
|
|
75983
75832
|
}
|
|
75984
75833
|
for (const file of listJsonlFiles(projectDir)) {
|
|
75985
|
-
const path2 =
|
|
75834
|
+
const path2 = join46(projectDir, file);
|
|
75986
75835
|
try {
|
|
75987
75836
|
const stats = statSync8(path2);
|
|
75988
|
-
const subagentsDir =
|
|
75837
|
+
const subagentsDir = join46(projectDir, basename12(path2, ".jsonl"), "subagents");
|
|
75989
75838
|
const activeSubagents = [];
|
|
75990
75839
|
for (const subagentFile of listClaudeSubagentFiles(subagentsDir)) {
|
|
75991
|
-
const subagentPath =
|
|
75840
|
+
const subagentPath = join46(subagentsDir, subagentFile);
|
|
75992
75841
|
try {
|
|
75993
75842
|
const subagentStats = statSync8(subagentPath);
|
|
75994
75843
|
if (subagentStats.mtimeMs < cutoff)
|
|
@@ -76229,7 +76078,7 @@ var ClaudeSource = {
|
|
|
76229
76078
|
// packages/runtime/src/tail/codex-source.ts
|
|
76230
76079
|
import { closeSync as closeSync2, existsSync as existsSync34, openSync as openSync2, readdirSync as readdirSync5, readSync as readSync2, statSync as statSync9 } from "fs";
|
|
76231
76080
|
import { homedir as homedir35 } from "os";
|
|
76232
|
-
import { basename as basename13, join as
|
|
76081
|
+
import { basename as basename13, join as join47 } from "path";
|
|
76233
76082
|
var SOURCE_NAME2 = "codex";
|
|
76234
76083
|
var MAX_SUMMARY_LEN2 = 200;
|
|
76235
76084
|
var TOOL_CALL_STATE_KEY = "codexToolCallsById";
|
|
@@ -76277,8 +76126,8 @@ function codexSessionRoots() {
|
|
|
76277
76126
|
if (explicit?.trim())
|
|
76278
76127
|
return [explicit.trim()];
|
|
76279
76128
|
return [
|
|
76280
|
-
|
|
76281
|
-
|
|
76129
|
+
join47(homedir35(), ".codex", "sessions"),
|
|
76130
|
+
join47(homedir35(), ".openai-codex", "sessions")
|
|
76282
76131
|
].filter((root) => existsSync34(root));
|
|
76283
76132
|
}
|
|
76284
76133
|
function isCodexAppServerProcess(command) {
|
|
@@ -76377,7 +76226,7 @@ function walkRecentJsonlFiles(root, scope) {
|
|
|
76377
76226
|
continue;
|
|
76378
76227
|
}
|
|
76379
76228
|
for (const entry of entries2) {
|
|
76380
|
-
const path2 =
|
|
76229
|
+
const path2 = join47(dir, entry);
|
|
76381
76230
|
let stats;
|
|
76382
76231
|
try {
|
|
76383
76232
|
stats = statSync9(path2);
|
|
@@ -76650,7 +76499,7 @@ var CodexSource = {
|
|
|
76650
76499
|
// packages/runtime/src/tail/cursor-source.ts
|
|
76651
76500
|
import { closeSync as closeSync3, existsSync as existsSync35, openSync as openSync3, readdirSync as readdirSync6, readSync as readSync3, statSync as statSync10 } from "fs";
|
|
76652
76501
|
import { homedir as homedir36 } from "os";
|
|
76653
|
-
import { basename as basename14, join as
|
|
76502
|
+
import { basename as basename14, join as join48 } from "path";
|
|
76654
76503
|
var SOURCE_NAME3 = "cursor";
|
|
76655
76504
|
var MAX_SUMMARY_LEN3 = 200;
|
|
76656
76505
|
var DEFAULT_HOT_DISCOVERY_WINDOW_MS3 = 10 * 60 * 1000;
|
|
@@ -76682,7 +76531,7 @@ function cursorProcessMonitorRoots() {
|
|
|
76682
76531
|
const explicit = process.env.OPENSCOUT_TAIL_CURSOR_PROCESS_MONITOR_ROOT;
|
|
76683
76532
|
if (explicit?.trim())
|
|
76684
76533
|
return [explicit.trim()];
|
|
76685
|
-
return [
|
|
76534
|
+
return [join48(homedir36(), "Library", "Application Support", "Cursor", "process-monitor")].filter((root) => existsSync35(root));
|
|
76686
76535
|
}
|
|
76687
76536
|
function isCursorProcess(command) {
|
|
76688
76537
|
const base = commandBasename2(command);
|
|
@@ -76773,7 +76622,7 @@ function walkRecentMonitorLogs(root, scope) {
|
|
|
76773
76622
|
for (const entry of entries2) {
|
|
76774
76623
|
if (!entry.endsWith(".log"))
|
|
76775
76624
|
continue;
|
|
76776
|
-
const path2 =
|
|
76625
|
+
const path2 = join48(root, entry);
|
|
76777
76626
|
try {
|
|
76778
76627
|
const stats = statSync10(path2);
|
|
76779
76628
|
if (!stats.isFile() || stats.mtimeMs < cutoff)
|
|
@@ -76850,7 +76699,7 @@ var CursorSource = {
|
|
|
76850
76699
|
// packages/runtime/src/tail/grok-source.ts
|
|
76851
76700
|
import { closeSync as closeSync4, existsSync as existsSync36, openSync as openSync4, readdirSync as readdirSync7, readFileSync as readFileSync20, readSync as readSync4, statSync as statSync11 } from "fs";
|
|
76852
76701
|
import { homedir as homedir37 } from "os";
|
|
76853
|
-
import { basename as basename15, dirname as dirname28, join as
|
|
76702
|
+
import { basename as basename15, dirname as dirname28, join as join49 } from "path";
|
|
76854
76703
|
var SOURCE_NAME4 = "grok";
|
|
76855
76704
|
var MAX_SUMMARY_LEN4 = 200;
|
|
76856
76705
|
var DEFAULT_HOT_DISCOVERY_WINDOW_MS4 = 10 * 60 * 1000;
|
|
@@ -76898,7 +76747,7 @@ function grokSessionRoots() {
|
|
|
76898
76747
|
const explicit = process.env.OPENSCOUT_TAIL_GROK_SESSIONS_ROOT;
|
|
76899
76748
|
if (explicit?.trim())
|
|
76900
76749
|
return [explicit.trim()];
|
|
76901
|
-
return [
|
|
76750
|
+
return [join49(homedir37(), ".grok", "sessions")].filter((root) => existsSync36(root));
|
|
76902
76751
|
}
|
|
76903
76752
|
function isGrokProcess(command) {
|
|
76904
76753
|
const base = commandBasename2(command);
|
|
@@ -76982,7 +76831,7 @@ function readGrokMetadata(file) {
|
|
|
76982
76831
|
};
|
|
76983
76832
|
}
|
|
76984
76833
|
const sessionDir = dirname28(file.path);
|
|
76985
|
-
const summary = readJsonFile2(
|
|
76834
|
+
const summary = readJsonFile2(join49(sessionDir, "summary.json"));
|
|
76986
76835
|
const info = metadataRecord9(summary?.info);
|
|
76987
76836
|
let cwd = typeof info?.cwd === "string" && info.cwd.trim() ? info.cwd : null;
|
|
76988
76837
|
let sessionId = typeof info?.id === "string" && info.id.trim() ? info.id : basename15(sessionDir);
|
|
@@ -77015,7 +76864,7 @@ function walkRecentGrokEventFiles(root, scope) {
|
|
|
77015
76864
|
continue;
|
|
77016
76865
|
}
|
|
77017
76866
|
for (const entry of entries2) {
|
|
77018
|
-
const path2 =
|
|
76867
|
+
const path2 = join49(dir, entry);
|
|
77019
76868
|
let stats;
|
|
77020
76869
|
try {
|
|
77021
76870
|
stats = statSync11(path2);
|
|
@@ -77101,7 +76950,7 @@ function grokToolArgSummary(toolName2, rawInput) {
|
|
|
77101
76950
|
return "";
|
|
77102
76951
|
}
|
|
77103
76952
|
function loadGrokToolCallIndex(sessionDir) {
|
|
77104
|
-
const updatesPath =
|
|
76953
|
+
const updatesPath = join49(sessionDir, "updates.jsonl");
|
|
77105
76954
|
if (!existsSync36(updatesPath))
|
|
77106
76955
|
return [];
|
|
77107
76956
|
const records = [];
|
|
@@ -77135,7 +76984,7 @@ function loadGrokToolCallIndex(sessionDir) {
|
|
|
77135
76984
|
}
|
|
77136
76985
|
function grokMatcherForTranscript(transcriptPath) {
|
|
77137
76986
|
const sessionDir = dirname28(transcriptPath);
|
|
77138
|
-
const updatesPath =
|
|
76987
|
+
const updatesPath = join49(sessionDir, "updates.jsonl");
|
|
77139
76988
|
if (!existsSync36(updatesPath))
|
|
77140
76989
|
return null;
|
|
77141
76990
|
let updatesMtimeMs = 0;
|
|
@@ -77332,7 +77181,7 @@ var GrokSource = {
|
|
|
77332
77181
|
// packages/runtime/src/tail/kimi-source.ts
|
|
77333
77182
|
import { existsSync as existsSync37, readdirSync as readdirSync8, readFileSync as readFileSync21, statSync as statSync12 } from "fs";
|
|
77334
77183
|
import { homedir as homedir38 } from "os";
|
|
77335
|
-
import { basename as basename16, dirname as dirname29, join as
|
|
77184
|
+
import { basename as basename16, dirname as dirname29, join as join50 } from "path";
|
|
77336
77185
|
var SOURCE_NAME5 = "kimi";
|
|
77337
77186
|
var MAX_SUMMARY_LEN5 = 200;
|
|
77338
77187
|
var DEFAULT_HOT_DISCOVERY_WINDOW_MS5 = 10 * 60 * 1000;
|
|
@@ -77384,8 +77233,8 @@ function kimiSessionsRoot() {
|
|
|
77384
77233
|
const explicit = process.env.OPENSCOUT_TAIL_KIMI_SESSIONS_ROOT?.trim();
|
|
77385
77234
|
if (explicit)
|
|
77386
77235
|
return explicit;
|
|
77387
|
-
const kimiHome = process.env.KIMI_CODE_HOME?.trim() ||
|
|
77388
|
-
return
|
|
77236
|
+
const kimiHome = process.env.KIMI_CODE_HOME?.trim() || join50(homedir38(), ".kimi-code");
|
|
77237
|
+
return join50(kimiHome, "sessions");
|
|
77389
77238
|
}
|
|
77390
77239
|
function isKimiProcess(command) {
|
|
77391
77240
|
const base = commandBasename2(command);
|
|
@@ -77429,7 +77278,7 @@ function walkRecentKimiWireFiles(root, scope) {
|
|
|
77429
77278
|
continue;
|
|
77430
77279
|
}
|
|
77431
77280
|
for (const entry of entries2) {
|
|
77432
|
-
const path2 =
|
|
77281
|
+
const path2 = join50(directory, entry);
|
|
77433
77282
|
let stats;
|
|
77434
77283
|
try {
|
|
77435
77284
|
stats = statSync12(path2);
|
|
@@ -77448,7 +77297,7 @@ function walkRecentKimiWireFiles(root, scope) {
|
|
|
77448
77297
|
function readKimiTranscriptMetadata(file) {
|
|
77449
77298
|
const agentId = basename16(dirname29(file.path));
|
|
77450
77299
|
const sessionDirectory = dirname29(dirname29(dirname29(file.path)));
|
|
77451
|
-
const statePath =
|
|
77300
|
+
const statePath = join50(sessionDirectory, "state.json");
|
|
77452
77301
|
let stateMtimeMs = null;
|
|
77453
77302
|
let stateSize = null;
|
|
77454
77303
|
try {
|
|
@@ -77673,7 +77522,7 @@ var KimiSource = {
|
|
|
77673
77522
|
// packages/runtime/src/tail/opencode-source.ts
|
|
77674
77523
|
import { closeSync as closeSync5, existsSync as existsSync38, openSync as openSync5, readdirSync as readdirSync9, readFileSync as readFileSync22, readSync as readSync5, statSync as statSync13 } from "fs";
|
|
77675
77524
|
import { homedir as homedir39 } from "os";
|
|
77676
|
-
import { basename as basename17, join as
|
|
77525
|
+
import { basename as basename17, join as join51, sep as sep2 } from "path";
|
|
77677
77526
|
var SOURCE_NAME6 = "opencode";
|
|
77678
77527
|
var MAX_SUMMARY_LEN6 = 200;
|
|
77679
77528
|
var DEFAULT_HOT_DISCOVERY_WINDOW_MS6 = 10 * 60 * 1000;
|
|
@@ -77709,7 +77558,7 @@ function opencodeStorageRoots() {
|
|
|
77709
77558
|
const explicit = process.env.OPENSCOUT_TAIL_OPENCODE_STORAGE_ROOT;
|
|
77710
77559
|
if (explicit?.trim())
|
|
77711
77560
|
return [explicit.trim()];
|
|
77712
|
-
return [
|
|
77561
|
+
return [join51(homedir39(), ".local", "share", "opencode", "storage")].filter((root) => existsSync38(root));
|
|
77713
77562
|
}
|
|
77714
77563
|
function isOpenCodeProcess(command) {
|
|
77715
77564
|
const base = commandBasename2(command).toLowerCase();
|
|
@@ -77795,7 +77644,7 @@ function partTimestamp(part) {
|
|
|
77795
77644
|
function walkRecentSessionFiles(root, scope) {
|
|
77796
77645
|
const cutoff = Date.now() - discoveryWindowMs6(scope);
|
|
77797
77646
|
const found = [];
|
|
77798
|
-
const stack = [
|
|
77647
|
+
const stack = [join51(root, "session")];
|
|
77799
77648
|
while (stack.length > 0) {
|
|
77800
77649
|
const dir = stack.pop();
|
|
77801
77650
|
let entries2 = [];
|
|
@@ -77805,7 +77654,7 @@ function walkRecentSessionFiles(root, scope) {
|
|
|
77805
77654
|
continue;
|
|
77806
77655
|
}
|
|
77807
77656
|
for (const entry of entries2) {
|
|
77808
|
-
const path2 =
|
|
77657
|
+
const path2 = join51(dir, entry);
|
|
77809
77658
|
let stats;
|
|
77810
77659
|
try {
|
|
77811
77660
|
stats = statSync13(path2);
|
|
@@ -77825,7 +77674,7 @@ function walkRecentSessionFiles(root, scope) {
|
|
|
77825
77674
|
}
|
|
77826
77675
|
function walkRecentMessageSessionFiles(root, scope) {
|
|
77827
77676
|
const cutoff = Date.now() - discoveryWindowMs6(scope);
|
|
77828
|
-
const messageRoot =
|
|
77677
|
+
const messageRoot = join51(root, "message");
|
|
77829
77678
|
let sessionDirs = [];
|
|
77830
77679
|
try {
|
|
77831
77680
|
sessionDirs = readdirSync9(messageRoot);
|
|
@@ -77834,7 +77683,7 @@ function walkRecentMessageSessionFiles(root, scope) {
|
|
|
77834
77683
|
}
|
|
77835
77684
|
const found = new Map;
|
|
77836
77685
|
for (const sessionId of sessionDirs) {
|
|
77837
|
-
const dir =
|
|
77686
|
+
const dir = join51(messageRoot, sessionId);
|
|
77838
77687
|
let entries2 = [];
|
|
77839
77688
|
try {
|
|
77840
77689
|
const stats = statSync13(dir);
|
|
@@ -77849,7 +77698,7 @@ function walkRecentMessageSessionFiles(root, scope) {
|
|
|
77849
77698
|
if (!entry.endsWith(".json"))
|
|
77850
77699
|
continue;
|
|
77851
77700
|
try {
|
|
77852
|
-
const stats = statSync13(
|
|
77701
|
+
const stats = statSync13(join51(dir, entry));
|
|
77853
77702
|
if (stats.isFile() && stats.mtimeMs >= cutoff && stats.mtimeMs > latestMessageMtime) {
|
|
77854
77703
|
latestMessageMtime = stats.mtimeMs;
|
|
77855
77704
|
}
|
|
@@ -77859,7 +77708,7 @@ function walkRecentMessageSessionFiles(root, scope) {
|
|
|
77859
77708
|
}
|
|
77860
77709
|
if (latestMessageMtime <= 0)
|
|
77861
77710
|
continue;
|
|
77862
|
-
const sessionPath =
|
|
77711
|
+
const sessionPath = join51(root, "session", "global", `${sessionId}.json`);
|
|
77863
77712
|
try {
|
|
77864
77713
|
const sessionStats = statSync13(sessionPath);
|
|
77865
77714
|
if (!sessionStats.isFile())
|
|
@@ -77915,7 +77764,7 @@ function discoverOpenCodeTranscripts(scope) {
|
|
|
77915
77764
|
});
|
|
77916
77765
|
}
|
|
77917
77766
|
function readOpenCodeMessages(root, sessionId) {
|
|
77918
|
-
const dir =
|
|
77767
|
+
const dir = join51(root, "message", sessionId);
|
|
77919
77768
|
let entries2 = [];
|
|
77920
77769
|
try {
|
|
77921
77770
|
entries2 = readdirSync9(dir);
|
|
@@ -77926,7 +77775,7 @@ function readOpenCodeMessages(root, sessionId) {
|
|
|
77926
77775
|
for (const entry of entries2) {
|
|
77927
77776
|
if (!entry.endsWith(".json"))
|
|
77928
77777
|
continue;
|
|
77929
|
-
const path2 =
|
|
77778
|
+
const path2 = join51(dir, entry);
|
|
77930
77779
|
let stats;
|
|
77931
77780
|
try {
|
|
77932
77781
|
stats = statSync13(path2);
|
|
@@ -77943,7 +77792,7 @@ function readOpenCodeMessages(root, sessionId) {
|
|
|
77943
77792
|
return messages2.sort((a, b) => (messageTimestamp(a) ?? a.__mtimeMs) - (messageTimestamp(b) ?? b.__mtimeMs)).slice(-messagesPerSession());
|
|
77944
77793
|
}
|
|
77945
77794
|
function readOpenCodeParts(root, messageId) {
|
|
77946
|
-
const dir =
|
|
77795
|
+
const dir = join51(root, "part", messageId);
|
|
77947
77796
|
let entries2 = [];
|
|
77948
77797
|
try {
|
|
77949
77798
|
entries2 = readdirSync9(dir);
|
|
@@ -77954,7 +77803,7 @@ function readOpenCodeParts(root, messageId) {
|
|
|
77954
77803
|
for (const entry of entries2) {
|
|
77955
77804
|
if (!entry.endsWith(".json"))
|
|
77956
77805
|
continue;
|
|
77957
|
-
const path2 =
|
|
77806
|
+
const path2 = join51(dir, entry);
|
|
77958
77807
|
let stats;
|
|
77959
77808
|
try {
|
|
77960
77809
|
stats = statSync13(path2);
|
|
@@ -78086,7 +77935,7 @@ var OpenCodeSource = {
|
|
|
78086
77935
|
// packages/runtime/src/tail/pi-source.ts
|
|
78087
77936
|
import { closeSync as closeSync6, existsSync as existsSync39, openSync as openSync6, readdirSync as readdirSync10, readSync as readSync6, statSync as statSync14 } from "fs";
|
|
78088
77937
|
import { homedir as homedir40 } from "os";
|
|
78089
|
-
import { basename as basename18, join as
|
|
77938
|
+
import { basename as basename18, join as join52, relative as relative5 } from "path";
|
|
78090
77939
|
var SOURCE_NAME7 = "pi";
|
|
78091
77940
|
var MAX_SUMMARY_LEN7 = 200;
|
|
78092
77941
|
var DEFAULT_HOT_DISCOVERY_WINDOW_MS7 = 10 * 60 * 1000;
|
|
@@ -78128,7 +77977,7 @@ function discoveryLimit7(scope) {
|
|
|
78128
77977
|
return readPositiveIntEnv7([scopedName, "OPENSCOUT_TAIL_DISCOVERY_LIMIT"], fallback);
|
|
78129
77978
|
}
|
|
78130
77979
|
function projectsRoot2() {
|
|
78131
|
-
return process.env.OPENSCOUT_TAIL_PI_SESSIONS_ROOT ??
|
|
77980
|
+
return process.env.OPENSCOUT_TAIL_PI_SESSIONS_ROOT ?? join52(homedir40(), ".pi", "agent", "sessions");
|
|
78132
77981
|
}
|
|
78133
77982
|
function listJsonlFiles2(dir) {
|
|
78134
77983
|
let entries2 = [];
|
|
@@ -78237,7 +78086,7 @@ function listRecentPiProjectTranscripts(root, scope) {
|
|
|
78237
78086
|
return [];
|
|
78238
78087
|
}
|
|
78239
78088
|
for (const entry of projectDirs) {
|
|
78240
|
-
const projectDir =
|
|
78089
|
+
const projectDir = join52(root, entry);
|
|
78241
78090
|
try {
|
|
78242
78091
|
if (!statSync14(projectDir).isDirectory())
|
|
78243
78092
|
continue;
|
|
@@ -78245,7 +78094,7 @@ function listRecentPiProjectTranscripts(root, scope) {
|
|
|
78245
78094
|
continue;
|
|
78246
78095
|
}
|
|
78247
78096
|
for (const file of listJsonlFiles2(projectDir)) {
|
|
78248
|
-
const path2 =
|
|
78097
|
+
const path2 = join52(projectDir, file);
|
|
78249
78098
|
try {
|
|
78250
78099
|
const stats = statSync14(path2);
|
|
78251
78100
|
if (stats.mtimeMs < cutoff)
|
|
@@ -78677,7 +78526,7 @@ async function readNew(handle, fromOffset, fileSize) {
|
|
|
78677
78526
|
async function readTranscriptText(path2, maxBytes = RECENT_TRANSCRIPT_READ_BYTES) {
|
|
78678
78527
|
let handle = null;
|
|
78679
78528
|
try {
|
|
78680
|
-
const stats = await
|
|
78529
|
+
const stats = await stat8(path2);
|
|
78681
78530
|
if (stats.size <= 0)
|
|
78682
78531
|
return "";
|
|
78683
78532
|
const start = Math.max(0, stats.size - maxBytes);
|
|
@@ -78695,7 +78544,7 @@ async function readTranscriptText(path2, maxBytes = RECENT_TRANSCRIPT_READ_BYTES
|
|
|
78695
78544
|
async function pumpWatcher(watcher) {
|
|
78696
78545
|
let handle = null;
|
|
78697
78546
|
try {
|
|
78698
|
-
const stats = await
|
|
78547
|
+
const stats = await stat8(watcher.transcriptPath);
|
|
78699
78548
|
if (stats.size < watcher.offset) {
|
|
78700
78549
|
watcher.offset = 0;
|
|
78701
78550
|
watcher.carry = "";
|
|
@@ -78760,7 +78609,7 @@ async function pumpAllWatchers() {
|
|
|
78760
78609
|
}
|
|
78761
78610
|
async function seedTail(watcher) {
|
|
78762
78611
|
try {
|
|
78763
|
-
const stats = await
|
|
78612
|
+
const stats = await stat8(watcher.transcriptPath);
|
|
78764
78613
|
watcher.offset = watcher.source.parseFile ? 0 : stats.size;
|
|
78765
78614
|
if (!watcher.source.parseFile && watcher.source.name === "codex") {
|
|
78766
78615
|
const lines = await readRecentTranscriptLines(watcher.transcriptPath, RECENT_TRANSCRIPT_LINES_PER_FILE);
|
|
@@ -78986,7 +78835,7 @@ function snapshotRecentEvents(limit = 500) {
|
|
|
78986
78835
|
async function readRecentTranscriptLines(path2, maxLines = RECENT_TRANSCRIPT_LINES_PER_FILE, maxBytes = RECENT_TRANSCRIPT_READ_BYTES) {
|
|
78987
78836
|
let handle = null;
|
|
78988
78837
|
try {
|
|
78989
|
-
const stats = await
|
|
78838
|
+
const stats = await stat8(path2);
|
|
78990
78839
|
if (stats.size <= 0)
|
|
78991
78840
|
return [];
|
|
78992
78841
|
const start = Math.max(0, stats.size - maxBytes);
|
|
@@ -79382,7 +79231,7 @@ function expandHome2(value) {
|
|
|
79382
79231
|
return homedir41();
|
|
79383
79232
|
}
|
|
79384
79233
|
if (value.startsWith("~/")) {
|
|
79385
|
-
return
|
|
79234
|
+
return join53(homedir41(), value.slice(2));
|
|
79386
79235
|
}
|
|
79387
79236
|
return value;
|
|
79388
79237
|
}
|
|
@@ -79391,17 +79240,17 @@ function encodeClaudeProjectsSlug2(absolutePath) {
|
|
|
79391
79240
|
return `-${normalized.replace(/^\//u, "").replace(/\//gu, "-")}`;
|
|
79392
79241
|
}
|
|
79393
79242
|
function claudeProjectsRoot() {
|
|
79394
|
-
return process.env.OPENSCOUT_CLAUDE_PROJECTS_ROOT?.trim() ||
|
|
79243
|
+
return process.env.OPENSCOUT_CLAUDE_PROJECTS_ROOT?.trim() || join53(homedir41(), ".claude", "projects");
|
|
79395
79244
|
}
|
|
79396
79245
|
function resolveClaudeHistoryPath(cwd, sessionId, options = {}) {
|
|
79397
79246
|
const normalizedCwd = expandHome2(cwd)?.trim();
|
|
79398
79247
|
if (!normalizedCwd) {
|
|
79399
79248
|
return null;
|
|
79400
79249
|
}
|
|
79401
|
-
const projectDir =
|
|
79250
|
+
const projectDir = join53(claudeProjectsRoot(), encodeClaudeProjectsSlug2(normalizedCwd));
|
|
79402
79251
|
const normalizedSessionId = sessionId?.trim().replace(/\.jsonl$/u, "") || "";
|
|
79403
79252
|
if (normalizedSessionId) {
|
|
79404
|
-
const exactPath =
|
|
79253
|
+
const exactPath = join53(projectDir, `${normalizedSessionId}.jsonl`);
|
|
79405
79254
|
if (existsSync40(exactPath)) {
|
|
79406
79255
|
return exactPath;
|
|
79407
79256
|
}
|
|
@@ -79419,7 +79268,7 @@ function findMostRecentJsonl(dir) {
|
|
|
79419
79268
|
for (const entry of readdirSync11(dir)) {
|
|
79420
79269
|
if (!entry.endsWith(".jsonl"))
|
|
79421
79270
|
continue;
|
|
79422
|
-
const full =
|
|
79271
|
+
const full = join53(dir, entry);
|
|
79423
79272
|
const st = statSync15(full);
|
|
79424
79273
|
if (!best || st.mtimeMs > best.mtime) {
|
|
79425
79274
|
best = { path: full, mtime: st.mtimeMs };
|
|
@@ -79455,7 +79304,7 @@ function buildClaudeSessionRefLookup() {
|
|
|
79455
79304
|
if (!projectEntry.isDirectory()) {
|
|
79456
79305
|
continue;
|
|
79457
79306
|
}
|
|
79458
|
-
const projectDir =
|
|
79307
|
+
const projectDir = join53(projectsRoot3, projectEntry.name);
|
|
79459
79308
|
for (const historyEntry of readdirSync11(projectDir, { withFileTypes: true })) {
|
|
79460
79309
|
if (!historyEntry.isFile() || !historyEntry.name.endsWith(".jsonl")) {
|
|
79461
79310
|
continue;
|
|
@@ -79464,14 +79313,14 @@ function buildClaudeSessionRefLookup() {
|
|
|
79464
79313
|
if (!refId) {
|
|
79465
79314
|
continue;
|
|
79466
79315
|
}
|
|
79467
|
-
const historyPath =
|
|
79468
|
-
const
|
|
79316
|
+
const historyPath = join53(projectDir, historyEntry.name);
|
|
79317
|
+
const stat9 = statSync15(historyPath);
|
|
79469
79318
|
addSessionRefLookupEntry(entries2, {
|
|
79470
79319
|
refId,
|
|
79471
79320
|
historyPath,
|
|
79472
79321
|
adapterType: "claude-code",
|
|
79473
|
-
mtimeMs:
|
|
79474
|
-
size:
|
|
79322
|
+
mtimeMs: stat9.mtimeMs,
|
|
79323
|
+
size: stat9.size
|
|
79475
79324
|
});
|
|
79476
79325
|
}
|
|
79477
79326
|
}
|
|
@@ -79846,9 +79695,9 @@ function readHistorySnapshot(candidate) {
|
|
|
79846
79695
|
if (!existsSync40(candidate.path)) {
|
|
79847
79696
|
return null;
|
|
79848
79697
|
}
|
|
79849
|
-
const
|
|
79698
|
+
const stat9 = statSync15(candidate.path);
|
|
79850
79699
|
const cached = historySnapshotCache.get(candidate.path);
|
|
79851
|
-
if (cached && cached.adapterType === candidate.adapterType && cached.mtimeMs ===
|
|
79700
|
+
if (cached && cached.adapterType === candidate.adapterType && cached.mtimeMs === stat9.mtimeMs && cached.size === stat9.size) {
|
|
79852
79701
|
return {
|
|
79853
79702
|
historyPath: cached.historyPath,
|
|
79854
79703
|
snapshot: cached.snapshot,
|
|
@@ -79859,7 +79708,7 @@ function readHistorySnapshot(candidate) {
|
|
|
79859
79708
|
path: candidate.path,
|
|
79860
79709
|
content: readFileSync23(candidate.path, "utf8"),
|
|
79861
79710
|
adapterType: candidate.adapterType,
|
|
79862
|
-
baseTimestampMs:
|
|
79711
|
+
baseTimestampMs: stat9.mtimeMs
|
|
79863
79712
|
});
|
|
79864
79713
|
if (replay.events.length === 0) {
|
|
79865
79714
|
return null;
|
|
@@ -79869,8 +79718,8 @@ function readHistorySnapshot(candidate) {
|
|
|
79869
79718
|
snapshot: replay.snapshot,
|
|
79870
79719
|
timedEvents: normalizeTimedEvents(replay.events),
|
|
79871
79720
|
adapterType: candidate.adapterType,
|
|
79872
|
-
mtimeMs:
|
|
79873
|
-
size:
|
|
79721
|
+
mtimeMs: stat9.mtimeMs,
|
|
79722
|
+
size: stat9.size
|
|
79874
79723
|
};
|
|
79875
79724
|
historySnapshotCache.set(candidate.path, nextEntry);
|
|
79876
79725
|
if (historySnapshotCache.size > HISTORY_SNAPSHOT_CACHE_LIMIT) {
|
|
@@ -80795,37 +80644,7 @@ async function loadBrokerSessionRefObservePayload(refId) {
|
|
|
80795
80644
|
if (!endpoint) {
|
|
80796
80645
|
return null;
|
|
80797
80646
|
}
|
|
80798
|
-
const
|
|
80799
|
-
const actor = broker2.snapshot.actors?.[endpoint.agentId];
|
|
80800
|
-
const endpointRoot = endpoint.projectRoot ?? endpoint.cwd ?? null;
|
|
80801
|
-
if (storedAgent) {
|
|
80802
|
-
const agent = {
|
|
80803
|
-
...storedAgent,
|
|
80804
|
-
harness: endpoint.harness,
|
|
80805
|
-
state: endpoint.state,
|
|
80806
|
-
projectRoot: endpointRoot,
|
|
80807
|
-
cwd: endpoint.cwd ?? endpointRoot,
|
|
80808
|
-
transport: endpoint.transport,
|
|
80809
|
-
harnessSessionId: endpoint.sessionId?.trim() || normalizedRef,
|
|
80810
|
-
project: endpointRoot ? basename20(endpointRoot) : storedAgent.project
|
|
80811
|
-
};
|
|
80812
|
-
const observed2 = await buildAgentObservePayload(agent, broker2, {
|
|
80813
|
-
sessionId: endpoint.sessionId?.trim() || normalizedRef
|
|
80814
|
-
}).catch(() => null);
|
|
80815
|
-
if (observed2 && observed2.source !== "unavailable") {
|
|
80816
|
-
return {
|
|
80817
|
-
kind: "agent",
|
|
80818
|
-
refId: normalizedRef,
|
|
80819
|
-
agentId: endpoint.agentId,
|
|
80820
|
-
source: observed2.source,
|
|
80821
|
-
fidelity: observed2.fidelity,
|
|
80822
|
-
historyPath: observed2.historyPath,
|
|
80823
|
-
sessionId: observed2.sessionId,
|
|
80824
|
-
updatedAt: observed2.updatedAt,
|
|
80825
|
-
data: observed2.data
|
|
80826
|
-
};
|
|
80827
|
-
}
|
|
80828
|
-
}
|
|
80647
|
+
const actor = broker2.snapshot.actors[endpoint.agentId];
|
|
80829
80648
|
const metadata = endpointMetadataRecord(endpoint);
|
|
80830
80649
|
const liveSnapshot = await readEndpointSessionSnapshot(endpoint).catch(() => null);
|
|
80831
80650
|
const providerRefs = endpointProviderSessionRefs(normalizedRef, endpoint, liveSnapshot);
|
|
@@ -80982,13 +80801,13 @@ init_harness_catalog();
|
|
|
80982
80801
|
init_agents();
|
|
80983
80802
|
import { realpathSync as realpathSync3 } from "fs";
|
|
80984
80803
|
import { homedir as homedir42 } from "os";
|
|
80985
|
-
import { isAbsolute as isAbsolute6, join as
|
|
80804
|
+
import { isAbsolute as isAbsolute6, join as join54, resolve as resolve21 } from "path";
|
|
80986
80805
|
function expandHomePath7(value) {
|
|
80987
80806
|
if (value === "~") {
|
|
80988
80807
|
return homedir42();
|
|
80989
80808
|
}
|
|
80990
80809
|
if (value.startsWith("~/")) {
|
|
80991
|
-
return
|
|
80810
|
+
return join54(homedir42(), value.slice(2));
|
|
80992
80811
|
}
|
|
80993
80812
|
return value;
|
|
80994
80813
|
}
|
|
@@ -81381,7 +81200,7 @@ function parseRepoDiffRawZ(output, numstat) {
|
|
|
81381
81200
|
oldPath = null;
|
|
81382
81201
|
if (status === "deleted")
|
|
81383
81202
|
newPath = null;
|
|
81384
|
-
const
|
|
81203
|
+
const stat9 = numstat.get(newPath ?? "") ?? numstat.get(oldPath ?? "");
|
|
81385
81204
|
files.push({
|
|
81386
81205
|
oldPath,
|
|
81387
81206
|
newPath,
|
|
@@ -81391,9 +81210,9 @@ function parseRepoDiffRawZ(output, numstat) {
|
|
|
81391
81210
|
oldMode: fields[0] ?? null,
|
|
81392
81211
|
newMode: fields[1] ?? null,
|
|
81393
81212
|
similarity: twoPathRecord ? Number.parseInt(statusCode.slice(1), 10) || null : null,
|
|
81394
|
-
binary:
|
|
81395
|
-
additions:
|
|
81396
|
-
deletions:
|
|
81213
|
+
binary: stat9?.binary ?? false,
|
|
81214
|
+
additions: stat9?.additions ?? null,
|
|
81215
|
+
deletions: stat9?.deletions ?? null,
|
|
81397
81216
|
hunks: [],
|
|
81398
81217
|
truncated: false
|
|
81399
81218
|
});
|
|
@@ -82552,7 +82371,7 @@ init_db_queries();
|
|
|
82552
82371
|
init_src();
|
|
82553
82372
|
import { Database as Database5 } from "bun:sqlite";
|
|
82554
82373
|
import { homedir as homedir43 } from "os";
|
|
82555
|
-
import { join as
|
|
82374
|
+
import { join as join55 } from "path";
|
|
82556
82375
|
|
|
82557
82376
|
// packages/runtime/src/drizzle.ts
|
|
82558
82377
|
init_drizzle_orm();
|
|
@@ -82575,8 +82394,8 @@ function resolveDbPath2() {
|
|
|
82575
82394
|
const explicit = process.env.OPENSCOUT_CONTROL_PLANE_DB?.trim();
|
|
82576
82395
|
if (explicit)
|
|
82577
82396
|
return explicit;
|
|
82578
|
-
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ??
|
|
82579
|
-
return
|
|
82397
|
+
const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join55(homedir43(), ".openscout", "control-plane");
|
|
82398
|
+
return join55(controlHome, "control-plane.sqlite");
|
|
82580
82399
|
}
|
|
82581
82400
|
function getDb() {
|
|
82582
82401
|
if (!_db2) {
|
|
@@ -83917,7 +83736,7 @@ function trimTrailingSlash(value) {
|
|
|
83917
83736
|
init_support_paths();
|
|
83918
83737
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
83919
83738
|
import { existsSync as existsSync41, mkdirSync as mkdirSync15, readFileSync as readFileSync24, renameSync as renameSync5, writeFileSync as writeFileSync14 } from "fs";
|
|
83920
|
-
import { dirname as dirname30, join as
|
|
83739
|
+
import { dirname as dirname30, join as join56 } from "path";
|
|
83921
83740
|
|
|
83922
83741
|
class ScoutbotReminderError extends Error {
|
|
83923
83742
|
status;
|
|
@@ -83928,7 +83747,7 @@ class ScoutbotReminderError extends Error {
|
|
|
83928
83747
|
}
|
|
83929
83748
|
}
|
|
83930
83749
|
function createScoutbotReminderStore(input = {}) {
|
|
83931
|
-
const filePath = input.filePath ??
|
|
83750
|
+
const filePath = input.filePath ?? join56(resolveOpenScoutSupportPaths().controlHome, "scoutbot-reminders.json");
|
|
83932
83751
|
const now = input.now ?? Date.now;
|
|
83933
83752
|
const readReminders = () => {
|
|
83934
83753
|
if (!existsSync41(filePath)) {
|
|
@@ -84090,7 +83909,7 @@ function titleFromBody(body) {
|
|
|
84090
83909
|
|
|
84091
83910
|
// packages/web/server/scoutbot-credentials.ts
|
|
84092
83911
|
init_support_paths();
|
|
84093
|
-
import { createCipheriv, createDecipheriv, randomBytes as
|
|
83912
|
+
import { createCipheriv, createDecipheriv, randomBytes as randomBytes5 } from "crypto";
|
|
84094
83913
|
import {
|
|
84095
83914
|
existsSync as existsSync42,
|
|
84096
83915
|
mkdirSync as mkdirSync16,
|
|
@@ -84098,12 +83917,12 @@ import {
|
|
|
84098
83917
|
renameSync as renameSync6,
|
|
84099
83918
|
writeFileSync as writeFileSync15
|
|
84100
83919
|
} from "fs";
|
|
84101
|
-
import { dirname as dirname31, join as
|
|
83920
|
+
import { dirname as dirname31, join as join57 } from "path";
|
|
84102
83921
|
var OPENAI_KEY_AAD = "openscout:scoutbot:openai:v1";
|
|
84103
83922
|
function createScoutbotCredentialStore(input = {}) {
|
|
84104
83923
|
const paths2 = resolveOpenScoutSupportPaths();
|
|
84105
|
-
const filePath = input.filePath ??
|
|
84106
|
-
const keyPath = input.keyPath ??
|
|
83924
|
+
const filePath = input.filePath ?? join57(paths2.controlHome, "scoutbot-credentials.json");
|
|
83925
|
+
const keyPath = input.keyPath ?? join57(paths2.controlHome, "scoutbot-credentials.key");
|
|
84107
83926
|
const getOpenAIKey = () => {
|
|
84108
83927
|
const stored = readStore(filePath).openai;
|
|
84109
83928
|
if (!stored)
|
|
@@ -84185,7 +84004,7 @@ function readOrCreateKey(keyPath) {
|
|
|
84185
84004
|
} catch {}
|
|
84186
84005
|
}
|
|
84187
84006
|
mkdirSync16(dirname31(keyPath), { recursive: true });
|
|
84188
|
-
const key =
|
|
84007
|
+
const key = randomBytes5(32);
|
|
84189
84008
|
const tmp = `${keyPath}.tmp`;
|
|
84190
84009
|
writeFileSync15(tmp, `${key.toString("base64url")}
|
|
84191
84010
|
`, { encoding: "utf8", mode: 384 });
|
|
@@ -84193,7 +84012,7 @@ function readOrCreateKey(keyPath) {
|
|
|
84193
84012
|
return key;
|
|
84194
84013
|
}
|
|
84195
84014
|
function encryptSecret(value, key, aad) {
|
|
84196
|
-
const iv =
|
|
84015
|
+
const iv = randomBytes5(12);
|
|
84197
84016
|
const cipher = createCipheriv("aes-256-gcm", key, iv);
|
|
84198
84017
|
cipher.setAAD(Buffer.from(aad, "utf8"));
|
|
84199
84018
|
const ciphertext = Buffer.concat([cipher.update(value, "utf8"), cipher.final()]);
|
|
@@ -85770,11 +85589,9 @@ function getScoutVoiceHealthSnapshot(now = Date.now()) {
|
|
|
85770
85589
|
adapter: "hudson-dictation",
|
|
85771
85590
|
capture: "native",
|
|
85772
85591
|
detail: "Scout voice host is not running. Launch Scout Menu and try again.",
|
|
85773
|
-
inputDevice: null,
|
|
85774
85592
|
host: null
|
|
85775
85593
|
};
|
|
85776
85594
|
}
|
|
85777
|
-
const inputDevice = resolveSessionInputDevice(host);
|
|
85778
85595
|
const micPermission = host.settings.permissions?.find((entry) => entry.kind === "microphone");
|
|
85779
85596
|
const microphoneGranted = micPermission?.granted ?? false;
|
|
85780
85597
|
const microphoneCanRequest = micPermission?.canRequest ?? false;
|
|
@@ -85787,7 +85604,6 @@ function getScoutVoiceHealthSnapshot(now = Date.now()) {
|
|
|
85787
85604
|
capture: "native",
|
|
85788
85605
|
detail,
|
|
85789
85606
|
microphoneGranted: false,
|
|
85790
|
-
inputDevice,
|
|
85791
85607
|
microphoneCanRequest,
|
|
85792
85608
|
host: {
|
|
85793
85609
|
hostId: host.hostId,
|
|
@@ -85804,7 +85620,6 @@ function getScoutVoiceHealthSnapshot(now = Date.now()) {
|
|
|
85804
85620
|
detail: null,
|
|
85805
85621
|
microphoneGranted: true,
|
|
85806
85622
|
microphoneCanRequest: false,
|
|
85807
|
-
inputDevice,
|
|
85808
85623
|
host: {
|
|
85809
85624
|
hostId: host.hostId,
|
|
85810
85625
|
platform: host.platform,
|
|
@@ -85963,7 +85778,7 @@ function mergeVoiceSettings(current, patch) {
|
|
|
85963
85778
|
// packages/web/server/vox.ts
|
|
85964
85779
|
import { existsSync as existsSync43, mkdirSync as mkdirSync17, readFileSync as readFileSync26, writeFileSync as writeFileSync16 } from "fs";
|
|
85965
85780
|
import { homedir as homedir44 } from "os";
|
|
85966
|
-
import { dirname as dirname33, join as
|
|
85781
|
+
import { dirname as dirname33, join as join59 } from "path";
|
|
85967
85782
|
import { randomUUID as randomUUID11 } from "crypto";
|
|
85968
85783
|
var VOX_CLIENT_ID = "openscout-web";
|
|
85969
85784
|
var DEFAULT_VOX_RPC_PORT = 42137;
|
|
@@ -86069,10 +85884,10 @@ function resolveVoxSpeechDefaults(env = process.env) {
|
|
|
86069
85884
|
const modelOverride = firstNonEmptyString7(env.OPENSCOUT_VOX_TTS_MODEL_ID, env.VOX_TTS_MODEL_ID);
|
|
86070
85885
|
const voiceOverride = firstNonEmptyString7(env.OPENSCOUT_VOX_TTS_VOICE_ID, env.VOX_TTS_VOICE_ID);
|
|
86071
85886
|
const voxHome = resolveVoxHome(env);
|
|
86072
|
-
const preferences = readJsonRecord2(
|
|
85887
|
+
const preferences = readJsonRecord2(join59(voxHome, "preferences.json"));
|
|
86073
85888
|
const preferredModel = modelOverride ?? nestedString(preferences, "speech", "preferredSynthesisModelId");
|
|
86074
85889
|
const preferredVoice = voiceOverride ?? nestedString(preferences, "speech", "preferredSynthesisVoiceId");
|
|
86075
|
-
const providers2 = readVoxTtsProviders(
|
|
85890
|
+
const providers2 = readVoxTtsProviders(join59(voxHome, "providers.json"));
|
|
86076
85891
|
const modelId2 = preferredModel ?? modelForPreferredVoice(providers2, preferredVoice) ?? firstConfiguredNonAppleTtsModel(providers2) ?? DEFAULT_VOX_SYNTHESIS_MODEL_ID;
|
|
86077
85892
|
const voiceId = preferredVoice ?? defaultVoiceForModel(providers2, modelId2);
|
|
86078
85893
|
return {
|
|
@@ -86096,13 +85911,13 @@ function ensureOpenScoutVoxOrigins() {
|
|
|
86096
85911
|
}
|
|
86097
85912
|
}
|
|
86098
85913
|
function resolveOpenScoutVoxOriginsPath() {
|
|
86099
|
-
return
|
|
85914
|
+
return join59(resolveVoxHome(), "origins.d", "openscout.json");
|
|
86100
85915
|
}
|
|
86101
85916
|
function resolveVoxHome(env = process.env) {
|
|
86102
|
-
return env.VOX_HOME ??
|
|
85917
|
+
return env.VOX_HOME ?? join59(homedir44(), ".vox");
|
|
86103
85918
|
}
|
|
86104
85919
|
function resolveVoxRpcPort() {
|
|
86105
|
-
const runtimePath = process.env.VOX_RUNTIME_PATH ??
|
|
85920
|
+
const runtimePath = process.env.VOX_RUNTIME_PATH ?? join59(resolveVoxHome(), "runtime.json");
|
|
86106
85921
|
if (!existsSync43(runtimePath)) {
|
|
86107
85922
|
const port = Number(process.env.VOX_PORT);
|
|
86108
85923
|
return Number.isFinite(port) && port > 0 ? port : DEFAULT_VOX_RPC_PORT;
|
|
@@ -86395,7 +86210,7 @@ function firstNonEmptyString8(...values) {
|
|
|
86395
86210
|
// packages/web/server/realtime-voice.ts
|
|
86396
86211
|
import { Database as Database6 } from "bun:sqlite";
|
|
86397
86212
|
import { mkdirSync as mkdirSync18 } from "fs";
|
|
86398
|
-
import { dirname as dirname34, join as
|
|
86213
|
+
import { dirname as dirname34, join as join60 } from "path";
|
|
86399
86214
|
|
|
86400
86215
|
// packages/web/shared/realtime-voice.ts
|
|
86401
86216
|
var SCOUT_REALTIME_VOICE_CALL_PATH = "/api/voice/realtime/call";
|
|
@@ -86674,7 +86489,7 @@ async function createScoutRealtimeVoiceCall(input) {
|
|
|
86674
86489
|
return body;
|
|
86675
86490
|
}
|
|
86676
86491
|
function defaultRealtimeVoiceAdmissionPath() {
|
|
86677
|
-
return
|
|
86492
|
+
return join60(dirname34(resolveDbPath()), "realtime-voice-admission.sqlite");
|
|
86678
86493
|
}
|
|
86679
86494
|
function positiveInteger3(value, fallback) {
|
|
86680
86495
|
const parsed = Number.parseInt(value?.trim() ?? "", 10);
|
|
@@ -87903,7 +87718,7 @@ import { dirname as dirname37, isAbsolute as isAbsolute9, relative as relative7,
|
|
|
87903
87718
|
// packages/web/server/material-heuristics.ts
|
|
87904
87719
|
import { existsSync as existsSync46, mkdirSync as mkdirSync20, readFileSync as readFileSync28, statSync as statSync19, watch, writeFileSync as writeFileSync18 } from "fs";
|
|
87905
87720
|
import { homedir as homedir47 } from "os";
|
|
87906
|
-
import { basename as basename24, dirname as dirname36, isAbsolute as isAbsolute8, join as
|
|
87721
|
+
import { basename as basename24, dirname as dirname36, isAbsolute as isAbsolute8, join as join63, resolve as resolve25 } from "path";
|
|
87907
87722
|
import { createRequire as createRequire3 } from "module";
|
|
87908
87723
|
var require4 = createRequire3(import.meta.url);
|
|
87909
87724
|
var picomatch = require4("picomatch");
|
|
@@ -87947,7 +87762,7 @@ var globalCachePath = null;
|
|
|
87947
87762
|
var globalCache = null;
|
|
87948
87763
|
var globalWatcher = null;
|
|
87949
87764
|
function globalHeuristicsPath() {
|
|
87950
|
-
return
|
|
87765
|
+
return join63(process.env.HOME ?? homedir47(), ".openscout", "heuristics.json");
|
|
87951
87766
|
}
|
|
87952
87767
|
function normalizePathForGlob(path2) {
|
|
87953
87768
|
return path2.replaceAll("\\", "/").replace(/^\.\//u, "");
|
|
@@ -88130,9 +87945,9 @@ function writeGlobalHeuristicsFile(raw2) {
|
|
|
88130
87945
|
return writeHeuristicsFile(globalHeuristicsPath(), raw2);
|
|
88131
87946
|
}
|
|
88132
87947
|
function projectHeuristicsPath(workspaceRoot) {
|
|
88133
|
-
const expanded = workspaceRoot.startsWith("~/") ?
|
|
87948
|
+
const expanded = workspaceRoot.startsWith("~/") ? join63(process.env.HOME ?? homedir47(), workspaceRoot.slice(2)) : workspaceRoot;
|
|
88134
87949
|
const root = isAbsolute8(expanded) ? resolve25(expanded) : resolve25(expanded);
|
|
88135
|
-
return
|
|
87950
|
+
return join63(root, ".openscout", "heuristics.json");
|
|
88136
87951
|
}
|
|
88137
87952
|
function projectHeuristicsFile(workspaceRoot) {
|
|
88138
87953
|
return readHeuristicsFile(projectHeuristicsPath(workspaceRoot));
|
|
@@ -88263,8 +88078,8 @@ function normalizeExistingPath(value) {
|
|
|
88263
88078
|
return null;
|
|
88264
88079
|
}
|
|
88265
88080
|
try {
|
|
88266
|
-
const
|
|
88267
|
-
return
|
|
88081
|
+
const stat9 = statSync20(absolute);
|
|
88082
|
+
return stat9.isDirectory() ? absolute : dirname37(absolute);
|
|
88268
88083
|
} catch {
|
|
88269
88084
|
return null;
|
|
88270
88085
|
}
|
|
@@ -89013,8 +88828,8 @@ async function resolveTrustedMaterialPath(work, materialId) {
|
|
|
89013
88828
|
if (!pathInsideRoot(realPath, realRoot)) {
|
|
89014
88829
|
return { ok: false, status: 403, error: "material path is outside its trusted root" };
|
|
89015
88830
|
}
|
|
89016
|
-
const
|
|
89017
|
-
if (!
|
|
88831
|
+
const stat9 = statSync20(realPath);
|
|
88832
|
+
if (!stat9.isFile()) {
|
|
89018
88833
|
return { ok: false, status: 415, error: "material is not a file" };
|
|
89019
88834
|
}
|
|
89020
88835
|
return { ok: true, material, realPath };
|
|
@@ -89028,12 +88843,12 @@ async function readWorkMaterialRaw(work, materialId) {
|
|
|
89028
88843
|
return resolved;
|
|
89029
88844
|
}
|
|
89030
88845
|
try {
|
|
89031
|
-
const
|
|
88846
|
+
const stat9 = statSync20(resolved.realPath);
|
|
89032
88847
|
return {
|
|
89033
88848
|
ok: true,
|
|
89034
88849
|
realPath: resolved.realPath,
|
|
89035
88850
|
mediaType: materialMediaType(resolved.realPath),
|
|
89036
|
-
sizeBytes:
|
|
88851
|
+
sizeBytes: stat9.size
|
|
89037
88852
|
};
|
|
89038
88853
|
} catch {
|
|
89039
88854
|
return { ok: false, status: 404, error: "material could not be read" };
|
|
@@ -89063,8 +88878,8 @@ async function readWorkMaterialContent(work, materialId) {
|
|
|
89063
88878
|
if (!pathInsideRoot(realPath, realRoot)) {
|
|
89064
88879
|
return { ok: false, status: 403, error: "material path is outside its trusted root" };
|
|
89065
88880
|
}
|
|
89066
|
-
const
|
|
89067
|
-
if (!
|
|
88881
|
+
const stat9 = statSync20(realPath);
|
|
88882
|
+
if (!stat9.isFile()) {
|
|
89068
88883
|
return { ok: false, status: 415, error: "material is not a file" };
|
|
89069
88884
|
}
|
|
89070
88885
|
const buffer = readFileSync29(realPath);
|
|
@@ -89096,9 +88911,9 @@ async function readWorkMaterialContent(work, materialId) {
|
|
|
89096
88911
|
|
|
89097
88912
|
// packages/web/server/plan-documents.ts
|
|
89098
88913
|
import { createHash as createHash9 } from "crypto";
|
|
89099
|
-
import { readdir as readdir4, readFile as
|
|
88914
|
+
import { readdir as readdir4, readFile as readFile16, stat as stat9 } from "fs/promises";
|
|
89100
88915
|
import { homedir as homedir49 } from "os";
|
|
89101
|
-
import { basename as basename25, isAbsolute as isAbsolute10, join as
|
|
88916
|
+
import { basename as basename25, isAbsolute as isAbsolute10, join as join64, relative as relative8, resolve as resolve27 } from "path";
|
|
89102
88917
|
var HOME3 = homedir49();
|
|
89103
88918
|
var PLAN_SUBDIRECTORIES = [
|
|
89104
88919
|
"plans",
|
|
@@ -89190,7 +89005,7 @@ async function walkMarkdownFiles(directory, remaining = { count: MAX_FILES_PER_R
|
|
|
89190
89005
|
for (const entry of entries2) {
|
|
89191
89006
|
if (remaining.count <= 0)
|
|
89192
89007
|
break;
|
|
89193
|
-
const fullPath =
|
|
89008
|
+
const fullPath = join64(directory, entry.name);
|
|
89194
89009
|
if (entry.isDirectory()) {
|
|
89195
89010
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist") {
|
|
89196
89011
|
continue;
|
|
@@ -89209,11 +89024,11 @@ async function discoverPlanFiles(root) {
|
|
|
89209
89024
|
if (root.kind === "home") {
|
|
89210
89025
|
return walkMarkdownFiles(root.root);
|
|
89211
89026
|
}
|
|
89212
|
-
const fromPlanDirs = (await Promise.all(PLAN_SUBDIRECTORIES.map((subdir) => walkMarkdownFiles(
|
|
89027
|
+
const fromPlanDirs = (await Promise.all(PLAN_SUBDIRECTORIES.map((subdir) => walkMarkdownFiles(join64(root.root, subdir))))).flat();
|
|
89213
89028
|
let directPlanFiles = [];
|
|
89214
89029
|
try {
|
|
89215
89030
|
const entries2 = await readdir4(root.root, { withFileTypes: true });
|
|
89216
|
-
directPlanFiles = entries2.filter((entry) => entry.isFile() && /\.plan\.md$/i.test(entry.name)).map((entry) =>
|
|
89031
|
+
directPlanFiles = entries2.filter((entry) => entry.isFile() && /\.plan\.md$/i.test(entry.name)).map((entry) => join64(root.root, entry.name));
|
|
89217
89032
|
} catch {
|
|
89218
89033
|
directPlanFiles = [];
|
|
89219
89034
|
}
|
|
@@ -89395,11 +89210,11 @@ function idForPlan(root, filePath) {
|
|
|
89395
89210
|
return `plan-doc:${hash}`;
|
|
89396
89211
|
}
|
|
89397
89212
|
async function readPlanDocument(root, filePath) {
|
|
89398
|
-
const fileStats = await
|
|
89213
|
+
const fileStats = await stat9(filePath).catch(() => null);
|
|
89399
89214
|
if (!fileStats || !fileStats.isFile() || fileStats.size > MAX_DOCUMENT_BYTES) {
|
|
89400
89215
|
return null;
|
|
89401
89216
|
}
|
|
89402
|
-
const rawText = await
|
|
89217
|
+
const rawText = await readFile16(filePath, "utf8").catch(() => null);
|
|
89403
89218
|
if (rawText === null)
|
|
89404
89219
|
return null;
|
|
89405
89220
|
const id = idForPlan(root, filePath);
|
|
@@ -89480,7 +89295,7 @@ init_file_preview();
|
|
|
89480
89295
|
init_support_paths();
|
|
89481
89296
|
import {
|
|
89482
89297
|
createHmac as createHmac2,
|
|
89483
|
-
randomBytes as
|
|
89298
|
+
randomBytes as randomBytes6,
|
|
89484
89299
|
timingSafeEqual as timingSafeEqual2
|
|
89485
89300
|
} from "crypto";
|
|
89486
89301
|
import {
|
|
@@ -89490,7 +89305,7 @@ import {
|
|
|
89490
89305
|
readFileSync as readFileSync31,
|
|
89491
89306
|
writeFileSync as writeFileSync19
|
|
89492
89307
|
} from "fs";
|
|
89493
|
-
import { join as
|
|
89308
|
+
import { join as join65 } from "path";
|
|
89494
89309
|
var SERVICE_LINK_SECRET_FILE = "service-link-signing.key";
|
|
89495
89310
|
var SERVICE_LINK_VERSION = "v1";
|
|
89496
89311
|
var SERVICE_LINK_TTL_MS = 60000;
|
|
@@ -89509,7 +89324,7 @@ function parseScoutServicesRestartTarget(value) {
|
|
|
89509
89324
|
function createSignedScoutServicesRestartUrl(target2, options = {}) {
|
|
89510
89325
|
const nowMs3 = options.nowMs ?? Date.now();
|
|
89511
89326
|
const expiresAt = nowMs3 + SERVICE_LINK_TTL_MS;
|
|
89512
|
-
const nonce = options.nonce ??
|
|
89327
|
+
const nonce = options.nonce ?? randomBytes6(16).toString("base64url");
|
|
89513
89328
|
const payload = serviceLinkPayload("restart", target2, String(expiresAt), nonce);
|
|
89514
89329
|
const sig = signPayload(payload);
|
|
89515
89330
|
const params = new URLSearchParams({
|
|
@@ -89537,7 +89352,7 @@ function signPayload(payload) {
|
|
|
89537
89352
|
return createHmac2("sha256", readOrCreateServiceLinkSecret()).update(payload).digest("base64url");
|
|
89538
89353
|
}
|
|
89539
89354
|
function serviceLinkSecretPath() {
|
|
89540
|
-
return
|
|
89355
|
+
return join65(resolveOpenScoutSupportPaths().supportDirectory, SERVICE_LINK_SECRET_FILE);
|
|
89541
89356
|
}
|
|
89542
89357
|
function readOrCreateServiceLinkSecret() {
|
|
89543
89358
|
const path2 = serviceLinkSecretPath();
|
|
@@ -89546,7 +89361,7 @@ function readOrCreateServiceLinkSecret() {
|
|
|
89546
89361
|
}
|
|
89547
89362
|
const supportDirectory = resolveOpenScoutSupportPaths().supportDirectory;
|
|
89548
89363
|
mkdirSync21(supportDirectory, { recursive: true, mode: 448 });
|
|
89549
|
-
const secret =
|
|
89364
|
+
const secret = randomBytes6(32);
|
|
89550
89365
|
try {
|
|
89551
89366
|
writeFileSync19(path2, `${secret.toString("base64url")}
|
|
89552
89367
|
`, {
|
|
@@ -90557,7 +90372,7 @@ async function readProcessCwd2(pid) {
|
|
|
90557
90372
|
return await readProcessCwd(pid);
|
|
90558
90373
|
}
|
|
90559
90374
|
function claudeProjectDirForCwd(cwd) {
|
|
90560
|
-
return
|
|
90375
|
+
return join71(homedir55(), ".claude", "projects", cwd.replace(/\//gu, "-"));
|
|
90561
90376
|
}
|
|
90562
90377
|
function mostRecentClaudeSessionForCwd(cwd) {
|
|
90563
90378
|
const dir = claudeProjectDirForCwd(cwd);
|
|
@@ -90571,7 +90386,7 @@ function mostRecentClaudeSessionForCwd(cwd) {
|
|
|
90571
90386
|
for (const entry of entries2) {
|
|
90572
90387
|
if (!entry.endsWith(".jsonl"))
|
|
90573
90388
|
continue;
|
|
90574
|
-
const transcriptPath =
|
|
90389
|
+
const transcriptPath = join71(dir, entry);
|
|
90575
90390
|
try {
|
|
90576
90391
|
const mtimeMs = statSync25(transcriptPath).mtimeMs;
|
|
90577
90392
|
if (!best || mtimeMs > best.mtimeMs) {
|
|
@@ -90594,7 +90409,7 @@ function readRelayRuntimeStateForTmuxSession(sessionName) {
|
|
|
90594
90409
|
return null;
|
|
90595
90410
|
}
|
|
90596
90411
|
for (const entry of entries2) {
|
|
90597
|
-
const statePath =
|
|
90412
|
+
const statePath = join71(agentsDir, entry, "state.json");
|
|
90598
90413
|
try {
|
|
90599
90414
|
const parsed = JSON.parse(readFileSync35(statePath, "utf8"));
|
|
90600
90415
|
if (parsed.sessionId === sessionName)
|
|
@@ -91814,7 +91629,7 @@ function expandHomePath8(value) {
|
|
|
91814
91629
|
return homedir55();
|
|
91815
91630
|
}
|
|
91816
91631
|
if (value.startsWith("~/")) {
|
|
91817
|
-
return
|
|
91632
|
+
return join71(homedir55(), value.slice(2));
|
|
91818
91633
|
}
|
|
91819
91634
|
return value;
|
|
91820
91635
|
}
|
|
@@ -91943,7 +91758,7 @@ function brokerDispatchReviewPrompt(input) {
|
|
|
91943
91758
|
"Review this from first principles, then inspect the relevant implementation.",
|
|
91944
91759
|
"",
|
|
91945
91760
|
"Topic: OpenScout failed dispatch / failed delivery",
|
|
91946
|
-
"Workspace: /Users/
|
|
91761
|
+
"Workspace: /Users/example/dev/openscout",
|
|
91947
91762
|
"",
|
|
91948
91763
|
"User goal:",
|
|
91949
91764
|
"- Diagnose this failed dispatch from the Dispatch screen.",
|
|
@@ -92121,14 +91936,6 @@ async function refreshOpenScoutBuildInfo(currentDirectory) {
|
|
|
92121
91936
|
const snapshot = await probe.fresh({ maxAgeMs: 0 });
|
|
92122
91937
|
return openScoutBuildInfoFromGit(snapshot.value);
|
|
92123
91938
|
}
|
|
92124
|
-
async function resolveOpenScoutBuildInfo(currentDirectory, refresh) {
|
|
92125
|
-
if (refresh)
|
|
92126
|
-
return refreshOpenScoutBuildInfo(currentDirectory);
|
|
92127
|
-
const cached2 = gitBuildInfoProbe.for(currentDirectory).read();
|
|
92128
|
-
if (cached2.value)
|
|
92129
|
-
return openScoutBuildInfoFromGit(cached2.value);
|
|
92130
|
-
return warmOpenScoutBuildInfo(currentDirectory);
|
|
92131
|
-
}
|
|
92132
91939
|
function permissionSetupHint(detail) {
|
|
92133
91940
|
const normalized = detail.toLowerCase();
|
|
92134
91941
|
const mentionsPermission = /permission|approval|allow|blocked/.test(normalized);
|
|
@@ -92908,7 +92715,7 @@ function isLikelyHudProjectRoot(root) {
|
|
|
92908
92715
|
} catch {
|
|
92909
92716
|
return false;
|
|
92910
92717
|
}
|
|
92911
|
-
return HUD_PROJECT_MARKERS.some((marker) => existsSync53(
|
|
92718
|
+
return HUD_PROJECT_MARKERS.some((marker) => existsSync53(join71(normalized, marker)));
|
|
92912
92719
|
}
|
|
92913
92720
|
function currentDirectoryProjectOption(currentDirectory, defaultHarness) {
|
|
92914
92721
|
const trimmed = currentDirectory.trim();
|
|
@@ -93267,7 +93074,8 @@ async function createOpenScoutWebServer(options) {
|
|
|
93267
93074
|
publicOrigin: options.publicOrigin
|
|
93268
93075
|
}));
|
|
93269
93076
|
app.get("/api/build", async (c) => {
|
|
93270
|
-
|
|
93077
|
+
const buildInfo = c.req.query("refresh") === "1" ? await refreshOpenScoutBuildInfo(currentDirectory) : loadOpenScoutBuildInfo(currentDirectory);
|
|
93078
|
+
return c.json(buildInfo);
|
|
93271
93079
|
});
|
|
93272
93080
|
app.get("/api/knowledge/status", (c) => {
|
|
93273
93081
|
const store2 = new SQLiteKnowledgeStore(undefined, undefined, { readonly: true });
|
|
@@ -95069,7 +94877,6 @@ async function createOpenScoutWebServer(options) {
|
|
|
95069
94877
|
pronouns: config.pronouns ?? "",
|
|
95070
94878
|
hue: config.hue ?? 195,
|
|
95071
94879
|
monogram: config.monogram ?? "",
|
|
95072
|
-
avatar: config.avatar ?? "",
|
|
95073
94880
|
bio: config.bio ?? "",
|
|
95074
94881
|
timezone: config.timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
95075
94882
|
workingHours: config.workingHours ?? "08:00 \u2013 18:00",
|
|
@@ -95184,7 +94991,6 @@ async function createOpenScoutWebServer(options) {
|
|
|
95184
94991
|
"handle",
|
|
95185
94992
|
"pronouns",
|
|
95186
94993
|
"monogram",
|
|
95187
|
-
"avatar",
|
|
95188
94994
|
"bio",
|
|
95189
94995
|
"timezone",
|
|
95190
94996
|
"workingHours",
|
|
@@ -95224,7 +95030,6 @@ async function createOpenScoutWebServer(options) {
|
|
|
95224
95030
|
pronouns: config.pronouns ?? "",
|
|
95225
95031
|
hue: config.hue ?? 195,
|
|
95226
95032
|
monogram: config.monogram ?? "",
|
|
95227
|
-
avatar: config.avatar ?? "",
|
|
95228
95033
|
bio: config.bio ?? "",
|
|
95229
95034
|
timezone: config.timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
95230
95035
|
workingHours: config.workingHours ?? "08:00 \u2013 18:00",
|
|
@@ -95761,12 +95566,12 @@ async function createOpenScoutWebServer(options) {
|
|
|
95761
95566
|
});
|
|
95762
95567
|
mountScoutVoiceRoutes(app, { resolveOpenAIApiKey: scoutbot.resolveOpenAIApiKey });
|
|
95763
95568
|
if (true) {
|
|
95764
|
-
const fixturesRoot =
|
|
95569
|
+
const fixturesRoot = join71(process.cwd(), "dev", "scoutbot-fx-fixtures");
|
|
95765
95570
|
app.get("/api/dev/scoutbot-fx/fixtures", (c) => {
|
|
95766
95571
|
if (!existsSync53(fixturesRoot)) {
|
|
95767
95572
|
return c.json({ fixtures: [], generatedAt: null, available: false });
|
|
95768
95573
|
}
|
|
95769
|
-
const manifestPath =
|
|
95574
|
+
const manifestPath = join71(fixturesRoot, "manifest.json");
|
|
95770
95575
|
if (!existsSync53(manifestPath)) {
|
|
95771
95576
|
return c.json({ fixtures: [], generatedAt: null, available: true, note: "manifest missing \u2014 re-run the generator script" });
|
|
95772
95577
|
}
|
|
@@ -95790,7 +95595,7 @@ async function createOpenScoutWebServer(options) {
|
|
|
95790
95595
|
if (!/^[a-zA-Z0-9._-]+\.wav$/.test(raw2)) {
|
|
95791
95596
|
return c.json({ error: "invalid fixture name" }, 400);
|
|
95792
95597
|
}
|
|
95793
|
-
const filePath =
|
|
95598
|
+
const filePath = join71(fixturesRoot, raw2);
|
|
95794
95599
|
if (!existsSync53(filePath)) {
|
|
95795
95600
|
return c.json({ error: "fixture not found" }, 404);
|
|
95796
95601
|
}
|
|
@@ -96040,7 +95845,7 @@ function resolveOpenScoutWebApplicationServerIdentity(env = process.env, _machin
|
|
|
96040
95845
|
|
|
96041
95846
|
// packages/web/server/relay.ts
|
|
96042
95847
|
import { mkdir as mkdir15, writeFile as writeFile13 } from "fs/promises";
|
|
96043
|
-
import { basename as basename32, join as
|
|
95848
|
+
import { basename as basename32, join as join72 } from "path";
|
|
96044
95849
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
96045
95850
|
var UPLOAD_DIR = "/tmp/scout-uploads";
|
|
96046
95851
|
function sanitizeUploadName(name2) {
|
|
@@ -96060,7 +95865,7 @@ async function handleRelayUpload(req) {
|
|
|
96060
95865
|
return Response.json({ error: "Invalid name" }, { status: 400 });
|
|
96061
95866
|
}
|
|
96062
95867
|
await mkdir15(UPLOAD_DIR, { recursive: true, mode: 448 });
|
|
96063
|
-
const filepath =
|
|
95868
|
+
const filepath = join72(UPLOAD_DIR, `${randomUUID12()}-${safeName}`);
|
|
96064
95869
|
await writeFile13(filepath, Buffer.from(data, "base64"), { mode: 384 });
|
|
96065
95870
|
return Response.json({ path: filepath });
|
|
96066
95871
|
}
|
|
@@ -96592,7 +96397,7 @@ function startProcessParentWatchdog(expectedParentPidRaw, options = {}) {
|
|
|
96592
96397
|
process.title = "scout-web";
|
|
96593
96398
|
var port = Number.parseInt(process.env.OPENSCOUT_WEB_PORT ?? process.env.SCOUT_WEB_PORT ?? String(resolveWebPort()), 10);
|
|
96594
96399
|
var hostname2 = resolveScoutWebBindHost(process.env);
|
|
96595
|
-
var webAuthToken =
|
|
96400
|
+
var webAuthToken = process.env.OPENSCOUT_WEB_AUTH_TOKEN?.trim() || randomBytes7(32).toString("base64url");
|
|
96596
96401
|
var currentDirectory = resolveOpenScoutSetupContextRoot({
|
|
96597
96402
|
env: process.env,
|
|
96598
96403
|
fallbackDirectory: process.cwd()
|
|
@@ -96606,12 +96411,12 @@ function resolveStaticRoot2() {
|
|
|
96606
96411
|
return process.env.OPENSCOUT_WEB_STATIC_ROOT.trim();
|
|
96607
96412
|
}
|
|
96608
96413
|
const selfDir = dirname43(fileURLToPath10(import.meta.url));
|
|
96609
|
-
const siblingClientRoot =
|
|
96610
|
-
if (existsSync55(
|
|
96414
|
+
const siblingClientRoot = join73(selfDir, "client");
|
|
96415
|
+
if (existsSync55(join73(siblingClientRoot, "index.html"))) {
|
|
96611
96416
|
return siblingClientRoot;
|
|
96612
96417
|
}
|
|
96613
96418
|
const sourceDistClientRoot = resolve31(selfDir, "../dist/client");
|
|
96614
|
-
if (existsSync55(
|
|
96419
|
+
if (existsSync55(join73(sourceDistClientRoot, "index.html"))) {
|
|
96615
96420
|
return sourceDistClientRoot;
|
|
96616
96421
|
}
|
|
96617
96422
|
return;
|