@howaboua/pi-durable-browser 0.0.0-stage → 0.10.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/LICENSE +21 -0
- package/NOTICE +52 -0
- package/README.md +86 -2
- package/dist/activation.d.ts +9 -0
- package/dist/activation.js +3759 -0
- package/dist/browser/artifact-store.d.ts +16 -0
- package/dist/browser/artifacts.d.ts +20 -0
- package/dist/browser/bounds.d.ts +4 -0
- package/dist/browser/config-store.d.ts +11 -0
- package/dist/browser/config.d.ts +7 -0
- package/dist/browser/help.d.ts +1 -0
- package/dist/browser/launcher.d.ts +1 -0
- package/dist/browser/operation-executor.d.ts +12 -0
- package/dist/browser/operation-input.d.ts +10 -0
- package/dist/browser/operation.d.ts +115 -0
- package/dist/browser/parse-operation.d.ts +6 -0
- package/dist/browser/parse-tab-operation.d.ts +3 -0
- package/dist/browser/remote-helper.d.ts +3 -0
- package/dist/browser/remote-process.d.ts +6 -0
- package/dist/browser/remote.d.ts +4 -0
- package/dist/browser/request.d.ts +8 -0
- package/dist/browser/routes.d.ts +15 -0
- package/dist/browser/runtime.d.ts +35 -0
- package/dist/browser/voice-start.d.ts +17 -0
- package/dist/browser/worker-client.d.ts +1 -0
- package/dist/browser/worker-server.d.ts +1 -0
- package/dist/browser/worker-socket.d.ts +11 -0
- package/dist/cdp/accessibility-snapshot.d.ts +11 -0
- package/dist/cdp/actions/click.d.ts +6 -0
- package/dist/cdp/actions/element.d.ts +22 -0
- package/dist/cdp/actions/fill.d.ts +8 -0
- package/dist/cdp/actions/key.d.ts +20 -0
- package/dist/cdp/actions/page.d.ts +7 -0
- package/dist/cdp/actions/screenshot.d.ts +14 -0
- package/dist/cdp/actions/selector.d.ts +2 -0
- package/dist/cdp/actions/type.d.ts +3 -0
- package/dist/cdp/actions/wait.d.ts +9 -0
- package/dist/cdp/client.d.ts +20 -0
- package/dist/cdp/discovery.d.ts +7 -0
- package/dist/cdp/evaluate.d.ts +3 -0
- package/dist/cdp/pages.d.ts +4 -0
- package/dist/cdp/serial.d.ts +1 -0
- package/dist/cdp/session.d.ts +27 -0
- package/dist/cdp/snapshot-contract.d.ts +38 -0
- package/dist/cdp/snapshot.d.ts +3 -0
- package/dist/cdp/tab-bridge.d.ts +26 -0
- package/dist/cdp/tabs.d.ts +32 -0
- package/dist/cdp/types.d.ts +22 -0
- package/dist/cdp/url.d.ts +1 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.js +3951 -0
- package/dist/presentation.d.ts +43 -0
- package/dist/presentation.js +82 -0
- package/dist/remote-worker.d.ts +2 -0
- package/dist/remote-worker.js +3850 -0
- package/package.json +67 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type CdpParams = Record<string, unknown>;
|
|
2
|
+
export interface CdpEventWait {
|
|
3
|
+
promise: Promise<unknown>;
|
|
4
|
+
cancel(): void;
|
|
5
|
+
}
|
|
6
|
+
export interface CdpConnection {
|
|
7
|
+
send(method: string, params?: CdpParams, sessionId?: string, signal?: AbortSignal): Promise<unknown>;
|
|
8
|
+
onEvent(method: string, handler: (params: unknown) => void): () => void;
|
|
9
|
+
waitForEvent(method: string, timeout?: number, signal?: AbortSignal): CdpEventWait;
|
|
10
|
+
}
|
|
11
|
+
export interface PageInfo {
|
|
12
|
+
targetId: string;
|
|
13
|
+
title: string;
|
|
14
|
+
url: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
openerId?: string;
|
|
17
|
+
owned?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type ElementRefs = Map<number, number>;
|
|
20
|
+
export declare function asRecord(value: unknown, label?: string): Record<string, unknown>;
|
|
21
|
+
export declare function asString(value: unknown, label: string): string;
|
|
22
|
+
export declare function errorMessage(error: unknown): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertHttpUrl(value: string): void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { JsonValue } from "@earendil-works/chord";
|
|
2
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
3
|
+
import { BrowserRuntime, type BrowserRuntimeConfig } from "./browser/runtime.ts";
|
|
4
|
+
export { type BrowserArtifactStore, environmentArtifactStore, nodeArtifactStore, } from "./browser/artifact-store.ts";
|
|
5
|
+
export { type BrowserRouteConfig, normalizeBrowserRouteConfig, } from "./browser/config.ts";
|
|
6
|
+
export { type BrowserRouteConfigStore, createBrowserRouteConfigFileStore, readBrowserRouteConfig, writeBrowserRouteConfig, } from "./browser/config-store.ts";
|
|
7
|
+
export type { BrowserOperation } from "./browser/operation.ts";
|
|
8
|
+
export { type BrowserRequest, parseBrowserRequest } from "./browser/request.ts";
|
|
9
|
+
export { BrowserRoutes, parseBrowserRoutes } from "./browser/routes.ts";
|
|
10
|
+
export { type BrowserExecutionOptions, BrowserRuntime, type BrowserRuntimeConfig, } from "./browser/runtime.ts";
|
|
11
|
+
export { type BrowserVoiceStartOptions, type BrowserVoiceStartResult, startBrowserVoice, } from "./browser/voice-start.ts";
|
|
12
|
+
export declare function prepareBrowserInput(input: unknown): {
|
|
13
|
+
command: string;
|
|
14
|
+
};
|
|
15
|
+
export interface BrowserToolOptions {
|
|
16
|
+
/** Keep native voice automation available without exposing the agent tool. */
|
|
17
|
+
voiceOnly?: boolean;
|
|
18
|
+
/** Artifact directory inside api.env, relative to that environment's cwd. */
|
|
19
|
+
environmentArtifactDirectory?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function createBrowserTool(runtime: BrowserRuntime, options?: BrowserToolOptions): {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
parameters: Type.TObject<{
|
|
25
|
+
command: Type.TOptional<Type.TString>;
|
|
26
|
+
}>;
|
|
27
|
+
constrainedSampling?: false | import("@earendil-works/pi-ai").ConstrainedSamplingConfig;
|
|
28
|
+
replay?: "safe" | "unsafe";
|
|
29
|
+
executionMode?: import("@earendil-works/pi-durable").ToolExecutionMode;
|
|
30
|
+
prepareArguments?(args: unknown): {
|
|
31
|
+
command?: string;
|
|
32
|
+
};
|
|
33
|
+
structuredOutputSchema?: Type.TSchema;
|
|
34
|
+
callers?: readonly ("model" | "tools")[];
|
|
35
|
+
deferred?: true;
|
|
36
|
+
outputLimits?: {
|
|
37
|
+
readonly maxBytes?: number;
|
|
38
|
+
readonly maxLines?: number;
|
|
39
|
+
readonly retain?: "head" | "tail";
|
|
40
|
+
};
|
|
41
|
+
execute(args: {
|
|
42
|
+
command?: string;
|
|
43
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<JsonValue>>;
|
|
44
|
+
executionHints: {
|
|
45
|
+
discovery: "help";
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: string;
|
|
48
|
+
additionalProperties: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** The host explicitly authorizes native CDP, launch, SSH and private state IO.
|
|
53
|
+
* The host must await close() before discarding this process-local runtime. */
|
|
54
|
+
export declare function createBrowserExtension(config: BrowserRuntimeConfig & BrowserToolOptions): {
|
|
55
|
+
runtime: BrowserRuntime;
|
|
56
|
+
tool: {
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
parameters: Type.TObject<{
|
|
60
|
+
command: Type.TOptional<Type.TString>;
|
|
61
|
+
}>;
|
|
62
|
+
constrainedSampling?: false | import("@earendil-works/pi-ai").ConstrainedSamplingConfig;
|
|
63
|
+
replay?: "safe" | "unsafe";
|
|
64
|
+
executionMode?: import("@earendil-works/pi-durable").ToolExecutionMode;
|
|
65
|
+
prepareArguments?(args: unknown): {
|
|
66
|
+
command?: string;
|
|
67
|
+
};
|
|
68
|
+
structuredOutputSchema?: Type.TSchema;
|
|
69
|
+
callers?: readonly ("model" | "tools")[];
|
|
70
|
+
deferred?: true;
|
|
71
|
+
outputLimits?: {
|
|
72
|
+
readonly maxBytes?: number;
|
|
73
|
+
readonly maxLines?: number;
|
|
74
|
+
readonly retain?: "head" | "tail";
|
|
75
|
+
};
|
|
76
|
+
execute(args: {
|
|
77
|
+
command?: string;
|
|
78
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<JsonValue>>;
|
|
79
|
+
executionHints: {
|
|
80
|
+
discovery: "help";
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: string;
|
|
83
|
+
additionalProperties: boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
extension: import("@earendil-works/pi-durable").Extension<{
|
|
88
|
+
name: string;
|
|
89
|
+
description: string;
|
|
90
|
+
parameters: Type.TObject<{
|
|
91
|
+
command: Type.TOptional<Type.TString>;
|
|
92
|
+
}>;
|
|
93
|
+
constrainedSampling?: false | import("@earendil-works/pi-ai").ConstrainedSamplingConfig;
|
|
94
|
+
replay?: "safe" | "unsafe";
|
|
95
|
+
executionMode?: import("@earendil-works/pi-durable").ToolExecutionMode;
|
|
96
|
+
prepareArguments?(args: unknown): {
|
|
97
|
+
command?: string;
|
|
98
|
+
};
|
|
99
|
+
structuredOutputSchema?: Type.TSchema;
|
|
100
|
+
callers?: readonly ("model" | "tools")[];
|
|
101
|
+
deferred?: true;
|
|
102
|
+
outputLimits?: {
|
|
103
|
+
readonly maxBytes?: number;
|
|
104
|
+
readonly maxLines?: number;
|
|
105
|
+
readonly retain?: "head" | "tail";
|
|
106
|
+
};
|
|
107
|
+
execute(args: {
|
|
108
|
+
command?: string;
|
|
109
|
+
}, api: import("@earendil-works/pi-durable").ToolExecutionApi<JsonValue>, context: import("@earendil-works/chord").Context): Promise<import("@earendil-works/pi-durable").ToolExecutionResult<JsonValue>>;
|
|
110
|
+
executionHints: {
|
|
111
|
+
discovery: "help";
|
|
112
|
+
inputSchema: {
|
|
113
|
+
type: string;
|
|
114
|
+
additionalProperties: boolean;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}>;
|
|
118
|
+
close: () => Promise<void>;
|
|
119
|
+
};
|