@effect-uai/core 0.9.0 → 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/dist/{AiError-CrdR1EQi.d.mts → AiError-Bf1pq4BB.d.mts} +8 -3
- package/dist/{AiError-CrdR1EQi.d.mts.map → AiError-Bf1pq4BB.d.mts.map} +1 -1
- package/dist/{Audio-DDSKCkSe.d.mts → Audio-CR7CSljJ.d.mts} +2 -2
- package/dist/{Audio-DDSKCkSe.d.mts.map → Audio-CR7CSljJ.d.mts.map} +1 -1
- package/dist/{Image-C_Zjpwhc.d.mts → Image-BZmKfIdq.d.mts} +2 -2
- package/dist/{Image-C_Zjpwhc.d.mts.map → Image-BZmKfIdq.d.mts.map} +1 -1
- package/dist/{Items-CgKD6Npw.d.mts → Items-BnIduEV2.d.mts} +9 -9
- package/dist/{Items-CgKD6Npw.d.mts.map → Items-BnIduEV2.d.mts.map} +1 -1
- package/dist/{Loop-B5_cqumi.d.mts → Loop-D8nWpowc.d.mts} +2 -2
- package/dist/{Loop-B5_cqumi.d.mts.map → Loop-D8nWpowc.d.mts.map} +1 -1
- package/dist/{Media-DOLyaygI.d.mts → Media-D_CpcM1Z.d.mts} +1 -1
- package/dist/{Media-DOLyaygI.d.mts.map → Media-D_CpcM1Z.d.mts.map} +1 -1
- package/dist/{StructuredFormat-CMJFD3sn.d.mts → StructuredFormat-DHaUJBdd.d.mts} +1 -1
- package/dist/{StructuredFormat-CMJFD3sn.d.mts.map → StructuredFormat-DHaUJBdd.d.mts.map} +1 -1
- package/dist/{Tool-0XUIT2A2.d.mts → Tool-2lC_XMth.d.mts} +64 -12
- package/dist/Tool-2lC_XMth.d.mts.map +1 -0
- package/dist/{ToolEvent-DYrAUJGs.d.mts → ToolEvent-cWZ2BnbS.d.mts} +2 -2
- package/dist/ToolEvent-cWZ2BnbS.d.mts.map +1 -0
- package/dist/{ToolResult-BZd-cEWW.d.mts → ToolResult-CL4hK_9z.d.mts} +10 -4
- package/dist/ToolResult-CL4hK_9z.d.mts.map +1 -0
- package/dist/{Toolkit-BKC8b8Xo.d.mts → Toolkit-Dr9l_hNy.d.mts} +64 -23
- package/dist/Toolkit-Dr9l_hNy.d.mts.map +1 -0
- package/dist/browser/Browser.d.mts +190 -0
- package/dist/browser/Browser.d.mts.map +1 -0
- package/dist/browser/Browser.mjs +34 -0
- package/dist/browser/Browser.mjs.map +1 -0
- package/dist/browser/BrowserError.d.mts +141 -0
- package/dist/browser/BrowserError.d.mts.map +1 -0
- package/dist/browser/BrowserError.mjs +89 -0
- package/dist/browser/BrowserError.mjs.map +1 -0
- package/dist/browser/BrowserTool.d.mts +58 -0
- package/dist/browser/BrowserTool.d.mts.map +1 -0
- package/dist/browser/BrowserTool.mjs +86 -0
- package/dist/browser/BrowserTool.mjs.map +1 -0
- package/dist/domain/AiError.d.mts +2 -2
- package/dist/domain/AiError.mjs +22 -3
- package/dist/domain/AiError.mjs.map +1 -1
- package/dist/domain/Audio.d.mts +1 -1
- package/dist/domain/Image.d.mts +1 -1
- package/dist/domain/Items.d.mts +1 -1
- package/dist/domain/Media.d.mts +1 -1
- package/dist/domain/Music.d.mts +1 -1
- package/dist/domain/Turn.d.mts +3 -3
- package/dist/embedding-model/Embedding.d.mts +1 -1
- package/dist/embedding-model/EmbeddingModel.d.mts +1 -1
- package/dist/index.d.mts +17 -12
- package/dist/index.mjs +14 -9
- package/dist/language-model/LanguageModel.d.mts +4 -4
- package/dist/loop/Loop.d.mts +1 -1
- package/dist/music-generator/MusicGenerator.d.mts +2 -2
- package/dist/observability/Metrics.d.mts +1 -1
- package/dist/retry/Retry.d.mts +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.d.mts +2 -2
- package/dist/structured-format/StructuredFormat.d.mts +1 -1
- package/dist/testing/MockMusicGenerator.d.mts +1 -1
- package/dist/testing/MockProvider.d.mts +1 -1
- package/dist/testing/MockSpeechSynthesizer.d.mts +1 -1
- package/dist/tool/Approval.d.mts +19 -7
- package/dist/tool/Approval.d.mts.map +1 -1
- package/dist/tool/Approval.mjs +18 -11
- package/dist/tool/Approval.mjs.map +1 -1
- package/dist/tool/Approval.test.mjs +46 -7
- package/dist/tool/Approval.test.mjs.map +1 -1
- package/dist/tool/HistoryCheck.d.mts +2 -2
- package/dist/tool/Tool.d.mts +2 -2
- package/dist/tool/Tool.mjs +86 -22
- package/dist/tool/Tool.mjs.map +1 -1
- package/dist/tool/ToolEvent.d.mts +1 -1
- package/dist/tool/ToolEvent.mjs +5 -0
- package/dist/tool/ToolEvent.mjs.map +1 -1
- package/dist/tool/ToolResult.d.mts +2 -2
- package/dist/tool/ToolResult.mjs +15 -6
- package/dist/tool/ToolResult.mjs.map +1 -1
- package/dist/tool/Toolkit.d.mts +2 -2
- package/dist/tool/Toolkit.mjs +62 -22
- package/dist/tool/Toolkit.mjs.map +1 -1
- package/dist/tool/Toolkit.test.mjs +163 -9
- package/dist/tool/Toolkit.test.mjs.map +1 -1
- package/dist/transcriber/Transcriber.d.mts +2 -2
- package/dist/web-read/WebRead.d.mts +44 -0
- package/dist/web-read/WebRead.d.mts.map +1 -0
- package/dist/web-read/WebRead.mjs +18 -0
- package/dist/web-read/WebRead.mjs.map +1 -0
- package/dist/web-read/WebReadTool.d.mts +57 -0
- package/dist/web-read/WebReadTool.d.mts.map +1 -0
- package/dist/web-read/WebReadTool.mjs +59 -0
- package/dist/web-read/WebReadTool.mjs.map +1 -0
- package/dist/web-search/WebSearch.d.mts +1 -1
- package/dist/web-search/WebSearchTool.d.mts +12 -6
- package/dist/web-search/WebSearchTool.d.mts.map +1 -1
- package/dist/web-search/WebSearchTool.mjs +10 -5
- package/dist/web-search/WebSearchTool.mjs.map +1 -1
- package/package.json +21 -1
- package/src/browser/Browser.ts +268 -0
- package/src/browser/BrowserError.ts +145 -0
- package/src/browser/BrowserTool.ts +161 -0
- package/src/domain/AiError.ts +27 -1
- package/src/index.ts +5 -0
- package/src/tool/Approval.test.ts +55 -5
- package/src/tool/Approval.ts +72 -27
- package/src/tool/Tool.ts +146 -47
- package/src/tool/ToolEvent.ts +5 -0
- package/src/tool/ToolResult.ts +14 -8
- package/src/tool/Toolkit.test.ts +171 -2
- package/src/tool/Toolkit.ts +173 -60
- package/src/web-read/WebRead.ts +70 -0
- package/src/web-read/WebReadTool.ts +96 -0
- package/src/web-search/WebSearchTool.ts +11 -5
- package/dist/Tool-0XUIT2A2.d.mts.map +0 -1
- package/dist/ToolEvent-DYrAUJGs.d.mts.map +0 -1
- package/dist/ToolResult-BZd-cEWW.d.mts.map +0 -1
- package/dist/Toolkit-BKC8b8Xo.d.mts.map +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { BrowserError } from "./BrowserError.mjs";
|
|
2
|
+
import { Brand, Context, Duration, Effect, Scope } from "effect";
|
|
3
|
+
|
|
4
|
+
//#region src/browser/Browser.d.ts
|
|
5
|
+
declare namespace Browser_d_exports {
|
|
6
|
+
export { AxNode, BoundingBox, Browser, BrowserService, BrowserSession, BrowserSessionId, BrowserSessionRef, CommonSessionRequest, Cookie, CookieApi, ElementInfo, PageFormat, ScreenshotOptions, ScrollDirection, ScrollOptions, attach, create, destroy, list };
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Session identifier. Branded `string` so providers don't accidentally
|
|
10
|
+
* accept a raw user-supplied id, and so a session id can't be passed where
|
|
11
|
+
* another service's id is expected. Each provider mints these per its own
|
|
12
|
+
* scheme; core code treats them opaquely. Mint via `BrowserSessionId(...)`.
|
|
13
|
+
*/
|
|
14
|
+
type BrowserSessionId = Brand.Branded<string, "BrowserSessionId">;
|
|
15
|
+
declare const BrowserSessionId: Brand.Constructor<BrowserSessionId>;
|
|
16
|
+
/** Reference returned by `list`; enough to `attach`. */
|
|
17
|
+
type BrowserSessionRef = {
|
|
18
|
+
readonly id: BrowserSessionId; /** Current top-level URL, when the provider reports it. */
|
|
19
|
+
readonly url?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Output representation for {@link BrowserSession.content}. `markdown` is
|
|
23
|
+
* the default.
|
|
24
|
+
*/
|
|
25
|
+
type PageFormat = "markdown" | "html";
|
|
26
|
+
/**
|
|
27
|
+
* Cross-provider session-create request. Provider-specific knobs (proxy,
|
|
28
|
+
* stealth, persistent profile, ...) live on each provider's narrowed
|
|
29
|
+
* request type which extends this.
|
|
30
|
+
*/
|
|
31
|
+
type CommonSessionRequest = {
|
|
32
|
+
/**
|
|
33
|
+
* Hard max lifetime of the session. Enforced locally (the handle is
|
|
34
|
+
* disposed and further calls fail with `BrowserSessionExpired`) and,
|
|
35
|
+
* where the provider supports it, passed through as a server-side cap so
|
|
36
|
+
* a crashed client still gets the session reclaimed. The provider cap
|
|
37
|
+
* must be >= the local reaper. Accepts millis, a string like
|
|
38
|
+
* `"5 minutes"`, or a `Duration`.
|
|
39
|
+
*/
|
|
40
|
+
readonly timeout?: Duration.Input;
|
|
41
|
+
/**
|
|
42
|
+
* Idle teardown: dispose the session after this much inactivity, the
|
|
43
|
+
* timer resetting on each operation. Opt-in; omit for no idle limit.
|
|
44
|
+
*/
|
|
45
|
+
readonly idleTimeout?: Duration.Input; /** Initial viewport size. Providers default differently. */
|
|
46
|
+
readonly viewport?: {
|
|
47
|
+
readonly width: number;
|
|
48
|
+
readonly height: number;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
type BoundingBox = {
|
|
52
|
+
readonly x: number;
|
|
53
|
+
readonly y: number;
|
|
54
|
+
readonly width: number;
|
|
55
|
+
readonly height: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* One element returned by {@link BrowserSession.query}. Serializable data,
|
|
59
|
+
* not a live handle (handles go stale across navigation and do not cross a
|
|
60
|
+
* provider boundary cleanly).
|
|
61
|
+
*/
|
|
62
|
+
type ElementInfo = {
|
|
63
|
+
/**
|
|
64
|
+
* Reference usable as a selector for a follow-up action. Valid until the
|
|
65
|
+
* next navigation; do not cache across `goto` or a page-changing click.
|
|
66
|
+
*/
|
|
67
|
+
readonly ref: string;
|
|
68
|
+
readonly tag: string;
|
|
69
|
+
readonly text?: string;
|
|
70
|
+
readonly attributes: Readonly<Record<string, string>>;
|
|
71
|
+
readonly box?: BoundingBox;
|
|
72
|
+
};
|
|
73
|
+
/** Accessibility-tree node returned by {@link BrowserSession.snapshot}. */
|
|
74
|
+
type AxNode = {
|
|
75
|
+
readonly role: string;
|
|
76
|
+
readonly name?: string;
|
|
77
|
+
readonly value?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Reference usable as a selector for a follow-up action. Valid until the
|
|
80
|
+
* next navigation; do not cache across `goto` or a page-changing click.
|
|
81
|
+
*/
|
|
82
|
+
readonly ref?: string;
|
|
83
|
+
readonly children: ReadonlyArray<AxNode>;
|
|
84
|
+
};
|
|
85
|
+
type ScrollDirection = "up" | "down" | "left" | "right";
|
|
86
|
+
type ScrollOptions = {
|
|
87
|
+
readonly direction: ScrollDirection; /** Distance in CSS pixels. Provider default applies when omitted. */
|
|
88
|
+
readonly pixels?: number;
|
|
89
|
+
};
|
|
90
|
+
type ScreenshotOptions = {
|
|
91
|
+
/** Clip to the first element matching this selector. */readonly selector?: string; /** Capture the full scrollable page rather than the viewport. */
|
|
92
|
+
readonly fullPage?: boolean;
|
|
93
|
+
};
|
|
94
|
+
type Cookie = {
|
|
95
|
+
readonly name: string;
|
|
96
|
+
readonly value: string;
|
|
97
|
+
readonly domain?: string;
|
|
98
|
+
readonly path?: string;
|
|
99
|
+
readonly expires?: number;
|
|
100
|
+
readonly httpOnly?: boolean;
|
|
101
|
+
readonly secure?: boolean;
|
|
102
|
+
readonly sameSite?: "Strict" | "Lax" | "None";
|
|
103
|
+
};
|
|
104
|
+
/** Read / write the session's cookie jar. Needed for authenticated flows. */
|
|
105
|
+
type CookieApi = {
|
|
106
|
+
readonly get: Effect.Effect<ReadonlyArray<Cookie>, BrowserError>;
|
|
107
|
+
readonly set: (cookies: ReadonlyArray<Cookie>) => Effect.Effect<void, BrowserError>;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Live session handle. Actions take a CSS selector string (so `#id` is
|
|
111
|
+
* just `#id`). Methods are plain `Effect` values; disposal is the scope
|
|
112
|
+
* finalizer, not a method here (see {@link BrowserService}). Anything not
|
|
113
|
+
* covered by a verb is reachable via `evaluate`. Per-operation time budgets
|
|
114
|
+
* are the provider's default; wrap any call in `Effect.timeout` for a
|
|
115
|
+
* tighter bound.
|
|
116
|
+
*/
|
|
117
|
+
type BrowserSession = {
|
|
118
|
+
readonly id: BrowserSessionId;
|
|
119
|
+
readonly goto: (url: string) => Effect.Effect<void, BrowserError>;
|
|
120
|
+
readonly waitFor: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
121
|
+
readonly click: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
122
|
+
readonly dblclick: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
123
|
+
readonly fill: (selector: string, text: string) => Effect.Effect<void, BrowserError>;
|
|
124
|
+
readonly type: (selector: string, text: string) => Effect.Effect<void, BrowserError>;
|
|
125
|
+
readonly press: (key: string) => Effect.Effect<void, BrowserError>;
|
|
126
|
+
readonly hover: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
127
|
+
readonly focus: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
128
|
+
readonly select: (selector: string, value: string) => Effect.Effect<void, BrowserError>;
|
|
129
|
+
readonly check: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
130
|
+
readonly uncheck: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
131
|
+
readonly scroll: (options: ScrollOptions) => Effect.Effect<void, BrowserError>;
|
|
132
|
+
readonly scrollIntoView: (selector: string) => Effect.Effect<void, BrowserError>;
|
|
133
|
+
readonly content: (format?: PageFormat) => Effect.Effect<string, BrowserError>;
|
|
134
|
+
readonly screenshot: (options?: ScreenshotOptions) => Effect.Effect<Uint8Array, BrowserError>;
|
|
135
|
+
readonly snapshot: Effect.Effect<AxNode, BrowserError>;
|
|
136
|
+
readonly query: (selector: string) => Effect.Effect<ReadonlyArray<ElementInfo>, BrowserError>;
|
|
137
|
+
readonly cookies: CookieApi;
|
|
138
|
+
readonly evaluate: (script: string) => Effect.Effect<unknown, BrowserError>;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Cross-provider browser service.
|
|
142
|
+
*
|
|
143
|
+
* Lifetime: `create` and `attach` return a handle in `Scope.Scope`. The
|
|
144
|
+
* scope finalizer disposes the session (close the transport, destroy or
|
|
145
|
+
* detach the remote session, kill the local engine). Bind with
|
|
146
|
+
* `Effect.scoped` for a single call, or hold a wider scope to keep a
|
|
147
|
+
* session warm across many calls. This is why there is no `dispose()` on
|
|
148
|
+
* {@link BrowserSession}; the scope is the lifecycle handle.
|
|
149
|
+
*/
|
|
150
|
+
type BrowserService = {
|
|
151
|
+
/**
|
|
152
|
+
* Provision a new session, bound to the caller's scope. Disposed on
|
|
153
|
+
* scope close.
|
|
154
|
+
*/
|
|
155
|
+
readonly create: (request: CommonSessionRequest) => Effect.Effect<BrowserSession, BrowserError, Scope.Scope>;
|
|
156
|
+
/**
|
|
157
|
+
* Re-acquire an existing session by id. Scope-bound, but the finalizer
|
|
158
|
+
* detaches rather than destroying, for sessions kept warm beyond a
|
|
159
|
+
* single run.
|
|
160
|
+
*/
|
|
161
|
+
readonly attach: (id: BrowserSessionId) => Effect.Effect<BrowserSession, BrowserError, Scope.Scope>; /** Enumerate sessions visible to the configured account / project. */
|
|
162
|
+
readonly list: Effect.Effect<ReadonlyArray<BrowserSessionRef>, BrowserError>;
|
|
163
|
+
/**
|
|
164
|
+
* Destroy a session from outside its owning scope. Most callers should
|
|
165
|
+
* let the scope finalizer handle this.
|
|
166
|
+
*/
|
|
167
|
+
readonly destroy: (id: BrowserSessionId) => Effect.Effect<void, BrowserError>;
|
|
168
|
+
};
|
|
169
|
+
declare const Browser_base: Context.ServiceClass<Browser, "@betalyra/effect-uai/Browser", BrowserService>;
|
|
170
|
+
declare class Browser extends Browser_base {}
|
|
171
|
+
/**
|
|
172
|
+
* Provision a session bound to the caller's scope. Drop the `Scope.Scope`
|
|
173
|
+
* requirement with `Effect.scoped`.
|
|
174
|
+
*/
|
|
175
|
+
declare const create: (request: CommonSessionRequest) => Effect.Effect<BrowserSession, BrowserError, Browser | Scope.Scope>;
|
|
176
|
+
/**
|
|
177
|
+
* Re-acquire an existing session by id. Same scope semantics as `create`,
|
|
178
|
+
* but the finalizer detaches rather than destroying.
|
|
179
|
+
*/
|
|
180
|
+
declare const attach: (id: BrowserSessionId) => Effect.Effect<BrowserSession, BrowserError, Browser | Scope.Scope>;
|
|
181
|
+
/** Enumerate sessions for the configured account / project. */
|
|
182
|
+
declare const list: Effect.Effect<ReadonlyArray<BrowserSessionRef>, BrowserError, Browser>;
|
|
183
|
+
/**
|
|
184
|
+
* Destroy a session from outside its owning scope. Most callers should let
|
|
185
|
+
* the scope finalizer handle this automatically.
|
|
186
|
+
*/
|
|
187
|
+
declare const destroy: (id: BrowserSessionId) => Effect.Effect<void, BrowserError, Browser>;
|
|
188
|
+
//#endregion
|
|
189
|
+
export { AxNode, BoundingBox, Browser, BrowserService, BrowserSession, BrowserSessionId, BrowserSessionRef, CommonSessionRequest, Cookie, CookieApi, ElementInfo, PageFormat, ScreenshotOptions, ScrollDirection, ScrollOptions, attach, create, destroy, list, Browser_d_exports as t };
|
|
190
|
+
//# sourceMappingURL=Browser.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Browser.d.mts","names":[],"sources":["../../src/browser/Browser.ts"],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
import { Brand, Context, Effect } from "effect";
|
|
3
|
+
//#region src/browser/Browser.ts
|
|
4
|
+
var Browser_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Browser: () => Browser,
|
|
6
|
+
BrowserSessionId: () => BrowserSessionId,
|
|
7
|
+
attach: () => attach,
|
|
8
|
+
create: () => create,
|
|
9
|
+
destroy: () => destroy,
|
|
10
|
+
list: () => list
|
|
11
|
+
});
|
|
12
|
+
const BrowserSessionId = Brand.nominal();
|
|
13
|
+
var Browser = class extends Context.Service()("@betalyra/effect-uai/Browser") {};
|
|
14
|
+
/**
|
|
15
|
+
* Provision a session bound to the caller's scope. Drop the `Scope.Scope`
|
|
16
|
+
* requirement with `Effect.scoped`.
|
|
17
|
+
*/
|
|
18
|
+
const create = (request) => Effect.flatMap(Browser.asEffect(), (s) => s.create(request));
|
|
19
|
+
/**
|
|
20
|
+
* Re-acquire an existing session by id. Same scope semantics as `create`,
|
|
21
|
+
* but the finalizer detaches rather than destroying.
|
|
22
|
+
*/
|
|
23
|
+
const attach = (id) => Effect.flatMap(Browser.asEffect(), (s) => s.attach(id));
|
|
24
|
+
/** Enumerate sessions for the configured account / project. */
|
|
25
|
+
const list = Effect.flatMap(Browser.asEffect(), (s) => s.list);
|
|
26
|
+
/**
|
|
27
|
+
* Destroy a session from outside its owning scope. Most callers should let
|
|
28
|
+
* the scope finalizer handle this automatically.
|
|
29
|
+
*/
|
|
30
|
+
const destroy = (id) => Effect.flatMap(Browser.asEffect(), (s) => s.destroy(id));
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Browser, BrowserSessionId, attach, create, destroy, list, Browser_exports as t };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=Browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Browser.mjs","names":[],"sources":["../../src/browser/Browser.ts"],"sourcesContent":["import { Brand, Context, type Duration, Effect, Scope } from \"effect\"\nimport type * as BrowserError from \"./BrowserError.js\"\n\n// ---------------------------------------------------------------------------\n// Identity\n// ---------------------------------------------------------------------------\n\n/**\n * Session identifier. Branded `string` so providers don't accidentally\n * accept a raw user-supplied id, and so a session id can't be passed where\n * another service's id is expected. Each provider mints these per its own\n * scheme; core code treats them opaquely. Mint via `BrowserSessionId(...)`.\n */\nexport type BrowserSessionId = Brand.Branded<string, \"BrowserSessionId\">\nexport const BrowserSessionId = Brand.nominal<BrowserSessionId>()\n\n/** Reference returned by `list`; enough to `attach`. */\nexport type BrowserSessionRef = {\n readonly id: BrowserSessionId\n /** Current top-level URL, when the provider reports it. */\n readonly url?: string\n}\n\n/**\n * Output representation for {@link BrowserSession.content}. `markdown` is\n * the default.\n */\nexport type PageFormat = \"markdown\" | \"html\"\n\n// ---------------------------------------------------------------------------\n// Create request\n// ---------------------------------------------------------------------------\n\n/**\n * Cross-provider session-create request. Provider-specific knobs (proxy,\n * stealth, persistent profile, ...) live on each provider's narrowed\n * request type which extends this.\n */\nexport type CommonSessionRequest = {\n /**\n * Hard max lifetime of the session. Enforced locally (the handle is\n * disposed and further calls fail with `BrowserSessionExpired`) and,\n * where the provider supports it, passed through as a server-side cap so\n * a crashed client still gets the session reclaimed. The provider cap\n * must be >= the local reaper. Accepts millis, a string like\n * `\"5 minutes\"`, or a `Duration`.\n */\n readonly timeout?: Duration.Input\n /**\n * Idle teardown: dispose the session after this much inactivity, the\n * timer resetting on each operation. Opt-in; omit for no idle limit.\n */\n readonly idleTimeout?: Duration.Input\n /** Initial viewport size. Providers default differently. */\n readonly viewport?: { readonly width: number; readonly height: number }\n}\n\n// ---------------------------------------------------------------------------\n// Observation shapes\n// ---------------------------------------------------------------------------\n\nexport type BoundingBox = {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n}\n\n/**\n * One element returned by {@link BrowserSession.query}. Serializable data,\n * not a live handle (handles go stale across navigation and do not cross a\n * provider boundary cleanly).\n */\nexport type ElementInfo = {\n /**\n * Reference usable as a selector for a follow-up action. Valid until the\n * next navigation; do not cache across `goto` or a page-changing click.\n */\n readonly ref: string\n readonly tag: string\n readonly text?: string\n readonly attributes: Readonly<Record<string, string>>\n readonly box?: BoundingBox\n}\n\n/** Accessibility-tree node returned by {@link BrowserSession.snapshot}. */\nexport type AxNode = {\n readonly role: string\n readonly name?: string\n readonly value?: string\n /**\n * Reference usable as a selector for a follow-up action. Valid until the\n * next navigation; do not cache across `goto` or a page-changing click.\n */\n readonly ref?: string\n readonly children: ReadonlyArray<AxNode>\n}\n\n// ---------------------------------------------------------------------------\n// Interaction shapes\n// ---------------------------------------------------------------------------\n\nexport type ScrollDirection = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type ScrollOptions = {\n readonly direction: ScrollDirection\n /** Distance in CSS pixels. Provider default applies when omitted. */\n readonly pixels?: number\n}\n\nexport type ScreenshotOptions = {\n /** Clip to the first element matching this selector. */\n readonly selector?: string\n /** Capture the full scrollable page rather than the viewport. */\n readonly fullPage?: boolean\n}\n\nexport type Cookie = {\n readonly name: string\n readonly value: string\n readonly domain?: string\n readonly path?: string\n readonly expires?: number\n readonly httpOnly?: boolean\n readonly secure?: boolean\n readonly sameSite?: \"Strict\" | \"Lax\" | \"None\"\n}\n\n/** Read / write the session's cookie jar. Needed for authenticated flows. */\nexport type CookieApi = {\n readonly get: Effect.Effect<ReadonlyArray<Cookie>, BrowserError.BrowserError>\n readonly set: (cookies: ReadonlyArray<Cookie>) => Effect.Effect<void, BrowserError.BrowserError>\n}\n\n// ---------------------------------------------------------------------------\n// Live session handle\n// ---------------------------------------------------------------------------\n\n/**\n * Live session handle. Actions take a CSS selector string (so `#id` is\n * just `#id`). Methods are plain `Effect` values; disposal is the scope\n * finalizer, not a method here (see {@link BrowserService}). Anything not\n * covered by a verb is reachable via `evaluate`. Per-operation time budgets\n * are the provider's default; wrap any call in `Effect.timeout` for a\n * tighter bound.\n */\nexport type BrowserSession = {\n readonly id: BrowserSessionId\n\n // Navigation and waiting\n readonly goto: (url: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly waitFor: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n\n // Interaction\n readonly click: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly dblclick: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly fill: (selector: string, text: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly type: (selector: string, text: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly press: (key: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly hover: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly focus: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly select: (\n selector: string,\n value: string,\n ) => Effect.Effect<void, BrowserError.BrowserError>\n readonly check: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly uncheck: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n readonly scroll: (options: ScrollOptions) => Effect.Effect<void, BrowserError.BrowserError>\n readonly scrollIntoView: (selector: string) => Effect.Effect<void, BrowserError.BrowserError>\n\n // Observation\n readonly content: (format?: PageFormat) => Effect.Effect<string, BrowserError.BrowserError>\n readonly screenshot: (\n options?: ScreenshotOptions,\n ) => Effect.Effect<Uint8Array, BrowserError.BrowserError>\n readonly snapshot: Effect.Effect<AxNode, BrowserError.BrowserError>\n readonly query: (\n selector: string,\n ) => Effect.Effect<ReadonlyArray<ElementInfo>, BrowserError.BrowserError>\n\n // State and escape hatch\n readonly cookies: CookieApi\n readonly evaluate: (script: string) => Effect.Effect<unknown, BrowserError.BrowserError>\n}\n\n// ---------------------------------------------------------------------------\n// Service definition\n// ---------------------------------------------------------------------------\n\n/**\n * Cross-provider browser service.\n *\n * Lifetime: `create` and `attach` return a handle in `Scope.Scope`. The\n * scope finalizer disposes the session (close the transport, destroy or\n * detach the remote session, kill the local engine). Bind with\n * `Effect.scoped` for a single call, or hold a wider scope to keep a\n * session warm across many calls. This is why there is no `dispose()` on\n * {@link BrowserSession}; the scope is the lifecycle handle.\n */\nexport type BrowserService = {\n /**\n * Provision a new session, bound to the caller's scope. Disposed on\n * scope close.\n */\n readonly create: (\n request: CommonSessionRequest,\n ) => Effect.Effect<BrowserSession, BrowserError.BrowserError, Scope.Scope>\n\n /**\n * Re-acquire an existing session by id. Scope-bound, but the finalizer\n * detaches rather than destroying, for sessions kept warm beyond a\n * single run.\n */\n readonly attach: (\n id: BrowserSessionId,\n ) => Effect.Effect<BrowserSession, BrowserError.BrowserError, Scope.Scope>\n\n /** Enumerate sessions visible to the configured account / project. */\n readonly list: Effect.Effect<ReadonlyArray<BrowserSessionRef>, BrowserError.BrowserError>\n\n /**\n * Destroy a session from outside its owning scope. Most callers should\n * let the scope finalizer handle this.\n */\n readonly destroy: (id: BrowserSessionId) => Effect.Effect<void, BrowserError.BrowserError>\n}\n\nexport class Browser extends Context.Service<Browser, BrowserService>()(\n \"@betalyra/effect-uai/Browser\",\n) {}\n\n// ---------------------------------------------------------------------------\n// Free helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Provision a session bound to the caller's scope. Drop the `Scope.Scope`\n * requirement with `Effect.scoped`.\n */\nexport const create = (\n request: CommonSessionRequest,\n): Effect.Effect<BrowserSession, BrowserError.BrowserError, Browser | Scope.Scope> =>\n Effect.flatMap(Browser.asEffect(), (s) => s.create(request))\n\n/**\n * Re-acquire an existing session by id. Same scope semantics as `create`,\n * but the finalizer detaches rather than destroying.\n */\nexport const attach = (\n id: BrowserSessionId,\n): Effect.Effect<BrowserSession, BrowserError.BrowserError, Browser | Scope.Scope> =>\n Effect.flatMap(Browser.asEffect(), (s) => s.attach(id))\n\n/** Enumerate sessions for the configured account / project. */\nexport const list: Effect.Effect<\n ReadonlyArray<BrowserSessionRef>,\n BrowserError.BrowserError,\n Browser\n> = Effect.flatMap(Browser.asEffect(), (s) => s.list)\n\n/**\n * Destroy a session from outside its owning scope. Most callers should let\n * the scope finalizer handle this automatically.\n */\nexport const destroy = (\n id: BrowserSessionId,\n): Effect.Effect<void, BrowserError.BrowserError, Browser> =>\n Effect.flatMap(Browser.asEffect(), (s) => s.destroy(id))\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,mBAAmB,MAAM,SAA2B;AAqNjE,IAAa,UAAb,cAA6B,QAAQ,SAAkC,CACrE,+BACD,CAAC;;;;;AAUF,MAAa,UACX,YAEA,OAAO,QAAQ,QAAQ,UAAU,GAAG,MAAM,EAAE,OAAO,QAAQ,CAAC;;;;;AAM9D,MAAa,UACX,OAEA,OAAO,QAAQ,QAAQ,UAAU,GAAG,MAAM,EAAE,OAAO,GAAG,CAAC;;AAGzD,MAAa,OAIT,OAAO,QAAQ,QAAQ,UAAU,GAAG,MAAM,EAAE,KAAK;;;;;AAMrD,MAAa,WACX,OAEA,OAAO,QAAQ,QAAQ,UAAU,GAAG,MAAM,EAAE,QAAQ,GAAG,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Duration } from "effect";
|
|
2
|
+
import * as _$effect_Cause0 from "effect/Cause";
|
|
3
|
+
import * as _$effect_Types0 from "effect/Types";
|
|
4
|
+
|
|
5
|
+
//#region src/browser/BrowserError.d.ts
|
|
6
|
+
declare namespace BrowserError_d_exports {
|
|
7
|
+
export { BrowserActionFailed, BrowserAuthFailed, BrowserAuthSubtype, BrowserCreateFailed, BrowserError, BrowserInvalidRequest, BrowserQuotaExceeded, BrowserSessionExpired, BrowserSessionNotFound, BrowserTimeout, BrowserUnsupported, describe };
|
|
8
|
+
}
|
|
9
|
+
declare const BrowserCreateFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
10
|
+
readonly _tag: "BrowserCreateFailed";
|
|
11
|
+
} & Readonly<A>;
|
|
12
|
+
/**
|
|
13
|
+
* Failed to provision a browser session: the transport could not connect,
|
|
14
|
+
* a launched engine did not come up, or the provider refused to mint a
|
|
15
|
+
* session. Provider's structured reason on `reason`; the raw transport /
|
|
16
|
+
* SDK error on `raw`.
|
|
17
|
+
*/
|
|
18
|
+
declare class BrowserCreateFailed extends BrowserCreateFailed_base<{
|
|
19
|
+
provider: string;
|
|
20
|
+
reason?: string;
|
|
21
|
+
raw: unknown;
|
|
22
|
+
}> {}
|
|
23
|
+
declare const BrowserSessionNotFound_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
24
|
+
readonly _tag: "BrowserSessionNotFound";
|
|
25
|
+
} & Readonly<A>;
|
|
26
|
+
/**
|
|
27
|
+
* The requested session id does not exist. Raised by `attach` / `destroy`
|
|
28
|
+
* against a stale or never-known id. Distinct from
|
|
29
|
+
* {@link BrowserSessionExpired}, which is a session that existed and has
|
|
30
|
+
* since ended.
|
|
31
|
+
*/
|
|
32
|
+
declare class BrowserSessionNotFound extends BrowserSessionNotFound_base<{
|
|
33
|
+
provider: string;
|
|
34
|
+
id: string;
|
|
35
|
+
}> {}
|
|
36
|
+
declare const BrowserSessionExpired_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
37
|
+
readonly _tag: "BrowserSessionExpired";
|
|
38
|
+
} & Readonly<A>;
|
|
39
|
+
/**
|
|
40
|
+
* An operation was issued against a session that has ended: it reached its
|
|
41
|
+
* max lifetime (the create-time `timeout`), was destroyed, or the provider
|
|
42
|
+
* reaped it. The handle is dead; `create` or `attach` a live session.
|
|
43
|
+
* Distinct from {@link BrowserTimeout} (a single live operation was too
|
|
44
|
+
* slow).
|
|
45
|
+
*/
|
|
46
|
+
declare class BrowserSessionExpired extends BrowserSessionExpired_base<{
|
|
47
|
+
provider: string;
|
|
48
|
+
id: string;
|
|
49
|
+
}> {}
|
|
50
|
+
declare const BrowserTimeout_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
51
|
+
readonly _tag: "BrowserTimeout";
|
|
52
|
+
} & Readonly<A>;
|
|
53
|
+
/**
|
|
54
|
+
* A single operation exceeded its own time budget while the session was
|
|
55
|
+
* still alive (a navigation that never settled, a `waitFor` selector that
|
|
56
|
+
* never appeared). Carries the breached budget for observability.
|
|
57
|
+
*/
|
|
58
|
+
declare class BrowserTimeout extends BrowserTimeout_base<{
|
|
59
|
+
provider: string;
|
|
60
|
+
operation: "create" | "attach" | "navigate" | "action" | "query";
|
|
61
|
+
budget?: Duration.Duration;
|
|
62
|
+
raw?: unknown;
|
|
63
|
+
}> {}
|
|
64
|
+
declare const BrowserActionFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
65
|
+
readonly _tag: "BrowserActionFailed";
|
|
66
|
+
} & Readonly<A>;
|
|
67
|
+
/**
|
|
68
|
+
* An interaction or observation failed at the transport / protocol layer:
|
|
69
|
+
* a selector resolved to nothing, an element was not actionable, an
|
|
70
|
+
* `evaluate` script threw, a navigation errored. `selector` and `reason`
|
|
71
|
+
* carry what is known.
|
|
72
|
+
*/
|
|
73
|
+
declare class BrowserActionFailed extends BrowserActionFailed_base<{
|
|
74
|
+
provider: string;
|
|
75
|
+
operation: "navigate" | "interact" | "observe" | "evaluate" | "cookies";
|
|
76
|
+
selector?: string;
|
|
77
|
+
reason?: string;
|
|
78
|
+
raw: unknown;
|
|
79
|
+
}> {}
|
|
80
|
+
declare const BrowserQuotaExceeded_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
81
|
+
readonly _tag: "BrowserQuotaExceeded";
|
|
82
|
+
} & Readonly<A>;
|
|
83
|
+
/**
|
|
84
|
+
* Provider rejected the request because an account / project quota or
|
|
85
|
+
* concurrency limit was exceeded. Separate from {@link BrowserCreateFailed}
|
|
86
|
+
* so callers can back off and retry.
|
|
87
|
+
*/
|
|
88
|
+
declare class BrowserQuotaExceeded extends BrowserQuotaExceeded_base<{
|
|
89
|
+
provider: string;
|
|
90
|
+
reason?: string;
|
|
91
|
+
raw: unknown;
|
|
92
|
+
}> {}
|
|
93
|
+
declare const BrowserInvalidRequest_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
94
|
+
readonly _tag: "BrowserInvalidRequest";
|
|
95
|
+
} & Readonly<A>;
|
|
96
|
+
/**
|
|
97
|
+
* Caller's request shape is malformed for the wired provider. Adapters
|
|
98
|
+
* should reject at the request-schema layer where possible; this is the
|
|
99
|
+
* runtime fallback.
|
|
100
|
+
*/
|
|
101
|
+
declare class BrowserInvalidRequest extends BrowserInvalidRequest_base<{
|
|
102
|
+
provider: string;
|
|
103
|
+
param?: string;
|
|
104
|
+
reason?: string;
|
|
105
|
+
raw?: unknown;
|
|
106
|
+
}> {}
|
|
107
|
+
/**
|
|
108
|
+
* Transport could not authenticate against the provider. Subtype mirrors
|
|
109
|
+
* the model-side `AiError.AuthFailed` shape for consistency.
|
|
110
|
+
*/
|
|
111
|
+
type BrowserAuthSubtype = "auth" | "permission" | "billing" | "quota";
|
|
112
|
+
declare const BrowserAuthFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
113
|
+
readonly _tag: "BrowserAuthFailed";
|
|
114
|
+
} & Readonly<A>;
|
|
115
|
+
declare class BrowserAuthFailed extends BrowserAuthFailed_base<{
|
|
116
|
+
provider: string;
|
|
117
|
+
subtype: BrowserAuthSubtype;
|
|
118
|
+
raw: unknown;
|
|
119
|
+
}> {}
|
|
120
|
+
declare const BrowserUnsupported_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
121
|
+
readonly _tag: "BrowserUnsupported";
|
|
122
|
+
} & Readonly<A>;
|
|
123
|
+
/**
|
|
124
|
+
* The wired provider does not implement the requested operation for these
|
|
125
|
+
* inputs. Distinct from {@link BrowserInvalidRequest} (malformed request)
|
|
126
|
+
* and from compile-time capability markers gating blanket provider gaps.
|
|
127
|
+
*/
|
|
128
|
+
declare class BrowserUnsupported extends BrowserUnsupported_base<{
|
|
129
|
+
provider: string;
|
|
130
|
+
capability: string;
|
|
131
|
+
reason?: string;
|
|
132
|
+
}> {}
|
|
133
|
+
type BrowserError = BrowserCreateFailed | BrowserSessionNotFound | BrowserSessionExpired | BrowserTimeout | BrowserActionFailed | BrowserQuotaExceeded | BrowserInvalidRequest | BrowserAuthFailed | BrowserUnsupported;
|
|
134
|
+
/**
|
|
135
|
+
* Short human-readable description of an error, for logs and model-facing
|
|
136
|
+
* failure messages. Prose, not a contract; branch on `_tag` instead.
|
|
137
|
+
*/
|
|
138
|
+
declare const describe: (e: BrowserError) => string;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { BrowserActionFailed, BrowserAuthFailed, BrowserAuthSubtype, BrowserCreateFailed, BrowserError, BrowserInvalidRequest, BrowserQuotaExceeded, BrowserSessionExpired, BrowserSessionNotFound, BrowserTimeout, BrowserUnsupported, describe, BrowserError_d_exports as t };
|
|
141
|
+
//# sourceMappingURL=BrowserError.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserError.d.mts","names":[],"sources":["../../src/browser/BrowserError.ts"],"mappings":";;;;;;;;cAA8C,wBAAA;;;;;;;;;cAQjC,mBAAA,SAA4B,wBAAA;EACvC,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,2BAAA;;;;AAZyC;;;;;cAoBjC,sBAAA,SAA+B,2BAAA;EAC1C,QAAA;EACA,EAAA;AAAA;AAAA,cACG,0BAAA;;;;;;;;;;cASQ,qBAAA,SAA8B,0BAAA;EACzC,QAAA;EACA,EAAA;AAAA;AAAA,cACG,mBAAA;;;;;;AA3BL;;cAkCa,cAAA,SAAuB,mBAAA;EAClC,QAAA;EACA,SAAA;EACA,MAAA,GAAS,QAAA,CAAS,QAAA;EAClB,GAAA;AAAA;AAAA,cACG,wBAAA;;;;;;;;;cAQQ,mBAAA,SAA4B,wBAAA;EACvC,QAAA;EACA,SAAA;EACA,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,yBAAA;;;;;;;;cAOQ,oBAAA,SAA6B,yBAAA;EACxC,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,0BAAA;;;;;;;;cAOQ,qBAAA,SAA8B,0BAAA;EACzC,QAAA;EACA,KAAA;EACA,MAAA;EACA,GAAA;AAAA;;;;;KAOU,kBAAA;AAAA,cAAgE,sBAAA;;;cAE/D,iBAAA,SAA0B,sBAAA;EACrC,QAAA;EACA,OAAA,EAAS,kBAAA;EACT,GAAA;AAAA;AAAA,cACG,uBAAA;;;;;;;;cAOQ,kBAAA,SAA2B,uBAAA;EACtC,QAAA;EACA,UAAA;EACA,MAAA;AAAA;AAAA,KAGU,YAAA,GACR,mBAAA,GACA,sBAAA,GACA,qBAAA,GACA,cAAA,GACA,mBAAA,GACA,oBAAA,GACA,qBAAA,GACA,iBAAA,GACA,kBAAA;;;;;cASS,QAAA,GAAW,CAAA,EAAG,YAAA"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
import { Data, Match } from "effect";
|
|
3
|
+
//#region src/browser/BrowserError.ts
|
|
4
|
+
var BrowserError_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
BrowserActionFailed: () => BrowserActionFailed,
|
|
6
|
+
BrowserAuthFailed: () => BrowserAuthFailed,
|
|
7
|
+
BrowserCreateFailed: () => BrowserCreateFailed,
|
|
8
|
+
BrowserInvalidRequest: () => BrowserInvalidRequest,
|
|
9
|
+
BrowserQuotaExceeded: () => BrowserQuotaExceeded,
|
|
10
|
+
BrowserSessionExpired: () => BrowserSessionExpired,
|
|
11
|
+
BrowserSessionNotFound: () => BrowserSessionNotFound,
|
|
12
|
+
BrowserTimeout: () => BrowserTimeout,
|
|
13
|
+
BrowserUnsupported: () => BrowserUnsupported,
|
|
14
|
+
describe: () => describe
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Failed to provision a browser session: the transport could not connect,
|
|
18
|
+
* a launched engine did not come up, or the provider refused to mint a
|
|
19
|
+
* session. Provider's structured reason on `reason`; the raw transport /
|
|
20
|
+
* SDK error on `raw`.
|
|
21
|
+
*/
|
|
22
|
+
var BrowserCreateFailed = class extends Data.TaggedError("BrowserCreateFailed") {};
|
|
23
|
+
/**
|
|
24
|
+
* The requested session id does not exist. Raised by `attach` / `destroy`
|
|
25
|
+
* against a stale or never-known id. Distinct from
|
|
26
|
+
* {@link BrowserSessionExpired}, which is a session that existed and has
|
|
27
|
+
* since ended.
|
|
28
|
+
*/
|
|
29
|
+
var BrowserSessionNotFound = class extends Data.TaggedError("BrowserSessionNotFound") {};
|
|
30
|
+
/**
|
|
31
|
+
* An operation was issued against a session that has ended: it reached its
|
|
32
|
+
* max lifetime (the create-time `timeout`), was destroyed, or the provider
|
|
33
|
+
* reaped it. The handle is dead; `create` or `attach` a live session.
|
|
34
|
+
* Distinct from {@link BrowserTimeout} (a single live operation was too
|
|
35
|
+
* slow).
|
|
36
|
+
*/
|
|
37
|
+
var BrowserSessionExpired = class extends Data.TaggedError("BrowserSessionExpired") {};
|
|
38
|
+
/**
|
|
39
|
+
* A single operation exceeded its own time budget while the session was
|
|
40
|
+
* still alive (a navigation that never settled, a `waitFor` selector that
|
|
41
|
+
* never appeared). Carries the breached budget for observability.
|
|
42
|
+
*/
|
|
43
|
+
var BrowserTimeout = class extends Data.TaggedError("BrowserTimeout") {};
|
|
44
|
+
/**
|
|
45
|
+
* An interaction or observation failed at the transport / protocol layer:
|
|
46
|
+
* a selector resolved to nothing, an element was not actionable, an
|
|
47
|
+
* `evaluate` script threw, a navigation errored. `selector` and `reason`
|
|
48
|
+
* carry what is known.
|
|
49
|
+
*/
|
|
50
|
+
var BrowserActionFailed = class extends Data.TaggedError("BrowserActionFailed") {};
|
|
51
|
+
/**
|
|
52
|
+
* Provider rejected the request because an account / project quota or
|
|
53
|
+
* concurrency limit was exceeded. Separate from {@link BrowserCreateFailed}
|
|
54
|
+
* so callers can back off and retry.
|
|
55
|
+
*/
|
|
56
|
+
var BrowserQuotaExceeded = class extends Data.TaggedError("BrowserQuotaExceeded") {};
|
|
57
|
+
/**
|
|
58
|
+
* Caller's request shape is malformed for the wired provider. Adapters
|
|
59
|
+
* should reject at the request-schema layer where possible; this is the
|
|
60
|
+
* runtime fallback.
|
|
61
|
+
*/
|
|
62
|
+
var BrowserInvalidRequest = class extends Data.TaggedError("BrowserInvalidRequest") {};
|
|
63
|
+
var BrowserAuthFailed = class extends Data.TaggedError("BrowserAuthFailed") {};
|
|
64
|
+
/**
|
|
65
|
+
* The wired provider does not implement the requested operation for these
|
|
66
|
+
* inputs. Distinct from {@link BrowserInvalidRequest} (malformed request)
|
|
67
|
+
* and from compile-time capability markers gating blanket provider gaps.
|
|
68
|
+
*/
|
|
69
|
+
var BrowserUnsupported = class extends Data.TaggedError("BrowserUnsupported") {};
|
|
70
|
+
const withReason = (base, reason) => reason === void 0 ? base : `${base}: ${reason}`;
|
|
71
|
+
/**
|
|
72
|
+
* Short human-readable description of an error, for logs and model-facing
|
|
73
|
+
* failure messages. Prose, not a contract; branch on `_tag` instead.
|
|
74
|
+
*/
|
|
75
|
+
const describe = Match.type().pipe(Match.discriminatorsExhaustive("_tag")({
|
|
76
|
+
BrowserCreateFailed: (e) => withReason("the browser session could not be created", e.reason),
|
|
77
|
+
BrowserSessionNotFound: () => "the browser session does not exist",
|
|
78
|
+
BrowserSessionExpired: () => "the browser session has expired",
|
|
79
|
+
BrowserTimeout: (e) => `the ${e.operation} operation timed out`,
|
|
80
|
+
BrowserActionFailed: (e) => withReason(`the ${e.operation} failed${e.selector === void 0 ? "" : ` on ${e.selector}`}`, e.reason),
|
|
81
|
+
BrowserQuotaExceeded: (e) => withReason("the browser quota is exceeded", e.reason),
|
|
82
|
+
BrowserInvalidRequest: (e) => withReason("the request was invalid", e.reason),
|
|
83
|
+
BrowserAuthFailed: (e) => `browser authentication failed (${e.subtype})`,
|
|
84
|
+
BrowserUnsupported: (e) => withReason(`this browser does not support ${e.capability}`, e.reason)
|
|
85
|
+
}));
|
|
86
|
+
//#endregion
|
|
87
|
+
export { BrowserActionFailed, BrowserAuthFailed, BrowserCreateFailed, BrowserInvalidRequest, BrowserQuotaExceeded, BrowserSessionExpired, BrowserSessionNotFound, BrowserTimeout, BrowserUnsupported, describe, BrowserError_exports as t };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=BrowserError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserError.mjs","names":[],"sources":["../../src/browser/BrowserError.ts"],"sourcesContent":["import { Data, Duration, Match } from \"effect\"\n\n/**\n * Failed to provision a browser session: the transport could not connect,\n * a launched engine did not come up, or the provider refused to mint a\n * session. Provider's structured reason on `reason`; the raw transport /\n * SDK error on `raw`.\n */\nexport class BrowserCreateFailed extends Data.TaggedError(\"BrowserCreateFailed\")<{\n provider: string\n reason?: string\n raw: unknown\n}> {}\n\n/**\n * The requested session id does not exist. Raised by `attach` / `destroy`\n * against a stale or never-known id. Distinct from\n * {@link BrowserSessionExpired}, which is a session that existed and has\n * since ended.\n */\nexport class BrowserSessionNotFound extends Data.TaggedError(\"BrowserSessionNotFound\")<{\n provider: string\n id: string\n}> {}\n\n/**\n * An operation was issued against a session that has ended: it reached its\n * max lifetime (the create-time `timeout`), was destroyed, or the provider\n * reaped it. The handle is dead; `create` or `attach` a live session.\n * Distinct from {@link BrowserTimeout} (a single live operation was too\n * slow).\n */\nexport class BrowserSessionExpired extends Data.TaggedError(\"BrowserSessionExpired\")<{\n provider: string\n id: string\n}> {}\n\n/**\n * A single operation exceeded its own time budget while the session was\n * still alive (a navigation that never settled, a `waitFor` selector that\n * never appeared). Carries the breached budget for observability.\n */\nexport class BrowserTimeout extends Data.TaggedError(\"BrowserTimeout\")<{\n provider: string\n operation: \"create\" | \"attach\" | \"navigate\" | \"action\" | \"query\"\n budget?: Duration.Duration\n raw?: unknown\n}> {}\n\n/**\n * An interaction or observation failed at the transport / protocol layer:\n * a selector resolved to nothing, an element was not actionable, an\n * `evaluate` script threw, a navigation errored. `selector` and `reason`\n * carry what is known.\n */\nexport class BrowserActionFailed extends Data.TaggedError(\"BrowserActionFailed\")<{\n provider: string\n operation: \"navigate\" | \"interact\" | \"observe\" | \"evaluate\" | \"cookies\"\n selector?: string\n reason?: string\n raw: unknown\n}> {}\n\n/**\n * Provider rejected the request because an account / project quota or\n * concurrency limit was exceeded. Separate from {@link BrowserCreateFailed}\n * so callers can back off and retry.\n */\nexport class BrowserQuotaExceeded extends Data.TaggedError(\"BrowserQuotaExceeded\")<{\n provider: string\n reason?: string\n raw: unknown\n}> {}\n\n/**\n * Caller's request shape is malformed for the wired provider. Adapters\n * should reject at the request-schema layer where possible; this is the\n * runtime fallback.\n */\nexport class BrowserInvalidRequest extends Data.TaggedError(\"BrowserInvalidRequest\")<{\n provider: string\n param?: string\n reason?: string\n raw?: unknown\n}> {}\n\n/**\n * Transport could not authenticate against the provider. Subtype mirrors\n * the model-side `AiError.AuthFailed` shape for consistency.\n */\nexport type BrowserAuthSubtype = \"auth\" | \"permission\" | \"billing\" | \"quota\"\n\nexport class BrowserAuthFailed extends Data.TaggedError(\"BrowserAuthFailed\")<{\n provider: string\n subtype: BrowserAuthSubtype\n raw: unknown\n}> {}\n\n/**\n * The wired provider does not implement the requested operation for these\n * inputs. Distinct from {@link BrowserInvalidRequest} (malformed request)\n * and from compile-time capability markers gating blanket provider gaps.\n */\nexport class BrowserUnsupported extends Data.TaggedError(\"BrowserUnsupported\")<{\n provider: string\n capability: string\n reason?: string\n}> {}\n\nexport type BrowserError =\n | BrowserCreateFailed\n | BrowserSessionNotFound\n | BrowserSessionExpired\n | BrowserTimeout\n | BrowserActionFailed\n | BrowserQuotaExceeded\n | BrowserInvalidRequest\n | BrowserAuthFailed\n | BrowserUnsupported\n\nconst withReason = (base: string, reason: string | undefined): string =>\n reason === undefined ? base : `${base}: ${reason}`\n\n/**\n * Short human-readable description of an error, for logs and model-facing\n * failure messages. Prose, not a contract; branch on `_tag` instead.\n */\nexport const describe: (e: BrowserError) => string = Match.type<BrowserError>().pipe(\n Match.discriminatorsExhaustive(\"_tag\")({\n BrowserCreateFailed: (e) => withReason(\"the browser session could not be created\", e.reason),\n BrowserSessionNotFound: () => \"the browser session does not exist\",\n BrowserSessionExpired: () => \"the browser session has expired\",\n BrowserTimeout: (e) => `the ${e.operation} operation timed out`,\n BrowserActionFailed: (e) =>\n withReason(\n `the ${e.operation} failed${e.selector === undefined ? \"\" : ` on ${e.selector}`}`,\n e.reason,\n ),\n BrowserQuotaExceeded: (e) => withReason(\"the browser quota is exceeded\", e.reason),\n BrowserInvalidRequest: (e) => withReason(\"the request was invalid\", e.reason),\n BrowserAuthFailed: (e) => `browser authentication failed (${e.subtype})`,\n BrowserUnsupported: (e) =>\n withReason(`this browser does not support ${e.capability}`, e.reason),\n }),\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,IAAa,sBAAb,cAAyC,KAAK,YAAY,sBAAsB,CAI7E;;;;;;;AAQH,IAAa,yBAAb,cAA4C,KAAK,YAAY,yBAAyB,CAGnF;;;;;;;;AASH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAGjF;;;;;;AAOH,IAAa,iBAAb,cAAoC,KAAK,YAAY,iBAAiB,CAKnE;;;;;;;AAQH,IAAa,sBAAb,cAAyC,KAAK,YAAY,sBAAsB,CAM7E;;;;;;AAOH,IAAa,uBAAb,cAA0C,KAAK,YAAY,uBAAuB,CAI/E;;;;;;AAOH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAKjF;AAQH,IAAa,oBAAb,cAAuC,KAAK,YAAY,oBAAoB,CAIzE;;;;;;AAOH,IAAa,qBAAb,cAAwC,KAAK,YAAY,qBAAqB,CAI3E;AAaH,MAAM,cAAc,MAAc,WAChC,WAAW,KAAA,IAAY,OAAO,GAAG,KAAK,IAAI;;;;;AAM5C,MAAa,WAAwC,MAAM,MAAoB,CAAC,KAC9E,MAAM,yBAAyB,OAAO,CAAC;CACrC,sBAAsB,MAAM,WAAW,4CAA4C,EAAE,OAAO;CAC5F,8BAA8B;CAC9B,6BAA6B;CAC7B,iBAAiB,MAAM,OAAO,EAAE,UAAU;CAC1C,sBAAsB,MACpB,WACE,OAAO,EAAE,UAAU,SAAS,EAAE,aAAa,KAAA,IAAY,KAAK,OAAO,EAAE,cACrE,EAAE,OACH;CACH,uBAAuB,MAAM,WAAW,iCAAiC,EAAE,OAAO;CAClF,wBAAwB,MAAM,WAAW,2BAA2B,EAAE,OAAO;CAC7E,oBAAoB,MAAM,kCAAkC,EAAE,QAAQ;CACtE,qBAAqB,MACnB,WAAW,iCAAiC,EAAE,cAAc,EAAE,OAAO;CACxE,CAAC,CACH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BrowserError } from "./BrowserError.mjs";
|
|
2
|
+
import { BrowserSession } from "./Browser.mjs";
|
|
3
|
+
import { l as Tool } from "../Tool-2lC_XMth.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/browser/BrowserTool.d.ts
|
|
6
|
+
declare namespace BrowserTool_d_exports {
|
|
7
|
+
export { browserToolkit, clickTool, fillTool, gotoTool, pressTool, scrollTool };
|
|
8
|
+
}
|
|
9
|
+
declare const gotoTool: (session: BrowserSession) => Tool<"browser_goto", {
|
|
10
|
+
readonly url: string;
|
|
11
|
+
}, unknown, string, BrowserError, never>;
|
|
12
|
+
declare const clickTool: (session: BrowserSession) => Tool<"browser_click", {
|
|
13
|
+
readonly ref: string;
|
|
14
|
+
}, unknown, string, BrowserError, never>;
|
|
15
|
+
declare const fillTool: (session: BrowserSession) => Tool<"browser_fill", {
|
|
16
|
+
readonly ref: string;
|
|
17
|
+
readonly text: string;
|
|
18
|
+
}, unknown, string, BrowserError, never>;
|
|
19
|
+
declare const pressTool: (session: BrowserSession) => Tool<"browser_press", {
|
|
20
|
+
readonly key: string;
|
|
21
|
+
}, unknown, string, BrowserError, never>;
|
|
22
|
+
declare const scrollTool: (session: BrowserSession) => Tool<"browser_scroll", {
|
|
23
|
+
readonly direction: "up" | "down";
|
|
24
|
+
}, unknown, string, BrowserError, never>;
|
|
25
|
+
/**
|
|
26
|
+
* The canonical browser action verbs bundled as a `Toolkit`, closed over a
|
|
27
|
+
* live `BrowserSession`. Compose it with a recipe-local page-reading tool and
|
|
28
|
+
* whatever finish/signal tools the agent needs:
|
|
29
|
+
*
|
|
30
|
+
* const toolkit = yield* Toolkit.compose(
|
|
31
|
+
* browserToolkit(session),
|
|
32
|
+
* Toolkit.make(readPageTool(session), finishTool),
|
|
33
|
+
* )
|
|
34
|
+
*
|
|
35
|
+
* For an à-la-carte subset, use the individual `gotoTool` / `clickTool` / …
|
|
36
|
+
* constructors directly. Run a turn's calls with `{ concurrency: 1 }`.
|
|
37
|
+
*/
|
|
38
|
+
declare const browserToolkit: (session: BrowserSession) => {
|
|
39
|
+
browser_goto: Tool<"browser_goto", {
|
|
40
|
+
readonly url: string;
|
|
41
|
+
}, unknown, string, BrowserError, never>;
|
|
42
|
+
browser_click: Tool<"browser_click", {
|
|
43
|
+
readonly ref: string;
|
|
44
|
+
}, unknown, string, BrowserError, never>;
|
|
45
|
+
browser_fill: Tool<"browser_fill", {
|
|
46
|
+
readonly ref: string;
|
|
47
|
+
readonly text: string;
|
|
48
|
+
}, unknown, string, BrowserError, never>;
|
|
49
|
+
browser_press: Tool<"browser_press", {
|
|
50
|
+
readonly key: string;
|
|
51
|
+
}, unknown, string, BrowserError, never>;
|
|
52
|
+
browser_scroll: Tool<"browser_scroll", {
|
|
53
|
+
readonly direction: "up" | "down";
|
|
54
|
+
}, unknown, string, BrowserError, never>;
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { browserToolkit, clickTool, fillTool, gotoTool, pressTool, scrollTool, BrowserTool_d_exports as t };
|
|
58
|
+
//# sourceMappingURL=BrowserTool.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserTool.d.mts","names":[],"sources":["../../src/browser/BrowserTool.ts"],"mappings":";;;;;;;;cAoEa,QAAA,GAAY,OAAA,EAAS,cAAA,KAAc,IAAA;EAAA;oBAAA,YAAA;AAAA,cAcnC,SAAA,GAAa,OAAA,EAAS,cAAA,KAAc,IAAA;EAAA;oBAAA,YAAA;AAAA,cAcpC,QAAA,GAAY,OAAA,EAAS,cAAA,KAAc,IAAA;EAAA;;oBAAA,YAAA;AAAA,cAenC,SAAA,GAAa,OAAA,EAAS,cAAA,KAAc,IAAA;EAAA;oBAAA,YAAA;AAAA,cAcpC,UAAA,GAAc,OAAA,EAAS,cAAA,KAAc,IAAA;EAAA;oBAAA,YAAA;;;;;;;;;;;;;AA3ClD;cAuEa,cAAA,GAAkB,OAAA,EAAS,cAAA;;;sBAAc,YAAA"}
|