mixdog 1.4.1 → 1.4.2
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 +3 -2
- package/scripts/build-shipped-history.mjs +115 -33
- package/scripts/gate-local.mjs +172 -61
- package/scripts/lib/gate-scheduler.mjs +138 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/run-node-tests.mjs +54 -29
- package/scripts/lib/scoped-temp.mjs +1 -0
- package/scripts/lib/test-failure-records.mjs +14 -1
- package/scripts/lib/test-failure-summary.mjs +16 -4
- package/scripts/lib/test-spawn-ledger.mjs +12 -3
- package/scripts/pptx-kit-index.mjs +5 -6
- package/scripts/suite-health.mjs +110 -28
- package/scripts/test.mjs +9 -14
- package/src/agents/advisor/AGENT.md +4 -4
- package/src/agents/advisor/agent.json +1 -1
- package/src/agents/explore/AGENT.md +22 -0
- package/src/agents/explore/agent.json +6 -0
- package/src/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +18 -2
- package/src/defaults/skills/browser-use/SKILL.md +4 -1
- package/src/defaults/skills/code-tidy/SKILL.md +71 -102
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +66 -114
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +19 -35
- package/src/defaults/skills/code-tidy/references/dead-code.md +3 -9
- package/src/defaults/skills/code-tidy/references/test-suite-slop.md +16 -27
- package/src/defaults/skills/computer-use/SKILL.md +12 -2
- package/src/defaults/skills/goal-management/SKILL.md +1 -1
- package/src/defaults/skills/setup/references/actions.md +12 -6
- package/src/defaults/skills/setup/references/surfaces.md +2 -2
- package/src/defaults/skills/setup-guide/SKILL.md +5 -2
- package/src/defaults/skills/setup-guide/model-recommendations.json +13 -0
- package/src/defaults/skills/skill-creator/SKILL.md +85 -190
- package/src/defaults/skills/skill-creator/references/design.md +70 -162
- package/src/defaults/skills/skill-creator/references/evaluation.md +33 -92
- package/src/defaults/skills/test-suite/SKILL.md +194 -0
- package/src/defaults/skills/test-suite/references/case-management.md +51 -0
- package/src/defaults/skills/test-suite/references/flaky-policy.md +39 -0
- package/src/defaults/skills/test-suite/references/reliability.md +49 -0
- package/src/defaults/skills/test-suite/references/suite-design.md +78 -0
- package/src/defaults/skills/test-suite/scripts/inventory.mjs +335 -0
- package/src/defaults/skills/visualize/SKILL.md +6 -2
- package/src/lib/rules-builder.cjs +6 -30
- package/src/rules/lead/LEAD.md +3 -3
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +4 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +130 -21
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -0
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +7 -7
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
- package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +122 -12
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -3
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +13 -2
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +152 -58
- package/src/runtime/agent/orchestrator/mcp/client.mjs +51 -18
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +83 -52
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +43 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +30 -28
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +31 -21
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +40 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-keys.mjs +34 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +14 -7
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +48 -31
- package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +0 -18
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +138 -6
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +100 -33
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/oauth-secret-fields.fixtures.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +26 -28
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/opencode-go-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +33 -2
- package/src/runtime/agent/orchestrator/providers/vertex-ai-auth.mjs +622 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-maas.mjs +185 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-models.mjs +445 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +567 -0
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +2 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +14 -5
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +30 -5
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +171 -37
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +94 -10
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +10 -5
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +5 -5
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -6
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +21 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +50 -28
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +3 -4
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +25 -14
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +17 -14
- package/src/runtime/agent/orchestrator/session/manager/session-scratch-environment.mjs +70 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +0 -3
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -3
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +47 -29
- package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +243 -38
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +164 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +36 -26
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +3 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +96 -20
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +99 -2
- package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +103 -13
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +49 -15
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +45 -27
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +34 -10
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -2
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/channels/lib/whisper-port.mjs +19 -10
- package/src/runtime/channels/lib/whisper-server.mjs +10 -1
- package/src/runtime/connectors/connector-accounts-mcp.mjs +236 -103
- package/src/runtime/connectors/gmail-app-password.mjs +3 -3
- package/src/runtime/explore/explorer.mjs +93 -0
- package/src/runtime/explore/tool-defs.mjs +35 -0
- package/src/runtime/explore/tool.mjs +123 -0
- package/src/runtime/memory/index.mjs +4 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
- package/src/runtime/memory/lib/embedding-worker.mjs +4 -0
- package/src/runtime/office/quality/assurance-structure-docx.mjs +1 -1
- package/src/runtime/shared/agent-route-config.mjs +17 -2
- package/src/runtime/shared/atomic-file.mjs +103 -2
- package/src/runtime/shared/background-tasks.mjs +15 -6
- package/src/runtime/shared/connector-accounts.mjs +5 -5
- package/src/runtime/shared/connector-catalog.d.mts +11 -4
- package/src/runtime/shared/connector-catalog.mjs +60 -52
- package/src/runtime/shared/custom-provider-keys.mjs +20 -0
- package/src/runtime/shared/file-has-data.mjs +26 -2
- package/src/runtime/shared/file-lock.mjs +13 -15
- package/src/runtime/shared/git-launch.d.mts +9 -0
- package/src/runtime/shared/git-launch.mjs +213 -0
- package/src/runtime/shared/git-runner-worker.mjs +2 -1
- package/src/runtime/shared/llm/cost.mjs +6 -1
- package/src/runtime/shared/llm/http-agent.mjs +313 -29
- package/src/runtime/shared/llm/model-catalog-projection.mjs +3 -2
- package/src/runtime/shared/llm/model-catalog.mjs +46 -6
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +3 -0
- package/src/runtime/shared/llm/system-proxy.mjs +452 -0
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/staged-install-worker.mjs +5 -0
- package/src/runtime/shared/staged-update.mjs +47 -2
- package/src/runtime/shared/tool-surface.mjs +110 -36
- package/src/runtime/shared/tool-work-units.mjs +4 -0
- package/src/runtime/shared/turn-worktree-snapshot.mjs +414 -54
- package/src/runtime/shared/worktrees/activity-gate.mjs +215 -318
- package/src/runtime/shared/worktrees/activity-ledger-worker.mjs +56 -0
- package/src/runtime/shared/worktrees/activity-ledger.mjs +391 -0
- package/src/runtime/shared/worktrees/branch-management.mjs +9 -3
- package/src/runtime/shared/worktrees/git.mjs +57 -0
- package/src/runtime/shared/worktrees/manager.mjs +205 -137
- package/src/runtime/tidy/install.mjs +95 -15
- package/src/runtime/tidy/languages.mjs +17 -15
- package/src/runtime/tidy/process.mjs +7 -4
- package/src/runtime/tidy/resolve.mjs +19 -16
- package/src/runtime/tidy/runners/biome.mjs +3 -3
- package/src/runtime/tidy/tool.mjs +1 -1
- package/src/runtime/tidy/worktree.mjs +10 -6
- package/src/runtime/visualize-bridge/client.mjs +4 -1
- package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
- package/src/runtime/web-search/index.mjs +1 -1
- package/src/session-runtime/agent-task-sessions.mjs +410 -353
- package/src/session-runtime/boot/tools.mjs +2 -0
- package/src/session-runtime/bot-status.mjs +103 -103
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/discovery.mjs +159 -40
- package/src/session-runtime/conversation-import/service.mjs +9 -3
- package/src/session-runtime/handoff-attachments.mjs +1 -1
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +2 -0
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +143 -116
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -1
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +16 -10
- package/src/session-runtime/mcp-glue/server-input.mjs +4 -1
- package/src/session-runtime/mixy-heartbeat.mjs +1 -1
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/resource-mcp-api.mjs +98 -35
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +44 -31
- package/src/session-runtime/resource-mcp-secrets.mjs +28 -11
- package/src/session-runtime/resource-mcp-servers.mjs +5 -4
- package/src/session-runtime/services/agent-tool/send-flow.mjs +10 -2
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +8 -3
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
- package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
- package/src/session-runtime/services/channel-worker/daemon-spawn.mjs +2 -0
- package/src/session-runtime/services/daemon-candidate.mjs +4 -1
- package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
- package/src/session-runtime/services/plugin-admin.mjs +10 -6
- package/src/session-runtime/services/provider-admin.mjs +281 -10
- package/src/session-runtime/session-turn-api.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +4 -1
- package/src/session-runtime/settings-system-api.mjs +1 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +13 -3
- package/src/session-runtime/setup-tool/connector-widen-approval.mjs +96 -0
- package/src/session-runtime/setup-tool/executor.mjs +6 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +2 -1
- package/src/session-runtime/turn/agent-ops.mjs +23 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +49 -11
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +10 -1
- package/src/session-runtime/workspace/activity-guards.mjs +176 -0
- package/src/session-runtime/workspace/session-view.mjs +149 -0
- package/src/session-runtime/workspace/side-checkouts.mjs +203 -0
- package/src/session-runtime/workspace/transition-runner.mjs +188 -0
- package/src/session-runtime/workspace/transitions.mjs +108 -1066
- package/src/session-runtime/workspace/workspace-merge.mjs +132 -0
- package/src/session-runtime/workspace/worktree-intents.mjs +242 -0
- package/src/session-runtime/workspace/worktree-maintenance.mjs +80 -0
- package/src/session-runtime/workspace/worktree-setup.mjs +85 -0
- package/src/session-runtime/workspace/worktree-tool.mjs +54 -54
- package/src/standalone/daemon-desktop-runtime.mjs +2 -0
- package/src/standalone/daemon-session-control.mjs +151 -136
- package/src/standalone/daemon.mjs +7 -0
- package/src/standalone/desktop-service-registry.mjs +9 -0
- package/src/standalone/local-session-runtime.mjs +5 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +3 -0
- package/src/standalone/session-client.mjs +5 -1
- package/src/standalone/session-frame-stream.mjs +83 -11
- package/src/standalone/session-protocol.mjs +4 -0
- package/src/standalone/session-service/agent-tree.mjs +45 -9
- package/src/standalone/session-service/projection/transcript-window.mjs +700 -64
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/tui/App.jsx +154 -164
- package/src/tui/app/app-view/floating-panel.jsx +3 -0
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +21 -10
- package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +1 -1
- package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +3 -0
- package/src/tui/app/prompt-submit/provider-prompts.mjs +3 -1
- package/src/tui/app/provider-setup/api-key-actions.mjs +31 -1
- package/src/tui/app/provider-setup/oauth-actions.mjs +25 -6
- package/src/tui/app/provider-setup-picker.mjs +20 -13
- package/src/tui/app/shell-layout/row-budgets.mjs +12 -10
- package/src/tui/app/slash-commands.mjs +1 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +46 -0
- package/src/tui/app/slash-dispatch.mjs +1 -1
- package/src/tui/app/use-btw-panel.mjs +29 -0
- package/src/tui/app/use-context-panel-refresh.mjs +31 -0
- package/src/tui/app/use-model-catalog-cache.mjs +13 -10
- package/src/tui/app/use-mouse-input.mjs +11 -0
- package/src/tui/app/use-onboarding-start.mjs +8 -3
- package/src/tui/app/use-panel-transition.mjs +10 -1
- package/src/tui/app/use-pasted-buffers.mjs +28 -20
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -0
- package/src/tui/app/use-prompt-layout-rows.mjs +3 -3
- package/src/tui/app/use-prompt-queue-history.mjs +3 -2
- package/src/tui/app/use-selection-focus.mjs +11 -2
- package/src/tui/app/use-selection-geometry.mjs +18 -9
- package/src/tui/app/use-selection-paint.mjs +4 -4
- package/src/tui/app/use-selection-stitch.mjs +3 -3
- package/src/tui/app/use-slash-palette.mjs +62 -0
- package/src/tui/app/use-terminal-chrome.mjs +2 -2
- package/src/tui/app/use-transcript-activity.mjs +47 -32
- package/src/tui/app/use-transcript-follow.mjs +12 -4
- package/src/tui/app/use-transcript-scroll.mjs +46 -17
- package/src/tui/app/use-transcript-swap-reset.mjs +27 -0
- package/src/tui/app/use-transcript-window/geometry.mjs +19 -5
- package/src/tui/app/use-transcript-window/instance-state.mjs +4 -0
- package/src/tui/app/use-transcript-window/selection-shift.mjs +5 -1
- package/src/tui/app/use-transcript-window.mjs +21 -11
- package/src/tui/app/use-tui-ready.mjs +18 -0
- package/src/tui/app/use-welcome-prompt-hint.mjs +5 -0
- package/src/tui/app/use-workflow-tab-cycle.mjs +5 -3
- package/src/tui/components/Picker.jsx +27 -3
- package/src/tui/components/SignInUrl.jsx +68 -0
- package/src/tui/components/TextEntryPanel.jsx +76 -46
- package/src/tui/components/sign-in-url-layout.mjs +24 -0
- package/src/tui/dist/index.mjs +1896 -1341
- package/src/tui/session/goal-turn-state.mjs +6 -2
- package/src/tui/session/session-api/controls.mjs +4 -0
- package/src/tui/session/session-api/extensions.mjs +8 -0
- package/src/tui/session/session-api/intake/abort.mjs +2 -1
- package/src/tui/session/session-api/intake.mjs +2 -0
- package/src/tui/session/session-api/integrations.mjs +2 -2
- package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +2 -2
- package/src/tui/session/transcript-spill/spill-writer.mjs +15 -0
- package/src/tui/session/transcript-spill.mjs +92 -4
- package/src/tui/session/transcript-store.mjs +2 -0
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
<!-- tools: web_search
|
|
1
|
+
<!-- tools: web_search -->
|
|
2
2
|
# Research
|
|
3
3
|
|
|
4
4
|
<!-- tools: web_search -->
|
|
5
|
-
- Current or
|
|
6
|
-
|
|
7
|
-
- Memory may be stale: web search non-Project facts before answering; when unsure, web search.
|
|
8
|
-
<!-- tools: web_fetch -->
|
|
9
|
-
- Page or documentation body retrieval from a known URL→`web_fetch`.
|
|
5
|
+
- Current or non-Project facts: `web_search` before answering; memory may be
|
|
6
|
+
stale, so when unsure, search.
|
|
10
7
|
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
- Check required behavior, exact outputs and essential integrity, security,
|
|
4
4
|
compatibility and buildability. Expected values come from sources or
|
|
5
5
|
independent invariants, never from the output itself or from recall.
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
- Match checks to the change: inspection for nonbehavioral edits, focused
|
|
7
|
+
tests for local behavior, broader lanes only for shared contracts. Run them
|
|
8
|
+
once after planned edits, heavy ones in sequence; never reread your writes.
|
|
9
|
+
- Read full logs; rerun only after a relevant fix, never masking a failure
|
|
10
|
+
with retries, timeout bumps or skips; reuse valid passes.
|
|
11
|
+
After two failed fixes, report and stop. Stop processes you started.
|
|
11
12
|
- Unexpected result: confirm the check sees the live artifact, not a cache or
|
|
12
13
|
stale copy, before blaming the system.
|
|
13
|
-
- Use supplied commands unchanged except inputs
|
|
14
|
-
|
|
15
|
-
to release.
|
|
14
|
+
- Use supplied commands unchanged except inputs; no stricter flags or
|
|
15
|
+
unrequested suites.
|
|
16
16
|
- Warnings or blocked checks never justify editing passing code. Fix obsolete
|
|
17
|
-
expectations, not valid requirements
|
|
17
|
+
expectations, not valid requirements. A bug fix gets one regression test;
|
|
18
|
+
tests assert behavior, never removals, constants or copied code.
|
|
18
19
|
- Missing dependencies block verification; use only evidenced recovery routes.
|
|
19
20
|
Report verified results and blockers.
|
|
20
21
|
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
source unless the user asks.
|
|
14
14
|
<!-- tools: visualize -->
|
|
15
15
|
- Show every finished visual artifact with `visualize open`, loading its schema
|
|
16
|
-
first if deferred: images, video, HTML, documents, decks, mockups, diagrams
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
first if deferred: images, video, HTML, documents, decks, mockups, diagrams.
|
|
17
|
+
A summary, plan or report of your own work stays in the chat, never a
|
|
18
|
+
visualize page. `open` shows the user a deliverable; to check your own
|
|
19
|
+
work (`check`, `inspect`, `capture`, `export`), open with `verify: true`.
|
|
19
20
|
|
|
20
21
|
<!-- tools: git -->
|
|
21
22
|
- A commit request includes selecting and staging its changes; a stage-only
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
// cancellation sources, so collapse them before installing that one link.
|
|
4
4
|
// The first already-aborted source wins (in declaration order), retaining its
|
|
5
5
|
// original reason instead of replacing it with a generic AbortError.
|
|
6
|
-
|
|
6
|
+
// `onWinner(signal)` runs once, with the source that won, before the composite
|
|
7
|
+
// aborts: the owner of a timeout source arms its own bookkeeping there, and a
|
|
8
|
+
// source that fires after another already won is never reported.
|
|
9
|
+
export function composeAgentDispatchAbortSignal(signals, onWinner = null) {
|
|
7
10
|
const sources = (Array.isArray(signals) ? signals : []).filter((signal) => signal instanceof AbortSignal);
|
|
8
11
|
if (sources.length === 0) return { signal: null, dispose: () => {} };
|
|
9
12
|
const controller = new AbortController();
|
|
10
13
|
const listeners = [];
|
|
11
14
|
const abortFrom = (signal) => {
|
|
12
15
|
if (controller.signal.aborted) return;
|
|
16
|
+
onWinner?.(signal);
|
|
13
17
|
try {
|
|
14
18
|
controller.abort(signal.reason);
|
|
15
19
|
} catch {
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
getSession,
|
|
35
35
|
linkParentSignalToSession,
|
|
36
36
|
} from '../session/manager.mjs';
|
|
37
|
+
import { armTurnTimeout } from '../session/manager/turn-reap.mjs';
|
|
37
38
|
import { resolveAgentWatchdogPolicy } from './agent-progress-watchdog.mjs';
|
|
38
39
|
import { resourceAdmission } from '../../../shared/resource-admission.mjs';
|
|
39
40
|
import { composeAgentDispatchAbortSignal } from './agent-dispatch/abort-link.mjs';
|
|
@@ -160,7 +161,15 @@ async function dispatchAdmitted(agent, opts, callArgs, { prepare, ask, updateSta
|
|
|
160
161
|
// each link replaces the previous listener in runtime-liveness. One
|
|
161
162
|
// composite survives askSession's controller swap and makes every source
|
|
162
163
|
// reach the provider call.
|
|
163
|
-
|
|
164
|
+
// The watchdog arms this session's own timeout reap only when it is the
|
|
165
|
+
// source that stops the turn; an inherited parent abort that won first is a
|
|
166
|
+
// cancel for this child and never arms it.
|
|
167
|
+
const abortLink = composeAgentDispatchAbortSignal(
|
|
168
|
+
[opts.parentSignal, callParentSignal, watchdog.signal],
|
|
169
|
+
(source) => {
|
|
170
|
+
if (source === watchdog.signal) armTurnTimeout(session.id);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
164
173
|
if (abortLink.signal) {
|
|
165
174
|
try {
|
|
166
175
|
linkParentSignalToSession(session.id, abortLink.signal);
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* and never while the turn waits on the user's approval (`awaitingUser`).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { appendAgentTrace } from '../agent-trace-io.mjs';
|
|
11
|
+
import { appendAgentTrace, normalizeSessionId, _appendToolFailureRow } from '../agent-trace-io.mjs';
|
|
12
12
|
import { getHiddenAgent } from '../internal-agents.mjs';
|
|
13
|
+
import { PACKAGE_VERSION } from '../../../web-search/lib/package-version.mjs';
|
|
13
14
|
import { envNonNegativeInt, envPresent } from '../../../shared/env.mjs';
|
|
14
15
|
import {
|
|
15
16
|
PROVIDER_FIRST_BYTE_TIMEOUT_MS,
|
|
@@ -126,22 +127,113 @@ export function partialHandoffTextFromSession(session, messageStartIndex = 0) {
|
|
|
126
127
|
/** Owner-facing handoff for a watchdog-stopped agent: the stop and its reason
|
|
127
128
|
* come first, so the owner never mistakes the partial text for a finished
|
|
128
129
|
* result or a user cancel. */
|
|
129
|
-
export function watchdogStoppedHandoff(error, partial) {
|
|
130
|
-
|
|
130
|
+
export function watchdogStoppedHandoff(error, partial, shellJobs) {
|
|
131
|
+
const note = stoppedShellJobsNote(shellJobs);
|
|
132
|
+
return `[Agent stopped by the progress watchdog: ${error.message}. The output below is partial.]${note ? `\n${note}` : ''}\n\n${partial}`;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
// Jobs confirmed gone are "stopped"; the others were killed but their
|
|
136
|
+
// processes are not yet confirmed gone, so they are "still stopping".
|
|
137
|
+
function stoppedShellJobsNote({ stopped = [], stopping = [] } = {}) {
|
|
138
|
+
return [
|
|
139
|
+
stopped.length > 0 && `[Stopped its background shell jobs: ${stopped.join(', ')}.]`,
|
|
140
|
+
stopping.length > 0 && `[Still stopping its background shell jobs: ${stopping.join(', ')}.]`,
|
|
141
|
+
]
|
|
142
|
+
.filter(Boolean)
|
|
143
|
+
.join(' ');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** A stall with no partial output is rethrown as the error: name the stopped
|
|
147
|
+
* jobs in its text so the caller still learns them. */
|
|
148
|
+
export function noteStoppedShellJobsOnError(error, shellJobs) {
|
|
149
|
+
const note = stoppedShellJobsNote(shellJobs);
|
|
150
|
+
if (note && error && typeof error === 'object') error.message = `${error.message} ${note}`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The timestamp the stop was measured from, and which clock it is.
|
|
154
|
+
function resolveWatchdogAbortClock({ snapshot, policy, anchorTs, lastProgressAt }) {
|
|
134
155
|
if (snapshot && policy) {
|
|
135
156
|
if (snapshot.waitingForFirstSemantic) {
|
|
136
|
-
|
|
137
|
-
if (
|
|
157
|
+
if (snapshot.modelRequestStartedAt) return { at: snapshot.modelRequestStartedAt, field: 'model_request_started_at' };
|
|
158
|
+
if (snapshot.askStartedAt) return { at: snapshot.askStartedAt, field: 'ask_started_at' };
|
|
138
159
|
}
|
|
139
|
-
|
|
140
|
-
if (
|
|
160
|
+
if (snapshot.lastProgressAt) return { at: snapshot.lastProgressAt, field: 'last_progress_at' };
|
|
161
|
+
if (snapshot.firstActivityAt) return { at: snapshot.firstActivityAt, field: 'first_activity_at' };
|
|
141
162
|
}
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
return null;
|
|
163
|
+
if (lastProgressAt) return { at: lastProgressAt, field: 'reported_progress_at' };
|
|
164
|
+
if (anchorTs) return { at: anchorTs, field: 'anchor_ts' };
|
|
165
|
+
return { at: null, field: null };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Which deadline fired, read from the abort message. `idle_bare` is the form
|
|
169
|
+
// the registry/dispatch fallback throws when no progress snapshot existed.
|
|
170
|
+
function watchdogAbortKind(message) {
|
|
171
|
+
const limit = Number(/\((\d+)ms/.exec(message)?.[1]) || null;
|
|
172
|
+
if (/^agent first transport stale/.test(message)) return { window: 'first_response', form: 'first_transport', limit };
|
|
173
|
+
if (/^agent first semantic response stale/.test(message)) return { window: 'first_output', form: 'first_semantic', limit };
|
|
174
|
+
if (/^agent task stale \(\d+ms without stream\/tool progress\)/.test(message)) {
|
|
175
|
+
return { window: 'idle', form: 'idle_progress', limit };
|
|
176
|
+
}
|
|
177
|
+
if (/^agent task stale/.test(message)) return { window: 'idle', form: 'idle_bare', limit };
|
|
178
|
+
if (/^agent progress checks failed/.test(message)) return { window: 'idle', form: 'checks_failed', limit: null };
|
|
179
|
+
return { window: null, form: 'other', limit: null };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Shipped builds keep no agent trace, so a stop could not be audited after the
|
|
183
|
+
// fact (was the agent really silent?). The tool-failure log stays on in ship
|
|
184
|
+
// mode; the row holds clocks and names only, never prompt or output text.
|
|
185
|
+
// `observation` says how the snapshot was obtained: a wire-safe runtime is
|
|
186
|
+
// sampled asynchronously and the watchdog may judge a cached read, so
|
|
187
|
+
// `snapshot_present` alone does not prove the clocks are current. Only an error
|
|
188
|
+
// name/code is kept from a failed read, never its message.
|
|
189
|
+
function recordAgentWatchdogAbortRow({
|
|
190
|
+
sessionId,
|
|
191
|
+
agent,
|
|
192
|
+
error,
|
|
193
|
+
snapshot,
|
|
194
|
+
policy,
|
|
195
|
+
clock,
|
|
196
|
+
elapsed,
|
|
197
|
+
anchorTs,
|
|
198
|
+
lastProgressAt,
|
|
199
|
+
iteration,
|
|
200
|
+
observation,
|
|
201
|
+
registrationId,
|
|
202
|
+
}) {
|
|
203
|
+
if (process.env.MIXDOG_AGENT_TRACE_DISABLE === '1') return;
|
|
204
|
+
const message = typeof error.message === 'string' ? error.message : '';
|
|
205
|
+
const { window, form, limit } = watchdogAbortKind(message);
|
|
206
|
+
_appendToolFailureRow({
|
|
207
|
+
ts: Date.now(),
|
|
208
|
+
kind: 'stall_abort',
|
|
209
|
+
category: 'agent-stall',
|
|
210
|
+
build_version: PACKAGE_VERSION,
|
|
211
|
+
registration_id: registrationId || null,
|
|
212
|
+
session_id: normalizeSessionId(sessionId),
|
|
213
|
+
iteration: iteration ?? null,
|
|
214
|
+
agent: agent || null,
|
|
215
|
+
stage: snapshot?.stage ?? null,
|
|
216
|
+
window,
|
|
217
|
+
limit_ms: limit ?? policy?.idleStaleMs ?? null,
|
|
218
|
+
form,
|
|
219
|
+
compared_field: clock.field,
|
|
220
|
+
compared_at: clock.at,
|
|
221
|
+
elapsed_ms: elapsed,
|
|
222
|
+
snapshot_present: Boolean(snapshot),
|
|
223
|
+
snapshot_source: snapshot ? observation?.source || 'direct' : null,
|
|
224
|
+
last_read_ok_at: observation?.lastReadOkAt || null,
|
|
225
|
+
read_pending_since: observation?.readPendingSince || null,
|
|
226
|
+
last_read_error: observation?.lastReadError || null,
|
|
227
|
+
ask_started_at: snapshot?.askStartedAt || null,
|
|
228
|
+
model_request_started_at: snapshot?.modelRequestStartedAt || null,
|
|
229
|
+
waiting_for_transport: snapshot ? Boolean(snapshot.waitingForTransport) : null,
|
|
230
|
+
waiting_for_first_semantic: snapshot ? Boolean(snapshot.waitingForFirstSemantic) : null,
|
|
231
|
+
awaiting_user: snapshot?.awaitingUser || null,
|
|
232
|
+
last_progress_at: snapshot?.lastProgressAt || lastProgressAt || null,
|
|
233
|
+
last_keepalive_at: snapshot?.lastKeepaliveAt || null,
|
|
234
|
+
anchor_ts: anchorTs || null,
|
|
235
|
+
current_tool: snapshot?.currentTool || null,
|
|
236
|
+
});
|
|
145
237
|
}
|
|
146
238
|
|
|
147
239
|
function recordAgentWatchdogAbort({
|
|
@@ -154,15 +246,14 @@ function recordAgentWatchdogAbort({
|
|
|
154
246
|
anchorTs = 0,
|
|
155
247
|
lastProgressAt = 0,
|
|
156
248
|
iteration = null,
|
|
249
|
+
observation = null,
|
|
250
|
+
registrationId = null,
|
|
251
|
+
comparedClock = null,
|
|
157
252
|
}) {
|
|
158
253
|
if (!sessionId || !error) return;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
now,
|
|
163
|
-
anchorTs,
|
|
164
|
-
lastProgressAt,
|
|
165
|
-
});
|
|
254
|
+
// A caller that decided on its own clock (the failed-checks stop) names it.
|
|
255
|
+
const clock = comparedClock || resolveWatchdogAbortClock({ snapshot, policy, anchorTs, lastProgressAt });
|
|
256
|
+
const elapsed = clock.at ? Math.max(0, now - clock.at) : null;
|
|
166
257
|
try {
|
|
167
258
|
appendAgentTrace({
|
|
168
259
|
sessionId,
|
|
@@ -178,6 +269,24 @@ function recordAgentWatchdogAbort({
|
|
|
178
269
|
} catch {
|
|
179
270
|
/* best-effort */
|
|
180
271
|
}
|
|
272
|
+
try {
|
|
273
|
+
recordAgentWatchdogAbortRow({
|
|
274
|
+
sessionId,
|
|
275
|
+
agent,
|
|
276
|
+
error,
|
|
277
|
+
snapshot,
|
|
278
|
+
policy,
|
|
279
|
+
clock,
|
|
280
|
+
elapsed,
|
|
281
|
+
anchorTs,
|
|
282
|
+
lastProgressAt,
|
|
283
|
+
iteration,
|
|
284
|
+
observation,
|
|
285
|
+
registrationId,
|
|
286
|
+
});
|
|
287
|
+
} catch {
|
|
288
|
+
/* best-effort */
|
|
289
|
+
}
|
|
181
290
|
}
|
|
182
291
|
|
|
183
292
|
export function abortAgentProgressWatchdog(controller, ctx) {
|
|
@@ -246,9 +355,9 @@ export function resolveAgentWatchdogPolicy(agent, overrides = {}) {
|
|
|
246
355
|
// Part B: the provider-level idle abort is the first mid-stream catch, but
|
|
247
356
|
// it is transport-based for Anthropic (pings reset it; other providers
|
|
248
357
|
// judge semantic idle). This public-agent idle is a BACKSTOP only, so it
|
|
249
|
-
// must not exceed the stall abort (600s default)
|
|
250
|
-
//
|
|
251
|
-
//
|
|
358
|
+
// must not exceed the stall abort (600s default): a ping-only wedge that
|
|
359
|
+
// slipped past the provider layer would otherwise hang the owner for half
|
|
360
|
+
// an hour. Anthropic pings extend it only up to
|
|
252
361
|
// KEEPALIVE_MAX_IDLE_MULTIPLIER times (evaluateAgentWatchdogAbort). Cap it at
|
|
253
362
|
// the stall abort while keeping 30 min as an absolute ceiling. Long tool
|
|
254
363
|
// calls refresh progress through the activity heartbeat, so they never
|
|
@@ -563,6 +563,19 @@ function oneShotPromptCacheOpts(agent) {
|
|
|
563
563
|
return isOneShotMaintenanceAgent(agent) ? { promptCacheScope: 'shared' } : null;
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
+
/**
|
|
567
|
+
* Cache send options for a session-less loop whose system prompt and tool
|
|
568
|
+
* schemas are the same bytes on every call (the explore tool's explorers):
|
|
569
|
+
* keyed on that prefix, never per call, on the default 5m tier. The parallel
|
|
570
|
+
* explorers of a fan-out and the next calls minutes later are its only
|
|
571
|
+
* readers, so the Lead's 1h / 12h tiers would only raise the write price.
|
|
572
|
+
*/
|
|
573
|
+
export function sharedPrefixProviderCacheOpts(provider) {
|
|
574
|
+
const shared = { promptCacheScope: 'shared' };
|
|
575
|
+
if (cacheCapabilityForProvider(provider) !== 'explicit-breakpoint') return shared;
|
|
576
|
+
return { ...shared, cacheStrategy: { tools: 'none', system: '5m', tier3: 'none', messages: '5m' } };
|
|
577
|
+
}
|
|
578
|
+
|
|
566
579
|
/**
|
|
567
580
|
* Cache send options for a role's requests on `provider`: the breakpoint
|
|
568
581
|
* strategy on explicit-breakpoint providers, the Lead-class 12h prefix TTL on
|
|
@@ -3,6 +3,9 @@ import { normalizeContextTokens } from '../../../shared/llm/default-context-wind
|
|
|
3
3
|
import { loadConfig } from '../config.mjs';
|
|
4
4
|
import { getHiddenAgent } from '../internal-agents.mjs';
|
|
5
5
|
|
|
6
|
+
// The settings agent whose route a hidden role runs on.
|
|
7
|
+
const ROLE_BY_MAINT_KEY = Object.freeze({ memory: 'maintainer', explore: 'explore' });
|
|
8
|
+
|
|
6
9
|
function normalizeMaintenanceCandidate(candidate) {
|
|
7
10
|
if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) return candidate || null;
|
|
8
11
|
const provider = String(candidate.provider || '').trim();
|
|
@@ -38,7 +41,7 @@ export function resolveMaintenanceRoute({ preset, optsPreset, agent, config: cfg
|
|
|
38
41
|
try {
|
|
39
42
|
const config = cfgIn || loadConfig({ secrets: false });
|
|
40
43
|
const key = hidden.maintKey || hidden.slot;
|
|
41
|
-
const role = key
|
|
44
|
+
const role = ROLE_BY_MAINT_KEY[key] || '';
|
|
42
45
|
if (!role) return config?.maintenance?.[key] ?? null;
|
|
43
46
|
// A disabled agent must not silently fall back to the Main model:
|
|
44
47
|
// "off" means the maintenance role does not run at all.
|
|
@@ -78,6 +78,10 @@ export function buildDefaultConfig(options = {}) {
|
|
|
78
78
|
apiKey: apiKey || undefined,
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
+
// authMode: 'service-account' (the stored key), 'adc' (the gcloud login or a
|
|
82
|
+
// metadata server, nothing stored) or 'api-key' (an express-mode key). No
|
|
83
|
+
// location: unset follows the environment's region, then global.
|
|
84
|
+
providers['vertex-ai'] = { enabled: false, authMode: 'service-account' };
|
|
81
85
|
// OAuth provider detection uses lightweight credential probes so config
|
|
82
86
|
// load does not import provider runtimes or SDKs.
|
|
83
87
|
//
|
|
@@ -299,13 +303,13 @@ export function loadConfig(options = {}) {
|
|
|
299
303
|
recap: recapConfig,
|
|
300
304
|
// The model may title the session (session tool, action=rename); default on.
|
|
301
305
|
aiSessionTitles: raw.aiSessionTitles !== false,
|
|
302
|
-
// Mixy's heartbeat check (session-runtime/mixy-heartbeat.mjs); default
|
|
303
|
-
heartbeat: raw.heartbeat
|
|
306
|
+
// Mixy's heartbeat check (session-runtime/mixy-heartbeat.mjs); default off.
|
|
307
|
+
heartbeat: raw.heartbeat === true,
|
|
304
308
|
// Minutes between its checks, one of a fixed set (shared/heartbeat-interval.mjs);
|
|
305
309
|
// anything else reads as the default.
|
|
306
310
|
heartbeatIntervalMinutes: normalizeHeartbeatIntervalMinutes(raw.heartbeatIntervalMinutes),
|
|
307
|
-
// Prompt-cache warming (session/cache-warm.mjs); default
|
|
308
|
-
promptCacheWarming: raw?.promptCacheWarming
|
|
311
|
+
// Prompt-cache warming (session/cache-warm.mjs); default off.
|
|
312
|
+
promptCacheWarming: raw?.promptCacheWarming === true,
|
|
309
313
|
// Bots may leave an emoji reaction on the user's message (react tool); default on.
|
|
310
314
|
reactions: raw.reactions !== false,
|
|
311
315
|
// Bots page layout (order, hidden groups, pins, retention) and the shared
|
|
@@ -360,7 +364,7 @@ export function loadConfig(options = {}) {
|
|
|
360
364
|
shell: {},
|
|
361
365
|
update: {},
|
|
362
366
|
recap: { enabled: true },
|
|
363
|
-
promptCacheWarming:
|
|
367
|
+
promptCacheWarming: false,
|
|
364
368
|
worktree: normalizeWorktreeSettings(null),
|
|
365
369
|
developer: {},
|
|
366
370
|
modules: {},
|
|
@@ -490,7 +494,8 @@ function buildAgentSaveBuilder(config) {
|
|
|
490
494
|
// Default true lives in code: only the opt-out is stored.
|
|
491
495
|
if (config.aiSessionTitles === false) next.aiSessionTitles = false;
|
|
492
496
|
else delete next.aiSessionTitles;
|
|
493
|
-
|
|
497
|
+
// Default off lives in code: only the opt-in is stored.
|
|
498
|
+
if (config.heartbeat === true) next.heartbeat = true;
|
|
494
499
|
else delete next.heartbeat;
|
|
495
500
|
// Only a non-default choice is stored.
|
|
496
501
|
const heartbeatMinutes = normalizeHeartbeatIntervalMinutes(config.heartbeatIntervalMinutes);
|
|
@@ -498,7 +503,7 @@ function buildAgentSaveBuilder(config) {
|
|
|
498
503
|
else delete next.heartbeatIntervalMinutes;
|
|
499
504
|
if (config.reactions === false) next.reactions = false;
|
|
500
505
|
else delete next.reactions;
|
|
501
|
-
if (config.promptCacheWarming ===
|
|
506
|
+
if (config.promptCacheWarming === true) next.promptCacheWarming = true;
|
|
502
507
|
else delete next.promptCacheWarming;
|
|
503
508
|
if (Array.isArray(config.botOrder) && config.botOrder.length) next.botOrder = [...config.botOrder];
|
|
504
509
|
else delete next.botOrder;
|
|
@@ -156,8 +156,8 @@ const firstSentence = (text) => {
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
// A catalog connector's curated when-to-use trigger; else the first sentence
|
|
159
|
-
// of the server's MCP instructions; else
|
|
160
|
-
// order); else its name. Never the account: that is part of the instruction
|
|
159
|
+
// of the server's MCP instructions; else the leading description of its first
|
|
160
|
+
// described tool (name order); else its name. Never the account: that is part of the instruction
|
|
161
161
|
// text delivered when the server's tools are loaded. Derived lines are
|
|
162
162
|
// compacted to at most 98 characters, ellipsis included.
|
|
163
163
|
function mcpServerTrigger(server, tools, instructions) {
|
|
@@ -168,11 +168,11 @@ function mcpServerTrigger(server, tools, instructions) {
|
|
|
168
168
|
const instruction = String(instructions?.[server] || '')
|
|
169
169
|
.replace(/[<>]/g, '')
|
|
170
170
|
.replace(/^\s*Account: \S+?\.\s+/, '');
|
|
171
|
-
const described =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
const described =
|
|
172
|
+
[...tools]
|
|
173
|
+
.sort((a, b) => String(a?.name || '').localeCompare(String(b?.name || '')))
|
|
174
|
+
.map((tool) => firstSentence(String(tool?.description || '').replace(/[<>]/g, '')))
|
|
175
|
+
.find(Boolean) || '';
|
|
176
176
|
const derived = firstSentence(instruction) || described;
|
|
177
177
|
return derived ? compactPromptManifestText(derived, 98) : `${titleCaseMcpServer(server)} MCP server tools.`;
|
|
178
178
|
}
|
|
@@ -7,7 +7,7 @@ import { compareCodePoints } from '../../../shared/code-point-order.mjs';
|
|
|
7
7
|
import { BOTS_DIR, MIXY_BOT_ID, botStoreActive, isStoreBot, mixyIdentityDir } from '../../../shared/agent-store.mjs';
|
|
8
8
|
import { mixdogRoot } from '../../../shared/plugin-paths.mjs';
|
|
9
9
|
import { readMarkdownDocument } from '../../../shared/markdown-frontmatter.mjs';
|
|
10
|
-
import { listHiddenAgentsByKind
|
|
10
|
+
import { listHiddenAgentsByKind } from '../internal-agents.mjs';
|
|
11
11
|
import { mixdogGlobalDir, mtimeWithTtl, readSafe } from './skill-catalog.mjs';
|
|
12
12
|
import { mixyDisplayName } from '../session/mixy-name.mjs';
|
|
13
13
|
|
|
@@ -15,14 +15,14 @@ import { mixyDisplayName } from '../session/mixy-name.mjs';
|
|
|
15
15
|
// Emits a BP2 agent/system block scoped to the calling agent:
|
|
16
16
|
// - Public/custom agents: their own agents/<agent>.md when present,
|
|
17
17
|
// plus the public agent-worker contract.
|
|
18
|
-
// - Hidden agents: their own rules/agent/<agent>.md section only.
|
|
18
|
+
// - Hidden maintenance agents: their own rules/agent/<agent>.md section only.
|
|
19
19
|
// - Null agent: falls back to the full all-in-one block
|
|
20
20
|
// (explicit-cache unified-shard path).
|
|
21
21
|
//
|
|
22
22
|
// Agent-specific markdown intentionally rides BP2, behind the shared BP1 tool
|
|
23
23
|
// and skill manifest prefix, so agent changes do not disturb the common layer.
|
|
24
24
|
//
|
|
25
|
-
// Classification is dynamic — hidden
|
|
25
|
+
// Classification is dynamic — the hidden maintenance set comes from the
|
|
26
26
|
// `kind` field in internal-agents.mjs. Any other non-null agent is public/custom.
|
|
27
27
|
|
|
28
28
|
// One catalog/rules section; selectRoleInstructionSections matches sections
|
|
@@ -36,10 +36,7 @@ function loadAgentClassification() {
|
|
|
36
36
|
// listHiddenAgentsByKind now reads from the mtime-aware cache inside
|
|
37
37
|
// internal-agents.mjs so the classification always reflects the current
|
|
38
38
|
// agents.json on disk.
|
|
39
|
-
return {
|
|
40
|
-
retrieval: new Set(listHiddenAgentsByKind('retrieval')),
|
|
41
|
-
maintenance: new Set(listHiddenAgentsByKind('maintenance')),
|
|
42
|
-
};
|
|
39
|
+
return { maintenance: new Set(listHiddenAgentsByKind('maintenance')) };
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
const _scopedRoleInstructionsCache = new Map();
|
|
@@ -167,28 +164,13 @@ function selfHiddenRuleSection(hiddenPairs, agent) {
|
|
|
167
164
|
return self ? [roleSection(self.name, self.body)] : [];
|
|
168
165
|
}
|
|
169
166
|
|
|
170
|
-
function selectRoleInstructionSections({
|
|
171
|
-
useUnified,
|
|
172
|
-
agent,
|
|
173
|
-
classification,
|
|
174
|
-
agentSharesCatalog,
|
|
175
|
-
agentSections,
|
|
176
|
-
hiddenPairs,
|
|
177
|
-
}) {
|
|
167
|
+
function selectRoleInstructionSections({ useUnified, agent, classification, agentSections, hiddenPairs }) {
|
|
178
168
|
if (useUnified || !agent) {
|
|
179
169
|
return {
|
|
180
170
|
agentRuleSectionsToEmit: hiddenRuleSections(hiddenPairs),
|
|
181
171
|
agentSectionsToEmit: agentSections,
|
|
182
172
|
};
|
|
183
173
|
}
|
|
184
|
-
if (classification.retrieval.has(agent)) {
|
|
185
|
-
return {
|
|
186
|
-
agentRuleSectionsToEmit: selfHiddenRuleSection(hiddenPairs, agent),
|
|
187
|
-
agentSectionsToEmit: agentSections.filter((s) =>
|
|
188
|
-
[...agentSharesCatalog].some((name) => s.startsWith(`## ${name}\n`))
|
|
189
|
-
),
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
174
|
if (classification.maintenance.has(agent)) {
|
|
193
175
|
const selfRules = selfHiddenRuleSection(hiddenPairs, agent);
|
|
194
176
|
const fromAgent = agentSections.find((s) => s.startsWith(`## ${agent}\n`));
|
|
@@ -233,8 +215,6 @@ export function loadScopedRoleInstructions(agent, provider = null) {
|
|
|
233
215
|
// failures (malformed/missing agents.json) must propagate, not be
|
|
234
216
|
// silently swallowed by the file-IO catch below.
|
|
235
217
|
const classification = loadAgentClassification();
|
|
236
|
-
const agentSharesCatalog =
|
|
237
|
-
agent && classification.retrieval.has(agent) ? new Set(getAgentCatalogShareAgents(agent)) : new Set();
|
|
238
218
|
try {
|
|
239
219
|
const agentSections = loadAgentSections(pluginRoot);
|
|
240
220
|
const hiddenPairs = loadHiddenAgentSnippets(pluginRoot);
|
|
@@ -243,7 +223,6 @@ export function loadScopedRoleInstructions(agent, provider = null) {
|
|
|
243
223
|
useUnified,
|
|
244
224
|
agent,
|
|
245
225
|
classification,
|
|
246
|
-
agentSharesCatalog,
|
|
247
226
|
agentSections,
|
|
248
227
|
hiddenPairs,
|
|
249
228
|
});
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
* found" error rather than silently mis-dispatching.
|
|
21
21
|
*
|
|
22
22
|
* Kind classification:
|
|
23
|
-
* - 'retrieval' : short-lived hidden retrieval agents.
|
|
24
23
|
* - 'maintenance' : background-trigger hidden agents (memory cycle and
|
|
25
24
|
* title generation). Receive only their own self section.
|
|
25
|
+
* An entry without a kind only names a route (the explore tool's
|
|
26
|
+
* `explore-agent`, which runs no session).
|
|
26
27
|
*
|
|
27
28
|
* Permission classification:
|
|
28
29
|
* - 'read' : read-only — apply_patch/shell blocked at loop.mjs runtime
|
|
@@ -185,7 +186,7 @@ export function listHiddenAgentNames() {
|
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
/**
|
|
188
|
-
* List hidden agent names matching a given kind ('
|
|
189
|
+
* List hidden agent names matching a given kind ('maintenance').
|
|
189
190
|
* Consumed by collect.mjs to drive BP2 agent classification dynamically
|
|
190
191
|
* instead of hard-coding agent-name sets.
|
|
191
192
|
*/
|
|
@@ -196,15 +197,3 @@ export function listHiddenAgentsByKind(kind) {
|
|
|
196
197
|
}
|
|
197
198
|
return out;
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Return the agents/<name>.md sections a hidden agent shares in its BP2 catalog
|
|
202
|
-
* (in addition to its own self section). Drives hidden-role cache
|
|
203
|
-
* alignment declaratively instead of a hard-coded agent-name branch in
|
|
204
|
-
* collect.mjs. Returns [] when the agent declares none.
|
|
205
|
-
*/
|
|
206
|
-
export function getAgentCatalogShareAgents(name) {
|
|
207
|
-
const hidden = getHiddenAgent(name);
|
|
208
|
-
if (!hidden || !Array.isArray(hidden.catalogShareAgents)) return [];
|
|
209
|
-
return hidden.catalogShareAgents.map((n) => String(n || '').trim()).filter(Boolean);
|
|
210
|
-
}
|