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
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { isOpenNavigationCommand } from "../../command-taxonomy.js";
|
|
2
|
-
import { getStartupScopedFlags } from "../../runtime.js";
|
|
3
|
-
import { buildNextToolAction } from "../next-actions.js";
|
|
4
|
-
const BROWSER_PROFILE_CONFIG_HINT = [
|
|
5
|
-
"Agent-browser profile/config hint: this looks like a local browser profile or Chrome user-data-dir setup problem, not a page-specific failure.",
|
|
6
|
-
"Do not keep retrying the same open/profile call. Run `profiles` and/or `doctor` through agent_browser, then tell the user whether Chrome/Chromium is installed, which Chrome profile directory names are available, or whether they need to configure a full profile/user-data directory path, a non-default Chromium-compatible `--executable-path`, or remove the profile requirement for public-page browsing.",
|
|
7
|
-
'Use the top-level `sessionMode: "fresh"` field for launch-scoped profile/debug/provider flags; do not pass `--session-mode` inside args.',
|
|
8
|
-
].join(" ");
|
|
9
|
-
function looksLikeBrowserProfileConfigError(errorText) {
|
|
10
|
-
return /\b(?:No Chrome user data directory found|Cannot resolve profile name|Chrome user data directory|Chrome profile\s+.+?\s+not found|Available profiles|If you meant a directory path)\b/i.test(errorText);
|
|
11
|
-
}
|
|
12
|
-
function isLaunchOrSetupContext(args, commandInfo) {
|
|
13
|
-
const command = commandInfo.command;
|
|
14
|
-
if (command === "profiles" || command === "doctor") {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
if (command !== undefined && command.length > 0 && isOpenNavigationCommand(command)) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return (args ? getStartupScopedFlags(args) : []).length > 0;
|
|
21
|
-
}
|
|
22
|
-
function buildBrowserProfileConfigActions(commandInfo) {
|
|
23
|
-
const actions = [];
|
|
24
|
-
if (commandInfo.command !== "profiles") {
|
|
25
|
-
actions.push(buildNextToolAction({
|
|
26
|
-
args: ["profiles"],
|
|
27
|
-
id: "inspect-browser-profiles",
|
|
28
|
-
reason: "List browser profiles/user-data-dir candidates before retrying profile-based launch.",
|
|
29
|
-
safety: "Read-only local setup inspection; does not open a page or mutate browser state.",
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
if (commandInfo.command !== "doctor") {
|
|
33
|
-
actions.push(buildNextToolAction({
|
|
34
|
-
args: ["doctor"],
|
|
35
|
-
id: "run-agent-browser-doctor",
|
|
36
|
-
reason: "Inspect local agent-browser browser installation/configuration before retrying.",
|
|
37
|
-
safety: "Read-only local diagnostics; report findings to the user before changing setup.",
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
return actions;
|
|
41
|
-
}
|
|
42
|
-
export function buildBrowserProfileConfigRecovery(options) {
|
|
43
|
-
if (!looksLikeBrowserProfileConfigError(options.errorText)) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
if (!isLaunchOrSetupContext(options.args, options.commandInfo)) {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
const actions = buildBrowserProfileConfigActions(options.commandInfo);
|
|
50
|
-
return {
|
|
51
|
-
actions: actions.length > 0 ? actions : undefined,
|
|
52
|
-
hint: BROWSER_PROFILE_CONFIG_HINT,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { formatRawSnapshotText, formatSnapshotSummary } from "../snapshot-content.js";
|
|
3
|
-
import { getScreenshotSummary } from "./artifacts.js";
|
|
4
|
-
import { formatProfilesText, getStreamSummary, getTabSummary } from "./diagnostics.js";
|
|
5
|
-
import { formatSkillsText } from "./skills.js";
|
|
6
|
-
import { getNavigationSummary } from "./navigation.js";
|
|
7
|
-
import { redactModelFacingText } from "./common.js";
|
|
8
|
-
const SIMPLE_ACTION_RESULTS = {
|
|
9
|
-
check: { field: "checked", label: "Checked" },
|
|
10
|
-
click: { field: "clicked", label: "Clicked" },
|
|
11
|
-
fill: { field: "filled", label: "Filled" },
|
|
12
|
-
focus: { field: "focused", label: "Focused" },
|
|
13
|
-
hover: { field: "hovered", label: "Hovered" },
|
|
14
|
-
press: { field: "pressed", label: "Pressed" },
|
|
15
|
-
select: { field: "selected", label: "Selected" },
|
|
16
|
-
type: { field: "typed", label: "Typed" },
|
|
17
|
-
uncheck: { field: "unchecked", label: "Unchecked" },
|
|
18
|
-
};
|
|
19
|
-
function formatSimpleActionResult(command, data) {
|
|
20
|
-
if (!isRecord(data) || (command === "click" && getNavigationSummary(data) !== undefined)) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
const definition = SIMPLE_ACTION_RESULTS[command];
|
|
24
|
-
if (!definition) {
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
const value = data[definition.field];
|
|
28
|
-
return typeof value === "string" || typeof value === "number" || typeof value === "boolean"
|
|
29
|
-
? `${definition.label}: ${redactModelFacingText(String(value))}`
|
|
30
|
-
: undefined;
|
|
31
|
-
}
|
|
32
|
-
function formatWaitResult(data) {
|
|
33
|
-
if (!isRecord(data)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
if (data.waited === "timeout") {
|
|
37
|
-
return "Fixed wait elapsed; no page condition was verified.";
|
|
38
|
-
}
|
|
39
|
-
for (const field of ["selector", "text", "url", "state", "waited"]) {
|
|
40
|
-
const value = data[field];
|
|
41
|
-
if (typeof value === "string" && value.length > 0) {
|
|
42
|
-
return `Wait completed: ${redactModelFacingText(value)}`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
function formatCloseResult(data) {
|
|
48
|
-
return isRecord(data) && data.closed === true ? "Browser session closed." : undefined;
|
|
49
|
-
}
|
|
50
|
-
function coerceVitalsMetricValue(value) {
|
|
51
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
if (isRecord(value)) {
|
|
55
|
-
for (const key of ["value", "duration", "startTime", "score"]) {
|
|
56
|
-
const nested = value[key];
|
|
57
|
-
if (typeof nested === "number" && Number.isFinite(nested)) {
|
|
58
|
-
return nested;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
function getVitalsMetric(data, key) {
|
|
65
|
-
const metrics = isRecord(data.metrics) ? data.metrics : undefined;
|
|
66
|
-
return coerceVitalsMetricValue(data[key] ?? data[key.toUpperCase()] ?? metrics?.[key] ?? metrics?.[key.toUpperCase()]);
|
|
67
|
-
}
|
|
68
|
-
function getVitalsMetrics(data) {
|
|
69
|
-
return ["lcp", "fcp", "ttfb", "inp", "cls"].flatMap((key) => {
|
|
70
|
-
const value = getVitalsMetric(data, key);
|
|
71
|
-
if (value === undefined) {
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
return [
|
|
75
|
-
key === "cls"
|
|
76
|
-
? `${key.toUpperCase()}: ${value}`
|
|
77
|
-
: `${key.toUpperCase()}: ${Math.round(value)}ms`,
|
|
78
|
-
];
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function getVitalsUnavailableReason(data) {
|
|
82
|
-
for (const key of ["reason", "message", "error", "status"]) {
|
|
83
|
-
const value = data[key];
|
|
84
|
-
if (typeof value === "string" && value.trim().length > 0) {
|
|
85
|
-
return redactModelFacingText(value.trim());
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return "No Core Web Vitals metric fields were present in the upstream result.";
|
|
89
|
-
}
|
|
90
|
-
function formatVitalsText(data) {
|
|
91
|
-
const url = typeof data.url === "string" && data.url.trim().length > 0
|
|
92
|
-
? redactModelFacingText(data.url.trim())
|
|
93
|
-
: undefined;
|
|
94
|
-
const metrics = getVitalsMetrics(data);
|
|
95
|
-
return [
|
|
96
|
-
url !== undefined && url.length > 0 ? `Vitals for ${url}` : "Vitals result",
|
|
97
|
-
...(metrics.length > 0
|
|
98
|
-
? metrics.map((metric) => `- ${metric}`)
|
|
99
|
-
: [`Metrics unavailable: ${getVitalsUnavailableReason(data)}`]),
|
|
100
|
-
].join("\n");
|
|
101
|
-
}
|
|
102
|
-
function formatVitalsSummary(data) {
|
|
103
|
-
const metrics = getVitalsMetrics(data);
|
|
104
|
-
return metrics.length > 0 ? `Vitals: ${metrics.join(", ")}` : "Vitals: metrics unavailable";
|
|
105
|
-
}
|
|
106
|
-
function formatReadSummary(data) {
|
|
107
|
-
if (!isRecord(data)) {
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
const url = data.finalUrl ?? data.url;
|
|
111
|
-
return typeof url === "string" ? `Read: ${url}` : undefined;
|
|
112
|
-
}
|
|
113
|
-
function formatScreenshotSummary(data) {
|
|
114
|
-
if (!isRecord(data)) {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
if (data.changed === false) {
|
|
118
|
-
return getScreenshotSummary(data);
|
|
119
|
-
}
|
|
120
|
-
return typeof data.path === "string" ? `Screenshot saved: ${data.path}` : undefined;
|
|
121
|
-
}
|
|
122
|
-
function formatTabSummary(data) {
|
|
123
|
-
if (!isRecord(data)) {
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
if (Array.isArray(data.tabs)) {
|
|
127
|
-
return `Tabs: ${data.tabs.length}`;
|
|
128
|
-
}
|
|
129
|
-
return data.closed === true ? "Tab closed" : undefined;
|
|
130
|
-
}
|
|
131
|
-
function formatTabText(data) {
|
|
132
|
-
if (!isRecord(data)) {
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
if (data.closed === true) {
|
|
136
|
-
return `Tab closed${typeof data.tabId === "string" ? `: ${redactModelFacingText(data.tabId)}` : "."}`;
|
|
137
|
-
}
|
|
138
|
-
return getTabSummary(data);
|
|
139
|
-
}
|
|
140
|
-
export const COMMAND_PRESENTERS = {
|
|
141
|
-
...Object.fromEntries(Object.keys(SIMPLE_ACTION_RESULTS).map((command) => [
|
|
142
|
-
command,
|
|
143
|
-
{
|
|
144
|
-
summary: (_commandInfo, data) => formatSimpleActionResult(command, data),
|
|
145
|
-
text: (_commandInfo, data) => formatSimpleActionResult(command, data),
|
|
146
|
-
},
|
|
147
|
-
])),
|
|
148
|
-
close: {
|
|
149
|
-
summary: (_commandInfo, data) => formatCloseResult(data),
|
|
150
|
-
text: (_commandInfo, data) => formatCloseResult(data),
|
|
151
|
-
},
|
|
152
|
-
exit: {
|
|
153
|
-
summary: (_commandInfo, data) => formatCloseResult(data),
|
|
154
|
-
text: (_commandInfo, data) => formatCloseResult(data),
|
|
155
|
-
},
|
|
156
|
-
quit: {
|
|
157
|
-
summary: (_commandInfo, data) => formatCloseResult(data),
|
|
158
|
-
text: (_commandInfo, data) => formatCloseResult(data),
|
|
159
|
-
},
|
|
160
|
-
wait: {
|
|
161
|
-
summary: (_commandInfo, data) => formatWaitResult(data),
|
|
162
|
-
text: (_commandInfo, data) => formatWaitResult(data),
|
|
163
|
-
},
|
|
164
|
-
profiles: {
|
|
165
|
-
summary: (_commandInfo, data) => Array.isArray(data) ? `Chrome profiles: ${data.length}` : undefined,
|
|
166
|
-
text: (_commandInfo, data) => Array.isArray(data) ? formatProfilesText(data, "Chrome profiles") : undefined,
|
|
167
|
-
},
|
|
168
|
-
read: {
|
|
169
|
-
summary: (_commandInfo, data) => formatReadSummary(data),
|
|
170
|
-
text: (_commandInfo, data) => isRecord(data) && typeof data.content === "string"
|
|
171
|
-
? redactModelFacingText(data.content)
|
|
172
|
-
: undefined,
|
|
173
|
-
},
|
|
174
|
-
screenshot: {
|
|
175
|
-
summary: (_commandInfo, data) => formatScreenshotSummary(data),
|
|
176
|
-
text: (_commandInfo, data) => (isRecord(data) ? getScreenshotSummary(data) : undefined),
|
|
177
|
-
},
|
|
178
|
-
skills: {
|
|
179
|
-
summary: (commandInfo, data) => {
|
|
180
|
-
if (Array.isArray(data) && commandInfo.subcommand === "list") {
|
|
181
|
-
return `agent-browser skills: ${data.length}`;
|
|
182
|
-
}
|
|
183
|
-
if (commandInfo.subcommand === "get") {
|
|
184
|
-
return "agent-browser skill loaded";
|
|
185
|
-
}
|
|
186
|
-
return commandInfo.subcommand === "path" ? "agent-browser skill path" : undefined;
|
|
187
|
-
},
|
|
188
|
-
text: formatSkillsText,
|
|
189
|
-
},
|
|
190
|
-
snapshot: {
|
|
191
|
-
summary: (_commandInfo, data) => (isRecord(data) ? formatSnapshotSummary(data) : undefined),
|
|
192
|
-
text: (_commandInfo, data) => (isRecord(data) ? formatRawSnapshotText(data) : undefined),
|
|
193
|
-
},
|
|
194
|
-
stream: {
|
|
195
|
-
summary: (commandInfo, data) => {
|
|
196
|
-
if (!isRecord(data) || commandInfo.subcommand !== "status") {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
const port = typeof data.port === "number" ? ` on port ${data.port}` : "";
|
|
200
|
-
return `Stream ${data.enabled === true ? "enabled" : "disabled"}${port}`;
|
|
201
|
-
},
|
|
202
|
-
text: (commandInfo, data) => isRecord(data) && commandInfo.subcommand === "status" ? getStreamSummary(data) : undefined,
|
|
203
|
-
},
|
|
204
|
-
tab: {
|
|
205
|
-
summary: (_commandInfo, data) => formatTabSummary(data),
|
|
206
|
-
text: (_commandInfo, data) => formatTabText(data),
|
|
207
|
-
},
|
|
208
|
-
vitals: {
|
|
209
|
-
summary: (_commandInfo, data) => (isRecord(data) ? formatVitalsSummary(data) : undefined),
|
|
210
|
-
text: (_commandInfo, data) => (isRecord(data) ? formatVitalsText(data) : undefined),
|
|
211
|
-
},
|
|
212
|
-
"web-vitals": {
|
|
213
|
-
summary: (_commandInfo, data) => (isRecord(data) ? formatVitalsSummary(data) : undefined),
|
|
214
|
-
text: (_commandInfo, data) => (isRecord(data) ? formatVitalsText(data) : undefined),
|
|
215
|
-
},
|
|
216
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { redactSensitiveText, redactSensitiveValue } from "../../runtime-redaction.js";
|
|
3
|
-
import { stringifyUnknown, truncateText } from "../text.js";
|
|
4
|
-
const UNTITLED_PAGE_SUMMARY = "(untitled page)";
|
|
5
|
-
export const LIGHTPANDA_IMAGE_REASON = "Lightpanda screenshot is a text-rendered page representation, not a graphical capture; CSS/mouse coordinate mapping is unknown.";
|
|
6
|
-
export function stringifyModelFacing(value) {
|
|
7
|
-
return stringifyUnknown(redactSensitiveValue(value));
|
|
8
|
-
}
|
|
9
|
-
export function redactModelFacingText(text) {
|
|
10
|
-
return redactSensitiveText(text);
|
|
11
|
-
}
|
|
12
|
-
export function getArrayField(data, key) {
|
|
13
|
-
return Array.isArray(data[key]) ? data[key] : undefined;
|
|
14
|
-
}
|
|
15
|
-
export function getStringField(data, key) {
|
|
16
|
-
const value = data[key];
|
|
17
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
18
|
-
}
|
|
19
|
-
// `lifecycle` is upstream launch/reuse bookkeeping, never page content, so it must not be the
|
|
20
|
-
// answer an agent reads when a command has no dedicated presenter.
|
|
21
|
-
function getNestedLifecycleRow(row) {
|
|
22
|
-
return isRecord(row) ? (row.result ?? row.data ?? row) : row;
|
|
23
|
-
}
|
|
24
|
-
export function extractAgentBrowserLifecycle(result) {
|
|
25
|
-
if (Array.isArray(result)) {
|
|
26
|
-
let latest;
|
|
27
|
-
for (const row of result) {
|
|
28
|
-
const nested = getNestedLifecycleRow(row);
|
|
29
|
-
latest = extractAgentBrowserLifecycle(nested) ?? latest;
|
|
30
|
-
}
|
|
31
|
-
return latest;
|
|
32
|
-
}
|
|
33
|
-
if (!isRecord(result)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
if (isRecord(result.lifecycle) && isRecord(result.lifecycle.effectiveLaunch)) {
|
|
37
|
-
const browserLaunched = result.lifecycle.effectiveLaunch.browserLaunched;
|
|
38
|
-
if (typeof browserLaunched === "boolean") {
|
|
39
|
-
return { effectiveLaunch: { browserLaunched } };
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return extractAgentBrowserLifecycle(result.result ?? result.data);
|
|
43
|
-
}
|
|
44
|
-
export function omitUpstreamLifecycle(data) {
|
|
45
|
-
if (Array.isArray(data)) {
|
|
46
|
-
return data;
|
|
47
|
-
}
|
|
48
|
-
const { lifecycle: _lifecycle, ...rest } = data;
|
|
49
|
-
return rest;
|
|
50
|
-
}
|
|
51
|
-
export function formatWebMcpCatalogUpdate(catalog) {
|
|
52
|
-
return `WebMCP catalog update (page-provided, untrusted; use webmcp list for schemas):\n${JSON.stringify(redactSensitiveValue(catalog))}`;
|
|
53
|
-
}
|
|
54
|
-
function getPageIdentitySummary(data) {
|
|
55
|
-
const title = typeof data.title === "string" ? data.title : undefined;
|
|
56
|
-
const url = typeof data.url === "string" ? data.url : undefined;
|
|
57
|
-
if (title === undefined && url === undefined) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
const parts = [title, url].filter((part) => part !== undefined && part.length > 0);
|
|
61
|
-
return parts.length > 0 ? parts.join("\n") : UNTITLED_PAGE_SUMMARY;
|
|
62
|
-
}
|
|
63
|
-
export function getPageSummary(data) {
|
|
64
|
-
const summary = getPageIdentitySummary(data);
|
|
65
|
-
if (summary === undefined) {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
const webmcp = isRecord(data.webmcp) ? data.webmcp : undefined;
|
|
69
|
-
return webmcp?.available === true &&
|
|
70
|
-
typeof webmcp.toolCount === "number" &&
|
|
71
|
-
Number.isInteger(webmcp.toolCount) &&
|
|
72
|
-
webmcp.toolCount > 0
|
|
73
|
-
? `${summary}\n\nWebMCP tools are available on this page (experimental). Run webmcp list to view them.`
|
|
74
|
-
: summary;
|
|
75
|
-
}
|
|
76
|
-
export function formatCount(count, singular, plural = `${singular}s`) {
|
|
77
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
78
|
-
}
|
|
79
|
-
export function firstLine(value, maxChars = 160) {
|
|
80
|
-
return truncateText(value.split("\n", 1)[0] ?? value, maxChars);
|
|
81
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { redactSensitiveValue } from "../../runtime-redaction.js";
|
|
3
|
-
import { omitUpstreamLifecycle } from "./common.js";
|
|
4
|
-
import { isTimeoutPartialProgress, redactTimeoutPartialProgress, } from "../../orchestration/browser-run/timeout-progress.js";
|
|
5
|
-
export const OBSERVATION_INLINE_MAX_CHARS = 16_000;
|
|
6
|
-
const OBSERVATION_DETAIL_FIELDS = [
|
|
7
|
-
"data",
|
|
8
|
-
"error",
|
|
9
|
-
"summary",
|
|
10
|
-
"failureCategory",
|
|
11
|
-
"successCategory",
|
|
12
|
-
"nextActions",
|
|
13
|
-
"warnings",
|
|
14
|
-
"sessionName",
|
|
15
|
-
"namespace",
|
|
16
|
-
"codeRun",
|
|
17
|
-
"failures",
|
|
18
|
-
"artifacts",
|
|
19
|
-
"artifactVerification",
|
|
20
|
-
"imageObservations",
|
|
21
|
-
"fullOutputPath",
|
|
22
|
-
"fullOutputPaths",
|
|
23
|
-
"fullOutputUnavailable",
|
|
24
|
-
"recordingRecovery",
|
|
25
|
-
"readConfirmation",
|
|
26
|
-
"sessionRecoveryHint",
|
|
27
|
-
"pageChangeSummary",
|
|
28
|
-
"timeoutPartialProgress",
|
|
29
|
-
"qaPreset",
|
|
30
|
-
"sourceLookup",
|
|
31
|
-
"networkSourceLookup",
|
|
32
|
-
"networkRouteDiagnostics",
|
|
33
|
-
"webMcpCatalog",
|
|
34
|
-
"clickDispatch",
|
|
35
|
-
"overlayBlockers",
|
|
36
|
-
"fillVerification",
|
|
37
|
-
"visibleRefFallback",
|
|
38
|
-
"richInputRecovery",
|
|
39
|
-
"snapshotDiff",
|
|
40
|
-
"snapshotFilter",
|
|
41
|
-
"snapshotViewport",
|
|
42
|
-
"scrollPage",
|
|
43
|
-
"scrollContainer",
|
|
44
|
-
"comboboxFocus",
|
|
45
|
-
"scrollNoop",
|
|
46
|
-
"selectorTextVisibility",
|
|
47
|
-
"selectorTextVisibilityAll",
|
|
48
|
-
"evalStdinHint",
|
|
49
|
-
"evalResultWarning",
|
|
50
|
-
"electronGetTextScopeWarning",
|
|
51
|
-
"electronGetTextScopeWarnings",
|
|
52
|
-
"recordingDependencyWarning",
|
|
53
|
-
];
|
|
54
|
-
export function isStringArray(value) {
|
|
55
|
-
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
56
|
-
}
|
|
57
|
-
export function getPresentationText(presentation) {
|
|
58
|
-
return presentation.content
|
|
59
|
-
.filter((part) => part.type === "text")
|
|
60
|
-
.map((part) => part.text.trim())
|
|
61
|
-
.filter((text) => text.length > 0)
|
|
62
|
-
.join("\n\n");
|
|
63
|
-
}
|
|
64
|
-
export function getPresentationImages(presentation) {
|
|
65
|
-
return presentation.content.filter((part) => part.type === "image");
|
|
66
|
-
}
|
|
67
|
-
export function getPresentationPaths(options) {
|
|
68
|
-
return (options.secondaryPaths ??
|
|
69
|
-
(options.primaryPath !== undefined && options.primaryPath.length > 0
|
|
70
|
-
? [options.primaryPath]
|
|
71
|
-
: []));
|
|
72
|
-
}
|
|
73
|
-
export function formatBatchStepCommand(command, index) {
|
|
74
|
-
return command && command.length > 0 ? command.join(" ") : `step-${index + 1}`;
|
|
75
|
-
}
|
|
76
|
-
function selectObservationFields(details) {
|
|
77
|
-
const observation = {};
|
|
78
|
-
for (const key of OBSERVATION_DETAIL_FIELDS) {
|
|
79
|
-
if (details[key] !== undefined) {
|
|
80
|
-
observation[key] = details[key];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (details.inspection === true &&
|
|
84
|
-
details.data === undefined &&
|
|
85
|
-
typeof details.stdout === "string") {
|
|
86
|
-
observation.data = details.stdout;
|
|
87
|
-
}
|
|
88
|
-
// Identical error/summary strings double-count large failure text against the observation bound; keep error.
|
|
89
|
-
if (typeof observation.error === "string" && observation.error === observation.summary) {
|
|
90
|
-
observation.summary = undefined;
|
|
91
|
-
}
|
|
92
|
-
if (isRecord(observation.data)) {
|
|
93
|
-
observation.data = omitUpstreamLifecycle(observation.data);
|
|
94
|
-
}
|
|
95
|
-
if (isTimeoutPartialProgress(observation.timeoutPartialProgress)) {
|
|
96
|
-
observation.timeoutPartialProgress = redactTimeoutPartialProgress(observation.timeoutPartialProgress);
|
|
97
|
-
}
|
|
98
|
-
return observation;
|
|
99
|
-
}
|
|
100
|
-
function projectBatchMetadata(step) {
|
|
101
|
-
const { data: _data, ...metadata } = projectAgentBrowserObservation(step, step.success !== false);
|
|
102
|
-
return Object.assign({ index: step.index }, metadata);
|
|
103
|
-
}
|
|
104
|
-
// Shared by direct results and code observations; ownership/replay state stays in details.
|
|
105
|
-
export function projectAgentBrowserObservation(details, succeeded) {
|
|
106
|
-
const observation = selectObservationFields(details);
|
|
107
|
-
if (Array.isArray(details.batchSteps)) {
|
|
108
|
-
observation.batchSteps = details.batchSteps.filter(isRecord).map(projectBatchMetadata);
|
|
109
|
-
}
|
|
110
|
-
const redacted = redactSensitiveValue(observation);
|
|
111
|
-
if (!isRecord(redacted)) {
|
|
112
|
-
throw new Error("Browser observation redaction must preserve its record shape.");
|
|
113
|
-
}
|
|
114
|
-
// Native stream endpoints are usable browser resource identifiers, not credentials.
|
|
115
|
-
if (isRecord(redacted.data) && isRecord(details.data) && typeof details.data.wsUrl === "string") {
|
|
116
|
-
redacted.data.wsUrl = details.data.wsUrl;
|
|
117
|
-
}
|
|
118
|
-
return { success: succeeded, resultCategory: succeeded ? "success" : "failure", ...redacted };
|
|
119
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { firstLine, getArrayField, getStringField, redactModelFacingText, stringifyModelFacing, } from "./common.js";
|
|
3
|
-
function violationLine(item, index) {
|
|
4
|
-
if (!isRecord(item)) {
|
|
5
|
-
return `${index + 1}. ${stringifyModelFacing(item)}`;
|
|
6
|
-
}
|
|
7
|
-
const id = redactModelFacingText(getStringField(item, "id") ?? "rule");
|
|
8
|
-
const impact = redactModelFacingText(getStringField(item, "impact") ?? "unknown");
|
|
9
|
-
const help = firstLine(redactModelFacingText(getStringField(item, "help") ?? "")
|
|
10
|
-
.replace(/\s+/g, " ")
|
|
11
|
-
.trim(), 160);
|
|
12
|
-
const nodeCount = typeof item.nodeCount === "number" ? item.nodeCount : getArrayField(item, "nodes")?.length;
|
|
13
|
-
const nodePart = typeof nodeCount === "number" ? `, ${nodeCount} node${nodeCount === 1 ? "" : "s"}` : "";
|
|
14
|
-
return `${index + 1}. [${impact}] ${id}${nodePart}${help.length > 0 ? ` — ${help}` : ""}`;
|
|
15
|
-
}
|
|
16
|
-
function countSummary(counts, violationCount, incompleteCount) {
|
|
17
|
-
const parts = [
|
|
18
|
-
`${violationCount} violation${violationCount === 1 ? "" : "s"}`,
|
|
19
|
-
`${incompleteCount} incomplete`,
|
|
20
|
-
];
|
|
21
|
-
if (typeof counts?.passes === "number") {
|
|
22
|
-
parts.push(`${counts.passes} passes`);
|
|
23
|
-
}
|
|
24
|
-
if (typeof counts?.inapplicable === "number") {
|
|
25
|
-
parts.push(`${counts.inapplicable} inapplicable`);
|
|
26
|
-
}
|
|
27
|
-
return `A11y audit: ${parts.join(", ")}.`;
|
|
28
|
-
}
|
|
29
|
-
function auditHeader(data) {
|
|
30
|
-
const lines = [];
|
|
31
|
-
const axeVersion = getStringField(data, "axeVersion");
|
|
32
|
-
if (axeVersion !== undefined) {
|
|
33
|
-
lines.push(`axe-core ${redactModelFacingText(axeVersion)}`);
|
|
34
|
-
}
|
|
35
|
-
const url = getStringField(data, "url");
|
|
36
|
-
if (url !== undefined) {
|
|
37
|
-
lines.push(`URL: ${redactModelFacingText(url)}`);
|
|
38
|
-
}
|
|
39
|
-
return lines;
|
|
40
|
-
}
|
|
41
|
-
function auditCounts(counts, violations, incomplete) {
|
|
42
|
-
return {
|
|
43
|
-
violations: typeof counts?.violations === "number" ? counts.violations : violations.length,
|
|
44
|
-
incomplete: typeof counts?.incomplete === "number" ? counts.incomplete : incomplete.length,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export function formatA11yText(data) {
|
|
48
|
-
const counts = isRecord(data.counts) ? data.counts : undefined;
|
|
49
|
-
const violations = getArrayField(data, "violations") ?? [];
|
|
50
|
-
const incomplete = getArrayField(data, "incomplete") ?? [];
|
|
51
|
-
if (!counts && violations.length === 0 && incomplete.length === 0) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
const lines = auditHeader(data);
|
|
55
|
-
const observedCounts = auditCounts(counts, violations, incomplete);
|
|
56
|
-
const incompleteCount = observedCounts.incomplete;
|
|
57
|
-
lines.push(countSummary(counts, observedCounts.violations, incompleteCount));
|
|
58
|
-
const preview = violations.slice(0, 10).map(violationLine);
|
|
59
|
-
lines.push(...preview);
|
|
60
|
-
if (violations.length > preview.length) {
|
|
61
|
-
lines.push(`... (${violations.length - preview.length} additional violations omitted from preview)`);
|
|
62
|
-
}
|
|
63
|
-
if (incompleteCount > 0) {
|
|
64
|
-
lines.push(`${incompleteCount} incomplete check${incompleteCount === 1 ? "" : "s"} need manual review (see details.data.incomplete).`);
|
|
65
|
-
}
|
|
66
|
-
return lines.join("\n");
|
|
67
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../../parsing.js";
|
|
2
|
-
import { firstLine, getArrayField, getStringField, redactModelFacingText, stringifyModelFacing, } from "./common.js";
|
|
3
|
-
export function formatDashboardText(data) {
|
|
4
|
-
const lines = [];
|
|
5
|
-
if (typeof data.port === "number") {
|
|
6
|
-
lines.push(`Port: ${data.port}`);
|
|
7
|
-
}
|
|
8
|
-
if (typeof data.pid === "number") {
|
|
9
|
-
lines.push(`PID: ${data.pid}`);
|
|
10
|
-
}
|
|
11
|
-
if (typeof data.stopped === "boolean") {
|
|
12
|
-
lines.push(`Stopped: ${data.stopped}`);
|
|
13
|
-
}
|
|
14
|
-
const reason = getStringField(data, "reason");
|
|
15
|
-
if (reason !== undefined) {
|
|
16
|
-
lines.push(`Reason: ${redactModelFacingText(reason)}`);
|
|
17
|
-
}
|
|
18
|
-
return lines.length > 0 ? lines.join("\n") : undefined;
|
|
19
|
-
}
|
|
20
|
-
function doctorCheckLines(item, index) {
|
|
21
|
-
if (!isRecord(item)) {
|
|
22
|
-
return [`${index + 1}. ${stringifyModelFacing(item)}`];
|
|
23
|
-
}
|
|
24
|
-
const status = getStringField(item, "status") ?? "info";
|
|
25
|
-
const label = [getStringField(item, "category"), getStringField(item, "id")]
|
|
26
|
-
.filter(Boolean)
|
|
27
|
-
.join("/");
|
|
28
|
-
const message = getStringField(item, "message") ??
|
|
29
|
-
getStringField(item, "name") ??
|
|
30
|
-
getStringField(item, "title") ??
|
|
31
|
-
getStringField(item, "check") ??
|
|
32
|
-
stringifyModelFacing(item);
|
|
33
|
-
const lines = [
|
|
34
|
-
`${index + 1}. [${redactModelFacingText(status)}]${label.length > 0 ? ` ${redactModelFacingText(label)}:` : ""} ${firstLine(redactModelFacingText(message), 220)}`,
|
|
35
|
-
];
|
|
36
|
-
const fix = getStringField(item, "fix");
|
|
37
|
-
if (fix !== undefined) {
|
|
38
|
-
lines.push(` fix: ${redactModelFacingText(fix)}`);
|
|
39
|
-
}
|
|
40
|
-
return lines;
|
|
41
|
-
}
|
|
42
|
-
function doctorSummary(data) {
|
|
43
|
-
const lines = [];
|
|
44
|
-
const status = getStringField(data, "status") ?? getStringField(data, "result");
|
|
45
|
-
if (status !== undefined) {
|
|
46
|
-
lines.push(`Status: ${redactModelFacingText(status)}`);
|
|
47
|
-
}
|
|
48
|
-
if (isRecord(data.summary)) {
|
|
49
|
-
const summary = data.summary;
|
|
50
|
-
const parts = ["pass", "warn", "fail"].flatMap((key) => typeof summary[key] === "number" ? [`${key}:${summary[key]}`] : []);
|
|
51
|
-
if (parts.length > 0) {
|
|
52
|
-
lines.push(`Summary: ${parts.join(", ")}`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return lines;
|
|
56
|
-
}
|
|
57
|
-
export function formatDoctorText(data) {
|
|
58
|
-
const lines = doctorSummary(data);
|
|
59
|
-
const checks = getArrayField(data, "checks");
|
|
60
|
-
if (checks) {
|
|
61
|
-
lines.push(`Checks: ${checks.length}`, ...checks.slice(0, 30).flatMap(doctorCheckLines));
|
|
62
|
-
if (checks.length > 30) {
|
|
63
|
-
lines.push(`... (${checks.length - 30} additional checks omitted from preview)`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
for (const key of ["issues", "problems"]) {
|
|
67
|
-
const items = getArrayField(data, key);
|
|
68
|
-
if (items) {
|
|
69
|
-
lines.push(`${key}: ${items.length}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (lines.length > 0) {
|
|
73
|
-
return lines.join("\n");
|
|
74
|
-
}
|
|
75
|
-
const keys = Object.keys(data).filter((key) => key !== "success");
|
|
76
|
-
return keys.length > 0
|
|
77
|
-
? `Doctor diagnostics returned unrecognized fields: ${keys.map(redactModelFacingText).join(", ")}. See details.data for structured diagnostics.`
|
|
78
|
-
: undefined;
|
|
79
|
-
}
|