pi-agent-browser-native 0.2.48 → 0.2.49
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 +17 -0
- package/README.md +16 -6
- package/dist/extensions/agent-browser/index.js +785 -0
- package/dist/extensions/agent-browser/lib/argv-descriptor.js +71 -0
- package/dist/extensions/agent-browser/lib/argv-grammar.js +121 -0
- package/dist/extensions/agent-browser/lib/bash-guard.js +190 -0
- package/dist/extensions/agent-browser/lib/command-policy.js +85 -0
- package/dist/extensions/agent-browser/lib/command-taxonomy.js +302 -0
- package/dist/extensions/agent-browser/lib/config-policy.js +686 -0
- package/dist/extensions/agent-browser/lib/config.js +122 -0
- package/dist/extensions/agent-browser/lib/electron/cdp.js +51 -0
- package/dist/extensions/agent-browser/lib/electron/cleanup.js +212 -0
- package/dist/extensions/agent-browser/lib/electron/discovery.js +633 -0
- package/dist/extensions/agent-browser/lib/electron/launch.js +351 -0
- package/{extensions/agent-browser/lib/electron/text.ts → dist/extensions/agent-browser/lib/electron/text.js} +5 -5
- package/dist/extensions/agent-browser/lib/executable-path.js +20 -0
- package/dist/extensions/agent-browser/lib/fs-utils.js +18 -0
- package/dist/extensions/agent-browser/lib/input-modes/electron.js +165 -0
- package/dist/extensions/agent-browser/lib/input-modes/job.js +519 -0
- package/dist/extensions/agent-browser/lib/input-modes/lookups.js +440 -0
- package/dist/extensions/agent-browser/lib/input-modes/params.js +164 -0
- package/dist/extensions/agent-browser/lib/input-modes/semantic-action.js +119 -0
- package/dist/extensions/agent-browser/lib/input-modes/shared.js +42 -0
- package/dist/extensions/agent-browser/lib/input-modes/types.js +21 -0
- package/dist/extensions/agent-browser/lib/input-modes.js +10 -0
- package/dist/extensions/agent-browser/lib/json-schema.js +58 -0
- package/dist/extensions/agent-browser/lib/launch-scoped-flags.js +59 -0
- package/dist/extensions/agent-browser/lib/navigation-policy.js +83 -0
- package/dist/extensions/agent-browser/lib/orchestration/batch-stdin.js +62 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/artifact-paths.js +39 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/click-dispatch.js +276 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.js +909 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result.js +443 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/index.js +47 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/direct-anchor-download.js +141 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/network-page-filter.js +108 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/scroll-shims.js +112 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter.js +158 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare/wait-timeouts.js +54 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare.js +762 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output.js +491 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prompt-guards.js +40 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-artifacts.js +5 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state.js +731 -0
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/types.js +1 -0
- package/dist/extensions/agent-browser/lib/orchestration/electron-host/index.js +718 -0
- package/dist/extensions/agent-browser/lib/orchestration/input-plan.js +247 -0
- package/dist/extensions/agent-browser/lib/orchestration/output-file.js +68 -0
- package/{extensions/agent-browser/lib/parsing.ts → dist/extensions/agent-browser/lib/parsing.js} +12 -11
- package/dist/extensions/agent-browser/lib/pi-tool-rendering.js +241 -0
- package/dist/extensions/agent-browser/lib/playbook.js +121 -0
- package/dist/extensions/agent-browser/lib/process.js +448 -0
- package/dist/extensions/agent-browser/lib/prompt-policy.js +91 -0
- package/dist/extensions/agent-browser/lib/results/action-recommendations.js +220 -0
- package/dist/extensions/agent-browser/lib/results/artifact-manifest.js +111 -0
- package/{extensions/agent-browser/lib/results/artifact-state.ts → dist/extensions/agent-browser/lib/results/artifact-state.js} +4 -8
- package/dist/extensions/agent-browser/lib/results/categories.js +76 -0
- package/dist/extensions/agent-browser/lib/results/confirmation.js +63 -0
- package/dist/extensions/agent-browser/lib/results/contracts.js +8 -0
- package/dist/extensions/agent-browser/lib/results/editable-ref-evidence.js +74 -0
- package/dist/extensions/agent-browser/lib/results/envelope.js +166 -0
- package/dist/extensions/agent-browser/lib/results/network-routes.js +92 -0
- package/dist/extensions/agent-browser/lib/results/network.js +73 -0
- package/dist/extensions/agent-browser/lib/results/next-actions.js +72 -0
- package/dist/extensions/agent-browser/lib/results/presentation/artifacts.js +515 -0
- package/dist/extensions/agent-browser/lib/results/presentation/batch.js +397 -0
- package/dist/extensions/agent-browser/lib/results/presentation/browser-profile-recovery.js +55 -0
- package/dist/extensions/agent-browser/lib/results/presentation/common.js +46 -0
- package/dist/extensions/agent-browser/lib/results/presentation/content.js +24 -0
- package/dist/extensions/agent-browser/lib/results/presentation/diagnostics.js +960 -0
- package/dist/extensions/agent-browser/lib/results/presentation/errors.js +205 -0
- package/dist/extensions/agent-browser/lib/results/presentation/large-output.js +134 -0
- package/dist/extensions/agent-browser/lib/results/presentation/navigation.js +159 -0
- package/dist/extensions/agent-browser/lib/results/presentation/registry.js +216 -0
- package/dist/extensions/agent-browser/lib/results/presentation/semantic-action.js +104 -0
- package/dist/extensions/agent-browser/lib/results/presentation/skills.js +152 -0
- package/dist/extensions/agent-browser/lib/results/presentation.js +177 -0
- package/dist/extensions/agent-browser/lib/results/recovery-actions.js +107 -0
- package/dist/extensions/agent-browser/lib/results/recovery-next-actions.js +50 -0
- package/dist/extensions/agent-browser/lib/results/selector-recovery.js +225 -0
- package/{extensions/agent-browser/lib/results/shared.ts → dist/extensions/agent-browser/lib/results/shared.js} +0 -1
- package/dist/extensions/agent-browser/lib/results/snapshot-high-value-controls.js +208 -0
- package/dist/extensions/agent-browser/lib/results/snapshot-refs.js +78 -0
- package/dist/extensions/agent-browser/lib/results/snapshot-segments.js +331 -0
- package/dist/extensions/agent-browser/lib/results/snapshot-spill.js +40 -0
- package/dist/extensions/agent-browser/lib/results/snapshot.js +264 -0
- package/dist/extensions/agent-browser/lib/results/text.js +40 -0
- package/{extensions/agent-browser/lib/results.ts → dist/extensions/agent-browser/lib/results.js} +2 -32
- package/dist/extensions/agent-browser/lib/runtime.js +816 -0
- package/dist/extensions/agent-browser/lib/session-page-state.js +411 -0
- package/dist/extensions/agent-browser/lib/string-enum-schema.js +13 -0
- package/dist/extensions/agent-browser/lib/temp.js +498 -0
- package/dist/extensions/agent-browser/lib/web-search.js +562 -0
- package/docs/RELEASE.md +22 -11
- package/docs/SUPPORT_MATRIX.md +4 -3
- package/package.json +9 -5
- package/scripts/config.mjs +8 -2
- package/scripts/doctor.mjs +8 -7
- package/extensions/agent-browser/index.ts +0 -961
- package/extensions/agent-browser/lib/argv-descriptor.ts +0 -90
- package/extensions/agent-browser/lib/argv-grammar.ts +0 -128
- package/extensions/agent-browser/lib/bash-guard.ts +0 -205
- package/extensions/agent-browser/lib/command-policy.ts +0 -71
- package/extensions/agent-browser/lib/command-taxonomy.ts +0 -336
- package/extensions/agent-browser/lib/config-policy.js +0 -690
- package/extensions/agent-browser/lib/config.ts +0 -211
- package/extensions/agent-browser/lib/electron/cdp.ts +0 -69
- package/extensions/agent-browser/lib/electron/cleanup.ts +0 -235
- package/extensions/agent-browser/lib/electron/discovery.ts +0 -710
- package/extensions/agent-browser/lib/electron/launch.ts +0 -499
- package/extensions/agent-browser/lib/executable-path.ts +0 -19
- package/extensions/agent-browser/lib/fs-utils.ts +0 -18
- package/extensions/agent-browser/lib/input-modes/electron.ts +0 -170
- package/extensions/agent-browser/lib/input-modes/job.ts +0 -527
- package/extensions/agent-browser/lib/input-modes/lookups.ts +0 -447
- package/extensions/agent-browser/lib/input-modes/params.ts +0 -205
- package/extensions/agent-browser/lib/input-modes/semantic-action.ts +0 -127
- package/extensions/agent-browser/lib/input-modes/shared.ts +0 -46
- package/extensions/agent-browser/lib/input-modes/types.ts +0 -225
- package/extensions/agent-browser/lib/input-modes.ts +0 -45
- package/extensions/agent-browser/lib/json-schema.ts +0 -73
- package/extensions/agent-browser/lib/launch-scoped-flags.ts +0 -67
- package/extensions/agent-browser/lib/navigation-policy.ts +0 -95
- package/extensions/agent-browser/lib/orchestration/batch-stdin.ts +0 -65
- package/extensions/agent-browser/lib/orchestration/browser-run/artifact-paths.ts +0 -44
- package/extensions/agent-browser/lib/orchestration/browser-run/click-dispatch.ts +0 -280
- package/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.ts +0 -914
- package/extensions/agent-browser/lib/orchestration/browser-run/final-result.ts +0 -521
- package/extensions/agent-browser/lib/orchestration/browser-run/index.ts +0 -53
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare/direct-anchor-download.ts +0 -158
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare/network-page-filter.ts +0 -116
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare/scroll-shims.ts +0 -147
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare/snapshot-filter.ts +0 -183
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare/wait-timeouts.ts +0 -58
- package/extensions/agent-browser/lib/orchestration/browser-run/prepare.ts +0 -847
- package/extensions/agent-browser/lib/orchestration/browser-run/process-output.ts +0 -559
- package/extensions/agent-browser/lib/orchestration/browser-run/prompt-guards.ts +0 -47
- package/extensions/agent-browser/lib/orchestration/browser-run/session-artifacts.ts +0 -8
- package/extensions/agent-browser/lib/orchestration/browser-run/session-state.ts +0 -868
- package/extensions/agent-browser/lib/orchestration/browser-run/types.ts +0 -565
- package/extensions/agent-browser/lib/orchestration/electron-host/index.ts +0 -855
- package/extensions/agent-browser/lib/orchestration/input-plan.ts +0 -375
- package/extensions/agent-browser/lib/orchestration/output-file.ts +0 -86
- package/extensions/agent-browser/lib/pi-tool-rendering.ts +0 -267
- package/extensions/agent-browser/lib/playbook.ts +0 -142
- package/extensions/agent-browser/lib/process.ts +0 -516
- package/extensions/agent-browser/lib/prompt-policy.ts +0 -105
- package/extensions/agent-browser/lib/results/action-recommendations.ts +0 -264
- package/extensions/agent-browser/lib/results/artifact-manifest.ts +0 -111
- package/extensions/agent-browser/lib/results/categories.ts +0 -106
- package/extensions/agent-browser/lib/results/confirmation.ts +0 -76
- package/extensions/agent-browser/lib/results/contracts.ts +0 -241
- package/extensions/agent-browser/lib/results/editable-ref-evidence.ts +0 -72
- package/extensions/agent-browser/lib/results/envelope.ts +0 -195
- package/extensions/agent-browser/lib/results/network-routes.ts +0 -83
- package/extensions/agent-browser/lib/results/network.ts +0 -78
- package/extensions/agent-browser/lib/results/next-actions.ts +0 -117
- package/extensions/agent-browser/lib/results/presentation/artifacts.ts +0 -588
- package/extensions/agent-browser/lib/results/presentation/batch.ts +0 -450
- package/extensions/agent-browser/lib/results/presentation/browser-profile-recovery.ts +0 -67
- package/extensions/agent-browser/lib/results/presentation/common.ts +0 -53
- package/extensions/agent-browser/lib/results/presentation/content.ts +0 -36
- package/extensions/agent-browser/lib/results/presentation/diagnostics.ts +0 -923
- package/extensions/agent-browser/lib/results/presentation/errors.ts +0 -227
- package/extensions/agent-browser/lib/results/presentation/large-output.ts +0 -182
- package/extensions/agent-browser/lib/results/presentation/navigation.ts +0 -184
- package/extensions/agent-browser/lib/results/presentation/registry.ts +0 -242
- package/extensions/agent-browser/lib/results/presentation/semantic-action.ts +0 -131
- package/extensions/agent-browser/lib/results/presentation/skills.ts +0 -143
- package/extensions/agent-browser/lib/results/presentation.ts +0 -257
- package/extensions/agent-browser/lib/results/recovery-actions.ts +0 -139
- package/extensions/agent-browser/lib/results/recovery-next-actions.ts +0 -71
- package/extensions/agent-browser/lib/results/selector-recovery.ts +0 -320
- package/extensions/agent-browser/lib/results/snapshot-high-value-controls.ts +0 -273
- package/extensions/agent-browser/lib/results/snapshot-refs.ts +0 -100
- package/extensions/agent-browser/lib/results/snapshot-segments.ts +0 -366
- package/extensions/agent-browser/lib/results/snapshot-spill.ts +0 -63
- package/extensions/agent-browser/lib/results/snapshot.ts +0 -329
- package/extensions/agent-browser/lib/results/text.ts +0 -40
- package/extensions/agent-browser/lib/runtime.ts +0 -988
- package/extensions/agent-browser/lib/session-page-state.ts +0 -512
- package/extensions/agent-browser/lib/string-enum-schema.ts +0 -20
- package/extensions/agent-browser/lib/temp.ts +0 -577
- package/extensions/agent-browser/lib/web-search.ts +0 -728
- /package/{extensions/agent-browser/lib/orchestration/browser-run.ts → dist/extensions/agent-browser/lib/orchestration/browser-run.js} +0 -0
|
@@ -1,847 +0,0 @@
|
|
|
1
|
-
import { copyFile, mkdir } from "node:fs/promises";
|
|
2
|
-
import { dirname, resolve } from "node:path";
|
|
3
|
-
|
|
4
|
-
import { launchElectronApp, type ElectronLaunchSuccess } from "../../electron/launch.js";
|
|
5
|
-
import { pathExists } from "../../fs-utils.js";
|
|
6
|
-
import { getCompiledSemanticActionSessionPrefix, type CompiledAgentBrowserSemanticAction } from "../../input-modes.js";
|
|
7
|
-
import { tryDirectAnchorDownload } from "./prepare/direct-anchor-download.js";
|
|
8
|
-
import { tryNetworkRequestsPageFilter } from "./prepare/network-page-filter.js";
|
|
9
|
-
import { tryContainerScroll, tryPageScrollTo } from "./prepare/scroll-shims.js";
|
|
10
|
-
import { trySnapshotFilter } from "./prepare/snapshot-filter.js";
|
|
11
|
-
import { getWaitAwareProcessTimeoutMs } from "./prepare/wait-timeouts.js";
|
|
12
|
-
import { getPersistentSessionArtifactStore } from "./session-artifacts.js";
|
|
13
|
-
import { buildAgentBrowserResultCategoryDetails } from "../../results.js";
|
|
14
|
-
import { buildSessionAwareStaleRefNextActions, buildSessionTabRecoveryNextActions } from "../../results/recovery-next-actions.js";
|
|
15
|
-
import { resolveVisibleRefActionFromSnapshot } from "../../results/selector-recovery.js";
|
|
16
|
-
import { extractRefSnapshotFromData, type SessionRefSnapshot, type SessionTabTarget } from "../../session-page-state.js";
|
|
17
|
-
import {
|
|
18
|
-
buildExecutionPlan,
|
|
19
|
-
createFreshSessionName,
|
|
20
|
-
extractCommandTokens,
|
|
21
|
-
redactInvocationArgs,
|
|
22
|
-
redactSensitiveText,
|
|
23
|
-
type CompatibilityWorkaround,
|
|
24
|
-
} from "../../runtime.js";
|
|
25
|
-
import {
|
|
26
|
-
applyOpenResultTabCorrection,
|
|
27
|
-
buildManagedSessionOutcome,
|
|
28
|
-
buildPinnedBatchPlan,
|
|
29
|
-
buildSessionDetailFields,
|
|
30
|
-
buildStaleRefPreflight,
|
|
31
|
-
collectSessionTabSelection,
|
|
32
|
-
getGuardedRefUsage,
|
|
33
|
-
getTraceOwnerGuardMessage,
|
|
34
|
-
runSessionCommandData,
|
|
35
|
-
shouldPinSessionTabForCommand,
|
|
36
|
-
} from "./session-state.js";
|
|
37
|
-
import { parseBatchStdinJsonArray, parseValidBatchStepEntries } from "../batch-stdin.js";
|
|
38
|
-
import { buildElectronHostFailureResult, getElectronLaunchFailureCategory, redactRecoveryHint } from "./final-result.js";
|
|
39
|
-
import { prepareClickDispatchProbe } from "./click-dispatch.js";
|
|
40
|
-
import { collectScrollPositionSnapshot, validateQaAttachedPrecondition } from "./diagnostics.js";
|
|
41
|
-
import { getScreenshotPathTokenIndex } from "./artifact-paths.js";
|
|
42
|
-
import { findRequestedArtifactCloseViolation } from "./prompt-guards.js";
|
|
43
|
-
|
|
44
|
-
import type {
|
|
45
|
-
AgentBrowserToolResult,
|
|
46
|
-
BrowserRunInputFields,
|
|
47
|
-
BrowserRunOptions,
|
|
48
|
-
BrowserRunStatePatch,
|
|
49
|
-
PreparedAgentBrowserArgs,
|
|
50
|
-
PreparedBrowserRun,
|
|
51
|
-
PrepareBrowserRunResult,
|
|
52
|
-
ScreenshotArtifactRequest,
|
|
53
|
-
ScreenshotPathRequest,
|
|
54
|
-
SemanticActionVisibleRefResolution,
|
|
55
|
-
StaleRefPreflight,
|
|
56
|
-
} from "./types.js";
|
|
57
|
-
|
|
58
|
-
export function normalizeRunInput(input: BrowserRunOptions["input"]): BrowserRunInputFields {
|
|
59
|
-
const base = { redactedArgs: input.redactedArgs, toolArgs: input.toolArgs, toolStdin: input.toolStdin };
|
|
60
|
-
switch (input.kind) {
|
|
61
|
-
case "electron":
|
|
62
|
-
return { ...base, compiledElectron: input.compiledElectron, redactedCompiledElectron: input.redactedCompiledElectron };
|
|
63
|
-
case "job":
|
|
64
|
-
return { ...base, compiledJob: input.compiledJob, redactedCompiledJob: input.redactedCompiledJob };
|
|
65
|
-
case "networkSourceLookup":
|
|
66
|
-
return { ...base, compiledNetworkSourceLookup: input.compiledNetworkSourceLookup, redactedCompiledNetworkSourceLookup: input.redactedCompiledNetworkSourceLookup };
|
|
67
|
-
case "qa":
|
|
68
|
-
return { ...base, compiledJob: input.compiledJob, compiledQaPreset: input.compiledQaPreset, redactedCompiledJob: input.redactedCompiledJob, redactedCompiledQaPreset: input.redactedCompiledQaPreset };
|
|
69
|
-
case "semanticAction":
|
|
70
|
-
return { ...base, compiledSemanticAction: input.compiledSemanticAction, redactedCompiledSemanticAction: input.redactedCompiledSemanticAction };
|
|
71
|
-
case "sourceLookup":
|
|
72
|
-
return { ...base, compiledSourceLookup: input.compiledSourceLookup, redactedCompiledSourceLookup: input.redactedCompiledSourceLookup };
|
|
73
|
-
case "args":
|
|
74
|
-
return base;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function buildInvocationPreview(effectiveArgs: string[]): string {
|
|
79
|
-
const preview = effectiveArgs.join(" ");
|
|
80
|
-
return preview.length > 120 ? `${preview.slice(0, 117)}...` : preview;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function getArtifactParentPathTokenIndex(commandTokens: string[]): number | undefined {
|
|
84
|
-
if (commandTokens[0] === "download" && commandTokens.length >= 3) return 2;
|
|
85
|
-
if (commandTokens[0] === "pdf" && commandTokens.length >= 2) return 1;
|
|
86
|
-
if (commandTokens[0] === "state" && commandTokens[1] === "save" && commandTokens.length >= 3) return 2;
|
|
87
|
-
if (commandTokens[0] === "wait") {
|
|
88
|
-
const downloadIndex = commandTokens.findIndex((token) => token === "--download");
|
|
89
|
-
const pathIndex = downloadIndex >= 0 ? downloadIndex + 1 : -1;
|
|
90
|
-
if (pathIndex > 0 && typeof commandTokens[pathIndex] === "string" && !commandTokens[pathIndex].startsWith("-")) return pathIndex;
|
|
91
|
-
}
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async function ensureArtifactParentDirectory(commandTokens: string[], cwd: string): Promise<void> {
|
|
96
|
-
const pathIndex = getArtifactParentPathTokenIndex(commandTokens);
|
|
97
|
-
if (pathIndex === undefined) return;
|
|
98
|
-
const requestedPath = commandTokens[pathIndex];
|
|
99
|
-
if (!requestedPath) return;
|
|
100
|
-
await mkdir(dirname(resolve(cwd, requestedPath)), { recursive: true });
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async function normalizeScreenshotPathInTokens(commandTokens: string[], cwd: string): Promise<{
|
|
104
|
-
request?: ScreenshotPathRequest;
|
|
105
|
-
tokens: string[];
|
|
106
|
-
}> {
|
|
107
|
-
const screenshotPathTokenIndex = getScreenshotPathTokenIndex(commandTokens);
|
|
108
|
-
if (screenshotPathTokenIndex === undefined) {
|
|
109
|
-
return { tokens: commandTokens };
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const requestedPath = commandTokens[screenshotPathTokenIndex];
|
|
113
|
-
const absolutePath = resolve(cwd, requestedPath);
|
|
114
|
-
await mkdir(dirname(absolutePath), { recursive: true });
|
|
115
|
-
|
|
116
|
-
const tokens = [...commandTokens];
|
|
117
|
-
tokens[screenshotPathTokenIndex] = absolutePath;
|
|
118
|
-
const terminatorIndex = tokens.indexOf("--");
|
|
119
|
-
if (terminatorIndex >= 0) {
|
|
120
|
-
tokens.splice(terminatorIndex, 1);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
request: {
|
|
125
|
-
absolutePath,
|
|
126
|
-
path: requestedPath,
|
|
127
|
-
},
|
|
128
|
-
tokens,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
async function prepareBatchScreenshotPaths(args: string[], stdin: string | undefined, cwd: string): Promise<PreparedAgentBrowserArgs | undefined> {
|
|
133
|
-
const commandTokens = extractCommandTokens(args);
|
|
134
|
-
if (commandTokens[0] !== "batch" || stdin === undefined) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
const parsed = parseBatchStdinJsonArray(stdin);
|
|
138
|
-
if (parsed.error || parsed.steps === undefined) {
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
let changed = false;
|
|
143
|
-
const batchScreenshotPathRequests: Array<ScreenshotPathRequest | undefined> = [];
|
|
144
|
-
const preparedSteps = await Promise.all(parsed.steps.map(async (step, index) => {
|
|
145
|
-
if (!Array.isArray(step) || !step.every((item) => typeof item === "string")) {
|
|
146
|
-
return step;
|
|
147
|
-
}
|
|
148
|
-
await ensureArtifactParentDirectory(step, cwd);
|
|
149
|
-
if (step[0] !== "screenshot") {
|
|
150
|
-
return step;
|
|
151
|
-
}
|
|
152
|
-
const normalized = await normalizeScreenshotPathInTokens(step, cwd);
|
|
153
|
-
batchScreenshotPathRequests[index] = normalized.request;
|
|
154
|
-
if (normalized.request) {
|
|
155
|
-
changed = true;
|
|
156
|
-
}
|
|
157
|
-
return normalized.tokens;
|
|
158
|
-
}));
|
|
159
|
-
|
|
160
|
-
return changed
|
|
161
|
-
? {
|
|
162
|
-
args,
|
|
163
|
-
batchScreenshotPathRequests,
|
|
164
|
-
stdin: JSON.stringify(preparedSteps),
|
|
165
|
-
}
|
|
166
|
-
: undefined;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export async function prepareAgentBrowserArgs(args: string[], stdin: string | undefined, cwd: string): Promise<PreparedAgentBrowserArgs> {
|
|
170
|
-
const preparedBatch = await prepareBatchScreenshotPaths(args, stdin, cwd);
|
|
171
|
-
if (preparedBatch) {
|
|
172
|
-
return preparedBatch;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const commandTokens = extractCommandTokens(args);
|
|
176
|
-
await ensureArtifactParentDirectory(commandTokens, cwd);
|
|
177
|
-
const normalized = await normalizeScreenshotPathInTokens(commandTokens, cwd);
|
|
178
|
-
if (!normalized.request) {
|
|
179
|
-
return { args };
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const commandStartIndex = args.length - commandTokens.length;
|
|
183
|
-
return {
|
|
184
|
-
args: [...args.slice(0, commandStartIndex), ...normalized.tokens],
|
|
185
|
-
screenshotPathRequest: normalized.request,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async function repairScreenshotData(options: {
|
|
190
|
-
cwd: string;
|
|
191
|
-
data: Record<string, unknown>;
|
|
192
|
-
request: ScreenshotPathRequest;
|
|
193
|
-
}): Promise<{ data: Record<string, unknown>; request: ScreenshotArtifactRequest }> {
|
|
194
|
-
const { cwd, data, request } = options;
|
|
195
|
-
const reportedPath = typeof data.path === "string" ? data.path : undefined;
|
|
196
|
-
const reportedAbsolutePath = reportedPath ? resolve(cwd, reportedPath) : undefined;
|
|
197
|
-
let status: ScreenshotArtifactRequest["status"] = await pathExists(request.absolutePath) ? "saved" : "missing";
|
|
198
|
-
let tempPath: string | undefined;
|
|
199
|
-
|
|
200
|
-
if (reportedAbsolutePath && reportedAbsolutePath !== request.absolutePath) {
|
|
201
|
-
tempPath = reportedAbsolutePath;
|
|
202
|
-
if (status === "missing" && await pathExists(reportedAbsolutePath)) {
|
|
203
|
-
await mkdir(dirname(request.absolutePath), { recursive: true });
|
|
204
|
-
await copyFile(reportedAbsolutePath, request.absolutePath);
|
|
205
|
-
status = "repaired-from-temp";
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return {
|
|
210
|
-
data: {
|
|
211
|
-
...data,
|
|
212
|
-
path: request.absolutePath,
|
|
213
|
-
},
|
|
214
|
-
request: {
|
|
215
|
-
...request,
|
|
216
|
-
status,
|
|
217
|
-
tempPath,
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export { repairScreenshotData };
|
|
223
|
-
|
|
224
|
-
const DIALOG_COMMAND_PROCESS_TIMEOUT_MS = 5_000;
|
|
225
|
-
const DIALOG_COMMAND_PROCESS_TIMEOUT_ENV = "PI_AGENT_BROWSER_DIALOG_PROCESS_TIMEOUT_MS";
|
|
226
|
-
const LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS = 8_000;
|
|
227
|
-
const LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_ENV = "PI_AGENT_BROWSER_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS";
|
|
228
|
-
const DIALOG_TRIGGER_TEXT_PATTERN = /\b(?:alert|confirm|dialog|prompt)\b/i;
|
|
229
|
-
|
|
230
|
-
function getPositiveIntegerEnv(name: string): number | undefined {
|
|
231
|
-
const value = process.env[name];
|
|
232
|
-
if (!value || !/^\d+$/.test(value.trim())) return undefined;
|
|
233
|
-
const parsed = Number(value.trim());
|
|
234
|
-
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : undefined;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function getRefIdsFromDirectCommand(commandTokens: string[]): string[] {
|
|
238
|
-
return [...new Set(getGuardedRefUsage(commandTokens))];
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function commandTextLooksLikeDialogTrigger(commandTokens: string[], refSnapshot?: SessionRefSnapshot): boolean {
|
|
242
|
-
if (commandTokens.some((token) => DIALOG_TRIGGER_TEXT_PATTERN.test(token))) return true;
|
|
243
|
-
for (const refId of getRefIdsFromDirectCommand(commandTokens)) {
|
|
244
|
-
const ref = refSnapshot?.refs?.[refId];
|
|
245
|
-
if (ref && DIALOG_TRIGGER_TEXT_PATTERN.test(`${ref.role} ${ref.name}`)) return true;
|
|
246
|
-
}
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function getDialogAwareProcessTimeoutMs(commandTokens: string[], refSnapshot?: SessionRefSnapshot, stdin?: string): number | undefined {
|
|
251
|
-
const command = commandTokens[0];
|
|
252
|
-
if (command === "dialog") return getPositiveIntegerEnv(DIALOG_COMMAND_PROCESS_TIMEOUT_ENV) ?? DIALOG_COMMAND_PROCESS_TIMEOUT_MS;
|
|
253
|
-
if (command === "eval" && typeof stdin === "string" && DIALOG_TRIGGER_TEXT_PATTERN.test(stdin)) return getPositiveIntegerEnv(LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_ENV) ?? LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS;
|
|
254
|
-
if ((command === "click" || command === "tap" || (command === "find" && commandTokens.includes("click"))) && commandTextLooksLikeDialogTrigger(commandTokens, refSnapshot)) return getPositiveIntegerEnv(LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_ENV) ?? LIKELY_DIALOG_TRIGGER_PROCESS_TIMEOUT_MS;
|
|
255
|
-
return undefined;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function describeRef(refSnapshot: SessionRefSnapshot | undefined, refId: string): string {
|
|
259
|
-
const ref = refSnapshot?.refs?.[refId];
|
|
260
|
-
return ref ? `${ref.role} ${JSON.stringify(ref.name)}` : "not present";
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function getSamePageFreshnessPreflightFailure(options: {
|
|
264
|
-
commandTokens: string[];
|
|
265
|
-
currentSnapshot: SessionRefSnapshot;
|
|
266
|
-
previousSnapshot: SessionRefSnapshot;
|
|
267
|
-
}): { message: string; refIds: string[] } | undefined {
|
|
268
|
-
if (options.commandTokens[0] === "batch") return undefined;
|
|
269
|
-
const refIds = getRefIdsFromDirectCommand(options.commandTokens);
|
|
270
|
-
if (refIds.length === 0) return undefined;
|
|
271
|
-
const previousUrl = options.previousSnapshot.target?.url;
|
|
272
|
-
const currentUrl = options.currentSnapshot.target?.url;
|
|
273
|
-
if (!previousUrl || !currentUrl || previousUrl !== currentUrl || currentUrl === "about:blank") return undefined;
|
|
274
|
-
const mismatchedRefs = refIds.filter((refId) => {
|
|
275
|
-
const previous = options.previousSnapshot.refs?.[refId];
|
|
276
|
-
const current = options.currentSnapshot.refs?.[refId];
|
|
277
|
-
if (!options.currentSnapshot.refIds.includes(refId)) return true;
|
|
278
|
-
if (!previous || !current) return previous !== current;
|
|
279
|
-
return previous.role !== current.role || previous.name !== current.name;
|
|
280
|
-
});
|
|
281
|
-
if (mismatchedRefs.length === 0) return undefined;
|
|
282
|
-
const refText = mismatchedRefs.map((refId) => `@${refId}`).join(", ");
|
|
283
|
-
const evidence = mismatchedRefs.map((refId) => `@${refId}: previous ${describeRef(options.previousSnapshot, refId)}, current ${describeRef(options.currentSnapshot, refId)}`).join("; ");
|
|
284
|
-
return {
|
|
285
|
-
message: `Ref ${refText} no longer matches the latest same-page snapshot. The page likely rerendered after the previous snapshot; run snapshot -i and retry with current refs. Evidence: ${evidence}.`,
|
|
286
|
-
refIds: mismatchedRefs,
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
async function collectSamePageRefFreshnessPreflight(options: {
|
|
291
|
-
commandTokens: string[];
|
|
292
|
-
cwd: string;
|
|
293
|
-
currentTarget?: SessionTabTarget;
|
|
294
|
-
previousSnapshot?: SessionRefSnapshot;
|
|
295
|
-
sessionName?: string;
|
|
296
|
-
signal?: AbortSignal;
|
|
297
|
-
}): Promise<StaleRefPreflight | undefined> {
|
|
298
|
-
if (!options.previousSnapshot || !options.sessionName || options.commandTokens[0] === "batch" || getRefIdsFromDirectCommand(options.commandTokens).length === 0) return undefined;
|
|
299
|
-
const previousUrl = options.previousSnapshot.target?.url;
|
|
300
|
-
const currentTargetUrl = options.currentTarget?.url;
|
|
301
|
-
if (currentTargetUrl === "about:blank" || (previousUrl && currentTargetUrl && previousUrl !== currentTargetUrl)) return undefined;
|
|
302
|
-
const snapshotData = await runSessionCommandData({ args: ["snapshot", "-i"], cwd: options.cwd, sessionName: options.sessionName, signal: options.signal });
|
|
303
|
-
const currentSnapshot = extractRefSnapshotFromData(snapshotData);
|
|
304
|
-
if (!currentSnapshot) return undefined;
|
|
305
|
-
const snapshotWithTarget = { ...currentSnapshot, target: currentSnapshot.target ?? options.currentTarget };
|
|
306
|
-
const mismatch = getSamePageFreshnessPreflightFailure({ commandTokens: options.commandTokens, currentSnapshot: snapshotWithTarget, previousSnapshot: options.previousSnapshot });
|
|
307
|
-
if (!mismatch) return undefined;
|
|
308
|
-
return { message: mismatch.message, refIds: mismatch.refIds, snapshot: snapshotWithTarget };
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function isPasswordStdinAuthSave(options: { command?: string; commandTokens: string[] }): boolean {
|
|
312
|
-
return options.command === "auth" && options.commandTokens[1] === "save" && options.commandTokens.includes("--password-stdin");
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export function getExactSensitiveStdinValues(options: { command?: string; commandTokens: string[]; stdin?: string }): string[] {
|
|
316
|
-
if (options.stdin === undefined || !isPasswordStdinAuthSave(options)) {
|
|
317
|
-
return [];
|
|
318
|
-
}
|
|
319
|
-
return [...new Set([options.stdin, options.stdin.trimEnd(), options.stdin.trim()].filter((value) => value.length > 0))];
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export function validateStdinCommandContract(options: { command?: string; commandTokens: string[]; stdin?: string }): string | undefined {
|
|
323
|
-
if (options.stdin === undefined) {
|
|
324
|
-
return undefined;
|
|
325
|
-
}
|
|
326
|
-
if (options.command === "batch") {
|
|
327
|
-
return undefined;
|
|
328
|
-
}
|
|
329
|
-
if (options.command === "eval" && options.commandTokens.includes("--stdin")) {
|
|
330
|
-
return undefined;
|
|
331
|
-
}
|
|
332
|
-
if (isPasswordStdinAuthSave(options)) {
|
|
333
|
-
return undefined;
|
|
334
|
-
}
|
|
335
|
-
const commandLabel = options.command ? `\`${options.command}\`` : "the requested command";
|
|
336
|
-
return `agent_browser stdin is only supported for \`batch\`, \`eval --stdin\`, and \`auth save --password-stdin\`; remove stdin from ${commandLabel} or use one of those command forms.`;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export async function resolveSemanticActionVisibleRefArgs(options: {
|
|
340
|
-
compiled: CompiledAgentBrowserSemanticAction | undefined;
|
|
341
|
-
cwd: string;
|
|
342
|
-
sessionName?: string;
|
|
343
|
-
signal?: AbortSignal;
|
|
344
|
-
}): Promise<SemanticActionVisibleRefResolution | undefined> {
|
|
345
|
-
if (!options.compiled || !options.sessionName || options.compiled.locator !== "role" || !["check", "click", "fill"].includes(options.compiled.action)) return undefined;
|
|
346
|
-
const snapshotData = await runSessionCommandData({ args: ["snapshot", "-i"], cwd: options.cwd, sessionName: options.sessionName, signal: options.signal });
|
|
347
|
-
const resolution = resolveVisibleRefActionFromSnapshot({ allowFill: true, compiledAction: options.compiled, snapshotData });
|
|
348
|
-
if (!resolution) return undefined;
|
|
349
|
-
return { args: [...getCompiledSemanticActionSessionPrefix(options.compiled), ...resolution.args], snapshot: resolution.snapshot };
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
export async function prepareBrowserRun(options: BrowserRunOptions): Promise<PrepareBrowserRunResult> {
|
|
353
|
-
const { cwd, implicitSessionIdleTimeoutMs, onUpdate, params, signal, state } = options;
|
|
354
|
-
const { sessionPageState, traceOwners, managedSessionBaseName, ephemeralSessionSeed } = state;
|
|
355
|
-
let freshSessionOrdinal = state.freshSessionOrdinal;
|
|
356
|
-
const {
|
|
357
|
-
compiledElectron,
|
|
358
|
-
compiledJob,
|
|
359
|
-
compiledNetworkSourceLookup,
|
|
360
|
-
compiledQaPreset,
|
|
361
|
-
compiledSemanticAction,
|
|
362
|
-
compiledSourceLookup,
|
|
363
|
-
redactedArgs,
|
|
364
|
-
redactedCompiledElectron,
|
|
365
|
-
redactedCompiledJob,
|
|
366
|
-
redactedCompiledNetworkSourceLookup,
|
|
367
|
-
redactedCompiledQaPreset,
|
|
368
|
-
redactedCompiledSemanticAction,
|
|
369
|
-
redactedCompiledSourceLookup,
|
|
370
|
-
toolArgs,
|
|
371
|
-
toolStdin,
|
|
372
|
-
} = normalizeRunInput(options.input);
|
|
373
|
-
let runtimeToolArgs = toolArgs;
|
|
374
|
-
let runtimeToolStdin = toolStdin;
|
|
375
|
-
let electronLaunch: ElectronLaunchSuccess | undefined;
|
|
376
|
-
const sessionMode = compiledElectron?.action === "launch" ? "fresh" : params.sessionMode ?? "auto";
|
|
377
|
-
const freshSessionName = createFreshSessionName(managedSessionBaseName, ephemeralSessionSeed, freshSessionOrdinal + 1);
|
|
378
|
-
if (compiledElectron?.action === "launch") {
|
|
379
|
-
const launchResult = await launchElectronApp(compiledElectron);
|
|
380
|
-
if (!launchResult.ok) {
|
|
381
|
-
const managedSessionOutcome = buildManagedSessionOutcome({
|
|
382
|
-
activeAfter: state.managedSessionActive,
|
|
383
|
-
activeBefore: state.managedSessionActive,
|
|
384
|
-
attemptedSessionName: freshSessionName,
|
|
385
|
-
command: "connect",
|
|
386
|
-
currentSessionName: state.managedSessionName,
|
|
387
|
-
previousSessionName: state.managedSessionName,
|
|
388
|
-
sessionMode: "fresh",
|
|
389
|
-
succeeded: false,
|
|
390
|
-
});
|
|
391
|
-
return { kind: "early-result", result: buildElectronHostFailureResult({
|
|
392
|
-
compiledElectron: redactedCompiledElectron ?? compiledElectron,
|
|
393
|
-
errorText: launchResult.failure.error,
|
|
394
|
-
failureCategory: getElectronLaunchFailureCategory(launchResult.failure),
|
|
395
|
-
launchFailure: launchResult.failure,
|
|
396
|
-
managedSessionOutcome,
|
|
397
|
-
status: launchResult.failure.reason,
|
|
398
|
-
}) };
|
|
399
|
-
}
|
|
400
|
-
electronLaunch = launchResult.value;
|
|
401
|
-
runtimeToolArgs = ["connect", electronLaunch.connectArg];
|
|
402
|
-
runtimeToolStdin = undefined;
|
|
403
|
-
}
|
|
404
|
-
const preparedArgs = await prepareAgentBrowserArgs(runtimeToolArgs, runtimeToolStdin, cwd);
|
|
405
|
-
const userRequestedJson = runtimeToolArgs.includes("--json");
|
|
406
|
-
let executionPlan = buildExecutionPlan(preparedArgs.args, {
|
|
407
|
-
freshSessionName,
|
|
408
|
-
managedSessionActive: state.managedSessionActive,
|
|
409
|
-
managedSessionName: state.managedSessionName,
|
|
410
|
-
sessionMode,
|
|
411
|
-
});
|
|
412
|
-
let semanticActionVisibleRefResolution: SemanticActionVisibleRefResolution | undefined;
|
|
413
|
-
if (!executionPlan.validationError && executionPlan.managedSessionName !== freshSessionName) {
|
|
414
|
-
semanticActionVisibleRefResolution = await resolveSemanticActionVisibleRefArgs({
|
|
415
|
-
compiled: compiledSemanticAction,
|
|
416
|
-
cwd,
|
|
417
|
-
sessionName: executionPlan.sessionName,
|
|
418
|
-
signal,
|
|
419
|
-
});
|
|
420
|
-
if (semanticActionVisibleRefResolution) {
|
|
421
|
-
executionPlan = buildExecutionPlan(semanticActionVisibleRefResolution.args, {
|
|
422
|
-
freshSessionName,
|
|
423
|
-
managedSessionActive: state.managedSessionActive,
|
|
424
|
-
managedSessionName: state.managedSessionName,
|
|
425
|
-
sessionMode,
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
const redactedEffectiveArgs = redactInvocationArgs(executionPlan.effectiveArgs);
|
|
430
|
-
const redactedRecoveryHint = redactRecoveryHint(executionPlan.recoveryHint);
|
|
431
|
-
const compatibilityWorkaround: CompatibilityWorkaround | undefined = executionPlan.compatibilityWorkaround;
|
|
432
|
-
const statePatch: BrowserRunStatePatch = executionPlan.managedSessionName === freshSessionName
|
|
433
|
-
? { freshSessionOrdinal: freshSessionOrdinal + 1 }
|
|
434
|
-
: {};
|
|
435
|
-
if (executionPlan.managedSessionName === freshSessionName) {
|
|
436
|
-
freshSessionOrdinal += 1;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
if (executionPlan.validationError) {
|
|
440
|
-
return { kind: "early-result", statePatch, result: {
|
|
441
|
-
content: [{ type: "text", text: executionPlan.validationError }],
|
|
442
|
-
details: {
|
|
443
|
-
args: redactedArgs,
|
|
444
|
-
compiledElectron: redactedCompiledElectron,
|
|
445
|
-
compiledJob: redactedCompiledJob,
|
|
446
|
-
compiledQaPreset: redactedCompiledQaPreset,
|
|
447
|
-
compiledSourceLookup: redactedCompiledSourceLookup,
|
|
448
|
-
compiledNetworkSourceLookup: redactedCompiledNetworkSourceLookup,
|
|
449
|
-
invalidValueFlag: executionPlan.invalidValueFlag,
|
|
450
|
-
sessionMode,
|
|
451
|
-
sessionRecoveryHint: redactedRecoveryHint,
|
|
452
|
-
startupScopedFlags: executionPlan.startupScopedFlags,
|
|
453
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedArgs, command: executionPlan.commandInfo.command, errorText: executionPlan.validationError, succeeded: false, validationError: executionPlan.validationError }),
|
|
454
|
-
validationError: executionPlan.validationError,
|
|
455
|
-
},
|
|
456
|
-
isError: true,
|
|
457
|
-
} };
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
const commandTokens = semanticActionVisibleRefResolution ? extractCommandTokens(semanticActionVisibleRefResolution.args) : extractCommandTokens(preparedArgs.args);
|
|
461
|
-
const exactSensitiveValues = getExactSensitiveStdinValues({
|
|
462
|
-
command: executionPlan.commandInfo.command,
|
|
463
|
-
commandTokens,
|
|
464
|
-
stdin: runtimeToolStdin,
|
|
465
|
-
});
|
|
466
|
-
const traceOwnerGuardMessage = getTraceOwnerGuardMessage({
|
|
467
|
-
command: executionPlan.commandInfo.command,
|
|
468
|
-
sessionName: executionPlan.sessionName,
|
|
469
|
-
subcommand: executionPlan.commandInfo.subcommand,
|
|
470
|
-
traceOwners,
|
|
471
|
-
});
|
|
472
|
-
if (traceOwnerGuardMessage) {
|
|
473
|
-
return { kind: "early-result", statePatch, result: {
|
|
474
|
-
content: [{ type: "text", text: traceOwnerGuardMessage }],
|
|
475
|
-
details: {
|
|
476
|
-
args: redactedArgs,
|
|
477
|
-
command: executionPlan.commandInfo.command,
|
|
478
|
-
compatibilityWorkaround,
|
|
479
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
480
|
-
sessionMode,
|
|
481
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: traceOwnerGuardMessage, succeeded: false, validationError: traceOwnerGuardMessage }),
|
|
482
|
-
validationError: traceOwnerGuardMessage,
|
|
483
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
484
|
-
},
|
|
485
|
-
isError: true,
|
|
486
|
-
} };
|
|
487
|
-
}
|
|
488
|
-
const stdinValidationError = validateStdinCommandContract({
|
|
489
|
-
command: executionPlan.commandInfo.command,
|
|
490
|
-
commandTokens,
|
|
491
|
-
stdin: runtimeToolStdin,
|
|
492
|
-
});
|
|
493
|
-
if (stdinValidationError) {
|
|
494
|
-
return { kind: "early-result", statePatch, result: {
|
|
495
|
-
content: [{ type: "text", text: stdinValidationError }],
|
|
496
|
-
details: {
|
|
497
|
-
args: redactedArgs,
|
|
498
|
-
command: executionPlan.commandInfo.command,
|
|
499
|
-
compatibilityWorkaround,
|
|
500
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
501
|
-
sessionMode,
|
|
502
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: stdinValidationError, succeeded: false, validationError: stdinValidationError }),
|
|
503
|
-
validationError: stdinValidationError,
|
|
504
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
505
|
-
},
|
|
506
|
-
isError: true,
|
|
507
|
-
} };
|
|
508
|
-
}
|
|
509
|
-
const priorSessionPageState = sessionPageState.get(executionPlan.sessionName);
|
|
510
|
-
const priorSessionTabTarget = priorSessionPageState.tabTarget;
|
|
511
|
-
const sessionTabPinningReason = priorSessionPageState.pinningReason;
|
|
512
|
-
const priorRefSnapshotState = priorSessionPageState.refSnapshot;
|
|
513
|
-
const priorRefSnapshotInvalidation = priorSessionPageState.refSnapshotInvalidation;
|
|
514
|
-
const resolvedSemanticActionRefSnapshot: SessionRefSnapshot | undefined = semanticActionVisibleRefResolution?.snapshot
|
|
515
|
-
? { ...semanticActionVisibleRefResolution.snapshot, target: semanticActionVisibleRefResolution.snapshot.target ?? priorSessionTabTarget }
|
|
516
|
-
: undefined;
|
|
517
|
-
const promptRefSnapshot = resolvedSemanticActionRefSnapshot ?? priorRefSnapshotState;
|
|
518
|
-
const requestedArtifactCloseViolation = await findRequestedArtifactCloseViolation({ artifactManifest: state.artifactManifest, command: executionPlan.commandInfo.command, cwd, promptPolicy: options.promptPolicy });
|
|
519
|
-
if (requestedArtifactCloseViolation) {
|
|
520
|
-
return { kind: "early-result", statePatch, result: {
|
|
521
|
-
content: [{ type: "text", text: requestedArtifactCloseViolation.message }],
|
|
522
|
-
details: {
|
|
523
|
-
args: redactedArgs,
|
|
524
|
-
command: executionPlan.commandInfo.command,
|
|
525
|
-
compatibilityWorkaround,
|
|
526
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
527
|
-
promptGuard: requestedArtifactCloseViolation,
|
|
528
|
-
sessionMode,
|
|
529
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: requestedArtifactCloseViolation.message, failureCategory: "policy-blocked", succeeded: false, validationError: requestedArtifactCloseViolation.message }),
|
|
530
|
-
validationError: requestedArtifactCloseViolation.message,
|
|
531
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
532
|
-
},
|
|
533
|
-
isError: true,
|
|
534
|
-
} };
|
|
535
|
-
}
|
|
536
|
-
const staleRefPreflight = buildStaleRefPreflight({
|
|
537
|
-
commandTokens,
|
|
538
|
-
currentTarget: priorSessionTabTarget,
|
|
539
|
-
refSnapshot: resolvedSemanticActionRefSnapshot ?? priorRefSnapshotState,
|
|
540
|
-
refSnapshotInvalidation: resolvedSemanticActionRefSnapshot ? undefined : priorRefSnapshotInvalidation,
|
|
541
|
-
stdin: runtimeToolStdin,
|
|
542
|
-
});
|
|
543
|
-
if (staleRefPreflight) {
|
|
544
|
-
return { kind: "early-result", statePatch, result: {
|
|
545
|
-
content: [{ type: "text", text: staleRefPreflight.message }],
|
|
546
|
-
details: {
|
|
547
|
-
args: redactedArgs,
|
|
548
|
-
command: executionPlan.commandInfo.command,
|
|
549
|
-
compatibilityWorkaround,
|
|
550
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
551
|
-
nextActions: buildSessionAwareStaleRefNextActions(executionPlan.sessionName),
|
|
552
|
-
refIds: staleRefPreflight.refIds,
|
|
553
|
-
refSnapshot: staleRefPreflight.snapshot,
|
|
554
|
-
refSnapshotInvalidation: staleRefPreflight.snapshotInvalidation,
|
|
555
|
-
sessionMode,
|
|
556
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: staleRefPreflight.message, failureCategory: "stale-ref", succeeded: false }),
|
|
557
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
558
|
-
},
|
|
559
|
-
isError: true,
|
|
560
|
-
} };
|
|
561
|
-
}
|
|
562
|
-
const samePageRefFreshnessPreflight = await collectSamePageRefFreshnessPreflight({
|
|
563
|
-
commandTokens,
|
|
564
|
-
cwd,
|
|
565
|
-
currentTarget: priorSessionTabTarget,
|
|
566
|
-
previousSnapshot: resolvedSemanticActionRefSnapshot ? undefined : priorRefSnapshotState,
|
|
567
|
-
sessionName: executionPlan.sessionName,
|
|
568
|
-
signal,
|
|
569
|
-
});
|
|
570
|
-
if (samePageRefFreshnessPreflight) {
|
|
571
|
-
if (samePageRefFreshnessPreflight.snapshot && executionPlan.sessionName) {
|
|
572
|
-
sessionPageState.applyRefSnapshot({ fallbackTarget: priorSessionTabTarget, sessionName: executionPlan.sessionName, snapshot: samePageRefFreshnessPreflight.snapshot, update: options.sessionPageStateUpdate });
|
|
573
|
-
}
|
|
574
|
-
return { kind: "early-result", statePatch, result: {
|
|
575
|
-
content: [{ type: "text", text: samePageRefFreshnessPreflight.message }],
|
|
576
|
-
details: {
|
|
577
|
-
args: redactedArgs,
|
|
578
|
-
command: executionPlan.commandInfo.command,
|
|
579
|
-
compatibilityWorkaround,
|
|
580
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
581
|
-
nextActions: buildSessionAwareStaleRefNextActions(executionPlan.sessionName),
|
|
582
|
-
refIds: samePageRefFreshnessPreflight.refIds,
|
|
583
|
-
refSnapshot: samePageRefFreshnessPreflight.snapshot,
|
|
584
|
-
sessionMode,
|
|
585
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: samePageRefFreshnessPreflight.message, failureCategory: "stale-ref", succeeded: false }),
|
|
586
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
587
|
-
},
|
|
588
|
-
isError: true,
|
|
589
|
-
} };
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
if (compiledQaPreset?.checks.attached) {
|
|
593
|
-
const qaAttachedPrecondition = await validateQaAttachedPrecondition({
|
|
594
|
-
cwd,
|
|
595
|
-
sessionName: executionPlan.sessionName,
|
|
596
|
-
signal,
|
|
597
|
-
});
|
|
598
|
-
if (qaAttachedPrecondition) {
|
|
599
|
-
return { kind: "early-result", statePatch, result: {
|
|
600
|
-
content: [{ type: "text", text: qaAttachedPrecondition.error }],
|
|
601
|
-
details: {
|
|
602
|
-
args: redactedArgs,
|
|
603
|
-
compiledQaPreset: redactedCompiledQaPreset,
|
|
604
|
-
compatibilityWorkaround,
|
|
605
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
606
|
-
nextActions: qaAttachedPrecondition.nextActions,
|
|
607
|
-
sessionMode,
|
|
608
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: qaAttachedPrecondition.error, succeeded: false, validationError: qaAttachedPrecondition.error }),
|
|
609
|
-
validationError: qaAttachedPrecondition.error,
|
|
610
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
611
|
-
},
|
|
612
|
-
isError: true,
|
|
613
|
-
} };
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
const persistentArtifactStore = getPersistentSessionArtifactStore(options.ctx);
|
|
618
|
-
const snapshotFilter = await trySnapshotFilter({
|
|
619
|
-
artifactManifest: state.artifactManifest,
|
|
620
|
-
commandTokens,
|
|
621
|
-
compatibilityWorkaround,
|
|
622
|
-
cwd,
|
|
623
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
624
|
-
persistentArtifactStore,
|
|
625
|
-
previousRefSnapshot: priorRefSnapshotState,
|
|
626
|
-
redactedArgs,
|
|
627
|
-
sessionMode,
|
|
628
|
-
sessionName: executionPlan.sessionName,
|
|
629
|
-
sessionPageState,
|
|
630
|
-
sessionPageStateUpdate: options.sessionPageStateUpdate,
|
|
631
|
-
signal,
|
|
632
|
-
usedImplicitSession: executionPlan.usedImplicitSession,
|
|
633
|
-
});
|
|
634
|
-
if (snapshotFilter) return { kind: "early-result", statePatch: { ...statePatch, artifactManifest: snapshotFilter.artifactManifest ?? statePatch.artifactManifest }, result: snapshotFilter.result };
|
|
635
|
-
|
|
636
|
-
const networkRequestsPageFilter = await tryNetworkRequestsPageFilter({
|
|
637
|
-
commandTokens,
|
|
638
|
-
compatibilityWorkaround,
|
|
639
|
-
cwd,
|
|
640
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
641
|
-
redactedArgs,
|
|
642
|
-
sessionMode,
|
|
643
|
-
sessionName: executionPlan.sessionName,
|
|
644
|
-
signal,
|
|
645
|
-
usedImplicitSession: executionPlan.usedImplicitSession,
|
|
646
|
-
});
|
|
647
|
-
if (networkRequestsPageFilter) return { kind: "early-result", statePatch, result: networkRequestsPageFilter };
|
|
648
|
-
|
|
649
|
-
const containerScroll = await tryContainerScroll({
|
|
650
|
-
commandTokens,
|
|
651
|
-
compatibilityWorkaround,
|
|
652
|
-
cwd,
|
|
653
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
654
|
-
redactedArgs,
|
|
655
|
-
sessionMode,
|
|
656
|
-
sessionName: executionPlan.sessionName,
|
|
657
|
-
signal,
|
|
658
|
-
usedImplicitSession: executionPlan.usedImplicitSession,
|
|
659
|
-
});
|
|
660
|
-
if (containerScroll) return { kind: "early-result", statePatch, result: containerScroll };
|
|
661
|
-
const pageScrollTo = await tryPageScrollTo({
|
|
662
|
-
commandTokens,
|
|
663
|
-
compatibilityWorkaround,
|
|
664
|
-
cwd,
|
|
665
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
666
|
-
redactedArgs,
|
|
667
|
-
sessionMode,
|
|
668
|
-
sessionName: executionPlan.sessionName,
|
|
669
|
-
signal,
|
|
670
|
-
usedImplicitSession: executionPlan.usedImplicitSession,
|
|
671
|
-
});
|
|
672
|
-
if (pageScrollTo) return { kind: "early-result", statePatch, result: pageScrollTo };
|
|
673
|
-
|
|
674
|
-
const directAnchorDownload = await tryDirectAnchorDownload({
|
|
675
|
-
artifactManifest: state.artifactManifest,
|
|
676
|
-
commandTokens,
|
|
677
|
-
compatibilityWorkaround,
|
|
678
|
-
cwd,
|
|
679
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
680
|
-
redactedArgs,
|
|
681
|
-
sessionMode,
|
|
682
|
-
sessionName: executionPlan.sessionName,
|
|
683
|
-
signal,
|
|
684
|
-
usedImplicitSession: executionPlan.usedImplicitSession,
|
|
685
|
-
});
|
|
686
|
-
if (directAnchorDownload) return { kind: "early-result", statePatch: { ...statePatch, artifactManifest: directAnchorDownload.artifactManifest ?? statePatch.artifactManifest }, result: directAnchorDownload.result };
|
|
687
|
-
|
|
688
|
-
let pinnedBatchUnwrapMode: PreparedBrowserRun["pinnedBatchUnwrapMode"];
|
|
689
|
-
let includePinnedNavigationSummary = false;
|
|
690
|
-
let sessionTabCorrection: PreparedBrowserRun["sessionTabCorrection"];
|
|
691
|
-
let processArgs = executionPlan.effectiveArgs;
|
|
692
|
-
let processStdin = preparedArgs.stdin ?? runtimeToolStdin;
|
|
693
|
-
if (
|
|
694
|
-
priorSessionTabTarget &&
|
|
695
|
-
shouldPinSessionTabForCommand({
|
|
696
|
-
command: executionPlan.commandInfo.command,
|
|
697
|
-
commandTokens,
|
|
698
|
-
pinningRequired: sessionTabPinningReason !== undefined,
|
|
699
|
-
sessionName: executionPlan.sessionName,
|
|
700
|
-
stdin: runtimeToolStdin,
|
|
701
|
-
})
|
|
702
|
-
) {
|
|
703
|
-
const plannedSessionTabSelection = await collectSessionTabSelection({
|
|
704
|
-
cwd,
|
|
705
|
-
sessionName: executionPlan.sessionName,
|
|
706
|
-
signal,
|
|
707
|
-
target: priorSessionTabTarget,
|
|
708
|
-
});
|
|
709
|
-
if (plannedSessionTabSelection && executionPlan.sessionName) {
|
|
710
|
-
if (executionPlan.commandInfo.command === "eval" && runtimeToolStdin !== undefined) {
|
|
711
|
-
const appliedSessionTabSelection = await applyOpenResultTabCorrection({
|
|
712
|
-
correction: plannedSessionTabSelection,
|
|
713
|
-
cwd,
|
|
714
|
-
sessionName: executionPlan.sessionName,
|
|
715
|
-
signal,
|
|
716
|
-
});
|
|
717
|
-
if (!appliedSessionTabSelection) {
|
|
718
|
-
const error = "agent-browser could not re-select the intended tab before running the command.";
|
|
719
|
-
return { kind: "early-result", statePatch, result: {
|
|
720
|
-
content: [{ type: "text", text: error }],
|
|
721
|
-
details: {
|
|
722
|
-
args: redactedArgs,
|
|
723
|
-
command: executionPlan.commandInfo.command,
|
|
724
|
-
compatibilityWorkaround,
|
|
725
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
726
|
-
sessionMode,
|
|
727
|
-
sessionTabCorrection: plannedSessionTabSelection,
|
|
728
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: error, failureCategory: "tab-drift", succeeded: false, tabDrift: true, validationError: error }),
|
|
729
|
-
nextActions: buildSessionTabRecoveryNextActions({
|
|
730
|
-
kind: "tab-drift",
|
|
731
|
-
resultCategory: "failure",
|
|
732
|
-
sessionName: executionPlan.sessionName,
|
|
733
|
-
tabCorrection: plannedSessionTabSelection,
|
|
734
|
-
target: priorSessionTabTarget,
|
|
735
|
-
}),
|
|
736
|
-
validationError: error,
|
|
737
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
738
|
-
},
|
|
739
|
-
isError: true,
|
|
740
|
-
} };
|
|
741
|
-
}
|
|
742
|
-
sessionTabCorrection = appliedSessionTabSelection;
|
|
743
|
-
} else {
|
|
744
|
-
const pinnedBatchPlan = buildPinnedBatchPlan({
|
|
745
|
-
command: executionPlan.commandInfo.command,
|
|
746
|
-
commandTokens,
|
|
747
|
-
selectedTab: plannedSessionTabSelection.selectedTab,
|
|
748
|
-
stdin: runtimeToolStdin,
|
|
749
|
-
});
|
|
750
|
-
if (pinnedBatchPlan && "error" in pinnedBatchPlan) {
|
|
751
|
-
return { kind: "early-result", statePatch, result: {
|
|
752
|
-
content: [{ type: "text", text: pinnedBatchPlan.error }],
|
|
753
|
-
details: {
|
|
754
|
-
args: redactedArgs,
|
|
755
|
-
command: executionPlan.commandInfo.command,
|
|
756
|
-
compatibilityWorkaround,
|
|
757
|
-
effectiveArgs: redactedEffectiveArgs,
|
|
758
|
-
sessionMode,
|
|
759
|
-
sessionTabCorrection: plannedSessionTabSelection,
|
|
760
|
-
...buildAgentBrowserResultCategoryDetails({ args: redactedEffectiveArgs, command: executionPlan.commandInfo.command, errorText: pinnedBatchPlan.error, failureCategory: "tab-drift", succeeded: false, tabDrift: true, validationError: pinnedBatchPlan.error }),
|
|
761
|
-
nextActions: buildSessionTabRecoveryNextActions({
|
|
762
|
-
kind: "tab-drift",
|
|
763
|
-
resultCategory: "failure",
|
|
764
|
-
sessionName: executionPlan.sessionName,
|
|
765
|
-
tabCorrection: plannedSessionTabSelection,
|
|
766
|
-
target: priorSessionTabTarget,
|
|
767
|
-
}),
|
|
768
|
-
validationError: pinnedBatchPlan.error,
|
|
769
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
770
|
-
},
|
|
771
|
-
isError: true,
|
|
772
|
-
} };
|
|
773
|
-
}
|
|
774
|
-
if (pinnedBatchPlan) {
|
|
775
|
-
sessionTabCorrection = plannedSessionTabSelection;
|
|
776
|
-
processArgs = ["--json", "--session", executionPlan.sessionName, "batch"];
|
|
777
|
-
processStdin = JSON.stringify(pinnedBatchPlan.steps);
|
|
778
|
-
includePinnedNavigationSummary = pinnedBatchPlan.includeNavigationSummary;
|
|
779
|
-
pinnedBatchUnwrapMode = pinnedBatchPlan.unwrapMode;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
const clickDispatchProbe = pinnedBatchUnwrapMode === undefined && compiledElectron === undefined
|
|
785
|
-
? await prepareClickDispatchProbe({ commandTokens, cwd, refSnapshot: promptRefSnapshot, sessionName: executionPlan.sessionName, signal })
|
|
786
|
-
: undefined;
|
|
787
|
-
const processTimeoutMs = options.params.timeoutMs ?? getDialogAwareProcessTimeoutMs(commandTokens, promptRefSnapshot, processStdin) ?? getWaitAwareProcessTimeoutMs(commandTokens, processStdin);
|
|
788
|
-
const redactedProcessArgs = redactInvocationArgs(processArgs);
|
|
789
|
-
const shouldProbeScrollNoop = executionPlan.commandInfo.command === "scroll" && executionPlan.startupScopedFlags.length === 0;
|
|
790
|
-
const scrollPositionBefore = shouldProbeScrollNoop
|
|
791
|
-
? await collectScrollPositionSnapshot({ cwd, sessionName: executionPlan.sessionName, signal })
|
|
792
|
-
: undefined;
|
|
793
|
-
|
|
794
|
-
onUpdate?.({
|
|
795
|
-
content: [{ type: "text", text: `Running agent-browser ${buildInvocationPreview(redactedProcessArgs)}` }],
|
|
796
|
-
details: {
|
|
797
|
-
compatibilityWorkaround,
|
|
798
|
-
effectiveArgs: redactedProcessArgs,
|
|
799
|
-
sessionMode,
|
|
800
|
-
sessionTabCorrection,
|
|
801
|
-
...buildSessionDetailFields(executionPlan.sessionName, executionPlan.usedImplicitSession),
|
|
802
|
-
},
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
return { kind: "ready", prepared: {
|
|
806
|
-
commandTokens,
|
|
807
|
-
compiledElectron,
|
|
808
|
-
compiledJob,
|
|
809
|
-
compiledNetworkSourceLookup,
|
|
810
|
-
compiledQaPreset,
|
|
811
|
-
compiledSemanticAction,
|
|
812
|
-
compiledSourceLookup,
|
|
813
|
-
compatibilityWorkaround,
|
|
814
|
-
clickDispatchProbe,
|
|
815
|
-
electronLaunch,
|
|
816
|
-
exactSensitiveValues,
|
|
817
|
-
executionPlan,
|
|
818
|
-
includePinnedNavigationSummary,
|
|
819
|
-
pinnedBatchUnwrapMode,
|
|
820
|
-
preparedArgs,
|
|
821
|
-
priorRefSnapshotState,
|
|
822
|
-
priorSessionTabTarget,
|
|
823
|
-
processArgs,
|
|
824
|
-
processStdin,
|
|
825
|
-
processTimeoutMs,
|
|
826
|
-
redactedArgs,
|
|
827
|
-
redactedCompiledElectron,
|
|
828
|
-
redactedCompiledJob,
|
|
829
|
-
redactedCompiledNetworkSourceLookup,
|
|
830
|
-
redactedCompiledQaPreset,
|
|
831
|
-
redactedCompiledSemanticAction,
|
|
832
|
-
redactedCompiledSourceLookup,
|
|
833
|
-
redactedEffectiveArgs,
|
|
834
|
-
redactedProcessArgs,
|
|
835
|
-
redactedRecoveryHint,
|
|
836
|
-
resolvedSemanticActionRefSnapshot,
|
|
837
|
-
runtimeToolArgs,
|
|
838
|
-
runtimeToolStdin,
|
|
839
|
-
scrollPositionBefore,
|
|
840
|
-
sessionMode,
|
|
841
|
-
sessionTabCorrection,
|
|
842
|
-
sessionTabPinningReason,
|
|
843
|
-
shouldProbeScrollNoop,
|
|
844
|
-
statePatch,
|
|
845
|
-
userRequestedJson,
|
|
846
|
-
} };
|
|
847
|
-
}
|