mixdog 1.2.3 → 1.2.5
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/package.json +1 -1
- package/scripts/gate-local.mjs +6 -4
- package/scripts/lib/gate-scheduler.mjs +29 -11
- package/scripts/mobile-release.mjs +5 -4
- package/scripts/probe-provider-catalog.mjs +31 -0
- package/scripts/provider-pingpong-live.mjs +128 -38
- package/scripts/session-sweep.mjs +5 -25
- package/src/agents/maintainer/AGENT.md +1 -1
- package/src/agents/maintainer/agent.json +1 -1
- package/src/agents/reviewer/AGENT.md +2 -4
- package/src/agents/security/AGENT.md +1 -2
- package/src/agents/writer/AGENT.md +2 -3
- package/src/defaults/shipped-history.json +7 -1
- package/src/defaults/skills/image/SKILL.md +21 -23
- package/src/lib/keychain-cjs.cjs +13 -11
- package/src/output-styles/common.md +2 -1
- package/src/rules/agent/AGENT.md +7 -5
- package/src/rules/lead/LEAD.md +13 -13
- package/src/rules/shared/45-destructive.md +4 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/preset.mjs +1 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +28 -7
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -11
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +101 -23
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-api-key-fetch.mjs +36 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-error-contract.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/gzip-post.mjs +26 -44
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +2 -5
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +4 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +41 -12
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +13 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +81 -10
- package/src/runtime/agent/orchestrator/providers/antigravity-retry-policy.mjs +109 -5
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +107 -37
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor-native-context.mjs +48 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-exec.mjs +144 -34
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +28 -4
- package/src/runtime/agent/orchestrator/providers/cursor-wire-request.mjs +8 -4
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-bridge.mjs +41 -11
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-messages.mjs +67 -5
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +14 -4
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +14 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +9 -6
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +7 -2
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +26 -4
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +12 -6
- package/src/runtime/agent/orchestrator/providers/gemini-error-contract.mjs +14 -6
- package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/gemini-rest-stream/watchdogs.mjs +16 -5
- package/src/runtime/agent/orchestrator/providers/gemini-retry-policy.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +22 -10
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/gemini-thinking.mjs +33 -7
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +11 -2
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/lib/claude-bridge-schema.mjs +9 -5
- package/src/runtime/agent/orchestrator/providers/lib/request-compression.mjs +86 -0
- package/src/runtime/agent/orchestrator/providers/lib/wire-pairing.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +16 -5
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/model-proxy-provider.mjs +60 -16
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +11 -13
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +30 -19
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +5 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +42 -5
- package/src/runtime/agent/orchestrator/providers/openai-compat-reasoning-field.mjs +13 -9
- package/src/runtime/agent/orchestrator/providers/openai-compat-response-normalization.mjs +1 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-parity.fixtures.mjs +18 -7
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +36 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-retry-profile.mjs +51 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +11 -1
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-request.mjs +64 -52
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/terminal-frames.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +1 -4
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/tool-calls.mjs +0 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +7 -6
- package/src/runtime/agent/orchestrator/providers/opencode-go-gemini.mjs +13 -2
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/openrouter.mjs +1 -2
- package/src/runtime/agent/orchestrator/providers/provider-error-kind.mjs +5 -4
- package/src/runtime/agent/orchestrator/providers/registry.mjs +9 -1
- package/src/runtime/agent/orchestrator/providers/retry-classification.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/wire-gateway.mjs +11 -4
- package/src/runtime/agent/orchestrator/providers/wire-route.mjs +14 -4
- package/src/runtime/agent/orchestrator/providers/xai-tool-search.fixtures.mjs +15 -3
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +6 -2
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +8 -6
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-availability.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-store.mjs +30 -2
- package/src/runtime/agent/orchestrator/runtime-core/goal-turns.mjs +3 -2
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +8 -3
- package/src/runtime/agent/orchestrator/runtime-core/skill-tool-loading.mjs +3 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-bridge-contract.mjs +6 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-bridge.mjs +10 -10
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +3 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +46 -8
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +10 -8
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +1 -2
- package/src/runtime/agent/orchestrator/session/agent-pool-progress.mjs +24 -0
- package/src/runtime/agent/orchestrator/session/cache/tool-result-reuse.mjs +10 -2
- package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +2 -3
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +3 -11
- package/src/runtime/agent/orchestrator/session/catalog-db/worker.mjs +6 -22
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +16 -2
- package/src/runtime/agent/orchestrator/session/compact/user-message-kind.mjs +28 -0
- package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +0 -6
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +0 -6
- package/src/runtime/agent/orchestrator/session/eager-dispatch/admission.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/historical-session-closure.mjs +10 -0
- package/src/runtime/agent/orchestrator/session/loop/assistant-commit.mjs +2 -5
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +2 -4
- package/src/runtime/agent/orchestrator/session/loop/context-overflow.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +0 -27
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/output-limit.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +4 -10
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +2 -9
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/loop/request-boundary.mjs +1 -4
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +76 -0
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/loop/step-auto-effort.mjs +8 -9
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +15 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +1 -4
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +3 -4
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +33 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-support.mjs +0 -4
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +21 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +38 -13
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-failure.mjs +33 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +19 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +57 -13
- package/src/runtime/agent/orchestrator/session/manager/failed-turn-rewind.mjs +16 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +6 -120
- package/src/runtime/agent/orchestrator/session/manager/pending-persist-queue.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +29 -8
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +42 -49
- package/src/runtime/agent/orchestrator/session/manager/runtime-state.mjs +50 -0
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +32 -14
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +17 -33
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +29 -13
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-recovery.mjs +45 -0
- package/src/runtime/agent/orchestrator/session/manager.mjs +2 -9
- package/src/runtime/agent/orchestrator/session/send-instrumentation.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/side-question.mjs +12 -7
- package/src/runtime/agent/orchestrator/session/store/lifecycle-barriers.mjs +5 -12
- package/src/runtime/agent/orchestrator/session/store/lifecycle-read.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +2 -6
- package/src/runtime/agent/orchestrator/session/store/live-cache-eviction.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/liveness-veto.mjs +46 -37
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/load-session.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +5 -11
- package/src/runtime/agent/orchestrator/session/store/session-paths.mjs +59 -0
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/sweep/stale-sweep.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-finish.mjs +27 -32
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-plan.mjs +0 -8
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-record.mjs +6 -18
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-row.mjs +33 -106
- package/src/runtime/agent/orchestrator/session/store/write-admission.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-agent-worker-pool.mjs +5 -8
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +160 -212
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +50 -116
- package/src/runtime/agent/orchestrator/session/store-summary-locations.mjs +3 -29
- package/src/runtime/agent/orchestrator/session/store-summary-reader-catalog-fixture.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +7 -8
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +9 -20
- package/src/runtime/agent/orchestrator/session/store.mjs +3 -16
- package/src/runtime/agent/orchestrator/session/tool-batch/execute-call.mjs +11 -12
- package/src/runtime/agent/orchestrator/session/tool-batch/finalize.mjs +37 -13
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +15 -4
- package/src/runtime/agent/orchestrator/session/tool-schema-rejection.mjs +4 -2
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +72 -15
- package/src/runtime/agent/orchestrator/session/turn-failure.mjs +45 -0
- package/src/runtime/agent/orchestrator/stall-policy.mjs +50 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +5 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/inline-hoist.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/external-tool-adapters.mjs +204 -10
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +160 -39
- package/src/runtime/agent/orchestrator/tools/builtin/git-partial-stage.mjs +7 -5
- package/src/runtime/agent/orchestrator/tools/builtin/grep-formatting.mjs +14 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-output.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-path-fanout.mjs +48 -44
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +10 -3
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +200 -17
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-task-output.mjs +5 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +20 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +101 -2
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +67 -0
- package/src/runtime/agent/orchestrator/tools/lib/process-table-fixture.mjs +50 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +303 -63
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +108 -18
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +77 -11
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +81 -5
- package/src/runtime/attachments/store.d.mts +9 -0
- package/src/runtime/attachments/store.mjs +80 -9
- package/src/runtime/browser-bridge/browser-action-contract.d.mts +0 -1
- package/src/runtime/browser-bridge/browser-action-contract.mjs +0 -2
- package/src/runtime/computer-bridge/action-schema.mjs +178 -178
- package/src/runtime/computer-bridge/linux-readiness.d.mts +0 -2
- package/src/runtime/computer-bridge/linux-readiness.mjs +0 -16
- package/src/runtime/effort-judge/judge-client.mjs +21 -4
- package/src/runtime/effort-judge/judge-worker.mjs +4 -1
- package/src/runtime/github/tool.mjs +118 -17
- package/src/runtime/media/adapters/codex-image.mjs +140 -21
- package/src/runtime/media/catalog.mjs +4 -4
- package/src/runtime/media/chatgpt-usage.mjs +55 -0
- package/src/runtime/media/defaults.mjs +37 -0
- package/src/runtime/media/jobs.mjs +12 -2
- package/src/runtime/media/lanes.mjs +12 -0
- package/src/runtime/media/tool-defs.mjs +15 -4
- package/src/runtime/media/tool.mjs +41 -12
- package/src/runtime/media/upstream-error.mjs +72 -6
- package/src/runtime/memory/lib/ingest/transcript-rows.mjs +1 -0
- package/src/runtime/memory/lib/pg/process.mjs +5 -7
- package/src/runtime/memory/lib/pg/supervisor.mjs +4 -1
- package/src/runtime/office/authoring/docx-html-runner.mjs +1 -1
- package/src/runtime/office/authoring/html-browser.mjs +18 -8
- package/src/runtime/office/authoring/pdf-html-runner.mjs +1 -1
- package/src/runtime/office/authoring/pptx-html-measure.mjs +1 -1
- package/src/runtime/office/authoring/xlsx-html-runner.mjs +1 -1
- package/src/runtime/office/core/office-write-ledger.mjs +1 -5
- package/src/runtime/office/index.mjs +2 -3
- package/src/runtime/office/pdf/pdf-analysis.mjs +0 -68
- package/src/runtime/session-search/session-search-ingest.mjs +1 -1
- package/src/runtime/shared/agent-reap-state.mjs +13 -0
- package/src/runtime/shared/atomic-file.d.mts +1 -1
- package/src/runtime/shared/background-tasks.mjs +6 -1
- package/src/runtime/shared/bounded-line-diff.mjs +11 -2
- package/src/runtime/shared/browser-launch.mjs +15 -0
- package/src/runtime/shared/err-text.mjs +42 -4
- package/src/runtime/shared/file-lock.mjs +6 -5
- package/src/runtime/shared/llm/anthropic-betas.mjs +1 -2
- package/src/runtime/shared/llm/provider-model-identities.mjs +1 -0
- package/src/runtime/shared/model-route-chain.d.mts +8 -0
- package/src/runtime/shared/model-route-chain.mjs +48 -0
- package/src/runtime/shared/model-route-fallback.mjs +22 -0
- package/src/runtime/shared/pid-liveness.mjs +12 -0
- package/src/runtime/shared/provider-api-key.mjs +6 -0
- package/src/runtime/shared/provider-timeout-phase.mjs +17 -0
- package/src/runtime/shared/quiet-progress.d.mts +35 -0
- package/src/runtime/shared/quiet-progress.mjs +101 -0
- package/src/runtime/shared/quota-resume-store.mjs +32 -1
- package/src/runtime/shared/read-row-numbers.mjs +44 -0
- package/src/runtime/shared/remote-intent.mjs +2 -42
- package/src/runtime/shared/slow-span.mjs +8 -1
- package/src/runtime/shared/statusline/statusline-segments.mjs +24 -2
- package/src/runtime/shared/tool-card-model/card-header.mjs +2 -1
- package/src/runtime/shared/tool-output-budget.mjs +2 -0
- package/src/runtime/shared/tool-result-summary.mjs +16 -2
- package/src/runtime/shared/tool-status.mjs +3 -2
- package/src/runtime/shared/tool-surface.mjs +2 -3
- package/src/runtime/shared/tool-work-units.mjs +22 -15
- package/src/runtime/shared/transcript-metadata.mjs +49 -1
- package/src/runtime/shared/transcript-turn-keys.mjs +33 -0
- package/src/runtime/shared/transcript-writer/transcript-file.mjs +10 -1
- package/src/runtime/shared/transcript-writer.mjs +14 -4
- package/src/runtime/shared/turn-changes.mjs +2 -1
- package/src/runtime/shared/turn-snapshot.mjs +11 -3
- package/src/runtime/shared/worktrees/activity-gate.mjs +175 -0
- package/src/runtime/shared/worktrees/branch-management.mjs +179 -0
- package/src/runtime/shared/worktrees/carry.mjs +6 -4
- package/src/runtime/shared/worktrees/contract.mjs +27 -1
- package/src/runtime/shared/worktrees/dependencies.mjs +456 -0
- package/src/runtime/shared/worktrees/file-recovery.mjs +29 -13
- package/src/runtime/shared/worktrees/git-head.mjs +22 -13
- package/src/runtime/shared/worktrees/include.mjs +125 -7
- package/src/runtime/shared/worktrees/lock.mjs +1 -1
- package/src/runtime/shared/worktrees/maintenance.mjs +20 -2
- package/src/runtime/shared/worktrees/manager.mjs +378 -32
- package/src/runtime/shared/worktrees/owner.mjs +2 -1
- package/src/runtime/shared/worktrees/preparation-report.mjs +79 -0
- package/src/runtime/shared/worktrees/setup-commands.mjs +232 -0
- package/src/runtime/shared/worktrees/workspace-visibility.mjs +17 -0
- package/src/runtime/terminal-bridge/client.mjs +14 -10
- package/src/session-runtime/boot/apis.mjs +7 -1
- package/src/session-runtime/boot/config.mjs +2 -0
- package/src/session-runtime/boot/facade.mjs +3 -0
- package/src/session-runtime/boot/session.mjs +3 -2
- package/src/session-runtime/boot/tools.mjs +3 -0
- package/src/session-runtime/conversation-import/service.mjs +1 -1
- package/src/session-runtime/goal-facade-api.mjs +2 -2
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +44 -18
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +4 -1
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +22 -8
- package/src/session-runtime/internal-tool-executor.mjs +2 -0
- package/src/session-runtime/lifecycle/cold-heir.mjs +0 -1
- package/src/session-runtime/lifecycle/session-catalog.mjs +14 -16
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +18 -53
- package/src/session-runtime/lifecycle/session-switch.mjs +1 -1
- package/src/session-runtime/lifecycle/shared.mjs +5 -6
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -5
- package/src/session-runtime/lifecycle/teardown.mjs +7 -16
- package/src/session-runtime/media-api.mjs +8 -0
- package/src/session-runtime/model-route/route-ownership.mjs +60 -0
- package/src/session-runtime/model-route/route-persist.mjs +3 -2
- package/src/session-runtime/model-route/set-route.mjs +114 -34
- package/src/session-runtime/model-route/web-search-route.mjs +7 -2
- package/src/session-runtime/model-route-api.mjs +4 -2
- package/src/session-runtime/native-web-search/routes.mjs +37 -24
- package/src/session-runtime/native-web-search.mjs +9 -8
- package/src/session-runtime/provider-auth/setup.mjs +4 -0
- package/src/session-runtime/provider-models/catalog-load.mjs +9 -0
- package/src/session-runtime/provider-models/web-search-catalog.mjs +23 -3
- package/src/session-runtime/provider-models.mjs +1 -0
- package/src/session-runtime/provider-usage.mjs +4 -0
- package/src/session-runtime/route-resolution.mjs +3 -1
- package/src/session-runtime/runtime-core.mjs +4 -0
- package/src/session-runtime/runtime-facade.mjs +6 -0
- package/src/session-runtime/services/agent-task-status.mjs +2 -0
- package/src/session-runtime/services/agent-tool/close-flow/close-all.mjs +0 -3
- package/src/session-runtime/services/agent-tool/close-flow.mjs +6 -7
- package/src/session-runtime/services/agent-tool/execute-send.mjs +2 -2
- package/src/session-runtime/services/agent-tool/execute-spawn.mjs +36 -3
- package/src/session-runtime/services/agent-tool/execute.mjs +9 -1
- package/src/session-runtime/services/agent-tool/helpers.mjs +30 -7
- package/src/session-runtime/services/agent-tool/job-task-reconcile.mjs +7 -2
- package/src/session-runtime/services/agent-tool/job-views/session-progress.mjs +6 -3
- package/src/session-runtime/services/agent-tool/lead-worker-index/lead-rows.mjs +3 -4
- package/src/session-runtime/services/agent-tool/lead-worker-index/reap-timers.mjs +9 -3
- package/src/session-runtime/services/agent-tool/lead-worker-index/row-settlement.mjs +7 -18
- package/src/session-runtime/services/agent-tool/lead-worker-index.mjs +9 -6
- package/src/session-runtime/services/agent-tool/model-select.mjs +82 -0
- package/src/session-runtime/services/agent-tool/send-flow.mjs +24 -6
- package/src/session-runtime/services/agent-tool/spawn-flow/job-start.mjs +3 -1
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +19 -5
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +5 -4
- package/src/session-runtime/services/agent-tool/spawn-flow.mjs +2 -1
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +3 -0
- package/src/session-runtime/services/agent-tool/tag-registry/tag-lookup.mjs +1 -3
- package/src/session-runtime/services/agent-tool/tag-registry/tag-refresh.mjs +1 -3
- package/src/session-runtime/services/agent-tool/tag-registry.mjs +3 -9
- package/src/session-runtime/services/agent-tool/terminal-reaper/scan-admission.mjs +8 -41
- package/src/session-runtime/services/agent-tool/terminal-reaper/stale-rows.mjs +3 -3
- package/src/session-runtime/services/agent-tool/terminal-reaper.mjs +6 -23
- package/src/session-runtime/services/agent-tool/terminal-trace.mjs +0 -1
- package/src/session-runtime/services/agent-tool/tool-def.mjs +7 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-liveness.mjs +32 -20
- package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +5 -2
- package/src/session-runtime/services/agent-tool/worker-index.mjs +28 -8
- package/src/session-runtime/services/agent-tool.mjs +4 -0
- package/src/session-runtime/services/agent-watchdog-registry.mjs +2 -0
- package/src/session-runtime/services/provider-admin.mjs +77 -0
- package/src/session-runtime/session-create/session-options.mjs +7 -5
- package/src/session-runtime/session-create/session-start-hook.mjs +2 -1
- package/src/session-runtime/session-transcript.mjs +4 -5
- package/src/session-runtime/session-turn-api.mjs +3 -9
- package/src/session-runtime/settings-builtin-tools-api.mjs +9 -6
- package/src/session-runtime/setup-tool/executor.mjs +23 -5
- package/src/session-runtime/setup-tool/extended-actions.mjs +6 -6
- package/src/session-runtime/setup-tool/settings-contract.mjs +7 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +13 -1
- package/src/session-runtime/tool-policy-refresh.mjs +83 -32
- package/src/session-runtime/turn/agent-ops.mjs +49 -2
- package/src/session-runtime/turn/side-question-ops.mjs +1 -4
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +2 -0
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +4 -0
- package/src/session-runtime/turn/turn-run/turn-settle.mjs +8 -2
- package/src/session-runtime/turn/turn-run.mjs +1 -36
- package/src/session-runtime/usage-stats-api.mjs +4 -1
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +16 -1
- package/src/session-runtime/workspace/admission-gate.mjs +44 -15
- package/src/session-runtime/workspace/project-branches.mjs +28 -36
- package/src/session-runtime/workspace/transition-steps.mjs +96 -95
- package/src/session-runtime/workspace/transitions.mjs +248 -68
- package/src/standalone/channel-transport.mjs +3 -4
- package/src/standalone/daemon-desktop-runtime.mjs +32 -1
- package/src/standalone/daemon-pg-stop.mjs +1 -3
- package/src/standalone/daemon-session-control.mjs +88 -0
- package/src/standalone/daemon-stored-session-views.mjs +23 -3
- package/src/standalone/daemon.mjs +2 -0
- package/src/standalone/desktop-service-registry.mjs +32 -5
- package/src/standalone/local-session-runtime.mjs +11 -12
- package/src/standalone/session-protocol.mjs +7 -0
- package/src/standalone/session-runtime-inline-host.mjs +2 -0
- package/src/standalone/session-service/agent-tree/agent-cancel.mjs +91 -49
- package/src/standalone/session-service/agent-tree/agent-child.mjs +19 -1
- package/src/standalone/session-service/agent-tree/agent-registry.mjs +25 -0
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +9 -1
- package/src/standalone/session-service/agent-tree.mjs +28 -2
- package/src/standalone/session-service/entries/session-loads.mjs +16 -5
- package/src/standalone/session-service/entries.mjs +1 -0
- package/src/standalone/session-service/projection/transcript-window.mjs +39 -0
- package/src/standalone/session-service/quota-resume.mjs +28 -13
- package/src/standalone/session-service/session-calls/session-turns.mjs +17 -6
- package/src/standalone/session-service/session-calls/session-views.mjs +6 -0
- package/src/standalone/session-tool-output.mjs +82 -0
- package/src/tui/app/app-view.jsx +2 -1
- package/src/tui/app/provider-setup/provider-items.mjs +8 -0
- package/src/tui/app/provider-setup-picker.mjs +15 -3
- package/src/tui/app/slash-commands.mjs +6 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +49 -0
- package/src/tui/components/Spinner.jsx +4 -0
- package/src/tui/components/SpinnerByline.jsx +21 -2
- package/src/tui/components/status-line/local-line.mjs +10 -2
- package/src/tui/dist/index.mjs +529 -270
- package/src/tui/session/active-tool-summary.mjs +1 -1
- package/src/tui/session/context-state.mjs +0 -3
- package/src/tui/session/goal-continuation/continuation-queue.mjs +2 -3
- package/src/tui/session/goal-continuation/deadline-delivery.mjs +4 -2
- package/src/tui/session/goal-continuation/session-boundary.mjs +21 -0
- package/src/tui/session/quota-resume.mjs +140 -61
- package/src/tui/session/session-api/commands.mjs +4 -10
- package/src/tui/session/session-api/controls.mjs +12 -0
- package/src/tui/session/session-api/lifecycle/dispose.mjs +2 -9
- package/src/tui/session/session-api/lifecycle/resume.mjs +2 -7
- package/src/tui/session/session-api/lifecycle.mjs +13 -11
- package/src/tui/session/session-api/media.mjs +2 -0
- package/src/tui/session/session-api/routes.mjs +81 -57
- package/src/tui/session/session-api/settings.mjs +3 -3
- package/src/tui/session/session-api/worktree.mjs +3 -2
- package/src/tui/session/session-flow/auto-clear.mjs +1 -3
- package/src/tui/session/session-flow/drain.mjs +6 -4
- package/src/tui/session/session-flow/queue/entry-shape.mjs +2 -0
- package/src/tui/session/session-flow/queue/take-entries.mjs +2 -1
- package/src/tui/session/session-flow/queue.mjs +1 -1
- package/src/tui/session/tool-approval.mjs +17 -8
- package/src/tui/session/transcript-store/streaming-tail.mjs +1 -1
- package/src/tui/session/tui-steering-persist.mjs +3 -5
- package/src/tui/session/turn-quiet.mjs +53 -0
- package/src/tui/session/turn-stream.mjs +5 -1
- package/src/tui/session/turn.mjs +38 -31
- package/src/tui/session/worktree-setup-notice.mjs +38 -0
- package/src/tui/spinner-meta.mjs +10 -0
- package/src/tui/spinner-verbs.mjs +3 -0
- package/src/ui/statusline.mjs +13 -3
- package/src/ui/streaming-markdown-heal.mjs +70 -18
- package/src/runtime/agent/orchestrator/providers/model-pricing-rates.mjs +0 -1
- package/src/runtime/agent/orchestrator/session/manager/foreign-pending-messages.mjs +0 -346
- package/src/runtime/agent/orchestrator/session/manager/session-owner-liveness.mjs +0 -117
- package/src/runtime/agent/orchestrator/session/store/paths-heartbeat.mjs +0 -302
- package/src/session-runtime/services/agent-tool/terminal-reaper/reap-timers.mjs +0 -142
- package/src/session-runtime/turn/share-ops.mjs +0 -77
- package/src/tui/session/cross-surface-share.mjs +0 -406
- package/src/tui/session/live-share/delta.mjs +0 -153
- package/src/tui/session/live-share/mirror.mjs +0 -106
- package/src/tui/session/live-share/owner.mjs +0 -254
- package/src/tui/session/live-share/retry.mjs +0 -54
- package/src/tui/session/live-share/viewer/frame-router.mjs +0 -32
- package/src/tui/session/live-share/viewer/pipe-client.mjs +0 -108
- package/src/tui/session/live-share/viewer/submit-acks.mjs +0 -65
- package/src/tui/session/live-share/viewer/sync-waiters.mjs +0 -53
- package/src/tui/session/live-share/viewer.mjs +0 -99
- package/src/tui/session/live-share/wire.mjs +0 -44
- package/src/tui/session/live-share.mjs +0 -154
- package/src/tui/session/shared-dir-watch.mjs +0 -69
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { renameSync } from 'node:fs';
|
|
3
|
+
import { modelProxyClientMode, serverModelCredentialsDisabledError } from '../../runtime/shared/model-proxy-mode.mjs';
|
|
3
4
|
import { sameAccountIdentity } from '../../runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs';
|
|
4
5
|
import {
|
|
5
6
|
AGENT_PROVIDER_ENV,
|
|
@@ -502,6 +503,7 @@ function customProviderRows(providers, checkSecrets) {
|
|
|
502
503
|
}
|
|
503
504
|
|
|
504
505
|
export async function providerSetup(config = {}, options = {}) {
|
|
506
|
+
if (modelProxyClientMode()) return modelProxyProviderSetup(options);
|
|
505
507
|
const providers = config.providers || {};
|
|
506
508
|
const checkSecrets = options?.checkSecrets !== false;
|
|
507
509
|
const keychain = checkSecrets ? keychainIssueFor(true) : null;
|
|
@@ -516,6 +518,59 @@ export async function providerSetup(config = {}, options = {}) {
|
|
|
516
518
|
};
|
|
517
519
|
}
|
|
518
520
|
|
|
521
|
+
// The desktop's hidden custom models, in the override shape pickers already read.
|
|
522
|
+
function hiddenModelOverrides(entry) {
|
|
523
|
+
const ids = Array.isArray(entry?.hiddenModels) ? entry.hiddenModels : [];
|
|
524
|
+
return Object.fromEntries(ids.filter((id) => typeof id === 'string').map((id) => [id, { hidden: true }]));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// SSH servers have no model credentials. Project only the PC's advertised
|
|
528
|
+
// availability; account identities and credential management stay on the PC.
|
|
529
|
+
async function modelProxyProviderSetup(options) {
|
|
530
|
+
const { loadModelProxyProviderConfig } = await import(
|
|
531
|
+
'../../runtime/agent/orchestrator/providers/model-proxy-provider.mjs'
|
|
532
|
+
);
|
|
533
|
+
let providers;
|
|
534
|
+
try {
|
|
535
|
+
providers = await loadModelProxyProviderConfig({ force: options.force === true, waitMs: 1_000 });
|
|
536
|
+
} catch (error) {
|
|
537
|
+
if (error?.code !== 'MODEL_PROXY_UNAVAILABLE') throw error;
|
|
538
|
+
return { managedByClient: true, unavailable: true, api: [], oauth: [], local: [] };
|
|
539
|
+
}
|
|
540
|
+
const project = (definitions, group, type) =>
|
|
541
|
+
definitions
|
|
542
|
+
.filter(({ id }) => Object.hasOwn(providers, id))
|
|
543
|
+
.map(({ id, name }) => {
|
|
544
|
+
const enabled = providers[id]?.enabled === true;
|
|
545
|
+
const authState = providers[id]?.authState;
|
|
546
|
+
// Older desktops advertise only enabled; new desktops distinguish a
|
|
547
|
+
// missing credential from a transiently unreadable, preserved adapter.
|
|
548
|
+
const authenticated = authState == null ? enabled : authState === 'present';
|
|
549
|
+
const usable = enabled && authState !== 'absent';
|
|
550
|
+
let status = usable ? 'Connected' : 'Not connected';
|
|
551
|
+
if (enabled && authState === 'unreadable') status = 'Checking…';
|
|
552
|
+
// Signed in but switched off on the desktop.
|
|
553
|
+
else if (!enabled && authState === 'present') status = 'Off';
|
|
554
|
+
return {
|
|
555
|
+
id, name, group, type, enabled,
|
|
556
|
+
authenticated,
|
|
557
|
+
usable,
|
|
558
|
+
...(group === 'local' ? { detected: enabled } : {}),
|
|
559
|
+
...(type === 'custom' ? { custom: true, modelOverrides: hiddenModelOverrides(providers[id]) } : {}),
|
|
560
|
+
status,
|
|
561
|
+
};
|
|
562
|
+
});
|
|
563
|
+
const custom = Object.entries(providers)
|
|
564
|
+
.filter(([id, entry]) => isCustomProviderId(id) && entry?.type === 'custom')
|
|
565
|
+
.map(([id]) => ({ id, name: id }));
|
|
566
|
+
return {
|
|
567
|
+
managedByClient: true,
|
|
568
|
+
api: [...project(API_PROVIDERS, 'api', 'api-key'), ...project(custom, 'api', 'custom')],
|
|
569
|
+
oauth: project(OAUTH_PROVIDERS, 'oauth', 'oauth'),
|
|
570
|
+
local: project([{ id: 'mixdog-local', name: 'Local Provider' }], 'local', 'local'),
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
|
|
519
574
|
function apiProviderStatusRow(p, config) {
|
|
520
575
|
const configured = config.providers?.[p.id] || {};
|
|
521
576
|
const envName = AGENT_PROVIDER_ENV[p.id] || p.env;
|
|
@@ -584,7 +639,12 @@ export function renderProviderStatus(config = {}) {
|
|
|
584
639
|
.join('\n');
|
|
585
640
|
}
|
|
586
641
|
|
|
642
|
+
function requireLocalProviderManagement() {
|
|
643
|
+
if (modelProxyClientMode()) throw serverModelCredentialsDisabledError('Provider account management');
|
|
644
|
+
}
|
|
645
|
+
|
|
587
646
|
export async function authenticateProvider(provider, secret) {
|
|
647
|
+
requireLocalProviderManagement();
|
|
588
648
|
const id = String(provider || '').trim();
|
|
589
649
|
if (!id) throw new Error('provider id is required');
|
|
590
650
|
|
|
@@ -605,6 +665,7 @@ export async function authenticateProvider(provider, secret) {
|
|
|
605
665
|
}
|
|
606
666
|
|
|
607
667
|
export async function loginOAuthProvider(cfgMod, provider) {
|
|
668
|
+
requireLocalProviderManagement();
|
|
608
669
|
const id = String(provider || '').trim();
|
|
609
670
|
const oauth = availableOAuthProvider(id);
|
|
610
671
|
if (!oauth) throw new Error(`unknown OAuth provider "${id}"`);
|
|
@@ -691,6 +752,7 @@ async function settleOAuthLogin(
|
|
|
691
752
|
}
|
|
692
753
|
|
|
693
754
|
export async function beginOAuthProviderLogin(cfgMod, provider, options = {}) {
|
|
755
|
+
requireLocalProviderManagement();
|
|
694
756
|
const id = String(provider || '').trim();
|
|
695
757
|
const oauth = availableOAuthProvider(id);
|
|
696
758
|
if (!oauth) throw new Error(`unknown OAuth provider "${id}"`);
|
|
@@ -763,6 +825,10 @@ export async function beginOAuthProviderLogin(cfgMod, provider, options = {}) {
|
|
|
763
825
|
}
|
|
764
826
|
|
|
765
827
|
export function listProviderAccounts(provider) {
|
|
828
|
+
if (!OAUTH_BY_ID.has(provider)) throw new TypeError('Unknown OAuth provider.');
|
|
829
|
+
// Client mode: accounts live on the desktop, so this server's roster is
|
|
830
|
+
// empty whatever this server's own provider availability says.
|
|
831
|
+
if (modelProxyClientMode()) return { provider, auto: true, useCredits: false, selectedId: null, accounts: [] };
|
|
766
832
|
const oauth = availableOAuthProvider(provider);
|
|
767
833
|
if (!oauth) throw new TypeError('Unknown OAuth provider.');
|
|
768
834
|
const pool = readProviderAccountPool(provider);
|
|
@@ -807,6 +873,7 @@ function defaultAccountRows(provider, oauth) {
|
|
|
807
873
|
// Store the implicit signed-in `default` account in the roster, so a change or
|
|
808
874
|
// a usage measurement has a row to land on. Returns the current roster view.
|
|
809
875
|
export async function materializeProviderAccounts(provider) {
|
|
876
|
+
requireLocalProviderManagement();
|
|
810
877
|
const current = listProviderAccounts(provider);
|
|
811
878
|
if (readProviderAccountPool(provider).accounts.length || !current.accounts.length) return current;
|
|
812
879
|
await registerProviderAccount(provider, 'default', { label: 'Account 1' });
|
|
@@ -814,6 +881,7 @@ export async function materializeProviderAccounts(provider) {
|
|
|
814
881
|
}
|
|
815
882
|
|
|
816
883
|
export async function updateProviderAccounts(provider, change) {
|
|
884
|
+
requireLocalProviderManagement();
|
|
817
885
|
await materializeProviderAccounts(provider);
|
|
818
886
|
await changeProviderAccounts(provider, change);
|
|
819
887
|
// Picking an account by hand is a decision to use it NOW, so the refusal
|
|
@@ -825,6 +893,7 @@ export async function updateProviderAccounts(provider, change) {
|
|
|
825
893
|
}
|
|
826
894
|
|
|
827
895
|
export async function saveProviderApiKey(cfgMod, provider, secret) {
|
|
896
|
+
requireLocalProviderManagement();
|
|
828
897
|
const id = String(provider || '').trim();
|
|
829
898
|
if (!API_PROVIDER_IDS.has(id)) throw new Error(`unknown API-key provider "${id}"`);
|
|
830
899
|
const value = String(secret || '').trim();
|
|
@@ -945,6 +1014,7 @@ async function resolveCustomInput(cfgMod, rawInput, options) {
|
|
|
945
1014
|
}
|
|
946
1015
|
|
|
947
1016
|
export async function saveCustomProvider(cfgMod, rawInput) {
|
|
1017
|
+
requireLocalProviderManagement();
|
|
948
1018
|
const {
|
|
949
1019
|
id: existingId,
|
|
950
1020
|
config,
|
|
@@ -999,6 +1069,7 @@ function plainPatch(value, allowed, label) {
|
|
|
999
1069
|
// removes the whole override; reasoning is merged key by key with the same
|
|
1000
1070
|
// tri-state rules. Semantic validation is the runtime normalizer's.
|
|
1001
1071
|
export async function updateCustomProviderModel(cfgMod, rawId, rawModelId, patch) {
|
|
1072
|
+
requireLocalProviderManagement();
|
|
1002
1073
|
const id = String(rawId || '').trim();
|
|
1003
1074
|
const modelId = typeof rawModelId === 'string' ? rawModelId.trim() : '';
|
|
1004
1075
|
if (!modelId) throw new TypeError('model id is required');
|
|
@@ -1079,6 +1150,7 @@ function withoutProviderReferences(config, id) {
|
|
|
1079
1150
|
}
|
|
1080
1151
|
|
|
1081
1152
|
export async function removeCustomProvider(cfgMod, rawId) {
|
|
1153
|
+
requireLocalProviderManagement();
|
|
1082
1154
|
const id = String(rawId || '').trim();
|
|
1083
1155
|
existingCustomEntry(cfgMod, id);
|
|
1084
1156
|
// Secret first: a real keychain failure (locked, permission) leaves the
|
|
@@ -1092,6 +1164,7 @@ export async function removeCustomProvider(cfgMod, rawId) {
|
|
|
1092
1164
|
}
|
|
1093
1165
|
|
|
1094
1166
|
export async function testCustomProvider(cfgMod, rawInput) {
|
|
1167
|
+
requireLocalProviderManagement();
|
|
1095
1168
|
const { id, config, apiKey } = await resolveCustomInput(cfgMod, rawInput, { requireModels: false });
|
|
1096
1169
|
try {
|
|
1097
1170
|
// The first visible manual model needs no discovery; otherwise the first
|
|
@@ -1128,6 +1201,7 @@ function customSecrets(apiKey, config) {
|
|
|
1128
1201
|
}
|
|
1129
1202
|
|
|
1130
1203
|
export async function discoverCustomProviderModels(cfgMod, rawInput) {
|
|
1204
|
+
requireLocalProviderManagement();
|
|
1131
1205
|
const { id, config, apiKey } = await resolveCustomInput(cfgMod, rawInput, { requireModels: false });
|
|
1132
1206
|
try {
|
|
1133
1207
|
const { createCustomProvider } = await loadCustomProviderModule();
|
|
@@ -1153,6 +1227,7 @@ function discoveryErrorView(error, secrets) {
|
|
|
1153
1227
|
}
|
|
1154
1228
|
|
|
1155
1229
|
export async function saveOpenAIUsageSessionKey(cfgMod, secret) {
|
|
1230
|
+
requireLocalProviderManagement();
|
|
1156
1231
|
const value = String(secret || '').trim();
|
|
1157
1232
|
if (!value) throw new Error('OpenAI usage session key is required for credit lookup');
|
|
1158
1233
|
await saveSecretAsync(SECRET_ACCOUNTS.openaiUsageSessionKey, value);
|
|
@@ -1161,6 +1236,7 @@ export async function saveOpenAIUsageSessionKey(cfgMod, secret) {
|
|
|
1161
1236
|
}
|
|
1162
1237
|
|
|
1163
1238
|
export async function saveOpenCodeGoUsageAuth(cfgMod, { apiKey } = {}) {
|
|
1239
|
+
requireLocalProviderManagement();
|
|
1164
1240
|
const secret = String(apiKey || '').trim();
|
|
1165
1241
|
if (!secret) throw new Error('OpenCode console API key is required for usage lookup');
|
|
1166
1242
|
// Subscription meters are read with a console service-account key holding the
|
|
@@ -1177,6 +1253,7 @@ export async function saveOpenCodeGoUsageAuth(cfgMod, { apiKey } = {}) {
|
|
|
1177
1253
|
}
|
|
1178
1254
|
|
|
1179
1255
|
export async function forgetProviderAuth(cfgModOrProvider, maybeProvider, requestedAccountId) {
|
|
1256
|
+
requireLocalProviderManagement();
|
|
1180
1257
|
const cfgMod = maybeProvider === undefined ? null : cfgModOrProvider;
|
|
1181
1258
|
const id = String(maybeProvider === undefined ? cfgModOrProvider : maybeProvider || '').trim();
|
|
1182
1259
|
const oauth = availableOAuthProvider(id);
|
|
@@ -16,6 +16,7 @@ function agentOwnedSessionFields(sessionProfile) {
|
|
|
16
16
|
visibility: 'agent-only',
|
|
17
17
|
agentTag: sessionProfile?.agentTag || null,
|
|
18
18
|
taskType: sessionProfile?.taskType || null,
|
|
19
|
+
...(sessionProfile?.routeFallbacks !== undefined ? { routeFallbacks: sessionProfile.routeFallbacks } : {}),
|
|
19
20
|
permission: sessionProfile?.permission || undefined,
|
|
20
21
|
permissionMode: sessionProfile?.permissionMode || undefined,
|
|
21
22
|
schemaAllowedTools: Array.isArray(sessionProfile?.schemaAllowedTools)
|
|
@@ -38,6 +39,10 @@ export function sessionOptions(deps, coreMemoryContext) {
|
|
|
38
39
|
const agentOwned = sessionProfile?.owner === 'agent' || sessionProfile?.visibility === 'agent-only';
|
|
39
40
|
// Agent-owned sessions keep the Active Workflow block only.
|
|
40
41
|
const workflowContext = agentOwned ? packContext : leadWorkflowContext;
|
|
42
|
+
const callerDisallowedTools = [
|
|
43
|
+
...(agentOwned ? [] : LEAD_DISALLOWED_TOOLS),
|
|
44
|
+
...(!agentOwned && rt.disallowDelegation ? ['agent'] : []),
|
|
45
|
+
];
|
|
41
46
|
const sessionOpts = {
|
|
42
47
|
...(rt.reservedSessionId ? { id: rt.reservedSessionId } : {}),
|
|
43
48
|
provider: rt.route.provider,
|
|
@@ -59,11 +64,8 @@ export function sessionOptions(deps, coreMemoryContext) {
|
|
|
59
64
|
...(rt.approvalMode ? { approvalMode: rt.approvalMode } : {}),
|
|
60
65
|
clientHostPid: sessionProfile?.clientHostPid || process.pid,
|
|
61
66
|
mcpScopeId: rt.mcpScopeId,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
...(!agentOwned && rt.disallowDelegation ? ['agent'] : []),
|
|
65
|
-
...featureDisallowedTools(),
|
|
66
|
-
],
|
|
67
|
+
callerDisallowedTools,
|
|
68
|
+
disallowedTools: [...callerDisallowedTools, ...featureDisallowedTools()],
|
|
67
69
|
cwd: rt.currentCwd,
|
|
68
70
|
...(rt.desktopSession && typeof rt.desktopSession === 'object' ? { desktopSession: rt.desktopSession } : {}),
|
|
69
71
|
coreMemoryContext,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// session-create/session-start-hook.mjs — the SessionStart project hook:
|
|
2
2
|
// best-effort dispatch whose additionalContext lands before the first turn.
|
|
3
3
|
import { runAbortable, throwIfAborted } from '../../runtime/shared/abort-race.mjs';
|
|
4
|
+
import { contextAckMessage } from '../../runtime/agent/orchestrator/session/compact/user-message-kind.mjs';
|
|
4
5
|
|
|
5
6
|
function sessionStartSource(reason) {
|
|
6
7
|
const reasonText = String(reason || '');
|
|
@@ -29,7 +30,7 @@ export async function dispatchSessionStart(deps, reason, signal) {
|
|
|
29
30
|
role: 'user',
|
|
30
31
|
content: `<system-reminder>\n# SessionStart Hook Context\n${startContext.trim()}\n</system-reminder>`,
|
|
31
32
|
});
|
|
32
|
-
rt.session.messages.push(
|
|
33
|
+
rt.session.messages.push(contextAckMessage());
|
|
33
34
|
rt.session.updatedAt = Date.now();
|
|
34
35
|
}
|
|
35
36
|
} catch {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Session transcript writer: every
|
|
1
|
+
// Session transcript writer: every session owns a
|
|
2
2
|
// conversation JSONL that the always-on memory watcher tails. The mutable
|
|
3
3
|
// runtime-core locals it needs are injected as accessors.
|
|
4
4
|
import { createTranscriptWriter } from '../runtime/shared/transcript-writer.mjs';
|
|
@@ -20,12 +20,10 @@ export function createSessionTranscript({ getSession, getCwd }) {
|
|
|
20
20
|
ensureSessionTranscriptWriter,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
//
|
|
24
|
-
// memory watcher tails this same file. Agent-owned sessions stay out of the
|
|
25
|
-
// user's recall pool and generate a session-local handoff when compacting.
|
|
23
|
+
// Agent conversations use the same writer but remain outside memory ingestion.
|
|
26
24
|
function ensureSessionTranscriptWriter() {
|
|
27
25
|
const session = getSession();
|
|
28
|
-
if (!session?.id
|
|
26
|
+
if (!session?.id) return false;
|
|
29
27
|
const cwd = getCwd();
|
|
30
28
|
const key = `${session.id}\u0000${cwd}`;
|
|
31
29
|
if (writerKey !== key) {
|
|
@@ -35,6 +33,7 @@ export function createSessionTranscript({ getSession, getCwd }) {
|
|
|
35
33
|
sessionId: session.id,
|
|
36
34
|
cwd,
|
|
37
35
|
pid: process.pid,
|
|
36
|
+
memoryEligible: !isAgentOwner(session),
|
|
38
37
|
});
|
|
39
38
|
writerKey = key;
|
|
40
39
|
} catch (error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* src/session-runtime/session-turn-api.mjs - turn execution (ask) plus the
|
|
3
|
-
* between-turn session
|
|
3
|
+
* between-turn session and agent/tool-surface commands. Stateless
|
|
4
4
|
* helpers are imported by the groups; the runtime injects live
|
|
5
5
|
* getters/setters for the mutable session/mode/turn-counter/transcript-writer
|
|
6
6
|
* locals plus the closure callbacks.
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { createTurnRunner } from './turn/turn-run.mjs';
|
|
9
9
|
import { createSessionOps } from './turn/session-ops.mjs';
|
|
10
10
|
import { createCompactionGate } from './turn/compaction-gate.mjs';
|
|
11
|
-
import { createShareOps } from './turn/share-ops.mjs';
|
|
12
11
|
import { createAgentOps } from './turn/agent-ops.mjs';
|
|
13
12
|
import { createSideQuestionOps } from './turn/side-question-ops.mjs';
|
|
14
13
|
|
|
@@ -19,13 +18,11 @@ export function createSessionTurnApi(deps) {
|
|
|
19
18
|
const afterCompaction = gate.after;
|
|
20
19
|
const runner = createTurnRunner({ ...deps, runPendingCompact: gate.run });
|
|
21
20
|
const session = createSessionOps(deps);
|
|
22
|
-
const share = createShareOps(deps);
|
|
23
21
|
const agent = createAgentOps(deps);
|
|
24
22
|
const side = createSideQuestionOps(deps);
|
|
25
23
|
return {
|
|
26
24
|
askSide: side.askSide,
|
|
27
25
|
cancelSide: side.cancelSide,
|
|
28
|
-
enqueueRemoteAttachedPrompt: runner.enqueueRemoteAttachedPrompt,
|
|
29
26
|
getTurnLiveness: runner.getTurnLiveness,
|
|
30
27
|
ask: afterCompaction(runner.ask),
|
|
31
28
|
clear: afterCompaction(session.clear),
|
|
@@ -36,14 +33,11 @@ export function createSessionTurnApi(deps) {
|
|
|
36
33
|
interruptTaskWait: session.interruptTaskWait,
|
|
37
34
|
readModelMessages: session.readModelMessages,
|
|
38
35
|
onAgentStatusChange: session.onAgentStatusChange,
|
|
39
|
-
takeRemoteInjections: share.takeRemoteInjections,
|
|
40
|
-
pendingSpoolPath: share.pendingSpoolPath,
|
|
41
|
-
publishSessionPresence: share.publishSessionPresence,
|
|
42
|
-
clearSessionPresence: share.clearSessionPresence,
|
|
43
|
-
sessionOwnerGone: share.sessionOwnerGone,
|
|
44
36
|
agentControl: agent.agentControl,
|
|
45
37
|
taskControl: agent.taskControl,
|
|
46
38
|
stopShellJob: agent.stopShellJob,
|
|
39
|
+
releaseShellJob: agent.releaseShellJob,
|
|
40
|
+
listShellJobs: agent.listShellJobs,
|
|
47
41
|
onNotification: agent.onNotification,
|
|
48
42
|
toolsStatus: agent.toolsStatus,
|
|
49
43
|
selectTools: agent.selectTools,
|
|
@@ -9,10 +9,7 @@ import {
|
|
|
9
9
|
} from '../runtime/agent/orchestrator/runtime-core/builtin-features.mjs';
|
|
10
10
|
import { featureEnvOverride, moduleEnabled } from '../runtime/agent/orchestrator/runtime-core/config-helpers.mjs';
|
|
11
11
|
import { LOCAL_PROVIDER_ID } from '../runtime/local-provider/managed-runtime.mjs';
|
|
12
|
-
import {
|
|
13
|
-
INSTRUCTION_FILES_MODES,
|
|
14
|
-
normalizeInstructionFilesMode,
|
|
15
|
-
} from '../runtime/shared/instruction-files-mode.mjs';
|
|
12
|
+
import { INSTRUCTION_FILES_MODES, normalizeInstructionFilesMode } from '../runtime/shared/instruction-files-mode.mjs';
|
|
16
13
|
import { getEmbeddingInfo } from '../runtime/memory/lib/embedding-provider.mjs';
|
|
17
14
|
import { onnxRuntimeSupported } from '../runtime/shared/onnx-runtime-support.mjs';
|
|
18
15
|
import {
|
|
@@ -24,7 +21,7 @@ import {
|
|
|
24
21
|
shutdownEffortJudge,
|
|
25
22
|
} from '../runtime/effort-judge/judge-client.mjs';
|
|
26
23
|
|
|
27
|
-
const TOGGLEABLE_BUILTINS = ['git', 'office', 'tidy', 'localProvider', 'autoEffort', 'visualize'];
|
|
24
|
+
const TOGGLEABLE_BUILTINS = ['git', 'office', 'tidy', 'localProvider', 'autoEffort', 'visualize', 'media'];
|
|
28
25
|
|
|
29
26
|
function setLocalProviderEnabledInConfig(configLike, enabled) {
|
|
30
27
|
const next = { ...(configLike || {}) };
|
|
@@ -113,6 +110,12 @@ export function createBuiltinToolSettings(
|
|
|
113
110
|
enabled: featureEnvOverride('MIXDOG_FEATURE_VISUALIZE') ?? moduleEnabled(config, 'visualize', true),
|
|
114
111
|
installed: true,
|
|
115
112
|
},
|
|
113
|
+
// Image and video generation ships with the runtime and is on unless
|
|
114
|
+
// switched off; the image/video skills follow it (`requires: media`).
|
|
115
|
+
media: {
|
|
116
|
+
enabled: featureEnvOverride('MIXDOG_FEATURE_MEDIA') ?? moduleEnabled(config, 'media', true),
|
|
117
|
+
installed: true,
|
|
118
|
+
},
|
|
116
119
|
localProvider: {
|
|
117
120
|
...localProvider,
|
|
118
121
|
...localSettings.status(),
|
|
@@ -168,7 +171,7 @@ export function createBuiltinToolSettings(
|
|
|
168
171
|
},
|
|
169
172
|
async setBuiltinToolEnabled(name, enabled) {
|
|
170
173
|
if (!TOGGLEABLE_BUILTINS.includes(name)) {
|
|
171
|
-
throw new TypeError('Built-in tool must be git, office, tidy, localProvider, autoEffort, or
|
|
174
|
+
throw new TypeError('Built-in tool must be git, office, tidy, localProvider, autoEffort, visualize, or media.');
|
|
172
175
|
}
|
|
173
176
|
if (name === 'autoEffort' && enabled !== false && !onnxRuntimeSupported()) {
|
|
174
177
|
throw new Error(EFFORT_JUDGE_UNSUPPORTED);
|
|
@@ -97,6 +97,7 @@ function routeInput(source) {
|
|
|
97
97
|
if (Object.hasOwn(source, 'contextPercent')) next.contextPercent = source.contextPercent;
|
|
98
98
|
if (Object.hasOwn(source, 'contextTokens')) next.contextTokens = source.contextTokens;
|
|
99
99
|
if (Object.hasOwn(source, 'disabled')) next.disabled = source.disabled;
|
|
100
|
+
if (Object.hasOwn(source, 'fallbacks')) next.fallbacks = source.fallbacks.map(routeInput);
|
|
100
101
|
return next;
|
|
101
102
|
}
|
|
102
103
|
|
|
@@ -119,6 +120,7 @@ function publicProviderRows(setup) {
|
|
|
119
120
|
...extra,
|
|
120
121
|
});
|
|
121
122
|
return {
|
|
123
|
+
...(setup?.managedByClient === true ? { managedByClient: true, unavailable: setup.unavailable === true } : {}),
|
|
122
124
|
pendingSecrets: setup?.pendingSecrets === true,
|
|
123
125
|
api: (setup?.api || []).map((row) =>
|
|
124
126
|
pick(row, {
|
|
@@ -143,7 +145,8 @@ function publicProviderRows(setup) {
|
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
/** Minimal provider rows for the model: only providers with a credential (or
|
|
146
|
-
* one needing re-authentication), counts instead of account rosters.
|
|
148
|
+
* one needing re-authentication), counts instead of account rosters. Without
|
|
149
|
+
* `accountCount` (desktop-owned accounts) no counts are reported. */
|
|
147
150
|
function configuredProviderRows(rows, accountCount) {
|
|
148
151
|
const providers = [];
|
|
149
152
|
let notConfigured = 0;
|
|
@@ -157,13 +160,15 @@ function configuredProviderRows(rows, accountCount) {
|
|
|
157
160
|
notConfigured += 1;
|
|
158
161
|
continue;
|
|
159
162
|
}
|
|
163
|
+
let accounts = {};
|
|
164
|
+
if (kind === 'oauth' && accountCount) accounts = { accounts: row.authenticated ? accountCount(row.id) : 0 };
|
|
160
165
|
providers.push({
|
|
161
166
|
id: row.id,
|
|
162
167
|
kind,
|
|
163
168
|
authenticated: row.authenticated,
|
|
164
169
|
status: row.status,
|
|
165
170
|
...(row.reauthRequired ? { reauthRequired: true } : {}),
|
|
166
|
-
...
|
|
171
|
+
...accounts,
|
|
167
172
|
});
|
|
168
173
|
}
|
|
169
174
|
}
|
|
@@ -331,6 +336,11 @@ const SETUP_STATUS_READERS = {
|
|
|
331
336
|
shell: (rt) => rt.getSystemShell?.() || {},
|
|
332
337
|
providers: async (rt, { detail }) => {
|
|
333
338
|
const rows = publicProviderRows(await rt.getProviderSetup?.({}));
|
|
339
|
+
// Client mode: the desktop owns accounts, so the server roster is never read.
|
|
340
|
+
if (rows.managedByClient) {
|
|
341
|
+
if (detail) return rows;
|
|
342
|
+
return { managedByClient: true, unavailable: rows.unavailable, ...configuredProviderRows(rows) };
|
|
343
|
+
}
|
|
334
344
|
if (!detail) return configuredProviderRows(rows, (id) => rt.getProviderAccounts(id).accounts.length);
|
|
335
345
|
rows.oauth = rows.oauth.map((row) =>
|
|
336
346
|
row.authenticated ? { ...row, accounts: publicAccounts(rt.getProviderAccounts(row.id)) } : row
|
|
@@ -369,6 +379,9 @@ function validateSetupInput(args) {
|
|
|
369
379
|
if (action !== 'set_agent_route' && Object.hasOwn(args.route, 'disabled')) {
|
|
370
380
|
throw new Error('route.disabled is only accepted by set_agent_route');
|
|
371
381
|
}
|
|
382
|
+
if (Object.hasOwn(args.route, 'fallbacks') && !['set_agent_route', 'set_web_search_route'].includes(action)) {
|
|
383
|
+
throw new Error('route.fallbacks is only accepted by set_agent_route and set_web_search_route');
|
|
384
|
+
}
|
|
372
385
|
for (const field of ['contextPercent', 'contextTokens', 'autoEffort']) {
|
|
373
386
|
if (action !== 'set_route' && action !== 'set_agent_route' && Object.hasOwn(args.route, field)) {
|
|
374
387
|
throw new Error(`route.${field} is only accepted by set_route and set_agent_route`);
|
|
@@ -436,7 +449,7 @@ const SETUP_ACTION_HANDLERS = {
|
|
|
436
449
|
open: (_rt, args, { openSurface }) => openSurface(args.target),
|
|
437
450
|
set_route: async (rt, args) => {
|
|
438
451
|
const route = routeInput(args.route);
|
|
439
|
-
const next = await rt.setRoute(route);
|
|
452
|
+
const next = await rt.setRoute(route, { keepMainModel: false });
|
|
440
453
|
return { route: next, appliesTo: 'next session (a conversation keeps its frozen route)' };
|
|
441
454
|
},
|
|
442
455
|
set_agent_route: async (rt, args) => {
|
|
@@ -554,6 +567,7 @@ const SETUP_ACTION_HANDLERS = {
|
|
|
554
567
|
forget_provider_auth: async (rt, args) => {
|
|
555
568
|
const name = requireText(args.name, 'name');
|
|
556
569
|
const setup = await rt.getProviderSetup({});
|
|
570
|
+
if (setup?.managedByClient) throw new Error('Manage provider accounts in the local desktop window.');
|
|
557
571
|
if (!(setup?.oauth || []).some((row) => row.id === name)) {
|
|
558
572
|
if (Object.hasOwn(args, 'accountId')) throw new Error('accountId applies only to OAuth providers');
|
|
559
573
|
return rt.forgetProviderAuth(name);
|
|
@@ -566,8 +580,12 @@ const SETUP_ACTION_HANDLERS = {
|
|
|
566
580
|
const accountId = Object.hasOwn(args, 'accountId') ? requireText(args.accountId, 'accountId') : accounts[0].id;
|
|
567
581
|
return { ...(await rt.forgetProviderAuth(name, accountId)), accountId };
|
|
568
582
|
},
|
|
569
|
-
set_provider_account: async (rt, args) =>
|
|
570
|
-
|
|
583
|
+
set_provider_account: async (rt, args) => {
|
|
584
|
+
if ((await rt.getProviderSetup?.({}))?.managedByClient) {
|
|
585
|
+
throw new Error('Manage provider accounts in the local desktop window.');
|
|
586
|
+
}
|
|
587
|
+
return publicAccounts(await rt.updateProviderAccounts(requireText(args.name, 'name'), args.providerAccount));
|
|
588
|
+
},
|
|
571
589
|
add_mcp_server: async (rt, args) => {
|
|
572
590
|
const server = mcpServerInput(args);
|
|
573
591
|
requireText(server.name, 'server.name');
|
|
@@ -33,10 +33,7 @@ function compactModelRow(row) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const isPresent = (value) =>
|
|
36
|
-
value != null &&
|
|
37
|
-
value !== '' &&
|
|
38
|
-
value !== false &&
|
|
39
|
-
!(typeof value === 'object' && !Object.keys(value).length);
|
|
36
|
+
value != null && value !== '' && value !== false && !(typeof value === 'object' && !Object.keys(value).length);
|
|
40
37
|
|
|
41
38
|
/** Everything set_route can use for one model; empty and false fields omitted. */
|
|
42
39
|
function modelDetail(row) {
|
|
@@ -69,10 +66,13 @@ function modelDetail(row) {
|
|
|
69
66
|
function findModel(rows, id, provider) {
|
|
70
67
|
const matches = rows.filter((row) => row.id === id && (!provider || row.provider === provider));
|
|
71
68
|
if (!matches.length) {
|
|
72
|
-
throw new Error(
|
|
69
|
+
throw new Error(
|
|
70
|
+
`model "${id}" not found${provider ? ` for provider "${provider}"` : ''}; list_models with catalog.provider returns its model ids`
|
|
71
|
+
);
|
|
73
72
|
}
|
|
74
73
|
const providers = [...new Set(matches.map((row) => row.provider))];
|
|
75
|
-
if (providers.length > 1)
|
|
74
|
+
if (providers.length > 1)
|
|
75
|
+
throw new Error(`model "${id}" is offered by ${providers.join(', ')}; pass catalog.provider`);
|
|
76
76
|
return matches[0];
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -116,7 +116,7 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
116
116
|
catalog: object({
|
|
117
117
|
provider: {
|
|
118
118
|
...text,
|
|
119
|
-
description:
|
|
119
|
+
description: "list_models: omit for the provider index; set for that provider's compact model rows.",
|
|
120
120
|
},
|
|
121
121
|
model: {
|
|
122
122
|
...text,
|
|
@@ -124,7 +124,12 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
124
124
|
'list_models: one model id; returns its full options (efforts, fast, service tiers, modelParameterOptions, parameterVariants) for set_route. Add provider when several offer the id.',
|
|
125
125
|
},
|
|
126
126
|
page: { type: 'integer', minimum: 1, description: 'list_models with provider: 1-based page; default 1.' },
|
|
127
|
-
limit: {
|
|
127
|
+
limit: {
|
|
128
|
+
type: 'integer',
|
|
129
|
+
minimum: 1,
|
|
130
|
+
maximum: 100,
|
|
131
|
+
description: 'list_models with provider: rows per page; default 25.',
|
|
132
|
+
},
|
|
128
133
|
webSearch: { ...boolean, description: 'list_models: native-search capable models only.' },
|
|
129
134
|
refresh: { ...boolean, description: 'list_models: refresh the catalog first.' },
|
|
130
135
|
}),
|
|
@@ -156,6 +156,17 @@ const ROUTE_SCHEMA = {
|
|
|
156
156
|
},
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
ROUTE_SCHEMA.properties.fallbacks = {
|
|
160
|
+
type: 'array',
|
|
161
|
+
description: 'Agent and Web Search routes only: ordered fallback models; [] clears the list.',
|
|
162
|
+
items: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
required: ['provider', 'model'],
|
|
166
|
+
properties: Object.fromEntries(Object.entries(ROUTE_SCHEMA.properties).filter(([key]) => key !== 'disabled')),
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
159
170
|
export const SETUP_TOOL_DEFS = Object.freeze([
|
|
160
171
|
{
|
|
161
172
|
name: 'setup',
|
|
@@ -272,7 +283,8 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
272
283
|
properties: { id: { type: 'string' }, label: { type: 'string', maxLength: 80 } },
|
|
273
284
|
},
|
|
274
285
|
},
|
|
275
|
-
description:
|
|
286
|
+
description:
|
|
287
|
+
'set_provider_account: OAuth account change; account ids from status providers with detail:true.',
|
|
276
288
|
},
|
|
277
289
|
modelId: {
|
|
278
290
|
type: 'string',
|