@parcha/pi-browser 0.0.0-stage → 0.1.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/LICENSE +202 -0
- package/NOTICE +33 -0
- package/README.md +348 -2
- package/dist/coding-agent-local.d.ts +16 -0
- package/dist/coding-agent-local.js +138 -0
- package/dist/coding-agent.d.ts +79 -0
- package/dist/coding-agent.js +448 -0
- package/dist/core/contract.d.ts +26 -0
- package/dist/core/contract.js +154 -0
- package/dist/core/custody.d.ts +117 -0
- package/dist/core/custody.js +126 -0
- package/dist/core/decisions.d.ts +43 -0
- package/dist/core/decisions.js +4 -0
- package/dist/core/downloads.d.ts +35 -0
- package/dist/core/downloads.js +131 -0
- package/dist/core/effects.d.ts +63 -0
- package/dist/core/effects.js +256 -0
- package/dist/core/evidence.d.ts +43 -0
- package/dist/core/evidence.js +6 -0
- package/dist/core/failures.d.ts +36 -0
- package/dist/core/failures.js +68 -0
- package/dist/core/find.d.ts +32 -0
- package/dist/core/find.js +179 -0
- package/dist/core/guard.d.ts +6 -0
- package/dist/core/guard.js +25 -0
- package/dist/core/host.d.ts +328 -0
- package/dist/core/host.js +2 -0
- package/dist/core/images.d.ts +37 -0
- package/dist/core/images.js +60 -0
- package/dist/core/lease.d.ts +16 -0
- package/dist/core/lease.js +30 -0
- package/dist/core/receipts.d.ts +19 -0
- package/dist/core/receipts.js +22 -0
- package/dist/core/redact.d.ts +13 -0
- package/dist/core/redact.js +83 -0
- package/dist/core/session-control.d.ts +25 -0
- package/dist/core/session-control.js +75 -0
- package/dist/core/sites.d.ts +33 -0
- package/dist/core/sites.js +102 -0
- package/dist/core/tools.d.ts +72 -0
- package/dist/core/tools.js +200 -0
- package/dist/core/uri.d.ts +11 -0
- package/dist/core/uri.js +37 -0
- package/dist/core/usage.d.ts +19 -0
- package/dist/core/usage.js +44 -0
- package/dist/core/web.d.ts +98 -0
- package/dist/core/web.js +327 -0
- package/dist/driver/extension-worker.d.ts +6 -0
- package/dist/driver/extension-worker.js +121 -0
- package/dist/driver/stagehand.d.ts +25 -0
- package/dist/driver/stagehand.js +91 -0
- package/dist/durable-result.d.ts +6 -0
- package/dist/durable-result.js +2 -0
- package/dist/durable.d.ts +79 -0
- package/dist/durable.js +582 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +20 -0
- package/dist/providers/browserbase-net.d.ts +13 -0
- package/dist/providers/browserbase-net.js +96 -0
- package/dist/providers/browserbase.d.ts +152 -0
- package/dist/providers/browserbase.js +262 -0
- package/dist/providers/cdp-call.d.ts +6 -0
- package/dist/providers/cdp-call.js +25 -0
- package/dist/providers/cdp.d.ts +55 -0
- package/dist/providers/cdp.js +423 -0
- package/dist/providers/http.d.ts +2 -0
- package/dist/providers/http.js +21 -0
- package/dist/providers/kernel.d.ts +49 -0
- package/dist/providers/kernel.js +246 -0
- package/dist/providers/shared.d.ts +47 -0
- package/dist/providers/shared.js +82 -0
- package/dist/recorder/credential.d.ts +9 -0
- package/dist/recorder/credential.js +49 -0
- package/dist/recorder/follow.d.ts +26 -0
- package/dist/recorder/follow.js +138 -0
- package/dist/recorder/frames.d.ts +80 -0
- package/dist/recorder/frames.js +309 -0
- package/dist/recorder/index.d.ts +4 -0
- package/dist/recorder/index.js +7 -0
- package/dist/recorder/jpeg.d.ts +8 -0
- package/dist/recorder/jpeg.js +70 -0
- package/dist/recorder/track.d.ts +107 -0
- package/dist/recorder/track.js +259 -0
- package/dist/store.d.ts +56 -0
- package/dist/store.js +196 -0
- package/dist/testing/backend.d.ts +231 -0
- package/dist/testing/backend.js +414 -0
- package/dist/testing/driver.d.ts +28 -0
- package/dist/testing/driver.js +32 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/pages.d.ts +3 -0
- package/dist/testing/pages.js +10 -0
- package/dist/testing/sentinels.d.ts +29 -0
- package/dist/testing/sentinels.js +38 -0
- package/dist/vendor/stagehand-facade/contract.d.ts +348 -0
- package/dist/vendor/stagehand-facade/contract.js +155 -0
- package/dist/vendor/stagehand-facade/runtime.d.ts +90 -0
- package/dist/vendor/stagehand-facade/runtime.js +1640 -0
- package/dist/vendor/stagehand-facade/screenshot-transport.d.ts +15 -0
- package/dist/vendor/stagehand-facade/screenshot-transport.js +51 -0
- package/dist/vendor/stagehand-facade/tools.d.ts +31 -0
- package/dist/vendor/stagehand-facade/tools.js +139 -0
- package/dist/web.d.ts +41 -0
- package/dist/web.js +38 -0
- package/package.json +123 -4
- package/src/vendor/stagehand-facade/UPSTREAM.json +24 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
type RawLocator = {
|
|
2
|
+
click(options?: {
|
|
3
|
+
button?: "left" | "right" | "middle";
|
|
4
|
+
clickCount?: number;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
hover(): Promise<void>;
|
|
7
|
+
fill(value: string): Promise<void>;
|
|
8
|
+
type(text: string, options?: {
|
|
9
|
+
delay?: number;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
selectOption(values: string | string[]): Promise<string[]>;
|
|
12
|
+
setInputFiles(files: unknown): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
type RawPage = {
|
|
15
|
+
readonly pageId?: string;
|
|
16
|
+
goto(url: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
17
|
+
reload(options?: Record<string, unknown>): Promise<unknown>;
|
|
18
|
+
goBack(options?: Record<string, unknown>): Promise<unknown>;
|
|
19
|
+
goForward(options?: Record<string, unknown>): Promise<unknown>;
|
|
20
|
+
evaluate<Result = unknown, Arg = unknown>(expression: string | ((arg: Arg) => Result | Promise<Result>), arg?: Arg): Promise<Result>;
|
|
21
|
+
screenshot(options?: Record<string, unknown>): Promise<Uint8Array>;
|
|
22
|
+
setViewportSize(width: number, height: number): Promise<void>;
|
|
23
|
+
waitForLoadState(state: string, timeout?: number): Promise<void>;
|
|
24
|
+
waitForTimeout(ms: number): Promise<void>;
|
|
25
|
+
waitForSelector(selector: string, options?: Record<string, unknown>): Promise<boolean>;
|
|
26
|
+
url(): Promise<string>;
|
|
27
|
+
title(): Promise<string>;
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
locator(selector: string): RawLocator;
|
|
30
|
+
type(text: string, options?: {
|
|
31
|
+
delay?: number;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
keyPress(key: string, options?: {
|
|
34
|
+
delay?: number;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
click(x: number, y: number, options?: Record<string, unknown>): Promise<void>;
|
|
37
|
+
hover(x: number, y: number): Promise<void>;
|
|
38
|
+
scroll(x: number, y: number, deltaX: number, deltaY: number): Promise<void>;
|
|
39
|
+
setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
|
|
40
|
+
addInitScript(script: string | ((arg: unknown) => unknown), arg?: unknown): Promise<void>;
|
|
41
|
+
snapshot(options?: Record<string, unknown>): Promise<unknown>;
|
|
42
|
+
on(event: "console" | "download" | "request" | "response" | "requestfailed", listener: (event: any) => unknown): Promise<{
|
|
43
|
+
unsubscribe(): Promise<void>;
|
|
44
|
+
}>;
|
|
45
|
+
onCDP(method: string, listener: (event: any) => unknown): Promise<{
|
|
46
|
+
unsubscribe(): Promise<void>;
|
|
47
|
+
}>;
|
|
48
|
+
sendCDP<Result = unknown>(method: string, params?: Record<string, unknown>): Promise<Result>;
|
|
49
|
+
};
|
|
50
|
+
type RawContext = {
|
|
51
|
+
pages(): Promise<RawPage[]>;
|
|
52
|
+
newPage(url?: string): Promise<RawPage>;
|
|
53
|
+
setActivePage(page: RawPage): Promise<void>;
|
|
54
|
+
cookies(urls?: string | string[]): Promise<unknown[]>;
|
|
55
|
+
addCookies(cookies: unknown[]): Promise<void>;
|
|
56
|
+
clearCookies(options?: Record<string, unknown>): Promise<void>;
|
|
57
|
+
setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
|
|
58
|
+
addInitScript(script: string | ((arg: unknown) => unknown), arg?: unknown): Promise<void>;
|
|
59
|
+
request?: {
|
|
60
|
+
fetch(url: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
61
|
+
get(url: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
62
|
+
post(url: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type BatchStagehandRuntime = {
|
|
66
|
+
page: RawPage;
|
|
67
|
+
context: RawContext;
|
|
68
|
+
};
|
|
69
|
+
export type PlaywrightCompatTelemetry = {
|
|
70
|
+
calls: Record<string, number>;
|
|
71
|
+
misses: Record<string, number>;
|
|
72
|
+
};
|
|
73
|
+
export type PlaywrightCompatRuntime = {
|
|
74
|
+
page: unknown;
|
|
75
|
+
context: unknown;
|
|
76
|
+
browser: unknown;
|
|
77
|
+
telemetry: () => PlaywrightCompatTelemetry;
|
|
78
|
+
artifacts: () => Array<{
|
|
79
|
+
path: string;
|
|
80
|
+
base64: string;
|
|
81
|
+
}>;
|
|
82
|
+
closeRequested: () => boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Builds a Playwright-shaped facade entirely inside a Stagehand callback batch.
|
|
86
|
+
* Keep this function self-contained: its source is serialized into the
|
|
87
|
+
* extension service worker with Function#toString.
|
|
88
|
+
*/
|
|
89
|
+
export declare function createPlaywrightCompatRuntime(stagehand: BatchStagehandRuntime): Promise<PlaywrightCompatRuntime>;
|
|
90
|
+
export {};
|