@fased/fased 0.1.18 → 0.1.20

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.
Files changed (228) hide show
  1. package/dist/{agents-B6Phr7_f.js → agents-ChQhgSlb.js} +11 -11
  2. package/dist/{attachment-normalize-CzEnjLNz.js → attachment-normalize-Cr8RzfVf.js} +1 -1
  3. package/dist/{attachment-normalize-Cw5usv34.js → attachment-normalize-DB19KLbl.js} +1 -1
  4. package/dist/{audio-preflight-Bb2vNNbg.js → audio-preflight-BLGP3XdB.js} +1 -1
  5. package/dist/{audio-preflight-CE7uXO4r.js → audio-preflight-BmW52Ycp.js} +1 -1
  6. package/dist/{audio-preflight-DdTXlJCN.js → audio-preflight-CHhcmiXJ.js} +3 -3
  7. package/dist/{audio-preflight-BneukbKN.js → audio-preflight-DAevycUR.js} +2 -2
  8. package/dist/{audio-preflight-DLDBtl4e.js → audio-preflight-DVwcDm03.js} +3 -3
  9. package/dist/{audit-xX6RNayR.js → audit-C5YXYuIL.js} +1 -1
  10. package/dist/{audit-B2R6WwpA.js → audit-DPnCY1UL.js} +1 -1
  11. package/dist/{auth-DtTjcdsn.js → auth-BbQxXxtt.js} +5 -5
  12. package/dist/{auth-choice-DEux81xn.js → auth-choice-D8Q1fQwa.js} +2 -2
  13. package/dist/{auth-choice-DSs5l1Mv.js → auth-choice-DRyuJ7OL.js} +2 -2
  14. package/dist/{auth-choice-prompt-D8d4kRYT.js → auth-choice-prompt-Bs_OE3ai.js} +1 -1
  15. package/dist/{auth-choice-prompt-Dhl403zz.js → auth-choice-prompt-EOHB6Adp.js} +1 -1
  16. package/dist/build-info.json +3 -3
  17. package/dist/bundled/boot-md/handler.js +1 -1
  18. package/dist/bundled/session-memory/handler.js +1 -1
  19. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  20. package/dist/{channel-web-DRJ_lg4d.js → channel-web-BYwefJub.js} +1 -1
  21. package/dist/{channel-web-B_R-iuZ6.js → channel-web-Do7PfpgZ.js} +1 -1
  22. package/dist/{channels-D9lINC_R.js → channels-Ca02RvCt.js} +9 -9
  23. package/dist/{channels-B-7M3uYr.js → channels-DrEj3b4G.js} +9 -9
  24. package/dist/{channels-cli-BNR8Ueih.js → channels-cli-CCa-scQg.js} +6 -6
  25. package/dist/{channels-cli-CZZGaHdW.js → channels-cli-b6IPejdy.js} +6 -6
  26. package/dist/{clack-prompter-D2fuSvy3.js → clack-prompter-DhFjwbXA.js} +110 -40
  27. package/dist/{clack-prompter-DsooqWFU.js → clack-prompter-Q_PN4iLX.js} +110 -40
  28. package/dist/cli/daemon-cli.js +1 -1
  29. package/dist/{cli-DDzZu95y.js → cli-DXIWIIJj.js} +3 -3
  30. package/dist/{cli-PJTbyT76.js → cli-eje5udQT.js} +3 -3
  31. package/dist/{command-registry-DH2g-1VS.js → command-registry-Bs12xiCA.js} +9 -9
  32. package/dist/{completion-cli-cirX46xi.js → completion-cli-Btcmy2ZS.js} +2 -2
  33. package/dist/{completion-cli-Cszwcu14.js → completion-cli-RlpZaXwm.js} +1 -1
  34. package/dist/{config-cli-wGaTNazO.js → config-cli-CTo8yFw1.js} +1 -1
  35. package/dist/{config-cli-D-JctiSJ.js → config-cli-D-FqgnuJ.js} +1 -1
  36. package/dist/{config-guard-C74yuV1t.js → config-guard-D6r7usdP.js} +2 -2
  37. package/dist/{config-guard-ComvK070.js → config-guard-DnCSSIeP.js} +1 -1
  38. package/dist/{configure-BZPWTrYa.js → configure-CLTc56jo.js} +16 -16
  39. package/dist/{configure-B3qdEOin.js → configure-D0-Sq2kW.js} +16 -16
  40. package/dist/control-ui/assets/app-DXYMrRJ9.js.map +1 -1
  41. package/dist/{cron-cli-B_Y1xWzG.js → cron-cli-BstCBSyn.js} +2 -2
  42. package/dist/{cron-cli-DV_fO2Av.js → cron-cli-pA06wiEq.js} +2 -2
  43. package/dist/{daemon-cli-DwEfnmS3.js → daemon-cli-DiuXEPjO.js} +1 -1
  44. package/dist/{daemon-cli-D99T8qck.js → daemon-cli-cyqRsnTF.js} +1 -1
  45. package/dist/daemon-cli.js +1 -1
  46. package/dist/{deps-DXHMO1Yj.js → deps-BKAIBkcE.js} +1 -1
  47. package/dist/{deps-5vuaH16V.js → deps-BWo3ls9h.js} +1 -1
  48. package/dist/{doctor-config-flow-4WutpMTV.js → doctor-config-flow-B-I0osH5.js} +1 -1
  49. package/dist/{doctor-config-flow-Cd9O0xNE.js → doctor-config-flow-Ceaz-Gkk.js} +1 -1
  50. package/dist/entry.js +1 -1
  51. package/dist/extensionAPI.js +2 -2
  52. package/dist/{gateway-cli-DxttS--5.js → gateway-cli-BbSS1Nxd.js} +28 -28
  53. package/dist/{gateway-cli-DnTW-Vqh.js → gateway-cli-izDCXWNN.js} +28 -28
  54. package/dist/{health-CK5_7SB-.js → health-DW5NMpNI.js} +2 -2
  55. package/dist/{health-DkKBhl0x.js → health-kF4U3o3b.js} +2 -2
  56. package/dist/{heartbeat-runner-C_SzC_tK.js → heartbeat-runner-BnDruNG2.js} +1 -1
  57. package/dist/{heartbeat-runner-B9_owa4e.js → heartbeat-runner-CJP5uO8S.js} +1 -1
  58. package/dist/{hooks-cli-CF1H42-g.js → hooks-cli-CSFuSiA5.js} +4 -4
  59. package/dist/{hooks-cli-DsUN2nCy.js → hooks-cli-U5qCBqJm.js} +4 -4
  60. package/dist/index.js +9 -9
  61. package/dist/{ipv4-oR6PCFkE.js → ipv4-B42xQEbV.js} +2 -2
  62. package/dist/{ipv4-hmcj6CY1.js → ipv4-DSDJ9Fn2.js} +2 -2
  63. package/dist/{lifecycle-DkQi8XHs.js → lifecycle-Bbry4K-O.js} +1 -1
  64. package/dist/{lifecycle-BtrqlzIp.js → lifecycle-BiNcSCVf.js} +1 -1
  65. package/dist/{list.auth-overview-DqpchDrO.js → list.auth-overview-ByYcn7Ct.js} +1 -1
  66. package/dist/{list.auth-overview-DtfRUx-B.js → list.auth-overview-Di-jSuQF.js} +1 -1
  67. package/dist/llm-slug-generator.js +1 -1
  68. package/dist/{model-catalog--SvucuO6.js → model-catalog-ex4Cpln_.js} +12 -8
  69. package/dist/{models-zXXNWbCe.js → models-BonzQ9Rv.js} +7 -7
  70. package/dist/{models-cli-8b2o7ZBO.js → models-cli-Cc0fVKLR.js} +7 -7
  71. package/dist/{models-cli-DwXIxRSn.js → models-cli-DZ05AYqI.js} +8 -8
  72. package/dist/{node-cli-D55JvlGv.js → node-cli-CKXvITsL.js} +3 -3
  73. package/dist/{node-cli-Dmiet_CN.js → node-cli-Dfl7X414.js} +3 -3
  74. package/dist/{note-DrwZGnSu.js → note-DwkETqd-.js} +2 -0
  75. package/dist/{note-CLUeye9D.js → note-rV2vspIo.js} +2 -0
  76. package/dist/{onboard-CqUH0CNb.js → onboard-BDK2o_5B.js} +8 -8
  77. package/dist/{onboard-BMckmyvg.js → onboard-CpJeEn67.js} +8 -8
  78. package/dist/{onboard-channels-CWZUEiko.js → onboard-channels-CDXretWe.js} +2 -2
  79. package/dist/{onboard-channels-Di1MifgF.js → onboard-channels-ZnUGKi2j.js} +2 -2
  80. package/dist/{onboard-search-CLhDai7x.js → onboard-search-BIltnW27.js} +6 -6
  81. package/dist/{onboard-search-WWi4blgc.js → onboard-search-HgNX3hct.js} +6 -6
  82. package/dist/{onboarding-DsCvgeVW.js → onboarding-Bgx1tJnU.js} +128 -65
  83. package/dist/{onboarding-D4OTdWQp.js → onboarding-CBlXOasA.js} +128 -65
  84. package/dist/{openresponses-http-CFQL8cSe.js → openresponses-http-5S3xc2MZ.js} +1 -1
  85. package/dist/{openresponses-http-qcMe4CnQ.js → openresponses-http-BBNbIRzc.js} +2 -2
  86. package/dist/{openresponses-http-DVyWivMq.js → openresponses-http-BTpFUwym.js} +1 -1
  87. package/dist/{openresponses-http-D6Ttjnvd.js → openresponses-http-COAxhJal.js} +3 -3
  88. package/dist/{openresponses-http-BdrytBTu.js → openresponses-http-o273A5SH.js} +3 -3
  89. package/dist/{parent-default-help-ClCr80XR.js → parent-default-help-BwE33-U1.js} +1 -1
  90. package/dist/{parent-default-help-D_UWzDsy.js → parent-default-help-DzWAx_GB.js} +1 -1
  91. package/dist/{paths-DuymR5Rg.js → paths-Bzz-O3FX.js} +9 -9
  92. package/dist/{pi-embedded-IQzv6URS.js → pi-embedded-Bnuo5tPq.js} +5 -5
  93. package/dist/{pi-embedded-BS0sTNPV.js → pi-embedded-CeuBUTjd.js} +14 -14
  94. package/dist/{plugin-registry-DfiokqgQ.js → plugin-registry-D2IeEq2N.js} +1 -1
  95. package/dist/{plugin-registry-C6ytAnfA.js → plugin-registry-DjTXh-9g.js} +1 -1
  96. package/dist/plugin-sdk/{audio-preflight-Cyb1e94b.js → audio-preflight-CVWduuEO.js} +1 -1
  97. package/dist/plugin-sdk/{audio-preflight-CWTDcoUz.js → audio-preflight-CdPkTmJX.js} +1 -1
  98. package/dist/plugin-sdk/channel-plugin-common.js +1 -1
  99. package/dist/plugin-sdk/{channel-web-CcGhVHhJ.js → channel-web-oM8gCehY.js} +1 -1
  100. package/dist/plugin-sdk/command-status.js +1 -1
  101. package/dist/plugin-sdk/index.js +2 -2
  102. package/dist/plugin-sdk/{openresponses-http-BsP7r5IA.js → openresponses-http-C_9IfZXZ.js} +1 -1
  103. package/dist/plugin-sdk/{openresponses-http-C7iy26fS.js → openresponses-http-_SiZJaK2.js} +1 -1
  104. package/dist/plugin-sdk/{pi-model-discovery-runtime-FgSYY3zE.js → pi-model-discovery-runtime-BWcaNxzp.js} +1 -1
  105. package/dist/plugin-sdk/{registry-DyRgZdL8.js → registry-DXXOSq_V.js} +8 -8
  106. package/dist/plugin-sdk/{reply-K26zHCJ7.js → reply-e-9_IdAa.js} +5 -5
  107. package/dist/plugin-sdk/src/brand.d.ts +2 -2
  108. package/dist/plugin-sdk/{status-DUXaf75C.js → status-D_fsW8e3.js} +5 -5
  109. package/dist/plugin-sdk/{web-BnHwbjCb.js → web-BL2TuPTi.js} +1 -1
  110. package/dist/plugin-sdk/{web-BZ-KI_i-.js → web-CaVSiRWI.js} +2 -2
  111. package/dist/{plugins-cli-1wRgk_1k.js → plugins-cli-BMV70lmj.js} +6 -6
  112. package/dist/{plugins-cli-CHCNHfO2.js → plugins-cli-Bf0I1xYR.js} +6 -6
  113. package/dist/{program-BmRPzUoU.js → program-CZzXG3p4.js} +9 -9
  114. package/dist/{program-context-CRYL81pY.js → program-context-CaLlkx1k.js} +25 -25
  115. package/dist/{prompt-select-styled-BzqepcY0.js → prompt-select-styled-Cj_SHqRt.js} +8 -8
  116. package/dist/{prompt-select-styled-Ixt2Vxqr.js → prompt-select-styled-DVwrrZSb.js} +8 -8
  117. package/dist/{prompt-style-Wxki8rmI.js → prompt-style-CWAacuMq.js} +1 -2
  118. package/dist/{prompt-style-DxKPs6E0.js → prompt-style-Rmj3c-Ir.js} +1 -2
  119. package/dist/{providers-cli-DBG7T-38.js → providers-cli-BWZUM8kN.js} +3 -3
  120. package/dist/{providers-cli-DsUpaNkE.js → providers-cli-Dwb_MRo-.js} +3 -3
  121. package/dist/{pw-ai-BWWVm40d.js → pw-ai-D6eWnTeA.js} +1 -1
  122. package/dist/{register.agent-pKJfY4ij.js → register.agent-C-bHdMXU.js} +12 -12
  123. package/dist/{register.agent-D5MjI275.js → register.agent-D0ZpgSNd.js} +11 -11
  124. package/dist/{register.configure-DUqD_hkp.js → register.configure-B0PTAyow.js} +16 -16
  125. package/dist/{register.configure-BtdBEnbT.js → register.configure-B51e7-qt.js} +16 -16
  126. package/dist/{register.maintenance-Bu9WP0d1.js → register.maintenance-B3cXfhM1.js} +12 -12
  127. package/dist/{register.maintenance-CN_vDSkN.js → register.maintenance-BrmIl5VW.js} +13 -13
  128. package/dist/{register.message-Jpj57foO.js → register.message-Dzs1vNKG.js} +4 -4
  129. package/dist/{register.message-Bmx5XWhU.js → register.message-EKaGgJ9I.js} +4 -4
  130. package/dist/{register.onboard-BBdUy5X-.js → register.onboard-BFPT0Hh1.js} +18 -18
  131. package/dist/{register.onboard-BaIUg7j4.js → register.onboard-DmFrOBs4.js} +18 -18
  132. package/dist/{register.setup-CGKrDEMc.js → register.setup-5M8f6DaB.js} +18 -18
  133. package/dist/{register.setup-CxPYg9dc.js → register.setup-B0beU4w3.js} +18 -18
  134. package/dist/{register.status-health-sessions-Dyyxnfsc.js → register.status-health-sessions-9GJwT82K.js} +7 -7
  135. package/dist/{register.status-health-sessions-C0Tc0YCk.js → register.status-health-sessions-CEIpWahs.js} +7 -7
  136. package/dist/{register.subclis-D76pTHAo.js → register.subclis-C3yGp0vO.js} +17 -17
  137. package/dist/{reply-C-KlztgC.js → reply-B034LmuD.js} +12 -8
  138. package/dist/{run-main-REepjMTK.js → run-main-DYdI5qyZ.js} +18 -18
  139. package/dist/{runtime-helper-grants-vtmIYIZm.js → runtime-helper-grants-9-0EfflU.js} +1 -1
  140. package/dist/{runtime-helper-grants-BQPMglLl.js → runtime-helper-grants-BB9I81Ny.js} +1 -1
  141. package/dist/{sandbox-cli-Cj9M5dH_.js → sandbox-cli-Bl9Lyv-l.js} +3 -3
  142. package/dist/{sandbox-cli-DNh-ozSE.js → sandbox-cli-CAh9nzL6.js} +3 -3
  143. package/dist/{security-cli-B74QtPBv.js → security-cli-Bt7g6fbK.js} +4 -4
  144. package/dist/{security-cli--nwf-QKL.js → security-cli-lQy0YwCb.js} +4 -4
  145. package/dist/{server-CPLhmiQ1.js → server-BKrGeOGh.js} +3 -3
  146. package/dist/{server-CdnHL3HN.js → server-CES-5PaV.js} +3 -3
  147. package/dist/{server-cron-Bga__DzU.js → server-cron-D3WgivDk.js} +2 -2
  148. package/dist/{server-cron-9rZPNOCw.js → server-cron-q6O09WWT.js} +2 -2
  149. package/dist/{server-node-events-NE3EvW3K.js → server-node-events-DE5oWSSB.js} +4 -4
  150. package/dist/{server-node-events-CYM7X9Ka.js → server-node-events-Df_2uVcT.js} +4 -4
  151. package/dist/{status-DNSq7M4m.js → status-CdI_oSZ4.js} +1 -1
  152. package/dist/{status-Cbvyhx9d.js → status-CqIzNbBd.js} +1 -1
  153. package/dist/{status-DX0Q8QQg.js → status-DrXKyHMz.js} +4 -4
  154. package/dist/{status-DfxoXWmn.js → status-ne0p_x1W.js} +4 -4
  155. package/dist/{systemd-linger-9E60sw1j.js → systemd-linger-BTw_D-6k.js} +1 -1
  156. package/dist/{systemd-linger-BYFLOJbt.js → systemd-linger-BlmGMvvA.js} +1 -1
  157. package/dist/{tui-BTgZ8oh1.js → tui-CF9NTWgo.js} +1 -1
  158. package/dist/{tui-DCimzH-j.js → tui-CLXEsHbW.js} +1 -1
  159. package/dist/{tui-cli-DJ8WiWCz.js → tui-cli-Bo8T0iEO.js} +4 -4
  160. package/dist/{tui-cli-BzoEecpB.js → tui-cli-DIHJPDjw.js} +4 -4
  161. package/dist/{update-cli-vLZ2i1bC.js → update-cli-RA5GdCSl.js} +13 -13
  162. package/dist/{update-cli-DLE13jlu.js → update-cli-pAvK-b3V.js} +14 -14
  163. package/dist/{update-runner-DA8lIKi7.js → update-runner-CUbpiOBD.js} +1 -1
  164. package/dist/{update-runner-YRzVDxMy.js → update-runner-kVl9uX8I.js} +1 -1
  165. package/dist/{web-CdUefYwV.js → web-BSGV69pb.js} +4 -4
  166. package/dist/{web-D7U7yJI6.js → web-CFtLg8L6.js} +2 -2
  167. package/dist/{web-BqBwrpRI.js → web-CRHqblTb.js} +4 -4
  168. package/dist/{web-gqp_WLnj.js → web-D7NnzaWN.js} +1 -1
  169. package/dist/{web-DgtV30_7.js → web-R6Wrr8ru.js} +1 -1
  170. package/dist/{web-search-providers.runtime-Dr2M7_ZH.js → web-search-providers.runtime-BQw2Sxko.js} +1 -1
  171. package/dist/{web-search-providers.runtime-JauoxBKh.js → web-search-providers.runtime-E9CDTKMh.js} +1 -1
  172. package/docs/gateway/tailscale.md +44 -0
  173. package/docs/images/screenshots/local/chat-ui-1.png +0 -0
  174. package/docs/images/screenshots/local/final-ui-1.png +0 -0
  175. package/docs/images/screenshots/local/local-ui-1.png +0 -0
  176. package/docs/images/screenshots/local/local-ui-2.png +0 -0
  177. package/docs/images/screenshots/local/model-ui-1.png +0 -0
  178. package/docs/images/screenshots/local/wallet-ui-2.png +0 -0
  179. package/docs/install/index.md +26 -5
  180. package/docs/install/installer.md +11 -11
  181. package/docs/install/node.md +9 -0
  182. package/docs/install/vps.md +27 -7
  183. package/docs/security/baseline-checklist.md +7 -2
  184. package/docs/start/agent-wallet-mining-walkthrough.md +17 -1
  185. package/extensions/acpx/package.json +1 -1
  186. package/extensions/bluebubbles/package.json +1 -1
  187. package/extensions/copilot-proxy/package.json +1 -1
  188. package/extensions/diagnostics-otel/package.json +1 -1
  189. package/extensions/discord/package.json +1 -1
  190. package/extensions/fased-federation/package.json +1 -1
  191. package/extensions/feishu/package.json +1 -1
  192. package/extensions/google-gemini-cli-auth/package.json +1 -1
  193. package/extensions/googlechat/package.json +1 -1
  194. package/extensions/imessage/package.json +1 -1
  195. package/extensions/irc/package.json +1 -1
  196. package/extensions/line/package.json +1 -1
  197. package/extensions/llm-task/package.json +1 -1
  198. package/extensions/lobster/package.json +1 -1
  199. package/extensions/matrix/CHANGELOG.md +12 -0
  200. package/extensions/matrix/package.json +1 -1
  201. package/extensions/mattermost/package.json +1 -1
  202. package/extensions/memory-core/package.json +1 -1
  203. package/extensions/memory-lancedb/package.json +1 -1
  204. package/extensions/minimax-portal-auth/package.json +1 -1
  205. package/extensions/msteams/CHANGELOG.md +12 -0
  206. package/extensions/msteams/package.json +1 -1
  207. package/extensions/nextcloud-talk/package.json +1 -1
  208. package/extensions/nostr/CHANGELOG.md +12 -0
  209. package/extensions/nostr/package.json +1 -1
  210. package/extensions/open-prose/package.json +1 -1
  211. package/extensions/sat-mining/package.json +1 -1
  212. package/extensions/signal/package.json +1 -1
  213. package/extensions/slack/package.json +1 -1
  214. package/extensions/synology-chat/package.json +1 -1
  215. package/extensions/telegram/package.json +1 -1
  216. package/extensions/tlon/package.json +1 -1
  217. package/extensions/twitch/CHANGELOG.md +12 -0
  218. package/extensions/twitch/package.json +1 -1
  219. package/extensions/voice-call/CHANGELOG.md +12 -0
  220. package/extensions/voice-call/package.json +1 -1
  221. package/extensions/whatsapp/package.json +1 -1
  222. package/extensions/zalo/CHANGELOG.md +12 -0
  223. package/extensions/zalo/package.json +1 -1
  224. package/extensions/zalouser/CHANGELOG.md +12 -0
  225. package/extensions/zalouser/package.json +1 -1
  226. package/package.json +1 -1
  227. package/scripts/start-managed.sh +2 -2
  228. package/docs/images/screenshots/local/wallet-ui-1.png +0 -0
@@ -1,7 +1,7 @@
1
1
  import { _ as resolveStateDir, u as resolveGatewayPort } from "./paths-C9FmTW1x.js";
2
2
  import { S as resolveUserPath, U as theme } from "./agent-paths-DmOVZE7g.js";
3
3
  import { Ga as ensureAuthProfileStore, Mn as writeConfigFile, Zr as collectConfigServiceEnvVars, d as resolveDefaultAgentId, dd as formatCliCommand, fr as ensureActiveMemoryPluginAllowlisted, kn as readConfigFileSnapshot, u as resolveAgentWorkspaceDir } from "./agent-scope-DHrLr5OF.js";
4
- import { Bt as detectBrowserOpenSupport, Ht as formatControlUiSshHint, Jt as openUrl, Lt as DEFAULT_WORKSPACE, Mo as runFederationAutoConnectOnce, Qo as findTailscaleBinary, Qt as resolveControlUiLinks, Rt as applyWizardMetadata, Vt as ensureWorkspaceAndSessions, Wt as handleOnboardingRepair, Xo as enableTailscaleFunnel, Xt as probeGatewayReachable, Yt as printWizardHeader, Zo as enableTailscaleServe, Zt as randomToken, en as summarizeExistingConfig, nn as waitForGatewayReachable, qt as normalizeGatewayTokenInput, tn as validateGatewayPasswordInput, xo as normalizeControlUiBasePath, yo as CONTROL_UI_BOOT_CHECK_PATH } from "./reply-C-KlztgC.js";
4
+ import { Bt as detectBrowserOpenSupport, Ht as formatControlUiSshHint, Jt as openUrl, Lt as DEFAULT_WORKSPACE, Mo as runFederationAutoConnectOnce, Qo as findTailscaleBinary, Qt as resolveControlUiLinks, Rt as applyWizardMetadata, Vt as ensureWorkspaceAndSessions, Wt as handleOnboardingRepair, Xo as enableTailscaleFunnel, Xt as probeGatewayReachable, Yt as printWizardHeader, Zo as enableTailscaleServe, Zt as randomToken, en as summarizeExistingConfig, nn as waitForGatewayReachable, qt as normalizeGatewayTokenInput, tn as validateGatewayPasswordInput, xo as normalizeControlUiBasePath, yo as CONTROL_UI_BOOT_CHECK_PATH } from "./reply-B034LmuD.js";
5
5
  import { d as defaultRuntime, f as restoreTerminalState, s as redactSensitiveText } from "./errors-Dx3S3Nrp.js";
6
6
  import { a as resolveSignerdBinaryPath, n as installSignerdBinary, o as restartLocalSocketSigner, r as migrateLocalSignerKeystoreToMaterialDir, t as configureWalletForOnboarding } from "./onboarding.wallet-CQG8MiG_.js";
7
7
  import { i as resolveLocalSignerRunAsUser, n as resolveLocalSignerBackendSocketPath, o as resolveLocalSignerSocketPath, r as resolveLocalSignerMaterialRootDir, t as ensureWalletStateDir } from "./wallet-runtime-config-BlRWvEER.js";
@@ -17,14 +17,14 @@ import { a as resolveHostedOnboardingGatewayStartupMode, i as resolveGatewayStar
17
17
  import { d as buildSystemdUnit, r as isSystemdUserServiceAvailable } from "./systemd-CmxDYXvt.js";
18
18
  import { t as resolveGatewayService } from "./service-Bsg622jp.js";
19
19
  import { n as auditGatewayServiceConfig, t as SERVICE_AUDIT_CODES } from "./service-audit-BRLbvcxT.js";
20
- import { a as promptRemoteGatewayConfig, n as getTailscaleMissingBinNoteLines, r as setupSkills, t as validateIPv4AddressInput, u as promptCustomApiConfig } from "./ipv4-oR6PCFkE.js";
21
- import { o as waitForHostedDashboardBrowserPath } from "./health-DkKBhl0x.js";
22
- import { n as warnIfModelConfigLooksOff, r as applyAuthChoice } from "./auth-choice-DSs5l1Mv.js";
23
- import { t as promptAuthChoiceGrouped } from "./auth-choice-prompt-Dhl403zz.js";
20
+ import { a as promptRemoteGatewayConfig, n as getTailscaleMissingBinNoteLines, r as setupSkills, t as validateIPv4AddressInput, u as promptCustomApiConfig } from "./ipv4-B42xQEbV.js";
21
+ import { o as waitForHostedDashboardBrowserPath } from "./health-kF4U3o3b.js";
22
+ import { n as warnIfModelConfigLooksOff, r as applyAuthChoice } from "./auth-choice-DRyuJ7OL.js";
23
+ import { t as promptAuthChoiceGrouped } from "./auth-choice-prompt-EOHB6Adp.js";
24
24
  import { n as logConfigUpdated } from "./logging-Dv2wthF_.js";
25
- import { n as setupChannels } from "./onboard-channels-Di1MifgF.js";
25
+ import { n as setupChannels } from "./onboard-channels-ZnUGKi2j.js";
26
26
  import { t as buildWorkspaceHookStatus } from "./hooks-status-BielXMUB.js";
27
- import { t as runTui } from "./tui-BTgZ8oh1.js";
27
+ import { t as runTui } from "./tui-CF9NTWgo.js";
28
28
  import fs from "node:fs";
29
29
  import os from "node:os";
30
30
  import path from "node:path";
@@ -169,7 +169,7 @@ function isHostedSecurityCapableSession(explicitFlag = false) {
169
169
  const sudoersPath = path.join("/etc/sudoers.d", `fased-host-maintenance-${currentUser}`);
170
170
  if (fs.existsSync(sudoersPath)) return true;
171
171
  }
172
- return canRunHostedMaintenanceCommand("sudo -n tailscale status >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n ufw status >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n firewall-cmd --state >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n systemctl is-active --quiet firewalld >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n systemctl status fased-gateway.service >/dev/null 2>&1");
172
+ return canRunHostedMaintenanceCommand("sudo -n /usr/local/sbin/fased-host-maintenance tailscale-status >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n /usr/local/sbin/fased-host-maintenance tailnet-ssh-ingress >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n /usr/local/sbin/fased-host-maintenance firewall-baseline >/dev/null 2>&1") || canRunHostedMaintenanceCommand("sudo -n systemctl status fased-gateway.service >/dev/null 2>&1");
173
173
  }
174
174
 
175
175
  //#endregion
@@ -547,16 +547,18 @@ async function installRootServiceMaintenanceAccess(params) {
547
547
  const sudoers = [
548
548
  `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl restart ${safeServiceName}.service`,
549
549
  `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl restart --no-block ${safeServiceName}.service`,
550
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl start --no-block ${safeServiceName}.service`,
551
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl enable --now ${safeServiceName}.service`,
550
552
  `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl status ${safeServiceName}.service`,
551
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl status ${safeServiceName}.service *`,
552
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl status ${safeServiceName} *`,
553
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl status ${safeServiceName}.service --no-pager`,
553
554
  `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl is-active ${safeServiceName}.service`,
554
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl is-active ${safeServiceName}.service *`,
555
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl is-active ${safeServiceName} *`,
556
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl show ${safeServiceName}.service *`,
557
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl show ${safeServiceName} *`,
558
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName}.service *`,
559
- `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName} *`
555
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl is-active ${safeServiceName}`,
556
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl show ${safeServiceName}.service -p ActiveState --value`,
557
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/systemctl cat ${safeServiceName}.service`,
558
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName}.service -n 50 --no-pager`,
559
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName}.service -n 120 --no-pager`,
560
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName} -n 50 --no-pager`,
561
+ `${safeUser} ALL=(root) NOPASSWD: /usr/bin/journalctl -u ${safeServiceName} -n 120 --no-pager`
560
562
  ].join("\n");
561
563
  return await runShell([
562
564
  `echo '${Buffer.from(`${sudoers}\n`, "utf8").toString("base64")}' | base64 -d | sudo -n tee '${sudoersPath}' >/dev/null`,
@@ -1358,7 +1360,7 @@ async function finalizeOnboardingWizard(options) {
1358
1360
  const systemdAvailable = process.platform === "linux" ? await isSystemdUserServiceAvailable() : true;
1359
1361
  if (process.platform === "linux" && !systemdAvailable && !strictVps && flow !== "quickstart") await prompter.note("Systemd user services are unavailable. Skipping lingering checks and user-service install.", "Systemd");
1360
1362
  if (process.platform === "linux" && systemdAvailable && strictVps) {} else if (process.platform === "linux" && systemdAvailable) {
1361
- const { ensureSystemdUserLingerInteractive } = await import("./systemd-linger-9E60sw1j.js").then((n) => n.r);
1363
+ const { ensureSystemdUserLingerInteractive } = await import("./systemd-linger-BTw_D-6k.js").then((n) => n.r);
1362
1364
  await ensureSystemdUserLingerInteractive({
1363
1365
  runtime,
1364
1366
  prompter: {
@@ -2463,7 +2465,7 @@ async function finalizeOnboardingWizard(options) {
2463
2465
  fallbackHint: !strictVps ? controlUiOpenHint : void 0
2464
2466
  }), "Dashboard ready");
2465
2467
  }
2466
- await prompter.outro(strictVps ? "Setup complete. Use HOSTED ACCESS above: Web UI, SSH, or fallback tunnel." : controlUiOpened ? "Setup complete. Next: Agent > Models, then Chat." : "Setup complete. Use the dashboard link above, then use Agent > Models and Chat.");
2468
+ if (!strictVps) await prompter.outro(controlUiOpened ? "Setup complete. Next: Agent > Models, then Chat." : "Setup complete. Use the dashboard link above, then use Agent > Models and Chat.");
2467
2469
  return { launchedTui };
2468
2470
  }
2469
2471
 
@@ -2747,6 +2749,8 @@ const LOW_MEMORY_SWAP_THRESHOLD_MB = 2304;
2747
2749
  const LOW_MEMORY_HOSTING_SWAP_GB = 4;
2748
2750
  const HOSTING_SWAP_GB = 2;
2749
2751
  const TAILSCALE_INTERACTIVE_TIMEOUT_MS = 120 * 1e3;
2752
+ const TAILSCALE_LOGIN_URL_RE = /https:\/\/login\.tailscale\.com\/a\/[A-Za-z0-9_-]+/i;
2753
+ const HOST_MAINTENANCE_HELPER = "/usr/local/sbin/fased-host-maintenance";
2750
2754
  function detectTotalMemoryMb() {
2751
2755
  if (process.platform === "linux") try {
2752
2756
  const match = fs.readFileSync("/proc/meminfo", "utf8").match(/^MemTotal:\s+(\d+)\s+kB/m);
@@ -2779,29 +2783,67 @@ function run(command, logPath) {
2779
2783
  detail: detail || `${command} (exit=${proc.status ?? "unknown"})`
2780
2784
  };
2781
2785
  }
2782
- function runInteractive(command, logPath, options) {
2783
- if (logPath) appendHostSecurityLog(logPath, command, "interactive command started; output shown in terminal");
2784
- const proc = spawnSync("bash", ["-lc", command], {
2785
- stdio: [
2786
+ async function runInteractive(command, logPath, options) {
2787
+ if (logPath) appendHostSecurityLog(logPath, command, "interactive command started; output captured for framed wizard display");
2788
+ return await new Promise((resolve) => {
2789
+ const proc = spawn("bash", ["-lc", command], { stdio: [
2786
2790
  "ignore",
2787
- "inherit",
2788
- "inherit"
2789
- ],
2790
- timeout: options?.timeoutMs,
2791
- killSignal: "SIGINT"
2791
+ "pipe",
2792
+ "pipe"
2793
+ ] });
2794
+ let output = "";
2795
+ let loginUrlShown = false;
2796
+ let timedOut = false;
2797
+ let noteQueue = Promise.resolve();
2798
+ const timer = options?.timeoutMs && options.timeoutMs > 0 ? setTimeout(() => {
2799
+ timedOut = true;
2800
+ proc.kill("SIGINT");
2801
+ }, options.timeoutMs) : null;
2802
+ const maybeShowLoginUrl = (chunk) => {
2803
+ output += chunk;
2804
+ if (loginUrlShown) return;
2805
+ const loginUrl = output.match(TAILSCALE_LOGIN_URL_RE)?.[0];
2806
+ if (!loginUrl) return;
2807
+ loginUrlShown = true;
2808
+ if (options?.prompter) {
2809
+ const message = [
2810
+ noteHeading("Open login URL"),
2811
+ "Open this URL in your local browser:",
2812
+ ...noteCommands([loginUrl]),
2813
+ "Return here after approving this VPS."
2814
+ ].join("\n");
2815
+ noteQueue = noteQueue.then(() => options.prompter?.note(message, options.noteTitle ?? "Tailscale login URL"));
2816
+ }
2817
+ };
2818
+ proc.stdout?.on("data", (chunk) => {
2819
+ maybeShowLoginUrl(String(chunk));
2820
+ });
2821
+ proc.stderr?.on("data", (chunk) => {
2822
+ maybeShowLoginUrl(String(chunk));
2823
+ });
2824
+ proc.on("error", (error) => {
2825
+ output += `\n${error instanceof Error ? error.message : String(error)}`;
2826
+ });
2827
+ proc.on("close", (code) => {
2828
+ if (timer) clearTimeout(timer);
2829
+ const detail = timedOut ? `${command} timed out after ${Math.round((options?.timeoutMs ?? 0) / 1e3)}s\n${output}`.trim() : `${command} (exit=${code ?? "unknown"})\n${output}`.trim();
2830
+ if (logPath) appendHostSecurityLog(logPath, command, detail);
2831
+ noteQueue.then(() => {
2832
+ if (code === 0) {
2833
+ resolve({
2834
+ ok: true,
2835
+ detail
2836
+ });
2837
+ return;
2838
+ }
2839
+ resolve({
2840
+ ok: false,
2841
+ detail,
2842
+ timedOut
2843
+ });
2844
+ });
2845
+ });
2792
2846
  });
2793
- const timedOut = proc.error?.code === "ETIMEDOUT";
2794
- const detail = timedOut ? `${command} timed out after ${Math.round((options?.timeoutMs ?? 0) / 1e3)}s` : `${command} (exit=${proc.status ?? "unknown"})`;
2795
- if (logPath) appendHostSecurityLog(logPath, command, detail);
2796
- if (proc.status === 0) return {
2797
- ok: true,
2798
- detail
2799
- };
2800
- return {
2801
- ok: false,
2802
- detail,
2803
- timedOut
2804
- };
2805
2847
  }
2806
2848
  function buildTailscaleLoginWaitCommand(command) {
2807
2849
  return [
@@ -2809,7 +2851,7 @@ function buildTailscaleLoginWaitCommand(command) {
2809
2851
  `bash -lc ${shellQuote(command)} &`,
2810
2852
  "ts_pid=$!",
2811
2853
  "for _ in $(seq 1 55); do",
2812
- " if tailscale ip -4 >/dev/null 2>&1 || sudo -n tailscale ip -4 >/dev/null 2>&1; then",
2854
+ ` if tailscale ip -4 >/dev/null 2>&1 || ${hostMaintenanceCommand("tailscale-ip4")} >/dev/null 2>&1 || sudo -n tailscale ip -4 >/dev/null 2>&1; then`,
2813
2855
  " kill -INT \"$ts_pid\" >/dev/null 2>&1 || true",
2814
2856
  " wait \"$ts_pid\" >/dev/null 2>&1 || true",
2815
2857
  " exit 0",
@@ -2822,15 +2864,19 @@ function buildTailscaleLoginWaitCommand(command) {
2822
2864
  "done",
2823
2865
  "kill -INT \"$ts_pid\" >/dev/null 2>&1 || true",
2824
2866
  "wait \"$ts_pid\" >/dev/null 2>&1 || true",
2825
- "if tailscale ip -4 >/dev/null 2>&1 || sudo -n tailscale ip -4 >/dev/null 2>&1; then",
2867
+ `if tailscale ip -4 >/dev/null 2>&1 || ${hostMaintenanceCommand("tailscale-ip4")} >/dev/null 2>&1 || sudo -n tailscale ip -4 >/dev/null 2>&1; then`,
2826
2868
  " exit 0",
2827
2869
  "fi",
2828
2870
  "exit 124"
2829
2871
  ].join("\n");
2830
2872
  }
2831
- function runInteractiveTailscaleLogin(command, logPath) {
2832
- if (logPath) appendHostSecurityLog(logPath, command, "interactive Tailscale login started; output shown in terminal");
2833
- const result = runInteractive(buildTailscaleLoginWaitCommand(command), void 0, { timeoutMs: TAILSCALE_INTERACTIVE_TIMEOUT_MS });
2873
+ async function runInteractiveTailscaleLogin(command, logPath, prompter) {
2874
+ if (logPath) appendHostSecurityLog(logPath, command, "interactive Tailscale login started; login URL shown in framed wizard note");
2875
+ const result = await runInteractive(buildTailscaleLoginWaitCommand(command), void 0, {
2876
+ timeoutMs: TAILSCALE_INTERACTIVE_TIMEOUT_MS,
2877
+ prompter,
2878
+ noteTitle: "Tailscale login URL"
2879
+ });
2834
2880
  if (logPath) appendHostSecurityLog(logPath, "tailscale login result", result.ok ? "tailnet IP appeared or tailscale up completed" : result.detail ?? "tailscale login failed");
2835
2881
  if (result.ok) return {
2836
2882
  ok: true,
@@ -2871,21 +2917,29 @@ function tailscaleTimedOutButReady(result, logPath, runner = run) {
2871
2917
  function shellQuote(value) {
2872
2918
  return `'${value.replace(/'/g, "'\\''")}'`;
2873
2919
  }
2920
+ function hostMaintenanceCommand(action) {
2921
+ return `sudo -n ${HOST_MAINTENANCE_HELPER} ${action}`;
2922
+ }
2923
+ function hostMaintenanceCommandWithInput(action, input) {
2924
+ return `printf '%s\\n' ${shellQuote(input)} | ${hostMaintenanceCommand(action)}`;
2925
+ }
2874
2926
  function isTailscaleLoggedIn(logPath, runner = run) {
2875
- return runner("tailscale status >/dev/null 2>&1", logPath).ok || runner("sudo -n tailscale status >/dev/null 2>&1", logPath).ok;
2927
+ return runner("tailscale status >/dev/null 2>&1", logPath).ok || runner(`${hostMaintenanceCommand("tailscale-status")} >/dev/null 2>&1`, logPath).ok || runner("sudo -n tailscale status >/dev/null 2>&1", logPath).ok;
2876
2928
  }
2877
2929
  function hasTailscaleIp(logPath, runner = run) {
2878
- return runner("tailscale ip -4 >/dev/null 2>&1", logPath).ok || runner("sudo -n tailscale ip -4 >/dev/null 2>&1", logPath).ok;
2930
+ return runner("tailscale ip -4 >/dev/null 2>&1", logPath).ok || runner(`${hostMaintenanceCommand("tailscale-ip4")} >/dev/null 2>&1`, logPath).ok || runner("sudo -n tailscale ip -4 >/dev/null 2>&1", logPath).ok;
2879
2931
  }
2880
2932
  function readTailscaleIp(logPath, runner = run) {
2881
2933
  const probe = runner("tailscale ip -4", logPath);
2882
- const sudoProbe = probe.ok ? probe : runner("sudo -n tailscale ip -4", logPath);
2934
+ const helperProbe = probe.ok ? probe : runner(hostMaintenanceCommand("tailscale-ip4"), logPath);
2935
+ const sudoProbe = helperProbe.ok ? helperProbe : runner("sudo -n tailscale ip -4", logPath);
2883
2936
  if (!sudoProbe.ok || !sudoProbe.detail) return;
2884
2937
  return sudoProbe.detail.match(/\b\d{1,3}(?:\.\d{1,3}){3}\b/)?.[0];
2885
2938
  }
2886
2939
  function readTailscaleSelf(logPath, runner = run) {
2887
2940
  const probe = runner("tailscale status --json", logPath);
2888
- const sudoProbe = probe.ok ? probe : runner("sudo -n tailscale status --json", logPath);
2941
+ const helperProbe = probe.ok ? probe : runner(hostMaintenanceCommand("tailscale-status-json"), logPath);
2942
+ const sudoProbe = helperProbe.ok ? helperProbe : runner("sudo -n tailscale status --json", logPath);
2889
2943
  if (!sudoProbe.ok || !sudoProbe.detail) return { ipv4: readTailscaleIp(logPath, runner) };
2890
2944
  try {
2891
2945
  const parsed = JSON.parse(sudoProbe.detail);
@@ -2991,7 +3045,8 @@ function verifyTailnetSshServerPrerequisites(params) {
2991
3045
  };
2992
3046
  }
2993
3047
  function ensureTailnetSshIngressForVerification(params) {
2994
- const result = (params.runner ?? run)([
3048
+ const runner = params.runner ?? run;
3049
+ const command = [
2995
3050
  "if command -v ufw >/dev/null 2>&1; then",
2996
3051
  " if sudo -n ufw status | grep -qi '^Status: active'; then",
2997
3052
  " sudo -n ufw insert 1 allow in on tailscale0 to any port 22 proto tcp || sudo -n ufw allow in on tailscale0 to any port 22 proto tcp",
@@ -3002,7 +3057,9 @@ function ensureTailnetSshIngressForVerification(params) {
3002
3057
  " sudo -n firewall-cmd --permanent --zone=trusted --add-interface=tailscale0 >/dev/null 2>&1 || true",
3003
3058
  " sudo -n firewall-cmd --reload >/dev/null 2>&1 || true",
3004
3059
  "fi"
3005
- ].join("\n"), params.logPath);
3060
+ ].join("\n");
3061
+ const helperResult = runner(hostMaintenanceCommand("tailnet-ssh-ingress"), params.logPath);
3062
+ const result = helperResult.ok ? helperResult : runner(command, params.logPath);
3006
3063
  if (!result.ok) return {
3007
3064
  ok: false,
3008
3065
  detail: result.detail ?? "could not prepare tailnet SSH firewall rule before verification"
@@ -3089,7 +3146,7 @@ async function confirmTailnetSshBeforeLockdown(params) {
3089
3146
  return false;
3090
3147
  }
3091
3148
  await prompter.note(formatTailscaleAccountBrowserLoginNote(), "Tailscale login");
3092
- const tsReset = interactiveRunner("sudo -n tailscale logout && sudo -n tailscale up --ssh --accept-routes --reset", logPath);
3149
+ const tsReset = await interactiveRunner(hostMaintenanceCommand("tailscale-up-reset-ssh"), logPath, prompter);
3093
3150
  const acceptedTimedOutLogin = tailscaleTimedOutButReady(tsReset, logPath, runner);
3094
3151
  if (!tsReset.ok && !acceptedTimedOutLogin || !hasTailscaleIp(logPath, runner)) {
3095
3152
  runtime.error("Hosting setup stopped before SSH/firewall lock-down.");
@@ -3133,9 +3190,9 @@ function ensureTailscaleServe(port, logPath) {
3133
3190
  ok: true,
3134
3191
  detail: `tailscale serve --bg -> 127.0.0.1:${port}`
3135
3192
  };
3136
- if (run(`sudo -n tailscale serve --bg http://127.0.0.1:${port}`, logPath).ok) return {
3193
+ if (run(hostMaintenanceCommandWithInput("tailscale-serve", String(port)), logPath).ok) return {
3137
3194
  ok: true,
3138
- detail: `sudo tailscale serve --bg -> 127.0.0.1:${port}`
3195
+ detail: `host maintenance tailscale serve -> 127.0.0.1:${port}`
3139
3196
  };
3140
3197
  if (run(`tailscale serve https / http://127.0.0.1:${port}`, logPath).ok) return {
3141
3198
  ok: true,
@@ -3159,7 +3216,7 @@ function isTailscaleServeReady(port) {
3159
3216
  ],
3160
3217
  encoding: "utf8"
3161
3218
  });
3162
- if ((probe.status ?? 1) !== 0) probe = spawnSync("bash", ["-lc", "sudo -n tailscale serve status"], {
3219
+ if ((probe.status ?? 1) !== 0) probe = spawnSync("bash", ["-lc", hostMaintenanceCommand("tailscale-serve-status")], {
3163
3220
  stdio: [
3164
3221
  "ignore",
3165
3222
  "pipe",
@@ -3192,6 +3249,7 @@ function packageInstallCommand(packages) {
3192
3249
  }
3193
3250
  function tailscaleInstallCommand() {
3194
3251
  return [
3252
+ `${hostMaintenanceCommand("tailscale-install-start")} && exit 0`,
3195
3253
  "if command -v tailscale >/dev/null 2>&1; then",
3196
3254
  " :",
3197
3255
  "elif command -v apt-get >/dev/null 2>&1; then",
@@ -3217,6 +3275,7 @@ function tailscaleInstallCommand() {
3217
3275
  }
3218
3276
  function firewallBaselineCommand() {
3219
3277
  return [
3278
+ `${hostMaintenanceCommand("firewall-baseline")} && exit 0`,
3220
3279
  "if command -v ufw >/dev/null 2>&1 || command -v apt-get >/dev/null 2>&1; then",
3221
3280
  " command -v ufw >/dev/null 2>&1 || { " + packageInstallCommand(["ufw"]) + "; }",
3222
3281
  " sudo -n ufw default deny incoming",
@@ -3240,13 +3299,14 @@ function firewallBaselineCommand() {
3240
3299
  }
3241
3300
  function automaticUpdatesCommand() {
3242
3301
  return [
3302
+ `${hostMaintenanceCommand("automatic-updates")} && exit 0`,
3243
3303
  "if command -v apt-get >/dev/null 2>&1; then",
3244
3304
  " " + packageInstallCommand(["unattended-upgrades"]),
3245
3305
  " sudo -n systemctl enable --now unattended-upgrades >/dev/null 2>&1 || true",
3246
3306
  " sudo -n systemctl enable --now apt-daily.timer apt-daily-upgrade.timer",
3247
3307
  "elif command -v dnf >/dev/null 2>&1 || command -v dnf5 >/dev/null 2>&1; then",
3248
3308
  " (" + packageInstallCommand(["dnf5-plugin-automatic"]) + ") || (" + packageInstallCommand(["dnf-automatic"]) + ")",
3249
- " sudo -n sed -i 's/^apply_updates[[:space:]]*=.*/apply_updates = yes/' /etc/dnf/automatic.conf >/dev/null 2>&1 || true",
3309
+ " sudo -n /usr/local/sbin/fased-host-maintenance enable-dnf-automatic >/dev/null 2>&1 || sudo -n sed -i 's/^apply_updates[[:space:]]*=.*/apply_updates = yes/' /etc/dnf/automatic.conf >/dev/null 2>&1 || true",
3250
3310
  " sudo -n systemctl enable --now dnf5-automatic.timer >/dev/null 2>&1 || sudo -n systemctl enable --now dnf-automatic.timer",
3251
3311
  "elif command -v yum >/dev/null 2>&1; then",
3252
3312
  " (" + packageInstallCommand(["dnf-automatic"]) + ") || (" + packageInstallCommand(["yum-cron"]) + ")",
@@ -3257,6 +3317,9 @@ function automaticUpdatesCommand() {
3257
3317
  "fi"
3258
3318
  ].join("\n");
3259
3319
  }
3320
+ function sshHardeningCommand() {
3321
+ return hostMaintenanceCommand("harden-ssh");
3322
+ }
3260
3323
  function failOrContinue(params) {
3261
3324
  const { opts, runtime, step, detail } = params;
3262
3325
  const body = detail ? `${step}: ${detail}` : step;
@@ -3301,8 +3364,8 @@ async function applyHostingSecurity(params) {
3301
3364
  validate: (value) => value.trim() ? void 0 : "Required"
3302
3365
  })).trim();
3303
3366
  else await prompter.note(formatTailscaleBrowserLoginNote(), "Tailscale login");
3304
- const resetCommand = tsAuthkey ? `sudo -n tailscale logout && sudo -n tailscale up --ssh --accept-routes --reset --authkey ${JSON.stringify(tsAuthkey)}` : "sudo -n tailscale logout && sudo -n tailscale up --ssh --accept-routes --reset";
3305
- const tsReset = tsAuthkey ? run(resetCommand, logPath) : runInteractiveTailscaleLogin(resetCommand, logPath);
3367
+ const resetCommand = tsAuthkey ? hostMaintenanceCommandWithInput("tailscale-up-reset-authkey-ssh", tsAuthkey) : hostMaintenanceCommand("tailscale-up-reset-ssh");
3368
+ const tsReset = tsAuthkey ? run(resetCommand, logPath) : await runInteractiveTailscaleLogin(resetCommand, logPath, prompter);
3306
3369
  if (!tsReset.ok && !tailscaleTimedOutButReady(tsReset, logPath)) return {
3307
3370
  ok: false,
3308
3371
  detail: tsReset.detail ?? "tailscale account switch failed"
@@ -3425,7 +3488,7 @@ async function applyHostingSecurity(params) {
3425
3488
  logPath
3426
3489
  };
3427
3490
  }
3428
- } else if (hasCommand("systemctl")) run("sudo -n systemctl enable --now tailscaled >/dev/null 2>&1 || true", logPath);
3491
+ } else if (hasCommand("systemctl")) run(`${hostMaintenanceCommand("tailscale-install-start")} >/dev/null 2>&1 || sudo -n systemctl enable --now tailscaled >/dev/null 2>&1 || true`, logPath);
3429
3492
  if (prompter && opts.nonInteractive !== true) await prompter.note(formatLocalDeviceTailnetRequirementNote(), "Local device requirement");
3430
3493
  let tsHealthy = isTailscaleLoggedIn(logPath);
3431
3494
  if (tsHealthy && prompter && opts.nonInteractive !== true) {
@@ -3434,7 +3497,7 @@ async function applyHostingSecurity(params) {
3434
3497
  initialValue: false
3435
3498
  })) {
3436
3499
  if (prompter) await prompter.note(formatTailscaleBrowserLoginNote(), "Tailscale login");
3437
- const tsReset = runInteractiveTailscaleLogin("sudo -n tailscale logout && sudo -n tailscale up --ssh --accept-routes --reset", logPath);
3500
+ const tsReset = await runInteractiveTailscaleLogin(hostMaintenanceCommand("tailscale-up-reset-ssh"), logPath, prompter);
3438
3501
  if (!tsReset.ok && !tailscaleTimedOutButReady(tsReset, logPath)) {
3439
3502
  checks.push({
3440
3503
  name: "tailscale",
@@ -3477,7 +3540,7 @@ async function applyHostingSecurity(params) {
3477
3540
  })).trim();
3478
3541
  }
3479
3542
  if (tsAuthkey) {
3480
- const tsUp = run(`sudo -n tailscale up --authkey ${JSON.stringify(tsAuthkey)} --ssh`, logPath);
3543
+ const tsUp = run(hostMaintenanceCommandWithInput("tailscale-up-authkey-ssh", tsAuthkey), logPath);
3481
3544
  if (!tsUp.ok) {
3482
3545
  checks.push({
3483
3546
  name: "tailscale",
@@ -3521,7 +3584,7 @@ async function applyHostingSecurity(params) {
3521
3584
  };
3522
3585
  } else {
3523
3586
  if (prompter) await prompter.note(formatTailscaleBrowserLoginNote(), "Tailscale login");
3524
- const tsUp = runInteractiveTailscaleLogin("sudo -n tailscale up --ssh", logPath);
3587
+ const tsUp = await runInteractiveTailscaleLogin(hostMaintenanceCommand("tailscale-up-ssh"), logPath, prompter);
3525
3588
  if (!tsUp.ok && !tailscaleTimedOutButReady(tsUp, logPath)) {
3526
3589
  checks.push({
3527
3590
  name: "tailscale",
@@ -3576,7 +3639,7 @@ async function applyHostingSecurity(params) {
3576
3639
  detail: "tailnet IP present; verifying app SSH before lock-down"
3577
3640
  });
3578
3641
  const operatorUser = run("id -u app >/dev/null 2>&1", logPath).ok ? "app" : process.env.SUDO_USER?.trim() || process.env.USER?.trim() || process.env.LOGNAME?.trim();
3579
- if (operatorUser) run(`sudo -n tailscale set --operator='${operatorUser}' >/dev/null 2>&1 || true`, logPath);
3642
+ if (operatorUser) run(`${hostMaintenanceCommand("tailscale-set-operator-self")} >/dev/null 2>&1 || true`, logPath);
3580
3643
  if (!await confirmTailnetSshBeforeLockdown({
3581
3644
  opts,
3582
3645
  runtime,
@@ -3648,7 +3711,7 @@ async function applyHostingSecurity(params) {
3648
3711
  ok: true,
3649
3712
  detail: "default-deny public ingress with tailnet SSH/HTTPS access"
3650
3713
  });
3651
- const sshRes = run("sudo -n sed -i 's/^#\\?PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config; sudo -n sed -i 's/^#\\?PermitRootLogin .*/PermitRootLogin no/' /etc/ssh/sshd_config; sudo -n systemctl restart ssh || sudo -n systemctl restart sshd", logPath);
3714
+ const sshRes = run(sshHardeningCommand(), logPath);
3652
3715
  if (!sshRes.ok) {
3653
3716
  checks.push({
3654
3717
  name: "ssh",
@@ -3673,7 +3736,7 @@ async function applyHostingSecurity(params) {
3673
3736
  ok: true,
3674
3737
  detail: "password auth/root login disabled and ssh restarted"
3675
3738
  });
3676
- const f2bRes = runHostSetupCommand(`${packageInstallCommand(["fail2ban"])}\nsudo -n systemctl enable --now fail2ban`);
3739
+ const f2bRes = runHostSetupCommand(`${hostMaintenanceCommand("fail2ban-enable")} || (${packageInstallCommand(["fail2ban"])}\nsudo -n systemctl enable --now fail2ban)`);
3677
3740
  if (!f2bRes.ok) {
3678
3741
  checks.push({
3679
3742
  name: "fail2ban",
@@ -3723,7 +3786,7 @@ async function applyHostingSecurity(params) {
3723
3786
  ok: true,
3724
3787
  detail: "automatic security updates enabled"
3725
3788
  });
3726
- runtime.log("Hosting host hardening complete.");
3789
+ appendHostSecurityLog(logPath, "hosting host hardening complete", "enforced");
3727
3790
  return {
3728
3791
  profile,
3729
3792
  checks,
@@ -2,7 +2,7 @@ import { Ui as logWarn, wa as defaultRuntime } from "./agent-scope-Cb1u7HE7.js";
2
2
  import "./github-copilot-token-DYrFvncE.js";
3
3
  import "./send-vR6HwT94.js";
4
4
  import "./send-BQMxv218.js";
5
- import { $ as emitAgentEvent, B as DEFAULT_INPUT_IMAGE_MIMES, G as normalizeMimeList, H as DEFAULT_INPUT_TIMEOUT_MS, K as resolveInputFileLimits, U as extractFileContentFromSource, V as DEFAULT_INPUT_MAX_REDIRECTS, W as extractImageContentFromSource, a as agentCommand, at as setSseHeaders, et as onAgentEvent, i as resolveAssistantStreamDeltaText, it as sendJson, n as handleGatewayPostJsonEndpoint, nt as resolveAgentIdForRequest, ot as writeDone, r as buildAgentMessageFromConversationEntries, rt as resolveSessionKey, tt as createDefaultDeps, z as DEFAULT_INPUT_IMAGE_MAX_BYTES } from "./pi-embedded-IQzv6URS.js";
5
+ import { $ as emitAgentEvent, B as DEFAULT_INPUT_IMAGE_MIMES, G as normalizeMimeList, H as DEFAULT_INPUT_TIMEOUT_MS, K as resolveInputFileLimits, U as extractFileContentFromSource, V as DEFAULT_INPUT_MAX_REDIRECTS, W as extractImageContentFromSource, a as agentCommand, at as setSseHeaders, et as onAgentEvent, i as resolveAssistantStreamDeltaText, it as sendJson, n as handleGatewayPostJsonEndpoint, nt as resolveAgentIdForRequest, ot as writeDone, r as buildAgentMessageFromConversationEntries, rt as resolveSessionKey, tt as createDefaultDeps, z as DEFAULT_INPUT_IMAGE_MAX_BYTES } from "./pi-embedded-Bnuo5tPq.js";
6
6
  import "./diagnostic-D6XQAXl4.js";
7
7
  import "./diagnostic-session-state-CexmAKza.js";
8
8
  import "./send-Da1hCe1A.js";
@@ -2,14 +2,14 @@ import { Sa as defaultRuntime, Vi as logWarn } from "./agent-scope-DUKEZjqM.js";
2
2
  import "./github-copilot-token-CNsqwfnE.js";
3
3
  import "./send-CFSRf7De.js";
4
4
  import "./send-gtmn6YeH.js";
5
- import { B as DEFAULT_INPUT_IMAGE_MIMES, G as normalizeMimeList, H as DEFAULT_INPUT_TIMEOUT_MS, K as resolveInputFileLimits, U as extractFileContentFromSource, V as DEFAULT_INPUT_MAX_REDIRECTS, W as extractImageContentFromSource, a as agentCommand, at as sendJson, et as emitAgentEvent, i as resolveAssistantStreamDeltaText, it as resolveSessionKey, n as handleGatewayPostJsonEndpoint, nt as createDefaultDeps, ot as setSseHeaders, r as buildAgentMessageFromConversationEntries, rt as resolveAgentIdForRequest, st as writeDone, tt as onAgentEvent, z as DEFAULT_INPUT_IMAGE_MAX_BYTES } from "./pi-embedded-BS0sTNPV.js";
5
+ import { B as DEFAULT_INPUT_IMAGE_MIMES, G as normalizeMimeList, H as DEFAULT_INPUT_TIMEOUT_MS, K as resolveInputFileLimits, U as extractFileContentFromSource, V as DEFAULT_INPUT_MAX_REDIRECTS, W as extractImageContentFromSource, a as agentCommand, at as sendJson, et as emitAgentEvent, i as resolveAssistantStreamDeltaText, it as resolveSessionKey, n as handleGatewayPostJsonEndpoint, nt as createDefaultDeps, ot as setSseHeaders, r as buildAgentMessageFromConversationEntries, rt as resolveAgentIdForRequest, st as writeDone, tt as onAgentEvent, z as DEFAULT_INPUT_IMAGE_MAX_BYTES } from "./pi-embedded-CeuBUTjd.js";
6
6
  import "./reply-prefix-Bitnsmpd.js";
7
7
  import "./diagnostic-_BiQ6GgD.js";
8
8
  import "./diagnostic-session-state-CL_QxyRg.js";
9
9
  import "./send-C3B8eaL_.js";
10
10
  import "./media-B1OiuFFn.js";
11
11
  import "./pi-model-discovery-DsJSYjlQ.js";
12
- import "./paths-DuymR5Rg.js";
12
+ import "./paths-Bzz-O3FX.js";
13
13
  import "./ssrf-9SwDSKOO.js";
14
14
  import "./path-alias-guards-B_y00xGw.js";
15
15
  import "./fs-safe-SqvX3xVH.js";
@@ -1,6 +1,6 @@
1
1
  import "./github-copilot-token-Dy7Y_jbI.js";
2
2
  import { la as logWarn, qo as defaultRuntime } from "./paths-OUJyk-5R.js";
3
- import { B as extractImageContentFromSource, F as DEFAULT_INPUT_IMAGE_MAX_BYTES, H as resolveInputFileLimits, I as DEFAULT_INPUT_IMAGE_MIMES, L as DEFAULT_INPUT_MAX_REDIRECTS, R as DEFAULT_INPUT_TIMEOUT_MS, V as normalizeMimeList, X as emitAgentEvent, Z as onAgentEvent, a as agentCommand, at as sendJson, i as resolveAssistantStreamDeltaText, it as resolveSessionKey, n as handleGatewayPostJsonEndpoint, nt as createDefaultDeps, ot as setSseHeaders, r as buildAgentMessageFromConversationEntries, rt as resolveAgentIdForRequest, st as writeDone, z as extractFileContentFromSource } from "./auth-DtTjcdsn.js";
3
+ import { B as extractImageContentFromSource, F as DEFAULT_INPUT_IMAGE_MAX_BYTES, H as resolveInputFileLimits, I as DEFAULT_INPUT_IMAGE_MIMES, L as DEFAULT_INPUT_MAX_REDIRECTS, R as DEFAULT_INPUT_TIMEOUT_MS, V as normalizeMimeList, X as emitAgentEvent, Z as onAgentEvent, a as agentCommand, at as sendJson, i as resolveAssistantStreamDeltaText, it as resolveSessionKey, n as handleGatewayPostJsonEndpoint, nt as createDefaultDeps, ot as setSseHeaders, r as buildAgentMessageFromConversationEntries, rt as resolveAgentIdForRequest, st as writeDone, z as extractFileContentFromSource } from "./auth-BbQxXxtt.js";
4
4
  import "./send-D96gGRQz.js";
5
5
  import "./send-BFoI9HuU.js";
6
6
  import "./skill-commands-DvoCSQnx.js";
@@ -2,7 +2,7 @@ import { bd as logWarn } from "./env-C77feXxI.js";
2
2
  import "./agent-paths-BI1hx-tF.js";
3
3
  import "./send-D7X0_iFp.js";
4
4
  import "./send-BFEd4vCM.js";
5
- import { Ai as buildAgentMessageFromConversationEntries, Ii as resolveAssistantStreamDeltaText, Li as agentCommand, _a as resolveAgentIdForRequest, an as DEFAULT_INPUT_IMAGE_MAX_BYTES, ba as setSseHeaders, cn as DEFAULT_INPUT_TIMEOUT_MS, dn as normalizeMimeList, fn as resolveInputFileLimits, ia as emitAgentEvent, ki as handleGatewayPostJsonEndpoint, ln as extractFileContentFromSource, oa as onAgentEvent, on as DEFAULT_INPUT_IMAGE_MIMES, sn as DEFAULT_INPUT_MAX_REDIRECTS, un as extractImageContentFromSource, va as resolveSessionKey, xa as writeDone, ya as sendJson } from "./model-catalog--SvucuO6.js";
5
+ import { Ai as buildAgentMessageFromConversationEntries, Ii as resolveAssistantStreamDeltaText, Li as agentCommand, _a as resolveAgentIdForRequest, an as DEFAULT_INPUT_IMAGE_MAX_BYTES, ba as setSseHeaders, cn as DEFAULT_INPUT_TIMEOUT_MS, dn as normalizeMimeList, fn as resolveInputFileLimits, ia as emitAgentEvent, ki as handleGatewayPostJsonEndpoint, ln as extractFileContentFromSource, oa as onAgentEvent, on as DEFAULT_INPUT_IMAGE_MIMES, sn as DEFAULT_INPUT_MAX_REDIRECTS, un as extractImageContentFromSource, va as resolveSessionKey, xa as writeDone, ya as sendJson } from "./model-catalog-ex4Cpln_.js";
6
6
  import "./github-copilot-token-A9DiaCB0.js";
7
7
  import { A as defaultRuntime } from "./entry.js";
8
8
  import "./reply-prefix-TUhpEtvr.js";
@@ -45,7 +45,7 @@ import "./send-C-su1wPZ.js";
45
45
  import "./outbound-attachment-Bh4FmcYg.js";
46
46
  import "./fetch-BVvWzHT_.js";
47
47
  import "./delivery-queue-55Cityuq.js";
48
- import { t as createDefaultDeps } from "./deps-5vuaH16V.js";
48
+ import { t as createDefaultDeps } from "./deps-BWo3ls9h.js";
49
49
  import "./frontmatter-D2UNJikU.js";
50
50
  import "./skills-Dis31awJ.js";
51
51
  import "./skills-remote-CIAB0AXm.js";
@@ -72,7 +72,7 @@ import "./cli-utils-XevKf-tr.js";
72
72
  import "./help-format-B2DRdx98.js";
73
73
  import "./progress-DkVYFLij.js";
74
74
  import "./replies-FXlmpJVO.js";
75
- import "./prompt-style-DxKPs6E0.js";
75
+ import "./prompt-style-Rmj3c-Ir.js";
76
76
  import "./pairing-labels-BCM1S2e_.js";
77
77
  import { randomUUID } from "node:crypto";
78
78
  import { z } from "zod";
@@ -2,7 +2,7 @@ import "./paths-C9FmTW1x.js";
2
2
  import "./agent-paths-DmOVZE7g.js";
3
3
  import { au as logWarn } from "./agent-scope-DHrLr5OF.js";
4
4
  import "./commands-registry-BRvZQ1jh.js";
5
- import { Er as onAgentEvent, G as DEFAULT_INPUT_TIMEOUT_MS, H as DEFAULT_INPUT_IMAGE_MAX_BYTES, J as normalizeMimeList, Ja as sendJson, K as extractFileContentFromSource, Ka as resolveAgentIdForRequest, U as DEFAULT_INPUT_IMAGE_MIMES, W as DEFAULT_INPUT_MAX_REDIRECTS, Xa as writeDone, Y as resolveInputFileLimits, Ya as setSseHeaders, ft as handleGatewayPostJsonEndpoint, ht as agentCommand, mt as resolveAssistantStreamDeltaText, pt as buildAgentMessageFromConversationEntries, q as extractImageContentFromSource, qa as resolveSessionKey, wr as emitAgentEvent } from "./reply-C-KlztgC.js";
5
+ import { Er as onAgentEvent, G as DEFAULT_INPUT_TIMEOUT_MS, H as DEFAULT_INPUT_IMAGE_MAX_BYTES, J as normalizeMimeList, Ja as sendJson, K as extractFileContentFromSource, Ka as resolveAgentIdForRequest, U as DEFAULT_INPUT_IMAGE_MIMES, W as DEFAULT_INPUT_MAX_REDIRECTS, Xa as writeDone, Y as resolveInputFileLimits, Ya as setSseHeaders, ft as handleGatewayPostJsonEndpoint, ht as agentCommand, mt as resolveAssistantStreamDeltaText, pt as buildAgentMessageFromConversationEntries, q as extractImageContentFromSource, qa as resolveSessionKey, wr as emitAgentEvent } from "./reply-B034LmuD.js";
6
6
  import { d as defaultRuntime } from "./errors-Dx3S3Nrp.js";
7
7
  import "./send-C5_fB8YQ.js";
8
8
  import "./send-jxmRy65D.js";
@@ -37,7 +37,7 @@ import "./ssrf-Blf4NrHS.js";
37
37
  import "./outbound-attachment-CsXJwFsg.js";
38
38
  import "./fetch-CnCPOuq7.js";
39
39
  import "./delivery-queue-DKRjVFlq.js";
40
- import { t as createDefaultDeps } from "./deps-DXHMO1Yj.js";
40
+ import { t as createDefaultDeps } from "./deps-BKAIBkcE.js";
41
41
  import "./memory-DDpj0IVA.js";
42
42
  import "./memory-search-BwYkW6_V.js";
43
43
  import "./manager-BmONwMiP.js";
@@ -74,7 +74,7 @@ import "./progress-DZRfIFVb.js";
74
74
  import "./replies-Do40G8fO.js";
75
75
  import "./skills-remote-BghdrdFV.js";
76
76
  import "./skill-commands-QW8zKXC_.js";
77
- import "./prompt-style-Wxki8rmI.js";
77
+ import "./prompt-style-CWAacuMq.js";
78
78
  import "./pairing-labels-D2yOKhoV.js";
79
79
  import { randomUUID } from "node:crypto";
80
80
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import { Gl as listChannelPlugins, Vf as CHAT_CHANNEL_ORDER, t as isTruthyEnvValue } from "./env-C77feXxI.js";
2
2
  import { d as listChannelPluginCatalogEntries } from "./dangerous-name-matching-CFRKz8Uq.js";
3
- import { t as ensurePluginRegistryLoaded } from "./plugin-registry-C6ytAnfA.js";
3
+ import { t as ensurePluginRegistryLoaded } from "./plugin-registry-DjTXh-9g.js";
4
4
 
5
5
  //#region src/cli/channel-options.ts
6
6
  function dedupe(values) {
@@ -1,6 +1,6 @@
1
1
  import { Cd as isTruthyEnvValue, Nu as listChannelPlugins, jf as CHAT_CHANNEL_ORDER } from "./agent-scope-DHrLr5OF.js";
2
2
  import { c as listChannelPluginCatalogEntries } from "./dangerous-name-matching-CnyEIiOk.js";
3
- import { t as ensurePluginRegistryLoaded } from "./plugin-registry-DfiokqgQ.js";
3
+ import { t as ensurePluginRegistryLoaded } from "./plugin-registry-D2IeEq2N.js";
4
4
 
5
5
  //#region src/cli/channel-options.ts
6
6
  function dedupe(values) {
@@ -9,7 +9,7 @@ import { createHmac } from "node:crypto";
9
9
  import { execFileSync, spawn } from "node:child_process";
10
10
  import { createServer } from "node:http";
11
11
  import net from "node:net";
12
- import WebSocket, { WebSocketServer } from "ws";
12
+ import WebSocket$1, { WebSocketServer } from "ws";
13
13
  import { Buffer as Buffer$1 } from "node:buffer";
14
14
 
15
15
  //#region src/browser/constants.ts
@@ -270,7 +270,7 @@ async function ensureChromeExtensionRelayServer(opts) {
270
270
  let extensionWs = null;
271
271
  const cdpClients = /* @__PURE__ */ new Set();
272
272
  const connectedTargets = /* @__PURE__ */ new Map();
273
- const extensionConnected = () => extensionWs?.readyState === WebSocket.OPEN;
273
+ const extensionConnected = () => extensionWs?.readyState === WebSocket$1.OPEN;
274
274
  let extensionDisconnectCleanupTimer = null;
275
275
  const extensionReconnectWaiters = /* @__PURE__ */ new Set();
276
276
  const flushExtensionReconnectWaiters = (connected) => {
@@ -321,7 +321,7 @@ async function ensureChromeExtensionRelayServer(opts) {
321
321
  let nextExtensionId = 1;
322
322
  const sendToExtension = async (payload) => {
323
323
  const ws = extensionWs;
324
- if (!ws || ws.readyState !== WebSocket.OPEN) throw new Error("Chrome extension not connected");
324
+ if (!ws || ws.readyState !== WebSocket$1.OPEN) throw new Error("Chrome extension not connected");
325
325
  ws.send(JSON.stringify(payload));
326
326
  return await new Promise((resolve, reject) => {
327
327
  const timer = setTimeout(() => {
@@ -338,12 +338,12 @@ async function ensureChromeExtensionRelayServer(opts) {
338
338
  const broadcastToCdpClients = (evt) => {
339
339
  const msg = JSON.stringify(evt);
340
340
  for (const ws of cdpClients) {
341
- if (ws.readyState !== WebSocket.OPEN) continue;
341
+ if (ws.readyState !== WebSocket$1.OPEN) continue;
342
342
  ws.send(msg);
343
343
  }
344
344
  };
345
345
  const sendResponseToCdp = (ws, res) => {
346
- if (ws.readyState !== WebSocket.OPEN) return;
346
+ if (ws.readyState !== WebSocket$1.OPEN) return;
347
347
  ws.send(JSON.stringify(res));
348
348
  };
349
349
  const ensureTargetEventsForClient = (ws, mode) => {
@@ -553,7 +553,7 @@ async function ensureChromeExtensionRelayServer(opts) {
553
553
  rejectUpgrade(socket, 401, "Unauthorized");
554
554
  return;
555
555
  }
556
- if (extensionWs && extensionWs.readyState !== WebSocket.OPEN) {
556
+ if (extensionWs && extensionWs.readyState !== WebSocket$1.OPEN) {
557
557
  try {
558
558
  extensionWs.terminate();
559
559
  } catch {}
@@ -590,7 +590,7 @@ async function ensureChromeExtensionRelayServer(opts) {
590
590
  clearExtensionDisconnectCleanupTimer();
591
591
  flushExtensionReconnectWaiters(true);
592
592
  const ping = setInterval(() => {
593
- if (ws.readyState !== WebSocket.OPEN) return;
593
+ if (ws.readyState !== WebSocket$1.OPEN) return;
594
594
  ws.send(JSON.stringify({ method: "ping" }));
595
595
  }, 5e3);
596
596
  ws.on("message", (data) => {
@@ -932,7 +932,7 @@ async function fetchOk(url, timeoutMs = 1500, init) {
932
932
  }
933
933
  async function withCdpSocket(wsUrl, fn, opts) {
934
934
  const headers = getHeadersWithAuth(wsUrl, opts?.headers ?? {});
935
- const ws = new WebSocket(wsUrl, {
935
+ const ws = new WebSocket$1(wsUrl, {
936
936
  handshakeTimeout: typeof opts?.handshakeTimeoutMs === "number" && Number.isFinite(opts.handshakeTimeoutMs) ? Math.max(1, Math.floor(opts.handshakeTimeoutMs)) : 5e3,
937
937
  ...Object.keys(headers).length ? { headers } : {}
938
938
  });
@@ -1858,7 +1858,7 @@ async function getChromeWebSocketUrl(cdpUrl, timeoutMs = 500) {
1858
1858
  async function canOpenWebSocket(wsUrl, timeoutMs = 800) {
1859
1859
  return await new Promise((resolve) => {
1860
1860
  const headers = getHeadersWithAuth(wsUrl);
1861
- const ws = new WebSocket(wsUrl, {
1861
+ const ws = new WebSocket$1(wsUrl, {
1862
1862
  handshakeTimeout: timeoutMs,
1863
1863
  ...Object.keys(headers).length ? { headers } : {}
1864
1864
  });