@effect-uai/core 0.12.0 → 0.12.1
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-Bf1pq4BB.d.mts → AiError-eLV9t1lU.d.mts} +12 -16
- package/dist/AiError-eLV9t1lU.d.mts.map +1 -0
- package/dist/{Audio-CR7CSljJ.d.mts → Audio-60lKKHxS.d.mts} +4 -5
- package/dist/Audio-60lKKHxS.d.mts.map +1 -0
- package/dist/{Image-C4vuBmu0.d.mts → Image-BK8-4H6s.d.mts} +12 -14
- package/dist/Image-BK8-4H6s.d.mts.map +1 -0
- package/dist/{Items-BKQgqJ8A.d.mts → Items-SfUabNuB.d.mts} +74 -76
- package/dist/Items-SfUabNuB.d.mts.map +1 -0
- package/dist/{Loop-D8nWpowc.d.mts → Loop-B54AB1ME.d.mts} +19 -21
- package/dist/Loop-B54AB1ME.d.mts.map +1 -0
- package/dist/{Media-D_CpcM1Z.d.mts → Media-DwgpifPD.d.mts} +1 -1
- package/dist/Media-DwgpifPD.d.mts.map +1 -0
- package/dist/{SandboxError-CIrVDOMV.d.mts → SandboxError-BN8b28Bh.d.mts} +11 -15
- package/dist/SandboxError-BN8b28Bh.d.mts.map +1 -0
- package/dist/{StructuredFormat-DHaUJBdd.d.mts → StructuredFormat-BlZhyOsi.d.mts} +3 -7
- package/dist/StructuredFormat-BlZhyOsi.d.mts.map +1 -0
- package/dist/{Tool-u5bag8SO.d.mts → Tool-DE-rnvkw.d.mts} +5 -8
- package/dist/Tool-DE-rnvkw.d.mts.map +1 -0
- package/dist/{ToolEvent-BBfOdhF_.d.mts → ToolEvent-D99MGQYH.d.mts} +56 -63
- package/dist/ToolEvent-D99MGQYH.d.mts.map +1 -0
- package/dist/{ToolResult-CRpmkBXR.d.mts → ToolResult-Cj8ChodL.d.mts} +49 -54
- package/dist/ToolResult-Cj8ChodL.d.mts.map +1 -0
- package/dist/{Toolkit-D4mQvhjq.d.mts → Toolkit-BEZrNPTI.d.mts} +13 -16
- package/dist/Toolkit-BEZrNPTI.d.mts.map +1 -0
- package/dist/browser/Browser.d.mts +11 -7
- package/dist/browser/Browser.d.mts.map +1 -1
- package/dist/browser/Browser.mjs +1 -1
- package/dist/browser/Browser.mjs.map +1 -1
- package/dist/browser/BrowserError.d.mts +9 -13
- package/dist/browser/BrowserError.d.mts.map +1 -1
- package/dist/browser/BrowserError.mjs +1 -1
- package/dist/browser/BrowserError.mjs.map +1 -1
- package/dist/browser/BrowserTool.d.mts +33 -36
- package/dist/browser/BrowserTool.d.mts.map +1 -1
- package/dist/browser/BrowserTool.mjs +1 -1
- package/dist/browser/BrowserTool.mjs.map +1 -1
- package/dist/capabilities/Capabilities.d.mts +8 -6
- package/dist/capabilities/Capabilities.d.mts.map +1 -1
- package/dist/capabilities/Capabilities.mjs +1 -1
- package/dist/capabilities/Capabilities.mjs.map +1 -1
- package/dist/dist-BaenoU1A.mjs +145 -0
- package/dist/dist-BaenoU1A.mjs.map +1 -0
- package/dist/{dist-C0m0QnUP.mjs → dist-nohcnkD6.mjs} +16 -15
- package/dist/dist-nohcnkD6.mjs.map +1 -0
- package/dist/domain/AiError.d.mts +1 -1
- package/dist/domain/AiError.mjs +1 -1
- package/dist/domain/AiError.mjs.map +1 -1
- package/dist/domain/Audio.d.mts +1 -1
- package/dist/domain/Audio.mjs +1 -1
- package/dist/domain/Citation.d.mts +0 -2
- package/dist/domain/Citation.d.mts.map +1 -1
- package/dist/domain/Citation.mjs +1 -1
- package/dist/domain/Image.d.mts +1 -1
- package/dist/domain/Image.mjs +1 -1
- package/dist/domain/Image.mjs.map +1 -1
- package/dist/domain/Items.d.mts +1 -1
- package/dist/domain/Items.mjs +1 -1
- package/dist/domain/Items.mjs.map +1 -1
- package/dist/domain/Media.d.mts +1 -1
- package/dist/domain/Media.mjs +1 -1
- package/dist/domain/Music.d.mts +18 -11
- package/dist/domain/Music.d.mts.map +1 -1
- package/dist/domain/Music.mjs +1 -1
- package/dist/domain/Music.mjs.map +1 -1
- package/dist/domain/Research.d.mts +3 -4
- package/dist/domain/Research.d.mts.map +1 -1
- package/dist/domain/Research.mjs +1 -1
- package/dist/domain/Transcript.d.mts +2 -3
- package/dist/domain/Transcript.d.mts.map +1 -1
- package/dist/domain/Transcript.mjs +1 -1
- package/dist/domain/Turn.d.mts +143 -164
- package/dist/domain/Turn.d.mts.map +1 -1
- package/dist/domain/Turn.mjs +1 -1
- package/dist/domain/Turn.mjs.map +1 -1
- package/dist/domain/Turn.test.d.mts +1 -1
- package/dist/domain/Turn.test.mjs +28 -18
- package/dist/domain/Turn.test.mjs.map +1 -1
- package/dist/embedding-model/Embedding.d.mts +1 -3
- package/dist/embedding-model/Embedding.d.mts.map +1 -1
- package/dist/embedding-model/Embedding.mjs +1 -1
- package/dist/embedding-model/EmbeddingModel.d.mts +1 -3
- package/dist/embedding-model/EmbeddingModel.d.mts.map +1 -1
- package/dist/embedding-model/EmbeddingModel.mjs +1 -1
- package/dist/embedding-model/EmbeddingModel.mjs.map +1 -1
- package/dist/embedding-model/EmbeddingModel.test.d.mts +1 -1
- package/dist/embedding-model/EmbeddingModel.test.mjs +14 -9
- package/dist/embedding-model/EmbeddingModel.test.mjs.map +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/job/Job.d.mts +4 -4
- package/dist/job/Job.d.mts.map +1 -1
- package/dist/job/Job.mjs +1 -1
- package/dist/job/Job.mjs.map +1 -1
- package/dist/language-model/LanguageModel.d.mts +4 -6
- package/dist/language-model/LanguageModel.d.mts.map +1 -1
- package/dist/language-model/LanguageModel.mjs +1 -1
- package/dist/language-model/LanguageModel.mjs.map +1 -1
- package/dist/language-model/LanguageModel.test.d.mts +1 -1
- package/dist/language-model/LanguageModel.test.mjs +6 -3
- package/dist/language-model/LanguageModel.test.mjs.map +1 -1
- package/dist/loop/Loop.d.mts +1 -1
- package/dist/loop/Loop.mjs +1 -1
- package/dist/loop/Loop.mjs.map +1 -1
- package/dist/loop/Loop.test.d.mts +1 -1
- package/dist/loop/Loop.test.mjs +60 -34
- package/dist/loop/Loop.test.mjs.map +1 -1
- package/dist/{magic-string.es-Dk-MMA0F.mjs → magic-string.es-CB2hOw9v.mjs} +14 -13
- package/dist/{magic-string.es-Dk-MMA0F.mjs.map → magic-string.es-CB2hOw9v.mjs.map} +1 -1
- package/dist/math/Vector.d.mts +0 -2
- package/dist/math/Vector.d.mts.map +1 -1
- package/dist/math/Vector.mjs +1 -1
- package/dist/math/Vector.mjs.map +1 -1
- package/dist/music-generator/MusicGenerator.d.mts +2 -4
- package/dist/music-generator/MusicGenerator.d.mts.map +1 -1
- package/dist/music-generator/MusicGenerator.mjs +1 -1
- package/dist/music-generator/MusicGenerator.mjs.map +1 -1
- package/dist/music-generator/MusicGenerator.test.d.mts +1 -1
- package/dist/music-generator/MusicGenerator.test.mjs +19 -10
- package/dist/music-generator/MusicGenerator.test.mjs.map +1 -1
- package/dist/observability/Metrics.d.mts +10 -7
- package/dist/observability/Metrics.d.mts.map +1 -1
- package/dist/observability/Metrics.mjs +1 -1
- package/dist/observability/Metrics.mjs.map +1 -1
- package/dist/observability/Metrics.test.d.mts +1 -1
- package/dist/observability/Metrics.test.mjs +50 -28
- package/dist/observability/Metrics.test.mjs.map +1 -1
- package/dist/observability/Telemetry.d.mts +2 -3
- package/dist/observability/Telemetry.d.mts.map +1 -1
- package/dist/observability/Telemetry.mjs +1 -1
- package/dist/observability/Telemetry.mjs.map +1 -1
- package/dist/observability/Telemetry.test.d.mts +1 -1
- package/dist/observability/Telemetry.test.mjs +15 -7
- package/dist/observability/Telemetry.test.mjs.map +1 -1
- package/dist/research/DeepResearch.d.mts +1 -3
- package/dist/research/DeepResearch.d.mts.map +1 -1
- package/dist/research/DeepResearch.mjs +1 -1
- package/dist/research/DeepResearch.mjs.map +1 -1
- package/dist/retry/Retry.d.mts +2 -6
- package/dist/retry/Retry.d.mts.map +1 -1
- package/dist/retry/Retry.mjs +1 -1
- package/dist/retry/Retry.mjs.map +1 -1
- package/dist/retry/Retry.test.d.mts +1 -1
- package/dist/retry/Retry.test.mjs +6 -3
- package/dist/retry/Retry.test.mjs.map +1 -1
- package/dist/sandbox/Memory.d.mts +0 -2
- package/dist/sandbox/Memory.d.mts.map +1 -1
- package/dist/sandbox/Memory.mjs +4 -4
- package/dist/sandbox/Memory.mjs.map +1 -1
- package/dist/sandbox/Sandbox.d.mts +144 -156
- package/dist/sandbox/Sandbox.d.mts.map +1 -1
- package/dist/sandbox/Sandbox.mjs +1 -1
- package/dist/sandbox/Sandbox.mjs.map +1 -1
- package/dist/sandbox/SandboxError.d.mts +1 -1
- package/dist/sandbox/SandboxError.mjs +1 -1
- package/dist/sandbox/SandboxError.mjs.map +1 -1
- package/dist/sandbox/SandboxImage.d.mts +0 -2
- package/dist/sandbox/SandboxImage.d.mts.map +1 -1
- package/dist/sandbox/SandboxImage.mjs +1 -1
- package/dist/sandbox/SandboxImage.mjs.map +1 -1
- package/dist/sandbox/SandboxNetwork.d.mts +0 -2
- package/dist/sandbox/SandboxNetwork.d.mts.map +1 -1
- package/dist/sandbox/SandboxNetwork.mjs +1 -1
- package/dist/sandbox/SandboxNetwork.mjs.map +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.d.mts +8 -7
- package/dist/speech-synthesizer/SpeechSynthesizer.d.mts.map +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.mjs +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.mjs.map +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.test.d.mts +1 -1
- package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs +31 -16
- package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs.map +1 -1
- package/dist/streaming/JSONL.d.mts +1 -5
- package/dist/streaming/JSONL.d.mts.map +1 -1
- package/dist/streaming/JSONL.mjs +1 -1
- package/dist/streaming/JSONL.mjs.map +1 -1
- package/dist/streaming/JSONL.test.d.mts +1 -1
- package/dist/streaming/JSONL.test.mjs +16 -8
- package/dist/streaming/JSONL.test.mjs.map +1 -1
- package/dist/streaming/Lines.d.mts +0 -2
- package/dist/streaming/Lines.d.mts.map +1 -1
- package/dist/streaming/Lines.mjs +1 -1
- package/dist/streaming/Lines.mjs.map +1 -1
- package/dist/streaming/SSE.d.mts +0 -2
- package/dist/streaming/SSE.d.mts.map +1 -1
- package/dist/streaming/SSE.mjs +1 -1
- package/dist/streaming/SSE.mjs.map +1 -1
- package/dist/streaming/SSE.test.d.mts +1 -1
- package/dist/streaming/SSE.test.mjs +34 -17
- package/dist/streaming/SSE.test.mjs.map +1 -1
- package/dist/structured-format/StructuredFormat.d.mts +1 -1
- package/dist/structured-format/StructuredFormat.mjs +1 -1
- package/dist/structured-format/StructuredFormat.mjs.map +1 -1
- package/dist/structured-format/StructuredFormat.test.d.mts +1 -1
- package/dist/structured-format/StructuredFormat.test.mjs +7 -4
- package/dist/structured-format/StructuredFormat.test.mjs.map +1 -1
- package/dist/{dist-CcRV3-A5.mjs → test.DNmyFkvJ-YPzDR0Co.mjs} +1644 -5172
- package/dist/test.DNmyFkvJ-YPzDR0Co.mjs.map +1 -0
- package/dist/testing/MockMusicGenerator.d.mts +4 -3
- package/dist/testing/MockMusicGenerator.d.mts.map +1 -1
- package/dist/testing/MockMusicGenerator.mjs.map +1 -1
- package/dist/testing/MockProvider.d.mts +1 -2
- package/dist/testing/MockProvider.d.mts.map +1 -1
- package/dist/testing/MockProvider.mjs.map +1 -1
- package/dist/testing/MockSandbox.d.mts +256 -290
- package/dist/testing/MockSandbox.d.mts.map +1 -1
- package/dist/testing/MockSandbox.mjs.map +1 -1
- package/dist/testing/MockSpeechSynthesizer.d.mts +10 -6
- package/dist/testing/MockSpeechSynthesizer.d.mts.map +1 -1
- package/dist/testing/MockSpeechSynthesizer.mjs.map +1 -1
- package/dist/testing/MockTranscriber.d.mts +3 -2
- package/dist/testing/MockTranscriber.d.mts.map +1 -1
- package/dist/testing/MockTranscriber.mjs.map +1 -1
- package/dist/tool/Approval.d.mts +31 -36
- package/dist/tool/Approval.d.mts.map +1 -1
- package/dist/tool/Approval.mjs +1 -1
- package/dist/tool/Approval.mjs.map +1 -1
- package/dist/tool/Approval.test.d.mts +1 -1
- package/dist/tool/Approval.test.mjs +37 -24
- package/dist/tool/Approval.test.mjs.map +1 -1
- package/dist/tool/HistoryCheck.d.mts +2 -4
- package/dist/tool/HistoryCheck.d.mts.map +1 -1
- package/dist/tool/HistoryCheck.mjs +1 -1
- package/dist/tool/HistoryCheck.mjs.map +1 -1
- package/dist/tool/Tool.d.mts +1 -1
- package/dist/tool/Tool.mjs +4 -4
- package/dist/tool/Tool.mjs.map +1 -1
- package/dist/tool/Tool.test.d.mts +1 -1
- package/dist/tool/Tool.test.mjs +23 -11
- package/dist/tool/Tool.test.mjs.map +1 -1
- package/dist/tool/ToolEvent.d.mts +1 -1
- package/dist/tool/ToolEvent.mjs +1 -1
- package/dist/tool/ToolEvent.mjs.map +1 -1
- package/dist/tool/ToolResult.d.mts +1 -1
- package/dist/tool/ToolResult.mjs +1 -1
- package/dist/tool/ToolResult.mjs.map +1 -1
- package/dist/tool/Toolkit.d.mts +1 -1
- package/dist/tool/Toolkit.mjs +4 -3
- package/dist/tool/Toolkit.mjs.map +1 -1
- package/dist/tool/Toolkit.test.d.mts +1 -1
- package/dist/tool/Toolkit.test.mjs +40 -21
- package/dist/tool/Toolkit.test.mjs.map +1 -1
- package/dist/transcriber/Transcriber.d.mts +6 -6
- package/dist/transcriber/Transcriber.d.mts.map +1 -1
- package/dist/transcriber/Transcriber.mjs +1 -1
- package/dist/transcriber/Transcriber.mjs.map +1 -1
- package/dist/transcriber/Transcriber.test.d.mts +1 -1
- package/dist/transcriber/Transcriber.test.mjs +20 -10
- package/dist/transcriber/Transcriber.test.mjs.map +1 -1
- package/dist/utils-CiH_DjFW.mjs +3918 -0
- package/dist/utils-CiH_DjFW.mjs.map +1 -0
- package/dist/web-read/WebRead.d.mts +15 -9
- package/dist/web-read/WebRead.d.mts.map +1 -1
- package/dist/web-read/WebRead.mjs +1 -1
- package/dist/web-read/WebRead.mjs.map +1 -1
- package/dist/web-read/WebReadTool.d.mts +4 -5
- package/dist/web-read/WebReadTool.d.mts.map +1 -1
- package/dist/web-read/WebReadTool.mjs +1 -1
- package/dist/web-read/WebReadTool.mjs.map +1 -1
- package/dist/web-search/WebSearch.d.mts +22 -13
- package/dist/web-search/WebSearch.d.mts.map +1 -1
- package/dist/web-search/WebSearch.mjs +1 -1
- package/dist/web-search/WebSearch.mjs.map +1 -1
- package/dist/web-search/WebSearchTool.d.mts +6 -6
- package/dist/web-search/WebSearchTool.d.mts.map +1 -1
- package/dist/web-search/WebSearchTool.mjs +1 -1
- package/dist/web-search/WebSearchTool.mjs.map +1 -1
- package/package.json +4 -4
- package/src/loop/Loop.test.ts +13 -14
- package/src/loop/Loop.ts +74 -76
- package/src/testing/MockProvider.ts +8 -9
- package/src/tool/Tool.ts +13 -13
- package/dist/AiError-Bf1pq4BB.d.mts.map +0 -1
- package/dist/Audio-CR7CSljJ.d.mts.map +0 -1
- package/dist/Image-C4vuBmu0.d.mts.map +0 -1
- package/dist/Items-BKQgqJ8A.d.mts.map +0 -1
- package/dist/Loop-D8nWpowc.d.mts.map +0 -1
- package/dist/Media-D_CpcM1Z.d.mts.map +0 -1
- package/dist/SandboxError-CIrVDOMV.d.mts.map +0 -1
- package/dist/StructuredFormat-DHaUJBdd.d.mts.map +0 -1
- package/dist/Tool-u5bag8SO.d.mts.map +0 -1
- package/dist/ToolEvent-BBfOdhF_.d.mts.map +0 -1
- package/dist/ToolResult-CRpmkBXR.d.mts.map +0 -1
- package/dist/Toolkit-D4mQvhjq.d.mts.map +0 -1
- package/dist/dist-C0m0QnUP.mjs.map +0 -1
- package/dist/dist-CcRV3-A5.mjs.map +0 -1
- /package/dist/{chunk-uyGKjUfl.mjs → rolldown-runtime-EAsCxrDo.mjs} +0 -0
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { v as ToolCall, y as ToolCallOutput } from "./Items-
|
|
1
|
+
import { v as ToolCall, y as ToolCallOutput } from "./Items-SfUabNuB.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
-
import * as _$effect_Cause0 from "effect/Cause";
|
|
4
3
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
|
-
|
|
6
|
-
//#region src/tool/Tool.d.ts
|
|
7
4
|
declare namespace Tool_d_exports {
|
|
8
5
|
export { AnyLocalTool, AnyTool, DecodableTool, DecodeResult, Emit, InteractionTool, ProviderTool, SignalTool, Tool, ToolDescriptor, ToolE, ToolError, ToolFailed, ToolInputSchema, ToolR, ToolValidationError, decodeArgs, decodeCallInput, descriptorsOf, execute, fail, fromEffectSchema, fromStandardSchema, interaction, isProviderTool, make, noInput, provider, providerToolsOf, signal, toDescriptors, withName, withRun };
|
|
9
6
|
}
|
|
@@ -12,7 +9,7 @@ declare const ToolError_base: Schema.Class<ToolError, Schema.TaggedStruct<"ToolE
|
|
|
12
9
|
readonly tool: Schema.String;
|
|
13
10
|
readonly message: Schema.String;
|
|
14
11
|
readonly cause: Schema.optional<Schema.Unknown>;
|
|
15
|
-
}>,
|
|
12
|
+
}>, import("effect/Cause").YieldableError>;
|
|
16
13
|
declare class ToolError extends ToolError_base {}
|
|
17
14
|
declare const ToolValidationError_base: Schema.Class<ToolValidationError, Schema.TaggedStruct<"ToolValidationError", {
|
|
18
15
|
readonly call_id: Schema.String;
|
|
@@ -21,7 +18,7 @@ declare const ToolValidationError_base: Schema.Class<ToolValidationError, Schema
|
|
|
21
18
|
readonly message: Schema.String;
|
|
22
19
|
readonly path: Schema.optional<Schema.$Array<Schema.Unknown>>;
|
|
23
20
|
}>>;
|
|
24
|
-
}>,
|
|
21
|
+
}>, import("effect/Cause").YieldableError>;
|
|
25
22
|
/**
|
|
26
23
|
* The model's `arguments` for a call failed the tool's `inputSchema`. Distinct
|
|
27
24
|
* from `ToolError` (malformed JSON, runtime crash) so callers can tell a
|
|
@@ -32,7 +29,7 @@ declare class ToolValidationError extends ToolValidationError_base {}
|
|
|
32
29
|
declare const ToolFailed_base: Schema.Class<ToolFailed, Schema.TaggedStruct<"ToolFailed", {
|
|
33
30
|
readonly message: Schema.String;
|
|
34
31
|
readonly kind: Schema.optional<Schema.String>;
|
|
35
|
-
}>,
|
|
32
|
+
}>, import("effect/Cause").YieldableError>;
|
|
36
33
|
/**
|
|
37
34
|
* The deliberate "speak to the model" failure sentinel. A tool's `run` that
|
|
38
35
|
* fails with a `ToolFailed` (or a bare `string`, its sugar) is absorbed by
|
|
@@ -314,4 +311,4 @@ declare const decodeArgs: <Input>(tool: DecodableTool<Input>, call: ToolCall) =>
|
|
|
314
311
|
declare const execute: <Name extends string, Input, Event, Output, E, R>(tool: Tool<Name, Input, Event, Output, E, R>, call: ToolCall) => Effect.Effect<ToolCallOutput, E | ToolError | ToolValidationError, R>;
|
|
315
312
|
//#endregion
|
|
316
313
|
export { providerToolsOf as A, fromEffectSchema as C, make as D, isProviderTool as E, toDescriptors as M, withName as N, noInput as O, withRun as P, fail as S, interaction as T, Tool_d_exports as _, Emit as a, descriptorsOf as b, SignalTool as c, ToolE as d, ToolError as f, ToolValidationError as g, ToolR as h, DecodeResult as i, signal as j, provider as k, Tool as l, ToolInputSchema as m, AnyTool as n, InteractionTool as o, ToolFailed as p, DecodableTool as r, ProviderTool as s, AnyLocalTool as t, ToolDescriptor as u, decodeArgs as v, fromStandardSchema as w, execute as x, decodeCallInput as y };
|
|
317
|
-
//# sourceMappingURL=Tool-
|
|
314
|
+
//# sourceMappingURL=Tool-DE-rnvkw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tool-DE-rnvkw.d.mts","names":[],"sources":["../src/tool/Tool.ts"],"mappings":";;;;;;;;;;;;cAMa,kBAAkB;;;;;;;;;;;;;;;cA0BlB,4BAA4B;;;;;;;;;;;;;;cAiB5B,mBAAmB;;;;;;cAanB,OAAI,iBACA;WACM;MACpB,OAAO,cAAc;;;;;;;;;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B;;;;;;;cAWnE,kBAAmB,OAAK,MAC7B,cAAc,QAAM,MACpB,aACL,OAAO,OAAO,aAAa;;;;;;;;;;cAgCjB,aAAc,OAAK,MACxB,cAAc,QAAM,MACpB,aACL,OAAO,OAAO,OAAO,YAAY;;;;;;;cA4BvB,UAAW,qBAAqB,OAAO,OAAO,QAAQ,GAAG,GAAC,MAC/D,KAAK,MAAM,OAAO,OAAO,QAAQ,GAAG,IAAE,MACtC,aACL,OAAO,OAAO,gBAAgB,IAAI,YAAY,qBAAqB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { t as ToolResult } from "./ToolResult-
|
|
1
|
+
import { t as ToolResult } from "./ToolResult-Cj8ChodL.mjs";
|
|
2
2
|
import { Data } from "effect";
|
|
3
|
-
import * as _$effect_Unify0 from "effect/Unify";
|
|
4
|
-
|
|
5
|
-
//#region src/tool/ToolEvent.d.ts
|
|
6
3
|
declare namespace ToolEvent_d_exports {
|
|
7
4
|
export { ToolEvent, isApprovalRequested, isOutput, isProgress };
|
|
8
5
|
}
|
|
@@ -29,27 +26,16 @@ type ToolEvent = Data.TaggedEnum<{
|
|
|
29
26
|
* exhaustive pattern matching.
|
|
30
27
|
*/
|
|
31
28
|
declare const ToolEvent: {
|
|
32
|
-
readonly ApprovalRequested:
|
|
29
|
+
readonly $is: <Tag extends "ApprovalRequested" | "Output" | "Progress">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
33
30
|
readonly _tag: "ApprovalRequested";
|
|
34
31
|
readonly call_id: string;
|
|
35
32
|
readonly tool: string;
|
|
36
33
|
readonly arguments: string;
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
readonly call_id: string;
|
|
41
|
-
readonly tool: string;
|
|
42
|
-
readonly data: unknown;
|
|
43
|
-
}, "_tag">;
|
|
44
|
-
readonly Output: Data.TaggedEnum.ConstructorFrom<{
|
|
34
|
+
}, {
|
|
35
|
+
readonly _tag: Tag;
|
|
36
|
+
}> | Extract<{
|
|
45
37
|
readonly _tag: "Output";
|
|
46
38
|
readonly result: ToolResult;
|
|
47
|
-
}, "_tag">;
|
|
48
|
-
readonly $is: <Tag extends "ApprovalRequested" | "Progress" | "Output">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
49
|
-
readonly _tag: "ApprovalRequested";
|
|
50
|
-
readonly call_id: string;
|
|
51
|
-
readonly tool: string;
|
|
52
|
-
readonly arguments: string;
|
|
53
39
|
}, {
|
|
54
40
|
readonly _tag: Tag;
|
|
55
41
|
}> | Extract<{
|
|
@@ -59,76 +45,83 @@ declare const ToolEvent: {
|
|
|
59
45
|
readonly data: unknown;
|
|
60
46
|
}, {
|
|
61
47
|
readonly _tag: Tag;
|
|
62
|
-
}> | Extract<{
|
|
63
|
-
readonly _tag: "Output";
|
|
64
|
-
readonly result: ToolResult;
|
|
65
|
-
}, {
|
|
66
|
-
readonly _tag: Tag;
|
|
67
48
|
}>;
|
|
68
49
|
readonly $match: {
|
|
69
|
-
<Cases extends {
|
|
70
|
-
readonly ApprovalRequested: (args: {
|
|
71
|
-
readonly _tag: "ApprovalRequested";
|
|
72
|
-
readonly call_id: string;
|
|
73
|
-
readonly tool: string;
|
|
74
|
-
readonly arguments: string;
|
|
75
|
-
}) => any;
|
|
76
|
-
readonly Progress: (args: {
|
|
77
|
-
readonly _tag: "Progress";
|
|
78
|
-
readonly call_id: string;
|
|
79
|
-
readonly tool: string;
|
|
80
|
-
readonly data: unknown;
|
|
81
|
-
}) => any;
|
|
82
|
-
readonly Output: (args: {
|
|
83
|
-
readonly _tag: "Output";
|
|
84
|
-
readonly result: ToolResult;
|
|
85
|
-
}) => any;
|
|
86
|
-
}>(cases: Cases): (value: {
|
|
50
|
+
<Cases extends { readonly [Tag in "ApprovalRequested" | "Output" | "Progress"]: (args: Extract<{
|
|
87
51
|
readonly _tag: "ApprovalRequested";
|
|
88
52
|
readonly call_id: string;
|
|
89
53
|
readonly tool: string;
|
|
90
54
|
readonly arguments: string;
|
|
55
|
+
} | {
|
|
56
|
+
readonly _tag: "Output";
|
|
57
|
+
readonly result: ToolResult;
|
|
91
58
|
} | {
|
|
92
59
|
readonly _tag: "Progress";
|
|
93
60
|
readonly call_id: string;
|
|
94
61
|
readonly tool: string;
|
|
95
62
|
readonly data: unknown;
|
|
63
|
+
}, {
|
|
64
|
+
readonly _tag: Tag;
|
|
65
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
66
|
+
readonly _tag: "ApprovalRequested";
|
|
67
|
+
readonly call_id: string;
|
|
68
|
+
readonly tool: string;
|
|
69
|
+
readonly arguments: string;
|
|
96
70
|
} | {
|
|
97
71
|
readonly _tag: "Output";
|
|
98
72
|
readonly result: ToolResult;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
readonly
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}) => any;
|
|
107
|
-
readonly Progress: (args: {
|
|
108
|
-
readonly _tag: "Progress";
|
|
109
|
-
readonly call_id: string;
|
|
110
|
-
readonly tool: string;
|
|
111
|
-
readonly data: unknown;
|
|
112
|
-
}) => any;
|
|
113
|
-
readonly Output: (args: {
|
|
114
|
-
readonly _tag: "Output";
|
|
115
|
-
readonly result: ToolResult;
|
|
116
|
-
}) => any;
|
|
117
|
-
}>(value: {
|
|
73
|
+
} | {
|
|
74
|
+
readonly _tag: "Progress";
|
|
75
|
+
readonly call_id: string;
|
|
76
|
+
readonly tool: string;
|
|
77
|
+
readonly data: unknown;
|
|
78
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["ApprovalRequested" | "Output" | "Progress"]>>;
|
|
79
|
+
<Cases extends { readonly [Tag in "ApprovalRequested" | "Output" | "Progress"]: (args: Extract<{
|
|
118
80
|
readonly _tag: "ApprovalRequested";
|
|
119
81
|
readonly call_id: string;
|
|
120
82
|
readonly tool: string;
|
|
121
83
|
readonly arguments: string;
|
|
84
|
+
} | {
|
|
85
|
+
readonly _tag: "Output";
|
|
86
|
+
readonly result: ToolResult;
|
|
122
87
|
} | {
|
|
123
88
|
readonly _tag: "Progress";
|
|
124
89
|
readonly call_id: string;
|
|
125
90
|
readonly tool: string;
|
|
126
91
|
readonly data: unknown;
|
|
92
|
+
}, {
|
|
93
|
+
readonly _tag: Tag;
|
|
94
|
+
}>) => any; }>(value: {
|
|
95
|
+
readonly _tag: "ApprovalRequested";
|
|
96
|
+
readonly call_id: string;
|
|
97
|
+
readonly tool: string;
|
|
98
|
+
readonly arguments: string;
|
|
127
99
|
} | {
|
|
128
100
|
readonly _tag: "Output";
|
|
129
101
|
readonly result: ToolResult;
|
|
130
|
-
}
|
|
102
|
+
} | {
|
|
103
|
+
readonly _tag: "Progress";
|
|
104
|
+
readonly call_id: string;
|
|
105
|
+
readonly tool: string;
|
|
106
|
+
readonly data: unknown;
|
|
107
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["ApprovalRequested" | "Output" | "Progress"]>>;
|
|
131
108
|
};
|
|
109
|
+
readonly ApprovalRequested: Data.TaggedEnum.ConstructorFrom<{
|
|
110
|
+
readonly _tag: "ApprovalRequested";
|
|
111
|
+
readonly call_id: string;
|
|
112
|
+
readonly tool: string;
|
|
113
|
+
readonly arguments: string;
|
|
114
|
+
}, "_tag">;
|
|
115
|
+
readonly Output: Data.TaggedEnum.ConstructorFrom<{
|
|
116
|
+
readonly _tag: "Output";
|
|
117
|
+
readonly result: ToolResult;
|
|
118
|
+
}, "_tag">;
|
|
119
|
+
readonly Progress: Data.TaggedEnum.ConstructorFrom<{
|
|
120
|
+
readonly _tag: "Progress";
|
|
121
|
+
readonly call_id: string;
|
|
122
|
+
readonly tool: string;
|
|
123
|
+
readonly data: unknown;
|
|
124
|
+
}, "_tag">;
|
|
132
125
|
};
|
|
133
126
|
declare const isApprovalRequested: (u: unknown) => u is {
|
|
134
127
|
readonly _tag: "ApprovalRequested";
|
|
@@ -148,4 +141,4 @@ declare const isOutput: (u: unknown) => u is {
|
|
|
148
141
|
};
|
|
149
142
|
//#endregion
|
|
150
143
|
export { isProgress as a, isOutput as i, ToolEvent_d_exports as n, isApprovalRequested as r, ToolEvent as t };
|
|
151
|
-
//# sourceMappingURL=ToolEvent-
|
|
144
|
+
//# sourceMappingURL=ToolEvent-D99MGQYH.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolEvent-D99MGQYH.d.mts","names":[],"sources":["../src/tool/ToolEvent.ts"],"mappings":";;;;;KAkBY,YAAY,KAAK;EAC3B;aACW;aACA;aACA;;EAEX;aACW;aACA;aACA;;EAEX;aACW,QAAQ;;;;;;;;;;cAWR;;;aArBS;aACH;aACK;;;;;aAQH,QAAA;;;;;aALC;aACH;aACA;;;;;;;eAPG;eACH;eACK;;;eAQH,QAAA;;;eALC;eACH;eACA;;;;;;;;;;;;;;;;;;;eAPG;eACH;eACK;;;eAQH,QAAA;;;eALC;eACH;eACA;;;;;;;;;;;;;;;;;;;;aAPG;aACH;aACK;;;;aAQH,QAAA;;;;aALC;aACH;aACA;;;cAgBN,sBAAmB,eAAA;;WAvBV;WACH;WACK;;cAsBX,aAAU,eAAA;;WAnBD;WACH;WACA;;cAkBN,WAAQ,eAAA;;WAfA,QAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { v as ToolCall, y as ToolCallOutput } from "./Items-
|
|
1
|
+
import { v as ToolCall, y as ToolCallOutput } from "./Items-SfUabNuB.mjs";
|
|
2
2
|
import { Data } from "effect";
|
|
3
|
-
import * as _$effect_Unify0 from "effect/Unify";
|
|
4
|
-
|
|
5
|
-
//#region src/tool/ToolResult.d.ts
|
|
6
3
|
declare namespace ToolResult_d_exports {
|
|
7
4
|
export { ToolResult, cancelled, denied, executionError, failed, isFailure, isOk, nonLocalTool, serializeValue, toToolCallOutput, validationError };
|
|
8
5
|
}
|
|
@@ -28,89 +25,87 @@ type ToolResult = Data.TaggedEnum<{
|
|
|
28
25
|
* raw `ToolResult.Failure(...)`.
|
|
29
26
|
*/
|
|
30
27
|
declare const ToolResult: {
|
|
31
|
-
readonly Ok:
|
|
32
|
-
readonly _tag: "Ok";
|
|
33
|
-
readonly call_id: string;
|
|
34
|
-
readonly tool: string;
|
|
35
|
-
readonly value: unknown;
|
|
36
|
-
}, "_tag">;
|
|
37
|
-
readonly Failure: Data.TaggedEnum.ConstructorFrom<{
|
|
28
|
+
readonly $is: <Tag extends "Failure" | "Ok">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
38
29
|
readonly _tag: "Failure";
|
|
39
30
|
readonly call_id: string;
|
|
40
31
|
readonly tool: string;
|
|
41
32
|
readonly kind: string;
|
|
42
33
|
readonly reason?: string;
|
|
43
|
-
}, "_tag">;
|
|
44
|
-
readonly $is: <Tag extends "Ok" | "Failure">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
45
|
-
readonly _tag: "Ok";
|
|
46
|
-
readonly call_id: string;
|
|
47
|
-
readonly tool: string;
|
|
48
|
-
readonly value: unknown;
|
|
49
34
|
}, {
|
|
50
35
|
readonly _tag: Tag;
|
|
51
36
|
}> | Extract<{
|
|
52
|
-
readonly _tag: "
|
|
37
|
+
readonly _tag: "Ok";
|
|
53
38
|
readonly call_id: string;
|
|
54
39
|
readonly tool: string;
|
|
55
|
-
readonly
|
|
56
|
-
readonly reason?: string;
|
|
40
|
+
readonly value: unknown;
|
|
57
41
|
}, {
|
|
58
42
|
readonly _tag: Tag;
|
|
59
43
|
}>;
|
|
60
44
|
readonly $match: {
|
|
61
|
-
<Cases extends {
|
|
62
|
-
readonly
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
readonly Failure: (args: {
|
|
69
|
-
readonly _tag: "Failure";
|
|
70
|
-
readonly call_id: string;
|
|
71
|
-
readonly tool: string;
|
|
72
|
-
readonly kind: string;
|
|
73
|
-
readonly reason?: string;
|
|
74
|
-
}) => any;
|
|
75
|
-
}>(cases: Cases): (value: {
|
|
45
|
+
<Cases extends { readonly [Tag in "Failure" | "Ok"]: (args: Extract<{
|
|
46
|
+
readonly _tag: "Failure";
|
|
47
|
+
readonly call_id: string;
|
|
48
|
+
readonly tool: string;
|
|
49
|
+
readonly kind: string;
|
|
50
|
+
readonly reason?: string;
|
|
51
|
+
} | {
|
|
76
52
|
readonly _tag: "Ok";
|
|
77
53
|
readonly call_id: string;
|
|
78
54
|
readonly tool: string;
|
|
79
55
|
readonly value: unknown;
|
|
80
|
-
}
|
|
56
|
+
}, {
|
|
57
|
+
readonly _tag: Tag;
|
|
58
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
81
59
|
readonly _tag: "Failure";
|
|
82
60
|
readonly call_id: string;
|
|
83
61
|
readonly tool: string;
|
|
84
62
|
readonly kind: string;
|
|
85
63
|
readonly reason?: string;
|
|
86
|
-
}
|
|
87
|
-
<Cases extends {
|
|
88
|
-
readonly Ok: (args: {
|
|
89
|
-
readonly _tag: "Ok";
|
|
90
|
-
readonly call_id: string;
|
|
91
|
-
readonly tool: string;
|
|
92
|
-
readonly value: unknown;
|
|
93
|
-
}) => any;
|
|
94
|
-
readonly Failure: (args: {
|
|
95
|
-
readonly _tag: "Failure";
|
|
96
|
-
readonly call_id: string;
|
|
97
|
-
readonly tool: string;
|
|
98
|
-
readonly kind: string;
|
|
99
|
-
readonly reason?: string;
|
|
100
|
-
}) => any;
|
|
101
|
-
}>(value: {
|
|
64
|
+
} | {
|
|
102
65
|
readonly _tag: "Ok";
|
|
103
66
|
readonly call_id: string;
|
|
104
67
|
readonly tool: string;
|
|
105
68
|
readonly value: unknown;
|
|
69
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Ok"]>>;
|
|
70
|
+
<Cases extends { readonly [Tag in "Failure" | "Ok"]: (args: Extract<{
|
|
71
|
+
readonly _tag: "Failure";
|
|
72
|
+
readonly call_id: string;
|
|
73
|
+
readonly tool: string;
|
|
74
|
+
readonly kind: string;
|
|
75
|
+
readonly reason?: string;
|
|
106
76
|
} | {
|
|
77
|
+
readonly _tag: "Ok";
|
|
78
|
+
readonly call_id: string;
|
|
79
|
+
readonly tool: string;
|
|
80
|
+
readonly value: unknown;
|
|
81
|
+
}, {
|
|
82
|
+
readonly _tag: Tag;
|
|
83
|
+
}>) => any; }>(value: {
|
|
107
84
|
readonly _tag: "Failure";
|
|
108
85
|
readonly call_id: string;
|
|
109
86
|
readonly tool: string;
|
|
110
87
|
readonly kind: string;
|
|
111
88
|
readonly reason?: string;
|
|
112
|
-
}
|
|
89
|
+
} | {
|
|
90
|
+
readonly _tag: "Ok";
|
|
91
|
+
readonly call_id: string;
|
|
92
|
+
readonly tool: string;
|
|
93
|
+
readonly value: unknown;
|
|
94
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Failure" | "Ok"]>>;
|
|
113
95
|
};
|
|
96
|
+
readonly Failure: Data.TaggedEnum.ConstructorFrom<{
|
|
97
|
+
readonly _tag: "Failure";
|
|
98
|
+
readonly call_id: string;
|
|
99
|
+
readonly tool: string;
|
|
100
|
+
readonly kind: string;
|
|
101
|
+
readonly reason?: string;
|
|
102
|
+
}, "_tag">;
|
|
103
|
+
readonly Ok: Data.TaggedEnum.ConstructorFrom<{
|
|
104
|
+
readonly _tag: "Ok";
|
|
105
|
+
readonly call_id: string;
|
|
106
|
+
readonly tool: string;
|
|
107
|
+
readonly value: unknown;
|
|
108
|
+
}, "_tag">;
|
|
114
109
|
};
|
|
115
110
|
declare const isOk: (u: unknown) => u is {
|
|
116
111
|
readonly _tag: "Ok";
|
|
@@ -154,4 +149,4 @@ declare const serializeValue: (value: unknown) => string;
|
|
|
154
149
|
declare const toToolCallOutput: (r: ToolResult) => ToolCallOutput;
|
|
155
150
|
//#endregion
|
|
156
151
|
export { executionError as a, isOk as c, toToolCallOutput as d, validationError as f, denied as i, nonLocalTool as l, ToolResult_d_exports as n, failed as o, cancelled as r, isFailure as s, ToolResult as t, serializeValue as u };
|
|
157
|
-
//# sourceMappingURL=ToolResult-
|
|
152
|
+
//# sourceMappingURL=ToolResult-Cj8ChodL.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolResult-Cj8ChodL.d.mts","names":[],"sources":["../src/tool/ToolResult.ts"],"mappings":";;;;;KAqBY,aAAa,KAAK;EAC5B;aACW;aACA;aACA;;EAEX;aACW;aACA;aACA;aACA;;;;;;;;;;;cAYA;;;aAfS;aACH;aACA;aACG;;;;;aARA;aACH;aACC;;;;;;;eAGE;eACH;eACA;eACG;;;eARA;eACH;eACC;;;;;;;;;;;;;;;;;eAGE;eACH;eACA;eACG;;;eARA;eACH;eACC;;;;;;;;;;;;;;;;;;aAGE;aACH;aACA;aACG;;;;aARA;aACH;aACC;;;cAoBP,OAAI,eAAA;;WAtBK;WACH;WACC;;cAqBP,YAAS,eAAA;;WAlBA;WACH;WACA;WACG;;cAqBT,SAAM,MAAU,UAAQ,cAAc,oBAAoB;;cAS1D,SAAM,MAAU,UAAQ,oBAAoB;;cAI5C,YAAS,MAAU,UAAQ,oBAAoB;;cAI/C,iBAAc,MAAU,UAAQ,mBAAmB;;;;;;;cASnD,eAAY,MAAU,UAAQ,oBAAoB;;;;;;cAYlD,kBAAe,MAAU,UAAQ,oBAAoB;;;;;;cAYrD,iBAAc;cAOd,mBAAgB,GAAO,eAAa"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { o as HistoryItem, v as ToolCall } from "./Items-
|
|
2
|
-
import { a as Emit, c as SignalTool, d as ToolE, h as ToolR, l as Tool, n as AnyTool, o as InteractionTool, p as ToolFailed, s as ProviderTool, u as ToolDescriptor } from "./Tool-
|
|
1
|
+
import { o as HistoryItem, v as ToolCall } from "./Items-SfUabNuB.mjs";
|
|
2
|
+
import { a as Emit, c as SignalTool, d as ToolE, h as ToolR, l as Tool, n as AnyTool, o as InteractionTool, p as ToolFailed, s as ProviderTool, u as ToolDescriptor } from "./Tool-DE-rnvkw.mjs";
|
|
3
3
|
import { Turn } from "./domain/Turn.mjs";
|
|
4
|
-
import { r as Step } from "./Loop-
|
|
5
|
-
import { t as ToolResult } from "./ToolResult-
|
|
6
|
-
import { t as ToolEvent } from "./ToolEvent-
|
|
4
|
+
import { r as Step } from "./Loop-B54AB1ME.mjs";
|
|
5
|
+
import { t as ToolResult } from "./ToolResult-Cj8ChodL.mjs";
|
|
6
|
+
import { t as ToolEvent } from "./ToolEvent-D99MGQYH.mjs";
|
|
7
7
|
import { Cause, Effect, Stream } from "effect";
|
|
8
|
-
import * as _$effect_Types0 from "effect/Types";
|
|
9
|
-
|
|
10
|
-
//#region src/tool/Toolkit.d.ts
|
|
11
8
|
declare namespace Toolkit_d_exports {
|
|
12
9
|
export { DuplicateToolName, ExecuteOptions, Middleware, NoDuplicateNames, ToolMap, Toolkit, ToolkitE, ToolkitR, UniqueTools, appendToolResults, collectResults, compose, continueWithResults, describeFailures, descriptors, fromArray, make, makeNamespaced, namespace, run, wrap };
|
|
13
10
|
}
|
|
14
11
|
type ToolMap = Record<string, AnyTool>;
|
|
15
12
|
type Toolkit<Tools extends ToolMap = ToolMap> = Tools;
|
|
16
|
-
declare const make: <const Tools extends ReadonlyArray<AnyTool>>(...tools: UniqueTools<Tools>) => Toolkit<{ [T in Tools[number] as T["name"]]: T }>;
|
|
13
|
+
declare const make: <const Tools extends ReadonlyArray<AnyTool>>(...tools: UniqueTools<Tools>) => Toolkit<{ [T in Tools[number] as T["name"]]: T; }>;
|
|
17
14
|
/**
|
|
18
15
|
* Build a toolkit from a dynamically-sourced array (MCP server, plugin). Names
|
|
19
16
|
* are not validated (MCP legitimately uses dots / >64 chars — sanitize at the
|
|
@@ -51,8 +48,8 @@ type UniqueTools<Tools extends ReadonlyArray<AnyTool>> = Tools & NoDuplicateName
|
|
|
51
48
|
type ComposeDuplicateKey<Kits extends ReadonlyArray<Toolkit>, Seen extends string = never> = Kits extends readonly [infer Head extends Toolkit, ...infer Tail extends ReadonlyArray<Toolkit>] ? string extends keyof Head ? ComposeDuplicateKey<Tail, Seen> : Extract<keyof Head & string, Seen> extends never ? ComposeDuplicateKey<Tail, Seen | (keyof Head & string)> : Extract<keyof Head & string, Seen> : never;
|
|
52
49
|
type NoDuplicateComposedKeys<Kits extends ReadonlyArray<Toolkit>> = [ComposeDuplicateKey<Kits>] extends [never] ? unknown : DuplicateNameError<ComposeDuplicateKey<Kits>>;
|
|
53
50
|
type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
|
|
54
|
-
type Composed<Kits extends ReadonlyArray<Toolkit>> = UnionToIntersection<Kits[number]> extends infer M ? (M extends ToolMap ? M : ToolMap) : ToolMap;
|
|
55
|
-
declare const DuplicateToolName_base: new <A extends Record<string, any> = {}>(args:
|
|
51
|
+
type Composed<Kits extends ReadonlyArray<Toolkit>> = UnionToIntersection<Kits[number]> extends (infer M) ? (M extends ToolMap ? M : ToolMap) : ToolMap;
|
|
52
|
+
declare const DuplicateToolName_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
56
53
|
readonly _tag: "DuplicateToolName";
|
|
57
54
|
} & Readonly<A>;
|
|
58
55
|
/**
|
|
@@ -67,7 +64,7 @@ declare class DuplicateToolName extends DuplicateToolName_base<{
|
|
|
67
64
|
}> {}
|
|
68
65
|
type PrefixName<Prefix extends string, Name extends string> = `${Prefix}__${Name}`;
|
|
69
66
|
type PrefixTool<Prefix extends string, T extends AnyTool> = T extends Tool<infer N, infer I, infer Ev, infer O, infer E, infer R> ? Tool<PrefixName<Prefix, N>, I, Ev, O, E, R> : T extends ProviderTool<infer N, infer I, infer P, infer C> ? ProviderTool<PrefixName<Prefix, N>, I, P, C> : T extends SignalTool<infer N, infer I> ? SignalTool<PrefixName<Prefix, N>, I> : T extends InteractionTool<infer N, infer I> ? InteractionTool<PrefixName<Prefix, N>, I> : T;
|
|
70
|
-
type Namespaced<Prefix extends string, T extends ToolMap> = { readonly [K in keyof T & string as PrefixName<Prefix, K>]: T[K] extends AnyTool ? PrefixTool<Prefix, T[K]> : never };
|
|
67
|
+
type Namespaced<Prefix extends string, T extends ToolMap> = { readonly [K in keyof T & string as PrefixName<Prefix, K>]: T[K] extends AnyTool ? PrefixTool<Prefix, T[K]> : never; };
|
|
71
68
|
/**
|
|
72
69
|
* Prefix every tool name with `<namespace>__`, returning a new toolkit. Use it
|
|
73
70
|
* to keep generic names (`search`) from two sources distinct before `compose`.
|
|
@@ -76,7 +73,7 @@ type Namespaced<Prefix extends string, T extends ToolMap> = { readonly [K in key
|
|
|
76
73
|
*/
|
|
77
74
|
declare const namespace: <const Prefix extends string, const T extends ToolMap>(prefix: Prefix, toolkit: Toolkit<T>) => Toolkit<Namespaced<Prefix, T>>;
|
|
78
75
|
/** `namespace(prefix, make(...tools))` in one step, for static namespaced tools. */
|
|
79
|
-
declare const makeNamespaced: <const Prefix extends string, const Tools extends ReadonlyArray<AnyTool>>(prefix: Prefix, ...tools: UniqueTools<Tools>) => Toolkit<Namespaced<Prefix, { [T in Tools[number] as T["name"]]: T }>>;
|
|
76
|
+
declare const makeNamespaced: <const Prefix extends string, const Tools extends ReadonlyArray<AnyTool>>(prefix: Prefix, ...tools: UniqueTools<Tools>) => Toolkit<Namespaced<Prefix, { [T in Tools[number] as T["name"]]: T; }>>;
|
|
80
77
|
/**
|
|
81
78
|
* Combine independently-built toolkits into one. This is where names from
|
|
82
79
|
* separate sources can collide, so it is the one effectful constructor: a
|
|
@@ -93,7 +90,7 @@ type Handler<Input, Event, Output, E, R> = (input: Input, emit: Emit<Event>) =>
|
|
|
93
90
|
*/
|
|
94
91
|
type Middleware<R2 = never, E2 = never> = <Input, Event, Output, E, R>(run: Handler<Input, Event, Output, E, R>, name: string) => Handler<Input, Event, Output, E | E2, R | R2>;
|
|
95
92
|
type WrapTool<T extends AnyTool, R2, E2> = T extends Tool<infer N, infer I, infer Ev, infer O, infer E, infer R> ? Tool<N, I, Ev, O, E | E2, R | R2> : T;
|
|
96
|
-
type WrapToolkit<T extends ToolMap, R2, E2> = { readonly [K in keyof T]: T[K] extends AnyTool ? WrapTool<T[K], R2, E2> : T[K] };
|
|
93
|
+
type WrapToolkit<T extends ToolMap, R2, E2> = { readonly [K in keyof T]: T[K] extends AnyTool ? WrapTool<T[K], R2, E2> : T[K]; };
|
|
97
94
|
/**
|
|
98
95
|
* Wrap every local tool's `run` with a middleware, preserving each tool's
|
|
99
96
|
* `Input`/`Output` and unioning the middleware's requirement `R2` into the
|
|
@@ -114,7 +111,7 @@ declare const wrap: {
|
|
|
114
111
|
<T extends Toolkit, R2, E2>(toolkit: T, middleware: Middleware<R2, E2>): WrapToolkit<T, R2, E2>;
|
|
115
112
|
};
|
|
116
113
|
type DescribeTool<T extends AnyTool> = T extends Tool<infer N, infer I, infer Ev, infer O, any, infer R> ? Tool<N, I, Ev, O, string, R> : T;
|
|
117
|
-
type DescribeToolkit<T extends ToolMap> = { readonly [K in keyof T]: T[K] extends AnyTool ? DescribeTool<T[K]> : T[K] };
|
|
114
|
+
type DescribeToolkit<T extends ToolMap> = { readonly [K in keyof T]: T[K] extends AnyTool ? DescribeTool<T[K]> : T[K]; };
|
|
118
115
|
/**
|
|
119
116
|
* Map every local tool's error to a `string`, so `Toolkit.run` absorbs those
|
|
120
117
|
* failures into `ToolResult.Failure` the model reads and adapts to. Pairs
|
|
@@ -193,4 +190,4 @@ declare const continueWithResults: {
|
|
|
193
190
|
};
|
|
194
191
|
//#endregion
|
|
195
192
|
export { wrap as S, fromArray as _, ToolMap as a, namespace as b, ToolkitR as c, appendToolResults as d, collectResults as f, descriptors as g, describeFailures as h, NoDuplicateNames as i, Toolkit_d_exports as l, continueWithResults as m, ExecuteOptions as n, Toolkit as o, compose as p, Middleware as r, ToolkitE as s, DuplicateToolName as t, UniqueTools as u, make as v, run as x, makeNamespaced as y };
|
|
196
|
-
//# sourceMappingURL=Toolkit-
|
|
193
|
+
//# sourceMappingURL=Toolkit-BEZrNPTI.d.mts.map
|
|
@@ -0,0 +1 @@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ts
|
|
5
3
|
declare namespace Browser_d_exports {
|
|
6
4
|
export { AxNode, BoundingBox, Browser, BrowserService, BrowserSession, BrowserSessionId, BrowserSessionRef, CommonSessionRequest, Cookie, CookieApi, ElementInfo, PageFormat, ScreenshotOptions, ScrollDirection, ScrollOptions, attach, create, destroy, list };
|
|
7
5
|
}
|
|
@@ -15,7 +13,8 @@ type BrowserSessionId = Brand.Branded<string, "BrowserSessionId">;
|
|
|
15
13
|
declare const BrowserSessionId: Brand.Constructor<BrowserSessionId>;
|
|
16
14
|
/** Reference returned by `list`; enough to `attach`. */
|
|
17
15
|
type BrowserSessionRef = {
|
|
18
|
-
readonly id: BrowserSessionId;
|
|
16
|
+
readonly id: BrowserSessionId;
|
|
17
|
+
/** Current top-level URL, when the provider reports it. */
|
|
19
18
|
readonly url?: string;
|
|
20
19
|
};
|
|
21
20
|
/**
|
|
@@ -42,7 +41,8 @@ type CommonSessionRequest = {
|
|
|
42
41
|
* Idle teardown: dispose the session after this much inactivity, the
|
|
43
42
|
* timer resetting on each operation. Opt-in; omit for no idle limit.
|
|
44
43
|
*/
|
|
45
|
-
readonly idleTimeout?: Duration.Input;
|
|
44
|
+
readonly idleTimeout?: Duration.Input;
|
|
45
|
+
/** Initial viewport size. Providers default differently. */
|
|
46
46
|
readonly viewport?: {
|
|
47
47
|
readonly width: number;
|
|
48
48
|
readonly height: number;
|
|
@@ -84,11 +84,14 @@ type AxNode = {
|
|
|
84
84
|
};
|
|
85
85
|
type ScrollDirection = "up" | "down" | "left" | "right";
|
|
86
86
|
type ScrollOptions = {
|
|
87
|
-
readonly direction: ScrollDirection;
|
|
87
|
+
readonly direction: ScrollDirection;
|
|
88
|
+
/** Distance in CSS pixels. Provider default applies when omitted. */
|
|
88
89
|
readonly pixels?: number;
|
|
89
90
|
};
|
|
90
91
|
type ScreenshotOptions = {
|
|
91
|
-
/** Clip to the first element matching this selector. */
|
|
92
|
+
/** Clip to the first element matching this selector. */
|
|
93
|
+
readonly selector?: string;
|
|
94
|
+
/** Capture the full scrollable page rather than the viewport. */
|
|
92
95
|
readonly fullPage?: boolean;
|
|
93
96
|
};
|
|
94
97
|
type Cookie = {
|
|
@@ -158,7 +161,8 @@ type BrowserService = {
|
|
|
158
161
|
* detaches rather than destroying, for sessions kept warm beyond a
|
|
159
162
|
* single run.
|
|
160
163
|
*/
|
|
161
|
-
readonly attach: (id: BrowserSessionId) => Effect.Effect<BrowserSession, BrowserError, Scope.Scope>;
|
|
164
|
+
readonly attach: (id: BrowserSessionId) => Effect.Effect<BrowserSession, BrowserError, Scope.Scope>;
|
|
165
|
+
/** Enumerate sessions visible to the configured account / project. */
|
|
162
166
|
readonly list: Effect.Effect<ReadonlyArray<BrowserSessionRef>, BrowserError>;
|
|
163
167
|
/**
|
|
164
168
|
* Destroy a session from outside its owning scope. Most callers should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.d.mts","names":[],"sources":["../../src/browser/Browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Browser.d.mts","names":[],"sources":["../../src/browser/Browser.ts"],"mappings":";;;;;;;;;;;KAaY,mBAAmB,MAAM;cACxB,kBAAgB,MAAA,YAAA;;KAGjB;WACD,IAAI;;WAEJ;;;;;;KAOC;;;;;;KAWA;;;;;;;;;WASD,UAAU,SAAS;;;;;WAKnB,cAAc,SAAS;;WAEvB;aAAsB;aAAwB;;;KAO7C;WACD;WACA;WACA;WACA;;;;;;;KAQC;;;;;WAKD;WACA;WACA;WACA,YAAY,SAAS;WACrB,MAAM;;;KAIL;WACD;WACA;WACA;;;;;WAKA;WACA,UAAU,cAAc;;KAOvB;KAEA;WACD,WAAW;;WAEX;;KAGC;;WAED;;WAEA;;KAGC;WACD;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;KAIC;WACD,KAAK,OAAO,OAAO,cAAc,SAAS;WAC1C,MAAM,SAAS,cAAc,YAAY,OAAO,aAAa;;;;;;;;;;KAe5D;WACD,IAAI;WAGJ,OAAO,gBA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.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, (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, (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, (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, (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,UAAU,MAAM,EAAE,OAAO,QAAQ,CAAC;;;;;AAMnD,MAAa,UACX,OAEA,OAAO,QAAQ,UAAU,MAAM,EAAE,OAAO,GAAG,CAAC;;AAG9C,MAAa,OAIT,OAAO,QAAQ,UAAU,MAAM,EAAE,KAAK;;;;;AAM1C,MAAa,WACX,OAEA,OAAO,QAAQ,UAAU,MAAM,EAAE,QAAQ,GAAG,CAAC"}
|
|
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, (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, (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, (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, (s) => s.destroy(id))\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,mBAAmB,MAAM,QAA0B;AAqNhE,IAAa,UAAb,cAA6B,QAAQ,QAAiC,CAAC,CACrE,8BACF,CAAC,CAAC,CAAC;;;;;AAUH,MAAa,UACX,YAEA,OAAO,QAAQ,UAAU,MAAM,EAAE,OAAO,OAAO,CAAC;;;;;AAMlD,MAAa,UACX,OAEA,OAAO,QAAQ,UAAU,MAAM,EAAE,OAAO,EAAE,CAAC;;AAG7C,MAAa,OAIT,OAAO,QAAQ,UAAU,MAAM,EAAE,IAAI;;;;;AAMzC,MAAa,WACX,OAEA,OAAO,QAAQ,UAAU,MAAM,EAAE,QAAQ,EAAE,CAAC"}
|