pi-agent-browser-native 0.9.5 → 0.9.7
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/CHANGELOG.md +114 -1
- package/README.md +17 -6
- package/dist/extensions/agent-browser/index.js +2482 -925
- package/dist/packaged/lib/browser-session-conversion.js +2946 -0
- package/dist/packaged/lib/config-policy.js +599 -0
- package/dist/packaged/lib/parsing.js +34 -0
- package/dist/packaged/lib/playbook.js +728 -0
- package/dist/packaged/lib/results/snapshot.js +2800 -0
- package/dist/packaged/lib/runtime.js +3075 -0
- package/docs/ARCHITECTURE.md +29 -10
- package/docs/CODE_QUALITY.md +32 -5
- package/docs/COMMAND_REFERENCE.md +156 -40
- package/docs/ELECTRON.md +1 -1
- package/docs/PERFORMANCE.md +252 -0
- package/docs/REFERENCE.md +15 -15
- package/docs/RELEASE.md +41 -18
- package/docs/REQUIREMENTS.md +6 -0
- package/docs/SESSION_STORAGE.md +13 -5
- package/docs/SUPPORT_MATRIX.md +31 -25
- package/docs/TOOL_CONTRACT.md +41 -18
- package/docs/performance/2026-10-12.json +7257 -0
- package/docs/platform-smoke.md +18 -14
- package/package.json +18 -4
- package/platform-smoke.config.mjs +3 -2
- package/scripts/agent-browser-capability-baseline.mjs +16 -2
- package/scripts/agent-browser-target.mjs +1 -1
- package/scripts/build.mjs +16 -5
- package/scripts/capability-options.mjs +20 -0
- package/scripts/capability-samples.mjs +23 -10
- package/scripts/config.mjs +1 -1
- package/scripts/convert-browser-session.mjs +1 -1
- package/scripts/platform-smoke/commands.mjs +30 -4
- package/scripts/platform-smoke/doctor-support.mjs +11 -2
- package/scripts/platform-smoke/doctor-windows.mjs +1 -1
- package/scripts/platform-smoke/doctor.mjs +26 -11
- package/scripts/platform-smoke/linux-image/Dockerfile +6 -3
- package/scripts/platform-smoke/platform-build-windows.ps1 +23 -3
- package/scripts/platform-smoke/suite-checks.mjs +11 -1
- package/scripts/platform-smoke/targets.mjs +4 -3
- package/scripts/platform-smoke.mjs +68 -25
- package/dist/extensions/agent-browser/lib/argv-descriptor.js +0 -123
- package/dist/extensions/agent-browser/lib/argv-grammar.js +0 -320
- package/dist/extensions/agent-browser/lib/bash-guard.js +0 -193
- package/dist/extensions/agent-browser/lib/batch-lifecycle.js +0 -131
- package/dist/extensions/agent-browser/lib/browser-execution-claim-codec.js +0 -61
- package/dist/extensions/agent-browser/lib/browser-execution-claim-storage.js +0 -232
- package/dist/extensions/agent-browser/lib/browser-execution-claims.js +0 -202
- package/dist/extensions/agent-browser/lib/browser-execution-identity.js +0 -77
- package/dist/extensions/agent-browser/lib/browser-journal-branch.js +0 -98
- package/dist/extensions/agent-browser/lib/browser-journal-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/browser-journal-projection.js +0 -221
- package/dist/extensions/agent-browser/lib/browser-journal-reader.js +0 -89
- package/dist/extensions/agent-browser/lib/browser-journal-replay.js +0 -246
- package/dist/extensions/agent-browser/lib/browser-journal.js +0 -148
- package/dist/extensions/agent-browser/lib/browser-legacy-pages.js +0 -220
- package/dist/extensions/agent-browser/lib/browser-legacy-projection.js +0 -282
- package/dist/extensions/agent-browser/lib/browser-legacy-types.js +0 -1
- package/dist/extensions/agent-browser/lib/browser-session-conversion-stream.js +0 -217
- package/dist/extensions/agent-browser/lib/browser-session-conversion.js +0 -126
- package/dist/extensions/agent-browser/lib/browser-transcript-contracts.js +0 -35
- package/dist/extensions/agent-browser/lib/browser-transcript-validation.js +0 -166
- package/dist/extensions/agent-browser/lib/browser-transcript.js +0 -189
- package/dist/extensions/agent-browser/lib/browser-value-parsing.js +0 -15
- package/dist/extensions/agent-browser/lib/command-capabilities.js +0 -340
- package/dist/extensions/agent-browser/lib/command-policy.js +0 -155
- package/dist/extensions/agent-browser/lib/command-taxonomy.js +0 -105
- package/dist/extensions/agent-browser/lib/config-policy.js +0 -450
- package/dist/extensions/agent-browser/lib/config-providers.js +0 -71
- package/dist/extensions/agent-browser/lib/config-validation.js +0 -231
- package/dist/extensions/agent-browser/lib/config.js +0 -69
- package/dist/extensions/agent-browser/lib/electron/cdp.js +0 -62
- package/dist/extensions/agent-browser/lib/electron/cleanup.js +0 -274
- package/dist/extensions/agent-browser/lib/electron/discovery-darwin.js +0 -109
- package/dist/extensions/agent-browser/lib/electron/discovery-desktop.js +0 -136
- package/dist/extensions/agent-browser/lib/electron/discovery-evidence.js +0 -90
- package/dist/extensions/agent-browser/lib/electron/discovery-linux.js +0 -93
- package/dist/extensions/agent-browser/lib/electron/discovery-packages.js +0 -162
- package/dist/extensions/agent-browser/lib/electron/discovery-types.js +0 -2
- package/dist/extensions/agent-browser/lib/electron/discovery.js +0 -217
- package/dist/extensions/agent-browser/lib/electron/launch-monitor.js +0 -102
- package/dist/extensions/agent-browser/lib/electron/launch-process.js +0 -209
- package/dist/extensions/agent-browser/lib/electron/launch-types.js +0 -2
- package/dist/extensions/agent-browser/lib/electron/launch.js +0 -340
- package/dist/extensions/agent-browser/lib/executable-path.js +0 -29
- package/dist/extensions/agent-browser/lib/execution-cwd.js +0 -67
- package/dist/extensions/agent-browser/lib/fs-utils.js +0 -10
- package/dist/extensions/agent-browser/lib/input-modes/electron.js +0 -201
- package/dist/extensions/agent-browser/lib/input-modes/job.js +0 -198
- package/dist/extensions/agent-browser/lib/input-modes/lookup-network-evidence.js +0 -116
- package/dist/extensions/agent-browser/lib/input-modes/lookup-plan.js +0 -132
- package/dist/extensions/agent-browser/lib/input-modes/lookup-redaction.js +0 -57
- package/dist/extensions/agent-browser/lib/input-modes/lookup-source-evidence.js +0 -151
- package/dist/extensions/agent-browser/lib/input-modes/lookup-workspace.js +0 -142
- package/dist/extensions/agent-browser/lib/input-modes/lookups.js +0 -84
- package/dist/extensions/agent-browser/lib/input-modes/params.js +0 -195
- package/dist/extensions/agent-browser/lib/input-modes/qa-analysis.js +0 -268
- package/dist/extensions/agent-browser/lib/input-modes/qa-presentation.js +0 -117
- package/dist/extensions/agent-browser/lib/input-modes/script-child.js +0 -396
- package/dist/extensions/agent-browser/lib/input-modes/script-protocol.js +0 -86
- package/dist/extensions/agent-browser/lib/input-modes/script-types.js +0 -1
- package/dist/extensions/agent-browser/lib/input-modes/script-validation.js +0 -60
- package/dist/extensions/agent-browser/lib/input-modes/script.js +0 -108
- package/dist/extensions/agent-browser/lib/input-modes/semantic-action.js +0 -243
- package/dist/extensions/agent-browser/lib/input-modes/shared.js +0 -48
- package/dist/extensions/agent-browser/lib/input-modes/types.js +0 -65
- package/dist/extensions/agent-browser/lib/json-schema.js +0 -65
- package/dist/extensions/agent-browser/lib/launch-scoped-flags.js +0 -212
- package/dist/extensions/agent-browser/lib/managed-session-policy-lock.js +0 -165
- package/dist/extensions/agent-browser/lib/managed-session-posix-storage.js +0 -58
- package/dist/extensions/agent-browser/lib/managed-session-project-identity.js +0 -244
- package/dist/extensions/agent-browser/lib/managed-session-restore-context.js +0 -84
- package/dist/extensions/agent-browser/lib/managed-session-restore-policy.js +0 -119
- package/dist/extensions/agent-browser/lib/managed-session-restore-state.js +0 -83
- package/dist/extensions/agent-browser/lib/managed-session-restore.js +0 -212
- package/dist/extensions/agent-browser/lib/managed-session-snapshot-records.js +0 -277
- package/dist/extensions/agent-browser/lib/managed-session-snapshots.js +0 -181
- package/dist/extensions/agent-browser/lib/managed-session-storage.js +0 -126
- package/dist/extensions/agent-browser/lib/native-confirmation.js +0 -140
- package/dist/extensions/agent-browser/lib/native-output.js +0 -81
- package/dist/extensions/agent-browser/lib/orchestration/batch-stdin.js +0 -182
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-merge.js +0 -30
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-paths.js +0 -188
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/browser-observation-result.js +0 -82
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/click-dispatch.js +0 -406
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostic-values.js +0 -31
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.js +0 -240
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-observation.js +0 -203
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-text-diagnostics.js +0 -109
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/fill-diagnostics.js +0 -119
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-action-recovery.js +0 -147
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-actions.js +0 -144
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-content.js +0 -123
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-details.js +0 -156
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-electron.js +0 -187
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-evidence.js +0 -39
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-missing-binary.js +0 -89
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-recovery.js +0 -97
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-redaction.js +0 -106
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-timeout.js +0 -110
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result.js +0 -53
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/index.js +0 -224
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/interaction-diagnostics.js +0 -290
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-close.js +0 -167
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-inspection.js +0 -108
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-policy.js +0 -174
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/native-helper-observation.js +0 -65
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/observation-types.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/overlay-diagnostics.js +0 -120
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/network-page-filter.js +0 -192
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/scroll-shims.js +0 -225
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter-data.js +0 -150
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter.js +0 -174
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-rendered-text.js +0 -147
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/wait-timeouts.js +0 -145
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-artifacts.js +0 -159
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-command.js +0 -131
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-daemon.js +0 -93
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-failure.js +0 -42
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-guards.js +0 -242
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-input.js +0 -75
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-observations.js +0 -92
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-selection.js +0 -254
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-state.js +0 -121
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-refs.js +0 -130
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-resources.js +0 -114
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-semantic.js +0 -121
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-session-plan.js +0 -222
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-timeouts.js +0 -68
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare.js +0 -202
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-analysis.js +0 -191
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-confirmation.js +0 -152
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-diagnostics.js +0 -182
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-electron.js +0 -150
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase.js +0 -115
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle.js +0 -256
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed.js +0 -256
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase.js +0 -93
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native.js +0 -113
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation.js +0 -316
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-ownership.js +0 -28
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase.js +0 -142
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation.js +0 -333
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase.js +0 -71
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication.js +0 -201
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-receipts.js +0 -183
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-refs.js +0 -200
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-tabs.js +0 -142
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output.js +0 -25
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prompt-guards.js +0 -50
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-receipt-reconciliation.js +0 -198
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-presentation.js +0 -154
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery.js +0 -80
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-capture.js +0 -14
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-observation.js +0 -206
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-commands.js +0 -130
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-electron.js +0 -212
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-observations.js +0 -61
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-outcomes.js +0 -187
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-refs.js +0 -169
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-tabs.js +0 -228
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state.js +0 -117
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/text-visibility-diagnostics.js +0 -182
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-diagnostics.js +0 -256
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-progress.js +0 -108
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/types.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/code-artifact-observation.js +0 -39
- package/dist/extensions/agent-browser/lib/orchestration/code-image-observation.js +0 -119
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/branch.js +0 -93
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup-result.js +0 -58
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup.js +0 -78
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/discovery.js +0 -106
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/index.js +0 -60
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/policy.js +0 -86
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-collection.js +0 -68
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-data.js +0 -169
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-presentation.js +0 -182
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe.js +0 -161
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/status.js +0 -167
- package/dist/extensions/agent-browser/lib/orchestration/execution-queue.js +0 -98
- package/dist/extensions/agent-browser/lib/orchestration/extension-artifact-preflight.js +0 -211
- package/dist/extensions/agent-browser/lib/orchestration/extension-artifacts.js +0 -23
- package/dist/extensions/agent-browser/lib/orchestration/extension-attachment-replay.js +0 -99
- package/dist/extensions/agent-browser/lib/orchestration/extension-branch-restore.js +0 -275
- package/dist/extensions/agent-browser/lib/orchestration/extension-code.js +0 -280
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-admission.js +0 -303
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-output.js +0 -36
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-result.js +0 -335
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-run.js +0 -227
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-state.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/extension-electron-ownership.js +0 -204
- package/dist/extensions/agent-browser/lib/orchestration/extension-execution-locks.js +0 -139
- package/dist/extensions/agent-browser/lib/orchestration/extension-execution-queue.js +0 -24
- package/dist/extensions/agent-browser/lib/orchestration/extension-host-coordination.js +0 -98
- package/dist/extensions/agent-browser/lib/orchestration/extension-host-run.js +0 -295
- package/dist/extensions/agent-browser/lib/orchestration/extension-intent-replay.js +0 -41
- package/dist/extensions/agent-browser/lib/orchestration/extension-invocation.js +0 -7
- package/dist/extensions/agent-browser/lib/orchestration/extension-lifecycle.js +0 -102
- package/dist/extensions/agent-browser/lib/orchestration/extension-managed-ownership.js +0 -133
- package/dist/extensions/agent-browser/lib/orchestration/extension-observation.js +0 -120
- package/dist/extensions/agent-browser/lib/orchestration/extension-prompt.js +0 -180
- package/dist/extensions/agent-browser/lib/orchestration/extension-recording.js +0 -290
- package/dist/extensions/agent-browser/lib/orchestration/extension-resource-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/extension-resource-replay.js +0 -269
- package/dist/extensions/agent-browser/lib/orchestration/extension-result-state.js +0 -113
- package/dist/extensions/agent-browser/lib/orchestration/extension-runtime.js +0 -146
- package/dist/extensions/agent-browser/lib/orchestration/extension-script-leases.js +0 -58
- package/dist/extensions/agent-browser/lib/orchestration/extension-tool-boundary.js +0 -62
- package/dist/extensions/agent-browser/lib/orchestration/extension-version-check.js +0 -54
- package/dist/extensions/agent-browser/lib/orchestration/input-plan-types.js +0 -1
- package/dist/extensions/agent-browser/lib/orchestration/input-plan.js +0 -313
- package/dist/extensions/agent-browser/lib/orchestration/input-redaction.js +0 -62
- package/dist/extensions/agent-browser/lib/orchestration/native-config.js +0 -144
- package/dist/extensions/agent-browser/lib/orchestration/native-root-launch.js +0 -77
- package/dist/extensions/agent-browser/lib/orchestration/native-session-defaults.js +0 -231
- package/dist/extensions/agent-browser/lib/orchestration/operation-paths.js +0 -142
- package/dist/extensions/agent-browser/lib/orchestration/output-file.js +0 -276
- package/dist/extensions/agent-browser/lib/orchestration/script-mode.js +0 -220
- package/dist/extensions/agent-browser/lib/owned-managed-session-context.js +0 -55
- package/dist/extensions/agent-browser/lib/page-target-batch.js +0 -118
- package/dist/extensions/agent-browser/lib/page-target-guards.js +0 -50
- package/dist/extensions/agent-browser/lib/page-target-navigation.js +0 -104
- package/dist/extensions/agent-browser/lib/page-target-validation.js +0 -90
- package/dist/extensions/agent-browser/lib/parsing.js +0 -30
- package/dist/extensions/agent-browser/lib/pi-tool-rendering.js +0 -343
- package/dist/extensions/agent-browser/lib/playbook.js +0 -146
- package/dist/extensions/agent-browser/lib/process-child.js +0 -284
- package/dist/extensions/agent-browser/lib/process-environment.js +0 -48
- package/dist/extensions/agent-browser/lib/process-errors.js +0 -23
- package/dist/extensions/agent-browser/lib/process-identity.js +0 -127
- package/dist/extensions/agent-browser/lib/process-socket-storage.js +0 -256
- package/dist/extensions/agent-browser/lib/process-stdout.js +0 -74
- package/dist/extensions/agent-browser/lib/process.js +0 -216
- package/dist/extensions/agent-browser/lib/prompt-artifacts.js +0 -287
- package/dist/extensions/agent-browser/lib/prompt-policy.js +0 -54
- package/dist/extensions/agent-browser/lib/read-command.js +0 -41
- package/dist/extensions/agent-browser/lib/read-confirmation.js +0 -162
- package/dist/extensions/agent-browser/lib/recording-reservations.js +0 -208
- package/dist/extensions/agent-browser/lib/redaction-fields.js +0 -75
- package/dist/extensions/agent-browser/lib/redaction-json.js +0 -149
- package/dist/extensions/agent-browser/lib/redaction-url.js +0 -88
- package/dist/extensions/agent-browser/lib/results/action-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/action-recommendations.js +0 -38
- package/dist/extensions/agent-browser/lib/results/artifact-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/artifact-manifest-validation.js +0 -133
- package/dist/extensions/agent-browser/lib/results/artifact-manifest.js +0 -173
- package/dist/extensions/agent-browser/lib/results/artifact-recommendations.js +0 -73
- package/dist/extensions/agent-browser/lib/results/categories.js +0 -152
- package/dist/extensions/agent-browser/lib/results/confirmation.js +0 -75
- package/dist/extensions/agent-browser/lib/results/contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/editable-ref-evidence.js +0 -99
- package/dist/extensions/agent-browser/lib/results/electron-recommendations.js +0 -83
- package/dist/extensions/agent-browser/lib/results/envelope-decoding.js +0 -48
- package/dist/extensions/agent-browser/lib/results/envelope.js +0 -198
- package/dist/extensions/agent-browser/lib/results/evidence-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/failure-recommendations.js +0 -180
- package/dist/extensions/agent-browser/lib/results/network-routes.js +0 -133
- package/dist/extensions/agent-browser/lib/results/network.js +0 -89
- package/dist/extensions/agent-browser/lib/results/next-actions.js +0 -111
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-files.js +0 -320
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-format.js +0 -138
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-images.js +0 -113
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-verification.js +0 -145
- package/dist/extensions/agent-browser/lib/results/presentation/artifacts.js +0 -165
- package/dist/extensions/agent-browser/lib/results/presentation/batch-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/presentation/batch-recording.js +0 -118
- package/dist/extensions/agent-browser/lib/results/presentation/batch-redaction.js +0 -68
- package/dist/extensions/agent-browser/lib/results/presentation/batch-rendering.js +0 -135
- package/dist/extensions/agent-browser/lib/results/presentation/batch-step.js +0 -227
- package/dist/extensions/agent-browser/lib/results/presentation/batch-summary.js +0 -91
- package/dist/extensions/agent-browser/lib/results/presentation/batch.js +0 -123
- package/dist/extensions/agent-browser/lib/results/presentation/browser-profile-recovery.js +0 -54
- package/dist/extensions/agent-browser/lib/results/presentation/command-presenters.js +0 -216
- package/dist/extensions/agent-browser/lib/results/presentation/common.js +0 -81
- package/dist/extensions/agent-browser/lib/results/presentation/content.js +0 -119
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-a11y.js +0 -67
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-health.js +0 -79
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-identity.js +0 -199
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-logs.js +0 -75
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network-actions.js +0 -216
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network.js +0 -124
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-redaction.js +0 -64
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-storage.js +0 -209
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-stream.js +0 -69
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-summary.js +0 -222
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostics.js +0 -124
- package/dist/extensions/agent-browser/lib/results/presentation/early-result.js +0 -70
- package/dist/extensions/agent-browser/lib/results/presentation/errors.js +0 -285
- package/dist/extensions/agent-browser/lib/results/presentation/input-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/presentation/large-output.js +0 -117
- package/dist/extensions/agent-browser/lib/results/presentation/navigation.js +0 -231
- package/dist/extensions/agent-browser/lib/results/presentation/notices.js +0 -75
- package/dist/extensions/agent-browser/lib/results/presentation/observation-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/presentation/observation-rendering.js +0 -127
- package/dist/extensions/agent-browser/lib/results/presentation/outcomes.js +0 -120
- package/dist/extensions/agent-browser/lib/results/presentation/output-completion.js +0 -77
- package/dist/extensions/agent-browser/lib/results/presentation/output-spill.js +0 -51
- package/dist/extensions/agent-browser/lib/results/presentation/registry.js +0 -145
- package/dist/extensions/agent-browser/lib/results/presentation/semantic-action.js +0 -104
- package/dist/extensions/agent-browser/lib/results/presentation/skills.js +0 -183
- package/dist/extensions/agent-browser/lib/results/presentation/source.js +0 -109
- package/dist/extensions/agent-browser/lib/results/presentation.js +0 -19
- package/dist/extensions/agent-browser/lib/results/recommendation-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/results/recording.js +0 -88
- package/dist/extensions/agent-browser/lib/results/recovery-actions.js +0 -118
- package/dist/extensions/agent-browser/lib/results/recovery-next-actions.js +0 -60
- package/dist/extensions/agent-browser/lib/results/selector-recovery-target.js +0 -83
- package/dist/extensions/agent-browser/lib/results/selector-recovery.js +0 -261
- package/dist/extensions/agent-browser/lib/results/snapshot-compact.js +0 -266
- package/dist/extensions/agent-browser/lib/results/snapshot-content.js +0 -32
- package/dist/extensions/agent-browser/lib/results/snapshot-high-value-controls.js +0 -240
- package/dist/extensions/agent-browser/lib/results/snapshot-refs.js +0 -103
- package/dist/extensions/agent-browser/lib/results/snapshot-segments.js +0 -383
- package/dist/extensions/agent-browser/lib/results/snapshot-spill.js +0 -53
- package/dist/extensions/agent-browser/lib/results/snapshot.js +0 -44
- package/dist/extensions/agent-browser/lib/results/text.js +0 -44
- package/dist/extensions/agent-browser/lib/runtime-args-validation.js +0 -133
- package/dist/extensions/agent-browser/lib/runtime-compatibility.js +0 -81
- package/dist/extensions/agent-browser/lib/runtime-contracts.js +0 -1
- package/dist/extensions/agent-browser/lib/runtime-redaction.js +0 -118
- package/dist/extensions/agent-browser/lib/runtime-replay-events.js +0 -144
- package/dist/extensions/agent-browser/lib/runtime-session-identity.js +0 -76
- package/dist/extensions/agent-browser/lib/runtime-session-plan.js +0 -114
- package/dist/extensions/agent-browser/lib/runtime-session-replay.js +0 -123
- package/dist/extensions/agent-browser/lib/runtime-tab-correction.js +0 -65
- package/dist/extensions/agent-browser/lib/runtime-timeouts.js +0 -28
- package/dist/extensions/agent-browser/lib/runtime.js +0 -163
- package/dist/extensions/agent-browser/lib/session-identity.js +0 -51
- package/dist/extensions/agent-browser/lib/session-page-observation.js +0 -357
- package/dist/extensions/agent-browser/lib/session-page-state.js +0 -353
- package/dist/extensions/agent-browser/lib/session-page-types.js +0 -1
- package/dist/extensions/agent-browser/lib/string-enum-schema.js +0 -8
- package/dist/extensions/agent-browser/lib/temp-artifact-budget.js +0 -81
- package/dist/extensions/agent-browser/lib/temp-mutation-queue.js +0 -7
- package/dist/extensions/agent-browser/lib/temp-root-ownership.js +0 -234
- package/dist/extensions/agent-browser/lib/temp-root.js +0 -211
- package/dist/extensions/agent-browser/lib/temp.js +0 -91
- package/dist/extensions/agent-browser/lib/tool-surface.js +0 -239
- package/dist/extensions/agent-browser/lib/upstream-version.js +0 -15
- package/dist/extensions/agent-browser/lib/web-search-providers.js +0 -193
- package/dist/extensions/agent-browser/lib/web-search-request.js +0 -102
- package/dist/extensions/agent-browser/lib/web-search-results.js +0 -281
- package/dist/extensions/agent-browser/lib/web-search-schema.js +0 -82
- package/dist/extensions/agent-browser/lib/web-search.js +0 -167
- package/dist/extensions/agent-browser/lib/webmcp-observation.js +0 -35
- package/dist/extensions/agent-browser/lib/windows-stock-launcher.js +0 -96
- package/dist/scripts/agent-browser-target.mjs +0 -23
package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { buildOutputStatePatch } from "./process-output-ownership.js";
|
|
2
|
-
import { isRecordPageTransitionCommand } from "../../command-taxonomy.js";
|
|
3
|
-
import { isRecord } from "../../parsing.js";
|
|
4
|
-
import { extractUpstreamCommandTokens } from "../../argv-descriptor.js";
|
|
5
|
-
import { buildAboutBlankWarning, formatElectronPostCommandHealthText, formatElectronSessionMismatchText, } from "./session-state.js";
|
|
6
|
-
import { getArtifactCleanupGuidance } from "./diagnostics.js";
|
|
7
|
-
import { buildFinalAgentBrowserToolResult, buildRedactedPresentationContent, prepareFinalResultRecoveryState, } from "./final-result.js";
|
|
8
|
-
function recordingPageWarning(draft) {
|
|
9
|
-
const reached = draft.input.prepared.executionPlan.commandInfo.command === "batch"
|
|
10
|
-
? draft.presentation.batchSteps?.some((step) => isRecordPageTransitionCommand(extractUpstreamCommandTokens(step.command ?? []))) === true
|
|
11
|
-
: isRecordPageTransitionCommand(draft.input.prepared.commandTokens);
|
|
12
|
-
if (!draft.input.processResult.agentBrowserStarted ||
|
|
13
|
-
draft.input.prepared.executionPlan.plainTextInspection ||
|
|
14
|
-
!reached) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
return "Page state: this wrapper conservatively invalidates earlier refs after recording starts and URL-bearing restarts. Take a fresh snapshot before continuing; this does not prove the page changed.";
|
|
18
|
-
}
|
|
19
|
-
function sessionWarning(draft) {
|
|
20
|
-
if (draft.electronPostCommandHealth) {
|
|
21
|
-
return formatElectronPostCommandHealthText(draft.electronPostCommandHealth);
|
|
22
|
-
}
|
|
23
|
-
if (draft.electronSessionMismatch) {
|
|
24
|
-
return formatElectronSessionMismatchText(draft.electronSessionMismatch);
|
|
25
|
-
}
|
|
26
|
-
return draft.aboutBlankSessionMismatch
|
|
27
|
-
? buildAboutBlankWarning(draft.aboutBlankSessionMismatch)
|
|
28
|
-
: undefined;
|
|
29
|
-
}
|
|
30
|
-
export async function collectPublicationWarnings(draft) {
|
|
31
|
-
draft.resultArtifactManifest = draft.presentation.artifactManifest ?? draft.artifactManifest;
|
|
32
|
-
draft.artifactCleanup = await getArtifactCleanupGuidance({
|
|
33
|
-
command: draft.input.prepared.executionPlan.commandInfo.command,
|
|
34
|
-
cwd: draft.input.cwd,
|
|
35
|
-
manifest: draft.resultArtifactManifest,
|
|
36
|
-
succeeded: draft.succeeded,
|
|
37
|
-
});
|
|
38
|
-
const warnings = [sessionWarning(draft), recordingPageWarning(draft)]
|
|
39
|
-
.filter((part) => part !== undefined && part.length > 0)
|
|
40
|
-
.join("\n\n");
|
|
41
|
-
draft.redactedContent =
|
|
42
|
-
draft.input.modelVisible === false
|
|
43
|
-
? []
|
|
44
|
-
: buildRedactedPresentationContent({
|
|
45
|
-
exactSensitiveValues: draft.input.prepared.exactSensitiveValues,
|
|
46
|
-
plainTextInspection: draft.plainTextInspection,
|
|
47
|
-
presentation: draft.presentation,
|
|
48
|
-
presentationEnvelope: draft.presentationEnvelope,
|
|
49
|
-
succeeded: draft.succeeded,
|
|
50
|
-
userRequestedJson: draft.input.prepared.userRequestedJson,
|
|
51
|
-
warningText: warnings.length > 0 ? warnings : undefined,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export async function recoverFinalOutput(draft) {
|
|
55
|
-
const recovery = await prepareFinalResultRecoveryState({
|
|
56
|
-
aboutBlankSessionMismatch: draft.aboutBlankSessionMismatch,
|
|
57
|
-
batchRefSnapshotState: draft.batchRefSnapshotState,
|
|
58
|
-
commandTokens: draft.input.prepared.commandTokens,
|
|
59
|
-
compiledSemanticAction: draft.input.prepared.compiledSemanticAction,
|
|
60
|
-
currentRefSnapshot: draft.currentRefSnapshot,
|
|
61
|
-
currentRefSnapshotInvalidation: draft.currentRefSnapshotInvalidation,
|
|
62
|
-
currentSessionTabTarget: draft.currentSessionTabTarget,
|
|
63
|
-
cwd: draft.input.cwd,
|
|
64
|
-
electronPostCommandHealth: draft.electronPostCommandHealth,
|
|
65
|
-
errorText: draft.errorText,
|
|
66
|
-
executionPlan: draft.input.prepared.executionPlan,
|
|
67
|
-
parseError: draft.parseError,
|
|
68
|
-
plainTextInspection: draft.plainTextInspection,
|
|
69
|
-
presentation: draft.presentation,
|
|
70
|
-
processResult: draft.input.processResult,
|
|
71
|
-
redactedProcessArgs: draft.input.prepared.redactedProcessArgs,
|
|
72
|
-
runtimeToolArgs: draft.input.prepared.runtimeToolArgs,
|
|
73
|
-
sessionPageState: draft.input.state.sessionPageState,
|
|
74
|
-
sessionPageStateUpdate: draft.input.sessionPageStateUpdate,
|
|
75
|
-
sessionTabCorrection: draft.sessionTabCorrection,
|
|
76
|
-
signal: draft.input.signal,
|
|
77
|
-
succeeded: draft.succeeded,
|
|
78
|
-
});
|
|
79
|
-
draft.currentRefSnapshot = recovery.currentRefSnapshot;
|
|
80
|
-
draft.currentRefSnapshotInvalidation = recovery.currentRefSnapshotInvalidation;
|
|
81
|
-
return recovery;
|
|
82
|
-
}
|
|
83
|
-
export function buildOutputResult(sources, recovery) {
|
|
84
|
-
const { input, native, page, lifecycle, publication } = sources;
|
|
85
|
-
const result = buildFinalAgentBrowserToolResult({
|
|
86
|
-
modelVisible: input.modelVisible,
|
|
87
|
-
aboutBlankSessionMismatch: lifecycle.aboutBlankSessionMismatch,
|
|
88
|
-
artifactCleanup: publication.artifactCleanup,
|
|
89
|
-
categoryDetails: recovery.categoryDetails,
|
|
90
|
-
clickDispatchDiagnostic: page.clickDispatchDiagnostic,
|
|
91
|
-
commandTokens: input.prepared.commandTokens,
|
|
92
|
-
comboboxFocusDiagnostic: page.diagnostics.comboboxFocusDiagnostic,
|
|
93
|
-
compiledNetworkSourceLookup: input.prepared.compiledNetworkSourceLookup,
|
|
94
|
-
compiledSemanticAction: input.prepared.compiledSemanticAction,
|
|
95
|
-
compatibilityWorkaround: input.prepared.compatibilityWorkaround,
|
|
96
|
-
currentRefSnapshot: input.modelVisible === false ? undefined : publication.currentRefSnapshot,
|
|
97
|
-
currentRefSnapshotInvalidation: publication.currentRefSnapshotInvalidation,
|
|
98
|
-
currentSessionTabTarget: publication.currentSessionTabTarget,
|
|
99
|
-
currentSessionTabTargetUnknown: publication.currentSessionTabTargetUnknown,
|
|
100
|
-
...electronResultEvidence(sources),
|
|
101
|
-
...invocationResultEvidence(sources),
|
|
102
|
-
...launchResultEvidence(sources),
|
|
103
|
-
errorText: lifecycle.errorText,
|
|
104
|
-
evalResultWarning: publication.evalResultWarning,
|
|
105
|
-
evalStdinHint: publication.evalStdinHint,
|
|
106
|
-
exactSensitiveValues: input.prepared.exactSensitiveValues,
|
|
107
|
-
executionPlan: input.prepared.executionPlan,
|
|
108
|
-
fillVerificationDiagnostic: page.diagnostics.fillVerificationDiagnostic,
|
|
109
|
-
inspectionText: native.inspectionText,
|
|
110
|
-
navigationSummary: page.navigationSummary,
|
|
111
|
-
networkSourceLookup: publication.networkSourceLookup,
|
|
112
|
-
noActivePageSnapshotFailure: recovery.noActivePageSnapshotFailure,
|
|
113
|
-
openResultTabCorrection: lifecycle.openResultTabCorrection,
|
|
114
|
-
overlayBlockerDiagnostic: page.diagnostics.overlayBlockerDiagnostic,
|
|
115
|
-
parseError: lifecycle.parseError,
|
|
116
|
-
parseFailureOutput: native.parseFailureOutput,
|
|
117
|
-
parseSucceeded: lifecycle.parseSucceeded,
|
|
118
|
-
plainTextInspection: lifecycle.plainTextInspection,
|
|
119
|
-
presentation: publication.presentation,
|
|
120
|
-
presentationEnvelope: publication.presentationEnvelope,
|
|
121
|
-
priorSessionTabTarget: input.prepared.priorSessionTabTarget,
|
|
122
|
-
processResult: input.processResult,
|
|
123
|
-
qaAttachedTarget: publication.qaAttachedTarget,
|
|
124
|
-
qaPreset: publication.qaPreset,
|
|
125
|
-
recordingDependencyWarning: page.diagnostics.recordingDependencyWarning,
|
|
126
|
-
resultArtifactManifest: publication.resultArtifactManifest,
|
|
127
|
-
richInputRecoveryDiagnostic: recovery.richInputRecoveryDiagnostic,
|
|
128
|
-
scrollNoopDiagnostic: page.diagnostics.scrollNoopDiagnostic,
|
|
129
|
-
selectorTextVisibilityDiagnostics: page.diagnostics.selectorTextVisibilityDiagnostics,
|
|
130
|
-
sessionMode: input.prepared.sessionMode,
|
|
131
|
-
sessionTabCorrection: lifecycle.sessionTabCorrection,
|
|
132
|
-
sourceLookup: publication.sourceLookup,
|
|
133
|
-
succeeded: publication.succeeded,
|
|
134
|
-
timeoutPartialProgress: lifecycle.timeoutPartialProgress,
|
|
135
|
-
unsettledWebMcpMutation: page.unsettledWebMcpMutation,
|
|
136
|
-
userRequestedJson: input.prepared.userRequestedJson,
|
|
137
|
-
visibleRefFallbackDiagnostic: recovery.visibleRefFallbackDiagnostic,
|
|
138
|
-
visibleRefFallbackSessionName: recovery.visibleRefFallbackSessionName,
|
|
139
|
-
});
|
|
140
|
-
const resultWithCloseAll = attachCloseAllReceipt(lifecycle, result);
|
|
141
|
-
const statePatch = buildOutputStatePatch({
|
|
142
|
-
...lifecycle,
|
|
143
|
-
artifactManifest: publication.artifactManifest,
|
|
144
|
-
networkRoutesBySession: publication.networkRoutesBySession,
|
|
145
|
-
});
|
|
146
|
-
return { result: resultWithCloseAll, statePatch };
|
|
147
|
-
}
|
|
148
|
-
function launchResultEvidence(sources) {
|
|
149
|
-
const { input, lifecycle, publication } = sources;
|
|
150
|
-
return {
|
|
151
|
-
headedLaunch: input.prepared.headedLaunch,
|
|
152
|
-
preserveAttachedBrowserSession: input.preserveAttachedBrowserSession === true,
|
|
153
|
-
providerLaunch: input.prepared.providerLaunch,
|
|
154
|
-
managedSessionHeadedAutosaveDisabled: (!(input.prepared.ownedManagedSessionContext?.reuseOnly === true) &&
|
|
155
|
-
lifecycle.resultHeadedManagedAutosaveDisabled) ||
|
|
156
|
-
undefined,
|
|
157
|
-
managedSessionHeadedAutosaveInterval: input.prepared.ownedManagedSessionContext?.reuseOnly === true
|
|
158
|
-
? undefined
|
|
159
|
-
: lifecycle.resultHeadedManagedAutosaveInterval,
|
|
160
|
-
managedSessionOutcome: publication.managedSessionOutcome,
|
|
161
|
-
managedSessionRestoreDisabled: input.state.managedSessionRestoreState.isDisabled(input.prepared.executionPlan.sessionName, input.prepared.executionPlan.namespace),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
function electronResultEvidence(sources) {
|
|
165
|
-
const { input, page, lifecycle } = sources;
|
|
166
|
-
return {
|
|
167
|
-
electronBroadGetTextScopeDiagnostics: page.diagnostics.electronBroadGetTextScopeDiagnostics,
|
|
168
|
-
electronFailedConnectCleanup: lifecycle.electronFailedConnectCleanup,
|
|
169
|
-
electronHandoff: lifecycle.electronHandoff,
|
|
170
|
-
electronLaunch: input.prepared.electronLaunch,
|
|
171
|
-
electronLaunchRecord: lifecycle.electronLaunchRecord,
|
|
172
|
-
electronLaunchRecords: input.state.electronLaunchRecords,
|
|
173
|
-
electronPostCommandHealth: page.electronPostCommandHealth,
|
|
174
|
-
electronProfileIsolationDetails: input.electronProfileIsolationDetails,
|
|
175
|
-
electronRefFreshnessDiagnostic: page.diagnostics.electronRefFreshnessDiagnostic,
|
|
176
|
-
electronSessionMismatch: page.electronSessionMismatch,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function invocationResultEvidence(sources) {
|
|
180
|
-
const { input, publication } = sources;
|
|
181
|
-
return {
|
|
182
|
-
redactedArgs: input.prepared.redactedArgs,
|
|
183
|
-
redactedCompiledElectron: input.prepared.redactedCompiledElectron,
|
|
184
|
-
redactedCompiledJob: input.prepared.redactedCompiledJob,
|
|
185
|
-
redactedCompiledNetworkSourceLookup: input.prepared.redactedCompiledNetworkSourceLookup,
|
|
186
|
-
redactedCompiledQaPreset: input.prepared.redactedCompiledQaPreset,
|
|
187
|
-
redactedCompiledSemanticAction: input.prepared.redactedCompiledSemanticAction,
|
|
188
|
-
redactedCompiledSourceLookup: input.prepared.redactedCompiledSourceLookup,
|
|
189
|
-
redactedContent: publication.redactedContent,
|
|
190
|
-
redactedProcessArgs: input.prepared.redactedProcessArgs,
|
|
191
|
-
redactedRecoveryHint: input.prepared.redactedRecoveryHint,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function attachCloseAllReceipt(draft, result) {
|
|
195
|
-
return draft.closeAllApplied
|
|
196
|
-
? {
|
|
197
|
-
...result,
|
|
198
|
-
details: { ...(isRecord(result.details) ? result.details : {}), closeAllApplied: true },
|
|
199
|
-
}
|
|
200
|
-
: result;
|
|
201
|
-
}
|
package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-receipts.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { buildOutputStatePatch } from "./process-output-ownership.js";
|
|
2
|
-
import { isStringArray } from "../../results/presentation/content.js";
|
|
3
|
-
import { extractAgentBrowserLifecycle } from "../../results/presentation/common.js";
|
|
4
|
-
import { detectConfirmationRequired } from "../../results/confirmation.js";
|
|
5
|
-
import { isSuccessfulNativeConfirmedClose } from "../../read-confirmation.js";
|
|
6
|
-
import { extractRefSnapshotFromData } from "../../session-page-state.js";
|
|
7
|
-
import { isRecord } from "../../parsing.js";
|
|
8
|
-
import { redactInvocationArgs } from "../../runtime-redaction.js";
|
|
9
|
-
import { inspectManagedSessionDaemon, } from "./managed-session-daemon-policy.js";
|
|
10
|
-
import { applyBrowserRunStatePatch } from "./session-state.js";
|
|
11
|
-
function observedBatchCommand(row) {
|
|
12
|
-
if (!isStringArray(row.command)) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
return isSuccessfulNativeConfirmedClose(row.command, row.result)
|
|
16
|
-
? ["close"]
|
|
17
|
-
: redactInvocationArgs(row.command);
|
|
18
|
-
}
|
|
19
|
-
function observedBatchSteps(draft) {
|
|
20
|
-
const data = draft.presentationEnvelope?.data;
|
|
21
|
-
if (!Array.isArray(data)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return data.flatMap((row) => {
|
|
25
|
-
if (!isRecord(row)) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
return [
|
|
29
|
-
{
|
|
30
|
-
command: observedBatchCommand(row),
|
|
31
|
-
success: row.success === true && !detectConfirmationRequired(row.result),
|
|
32
|
-
lifecycle: extractAgentBrowserLifecycle(row.result),
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
export function commitObservedLifecycle(draft) {
|
|
38
|
-
const { prepared, state, processResult } = draft.input;
|
|
39
|
-
// Native ownership must be committed before rendering or result export can fail.
|
|
40
|
-
applyBrowserRunStatePatch(state, buildOutputStatePatch(draft));
|
|
41
|
-
state.observedBrowserEffects = {
|
|
42
|
-
args: prepared.redactedArgs,
|
|
43
|
-
command: draft.directClose ? "close" : prepared.executionPlan.commandInfo.command,
|
|
44
|
-
subcommand: draft.directClose ? undefined : prepared.executionPlan.commandInfo.subcommand,
|
|
45
|
-
sessionName: prepared.executionPlan.sessionName,
|
|
46
|
-
namespace: prepared.executionPlan.namespace,
|
|
47
|
-
sessionMode: prepared.sessionMode,
|
|
48
|
-
usedImplicitSession: prepared.executionPlan.usedImplicitSession,
|
|
49
|
-
agentBrowserStarted: processResult.agentBrowserStarted,
|
|
50
|
-
nativeSucceeded: draft.succeeded,
|
|
51
|
-
managedSessionOutcome: draft.managedSessionOutcome,
|
|
52
|
-
managedSessionCwd: prepared.ownedManagedSessionContext?.cwd ?? draft.managedSessionCwd,
|
|
53
|
-
compatibilityWorkaround: prepared.compatibilityWorkaround,
|
|
54
|
-
managedSessionHeadedAutosaveDisabled: draft.resultHeadedManagedAutosaveDisabled,
|
|
55
|
-
managedSessionHeadedAutosaveInterval: draft.resultHeadedManagedAutosaveInterval,
|
|
56
|
-
managedSessionRestoreDisabled: state.managedSessionRestoreState.isDisabled(prepared.executionPlan.sessionName, prepared.executionPlan.namespace),
|
|
57
|
-
closeAllApplied: draft.closeAllApplied,
|
|
58
|
-
readConfirmation: draft.readConfirmationEvent ??
|
|
59
|
-
prepared.readConfirmation ??
|
|
60
|
-
state.observedBrowserEffects?.readConfirmation,
|
|
61
|
-
electron: draft.electronLaunchRecord
|
|
62
|
-
? { launch: draft.electronLaunchRecord, cleanup: draft.electronFailedConnectCleanup }
|
|
63
|
-
: undefined,
|
|
64
|
-
batchSteps: observedBatchSteps(draft),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function managedLaunchRetained(draft) {
|
|
68
|
-
return (draft.succeeded ||
|
|
69
|
-
(draft.managedSessionOutcome?.activeAfter === true &&
|
|
70
|
-
draft.managedSessionOutcome.currentSessionName ===
|
|
71
|
-
draft.input.prepared.executionPlan.sessionName));
|
|
72
|
-
}
|
|
73
|
-
function needsDaemonReceipt(draft) {
|
|
74
|
-
const { prepared, state, processResult } = draft.input;
|
|
75
|
-
const owned = prepared.ownedManagedSessionContext;
|
|
76
|
-
return (owned !== undefined &&
|
|
77
|
-
owned.reuseOnly !== true &&
|
|
78
|
-
!draft.commandClosesSession &&
|
|
79
|
-
processResult.agentBrowserStarted &&
|
|
80
|
-
managedLaunchRetained(draft) &&
|
|
81
|
-
!state.managedSessionRestoreState.getDaemonReceipt(prepared.executionPlan.sessionName, prepared.executionPlan.namespace));
|
|
82
|
-
}
|
|
83
|
-
function bindDaemonEvidence(draft, daemon, sessionKey, newSnapshot) {
|
|
84
|
-
const { prepared, state } = draft.input;
|
|
85
|
-
if (newSnapshot) {
|
|
86
|
-
state.sessionPageState.bindSnapshotGeneration(sessionKey, daemon.status === "active" ? daemon.generation : undefined);
|
|
87
|
-
draft.currentRefSnapshot = state.sessionPageState.get(sessionKey).refSnapshot;
|
|
88
|
-
}
|
|
89
|
-
if (prepared.ownedManagedSessionContext &&
|
|
90
|
-
daemon.status === "active" &&
|
|
91
|
-
daemon.generation !== undefined &&
|
|
92
|
-
daemon.generation.length > 0) {
|
|
93
|
-
state.managedSessionRestoreState.recordDaemonRestoreKey(prepared.executionPlan.sessionName, prepared.executionPlan.namespace, daemon.restoreKey, daemon.generation);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function hasNewSnapshot(draft) {
|
|
97
|
-
const snapshot = draft.authoritativePageState?.refSnapshot;
|
|
98
|
-
return (snapshot !== undefined &&
|
|
99
|
-
snapshot.snapshotId !== draft.input.prepared.priorRefSnapshotState?.snapshotId);
|
|
100
|
-
}
|
|
101
|
-
function daemonReceiptIdentity(draft) {
|
|
102
|
-
const sessionKey = draft.sessionStateKey;
|
|
103
|
-
const sessionName = draft.input.prepared.executionPlan.sessionName;
|
|
104
|
-
if (sessionKey === undefined ||
|
|
105
|
-
sessionKey.length === 0 ||
|
|
106
|
-
sessionName === undefined ||
|
|
107
|
-
sessionName.length === 0) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
return { sessionKey, sessionName };
|
|
111
|
-
}
|
|
112
|
-
function daemonAutosaveInterval(draft) {
|
|
113
|
-
const owned = draft.input.prepared.ownedManagedSessionContext;
|
|
114
|
-
return (owned?.headedManagedAutosaveInterval ??
|
|
115
|
-
(owned?.headedManagedAutosaveDisabled === true ? "0" : undefined));
|
|
116
|
-
}
|
|
117
|
-
export async function bindOutputDaemonReceipt(draft) {
|
|
118
|
-
const sessionKey = draft.sessionStateKey;
|
|
119
|
-
const { prepared, state, cwd, signal } = draft.input;
|
|
120
|
-
draft.authoritativePageState =
|
|
121
|
-
sessionKey !== undefined && sessionKey.length > 0
|
|
122
|
-
? state.sessionPageState.get(sessionKey)
|
|
123
|
-
: undefined;
|
|
124
|
-
const newSnapshot = hasNewSnapshot(draft);
|
|
125
|
-
const receiptNeeded = needsDaemonReceipt(draft);
|
|
126
|
-
const identity = daemonReceiptIdentity(draft);
|
|
127
|
-
if (!identity || (!newSnapshot && !receiptNeeded)) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const { sessionKey: key, sessionName } = identity;
|
|
131
|
-
const daemon = await inspectManagedSessionDaemon({
|
|
132
|
-
cwd,
|
|
133
|
-
namespace: prepared.executionPlan.namespace,
|
|
134
|
-
sessionName,
|
|
135
|
-
signal,
|
|
136
|
-
includeGeneration: true,
|
|
137
|
-
headedManagedAutosaveInterval: daemonAutosaveInterval(draft),
|
|
138
|
-
timeoutMs: prepared.processTimeoutMs,
|
|
139
|
-
});
|
|
140
|
-
bindDaemonEvidence(draft, daemon, key, newSnapshot);
|
|
141
|
-
}
|
|
142
|
-
function confirmedSnapshotEvidenceComplete(draft) {
|
|
143
|
-
return (draft.sessionStateKey !== undefined &&
|
|
144
|
-
draft.sessionStateKey.length > 0 &&
|
|
145
|
-
draft.currentRefSnapshot !== undefined &&
|
|
146
|
-
draft.processSucceeded &&
|
|
147
|
-
draft.parseSucceeded &&
|
|
148
|
-
!draft.unobservedMutation);
|
|
149
|
-
}
|
|
150
|
-
function lastRowConfirmedSnapshot(draft) {
|
|
151
|
-
const data = draft.presentationEnvelope?.data;
|
|
152
|
-
const lastIndex = Array.isArray(data) ? data.length - 1 : 0;
|
|
153
|
-
return draft.confirmedEffects.some((effect) => effect.command === "snapshot" &&
|
|
154
|
-
effect.succeeded &&
|
|
155
|
-
effect.index === lastIndex &&
|
|
156
|
-
extractRefSnapshotFromData(effect.data) !== undefined);
|
|
157
|
-
}
|
|
158
|
-
function markFreshConfirmedSnapshot(draft) {
|
|
159
|
-
const confirmation = draft.readConfirmationEvent;
|
|
160
|
-
if (confirmation?.state !== "cleared" ||
|
|
161
|
-
confirmation.command !== "snapshot" ||
|
|
162
|
-
confirmation.action !== "snapshot") {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (!confirmedSnapshotEvidenceComplete(draft) || !lastRowConfirmedSnapshot(draft)) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
draft.readConfirmationEvent = { ...confirmation, refSnapshotFresh: true };
|
|
169
|
-
draft.presentation.readConfirmation = draft.readConfirmationEvent;
|
|
170
|
-
draft.input.state.sessionPageState.applyReadConfirmation(draft.readConfirmationEvent, draft.input.sessionPageStateUpdate);
|
|
171
|
-
draft.input.state.observedBrowserEffects = {
|
|
172
|
-
...draft.input.state.observedBrowserEffects,
|
|
173
|
-
readConfirmation: draft.readConfirmationEvent,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
export function publishConfirmedSnapshot(draft) {
|
|
177
|
-
markFreshConfirmedSnapshot(draft);
|
|
178
|
-
if (draft.sessionStateKey !== undefined && draft.sessionStateKey.length > 0) {
|
|
179
|
-
draft.currentSessionTabTarget = draft.authoritativePageState?.tabTarget;
|
|
180
|
-
}
|
|
181
|
-
draft.currentSessionTabTargetUnknown =
|
|
182
|
-
draft.authoritativePageState?.tabTargetUnknown === true ? true : undefined;
|
|
183
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { buildPageTransitionRefSnapshotInvalidation, getCommandRefSnapshotInvalidation, extractLatestRefSnapshotStateFromBatchResults, extractRefSnapshotFromData, } from "../../session-page-state.js";
|
|
2
|
-
import { isRecord } from "../../parsing.js";
|
|
3
|
-
import { runSessionCommandData } from "./session-state.js";
|
|
4
|
-
function batchSnapshotData(draft) {
|
|
5
|
-
const data = draft.presentationEnvelope?.data;
|
|
6
|
-
if (!Array.isArray(data)) {
|
|
7
|
-
return data;
|
|
8
|
-
}
|
|
9
|
-
const rows = [];
|
|
10
|
-
for (const [index, row] of data.entries()) {
|
|
11
|
-
const snapshot = draft.confirmedEffects.find((effect) => effect.index === index && effect.command === "snapshot");
|
|
12
|
-
if (snapshot && isRecord(row)) {
|
|
13
|
-
rows.push({
|
|
14
|
-
...row,
|
|
15
|
-
command: ["snapshot"],
|
|
16
|
-
result: snapshot.data,
|
|
17
|
-
success: snapshot.succeeded,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
rows.push(row);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return rows;
|
|
25
|
-
}
|
|
26
|
-
function getTransitionInvalidation(draft) {
|
|
27
|
-
// Missing native rows can hide a recording swap or WebMCP mutation. Planned steps are conservative fallback evidence.
|
|
28
|
-
const direct = getCommandRefSnapshotInvalidation(draft.input.prepared.commandTokens);
|
|
29
|
-
const planned = !Array.isArray(draft.presentationEnvelope?.data)
|
|
30
|
-
? draft.batchCommandSteps
|
|
31
|
-
.map(getCommandRefSnapshotInvalidation)
|
|
32
|
-
.find((value) => value !== undefined)
|
|
33
|
-
: undefined;
|
|
34
|
-
if (draft.unobservedMutation && !draft.failedTransitionReverification) {
|
|
35
|
-
return buildPageTransitionRefSnapshotInvalidation("A dispatched mutation was interrupted without a final outcome. Verify the current URL and take a fresh snapshot before deciding whether to retry.");
|
|
36
|
-
}
|
|
37
|
-
if (draft.unsettledWebMcpMutation) {
|
|
38
|
-
return buildPageTransitionRefSnapshotInvalidation("A detached WebMCP invocation is still pending or failed to settle and can mutate, rerender, or navigate the page, so prior snapshot refs remain invalid after URL verification. Run webmcp result or cancel, then take a fresh snapshot before using page-scoped refs.");
|
|
39
|
-
}
|
|
40
|
-
return observedTransitionInvalidation(draft, direct ?? planned);
|
|
41
|
-
}
|
|
42
|
-
function observedTransitionInvalidation(draft, commandInvalidation) {
|
|
43
|
-
if (draft.input.processResult.agentBrowserStarted &&
|
|
44
|
-
draft.nativeCommandMayHaveExecuted &&
|
|
45
|
-
commandInvalidation) {
|
|
46
|
-
return commandInvalidation;
|
|
47
|
-
}
|
|
48
|
-
if (draft.failedTransitionReverification) {
|
|
49
|
-
return buildPageTransitionRefSnapshotInvalidation("A failed page transition may still have changed the page, so the prior snapshot refs were invalidated. Run snapshot -i before using page-scoped refs.");
|
|
50
|
-
}
|
|
51
|
-
return draft.batchRefSnapshotState?.invalidation?.reason === "page-transition"
|
|
52
|
-
? draft.batchRefSnapshotState.invalidation
|
|
53
|
-
: undefined;
|
|
54
|
-
}
|
|
55
|
-
function applyOutputTabTarget(draft, sessionName) {
|
|
56
|
-
const { state, sessionPageStateUpdate } = draft.input;
|
|
57
|
-
if (draft.currentSessionTabTarget) {
|
|
58
|
-
const tabUpdate = state.sessionPageState.applyTabTarget({
|
|
59
|
-
sessionName,
|
|
60
|
-
target: draft.currentSessionTabTarget,
|
|
61
|
-
update: sessionPageStateUpdate,
|
|
62
|
-
});
|
|
63
|
-
if (!tabUpdate.applied && draft.succeeded) {
|
|
64
|
-
state.sessionPageState.markPinning(sessionName, "drift");
|
|
65
|
-
}
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const { commandTokens } = draft.input.prepared;
|
|
69
|
-
const canHaveChanged = draft.unobservedMutation ||
|
|
70
|
-
draft.resultingPageState.pageUrlUnknown ||
|
|
71
|
-
draft.resultingPageState.pageTargetMayHaveChanged;
|
|
72
|
-
if (draft.input.processResult.agentBrowserStarted &&
|
|
73
|
-
canHaveChanged &&
|
|
74
|
-
!(commandTokens[0] === "session" && commandTokens[1] === "info")) {
|
|
75
|
-
state.sessionPageState.markTabTargetUnknown({ sessionName, update: sessionPageStateUpdate });
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function outputSnapshot(draft) {
|
|
79
|
-
if (draft.unsettledWebMcpMutation || draft.unobservedMutation) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const { prepared } = draft.input;
|
|
83
|
-
if (prepared.executionPlan.commandInfo.command === "batch") {
|
|
84
|
-
return draft.batchRefSnapshotState?.snapshot;
|
|
85
|
-
}
|
|
86
|
-
if (!draft.succeeded) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
return directOutputSnapshot(draft);
|
|
90
|
-
}
|
|
91
|
-
function snapshotRefreshArgs(draft, snapshot) {
|
|
92
|
-
if (draft.batchRefSnapshotState?.refreshArgs) {
|
|
93
|
-
return draft.batchRefSnapshotState.refreshArgs;
|
|
94
|
-
}
|
|
95
|
-
const { commandTokens } = draft.input.prepared;
|
|
96
|
-
const data = draft.presentationEnvelope?.data;
|
|
97
|
-
if (!draft.succeeded ||
|
|
98
|
-
commandTokens[0] !== "snapshot" ||
|
|
99
|
-
!isRecord(data) ||
|
|
100
|
-
!isRecord(data.snapshot) ||
|
|
101
|
-
snapshot) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
return commandTokens.filter((token) => token !== "--delta" && token !== "--full");
|
|
105
|
-
}
|
|
106
|
-
async function refreshCompleteRefs(draft, sessionName, snapshot) {
|
|
107
|
-
const args = snapshotRefreshArgs(draft, snapshot);
|
|
108
|
-
if (!args ||
|
|
109
|
-
draft.readConfirmation?.state === "pending" ||
|
|
110
|
-
draft.unsettledWebMcpMutation ||
|
|
111
|
-
draft.unobservedMutation) {
|
|
112
|
-
return snapshot;
|
|
113
|
-
}
|
|
114
|
-
// Native owns delta baselines; read complete refs without advancing that baseline.
|
|
115
|
-
const refreshed = extractRefSnapshotFromData(await runSessionCommandData({
|
|
116
|
-
args,
|
|
117
|
-
cwd: draft.input.cwd,
|
|
118
|
-
namespace: draft.input.prepared.executionPlan.namespace,
|
|
119
|
-
sessionName: draft.input.prepared.executionPlan.sessionName,
|
|
120
|
-
signal: draft.input.signal,
|
|
121
|
-
}));
|
|
122
|
-
if (!refreshed) {
|
|
123
|
-
draft.input.state.sessionPageState.applyRefSnapshotInvalidation({
|
|
124
|
-
sessionName,
|
|
125
|
-
update: draft.input.sessionPageStateUpdate,
|
|
126
|
-
invalidation: buildPageTransitionRefSnapshotInvalidation("The native snapshot delta did not include complete refs and the full ref read failed. Run snapshot -i before using refs."),
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
return refreshed;
|
|
130
|
-
}
|
|
131
|
-
function applyOutputSnapshot(draft, sessionName, snapshot, invalidation) {
|
|
132
|
-
const { sessionPageState } = draft.input.state;
|
|
133
|
-
let view = sessionPageState.get(sessionName);
|
|
134
|
-
if (snapshot) {
|
|
135
|
-
view = sessionPageState.applyRefSnapshot({
|
|
136
|
-
sessionName,
|
|
137
|
-
snapshot,
|
|
138
|
-
fallbackTarget: draft.currentSessionTabTarget,
|
|
139
|
-
update: draft.input.sessionPageStateUpdate,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
else if (invalidation) {
|
|
143
|
-
view = sessionPageState.applyRefSnapshotInvalidation({
|
|
144
|
-
sessionName,
|
|
145
|
-
invalidation,
|
|
146
|
-
update: draft.input.sessionPageStateUpdate,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
draft.currentRefSnapshot = view.refSnapshot;
|
|
150
|
-
draft.currentRefSnapshotInvalidation = view.refSnapshotInvalidation;
|
|
151
|
-
}
|
|
152
|
-
export async function reconcileOutputRefs(draft) {
|
|
153
|
-
if (draft.input.prepared.executionPlan.commandInfo.command === "batch") {
|
|
154
|
-
draft.batchRefSnapshotState = extractLatestRefSnapshotStateFromBatchResults(batchSnapshotData(draft));
|
|
155
|
-
}
|
|
156
|
-
const sessionName = draft.sessionStateKey;
|
|
157
|
-
if (sessionName === undefined || sessionName.length === 0 || draft.browserIndependentRead) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if ((draft.directClose && draft.succeeded) || draft.nestedBatchClosed) {
|
|
161
|
-
retireOutputSession(draft, sessionName);
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const invalidation = getTransitionInvalidation(draft);
|
|
165
|
-
applyOutputTabTarget(draft, sessionName);
|
|
166
|
-
const snapshot = await refreshCompleteRefs(draft, sessionName, outputSnapshot(draft));
|
|
167
|
-
applyOutputSnapshot(draft, sessionName, snapshot, invalidation);
|
|
168
|
-
}
|
|
169
|
-
export function retireOutputSession(draft, sessionName) {
|
|
170
|
-
draft.input.state.attachedSessionKeys.delete(sessionName);
|
|
171
|
-
const routes = new Map(draft.networkRoutesBySession);
|
|
172
|
-
routes.delete(sessionName);
|
|
173
|
-
draft.networkRoutesBySession = routes;
|
|
174
|
-
draft.input.state.sessionPageState.clearSession(sessionName);
|
|
175
|
-
draft.input.state.closedManagedSessionNames.add(sessionName);
|
|
176
|
-
}
|
|
177
|
-
export function reconcileOutputPinning(draft) {
|
|
178
|
-
const sessionName = draft.sessionStateKey;
|
|
179
|
-
if (sessionName === undefined || sessionName.length === 0 || !draft.succeeded) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (draft.openResultTabCorrection ||
|
|
183
|
-
draft.sessionTabCorrection ||
|
|
184
|
-
draft.aboutBlankSessionMismatch?.recoveryApplied === true) {
|
|
185
|
-
draft.input.state.sessionPageState.markPinning(sessionName, "drift");
|
|
186
|
-
}
|
|
187
|
-
else if (draft.input.prepared.sessionTabPinningReason === "restore" &&
|
|
188
|
-
draft.observedSessionTabTarget) {
|
|
189
|
-
draft.input.state.sessionPageState.clearRestorePinning(sessionName);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function directOutputSnapshot(draft) {
|
|
193
|
-
const { prepared } = draft.input;
|
|
194
|
-
if (prepared.executionPlan.commandInfo.command === "snapshot" ||
|
|
195
|
-
draft.confirmedCommand === "snapshot") {
|
|
196
|
-
return extractRefSnapshotFromData(draft.confirmedData ?? draft.presentationEnvelope?.data);
|
|
197
|
-
}
|
|
198
|
-
return (prepared.resolvedSemanticActionRefSnapshot ??
|
|
199
|
-
draft.diagnostics.overlayBlockerDiagnostic?.snapshot);
|
|
200
|
-
}
|