opendevbrowser 0.0.19 → 0.0.21
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/README.md +32 -24
- package/dist/automation/coordinator.d.ts +61 -2
- package/dist/automation/coordinator.d.ts.map +1 -1
- package/dist/browser/browser-manager.d.ts +6 -1
- package/dist/browser/browser-manager.d.ts.map +1 -1
- package/dist/browser/canvas-manager.d.ts +4 -0
- package/dist/browser/canvas-manager.d.ts.map +1 -1
- package/dist/browser/manager-types.d.ts +6 -1
- package/dist/browser/manager-types.d.ts.map +1 -1
- package/dist/browser/ops-browser-manager.d.ts +6 -1
- package/dist/browser/ops-browser-manager.d.ts.map +1 -1
- package/dist/browser/screencast-recorder.d.ts.map +1 -1
- package/dist/browser/session-inspector.d.ts +39 -0
- package/dist/browser/session-inspector.d.ts.map +1 -1
- package/dist/canvas/document-store.d.ts +14 -5
- package/dist/canvas/document-store.d.ts.map +1 -1
- package/dist/canvas/starters/catalog.d.ts.map +1 -1
- package/dist/canvas/types.d.ts +120 -9
- package/dist/canvas/types.d.ts.map +1 -1
- package/dist/challenges/action-loop.d.ts +2 -1
- package/dist/challenges/action-loop.d.ts.map +1 -1
- package/dist/challenges/capture.d.ts +14 -0
- package/dist/challenges/capture.d.ts.map +1 -0
- package/dist/challenges/index.d.ts +3 -1
- package/dist/challenges/index.d.ts.map +1 -1
- package/dist/challenges/inspect-plan.d.ts +40 -0
- package/dist/challenges/inspect-plan.d.ts.map +1 -0
- package/dist/challenges/orchestrator.d.ts.map +1 -1
- package/dist/challenges/types.d.ts +34 -0
- package/dist/challenges/types.d.ts.map +1 -1
- package/dist/{chunk-YBQECXZX.js → chunk-3VA6XR25.js} +3 -3
- package/dist/chunk-3VA6XR25.js.map +1 -0
- package/dist/{chunk-W4IHGDXV.js → chunk-4KVXCXV3.js} +25778 -24279
- package/dist/chunk-4KVXCXV3.js.map +1 -0
- package/dist/{chunk-5FZQJRBQ.js → chunk-ZE2E7ZGH.js} +3013 -1010
- package/dist/chunk-ZE2E7ZGH.js.map +1 -0
- package/dist/cli/commands/challenge-automation-mode.d.ts +3 -0
- package/dist/cli/commands/challenge-automation-mode.d.ts.map +1 -0
- package/dist/cli/commands/inspiredesign.d.ts +25 -0
- package/dist/cli/commands/inspiredesign.d.ts.map +1 -0
- package/dist/cli/commands/macro-resolve.d.ts.map +1 -1
- package/dist/cli/commands/nav/review-desktop.d.ts +7 -0
- package/dist/cli/commands/nav/review-desktop.d.ts.map +1 -0
- package/dist/cli/commands/nav/review-shared.d.ts +10 -0
- package/dist/cli/commands/nav/review-shared.d.ts.map +1 -0
- package/dist/cli/commands/nav/review.d.ts.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/session/inspector-audit.d.ts +7 -0
- package/dist/cli/commands/session/inspector-audit.d.ts.map +1 -0
- package/dist/cli/commands/session/inspector-plan.d.ts +7 -0
- package/dist/cli/commands/session/inspector-plan.d.ts.map +1 -0
- package/dist/cli/commands/session/inspector-shared.d.ts +11 -0
- package/dist/cli/commands/session/inspector-shared.d.ts.map +1 -0
- package/dist/cli/commands/session/inspector.d.ts +1 -11
- package/dist/cli/commands/session/inspector.d.ts.map +1 -1
- package/dist/cli/commands/status-capabilities.d.ts +7 -0
- package/dist/cli/commands/status-capabilities.d.ts.map +1 -0
- package/dist/cli/daemon-client.d.ts.map +1 -1
- package/dist/cli/daemon-commands.d.ts.map +1 -1
- package/dist/cli/daemon-status.d.ts +5 -0
- package/dist/cli/daemon-status.d.ts.map +1 -1
- package/dist/cli/daemon.d.ts +5 -0
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/help.d.ts +2 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/index.js +660 -244
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/remote-manager.d.ts +6 -0
- package/dist/cli/remote-manager.d.ts.map +1 -1
- package/dist/cli/utils/parse.d.ts +1 -0
- package/dist/cli/utils/parse.d.ts.map +1 -1
- package/dist/cli/utils/skills.d.ts +1 -1
- package/dist/cli/utils/skills.d.ts.map +1 -1
- package/dist/cli/utils/workflow-message.d.ts +3 -0
- package/dist/cli/utils/workflow-message.d.ts.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/core/bootstrap.d.ts.map +1 -1
- package/dist/core/runtime-assemblies.d.ts +2 -1
- package/dist/core/runtime-assemblies.d.ts.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/desktop/runtime.d.ts +1 -0
- package/dist/desktop/runtime.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +729 -448
- package/dist/index.js.map +1 -1
- package/dist/inspiredesign/handoff.d.ts +34 -0
- package/dist/inspiredesign/handoff.d.ts.map +1 -0
- package/dist/opendevbrowser.d.ts.map +1 -1
- package/dist/opendevbrowser.js +729 -448
- package/dist/opendevbrowser.js.map +1 -1
- package/dist/providers/browser-fallback.d.ts.map +1 -1
- package/dist/providers/constraint.d.ts +11 -0
- package/dist/providers/constraint.d.ts.map +1 -1
- package/dist/providers/cookie-source.d.ts +8 -0
- package/dist/providers/cookie-source.d.ts.map +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/inspiredesign-capture.d.ts +17 -0
- package/dist/providers/inspiredesign-capture.d.ts.map +1 -0
- package/dist/providers/inspiredesign-contract.d.ts +110 -0
- package/dist/providers/inspiredesign-contract.d.ts.map +1 -0
- package/dist/providers/renderer.d.ts +23 -0
- package/dist/providers/renderer.d.ts.map +1 -1
- package/dist/providers/runtime-bundle.d.ts +2 -1
- package/dist/providers/runtime-bundle.d.ts.map +1 -1
- package/dist/providers/runtime-factory.d.ts +4 -2
- package/dist/providers/runtime-factory.d.ts.map +1 -1
- package/dist/providers/shopping/index.d.ts +1 -1
- package/dist/providers/types.d.ts +3 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/workflow-contracts.d.ts +1 -1
- package/dist/providers/workflow-contracts.d.ts.map +1 -1
- package/dist/providers/workflow-handoff.d.ts +14 -0
- package/dist/providers/workflow-handoff.d.ts.map +1 -0
- package/dist/providers/workflows.d.ts +21 -2
- package/dist/providers/workflows.d.ts.map +1 -1
- package/dist/{providers-G36AM3Z2.js → providers-ZIVHHH4F.js} +6 -2
- package/dist/public-surface/generated-manifest.d.ts +143 -7
- package/dist/public-surface/generated-manifest.d.ts.map +1 -1
- package/dist/public-surface/source.d.ts +102 -3
- package/dist/public-surface/source.d.ts.map +1 -1
- package/dist/relay/protocol.d.ts +1 -1
- package/dist/relay/protocol.d.ts.map +1 -1
- package/dist/relay/relay-server.d.ts +1 -0
- package/dist/relay/relay-server.d.ts.map +1 -1
- package/dist/skills/skill-loader.js +1 -1
- package/dist/tools/automation-shared.d.ts +6 -0
- package/dist/tools/automation-shared.d.ts.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/inspiredesign_run.d.ts +4 -0
- package/dist/tools/inspiredesign_run.d.ts.map +1 -0
- package/dist/tools/review_desktop.d.ts +4 -0
- package/dist/tools/review_desktop.d.ts.map +1 -0
- package/dist/tools/session_inspector.d.ts.map +1 -1
- package/dist/tools/session_inspector_audit.d.ts +4 -0
- package/dist/tools/session_inspector_audit.d.ts.map +1 -0
- package/dist/tools/session_inspector_plan.d.ts +4 -0
- package/dist/tools/session_inspector_plan.d.ts.map +1 -0
- package/dist/tools/status_capabilities.d.ts +4 -0
- package/dist/tools/status_capabilities.d.ts.map +1 -0
- package/extension/dist/background.js +70 -10
- package/extension/dist/canvas/canvas-runtime.js +14 -1
- package/extension/dist/ops/ops-runtime.js +18 -1
- package/extension/dist/popup.js +29 -16
- package/extension/dist/services/ConnectionManager.js +27 -2
- package/extension/manifest.json +1 -1
- package/extension/popup.html +11 -0
- package/package.json +5 -5
- package/skills/AGENTS.md +2 -2
- package/skills/opendevbrowser-best-practices/SKILL.md +50 -15
- package/skills/opendevbrowser-best-practices/artifacts/canvas-governance-playbook.md +31 -12
- package/skills/opendevbrowser-best-practices/artifacts/command-channel-reference.md +64 -15
- package/skills/opendevbrowser-best-practices/artifacts/provider-workflows.md +4 -0
- package/skills/opendevbrowser-best-practices/artifacts/skill-runtime-surface-matrix.md +11 -10
- package/skills/opendevbrowser-best-practices/assets/templates/canvas-blocker-checklist.json +28 -22
- package/skills/opendevbrowser-best-practices/assets/templates/canvas-generation-plan.v1.json +18 -17
- package/skills/opendevbrowser-best-practices/assets/templates/canvas-handshake-example.json +135 -17
- package/skills/opendevbrowser-best-practices/assets/templates/skill-runtime-pack-matrix.json +55 -8
- package/skills/opendevbrowser-best-practices/assets/templates/surface-audit-checklist.json +18 -4
- package/skills/opendevbrowser-best-practices/scripts/odb-workflow.sh +16 -4
- package/skills/opendevbrowser-best-practices/scripts/run-robustness-audit.sh +3 -1
- package/skills/opendevbrowser-best-practices/scripts/validate-skill-assets.sh +68 -25
- package/skills/opendevbrowser-design-agent/SKILL.md +9 -4
- package/skills/opendevbrowser-design-agent/artifacts/design-workflows.md +15 -6
- package/skills/opendevbrowser-design-agent/assets/templates/canvas-generation-plan.design.v1.json +18 -17
- package/skills/opendevbrowser-design-agent/scripts/design-workflow.sh +11 -0
- package/skills/opendevbrowser-design-agent/scripts/validate-skill-assets.sh +57 -0
- package/skills/opendevbrowser-product-presentation-asset/SKILL.md +2 -2
- package/dist/chunk-5FZQJRBQ.js.map +0 -1
- package/dist/chunk-W4IHGDXV.js.map +0 -1
- package/dist/chunk-YBQECXZX.js.map +0 -1
- /package/dist/{providers-G36AM3Z2.js.map → providers-ZIVHHH4F.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
ScriptRunner,
|
|
5
5
|
buildAnnotateResult,
|
|
6
6
|
buildBrowserReviewResult,
|
|
7
|
+
buildCorrelatedAuditBundle,
|
|
7
8
|
buildLoopbackSessionRelayEndpoint,
|
|
9
|
+
captureInspiredesignReferenceFromManager,
|
|
8
10
|
classifySessionRelayEndpoint,
|
|
9
11
|
createAutomationCoordinator,
|
|
10
12
|
createCoreRuntimeAssemblies,
|
|
@@ -12,21 +14,24 @@ import {
|
|
|
12
14
|
executeMacroWithRuntime,
|
|
13
15
|
extractExtension,
|
|
14
16
|
fetchDaemonStatusFromMetadata,
|
|
17
|
+
getCurrentDaemonFingerprint,
|
|
15
18
|
inspectSession,
|
|
16
19
|
onboarding_metadata_default,
|
|
20
|
+
readDaemonMetadata,
|
|
21
|
+
requireChallengeOrchestrationConfig,
|
|
17
22
|
resolveBundledProviderRuntime,
|
|
18
23
|
resolveSessionRelayRoute,
|
|
19
24
|
startDaemon
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-Y2KL55OG.js";
|
|
25
|
+
} from "./chunk-4KVXCXV3.js";
|
|
26
|
+
import "./chunk-3VA6XR25.js";
|
|
23
27
|
import "./chunk-TBUCZX4A.js";
|
|
28
|
+
import "./chunk-Y2KL55OG.js";
|
|
24
29
|
import {
|
|
25
30
|
CHALLENGE_AUTOMATION_MODES,
|
|
26
31
|
buildBlockerArtifacts,
|
|
27
32
|
classifyBlockerSignal,
|
|
28
33
|
createRequestId
|
|
29
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZE2E7ZGH.js";
|
|
30
35
|
import "./chunk-FUSXMW3G.js";
|
|
31
36
|
|
|
32
37
|
// src/cli/remote-manager.ts
|
|
@@ -301,6 +306,13 @@ var RemoteManager = class {
|
|
|
301
306
|
...options
|
|
302
307
|
});
|
|
303
308
|
}
|
|
309
|
+
inspectChallengePlan(input) {
|
|
310
|
+
return this.client.call("session.inspectPlan", {
|
|
311
|
+
sessionId: input.sessionId,
|
|
312
|
+
...typeof input.targetId === "string" ? { targetId: input.targetId } : {},
|
|
313
|
+
...typeof input.runMode === "string" ? { challengeAutomationMode: input.runMode } : {}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
304
316
|
createSessionInspector() {
|
|
305
317
|
return {
|
|
306
318
|
status: (sessionId) => this.status(sessionId),
|
|
@@ -494,7 +506,7 @@ var RemoteRelay = class {
|
|
|
494
506
|
|
|
495
507
|
// src/skills/skill-nudge.ts
|
|
496
508
|
var SKILL_NUDGE_MARKER = "[opendevbrowser:skill-nudge]";
|
|
497
|
-
var SKILL_NUDGE_MESSAGE = `${SKILL_NUDGE_MARKER} If this task likely matches a skill, start with skill("${onboarding_metadata_default.skillName}", "${onboarding_metadata_default.skillTopic}"). For frontend, UI, screenshot-to-code, or /canvas design work, then load skill("${onboarding_metadata_default.designSkillName}"). Use the canonical opendevbrowser-* packs and start with the bundled quick-start lane before low-level browser commands.`;
|
|
509
|
+
var SKILL_NUDGE_MESSAGE = `${SKILL_NUDGE_MARKER} If this task likely matches a skill, start with skill("${onboarding_metadata_default.skillName}", "${onboarding_metadata_default.skillTopic}"). For frontend, UI, screenshot-to-code, or /canvas design work, then load skill("${onboarding_metadata_default.designSkillName}", "${onboarding_metadata_default.designSkillTopic}"). Use the canonical opendevbrowser-* packs and start with the bundled quick-start lane before low-level browser commands.`;
|
|
498
510
|
function createSkillNudgeState() {
|
|
499
511
|
return { pending: false, requestedAtMs: null };
|
|
500
512
|
}
|
|
@@ -1089,26 +1101,71 @@ function createStatusTool(deps) {
|
|
|
1089
1101
|
});
|
|
1090
1102
|
}
|
|
1091
1103
|
|
|
1092
|
-
// src/tools/
|
|
1104
|
+
// src/tools/status_capabilities.ts
|
|
1093
1105
|
import { tool as tool5 } from "@opencode-ai/plugin";
|
|
1106
|
+
|
|
1107
|
+
// src/tools/automation-shared.ts
|
|
1108
|
+
function requireAutomationCoordinator(deps) {
|
|
1109
|
+
return deps.automationCoordinator ?? failure("Automation coordinator unavailable.", "automation_coordinator_unavailable");
|
|
1110
|
+
}
|
|
1111
|
+
function requireSessionInspectorHandle(deps) {
|
|
1112
|
+
const inspector = deps.manager.createSessionInspector?.();
|
|
1113
|
+
return inspector ?? failure(
|
|
1114
|
+
"Session inspector is unavailable for the current runtime.",
|
|
1115
|
+
"session_inspector_unavailable"
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// src/tools/status_capabilities.ts
|
|
1094
1120
|
var z5 = tool5.schema;
|
|
1095
|
-
|
|
1121
|
+
var challengeAutomationModeSchema = z5.enum(CHALLENGE_AUTOMATION_MODES);
|
|
1122
|
+
function createStatusCapabilitiesTool(deps) {
|
|
1096
1123
|
return tool5({
|
|
1124
|
+
description: "Inspect runtime capability discovery for the host and an optional session.",
|
|
1125
|
+
args: {
|
|
1126
|
+
sessionId: z5.string().optional().describe("Optional session id"),
|
|
1127
|
+
targetId: z5.string().optional().describe("Optional target id"),
|
|
1128
|
+
challengeAutomationMode: challengeAutomationModeSchema.optional().describe("Optional browser-scoped computer-use mode override")
|
|
1129
|
+
},
|
|
1130
|
+
async execute(args) {
|
|
1131
|
+
try {
|
|
1132
|
+
const coordinator = requireAutomationCoordinator(deps);
|
|
1133
|
+
if (typeof coordinator === "string") {
|
|
1134
|
+
return coordinator;
|
|
1135
|
+
}
|
|
1136
|
+
const result = await coordinator.statusCapabilities({
|
|
1137
|
+
browserSessionId: args.sessionId,
|
|
1138
|
+
targetId: args.targetId,
|
|
1139
|
+
runMode: args.challengeAutomationMode
|
|
1140
|
+
});
|
|
1141
|
+
return ok(result);
|
|
1142
|
+
} catch (error) {
|
|
1143
|
+
return failure(serializeError(error).message, "status_capabilities_failed");
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// src/tools/session_inspector.ts
|
|
1150
|
+
import { tool as tool6 } from "@opencode-ai/plugin";
|
|
1151
|
+
var z6 = tool6.schema;
|
|
1152
|
+
function createSessionInspectorTool(deps) {
|
|
1153
|
+
return tool6({
|
|
1097
1154
|
description: "Capture a session-first diagnostic bundle with relay health, trace proof, and a suggested next action.",
|
|
1098
1155
|
args: {
|
|
1099
|
-
sessionId:
|
|
1100
|
-
includeUrls:
|
|
1101
|
-
sinceConsoleSeq:
|
|
1102
|
-
sinceNetworkSeq:
|
|
1103
|
-
sinceExceptionSeq:
|
|
1104
|
-
max:
|
|
1105
|
-
requestId:
|
|
1156
|
+
sessionId: z6.string().describe("Session id"),
|
|
1157
|
+
includeUrls: z6.boolean().optional().describe("Include target URLs in the targets summary"),
|
|
1158
|
+
sinceConsoleSeq: z6.number().int().optional().describe("Resume cursor for console events"),
|
|
1159
|
+
sinceNetworkSeq: z6.number().int().optional().describe("Resume cursor for network events"),
|
|
1160
|
+
sinceExceptionSeq: z6.number().int().optional().describe("Resume cursor for exception events"),
|
|
1161
|
+
max: z6.number().int().optional().describe("Max events per diagnostics channel"),
|
|
1162
|
+
requestId: z6.string().optional().describe("Optional trace request id")
|
|
1106
1163
|
},
|
|
1107
1164
|
async execute(args) {
|
|
1108
1165
|
try {
|
|
1109
|
-
const inspector = deps
|
|
1110
|
-
if (
|
|
1111
|
-
return
|
|
1166
|
+
const inspector = requireSessionInspectorHandle(deps);
|
|
1167
|
+
if (typeof inspector === "string") {
|
|
1168
|
+
return inspector;
|
|
1112
1169
|
}
|
|
1113
1170
|
await deps.relay?.refresh?.().catch(() => void 0);
|
|
1114
1171
|
const relayStatus = deps.relay?.status?.() ?? null;
|
|
@@ -1130,15 +1187,113 @@ function createSessionInspectorTool(deps) {
|
|
|
1130
1187
|
});
|
|
1131
1188
|
}
|
|
1132
1189
|
|
|
1190
|
+
// src/tools/session_inspector_plan.ts
|
|
1191
|
+
import { tool as tool7 } from "@opencode-ai/plugin";
|
|
1192
|
+
var z7 = tool7.schema;
|
|
1193
|
+
var challengeAutomationModeSchema2 = z7.enum(CHALLENGE_AUTOMATION_MODES);
|
|
1194
|
+
function createSessionInspectorPlanTool(deps) {
|
|
1195
|
+
return tool7({
|
|
1196
|
+
description: "Inspect browser-scoped computer-use policy, eligibility, and safe suggested steps.",
|
|
1197
|
+
args: {
|
|
1198
|
+
sessionId: z7.string().describe("Session id"),
|
|
1199
|
+
targetId: z7.string().optional().describe("Optional target id"),
|
|
1200
|
+
challengeAutomationMode: challengeAutomationModeSchema2.optional().describe("Optional browser-scoped computer-use mode override")
|
|
1201
|
+
},
|
|
1202
|
+
async execute(args) {
|
|
1203
|
+
try {
|
|
1204
|
+
const coordinator = requireAutomationCoordinator(deps);
|
|
1205
|
+
if (typeof coordinator === "string") {
|
|
1206
|
+
return coordinator;
|
|
1207
|
+
}
|
|
1208
|
+
const result = await coordinator.inspectChallengePlan({
|
|
1209
|
+
browserSessionId: args.sessionId,
|
|
1210
|
+
targetId: args.targetId,
|
|
1211
|
+
runMode: args.challengeAutomationMode
|
|
1212
|
+
});
|
|
1213
|
+
return ok(result);
|
|
1214
|
+
} catch (error) {
|
|
1215
|
+
return failure(serializeError(error).message, "session_inspector_plan_failed");
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
// src/tools/session_inspector_audit.ts
|
|
1222
|
+
import { tool as tool8 } from "@opencode-ai/plugin";
|
|
1223
|
+
var z8 = tool8.schema;
|
|
1224
|
+
var challengeAutomationModeSchema3 = z8.enum(CHALLENGE_AUTOMATION_MODES);
|
|
1225
|
+
function createSessionInspectorAuditTool(deps) {
|
|
1226
|
+
return tool8({
|
|
1227
|
+
description: "Capture a correlated audit bundle across desktop evidence, browser review, and policy state.",
|
|
1228
|
+
args: {
|
|
1229
|
+
sessionId: z8.string().describe("Session id"),
|
|
1230
|
+
targetId: z8.string().optional().describe("Optional target id"),
|
|
1231
|
+
reason: z8.string().optional().describe("Optional audit reason"),
|
|
1232
|
+
maxChars: z8.number().int().optional().describe("Max characters for review output"),
|
|
1233
|
+
cursor: z8.string().optional().describe("Cursor for paging"),
|
|
1234
|
+
includeUrls: z8.boolean().optional().describe("Include target URLs in the targets summary"),
|
|
1235
|
+
sinceConsoleSeq: z8.number().int().optional().describe("Resume cursor for console events"),
|
|
1236
|
+
sinceNetworkSeq: z8.number().int().optional().describe("Resume cursor for network events"),
|
|
1237
|
+
sinceExceptionSeq: z8.number().int().optional().describe("Resume cursor for exception events"),
|
|
1238
|
+
max: z8.number().int().optional().describe("Max events per diagnostics channel"),
|
|
1239
|
+
requestId: z8.string().optional().describe("Optional trace request id"),
|
|
1240
|
+
challengeAutomationMode: challengeAutomationModeSchema3.optional().describe("Optional browser-scoped computer-use mode override")
|
|
1241
|
+
},
|
|
1242
|
+
async execute(args) {
|
|
1243
|
+
try {
|
|
1244
|
+
const coordinator = requireAutomationCoordinator(deps);
|
|
1245
|
+
if (typeof coordinator === "string") {
|
|
1246
|
+
return coordinator;
|
|
1247
|
+
}
|
|
1248
|
+
const inspector = requireSessionInspectorHandle(deps);
|
|
1249
|
+
if (typeof inspector === "string") {
|
|
1250
|
+
return inspector;
|
|
1251
|
+
}
|
|
1252
|
+
await deps.relay?.refresh?.().catch(() => void 0);
|
|
1253
|
+
const review = await coordinator.reviewDesktop({
|
|
1254
|
+
browserSessionId: args.sessionId,
|
|
1255
|
+
targetId: args.targetId,
|
|
1256
|
+
reason: args.reason,
|
|
1257
|
+
maxChars: args.maxChars,
|
|
1258
|
+
cursor: args.cursor
|
|
1259
|
+
});
|
|
1260
|
+
const challengePlan = await coordinator.inspectChallengePlan({
|
|
1261
|
+
browserSessionId: args.sessionId,
|
|
1262
|
+
targetId: args.targetId,
|
|
1263
|
+
runMode: args.challengeAutomationMode
|
|
1264
|
+
});
|
|
1265
|
+
const result = await buildCorrelatedAuditBundle({
|
|
1266
|
+
handle: inspector,
|
|
1267
|
+
browserSessionId: args.sessionId,
|
|
1268
|
+
targetId: args.targetId,
|
|
1269
|
+
observation: review.observation,
|
|
1270
|
+
review: review.verification,
|
|
1271
|
+
challengePlan,
|
|
1272
|
+
includeUrls: args.includeUrls,
|
|
1273
|
+
sinceConsoleSeq: args.sinceConsoleSeq,
|
|
1274
|
+
sinceNetworkSeq: args.sinceNetworkSeq,
|
|
1275
|
+
sinceExceptionSeq: args.sinceExceptionSeq,
|
|
1276
|
+
max: args.max,
|
|
1277
|
+
requestId: args.requestId,
|
|
1278
|
+
relayStatus: deps.relay?.status?.() ?? null
|
|
1279
|
+
});
|
|
1280
|
+
return ok(result);
|
|
1281
|
+
} catch (error) {
|
|
1282
|
+
return failure(serializeError(error).message, "session_inspector_audit_failed");
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1133
1288
|
// src/tools/targets_list.ts
|
|
1134
|
-
import { tool as
|
|
1135
|
-
var
|
|
1289
|
+
import { tool as tool9 } from "@opencode-ai/plugin";
|
|
1290
|
+
var z9 = tool9.schema;
|
|
1136
1291
|
function createTargetsListTool(deps) {
|
|
1137
|
-
return
|
|
1292
|
+
return tool9({
|
|
1138
1293
|
description: "List targets (tabs) in the current session.",
|
|
1139
1294
|
args: {
|
|
1140
|
-
sessionId:
|
|
1141
|
-
includeUrls:
|
|
1295
|
+
sessionId: z9.string().describe("Session id"),
|
|
1296
|
+
includeUrls: z9.boolean().optional().describe("Include target URLs")
|
|
1142
1297
|
},
|
|
1143
1298
|
async execute(args) {
|
|
1144
1299
|
try {
|
|
@@ -1155,14 +1310,14 @@ function createTargetsListTool(deps) {
|
|
|
1155
1310
|
}
|
|
1156
1311
|
|
|
1157
1312
|
// src/tools/target_use.ts
|
|
1158
|
-
import { tool as
|
|
1159
|
-
var
|
|
1313
|
+
import { tool as tool10 } from "@opencode-ai/plugin";
|
|
1314
|
+
var z10 = tool10.schema;
|
|
1160
1315
|
function createTargetUseTool(deps) {
|
|
1161
|
-
return
|
|
1316
|
+
return tool10({
|
|
1162
1317
|
description: "Set the active target (tab).",
|
|
1163
1318
|
args: {
|
|
1164
|
-
sessionId:
|
|
1165
|
-
targetId:
|
|
1319
|
+
sessionId: z10.string().describe("Session id"),
|
|
1320
|
+
targetId: z10.string().describe("Target id")
|
|
1166
1321
|
},
|
|
1167
1322
|
async execute(args) {
|
|
1168
1323
|
try {
|
|
@@ -1180,14 +1335,14 @@ function createTargetUseTool(deps) {
|
|
|
1180
1335
|
}
|
|
1181
1336
|
|
|
1182
1337
|
// src/tools/target_new.ts
|
|
1183
|
-
import { tool as
|
|
1184
|
-
var
|
|
1338
|
+
import { tool as tool11 } from "@opencode-ai/plugin";
|
|
1339
|
+
var z11 = tool11.schema;
|
|
1185
1340
|
function createTargetNewTool(deps) {
|
|
1186
|
-
return
|
|
1341
|
+
return tool11({
|
|
1187
1342
|
description: "Open a new target (tab).",
|
|
1188
1343
|
args: {
|
|
1189
|
-
sessionId:
|
|
1190
|
-
url:
|
|
1344
|
+
sessionId: z11.string().describe("Session id"),
|
|
1345
|
+
url: z11.string().optional().describe("Optional URL to open")
|
|
1191
1346
|
},
|
|
1192
1347
|
async execute(args) {
|
|
1193
1348
|
try {
|
|
@@ -1201,14 +1356,14 @@ function createTargetNewTool(deps) {
|
|
|
1201
1356
|
}
|
|
1202
1357
|
|
|
1203
1358
|
// src/tools/target_close.ts
|
|
1204
|
-
import { tool as
|
|
1205
|
-
var
|
|
1359
|
+
import { tool as tool12 } from "@opencode-ai/plugin";
|
|
1360
|
+
var z12 = tool12.schema;
|
|
1206
1361
|
function createTargetCloseTool(deps) {
|
|
1207
|
-
return
|
|
1362
|
+
return tool12({
|
|
1208
1363
|
description: "Close a target (tab).",
|
|
1209
1364
|
args: {
|
|
1210
|
-
sessionId:
|
|
1211
|
-
targetId:
|
|
1365
|
+
sessionId: z12.string().describe("Session id"),
|
|
1366
|
+
targetId: z12.string().describe("Target id")
|
|
1212
1367
|
},
|
|
1213
1368
|
async execute(args) {
|
|
1214
1369
|
try {
|
|
@@ -1222,15 +1377,15 @@ function createTargetCloseTool(deps) {
|
|
|
1222
1377
|
}
|
|
1223
1378
|
|
|
1224
1379
|
// src/tools/page.ts
|
|
1225
|
-
import { tool as
|
|
1226
|
-
var
|
|
1380
|
+
import { tool as tool13 } from "@opencode-ai/plugin";
|
|
1381
|
+
var z13 = tool13.schema;
|
|
1227
1382
|
function createPageTool(deps) {
|
|
1228
|
-
return
|
|
1383
|
+
return tool13({
|
|
1229
1384
|
description: "Open or focus a named page, optionally navigating to a URL.",
|
|
1230
1385
|
args: {
|
|
1231
|
-
sessionId:
|
|
1232
|
-
name:
|
|
1233
|
-
url:
|
|
1386
|
+
sessionId: z13.string().describe("Active browser session id"),
|
|
1387
|
+
name: z13.string().describe("Stable page name"),
|
|
1388
|
+
url: z13.string().optional().describe("Optional URL to open")
|
|
1234
1389
|
},
|
|
1235
1390
|
async execute(args) {
|
|
1236
1391
|
try {
|
|
@@ -1249,13 +1404,13 @@ function createPageTool(deps) {
|
|
|
1249
1404
|
}
|
|
1250
1405
|
|
|
1251
1406
|
// src/tools/list.ts
|
|
1252
|
-
import { tool as
|
|
1253
|
-
var
|
|
1407
|
+
import { tool as tool14 } from "@opencode-ai/plugin";
|
|
1408
|
+
var z14 = tool14.schema;
|
|
1254
1409
|
function createListTool(deps) {
|
|
1255
|
-
return
|
|
1410
|
+
return tool14({
|
|
1256
1411
|
description: "List named pages in the current session.",
|
|
1257
1412
|
args: {
|
|
1258
|
-
sessionId:
|
|
1413
|
+
sessionId: z14.string().describe("Active browser session id")
|
|
1259
1414
|
},
|
|
1260
1415
|
async execute(args) {
|
|
1261
1416
|
try {
|
|
@@ -1269,14 +1424,14 @@ function createListTool(deps) {
|
|
|
1269
1424
|
}
|
|
1270
1425
|
|
|
1271
1426
|
// src/tools/close.ts
|
|
1272
|
-
import { tool as
|
|
1273
|
-
var
|
|
1427
|
+
import { tool as tool15 } from "@opencode-ai/plugin";
|
|
1428
|
+
var z15 = tool15.schema;
|
|
1274
1429
|
function createCloseTool(deps) {
|
|
1275
|
-
return
|
|
1430
|
+
return tool15({
|
|
1276
1431
|
description: "Close a named page within the current session.",
|
|
1277
1432
|
args: {
|
|
1278
|
-
sessionId:
|
|
1279
|
-
name:
|
|
1433
|
+
sessionId: z15.string().describe("Active browser session id"),
|
|
1434
|
+
name: z15.string().describe("Named page to close")
|
|
1280
1435
|
},
|
|
1281
1436
|
async execute(args) {
|
|
1282
1437
|
try {
|
|
@@ -1290,18 +1445,18 @@ function createCloseTool(deps) {
|
|
|
1290
1445
|
}
|
|
1291
1446
|
|
|
1292
1447
|
// src/tools/goto.ts
|
|
1293
|
-
import { tool as
|
|
1294
|
-
var
|
|
1295
|
-
var waitUntilSchema =
|
|
1448
|
+
import { tool as tool16 } from "@opencode-ai/plugin";
|
|
1449
|
+
var z16 = tool16.schema;
|
|
1450
|
+
var waitUntilSchema = z16.enum(["domcontentloaded", "load", "networkidle"]);
|
|
1296
1451
|
function createGotoTool(deps) {
|
|
1297
|
-
return
|
|
1452
|
+
return tool16({
|
|
1298
1453
|
description: "Navigate the active target to a URL.",
|
|
1299
1454
|
args: {
|
|
1300
|
-
sessionId:
|
|
1301
|
-
url:
|
|
1302
|
-
targetId:
|
|
1455
|
+
sessionId: z16.string().describe("Session id"),
|
|
1456
|
+
url: z16.string().describe("URL to navigate to"),
|
|
1457
|
+
targetId: z16.string().optional().describe("Optional target id"),
|
|
1303
1458
|
waitUntil: waitUntilSchema.optional().describe("Load state to wait for"),
|
|
1304
|
-
timeoutMs:
|
|
1459
|
+
timeoutMs: z16.number().int().optional().describe("Timeout in milliseconds")
|
|
1305
1460
|
},
|
|
1306
1461
|
async execute(args) {
|
|
1307
1462
|
try {
|
|
@@ -1322,20 +1477,20 @@ function createGotoTool(deps) {
|
|
|
1322
1477
|
}
|
|
1323
1478
|
|
|
1324
1479
|
// src/tools/wait.ts
|
|
1325
|
-
import { tool as
|
|
1326
|
-
var
|
|
1327
|
-
var waitUntilSchema2 =
|
|
1328
|
-
var waitStateSchema =
|
|
1480
|
+
import { tool as tool17 } from "@opencode-ai/plugin";
|
|
1481
|
+
var z17 = tool17.schema;
|
|
1482
|
+
var waitUntilSchema2 = z17.enum(["domcontentloaded", "load", "networkidle"]);
|
|
1483
|
+
var waitStateSchema = z17.enum(["attached", "visible", "hidden"]);
|
|
1329
1484
|
function createWaitTool(deps) {
|
|
1330
|
-
return
|
|
1485
|
+
return tool17({
|
|
1331
1486
|
description: "Wait for a load state or a ref state.",
|
|
1332
1487
|
args: {
|
|
1333
|
-
sessionId:
|
|
1334
|
-
targetId:
|
|
1488
|
+
sessionId: z17.string().describe("Session id"),
|
|
1489
|
+
targetId: z17.string().optional().describe("Optional target id"),
|
|
1335
1490
|
until: waitUntilSchema2.optional().describe("Load state to wait for"),
|
|
1336
|
-
ref:
|
|
1491
|
+
ref: z17.string().optional().describe("Ref to wait for"),
|
|
1337
1492
|
state: waitStateSchema.optional().describe("Ref state to wait for"),
|
|
1338
|
-
timeoutMs:
|
|
1493
|
+
timeoutMs: z17.number().int().optional().describe("Timeout in milliseconds")
|
|
1339
1494
|
},
|
|
1340
1495
|
async execute(args) {
|
|
1341
1496
|
try {
|
|
@@ -1367,18 +1522,18 @@ function createWaitTool(deps) {
|
|
|
1367
1522
|
}
|
|
1368
1523
|
|
|
1369
1524
|
// src/tools/snapshot.ts
|
|
1370
|
-
import { tool as
|
|
1371
|
-
var
|
|
1372
|
-
var formatSchema =
|
|
1525
|
+
import { tool as tool18 } from "@opencode-ai/plugin";
|
|
1526
|
+
var z18 = tool18.schema;
|
|
1527
|
+
var formatSchema = z18.enum(["outline", "actionables"]);
|
|
1373
1528
|
function createSnapshotTool(deps) {
|
|
1374
|
-
return
|
|
1529
|
+
return tool18({
|
|
1375
1530
|
description: "Capture a snapshot of the current page and return refs.",
|
|
1376
1531
|
args: {
|
|
1377
|
-
sessionId:
|
|
1378
|
-
targetId:
|
|
1532
|
+
sessionId: z18.string().describe("Session id"),
|
|
1533
|
+
targetId: z18.string().optional().describe("Optional target id"),
|
|
1379
1534
|
format: formatSchema.optional().describe("Snapshot format"),
|
|
1380
|
-
maxChars:
|
|
1381
|
-
cursor:
|
|
1535
|
+
maxChars: z18.number().int().optional().describe("Max characters for snapshot output"),
|
|
1536
|
+
cursor: z18.string().optional().describe("Cursor for paging")
|
|
1382
1537
|
},
|
|
1383
1538
|
async execute(args) {
|
|
1384
1539
|
try {
|
|
@@ -1399,16 +1554,16 @@ function createSnapshotTool(deps) {
|
|
|
1399
1554
|
}
|
|
1400
1555
|
|
|
1401
1556
|
// src/tools/review.ts
|
|
1402
|
-
import { tool as
|
|
1403
|
-
var
|
|
1557
|
+
import { tool as tool19 } from "@opencode-ai/plugin";
|
|
1558
|
+
var z19 = tool19.schema;
|
|
1404
1559
|
function createReviewTool(deps) {
|
|
1405
|
-
return
|
|
1560
|
+
return tool19({
|
|
1406
1561
|
description: "Capture a first-class review payload with status and actionables.",
|
|
1407
1562
|
args: {
|
|
1408
|
-
sessionId:
|
|
1409
|
-
targetId:
|
|
1410
|
-
maxChars:
|
|
1411
|
-
cursor:
|
|
1563
|
+
sessionId: z19.string().describe("Session id"),
|
|
1564
|
+
targetId: z19.string().optional().describe("Optional target id"),
|
|
1565
|
+
maxChars: z19.number().int().optional().describe("Max characters for review output"),
|
|
1566
|
+
cursor: z19.string().optional().describe("Cursor for paging")
|
|
1412
1567
|
},
|
|
1413
1568
|
async execute(args) {
|
|
1414
1569
|
try {
|
|
@@ -1428,16 +1583,50 @@ function createReviewTool(deps) {
|
|
|
1428
1583
|
});
|
|
1429
1584
|
}
|
|
1430
1585
|
|
|
1586
|
+
// src/tools/review_desktop.ts
|
|
1587
|
+
import { tool as tool20 } from "@opencode-ai/plugin";
|
|
1588
|
+
var z20 = tool20.schema;
|
|
1589
|
+
function createReviewDesktopTool(deps) {
|
|
1590
|
+
return tool20({
|
|
1591
|
+
description: "Capture desktop-assisted browser review with read-only desktop evidence and browser-owned verification.",
|
|
1592
|
+
args: {
|
|
1593
|
+
sessionId: z20.string().describe("Session id"),
|
|
1594
|
+
targetId: z20.string().optional().describe("Optional target id"),
|
|
1595
|
+
reason: z20.string().optional().describe("Optional audit reason"),
|
|
1596
|
+
maxChars: z20.number().int().optional().describe("Max characters for review output"),
|
|
1597
|
+
cursor: z20.string().optional().describe("Cursor for paging")
|
|
1598
|
+
},
|
|
1599
|
+
async execute(args) {
|
|
1600
|
+
try {
|
|
1601
|
+
const coordinator = requireAutomationCoordinator(deps);
|
|
1602
|
+
if (typeof coordinator === "string") {
|
|
1603
|
+
return coordinator;
|
|
1604
|
+
}
|
|
1605
|
+
const result = await coordinator.reviewDesktop({
|
|
1606
|
+
browserSessionId: args.sessionId,
|
|
1607
|
+
targetId: args.targetId,
|
|
1608
|
+
reason: args.reason,
|
|
1609
|
+
maxChars: args.maxChars,
|
|
1610
|
+
cursor: args.cursor
|
|
1611
|
+
});
|
|
1612
|
+
return ok(result);
|
|
1613
|
+
} catch (error) {
|
|
1614
|
+
return failure(serializeError(error).message, "review_desktop_failed");
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1431
1620
|
// src/tools/click.ts
|
|
1432
|
-
import { tool as
|
|
1433
|
-
var
|
|
1621
|
+
import { tool as tool21 } from "@opencode-ai/plugin";
|
|
1622
|
+
var z21 = tool21.schema;
|
|
1434
1623
|
function createClickTool(deps) {
|
|
1435
|
-
return
|
|
1624
|
+
return tool21({
|
|
1436
1625
|
description: "Click a referenced element.",
|
|
1437
1626
|
args: {
|
|
1438
|
-
sessionId:
|
|
1439
|
-
targetId:
|
|
1440
|
-
ref:
|
|
1627
|
+
sessionId: z21.string().describe("Session id"),
|
|
1628
|
+
targetId: z21.string().optional().describe("Optional target id"),
|
|
1629
|
+
ref: z21.string().describe("Element ref")
|
|
1441
1630
|
},
|
|
1442
1631
|
async execute(args) {
|
|
1443
1632
|
try {
|
|
@@ -1451,15 +1640,15 @@ function createClickTool(deps) {
|
|
|
1451
1640
|
}
|
|
1452
1641
|
|
|
1453
1642
|
// src/tools/hover.ts
|
|
1454
|
-
import { tool as
|
|
1455
|
-
var
|
|
1643
|
+
import { tool as tool22 } from "@opencode-ai/plugin";
|
|
1644
|
+
var z22 = tool22.schema;
|
|
1456
1645
|
function createHoverTool(deps) {
|
|
1457
|
-
return
|
|
1646
|
+
return tool22({
|
|
1458
1647
|
description: "Hover over an element by ref.",
|
|
1459
1648
|
args: {
|
|
1460
|
-
sessionId:
|
|
1461
|
-
targetId:
|
|
1462
|
-
ref:
|
|
1649
|
+
sessionId: z22.string().describe("Active browser session id"),
|
|
1650
|
+
targetId: z22.string().optional().describe("Optional target id"),
|
|
1651
|
+
ref: z22.string().describe("Element ref from snapshot")
|
|
1463
1652
|
},
|
|
1464
1653
|
async execute(args) {
|
|
1465
1654
|
try {
|
|
@@ -1473,16 +1662,16 @@ function createHoverTool(deps) {
|
|
|
1473
1662
|
}
|
|
1474
1663
|
|
|
1475
1664
|
// src/tools/press.ts
|
|
1476
|
-
import { tool as
|
|
1477
|
-
var
|
|
1665
|
+
import { tool as tool23 } from "@opencode-ai/plugin";
|
|
1666
|
+
var z23 = tool23.schema;
|
|
1478
1667
|
function createPressTool(deps) {
|
|
1479
|
-
return
|
|
1668
|
+
return tool23({
|
|
1480
1669
|
description: "Press a keyboard key, optionally focusing a ref first.",
|
|
1481
1670
|
args: {
|
|
1482
|
-
sessionId:
|
|
1483
|
-
targetId:
|
|
1484
|
-
key:
|
|
1485
|
-
ref:
|
|
1671
|
+
sessionId: z23.string().describe("Active browser session id"),
|
|
1672
|
+
targetId: z23.string().optional().describe("Optional target id"),
|
|
1673
|
+
key: z23.string().describe("Keyboard key to press, e.g. Enter or ArrowDown"),
|
|
1674
|
+
ref: z23.string().optional().describe("Optional element ref to focus first")
|
|
1486
1675
|
},
|
|
1487
1676
|
async execute(args) {
|
|
1488
1677
|
try {
|
|
@@ -1496,15 +1685,15 @@ function createPressTool(deps) {
|
|
|
1496
1685
|
}
|
|
1497
1686
|
|
|
1498
1687
|
// src/tools/check.ts
|
|
1499
|
-
import { tool as
|
|
1500
|
-
var
|
|
1688
|
+
import { tool as tool24 } from "@opencode-ai/plugin";
|
|
1689
|
+
var z24 = tool24.schema;
|
|
1501
1690
|
function createCheckTool(deps) {
|
|
1502
|
-
return
|
|
1691
|
+
return tool24({
|
|
1503
1692
|
description: "Check a checkbox or toggle by ref.",
|
|
1504
1693
|
args: {
|
|
1505
|
-
sessionId:
|
|
1506
|
-
targetId:
|
|
1507
|
-
ref:
|
|
1694
|
+
sessionId: z24.string().describe("Active browser session id"),
|
|
1695
|
+
targetId: z24.string().optional().describe("Optional target id"),
|
|
1696
|
+
ref: z24.string().describe("Element ref from snapshot")
|
|
1508
1697
|
},
|
|
1509
1698
|
async execute(args) {
|
|
1510
1699
|
try {
|
|
@@ -1518,15 +1707,15 @@ function createCheckTool(deps) {
|
|
|
1518
1707
|
}
|
|
1519
1708
|
|
|
1520
1709
|
// src/tools/uncheck.ts
|
|
1521
|
-
import { tool as
|
|
1522
|
-
var
|
|
1710
|
+
import { tool as tool25 } from "@opencode-ai/plugin";
|
|
1711
|
+
var z25 = tool25.schema;
|
|
1523
1712
|
function createUncheckTool(deps) {
|
|
1524
|
-
return
|
|
1713
|
+
return tool25({
|
|
1525
1714
|
description: "Uncheck a checkbox or toggle by ref.",
|
|
1526
1715
|
args: {
|
|
1527
|
-
sessionId:
|
|
1528
|
-
targetId:
|
|
1529
|
-
ref:
|
|
1716
|
+
sessionId: z25.string().describe("Active browser session id"),
|
|
1717
|
+
targetId: z25.string().optional().describe("Optional target id"),
|
|
1718
|
+
ref: z25.string().describe("Element ref from snapshot")
|
|
1530
1719
|
},
|
|
1531
1720
|
async execute(args) {
|
|
1532
1721
|
try {
|
|
@@ -1540,18 +1729,18 @@ function createUncheckTool(deps) {
|
|
|
1540
1729
|
}
|
|
1541
1730
|
|
|
1542
1731
|
// src/tools/type.ts
|
|
1543
|
-
import { tool as
|
|
1544
|
-
var
|
|
1732
|
+
import { tool as tool26 } from "@opencode-ai/plugin";
|
|
1733
|
+
var z26 = tool26.schema;
|
|
1545
1734
|
function createTypeTool(deps) {
|
|
1546
|
-
return
|
|
1735
|
+
return tool26({
|
|
1547
1736
|
description: "Type text into a referenced input.",
|
|
1548
1737
|
args: {
|
|
1549
|
-
sessionId:
|
|
1550
|
-
targetId:
|
|
1551
|
-
ref:
|
|
1552
|
-
text:
|
|
1553
|
-
clear:
|
|
1554
|
-
submit:
|
|
1738
|
+
sessionId: z26.string().describe("Session id"),
|
|
1739
|
+
targetId: z26.string().optional().describe("Optional target id"),
|
|
1740
|
+
ref: z26.string().describe("Element ref"),
|
|
1741
|
+
text: z26.string().describe("Text to type"),
|
|
1742
|
+
clear: z26.boolean().optional().describe("Clear before typing"),
|
|
1743
|
+
submit: z26.boolean().optional().describe("Press Enter after typing")
|
|
1555
1744
|
},
|
|
1556
1745
|
async execute(args) {
|
|
1557
1746
|
try {
|
|
@@ -1572,16 +1761,16 @@ function createTypeTool(deps) {
|
|
|
1572
1761
|
}
|
|
1573
1762
|
|
|
1574
1763
|
// src/tools/select.ts
|
|
1575
|
-
import { tool as
|
|
1576
|
-
var
|
|
1764
|
+
import { tool as tool27 } from "@opencode-ai/plugin";
|
|
1765
|
+
var z27 = tool27.schema;
|
|
1577
1766
|
function createSelectTool(deps) {
|
|
1578
|
-
return
|
|
1767
|
+
return tool27({
|
|
1579
1768
|
description: "Select options in a referenced select element.",
|
|
1580
1769
|
args: {
|
|
1581
|
-
sessionId:
|
|
1582
|
-
targetId:
|
|
1583
|
-
ref:
|
|
1584
|
-
values:
|
|
1770
|
+
sessionId: z27.string().describe("Session id"),
|
|
1771
|
+
targetId: z27.string().optional().describe("Optional target id"),
|
|
1772
|
+
ref: z27.string().describe("Element ref"),
|
|
1773
|
+
values: z27.array(z27.string()).describe("Values to select")
|
|
1585
1774
|
},
|
|
1586
1775
|
async execute(args) {
|
|
1587
1776
|
try {
|
|
@@ -1595,16 +1784,16 @@ function createSelectTool(deps) {
|
|
|
1595
1784
|
}
|
|
1596
1785
|
|
|
1597
1786
|
// src/tools/scroll.ts
|
|
1598
|
-
import { tool as
|
|
1599
|
-
var
|
|
1787
|
+
import { tool as tool28 } from "@opencode-ai/plugin";
|
|
1788
|
+
var z28 = tool28.schema;
|
|
1600
1789
|
function createScrollTool(deps) {
|
|
1601
|
-
return
|
|
1790
|
+
return tool28({
|
|
1602
1791
|
description: "Scroll the page or a referenced element.",
|
|
1603
1792
|
args: {
|
|
1604
|
-
sessionId:
|
|
1605
|
-
targetId:
|
|
1606
|
-
dy:
|
|
1607
|
-
ref:
|
|
1793
|
+
sessionId: z28.string().describe("Session id"),
|
|
1794
|
+
targetId: z28.string().optional().describe("Optional target id"),
|
|
1795
|
+
dy: z28.number().describe("Scroll delta in pixels"),
|
|
1796
|
+
ref: z28.string().optional().describe("Optional element ref to scroll")
|
|
1608
1797
|
},
|
|
1609
1798
|
async execute(args) {
|
|
1610
1799
|
try {
|
|
@@ -1618,16 +1807,16 @@ function createScrollTool(deps) {
|
|
|
1618
1807
|
}
|
|
1619
1808
|
|
|
1620
1809
|
// src/tools/scroll_into_view.ts
|
|
1621
|
-
import { tool as
|
|
1622
|
-
var
|
|
1810
|
+
import { tool as tool29 } from "@opencode-ai/plugin";
|
|
1811
|
+
var z29 = tool29.schema;
|
|
1623
1812
|
function createScrollIntoViewTool(deps) {
|
|
1624
|
-
return
|
|
1813
|
+
return tool29({
|
|
1625
1814
|
description: "Scroll an element into view by ref.",
|
|
1626
1815
|
args: {
|
|
1627
|
-
sessionId:
|
|
1628
|
-
targetId:
|
|
1629
|
-
ref:
|
|
1630
|
-
},
|
|
1816
|
+
sessionId: z29.string().describe("Active browser session id"),
|
|
1817
|
+
targetId: z29.string().optional().describe("Optional target id"),
|
|
1818
|
+
ref: z29.string().describe("Element ref from snapshot")
|
|
1819
|
+
},
|
|
1631
1820
|
async execute(args) {
|
|
1632
1821
|
try {
|
|
1633
1822
|
const result = await deps.manager.scrollIntoView(args.sessionId, args.ref, args.targetId);
|
|
@@ -1640,16 +1829,16 @@ function createScrollIntoViewTool(deps) {
|
|
|
1640
1829
|
}
|
|
1641
1830
|
|
|
1642
1831
|
// src/tools/upload.ts
|
|
1643
|
-
import { tool as
|
|
1644
|
-
var
|
|
1832
|
+
import { tool as tool30 } from "@opencode-ai/plugin";
|
|
1833
|
+
var z30 = tool30.schema;
|
|
1645
1834
|
function createUploadTool(deps) {
|
|
1646
|
-
return
|
|
1835
|
+
return tool30({
|
|
1647
1836
|
description: "Upload files to an input or chooser by ref.",
|
|
1648
1837
|
args: {
|
|
1649
|
-
sessionId:
|
|
1650
|
-
targetId:
|
|
1651
|
-
ref:
|
|
1652
|
-
files:
|
|
1838
|
+
sessionId: z30.string().describe("Active browser session id"),
|
|
1839
|
+
targetId: z30.string().optional().describe("Optional target id"),
|
|
1840
|
+
ref: z30.string().describe("Element ref"),
|
|
1841
|
+
files: z30.array(z30.string()).min(1).describe("Local host file paths")
|
|
1653
1842
|
},
|
|
1654
1843
|
async execute(args) {
|
|
1655
1844
|
try {
|
|
@@ -1667,17 +1856,17 @@ function createUploadTool(deps) {
|
|
|
1667
1856
|
}
|
|
1668
1857
|
|
|
1669
1858
|
// src/tools/pointer_move.ts
|
|
1670
|
-
import { tool as
|
|
1671
|
-
var
|
|
1859
|
+
import { tool as tool31 } from "@opencode-ai/plugin";
|
|
1860
|
+
var z31 = tool31.schema;
|
|
1672
1861
|
function createPointerMoveTool(deps) {
|
|
1673
|
-
return
|
|
1862
|
+
return tool31({
|
|
1674
1863
|
description: "Move the pointer to viewport coordinates.",
|
|
1675
1864
|
args: {
|
|
1676
|
-
sessionId:
|
|
1677
|
-
targetId:
|
|
1678
|
-
x:
|
|
1679
|
-
y:
|
|
1680
|
-
steps:
|
|
1865
|
+
sessionId: z31.string().describe("Active browser session id"),
|
|
1866
|
+
targetId: z31.string().optional().describe("Optional target id"),
|
|
1867
|
+
x: z31.number().describe("Viewport x coordinate"),
|
|
1868
|
+
y: z31.number().describe("Viewport y coordinate"),
|
|
1869
|
+
steps: z31.number().int().positive().optional().describe("Optional move interpolation step count")
|
|
1681
1870
|
},
|
|
1682
1871
|
async execute(args) {
|
|
1683
1872
|
try {
|
|
@@ -1691,18 +1880,18 @@ function createPointerMoveTool(deps) {
|
|
|
1691
1880
|
}
|
|
1692
1881
|
|
|
1693
1882
|
// src/tools/pointer_down.ts
|
|
1694
|
-
import { tool as
|
|
1695
|
-
var
|
|
1883
|
+
import { tool as tool32 } from "@opencode-ai/plugin";
|
|
1884
|
+
var z32 = tool32.schema;
|
|
1696
1885
|
function createPointerDownTool(deps) {
|
|
1697
|
-
return
|
|
1886
|
+
return tool32({
|
|
1698
1887
|
description: "Move to viewport coordinates and press a mouse button.",
|
|
1699
1888
|
args: {
|
|
1700
|
-
sessionId:
|
|
1701
|
-
targetId:
|
|
1702
|
-
x:
|
|
1703
|
-
y:
|
|
1704
|
-
button:
|
|
1705
|
-
clickCount:
|
|
1889
|
+
sessionId: z32.string().describe("Active browser session id"),
|
|
1890
|
+
targetId: z32.string().optional().describe("Optional target id"),
|
|
1891
|
+
x: z32.number().describe("Viewport x coordinate"),
|
|
1892
|
+
y: z32.number().describe("Viewport y coordinate"),
|
|
1893
|
+
button: z32.enum(["left", "middle", "right"]).optional().describe("Mouse button to press"),
|
|
1894
|
+
clickCount: z32.number().int().positive().optional().describe("Associated click count")
|
|
1706
1895
|
},
|
|
1707
1896
|
async execute(args) {
|
|
1708
1897
|
try {
|
|
@@ -1723,18 +1912,18 @@ function createPointerDownTool(deps) {
|
|
|
1723
1912
|
}
|
|
1724
1913
|
|
|
1725
1914
|
// src/tools/pointer_up.ts
|
|
1726
|
-
import { tool as
|
|
1727
|
-
var
|
|
1915
|
+
import { tool as tool33 } from "@opencode-ai/plugin";
|
|
1916
|
+
var z33 = tool33.schema;
|
|
1728
1917
|
function createPointerUpTool(deps) {
|
|
1729
|
-
return
|
|
1918
|
+
return tool33({
|
|
1730
1919
|
description: "Move to viewport coordinates and release a mouse button.",
|
|
1731
1920
|
args: {
|
|
1732
|
-
sessionId:
|
|
1733
|
-
targetId:
|
|
1734
|
-
x:
|
|
1735
|
-
y:
|
|
1736
|
-
button:
|
|
1737
|
-
clickCount:
|
|
1921
|
+
sessionId: z33.string().describe("Active browser session id"),
|
|
1922
|
+
targetId: z33.string().optional().describe("Optional target id"),
|
|
1923
|
+
x: z33.number().describe("Viewport x coordinate"),
|
|
1924
|
+
y: z33.number().describe("Viewport y coordinate"),
|
|
1925
|
+
button: z33.enum(["left", "middle", "right"]).optional().describe("Mouse button to release"),
|
|
1926
|
+
clickCount: z33.number().int().positive().optional().describe("Associated click count")
|
|
1738
1927
|
},
|
|
1739
1928
|
async execute(args) {
|
|
1740
1929
|
try {
|
|
@@ -1755,19 +1944,19 @@ function createPointerUpTool(deps) {
|
|
|
1755
1944
|
}
|
|
1756
1945
|
|
|
1757
1946
|
// src/tools/pointer_drag.ts
|
|
1758
|
-
import { tool as
|
|
1759
|
-
var
|
|
1947
|
+
import { tool as tool34 } from "@opencode-ai/plugin";
|
|
1948
|
+
var z34 = tool34.schema;
|
|
1760
1949
|
function createPointerDragTool(deps) {
|
|
1761
|
-
return
|
|
1950
|
+
return tool34({
|
|
1762
1951
|
description: "Drag the pointer between two viewport coordinates.",
|
|
1763
1952
|
args: {
|
|
1764
|
-
sessionId:
|
|
1765
|
-
targetId:
|
|
1766
|
-
fromX:
|
|
1767
|
-
fromY:
|
|
1768
|
-
toX:
|
|
1769
|
-
toY:
|
|
1770
|
-
steps:
|
|
1953
|
+
sessionId: z34.string().describe("Active browser session id"),
|
|
1954
|
+
targetId: z34.string().optional().describe("Optional target id"),
|
|
1955
|
+
fromX: z34.number().describe("Start x coordinate"),
|
|
1956
|
+
fromY: z34.number().describe("Start y coordinate"),
|
|
1957
|
+
toX: z34.number().describe("End x coordinate"),
|
|
1958
|
+
toY: z34.number().describe("End y coordinate"),
|
|
1959
|
+
steps: z34.number().int().positive().optional().describe("Optional drag interpolation step count")
|
|
1771
1960
|
},
|
|
1772
1961
|
async execute(args) {
|
|
1773
1962
|
try {
|
|
@@ -1787,16 +1976,16 @@ function createPointerDragTool(deps) {
|
|
|
1787
1976
|
}
|
|
1788
1977
|
|
|
1789
1978
|
// src/tools/dom_get_html.ts
|
|
1790
|
-
import { tool as
|
|
1791
|
-
var
|
|
1979
|
+
import { tool as tool35 } from "@opencode-ai/plugin";
|
|
1980
|
+
var z35 = tool35.schema;
|
|
1792
1981
|
function createDomGetHtmlTool(deps) {
|
|
1793
|
-
return
|
|
1982
|
+
return tool35({
|
|
1794
1983
|
description: "Get outerHTML for a referenced element.",
|
|
1795
1984
|
args: {
|
|
1796
|
-
sessionId:
|
|
1797
|
-
targetId:
|
|
1798
|
-
ref:
|
|
1799
|
-
maxChars:
|
|
1985
|
+
sessionId: z35.string().describe("Session id"),
|
|
1986
|
+
targetId: z35.string().optional().describe("Optional target id"),
|
|
1987
|
+
ref: z35.string().describe("Element ref"),
|
|
1988
|
+
maxChars: z35.number().int().optional().describe("Max characters")
|
|
1800
1989
|
},
|
|
1801
1990
|
async execute(args) {
|
|
1802
1991
|
try {
|
|
@@ -1819,16 +2008,16 @@ function createDomGetHtmlTool(deps) {
|
|
|
1819
2008
|
}
|
|
1820
2009
|
|
|
1821
2010
|
// src/tools/dom_get_text.ts
|
|
1822
|
-
import { tool as
|
|
1823
|
-
var
|
|
2011
|
+
import { tool as tool36 } from "@opencode-ai/plugin";
|
|
2012
|
+
var z36 = tool36.schema;
|
|
1824
2013
|
function createDomGetTextTool(deps) {
|
|
1825
|
-
return
|
|
2014
|
+
return tool36({
|
|
1826
2015
|
description: "Get inner text for a referenced element.",
|
|
1827
2016
|
args: {
|
|
1828
|
-
sessionId:
|
|
1829
|
-
targetId:
|
|
1830
|
-
ref:
|
|
1831
|
-
maxChars:
|
|
2017
|
+
sessionId: z36.string().describe("Session id"),
|
|
2018
|
+
targetId: z36.string().optional().describe("Optional target id"),
|
|
2019
|
+
ref: z36.string().describe("Element ref"),
|
|
2020
|
+
maxChars: z36.number().int().optional().describe("Max characters")
|
|
1832
2021
|
},
|
|
1833
2022
|
async execute(args) {
|
|
1834
2023
|
try {
|
|
@@ -1851,16 +2040,16 @@ function createDomGetTextTool(deps) {
|
|
|
1851
2040
|
}
|
|
1852
2041
|
|
|
1853
2042
|
// src/tools/get_attr.ts
|
|
1854
|
-
import { tool as
|
|
1855
|
-
var
|
|
2043
|
+
import { tool as tool37 } from "@opencode-ai/plugin";
|
|
2044
|
+
var z37 = tool37.schema;
|
|
1856
2045
|
function createGetAttrTool(deps) {
|
|
1857
|
-
return
|
|
2046
|
+
return tool37({
|
|
1858
2047
|
description: "Get a DOM attribute value by ref.",
|
|
1859
2048
|
args: {
|
|
1860
|
-
sessionId:
|
|
1861
|
-
targetId:
|
|
1862
|
-
ref:
|
|
1863
|
-
name:
|
|
2049
|
+
sessionId: z37.string().describe("Active browser session id"),
|
|
2050
|
+
targetId: z37.string().optional().describe("Optional target id"),
|
|
2051
|
+
ref: z37.string().describe("Element ref from snapshot"),
|
|
2052
|
+
name: z37.string().describe("Attribute name, e.g. href or aria-label")
|
|
1864
2053
|
},
|
|
1865
2054
|
async execute(args) {
|
|
1866
2055
|
try {
|
|
@@ -1874,15 +2063,15 @@ function createGetAttrTool(deps) {
|
|
|
1874
2063
|
}
|
|
1875
2064
|
|
|
1876
2065
|
// src/tools/get_value.ts
|
|
1877
|
-
import { tool as
|
|
1878
|
-
var
|
|
2066
|
+
import { tool as tool38 } from "@opencode-ai/plugin";
|
|
2067
|
+
var z38 = tool38.schema;
|
|
1879
2068
|
function createGetValueTool(deps) {
|
|
1880
|
-
return
|
|
2069
|
+
return tool38({
|
|
1881
2070
|
description: "Get the input value for an element by ref.",
|
|
1882
2071
|
args: {
|
|
1883
|
-
sessionId:
|
|
1884
|
-
targetId:
|
|
1885
|
-
ref:
|
|
2072
|
+
sessionId: z38.string().describe("Active browser session id"),
|
|
2073
|
+
targetId: z38.string().optional().describe("Optional target id"),
|
|
2074
|
+
ref: z38.string().describe("Element ref from snapshot")
|
|
1886
2075
|
},
|
|
1887
2076
|
async execute(args) {
|
|
1888
2077
|
try {
|
|
@@ -1896,15 +2085,15 @@ function createGetValueTool(deps) {
|
|
|
1896
2085
|
}
|
|
1897
2086
|
|
|
1898
2087
|
// src/tools/is_visible.ts
|
|
1899
|
-
import { tool as
|
|
1900
|
-
var
|
|
2088
|
+
import { tool as tool39 } from "@opencode-ai/plugin";
|
|
2089
|
+
var z39 = tool39.schema;
|
|
1901
2090
|
function createIsVisibleTool(deps) {
|
|
1902
|
-
return
|
|
2091
|
+
return tool39({
|
|
1903
2092
|
description: "Check if an element is visible by ref.",
|
|
1904
2093
|
args: {
|
|
1905
|
-
sessionId:
|
|
1906
|
-
targetId:
|
|
1907
|
-
ref:
|
|
2094
|
+
sessionId: z39.string().describe("Active browser session id"),
|
|
2095
|
+
targetId: z39.string().optional().describe("Optional target id"),
|
|
2096
|
+
ref: z39.string().describe("Element ref from snapshot")
|
|
1908
2097
|
},
|
|
1909
2098
|
async execute(args) {
|
|
1910
2099
|
try {
|
|
@@ -1918,15 +2107,15 @@ function createIsVisibleTool(deps) {
|
|
|
1918
2107
|
}
|
|
1919
2108
|
|
|
1920
2109
|
// src/tools/is_enabled.ts
|
|
1921
|
-
import { tool as
|
|
1922
|
-
var
|
|
2110
|
+
import { tool as tool40 } from "@opencode-ai/plugin";
|
|
2111
|
+
var z40 = tool40.schema;
|
|
1923
2112
|
function createIsEnabledTool(deps) {
|
|
1924
|
-
return
|
|
2113
|
+
return tool40({
|
|
1925
2114
|
description: "Check if an element is enabled by ref.",
|
|
1926
2115
|
args: {
|
|
1927
|
-
sessionId:
|
|
1928
|
-
targetId:
|
|
1929
|
-
ref:
|
|
2116
|
+
sessionId: z40.string().describe("Active browser session id"),
|
|
2117
|
+
targetId: z40.string().optional().describe("Optional target id"),
|
|
2118
|
+
ref: z40.string().describe("Element ref from snapshot")
|
|
1930
2119
|
},
|
|
1931
2120
|
async execute(args) {
|
|
1932
2121
|
try {
|
|
@@ -1940,15 +2129,15 @@ function createIsEnabledTool(deps) {
|
|
|
1940
2129
|
}
|
|
1941
2130
|
|
|
1942
2131
|
// src/tools/is_checked.ts
|
|
1943
|
-
import { tool as
|
|
1944
|
-
var
|
|
2132
|
+
import { tool as tool41 } from "@opencode-ai/plugin";
|
|
2133
|
+
var z41 = tool41.schema;
|
|
1945
2134
|
function createIsCheckedTool(deps) {
|
|
1946
|
-
return
|
|
2135
|
+
return tool41({
|
|
1947
2136
|
description: "Check if an element is checked by ref.",
|
|
1948
2137
|
args: {
|
|
1949
|
-
sessionId:
|
|
1950
|
-
targetId:
|
|
1951
|
-
ref:
|
|
2138
|
+
sessionId: z41.string().describe("Active browser session id"),
|
|
2139
|
+
targetId: z41.string().optional().describe("Optional target id"),
|
|
2140
|
+
ref: z41.string().describe("Element ref from snapshot")
|
|
1952
2141
|
},
|
|
1953
2142
|
async execute(args) {
|
|
1954
2143
|
try {
|
|
@@ -1962,20 +2151,20 @@ function createIsCheckedTool(deps) {
|
|
|
1962
2151
|
}
|
|
1963
2152
|
|
|
1964
2153
|
// src/tools/run.ts
|
|
1965
|
-
import { tool as
|
|
1966
|
-
var
|
|
1967
|
-
var stepSchema =
|
|
1968
|
-
action:
|
|
1969
|
-
args:
|
|
2154
|
+
import { tool as tool42 } from "@opencode-ai/plugin";
|
|
2155
|
+
var z42 = tool42.schema;
|
|
2156
|
+
var stepSchema = z42.object({
|
|
2157
|
+
action: z42.string().describe("Action name"),
|
|
2158
|
+
args: z42.record(z42.string(), z42.unknown()).optional().describe("Action arguments")
|
|
1970
2159
|
});
|
|
1971
2160
|
function createRunTool(deps) {
|
|
1972
|
-
return
|
|
2161
|
+
return tool42({
|
|
1973
2162
|
description: "Run multiple actions in a single tool call.",
|
|
1974
2163
|
args: {
|
|
1975
|
-
sessionId:
|
|
1976
|
-
steps:
|
|
1977
|
-
stopOnError:
|
|
1978
|
-
maxSnapshotChars:
|
|
2164
|
+
sessionId: z42.string().describe("Session id"),
|
|
2165
|
+
steps: z42.array(stepSchema).describe("Steps to execute"),
|
|
2166
|
+
stopOnError: z42.boolean().optional().describe("Stop when a step fails"),
|
|
2167
|
+
maxSnapshotChars: z42.number().int().optional().describe("Default maxChars for snapshot steps")
|
|
1979
2168
|
},
|
|
1980
2169
|
async execute(args) {
|
|
1981
2170
|
try {
|
|
@@ -2008,13 +2197,13 @@ function normalizeSteps(steps, maxSnapshotChars) {
|
|
|
2008
2197
|
}
|
|
2009
2198
|
|
|
2010
2199
|
// src/tools/prompting_guide.ts
|
|
2011
|
-
import { tool as
|
|
2012
|
-
var
|
|
2200
|
+
import { tool as tool43 } from "@opencode-ai/plugin";
|
|
2201
|
+
var z43 = tool43.schema;
|
|
2013
2202
|
function createPromptingGuideTool(deps) {
|
|
2014
|
-
return
|
|
2203
|
+
return tool43({
|
|
2015
2204
|
description: `Start here for first-contact OpenDevBrowser guidance, including ${onboarding_metadata_default.skillName} ${onboarding_metadata_default.skillTopic}.`,
|
|
2016
2205
|
args: {
|
|
2017
|
-
topic:
|
|
2206
|
+
topic: z43.string().optional().describe("Optional topic for guidance")
|
|
2018
2207
|
},
|
|
2019
2208
|
async execute(args) {
|
|
2020
2209
|
try {
|
|
@@ -2028,15 +2217,15 @@ function createPromptingGuideTool(deps) {
|
|
|
2028
2217
|
}
|
|
2029
2218
|
|
|
2030
2219
|
// src/tools/console_poll.ts
|
|
2031
|
-
import { tool as
|
|
2032
|
-
var
|
|
2220
|
+
import { tool as tool44 } from "@opencode-ai/plugin";
|
|
2221
|
+
var z44 = tool44.schema;
|
|
2033
2222
|
function createConsolePollTool(deps) {
|
|
2034
|
-
return
|
|
2223
|
+
return tool44({
|
|
2035
2224
|
description: "Poll console events for the active target.",
|
|
2036
2225
|
args: {
|
|
2037
|
-
sessionId:
|
|
2038
|
-
sinceSeq:
|
|
2039
|
-
max:
|
|
2226
|
+
sessionId: z44.string().describe("Session id"),
|
|
2227
|
+
sinceSeq: z44.number().int().optional().describe("Sequence to resume from"),
|
|
2228
|
+
max: z44.number().int().optional().describe("Max events to return")
|
|
2040
2229
|
},
|
|
2041
2230
|
async execute(args) {
|
|
2042
2231
|
try {
|
|
@@ -2054,15 +2243,15 @@ function createConsolePollTool(deps) {
|
|
|
2054
2243
|
}
|
|
2055
2244
|
|
|
2056
2245
|
// src/tools/network_poll.ts
|
|
2057
|
-
import { tool as
|
|
2058
|
-
var
|
|
2246
|
+
import { tool as tool45 } from "@opencode-ai/plugin";
|
|
2247
|
+
var z45 = tool45.schema;
|
|
2059
2248
|
function createNetworkPollTool(deps) {
|
|
2060
|
-
return
|
|
2249
|
+
return tool45({
|
|
2061
2250
|
description: "Poll network events for the active target.",
|
|
2062
2251
|
args: {
|
|
2063
|
-
sessionId:
|
|
2064
|
-
sinceSeq:
|
|
2065
|
-
max:
|
|
2252
|
+
sessionId: z45.string().describe("Session id"),
|
|
2253
|
+
sinceSeq: z45.number().int().optional().describe("Sequence to resume from"),
|
|
2254
|
+
max: z45.number().int().optional().describe("Max events to return")
|
|
2066
2255
|
},
|
|
2067
2256
|
async execute(args) {
|
|
2068
2257
|
try {
|
|
@@ -2080,18 +2269,18 @@ function createNetworkPollTool(deps) {
|
|
|
2080
2269
|
}
|
|
2081
2270
|
|
|
2082
2271
|
// src/tools/debug_trace_snapshot.ts
|
|
2083
|
-
import { tool as
|
|
2084
|
-
var
|
|
2272
|
+
import { tool as tool46 } from "@opencode-ai/plugin";
|
|
2273
|
+
var z46 = tool46.schema;
|
|
2085
2274
|
function createDebugTraceSnapshotTool(deps) {
|
|
2086
|
-
return
|
|
2275
|
+
return tool46({
|
|
2087
2276
|
description: "Capture a combined debug trace snapshot (page + console + network + exceptions).",
|
|
2088
2277
|
args: {
|
|
2089
|
-
sessionId:
|
|
2090
|
-
sinceConsoleSeq:
|
|
2091
|
-
sinceNetworkSeq:
|
|
2092
|
-
sinceExceptionSeq:
|
|
2093
|
-
max:
|
|
2094
|
-
requestId:
|
|
2278
|
+
sessionId: z46.string().describe("Session id"),
|
|
2279
|
+
sinceConsoleSeq: z46.number().int().optional().describe("Resume cursor for console events"),
|
|
2280
|
+
sinceNetworkSeq: z46.number().int().optional().describe("Resume cursor for network events"),
|
|
2281
|
+
sinceExceptionSeq: z46.number().int().optional().describe("Resume cursor for exception events"),
|
|
2282
|
+
max: z46.number().int().optional().describe("Max events per channel"),
|
|
2283
|
+
requestId: z46.string().optional().describe("Optional trace request id")
|
|
2095
2284
|
},
|
|
2096
2285
|
async execute(args) {
|
|
2097
2286
|
try {
|
|
@@ -2201,8 +2390,8 @@ function extractHosts(events) {
|
|
|
2201
2390
|
}
|
|
2202
2391
|
|
|
2203
2392
|
// src/tools/cookie_import.ts
|
|
2204
|
-
import { tool as
|
|
2205
|
-
var
|
|
2393
|
+
import { tool as tool47 } from "@opencode-ai/plugin";
|
|
2394
|
+
var z47 = tool47.schema;
|
|
2206
2395
|
function validateCookieRecord(cookie) {
|
|
2207
2396
|
const name = cookie.name?.trim();
|
|
2208
2397
|
if (!name) {
|
|
@@ -2281,23 +2470,23 @@ function validateCookieRecord(cookie) {
|
|
|
2281
2470
|
};
|
|
2282
2471
|
}
|
|
2283
2472
|
function createCookieImportTool(deps) {
|
|
2284
|
-
return
|
|
2473
|
+
return tool47({
|
|
2285
2474
|
description: "Import validated cookies into the current session context.",
|
|
2286
2475
|
args: {
|
|
2287
|
-
sessionId:
|
|
2288
|
-
cookies:
|
|
2289
|
-
name:
|
|
2290
|
-
value:
|
|
2291
|
-
url:
|
|
2292
|
-
domain:
|
|
2293
|
-
path:
|
|
2294
|
-
expires:
|
|
2295
|
-
httpOnly:
|
|
2296
|
-
secure:
|
|
2297
|
-
sameSite:
|
|
2476
|
+
sessionId: z47.string().describe("Session id"),
|
|
2477
|
+
cookies: z47.array(z47.object({
|
|
2478
|
+
name: z47.string().min(1),
|
|
2479
|
+
value: z47.string(),
|
|
2480
|
+
url: z47.string().optional(),
|
|
2481
|
+
domain: z47.string().optional(),
|
|
2482
|
+
path: z47.string().optional(),
|
|
2483
|
+
expires: z47.number().optional(),
|
|
2484
|
+
httpOnly: z47.boolean().optional(),
|
|
2485
|
+
secure: z47.boolean().optional(),
|
|
2486
|
+
sameSite: z47.enum(["Strict", "Lax", "None"]).optional()
|
|
2298
2487
|
})).min(1).describe("Cookies to import"),
|
|
2299
|
-
strict:
|
|
2300
|
-
requestId:
|
|
2488
|
+
strict: z47.boolean().optional().describe("Reject on first invalid cookie (default true)"),
|
|
2489
|
+
requestId: z47.string().optional().describe("Optional trace request id")
|
|
2301
2490
|
},
|
|
2302
2491
|
async execute(args) {
|
|
2303
2492
|
try {
|
|
@@ -2339,8 +2528,8 @@ function createCookieImportTool(deps) {
|
|
|
2339
2528
|
}
|
|
2340
2529
|
|
|
2341
2530
|
// src/tools/cookie_list.ts
|
|
2342
|
-
import { tool as
|
|
2343
|
-
var
|
|
2531
|
+
import { tool as tool48 } from "@opencode-ai/plugin";
|
|
2532
|
+
var z48 = tool48.schema;
|
|
2344
2533
|
function normalizeCookieUrls(urls) {
|
|
2345
2534
|
if (!urls || urls.length === 0) {
|
|
2346
2535
|
return void 0;
|
|
@@ -2371,12 +2560,12 @@ function normalizeCookieUrls(urls) {
|
|
|
2371
2560
|
return normalized;
|
|
2372
2561
|
}
|
|
2373
2562
|
function createCookieListTool(deps) {
|
|
2374
|
-
return
|
|
2563
|
+
return tool48({
|
|
2375
2564
|
description: "List cookies in the current session context with optional URL filtering.",
|
|
2376
2565
|
args: {
|
|
2377
|
-
sessionId:
|
|
2378
|
-
urls:
|
|
2379
|
-
requestId:
|
|
2566
|
+
sessionId: z48.string().describe("Session id"),
|
|
2567
|
+
urls: z48.array(z48.string().min(1)).optional().describe("Optional URL filters for cookie scoping"),
|
|
2568
|
+
requestId: z48.string().optional().describe("Optional trace request id")
|
|
2380
2569
|
},
|
|
2381
2570
|
async execute(args) {
|
|
2382
2571
|
try {
|
|
@@ -2416,7 +2605,7 @@ function createCookieListTool(deps) {
|
|
|
2416
2605
|
}
|
|
2417
2606
|
|
|
2418
2607
|
// src/tools/macro_resolve.ts
|
|
2419
|
-
import { tool as
|
|
2608
|
+
import { tool as tool49 } from "@opencode-ai/plugin";
|
|
2420
2609
|
|
|
2421
2610
|
// src/tools/workflow-runtime.ts
|
|
2422
2611
|
var resolveProviderRuntime = async (deps, options) => {
|
|
@@ -2430,7 +2619,7 @@ var resolveProviderRuntime = async (deps, options) => {
|
|
|
2430
2619
|
};
|
|
2431
2620
|
|
|
2432
2621
|
// src/tools/macro_resolve.ts
|
|
2433
|
-
var
|
|
2622
|
+
var z49 = tool49.schema;
|
|
2434
2623
|
async function loadMacroRuntime() {
|
|
2435
2624
|
try {
|
|
2436
2625
|
const module = await import("./macros-ND2M7LWU.js");
|
|
@@ -2478,13 +2667,13 @@ function parseFallbackMacro(expression, defaultProvider) {
|
|
|
2478
2667
|
};
|
|
2479
2668
|
}
|
|
2480
2669
|
function createMacroResolveTool(deps) {
|
|
2481
|
-
return
|
|
2670
|
+
return tool49({
|
|
2482
2671
|
description: "Resolve a macro expression to a provider action with provenance metadata.",
|
|
2483
2672
|
args: {
|
|
2484
|
-
expression:
|
|
2485
|
-
defaultProvider:
|
|
2486
|
-
includeCatalog:
|
|
2487
|
-
execute:
|
|
2673
|
+
expression: z49.string().min(2).describe('Macro expression, e.g. @web.search("query")'),
|
|
2674
|
+
defaultProvider: z49.string().optional().describe("Default provider fallback"),
|
|
2675
|
+
includeCatalog: z49.boolean().optional().describe("Include available runtime macro names"),
|
|
2676
|
+
execute: z49.boolean().optional().describe("Execute the resolved provider action and include execution payload")
|
|
2488
2677
|
},
|
|
2489
2678
|
async execute(args) {
|
|
2490
2679
|
try {
|
|
@@ -2532,14 +2721,14 @@ function createMacroResolveTool(deps) {
|
|
|
2532
2721
|
}
|
|
2533
2722
|
|
|
2534
2723
|
// src/tools/clone_page.ts
|
|
2535
|
-
import { tool as
|
|
2536
|
-
var
|
|
2724
|
+
import { tool as tool50 } from "@opencode-ai/plugin";
|
|
2725
|
+
var z50 = tool50.schema;
|
|
2537
2726
|
function createClonePageTool(deps) {
|
|
2538
|
-
return
|
|
2727
|
+
return tool50({
|
|
2539
2728
|
description: "Export the active page as a React component and CSS bundle.",
|
|
2540
2729
|
args: {
|
|
2541
|
-
sessionId:
|
|
2542
|
-
targetId:
|
|
2730
|
+
sessionId: z50.string().describe("Active browser session id"),
|
|
2731
|
+
targetId: z50.string().optional().describe("Optional target id")
|
|
2543
2732
|
},
|
|
2544
2733
|
async execute(args) {
|
|
2545
2734
|
try {
|
|
@@ -2553,15 +2742,15 @@ function createClonePageTool(deps) {
|
|
|
2553
2742
|
}
|
|
2554
2743
|
|
|
2555
2744
|
// src/tools/clone_component.ts
|
|
2556
|
-
import { tool as
|
|
2557
|
-
var
|
|
2745
|
+
import { tool as tool51 } from "@opencode-ai/plugin";
|
|
2746
|
+
var z51 = tool51.schema;
|
|
2558
2747
|
function createCloneComponentTool(deps) {
|
|
2559
|
-
return
|
|
2748
|
+
return tool51({
|
|
2560
2749
|
description: "Export a selected element subtree as a React component and CSS bundle.",
|
|
2561
2750
|
args: {
|
|
2562
|
-
sessionId:
|
|
2563
|
-
targetId:
|
|
2564
|
-
ref:
|
|
2751
|
+
sessionId: z51.string().describe("Active browser session id"),
|
|
2752
|
+
targetId: z51.string().optional().describe("Optional target id"),
|
|
2753
|
+
ref: z51.string().describe("Element ref from snapshot")
|
|
2565
2754
|
},
|
|
2566
2755
|
async execute(args) {
|
|
2567
2756
|
try {
|
|
@@ -2575,14 +2764,14 @@ function createCloneComponentTool(deps) {
|
|
|
2575
2764
|
}
|
|
2576
2765
|
|
|
2577
2766
|
// src/tools/perf.ts
|
|
2578
|
-
import { tool as
|
|
2579
|
-
var
|
|
2767
|
+
import { tool as tool52 } from "@opencode-ai/plugin";
|
|
2768
|
+
var z52 = tool52.schema;
|
|
2580
2769
|
function createPerfTool(deps) {
|
|
2581
|
-
return
|
|
2770
|
+
return tool52({
|
|
2582
2771
|
description: "Fetch lightweight performance metrics from the active page.",
|
|
2583
2772
|
args: {
|
|
2584
|
-
sessionId:
|
|
2585
|
-
targetId:
|
|
2773
|
+
sessionId: z52.string().describe("Active browser session id"),
|
|
2774
|
+
targetId: z52.string().optional().describe("Optional target id")
|
|
2586
2775
|
},
|
|
2587
2776
|
async execute(args) {
|
|
2588
2777
|
try {
|
|
@@ -2596,17 +2785,17 @@ function createPerfTool(deps) {
|
|
|
2596
2785
|
}
|
|
2597
2786
|
|
|
2598
2787
|
// src/tools/screenshot.ts
|
|
2599
|
-
import { tool as
|
|
2600
|
-
var
|
|
2788
|
+
import { tool as tool53 } from "@opencode-ai/plugin";
|
|
2789
|
+
var z53 = tool53.schema;
|
|
2601
2790
|
function createScreenshotTool(deps) {
|
|
2602
|
-
return
|
|
2791
|
+
return tool53({
|
|
2603
2792
|
description: "Capture a screenshot of the active page.",
|
|
2604
2793
|
args: {
|
|
2605
|
-
sessionId:
|
|
2606
|
-
targetId:
|
|
2607
|
-
path:
|
|
2608
|
-
ref:
|
|
2609
|
-
fullPage:
|
|
2794
|
+
sessionId: z53.string().describe("Active browser session id"),
|
|
2795
|
+
targetId: z53.string().optional().describe("Optional target id"),
|
|
2796
|
+
path: z53.string().optional().describe("Optional output file path"),
|
|
2797
|
+
ref: z53.string().optional().describe("Optional snapshot ref for an element capture"),
|
|
2798
|
+
fullPage: z53.boolean().optional().describe("Capture the full scrollable page")
|
|
2610
2799
|
},
|
|
2611
2800
|
async execute(args) {
|
|
2612
2801
|
try {
|
|
@@ -2625,17 +2814,17 @@ function createScreenshotTool(deps) {
|
|
|
2625
2814
|
}
|
|
2626
2815
|
|
|
2627
2816
|
// src/tools/screencast_start.ts
|
|
2628
|
-
import { tool as
|
|
2629
|
-
var
|
|
2817
|
+
import { tool as tool54 } from "@opencode-ai/plugin";
|
|
2818
|
+
var z54 = tool54.schema;
|
|
2630
2819
|
function createScreencastStartTool(deps) {
|
|
2631
|
-
return
|
|
2820
|
+
return tool54({
|
|
2632
2821
|
description: "Start a browser screencast replay capture.",
|
|
2633
2822
|
args: {
|
|
2634
|
-
sessionId:
|
|
2635
|
-
targetId:
|
|
2636
|
-
outputDir:
|
|
2637
|
-
intervalMs:
|
|
2638
|
-
maxFrames:
|
|
2823
|
+
sessionId: z54.string().describe("Active browser session id"),
|
|
2824
|
+
targetId: z54.string().optional().describe("Optional target id"),
|
|
2825
|
+
outputDir: z54.string().optional().describe("Optional screencast output directory"),
|
|
2826
|
+
intervalMs: z54.number().int().min(250).optional().describe("Frame capture interval in milliseconds"),
|
|
2827
|
+
maxFrames: z54.number().int().min(1).optional().describe("Maximum frame count before auto-stop")
|
|
2639
2828
|
},
|
|
2640
2829
|
async execute(args) {
|
|
2641
2830
|
try {
|
|
@@ -2654,14 +2843,14 @@ function createScreencastStartTool(deps) {
|
|
|
2654
2843
|
}
|
|
2655
2844
|
|
|
2656
2845
|
// src/tools/screencast_stop.ts
|
|
2657
|
-
import { tool as
|
|
2658
|
-
var
|
|
2846
|
+
import { tool as tool55 } from "@opencode-ai/plugin";
|
|
2847
|
+
var z55 = tool55.schema;
|
|
2659
2848
|
function createScreencastStopTool(deps) {
|
|
2660
|
-
return
|
|
2849
|
+
return tool55({
|
|
2661
2850
|
description: "Stop a browser screencast replay capture.",
|
|
2662
2851
|
args: {
|
|
2663
|
-
sessionId:
|
|
2664
|
-
screencastId:
|
|
2852
|
+
sessionId: z55.string().describe("Browser session id that owns the screencast"),
|
|
2853
|
+
screencastId: z55.string().describe("Active screencast id")
|
|
2665
2854
|
},
|
|
2666
2855
|
async execute(args) {
|
|
2667
2856
|
try {
|
|
@@ -2675,16 +2864,16 @@ function createScreencastStopTool(deps) {
|
|
|
2675
2864
|
}
|
|
2676
2865
|
|
|
2677
2866
|
// src/tools/dialog.ts
|
|
2678
|
-
import { tool as
|
|
2679
|
-
var
|
|
2867
|
+
import { tool as tool56 } from "@opencode-ai/plugin";
|
|
2868
|
+
var z56 = tool56.schema;
|
|
2680
2869
|
function createDialogTool(deps) {
|
|
2681
|
-
return
|
|
2870
|
+
return tool56({
|
|
2682
2871
|
description: "Inspect or handle a JavaScript dialog.",
|
|
2683
2872
|
args: {
|
|
2684
|
-
sessionId:
|
|
2685
|
-
targetId:
|
|
2686
|
-
action:
|
|
2687
|
-
promptText:
|
|
2873
|
+
sessionId: z56.string().describe("Active browser session id"),
|
|
2874
|
+
targetId: z56.string().optional().describe("Optional target id"),
|
|
2875
|
+
action: z56.enum(["status", "accept", "dismiss"]).optional().describe("Dialog action"),
|
|
2876
|
+
promptText: z56.string().optional().describe("Prompt text to submit when accepting a prompt dialog")
|
|
2688
2877
|
},
|
|
2689
2878
|
async execute(args) {
|
|
2690
2879
|
try {
|
|
@@ -2702,7 +2891,7 @@ function createDialogTool(deps) {
|
|
|
2702
2891
|
}
|
|
2703
2892
|
|
|
2704
2893
|
// src/tools/desktop_status.ts
|
|
2705
|
-
import { tool as
|
|
2894
|
+
import { tool as tool57 } from "@opencode-ai/plugin";
|
|
2706
2895
|
|
|
2707
2896
|
// src/tools/desktop-shared.ts
|
|
2708
2897
|
function isRecord(value) {
|
|
@@ -2732,7 +2921,7 @@ function desktopToolFailure(error, code) {
|
|
|
2732
2921
|
|
|
2733
2922
|
// src/tools/desktop_status.ts
|
|
2734
2923
|
function createDesktopStatusTool(deps) {
|
|
2735
|
-
return
|
|
2924
|
+
return tool57({
|
|
2736
2925
|
description: "Inspect sibling desktop observation availability.",
|
|
2737
2926
|
args: {},
|
|
2738
2927
|
async execute() {
|
|
@@ -2750,13 +2939,13 @@ function createDesktopStatusTool(deps) {
|
|
|
2750
2939
|
}
|
|
2751
2940
|
|
|
2752
2941
|
// src/tools/desktop_windows.ts
|
|
2753
|
-
import { tool as
|
|
2754
|
-
var
|
|
2942
|
+
import { tool as tool58 } from "@opencode-ai/plugin";
|
|
2943
|
+
var z57 = tool58.schema;
|
|
2755
2944
|
function createDesktopWindowsTool(deps) {
|
|
2756
|
-
return
|
|
2945
|
+
return tool58({
|
|
2757
2946
|
description: "List observable desktop windows.",
|
|
2758
2947
|
args: {
|
|
2759
|
-
reason:
|
|
2948
|
+
reason: z57.string().optional().describe("Optional audit reason")
|
|
2760
2949
|
},
|
|
2761
2950
|
async execute(args) {
|
|
2762
2951
|
const runtime = requireDesktopRuntime(deps);
|
|
@@ -2773,13 +2962,13 @@ function createDesktopWindowsTool(deps) {
|
|
|
2773
2962
|
}
|
|
2774
2963
|
|
|
2775
2964
|
// src/tools/desktop_active_window.ts
|
|
2776
|
-
import { tool as
|
|
2777
|
-
var
|
|
2965
|
+
import { tool as tool59 } from "@opencode-ai/plugin";
|
|
2966
|
+
var z58 = tool59.schema;
|
|
2778
2967
|
function createDesktopActiveWindowTool(deps) {
|
|
2779
|
-
return
|
|
2968
|
+
return tool59({
|
|
2780
2969
|
description: "Inspect the active desktop window.",
|
|
2781
2970
|
args: {
|
|
2782
|
-
reason:
|
|
2971
|
+
reason: z58.string().optional().describe("Optional audit reason")
|
|
2783
2972
|
},
|
|
2784
2973
|
async execute(args) {
|
|
2785
2974
|
const runtime = requireDesktopRuntime(deps);
|
|
@@ -2796,13 +2985,13 @@ function createDesktopActiveWindowTool(deps) {
|
|
|
2796
2985
|
}
|
|
2797
2986
|
|
|
2798
2987
|
// src/tools/desktop_capture_desktop.ts
|
|
2799
|
-
import { tool as
|
|
2800
|
-
var
|
|
2988
|
+
import { tool as tool60 } from "@opencode-ai/plugin";
|
|
2989
|
+
var z59 = tool60.schema;
|
|
2801
2990
|
function createDesktopCaptureDesktopTool(deps) {
|
|
2802
|
-
return
|
|
2991
|
+
return tool60({
|
|
2803
2992
|
description: "Capture the current desktop surface.",
|
|
2804
2993
|
args: {
|
|
2805
|
-
reason:
|
|
2994
|
+
reason: z59.string().describe("Audit reason for the capture")
|
|
2806
2995
|
},
|
|
2807
2996
|
async execute(args) {
|
|
2808
2997
|
const runtime = requireDesktopRuntime(deps);
|
|
@@ -2819,14 +3008,14 @@ function createDesktopCaptureDesktopTool(deps) {
|
|
|
2819
3008
|
}
|
|
2820
3009
|
|
|
2821
3010
|
// src/tools/desktop_capture_window.ts
|
|
2822
|
-
import { tool as
|
|
2823
|
-
var
|
|
3011
|
+
import { tool as tool61 } from "@opencode-ai/plugin";
|
|
3012
|
+
var z60 = tool61.schema;
|
|
2824
3013
|
function createDesktopCaptureWindowTool(deps) {
|
|
2825
|
-
return
|
|
3014
|
+
return tool61({
|
|
2826
3015
|
description: "Capture a specific desktop window.",
|
|
2827
3016
|
args: {
|
|
2828
|
-
windowId:
|
|
2829
|
-
reason:
|
|
3017
|
+
windowId: z60.string().describe("Desktop window id"),
|
|
3018
|
+
reason: z60.string().describe("Audit reason for the capture")
|
|
2830
3019
|
},
|
|
2831
3020
|
async execute(args) {
|
|
2832
3021
|
const runtime = requireDesktopRuntime(deps);
|
|
@@ -2843,14 +3032,14 @@ function createDesktopCaptureWindowTool(deps) {
|
|
|
2843
3032
|
}
|
|
2844
3033
|
|
|
2845
3034
|
// src/tools/desktop_accessibility_snapshot.ts
|
|
2846
|
-
import { tool as
|
|
2847
|
-
var
|
|
3035
|
+
import { tool as tool62 } from "@opencode-ai/plugin";
|
|
3036
|
+
var z61 = tool62.schema;
|
|
2848
3037
|
function createDesktopAccessibilitySnapshotTool(deps) {
|
|
2849
|
-
return
|
|
3038
|
+
return tool62({
|
|
2850
3039
|
description: "Capture desktop accessibility state.",
|
|
2851
3040
|
args: {
|
|
2852
|
-
reason:
|
|
2853
|
-
windowId:
|
|
3041
|
+
reason: z61.string().describe("Audit reason for the accessibility snapshot"),
|
|
3042
|
+
windowId: z61.string().optional().describe("Optional desktop window id")
|
|
2854
3043
|
},
|
|
2855
3044
|
async execute(args) {
|
|
2856
3045
|
const runtime = requireDesktopRuntime(deps);
|
|
@@ -2867,25 +3056,25 @@ function createDesktopAccessibilitySnapshotTool(deps) {
|
|
|
2867
3056
|
}
|
|
2868
3057
|
|
|
2869
3058
|
// src/tools/annotate.ts
|
|
2870
|
-
import { tool as
|
|
2871
|
-
var
|
|
2872
|
-
var screenshotModeSchema =
|
|
2873
|
-
var transportSchema =
|
|
3059
|
+
import { tool as tool63 } from "@opencode-ai/plugin";
|
|
3060
|
+
var z62 = tool63.schema;
|
|
3061
|
+
var screenshotModeSchema = z62.enum(["visible", "full", "none"]);
|
|
3062
|
+
var transportSchema = z62.enum(["auto", "direct", "relay"]);
|
|
2874
3063
|
function createAnnotateTool(deps) {
|
|
2875
|
-
return
|
|
3064
|
+
return tool63({
|
|
2876
3065
|
description: "Request interactive annotations via direct (CDP) or relay transport.",
|
|
2877
3066
|
args: {
|
|
2878
|
-
sessionId:
|
|
2879
|
-
stored:
|
|
2880
|
-
includeScreenshots:
|
|
3067
|
+
sessionId: z62.string().describe("Session id"),
|
|
3068
|
+
stored: z62.boolean().optional().describe("Fetch the latest payload explicitly sent from popup/canvas surfaces"),
|
|
3069
|
+
includeScreenshots: z62.boolean().optional().describe("When fetching stored payloads, prefer screenshots if still available in memory"),
|
|
2881
3070
|
transport: transportSchema.optional().describe("auto | direct | relay (default: auto)"),
|
|
2882
|
-
targetId:
|
|
2883
|
-
tabId:
|
|
2884
|
-
url:
|
|
3071
|
+
targetId: z62.string().optional().describe("Optional target id for direct mode"),
|
|
3072
|
+
tabId: z62.number().int().optional().describe("Optional Chrome tab id for relay mode"),
|
|
3073
|
+
url: z62.string().optional().describe("Optional URL to open before annotating"),
|
|
2885
3074
|
screenshotMode: screenshotModeSchema.optional().describe("visible | full | none (default: visible)"),
|
|
2886
|
-
debug:
|
|
2887
|
-
context:
|
|
2888
|
-
timeoutMs:
|
|
3075
|
+
debug: z62.boolean().optional().describe("Include debug metadata"),
|
|
3076
|
+
context: z62.string().optional().describe("Optional context for the annotator"),
|
|
3077
|
+
timeoutMs: z62.number().int().optional().describe("Timeout in milliseconds")
|
|
2889
3078
|
},
|
|
2890
3079
|
async execute(args) {
|
|
2891
3080
|
try {
|
|
@@ -2934,36 +3123,36 @@ function createAnnotateTool(deps) {
|
|
|
2934
3123
|
}
|
|
2935
3124
|
|
|
2936
3125
|
// src/tools/research_run.ts
|
|
2937
|
-
import { tool as
|
|
2938
|
-
var
|
|
2939
|
-
var sourceSelectionSchema =
|
|
2940
|
-
var sourceSchema =
|
|
2941
|
-
var modeSchema =
|
|
2942
|
-
var cookiePolicySchema =
|
|
2943
|
-
var
|
|
3126
|
+
import { tool as tool64 } from "@opencode-ai/plugin";
|
|
3127
|
+
var z63 = tool64.schema;
|
|
3128
|
+
var sourceSelectionSchema = z63.enum(["auto", "web", "community", "social", "shopping", "all"]);
|
|
3129
|
+
var sourceSchema = z63.enum(["web", "community", "social", "shopping"]);
|
|
3130
|
+
var modeSchema = z63.enum(["compact", "json", "md", "context", "path"]);
|
|
3131
|
+
var cookiePolicySchema = z63.enum(["off", "auto", "required"]);
|
|
3132
|
+
var challengeAutomationModeSchema4 = z63.enum(CHALLENGE_AUTOMATION_MODES);
|
|
2944
3133
|
function createResearchRunTool(deps) {
|
|
2945
|
-
return
|
|
3134
|
+
return tool64({
|
|
2946
3135
|
description: "Run cross-source research with strict timebox and artifact outputs.",
|
|
2947
3136
|
args: {
|
|
2948
|
-
topic:
|
|
2949
|
-
days:
|
|
2950
|
-
from:
|
|
2951
|
-
to:
|
|
3137
|
+
topic: z63.string().min(1).describe("Research topic"),
|
|
3138
|
+
days: z63.number().int().positive().optional().describe("Timebox in days"),
|
|
3139
|
+
from: z63.string().optional().describe("ISO start date"),
|
|
3140
|
+
to: z63.string().optional().describe("ISO end date"),
|
|
2952
3141
|
sourceSelection: sourceSelectionSchema.optional().describe("auto|web|community|social|shopping|all"),
|
|
2953
|
-
sources:
|
|
3142
|
+
sources: z63.array(sourceSchema).optional().describe("Explicit source list"),
|
|
2954
3143
|
mode: modeSchema.optional().describe("compact|json|md|context|path"),
|
|
2955
|
-
includeEngagement:
|
|
2956
|
-
limitPerSource:
|
|
2957
|
-
outputDir:
|
|
2958
|
-
ttlHours:
|
|
2959
|
-
useCookies:
|
|
2960
|
-
challengeAutomationMode:
|
|
3144
|
+
includeEngagement: z63.boolean().optional().describe("Include engagement enrichment"),
|
|
3145
|
+
limitPerSource: z63.number().int().positive().optional().describe("Result limit per source"),
|
|
3146
|
+
outputDir: z63.string().optional().describe("Optional artifact output directory"),
|
|
3147
|
+
ttlHours: z63.number().int().positive().optional().describe("Artifact retention TTL in hours"),
|
|
3148
|
+
useCookies: z63.boolean().optional().describe("Enable/disable provider cookie injection for this run"),
|
|
3149
|
+
challengeAutomationMode: challengeAutomationModeSchema4.optional().describe("Challenge automation mode: off|browser|browser_with_helper"),
|
|
2961
3150
|
cookiePolicyOverride: cookiePolicySchema.optional().describe("Override cookie policy: off|auto|required")
|
|
2962
3151
|
},
|
|
2963
3152
|
async execute(args) {
|
|
2964
3153
|
try {
|
|
2965
3154
|
const runtime = await resolveProviderRuntime(deps);
|
|
2966
|
-
const { runResearchWorkflow } = await import("./providers-
|
|
3155
|
+
const { runResearchWorkflow } = await import("./providers-ZIVHHH4F.js");
|
|
2967
3156
|
const result = await runResearchWorkflow(runtime, {
|
|
2968
3157
|
topic: args.topic,
|
|
2969
3158
|
days: args.days,
|
|
@@ -2989,32 +3178,32 @@ function createResearchRunTool(deps) {
|
|
|
2989
3178
|
}
|
|
2990
3179
|
|
|
2991
3180
|
// src/tools/shopping_run.ts
|
|
2992
|
-
import { tool as
|
|
2993
|
-
var
|
|
2994
|
-
var sortSchema =
|
|
2995
|
-
var modeSchema2 =
|
|
2996
|
-
var cookiePolicySchema2 =
|
|
2997
|
-
var
|
|
3181
|
+
import { tool as tool65 } from "@opencode-ai/plugin";
|
|
3182
|
+
var z64 = tool65.schema;
|
|
3183
|
+
var sortSchema = z64.enum(["best_deal", "lowest_price", "highest_rating", "fastest_shipping"]);
|
|
3184
|
+
var modeSchema2 = z64.enum(["compact", "json", "md", "context", "path"]);
|
|
3185
|
+
var cookiePolicySchema2 = z64.enum(["off", "auto", "required"]);
|
|
3186
|
+
var challengeAutomationModeSchema5 = z64.enum(CHALLENGE_AUTOMATION_MODES);
|
|
2998
3187
|
function createShoppingRunTool(deps) {
|
|
2999
|
-
return
|
|
3188
|
+
return tool65({
|
|
3000
3189
|
description: "Run shopping/deal intelligence across shopping providers.",
|
|
3001
3190
|
args: {
|
|
3002
|
-
query:
|
|
3003
|
-
providers:
|
|
3004
|
-
budget:
|
|
3005
|
-
region:
|
|
3191
|
+
query: z64.string().min(1).describe("Shopping query"),
|
|
3192
|
+
providers: z64.array(z64.string()).optional().describe("Optional provider allow-list"),
|
|
3193
|
+
budget: z64.number().positive().optional().describe("Optional budget amount"),
|
|
3194
|
+
region: z64.string().optional().describe("Region hint"),
|
|
3006
3195
|
sort: sortSchema.optional().describe("best_deal|lowest_price|highest_rating|fastest_shipping"),
|
|
3007
3196
|
mode: modeSchema2.optional().describe("compact|json|md|context|path"),
|
|
3008
|
-
outputDir:
|
|
3009
|
-
ttlHours:
|
|
3010
|
-
useCookies:
|
|
3011
|
-
challengeAutomationMode:
|
|
3197
|
+
outputDir: z64.string().optional().describe("Optional artifact output directory"),
|
|
3198
|
+
ttlHours: z64.number().int().positive().optional().describe("Artifact retention TTL in hours"),
|
|
3199
|
+
useCookies: z64.boolean().optional().describe("Enable/disable provider cookie injection for this run"),
|
|
3200
|
+
challengeAutomationMode: challengeAutomationModeSchema5.optional().describe("Challenge automation mode: off|browser|browser_with_helper"),
|
|
3012
3201
|
cookiePolicyOverride: cookiePolicySchema2.optional().describe("Override cookie policy: off|auto|required")
|
|
3013
3202
|
},
|
|
3014
3203
|
async execute(args) {
|
|
3015
3204
|
try {
|
|
3016
3205
|
const runtime = await resolveProviderRuntime(deps);
|
|
3017
|
-
const { runShoppingWorkflow } = await import("./providers-
|
|
3206
|
+
const { runShoppingWorkflow } = await import("./providers-ZIVHHH4F.js");
|
|
3018
3207
|
const result = await runShoppingWorkflow(runtime, {
|
|
3019
3208
|
query: args.query,
|
|
3020
3209
|
providers: args.providers,
|
|
@@ -3037,10 +3226,10 @@ function createShoppingRunTool(deps) {
|
|
|
3037
3226
|
}
|
|
3038
3227
|
|
|
3039
3228
|
// src/tools/product_video_run.ts
|
|
3040
|
-
import { tool as
|
|
3041
|
-
var
|
|
3042
|
-
var cookiePolicySchema3 =
|
|
3043
|
-
var
|
|
3229
|
+
import { tool as tool66 } from "@opencode-ai/plugin";
|
|
3230
|
+
var z65 = tool66.schema;
|
|
3231
|
+
var cookiePolicySchema3 = z65.enum(["off", "auto", "required"]);
|
|
3232
|
+
var challengeAutomationModeSchema6 = z65.enum(CHALLENGE_AUTOMATION_MODES);
|
|
3044
3233
|
async function captureScreenshotBuffer(deps, url) {
|
|
3045
3234
|
let sessionId = null;
|
|
3046
3235
|
try {
|
|
@@ -3064,26 +3253,26 @@ async function captureScreenshotBuffer(deps, url) {
|
|
|
3064
3253
|
}
|
|
3065
3254
|
}
|
|
3066
3255
|
function createProductVideoRunTool(deps) {
|
|
3067
|
-
return
|
|
3256
|
+
return tool66({
|
|
3068
3257
|
description: "Collect a product presentation asset pack for video/UGC workflows.",
|
|
3069
3258
|
args: {
|
|
3070
|
-
product_url:
|
|
3071
|
-
product_name:
|
|
3072
|
-
provider_hint:
|
|
3073
|
-
include_screenshots:
|
|
3074
|
-
include_all_images:
|
|
3075
|
-
include_copy:
|
|
3076
|
-
output_dir:
|
|
3077
|
-
ttl_hours:
|
|
3078
|
-
timeoutMs:
|
|
3079
|
-
useCookies:
|
|
3080
|
-
challengeAutomationMode:
|
|
3259
|
+
product_url: z65.string().optional().describe("Product URL"),
|
|
3260
|
+
product_name: z65.string().optional().describe("Product name"),
|
|
3261
|
+
provider_hint: z65.string().optional().describe("Optional provider hint"),
|
|
3262
|
+
include_screenshots: z65.boolean().optional().describe("Include screenshots (default true)"),
|
|
3263
|
+
include_all_images: z65.boolean().optional().describe("Include all discovered images (default true)"),
|
|
3264
|
+
include_copy: z65.boolean().optional().describe("Include product copy extraction (default true)"),
|
|
3265
|
+
output_dir: z65.string().optional().describe("Optional output directory"),
|
|
3266
|
+
ttl_hours: z65.number().int().positive().optional().describe("Artifact retention TTL in hours"),
|
|
3267
|
+
timeoutMs: z65.number().int().positive().optional().describe("Workflow timeout in milliseconds"),
|
|
3268
|
+
useCookies: z65.boolean().optional().describe("Enable/disable provider cookie injection for this run"),
|
|
3269
|
+
challengeAutomationMode: challengeAutomationModeSchema6.optional().describe("Challenge automation mode: off|browser|browser_with_helper"),
|
|
3081
3270
|
cookiePolicyOverride: cookiePolicySchema3.optional().describe("Override cookie policy: off|auto|required")
|
|
3082
3271
|
},
|
|
3083
3272
|
async execute(args) {
|
|
3084
3273
|
try {
|
|
3085
3274
|
const runtime = await resolveProviderRuntime(deps);
|
|
3086
|
-
const { runProductVideoWorkflow } = await import("./providers-
|
|
3275
|
+
const { runProductVideoWorkflow } = await import("./providers-ZIVHHH4F.js");
|
|
3087
3276
|
const includeScreenshots = args.include_screenshots ?? true;
|
|
3088
3277
|
const result = await runProductVideoWorkflow(runtime, {
|
|
3089
3278
|
product_url: args.product_url,
|
|
@@ -3109,15 +3298,70 @@ function createProductVideoRunTool(deps) {
|
|
|
3109
3298
|
});
|
|
3110
3299
|
}
|
|
3111
3300
|
|
|
3301
|
+
// src/tools/inspiredesign_run.ts
|
|
3302
|
+
import { tool as tool67 } from "@opencode-ai/plugin";
|
|
3303
|
+
var z66 = tool67.schema;
|
|
3304
|
+
var modeSchema3 = z66.enum(["compact", "json", "md", "context", "path"]);
|
|
3305
|
+
var captureModeSchema = z66.enum(["off", "deep"]);
|
|
3306
|
+
var cookiePolicySchema4 = z66.enum(["off", "auto", "required"]);
|
|
3307
|
+
var challengeAutomationModeSchema7 = z66.enum(CHALLENGE_AUTOMATION_MODES);
|
|
3308
|
+
function createInspiredesignRunTool(deps) {
|
|
3309
|
+
return tool67({
|
|
3310
|
+
description: "Run the inspiredesign workflow directly.",
|
|
3311
|
+
args: {
|
|
3312
|
+
brief: z66.string().min(1).describe("Inspiredesign brief"),
|
|
3313
|
+
urls: z66.array(z66.string()).optional().describe("Inspiration URLs to analyze"),
|
|
3314
|
+
captureMode: captureModeSchema.optional().describe("Capture mode: off|deep"),
|
|
3315
|
+
includePrototypeGuidance: z66.boolean().optional().describe("Include prototype guidance output"),
|
|
3316
|
+
mode: modeSchema3.optional().describe("compact|json|md|context|path"),
|
|
3317
|
+
timeoutMs: z66.number().int().positive().optional().describe("Workflow timeout in milliseconds"),
|
|
3318
|
+
outputDir: z66.string().optional().describe("Optional artifact output directory"),
|
|
3319
|
+
ttlHours: z66.number().int().positive().optional().describe("Artifact retention TTL in hours"),
|
|
3320
|
+
useCookies: z66.boolean().optional().describe("Enable/disable provider cookie injection for this run"),
|
|
3321
|
+
challengeAutomationMode: challengeAutomationModeSchema7.optional().describe("Challenge automation mode: off|browser|browser_with_helper"),
|
|
3322
|
+
cookiePolicyOverride: cookiePolicySchema4.optional().describe("Override cookie policy: off|auto|required")
|
|
3323
|
+
},
|
|
3324
|
+
async execute(args) {
|
|
3325
|
+
try {
|
|
3326
|
+
const runtime = await resolveProviderRuntime(deps);
|
|
3327
|
+
const { runInspiredesignWorkflow } = await import("./providers-ZIVHHH4F.js");
|
|
3328
|
+
const captureMode = args.captureMode ?? "off";
|
|
3329
|
+
const cookieSource = deps.config.get().providers?.cookieSource;
|
|
3330
|
+
const result = await runInspiredesignWorkflow(runtime, {
|
|
3331
|
+
brief: args.brief,
|
|
3332
|
+
urls: args.urls,
|
|
3333
|
+
captureMode,
|
|
3334
|
+
includePrototypeGuidance: args.includePrototypeGuidance,
|
|
3335
|
+
mode: args.mode ?? "compact",
|
|
3336
|
+
timeoutMs: args.timeoutMs,
|
|
3337
|
+
outputDir: args.outputDir,
|
|
3338
|
+
ttlHours: args.ttlHours,
|
|
3339
|
+
useCookies: args.useCookies,
|
|
3340
|
+
challengeAutomationMode: args.challengeAutomationMode,
|
|
3341
|
+
cookiePolicyOverride: args.cookiePolicyOverride
|
|
3342
|
+
}, {
|
|
3343
|
+
captureReference: captureMode === "deep" ? async (url, options) => captureInspiredesignReferenceFromManager(deps.manager, url, {
|
|
3344
|
+
...options,
|
|
3345
|
+
cookieSource
|
|
3346
|
+
}) : void 0
|
|
3347
|
+
});
|
|
3348
|
+
return ok(result);
|
|
3349
|
+
} catch (error) {
|
|
3350
|
+
return failure(serializeError(error).message, "inspiredesign_run_failed");
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3112
3356
|
// src/tools/canvas.ts
|
|
3113
|
-
import { tool as
|
|
3114
|
-
var
|
|
3357
|
+
import { tool as tool68 } from "@opencode-ai/plugin";
|
|
3358
|
+
var z67 = tool68.schema;
|
|
3115
3359
|
function createCanvasTool(deps) {
|
|
3116
|
-
return
|
|
3360
|
+
return tool68({
|
|
3117
3361
|
description: "Execute a typed design-canvas command such as canvas.session.open, canvas.feedback.next, or canvas.document.patch.",
|
|
3118
3362
|
args: {
|
|
3119
|
-
command:
|
|
3120
|
-
params:
|
|
3363
|
+
command: z67.string().min(1).describe("Canvas command name"),
|
|
3364
|
+
params: z67.record(z67.string(), z67.unknown()).optional().describe("Canvas command payload")
|
|
3121
3365
|
},
|
|
3122
3366
|
async execute(args) {
|
|
3123
3367
|
if (!deps.canvasManager) {
|
|
@@ -3141,9 +3385,9 @@ function createCanvasTool(deps) {
|
|
|
3141
3385
|
}
|
|
3142
3386
|
|
|
3143
3387
|
// src/tools/skill_list.ts
|
|
3144
|
-
import { tool as
|
|
3388
|
+
import { tool as tool69 } from "@opencode-ai/plugin";
|
|
3145
3389
|
function createSkillListTool(deps) {
|
|
3146
|
-
return
|
|
3390
|
+
return tool69({
|
|
3147
3391
|
description: "List bundled and discovered skill packs before choosing a local onboarding or workflow lane.",
|
|
3148
3392
|
args: {},
|
|
3149
3393
|
async execute() {
|
|
@@ -3162,14 +3406,14 @@ function createSkillListTool(deps) {
|
|
|
3162
3406
|
}
|
|
3163
3407
|
|
|
3164
3408
|
// src/tools/skill_load.ts
|
|
3165
|
-
import { tool as
|
|
3166
|
-
var
|
|
3409
|
+
import { tool as tool70 } from "@opencode-ai/plugin";
|
|
3410
|
+
var z68 = tool70.schema;
|
|
3167
3411
|
function createSkillLoadTool(deps) {
|
|
3168
|
-
return
|
|
3412
|
+
return tool70({
|
|
3169
3413
|
description: `Load a local skill directly; start with ${onboarding_metadata_default.skillName} ${onboarding_metadata_default.skillTopic} before low-level browser commands.`,
|
|
3170
3414
|
args: {
|
|
3171
|
-
name:
|
|
3172
|
-
topic:
|
|
3415
|
+
name: z68.string().describe("Name of the skill to load (e.g., 'opendevbrowser-login-automation', 'opendevbrowser-form-testing')"),
|
|
3416
|
+
topic: z68.string().optional().describe("Optional topic to filter the skill content")
|
|
3173
3417
|
},
|
|
3174
3418
|
async execute(args) {
|
|
3175
3419
|
try {
|
|
@@ -3204,7 +3448,19 @@ function createTools(deps) {
|
|
|
3204
3448
|
opendevbrowser_connect: wrap("opendevbrowser_connect", createConnectTool(deps)),
|
|
3205
3449
|
opendevbrowser_disconnect: wrap("opendevbrowser_disconnect", createDisconnectTool(deps)),
|
|
3206
3450
|
opendevbrowser_status: wrap("opendevbrowser_status", createStatusTool(deps)),
|
|
3451
|
+
opendevbrowser_status_capabilities: wrap(
|
|
3452
|
+
"opendevbrowser_status_capabilities",
|
|
3453
|
+
createStatusCapabilitiesTool(deps)
|
|
3454
|
+
),
|
|
3207
3455
|
opendevbrowser_session_inspector: wrap("opendevbrowser_session_inspector", createSessionInspectorTool(deps)),
|
|
3456
|
+
opendevbrowser_session_inspector_plan: wrap(
|
|
3457
|
+
"opendevbrowser_session_inspector_plan",
|
|
3458
|
+
createSessionInspectorPlanTool(deps)
|
|
3459
|
+
),
|
|
3460
|
+
opendevbrowser_session_inspector_audit: wrap(
|
|
3461
|
+
"opendevbrowser_session_inspector_audit",
|
|
3462
|
+
createSessionInspectorAuditTool(deps)
|
|
3463
|
+
),
|
|
3208
3464
|
opendevbrowser_targets_list: wrap("opendevbrowser_targets_list", createTargetsListTool(deps)),
|
|
3209
3465
|
opendevbrowser_target_use: wrap("opendevbrowser_target_use", createTargetUseTool(deps)),
|
|
3210
3466
|
opendevbrowser_target_new: wrap("opendevbrowser_target_new", createTargetNewTool(deps)),
|
|
@@ -3216,6 +3472,7 @@ function createTools(deps) {
|
|
|
3216
3472
|
opendevbrowser_wait: wrap("opendevbrowser_wait", createWaitTool(deps)),
|
|
3217
3473
|
opendevbrowser_snapshot: wrap("opendevbrowser_snapshot", createSnapshotTool(deps)),
|
|
3218
3474
|
opendevbrowser_review: wrap("opendevbrowser_review", createReviewTool(deps)),
|
|
3475
|
+
opendevbrowser_review_desktop: wrap("opendevbrowser_review_desktop", createReviewDesktopTool(deps)),
|
|
3219
3476
|
opendevbrowser_click: wrap("opendevbrowser_click", createClickTool(deps)),
|
|
3220
3477
|
opendevbrowser_hover: wrap("opendevbrowser_hover", createHoverTool(deps)),
|
|
3221
3478
|
opendevbrowser_press: wrap("opendevbrowser_press", createPressTool(deps)),
|
|
@@ -3248,6 +3505,7 @@ function createTools(deps) {
|
|
|
3248
3505
|
opendevbrowser_research_run: wrap("opendevbrowser_research_run", createResearchRunTool(deps)),
|
|
3249
3506
|
opendevbrowser_shopping_run: wrap("opendevbrowser_shopping_run", createShoppingRunTool(deps)),
|
|
3250
3507
|
opendevbrowser_product_video_run: wrap("opendevbrowser_product_video_run", createProductVideoRunTool(deps)),
|
|
3508
|
+
opendevbrowser_inspiredesign_run: wrap("opendevbrowser_inspiredesign_run", createInspiredesignRunTool(deps)),
|
|
3251
3509
|
opendevbrowser_canvas: wrap("opendevbrowser_canvas", createCanvasTool(deps)),
|
|
3252
3510
|
opendevbrowser_clone_page: wrap("opendevbrowser_clone_page", createClonePageTool(deps)),
|
|
3253
3511
|
opendevbrowser_clone_component: wrap("opendevbrowser_clone_component", createCloneComponentTool(deps)),
|
|
@@ -3314,6 +3572,8 @@ var OpenDevBrowserPlugin = async ({ directory, worktree }) => {
|
|
|
3314
3572
|
if (!daemonClient) {
|
|
3315
3573
|
daemonClient = new DaemonClient({ autoRenew: true });
|
|
3316
3574
|
}
|
|
3575
|
+
const currentConfig = configStore.get();
|
|
3576
|
+
const challengeConfig = requireChallengeOrchestrationConfig(currentConfig);
|
|
3317
3577
|
manager = new RemoteManager(daemonClient);
|
|
3318
3578
|
canvasManager = new RemoteCanvasManager(daemonClient);
|
|
3319
3579
|
desktopRuntime = new RemoteDesktopRuntime(daemonClient);
|
|
@@ -3326,12 +3586,17 @@ var OpenDevBrowserPlugin = async ({ directory, worktree }) => {
|
|
|
3326
3586
|
browserFallbackPort
|
|
3327
3587
|
} = createCoreRuntimeAssemblies({
|
|
3328
3588
|
cacheRoot: core.cacheRoot,
|
|
3329
|
-
config:
|
|
3330
|
-
manager
|
|
3589
|
+
config: currentConfig,
|
|
3590
|
+
manager,
|
|
3591
|
+
challengeConfig
|
|
3331
3592
|
}));
|
|
3332
3593
|
automationCoordinator = createAutomationCoordinator({
|
|
3333
3594
|
manager,
|
|
3334
|
-
desktopRuntime
|
|
3595
|
+
desktopRuntime,
|
|
3596
|
+
challengeMode: challengeConfig.mode,
|
|
3597
|
+
governedLanes: challengeConfig.governed,
|
|
3598
|
+
helperBridgeEnabled: challengeConfig.optionalComputerUseBridge.enabled,
|
|
3599
|
+
snapshotMaxChars: currentConfig.snapshot.maxChars
|
|
3335
3600
|
});
|
|
3336
3601
|
toolDeps.manager = manager;
|
|
3337
3602
|
toolDeps.canvasManager = canvasManager;
|
|
@@ -3353,14 +3618,30 @@ var OpenDevBrowserPlugin = async ({ directory, worktree }) => {
|
|
|
3353
3618
|
const deadline = Date.now() + 2e3;
|
|
3354
3619
|
let attempt = 0;
|
|
3355
3620
|
let lastError = null;
|
|
3621
|
+
const currentFingerprint = getCurrentDaemonFingerprint();
|
|
3356
3622
|
while (attempt < 2 && Date.now() < deadline) {
|
|
3357
3623
|
attempt += 1;
|
|
3358
3624
|
const status = await fetchDaemonStatusFromMetadata(currentConfig);
|
|
3359
|
-
if (status?.ok) {
|
|
3625
|
+
if (status?.ok && status.fingerprint === currentFingerprint) {
|
|
3360
3626
|
bindRemote();
|
|
3361
3627
|
await relay?.refresh?.();
|
|
3362
3628
|
return;
|
|
3363
3629
|
}
|
|
3630
|
+
if (status?.ok) {
|
|
3631
|
+
const metadata = readDaemonMetadata();
|
|
3632
|
+
const daemonPort = metadata?.port ?? currentConfig.daemonPort;
|
|
3633
|
+
const daemonToken = metadata?.token ?? currentConfig.daemonToken;
|
|
3634
|
+
if (daemonPort > 0 && daemonToken) {
|
|
3635
|
+
try {
|
|
3636
|
+
await fetch(`http://127.0.0.1:${daemonPort}/stop`, {
|
|
3637
|
+
method: "POST",
|
|
3638
|
+
headers: { Authorization: `Bearer ${daemonToken}` }
|
|
3639
|
+
});
|
|
3640
|
+
} catch (error) {
|
|
3641
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3364
3645
|
try {
|
|
3365
3646
|
const { stop } = await startDaemon({ config: currentConfig, directory, worktree });
|
|
3366
3647
|
hubStop = stop;
|