mixdog 1.4.0 → 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/check-voice-runtime-inputs.mjs +25 -0
- package/scripts/gate-local.mjs +183 -63
- package/scripts/latest-guard.mjs +21 -9
- package/scripts/lib/gate-scheduler.mjs +138 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/isolated-test-env.mjs +10 -5
- package/scripts/lib/run-node-tests.mjs +91 -66
- package/scripts/lib/scoped-temp.d.mts +16 -0
- package/scripts/lib/scoped-temp.mjs +124 -0
- package/scripts/lib/stale-temp.mjs +44 -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/post-release-check.mjs +1 -6
- package/scripts/pptx-kit-index.mjs +17 -5
- package/scripts/suite-health.mjs +115 -24
- package/scripts/test-data-dir.mjs +10 -7
- 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/app.mjs +4 -0
- package/src/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +23 -2
- package/src/defaults/skills/browser-use/SKILL.md +10 -5
- 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 +16 -4
- 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 +35 -42
- package/src/output-styles/common.md +2 -2
- package/src/output-styles/simple.md +1 -1
- package/src/rules/agent/AGENT.md +5 -4
- package/src/rules/lead/LEAD.md +12 -7
- package/src/rules/shared/10-tool-workflow.md +3 -1
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/45-destructive.md +0 -2
- package/src/rules/shared/50-execution.md +2 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +8 -9
- 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 +156 -24
- 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/cache-break-trace.mjs +2 -0
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +8 -8
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +3 -1
- 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 +88 -54
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +54 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +37 -31
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +8 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens-recovery.mjs +6 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -2
- 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/anthropic-oauth-request/initial-status.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +2 -2
- 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-login.mjs +1 -10
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +3 -0
- 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/devin.mjs +3 -0
- 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 +248 -41
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-prefix-trace.mjs +76 -11
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +45 -6
- package/src/runtime/agent/orchestrator/providers/lib/first-output-window.mjs +58 -0
- package/src/runtime/agent/orchestrator/providers/lib/listen-on.mjs +14 -0
- 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-login.mjs +1 -10
- 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-compat-chat-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/chunk-events.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +5 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +16 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/output-items.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events.mjs +13 -3
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state.mjs +13 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-watchdogs.mjs +81 -42
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +8 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +160 -31
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +22 -12
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +49 -22
- 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 +45 -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/ask-user-tool-defs.mjs +41 -13
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +8 -6
- package/src/runtime/agent/orchestrator/runtime-core/session-text.mjs +7 -3
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +6 -1
- 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/runtime-core/workflow.mjs +5 -2
- 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/scoped-cache.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +102 -12
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +23 -0
- package/src/runtime/agent/orchestrator/session/compact/observation-supersession.mjs +103 -23
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +160 -36
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +164 -23
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +139 -19
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +38 -7
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +100 -22
- 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/compact-policy.mjs +33 -3
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +9 -2
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +13 -5
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +14 -0
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +23 -4
- 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/tool-exposure-migration.mjs +39 -21
- 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/ask-turn-loop-options.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/manager/owner-route-fallbacks.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/route-fallback-chain.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +30 -13
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +63 -6
- 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 +35 -13
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +24 -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 +10 -6
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +56 -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/pre-send-compact.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/prompt-cache-touch-store.mjs +30 -7
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +154 -0
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +37 -8
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +252 -39
- 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/session/transcript-restore/restore.mjs +61 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +23 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +46 -20
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +67 -31
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +25 -13
- package/src/runtime/agent/orchestrator/tools/builtin/lib/scoped-search-flight.mjs +9 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-publication.mjs +23 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +1 -8
- 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/code-graph/dispatch/federation.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/lib/isolated-test-env.mjs +4 -3
- 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 +28 -4
- 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/webhook/signature.mjs +4 -1
- package/src/runtime/channels/lib/whisper-port.mjs +29 -11
- package/src/runtime/channels/lib/whisper-server.mjs +10 -1
- package/src/runtime/computer-bridge/action-schema.mjs +2 -2
- package/src/runtime/computer-bridge/core-actions.mjs +2 -2
- package/src/runtime/computer-bridge/error-recovery.mjs +5 -4
- package/src/runtime/computer-bridge/linux-action-capabilities.mjs +24 -5
- package/src/runtime/computer-bridge/linux-readiness.d.mts +7 -2
- 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/local-provider/server-process.mjs +2 -1
- package/src/runtime/media/adapters/gemini-video.mjs +4 -1
- package/src/runtime/media/adapters/xai-media.mjs +2 -1
- 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 +10 -3
- package/src/runtime/memory/lib/memory-action-handlers/cycle-backfill-action.mjs +1 -7
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +1 -6
- package/src/runtime/office/authoring/pdf-author-action.mjs +1 -6
- package/src/runtime/office/design/design-art-direction.mjs +29 -27
- package/src/runtime/office/pdf/pdf-writer.mjs +6 -1
- package/src/runtime/office/portable/portable-snapshot-docx.mjs +7 -1
- package/src/runtime/office/portable/portable-snapshot-shared.mjs +6 -1
- package/src/runtime/office/quality/assurance-rendered.mjs +9 -2
- package/src/runtime/office/quality/assurance-structure-docx.mjs +4 -2
- package/src/runtime/office/quality/design-review.mjs +1 -5
- package/src/runtime/office/quality/document-brief.mjs +1 -5
- package/src/runtime/office/quality/forced-break-pages.mjs +9 -6
- package/src/runtime/office/quality/quality-pipeline.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/bot-owned-work.mjs +56 -0
- 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/defaults-separation.mjs +1 -4
- package/src/runtime/shared/fetch-safe-listen.d.mts +16 -0
- package/src/runtime/shared/fetch-safe-listen.mjs +50 -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/handoff-artifacts.d.mts +2 -1
- package/src/runtime/shared/handoff-artifacts.mjs +18 -8
- package/src/runtime/shared/idle-auto-clear-gate.mjs +29 -7
- package/src/runtime/shared/llm/cost.mjs +11 -2
- 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/loopback-listener.mjs +25 -2
- package/src/runtime/shared/model-route-chain.d.mts +7 -2
- package/src/runtime/shared/model-route-chain.mjs +22 -4
- package/src/runtime/shared/open-url.mjs +10 -0
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/session-activity-signal.mjs +14 -0
- package/src/runtime/shared/session-scratch.mjs +37 -0
- package/src/runtime/shared/staged-install-worker.mjs +5 -0
- package/src/runtime/shared/staged-update.mjs +47 -2
- package/src/runtime/shared/tool-card-model/agent-surface.mjs +1 -3
- package/src/runtime/shared/tool-card-model/card-status.mjs +15 -2
- package/src/runtime/shared/tool-result-summary.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +113 -36
- package/src/runtime/shared/tool-work-units.mjs +6 -0
- package/src/runtime/shared/turn-snapshot-store.mjs +13 -6
- 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/contract.mjs +4 -1
- package/src/runtime/shared/worktrees/git.mjs +72 -0
- package/src/runtime/shared/worktrees/manager.mjs +285 -168
- package/src/runtime/shared/worktrees/test-support.mjs +6 -10
- 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 +6 -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-home-delivery.mjs +41 -0
- package/src/session-runtime/agent-task-sessions.mjs +458 -312
- package/src/session-runtime/agent-tool-routing.mjs +8 -41
- package/src/session-runtime/boot/tools.mjs +7 -1
- package/src/session-runtime/bot-status.mjs +107 -101
- package/src/session-runtime/bot-target.mjs +38 -0
- package/src/session-runtime/channel-config-api.mjs +6 -1
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/codex-titles.mjs +88 -0
- package/src/session-runtime/conversation-import/discovery.mjs +401 -36
- package/src/session-runtime/conversation-import/service.mjs +35 -8
- package/src/session-runtime/handoff-attachments.mjs +82 -31
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +12 -13
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +1 -0
- 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/reaction-tool.mjs +4 -1
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +145 -112
- package/src/session-runtime/lifecycle/cold-heir.mjs +11 -6
- package/src/session-runtime/lifecycle/session-catalog.mjs +9 -1
- 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/model-route/set-route.mjs +11 -2
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/provider-catalog-cache.mjs +82 -36
- package/src/session-runtime/provider-models/catalog-load.mjs +23 -6
- package/src/session-runtime/provider-models.mjs +4 -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/resource-recall-api.mjs +6 -1
- package/src/session-runtime/runtime-feature-gates.mjs +5 -1
- package/src/session-runtime/services/agent-tool/execute.mjs +14 -9
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +20 -4
- package/src/session-runtime/services/agent-tool/model-select.mjs +48 -7
- package/src/session-runtime/services/agent-tool/render.mjs +71 -17
- 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-tool/spawn-preset.mjs +6 -2
- package/src/session-runtime/services/agent-tool/tool-def.mjs +9 -9
- 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 +283 -11
- 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/tool-policy/policy-stage.mjs +1 -0
- 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-editor.mjs +5 -1
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +25 -5
- package/src/session-runtime/workflow-agents-api/onboarding.mjs +3 -3
- 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 -1041
- 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 +73 -56
- package/src/standalone/daemon-desktop-runtime.mjs +2 -0
- package/src/standalone/daemon-session-control.mjs +169 -138
- 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/agent-turns.mjs +16 -12
- 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-action.mjs +10 -3
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/standalone/session-transport/client-registry/client-grace.mjs +12 -9
- package/src/tui/App.jsx +154 -164
- package/src/tui/app/app-view/floating-panel.jsx +10 -4
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +21 -10
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +1 -3
- package/src/tui/app/model-picker/route-selection.mjs +5 -6
- 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 +58 -21
- package/src/tui/app/provider-setup/provider-items.mjs +8 -2
- package/src/tui/app/provider-setup-picker.mjs +29 -18
- 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/QuestionPanel.jsx +13 -4
- 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 +1963 -1361
- 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/session-flow/queue/take-entries.mjs +11 -0
- 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/ui/statusline-agents.mjs +1 -3
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
|
@@ -6,13 +6,31 @@
|
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
7
7
|
import { publishForegroundShellRecord, retireForegroundShellRecord } from '../builtin/shell-jobs.mjs';
|
|
8
8
|
import { ShellTextDecoder, TaskOutput, treeKill } from '../shell-exec-output.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { createContainedTreeTracker, createProcessTreeTracker } from './shell-descendants.mjs';
|
|
10
10
|
import { registerOwnedShellTree } from './owned-shell-trees.mjs';
|
|
11
11
|
|
|
12
|
+
/** The tracker of the run's process tree, created once. A killed tree the
|
|
13
|
+
* spawn server contains is gone on its verified-empty report alone; every
|
|
14
|
+
* other tree (no containment, or a root that exited on its own and left
|
|
15
|
+
* survivors) is observed through the process table. */
|
|
16
|
+
export function runTreeTracker(run) {
|
|
17
|
+
run.terminationTracker =
|
|
18
|
+
run.terminationTracker ||
|
|
19
|
+
(run.killed === true && run.child.contained === true
|
|
20
|
+
? createContainedTreeTracker({
|
|
21
|
+
outcome: () => run.child.treeOutcome,
|
|
22
|
+
// Survivors the server kept in the job: the kill, by request id.
|
|
23
|
+
cancel: () => treeKill(run.child),
|
|
24
|
+
})
|
|
25
|
+
: createProcessTreeTracker({ pid: run.child.pid, rootCreationTime: run.child.creationTime }));
|
|
26
|
+
return run.terminationTracker;
|
|
27
|
+
}
|
|
28
|
+
|
|
12
29
|
/** One pre-kill identity read of the run's tree (every kill path shares it):
|
|
13
|
-
* resolves true once the capture is complete, false when it failed.
|
|
30
|
+
* resolves true once the capture is complete, false when it failed. A
|
|
31
|
+
* contained kill needs none: true at once, so the kill is never delayed. */
|
|
14
32
|
export function capturePreKill(run) {
|
|
15
|
-
|
|
33
|
+
if (runTreeTracker(run).contained) return true;
|
|
16
34
|
const rootExited = run.child.exitCode != null || run.child.signalCode != null;
|
|
17
35
|
return run.terminationTracker.capture({ rootExited }).catch(() => false);
|
|
18
36
|
}
|
|
@@ -32,6 +50,7 @@ export function registerForegroundOwnedTree(run, ownerSessionId) {
|
|
|
32
50
|
run.killCause = run.killCause || 'session-close';
|
|
33
51
|
// Always a fresh read: an earlier one predates what the run started
|
|
34
52
|
// since. Pending, the kill is sent at the snapshot bound regardless.
|
|
53
|
+
// A contained tree answers true at once: its cancel is sent at once.
|
|
35
54
|
return capturePreKill(run);
|
|
36
55
|
},
|
|
37
56
|
};
|
|
@@ -219,18 +238,23 @@ export function keepTerminationUnconfirmedRecord(run) {
|
|
|
219
238
|
// Record the tree's identities while the root is still alive, THEN kill: once
|
|
220
239
|
// an intermediate dies its children's parent links dangle and a snapshot taken
|
|
221
240
|
// afterwards can no longer find them.
|
|
222
|
-
// The kill waits
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
// workspace stays held
|
|
226
|
-
//
|
|
241
|
+
// The kill waits until the snapshot succeeded or failed, never just for a
|
|
242
|
+
// while: a read still in flight takes its table after a kill sent beside it,
|
|
243
|
+
// finds the root gone, and the tree could never be confirmed terminated (the
|
|
244
|
+
// workspace then stays held until a force-release). A healthy table read takes
|
|
245
|
+
// seconds on a loaded host; a stuck one ends at its enumeration deadline
|
|
246
|
+
// (ENUMERATION_DEADLINE_MS), and the kill is sent then, the outcome unknown.
|
|
247
|
+
// A tree the spawn server contains is killed at once instead: its job holds
|
|
248
|
+
// every descendant, and the server reports when that job is empty.
|
|
249
|
+
// The confirmation deadline starts once the kill is actually issued.
|
|
227
250
|
function snapshotThenKill(run, afterKill) {
|
|
228
|
-
|
|
251
|
+
const snapshot = run.child?.pid ? capturePreKill(run) : true;
|
|
252
|
+
if (snapshot === true) {
|
|
229
253
|
treeKill(run.child);
|
|
230
254
|
afterKill();
|
|
231
255
|
return;
|
|
232
256
|
}
|
|
233
|
-
void
|
|
257
|
+
void snapshot.then(() => {
|
|
234
258
|
treeKill(run.child);
|
|
235
259
|
afterKill();
|
|
236
260
|
});
|
|
@@ -55,8 +55,13 @@ function _disabled() {
|
|
|
55
55
|
return process.env.MIXDOG_SHELL_WARM_STANDBY === '0';
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
// Per-session scratch variables: they differ between sessions by design, so
|
|
59
|
+
// they stay out of the reuse signature and are set in the hand-off prelude.
|
|
60
|
+
const SCRATCH_ENV_KEYS = Object.freeze(['TEMP', 'TMP', 'TMPDIR']);
|
|
61
|
+
|
|
58
62
|
function envSignature(env) {
|
|
59
63
|
const entries = Object.entries(env || {})
|
|
64
|
+
.filter(([key]) => !SCRATCH_ENV_KEYS.includes(key))
|
|
60
65
|
.map(([key, value]) => `${key}=${value}`)
|
|
61
66
|
.sort()
|
|
62
67
|
.join('\n');
|
|
@@ -67,8 +72,16 @@ function _slotAlive(slot) {
|
|
|
67
72
|
return Boolean(slot?.native?.child && slot.native.child.exitCode == null && !slot.native.child.killed);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
// A PowerShell expression yielding `value` for any text. PowerShell quoting has
|
|
76
|
+
// no safe form for typographic apostrophes and the like, so the value travels
|
|
77
|
+
// as UTF-8 Base64 and is decoded inside the expression.
|
|
78
|
+
function psStringExpr(value) {
|
|
79
|
+
return `[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${Buffer.from(String(value), 'utf8').toString('base64')}'))`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The parked standby slot, for tests. */
|
|
83
|
+
export function _parkedShellStandbyForTest() {
|
|
84
|
+
return _slot;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
/** Pre-spawn the next standby (fire-and-forget; a live one is kept). */
|
|
@@ -89,6 +102,8 @@ function ensureWarmShellStandby({ shell, env }) {
|
|
|
89
102
|
outputLimit: SHELL_OUTPUT_DISK_CAP,
|
|
90
103
|
rawOutput: true,
|
|
91
104
|
stdinPipe: true,
|
|
105
|
+
// The command it is fed runs contained, like a fresh spawn's.
|
|
106
|
+
contain: true,
|
|
92
107
|
shellType: 'powershell',
|
|
93
108
|
command: '(warm shell standby)',
|
|
94
109
|
},
|
|
@@ -164,9 +179,18 @@ export function takeWarmShellStandby({ shell, env }) {
|
|
|
164
179
|
// cwd prelude: the standby was spawned in the daemon cwd. Set-Location
|
|
165
180
|
// fixes $PWD and native-child working dirs; Environment.CurrentDirectory
|
|
166
181
|
// fixes .NET relative-path APIs.
|
|
167
|
-
const
|
|
168
|
-
?
|
|
182
|
+
const cwdPrelude = workDir
|
|
183
|
+
? `$__mixdogCwd = ${psStringExpr(workDir)}; Set-Location -LiteralPath $__mixdogCwd; [System.Environment]::CurrentDirectory = $__mixdogCwd; `
|
|
169
184
|
: '';
|
|
185
|
+
// Scratch prelude: the standby was spawned for whichever session parked
|
|
186
|
+
// it. Set (or clear, when the request has none) the requested values
|
|
187
|
+
// before the command runs, so no other session's scratch path survives.
|
|
188
|
+
const scratchPrelude = SCRATCH_ENV_KEYS.map((key) =>
|
|
189
|
+
typeof env?.[key] === 'string'
|
|
190
|
+
? `$env:${key} = ${psStringExpr(env[key])}; `
|
|
191
|
+
: `Remove-Item -LiteralPath 'Env:${key}' -ErrorAction SilentlyContinue; `
|
|
192
|
+
).join('');
|
|
193
|
+
const prelude = scratchPrelude + cwdPrelude;
|
|
170
194
|
// Single atomic write+EOF: a separate close message can race ahead
|
|
171
195
|
// of the server's async write thread and feed an empty script.
|
|
172
196
|
slot.native.child.writeStdin(prelude + String(commandText ?? ''), { close: true });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Test support: wait for a real condition on a wall-clock budget. A fixed
|
|
2
|
+
// number of event-loop turns is load-dependent (async record writes and
|
|
3
|
+
// process-table reads take more turns on a busy machine); elapsed time is not.
|
|
4
|
+
// Polls on a short real timer (never a busy loop). The real setTimeout is
|
|
5
|
+
// captured at load, before any test enables mock timers, so a mocked clock
|
|
6
|
+
// cannot freeze the wait.
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
|
|
9
|
+
const realSetTimeout = setTimeout;
|
|
10
|
+
const POLL_MS = 5;
|
|
11
|
+
const tick = () => new Promise((resolve) => realSetTimeout(resolve, POLL_MS));
|
|
12
|
+
|
|
13
|
+
/** Resolves with the first truthy `read()` (sync or async); fails with `what`
|
|
14
|
+
* once `timeoutMs` has passed without one. */
|
|
15
|
+
export async function waitUntil(
|
|
16
|
+
read,
|
|
17
|
+
{ timeoutMs = 10_000, what = String(read).replace(/\s+/g, ' ').slice(0, 160) } = {}
|
|
18
|
+
) {
|
|
19
|
+
const deadline = Date.now() + timeoutMs;
|
|
20
|
+
for (;;) {
|
|
21
|
+
const value = await read();
|
|
22
|
+
if (value) return value;
|
|
23
|
+
if (Date.now() >= deadline) assert.fail(`condition not reached within ${timeoutMs}ms: ${what}`);
|
|
24
|
+
await tick();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -432,7 +432,7 @@ function attachChildExit(run, releasePromotedCapture) {
|
|
|
432
432
|
// child termination regardless — give 'close' a 3 s grace then
|
|
433
433
|
// settle anyway. The grace outlives the spawn server's own 2 s drain
|
|
434
434
|
// deadline, so the real exit status normally still arrives first.
|
|
435
|
-
|
|
435
|
+
const onExit = (code, signal) => {
|
|
436
436
|
if (!run.rootExitAtMs) run.rootExitAtMs = Date.now();
|
|
437
437
|
const grace = setTimeout(() => {
|
|
438
438
|
if (run.settled || run.promotionClose) return;
|
|
@@ -449,7 +449,12 @@ function attachChildExit(run, releasePromotedCapture) {
|
|
|
449
449
|
run.settle(code == null ? 1 : code, signal);
|
|
450
450
|
}, 3000);
|
|
451
451
|
if (grace.unref) grace.unref();
|
|
452
|
-
}
|
|
452
|
+
};
|
|
453
|
+
// The spawn awaits the command's workspace lease before these listeners
|
|
454
|
+
// exist; a root that exited meanwhile ('close' is replayed, 'exit' is not)
|
|
455
|
+
// starts its grace now.
|
|
456
|
+
if (child.exitCode != null || child.signalCode != null) onExit(child.exitCode, child.signalCode);
|
|
457
|
+
else child.once('exit', onExit);
|
|
453
458
|
}
|
|
454
459
|
|
|
455
460
|
// Live-progress heartbeat: every 2 s while the foreground command runs, emit
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.12",
|
|
3
3
|
"_comment": "Synced from immutable spawn-v release assets.",
|
|
4
4
|
"assets": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
7
|
-
"sha256": "
|
|
6
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-darwin-arm64",
|
|
7
|
+
"sha256": "bc2307b1c089e07f829a8a1daf4dfdfc128e3221d8f70609ffbdcc3f8b596806"
|
|
8
8
|
},
|
|
9
9
|
"darwin-x64": {
|
|
10
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
11
|
-
"sha256": "
|
|
10
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-darwin-x64",
|
|
11
|
+
"sha256": "4b1d221a29128046c417cfae5617e2898e1b7bc564dca686b2608b6cb14bf3af"
|
|
12
12
|
},
|
|
13
13
|
"linux-arm64": {
|
|
14
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
15
|
-
"sha256": "
|
|
14
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-linux-arm64",
|
|
15
|
+
"sha256": "2f577f54693726db0d285a16c3af2ad25b73fd705fd2fd4ac5c18ce795f657a9"
|
|
16
16
|
},
|
|
17
17
|
"linux-x64": {
|
|
18
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
19
|
-
"sha256": "
|
|
18
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-linux-x64",
|
|
19
|
+
"sha256": "83b52edfe2b810d5cf6544b03ab263eedcf7b2ef3c73107a45a33f6f7871e59e"
|
|
20
20
|
},
|
|
21
21
|
"win32-arm64": {
|
|
22
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
23
|
-
"sha256": "
|
|
22
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-win32-arm64.exe",
|
|
23
|
+
"sha256": "33872113fc0ca3cd2a2f6cf36c33430431388a5e36f254c8a0c6a44932057009"
|
|
24
24
|
},
|
|
25
25
|
"win32-x64": {
|
|
26
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.
|
|
27
|
-
"sha256": "
|
|
26
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/spawn-v0.1.12/mixdog-spawn-win32-x64.exe",
|
|
27
|
+
"sha256": "0070823fa03a50819077d60a407f4f8e26becafe3541ecdfabe522fc5e05a8cb"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -46,7 +46,10 @@ function verifySignature(secret, rawBody, signatureValue, parser) {
|
|
|
46
46
|
if (!vMatch || !tMatch) return false;
|
|
47
47
|
const ts = Number(tMatch[1]);
|
|
48
48
|
if (!Number.isFinite(ts) || Math.abs(Date.now() - ts * 1000) > STRIPE_TOLERANCE_MS) return false;
|
|
49
|
-
const expected = crypto
|
|
49
|
+
const expected = crypto
|
|
50
|
+
.createHmac('sha256', secret)
|
|
51
|
+
.update(Buffer.concat([Buffer.from(`${tMatch[1]}.`), Buffer.from(rawBody)]))
|
|
52
|
+
.digest('hex');
|
|
50
53
|
return hexDigestsEqual(vMatch[1], expected);
|
|
51
54
|
}
|
|
52
55
|
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import net from 'node:net';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { execFile } from 'node:child_process';
|
|
4
|
+
import { FETCH_BLOCKED_PORTS, FETCH_SAFE_ATTEMPTS } from '../../shared/fetch-safe-listen.mjs';
|
|
4
5
|
|
|
5
6
|
// whisper.cpp cannot bind port 0 itself. Ask the OS for an available port,
|
|
6
7
|
// release the reservation immediately before spawn, then verify the listener's
|
|
@@ -15,9 +16,17 @@ export function selectWhisperPort(host, preferred) {
|
|
|
15
16
|
server.close((error) => (error ? reject(error) : resolve(selected)));
|
|
16
17
|
});
|
|
17
18
|
});
|
|
19
|
+
// The server is reached with fetch, which refuses a "bad port" the OS may assign.
|
|
20
|
+
const reserveFetchSafe = async () => {
|
|
21
|
+
for (let attempt = 0; attempt <= FETCH_SAFE_ATTEMPTS; attempt += 1) {
|
|
22
|
+
const port = await reserve(0);
|
|
23
|
+
if (!FETCH_BLOCKED_PORTS.has(port)) return port;
|
|
24
|
+
}
|
|
25
|
+
throw new Error('no fetch-safe loopback port was assigned');
|
|
26
|
+
};
|
|
18
27
|
return reserve(preferred).catch((error) => {
|
|
19
28
|
if (error.code !== 'EADDRINUSE' && error.code !== 'EACCES') throw error;
|
|
20
|
-
return
|
|
29
|
+
return reserveFetchSafe();
|
|
21
30
|
});
|
|
22
31
|
}
|
|
23
32
|
|
|
@@ -39,22 +48,31 @@ function runOwnershipQuery(command, args) {
|
|
|
39
48
|
});
|
|
40
49
|
}
|
|
41
50
|
|
|
51
|
+
// Get-NetTCPConnection prints one OwningProcess number per line: no localized words.
|
|
52
|
+
export function listenerPidsInclude(stdout, pid) {
|
|
53
|
+
return stdout.split(/\r?\n/).some((line) => line.trim() === String(pid));
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
export async function whisperListenerOwned(host, port, pid) {
|
|
43
57
|
if (!Number.isInteger(pid) || pid <= 0 || !Number.isInteger(port)) return false;
|
|
44
58
|
try {
|
|
45
59
|
if (process.platform === 'win32') {
|
|
46
60
|
const root = process.env.SystemRoot || 'C:\\Windows';
|
|
47
|
-
|
|
61
|
+
// netstat omits listeners when the TCP table is large; the CIM-backed cmdlet does not.
|
|
62
|
+
// The State filter is skipped (it can report an unknown state for live listeners);
|
|
63
|
+
// a listening row is the one with no remote endpoint (RemotePort 0).
|
|
64
|
+
if (!/^[0-9a-fA-F:.]+$/.test(host)) return false;
|
|
65
|
+
const stdout = await runOwnershipQuery(
|
|
66
|
+
path.join(root, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
|
|
67
|
+
[
|
|
68
|
+
'-NoProfile',
|
|
69
|
+
'-NonInteractive',
|
|
70
|
+
'-Command',
|
|
71
|
+
`(Get-NetTCPConnection -LocalAddress '${host}' -LocalPort ${port} -ErrorAction SilentlyContinue | Where-Object RemotePort -eq 0).OwningProcess`,
|
|
72
|
+
]
|
|
73
|
+
);
|
|
48
74
|
if (stdout === null) return false;
|
|
49
|
-
return stdout
|
|
50
|
-
const fields = line.trim().split(/\s+/);
|
|
51
|
-
return (
|
|
52
|
-
fields[0] === 'TCP' &&
|
|
53
|
-
fields[1] === `${host}:${port}` &&
|
|
54
|
-
fields[3] === 'LISTENING' &&
|
|
55
|
-
fields[4] === String(pid)
|
|
56
|
-
);
|
|
57
|
-
});
|
|
75
|
+
return listenerPidsInclude(stdout, pid);
|
|
58
76
|
}
|
|
59
77
|
if (process.platform === 'linux') {
|
|
60
78
|
const stdout = await runOwnershipQuery('ss', ['-H', '-ltnp', `sport = :${port}`]);
|
|
@@ -80,6 +80,9 @@ const mgr = {
|
|
|
80
80
|
child: null, // ChildProcess handle (non-detached)
|
|
81
81
|
port: null, // selected port; must belong to the current child
|
|
82
82
|
host: null,
|
|
83
|
+
// Ownership proven for this child+port. A live child keeps its bound port, so
|
|
84
|
+
// no other process can take it; cleared whenever the child goes away.
|
|
85
|
+
proof: null, // { child, port }
|
|
83
86
|
runtimeKey: null, // exact contract fingerprint
|
|
84
87
|
contract: null, // { serverCmd, modelPath, threadCount, host }
|
|
85
88
|
startPromise: null, // in-flight ensureReady() start
|
|
@@ -330,6 +333,7 @@ async function teardown(reason) {
|
|
|
330
333
|
}
|
|
331
334
|
}
|
|
332
335
|
mgr.child = null;
|
|
336
|
+
mgr.proof = null;
|
|
333
337
|
mgr.port = null;
|
|
334
338
|
mgr.host = null;
|
|
335
339
|
mgr.runtimeKey = null;
|
|
@@ -357,6 +361,7 @@ function wireChildExit() {
|
|
|
357
361
|
detachChildHandlers();
|
|
358
362
|
clearPidMeta();
|
|
359
363
|
mgr.child = null;
|
|
364
|
+
mgr.proof = null;
|
|
360
365
|
mgr.port = null;
|
|
361
366
|
mgr.runtimeKey = null;
|
|
362
367
|
mgr.contract = null;
|
|
@@ -435,6 +440,7 @@ async function startServer(contract) {
|
|
|
435
440
|
mgr.state === STATE.STARTING
|
|
436
441
|
) {
|
|
437
442
|
mgr.port = port;
|
|
443
|
+
mgr.proof = { child, port };
|
|
438
444
|
mgr.state = STATE.READY;
|
|
439
445
|
return;
|
|
440
446
|
}
|
|
@@ -509,7 +515,10 @@ export async function transcribe(wavPath, { language } = {}) {
|
|
|
509
515
|
try {
|
|
510
516
|
const [data, owned] = await Promise.all([
|
|
511
517
|
fs.promises.readFile(wavPath),
|
|
512
|
-
|
|
518
|
+
// Proven at readiness for this live child; re-prove only without that proof.
|
|
519
|
+
mgr.proof?.child === child && mgr.proof.port === port && child.exitCode === null
|
|
520
|
+
? true
|
|
521
|
+
: whisperListenerOwned(host, port, child.pid),
|
|
513
522
|
]);
|
|
514
523
|
// Re-check after the awaits: a replacement listener (or child) must never
|
|
515
524
|
// receive audio. Nothing awaits between this check and the request.
|
|
@@ -362,13 +362,13 @@ export const COMPUTER_ACTION_CONTRACTS = [
|
|
|
362
362
|
type: 'string',
|
|
363
363
|
minLength: 1,
|
|
364
364
|
description:
|
|
365
|
-
"Fallback sign-in in the user's own browser; prefer its existing session/SSO or Browser Use's saved sign-in. Saved login (username or masked label; a miss lists the site's labels) written after host checks into the focused field of a Chrome/Edge HTTPS page. The site receives it. A password is kept from you and its browser's pixels are withheld this turn, but a page that redisplays it can expose it, and other programs of the same Windows user are outside this protection; a username is not hidden. On refusal hand the secret to the user (
|
|
365
|
+
"Fallback sign-in in the user's own browser; prefer its existing session/SSO or Browser Use's saved sign-in. Saved login (username or masked label; a miss lists the site's labels) written after host checks into the focused field of a Chrome/Edge HTTPS page. The site receives it. A password is kept from you and its browser's pixels are withheld this turn, but a page that redisplays it can expose it, and other programs of the same Windows user are outside this protection; a username is not hidden. On refusal hand the secret to the user (handoff_user secret, surface computer).",
|
|
366
366
|
},
|
|
367
367
|
field: {
|
|
368
368
|
type: 'string',
|
|
369
369
|
enum: SAVED_LOGIN_FIELDS,
|
|
370
370
|
description:
|
|
371
|
-
"username (text field) or password (password field). One-time codes, passkeys, security keys and app approvals are the user's step:
|
|
371
|
+
"username (text field) or password (password field). One-time codes, passkeys, security keys and app approvals are the user's step: handoff_user takeover.",
|
|
372
372
|
},
|
|
373
373
|
},
|
|
374
374
|
['savedAccount', 'field']
|
|
@@ -74,13 +74,13 @@ export const COMPUTER_CORE_ACTION_SCHEMA = {
|
|
|
74
74
|
text: {
|
|
75
75
|
type: 'string',
|
|
76
76
|
maxLength: 30_000,
|
|
77
|
-
description: `Literal text; foreground cap ${MAX_COMPUTER_FOREGROUND_TEXT_CHARS} UTF-16 code units per action. Never a password or one-time code, even one shown on screen: saved_login or
|
|
77
|
+
description: `Literal text; foreground cap ${MAX_COMPUTER_FOREGROUND_TEXT_CHARS} UTF-16 code units per action. Never a password or one-time code, even one shown on screen: saved_login or handoff_user.`,
|
|
78
78
|
},
|
|
79
79
|
value: {
|
|
80
80
|
type: 'string',
|
|
81
81
|
maxLength: 30_000,
|
|
82
82
|
description:
|
|
83
|
-
'set_value replacement for an element that advertises set_value; writes the control directly, without focus or keystrokes. Never a password or one-time code, even one shown on screen: saved_login or
|
|
83
|
+
'set_value replacement for an element that advertises set_value; writes the control directly, without focus or keystrokes. Never a password or one-time code, even one shown on screen: saved_login or handoff_user.',
|
|
84
84
|
},
|
|
85
85
|
keys: {
|
|
86
86
|
type: 'string',
|
|
@@ -31,8 +31,9 @@ const CLEANUP_CODES = new Set([
|
|
|
31
31
|
const PIXEL_CODES = new Set(['pixel_unavailable', 'observation_unavailable']);
|
|
32
32
|
// Saved-login refusals made before anything was written (host/saved-login.ts).
|
|
33
33
|
const SAVED_LOGIN_REFUSAL_CODES = new Set(['saved_login_refused', 'saved_login_changed', 'saved_login_unavailable']);
|
|
34
|
-
const SECRET_HANDOFF = 'hand the secret to the user with
|
|
35
|
-
const STEP_HANDOFF =
|
|
34
|
+
const SECRET_HANDOFF = 'hand the secret to the user with handoff_user (kind "secret", surface "computer")';
|
|
35
|
+
const STEP_HANDOFF =
|
|
36
|
+
'hand the step to the user with handoff_user (kind "takeover", surface "computer", need "sign_in")';
|
|
36
37
|
// Reads send no input, so their timeout is a provider budget, not an uncertain
|
|
37
38
|
// mutation: the caller needs another read route, not a cleanup investigation.
|
|
38
39
|
const READ_ONLY_ACTIONS = new Set(['capture', 'list', 'diagnose', 'verify']);
|
|
@@ -157,14 +158,14 @@ function recoveryForCode(code, args) {
|
|
|
157
158
|
if (SAVED_LOGIN_REFUSAL_CODES.has(code)) {
|
|
158
159
|
return {
|
|
159
160
|
code,
|
|
160
|
-
next: '
|
|
161
|
+
next: 'handoff_user',
|
|
161
162
|
guidance: `Nothing was written. If the refusal lists stored masked labels and the user's account is one of them, use that label; otherwise ${SECRET_HANDOFF}. Never type the secret yourself or try another window or field to get past the check.`,
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
if (code === 'saved_login_unconfirmed') {
|
|
165
166
|
return {
|
|
166
167
|
code,
|
|
167
|
-
next: '
|
|
168
|
+
next: 'handoff_user',
|
|
168
169
|
guidance: `The saved value may have been written. Do not call saved_login again for this field and do not type it yourself; ${STEP_HANDOFF} to check the field and finish signing in.`,
|
|
169
170
|
};
|
|
170
171
|
}
|
|
@@ -14,15 +14,34 @@
|
|
|
14
14
|
// pointer/keyboard the input device (uinput on Wayland, XTest on X11).
|
|
15
15
|
|
|
16
16
|
const WINDOW_ACTIONS = new Set([
|
|
17
|
-
'list_windows',
|
|
18
|
-
'
|
|
19
|
-
'
|
|
17
|
+
'list_windows',
|
|
18
|
+
'window_snapshot',
|
|
19
|
+
'related_windows',
|
|
20
|
+
'window_bounds',
|
|
21
|
+
'window_capture',
|
|
22
|
+
'window_integrity',
|
|
23
|
+
'validate_background_input',
|
|
24
|
+
'list_apps',
|
|
25
|
+
'verify',
|
|
26
|
+
'focus_window',
|
|
27
|
+
'move_window',
|
|
28
|
+
'window_state',
|
|
29
|
+
'close_window',
|
|
30
|
+
'terminate_process',
|
|
20
31
|
]);
|
|
21
32
|
const ACCESSIBILITY_ACTIONS = new Set(['snapshot', 'find', 'window_predicates', 'accessibility_probe']);
|
|
22
33
|
const SEMANTIC_ACTIONS = new Set(['invoke', 'set_value', 'toggle', 'invoke_menu']);
|
|
23
34
|
const POINTER_ACTIONS = new Set([
|
|
24
|
-
'click',
|
|
25
|
-
'
|
|
35
|
+
'click',
|
|
36
|
+
'double_click',
|
|
37
|
+
'right_click',
|
|
38
|
+
'middle_click',
|
|
39
|
+
'triple_click',
|
|
40
|
+
'mouse_down',
|
|
41
|
+
'mouse_up',
|
|
42
|
+
'mouse_move',
|
|
43
|
+
'drag',
|
|
44
|
+
'scroll',
|
|
26
45
|
]);
|
|
27
46
|
const KEYBOARD_ACTIONS = new Set(['type', 'key', 'key_down', 'key_up']);
|
|
28
47
|
|
|
@@ -35,7 +35,10 @@ export interface LinuxComputerRefusal {
|
|
|
35
35
|
export const MIN_WINDOW_HELPER_VERSION: number;
|
|
36
36
|
export const CAPABILITY_UNAVAILABLE_CODE: 'computer_capability_unavailable';
|
|
37
37
|
export function detectSession(env: Record<string, string | undefined>): 'wayland' | 'x11';
|
|
38
|
-
export function detectDesktop(
|
|
38
|
+
export function detectDesktop(
|
|
39
|
+
env: Record<string, string | undefined>,
|
|
40
|
+
session: 'wayland' | 'x11'
|
|
41
|
+
): LinuxComputerReadiness['desktop'];
|
|
39
42
|
export function checkLinuxComputerReadiness(options?: Record<string, unknown>): Promise<LinuxComputerReadiness>;
|
|
40
43
|
export function getLinuxComputerReadiness(options?: Record<string, unknown>): Promise<LinuxComputerReadiness>;
|
|
41
44
|
export function missingCapabilities(
|
|
@@ -47,4 +50,6 @@ export function resetLinuxComputerPreflightCache(): void;
|
|
|
47
50
|
export const GNOME_EXTENSION_UUID: 'mixdog-windows@mixdog.io';
|
|
48
51
|
export function gnomeExtensionDirs(env?: Record<string, string | undefined>): string[];
|
|
49
52
|
export const CAPTURE_FALLBACK_NOTE: string;
|
|
50
|
-
export function linuxCaptureFallback(
|
|
53
|
+
export function linuxCaptureFallback(
|
|
54
|
+
options?: Record<string, unknown>
|
|
55
|
+
): Promise<{ command: Record<string, unknown>; note: string } | null>;
|