mixdog 0.9.159 → 0.9.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/MIT.txt +1 -1
- package/NOTICE.md +2 -1
- package/README.md +3 -1
- package/package.json +23 -13
- package/scripts/build-tui.mjs +1 -16
- package/scripts/lib/local-provider-live-scenarios.mjs +22 -0
- package/scripts/lib/test-timing-reporter.mjs +38 -0
- package/scripts/local-provider-live-check.mjs +141 -0
- package/scripts/office/aesthetics-probe.mjs +59 -0
- package/scripts/office/author-deck.mjs +56 -0
- package/scripts/office/build-pptx-icons.mjs +48 -0
- package/scripts/office-design-audit.mjs +1 -1
- package/scripts/office-live-test-plan.mjs +34 -0
- package/scripts/pdf-rotation-stress.mjs +74 -0
- package/scripts/perf/cold-reconnect-probe.mjs +109 -0
- package/scripts/perf/transcript-baseline.mjs +56 -0
- package/scripts/perf/transcript-runtime-probe.mjs +62 -0
- package/scripts/release-paths.mjs +8 -38
- package/scripts/run-advisory-spec.mjs +6 -0
- package/scripts/run-office-live-tests.mjs +51 -18
- package/scripts/suite-health.mjs +3 -5
- package/scripts/test.mjs +100 -0
- package/scripts/tui-frame-harness-shim.mjs +1 -1
- package/scripts/tui-frame-harness.mjs +7 -2
- package/scripts/tui-transcript-jitter-harness.mjs +0 -11
- package/src/app.mjs +2 -14
- package/src/defaults/cycle3-review-prompt.md +32 -14
- package/src/defaults/plugin.json +6 -0
- package/src/defaults/skills/browser-use/SKILL.md +159 -0
- package/src/defaults/skills/computer-use/SKILL.md +157 -0
- package/src/defaults/skills/docx/SKILL.md +52 -0
- package/src/defaults/skills/image/SKILL.md +94 -0
- package/src/defaults/skills/local-provider/SKILL.md +115 -0
- package/src/defaults/skills/pdf/SKILL.md +51 -0
- package/src/defaults/skills/pptx/SKILL.md +145 -0
- package/src/defaults/skills/pptx/references/charts.md +153 -0
- package/src/defaults/skills/pptx/references/composition.md +182 -0
- package/src/defaults/skills/pptx/references/direction.md +70 -0
- package/src/defaults/skills/pptx/references/kit.md +551 -0
- package/src/defaults/skills/pptx/references/pictures.md +76 -0
- package/src/defaults/skills/pptx/references/review.md +104 -0
- package/src/defaults/skills/pptx/scripts/qc-pages.mjs +368 -0
- package/src/defaults/skills/pptx/scripts/review-deck.mjs +155 -0
- package/src/defaults/skills/pptx/scripts/source-extract.mjs +121 -0
- package/src/defaults/skills/setup/SKILL.md +86 -460
- package/src/defaults/skills/setup/references/actions.md +127 -0
- package/src/defaults/skills/setup/references/surfaces.md +72 -0
- package/src/defaults/skills/skill-creator/SKILL.md +191 -0
- package/src/defaults/skills/skill-creator/references/design.md +182 -0
- package/src/defaults/skills/skill-creator/references/evaluation.md +111 -0
- package/src/defaults/skills/skill-creator/references/source-review.md +94 -0
- package/src/defaults/skills/skill-creator/scripts/validate-skill.mjs +166 -0
- package/src/defaults/skills/video/SKILL.md +63 -0
- package/src/defaults/skills/xlsx/SKILL.md +72 -0
- package/src/defaults/skills/xlsx/references/model-conventions.md +52 -0
- package/src/headless-exec.mjs +1 -4
- package/src/headless-role.mjs +2 -5
- package/src/help.mjs +1 -1
- package/src/lib/output-style-meta.cjs +5 -1
- package/src/lib/rules-builder.cjs +24 -23
- package/src/mixdog-session-runtime.mjs +16 -7
- package/src/output-styles/extreme-minimal.md +1 -1
- package/src/rules/lead/01-general.md +5 -4
- package/src/rules/shared/00-general.md +4 -0
- package/src/rules/shared/30-exploration.md +2 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-loop-policy.mjs +1 -6
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -63
- package/src/runtime/agent/orchestrator/agent-runtime/completion-text.mjs +13 -0
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +0 -1
- package/src/runtime/agent/orchestrator/agent-runtime/title-completion.mjs +4 -15
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -1
- package/src/runtime/agent/orchestrator/agent-trace-io.mjs +1 -2
- package/src/runtime/agent/orchestrator/agent-trace.mjs +3 -4
- package/src/runtime/agent/orchestrator/cache-break-trace.mjs +1 -1
- package/src/runtime/agent/orchestrator/config.mjs +64 -7
- package/src/runtime/agent/orchestrator/context/collect.mjs +122 -58
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +1 -1
- package/src/runtime/agent/orchestrator/internal-tools.mjs +0 -5
- package/src/runtime/agent/orchestrator/mcp/client.mjs +2 -34
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +5 -16
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +10 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-fable-history.mjs +77 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-leaked-toolcall.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +1 -15
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +14 -63
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +5 -5
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +111 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +5 -146
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +124 -45
- package/src/runtime/agent/orchestrator/providers/anthropic-thinking-contract.mjs +13 -0
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +50 -42
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +5 -22
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +7 -10
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +2 -85
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +91 -0
- package/src/runtime/agent/orchestrator/providers/api-usage.mjs +4 -19
- package/src/runtime/agent/orchestrator/providers/compat-request-policy.mjs +21 -0
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor-wire-guards.mjs +63 -6
- package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +12 -7
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +27 -7
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +16 -10
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +150 -0
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-history-signatures.mjs +29 -0
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +5 -4
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +5 -6
- package/src/runtime/agent/orchestrator/providers/gemini-thinking.mjs +48 -0
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +23 -26
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +5 -36
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +19 -38
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +1 -7
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-image-input.mjs +105 -0
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +50 -94
- package/src/runtime/agent/orchestrator/providers/lib/json-memory-cache.mjs +27 -0
- package/src/runtime/agent/orchestrator/providers/lib/oauth-pkce.mjs +27 -0
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +29 -0
- package/src/runtime/agent/orchestrator/providers/lib/provider-replay.mjs +9 -6
- package/src/runtime/agent/orchestrator/providers/lib/wire-pairing.mjs +143 -0
- package/src/runtime/agent/orchestrator/providers/mixdog-local-wire.mjs +25 -0
- package/src/runtime/agent/orchestrator/providers/mixdog-local.mjs +79 -0
- package/src/runtime/agent/orchestrator/providers/model-catalog-projection.mjs +8 -0
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +18 -1
- package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/model-service-tiers.mjs +11 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +0 -8
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +205 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +5 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +17 -14
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +22 -25
- package/src/runtime/agent/orchestrator/providers/openai-direct-request.mjs +18 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +2 -15
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +4 -29
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +3 -4
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +48 -84
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +152 -0
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +15 -243
- package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +1 -36
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +6 -38
- package/src/runtime/agent/orchestrator/providers/opencode-go-usage.mjs +7 -20
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +44 -19
- package/src/runtime/agent/orchestrator/providers/registry.mjs +15 -0
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +44 -5
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +0 -5
- package/src/runtime/agent/orchestrator/providers/stream-json-pool.mjs +2 -6
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +41 -57
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +38 -11
- package/src/runtime/agent/orchestrator/session/cache/util.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +1 -112
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +3 -5
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +0 -12
- package/src/runtime/agent/orchestrator/session/context-compaction-policy.mjs +18 -23
- package/src/runtime/agent/orchestrator/session/context-fingerprint.mjs +54 -0
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +9 -58
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -5
- package/src/runtime/agent/orchestrator/session/evidence-union.mjs +3 -7
- package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/loop/arg-schema-coerce.mjs +92 -0
- package/src/runtime/agent/orchestrator/session/loop/compact-debug.mjs +2 -10
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +38 -63
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +14 -14
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +6 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +87 -38
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +12 -14
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +30 -33
- package/src/runtime/agent/orchestrator/session/manager/foreign-pending-messages.mjs +355 -0
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +6 -6
- package/src/runtime/agent/orchestrator/session/manager/message-sanitize.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +324 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +62 -688
- package/src/runtime/agent/orchestrator/session/manager/prompt-surface-publish.mjs +35 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +15 -2
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +38 -79
- package/src/runtime/agent/orchestrator/session/manager/rules-source-cache.mjs +61 -0
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +44 -14
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +9 -4
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +2 -28
- package/src/runtime/agent/orchestrator/session/manager.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/result-classification.mjs +0 -67
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/store/canonical-reader.mjs +62 -0
- package/src/runtime/agent/orchestrator/session/store/fs-probe.mjs +1 -20
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +60 -9
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +0 -19
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +0 -11
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +117 -134
- package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +131 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +20 -46
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +133 -0
- package/src/runtime/agent/orchestrator/session/thinking-replay-recovery.mjs +1 -4
- package/src/runtime/agent/orchestrator/session/token-estimate-floors.mjs +34 -0
- package/src/runtime/agent/orchestrator/session/token-estimate.mjs +3 -36
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +1 -7
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/binary-file.mjs +0 -25
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +7 -5
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +2 -7
- package/src/runtime/agent/orchestrator/tools/builtin/git-partial-stage.mjs +1 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +19 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +26 -2
- package/src/runtime/agent/orchestrator/tools/builtin/local-search-telemetry.mjs +0 -9
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +0 -20
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +0 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +7 -16
- package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +1 -14
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +5 -22
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-admission.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +17 -75
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +3 -19
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +4 -57
- package/src/runtime/agent/orchestrator/tools/builtin/shell-lossless-compact.mjs +0 -12
- package/src/runtime/agent/orchestrator/tools/builtin/shell-output.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +1 -7
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-store.mjs +3 -25
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +9 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-roots.mjs +276 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +38 -16
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +11 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +23 -355
- package/src/runtime/agent/orchestrator/tools/code-graph/exact-file-graph.mjs +92 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +1 -11
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -4
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +8 -0
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/graph-binary-fetcher.mjs +51 -124
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +2 -68
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +1 -10
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +2 -14
- package/src/runtime/agent/orchestrator/tools/patch-binary-fetcher.mjs +57 -138
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +4 -8
- package/src/runtime/agent/orchestrator/tools/spawn-binary-fetcher.mjs +45 -122
- package/src/runtime/attachments/pdf-extract.mjs +14 -6
- package/src/runtime/attachments/pdfjs-runtime.mjs +12 -0
- package/src/runtime/attachments/store.mjs +8 -8
- package/src/runtime/bridge-discovery.mjs +67 -0
- package/src/runtime/browser-bridge/action-schema.d.mts +6 -0
- package/src/runtime/browser-bridge/action-schema.mjs +9 -3
- package/src/runtime/browser-bridge/client.mjs +18 -31
- package/src/runtime/browser-bridge/tool-defs.mjs +16 -7
- package/src/runtime/channels/lib/boot-profile.mjs +3 -16
- package/src/runtime/channels/lib/config.mjs +0 -1
- package/src/runtime/channels/lib/runtime-paths.mjs +2 -15
- package/src/runtime/channels/lib/scheduler.mjs +0 -15
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +7 -59
- package/src/runtime/channels/lib/worker-main.mjs +2 -30
- package/src/runtime/computer-bridge/action-schema.mjs +7 -5
- package/src/runtime/computer-bridge/actions.d.mts +6 -0
- package/src/runtime/computer-bridge/actions.mjs +75 -0
- package/src/runtime/computer-bridge/client.mjs +21 -39
- package/src/runtime/computer-bridge/core-actions.mjs +2 -3
- package/src/runtime/computer-bridge/error-recovery.mjs +15 -3
- package/src/runtime/computer-bridge/limits.d.mts +8 -0
- package/src/runtime/computer-bridge/limits.mjs +67 -0
- package/src/runtime/computer-bridge/tool-defs.mjs +10 -16
- package/src/runtime/github/client.d.mts +17 -0
- package/src/runtime/github/client.mjs +127 -0
- package/src/runtime/github/commands.mjs +106 -0
- package/src/runtime/github/contract.d.mts +58 -0
- package/src/runtime/github/contract.mjs +147 -0
- package/src/runtime/github/tool.mjs +64 -0
- package/src/runtime/local-provider/asset-installer.mjs +261 -0
- package/src/runtime/local-provider/asset-storage.mjs +36 -0
- package/src/runtime/local-provider/catalog.mjs +151 -0
- package/src/runtime/local-provider/data/manifest.json +48 -0
- package/src/runtime/local-provider/gguf-header.mjs +92 -0
- package/src/runtime/local-provider/hardware.mjs +83 -0
- package/src/runtime/local-provider/hugging-face.mjs +111 -0
- package/src/runtime/local-provider/input-capabilities.mjs +19 -0
- package/src/runtime/local-provider/install-progress.mjs +77 -0
- package/src/runtime/local-provider/managed-runtime.mjs +45 -0
- package/src/runtime/local-provider/model-maintenance.mjs +114 -0
- package/src/runtime/local-provider/model-state.mjs +53 -0
- package/src/runtime/local-provider/registered-models.mjs +67 -0
- package/src/runtime/local-provider/request-queue.mjs +125 -0
- package/src/runtime/local-provider/resumable-installations.mjs +27 -0
- package/src/runtime/local-provider/server-process.mjs +209 -0
- package/src/runtime/local-provider/server.mjs +99 -0
- package/src/runtime/media/download.mjs +1 -1
- package/src/runtime/media/lanes.mjs +1 -1
- package/src/runtime/media/renditions.mjs +1 -1
- package/src/runtime/media/store.mjs +1 -1
- package/src/runtime/media/tool-defs.mjs +40 -0
- package/src/runtime/media/tool.mjs +277 -0
- package/src/runtime/memory/index.mjs +11 -29
- package/src/runtime/memory/lib/core-memory-candidates.mjs +0 -5
- package/src/runtime/memory/lib/core-memory-file.mjs +2 -2
- package/src/runtime/memory/lib/core-memory-store.mjs +37 -8
- package/src/runtime/memory/lib/cycle-scheduler.mjs +16 -2
- package/src/runtime/memory/lib/embedding-model-config.mjs +2 -4
- package/src/runtime/memory/lib/embedding-reindex.mjs +2 -4
- package/src/runtime/memory/lib/http-router.mjs +13 -1
- package/src/runtime/memory/lib/http-wire.mjs +1 -1
- package/src/runtime/memory/lib/memory-action-handlers.mjs +4 -1
- package/src/runtime/memory/lib/memory-config-flags.mjs +8 -12
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +0 -40
- package/src/runtime/memory/lib/memory-cycle1.mjs +1 -5
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +30 -9
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +35 -4
- package/src/runtime/memory/lib/memory-cycle2.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle3-evidence.mjs +117 -0
- package/src/runtime/memory/lib/memory-cycle3-guards.mjs +272 -0
- package/src/runtime/memory/lib/memory-cycle3.mjs +81 -238
- package/src/runtime/memory/lib/memory-embed.mjs +1 -4
- package/src/runtime/memory/lib/memory-score.mjs +0 -13
- package/src/runtime/memory/lib/memory-text-utils.mjs +7 -1
- package/src/runtime/memory/lib/pg/adapter.mjs +2 -2
- package/src/runtime/memory/lib/phase-merge-verdicts.mjs +54 -0
- package/src/runtime/memory/lib/prompt-surface-file.mjs +98 -0
- package/src/runtime/memory/lib/query-handlers.mjs +4 -1
- package/src/runtime/memory/lib/recall-embedding-readiness.mjs +1 -1
- package/src/runtime/memory/lib/recall-format.mjs +15 -7
- package/src/runtime/memory/lib/recall-order.mjs +6 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +25 -52
- package/src/runtime/memory/lib/session-ingest.mjs +3 -3
- package/src/runtime/memory/lib/trace-mode.mjs +1 -1
- package/src/runtime/memory/lib/trace-store.mjs +1 -10
- package/src/runtime/memory/lib/transcript-ingest.mjs +2 -2
- package/src/runtime/office/README.md +54 -0
- package/src/runtime/office/authoring/pptx-author-action.mjs +166 -0
- package/src/runtime/office/authoring/pptx-author-session.mjs +112 -0
- package/src/runtime/office/authoring/pptx-brief.mjs +270 -0
- package/src/runtime/office/authoring/pptx-contact-sheet.mjs +54 -0
- package/src/runtime/office/authoring/pptx-icons.json +1 -0
- package/src/runtime/office/authoring/pptx-icons.mjs +50 -0
- package/src/runtime/office/authoring/pptx-kit.mjs +33 -0
- package/src/runtime/office/authoring/pptx-receipt.mjs +388 -0
- package/src/runtime/office/authoring/pptx-review-artifacts.mjs +32 -0
- package/src/runtime/office/authoring/pptx-script-contract.mjs +15 -0
- package/src/runtime/office/authoring/pptx-script-normalize.mjs +244 -0
- package/src/runtime/office/authoring/pptx-script-runner.mjs +142 -0
- package/src/runtime/office/{assurance-benchmark.mjs → bench/assurance-benchmark.mjs} +8 -98
- package/src/runtime/office/bench/bench-support.mjs +18 -0
- package/src/runtime/office/{benchmark.mjs → bench/benchmark.mjs} +6 -11
- package/src/runtime/office/{contract-benchmark.mjs → bench/contract-benchmark.mjs} +4 -9
- package/src/runtime/office/bench/deck-bench.mjs +78 -0
- package/src/runtime/office/{polish-benchmark.mjs → bench/polish-benchmark.mjs} +2 -7
- package/src/runtime/office/{quality-live-benchmark.mjs → bench/quality-live-benchmark.mjs} +5 -260
- package/src/runtime/office/capabilities.mjs +105 -45
- package/src/runtime/office/{com-adapter.mjs → com/com-adapter.mjs} +58 -53
- package/src/runtime/office/com/office-com-cleanup.ps1 +126 -0
- package/src/runtime/office/{office-com-host.ps1 → com/office-com-host.ps1} +427 -90
- package/src/runtime/office/{office-com-session-host.ps1 → com/office-com-session-host.ps1} +117 -90
- package/src/runtime/office/com/office-session-client.mjs +91 -0
- package/src/runtime/office/{journal.mjs → core/journal.mjs} +1 -1
- package/src/runtime/office/core/office-actions-batch.mjs +348 -0
- package/src/runtime/office/core/office-actions-inspect.mjs +157 -0
- package/src/runtime/office/core/office-actions-lifecycle.mjs +253 -0
- package/src/runtime/office/core/office-actions-render.mjs +307 -0
- package/src/runtime/office/core/office-actions.mjs +6 -0
- package/src/runtime/office/{office-core.mjs → core/office-core.mjs} +26 -5
- package/src/runtime/office/core/office-render-preview.mjs +160 -0
- package/src/runtime/office/{office-sessions.mjs → core/office-sessions.mjs} +141 -9
- package/src/runtime/office/{office-transactions.mjs → core/office-transactions.mjs} +2 -1
- package/src/runtime/office/core/pptx-page-cache.mjs +70 -0
- package/src/runtime/office/{snapshot-contract.mjs → core/snapshot-contract.mjs} +28 -0
- package/src/runtime/office/{tabular.mjs → core/tabular.mjs} +2 -12
- package/src/runtime/office/{composition-system.mjs → design/composition-system.mjs} +2 -11
- package/src/runtime/office/{content-model.mjs → design/content-model.mjs} +1 -14
- package/src/runtime/office/{design-art-direction.mjs → design/design-art-direction.mjs} +51 -65
- package/src/runtime/office/{design-creative-director.mjs → design/design-creative-director.mjs} +7 -25
- package/src/runtime/office/design/design-discipline.mjs +310 -0
- package/src/runtime/office/{design-system.mjs → design/design-system.mjs} +14 -102
- package/src/runtime/office/{design-tokens.mjs → design/design-tokens.mjs} +33 -47
- package/src/runtime/office/{design-docx.mjs → design/docx/design-docx.mjs} +2 -1
- package/src/runtime/office/{design-library-core.mjs → design/library/design-library-core.mjs} +8 -34
- package/src/runtime/office/{design-library-pack.mjs → design/library/design-library-pack.mjs} +16 -1
- package/src/runtime/office/{design-library.mjs → design/library/design-library.mjs} +15 -2
- package/src/runtime/office/{design-template-index.mjs → design/library/design-template-index.mjs} +24 -2
- package/src/runtime/office/{design-template-inspect.mjs → design/library/design-template-inspect.mjs} +1 -12
- package/src/runtime/office/{design-xlsx-components.mjs → design/xlsx/design-xlsx-components.mjs} +2 -1
- package/src/runtime/office/{design-xlsx.mjs → design/xlsx/design-xlsx.mjs} +3 -1
- package/src/runtime/office/index.mjs +99 -30
- package/src/runtime/office/office-test-support.mjs +66 -0
- package/src/runtime/office/{document-preview.mjs → pdf/document-preview.mjs} +1 -1
- package/src/runtime/office/pdf/pdf-adapter.mjs +824 -0
- package/src/runtime/office/pdf/pdf-analysis.mjs +733 -0
- package/src/runtime/office/pdf/pdf-draw.mjs +91 -0
- package/src/runtime/office/pdf/pdf-fonts.mjs +91 -0
- package/src/runtime/office/pdf/pdf-forms.mjs +265 -0
- package/src/runtime/office/{pdf-render.mjs → pdf/pdf-render.mjs} +42 -36
- package/src/runtime/office/pdf/pdf-safety.mjs +50 -0
- package/src/runtime/office/pdf/pdf-search.mjs +187 -0
- package/src/runtime/office/{pdf-security.mjs → pdf/pdf-security.mjs} +7 -3
- package/src/runtime/office/pdf/pdf-writer.mjs +195 -0
- package/src/runtime/office/portable/docx-revisions.mjs +474 -0
- package/src/runtime/office/portable/docx-runs.mjs +293 -0
- package/src/runtime/office/portable/docx-tracked-edits.mjs +165 -0
- package/src/runtime/office/portable/font-provisioner.mjs +210 -0
- package/src/runtime/office/{ooxml-validator.mjs → portable/ooxml-validator.mjs} +26 -3
- package/src/runtime/office/{portable-cells.mjs → portable/portable-cells.mjs} +12 -3
- package/src/runtime/office/portable/portable-chart-faults.mjs +96 -0
- package/src/runtime/office/{portable-chart.mjs → portable/portable-chart.mjs} +21 -19
- package/src/runtime/office/{portable-docx-parts.mjs → portable/portable-docx-parts.mjs} +97 -0
- package/src/runtime/office/{portable-docx-xml.mjs → portable/portable-docx-xml.mjs} +2 -2
- package/src/runtime/office/{portable-docx.mjs → portable/portable-docx.mjs} +211 -36
- package/src/runtime/office/{portable-opc.mjs → portable/portable-opc.mjs} +11 -3
- package/src/runtime/office/{portable-package.mjs → portable/portable-package.mjs} +7 -25
- package/src/runtime/office/{portable-pivot.mjs → portable/portable-pivot.mjs} +1 -1
- package/src/runtime/office/{portable-pptx-chart.mjs → portable/portable-pptx-chart.mjs} +4 -2
- package/src/runtime/office/{portable-pptx-charts.mjs → portable/portable-pptx-charts.mjs} +5 -19
- package/src/runtime/office/{portable-pptx-core.mjs → portable/portable-pptx-core.mjs} +14 -3
- package/src/runtime/office/{portable-pptx-package.mjs → portable/portable-pptx-package.mjs} +62 -5
- package/src/runtime/office/{portable-pptx-shapes.mjs → portable/portable-pptx-shapes.mjs} +1 -1
- package/src/runtime/office/{portable-pptx.mjs → portable/portable-pptx.mjs} +11 -2
- package/src/runtime/office/{portable-sheet-styles.mjs → portable/portable-sheet-styles.mjs} +74 -11
- package/src/runtime/office/{portable-slide-shapes.mjs → portable/portable-slide-shapes.mjs} +8 -15
- package/src/runtime/office/{portable-snapshot.mjs → portable/portable-snapshot.mjs} +254 -27
- package/src/runtime/office/{portable-soffice.mjs → portable/portable-soffice.mjs} +45 -1
- package/src/runtime/office/{portable-validation.mjs → portable/portable-validation.mjs} +73 -34
- package/src/runtime/office/{portable-xlsx.mjs → portable/portable-xlsx.mjs} +3 -1
- package/src/runtime/office/{portable-xml.mjs → portable/portable-xml.mjs} +20 -0
- package/src/runtime/office/portable/pptx-relations.mjs +92 -0
- package/src/runtime/office/portable/pptx-targets.mjs +30 -0
- package/src/runtime/office/portable/review-editability.mjs +111 -0
- package/src/runtime/office/{text-metrics.mjs → portable/text-metrics.mjs} +232 -28
- package/src/runtime/office/{xlsx-assertions.mjs → portable/xlsx-assertions.mjs} +5 -21
- package/src/runtime/office/portable/xlsx-audit-support.mjs +132 -0
- package/src/runtime/office/{xlsx-contract.mjs → portable/xlsx-contract.mjs} +50 -12
- package/src/runtime/office/portable/xlsx-conventions.mjs +75 -0
- package/src/runtime/office/portable/xlsx-formula-audit.mjs +247 -0
- package/src/runtime/office/portable/xlsx-sheet-hygiene.mjs +100 -0
- package/src/runtime/office/quality/assurance-checklist.mjs +185 -0
- package/src/runtime/office/quality/assurance-rendered.mjs +167 -0
- package/src/runtime/office/quality/assurance-structure.mjs +440 -0
- package/src/runtime/office/quality/assurance-trust.mjs +246 -0
- package/src/runtime/office/quality/assurance.mjs +11 -0
- package/src/runtime/office/quality/design-aesthetics-metrics.mjs +271 -0
- package/src/runtime/office/quality/design-aesthetics.mjs +285 -0
- package/src/runtime/office/{design-deck-diversity.mjs → quality/design-deck-diversity.mjs} +31 -1
- package/src/runtime/office/quality/design-review-authored.mjs +113 -0
- package/src/runtime/office/quality/design-review-critique.mjs +120 -0
- package/src/runtime/office/{design-review.mjs → quality/design-review.mjs} +167 -123
- package/src/runtime/office/quality/inline-audit.mjs +139 -0
- package/src/runtime/office/quality/pptx-deck-rubric.mjs +93 -0
- package/src/runtime/office/quality/pptx-slide-roles.mjs +136 -0
- package/src/runtime/office/quality/quality-pipeline.mjs +280 -0
- package/src/runtime/office/{quality-score.mjs → quality/quality-score.mjs} +2 -4
- package/src/runtime/office/quality/render-air.mjs +114 -0
- package/src/runtime/office/shared/asar-path.mjs +5 -0
- package/src/runtime/office/shared/values.mjs +32 -0
- package/src/runtime/office/tool-defs.mjs +35 -29
- package/src/runtime/shared/agent-route-config.mjs +3 -3
- package/src/runtime/shared/atomic-file.mjs +27 -20
- package/src/runtime/shared/background-tasks.mjs +2 -37
- package/src/runtime/shared/boot-profile.mjs +26 -0
- package/src/runtime/shared/bounded-download.mjs +40 -0
- package/src/runtime/shared/bridge-tool-args.mjs +1 -1
- package/src/runtime/shared/buffered-appender.mjs +1 -1
- package/src/runtime/shared/child-guardian.mjs +1 -5
- package/src/runtime/shared/child-spawn-gate.mjs +2 -2
- package/src/runtime/shared/clean.mjs +5 -0
- package/src/runtime/shared/config.mjs +8 -30
- package/src/runtime/shared/edit-tool-dialect.mjs +19 -6
- package/src/runtime/shared/env.mjs +41 -0
- package/src/runtime/shared/err-text.mjs +15 -5
- package/src/runtime/shared/error-presentation.mjs +101 -0
- package/src/runtime/shared/extension-scopes.mjs +139 -0
- package/src/runtime/shared/json-file.mjs +6 -0
- package/src/runtime/shared/llm/cost.mjs +2 -2
- package/src/runtime/shared/llm/http-agent.mjs +18 -6
- package/src/runtime/shared/markdown-frontmatter.mjs +2 -4
- package/src/runtime/shared/memory-snapshot.mjs +0 -4
- package/src/runtime/shared/native-asset.mjs +149 -0
- package/src/runtime/shared/numbers.mjs +12 -0
- package/src/runtime/shared/object.mjs +7 -0
- package/src/runtime/shared/owner-fair-gate.mjs +1 -5
- package/src/runtime/shared/plugin-manifest.mjs +44 -0
- package/src/runtime/shared/pristine-execution.mjs +4 -7
- package/src/runtime/shared/process-lifecycle.mjs +1 -5
- package/src/runtime/shared/resource-admission.mjs +4 -7
- package/src/runtime/shared/service-discovery.mjs +1 -22
- package/src/runtime/shared/session-runtime-health.mjs +15 -1
- package/src/runtime/shared/skill-document.mjs +36 -8
- package/src/runtime/shared/task-notification-envelope.mjs +0 -25
- package/src/runtime/shared/time-format.mjs +1 -1
- package/src/runtime/shared/tool-execution-contract.mjs +29 -7
- package/src/runtime/shared/tool-result-summary.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +21 -21
- package/src/runtime/shared/tool-workload-gates.mjs +1 -5
- package/src/runtime/shared/transcript-writer.mjs +5 -2
- package/src/runtime/shared/transport-error-text.mjs +128 -0
- package/src/runtime/shared/turn-snapshot-store.mjs +81 -7
- package/src/runtime/shared/turn-snapshot.mjs +147 -19
- package/src/runtime/shared/user-data-guard.mjs +1 -73
- package/src/runtime/web-search/lib/web-tools.mjs +0 -157
- package/src/session-runtime/agent-tool-routing.mjs +56 -0
- package/src/session-runtime/boot-profile.mjs +6 -18
- package/src/session-runtime/builtin-features.d.mts +8 -0
- package/src/session-runtime/builtin-features.mjs +42 -4
- package/src/session-runtime/config-helpers.mjs +1 -1
- package/src/session-runtime/context-status.mjs +44 -11
- package/src/session-runtime/effort.mjs +28 -32
- package/src/session-runtime/extension-scopes.mjs +94 -0
- package/src/session-runtime/fs-utils.mjs +1 -3
- package/src/session-runtime/goal-facade-api.mjs +52 -0
- package/src/session-runtime/goal-reminder.mjs +12 -5
- package/src/session-runtime/goal-runtime.mjs +196 -305
- package/src/session-runtime/goal-storage.mjs +60 -0
- package/src/session-runtime/goal-tasks.mjs +125 -0
- package/src/session-runtime/goal-text.mjs +8 -5
- package/src/session-runtime/goal-tool-defs.mjs +91 -0
- package/src/session-runtime/hitch-profile.mjs +1 -1
- package/src/session-runtime/hook-payload.mjs +32 -0
- package/src/session-runtime/internal-tool-executor.mjs +171 -0
- package/src/session-runtime/lifecycle-api.mjs +7 -2
- package/src/session-runtime/local-model-api.mjs +22 -0
- package/src/session-runtime/local-provider-settings.mjs +49 -0
- package/src/session-runtime/mcp-glue.mjs +8 -3
- package/src/session-runtime/model-capabilities.mjs +3 -15
- package/src/session-runtime/model-recency.mjs +3 -0
- package/src/session-runtime/model-route-api.mjs +26 -51
- package/src/session-runtime/native-teardown.mjs +42 -0
- package/src/session-runtime/notification-bus.mjs +13 -1
- package/src/session-runtime/plugin-mcp.mjs +9 -30
- package/src/session-runtime/provider-auth-api.mjs +2 -13
- package/src/session-runtime/provider-models.mjs +9 -0
- package/src/session-runtime/provider-readiness.mjs +131 -0
- package/src/session-runtime/provider-request-snapshot.mjs +0 -19
- package/src/session-runtime/resource-api.mjs +70 -3
- package/src/session-runtime/runtime-core.mjs +176 -705
- package/src/session-runtime/runtime-facade.mjs +112 -0
- package/src/session-runtime/runtime-modules.mjs +56 -0
- package/src/session-runtime/runtime-review-api.mjs +19 -0
- package/src/session-runtime/runtime-tunables.mjs +1 -1
- package/src/session-runtime/session-lifecycle.mjs +14 -4
- package/src/session-runtime/session-route-policy.mjs +26 -0
- package/src/session-runtime/session-text.mjs +3 -32
- package/src/session-runtime/session-turn-api.mjs +16 -4
- package/src/session-runtime/settings-api.mjs +56 -3
- package/src/session-runtime/setup-tool/executor.mjs +316 -0
- package/src/session-runtime/setup-tool/tool-defs.mjs +164 -0
- package/src/session-runtime/skills-api.mjs +39 -13
- package/src/session-runtime/tool-catalog-data.mjs +3 -2
- package/src/session-runtime/tool-catalog-schema.mjs +1 -16
- package/src/session-runtime/tool-catalog.mjs +0 -6
- package/src/session-runtime/tool-defs.mjs +1 -1
- package/src/session-runtime/tool-policy-refresh.mjs +4 -1
- package/src/session-runtime/tool-profile.mjs +1 -0
- package/src/session-runtime/tool-surface.mjs +2 -0
- package/src/session-runtime/workflow-agents-api.mjs +2 -1
- package/src/session-runtime/workflow.mjs +2 -2
- package/src/standalone/agent-tool/helpers.mjs +31 -7
- package/src/standalone/agent-tool/lead-worker-index.mjs +3 -27
- package/src/standalone/agent-tool/notify.mjs +1 -0
- package/src/standalone/agent-tool/worker-index.mjs +1 -25
- package/src/standalone/agent-tool.mjs +0 -24
- package/src/standalone/boot-phase-profiler.mjs +60 -0
- package/src/standalone/channel-admin.mjs +1 -42
- package/src/standalone/channel-transport.mjs +21 -4
- package/src/standalone/daemon-boot-coordinator.mjs +103 -0
- package/src/standalone/daemon.mjs +50 -46
- package/src/standalone/desktop-service-registry.mjs +226 -0
- package/src/standalone/fair-call-scheduler.mjs +1 -4
- package/src/standalone/hook-bus/config.mjs +1 -1
- package/src/standalone/hook-bus.mjs +11 -0
- package/src/standalone/plugin-admin.mjs +3 -15
- package/src/standalone/provider-admin.mjs +40 -53
- package/src/standalone/seeds.mjs +62 -18
- package/src/standalone/session-attachment-pool.mjs +127 -0
- package/src/standalone/session-client.mjs +53 -669
- package/src/standalone/session-protocol.mjs +12 -1
- package/src/standalone/session-proxy.mjs +538 -0
- package/src/standalone/session-runtime-inline-host.mjs +28 -11
- package/src/standalone/session-runtime-worker.mjs +13 -3
- package/src/standalone/session-service/agent-tree.mjs +477 -0
- package/src/standalone/session-service/project-catalog.mjs +86 -0
- package/src/standalone/session-service/projection.mjs +295 -0
- package/src/standalone/session-service-api.mjs +56 -0
- package/src/standalone/session-service.mjs +151 -1078
- package/src/standalone/session-state-projection.mjs +57 -0
- package/src/standalone/session-transport.mjs +44 -5
- package/src/standalone/session-wire-values.mjs +54 -0
- package/src/standalone/session-wire.mjs +1 -1
- package/src/standalone/usage-dashboard.mjs +3 -30
- package/src/tui/App.jsx +14 -0
- package/src/tui/app/app-format.mjs +5 -13
- package/src/tui/app/app-view.jsx +1 -0
- package/src/tui/app/extension-pickers.mjs +20 -4
- package/src/tui/app/input-parsers.mjs +3 -21
- package/src/tui/app/model-options.mjs +7 -5
- package/src/tui/app/prompt-submit.mjs +0 -18
- package/src/tui/app/provider-setup-picker.mjs +24 -76
- package/src/tui/app/transcript-row-estimate.mjs +0 -1
- package/src/tui/app/transcript-window.mjs +2 -13
- package/src/tui/app/use-transcript-scroll.mjs +1 -1
- package/src/tui/app/use-transcript-window.mjs +1 -1
- package/src/tui/components/PromptInput.jsx +4 -4
- package/src/tui/display-width.mjs +5 -6
- package/src/tui/dist/index.mjs +5349 -5096
- package/src/tui/index.jsx +4 -2
- package/src/tui/markdown/format-token.mjs +0 -5
- package/src/tui/markdown/streaming-markdown.mjs +2 -157
- package/src/tui/prompt-history-store.mjs +0 -13
- package/src/tui/session/agent-envelope.mjs +38 -5
- package/src/tui/session/agent-job-feed.mjs +8 -0
- package/src/tui/session/boot-profile.mjs +2 -14
- package/src/tui/session/context-state.mjs +0 -4
- package/src/tui/session/goal-continuation.mjs +1 -10
- package/src/tui/session/notification-plan.mjs +8 -0
- package/src/tui/session/render-frame-source.mjs +22 -0
- package/src/tui/session/render-timing.mjs +13 -3
- package/src/tui/session/session-api-ext.mjs +18 -9
- package/src/tui/session/session-api.mjs +28 -0
- package/src/tui/session/session-stats.mjs +7 -41
- package/src/tui/session/transcript-spill.mjs +2 -83
- package/src/tui/session/turn-aggregate-cards.mjs +252 -0
- package/src/tui/session/turn-deferred-cards.mjs +127 -0
- package/src/tui/session/turn.mjs +77 -379
- package/src/tui/session-local.mjs +19 -74
- package/src/ui/model-display.mjs +57 -1
- package/src/ui/statusline-agents.mjs +1 -5
- package/src/ui/statusline-segments.mjs +1 -5
- package/src/ui/statusline.mjs +16 -6
- package/src/ui/streaming-markdown-heal.mjs +147 -0
- package/src/vendor/statusline/bin/statusline-route.mjs +1 -1
- package/src/vendor/statusline/src/gateway/route-meta.mjs +1 -1
- package/src/workflows/default/WORKFLOW.md +5 -3
- package/src/workflows/solo/WORKFLOW.md +5 -3
- package/src/runtime/agent/orchestrator/agent-runtime/commit-message-completion.mjs +0 -67
- package/src/runtime/agent/orchestrator/providers/lib/env-utils.mjs +0 -15
- package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +0 -112
- package/src/runtime/agent/orchestrator/session/compact/handoff.mjs +0 -476
- package/src/runtime/agent/orchestrator/session/loop/env.mjs +0 -14
- package/src/runtime/agent/orchestrator/session/manager/env-utils.mjs +0 -8
- package/src/runtime/office/assurance.mjs +0 -962
- package/src/runtime/office/design-aesthetics.mjs +0 -460
- package/src/runtime/office/design-frontier-review.mjs +0 -129
- package/src/runtime/office/design-layout-grammar.mjs +0 -134
- package/src/runtime/office/design-pptx-executive.mjs +0 -335
- package/src/runtime/office/design-pptx-plan.mjs +0 -1002
- package/src/runtime/office/design-pptx-primitives.mjs +0 -87
- package/src/runtime/office/design-pptx-semantic-flow.mjs +0 -111
- package/src/runtime/office/design-pptx-semantic-visuals.mjs +0 -885
- package/src/runtime/office/design-pptx-stack.mjs +0 -58
- package/src/runtime/office/design-pptx.mjs +0 -776
- package/src/runtime/office/office-actions.mjs +0 -979
- package/src/runtime/office/pdf-adapter.mjs +0 -591
- package/src/runtime/office/pdf-analysis.mjs +0 -429
- package/src/runtime/office/quality-pipeline.mjs +0 -154
- package/src/session-runtime/env.mjs +0 -16
- package/vendor/ink/build/ansi-tokenizer.d.ts +0 -38
- package/vendor/ink/build/ansi-tokenizer.js +0 -316
- package/vendor/ink/build/ansi-tokenizer.js.map +0 -1
- package/vendor/ink/build/colorize.d.ts +0 -3
- package/vendor/ink/build/colorize.js +0 -48
- package/vendor/ink/build/colorize.js.map +0 -1
- package/vendor/ink/build/components/AccessibilityContext.d.ts +0 -3
- package/vendor/ink/build/components/AccessibilityContext.js +0 -5
- package/vendor/ink/build/components/AccessibilityContext.js.map +0 -1
- package/vendor/ink/build/components/AnimationContext.d.ts +0 -9
- package/vendor/ink/build/components/AnimationContext.js +0 -13
- package/vendor/ink/build/components/AnimationContext.js.map +0 -1
- package/vendor/ink/build/components/App.d.ts +0 -24
- package/vendor/ink/build/components/App.js +0 -608
- package/vendor/ink/build/components/App.js.map +0 -1
- package/vendor/ink/build/components/AppContext.d.ts +0 -80
- package/vendor/ink/build/components/AppContext.js +0 -25
- package/vendor/ink/build/components/AppContext.js.map +0 -1
- package/vendor/ink/build/components/BackgroundContext.d.ts +0 -4
- package/vendor/ink/build/components/BackgroundContext.js +0 -3
- package/vendor/ink/build/components/BackgroundContext.js.map +0 -1
- package/vendor/ink/build/components/Box.d.ts +0 -130
- package/vendor/ink/build/components/Box.js +0 -34
- package/vendor/ink/build/components/Box.js.map +0 -1
- package/vendor/ink/build/components/CursorContext.d.ts +0 -11
- package/vendor/ink/build/components/CursorContext.js +0 -8
- package/vendor/ink/build/components/CursorContext.js.map +0 -1
- package/vendor/ink/build/components/ErrorBoundary.d.ts +0 -18
- package/vendor/ink/build/components/ErrorBoundary.js +0 -23
- package/vendor/ink/build/components/ErrorBoundary.js.map +0 -1
- package/vendor/ink/build/components/ErrorOverview.d.ts +0 -6
- package/vendor/ink/build/components/ErrorOverview.js +0 -90
- package/vendor/ink/build/components/ErrorOverview.js.map +0 -1
- package/vendor/ink/build/components/FocusContext.d.ts +0 -16
- package/vendor/ink/build/components/FocusContext.js +0 -17
- package/vendor/ink/build/components/FocusContext.js.map +0 -1
- package/vendor/ink/build/components/Newline.d.ts +0 -13
- package/vendor/ink/build/components/Newline.js +0 -8
- package/vendor/ink/build/components/Newline.js.map +0 -1
- package/vendor/ink/build/components/Spacer.d.ts +0 -7
- package/vendor/ink/build/components/Spacer.js +0 -11
- package/vendor/ink/build/components/Spacer.js.map +0 -1
- package/vendor/ink/build/components/Static.d.ts +0 -24
- package/vendor/ink/build/components/Static.js +0 -28
- package/vendor/ink/build/components/Static.js.map +0 -1
- package/vendor/ink/build/components/StderrContext.d.ts +0 -15
- package/vendor/ink/build/components/StderrContext.js +0 -13
- package/vendor/ink/build/components/StderrContext.js.map +0 -1
- package/vendor/ink/build/components/StdinContext.d.ts +0 -28
- package/vendor/ink/build/components/StdinContext.js +0 -20
- package/vendor/ink/build/components/StdinContext.js.map +0 -1
- package/vendor/ink/build/components/StdoutContext.d.ts +0 -15
- package/vendor/ink/build/components/StdoutContext.js +0 -13
- package/vendor/ink/build/components/StdoutContext.js.map +0 -1
- package/vendor/ink/build/components/Text.d.ts +0 -55
- package/vendor/ink/build/components/Text.js +0 -50
- package/vendor/ink/build/components/Text.js.map +0 -1
- package/vendor/ink/build/components/Transform.d.ts +0 -16
- package/vendor/ink/build/components/Transform.js +0 -15
- package/vendor/ink/build/components/Transform.js.map +0 -1
- package/vendor/ink/build/cursor-helpers.d.ts +0 -39
- package/vendor/ink/build/cursor-helpers.js +0 -62
- package/vendor/ink/build/cursor-helpers.js.map +0 -1
- package/vendor/ink/build/devtools-window-polyfill.d.ts +0 -1
- package/vendor/ink/build/devtools-window-polyfill.js +0 -68
- package/vendor/ink/build/devtools-window-polyfill.js.map +0 -1
- package/vendor/ink/build/devtools.d.ts +0 -1
- package/vendor/ink/build/devtools.js +0 -36
- package/vendor/ink/build/devtools.js.map +0 -1
- package/vendor/ink/build/display-width.js +0 -96
- package/vendor/ink/build/dom.d.ts +0 -62
- package/vendor/ink/build/dom.js +0 -143
- package/vendor/ink/build/dom.js.map +0 -1
- package/vendor/ink/build/get-max-width.d.ts +0 -3
- package/vendor/ink/build/get-max-width.js +0 -10
- package/vendor/ink/build/get-max-width.js.map +0 -1
- package/vendor/ink/build/hooks/use-animation.d.ts +0 -49
- package/vendor/ink/build/hooks/use-animation.js +0 -87
- package/vendor/ink/build/hooks/use-animation.js.map +0 -1
- package/vendor/ink/build/hooks/use-app.d.ts +0 -5
- package/vendor/ink/build/hooks/use-app.js +0 -8
- package/vendor/ink/build/hooks/use-app.js.map +0 -1
- package/vendor/ink/build/hooks/use-box-metrics.d.ts +0 -59
- package/vendor/ink/build/hooks/use-box-metrics.js +0 -81
- package/vendor/ink/build/hooks/use-box-metrics.js.map +0 -1
- package/vendor/ink/build/hooks/use-cursor.d.ts +0 -12
- package/vendor/ink/build/hooks/use-cursor.js +0 -29
- package/vendor/ink/build/hooks/use-cursor.js.map +0 -1
- package/vendor/ink/build/hooks/use-focus-manager.d.ts +0 -43
- package/vendor/ink/build/hooks/use-focus-manager.js +0 -18
- package/vendor/ink/build/hooks/use-focus-manager.js.map +0 -1
- package/vendor/ink/build/hooks/use-focus.d.ts +0 -30
- package/vendor/ink/build/hooks/use-focus.js +0 -43
- package/vendor/ink/build/hooks/use-focus.js.map +0 -1
- package/vendor/ink/build/hooks/use-input.d.ts +0 -132
- package/vendor/ink/build/hooks/use-input.js +0 -126
- package/vendor/ink/build/hooks/use-input.js.map +0 -1
- package/vendor/ink/build/hooks/use-is-screen-reader-enabled.d.ts +0 -6
- package/vendor/ink/build/hooks/use-is-screen-reader-enabled.js +0 -12
- package/vendor/ink/build/hooks/use-is-screen-reader-enabled.js.map +0 -1
- package/vendor/ink/build/hooks/use-paste.d.ts +0 -35
- package/vendor/ink/build/hooks/use-paste.js +0 -62
- package/vendor/ink/build/hooks/use-paste.js.map +0 -1
- package/vendor/ink/build/hooks/use-stderr.d.ts +0 -5
- package/vendor/ink/build/hooks/use-stderr.js +0 -8
- package/vendor/ink/build/hooks/use-stderr.js.map +0 -1
- package/vendor/ink/build/hooks/use-stdin.d.ts +0 -7
- package/vendor/ink/build/hooks/use-stdin.js +0 -9
- package/vendor/ink/build/hooks/use-stdin.js.map +0 -1
- package/vendor/ink/build/hooks/use-stdout.d.ts +0 -5
- package/vendor/ink/build/hooks/use-stdout.js +0 -8
- package/vendor/ink/build/hooks/use-stdout.js.map +0 -1
- package/vendor/ink/build/hooks/use-window-size.d.ts +0 -18
- package/vendor/ink/build/hooks/use-window-size.js +0 -22
- package/vendor/ink/build/hooks/use-window-size.js.map +0 -1
- package/vendor/ink/build/index.d.ts +0 -42
- package/vendor/ink/build/index.js +0 -24
- package/vendor/ink/build/index.js.map +0 -1
- package/vendor/ink/build/ink.d.ts +0 -146
- package/vendor/ink/build/ink.js +0 -1287
- package/vendor/ink/build/ink.js.map +0 -1
- package/vendor/ink/build/input-parser.d.ts +0 -15
- package/vendor/ink/build/input-parser.js +0 -63
- package/vendor/ink/build/input-parser.js.map +0 -1
- package/vendor/ink/build/instances.d.ts +0 -3
- package/vendor/ink/build/instances.js +0 -8
- package/vendor/ink/build/instances.js.map +0 -1
- package/vendor/ink/build/kitty-keyboard.d.ts +0 -23
- package/vendor/ink/build/kitty-keyboard.js +0 -32
- package/vendor/ink/build/kitty-keyboard.js.map +0 -1
- package/vendor/ink/build/log-update.d.ts +0 -20
- package/vendor/ink/build/log-update.js +0 -320
- package/vendor/ink/build/log-update.js.map +0 -1
- package/vendor/ink/build/measure-element.d.ts +0 -20
- package/vendor/ink/build/measure-element.js +0 -13
- package/vendor/ink/build/measure-element.js.map +0 -1
- package/vendor/ink/build/measure-text.d.ts +0 -6
- package/vendor/ink/build/measure-text.js +0 -24
- package/vendor/ink/build/measure-text.js.map +0 -1
- package/vendor/ink/build/output.d.ts +0 -35
- package/vendor/ink/build/output.js +0 -567
- package/vendor/ink/build/output.js.map +0 -1
- package/vendor/ink/build/parse-keypress.d.ts +0 -20
- package/vendor/ink/build/parse-keypress.js +0 -495
- package/vendor/ink/build/parse-keypress.js.map +0 -1
- package/vendor/ink/build/reconciler.d.ts +0 -4
- package/vendor/ink/build/reconciler.js +0 -306
- package/vendor/ink/build/reconciler.js.map +0 -1
- package/vendor/ink/build/render-background.d.ts +0 -4
- package/vendor/ink/build/render-background.js +0 -25
- package/vendor/ink/build/render-background.js.map +0 -1
- package/vendor/ink/build/render-border.d.ts +0 -4
- package/vendor/ink/build/render-border.js +0 -84
- package/vendor/ink/build/render-border.js.map +0 -1
- package/vendor/ink/build/render-node-to-output.d.ts +0 -14
- package/vendor/ink/build/render-node-to-output.js +0 -207
- package/vendor/ink/build/render-node-to-output.js.map +0 -1
- package/vendor/ink/build/render-to-string.d.ts +0 -38
- package/vendor/ink/build/render-to-string.js +0 -116
- package/vendor/ink/build/render-to-string.js.map +0 -1
- package/vendor/ink/build/render.d.ts +0 -176
- package/vendor/ink/build/render.js +0 -84
- package/vendor/ink/build/render.js.map +0 -1
- package/vendor/ink/build/renderer.d.ts +0 -8
- package/vendor/ink/build/renderer.js +0 -67
- package/vendor/ink/build/renderer.js.map +0 -1
- package/vendor/ink/build/sanitize-ansi.d.ts +0 -2
- package/vendor/ink/build/sanitize-ansi.js +0 -27
- package/vendor/ink/build/sanitize-ansi.js.map +0 -1
- package/vendor/ink/build/selection-rect.js +0 -80
- package/vendor/ink/build/squash-text-nodes.d.ts +0 -3
- package/vendor/ink/build/squash-text-nodes.js +0 -36
- package/vendor/ink/build/squash-text-nodes.js.map +0 -1
- package/vendor/ink/build/styles.d.ts +0 -302
- package/vendor/ink/build/styles.js +0 -303
- package/vendor/ink/build/styles.js.map +0 -1
- package/vendor/ink/build/termio-keypress.js +0 -271
- package/vendor/ink/build/termio-tokenize.js +0 -188
- package/vendor/ink/build/utils.d.ts +0 -9
- package/vendor/ink/build/utils.js +0 -19
- package/vendor/ink/build/utils.js.map +0 -1
- package/vendor/ink/build/wrap-text.d.ts +0 -5
- package/vendor/ink/build/wrap-text.js +0 -204
- package/vendor/ink/build/wrap-text.js.map +0 -1
- package/vendor/ink/build/write-synchronized.d.ts +0 -4
- package/vendor/ink/build/write-synchronized.js +0 -9
- package/vendor/ink/build/write-synchronized.js.map +0 -1
- package/vendor/ink/license +0 -10
- package/vendor/ink/package.json +0 -137
- /package/src/runtime/office/{office-documents.mjs → core/office-documents.mjs} +0 -0
- /package/src/runtime/office/{pagination.mjs → core/pagination.mjs} +0 -0
- /package/src/runtime/office/{design-docx-components.mjs → design/docx/design-docx-components.mjs} +0 -0
- /package/src/runtime/office/{templates → design/library/templates}/mixdog-executive.pptx +0 -0
- /package/src/runtime/office/{templates → design/library/templates}/mixdog-executive.pptx.mixdog.json +0 -0
- /package/src/runtime/office/{image-layout.mjs → portable/image-layout.mjs} +0 -0
- /package/src/runtime/office/{portable-ooxml.mjs → portable/portable-ooxml.mjs} +0 -0
- /package/src/runtime/office/{portable-pptx-deck.mjs → portable/portable-pptx-deck.mjs} +0 -0
- /package/src/runtime/office/{portable-sheet-parts.mjs → portable/portable-sheet-parts.mjs} +0 -0
- /package/src/runtime/office/{portable-sheet-xml.mjs → portable/portable-sheet-xml.mjs} +0 -0
- /package/src/runtime/office/{visual-diff.mjs → quality/visual-diff.mjs} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdtemp, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { PDFDocument, degrees } from 'pdf-lib';
|
|
6
|
+
import { applyPdfBatch } from '../src/runtime/office/pdf/pdf-adapter.mjs';
|
|
7
|
+
import { extractPdfTextLayout, findPdfText } from '../src/runtime/office/pdf/pdf-analysis.mjs';
|
|
8
|
+
|
|
9
|
+
// Deterministic differential stress: compare search-derived PDF marks with
|
|
10
|
+
// the coordinates used to draw the source, varying page rotation and boxes.
|
|
11
|
+
// This is opt-in and never runs as part of the default unit suite.
|
|
12
|
+
const until = Date.parse(process.argv[2] || '');
|
|
13
|
+
assert.ok(Number.isFinite(until), 'Pass an ISO end time');
|
|
14
|
+
const directory = await mkdtemp(join(tmpdir(), 'pdf-rotation-stress-'));
|
|
15
|
+
const path = join(directory, 'latest.pdf');
|
|
16
|
+
let state = 0x5eed2026;
|
|
17
|
+
const random = () => {
|
|
18
|
+
state = (Math.imul(state, 1664525) + 1013904223) >>> 0;
|
|
19
|
+
return state / 0x100000000;
|
|
20
|
+
};
|
|
21
|
+
const between = (min, max) => min + random() * (max - min);
|
|
22
|
+
let rounds = 0;
|
|
23
|
+
let pagesChecked = 0;
|
|
24
|
+
let nextReport = Date.now();
|
|
25
|
+
do {
|
|
26
|
+
const pdf = await PDFDocument.create();
|
|
27
|
+
const font = await pdf.embedFont('Helvetica');
|
|
28
|
+
const expected = [];
|
|
29
|
+
for (let index = 0; index < 16; index += 1) {
|
|
30
|
+
const width = between(400, 700);
|
|
31
|
+
const height = between(350, 800);
|
|
32
|
+
const originX = between(-100, 150);
|
|
33
|
+
const originY = between(-100, 150);
|
|
34
|
+
const page = pdf.addPage([width, height]);
|
|
35
|
+
page.setMediaBox(originX, originY, width, height);
|
|
36
|
+
page.setCropBox(originX + 10, originY + 10, width - 20, height - 20);
|
|
37
|
+
page.setRotation(degrees([0, 90, 180, 270][index % 4]));
|
|
38
|
+
const size = between(9, 30);
|
|
39
|
+
const x = originX + 40;
|
|
40
|
+
const y = originY + height - 80;
|
|
41
|
+
const prefix = font.widthOfTextAtSize('Al', size);
|
|
42
|
+
// Separate text runs exercise joining in reversed as well as upright text.
|
|
43
|
+
page.drawText('Alpha', { x, y, size, font });
|
|
44
|
+
page.drawText('beta', { x: x + font.widthOfTextAtSize('Alpha ', size), y, size, font });
|
|
45
|
+
expected.push({ x: x + prefix, y, width: font.widthOfTextAtSize('pha beta', size), height: size });
|
|
46
|
+
}
|
|
47
|
+
await writeFile(path, await pdf.save());
|
|
48
|
+
const results = await applyPdfBatch(path, [
|
|
49
|
+
{ op: 'highlight', find: 'pha beta' },
|
|
50
|
+
{ op: 'add_link', find: 'pha beta', toPage: 1 },
|
|
51
|
+
{ op: 'add_text', text: 'After measurement', page: 1, x: 40, y: 40, size: 10 },
|
|
52
|
+
]);
|
|
53
|
+
for (const result of results.slice(0, 2)) {
|
|
54
|
+
assert.equal(result.boxes.length, expected.length);
|
|
55
|
+
for (const box of result.boxes) {
|
|
56
|
+
for (const key of ['x', 'y', 'width', 'height']) {
|
|
57
|
+
assert.ok(Math.abs(box[key] - expected[box.page - 1][key]) < 0.08,
|
|
58
|
+
JSON.stringify({ round: rounds, state, key, box, expected: expected[box.page - 1], path }));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const layout = await extractPdfTextLayout(path, { shapes: false });
|
|
63
|
+
assert.equal(findPdfText(layout, 'pha beta').matchCount, expected.length);
|
|
64
|
+
const saved = await PDFDocument.load(await readFile(path));
|
|
65
|
+
assert.deepEqual(saved.getPages().map((page) => page.getRotation().angle),
|
|
66
|
+
expected.map((_, index) => [0, 90, 180, 270][index % 4]));
|
|
67
|
+
rounds += 1;
|
|
68
|
+
pagesChecked += expected.length;
|
|
69
|
+
if (Date.now() >= nextReport) {
|
|
70
|
+
console.log(JSON.stringify({ rounds, pagesChecked, rssMB: Math.round(process.memoryUsage().rss / 1024 / 1024) }));
|
|
71
|
+
nextReport = Date.now() + 60_000;
|
|
72
|
+
}
|
|
73
|
+
} while (Date.now() < until);
|
|
74
|
+
console.log(JSON.stringify({ ok: true, rounds, pagesChecked, directory }));
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Exercise production orchestration with injected, non-network dependencies.
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtempSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { performance } from 'node:perf_hooks';
|
|
7
|
+
import { setImmediate as immediate } from 'node:timers/promises';
|
|
8
|
+
|
|
9
|
+
const directory = mkdtempSync(join(tmpdir(), 'mixdog-cold-reconnect-'));
|
|
10
|
+
process.env.MIXDOG_RUNTIME_ROOT = directory;
|
|
11
|
+
process.env.MIXDOG_DATA_DIR = directory;
|
|
12
|
+
process.env.MIXDOG_DISABLE_MCP = '0';
|
|
13
|
+
const started = performance.now();
|
|
14
|
+
const { createProviderModels } = await import('../../src/session-runtime/provider-models.mjs');
|
|
15
|
+
const { createProviderAuthApi } = await import('../../src/session-runtime/provider-auth-api.mjs');
|
|
16
|
+
const { createMcpGlue } = await import('../../src/session-runtime/mcp-glue.mjs');
|
|
17
|
+
const importMs = performance.now() - started;
|
|
18
|
+
let catalogCalls = 0, revision = 987654;
|
|
19
|
+
const registry = {
|
|
20
|
+
providerCatalogRevision: () => revision,
|
|
21
|
+
getAllProviders: () => new Map([['openai', {
|
|
22
|
+
listModels: async () => {
|
|
23
|
+
catalogCalls++;
|
|
24
|
+
await immediate();
|
|
25
|
+
return [{ id: 'synthetic-model', name: 'Synthetic model', contextWindow: 128000 }];
|
|
26
|
+
},
|
|
27
|
+
}]]),
|
|
28
|
+
};
|
|
29
|
+
const createModels = () => createProviderModels({
|
|
30
|
+
caches: { providerModelsCache: { models: null }, providerModelsLoadSeq: 0,
|
|
31
|
+
webSearchProviderModelsCache: { models: null } },
|
|
32
|
+
modelMetaByRoute: new Map(), getRoute: () => ({ provider: 'openai' }),
|
|
33
|
+
getConfig: () => ({}), getReg: () => registry, webSearchCapableFor: () => false,
|
|
34
|
+
sortProviderModelsRaw: rows => rows,
|
|
35
|
+
providerModelCacheRowRaw: (provider, row) => ({ ...row, provider }),
|
|
36
|
+
normalizeWebSearchProviderId: value => value, isWebSearchCapableProvider: () => false,
|
|
37
|
+
ensureFullConfig() {}, awaitKeychainPrewarm: async () => {},
|
|
38
|
+
ensureProvidersReady: async () => {}, bootProfile() {}, scheduleProviderModelWarmup() {},
|
|
39
|
+
quickHelpers: { quickProviderModelRows: () => [{ id: 'quick' }] },
|
|
40
|
+
});
|
|
41
|
+
const sessions = Array.from({ length: 8 }, createModels);
|
|
42
|
+
let start = performance.now();
|
|
43
|
+
const cold = await Promise.all(sessions.map(api => api.collectProviderModels()));
|
|
44
|
+
const catalogColdMs = performance.now() - start;
|
|
45
|
+
assert.ok(cold.every(rows => rows.length === 1));
|
|
46
|
+
assert.equal(catalogCalls, 1);
|
|
47
|
+
start = performance.now();
|
|
48
|
+
await Promise.all(sessions.map(api => api.collectProviderModels()));
|
|
49
|
+
const catalogWarmMs = performance.now() - start;
|
|
50
|
+
assert.equal(catalogCalls, 1);
|
|
51
|
+
revision++;
|
|
52
|
+
await Promise.all(sessions.map(api => api.collectProviderModels()));
|
|
53
|
+
assert.equal(catalogCalls, 2);
|
|
54
|
+
|
|
55
|
+
let releaseSecrets, ready = false;
|
|
56
|
+
const secrets = new Promise(resolve => { releaseSecrets = resolve; });
|
|
57
|
+
const auth = createProviderAuthApi({
|
|
58
|
+
awaitKeychainPrewarm: () => secrets,
|
|
59
|
+
isKeychainPrewarmReady: () => ready,
|
|
60
|
+
hasProviderSetupCached: () => ready,
|
|
61
|
+
cachedProviderSetup: async options => ({ source: options.quick ? 'quick' : 'authoritative' }),
|
|
62
|
+
});
|
|
63
|
+
start = performance.now();
|
|
64
|
+
const quickAuth = await auth.getProviderSetup();
|
|
65
|
+
const pendingAuthMs = performance.now() - start;
|
|
66
|
+
assert.equal(quickAuth.pendingSecrets, true);
|
|
67
|
+
assert.equal(quickAuth.source, 'quick');
|
|
68
|
+
ready = true;
|
|
69
|
+
releaseSecrets();
|
|
70
|
+
await immediate();
|
|
71
|
+
assert.equal((await auth.getProviderSetup()).source, 'authoritative');
|
|
72
|
+
|
|
73
|
+
let releaseConnect;
|
|
74
|
+
let active = 0, maxActive = 0, config = { mcpServers: { first: { command: 'synthetic' } } };
|
|
75
|
+
const connected = [];
|
|
76
|
+
const gate = new Promise(resolve => { releaseConnect = resolve; });
|
|
77
|
+
const state = { mcpConnectGeneration: 0, mcpConnectInFlight: null, mcpFailures: [] };
|
|
78
|
+
const mcp = createMcpGlue({
|
|
79
|
+
state, getConfig: () => config, getCurrentCwd: () => directory,
|
|
80
|
+
mcpClient: {
|
|
81
|
+
resolveMcpTransportKind: () => 'stdio', getMcpServerStatus: () => [],
|
|
82
|
+
resolveMcpStartupTimeoutMs: () => 10000, disconnectAll: async () => {},
|
|
83
|
+
connectMcpServers: async servers => {
|
|
84
|
+
maxActive = Math.max(maxActive, ++active);
|
|
85
|
+
await gate;
|
|
86
|
+
connected.push(Object.keys(servers));
|
|
87
|
+
active--;
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
const initial = mcp.connectConfiguredMcp();
|
|
92
|
+
start = performance.now();
|
|
93
|
+
await mcp.awaitInitialMcpConnect(15);
|
|
94
|
+
const mcpBoundedWaitMs = performance.now() - start;
|
|
95
|
+
assert.equal(active, 1);
|
|
96
|
+
const obsolete = mcp.connectConfiguredMcp({ reset: true });
|
|
97
|
+
config = { mcpServers: { latest: { command: 'synthetic' } } };
|
|
98
|
+
const latest = mcp.connectConfiguredMcp({ reset: true });
|
|
99
|
+
releaseConnect();
|
|
100
|
+
await Promise.all([initial, obsolete, latest]);
|
|
101
|
+
assert.equal(maxActive, 1);
|
|
102
|
+
assert.deepEqual(connected, [['first'], ['latest']]);
|
|
103
|
+
assert.equal(state.mcpConnectInFlight, null);
|
|
104
|
+
const report = { directory, importMs, catalogColdMs, catalogWarmMs, pendingAuthMs,
|
|
105
|
+
catalogCallsForEightSessionsBeforeAndAfterInvalidation: catalogCalls, mcpBoundedWaitMs,
|
|
106
|
+
maxConcurrentMcpConnections: maxActive, connected,
|
|
107
|
+
limits: 'Injected model lists, keychain and MCP: validates orchestration, not external network/keychain latency.' };
|
|
108
|
+
writeFileSync(join(directory, 'report.json'), JSON.stringify(report, null, 2));
|
|
109
|
+
console.log(JSON.stringify(report, null, 2));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Frozen pre-optimization reference for differential tests and local probes.
|
|
2
|
+
// This is deliberately not imported by product code.
|
|
3
|
+
export function legacyTokenFloors(s) {
|
|
4
|
+
let floor = 0;
|
|
5
|
+
for (const match of s.matchAll(/[\x21-\x7e]{16,}/g)) {
|
|
6
|
+
floor += match[0].length * (match[0].length >= 64 ? 0.65 : 0.5);
|
|
7
|
+
}
|
|
8
|
+
const words = s.match(/\b(?=[A-Za-z0-9]{8,}\b)(?=[A-Za-z0-9]*[A-Za-z])(?=[A-Za-z0-9]*\d)[A-Za-z0-9]+\b/g) || [];
|
|
9
|
+
if (words.length >= 3) {
|
|
10
|
+
const chars = words.reduce((sum, word) => sum + word.length, 0);
|
|
11
|
+
floor = Math.max(floor, chars * 0.5 + (s.length - chars) * 0.25);
|
|
12
|
+
}
|
|
13
|
+
const lines = s.split(/\r?\n/).filter(line => line.trim());
|
|
14
|
+
const nonWhitespace = s.match(/\S/g)?.length || 0;
|
|
15
|
+
const structural = s.match(/[\[\]{}":,=<>|\\]/g)?.length || 0;
|
|
16
|
+
const jsonLines = lines.filter(line => /^\s*[\[{].*[\]}],?\s*$/.test(line)).length;
|
|
17
|
+
if (lines.length >= 3 && nonWhitespace > 0
|
|
18
|
+
&& (jsonLines >= Math.ceil(lines.length / 2) || structural / nonWhitespace >= 0.12)) {
|
|
19
|
+
floor = Math.max(floor, nonWhitespace * 0.5 + (s.length - nonWhitespace) * 0.25);
|
|
20
|
+
}
|
|
21
|
+
return floor;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const text = item => typeof item.text === 'string' ? item.text : item.text == null ? '' : String(item.text);
|
|
25
|
+
const ownsId = item => item.id !== undefined && item.id !== null;
|
|
26
|
+
const signature = item => [item.kind, item.status, item.label, item.tone, item.verb,
|
|
27
|
+
item.count, item.completedCount, item.detail].map(value => String(value ?? '')).join('\u0001');
|
|
28
|
+
|
|
29
|
+
export function legacyAlignment(previous, incoming) {
|
|
30
|
+
let best = null;
|
|
31
|
+
for (let offset = 0; offset < previous.length; offset++) {
|
|
32
|
+
const span = Math.min(previous.length - offset, incoming.length);
|
|
33
|
+
let overlap = 0, idMatches = 0, strongMatches = 0;
|
|
34
|
+
for (; overlap < span; overlap++) {
|
|
35
|
+
const a = previous[offset + overlap], b = incoming[overlap];
|
|
36
|
+
const at = text(a), bt = text(b);
|
|
37
|
+
const compatible = a.kind === b.kind && (a.kind === 'tool'
|
|
38
|
+
? String(a.name ?? '') === String(b.name ?? '')
|
|
39
|
+
: a.kind === 'user' || a.kind === 'assistant'
|
|
40
|
+
? at === bt || (at.length > 0 && bt.length > 0 && (at.startsWith(bt) || bt.startsWith(at)))
|
|
41
|
+
: true);
|
|
42
|
+
if (a !== b && !compatible) break;
|
|
43
|
+
if (ownsId(a) && ownsId(b) && String(a.id) === String(b.id)) idMatches++;
|
|
44
|
+
if (a === b || (a.kind === b.kind && at === bt
|
|
45
|
+
&& String(a.name ?? '') === String(b.name ?? '') && signature(a) === signature(b))) strongMatches++;
|
|
46
|
+
}
|
|
47
|
+
if (!overlap || overlap !== span) continue;
|
|
48
|
+
const candidate = { offset, overlap, idMatches, strongMatches, endsAtBaselineTail: offset + overlap === previous.length };
|
|
49
|
+
const rank = item => [item.overlap, item.idMatches, item.strongMatches,
|
|
50
|
+
Number(item.endsAtBaselineTail), incoming.length < previous.length ? item.offset : -item.offset];
|
|
51
|
+
const a = rank(candidate), b = best && rank(best);
|
|
52
|
+
const different = b ? a.findIndex((value, index) => value !== b[index]) : -1;
|
|
53
|
+
if (!best || (different >= 0 && a[different] > b[different])) best = candidate;
|
|
54
|
+
}
|
|
55
|
+
return best;
|
|
56
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Isolated synthetic histories only: no live daemon, credentials or model calls.
|
|
2
|
+
import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { performance } from 'node:perf_hooks';
|
|
6
|
+
import { setImmediate as immediate } from 'node:timers/promises';
|
|
7
|
+
import { legacyTokenFloors } from './transcript-baseline.mjs';
|
|
8
|
+
import { denseTokenFloor, structuredTokenFloor } from '../../src/runtime/agent/orchestrator/session/token-estimate-floors.mjs';
|
|
9
|
+
import { estimateMessagesTokens, summarizeContextMessages } from '../../src/runtime/agent/orchestrator/session/context-utils.mjs';
|
|
10
|
+
import { readTopLevelLifecycleRecord } from '../../src/runtime/agent/orchestrator/session/lifecycle-scan.mjs';
|
|
11
|
+
import { createCanonicalSessionReader } from '../../src/runtime/agent/orchestrator/session/store/canonical-reader.mjs';
|
|
12
|
+
import { yieldToRenderer } from '../../src/tui/session/render-timing.mjs';
|
|
13
|
+
|
|
14
|
+
const directory = mkdtempSync(join(tmpdir(), 'mixdog-transcript-perf-'));
|
|
15
|
+
const messages = Array.from({ length: 1000 }, (_, i) => ({
|
|
16
|
+
role: i % 2 ? 'assistant' : 'user', content: `message ${i}\n${'ordinary content with spaces '.repeat(280)}`,
|
|
17
|
+
}));
|
|
18
|
+
const raw = JSON.stringify({ id: 'synthetic', closed: false, generation: 1, messages });
|
|
19
|
+
const target = join(directory, 'synthetic.json');
|
|
20
|
+
writeFileSync(target, raw);
|
|
21
|
+
const currentReader = createCanonicalSessionReader();
|
|
22
|
+
const oldReader = () => readTopLevelLifecycleRecord(readFileSync(target, 'utf8'));
|
|
23
|
+
const currentFloors = value => Math.max(denseTokenFloor(value), structuredTokenFloor(value));
|
|
24
|
+
const median = values => [...values].sort((a, b) => a - b)[Math.floor(values.length / 2)];
|
|
25
|
+
const timed = async (name, action, repetitions = 5) => {
|
|
26
|
+
const samples = [];
|
|
27
|
+
for (let i = 0; i < repetitions; i++) {
|
|
28
|
+
globalThis.gc?.();
|
|
29
|
+
const start = performance.now();
|
|
30
|
+
await action();
|
|
31
|
+
samples.push(performance.now() - start);
|
|
32
|
+
}
|
|
33
|
+
return { name, medianMs: +median(samples).toFixed(3), samplesMs: samples.map(n => +n.toFixed(3)) };
|
|
34
|
+
};
|
|
35
|
+
const results = [];
|
|
36
|
+
results.push(await timed('token-floors-before', () => messages.forEach(m => legacyTokenFloors(m.content))));
|
|
37
|
+
results.push(await timed('token-floors-after', () => messages.forEach(m => currentFloors(m.content))));
|
|
38
|
+
results.push(await timed('full-token-meter-after', () => estimateMessagesTokens(messages)));
|
|
39
|
+
results.push(await timed('context-summary-cold-after', () => summarizeContextMessages(structuredClone(messages))));
|
|
40
|
+
summarizeContextMessages(messages);
|
|
41
|
+
results.push(await timed('context-summary-warm-after', () => summarizeContextMessages(messages)));
|
|
42
|
+
results.push(await timed('canonical-before', oldReader));
|
|
43
|
+
currentReader(target, true);
|
|
44
|
+
results.push(await timed('canonical-warm-after', () => currentReader(target, true)));
|
|
45
|
+
results.push(await timed('headless-render-yield-after', () => yieldToRenderer()));
|
|
46
|
+
// An independent queued session callback shares the SAME event loop with the
|
|
47
|
+
// heavy operation. Its delay attributes interference directly to this batch,
|
|
48
|
+
// unlike a live daemon's unrelated maximum event-loop observation.
|
|
49
|
+
for (const [name, action] of [
|
|
50
|
+
['shared-loop-before', () => { messages.forEach(m => legacyTokenFloors(m.content)); oldReader(); }],
|
|
51
|
+
['shared-loop-after', () => { messages.forEach(m => currentFloors(m.content)); currentReader(target, true); }],
|
|
52
|
+
]) {
|
|
53
|
+
results.push(await timed(name, async () => {
|
|
54
|
+
const otherSession = immediate();
|
|
55
|
+
action();
|
|
56
|
+
await otherSession;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
const report = { bytes: Buffer.byteLength(raw), messageCount: messages.length, directory, results,
|
|
60
|
+
limits: 'Synthetic same-event-loop contention, not attribution of the prior live 502ms event.' };
|
|
61
|
+
writeFileSync(join(directory, 'report.json'), JSON.stringify(report, null, 2));
|
|
62
|
+
console.log(JSON.stringify(report, null, 2));
|
|
@@ -28,48 +28,22 @@ export const DESKTOP_GATE_SCRIPT_BASES = [
|
|
|
28
28
|
'scripts/runtime-dependency-cache-key',
|
|
29
29
|
];
|
|
30
30
|
|
|
31
|
-
// Prefixes whose changes require the runtime gate
|
|
32
|
-
//
|
|
31
|
+
// Prefixes whose changes require the runtime gate. The gate runs the
|
|
32
|
+
// discovered default lane (scripts/test.mjs: every test file under src/ and
|
|
33
|
+
// scripts/), so any change under those roots is a candidate.
|
|
33
34
|
export const RUNTIME_GATE_PREFIXES = [
|
|
34
35
|
'.github/workflows/',
|
|
35
36
|
'native/',
|
|
36
|
-
'scripts/
|
|
37
|
-
'src/
|
|
38
|
-
'src/runtime/shared/',
|
|
37
|
+
'scripts/',
|
|
38
|
+
'src/',
|
|
39
39
|
];
|
|
40
40
|
|
|
41
|
-
// Everything `npm run test:release-critical` executes
|
|
42
|
-
// (test:release-assets + smoke:patch + test:providers).
|
|
43
|
-
export const RELEASE_CRITICAL_SCRIPTS = [
|
|
44
|
-
'scripts/verify-release-assets.mjs',
|
|
45
|
-
'scripts/release-gate-test.mjs',
|
|
46
|
-
'scripts/prepare-native-assets.mjs',
|
|
47
|
-
'scripts/prepare-native-assets-test.mjs',
|
|
48
|
-
'scripts/generate-voice-runtime-manifest.mjs',
|
|
49
|
-
'scripts/generate-voice-runtime-manifest.test.mjs',
|
|
50
|
-
'scripts/apply-patch-edit-smoke.mjs',
|
|
51
|
-
'scripts/provider-contract-test.mjs',
|
|
52
|
-
'scripts/provider-stream-outcome-test.mjs',
|
|
53
|
-
'scripts/cursor-provider-test.mjs',
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
// Directory-shaped suites the critical lane executes (test:providers runs
|
|
57
|
-
// scripts/provider-toolcall/*.test.mjs): deploy consumes these as git
|
|
58
|
-
// pathspecs, the gate regex as path prefixes.
|
|
59
|
-
export const RELEASE_CRITICAL_SUITE_DIRS = ['scripts/provider-toolcall'];
|
|
60
|
-
|
|
61
|
-
// Gate-only suite files the runtime job executes beyond the critical lane
|
|
62
|
-
// (test:compact); editing one must re-run the gate that executes it.
|
|
63
|
-
export const RUNTIME_GATE_SUITE_FILES = ['scripts/suite-compact-test.mjs'];
|
|
64
|
-
|
|
65
41
|
// deploy.yml plan: paths whose change since the published release tag marks
|
|
66
|
-
// the
|
|
42
|
+
// the default lane as unverified.
|
|
67
43
|
export const RELEASE_CRITICAL_PATHS = [
|
|
68
44
|
'native',
|
|
69
|
-
'
|
|
70
|
-
'src
|
|
71
|
-
...RELEASE_CRITICAL_SCRIPTS,
|
|
72
|
-
...RELEASE_CRITICAL_SUITE_DIRS,
|
|
45
|
+
'scripts',
|
|
46
|
+
'src',
|
|
73
47
|
...PACKAGE_MANIFESTS,
|
|
74
48
|
];
|
|
75
49
|
|
|
@@ -87,10 +61,6 @@ export function desktopGateRegex() {
|
|
|
87
61
|
export function runtimeGateRegex() {
|
|
88
62
|
return `^(${[
|
|
89
63
|
...RUNTIME_GATE_PREFIXES.map(escapeRegex),
|
|
90
|
-
...RELEASE_CRITICAL_SCRIPTS.map((file) => `${escapeRegex(file)}$`),
|
|
91
|
-
...RELEASE_CRITICAL_SUITE_DIRS.map((dir) => `${escapeRegex(dir)}/`),
|
|
92
|
-
...RUNTIME_GATE_SUITE_FILES.map((file) => `${escapeRegex(file)}$`),
|
|
93
|
-
...DESKTOP_GATE_SCRIPT_BASES.map((base) => `${escapeRegex(base)}(\\.test)?\\.mjs$`),
|
|
94
64
|
...PACKAGE_MANIFESTS.map((file) => `${escapeRegex(file)}$`),
|
|
95
65
|
...GATE_SELECTION_SOURCES.map((file) => `${escapeRegex(file)}$`),
|
|
96
66
|
].join('|')})`;
|
|
@@ -1,28 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { buildLiveTestPlan, liveTestHelp } from './office-live-test-plan.mjs';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
let plan;
|
|
5
|
+
try {
|
|
6
|
+
plan = buildLiveTestPlan(process.argv.slice(2));
|
|
7
|
+
} catch (error) {
|
|
8
|
+
process.stderr.write(`${error.message}\n${liveTestHelp}`);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
if (!plan) {
|
|
12
|
+
process.stdout.write(liveTestHelp);
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
process.stdout.write(`Office 라이브 검증 시작 — ${plan.label}\n`);
|
|
16
|
+
const child = spawn(process.execPath, plan.args, {
|
|
8
17
|
cwd: process.cwd(),
|
|
9
18
|
env: {
|
|
10
19
|
...process.env,
|
|
11
20
|
MIXDOG_TEST_LIVE_OFFICE: '1',
|
|
12
21
|
},
|
|
13
22
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
14
|
-
encoding: 'utf8',
|
|
15
|
-
maxBuffer: 16 * 1024 * 1024,
|
|
16
23
|
windowsHide: true,
|
|
17
24
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
process.stderr.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
let tapFailed = false;
|
|
26
|
+
let emptySelection = false;
|
|
27
|
+
// Forward chunks immediately; retain only a bounded line prefix for TAP status,
|
|
28
|
+
// not the potentially large Office snapshots printed in assertion failures.
|
|
29
|
+
for (const [source, destination] of [[child.stdout, process.stdout], [child.stderr, process.stderr]]) {
|
|
30
|
+
source.setEncoding('utf8');
|
|
31
|
+
let prefix = '';
|
|
32
|
+
const inspect = () => {
|
|
33
|
+
if (/^(?:not ok \d+ -|# fail [1-9]\d*)/u.test(prefix)) tapFailed = true;
|
|
34
|
+
// Node can wrap a filtered-out file as one passing file test after a
|
|
35
|
+
// top-level empty TAP plan, so "# tests" alone is not sufficient.
|
|
36
|
+
if (/^(?:# tests 0\s*$|1\.\.0(?:\s|$))/u.test(prefix)) emptySelection = true;
|
|
37
|
+
};
|
|
38
|
+
source.on('data', (chunk) => {
|
|
39
|
+
if (!destination.write(chunk)) {
|
|
40
|
+
source.pause();
|
|
41
|
+
destination.once('drain', () => source.resume());
|
|
42
|
+
}
|
|
43
|
+
const lines = chunk.split('\n');
|
|
44
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
45
|
+
prefix = (prefix + lines[i]).slice(0, 1024);
|
|
46
|
+
if (i < lines.length - 1) {
|
|
47
|
+
inspect();
|
|
48
|
+
prefix = '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
source.on('end', inspect);
|
|
26
53
|
}
|
|
27
|
-
|
|
28
|
-
process.
|
|
54
|
+
child.on('error', (error) => {
|
|
55
|
+
process.stderr.write(`${error.stack || error}\n`);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
});
|
|
58
|
+
child.on('close', (code) => {
|
|
59
|
+
if (emptySelection) process.stderr.write('선택한 범위에 실행할 테스트가 없습니다.\n');
|
|
60
|
+
process.exitCode = tapFailed || emptySelection ? 1 : Number.isInteger(code) ? code : 1;
|
|
61
|
+
});
|
package/scripts/suite-health.mjs
CHANGED
|
@@ -16,8 +16,6 @@ export const WORKSPACES = [
|
|
|
16
16
|
'smoke:loop': 'long-running local endurance harness',
|
|
17
17
|
'smoke:loop:final': 'endurance-harness gate, needs hours of loop data',
|
|
18
18
|
'smoke:loop:report': 'report reader, not a suite',
|
|
19
|
-
'test:release-critical': 'aggregate; the release gate owns it',
|
|
20
|
-
'test:quick': 'aggregate; its components run individually',
|
|
21
19
|
'test:office:live': 'drives real Office COM on a desktop machine',
|
|
22
20
|
'test:embedding-runtime:warmup': 'downloads the embedding runtime',
|
|
23
21
|
'test:spec-advisory': 'advisory by design (MIXDOG_TEST_ADVISORY)',
|
|
@@ -26,9 +24,9 @@ export const WORKSPACES = [
|
|
|
26
24
|
{
|
|
27
25
|
dir: 'apps/desktop',
|
|
28
26
|
exclusions: {
|
|
29
|
-
'test:
|
|
30
|
-
'test:
|
|
31
|
-
'test:
|
|
27
|
+
'test:all': 'aggregate of the fast, slow, and live lanes',
|
|
28
|
+
'test:live': 'needs built artifacts; the packaging workflow owns it',
|
|
29
|
+
'test:daemon:e2e': 'needs the built daemon; the release gate desktop job owns it',
|
|
32
30
|
'test:spec-advisory': 'advisory by design (MIXDOG_TEST_ADVISORY)',
|
|
33
31
|
'test:browser-host:integration': 'live desktop integration harness',
|
|
34
32
|
'test:browser-profile-import:integration': 'live desktop integration harness',
|
package/scripts/test.mjs
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Discovery-based test entry (docs/testing.md). A test file joins the suite
|
|
3
|
+
// by existing; its lane comes from its name, never from a hand-kept list:
|
|
4
|
+
//
|
|
5
|
+
// *.test.mjs fast the default lane; every push, every local run
|
|
6
|
+
// *.slow.test.mjs slow files over ~10s; their own CI job
|
|
7
|
+
// *.live.test.mjs live need a built artifact or a live system
|
|
8
|
+
//
|
|
9
|
+
// Usage: node scripts/test.mjs [--lane fast|slow|live|all] [--list]
|
|
10
|
+
// [--import <spec>]... [--test-*]... [filter...]
|
|
11
|
+
// filter substring of a file path; only matching files run.
|
|
12
|
+
// --import forwarded to node (desktop passes its test-env and tsx loaders).
|
|
13
|
+
// --test-* forwarded to node --test (e.g. --test-name-pattern, --test-only).
|
|
14
|
+
//
|
|
15
|
+
// Runs from the package that invokes it: `src/` and `scripts/` under cwd are
|
|
16
|
+
// the roots, so the root package and apps/desktop share this one entry.
|
|
17
|
+
import { spawn } from 'node:child_process';
|
|
18
|
+
import { glob } from 'node:fs/promises';
|
|
19
|
+
import { dirname, resolve } from 'node:path';
|
|
20
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
21
|
+
|
|
22
|
+
const ROOTS = ['src', 'scripts'];
|
|
23
|
+
const PATTERNS = ['**/*.test.mjs', '**/*-test.mjs'];
|
|
24
|
+
const EXCLUDED_DIRS = new Set(['node_modules', '.runtime', 'out', 'dist', 'target']);
|
|
25
|
+
// A file URL: node resolves reporter specifiers through the ESM loader, which
|
|
26
|
+
// rejects a bare Windows drive path as an unknown "c:" scheme.
|
|
27
|
+
const REPORTER = pathToFileURL(resolve(dirname(fileURLToPath(import.meta.url)), 'lib', 'test-timing-reporter.mjs')).href;
|
|
28
|
+
|
|
29
|
+
export function laneOf(file) {
|
|
30
|
+
if (/\.live\.test\.mjs$/.test(file)) return 'live';
|
|
31
|
+
if (/\.slow\.test\.mjs$/.test(file)) return 'slow';
|
|
32
|
+
return 'fast';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function parseArgs(argv) {
|
|
36
|
+
const options = { lane: 'fast', list: false, nodeArgs: [], filters: [] };
|
|
37
|
+
for (let index = 0; index < argv.length; index++) {
|
|
38
|
+
const arg = argv[index];
|
|
39
|
+
if (arg === '--lane') options.lane = argv[++index];
|
|
40
|
+
else if (arg.startsWith('--lane=')) options.lane = arg.slice('--lane='.length);
|
|
41
|
+
else if (arg === '--list') options.list = true;
|
|
42
|
+
else if (arg === '--import') options.nodeArgs.push(arg, argv[++index]);
|
|
43
|
+
else if (arg.startsWith('--import=') || arg.startsWith('--test-')) options.nodeArgs.push(arg);
|
|
44
|
+
else options.filters.push(arg.replaceAll('\\', '/'));
|
|
45
|
+
}
|
|
46
|
+
if (!['fast', 'slow', 'live', 'all'].includes(options.lane)) {
|
|
47
|
+
throw new Error(`unknown lane "${options.lane}" (fast|slow|live|all)`);
|
|
48
|
+
}
|
|
49
|
+
return options;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function discoverTestFiles(cwd = process.cwd()) {
|
|
53
|
+
const files = new Set();
|
|
54
|
+
for (const root of ROOTS) {
|
|
55
|
+
for (const pattern of PATTERNS) {
|
|
56
|
+
for await (const entry of glob(`${root}/${pattern}`, {
|
|
57
|
+
cwd,
|
|
58
|
+
exclude: (path) => String(path).split(/[\\/]/).some((segment) => EXCLUDED_DIRS.has(segment)),
|
|
59
|
+
})) files.add(entry.replaceAll('\\', '/'));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return [...files].sort();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function selectTestFiles(files, { lane, filters }) {
|
|
66
|
+
return files
|
|
67
|
+
.filter((file) => lane === 'all' || laneOf(file) === lane)
|
|
68
|
+
.filter((file) => filters.length === 0 || filters.some((filter) => file.includes(filter)));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function main() {
|
|
72
|
+
const options = parseArgs(process.argv.slice(2));
|
|
73
|
+
const files = selectTestFiles(await discoverTestFiles(), options);
|
|
74
|
+
if (options.list) {
|
|
75
|
+
for (const file of files) console.log(`${laneOf(file).padEnd(5)} ${file}`);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (files.length === 0) {
|
|
79
|
+
console.error(`no ${options.lane} test files match ${options.filters.join(' ') || '(everything)'}`);
|
|
80
|
+
process.exitCode = 1;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const args = [
|
|
84
|
+
...options.nodeArgs,
|
|
85
|
+
'--test',
|
|
86
|
+
// A suite that leaves a handle open (a session runtime closed without
|
|
87
|
+
// waiting for its children) must not hang the whole run.
|
|
88
|
+
'--test-force-exit',
|
|
89
|
+
'--test-reporter=spec', '--test-reporter-destination=stdout',
|
|
90
|
+
`--test-reporter=${REPORTER}`, '--test-reporter-destination=stderr',
|
|
91
|
+
...files,
|
|
92
|
+
];
|
|
93
|
+
const child = spawn(process.execPath, args, { stdio: 'inherit' });
|
|
94
|
+
child.on('exit', (code, signal) => {
|
|
95
|
+
process.exitCode = code ?? (signal ? 1 : 0);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const invoked = process.argv[1] ? resolve(process.argv[1]) : '';
|
|
100
|
+
if (invoked === fileURLToPath(import.meta.url)) await main();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Mirror of
|
|
1
|
+
// Mirror of patched Ink's shouldClearTerminalForFrame, with the
|
|
2
2
|
// Windows branch parameterized so the harness can probe both platforms without
|
|
3
3
|
// relying on process.platform. Kept byte-faithful to the source predicate so
|
|
4
4
|
// the harness reflects real clear decisions.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* scripts/tui-frame-harness.mjs — renderer-level frame-grid evidence harness.
|
|
4
4
|
*
|
|
5
|
-
* Drives
|
|
5
|
+
* Drives patched Ink log-update createIncremental(fakeStream) through the SAME
|
|
6
6
|
* wrapper logic ink.js renderInteractiveFrame() applies (fullscreen detect +
|
|
7
7
|
* trailing-newline normalization + shouldClearTerminalForFrame), replays the
|
|
8
8
|
* emitted ANSI into a minimal VT grid interpreter, and asserts the absolute row
|
|
@@ -13,12 +13,17 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Run: node scripts/tui-frame-harness.mjs
|
|
15
15
|
*/
|
|
16
|
+
import { dirname, join } from 'node:path';
|
|
17
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
18
|
+
|
|
16
19
|
// [harness] log-update reads process.platform/WT_SESSION AT IMPORT to pick its
|
|
17
20
|
// Windows-safe absolute-cursor branch. Force WT_SESSION on BEFORE importing it
|
|
18
21
|
// so POSIX/CI runs exercise the same branch WT users hit. Must precede the
|
|
19
22
|
// dynamic import below.
|
|
20
23
|
process.env.WT_SESSION = process.env.WT_SESSION || '1';
|
|
21
|
-
const
|
|
24
|
+
const inkBuildDir = dirname(fileURLToPath(import.meta.resolve('ink')));
|
|
25
|
+
const logUpdateUrl = pathToFileURL(join(inkBuildDir, 'log-update.js')).href;
|
|
26
|
+
const { default: logUpdate } = await import(logUpdateUrl);
|
|
22
27
|
const { shouldClearTerminalForFrameProbe } = await import('./tui-frame-harness-shim.mjs');
|
|
23
28
|
const { default: ansiEscapes } = await import('ansi-escapes');
|
|
24
29
|
|
|
@@ -8,16 +8,6 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
|
8
8
|
const entry = join(ROOT, 'scripts', 'tui-transcript-jitter-harness-entry.jsx');
|
|
9
9
|
const outfile = join(ROOT, 'scripts', '.tui-transcript-jitter-harness.tmp.mjs');
|
|
10
10
|
|
|
11
|
-
const inkAlias = {
|
|
12
|
-
name: 'mixdog-ink-alias',
|
|
13
|
-
setup(ctx) {
|
|
14
|
-
ctx.onResolve({ filter: /^ink$/ }, () => ({
|
|
15
|
-
path: '../vendor/ink/build/index.js',
|
|
16
|
-
external: true,
|
|
17
|
-
}));
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
11
|
try {
|
|
22
12
|
await build({
|
|
23
13
|
entryPoints: [entry],
|
|
@@ -28,7 +18,6 @@ try {
|
|
|
28
18
|
target: 'node22',
|
|
29
19
|
jsx: 'automatic',
|
|
30
20
|
packages: 'external',
|
|
31
|
-
plugins: [inkAlias],
|
|
32
21
|
banner: {
|
|
33
22
|
js: "import { createRequire as __mixdogCreateRequire } from 'node:module';\nconst require = __mixdogCreateRequire(import.meta.url);",
|
|
34
23
|
},
|