pi-agent-browser-native 0.9.2 → 0.9.4
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 +91 -5
- package/README.md +120 -86
- package/dist/extensions/agent-browser/index.js +43065 -2016
- package/dist/extensions/agent-browser/lib/argv-descriptor.js +49 -26
- package/dist/extensions/agent-browser/lib/argv-grammar.js +82 -93
- package/dist/extensions/agent-browser/lib/bash-guard.js +129 -126
- package/dist/extensions/agent-browser/lib/batch-lifecycle.js +113 -49
- package/dist/extensions/agent-browser/lib/browser-execution-claim-codec.js +61 -0
- package/dist/extensions/agent-browser/lib/browser-execution-claim-storage.js +232 -0
- package/dist/extensions/agent-browser/lib/browser-execution-claims.js +202 -0
- package/dist/extensions/agent-browser/lib/browser-execution-identity.js +77 -0
- package/dist/extensions/agent-browser/lib/browser-journal-branch.js +98 -0
- package/dist/extensions/agent-browser/lib/browser-journal-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/browser-journal-projection.js +221 -0
- package/dist/extensions/agent-browser/lib/browser-journal-reader.js +89 -0
- package/dist/extensions/agent-browser/lib/browser-journal-replay.js +246 -0
- package/dist/extensions/agent-browser/lib/browser-journal.js +103 -394
- package/dist/extensions/agent-browser/lib/browser-legacy-pages.js +220 -0
- package/dist/extensions/agent-browser/lib/browser-legacy-projection.js +282 -0
- package/dist/extensions/agent-browser/lib/browser-legacy-types.js +1 -0
- package/dist/extensions/agent-browser/lib/browser-session-conversion-stream.js +217 -0
- package/dist/extensions/agent-browser/lib/browser-session-conversion.js +80 -335
- package/dist/extensions/agent-browser/lib/browser-transcript-contracts.js +35 -0
- package/dist/extensions/agent-browser/lib/browser-transcript-validation.js +166 -0
- package/dist/extensions/agent-browser/lib/browser-transcript.js +137 -81
- package/dist/extensions/agent-browser/lib/browser-value-parsing.js +15 -0
- package/dist/extensions/agent-browser/lib/command-capabilities.js +340 -0
- package/dist/extensions/agent-browser/lib/command-policy.js +107 -88
- package/dist/extensions/agent-browser/lib/command-taxonomy.js +49 -322
- package/dist/extensions/agent-browser/lib/config-policy.js +138 -343
- package/dist/extensions/agent-browser/lib/config-providers.js +71 -0
- package/dist/extensions/agent-browser/lib/config-validation.js +218 -0
- package/dist/extensions/agent-browser/lib/config.js +19 -7
- package/dist/extensions/agent-browser/lib/electron/cdp.js +15 -7
- package/dist/extensions/agent-browser/lib/electron/cleanup.js +134 -55
- package/dist/extensions/agent-browser/lib/electron/discovery-darwin.js +109 -0
- package/dist/extensions/agent-browser/lib/electron/discovery-desktop.js +136 -0
- package/dist/extensions/agent-browser/lib/electron/discovery-evidence.js +89 -0
- package/dist/extensions/agent-browser/lib/electron/discovery-linux.js +93 -0
- package/dist/extensions/agent-browser/lib/electron/discovery-packages.js +162 -0
- package/dist/extensions/agent-browser/lib/electron/discovery-types.js +2 -0
- package/dist/extensions/agent-browser/lib/electron/discovery.js +140 -549
- package/dist/extensions/agent-browser/lib/electron/launch-monitor.js +102 -0
- package/dist/extensions/agent-browser/lib/electron/launch-process.js +209 -0
- package/dist/extensions/agent-browser/lib/electron/launch-types.js +2 -0
- package/dist/extensions/agent-browser/lib/electron/launch.js +249 -354
- package/dist/extensions/agent-browser/lib/executable-path.js +21 -12
- package/dist/extensions/agent-browser/lib/execution-cwd.js +35 -18
- package/dist/extensions/agent-browser/lib/input-modes/electron.js +162 -121
- package/dist/extensions/agent-browser/lib/input-modes/job.js +116 -313
- package/dist/extensions/agent-browser/lib/input-modes/lookup-network-evidence.js +104 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookup-plan.js +132 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookup-redaction.js +57 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookup-source-evidence.js +151 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookup-workspace.js +142 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookups.js +57 -412
- package/dist/extensions/agent-browser/lib/input-modes/params.js +63 -17
- package/dist/extensions/agent-browser/lib/input-modes/qa-analysis.js +268 -0
- package/dist/extensions/agent-browser/lib/input-modes/qa-presentation.js +117 -0
- package/dist/extensions/agent-browser/lib/input-modes/script-child.js +396 -0
- package/dist/extensions/agent-browser/lib/input-modes/script-protocol.js +86 -0
- package/dist/extensions/agent-browser/lib/input-modes/script-types.js +1 -0
- package/dist/extensions/agent-browser/lib/input-modes/script-validation.js +60 -0
- package/dist/extensions/agent-browser/lib/input-modes/script.js +60 -409
- package/dist/extensions/agent-browser/lib/input-modes/semantic-action.js +218 -128
- package/dist/extensions/agent-browser/lib/input-modes/shared.js +15 -4
- package/dist/extensions/agent-browser/lib/input-modes/types.js +56 -7
- package/dist/extensions/agent-browser/lib/json-schema.js +22 -10
- package/dist/extensions/agent-browser/lib/launch-scoped-flags.js +17 -5
- package/dist/extensions/agent-browser/lib/managed-session-policy-lock.js +92 -425
- package/dist/extensions/agent-browser/lib/managed-session-posix-storage.js +58 -0
- package/dist/extensions/agent-browser/lib/managed-session-project-identity.js +244 -0
- package/dist/extensions/agent-browser/lib/managed-session-restore-context.js +84 -0
- package/dist/extensions/agent-browser/lib/managed-session-restore-policy.js +119 -0
- package/dist/extensions/agent-browser/lib/managed-session-restore-state.js +83 -0
- package/dist/extensions/agent-browser/lib/managed-session-restore.js +168 -300
- package/dist/extensions/agent-browser/lib/managed-session-snapshot-records.js +277 -0
- package/dist/extensions/agent-browser/lib/managed-session-snapshots.js +128 -305
- package/dist/extensions/agent-browser/lib/managed-session-storage.js +56 -253
- package/dist/extensions/agent-browser/lib/native-confirmation.js +140 -0
- package/dist/extensions/agent-browser/lib/native-output.js +44 -9
- package/dist/extensions/agent-browser/lib/orchestration/batch-stdin.js +107 -66
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-merge.js +14 -6
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-paths.js +109 -57
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/browser-observation-result.js +82 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/click-dispatch.js +171 -57
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostic-values.js +31 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.js +152 -781
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-observation.js +202 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/electron-text-diagnostics.js +109 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/fill-diagnostics.js +119 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-action-recovery.js +147 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-actions.js +144 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-content.js +123 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-details.js +156 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-electron.js +179 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-evidence.js +39 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-missing-binary.js +89 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-recovery.js +97 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-redaction.js +106 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result-timeout.js +110 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result.js +41 -538
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/index.js +204 -108
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/interaction-diagnostics.js +290 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-close.js +167 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-inspection.js +108 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/managed-session-daemon-policy.js +127 -199
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/native-helper-observation.js +65 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/observation-types.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/overlay-diagnostics.js +120 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/network-page-filter.js +113 -30
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/scroll-shims.js +109 -28
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter-data.js +150 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter.js +138 -253
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-rendered-text.js +147 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/wait-timeouts.js +59 -24
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-artifacts.js +159 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-command.js +131 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-daemon.js +93 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-failure.js +42 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-guards.js +242 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-input.js +75 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-observations.js +92 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-selection.js +254 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-page-state.js +121 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-refs.js +130 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-resources.js +114 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-semantic.js +121 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-session-plan.js +222 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare-timeouts.js +68 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare.js +176 -1114
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-analysis.js +191 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-confirmation.js +152 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-diagnostics.js +182 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-electron.js +150 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle-phase.js +115 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-lifecycle.js +256 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-managed.js +256 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native-phase.js +93 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-native.js +113 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-navigation.js +316 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-ownership.js +28 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-page-phase.js +142 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-presentation.js +333 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication-phase.js +71 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-publication.js +201 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-receipts.js +183 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-refs.js +200 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output-tabs.js +142 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output.js +18 -910
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prompt-guards.js +23 -13
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-receipt-reconciliation.js +198 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery-presentation.js +154 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/recording-recovery.js +68 -151
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-capture.js +14 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/screenshot-observation.js +169 -46
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-commands.js +130 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-electron.js +210 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-observations.js +61 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-outcomes.js +187 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-refs.js +171 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state-tabs.js +228 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state.js +77 -753
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/text-visibility-diagnostics.js +182 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-diagnostics.js +256 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/timeout-progress.js +108 -0
- package/dist/extensions/agent-browser/lib/orchestration/code-artifact-observation.js +39 -0
- package/dist/extensions/agent-browser/lib/orchestration/code-image-observation.js +119 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/branch.js +92 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup-result.js +58 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/cleanup.js +78 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/discovery.js +106 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/index.js +48 -816
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/policy.js +86 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-collection.js +69 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-data.js +167 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe-presentation.js +164 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/probe.js +161 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/status.js +165 -0
- package/dist/extensions/agent-browser/lib/orchestration/execution-queue.js +21 -9
- package/dist/extensions/agent-browser/lib/orchestration/extension-artifact-preflight.js +211 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-artifacts.js +23 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-attachment-replay.js +99 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-branch-restore.js +275 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-code.js +280 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-admission.js +303 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-output.js +36 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-result.js +335 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-run.js +227 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-command-state.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-electron-ownership.js +204 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-execution-locks.js +139 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-execution-queue.js +24 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-host-coordination.js +98 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-host-run.js +295 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-intent-replay.js +41 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-invocation.js +7 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-lifecycle.js +102 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-managed-ownership.js +133 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-observation.js +120 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-prompt.js +180 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-recording.js +290 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-resource-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-resource-replay.js +269 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-result-state.js +113 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-runtime.js +146 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-script-leases.js +58 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-tool-boundary.js +62 -0
- package/dist/extensions/agent-browser/lib/orchestration/extension-version-check.js +54 -0
- package/dist/extensions/agent-browser/lib/orchestration/input-plan-types.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/input-plan.js +261 -185
- package/dist/extensions/agent-browser/lib/orchestration/input-redaction.js +62 -0
- package/dist/extensions/agent-browser/lib/orchestration/native-config.js +144 -0
- package/dist/extensions/agent-browser/lib/orchestration/native-root-launch.js +77 -0
- package/dist/extensions/agent-browser/lib/orchestration/native-session-defaults.js +210 -139
- package/dist/extensions/agent-browser/lib/orchestration/operation-paths.js +124 -58
- package/dist/extensions/agent-browser/lib/orchestration/output-file.js +198 -98
- package/dist/extensions/agent-browser/lib/orchestration/script-mode.js +199 -96
- package/dist/extensions/agent-browser/lib/owned-managed-session-context.js +55 -0
- package/dist/extensions/agent-browser/lib/page-target-batch.js +118 -0
- package/dist/extensions/agent-browser/lib/page-target-guards.js +50 -0
- package/dist/extensions/agent-browser/lib/page-target-navigation.js +104 -0
- package/dist/extensions/agent-browser/lib/page-target-validation.js +59 -243
- package/dist/extensions/agent-browser/lib/parsing.js +13 -4
- package/dist/extensions/agent-browser/lib/pi-tool-rendering.js +134 -68
- package/dist/extensions/agent-browser/lib/playbook.js +18 -14
- package/dist/extensions/agent-browser/lib/process-child.js +284 -0
- package/dist/extensions/agent-browser/lib/process-environment.js +22 -6
- package/dist/extensions/agent-browser/lib/process-errors.js +23 -0
- package/dist/extensions/agent-browser/lib/process-identity.js +47 -15
- package/dist/extensions/agent-browser/lib/process-socket-storage.js +256 -0
- package/dist/extensions/agent-browser/lib/process-stdout.js +74 -0
- package/dist/extensions/agent-browser/lib/process.js +146 -537
- package/dist/extensions/agent-browser/lib/prompt-artifacts.js +287 -0
- package/dist/extensions/agent-browser/lib/prompt-policy.js +15 -194
- package/dist/extensions/agent-browser/lib/read-command.js +41 -0
- package/dist/extensions/agent-browser/lib/read-confirmation.js +138 -35
- package/dist/extensions/agent-browser/lib/recording-reservations.js +118 -45
- package/dist/extensions/agent-browser/lib/redaction-fields.js +75 -0
- package/dist/extensions/agent-browser/lib/redaction-json.js +149 -0
- package/dist/extensions/agent-browser/lib/redaction-url.js +88 -0
- package/dist/extensions/agent-browser/lib/results/action-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/action-recommendations.js +28 -271
- package/dist/extensions/agent-browser/lib/results/artifact-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/artifact-manifest-validation.js +133 -0
- package/dist/extensions/agent-browser/lib/results/artifact-manifest.js +96 -94
- package/dist/extensions/agent-browser/lib/results/artifact-recommendations.js +73 -0
- package/dist/extensions/agent-browser/lib/results/categories.js +111 -54
- package/dist/extensions/agent-browser/lib/results/confirmation.js +29 -10
- package/dist/extensions/agent-browser/lib/results/editable-ref-evidence.js +62 -27
- package/dist/extensions/agent-browser/lib/results/electron-recommendations.js +83 -0
- package/dist/extensions/agent-browser/lib/results/envelope-decoding.js +48 -0
- package/dist/extensions/agent-browser/lib/results/envelope.js +93 -66
- package/dist/extensions/agent-browser/lib/results/evidence-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/failure-recommendations.js +180 -0
- package/dist/extensions/agent-browser/lib/results/network-routes.js +86 -45
- package/dist/extensions/agent-browser/lib/results/network.js +35 -12
- package/dist/extensions/agent-browser/lib/results/next-actions.js +49 -19
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-files.js +320 -0
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-format.js +138 -0
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-images.js +113 -0
- package/dist/extensions/agent-browser/lib/results/presentation/artifact-verification.js +145 -0
- package/dist/extensions/agent-browser/lib/results/presentation/artifacts.js +99 -552
- package/dist/extensions/agent-browser/lib/results/presentation/batch-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch-recording.js +118 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch-redaction.js +68 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch-rendering.js +135 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch-step.js +227 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch-summary.js +91 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch.js +91 -460
- package/dist/extensions/agent-browser/lib/results/presentation/browser-profile-recovery.js +9 -5
- package/dist/extensions/agent-browser/lib/results/presentation/command-presenters.js +216 -0
- package/dist/extensions/agent-browser/lib/results/presentation/common.js +26 -9
- package/dist/extensions/agent-browser/lib/results/presentation/content.js +86 -29
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-a11y.js +67 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-health.js +79 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-identity.js +199 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-logs.js +75 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network-actions.js +216 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-network.js +124 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-redaction.js +64 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-storage.js +209 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-stream.js +69 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostic-summary.js +222 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostics.js +103 -1019
- package/dist/extensions/agent-browser/lib/results/presentation/early-result.js +70 -0
- package/dist/extensions/agent-browser/lib/results/presentation/errors.js +130 -60
- package/dist/extensions/agent-browser/lib/results/presentation/input-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/presentation/large-output.js +60 -145
- package/dist/extensions/agent-browser/lib/results/presentation/navigation.js +147 -88
- package/dist/extensions/agent-browser/lib/results/presentation/notices.js +75 -0
- package/dist/extensions/agent-browser/lib/results/presentation/observation-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/presentation/observation-rendering.js +127 -0
- package/dist/extensions/agent-browser/lib/results/presentation/outcomes.js +120 -0
- package/dist/extensions/agent-browser/lib/results/presentation/output-completion.js +77 -0
- package/dist/extensions/agent-browser/lib/results/presentation/output-spill.js +51 -0
- package/dist/extensions/agent-browser/lib/results/presentation/registry.js +117 -237
- package/dist/extensions/agent-browser/lib/results/presentation/semantic-action.js +35 -21
- package/dist/extensions/agent-browser/lib/results/presentation/skills.js +104 -73
- package/dist/extensions/agent-browser/lib/results/presentation/source.js +109 -0
- package/dist/extensions/agent-browser/lib/results/presentation.js +17 -248
- package/dist/extensions/agent-browser/lib/results/recommendation-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/results/recording.js +52 -14
- package/dist/extensions/agent-browser/lib/results/recovery-actions.js +14 -5
- package/dist/extensions/agent-browser/lib/results/recovery-next-actions.js +30 -22
- package/dist/extensions/agent-browser/lib/results/selector-recovery-target.js +83 -0
- package/dist/extensions/agent-browser/lib/results/selector-recovery.js +123 -123
- package/dist/extensions/agent-browser/lib/results/snapshot-compact.js +266 -0
- package/dist/extensions/agent-browser/lib/results/snapshot-content.js +32 -0
- package/dist/extensions/agent-browser/lib/results/snapshot-high-value-controls.js +104 -71
- package/dist/extensions/agent-browser/lib/results/snapshot-refs.js +31 -11
- package/dist/extensions/agent-browser/lib/results/snapshot-segments.js +125 -66
- package/dist/extensions/agent-browser/lib/results/snapshot-spill.js +26 -7
- package/dist/extensions/agent-browser/lib/results/snapshot.js +28 -248
- package/dist/extensions/agent-browser/lib/results/text.js +16 -5
- package/dist/extensions/agent-browser/lib/runtime-args-validation.js +133 -0
- package/dist/extensions/agent-browser/lib/runtime-compatibility.js +81 -0
- package/dist/extensions/agent-browser/lib/runtime-contracts.js +1 -0
- package/dist/extensions/agent-browser/lib/runtime-redaction.js +118 -0
- package/dist/extensions/agent-browser/lib/runtime-replay-events.js +144 -0
- package/dist/extensions/agent-browser/lib/runtime-session-identity.js +76 -0
- package/dist/extensions/agent-browser/lib/runtime-session-plan.js +114 -0
- package/dist/extensions/agent-browser/lib/runtime-session-replay.js +123 -0
- package/dist/extensions/agent-browser/lib/runtime-tab-correction.js +65 -0
- package/dist/extensions/agent-browser/lib/runtime-timeouts.js +28 -0
- package/dist/extensions/agent-browser/lib/runtime.js +137 -1037
- package/dist/extensions/agent-browser/lib/session-identity.js +51 -0
- package/dist/extensions/agent-browser/lib/session-page-observation.js +357 -0
- package/dist/extensions/agent-browser/lib/session-page-state.js +188 -324
- package/dist/extensions/agent-browser/lib/session-page-types.js +1 -0
- package/dist/extensions/agent-browser/lib/temp-artifact-budget.js +78 -0
- package/dist/extensions/agent-browser/lib/temp-mutation-queue.js +7 -0
- package/dist/extensions/agent-browser/lib/temp-root-ownership.js +234 -0
- package/dist/extensions/agent-browser/lib/temp-root.js +207 -0
- package/dist/extensions/agent-browser/lib/temp.js +33 -446
- package/dist/extensions/agent-browser/lib/tool-surface.js +94 -24
- package/dist/extensions/agent-browser/lib/upstream-version.js +3 -2
- package/dist/extensions/agent-browser/lib/web-search-providers.js +229 -0
- package/dist/extensions/agent-browser/lib/web-search-request.js +108 -0
- package/dist/extensions/agent-browser/lib/web-search-results.js +281 -0
- package/dist/extensions/agent-browser/lib/web-search-schema.js +82 -0
- package/dist/extensions/agent-browser/lib/web-search.js +109 -617
- package/dist/extensions/agent-browser/lib/webmcp-observation.js +13 -6
- package/dist/extensions/agent-browser/lib/windows-stock-launcher.js +63 -37
- package/dist/extensions/agent-browser/script-worker.js +80 -43
- package/dist/scripts/agent-browser-target.mjs +4 -2
- package/docs/ARCHITECTURE.md +22 -10
- package/docs/CODE_QUALITY.md +242 -0
- package/docs/COMMAND_REFERENCE.md +264 -229
- package/docs/ELECTRON.md +53 -44
- package/docs/RELEASE.md +21 -17
- package/docs/REQUIREMENTS.md +2 -0
- package/docs/SESSION_STORAGE.md +1 -1
- package/docs/SUPPORT_MATRIX.md +84 -77
- package/docs/TOOL_CONTRACT.md +165 -130
- package/docs/platform-smoke.md +5 -5
- package/package.json +143 -120
- package/scripts/agent-browser-capability-baseline.mjs +361 -957
- package/scripts/agent-browser-target.mjs +6 -2
- package/scripts/build.mjs +37 -8
- package/scripts/capability-core-commands.mjs +193 -0
- package/scripts/capability-options.mjs +283 -0
- package/scripts/capability-samples.mjs +133 -0
- package/scripts/capability-section.mjs +11 -0
- package/scripts/config.mjs +213 -114
- package/scripts/convert-browser-session.mjs +30 -9
- package/scripts/doctor-sources.mjs +195 -0
- package/scripts/doctor.mjs +92 -247
- package/scripts/platform-smoke/artifacts.mjs +38 -11
- package/scripts/platform-smoke/commands.mjs +104 -0
- package/scripts/platform-smoke/crabbox-runner.mjs +167 -80
- package/scripts/platform-smoke/doctor-support.mjs +157 -0
- package/scripts/platform-smoke/doctor-windows.mjs +230 -0
- package/scripts/platform-smoke/doctor.mjs +212 -320
- package/scripts/platform-smoke/lease-evidence.mjs +134 -0
- package/scripts/platform-smoke/suite-checks.mjs +98 -0
- package/scripts/platform-smoke/suite-evidence.mjs +281 -0
- package/scripts/platform-smoke/targets.mjs +158 -472
- package/scripts/platform-smoke.mjs +55 -40
- package/scripts/prepare.mjs +16 -7
|
@@ -1,90 +1,127 @@
|
|
|
1
1
|
import { isRecord } from "../../parsing.js";
|
|
2
2
|
import { getStringField, redactModelFacingText, stringifyModelFacing } from "./common.js";
|
|
3
3
|
function formatSkillsListText(skills) {
|
|
4
|
-
if (skills.length === 0)
|
|
4
|
+
if (skills.length === 0) {
|
|
5
5
|
return "No agent-browser skills found.";
|
|
6
|
+
}
|
|
6
7
|
return skills
|
|
7
8
|
.map((item, index) => {
|
|
8
|
-
if (!isRecord(item))
|
|
9
|
+
if (!isRecord(item)) {
|
|
9
10
|
return `${index + 1}. ${stringifyModelFacing(item)}`;
|
|
11
|
+
}
|
|
10
12
|
const name = redactModelFacingText(getStringField(item, "name") ?? `(skill ${index + 1})`);
|
|
11
13
|
const description = getStringField(item, "description");
|
|
12
|
-
return description
|
|
14
|
+
return description !== undefined
|
|
15
|
+
? `${index + 1}. ${name} — ${redactModelFacingText(description)}`
|
|
16
|
+
: `${index + 1}. ${name}`;
|
|
13
17
|
})
|
|
14
18
|
.join("\n");
|
|
15
19
|
}
|
|
16
20
|
function getSkillContent(data) {
|
|
17
|
-
if (typeof data === "string")
|
|
21
|
+
if (typeof data === "string") {
|
|
18
22
|
return data;
|
|
19
|
-
|
|
23
|
+
}
|
|
24
|
+
if (isRecord(data) && typeof data.content === "string") {
|
|
20
25
|
return data.content;
|
|
21
|
-
|
|
26
|
+
}
|
|
27
|
+
if (!Array.isArray(data)) {
|
|
22
28
|
return undefined;
|
|
23
|
-
|
|
29
|
+
}
|
|
30
|
+
const content = data.flatMap((item) => isRecord(item) && typeof item.content === "string" ? [item.content] : []);
|
|
24
31
|
return content.length > 0 ? content.join("\n\n") : undefined;
|
|
25
32
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
class SkillShellWords {
|
|
34
|
+
words = [];
|
|
35
|
+
current = "";
|
|
36
|
+
quote;
|
|
37
|
+
index = 0;
|
|
38
|
+
input;
|
|
39
|
+
constructor(input) {
|
|
40
|
+
this.input = input;
|
|
41
|
+
}
|
|
42
|
+
flush() {
|
|
43
|
+
if (this.current.length > 0) {
|
|
44
|
+
this.words.push(this.current);
|
|
45
|
+
this.current = "";
|
|
38
46
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
current += input[index];
|
|
45
|
-
}
|
|
46
|
-
else
|
|
47
|
-
current += char;
|
|
48
|
-
continue;
|
|
47
|
+
}
|
|
48
|
+
appendEscape() {
|
|
49
|
+
if (this.index + 1 < this.input.length) {
|
|
50
|
+
this.index += 1;
|
|
51
|
+
this.current += this.input[this.index];
|
|
49
52
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
continue;
|
|
53
|
+
else {
|
|
54
|
+
this.current += "\\";
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
}
|
|
57
|
+
consumeQuoted(char) {
|
|
58
|
+
const closing = this.quote === "single" ? "'" : '"';
|
|
59
|
+
if (char === closing) {
|
|
60
|
+
this.quote = undefined;
|
|
57
61
|
}
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
else if (this.quote === "double" && char === "\\") {
|
|
63
|
+
this.appendEscape();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.current += char;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
consumeUnquoted(char) {
|
|
70
|
+
if (char === "'" || char === '"') {
|
|
71
|
+
this.quote = char === "'" ? "single" : "double";
|
|
72
|
+
}
|
|
73
|
+
else if (char === "\\") {
|
|
74
|
+
this.appendEscape();
|
|
62
75
|
}
|
|
63
|
-
if (char === "#" && current.length === 0) {
|
|
64
|
-
|
|
76
|
+
else if (char === "#" && this.current.length === 0) {
|
|
77
|
+
return false;
|
|
65
78
|
}
|
|
66
|
-
if (/\s/.test(char)) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
else if (/\s/.test(char)) {
|
|
80
|
+
this.flush();
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.current += char;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
parse() {
|
|
88
|
+
for (; this.index < this.input.length; this.index += 1) {
|
|
89
|
+
const char = this.input[this.index];
|
|
90
|
+
if (this.quote !== undefined) {
|
|
91
|
+
this.consumeQuoted(char);
|
|
70
92
|
}
|
|
71
|
-
|
|
93
|
+
else if (!this.consumeUnquoted(char)) {
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (this.quote !== undefined) {
|
|
98
|
+
return undefined;
|
|
72
99
|
}
|
|
73
|
-
|
|
100
|
+
this.flush();
|
|
101
|
+
return this.words;
|
|
74
102
|
}
|
|
75
|
-
if (quote)
|
|
76
|
-
return undefined;
|
|
77
|
-
if (current.length > 0)
|
|
78
|
-
words.push(current);
|
|
79
|
-
return words;
|
|
80
103
|
}
|
|
81
104
|
function formatNativeAgentBrowserCall(args, stdin) {
|
|
82
105
|
return stdin === undefined
|
|
83
106
|
? `agent_browser { "args": ${JSON.stringify(args)} }`
|
|
84
107
|
: `agent_browser { "args": ${JSON.stringify(args)}, "stdin": ${JSON.stringify(stdin)} }`;
|
|
85
108
|
}
|
|
109
|
+
function readSkillHeredoc(lines, startIndex, delimiter, stripsLeadingTabs) {
|
|
110
|
+
const stdinLines = [];
|
|
111
|
+
for (let cursor = startIndex; cursor < lines.length; cursor += 1) {
|
|
112
|
+
const candidate = stripsLeadingTabs ? lines[cursor].replace(/^\t+/, "") : lines[cursor];
|
|
113
|
+
if (candidate === delimiter) {
|
|
114
|
+
return { stdin: stdinLines.join("\n"), endIndex: cursor };
|
|
115
|
+
}
|
|
116
|
+
stdinLines.push(candidate);
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
86
120
|
function formatNativeSkillContent(content) {
|
|
87
|
-
const lines = content
|
|
121
|
+
const lines = content
|
|
122
|
+
.replace(/^allowed-tools:.*agent-browser.*\n?/gim, "")
|
|
123
|
+
.replace(/^```bash\s*$/gim, "```text")
|
|
124
|
+
.split("\n");
|
|
88
125
|
const output = [];
|
|
89
126
|
for (let index = 0; index < lines.length; index += 1) {
|
|
90
127
|
const line = lines[index];
|
|
@@ -97,7 +134,7 @@ function formatNativeSkillContent(content) {
|
|
|
97
134
|
const rawArgsText = commandMatch[2];
|
|
98
135
|
const heredocMatch = /^(.*?)\s+(<<-?)['"]?([A-Za-z_][A-Za-z0-9_]*)['"]?\s*$/.exec(rawArgsText);
|
|
99
136
|
const argsText = heredocMatch?.[1] ?? rawArgsText;
|
|
100
|
-
const args =
|
|
137
|
+
const args = new SkillShellWords(argsText).parse();
|
|
101
138
|
if (!args || args.length === 0) {
|
|
102
139
|
output.push(line);
|
|
103
140
|
continue;
|
|
@@ -106,42 +143,36 @@ function formatNativeSkillContent(content) {
|
|
|
106
143
|
output.push(`${indent}${formatNativeAgentBrowserCall(args)}`);
|
|
107
144
|
continue;
|
|
108
145
|
}
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
const stdinLines = [];
|
|
112
|
-
let cursor = index + 1;
|
|
113
|
-
while (cursor < lines.length) {
|
|
114
|
-
const candidate = stripsLeadingTabs ? lines[cursor].replace(/^\t+/, "") : lines[cursor];
|
|
115
|
-
if (candidate === delimiter)
|
|
116
|
-
break;
|
|
117
|
-
stdinLines.push(candidate);
|
|
118
|
-
cursor += 1;
|
|
119
|
-
}
|
|
120
|
-
if (cursor >= lines.length) {
|
|
146
|
+
const heredoc = readSkillHeredoc(lines, index + 1, heredocMatch[3], heredocMatch[2] === "<<-");
|
|
147
|
+
if (!heredoc) {
|
|
121
148
|
output.push(line);
|
|
122
149
|
continue;
|
|
123
150
|
}
|
|
124
|
-
output.push(`${indent}${formatNativeAgentBrowserCall(args,
|
|
125
|
-
index =
|
|
151
|
+
output.push(`${indent}${formatNativeAgentBrowserCall(args, heredoc.stdin)}`);
|
|
152
|
+
index = heredoc.endIndex;
|
|
126
153
|
}
|
|
127
154
|
return output.join("\n");
|
|
128
155
|
}
|
|
129
156
|
export function formatSkillsText(commandInfo, data) {
|
|
130
|
-
if (commandInfo.command !== "skills")
|
|
157
|
+
if (commandInfo.command !== "skills") {
|
|
131
158
|
return undefined;
|
|
132
|
-
|
|
159
|
+
}
|
|
160
|
+
if (commandInfo.subcommand === "path") {
|
|
133
161
|
return typeof data === "string" ? redactModelFacingText(data) : undefined;
|
|
134
|
-
|
|
162
|
+
}
|
|
163
|
+
if (commandInfo.subcommand === "list" && Array.isArray(data)) {
|
|
135
164
|
return formatSkillsListText(data);
|
|
165
|
+
}
|
|
136
166
|
const content = getSkillContent(data);
|
|
137
|
-
if (content) {
|
|
167
|
+
if (content !== undefined && content.length > 0) {
|
|
138
168
|
const note = [
|
|
139
169
|
"Pi native-tool note: upstream skill text was adapted for this native tool.",
|
|
140
170
|
"Use args for CLI tokens and stdin only for batch, eval --stdin, or auth save --password-stdin; do not pipe heredocs through bash unless the user explicitly asks for a bash workflow.",
|
|
141
171
|
].join("\n");
|
|
142
172
|
return `${note}\n\n${redactModelFacingText(formatNativeSkillContent(content))}`;
|
|
143
173
|
}
|
|
144
|
-
if (typeof data === "string")
|
|
174
|
+
if (typeof data === "string") {
|
|
145
175
|
return redactModelFacingText(formatNativeSkillContent(data));
|
|
176
|
+
}
|
|
146
177
|
return undefined;
|
|
147
178
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { extractUpstreamCommandTokens, parseCommandInfo, } from "../../argv-descriptor.js";
|
|
2
|
+
import { isRecord } from "../../parsing.js";
|
|
3
|
+
import { nextReadConfirmation } from "../../read-confirmation.js";
|
|
4
|
+
import { redactInvocationArgs } from "../../runtime-redaction.js";
|
|
5
|
+
import { detectConfirmationRequired } from "../confirmation.js";
|
|
6
|
+
import { buildSnapshotPresentation } from "../snapshot.js";
|
|
7
|
+
import { formatArtifactMetadataLines, formatArtifactSummary } from "./artifacts.js";
|
|
8
|
+
import { buildBatchPresentation, isAgentBrowserBatchResultArray, redactBatchStepErrorData, } from "./batch.js";
|
|
9
|
+
import { isStringArray } from "./content.js";
|
|
10
|
+
import { enrichStreamStatusData, redactPresentationData } from "./diagnostics.js";
|
|
11
|
+
import { formatPresentationContentText, formatPresentationSummary } from "./registry.js";
|
|
12
|
+
import { resolvePresentationCommandInfo } from "./semantic-action.js";
|
|
13
|
+
export function resolvePresentationCommands(options) {
|
|
14
|
+
const commandInfo = options.commandInfo.commandTokens || !options.args
|
|
15
|
+
? options.commandInfo
|
|
16
|
+
: { ...options.commandInfo, commandTokens: extractUpstreamCommandTokens(options.args) };
|
|
17
|
+
return {
|
|
18
|
+
commandInfo,
|
|
19
|
+
presentationCommandInfo: resolvePresentationCommandInfo(commandInfo, options.compiledSemanticAction),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function redactBatchSpillData(data) {
|
|
23
|
+
return data.map((row) => {
|
|
24
|
+
const command = isStringArray(row.command) ? row.command : undefined;
|
|
25
|
+
return {
|
|
26
|
+
...row,
|
|
27
|
+
command: command ? redactInvocationArgs(command) : row.command,
|
|
28
|
+
error: row.error === undefined ? undefined : redactBatchStepErrorData(command, row.error),
|
|
29
|
+
result: row.result === undefined
|
|
30
|
+
? undefined
|
|
31
|
+
: redactPresentationData(parseCommandInfo(command ?? []), row.result),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function buildPresentationSource(options, commands) {
|
|
36
|
+
const { commandInfo } = commands;
|
|
37
|
+
const data = enrichPresentationSource(options, commandInfo);
|
|
38
|
+
return {
|
|
39
|
+
...commands,
|
|
40
|
+
data,
|
|
41
|
+
presentationData: commandInfo.command === "batch" && isAgentBrowserBatchResultArray(data)
|
|
42
|
+
? redactBatchSpillData(data)
|
|
43
|
+
: redactPresentationData(commandInfo, data),
|
|
44
|
+
recordingCommand: commandInfo.command === "record",
|
|
45
|
+
recordingBatch: isRecordingBatch(commandInfo, data),
|
|
46
|
+
confirmationRequired: detectConfirmationRequired(data),
|
|
47
|
+
readConfirmation: nextReadConfirmation({
|
|
48
|
+
commandTokens: commandInfo.commandTokens ?? [],
|
|
49
|
+
data,
|
|
50
|
+
namespace: options.namespace,
|
|
51
|
+
sessionName: options.sessionName ?? "default",
|
|
52
|
+
succeeded: options.envelope?.success !== false,
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function enrichPresentationSource(options, commandInfo) {
|
|
57
|
+
const data = enrichStreamStatusData(commandInfo, options.envelope?.data);
|
|
58
|
+
return commandInfo.command === "session" && commandInfo.subcommand === "info" && isRecord(data)
|
|
59
|
+
? { ...data, piCleanupOwnership: options.piCleanupOwnership ?? "unknown" }
|
|
60
|
+
: data;
|
|
61
|
+
}
|
|
62
|
+
function isRecordingBatch(command, data) {
|
|
63
|
+
return (command.command === "batch" &&
|
|
64
|
+
isAgentBrowserBatchResultArray(data) &&
|
|
65
|
+
data.some((row) => row.command?.[0] === "record"));
|
|
66
|
+
}
|
|
67
|
+
function buildNativeContent(options, source, artifacts) {
|
|
68
|
+
if (options.modelVisible === false) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const text = artifacts.length > 0
|
|
72
|
+
? formatArtifactMetadataLines(artifacts).join("\n")
|
|
73
|
+
: formatPresentationContentText(source.commandInfo, source.data, options.compiledSemanticAction);
|
|
74
|
+
return [{ type: "text", text }];
|
|
75
|
+
}
|
|
76
|
+
export async function buildSourcePresentation(options, source, artifacts, buildNestedToolPresentation) {
|
|
77
|
+
const summary = formatArtifactSummary(artifacts) ??
|
|
78
|
+
formatPresentationSummary(source.commandInfo, source.data, options.compiledSemanticAction);
|
|
79
|
+
if (source.commandInfo.command === "batch" && isAgentBrowserBatchResultArray(source.data)) {
|
|
80
|
+
return buildBatchPresentation({
|
|
81
|
+
artifactManifest: options.artifactManifest,
|
|
82
|
+
artifactMaxUpdatedAtMs: options.artifactMaxUpdatedAtMs,
|
|
83
|
+
artifactMinUpdatedAtMs: options.artifactMinUpdatedAtMs,
|
|
84
|
+
artifactRequests: options.batchArtifactRequests,
|
|
85
|
+
buildNestedToolPresentation,
|
|
86
|
+
modelVisible: options.modelVisible,
|
|
87
|
+
cwd: options.cwd,
|
|
88
|
+
data: source.data,
|
|
89
|
+
namespace: options.namespace,
|
|
90
|
+
networkRoutes: options.networkRoutes,
|
|
91
|
+
persistentArtifactStore: options.persistentArtifactStore,
|
|
92
|
+
piCleanupOwnership: options.piCleanupOwnership,
|
|
93
|
+
sessionName: options.sessionName,
|
|
94
|
+
summary,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (options.modelVisible !== false &&
|
|
98
|
+
source.commandInfo.command === "snapshot" &&
|
|
99
|
+
isRecord(source.data) &&
|
|
100
|
+
!source.confirmationRequired) {
|
|
101
|
+
return buildSnapshotPresentation(source.data, options.persistentArtifactStore, options.artifactManifest);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
artifacts: artifacts.length > 0 ? artifacts : undefined,
|
|
105
|
+
content: buildNativeContent(options, source, artifacts),
|
|
106
|
+
data: source.presentationData,
|
|
107
|
+
summary,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -1,250 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isRecord } from "../parsing.js";
|
|
3
|
-
import { buildReadConfirmationNextActions, nextReadConfirmation } from "../read-confirmation.js";
|
|
4
|
-
import { extractUpstreamCommandTokens, parseCommandInfo, redactInvocationArgs } from "../runtime.js";
|
|
5
|
-
import { buildAgentBrowserNextActions } from "./action-recommendations.js";
|
|
6
|
-
import { buildAgentBrowserResultCategoryDetails } from "./categories.js";
|
|
7
|
-
import { detectConfirmationRequired } from "./confirmation.js";
|
|
8
|
-
import { buildSnapshotPresentation } from "./snapshot.js";
|
|
9
|
-
import { formatWebMcpCatalogUpdate, redactModelFacingText } from "./presentation/common.js";
|
|
10
|
-
import { applyArtifactManifest, attachInlineImage, buildArtifactVerificationSummary, buildManifestEntriesForFileArtifacts, classifyPresentationSuccessCategory, extractFileArtifacts, extractImagePath, formatArtifactMetadataLines, formatArtifactSummary, formatMissingArtifactFailureText, getSavedFileDetails, hasMissingFileArtifact, isManifestFileArtifact, } from "./presentation/artifacts.js";
|
|
11
|
-
import { buildBatchPresentation, isAgentBrowserBatchResultArray, redactBatchStepErrorData } from "./presentation/batch.js";
|
|
12
|
-
import { getPresentationPaths, isStringArray } from "./presentation/content.js";
|
|
13
|
-
import { buildNetworkRequestsNextActions, buildStreamNextActions, enrichStreamStatusData, formatNetworkRouteDiagnosticsText, redactPresentationData, } from "./presentation/diagnostics.js";
|
|
14
|
-
import { buildErrorPresentation, isOverlayBlockedClickError } from "./presentation/errors.js";
|
|
15
|
-
import { compactLargePresentationOutput } from "./presentation/large-output.js";
|
|
16
|
-
import { buildPageChangeSummary } from "./presentation/navigation.js";
|
|
17
|
-
import { formatPresentationContentText, formatPresentationSummary } from "./presentation/registry.js";
|
|
18
|
-
import { resolvePresentationCommandInfo } from "./presentation/semantic-action.js";
|
|
19
|
-
function sanitizeModelFacingPresentation(presentation) {
|
|
20
|
-
presentation.content = presentation.content.map((item) => {
|
|
21
|
-
if (item.type !== "text")
|
|
22
|
-
return item;
|
|
23
|
-
return { ...item, text: redactModelFacingText(item.text) };
|
|
24
|
-
});
|
|
25
|
-
presentation.summary = redactModelFacingText(presentation.summary);
|
|
26
|
-
return presentation;
|
|
27
|
-
}
|
|
28
|
-
function mergeNextActions(...groups) {
|
|
29
|
-
const merged = groups.flatMap((group) => group ?? []);
|
|
30
|
-
return merged.length > 0 ? merged : undefined;
|
|
31
|
-
}
|
|
32
|
-
function shouldAddAnnotatedScreenshotGuidance(commandInfo, args) {
|
|
33
|
-
return commandInfo.command === "screenshot" && (args?.includes("--annotate") ?? false);
|
|
34
|
-
}
|
|
35
|
-
function getKeyboardInsertTextWarning(commandInfo) {
|
|
36
|
-
if (commandInfo.command !== "keyboard" || commandInfo.subcommand !== "inserttext")
|
|
37
|
-
return undefined;
|
|
38
|
-
return "Input dispatch warning: keyboard inserttext skips key events. A DOM value change does not prove a framework-controlled editor accepted it; verify application state before saving, or use keyboard type when real key events are required.";
|
|
39
|
-
}
|
|
40
|
-
function redactBatchSpillData(data) {
|
|
41
|
-
return data.map((row) => {
|
|
42
|
-
const command = isStringArray(row.command) ? row.command : undefined;
|
|
43
|
-
const commandInfo = parseCommandInfo(command ?? []);
|
|
44
|
-
return {
|
|
45
|
-
...row,
|
|
46
|
-
command: command ? redactInvocationArgs(command) : row.command,
|
|
47
|
-
error: row.error === undefined ? undefined : redactBatchStepErrorData(command, row.error),
|
|
48
|
-
result: row.result === undefined ? undefined : redactPresentationData(commandInfo, row.result),
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
}
|
|
1
|
+
import { completePresentationOutput, extractPresentationArtifacts, } from "./presentation/output-completion.js";
|
|
52
2
|
export async function buildToolPresentation(options) {
|
|
53
|
-
const {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const presentationData = commandInfo.command === "batch" && isAgentBrowserBatchResultArray(data)
|
|
70
|
-
? redactBatchSpillData(data)
|
|
71
|
-
: redactPresentationData(commandInfoWithTokens, data);
|
|
72
|
-
const artifacts = await extractFileArtifacts({ artifactManifest, artifactMaxUpdatedAtMs: options.artifactMaxUpdatedAtMs, artifactMinUpdatedAtMs: options.artifactMinUpdatedAtMs, artifactRequest, commandInfo: presentationCommandInfo, cwd, data, namespace, recordingOutcome: recordingCommand ? envelope?.success : undefined, recordingPending: options.recordingPending, previousRecordingContactSheetPath: options.previousRecordingContactSheetPath, sessionName });
|
|
73
|
-
const artifactVerification = buildArtifactVerificationSummary(artifacts);
|
|
74
|
-
const artifactSummary = formatArtifactSummary(artifacts);
|
|
75
|
-
const summary = artifactSummary ?? formatPresentationSummary(commandInfoWithTokens, data, compiledSemanticAction);
|
|
76
|
-
const artifactText = artifacts.length > 0 ? formatArtifactMetadataLines(artifacts).join("\n") : undefined;
|
|
77
|
-
let presentation;
|
|
78
|
-
if (commandInfo.command === "batch" && isAgentBrowserBatchResultArray(data)) {
|
|
79
|
-
presentation = await buildBatchPresentation({
|
|
80
|
-
artifactManifest,
|
|
81
|
-
artifactMaxUpdatedAtMs: options.artifactMaxUpdatedAtMs,
|
|
82
|
-
artifactMinUpdatedAtMs: options.artifactMinUpdatedAtMs,
|
|
83
|
-
artifactRequests: options.batchArtifactRequests,
|
|
84
|
-
buildNestedToolPresentation: buildToolPresentation,
|
|
85
|
-
modelVisible: options.modelVisible,
|
|
86
|
-
cwd,
|
|
87
|
-
data,
|
|
88
|
-
namespace,
|
|
89
|
-
networkRoutes,
|
|
90
|
-
persistentArtifactStore,
|
|
91
|
-
piCleanupOwnership: options.piCleanupOwnership,
|
|
92
|
-
sessionName,
|
|
93
|
-
summary,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
else if (options.modelVisible !== false && commandInfo.command === "snapshot" && isRecord(data)) {
|
|
97
|
-
presentation = await buildSnapshotPresentation(data, persistentArtifactStore, artifactManifest);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
presentation = {
|
|
101
|
-
artifactVerification,
|
|
102
|
-
artifacts: artifacts.length > 0 ? artifacts : undefined,
|
|
103
|
-
content: options.modelVisible === false ? [] : [{ type: "text", text: artifactText ?? formatPresentationContentText(commandInfoWithTokens, data, compiledSemanticAction) }],
|
|
104
|
-
data: presentationData,
|
|
105
|
-
summary,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
if (errorText && (recordingCommand || recordingBatch)) {
|
|
109
|
-
const errorPresentation = buildErrorPresentation({ args, commandInfo, errorText, presentationCommand: presentationCommandInfo.command, sessionName });
|
|
110
|
-
presentation = { ...presentation, resultCategory: "failure", failureCategory: errorPresentation.failureCategory, summary: errorPresentation.summary,
|
|
111
|
-
content: [{ type: "text", text: `${errorPresentation.content[0]?.type === "text" ? errorPresentation.content[0].text : errorText}\n\n${presentation.content[0]?.type === "text" ? presentation.content[0].text : ""}` }],
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
if (networkRouteDiagnostics && networkRouteDiagnostics.length > 0 && presentation.content[0]?.type === "text") {
|
|
115
|
-
const diagnosticText = formatNetworkRouteDiagnosticsText(networkRouteDiagnostics);
|
|
116
|
-
if (diagnosticText)
|
|
117
|
-
presentation.content[0] = { ...presentation.content[0], text: `${diagnosticText}\n\n${presentation.content[0].text}` };
|
|
118
|
-
presentation.networkRouteDiagnostics = networkRouteDiagnostics;
|
|
119
|
-
}
|
|
120
|
-
if (artifacts.length > 0 && !presentation.artifacts) {
|
|
121
|
-
presentation.artifacts = artifacts;
|
|
122
|
-
}
|
|
123
|
-
presentation.artifactVerification = presentation.artifactVerification ?? artifactVerification;
|
|
124
|
-
if (isRecord(data)) {
|
|
125
|
-
const savedFile = getSavedFileDetails(commandInfo, data);
|
|
126
|
-
if (savedFile) {
|
|
127
|
-
presentation.savedFile = savedFile;
|
|
128
|
-
presentation.savedFilePath = savedFile.path;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (isRecord(presentationData) && isRecord(presentationData.webmcp) && (Array.isArray(presentationData.webmcp.tools) || presentationData.webmcp.status === "unavailable") && presentation.content[0]?.type === "text") {
|
|
132
|
-
presentation.content[0] = { ...presentation.content[0], text: `${presentation.content[0].text}\n\n${formatWebMcpCatalogUpdate(presentationData.webmcp)}` };
|
|
133
|
-
}
|
|
134
|
-
if (shouldAddAnnotatedScreenshotGuidance(commandInfo, args) && presentation.content[0]?.type === "text") {
|
|
135
|
-
const guidance = "Annotated screenshot note: dense pages can produce overlapping labels. If the labels are noisy, capture a scoped element screenshot, take a non-annotated screenshot, or use snapshot -i high-value refs as the machine-readable map.";
|
|
136
|
-
presentation.content[0] = { ...presentation.content[0], text: `${presentation.content[0].text}\n\n${guidance}` };
|
|
137
|
-
}
|
|
138
|
-
const keyboardInsertTextWarning = getKeyboardInsertTextWarning(commandInfoWithTokens);
|
|
139
|
-
if (keyboardInsertTextWarning && presentation.content[0]?.type === "text") {
|
|
140
|
-
presentation.content[0] = { ...presentation.content[0], text: `${presentation.content[0].text}\n\n${keyboardInsertTextWarning}` };
|
|
141
|
-
}
|
|
142
|
-
const imagePath = artifactRequest?.absolutePath ?? extractImagePath(commandInfo, cwd, data)
|
|
143
|
-
?? (recordingCommand ? artifacts.find((artifact) => artifact.kind === "image" && artifact.status === "saved")?.absolutePath : undefined);
|
|
144
|
-
const attachImage = imagePath && !(isRecord(data) && data.changed === false) && !artifacts.some(artifact => artifact.absolutePath === imagePath && ["missing", "stale", "failed"].includes(artifact.status ?? ""));
|
|
145
|
-
const presentationWithImage = attachImage ? await attachInlineImage(presentation, imagePath, options.modelVisible) : presentation;
|
|
146
|
-
if (commandInfo.command === "screenshot" && presentationWithImage.imageObservations) {
|
|
147
|
-
for (const image of presentationWithImage.imageObservations)
|
|
148
|
-
image.capture = getScreenshotCapture(commandInfoWithTokens.commandTokens ?? []).kind;
|
|
149
|
-
}
|
|
150
|
-
const compactedPresentation = options.modelVisible === false ? presentationWithImage : await compactLargePresentationOutput({
|
|
151
|
-
artifactManifest,
|
|
152
|
-
commandInfo,
|
|
153
|
-
data: presentationData,
|
|
154
|
-
persistentArtifactStore,
|
|
155
|
-
presentation: presentationWithImage,
|
|
156
|
-
});
|
|
157
|
-
const presentationWithManifest = applyArtifactManifest(compactedPresentation, compactedPresentation.artifactManifest ?? artifactManifest, buildManifestEntriesForFileArtifacts(artifacts.filter(isManifestFileArtifact)));
|
|
158
|
-
const currentSpillPaths = new Set(getPresentationPaths({
|
|
159
|
-
primaryPath: presentationWithManifest.fullOutputPath,
|
|
160
|
-
secondaryPaths: presentationWithManifest.fullOutputPaths,
|
|
161
|
-
}));
|
|
162
|
-
presentationWithManifest.artifactVerification = buildArtifactVerificationSummary(artifacts, presentationWithManifest.artifactManifest, currentSpillPaths) ?? presentationWithManifest.artifactVerification;
|
|
163
|
-
const confirmationRequired = detectConfirmationRequired(data);
|
|
164
|
-
const missingArtifactFailureText = formatMissingArtifactFailureText(presentationWithManifest.artifacts);
|
|
165
|
-
if (!errorText && missingArtifactFailureText && hasMissingFileArtifact(presentationWithManifest.artifacts)) {
|
|
166
|
-
presentationWithManifest.resultCategory = "failure";
|
|
167
|
-
presentationWithManifest.failureCategory = "artifact-missing";
|
|
168
|
-
presentationWithManifest.successCategory = undefined;
|
|
169
|
-
presentationWithManifest.summary = missingArtifactFailureText;
|
|
170
|
-
if (presentationWithManifest.content[0]?.type === "text") {
|
|
171
|
-
presentationWithManifest.content[0] = { ...presentationWithManifest.content[0], text: `${missingArtifactFailureText}\n\n${presentationWithManifest.content[0].text}` };
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
presentationWithManifest.content.unshift({ type: "text", text: missingArtifactFailureText });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
const failedRecording = presentationWithManifest.artifacts?.find((artifact) => artifact.recording?.success === false || artifact.recording?.output.encoderSucceeded === false);
|
|
178
|
-
if (failedRecording && !errorText) {
|
|
179
|
-
const failure = `Recording failed: ${failedRecording.recording?.error ?? "native capture/encoder failure"}`;
|
|
180
|
-
presentationWithManifest.resultCategory = "failure";
|
|
181
|
-
presentationWithManifest.failureCategory = "upstream-error";
|
|
182
|
-
presentationWithManifest.successCategory = undefined;
|
|
183
|
-
presentationWithManifest.summary = failure;
|
|
184
|
-
presentationWithManifest.content.unshift({ type: "text", text: failure });
|
|
185
|
-
}
|
|
186
|
-
if (readConfirmation?.state === "pending") {
|
|
187
|
-
presentationWithManifest.readConfirmation = readConfirmation;
|
|
188
|
-
presentationWithManifest.resultCategory = "failure";
|
|
189
|
-
presentationWithManifest.failureCategory = "confirmation-required";
|
|
190
|
-
presentationWithManifest.successCategory = undefined;
|
|
191
|
-
}
|
|
192
|
-
if (!presentationWithManifest.resultCategory) {
|
|
193
|
-
const categoryDetails = buildAgentBrowserResultCategoryDetails({
|
|
194
|
-
artifacts: presentationWithManifest.artifacts,
|
|
195
|
-
command: presentationCommandInfo.command,
|
|
196
|
-
confirmationRequired: confirmationRequired !== undefined,
|
|
197
|
-
errorText: envelope?.success === false ? presentationWithManifest.summary : undefined,
|
|
198
|
-
savedFile: presentationWithManifest.savedFile,
|
|
199
|
-
succeeded: envelope?.success !== false && confirmationRequired === undefined,
|
|
200
|
-
});
|
|
201
|
-
presentationWithManifest.resultCategory = categoryDetails.resultCategory;
|
|
202
|
-
presentationWithManifest.successCategory = categoryDetails.resultCategory === "success"
|
|
203
|
-
? classifyPresentationSuccessCategory({
|
|
204
|
-
artifactVerification: presentationWithManifest.artifactVerification,
|
|
205
|
-
artifacts: presentationWithManifest.artifacts,
|
|
206
|
-
savedFile: presentationWithManifest.savedFile,
|
|
207
|
-
})
|
|
208
|
-
: categoryDetails.successCategory;
|
|
209
|
-
presentationWithManifest.failureCategory = categoryDetails.failureCategory;
|
|
210
|
-
}
|
|
211
|
-
if (presentationWithManifest.resultCategory === "success") {
|
|
212
|
-
presentationWithManifest.successCategory = classifyPresentationSuccessCategory({
|
|
213
|
-
artifactVerification: presentationWithManifest.artifactVerification,
|
|
214
|
-
artifacts: presentationWithManifest.artifacts,
|
|
215
|
-
savedFile: presentationWithManifest.savedFile,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const genericNextActions = presentationWithManifest.nextActions ? undefined : buildAgentBrowserNextActions({
|
|
219
|
-
artifacts: presentationWithManifest.artifacts,
|
|
220
|
-
args,
|
|
221
|
-
command: presentationCommandInfo.command,
|
|
222
|
-
confirmationId: confirmationRequired?.id,
|
|
223
|
-
failureCategory: presentationWithManifest.failureCategory,
|
|
224
|
-
overlayBlockedClick: isOverlayBlockedClickError(presentationCommandInfo.command, envelope?.success === false ? presentationWithManifest.summary : undefined, args ?? presentationCommandInfo.commandTokens),
|
|
225
|
-
resultCategory: presentationWithManifest.resultCategory ?? "success",
|
|
226
|
-
savedFilePath: presentationWithManifest.savedFilePath,
|
|
227
|
-
sessionName,
|
|
228
|
-
subcommand: presentationCommandInfo.subcommand,
|
|
229
|
-
successCategory: presentationWithManifest.successCategory,
|
|
230
|
-
});
|
|
231
|
-
const networkNextActions = commandInfoWithTokens.command === "network" && commandInfoWithTokens.subcommand === "requests" && presentationWithManifest.resultCategory === "success"
|
|
232
|
-
? buildNetworkRequestsNextActions(data, sessionName, presentationWithManifest.networkRouteDiagnostics)
|
|
233
|
-
: undefined;
|
|
234
|
-
const streamNextActions = presentationWithManifest.resultCategory === "success" ? buildStreamNextActions(commandInfoWithTokens, data, sessionName) : undefined;
|
|
235
|
-
presentationWithManifest.nextActions = readConfirmation ? buildReadConfirmationNextActions(readConfirmation, true) : mergeNextActions(presentationWithManifest.nextActions, genericNextActions, networkNextActions, streamNextActions);
|
|
236
|
-
presentationWithManifest.pageChangeSummary = presentationWithManifest.pageChangeSummary ?? buildPageChangeSummary({
|
|
237
|
-
artifacts: presentationWithManifest.artifacts,
|
|
238
|
-
commandInfo: presentationCommandInfo,
|
|
239
|
-
data,
|
|
240
|
-
nextActions: presentationWithManifest.nextActions,
|
|
241
|
-
savedFilePath: presentationWithManifest.savedFilePath,
|
|
242
|
-
summary: presentationWithManifest.summary,
|
|
243
|
-
});
|
|
244
|
-
if (presentationWithManifest.pageChangeSummary?.observed === false && presentationCommandInfo.command !== "batch" && presentationWithManifest.content[0]?.type === "text") {
|
|
245
|
-
presentationWithManifest.content[0] = { ...presentationWithManifest.content[0], text: `${presentationWithManifest.content[0].text}\n\nAction dispatched; application change unverified. Verify the expected URL, text, state, or external receipt before relying on it.` };
|
|
246
|
-
}
|
|
247
|
-
if (options.modelVisible === false)
|
|
248
|
-
presentationWithManifest.content = [];
|
|
249
|
-
return sanitizeModelFacingPresentation(presentationWithManifest);
|
|
3
|
+
const { buildPresentationSource, buildSourcePresentation, resolvePresentationCommands } = await import("./presentation/source.js");
|
|
4
|
+
const { buildEarlyPresentation, sanitizeModelFacingPresentation } = await import("./presentation/early-result.js");
|
|
5
|
+
const { applyPresentationNotices } = await import("./presentation/notices.js");
|
|
6
|
+
const { applyPresentationOutcome } = await import("./presentation/outcomes.js");
|
|
7
|
+
const commands = resolvePresentationCommands(options);
|
|
8
|
+
const early = await buildEarlyPresentation(options, commands);
|
|
9
|
+
if (early) {
|
|
10
|
+
return early;
|
|
11
|
+
}
|
|
12
|
+
const source = buildPresentationSource(options, commands);
|
|
13
|
+
const artifacts = await extractPresentationArtifacts(options, source);
|
|
14
|
+
const draft = await buildSourcePresentation(options, source, artifacts, buildToolPresentation);
|
|
15
|
+
applyPresentationNotices(draft, options, source);
|
|
16
|
+
const completed = await completePresentationOutput(draft, options, source, artifacts);
|
|
17
|
+
applyPresentationOutcome(completed, options, source);
|
|
18
|
+
return sanitizeModelFacingPresentation(completed);
|
|
250
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|