@fased/fased 0.1.54 → 0.1.56
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/config/capability-catalog.json +12 -0
- 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/authenticated-model-catalog.js +28 -0
- package/dist/agents/bash-tools.exec-host-node.js +1 -1
- package/dist/agents/bash-tools.exec.js +1 -1
- package/dist/agents/bash-tools.shared.js +2 -2
- package/dist/agents/cli-credentials.js +4 -4
- package/dist/agents/copilot-dynamic-headers.js +37 -0
- package/dist/agents/current-model-catalog.js +9 -13
- 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-normalized.js +1 -0
- package/dist/agents/model-catalog-source.js +2 -2
- package/dist/agents/model-catalog.js +1 -1
- package/dist/agents/model-metadata.js +58 -9
- package/dist/agents/openai-codex-app-server.js +499 -0
- package/dist/agents/pi-embedded-runner/compact.js +3 -3
- package/dist/agents/pi-embedded-runner/extra-params.js +168 -79
- package/dist/agents/pi-embedded-runner/model.js +62 -1
- package/dist/agents/pi-embedded-runner/moonshot-stream-wrappers.js +46 -0
- package/dist/agents/pi-embedded-runner/openai-stream-wrappers.js +221 -0
- package/dist/agents/pi-embedded-runner/run/attempt.js +6 -4
- package/dist/agents/pi-embedded-runner/run.js +5 -2
- package/dist/agents/pi-embedded-runner/utils.js +1 -1
- package/dist/agents/pi-embedded-runner.js +1 -1
- 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/pi-tools.js +2 -2
- 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/tools/discord-actions-messaging.js +1 -1
- package/dist/agents/tools/message-tool.js +1 -1
- package/dist/agents/tools/session-status-tool.js +3 -3
- package/dist/agents/tools/slack-actions.js +1 -1
- package/dist/agents/tools/tts-tool.js +1 -1
- 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/commands-models.js +1 -1
- package/dist/auto-reply/reply/directive-handling.impl.js +4 -1
- package/dist/auto-reply/reply/dispatch-acp.js +1 -1
- package/dist/auto-reply/reply/dispatch-from-config.js +1 -1
- package/dist/auto-reply/reply/get-reply-run.js +20 -2
- package/dist/auto-reply/reply/model-selection.js +1 -1
- 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-reset-model.js +1 -1
- package/dist/auto-reply/reply/session.js +3 -3
- package/dist/auto-reply/skill-commands.js +3 -3
- package/dist/auto-reply/status.js +7 -7
- package/dist/auto-reply/thinking.js +1 -1
- package/dist/brand.js +1 -1
- package/dist/browser/cdp.helpers.js +2 -2
- package/dist/browser/chrome.executables.js +3 -3
- package/dist/browser/chrome.js +5 -5
- package/dist/browser/chrome.profile-decoration.js +6 -6
- package/dist/browser/extension-relay.js +7 -7
- 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-add.js +1 -1
- 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 +2 -2
- 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/program/register.agent.js +1 -1
- package/dist/cli/providers-cli.js +3 -2
- package/dist/cli/secrets-cli.js +3 -3
- package/dist/cli/windows-argv.js +2 -2
- package/dist/commands/agent.js +22 -3
- package/dist/commands/auth-choice.apply.api-providers.js +3 -8
- package/dist/commands/auth-choice.apply.openai.js +13 -7
- package/dist/commands/auth-choice.model-check.js +1 -2
- package/dist/commands/configure.gateway-auth.js +14 -16
- package/dist/commands/dashboard-link.js +3 -3
- package/dist/commands/doctor-config-flow.js +1 -1
- 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/hosted-dashboard-probe.js +3 -3
- package/dist/commands/managed-up.js +2 -2
- package/dist/commands/model-picker.js +27 -8
- package/dist/commands/models/list.probe.js +1 -1
- package/dist/commands/models/list.registry.js +13 -17
- package/dist/commands/models/list.status-command.js +2 -2
- package/dist/commands/onboard-auth.config-core.js +1 -1
- package/dist/commands/onboard-auth.config-litellm.js +21 -21
- package/dist/commands/onboard-auth.credentials.js +3 -4
- package/dist/commands/onboard-auth.js +0 -1
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/openai-codex-model-default.js +28 -5
- 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/config/zod-schema.agent-defaults.js +6 -2
- package/dist/config/zod-schema.agent-runtime.js +6 -2
- package/dist/config/zod-schema.core.js +6 -2
- package/dist/control-ui/assets/{app-BKlu6OKz.js → app-D7TXyNRi.js} +1548 -1540
- package/dist/control-ui/assets/chat-model-ref-Djkv93yn.js +2 -0
- package/dist/control-ui/assets/{index-nrFcGMv-.js → index-BmSBom-w.js} +3 -3
- package/dist/control-ui/assets/{providers-BQFrRqym.js → providers-Cc89iMdx.js} +5 -5
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -0
- package/dist/cron/isolated-agent/run.js +6 -2
- package/dist/cron/service/jobs.js +11 -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/gateway-plugin.js +2 -2
- package/dist/discord/monitor/thread-bindings.state.js +2 -2
- package/dist/discord/voice/manager.js +1 -1
- package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
- package/dist/gateway/client.js +4 -4
- 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 +11 -9
- package/dist/gateway/hooks-mapping.js +4 -4
- package/dist/gateway/protocol/schema/agents-models-skills.js +66 -4
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http.js +4 -4
- package/dist/gateway/server-methods/chat.js +3 -3
- package/dist/gateway/server-methods/models.js +8 -8
- package/dist/gateway/server-methods/sessions.js +8 -8
- package/dist/gateway/server-methods/tts.js +2 -2
- package/dist/gateway/server-methods/usage.js +2 -2
- package/dist/gateway/server-model-catalog.js +3 -0
- 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/gateway/sessions-patch.js +27 -24
- 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/update-runner.js +31 -3
- package/dist/infra/widearea-dns.js +3 -3
- package/dist/infra/wsl.js +2 -2
- 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/inventory.js +19 -2
- 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-DW9OS5Ll.js → accounts-DzWlKv1U.js} +1 -1
- package/dist/plugin-sdk/{actions-DQUXohRr.js → actions-BplQVLL6.js} +4 -4
- package/dist/plugin-sdk/{active-listener-BZQWZPF7.js → active-listener-x4MLhYUw.js} +1 -1
- package/dist/plugin-sdk/{allow-list-BYeKk0Sy.js → allow-list-DyAxs4yw.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-t4mmHsI2.js → audio-preflight-G8h3Sn8_.js} +43 -47
- package/dist/plugin-sdk/{audit-BZk_6Buw.js → audit-CWknklvI.js} +1 -1
- package/dist/plugin-sdk/{channel-access-CN5HiWdb.js → channel-access-a9Dnfw7-.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-B7Kkvx9K.js → channel-access-configure-CD4QDN5E.js} +1 -1
- package/dist/plugin-sdk/{channel-adapters.discord-IOZP8Cv5.js → channel-adapters.discord-BS4S4Svh.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-B2ffJ-LR.js → chunk-B8EZkwiT.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-jOdkyP53.js → chunk-items-CEPklxGe.js} +1 -1
- package/dist/plugin-sdk/command-status.d.ts +2 -2
- package/dist/plugin-sdk/command-status.js +43 -47
- package/dist/plugin-sdk/{commands-registry-BWb4NcfW.js → commands-registry-BfEa4tFA.js} +2 -2
- package/dist/plugin-sdk/{common-C4XrB73N.js → common-CbfckC19.js} +1 -1
- package/dist/plugin-sdk/{config-rySyVtKs.js → config-Bt5GhnA-.js} +105 -73
- package/dist/plugin-sdk/{config-schema-BaybPPrJ.js → config-schema-B9DKr6J5.js} +96239 -81587
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/device-pair.js +2 -3
- package/dist/plugin-sdk/{diagnostic-Dfn1iERm.js → diagnostic-DLL_zekv.js} +3 -3
- package/dist/plugin-sdk/{directory-live-DatqU-eS.js → directory-live-CSuYxdwk.js} +1 -1
- package/dist/plugin-sdk/{directory-live-ClwN5KKq.js → directory-live-Dw7ZgC9_.js} +1 -1
- package/dist/plugin-sdk/discord.d.ts +5 -5
- package/dist/plugin-sdk/discord.js +31 -32
- package/dist/plugin-sdk/{draft-stream-controls-D4Tb_iS_.js → draft-stream-controls-BqchW1vi.js} +1 -1
- package/dist/plugin-sdk/{fetch-guard-BuYrl6q2.js → fetch-guard-CeG6u6ld.js} +1 -1
- package/dist/plugin-sdk/{filesystem-manager-B9DDPgfU.js → filesystem-manager-BGGGrkiN.js} +2 -2
- package/dist/plugin-sdk/{fs-safe-BG-VzVkL.js → fs-safe-xBqok6yR.js} +1 -1
- package/dist/plugin-sdk/{group-mentions-DLOOve8d.d.ts → group-mentions-BHRff6j8.d.ts} +1 -1
- package/dist/plugin-sdk/{guilds-BeT3iHHJ.js → guilds-CDhRIX57.js} +1 -1
- package/dist/plugin-sdk/{handle-action-CGF-Qnp0.js → handle-action-DbzZFYnG.js} +24 -25
- package/dist/plugin-sdk/{helpers-DgRMfCnT.js → helpers-CluGKuIV.js} +1 -1
- package/dist/plugin-sdk/{image-ops-CcBfoMLW.js → image-ops-CUaLtIFj.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +8 -8
- package/dist/plugin-sdk/index.js +47 -51
- package/dist/plugin-sdk/json-store.js +6 -6
- package/dist/plugin-sdk/{login-DpDQyM7r.js → login-DJuHYDiK.js} +3 -3
- package/dist/plugin-sdk/{login-qr-COaSAPY5.js → login-qr-CbHL5ayf.js} +3 -3
- package/dist/plugin-sdk/{manager-Cqz30lA3.js → manager-oHAvZCT3.js} +7 -7
- package/dist/plugin-sdk/{markdown-tables-BOG5sSQQ.js → markdown-tables-Mkx7k92Y.js} +1 -1
- package/dist/plugin-sdk/{media-Bu-nJpPs.js → media-CA8sTmVE.js} +4 -4
- package/dist/plugin-sdk/{monitor-II_NIq3G.js → monitor-CZrN9pev.js} +51 -55
- package/dist/plugin-sdk/{monitor-DL6oEVo8.js → monitor-CmwGqNyV.js} +61 -65
- package/dist/plugin-sdk/{openresponses-http-vkHBBpGY.js → openresponses-http-CWOd4war.js} +43 -47
- package/dist/plugin-sdk/{optional-runtime-dependency-DEojVNfv.js → optional-runtime-dependency-DKmk9PZa.js} +1 -1
- package/dist/plugin-sdk/{outbound-mf2y6KuY.js → outbound-0oN9IfNw.js} +9 -9
- package/dist/plugin-sdk/{outbound-attachment-ivAHpWnn.js → outbound-attachment-DdVkqUzE.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-CvJ6Qa1Q.d.ts → pairing-message-BMkkS038.d.ts} +2 -2
- package/dist/plugin-sdk/{pairing-message-CqYG12t-.js → pairing-message-ClqhfCUk.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-D-21Sphe.js → pairing-store-B01mCSct.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-B6gD1clF.js → pi-model-discovery-Buz0JC1Y.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-3yDxS3ro.js → pi-model-discovery-runtime-DuwuoteY.js} +2 -2
- package/dist/plugin-sdk/{probe-Cyb-DGA3.js → probe--7xtfzMm.js} +3 -3
- package/dist/plugin-sdk/{probe-Dlk0Jxpw.js → probe-BFroeK3g.js} +1 -1
- package/dist/plugin-sdk/{probe-D8JAILir.js → probe-l_whvGLY.js} +1 -1
- package/dist/plugin-sdk/{resolve-channels-zEnvugag.js → probe-xY3Ky0Tx.js} +3 -4
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
- package/dist/plugin-sdk/{pw-ai-CMplwiwf.js → pw-ai-B0domrii.js} +6 -8
- package/dist/plugin-sdk/{qmd-manager-DCUE21Kj.js → qmd-manager-CFFeM4Fl.js} +3 -3
- package/dist/plugin-sdk/{query-expansion-Zr9qQixm.js → query-expansion-CAI2kKLQ.js} +1 -1
- package/dist/plugin-sdk/{replies-wiI4veI7.js → replies-1macZ1mZ.js} +4 -4
- package/dist/plugin-sdk/{resolve-channels-ChWKWtA9.js → resolve-channels-87LZrFk_.js} +2 -2
- package/dist/plugin-sdk/resolve-channels-CwB2_019.js +4 -0
- package/dist/plugin-sdk/{resolve-outbound-target-bm9RUK5q.js → resolve-outbound-target-BdH6LUoW.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-ekGNc6os.js → resolve-route-CkNIKKEW.js} +1 -1
- package/dist/plugin-sdk/{resolve-users-BTvjQuui.js → resolve-users-Cxb5wpAQ.js} +1 -1
- package/dist/plugin-sdk/{resolve-users-CTzoruIZ.js → resolve-users-V6dHh_2B.js} +2 -2
- package/dist/plugin-sdk/{retry-policy-BvlC2SPh.js → retry-policy-9ybIh4Fq.js} +1 -1
- package/dist/plugin-sdk/{runtime-ClSakPxR.js → runtime-Dy420wBu.js} +3 -3
- package/dist/plugin-sdk/{runtime-dependency-yAWxH4El.js → runtime-dependency-CIw9t7-k.js} +123 -15
- package/dist/plugin-sdk/{sandbox-paths-lj7_EVuA.js → sandbox-paths-w64tYl0v.js} +1 -1
- package/dist/plugin-sdk/sat-runtime.d.ts +3 -3
- package/dist/plugin-sdk/sat-runtime.js +44 -10
- package/dist/plugin-sdk/{send-D264hFVb.js → send-2VcOMTN5.js} +9 -9
- package/dist/plugin-sdk/{send-CgyS75Av.js → send-BQUtCJFW.js} +10 -10
- package/dist/plugin-sdk/{send-D58yEeH4.js → send-DPJIIYAs.js} +6 -6
- package/dist/plugin-sdk/{send-C7x6gzSl.js → send-Dqes9tdU.js} +13 -13
- package/dist/plugin-sdk/{send-DrAtUGLM.js → send-J4JWKP62.js} +8 -8
- package/dist/plugin-sdk/{session-DyMtb5YQ.js → session-C_n2S5ub.js} +3 -3
- package/dist/plugin-sdk/{skill-commands-Q80wCyry.js → skill-commands-B7wx9ax8.js} +102 -102
- package/dist/plugin-sdk/{slack-C-I6q3NB.js → slack-BouRQG-W.js} +64 -68
- package/dist/plugin-sdk/{slack-actions-dGE_t_Un.js → slack-actions-CasHVtiq.js} +20 -21
- package/dist/plugin-sdk/slack.d.ts +5 -5
- package/dist/plugin-sdk/slack.js +13 -13
- package/dist/plugin-sdk/{ssrf-BZG8Ztod.js → ssrf-fG4UHKBw.js} +180 -2
- package/dist/plugin-sdk/{sticker-cache-DCrDTYIi.js → sticker-cache-BvGEUas3.js} +3 -3
- package/dist/plugin-sdk/{tables-0mhUOh5v.js → tables-CjlQJV4r.js} +2 -2
- package/dist/plugin-sdk/{device-pairing-D2Yq-_U6.js → tailscale-status-DwpNdO3Z.js} +104 -2
- package/dist/plugin-sdk/{targets-znKHngSk.js → targets-QfP164Dh.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-GBYY8-x9.js → telegram-actions-CwYjV6Db.js} +48 -52
- package/dist/plugin-sdk/telegram.d.ts +5 -5
- package/dist/plugin-sdk/telegram.js +11 -11
- package/dist/plugin-sdk/{thread-bindings.lifecycle-ClzPBK70.js → thread-bindings.lifecycle-DU4iX_Jr.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-Ha01nmrq.js → thread-bindings.state-BgYWFjNF.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-C_xfeEN9.d.ts → tmp-fased-dir-BdFQvrvw.d.ts} +2 -2
- package/dist/plugin-sdk/{types-DV5TNhMK.d.ts → types-BYDL6dQj.d.ts} +2 -2
- package/dist/plugin-sdk/{types-BI2njxWJ.d.ts → types-CLIvQaVg.d.ts} +39 -5
- package/dist/plugin-sdk/{types-CBCtqtMn.d.ts → types-DyhXnYUr.d.ts} +1 -1
- package/dist/plugin-sdk/{types.plugin-CvUiB3Kh.d.ts → types.plugin-_fbu40Re.d.ts} +8 -5
- package/dist/plugin-sdk/{web-CJMfhGFY.js → web-D0yENDve.js} +52 -56
- package/dist/plugin-sdk/{whatsapp-actions-0ZbGo5ZV.js → whatsapp-actions-BT2nPLyo.js} +18 -19
- package/dist/plugin-sdk/{whatsapp-heartbeat-DGTsuvQ8.js → whatsapp-heartbeat-CiABSZ6G.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +5 -5
- package/dist/plugin-sdk/whatsapp.js +14 -14
- package/dist/plugin-sdk/{wsl-D5jDUlms.js → wsl-B_ojyEtC.js} +53 -53
- 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/runtime/index.js +1 -1
- package/dist/plugins/status-cache.js +9 -9
- package/dist/plugins/update.js +3 -3
- package/dist/plugins/web-search-install-catalog.js +3 -3
- package/dist/providers/github-copilot-model-discovery.js +51 -0
- package/dist/providers/litellm-models.js +1 -1
- package/dist/providers/openai-codex-model-discovery.js +166 -0
- package/dist/providers/refresh.js +311 -67
- package/dist/providers/registry.js +16 -6
- package/dist/providers/runtime-model-catalog.js +250 -0
- 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/model-thinking.js +54 -4
- 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/bot-message-context.js +1 -1
- 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 +31 -13
- 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 +2 -1
- package/dist/control-ui/assets/chat-model-ref-B9sWop67.js +0 -2
- package/dist/plugin-sdk/ip-C70a-YlD.js +0 -181
- package/dist/plugin-sdk/tailscale-status-ClsquRGs.js +0 -104
- package/dist/plugin-sdk/wallet-status-CyovJojz.js +0 -11944
- package/dist/plugin-sdk/ws-CocpWGhl.js +0 -114
- /package/dist/plugin-sdk/{blocks-input-Dcitfh7h.js → blocks-input-Bg-8S2pl.js} +0 -0
- /package/dist/plugin-sdk/{channel-activity-Cg1xRoc2.js → channel-activity-DBDMQ3yI.js} +0 -0
- /package/dist/plugin-sdk/{channel-core-BOkyXXLa.js → channel-core-CFRs8LPy.js} +0 -0
- /package/dist/plugin-sdk/{client-D2N7hqVu.js → client-pI228AVT.js} +0 -0
- /package/dist/plugin-sdk/{command-poll-backoff-NAePk3eL.js → command-poll-backoff-yJU83wEq.js} +0 -0
- /package/dist/plugin-sdk/{date-time-CE3Uer3C.js → date-time-uUevHscU.js} +0 -0
- /package/dist/plugin-sdk/{diagnostic-session-state-HO94DMou.js → diagnostic-session-state-DqgfGYqZ.js} +0 -0
- /package/dist/plugin-sdk/{draft-stream-loop-CKyHn8IX.js → draft-stream-loop-CrOPfV3F.js} +0 -0
- /package/dist/plugin-sdk/{fetch-Cu-ahkie.js → fetch-BtmoPIlf.js} +0 -0
- /package/dist/plugin-sdk/{gateway-registry-DFsoY6C0.js → gateway-registry-DZDsqicG.js} +0 -0
- /package/dist/plugin-sdk/{inbound-context-BFnIdcqI.js → inbound-context-DrAcXE0y.js} +0 -0
- /package/dist/plugin-sdk/{internal-qo16nNU1.js → internal-CG_nHo-2.js} +0 -0
- /package/dist/plugin-sdk/{memory-search-C3C0bD2H.js → memory-search-VFll-AIb.js} +0 -0
- /package/dist/plugin-sdk/{pairing-token-N_6Jbt1L.js → pairing-token-Cs3BRKc0.js} +0 -0
- /package/dist/plugin-sdk/{path-alias-guards-Dg3gU-MA.js → path-alias-guards-BJZD5JMJ.js} +0 -0
- /package/dist/plugin-sdk/{polls-DQrR-qT3.js → polls-DKQXVfJp.js} +0 -0
- /package/dist/plugin-sdk/{proxy-7xs_rsnV.js → proxy-DWpYcsvR.js} +0 -0
- /package/dist/plugin-sdk/{qmd-scope-D1sSG_Rx.js → qmd-scope-CdX34VCV.js} +0 -0
- /package/dist/plugin-sdk/{redact-identifier-Q3tkvxhm.js → redact-identifier-Lt7t3l7S.js} +0 -0
- /package/dist/plugin-sdk/{redact-sensitive-url-dPvnFFsK.js → redact-sensitive-url-g-ukZjwA.js} +0 -0
- /package/dist/plugin-sdk/{render-Bwu_WxwA.js → render-e7fENCYH.js} +0 -0
- /package/dist/plugin-sdk/{reply-prefix-Bqzm6DC1.js → reply-prefix-ClpxvL_w.js} +0 -0
- /package/dist/plugin-sdk/{reply-reference-BkbK_DWT.js → reply-reference-Bqk-7HXE.js} +0 -0
- /package/dist/plugin-sdk/{secure-random-Bl-AVLVb.js → secure-random-BIkG-k4s.js} +0 -0
- /package/dist/plugin-sdk/{shared-clhhbWN3.js → shared-CBgp_GBw.js} +0 -0
- /package/dist/plugin-sdk/{target-errors-C_SVKoEv.js → target-errors-Ckufe179.js} +0 -0
- /package/dist/plugin-sdk/{targets-BDvvnlph.js → targets-CoMJ1ry1.js} +0 -0
- /package/dist/plugin-sdk/{tokens-BvtlOzVP.js → tokens-BbnqfVuu.js} +0 -0
- /package/dist/plugin-sdk/{tool-loop-detection-CWphm1k_.js → tool-loop-detection-Bp8bPJLs.js} +0 -0
- /package/dist/plugin-sdk/{ui-e020ouhJ.js → ui-Be8cLHIS.js} +0 -0
- /package/dist/plugin-sdk/{with-timeout-BYrRAYFV.js → with-timeout-ckWB8rTo.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BASE_THINKING_LEVELS, XHIGH_THINKING_LEVELS, resolveModelThinkingCapability } from "../shared/model-thinking.js";
|
|
2
2
|
import { CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID, CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF, CLOUDFLARE_AI_GATEWAY_MODEL_CATALOG, CLOUDFLARE_AI_GATEWAY_MODEL_IDS, CLOUDFLARE_AI_GATEWAY_MODEL_REFS, CLOUDFLARE_AI_GATEWAY_PROVIDER_BRAND_ID, CLOUDFLARE_AI_GATEWAY_ROUTE_ID, buildCloudflareAiGatewayModelCapabilityOverrides, resolveCloudflareAiGatewayBaseUrl } from "./cloudflare-ai-gateway-shared.js";
|
|
3
3
|
import { HUGGINGFACE_DEFAULT_MODEL_ID, HUGGINGFACE_DEFAULT_MODEL_REF, HUGGINGFACE_MODEL_IDS, HUGGINGFACE_MODEL_REFS, buildHuggingfaceModelCapabilityOverrides } from "./huggingface-models.js";
|
|
4
|
-
import { LITELLM_BASE_URL, LITELLM_DEFAULT_MODEL_ID, LITELLM_DEFAULT_MODEL_REF, LITELLM_MODEL_IDS, LITELLM_MODEL_REFS, buildLitellmModelCapabilityOverrides } from "./litellm-models.js";
|
|
5
4
|
import { OPENCODE_ZEN_DEFAULT_MODEL, OPENCODE_ZEN_DEFAULT_MODEL_REF, OPENCODE_ZEN_MODEL_IDS, OPENCODE_ZEN_MODEL_REFS, buildOpencodeZenModelCapabilityOverrides } from "./opencode-zen-shared.js";
|
|
6
5
|
import { SYNTHETIC_MODEL_IDS, buildSyntheticModelCapabilityOverrides } from "./synthetic-models.js";
|
|
7
6
|
import { TOGETHER_DEFAULT_MODEL_ID, TOGETHER_DEFAULT_MODEL_REF, TOGETHER_MODEL_IDS, TOGETHER_MODEL_REFS, buildTogetherModelCapabilityOverrides } from "./together-models.js";
|
|
8
7
|
import { VENICE_DEFAULT_MODEL_ID, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_IDS, VENICE_MODEL_REFS, buildVeniceModelCapabilityOverrides } from "./venice-models.js";
|
|
9
8
|
import { VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF, VERCEL_AI_GATEWAY_MODEL_IDS, VERCEL_AI_GATEWAY_MODEL_REFS, buildVercelAiGatewayModelCapabilityOverrides } from "./vercel-ai-gateway-models.js";
|
|
10
9
|
import { XIAOMI_MODEL_IDS, buildXiaomiModelCapabilityOverrides } from "./xiaomi-models.js";
|
|
10
|
+
import { LITELLM_BASE_URL, LITELLM_DEFAULT_MODEL_ID, LITELLM_MODEL_IDS, LITELLM_MODEL_REFS } from "./litellm-models.js";
|
|
11
11
|
|
|
12
12
|
//#region src/providers/registry.ts
|
|
13
13
|
const PROVIDER_BRAND_ORDER = [
|
|
@@ -422,7 +422,6 @@ const SYNTHETIC_MODEL_CAPABILITY_OVERRIDES = buildSyntheticModelCapabilityOverri
|
|
|
422
422
|
const TOGETHER_MODEL_CAPABILITY_OVERRIDES = buildTogetherModelCapabilityOverrides(TOGETHER_ROUTE_ID);
|
|
423
423
|
const HUGGINGFACE_MODEL_CAPABILITY_OVERRIDES = buildHuggingfaceModelCapabilityOverrides(HUGGINGFACE_ROUTE_ID);
|
|
424
424
|
const VENICE_MODEL_CAPABILITY_OVERRIDES = buildVeniceModelCapabilityOverrides(VENICE_ROUTE_ID);
|
|
425
|
-
const LITELLM_MODEL_CAPABILITY_OVERRIDES = buildLitellmModelCapabilityOverrides(LITELLM_ROUTE_ID);
|
|
426
425
|
const CLOUDFLARE_AI_GATEWAY_MODEL_CAPABILITY_OVERRIDES = buildCloudflareAiGatewayModelCapabilityOverrides(CLOUDFLARE_AI_GATEWAY_ROUTE_ID);
|
|
427
426
|
const CUSTOM_PROVIDER_MODEL_REFS = [];
|
|
428
427
|
function parseModelRef(ref) {
|
|
@@ -764,7 +763,7 @@ const OPENAI_PROVIDER_MANIFEST = {
|
|
|
764
763
|
id: "openai-codex",
|
|
765
764
|
route: OPENAI_CODEX_ROUTE_ID,
|
|
766
765
|
kind: "oauth",
|
|
767
|
-
label: "
|
|
766
|
+
label: "ChatGPT sign-in",
|
|
768
767
|
hint: "Open the OpenAI sign-in URL, finish login in the browser, then Fased completes the OAuth flow."
|
|
769
768
|
}, {
|
|
770
769
|
id: "openai-api-key",
|
|
@@ -1437,12 +1436,12 @@ const LITELLM_PROVIDER_MANIFEST = {
|
|
|
1437
1436
|
hint: "LiteLLM Proxy virtual key or master key plus /v1 base URL"
|
|
1438
1437
|
}],
|
|
1439
1438
|
models: {
|
|
1440
|
-
recommended: [
|
|
1439
|
+
recommended: [],
|
|
1441
1440
|
dynamic: true,
|
|
1442
1441
|
operatorCatalog: true,
|
|
1443
1442
|
routeRules: { [LITELLM_ROUTE_ID]: [`${LITELLM_ROUTE_ID}/*`] }
|
|
1444
1443
|
},
|
|
1445
|
-
modelCapabilities:
|
|
1444
|
+
modelCapabilities: {}
|
|
1446
1445
|
};
|
|
1447
1446
|
const CLOUDFLARE_AI_GATEWAY_PROVIDER_MANIFEST = {
|
|
1448
1447
|
id: CLOUDFLARE_AI_GATEWAY_PROVIDER_BRAND_ID,
|
|
@@ -1581,6 +1580,17 @@ function isStandardProviderModelRef(ref) {
|
|
|
1581
1580
|
}
|
|
1582
1581
|
return STANDARD_PROVIDER_MODEL_REFS.has(value.toLowerCase());
|
|
1583
1582
|
}
|
|
1583
|
+
function providerModelRecommendationRank(provider, model) {
|
|
1584
|
+
const manifest = getProviderBrandManifestForRoute(provider);
|
|
1585
|
+
if (!manifest) {
|
|
1586
|
+
return undefined;
|
|
1587
|
+
}
|
|
1588
|
+
const normalizedProvider = provider.trim().toLowerCase();
|
|
1589
|
+
const normalizedRef = `${normalizedProvider}/${model.trim().toLowerCase()}`;
|
|
1590
|
+
const routeRecommendations = manifest.models.recommended.filter((ref) => ref.trim().toLowerCase().startsWith(`${normalizedProvider}/`));
|
|
1591
|
+
const index = routeRecommendations.findIndex((ref) => ref.trim().toLowerCase() === normalizedRef);
|
|
1592
|
+
return index >= 0 ? index + 1 : undefined;
|
|
1593
|
+
}
|
|
1584
1594
|
function isStandardProviderCatalogEntry(entry) {
|
|
1585
1595
|
const provider = entry.provider.trim();
|
|
1586
1596
|
const id = entry.id.trim();
|
|
@@ -1591,4 +1601,4 @@ function isStandardProviderCatalogEntry(entry) {
|
|
|
1591
1601
|
}
|
|
1592
1602
|
|
|
1593
1603
|
//#endregion
|
|
1594
|
-
export { ANTHROPIC_MODEL_IDS, ANTHROPIC_PROVIDER_BRAND_ID, ANTHROPIC_PROVIDER_MANIFEST, ANTHROPIC_ROUTE_ID, BYTEPLUS_CODING_MODEL_IDS, BYTEPLUS_CODING_MODEL_REFS, BYTEPLUS_CODING_ROUTE_ID, BYTEPLUS_MODEL_IDS, BYTEPLUS_MODEL_REFS, BYTEPLUS_PLAN_ROUTE_ID, BYTEPLUS_PROVIDER_BRAND_ID, BYTEPLUS_ROUTE_ID, CHUTES_MODEL_IDS, CHUTES_PROVIDER_BRAND_ID, CHUTES_ROUTE_ID, COPILOT_PROVIDER_BRAND_ID, COPILOT_PROXY_MODEL_IDS, COPILOT_PROXY_MODEL_REFS, COPILOT_PROXY_ROUTE_ID, CUSTOM_PROVIDER_BRAND_ID, CUSTOM_PROVIDER_ROUTE_ID, GITHUB_COPILOT_DEFAULT_MODEL_REF, GITHUB_COPILOT_MODEL_IDS, GITHUB_COPILOT_MODEL_REFS, GITHUB_COPILOT_ROUTE_ID, GOOGLE_API_MODEL_REFS, GOOGLE_API_ROUTE_ID, GOOGLE_GEMINI_CLI_MODEL_REFS, GOOGLE_GEMINI_CLI_ROUTE_ID, GOOGLE_GEMINI_MODEL_IDS, GOOGLE_PROVIDER_BRAND_ID, HUGGINGFACE_PROVIDER_BRAND_ID, HUGGINGFACE_ROUTE_ID, KIMI_CODING_MODEL_IDS, KIMI_CODING_ROUTE_ID, LITELLM_PROVIDER_BRAND_ID, LITELLM_ROUTE_ID, LMSTUDIO_PROVIDER_BRAND_ID, LMSTUDIO_ROUTE_ID, MINIMAX_API_ROUTE_ID, MINIMAX_CN_ROUTE_ID, MINIMAX_MODEL_IDS, MINIMAX_PORTAL_ROUTE_ID, MINIMAX_PROVIDER_BRAND_ID, MISTRAL_MODEL_IDS, MISTRAL_MODEL_REFS, MISTRAL_PROVIDER_BRAND_ID, MISTRAL_ROUTE_ID, MOONSHOT_MODEL_IDS, MOONSHOT_PROVIDER_BRAND_ID, MOONSHOT_ROUTE_ID, OLLAMA_PROVIDER_BRAND_ID, OLLAMA_ROUTE_ID, OPENAI_API_MODEL_IDS, OPENAI_API_MODEL_REFS, OPENAI_API_ROUTE_ID, OPENAI_CODEX_ROUTE_ID, OPENAI_PROVIDER_BRAND_ID, OPENAI_SIGN_IN_MODEL_IDS, OPENAI_SIGN_IN_MODEL_REFS, OPENCODE_ZEN_PROVIDER_BRAND_ID, OPENCODE_ZEN_ROUTE_ID, OPENROUTER_MODEL_IDS, OPENROUTER_MODEL_REFS, OPENROUTER_PROVIDER_BRAND_ID, OPENROUTER_ROUTE_ID, PROVIDER_BRAND_ORDER, QIANFAN_MODEL_IDS, QIANFAN_MODEL_REFS, QIANFAN_PROVIDER_BRAND_ID, QIANFAN_ROUTE_ID, QWEN_API_MODEL_IDS, QWEN_API_ROUTE_ID, QWEN_CODING_PLAN_MODEL_IDS, QWEN_CODING_PLAN_ROUTE_ID, QWEN_PROVIDER_BRAND_ID, SYNTHETIC_MODEL_REFS, SYNTHETIC_PROVIDER_BRAND_ID, SYNTHETIC_ROUTE_ID, TOGETHER_PROVIDER_BRAND_ID, TOGETHER_ROUTE_ID, VENICE_PROVIDER_BRAND_ID, VENICE_ROUTE_ID, VERCEL_AI_GATEWAY_PROVIDER_BRAND_ID, VERCEL_AI_GATEWAY_ROUTE_ID, VLLM_PROVIDER_BRAND_ID, VLLM_ROUTE_ID, VOLCENGINE_CODING_MODEL_IDS, VOLCENGINE_CODING_MODEL_REFS, VOLCENGINE_CODING_ROUTE_ID, VOLCENGINE_MODEL_IDS, VOLCENGINE_MODEL_REFS, VOLCENGINE_PLAN_ROUTE_ID, VOLCENGINE_PROVIDER_BRAND_ID, VOLCENGINE_ROUTE_ID, XAI_MODEL_IDS, XAI_MODEL_REFS, XAI_PROVIDER_BRAND_ID, XAI_ROUTE_ID, XIAOMI_MODEL_REFS, XIAOMI_PROVIDER_BRAND_ID, XIAOMI_ROUTE_ID, ZAI_MODEL_IDS, ZAI_MODEL_REFS, ZAI_PROVIDER_BRAND_ID, ZAI_ROUTE_ID, getProviderBrandManifestForRoute,
|
|
1604
|
+
export { ANTHROPIC_MODEL_IDS, ANTHROPIC_PROVIDER_BRAND_ID, ANTHROPIC_PROVIDER_MANIFEST, ANTHROPIC_ROUTE_ID, BYTEPLUS_CODING_MODEL_IDS, BYTEPLUS_CODING_MODEL_REFS, BYTEPLUS_CODING_ROUTE_ID, BYTEPLUS_MODEL_IDS, BYTEPLUS_MODEL_REFS, BYTEPLUS_PLAN_ROUTE_ID, BYTEPLUS_PROVIDER_BRAND_ID, BYTEPLUS_ROUTE_ID, CHUTES_MODEL_IDS, CHUTES_PROVIDER_BRAND_ID, CHUTES_ROUTE_ID, COPILOT_PROVIDER_BRAND_ID, COPILOT_PROXY_MODEL_IDS, COPILOT_PROXY_MODEL_REFS, COPILOT_PROXY_ROUTE_ID, CUSTOM_PROVIDER_BRAND_ID, CUSTOM_PROVIDER_ROUTE_ID, GITHUB_COPILOT_DEFAULT_MODEL_REF, GITHUB_COPILOT_MODEL_IDS, GITHUB_COPILOT_MODEL_REFS, GITHUB_COPILOT_ROUTE_ID, GOOGLE_API_MODEL_REFS, GOOGLE_API_ROUTE_ID, GOOGLE_GEMINI_CLI_MODEL_REFS, GOOGLE_GEMINI_CLI_ROUTE_ID, GOOGLE_GEMINI_MODEL_IDS, GOOGLE_PROVIDER_BRAND_ID, HUGGINGFACE_PROVIDER_BRAND_ID, HUGGINGFACE_ROUTE_ID, KIMI_CODING_MODEL_IDS, KIMI_CODING_ROUTE_ID, LITELLM_PROVIDER_BRAND_ID, LITELLM_ROUTE_ID, LMSTUDIO_PROVIDER_BRAND_ID, LMSTUDIO_ROUTE_ID, MINIMAX_API_ROUTE_ID, MINIMAX_CN_ROUTE_ID, MINIMAX_MODEL_IDS, MINIMAX_PORTAL_ROUTE_ID, MINIMAX_PROVIDER_BRAND_ID, MISTRAL_MODEL_IDS, MISTRAL_MODEL_REFS, MISTRAL_PROVIDER_BRAND_ID, MISTRAL_ROUTE_ID, MOONSHOT_MODEL_IDS, MOONSHOT_PROVIDER_BRAND_ID, MOONSHOT_ROUTE_ID, OLLAMA_PROVIDER_BRAND_ID, OLLAMA_ROUTE_ID, OPENAI_API_MODEL_IDS, OPENAI_API_MODEL_REFS, OPENAI_API_ROUTE_ID, OPENAI_CODEX_ROUTE_ID, OPENAI_PROVIDER_BRAND_ID, OPENAI_SIGN_IN_MODEL_IDS, OPENAI_SIGN_IN_MODEL_REFS, OPENCODE_ZEN_PROVIDER_BRAND_ID, OPENCODE_ZEN_ROUTE_ID, OPENROUTER_MODEL_IDS, OPENROUTER_MODEL_REFS, OPENROUTER_PROVIDER_BRAND_ID, OPENROUTER_ROUTE_ID, PROVIDER_BRAND_ORDER, QIANFAN_MODEL_IDS, QIANFAN_MODEL_REFS, QIANFAN_PROVIDER_BRAND_ID, QIANFAN_ROUTE_ID, QWEN_API_MODEL_IDS, QWEN_API_ROUTE_ID, QWEN_CODING_PLAN_MODEL_IDS, QWEN_CODING_PLAN_ROUTE_ID, QWEN_PROVIDER_BRAND_ID, SYNTHETIC_MODEL_REFS, SYNTHETIC_PROVIDER_BRAND_ID, SYNTHETIC_ROUTE_ID, TOGETHER_PROVIDER_BRAND_ID, TOGETHER_ROUTE_ID, VENICE_PROVIDER_BRAND_ID, VENICE_ROUTE_ID, VERCEL_AI_GATEWAY_PROVIDER_BRAND_ID, VERCEL_AI_GATEWAY_ROUTE_ID, VLLM_PROVIDER_BRAND_ID, VLLM_ROUTE_ID, VOLCENGINE_CODING_MODEL_IDS, VOLCENGINE_CODING_MODEL_REFS, VOLCENGINE_CODING_ROUTE_ID, VOLCENGINE_MODEL_IDS, VOLCENGINE_MODEL_REFS, VOLCENGINE_PLAN_ROUTE_ID, VOLCENGINE_PROVIDER_BRAND_ID, VOLCENGINE_ROUTE_ID, XAI_MODEL_IDS, XAI_MODEL_REFS, XAI_PROVIDER_BRAND_ID, XAI_ROUTE_ID, XIAOMI_MODEL_REFS, XIAOMI_PROVIDER_BRAND_ID, XIAOMI_ROUTE_ID, ZAI_MODEL_IDS, ZAI_MODEL_REFS, ZAI_PROVIDER_BRAND_ID, ZAI_ROUTE_ID, getProviderBrandManifestForRoute, isOpenAISignInRuntimeModelSupported, isStandardProviderCatalogEntry, isStandardProviderModelRef, listProviderBrandManifests, lookupProviderManifestModelCapability, providerModelRecommendationRank, resolveProviderRouteModelCapability };
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { getProviderBrandManifestForRoute } from "./registry.js";
|
|
2
|
+
import { buildModelCatalogMergeKey } from "../agents/model-catalog-normalized.js";
|
|
3
|
+
import { deriveModelMetadata } from "../agents/model-metadata.js";
|
|
4
|
+
import { buildProviderRefreshEnvFromCredentials, fetchProviderRefreshSnapshotForRoutes } from "./refresh.js";
|
|
5
|
+
import { discoverGitHubCopilotModels } from "./github-copilot-model-discovery.js";
|
|
6
|
+
import { discoverOpenAICodexModels } from "./openai-codex-model-discovery.js";
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
|
|
9
|
+
//#region src/providers/runtime-model-catalog.ts
|
|
10
|
+
const DISCOVERY_TTL_MS = 5 * 6e4;
|
|
11
|
+
let cache = null;
|
|
12
|
+
const SPECIALIZED_DISCOVERY_ROUTES = new Set(["openai-codex", "github-copilot"]);
|
|
13
|
+
function authModeForProfileType(type) {
|
|
14
|
+
return type === "api_key" ? "api-key" : type;
|
|
15
|
+
}
|
|
16
|
+
function methodMatchesAuthMode(method, authMode) {
|
|
17
|
+
const methodMode = method.kind === "api-key" || method.kind === "manual" ? "api-key" : method.kind === "token" ? "token" : "oauth";
|
|
18
|
+
return methodMode === authMode;
|
|
19
|
+
}
|
|
20
|
+
function methodRouteIds(method) {
|
|
21
|
+
return [
|
|
22
|
+
method.route,
|
|
23
|
+
method.statusRoute,
|
|
24
|
+
method.configProviderId
|
|
25
|
+
].map((value) => value?.trim().toLowerCase()).filter((value) => Boolean(value));
|
|
26
|
+
}
|
|
27
|
+
function credentialRoutesForProvider(store, route) {
|
|
28
|
+
const normalizedRoute = route.trim().toLowerCase();
|
|
29
|
+
const manifest = getProviderBrandManifestForRoute(normalizedRoute);
|
|
30
|
+
const routes = [];
|
|
31
|
+
const seen = new Set();
|
|
32
|
+
for (const profile of Object.values(store.profiles ?? {})) {
|
|
33
|
+
const profileProvider = profile.provider.trim().toLowerCase();
|
|
34
|
+
if (!profileProvider) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const profileManifest = getProviderBrandManifestForRoute(profileProvider);
|
|
38
|
+
if (profileProvider !== normalizedRoute && profileManifest?.id !== manifest?.id) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const authMode = authModeForProfileType(profile.type);
|
|
42
|
+
const method = manifest?.methods.find((candidate) => methodMatchesAuthMode(candidate, authMode) && (methodRouteIds(candidate).includes(profileProvider) || methodRouteIds(candidate).includes(normalizedRoute)));
|
|
43
|
+
const id = method?.id ?? `${normalizedRoute}:${authMode}`;
|
|
44
|
+
const key = `${id}:${authMode}`;
|
|
45
|
+
if (seen.has(key)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
seen.add(key);
|
|
49
|
+
routes.push({
|
|
50
|
+
id,
|
|
51
|
+
label: method?.label ?? manifest?.label ?? normalizedRoute,
|
|
52
|
+
authMode
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return routes;
|
|
56
|
+
}
|
|
57
|
+
function resetRuntimeProviderModelCatalogCache() {
|
|
58
|
+
cache = null;
|
|
59
|
+
}
|
|
60
|
+
function discoveryKey(params) {
|
|
61
|
+
const routes = [...params.routes].map((route) => route.trim().toLowerCase()).toSorted();
|
|
62
|
+
const endpoints = routes.map((route) => {
|
|
63
|
+
const provider = params.cfg.models?.providers?.[route];
|
|
64
|
+
return [
|
|
65
|
+
route,
|
|
66
|
+
provider?.baseUrl ?? "",
|
|
67
|
+
provider?.api ?? ""
|
|
68
|
+
];
|
|
69
|
+
});
|
|
70
|
+
const credentialIdentity = createHash("sha256").update(JSON.stringify(params.store.profiles ?? {})).digest("hex");
|
|
71
|
+
return JSON.stringify({
|
|
72
|
+
endpoints,
|
|
73
|
+
credentialIdentity
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function loadSnapshot(params) {
|
|
77
|
+
const key = discoveryKey(params);
|
|
78
|
+
const now = Date.now();
|
|
79
|
+
if (cache?.key === key && cache.expiresAt > now) {
|
|
80
|
+
return await cache.value;
|
|
81
|
+
}
|
|
82
|
+
const value = fetchProviderRefreshSnapshotForRoutes({
|
|
83
|
+
routes: params.routes,
|
|
84
|
+
env: buildProviderRefreshEnvFromCredentials({
|
|
85
|
+
env: process.env,
|
|
86
|
+
authStores: [params.store],
|
|
87
|
+
modelProviders: params.cfg.models?.providers
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
cache = {
|
|
91
|
+
key,
|
|
92
|
+
expiresAt: now + DISCOVERY_TTL_MS,
|
|
93
|
+
value
|
|
94
|
+
};
|
|
95
|
+
try {
|
|
96
|
+
return await value;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
if (cache?.value === value) {
|
|
99
|
+
cache = null;
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function discoverInteractiveRoutes(params) {
|
|
105
|
+
const discovered = new Map();
|
|
106
|
+
if (params.routes.has("openai-codex")) {
|
|
107
|
+
discovered.set("openai-codex", await discoverOpenAICodexModels({
|
|
108
|
+
cfg: params.cfg,
|
|
109
|
+
store: params.store,
|
|
110
|
+
agentDir: params.agentDir
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
if (params.routes.has("github-copilot")) {
|
|
114
|
+
discovered.set("github-copilot", await discoverGitHubCopilotModels({
|
|
115
|
+
cfg: params.cfg,
|
|
116
|
+
store: params.store,
|
|
117
|
+
agentDir: params.agentDir
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
return discovered;
|
|
121
|
+
}
|
|
122
|
+
function snapshotCapabilities(model) {
|
|
123
|
+
return {
|
|
124
|
+
...model.tools !== undefined ? { tools: model.tools } : {},
|
|
125
|
+
...model.json !== undefined ? { json: model.json } : {},
|
|
126
|
+
...model.audio !== undefined ? { audio: model.audio } : {},
|
|
127
|
+
...model.video !== undefined ? { video: model.video } : {},
|
|
128
|
+
...model.speech !== undefined ? { speech: model.speech } : {},
|
|
129
|
+
...model.thinkingLevels?.length ? { thinkingLevels: model.thinkingLevels } : {},
|
|
130
|
+
...model.defaultThinkingLevel ? { defaultThinkingLevel: model.defaultThinkingLevel } : {},
|
|
131
|
+
...model.thinkingMode ? { thinkingMode: model.thinkingMode } : {},
|
|
132
|
+
...model.reasoningBudgetSupported !== undefined ? { reasoningBudgetSupported: model.reasoningBudgetSupported } : {}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function snapshotHasCapabilityMetadata(model) {
|
|
136
|
+
return model.input !== undefined || model.reasoning !== undefined || model.tools !== undefined || model.json !== undefined || model.audio !== undefined || model.video !== undefined || model.speech !== undefined || model.thinkingLevels !== undefined || model.defaultThinkingLevel !== undefined || model.thinkingMode !== undefined || model.reasoningBudgetSupported !== undefined || model.contextWindow !== undefined || model.maxTokens !== undefined;
|
|
137
|
+
}
|
|
138
|
+
function snapshotRoutes(snapshot) {
|
|
139
|
+
const routes = new Map();
|
|
140
|
+
for (const provider of Object.values(snapshot.providers ?? {})) {
|
|
141
|
+
for (const [route, values] of Object.entries(provider.routes ?? {})) {
|
|
142
|
+
routes.set(route.trim().toLowerCase(), values.flatMap((value) => typeof value === "string" ? [{ id: value }] : value?.id?.trim() ? [value] : []));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return routes;
|
|
146
|
+
}
|
|
147
|
+
function mergeDiscoveredRoute(params) {
|
|
148
|
+
const baseByKey = new Map(params.catalog.map((model) => [buildModelCatalogMergeKey(model.provider, model.id), model]));
|
|
149
|
+
const providerConfig = params.cfg.models?.providers?.[params.route];
|
|
150
|
+
const credentialRoutes = credentialRoutesForProvider(params.store, params.route);
|
|
151
|
+
return params.discovered.map((model) => {
|
|
152
|
+
const base = baseByKey.get(buildModelCatalogMergeKey(params.route, model.id));
|
|
153
|
+
const capabilities = snapshotCapabilities(model);
|
|
154
|
+
const entry = {
|
|
155
|
+
id: model.id,
|
|
156
|
+
name: model.name ?? base?.name ?? model.id,
|
|
157
|
+
provider: params.route,
|
|
158
|
+
...model.contextWindow ?? base?.contextWindow ? { contextWindow: model.contextWindow ?? base?.contextWindow } : {},
|
|
159
|
+
...model.maxTokens ?? base?.maxTokens ? { maxTokens: model.maxTokens ?? base?.maxTokens } : {},
|
|
160
|
+
...model.reasoning ?? base?.reasoning ? { reasoning: model.reasoning ?? base?.reasoning } : {},
|
|
161
|
+
input: model.input ?? base?.input ?? ["text"],
|
|
162
|
+
...base?.baseUrl ?? providerConfig?.baseUrl ? { baseUrl: base?.baseUrl ?? providerConfig?.baseUrl } : {},
|
|
163
|
+
...base?.api ?? providerConfig?.api ? { api: base?.api ?? providerConfig?.api } : {},
|
|
164
|
+
...model.price ?? base?.cost ? { cost: model.price ?? base?.cost } : {},
|
|
165
|
+
...Object.keys(capabilities).length > 0 ? { capabilities } : {},
|
|
166
|
+
...model.responsesLite !== undefined ? { compat: {
|
|
167
|
+
...base?.compat,
|
|
168
|
+
responsesLite: model.responsesLite
|
|
169
|
+
} } : base?.compat ? { compat: base.compat } : {},
|
|
170
|
+
catalogSource: "provider-api"
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
...entry,
|
|
174
|
+
metadata: {
|
|
175
|
+
...base?.metadata,
|
|
176
|
+
...deriveModelMetadata({
|
|
177
|
+
model: entry,
|
|
178
|
+
cfg: params.cfg,
|
|
179
|
+
providerConfig,
|
|
180
|
+
...credentialRoutes.length > 0 ? { credentialRoutes } : {},
|
|
181
|
+
...snapshotHasCapabilityMetadata(model) ? {
|
|
182
|
+
capabilitySource: "provider-api",
|
|
183
|
+
capabilityRetrievedAt: params.retrievedAt
|
|
184
|
+
} : {}
|
|
185
|
+
}),
|
|
186
|
+
retrievedAt: params.retrievedAt
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
async function applyRuntimeProviderModelDiscovery(params) {
|
|
192
|
+
const requestedRoutes = new Set([...params.routes].map((route) => route.trim().toLowerCase()).filter(Boolean));
|
|
193
|
+
if (requestedRoutes.size === 0) {
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
const specializedRoutes = new Set([...requestedRoutes].filter((route) => SPECIALIZED_DISCOVERY_ROUTES.has(route)));
|
|
197
|
+
const providerApiRoutes = [...requestedRoutes].filter((route) => !specializedRoutes.has(route));
|
|
198
|
+
const interactiveRoutes = await discoverInteractiveRoutes({
|
|
199
|
+
routes: requestedRoutes,
|
|
200
|
+
cfg: params.cfg,
|
|
201
|
+
store: params.store,
|
|
202
|
+
agentDir: params.agentDir
|
|
203
|
+
}).catch(() => new Map());
|
|
204
|
+
let discoveredRoutes = new Map(interactiveRoutes);
|
|
205
|
+
if (providerApiRoutes.length > 0) {
|
|
206
|
+
try {
|
|
207
|
+
const snapshot = await loadSnapshot({
|
|
208
|
+
...params,
|
|
209
|
+
routes: providerApiRoutes
|
|
210
|
+
});
|
|
211
|
+
discoveredRoutes = new Map([...discoveredRoutes, ...snapshotRoutes(snapshot)]);
|
|
212
|
+
} catch {}
|
|
213
|
+
}
|
|
214
|
+
const retrievedAt = new Date().toISOString();
|
|
215
|
+
const authoritativeRoutes = new Set([...discoveredRoutes.keys()].filter((route) => requestedRoutes.has(route)));
|
|
216
|
+
const replacedRoutes = new Set(providerApiRoutes);
|
|
217
|
+
for (const route of specializedRoutes) {
|
|
218
|
+
replacedRoutes.add(route);
|
|
219
|
+
}
|
|
220
|
+
const retained = params.catalog.filter((model) => !replacedRoutes.has(model.provider.trim().toLowerCase()));
|
|
221
|
+
const discovered = [...authoritativeRoutes].flatMap((route) => mergeDiscoveredRoute({
|
|
222
|
+
route,
|
|
223
|
+
discovered: discoveredRoutes.get(route) ?? [],
|
|
224
|
+
catalog: params.catalog,
|
|
225
|
+
cfg: params.cfg,
|
|
226
|
+
store: params.store,
|
|
227
|
+
retrievedAt
|
|
228
|
+
}));
|
|
229
|
+
return [...retained, ...discovered].toSorted((left, right) => left.provider.localeCompare(right.provider) || (left.metadata?.recommendationRank ?? Number.MAX_SAFE_INTEGER) - (right.metadata?.recommendationRank ?? Number.MAX_SAFE_INTEGER) || left.name.localeCompare(right.name));
|
|
230
|
+
}
|
|
231
|
+
function filterCatalogToAuthoritativeAvailability(catalog, store) {
|
|
232
|
+
const specializedProviders = store ? new Set(Object.values(store.profiles ?? {}).map((profile) => profile.provider.trim().toLowerCase()).filter((provider) => SPECIALIZED_DISCOVERY_ROUTES.has(provider))) : new Set();
|
|
233
|
+
const byProvider = new Map();
|
|
234
|
+
for (const model of catalog) {
|
|
235
|
+
const provider = model.provider.trim().toLowerCase();
|
|
236
|
+
byProvider.set(provider, [...byProvider.get(provider) ?? [], model]);
|
|
237
|
+
}
|
|
238
|
+
return [...byProvider.entries()].flatMap(([provider, models]) => {
|
|
239
|
+
if (models.some((model) => model.catalogSource === "provider-api")) {
|
|
240
|
+
return models.filter((model) => model.catalogSource === "provider-api");
|
|
241
|
+
}
|
|
242
|
+
if (specializedProviders.has(provider)) {
|
|
243
|
+
return models.filter((model) => model.catalogSource === "runtime" || model.catalogSource === "provider-api");
|
|
244
|
+
}
|
|
245
|
+
return models;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
//#endregion
|
|
250
|
+
export { applyRuntimeProviderModelDiscovery, filterCatalogToAuthoritativeAvailability, resetRuntimeProviderModelCatalogCache };
|
package/dist/secrets/apply.js
CHANGED
|
@@ -12,7 +12,7 @@ import { listKnownSecretEnvVarNames } from "./provider-env-vars.js";
|
|
|
12
12
|
import { createSecretsConfigIO } from "./config-io.js";
|
|
13
13
|
import { normalizeSecretsPlanOptions, resolveValidatedTargetPathSegments } from "./plan.js";
|
|
14
14
|
import { prepareSecretsRuntimeSnapshot } from "./runtime.js";
|
|
15
|
-
import
|
|
15
|
+
import syncFs from "node:fs";
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -125,8 +125,8 @@ function collectAuthStorePaths(config, stateDir) {
|
|
|
125
125
|
const paths = new Set();
|
|
126
126
|
paths.add(path.join(resolveUserPath(stateDir), "agents", "main", "agent", "auth-profiles.json"));
|
|
127
127
|
const agentsRoot = path.join(resolveUserPath(stateDir), "agents");
|
|
128
|
-
if (
|
|
129
|
-
for (const entry of
|
|
128
|
+
if (syncFs.existsSync(agentsRoot)) {
|
|
129
|
+
for (const entry of syncFs.readdirSync(agentsRoot, { withFileTypes: true })) {
|
|
130
130
|
if (!entry.isDirectory()) {
|
|
131
131
|
continue;
|
|
132
132
|
}
|
|
@@ -146,15 +146,15 @@ function collectAuthStorePaths(config, stateDir) {
|
|
|
146
146
|
function collectAuthJsonPaths(stateDir) {
|
|
147
147
|
const out = [];
|
|
148
148
|
const agentsRoot = path.join(resolveUserPath(stateDir), "agents");
|
|
149
|
-
if (!
|
|
149
|
+
if (!syncFs.existsSync(agentsRoot)) {
|
|
150
150
|
return out;
|
|
151
151
|
}
|
|
152
|
-
for (const entry of
|
|
152
|
+
for (const entry of syncFs.readdirSync(agentsRoot, { withFileTypes: true })) {
|
|
153
153
|
if (!entry.isDirectory()) {
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
156
|
const candidate = path.join(agentsRoot, entry.name, "agent", "auth.json");
|
|
157
|
-
if (
|
|
157
|
+
if (syncFs.existsSync(candidate)) {
|
|
158
158
|
out.push(candidate);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -249,10 +249,10 @@ async function projectPlanState(params) {
|
|
|
249
249
|
const authStoreByPath = new Map();
|
|
250
250
|
if (options.scrubAuthProfilesForProviderTargets && providerTargets.size > 0) {
|
|
251
251
|
for (const authStorePath of collectAuthStorePaths(nextConfig, stateDir)) {
|
|
252
|
-
if (!
|
|
252
|
+
if (!syncFs.existsSync(authStorePath)) {
|
|
253
253
|
continue;
|
|
254
254
|
}
|
|
255
|
-
const raw =
|
|
255
|
+
const raw = syncFs.readFileSync(authStorePath, "utf8");
|
|
256
256
|
const parsed = JSON.parse(raw);
|
|
257
257
|
if (!isRecord(parsed) || !isRecord(parsed.profiles)) {
|
|
258
258
|
continue;
|
|
@@ -308,7 +308,7 @@ async function projectPlanState(params) {
|
|
|
308
308
|
const authJsonByPath = new Map();
|
|
309
309
|
if (options.scrubLegacyAuthJson) {
|
|
310
310
|
for (const authJsonPath of collectAuthJsonPaths(stateDir)) {
|
|
311
|
-
const raw =
|
|
311
|
+
const raw = syncFs.readFileSync(authJsonPath, "utf8");
|
|
312
312
|
const parsed = JSON.parse(raw);
|
|
313
313
|
if (!isRecord(parsed)) {
|
|
314
314
|
continue;
|
|
@@ -333,8 +333,8 @@ async function projectPlanState(params) {
|
|
|
333
333
|
const envRawByPath = new Map();
|
|
334
334
|
if (options.scrubEnv && scrubbedValues.size > 0) {
|
|
335
335
|
const envPath = path.join(resolveConfigDir(params.env, os.homedir), ".env");
|
|
336
|
-
if (
|
|
337
|
-
const current =
|
|
336
|
+
if (syncFs.existsSync(envPath)) {
|
|
337
|
+
const current = syncFs.readFileSync(envPath, "utf8");
|
|
338
338
|
const scrubbed = scrubEnvRaw(current, scrubbedValues, new Set(listKnownSecretEnvVarNames()));
|
|
339
339
|
if (scrubbed.removed > 0 && scrubbed.nextRaw !== current) {
|
|
340
340
|
envRawByPath.set(envPath, scrubbed.nextRaw);
|
|
@@ -387,24 +387,24 @@ async function projectPlanState(params) {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
function captureFileSnapshot(pathname) {
|
|
390
|
-
if (!
|
|
390
|
+
if (!syncFs.existsSync(pathname)) {
|
|
391
391
|
return {
|
|
392
392
|
existed: false,
|
|
393
393
|
content: "",
|
|
394
394
|
mode: 384
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
const stat =
|
|
397
|
+
const stat = syncFs.statSync(pathname);
|
|
398
398
|
return {
|
|
399
399
|
existed: true,
|
|
400
|
-
content:
|
|
400
|
+
content: syncFs.readFileSync(pathname, "utf8"),
|
|
401
401
|
mode: stat.mode & 511
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
404
|
function restoreFileSnapshot(pathname, snapshot) {
|
|
405
405
|
if (!snapshot.existed) {
|
|
406
|
-
if (
|
|
407
|
-
|
|
406
|
+
if (syncFs.existsSync(pathname)) {
|
|
407
|
+
syncFs.rmSync(pathname, { force: true });
|
|
408
408
|
}
|
|
409
409
|
return;
|
|
410
410
|
}
|
package/dist/secrets/audit.js
CHANGED
|
@@ -10,7 +10,7 @@ import { resolveSecretRefValue, resolveSecretRefValues } from "./resolve.js";
|
|
|
10
10
|
import { normalizeProviderId } from "../agents/model-selection.js";
|
|
11
11
|
import { listKnownSecretEnvVarNames } from "./provider-env-vars.js";
|
|
12
12
|
import { createSecretsConfigIO } from "./config-io.js";
|
|
13
|
-
import
|
|
13
|
+
import syncFs from "node:fs";
|
|
14
14
|
import os from "node:os";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
|
|
@@ -51,12 +51,12 @@ function parseEnvValue(raw) {
|
|
|
51
51
|
return trimmed;
|
|
52
52
|
}
|
|
53
53
|
function collectEnvPlaintext(params) {
|
|
54
|
-
if (!
|
|
54
|
+
if (!syncFs.existsSync(params.envPath)) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
params.collector.filesScanned.add(params.envPath);
|
|
58
58
|
const knownKeys = new Set(listKnownSecretEnvVarNames());
|
|
59
|
-
const raw =
|
|
59
|
+
const raw = syncFs.readFileSync(params.envPath, "utf8");
|
|
60
60
|
const lines = raw.split(/\r?\n/);
|
|
61
61
|
for (const line of lines) {
|
|
62
62
|
const match = line.match(/^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);
|
|
@@ -81,11 +81,11 @@ function collectEnvPlaintext(params) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
function readJsonObject(filePath) {
|
|
84
|
-
if (!
|
|
84
|
+
if (!syncFs.existsSync(filePath)) {
|
|
85
85
|
return { value: null };
|
|
86
86
|
}
|
|
87
87
|
try {
|
|
88
|
-
const raw =
|
|
88
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
89
89
|
const parsed = JSON.parse(raw);
|
|
90
90
|
if (!isRecord(parsed)) {
|
|
91
91
|
return { value: null };
|
|
@@ -196,8 +196,8 @@ function collectAuthStorePaths(config, stateDir) {
|
|
|
196
196
|
const paths = new Set();
|
|
197
197
|
paths.add(path.join(resolveUserPath(stateDir), "agents", "main", "agent", "auth-profiles.json"));
|
|
198
198
|
const agentsRoot = path.join(resolveUserPath(stateDir), "agents");
|
|
199
|
-
if (
|
|
200
|
-
for (const entry of
|
|
199
|
+
if (syncFs.existsSync(agentsRoot)) {
|
|
200
|
+
for (const entry of syncFs.readdirSync(agentsRoot, { withFileTypes: true })) {
|
|
201
201
|
if (!entry.isDirectory()) {
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
@@ -215,7 +215,7 @@ function collectAuthStorePaths(config, stateDir) {
|
|
|
215
215
|
return [...paths];
|
|
216
216
|
}
|
|
217
217
|
function collectAuthStoreSecrets(params) {
|
|
218
|
-
if (!
|
|
218
|
+
if (!syncFs.existsSync(params.authStorePath)) {
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
params.collector.filesScanned.add(params.authStorePath);
|
|
@@ -315,15 +315,15 @@ function collectAuthStoreSecrets(params) {
|
|
|
315
315
|
}
|
|
316
316
|
function collectAuthJsonResidue(params) {
|
|
317
317
|
const agentsRoot = path.join(resolveUserPath(params.stateDir), "agents");
|
|
318
|
-
if (!
|
|
318
|
+
if (!syncFs.existsSync(agentsRoot)) {
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
for (const entry of
|
|
321
|
+
for (const entry of syncFs.readdirSync(agentsRoot, { withFileTypes: true })) {
|
|
322
322
|
if (!entry.isDirectory()) {
|
|
323
323
|
continue;
|
|
324
324
|
}
|
|
325
325
|
const authJsonPath = path.join(agentsRoot, entry.name, "agent", "auth.json");
|
|
326
|
-
if (!
|
|
326
|
+
if (!syncFs.existsSync(authJsonPath)) {
|
|
327
327
|
continue;
|
|
328
328
|
}
|
|
329
329
|
params.collector.filesScanned.add(authJsonPath);
|
package/dist/secrets/shared.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import syncFs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/secrets/shared.ts
|
|
@@ -15,28 +15,28 @@ function normalizePositiveInt(value, fallback) {
|
|
|
15
15
|
return Math.max(1, Math.floor(fallback));
|
|
16
16
|
}
|
|
17
17
|
function ensureDirForFile(filePath) {
|
|
18
|
-
|
|
18
|
+
syncFs.mkdirSync(path.dirname(filePath), {
|
|
19
19
|
recursive: true,
|
|
20
20
|
mode: 448
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function writeJsonFileSecure(pathname, value) {
|
|
24
24
|
ensureDirForFile(pathname);
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
syncFs.writeFileSync(pathname, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
26
|
+
syncFs.chmodSync(pathname, 384);
|
|
27
27
|
}
|
|
28
28
|
function readTextFileIfExists(pathname) {
|
|
29
|
-
if (!
|
|
29
|
+
if (!syncFs.existsSync(pathname)) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return syncFs.readFileSync(pathname, "utf8");
|
|
33
33
|
}
|
|
34
34
|
function writeTextFileAtomic(pathname, value, mode = 384) {
|
|
35
35
|
ensureDirForFile(pathname);
|
|
36
36
|
const tempPath = `${pathname}.tmp-${process.pid}-${Date.now()}`;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
syncFs.writeFileSync(tempPath, value, "utf8");
|
|
38
|
+
syncFs.chmodSync(tempPath, mode);
|
|
39
|
+
syncFs.renameSync(tempPath, pathname);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import syncFs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/security/scan-paths.ts
|
|
@@ -10,7 +10,7 @@ function isPathInside(basePath, candidatePath) {
|
|
|
10
10
|
}
|
|
11
11
|
function safeRealpathSync(filePath) {
|
|
12
12
|
try {
|
|
13
|
-
return
|
|
13
|
+
return syncFs.realpathSync(filePath);
|
|
14
14
|
} catch {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import syncFs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/config-eval.ts
|
|
@@ -133,7 +133,7 @@ function hasBinary(bin) {
|
|
|
133
133
|
for (const ext of extensions) {
|
|
134
134
|
const candidate = path.join(part, bin + ext);
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
137
137
|
hasBinaryCache.set(bin, true);
|
|
138
138
|
return true;
|
|
139
139
|
} catch {}
|