@fased/fased 0.1.30 → 0.1.31

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 (202) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{agents-BU4NqZkn.js → agents-B7oe96FC.js} +8 -8
  3. package/dist/{attachment-normalize-D3LvGnxE.js → attachment-normalize-B-UXOsKN.js} +1 -1
  4. package/dist/{attachment-normalize-3_V1yb6a.js → attachment-normalize-Ch3m3gW7.js} +1 -1
  5. package/dist/{audio-preflight-B4hZi0X5.js → audio-preflight-BLnXSrbe.js} +1 -1
  6. package/dist/{audio-preflight-YPQKo93v.js → audio-preflight-DWAgAnFF.js} +1 -1
  7. package/dist/{audio-preflight-r8PHFHTe.js → audio-preflight-DWXq2U0B.js} +2 -2
  8. package/dist/{audio-preflight-DcQrkXYr.js → audio-preflight-JeAEvjmi.js} +2 -2
  9. package/dist/{audio-preflight-MUfVeIPT.js → audio-preflight-UFD3iTyT.js} +2 -2
  10. package/dist/{audit-ChF16w3M.js → audit-C11zzpna.js} +1 -1
  11. package/dist/{audit-BNmzld5I.js → audit-uEYwrVh1.js} +1 -1
  12. package/dist/{auth-choice-BJGGTOYU.js → auth-choice-CvM0GCEt.js} +1 -1
  13. package/dist/{auth-choice-UvbBnRhr.js → auth-choice-fxfJkTWE.js} +1 -1
  14. package/dist/{auth-choice-prompt-9uH2hSjM.js → auth-choice-prompt-CZWGTWFF.js} +1 -1
  15. package/dist/{auth-choice-prompt-CPoTg_-G.js → auth-choice-prompt-DgZ_-DFR.js} +1 -1
  16. package/dist/{auth-DGXGqcN7.js → auth-miYdUxcO.js} +5 -5
  17. package/dist/build-info.json +3 -3
  18. package/dist/bundled/boot-md/handler.js +2 -2
  19. package/dist/bundled/session-memory/handler.js +2 -2
  20. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  21. package/dist/{channel-web-DLD1undh.js → channel-web-CEpBiX-Q.js} +1 -1
  22. package/dist/{channel-web-0wKGD4yD.js → channel-web-DRFSKnVi.js} +1 -1
  23. package/dist/{channels-B9bvlD7y.js → channels-Bzj2_yUj.js} +6 -6
  24. package/dist/{channels-CBT56Ap7.js → channels-CY1sX0bz.js} +6 -6
  25. package/dist/{channels-cli-D6ioLe8o.js → channels-cli-BruuPCkp.js} +5 -5
  26. package/dist/{channels-cli-CK1qojpR.js → channels-cli-CRfpkLwo.js} +5 -5
  27. package/dist/cli/daemon-cli.js +1 -1
  28. package/dist/{cli-ByaZFcQl.js → cli-BXBAZCT8.js} +2 -2
  29. package/dist/{cli-DgHb9Vld.js → cli-BgodEMPl.js} +2 -2
  30. package/dist/{command-registry-mptWJW8S.js → command-registry-CU64eZmw.js} +9 -9
  31. package/dist/{completion-cli-DyJbXhbh.js → completion-cli-CWke3Y2I.js} +1 -1
  32. package/dist/{completion-cli-BRvgVQzN.js → completion-cli-DNlt3cBf.js} +2 -2
  33. package/dist/{config-cli-BrzPOli4.js → config-cli-BugbkifH.js} +1 -1
  34. package/dist/{config-cli-R0TQZDi7.js → config-cli-DTLNqY4I.js} +1 -1
  35. package/dist/{configure-Bt3nH-_I.js → configure-BYcI4db_.js} +12 -12
  36. package/dist/{configure-pREf12zB.js → configure-XZxBL9XF.js} +12 -12
  37. package/dist/control-ui/assets/app-DXYMrRJ9.js.map +1 -1
  38. package/dist/{cron-cli-BIYfBpRP.js → cron-cli-BAT3nsi8.js} +2 -2
  39. package/dist/{cron-cli-zdoRLQ0m.js → cron-cli-BzceMqJm.js} +2 -2
  40. package/dist/{daemon-cli-LLGP6g2r.js → daemon-cli-5_eqnI7H.js} +77 -38
  41. package/dist/{daemon-cli-Cj4_RgEM.js → daemon-cli-JvoxFHRy.js} +77 -38
  42. package/dist/daemon-cli.js +76 -37
  43. package/dist/{deps-sd-SQKYn.js → deps-BWahcXVa.js} +1 -1
  44. package/dist/{deps-QnUngXA3.js → deps-CkOczIqw.js} +1 -1
  45. package/dist/entry.js +1 -1
  46. package/dist/extensionAPI.js +1 -1
  47. package/dist/{gateway-cli-Cn3STpYX.js → gateway-cli-D0rc9BQT.js} +27 -27
  48. package/dist/{gateway-cli-yfNsUzH6.js → gateway-cli-DZwQlnd-.js} +27 -27
  49. package/dist/{health-BfGnSyOV.js → health-CtFbngOI.js} +2 -2
  50. package/dist/{health-DcurJYny.js → health-Dx0abJui.js} +2 -2
  51. package/dist/{heartbeat-runner-CY41VFZE.js → heartbeat-runner-CnzA9MCj.js} +1 -1
  52. package/dist/{heartbeat-runner-CJZStXhx.js → heartbeat-runner-DBcCEPYX.js} +1 -1
  53. package/dist/{hooks-cli-WtC65axA.js → hooks-cli-C4nrKQB8.js} +3 -3
  54. package/dist/{hooks-cli-DpkFISKR.js → hooks-cli-ED4F4hgZ.js} +3 -3
  55. package/dist/index.js +7 -7
  56. package/dist/{ipv4-CdRPraPM.js → ipv4-BiVsHcPZ.js} +2 -2
  57. package/dist/{ipv4-BkY__Z0A.js → ipv4-p6oBdL3i.js} +2 -2
  58. package/dist/{lifecycle-DUPuKIvd.js → lifecycle-DN1VLZsk.js} +1 -1
  59. package/dist/{lifecycle-Dd-6tFQk.js → lifecycle-DXPbWOOF.js} +1 -1
  60. package/dist/{list.auth-overview-DcdJySBi.js → list.auth-overview-SGV043-s.js} +1 -1
  61. package/dist/{list.auth-overview-CE2_GQ-8.js → list.auth-overview-qQ-PSQWI.js} +1 -1
  62. package/dist/llm-slug-generator.js +2 -2
  63. package/dist/{model-catalog-DOuyqwFa.js → model-catalog-DTeRSOlM.js} +6 -6
  64. package/dist/{models-ItVo4_FF.js → models-DNWCoAr6.js} +4 -4
  65. package/dist/{models-cli-DKEzhF9X.js → models-cli-6JDQwXLP.js} +4 -4
  66. package/dist/{models-cli-YznPWFUE.js → models-cli-8Ogt1Nai.js} +5 -5
  67. package/dist/{node-cli-CZaJUGYu.js → node-cli-B5XUZW_F.js} +2 -2
  68. package/dist/{node-cli-qkHTKDmW.js → node-cli-BPQ4Bj27.js} +2 -2
  69. package/dist/{onboard-Cpw2fP2S.js → onboard-Bkmx2_JM.js} +6 -6
  70. package/dist/{onboard--COJdfXc.js → onboard-CoIQYNfB.js} +6 -6
  71. package/dist/{onboard-channels-BH6atgy1.js → onboard-channels-6l52GEWY.js} +2 -2
  72. package/dist/{onboard-channels-CbQgdo3k.js → onboard-channels-B-CHfy-_.js} +2 -2
  73. package/dist/{onboard-search-BxaAdq5U.js → onboard-search-CXl_FBtA.js} +5 -5
  74. package/dist/{onboard-search-Bg8qvHBV.js → onboard-search-DitZYPTM.js} +5 -5
  75. package/dist/{onboarding-B-_4gKpN.js → onboarding-BAdN-hFD.js} +7 -7
  76. package/dist/{onboarding-DiuUZg9l.js → onboarding-DnPBiIlf.js} +7 -7
  77. package/dist/{openresponses-http-BVdja8Nj.js → openresponses-http-C4uMHFQG.js} +2 -2
  78. package/dist/{openresponses-http-svQwMBaq.js → openresponses-http-CWOcu9i9.js} +2 -2
  79. package/dist/{openresponses-http-BNIAyGrH.js → openresponses-http-CdFdfFbo.js} +1 -1
  80. package/dist/{openresponses-http-DGAqU5K9.js → openresponses-http-CgJamjpH.js} +1 -1
  81. package/dist/{openresponses-http-DhBER2sI.js → openresponses-http-cj2oimfW.js} +2 -2
  82. package/dist/{parent-default-help-DUqMyqko.js → parent-default-help-BT7FBzs-.js} +1 -1
  83. package/dist/{parent-default-help-B2mCEhav.js → parent-default-help-ecMFlg2S.js} +1 -1
  84. package/dist/{paths-zdeD1PNp.js → paths-BrYFwmxy.js} +9 -9
  85. package/dist/{pi-embedded-CrKlYvWM.js → pi-embedded-BMW4AO0b.js} +14 -14
  86. package/dist/{pi-embedded-DPl5Aqw4.js → pi-embedded-YWZsPSdf.js} +5 -5
  87. package/dist/{plugin-registry-BBzitaxQ.js → plugin-registry-CwfvRSs4.js} +1 -1
  88. package/dist/{plugin-registry-CIiRwpQv.js → plugin-registry-DA_1IBe0.js} +1 -1
  89. package/dist/plugin-sdk/{audio-preflight-DcJUk03P.js → audio-preflight-B-GNQeK0.js} +1 -1
  90. package/dist/plugin-sdk/{audio-preflight-B-__-RfZ.js → audio-preflight-DeP8VHC6.js} +1 -1
  91. package/dist/plugin-sdk/{channel-web-DoGtD0PQ.js → channel-web-QaRgsb6f.js} +1 -1
  92. package/dist/plugin-sdk/command-status.js +1 -1
  93. package/dist/plugin-sdk/index.js +2 -2
  94. package/dist/plugin-sdk/{openresponses-http-VFgg_bR4.js → openresponses-http-BISP9-A6.js} +1 -1
  95. package/dist/plugin-sdk/{openresponses-http-DQWJE95u.js → openresponses-http-DenlQldm.js} +1 -1
  96. package/dist/plugin-sdk/{reply-D4WNXysa.js → reply-DQSn23Jt.js} +5 -5
  97. package/dist/plugin-sdk/src/brand.d.ts +2 -2
  98. package/dist/plugin-sdk/{status-BlX9jStp.js → status-CkAJPulJ.js} +5 -5
  99. package/dist/plugin-sdk/{web-Cr8AJx43.js → web-0HkZCM7O.js} +2 -2
  100. package/dist/plugin-sdk/{web-CEucw6Dl.js → web-Cav7vEAd.js} +1 -1
  101. package/dist/{plugins-cli-B9w9SKYa.js → plugins-cli-CIumz1mA.js} +5 -5
  102. package/dist/{plugins-cli-CdRa6xYi.js → plugins-cli-NtgUFN5F.js} +5 -5
  103. package/dist/{program-C9wZbb_-.js → program-CSz1D1dG.js} +7 -7
  104. package/dist/{program-context-Dc8hoANx.js → program-context-DI-GvkMR.js} +24 -24
  105. package/dist/{prompt-select-styled-oUCALY2N.js → prompt-select-styled-n_A35tSP.js} +4 -4
  106. package/dist/{prompt-select-styled-9E7HlPjk.js → prompt-select-styled-vQMrGEwY.js} +4 -4
  107. package/dist/{pw-ai-5b6U6vNE.js → pw-ai-AEM6NhZt.js} +1 -1
  108. package/dist/{register.agent-BhoMAqJe.js → register.agent-CpHR4A6v.js} +8 -8
  109. package/dist/{register.agent-Dty2GQos.js → register.agent-DD-U7oGb.js} +9 -9
  110. package/dist/{register.configure-CjQhBudl.js → register.configure-C3qRt8Z2.js} +12 -12
  111. package/dist/{register.configure-DZl7w5Se.js → register.configure-CsmE4__F.js} +12 -12
  112. package/dist/{register.maintenance-CGFQEESj.js → register.maintenance-C1pTDCfr.js} +9 -9
  113. package/dist/{register.maintenance-C9_UzTyI.js → register.maintenance-Dw9XWs6B.js} +8 -8
  114. package/dist/{register.message-DnrC31ZC.js → register.message-C5H4BaZR.js} +3 -3
  115. package/dist/{register.message-C3BTjmhg.js → register.message-D1vEgAqq.js} +3 -3
  116. package/dist/{register.onboard-DzO2dNpB.js → register.onboard-C2ZqqRHb.js} +14 -14
  117. package/dist/{register.onboard-DIxJ1bFs.js → register.onboard-Dd5wooum.js} +14 -14
  118. package/dist/{register.setup-B5Ji_Smo.js → register.setup-S47GDXlI.js} +14 -14
  119. package/dist/{register.setup-Cd8rXata.js → register.setup-wdsoq3BF.js} +14 -14
  120. package/dist/{register.status-health-sessions-CUw6awJ6.js → register.status-health-sessions-BoN2hOA8.js} +6 -6
  121. package/dist/{register.status-health-sessions-CYpKmq3y.js → register.status-health-sessions-C876VSZh.js} +6 -6
  122. package/dist/{register.subclis-DEnba1hq.js → register.subclis-BT84Bn-_.js} +16 -16
  123. package/dist/{reply-DVGmtLPq.js → reply-jrONH9Y7.js} +6 -6
  124. package/dist/{run-main-BqiU1shU.js → run-main-C6XcZlLi.js} +14 -14
  125. package/dist/{runtime-helper-grants-BQl2Y_KJ.js → runtime-helper-grants-Jas30vI5.js} +1 -1
  126. package/dist/{runtime-helper-grants-CHz5azhO.js → runtime-helper-grants-kih7jkmx.js} +1 -1
  127. package/dist/{sandbox-cli-C7tRjHGl.js → sandbox-cli-Bfj6NbE1.js} +2 -2
  128. package/dist/{sandbox-cli-BLWfhZh2.js → sandbox-cli-C9wECeaH.js} +2 -2
  129. package/dist/{security-cli-DGCfCHzM.js → security-cli-B1c376KU.js} +3 -3
  130. package/dist/{security-cli-0-5Vgk1A.js → security-cli-Dz7uvFDt.js} +3 -3
  131. package/dist/{server-DamsmTjm.js → server-B2nRkZJD.js} +2 -2
  132. package/dist/{server-BMZYE37o.js → server-DYUU_xzp.js} +2 -2
  133. package/dist/{server-cron-BUWyjpTV.js → server-cron-BgVg0Xr0.js} +2 -2
  134. package/dist/{server-cron-DC9t05LU.js → server-cron-DiMWX26M.js} +2 -2
  135. package/dist/{server-node-events-C3IOxSF_.js → server-node-events-BTIgBj-Y.js} +3 -3
  136. package/dist/{server-node-events-cusaGrcY.js → server-node-events-CD7PjM02.js} +3 -3
  137. package/dist/{status-CrL7Hp3R.js → status-C1h5Ta_q.js} +4 -4
  138. package/dist/{status-Dlt3xwcf.js → status-CnhP8fx7.js} +4 -4
  139. package/dist/{status-Doqt5wXN.js → status-DkMo6n1P.js} +1 -1
  140. package/dist/{status-B39ZJFhD.js → status-aMuRqtjs.js} +1 -1
  141. package/dist/{tui-DdPEVWjR.js → tui-BuCSCKXc.js} +1 -1
  142. package/dist/{tui-R-P_OV8J.js → tui-DM671Mke.js} +1 -1
  143. package/dist/{tui-cli-ChpP9FsL.js → tui-cli-Cfw5R0S8.js} +3 -3
  144. package/dist/{tui-cli-BgihXvs7.js → tui-cli-DjI4QOzV.js} +3 -3
  145. package/dist/{update-cli-DVCjSLYw.js → update-cli-BL1PUycr.js} +10 -10
  146. package/dist/{update-cli-DPdSuHZT.js → update-cli-Bl5opT2O.js} +9 -9
  147. package/dist/{update-runner-DNPfs265.js → update-runner-BNiDZKyO.js} +1 -1
  148. package/dist/{update-runner-COs-YDhT.js → update-runner-Col2sOeF.js} +1 -1
  149. package/dist/{web-BHp_2XHP.js → web-0I3YFoDZ.js} +1 -1
  150. package/dist/{web-DQuQBwMr.js → web-Blq5sWxH.js} +2 -2
  151. package/dist/{web-vGE7qeF-.js → web-C7I6HVNX.js} +1 -1
  152. package/dist/{web-D8bq1XRX.js → web-D-gMdQkD.js} +3 -3
  153. package/dist/{web-B2SWpLdC.js → web-_igiL4AE.js} +3 -3
  154. package/dist/{web-search-providers.runtime-CiOoq6G3.js → web-search-providers.runtime-CzUamtQl.js} +1 -1
  155. package/dist/{web-search-providers.runtime-BD9Vp8eD.js → web-search-providers.runtime-pv7Jv2d6.js} +1 -1
  156. package/extensions/acpx/package.json +1 -1
  157. package/extensions/bluebubbles/package.json +1 -1
  158. package/extensions/copilot-proxy/package.json +1 -1
  159. package/extensions/diagnostics-otel/package.json +1 -1
  160. package/extensions/discord/package.json +1 -1
  161. package/extensions/fased-federation/package.json +1 -1
  162. package/extensions/feishu/package.json +1 -1
  163. package/extensions/google-gemini-cli-auth/package.json +1 -1
  164. package/extensions/googlechat/package.json +1 -1
  165. package/extensions/imessage/package.json +1 -1
  166. package/extensions/irc/package.json +1 -1
  167. package/extensions/line/package.json +1 -1
  168. package/extensions/llm-task/package.json +1 -1
  169. package/extensions/lobster/package.json +1 -1
  170. package/extensions/matrix/CHANGELOG.md +6 -0
  171. package/extensions/matrix/package.json +1 -1
  172. package/extensions/mattermost/package.json +1 -1
  173. package/extensions/memory-core/package.json +1 -1
  174. package/extensions/memory-lancedb/package.json +1 -1
  175. package/extensions/minimax-portal-auth/package.json +1 -1
  176. package/extensions/msteams/CHANGELOG.md +6 -0
  177. package/extensions/msteams/package.json +1 -1
  178. package/extensions/nextcloud-talk/package.json +1 -1
  179. package/extensions/nostr/CHANGELOG.md +6 -0
  180. package/extensions/nostr/package.json +1 -1
  181. package/extensions/open-prose/package.json +1 -1
  182. package/extensions/sat-mining/package.json +1 -1
  183. package/extensions/signal/package.json +1 -1
  184. package/extensions/slack/package.json +1 -1
  185. package/extensions/synology-chat/package.json +1 -1
  186. package/extensions/telegram/package.json +1 -1
  187. package/extensions/tlon/package.json +1 -1
  188. package/extensions/twitch/CHANGELOG.md +6 -0
  189. package/extensions/twitch/package.json +1 -1
  190. package/extensions/voice-call/CHANGELOG.md +6 -0
  191. package/extensions/voice-call/package.json +1 -1
  192. package/extensions/whatsapp/package.json +1 -1
  193. package/extensions/zalo/CHANGELOG.md +6 -0
  194. package/extensions/zalo/package.json +1 -1
  195. package/extensions/zalouser/CHANGELOG.md +6 -0
  196. package/extensions/zalouser/package.json +1 -1
  197. package/package.json +1 -1
  198. package/src/brand.ts +1 -1
  199. package/src/canvas-host/a2ui/.bundle.hash +1 -1
  200. package/src/cli/daemon-cli/lifecycle.ts +23 -0
  201. package/src/cli/daemon-cli/restart-health.ts +37 -1
  202. package/src/cli/daemon-cli/status.gather.ts +37 -3
@@ -1837,8 +1837,8 @@ function registerCronWorkerCommand(cron) {
1837
1837
  try {
1838
1838
  const [{ loadConfig }, { createDefaultDeps }, { buildGatewayCronService }] = await Promise.all([
1839
1839
  import("./env-BegRUDBP.js").then((n) => n.qt),
1840
- import("./deps-QnUngXA3.js").then((n) => n.r),
1841
- import("./server-cron-BUWyjpTV.js").then((n) => n.n)
1840
+ import("./deps-CkOczIqw.js").then((n) => n.r),
1841
+ import("./server-cron-BgVg0Xr0.js").then((n) => n.n)
1842
1842
  ]);
1843
1843
  const workerId = typeof opts.workerId === "string" && opts.workerId.trim() ? opts.workerId.trim() : `task-worker:${process.pid}`;
1844
1844
  const maxRuns = parsePositiveInt(opts.maxRuns, 1);
@@ -1840,8 +1840,8 @@ function registerCronWorkerCommand(cron) {
1840
1840
  try {
1841
1841
  const [{ loadConfig }, { createDefaultDeps }, { buildGatewayCronService }] = await Promise.all([
1842
1842
  import("./agent-scope-CrCe9L5D.js").then((n) => n.wn),
1843
- import("./deps-sd-SQKYn.js").then((n) => n.r),
1844
- import("./server-cron-DC9t05LU.js").then((n) => n.n)
1843
+ import("./deps-BWahcXVa.js").then((n) => n.r),
1844
+ import("./server-cron-DiMWX26M.js").then((n) => n.n)
1845
1845
  ]);
1846
1846
  const workerId = typeof opts.workerId === "string" && opts.workerId.trim() ? opts.workerId.trim() : `task-worker:${process.pid}`;
1847
1847
  const maxRuns = parsePositiveInt(opts.maxRuns, 1);
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
2
  import { Cf as GATEWAY_CLIENT_MODES, Cu as formatCliCommand, Qt as readConfigFileSnapshot, Xt as loadConfig, Yt as createConfigIO, tn as writeConfigFile, wf as GATEWAY_CLIENT_NAMES } from "./env-BegRUDBP.js";
3
3
  import { B as colorize, G as getResolvedLoggerSettings, H as theme, T as sleep, V as isRich, w as shortenHomePath } from "./agent-paths-BI1hx-tF.js";
4
- import { E as resolveControlUiLinks, T as randomToken, Vn as resolveGatewayAuth } from "./model-catalog-DOuyqwFa.js";
4
+ import { E as resolveControlUiLinks, T as randomToken, Vn as resolveGatewayAuth } from "./model-catalog-DTeRSOlM.js";
5
5
  import { A as defaultRuntime, Ct as resolveStateDir, _t as resolveIsNixMode, ft as resolveConfigPath, gt as resolveGatewayPort } from "./entry.js";
6
6
  import { f as classifyPortListener, l as inspectPortUsage, p as formatPortDiagnostics } from "./chrome-BWkaWvCf.js";
7
7
  import { t as pickPrimaryTailnetIPv4 } from "./tailnet-CGlWbWK9.js";
8
8
  import { p as resolveGatewayBindHost } from "./ws-DiFJ3zRB.js";
9
- import { n as callGateway, sr as loadGatewayTlsRuntime } from "./call-FB3XorzP.js";
9
+ import { l as resolveGatewayCredentialsFromConfig, n as callGateway, sr as loadGatewayTlsRuntime } from "./call-FB3XorzP.js";
10
10
  import { g as resolveGatewaySystemdServiceName, p as resolveGatewayLaunchAgentLabel } from "./constants-BFf26Ay9.js";
11
11
  import { r as isWSLEnv } from "./wsl-CZrHoi91.js";
12
12
  import { t as formatDocsLink } from "./links-BxcIEPsi.js";
@@ -147,6 +147,34 @@ async function runDaemonInstall(opts) {
147
147
  });
148
148
  }
149
149
 
150
+ //#endregion
151
+ //#region src/cli/daemon-cli/probe.ts
152
+ async function probeGatewayStatus(opts) {
153
+ try {
154
+ await withProgress({
155
+ label: "Checking gateway status...",
156
+ indeterminate: true,
157
+ enabled: opts.json !== true
158
+ }, async () => await callGateway({
159
+ url: opts.url,
160
+ token: opts.token,
161
+ password: opts.password,
162
+ tlsFingerprint: opts.tlsFingerprint,
163
+ method: "status",
164
+ timeoutMs: opts.timeoutMs,
165
+ clientName: GATEWAY_CLIENT_NAMES.CLI,
166
+ mode: GATEWAY_CLIENT_MODES.CLI,
167
+ ...opts.configPath ? { configPath: opts.configPath } : {}
168
+ }));
169
+ return { ok: true };
170
+ } catch (err) {
171
+ return {
172
+ ok: false,
173
+ error: err instanceof Error ? err.message : String(err)
174
+ };
175
+ }
176
+ }
177
+
150
178
  //#endregion
151
179
  //#region src/cli/daemon-cli/restart-health.ts
152
180
  const DEFAULT_RESTART_HEALTH_TIMEOUT_MS = 6e4;
@@ -185,7 +213,15 @@ async function inspectGatewayRestart(params) {
185
213
  listener,
186
214
  runtimePid
187
215
  })) : gatewayListeners.length > 0 || portUsage.status === "busy" && portUsage.listeners.length === 0;
188
- const healthy = running && ownsPort;
216
+ const rpc = running && ownsPort && params.rpc ? await probeGatewayStatus({
217
+ url: params.rpc.url,
218
+ token: params.rpc.token,
219
+ password: params.rpc.password,
220
+ tlsFingerprint: params.rpc.tlsFingerprint,
221
+ timeoutMs: params.rpc.timeoutMs,
222
+ json: true
223
+ }) : void 0;
224
+ const healthy = running && ownsPort && (rpc ? rpc.ok : true);
189
225
  const staleGatewayPids = Array.from(new Set(gatewayListeners.filter((listener) => Number.isFinite(listener.pid)).filter((listener) => {
190
226
  if (!running) return true;
191
227
  if (runtimePid == null) return true;
@@ -198,6 +234,7 @@ async function inspectGatewayRestart(params) {
198
234
  runtime,
199
235
  portUsage,
200
236
  healthy,
237
+ ...rpc ? { rpc } : {},
201
238
  staleGatewayPids
202
239
  };
203
240
  }
@@ -207,7 +244,8 @@ async function waitForGatewayHealthyRestart(params) {
207
244
  let snapshot = await inspectGatewayRestart({
208
245
  service: params.service,
209
246
  port: params.port,
210
- env: params.env
247
+ env: params.env,
248
+ rpc: params.rpc
211
249
  });
212
250
  for (let attempt = 0; attempt < attempts; attempt += 1) {
213
251
  if (snapshot.healthy) return snapshot;
@@ -216,7 +254,8 @@ async function waitForGatewayHealthyRestart(params) {
216
254
  snapshot = await inspectGatewayRestart({
217
255
  service: params.service,
218
256
  port: params.port,
219
- env: params.env
257
+ env: params.env,
258
+ rpc: params.rpc
220
259
  });
221
260
  }
222
261
  return snapshot;
@@ -233,6 +272,7 @@ function renderRestartDiagnostics(snapshot) {
233
272
  if (snapshot.portUsage.status === "busy") lines.push(...formatPortDiagnostics(snapshot.portUsage));
234
273
  else lines.push(`Gateway port ${snapshot.portUsage.port} status: ${snapshot.portUsage.status}.`);
235
274
  if (snapshot.portUsage.errors?.length) lines.push(`Port diagnostics errors: ${snapshot.portUsage.errors.join("; ")}`);
275
+ if (snapshot.rpc && !snapshot.rpc.ok) lines.push(`Gateway RPC probe: failed${snapshot.rpc.error ? ` (${snapshot.rpc.error})` : ""}.`);
236
276
  return lines;
237
277
  }
238
278
  async function terminateStaleGatewayPids(pids) {
@@ -267,6 +307,23 @@ async function resolveGatewayRestartPort() {
267
307
  };
268
308
  return parsePortFromArgs(command?.programArguments) ?? resolveGatewayPort(loadConfig(), mergedEnv);
269
309
  }
310
+ async function resolveGatewayRestartRpc(port) {
311
+ const cfg = loadConfig();
312
+ const tlsRuntime = cfg.gateway?.tls?.enabled === true ? await loadGatewayTlsRuntime(cfg.gateway.tls) : void 0;
313
+ const scheme = tlsRuntime?.enabled ? "wss" : "ws";
314
+ const auth = resolveGatewayCredentialsFromConfig({
315
+ cfg,
316
+ env: process.env,
317
+ modeOverride: "local"
318
+ });
319
+ return {
320
+ url: `${scheme}://127.0.0.1:${port}`,
321
+ token: auth.token,
322
+ password: auth.password,
323
+ tlsFingerprint: tlsRuntime?.enabled ? tlsRuntime.fingerprintSha256 : void 0,
324
+ timeoutMs: 1500
325
+ };
326
+ }
270
327
  async function runDaemonUninstall(opts = {}) {
271
328
  return await runServiceUninstall({
272
329
  serviceNoun: "Gateway",
@@ -313,7 +370,8 @@ async function runDaemonRestart(opts = {}) {
313
370
  service,
314
371
  port: restartPort,
315
372
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
316
- delayMs: POST_RESTART_HEALTH_DELAY_MS
373
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
374
+ rpc: await resolveGatewayRestartRpc(restartPort)
317
375
  });
318
376
  if (!health.healthy && health.staleGatewayPids.length > 0) {
319
377
  const staleMsg = `Found stale gateway process(es): ${health.staleGatewayPids.join(", ")}.`;
@@ -331,7 +389,8 @@ async function runDaemonRestart(opts = {}) {
331
389
  service,
332
390
  port: restartPort,
333
391
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
334
- delayMs: POST_RESTART_HEALTH_DELAY_MS
392
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
393
+ rpc: await resolveGatewayRestartRpc(restartPort)
335
394
  });
336
395
  }
337
396
  if (health.healthy) return;
@@ -352,41 +411,21 @@ async function runDaemonRestart(opts = {}) {
352
411
  });
353
412
  }
354
413
 
355
- //#endregion
356
- //#region src/cli/daemon-cli/probe.ts
357
- async function probeGatewayStatus(opts) {
358
- try {
359
- await withProgress({
360
- label: "Checking gateway status...",
361
- indeterminate: true,
362
- enabled: opts.json !== true
363
- }, async () => await callGateway({
364
- url: opts.url,
365
- token: opts.token,
366
- password: opts.password,
367
- tlsFingerprint: opts.tlsFingerprint,
368
- method: "status",
369
- timeoutMs: opts.timeoutMs,
370
- clientName: GATEWAY_CLIENT_NAMES.CLI,
371
- mode: GATEWAY_CLIENT_MODES.CLI,
372
- ...opts.configPath ? { configPath: opts.configPath } : {}
373
- }));
374
- return { ok: true };
375
- } catch (err) {
376
- return {
377
- ok: false,
378
- error: err instanceof Error ? err.message : String(err)
379
- };
380
- }
381
- }
382
-
383
414
  //#endregion
384
415
  //#region src/cli/daemon-cli/status.gather.ts
385
- function shouldReportPortUsage(status, rpcOk) {
386
- if (status !== "busy") return false;
416
+ function shouldReportPortUsage(port, rpcOk, runtime) {
417
+ if (!port || port.status !== "busy") return false;
387
418
  if (rpcOk === true) return false;
419
+ if (isExpectedSingleGatewayListener(port, runtime)) return false;
388
420
  return true;
389
421
  }
422
+ function isExpectedSingleGatewayListener(port, runtime) {
423
+ if (!port || port.status !== "busy" || runtime?.status !== "running") return false;
424
+ if (port.listeners.length === 0) return false;
425
+ const gatewayListeners = port.listeners.filter((listener) => classifyPortListener(listener, port.port) === "gateway");
426
+ if (gatewayListeners.length !== port.listeners.length) return false;
427
+ return Array.from(new Set(gatewayListeners.map((listener) => listener.pid).filter((pid) => typeof pid === "number" && Number.isFinite(pid)))).length <= 1;
428
+ }
390
429
  async function gatherDaemonStatus(opts) {
391
430
  const service = resolveGatewayService();
392
431
  const [loaded, command, runtime] = await Promise.all([
@@ -511,7 +550,7 @@ async function gatherDaemonStatus(opts) {
511
550
  };
512
551
  }
513
552
  function renderPortDiagnosticsForCli(status, rpcOk) {
514
- if (!status.port || !shouldReportPortUsage(status.port.status, rpcOk)) return [];
553
+ if (!shouldReportPortUsage(status.port, rpcOk, status.service.runtime)) return [];
515
554
  return formatPortDiagnostics({
516
555
  port: status.port.port,
517
556
  status: status.port.status,
@@ -2,12 +2,12 @@ import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
2
  import { _ as resolveStateDir, d as resolveIsNixMode, o as resolveConfigPath, u as resolveGatewayPort } from "./paths-C9FmTW1x.js";
3
3
  import { E as sleep, H as isRich, K as getResolvedLoggerSettings, T as shortenHomePath, U as theme, V as colorize } from "./agent-paths-DmOVZE7g.js";
4
4
  import { Dn as loadConfig, En as createConfigIO, Mn as writeConfigFile, dd as formatCliCommand, kn as readConfigFileSnapshot, mf as GATEWAY_CLIENT_NAMES, pf as GATEWAY_CLIENT_MODES } from "./agent-scope-CrCe9L5D.js";
5
- import { Qt as resolveControlUiLinks, Zt as randomToken, lt as resolveGatewayAuth } from "./reply-DVGmtLPq.js";
5
+ import { Qt as resolveControlUiLinks, Zt as randomToken, lt as resolveGatewayAuth } from "./reply-jrONH9Y7.js";
6
6
  import { d as defaultRuntime } from "./errors-Dx3S3Nrp.js";
7
7
  import { f as inspectPortUsage, g as formatPortDiagnostics, h as classifyPortListener } from "./chrome-Bn66R9td.js";
8
8
  import { t as pickPrimaryTailnetIPv4 } from "./tailnet-CxIqR5zC.js";
9
9
  import { p as resolveGatewayBindHost } from "./ws-cvQhrVP3.js";
10
- import { n as callGateway, sr as loadGatewayTlsRuntime } from "./call-rH-qkwGN.js";
10
+ import { l as resolveGatewayCredentialsFromConfig, n as callGateway, sr as loadGatewayTlsRuntime } from "./call-rH-qkwGN.js";
11
11
  import { g as resolveGatewaySystemdServiceName, p as resolveGatewayLaunchAgentLabel } from "./constants-C2y93ya8.js";
12
12
  import { r as isWSLEnv } from "./wsl-Dk6WfABt.js";
13
13
  import { t as formatDocsLink } from "./links-7kxyNpcK.js";
@@ -148,6 +148,34 @@ async function runDaemonInstall(opts) {
148
148
  });
149
149
  }
150
150
 
151
+ //#endregion
152
+ //#region src/cli/daemon-cli/probe.ts
153
+ async function probeGatewayStatus(opts) {
154
+ try {
155
+ await withProgress({
156
+ label: "Checking gateway status...",
157
+ indeterminate: true,
158
+ enabled: opts.json !== true
159
+ }, async () => await callGateway({
160
+ url: opts.url,
161
+ token: opts.token,
162
+ password: opts.password,
163
+ tlsFingerprint: opts.tlsFingerprint,
164
+ method: "status",
165
+ timeoutMs: opts.timeoutMs,
166
+ clientName: GATEWAY_CLIENT_NAMES.CLI,
167
+ mode: GATEWAY_CLIENT_MODES.CLI,
168
+ ...opts.configPath ? { configPath: opts.configPath } : {}
169
+ }));
170
+ return { ok: true };
171
+ } catch (err) {
172
+ return {
173
+ ok: false,
174
+ error: err instanceof Error ? err.message : String(err)
175
+ };
176
+ }
177
+ }
178
+
151
179
  //#endregion
152
180
  //#region src/cli/daemon-cli/restart-health.ts
153
181
  const DEFAULT_RESTART_HEALTH_TIMEOUT_MS = 6e4;
@@ -186,7 +214,15 @@ async function inspectGatewayRestart(params) {
186
214
  listener,
187
215
  runtimePid
188
216
  })) : gatewayListeners.length > 0 || portUsage.status === "busy" && portUsage.listeners.length === 0;
189
- const healthy = running && ownsPort;
217
+ const rpc = running && ownsPort && params.rpc ? await probeGatewayStatus({
218
+ url: params.rpc.url,
219
+ token: params.rpc.token,
220
+ password: params.rpc.password,
221
+ tlsFingerprint: params.rpc.tlsFingerprint,
222
+ timeoutMs: params.rpc.timeoutMs,
223
+ json: true
224
+ }) : void 0;
225
+ const healthy = running && ownsPort && (rpc ? rpc.ok : true);
190
226
  const staleGatewayPids = Array.from(new Set(gatewayListeners.filter((listener) => Number.isFinite(listener.pid)).filter((listener) => {
191
227
  if (!running) return true;
192
228
  if (runtimePid == null) return true;
@@ -199,6 +235,7 @@ async function inspectGatewayRestart(params) {
199
235
  runtime,
200
236
  portUsage,
201
237
  healthy,
238
+ ...rpc ? { rpc } : {},
202
239
  staleGatewayPids
203
240
  };
204
241
  }
@@ -208,7 +245,8 @@ async function waitForGatewayHealthyRestart(params) {
208
245
  let snapshot = await inspectGatewayRestart({
209
246
  service: params.service,
210
247
  port: params.port,
211
- env: params.env
248
+ env: params.env,
249
+ rpc: params.rpc
212
250
  });
213
251
  for (let attempt = 0; attempt < attempts; attempt += 1) {
214
252
  if (snapshot.healthy) return snapshot;
@@ -217,7 +255,8 @@ async function waitForGatewayHealthyRestart(params) {
217
255
  snapshot = await inspectGatewayRestart({
218
256
  service: params.service,
219
257
  port: params.port,
220
- env: params.env
258
+ env: params.env,
259
+ rpc: params.rpc
221
260
  });
222
261
  }
223
262
  return snapshot;
@@ -234,6 +273,7 @@ function renderRestartDiagnostics(snapshot) {
234
273
  if (snapshot.portUsage.status === "busy") lines.push(...formatPortDiagnostics(snapshot.portUsage));
235
274
  else lines.push(`Gateway port ${snapshot.portUsage.port} status: ${snapshot.portUsage.status}.`);
236
275
  if (snapshot.portUsage.errors?.length) lines.push(`Port diagnostics errors: ${snapshot.portUsage.errors.join("; ")}`);
276
+ if (snapshot.rpc && !snapshot.rpc.ok) lines.push(`Gateway RPC probe: failed${snapshot.rpc.error ? ` (${snapshot.rpc.error})` : ""}.`);
237
277
  return lines;
238
278
  }
239
279
  async function terminateStaleGatewayPids(pids) {
@@ -268,6 +308,23 @@ async function resolveGatewayRestartPort() {
268
308
  };
269
309
  return parsePortFromArgs(command?.programArguments) ?? resolveGatewayPort(loadConfig(), mergedEnv);
270
310
  }
311
+ async function resolveGatewayRestartRpc(port) {
312
+ const cfg = loadConfig();
313
+ const tlsRuntime = cfg.gateway?.tls?.enabled === true ? await loadGatewayTlsRuntime(cfg.gateway.tls) : void 0;
314
+ const scheme = tlsRuntime?.enabled ? "wss" : "ws";
315
+ const auth = resolveGatewayCredentialsFromConfig({
316
+ cfg,
317
+ env: process.env,
318
+ modeOverride: "local"
319
+ });
320
+ return {
321
+ url: `${scheme}://127.0.0.1:${port}`,
322
+ token: auth.token,
323
+ password: auth.password,
324
+ tlsFingerprint: tlsRuntime?.enabled ? tlsRuntime.fingerprintSha256 : void 0,
325
+ timeoutMs: 1500
326
+ };
327
+ }
271
328
  async function runDaemonUninstall(opts = {}) {
272
329
  return await runServiceUninstall({
273
330
  serviceNoun: "Gateway",
@@ -314,7 +371,8 @@ async function runDaemonRestart(opts = {}) {
314
371
  service,
315
372
  port: restartPort,
316
373
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
317
- delayMs: POST_RESTART_HEALTH_DELAY_MS
374
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
375
+ rpc: await resolveGatewayRestartRpc(restartPort)
318
376
  });
319
377
  if (!health.healthy && health.staleGatewayPids.length > 0) {
320
378
  const staleMsg = `Found stale gateway process(es): ${health.staleGatewayPids.join(", ")}.`;
@@ -332,7 +390,8 @@ async function runDaemonRestart(opts = {}) {
332
390
  service,
333
391
  port: restartPort,
334
392
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
335
- delayMs: POST_RESTART_HEALTH_DELAY_MS
393
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
394
+ rpc: await resolveGatewayRestartRpc(restartPort)
336
395
  });
337
396
  }
338
397
  if (health.healthy) return;
@@ -353,41 +412,21 @@ async function runDaemonRestart(opts = {}) {
353
412
  });
354
413
  }
355
414
 
356
- //#endregion
357
- //#region src/cli/daemon-cli/probe.ts
358
- async function probeGatewayStatus(opts) {
359
- try {
360
- await withProgress({
361
- label: "Checking gateway status...",
362
- indeterminate: true,
363
- enabled: opts.json !== true
364
- }, async () => await callGateway({
365
- url: opts.url,
366
- token: opts.token,
367
- password: opts.password,
368
- tlsFingerprint: opts.tlsFingerprint,
369
- method: "status",
370
- timeoutMs: opts.timeoutMs,
371
- clientName: GATEWAY_CLIENT_NAMES.CLI,
372
- mode: GATEWAY_CLIENT_MODES.CLI,
373
- ...opts.configPath ? { configPath: opts.configPath } : {}
374
- }));
375
- return { ok: true };
376
- } catch (err) {
377
- return {
378
- ok: false,
379
- error: err instanceof Error ? err.message : String(err)
380
- };
381
- }
382
- }
383
-
384
415
  //#endregion
385
416
  //#region src/cli/daemon-cli/status.gather.ts
386
- function shouldReportPortUsage(status, rpcOk) {
387
- if (status !== "busy") return false;
417
+ function shouldReportPortUsage(port, rpcOk, runtime) {
418
+ if (!port || port.status !== "busy") return false;
388
419
  if (rpcOk === true) return false;
420
+ if (isExpectedSingleGatewayListener(port, runtime)) return false;
389
421
  return true;
390
422
  }
423
+ function isExpectedSingleGatewayListener(port, runtime) {
424
+ if (!port || port.status !== "busy" || runtime?.status !== "running") return false;
425
+ if (port.listeners.length === 0) return false;
426
+ const gatewayListeners = port.listeners.filter((listener) => classifyPortListener(listener, port.port) === "gateway");
427
+ if (gatewayListeners.length !== port.listeners.length) return false;
428
+ return Array.from(new Set(gatewayListeners.map((listener) => listener.pid).filter((pid) => typeof pid === "number" && Number.isFinite(pid)))).length <= 1;
429
+ }
391
430
  async function gatherDaemonStatus(opts) {
392
431
  const service = resolveGatewayService();
393
432
  const [loaded, command, runtime] = await Promise.all([
@@ -512,7 +551,7 @@ async function gatherDaemonStatus(opts) {
512
551
  };
513
552
  }
514
553
  function renderPortDiagnosticsForCli(status, rpcOk) {
515
- if (!status.port || !shouldReportPortUsage(status.port.status, rpcOk)) return [];
554
+ if (!shouldReportPortUsage(status.port, rpcOk, status.service.runtime)) return [];
516
555
  return formatPortDiagnostics({
517
556
  port: status.port.port,
518
557
  status: status.port.status,
@@ -1,6 +1,6 @@
1
1
  import { l as resolveGatewayPort, p as resolveStateDir, s as resolveConfigPath, u as resolveIsNixMode } from "./github-copilot-token-Dy7Y_jbI.js";
2
2
  import { Ct as writeConfigFile, Fs as theme, Go as isSupportedNodeVersion, Ls as getResolvedLoggerSettings, Ns as colorize, Ps as isRich, Qa as GATEWAY_CLIENT_NAMES, Wo as VERSION, Za as GATEWAY_CLIENT_MODES, Zo as collectConfigServiceEnvVars, _t as createConfigIO, bs as shortenHomePath, bt as readConfigFileSnapshot, ns as formatCliCommand, qo as defaultRuntime, vt as loadConfig, xs as sleep } from "./paths-CfLHb30A.js";
3
- import { Ct as formatDocsLink, St as resolveLegacyGatewayLaunchAgentLabels, _t as resolveGatewayLaunchAgentLabel, bt as resolveGatewaySystemdServiceName, dt as callGateway, ft as resolveGatewayCredentialsFromConfig, gt as GATEWAY_SERVICE_MARKER, ht as GATEWAY_SERVICE_KIND, lt as randomToken, mt as GATEWAY_LAUNCH_AGENT_LABEL, pt as loadGatewayTlsRuntime, t as resolveGatewayAuth, ut as resolveControlUiLinks, vt as resolveGatewayProfileSuffix, xt as resolveGatewayWindowsTaskName, y as withProgress, yt as resolveGatewayServiceDescription } from "./auth-DGXGqcN7.js";
3
+ import { Ct as formatDocsLink, St as resolveLegacyGatewayLaunchAgentLabels, _t as resolveGatewayLaunchAgentLabel, bt as resolveGatewaySystemdServiceName, dt as callGateway, ft as resolveGatewayCredentialsFromConfig, gt as GATEWAY_SERVICE_MARKER, ht as GATEWAY_SERVICE_KIND, lt as randomToken, mt as GATEWAY_LAUNCH_AGENT_LABEL, pt as loadGatewayTlsRuntime, t as resolveGatewayAuth, ut as resolveControlUiLinks, vt as resolveGatewayProfileSuffix, xt as resolveGatewayWindowsTaskName, y as withProgress, yt as resolveGatewayServiceDescription } from "./auth-miYdUxcO.js";
4
4
  import "./send-CATaWrzb.js";
5
5
  import "./send-Dh1OzXJR.js";
6
6
  import "./skill-commands-DrPVL-fM.js";
@@ -2612,6 +2612,34 @@ async function runServiceRestart(params) {
2612
2612
  }
2613
2613
  }
2614
2614
 
2615
+ //#endregion
2616
+ //#region src/cli/daemon-cli/probe.ts
2617
+ async function probeGatewayStatus(opts) {
2618
+ try {
2619
+ await withProgress({
2620
+ label: "Checking gateway status...",
2621
+ indeterminate: true,
2622
+ enabled: opts.json !== true
2623
+ }, async () => await callGateway({
2624
+ url: opts.url,
2625
+ token: opts.token,
2626
+ password: opts.password,
2627
+ tlsFingerprint: opts.tlsFingerprint,
2628
+ method: "status",
2629
+ timeoutMs: opts.timeoutMs,
2630
+ clientName: GATEWAY_CLIENT_NAMES.CLI,
2631
+ mode: GATEWAY_CLIENT_MODES.CLI,
2632
+ ...opts.configPath ? { configPath: opts.configPath } : {}
2633
+ }));
2634
+ return { ok: true };
2635
+ } catch (err) {
2636
+ return {
2637
+ ok: false,
2638
+ error: err instanceof Error ? err.message : String(err)
2639
+ };
2640
+ }
2641
+ }
2642
+
2615
2643
  //#endregion
2616
2644
  //#region src/cli/daemon-cli/restart-health.ts
2617
2645
  const DEFAULT_RESTART_HEALTH_TIMEOUT_MS = 6e4;
@@ -2650,7 +2678,15 @@ async function inspectGatewayRestart(params) {
2650
2678
  listener,
2651
2679
  runtimePid
2652
2680
  })) : gatewayListeners.length > 0 || portUsage.status === "busy" && portUsage.listeners.length === 0;
2653
- const healthy = running && ownsPort;
2681
+ const rpc = running && ownsPort && params.rpc ? await probeGatewayStatus({
2682
+ url: params.rpc.url,
2683
+ token: params.rpc.token,
2684
+ password: params.rpc.password,
2685
+ tlsFingerprint: params.rpc.tlsFingerprint,
2686
+ timeoutMs: params.rpc.timeoutMs,
2687
+ json: true
2688
+ }) : void 0;
2689
+ const healthy = running && ownsPort && (rpc ? rpc.ok : true);
2654
2690
  const staleGatewayPids = Array.from(new Set(gatewayListeners.filter((listener) => Number.isFinite(listener.pid)).filter((listener) => {
2655
2691
  if (!running) return true;
2656
2692
  if (runtimePid == null) return true;
@@ -2663,6 +2699,7 @@ async function inspectGatewayRestart(params) {
2663
2699
  runtime,
2664
2700
  portUsage,
2665
2701
  healthy,
2702
+ ...rpc ? { rpc } : {},
2666
2703
  staleGatewayPids
2667
2704
  };
2668
2705
  }
@@ -2672,7 +2709,8 @@ async function waitForGatewayHealthyRestart(params) {
2672
2709
  let snapshot = await inspectGatewayRestart({
2673
2710
  service: params.service,
2674
2711
  port: params.port,
2675
- env: params.env
2712
+ env: params.env,
2713
+ rpc: params.rpc
2676
2714
  });
2677
2715
  for (let attempt = 0; attempt < attempts; attempt += 1) {
2678
2716
  if (snapshot.healthy) return snapshot;
@@ -2681,7 +2719,8 @@ async function waitForGatewayHealthyRestart(params) {
2681
2719
  snapshot = await inspectGatewayRestart({
2682
2720
  service: params.service,
2683
2721
  port: params.port,
2684
- env: params.env
2722
+ env: params.env,
2723
+ rpc: params.rpc
2685
2724
  });
2686
2725
  }
2687
2726
  return snapshot;
@@ -2698,6 +2737,7 @@ function renderRestartDiagnostics(snapshot) {
2698
2737
  if (snapshot.portUsage.status === "busy") lines.push(...formatPortDiagnostics(snapshot.portUsage));
2699
2738
  else lines.push(`Gateway port ${snapshot.portUsage.port} status: ${snapshot.portUsage.status}.`);
2700
2739
  if (snapshot.portUsage.errors?.length) lines.push(`Port diagnostics errors: ${snapshot.portUsage.errors.join("; ")}`);
2740
+ if (snapshot.rpc && !snapshot.rpc.ok) lines.push(`Gateway RPC probe: failed${snapshot.rpc.error ? ` (${snapshot.rpc.error})` : ""}.`);
2701
2741
  return lines;
2702
2742
  }
2703
2743
  async function terminateStaleGatewayPids(pids) {
@@ -2732,6 +2772,23 @@ async function resolveGatewayRestartPort() {
2732
2772
  };
2733
2773
  return parsePortFromArgs(command?.programArguments) ?? resolveGatewayPort(loadConfig(), mergedEnv);
2734
2774
  }
2775
+ async function resolveGatewayRestartRpc(port) {
2776
+ const cfg = loadConfig();
2777
+ const tlsRuntime = cfg.gateway?.tls?.enabled === true ? await loadGatewayTlsRuntime(cfg.gateway.tls) : void 0;
2778
+ const scheme = tlsRuntime?.enabled ? "wss" : "ws";
2779
+ const auth = resolveGatewayCredentialsFromConfig({
2780
+ cfg,
2781
+ env: process.env,
2782
+ modeOverride: "local"
2783
+ });
2784
+ return {
2785
+ url: `${scheme}://127.0.0.1:${port}`,
2786
+ token: auth.token,
2787
+ password: auth.password,
2788
+ tlsFingerprint: tlsRuntime?.enabled ? tlsRuntime.fingerprintSha256 : void 0,
2789
+ timeoutMs: 1500
2790
+ };
2791
+ }
2735
2792
  async function runDaemonUninstall(opts = {}) {
2736
2793
  return await runServiceUninstall({
2737
2794
  serviceNoun: "Gateway",
@@ -2778,7 +2835,8 @@ async function runDaemonRestart(opts = {}) {
2778
2835
  service,
2779
2836
  port: restartPort,
2780
2837
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
2781
- delayMs: POST_RESTART_HEALTH_DELAY_MS
2838
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
2839
+ rpc: await resolveGatewayRestartRpc(restartPort)
2782
2840
  });
2783
2841
  if (!health.healthy && health.staleGatewayPids.length > 0) {
2784
2842
  const staleMsg = `Found stale gateway process(es): ${health.staleGatewayPids.join(", ")}.`;
@@ -2796,7 +2854,8 @@ async function runDaemonRestart(opts = {}) {
2796
2854
  service,
2797
2855
  port: restartPort,
2798
2856
  attempts: POST_RESTART_HEALTH_ATTEMPTS,
2799
- delayMs: POST_RESTART_HEALTH_DELAY_MS
2857
+ delayMs: POST_RESTART_HEALTH_DELAY_MS,
2858
+ rpc: await resolveGatewayRestartRpc(restartPort)
2800
2859
  });
2801
2860
  }
2802
2861
  if (health.healthy) return;
@@ -3109,41 +3168,21 @@ async function findExtraGatewayServices(env, opts = {}) {
3109
3168
  return results;
3110
3169
  }
3111
3170
 
3112
- //#endregion
3113
- //#region src/cli/daemon-cli/probe.ts
3114
- async function probeGatewayStatus(opts) {
3115
- try {
3116
- await withProgress({
3117
- label: "Checking gateway status...",
3118
- indeterminate: true,
3119
- enabled: opts.json !== true
3120
- }, async () => await callGateway({
3121
- url: opts.url,
3122
- token: opts.token,
3123
- password: opts.password,
3124
- tlsFingerprint: opts.tlsFingerprint,
3125
- method: "status",
3126
- timeoutMs: opts.timeoutMs,
3127
- clientName: GATEWAY_CLIENT_NAMES.CLI,
3128
- mode: GATEWAY_CLIENT_MODES.CLI,
3129
- ...opts.configPath ? { configPath: opts.configPath } : {}
3130
- }));
3131
- return { ok: true };
3132
- } catch (err) {
3133
- return {
3134
- ok: false,
3135
- error: err instanceof Error ? err.message : String(err)
3136
- };
3137
- }
3138
- }
3139
-
3140
3171
  //#endregion
3141
3172
  //#region src/cli/daemon-cli/status.gather.ts
3142
- function shouldReportPortUsage(status, rpcOk) {
3143
- if (status !== "busy") return false;
3173
+ function shouldReportPortUsage(port, rpcOk, runtime) {
3174
+ if (!port || port.status !== "busy") return false;
3144
3175
  if (rpcOk === true) return false;
3176
+ if (isExpectedSingleGatewayListener(port, runtime)) return false;
3145
3177
  return true;
3146
3178
  }
3179
+ function isExpectedSingleGatewayListener(port, runtime) {
3180
+ if (!port || port.status !== "busy" || runtime?.status !== "running") return false;
3181
+ if (port.listeners.length === 0) return false;
3182
+ const gatewayListeners = port.listeners.filter((listener) => classifyPortListener(listener, port.port) === "gateway");
3183
+ if (gatewayListeners.length !== port.listeners.length) return false;
3184
+ return Array.from(new Set(gatewayListeners.map((listener) => listener.pid).filter((pid) => typeof pid === "number" && Number.isFinite(pid)))).length <= 1;
3185
+ }
3147
3186
  async function gatherDaemonStatus(opts) {
3148
3187
  const service = resolveGatewayService();
3149
3188
  const [loaded, command, runtime] = await Promise.all([
@@ -3268,7 +3307,7 @@ async function gatherDaemonStatus(opts) {
3268
3307
  };
3269
3308
  }
3270
3309
  function renderPortDiagnosticsForCli(status, rpcOk) {
3271
- if (!status.port || !shouldReportPortUsage(status.port.status, rpcOk)) return [];
3310
+ if (!shouldReportPortUsage(status.port, rpcOk, status.service.runtime)) return [];
3272
3311
  return formatPortDiagnostics({
3273
3312
  port: status.port.port,
3274
3313
  status: status.port.status,
@@ -23,7 +23,7 @@ var deps_exports = /* @__PURE__ */ __exportAll({
23
23
  function createDefaultDeps() {
24
24
  return {
25
25
  sendMessageWhatsApp: async (...args) => {
26
- const { sendMessageWhatsApp } = await import("./web-B2SWpLdC.js");
26
+ const { sendMessageWhatsApp } = await import("./web-_igiL4AE.js");
27
27
  return await sendMessageWhatsApp(...args);
28
28
  },
29
29
  sendMessageTelegram: async (...args) => {
@@ -23,7 +23,7 @@ var deps_exports = /* @__PURE__ */ __exportAll({
23
23
  function createDefaultDeps() {
24
24
  return {
25
25
  sendMessageWhatsApp: async (...args) => {
26
- const { sendMessageWhatsApp } = await import("./web-D8bq1XRX.js");
26
+ const { sendMessageWhatsApp } = await import("./web-D-gMdQkD.js");
27
27
  return await sendMessageWhatsApp(...args);
28
28
  },
29
29
  sendMessageTelegram: async (...args) => {
package/dist/entry.js CHANGED
@@ -1671,7 +1671,7 @@ if (!isMainModule({
1671
1671
  applyCliProfileEnv({ profile: parsed.profile });
1672
1672
  process$1.argv = parsed.argv;
1673
1673
  }
1674
- import("./run-main-BqiU1shU.js").then(({ runCli }) => runCli(process$1.argv)).catch((error) => {
1674
+ import("./run-main-C6XcZlLi.js").then(({ runCli }) => runCli(process$1.argv)).catch((error) => {
1675
1675
  console.error("[fased] Failed to start CLI:", formatUncaughtError(error));
1676
1676
  process$1.exitCode = 1;
1677
1677
  });
@@ -2,7 +2,7 @@ import { Pt as resolveSessionFilePath, Rt as resolveStorePath, S as ensureAgentW
2
2
  import "./github-copilot-token-CNsqwfnE.js";
3
3
  import "./send-BL6uivCv.js";
4
4
  import "./send-BRzujRf3.js";
5
- import { $ as resolveAgentTimeoutMs, t as runEmbeddedPiAgent } from "./pi-embedded-DPl5Aqw4.js";
5
+ import { $ as resolveAgentTimeoutMs, t as runEmbeddedPiAgent } from "./pi-embedded-YWZsPSdf.js";
6
6
  import { a as resolveAgentIdentity } from "./reply-prefix-Dtgue6NM.js";
7
7
  import "./diagnostic-IcOSmaHW.js";
8
8
  import "./diagnostic-session-state-CL_QxyRg.js";