@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
package/package.json
CHANGED
package/src/brand.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const FASED_BRAND_NAME = "Fased";
|
|
2
2
|
export const FASED_AGENT_NAME = "Fased Agent";
|
|
3
3
|
export const FASED_CONTROL_NAME = "Fased Control";
|
|
4
|
-
export const FASED_PRODUCT_VERSION = "0.1.
|
|
4
|
+
export const FASED_PRODUCT_VERSION = "0.1.32";
|
|
5
5
|
export const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
|
|
6
6
|
|
|
7
7
|
export function formatFasedDisplayLine(): string {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8165b35a88ec0aaf6769178d83ee3a6134b0b373e3a0ef451d22e5034bebe4f2
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { loadConfig, resolveGatewayPort } from "../../config/config.js";
|
|
2
2
|
import { resolveGatewayService } from "../../daemon/service.js";
|
|
3
|
+
import { resolveGatewayCredentialsFromConfig } from "../../gateway/credentials.js";
|
|
4
|
+
import { loadGatewayTlsRuntime } from "../../infra/tls/gateway.js";
|
|
3
5
|
import { defaultRuntime } from "../../runtime.js";
|
|
4
6
|
import { theme } from "../../terminal/theme.js";
|
|
5
7
|
import { formatCliCommand } from "../command-format.js";
|
|
@@ -35,6 +37,25 @@ async function resolveGatewayRestartPort() {
|
|
|
35
37
|
return portFromArgs ?? resolveGatewayPort(loadConfig(), mergedEnv);
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
async function resolveGatewayRestartRpc(port: number) {
|
|
41
|
+
const cfg = loadConfig();
|
|
42
|
+
const tlsRuntime =
|
|
43
|
+
cfg.gateway?.tls?.enabled === true ? await loadGatewayTlsRuntime(cfg.gateway.tls) : undefined;
|
|
44
|
+
const scheme = tlsRuntime?.enabled ? "wss" : "ws";
|
|
45
|
+
const auth = resolveGatewayCredentialsFromConfig({
|
|
46
|
+
cfg,
|
|
47
|
+
env: process.env,
|
|
48
|
+
modeOverride: "local",
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
url: `${scheme}://127.0.0.1:${port}`,
|
|
52
|
+
token: auth.token,
|
|
53
|
+
password: auth.password,
|
|
54
|
+
tlsFingerprint: tlsRuntime?.enabled ? tlsRuntime.fingerprintSha256 : undefined,
|
|
55
|
+
timeoutMs: 1_500,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
38
59
|
export async function runDaemonUninstall(opts: DaemonLifecycleOptions = {}) {
|
|
39
60
|
return await runServiceUninstall({
|
|
40
61
|
serviceNoun: "Gateway",
|
|
@@ -88,6 +109,7 @@ export async function runDaemonRestart(opts: DaemonLifecycleOptions = {}): Promi
|
|
|
88
109
|
port: restartPort,
|
|
89
110
|
attempts: POST_RESTART_HEALTH_ATTEMPTS,
|
|
90
111
|
delayMs: POST_RESTART_HEALTH_DELAY_MS,
|
|
112
|
+
rpc: await resolveGatewayRestartRpc(restartPort),
|
|
91
113
|
});
|
|
92
114
|
|
|
93
115
|
if (!health.healthy && health.staleGatewayPids.length > 0) {
|
|
@@ -105,6 +127,7 @@ export async function runDaemonRestart(opts: DaemonLifecycleOptions = {}): Promi
|
|
|
105
127
|
port: restartPort,
|
|
106
128
|
attempts: POST_RESTART_HEALTH_ATTEMPTS,
|
|
107
129
|
delayMs: POST_RESTART_HEALTH_DELAY_MS,
|
|
130
|
+
rpc: await resolveGatewayRestartRpc(restartPort),
|
|
108
131
|
});
|
|
109
132
|
}
|
|
110
133
|
|
|
@@ -14,7 +14,7 @@ export async function probeGatewayStatus(opts: {
|
|
|
14
14
|
try {
|
|
15
15
|
await withProgress(
|
|
16
16
|
{
|
|
17
|
-
label: "Checking gateway
|
|
17
|
+
label: "Checking gateway health...",
|
|
18
18
|
indeterminate: true,
|
|
19
19
|
enabled: opts.json !== true,
|
|
20
20
|
},
|
|
@@ -24,7 +24,7 @@ export async function probeGatewayStatus(opts: {
|
|
|
24
24
|
token: opts.token,
|
|
25
25
|
password: opts.password,
|
|
26
26
|
tlsFingerprint: opts.tlsFingerprint,
|
|
27
|
-
method: "
|
|
27
|
+
method: "health",
|
|
28
28
|
timeoutMs: opts.timeoutMs,
|
|
29
29
|
clientName: GATEWAY_CLIENT_NAMES.CLI,
|
|
30
30
|
mode: GATEWAY_CLIENT_MODES.CLI,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
type PortUsage,
|
|
8
8
|
} from "../../infra/ports.js";
|
|
9
9
|
import { sleep } from "../../utils.js";
|
|
10
|
+
import { probeGatewayStatus } from "./probe.js";
|
|
10
11
|
|
|
11
12
|
export const DEFAULT_RESTART_HEALTH_TIMEOUT_MS = 60_000;
|
|
12
13
|
export const DEFAULT_RESTART_HEALTH_DELAY_MS = 500;
|
|
@@ -18,6 +19,10 @@ export type GatewayRestartSnapshot = {
|
|
|
18
19
|
runtime: GatewayServiceRuntime;
|
|
19
20
|
portUsage: PortUsage;
|
|
20
21
|
healthy: boolean;
|
|
22
|
+
rpc?: {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
};
|
|
21
26
|
staleGatewayPids: number[];
|
|
22
27
|
};
|
|
23
28
|
|
|
@@ -32,6 +37,13 @@ export async function inspectGatewayRestart(params: {
|
|
|
32
37
|
service: GatewayService;
|
|
33
38
|
port: number;
|
|
34
39
|
env?: NodeJS.ProcessEnv;
|
|
40
|
+
rpc?: {
|
|
41
|
+
url: string;
|
|
42
|
+
token?: string;
|
|
43
|
+
password?: string;
|
|
44
|
+
tlsFingerprint?: string;
|
|
45
|
+
timeoutMs: number;
|
|
46
|
+
};
|
|
35
47
|
}): Promise<GatewayRestartSnapshot> {
|
|
36
48
|
const env = params.env ?? process.env;
|
|
37
49
|
let runtime: GatewayServiceRuntime = { status: "unknown" };
|
|
@@ -67,7 +79,18 @@ export async function inspectGatewayRestart(params: {
|
|
|
67
79
|
? portUsage.listeners.some((listener) => listenerOwnedByRuntimePid({ listener, runtimePid }))
|
|
68
80
|
: gatewayListeners.length > 0 ||
|
|
69
81
|
(portUsage.status === "busy" && portUsage.listeners.length === 0);
|
|
70
|
-
const
|
|
82
|
+
const shouldProbeRpc = running && ownsPort && params.rpc;
|
|
83
|
+
const rpc = shouldProbeRpc
|
|
84
|
+
? await probeGatewayStatus({
|
|
85
|
+
url: params.rpc.url,
|
|
86
|
+
token: params.rpc.token,
|
|
87
|
+
password: params.rpc.password,
|
|
88
|
+
tlsFingerprint: params.rpc.tlsFingerprint,
|
|
89
|
+
timeoutMs: params.rpc.timeoutMs,
|
|
90
|
+
json: true,
|
|
91
|
+
})
|
|
92
|
+
: undefined;
|
|
93
|
+
const healthy = running && ownsPort && (rpc ? rpc.ok : true);
|
|
71
94
|
const staleGatewayPids = Array.from(
|
|
72
95
|
new Set(
|
|
73
96
|
gatewayListeners
|
|
@@ -89,6 +112,7 @@ export async function inspectGatewayRestart(params: {
|
|
|
89
112
|
runtime,
|
|
90
113
|
portUsage,
|
|
91
114
|
healthy,
|
|
115
|
+
...(rpc ? { rpc } : {}),
|
|
92
116
|
staleGatewayPids,
|
|
93
117
|
};
|
|
94
118
|
}
|
|
@@ -99,6 +123,13 @@ export async function waitForGatewayHealthyRestart(params: {
|
|
|
99
123
|
attempts?: number;
|
|
100
124
|
delayMs?: number;
|
|
101
125
|
env?: NodeJS.ProcessEnv;
|
|
126
|
+
rpc?: {
|
|
127
|
+
url: string;
|
|
128
|
+
token?: string;
|
|
129
|
+
password?: string;
|
|
130
|
+
tlsFingerprint?: string;
|
|
131
|
+
timeoutMs: number;
|
|
132
|
+
};
|
|
102
133
|
}): Promise<GatewayRestartSnapshot> {
|
|
103
134
|
const attempts = params.attempts ?? DEFAULT_RESTART_HEALTH_ATTEMPTS;
|
|
104
135
|
const delayMs = params.delayMs ?? DEFAULT_RESTART_HEALTH_DELAY_MS;
|
|
@@ -107,6 +138,7 @@ export async function waitForGatewayHealthyRestart(params: {
|
|
|
107
138
|
service: params.service,
|
|
108
139
|
port: params.port,
|
|
109
140
|
env: params.env,
|
|
141
|
+
rpc: params.rpc,
|
|
110
142
|
});
|
|
111
143
|
|
|
112
144
|
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
@@ -121,6 +153,7 @@ export async function waitForGatewayHealthyRestart(params: {
|
|
|
121
153
|
service: params.service,
|
|
122
154
|
port: params.port,
|
|
123
155
|
env: params.env,
|
|
156
|
+
rpc: params.rpc,
|
|
124
157
|
});
|
|
125
158
|
}
|
|
126
159
|
|
|
@@ -151,6 +184,9 @@ export function renderRestartDiagnostics(snapshot: GatewayRestartSnapshot): stri
|
|
|
151
184
|
if (snapshot.portUsage.errors?.length) {
|
|
152
185
|
lines.push(`Port diagnostics errors: ${snapshot.portUsage.errors.join("; ")}`);
|
|
153
186
|
}
|
|
187
|
+
if (snapshot.rpc && !snapshot.rpc.ok) {
|
|
188
|
+
lines.push(`Gateway RPC probe: failed${snapshot.rpc.error ? ` (${snapshot.rpc.error})` : ""}.`);
|
|
189
|
+
}
|
|
154
190
|
|
|
155
191
|
return lines;
|
|
156
192
|
}
|
|
@@ -13,6 +13,7 @@ import { auditGatewayServiceConfig } from "../../daemon/service-audit.js";
|
|
|
13
13
|
import { resolveGatewayService } from "../../daemon/service.js";
|
|
14
14
|
import { resolveGatewayBindHost } from "../../gateway/net.js";
|
|
15
15
|
import {
|
|
16
|
+
classifyPortListener,
|
|
16
17
|
formatPortDiagnostics,
|
|
17
18
|
inspectPortUsage,
|
|
18
19
|
type PortListener,
|
|
@@ -96,16 +97,49 @@ export type DaemonStatus = {
|
|
|
96
97
|
extraServices: Array<{ label: string; detail: string; scope: string }>;
|
|
97
98
|
};
|
|
98
99
|
|
|
99
|
-
function shouldReportPortUsage(
|
|
100
|
-
|
|
100
|
+
function shouldReportPortUsage(
|
|
101
|
+
port: DaemonStatus["port"] | undefined,
|
|
102
|
+
rpcOk?: boolean,
|
|
103
|
+
runtime?: DaemonStatus["service"]["runtime"],
|
|
104
|
+
) {
|
|
105
|
+
if (!port || port.status !== "busy") {
|
|
101
106
|
return false;
|
|
102
107
|
}
|
|
103
108
|
if (rpcOk === true) {
|
|
104
109
|
return false;
|
|
105
110
|
}
|
|
111
|
+
if (isExpectedSingleGatewayListener(port, runtime)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
106
114
|
return true;
|
|
107
115
|
}
|
|
108
116
|
|
|
117
|
+
function isExpectedSingleGatewayListener(
|
|
118
|
+
port: DaemonStatus["port"],
|
|
119
|
+
runtime?: DaemonStatus["service"]["runtime"],
|
|
120
|
+
): boolean {
|
|
121
|
+
if (!port || port.status !== "busy" || runtime?.status !== "running") {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
if (port.listeners.length === 0) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const gatewayListeners = port.listeners.filter(
|
|
128
|
+
(listener) => classifyPortListener(listener, port.port) === "gateway",
|
|
129
|
+
);
|
|
130
|
+
if (gatewayListeners.length !== port.listeners.length) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
const pids = Array.from(
|
|
134
|
+
new Set(
|
|
135
|
+
gatewayListeners
|
|
136
|
+
.map((listener) => listener.pid)
|
|
137
|
+
.filter((pid): pid is number => typeof pid === "number" && Number.isFinite(pid)),
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
return pids.length <= 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
109
143
|
export async function gatherDaemonStatus(
|
|
110
144
|
opts: {
|
|
111
145
|
rpc: GatewayRpcOpts;
|
|
@@ -285,7 +319,7 @@ export async function gatherDaemonStatus(
|
|
|
285
319
|
}
|
|
286
320
|
|
|
287
321
|
export function renderPortDiagnosticsForCli(status: DaemonStatus, rpcOk?: boolean): string[] {
|
|
288
|
-
if (!status.port
|
|
322
|
+
if (!shouldReportPortUsage(status.port, rpcOk, status.service.runtime)) {
|
|
289
323
|
return [];
|
|
290
324
|
}
|
|
291
325
|
return formatPortDiagnostics({
|