mixdog 1.4.2 → 1.4.4
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 +2 -2
- package/scripts/build-shipped-history.mjs +15 -5
- package/scripts/gate-local.mjs +65 -19
- package/scripts/graph-parity.mjs +8 -3
- package/scripts/lib/gate-scheduler.mjs +2 -1
- package/scripts/lib/run-node-tests.mjs +17 -5
- package/scripts/lib/test-failure-summary.mjs +1 -8
- package/scripts/lib/test-spawn-ledger.mjs +33 -2
- package/scripts/post-release-check.mjs +26 -16
- package/scripts/provider-pingpong-live.mjs +1 -1
- package/scripts/prune-embedding-runtime.mjs +3 -1
- package/scripts/release-paths.mjs +7 -1
- package/src/defaults/shipped-history.json +24 -0
- package/src/defaults/skills/computer-use/SKILL.md +14 -3
- package/src/defaults/skills/memory-management/SKILL.md +10 -5
- package/src/defaults/skills/setup/SKILL.md +2 -2
- package/src/defaults/skills/setup/references/actions.md +17 -4
- package/src/defaults/skills/setup/references/surfaces.md +3 -0
- package/src/defaults/skills/setup-guide/SKILL.md +6 -1
- package/src/lib/instruction-text.cjs +36 -0
- package/src/lib/rules-builder.cjs +34 -20
- package/src/orchestration/balanced.md +23 -0
- package/src/orchestration/focused.md +22 -0
- package/src/orchestration/none.md +5 -0
- package/src/orchestration/swarm.md +24 -0
- package/src/rules/agent-mode/AGENT_MODE.md +3 -1
- package/src/rules/agent-mode/MIXY.md +5 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/session-prep.mjs +3 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +0 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +4 -2
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +0 -9
- package/src/runtime/agent/orchestrator/agent-runtime/heartbeat-completion.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +67 -0
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +4 -4
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +3 -1
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +199 -46
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +3 -5
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +9 -3
- package/src/runtime/agent/orchestrator/mcp/client.mjs +3 -5
- package/src/runtime/agent/orchestrator/mcp/oauth-client.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/oauth-credentials.mjs +8 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-probe.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +14 -0
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +11 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-start.mjs +4 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-stop.mjs +3 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-outcome.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +121 -9
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/gemini-thinking.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/lib/generation-window.mjs +9 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +9 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-result.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +5 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-response-normalization.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-head-parity.json +2784 -2872
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +5 -8
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-outcome.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload-parity.fixture.json +288 -300
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/openrouter-provider-routing.mjs +28 -0
- package/src/runtime/agent/orchestrator/providers/openrouter.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +30 -25
- package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/xai-tool-search-head-parity.json +10 -30
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-result.mjs +66 -0
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +30 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +0 -11
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-availability.mjs +8 -0
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-delta.mjs +17 -3
- package/src/runtime/agent/orchestrator/runtime-core/goal-control.mjs +47 -27
- package/src/runtime/agent/orchestrator/runtime-core/goal-deadlines.mjs +141 -10
- package/src/runtime/agent/orchestrator/runtime-core/goal-mutations.mjs +26 -63
- package/src/runtime/agent/orchestrator/runtime-core/goal-reminder.mjs +28 -3
- package/src/runtime/agent/orchestrator/runtime-core/goal-runtime.mjs +36 -11
- package/src/runtime/agent/orchestrator/runtime-core/goal-state.mjs +88 -56
- package/src/runtime/agent/orchestrator/runtime-core/goal-storage.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-store.mjs +51 -32
- package/src/runtime/agent/orchestrator/runtime-core/goal-text.mjs +45 -145
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-defs.mjs +15 -98
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-exec.mjs +32 -99
- package/src/runtime/agent/orchestrator/runtime-core/goal-turns.mjs +23 -78
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +69 -48
- package/src/runtime/agent/orchestrator/runtime-core/todo-list.mjs +367 -0
- package/src/runtime/agent/orchestrator/runtime-core/todo-tool-defs.mjs +47 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-availability.mjs +155 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +9 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +119 -35
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +28 -22
- package/src/runtime/agent/orchestrator/session/agent-pool-progress.mjs +30 -0
- package/src/runtime/agent/orchestrator/session/attachment-preflight.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/compact/summary-route.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +8 -12
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +7 -3
- package/src/runtime/agent/orchestrator/session/human-gate/held-message.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +1 -2
- package/src/runtime/agent/orchestrator/session/human-gate/run-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/loop/context-overflow.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/todo-check.mjs +196 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +116 -50
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +5 -6
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +6 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +16 -2
- package/src/runtime/agent/orchestrator/session/loop/turn-report.mjs +35 -0
- package/src/runtime/agent/orchestrator/session/loop/usage.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +57 -26
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +9 -7
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +21 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-failure.mjs +27 -11
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-open.mjs +37 -34
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +25 -15
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +79 -24
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-steering-drain.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +12 -1
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +6 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +9 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-path.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-shard.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/prompt-settings.mjs +598 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +19 -0
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +19 -10
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/manager/session-fallback-title.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +31 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lock.mjs +31 -0
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +42 -6
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +8 -9
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +339 -88
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-recovery.mjs +135 -11
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +377 -104
- package/src/runtime/agent/orchestrator/session/manager/turn-durability.mjs +144 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/save-session-worker.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/store/canonical-reader.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/liveness-veto.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +23 -2
- package/src/runtime/agent/orchestrator/session/store/sweep/sub-agent-retention.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/store/transcript-durability.mjs +88 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/store-summary-log.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +14 -5
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/store.mjs +17 -6
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +7 -1
- package/src/runtime/agent/orchestrator/session/tail-reminder-rules.mjs +9 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/agent-envelope.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +3 -5
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +4 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/misuse-guard.mjs +21 -3
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/result-format.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/worktree-add-guard.mjs +77 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +7 -3
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +27 -9
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-output-silence.mjs +64 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-task-output.mjs +20 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-fast-paths.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +0 -10
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +12 -1
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -24
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary/child-kill.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/calls.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/symbols.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +4 -5
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +3 -4
- package/src/runtime/agent/orchestrator/tools/code-graph.mjs +4 -22
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +0 -4
- package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +0 -1
- package/src/runtime/attachments/attachment-reference.mjs +1 -1
- package/src/runtime/attachments/pdf-extract.mjs +1 -1
- package/src/runtime/attachments/store.d.mts +1 -0
- package/src/runtime/attachments/store.mjs +2 -2
- package/src/runtime/channels/lib/config-reload-watch.mjs +42 -0
- package/src/runtime/channels/lib/owned-runtime/config-reload.mjs +29 -9
- package/src/runtime/channels/lib/routines-db.mjs +35 -0
- package/src/runtime/channels/lib/scheduler.mjs +33 -0
- package/src/runtime/channels/lib/schedules-db.mjs +15 -4
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +4 -1
- package/src/runtime/channels/lib/webhooks-db.mjs +13 -3
- package/src/runtime/channels/lib/whisper-server.mjs +12 -12
- package/src/runtime/channels/lib/worker-main.mjs +9 -31
- package/src/runtime/computer-bridge/action-schema.mjs +2 -2
- package/src/runtime/computer-bridge/core-actions.mjs +16 -2
- package/src/runtime/computer-bridge/linux-readiness.mjs +10 -14
- package/src/runtime/computer-bridge/result-canonical.mjs +6 -0
- package/src/runtime/connectors/connector-accounts-mcp.mjs +169 -33
- package/src/runtime/connectors/gmail-app-password.mjs +2 -2
- package/src/runtime/connectors/google-mcp.mjs +1 -1
- package/src/runtime/effort-judge/judge-client.mjs +2 -2
- package/src/runtime/effort-judge/judge-input.mjs +4 -4
- package/src/runtime/explore/explorer.mjs +0 -5
- package/src/runtime/explore/tool.mjs +3 -3
- package/src/runtime/local-provider/hardware.mjs +1 -1
- package/src/runtime/media/adapters/codex-image.mjs +3 -3
- package/src/runtime/media/adapters/gemini-video.mjs +1 -1
- package/src/runtime/media/media-usage.mjs +1 -1
- package/src/runtime/media/store.mjs +1 -1
- package/src/runtime/memory/index.mjs +11 -1
- package/src/runtime/memory/lib/embedding-reindex.mjs +27 -0
- package/src/runtime/memory/lib/memory-embed.mjs +83 -14
- package/src/runtime/memory/lib/memory-process-lock.mjs +159 -36
- package/src/runtime/memory/lib/memory-text-utils.mjs +6 -1
- package/src/runtime/memory/lib/memory.mjs +17 -0
- package/src/runtime/memory/lib/pg/process.mjs +1 -1
- package/src/runtime/memory/lib/pg/supervisor.mjs +16 -96
- package/src/runtime/memory/lib/recall-hybrid/hybrid-sql.mjs +12 -3
- package/src/runtime/memory/tool-defs.mjs +1 -1
- package/src/runtime/office/authoring/docx-html-runner.mjs +1 -1
- package/src/runtime/office/authoring/pptx-author-action.mjs +1 -1
- package/src/runtime/office/authoring/xlsx-html-build.mjs +1 -1
- package/src/runtime/office/authoring/xlsx-html-runner.mjs +1 -1
- package/src/runtime/office/capabilities.mjs +1 -1
- package/src/runtime/office/core/office-core.mjs +1 -1
- package/src/runtime/office/design/content-model.mjs +3 -3
- package/src/runtime/office/design/docx/design-docx/section.mjs +6 -6
- package/src/runtime/office/design/xlsx/design-xlsx-components.mjs +1 -1
- package/src/runtime/office/design/xlsx/design-xlsx.mjs +1 -1
- package/src/runtime/office/pdf/ocr-engine.mjs +1 -1
- package/src/runtime/office/pdf/pdf-writer.mjs +4 -4
- package/src/runtime/office/portable/portable-docx-operations.mjs +2 -2
- package/src/runtime/office/portable/portable-soffice.mjs +8 -6
- package/src/runtime/office/portable/xlsx-contract.mjs +1 -1
- package/src/runtime/shared/atomic-file.d.mts +8 -0
- package/src/runtime/shared/background-tasks.mjs +22 -4
- package/src/runtime/shared/background-wait.mjs +66 -0
- package/src/runtime/shared/child-guardian.mjs +17 -7
- package/src/runtime/shared/config.mjs +313 -16
- package/src/runtime/shared/connector-catalog.d.mts +4 -5
- package/src/runtime/shared/connector-catalog.mjs +11 -1
- package/src/runtime/shared/file-lock.mjs +8 -3
- package/src/runtime/shared/git-runner.mjs +7 -2
- package/src/runtime/shared/idle-gc.mjs +30 -7
- package/src/runtime/shared/llm/http-agent.mjs +8 -5
- package/src/runtime/shared/llm/system-proxy.mjs +2 -1
- package/src/runtime/shared/llm/usage-accounting.mjs +110 -19
- package/src/runtime/shared/llm/usage-context.mjs +1 -1
- package/src/runtime/shared/llm/usage-ledger-quota.mjs +33 -12
- package/src/runtime/shared/llm/usage-ledger-requests.mjs +183 -0
- package/src/runtime/shared/llm/usage-ledger-rollup.mjs +90 -10
- package/src/runtime/shared/llm/usage-ledger-worker.mjs +2 -0
- package/src/runtime/shared/llm/usage-ledger.mjs +60 -1
- package/src/runtime/shared/llm/usage-request-status.mjs +48 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +48 -0
- package/src/runtime/shared/maintenance-schedule.mjs +109 -0
- package/src/runtime/shared/process-runner.mjs +8 -4
- package/src/runtime/shared/routine-trigger.d.mts +13 -0
- package/src/runtime/shared/routine-trigger.mjs +34 -0
- package/src/runtime/shared/run-child.d.mts +2 -1
- package/src/runtime/shared/run-child.mjs +70 -18
- package/src/runtime/shared/session-scratch.mjs +14 -2
- package/src/runtime/shared/shipped-definitions.mjs +7 -1
- package/src/runtime/shared/tool-card-model.golden.json +3 -12
- package/src/runtime/shared/tool-execution-contract.mjs +2 -0
- package/src/runtime/shared/tool-result-summary.mjs +1 -1
- package/src/runtime/shared/tool-work-units.mjs +31 -6
- package/src/runtime/shared/turn-snapshot.mjs +26 -4
- package/src/runtime/shared/turn-worktree-snapshot.mjs +6 -11
- package/src/runtime/shared/worker-requests.mjs +17 -3
- package/src/runtime/shared/worktrees/branch-management.mjs +1 -5
- package/src/runtime/shared/worktrees/contract.mjs +16 -6
- package/src/runtime/shared/worktrees/dependencies.mjs +127 -89
- package/src/runtime/shared/worktrees/disk.mjs +79 -2
- package/src/runtime/shared/worktrees/git.mjs +44 -11
- package/src/runtime/shared/worktrees/include.mjs +6 -4
- package/src/runtime/shared/worktrees/maintenance.mjs +422 -30
- package/src/runtime/shared/worktrees/manager.mjs +772 -75
- package/src/runtime/shared/worktrees/settings.mjs +33 -7
- package/src/runtime/shared/worktrees/test-support.mjs +5 -1
- package/src/runtime/shared/worktrees/worker-snapshots.mjs +82 -0
- package/src/runtime/tidy/process.mjs +2 -1
- package/src/runtime/web-search/index.mjs +3 -22
- package/src/runtime/web-search/lib/web-tools.mjs +2 -2
- package/src/runtime/web-search/tool-defs.mjs +17 -26
- package/src/session-runtime/agent-home-delivery.mjs +76 -8
- package/src/session-runtime/agent-profile-changes.mjs +55 -4
- package/src/session-runtime/agent-task-sessions.mjs +63 -22
- package/src/session-runtime/boot/apis.mjs +42 -4
- package/src/session-runtime/boot/begin.mjs +2 -0
- package/src/session-runtime/boot/config.mjs +10 -1
- package/src/session-runtime/boot/facade.mjs +1 -0
- package/src/session-runtime/boot/providers.mjs +70 -3
- package/src/session-runtime/boot/session.mjs +2 -0
- package/src/session-runtime/boot/tools.mjs +75 -25
- package/src/session-runtime/channel-config-api.mjs +1 -0
- package/src/session-runtime/config-change-effects.mjs +179 -0
- package/src/session-runtime/config-lifecycle/config-writers.mjs +1 -0
- package/src/session-runtime/config-lifecycle.mjs +160 -24
- package/src/session-runtime/conversation-import/discovery.mjs +86 -7
- package/src/session-runtime/conversation-import/service.mjs +3 -2
- package/src/session-runtime/goal-facade-api.mjs +49 -3
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +5 -57
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +3 -2
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +3 -11
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +18 -4
- package/src/session-runtime/internal-tool-executor.mjs +12 -19
- package/src/session-runtime/lifecycle/cold-heir.mjs +7 -0
- package/src/session-runtime/lifecycle/memory-ingest.mjs +3 -3
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +53 -5
- package/src/session-runtime/lifecycle/session-switch.mjs +13 -2
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +4 -4
- package/src/session-runtime/lifecycle-api.mjs +1 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +14 -3
- package/src/session-runtime/mcp-glue/server-connection.mjs +34 -8
- package/src/session-runtime/model-route/route-persist.mjs +12 -4
- package/src/session-runtime/model-route/set-route.mjs +40 -7
- package/src/session-runtime/native-web-search/routes.mjs +3 -3
- package/src/session-runtime/provider-auth/refresh.mjs +6 -3
- package/src/session-runtime/provider-auth/setup.mjs +1 -1
- package/src/session-runtime/provider-models/row-hydration.mjs +2 -0
- package/src/session-runtime/provider-readiness.mjs +53 -4
- package/src/session-runtime/resource-api.mjs +1 -1
- package/src/session-runtime/resource-extension-sync.mjs +4 -8
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +5 -1
- package/src/session-runtime/resource-mcp-secrets.mjs +3 -3
- package/src/session-runtime/resource-plugins-api.mjs +4 -0
- package/src/session-runtime/routine-executor.mjs +152 -0
- package/src/session-runtime/routine-home-turn.mjs +46 -5
- package/src/session-runtime/routine-owner.mjs +9 -3
- package/src/session-runtime/runtime-facade.mjs +5 -0
- package/src/session-runtime/runtime-feature-gates.mjs +2 -11
- package/src/session-runtime/schedule-session-run.mjs +1 -0
- package/src/session-runtime/services/agent-task-status.mjs +29 -1
- package/src/session-runtime/services/agent-tool/job-task-reconcile.mjs +6 -1
- package/src/session-runtime/services/agent-tool/job-views/session-progress.mjs +10 -0
- package/src/session-runtime/services/agent-tool/render.mjs +6 -1
- package/src/session-runtime/services/agent-tool/send-flow.mjs +110 -6
- package/src/session-runtime/services/agent-tool/spawn-flow/job-start.mjs +12 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +5 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +24 -6
- package/src/session-runtime/services/agent-tool.mjs +51 -1
- package/src/session-runtime/services/channel-admin.mjs +62 -3
- package/src/session-runtime/services/hook-bus/command-handler.mjs +7 -11
- package/src/session-runtime/services/plugin-admin.mjs +50 -7
- package/src/session-runtime/services/provider-admin.mjs +5 -0
- package/src/session-runtime/services/seeds.mjs +7 -0
- package/src/session-runtime/services/usage-stats-model.mjs +32 -11
- package/src/session-runtime/session-create/materialize.mjs +4 -2
- package/src/session-runtime/session-create/session-options.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +1 -9
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +1 -1
- package/src/session-runtime/setup-tool/connector-widen-approval.mjs +1 -1
- package/src/session-runtime/setup-tool/executor.mjs +9 -2
- package/src/session-runtime/setup-tool/extended-actions.mjs +3 -1
- package/src/session-runtime/setup-tool/settings-contract.mjs +30 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +26 -1
- package/src/session-runtime/tool-policy/agent-profile-fold.mjs +40 -43
- package/src/session-runtime/tool-policy/mode-switch.mjs +1 -1
- package/src/session-runtime/tool-policy/policy-stage.mjs +106 -8
- package/src/session-runtime/tool-policy/workflow-overlay.mjs +2 -1
- package/src/session-runtime/tool-policy-refresh.mjs +182 -5
- package/src/session-runtime/tool-surface.mjs +38 -1
- package/src/session-runtime/turn/agent-ops.mjs +10 -2
- package/src/session-runtime/turn/session-ops.mjs +2 -0
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +5 -0
- package/src/session-runtime/turn/turn-run.mjs +1 -1
- package/src/session-runtime/usage-stats-api.mjs +117 -1
- package/src/session-runtime/webhook-session-run.mjs +2 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +37 -33
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +183 -23
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +3 -10
- package/src/session-runtime/workflow-agents-api/instruction-files.mjs +165 -0
- package/src/session-runtime/workflow-agents-api/style-and-mode.mjs +5 -4
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +2 -3
- package/src/session-runtime/workflow-agents-api.mjs +2 -0
- package/src/session-runtime/workspace/project-branches.mjs +1 -1
- package/src/session-runtime/workspace/session-view.mjs +1 -1
- package/src/session-runtime/workspace/transitions.mjs +20 -4
- package/src/session-runtime/workspace/worktree-maintenance.mjs +126 -6
- package/src/session-runtime/workspace/worktree-setup.mjs +13 -1
- package/src/session-runtime/workspace/worktree-tool.mjs +16 -0
- package/src/standalone/daemon-agent-control.mjs +25 -8
- package/src/standalone/daemon-desktop-runtime.mjs +6 -2
- package/src/standalone/daemon-lag-profiler.mjs +7 -7
- package/src/standalone/daemon.mjs +54 -2
- package/src/standalone/local-session-runtime.mjs +16 -0
- package/src/standalone/session-client/daemon-unavailable.mjs +1 -1
- package/src/standalone/session-protocol.mjs +12 -0
- package/src/standalone/session-service/agent-route-follow.mjs +23 -20
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +18 -6
- package/src/standalone/session-service/quota-resume.mjs +9 -0
- package/src/standalone/session-service/retention/busy.mjs +3 -2
- package/src/standalone/session-service/session-calls/session-action.mjs +51 -1
- package/src/standalone/session-service/session-calls/session-turns.mjs +37 -18
- package/src/standalone/session-service/session-calls/turn-gate.mjs +34 -0
- package/src/standalone/session-service/session-calls.mjs +2 -1
- package/src/tui/App.jsx +8 -0
- package/src/tui/app/clipboard.mjs +1 -1
- package/src/tui/app/create-app-pickers.mjs +2 -0
- package/src/tui/app/doctor.mjs +2 -2
- package/src/tui/app/model-picker/model-footer.mjs +1 -1
- package/src/tui/app/model-picker/provider-models-list.mjs +7 -3
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +23 -3
- package/src/tui/app/model-picker/route-selection.mjs +1 -0
- package/src/tui/app/panel-signature.mjs +1 -1
- package/src/tui/app/settings-picker.mjs +53 -8
- package/src/tui/app/shell-layout/row-budgets.mjs +2 -2
- package/src/tui/app/slash-commands.mjs +1 -1
- package/src/tui/app/slash-dispatch/route-commands.mjs +1 -1
- package/src/tui/app/slash-dispatch/session-commands.mjs +1 -1
- package/src/tui/app/use-prompt-queue-history.mjs +2 -2
- package/src/tui/app/use-transcript-activity.mjs +1 -1
- package/src/tui/app/use-transcript-window/geometry.mjs +1 -1
- package/src/tui/components/prompt-input/escape-policy.d.mts +0 -1
- package/src/tui/components/prompt-input/escape-policy.mjs +1 -1
- package/src/tui/components/question-panel-model.mjs +4 -4
- package/src/tui/components/tool-execution/standard-card.jsx +3 -4
- package/src/tui/components/user-message-skills.mjs +1 -1
- package/src/tui/dist/index.mjs +350 -37
- package/src/tui/markdown/render-ansi.mjs +1 -1
- package/src/tui/session/agent-job-feed/notification-router.mjs +10 -0
- package/src/tui/session/agent-job-feed.mjs +2 -0
- package/src/tui/session/context-state.mjs +3 -0
- package/src/tui/session/quota-resume.mjs +1 -1
- package/src/tui/session/session-api/integrations.mjs +3 -0
- package/src/tui/session/session-api/lifecycle/dispose.mjs +1 -0
- package/src/tui/session/session-api/lifecycle/session-reset.mjs +7 -0
- package/src/tui/session/session-api/routes-agent-definitions.mjs +5 -0
- package/src/tui/session/session-api/worktree.mjs +13 -1
- package/src/tui/session/session-flow/drain.mjs +11 -14
- package/src/tui/session/tool-approval-settle.mjs +24 -4
- package/src/tui/session/tool-approval.mjs +35 -10
- package/src/tui/session/tool-card-results/grouped-result.mjs +2 -2
- package/src/tui/session/turn-quiet.mjs +1 -1
- package/src/tui/session/turn.mjs +3 -0
- package/src/tui/session/worktree-setup-notice.mjs +1 -1
- package/src/tui/spinner-meta.mjs +3 -3
- package/src/tui/spinner-verbs.mjs +2 -2
- package/src/defaults/skills/goal-management/SKILL.md +0 -169
- package/src/runtime/agent/orchestrator/runtime-core/goal-tasks.mjs +0 -156
- package/src/session-runtime/goal-tasks.mjs +0 -1
|
@@ -24,7 +24,9 @@ import {
|
|
|
24
24
|
setEndpointEnabled as dbSetEndpointEnabled,
|
|
25
25
|
} from '../../runtime/channels/lib/webhooks-db.mjs';
|
|
26
26
|
import { normalizeAutomationAttachments } from '../../runtime/shared/automation-attachments.mjs';
|
|
27
|
-
import { assertRoutineOwner, routineOwnerProblem } from '../routine-owner.mjs';
|
|
27
|
+
import { ROUTINE_OWNER_PROBLEMS, assertRoutineOwner, routineOwnerProblem } from '../routine-owner.mjs';
|
|
28
|
+
import { MIXY_BOT_ID } from '../../runtime/shared/agent-store.mjs';
|
|
29
|
+
import { assertRoutineExecutor } from '../routine-executor.mjs';
|
|
28
30
|
import { hasEnabledAutomation } from '../../runtime/shared/automation-presence.mjs';
|
|
29
31
|
import { resolveScheduleTimezone, validateScheduleCron } from '../../runtime/shared/schedule-time.mjs';
|
|
30
32
|
import { scheduleNameTakenError, scheduleRenameRunningError } from '../../runtime/channels/lib/schedule-errors.mjs';
|
|
@@ -203,6 +205,8 @@ function scheduleToDisplay(s, ownerProblem = '') {
|
|
|
203
205
|
instructions: s.prompt,
|
|
204
206
|
// The bot it belongs to: each run is a turn in that bot's chat.
|
|
205
207
|
owner: s.ownerAgentId || MIXY_AGENT_ID,
|
|
208
|
+
// The sub-agent that carries each fire out first (routine-executor.mjs); null = the bot itself.
|
|
209
|
+
executorAgentId: s.executorAgentId || null,
|
|
206
210
|
// Why it is paused for its owner (routine-owner.mjs); absent when it runs.
|
|
207
211
|
...(ownerProblem ? { ownerProblem } : {}),
|
|
208
212
|
nextFireAt: isoOrUndefined(s.nextFireAt),
|
|
@@ -250,6 +254,13 @@ function scheduleOwner(owner, existing) {
|
|
|
250
254
|
return existing?.ownerAgentId || MIXY_AGENT_ID;
|
|
251
255
|
}
|
|
252
256
|
|
|
257
|
+
// A save's executor: `executorAgentId` undefined keeps the saved one on an
|
|
258
|
+
// overwrite; null or '' clears it; an id must be a delegatable sub-agent.
|
|
259
|
+
async function routineExecutor(executorAgentId, existing) {
|
|
260
|
+
if (executorAgentId === undefined) return existing?.executorAgentId || null;
|
|
261
|
+
return assertRoutineExecutor(executorAgentId);
|
|
262
|
+
}
|
|
263
|
+
|
|
253
264
|
/** Each owner's problem (routine-owner.mjs) for its stored rows, probed once
|
|
254
265
|
* per owner. */
|
|
255
266
|
function ownerProblems() {
|
|
@@ -268,9 +279,13 @@ function ownerProblems() {
|
|
|
268
279
|
export async function listSchedules() {
|
|
269
280
|
const rows = await dbListSchedules();
|
|
270
281
|
const problemOf = ownerProblems();
|
|
271
|
-
|
|
282
|
+
const listed = await Promise.all(rows.map(async (row) => scheduleToDisplay(row, await problemOf(row.ownerAgentId))));
|
|
283
|
+
return listed.filter(shownRoutine);
|
|
272
284
|
}
|
|
273
285
|
|
|
286
|
+
// An archived bot's routines are hidden until it is restored (routine-owner.mjs).
|
|
287
|
+
const shownRoutine = (row) => row.ownerProblem !== 'owner-archived';
|
|
288
|
+
|
|
274
289
|
/**
|
|
275
290
|
* Run `step` (the move of schedule `name`'s row) with `name` reserved against
|
|
276
291
|
* runs in this process (the app's "Run now"). Refused when one is in flight.
|
|
@@ -319,6 +334,7 @@ export async function saveSchedule(
|
|
|
319
334
|
enabled,
|
|
320
335
|
instructions,
|
|
321
336
|
owner,
|
|
337
|
+
executorAgentId,
|
|
322
338
|
overwrite = false,
|
|
323
339
|
newName,
|
|
324
340
|
} = {},
|
|
@@ -340,6 +356,7 @@ export async function saveSchedule(
|
|
|
340
356
|
}
|
|
341
357
|
const ownerAgentId = scheduleOwner(owner, existing);
|
|
342
358
|
await assertRoutineOwner(ownerAgentId);
|
|
359
|
+
const executor = await routineExecutor(executorAgentId, existing);
|
|
343
360
|
const whenCron = hasTime ? validateScheduleCron(foldDaysIntoCron(normalizeCron(time), days)) : null;
|
|
344
361
|
const whenAt = hasAt ? parseAtDatetime(at) : null;
|
|
345
362
|
const scheduleTimezone = hasTime ? resolveScheduleTimezone(timezone) : null;
|
|
@@ -356,6 +373,7 @@ export async function saveSchedule(
|
|
|
356
373
|
enabled: enabled !== false,
|
|
357
374
|
nextFireAt: whenAt,
|
|
358
375
|
ownerAgentId,
|
|
376
|
+
executorAgentId: executor,
|
|
359
377
|
};
|
|
360
378
|
let saved;
|
|
361
379
|
if (renaming) {
|
|
@@ -367,6 +385,7 @@ export async function saveSchedule(
|
|
|
367
385
|
saved = await upsertSchedule(def);
|
|
368
386
|
}
|
|
369
387
|
automationProbe.invalidate();
|
|
388
|
+
await refuseIfOwnerDeleted(ownerAgentId);
|
|
370
389
|
return scheduleToDisplay(saved);
|
|
371
390
|
}
|
|
372
391
|
|
|
@@ -393,7 +412,7 @@ async function listWebhooks() {
|
|
|
393
412
|
const endpoints = await dbListEndpoints();
|
|
394
413
|
const problemOf = ownerProblems();
|
|
395
414
|
const problems = await Promise.all(endpoints.map((ep) => problemOf(ep.ownerAgentId)));
|
|
396
|
-
|
|
415
|
+
const listed = endpoints.map((ep, index) => ({
|
|
397
416
|
name: ep.name,
|
|
398
417
|
description: ep.description || '',
|
|
399
418
|
parser: ep.parser || 'github',
|
|
@@ -407,6 +426,7 @@ async function listWebhooks() {
|
|
|
407
426
|
instructions: ep.instructions,
|
|
408
427
|
// The bot it belongs to: each run is a turn in that bot's chat.
|
|
409
428
|
owner: ep.ownerAgentId || MIXY_AGENT_ID,
|
|
429
|
+
executorAgentId: ep.executorAgentId || null,
|
|
410
430
|
...(problems[index] ? { ownerProblem: problems[index] } : {}),
|
|
411
431
|
lastEventAt: isoOrUndefined(ep.lastEventAt),
|
|
412
432
|
lastSuccessAt: isoOrUndefined(ep.lastSuccessAt),
|
|
@@ -416,6 +436,7 @@ async function listWebhooks() {
|
|
|
416
436
|
hasLastPayload: ep.hasLastPayload === true,
|
|
417
437
|
...routineHealth(ep),
|
|
418
438
|
}));
|
|
439
|
+
return listed.filter(shownRoutine);
|
|
419
440
|
}
|
|
420
441
|
|
|
421
442
|
export async function saveWebhook({
|
|
@@ -428,6 +449,7 @@ export async function saveWebhook({
|
|
|
428
449
|
enabled,
|
|
429
450
|
instructions,
|
|
430
451
|
owner,
|
|
452
|
+
executorAgentId,
|
|
431
453
|
overwrite = false,
|
|
432
454
|
} = {}) {
|
|
433
455
|
const id = assertName(name, 'webhook name');
|
|
@@ -445,6 +467,7 @@ export async function saveWebhook({
|
|
|
445
467
|
}
|
|
446
468
|
const ownerAgentId = scheduleOwner(owner, existing);
|
|
447
469
|
await assertRoutineOwner(ownerAgentId);
|
|
470
|
+
const executor = await routineExecutor(executorAgentId, existing);
|
|
448
471
|
// Secret semantics: an explicit value always wins; an EMPTY value on an
|
|
449
472
|
// overwrite PRESERVES the stored secret (editing instructions must not
|
|
450
473
|
// silently rotate the key the external service was configured with); only
|
|
@@ -464,11 +487,14 @@ export async function saveWebhook({
|
|
|
464
487
|
instructions: body,
|
|
465
488
|
enabled: enabled !== false,
|
|
466
489
|
ownerAgentId,
|
|
490
|
+
executorAgentId: executor,
|
|
467
491
|
});
|
|
468
492
|
automationProbe.invalidate();
|
|
493
|
+
await refuseIfOwnerDeleted(ownerAgentId);
|
|
469
494
|
return {
|
|
470
495
|
name: id,
|
|
471
496
|
owner: saved.ownerAgentId || ownerAgentId,
|
|
497
|
+
executorAgentId: saved.executorAgentId || null,
|
|
472
498
|
description: saved.description,
|
|
473
499
|
parser: saved.parser,
|
|
474
500
|
...(saved.cwd ? { cwd: saved.cwd } : {}),
|
|
@@ -486,6 +512,39 @@ export async function deleteWebhook(name) {
|
|
|
486
512
|
return { name: id, deleted: true };
|
|
487
513
|
}
|
|
488
514
|
|
|
515
|
+
/**
|
|
516
|
+
* Delete every schedule and webhook `agentId` currently owns, as its bot is
|
|
517
|
+
* deleted for good (agent-editor.mjs): all of them in one statement, or none
|
|
518
|
+
* (routines-db.mjs). Resolves the names removed. Mixy is never a target.
|
|
519
|
+
* Without a PostgreSQL cluster none exists, and none is started.
|
|
520
|
+
*/
|
|
521
|
+
export async function deleteOwnedRoutines(agentId) {
|
|
522
|
+
if (!agentHomeSessionId(agentId) || agentId === MIXY_AGENT_ID || agentId === MIXY_BOT_ID) {
|
|
523
|
+
throw new Error(`the routines of "${agentId}" cannot be deleted with a bot`);
|
|
524
|
+
}
|
|
525
|
+
if (!pgClusterExists(resolvePluginData())) return { schedules: [], webhooks: [] };
|
|
526
|
+
// Loaded on use: the stores' own modules stay the only imports of every reader.
|
|
527
|
+
const { deleteRoutinesOwnedBy } = await import('../../runtime/channels/lib/routines-db.mjs');
|
|
528
|
+
const removed = await deleteRoutinesOwnedBy(agentId);
|
|
529
|
+
automationProbe.invalidate();
|
|
530
|
+
return removed;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* After a save: the owner it checked may have been deleted for good meanwhile,
|
|
535
|
+
* its routines purged before this row landed. Then the row goes the way of
|
|
536
|
+
* the bot's others (deleteOwnedRoutines) and the save is refused. The delete
|
|
537
|
+
* purges again once the bot's folder is gone, so either a purge sees this row
|
|
538
|
+
* or this check sees the bot gone. An owner archived meanwhile keeps the row,
|
|
539
|
+
* hidden with its others until a restore, as if saved just before.
|
|
540
|
+
*/
|
|
541
|
+
async function refuseIfOwnerDeleted(ownerAgentId) {
|
|
542
|
+
const problem = await routineOwnerProblem(ownerAgentId).catch(() => '');
|
|
543
|
+
if (problem !== 'owner-deleted') return;
|
|
544
|
+
await deleteOwnedRoutines(ownerAgentId);
|
|
545
|
+
throw new Error(ROUTINE_OWNER_PROBLEMS[problem]);
|
|
546
|
+
}
|
|
547
|
+
|
|
489
548
|
export async function setWebhookEnabled(name, enabled) {
|
|
490
549
|
const id = assertName(name, 'webhook name');
|
|
491
550
|
const updated = await dbSetEndpointEnabled(id, enabled !== false);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { spawn
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
3
|
import { MAX_BUFFER_BYTES } from './constants.mjs';
|
|
4
4
|
import { handlerTimeoutS } from './handler-timeout.mjs';
|
|
5
5
|
import { abortReason, throwIfAborted } from '../../../runtime/shared/abort-race.mjs';
|
|
6
6
|
import { scrubRuntimeRootVars } from '../../../runtime/agent/orchestrator/tools/env-scrub.mjs';
|
|
7
|
+
import { spawnTreeKill } from '../../../runtime/agent/orchestrator/mcp/child-tree.mjs';
|
|
7
8
|
|
|
8
9
|
function resolvePlaceholders(str, projectDir, pluginData, pluginRoot = null) {
|
|
9
10
|
if (typeof str !== 'string') return str;
|
|
@@ -23,17 +24,13 @@ export function defaultShellKind() {
|
|
|
23
24
|
return process.platform === 'win32' ? 'powershell' : 'bash';
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
// POSIX children share a detached process group; Windows
|
|
27
|
+
// POSIX children share a detached process group; on Windows the shared
|
|
28
|
+
// creation-checked tree kill owns the tree, off the event loop.
|
|
27
29
|
function killProcessTree(child, signal = 'SIGTERM') {
|
|
28
30
|
if (!child || child.pid == null) return;
|
|
29
31
|
if (process.platform === 'win32') {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} catch {
|
|
33
|
-
try {
|
|
34
|
-
child.kill(signal);
|
|
35
|
-
} catch {}
|
|
36
|
-
}
|
|
32
|
+
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
33
|
+
spawnTreeKill([child.pid], { root: child });
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
36
|
try {
|
|
@@ -48,8 +45,7 @@ function killProcessTree(child, signal = 'SIGTERM') {
|
|
|
48
45
|
const KILL_GRACE_MS = 2000;
|
|
49
46
|
function terminateTree(child) {
|
|
50
47
|
killProcessTree(child, 'SIGTERM');
|
|
51
|
-
//
|
|
52
|
-
// recycled PID instead of the process this handler created.
|
|
48
|
+
// The Windows tree kill is already a hard termination.
|
|
53
49
|
if (process.platform === 'win32') return;
|
|
54
50
|
const timer = setTimeout(() => killProcessTree(child, 'SIGKILL'), KILL_GRACE_MS);
|
|
55
51
|
timer.unref?.();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { existsSync, mkdirSync, readdirSync, renameSync, rmSync } from 'node:fs';
|
|
2
|
+
import { chmodSync, existsSync, lstatSync, mkdirSync, readdirSync, renameSync, rmSync, unlinkSync } from 'node:fs';
|
|
3
3
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { createHash, randomUUID } from 'node:crypto';
|
|
6
6
|
import { readJsonStateSync, updateJsonAtomicSync, withFileLockSync } from '../../runtime/shared/atomic-file.mjs';
|
|
7
|
+
import { announceStoredStateChange } from '../../runtime/shared/config.mjs';
|
|
7
8
|
import { resolvePluginData } from '../../runtime/shared/plugin-paths.mjs';
|
|
8
9
|
import { pluginManifest } from '../../runtime/shared/plugin-manifest.mjs';
|
|
9
10
|
import { pluginMetadata } from '../../runtime/shared/plugin-metadata.mjs';
|
|
@@ -60,6 +61,9 @@ function mutateRegistry(dataDir, mutator) {
|
|
|
60
61
|
},
|
|
61
62
|
{ secret: true, fsyncDir: true, backup: true }
|
|
62
63
|
);
|
|
64
|
+
// Other processes connect or drop the plugin's MCP servers on this (the
|
|
65
|
+
// live install's registry only; an explicit dataDir is a separate store).
|
|
66
|
+
if (resolve(dataDir) === resolve(resolvePluginData())) announceStoredStateChange('plugins');
|
|
63
67
|
return result;
|
|
64
68
|
}
|
|
65
69
|
|
|
@@ -164,6 +168,45 @@ function withPluginMutation(dataDir, id, operation) {
|
|
|
164
168
|
});
|
|
165
169
|
}
|
|
166
170
|
|
|
171
|
+
// Node 24 on Windows (Electron) makes rmSync follow junctions into their targets,
|
|
172
|
+
// so every link is detached first and never chmod-ed or recursed into. It also
|
|
173
|
+
// fails with EPERM on read-only files such as git pack files; clear the read-only
|
|
174
|
+
// bit and retry once. Each entry is lstat-ed right before it is acted on, not
|
|
175
|
+
// trusted from the listing, so a directory swapped for a link after the listing
|
|
176
|
+
// is detached instead of entered. What remains is the instant between that
|
|
177
|
+
// lstat and the next readdir/chmod, which no portable fs call can close. A file
|
|
178
|
+
// with other names (link count > 1) shares its mode with them, so `onFile` is
|
|
179
|
+
// told its stat and the chmod recovery skips it.
|
|
180
|
+
function walkTree(dir, onFile) {
|
|
181
|
+
for (const name of readdirSync(dir)) {
|
|
182
|
+
const full = join(dir, name);
|
|
183
|
+
const stat = lstatSync(full, { throwIfNoEntry: false });
|
|
184
|
+
if (!stat) continue;
|
|
185
|
+
if (stat.isSymbolicLink()) unlinkSync(full);
|
|
186
|
+
else if (stat.isDirectory()) walkTree(full, onFile);
|
|
187
|
+
else onFile?.(full, stat);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function removeTree(path) {
|
|
192
|
+
const stat = lstatSync(path, { throwIfNoEntry: false });
|
|
193
|
+
if (!stat) return;
|
|
194
|
+
if (stat.isSymbolicLink()) return unlinkSync(path);
|
|
195
|
+
const options = { recursive: true, force: true };
|
|
196
|
+
if (stat.isDirectory()) walkTree(path);
|
|
197
|
+
try {
|
|
198
|
+
rmSync(path, options);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
if (error?.code !== 'EPERM') throw error;
|
|
201
|
+
if (stat.isDirectory()) {
|
|
202
|
+
walkTree(path, (file, fileStat) => {
|
|
203
|
+
if (fileStat.nlink === 1) chmodSync(file, 0o666);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
rmSync(path, options);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
167
210
|
function cleanupManagedPartials(root) {
|
|
168
211
|
const parent = dirname(root);
|
|
169
212
|
const prefix = `${basename(root)}.tmp-`;
|
|
@@ -171,7 +214,7 @@ function cleanupManagedPartials(root) {
|
|
|
171
214
|
for (const entry of readdirSync(parent)) {
|
|
172
215
|
if (!entry.startsWith(prefix)) continue;
|
|
173
216
|
try {
|
|
174
|
-
|
|
217
|
+
removeTree(join(parent, entry));
|
|
175
218
|
} catch {}
|
|
176
219
|
}
|
|
177
220
|
}
|
|
@@ -181,7 +224,7 @@ function recoverManagedPluginRoot(root) {
|
|
|
181
224
|
if (!existsSync(root) && existsSync(backupRoot)) {
|
|
182
225
|
renameSync(backupRoot, root);
|
|
183
226
|
} else if (existsSync(root) && existsSync(backupRoot)) {
|
|
184
|
-
|
|
227
|
+
removeTree(backupRoot);
|
|
185
228
|
}
|
|
186
229
|
return backupRoot;
|
|
187
230
|
}
|
|
@@ -206,7 +249,7 @@ export function _publishManagedPluginRoot(root, tempRoot) {
|
|
|
206
249
|
throw error;
|
|
207
250
|
}
|
|
208
251
|
try {
|
|
209
|
-
|
|
252
|
+
removeTree(backupRoot);
|
|
210
253
|
} catch {}
|
|
211
254
|
}
|
|
212
255
|
|
|
@@ -224,7 +267,7 @@ function materializePlugin(normalized, id, dataDir) {
|
|
|
224
267
|
_publishManagedPluginRoot(root, tempRoot);
|
|
225
268
|
} catch (error) {
|
|
226
269
|
try {
|
|
227
|
-
|
|
270
|
+
removeTree(tempRoot);
|
|
228
271
|
} catch {}
|
|
229
272
|
throw error;
|
|
230
273
|
} finally {
|
|
@@ -370,8 +413,8 @@ export function removePlugin(idOrName, { dataDir = resolvePluginData() } = {}) {
|
|
|
370
413
|
});
|
|
371
414
|
if (entry.managed !== false && entry.root) {
|
|
372
415
|
ensureInside(installRoot(dataDir), entry.root);
|
|
373
|
-
|
|
374
|
-
|
|
416
|
+
removeTree(entry.root);
|
|
417
|
+
removeTree(`${entry.root}.backup`);
|
|
375
418
|
cleanupManagedPartials(entry.root);
|
|
376
419
|
}
|
|
377
420
|
return { ...entry, removed: true };
|
|
@@ -598,6 +598,7 @@ function publicCustomModelRows(rows) {
|
|
|
598
598
|
if (out > 0) model.maxOutputTokens = Math.floor(out);
|
|
599
599
|
model.hidden = item.hidden === true;
|
|
600
600
|
model.manual = item.manual === true;
|
|
601
|
+
if (item.inherited) model.inherited = structuredClone(item.inherited);
|
|
601
602
|
for (const key of [
|
|
602
603
|
'supportsVision',
|
|
603
604
|
'supportsReasoning',
|
|
@@ -660,6 +661,7 @@ function customProviderRow(id, entry, checkSecrets = true) {
|
|
|
660
661
|
row.discovery = structuredClone(config?.discovery ?? entry.discovery ?? { newModelsHidden: false });
|
|
661
662
|
row.modelOverrides = structuredClone(config?.modelOverrides ?? entry.modelOverrides ?? {});
|
|
662
663
|
if (config?.headers) row.headers = { ...config.headers };
|
|
664
|
+
if (config?.requestBody) row.requestBody = structuredClone(config.requestBody);
|
|
663
665
|
if (config?.wires) row.wires = [...config.wires];
|
|
664
666
|
if (config?.modelWires) row.modelWires = { ...config.modelWires };
|
|
665
667
|
// Additional API keys by id only; their values never leave the keychain.
|
|
@@ -1308,6 +1310,7 @@ function withStoredSettings(input, entry) {
|
|
|
1308
1310
|
if (out.modelOverrides === undefined) out.modelOverrides = stored.modelOverrides;
|
|
1309
1311
|
// `headers: {}` clears them; an omitted field keeps the stored ones.
|
|
1310
1312
|
if (out.headers === undefined && stored.headers) out.headers = stored.headers;
|
|
1313
|
+
if (out.requestBody === undefined && stored.requestBody) out.requestBody = stored.requestBody;
|
|
1311
1314
|
// Served wires and per-model wires have no setup field yet: an edit on
|
|
1312
1315
|
// the same protocol keeps them (another protocol serves other wires).
|
|
1313
1316
|
if ((out.protocol ?? stored.protocol) === stored.protocol) {
|
|
@@ -1472,6 +1475,8 @@ const MODEL_PATCH_KEYS = new Set([
|
|
|
1472
1475
|
'maxOutputTokens',
|
|
1473
1476
|
'supportsVision',
|
|
1474
1477
|
'reasoning',
|
|
1478
|
+
'requestBody',
|
|
1479
|
+
'requestHeaders',
|
|
1475
1480
|
]);
|
|
1476
1481
|
const REASONING_PATCH_KEYS = new Set(['levels', 'wireFormat', 'wireValues', 'replay']);
|
|
1477
1482
|
|
|
@@ -127,6 +127,13 @@ export function retireSeededPackCopies({ rootDir, dataDir, backup = makeBackup(d
|
|
|
127
127
|
if (![bundled, ...(history.outputStyles[name] || [])].includes(fileHash(copy))) continue;
|
|
128
128
|
if (backup.move(copy)) retired.push(`output-styles/${name}`);
|
|
129
129
|
}
|
|
130
|
+
for (const name of childNames(join(dataDir, 'orchestration'), 'md')) {
|
|
131
|
+
const bundled = fileHash(join(rootDir, 'orchestration', name));
|
|
132
|
+
if (!bundled) continue;
|
|
133
|
+
const copy = join(dataDir, 'orchestration', name);
|
|
134
|
+
if (![bundled, ...(history.orchestration[name] || [])].includes(fileHash(copy))) continue;
|
|
135
|
+
if (backup.move(copy)) retired.push(`orchestration/${name}`);
|
|
136
|
+
}
|
|
130
137
|
return retired;
|
|
131
138
|
}
|
|
132
139
|
|
|
@@ -24,8 +24,11 @@
|
|
|
24
24
|
import { billableInputTokensForProvider } from '../../runtime/shared/llm/cost.mjs';
|
|
25
25
|
import { hourlySeries } from './usage-stats-hours.mjs';
|
|
26
26
|
import {
|
|
27
|
+
FAST_KEY,
|
|
27
28
|
isConversationUsageSource,
|
|
29
|
+
isFastCall,
|
|
28
30
|
knownCostTurns,
|
|
31
|
+
sortFastBesideModel,
|
|
29
32
|
usageRollupDayKey,
|
|
30
33
|
} from '../../runtime/shared/llm/usage-rollup.mjs';
|
|
31
34
|
|
|
@@ -132,11 +135,14 @@ function providerBucket(state, provider, kind) {
|
|
|
132
135
|
return bucket;
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
// A model's Fast-mode calls are their own row beside its normal row.
|
|
139
|
+
function modelBucket(provider, model, fast = false) {
|
|
140
|
+
const key = fast ? model + FAST_KEY : model;
|
|
141
|
+
let bucket = provider.models.get(key);
|
|
137
142
|
if (!bucket) {
|
|
138
143
|
bucket = {
|
|
139
144
|
model,
|
|
145
|
+
fast,
|
|
140
146
|
turns: 0,
|
|
141
147
|
input: 0,
|
|
142
148
|
output: 0,
|
|
@@ -146,7 +152,7 @@ function modelBucket(provider, model) {
|
|
|
146
152
|
sessions: new Set(),
|
|
147
153
|
sessionsComplete: true,
|
|
148
154
|
};
|
|
149
|
-
provider.models.set(
|
|
155
|
+
provider.models.set(key, bucket);
|
|
150
156
|
}
|
|
151
157
|
return bucket;
|
|
152
158
|
}
|
|
@@ -166,9 +172,9 @@ function addUsage(target, usage) {
|
|
|
166
172
|
target.speedMs = (target.speedMs || 0) + (usage.speedMs || 0);
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
function foldRoute(state, providerId, modelId, kind, usage) {
|
|
175
|
+
function foldRoute(state, providerId, modelId, kind, usage, fast = false) {
|
|
170
176
|
const provider = providerBucket(state, providerId, kind);
|
|
171
|
-
const model = modelBucket(provider, modelId);
|
|
177
|
+
const model = modelBucket(provider, modelId, fast);
|
|
172
178
|
for (const bucket of [provider, model]) {
|
|
173
179
|
addUsage(bucket, usage);
|
|
174
180
|
if (usage.turns > 0 && (!usage.sessions || usage.sessionsComplete === false)) {
|
|
@@ -258,7 +264,7 @@ function foldRollupDay(state, key, day, conversationOnly) {
|
|
|
258
264
|
speedOutput: num(raw?.speedOutput),
|
|
259
265
|
speedMs: num(raw?.speedMs),
|
|
260
266
|
};
|
|
261
|
-
foldRoute(state, providerId, modelId, text(raw?.kind), usage);
|
|
267
|
+
foldRoute(state, providerId, modelId, text(raw?.kind), usage, raw?.fast === true);
|
|
262
268
|
addDaily(state, key, usage, providerId);
|
|
263
269
|
}
|
|
264
270
|
|
|
@@ -313,7 +319,14 @@ function foldEvent(state, key, event, conversationOnly) {
|
|
|
313
319
|
speedOutput: timed ? output : 0,
|
|
314
320
|
speedMs: timed ? durationMs : 0,
|
|
315
321
|
};
|
|
316
|
-
|
|
322
|
+
// Tiers are kept on the record's rates (see makeUsageRecord), not top level.
|
|
323
|
+
const kind = text(event?.providerKind);
|
|
324
|
+
const fast = isFastCall({
|
|
325
|
+
kind,
|
|
326
|
+
requestServiceTier: event?.rates?.requestServiceTier,
|
|
327
|
+
serviceTier: event?.rates?.serviceTier,
|
|
328
|
+
});
|
|
329
|
+
foldRoute(state, providerId, modelId, kind, usage, fast);
|
|
317
330
|
addDaily(state, key, usage, providerId);
|
|
318
331
|
|
|
319
332
|
if (durationMs > 0) {
|
|
@@ -513,9 +526,12 @@ function exportRoute(bucket, totalTokens) {
|
|
|
513
526
|
function exportProviders(state, { totalTokens, modelLimit }) {
|
|
514
527
|
return [...state.providers.values()]
|
|
515
528
|
.map((bucket) => {
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
.
|
|
529
|
+
const exported = [...bucket.models.values()].map((model) => ({
|
|
530
|
+
model: model.model,
|
|
531
|
+
...(model.fast ? { fast: true } : {}),
|
|
532
|
+
...exportRoute(model, totalTokens),
|
|
533
|
+
}));
|
|
534
|
+
const models = sortFastBesideModel(exported, (row) => row.model, ['tokens', 'costUsd']);
|
|
519
535
|
return {
|
|
520
536
|
provider: bucket.provider,
|
|
521
537
|
providerKind: bucket.providerKind,
|
|
@@ -535,7 +551,12 @@ function exportUnpricedModels(state) {
|
|
|
535
551
|
const rows = [];
|
|
536
552
|
for (const provider of state.providers.values()) {
|
|
537
553
|
for (const model of provider.models.values()) {
|
|
538
|
-
|
|
554
|
+
// A model's Fast bucket is the same identity as its normal one.
|
|
555
|
+
if (
|
|
556
|
+
model.turns > 0 &&
|
|
557
|
+
model.costKnownTurns < model.turns &&
|
|
558
|
+
!rows.some((row) => row.provider === provider.provider && row.model === model.model)
|
|
559
|
+
)
|
|
539
560
|
rows.push({ provider: provider.provider, model: model.model });
|
|
540
561
|
}
|
|
541
562
|
}
|
|
@@ -12,7 +12,7 @@ import { sessionOptions } from './session-options.mjs';
|
|
|
12
12
|
* time. A boot connect still mid-handshake is caught on the first user
|
|
13
13
|
* turn by refreshInitialDeferredMcpSurface (session-turn-api), which
|
|
14
14
|
* re-folds the live registry before the prompt renders. */
|
|
15
|
-
function seedToolSurface(deps, reason) {
|
|
15
|
+
function seedToolSurface(deps, reason, coreMemoryContext) {
|
|
16
16
|
const { rt, mcpClient, modelStandaloneTools, applyPreSessionToolSelection } = deps;
|
|
17
17
|
let connectedMcpTools = [];
|
|
18
18
|
try {
|
|
@@ -37,6 +37,8 @@ function seedToolSurface(deps, reason) {
|
|
|
37
37
|
// process-wide firstTurnCompleted.
|
|
38
38
|
rt.session.deferredInitialRefreshPending = !/resume/i.test(String(reason || ''));
|
|
39
39
|
applyPreSessionToolSelection();
|
|
40
|
+
// Built from the settings as they stand: its first turn need not rebuild it.
|
|
41
|
+
deps.noteToolAvailability?.(rt.session, coreMemoryContext);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/** Adopt the provider session and publish it to hooks and statusline. */
|
|
@@ -45,7 +47,7 @@ export function materializeSession(deps, reason, coreMemoryContext) {
|
|
|
45
47
|
// adoptSession attaches the hook bridge (boot/infrastructure.mjs sessionAdopter).
|
|
46
48
|
adoptSession(mgr.createSession(sessionOptions(deps, coreMemoryContext)));
|
|
47
49
|
rt.reservedSessionId = null;
|
|
48
|
-
seedToolSurface(deps, reason);
|
|
50
|
+
seedToolSurface(deps, reason, coreMemoryContext);
|
|
49
51
|
writeStatuslineRoute(statusRoutes, rt.session, rt.route);
|
|
50
52
|
hooks.emit('session:create', {
|
|
51
53
|
sessionId: rt.session.id,
|
|
@@ -111,6 +111,8 @@ export function sessionOptions(deps, coreMemoryContext) {
|
|
|
111
111
|
cwd: rt.currentCwd,
|
|
112
112
|
...(rt.desktopSession && typeof rt.desktopSession === 'object' ? { desktopSession: rt.desktopSession } : {}),
|
|
113
113
|
coreMemoryContext,
|
|
114
|
+
// Prompt settings from the in-memory config (its disk copy trails it).
|
|
115
|
+
promptConfig: rt.config,
|
|
114
116
|
workflow,
|
|
115
117
|
workflowContext,
|
|
116
118
|
...(leadWorkflowParts ? { leadWorkflowParts } : {}),
|
|
@@ -67,7 +67,6 @@ export function createBuiltinToolSettings(
|
|
|
67
67
|
webSearchEnabled,
|
|
68
68
|
invalidateContextStatusCache,
|
|
69
69
|
invalidatePreSessionToolSurface,
|
|
70
|
-
refreshEmptySessionToolPolicy,
|
|
71
70
|
},
|
|
72
71
|
localSettings
|
|
73
72
|
) {
|
|
@@ -201,19 +200,15 @@ export function createBuiltinToolSettings(
|
|
|
201
200
|
async setWebSearchEnabled(enabled) {
|
|
202
201
|
const config = getConfig();
|
|
203
202
|
saveConfigAndAdopt(setModuleEnabledInConfig({ ...config }, 'webSearch', enabled !== false));
|
|
204
|
-
// Empty/reserved sessions rebuild now so session entry does not still
|
|
205
|
-
// advertise web_search. A conversation keeps its frozen schema.
|
|
206
|
-
await refreshEmptySessionToolPolicy?.();
|
|
207
203
|
return this.getToolModuleSettings();
|
|
208
204
|
},
|
|
209
205
|
/** Which user instruction files (AGENTS.md / CLAUDE.md) new sessions load:
|
|
210
|
-
* 'all' | 'agents' | 'claude' | 'off'.
|
|
206
|
+
* 'all' | 'agents' | 'claude' | 'off'. An empty session rebuilds at its next turn. */
|
|
211
207
|
async setInstructionFiles(mode) {
|
|
212
208
|
if (!INSTRUCTION_FILES_MODES.includes(mode)) {
|
|
213
209
|
throw new TypeError(`Instruction files must be one of ${INSTRUCTION_FILES_MODES.join(', ')}.`);
|
|
214
210
|
}
|
|
215
211
|
saveConfigAndAdopt({ ...getConfig(), instructionFiles: mode });
|
|
216
|
-
await refreshEmptySessionToolPolicy?.();
|
|
217
212
|
return this.getToolModuleSettings();
|
|
218
213
|
},
|
|
219
214
|
/** The global "Auto reasoning base": the effort Auto works around. */
|
|
@@ -238,7 +233,6 @@ export function createBuiltinToolSettings(
|
|
|
238
233
|
if (memoryEnabled) nextConfig = setBuiltinInstalledInConfig(nextConfig, 'memory', true);
|
|
239
234
|
saveConfigAndAdopt(nextConfig);
|
|
240
235
|
invalidateContextStatusCache();
|
|
241
|
-
await refreshEmptySessionToolPolicy?.();
|
|
242
236
|
return this.getToolModuleSettings();
|
|
243
237
|
},
|
|
244
238
|
async setBuiltinToolEnabled(name, enabled) {
|
|
@@ -268,7 +262,6 @@ export function createBuiltinToolSettings(
|
|
|
268
262
|
}
|
|
269
263
|
// Turning Auto on loads nothing: the judge starts on its first turn.
|
|
270
264
|
if (name === 'autoEffort' && enabled === false) await shutdownEffortJudge();
|
|
271
|
-
await refreshEmptySessionToolPolicy?.();
|
|
272
265
|
return this.getToolModuleSettings();
|
|
273
266
|
},
|
|
274
267
|
/** Extensions → Built-in Install: run the feature's preparation adapter
|
|
@@ -300,7 +293,6 @@ export function createBuiltinToolSettings(
|
|
|
300
293
|
await syncLocalProviderRegistry?.(true);
|
|
301
294
|
}
|
|
302
295
|
if (name === 'memory') invalidateContextStatusCache();
|
|
303
|
-
await refreshEmptySessionToolPolicy?.();
|
|
304
296
|
return this.getToolModuleSettings();
|
|
305
297
|
},
|
|
306
298
|
/** Extensions → Code Tidy: which engines exist, where each one comes from,
|
|
@@ -66,7 +66,7 @@ export const AGENT_SETTINGS_HANDLERS = {
|
|
|
66
66
|
}
|
|
67
67
|
const name = requireText(args.name, 'name');
|
|
68
68
|
await rt.restoreAgentDefinition(name);
|
|
69
|
-
return { restored: name, note: 'Its chat is back
|
|
69
|
+
return { restored: name, note: 'Its chat is back, and its routines run again as they were.' };
|
|
70
70
|
},
|
|
71
71
|
set_bot_order: (rt, args) => ({ botOrder: rt.setBotOrder(args.botOrder).order }),
|
|
72
72
|
set_cache_warming_enabled: (rt, args) => ({
|
|
@@ -79,7 +79,7 @@ const ACTION_APPLIES_TO = {
|
|
|
79
79
|
set_agent_connector: "that agent's next connector tool call, in every session",
|
|
80
80
|
set_agent_connector_tool: "that agent's next call of the tool, in every session",
|
|
81
81
|
set_project_connector: 'the next connector tool call of sessions in that Project',
|
|
82
|
-
restore_definition: 'now: the bot
|
|
82
|
+
restore_definition: 'now: the bot, its chat and its routines (as they were) return',
|
|
83
83
|
set_bot_order: 'the Bots page and the Sessions bot section on every device',
|
|
84
84
|
set_orchestration_mode:
|
|
85
85
|
"new sessions and an empty current one (the default mode); a conversation keeps its own mode until it is switched with the composer's mode selector",
|
|
@@ -92,7 +92,14 @@ const ACTION_APPLIES_TO = {
|
|
|
92
92
|
set_heartbeat_interval:
|
|
93
93
|
"Mixy's heartbeat from the next tick: the next check is due the new interval after the last one; no restart required",
|
|
94
94
|
set_reactions_enabled:
|
|
95
|
-
"bots' chats; while off a reaction is refused at once
|
|
95
|
+
"bots' chats, this conversation included, from their next turn; while off a reaction is refused at once; reactions already left stay visible",
|
|
96
|
+
set_profile: 'every conversation, this one included, from its next turn',
|
|
97
|
+
set_instruction_files: 'every conversation, this one included, from its next turn',
|
|
98
|
+
set_memory_enabled: 'every conversation, this one included, from its next turn',
|
|
99
|
+
set_web_search_enabled: 'every conversation, this one included, from its next turn',
|
|
100
|
+
set_builtin_enabled: 'every conversation, this one included, from its next turn',
|
|
101
|
+
install_builtin: 'every conversation, this one included, from its next turn',
|
|
102
|
+
set_output_style: 'every conversation, this one included, from its next turn',
|
|
96
103
|
set_worktree_settings: 'new tasks and worktrees created afterwards; existing worktrees are unchanged',
|
|
97
104
|
set_system_shell: 'subsequent shell calls',
|
|
98
105
|
save_automation: 'the automation worker; scheduled runs follow the saved timing',
|
|
@@ -284,7 +284,7 @@ export const EXTENDED_SETUP_HANDLERS = Object.freeze({
|
|
|
284
284
|
recovery:
|
|
285
285
|
args.definitionKind === 'workflow'
|
|
286
286
|
? 'User-authored definition files are deleted. A built-in override may revert to its built-in definition.'
|
|
287
|
-
: 'A custom agent or bot is archived with its chat and
|
|
287
|
+
: 'A custom agent or bot is archived with its chat; its schedules and webhooks are paused and hidden, unchanged. The user can restore it, routines included, from Sessions → Archived, or delete it there for good, which deletes its routines too. A built-in override reverts to its built-in definition.',
|
|
288
288
|
};
|
|
289
289
|
},
|
|
290
290
|
async save_automation(rt, args, context = {}) {
|
|
@@ -307,6 +307,8 @@ export const EXTENDED_SETUP_HANDLERS = Object.freeze({
|
|
|
307
307
|
owner: input.owner,
|
|
308
308
|
});
|
|
309
309
|
const next = { ...pick(previous, entryKeys), ...input };
|
|
310
|
+
// Omitted keeps the saved executor without checking it again (channel-admin.mjs).
|
|
311
|
+
if (!own(input, 'executorAgentId')) delete next.executorAgentId;
|
|
310
312
|
if (kind === 'schedule') {
|
|
311
313
|
if (previous.whenAt && !own(input, 'time') && !own(input, 'at')) {
|
|
312
314
|
next.at = new Date(previous.whenAt).toISOString();
|