mixdog 0.9.152 → 0.9.154
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/browser-import-NOTICE.txt +11 -0
- package/NOTICE.md +11 -0
- package/README.md +8 -10
- package/package.json +19 -3
- package/scripts/computer-task-cost-report.mjs +144 -0
- package/scripts/run-office-live-tests.mjs +32 -0
- package/src/agents/front-worker/AGENT.md +13 -0
- package/src/agents/front-worker/agent.json +6 -0
- package/src/agents/heavy-worker/AGENT.md +10 -11
- package/src/agents/heavy-worker/agent.json +1 -1
- package/src/agents/maintainer/AGENT.md +0 -2
- package/src/agents/reviewer/AGENT.md +9 -13
- package/src/agents/reviewer/agent.json +1 -1
- package/src/agents/security/AGENT.md +14 -0
- package/src/agents/security/agent.json +6 -0
- package/src/agents/worker/AGENT.md +8 -8
- package/src/agents/worker/agent.json +1 -1
- package/src/agents/writer/AGENT.md +14 -0
- package/src/agents/writer/agent.json +6 -0
- package/src/rules/agent/00-common.md +4 -7
- package/src/rules/lead/01-general.md +0 -3
- package/src/rules/shared/10-tool-workflow.md +10 -2
- package/src/rules/shared/60-verification.md +2 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +183 -26
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +4 -0
- package/src/runtime/agent/orchestrator/cache-break-trace.mjs +109 -0
- package/src/runtime/agent/orchestrator/config.mjs +7 -2
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +16 -3
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +9 -1
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +30 -9
- package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +18 -26
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +25 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +103 -10
- package/src/runtime/agent/orchestrator/providers/openai-turn-state.mjs +68 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +36 -11
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +140 -86
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +9 -13
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +72 -4
- package/src/runtime/agent/orchestrator/session/browser-snapshot-supersession.mjs +61 -0
- package/src/runtime/agent/orchestrator/session/compact/handoff.mjs +0 -22
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +11 -23
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +28 -269
- package/src/runtime/agent/orchestrator/session/compact.mjs +0 -6
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +86 -11
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +17 -1
- package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +12 -8
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +110 -2
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +3 -16
- package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +80 -18
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +80 -21
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +33 -72
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +21 -2
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +25 -51
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +4 -110
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +39 -15
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +14 -4
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +41 -8
- package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +129 -12
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +15 -1
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +36 -2
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +157 -30
- package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +57 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +22 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +4 -0
- package/src/runtime/attachments/pdf-extract.mjs +3 -0
- package/src/runtime/attachments/pdfjs-runtime.mjs +13 -0
- package/src/runtime/browser-bridge/action-schema.mjs +251 -0
- package/src/runtime/browser-bridge/client.mjs +75 -26
- package/src/runtime/browser-bridge/tool-defs.mjs +132 -15
- package/src/runtime/computer-bridge/action-schema.mjs +653 -0
- package/src/runtime/computer-bridge/client.mjs +211 -28
- package/src/runtime/computer-bridge/tool-defs.mjs +25 -45
- package/src/runtime/office/assurance-benchmark.mjs +358 -0
- package/src/runtime/office/assurance.mjs +833 -0
- package/src/runtime/office/benchmark.mjs +496 -0
- package/src/runtime/office/capabilities.mjs +551 -0
- package/src/runtime/office/com-adapter.mjs +283 -0
- package/src/runtime/office/content-model.mjs +183 -0
- package/src/runtime/office/contract-benchmark.mjs +105 -0
- package/src/runtime/office/design-library.mjs +1562 -0
- package/src/runtime/office/design-system.mjs +1966 -0
- package/src/runtime/office/index.mjs +2413 -0
- package/src/runtime/office/journal.mjs +82 -0
- package/src/runtime/office/office-com-host.ps1 +3781 -0
- package/src/runtime/office/office-com-session-host.ps1 +855 -0
- package/src/runtime/office/ooxml-validator.mjs +271 -0
- package/src/runtime/office/pagination.mjs +132 -0
- package/src/runtime/office/pdf-adapter.mjs +591 -0
- package/src/runtime/office/pdf-analysis.mjs +372 -0
- package/src/runtime/office/pdf-render.mjs +167 -0
- package/src/runtime/office/pdf-security.mjs +63 -0
- package/src/runtime/office/polish-benchmark.mjs +190 -0
- package/src/runtime/office/portable-ooxml.mjs +1867 -0
- package/src/runtime/office/quality-live-benchmark.mjs +486 -0
- package/src/runtime/office/quality-pipeline.mjs +136 -0
- package/src/runtime/office/tabular.mjs +302 -0
- package/src/runtime/office/templates/mixdog-executive.pptx +0 -0
- package/src/runtime/office/templates/mixdog-executive.pptx.mixdog.json +190 -0
- package/src/runtime/office/tool-defs.mjs +113 -0
- package/src/runtime/office/visual-diff.mjs +89 -0
- package/src/runtime/office/xlsx-assertions.mjs +172 -0
- package/src/runtime/office/xlsx-contract.mjs +147 -0
- package/src/runtime/shared/agent-route-config.mjs +9 -0
- package/src/runtime/shared/tool-execution-contract.mjs +16 -0
- package/src/runtime/shared/tool-surface.mjs +9 -0
- package/src/session-runtime/context-status.mjs +9 -3
- package/src/session-runtime/deferred-tool-delta.mjs +104 -0
- package/src/session-runtime/goal-runtime.mjs +617 -197
- package/src/session-runtime/lifecycle-api.mjs +50 -8
- package/src/session-runtime/provider-request-snapshot.mjs +33 -9
- package/src/session-runtime/resource-api.mjs +31 -94
- package/src/session-runtime/runtime-core.mjs +78 -26
- package/src/session-runtime/session-lifecycle.mjs +34 -12
- package/src/session-runtime/session-title.mjs +2 -2
- package/src/session-runtime/session-turn-api.mjs +15 -14
- package/src/session-runtime/tool-catalog-data.mjs +1 -1
- package/src/session-runtime/tool-catalog.mjs +38 -99
- package/src/session-runtime/tool-defs.mjs +6 -1
- package/src/session-runtime/tool-surface.mjs +18 -8
- package/src/session-runtime/workflow-agents-api.mjs +8 -25
- package/src/session-runtime/workflow.mjs +8 -6
- package/src/standalone/agent-tool/helpers.mjs +2 -2
- package/src/standalone/agent-tool/job-views.mjs +3 -1
- package/src/standalone/agent-tool/notify.mjs +5 -1
- package/src/standalone/agent-tool/render.mjs +3 -0
- package/src/standalone/agent-tool/spawn-flow.mjs +61 -16
- package/src/standalone/agent-tool/tool-def.mjs +1 -1
- package/src/standalone/agent-tool/worker-index.mjs +123 -0
- package/src/standalone/agent-tool/worker-rows.mjs +2 -1
- package/src/standalone/agent-tool.mjs +57 -10
- package/src/standalone/daemon.mjs +105 -6
- package/src/standalone/session-runtime-host.mjs +61 -48
- package/src/standalone/session-runtime-inline-host.mjs +34 -127
- package/src/standalone/session-runtime-worker.mjs +20 -198
- package/src/standalone/session-service.mjs +632 -7
- package/src/tui/dist/index.mjs +24 -1
- package/src/tui/lib/voice-setup.mjs +4 -1
- package/src/tui/session/context-state.mjs +2 -13
- package/src/tui/session/goal-continuation.mjs +38 -7
- package/src/tui/session/session-api-ext.mjs +9 -0
- package/src/tui/session/session-api.mjs +15 -1
- package/src/tui/session/session-flow.mjs +25 -1
- package/src/tui/session/turn.mjs +88 -16
- package/src/tui/session-local.mjs +25 -3
- package/src/vendor/statusline/src/gateway/route-meta.mjs +31 -0
- package/scripts/generate-voice-runtime-manifest.test.mjs +0 -135
- package/scripts/native-binary-arch.test.mjs +0 -111
- package/scripts/patch-replay.test.mjs +0 -94
- package/src/headless-exec.test.mjs +0 -539
- package/src/runtime/agent/orchestrator/agent-trace-timing.test.mjs +0 -57
- package/src/runtime/agent/orchestrator/context/collect-skills.test.mjs +0 -153
- package/src/runtime/agent/orchestrator/mcp/cancellation.test.mjs +0 -139
- package/src/runtime/agent/orchestrator/mcp/features.test.mjs +0 -66
- package/src/runtime/agent/orchestrator/mcp/security.test.mjs +0 -80
- package/src/runtime/agent/orchestrator/providers/anthropic-fast-mode.test.mjs +0 -90
- package/src/runtime/agent/orchestrator/providers/anthropic-server-fallback.test.mjs +0 -215
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.test.mjs +0 -165
- package/src/runtime/agent/orchestrator/providers/media-parity.test.mjs +0 -142
- package/src/runtime/agent/orchestrator/providers/openai-codex-identity.test.mjs +0 -153
- package/src/runtime/agent/orchestrator/providers/openai-codex-model.test.mjs +0 -24
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta-parity.test.mjs +0 -190
- package/src/runtime/agent/orchestrator/providers/provider-replay.test.mjs +0 -235
- package/src/runtime/agent/orchestrator/providers/sse-framing.test.mjs +0 -719
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.test.mjs +0 -40
- package/src/runtime/agent/orchestrator/session/compact-policy.test.mjs +0 -176
- package/src/runtime/agent/orchestrator/session/compaction-read-reset.test.mjs +0 -161
- package/src/runtime/agent/orchestrator/session/eager-dispatch.test.mjs +0 -115
- package/src/runtime/agent/orchestrator/session/evidence-union.test.mjs +0 -228
- package/src/runtime/agent/orchestrator/session/image-strip-recovery.test.mjs +0 -245
- package/src/runtime/agent/orchestrator/session/lossless-tool-output.test.mjs +0 -125
- package/src/runtime/agent/orchestrator/session/manager/pending-messages-persistence.test.mjs +0 -325
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.test.mjs +0 -70
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.test.mjs +0 -457
- package/src/runtime/agent/orchestrator/session/provider-prefix-guard.test.mjs +0 -117
- package/src/runtime/agent/orchestrator/session/reduction-metrics.test.mjs +0 -87
- package/src/runtime/agent/orchestrator/session/store/serialize.test.mjs +0 -60
- package/src/runtime/agent/orchestrator/session/store-summary-reader.test.mjs +0 -583
- package/src/runtime/agent/orchestrator/session/task-wait-control.test.mjs +0 -78
- package/src/runtime/agent/orchestrator/tools/builtin/absence-absorption.test.mjs +0 -43
- package/src/runtime/agent/orchestrator/tools/builtin/absolute-glob-expand.test.mjs +0 -63
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool-cwd-env.test.mjs +0 -14
- package/src/runtime/agent/orchestrator/tools/builtin/edit-encoding-eol.test.mjs +0 -224
- package/src/runtime/agent/orchestrator/tools/builtin/edit-sequential-occupation.test.mjs +0 -224
- package/src/runtime/agent/orchestrator/tools/builtin/enoent-outside-project.test.mjs +0 -56
- package/src/runtime/agent/orchestrator/tools/builtin/find-search-budget.test.mjs +0 -103
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-policy.test.mjs +0 -30
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.test.mjs +0 -390
- package/src/runtime/agent/orchestrator/tools/builtin/git-repo-rw-lock.test.mjs +0 -83
- package/src/runtime/agent/orchestrator/tools/builtin/grep-output-budget.test.mjs +0 -31
- package/src/runtime/agent/orchestrator/tools/builtin/grep-single-file-rescue.test.mjs +0 -106
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.test.mjs +0 -102
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool-integrity.test.mjs +0 -152
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-health.test.mjs +0 -24
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-transport.test.mjs +0 -24
- package/src/runtime/agent/orchestrator/tools/builtin/noise-dir-visibility.test.mjs +0 -69
- package/src/runtime/agent/orchestrator/tools/builtin/read-glob-survey.test.mjs +0 -71
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.test.mjs +0 -56
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.test.mjs +0 -16
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-top-k.test.mjs +0 -39
- package/src/runtime/agent/orchestrator/tools/builtin/write-symlink.test.mjs +0 -153
- package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-anchor-relocation.test.mjs +0 -55
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.test.mjs +0 -88
- package/src/runtime/agent/orchestrator/tools/code-graph/loose-file-target.test.mjs +0 -72
- package/src/runtime/agent/orchestrator/tools/code-graph/memory-cache.test.mjs +0 -54
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.test.mjs +0 -20
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-search-scope.test.mjs +0 -55
- package/src/runtime/agent/orchestrator/tools/code-graph/text-span-mask.test.mjs +0 -268
- package/src/runtime/agent/orchestrator/tools/env-scrub.test.mjs +0 -57
- package/src/runtime/agent/orchestrator/tools/graph-binary-fetcher.test.mjs +0 -19
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.test.mjs +0 -104
- package/src/runtime/agent/orchestrator/tools/patch/engine-contract-gate.test.mjs +0 -661
- package/src/runtime/agent/orchestrator/tools/patch/patch-codec-eol.test.mjs +0 -552
- package/src/runtime/agent/orchestrator/tools/patch/patch-symlink.test.mjs +0 -141
- package/src/runtime/agent/orchestrator/tools/patch/v4a-pure-move.test.mjs +0 -57
- package/src/runtime/agent/orchestrator/tools/patch/v4a-section-coalesce.test.mjs +0 -81
- package/src/runtime/agent/orchestrator/tools/spawn-binary-fetcher.test.mjs +0 -52
- package/src/runtime/attachments/store.test.mjs +0 -209
- package/src/runtime/channels/lib/voice-runtime-fetcher.test.mjs +0 -17
- package/src/runtime/channels/lib/webhook/deliveries.test.mjs +0 -18
- package/src/runtime/channels/lib/webhook/relay-tunnel.test.mjs +0 -68
- package/src/runtime/media/adapters/codex-image.test.mjs +0 -22
- package/src/runtime/media/download.test.mjs +0 -52
- package/src/runtime/media/renditions.test.mjs +0 -99
- package/src/runtime/media/store.test.mjs +0 -159
- package/src/runtime/memory/lib/archive-security.test.mjs +0 -128
- package/src/runtime/memory/lib/embedding-model-config.test.mjs +0 -33
- package/src/runtime/memory/lib/http-wire.test.mjs +0 -15
- package/src/runtime/memory/lib/memory-cycle-packets.test.mjs +0 -49
- package/src/runtime/memory/lib/memory-cycle2-shared.test.mjs +0 -78
- package/src/runtime/memory/lib/memory-embedding-migration.test.mjs +0 -50
- package/src/runtime/memory/lib/pg/process.test.mjs +0 -36
- package/src/runtime/memory/lib/trace-store.test.mjs +0 -57
- package/src/runtime/memory/lib/transcript-ingest.test.mjs +0 -52
- package/src/runtime/shared/background-tasks.test.mjs +0 -78
- package/src/runtime/shared/bounded-download.test.mjs +0 -41
- package/src/runtime/shared/channel-notification-routing.test.mjs +0 -25
- package/src/runtime/shared/child-spawn-remote.test.mjs +0 -124
- package/src/runtime/shared/remote-intent.test.mjs +0 -40
- package/src/runtime/shared/resource-admission.test.mjs +0 -43
- package/src/runtime/shared/runtime-root.test.mjs +0 -34
- package/src/runtime/shared/schedule-time.test.mjs +0 -29
- package/src/runtime/shared/session-runtime-health.test.mjs +0 -83
- package/src/runtime/shared/skill-document.test.mjs +0 -81
- package/src/runtime/shared/tool-surface.test.mjs +0 -87
- package/src/runtime/shared/update-checker.test.mjs +0 -33
- package/src/runtime/shared/user-cwd.test.mjs +0 -43
- package/src/runtime/shared/webhook-session-run.test.mjs +0 -14
- package/src/session-runtime/agent-disable.test.mjs +0 -123
- package/src/session-runtime/cwd-plugins.test.mjs +0 -75
- package/src/session-runtime/cwd-tool-routing.test.mjs +0 -61
- package/src/session-runtime/global-extensions.test.mjs +0 -28
- package/src/session-runtime/goal-runtime.test.mjs +0 -108
- package/src/session-runtime/lifecycle-api.test.mjs +0 -21
- package/src/session-runtime/model-settings-persist.test.mjs +0 -105
- package/src/session-runtime/notification-bus.test.mjs +0 -148
- package/src/session-runtime/plugin-mcp-standard.test.mjs +0 -177
- package/src/session-runtime/prewarm.test.mjs +0 -52
- package/src/session-runtime/provider-request-snapshot.test.mjs +0 -37
- package/src/session-runtime/resource-api-global.test.mjs +0 -69
- package/src/session-runtime/session-lifecycle.test.mjs +0 -125
- package/src/session-runtime/session-title.test.mjs +0 -36
- package/src/session-runtime/skills-api.test.mjs +0 -99
- package/src/session-runtime/tool-policy-surface.test.mjs +0 -331
- package/src/standalone/agent-tool/helpers.test.mjs +0 -62
- package/src/standalone/agent-tool/notify.test.mjs +0 -37
- package/src/standalone/agent-tool/spawn-flow.test.mjs +0 -63
- package/src/standalone/channel-restart.test.mjs +0 -145
- package/src/standalone/channel-session-router.test.mjs +0 -37
- package/src/standalone/channel-worker-heartbeat.test.mjs +0 -30
- package/src/standalone/hook-bus/handlers.test.mjs +0 -88
- package/src/standalone/plugin-admin.test.mjs +0 -173
- package/src/standalone/session-runtime-agent-control-client.test.mjs +0 -71
- package/src/standalone/session-runtime-dispatch-cancel.test.mjs +0 -139
- package/src/standalone/session-runtime-host-factory.test.mjs +0 -31
- package/src/standalone/session-runtime-host-health.test.mjs +0 -160
- package/src/standalone/session-runtime-inline-host.test.mjs +0 -83
- package/src/standalone/session-runtime-provider-cooldown.test.mjs +0 -80
- package/src/standalone/session-runtime-shard-host.test.mjs +0 -569
- package/src/standalone/session-runtime-shard-router.test.mjs +0 -101
- package/src/tui/app/live-spinner-visibility.test.mjs +0 -44
- package/src/tui/app/panel-epoch.test.mjs +0 -1009
- package/src/tui/app/panel-handoff.test.mjs +0 -311
- package/src/tui/app/prompt-submit.test.mjs +0 -206
- package/src/tui/session/completion-card-restore.test.mjs +0 -111
- package/src/tui/session/goal-continuation.test.mjs +0 -84
- package/src/tui/session/oauth-flows.test.mjs +0 -134
- package/src/tui/session/queue-helpers.test.mjs +0 -46
- package/src/tui/session/session-action-surface.test.mjs +0 -108
- package/src/tui/session/task-wait-submit.test.mjs +0 -80
- package/src/tui/session/tool-result-status.test.mjs +0 -131
- package/src/tui/session/tui-steering-persist.test.mjs +0 -104
|
@@ -584,6 +584,33 @@ function compactTelemetry(compact) {
|
|
|
584
584
|
return out;
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
+
function compactTransportTiming(timing) {
|
|
588
|
+
if (!timing || typeof timing !== 'object') return null;
|
|
589
|
+
const ms = value => Number.isFinite(Number(value))
|
|
590
|
+
? Math.max(0, Math.round(Number(value)))
|
|
591
|
+
: null;
|
|
592
|
+
const count = value => Number.isFinite(Number(value))
|
|
593
|
+
? Math.max(0, Math.round(Number(value)))
|
|
594
|
+
: null;
|
|
595
|
+
return {
|
|
596
|
+
transport: cleanString(timing.transport) || null,
|
|
597
|
+
outcome: cleanString(timing.outcome) || null,
|
|
598
|
+
admissionQueueWaitMs: ms(timing.admissionQueueWaitMs),
|
|
599
|
+
providerConcurrentRequests: count(timing.providerConcurrentRequests),
|
|
600
|
+
providerQueuedRequests: count(timing.providerQueuedRequests),
|
|
601
|
+
poolOwnerWaitMs: ms(timing.poolOwnerWaitMs),
|
|
602
|
+
socketAcquireMs: ms(timing.socketAcquireMs),
|
|
603
|
+
poolAcquireMs: ms(timing.poolAcquireMs),
|
|
604
|
+
requestBuildSerializationMs: ms(timing.requestBuildSerializationMs),
|
|
605
|
+
preResponseCreatedMs: ms(timing.preResponseCreatedMs),
|
|
606
|
+
providerFirstEventMs: ms(timing.providerFirstEventMs),
|
|
607
|
+
retryBackoffMs: ms(timing.retryBackoffMs),
|
|
608
|
+
handshakeRetries: count(timing.handshakeRetries),
|
|
609
|
+
acquireAttempts: count(timing.acquireAttempts),
|
|
610
|
+
acquireMode: cleanString(timing.acquireMode) || null,
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
|
|
587
614
|
export function recordGatewayUsageEvent(summary) {
|
|
588
615
|
const event = {
|
|
589
616
|
ts: summary?.at || Date.now(),
|
|
@@ -605,6 +632,8 @@ export function recordGatewayUsageEvent(summary) {
|
|
|
605
632
|
durationMs: Number.isFinite(Number(summary?.durationMs)) ? Math.max(0, Math.round(summary.durationMs)) : null,
|
|
606
633
|
requestKind: cleanString(summary?.requestKind) || null,
|
|
607
634
|
sessionId: cleanString(summary?.sessionId) || null,
|
|
635
|
+
sourceType: cleanString(summary?.sourceType) || null,
|
|
636
|
+
sourceName: cleanString(summary?.sourceName) || null,
|
|
608
637
|
toolCount: Number.isFinite(Number(summary?.toolCount)) ? Math.max(0, Math.round(summary.toolCount)) : null,
|
|
609
638
|
systemCount: Number.isFinite(Number(summary?.systemCount)) ? Math.max(0, Math.round(summary.systemCount)) : null,
|
|
610
639
|
messageCount: Number.isFinite(Number(summary?.messageCount)) ? Math.max(0, Math.round(summary.messageCount)) : null,
|
|
@@ -621,6 +650,8 @@ export function recordGatewayUsageEvent(summary) {
|
|
|
621
650
|
};
|
|
622
651
|
const compact = compactTelemetry(summary?.compact);
|
|
623
652
|
if (compact) event.compact = compact;
|
|
653
|
+
const transportTiming = compactTransportTiming(summary?.transportTiming);
|
|
654
|
+
if (transportTiming) event.transportTiming = transportTiming;
|
|
624
655
|
pendingUsageEvents.push(event);
|
|
625
656
|
if (pendingUsageEvents.length >= 20) flushGatewayUsageEvents();
|
|
626
657
|
else scheduleGatewayUsageFlush();
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict'
|
|
2
|
-
import test from 'node:test'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
VOICE_RUNTIME_CONFIG,
|
|
6
|
-
VOICE_RUNTIME_TAG,
|
|
7
|
-
buildVoiceRuntimePlatforms,
|
|
8
|
-
fetchGithubRelease,
|
|
9
|
-
voiceRuntimeBuildHash,
|
|
10
|
-
} from './generate-voice-runtime-manifest.mjs'
|
|
11
|
-
import { mergeVoiceRuntimeManifest } from './sync-voice-runtime-manifest.mjs'
|
|
12
|
-
|
|
13
|
-
const names = VOICE_RUNTIME_CONFIG.platforms.map((platform) => platform.asset)
|
|
14
|
-
|
|
15
|
-
test('voice runtime release assets produce a complete fail-closed manifest', () => {
|
|
16
|
-
assert.equal(VOICE_RUNTIME_CONFIG.vulkanSdkVersion, '1.4.309.0')
|
|
17
|
-
const assets = names.map((name, index) => ({
|
|
18
|
-
name,
|
|
19
|
-
size: index + 1,
|
|
20
|
-
digest: `sha256:${String(index + 1).padStart(64, '0')}`,
|
|
21
|
-
browser_download_url: `https://github.com/tribgames/mixdog/releases/download/${VOICE_RUNTIME_TAG}/${name}`,
|
|
22
|
-
}))
|
|
23
|
-
const platforms = buildVoiceRuntimePlatforms(assets)
|
|
24
|
-
assert.equal(platforms['win32-x64'].variants[0].id, 'vulkan')
|
|
25
|
-
assert.equal(platforms['linux-x64'].variants[0].id, 'vulkan')
|
|
26
|
-
assert.equal(platforms['linux-arm64'].variants[0].id, 'vulkan')
|
|
27
|
-
assert.equal(platforms['darwin-arm64'].variants[0].id, 'metal')
|
|
28
|
-
assert.equal(platforms['darwin-x64'].variants[0].id, 'cpu')
|
|
29
|
-
assert.equal(platforms['win32-x64'].variants[0].executable, 'whisper-server.exe')
|
|
30
|
-
assert.deepEqual(
|
|
31
|
-
VOICE_RUNTIME_CONFIG.platforms
|
|
32
|
-
.filter((platform) => platform.os === 'linux')
|
|
33
|
-
.map((platform) => platform.runner),
|
|
34
|
-
['ubuntu-24.04', 'ubuntu-24.04-arm'],
|
|
35
|
-
)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
test('voice runtime manifest generation rejects a partial release', () => {
|
|
39
|
-
assert.throws(() => buildVoiceRuntimePlatforms([]), /missing required asset/)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
test('voice runtime manifest generation rejects undeclared archives', () => {
|
|
43
|
-
assert.throws(
|
|
44
|
-
() => buildVoiceRuntimePlatforms([{
|
|
45
|
-
name: 'whisper-server-linux-riscv64-cpu.zip',
|
|
46
|
-
size: 1,
|
|
47
|
-
digest: `sha256:${'1'.padStart(64, '0')}`,
|
|
48
|
-
browser_download_url:
|
|
49
|
-
`https://github.com/tribgames/mixdog/releases/download/${VOICE_RUNTIME_TAG}/whisper-server-linux-riscv64-cpu.zip`,
|
|
50
|
-
}]),
|
|
51
|
-
/unexpected runtime asset/,
|
|
52
|
-
)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
test('voice runtime manifest normalizes hidden draft asset URLs to the published tag', () => {
|
|
56
|
-
const assets = names.map((name, index) => ({
|
|
57
|
-
name,
|
|
58
|
-
size: index + 1,
|
|
59
|
-
digest: `sha256:${String(index + 1).padStart(64, '0')}`,
|
|
60
|
-
browser_download_url:
|
|
61
|
-
`https://github.com/tribgames/mixdog/releases/download/untagged-fixture/${name}`,
|
|
62
|
-
}))
|
|
63
|
-
const platforms = buildVoiceRuntimePlatforms(assets)
|
|
64
|
-
assert.equal(
|
|
65
|
-
platforms['win32-x64'].variants[0].url,
|
|
66
|
-
`https://github.com/tribgames/mixdog/releases/download/${VOICE_RUNTIME_TAG}/whisper-server-win32-x64-vulkan.zip`,
|
|
67
|
-
)
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
test('voice runtime release lookup finds an authenticated untagged draft', async (t) => {
|
|
71
|
-
const originalFetch = globalThis.fetch
|
|
72
|
-
t.after(() => {
|
|
73
|
-
globalThis.fetch = originalFetch
|
|
74
|
-
})
|
|
75
|
-
const requests = []
|
|
76
|
-
globalThis.fetch = async (url) => {
|
|
77
|
-
requests.push(String(url))
|
|
78
|
-
if (String(url).includes('/releases/tags/')) {
|
|
79
|
-
return new Response(null, { status: 404 })
|
|
80
|
-
}
|
|
81
|
-
return Response.json([{
|
|
82
|
-
tag_name: VOICE_RUNTIME_TAG,
|
|
83
|
-
draft: true,
|
|
84
|
-
assets: [],
|
|
85
|
-
}])
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const release = await fetchGithubRelease(
|
|
89
|
-
'tribgames/mixdog',
|
|
90
|
-
VOICE_RUNTIME_TAG,
|
|
91
|
-
'fixture-token',
|
|
92
|
-
)
|
|
93
|
-
assert.equal(release.draft, true)
|
|
94
|
-
assert.equal(release.tag_name, VOICE_RUNTIME_TAG)
|
|
95
|
-
assert.equal(requests.length, 2)
|
|
96
|
-
assert.match(requests[1], /\/releases\?per_page=100&page=1$/)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
test('voice runtime build identity is stable and merge preserves model and ffmpeg metadata', async () => {
|
|
100
|
-
const buildHash = await voiceRuntimeBuildHash()
|
|
101
|
-
assert.match(buildHash, /^[a-f0-9]{64}$/)
|
|
102
|
-
const platforms = Object.fromEntries(VOICE_RUNTIME_CONFIG.platforms.map((platform, index) => [
|
|
103
|
-
platform.key,
|
|
104
|
-
{
|
|
105
|
-
variants: [{
|
|
106
|
-
id: platform.backend,
|
|
107
|
-
requires: null,
|
|
108
|
-
url: `https://github.com/tribgames/mixdog/releases/download/${VOICE_RUNTIME_TAG}/${platform.asset}`,
|
|
109
|
-
sha256: String(index + 1).padStart(64, '0'),
|
|
110
|
-
size: index + 1,
|
|
111
|
-
format: 'zip',
|
|
112
|
-
executable: platform.executable,
|
|
113
|
-
}],
|
|
114
|
-
},
|
|
115
|
-
]))
|
|
116
|
-
const current = {
|
|
117
|
-
version: '1.8.4',
|
|
118
|
-
source: 'old',
|
|
119
|
-
model: { id: 'standard' },
|
|
120
|
-
ffmpeg: { version: 'b6.1.1' },
|
|
121
|
-
platforms: {},
|
|
122
|
-
}
|
|
123
|
-
const released = {
|
|
124
|
-
...current,
|
|
125
|
-
version: VOICE_RUNTIME_CONFIG.runtimeVersion,
|
|
126
|
-
source: `ggml-org/whisper.cpp@${VOICE_RUNTIME_CONFIG.whisperCommit}`,
|
|
127
|
-
release_tag: VOICE_RUNTIME_TAG,
|
|
128
|
-
build_hash: buildHash,
|
|
129
|
-
platforms,
|
|
130
|
-
}
|
|
131
|
-
const merged = await mergeVoiceRuntimeManifest(current, released)
|
|
132
|
-
assert.strictEqual(merged.model, current.model)
|
|
133
|
-
assert.strictEqual(merged.ffmpeg, current.ffmpeg)
|
|
134
|
-
assert.deepEqual(merged.platforms, platforms)
|
|
135
|
-
})
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict'
|
|
2
|
-
import test from 'node:test'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
nativeBinaryArch,
|
|
6
|
-
nativeBinaryArches,
|
|
7
|
-
nativeBinaryRunsOn,
|
|
8
|
-
} from './native-binary-arch.mjs'
|
|
9
|
-
|
|
10
|
-
function machO({ cpu, littleEndian = true, wide = true }) {
|
|
11
|
-
const buffer = Buffer.alloc(32)
|
|
12
|
-
const magic = wide ? 0xfeedfacf : 0xfeedface
|
|
13
|
-
if (littleEndian) {
|
|
14
|
-
buffer.writeUInt32BE(wide ? 0xcffaedfe : 0xcefaedfe, 0)
|
|
15
|
-
buffer.writeUInt32LE(cpu, 4)
|
|
16
|
-
} else {
|
|
17
|
-
buffer.writeUInt32BE(magic, 0)
|
|
18
|
-
buffer.writeUInt32BE(cpu, 4)
|
|
19
|
-
}
|
|
20
|
-
return buffer
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function machOFat(cpus) {
|
|
24
|
-
const buffer = Buffer.alloc(8 + cpus.length * 20)
|
|
25
|
-
buffer.writeUInt32BE(0xcafebabe, 0)
|
|
26
|
-
buffer.writeUInt32BE(cpus.length, 4)
|
|
27
|
-
cpus.forEach((cpu, index) => buffer.writeUInt32BE(cpu, 8 + index * 20))
|
|
28
|
-
return buffer
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function elf(machine, { eiClass = 2 } = {}) {
|
|
32
|
-
const buffer = Buffer.alloc(eiClass === 1 ? 52 : 64)
|
|
33
|
-
buffer.writeUInt32BE(0x7f454c46, 0)
|
|
34
|
-
buffer[4] = eiClass
|
|
35
|
-
buffer[5] = 1
|
|
36
|
-
buffer.writeUInt16LE(machine, 18)
|
|
37
|
-
return buffer
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function pe(machine) {
|
|
41
|
-
const buffer = Buffer.alloc(128)
|
|
42
|
-
buffer.writeUInt16LE(0x5a4d, 0)
|
|
43
|
-
buffer.writeUInt32LE(64, 60)
|
|
44
|
-
buffer.writeUInt32LE(0x00004550, 64)
|
|
45
|
-
buffer.writeUInt16LE(machine, 68)
|
|
46
|
-
return buffer
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
test('Mach-O headers name their architecture in both endiannesses', () => {
|
|
50
|
-
assert.equal(nativeBinaryArch(machO({ cpu: 0x01000007 })), 'x64')
|
|
51
|
-
assert.equal(nativeBinaryArch(machO({ cpu: 0x0100000c })), 'arm64')
|
|
52
|
-
assert.equal(nativeBinaryArch(machO({ cpu: 0x01000007, littleEndian: false })), 'x64')
|
|
53
|
-
assert.equal(nativeBinaryArch(machO({ cpu: 7, wide: false })), 'ia32')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
test('universal binaries report every slice they carry', () => {
|
|
57
|
-
assert.deepEqual(nativeBinaryArches(machOFat([0x01000007, 0x0100000c])), ['x64', 'arm64'])
|
|
58
|
-
assert.equal(nativeBinaryRunsOn(machOFat([0x01000007, 0x0100000c]), 'arm64'), true)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
test('ELF and PE headers are read too', () => {
|
|
62
|
-
assert.equal(nativeBinaryArch(elf(0x3e)), 'x64')
|
|
63
|
-
assert.equal(nativeBinaryArch(elf(0xb7)), 'arm64')
|
|
64
|
-
assert.equal(nativeBinaryArch(elf(0x03, { eiClass: 1 })), 'ia32')
|
|
65
|
-
assert.equal(nativeBinaryArch(pe(0x8664)), 'x64')
|
|
66
|
-
assert.equal(nativeBinaryArch(pe(0xaa64)), 'arm64')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
test('ELF class must match the named machine', () => {
|
|
70
|
-
assert.equal(nativeBinaryArch(elf(0x3e, { eiClass: 1 })), null)
|
|
71
|
-
assert.equal(nativeBinaryRunsOn(elf(0x3e, { eiClass: 1 }), 'x64'), false)
|
|
72
|
-
assert.equal(nativeBinaryArch(elf(0xb7, { eiClass: 1 })), null)
|
|
73
|
-
assert.equal(nativeBinaryArch(elf(0x03)), null)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
test('a foreign architecture is rejected for the target', () => {
|
|
77
|
-
assert.equal(nativeBinaryRunsOn(machO({ cpu: 0x0100000c }), 'x64'), false)
|
|
78
|
-
assert.equal(nativeBinaryRunsOn(elf(0x3e), 'arm64'), false)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
test('unknown, truncated, or unsupported headers are not architecture-compatible', () => {
|
|
82
|
-
assert.equal(nativeBinaryArches(Buffer.from('#!/bin/sh\nexec node "$0"\n')), null)
|
|
83
|
-
assert.equal(nativeBinaryRunsOn(Buffer.alloc(4), 'x64'), false)
|
|
84
|
-
assert.equal(nativeBinaryRunsOn(Buffer.from('#!/bin/sh\n'), 'arm64'), false)
|
|
85
|
-
assert.equal(nativeBinaryRunsOn(elf(0xf3), 'x64'), false)
|
|
86
|
-
|
|
87
|
-
const truncatedMachO = Buffer.alloc(8)
|
|
88
|
-
truncatedMachO.writeUInt32BE(0xcffaedfe, 0)
|
|
89
|
-
truncatedMachO.writeUInt32LE(0x01000007, 4)
|
|
90
|
-
assert.equal(nativeBinaryRunsOn(truncatedMachO, 'x64'), false)
|
|
91
|
-
|
|
92
|
-
const truncatedElf = Buffer.alloc(20)
|
|
93
|
-
truncatedElf.writeUInt32BE(0x7f454c46, 0)
|
|
94
|
-
truncatedElf[4] = 1
|
|
95
|
-
truncatedElf[5] = 1
|
|
96
|
-
truncatedElf.writeUInt16LE(0x3e, 18)
|
|
97
|
-
assert.equal(nativeBinaryRunsOn(truncatedElf, 'x64'), false)
|
|
98
|
-
|
|
99
|
-
const truncatedPe = Buffer.alloc(70)
|
|
100
|
-
truncatedPe.writeUInt16LE(0x5a4d, 0)
|
|
101
|
-
truncatedPe.writeUInt32LE(64, 60)
|
|
102
|
-
truncatedPe.writeUInt32LE(0x00004550, 64)
|
|
103
|
-
truncatedPe.writeUInt16LE(0x8664, 68)
|
|
104
|
-
assert.equal(nativeBinaryRunsOn(truncatedPe, 'x64'), false)
|
|
105
|
-
|
|
106
|
-
const truncatedFat = Buffer.alloc(12)
|
|
107
|
-
truncatedFat.writeUInt32BE(0xcafebabe, 0)
|
|
108
|
-
truncatedFat.writeUInt32BE(1, 4)
|
|
109
|
-
truncatedFat.writeUInt32BE(0x01000007, 8)
|
|
110
|
-
assert.equal(nativeBinaryRunsOn(truncatedFat, 'x64'), false)
|
|
111
|
-
})
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { existsSync, mkdtempSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import { tmpdir } from 'node:os';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import test from 'node:test';
|
|
6
|
-
|
|
7
|
-
import { executePatchTool } from '../src/runtime/agent/orchestrator/tools/patch.mjs';
|
|
8
|
-
import { legacyPartialReplayReason, replayOne } from './patch-replay.mjs';
|
|
9
|
-
|
|
10
|
-
test('partial patch replay captures the pre-mutation state and never recaptures replay failures', async () => {
|
|
11
|
-
const root = mkdtempSync(join(tmpdir(), 'mixdog-patch-capture-'));
|
|
12
|
-
const replayDir = join(root, 'replays');
|
|
13
|
-
mkdirSync(replayDir);
|
|
14
|
-
writeFileSync(join(root, 'good.txt'), 'one\n');
|
|
15
|
-
writeFileSync(join(root, 'stale.txt'), 'actual\n');
|
|
16
|
-
const previousDir = process.env.MIXDOG_PATCH_REPLAY_DIR;
|
|
17
|
-
const previousCapture = process.env.MIXDOG_PATCH_REPLAY_CAPTURE;
|
|
18
|
-
process.env.MIXDOG_PATCH_REPLAY_DIR = replayDir;
|
|
19
|
-
process.env.MIXDOG_PATCH_REPLAY_CAPTURE = '1';
|
|
20
|
-
try {
|
|
21
|
-
const result = await executePatchTool('apply_patch', {
|
|
22
|
-
patch: [
|
|
23
|
-
'*** Begin Patch',
|
|
24
|
-
'*** Update File: good.txt',
|
|
25
|
-
'@@',
|
|
26
|
-
'-one',
|
|
27
|
-
'+two',
|
|
28
|
-
'*** Update File: stale.txt',
|
|
29
|
-
'@@',
|
|
30
|
-
'-expected',
|
|
31
|
-
'+next',
|
|
32
|
-
'*** End Patch',
|
|
33
|
-
'',
|
|
34
|
-
].join('\n'),
|
|
35
|
-
}, root, { sessionId: 'session-test', toolCallId: 'call-test' });
|
|
36
|
-
assert.match(result, /^Error: apply_patch file-level partial: 1\/2/m);
|
|
37
|
-
const captures = readdirSync(replayDir).filter((file) => file.endsWith('.json'));
|
|
38
|
-
assert.equal(captures.length, 1);
|
|
39
|
-
const record = JSON.parse(readFileSync(join(replayDir, captures[0]), 'utf8'));
|
|
40
|
-
assert.equal(record.snapshot_phase, 'pre');
|
|
41
|
-
assert.equal(record.file_snapshots['good.txt'], 'one\n');
|
|
42
|
-
assert.equal(record.file_snapshots['stale.txt'], 'actual\n');
|
|
43
|
-
assert.deepEqual(record.outcome, {
|
|
44
|
-
kind: 'partial',
|
|
45
|
-
applied: 1,
|
|
46
|
-
total: 2,
|
|
47
|
-
rejected: 1,
|
|
48
|
-
rejectedTargets: ['stale.txt'],
|
|
49
|
-
});
|
|
50
|
-
assert.equal(record.session_id, 'session-test');
|
|
51
|
-
assert.equal(record.tool_call_id, 'call-test');
|
|
52
|
-
assert.match(record.error_text, /expected first old line/);
|
|
53
|
-
|
|
54
|
-
const replayed = await replayOne(record);
|
|
55
|
-
assert.equal(replayed.skipped, false);
|
|
56
|
-
assert.equal(replayed.ok, false);
|
|
57
|
-
assert.equal(readdirSync(replayDir).filter((file) => file.endsWith('.json')).length, 1);
|
|
58
|
-
} finally {
|
|
59
|
-
if (previousDir === undefined) delete process.env.MIXDOG_PATCH_REPLAY_DIR;
|
|
60
|
-
else process.env.MIXDOG_PATCH_REPLAY_DIR = previousDir;
|
|
61
|
-
if (previousCapture === undefined) delete process.env.MIXDOG_PATCH_REPLAY_CAPTURE;
|
|
62
|
-
else process.env.MIXDOG_PATCH_REPLAY_CAPTURE = previousCapture;
|
|
63
|
-
rmSync(root, { recursive: true, force: true });
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test('legacy partial captures are skipped instead of producing misleading replay failures', () => {
|
|
68
|
-
assert.match(legacyPartialReplayReason({
|
|
69
|
-
error_first_line: 'Error: apply_patch file-level partial: 1/2 file(s) applied to disk (committed); 1 file(s) rejected',
|
|
70
|
-
}), /post-mutation snapshots/);
|
|
71
|
-
assert.equal(legacyPartialReplayReason({
|
|
72
|
-
snapshot_phase: 'pre',
|
|
73
|
-
outcome: { kind: 'partial' },
|
|
74
|
-
}), null);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test('replay snapshots cannot write outside the throwaway replay root', async () => {
|
|
78
|
-
const escaped = join(tmpdir(), `mixdog-patch-replay-escape-${process.pid}-${Date.now()}.txt`);
|
|
79
|
-
try {
|
|
80
|
-
const result = await replayOne({
|
|
81
|
-
id: 'unsafe-snapshot',
|
|
82
|
-
args: { patch: '*** Begin Patch\n*** End Patch\n' },
|
|
83
|
-
file_snapshots: {
|
|
84
|
-
[`../${escaped.split(/[\\/]/).at(-1)}`]: 'must not be written',
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
assert.equal(result.ok, false);
|
|
88
|
-
assert.equal(result.skipped, false);
|
|
89
|
-
assert.match(result.after, /unsafe snapshot path/);
|
|
90
|
-
assert.equal(existsSync(escaped), false);
|
|
91
|
-
} finally {
|
|
92
|
-
rmSync(escaped, { force: true });
|
|
93
|
-
}
|
|
94
|
-
});
|