mixdog 1.3.4 → 1.4.0
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/LICENSES/oh-my-pi-MIT.txt +23 -0
- package/NOTICE.md +17 -2
- package/README.md +11 -0
- package/package.json +3 -11
- package/scripts/daemon-stub.mjs +1 -1
- package/scripts/embed-google-oauth-client.mjs +49 -0
- package/scripts/gate-local.mjs +4 -2
- package/scripts/lib/test-spawn-ledger.mjs +46 -1
- package/scripts/native-release-status.mjs +2 -2
- package/scripts/recall-history-cases.json +1 -1
- package/scripts/suite-health.mjs +10 -1
- package/scripts/test.mjs +12 -11
- package/src/agents/reviewer/AGENT.md +7 -11
- package/src/agents/reviewer/agent.json +1 -1
- package/src/defaults/shipped-history.json +25 -1
- package/src/defaults/skills/browser-use/SKILL.md +77 -17
- package/src/defaults/skills/code-tidy/SKILL.md +142 -270
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +4 -4
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +31 -76
- package/src/defaults/skills/code-tidy/references/dead-code.md +6 -12
- package/src/defaults/skills/computer-use/SKILL.md +33 -9
- package/src/defaults/skills/setup/SKILL.md +29 -2
- package/src/defaults/skills/setup/references/actions.md +117 -28
- package/src/defaults/skills/setup/references/surfaces.md +77 -35
- package/src/defaults/skills/setup-guide/SKILL.md +3 -3
- package/src/defaults/skills/visualize/SKILL.md +2 -1
- package/src/lib/keychain-cjs.cjs +359 -29
- package/src/lib/rules-builder.cjs +10 -8
- package/src/rules/agent/AGENT.md +6 -6
- package/src/rules/agent-mode/AGENT_MODE.md +10 -2
- package/src/rules/agent-mode/MIXY.md +12 -0
- package/src/rules/lead/LEAD.md +18 -20
- package/src/rules/shared/05-tool-calls.md +5 -6
- package/src/rules/shared/10-tool-workflow.md +2 -0
- package/src/rules/shared/60-verification.md +7 -5
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -3
- package/src/runtime/agent/orchestrator/agent-runtime/heartbeat-completion.mjs +193 -0
- package/src/runtime/agent/orchestrator/agent-runtime/title-completion.mjs +3 -1
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +3 -1
- package/src/runtime/agent/orchestrator/config.mjs +34 -0
- package/src/runtime/agent/orchestrator/context/collect.mjs +3 -0
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +72 -67
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +54 -1
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +3 -3
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +177 -73
- package/src/runtime/agent/orchestrator/mcp/client.mjs +25 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-callback.mjs +31 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-client.mjs +16 -3
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +42 -7
- package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +21 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-shared.mjs +23 -0
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +11 -1
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +230 -137
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +64 -7
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +18 -5
- package/src/runtime/agent/orchestrator/providers/anthropic-cache-warm.mjs +165 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/gzip-post.mjs +14 -14
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +160 -69
- package/src/runtime/agent/orchestrator/providers/anthropic-overload-fallback.mjs +25 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +64 -33
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +135 -87
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +52 -8
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +22 -6
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +15 -4
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +17 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +142 -104
- package/src/runtime/agent/orchestrator/providers/cache-warm-admission.mjs +90 -0
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +10 -4
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +10 -217
- package/src/runtime/agent/orchestrator/providers/cursor-wire-transport.mjs +25 -9
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +22 -6
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +409 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-families.mjs +187 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-identity.mjs +342 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-models.mjs +541 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-protobuf.mjs +305 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-request.mjs +558 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-schema.mjs +880 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-session.mjs +190 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-tool-args.mjs +351 -0
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +560 -0
- package/src/runtime/agent/orchestrator/providers/devin.mjs +491 -0
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/gemini-output-limit.mjs +46 -0
- package/src/runtime/agent/orchestrator/providers/gemini-reasoning-relay.mjs +30 -0
- package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +7 -11
- package/src/runtime/agent/orchestrator/providers/gemini-retry-policy.mjs +61 -22
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-request.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +71 -4
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +25 -2
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +96 -5
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +17 -3
- package/src/runtime/agent/orchestrator/providers/lib/tail-reminder-split.mjs +23 -5
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +52 -10
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +8 -1
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/npm-cli-version.mjs +11 -3
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +19 -1
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +39 -3
- 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 +2 -0
- package/src/runtime/agent/orchestrator/providers/openai-error-contract.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +10 -9
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/send-context.mjs +22 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/attempt-context.mjs +43 -5
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/handshake-failure.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/stream-failure.mjs +6 -3
- package/src/runtime/agent/orchestrator/providers/opencode-go-gemini.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/provider-availability.mjs +19 -0
- package/src/runtime/agent/orchestrator/providers/provider-error-kind.mjs +65 -1
- package/src/runtime/agent/orchestrator/providers/quota-reading.mjs +38 -12
- package/src/runtime/agent/orchestrator/providers/registry.mjs +43 -3
- package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +39 -7
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/wire-protobuf-codec.mjs +368 -0
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +12 -7
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/compaction-config-keys.mjs +62 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +37 -16
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-delta.mjs +100 -23
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/reaction-tool-defs.mjs +133 -0
- package/src/runtime/agent/orchestrator/runtime-core/session-text.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-bridge.mjs +19 -4
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +125 -30
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +23 -5
- package/src/runtime/agent/orchestrator/runtime-core/tool-profile.mjs +35 -10
- package/src/runtime/agent/orchestrator/runtime-core/workflow/agents.mjs +57 -10
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +9 -6
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +18 -0
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +0 -3
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +10 -4
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +792 -0
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +148 -25
- package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +475 -58
- package/src/runtime/agent/orchestrator/session/compaction-archive.mjs +42 -17
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/human-gate/gate.mjs +47 -9
- package/src/runtime/agent/orchestrator/session/human-gate/outbound-policy.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -4
- package/src/runtime/agent/orchestrator/session/human-gate/store.mjs +14 -2
- package/src/runtime/agent/orchestrator/session/loop/assistant-commit.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +18 -22
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +32 -3
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +51 -3
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +17 -3
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +10 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/after-hook.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +14 -4
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +16 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +16 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +10 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +3 -10
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +23 -5
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +12 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +19 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-commit.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +133 -90
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +14 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +31 -4
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +30 -18
- package/src/runtime/agent/orchestrator/session/manager/owner-route-fallbacks.mjs +23 -13
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/manager/provider-replay.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/manager/route-fallback-chain.mjs +129 -0
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +20 -2
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +102 -15
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +18 -5
- package/src/runtime/agent/orchestrator/session/message-ids.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/message-reactions.mjs +89 -0
- package/src/runtime/agent/orchestrator/session/message-reactions.test-support.mjs +75 -0
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +19 -8
- package/src/runtime/agent/orchestrator/session/prompt-cache-idle-gaps.mjs +113 -0
- package/src/runtime/agent/orchestrator/session/prompt-cache-touch-store.mjs +127 -0
- package/src/runtime/agent/orchestrator/session/routine-result.d.mts +0 -2
- package/src/runtime/agent/orchestrator/session/routine-result.mjs +47 -11
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +20 -2
- package/src/runtime/agent/orchestrator/session/sensitive-projection.mjs +100 -0
- package/src/runtime/agent/orchestrator/session/sensitive-values.mjs +257 -0
- package/src/runtime/agent/orchestrator/session/side-question-store.mjs +20 -7
- package/src/runtime/agent/orchestrator/session/side-question.mjs +18 -0
- package/src/runtime/agent/orchestrator/session/skill-update-notice.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/store/live-state.mjs +6 -3
- package/src/runtime/agent/orchestrator/session/store/save-delta.mjs +9 -5
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +9 -8
- package/src/runtime/agent/orchestrator/session/store/session-persistence-events.mjs +29 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-header-cache.mjs +85 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +133 -18
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +12 -2
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +44 -14
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +84 -3
- package/src/runtime/agent/orchestrator/session/stored-attachment-history.mjs +32 -0
- package/src/runtime/agent/orchestrator/session/tail-reminder-rules.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/thinking-binding.mjs +108 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/tool-batch/record-outcome.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/tool-batch/state.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +25 -2
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-status.mjs +9 -7
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-text.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/turn-failure.mjs +5 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +5 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +12 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/misuse-guard.mjs +240 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/result-format.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/shell-cwd.mjs +38 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +25 -5
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +65 -7
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +36 -13
- package/src/runtime/browser-bridge/action-schema.mjs +13 -2
- package/src/runtime/browser-bridge/client.mjs +73 -8
- package/src/runtime/browser-bridge/input-fields.mjs +8 -9
- package/src/runtime/browser-bridge/mail-links.mjs +107 -0
- package/src/runtime/browser-bridge/tool-defs.mjs +1 -1
- package/src/runtime/channels/lib/config.mjs +6 -61
- package/src/runtime/channels/lib/crash-log.mjs +1 -1
- package/src/runtime/channels/lib/event-pipeline.mjs +4 -19
- package/src/runtime/channels/lib/event-queue.mjs +3 -18
- package/src/runtime/channels/lib/owned-runtime/automation-services.mjs +2 -2
- package/src/runtime/channels/lib/owned-runtime/automation-start.mjs +3 -4
- package/src/runtime/channels/lib/owned-runtime/config-reload.mjs +4 -59
- package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +33 -115
- package/src/runtime/channels/lib/owned-runtime/owned-stop.mjs +5 -22
- package/src/runtime/channels/lib/owned-runtime/state.mjs +2 -8
- package/src/runtime/channels/lib/owned-runtime.mjs +6 -23
- package/src/runtime/channels/lib/parent-bridge.mjs +2 -2
- package/src/runtime/channels/lib/runtime-paths.mjs +4 -43
- package/src/runtime/channels/lib/schedule-errors.mjs +51 -0
- package/src/runtime/channels/lib/scheduler.mjs +135 -154
- package/src/runtime/channels/lib/schedules-db.mjs +83 -11
- package/src/runtime/channels/lib/status-snapshot.mjs +1 -1
- package/src/runtime/channels/lib/tool-dispatch.mjs +14 -2
- package/src/runtime/channels/lib/webhooks-db.mjs +5 -9
- package/src/runtime/channels/lib/worker-bootstrap.mjs +0 -1
- package/src/runtime/channels/lib/worker-ipc.mjs +0 -1
- package/src/runtime/channels/lib/worker-main.mjs +19 -34
- package/src/runtime/computer-bridge/action-schema.mjs +42 -1
- package/src/runtime/computer-bridge/actions.mjs +9 -1
- package/src/runtime/computer-bridge/client.mjs +180 -8
- package/src/runtime/computer-bridge/core-actions.mjs +2 -2
- package/src/runtime/computer-bridge/error-recovery.mjs +27 -2
- package/src/runtime/computer-bridge/linux-readiness.mjs +65 -23
- package/src/runtime/computer-bridge/pending-continuation.mjs +1 -1
- package/src/runtime/connectors/connector-accounts-mcp.mjs +230 -0
- package/src/runtime/connectors/gmail-app-password.mjs +172 -39
- package/src/runtime/connectors/google-mcp.mjs +10 -12
- package/src/runtime/memory/lib/pg/adapter.mjs +77 -70
- package/src/runtime/memory/lib/pg/supervisor.mjs +24 -12
- package/src/runtime/memory/lib/runtime-fetcher.mjs +23 -5
- package/src/runtime/office/com/com-adapter.mjs +17 -1
- package/src/runtime/office/com/office-com-host.ps1 +51 -1
- package/src/runtime/office/pdf/cfb-fixture.mjs +328 -0
- package/src/runtime/office/pdf/cfb-protection.mjs +311 -0
- package/src/runtime/office/pdf/document-preview.mjs +326 -8
- package/src/runtime/office/pdf/ooxml-crypto.mjs +469 -0
- package/src/runtime/office/pdf/ooxml-key-worker.mjs +14 -0
- package/src/runtime/office/portable/portable-soffice.mjs +45 -5
- package/src/runtime/session-search/session-search-db.mjs +73 -9
- package/src/runtime/session-search/session-search-ingest.mjs +110 -20
- package/src/runtime/shared/abort-race.mjs +89 -0
- package/src/runtime/shared/agent-avatar.d.mts +0 -1
- package/src/runtime/shared/agent-kind.mjs +4 -3
- package/src/runtime/shared/bot-hops.mjs +62 -2
- package/src/runtime/shared/bounded-download.mjs +8 -3
- package/src/runtime/shared/config.mjs +51 -35
- package/src/runtime/shared/connector-accounts.mjs +20 -10
- package/src/runtime/shared/connector-catalog.d.mts +33 -2
- package/src/runtime/shared/connector-catalog.mjs +166 -8
- package/src/runtime/shared/connector-triggers.mjs +22 -19
- package/src/runtime/shared/defaults-separation.mjs +2 -14
- package/src/runtime/shared/delegated-approval-host.mjs +103 -11
- package/src/runtime/shared/developer-options.mjs +32 -1
- package/src/runtime/shared/err-text.mjs +24 -15
- package/src/runtime/shared/file-permissions.d.mts +0 -8
- package/src/runtime/shared/file-permissions.mjs +0 -11
- package/src/runtime/shared/git-direct.test-support.mjs +19 -0
- package/src/runtime/shared/google-oauth-client.generated.json +4 -0
- package/src/runtime/shared/google-oauth-client.mjs +34 -9
- package/src/runtime/shared/heartbeat-interval.d.mts +4 -0
- package/src/runtime/shared/heartbeat-interval.mjs +19 -0
- package/src/runtime/shared/idle-auto-clear-gate.mjs +104 -0
- package/src/runtime/shared/llm/anthropic-betas.mjs +7 -0
- package/src/runtime/shared/llm/anthropic-thinking-contract.mjs +12 -0
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +1 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +1 -1
- package/src/runtime/shared/llm/well-formed.mjs +66 -0
- package/src/runtime/shared/mixy-presence.mjs +22 -0
- package/src/runtime/shared/orchestration.d.mts +2 -0
- package/src/runtime/shared/pg-schema-db.mjs +27 -16
- package/src/runtime/shared/profile-config.cjs +1 -1
- package/src/runtime/shared/prompt-origin.d.mts +4 -0
- package/src/runtime/shared/prompt-origin.mjs +21 -0
- package/src/runtime/shared/provider-accounts.mjs +231 -59
- package/src/runtime/shared/provider-api-key.mjs +19 -8
- package/src/runtime/shared/provider-display-name.mjs +29 -0
- package/src/runtime/shared/provider-timeout-phase.mjs +2 -0
- package/src/runtime/shared/routine-trigger.d.mts +2 -0
- package/src/runtime/shared/routine-trigger.mjs +52 -0
- package/src/runtime/shared/sensitive-path-rules.d.mts +2 -10
- package/src/runtime/shared/sensitive-path-rules.mjs +19 -41
- package/src/runtime/shared/session-activity-signal.mjs +34 -1
- package/src/runtime/shared/session-sidebar-host.d.mts +1 -1
- package/src/runtime/shared/session-sidebar-host.mjs +7 -3
- package/src/runtime/shared/session-turn-prelude.mjs +18 -0
- package/src/runtime/shared/tool-execution-contract.mjs +2 -0
- package/src/runtime/shared/tool-result-summary.mjs +1 -14
- package/src/runtime/shared/transcript-metadata.mjs +38 -0
- package/src/runtime/shared/user-data-guard.mjs +30 -2
- package/src/runtime/shared/worktrees/activity-gate.mjs +12 -5
- package/src/runtime/shared/worktrees/test-support.mjs +9 -4
- package/src/runtime/terminal-bridge/client.mjs +10 -1
- package/src/runtime/visualize-bridge/client.mjs +27 -8
- package/src/runtime/visualize-bridge/tool-defs.mjs +22 -8
- package/src/runtime/visualize-bridge/tool-meta.d.mts +5 -0
- package/src/runtime/visualize-bridge/tool-meta.mjs +22 -0
- package/src/runtime/web-search/lib/fetch-pipeline.mjs +2 -2
- package/src/session-runtime/agent-home-delivery.mjs +486 -179
- package/src/session-runtime/agent-room-delivery.mjs +28 -1
- package/src/session-runtime/agent-task-sessions.mjs +561 -199
- package/src/session-runtime/boot/apis.mjs +9 -0
- package/src/session-runtime/boot/begin.mjs +3 -2
- package/src/session-runtime/boot/infrastructure.mjs +4 -0
- package/src/session-runtime/boot/providers.mjs +3 -0
- package/src/session-runtime/boot/tools.mjs +8 -1
- package/src/session-runtime/bot-chain.mjs +32 -0
- package/src/session-runtime/bot-status.mjs +7 -4
- package/src/session-runtime/channel-config-api.mjs +63 -17
- package/src/session-runtime/config-lifecycle.mjs +6 -0
- package/src/session-runtime/connector-merge-migration.mjs +305 -0
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +132 -28
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +2 -0
- package/src/session-runtime/internal-tool-executor/reaction-tool.mjs +45 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +72 -5
- package/src/session-runtime/internal-tool-executor.mjs +4 -0
- package/src/session-runtime/lifecycle/inheritance.mjs +16 -3
- package/src/session-runtime/lifecycle/session-catalog.mjs +3 -1
- package/src/session-runtime/lifecycle/teardown/runtime-stops.mjs +50 -4
- package/src/session-runtime/lifecycle/teardown.mjs +23 -5
- package/src/session-runtime/mcp-glue/server-catalog.mjs +61 -3
- package/src/session-runtime/mcp-oauth-login.mjs +5 -3
- package/src/session-runtime/mixy-heartbeat.mjs +927 -0
- package/src/session-runtime/model-route/route-tuning.mjs +10 -6
- package/src/session-runtime/notification-bus.mjs +31 -117
- package/src/session-runtime/notification-completion-queue.mjs +54 -0
- package/src/session-runtime/notification-listeners.mjs +76 -0
- package/src/session-runtime/owned-automation-run.mjs +35 -13
- package/src/session-runtime/prewarm/channel-start.mjs +3 -7
- package/src/session-runtime/provider-auth/login.mjs +7 -0
- package/src/session-runtime/provider-models/row-hydration.mjs +13 -2
- package/src/session-runtime/resource-mcp-api.mjs +143 -224
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +163 -0
- package/src/session-runtime/resource-mcp-oauth-api.mjs +217 -0
- package/src/session-runtime/resource-mcp-secrets.mjs +82 -0
- package/src/session-runtime/resource-mcp-servers.mjs +78 -0
- package/src/session-runtime/resource-mcp-store.mjs +49 -0
- package/src/session-runtime/routine-home-turn.mjs +33 -6
- package/src/session-runtime/routine-owner.mjs +40 -9
- package/src/session-runtime/schedule-session-run.mjs +7 -3
- package/src/session-runtime/services/agent-tool/close-flow.mjs +3 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +8 -12
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +7 -2
- package/src/session-runtime/services/agent-tool/tag-registry.mjs +1 -0
- package/src/session-runtime/services/agent-tool/worker-index/awaiting-user-sync.mjs +51 -0
- package/src/session-runtime/services/agent-tool/worker-index/disposal.mjs +55 -0
- package/src/session-runtime/services/agent-tool/worker-index/released-store.mjs +123 -0
- package/src/session-runtime/services/agent-tool/worker-index/restart-settlement.mjs +112 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-reads.mjs +36 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +2 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-store.mjs +17 -4
- package/src/session-runtime/services/agent-tool/worker-index/row-writes.mjs +58 -0
- package/src/session-runtime/services/agent-tool/worker-index.mjs +41 -241
- package/src/session-runtime/services/agent-tool/worker-rows.mjs +3 -0
- package/src/session-runtime/services/channel-admin.mjs +73 -31
- package/src/session-runtime/services/channel-session-router.mjs +4 -2
- package/src/session-runtime/services/channel-worker.mjs +1 -1
- package/src/session-runtime/services/provider-admin.mjs +128 -25
- package/src/session-runtime/services/schedule-access.mjs +14 -0
- package/src/session-runtime/services/seeds.mjs +0 -28
- package/src/session-runtime/services/usage-dashboard-model.mjs +1 -0
- package/src/session-runtime/session-compaction-sync.mjs +27 -0
- package/src/session-runtime/session-create/session-options.mjs +8 -4
- package/src/session-runtime/settings-builtin-tools-api.mjs +11 -0
- package/src/session-runtime/settings-compaction-api.mjs +2 -40
- package/src/session-runtime/settings-system-api.mjs +28 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +65 -0
- package/src/session-runtime/setup-tool/executor.mjs +187 -29
- package/src/session-runtime/setup-tool/extended-actions.mjs +33 -2
- package/src/session-runtime/setup-tool/session-route-actions.mjs +152 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +68 -6
- package/src/session-runtime/setup-tool/tool-defs.mjs +92 -6
- package/src/session-runtime/task-session-route.mjs +99 -0
- package/src/session-runtime/tool-policy/agent-profile-fold.mjs +17 -13
- package/src/session-runtime/tool-policy/policy-stage.mjs +21 -4
- package/src/session-runtime/tool-policy/surface-helpers.mjs +2 -3
- package/src/session-runtime/tool-surface.mjs +4 -0
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +1 -0
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +98 -21
- package/src/session-runtime/workflow-agents-api/style-and-mode.mjs +4 -0
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +6 -1
- package/src/session-runtime/workspace/transitions.mjs +10 -2
- package/src/standalone/channel-transport/client-registry/client-records.mjs +65 -0
- package/src/standalone/channel-transport/client-registry/client-registration.mjs +118 -0
- package/src/standalone/channel-transport/client-registry.mjs +24 -163
- package/src/standalone/channel-transport.mjs +1 -1
- package/src/standalone/daemon-channels-loader.mjs +10 -8
- package/src/standalone/daemon-session-control/list-page.mjs +72 -0
- package/src/standalone/daemon-session-control/request.mjs +51 -0
- package/src/standalone/daemon-session-control/room-host.mjs +57 -0
- package/src/standalone/daemon-session-control/route-control.mjs +48 -0
- package/src/standalone/daemon-session-control/send-turn.mjs +60 -0
- package/src/standalone/daemon-session-control/worktree-control.mjs +40 -0
- package/src/standalone/daemon-session-control.mjs +161 -157
- package/src/standalone/daemon.mjs +33 -2
- package/src/standalone/session-client.mjs +7 -3
- package/src/standalone/session-protocol.mjs +10 -0
- package/src/standalone/session-service/agent-tree/agent-cancel.mjs +6 -2
- package/src/standalone/session-service/agent-tree/agent-child.mjs +1 -0
- package/src/standalone/session-service/quota-resume.mjs +3 -0
- package/src/standalone/session-service/retention/busy.mjs +65 -1
- package/src/standalone/session-service/session-calls/session-action.mjs +23 -2
- package/src/standalone/session-service/session-calls/session-turns.mjs +6 -0
- package/src/standalone/session-service/session-calls/session-views.mjs +8 -0
- package/src/standalone/session-service.mjs +13 -0
- package/src/standalone/session-tool-output.mjs +21 -10
- package/src/tui/app/model-options.mjs +4 -27
- package/src/tui/dist/index.mjs +81 -65
- package/src/tui/session/agent-job-feed/model-notification.mjs +3 -0
- package/src/tui/session/initial-state.mjs +3 -0
- package/src/tui/session/notice-surface.mjs +23 -1
- package/src/tui/session/queue-helpers.mjs +3 -42
- package/src/tui/session/session-api/integrations.mjs +1 -0
- package/src/tui/session/session-api/lifecycle.mjs +8 -0
- package/src/tui/session/session-api/routes-agent-definitions.mjs +14 -2
- package/src/tui/session/session-api/routes-write.mjs +5 -1
- package/src/tui/session/session-api/routes.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +30 -2
- package/src/tui/session/session-flow/auto-clear.mjs +4 -33
- package/src/tui/session/session-flow/drain-closed-queue.mjs +38 -0
- package/src/tui/session/session-flow/drain-enqueue.mjs +86 -0
- package/src/tui/session/session-flow/drain-retry.mjs +35 -0
- package/src/tui/session/session-flow/drain.mjs +118 -149
- package/src/tui/session/session-flow/queue/entry-shape.mjs +5 -0
- package/src/tui/session/session-flow/queue/take-entries.mjs +5 -2
- package/src/tui/session/tool-approval-delegation.mjs +64 -0
- package/src/tui/session/tool-approval-request.mjs +39 -0
- package/src/tui/session/tool-approval-settle.mjs +62 -0
- package/src/tui/session/tool-approval.mjs +69 -115
- package/src/tui/session/tui-steering-persist.mjs +8 -1
- package/src/tui/session/turn-stream.mjs +36 -3
- package/src/tui/session/turn.mjs +23 -2
- package/src/vendor/statusline/bin/statusline-route.mjs +1 -219
- package/src/vendor/statusline/src/gateway/route-meta.mjs +35 -13
- package/scripts/code-graph-description-contract.mjs +0 -188
- package/src/runtime/channels/lib/owned-runtime/ownership-refresh.mjs +0 -36
|
@@ -38,11 +38,11 @@ export const SETUP_EXTENDED_ACTION_FIELDS = Object.freeze({
|
|
|
38
38
|
add_hook_rule: 'hookRule',
|
|
39
39
|
set_hook_rule_enabled: 'ruleIndex enabled',
|
|
40
40
|
delete_hook_rule: 'ruleIndex',
|
|
41
|
-
set_media_default: 'kind lane model?',
|
|
41
|
+
set_media_default: 'kind lane model? accountId?',
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
/** Mirrors RULE_ACTIONS in services/hook-bus/rule-store.mjs. */
|
|
45
|
-
|
|
45
|
+
const SETUP_HOOK_RULE_ACTIONS = Object.freeze(['allow', 'deny', 'block', 'modify', 'rewrite', 'ask']);
|
|
46
46
|
|
|
47
47
|
/** Mirrors ACTIVITY_RAIL_PIN_IDS in apps/desktop/src/shared/activity-rail-pins.ts. */
|
|
48
48
|
export const SETUP_ACTIVITY_RAIL_PIN_IDS = Object.freeze([
|
|
@@ -177,6 +177,10 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
177
177
|
entry: object(
|
|
178
178
|
{
|
|
179
179
|
name: text,
|
|
180
|
+
newName: {
|
|
181
|
+
...text,
|
|
182
|
+
description: 'Schedule only, with overwrite: rename the schedule `name` to this; its history is kept.',
|
|
183
|
+
},
|
|
180
184
|
description: text,
|
|
181
185
|
instructions: text,
|
|
182
186
|
time: { ...text, description: 'Schedule cron expression. Mutually exclusive with at.' },
|
|
@@ -220,7 +224,6 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
220
224
|
desktop: object({
|
|
221
225
|
keepAwake: boolean,
|
|
222
226
|
runInBackground: boolean,
|
|
223
|
-
turnNotifications: boolean,
|
|
224
227
|
usagePinned: boolean,
|
|
225
228
|
usageRailShortLong: boolean,
|
|
226
229
|
usageAccountsExpanded: boolean,
|
|
@@ -228,12 +231,37 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
228
231
|
usageRailSlotsAll: boolean,
|
|
229
232
|
computerObserveOnly: boolean,
|
|
230
233
|
browserAutoSignIn: boolean,
|
|
234
|
+
saveChatLogins: boolean,
|
|
231
235
|
notificationVolume: {
|
|
232
236
|
type: 'integer',
|
|
233
237
|
minimum: 0,
|
|
234
238
|
maximum: 400,
|
|
235
239
|
description: 'Windows only: notification sound volume percent.',
|
|
236
240
|
},
|
|
241
|
+
botOverlay: object(
|
|
242
|
+
{
|
|
243
|
+
enabled: {
|
|
244
|
+
...boolean,
|
|
245
|
+
description: 'Show the representative bot overlay; refused while no representative bot exists.',
|
|
246
|
+
},
|
|
247
|
+
position: {
|
|
248
|
+
type: 'string',
|
|
249
|
+
enum: ['pinned', 'pinnedHere', 'free', 'onScreen'],
|
|
250
|
+
description:
|
|
251
|
+
'pinned = pin above the message box (default); pinnedHere = pin here; free = free in the app window; onScreen = free on screen.',
|
|
252
|
+
},
|
|
253
|
+
keepAbove: { ...boolean, description: 'Keep above other windows (default off).' },
|
|
254
|
+
collapsed: { ...boolean, description: 'Collapse the bubble so only the bot shows (default off).' },
|
|
255
|
+
autoAdvance: { ...boolean, description: 'Auto-advance long replies (default on).' },
|
|
256
|
+
autoClose: { ...boolean, description: 'Close replies automatically once read (default on).' },
|
|
257
|
+
scale: {
|
|
258
|
+
type: 'integer',
|
|
259
|
+
enum: [50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200],
|
|
260
|
+
description: 'Bot size in percent (default 100).',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
[]
|
|
264
|
+
),
|
|
237
265
|
}),
|
|
238
266
|
appearance: object({
|
|
239
267
|
theme: { type: 'string', enum: ['system', 'dark', 'white'] },
|
|
@@ -242,6 +270,35 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
242
270
|
description: 'Desktop UI language id from status appearance; independent of profile language.',
|
|
243
271
|
},
|
|
244
272
|
sidePanels: { type: 'string', enum: ['close-left', 'close-right', 'close-both', 'keep-open'] },
|
|
273
|
+
sidePanelPosition: {
|
|
274
|
+
type: 'string',
|
|
275
|
+
enum: ['right', 'bottom', 'auto'],
|
|
276
|
+
description:
|
|
277
|
+
'Where the side dock sits on desktop: beside the chat, below it, or by window shape (default right).',
|
|
278
|
+
},
|
|
279
|
+
timeFormat: {
|
|
280
|
+
type: 'string',
|
|
281
|
+
enum: ['system', '12h', '24h'],
|
|
282
|
+
description: 'Clock style for every time of day shown (default system = the UI language own clock).',
|
|
283
|
+
},
|
|
284
|
+
uiScale: {
|
|
285
|
+
type: 'number',
|
|
286
|
+
minimum: 0.85,
|
|
287
|
+
maximum: 1.2,
|
|
288
|
+
description: 'UI size multiplier, 0.85-1.2 in steps of 0.05 (default 1).',
|
|
289
|
+
},
|
|
290
|
+
codeSize: {
|
|
291
|
+
type: 'integer',
|
|
292
|
+
minimum: 10,
|
|
293
|
+
maximum: 20,
|
|
294
|
+
description: 'Code text size in px, 10-20 (default 13).',
|
|
295
|
+
},
|
|
296
|
+
codeLigatures: { ...boolean, description: 'Join symbols such as => into one glyph in code (default on).' },
|
|
297
|
+
chatTextSize: {
|
|
298
|
+
type: 'string',
|
|
299
|
+
enum: ['small', 'default', 'large', 'extra-large'],
|
|
300
|
+
description: 'Conversation and composer text size (default default).',
|
|
301
|
+
},
|
|
245
302
|
markdownDefaultView: { type: 'string', enum: ['preview', 'rich', 'source'] },
|
|
246
303
|
linkPreview: boolean,
|
|
247
304
|
toolActivityExpansion: { type: 'string', enum: ['collapsed', 'commands', 'all'] },
|
|
@@ -290,10 +347,15 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
290
347
|
minimum: 0,
|
|
291
348
|
description: 'set_hook_rule_enabled/delete_hook_rule: rule index from status hooks.',
|
|
292
349
|
},
|
|
293
|
-
lane: {
|
|
350
|
+
lane: {
|
|
351
|
+
...text,
|
|
352
|
+
description:
|
|
353
|
+
'set_media_default: lane id from the media catalog to pin as the default generator for the kind; "" clears the pin (back to Auto).',
|
|
354
|
+
},
|
|
294
355
|
model: {
|
|
295
356
|
...nonBlank,
|
|
296
|
-
description:
|
|
357
|
+
description:
|
|
358
|
+
'set_media_default: model id offered by the lane for the kind; omitted = the lane default. set_model_preferences: model id of the provider.',
|
|
297
359
|
},
|
|
298
360
|
project: object({ path: text, alias: text }, ['path']),
|
|
299
361
|
projectPath: { ...text, description: 'Exact registered Project root.' },
|
|
@@ -306,7 +368,7 @@ export const SETUP_EXTENDED_PROPERTIES = Object.freeze({
|
|
|
306
368
|
riskAccepted: {
|
|
307
369
|
...boolean,
|
|
308
370
|
description:
|
|
309
|
-
"set_developer_option: the user's explicit acceptance of the option warning; required to enable an option that has one.",
|
|
371
|
+
"set_developer_option: the user's explicit acceptance of the option warning; required to enable an option that has one. Exception: allowAllActions (allow all actions except payments and permanent deletes) can only be turned on by the person in the desktop app; it is rejected regardless of riskAccepted, and remote enablement is rejected too.",
|
|
310
372
|
},
|
|
311
373
|
});
|
|
312
374
|
|
|
@@ -6,9 +6,17 @@ import {
|
|
|
6
6
|
} from './settings-contract.mjs';
|
|
7
7
|
import { MEDIA_KINDS } from '../../runtime/media/tool-defs.mjs';
|
|
8
8
|
import { INSTRUCTION_FILES_MODES } from '../../runtime/shared/instruction-files-mode.mjs';
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_HEARTBEAT_INTERVAL_MINUTES,
|
|
11
|
+
HEARTBEAT_INTERVAL_CHOICES,
|
|
12
|
+
} from '../../runtime/shared/heartbeat-interval.mjs';
|
|
9
13
|
import { AUTO_EFFORT_BASES } from '../../runtime/agent/orchestrator/providers/auto-effort.mjs';
|
|
10
14
|
import { WORKTREE_NEW_TASK_DEFAULTS } from '../../runtime/shared/worktrees/settings.mjs';
|
|
11
15
|
import { CONNECTOR_IDS } from '../../runtime/shared/connector-catalog.mjs';
|
|
16
|
+
import { COMPACTION_SUMMARY_MODES } from '../../runtime/agent/orchestrator/session/compact/summary-mode.mjs';
|
|
17
|
+
import { ACTION_KINDS } from '../../runtime/agent/orchestrator/session/human-gate/outbound-policy.mjs';
|
|
18
|
+
import { PERMISSION_MODES } from '../../runtime/agent/orchestrator/session/human-gate/store.mjs';
|
|
19
|
+
import { CONNECTOR_PERMISSIONS } from '../../runtime/agent/orchestrator/mcp/agent-connectors.mjs';
|
|
12
20
|
|
|
13
21
|
/** Built-in `setup` tool: the model's handle on a Mixdog user's persisted
|
|
14
22
|
* configuration. The description is a contract only; how to use each action
|
|
@@ -99,6 +107,12 @@ export const SETUP_ACTION_FIELDS = Object.freeze({
|
|
|
99
107
|
delete_local_model: 'confirmationToken',
|
|
100
108
|
set_system_shell: 'command',
|
|
101
109
|
set_auto_update: 'enabled',
|
|
110
|
+
set_ai_session_titles: 'enabled',
|
|
111
|
+
set_quota_auto_resume: 'enabled',
|
|
112
|
+
set_model_preferences: 'provider model hidden? favorite?',
|
|
113
|
+
set_heartbeat_enabled: 'enabled',
|
|
114
|
+
set_heartbeat_interval: 'minutes',
|
|
115
|
+
set_reactions_enabled: 'enabled',
|
|
102
116
|
forget_provider_auth: 'name accountId?',
|
|
103
117
|
set_provider_account: 'name providerAccount',
|
|
104
118
|
add_mcp_server: 'server',
|
|
@@ -115,6 +129,19 @@ export const SETUP_ACTION_FIELDS = Object.freeze({
|
|
|
115
129
|
enable_plugin_mcp: 'name',
|
|
116
130
|
connect_connector: 'connector',
|
|
117
131
|
set_worktree_settings: 'worktree',
|
|
132
|
+
reset_route_fallback: 'sessionId? agent?',
|
|
133
|
+
continue_in_model: 'sessionId route',
|
|
134
|
+
schedule_quota_resume: 'sessionId',
|
|
135
|
+
cancel_quota_resume: 'sessionId',
|
|
136
|
+
set_cache_warming_enabled: 'enabled',
|
|
137
|
+
read_agent_settings: 'agent',
|
|
138
|
+
read_project_connectors: 'projectPath',
|
|
139
|
+
set_agent_permission: 'agent actionKind permissionMode',
|
|
140
|
+
set_agent_connector: 'agent name enabled',
|
|
141
|
+
set_agent_connector_tool: 'agent name tool permission',
|
|
142
|
+
set_project_connector: 'projectPath name enabled',
|
|
143
|
+
restore_definition: 'definitionKind name',
|
|
144
|
+
set_bot_order: 'botOrder',
|
|
118
145
|
...SETUP_EXTENDED_ACTION_FIELDS,
|
|
119
146
|
});
|
|
120
147
|
|
|
@@ -130,6 +157,7 @@ export const SETUP_BUILTIN_TOGGLE_FEATURES = Object.freeze([
|
|
|
130
157
|
'computer',
|
|
131
158
|
'voice',
|
|
132
159
|
'visualize',
|
|
160
|
+
'media',
|
|
133
161
|
]);
|
|
134
162
|
|
|
135
163
|
const ROUTE_SCHEMA = {
|
|
@@ -163,7 +191,7 @@ const ROUTE_SCHEMA = {
|
|
|
163
191
|
ROUTE_SCHEMA.properties.fallbacks = {
|
|
164
192
|
type: 'array',
|
|
165
193
|
description:
|
|
166
|
-
'Lead (set_route), agent (bots included) and Web Search routes only: ordered fallback models tried when the model hits its usage limit or is unavailable; [] clears the list.',
|
|
194
|
+
'Lead (set_route), agent (bots included) and Web Search routes only: ordered fallback models tried when the model hits its usage limit or is unavailable, each on another provider; [] clears the list. Running sessions on that route read it at their next hop.',
|
|
167
195
|
items: {
|
|
168
196
|
type: 'object',
|
|
169
197
|
additionalProperties: false,
|
|
@@ -212,7 +240,11 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
212
240
|
description:
|
|
213
241
|
'Partial route update; omitted fields are preserved. Agent or Web Search provider "" restores Main inheritance. contextPercent and contextTokens apply to Main and agent routes only.',
|
|
214
242
|
},
|
|
215
|
-
agent: {
|
|
243
|
+
agent: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
description:
|
|
246
|
+
'Agent or bot id (lead = Mixy): set_agent_route, read_agent_settings, set_agent_permission, set_agent_connector(_tool); reset_route_fallback: every chat of that bot.',
|
|
247
|
+
},
|
|
216
248
|
workflow: { type: 'string', description: 'set_workflow: pack id.' },
|
|
217
249
|
style: { type: 'string', description: 'set_output_style: style id.' },
|
|
218
250
|
profile: {
|
|
@@ -248,13 +280,33 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
248
280
|
properties: {
|
|
249
281
|
mainBufferTokens: { type: 'integer', minimum: 0 },
|
|
250
282
|
mainBufferPercent: { type: 'number', minimum: 0, maximum: 100 },
|
|
283
|
+
onModelChange: {
|
|
284
|
+
type: 'boolean',
|
|
285
|
+
description: 'Auto-compact a conversation on its current model before it switches to another one.',
|
|
286
|
+
},
|
|
287
|
+
summaryMode: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
enum: [...COMPACTION_SUMMARY_MODES],
|
|
290
|
+
description:
|
|
291
|
+
'Which model writes compaction summaries: smart (default), maintainer (the Maintainer), self (the conversation model).',
|
|
292
|
+
},
|
|
251
293
|
},
|
|
252
|
-
description:
|
|
294
|
+
description:
|
|
295
|
+
'set_compaction: reserved Main context budget (give tokens OR percent, not both), onModelChange and summaryMode; read back with status compaction.',
|
|
253
296
|
},
|
|
254
297
|
enabled: {
|
|
255
298
|
type: 'boolean',
|
|
256
299
|
description:
|
|
257
|
-
'Boolean setters (set_*_enabled, set_compaction, set_auto_update, set_mcp_enabled, set_plugin_enabled).',
|
|
300
|
+
'Boolean setters (set_*_enabled, set_compaction, set_auto_update, set_ai_session_titles, set_quota_auto_resume, set_heartbeat_enabled, set_mcp_enabled, set_plugin_enabled, set_agent_connector, set_project_connector).',
|
|
301
|
+
},
|
|
302
|
+
provider: { type: 'string', description: 'set_model_preferences: provider id.' },
|
|
303
|
+
hidden: {
|
|
304
|
+
type: 'boolean',
|
|
305
|
+
description: 'set_model_preferences: false lists the model in /model, true hides it; omitted = unchanged.',
|
|
306
|
+
},
|
|
307
|
+
favorite: {
|
|
308
|
+
type: 'boolean',
|
|
309
|
+
description: 'set_model_preferences: favorite star on or off; omitted = unchanged.',
|
|
258
310
|
},
|
|
259
311
|
instructionFiles: {
|
|
260
312
|
type: 'string',
|
|
@@ -270,12 +322,12 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
270
322
|
},
|
|
271
323
|
name: {
|
|
272
324
|
type: 'string',
|
|
273
|
-
description: `set_builtin_enabled: ${SETUP_BUILTIN_TOGGLE_FEATURES.join('|')}; install_builtin also accepts memory. Memory toggles use set_memory_enabled. revoke_linked_device: client id from status connection, not its display name; set_developer_option: option id from status developer; read_definition/delete_definition: the definition id; reconnect_mcp: optional MCP server name (omit for all); else MCP/plugin/provider id.`,
|
|
325
|
+
description: `set_builtin_enabled: ${SETUP_BUILTIN_TOGGLE_FEATURES.join('|')}; install_builtin also accepts memory. Memory toggles use set_memory_enabled. revoke_linked_device: client id from status connection, not its display name; set_developer_option: option id from status developer; read_definition/delete_definition: the definition id; reconnect_mcp: optional MCP server name (omit for all); set_agent_connector(_tool)/set_project_connector: connector (MCP server) id from read_agent_settings; restore_definition: archived agent id; else MCP/plugin/provider id.`,
|
|
274
326
|
},
|
|
275
327
|
accountId: {
|
|
276
328
|
type: 'string',
|
|
277
329
|
description:
|
|
278
|
-
|
|
330
|
+
"forget_provider_auth: OAuth account id from status providers with detail:true; required when the provider has several accounts. set_media_default: optional account of the OAuth lane to pin; omitted = the lane provider's selected account.",
|
|
279
331
|
},
|
|
280
332
|
providerAccount: {
|
|
281
333
|
type: 'object',
|
|
@@ -323,6 +375,11 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
323
375
|
maximum: 86400,
|
|
324
376
|
description: 'set_local_idle_ttl: unload after this many idle seconds, 0 disables; default 3600.',
|
|
325
377
|
},
|
|
378
|
+
minutes: {
|
|
379
|
+
type: 'integer',
|
|
380
|
+
enum: [...HEARTBEAT_INTERVAL_CHOICES],
|
|
381
|
+
description: `set_heartbeat_interval: minutes between Mixy's heartbeat checks; default ${DEFAULT_HEARTBEAT_INTERVAL_MINUTES}.`,
|
|
382
|
+
},
|
|
326
383
|
query: { type: 'string', description: 'search_local_models: Hugging Face GGUF search query.' },
|
|
327
384
|
repository: { type: 'string', description: 'inspect_hf_model: public Hugging Face owner/model repository.' },
|
|
328
385
|
filename: {
|
|
@@ -400,6 +457,35 @@ export const SETUP_TOOL_DEFS = Object.freeze([
|
|
|
400
457
|
},
|
|
401
458
|
description: 'set_worktree_settings: only the given fields change.',
|
|
402
459
|
},
|
|
460
|
+
sessionId: {
|
|
461
|
+
type: 'string',
|
|
462
|
+
description:
|
|
463
|
+
'reset_route_fallback (default: this session), continue_in_model, schedule_quota_resume, cancel_quota_resume: session id from status model/agents or the session tool. The last three take another session.',
|
|
464
|
+
},
|
|
465
|
+
actionKind: {
|
|
466
|
+
type: 'string',
|
|
467
|
+
enum: [...ACTION_KINDS],
|
|
468
|
+
description: "set_agent_permission: the action kind row of the agent's permission table.",
|
|
469
|
+
},
|
|
470
|
+
permissionMode: {
|
|
471
|
+
type: 'string',
|
|
472
|
+
enum: [...PERMISSION_MODES],
|
|
473
|
+
description:
|
|
474
|
+
'set_agent_permission: block or ask; allow (and any change that lets an agent do more without asking) is made by the person in the desktop app.',
|
|
475
|
+
},
|
|
476
|
+
tool: { type: 'string', description: 'set_agent_connector_tool: tool name within the connector `name`.' },
|
|
477
|
+
permission: {
|
|
478
|
+
type: 'string',
|
|
479
|
+
enum: [...CONNECTOR_PERMISSIONS],
|
|
480
|
+
description: 'set_agent_connector_tool: needs_approval or disabled; auto is made in the desktop app.',
|
|
481
|
+
},
|
|
482
|
+
botOrder: {
|
|
483
|
+
type: 'array',
|
|
484
|
+
items: { type: 'string', minLength: 1, pattern: '\\S' },
|
|
485
|
+
maxItems: 500,
|
|
486
|
+
description:
|
|
487
|
+
'set_bot_order: bot ids in display order (Mixy is always first and not listed); [] = default order.',
|
|
488
|
+
},
|
|
403
489
|
...SETUP_EXTENDED_PROPERTIES,
|
|
404
490
|
},
|
|
405
491
|
},
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task-session-route.mjs — the model and reasoning effort a bot asks of a
|
|
3
|
+
* task session (the session tool's `model` / `effort`), checked against the
|
|
4
|
+
* provider catalog the desktop model menu lists (listProviderModels rows:
|
|
5
|
+
* provider, id, display, effortOptions).
|
|
6
|
+
*/
|
|
7
|
+
import { clean } from '../runtime/agent/orchestrator/runtime-core/session-text.mjs';
|
|
8
|
+
import { normalizeEffortInput } from '../runtime/agent/orchestrator/runtime-core/effort.mjs';
|
|
9
|
+
|
|
10
|
+
// Choices an error names: a short list, never the whole catalog.
|
|
11
|
+
const CHOICE_LIMIT = 6;
|
|
12
|
+
|
|
13
|
+
const lower = (value) => clean(value).toLowerCase();
|
|
14
|
+
const rowId = (row) => clean(row.id || row.model);
|
|
15
|
+
const sameModel = (row, route) => row.provider === route.provider && lower(rowId(row)) === lower(route.model);
|
|
16
|
+
const effortsOf = (row) => (Array.isArray(row?.effortOptions) ? row.effortOptions.map((option) => option.value) : []);
|
|
17
|
+
const choiceLabel = (row) => `${row.display || rowId(row)} (${row.provider}/${rowId(row)})`;
|
|
18
|
+
|
|
19
|
+
function choices(rows) {
|
|
20
|
+
const shown = rows.slice(0, CHOICE_LIMIT).map(choiceLabel).join('; ');
|
|
21
|
+
return rows.length > CHOICE_LIMIT ? `${shown}; … (${rows.length} total)` : shown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** An effort level word ("max") or null; "auto" is no level. */
|
|
25
|
+
function effortWord(word) {
|
|
26
|
+
try {
|
|
27
|
+
return normalizeEffortInput(word);
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The catalog rows of the model menu, read through session `sessionId`'s runtime. */
|
|
34
|
+
export async function readModelCatalog(service, sessionId) {
|
|
35
|
+
const result = await service.readSession({ sessionId, action: 'listProviderModels', args: [{}] });
|
|
36
|
+
return Array.isArray(result?.value) ? result.value : [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The route of a catalog display name (case-insensitive, exact), with a
|
|
40
|
+
* trailing effort word ("Claude Opus 5.5 max", or auto) read as the effort
|
|
41
|
+
* only when the whole text names no model. With `explicitEffort` the word
|
|
42
|
+
* only selects the name: the caller applies its own effort. Throws with the
|
|
43
|
+
* choices when the text names no model or several. */
|
|
44
|
+
export function routeByDisplayName(text, rows, explicitEffort = false) {
|
|
45
|
+
const wanted = lower(text);
|
|
46
|
+
const cut = wanted.lastIndexOf(' ');
|
|
47
|
+
const word = cut > 0 ? wanted.slice(cut + 1) : '';
|
|
48
|
+
const suffix = word === 'auto' || effortWord(word) ? word : null;
|
|
49
|
+
let hits = rows.filter((row) => lower(row.display) === wanted);
|
|
50
|
+
let effort = null;
|
|
51
|
+
if (!hits.length && suffix) {
|
|
52
|
+
const base = wanted.slice(0, cut).trim();
|
|
53
|
+
hits = rows.filter((row) => lower(row.display) === base);
|
|
54
|
+
effort = suffix;
|
|
55
|
+
}
|
|
56
|
+
if (!hits.length) {
|
|
57
|
+
const words = wanted.split(/\s+/).filter(Boolean);
|
|
58
|
+
const near = rows.filter((row) => words.every((word) => lower(row.display).includes(word)));
|
|
59
|
+
throw new Error(
|
|
60
|
+
`session: model "${clean(text)}" is neither a provider/model route, a preset name nor a model display name. ` +
|
|
61
|
+
`Choices: ${choices(near.length ? near : rows)}${suffix ? '. To set the reasoning effort, pass it as the effort field' : ''}`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
const distinct = [...new Map(hits.map((row) => [`${row.provider}/${rowId(row)}`, row])).values()];
|
|
65
|
+
if (distinct.length > 1) {
|
|
66
|
+
throw new Error(`session: model "${clean(text)}" is ambiguous; use provider/model: ${choices(distinct)}`);
|
|
67
|
+
}
|
|
68
|
+
const route = { provider: distinct[0].provider, model: rowId(distinct[0]) };
|
|
69
|
+
return effort && !explicitEffort ? withEffort(route, effort, rows) : route;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** `route` with the effort level `value`, checked against the levels its
|
|
73
|
+
* model supports ("auto" clears it). A chosen level turns the route's Auto
|
|
74
|
+
* effort off, as the menu's effort pick does, or Auto would replace it. */
|
|
75
|
+
export function withEffort(route, value, rows) {
|
|
76
|
+
const level = checkEffort(value, route, rows);
|
|
77
|
+
const { effort: _previous, ...rest } = route;
|
|
78
|
+
return level ? { ...rest, effort: level, autoEffort: false } : rest;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The effort level `value` names for `route` ("auto" is null); throws with
|
|
82
|
+
* the model's levels when it is unknown or unsupported. */
|
|
83
|
+
export function checkEffort(value, route, rows) {
|
|
84
|
+
const row = rows.find((candidate) => sameModel(candidate, route));
|
|
85
|
+
const allowed = row ? effortsOf(row) : null;
|
|
86
|
+
const offer = allowed
|
|
87
|
+
? `; ${route.provider}/${route.model} supports: auto${allowed.map((level) => `, ${level}`).join('')}`
|
|
88
|
+
: '';
|
|
89
|
+
let level;
|
|
90
|
+
try {
|
|
91
|
+
level = normalizeEffortInput(value);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
throw new Error(`session: ${error.message}${offer}`);
|
|
94
|
+
}
|
|
95
|
+
if (level && allowed && !allowed.includes(level)) {
|
|
96
|
+
throw new Error(`session: effort "${level}" is not supported${offer}`);
|
|
97
|
+
}
|
|
98
|
+
return level;
|
|
99
|
+
}
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
} from '../../runtime/agent/orchestrator/mcp/agent-connectors.mjs';
|
|
20
20
|
import { agentListEntries } from '../../runtime/agent/orchestrator/session/manager/prompt-utils.mjs';
|
|
21
21
|
import { markToolSurfaceMigrated } from '../../runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs';
|
|
22
|
+
import { resetBp2StableContext } from '../../runtime/agent/orchestrator/context/collect.mjs';
|
|
23
|
+
import { requestPrefixIdentity } from '../../runtime/agent/orchestrator/session/thinking-binding.mjs';
|
|
22
24
|
import {
|
|
23
25
|
agentProfileRevision,
|
|
24
26
|
leadRosterRevision,
|
|
@@ -40,15 +42,6 @@ const PROMPT_FOLD_INTENT = 'prompt_fold';
|
|
|
40
42
|
// Cache-break intents that already rebuild the conversation's cached prefix.
|
|
41
43
|
const COLD_INTENTS = new Set(['post_turn_compaction', 'manual_compaction']);
|
|
42
44
|
|
|
43
|
-
// What the next request sends ahead of the conversation: the system blocks and tools.
|
|
44
|
-
const promptPrefix = (session) =>
|
|
45
|
-
JSON.stringify([
|
|
46
|
-
(Array.isArray(session.messages) ? session.messages : [])
|
|
47
|
-
.filter((message) => message?.role === 'system')
|
|
48
|
-
.map((message) => message.content),
|
|
49
|
-
session.tools,
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
45
|
// A bot thread built from other shipped rules than these (a release changed one).
|
|
53
46
|
const rulesStale = (session) =>
|
|
54
47
|
sessionModeOf(session) === AGENT_MODE && session.rulesRevision !== promptRulesRevision();
|
|
@@ -208,7 +201,10 @@ export function createAgentProfileFold({
|
|
|
208
201
|
const config = configForSession(getConfig(), session.workflow?.id, currentMode(session));
|
|
209
202
|
const staged = await stagePolicy(session, identity, config, { conversation: true });
|
|
210
203
|
if (getSession?.() !== session) return false;
|
|
211
|
-
const before =
|
|
204
|
+
const before = requestPrefixIdentity(session);
|
|
205
|
+
// BP2 (profile meta, skill manifest) from current sources too; applyPolicy
|
|
206
|
+
// re-appends its deferred manifest.
|
|
207
|
+
if (typeof staged.stableContext === 'string') resetBp2StableContext(session, staged.stableContext);
|
|
212
208
|
applyPolicy(session, staged);
|
|
213
209
|
rewriteConversationBp3Core(session, staged.core);
|
|
214
210
|
if (session.agentProfileRevision !== undefined) {
|
|
@@ -218,17 +214,25 @@ export function createAgentProfileFold({
|
|
|
218
214
|
}
|
|
219
215
|
if (agentMode) session.rulesRevision = promptRulesRevision();
|
|
220
216
|
session.updatedAt = Date.now();
|
|
221
|
-
if (
|
|
217
|
+
if (requestPrefixIdentity(session) === before) return false;
|
|
222
218
|
markToolSurfaceMigrated(session, session.pendingCacheBreakIntent || intent);
|
|
223
219
|
return true;
|
|
224
220
|
}
|
|
225
221
|
|
|
226
222
|
/** Fold pending prompt changes (a switched workflow, a bot's moved tool
|
|
227
|
-
* gates, changed shipped rules) when the cache is cold anyway.
|
|
223
|
+
* gates, changed shipped rules) when the cache is cold anyway. A
|
|
224
|
+
* compaction rebuilds the prompt from current sources whether or not
|
|
225
|
+
* anything is known pending (an update can change shipped rules, skills
|
|
226
|
+
* and manifests no stamp tracks); an unchanged prompt stays byte-identical
|
|
227
|
+
* and adds no break. */
|
|
228
228
|
async function foldPromptIfCold() {
|
|
229
229
|
const session = getSession?.();
|
|
230
|
+
// Scope exception: delegated worker sessions (`owner: 'agent'`) keep the
|
|
231
|
+
// prompt they were created with; they are task-scoped, and their skill
|
|
232
|
+
// bodies are still restored from current sources at Compact.
|
|
230
233
|
if (!session?.id || !session.promptIdentity || isAgentOwner(session)) return false;
|
|
231
|
-
|
|
234
|
+
const compacted = COLD_INTENTS.has(session.pendingCacheBreakIntent);
|
|
235
|
+
if (!compacted && !(foldPending(session) && cacheCold(session))) return false;
|
|
232
236
|
return foldPrompt(session, PROMPT_FOLD_INTENT);
|
|
233
237
|
}
|
|
234
238
|
|
|
@@ -11,14 +11,21 @@ import {
|
|
|
11
11
|
import { deferredSurfaceModeForLead } from '../../runtime/agent/orchestrator/runtime-core/effort.mjs';
|
|
12
12
|
import {
|
|
13
13
|
applyInitialDeferredToolManifestToBp2,
|
|
14
|
+
buildSkillManifest,
|
|
15
|
+
collectPromptSkillsCached,
|
|
14
16
|
composeSystemPrompt,
|
|
15
17
|
} from '../../runtime/agent/orchestrator/context/collect.mjs';
|
|
16
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
_buildBaseRules,
|
|
20
|
+
_buildLeadMetaContext,
|
|
21
|
+
} from '../../runtime/agent/orchestrator/session/manager/rules-cache.mjs';
|
|
17
22
|
import { sessionRolePromptFields } from '../../runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs';
|
|
18
23
|
import {
|
|
19
24
|
delegationDisabled,
|
|
20
25
|
honoredSchemaAllowlist,
|
|
26
|
+
reactionDisabled,
|
|
21
27
|
} from '../../runtime/agent/orchestrator/session/manager/session-tool-surface.mjs';
|
|
28
|
+
import { REACTION_TOOL_NAME } from '../../runtime/agent/orchestrator/runtime-core/reaction-tool-defs.mjs';
|
|
22
29
|
import { finalizeSessionToolList } from '../../runtime/agent/orchestrator/session/manager/tool-resolution.mjs';
|
|
23
30
|
import { isAgentOwner } from '../../runtime/agent/orchestrator/agent-owner.mjs';
|
|
24
31
|
import { AGENT_MODE, sessionModeOf } from '../../runtime/agent/orchestrator/session/agent-mode.mjs';
|
|
@@ -40,14 +47,15 @@ export function createPolicyStage({
|
|
|
40
47
|
activeWorkflowContext,
|
|
41
48
|
}) {
|
|
42
49
|
// The tools `session` is denied now: its caller's denials, the feature gates
|
|
43
|
-
// as they stand,
|
|
50
|
+
// as they stand, an agent-mode Lead's agent tool when its workflow
|
|
44
51
|
// delegates to no one (a coding Lead keeps it: workflow.mjs
|
|
45
|
-
// workflowDisallowsAgentTool).
|
|
52
|
+
// workflowDisallowsAgentTool), and react outside a bot's chat with the user.
|
|
46
53
|
function liveDeniedTools(session, workflow) {
|
|
47
54
|
return [
|
|
48
55
|
...session.callerDisallowedTools,
|
|
49
56
|
...featureDisallowedTools(),
|
|
50
57
|
...(workflowDisallowsAgentTool(workflow, { agentMode: sessionModeOf(session) === AGENT_MODE }) ? ['agent'] : []),
|
|
58
|
+
...(reactionDisabled(session, isAgentOwner(session)) ? [REACTION_TOOL_NAME] : []),
|
|
51
59
|
]
|
|
52
60
|
.map((name) => String(name || ''))
|
|
53
61
|
.filter(Boolean);
|
|
@@ -131,7 +139,12 @@ export function createPolicyStage({
|
|
|
131
139
|
model: getRoute()?.model,
|
|
132
140
|
});
|
|
133
141
|
const coreMemoryContext = conversation ? '' : await leadCoreMemoryContext();
|
|
134
|
-
|
|
142
|
+
// BP2's stable part as session creation composes it
|
|
143
|
+
// (session-prompt-composition.mjs): the Lead meta context and the skill
|
|
144
|
+
// manifest of the skills in scope now.
|
|
145
|
+
const skipRules = identity.skipAgentRules || toolFreeRole;
|
|
146
|
+
const skills = schemaAllowedTools?.length === 0 ? [] : collectPromptSkillsCached(session.cwd);
|
|
147
|
+
const { sessionMarkerCore, stableSystemContext } = composeSystemPrompt({
|
|
135
148
|
...sessionRolePromptFields(identity, {
|
|
136
149
|
ownerIsAgent,
|
|
137
150
|
toolFreeRole,
|
|
@@ -146,6 +159,8 @@ export function createPolicyStage({
|
|
|
146
159
|
// setting; agent mode carries none.
|
|
147
160
|
instructionFilesContext:
|
|
148
161
|
conversation || toolFreeRole || agentMode ? null : loadInstructionFilesContext?.(session) || null,
|
|
162
|
+
metaContext: skipRules || ownerIsAgent ? undefined : _buildLeadMetaContext({ includeOutputStyle: !agentMode }),
|
|
163
|
+
skillManifest: buildSkillManifest(skills),
|
|
149
164
|
});
|
|
150
165
|
return {
|
|
151
166
|
workflow,
|
|
@@ -156,6 +171,8 @@ export function createPolicyStage({
|
|
|
156
171
|
ownerIsAgent,
|
|
157
172
|
baseRules,
|
|
158
173
|
core: conversation ? withPresentedWorkspaceSlices(session, sessionMarkerCore) : sessionMarkerCore,
|
|
174
|
+
// Without BP1 the BP2 block cannot be located: null leaves it as it is.
|
|
175
|
+
stableContext: skipRules ? null : stableSystemContext,
|
|
159
176
|
};
|
|
160
177
|
}
|
|
161
178
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// rewriting its system blocks (BP1 heading, BP3 core), and the configs a
|
|
3
3
|
// session's workflow and orchestration mode give.
|
|
4
4
|
import { AGENT_MODE, resolveSessionMode, sessionModeOf } from '../../runtime/agent/orchestrator/session/agent-mode.mjs';
|
|
5
|
-
import { MIXY_AGENT_ID } from '../../runtime/agent/orchestrator/session/agent-home.mjs';
|
|
6
5
|
import { refreshSessionBp3Environment } from '../../runtime/agent/orchestrator/session/manager/prompt-utils.mjs';
|
|
7
6
|
import { promptOrchestrationModeOf } from '../../runtime/agent/orchestrator/session/manager/orchestration-mode-switch-notice.mjs';
|
|
8
7
|
import { sessionOrchestrationMode } from '../../runtime/shared/orchestration.mjs';
|
|
@@ -77,11 +76,11 @@ export function rewriteBp3Core(session, nextCore) {
|
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
// A Lead's workflow slices (orchestration, agent and contact catalogs) for its
|
|
80
|
-
// mode
|
|
79
|
+
// mode; an agent-mode Lead's contacts are every bot but itself.
|
|
81
80
|
export function leadPartsFor(session, leadPromptParts) {
|
|
82
81
|
return leadPromptParts({
|
|
83
82
|
agentMode: sessionModeOf(session) === AGENT_MODE,
|
|
84
|
-
|
|
83
|
+
agentId: resolveSessionMode({ session }).agentId,
|
|
85
84
|
});
|
|
86
85
|
}
|
|
87
86
|
|
|
@@ -18,6 +18,9 @@ import { workflowDisallowsAgentTool } from '../runtime/agent/orchestrator/runtim
|
|
|
18
18
|
import { promptWorkflowOf } from '../runtime/agent/orchestrator/session/manager/workflow-switch-notice.mjs';
|
|
19
19
|
import { configuredOrchestrationMode } from '../runtime/shared/orchestration.mjs';
|
|
20
20
|
import { isAgentModeSession } from '../runtime/agent/orchestrator/session/agent-mode.mjs';
|
|
21
|
+
import { isAgentOwner } from '../runtime/agent/orchestrator/agent-owner.mjs';
|
|
22
|
+
import { reactionDisabled } from '../runtime/agent/orchestrator/session/manager/session-tool-surface.mjs';
|
|
23
|
+
import { REACTION_TOOL_NAME } from '../runtime/agent/orchestrator/runtime-core/reaction-tool-defs.mjs';
|
|
21
24
|
|
|
22
25
|
export function createToolSurface({
|
|
23
26
|
mgr,
|
|
@@ -78,6 +81,7 @@ export function createToolSurface({
|
|
|
78
81
|
...disallowedModelToolNamesForProfile(profileCandidates, getToolProfile()),
|
|
79
82
|
...getFeatureDisallowedTools(),
|
|
80
83
|
...(workflowAllowsAgents() ? [] : [...agentToolNames]),
|
|
84
|
+
...(reactionDisabled(session, isAgentOwner(session)) ? [REACTION_TOOL_NAME] : []),
|
|
81
85
|
];
|
|
82
86
|
}
|
|
83
87
|
|
|
@@ -80,6 +80,7 @@ export function createAskCallbacks({ transcript, notifyFnForSession, scheduleSea
|
|
|
80
80
|
beforeToolExecution: () => turn.snapshot.promise || Promise.resolve(),
|
|
81
81
|
transcriptMeta: stampCheckpoint(options),
|
|
82
82
|
promptSource: options.promptSource,
|
|
83
|
+
...(options.promptOrigin ? { promptOrigin: options.promptOrigin } : {}),
|
|
83
84
|
// A routine turn's trusted selection text (its instructions only).
|
|
84
85
|
...(typeof options.skillSelection === 'string' ? { skillSelection: options.skillSelection } : {}),
|
|
85
86
|
retryFailedTurn: options.retryFailedTurn === true,
|