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/final-result-missing-binary.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { cleanupElectronLaunchResources, } from "../../electron/cleanup.js";
|
|
2
|
-
import { buildAgentBrowserResultCategoryDetails } from "../../results/categories.js";
|
|
3
|
-
import { applyNamespaceToNextActions } from "../../results/next-actions.js";
|
|
4
|
-
import { buildManagedSessionFreshFailureNextActions, buildManagedSessionOutcome, formatManagedSessionOutcomeText, } from "./session-state.js";
|
|
5
|
-
export function buildMissingBinaryMessage() {
|
|
6
|
-
return [
|
|
7
|
-
"agent-browser is required but was not found on PATH.",
|
|
8
|
-
"This project does not bundle agent-browser.",
|
|
9
|
-
"Run `pi-agent-browser-doctor` for package/PATH diagnostics, then install agent-browser using the upstream docs:",
|
|
10
|
-
"- https://agent-browser.dev/",
|
|
11
|
-
"- https://github.com/vercel-labs/agent-browser",
|
|
12
|
-
].join("\n");
|
|
13
|
-
}
|
|
14
|
-
export function isMissingAgentBrowserBinary(processResult) {
|
|
15
|
-
return processResult.spawnError?.message.includes("ENOENT") === true;
|
|
16
|
-
}
|
|
17
|
-
function missingBinaryOutcome(options) {
|
|
18
|
-
return buildManagedSessionOutcome({
|
|
19
|
-
activeAfter: options.managedSessionActive,
|
|
20
|
-
activeBefore: options.managedSessionActive,
|
|
21
|
-
attemptedSessionName: options.executionPlan.managedSessionName,
|
|
22
|
-
command: options.executionPlan.commandInfo.command,
|
|
23
|
-
currentSessionName: options.managedSessionName,
|
|
24
|
-
currentSessionNamespace: options.managedSessionNamespace,
|
|
25
|
-
previousSessionName: options.managedSessionName,
|
|
26
|
-
sessionMode: options.sessionMode,
|
|
27
|
-
succeeded: false,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function missingBinaryDetails(options, managedSessionOutcome, cleanup) {
|
|
31
|
-
const actions = applyNamespaceToNextActions(buildManagedSessionFreshFailureNextActions(managedSessionOutcome), options.executionPlan.namespace) ?? [];
|
|
32
|
-
const errorText = buildMissingBinaryMessage();
|
|
33
|
-
return {
|
|
34
|
-
agentBrowserStarted: options.processResult.agentBrowserStarted,
|
|
35
|
-
args: options.redactedArgs,
|
|
36
|
-
compatibilityWorkaround: options.compatibilityWorkaround,
|
|
37
|
-
effectiveArgs: options.redactedProcessArgs,
|
|
38
|
-
electron: cleanup?.record
|
|
39
|
-
? {
|
|
40
|
-
action: "launch",
|
|
41
|
-
cleanup,
|
|
42
|
-
launch: cleanup.record,
|
|
43
|
-
status: "failed",
|
|
44
|
-
targets: options.electronLaunch?.targets,
|
|
45
|
-
version: options.electronLaunch?.version,
|
|
46
|
-
}
|
|
47
|
-
: undefined,
|
|
48
|
-
managedSessionOutcome,
|
|
49
|
-
namespace: options.executionPlan.namespace,
|
|
50
|
-
nextActions: actions.length > 0 ? actions : undefined,
|
|
51
|
-
sessionMode: options.sessionMode,
|
|
52
|
-
sessionTabCorrection: options.sessionTabCorrection,
|
|
53
|
-
...buildAgentBrowserResultCategoryDetails({
|
|
54
|
-
args: options.redactedProcessArgs,
|
|
55
|
-
command: options.executionPlan.commandInfo.command,
|
|
56
|
-
errorText,
|
|
57
|
-
failureCategory: "missing-binary",
|
|
58
|
-
spawnError: options.spawnError,
|
|
59
|
-
succeeded: false,
|
|
60
|
-
}),
|
|
61
|
-
spawnError: options.spawnError,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export async function buildMissingBinaryFailureResult(options) {
|
|
65
|
-
if (!isMissingAgentBrowserBinary(options.processResult)) {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
const spawnError = options.processResult.spawnError.message;
|
|
69
|
-
const outcome = missingBinaryOutcome(options);
|
|
70
|
-
const cleanup = options.electronLaunch
|
|
71
|
-
? await cleanupElectronLaunchResources({
|
|
72
|
-
child: options.electronLaunch.child,
|
|
73
|
-
record: options.electronLaunch.record,
|
|
74
|
-
timeoutMs: options.implicitSessionCloseTimeoutMs,
|
|
75
|
-
})
|
|
76
|
-
: undefined;
|
|
77
|
-
const text = [
|
|
78
|
-
buildMissingBinaryMessage(),
|
|
79
|
-
formatManagedSessionOutcomeText(outcome),
|
|
80
|
-
cleanup ? `Electron cleanup after failed attach: ${cleanup.summary}` : undefined,
|
|
81
|
-
]
|
|
82
|
-
.filter((part) => part !== undefined && part.length > 0)
|
|
83
|
-
.join("\n\n");
|
|
84
|
-
return {
|
|
85
|
-
content: [{ type: "text", text }],
|
|
86
|
-
details: missingBinaryDetails({ ...options, spawnError }, outcome, cleanup),
|
|
87
|
-
isError: true,
|
|
88
|
-
};
|
|
89
|
-
}
|
package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-recovery.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { extractExplicitSessionName } from "../../argv-grammar.js";
|
|
2
|
-
import { buildAgentBrowserResultCategoryDetails } from "../../results/categories.js";
|
|
3
|
-
import { buildRichInputRecoveryDiagnostic } from "../../results/selector-recovery.js";
|
|
4
|
-
import { buildNoActivePageRefSnapshotInvalidation, isNoActivePageSnapshotFailure, } from "../../session-page-state.js";
|
|
5
|
-
import { collectVisibleRefFallbackDiagnostic } from "./diagnostics.js";
|
|
6
|
-
import { getSessionContextKey } from "./session-state.js";
|
|
7
|
-
function recoveryFailureCategory(options) {
|
|
8
|
-
return (options.presentation.failureCategory ??
|
|
9
|
-
options.presentation.batchFailure?.failedStep.failureCategory ??
|
|
10
|
-
(options.electronPostCommandHealth ? "tab-drift" : undefined));
|
|
11
|
-
}
|
|
12
|
-
function classifyRecovery(options) {
|
|
13
|
-
return buildAgentBrowserResultCategoryDetails({
|
|
14
|
-
artifacts: options.presentation.artifacts,
|
|
15
|
-
args: options.redactedProcessArgs,
|
|
16
|
-
command: options.executionPlan.commandInfo.command,
|
|
17
|
-
confirmationRequired: options.presentation.summary.startsWith("Confirmation required"),
|
|
18
|
-
errorText: options.errorText ?? options.presentation.summary,
|
|
19
|
-
failureCategory: recoveryFailureCategory(options),
|
|
20
|
-
inspection: options.plainTextInspection,
|
|
21
|
-
parseError: options.parseError,
|
|
22
|
-
savedFile: options.presentation.savedFile,
|
|
23
|
-
spawnError: options.processResult.spawnError?.message,
|
|
24
|
-
succeeded: options.succeeded,
|
|
25
|
-
tabDrift: !options.succeeded &&
|
|
26
|
-
(options.aboutBlankSessionMismatch !== undefined ||
|
|
27
|
-
options.electronPostCommandHealth !== undefined ||
|
|
28
|
-
options.sessionTabCorrection !== undefined),
|
|
29
|
-
timedOut: options.processResult.timedOut,
|
|
30
|
-
validationError: undefined,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function applyFallbackSnapshot(options, snapshot, sessionKey) {
|
|
34
|
-
if (!snapshot || sessionKey === undefined || sessionKey.length === 0) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
return options.sessionPageState.applyRefSnapshot({
|
|
38
|
-
fallbackTarget: options.currentSessionTabTarget,
|
|
39
|
-
sessionName: sessionKey,
|
|
40
|
-
snapshot,
|
|
41
|
-
update: options.sessionPageStateUpdate,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function invalidateNoActivePage(options) {
|
|
45
|
-
const sessionKey = getSessionContextKey(options.executionPlan.sessionName, options.executionPlan.namespace);
|
|
46
|
-
if (sessionKey === undefined || sessionKey.length === 0) {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
return options.sessionPageState.applyRefSnapshotInvalidation({
|
|
50
|
-
invalidation: buildNoActivePageRefSnapshotInvalidation(),
|
|
51
|
-
sessionName: sessionKey,
|
|
52
|
-
update: options.sessionPageStateUpdate,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function hasNoActivePage(options, category) {
|
|
56
|
-
return (category.resultCategory === "failure" &&
|
|
57
|
-
(isNoActivePageSnapshotFailure(options.executionPlan.commandInfo.command, options.errorText ?? options.presentation.summary) ||
|
|
58
|
-
options.batchRefSnapshotState?.invalidation?.reason === "no-active-page"));
|
|
59
|
-
}
|
|
60
|
-
export async function prepareFinalResultRecoveryState(options) {
|
|
61
|
-
const categoryDetails = classifyRecovery(options);
|
|
62
|
-
let { currentRefSnapshot, currentRefSnapshotInvalidation } = options;
|
|
63
|
-
let visibleRefFallbackDiagnostic;
|
|
64
|
-
const visibleRefFallbackSessionName = options.executionPlan.sessionName ?? extractExplicitSessionName(options.runtimeToolArgs);
|
|
65
|
-
if (categoryDetails.failureCategory === "selector-not-found") {
|
|
66
|
-
visibleRefFallbackDiagnostic = await collectVisibleRefFallbackDiagnostic({
|
|
67
|
-
commandTokens: options.presentation.batchFailure?.failedStep.command ?? options.commandTokens,
|
|
68
|
-
compiledSemanticAction: options.compiledSemanticAction,
|
|
69
|
-
cwd: options.cwd,
|
|
70
|
-
namespace: options.executionPlan.namespace,
|
|
71
|
-
sessionName: visibleRefFallbackSessionName,
|
|
72
|
-
signal: options.signal,
|
|
73
|
-
});
|
|
74
|
-
const update = applyFallbackSnapshot(options, visibleRefFallbackDiagnostic?.snapshot, getSessionContextKey(visibleRefFallbackSessionName, options.executionPlan.namespace));
|
|
75
|
-
if (update) {
|
|
76
|
-
currentRefSnapshot = update.refSnapshot;
|
|
77
|
-
currentRefSnapshotInvalidation = update.refSnapshotInvalidation;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const noActivePageSnapshotFailure = hasNoActivePage(options, categoryDetails);
|
|
81
|
-
if (noActivePageSnapshotFailure) {
|
|
82
|
-
const update = invalidateNoActivePage(options);
|
|
83
|
-
if (update) {
|
|
84
|
-
currentRefSnapshot = update.refSnapshot;
|
|
85
|
-
currentRefSnapshotInvalidation = update.refSnapshotInvalidation;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
categoryDetails,
|
|
90
|
-
currentRefSnapshot,
|
|
91
|
-
currentRefSnapshotInvalidation,
|
|
92
|
-
noActivePageSnapshotFailure,
|
|
93
|
-
richInputRecoveryDiagnostic: buildRichInputRecoveryDiagnostic(visibleRefFallbackDiagnostic),
|
|
94
|
-
visibleRefFallbackDiagnostic,
|
|
95
|
-
visibleRefFallbackSessionName,
|
|
96
|
-
};
|
|
97
|
-
}
|
package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-redaction.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { redactInvocationArgs, redactSensitiveText, redactSensitiveValue, } from "../../runtime-redaction.js";
|
|
3
|
-
import { projectAgentBrowserObservation } from "../../results/presentation/content.js";
|
|
4
|
-
export function redactExactSensitiveText(text, sensitiveValues) {
|
|
5
|
-
let redacted = text;
|
|
6
|
-
for (const value of sensitiveValues) {
|
|
7
|
-
redacted = redacted.split(value).join("[REDACTED]");
|
|
8
|
-
}
|
|
9
|
-
return redacted;
|
|
10
|
-
}
|
|
11
|
-
export function redactExactSensitiveValue(value, sensitiveValues) {
|
|
12
|
-
if (sensitiveValues.length === 0) {
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
if (typeof value === "string") {
|
|
16
|
-
return redactExactSensitiveText(value, sensitiveValues);
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(value)) {
|
|
19
|
-
const entries = value;
|
|
20
|
-
return entries.map((item) => redactExactSensitiveValue(item, sensitiveValues));
|
|
21
|
-
}
|
|
22
|
-
if (!isRecord(value)) {
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
return Object.fromEntries(Object.entries(value).map(([key, entryValue]) => [
|
|
26
|
-
key,
|
|
27
|
-
redactExactSensitiveValue(entryValue, sensitiveValues),
|
|
28
|
-
]));
|
|
29
|
-
}
|
|
30
|
-
export function redactToolDetails(details, sensitiveValues) {
|
|
31
|
-
const redacted = redactSensitiveValue(redactExactSensitiveValue(details, sensitiveValues));
|
|
32
|
-
if (!isRecord(redacted)) {
|
|
33
|
-
throw new Error("Browser result details must remain an object after redaction.");
|
|
34
|
-
}
|
|
35
|
-
return redacted;
|
|
36
|
-
}
|
|
37
|
-
export function redactRecoveryHint(recoveryHint) {
|
|
38
|
-
if (!recoveryHint) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
const exampleArgs = redactInvocationArgs(recoveryHint.exampleArgs);
|
|
42
|
-
return {
|
|
43
|
-
...recoveryHint,
|
|
44
|
-
exampleArgs,
|
|
45
|
-
exampleParams: { ...recoveryHint.exampleParams, args: exampleArgs },
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export function buildJsonVisibleContent(options) {
|
|
49
|
-
const { error, presentation, succeeded, warnings } = options;
|
|
50
|
-
const payload = projectAgentBrowserObservation({
|
|
51
|
-
...presentation,
|
|
52
|
-
...options.details,
|
|
53
|
-
error,
|
|
54
|
-
warnings: warnings !== undefined && warnings.length > 0 ? warnings : undefined,
|
|
55
|
-
}, succeeded);
|
|
56
|
-
const images = presentation.content.filter((item) => item.type === "image");
|
|
57
|
-
return [{ type: "text", text: JSON.stringify(payload, null, 2) }, ...images];
|
|
58
|
-
}
|
|
59
|
-
function warningLines(text) {
|
|
60
|
-
return text === undefined || text.length === 0 ? undefined : [text];
|
|
61
|
-
}
|
|
62
|
-
function contentWithWarnings(options) {
|
|
63
|
-
if (options.userRequestedJson && !options.plainTextInspection) {
|
|
64
|
-
return buildJsonVisibleContent({
|
|
65
|
-
error: options.presentationEnvelope?.error,
|
|
66
|
-
presentation: options.presentation,
|
|
67
|
-
succeeded: options.succeeded,
|
|
68
|
-
warnings: warningLines(options.warningText),
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const content = [...options.presentation.content];
|
|
72
|
-
if (options.warningText === undefined ||
|
|
73
|
-
options.warningText.length === 0 ||
|
|
74
|
-
options.userRequestedJson) {
|
|
75
|
-
return content;
|
|
76
|
-
}
|
|
77
|
-
if (content[0]?.type === "text") {
|
|
78
|
-
content[0] = { ...content[0], text: `${options.warningText}\n\n${content[0].text}` };
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
content.unshift({ type: "text", text: options.warningText });
|
|
82
|
-
}
|
|
83
|
-
return content;
|
|
84
|
-
}
|
|
85
|
-
export function buildRedactedPresentationContent(options) {
|
|
86
|
-
return contentWithWarnings(options).map((item) => {
|
|
87
|
-
if (item.type !== "text") {
|
|
88
|
-
return item;
|
|
89
|
-
}
|
|
90
|
-
const text = options.userRequestedJson && !options.plainTextInspection
|
|
91
|
-
? JSON.stringify(redactExactSensitiveValue(JSON.parse(item.text), options.exactSensitiveValues), null, 2)
|
|
92
|
-
: redactSensitiveText(redactExactSensitiveText(item.text, options.exactSensitiveValues));
|
|
93
|
-
return { type: "text", text };
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
export function readJsonWarnings(content) {
|
|
97
|
-
if (content[0]?.type !== "text") {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
const prior = JSON.parse(content[0].text);
|
|
101
|
-
if (!isRecord(prior) || !Array.isArray(prior.warnings)) {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
const warnings = prior.warnings;
|
|
105
|
-
return warnings;
|
|
106
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { withOptionalSessionArgs } from "../../results/next-actions.js";
|
|
2
|
-
function verifyTimeoutTarget(sessionName, stepIndex) {
|
|
3
|
-
return {
|
|
4
|
-
id: "verify-page-target-after-timeout",
|
|
5
|
-
params: {
|
|
6
|
-
args: withOptionalSessionArgs(sessionName, ["batch", "--bail"]),
|
|
7
|
-
stdin: JSON.stringify([
|
|
8
|
-
["get", "url"],
|
|
9
|
-
["snapshot", "-i"],
|
|
10
|
-
]),
|
|
11
|
-
},
|
|
12
|
-
reason: `Verify the current URL, then inspect the page after timeout${stepIndex === undefined ? "" : ` before considering a retry of step ${stepIndex}`}.`,
|
|
13
|
-
safety: "Fail-fast read-only recovery: snapshot runs only after get url succeeds, satisfying the wrapper page-target guard without trusting the planned URL.",
|
|
14
|
-
tool: "agent_browser",
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function retryTimeoutStep(options, freshSessionAbandoned) {
|
|
18
|
-
const retry = options.timeoutPartialProgress?.retryStep?.retry;
|
|
19
|
-
if (!retry) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
const stepIndex = options.timeoutPartialProgress.retryStep.index;
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
id: "retry-timeout-step",
|
|
26
|
-
params: freshSessionAbandoned
|
|
27
|
-
? { ...retry, sessionMode: "fresh" }
|
|
28
|
-
: {
|
|
29
|
-
...retry,
|
|
30
|
-
args: withOptionalSessionArgs(options.executionPlan.sessionName, [...retry.args]),
|
|
31
|
-
},
|
|
32
|
-
reason: freshSessionAbandoned
|
|
33
|
-
? `Consider retrying the single timed-out step ${stepIndex} in a fresh browser session because the timed-out fresh session was not proven live.`
|
|
34
|
-
: `Consider retrying the single timed-out step ${stepIndex} against the current browser session.`,
|
|
35
|
-
safety: "Only read-only or idempotent timeout steps get executable retry args; inspect current page/artifact state before using the action.",
|
|
36
|
-
tool: "agent_browser",
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
function verifyUnknownTimeoutTarget(options, freshSessionAbandoned) {
|
|
41
|
-
const sessionName = options.executionPlan.sessionName;
|
|
42
|
-
if (options.currentSessionTabTargetUnknown === true &&
|
|
43
|
-
!freshSessionAbandoned &&
|
|
44
|
-
sessionName !== undefined &&
|
|
45
|
-
sessionName.length > 0) {
|
|
46
|
-
return [verifyTimeoutTarget(sessionName, options.timeoutPartialProgress?.retryStep?.index)];
|
|
47
|
-
}
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
function inspectTimeoutPage(options, freshSessionAbandoned) {
|
|
51
|
-
const sessionName = options.executionPlan.sessionName;
|
|
52
|
-
if (!options.timeoutPartialProgress ||
|
|
53
|
-
freshSessionAbandoned ||
|
|
54
|
-
sessionName === undefined ||
|
|
55
|
-
sessionName.length === 0) {
|
|
56
|
-
return [];
|
|
57
|
-
}
|
|
58
|
-
const stepIndex = options.timeoutPartialProgress.retryStep?.index;
|
|
59
|
-
return [
|
|
60
|
-
{
|
|
61
|
-
id: "inspect-current-page-after-timeout",
|
|
62
|
-
params: { args: withOptionalSessionArgs(sessionName, ["snapshot", "-i"]) },
|
|
63
|
-
reason: `Inspect the current page after timeout before deciding how to resume${stepIndex === undefined ? "" : ` with step ${stepIndex}`}.`,
|
|
64
|
-
safety: "Read details.timeoutPartialProgress first. Do not blindly retry mutating steps such as clicks, fills, key presses, selects, or checks; split the remaining flow into shorter batches around the next navigation or DOM mutation boundary.",
|
|
65
|
-
tool: "agent_browser",
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
export function buildTimeoutPartialProgressNextActions(options) {
|
|
70
|
-
if (options.executionPlan.commandInfo.command === "session" &&
|
|
71
|
-
options.executionPlan.commandInfo.subcommand === "info") {
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
const freshSessionAbandoned = options.sessionMode === "fresh" && options.timeoutPartialProgress?.liveUrlRecovered !== true;
|
|
75
|
-
const verification = verifyUnknownTimeoutTarget(options, freshSessionAbandoned);
|
|
76
|
-
if (verification.length > 0) {
|
|
77
|
-
return verification;
|
|
78
|
-
}
|
|
79
|
-
const retry = retryTimeoutStep(options, freshSessionAbandoned);
|
|
80
|
-
return retry.length > 0 ? retry : inspectTimeoutPage(options, freshSessionAbandoned);
|
|
81
|
-
}
|
|
82
|
-
export function buildDialogTimeoutNextActions(options) {
|
|
83
|
-
if (options.command === undefined ||
|
|
84
|
-
!["dialog", "click", "tap", "find", "eval"].includes(options.command)) {
|
|
85
|
-
return [];
|
|
86
|
-
}
|
|
87
|
-
return [
|
|
88
|
-
{
|
|
89
|
-
id: "inspect-dialog-after-timeout",
|
|
90
|
-
params: { args: withOptionalSessionArgs(options.sessionName, ["dialog", "status"]) },
|
|
91
|
-
reason: "Check whether a blocking JavaScript dialog is pending after the timed-out interaction.",
|
|
92
|
-
safety: "Read-only dialog status; this wrapper bounds dialog commands so recovery attempts do not wait for the full default watchdog.",
|
|
93
|
-
tool: "agent_browser",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: "dismiss-dialog-after-timeout",
|
|
97
|
-
params: { args: withOptionalSessionArgs(options.sessionName, ["dialog", "dismiss"]) },
|
|
98
|
-
reason: "Dismiss a pending alert/confirm/prompt when the workflow can safely abandon the dialog.",
|
|
99
|
-
safety: "Only run when dismissing/canceling the dialog is acceptable for the user flow.",
|
|
100
|
-
tool: "agent_browser",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: "recover-fresh-session-after-dialog-timeout",
|
|
104
|
-
params: { args: ["open", "about:blank"], sessionMode: "fresh" },
|
|
105
|
-
reason: "Start a clean browser session if the current session remains blocked behind a JavaScript dialog.",
|
|
106
|
-
safety: "Replace about:blank with the intended recovery URL; this abandons the blocked managed session.",
|
|
107
|
-
tool: "agent_browser",
|
|
108
|
-
},
|
|
109
|
-
];
|
|
110
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { redactNetworkSourceLookupSurface, redactNetworkSourceLookupUrl, } from "../../input-modes/lookups.js";
|
|
2
|
-
import { isRecord } from "../../parsing.js";
|
|
3
|
-
import { applyNamespaceToNextActions } from "../../results/next-actions.js";
|
|
4
|
-
import { extractAgentBrowserLifecycle } from "../../results/presentation/common.js";
|
|
5
|
-
import { buildResultNextActions } from "./final-result-actions.js";
|
|
6
|
-
import { buildFinalResultContent } from "./final-result-content.js";
|
|
7
|
-
import { buildAgentBrowserResultDetails } from "./final-result-details.js";
|
|
8
|
-
import { buildBrowserWindowStatus } from "./final-result-evidence.js";
|
|
9
|
-
import { redactToolDetails } from "./final-result-redaction.js";
|
|
10
|
-
export { buildMissingBinaryMessage, isMissingAgentBrowserBinary, buildMissingBinaryFailureResult, } from "./final-result-missing-binary.js";
|
|
11
|
-
export { buildElectronHostFailureResult, getElectronLaunchFailureCategory, formatElectronLaunchText, formatElectronTargetLines, } from "./final-result-electron.js";
|
|
12
|
-
export { buildJsonVisibleContent, buildRedactedPresentationContent, redactExactSensitiveText, redactExactSensitiveValue, redactToolDetails, redactRecoveryHint, } from "./final-result-redaction.js";
|
|
13
|
-
export { prepareFinalResultRecoveryState } from "./final-result-recovery.js";
|
|
14
|
-
export { formatAgentBrowserNextActionsText } from "./final-result-content.js";
|
|
15
|
-
export function buildWrapperRecoveryHint(options) {
|
|
16
|
-
return options.sessionTabCorrection
|
|
17
|
-
? "Wrapper recovery hint: this call used session tab correction. Inspect details.effectiveArgs and details.sessionTabCorrection; if the selected tab looks wrong, run tab list for the same session before retrying."
|
|
18
|
-
: undefined;
|
|
19
|
-
}
|
|
20
|
-
function redactNetworkLookupResult(result) {
|
|
21
|
-
const details = redactNetworkSourceLookupSurface(result.details);
|
|
22
|
-
if (!isRecord(details)) {
|
|
23
|
-
throw new Error("Network lookup result details must remain an object after redaction.");
|
|
24
|
-
}
|
|
25
|
-
const content = result.content.map((item) => {
|
|
26
|
-
if (item.type === "text") {
|
|
27
|
-
return { type: "text", text: redactNetworkSourceLookupUrl(item.text) ?? item.text };
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
type: "image",
|
|
31
|
-
data: redactNetworkSourceLookupUrl(item.data) ?? item.data,
|
|
32
|
-
mimeType: redactNetworkSourceLookupUrl(item.mimeType) ?? item.mimeType,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
return { content, details, isError: result.isError };
|
|
36
|
-
}
|
|
37
|
-
export function buildFinalAgentBrowserToolResult(options) {
|
|
38
|
-
const nextActions = applyNamespaceToNextActions(buildResultNextActions(options), options.executionPlan.namespace);
|
|
39
|
-
const lifecycle = extractAgentBrowserLifecycle(options.presentationEnvelope?.data);
|
|
40
|
-
const browserWindow = buildBrowserWindowStatus(options, lifecycle);
|
|
41
|
-
const details = redactToolDetails(buildAgentBrowserResultDetails(options, nextActions, lifecycle, browserWindow), options.exactSensitiveValues);
|
|
42
|
-
const rendered = options.modelVisible === false
|
|
43
|
-
? { content: [] }
|
|
44
|
-
: buildFinalResultContent(options, details, nextActions, { lifecycle, browserWindow });
|
|
45
|
-
const result = {
|
|
46
|
-
content: rendered.content,
|
|
47
|
-
details: "warnings" in rendered && rendered.warnings !== undefined
|
|
48
|
-
? { ...details, warnings: rendered.warnings }
|
|
49
|
-
: details,
|
|
50
|
-
isError: !options.succeeded,
|
|
51
|
-
};
|
|
52
|
-
return options.compiledNetworkSourceLookup ? redactNetworkLookupResult(result) : result;
|
|
53
|
-
}
|