zan-browser 1.3.38 → 2.0.0
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/dist/ai.d.ts +3 -16
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +101 -208
- package/dist/ai.js.map +1 -1
- package/dist/blacklist.d.ts +2 -0
- package/dist/blacklist.d.ts.map +1 -0
- package/dist/blacklist.js +115 -0
- package/dist/blacklist.js.map +1 -0
- package/dist/browser-provider.d.ts +81 -0
- package/dist/browser-provider.d.ts.map +1 -0
- package/dist/browser-provider.js +6 -0
- package/dist/browser-provider.js.map +1 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +51 -60
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptor.d.ts +3 -3
- package/dist/interceptor.d.ts.map +1 -1
- package/dist/interceptor.js +45 -19
- package/dist/interceptor.js.map +1 -1
- package/dist/navigator.d.ts +40 -0
- package/dist/navigator.d.ts.map +1 -0
- package/dist/navigator.js +507 -0
- package/dist/navigator.js.map +1 -0
- package/dist/observer.d.ts +23 -3
- package/dist/observer.d.ts.map +1 -1
- package/dist/observer.js +310 -270
- package/dist/observer.js.map +1 -1
- package/dist/perception.d.ts +42 -0
- package/dist/perception.d.ts.map +1 -0
- package/dist/perception.js +140 -0
- package/dist/perception.js.map +1 -0
- package/dist/providers/browserbase.d.ts +12 -0
- package/dist/providers/browserbase.d.ts.map +1 -0
- package/dist/providers/browserbase.js +226 -0
- package/dist/providers/browserbase.js.map +1 -0
- package/dist/providers/puppeteer-local.d.ts +5 -0
- package/dist/providers/puppeteer-local.d.ts.map +1 -0
- package/dist/providers/puppeteer-local.js +218 -0
- package/dist/providers/puppeteer-local.js.map +1 -0
- package/dist/session.d.ts +17 -23
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +112 -407
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +1 -32
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/ai.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import type { ObserveResult,
|
|
1
|
+
import type { ObserveResult, AgentAction, SeedValue } from "./types";
|
|
2
2
|
export declare class AIClient {
|
|
3
3
|
private client;
|
|
4
4
|
private model;
|
|
5
5
|
constructor(apiKey: string, model?: string);
|
|
6
|
-
decideFromObservation(goal: string, observation: ObserveResult,
|
|
7
|
-
|
|
8
|
-
content: string;
|
|
9
|
-
}>, step: number, maxSteps: number, seedValues?: SeedValue[]): Promise<AgentCompletion>;
|
|
10
|
-
decideFromScreenshot(goal: string, screenshotBase64: string, trajectory: Array<{
|
|
11
|
-
role: "assistant" | "user";
|
|
12
|
-
content: string;
|
|
13
|
-
}>, step: number, maxSteps: number, seedValues?: SeedValue[]): Promise<AgentCompletion>;
|
|
14
|
-
scrapePageContent(goal: string, pageContent: string, seedValues?: SeedValue[], availableLinks?: PageLink[]): Promise<{
|
|
15
|
-
found: boolean;
|
|
16
|
-
data: Record<string, unknown> | null;
|
|
17
|
-
nextUrl: string | null;
|
|
18
|
-
reasoning: string;
|
|
19
|
-
}>;
|
|
20
|
-
private parseCompletion;
|
|
6
|
+
decideFromObservation(goal: string, observation: ObserveResult, history: string[], seedValues?: SeedValue[]): Promise<AgentAction>;
|
|
7
|
+
decideFromScreenshot(goal: string, screenshotBase64: string, history: string[], seedValues?: SeedValue[]): Promise<AgentAction>;
|
|
21
8
|
private parseAction;
|
|
22
9
|
}
|
|
23
10
|
//# sourceMappingURL=ai.d.ts.map
|
package/dist/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIrE,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAS;gBAEV,MAAM,EAAE,MAAM,EAAE,KAAK,SAAgB;IAM3C,qBAAqB,CACzB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa,EAC1B,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,CAAC,EAAE,SAAS,EAAE,GACvB,OAAO,CAAC,WAAW,CAAC;IAuDjB,oBAAoB,CACxB,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,CAAC,EAAE,SAAS,EAAE,GACvB,OAAO,CAAC,WAAW,CAAC;IAgEvB,OAAO,CAAC,WAAW;CA2BpB"}
|
package/dist/ai.js
CHANGED
|
@@ -5,59 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AIClient = void 0;
|
|
7
7
|
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
8
|
-
const DEFAULT_MODEL = "claude-
|
|
9
|
-
const SYSTEM_PROMPT = `You are a precise browser automation agent that interacts with websites through structured commands.
|
|
10
|
-
Your role is to:
|
|
11
|
-
1. Analyze the provided webpage elements and structure
|
|
12
|
-
2. Plan actions to accomplish the given task
|
|
13
|
-
3. Respond with valid JSON containing your action and state assessment
|
|
14
|
-
|
|
15
|
-
INPUT STRUCTURE:
|
|
16
|
-
Elements use this format:
|
|
17
|
-
id[:]<element_type attr1="val" attr2="val">text</element_type>
|
|
18
|
-
_[:] Non-interactive text context
|
|
19
|
-
|
|
20
|
-
IDs: B=button, L=link, I=input, S=select, O=option, F=image, M=misc
|
|
21
|
-
|
|
22
|
-
CRITICAL: Never use an ID that is not explicitly shown in the current elements.
|
|
23
|
-
CRITICAL: Never invent URLs. Only use hrefs from the elements list.
|
|
24
|
-
|
|
25
|
-
RESPONSE FORMAT:
|
|
26
|
-
You must ALWAYS respond with valid JSON in this exact format (no markdown, no backticks):
|
|
27
|
-
{
|
|
28
|
-
"state": {
|
|
29
|
-
"previous_goal_status": "success" | "failure" | "unknown",
|
|
30
|
-
"previous_goal_eval": "evaluation of whether the previous action achieved its goal",
|
|
31
|
-
"page_summary": "brief description of the current page",
|
|
32
|
-
"relevant_interactions": [{"id": "B1", "reason": "why this element matters"}],
|
|
33
|
-
"memory": "important information to remember across steps",
|
|
34
|
-
"next_goal": "what you plan to do next"
|
|
35
|
-
},
|
|
36
|
-
"action": { ... one of the actions below ... }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
ACTIONS (choose exactly one):
|
|
40
|
-
- goto: {"type": "goto", "url": "https://...", "reason": "why"} — navigate to URL (ONLY from element hrefs)
|
|
41
|
-
- click: {"type": "click", "elementId": "B1", "reason": "why"}
|
|
42
|
-
- fill: {"type": "fill", "elementId": "I1", "value": "text", "reason": "why"}
|
|
43
|
-
- press_key: {"type": "press_key", "key": "Enter", "reason": "why"}
|
|
44
|
-
- scroll_down: {"type": "scroll", "direction": "down", "reason": "why"}
|
|
45
|
-
- scroll_up: {"type": "scroll", "direction": "up", "reason": "why"}
|
|
46
|
-
- scrape: {"type": "scrape", "reason": "why"} — data is visible on page, extract it
|
|
47
|
-
- done: {"type": "done", "reason": "why", "data": {}} — task complete, return extracted data
|
|
48
|
-
- impossible: {"type": "impossible", "reason": "why this cannot be done"}
|
|
49
|
-
|
|
50
|
-
NAVIGATION & ERROR HANDLING:
|
|
51
|
-
- If no suitable elements exist, use scroll or goto to find them
|
|
52
|
-
- If stuck, try alternative approaches
|
|
53
|
-
- Handle popups/cookies by accepting or closing them
|
|
54
|
-
- Use scroll to find elements you are looking for
|
|
55
|
-
|
|
56
|
-
TASK COMPLETION:
|
|
57
|
-
- Use done action as soon as the task is complete
|
|
58
|
-
- Include all relevant data in the done action
|
|
59
|
-
- If running out of steps, speed up and use done
|
|
60
|
-
- relevant_interactions should have at most 3 items`;
|
|
8
|
+
const DEFAULT_MODEL = "claude-haiku-4-5-20251001";
|
|
61
9
|
class AIClient {
|
|
62
10
|
client;
|
|
63
11
|
model;
|
|
@@ -65,189 +13,134 @@ class AIClient {
|
|
|
65
13
|
this.client = new sdk_1.default({ apiKey });
|
|
66
14
|
this.model = model;
|
|
67
15
|
}
|
|
68
|
-
// Decide the next action given the observed DOM state
|
|
69
|
-
async decideFromObservation(goal, observation,
|
|
16
|
+
// Decide the next action given the observed DOM state (text first, no screenshot)
|
|
17
|
+
async decideFromObservation(goal, observation, history, seedValues) {
|
|
18
|
+
const historyText = history.length > 0
|
|
19
|
+
? `\nPREVIOUS STEPS:\n${history.slice(-5).join("\n")}`
|
|
20
|
+
: "";
|
|
70
21
|
const seedContext = seedValues && seedValues.length > 0
|
|
71
22
|
? `\nINPUT VALUES TO USE:\n${seedValues.map(s => `- ${s.paramName} (${s.description}): use "${s.exampleValue}" when filling any relevant input field`).join("\n")}`
|
|
72
23
|
: "";
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
24
|
+
const prompt = `You are controlling a browser to achieve a goal. You are discovering APIs by navigating websites like a real user.
|
|
25
|
+
Decide the SINGLE next action to take based on the current page state.
|
|
26
|
+
|
|
27
|
+
GOAL: ${goal}
|
|
28
|
+
${historyText}${seedContext}
|
|
77
29
|
|
|
78
|
-
|
|
79
|
-
[Start of page]
|
|
30
|
+
CURRENT PAGE STATE:
|
|
80
31
|
${observation.text}
|
|
81
|
-
[End of page]
|
|
82
|
-
<WEBSITE_CONTENT_END>
|
|
83
32
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
messages.push({ role: entry.role, content: entry.content });
|
|
96
|
-
}
|
|
97
|
-
// Current observation
|
|
98
|
-
messages.push({ role: "user", content: userMessage });
|
|
99
|
-
const response = await this.client.messages.create({
|
|
100
|
-
model: this.model,
|
|
101
|
-
max_tokens: 1024,
|
|
102
|
-
system: SYSTEM_PROMPT,
|
|
103
|
-
messages,
|
|
104
|
-
});
|
|
105
|
-
const text = response.content[0].type === "text" ? response.content[0].text : "";
|
|
106
|
-
return this.parseCompletion(text);
|
|
107
|
-
}
|
|
108
|
-
async decideFromScreenshot(goal, screenshotBase64, trajectory, step, maxSteps, seedValues) {
|
|
109
|
-
const seedContext = seedValues && seedValues.length > 0
|
|
110
|
-
? `\nINPUT VALUES TO USE:\n${seedValues.map(s => `- ${s.paramName} (${s.description}): use "${s.exampleValue}" when filling any relevant input field`).join("\n")}`
|
|
111
|
-
: "";
|
|
112
|
-
const userMessage = `The DOM observer couldn't identify enough elements — you're seeing a screenshot instead.
|
|
113
|
-
Current step: ${step}/${maxSteps}
|
|
33
|
+
IMPORTANT RULES:
|
|
34
|
+
- Always dismiss cookie banners first if detected
|
|
35
|
+
- If a modal is open, interact with it first
|
|
36
|
+
- If the page is loading, return a wait action (1000ms)
|
|
37
|
+
- If an AUTOCOMPLETE DROPDOWN IS OPEN, you MUST click the first result using "click" on the relevant element
|
|
38
|
+
- If SEED VALUE FOUND IN NETWORK RESPONSES, return "done" immediately — the target API is captured
|
|
39
|
+
- Take the MINIMUM actions needed — stop as soon as the goal is achievable
|
|
40
|
+
- If INPUT VALUES are provided above, use them when filling search boxes or input fields
|
|
41
|
+
- If you see error messages or "no results", the input may be wrong — return "done" to try next value
|
|
42
|
+
- Think like a REAL USER navigating this website, not a programmer
|
|
43
|
+
- If you cannot achieve the goal, return "impossible" with a clear reason
|
|
114
44
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
content: [
|
|
127
|
-
{
|
|
128
|
-
type: "image",
|
|
129
|
-
source: {
|
|
130
|
-
type: "base64",
|
|
131
|
-
media_type: "image/jpeg",
|
|
132
|
-
data: screenshotBase64,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
{ type: "text", text: userMessage },
|
|
136
|
-
],
|
|
137
|
-
});
|
|
45
|
+
Respond with a JSON object (no markdown, no code fences):
|
|
46
|
+
{
|
|
47
|
+
"type": "click" | "fill" | "scroll" | "wait" | "navigate" | "done" | "impossible",
|
|
48
|
+
"elementId": "@B3" (required for click/fill — use the element IDs from the page state),
|
|
49
|
+
"value": "text to type" (required for fill),
|
|
50
|
+
"direction": "up" | "down" (required for scroll),
|
|
51
|
+
"amount": 300 (optional for scroll, pixels),
|
|
52
|
+
"ms": 1000 (required for wait),
|
|
53
|
+
"url": "https://..." (required for navigate),
|
|
54
|
+
"reason": "why this action"
|
|
55
|
+
}`;
|
|
138
56
|
const response = await this.client.messages.create({
|
|
139
57
|
model: this.model,
|
|
140
|
-
max_tokens:
|
|
141
|
-
|
|
142
|
-
messages,
|
|
58
|
+
max_tokens: 300,
|
|
59
|
+
messages: [{ role: "user", content: prompt }],
|
|
143
60
|
});
|
|
144
61
|
const text = response.content[0].type === "text" ? response.content[0].text : "";
|
|
145
|
-
return this.
|
|
62
|
+
return this.parseAction(text);
|
|
146
63
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
? `\nCONCRETE EXAMPLE INPUTS:\n${seedValues.map((s) => `- ${s.paramName}: "${s.exampleValue}"`).join("\n")}`
|
|
64
|
+
async decideFromScreenshot(goal, screenshotBase64, history, seedValues) {
|
|
65
|
+
const historyText = history.length > 0
|
|
66
|
+
? `\nPREVIOUS STEPS:\n${history.slice(-3).join("\n")}`
|
|
151
67
|
: "";
|
|
152
|
-
const
|
|
153
|
-
? `\
|
|
68
|
+
const seedContext = seedValues && seedValues.length > 0
|
|
69
|
+
? `\nINPUT VALUES TO USE:\n${seedValues.map(s => `- ${s.paramName} (${s.description}): use "${s.exampleValue}" when filling any relevant input field`).join("\n")}`
|
|
154
70
|
: "";
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const prompt = `The user wants: ${goal}${seedContext}
|
|
71
|
+
const prompt = `You are controlling a browser to discover APIs by navigating websites.
|
|
72
|
+
The DOM observer couldn't identify enough elements — you're seeing a screenshot instead.
|
|
73
|
+
Decide the SINGLE next action.
|
|
159
74
|
|
|
160
|
-
|
|
161
|
-
${
|
|
162
|
-
${linksSection}
|
|
75
|
+
GOAL: ${goal}
|
|
76
|
+
${historyText}${seedContext}
|
|
163
77
|
|
|
164
|
-
|
|
165
|
-
|
|
78
|
+
RULES:
|
|
79
|
+
- Think like a real USER navigating this website
|
|
80
|
+
- Take minimum actions needed
|
|
81
|
+
- Return "done" when the goal is achievable
|
|
82
|
+
- If INPUT VALUES are provided, use them for search boxes
|
|
83
|
+
- Return "impossible" if it cannot be done
|
|
166
84
|
|
|
167
|
-
Respond with JSON
|
|
85
|
+
Respond with JSON (no markdown, no code fences):
|
|
168
86
|
{
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
87
|
+
"type": "click" | "fill" | "scroll" | "wait" | "navigate" | "done" | "impossible",
|
|
88
|
+
"elementId": "describe the element visually if no ID available",
|
|
89
|
+
"value": "text to type" (for fill),
|
|
90
|
+
"direction": "up" | "down" (for scroll),
|
|
91
|
+
"ms": 1000 (for wait),
|
|
92
|
+
"url": "https://..." (for navigate),
|
|
93
|
+
"reason": "why"
|
|
173
94
|
}`;
|
|
174
95
|
const response = await this.client.messages.create({
|
|
175
|
-
model:
|
|
176
|
-
max_tokens:
|
|
177
|
-
messages: [
|
|
96
|
+
model: this.model,
|
|
97
|
+
max_tokens: 300,
|
|
98
|
+
messages: [
|
|
99
|
+
{
|
|
100
|
+
role: "user",
|
|
101
|
+
content: [
|
|
102
|
+
{
|
|
103
|
+
type: "image",
|
|
104
|
+
source: {
|
|
105
|
+
type: "base64",
|
|
106
|
+
media_type: "image/jpeg",
|
|
107
|
+
data: screenshotBase64,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{ type: "text", text: prompt },
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
178
114
|
});
|
|
179
|
-
const text = response.content[0].type === "text" ? response.content[0].text : "
|
|
180
|
-
|
|
181
|
-
const cleaned = text.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim();
|
|
182
|
-
return JSON.parse(cleaned);
|
|
183
|
-
}
|
|
184
|
-
catch {
|
|
185
|
-
return { found: false, data: null, nextUrl: null, reasoning: "failed to parse scrape response" };
|
|
186
|
-
}
|
|
115
|
+
const text = response.content[0].type === "text" ? response.content[0].text : "";
|
|
116
|
+
return this.parseAction(text);
|
|
187
117
|
}
|
|
188
118
|
// ─── Private ─────────────────────────────────────────────────────────────────
|
|
189
|
-
|
|
119
|
+
parseAction(raw) {
|
|
190
120
|
try {
|
|
191
121
|
const cleaned = raw.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim();
|
|
192
122
|
const parsed = JSON.parse(cleaned);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
123
|
+
switch (parsed.type) {
|
|
124
|
+
case "click":
|
|
125
|
+
return { type: "click", elementId: parsed.elementId ?? "", reason: parsed.reason ?? "" };
|
|
126
|
+
case "fill":
|
|
127
|
+
return { type: "fill", elementId: parsed.elementId ?? "", value: parsed.value ?? "", reason: parsed.reason ?? "" };
|
|
128
|
+
case "scroll":
|
|
129
|
+
return { type: "scroll", direction: parsed.direction ?? "down", amount: parsed.amount, reason: parsed.reason ?? "" };
|
|
130
|
+
case "wait":
|
|
131
|
+
return { type: "wait", ms: parsed.ms ?? 1000, reason: parsed.reason ?? "" };
|
|
132
|
+
case "navigate":
|
|
133
|
+
return { type: "navigate", url: parsed.url ?? "", reason: parsed.reason ?? "" };
|
|
134
|
+
case "done":
|
|
135
|
+
return { type: "done", reason: parsed.reason ?? "" };
|
|
136
|
+
case "impossible":
|
|
137
|
+
return { type: "impossible", reason: parsed.reason ?? "could not achieve goal" };
|
|
138
|
+
default:
|
|
139
|
+
return { type: "impossible", reason: `unknown action type: ${parsed.type}` };
|
|
140
|
+
}
|
|
203
141
|
}
|
|
204
142
|
catch {
|
|
205
|
-
return {
|
|
206
|
-
state: {
|
|
207
|
-
previous_goal_status: "unknown",
|
|
208
|
-
previous_goal_eval: "failed to parse response",
|
|
209
|
-
page_summary: "",
|
|
210
|
-
relevant_interactions: [],
|
|
211
|
-
memory: "",
|
|
212
|
-
next_goal: "",
|
|
213
|
-
},
|
|
214
|
-
action: { type: "impossible", reason: `failed to parse AI response: ${raw.slice(0, 100)}` },
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
parseAction(parsed) {
|
|
219
|
-
if (!parsed || typeof parsed !== "object") {
|
|
220
|
-
return { type: "impossible", reason: "invalid action object" };
|
|
221
|
-
}
|
|
222
|
-
const type = parsed.type;
|
|
223
|
-
const reason = parsed.reason ?? "";
|
|
224
|
-
switch (type) {
|
|
225
|
-
case "click":
|
|
226
|
-
return { type: "click", elementId: (parsed.elementId ?? parsed.id ?? ""), reason };
|
|
227
|
-
case "fill":
|
|
228
|
-
return { type: "fill", elementId: (parsed.elementId ?? parsed.id ?? ""), value: (parsed.value ?? ""), reason };
|
|
229
|
-
case "scroll":
|
|
230
|
-
case "scroll_down":
|
|
231
|
-
return { type: "scroll", direction: parsed.direction ?? "down", amount: parsed.amount, reason };
|
|
232
|
-
case "scroll_up":
|
|
233
|
-
return { type: "scroll", direction: "up", reason };
|
|
234
|
-
case "wait":
|
|
235
|
-
return { type: "wait", ms: parsed.ms ?? 1000, reason };
|
|
236
|
-
case "goto":
|
|
237
|
-
case "navigate":
|
|
238
|
-
return { type: "navigate", url: (parsed.url ?? ""), reason };
|
|
239
|
-
case "press_key":
|
|
240
|
-
return { type: "press_key", key: (parsed.key ?? ""), reason };
|
|
241
|
-
case "scrape":
|
|
242
|
-
return { type: "scrape", reason };
|
|
243
|
-
case "screenshot":
|
|
244
|
-
return { type: "screenshot", reason: reason || "need visual confirmation" };
|
|
245
|
-
case "done":
|
|
246
|
-
return { type: "done", reason, data: parsed.data };
|
|
247
|
-
case "impossible":
|
|
248
|
-
return { type: "impossible", reason: reason || "could not achieve goal" };
|
|
249
|
-
default:
|
|
250
|
-
return { type: "impossible", reason: `unknown action type: ${type}` };
|
|
143
|
+
return { type: "impossible", reason: `failed to parse AI response: ${raw.slice(0, 100)}` };
|
|
251
144
|
}
|
|
252
145
|
}
|
|
253
146
|
}
|
package/dist/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAG1C,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAG1C,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAElD,MAAa,QAAQ;IACX,MAAM,CAAY;IAClB,KAAK,CAAS;IAEtB,YAAY,MAAc,EAAE,KAAK,GAAG,aAAa;QAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,aAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,kFAAkF;IAClF,KAAK,CAAC,qBAAqB,CACzB,IAAY,EACZ,WAA0B,EAC1B,OAAiB,EACjB,UAAwB;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,MAAM,GAAG,CAAC;YAChB,CAAC,CAAC,sBAAsB,OA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D,KAAK,YAAY;oBACf,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,wBAAwB,EAAE,CAAC;gBACnF;oBACE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,wBAAwB,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YACjF,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,gCAAgC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QAC7F,CAAC;IACH,CAAC;CACF;AAtKD,4BAsKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blacklist.d.ts","sourceRoot":"","sources":["../src/blacklist.ts"],"names":[],"mappings":"AA4HA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIlD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Aggressive domain/URL blacklist ──────────────────────────────────────────
|
|
3
|
+
// Consolidated from test-api + zan-browser patterns.
|
|
4
|
+
// Filters out analytics, tracking, ads, consent, fonts, auth providers, and other noise.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isBlacklisted = isBlacklisted;
|
|
7
|
+
const BLACKLISTED_DOMAINS = [
|
|
8
|
+
// Analytics & tracking
|
|
9
|
+
/google-analytics/i,
|
|
10
|
+
/googletagmanager/i,
|
|
11
|
+
/doubleclick/i,
|
|
12
|
+
/googlesyndication/i,
|
|
13
|
+
/googleadservices/i,
|
|
14
|
+
/facebook\.net/i,
|
|
15
|
+
/facebook\.com\/tr/i,
|
|
16
|
+
/hotjar/i,
|
|
17
|
+
/sentry\.io/i,
|
|
18
|
+
/newrelic/i,
|
|
19
|
+
/segment\.io/i,
|
|
20
|
+
/segment\.com/i,
|
|
21
|
+
/amplitude\.com/i,
|
|
22
|
+
/mixpanel\.com/i,
|
|
23
|
+
/heap\.io/i,
|
|
24
|
+
/fullstory\.com/i,
|
|
25
|
+
/clarity\.ms/i,
|
|
26
|
+
/mouseflow\.com/i,
|
|
27
|
+
/crazyegg\.com/i,
|
|
28
|
+
/optimizely\.com/i,
|
|
29
|
+
/branch\.io/i,
|
|
30
|
+
/appsflyer\.com/i,
|
|
31
|
+
/adjust\.com/i,
|
|
32
|
+
// Consent / cookie banners
|
|
33
|
+
/cookielaw/i,
|
|
34
|
+
/onetrust/i,
|
|
35
|
+
/consent/i,
|
|
36
|
+
/optanon/i,
|
|
37
|
+
/cookiebot/i,
|
|
38
|
+
/trustarc/i,
|
|
39
|
+
// Firebase
|
|
40
|
+
/firebaseinstallations/i,
|
|
41
|
+
/firebaseremoteconfig/i,
|
|
42
|
+
/firebase.*config/i,
|
|
43
|
+
// Fonts & maps (not data APIs)
|
|
44
|
+
/fonts\.googleapis/i,
|
|
45
|
+
/fonts\.gstatic/i,
|
|
46
|
+
/maps\.googleapis.*(?:mapsjs|mapConfigs|styles|tiles)/i,
|
|
47
|
+
// Search/algolia (internal, not user data)
|
|
48
|
+
/\.algolia\.net/i,
|
|
49
|
+
// Accessibility overlays
|
|
50
|
+
/userway\.org/i,
|
|
51
|
+
/accessibe\.com/i,
|
|
52
|
+
// Video/streaming infrastructure
|
|
53
|
+
/clipro\.tv/i,
|
|
54
|
+
/blazesdk/i,
|
|
55
|
+
/ivs-device-config\.live-video/i,
|
|
56
|
+
/mux\.com/i,
|
|
57
|
+
// Auth providers (internal)
|
|
58
|
+
/sp\.auth\.adobe\.com/i,
|
|
59
|
+
// ESPN/Disney ad/tracking infra
|
|
60
|
+
/bamgrid\.com/i,
|
|
61
|
+
/espncdn\.com/i,
|
|
62
|
+
/broadband\.espn/i,
|
|
63
|
+
/fastcast\.espn/i,
|
|
64
|
+
/log\.espn/i,
|
|
65
|
+
/dcf\.espn/i,
|
|
66
|
+
/pinpoint\.espn/i,
|
|
67
|
+
// Twitch internal
|
|
68
|
+
/gql\.twitch\.tv/i,
|
|
69
|
+
/twitch\.tv\/gql/i,
|
|
70
|
+
// CDN telemetry
|
|
71
|
+
/cdn-cgi\//i,
|
|
72
|
+
/cloudflareinsights/i,
|
|
73
|
+
// Recaptcha / hcaptcha
|
|
74
|
+
/recaptcha/i,
|
|
75
|
+
/hcaptcha/i,
|
|
76
|
+
// Push notifications
|
|
77
|
+
/onesignal/i,
|
|
78
|
+
/pushwoosh/i,
|
|
79
|
+
// Customer support widgets
|
|
80
|
+
/intercom/i,
|
|
81
|
+
/zendesk/i,
|
|
82
|
+
/drift\.com/i,
|
|
83
|
+
/tawk\.to/i,
|
|
84
|
+
/livechat/i,
|
|
85
|
+
/crisp\.chat/i,
|
|
86
|
+
];
|
|
87
|
+
const BLACKLISTED_URL_PATTERNS = [
|
|
88
|
+
// Static assets
|
|
89
|
+
/\.(png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|css|webp|avif|mp4|mp3|pdf|zip|map)(\?|$)/i,
|
|
90
|
+
// Manifest, favicons, service workers
|
|
91
|
+
/manifest\.json/i,
|
|
92
|
+
/favicon/i,
|
|
93
|
+
/sw\.js/i,
|
|
94
|
+
/service-worker/i,
|
|
95
|
+
/workbox/i,
|
|
96
|
+
// Source maps
|
|
97
|
+
/\.map$/i,
|
|
98
|
+
// Build artifacts
|
|
99
|
+
/\/_next\/static\//i,
|
|
100
|
+
/\/webpack/i,
|
|
101
|
+
/\/chunks\//i,
|
|
102
|
+
// Tracking pixels
|
|
103
|
+
/\/pixel/i,
|
|
104
|
+
/\/beacon/i,
|
|
105
|
+
/\/collect\?/i,
|
|
106
|
+
/\/__utm/i,
|
|
107
|
+
];
|
|
108
|
+
function isBlacklisted(url) {
|
|
109
|
+
if (BLACKLISTED_DOMAINS.some((pattern) => pattern.test(url)))
|
|
110
|
+
return true;
|
|
111
|
+
if (BLACKLISTED_URL_PATTERNS.some((pattern) => pattern.test(url)))
|
|
112
|
+
return true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=blacklist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blacklist.js","sourceRoot":"","sources":["../src/blacklist.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,qDAAqD;AACrD,yFAAyF;;AA0HzF,sCAIC;AA5HD,MAAM,mBAAmB,GAAG;IAC1B,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;IACd,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,SAAS;IACT,aAAa;IACb,WAAW;IACX,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,iBAAiB;IACjB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,iBAAiB;IACjB,cAAc;IAEd,2BAA2B;IAC3B,YAAY;IACZ,WAAW;IACX,UAAU;IACV,UAAU;IACV,YAAY;IACZ,WAAW;IAEX,WAAW;IACX,wBAAwB;IACxB,uBAAuB;IACvB,mBAAmB;IAEnB,+BAA+B;IAC/B,oBAAoB;IACpB,iBAAiB;IACjB,uDAAuD;IAEvD,2CAA2C;IAC3C,iBAAiB;IAEjB,yBAAyB;IACzB,eAAe;IACf,iBAAiB;IAEjB,iCAAiC;IACjC,aAAa;IACb,WAAW;IACX,gCAAgC;IAChC,WAAW;IAEX,4BAA4B;IAC5B,uBAAuB;IAEvB,gCAAgC;IAChC,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,iBAAiB;IAEjB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAElB,gBAAgB;IAChB,YAAY;IACZ,qBAAqB;IAErB,uBAAuB;IACvB,YAAY;IACZ,WAAW;IAEX,qBAAqB;IACrB,YAAY;IACZ,YAAY;IAEZ,2BAA2B;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;IACX,WAAW;IACX,cAAc;CACf,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,gBAAgB;IAChB,sFAAsF;IAEtF,sCAAsC;IACtC,iBAAiB;IACjB,UAAU;IACV,SAAS;IACT,iBAAiB;IACjB,UAAU;IAEV,cAAc;IACd,SAAS;IAET,kBAAkB;IAClB,oBAAoB;IACpB,YAAY;IACZ,aAAa;IAEb,kBAAkB;IAClB,UAAU;IACV,WAAW;IACX,cAAc;IACd,UAAU;CACX,CAAC;AAEF,SAAgB,aAAa,CAAC,GAAW;IACvC,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1E,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/E,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface ElementHandle {
|
|
2
|
+
click(): Promise<void>;
|
|
3
|
+
boundingBox(): Promise<{
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
} | null>;
|
|
9
|
+
}
|
|
10
|
+
export interface PageHandle {
|
|
11
|
+
goto(url: string, options?: {
|
|
12
|
+
waitUntil?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
url(): string;
|
|
16
|
+
title(): Promise<string>;
|
|
17
|
+
content(): Promise<string>;
|
|
18
|
+
reload(options?: {
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
evaluate<T>(fn: (...args: any[]) => T, ...args: any[]): Promise<T>;
|
|
22
|
+
screenshot(options?: {
|
|
23
|
+
type?: "jpeg" | "png";
|
|
24
|
+
quality?: number;
|
|
25
|
+
encoding?: "base64" | "binary";
|
|
26
|
+
}): Promise<Buffer | string>;
|
|
27
|
+
click(selector: string, options?: {
|
|
28
|
+
clickCount?: number;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
type(selector: string, text: string, options?: {
|
|
31
|
+
delay?: number;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
keyboard: {
|
|
34
|
+
press(key: string): Promise<void>;
|
|
35
|
+
type(text: string, options?: {
|
|
36
|
+
delay?: number;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
mouse: {
|
|
40
|
+
click(x: number, y: number): Promise<void>;
|
|
41
|
+
move(x: number, y: number): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
waitForTimeout(ms: number): Promise<void>;
|
|
44
|
+
waitForSelector(selector: string, options?: {
|
|
45
|
+
timeout?: number;
|
|
46
|
+
visible?: boolean;
|
|
47
|
+
}): Promise<ElementHandle | null>;
|
|
48
|
+
waitForNetworkIdle(options?: {
|
|
49
|
+
timeout?: number;
|
|
50
|
+
idleTime?: number;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
$$(selector: string): Promise<ElementHandle[]>;
|
|
53
|
+
setRequestInterception(enabled: boolean): Promise<void>;
|
|
54
|
+
on(event: string, handler: (...args: any[]) => void): void;
|
|
55
|
+
off(event: string, handler: (...args: any[]) => void): void;
|
|
56
|
+
close(): Promise<void>;
|
|
57
|
+
isClosed(): boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface BrowserHandle {
|
|
60
|
+
newPage(): Promise<PageHandle>;
|
|
61
|
+
close(): Promise<void>;
|
|
62
|
+
viewerUrl?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface BrowserProvider {
|
|
65
|
+
launch(config: ProviderConfig): Promise<BrowserHandle>;
|
|
66
|
+
}
|
|
67
|
+
export interface ProviderConfig {
|
|
68
|
+
viewport?: {
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
};
|
|
72
|
+
proxy?: {
|
|
73
|
+
server: string;
|
|
74
|
+
username?: string;
|
|
75
|
+
password?: string;
|
|
76
|
+
};
|
|
77
|
+
timeout?: number;
|
|
78
|
+
headless?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export type ProviderType = "puppeteer-local" | "browserbase" | "ws-endpoint";
|
|
81
|
+
//# sourceMappingURL=browser-provider.d.ts.map
|