@fased/fased 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{agents-BU4NqZkn.js → agents-C9M0l-z1.js} +8 -8
- package/dist/{attachment-normalize-D3LvGnxE.js → attachment-normalize-3SG3lsyA.js} +1 -1
- package/dist/{attachment-normalize-3_V1yb6a.js → attachment-normalize-B9DOGvsN.js} +1 -1
- package/dist/{audio-preflight-B4hZi0X5.js → audio-preflight-1Adp2U4P.js} +1 -1
- package/dist/{audio-preflight-MUfVeIPT.js → audio-preflight-BJWtQuva.js} +1 -1
- package/dist/{audio-preflight-r8PHFHTe.js → audio-preflight-CBCOUaBS.js} +2 -2
- package/dist/{audio-preflight-DcQrkXYr.js → audio-preflight-Sv6kC6zq.js} +2 -2
- package/dist/{audio-preflight-YPQKo93v.js → audio-preflight-Yh7ePF_K.js} +2 -2
- package/dist/{audit-BNmzld5I.js → audit--bs_HZI7.js} +1 -1
- package/dist/{audit-ChF16w3M.js → audit-BxY0dXjF.js} +1 -1
- package/dist/{auth-DGXGqcN7.js → auth-CVGoBFRu.js} +5 -5
- package/dist/{auth-choice-UvbBnRhr.js → auth-choice-DJCkgrZf.js} +1 -1
- package/dist/{auth-choice-BJGGTOYU.js → auth-choice-hqc8badr.js} +1 -1
- package/dist/{auth-choice-prompt-CPoTg_-G.js → auth-choice-prompt-CgKsstJp.js} +1 -1
- package/dist/{auth-choice-prompt-9uH2hSjM.js → auth-choice-prompt-ClC1AQ5S.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-web-0wKGD4yD.js → channel-web-9RWLChjo.js} +1 -1
- package/dist/{channel-web-DLD1undh.js → channel-web-KMOLb33A.js} +1 -1
- package/dist/{channels-CBT56Ap7.js → channels-Bi578Scw.js} +6 -6
- package/dist/{channels-B9bvlD7y.js → channels-DG-P9Wz_.js} +6 -6
- package/dist/{channels-cli-CK1qojpR.js → channels-cli-3nP8aA1E.js} +5 -5
- package/dist/{channels-cli-D6ioLe8o.js → channels-cli-CeXjvyug.js} +5 -5
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-DgHb9Vld.js → cli-BHwta9zB.js} +2 -2
- package/dist/{cli-ByaZFcQl.js → cli-DttJMqPU.js} +2 -2
- package/dist/{command-registry-mptWJW8S.js → command-registry-BIpl_FuJ.js} +9 -9
- package/dist/{completion-cli-DyJbXhbh.js → completion-cli-Brs6d9Ck.js} +1 -1
- package/dist/{completion-cli-BRvgVQzN.js → completion-cli-Py4BkrSJ.js} +2 -2
- package/dist/{config-cli-R0TQZDi7.js → config-cli-BP4JMXEu.js} +1 -1
- package/dist/{config-cli-BrzPOli4.js → config-cli-RTgToPyL.js} +1 -1
- package/dist/{configure-Bt3nH-_I.js → configure-BPYADl2J.js} +12 -12
- package/dist/{configure-pREf12zB.js → configure-BpyrX7AX.js} +12 -12
- package/dist/control-ui/assets/app-DXYMrRJ9.js.map +1 -1
- package/dist/{cron-cli-zdoRLQ0m.js → cron-cli-Bqnyia9D.js} +2 -2
- package/dist/{cron-cli-BIYfBpRP.js → cron-cli-DG6UhqGh.js} +2 -2
- package/dist/{daemon-cli-LLGP6g2r.js → daemon-cli-DRZAW920.js} +77 -38
- package/dist/{daemon-cli-Cj4_RgEM.js → daemon-cli-DvUDSwZ6.js} +77 -38
- package/dist/daemon-cli.js +76 -37
- package/dist/{deps-QnUngXA3.js → deps-BXD31H9r.js} +1 -1
- package/dist/{deps-sd-SQKYn.js → deps-Dt_C-sk6.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +2 -2
- package/dist/{gateway-cli-yfNsUzH6.js → gateway-cli-B3ZBpI5b.js} +27 -27
- package/dist/{gateway-cli-Cn3STpYX.js → gateway-cli-B9Jega1W.js} +27 -27
- package/dist/{health-DcurJYny.js → health-B6CuVELf.js} +2 -2
- package/dist/{health-BfGnSyOV.js → health-Cpjz51iq.js} +2 -2
- package/dist/{heartbeat-runner-CJZStXhx.js → heartbeat-runner-CFHCjrD6.js} +1 -1
- package/dist/{heartbeat-runner-CY41VFZE.js → heartbeat-runner-DlGg8a6p.js} +1 -1
- package/dist/{hooks-cli-DpkFISKR.js → hooks-cli-BoS2R5LX.js} +3 -3
- package/dist/{hooks-cli-WtC65axA.js → hooks-cli-C4M9e4gp.js} +3 -3
- package/dist/index.js +7 -7
- package/dist/{ipv4-BkY__Z0A.js → ipv4-Kk3Gdn9X.js} +2 -2
- package/dist/{ipv4-CdRPraPM.js → ipv4-yW-iu9Dm.js} +2 -2
- package/dist/{lifecycle-Dd-6tFQk.js → lifecycle-BEBEHpWI.js} +1 -1
- package/dist/{lifecycle-DUPuKIvd.js → lifecycle-Bi6-UGGr.js} +1 -1
- package/dist/{list.auth-overview-DcdJySBi.js → list.auth-overview-C3kBef3h.js} +1 -1
- package/dist/{list.auth-overview-CE2_GQ-8.js → list.auth-overview-DC6xetIm.js} +1 -1
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{model-catalog-DOuyqwFa.js → model-catalog-DLnvfoWK.js} +6 -6
- package/dist/{models-ItVo4_FF.js → models-CQ58ONbA.js} +4 -4
- package/dist/{models-cli-DKEzhF9X.js → models-cli-CsRw9XQ1.js} +4 -4
- package/dist/{models-cli-YznPWFUE.js → models-cli-DvfsgPZn.js} +5 -5
- package/dist/{node-cli-qkHTKDmW.js → node-cli-DCSFpsVH.js} +2 -2
- package/dist/{node-cli-CZaJUGYu.js → node-cli-DPJxGekE.js} +2 -2
- package/dist/{onboard-Cpw2fP2S.js → onboard-C_qD227j.js} +6 -6
- package/dist/{onboard--COJdfXc.js → onboard-M91tr58T.js} +6 -6
- package/dist/{onboard-channels-CbQgdo3k.js → onboard-channels-BRP2FtwH.js} +2 -2
- package/dist/{onboard-channels-BH6atgy1.js → onboard-channels-DVVeTmrM.js} +2 -2
- package/dist/{onboard-search-Bg8qvHBV.js → onboard-search-D78hzR7X.js} +5 -5
- package/dist/{onboard-search-BxaAdq5U.js → onboard-search-DDXa6Rib.js} +5 -5
- package/dist/{onboarding-B-_4gKpN.js → onboarding-DnFHAoNE.js} +7 -7
- package/dist/{onboarding-DiuUZg9l.js → onboarding-pZ1Jf-8h.js} +7 -7
- package/dist/{openresponses-http-DhBER2sI.js → openresponses-http-BS1_d3jR.js} +2 -2
- package/dist/{openresponses-http-svQwMBaq.js → openresponses-http-CrUE4VRC.js} +1 -1
- package/dist/{openresponses-http-BNIAyGrH.js → openresponses-http-DXlow5DU.js} +1 -1
- package/dist/{openresponses-http-DGAqU5K9.js → openresponses-http-ERMucVeO.js} +2 -2
- package/dist/{openresponses-http-BVdja8Nj.js → openresponses-http-xQEkEQ6X.js} +2 -2
- package/dist/{parent-default-help-DUqMyqko.js → parent-default-help-DAqwrXLF.js} +1 -1
- package/dist/{parent-default-help-B2mCEhav.js → parent-default-help-DcHwWRVG.js} +1 -1
- package/dist/{paths-DGN5lNb7.js → paths-6Y-iET7k.js} +9 -9
- package/dist/{pi-embedded-DPl5Aqw4.js → pi-embedded-D48hcJCt.js} +14 -14
- package/dist/{pi-embedded-CrKlYvWM.js → pi-embedded-DI_Xhl4J.js} +5 -5
- package/dist/{plugin-registry-CIiRwpQv.js → plugin-registry-DfMTZHnU.js} +1 -1
- package/dist/{plugin-registry-BBzitaxQ.js → plugin-registry-UQgZaIGL.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-B-__-RfZ.js → audio-preflight-BgMMXymt.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-DcJUk03P.js → audio-preflight-CV14wEHo.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.js +1 -1
- package/dist/plugin-sdk/{channel-web-DoGtD0PQ.js → channel-web-CH4KDsdG.js} +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/{openresponses-http-VFgg_bR4.js → openresponses-http-Czb4I2s-.js} +1 -1
- package/dist/plugin-sdk/{openresponses-http-DQWJE95u.js → openresponses-http-hm0xMbb1.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-CwXjrUIM.js → pi-model-discovery-runtime-DaiqegxK.js} +1 -1
- package/dist/plugin-sdk/{registry-C90cYLNB.js → registry-D1bAj51G.js} +8 -8
- package/dist/plugin-sdk/{reply-D4WNXysa.js → reply-39uSimjr.js} +5 -5
- package/dist/plugin-sdk/src/brand.d.ts +2 -2
- package/dist/plugin-sdk/{status-BlX9jStp.js → status-CYUhk0OD.js} +5 -5
- package/dist/plugin-sdk/{web-CEucw6Dl.js → web-DfmRaZxe.js} +1 -1
- package/dist/plugin-sdk/{web-Cr8AJx43.js → web-yZlgHxrL.js} +2 -2
- package/dist/{plugins-cli-B9w9SKYa.js → plugins-cli-Cqv8gBQ_.js} +5 -5
- package/dist/{plugins-cli-CdRa6xYi.js → plugins-cli-Cxz8wBrW.js} +5 -5
- package/dist/{program-C9wZbb_-.js → program-DDIesooR.js} +7 -7
- package/dist/{program-context-Dc8hoANx.js → program-context-CKYkefXE.js} +24 -24
- package/dist/{prompt-select-styled-9E7HlPjk.js → prompt-select-styled-D93sCpQh.js} +4 -4
- package/dist/{prompt-select-styled-oUCALY2N.js → prompt-select-styled-Dd9UMH0Y.js} +4 -4
- package/dist/{pw-ai-BaQ88hEN.js → pw-ai-DuNzIjgi.js} +1 -1
- package/dist/{register.agent-Dty2GQos.js → register.agent-4-it81L8.js} +9 -9
- package/dist/{register.agent-BhoMAqJe.js → register.agent-DIhN_kWa.js} +8 -8
- package/dist/{register.configure-CjQhBudl.js → register.configure-DZxKoDN3.js} +12 -12
- package/dist/{register.configure-DZl7w5Se.js → register.configure-qhI-P_oT.js} +12 -12
- package/dist/{register.maintenance-CGFQEESj.js → register.maintenance-BBQxyCpV.js} +9 -9
- package/dist/{register.maintenance-C9_UzTyI.js → register.maintenance-CLxGWk1C.js} +8 -8
- package/dist/{register.message-DnrC31ZC.js → register.message-Ch9NwFdM.js} +3 -3
- package/dist/{register.message-C3BTjmhg.js → register.message-DzMOXDgp.js} +3 -3
- package/dist/{register.onboard-DIxJ1bFs.js → register.onboard-BLBtWu3F.js} +14 -14
- package/dist/{register.onboard-DzO2dNpB.js → register.onboard-RgmG_vgu.js} +14 -14
- package/dist/{register.setup-B5Ji_Smo.js → register.setup-BVF84fkF.js} +14 -14
- package/dist/{register.setup-Cd8rXata.js → register.setup-CN1g2RMt.js} +14 -14
- package/dist/{register.status-health-sessions-CUw6awJ6.js → register.status-health-sessions-BU39-o9s.js} +6 -6
- package/dist/{register.status-health-sessions-CYpKmq3y.js → register.status-health-sessions-DQ-6ktbI.js} +6 -6
- package/dist/{register.subclis-DEnba1hq.js → register.subclis-CjN7kBwT.js} +16 -16
- package/dist/{reply-DVGmtLPq.js → reply-CScH11Id.js} +6 -6
- package/dist/{run-main-BqiU1shU.js → run-main-BNanbHOO.js} +14 -14
- package/dist/{runtime-helper-grants-BQl2Y_KJ.js → runtime-helper-grants-C79-aB7A.js} +1 -1
- package/dist/{runtime-helper-grants-CHz5azhO.js → runtime-helper-grants-DuYqyaEM.js} +1 -1
- package/dist/{sandbox-cli-BLWfhZh2.js → sandbox-cli-B4TQGwK3.js} +2 -2
- package/dist/{sandbox-cli-C7tRjHGl.js → sandbox-cli-wb8XfktJ.js} +2 -2
- package/dist/{security-cli-DGCfCHzM.js → security-cli-B0ixaJVQ.js} +3 -3
- package/dist/{security-cli-0-5Vgk1A.js → security-cli-DDqvUdxu.js} +3 -3
- package/dist/{server-BMZYE37o.js → server-DDClE1d0.js} +2 -2
- package/dist/{server-cron-BUWyjpTV.js → server-cron-BS1jgNEy.js} +2 -2
- package/dist/{server-cron-DC9t05LU.js → server-cron-CHqqCpAF.js} +2 -2
- package/dist/{server-node-events-cusaGrcY.js → server-node-events-CGz55vsP.js} +3 -3
- package/dist/{server-node-events-C3IOxSF_.js → server-node-events-DfodVK1X.js} +3 -3
- package/dist/{server-DamsmTjm.js → server-pdfJmWak.js} +2 -2
- package/dist/{status-Dlt3xwcf.js → status-6cMXaS3e.js} +4 -4
- package/dist/{status-B39ZJFhD.js → status-B5Csdh6E.js} +1 -1
- package/dist/{status-CrL7Hp3R.js → status-D_s8CjtO.js} +4 -4
- package/dist/{status-Doqt5wXN.js → status-DxDA2XqP.js} +1 -1
- package/dist/{tui-R-P_OV8J.js → tui-BgAtpZvX.js} +1 -1
- package/dist/{tui-DdPEVWjR.js → tui-BtBJfsoD.js} +1 -1
- package/dist/{tui-cli-BgihXvs7.js → tui-cli-B2uAW1Tv.js} +3 -3
- package/dist/{tui-cli-ChpP9FsL.js → tui-cli-Be08Tr3T.js} +3 -3
- package/dist/{update-cli-DVCjSLYw.js → update-cli-BI1HyhJx.js} +10 -10
- package/dist/{update-cli-DPdSuHZT.js → update-cli-ess-i7v6.js} +9 -9
- package/dist/{update-runner-COs-YDhT.js → update-runner-B7b7XcMo.js} +1 -1
- package/dist/{update-runner-DNPfs265.js → update-runner-CKHb5ESG.js} +1 -1
- package/dist/{web-DQuQBwMr.js → web-B2eQm9c2.js} +1 -1
- package/dist/{web-B2SWpLdC.js → web-BwUlZfNk.js} +3 -3
- package/dist/{web-D8bq1XRX.js → web-ChCVQYdV.js} +3 -3
- package/dist/{web-BHp_2XHP.js → web-CrHcxt5v.js} +1 -1
- package/dist/{web-vGE7qeF-.js → web-DklUb8i3.js} +2 -2
- package/dist/{web-search-providers.runtime-BD9Vp8eD.js → web-search-providers.runtime-_BRMKUlp.js} +1 -1
- package/dist/{web-search-providers.runtime-CiOoq6G3.js → web-search-providers.runtime-xPoF2gKl.js} +1 -1
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +12 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/src/brand.ts +1 -1
- package/src/canvas-host/a2ui/.bundle.hash +1 -1
- package/src/cli/daemon-cli/lifecycle.ts +23 -0
- package/src/cli/daemon-cli/probe.ts +2 -2
- package/src/cli/daemon-cli/restart-health.ts +37 -1
- package/src/cli/daemon-cli/status.gather.ts +37 -3
|
@@ -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-
|
|
1844
|
-
import("./server-cron-
|
|
1843
|
+
import("./deps-Dt_C-sk6.js").then((n) => n.r),
|
|
1844
|
+
import("./server-cron-CHqqCpAF.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);
|
|
@@ -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-
|
|
1841
|
-
import("./server-cron-
|
|
1840
|
+
import("./deps-BXD31H9r.js").then((n) => n.r),
|
|
1841
|
+
import("./server-cron-BS1jgNEy.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);
|
|
@@ -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-
|
|
4
|
+
import { E as resolveControlUiLinks, T as randomToken, Vn as resolveGatewayAuth } from "./model-catalog-DLnvfoWK.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 health...",
|
|
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: "health",
|
|
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
|
|
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(
|
|
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
|
|
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-
|
|
5
|
+
import { Qt as resolveControlUiLinks, Zt as randomToken, lt as resolveGatewayAuth } from "./reply-CScH11Id.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 health...",
|
|
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: "health",
|
|
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
|
|
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(
|
|
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
|
|
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,
|
package/dist/daemon-cli.js
CHANGED
|
@@ -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-
|
|
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-CVGoBFRu.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 health...",
|
|
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: "health",
|
|
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
|
|
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(
|
|
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
|
|
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-
|
|
26
|
+
const { sendMessageWhatsApp } = await import("./web-ChCVQYdV.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-
|
|
26
|
+
const { sendMessageWhatsApp } = await import("./web-BwUlZfNk.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-
|
|
1674
|
+
import("./run-main-BNanbHOO.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
|
});
|
package/dist/extensionAPI.js
CHANGED
|
@@ -2,14 +2,14 @@ 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-
|
|
5
|
+
import { $ as resolveAgentTimeoutMs, t as runEmbeddedPiAgent } from "./pi-embedded-D48hcJCt.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";
|
|
9
9
|
import "./send-CRPZnP3g.js";
|
|
10
10
|
import "./media-Byi2a0IF.js";
|
|
11
11
|
import "./pi-model-discovery-CoOUKWxg.js";
|
|
12
|
-
import "./paths-
|
|
12
|
+
import "./paths-6Y-iET7k.js";
|
|
13
13
|
import "./ssrf-9SwDSKOO.js";
|
|
14
14
|
import "./path-alias-guards-DrlQyXxM.js";
|
|
15
15
|
import "./fs-safe-WbnfJj7r.js";
|