pi-agent-browser-native 0.9.5 → 0.9.6
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 +19 -0
- package/README.md +3 -0
- package/dist/extensions/agent-browser/index.js +1214 -583
- package/dist/packaged/lib/browser-session-conversion.js +2810 -0
- package/dist/packaged/lib/config-policy.js +599 -0
- package/dist/packaged/lib/parsing.js +34 -0
- package/dist/packaged/lib/playbook.js +694 -0
- package/dist/packaged/lib/results/snapshot.js +2671 -0
- package/dist/packaged/lib/runtime.js +3027 -0
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CODE_QUALITY.md +11 -0
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/PERFORMANCE.md +243 -0
- package/docs/REFERENCE.md +3 -3
- package/docs/SESSION_STORAGE.md +11 -3
- package/docs/SUPPORT_MATRIX.md +8 -4
- package/docs/TOOL_CONTRACT.md +4 -4
- package/docs/performance/2026-10-12.json +7257 -0
- package/package.json +13 -2
- package/scripts/build.mjs +16 -5
- package/scripts/config.mjs +1 -1
- package/scripts/convert-browser-session.mjs +1 -1
- 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,383 +0,0 @@
|
|
|
1
|
-
import { normalizeWhitespace, truncateText } from "./text.js";
|
|
2
|
-
const SNAPSHOT_MAX_ADDITIONAL_SECTIONS = 2;
|
|
3
|
-
const SNAPSHOT_FALLBACK_PREVIEW_MAX_LINES = 12;
|
|
4
|
-
const SNAPSHOT_LINE_MAX_CHARS = 140;
|
|
5
|
-
const SNAPSHOT_SIGNAL_ROLES = new Set([
|
|
6
|
-
"article",
|
|
7
|
-
"banner",
|
|
8
|
-
"button",
|
|
9
|
-
"checkbox",
|
|
10
|
-
"combobox",
|
|
11
|
-
"dialog",
|
|
12
|
-
"gridcell",
|
|
13
|
-
"heading",
|
|
14
|
-
"link",
|
|
15
|
-
"listitem",
|
|
16
|
-
"main",
|
|
17
|
-
"menu",
|
|
18
|
-
"menuitem",
|
|
19
|
-
"navigation",
|
|
20
|
-
"option",
|
|
21
|
-
"radio",
|
|
22
|
-
"region",
|
|
23
|
-
"row",
|
|
24
|
-
"searchbox",
|
|
25
|
-
"tab",
|
|
26
|
-
"textbox",
|
|
27
|
-
]);
|
|
28
|
-
const SNAPSHOT_SEGMENT_ROOT_ROLES = new Set([
|
|
29
|
-
"article",
|
|
30
|
-
"dialog",
|
|
31
|
-
"heading",
|
|
32
|
-
"main",
|
|
33
|
-
"menu",
|
|
34
|
-
"region",
|
|
35
|
-
]);
|
|
36
|
-
const SNAPSHOT_ROLE_PRIORITY = {
|
|
37
|
-
article: 0,
|
|
38
|
-
main: 1,
|
|
39
|
-
dialog: 2,
|
|
40
|
-
menu: 3,
|
|
41
|
-
region: 4,
|
|
42
|
-
heading: 5,
|
|
43
|
-
searchbox: 6,
|
|
44
|
-
textbox: 7,
|
|
45
|
-
combobox: 8,
|
|
46
|
-
button: 9,
|
|
47
|
-
checkbox: 10,
|
|
48
|
-
radio: 11,
|
|
49
|
-
tab: 12,
|
|
50
|
-
option: 13,
|
|
51
|
-
link: 14,
|
|
52
|
-
listitem: 14,
|
|
53
|
-
row: 15,
|
|
54
|
-
gridcell: 16,
|
|
55
|
-
navigation: 17,
|
|
56
|
-
generic: 99,
|
|
57
|
-
unknown: 100,
|
|
58
|
-
};
|
|
59
|
-
const SNAPSHOT_NOISE_NAME_PATTERNS = [
|
|
60
|
-
/^skip to /i,
|
|
61
|
-
/^ad$/i,
|
|
62
|
-
/^don't want to see ads\??$/i,
|
|
63
|
-
/keyboard shortcuts/i,
|
|
64
|
-
/\bpromoted\b/i,
|
|
65
|
-
/\bsponsored\b/i,
|
|
66
|
-
];
|
|
67
|
-
const SNAPSHOT_CHROME_SECTION_PATTERNS = [
|
|
68
|
-
/^primary$/i,
|
|
69
|
-
/^footer$/i,
|
|
70
|
-
/^navigation$/i,
|
|
71
|
-
/\bwhat['’]?s happening\b/i,
|
|
72
|
-
/\brelevant people\b/i,
|
|
73
|
-
/\btrending\b/i,
|
|
74
|
-
/\brelated\b/i,
|
|
75
|
-
/\brecommended\b/i,
|
|
76
|
-
/\bsuggested\b/i,
|
|
77
|
-
];
|
|
78
|
-
export function getSnapshotRolePriority(role) {
|
|
79
|
-
return SNAPSHOT_ROLE_PRIORITY[role] ?? 50;
|
|
80
|
-
}
|
|
81
|
-
function parseSnapshotHeadingLevel(text) {
|
|
82
|
-
const level = text.match(/\blevel=(\d+)/)?.[1];
|
|
83
|
-
return level !== undefined && level.length > 0 ? Number(level) : undefined;
|
|
84
|
-
}
|
|
85
|
-
export function parseSnapshotLines(snapshot) {
|
|
86
|
-
return snapshot
|
|
87
|
-
.split("\n")
|
|
88
|
-
.filter((line) => line.length > 0)
|
|
89
|
-
.map((raw, index) => {
|
|
90
|
-
const trimmed = raw.trimStart();
|
|
91
|
-
const depth = Math.floor((raw.match(/^\s*/)?.[0].length ?? 0) / 2);
|
|
92
|
-
const role = trimmed.match(/^[-*]\s+([^\s"]+)/)?.[1] ?? "unknown";
|
|
93
|
-
const name = normalizeWhitespace(trimmed.match(/"([^"]*)"/)?.[1] ?? "");
|
|
94
|
-
const ref = trimmed.match(/\bref=([^,\]\s]+)/)?.[1];
|
|
95
|
-
return {
|
|
96
|
-
depth,
|
|
97
|
-
headingLevel: parseSnapshotHeadingLevel(trimmed),
|
|
98
|
-
index,
|
|
99
|
-
name,
|
|
100
|
-
raw,
|
|
101
|
-
ref,
|
|
102
|
-
role,
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
export function isNoiseName(name) {
|
|
107
|
-
return SNAPSHOT_NOISE_NAME_PATTERNS.some((pattern) => pattern.test(name));
|
|
108
|
-
}
|
|
109
|
-
export function isChromeSectionName(name) {
|
|
110
|
-
return SNAPSHOT_CHROME_SECTION_PATTERNS.some((pattern) => pattern.test(name));
|
|
111
|
-
}
|
|
112
|
-
function isNoiseSnapshotLine(line) {
|
|
113
|
-
if (line.name.length > 0 && isNoiseName(line.name)) {
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
const loweredRaw = line.raw.toLowerCase();
|
|
117
|
-
return loweredRaw.includes("promoted") || loweredRaw.includes("sponsored");
|
|
118
|
-
}
|
|
119
|
-
function isPotentialSegmentRootLine(line) {
|
|
120
|
-
if (!SNAPSHOT_SEGMENT_ROOT_ROLES.has(line.role)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (isNoiseSnapshotLine(line)) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
if (line.role === "heading") {
|
|
127
|
-
return line.name.length > 0 && (line.headingLevel ?? 99) <= 3;
|
|
128
|
-
}
|
|
129
|
-
if (line.role === "region") {
|
|
130
|
-
return line.name.length > 0;
|
|
131
|
-
}
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
function getHeadingPriorityScore(level) {
|
|
135
|
-
switch (level) {
|
|
136
|
-
case 1:
|
|
137
|
-
return 40;
|
|
138
|
-
case 2:
|
|
139
|
-
return 22;
|
|
140
|
-
case 3:
|
|
141
|
-
return 12;
|
|
142
|
-
case undefined:
|
|
143
|
-
return 0;
|
|
144
|
-
default:
|
|
145
|
-
return 0;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function scoreSegment(segment) {
|
|
149
|
-
const { root } = segment;
|
|
150
|
-
const distinctRefs = new Set(segment.lines.flatMap((line) => line.ref !== undefined && line.ref.length > 0 ? [line.ref] : [])).size;
|
|
151
|
-
let score = 0;
|
|
152
|
-
score += 120 - getSnapshotRolePriority(root.role) * 8;
|
|
153
|
-
score += Math.min(distinctRefs, 16);
|
|
154
|
-
score += Math.min(segment.lines.length, 12);
|
|
155
|
-
score -= Math.min(root.index, 60) / 3;
|
|
156
|
-
score -= root.depth * 6;
|
|
157
|
-
if (root.role === "heading") {
|
|
158
|
-
score += getHeadingPriorityScore(root.headingLevel);
|
|
159
|
-
}
|
|
160
|
-
if (root.name.length > 0) {
|
|
161
|
-
score += 10;
|
|
162
|
-
}
|
|
163
|
-
if (root.name.length <= 2) {
|
|
164
|
-
score -= 18;
|
|
165
|
-
}
|
|
166
|
-
if (isChromeSectionName(root.name)) {
|
|
167
|
-
score -= 45;
|
|
168
|
-
}
|
|
169
|
-
if (isNoiseName(root.name)) {
|
|
170
|
-
score -= 1000;
|
|
171
|
-
}
|
|
172
|
-
return score;
|
|
173
|
-
}
|
|
174
|
-
function hasDuplicateSegmentAncestor(line, stack) {
|
|
175
|
-
const name = normalizeWhitespace(line.name.toLowerCase());
|
|
176
|
-
if (name.length === 0) {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
for (let index = stack.length - 1; index >= 0; index -= 1) {
|
|
180
|
-
const ancestor = stack.at(index);
|
|
181
|
-
if (ancestor &&
|
|
182
|
-
normalizeWhitespace(ancestor.name.toLowerCase()) === name &&
|
|
183
|
-
SNAPSHOT_SEGMENT_ROOT_ROLES.has(ancestor.role)) {
|
|
184
|
-
return true;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
export function buildSnapshotSegments(snapshotLines) {
|
|
190
|
-
const roots = [];
|
|
191
|
-
const stack = [];
|
|
192
|
-
for (const line of snapshotLines) {
|
|
193
|
-
stack.length = line.depth;
|
|
194
|
-
if (isPotentialSegmentRootLine(line) && !hasDuplicateSegmentAncestor(line, stack)) {
|
|
195
|
-
roots.push(line);
|
|
196
|
-
}
|
|
197
|
-
stack[line.depth] = line;
|
|
198
|
-
}
|
|
199
|
-
return roots.map((root, index) => {
|
|
200
|
-
let endIndexExclusive = snapshotLines.length;
|
|
201
|
-
for (let nextIndex = index + 1; nextIndex < roots.length; nextIndex += 1) {
|
|
202
|
-
const candidate = roots[nextIndex];
|
|
203
|
-
if (candidate.depth <= root.depth) {
|
|
204
|
-
endIndexExclusive = candidate.index;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const lines = snapshotLines.slice(root.index, endIndexExclusive);
|
|
209
|
-
const segment = {
|
|
210
|
-
endIndexExclusive,
|
|
211
|
-
lines,
|
|
212
|
-
root,
|
|
213
|
-
score: 0,
|
|
214
|
-
startIndex: root.index,
|
|
215
|
-
};
|
|
216
|
-
return Object.assign({}, segment, { score: scoreSegment(segment) });
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
export function choosePrimarySegment(segments) {
|
|
220
|
-
if (segments.length === 0) {
|
|
221
|
-
return undefined;
|
|
222
|
-
}
|
|
223
|
-
return (segments.find((segment) => segment.root.role === "main" || segment.root.role === "article") ??
|
|
224
|
-
segments.find((segment) => segment.root.role === "heading" && segment.root.headingLevel === 1) ??
|
|
225
|
-
segments.find((segment) => segment.score >= 90) ??
|
|
226
|
-
[...segments].sort((left, right) => {
|
|
227
|
-
const difference = right.score - left.score;
|
|
228
|
-
return difference !== 0 && !Number.isNaN(difference)
|
|
229
|
-
? difference
|
|
230
|
-
: left.startIndex - right.startIndex;
|
|
231
|
-
})[0]);
|
|
232
|
-
}
|
|
233
|
-
function isChromePreviewSegment(segment) {
|
|
234
|
-
return (isChromeSectionName(segment.root.name) ||
|
|
235
|
-
(segment.root.role === "heading" && segment.root.name.length <= 2));
|
|
236
|
-
}
|
|
237
|
-
export function chooseAdditionalSegments(segments, primary) {
|
|
238
|
-
if (!primary) {
|
|
239
|
-
return [];
|
|
240
|
-
}
|
|
241
|
-
const seenNames = new Set([normalizeWhitespace(primary.root.name.toLowerCase())]);
|
|
242
|
-
const rankedCandidates = segments
|
|
243
|
-
.filter((segment) => segment !== primary && segment.score >= 45)
|
|
244
|
-
.sort((left, right) => {
|
|
245
|
-
const leftDistance = Math.abs(left.startIndex - primary.startIndex);
|
|
246
|
-
const rightDistance = Math.abs(right.startIndex - primary.startIndex);
|
|
247
|
-
if (leftDistance !== rightDistance) {
|
|
248
|
-
return leftDistance - rightDistance;
|
|
249
|
-
}
|
|
250
|
-
if (right.score !== left.score) {
|
|
251
|
-
return right.score - left.score;
|
|
252
|
-
}
|
|
253
|
-
return left.startIndex - right.startIndex;
|
|
254
|
-
});
|
|
255
|
-
const chosen = [];
|
|
256
|
-
for (const segment of rankedCandidates) {
|
|
257
|
-
if (chosen.length >= SNAPSHOT_MAX_ADDITIONAL_SECTIONS) {
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
if (isChromePreviewSegment(segment)) {
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
const nameKey = normalizeWhitespace(segment.root.name.toLowerCase());
|
|
264
|
-
if (nameKey.length > 0 && seenNames.has(nameKey)) {
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
chosen.push(segment);
|
|
268
|
-
if (nameKey.length > 0) {
|
|
269
|
-
seenNames.add(nameKey);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return chosen.sort((left, right) => left.startIndex - right.startIndex);
|
|
273
|
-
}
|
|
274
|
-
export function getMeaningfulSegmentLines(segment) {
|
|
275
|
-
return segment.lines.filter((line) => {
|
|
276
|
-
if (isNoiseSnapshotLine(line)) {
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
if (line.role === "generic" && (line.ref ?? "") === "" && line.name.length === 0) {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
if (line.role === "link" && line.name.length === 0) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
return true;
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
function formatPreviewLine(line, baseDepth) {
|
|
289
|
-
const leadingWhitespace = (line.raw.match(/^\s*/) ?? [""])[0].length;
|
|
290
|
-
const stripChars = Math.min(leadingWhitespace, Math.max(0, baseDepth) * 2);
|
|
291
|
-
return truncateText(line.raw.slice(stripChars), SNAPSHOT_LINE_MAX_CHARS);
|
|
292
|
-
}
|
|
293
|
-
function isRedundantPreviewLine(line, root) {
|
|
294
|
-
if (line === root) {
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
return ((root.role !== "heading" && line.depth - root.depth > 2) ||
|
|
298
|
-
(root.name.length > 0 &&
|
|
299
|
-
line.name === root.name &&
|
|
300
|
-
(line.role === "heading" || line.role === "link")));
|
|
301
|
-
}
|
|
302
|
-
export function buildSegmentPreview(segment, maxLines) {
|
|
303
|
-
const meaningfulLines = getMeaningfulSegmentLines(segment);
|
|
304
|
-
if (meaningfulLines.length === 0) {
|
|
305
|
-
return { omittedCount: 0, refIds: [], lines: [] };
|
|
306
|
-
}
|
|
307
|
-
const previewLines = [];
|
|
308
|
-
const previewRefIds = new Set();
|
|
309
|
-
const seenPreviewKeys = new Set();
|
|
310
|
-
const rootDepth = segment.root.depth;
|
|
311
|
-
for (const line of meaningfulLines) {
|
|
312
|
-
if (previewLines.length >= maxLines) {
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
if (isRedundantPreviewLine(line, segment.root)) {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
const key = `${line.role}:${line.name}:${line.ref ?? ""}:${line.depth}`;
|
|
319
|
-
if (seenPreviewKeys.has(key)) {
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
seenPreviewKeys.add(key);
|
|
323
|
-
previewLines.push(line);
|
|
324
|
-
if (line.ref !== undefined && line.ref.length > 0) {
|
|
325
|
-
previewRefIds.add(line.ref);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
omittedCount: Math.max(0, meaningfulLines.length - previewLines.length),
|
|
330
|
-
refIds: [...previewRefIds],
|
|
331
|
-
lines: previewLines.map((line) => formatPreviewLine(line, rootDepth)),
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
function hasSnapshotSignal(line) {
|
|
335
|
-
return (SNAPSHOT_SIGNAL_ROLES.has(line.role) || (line.ref ?? "").length > 0 || line.name.length > 0);
|
|
336
|
-
}
|
|
337
|
-
export function buildFallbackSnapshotOutline(snapshotLines) {
|
|
338
|
-
const selected = new Set();
|
|
339
|
-
for (let index = 0; index < snapshotLines.length && selected.size < 4; index += 1) {
|
|
340
|
-
if (!isNoiseSnapshotLine(snapshotLines[index])) {
|
|
341
|
-
selected.add(index);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
for (let index = 0; index < snapshotLines.length && selected.size < SNAPSHOT_FALLBACK_PREVIEW_MAX_LINES; index += 1) {
|
|
345
|
-
const line = snapshotLines[index];
|
|
346
|
-
if (isNoiseSnapshotLine(line)) {
|
|
347
|
-
continue;
|
|
348
|
-
}
|
|
349
|
-
if (hasSnapshotSignal(line)) {
|
|
350
|
-
selected.add(index);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
const chosenLines = [...selected]
|
|
354
|
-
.sort((left, right) => left - right)
|
|
355
|
-
.slice(0, SNAPSHOT_FALLBACK_PREVIEW_MAX_LINES)
|
|
356
|
-
.map((index) => snapshotLines[index]);
|
|
357
|
-
return {
|
|
358
|
-
omittedCount: Math.max(0, snapshotLines.length - chosenLines.length),
|
|
359
|
-
refIds: chosenLines.flatMap((line) => line.ref !== undefined && line.ref.length > 0 ? [line.ref] : []),
|
|
360
|
-
lines: chosenLines.map((line) => truncateText(line.raw, SNAPSHOT_LINE_MAX_CHARS)),
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
export function buildRefLineOrderMap(snapshotLines) {
|
|
364
|
-
const map = new Map();
|
|
365
|
-
for (const line of snapshotLines) {
|
|
366
|
-
if (line.ref === undefined || line.ref.length === 0 || map.has(line.ref)) {
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
map.set(line.ref, line.index);
|
|
370
|
-
}
|
|
371
|
-
return map;
|
|
372
|
-
}
|
|
373
|
-
export function canUseStructuredSnapshotPreview(snapshotLines, refEntries) {
|
|
374
|
-
if (snapshotLines.length === 0) {
|
|
375
|
-
return false;
|
|
376
|
-
}
|
|
377
|
-
const linesWithRecognizedRoles = snapshotLines.filter((line) => line.role !== "unknown").length;
|
|
378
|
-
const linesWithNames = snapshotLines.filter((line) => line.name.length > 0).length;
|
|
379
|
-
const parsedRefIds = new Set(snapshotLines.flatMap((line) => line.ref !== undefined && line.ref.length > 0 ? [line.ref] : []));
|
|
380
|
-
return (linesWithRecognizedRoles >= Math.min(snapshotLines.length, 3) ||
|
|
381
|
-
linesWithNames >= Math.min(snapshotLines.length, 3) ||
|
|
382
|
-
parsedRefIds.size >= Math.min(refEntries.length, 3));
|
|
383
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { redactSensitiveValue } from "../runtime-redaction.js";
|
|
2
|
-
import { writePersistentSessionArtifactFile, writeSecureTempFile, } from "../temp.js";
|
|
3
|
-
import { buildEvictedSessionArtifactEntries, formatSessionArtifactRetentionSummary, mergeSessionArtifactManifest, } from "./artifact-manifest.js";
|
|
4
|
-
const SNAPSHOT_SPILL_FILE_PREFIX = "pi-agent-browser-snapshot";
|
|
5
|
-
export async function writeSnapshotSpillFile(data, persistentArtifactStore) {
|
|
6
|
-
const options = {
|
|
7
|
-
content: JSON.stringify(redactSensitiveValue(data), null, 2),
|
|
8
|
-
prefix: SNAPSHOT_SPILL_FILE_PREFIX,
|
|
9
|
-
suffix: ".json",
|
|
10
|
-
};
|
|
11
|
-
if (persistentArtifactStore) {
|
|
12
|
-
const result = await writePersistentSessionArtifactFile({
|
|
13
|
-
...options,
|
|
14
|
-
store: persistentArtifactStore,
|
|
15
|
-
});
|
|
16
|
-
return { ...result, storageScope: "persistent-session" };
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
evictedArtifacts: [],
|
|
20
|
-
path: await writeSecureTempFile(options),
|
|
21
|
-
storageScope: "process-temp",
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export function applySnapshotArtifactManifest(options) {
|
|
25
|
-
if (options.fullOutputPath === undefined ||
|
|
26
|
-
options.fullOutputPath.length === 0 ||
|
|
27
|
-
!options.spill) {
|
|
28
|
-
return {};
|
|
29
|
-
}
|
|
30
|
-
const nowMs = Date.now();
|
|
31
|
-
const entries = [
|
|
32
|
-
{
|
|
33
|
-
command: options.command,
|
|
34
|
-
createdAtMs: nowMs,
|
|
35
|
-
kind: "spill",
|
|
36
|
-
path: options.fullOutputPath,
|
|
37
|
-
retentionState: options.spill.storageScope === "persistent-session" ? "live" : "ephemeral",
|
|
38
|
-
storageScope: options.spill.storageScope,
|
|
39
|
-
},
|
|
40
|
-
...buildEvictedSessionArtifactEntries(options.spill.evictedArtifacts, nowMs),
|
|
41
|
-
];
|
|
42
|
-
const artifactManifest = mergeSessionArtifactManifest({
|
|
43
|
-
base: options.baseManifest,
|
|
44
|
-
entries,
|
|
45
|
-
nowMs,
|
|
46
|
-
});
|
|
47
|
-
return artifactManifest
|
|
48
|
-
? {
|
|
49
|
-
artifactManifest,
|
|
50
|
-
artifactRetentionSummary: formatSessionArtifactRetentionSummary(artifactManifest),
|
|
51
|
-
}
|
|
52
|
-
: {};
|
|
53
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "../parsing.js";
|
|
2
|
-
import { buildCompactSnapshotView } from "./snapshot-compact.js";
|
|
3
|
-
import { formatRawSnapshotText, formatSnapshotSummary, getSnapshotText, } from "./snapshot-content.js";
|
|
4
|
-
import { getSnapshotRefEntries } from "./snapshot-refs.js";
|
|
5
|
-
import { applySnapshotArtifactManifest, writeSnapshotSpillFile, } from "./snapshot-spill.js";
|
|
6
|
-
import { countLines, stringifyUnknown } from "./text.js";
|
|
7
|
-
export { formatRawSnapshotText, formatSnapshotSummary } from "./snapshot-content.js";
|
|
8
|
-
function shouldCompactSnapshot(rawText, data) {
|
|
9
|
-
return (rawText.length > 6_000 ||
|
|
10
|
-
countLines(getSnapshotText(data) ?? "") > 80 ||
|
|
11
|
-
getSnapshotRefEntries(data).length > 60);
|
|
12
|
-
}
|
|
13
|
-
async function getSnapshotSpill(data, store) {
|
|
14
|
-
try {
|
|
15
|
-
const spill = await writeSnapshotSpillFile(data, store);
|
|
16
|
-
return { spill, fullOutputPath: spill.path };
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
return { spillErrorText: error instanceof Error ? error.message : stringifyUnknown(error) };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export async function buildSnapshotPresentation(data, persistentArtifactStore, artifactManifest) {
|
|
23
|
-
const summary = formatSnapshotSummary(data);
|
|
24
|
-
const rawText = formatRawSnapshotText(data);
|
|
25
|
-
// Native partials are patches, not accessibility trees; large-output owns oversized patches.
|
|
26
|
-
if ((isRecord(data.snapshot) && data.snapshot.kind !== "full") ||
|
|
27
|
-
!shouldCompactSnapshot(rawText, data)) {
|
|
28
|
-
return { content: [{ type: "text", text: rawText }], data, summary };
|
|
29
|
-
}
|
|
30
|
-
const { spill, fullOutputPath, spillErrorText } = await getSnapshotSpill(data, persistentArtifactStore);
|
|
31
|
-
const compact = buildCompactSnapshotView(data, fullOutputPath, spillErrorText);
|
|
32
|
-
const manifestFields = applySnapshotArtifactManifest({
|
|
33
|
-
baseManifest: artifactManifest,
|
|
34
|
-
command: "snapshot",
|
|
35
|
-
fullOutputPath,
|
|
36
|
-
spill,
|
|
37
|
-
});
|
|
38
|
-
const notice = manifestFields.artifactRetentionSummary;
|
|
39
|
-
const text = compact.content.at(0);
|
|
40
|
-
if (notice !== undefined && notice.length > 0 && text?.type === "text") {
|
|
41
|
-
compact.content[0] = { type: "text", text: `${text.text}\n\n${notice}` };
|
|
42
|
-
}
|
|
43
|
-
return { ...manifestFields, ...compact, fullOutputPath, summary: `${summary} (compact)` };
|
|
44
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export function stringifyUnknown(value) {
|
|
2
|
-
if (typeof value === "string") {
|
|
3
|
-
return value;
|
|
4
|
-
}
|
|
5
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
6
|
-
return String(value);
|
|
7
|
-
}
|
|
8
|
-
if (value === null || value === undefined) {
|
|
9
|
-
return "";
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
const serialized = JSON.stringify(value, null, 2);
|
|
13
|
-
return typeof serialized === "string" ? serialized : "";
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return stringifyFallback(value);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function stringifyFallback(value) {
|
|
20
|
-
if (typeof value === "bigint" || typeof value === "symbol" || typeof value === "function") {
|
|
21
|
-
return String(value);
|
|
22
|
-
}
|
|
23
|
-
return Object.prototype.toString.call(value);
|
|
24
|
-
}
|
|
25
|
-
export function countLines(text) {
|
|
26
|
-
return text.length === 0 ? 0 : text.split("\n").length;
|
|
27
|
-
}
|
|
28
|
-
export function normalizeWhitespace(text) {
|
|
29
|
-
return text.replace(/\s+/g, " ").trim();
|
|
30
|
-
}
|
|
31
|
-
export function truncateText(text, maxChars) {
|
|
32
|
-
if (text.length <= maxChars) {
|
|
33
|
-
return text;
|
|
34
|
-
}
|
|
35
|
-
return `${text.slice(0, Math.max(1, maxChars - 1))}…`;
|
|
36
|
-
}
|
|
37
|
-
export function compareRefIds(left, right) {
|
|
38
|
-
const leftMatch = left.match(/^(?:[a-zA-Z]+)?(\d+)$/);
|
|
39
|
-
const rightMatch = right.match(/^(?:[a-zA-Z]+)?(\d+)$/);
|
|
40
|
-
if (leftMatch && rightMatch) {
|
|
41
|
-
return Number(leftMatch[1]) - Number(rightMatch[1]);
|
|
42
|
-
}
|
|
43
|
-
return left.localeCompare(right);
|
|
44
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { parseArgvDescriptor } from "./argv-descriptor.js";
|
|
2
|
-
import { GLOBAL_BOOLEAN_FLAGS_WITH_OPTIONAL_VALUES, GLOBAL_VALUE_FLAGS_ALLOWING_DASH_VALUE, PREVALIDATED_VALUE_FLAGS, stripUpstreamGlobalFlags, } from "./argv-grammar.js";
|
|
3
|
-
import { isOpenNavigationCommand } from "./command-taxonomy.js";
|
|
4
|
-
import { TARGET_AGENT_BROWSER_VERSION } from "./upstream-version.js";
|
|
5
|
-
const INSPECTION_FLAGS = new Set(["--help", "-h", "--version", "-V"]);
|
|
6
|
-
const SHELL_OPERATOR_TOKENS = new Set(["&&", "||", "|", ";", ">", ">>", "<"]);
|
|
7
|
-
export function isPlainTextInspectionArgs(args) {
|
|
8
|
-
return args.some((token) => INSPECTION_FLAGS.has(token));
|
|
9
|
-
}
|
|
10
|
-
function getSingleKeyCommandValidationError(args) {
|
|
11
|
-
const { commandInfo, upstreamCommandTokens: tokens } = parseArgvDescriptor(args);
|
|
12
|
-
const command = commandInfo.command;
|
|
13
|
-
if (!["press", "key", "keydown", "keyup"].includes(command ?? "") || tokens.length === 2) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const label = command === "key" ? "key/press" : command;
|
|
17
|
-
return `agent-browser ${label ?? ""} accepts exactly one key argument. Do not pass a selector or ref to ${label ?? ""}; focus or click the target first, then run ${command ?? ""} <key> (for example: focus @e1, then press Enter).`;
|
|
18
|
-
}
|
|
19
|
-
function getBareMcpValidationError(args) {
|
|
20
|
-
const { commandInfo, upstreamCommandTokens: tokens } = parseArgvDescriptor(args);
|
|
21
|
-
if (commandInfo.command !== "mcp" || tokens.includes("--help") || tokens.includes("-h")) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return "agent-browser mcp starts a stdio MCP server for external MCP clients, not a one-shot native agent_browser tool workflow. Use the native agent_browser tool modes directly, or configure an MCP client to launch `agent-browser mcp`. Use `mcp --help` for help.";
|
|
25
|
-
}
|
|
26
|
-
function getUnsupportedInlineWaitDownloadError(args) {
|
|
27
|
-
const descriptor = parseArgvDescriptor(args);
|
|
28
|
-
if (descriptor.commandInfo.command !== "wait" ||
|
|
29
|
-
!descriptor.upstreamCommandTokens.some((token) => token.startsWith("--download="))) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
return `agent-browser ${TARGET_AGENT_BROWSER_VERSION} does not support \`wait --download=<path>\`. Pass the optional path as a separate argument: \`wait --download <path>\` (or \`wait -d <path>\`).`;
|
|
33
|
-
}
|
|
34
|
-
function getBareNoSandboxValidationError(args, batchStep) {
|
|
35
|
-
// Native batch rows skip global parsing; --args is effective only on the outer CLI call.
|
|
36
|
-
const tokens = batchStep ? args : stripUpstreamGlobalFlags(args);
|
|
37
|
-
const command = tokens[0];
|
|
38
|
-
const leading = command === "--no-sandbox";
|
|
39
|
-
if (!leading &&
|
|
40
|
-
(!isOpenNavigationCommand(command) || !tokens.slice(1).includes("--no-sandbox"))) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const explanation = leading
|
|
44
|
-
? "`--no-sandbox` is not an agent-browser command."
|
|
45
|
-
: `\`--no-sandbox\` is ignored as an option by \`${command}\`.`;
|
|
46
|
-
return `${explanation} It is a Chromium launch argument. Put it in top-level \`--args\` and start a fresh session: { args: ["--args", "--no-sandbox", "open", "https://example.com"], sessionMode: "fresh" }. For batch, put --args before batch, not inside a step.`;
|
|
47
|
-
}
|
|
48
|
-
function getForbiddenToolTokenError(args) {
|
|
49
|
-
const shellOperator = args.find((token) => SHELL_OPERATOR_TOKENS.has(token));
|
|
50
|
-
if (shellOperator !== undefined) {
|
|
51
|
-
return `Do not pass shell operators like \`${shellOperator}\`. Pass exact agent-browser CLI arguments only.`;
|
|
52
|
-
}
|
|
53
|
-
if (args.some((token) => token === "--session-mode" || token.startsWith("--session-mode="))) {
|
|
54
|
-
return 'Do not pass `--session-mode` in args. Use the top-level agent_browser `sessionMode` field instead, for example { args: ["--profile", "Default", "open", "https://example.com"], sessionMode: "fresh" }.';
|
|
55
|
-
}
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
export function validateToolArgs(args, options = {}) {
|
|
59
|
-
if (args.length === 0) {
|
|
60
|
-
return "`args` must contain at least one agent-browser command token.";
|
|
61
|
-
}
|
|
62
|
-
const forbidden = getForbiddenToolTokenError(args);
|
|
63
|
-
if (forbidden !== undefined) {
|
|
64
|
-
return forbidden;
|
|
65
|
-
}
|
|
66
|
-
return getNativeCommandShapeError(args, options.batchStep === true);
|
|
67
|
-
}
|
|
68
|
-
function getNativeCommandShapeError(args, batchStep) {
|
|
69
|
-
const inspection = !batchStep && isPlainTextInspectionArgs(args);
|
|
70
|
-
const invalidValueFlag = inspection ? undefined : getInvalidValueFlagDetails(args, !batchStep);
|
|
71
|
-
if (invalidValueFlag?.reason === "unsupported-assignment") {
|
|
72
|
-
return formatInvalidValueFlagError(invalidValueFlag, batchStep);
|
|
73
|
-
}
|
|
74
|
-
return ((inspection ? undefined : getBareNoSandboxValidationError(args, batchStep)) ??
|
|
75
|
-
getBareMcpValidationError(args) ??
|
|
76
|
-
getSingleKeyCommandValidationError(args) ??
|
|
77
|
-
getUnsupportedInlineWaitDownloadError(args));
|
|
78
|
-
}
|
|
79
|
-
function unsupportedAssignment(token, flag, allowRestoreAssignment) {
|
|
80
|
-
return (token.includes("=") &&
|
|
81
|
-
(PREVALIDATED_VALUE_FLAGS.has(flag) ||
|
|
82
|
-
GLOBAL_BOOLEAN_FLAGS_WITH_OPTIONAL_VALUES.has(flag) ||
|
|
83
|
-
(!allowRestoreAssignment && flag === "--restore")));
|
|
84
|
-
}
|
|
85
|
-
function valueFlagProblem(flag, receivedToken) {
|
|
86
|
-
if (receivedToken === undefined || (flag === "--args" && receivedToken.length === 0)) {
|
|
87
|
-
return "missing-value";
|
|
88
|
-
}
|
|
89
|
-
if (receivedToken.startsWith("-") && !GLOBAL_VALUE_FLAGS_ALLOWING_DASH_VALUE.has(flag)) {
|
|
90
|
-
return "unexpected-flag";
|
|
91
|
-
}
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
export function getInvalidValueFlagDetails(args, allowRestoreAssignment = true) {
|
|
95
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
96
|
-
const token = args[index];
|
|
97
|
-
if (!token.startsWith("-")) {
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
const flag = token.split("=", 1)[0] ?? token;
|
|
101
|
-
if (unsupportedAssignment(token, flag, allowRestoreAssignment)) {
|
|
102
|
-
return { flag, index, reason: "unsupported-assignment" };
|
|
103
|
-
}
|
|
104
|
-
if (!PREVALIDATED_VALUE_FLAGS.has(flag)) {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
const receivedToken = args.at(index + 1);
|
|
108
|
-
const reason = valueFlagProblem(flag, receivedToken);
|
|
109
|
-
if (reason !== undefined) {
|
|
110
|
-
return reason === "unexpected-flag"
|
|
111
|
-
? { flag, index, reason, receivedToken }
|
|
112
|
-
: { flag, index, reason };
|
|
113
|
-
}
|
|
114
|
-
index += 1;
|
|
115
|
-
}
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
export function formatInvalidValueFlagError(details, batchStep = false) {
|
|
119
|
-
if (details.reason === "unsupported-assignment") {
|
|
120
|
-
if (batchStep) {
|
|
121
|
-
return details.flag === "--restore"
|
|
122
|
-
? "Global `--restore=<key>` belongs before `batch` in top-level args, not inside a batch step."
|
|
123
|
-
: `Global \`${details.flag}=<value>\` is not supported inside a batch step. Move \`${details.flag}\` and its value before \`batch\` as separate top-level args.`;
|
|
124
|
-
}
|
|
125
|
-
return `agent-browser ${TARGET_AGENT_BROWSER_VERSION} does not support \`${details.flag}=<value>\`. Pass \`${details.flag}\` and its value as separate arguments.`;
|
|
126
|
-
}
|
|
127
|
-
if (details.reason === "unexpected-flag" &&
|
|
128
|
-
details.receivedToken !== undefined &&
|
|
129
|
-
details.receivedToken.length > 0) {
|
|
130
|
-
return `Flag \`${details.flag}\` requires a value, but received \`${details.receivedToken}\` instead. Pass a non-flag value immediately after \`${details.flag}\`.`;
|
|
131
|
-
}
|
|
132
|
-
return `Flag \`${details.flag}\` requires a value immediately after it. Pass a non-flag token like \`${details.flag} demo\`.`;
|
|
133
|
-
}
|