@fased/fased 0.1.55 → 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 +3 -2
- 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 +6 -3
- 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 +2 -2
- package/dist/agents/model-catalog.js +1 -1
- package/dist/agents/model-metadata.js +34 -6
- 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 +159 -95
- 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/secrets-cli.js +3 -3
- package/dist/cli/windows-argv.js +2 -2
- package/dist/commands/agent.js +22 -3
- 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 +4 -3
- package/dist/commands/models/list.probe.js +1 -1
- package/dist/commands/models/list.registry.js +3 -2
- package/dist/commands/models/list.status-command.js +2 -2
- package/dist/commands/onboard-auth.credentials.js +3 -3
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/openai-codex-model-default.js +3 -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/config/zod-schema.agent-defaults.js +4 -2
- package/dist/config/zod-schema.agent-runtime.js +4 -2
- package/dist/config/zod-schema.core.js +4 -2
- package/dist/control-ui/assets/{app-D2RaTXoV.js → app-D7TXyNRi.js} +390 -383
- package/dist/control-ui/assets/chat-model-ref-Djkv93yn.js +2 -0
- package/dist/control-ui/assets/{index-D2nC6I-9.js → index-BmSBom-w.js} +3 -3
- package/dist/control-ui/assets/{providers-CyjiG5Jw.js → providers-Cc89iMdx.js} +3 -3
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -1
- 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 +9 -9
- package/dist/gateway/hooks-mapping.js +4 -4
- package/dist/gateway/protocol/schema/agents-models-skills.js +63 -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 +4 -3
- 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 +1 -1
- 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/widearea-dns.js +3 -3
- package/dist/infra/wsl.js +2 -2
- package/dist/light-update-status.js +11 -11
- 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-CeRNo5Ae.js → accounts-DzWlKv1U.js} +1 -1
- package/dist/plugin-sdk/{actions-OMRHtXPj.js → actions-BplQVLL6.js} +4 -4
- package/dist/plugin-sdk/{active-listener-BlIkS3iR.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-B2n3a2Tj.js → audio-preflight-G8h3Sn8_.js} +43 -47
- package/dist/plugin-sdk/{audit-Ppg6dR_b.js → audit-CWknklvI.js} +1 -1
- package/dist/plugin-sdk/{channel-access-af8dWWRv.js → channel-access-a9Dnfw7-.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-B6IAGlE0.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-CD76Byie.js → chunk-B8EZkwiT.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-Bu19zrYH.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-DgS55tNj.js → commands-registry-BfEa4tFA.js} +2 -2
- package/dist/plugin-sdk/{common-CWvfeiX0.js → common-CbfckC19.js} +1 -1
- package/dist/plugin-sdk/{config-CYDETqcF.js → config-Bt5GhnA-.js} +29 -15
- package/dist/plugin-sdk/{config-schema-CQ4EVcQG.js → config-schema-B9DKr6J5.js} +95877 -81287
- 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-BxDgHCgj.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-B75UVKxF.js → handle-action-DbzZFYnG.js} +24 -25
- package/dist/plugin-sdk/{helpers-BuEwju6y.js → helpers-CluGKuIV.js} +1 -1
- package/dist/plugin-sdk/{image-ops-C66HPeAZ.js → image-ops-CUaLtIFj.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +7 -7
- package/dist/plugin-sdk/index.js +47 -51
- package/dist/plugin-sdk/json-store.js +6 -6
- package/dist/plugin-sdk/{login-Amr2DpKU.js → login-DJuHYDiK.js} +3 -3
- package/dist/plugin-sdk/{login-qr-DMQNEi9m.js → login-qr-CbHL5ayf.js} +3 -3
- package/dist/plugin-sdk/{manager-Bvpq49BI.js → manager-oHAvZCT3.js} +7 -7
- package/dist/plugin-sdk/{markdown-tables-DmQ7oXOm.js → markdown-tables-Mkx7k92Y.js} +1 -1
- package/dist/plugin-sdk/{media-ByLQbEwJ.js → media-CA8sTmVE.js} +4 -4
- package/dist/plugin-sdk/{monitor-K_u6daGa.js → monitor-CZrN9pev.js} +51 -55
- package/dist/plugin-sdk/{monitor-S_7LrvSj.js → monitor-CmwGqNyV.js} +61 -65
- package/dist/plugin-sdk/{openresponses-http-BrDJUZXR.js → openresponses-http-CWOd4war.js} +43 -47
- package/dist/plugin-sdk/{optional-runtime-dependency-CbYjAC2b.js → optional-runtime-dependency-DKmk9PZa.js} +1 -1
- package/dist/plugin-sdk/{outbound-BuDafBBI.js → outbound-0oN9IfNw.js} +9 -9
- package/dist/plugin-sdk/{outbound-attachment-DmZmUqFP.js → outbound-attachment-DdVkqUzE.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-D0-UWGFJ.d.ts → pairing-message-BMkkS038.d.ts} +2 -2
- package/dist/plugin-sdk/{pairing-message-e4D4eBDA.js → pairing-message-ClqhfCUk.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-T3IGoGZg.js → pairing-store-B01mCSct.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-DvAG_Png.js → pi-model-discovery-Buz0JC1Y.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-NjkUgjIf.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-D7eW43DL.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-BMIPmEoP.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-CXCqUUPV.js → resolve-outbound-target-BdH6LUoW.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-DJN-SUSt.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-CY1qY6d7.js → retry-policy-9ybIh4Fq.js} +1 -1
- package/dist/plugin-sdk/{runtime-CgOkQe0w.js → runtime-Dy420wBu.js} +3 -3
- package/dist/plugin-sdk/{runtime-dependency-DvdRNMvs.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-BAz22RZr.js → send-2VcOMTN5.js} +9 -9
- package/dist/plugin-sdk/{send-2ITqny2W.js → send-BQUtCJFW.js} +10 -10
- package/dist/plugin-sdk/{send-Cr-dj6S-.js → send-DPJIIYAs.js} +6 -6
- package/dist/plugin-sdk/{send-BG3RWyil.js → send-Dqes9tdU.js} +13 -13
- package/dist/plugin-sdk/{send-eTxqFFsw.js → send-J4JWKP62.js} +8 -8
- package/dist/plugin-sdk/{session-C8nJmmVE.js → session-C_n2S5ub.js} +3 -3
- package/dist/plugin-sdk/{skill-commands-Rm5by9S8.js → skill-commands-B7wx9ax8.js} +102 -102
- package/dist/plugin-sdk/{slack-xvIVvyEM.js → slack-BouRQG-W.js} +64 -68
- package/dist/plugin-sdk/{slack-actions-BNIALJTA.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-D3oDiu2u.js → sticker-cache-BvGEUas3.js} +3 -3
- package/dist/plugin-sdk/{tables-DS5L7lCA.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-D6lUomJc.js → targets-QfP164Dh.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-MSFkDn0m.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-Ry6Vcgw3.js → thread-bindings.lifecycle-DU4iX_Jr.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-C0stmvNk.js → thread-bindings.state-BgYWFjNF.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-D91GExk4.d.ts → tmp-fased-dir-BdFQvrvw.d.ts} +2 -2
- package/dist/plugin-sdk/{types-DVTIpopt.d.ts → types-BYDL6dQj.d.ts} +2 -2
- package/dist/plugin-sdk/{types-DKvBJHfH.d.ts → types-CLIvQaVg.d.ts} +26 -1
- package/dist/plugin-sdk/{types-BzadOItY.d.ts → types-DyhXnYUr.d.ts} +1 -1
- package/dist/plugin-sdk/{types.plugin-BiHPaDTF.d.ts → types.plugin-_fbu40Re.d.ts} +7 -5
- package/dist/plugin-sdk/{web-DRNJxHXA.js → web-D0yENDve.js} +52 -56
- package/dist/plugin-sdk/{whatsapp-actions-BDXZF2R5.js → whatsapp-actions-BT2nPLyo.js} +18 -19
- package/dist/plugin-sdk/{whatsapp-heartbeat-CKgmwCGr.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-Biw7Mj39.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/openai-codex-model-discovery.js +166 -0
- package/dist/providers/refresh.js +116 -34
- package/dist/providers/registry.js +2 -2
- package/dist/providers/runtime-model-catalog.js +97 -28
- 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 +13 -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/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 +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 +6 -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 +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -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 +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +2 -1
- package/dist/control-ui/assets/chat-model-ref-BZFblCeY.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-f0HagNeO.js +0 -11947
- 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
|
@@ -8,7 +8,7 @@ import { resolveControlUiRootSync } from "../infra/control-ui-assets.js";
|
|
|
8
8
|
import { DEFAULT_ASSISTANT_IDENTITY, resolveAssistantIdentity } from "./assistant-identity.js";
|
|
9
9
|
import { CONTROL_UI_BOOTSTRAP_CONFIG_PATH } from "./control-ui-contract.js";
|
|
10
10
|
import { buildControlUiCspHeader } from "./control-ui-csp.js";
|
|
11
|
-
import
|
|
11
|
+
import syncFs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
|
|
14
14
|
//#region src/gateway/control-ui.ts
|
|
@@ -152,10 +152,10 @@ function handleControlUiAvatarRequest(req, res, opts) {
|
|
|
152
152
|
res.end();
|
|
153
153
|
return true;
|
|
154
154
|
}
|
|
155
|
-
serveResolvedFile(res, safeAvatar.path,
|
|
155
|
+
serveResolvedFile(res, safeAvatar.path, syncFs.readFileSync(safeAvatar.fd));
|
|
156
156
|
return true;
|
|
157
157
|
} finally {
|
|
158
|
-
|
|
158
|
+
syncFs.closeSync(safeAvatar.fd);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function respondNotFound(res) {
|
|
@@ -318,7 +318,7 @@ function handleControlUiHttpRequest(req, res, opts) {
|
|
|
318
318
|
}
|
|
319
319
|
const rootReal = (() => {
|
|
320
320
|
try {
|
|
321
|
-
return
|
|
321
|
+
return syncFs.realpathSync(root);
|
|
322
322
|
} catch (error) {
|
|
323
323
|
if (isExpectedSafePathError(error)) {
|
|
324
324
|
return null;
|
|
@@ -364,13 +364,13 @@ function handleControlUiHttpRequest(req, res, opts) {
|
|
|
364
364
|
return true;
|
|
365
365
|
}
|
|
366
366
|
if (path.basename(safeFile.path) === "index.html") {
|
|
367
|
-
serveResolvedIndexHtml(res,
|
|
367
|
+
serveResolvedIndexHtml(res, syncFs.readFileSync(safeFile.fd, "utf8"));
|
|
368
368
|
return true;
|
|
369
369
|
}
|
|
370
|
-
serveResolvedFile(res, safeFile.path,
|
|
370
|
+
serveResolvedFile(res, safeFile.path, syncFs.readFileSync(safeFile.fd));
|
|
371
371
|
return true;
|
|
372
372
|
} finally {
|
|
373
|
-
|
|
373
|
+
syncFs.closeSync(safeFile.fd);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
if (STATIC_ASSET_EXTENSIONS.has(path.extname(fileRel).toLowerCase())) {
|
|
@@ -387,10 +387,10 @@ function handleControlUiHttpRequest(req, res, opts) {
|
|
|
387
387
|
res.end();
|
|
388
388
|
return true;
|
|
389
389
|
}
|
|
390
|
-
serveResolvedIndexHtml(res,
|
|
390
|
+
serveResolvedIndexHtml(res, syncFs.readFileSync(safeIndex.fd, "utf8"));
|
|
391
391
|
return true;
|
|
392
392
|
} finally {
|
|
393
|
-
|
|
393
|
+
syncFs.closeSync(safeIndex.fd);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
respondNotFound(res);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONFIG_PATH } from "../config/paths.js";
|
|
2
2
|
import "../config/config.js";
|
|
3
3
|
import { importFileModule, resolveFunctionModuleExport } from "../hooks/module-loader.js";
|
|
4
|
-
import
|
|
4
|
+
import syncFs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
|
|
7
7
|
//#region src/gateway/hooks-mapping.ts
|
|
@@ -301,8 +301,8 @@ function escapesBase(baseDir, candidate) {
|
|
|
301
301
|
}
|
|
302
302
|
function safeRealpathSync(candidate) {
|
|
303
303
|
try {
|
|
304
|
-
const nativeRealpath =
|
|
305
|
-
return nativeRealpath ? nativeRealpath(candidate) :
|
|
304
|
+
const nativeRealpath = syncFs.realpathSync.native;
|
|
305
|
+
return nativeRealpath ? nativeRealpath(candidate) : syncFs.realpathSync(candidate);
|
|
306
306
|
} catch {
|
|
307
307
|
return null;
|
|
308
308
|
}
|
|
@@ -310,7 +310,7 @@ function safeRealpathSync(candidate) {
|
|
|
310
310
|
function resolveExistingAncestor(candidate) {
|
|
311
311
|
let current = path.resolve(candidate);
|
|
312
312
|
while (true) {
|
|
313
|
-
if (
|
|
313
|
+
if (syncFs.existsSync(current)) {
|
|
314
314
|
return current;
|
|
315
315
|
}
|
|
316
316
|
const parent = path.dirname(current);
|
|
@@ -16,12 +16,16 @@ const ModelChoiceSchema = Type.Object({
|
|
|
16
16
|
catalogSource: Type.Optional(Type.Union([
|
|
17
17
|
Type.Literal("configured"),
|
|
18
18
|
Type.Literal("runtime"),
|
|
19
|
+
Type.Literal("provider-api"),
|
|
19
20
|
Type.Literal("current-preview"),
|
|
20
21
|
Type.Literal("provider-index"),
|
|
21
22
|
Type.Literal("manifest")
|
|
22
23
|
])),
|
|
23
24
|
metadata: Type.Optional(Type.Object({
|
|
25
|
+
ref: NonEmptyString,
|
|
24
26
|
provider: NonEmptyString,
|
|
27
|
+
publicProviderId: NonEmptyString,
|
|
28
|
+
publicProviderLabel: NonEmptyString,
|
|
25
29
|
model: NonEmptyString,
|
|
26
30
|
label: NonEmptyString,
|
|
27
31
|
contextWindow: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
@@ -44,7 +48,8 @@ const ModelChoiceSchema = Type.Object({
|
|
|
44
48
|
Type.Literal("medium"),
|
|
45
49
|
Type.Literal("high"),
|
|
46
50
|
Type.Literal("xhigh"),
|
|
47
|
-
Type.Literal("max")
|
|
51
|
+
Type.Literal("max"),
|
|
52
|
+
Type.Literal("ultra")
|
|
48
53
|
]))),
|
|
49
54
|
defaultThinkingLevel: Type.Optional(Type.Union([
|
|
50
55
|
Type.Literal("off"),
|
|
@@ -53,7 +58,8 @@ const ModelChoiceSchema = Type.Object({
|
|
|
53
58
|
Type.Literal("medium"),
|
|
54
59
|
Type.Literal("high"),
|
|
55
60
|
Type.Literal("xhigh"),
|
|
56
|
-
Type.Literal("max")
|
|
61
|
+
Type.Literal("max"),
|
|
62
|
+
Type.Literal("ultra")
|
|
57
63
|
])),
|
|
58
64
|
thinkingMode: Type.Optional(Type.Union([
|
|
59
65
|
Type.Literal("openai-reasoning-effort"),
|
|
@@ -72,15 +78,68 @@ const ModelChoiceSchema = Type.Object({
|
|
|
72
78
|
])),
|
|
73
79
|
reasoningBudgetSupported: Type.Optional(Type.Boolean()),
|
|
74
80
|
streaming: Type.Boolean(),
|
|
75
|
-
capabilityConfidence: Type.Union([
|
|
81
|
+
capabilityConfidence: Type.Union([
|
|
82
|
+
Type.Literal("verified"),
|
|
83
|
+
Type.Literal("declared"),
|
|
84
|
+
Type.Literal("inferred"),
|
|
85
|
+
Type.Literal("unknown")
|
|
86
|
+
]),
|
|
87
|
+
capabilitySource: Type.Union([
|
|
88
|
+
Type.Literal("provider-api"),
|
|
89
|
+
Type.Literal("official-docs"),
|
|
90
|
+
Type.Literal("runtime"),
|
|
91
|
+
Type.Literal("configured"),
|
|
92
|
+
Type.Literal("inferred"),
|
|
93
|
+
Type.Literal("unknown")
|
|
94
|
+
]),
|
|
95
|
+
capabilityRetrievedAt: Type.Optional(NonEmptyString),
|
|
96
|
+
retrievedAt: NonEmptyString,
|
|
97
|
+
availabilitySource: Type.Union([
|
|
98
|
+
Type.Literal("provider-api"),
|
|
99
|
+
Type.Literal("runtime-catalog"),
|
|
100
|
+
Type.Literal("configured"),
|
|
101
|
+
Type.Literal("provider-plugin"),
|
|
102
|
+
Type.Literal("reviewed-catalog"),
|
|
103
|
+
Type.Literal("curated-recommendation")
|
|
104
|
+
]),
|
|
105
|
+
authRoute: NonEmptyString,
|
|
76
106
|
authMode: Type.Union([
|
|
77
107
|
Type.Literal("api-key"),
|
|
78
108
|
Type.Literal("oauth"),
|
|
79
|
-
Type.Literal("token")
|
|
109
|
+
Type.Literal("token"),
|
|
110
|
+
Type.Literal("aws-sdk")
|
|
80
111
|
]),
|
|
112
|
+
credentialRoute: Type.Object({
|
|
113
|
+
id: NonEmptyString,
|
|
114
|
+
label: NonEmptyString,
|
|
115
|
+
authMode: Type.Union([
|
|
116
|
+
Type.Literal("api-key"),
|
|
117
|
+
Type.Literal("oauth"),
|
|
118
|
+
Type.Literal("token"),
|
|
119
|
+
Type.Literal("aws-sdk")
|
|
120
|
+
])
|
|
121
|
+
}, { additionalProperties: false }),
|
|
122
|
+
credentialRoutes: Type.Array(Type.Object({
|
|
123
|
+
id: NonEmptyString,
|
|
124
|
+
label: NonEmptyString,
|
|
125
|
+
authMode: Type.Union([
|
|
126
|
+
Type.Literal("api-key"),
|
|
127
|
+
Type.Literal("oauth"),
|
|
128
|
+
Type.Literal("token"),
|
|
129
|
+
Type.Literal("aws-sdk")
|
|
130
|
+
])
|
|
131
|
+
}, { additionalProperties: false }), { minItems: 1 }),
|
|
132
|
+
price: Type.Optional(Type.Object({
|
|
133
|
+
input: Type.Number({ minimum: 0 }),
|
|
134
|
+
output: Type.Number({ minimum: 0 }),
|
|
135
|
+
cacheRead: Type.Number({ minimum: 0 }),
|
|
136
|
+
cacheWrite: Type.Number({ minimum: 0 }),
|
|
137
|
+
unit: Type.Literal("usd-per-million-tokens")
|
|
138
|
+
}, { additionalProperties: false })),
|
|
81
139
|
privateNetwork: Type.Boolean(),
|
|
82
140
|
privateNetworkAllowed: Type.Boolean(),
|
|
83
141
|
recommended: Type.Optional(Type.Boolean()),
|
|
142
|
+
recommendationRank: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
84
143
|
default: Type.Optional(Type.Boolean())
|
|
85
144
|
}, { additionalProperties: false }))
|
|
86
145
|
}, { additionalProperties: false });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runExec } from "../process/exec.js";
|
|
2
2
|
import { getTailnetHostname } from "../infra/tailscale.js";
|
|
3
|
-
import
|
|
3
|
+
import syncFs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
|
|
6
6
|
//#region src/gateway/server-discovery.ts
|
|
@@ -20,7 +20,7 @@ function resolveBonjourCliPath(opts = {}) {
|
|
|
20
20
|
if (envPath) {
|
|
21
21
|
return envPath;
|
|
22
22
|
}
|
|
23
|
-
const statSync = opts.statSync ??
|
|
23
|
+
const statSync = opts.statSync ?? syncFs.statSync;
|
|
24
24
|
const isFile = (candidate) => {
|
|
25
25
|
try {
|
|
26
26
|
return statSync(candidate).isFile();
|
|
@@ -51,7 +51,7 @@ import { buildGatewayProbePayload } from "./probe-payload.js";
|
|
|
51
51
|
import { canonicalizePathVariant } from "./security-path.js";
|
|
52
52
|
import { handleToolsInvokeHttpRequest } from "./tools-invoke-http.js";
|
|
53
53
|
import { authorizeGatewayConnect, isLocalDirectRequest } from "./auth.js";
|
|
54
|
-
import
|
|
54
|
+
import syncFs from "node:fs";
|
|
55
55
|
import path from "node:path";
|
|
56
56
|
import { createServer } from "node:http";
|
|
57
57
|
import { createServer as createServer$1 } from "node:https";
|
|
@@ -2102,7 +2102,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
|
|
|
2102
2102
|
const sourcePath = path.join(resolveStateDir(env), "federation", "access-token.json");
|
|
2103
2103
|
const managed = (env.FASED_GATEWAY_MODE ?? "").trim().toLowerCase() === "managed";
|
|
2104
2104
|
const configured = resolveConfiguredFederationStatus(env);
|
|
2105
|
-
if (!
|
|
2105
|
+
if (!syncFs.existsSync(sourcePath)) {
|
|
2106
2106
|
return {
|
|
2107
2107
|
managed,
|
|
2108
2108
|
sourcePath,
|
|
@@ -2114,7 +2114,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
let rawText = "";
|
|
2116
2116
|
try {
|
|
2117
|
-
rawText =
|
|
2117
|
+
rawText = syncFs.readFileSync(sourcePath, "utf-8");
|
|
2118
2118
|
} catch {
|
|
2119
2119
|
return {
|
|
2120
2120
|
managed,
|
|
@@ -2163,7 +2163,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
|
|
|
2163
2163
|
const lifecycle = Number.isFinite(expiresAtMs) ? expiresAtMs > Date.now() ? "active" : "expired" : "invalid";
|
|
2164
2164
|
let fileUpdatedAt;
|
|
2165
2165
|
try {
|
|
2166
|
-
fileUpdatedAt =
|
|
2166
|
+
fileUpdatedAt = syncFs.statSync(sourcePath).mtime.toISOString();
|
|
2167
2167
|
} catch {
|
|
2168
2168
|
fileUpdatedAt = undefined;
|
|
2169
2169
|
}
|
|
@@ -30,7 +30,7 @@ import { parseMessageWithAttachments } from "../chat-attachments.js";
|
|
|
30
30
|
import { injectTimestamp, timestampOptsFromConfig } from "./agent-timestamp.js";
|
|
31
31
|
import { normalizeRpcAttachmentsToChatAttachments } from "./attachment-normalize.js";
|
|
32
32
|
import { appendInjectedAssistantMessageToTranscript } from "./chat-transcript-inject.js";
|
|
33
|
-
import
|
|
33
|
+
import syncFs from "node:fs";
|
|
34
34
|
import path from "node:path";
|
|
35
35
|
|
|
36
36
|
//#region src/gateway/server-methods/chat.ts
|
|
@@ -321,7 +321,7 @@ function resolveTranscriptPath(params) {
|
|
|
321
321
|
}
|
|
322
322
|
function transcriptHasIdempotencyKey(transcriptPath, idempotencyKey) {
|
|
323
323
|
try {
|
|
324
|
-
const lines =
|
|
324
|
+
const lines = syncFs.readFileSync(transcriptPath, "utf-8").split(/\r?\n/);
|
|
325
325
|
for (const line of lines) {
|
|
326
326
|
if (!line.trim()) {
|
|
327
327
|
continue;
|
|
@@ -349,7 +349,7 @@ function appendAssistantTranscriptMessage(params) {
|
|
|
349
349
|
error: "transcript path not resolved"
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
if (!
|
|
352
|
+
if (!syncFs.existsSync(transcriptPath)) {
|
|
353
353
|
if (!params.createIfMissing) {
|
|
354
354
|
return {
|
|
355
355
|
ok: false,
|
|
@@ -11,14 +11,14 @@ import { loadConfig, writeConfigFile } from "../../config/io.js";
|
|
|
11
11
|
import "../../config/config.js";
|
|
12
12
|
import { resolveProfileUnusableUntilForDisplay } from "../../agents/auth-profiles/usage.js";
|
|
13
13
|
import "../../agents/auth-profiles.js";
|
|
14
|
+
import { deriveModelMetadata } from "../../agents/model-metadata.js";
|
|
15
|
+
import { resolveAuthenticatedModelCatalog } from "../../agents/authenticated-model-catalog.js";
|
|
14
16
|
import { ErrorCodes, errorShape } from "../protocol/schema/error-codes.js";
|
|
15
17
|
import { formatValidationErrors, validateModelsAuthClearParams, validateModelsAuthConfigureParams, validateModelsAuthInteractiveStartParams, validateModelsAuthStatusParams, validateModelsAuthStoreParams, validateModelsCatalogStatusParams, validateModelsListParams } from "../protocol/index.js";
|
|
16
|
-
import { deriveModelMetadata } from "../../agents/model-metadata.js";
|
|
17
18
|
import { loadProviderExtensionCatalogIndex } from "../../agents/provider-extension-catalog-index.js";
|
|
18
19
|
import { buildModelCatalogStatus } from "../../agents/model-catalog-status.js";
|
|
19
20
|
import { DEFAULT_OAUTH_WARN_MS, buildAuthHealthSummary } from "../../agents/auth-health.js";
|
|
20
21
|
import { normalizeLegacyOnboardAuthChoice } from "../../commands/auth-choice-legacy.js";
|
|
21
|
-
import { resolveAuthenticatedModelCatalog } from "../../agents/authenticated-model-catalog.js";
|
|
22
22
|
import { configureLmStudioProvider, configureOllamaProvider, configureVllmProvider } from "../../commands/vllm-setup.js";
|
|
23
23
|
import { applyAuthChoice } from "../../commands/auth-choice.apply.js";
|
|
24
24
|
import "../../commands/auth-choice.js";
|
|
@@ -858,7 +858,8 @@ const modelsHandlers = {
|
|
|
858
858
|
cfg,
|
|
859
859
|
store,
|
|
860
860
|
catalog,
|
|
861
|
-
defaultProvider: DEFAULT_PROVIDER
|
|
861
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
862
|
+
agentDir
|
|
862
863
|
});
|
|
863
864
|
const providerFilter = typeof params.provider === "string" && params.provider.trim() ? normalizeProviderId(params.provider) : "";
|
|
864
865
|
const modelSource = params.all === true || params.available === true ? usableCatalog : allowedCatalog.length > 0 ? allowedCatalog : usableCatalog;
|
|
@@ -16,7 +16,7 @@ import "../../config/sessions.js";
|
|
|
16
16
|
import { captureSessionCompactionSnapshot, cleanupSessionCompactionSnapshot, getSessionCompactionCheckpoint, listSessionCompactionCheckpoints, persistSessionCompactionCheckpoint } from "../session-compaction-checkpoints.js";
|
|
17
17
|
import { invalidateCombinedSessionStoreCache, listSessionsFromStore, loadCombinedSessionStoreForGateway, pruneLegacyStoreKeys, resolveGatewaySessionStoreTarget, resolveSessionModelRef } from "../session-utils.js";
|
|
18
18
|
import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js";
|
|
19
|
-
import {
|
|
19
|
+
import { buildUsableModelProviderSet } from "../../agents/model-catalog-access.js";
|
|
20
20
|
import "../../agents/pi-embedded.js";
|
|
21
21
|
import { ErrorCodes, errorShape } from "../protocol/schema/error-codes.js";
|
|
22
22
|
import { validateSessionsCompactParams, validateSessionsCompactionBranchParams, validateSessionsCompactionGetParams, validateSessionsCompactionListParams, validateSessionsCompactionRestoreParams, validateSessionsDeleteParams, validateSessionsListParams, validateSessionsMessagesSubscribeParams, validateSessionsMessagesUnsubscribeParams, validateSessionsPatchParams, validateSessionsPreviewParams, validateSessionsResetParams, validateSessionsResolveParams } from "../protocol/index.js";
|
|
@@ -24,13 +24,13 @@ import { clearSessionQueues } from "../../auto-reply/reply/queue/cleanup.js";
|
|
|
24
24
|
import "../../auto-reply/reply/queue.js";
|
|
25
25
|
import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js";
|
|
26
26
|
import { getAcpSessionManager } from "../../acp/control-plane/manager.js";
|
|
27
|
-
import {
|
|
27
|
+
import { clearBootstrapSnapshot } from "../../agents/bootstrap-cache.js";
|
|
28
28
|
import { abortEmbeddedPiRun, waitForEmbeddedPiRunEnd } from "../../agents/pi-embedded-runner/runs.js";
|
|
29
29
|
import { clearCheckpointBranchIsolationFields } from "../session-compaction-isolation.js";
|
|
30
30
|
import { applySessionsPatchToStore } from "../sessions-patch.js";
|
|
31
31
|
import { resolveSessionKeyFromResolveParams } from "../sessions-resolve.js";
|
|
32
32
|
import { assertValidParams } from "./validation.js";
|
|
33
|
-
import
|
|
33
|
+
import syncFs from "node:fs";
|
|
34
34
|
import path from "node:path";
|
|
35
35
|
import { randomUUID } from "node:crypto";
|
|
36
36
|
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
@@ -196,7 +196,7 @@ function resolveCheckpointSnapshotFile(params) {
|
|
|
196
196
|
return null;
|
|
197
197
|
}
|
|
198
198
|
try {
|
|
199
|
-
if (!
|
|
199
|
+
if (!syncFs.statSync(filePath).isFile()) {
|
|
200
200
|
return null;
|
|
201
201
|
}
|
|
202
202
|
} catch {
|
|
@@ -543,7 +543,7 @@ const sessionsHandlers = {
|
|
|
543
543
|
}
|
|
544
544
|
const cleanupRestoredFile = () => {
|
|
545
545
|
try {
|
|
546
|
-
|
|
546
|
+
syncFs.rmSync(sessionFile, { force: true });
|
|
547
547
|
} catch {}
|
|
548
548
|
};
|
|
549
549
|
const cleanupError = await ensureSessionRuntimeCleanup({
|
|
@@ -1068,7 +1068,7 @@ const sessionsHandlers = {
|
|
|
1068
1068
|
}, undefined);
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
const filePath = resolveSessionTranscriptCandidates(sessionId, storePath, entry?.sessionFile, target.agentId).find((candidate) =>
|
|
1071
|
+
const filePath = resolveSessionTranscriptCandidates(sessionId, storePath, entry?.sessionFile, target.agentId).find((candidate) => syncFs.existsSync(candidate));
|
|
1072
1072
|
if (!filePath) {
|
|
1073
1073
|
respond(true, {
|
|
1074
1074
|
ok: true,
|
|
@@ -1078,7 +1078,7 @@ const sessionsHandlers = {
|
|
|
1078
1078
|
}, undefined);
|
|
1079
1079
|
return;
|
|
1080
1080
|
}
|
|
1081
|
-
const raw =
|
|
1081
|
+
const raw = syncFs.readFileSync(filePath, "utf-8");
|
|
1082
1082
|
const lines = raw.split(/\r?\n/).filter((l) => l.trim().length > 0);
|
|
1083
1083
|
if (lines.length <= maxLines) {
|
|
1084
1084
|
respond(true, {
|
|
@@ -1096,7 +1096,7 @@ const sessionsHandlers = {
|
|
|
1096
1096
|
const archived = archiveFileOnDisk(filePath, "bak");
|
|
1097
1097
|
const keptLines = lines.slice(-maxLines);
|
|
1098
1098
|
try {
|
|
1099
|
-
|
|
1099
|
+
syncFs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, "utf-8");
|
|
1100
1100
|
} catch (error) {
|
|
1101
1101
|
if (preCompactionSnapshot) {
|
|
1102
1102
|
cleanupSessionCompactionSnapshot(preCompactionSnapshot);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { loadConfig } from "../../config/io.js";
|
|
2
2
|
import "../../config/config.js";
|
|
3
|
-
import { OPENAI_TTS_MODELS, OPENAI_TTS_VOICES } from "../../tts/tts-core.js";
|
|
4
|
-
import { getTtsProvider, isTtsEnabled, isTtsProviderConfigured, listTtsPersonas, resolveTtsApiKey, resolveTtsAutoMode, resolveTtsConfig, resolveTtsPrefsPath, resolveTtsProviderOrder, setTtsEnabled, setTtsProvider, textToSpeech } from "../../tts/tts.js";
|
|
5
3
|
import { ErrorCodes, errorShape } from "../protocol/schema/error-codes.js";
|
|
6
4
|
import "../protocol/index.js";
|
|
5
|
+
import { OPENAI_TTS_MODELS, OPENAI_TTS_VOICES } from "../../tts/tts-core.js";
|
|
6
|
+
import { getTtsProvider, isTtsEnabled, isTtsProviderConfigured, listTtsPersonas, resolveTtsApiKey, resolveTtsAutoMode, resolveTtsConfig, resolveTtsPrefsPath, resolveTtsProviderOrder, setTtsEnabled, setTtsProvider, textToSpeech } from "../../tts/tts.js";
|
|
7
7
|
import { formatForLog } from "../ws-log.js";
|
|
8
8
|
|
|
9
9
|
//#region src/gateway/server-methods/tts.ts
|
|
@@ -12,7 +12,7 @@ import { readCronRunLogEntriesPageAll } from "../../cron/run-log.js";
|
|
|
12
12
|
import { loadCronStore, resolveCronStorePath } from "../../cron/store.js";
|
|
13
13
|
import { discoverAllSessions, loadCostUsageSummary, loadSessionCostSummary, loadSessionUsageTimeSeries } from "../../infra/session-cost-usage.js";
|
|
14
14
|
import { buildUsageAggregateTail } from "../../shared/usage-aggregates.js";
|
|
15
|
-
import
|
|
15
|
+
import syncFs from "node:fs";
|
|
16
16
|
|
|
17
17
|
//#region src/gateway/server-methods/usage.ts
|
|
18
18
|
const COST_USAGE_CACHE_TTL_MS = 3e4;
|
|
@@ -662,7 +662,7 @@ const usageHandlers = {
|
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
664
|
try {
|
|
665
|
-
const stats =
|
|
665
|
+
const stats = syncFs.statSync(sessionFile);
|
|
666
666
|
if (stats.isFile()) {
|
|
667
667
|
mergedEntries.push({
|
|
668
668
|
key: resolvedStoreKey,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadConfig } from "../config/io.js";
|
|
2
2
|
import "../config/config.js";
|
|
3
|
-
import { loadModelCatalog, resetModelCatalogCacheForTest } from "../agents/model-catalog.js";
|
|
4
3
|
import { resetRuntimeProviderModelCatalogCache } from "../providers/runtime-model-catalog.js";
|
|
4
|
+
import { loadModelCatalog, resetModelCatalogCacheForTest } from "../agents/model-catalog.js";
|
|
5
5
|
|
|
6
6
|
//#region src/gateway/server-model-catalog.ts
|
|
7
7
|
function createGatewayModelCatalogCache() {
|
|
@@ -68,7 +68,7 @@ import { createWizardSessionTracker } from "./server-wizard-sessions.js";
|
|
|
68
68
|
import { attachGatewayWsHandlers } from "./server-ws-runtime.js";
|
|
69
69
|
import { loadGatewayTlsRuntime } from "./server/tls.js";
|
|
70
70
|
import { createSessionEventSubscriberRegistry, createSessionMessageSubscriberRegistry } from "./session-event-subscribers.js";
|
|
71
|
-
import
|
|
71
|
+
import syncFs from "node:fs";
|
|
72
72
|
import path from "node:path";
|
|
73
73
|
|
|
74
74
|
//#region src/gateway/server.impl.ts
|
|
@@ -99,10 +99,10 @@ function hasConfiguredLocalSignerKeystoreMaterial(env) {
|
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
101
|
const materialDir = resolveLocalSignerMaterialRootDir(env);
|
|
102
|
-
if (!
|
|
102
|
+
if (!syncFs.existsSync(materialDir)) {
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
|
-
return
|
|
105
|
+
return syncFs.readdirSync(materialDir, { withFileTypes: true }).some((entry) => entry.isFile() && /^keystore-solana(?:-.+)?\.v1\.enc$/i.test(entry.name));
|
|
106
106
|
} catch {
|
|
107
107
|
return false;
|
|
108
108
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isSessionCompactionCheckpointArtifactName } from "../config/sessions/artifacts.js";
|
|
2
2
|
import "../config/sessions.js";
|
|
3
|
-
import
|
|
3
|
+
import syncFs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
|
|
@@ -88,7 +88,7 @@ function deleteCheckpointSnapshotIfSafe(filePath, expectedDir) {
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
try {
|
|
91
|
-
|
|
91
|
+
syncFs.unlinkSync(resolved);
|
|
92
92
|
} catch {}
|
|
93
93
|
}
|
|
94
94
|
function cleanupSessionCompactionSnapshot(reference) {
|
|
@@ -105,7 +105,7 @@ function captureSessionCompactionSnapshot(params) {
|
|
|
105
105
|
const resolved = path.resolve(sessionFile);
|
|
106
106
|
let stat;
|
|
107
107
|
try {
|
|
108
|
-
stat =
|
|
108
|
+
stat = syncFs.statSync(resolved);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
@@ -123,7 +123,7 @@ function captureSessionCompactionSnapshot(params) {
|
|
|
123
123
|
const base = path.basename(resolved, ".jsonl");
|
|
124
124
|
const snapshotFile = path.join(dir, `${base}.checkpoint.${randomUUID()}.jsonl`);
|
|
125
125
|
try {
|
|
126
|
-
|
|
126
|
+
syncFs.copyFileSync(resolved, snapshotFile);
|
|
127
127
|
} catch {
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
@@ -7,7 +7,7 @@ import { extractToolCallNames, hasToolCall } from "../utils/transcript-tools.js"
|
|
|
7
7
|
import { stripEnvelope } from "../shared/chat-envelope.js";
|
|
8
8
|
import "./chat-sanitize.js";
|
|
9
9
|
import "../config/sessions.js";
|
|
10
|
-
import
|
|
10
|
+
import syncFs from "node:fs";
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
|
|
@@ -50,11 +50,11 @@ function setCachedSessionTitleFields(cacheKey, stat, value) {
|
|
|
50
50
|
}
|
|
51
51
|
function readSessionMessages(sessionId, storePath, sessionFile) {
|
|
52
52
|
const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile);
|
|
53
|
-
const filePath = candidates.find((p) =>
|
|
53
|
+
const filePath = candidates.find((p) => syncFs.existsSync(p));
|
|
54
54
|
if (!filePath) {
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
|
-
const lines =
|
|
57
|
+
const lines = syncFs.readFileSync(filePath, "utf-8").split(/\r?\n/);
|
|
58
58
|
const messages = [];
|
|
59
59
|
for (const line of lines) {
|
|
60
60
|
if (!line.trim()) {
|
|
@@ -123,7 +123,7 @@ function resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, a
|
|
|
123
123
|
function canonicalizePathForComparison(filePath) {
|
|
124
124
|
const resolved = path.resolve(filePath);
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return syncFs.realpathSync(resolved);
|
|
127
127
|
} catch {
|
|
128
128
|
return resolved;
|
|
129
129
|
}
|
|
@@ -131,7 +131,7 @@ function canonicalizePathForComparison(filePath) {
|
|
|
131
131
|
function archiveFileOnDisk(filePath, reason) {
|
|
132
132
|
const ts = formatSessionArchiveTimestamp();
|
|
133
133
|
const archived = `${filePath}.${reason}.${ts}`;
|
|
134
|
-
|
|
134
|
+
syncFs.renameSync(filePath, archived);
|
|
135
135
|
return archived;
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
@@ -149,7 +149,7 @@ function archiveSessionTranscripts(opts) {
|
|
|
149
149
|
continue;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
if (!
|
|
152
|
+
if (!syncFs.existsSync(candidatePath)) {
|
|
153
153
|
continue;
|
|
154
154
|
}
|
|
155
155
|
try {
|
|
@@ -171,7 +171,7 @@ async function cleanupArchivedSessionTranscripts(opts) {
|
|
|
171
171
|
let removed = 0;
|
|
172
172
|
let scanned = 0;
|
|
173
173
|
for (const dir of directories) {
|
|
174
|
-
const entries = await
|
|
174
|
+
const entries = await syncFs.promises.readdir(dir).catch(() => []);
|
|
175
175
|
for (const entry of entries) {
|
|
176
176
|
const timestamp = parseSessionArchiveTimestamp(entry, reason);
|
|
177
177
|
if (timestamp == null) {
|
|
@@ -182,11 +182,11 @@ async function cleanupArchivedSessionTranscripts(opts) {
|
|
|
182
182
|
continue;
|
|
183
183
|
}
|
|
184
184
|
const fullPath = path.join(dir, entry);
|
|
185
|
-
const stat = await
|
|
185
|
+
const stat = await syncFs.promises.stat(fullPath).catch(() => null);
|
|
186
186
|
if (!stat?.isFile()) {
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
|
-
await
|
|
189
|
+
await syncFs.promises.rm(fullPath).catch(() => undefined);
|
|
190
190
|
removed += 1;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -225,7 +225,7 @@ function capArrayByJsonBytes(items, maxBytes) {
|
|
|
225
225
|
const MAX_LINES_TO_SCAN = 10;
|
|
226
226
|
function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile, agentId, opts) {
|
|
227
227
|
const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
|
|
228
|
-
const filePath = candidates.find((p) =>
|
|
228
|
+
const filePath = candidates.find((p) => syncFs.existsSync(p));
|
|
229
229
|
if (!filePath) {
|
|
230
230
|
return {
|
|
231
231
|
firstUserMessage: null,
|
|
@@ -234,7 +234,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
|
|
|
234
234
|
}
|
|
235
235
|
let stat;
|
|
236
236
|
try {
|
|
237
|
-
stat =
|
|
237
|
+
stat = syncFs.statSync(filePath);
|
|
238
238
|
} catch {
|
|
239
239
|
return {
|
|
240
240
|
firstUserMessage: null,
|
|
@@ -256,7 +256,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
|
|
|
256
256
|
}
|
|
257
257
|
let fd = null;
|
|
258
258
|
try {
|
|
259
|
-
fd =
|
|
259
|
+
fd = syncFs.openSync(filePath, "r");
|
|
260
260
|
const size = stat.size;
|
|
261
261
|
let firstUserMessage = null;
|
|
262
262
|
try {
|
|
@@ -286,7 +286,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
|
|
|
286
286
|
} finally {
|
|
287
287
|
if (fd !== null) {
|
|
288
288
|
try {
|
|
289
|
-
|
|
289
|
+
syncFs.closeSync(fd);
|
|
290
290
|
} catch {}
|
|
291
291
|
}
|
|
292
292
|
}
|
|
@@ -314,7 +314,7 @@ function extractTextFromContent(content) {
|
|
|
314
314
|
}
|
|
315
315
|
function readTranscriptHeadChunk(fd, maxBytes = 8192) {
|
|
316
316
|
const buf = Buffer.alloc(maxBytes);
|
|
317
|
-
const bytesRead =
|
|
317
|
+
const bytesRead = syncFs.readSync(fd, buf, 0, buf.length, 0);
|
|
318
318
|
if (bytesRead <= 0) {
|
|
319
319
|
return null;
|
|
320
320
|
}
|
|
@@ -345,16 +345,16 @@ function extractFirstUserMessageFromTranscriptChunk(chunk, opts) {
|
|
|
345
345
|
}
|
|
346
346
|
function findExistingTranscriptPath(sessionId, storePath, sessionFile, agentId) {
|
|
347
347
|
const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
|
|
348
|
-
return candidates.find((p) =>
|
|
348
|
+
return candidates.find((p) => syncFs.existsSync(p)) ?? null;
|
|
349
349
|
}
|
|
350
350
|
function withOpenTranscriptFd(filePath, read) {
|
|
351
351
|
let fd = null;
|
|
352
352
|
try {
|
|
353
|
-
fd =
|
|
353
|
+
fd = syncFs.openSync(filePath, "r");
|
|
354
354
|
return read(fd);
|
|
355
355
|
} catch {} finally {
|
|
356
356
|
if (fd !== null) {
|
|
357
|
-
|
|
357
|
+
syncFs.closeSync(fd);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
return null;
|
|
@@ -378,7 +378,7 @@ function readLastMessagePreviewFromOpenTranscript(params) {
|
|
|
378
378
|
const readStart = Math.max(0, params.size - LAST_MSG_MAX_BYTES);
|
|
379
379
|
const readLen = Math.min(params.size, LAST_MSG_MAX_BYTES);
|
|
380
380
|
const buf = Buffer.alloc(readLen);
|
|
381
|
-
|
|
381
|
+
syncFs.readSync(params.fd, buf, 0, readLen, readStart);
|
|
382
382
|
const chunk = buf.toString("utf-8");
|
|
383
383
|
const lines = chunk.split(/\r?\n/).filter((l) => l.trim());
|
|
384
384
|
const tailLines = lines.slice(-LAST_MSG_MAX_LINES);
|
|
@@ -404,7 +404,7 @@ function readLastMessagePreviewFromTranscript(sessionId, storePath, sessionFile,
|
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
406
406
|
return withOpenTranscriptFd(filePath, (fd) => {
|
|
407
|
-
const stat =
|
|
407
|
+
const stat = syncFs.fstatSync(fd);
|
|
408
408
|
const size = stat.size;
|
|
409
409
|
if (size === 0) {
|
|
410
410
|
return null;
|
|
@@ -522,8 +522,8 @@ function buildPreviewItems(messages, maxItems, maxChars) {
|
|
|
522
522
|
function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
|
|
523
523
|
let fd = null;
|
|
524
524
|
try {
|
|
525
|
-
fd =
|
|
526
|
-
const stat =
|
|
525
|
+
fd = syncFs.openSync(filePath, "r");
|
|
526
|
+
const stat = syncFs.fstatSync(fd);
|
|
527
527
|
const size = stat.size;
|
|
528
528
|
if (size === 0) {
|
|
529
529
|
return [];
|
|
@@ -531,7 +531,7 @@ function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
|
|
|
531
531
|
const readStart = Math.max(0, size - readBytes);
|
|
532
532
|
const readLen = Math.min(size, readBytes);
|
|
533
533
|
const buf = Buffer.alloc(readLen);
|
|
534
|
-
|
|
534
|
+
syncFs.readSync(fd, buf, 0, readLen, readStart);
|
|
535
535
|
const chunk = buf.toString("utf-8");
|
|
536
536
|
const lines = chunk.split(/\r?\n/).filter((l) => l.trim());
|
|
537
537
|
const tailLines = lines.slice(-PREVIEW_MAX_LINES);
|
|
@@ -554,13 +554,13 @@ function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
|
|
|
554
554
|
return [];
|
|
555
555
|
} finally {
|
|
556
556
|
if (fd !== null) {
|
|
557
|
-
|
|
557
|
+
syncFs.closeSync(fd);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
function readSessionPreviewItemsFromTranscript(sessionId, storePath, sessionFile, agentId, maxItems, maxChars) {
|
|
562
562
|
const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
|
|
563
|
-
const filePath = candidates.find((p) =>
|
|
563
|
+
const filePath = candidates.find((p) => syncFs.existsSync(p));
|
|
564
564
|
if (!filePath) {
|
|
565
565
|
return [];
|
|
566
566
|
}
|