@fased/fased 0.1.49 → 0.1.51
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/dist/acp/client.js +2 -2
- package/dist/acp/secret-file.js +2 -2
- package/dist/agents/agent-scope.js +2 -2
- package/dist/agents/apply-patch.js +8 -8
- package/dist/agents/auth-profiles/paths.js +2 -2
- package/dist/agents/auth-profiles/store.js +2 -2
- package/dist/agents/bash-tools.shared.js +2 -2
- package/dist/agents/cli-credentials.js +4 -4
- package/dist/agents/current-model-catalog.js +45 -0
- package/dist/agents/docs-path.js +3 -3
- package/dist/agents/embedded-pi-mcp.js +4 -4
- package/dist/agents/identity-avatar.js +3 -3
- package/dist/agents/identity-file.js +2 -2
- package/dist/agents/model-catalog-source.js +28 -3
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
- package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
- package/dist/agents/pi-model-discovery.js +6 -6
- package/dist/agents/pi-project-settings.js +3 -3
- package/dist/agents/provider-id.js +1 -1
- package/dist/agents/sandbox/fs-bridge.js +2 -2
- package/dist/agents/session-dirs.js +4 -4
- package/dist/agents/session-write-lock.js +13 -13
- package/dist/agents/shell-utils.js +5 -5
- package/dist/agents/skills/bundled-dir.js +4 -4
- package/dist/agents/skills/local-loader.js +6 -6
- package/dist/agents/skills/plugin-skills.js +2 -2
- package/dist/agents/skills/workspace.js +13 -13
- package/dist/agents/skills-install-download.js +7 -7
- package/dist/agents/skills-install-plan.js +2 -2
- package/dist/agents/skills-install.js +2 -2
- package/dist/agents/skills-status.js +2 -2
- package/dist/agents/subagent-depth.js +2 -2
- package/dist/agents/system-prompt-params.js +2 -2
- package/dist/agents/workspace.js +22 -22
- package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
- package/dist/auto-reply/reply/agent-runner.js +2 -2
- package/dist/auto-reply/reply/commands-export-session.js +7 -7
- package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
- package/dist/auto-reply/reply/post-compaction-context.js +3 -3
- package/dist/auto-reply/reply/session.js +3 -3
- package/dist/auto-reply/skill-commands.js +3 -3
- package/dist/auto-reply/status.js +6 -6
- package/dist/brand.js +1 -1
- package/dist/browser/chrome.executables.js +3 -3
- package/dist/browser/chrome.js +3 -3
- package/dist/browser/chrome.profile-decoration.js +6 -6
- package/dist/browser/profiles-service.js +2 -2
- package/dist/browser/server-context.js +2 -2
- package/dist/browser/trash.js +4 -4
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/server.js +4 -4
- package/dist/capabilities/catalog.js +3 -3
- package/dist/channels/plugins/catalog.js +3 -3
- package/dist/cli/browser-cli-extension.js +6 -6
- package/dist/cli/command-format.js +2 -2
- package/dist/cli/cron-cli/register.cron-simple.js +2 -2
- package/dist/cli/dns-cli.js +9 -9
- package/dist/cli/gateway-cli/dev.js +5 -5
- package/dist/cli/gateway-cli/run.js +2 -2
- package/dist/cli/hooks-cli.js +5 -5
- package/dist/cli/lightweight/gateway-runtime-probe.js +50 -0
- package/dist/cli/memory-cli.js +7 -7
- package/dist/cli/nodes-media-utils.js +2 -2
- package/dist/cli/plugins-cli.js +2 -2
- package/dist/cli/secrets-cli.js +3 -3
- package/dist/cli/update-cli/update-command.js +120 -0
- package/dist/cli/windows-argv.js +2 -2
- package/dist/commands/dashboard-link.js +3 -3
- package/dist/commands/doctor-install.js +5 -5
- package/dist/commands/doctor-memory-search.js +2 -2
- package/dist/commands/doctor-platform-notes.js +2 -2
- package/dist/commands/doctor-sandbox.js +2 -2
- package/dist/commands/doctor-state-integrity.js +23 -23
- package/dist/commands/doctor-workspace.js +3 -3
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/managed-up.js +2 -2
- package/dist/commands/onboard-auth.credentials.js +3 -3
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/sessions-cleanup.js +2 -2
- package/dist/commands/signal-install.js +6 -6
- package/dist/commands/status-all/channels.js +2 -2
- package/dist/commands/wallet.js +47 -47
- package/dist/config/cache-utils.js +2 -2
- package/dist/config/includes.js +5 -5
- package/dist/config/io.js +2 -2
- package/dist/config/paths.js +3 -3
- package/dist/config/sat-runtime-ids.js +3 -3
- package/dist/config/sessions/disk-budget.js +6 -6
- package/dist/config/sessions/paths.js +2 -2
- package/dist/config/sessions/store.js +17 -17
- package/dist/config/sessions/transcript.js +4 -4
- package/dist/config/talk.js +2 -2
- package/dist/control-ui/assets/{app-6iCry787.js → app-wJm5kuje.js} +4 -4
- package/dist/control-ui/assets/{chat-model-ref-C6CFR-GR.js → chat-model-ref-Cs2TTOtF.js} +2 -2
- package/dist/control-ui/assets/{index-CNFgocD9.js → index-vTDTf5Zv.js} +3 -3
- package/dist/control-ui/assets/{providers-WTJ1kMKy.js → providers-C0DEXi8e.js} +2 -2
- package/dist/control-ui/index.html +1 -1
- package/dist/cron/service/store.js +2 -2
- package/dist/cron/store.js +6 -6
- package/dist/daemon/systemd-system.js +5 -5
- package/dist/discord/monitor/thread-bindings.state.js +2 -2
- package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
- package/dist/gateway/control-ui-boot-check.js +6 -6
- package/dist/gateway/control-ui-login.js +7 -7
- package/dist/gateway/control-ui.js +9 -9
- package/dist/gateway/hooks-mapping.js +4 -4
- package/dist/gateway/probe-payload.js +14 -0
- package/dist/gateway/probe.js +8 -4
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http-lazy.js +2 -4
- package/dist/gateway/server-http.js +6 -8
- package/dist/gateway/server-methods/chat.js +3 -3
- package/dist/gateway/server-methods/models.js +3 -2
- package/dist/gateway/server-methods/sessions.js +6 -6
- package/dist/gateway/server-methods/usage.js +2 -2
- package/dist/gateway/server.impl.js +3 -3
- package/dist/gateway/session-compaction-checkpoints.js +4 -4
- package/dist/gateway/session-utils.fs.js +24 -24
- package/dist/gateway/session-utils.js +6 -6
- package/dist/hooks/bundled-dir.js +4 -4
- package/dist/hooks/gmail-setup-utils.js +6 -6
- package/dist/hooks/import-url.js +2 -2
- package/dist/hooks/loader.js +4 -4
- package/dist/hooks/workspace.js +7 -7
- package/dist/infra/archive.js +17 -17
- package/dist/infra/boundary-file-read.js +2 -2
- package/dist/infra/boundary-path.js +15 -15
- package/dist/infra/brew.js +2 -2
- package/dist/infra/control-ui-assets.js +14 -14
- package/dist/infra/device-auth-store.js +8 -8
- package/dist/infra/device-identity.js +8 -8
- package/dist/infra/dotenv.js +2 -2
- package/dist/infra/exec-approvals.js +8 -8
- package/dist/infra/exec-command-resolution.js +4 -4
- package/dist/infra/exec-safe-bin-trust.js +2 -2
- package/dist/infra/fased-root.js +5 -5
- package/dist/infra/fs-safe.js +14 -14
- package/dist/infra/gateway-lock.js +11 -11
- package/dist/infra/git-commit.js +5 -5
- package/dist/infra/git-root.js +4 -4
- package/dist/infra/hosted-runtime-artifact.js +3 -3
- package/dist/infra/is-main.js +2 -2
- package/dist/infra/json-file.js +7 -7
- package/dist/infra/outbound/delivery-queue.js +16 -16
- package/dist/infra/path-env.js +3 -3
- package/dist/infra/ports-lsof.js +4 -4
- package/dist/infra/provider-usage.auth.js +3 -3
- package/dist/infra/safe-open-sync.js +2 -2
- package/dist/infra/session-cost-usage.js +9 -9
- package/dist/infra/shell-env.js +2 -2
- package/dist/infra/state-migrations.fs.js +6 -6
- package/dist/infra/state-migrations.js +23 -23
- package/dist/infra/tmp-fased-dir.js +6 -6
- package/dist/infra/widearea-dns.js +3 -3
- package/dist/infra/wsl.js +2 -2
- package/dist/light-update-precheck.js +1 -1
- package/dist/light-update-status.js +1 -1
- package/dist/line/accounts.js +2 -2
- package/dist/line/download.js +2 -2
- package/dist/logging/config.js +3 -3
- package/dist/logging/logger.js +7 -7
- package/dist/managed/federation.js +3 -3
- package/dist/managed/tunnel.js +3 -3
- package/dist/media/store.js +13 -13
- package/dist/media-understanding/runner.js +3 -3
- package/dist/memory/embeddings.js +2 -2
- package/dist/memory/internal.js +10 -10
- package/dist/memory/manager-sync-ops.js +7 -7
- package/dist/memory/repair-executor.js +17 -17
- package/dist/node-host/invoke-system-run-plan.js +8 -8
- package/dist/node-host/invoke.js +2 -2
- package/dist/node-host/runner.js +3 -3
- package/dist/pairing/pairing-store.js +3 -3
- package/dist/plugin-sdk/{accounts-B5fY9hZy.js → accounts-BfdIB9Ud.js} +1 -1
- package/dist/plugin-sdk/{actions-D-9SsSEy.js → actions-DHN_x97P.js} +2 -2
- package/dist/plugin-sdk/{active-listener-BH7rDR47.js → active-listener-CIP_Ht8d.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-4faayz5S.js → audio-preflight-CKGhXtyV.js} +26 -26
- package/dist/plugin-sdk/{audit-BQfsboqd.js → audit-Cmg38KPG.js} +1 -1
- package/dist/plugin-sdk/{channel-access-CDZ-cJPq.js → channel-access-JHDguu4T.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-DlpuhlH6.js → channel-access-configure-B8mwKp-Z.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-items-Cyc4Kl6A.js → chunk-items-iKdlZyWZ.js} +1 -1
- package/dist/plugin-sdk/{chunk-CZuCyS7k.js → chunk-oJRyTNTL.js} +1 -1
- package/dist/plugin-sdk/command-status.js +26 -26
- package/dist/plugin-sdk/{commands-registry-COIbIjGO.js → commands-registry-Cjo7OjIf.js} +2 -2
- package/dist/plugin-sdk/{common-LMHJe8KW.js → common-Dx4sUa9f.js} +1 -1
- package/dist/plugin-sdk/{config-ZMbTT0kM.js → config-DdS0zHiU.js} +79 -3
- package/dist/plugin-sdk/{config-schema-Cku0a8Tm.js → config-schema-BJQEjMPz.js} +2001 -449
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +4 -4
- package/dist/plugin-sdk/discord.js +19 -19
- package/dist/plugin-sdk/{handle-action-C8ZZfORB.js → handle-action-wR0x9b0c.js} +13 -13
- package/dist/plugin-sdk/{helpers-vfzH9tBn.js → helpers-DkauqZNP.js} +1 -1
- package/dist/plugin-sdk/{image-ops-BnOmQA5d.js → image-ops-DmSjpAeh.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +18 -18
- package/dist/plugin-sdk/index.js +28 -28
- package/dist/plugin-sdk/json-store.js +6 -6
- package/dist/plugin-sdk/{login-C73Wpiw8.js → login-DB9LIbi8.js} +3 -3
- package/dist/plugin-sdk/{login-qr-CRKHA7i8.js → login-qr-CDhMa-c7.js} +3 -3
- package/dist/plugin-sdk/{manager-CHYhpKHn.js → manager-DGZsMQWR.js} +2 -2
- package/dist/plugin-sdk/{markdown-tables-B84dPWNG.js → markdown-tables-BX7JXDUV.js} +1 -1
- package/dist/plugin-sdk/{media-4daDcNER.js → media-DyzsScOp.js} +2 -2
- package/dist/plugin-sdk/{monitor-DJhU-J5u.js → monitor-B91PZ2mD.js} +31 -31
- package/dist/plugin-sdk/{monitor-CChc6bQV.js → monitor-BH9rTJFq.js} +30 -30
- package/dist/plugin-sdk/{openresponses-http-Dvyczr35.js → openresponses-http-CmBLZ9bH.js} +26 -26
- package/dist/plugin-sdk/{optional-runtime-dependency-BFpqaCzp.js → optional-runtime-dependency-DaMkPVe_.js} +1 -1
- package/dist/plugin-sdk/{outbound-C1xBxfNb.js → outbound-X-m2mBZn.js} +6 -6
- package/dist/plugin-sdk/{outbound-attachment-DvcxPP7b.js → outbound-attachment-M0NCUSG-.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-DWXHX-jt.d.ts → pairing-message-BaQiXKLE.d.ts} +1 -1
- package/dist/plugin-sdk/{pairing-message-DpYT614h.js → pairing-message-hnmpJlW2.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-CprpGco9.js → pairing-store-DyghUm9G.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-BQ6fFRBA.js → pi-model-discovery-ReorOh7W.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-BF_89lVj.js → pi-model-discovery-runtime-C-CHZo03.js} +2 -2
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
- package/dist/plugin-sdk/{pw-ai-xgpIbHOr.js → pw-ai-D_gli3_r.js} +3 -3
- package/dist/plugin-sdk/{replies-AzJ6U6Ut.js → replies-Djyehmcu.js} +2 -2
- package/dist/plugin-sdk/{resolve-outbound-target-COo_TR7B.js → resolve-outbound-target-Chznq8rS.js} +1 -1
- package/dist/plugin-sdk/{resolve-route-CZFzHOIe.js → resolve-route-Ce08Fx-G.js} +1 -1
- package/dist/plugin-sdk/{retry-policy-BSdqqXsI.js → retry-policy-eS25atAo.js} +1 -1
- package/dist/plugin-sdk/{runtime-CeoGffDi.js → runtime-Cv3gX3Wc.js} +3 -3
- package/dist/plugin-sdk/{runtime-dependency-Cvbs0GXf.js → runtime-dependency-p_iKbESf.js} +2 -2
- package/dist/plugin-sdk/sat-runtime.d.ts +2 -2
- package/dist/plugin-sdk/sat-runtime.js +5 -5
- package/dist/plugin-sdk/{send-B_-UtG9F.js → send-B3RAELvw.js} +6 -6
- package/dist/plugin-sdk/{send-C0Q1u7N1.js → send-BuPGxx3-.js} +8 -8
- package/dist/plugin-sdk/{send-CGE7OgsA.js → send-C-jaxZJG.js} +5 -5
- package/dist/plugin-sdk/{send-DCxAv7bV.js → send-CSob7dn9.js} +6 -6
- package/dist/plugin-sdk/{send-DVpCBUuL.js → send-CsLJsIvv.js} +7 -7
- package/dist/plugin-sdk/{session-ETYBbhLn.js → session-DKJGakm1.js} +2 -2
- package/dist/plugin-sdk/{skill-commands-BQL6TBIv.js → skill-commands-BqpZG5nW.js} +2 -2
- package/dist/plugin-sdk/{slack-Bs_4uivd.js → slack-CQqN9uBH.js} +38 -38
- package/dist/plugin-sdk/{slack-actions-CBPZkfTS.js → slack-actions-DlbVH5SS.js} +11 -11
- package/dist/plugin-sdk/slack.d.ts +4 -4
- package/dist/plugin-sdk/slack.js +9 -9
- package/dist/plugin-sdk/{sticker-cache-BBZMp-oQ.js → sticker-cache-CDyt2ZMh.js} +3 -3
- package/dist/plugin-sdk/{tables-B-G7Bb0l.js → tables-Cij4iAXw.js} +1 -1
- package/dist/plugin-sdk/{targets-D8UaoWHd.js → targets-VrYeAmeT.js} +1 -1
- package/dist/plugin-sdk/{telegram-actions-BARLx9zc.js → telegram-actions-ZwUBOkwa.js} +29 -29
- package/dist/plugin-sdk/telegram.d.ts +4 -4
- package/dist/plugin-sdk/telegram.js +8 -8
- package/dist/plugin-sdk/{thread-bindings.lifecycle-DwYKCLLq.js → thread-bindings.lifecycle-BWIzwpPM.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-BNWfHA0f.js → thread-bindings.state-CpAQrGco.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-Be1wBhVz.d.ts → tmp-fased-dir-DLba1ePP.d.ts} +1 -1
- package/dist/plugin-sdk/{types-CXLEOrJX.d.ts → types-CKR2Lvsa.d.ts} +1 -1
- package/dist/plugin-sdk/{types-CJGVZX6j.d.ts → types-NR-f-rw-.d.ts} +3 -3
- package/dist/plugin-sdk/{wallet-status-Coekn_SJ.js → wallet-status-ClmXigGN.js} +3 -3
- package/dist/plugin-sdk/{web-BwolzGVF.js → web-BK2j9z6c.js} +31 -31
- package/dist/plugin-sdk/{whatsapp-actions-CSvf6eev.js → whatsapp-actions-CaenMy79.js} +13 -13
- package/dist/plugin-sdk/{whatsapp-heartbeat-Bw7OtTe6.js → whatsapp-heartbeat-Cr9K5Sil.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +9 -9
- package/dist/plugin-sdk/whatsapp.js +12 -12
- package/dist/plugin-sdk/{wsl-By1Mc-oS.js → wsl-D_I-iL4U.js} +3 -3
- package/dist/plugin-sdk/{zod-schema.providers-core-TI6sL-6B.d.ts → zod-schema.providers-core-CIzCjXH9.d.ts} +75 -75
- package/dist/plugins/bundled-dir.js +3 -3
- package/dist/plugins/discovery.js +11 -11
- package/dist/plugins/loader.js +13 -13
- package/dist/plugins/manifest-registry.js +2 -2
- package/dist/plugins/manifest.js +4 -4
- package/dist/plugins/path-safety.js +3 -3
- package/dist/plugins/status-cache.js +10 -10
- package/dist/plugins/update.js +3 -3
- package/dist/plugins/web-search-install-catalog.js +3 -3
- package/dist/providers/refresh.js +1 -1
- package/dist/providers/refreshed-model-capabilities.js +1935 -406
- package/dist/providers/registry.js +13 -2
- package/dist/secrets/apply.js +16 -16
- package/dist/secrets/audit.js +11 -11
- package/dist/secrets/shared.js +9 -9
- package/dist/security/scan-paths.js +2 -2
- package/dist/shared/config-eval.js +2 -2
- package/dist/shared/pid-alive.js +2 -2
- package/dist/tasks/standing-orders.js +5 -5
- package/dist/tasks/task-flow-registry.js +5 -5
- package/dist/tasks/task-registry.js +5 -5
- package/dist/tasks/workflow-definitions.js +6 -6
- package/dist/telegram/token.js +5 -5
- package/dist/utils.js +5 -5
- package/dist/wallet/local-socket-signer-broker.js +16 -16
- package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
- package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
- package/dist/wallet/wallet-approval-auth.js +5 -5
- package/dist/wallet/wallet-audit-log.js +5 -5
- package/dist/wallet/wallet-custody.js +21 -21
- package/dist/wallet/wallet-inbound-events.js +5 -5
- package/dist/wallet/wallet-observability.js +5 -5
- package/dist/wallet/wallet-policy.js +9 -9
- package/dist/wallet/wallet-provider-registry.js +7 -7
- package/dist/wallet/wallet-runtime-config.js +3 -3
- package/dist/wallet/wallet-secrets-store.js +22 -22
- package/dist/wallet/wallet-send-approvals.js +5 -5
- package/dist/wallet/wallet-settlement-links.js +5 -5
- package/dist/web/accounts.js +3 -3
- package/dist/web/auth-store.js +18 -18
- package/dist/web/session.js +4 -4
- package/dist/wizard/host-security-capability.js +2 -2
- package/dist/wizard/onboarding.host-security.js +7 -7
- package/dist/wizard/onboarding.js +7 -7
- package/dist/wizard/onboarding.wallet.js +44 -44
- 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/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/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 +2 -2
- 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/synology-chat/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/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/scripts/start-managed.sh +14 -0
|
@@ -5,7 +5,7 @@ import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js";
|
|
|
5
5
|
import { createConfigIO, writeConfigFile } from "../../config/io.js";
|
|
6
6
|
import "../../config/config.js";
|
|
7
7
|
import { handleReset } from "../../commands/onboard-helpers.js";
|
|
8
|
-
import
|
|
8
|
+
import fs from "node:fs";
|
|
9
9
|
import os from "node:os";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ const DEV_AGENT_WORKSPACE_SUFFIX = "dev";
|
|
|
17
17
|
async function loadDevTemplate(name, fallback) {
|
|
18
18
|
try {
|
|
19
19
|
const templateDir = await resolveWorkspaceTemplateDir();
|
|
20
|
-
const raw = await
|
|
20
|
+
const raw = await fs.promises.readFile(path.join(templateDir, name), "utf-8");
|
|
21
21
|
if (!raw.startsWith("---")) {
|
|
22
22
|
return raw;
|
|
23
23
|
}
|
|
@@ -40,7 +40,7 @@ const resolveDevWorkspaceDir = (env = process.env) => {
|
|
|
40
40
|
};
|
|
41
41
|
async function writeFileIfMissing(filePath, content) {
|
|
42
42
|
try {
|
|
43
|
-
await
|
|
43
|
+
await fs.promises.writeFile(filePath, content, {
|
|
44
44
|
encoding: "utf-8",
|
|
45
45
|
flag: "wx"
|
|
46
46
|
});
|
|
@@ -53,7 +53,7 @@ async function writeFileIfMissing(filePath, content) {
|
|
|
53
53
|
}
|
|
54
54
|
async function ensureDevWorkspace(dir) {
|
|
55
55
|
const resolvedDir = resolveUserPath(dir);
|
|
56
|
-
await
|
|
56
|
+
await fs.promises.mkdir(resolvedDir, { recursive: true });
|
|
57
57
|
const [agents, soul, tools, identity, user] = await Promise.all([
|
|
58
58
|
loadDevTemplate("AGENTS.dev.md", `# AGENTS.md - FasedAgent Dev Workspace\n\nDefault dev workspace for fased gateway --dev.\n`),
|
|
59
59
|
loadDevTemplate("SOUL.dev.md", `# SOUL.md - Dev Persona\n\nProtocol droid for debugging and operations.\n`),
|
|
@@ -74,7 +74,7 @@ async function ensureDevGatewayConfig(opts) {
|
|
|
74
74
|
}
|
|
75
75
|
const io = createConfigIO();
|
|
76
76
|
const configPath = io.configPath;
|
|
77
|
-
const configExists =
|
|
77
|
+
const configExists = fs.existsSync(configPath);
|
|
78
78
|
if (!opts.reset && configExists) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
@@ -20,7 +20,7 @@ import { startGatewayServer } from "../../gateway/server.impl.js";
|
|
|
20
20
|
import "../../gateway/server.js";
|
|
21
21
|
import { ensureDevGatewayConfig } from "./dev.js";
|
|
22
22
|
import { runGatewayLoop } from "./run-loop.js";
|
|
23
|
-
import
|
|
23
|
+
import fs from "node:fs";
|
|
24
24
|
import path from "node:path";
|
|
25
25
|
|
|
26
26
|
//#region src/cli/gateway-cli/run.ts
|
|
@@ -145,7 +145,7 @@ async function runGatewayCommand(opts) {
|
|
|
145
145
|
const passwordRaw = toOptionString(opts.password);
|
|
146
146
|
const tokenRaw = toOptionString(opts.token);
|
|
147
147
|
const snapshot = await readConfigFileSnapshot().catch(() => null);
|
|
148
|
-
const configExists = snapshot?.exists ??
|
|
148
|
+
const configExists = snapshot?.exists ?? fs.existsSync(CONFIG_PATH);
|
|
149
149
|
const configAuditPath = path.join(resolveStateDir(process.env), "logs", "config-audit.jsonl");
|
|
150
150
|
const mode = cfg.gateway?.mode;
|
|
151
151
|
if (!opts.allowUnconfigured && mode !== "local") {
|
package/dist/cli/hooks-cli.js
CHANGED
|
@@ -14,9 +14,9 @@ import { buildWorkspaceHookStatus } from "../hooks/hooks-status.js";
|
|
|
14
14
|
import { installHooksFromNpmSpec, installHooksFromPath, resolveHookInstallDir } from "../hooks/install.js";
|
|
15
15
|
import { recordHookInstall } from "../hooks/installs.js";
|
|
16
16
|
import { buildNpmInstallRecordFields, resolvePinnedNpmInstallRecordForCli } from "./npm-resolution.js";
|
|
17
|
-
import
|
|
17
|
+
import fs from "node:fs";
|
|
18
18
|
import path from "node:path";
|
|
19
|
-
import fs from "node:fs/promises";
|
|
19
|
+
import fs$1 from "node:fs/promises";
|
|
20
20
|
|
|
21
21
|
//#region src/cli/hooks-cli.ts
|
|
22
22
|
function mergeHookEntries(pluginEntries, workspaceEntries) {
|
|
@@ -139,7 +139,7 @@ function logIntegrityDriftWarning(hookId, drift) {
|
|
|
139
139
|
}
|
|
140
140
|
async function readInstalledPackageVersion(dir) {
|
|
141
141
|
try {
|
|
142
|
-
const raw = await fs.readFile(path.join(dir, "package.json"), "utf-8");
|
|
142
|
+
const raw = await fs$1.readFile(path.join(dir, "package.json"), "utf-8");
|
|
143
143
|
const parsed = JSON.parse(raw);
|
|
144
144
|
return typeof parsed.version === "string" ? parsed.version : undefined;
|
|
145
145
|
} catch {
|
|
@@ -430,9 +430,9 @@ function registerHooksCli(program) {
|
|
|
430
430
|
hooks.command("install").description("Install a hook pack (path, archive, or npm spec)").argument("<path-or-spec>", "Path to a hook pack or npm package spec").option("-l, --link", "Link a local path instead of copying", false).option("--pin", "Record npm installs as exact resolved <name>@<version>", false).action(async (raw, opts) => {
|
|
431
431
|
const resolved = resolveUserPath(raw);
|
|
432
432
|
const cfg = loadConfig();
|
|
433
|
-
if (
|
|
433
|
+
if (fs.existsSync(resolved)) {
|
|
434
434
|
if (opts.link) {
|
|
435
|
-
const stat =
|
|
435
|
+
const stat = fs.statSync(resolved);
|
|
436
436
|
if (!stat.isDirectory()) {
|
|
437
437
|
defaultRuntime.error("Linked hook paths must be directories.");
|
|
438
438
|
process.exit(1);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { resolvePluginStatusConfigPath } from "../../plugins/status-cache.js";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/lightweight/gateway-runtime-probe.ts
|
|
5
|
+
function readGatewayProbeConfig(configPath) {
|
|
6
|
+
try {
|
|
7
|
+
const parsed = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
8
|
+
const configuredPort = parsed.gateway?.port;
|
|
9
|
+
return {
|
|
10
|
+
port: typeof configuredPort === "number" && Number.isInteger(configuredPort) ? configuredPort : 18789,
|
|
11
|
+
tls: parsed.gateway?.tls?.enabled === true
|
|
12
|
+
};
|
|
13
|
+
} catch {
|
|
14
|
+
return {
|
|
15
|
+
port: 18789,
|
|
16
|
+
tls: false
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function probeRunningGatewayRuntimeIdentity(params = {}) {
|
|
21
|
+
const config = readGatewayProbeConfig(params.configPath ?? resolvePluginStatusConfigPath());
|
|
22
|
+
try {
|
|
23
|
+
const response = await (params.fetchImpl ?? fetch)(`${config.tls ? "https" : "http"}://127.0.0.1:${config.port}/healthz`, {
|
|
24
|
+
signal: AbortSignal.timeout(params.timeoutMs ?? 600),
|
|
25
|
+
headers: { accept: "application/json" }
|
|
26
|
+
});
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
return {
|
|
29
|
+
reachable: true,
|
|
30
|
+
version: null,
|
|
31
|
+
runtimeSource: null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const payload = await response.json();
|
|
35
|
+
return {
|
|
36
|
+
reachable: true,
|
|
37
|
+
version: typeof payload.version === "string" ? payload.version.trim() || null : null,
|
|
38
|
+
runtimeSource: typeof payload.runtimeSource === "string" ? payload.runtimeSource.trim() || null : null
|
|
39
|
+
};
|
|
40
|
+
} catch {
|
|
41
|
+
return {
|
|
42
|
+
reachable: config.tls,
|
|
43
|
+
version: null,
|
|
44
|
+
runtimeSource: null
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { probeRunningGatewayRuntimeIdentity };
|
package/dist/cli/memory-cli.js
CHANGED
|
@@ -17,10 +17,10 @@ import { formatDocsLink } from "../terminal/links.js";
|
|
|
17
17
|
import { withManager } from "./cli-utils.js";
|
|
18
18
|
import { formatHelpExamples } from "./help-format.js";
|
|
19
19
|
import { withProgress, withProgressTotals } from "./progress.js";
|
|
20
|
-
import
|
|
20
|
+
import fs from "node:fs";
|
|
21
21
|
import os from "node:os";
|
|
22
22
|
import path from "node:path";
|
|
23
|
-
import fs from "node:fs/promises";
|
|
23
|
+
import fs$1 from "node:fs/promises";
|
|
24
24
|
|
|
25
25
|
//#region src/cli/memory-cli.ts
|
|
26
26
|
function formatSourceLabel(source, workspaceDir, agentId) {
|
|
@@ -74,7 +74,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
74
74
|
}
|
|
75
75
|
async function checkReadableFile(pathname) {
|
|
76
76
|
try {
|
|
77
|
-
await fs.access(pathname,
|
|
77
|
+
await fs$1.access(pathname, fs.constants.R_OK);
|
|
78
78
|
return { exists: true };
|
|
79
79
|
} catch (err) {
|
|
80
80
|
const code = err.code;
|
|
@@ -91,7 +91,7 @@ async function scanSessionFiles(agentId) {
|
|
|
91
91
|
const issues = [];
|
|
92
92
|
const sessionsDir = resolveSessionTranscriptsDirForAgent(agentId);
|
|
93
93
|
try {
|
|
94
|
-
const entries = await fs.readdir(sessionsDir, { withFileTypes: true });
|
|
94
|
+
const entries = await fs$1.readdir(sessionsDir, { withFileTypes: true });
|
|
95
95
|
const totalFiles = entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).length;
|
|
96
96
|
return {
|
|
97
97
|
source: "sessions",
|
|
@@ -132,7 +132,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
132
132
|
const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
|
|
133
133
|
for (const extraPath of resolvedExtraPaths) {
|
|
134
134
|
try {
|
|
135
|
-
const stat = await fs.lstat(extraPath);
|
|
135
|
+
const stat = await fs$1.lstat(extraPath);
|
|
136
136
|
if (stat.isSymbolicLink()) {
|
|
137
137
|
continue;
|
|
138
138
|
}
|
|
@@ -151,7 +151,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
151
151
|
}
|
|
152
152
|
let dirReadable = null;
|
|
153
153
|
try {
|
|
154
|
-
await fs.access(memoryDir,
|
|
154
|
+
await fs$1.access(memoryDir, fs.constants.R_OK);
|
|
155
155
|
dirReadable = true;
|
|
156
156
|
} catch (err) {
|
|
157
157
|
const code = err.code;
|
|
@@ -210,7 +210,7 @@ async function summarizeQmdIndexArtifact(manager) {
|
|
|
210
210
|
}
|
|
211
211
|
let stat;
|
|
212
212
|
try {
|
|
213
|
-
stat = await fs.stat(dbPath);
|
|
213
|
+
stat = await fs$1.stat(dbPath);
|
|
214
214
|
} catch (err) {
|
|
215
215
|
const code = err.code;
|
|
216
216
|
if (code === "ENOENT") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolvePreferredFasedAgentTmpDir } from "../infra/tmp-fased-dir.js";
|
|
2
|
-
import
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/nodes-media-utils.ts
|
|
@@ -18,7 +18,7 @@ function asBoolean(value) {
|
|
|
18
18
|
function resolveTempPathParts(opts) {
|
|
19
19
|
const tmpDir = opts.tmpDir ?? resolvePreferredFasedAgentTmpDir();
|
|
20
20
|
if (!opts.tmpDir) {
|
|
21
|
-
|
|
21
|
+
fs.mkdirSync(tmpDir, {
|
|
22
22
|
recursive: true,
|
|
23
23
|
mode: 448
|
|
24
24
|
});
|
package/dist/cli/plugins-cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import "./plugins-config.js";
|
|
|
22
22
|
import { pluginDoctorCommand } from "./plugins-doctor-cli.js";
|
|
23
23
|
import { pluginInfoCommand } from "./plugins-info-cli.js";
|
|
24
24
|
import "./plugins-status-cli.js";
|
|
25
|
-
import
|
|
25
|
+
import fs from "node:fs";
|
|
26
26
|
import os from "node:os";
|
|
27
27
|
import path from "node:path";
|
|
28
28
|
|
|
@@ -428,7 +428,7 @@ function registerPluginsCli(program) {
|
|
|
428
428
|
const normalized = fileSpec && fileSpec.ok ? fileSpec.path : raw;
|
|
429
429
|
const resolved = resolveUserPath(normalized);
|
|
430
430
|
const cfg = loadConfig();
|
|
431
|
-
if (
|
|
431
|
+
if (fs.existsSync(resolved)) {
|
|
432
432
|
if (opts.link) {
|
|
433
433
|
const probe = await installPluginFromPath({
|
|
434
434
|
path: resolved,
|
package/dist/cli/secrets-cli.js
CHANGED
|
@@ -7,12 +7,12 @@ import { isSecretsApplyPlan } from "../secrets/plan.js";
|
|
|
7
7
|
import { runSecretsApply } from "../secrets/apply.js";
|
|
8
8
|
import { resolveSecretsAuditExitCode, runSecretsAudit } from "../secrets/audit.js";
|
|
9
9
|
import { runSecretsConfigureInteractive } from "../secrets/configure.js";
|
|
10
|
-
import
|
|
10
|
+
import fs from "node:fs";
|
|
11
11
|
import { confirm } from "@clack/prompts";
|
|
12
12
|
|
|
13
13
|
//#region src/cli/secrets-cli.ts
|
|
14
14
|
function readPlanFile(pathname) {
|
|
15
|
-
const raw =
|
|
15
|
+
const raw = fs.readFileSync(pathname, "utf8");
|
|
16
16
|
const parsed = JSON.parse(raw);
|
|
17
17
|
if (!isSecretsApplyPlan(parsed)) {
|
|
18
18
|
throw new Error(`Invalid secrets plan file: ${pathname}`);
|
|
@@ -71,7 +71,7 @@ function registerSecretsCli(program) {
|
|
|
71
71
|
skipProviderSetup: Boolean(opts.skipProviderSetup)
|
|
72
72
|
});
|
|
73
73
|
if (opts.planOut) {
|
|
74
|
-
|
|
74
|
+
fs.writeFileSync(opts.planOut, `${JSON.stringify(configured.plan, null, 2)}\n`, "utf8");
|
|
75
75
|
}
|
|
76
76
|
if (opts.json) {
|
|
77
77
|
defaultRuntime.log(JSON.stringify({
|
|
@@ -12,6 +12,7 @@ import { stylePromptMessage } from "../../terminal/prompt-style.js";
|
|
|
12
12
|
import { DEFAULT_GIT_CHANNEL, DEFAULT_PACKAGE_CHANNEL, channelToNpmTag, normalizeUpdateChannel } from "../../infra/update-channels.js";
|
|
13
13
|
import { cleanupGlobalRenameDirs, globalInstallArgs, resolveGlobalPackageRoot, resolveNodeModulesRootForPackageRoot } from "../../infra/update-global.js";
|
|
14
14
|
import { checkUpdateStatus, compareSemverStrings, resolveNpmChannelTag } from "../../infra/update-check.js";
|
|
15
|
+
import { probeGateway } from "../../gateway/probe.js";
|
|
15
16
|
import { runDaemonInstall } from "../daemon-cli/install.js";
|
|
16
17
|
import { renderRestartDiagnostics, terminateStaleGatewayPids, waitForGatewayHealthyRestart } from "../daemon-cli/restart-health.js";
|
|
17
18
|
import { runDaemonRestart } from "../daemon-cli/lifecycle.js";
|
|
@@ -24,6 +25,7 @@ import { checkShellCompletionStatus, ensureCompletionCacheExists } from "../../c
|
|
|
24
25
|
import { runPostUpdateDoctorRepair } from "../../commands/doctor-update.js";
|
|
25
26
|
import { doctorCommand } from "../../commands/doctor.js";
|
|
26
27
|
import { DEFAULT_PACKAGE_NAME, createGlobalCommandRunner, ensureGitCheckout, normalizeTag, parseTimeoutMsOrExit, resolveGitInstallDir, resolveGlobalManager, resolveNodeRunner, resolveTargetVersion, resolveUpdateRoot, runUpdateStep } from "./shared.js";
|
|
28
|
+
import { probeRunningGatewayRuntimeIdentity } from "../lightweight/gateway-runtime-probe.js";
|
|
27
29
|
import { createUpdateProgress, printResult } from "./progress.js";
|
|
28
30
|
import { prepareRestartScript, runRestartScript } from "./restart-helper.js";
|
|
29
31
|
import { resolveUpdateGatewayServiceTarget } from "./service-target.js";
|
|
@@ -58,6 +60,36 @@ function printUpdateLifecycleTimings(timings, jsonMode) {
|
|
|
58
60
|
}
|
|
59
61
|
defaultRuntime.log("");
|
|
60
62
|
}
|
|
63
|
+
async function verifyGatewayRuntimeVersion(params) {
|
|
64
|
+
const probe = await probeGateway({
|
|
65
|
+
url: params.rpc.url,
|
|
66
|
+
auth: {
|
|
67
|
+
token: params.rpc.token,
|
|
68
|
+
password: params.rpc.password
|
|
69
|
+
},
|
|
70
|
+
tlsFingerprint: params.rpc.tlsFingerprint,
|
|
71
|
+
timeoutMs: Math.max(params.rpc.timeoutMs, 3e3)
|
|
72
|
+
});
|
|
73
|
+
const actualVersion = probe.server?.version?.trim() || null;
|
|
74
|
+
if (!probe.ok) {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
actualVersion,
|
|
78
|
+
error: probe.error ?? "gateway probe failed"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (actualVersion !== params.expectedVersion) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
actualVersion,
|
|
85
|
+
error: `running gateway version ${actualVersion ?? "unknown"} does not match installed version ${params.expectedVersion}`
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
ok: true,
|
|
90
|
+
actualVersion
|
|
91
|
+
};
|
|
92
|
+
}
|
|
61
93
|
const UPDATE_QUIPS = [
|
|
62
94
|
"Leveled up! New skills unlocked. You're welcome.",
|
|
63
95
|
"Fresh code, same agent. Miss me?",
|
|
@@ -546,6 +578,22 @@ async function maybeRestartService(params) {
|
|
|
546
578
|
rpc: params.rpc
|
|
547
579
|
}));
|
|
548
580
|
}
|
|
581
|
+
if (health.healthy && params.expectedVersion) {
|
|
582
|
+
const identity = await measureUpdateStage(timings, "gateway version verification", () => verifyGatewayRuntimeVersion({
|
|
583
|
+
expectedVersion: params.expectedVersion,
|
|
584
|
+
rpc: params.rpc
|
|
585
|
+
}));
|
|
586
|
+
if (!identity.ok) {
|
|
587
|
+
health = {
|
|
588
|
+
...health,
|
|
589
|
+
healthy: false
|
|
590
|
+
};
|
|
591
|
+
partial = true;
|
|
592
|
+
if (!params.opts.json) {
|
|
593
|
+
defaultRuntime.log(theme.warn(`Gateway runtime verification failed: ${identity.error}`));
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
549
597
|
if (health.healthy) {
|
|
550
598
|
if (!params.opts.json) {
|
|
551
599
|
defaultRuntime.log(theme.success("Daemon restart completed."));
|
|
@@ -754,6 +802,77 @@ async function updateCommand(opts) {
|
|
|
754
802
|
}
|
|
755
803
|
}
|
|
756
804
|
if (alreadyCurrent && currentVersion && targetVersion) {
|
|
805
|
+
const runningRuntime = await probeRunningGatewayRuntimeIdentity({ timeoutMs: 750 });
|
|
806
|
+
if (runningRuntime.reachable && runningRuntime.version !== currentVersion) {
|
|
807
|
+
if (!shouldRestart) {
|
|
808
|
+
defaultRuntime.error(`Installed version is ${currentVersion}, but the running gateway reports ${runningRuntime.version ?? "an older runtime without identity"}. Re-run without --no-restart.`);
|
|
809
|
+
defaultRuntime.exit(1);
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
const serviceTarget = await resolveUpdateGatewayServiceTarget();
|
|
813
|
+
const serviceLoaded = await serviceTarget.service.isLoaded({ env: process.env });
|
|
814
|
+
if (!serviceLoaded) {
|
|
815
|
+
defaultRuntime.error(`Installed version is ${currentVersion}, but a different unmanaged gateway is running. Stop it, then run ${formatCliCommand("fased gateway install --force")} and ${formatCliCommand("fased gateway restart")}.`);
|
|
816
|
+
defaultRuntime.exit(1);
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
if (!opts.json) {
|
|
820
|
+
defaultRuntime.log(theme.warn(`Installed files are current, but gateway runtime is ${runningRuntime.version ?? "legacy/unknown"}. Refreshing the managed service...`));
|
|
821
|
+
}
|
|
822
|
+
if (serviceTarget.scope === "system") {
|
|
823
|
+
await serviceTarget.service.restart({
|
|
824
|
+
env: process.env,
|
|
825
|
+
stdout: process.stdout
|
|
826
|
+
});
|
|
827
|
+
} else {
|
|
828
|
+
const restarted = await runDaemonRestart();
|
|
829
|
+
if (!restarted) {
|
|
830
|
+
defaultRuntime.error("Gateway service restart did not start.");
|
|
831
|
+
defaultRuntime.exit(1);
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const gatewayPort = resolveGatewayPort(configSnapshot.valid ? configSnapshot.config : undefined);
|
|
836
|
+
const gatewayConfig = configSnapshot.valid ? configSnapshot.config.gateway : undefined;
|
|
837
|
+
const tlsRuntime = await loadGatewayTlsRuntime(gatewayConfig?.tls);
|
|
838
|
+
const rpc = {
|
|
839
|
+
url: `${tlsRuntime.enabled ? "wss" : "ws"}://127.0.0.1:${gatewayPort}`,
|
|
840
|
+
token: gatewayConfig?.auth?.token,
|
|
841
|
+
password: gatewayConfig?.auth?.password,
|
|
842
|
+
tlsFingerprint: tlsRuntime.enabled ? tlsRuntime.fingerprintSha256 : undefined,
|
|
843
|
+
timeoutMs: 1500
|
|
844
|
+
};
|
|
845
|
+
const health = await waitForGatewayHealthyRestart({
|
|
846
|
+
service: serviceTarget.service,
|
|
847
|
+
port: gatewayPort,
|
|
848
|
+
rpc
|
|
849
|
+
});
|
|
850
|
+
const identity = health.healthy ? await verifyGatewayRuntimeVersion({
|
|
851
|
+
expectedVersion: currentVersion,
|
|
852
|
+
rpc
|
|
853
|
+
}) : {
|
|
854
|
+
ok: false,
|
|
855
|
+
actualVersion: null,
|
|
856
|
+
error: "gateway did not become healthy"
|
|
857
|
+
};
|
|
858
|
+
if (!identity.ok) {
|
|
859
|
+
defaultRuntime.error(`Gateway runtime refresh failed: ${identity.error}`);
|
|
860
|
+
defaultRuntime.exit(1);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
if (opts.json) {
|
|
864
|
+
defaultRuntime.log(JSON.stringify({
|
|
865
|
+
status: "repaired",
|
|
866
|
+
currentVersion,
|
|
867
|
+
targetVersion,
|
|
868
|
+
gatewayVersion: identity.actualVersion,
|
|
869
|
+
channel
|
|
870
|
+
}, null, 2));
|
|
871
|
+
} else {
|
|
872
|
+
defaultRuntime.log(`Gateway runtime refreshed: ${identity.actualVersion}`);
|
|
873
|
+
}
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
757
876
|
if (opts.json) {
|
|
758
877
|
defaultRuntime.log(JSON.stringify({
|
|
759
878
|
status: "current",
|
|
@@ -847,6 +966,7 @@ async function updateCommand(opts) {
|
|
|
847
966
|
restartScriptPath,
|
|
848
967
|
serviceTarget,
|
|
849
968
|
serviceLoaded,
|
|
969
|
+
expectedVersion: result.after?.version ?? targetVersion,
|
|
850
970
|
rpc: restartRpc
|
|
851
971
|
});
|
|
852
972
|
if (!restartResult.healthy) {
|
package/dist/cli/windows-argv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/windows-argv.ts
|
|
@@ -33,7 +33,7 @@ function normalizeWindowsArgv(argv) {
|
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
const lower = normalized.toLowerCase();
|
|
36
|
-
return lower === execPathLower || path.basename(lower) === execBase || lower.endsWith("\\node.exe") || lower.endsWith("/node.exe") || lower.includes("node.exe") || path.basename(lower) === "node.exe" &&
|
|
36
|
+
return lower === execPathLower || path.basename(lower) === execBase || lower.endsWith("\\node.exe") || lower.endsWith("/node.exe") || lower.includes("node.exe") || path.basename(lower) === "node.exe" && fs.existsSync(normalized);
|
|
37
37
|
};
|
|
38
38
|
const next = [...argv];
|
|
39
39
|
for (let i = 1; i <= 3 && i < next.length;) {
|
|
@@ -4,7 +4,7 @@ import { parseDurationMs } from "../cli/parse-duration.js";
|
|
|
4
4
|
import { readConfigFileSnapshot } from "../config/io.js";
|
|
5
5
|
import "../config/config.js";
|
|
6
6
|
import { CONTROL_UI_LOGIN_DEFAULT_GRANT_TTL_MS, createLoginGrant, normalizePublicHost } from "../gateway/control-ui-login.js";
|
|
7
|
-
import
|
|
7
|
+
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/dashboard-link.ts
|
|
@@ -12,10 +12,10 @@ const AGENT_DOMAIN_SUFFIX = ".agents.fased.app";
|
|
|
12
12
|
function readStateGatewayToken(env = process.env) {
|
|
13
13
|
try {
|
|
14
14
|
const filePath = path.join(resolveStateDir(env), "gateway-secret");
|
|
15
|
-
if (!
|
|
15
|
+
if (!fs.existsSync(filePath)) {
|
|
16
16
|
return "";
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return fs.readFileSync(filePath, "utf8").trim();
|
|
19
19
|
} catch {
|
|
20
20
|
return "";
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { note } from "../terminal/note.js";
|
|
2
|
-
import
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/doctor-install.ts
|
|
@@ -8,7 +8,7 @@ function noteSourceInstallIssues(root) {
|
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
const workspaceMarker = path.join(root, "pnpm-workspace.yaml");
|
|
11
|
-
if (!
|
|
11
|
+
if (!fs.existsSync(workspaceMarker)) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const warnings = [];
|
|
@@ -16,13 +16,13 @@ function noteSourceInstallIssues(root) {
|
|
|
16
16
|
const pnpmStore = path.join(nodeModules, ".pnpm");
|
|
17
17
|
const tsxBin = path.join(nodeModules, ".bin", "tsx");
|
|
18
18
|
const srcEntry = path.join(root, "src", "entry.ts");
|
|
19
|
-
if (
|
|
19
|
+
if (fs.existsSync(nodeModules) && !fs.existsSync(pnpmStore)) {
|
|
20
20
|
warnings.push("- node_modules was not installed by pnpm (missing node_modules/.pnpm). Run: pnpm install");
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
22
|
+
if (fs.existsSync(path.join(root, "package-lock.json"))) {
|
|
23
23
|
warnings.push("- package-lock.json present in a pnpm workspace. If you ran npm install, remove it and reinstall with pnpm.");
|
|
24
24
|
}
|
|
25
|
-
if (
|
|
25
|
+
if (fs.existsSync(srcEntry) && !fs.existsSync(tsxBin)) {
|
|
26
26
|
warnings.push("- tsx binary is missing for source runs. Run: pnpm install");
|
|
27
27
|
}
|
|
28
28
|
if (warnings.length > 0) {
|
|
@@ -5,7 +5,7 @@ import { resolveApiKeyForProvider } from "../agents/model-auth.js";
|
|
|
5
5
|
import { resolveMemoryBackendConfig } from "../memory/backend-config.js";
|
|
6
6
|
import { resolveMemorySearchConfig } from "../agents/memory-search.js";
|
|
7
7
|
import { note } from "../terminal/note.js";
|
|
8
|
-
import
|
|
8
|
+
import fs from "node:fs";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/doctor-memory-search.ts
|
|
11
11
|
/**
|
|
@@ -126,7 +126,7 @@ function hasLocalEmbeddings(local) {
|
|
|
126
126
|
}
|
|
127
127
|
const resolved = resolveUserPath(modelPath);
|
|
128
128
|
try {
|
|
129
|
-
return
|
|
129
|
+
return fs.statSync(resolved).isFile();
|
|
130
130
|
} catch {
|
|
131
131
|
return false;
|
|
132
132
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shortenHomePath } from "../utils.js";
|
|
2
2
|
import { note } from "../terminal/note.js";
|
|
3
|
-
import
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
@@ -17,7 +17,7 @@ async function noteMacLaunchAgentOverrides() {
|
|
|
17
17
|
}
|
|
18
18
|
const home = resolveHomeDir();
|
|
19
19
|
const markerCandidates = [path.join(home, ".fased", "disable-launchagent")];
|
|
20
|
-
const markerPath = markerCandidates.find((candidate) =>
|
|
20
|
+
const markerPath = markerCandidates.find((candidate) => fs.existsSync(candidate));
|
|
21
21
|
if (!markerPath) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
@@ -3,7 +3,7 @@ import { DEFAULT_SANDBOX_BROWSER_IMAGE, DEFAULT_SANDBOX_COMMON_IMAGE, DEFAULT_SA
|
|
|
3
3
|
import { resolveSandboxScope } from "../agents/sandbox/config.js";
|
|
4
4
|
import "../agents/sandbox.js";
|
|
5
5
|
import { note } from "../terminal/note.js";
|
|
6
|
-
import
|
|
6
|
+
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/doctor-sandbox.ts
|
|
@@ -18,7 +18,7 @@ function resolveSandboxScript(scriptRel) {
|
|
|
18
18
|
}
|
|
19
19
|
for (const root of candidates) {
|
|
20
20
|
const scriptPath = path.join(root, scriptRel);
|
|
21
|
-
if (
|
|
21
|
+
if (fs.existsSync(scriptPath)) {
|
|
22
22
|
return {
|
|
23
23
|
scriptPath,
|
|
24
24
|
cwd: root
|