backup 2026-08-23T20:24:25.191693 (part 5)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .opencode/node_modules/effect/dist/internal/schema/schema.js +11 -11
- .opencode/node_modules/effect/dist/internal/schema/schema.js.map +1 -1
- .opencode/node_modules/effect/dist/testing/FastCheck.d.ts +14 -12
- .opencode/node_modules/effect/dist/testing/FastCheck.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/testing/FastCheck.js +14 -12
- .opencode/node_modules/effect/dist/testing/FastCheck.js.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestClock.d.ts +56 -52
- .opencode/node_modules/effect/dist/testing/TestClock.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestClock.js +29 -14
- .opencode/node_modules/effect/dist/testing/TestClock.js.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestConsole.d.ts +114 -35
- .opencode/node_modules/effect/dist/testing/TestConsole.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestConsole.js +65 -15
- .opencode/node_modules/effect/dist/testing/TestConsole.js.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestSchema.d.ts +125 -86
- .opencode/node_modules/effect/dist/testing/TestSchema.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/testing/TestSchema.js +125 -154
- .opencode/node_modules/effect/dist/testing/TestSchema.js.map +1 -1
- .opencode/node_modules/effect/dist/testing/index.d.ts +0 -73
- .opencode/node_modules/effect/dist/testing/index.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/testing/index.js +0 -73
- .opencode/node_modules/effect/dist/testing/index.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/AiError.d.ts +306 -236
- .opencode/node_modules/effect/dist/unstable/ai/AiError.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/AiError.js +261 -198
- .opencode/node_modules/effect/dist/unstable/ai/AiError.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.d.ts +28 -22
- .opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.js +56 -52
- .opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/Chat.d.ts +136 -47
- .opencode/node_modules/effect/dist/unstable/ai/Chat.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/Chat.js +103 -78
- .opencode/node_modules/effect/dist/unstable/ai/Chat.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.d.ts +85 -25
- .opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.js +81 -21
- .opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/IdGenerator.d.ts +48 -62
- .opencode/node_modules/effect/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/IdGenerator.js +36 -55
- .opencode/node_modules/effect/dist/unstable/ai/IdGenerator.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/LanguageModel.d.ts +113 -76
- .opencode/node_modules/effect/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/LanguageModel.js +73 -31
- .opencode/node_modules/effect/dist/unstable/ai/LanguageModel.js.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/McpSchema.d.ts +608 -220
- .opencode/node_modules/effect/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- .opencode/node_modules/effect/dist/unstable/ai/McpSchema.js +525 -198
- .opencode/node_modules/effect/dist/unstable/ai/McpSchema.js.map +1 -1
.opencode/node_modules/effect/dist/internal/schema/schema.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import * as Effect from "../../Effect.js";
|
| 2 |
import { flow } from "../../Function.js";
|
| 3 |
import * as Pipeable from "../../Pipeable.js";
|
| 4 |
-
import * as
|
| 5 |
-
import * as
|
| 6 |
/** @internal */
|
| 7 |
export const TypeId = "~effect/Schema/Schema";
|
| 8 |
const SchemaProto = {
|
|
@@ -11,13 +11,13 @@ const SchemaProto = {
|
|
| 11 |
return Pipeable.pipeArguments(this, arguments);
|
| 12 |
},
|
| 13 |
annotate(annotations) {
|
| 14 |
-
return this.rebuild(
|
| 15 |
},
|
| 16 |
annotateKey(annotations) {
|
| 17 |
-
return this.rebuild(
|
| 18 |
},
|
| 19 |
check(...checks) {
|
| 20 |
-
return this.rebuild(
|
| 21 |
}
|
| 22 |
};
|
| 23 |
/** @internal */
|
|
@@ -28,9 +28,9 @@ export function make(ast, options) {
|
|
| 28 |
}
|
| 29 |
self.ast = ast;
|
| 30 |
self.rebuild = ast => make(ast, options);
|
| 31 |
-
self.makeEffect = flow(
|
| 32 |
-
self.make =
|
| 33 |
-
self.makeOption =
|
| 34 |
return self;
|
| 35 |
}
|
| 36 |
/** @internal */
|
|
@@ -69,12 +69,12 @@ export function makeReorder(getPriority) {
|
|
| 69 |
// Create a map of original indices for O(1) lookup
|
| 70 |
const indexMap = new Map();
|
| 71 |
for (let i = 0; i < types.length; i++) {
|
| 72 |
-
indexMap.set(
|
| 73 |
}
|
| 74 |
// Create a sorted copy of the types array
|
| 75 |
const sortedTypes = [...types].sort((a, b) => {
|
| 76 |
-
a =
|
| 77 |
-
b =
|
| 78 |
const pa = getPriority(a);
|
| 79 |
const pb = getPriority(b);
|
| 80 |
if (pa !== pb) return pa - pb;
|
|
|
|
| 1 |
import * as Effect from "../../Effect.js";
|
| 2 |
import { flow } from "../../Function.js";
|
| 3 |
import * as Pipeable from "../../Pipeable.js";
|
| 4 |
+
import * as SchemaAST from "../../SchemaAST.js";
|
| 5 |
+
import * as SchemaParser from "../../SchemaParser.js";
|
| 6 |
/** @internal */
|
| 7 |
export const TypeId = "~effect/Schema/Schema";
|
| 8 |
const SchemaProto = {
|
|
|
|
| 11 |
return Pipeable.pipeArguments(this, arguments);
|
| 12 |
},
|
| 13 |
annotate(annotations) {
|
| 14 |
+
return this.rebuild(SchemaAST.annotate(this.ast, annotations));
|
| 15 |
},
|
| 16 |
annotateKey(annotations) {
|
| 17 |
+
return this.rebuild(SchemaAST.annotateKey(this.ast, annotations));
|
| 18 |
},
|
| 19 |
check(...checks) {
|
| 20 |
+
return this.rebuild(SchemaAST.appendChecks(this.ast, checks));
|
| 21 |
}
|
| 22 |
};
|
| 23 |
/** @internal */
|
|
|
|
| 28 |
}
|
| 29 |
self.ast = ast;
|
| 30 |
self.rebuild = ast => make(ast, options);
|
| 31 |
+
self.makeEffect = flow(SchemaParser.makeEffect(self), Effect.mapErrorEager(issue => new SchemaError(issue)));
|
| 32 |
+
self.make = SchemaParser.make(self);
|
| 33 |
+
self.makeOption = SchemaParser.makeOption(self);
|
| 34 |
return self;
|
| 35 |
}
|
| 36 |
/** @internal */
|
|
|
|
| 69 |
// Create a map of original indices for O(1) lookup
|
| 70 |
const indexMap = new Map();
|
| 71 |
for (let i = 0; i < types.length; i++) {
|
| 72 |
+
indexMap.set(SchemaAST.toEncoded(types[i]), i);
|
| 73 |
}
|
| 74 |
// Create a sorted copy of the types array
|
| 75 |
const sortedTypes = [...types].sort((a, b) => {
|
| 76 |
+
a = SchemaAST.toEncoded(a);
|
| 77 |
+
b = SchemaAST.toEncoded(b);
|
| 78 |
const pa = getPriority(a);
|
| 79 |
const pb = getPriority(b);
|
| 80 |
if (pa !== pb) return pa - pb;
|
.opencode/node_modules/effect/dist/internal/schema/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"schema.js","names":["Effect","flow","Pipeable","
|
|
|
|
| 1 |
+
{"version":3,"file":"schema.js","names":["Effect","flow","Pipeable","SchemaAST","SchemaParser","TypeId","SchemaProto","pipe","pipeArguments","arguments","annotate","annotations","rebuild","ast","annotateKey","check","checks","appendChecks","make","options","self","Object","create","assign","makeEffect","mapErrorEager","issue","SchemaError","makeOption","SchemaErrorTypeId","_tag","name","constructor","message","toString","jsonReorder","makeReorder","getJsonPriority","getPriority","types","indexMap","Map","i","length","set","toEncoded","sortedTypes","sort","a","b","pa","pb","get","orderChanged","some","index"],"sources":["../../../src/internal/schema/schema.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,iBAAiB;AACzC,SAASC,IAAI,QAAQ,mBAAmB;AACxC,OAAO,KAAKC,QAAQ,MAAM,mBAAmB;AAE7C,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAE/C,OAAO,KAAKC,YAAY,MAAM,uBAAuB;AAErD;AACA,OAAO,MAAMC,MAAM,GAAG,uBAAuB;AAE7C,MAAMC,WAAW,GAAG;EAClB,CAACD,MAAM,GAAGA,MAAM;EAChBE,IAAIA,CAAA;IACF,OAAOL,QAAQ,CAACM,aAAa,CAAC,IAAI,EAAEC,SAAS,CAAC;EAChD,CAAC;EACDC,QAAQA,CAAmBC,WAA2C;IACpE,OAAO,IAAI,CAACC,OAAO,CAACT,SAAS,CAACO,QAAQ,CAAC,IAAI,CAACG,GAAG,EAAEF,WAAW,CAAC,CAAC;EAChE,CAAC;EACDG,WAAWA,CAAmBH,WAA4C;IACxE,OAAO,IAAI,CAACC,OAAO,CAACT,SAAS,CAACW,WAAW,CAAC,IAAI,CAACD,GAAG,EAAEF,WAAW,CAAC,CAAC;EACnE,CAAC;EACDI,KAAKA,CAAmB,GAAGC,MAA+E;IACxG,OAAO,IAAI,CAACJ,OAAO,CAACT,SAAS,CAACc,YAAY,CAAC,IAAI,CAACJ,GAAG,EAAEG,MAAM,CAAC,CAAC;EAC/D;CACD;AAED;AACA,OAAM,SAAUE,IAAIA,CAAuBL,GAAa,EAAEM,OAAgB;EACxE,MAAMC,IAAI,GAAGC,MAAM,CAACC,MAAM,CAAChB,WAAW,CAAC;EACvC,IAAIa,OAAO,EAAE;IACXE,MAAM,CAACE,MAAM,CAACH,IAA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AyB;IACjD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,KAAK,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;MACrCF,QAAQ,CAACI,GAAG,CAACzC,SAAS,CAAC0C,SAAS,CAACN,KAAK,CAACG,CAAC,CAAC,CAAC,EAAEA,CAAC,CAAC;IAChD;IAEA;IACA,MAAMI,WAAW,GAAG,CAAC,GAAGP,KAAK,CAAC,CAACQ,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAI;MAC3CD,CAAC,GAAG7C,SAAS,CAAC0C,SAAS,CAACG,CAAC,CAAC;MAC1BC,CAAC,GAAG9C,SAAS,CAAC0C,SAAS,CAACI,CAAC,CAAC;MAC1B,MAAMC,EAAE,GAAGZ,WAAW,CAACU,CAAC,CAAC;MACzB,MAAMG,EAAE,GAAGb,WAAW,CAACW,CAAC,CAAC;MACzB,IAAIC,EAAE,KAAKC,EAAE,EAAE,OAAOD,EAAE,GAAGC,EAAE;MAC7B;MACA,OAAOX,QAAQ,CAACY,GAAG,CAACJ,CAAC,CAAE,GAAGR,QAAQ,CAACY,GAAG,CAACH,CAAC,CAAE;IAC5C,CAAC,CAAC;IAEF;IACA,MAAMI,YAAY,GAAGP,WAAW,CAACQ,IAAI,CAAC,CAACzC,GAAG,EAAE0C,KAAK,KAAK1C,GAAG,KAAK0B,KAAK,CAACgB,KAAK,CAAC,CAAC;IAE3E,IAAI,CAACF,YAAY,EAAE,OAAOd,KAAK;IAC/B,OAAOO,WAAW;EACpB,CAAC;AACH","ignoreList":[]}
|
.opencode/node_modules/effect/dist/testing/FastCheck.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* Fast-check is a property-based testing framework that generates random test cases
|
| 4 |
-
* to validate that properties hold true for a wide range of inputs.
|
| 5 |
*
|
| 6 |
-
* Property-based
|
| 7 |
-
*
|
| 8 |
-
*
|
|
|
|
| 9 |
*
|
| 10 |
* @since 3.10.0
|
| 11 |
*/
|
|
@@ -18,9 +17,10 @@
|
|
| 18 |
* true for your functions, rather than writing specific test cases. The library
|
| 19 |
* then generates many random inputs to verify these properties.
|
| 20 |
*
|
| 21 |
-
*
|
|
|
|
| 22 |
* ```ts
|
| 23 |
-
* import
|
| 24 |
*
|
| 25 |
* // Property: reverse of reverse should equal original
|
| 26 |
* const reverseProp = FastCheck.property(
|
|
@@ -36,9 +36,10 @@
|
|
| 36 |
* FastCheck.assert(reverseProp)
|
| 37 |
* ```
|
| 38 |
*
|
| 39 |
-
*
|
|
|
|
| 40 |
* ```ts
|
| 41 |
-
* import
|
| 42 |
*
|
| 43 |
* // Test string concatenation properties
|
| 44 |
* const concatProp = FastCheck.property(
|
|
@@ -55,9 +56,10 @@
|
|
| 55 |
* FastCheck.assert(concatProp)
|
| 56 |
* ```
|
| 57 |
*
|
| 58 |
-
*
|
|
|
|
| 59 |
* ```ts
|
| 60 |
-
* import
|
| 61 |
*
|
| 62 |
* // Generate random data for testing
|
| 63 |
* const personArbitrary = FastCheck.record({
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Re-exports `fast-check` for property-based testing.
|
|
|
|
|
|
|
| 3 |
*
|
| 4 |
+
* Property-based tests describe a rule that should hold for many inputs, and
|
| 5 |
+
* `fast-check` generates random examples to look for counterexamples. This
|
| 6 |
+
* module exposes the library from `effect/testing` so tests can use it alongside
|
| 7 |
+
* the other Effect testing helpers.
|
| 8 |
*
|
| 9 |
* @since 3.10.0
|
| 10 |
*/
|
|
|
|
| 17 |
* true for your functions, rather than writing specific test cases. The library
|
| 18 |
* then generates many random inputs to verify these properties.
|
| 19 |
*
|
| 20 |
+
* **Example** (Checking an array reversal property)
|
| 21 |
+
*
|
| 22 |
* ```ts
|
| 23 |
+
* import { FastCheck } from "effect/testing"
|
| 24 |
*
|
| 25 |
* // Property: reverse of reverse should equal original
|
| 26 |
* const reverseProp = FastCheck.property(
|
|
|
|
| 36 |
* FastCheck.assert(reverseProp)
|
| 37 |
* ```
|
| 38 |
*
|
| 39 |
+
* **Example** (Checking string concatenation properties)
|
| 40 |
+
*
|
| 41 |
* ```ts
|
| 42 |
+
* import { FastCheck } from "effect/testing"
|
| 43 |
*
|
| 44 |
* // Test string concatenation properties
|
| 45 |
* const concatProp = FastCheck.property(
|
|
|
|
| 56 |
* FastCheck.assert(concatProp)
|
| 57 |
* ```
|
| 58 |
*
|
| 59 |
+
* **Example** (Generating record data for properties)
|
| 60 |
+
*
|
| 61 |
* ```ts
|
| 62 |
+
* import { FastCheck } from "effect/testing"
|
| 63 |
*
|
| 64 |
* // Generate random data for testing
|
| 65 |
* const personArbitrary = FastCheck.record({
|
.opencode/node_modules/effect/dist/testing/FastCheck.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"FastCheck.d.ts","sourceRoot":"","sources":["../../src/testing/FastCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"FastCheck.d.ts","sourceRoot":"","sources":["../../src/testing/FastCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,cAAc,YAAY,CAAA"}
|
.opencode/node_modules/effect/dist/testing/FastCheck.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* Fast-check is a property-based testing framework that generates random test cases
|
| 4 |
-
* to validate that properties hold true for a wide range of inputs.
|
| 5 |
*
|
| 6 |
-
* Property-based
|
| 7 |
-
*
|
| 8 |
-
*
|
|
|
|
| 9 |
*
|
| 10 |
* @since 3.10.0
|
| 11 |
*/
|
|
@@ -18,9 +17,10 @@
|
|
| 18 |
* true for your functions, rather than writing specific test cases. The library
|
| 19 |
* then generates many random inputs to verify these properties.
|
| 20 |
*
|
| 21 |
-
*
|
|
|
|
| 22 |
* ```ts
|
| 23 |
-
* import
|
| 24 |
*
|
| 25 |
* // Property: reverse of reverse should equal original
|
| 26 |
* const reverseProp = FastCheck.property(
|
|
@@ -36,9 +36,10 @@
|
|
| 36 |
* FastCheck.assert(reverseProp)
|
| 37 |
* ```
|
| 38 |
*
|
| 39 |
-
*
|
|
|
|
| 40 |
* ```ts
|
| 41 |
-
* import
|
| 42 |
*
|
| 43 |
* // Test string concatenation properties
|
| 44 |
* const concatProp = FastCheck.property(
|
|
@@ -55,9 +56,10 @@
|
|
| 55 |
* FastCheck.assert(concatProp)
|
| 56 |
* ```
|
| 57 |
*
|
| 58 |
-
*
|
|
|
|
| 59 |
* ```ts
|
| 60 |
-
* import
|
| 61 |
*
|
| 62 |
* // Generate random data for testing
|
| 63 |
* const personArbitrary = FastCheck.record({
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Re-exports `fast-check` for property-based testing.
|
|
|
|
|
|
|
| 3 |
*
|
| 4 |
+
* Property-based tests describe a rule that should hold for many inputs, and
|
| 5 |
+
* `fast-check` generates random examples to look for counterexamples. This
|
| 6 |
+
* module exposes the library from `effect/testing` so tests can use it alongside
|
| 7 |
+
* the other Effect testing helpers.
|
| 8 |
*
|
| 9 |
* @since 3.10.0
|
| 10 |
*/
|
|
|
|
| 17 |
* true for your functions, rather than writing specific test cases. The library
|
| 18 |
* then generates many random inputs to verify these properties.
|
| 19 |
*
|
| 20 |
+
* **Example** (Checking an array reversal property)
|
| 21 |
+
*
|
| 22 |
* ```ts
|
| 23 |
+
* import { FastCheck } from "effect/testing"
|
| 24 |
*
|
| 25 |
* // Property: reverse of reverse should equal original
|
| 26 |
* const reverseProp = FastCheck.property(
|
|
|
|
| 36 |
* FastCheck.assert(reverseProp)
|
| 37 |
* ```
|
| 38 |
*
|
| 39 |
+
* **Example** (Checking string concatenation properties)
|
| 40 |
+
*
|
| 41 |
* ```ts
|
| 42 |
+
* import { FastCheck } from "effect/testing"
|
| 43 |
*
|
| 44 |
* // Test string concatenation properties
|
| 45 |
* const concatProp = FastCheck.property(
|
|
|
|
| 56 |
* FastCheck.assert(concatProp)
|
| 57 |
* ```
|
| 58 |
*
|
| 59 |
+
* **Example** (Generating record data for properties)
|
| 60 |
+
*
|
| 61 |
* ```ts
|
| 62 |
+
* import { FastCheck } from "effect/testing"
|
| 63 |
*
|
| 64 |
* // Generate random data for testing
|
| 65 |
* const personArbitrary = FastCheck.record({
|
.opencode/node_modules/effect/dist/testing/FastCheck.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"FastCheck.js","names":[],"sources":["../../src/testing/FastCheck.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"FastCheck.js","names":[],"sources":["../../src/testing/FastCheck.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,cAAc,YAAY","ignoreList":[]}
|
.opencode/node_modules/effect/dist/testing/TestClock.d.ts
CHANGED
|
@@ -4,16 +4,26 @@ import * as Effect from "../Effect.ts";
|
|
| 4 |
import * as Latch from "../Latch.ts";
|
| 5 |
import * as Layer from "../Layer.ts";
|
| 6 |
/**
|
| 7 |
-
* A `TestClock` simplifies
|
| 8 |
-
*
|
|
|
|
|
|
|
| 9 |
*
|
| 10 |
* Instead of waiting for actual time to pass, `sleep` and methods implemented
|
| 11 |
-
* in terms of it schedule effects to take place at a given clock time.
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
*
|
| 16 |
-
*
|
| 17 |
*
|
| 18 |
* ```ts
|
| 19 |
* import { Effect, Fiber, Option, pipe } from "effect"
|
|
@@ -32,15 +42,8 @@ import * as Layer from "../Layer.ts";
|
|
| 32 |
* })
|
| 33 |
* ```
|
| 34 |
*
|
| 35 |
-
*
|
| 36 |
-
* and methods derived from it will semantically block until the time is set to
|
| 37 |
-
* on or after the time they are scheduled to run. If we didn't fork the fiber
|
| 38 |
-
* on which we called sleep we would never get to set the time on the line
|
| 39 |
-
* below. Thus, a useful pattern when using `TestClock` is to fork the effect
|
| 40 |
-
* being tested, then adjust the clock time, and finally verify that the
|
| 41 |
-
* expected effects have been performed.
|
| 42 |
*
|
| 43 |
-
* @example
|
| 44 |
* ```ts
|
| 45 |
* import { Effect } from "effect"
|
| 46 |
* import { TestClock } from "effect/testing"
|
|
@@ -62,8 +65,8 @@ import * as Layer from "../Layer.ts";
|
|
| 62 |
* })
|
| 63 |
* ```
|
| 64 |
*
|
| 65 |
-
* @since 2.0.0
|
| 66 |
* @category models
|
|
|
|
| 67 |
*/
|
| 68 |
export interface TestClock extends Clock.Clock {
|
| 69 |
/**
|
|
@@ -84,7 +87,10 @@ export interface TestClock extends Clock.Clock {
|
|
| 84 |
withLive<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
| 85 |
}
|
| 86 |
/**
|
| 87 |
-
*
|
|
|
|
|
|
|
|
|
|
| 88 |
* ```ts
|
| 89 |
* import { Effect } from "effect"
|
| 90 |
* import { TestClock } from "effect/testing"
|
|
@@ -101,12 +107,16 @@ export interface TestClock extends Clock.Clock {
|
|
| 101 |
* })
|
| 102 |
* ```
|
| 103 |
*
|
| 104 |
-
* @since
|
| 105 |
-
* @category models
|
| 106 |
*/
|
| 107 |
export declare namespace TestClock {
|
| 108 |
/**
|
| 109 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
* ```ts
|
| 111 |
* import { Effect } from "effect"
|
| 112 |
* import { TestClock } from "effect/testing"
|
|
@@ -122,8 +132,8 @@ export declare namespace TestClock {
|
|
| 122 |
* })
|
| 123 |
* ```
|
| 124 |
*
|
|
|
|
| 125 |
* @since 4.0.0
|
| 126 |
-
* @category models
|
| 127 |
*/
|
| 128 |
interface Options {
|
| 129 |
/**
|
|
@@ -133,24 +143,12 @@ export declare namespace TestClock {
|
|
| 133 |
readonly warningDelay?: Duration.Input;
|
| 134 |
}
|
| 135 |
/**
|
| 136 |
-
*
|
| 137 |
-
*
|
| 138 |
-
*
|
| 139 |
-
* import { TestClock } from "effect/testing"
|
| 140 |
*
|
| 141 |
-
* const program = Effect.gen(function*() {
|
| 142 |
-
* const testClock = yield* TestClock.make()
|
| 143 |
-
*
|
| 144 |
-
* // The state represents the current timestamp and scheduled sleeps
|
| 145 |
-
* const timestamp = testClock.currentTimeMillisUnsafe()
|
| 146 |
-
* console.log(timestamp) // Current test time
|
| 147 |
-
*
|
| 148 |
-
* // Internal state structure: { timestamp: number, sleeps: Array<[number, Latch.Latch]> }
|
| 149 |
-
* })
|
| 150 |
-
* ```
|
| 151 |
-
*
|
| 152 |
-
* @since 4.0.0
|
| 153 |
* @category models
|
|
|
|
| 154 |
*/
|
| 155 |
interface State {
|
| 156 |
readonly timestamp: number;
|
|
@@ -160,7 +158,8 @@ export declare namespace TestClock {
|
|
| 160 |
/**
|
| 161 |
* Creates a `TestClock` with optional configuration.
|
| 162 |
*
|
| 163 |
-
*
|
|
|
|
| 164 |
* ```ts
|
| 165 |
* import { Effect } from "effect"
|
| 166 |
* import { TestClock } from "effect/testing"
|
|
@@ -181,23 +180,24 @@ export declare namespace TestClock {
|
|
| 181 |
* })
|
| 182 |
* ```
|
| 183 |
*
|
| 184 |
-
* @since 4.0.0
|
| 185 |
* @category constructors
|
|
|
|
| 186 |
*/
|
| 187 |
export declare const make: (options?: TestClock.Options | undefined) => Effect.Effect<{
|
| 188 |
currentTimeMillisUnsafe: () => number;
|
| 189 |
currentTimeNanosUnsafe: () => bigint;
|
| 190 |
currentTimeMillis: Effect.Effect<number, never, never>;
|
| 191 |
currentTimeNanos: Effect.Effect<bigint, never, never>;
|
| 192 |
-
adjust: (duration: Duration.Input) => Effect.Effect<void, never,
|
| 193 |
-
setTime: (timestamp: number) => Effect.Effect<void, never,
|
| 194 |
sleep: (duration: Duration.Duration) => Effect.Effect<void, never, never>;
|
| 195 |
withLive: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, never>>;
|
| 196 |
}, never, import("../Scope.ts").Scope>;
|
| 197 |
/**
|
| 198 |
* Creates a `Layer` which constructs a `TestClock`.
|
| 199 |
*
|
| 200 |
-
*
|
|
|
|
| 201 |
* ```ts
|
| 202 |
* import { Effect } from "effect"
|
| 203 |
* import { TestClock } from "effect/testing"
|
|
@@ -216,15 +216,16 @@ export declare const make: (options?: TestClock.Options | undefined) => Effect.E
|
|
| 216 |
* }).pipe(Effect.provide(testClockLayer))
|
| 217 |
* ```
|
| 218 |
*
|
| 219 |
-
* @since 4.0.0
|
| 220 |
* @category layers
|
|
|
|
| 221 |
*/
|
| 222 |
export declare const layer: (options?: TestClock.Options) => Layer.Layer<TestClock>;
|
| 223 |
/**
|
| 224 |
* Retrieves the `TestClock` service for this test and uses it to run the
|
| 225 |
* specified workflow.
|
| 226 |
*
|
| 227 |
-
*
|
|
|
|
| 228 |
* ```ts
|
| 229 |
* import { Effect } from "effect"
|
| 230 |
* import { TestClock } from "effect/testing"
|
|
@@ -242,8 +243,8 @@ export declare const layer: (options?: TestClock.Options) => Layer.Layer<TestClo
|
|
| 242 |
* })
|
| 243 |
* ```
|
| 244 |
*
|
|
|
|
| 245 |
* @since 2.0.0
|
| 246 |
-
* @category utils
|
| 247 |
*/
|
| 248 |
export declare const testClockWith: <A, E, R>(f: (testClock: TestClock) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 249 |
/**
|
|
@@ -251,7 +252,8 @@ export declare const testClockWith: <A, E, R>(f: (testClock: TestClock) => Effec
|
|
| 251 |
* by the specified duration, running any actions scheduled for on or before
|
| 252 |
* the new time in order.
|
| 253 |
*
|
| 254 |
-
*
|
|
|
|
| 255 |
* ```ts
|
| 256 |
* import { Effect } from "effect"
|
| 257 |
* import { TestClock } from "effect/testing"
|
|
@@ -273,15 +275,16 @@ export declare const testClockWith: <A, E, R>(f: (testClock: TestClock) => Effec
|
|
| 273 |
* })
|
| 274 |
* ```
|
| 275 |
*
|
|
|
|
| 276 |
* @since 2.0.0
|
| 277 |
-
* @category utils
|
| 278 |
*/
|
| 279 |
export declare const adjust: (duration: Duration.Input) => Effect.Effect<void>;
|
| 280 |
/**
|
| 281 |
* Sets the current clock time to the specified `timestamp`. Any effects that
|
| 282 |
* were scheduled to occur on or before the new time will be run in order.
|
| 283 |
*
|
| 284 |
-
*
|
|
|
|
| 285 |
* ```ts
|
| 286 |
* import { Duration, Effect } from "effect"
|
| 287 |
* import { TestClock } from "effect/testing"
|
|
@@ -304,15 +307,16 @@ export declare const adjust: (duration: Duration.Input) => Effect.Effect<void>;
|
|
| 304 |
* })
|
| 305 |
* ```
|
| 306 |
*
|
|
|
|
| 307 |
* @since 2.0.0
|
| 308 |
-
* @category utils
|
| 309 |
*/
|
| 310 |
export declare const setTime: (timestamp: number) => Effect.Effect<void>;
|
| 311 |
/**
|
| 312 |
* Executes the specified effect with the live `Clock` instead of the
|
| 313 |
* `TestClock`.
|
| 314 |
*
|
| 315 |
-
*
|
|
|
|
| 316 |
* ```ts
|
| 317 |
* import { Clock, Effect } from "effect"
|
| 318 |
* import { TestClock } from "effect/testing"
|
|
@@ -335,8 +339,8 @@ export declare const setTime: (timestamp: number) => Effect.Effect<void>;
|
|
| 335 |
* })
|
| 336 |
* ```
|
| 337 |
*
|
| 338 |
-
* @
|
| 339 |
-
* @
|
| 340 |
*/
|
| 341 |
export declare const withLive: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 342 |
//# sourceMappingURL=TestClock.d.ts.map
|
|
|
|
| 4 |
import * as Latch from "../Latch.ts";
|
| 5 |
import * as Layer from "../Layer.ts";
|
| 6 |
/**
|
| 7 |
+
* A `TestClock` simplifies deterministic and efficient testing of effects that
|
| 8 |
+
* involve the passage of time.
|
| 9 |
+
*
|
| 10 |
+
* **Details**
|
| 11 |
*
|
| 12 |
* Instead of waiting for actual time to pass, `sleep` and methods implemented
|
| 13 |
+
* in terms of it schedule effects to take place at a given clock time. Use
|
| 14 |
+
* `adjust` and `setTime` to move clock time, and all effects scheduled to take
|
| 15 |
+
* place on or before that time will automatically run in order.
|
| 16 |
+
*
|
| 17 |
+
* **Gotchas**
|
| 18 |
+
*
|
| 19 |
+
* Calls to `sleep` and methods derived from it will semantically block until
|
| 20 |
+
* the time is set to on or after the time they are scheduled to run. Fork the
|
| 21 |
+
* effect being tested, then adjust the clock time, and finally verify that the
|
| 22 |
+
* expected effects have been performed.
|
| 23 |
+
*
|
| 24 |
+
* **Example** (Testing timeouts deterministically)
|
| 25 |
*
|
| 26 |
+
* Tests `Effect.timeout` using `TestClock`.
|
| 27 |
*
|
| 28 |
* ```ts
|
| 29 |
* import { Effect, Fiber, Option, pipe } from "effect"
|
|
|
|
| 42 |
* })
|
| 43 |
* ```
|
| 44 |
*
|
| 45 |
+
* **Example** (Advancing time deterministically)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
*
|
|
|
|
| 47 |
* ```ts
|
| 48 |
* import { Effect } from "effect"
|
| 49 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 65 |
* })
|
| 66 |
* ```
|
| 67 |
*
|
|
|
|
| 68 |
* @category models
|
| 69 |
+
* @since 2.0.0
|
| 70 |
*/
|
| 71 |
export interface TestClock extends Clock.Clock {
|
| 72 |
/**
|
|
|
|
| 87 |
withLive<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
| 88 |
}
|
| 89 |
/**
|
| 90 |
+
* Namespace containing `TestClock` configuration and state types.
|
| 91 |
+
*
|
| 92 |
+
* **Example** (Configuring a test clock)
|
| 93 |
+
*
|
| 94 |
* ```ts
|
| 95 |
* import { Effect } from "effect"
|
| 96 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 107 |
* })
|
| 108 |
* ```
|
| 109 |
*
|
| 110 |
+
* @since 2.0.0
|
|
|
|
| 111 |
*/
|
| 112 |
export declare namespace TestClock {
|
| 113 |
/**
|
| 114 |
+
* Options used when constructing a `TestClock`. `warningDelay` controls how
|
| 115 |
+
* long the live clock waits before logging a warning when a test uses time
|
| 116 |
+
* without advancing the test clock.
|
| 117 |
+
*
|
| 118 |
+
* **Example** (Configuring the warning delay)
|
| 119 |
+
*
|
| 120 |
* ```ts
|
| 121 |
* import { Effect } from "effect"
|
| 122 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 132 |
* })
|
| 133 |
* ```
|
| 134 |
*
|
| 135 |
+
* @category options
|
| 136 |
* @since 4.0.0
|
|
|
|
| 137 |
*/
|
| 138 |
interface Options {
|
| 139 |
/**
|
|
|
|
| 143 |
readonly warningDelay?: Duration.Input;
|
| 144 |
}
|
| 145 |
/**
|
| 146 |
+
* Represents the state tracked by a `TestClock`, including the current
|
| 147 |
+
* millisecond timestamp and the sleeps scheduled to resume when the clock
|
| 148 |
+
* reaches their target time.
|
|
|
|
| 149 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
* @category models
|
| 151 |
+
* @since 4.0.0
|
| 152 |
*/
|
| 153 |
interface State {
|
| 154 |
readonly timestamp: number;
|
|
|
|
| 158 |
/**
|
| 159 |
* Creates a `TestClock` with optional configuration.
|
| 160 |
*
|
| 161 |
+
* **Example** (Creating a test clock)
|
| 162 |
+
*
|
| 163 |
* ```ts
|
| 164 |
* import { Effect } from "effect"
|
| 165 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 180 |
* })
|
| 181 |
* ```
|
| 182 |
*
|
|
|
|
| 183 |
* @category constructors
|
| 184 |
+
* @since 4.0.0
|
| 185 |
*/
|
| 186 |
export declare const make: (options?: TestClock.Options | undefined) => Effect.Effect<{
|
| 187 |
currentTimeMillisUnsafe: () => number;
|
| 188 |
currentTimeNanosUnsafe: () => bigint;
|
| 189 |
currentTimeMillis: Effect.Effect<number, never, never>;
|
| 190 |
currentTimeNanos: Effect.Effect<bigint, never, never>;
|
| 191 |
+
adjust: (duration: Duration.Input) => Effect.Effect<void, never, never>;
|
| 192 |
+
setTime: (timestamp: number) => Effect.Effect<void, never, never>;
|
| 193 |
sleep: (duration: Duration.Duration) => Effect.Effect<void, never, never>;
|
| 194 |
withLive: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, never>>;
|
| 195 |
}, never, import("../Scope.ts").Scope>;
|
| 196 |
/**
|
| 197 |
* Creates a `Layer` which constructs a `TestClock`.
|
| 198 |
*
|
| 199 |
+
* **Example** (Providing a test clock layer)
|
| 200 |
+
*
|
| 201 |
* ```ts
|
| 202 |
* import { Effect } from "effect"
|
| 203 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 216 |
* }).pipe(Effect.provide(testClockLayer))
|
| 217 |
* ```
|
| 218 |
*
|
|
|
|
| 219 |
* @category layers
|
| 220 |
+
* @since 4.0.0
|
| 221 |
*/
|
| 222 |
export declare const layer: (options?: TestClock.Options) => Layer.Layer<TestClock>;
|
| 223 |
/**
|
| 224 |
* Retrieves the `TestClock` service for this test and uses it to run the
|
| 225 |
* specified workflow.
|
| 226 |
*
|
| 227 |
+
* **Example** (Accessing the test clock)
|
| 228 |
+
*
|
| 229 |
* ```ts
|
| 230 |
* import { Effect } from "effect"
|
| 231 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 243 |
* })
|
| 244 |
* ```
|
| 245 |
*
|
| 246 |
+
* @category testing
|
| 247 |
* @since 2.0.0
|
|
|
|
| 248 |
*/
|
| 249 |
export declare const testClockWith: <A, E, R>(f: (testClock: TestClock) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 250 |
/**
|
|
|
|
| 252 |
* by the specified duration, running any actions scheduled for on or before
|
| 253 |
* the new time in order.
|
| 254 |
*
|
| 255 |
+
* **Example** (Advancing the test clock)
|
| 256 |
+
*
|
| 257 |
* ```ts
|
| 258 |
* import { Effect } from "effect"
|
| 259 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 275 |
* })
|
| 276 |
* ```
|
| 277 |
*
|
| 278 |
+
* @category testing
|
| 279 |
* @since 2.0.0
|
|
|
|
| 280 |
*/
|
| 281 |
export declare const adjust: (duration: Duration.Input) => Effect.Effect<void>;
|
| 282 |
/**
|
| 283 |
* Sets the current clock time to the specified `timestamp`. Any effects that
|
| 284 |
* were scheduled to occur on or before the new time will be run in order.
|
| 285 |
*
|
| 286 |
+
* **Example** (Setting the test clock time)
|
| 287 |
+
*
|
| 288 |
* ```ts
|
| 289 |
* import { Duration, Effect } from "effect"
|
| 290 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 307 |
* })
|
| 308 |
* ```
|
| 309 |
*
|
| 310 |
+
* @category testing
|
| 311 |
* @since 2.0.0
|
|
|
|
| 312 |
*/
|
| 313 |
export declare const setTime: (timestamp: number) => Effect.Effect<void>;
|
| 314 |
/**
|
| 315 |
* Executes the specified effect with the live `Clock` instead of the
|
| 316 |
* `TestClock`.
|
| 317 |
*
|
| 318 |
+
* **Example** (Running with the live clock)
|
| 319 |
+
*
|
| 320 |
* ```ts
|
| 321 |
* import { Clock, Effect } from "effect"
|
| 322 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 339 |
* })
|
| 340 |
* ```
|
| 341 |
*
|
| 342 |
+
* @category testing
|
| 343 |
+
* @since 4.0.0
|
| 344 |
*/
|
| 345 |
export declare const withLive: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 346 |
//# sourceMappingURL=TestClock.d.ts.map
|
.opencode/node_modules/effect/dist/testing/TestClock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestClock.d.ts","sourceRoot":"","sources":["../../src/testing/TestClock.ts"],"names":[],"mappings":"
|
|
|
|
| 1 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MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAC9B,CAAA"}
|
.opencode/node_modules/effect/dist/testing/TestClock.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
| 1 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
* @since 2.0.0
|
| 3 |
*/
|
| 4 |
import * as Arr from "../Array.js";
|
|
@@ -27,7 +36,8 @@ const SleepOrder = /*#__PURE__*/Order.flip(/*#__PURE__*/Order.Struct({
|
|
| 27 |
/**
|
| 28 |
* Creates a `TestClock` with optional configuration.
|
| 29 |
*
|
| 30 |
-
*
|
|
|
|
| 31 |
* ```ts
|
| 32 |
* import { Effect } from "effect"
|
| 33 |
* import { TestClock } from "effect/testing"
|
|
@@ -48,8 +58,8 @@ const SleepOrder = /*#__PURE__*/Order.flip(/*#__PURE__*/Order.Struct({
|
|
| 48 |
* })
|
| 49 |
* ```
|
| 50 |
*
|
| 51 |
-
* @since 4.0.0
|
| 52 |
* @category constructors
|
|
|
|
| 53 |
*/
|
| 54 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
| 55 |
const config = Object.assign({}, defaultOptions, options);
|
|
@@ -120,7 +130,7 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
|
| 120 |
});
|
| 121 |
const runSemaphore = yield* Semaphore.make(1);
|
| 122 |
const run = Effect.fnUntraced(function* (step) {
|
| 123 |
-
yield* Fiber.await(yield* Effect.
|
| 124 |
const endTimestamp = step(currentTimestamp);
|
| 125 |
while (Arr.isArrayNonEmpty(sleeps)) {
|
| 126 |
if (Arr.lastNonEmpty(sleeps).timestamp > endTimestamp) break;
|
|
@@ -153,7 +163,8 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
|
| 153 |
/**
|
| 154 |
* Creates a `Layer` which constructs a `TestClock`.
|
| 155 |
*
|
| 156 |
-
*
|
|
|
|
| 157 |
* ```ts
|
| 158 |
* import { Effect } from "effect"
|
| 159 |
* import { TestClock } from "effect/testing"
|
|
@@ -172,15 +183,16 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
|
| 172 |
* }).pipe(Effect.provide(testClockLayer))
|
| 173 |
* ```
|
| 174 |
*
|
| 175 |
-
* @since 4.0.0
|
| 176 |
* @category layers
|
|
|
|
| 177 |
*/
|
| 178 |
export const layer = /*#__PURE__*/flow(make, /*#__PURE__*/Layer.effect(Clock.Clock));
|
| 179 |
/**
|
| 180 |
* Retrieves the `TestClock` service for this test and uses it to run the
|
| 181 |
* specified workflow.
|
| 182 |
*
|
| 183 |
-
*
|
|
|
|
| 184 |
* ```ts
|
| 185 |
* import { Effect } from "effect"
|
| 186 |
* import { TestClock } from "effect/testing"
|
|
@@ -198,8 +210,8 @@ export const layer = /*#__PURE__*/flow(make, /*#__PURE__*/Layer.effect(Clock.Clo
|
|
| 198 |
* })
|
| 199 |
* ```
|
| 200 |
*
|
|
|
|
| 201 |
* @since 2.0.0
|
| 202 |
-
* @category utils
|
| 203 |
*/
|
| 204 |
export const testClockWith = f => Effect.withFiber(fiber => f(fiber.getRef(Clock.Clock)));
|
| 205 |
/**
|
|
@@ -207,7 +219,8 @@ export const testClockWith = f => Effect.withFiber(fiber => f(fiber.getRef(Clock
|
|
| 207 |
* by the specified duration, running any actions scheduled for on or before
|
| 208 |
* the new time in order.
|
| 209 |
*
|
| 210 |
-
*
|
|
|
|
| 211 |
* ```ts
|
| 212 |
* import { Effect } from "effect"
|
| 213 |
* import { TestClock } from "effect/testing"
|
|
@@ -229,15 +242,16 @@ export const testClockWith = f => Effect.withFiber(fiber => f(fiber.getRef(Clock
|
|
| 229 |
* })
|
| 230 |
* ```
|
| 231 |
*
|
|
|
|
| 232 |
* @since 2.0.0
|
| 233 |
-
* @category utils
|
| 234 |
*/
|
| 235 |
export const adjust = duration => testClockWith(testClock => testClock.adjust(duration));
|
| 236 |
/**
|
| 237 |
* Sets the current clock time to the specified `timestamp`. Any effects that
|
| 238 |
* were scheduled to occur on or before the new time will be run in order.
|
| 239 |
*
|
| 240 |
-
*
|
|
|
|
| 241 |
* ```ts
|
| 242 |
* import { Duration, Effect } from "effect"
|
| 243 |
* import { TestClock } from "effect/testing"
|
|
@@ -260,15 +274,16 @@ export const adjust = duration => testClockWith(testClock => testClock.adjust(du
|
|
| 260 |
* })
|
| 261 |
* ```
|
| 262 |
*
|
|
|
|
| 263 |
* @since 2.0.0
|
| 264 |
-
* @category utils
|
| 265 |
*/
|
| 266 |
export const setTime = timestamp => testClockWith(testClock => testClock.setTime(timestamp));
|
| 267 |
/**
|
| 268 |
* Executes the specified effect with the live `Clock` instead of the
|
| 269 |
* `TestClock`.
|
| 270 |
*
|
| 271 |
-
*
|
|
|
|
| 272 |
* ```ts
|
| 273 |
* import { Clock, Effect } from "effect"
|
| 274 |
* import { TestClock } from "effect/testing"
|
|
@@ -291,8 +306,8 @@ export const setTime = timestamp => testClockWith(testClock => testClock.setTime
|
|
| 291 |
* })
|
| 292 |
* ```
|
| 293 |
*
|
| 294 |
-
* @
|
| 295 |
-
* @
|
| 296 |
*/
|
| 297 |
export const withLive = effect => testClockWith(testClock => testClock.withLive(effect));
|
| 298 |
const WarningState = /*#__PURE__*/Data.taggedEnum();
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Controllable `Clock` service for tests.
|
| 3 |
+
*
|
| 4 |
+
* Instead of waiting for real time to pass, effects that use `Effect.sleep`,
|
| 5 |
+
* timeouts, schedules, retries, and other time-based operators can be driven by
|
| 6 |
+
* advancing the test clock. This makes time-based tests deterministic and fast.
|
| 7 |
+
* The module also includes helpers for moving test time, temporarily using the
|
| 8 |
+
* live clock, and warning when a test appears to be waiting on time without
|
| 9 |
+
* advancing it.
|
| 10 |
+
*
|
| 11 |
* @since 2.0.0
|
| 12 |
*/
|
| 13 |
import * as Arr from "../Array.js";
|
|
|
|
| 36 |
/**
|
| 37 |
* Creates a `TestClock` with optional configuration.
|
| 38 |
*
|
| 39 |
+
* **Example** (Creating a test clock)
|
| 40 |
+
*
|
| 41 |
* ```ts
|
| 42 |
* import { Effect } from "effect"
|
| 43 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 58 |
* })
|
| 59 |
* ```
|
| 60 |
*
|
|
|
|
| 61 |
* @category constructors
|
| 62 |
+
* @since 4.0.0
|
| 63 |
*/
|
| 64 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
| 65 |
const config = Object.assign({}, defaultOptions, options);
|
|
|
|
| 130 |
});
|
| 131 |
const runSemaphore = yield* Semaphore.make(1);
|
| 132 |
const run = Effect.fnUntraced(function* (step) {
|
| 133 |
+
yield* Fiber.await(yield* Effect.forkChild(Effect.yieldNow));
|
| 134 |
const endTimestamp = step(currentTimestamp);
|
| 135 |
while (Arr.isArrayNonEmpty(sleeps)) {
|
| 136 |
if (Arr.lastNonEmpty(sleeps).timestamp > endTimestamp) break;
|
|
|
|
| 163 |
/**
|
| 164 |
* Creates a `Layer` which constructs a `TestClock`.
|
| 165 |
*
|
| 166 |
+
* **Example** (Providing a test clock layer)
|
| 167 |
+
*
|
| 168 |
* ```ts
|
| 169 |
* import { Effect } from "effect"
|
| 170 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 183 |
* }).pipe(Effect.provide(testClockLayer))
|
| 184 |
* ```
|
| 185 |
*
|
|
|
|
| 186 |
* @category layers
|
| 187 |
+
* @since 4.0.0
|
| 188 |
*/
|
| 189 |
export const layer = /*#__PURE__*/flow(make, /*#__PURE__*/Layer.effect(Clock.Clock));
|
| 190 |
/**
|
| 191 |
* Retrieves the `TestClock` service for this test and uses it to run the
|
| 192 |
* specified workflow.
|
| 193 |
*
|
| 194 |
+
* **Example** (Accessing the test clock)
|
| 195 |
+
*
|
| 196 |
* ```ts
|
| 197 |
* import { Effect } from "effect"
|
| 198 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 210 |
* })
|
| 211 |
* ```
|
| 212 |
*
|
| 213 |
+
* @category testing
|
| 214 |
* @since 2.0.0
|
|
|
|
| 215 |
*/
|
| 216 |
export const testClockWith = f => Effect.withFiber(fiber => f(fiber.getRef(Clock.Clock)));
|
| 217 |
/**
|
|
|
|
| 219 |
* by the specified duration, running any actions scheduled for on or before
|
| 220 |
* the new time in order.
|
| 221 |
*
|
| 222 |
+
* **Example** (Advancing the test clock)
|
| 223 |
+
*
|
| 224 |
* ```ts
|
| 225 |
* import { Effect } from "effect"
|
| 226 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 242 |
* })
|
| 243 |
* ```
|
| 244 |
*
|
| 245 |
+
* @category testing
|
| 246 |
* @since 2.0.0
|
|
|
|
| 247 |
*/
|
| 248 |
export const adjust = duration => testClockWith(testClock => testClock.adjust(duration));
|
| 249 |
/**
|
| 250 |
* Sets the current clock time to the specified `timestamp`. Any effects that
|
| 251 |
* were scheduled to occur on or before the new time will be run in order.
|
| 252 |
*
|
| 253 |
+
* **Example** (Setting the test clock time)
|
| 254 |
+
*
|
| 255 |
* ```ts
|
| 256 |
* import { Duration, Effect } from "effect"
|
| 257 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 274 |
* })
|
| 275 |
* ```
|
| 276 |
*
|
| 277 |
+
* @category testing
|
| 278 |
* @since 2.0.0
|
|
|
|
| 279 |
*/
|
| 280 |
export const setTime = timestamp => testClockWith(testClock => testClock.setTime(timestamp));
|
| 281 |
/**
|
| 282 |
* Executes the specified effect with the live `Clock` instead of the
|
| 283 |
* `TestClock`.
|
| 284 |
*
|
| 285 |
+
* **Example** (Running with the live clock)
|
| 286 |
+
*
|
| 287 |
* ```ts
|
| 288 |
* import { Clock, Effect } from "effect"
|
| 289 |
* import { TestClock } from "effect/testing"
|
|
|
|
| 306 |
* })
|
| 307 |
* ```
|
| 308 |
*
|
| 309 |
+
* @category testing
|
| 310 |
+
* @since 4.0.0
|
| 311 |
*/
|
| 312 |
export const withLive = effect => testClockWith(testClock => testClock.withLive(effect));
|
| 313 |
const WarningState = /*#__PURE__*/Data.taggedEnum();
|
.opencode/node_modules/effect/dist/testing/TestClock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestClock.js","names":["Arr","Clock","Data","Duration","Effect","Fiber","flow","Latch","Layer","Order","Semaphore","warningMessage","defaultOptions","warningDelay","SleepOrder","flip","Struct","timestamp","Number","sequence","make","fnUntraced","options","config","Object","assign","sleeps","liveClock","clockWith","succeed","warningSemaphore","currentTimestamp","Date","getTime","warningState","WarningState","Start","currentTimeMillisUnsafe","currentTimeNanosUnsafe","BigInt","Math","floor","currentTimeMillis","sync","currentTimeNanos","withLive","effect","provideService","warningStart","withPermits","suspend","_tag","logWarning","pipe","delay","forkChild","interruptible","flatMap","fiber","Pending","void","warningDone","interrupt","andThen","Done","sleep","duration","millis","toMillis","end","latch","makeUnsafe","push","sort","await","runSemaphore","run","step","
|
|
|
|
| 1 |
+
{"version":3,"file":"TestClock.js","names":["Arr","Clock","Data","Duration","Effect","Fiber","flow","Latch","Layer","Order","Semaphore","warningMessage","defaultOptions","warningDelay","SleepOrder","flip","Struct","timestamp","Number","sequence","make","fnUntraced","options","config","Object","assign","sleeps","liveClock","clockWith","succeed","warningSemaphore","currentTimestamp","Date","getTime","warningState","WarningState","Start","currentTimeMillisUnsafe","currentTimeNanosUnsafe","BigInt","Math","floor","currentTimeMillis","sync","currentTimeNanos","withLive","effect","provideService","warningStart","withPermits","suspend","_tag","logWarning","pipe","delay","forkChild","interruptible","flatMap","fiber","Pending","void","warningDone","interrupt","andThen","Done","sleep","duration","millis","toMillis","end","latch","makeUnsafe","push","sort","await","runSemaphore","run","step","yieldNow","endTimestamp","isArrayNonEmpty","lastNonEmpty","entry","pop","openUnsafe","adjust","fromInputUnsafe","setTime","addFinalizer","layer","testClockWith","f","withFiber","getRef","testClock","taggedEnum"],"sources":["../../src/testing/TestClock.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,OAAO,KAAKA,GAAG,MAAM,aAAa;AAClC,OAAO,KAA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BC,CAAmD,IACxBvF,MAAM,CAACwF,SAAS,CAAElC,KAAK,IAAKiC,CAAC,CAACjC,KAAK,CAACmC,MAAM,CAAC5F,KAAK,CAACA,KAAK,CAAc,CAAC,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAO,MAAMoF,MAAM,GAAInB,QAAwB,IAC7CwB,aAAa,CAAEI,SAAS,IAAKA,SAAS,CAACT,MAAM,CAACnB,QAAQ,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAO,MAAMqB,OAAO,GAAItE,SAAiB,IACvCyE,aAAa,CAAEI,SAAS,IAAKA,SAAS,CAACP,OAAO,CAACtE,SAAS,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAO,MAAM4B,QAAQ,GAAaC,MAA8B,IAC9D4C,aAAa,CAAEI,SAAS,IAAKA,SAAS,CAACjD,QAAQ,CAACC,MAAM,CAAC,CAAC;AAiC1D,MAAMX,YAAY,gBAAGjC,IAAI,CAAC6F,UAAU,EAAgB","ignoreList":[]}
|
.opencode/node_modules/effect/dist/testing/TestConsole.d.ts
CHANGED
|
@@ -6,13 +6,21 @@ import * as Layer from "../Layer.ts";
|
|
| 6 |
* It captures all console output for testing purposes while maintaining full
|
| 7 |
* compatibility with the standard Console API.
|
| 8 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
* This interface extends the standard Console interface and adds methods to
|
| 10 |
* retrieve logged messages for verification in tests.
|
| 11 |
*
|
| 12 |
-
*
|
|
|
|
| 13 |
* ```ts
|
| 14 |
* import { Console, Effect } from "effect"
|
| 15 |
-
* import
|
| 16 |
*
|
| 17 |
* const program = Effect.gen(function*() {
|
| 18 |
* yield* Console.log("Hello, World!")
|
|
@@ -26,18 +34,32 @@ import * as Layer from "../Layer.ts";
|
|
| 26 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 27 |
* ```
|
| 28 |
*
|
| 29 |
-
* @
|
|
|
|
|
|
|
|
|
|
| 30 |
* @category models
|
|
|
|
| 31 |
*/
|
| 32 |
export interface TestConsole extends Console.Console {
|
| 33 |
/**
|
| 34 |
* Returns an array of all items that have been logged by the program using
|
| 35 |
* `Console.log` thus far.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
*/
|
| 37 |
readonly logLines: Effect.Effect<ReadonlyArray<unknown>>;
|
| 38 |
/**
|
| 39 |
* Returns an array of all items that have been logged by the program using
|
| 40 |
* `Console.error` thus far.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
*/
|
| 42 |
readonly errorLines: Effect.Effect<ReadonlyArray<unknown>>;
|
| 43 |
}
|
|
@@ -45,45 +67,60 @@ export interface TestConsole extends Console.Console {
|
|
| 45 |
* The `TestConsole` namespace provides types and utilities for working with
|
| 46 |
* test console implementations.
|
| 47 |
*
|
| 48 |
-
*
|
| 49 |
-
*
|
| 50 |
-
*
|
| 51 |
-
* // Use TestConsole.make to create a test console instance
|
| 52 |
-
* // Use TestConsole.layer to provide the service in tests
|
| 53 |
-
* ```
|
| 54 |
*
|
| 55 |
* @since 4.0.0
|
| 56 |
-
* @category models
|
| 57 |
*/
|
| 58 |
export declare namespace TestConsole {
|
| 59 |
/**
|
| 60 |
* Represents a console method name that can be invoked on the TestConsole.
|
| 61 |
* This type includes all methods available on the Console interface.
|
| 62 |
*
|
| 63 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
* ```ts
|
| 65 |
-
*
|
| 66 |
-
*
|
| 67 |
-
*
|
|
|
|
|
|
|
| 68 |
* ```
|
| 69 |
*
|
| 70 |
-
* @since 4.0.0
|
| 71 |
* @category models
|
|
|
|
| 72 |
*/
|
| 73 |
type Method = keyof Console.Console;
|
| 74 |
/**
|
| 75 |
* Represents a single console method invocation captured by the TestConsole.
|
| 76 |
* Each entry contains the method name and the parameters passed to it.
|
| 77 |
*
|
| 78 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
* ```ts
|
| 80 |
-
*
|
| 81 |
-
*
|
| 82 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
* ```
|
| 84 |
*
|
| 85 |
-
* @since 4.0.0
|
| 86 |
* @category models
|
|
|
|
| 87 |
*/
|
| 88 |
interface Entry {
|
| 89 |
readonly method: Method;
|
|
@@ -95,10 +132,15 @@ export declare namespace TestConsole {
|
|
| 95 |
* The returned TestConsole implements the Console interface and provides
|
| 96 |
* additional methods to retrieve logged messages.
|
| 97 |
*
|
| 98 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
* ```ts
|
| 100 |
* import { Console, Effect } from "effect"
|
| 101 |
-
* import
|
| 102 |
*
|
| 103 |
* const program = Effect.gen(function*() {
|
| 104 |
* yield* Console.log("Debug message")
|
|
@@ -112,18 +154,25 @@ export declare namespace TestConsole {
|
|
| 112 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 113 |
* ```
|
| 114 |
*
|
| 115 |
-
* @
|
|
|
|
| 116 |
* @category constructors
|
|
|
|
| 117 |
*/
|
| 118 |
export declare const make: Effect.Effect<TestConsole, never, never>;
|
| 119 |
/**
|
| 120 |
* Retrieves the `TestConsole` service for this test and uses it to run the
|
| 121 |
* specified workflow.
|
| 122 |
*
|
| 123 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
* ```ts
|
| 125 |
* import { Effect } from "effect"
|
| 126 |
-
* import
|
| 127 |
*
|
| 128 |
* const program = TestConsole.testConsoleWith((testConsole) =>
|
| 129 |
* Effect.gen(function*() {
|
|
@@ -139,8 +188,12 @@ export declare const make: Effect.Effect<TestConsole, never, never>;
|
|
| 139 |
* ).pipe(Effect.provide(TestConsole.layer))
|
| 140 |
* ```
|
| 141 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
* @since 4.0.0
|
| 143 |
-
* @category utils
|
| 144 |
*/
|
| 145 |
export declare const testConsoleWith: <A, E, R>(f: (console: TestConsole) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 146 |
/**
|
|
@@ -148,10 +201,15 @@ export declare const testConsoleWith: <A, E, R>(f: (console: TestConsole) => Eff
|
|
| 148 |
* This layer can be used to provide a TestConsole implementation
|
| 149 |
* for testing purposes.
|
| 150 |
*
|
| 151 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
* ```ts
|
| 153 |
* import { Console, Effect } from "effect"
|
| 154 |
-
* import
|
| 155 |
*
|
| 156 |
* const program = Effect.gen(function*() {
|
| 157 |
* yield* Console.log("This will be captured")
|
|
@@ -165,18 +223,27 @@ export declare const testConsoleWith: <A, E, R>(f: (console: TestConsole) => Eff
|
|
| 165 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 166 |
* ```
|
| 167 |
*
|
| 168 |
-
* @
|
|
|
|
|
|
|
| 169 |
* @category layers
|
|
|
|
| 170 |
*/
|
| 171 |
export declare const layer: Layer.Layer<TestConsole>;
|
| 172 |
/**
|
| 173 |
* Returns an array of all items that have been logged by the program using
|
| 174 |
* `Console.log` thus far.
|
| 175 |
*
|
| 176 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
* ```ts
|
| 178 |
* import { Console, Effect } from "effect"
|
| 179 |
-
* import
|
| 180 |
*
|
| 181 |
* const program = Effect.gen(function*() {
|
| 182 |
* yield* Console.log("First message")
|
|
@@ -194,18 +261,27 @@ export declare const layer: Layer.Layer<TestConsole>;
|
|
| 194 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 195 |
* ```
|
| 196 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
* @since 4.0.0
|
| 198 |
-
* @category utils
|
| 199 |
*/
|
| 200 |
export declare const logLines: Effect.Effect<ReadonlyArray<unknown>, never, never>;
|
| 201 |
/**
|
| 202 |
* Returns an array of all items that have been logged by the program using
|
| 203 |
* `Console.error` thus far.
|
| 204 |
*
|
| 205 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
* ```ts
|
| 207 |
* import { Console, Effect } from "effect"
|
| 208 |
-
* import
|
| 209 |
*
|
| 210 |
* const program = Effect.gen(function*() {
|
| 211 |
* yield* Console.error("Error message")
|
|
@@ -221,8 +297,11 @@ export declare const logLines: Effect.Effect<ReadonlyArray<unknown>, never, neve
|
|
| 221 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 222 |
* ```
|
| 223 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
* @since 4.0.0
|
| 225 |
-
* @category utils
|
| 226 |
*/
|
| 227 |
export declare const errorLines: Effect.Effect<ReadonlyArray<unknown>, never, never>;
|
| 228 |
//# sourceMappingURL=TestConsole.d.ts.map
|
|
|
|
| 6 |
* It captures all console output for testing purposes while maintaining full
|
| 7 |
* compatibility with the standard Console API.
|
| 8 |
*
|
| 9 |
+
* **When to use**
|
| 10 |
+
*
|
| 11 |
+
* Use to provide a console implementation that records calls for assertions in
|
| 12 |
+
* tests.
|
| 13 |
+
*
|
| 14 |
+
* **Details**
|
| 15 |
+
*
|
| 16 |
* This interface extends the standard Console interface and adds methods to
|
| 17 |
* retrieve logged messages for verification in tests.
|
| 18 |
*
|
| 19 |
+
* **Example** (Capturing console output in tests)
|
| 20 |
+
*
|
| 21 |
* ```ts
|
| 22 |
* import { Console, Effect } from "effect"
|
| 23 |
+
* import { TestConsole } from "effect/testing"
|
| 24 |
*
|
| 25 |
* const program = Effect.gen(function*() {
|
| 26 |
* yield* Console.log("Hello, World!")
|
|
|
|
| 34 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 35 |
* ```
|
| 36 |
*
|
| 37 |
+
* @see {@link layer} for providing `TestConsole` to an effect
|
| 38 |
+
* @see {@link logLines} for reading captured `Console.log` calls
|
| 39 |
+
* @see {@link errorLines} for reading captured `Console.error` calls
|
| 40 |
+
*
|
| 41 |
* @category models
|
| 42 |
+
* @since 4.0.0
|
| 43 |
*/
|
| 44 |
export interface TestConsole extends Console.Console {
|
| 45 |
/**
|
| 46 |
* Returns an array of all items that have been logged by the program using
|
| 47 |
* `Console.log` thus far.
|
| 48 |
+
*
|
| 49 |
+
* **When to use**
|
| 50 |
+
*
|
| 51 |
+
* Use to inspect captured `Console.log` calls through a `TestConsole`
|
| 52 |
+
* instance.
|
| 53 |
*/
|
| 54 |
readonly logLines: Effect.Effect<ReadonlyArray<unknown>>;
|
| 55 |
/**
|
| 56 |
* Returns an array of all items that have been logged by the program using
|
| 57 |
* `Console.error` thus far.
|
| 58 |
+
*
|
| 59 |
+
* **When to use**
|
| 60 |
+
*
|
| 61 |
+
* Use to inspect captured `Console.error` calls through a `TestConsole`
|
| 62 |
+
* instance.
|
| 63 |
*/
|
| 64 |
readonly errorLines: Effect.Effect<ReadonlyArray<unknown>>;
|
| 65 |
}
|
|
|
|
| 67 |
* The `TestConsole` namespace provides types and utilities for working with
|
| 68 |
* test console implementations.
|
| 69 |
*
|
| 70 |
+
* **When to use**
|
| 71 |
+
*
|
| 72 |
+
* Use when referring to types nested under the `TestConsole` namespace.
|
|
|
|
|
|
|
|
|
|
| 73 |
*
|
| 74 |
* @since 4.0.0
|
|
|
|
| 75 |
*/
|
| 76 |
export declare namespace TestConsole {
|
| 77 |
/**
|
| 78 |
* Represents a console method name that can be invoked on the TestConsole.
|
| 79 |
* This type includes all methods available on the Console interface.
|
| 80 |
*
|
| 81 |
+
* **When to use**
|
| 82 |
+
*
|
| 83 |
+
* Use to type the console method name recorded in a captured test console
|
| 84 |
+
* entry.
|
| 85 |
+
*
|
| 86 |
+
* **Example** (Typing captured console methods)
|
| 87 |
+
*
|
| 88 |
* ```ts
|
| 89 |
+
* import type { TestConsole } from "effect/testing"
|
| 90 |
+
*
|
| 91 |
+
* const method: TestConsole.TestConsole.Method = "log"
|
| 92 |
+
*
|
| 93 |
+
* console.log(method) // "log"
|
| 94 |
* ```
|
| 95 |
*
|
|
|
|
| 96 |
* @category models
|
| 97 |
+
* @since 4.0.0
|
| 98 |
*/
|
| 99 |
type Method = keyof Console.Console;
|
| 100 |
/**
|
| 101 |
* Represents a single console method invocation captured by the TestConsole.
|
| 102 |
* Each entry contains the method name and the parameters passed to it.
|
| 103 |
*
|
| 104 |
+
* **When to use**
|
| 105 |
+
*
|
| 106 |
+
* Use to inspect or type one captured console invocation.
|
| 107 |
+
*
|
| 108 |
+
* **Example** (Typing captured console entries)
|
| 109 |
+
*
|
| 110 |
* ```ts
|
| 111 |
+
* import type { TestConsole } from "effect/testing"
|
| 112 |
+
*
|
| 113 |
+
* const entry: TestConsole.TestConsole.Entry = {
|
| 114 |
+
* method: "error",
|
| 115 |
+
* parameters: ["not found"]
|
| 116 |
+
* }
|
| 117 |
+
*
|
| 118 |
+
* console.log(entry.method) // "error"
|
| 119 |
+
* console.log(entry.parameters) // ["not found"]
|
| 120 |
* ```
|
| 121 |
*
|
|
|
|
| 122 |
* @category models
|
| 123 |
+
* @since 4.0.0
|
| 124 |
*/
|
| 125 |
interface Entry {
|
| 126 |
readonly method: Method;
|
|
|
|
| 132 |
* The returned TestConsole implements the Console interface and provides
|
| 133 |
* additional methods to retrieve logged messages.
|
| 134 |
*
|
| 135 |
+
* **When to use**
|
| 136 |
+
*
|
| 137 |
+
* Use to construct a test console service value directly.
|
| 138 |
+
*
|
| 139 |
+
* **Example** (Creating a test console)
|
| 140 |
+
*
|
| 141 |
* ```ts
|
| 142 |
* import { Console, Effect } from "effect"
|
| 143 |
+
* import { TestConsole } from "effect/testing"
|
| 144 |
*
|
| 145 |
* const program = Effect.gen(function*() {
|
| 146 |
* yield* Console.log("Debug message")
|
|
|
|
| 154 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 155 |
* ```
|
| 156 |
*
|
| 157 |
+
* @see {@link layer} for providing a `TestConsole` as a `Layer`
|
| 158 |
+
*
|
| 159 |
* @category constructors
|
| 160 |
+
* @since 4.0.0
|
| 161 |
*/
|
| 162 |
export declare const make: Effect.Effect<TestConsole, never, never>;
|
| 163 |
/**
|
| 164 |
* Retrieves the `TestConsole` service for this test and uses it to run the
|
| 165 |
* specified workflow.
|
| 166 |
*
|
| 167 |
+
* **When to use**
|
| 168 |
+
*
|
| 169 |
+
* Use to access the provided test console service inside an effect.
|
| 170 |
+
*
|
| 171 |
+
* **Example** (Accessing the test console service)
|
| 172 |
+
*
|
| 173 |
* ```ts
|
| 174 |
* import { Effect } from "effect"
|
| 175 |
+
* import { TestConsole } from "effect/testing"
|
| 176 |
*
|
| 177 |
* const program = TestConsole.testConsoleWith((testConsole) =>
|
| 178 |
* Effect.gen(function*() {
|
|
|
|
| 188 |
* ).pipe(Effect.provide(TestConsole.layer))
|
| 189 |
* ```
|
| 190 |
*
|
| 191 |
+
* @see {@link layer} for providing the test console service
|
| 192 |
+
* @see {@link logLines} for reading captured `Console.log` calls directly
|
| 193 |
+
* @see {@link errorLines} for reading captured `Console.error` calls directly
|
| 194 |
+
*
|
| 195 |
+
* @category testing
|
| 196 |
* @since 4.0.0
|
|
|
|
| 197 |
*/
|
| 198 |
export declare const testConsoleWith: <A, E, R>(f: (console: TestConsole) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
| 199 |
/**
|
|
|
|
| 201 |
* This layer can be used to provide a TestConsole implementation
|
| 202 |
* for testing purposes.
|
| 203 |
*
|
| 204 |
+
* **When to use**
|
| 205 |
+
*
|
| 206 |
+
* Use to run an effect with console calls captured by `TestConsole`.
|
| 207 |
+
*
|
| 208 |
+
* **Example** (Providing a test console layer)
|
| 209 |
+
*
|
| 210 |
* ```ts
|
| 211 |
* import { Console, Effect } from "effect"
|
| 212 |
+
* import { TestConsole } from "effect/testing"
|
| 213 |
*
|
| 214 |
* const program = Effect.gen(function*() {
|
| 215 |
* yield* Console.log("This will be captured")
|
|
|
|
| 223 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 224 |
* ```
|
| 225 |
*
|
| 226 |
+
* @see {@link make} for constructing the service value directly
|
| 227 |
+
* @see {@link testConsoleWith} for accessing the provided test console service
|
| 228 |
+
*
|
| 229 |
* @category layers
|
| 230 |
+
* @since 4.0.0
|
| 231 |
*/
|
| 232 |
export declare const layer: Layer.Layer<TestConsole>;
|
| 233 |
/**
|
| 234 |
* Returns an array of all items that have been logged by the program using
|
| 235 |
* `Console.log` thus far.
|
| 236 |
*
|
| 237 |
+
* **When to use**
|
| 238 |
+
*
|
| 239 |
+
* Use to assert on captured `Console.log` output from a program provided with
|
| 240 |
+
* `TestConsole.layer`.
|
| 241 |
+
*
|
| 242 |
+
* **Example** (Reading captured log lines)
|
| 243 |
+
*
|
| 244 |
* ```ts
|
| 245 |
* import { Console, Effect } from "effect"
|
| 246 |
+
* import { TestConsole } from "effect/testing"
|
| 247 |
*
|
| 248 |
* const program = Effect.gen(function*() {
|
| 249 |
* yield* Console.log("First message")
|
|
|
|
| 261 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 262 |
* ```
|
| 263 |
*
|
| 264 |
+
* @see {@link errorLines} for reading captured `Console.error` output
|
| 265 |
+
* @see {@link layer} for capturing console calls during a test
|
| 266 |
+
*
|
| 267 |
+
* @category testing
|
| 268 |
* @since 4.0.0
|
|
|
|
| 269 |
*/
|
| 270 |
export declare const logLines: Effect.Effect<ReadonlyArray<unknown>, never, never>;
|
| 271 |
/**
|
| 272 |
* Returns an array of all items that have been logged by the program using
|
| 273 |
* `Console.error` thus far.
|
| 274 |
*
|
| 275 |
+
* **When to use**
|
| 276 |
+
*
|
| 277 |
+
* Use to assert on captured `Console.error` output from a program provided
|
| 278 |
+
* with `TestConsole.layer`.
|
| 279 |
+
*
|
| 280 |
+
* **Example** (Reading captured error lines)
|
| 281 |
+
*
|
| 282 |
* ```ts
|
| 283 |
* import { Console, Effect } from "effect"
|
| 284 |
+
* import { TestConsole } from "effect/testing"
|
| 285 |
*
|
| 286 |
* const program = Effect.gen(function*() {
|
| 287 |
* yield* Console.error("Error message")
|
|
|
|
| 297 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 298 |
* ```
|
| 299 |
*
|
| 300 |
+
* @see {@link logLines} for reading captured `Console.log` output
|
| 301 |
+
* @see {@link layer} for capturing console calls during a test
|
| 302 |
+
*
|
| 303 |
+
* @category testing
|
| 304 |
* @since 4.0.0
|
|
|
|
| 305 |
*/
|
| 306 |
export declare const errorLines: Effect.Effect<ReadonlyArray<unknown>, never, never>;
|
| 307 |
//# sourceMappingURL=TestConsole.d.ts.map
|
.opencode/node_modules/effect/dist/testing/TestConsole.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestConsole.d.ts","sourceRoot":"","sources":["../../src/testing/TestConsole.ts"],"names":[],"mappings":"
|
|
|
|
| 1 |
+
{"version":3,"file":"TestConsole.d.ts","sourceRoot":"","sources":["../../src/testing/TestConsole.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,OAAO;IAClD;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;IACxD;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;CAC3D;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAY,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAA;IAE1C;;;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from "../Layer.js";
|
|
| 10 |
* The returned TestConsole implements the Console interface and provides
|
| 11 |
* additional methods to retrieve logged messages.
|
| 12 |
*
|
| 13 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
* ```ts
|
| 15 |
* import { Console, Effect } from "effect"
|
| 16 |
-
* import
|
| 17 |
*
|
| 18 |
* const program = Effect.gen(function*() {
|
| 19 |
* yield* Console.log("Debug message")
|
|
@@ -27,8 +40,10 @@ import * as Layer from "../Layer.js";
|
|
| 27 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 28 |
* ```
|
| 29 |
*
|
| 30 |
-
* @
|
|
|
|
| 31 |
* @category constructors
|
|
|
|
| 32 |
*/
|
| 33 |
export const make = /*#__PURE__*/Effect.gen(function* () {
|
| 34 |
const entries = [];
|
|
@@ -70,10 +85,15 @@ export const make = /*#__PURE__*/Effect.gen(function* () {
|
|
| 70 |
* Retrieves the `TestConsole` service for this test and uses it to run the
|
| 71 |
* specified workflow.
|
| 72 |
*
|
| 73 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
* ```ts
|
| 75 |
* import { Effect } from "effect"
|
| 76 |
-
* import
|
| 77 |
*
|
| 78 |
* const program = TestConsole.testConsoleWith((testConsole) =>
|
| 79 |
* Effect.gen(function*() {
|
|
@@ -89,8 +109,12 @@ export const make = /*#__PURE__*/Effect.gen(function* () {
|
|
| 89 |
* ).pipe(Effect.provide(TestConsole.layer))
|
| 90 |
* ```
|
| 91 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
* @since 4.0.0
|
| 93 |
-
* @category utils
|
| 94 |
*/
|
| 95 |
export const testConsoleWith = f => Console.consoleWith(console => f(console));
|
| 96 |
/**
|
|
@@ -98,10 +122,15 @@ export const testConsoleWith = f => Console.consoleWith(console => f(console));
|
|
| 98 |
* This layer can be used to provide a TestConsole implementation
|
| 99 |
* for testing purposes.
|
| 100 |
*
|
| 101 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
* ```ts
|
| 103 |
* import { Console, Effect } from "effect"
|
| 104 |
-
* import
|
| 105 |
*
|
| 106 |
* const program = Effect.gen(function*() {
|
| 107 |
* yield* Console.log("This will be captured")
|
|
@@ -115,18 +144,27 @@ export const testConsoleWith = f => Console.consoleWith(console => f(console));
|
|
| 115 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 116 |
* ```
|
| 117 |
*
|
| 118 |
-
* @
|
|
|
|
|
|
|
| 119 |
* @category layers
|
|
|
|
| 120 |
*/
|
| 121 |
export const layer = /*#__PURE__*/Layer.effect(Console.Console)(make);
|
| 122 |
/**
|
| 123 |
* Returns an array of all items that have been logged by the program using
|
| 124 |
* `Console.log` thus far.
|
| 125 |
*
|
| 126 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
* ```ts
|
| 128 |
* import { Console, Effect } from "effect"
|
| 129 |
-
* import
|
| 130 |
*
|
| 131 |
* const program = Effect.gen(function*() {
|
| 132 |
* yield* Console.log("First message")
|
|
@@ -144,18 +182,27 @@ export const layer = /*#__PURE__*/Layer.effect(Console.Console)(make);
|
|
| 144 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 145 |
* ```
|
| 146 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
* @since 4.0.0
|
| 148 |
-
* @category utils
|
| 149 |
*/
|
| 150 |
export const logLines = /*#__PURE__*/testConsoleWith(console => console.logLines);
|
| 151 |
/**
|
| 152 |
* Returns an array of all items that have been logged by the program using
|
| 153 |
* `Console.error` thus far.
|
| 154 |
*
|
| 155 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
* ```ts
|
| 157 |
* import { Console, Effect } from "effect"
|
| 158 |
-
* import
|
| 159 |
*
|
| 160 |
* const program = Effect.gen(function*() {
|
| 161 |
* yield* Console.error("Error message")
|
|
@@ -171,8 +218,11 @@ export const logLines = /*#__PURE__*/testConsoleWith(console => console.logLines
|
|
| 171 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 172 |
* ```
|
| 173 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
* @since 4.0.0
|
| 175 |
-
* @category utils
|
| 176 |
*/
|
| 177 |
export const errorLines = /*#__PURE__*/testConsoleWith(console => console.errorLines);
|
| 178 |
//# sourceMappingURL=TestConsole.js.map
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Provides a test implementation of the Effect `Console` service.
|
| 3 |
+
*
|
| 4 |
+
* When the test layer is provided, calls made through the Effect console APIs
|
| 5 |
+
* are captured in memory instead of being written to the host console. Tests can
|
| 6 |
+
* then assert on logged values deterministically. This module includes the
|
| 7 |
+
* console layer, helpers for reading captured `Console.log` and `Console.error`
|
| 8 |
+
* arguments, and access to the provided test console service.
|
| 9 |
+
*
|
| 10 |
* @since 4.0.0
|
| 11 |
*/
|
| 12 |
import * as Array from "../Array.js";
|
|
|
|
| 18 |
* The returned TestConsole implements the Console interface and provides
|
| 19 |
* additional methods to retrieve logged messages.
|
| 20 |
*
|
| 21 |
+
* **When to use**
|
| 22 |
+
*
|
| 23 |
+
* Use to construct a test console service value directly.
|
| 24 |
+
*
|
| 25 |
+
* **Example** (Creating a test console)
|
| 26 |
+
*
|
| 27 |
* ```ts
|
| 28 |
* import { Console, Effect } from "effect"
|
| 29 |
+
* import { TestConsole } from "effect/testing"
|
| 30 |
*
|
| 31 |
* const program = Effect.gen(function*() {
|
| 32 |
* yield* Console.log("Debug message")
|
|
|
|
| 40 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 41 |
* ```
|
| 42 |
*
|
| 43 |
+
* @see {@link layer} for providing a `TestConsole` as a `Layer`
|
| 44 |
+
*
|
| 45 |
* @category constructors
|
| 46 |
+
* @since 4.0.0
|
| 47 |
*/
|
| 48 |
export const make = /*#__PURE__*/Effect.gen(function* () {
|
| 49 |
const entries = [];
|
|
|
|
| 85 |
* Retrieves the `TestConsole` service for this test and uses it to run the
|
| 86 |
* specified workflow.
|
| 87 |
*
|
| 88 |
+
* **When to use**
|
| 89 |
+
*
|
| 90 |
+
* Use to access the provided test console service inside an effect.
|
| 91 |
+
*
|
| 92 |
+
* **Example** (Accessing the test console service)
|
| 93 |
+
*
|
| 94 |
* ```ts
|
| 95 |
* import { Effect } from "effect"
|
| 96 |
+
* import { TestConsole } from "effect/testing"
|
| 97 |
*
|
| 98 |
* const program = TestConsole.testConsoleWith((testConsole) =>
|
| 99 |
* Effect.gen(function*() {
|
|
|
|
| 109 |
* ).pipe(Effect.provide(TestConsole.layer))
|
| 110 |
* ```
|
| 111 |
*
|
| 112 |
+
* @see {@link layer} for providing the test console service
|
| 113 |
+
* @see {@link logLines} for reading captured `Console.log` calls directly
|
| 114 |
+
* @see {@link errorLines} for reading captured `Console.error` calls directly
|
| 115 |
+
*
|
| 116 |
+
* @category testing
|
| 117 |
* @since 4.0.0
|
|
|
|
| 118 |
*/
|
| 119 |
export const testConsoleWith = f => Console.consoleWith(console => f(console));
|
| 120 |
/**
|
|
|
|
| 122 |
* This layer can be used to provide a TestConsole implementation
|
| 123 |
* for testing purposes.
|
| 124 |
*
|
| 125 |
+
* **When to use**
|
| 126 |
+
*
|
| 127 |
+
* Use to run an effect with console calls captured by `TestConsole`.
|
| 128 |
+
*
|
| 129 |
+
* **Example** (Providing a test console layer)
|
| 130 |
+
*
|
| 131 |
* ```ts
|
| 132 |
* import { Console, Effect } from "effect"
|
| 133 |
+
* import { TestConsole } from "effect/testing"
|
| 134 |
*
|
| 135 |
* const program = Effect.gen(function*() {
|
| 136 |
* yield* Console.log("This will be captured")
|
|
|
|
| 144 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 145 |
* ```
|
| 146 |
*
|
| 147 |
+
* @see {@link make} for constructing the service value directly
|
| 148 |
+
* @see {@link testConsoleWith} for accessing the provided test console service
|
| 149 |
+
*
|
| 150 |
* @category layers
|
| 151 |
+
* @since 4.0.0
|
| 152 |
*/
|
| 153 |
export const layer = /*#__PURE__*/Layer.effect(Console.Console)(make);
|
| 154 |
/**
|
| 155 |
* Returns an array of all items that have been logged by the program using
|
| 156 |
* `Console.log` thus far.
|
| 157 |
*
|
| 158 |
+
* **When to use**
|
| 159 |
+
*
|
| 160 |
+
* Use to assert on captured `Console.log` output from a program provided with
|
| 161 |
+
* `TestConsole.layer`.
|
| 162 |
+
*
|
| 163 |
+
* **Example** (Reading captured log lines)
|
| 164 |
+
*
|
| 165 |
* ```ts
|
| 166 |
* import { Console, Effect } from "effect"
|
| 167 |
+
* import { TestConsole } from "effect/testing"
|
| 168 |
*
|
| 169 |
* const program = Effect.gen(function*() {
|
| 170 |
* yield* Console.log("First message")
|
|
|
|
| 182 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 183 |
* ```
|
| 184 |
*
|
| 185 |
+
* @see {@link errorLines} for reading captured `Console.error` output
|
| 186 |
+
* @see {@link layer} for capturing console calls during a test
|
| 187 |
+
*
|
| 188 |
+
* @category testing
|
| 189 |
* @since 4.0.0
|
|
|
|
| 190 |
*/
|
| 191 |
export const logLines = /*#__PURE__*/testConsoleWith(console => console.logLines);
|
| 192 |
/**
|
| 193 |
* Returns an array of all items that have been logged by the program using
|
| 194 |
* `Console.error` thus far.
|
| 195 |
*
|
| 196 |
+
* **When to use**
|
| 197 |
+
*
|
| 198 |
+
* Use to assert on captured `Console.error` output from a program provided
|
| 199 |
+
* with `TestConsole.layer`.
|
| 200 |
+
*
|
| 201 |
+
* **Example** (Reading captured error lines)
|
| 202 |
+
*
|
| 203 |
* ```ts
|
| 204 |
* import { Console, Effect } from "effect"
|
| 205 |
+
* import { TestConsole } from "effect/testing"
|
| 206 |
*
|
| 207 |
* const program = Effect.gen(function*() {
|
| 208 |
* yield* Console.error("Error message")
|
|
|
|
| 218 |
* }).pipe(Effect.provide(TestConsole.layer))
|
| 219 |
* ```
|
| 220 |
*
|
| 221 |
+
* @see {@link logLines} for reading captured `Console.log` output
|
| 222 |
+
* @see {@link layer} for capturing console calls during a test
|
| 223 |
+
*
|
| 224 |
+
* @category testing
|
| 225 |
* @since 4.0.0
|
|
|
|
| 226 |
*/
|
| 227 |
export const errorLines = /*#__PURE__*/testConsoleWith(console => console.errorLines);
|
| 228 |
//# sourceMappingURL=TestConsole.js.map
|
.opencode/node_modules/effect/dist/testing/TestConsole.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestConsole.js","names":["Array","Console","Effect","Layer","make","gen","entries","createEntryUnsafe","method","parameters","push","logLines","sync","flatMap","entry","errorLines","assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn","testConsoleWith","f","consoleWith","console","layer","effect"],"sources":["../../src/testing/TestConsole.ts"],"sourcesContent":[null],"mappings":"AAAA;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"TestConsole.js","names":["Array","Console","Effect","Layer","make","gen","entries","createEntryUnsafe","method","parameters","push","logLines","sync","flatMap","entry","errorLines","assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn","testConsoleWith","f","consoleWith","console","layer","effect"],"sources":["../../src/testing/TestConsole.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAKA,KAAK,MAAM,aAAa;AACpC,OAAO,KAAKC,OAAO,MAAM,eAAe;AACxC,OAAO,KAAKC,MAAM,MAAM,cAAc;AACtC,OAAO,KAAKC,KAAK,MAAM,aAAa;AAmIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,OAAO,MAAMC,IAAI,gBAAGF,MAAM,CAACG,GAAG,CAAC,aAAS;EACtC,MAAMC,OAAO,GAA6B,EAAE;EAE5C,SAASC,iBAAiBA,CAACC,MAA0B;IACnD,OAAO,CAAC,GAAGC,UAA8B,KAAU;MACjDH,OAAO,CAACI,IAAI,CAAC;QAAEF,MAAM;QAAEC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iBAAiB,CAAC,SAAS,CAAC;IACrC0B,KAAK,EAAE1B,iBAAiB,CAAC,OAAO,CAAC;IACjC2B,IAAI,EAAE3B,iBAAiB,CAAC,MAAM,CAAC;IAC/BI,QAAQ;IACRI;GACc;AAClB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,OAAO,MAAMoB,eAAe,GAAaC,CAAmD,IAC1FnC,OAAO,CAACoC,WAAW,CAAEC,OAAO,IAAKF,CAAC,CAACE,OAAsB,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,OAAO,MAAMC,KAAK,gBAA6BpC,KAAK,CAACqC,MAAM,CAACvC,OAAO,CAACA,OAAO,CAAC,CAACG,IAAI,CAAQ;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,OAAO,MAAMO,QAAQ,gBAAwDwB,eAAe,CACzFG,OAAO,IAAKA,OAAO,CAAC3B,QAAQ,CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,OAAO,MAAMI,UAAU,gBAAwDoB,eAAe,CAC3FG,OAAO,IAAKA,OAAO,CAACvB,UAAU,CAChC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/testing/TestSchema.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
| 1 |
import type * as Context from "../Context.ts";
|
| 2 |
import * as Effect from "../Effect.ts";
|
| 3 |
import * as Schema from "../Schema.ts";
|
| 4 |
-
import * as
|
| 5 |
-
import type * as
|
| 6 |
import * as FastCheck from "../testing/FastCheck.ts";
|
| 7 |
/**
|
| 8 |
-
*
|
| 9 |
-
* operation-specific helpers: {@link Decoding}, {@link Encoding}, make,
|
| 10 |
-
* arbitrary generation, and round-trip verification.
|
| 11 |
*
|
| 12 |
-
* When to use
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
* - You want property-based round-trip or generation checks.
|
| 16 |
*
|
| 17 |
* **Example** (Decoding and encoding a struct)
|
| 18 |
*
|
|
@@ -32,18 +29,21 @@ import * as FastCheck from "../testing/FastCheck.ts";
|
|
| 32 |
*
|
| 33 |
* @see {@link Decoding}
|
| 34 |
* @see {@link Encoding}
|
| 35 |
-
*
|
| 36 |
* @since 4.0.0
|
| 37 |
*/
|
| 38 |
export declare class Asserts<S extends Schema.Top> {
|
| 39 |
/**
|
| 40 |
-
* Static helpers for comparing schema AST structures.
|
| 41 |
-
*
|
|
|
|
| 42 |
*
|
| 43 |
-
*
|
| 44 |
-
*
|
| 45 |
-
*
|
| 46 |
-
*
|
|
|
|
|
|
|
| 47 |
*
|
| 48 |
* **Example** (Comparing struct fields)
|
| 49 |
*
|
|
@@ -67,12 +67,16 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 67 |
readonly schema: S;
|
| 68 |
constructor(schema: S);
|
| 69 |
/**
|
| 70 |
-
* Returns an object with `succeed` and `fail` helpers for testing the
|
| 71 |
-
*
|
|
|
|
| 72 |
*
|
| 73 |
-
*
|
| 74 |
-
*
|
| 75 |
-
*
|
|
|
|
|
|
|
|
|
|
| 76 |
*
|
| 77 |
* **Example** (Testing make)
|
| 78 |
*
|
|
@@ -84,6 +88,9 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 84 |
* const asserts = new TestSchema.Asserts(schema)
|
| 85 |
* await asserts.make().succeed("hello")
|
| 86 |
* ```
|
|
|
|
|
|
|
|
|
|
| 87 |
*/
|
| 88 |
make(options?: Schema.MakeOptions): {
|
| 89 |
succeed: {
|
|
@@ -93,13 +100,16 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 93 |
fail(input: unknown, message: string): Promise<void>;
|
| 94 |
};
|
| 95 |
/**
|
| 96 |
-
* Runs a property-based test that encodes arbitrary values and then decodes
|
| 97 |
-
*
|
| 98 |
-
*
|
|
|
|
|
|
|
|
|
|
| 99 |
*
|
| 100 |
-
*
|
| 101 |
-
*
|
| 102 |
-
* - Pass `options.params` to control FastCheck parameters
|
| 103 |
*
|
| 104 |
* **Example** (Round-trip verification)
|
| 105 |
*
|
|
@@ -110,15 +120,22 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 110 |
* const asserts = new TestSchema.Asserts(Schema.NumberFromString)
|
| 111 |
* await asserts.verifyLosslessTransformation()
|
| 112 |
* ```
|
|
|
|
|
|
|
| 113 |
*/
|
| 114 |
verifyLosslessTransformation<S extends Schema.Codec<unknown, unknown>>(this: Asserts<S>, options?: {
|
| 115 |
readonly params?: FastCheck.Parameters<[S["Type"]]>;
|
| 116 |
}): Promise<void>;
|
| 117 |
/**
|
| 118 |
-
* Returns a {@link Decoding} instance for this schema
|
| 119 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
*
|
| 121 |
-
*
|
| 122 |
*
|
| 123 |
* **Example** (Decoding assertions)
|
| 124 |
*
|
|
@@ -133,15 +150,21 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 133 |
* ```
|
| 134 |
*
|
| 135 |
* @see {@link Decoding}
|
|
|
|
| 136 |
*/
|
| 137 |
decoding(options?: {
|
| 138 |
-
readonly parseOptions?:
|
| 139 |
}): Decoding<S>;
|
| 140 |
/**
|
| 141 |
-
* Returns an {@link Encoding} instance for this schema
|
| 142 |
-
* and `fail` helpers to test encoding behavior.
|
| 143 |
*
|
| 144 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
*
|
| 146 |
* **Example** (Encoding assertions)
|
| 147 |
*
|
|
@@ -155,17 +178,22 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 155 |
* ```
|
| 156 |
*
|
| 157 |
* @see {@link Encoding}
|
|
|
|
| 158 |
*/
|
| 159 |
encoding(options?: {
|
| 160 |
-
readonly parseOptions?:
|
| 161 |
}): Encoding<S>;
|
| 162 |
/**
|
| 163 |
-
* Returns an object with property-based testing helpers for the schema's
|
| 164 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
*
|
| 166 |
-
*
|
| 167 |
-
*
|
| 168 |
-
*
|
| 169 |
*
|
| 170 |
* **Example** (Verifying arbitrary generation)
|
| 171 |
*
|
|
@@ -176,6 +204,8 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 176 |
* const asserts = new TestSchema.Asserts(Schema.String)
|
| 177 |
* asserts.arbitrary().verifyGeneration()
|
| 178 |
* ```
|
|
|
|
|
|
|
| 179 |
*/
|
| 180 |
arbitrary<S extends Schema.Codec<unknown, unknown, never, unknown>>(this: Asserts<S>): {
|
| 181 |
verifyGeneration(options?: {
|
|
@@ -184,22 +214,15 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 184 |
};
|
| 185 |
}
|
| 186 |
/**
|
| 187 |
-
*
|
| 188 |
-
*
|
|
|
|
| 189 |
*
|
| 190 |
-
*
|
| 191 |
-
* - You want to assert that specific inputs decode to expected values.
|
| 192 |
-
* - You want to assert that invalid inputs produce specific error messages.
|
| 193 |
-
* - You need to provide services required by the schema's decoding pipeline.
|
| 194 |
*
|
| 195 |
-
*
|
| 196 |
-
*
|
| 197 |
-
*
|
| 198 |
-
* - `succeed(input, expected)` asserts the decoded output equals `expected`.
|
| 199 |
-
* - `fail(input, message)` asserts decoding fails and the stringified issue
|
| 200 |
-
* equals `message`.
|
| 201 |
-
* - `provide(key, impl)` returns a new `Decoding` with the service injected
|
| 202 |
-
* into the decoding context.
|
| 203 |
*
|
| 204 |
* **Example** (Decoding with service provision)
|
| 205 |
*
|
|
@@ -214,23 +237,27 @@ export declare class Asserts<S extends Schema.Top> {
|
|
| 214 |
*
|
| 215 |
* @see {@link Asserts}
|
| 216 |
* @see {@link Encoding}
|
| 217 |
-
*
|
| 218 |
* @since 4.0.0
|
| 219 |
*/
|
| 220 |
export declare class Decoding<S extends Schema.Top> {
|
| 221 |
readonly schema: S;
|
| 222 |
-
readonly decodeUnknownEffect: (input: unknown, options?:
|
| 223 |
readonly options?: {
|
| 224 |
-
readonly parseOptions?:
|
| 225 |
} | undefined;
|
| 226 |
constructor(schema: S, options?: {
|
| 227 |
-
readonly parseOptions?:
|
| 228 |
});
|
| 229 |
/**
|
| 230 |
* Asserts that decoding `input` succeeds. With one argument, asserts the
|
| 231 |
* output equals the input. With two arguments, asserts the output equals
|
| 232 |
* `expected`.
|
| 233 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
* **Example** (Identity and transformed decoding)
|
| 235 |
*
|
| 236 |
* ```ts
|
|
@@ -240,6 +267,8 @@ export declare class Decoding<S extends Schema.Top> {
|
|
| 240 |
* const decoding = new TestSchema.Asserts(Schema.NumberFromString).decoding()
|
| 241 |
* await decoding.succeed("1", 1) // transformed
|
| 242 |
* ```
|
|
|
|
|
|
|
| 243 |
*/
|
| 244 |
succeed<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown): Promise<void>;
|
| 245 |
succeed<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown, expected: S["Type"]): Promise<void>;
|
|
@@ -247,6 +276,10 @@ export declare class Decoding<S extends Schema.Top> {
|
|
| 247 |
* Asserts that decoding `input` fails and the stringified issue equals
|
| 248 |
* `message`.
|
| 249 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
* **Example** (Asserting a decoding failure)
|
| 251 |
*
|
| 252 |
* ```ts
|
|
@@ -256,37 +289,31 @@ export declare class Decoding<S extends Schema.Top> {
|
|
| 256 |
* const decoding = new TestSchema.Asserts(Schema.String).decoding()
|
| 257 |
* await decoding.fail(42, "Expected string, got 42")
|
| 258 |
* ```
|
|
|
|
|
|
|
| 259 |
*/
|
| 260 |
fail<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown, message: string): Promise<void>;
|
| 261 |
/**
|
| 262 |
-
* Returns a new {@link Decoding} instance with the given service injected
|
| 263 |
-
* into the decoding effect context. Use this when the schema's decoder
|
| 264 |
-
* requires a service dependency.
|
| 265 |
*
|
| 266 |
-
*
|
|
|
|
|
|
|
| 267 |
*
|
| 268 |
* @see {@link Encoding.provide}
|
| 269 |
*/
|
| 270 |
provide<Id, Service>(service: Context.Key<Id, Service>, implementation: Service): Decoding<Schema.middlewareDecoding<S, Exclude<S["DecodingServices"], Id>>>;
|
| 271 |
}
|
| 272 |
/**
|
| 273 |
-
*
|
| 274 |
-
*
|
|
|
|
|
|
|
|
|
|
| 275 |
*
|
| 276 |
-
*
|
| 277 |
-
* - You want to assert that specific values encode to expected outputs.
|
| 278 |
-
* - You want to assert that invalid inputs produce specific error messages
|
| 279 |
-
* during encoding.
|
| 280 |
-
* - You need to provide services required by the schema's encoding pipeline.
|
| 281 |
*
|
| 282 |
-
*
|
| 283 |
-
* - All assertions are async and use `assert.deepStrictEqual` internally.
|
| 284 |
-
* - `succeed(input)` asserts the encoded output equals `input` (identity).
|
| 285 |
-
* - `succeed(input, expected)` asserts the encoded output equals `expected`.
|
| 286 |
-
* - `fail(input, message)` asserts encoding fails and the stringified issue
|
| 287 |
-
* equals `message`.
|
| 288 |
-
* - `provide(key, impl)` returns a new `Encoding` with the service injected
|
| 289 |
-
* into the encoding context.
|
| 290 |
*
|
| 291 |
* **Example** (Encoding assertions)
|
| 292 |
*
|
|
@@ -301,22 +328,27 @@ export declare class Decoding<S extends Schema.Top> {
|
|
| 301 |
* @see {@link Asserts}
|
| 302 |
* @see {@link Decoding}
|
| 303 |
*
|
|
|
|
| 304 |
* @since 4.0.0
|
| 305 |
*/
|
| 306 |
-
declare class Encoding<S extends Schema.Top> {
|
| 307 |
readonly schema: S;
|
| 308 |
-
readonly encodeUnknownEffect: (input: unknown, options?:
|
| 309 |
readonly options?: {
|
| 310 |
-
readonly parseOptions?:
|
| 311 |
} | undefined;
|
| 312 |
constructor(schema: S, options?: {
|
| 313 |
-
readonly parseOptions?:
|
| 314 |
});
|
| 315 |
/**
|
| 316 |
* Asserts that encoding `input` succeeds. With one argument, asserts the
|
| 317 |
* output equals the input. With two arguments, asserts the output equals
|
| 318 |
* `expected`.
|
| 319 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
* **Example** (Identity and transformed encoding)
|
| 321 |
*
|
| 322 |
* ```ts
|
|
@@ -326,6 +358,8 @@ declare class Encoding<S extends Schema.Top> {
|
|
| 326 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 327 |
* await encoding.succeed(1, "1") // transformed
|
| 328 |
* ```
|
|
|
|
|
|
|
| 329 |
*/
|
| 330 |
succeed<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown): Promise<void>;
|
| 331 |
succeed<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown, expected: S["Encoded"]): Promise<void>;
|
|
@@ -333,6 +367,10 @@ declare class Encoding<S extends Schema.Top> {
|
|
| 333 |
* Asserts that encoding `input` fails and the stringified issue equals
|
| 334 |
* `message`.
|
| 335 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
* **Example** (Asserting an encoding failure)
|
| 337 |
*
|
| 338 |
* ```ts
|
|
@@ -342,18 +380,19 @@ declare class Encoding<S extends Schema.Top> {
|
|
| 342 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 343 |
* await encoding.fail("not-a-number", "Expected number, got \"not-a-number\"")
|
| 344 |
* ```
|
|
|
|
|
|
|
| 345 |
*/
|
| 346 |
fail<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown, message: string): Promise<void>;
|
| 347 |
/**
|
| 348 |
-
* Returns a new {@link Encoding} instance with the given service injected
|
| 349 |
-
*
|
| 350 |
-
*
|
| 351 |
*
|
| 352 |
-
*
|
| 353 |
*
|
| 354 |
* @see {@link Decoding.provide}
|
| 355 |
*/
|
| 356 |
provide<Id, Service>(service: Context.Key<Id, Service>, implementation: Service): Encoding<Schema.middlewareEncoding<S, Exclude<S["EncodingServices"], Id>>>;
|
| 357 |
}
|
| 358 |
-
export {};
|
| 359 |
//# sourceMappingURL=TestSchema.d.ts.map
|
|
|
|
| 1 |
import type * as Context from "../Context.ts";
|
| 2 |
import * as Effect from "../Effect.ts";
|
| 3 |
import * as Schema from "../Schema.ts";
|
| 4 |
+
import * as SchemaAST from "../SchemaAST.ts";
|
| 5 |
+
import type * as SchemaIssue from "../SchemaIssue.ts";
|
| 6 |
import * as FastCheck from "../testing/FastCheck.ts";
|
| 7 |
/**
|
| 8 |
+
* Provides schema test assertions for decoding, encoding, make, arbitrary generation, and round-trip verification.
|
|
|
|
|
|
|
| 9 |
*
|
| 10 |
+
* **When to use**
|
| 11 |
+
*
|
| 12 |
+
* Use when writing schema unit tests for decoding, encoding, construction, property-based round-trip, or generation behavior.
|
|
|
|
| 13 |
*
|
| 14 |
* **Example** (Decoding and encoding a struct)
|
| 15 |
*
|
|
|
|
| 29 |
*
|
| 30 |
* @see {@link Decoding}
|
| 31 |
* @see {@link Encoding}
|
| 32 |
+
* @category testing
|
| 33 |
* @since 4.0.0
|
| 34 |
*/
|
| 35 |
export declare class Asserts<S extends Schema.Top> {
|
| 36 |
/**
|
| 37 |
+
* Static helpers for comparing schema AST structures.
|
| 38 |
+
*
|
| 39 |
+
* **When to use**
|
| 40 |
*
|
| 41 |
+
* Use to assert that two schema field or tuple element definitions produce
|
| 42 |
+
* the same AST structure.
|
| 43 |
+
*
|
| 44 |
+
* **Details**
|
| 45 |
+
*
|
| 46 |
+
* `ast.fields.equals(a, b)` compares struct field ASTs via `assert.deepStrictEqual`. `ast.elements.equals(a, b)` compares tuple element ASTs via `assert.deepStrictEqual`.
|
| 47 |
*
|
| 48 |
* **Example** (Comparing struct fields)
|
| 49 |
*
|
|
|
|
| 67 |
readonly schema: S;
|
| 68 |
constructor(schema: S);
|
| 69 |
/**
|
| 70 |
+
* Returns an object with `succeed` and `fail` helpers for testing the schema's `make` operation.
|
| 71 |
+
*
|
| 72 |
+
* **When to use**
|
| 73 |
*
|
| 74 |
+
* Use to assert how `Schema.make` accepts, transforms, or rejects
|
| 75 |
+
* construction input for this schema.
|
| 76 |
+
*
|
| 77 |
+
* **Details**
|
| 78 |
+
*
|
| 79 |
+
* `succeed(input)` asserts make returns the input unchanged. `succeed(input, expected)` asserts make returns `expected`. `fail(input, message)` asserts make fails with `message`.
|
| 80 |
*
|
| 81 |
* **Example** (Testing make)
|
| 82 |
*
|
|
|
|
| 88 |
* const asserts = new TestSchema.Asserts(schema)
|
| 89 |
* await asserts.make().succeed("hello")
|
| 90 |
* ```
|
| 91 |
+
*
|
| 92 |
+
* @see {@link decoding} for assertions against decoded input
|
| 93 |
+
* @see {@link encoding} for assertions against encoded output
|
| 94 |
*/
|
| 95 |
make(options?: Schema.MakeOptions): {
|
| 96 |
succeed: {
|
|
|
|
| 100 |
fail(input: unknown, message: string): Promise<void>;
|
| 101 |
};
|
| 102 |
/**
|
| 103 |
+
* Runs a property-based test that encodes arbitrary values and then decodes them, asserting the decoded value equals the original.
|
| 104 |
+
*
|
| 105 |
+
* **When to use**
|
| 106 |
+
*
|
| 107 |
+
* Use to verify that generated schema values survive an encode-then-decode
|
| 108 |
+
* round trip.
|
| 109 |
*
|
| 110 |
+
* **Details**
|
| 111 |
+
*
|
| 112 |
+
* FastCheck generates arbitrary values matching the schema's `Type`. The assertion fails if any generated value does not round-trip. Pass `options.params` to control FastCheck parameters such as `numRuns`.
|
| 113 |
*
|
| 114 |
* **Example** (Round-trip verification)
|
| 115 |
*
|
|
|
|
| 120 |
* const asserts = new TestSchema.Asserts(Schema.NumberFromString)
|
| 121 |
* await asserts.verifyLosslessTransformation()
|
| 122 |
* ```
|
| 123 |
+
*
|
| 124 |
+
* @see {@link arbitrary} for checking that generated values satisfy the schema
|
| 125 |
*/
|
| 126 |
verifyLosslessTransformation<S extends Schema.Codec<unknown, unknown>>(this: Asserts<S>, options?: {
|
| 127 |
readonly params?: FastCheck.Parameters<[S["Type"]]>;
|
| 128 |
}): Promise<void>;
|
| 129 |
/**
|
| 130 |
+
* Returns a {@link Decoding} instance for this schema with helpers for decoding assertions.
|
| 131 |
+
*
|
| 132 |
+
* **When to use**
|
| 133 |
+
*
|
| 134 |
+
* Use to test how unknown input is decoded into the schema's type.
|
| 135 |
+
*
|
| 136 |
+
* **Details**
|
| 137 |
*
|
| 138 |
+
* Pass `parseOptions` to control error reporting, for example `{ errors: "all" }`.
|
| 139 |
*
|
| 140 |
* **Example** (Decoding assertions)
|
| 141 |
*
|
|
|
|
| 150 |
* ```
|
| 151 |
*
|
| 152 |
* @see {@link Decoding}
|
| 153 |
+
* @see {@link encoding} for assertions in the opposite direction
|
| 154 |
*/
|
| 155 |
decoding(options?: {
|
| 156 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 157 |
}): Decoding<S>;
|
| 158 |
/**
|
| 159 |
+
* Returns an {@link Encoding} instance for this schema with helpers for encoding assertions.
|
|
|
|
| 160 |
*
|
| 161 |
+
* **When to use**
|
| 162 |
+
*
|
| 163 |
+
* Use to test how schema values are encoded into their external form.
|
| 164 |
+
*
|
| 165 |
+
* **Details**
|
| 166 |
+
*
|
| 167 |
+
* Pass `parseOptions` to control error reporting, for example `{ errors: "all" }`.
|
| 168 |
*
|
| 169 |
* **Example** (Encoding assertions)
|
| 170 |
*
|
|
|
|
| 178 |
* ```
|
| 179 |
*
|
| 180 |
* @see {@link Encoding}
|
| 181 |
+
* @see {@link decoding} for assertions in the opposite direction
|
| 182 |
*/
|
| 183 |
encoding(options?: {
|
| 184 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 185 |
}): Encoding<S>;
|
| 186 |
/**
|
| 187 |
+
* Returns an object with property-based testing helpers for the schema's arbitrary generator.
|
| 188 |
+
*
|
| 189 |
+
* **When to use**
|
| 190 |
+
*
|
| 191 |
+
* Use to verify that arbitrary values generated for this schema satisfy the
|
| 192 |
+
* schema's predicate.
|
| 193 |
*
|
| 194 |
+
* **Details**
|
| 195 |
+
*
|
| 196 |
+
* `verifyGeneration()` generates arbitrary values and asserts each value satisfies the schema's `is` predicate. It defaults to 20 runs. Pass `options.params` to override FastCheck parameters.
|
| 197 |
*
|
| 198 |
* **Example** (Verifying arbitrary generation)
|
| 199 |
*
|
|
|
|
| 204 |
* const asserts = new TestSchema.Asserts(Schema.String)
|
| 205 |
* asserts.arbitrary().verifyGeneration()
|
| 206 |
* ```
|
| 207 |
+
*
|
| 208 |
+
* @see {@link verifyLosslessTransformation} for property-based round-trip checks
|
| 209 |
*/
|
| 210 |
arbitrary<S extends Schema.Codec<unknown, unknown, never, unknown>>(this: Asserts<S>): {
|
| 211 |
verifyGeneration(options?: {
|
|
|
|
| 214 |
};
|
| 215 |
}
|
| 216 |
/**
|
| 217 |
+
* Provides decoding test assertions through `succeed` and `fail` methods that run the schema's decoder and compare the result.
|
| 218 |
+
*
|
| 219 |
+
* **When to use**
|
| 220 |
*
|
| 221 |
+
* Use when you want to assert that specific inputs decode to expected values, invalid inputs produce specific error messages, or schemas receive required decoding services.
|
|
|
|
|
|
|
|
|
|
| 222 |
*
|
| 223 |
+
* **Details**
|
| 224 |
+
*
|
| 225 |
+
* All assertions are async and use `assert.deepStrictEqual` internally. `succeed(input)` asserts the decoded output equals `input`; `succeed(input, expected)` asserts it equals `expected`; `fail(input, message)` asserts decoding fails and the stringified issue equals `message`. `provide(key, impl)` returns a new `Decoding` with the service injected into the decoding context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
*
|
| 227 |
* **Example** (Decoding with service provision)
|
| 228 |
*
|
|
|
|
| 237 |
*
|
| 238 |
* @see {@link Asserts}
|
| 239 |
* @see {@link Encoding}
|
| 240 |
+
* @category testing
|
| 241 |
* @since 4.0.0
|
| 242 |
*/
|
| 243 |
export declare class Decoding<S extends Schema.Top> {
|
| 244 |
readonly schema: S;
|
| 245 |
+
readonly decodeUnknownEffect: (input: unknown, options?: SchemaAST.ParseOptions) => Effect.Effect<S["Type"], SchemaIssue.Issue, S["DecodingServices"]>;
|
| 246 |
readonly options?: {
|
| 247 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 248 |
} | undefined;
|
| 249 |
constructor(schema: S, options?: {
|
| 250 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 251 |
});
|
| 252 |
/**
|
| 253 |
* Asserts that decoding `input` succeeds. With one argument, asserts the
|
| 254 |
* output equals the input. With two arguments, asserts the output equals
|
| 255 |
* `expected`.
|
| 256 |
*
|
| 257 |
+
* **When to use**
|
| 258 |
+
*
|
| 259 |
+
* Use to verify successful decoding for one input case.
|
| 260 |
+
*
|
| 261 |
* **Example** (Identity and transformed decoding)
|
| 262 |
*
|
| 263 |
* ```ts
|
|
|
|
| 267 |
* const decoding = new TestSchema.Asserts(Schema.NumberFromString).decoding()
|
| 268 |
* await decoding.succeed("1", 1) // transformed
|
| 269 |
* ```
|
| 270 |
+
*
|
| 271 |
+
* @see {@link fail} for asserting decoding failures
|
| 272 |
*/
|
| 273 |
succeed<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown): Promise<void>;
|
| 274 |
succeed<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown, expected: S["Type"]): Promise<void>;
|
|
|
|
| 276 |
* Asserts that decoding `input` fails and the stringified issue equals
|
| 277 |
* `message`.
|
| 278 |
*
|
| 279 |
+
* **When to use**
|
| 280 |
+
*
|
| 281 |
+
* Use to verify that invalid decoding input produces the expected issue text.
|
| 282 |
+
*
|
| 283 |
* **Example** (Asserting a decoding failure)
|
| 284 |
*
|
| 285 |
* ```ts
|
|
|
|
| 289 |
* const decoding = new TestSchema.Asserts(Schema.String).decoding()
|
| 290 |
* await decoding.fail(42, "Expected string, got 42")
|
| 291 |
* ```
|
| 292 |
+
*
|
| 293 |
+
* @see {@link succeed} for asserting successful decoding
|
| 294 |
*/
|
| 295 |
fail<S extends Schema.Decoder<unknown, never>>(this: Decoding<S>, input: unknown, message: string): Promise<void>;
|
| 296 |
/**
|
| 297 |
+
* Returns a new {@link Decoding} instance with the given service injected into the decoding effect context.
|
|
|
|
|
|
|
| 298 |
*
|
| 299 |
+
* **When to use**
|
| 300 |
+
*
|
| 301 |
+
* Use when the schema's decoder requires a service dependency.
|
| 302 |
*
|
| 303 |
* @see {@link Encoding.provide}
|
| 304 |
*/
|
| 305 |
provide<Id, Service>(service: Context.Key<Id, Service>, implementation: Service): Decoding<Schema.middlewareDecoding<S, Exclude<S["DecodingServices"], Id>>>;
|
| 306 |
}
|
| 307 |
/**
|
| 308 |
+
* Provides encoding test assertions through `succeed` and `fail` methods that run the schema's encoder and compare the result.
|
| 309 |
+
*
|
| 310 |
+
* **When to use**
|
| 311 |
+
*
|
| 312 |
+
* Use when you want to assert that specific values encode to expected outputs, invalid inputs produce specific error messages, or schemas receive required encoding services.
|
| 313 |
*
|
| 314 |
+
* **Details**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
*
|
| 316 |
+
* All assertions are async and use `assert.deepStrictEqual` internally. `succeed(input)` asserts the encoded output equals `input`; `succeed(input, expected)` asserts it equals `expected`; `fail(input, message)` asserts encoding fails and the stringified issue equals `message`. `provide(key, impl)` returns a new `Encoding` with the service injected into the encoding context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
*
|
| 318 |
* **Example** (Encoding assertions)
|
| 319 |
*
|
|
|
|
| 328 |
* @see {@link Asserts}
|
| 329 |
* @see {@link Decoding}
|
| 330 |
*
|
| 331 |
+
* @category testing
|
| 332 |
* @since 4.0.0
|
| 333 |
*/
|
| 334 |
+
export declare class Encoding<S extends Schema.Top> {
|
| 335 |
readonly schema: S;
|
| 336 |
+
readonly encodeUnknownEffect: (input: unknown, options?: SchemaAST.ParseOptions) => Effect.Effect<S["Type"], SchemaIssue.Issue, S["EncodingServices"]>;
|
| 337 |
readonly options?: {
|
| 338 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 339 |
} | undefined;
|
| 340 |
constructor(schema: S, options?: {
|
| 341 |
+
readonly parseOptions?: SchemaAST.ParseOptions | undefined;
|
| 342 |
});
|
| 343 |
/**
|
| 344 |
* Asserts that encoding `input` succeeds. With one argument, asserts the
|
| 345 |
* output equals the input. With two arguments, asserts the output equals
|
| 346 |
* `expected`.
|
| 347 |
*
|
| 348 |
+
* **When to use**
|
| 349 |
+
*
|
| 350 |
+
* Use to verify successful encoding for one input case.
|
| 351 |
+
*
|
| 352 |
* **Example** (Identity and transformed encoding)
|
| 353 |
*
|
| 354 |
* ```ts
|
|
|
|
| 358 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 359 |
* await encoding.succeed(1, "1") // transformed
|
| 360 |
* ```
|
| 361 |
+
*
|
| 362 |
+
* @see {@link fail} for asserting encoding failures
|
| 363 |
*/
|
| 364 |
succeed<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown): Promise<void>;
|
| 365 |
succeed<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown, expected: S["Encoded"]): Promise<void>;
|
|
|
|
| 367 |
* Asserts that encoding `input` fails and the stringified issue equals
|
| 368 |
* `message`.
|
| 369 |
*
|
| 370 |
+
* **When to use**
|
| 371 |
+
*
|
| 372 |
+
* Use to verify that invalid encoding input produces the expected issue text.
|
| 373 |
+
*
|
| 374 |
* **Example** (Asserting an encoding failure)
|
| 375 |
*
|
| 376 |
* ```ts
|
|
|
|
| 380 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 381 |
* await encoding.fail("not-a-number", "Expected number, got \"not-a-number\"")
|
| 382 |
* ```
|
| 383 |
+
*
|
| 384 |
+
* @see {@link succeed} for asserting successful encoding
|
| 385 |
*/
|
| 386 |
fail<S extends Schema.Encoder<unknown, never>>(this: Encoding<S>, input: unknown, message: string): Promise<void>;
|
| 387 |
/**
|
| 388 |
+
* Returns a new {@link Encoding} instance with the given service injected into the encoding effect context.
|
| 389 |
+
*
|
| 390 |
+
* **When to use**
|
| 391 |
*
|
| 392 |
+
* Use when the schema's encoder requires a service dependency.
|
| 393 |
*
|
| 394 |
* @see {@link Decoding.provide}
|
| 395 |
*/
|
| 396 |
provide<Id, Service>(service: Context.Key<Id, Service>, implementation: Service): Encoding<Schema.middlewareEncoding<S, Exclude<S["EncodingServices"], Id>>>;
|
| 397 |
}
|
|
|
|
| 398 |
//# sourceMappingURL=TestSchema.d.ts.map
|
.opencode/node_modules/effect/dist/testing/TestSchema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestSchema.d.ts","sourceRoot":"","sources":["../../src/testing/TestSchema.ts"],"names":[],"mappings":"
|
|
|
|
| 1 |
+
{"version":3,"file":"TestSchema.d.ts","sourceRoot":"","sources":["../../src/testing/TestSchema.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAGtC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG;IACvC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,GAAG;;iCAEM,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM;;;iCAK7C,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,KAAK,CAAC,QAAQ;;MAIrD;IAEV,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;gBACN,MAAM,EAAE,CAAC;IAGrB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW;;oBAED,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;oBACzB,CA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CAAC,CAAC,SAAS,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,EACjD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM;IAUjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO,EACjB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,EACjC,cAAc,EAAE,OAAO,GACtB,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAM9E"}
|
.opencode/node_modules/effect/dist/testing/TestSchema.js
CHANGED
|
@@ -1,68 +1,11 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* arbitrary-generation behavior. Used in unit tests to verify that schemas
|
| 4 |
-
* accept, reject, and round-trip values correctly.
|
| 5 |
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
* helpers that run the schema's decoder and compare the result.
|
| 12 |
-
* - **Encoding** – returned by `asserts.encoding()`; mirrors {@link Decoding}
|
| 13 |
-
* but exercises the encoder direction.
|
| 14 |
-
* - Every assertion is async (`Promise<void>`) because parsing may involve
|
| 15 |
-
* effectful schemas.
|
| 16 |
-
* - `succeed` with one argument asserts identity (output equals input);
|
| 17 |
-
* with two arguments asserts a specific expected output.
|
| 18 |
-
* - `fail` always takes the input and the expected error message string.
|
| 19 |
-
*
|
| 20 |
-
* ## Common tasks
|
| 21 |
-
*
|
| 22 |
-
* - Assert decoding succeeds / fails → `new Asserts(schema).decoding().succeed(…)` / `.fail(…)`
|
| 23 |
-
* - Assert encoding succeeds / fails → `new Asserts(schema).encoding().succeed(…)` / `.fail(…)`
|
| 24 |
-
* - Assert make succeeds / fails → `new Asserts(schema).make().succeed(…)` / `.fail(…)`
|
| 25 |
-
* - Verify round-trip (encode then decode) → `new Asserts(schema).verifyLosslessTransformation()`
|
| 26 |
-
* - Verify arbitrary generation → `new Asserts(schema).arbitrary().verifyGeneration()`
|
| 27 |
-
* - Compare AST of struct fields → `Asserts.ast.fields.equals(a, b)`
|
| 28 |
-
* - Provide a service dependency for decoding → `asserts.decoding().provide(key, impl)`
|
| 29 |
-
*
|
| 30 |
-
* ## Gotchas
|
| 31 |
-
*
|
| 32 |
-
* - `succeed` uses `assert.deepStrictEqual`, so reference equality is not
|
| 33 |
-
* required but structural equality is.
|
| 34 |
-
* - `fail` compares against the stringified `Issue`, not the `Issue` object
|
| 35 |
-
* itself. Pass the exact multiline string the issue produces.
|
| 36 |
-
* - `verifyLosslessTransformation` and `arbitrary().verifyGeneration` run
|
| 37 |
-
* property-based tests via FastCheck; default run count is 20 for
|
| 38 |
-
* `verifyGeneration`.
|
| 39 |
-
*
|
| 40 |
-
* ## Quickstart
|
| 41 |
-
*
|
| 42 |
-
* **Example** (Basic decoding and encoding assertions)
|
| 43 |
-
*
|
| 44 |
-
* ```ts
|
| 45 |
-
* import { Schema } from "effect"
|
| 46 |
-
* import { TestSchema } from "effect/testing"
|
| 47 |
-
*
|
| 48 |
-
* const schema = Schema.NumberFromString
|
| 49 |
-
* const asserts = new TestSchema.Asserts(schema)
|
| 50 |
-
*
|
| 51 |
-
* // decoding
|
| 52 |
-
* const decoding = asserts.decoding()
|
| 53 |
-
* await decoding.succeed("1", 1)
|
| 54 |
-
* await decoding.fail(null, "Expected string, got null")
|
| 55 |
-
*
|
| 56 |
-
* // encoding
|
| 57 |
-
* const encoding = asserts.encoding()
|
| 58 |
-
* await encoding.succeed(1, "1")
|
| 59 |
-
* ```
|
| 60 |
-
*
|
| 61 |
-
* ## See also
|
| 62 |
-
*
|
| 63 |
-
* - {@link Asserts}
|
| 64 |
-
* - {@link Decoding}
|
| 65 |
-
* - {@link Encoding}
|
| 66 |
*
|
| 67 |
* @since 4.0.0
|
| 68 |
*/
|
|
@@ -71,18 +14,15 @@ import * as Effect from "../Effect.js";
|
|
| 71 |
import * as Record from "../Record.js";
|
| 72 |
import * as Result from "../Result.js";
|
| 73 |
import * as Schema from "../Schema.js";
|
| 74 |
-
import * as
|
| 75 |
-
import * as
|
| 76 |
import * as FastCheck from "../testing/FastCheck.js";
|
| 77 |
/**
|
| 78 |
-
*
|
| 79 |
-
*
|
| 80 |
-
*
|
| 81 |
*
|
| 82 |
-
*
|
| 83 |
-
* - You are writing unit tests for a schema's decoding, encoding, or
|
| 84 |
-
* construction behavior.
|
| 85 |
-
* - You want property-based round-trip or generation checks.
|
| 86 |
*
|
| 87 |
* **Example** (Decoding and encoding a struct)
|
| 88 |
*
|
|
@@ -102,18 +42,21 @@ import * as FastCheck from "../testing/FastCheck.js";
|
|
| 102 |
*
|
| 103 |
* @see {@link Decoding}
|
| 104 |
* @see {@link Encoding}
|
| 105 |
-
*
|
| 106 |
* @since 4.0.0
|
| 107 |
*/
|
| 108 |
export class Asserts {
|
| 109 |
/**
|
| 110 |
-
* Static helpers for comparing schema AST structures.
|
| 111 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
*
|
| 113 |
-
*
|
| 114 |
-
* `assert.deepStrictEqual`.
|
| 115 |
-
* - `ast.elements.equals(a, b)` – compares tuple element ASTs via
|
| 116 |
-
* `assert.deepStrictEqual`.
|
| 117 |
*
|
| 118 |
* **Example** (Comparing struct fields)
|
| 119 |
*
|
|
@@ -129,12 +72,12 @@ export class Asserts {
|
|
| 129 |
static ast = {
|
| 130 |
fields: {
|
| 131 |
equals: (a, b) => {
|
| 132 |
-
assert.deepStrictEqual(Record.map(a,
|
| 133 |
}
|
| 134 |
},
|
| 135 |
elements: {
|
| 136 |
equals: (a, b) => {
|
| 137 |
-
assert.deepStrictEqual(a.map(
|
| 138 |
}
|
| 139 |
}
|
| 140 |
};
|
|
@@ -143,12 +86,16 @@ export class Asserts {
|
|
| 143 |
this.schema = schema;
|
| 144 |
}
|
| 145 |
/**
|
| 146 |
-
* Returns an object with `succeed` and `fail` helpers for testing the
|
| 147 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
*
|
| 149 |
-
*
|
| 150 |
-
* - `succeed(input, expected)` – asserts make returns `expected`.
|
| 151 |
-
* - `fail(input, message)` – asserts make fails with `message`.
|
| 152 |
*
|
| 153 |
* **Example** (Testing make)
|
| 154 |
*
|
|
@@ -160,30 +107,36 @@ export class Asserts {
|
|
| 160 |
* const asserts = new TestSchema.Asserts(schema)
|
| 161 |
* await asserts.make().succeed("hello")
|
| 162 |
* ```
|
|
|
|
|
|
|
|
|
|
| 163 |
*/
|
| 164 |
make(options) {
|
| 165 |
-
const makeEffect =
|
| 166 |
async function succeed(input, expected) {
|
| 167 |
-
const r = await Effect.runPromise(makeEffect(input, options).pipe(Effect.
|
| 168 |
expected = arguments.length === 1 ? input : expected;
|
| 169 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 170 |
}
|
| 171 |
return {
|
| 172 |
succeed,
|
| 173 |
async fail(input, message) {
|
| 174 |
-
const r = await Effect.runPromise(makeEffect(input, options).pipe(Effect.
|
| 175 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 176 |
}
|
| 177 |
};
|
| 178 |
}
|
| 179 |
/**
|
| 180 |
-
* Runs a property-based test that encodes arbitrary values and then decodes
|
| 181 |
-
*
|
| 182 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
*
|
| 184 |
-
*
|
| 185 |
-
* - Fails the test if any generated value does not round-trip.
|
| 186 |
-
* - Pass `options.params` to control FastCheck parameters (e.g. `numRuns`).
|
| 187 |
*
|
| 188 |
* **Example** (Round-trip verification)
|
| 189 |
*
|
|
@@ -194,21 +147,28 @@ export class Asserts {
|
|
| 194 |
* const asserts = new TestSchema.Asserts(Schema.NumberFromString)
|
| 195 |
* await asserts.verifyLosslessTransformation()
|
| 196 |
* ```
|
|
|
|
|
|
|
| 197 |
*/
|
| 198 |
verifyLosslessTransformation(options) {
|
| 199 |
-
const decodeUnknownEffect =
|
| 200 |
-
const encodeEffect =
|
| 201 |
const arbitrary = Schema.toArbitrary(this.schema);
|
| 202 |
return FastCheck.assert(FastCheck.asyncProperty(arbitrary, async t => {
|
| 203 |
-
const r = await Effect.runPromise(encodeEffect(t).pipe(Effect.
|
| 204 |
assert.deepStrictEqual(r, Result.succeed(t));
|
| 205 |
}), options?.params);
|
| 206 |
}
|
| 207 |
/**
|
| 208 |
-
* Returns a {@link Decoding} instance for this schema
|
| 209 |
-
*
|
|
|
|
|
|
|
|
|
|
| 210 |
*
|
| 211 |
-
*
|
|
|
|
|
|
|
| 212 |
*
|
| 213 |
* **Example** (Decoding assertions)
|
| 214 |
*
|
|
@@ -223,15 +183,21 @@ export class Asserts {
|
|
| 223 |
* ```
|
| 224 |
*
|
| 225 |
* @see {@link Decoding}
|
|
|
|
| 226 |
*/
|
| 227 |
decoding(options) {
|
| 228 |
return new Decoding(this.schema, options);
|
| 229 |
}
|
| 230 |
/**
|
| 231 |
-
* Returns an {@link Encoding} instance for this schema
|
| 232 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
*
|
| 234 |
-
*
|
| 235 |
*
|
| 236 |
* **Example** (Encoding assertions)
|
| 237 |
*
|
|
@@ -245,17 +211,22 @@ export class Asserts {
|
|
| 245 |
* ```
|
| 246 |
*
|
| 247 |
* @see {@link Encoding}
|
|
|
|
| 248 |
*/
|
| 249 |
encoding(options) {
|
| 250 |
return new Encoding(this.schema, options);
|
| 251 |
}
|
| 252 |
/**
|
| 253 |
-
* Returns an object with property-based testing helpers for the schema's
|
| 254 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
*
|
| 256 |
-
*
|
| 257 |
-
* satisfies the schema's `is` predicate. Defaults to 20 runs.
|
| 258 |
-
* - Pass `options.params` to override FastCheck parameters.
|
| 259 |
*
|
| 260 |
* **Example** (Verifying arbitrary generation)
|
| 261 |
*
|
|
@@ -266,6 +237,8 @@ export class Asserts {
|
|
| 266 |
* const asserts = new TestSchema.Asserts(Schema.String)
|
| 267 |
* asserts.arbitrary().verifyGeneration()
|
| 268 |
* ```
|
|
|
|
|
|
|
| 269 |
*/
|
| 270 |
arbitrary() {
|
| 271 |
const schema = this.schema;
|
|
@@ -283,22 +256,15 @@ export class Asserts {
|
|
| 283 |
}
|
| 284 |
}
|
| 285 |
/**
|
| 286 |
-
*
|
| 287 |
-
*
|
|
|
|
| 288 |
*
|
| 289 |
-
*
|
| 290 |
-
* - You want to assert that specific inputs decode to expected values.
|
| 291 |
-
* - You want to assert that invalid inputs produce specific error messages.
|
| 292 |
-
* - You need to provide services required by the schema's decoding pipeline.
|
| 293 |
*
|
| 294 |
-
*
|
| 295 |
-
*
|
| 296 |
-
*
|
| 297 |
-
* - `succeed(input, expected)` asserts the decoded output equals `expected`.
|
| 298 |
-
* - `fail(input, message)` asserts decoding fails and the stringified issue
|
| 299 |
-
* equals `message`.
|
| 300 |
-
* - `provide(key, impl)` returns a new `Decoding` with the service injected
|
| 301 |
-
* into the decoding context.
|
| 302 |
*
|
| 303 |
* **Example** (Decoding with service provision)
|
| 304 |
*
|
|
@@ -313,7 +279,7 @@ export class Asserts {
|
|
| 313 |
*
|
| 314 |
* @see {@link Asserts}
|
| 315 |
* @see {@link Encoding}
|
| 316 |
-
*
|
| 317 |
* @since 4.0.0
|
| 318 |
*/
|
| 319 |
export class Decoding {
|
|
@@ -322,11 +288,11 @@ export class Decoding {
|
|
| 322 |
options;
|
| 323 |
constructor(schema, options) {
|
| 324 |
this.schema = schema;
|
| 325 |
-
this.decodeUnknownEffect =
|
| 326 |
this.options = options;
|
| 327 |
}
|
| 328 |
async succeed(input, expected) {
|
| 329 |
-
const r = await Effect.runPromise(this.decodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.
|
| 330 |
expected = arguments.length === 1 ? input : expected;
|
| 331 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 332 |
}
|
|
@@ -334,6 +300,10 @@ export class Decoding {
|
|
| 334 |
* Asserts that decoding `input` fails and the stringified issue equals
|
| 335 |
* `message`.
|
| 336 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
* **Example** (Asserting a decoding failure)
|
| 338 |
*
|
| 339 |
* ```ts
|
|
@@ -343,17 +313,19 @@ export class Decoding {
|
|
| 343 |
* const decoding = new TestSchema.Asserts(Schema.String).decoding()
|
| 344 |
* await decoding.fail(42, "Expected string, got 42")
|
| 345 |
* ```
|
|
|
|
|
|
|
| 346 |
*/
|
| 347 |
async fail(input, message) {
|
| 348 |
-
const r = await Effect.runPromise(this.decodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.
|
| 349 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 350 |
}
|
| 351 |
/**
|
| 352 |
-
* Returns a new {@link Decoding} instance with the given service injected
|
| 353 |
-
* into the decoding effect context. Use this when the schema's decoder
|
| 354 |
-
* requires a service dependency.
|
| 355 |
*
|
| 356 |
-
*
|
|
|
|
|
|
|
| 357 |
*
|
| 358 |
* @see {@link Encoding.provide}
|
| 359 |
*/
|
|
@@ -362,23 +334,15 @@ export class Decoding {
|
|
| 362 |
}
|
| 363 |
}
|
| 364 |
/**
|
| 365 |
-
*
|
| 366 |
-
*
|
|
|
|
| 367 |
*
|
| 368 |
-
*
|
| 369 |
-
* - You want to assert that specific values encode to expected outputs.
|
| 370 |
-
* - You want to assert that invalid inputs produce specific error messages
|
| 371 |
-
* during encoding.
|
| 372 |
-
* - You need to provide services required by the schema's encoding pipeline.
|
| 373 |
*
|
| 374 |
-
*
|
| 375 |
-
*
|
| 376 |
-
*
|
| 377 |
-
* - `succeed(input, expected)` asserts the encoded output equals `expected`.
|
| 378 |
-
* - `fail(input, message)` asserts encoding fails and the stringified issue
|
| 379 |
-
* equals `message`.
|
| 380 |
-
* - `provide(key, impl)` returns a new `Encoding` with the service injected
|
| 381 |
-
* into the encoding context.
|
| 382 |
*
|
| 383 |
* **Example** (Encoding assertions)
|
| 384 |
*
|
|
@@ -393,19 +357,20 @@ export class Decoding {
|
|
| 393 |
* @see {@link Asserts}
|
| 394 |
* @see {@link Decoding}
|
| 395 |
*
|
|
|
|
| 396 |
* @since 4.0.0
|
| 397 |
*/
|
| 398 |
-
class Encoding {
|
| 399 |
schema;
|
| 400 |
encodeUnknownEffect;
|
| 401 |
options;
|
| 402 |
constructor(schema, options) {
|
| 403 |
this.schema = schema;
|
| 404 |
-
this.encodeUnknownEffect =
|
| 405 |
this.options = options;
|
| 406 |
}
|
| 407 |
async succeed(input, expected) {
|
| 408 |
-
const r = await Effect.runPromise(this.encodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.
|
| 409 |
expected = arguments.length === 1 ? input : expected;
|
| 410 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 411 |
}
|
|
@@ -413,6 +378,10 @@ class Encoding {
|
|
| 413 |
* Asserts that encoding `input` fails and the stringified issue equals
|
| 414 |
* `message`.
|
| 415 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
* **Example** (Asserting an encoding failure)
|
| 417 |
*
|
| 418 |
* ```ts
|
|
@@ -422,17 +391,19 @@ class Encoding {
|
|
| 422 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 423 |
* await encoding.fail("not-a-number", "Expected number, got \"not-a-number\"")
|
| 424 |
* ```
|
|
|
|
|
|
|
| 425 |
*/
|
| 426 |
async fail(input, message) {
|
| 427 |
-
const r = await Effect.runPromise(this.encodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.
|
| 428 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 429 |
}
|
| 430 |
/**
|
| 431 |
-
* Returns a new {@link Encoding} instance with the given service injected
|
| 432 |
-
*
|
| 433 |
-
*
|
| 434 |
*
|
| 435 |
-
*
|
| 436 |
*
|
| 437 |
* @see {@link Decoding.provide}
|
| 438 |
*/
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Provides helpers for testing Schema behavior.
|
|
|
|
|
|
|
| 3 |
*
|
| 4 |
+
* These utilities assert how schemas construct values, decode input, encode
|
| 5 |
+
* output, generate arbitrary values, and round-trip between encoded and decoded
|
| 6 |
+
* forms. The `Asserts` class groups the common checks for one schema, while
|
| 7 |
+
* `Decoding` and `Encoding` can be used directly when a test only needs one
|
| 8 |
+
* direction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
*
|
| 10 |
* @since 4.0.0
|
| 11 |
*/
|
|
|
|
| 14 |
import * as Record from "../Record.js";
|
| 15 |
import * as Result from "../Result.js";
|
| 16 |
import * as Schema from "../Schema.js";
|
| 17 |
+
import * as SchemaAST from "../SchemaAST.js";
|
| 18 |
+
import * as SchemaParser from "../SchemaParser.js";
|
| 19 |
import * as FastCheck from "../testing/FastCheck.js";
|
| 20 |
/**
|
| 21 |
+
* Provides schema test assertions for decoding, encoding, make, arbitrary generation, and round-trip verification.
|
| 22 |
+
*
|
| 23 |
+
* **When to use**
|
| 24 |
*
|
| 25 |
+
* Use when writing schema unit tests for decoding, encoding, construction, property-based round-trip, or generation behavior.
|
|
|
|
|
|
|
|
|
|
| 26 |
*
|
| 27 |
* **Example** (Decoding and encoding a struct)
|
| 28 |
*
|
|
|
|
| 42 |
*
|
| 43 |
* @see {@link Decoding}
|
| 44 |
* @see {@link Encoding}
|
| 45 |
+
* @category testing
|
| 46 |
* @since 4.0.0
|
| 47 |
*/
|
| 48 |
export class Asserts {
|
| 49 |
/**
|
| 50 |
+
* Static helpers for comparing schema AST structures.
|
| 51 |
+
*
|
| 52 |
+
* **When to use**
|
| 53 |
+
*
|
| 54 |
+
* Use to assert that two schema field or tuple element definitions produce
|
| 55 |
+
* the same AST structure.
|
| 56 |
+
*
|
| 57 |
+
* **Details**
|
| 58 |
*
|
| 59 |
+
* `ast.fields.equals(a, b)` compares struct field ASTs via `assert.deepStrictEqual`. `ast.elements.equals(a, b)` compares tuple element ASTs via `assert.deepStrictEqual`.
|
|
|
|
|
|
|
|
|
|
| 60 |
*
|
| 61 |
* **Example** (Comparing struct fields)
|
| 62 |
*
|
|
|
|
| 72 |
static ast = {
|
| 73 |
fields: {
|
| 74 |
equals: (a, b) => {
|
| 75 |
+
assert.deepStrictEqual(Record.map(a, SchemaAST.getAST), Record.map(b, SchemaAST.getAST));
|
| 76 |
}
|
| 77 |
},
|
| 78 |
elements: {
|
| 79 |
equals: (a, b) => {
|
| 80 |
+
assert.deepStrictEqual(a.map(SchemaAST.getAST), b.map(SchemaAST.getAST));
|
| 81 |
}
|
| 82 |
}
|
| 83 |
};
|
|
|
|
| 86 |
this.schema = schema;
|
| 87 |
}
|
| 88 |
/**
|
| 89 |
+
* Returns an object with `succeed` and `fail` helpers for testing the schema's `make` operation.
|
| 90 |
+
*
|
| 91 |
+
* **When to use**
|
| 92 |
+
*
|
| 93 |
+
* Use to assert how `Schema.make` accepts, transforms, or rejects
|
| 94 |
+
* construction input for this schema.
|
| 95 |
+
*
|
| 96 |
+
* **Details**
|
| 97 |
*
|
| 98 |
+
* `succeed(input)` asserts make returns the input unchanged. `succeed(input, expected)` asserts make returns `expected`. `fail(input, message)` asserts make fails with `message`.
|
|
|
|
|
|
|
| 99 |
*
|
| 100 |
* **Example** (Testing make)
|
| 101 |
*
|
|
|
|
| 107 |
* const asserts = new TestSchema.Asserts(schema)
|
| 108 |
* await asserts.make().succeed("hello")
|
| 109 |
* ```
|
| 110 |
+
*
|
| 111 |
+
* @see {@link decoding} for assertions against decoded input
|
| 112 |
+
* @see {@link encoding} for assertions against encoded output
|
| 113 |
*/
|
| 114 |
make(options) {
|
| 115 |
+
const makeEffect = SchemaParser.makeEffect(this.schema);
|
| 116 |
async function succeed(input, expected) {
|
| 117 |
+
const r = await Effect.runPromise(makeEffect(input, options).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 118 |
expected = arguments.length === 1 ? input : expected;
|
| 119 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 120 |
}
|
| 121 |
return {
|
| 122 |
succeed,
|
| 123 |
async fail(input, message) {
|
| 124 |
+
const r = await Effect.runPromise(makeEffect(input, options).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 125 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 126 |
}
|
| 127 |
};
|
| 128 |
}
|
| 129 |
/**
|
| 130 |
+
* Runs a property-based test that encodes arbitrary values and then decodes them, asserting the decoded value equals the original.
|
| 131 |
+
*
|
| 132 |
+
* **When to use**
|
| 133 |
+
*
|
| 134 |
+
* Use to verify that generated schema values survive an encode-then-decode
|
| 135 |
+
* round trip.
|
| 136 |
+
*
|
| 137 |
+
* **Details**
|
| 138 |
*
|
| 139 |
+
* FastCheck generates arbitrary values matching the schema's `Type`. The assertion fails if any generated value does not round-trip. Pass `options.params` to control FastCheck parameters such as `numRuns`.
|
|
|
|
|
|
|
| 140 |
*
|
| 141 |
* **Example** (Round-trip verification)
|
| 142 |
*
|
|
|
|
| 147 |
* const asserts = new TestSchema.Asserts(Schema.NumberFromString)
|
| 148 |
* await asserts.verifyLosslessTransformation()
|
| 149 |
* ```
|
| 150 |
+
*
|
| 151 |
+
* @see {@link arbitrary} for checking that generated values satisfy the schema
|
| 152 |
*/
|
| 153 |
verifyLosslessTransformation(options) {
|
| 154 |
+
const decodeUnknownEffect = SchemaParser.decodeUnknownEffect(this.schema);
|
| 155 |
+
const encodeEffect = SchemaParser.encodeEffect(this.schema);
|
| 156 |
const arbitrary = Schema.toArbitrary(this.schema);
|
| 157 |
return FastCheck.assert(FastCheck.asyncProperty(arbitrary, async t => {
|
| 158 |
+
const r = await Effect.runPromise(encodeEffect(t).pipe(Effect.flatMapEager(e => decodeUnknownEffect(e)), Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 159 |
assert.deepStrictEqual(r, Result.succeed(t));
|
| 160 |
}), options?.params);
|
| 161 |
}
|
| 162 |
/**
|
| 163 |
+
* Returns a {@link Decoding} instance for this schema with helpers for decoding assertions.
|
| 164 |
+
*
|
| 165 |
+
* **When to use**
|
| 166 |
+
*
|
| 167 |
+
* Use to test how unknown input is decoded into the schema's type.
|
| 168 |
*
|
| 169 |
+
* **Details**
|
| 170 |
+
*
|
| 171 |
+
* Pass `parseOptions` to control error reporting, for example `{ errors: "all" }`.
|
| 172 |
*
|
| 173 |
* **Example** (Decoding assertions)
|
| 174 |
*
|
|
|
|
| 183 |
* ```
|
| 184 |
*
|
| 185 |
* @see {@link Decoding}
|
| 186 |
+
* @see {@link encoding} for assertions in the opposite direction
|
| 187 |
*/
|
| 188 |
decoding(options) {
|
| 189 |
return new Decoding(this.schema, options);
|
| 190 |
}
|
| 191 |
/**
|
| 192 |
+
* Returns an {@link Encoding} instance for this schema with helpers for encoding assertions.
|
| 193 |
+
*
|
| 194 |
+
* **When to use**
|
| 195 |
+
*
|
| 196 |
+
* Use to test how schema values are encoded into their external form.
|
| 197 |
+
*
|
| 198 |
+
* **Details**
|
| 199 |
*
|
| 200 |
+
* Pass `parseOptions` to control error reporting, for example `{ errors: "all" }`.
|
| 201 |
*
|
| 202 |
* **Example** (Encoding assertions)
|
| 203 |
*
|
|
|
|
| 211 |
* ```
|
| 212 |
*
|
| 213 |
* @see {@link Encoding}
|
| 214 |
+
* @see {@link decoding} for assertions in the opposite direction
|
| 215 |
*/
|
| 216 |
encoding(options) {
|
| 217 |
return new Encoding(this.schema, options);
|
| 218 |
}
|
| 219 |
/**
|
| 220 |
+
* Returns an object with property-based testing helpers for the schema's arbitrary generator.
|
| 221 |
+
*
|
| 222 |
+
* **When to use**
|
| 223 |
+
*
|
| 224 |
+
* Use to verify that arbitrary values generated for this schema satisfy the
|
| 225 |
+
* schema's predicate.
|
| 226 |
+
*
|
| 227 |
+
* **Details**
|
| 228 |
*
|
| 229 |
+
* `verifyGeneration()` generates arbitrary values and asserts each value satisfies the schema's `is` predicate. It defaults to 20 runs. Pass `options.params` to override FastCheck parameters.
|
|
|
|
|
|
|
| 230 |
*
|
| 231 |
* **Example** (Verifying arbitrary generation)
|
| 232 |
*
|
|
|
|
| 237 |
* const asserts = new TestSchema.Asserts(Schema.String)
|
| 238 |
* asserts.arbitrary().verifyGeneration()
|
| 239 |
* ```
|
| 240 |
+
*
|
| 241 |
+
* @see {@link verifyLosslessTransformation} for property-based round-trip checks
|
| 242 |
*/
|
| 243 |
arbitrary() {
|
| 244 |
const schema = this.schema;
|
|
|
|
| 256 |
}
|
| 257 |
}
|
| 258 |
/**
|
| 259 |
+
* Provides decoding test assertions through `succeed` and `fail` methods that run the schema's decoder and compare the result.
|
| 260 |
+
*
|
| 261 |
+
* **When to use**
|
| 262 |
*
|
| 263 |
+
* Use when you want to assert that specific inputs decode to expected values, invalid inputs produce specific error messages, or schemas receive required decoding services.
|
|
|
|
|
|
|
|
|
|
| 264 |
*
|
| 265 |
+
* **Details**
|
| 266 |
+
*
|
| 267 |
+
* All assertions are async and use `assert.deepStrictEqual` internally. `succeed(input)` asserts the decoded output equals `input`; `succeed(input, expected)` asserts it equals `expected`; `fail(input, message)` asserts decoding fails and the stringified issue equals `message`. `provide(key, impl)` returns a new `Decoding` with the service injected into the decoding context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
*
|
| 269 |
* **Example** (Decoding with service provision)
|
| 270 |
*
|
|
|
|
| 279 |
*
|
| 280 |
* @see {@link Asserts}
|
| 281 |
* @see {@link Encoding}
|
| 282 |
+
* @category testing
|
| 283 |
* @since 4.0.0
|
| 284 |
*/
|
| 285 |
export class Decoding {
|
|
|
|
| 288 |
options;
|
| 289 |
constructor(schema, options) {
|
| 290 |
this.schema = schema;
|
| 291 |
+
this.decodeUnknownEffect = SchemaParser.decodeUnknownEffect(schema);
|
| 292 |
this.options = options;
|
| 293 |
}
|
| 294 |
async succeed(input, expected) {
|
| 295 |
+
const r = await Effect.runPromise(this.decodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 296 |
expected = arguments.length === 1 ? input : expected;
|
| 297 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 298 |
}
|
|
|
|
| 300 |
* Asserts that decoding `input` fails and the stringified issue equals
|
| 301 |
* `message`.
|
| 302 |
*
|
| 303 |
+
* **When to use**
|
| 304 |
+
*
|
| 305 |
+
* Use to verify that invalid decoding input produces the expected issue text.
|
| 306 |
+
*
|
| 307 |
* **Example** (Asserting a decoding failure)
|
| 308 |
*
|
| 309 |
* ```ts
|
|
|
|
| 313 |
* const decoding = new TestSchema.Asserts(Schema.String).decoding()
|
| 314 |
* await decoding.fail(42, "Expected string, got 42")
|
| 315 |
* ```
|
| 316 |
+
*
|
| 317 |
+
* @see {@link succeed} for asserting successful decoding
|
| 318 |
*/
|
| 319 |
async fail(input, message) {
|
| 320 |
+
const r = await Effect.runPromise(this.decodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 321 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 322 |
}
|
| 323 |
/**
|
| 324 |
+
* Returns a new {@link Decoding} instance with the given service injected into the decoding effect context.
|
|
|
|
|
|
|
| 325 |
*
|
| 326 |
+
* **When to use**
|
| 327 |
+
*
|
| 328 |
+
* Use when the schema's decoder requires a service dependency.
|
| 329 |
*
|
| 330 |
* @see {@link Encoding.provide}
|
| 331 |
*/
|
|
|
|
| 334 |
}
|
| 335 |
}
|
| 336 |
/**
|
| 337 |
+
* Provides encoding test assertions through `succeed` and `fail` methods that run the schema's encoder and compare the result.
|
| 338 |
+
*
|
| 339 |
+
* **When to use**
|
| 340 |
*
|
| 341 |
+
* Use when you want to assert that specific values encode to expected outputs, invalid inputs produce specific error messages, or schemas receive required encoding services.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
*
|
| 343 |
+
* **Details**
|
| 344 |
+
*
|
| 345 |
+
* All assertions are async and use `assert.deepStrictEqual` internally. `succeed(input)` asserts the encoded output equals `input`; `succeed(input, expected)` asserts it equals `expected`; `fail(input, message)` asserts encoding fails and the stringified issue equals `message`. `provide(key, impl)` returns a new `Encoding` with the service injected into the encoding context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
*
|
| 347 |
* **Example** (Encoding assertions)
|
| 348 |
*
|
|
|
|
| 357 |
* @see {@link Asserts}
|
| 358 |
* @see {@link Decoding}
|
| 359 |
*
|
| 360 |
+
* @category testing
|
| 361 |
* @since 4.0.0
|
| 362 |
*/
|
| 363 |
+
export class Encoding {
|
| 364 |
schema;
|
| 365 |
encodeUnknownEffect;
|
| 366 |
options;
|
| 367 |
constructor(schema, options) {
|
| 368 |
this.schema = schema;
|
| 369 |
+
this.encodeUnknownEffect = SchemaParser.encodeUnknownEffect(schema);
|
| 370 |
this.options = options;
|
| 371 |
}
|
| 372 |
async succeed(input, expected) {
|
| 373 |
+
const r = await Effect.runPromise(this.encodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 374 |
expected = arguments.length === 1 ? input : expected;
|
| 375 |
assert.deepStrictEqual(r, Result.succeed(expected));
|
| 376 |
}
|
|
|
|
| 378 |
* Asserts that encoding `input` fails and the stringified issue equals
|
| 379 |
* `message`.
|
| 380 |
*
|
| 381 |
+
* **When to use**
|
| 382 |
+
*
|
| 383 |
+
* Use to verify that invalid encoding input produces the expected issue text.
|
| 384 |
+
*
|
| 385 |
* **Example** (Asserting an encoding failure)
|
| 386 |
*
|
| 387 |
* ```ts
|
|
|
|
| 391 |
* const encoding = new TestSchema.Asserts(Schema.NumberFromString).encoding()
|
| 392 |
* await encoding.fail("not-a-number", "Expected number, got \"not-a-number\"")
|
| 393 |
* ```
|
| 394 |
+
*
|
| 395 |
+
* @see {@link succeed} for asserting successful encoding
|
| 396 |
*/
|
| 397 |
async fail(input, message) {
|
| 398 |
+
const r = await Effect.runPromise(this.encodeUnknownEffect(input, this.options?.parseOptions).pipe(Effect.mapErrorEager(issue => issue.toString()), Effect.result));
|
| 399 |
assert.deepStrictEqual(r, Result.fail(message));
|
| 400 |
}
|
| 401 |
/**
|
| 402 |
+
* Returns a new {@link Encoding} instance with the given service injected into the encoding effect context.
|
| 403 |
+
*
|
| 404 |
+
* **When to use**
|
| 405 |
*
|
| 406 |
+
* Use when the schema's encoder requires a service dependency.
|
| 407 |
*
|
| 408 |
* @see {@link Decoding.provide}
|
| 409 |
*/
|
.opencode/node_modules/effect/dist/testing/TestSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"TestSchema.js","names":["assert","Effect","Record","Result","Schema","
|
|
|
|
| 1 |
+
{"version":3,"file":"TestSchema.js","names":["assert","Effect","Record","Result","Schema","SchemaAST","SchemaParser","FastCheck","Asserts","ast","fields","equals","a","b","deepStrictEqual","map","getAST","elements","schema","constructor","make","options","makeEffect","succeed","input","expected","r","runPromise","pipe","mapErrorEager","issue","toString","result","arguments","length","fail","message","verifyLosslessTransformation","decodeUnknownEffect","encodeEffect","arbitrary","toArbitrary","asyncProperty","t","flatMapEager","e","params","decoding","Decoding","encoding","Encoding","verifyGeneration","is","arb","property","numRuns","parseOptions","provide","service","implementation","middlewareDecoding","provideService","encodeUnknownEffect","middlewareEncoding"],"sources":["../../src/testing/TestSchema.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAKA,MAAM,MAA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IAAI,CAC9D3B,MAAM,CAAC4B,aAAa,CAAEC,KAAK,IAAKA,KAAK,CAACC,QAAQ,EAAE,CAAC,EACjD9B,MAAM,CAAC+B,MAAM,CACd,CACF;IACDhC,MAAM,CAACc,eAAe,CAACY,CAAC,EAAEvB,MAAM,CAACgC,IAAI,CAACC,OAAO,CAAC,CAAC;EACjD;EACA;;;;;;;;;EASAqB,OAAOA,CACLC,OAAiC,EACjCC,cAAuB;IAEvB,OAAO,IAAIT,QAAQ,CACjB,IAAI,CAAChC,MAAM,CAACU,IAAI,CAACxB,MAAM,CAAC2D,kBAAkB,CAAC9D,MAAM,CAAC4D,cAAc,CAACH,OAAO,EAAEC,cAAc,CAAC,CAAC,CAAC,EAC3F,IAAI,CAACtC,OAAO,CACb;EACH","ignoreList":[]}
|
.opencode/node_modules/effect/dist/testing/index.d.ts
CHANGED
|
@@ -2,14 +2,6 @@
|
|
| 2 |
* @since 4.0.0
|
| 3 |
*/
|
| 4 |
/**
|
| 5 |
-
* This module provides a re-export of the fast-check library for property-based testing.
|
| 6 |
-
* Fast-check is a property-based testing framework that generates random test cases
|
| 7 |
-
* to validate that properties hold true for a wide range of inputs.
|
| 8 |
-
*
|
| 9 |
-
* Property-based testing is a testing methodology where you specify properties that
|
| 10 |
-
* should hold true for your functions, and the framework generates many random test
|
| 11 |
-
* cases to try to find counterexamples.
|
| 12 |
-
*
|
| 13 |
* @since 3.10.0
|
| 14 |
*/
|
| 15 |
export * as FastCheck from "./FastCheck.ts";
|
|
@@ -22,71 +14,6 @@ export * as TestClock from "./TestClock.ts";
|
|
| 22 |
*/
|
| 23 |
export * as TestConsole from "./TestConsole.ts";
|
| 24 |
/**
|
| 25 |
-
* Testing utilities for asserting Schema decoding, encoding, make, and
|
| 26 |
-
* arbitrary-generation behavior. Used in unit tests to verify that schemas
|
| 27 |
-
* accept, reject, and round-trip values correctly.
|
| 28 |
-
*
|
| 29 |
-
* ## Mental model
|
| 30 |
-
*
|
| 31 |
-
* - **Asserts** – entry point: wraps a schema and exposes helpers grouped by
|
| 32 |
-
* operation (decoding, encoding, make, arbitrary, round-trip).
|
| 33 |
-
* - **Decoding** – returned by `asserts.decoding()`; has `succeed` / `fail`
|
| 34 |
-
* helpers that run the schema's decoder and compare the result.
|
| 35 |
-
* - **Encoding** – returned by `asserts.encoding()`; mirrors {@link Decoding}
|
| 36 |
-
* but exercises the encoder direction.
|
| 37 |
-
* - Every assertion is async (`Promise<void>`) because parsing may involve
|
| 38 |
-
* effectful schemas.
|
| 39 |
-
* - `succeed` with one argument asserts identity (output equals input);
|
| 40 |
-
* with two arguments asserts a specific expected output.
|
| 41 |
-
* - `fail` always takes the input and the expected error message string.
|
| 42 |
-
*
|
| 43 |
-
* ## Common tasks
|
| 44 |
-
*
|
| 45 |
-
* - Assert decoding succeeds / fails → `new Asserts(schema).decoding().succeed(…)` / `.fail(…)`
|
| 46 |
-
* - Assert encoding succeeds / fails → `new Asserts(schema).encoding().succeed(…)` / `.fail(…)`
|
| 47 |
-
* - Assert make succeeds / fails → `new Asserts(schema).make().succeed(…)` / `.fail(…)`
|
| 48 |
-
* - Verify round-trip (encode then decode) → `new Asserts(schema).verifyLosslessTransformation()`
|
| 49 |
-
* - Verify arbitrary generation → `new Asserts(schema).arbitrary().verifyGeneration()`
|
| 50 |
-
* - Compare AST of struct fields → `Asserts.ast.fields.equals(a, b)`
|
| 51 |
-
* - Provide a service dependency for decoding → `asserts.decoding().provide(key, impl)`
|
| 52 |
-
*
|
| 53 |
-
* ## Gotchas
|
| 54 |
-
*
|
| 55 |
-
* - `succeed` uses `assert.deepStrictEqual`, so reference equality is not
|
| 56 |
-
* required but structural equality is.
|
| 57 |
-
* - `fail` compares against the stringified `Issue`, not the `Issue` object
|
| 58 |
-
* itself. Pass the exact multiline string the issue produces.
|
| 59 |
-
* - `verifyLosslessTransformation` and `arbitrary().verifyGeneration` run
|
| 60 |
-
* property-based tests via FastCheck; default run count is 20 for
|
| 61 |
-
* `verifyGeneration`.
|
| 62 |
-
*
|
| 63 |
-
* ## Quickstart
|
| 64 |
-
*
|
| 65 |
-
* **Example** (Basic decoding and encoding assertions)
|
| 66 |
-
*
|
| 67 |
-
* ```ts
|
| 68 |
-
* import { Schema } from "effect"
|
| 69 |
-
* import { TestSchema } from "effect/testing"
|
| 70 |
-
*
|
| 71 |
-
* const schema = Schema.NumberFromString
|
| 72 |
-
* const asserts = new TestSchema.Asserts(schema)
|
| 73 |
-
*
|
| 74 |
-
* // decoding
|
| 75 |
-
* const decoding = asserts.decoding()
|
| 76 |
-
* await decoding.succeed("1", 1)
|
| 77 |
-
* await decoding.fail(null, "Expected string, got null")
|
| 78 |
-
*
|
| 79 |
-
* // encoding
|
| 80 |
-
* const encoding = asserts.encoding()
|
| 81 |
-
* await encoding.succeed(1, "1")
|
| 82 |
-
* ```
|
| 83 |
-
*
|
| 84 |
-
* ## See also
|
| 85 |
-
*
|
| 86 |
-
* - {@link Asserts}
|
| 87 |
-
* - {@link Decoding}
|
| 88 |
-
* - {@link Encoding}
|
| 89 |
-
*
|
| 90 |
* @since 4.0.0
|
| 91 |
*/
|
| 92 |
export * as TestSchema from "./TestSchema.ts";
|
|
|
|
| 2 |
* @since 4.0.0
|
| 3 |
*/
|
| 4 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
* @since 3.10.0
|
| 6 |
*/
|
| 7 |
export * as FastCheck from "./FastCheck.ts";
|
|
|
|
| 14 |
*/
|
| 15 |
export * as TestConsole from "./TestConsole.ts";
|
| 16 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
* @since 4.0.0
|
| 18 |
*/
|
| 19 |
export * as TestSchema from "./TestSchema.ts";
|
.opencode/node_modules/effect/dist/testing/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA"}
|
.opencode/node_modules/effect/dist/testing/index.js
CHANGED
|
@@ -3,14 +3,6 @@
|
|
| 3 |
*/
|
| 4 |
// @barrel: Auto-generated exports. Do not edit manually.
|
| 5 |
/**
|
| 6 |
-
* This module provides a re-export of the fast-check library for property-based testing.
|
| 7 |
-
* Fast-check is a property-based testing framework that generates random test cases
|
| 8 |
-
* to validate that properties hold true for a wide range of inputs.
|
| 9 |
-
*
|
| 10 |
-
* Property-based testing is a testing methodology where you specify properties that
|
| 11 |
-
* should hold true for your functions, and the framework generates many random test
|
| 12 |
-
* cases to try to find counterexamples.
|
| 13 |
-
*
|
| 14 |
* @since 3.10.0
|
| 15 |
*/
|
| 16 |
export * as FastCheck from "./FastCheck.js";
|
|
@@ -23,71 +15,6 @@ export * as TestClock from "./TestClock.js";
|
|
| 23 |
*/
|
| 24 |
export * as TestConsole from "./TestConsole.js";
|
| 25 |
/**
|
| 26 |
-
* Testing utilities for asserting Schema decoding, encoding, make, and
|
| 27 |
-
* arbitrary-generation behavior. Used in unit tests to verify that schemas
|
| 28 |
-
* accept, reject, and round-trip values correctly.
|
| 29 |
-
*
|
| 30 |
-
* ## Mental model
|
| 31 |
-
*
|
| 32 |
-
* - **Asserts** – entry point: wraps a schema and exposes helpers grouped by
|
| 33 |
-
* operation (decoding, encoding, make, arbitrary, round-trip).
|
| 34 |
-
* - **Decoding** – returned by `asserts.decoding()`; has `succeed` / `fail`
|
| 35 |
-
* helpers that run the schema's decoder and compare the result.
|
| 36 |
-
* - **Encoding** – returned by `asserts.encoding()`; mirrors {@link Decoding}
|
| 37 |
-
* but exercises the encoder direction.
|
| 38 |
-
* - Every assertion is async (`Promise<void>`) because parsing may involve
|
| 39 |
-
* effectful schemas.
|
| 40 |
-
* - `succeed` with one argument asserts identity (output equals input);
|
| 41 |
-
* with two arguments asserts a specific expected output.
|
| 42 |
-
* - `fail` always takes the input and the expected error message string.
|
| 43 |
-
*
|
| 44 |
-
* ## Common tasks
|
| 45 |
-
*
|
| 46 |
-
* - Assert decoding succeeds / fails → `new Asserts(schema).decoding().succeed(…)` / `.fail(…)`
|
| 47 |
-
* - Assert encoding succeeds / fails → `new Asserts(schema).encoding().succeed(…)` / `.fail(…)`
|
| 48 |
-
* - Assert make succeeds / fails → `new Asserts(schema).make().succeed(…)` / `.fail(…)`
|
| 49 |
-
* - Verify round-trip (encode then decode) → `new Asserts(schema).verifyLosslessTransformation()`
|
| 50 |
-
* - Verify arbitrary generation → `new Asserts(schema).arbitrary().verifyGeneration()`
|
| 51 |
-
* - Compare AST of struct fields → `Asserts.ast.fields.equals(a, b)`
|
| 52 |
-
* - Provide a service dependency for decoding → `asserts.decoding().provide(key, impl)`
|
| 53 |
-
*
|
| 54 |
-
* ## Gotchas
|
| 55 |
-
*
|
| 56 |
-
* - `succeed` uses `assert.deepStrictEqual`, so reference equality is not
|
| 57 |
-
* required but structural equality is.
|
| 58 |
-
* - `fail` compares against the stringified `Issue`, not the `Issue` object
|
| 59 |
-
* itself. Pass the exact multiline string the issue produces.
|
| 60 |
-
* - `verifyLosslessTransformation` and `arbitrary().verifyGeneration` run
|
| 61 |
-
* property-based tests via FastCheck; default run count is 20 for
|
| 62 |
-
* `verifyGeneration`.
|
| 63 |
-
*
|
| 64 |
-
* ## Quickstart
|
| 65 |
-
*
|
| 66 |
-
* **Example** (Basic decoding and encoding assertions)
|
| 67 |
-
*
|
| 68 |
-
* ```ts
|
| 69 |
-
* import { Schema } from "effect"
|
| 70 |
-
* import { TestSchema } from "effect/testing"
|
| 71 |
-
*
|
| 72 |
-
* const schema = Schema.NumberFromString
|
| 73 |
-
* const asserts = new TestSchema.Asserts(schema)
|
| 74 |
-
*
|
| 75 |
-
* // decoding
|
| 76 |
-
* const decoding = asserts.decoding()
|
| 77 |
-
* await decoding.succeed("1", 1)
|
| 78 |
-
* await decoding.fail(null, "Expected string, got null")
|
| 79 |
-
*
|
| 80 |
-
* // encoding
|
| 81 |
-
* const encoding = asserts.encoding()
|
| 82 |
-
* await encoding.succeed(1, "1")
|
| 83 |
-
* ```
|
| 84 |
-
*
|
| 85 |
-
* ## See also
|
| 86 |
-
*
|
| 87 |
-
* - {@link Asserts}
|
| 88 |
-
* - {@link Decoding}
|
| 89 |
-
* - {@link Encoding}
|
| 90 |
-
*
|
| 91 |
* @since 4.0.0
|
| 92 |
*/
|
| 93 |
export * as TestSchema from "./TestSchema.js";
|
|
|
|
| 3 |
*/
|
| 4 |
// @barrel: Auto-generated exports. Do not edit manually.
|
| 5 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
* @since 3.10.0
|
| 7 |
*/
|
| 8 |
export * as FastCheck from "./FastCheck.js";
|
|
|
|
| 15 |
*/
|
| 16 |
export * as TestConsole from "./TestConsole.js";
|
| 17 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
* @since 4.0.0
|
| 19 |
*/
|
| 20 |
export * as TestSchema from "./TestSchema.js";
|
.opencode/node_modules/effect/dist/testing/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"index.js","names":["FastCheck","TestClock","TestConsole","TestSchema"],"sources":["../../src/testing/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","names":["FastCheck","TestClock","TestConsole","TestSchema"],"sources":["../../src/testing/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAKA,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,UAAU,MAAM,iBAAiB","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/AiError.d.ts
CHANGED
|
@@ -1,82 +1,15 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* for AI operations.
|
| 4 |
-
*
|
| 5 |
-
* This module uses the `reason` pattern where `AiError` is a top-level
|
| 6 |
-
* wrapper error containing `module`, `method`, and a `reason` field that holds
|
| 7 |
-
* the semantic error. This design enables ergonomic error handling while
|
| 8 |
-
* preserving rich context about failures.
|
| 9 |
-
*
|
| 10 |
-
* ## Semantic Error Categories
|
| 11 |
-
*
|
| 12 |
-
* - **RateLimitError** - Request throttled (429s, provider-specific limits)
|
| 13 |
-
* - **QuotaExhaustedError** - Account/billing limits reached
|
| 14 |
-
* - **AuthenticationError** - Invalid/expired credentials
|
| 15 |
-
* - **ContentPolicyError** - Input/output violated content policy
|
| 16 |
-
* - **InvalidRequestError** - Malformed request parameters
|
| 17 |
-
* - **InvalidUserInputError** - Prompt contains unsupported content
|
| 18 |
-
* - **InternalProviderError** - Provider-side failures (5xx)
|
| 19 |
-
* - **NetworkError** - Transport-level failures
|
| 20 |
-
* - **InvalidOutputError** - LLM output parsing/validation failures
|
| 21 |
-
* - **StructuredOutputError** - LLM generated text that doesn't conform to structured output schema
|
| 22 |
-
* - **UnsupportedSchemaError** - Codec transformer rejected a schema with unsupported constructs
|
| 23 |
-
* - **UnknownError** - Catch-all for unknown errors
|
| 24 |
-
*
|
| 25 |
-
* ## Tool Call Errors
|
| 26 |
-
*
|
| 27 |
-
* - **ToolNotFoundError** - Model requested non-existent tool
|
| 28 |
-
* - **ToolParameterValidationError** - Tool call params failed validation
|
| 29 |
-
* - **InvalidToolResultError** - Tool handler returned invalid result
|
| 30 |
-
* - **ToolResultEncodingError** - Tool result encoding failed
|
| 31 |
-
* - **ToolConfigurationError** - Provider tool misconfigured
|
| 32 |
-
*
|
| 33 |
-
* ## Retryability
|
| 34 |
-
*
|
| 35 |
-
* Each reason type has an `isRetryable` getter indicating whether the error is
|
| 36 |
-
* transient. Some errors also provide a `retryAfter` duration hint.
|
| 37 |
-
*
|
| 38 |
-
* @example
|
| 39 |
-
* ```ts
|
| 40 |
-
* import { Effect, Match } from "effect"
|
| 41 |
-
* import type { AiError } from "effect/unstable/ai"
|
| 42 |
-
*
|
| 43 |
-
* // Handle errors using Match on the reason
|
| 44 |
-
* const handleAiError = Match.type<AiError.AiError>().pipe(
|
| 45 |
-
* Match.when(
|
| 46 |
-
* { reason: { _tag: "RateLimitError" } },
|
| 47 |
-
* (err) => Effect.logWarning(`Rate limited, retry after ${err.retryAfter}`)
|
| 48 |
-
* ),
|
| 49 |
-
* Match.when(
|
| 50 |
-
* { reason: { _tag: "AuthenticationError" } },
|
| 51 |
-
* (err) => Effect.logError(`Auth failed: ${err.reason.kind}`)
|
| 52 |
-
* ),
|
| 53 |
-
* Match.when(
|
| 54 |
-
* { reason: { isRetryable: true } },
|
| 55 |
-
* (err) => Effect.logWarning(`Transient error, retrying: ${err.message}`)
|
| 56 |
-
* ),
|
| 57 |
-
* Match.orElse((err) => Effect.logError(`Permanent error: ${err.message}`))
|
| 58 |
-
* )
|
| 59 |
-
* ```
|
| 60 |
*
|
| 61 |
-
*
|
| 62 |
-
* ``
|
| 63 |
-
*
|
| 64 |
-
*
|
| 65 |
-
*
|
| 66 |
-
*
|
| 67 |
-
*
|
| 68 |
-
* module: "OpenAI",
|
| 69 |
-
* method: "completion",
|
| 70 |
-
* reason: new AiError.RateLimitError({
|
| 71 |
-
* retryAfter: Duration.seconds(60)
|
| 72 |
-
* })
|
| 73 |
-
* })
|
| 74 |
*
|
| 75 |
-
*
|
| 76 |
-
* console.log(error.message) // "OpenAI.completion: Rate limit exceeded. Retry after 1 minute"
|
| 77 |
-
* ```
|
| 78 |
-
*
|
| 79 |
-
* @since 1.0.0
|
| 80 |
*/
|
| 81 |
import * as Duration from "../../Duration.ts";
|
| 82 |
import * as Schema from "../../Schema.ts";
|
|
@@ -97,11 +30,14 @@ declare const NetworkError_base: Schema.Class<NetworkError, Schema.Struct<{
|
|
| 97 |
/**
|
| 98 |
* Error indicating a network-level failure before receiving a response.
|
| 99 |
*
|
|
|
|
|
|
|
| 100 |
* This error is raised when issues arise before receiving an HTTP response,
|
| 101 |
* such as network connectivity problems, request encoding issues, or invalid
|
| 102 |
* URLs.
|
| 103 |
*
|
| 104 |
-
*
|
|
|
|
| 105 |
* ```ts
|
| 106 |
* import { AiError } from "effect/unstable/ai"
|
| 107 |
*
|
|
@@ -122,24 +58,27 @@ declare const NetworkError_base: Schema.Class<NetworkError, Schema.Struct<{
|
|
| 122 |
* // "Transport: Connection timeout after 30 seconds (POST https://api.openai.com/v1/completions)"
|
| 123 |
* ```
|
| 124 |
*
|
| 125 |
-
* @since 1.0.0
|
| 126 |
* @category reason
|
|
|
|
| 127 |
*/
|
| 128 |
export declare class NetworkError extends NetworkError_base {
|
| 129 |
/**
|
| 130 |
-
*
|
|
|
|
|
|
|
| 131 |
*/
|
| 132 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 133 |
/**
|
| 134 |
* Transport errors are retryable; encoding and URL errors are not.
|
| 135 |
*
|
| 136 |
-
* @since
|
| 137 |
*/
|
| 138 |
get isRetryable(): boolean;
|
| 139 |
/**
|
| 140 |
* Creates a NetworkError from a platform HttpClientError.RequestError.
|
| 141 |
*
|
| 142 |
-
*
|
|
|
|
| 143 |
* ```ts
|
| 144 |
* import { AiError } from "effect/unstable/ai"
|
| 145 |
* import type { HttpClientError } from "effect/unstable/http"
|
|
@@ -149,8 +88,7 @@ export declare class NetworkError extends NetworkError_base {
|
|
| 149 |
* const aiError = AiError.NetworkError.fromRequestError(platformError)
|
| 150 |
* ```
|
| 151 |
*
|
| 152 |
-
* @since
|
| 153 |
-
* @category constructors
|
| 154 |
*/
|
| 155 |
static fromRequestError(error: HttpClientError.RequestError): NetworkError;
|
| 156 |
get message(): string;
|
|
@@ -158,110 +96,129 @@ export declare class NetworkError extends NetworkError_base {
|
|
| 158 |
/**
|
| 159 |
* Schema for provider-specific metadata which can be attached to error reasons.
|
| 160 |
*
|
| 161 |
-
*
|
| 162 |
*
|
| 163 |
-
*
|
| 164 |
-
*
|
| 165 |
-
*
|
| 166 |
-
*
|
| 167 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
* }
|
| 169 |
* ```
|
| 170 |
*
|
| 171 |
-
* @since 1.0.0
|
| 172 |
* @category schemas
|
|
|
|
| 173 |
*/
|
| 174 |
export declare const ProviderMetadata: Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson>>>;
|
| 175 |
/**
|
| 176 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
* @category models
|
|
|
|
| 178 |
*/
|
| 179 |
export type ProviderMetadata = typeof ProviderMetadata.Type;
|
| 180 |
/**
|
| 181 |
* Provider-specific metadata attached to `RateLimitError`.
|
| 182 |
*
|
| 183 |
-
* @
|
| 184 |
-
* @
|
| 185 |
*/
|
| 186 |
export interface RateLimitErrorMetadata extends ProviderMetadata {
|
| 187 |
}
|
| 188 |
/**
|
| 189 |
* Provider-specific metadata attached to `QuotaExhaustedError`.
|
| 190 |
*
|
| 191 |
-
* @
|
| 192 |
-
* @
|
| 193 |
*/
|
| 194 |
export interface QuotaExhaustedErrorMetadata extends ProviderMetadata {
|
| 195 |
}
|
| 196 |
/**
|
| 197 |
* Provider-specific metadata attached to `AuthenticationError`.
|
| 198 |
*
|
| 199 |
-
* @
|
| 200 |
-
* @
|
| 201 |
*/
|
| 202 |
export interface AuthenticationErrorMetadata extends ProviderMetadata {
|
| 203 |
}
|
| 204 |
/**
|
| 205 |
* Provider-specific metadata attached to `ContentPolicyError`.
|
| 206 |
*
|
| 207 |
-
* @
|
| 208 |
-
* @
|
| 209 |
*/
|
| 210 |
export interface ContentPolicyErrorMetadata extends ProviderMetadata {
|
| 211 |
}
|
| 212 |
/**
|
| 213 |
* Provider-specific metadata attached to `InvalidRequestError`.
|
| 214 |
*
|
| 215 |
-
* @
|
| 216 |
-
* @
|
| 217 |
*/
|
| 218 |
export interface InvalidRequestErrorMetadata extends ProviderMetadata {
|
| 219 |
}
|
| 220 |
/**
|
| 221 |
* Provider-specific metadata attached to `InternalProviderError`.
|
| 222 |
*
|
| 223 |
-
* @
|
| 224 |
-
* @
|
| 225 |
*/
|
| 226 |
export interface InternalProviderErrorMetadata extends ProviderMetadata {
|
| 227 |
}
|
| 228 |
/**
|
| 229 |
* Provider-specific metadata attached to `InvalidOutputError`.
|
| 230 |
*
|
| 231 |
-
* @
|
| 232 |
-
* @
|
| 233 |
*/
|
| 234 |
export interface InvalidOutputErrorMetadata extends ProviderMetadata {
|
| 235 |
}
|
| 236 |
/**
|
| 237 |
* Provider-specific metadata attached to `StructuredOutputError`.
|
| 238 |
*
|
| 239 |
-
* @
|
| 240 |
-
* @
|
| 241 |
*/
|
| 242 |
export interface StructuredOutputErrorMetadata extends ProviderMetadata {
|
| 243 |
}
|
| 244 |
/**
|
| 245 |
* Provider-specific metadata attached to `UnsupportedSchemaError`.
|
| 246 |
*
|
| 247 |
-
* @
|
| 248 |
-
* @
|
| 249 |
*/
|
| 250 |
export interface UnsupportedSchemaErrorMetadata extends ProviderMetadata {
|
| 251 |
}
|
| 252 |
/**
|
| 253 |
* Provider-specific metadata attached to `UnknownError`.
|
| 254 |
*
|
| 255 |
-
* @
|
| 256 |
-
* @
|
| 257 |
*/
|
| 258 |
export interface UnknownErrorMetadata extends ProviderMetadata {
|
| 259 |
}
|
| 260 |
/**
|
| 261 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
*
|
| 263 |
-
* @since 1.0.0
|
| 264 |
* @category schemas
|
|
|
|
| 265 |
*/
|
| 266 |
export declare const UsageInfo: Schema.Struct<{
|
| 267 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
|
@@ -269,10 +226,23 @@ export declare const UsageInfo: Schema.Struct<{
|
|
| 269 |
readonly totalTokens: Schema.optional<Schema.Number>;
|
| 270 |
}>;
|
| 271 |
/**
|
| 272 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
*
|
| 274 |
-
* @since 1.0.0
|
| 275 |
* @category schemas
|
|
|
|
| 276 |
*/
|
| 277 |
export declare const HttpContext: Schema.Struct<{
|
| 278 |
readonly request: Schema.Struct<{
|
|
@@ -291,7 +261,7 @@ export declare const HttpContext: Schema.Struct<{
|
|
| 291 |
declare const RateLimitError_base: Schema.Class<RateLimitError, Schema.Struct<{
|
| 292 |
readonly _tag: Schema.tag<"RateLimitError">;
|
| 293 |
readonly retryAfter: Schema.optional<Schema.Duration>;
|
| 294 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<RateLimitErrorMetadata>>>;
|
| 295 |
readonly http: Schema.optional<Schema.Struct<{
|
| 296 |
readonly request: Schema.Struct<{
|
| 297 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -310,10 +280,13 @@ declare const RateLimitError_base: Schema.Class<RateLimitError, Schema.Struct<{
|
|
| 310 |
/**
|
| 311 |
* Error indicating the request was rate limited.
|
| 312 |
*
|
|
|
|
|
|
|
| 313 |
* Rate limit errors are always retryable. When `retryAfter` is provided,
|
| 314 |
* callers should wait that duration before retrying.
|
| 315 |
*
|
| 316 |
-
*
|
|
|
|
| 317 |
* ```ts
|
| 318 |
* import { Duration } from "effect"
|
| 319 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -326,18 +299,20 @@ declare const RateLimitError_base: Schema.Class<RateLimitError, Schema.Struct<{
|
|
| 326 |
* console.log(rateLimitError.message) // "Rate limit exceeded. Retry after 1 minute"
|
| 327 |
* ```
|
| 328 |
*
|
| 329 |
-
* @since 1.0.0
|
| 330 |
* @category reason
|
|
|
|
| 331 |
*/
|
| 332 |
export declare class RateLimitError extends RateLimitError_base {
|
| 333 |
/**
|
| 334 |
-
*
|
|
|
|
|
|
|
| 335 |
*/
|
| 336 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 337 |
/**
|
| 338 |
* Rate limit errors are always retryable.
|
| 339 |
*
|
| 340 |
-
* @since
|
| 341 |
*/
|
| 342 |
get isRetryable(): boolean;
|
| 343 |
get message(): string;
|
|
@@ -345,7 +320,7 @@ export declare class RateLimitError extends RateLimitError_base {
|
|
| 345 |
declare const QuotaExhaustedError_base: Schema.Class<QuotaExhaustedError, Schema.Struct<{
|
| 346 |
readonly _tag: Schema.tag<"QuotaExhaustedError">;
|
| 347 |
readonly resetAt: Schema.optional<Schema.DateTimeUtc>;
|
| 348 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<QuotaExhaustedErrorMetadata>>>;
|
| 349 |
readonly http: Schema.optional<Schema.Struct<{
|
| 350 |
readonly request: Schema.Struct<{
|
| 351 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -364,9 +339,12 @@ declare const QuotaExhaustedError_base: Schema.Class<QuotaExhaustedError, Schema
|
|
| 364 |
/**
|
| 365 |
* Error indicating account or billing limits have been reached.
|
| 366 |
*
|
|
|
|
|
|
|
| 367 |
* Quota exhausted errors are not retryable without user action.
|
| 368 |
*
|
| 369 |
-
*
|
|
|
|
| 370 |
* ```ts
|
| 371 |
* import { AiError } from "effect/unstable/ai"
|
| 372 |
*
|
|
@@ -377,18 +355,20 @@ declare const QuotaExhaustedError_base: Schema.Class<QuotaExhaustedError, Schema
|
|
| 377 |
* // "Quota exhausted. Check your account billing and usage limits."
|
| 378 |
* ```
|
| 379 |
*
|
| 380 |
-
* @since 1.0.0
|
| 381 |
* @category reason
|
|
|
|
| 382 |
*/
|
| 383 |
export declare class QuotaExhaustedError extends QuotaExhaustedError_base {
|
| 384 |
/**
|
| 385 |
-
*
|
|
|
|
|
|
|
| 386 |
*/
|
| 387 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 388 |
/**
|
| 389 |
* Quota exhausted errors require user action and are not retryable.
|
| 390 |
*
|
| 391 |
-
* @since
|
| 392 |
*/
|
| 393 |
get isRetryable(): boolean;
|
| 394 |
get message(): string;
|
|
@@ -396,7 +376,7 @@ export declare class QuotaExhaustedError extends QuotaExhaustedError_base {
|
|
| 396 |
declare const AuthenticationError_base: Schema.Class<AuthenticationError, Schema.Struct<{
|
| 397 |
readonly _tag: Schema.tag<"AuthenticationError">;
|
| 398 |
readonly kind: Schema.Literals<readonly ["InvalidKey", "ExpiredKey", "MissingKey", "InsufficientPermissions", "Unknown"]>;
|
| 399 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<AuthenticationErrorMetadata>>>;
|
| 400 |
readonly http: Schema.optional<Schema.Struct<{
|
| 401 |
readonly request: Schema.Struct<{
|
| 402 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -415,9 +395,12 @@ declare const AuthenticationError_base: Schema.Class<AuthenticationError, Schema
|
|
| 415 |
/**
|
| 416 |
* Error indicating authentication or authorization failure.
|
| 417 |
*
|
|
|
|
|
|
|
| 418 |
* Authentication errors are never retryable without credential changes.
|
| 419 |
*
|
| 420 |
-
*
|
|
|
|
| 421 |
* ```ts
|
| 422 |
* import { AiError } from "effect/unstable/ai"
|
| 423 |
*
|
|
@@ -430,18 +413,20 @@ declare const AuthenticationError_base: Schema.Class<AuthenticationError, Schema
|
|
| 430 |
* // "InvalidKey: Verify your API key is correct"
|
| 431 |
* ```
|
| 432 |
*
|
| 433 |
-
* @since 1.0.0
|
| 434 |
* @category reason
|
|
|
|
| 435 |
*/
|
| 436 |
export declare class AuthenticationError extends AuthenticationError_base {
|
| 437 |
/**
|
| 438 |
-
*
|
|
|
|
|
|
|
| 439 |
*/
|
| 440 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 441 |
/**
|
| 442 |
* Authentication errors require credential changes and are not retryable.
|
| 443 |
*
|
| 444 |
-
* @since
|
| 445 |
*/
|
| 446 |
get isRetryable(): boolean;
|
| 447 |
get message(): string;
|
|
@@ -449,7 +434,7 @@ export declare class AuthenticationError extends AuthenticationError_base {
|
|
| 449 |
declare const ContentPolicyError_base: Schema.Class<ContentPolicyError, Schema.Struct<{
|
| 450 |
readonly _tag: Schema.tag<"ContentPolicyError">;
|
| 451 |
readonly description: Schema.String;
|
| 452 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<ContentPolicyErrorMetadata>>>;
|
| 453 |
readonly http: Schema.optional<Schema.Struct<{
|
| 454 |
readonly request: Schema.Struct<{
|
| 455 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -468,9 +453,12 @@ declare const ContentPolicyError_base: Schema.Class<ContentPolicyError, Schema.S
|
|
| 468 |
/**
|
| 469 |
* Error indicating content policy violation.
|
| 470 |
*
|
|
|
|
|
|
|
| 471 |
* Content policy errors are never retryable without content changes.
|
| 472 |
*
|
| 473 |
-
*
|
|
|
|
| 474 |
* ```ts
|
| 475 |
* import { AiError } from "effect/unstable/ai"
|
| 476 |
*
|
|
@@ -483,18 +471,20 @@ declare const ContentPolicyError_base: Schema.Class<ContentPolicyError, Schema.S
|
|
| 483 |
* // "Content policy violation: Input contains prohibited content"
|
| 484 |
* ```
|
| 485 |
*
|
| 486 |
-
* @since 1.0.0
|
| 487 |
* @category reason
|
|
|
|
| 488 |
*/
|
| 489 |
export declare class ContentPolicyError extends ContentPolicyError_base {
|
| 490 |
/**
|
| 491 |
-
*
|
|
|
|
|
|
|
| 492 |
*/
|
| 493 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 494 |
/**
|
| 495 |
* Content policy errors require content changes and are not retryable.
|
| 496 |
*
|
| 497 |
-
* @since
|
| 498 |
*/
|
| 499 |
get isRetryable(): boolean;
|
| 500 |
get message(): string;
|
|
@@ -504,7 +494,7 @@ declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema
|
|
| 504 |
readonly parameter: Schema.optional<Schema.String>;
|
| 505 |
readonly constraint: Schema.optional<Schema.String>;
|
| 506 |
readonly description: Schema.optional<Schema.String>;
|
| 507 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InvalidRequestErrorMetadata>>>;
|
| 508 |
readonly http: Schema.optional<Schema.Struct<{
|
| 509 |
readonly request: Schema.Struct<{
|
| 510 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -523,9 +513,12 @@ declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema
|
|
| 523 |
/**
|
| 524 |
* Error indicating the request had invalid or malformed parameters.
|
| 525 |
*
|
|
|
|
|
|
|
| 526 |
* Invalid request errors require fixing the request and are not retryable.
|
| 527 |
*
|
| 528 |
-
*
|
|
|
|
| 529 |
* ```ts
|
| 530 |
* import { AiError } from "effect/unstable/ai"
|
| 531 |
*
|
|
@@ -540,18 +533,20 @@ declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema
|
|
| 540 |
* // "Invalid request: parameter 'temperature' must be between 0 and 2. Temperature value 5 is out of range"
|
| 541 |
* ```
|
| 542 |
*
|
| 543 |
-
* @since 1.0.0
|
| 544 |
* @category reason
|
|
|
|
| 545 |
*/
|
| 546 |
export declare class InvalidRequestError extends InvalidRequestError_base {
|
| 547 |
/**
|
| 548 |
-
*
|
|
|
|
|
|
|
| 549 |
*/
|
| 550 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 551 |
/**
|
| 552 |
* Invalid request errors require fixing the request and are not retryable.
|
| 553 |
*
|
| 554 |
-
* @since
|
| 555 |
*/
|
| 556 |
get isRetryable(): boolean;
|
| 557 |
get message(): string;
|
|
@@ -559,7 +554,7 @@ export declare class InvalidRequestError extends InvalidRequestError_base {
|
|
| 559 |
declare const InternalProviderError_base: Schema.Class<InternalProviderError, Schema.Struct<{
|
| 560 |
readonly _tag: Schema.tag<"InternalProviderError">;
|
| 561 |
readonly description: Schema.String;
|
| 562 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InternalProviderErrorMetadata>>>;
|
| 563 |
readonly http: Schema.optional<Schema.Struct<{
|
| 564 |
readonly request: Schema.Struct<{
|
| 565 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -578,9 +573,12 @@ declare const InternalProviderError_base: Schema.Class<InternalProviderError, Sc
|
|
| 578 |
/**
|
| 579 |
* Error indicating the AI provider experienced an internal error.
|
| 580 |
*
|
|
|
|
|
|
|
| 581 |
* Internal provider errors are typically transient and are retryable.
|
| 582 |
*
|
| 583 |
-
*
|
|
|
|
| 584 |
* ```ts
|
| 585 |
* import { AiError } from "effect/unstable/ai"
|
| 586 |
*
|
|
@@ -593,18 +591,20 @@ declare const InternalProviderError_base: Schema.Class<InternalProviderError, Sc
|
|
| 593 |
* // "Internal provider error: Server encountered an unexpected error"
|
| 594 |
* ```
|
| 595 |
*
|
| 596 |
-
* @since 1.0.0
|
| 597 |
* @category reason
|
|
|
|
| 598 |
*/
|
| 599 |
export declare class InternalProviderError extends InternalProviderError_base {
|
| 600 |
/**
|
| 601 |
-
*
|
|
|
|
|
|
|
| 602 |
*/
|
| 603 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 604 |
/**
|
| 605 |
* Internal provider errors are typically transient and are retryable.
|
| 606 |
*
|
| 607 |
-
* @since
|
| 608 |
*/
|
| 609 |
get isRetryable(): boolean;
|
| 610 |
get message(): string;
|
|
@@ -612,7 +612,7 @@ export declare class InternalProviderError extends InternalProviderError_base {
|
|
| 612 |
declare const InvalidOutputError_base: Schema.Class<InvalidOutputError, Schema.Struct<{
|
| 613 |
readonly _tag: Schema.tag<"InvalidOutputError">;
|
| 614 |
readonly description: Schema.String;
|
| 615 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InvalidOutputErrorMetadata>>>;
|
| 616 |
readonly usage: Schema.optional<Schema.Struct<{
|
| 617 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
| 618 |
readonly completionTokens: Schema.optional<Schema.Number>;
|
|
@@ -622,9 +622,12 @@ declare const InvalidOutputError_base: Schema.Class<InvalidOutputError, Schema.S
|
|
| 622 |
/**
|
| 623 |
* Error indicating failure to parse or validate LLM output.
|
| 624 |
*
|
|
|
|
|
|
|
| 625 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 626 |
*
|
| 627 |
-
*
|
|
|
|
| 628 |
* ```ts
|
| 629 |
* import { AiError } from "effect/unstable/ai"
|
| 630 |
*
|
|
@@ -637,24 +640,27 @@ declare const InvalidOutputError_base: Schema.Class<InvalidOutputError, Schema.S
|
|
| 637 |
* // "Invalid output: Expected a string but received a number"
|
| 638 |
* ```
|
| 639 |
*
|
| 640 |
-
* @since 1.0.0
|
| 641 |
* @category reason
|
|
|
|
| 642 |
*/
|
| 643 |
export declare class InvalidOutputError extends InvalidOutputError_base {
|
| 644 |
/**
|
| 645 |
-
*
|
|
|
|
|
|
|
| 646 |
*/
|
| 647 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 648 |
/**
|
| 649 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 650 |
*
|
| 651 |
-
* @since
|
| 652 |
*/
|
| 653 |
get isRetryable(): boolean;
|
| 654 |
/**
|
| 655 |
* Creates an InvalidOutputError from a Schema error.
|
| 656 |
*
|
| 657 |
-
*
|
|
|
|
| 658 |
* ```ts
|
| 659 |
* import { Schema } from "effect"
|
| 660 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -664,8 +670,7 @@ export declare class InvalidOutputError extends InvalidOutputError_base {
|
|
| 664 |
* const parseError = AiError.InvalidOutputError.fromSchemaError(schemaError)
|
| 665 |
* ```
|
| 666 |
*
|
| 667 |
-
* @since
|
| 668 |
-
* @category constructors
|
| 669 |
*/
|
| 670 |
static fromSchemaError(error: Schema.SchemaError): InvalidOutputError;
|
| 671 |
get message(): string;
|
|
@@ -674,7 +679,7 @@ declare const StructuredOutputError_base: Schema.Class<StructuredOutputError, Sc
|
|
| 674 |
readonly _tag: Schema.tag<"StructuredOutputError">;
|
| 675 |
readonly description: Schema.String;
|
| 676 |
readonly responseText: Schema.String;
|
| 677 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<StructuredOutputErrorMetadata>>>;
|
| 678 |
readonly usage: Schema.optional<Schema.Struct<{
|
| 679 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
| 680 |
readonly completionTokens: Schema.optional<Schema.Number>;
|
|
@@ -685,9 +690,12 @@ declare const StructuredOutputError_base: Schema.Class<StructuredOutputError, Sc
|
|
| 685 |
* Error indicating the LLM generated text that does not conform to the
|
| 686 |
* requested structured output schema.
|
| 687 |
*
|
|
|
|
|
|
|
| 688 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 689 |
*
|
| 690 |
-
*
|
|
|
|
| 691 |
* ```ts
|
| 692 |
* import { AiError } from "effect/unstable/ai"
|
| 693 |
*
|
|
@@ -701,24 +709,27 @@ declare const StructuredOutputError_base: Schema.Class<StructuredOutputError, Sc
|
|
| 701 |
* // "Structured output validation failed: Expected a valid JSON object"
|
| 702 |
* ```
|
| 703 |
*
|
| 704 |
-
* @since 1.0.0
|
| 705 |
* @category reason
|
|
|
|
| 706 |
*/
|
| 707 |
export declare class StructuredOutputError extends StructuredOutputError_base {
|
| 708 |
/**
|
| 709 |
-
*
|
|
|
|
|
|
|
| 710 |
*/
|
| 711 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 712 |
/**
|
| 713 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 714 |
*
|
| 715 |
-
* @since
|
| 716 |
*/
|
| 717 |
get isRetryable(): boolean;
|
| 718 |
/**
|
| 719 |
* Creates a StructuredOutputError from a Schema error.
|
| 720 |
*
|
| 721 |
-
*
|
|
|
|
| 722 |
* ```ts
|
| 723 |
* import { Schema } from "effect"
|
| 724 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -729,8 +740,7 @@ export declare class StructuredOutputError extends StructuredOutputError_base {
|
|
| 729 |
* const parseError = AiError.StructuredOutputError.fromSchemaError(schemaError, rawText)
|
| 730 |
* ```
|
| 731 |
*
|
| 732 |
-
* @since
|
| 733 |
-
* @category constructors
|
| 734 |
*/
|
| 735 |
static fromSchemaError(error: Schema.SchemaError, responseText: string): StructuredOutputError;
|
| 736 |
get message(): string;
|
|
@@ -738,16 +748,19 @@ export declare class StructuredOutputError extends StructuredOutputError_base {
|
|
| 738 |
declare const UnsupportedSchemaError_base: Schema.Class<UnsupportedSchemaError, Schema.Struct<{
|
| 739 |
readonly _tag: Schema.tag<"UnsupportedSchemaError">;
|
| 740 |
readonly description: Schema.String;
|
| 741 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<UnsupportedSchemaErrorMetadata>>>;
|
| 742 |
}>, import("../../Cause.ts").YieldableError>;
|
| 743 |
/**
|
| 744 |
* Error indicating a codec transformer rejected a schema because it contains
|
| 745 |
* unsupported constructs.
|
| 746 |
*
|
|
|
|
|
|
|
| 747 |
* Unsupported schema errors are not retryable because they indicate a
|
| 748 |
* programmer error where the schema is incompatible with the provider.
|
| 749 |
*
|
| 750 |
-
*
|
|
|
|
| 751 |
* ```ts
|
| 752 |
* import { AiError } from "effect/unstable/ai"
|
| 753 |
*
|
|
@@ -760,18 +773,20 @@ declare const UnsupportedSchemaError_base: Schema.Class<UnsupportedSchemaError,
|
|
| 760 |
* // "Unsupported schema: Unions are not supported in Anthropic structured output"
|
| 761 |
* ```
|
| 762 |
*
|
| 763 |
-
* @since 1.0.0
|
| 764 |
* @category reason
|
|
|
|
| 765 |
*/
|
| 766 |
export declare class UnsupportedSchemaError extends UnsupportedSchemaError_base {
|
| 767 |
/**
|
| 768 |
-
*
|
|
|
|
|
|
|
| 769 |
*/
|
| 770 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 771 |
/**
|
| 772 |
* Unsupported schema errors are not retryable because they indicate a programmer error.
|
| 773 |
*
|
| 774 |
-
* @since
|
| 775 |
*/
|
| 776 |
get isRetryable(): boolean;
|
| 777 |
get message(): string;
|
|
@@ -779,7 +794,7 @@ export declare class UnsupportedSchemaError extends UnsupportedSchemaError_base
|
|
| 779 |
declare const UnknownError_base: Schema.Class<UnknownError, Schema.Struct<{
|
| 780 |
readonly _tag: Schema.tag<"UnknownError">;
|
| 781 |
readonly description: Schema.optional<Schema.String>;
|
| 782 |
-
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<UnknownErrorMetadata>>>;
|
| 783 |
readonly http: Schema.optional<Schema.Struct<{
|
| 784 |
readonly request: Schema.Struct<{
|
| 785 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
@@ -796,11 +811,14 @@ declare const UnknownError_base: Schema.Class<UnknownError, Schema.Struct<{
|
|
| 796 |
}>>;
|
| 797 |
}>, import("../../Cause.ts").YieldableError>;
|
| 798 |
/**
|
| 799 |
-
*
|
|
|
|
|
|
|
| 800 |
*
|
| 801 |
* Unknown errors are not retryable by default since the cause is unknown.
|
| 802 |
*
|
| 803 |
-
*
|
|
|
|
| 804 |
* ```ts
|
| 805 |
* import { AiError } from "effect/unstable/ai"
|
| 806 |
*
|
|
@@ -813,18 +831,20 @@ declare const UnknownError_base: Schema.Class<UnknownError, Schema.Struct<{
|
|
| 813 |
* // "An unexpected error occurred"
|
| 814 |
* ```
|
| 815 |
*
|
| 816 |
-
* @since 1.0.0
|
| 817 |
* @category reason
|
|
|
|
| 818 |
*/
|
| 819 |
export declare class UnknownError extends UnknownError_base {
|
| 820 |
/**
|
| 821 |
-
*
|
|
|
|
|
|
|
| 822 |
*/
|
| 823 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 824 |
/**
|
| 825 |
* Unknown errors are not retryable by default.
|
| 826 |
*
|
| 827 |
-
* @since
|
| 828 |
*/
|
| 829 |
get isRetryable(): boolean;
|
| 830 |
get message(): string;
|
|
@@ -837,10 +857,13 @@ declare const ToolNotFoundError_base: Schema.Class<ToolNotFoundError, Schema.Str
|
|
| 837 |
/**
|
| 838 |
* Error indicating the model requested a tool that doesn't exist in the toolkit.
|
| 839 |
*
|
|
|
|
|
|
|
| 840 |
* This error is retryable because the model may self-correct when provided
|
| 841 |
* with the list of available tools.
|
| 842 |
*
|
| 843 |
-
*
|
|
|
|
| 844 |
* ```ts
|
| 845 |
* import { AiError } from "effect/unstable/ai"
|
| 846 |
*
|
|
@@ -854,18 +877,20 @@ declare const ToolNotFoundError_base: Schema.Class<ToolNotFoundError, Schema.Str
|
|
| 854 |
* // "Tool 'unknownTool' not found. Available tools: GetWeather, GetTime"
|
| 855 |
* ```
|
| 856 |
*
|
| 857 |
-
* @since 1.0.0
|
| 858 |
* @category reason
|
|
|
|
| 859 |
*/
|
| 860 |
export declare class ToolNotFoundError extends ToolNotFoundError_base {
|
| 861 |
/**
|
| 862 |
-
*
|
|
|
|
|
|
|
| 863 |
*/
|
| 864 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 865 |
/**
|
| 866 |
* Tool not found errors are retryable because the model may self-correct.
|
| 867 |
*
|
| 868 |
-
* @since
|
| 869 |
*/
|
| 870 |
get isRetryable(): boolean;
|
| 871 |
get message(): string;
|
|
@@ -879,10 +904,13 @@ declare const ToolParameterValidationError_base: Schema.Class<ToolParameterValid
|
|
| 879 |
/**
|
| 880 |
* Error indicating the model's tool call parameters failed schema validation.
|
| 881 |
*
|
|
|
|
|
|
|
| 882 |
* This error is retryable because the model may correct its parameters
|
| 883 |
* on subsequent attempts.
|
| 884 |
*
|
| 885 |
-
*
|
|
|
|
| 886 |
* ```ts
|
| 887 |
* import { AiError } from "effect/unstable/ai"
|
| 888 |
*
|
|
@@ -897,18 +925,20 @@ declare const ToolParameterValidationError_base: Schema.Class<ToolParameterValid
|
|
| 897 |
* // "Invalid parameters for tool 'GetWeather': Expected string, got number"
|
| 898 |
* ```
|
| 899 |
*
|
| 900 |
-
* @since 1.0.0
|
| 901 |
* @category reason
|
|
|
|
| 902 |
*/
|
| 903 |
export declare class ToolParameterValidationError extends ToolParameterValidationError_base {
|
| 904 |
/**
|
| 905 |
-
*
|
|
|
|
|
|
|
| 906 |
*/
|
| 907 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 908 |
/**
|
| 909 |
* Parameter validation errors are retryable because the model may correct parameters.
|
| 910 |
*
|
| 911 |
-
* @since
|
| 912 |
*/
|
| 913 |
get isRetryable(): boolean;
|
| 914 |
get message(): string;
|
|
@@ -922,10 +952,13 @@ declare const InvalidToolResultError_base: Schema.Class<InvalidToolResultError,
|
|
| 922 |
* Error indicating the tool handler returned an invalid result that does not
|
| 923 |
* match the tool's schema.
|
| 924 |
*
|
|
|
|
|
|
|
| 925 |
* This error is not retryable because invalid results indicate a bug in the
|
| 926 |
* tool handler implementation.
|
| 927 |
*
|
| 928 |
-
*
|
|
|
|
| 929 |
* ```ts
|
| 930 |
* import { AiError } from "effect/unstable/ai"
|
| 931 |
*
|
|
@@ -939,18 +972,20 @@ declare const InvalidToolResultError_base: Schema.Class<InvalidToolResultError,
|
|
| 939 |
* // "Tool 'GetWeather' returned invalid result: missing 'temperature' field"
|
| 940 |
* ```
|
| 941 |
*
|
| 942 |
-
* @since 1.0.0
|
| 943 |
* @category reason
|
|
|
|
| 944 |
*/
|
| 945 |
export declare class InvalidToolResultError extends InvalidToolResultError_base {
|
| 946 |
/**
|
| 947 |
-
*
|
|
|
|
|
|
|
| 948 |
*/
|
| 949 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 950 |
/**
|
| 951 |
* Invalid tool result errors are not retryable because they indicate a bug in the handler.
|
| 952 |
*
|
| 953 |
-
* @since
|
| 954 |
*/
|
| 955 |
get isRetryable(): boolean;
|
| 956 |
get message(): string;
|
|
@@ -964,36 +999,41 @@ declare const ToolResultEncodingError_base: Schema.Class<ToolResultEncodingError
|
|
| 964 |
/**
|
| 965 |
* Error indicating the tool result cannot be encoded for sending back to the model.
|
| 966 |
*
|
|
|
|
|
|
|
| 967 |
* This error is not retryable because encoding failures indicate a bug in the
|
| 968 |
* tool schema definitions.
|
| 969 |
*
|
| 970 |
-
*
|
|
|
|
| 971 |
* ```ts
|
| 972 |
* import { AiError } from "effect/unstable/ai"
|
| 973 |
*
|
| 974 |
* const error = new AiError.ToolResultEncodingError({
|
| 975 |
* toolName: "GetWeather",
|
| 976 |
-
* toolResult: {
|
| 977 |
-
* description: "Cannot encode
|
| 978 |
* })
|
| 979 |
*
|
| 980 |
* console.log(error.isRetryable) // false
|
| 981 |
* console.log(error.message)
|
| 982 |
-
* // "Failed to encode result for tool 'GetWeather': Cannot encode
|
| 983 |
* ```
|
| 984 |
*
|
| 985 |
-
* @since 1.0.0
|
| 986 |
* @category reason
|
|
|
|
| 987 |
*/
|
| 988 |
export declare class ToolResultEncodingError extends ToolResultEncodingError_base {
|
| 989 |
/**
|
| 990 |
-
*
|
|
|
|
|
|
|
| 991 |
*/
|
| 992 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 993 |
/**
|
| 994 |
* Encoding errors are not retryable because they indicate a code bug.
|
| 995 |
*
|
| 996 |
-
* @since
|
| 997 |
*/
|
| 998 |
get isRetryable(): boolean;
|
| 999 |
get message(): string;
|
|
@@ -1006,10 +1046,13 @@ declare const ToolConfigurationError_base: Schema.Class<ToolConfigurationError,
|
|
| 1006 |
/**
|
| 1007 |
* Error indicating a provider-defined tool was configured with invalid arguments.
|
| 1008 |
*
|
|
|
|
|
|
|
| 1009 |
* This error is not retryable because it indicates a programming error in the
|
| 1010 |
* tool configuration that must be fixed in code.
|
| 1011 |
*
|
| 1012 |
-
*
|
|
|
|
| 1013 |
* ```ts
|
| 1014 |
* import { AiError } from "effect/unstable/ai"
|
| 1015 |
*
|
|
@@ -1023,18 +1066,20 @@ declare const ToolConfigurationError_base: Schema.Class<ToolConfigurationError,
|
|
| 1023 |
* // "Invalid configuration for tool 'OpenAiCodeInterpreter': Invalid container ID format"
|
| 1024 |
* ```
|
| 1025 |
*
|
| 1026 |
-
* @since 1.0.0
|
| 1027 |
* @category reason
|
|
|
|
| 1028 |
*/
|
| 1029 |
export declare class ToolConfigurationError extends ToolConfigurationError_base {
|
| 1030 |
/**
|
| 1031 |
-
*
|
|
|
|
|
|
|
| 1032 |
*/
|
| 1033 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1034 |
/**
|
| 1035 |
* Configuration errors are not retryable because they indicate a code bug.
|
| 1036 |
*
|
| 1037 |
-
* @since
|
| 1038 |
*/
|
| 1039 |
get isRetryable(): boolean;
|
| 1040 |
get message(): string;
|
|
@@ -1047,10 +1092,13 @@ declare const ToolkitRequiredError_base: Schema.Class<ToolkitRequiredError, Sche
|
|
| 1047 |
/**
|
| 1048 |
* Error indicating an operation requires a toolkit but none was provided.
|
| 1049 |
*
|
|
|
|
|
|
|
| 1050 |
* This error occurs when tool approval responses are present in the prompt
|
| 1051 |
* but no toolkit was provided to resolve them.
|
| 1052 |
*
|
| 1053 |
-
*
|
|
|
|
| 1054 |
* ```ts
|
| 1055 |
* import { AiError } from "effect/unstable/ai"
|
| 1056 |
*
|
|
@@ -1063,18 +1111,20 @@ declare const ToolkitRequiredError_base: Schema.Class<ToolkitRequiredError, Sche
|
|
| 1063 |
* // "Toolkit required to resolve pending tool approvals: GetWeather, SendEmail"
|
| 1064 |
* ```
|
| 1065 |
*
|
| 1066 |
-
* @since 1.0.0
|
| 1067 |
* @category reason
|
|
|
|
| 1068 |
*/
|
| 1069 |
export declare class ToolkitRequiredError extends ToolkitRequiredError_base {
|
| 1070 |
/**
|
| 1071 |
-
*
|
|
|
|
|
|
|
| 1072 |
*/
|
| 1073 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1074 |
/**
|
| 1075 |
* Toolkit required errors are not retryable without providing a toolkit.
|
| 1076 |
*
|
| 1077 |
-
* @since
|
| 1078 |
*/
|
| 1079 |
get isRetryable(): boolean;
|
| 1080 |
get message(): string;
|
|
@@ -1086,35 +1136,40 @@ declare const InvalidUserInputError_base: Schema.Class<InvalidUserInputError, Sc
|
|
| 1086 |
/**
|
| 1087 |
* Error indicating the user provided invalid input in their prompt.
|
| 1088 |
*
|
|
|
|
|
|
|
| 1089 |
* This error is raised when the prompt contains content that is structurally
|
| 1090 |
* valid but not supported by the provider (e.g., unsupported media types,
|
| 1091 |
* unsupported file formats, etc.).
|
| 1092 |
*
|
| 1093 |
-
*
|
|
|
|
| 1094 |
* ```ts
|
| 1095 |
* import { AiError } from "effect/unstable/ai"
|
| 1096 |
*
|
| 1097 |
* const error = new AiError.InvalidUserInputError({
|
| 1098 |
-
* description: "Unsupported media type 'video/mp4'. Supported types
|
| 1099 |
* })
|
| 1100 |
*
|
| 1101 |
* console.log(error.isRetryable) // false
|
| 1102 |
* console.log(error.message)
|
| 1103 |
-
* // "Invalid user input: Unsupported media type 'video/mp4'. Supported types
|
| 1104 |
* ```
|
| 1105 |
*
|
| 1106 |
-
* @since 1.0.0
|
| 1107 |
* @category reason
|
|
|
|
| 1108 |
*/
|
| 1109 |
export declare class InvalidUserInputError extends InvalidUserInputError_base {
|
| 1110 |
/**
|
| 1111 |
-
*
|
|
|
|
|
|
|
| 1112 |
*/
|
| 1113 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1114 |
/**
|
| 1115 |
* Invalid user input errors require fixing the input and are not retryable.
|
| 1116 |
*
|
| 1117 |
-
* @since
|
| 1118 |
*/
|
| 1119 |
get isRetryable(): boolean;
|
| 1120 |
get message(): string;
|
|
@@ -1122,21 +1177,31 @@ export declare class InvalidUserInputError extends InvalidUserInputError_base {
|
|
| 1122 |
/**
|
| 1123 |
* Union type of all semantic error reasons that can occur during AI operations.
|
| 1124 |
*
|
| 1125 |
-
*
|
| 1126 |
-
*
|
| 1127 |
-
*
|
| 1128 |
-
*
|
| 1129 |
-
*
|
| 1130 |
*
|
| 1131 |
-
* @since 1.0.0
|
| 1132 |
* @category models
|
|
|
|
| 1133 |
*/
|
| 1134 |
export type AiErrorReason = RateLimitError | QuotaExhaustedError | AuthenticationError | ContentPolicyError | InvalidRequestError | InternalProviderError | NetworkError | InvalidOutputError | StructuredOutputError | UnsupportedSchemaError | UnknownError | ToolNotFoundError | ToolParameterValidationError | InvalidToolResultError | ToolResultEncodingError | ToolConfigurationError | ToolkitRequiredError | InvalidUserInputError;
|
| 1135 |
/**
|
| 1136 |
* Schema for validating and parsing AI error reasons.
|
| 1137 |
*
|
| 1138 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1139 |
* @category schemas
|
|
|
|
| 1140 |
*/
|
| 1141 |
export declare const AiErrorReason: Schema.Union<[
|
| 1142 |
typeof RateLimitError,
|
|
@@ -1166,16 +1231,20 @@ declare const AiError_base: Schema.Class<AiError, Schema.Struct<{
|
|
| 1166 |
readonly reason: Schema.Union<[typeof RateLimitError, typeof QuotaExhaustedError, typeof AuthenticationError, typeof ContentPolicyError, typeof InvalidRequestError, typeof InternalProviderError, typeof NetworkError, typeof InvalidOutputError, typeof StructuredOutputError, typeof UnsupportedSchemaError, typeof UnknownError, typeof ToolNotFoundError, typeof ToolParameterValidationError, typeof InvalidToolResultError, typeof ToolResultEncodingError, typeof ToolConfigurationError, typeof ToolkitRequiredError, typeof InvalidUserInputError]>;
|
| 1167 |
}>, import("../../Cause.ts").YieldableError>;
|
| 1168 |
/**
|
| 1169 |
-
*
|
| 1170 |
*
|
| 1171 |
-
*
|
| 1172 |
-
* - `module` and `method` context for where the error occurred
|
| 1173 |
-
* - `reason` field containing the semantic error type
|
| 1174 |
-
* - Delegated `isRetryable` and `retryAfter` to the underlying reason
|
| 1175 |
*
|
| 1176 |
-
* Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1177 |
*
|
| 1178 |
-
* @example
|
| 1179 |
* ```ts
|
| 1180 |
* import { Effect } from "effect"
|
| 1181 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -1193,8 +1262,8 @@ declare const AiError_base: Schema.Class<AiError, Schema.Struct<{
|
|
| 1193 |
* )
|
| 1194 |
* ```
|
| 1195 |
*
|
| 1196 |
-
* @since 1.0.0
|
| 1197 |
* @category schemas
|
|
|
|
| 1198 |
*/
|
| 1199 |
export declare class AiError extends AiError_base {
|
| 1200 |
readonly [TypeId]: "~effect/unstable/ai/AiError/AiError";
|
|
@@ -1202,13 +1271,13 @@ export declare class AiError extends AiError_base {
|
|
| 1202 |
/**
|
| 1203 |
* Delegates to the underlying reason's `isRetryable` getter.
|
| 1204 |
*
|
| 1205 |
-
* @since
|
| 1206 |
*/
|
| 1207 |
get isRetryable(): boolean;
|
| 1208 |
/**
|
| 1209 |
* Delegates to the underlying reason's `retryAfter` if present.
|
| 1210 |
*
|
| 1211 |
-
* @since
|
| 1212 |
*/
|
| 1213 |
get retryAfter(): Duration.Duration | undefined;
|
| 1214 |
get message(): string;
|
|
@@ -1216,17 +1285,15 @@ export declare class AiError extends AiError_base {
|
|
| 1216 |
/**
|
| 1217 |
* The encoded (serialized) form of an `AiError`.
|
| 1218 |
*
|
| 1219 |
-
* @since 1.0.0
|
| 1220 |
* @category schemas
|
|
|
|
| 1221 |
*/
|
| 1222 |
export type AiErrorEncoded = typeof AiError["Encoded"];
|
| 1223 |
/**
|
| 1224 |
* Type guard to check if a value is an `AiError`.
|
| 1225 |
*
|
| 1226 |
-
*
|
| 1227 |
-
* @returns `true` if the value is an `AiError`, `false` otherwise
|
| 1228 |
*
|
| 1229 |
-
* @example
|
| 1230 |
* ```ts
|
| 1231 |
* import { AiError } from "effect/unstable/ai"
|
| 1232 |
*
|
|
@@ -1241,17 +1308,15 @@ export type AiErrorEncoded = typeof AiError["Encoded"];
|
|
| 1241 |
* console.log(AiError.isAiError(aiError)) // true
|
| 1242 |
* ```
|
| 1243 |
*
|
| 1244 |
-
* @since 1.0.0
|
| 1245 |
* @category guards
|
|
|
|
| 1246 |
*/
|
| 1247 |
export declare const isAiError: (u: unknown) => u is AiError;
|
| 1248 |
/**
|
| 1249 |
* Type guard to check if a value is an `AiErrorReason`.
|
| 1250 |
*
|
| 1251 |
-
*
|
| 1252 |
-
* @returns `true` if the value is an `AiErrorReason`, `false` otherwise
|
| 1253 |
*
|
| 1254 |
-
* @example
|
| 1255 |
* ```ts
|
| 1256 |
* import { AiError } from "effect/unstable/ai"
|
| 1257 |
*
|
|
@@ -1262,14 +1327,15 @@ export declare const isAiError: (u: unknown) => u is AiError;
|
|
| 1262 |
* console.log(AiError.isAiErrorReason(genericError)) // false
|
| 1263 |
* ```
|
| 1264 |
*
|
| 1265 |
-
* @since 1.0.0
|
| 1266 |
* @category guards
|
|
|
|
| 1267 |
*/
|
| 1268 |
export declare const isAiErrorReason: (u: unknown) => u is AiErrorReason;
|
| 1269 |
/**
|
| 1270 |
* Creates an `AiError` with the given reason.
|
| 1271 |
*
|
| 1272 |
-
*
|
|
|
|
| 1273 |
* ```ts
|
| 1274 |
* import { Duration } from "effect"
|
| 1275 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -1286,8 +1352,8 @@ export declare const isAiErrorReason: (u: unknown) => u is AiErrorReason;
|
|
| 1286 |
* // "OpenAI.completion: Rate limit exceeded. Retry after 1 minute"
|
| 1287 |
* ```
|
| 1288 |
*
|
| 1289 |
-
* @since 1.0.0
|
| 1290 |
* @category constructors
|
|
|
|
| 1291 |
*/
|
| 1292 |
export declare const make: (params: {
|
| 1293 |
readonly module: string;
|
|
@@ -1297,9 +1363,13 @@ export declare const make: (params: {
|
|
| 1297 |
/**
|
| 1298 |
* Maps HTTP status codes to semantic error reasons.
|
| 1299 |
*
|
| 1300 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1301 |
*
|
| 1302 |
-
* @example
|
| 1303 |
* ```ts
|
| 1304 |
* import { AiError } from "effect/unstable/ai"
|
| 1305 |
*
|
|
@@ -1311,8 +1381,8 @@ export declare const make: (params: {
|
|
| 1311 |
* console.log(reason._tag) // "RateLimitError"
|
| 1312 |
* ```
|
| 1313 |
*
|
| 1314 |
-
* @since 1.0.0
|
| 1315 |
* @category constructors
|
|
|
|
| 1316 |
*/
|
| 1317 |
export declare const reasonFromHttpStatus: (params: {
|
| 1318 |
readonly status: number;
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines shared errors for AI operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
*
|
| 4 |
+
* `AiError` records where a failure happened and stores the detailed reason in a
|
| 5 |
+
* `reason` field. Those reasons cover transport problems, provider responses,
|
| 6 |
+
* rate limits, authentication, content policy failures, invalid requests,
|
| 7 |
+
* invalid output, unsupported schemas, tool failures, invalid user input, and
|
| 8 |
+
* unknown failures. This module also includes metadata schemas, guards,
|
| 9 |
+
* constructors, and helpers for converting HTTP response information into AI
|
| 10 |
+
* error reasons.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
*
|
| 12 |
+
* @since 4.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
*/
|
| 14 |
import * as Duration from "../../Duration.ts";
|
| 15 |
import * as Schema from "../../Schema.ts";
|
|
|
|
| 30 |
/**
|
| 31 |
* Error indicating a network-level failure before receiving a response.
|
| 32 |
*
|
| 33 |
+
* **Details**
|
| 34 |
+
*
|
| 35 |
* This error is raised when issues arise before receiving an HTTP response,
|
| 36 |
* such as network connectivity problems, request encoding issues, or invalid
|
| 37 |
* URLs.
|
| 38 |
*
|
| 39 |
+
* **Example** (Creating a network error)
|
| 40 |
+
*
|
| 41 |
* ```ts
|
| 42 |
* import { AiError } from "effect/unstable/ai"
|
| 43 |
*
|
|
|
|
| 58 |
* // "Transport: Connection timeout after 30 seconds (POST https://api.openai.com/v1/completions)"
|
| 59 |
* ```
|
| 60 |
*
|
|
|
|
| 61 |
* @category reason
|
| 62 |
+
* @since 4.0.0
|
| 63 |
*/
|
| 64 |
export declare class NetworkError extends NetworkError_base {
|
| 65 |
/**
|
| 66 |
+
* Marks `NetworkError` as a semantic AI error reason for runtime guards.
|
| 67 |
+
*
|
| 68 |
+
* @since 4.0.0
|
| 69 |
*/
|
| 70 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 71 |
/**
|
| 72 |
* Transport errors are retryable; encoding and URL errors are not.
|
| 73 |
*
|
| 74 |
+
* @since 4.0.0
|
| 75 |
*/
|
| 76 |
get isRetryable(): boolean;
|
| 77 |
/**
|
| 78 |
* Creates a NetworkError from a platform HttpClientError.RequestError.
|
| 79 |
*
|
| 80 |
+
* **Example** (Creating a network error from a request error)
|
| 81 |
+
*
|
| 82 |
* ```ts
|
| 83 |
* import { AiError } from "effect/unstable/ai"
|
| 84 |
* import type { HttpClientError } from "effect/unstable/http"
|
|
|
|
| 88 |
* const aiError = AiError.NetworkError.fromRequestError(platformError)
|
| 89 |
* ```
|
| 90 |
*
|
| 91 |
+
* @since 4.0.0
|
|
|
|
| 92 |
*/
|
| 93 |
static fromRequestError(error: HttpClientError.RequestError): NetworkError;
|
| 94 |
get message(): string;
|
|
|
|
| 96 |
/**
|
| 97 |
* Schema for provider-specific metadata which can be attached to error reasons.
|
| 98 |
*
|
| 99 |
+
* **Details**
|
| 100 |
*
|
| 101 |
+
* Provider-specific metadata is namespaced by provider name. Each provider
|
| 102 |
+
* value can contain arbitrary mutable JSON metadata or `null`.
|
| 103 |
+
*
|
| 104 |
+
* **Example** (Metadata shape)
|
| 105 |
+
*
|
| 106 |
+
* ```ts
|
| 107 |
+
* const metadata = {
|
| 108 |
+
* openai: {
|
| 109 |
+
* errorCode: "rate_limit_exceeded",
|
| 110 |
+
* requestId: "req_123"
|
| 111 |
+
* },
|
| 112 |
+
* anthropic: null
|
| 113 |
* }
|
| 114 |
* ```
|
| 115 |
*
|
|
|
|
| 116 |
* @category schemas
|
| 117 |
+
* @since 4.0.0
|
| 118 |
*/
|
| 119 |
export declare const ProviderMetadata: Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson>>>;
|
| 120 |
/**
|
| 121 |
+
* Type of provider-specific metadata attached to AI error reasons.
|
| 122 |
+
*
|
| 123 |
+
* **Details**
|
| 124 |
+
*
|
| 125 |
+
* Metadata is keyed by provider name, and each provider value is either mutable
|
| 126 |
+
* JSON metadata or `null`.
|
| 127 |
+
*
|
| 128 |
* @category models
|
| 129 |
+
* @since 4.0.0
|
| 130 |
*/
|
| 131 |
export type ProviderMetadata = typeof ProviderMetadata.Type;
|
| 132 |
/**
|
| 133 |
* Provider-specific metadata attached to `RateLimitError`.
|
| 134 |
*
|
| 135 |
+
* @category configuration
|
| 136 |
+
* @since 4.0.0
|
| 137 |
*/
|
| 138 |
export interface RateLimitErrorMetadata extends ProviderMetadata {
|
| 139 |
}
|
| 140 |
/**
|
| 141 |
* Provider-specific metadata attached to `QuotaExhaustedError`.
|
| 142 |
*
|
| 143 |
+
* @category configuration
|
| 144 |
+
* @since 4.0.0
|
| 145 |
*/
|
| 146 |
export interface QuotaExhaustedErrorMetadata extends ProviderMetadata {
|
| 147 |
}
|
| 148 |
/**
|
| 149 |
* Provider-specific metadata attached to `AuthenticationError`.
|
| 150 |
*
|
| 151 |
+
* @category configuration
|
| 152 |
+
* @since 4.0.0
|
| 153 |
*/
|
| 154 |
export interface AuthenticationErrorMetadata extends ProviderMetadata {
|
| 155 |
}
|
| 156 |
/**
|
| 157 |
* Provider-specific metadata attached to `ContentPolicyError`.
|
| 158 |
*
|
| 159 |
+
* @category configuration
|
| 160 |
+
* @since 4.0.0
|
| 161 |
*/
|
| 162 |
export interface ContentPolicyErrorMetadata extends ProviderMetadata {
|
| 163 |
}
|
| 164 |
/**
|
| 165 |
* Provider-specific metadata attached to `InvalidRequestError`.
|
| 166 |
*
|
| 167 |
+
* @category configuration
|
| 168 |
+
* @since 4.0.0
|
| 169 |
*/
|
| 170 |
export interface InvalidRequestErrorMetadata extends ProviderMetadata {
|
| 171 |
}
|
| 172 |
/**
|
| 173 |
* Provider-specific metadata attached to `InternalProviderError`.
|
| 174 |
*
|
| 175 |
+
* @category configuration
|
| 176 |
+
* @since 4.0.0
|
| 177 |
*/
|
| 178 |
export interface InternalProviderErrorMetadata extends ProviderMetadata {
|
| 179 |
}
|
| 180 |
/**
|
| 181 |
* Provider-specific metadata attached to `InvalidOutputError`.
|
| 182 |
*
|
| 183 |
+
* @category configuration
|
| 184 |
+
* @since 4.0.0
|
| 185 |
*/
|
| 186 |
export interface InvalidOutputErrorMetadata extends ProviderMetadata {
|
| 187 |
}
|
| 188 |
/**
|
| 189 |
* Provider-specific metadata attached to `StructuredOutputError`.
|
| 190 |
*
|
| 191 |
+
* @category configuration
|
| 192 |
+
* @since 4.0.0
|
| 193 |
*/
|
| 194 |
export interface StructuredOutputErrorMetadata extends ProviderMetadata {
|
| 195 |
}
|
| 196 |
/**
|
| 197 |
* Provider-specific metadata attached to `UnsupportedSchemaError`.
|
| 198 |
*
|
| 199 |
+
* @category configuration
|
| 200 |
+
* @since 4.0.0
|
| 201 |
*/
|
| 202 |
export interface UnsupportedSchemaErrorMetadata extends ProviderMetadata {
|
| 203 |
}
|
| 204 |
/**
|
| 205 |
* Provider-specific metadata attached to `UnknownError`.
|
| 206 |
*
|
| 207 |
+
* @category configuration
|
| 208 |
+
* @since 4.0.0
|
| 209 |
*/
|
| 210 |
export interface UnknownErrorMetadata extends ProviderMetadata {
|
| 211 |
}
|
| 212 |
/**
|
| 213 |
+
* Schema for token usage information from AI operations.
|
| 214 |
+
*
|
| 215 |
+
* **Details**
|
| 216 |
+
*
|
| 217 |
+
* Schema for optional provider-reported token counts for prompt tokens,
|
| 218 |
+
* completion tokens, and total tokens.
|
| 219 |
*
|
|
|
|
| 220 |
* @category schemas
|
| 221 |
+
* @since 4.0.0
|
| 222 |
*/
|
| 223 |
export declare const UsageInfo: Schema.Struct<{
|
| 224 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
|
|
|
| 226 |
readonly totalTokens: Schema.optional<Schema.Number>;
|
| 227 |
}>;
|
| 228 |
/**
|
| 229 |
+
* Schema for the combined HTTP context used in error reporting.
|
| 230 |
+
*
|
| 231 |
+
* **When to use**
|
| 232 |
+
*
|
| 233 |
+
* Use to attach request details, optional response details, and optional body
|
| 234 |
+
* text to AI provider errors.
|
| 235 |
+
*
|
| 236 |
+
* **Details**
|
| 237 |
+
*
|
| 238 |
+
* Includes the required request details plus optional response details and raw
|
| 239 |
+
* response body.
|
| 240 |
+
*
|
| 241 |
+
* @see {@link HttpRequestDetails} for captured request details
|
| 242 |
+
* @see {@link HttpResponseDetails} for captured response details
|
| 243 |
*
|
|
|
|
| 244 |
* @category schemas
|
| 245 |
+
* @since 4.0.0
|
| 246 |
*/
|
| 247 |
export declare const HttpContext: Schema.Struct<{
|
| 248 |
readonly request: Schema.Struct<{
|
|
|
|
| 261 |
declare const RateLimitError_base: Schema.Class<RateLimitError, Schema.Struct<{
|
| 262 |
readonly _tag: Schema.tag<"RateLimitError">;
|
| 263 |
readonly retryAfter: Schema.optional<Schema.Duration>;
|
| 264 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<RateLimitErrorMetadata>>, never>;
|
| 265 |
readonly http: Schema.optional<Schema.Struct<{
|
| 266 |
readonly request: Schema.Struct<{
|
| 267 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 280 |
/**
|
| 281 |
* Error indicating the request was rate limited.
|
| 282 |
*
|
| 283 |
+
* **Details**
|
| 284 |
+
*
|
| 285 |
* Rate limit errors are always retryable. When `retryAfter` is provided,
|
| 286 |
* callers should wait that duration before retrying.
|
| 287 |
*
|
| 288 |
+
* **Example** (Creating a rate limit error)
|
| 289 |
+
*
|
| 290 |
* ```ts
|
| 291 |
* import { Duration } from "effect"
|
| 292 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 299 |
* console.log(rateLimitError.message) // "Rate limit exceeded. Retry after 1 minute"
|
| 300 |
* ```
|
| 301 |
*
|
|
|
|
| 302 |
* @category reason
|
| 303 |
+
* @since 4.0.0
|
| 304 |
*/
|
| 305 |
export declare class RateLimitError extends RateLimitError_base {
|
| 306 |
/**
|
| 307 |
+
* Marks `RateLimitError` as a semantic AI error reason for runtime guards.
|
| 308 |
+
*
|
| 309 |
+
* @since 4.0.0
|
| 310 |
*/
|
| 311 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 312 |
/**
|
| 313 |
* Rate limit errors are always retryable.
|
| 314 |
*
|
| 315 |
+
* @since 4.0.0
|
| 316 |
*/
|
| 317 |
get isRetryable(): boolean;
|
| 318 |
get message(): string;
|
|
|
|
| 320 |
declare const QuotaExhaustedError_base: Schema.Class<QuotaExhaustedError, Schema.Struct<{
|
| 321 |
readonly _tag: Schema.tag<"QuotaExhaustedError">;
|
| 322 |
readonly resetAt: Schema.optional<Schema.DateTimeUtc>;
|
| 323 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<QuotaExhaustedErrorMetadata>>, never>;
|
| 324 |
readonly http: Schema.optional<Schema.Struct<{
|
| 325 |
readonly request: Schema.Struct<{
|
| 326 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 339 |
/**
|
| 340 |
* Error indicating account or billing limits have been reached.
|
| 341 |
*
|
| 342 |
+
* **Details**
|
| 343 |
+
*
|
| 344 |
* Quota exhausted errors are not retryable without user action.
|
| 345 |
*
|
| 346 |
+
* **Example** (Creating a quota exhausted error)
|
| 347 |
+
*
|
| 348 |
* ```ts
|
| 349 |
* import { AiError } from "effect/unstable/ai"
|
| 350 |
*
|
|
|
|
| 355 |
* // "Quota exhausted. Check your account billing and usage limits."
|
| 356 |
* ```
|
| 357 |
*
|
|
|
|
| 358 |
* @category reason
|
| 359 |
+
* @since 4.0.0
|
| 360 |
*/
|
| 361 |
export declare class QuotaExhaustedError extends QuotaExhaustedError_base {
|
| 362 |
/**
|
| 363 |
+
* Marks `QuotaExhaustedError` as a semantic AI error reason for runtime guards.
|
| 364 |
+
*
|
| 365 |
+
* @since 4.0.0
|
| 366 |
*/
|
| 367 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 368 |
/**
|
| 369 |
* Quota exhausted errors require user action and are not retryable.
|
| 370 |
*
|
| 371 |
+
* @since 4.0.0
|
| 372 |
*/
|
| 373 |
get isRetryable(): boolean;
|
| 374 |
get message(): string;
|
|
|
|
| 376 |
declare const AuthenticationError_base: Schema.Class<AuthenticationError, Schema.Struct<{
|
| 377 |
readonly _tag: Schema.tag<"AuthenticationError">;
|
| 378 |
readonly kind: Schema.Literals<readonly ["InvalidKey", "ExpiredKey", "MissingKey", "InsufficientPermissions", "Unknown"]>;
|
| 379 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<AuthenticationErrorMetadata>>, never>;
|
| 380 |
readonly http: Schema.optional<Schema.Struct<{
|
| 381 |
readonly request: Schema.Struct<{
|
| 382 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 395 |
/**
|
| 396 |
* Error indicating authentication or authorization failure.
|
| 397 |
*
|
| 398 |
+
* **Details**
|
| 399 |
+
*
|
| 400 |
* Authentication errors are never retryable without credential changes.
|
| 401 |
*
|
| 402 |
+
* **Example** (Creating an authentication error)
|
| 403 |
+
*
|
| 404 |
* ```ts
|
| 405 |
* import { AiError } from "effect/unstable/ai"
|
| 406 |
*
|
|
|
|
| 413 |
* // "InvalidKey: Verify your API key is correct"
|
| 414 |
* ```
|
| 415 |
*
|
|
|
|
| 416 |
* @category reason
|
| 417 |
+
* @since 4.0.0
|
| 418 |
*/
|
| 419 |
export declare class AuthenticationError extends AuthenticationError_base {
|
| 420 |
/**
|
| 421 |
+
* Marks `AuthenticationError` as a semantic AI error reason for runtime guards.
|
| 422 |
+
*
|
| 423 |
+
* @since 4.0.0
|
| 424 |
*/
|
| 425 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 426 |
/**
|
| 427 |
* Authentication errors require credential changes and are not retryable.
|
| 428 |
*
|
| 429 |
+
* @since 4.0.0
|
| 430 |
*/
|
| 431 |
get isRetryable(): boolean;
|
| 432 |
get message(): string;
|
|
|
|
| 434 |
declare const ContentPolicyError_base: Schema.Class<ContentPolicyError, Schema.Struct<{
|
| 435 |
readonly _tag: Schema.tag<"ContentPolicyError">;
|
| 436 |
readonly description: Schema.String;
|
| 437 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<ContentPolicyErrorMetadata>>, never>;
|
| 438 |
readonly http: Schema.optional<Schema.Struct<{
|
| 439 |
readonly request: Schema.Struct<{
|
| 440 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 453 |
/**
|
| 454 |
* Error indicating content policy violation.
|
| 455 |
*
|
| 456 |
+
* **Details**
|
| 457 |
+
*
|
| 458 |
* Content policy errors are never retryable without content changes.
|
| 459 |
*
|
| 460 |
+
* **Example** (Creating a content policy error)
|
| 461 |
+
*
|
| 462 |
* ```ts
|
| 463 |
* import { AiError } from "effect/unstable/ai"
|
| 464 |
*
|
|
|
|
| 471 |
* // "Content policy violation: Input contains prohibited content"
|
| 472 |
* ```
|
| 473 |
*
|
|
|
|
| 474 |
* @category reason
|
| 475 |
+
* @since 4.0.0
|
| 476 |
*/
|
| 477 |
export declare class ContentPolicyError extends ContentPolicyError_base {
|
| 478 |
/**
|
| 479 |
+
* Marks `ContentPolicyError` as a semantic AI error reason for runtime guards.
|
| 480 |
+
*
|
| 481 |
+
* @since 4.0.0
|
| 482 |
*/
|
| 483 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 484 |
/**
|
| 485 |
* Content policy errors require content changes and are not retryable.
|
| 486 |
*
|
| 487 |
+
* @since 4.0.0
|
| 488 |
*/
|
| 489 |
get isRetryable(): boolean;
|
| 490 |
get message(): string;
|
|
|
|
| 494 |
readonly parameter: Schema.optional<Schema.String>;
|
| 495 |
readonly constraint: Schema.optional<Schema.String>;
|
| 496 |
readonly description: Schema.optional<Schema.String>;
|
| 497 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InvalidRequestErrorMetadata>>, never>;
|
| 498 |
readonly http: Schema.optional<Schema.Struct<{
|
| 499 |
readonly request: Schema.Struct<{
|
| 500 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 513 |
/**
|
| 514 |
* Error indicating the request had invalid or malformed parameters.
|
| 515 |
*
|
| 516 |
+
* **Details**
|
| 517 |
+
*
|
| 518 |
* Invalid request errors require fixing the request and are not retryable.
|
| 519 |
*
|
| 520 |
+
* **Example** (Creating an invalid request error)
|
| 521 |
+
*
|
| 522 |
* ```ts
|
| 523 |
* import { AiError } from "effect/unstable/ai"
|
| 524 |
*
|
|
|
|
| 533 |
* // "Invalid request: parameter 'temperature' must be between 0 and 2. Temperature value 5 is out of range"
|
| 534 |
* ```
|
| 535 |
*
|
|
|
|
| 536 |
* @category reason
|
| 537 |
+
* @since 4.0.0
|
| 538 |
*/
|
| 539 |
export declare class InvalidRequestError extends InvalidRequestError_base {
|
| 540 |
/**
|
| 541 |
+
* Marks `InvalidRequestError` as a semantic AI error reason for runtime guards.
|
| 542 |
+
*
|
| 543 |
+
* @since 4.0.0
|
| 544 |
*/
|
| 545 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 546 |
/**
|
| 547 |
* Invalid request errors require fixing the request and are not retryable.
|
| 548 |
*
|
| 549 |
+
* @since 4.0.0
|
| 550 |
*/
|
| 551 |
get isRetryable(): boolean;
|
| 552 |
get message(): string;
|
|
|
|
| 554 |
declare const InternalProviderError_base: Schema.Class<InternalProviderError, Schema.Struct<{
|
| 555 |
readonly _tag: Schema.tag<"InternalProviderError">;
|
| 556 |
readonly description: Schema.String;
|
| 557 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InternalProviderErrorMetadata>>, never>;
|
| 558 |
readonly http: Schema.optional<Schema.Struct<{
|
| 559 |
readonly request: Schema.Struct<{
|
| 560 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 573 |
/**
|
| 574 |
* Error indicating the AI provider experienced an internal error.
|
| 575 |
*
|
| 576 |
+
* **Details**
|
| 577 |
+
*
|
| 578 |
* Internal provider errors are typically transient and are retryable.
|
| 579 |
*
|
| 580 |
+
* **Example** (Creating an internal provider error)
|
| 581 |
+
*
|
| 582 |
* ```ts
|
| 583 |
* import { AiError } from "effect/unstable/ai"
|
| 584 |
*
|
|
|
|
| 591 |
* // "Internal provider error: Server encountered an unexpected error"
|
| 592 |
* ```
|
| 593 |
*
|
|
|
|
| 594 |
* @category reason
|
| 595 |
+
* @since 4.0.0
|
| 596 |
*/
|
| 597 |
export declare class InternalProviderError extends InternalProviderError_base {
|
| 598 |
/**
|
| 599 |
+
* Marks `InternalProviderError` as a semantic AI error reason for runtime guards.
|
| 600 |
+
*
|
| 601 |
+
* @since 4.0.0
|
| 602 |
*/
|
| 603 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 604 |
/**
|
| 605 |
* Internal provider errors are typically transient and are retryable.
|
| 606 |
*
|
| 607 |
+
* @since 4.0.0
|
| 608 |
*/
|
| 609 |
get isRetryable(): boolean;
|
| 610 |
get message(): string;
|
|
|
|
| 612 |
declare const InvalidOutputError_base: Schema.Class<InvalidOutputError, Schema.Struct<{
|
| 613 |
readonly _tag: Schema.tag<"InvalidOutputError">;
|
| 614 |
readonly description: Schema.String;
|
| 615 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<InvalidOutputErrorMetadata>>, never>;
|
| 616 |
readonly usage: Schema.optional<Schema.Struct<{
|
| 617 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
| 618 |
readonly completionTokens: Schema.optional<Schema.Number>;
|
|
|
|
| 622 |
/**
|
| 623 |
* Error indicating failure to parse or validate LLM output.
|
| 624 |
*
|
| 625 |
+
* **Details**
|
| 626 |
+
*
|
| 627 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 628 |
*
|
| 629 |
+
* **Example** (Creating an invalid output error)
|
| 630 |
+
*
|
| 631 |
* ```ts
|
| 632 |
* import { AiError } from "effect/unstable/ai"
|
| 633 |
*
|
|
|
|
| 640 |
* // "Invalid output: Expected a string but received a number"
|
| 641 |
* ```
|
| 642 |
*
|
|
|
|
| 643 |
* @category reason
|
| 644 |
+
* @since 4.0.0
|
| 645 |
*/
|
| 646 |
export declare class InvalidOutputError extends InvalidOutputError_base {
|
| 647 |
/**
|
| 648 |
+
* Marks `InvalidOutputError` as a semantic AI error reason for runtime guards.
|
| 649 |
+
*
|
| 650 |
+
* @since 4.0.0
|
| 651 |
*/
|
| 652 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 653 |
/**
|
| 654 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 655 |
*
|
| 656 |
+
* @since 4.0.0
|
| 657 |
*/
|
| 658 |
get isRetryable(): boolean;
|
| 659 |
/**
|
| 660 |
* Creates an InvalidOutputError from a Schema error.
|
| 661 |
*
|
| 662 |
+
* **Example** (Creating an invalid output error from a schema error)
|
| 663 |
+
*
|
| 664 |
* ```ts
|
| 665 |
* import { Schema } from "effect"
|
| 666 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 670 |
* const parseError = AiError.InvalidOutputError.fromSchemaError(schemaError)
|
| 671 |
* ```
|
| 672 |
*
|
| 673 |
+
* @since 4.0.0
|
|
|
|
| 674 |
*/
|
| 675 |
static fromSchemaError(error: Schema.SchemaError): InvalidOutputError;
|
| 676 |
get message(): string;
|
|
|
|
| 679 |
readonly _tag: Schema.tag<"StructuredOutputError">;
|
| 680 |
readonly description: Schema.String;
|
| 681 |
readonly responseText: Schema.String;
|
| 682 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<StructuredOutputErrorMetadata>>, never>;
|
| 683 |
readonly usage: Schema.optional<Schema.Struct<{
|
| 684 |
readonly promptTokens: Schema.optional<Schema.Number>;
|
| 685 |
readonly completionTokens: Schema.optional<Schema.Number>;
|
|
|
|
| 690 |
* Error indicating the LLM generated text that does not conform to the
|
| 691 |
* requested structured output schema.
|
| 692 |
*
|
| 693 |
+
* **Details**
|
| 694 |
+
*
|
| 695 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 696 |
*
|
| 697 |
+
* **Example** (Creating a structured output error)
|
| 698 |
+
*
|
| 699 |
* ```ts
|
| 700 |
* import { AiError } from "effect/unstable/ai"
|
| 701 |
*
|
|
|
|
| 709 |
* // "Structured output validation failed: Expected a valid JSON object"
|
| 710 |
* ```
|
| 711 |
*
|
|
|
|
| 712 |
* @category reason
|
| 713 |
+
* @since 4.0.0
|
| 714 |
*/
|
| 715 |
export declare class StructuredOutputError extends StructuredOutputError_base {
|
| 716 |
/**
|
| 717 |
+
* Marks `StructuredOutputError` as a semantic AI error reason for runtime guards.
|
| 718 |
+
*
|
| 719 |
+
* @since 4.0.0
|
| 720 |
*/
|
| 721 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 722 |
/**
|
| 723 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 724 |
*
|
| 725 |
+
* @since 4.0.0
|
| 726 |
*/
|
| 727 |
get isRetryable(): boolean;
|
| 728 |
/**
|
| 729 |
* Creates a StructuredOutputError from a Schema error.
|
| 730 |
*
|
| 731 |
+
* **Example** (Creating a structured output error from a schema error)
|
| 732 |
+
*
|
| 733 |
* ```ts
|
| 734 |
* import { Schema } from "effect"
|
| 735 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 740 |
* const parseError = AiError.StructuredOutputError.fromSchemaError(schemaError, rawText)
|
| 741 |
* ```
|
| 742 |
*
|
| 743 |
+
* @since 4.0.0
|
|
|
|
| 744 |
*/
|
| 745 |
static fromSchemaError(error: Schema.SchemaError, responseText: string): StructuredOutputError;
|
| 746 |
get message(): string;
|
|
|
|
| 748 |
declare const UnsupportedSchemaError_base: Schema.Class<UnsupportedSchemaError, Schema.Struct<{
|
| 749 |
readonly _tag: Schema.tag<"UnsupportedSchemaError">;
|
| 750 |
readonly description: Schema.String;
|
| 751 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<UnsupportedSchemaErrorMetadata>>, never>;
|
| 752 |
}>, import("../../Cause.ts").YieldableError>;
|
| 753 |
/**
|
| 754 |
* Error indicating a codec transformer rejected a schema because it contains
|
| 755 |
* unsupported constructs.
|
| 756 |
*
|
| 757 |
+
* **Details**
|
| 758 |
+
*
|
| 759 |
* Unsupported schema errors are not retryable because they indicate a
|
| 760 |
* programmer error where the schema is incompatible with the provider.
|
| 761 |
*
|
| 762 |
+
* **Example** (Creating an unsupported schema error)
|
| 763 |
+
*
|
| 764 |
* ```ts
|
| 765 |
* import { AiError } from "effect/unstable/ai"
|
| 766 |
*
|
|
|
|
| 773 |
* // "Unsupported schema: Unions are not supported in Anthropic structured output"
|
| 774 |
* ```
|
| 775 |
*
|
|
|
|
| 776 |
* @category reason
|
| 777 |
+
* @since 4.0.0
|
| 778 |
*/
|
| 779 |
export declare class UnsupportedSchemaError extends UnsupportedSchemaError_base {
|
| 780 |
/**
|
| 781 |
+
* Marks `UnsupportedSchemaError` as a semantic AI error reason for runtime guards.
|
| 782 |
+
*
|
| 783 |
+
* @since 4.0.0
|
| 784 |
*/
|
| 785 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 786 |
/**
|
| 787 |
* Unsupported schema errors are not retryable because they indicate a programmer error.
|
| 788 |
*
|
| 789 |
+
* @since 4.0.0
|
| 790 |
*/
|
| 791 |
get isRetryable(): boolean;
|
| 792 |
get message(): string;
|
|
|
|
| 794 |
declare const UnknownError_base: Schema.Class<UnknownError, Schema.Struct<{
|
| 795 |
readonly _tag: Schema.tag<"UnknownError">;
|
| 796 |
readonly description: Schema.optional<Schema.String>;
|
| 797 |
+
readonly metadata: Schema.withDecodingDefault<Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.MutableJson, Schema.MutableJson, never, never>>> & Schema.Schema<UnknownErrorMetadata>>, never>;
|
| 798 |
readonly http: Schema.optional<Schema.Struct<{
|
| 799 |
readonly request: Schema.Struct<{
|
| 800 |
readonly method: Schema.Literals<readonly ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"]>;
|
|
|
|
| 811 |
}>>;
|
| 812 |
}>, import("../../Cause.ts").YieldableError>;
|
| 813 |
/**
|
| 814 |
+
* Error data for unknown or unexpected AI failures.
|
| 815 |
+
*
|
| 816 |
+
* **Details**
|
| 817 |
*
|
| 818 |
* Unknown errors are not retryable by default since the cause is unknown.
|
| 819 |
*
|
| 820 |
+
* **Example** (Creating an unknown error)
|
| 821 |
+
*
|
| 822 |
* ```ts
|
| 823 |
* import { AiError } from "effect/unstable/ai"
|
| 824 |
*
|
|
|
|
| 831 |
* // "An unexpected error occurred"
|
| 832 |
* ```
|
| 833 |
*
|
|
|
|
| 834 |
* @category reason
|
| 835 |
+
* @since 4.0.0
|
| 836 |
*/
|
| 837 |
export declare class UnknownError extends UnknownError_base {
|
| 838 |
/**
|
| 839 |
+
* Marks `UnknownError` as a semantic AI error reason for runtime guards.
|
| 840 |
+
*
|
| 841 |
+
* @since 4.0.0
|
| 842 |
*/
|
| 843 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 844 |
/**
|
| 845 |
* Unknown errors are not retryable by default.
|
| 846 |
*
|
| 847 |
+
* @since 4.0.0
|
| 848 |
*/
|
| 849 |
get isRetryable(): boolean;
|
| 850 |
get message(): string;
|
|
|
|
| 857 |
/**
|
| 858 |
* Error indicating the model requested a tool that doesn't exist in the toolkit.
|
| 859 |
*
|
| 860 |
+
* **Details**
|
| 861 |
+
*
|
| 862 |
* This error is retryable because the model may self-correct when provided
|
| 863 |
* with the list of available tools.
|
| 864 |
*
|
| 865 |
+
* **Example** (Creating a tool not found error)
|
| 866 |
+
*
|
| 867 |
* ```ts
|
| 868 |
* import { AiError } from "effect/unstable/ai"
|
| 869 |
*
|
|
|
|
| 877 |
* // "Tool 'unknownTool' not found. Available tools: GetWeather, GetTime"
|
| 878 |
* ```
|
| 879 |
*
|
|
|
|
| 880 |
* @category reason
|
| 881 |
+
* @since 4.0.0
|
| 882 |
*/
|
| 883 |
export declare class ToolNotFoundError extends ToolNotFoundError_base {
|
| 884 |
/**
|
| 885 |
+
* Marks `ToolNotFoundError` as a semantic AI error reason for runtime guards.
|
| 886 |
+
*
|
| 887 |
+
* @since 4.0.0
|
| 888 |
*/
|
| 889 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 890 |
/**
|
| 891 |
* Tool not found errors are retryable because the model may self-correct.
|
| 892 |
*
|
| 893 |
+
* @since 4.0.0
|
| 894 |
*/
|
| 895 |
get isRetryable(): boolean;
|
| 896 |
get message(): string;
|
|
|
|
| 904 |
/**
|
| 905 |
* Error indicating the model's tool call parameters failed schema validation.
|
| 906 |
*
|
| 907 |
+
* **Details**
|
| 908 |
+
*
|
| 909 |
* This error is retryable because the model may correct its parameters
|
| 910 |
* on subsequent attempts.
|
| 911 |
*
|
| 912 |
+
* **Example** (Creating a tool parameter validation error)
|
| 913 |
+
*
|
| 914 |
* ```ts
|
| 915 |
* import { AiError } from "effect/unstable/ai"
|
| 916 |
*
|
|
|
|
| 925 |
* // "Invalid parameters for tool 'GetWeather': Expected string, got number"
|
| 926 |
* ```
|
| 927 |
*
|
|
|
|
| 928 |
* @category reason
|
| 929 |
+
* @since 4.0.0
|
| 930 |
*/
|
| 931 |
export declare class ToolParameterValidationError extends ToolParameterValidationError_base {
|
| 932 |
/**
|
| 933 |
+
* Marks `ToolParameterValidationError` as a semantic AI error reason for runtime guards.
|
| 934 |
+
*
|
| 935 |
+
* @since 4.0.0
|
| 936 |
*/
|
| 937 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 938 |
/**
|
| 939 |
* Parameter validation errors are retryable because the model may correct parameters.
|
| 940 |
*
|
| 941 |
+
* @since 4.0.0
|
| 942 |
*/
|
| 943 |
get isRetryable(): boolean;
|
| 944 |
get message(): string;
|
|
|
|
| 952 |
* Error indicating the tool handler returned an invalid result that does not
|
| 953 |
* match the tool's schema.
|
| 954 |
*
|
| 955 |
+
* **Details**
|
| 956 |
+
*
|
| 957 |
* This error is not retryable because invalid results indicate a bug in the
|
| 958 |
* tool handler implementation.
|
| 959 |
*
|
| 960 |
+
* **Example** (Creating an invalid tool result error)
|
| 961 |
+
*
|
| 962 |
* ```ts
|
| 963 |
* import { AiError } from "effect/unstable/ai"
|
| 964 |
*
|
|
|
|
| 972 |
* // "Tool 'GetWeather' returned invalid result: missing 'temperature' field"
|
| 973 |
* ```
|
| 974 |
*
|
|
|
|
| 975 |
* @category reason
|
| 976 |
+
* @since 4.0.0
|
| 977 |
*/
|
| 978 |
export declare class InvalidToolResultError extends InvalidToolResultError_base {
|
| 979 |
/**
|
| 980 |
+
* Marks `InvalidToolResultError` as a semantic AI error reason for runtime guards.
|
| 981 |
+
*
|
| 982 |
+
* @since 4.0.0
|
| 983 |
*/
|
| 984 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 985 |
/**
|
| 986 |
* Invalid tool result errors are not retryable because they indicate a bug in the handler.
|
| 987 |
*
|
| 988 |
+
* @since 4.0.0
|
| 989 |
*/
|
| 990 |
get isRetryable(): boolean;
|
| 991 |
get message(): string;
|
|
|
|
| 999 |
/**
|
| 1000 |
* Error indicating the tool result cannot be encoded for sending back to the model.
|
| 1001 |
*
|
| 1002 |
+
* **Details**
|
| 1003 |
+
*
|
| 1004 |
* This error is not retryable because encoding failures indicate a bug in the
|
| 1005 |
* tool schema definitions.
|
| 1006 |
*
|
| 1007 |
+
* **Example** (Creating a tool result encoding error)
|
| 1008 |
+
*
|
| 1009 |
* ```ts
|
| 1010 |
* import { AiError } from "effect/unstable/ai"
|
| 1011 |
*
|
| 1012 |
* const error = new AiError.ToolResultEncodingError({
|
| 1013 |
* toolName: "GetWeather",
|
| 1014 |
+
* toolResult: { temperature: 72n },
|
| 1015 |
+
* description: "Cannot encode bigint values as JSON"
|
| 1016 |
* })
|
| 1017 |
*
|
| 1018 |
* console.log(error.isRetryable) // false
|
| 1019 |
* console.log(error.message)
|
| 1020 |
+
* // "Failed to encode result for tool 'GetWeather': Cannot encode bigint values as JSON"
|
| 1021 |
* ```
|
| 1022 |
*
|
|
|
|
| 1023 |
* @category reason
|
| 1024 |
+
* @since 4.0.0
|
| 1025 |
*/
|
| 1026 |
export declare class ToolResultEncodingError extends ToolResultEncodingError_base {
|
| 1027 |
/**
|
| 1028 |
+
* Marks `ToolResultEncodingError` as a semantic AI error reason for runtime guards.
|
| 1029 |
+
*
|
| 1030 |
+
* @since 4.0.0
|
| 1031 |
*/
|
| 1032 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1033 |
/**
|
| 1034 |
* Encoding errors are not retryable because they indicate a code bug.
|
| 1035 |
*
|
| 1036 |
+
* @since 4.0.0
|
| 1037 |
*/
|
| 1038 |
get isRetryable(): boolean;
|
| 1039 |
get message(): string;
|
|
|
|
| 1046 |
/**
|
| 1047 |
* Error indicating a provider-defined tool was configured with invalid arguments.
|
| 1048 |
*
|
| 1049 |
+
* **Details**
|
| 1050 |
+
*
|
| 1051 |
* This error is not retryable because it indicates a programming error in the
|
| 1052 |
* tool configuration that must be fixed in code.
|
| 1053 |
*
|
| 1054 |
+
* **Example** (Creating a tool configuration error)
|
| 1055 |
+
*
|
| 1056 |
* ```ts
|
| 1057 |
* import { AiError } from "effect/unstable/ai"
|
| 1058 |
*
|
|
|
|
| 1066 |
* // "Invalid configuration for tool 'OpenAiCodeInterpreter': Invalid container ID format"
|
| 1067 |
* ```
|
| 1068 |
*
|
|
|
|
| 1069 |
* @category reason
|
| 1070 |
+
* @since 4.0.0
|
| 1071 |
*/
|
| 1072 |
export declare class ToolConfigurationError extends ToolConfigurationError_base {
|
| 1073 |
/**
|
| 1074 |
+
* Marks `ToolConfigurationError` as a semantic AI error reason for runtime guards.
|
| 1075 |
+
*
|
| 1076 |
+
* @since 4.0.0
|
| 1077 |
*/
|
| 1078 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1079 |
/**
|
| 1080 |
* Configuration errors are not retryable because they indicate a code bug.
|
| 1081 |
*
|
| 1082 |
+
* @since 4.0.0
|
| 1083 |
*/
|
| 1084 |
get isRetryable(): boolean;
|
| 1085 |
get message(): string;
|
|
|
|
| 1092 |
/**
|
| 1093 |
* Error indicating an operation requires a toolkit but none was provided.
|
| 1094 |
*
|
| 1095 |
+
* **Details**
|
| 1096 |
+
*
|
| 1097 |
* This error occurs when tool approval responses are present in the prompt
|
| 1098 |
* but no toolkit was provided to resolve them.
|
| 1099 |
*
|
| 1100 |
+
* **Example** (Creating a toolkit required error)
|
| 1101 |
+
*
|
| 1102 |
* ```ts
|
| 1103 |
* import { AiError } from "effect/unstable/ai"
|
| 1104 |
*
|
|
|
|
| 1111 |
* // "Toolkit required to resolve pending tool approvals: GetWeather, SendEmail"
|
| 1112 |
* ```
|
| 1113 |
*
|
|
|
|
| 1114 |
* @category reason
|
| 1115 |
+
* @since 4.0.0
|
| 1116 |
*/
|
| 1117 |
export declare class ToolkitRequiredError extends ToolkitRequiredError_base {
|
| 1118 |
/**
|
| 1119 |
+
* Marks `ToolkitRequiredError` as a semantic AI error reason for runtime guards.
|
| 1120 |
+
*
|
| 1121 |
+
* @since 4.0.0
|
| 1122 |
*/
|
| 1123 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1124 |
/**
|
| 1125 |
* Toolkit required errors are not retryable without providing a toolkit.
|
| 1126 |
*
|
| 1127 |
+
* @since 4.0.0
|
| 1128 |
*/
|
| 1129 |
get isRetryable(): boolean;
|
| 1130 |
get message(): string;
|
|
|
|
| 1136 |
/**
|
| 1137 |
* Error indicating the user provided invalid input in their prompt.
|
| 1138 |
*
|
| 1139 |
+
* **Details**
|
| 1140 |
+
*
|
| 1141 |
* This error is raised when the prompt contains content that is structurally
|
| 1142 |
* valid but not supported by the provider (e.g., unsupported media types,
|
| 1143 |
* unsupported file formats, etc.).
|
| 1144 |
*
|
| 1145 |
+
* **Example** (Creating an invalid user input error)
|
| 1146 |
+
*
|
| 1147 |
* ```ts
|
| 1148 |
* import { AiError } from "effect/unstable/ai"
|
| 1149 |
*
|
| 1150 |
* const error = new AiError.InvalidUserInputError({
|
| 1151 |
+
* description: "Unsupported media type 'video/mp4'. Supported types include images, application/pdf, text/plain"
|
| 1152 |
* })
|
| 1153 |
*
|
| 1154 |
* console.log(error.isRetryable) // false
|
| 1155 |
* console.log(error.message)
|
| 1156 |
+
* // "Invalid user input: Unsupported media type 'video/mp4'. Supported types include images, application/pdf, text/plain"
|
| 1157 |
* ```
|
| 1158 |
*
|
|
|
|
| 1159 |
* @category reason
|
| 1160 |
+
* @since 4.0.0
|
| 1161 |
*/
|
| 1162 |
export declare class InvalidUserInputError extends InvalidUserInputError_base {
|
| 1163 |
/**
|
| 1164 |
+
* Marks `InvalidUserInputError` as a semantic AI error reason for runtime guards.
|
| 1165 |
+
*
|
| 1166 |
+
* @since 4.0.0
|
| 1167 |
*/
|
| 1168 |
readonly [ReasonTypeId]: "~effect/unstable/ai/AiError/Reason";
|
| 1169 |
/**
|
| 1170 |
* Invalid user input errors require fixing the input and are not retryable.
|
| 1171 |
*
|
| 1172 |
+
* @since 4.0.0
|
| 1173 |
*/
|
| 1174 |
get isRetryable(): boolean;
|
| 1175 |
get message(): string;
|
|
|
|
| 1177 |
/**
|
| 1178 |
* Union type of all semantic error reasons that can occur during AI operations.
|
| 1179 |
*
|
| 1180 |
+
* **Details**
|
| 1181 |
+
*
|
| 1182 |
+
* Every reason carries a semantic `_tag`, a human-readable message, and an
|
| 1183 |
+
* `isRetryable` getter. Provider-facing reasons may also include retry timing,
|
| 1184 |
+
* provider metadata, usage information, or HTTP context.
|
| 1185 |
*
|
|
|
|
| 1186 |
* @category models
|
| 1187 |
+
* @since 4.0.0
|
| 1188 |
*/
|
| 1189 |
export type AiErrorReason = RateLimitError | QuotaExhaustedError | AuthenticationError | ContentPolicyError | InvalidRequestError | InternalProviderError | NetworkError | InvalidOutputError | StructuredOutputError | UnsupportedSchemaError | UnknownError | ToolNotFoundError | ToolParameterValidationError | InvalidToolResultError | ToolResultEncodingError | ToolConfigurationError | ToolkitRequiredError | InvalidUserInputError;
|
| 1190 |
/**
|
| 1191 |
* Schema for validating and parsing AI error reasons.
|
| 1192 |
*
|
| 1193 |
+
* **When to use**
|
| 1194 |
+
*
|
| 1195 |
+
* Use when decoding or validating unknown AI error reason values with Schema.
|
| 1196 |
+
*
|
| 1197 |
+
* **Details**
|
| 1198 |
+
*
|
| 1199 |
+
* This runtime schema is the union of the concrete AI error reason classes.
|
| 1200 |
+
*
|
| 1201 |
+
* @see {@link isAiErrorReason} for checking an existing value without Schema decoding
|
| 1202 |
+
*
|
| 1203 |
* @category schemas
|
| 1204 |
+
* @since 4.0.0
|
| 1205 |
*/
|
| 1206 |
export declare const AiErrorReason: Schema.Union<[
|
| 1207 |
typeof RateLimitError,
|
|
|
|
| 1231 |
readonly reason: Schema.Union<[typeof RateLimitError, typeof QuotaExhaustedError, typeof AuthenticationError, typeof ContentPolicyError, typeof InvalidRequestError, typeof InternalProviderError, typeof NetworkError, typeof InvalidOutputError, typeof StructuredOutputError, typeof UnsupportedSchemaError, typeof UnknownError, typeof ToolNotFoundError, typeof ToolParameterValidationError, typeof InvalidToolResultError, typeof ToolResultEncodingError, typeof ToolConfigurationError, typeof ToolkitRequiredError, typeof InvalidUserInputError]>;
|
| 1232 |
}>, import("../../Cause.ts").YieldableError>;
|
| 1233 |
/**
|
| 1234 |
+
* Schema for the top-level AI error wrapper using the `reason` pattern.
|
| 1235 |
*
|
| 1236 |
+
* **When to use**
|
|
|
|
|
|
|
|
|
|
| 1237 |
*
|
| 1238 |
+
* Use when you need AI errors that can be handled by semantic reason with
|
| 1239 |
+
* `Effect.catchReason`.
|
| 1240 |
+
*
|
| 1241 |
+
* **Details**
|
| 1242 |
+
*
|
| 1243 |
+
* This error stores `module` and `method` context, the semantic `reason`, and
|
| 1244 |
+
* delegates `isRetryable` and `retryAfter` to the underlying reason.
|
| 1245 |
+
*
|
| 1246 |
+
* **Example** (Handling an AI error by tag)
|
| 1247 |
*
|
|
|
|
| 1248 |
* ```ts
|
| 1249 |
* import { Effect } from "effect"
|
| 1250 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 1262 |
* )
|
| 1263 |
* ```
|
| 1264 |
*
|
|
|
|
| 1265 |
* @category schemas
|
| 1266 |
+
* @since 4.0.0
|
| 1267 |
*/
|
| 1268 |
export declare class AiError extends AiError_base {
|
| 1269 |
readonly [TypeId]: "~effect/unstable/ai/AiError/AiError";
|
|
|
|
| 1271 |
/**
|
| 1272 |
* Delegates to the underlying reason's `isRetryable` getter.
|
| 1273 |
*
|
| 1274 |
+
* @since 4.0.0
|
| 1275 |
*/
|
| 1276 |
get isRetryable(): boolean;
|
| 1277 |
/**
|
| 1278 |
* Delegates to the underlying reason's `retryAfter` if present.
|
| 1279 |
*
|
| 1280 |
+
* @since 4.0.0
|
| 1281 |
*/
|
| 1282 |
get retryAfter(): Duration.Duration | undefined;
|
| 1283 |
get message(): string;
|
|
|
|
| 1285 |
/**
|
| 1286 |
* The encoded (serialized) form of an `AiError`.
|
| 1287 |
*
|
|
|
|
| 1288 |
* @category schemas
|
| 1289 |
+
* @since 4.0.0
|
| 1290 |
*/
|
| 1291 |
export type AiErrorEncoded = typeof AiError["Encoded"];
|
| 1292 |
/**
|
| 1293 |
* Type guard to check if a value is an `AiError`.
|
| 1294 |
*
|
| 1295 |
+
* **Example** (Checking for an AI error)
|
|
|
|
| 1296 |
*
|
|
|
|
| 1297 |
* ```ts
|
| 1298 |
* import { AiError } from "effect/unstable/ai"
|
| 1299 |
*
|
|
|
|
| 1308 |
* console.log(AiError.isAiError(aiError)) // true
|
| 1309 |
* ```
|
| 1310 |
*
|
|
|
|
| 1311 |
* @category guards
|
| 1312 |
+
* @since 4.0.0
|
| 1313 |
*/
|
| 1314 |
export declare const isAiError: (u: unknown) => u is AiError;
|
| 1315 |
/**
|
| 1316 |
* Type guard to check if a value is an `AiErrorReason`.
|
| 1317 |
*
|
| 1318 |
+
* **Example** (Checking for an AI error reason)
|
|
|
|
| 1319 |
*
|
|
|
|
| 1320 |
* ```ts
|
| 1321 |
* import { AiError } from "effect/unstable/ai"
|
| 1322 |
*
|
|
|
|
| 1327 |
* console.log(AiError.isAiErrorReason(genericError)) // false
|
| 1328 |
* ```
|
| 1329 |
*
|
|
|
|
| 1330 |
* @category guards
|
| 1331 |
+
* @since 4.0.0
|
| 1332 |
*/
|
| 1333 |
export declare const isAiErrorReason: (u: unknown) => u is AiErrorReason;
|
| 1334 |
/**
|
| 1335 |
* Creates an `AiError` with the given reason.
|
| 1336 |
*
|
| 1337 |
+
* **Example** (Creating an AI error)
|
| 1338 |
+
*
|
| 1339 |
* ```ts
|
| 1340 |
* import { Duration } from "effect"
|
| 1341 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 1352 |
* // "OpenAI.completion: Rate limit exceeded. Retry after 1 minute"
|
| 1353 |
* ```
|
| 1354 |
*
|
|
|
|
| 1355 |
* @category constructors
|
| 1356 |
+
* @since 4.0.0
|
| 1357 |
*/
|
| 1358 |
export declare const make: (params: {
|
| 1359 |
readonly module: string;
|
|
|
|
| 1363 |
/**
|
| 1364 |
* Maps HTTP status codes to semantic error reasons.
|
| 1365 |
*
|
| 1366 |
+
* **When to use**
|
| 1367 |
+
*
|
| 1368 |
+
* Use as the base mapping when provider packages translate HTTP status codes into
|
| 1369 |
+
* provider-specific error reasons.
|
| 1370 |
+
*
|
| 1371 |
+
* **Example** (Mapping an HTTP status to a reason)
|
| 1372 |
*
|
|
|
|
| 1373 |
* ```ts
|
| 1374 |
* import { AiError } from "effect/unstable/ai"
|
| 1375 |
*
|
|
|
|
| 1381 |
* console.log(reason._tag) // "RateLimitError"
|
| 1382 |
* ```
|
| 1383 |
*
|
|
|
|
| 1384 |
* @category constructors
|
| 1385 |
+
* @since 4.0.0
|
| 1386 |
*/
|
| 1387 |
export declare const reasonFromHttpStatus: (params: {
|
| 1388 |
readonly status: number;
|
.opencode/node_modules/effect/dist/unstable/ai/AiError.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"AiError.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/AiError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"AiError.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/AiError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAM7C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAGlE,QAAA,MAAM,YAAY,EAAG,oCAA6C,CAAA;;;;;;;;;;;;;AAsBlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,YAAa,SAAQ,iBAOhC;IACA;;;;OAIG;IACH,QAAQ,CAAC,CAAC,YAAY,CAAC,uCAAe;IAEtC;;;;OAIG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,eAAe,CAAC,YAAY,GAAG,YAAY;IAc1E,IAAa,OAAO,IAAI,MAAM,CA+B7B;CACF;AAUD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAC3C,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CACkB,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,sBAAuB,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AAU,IAAI,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAE9C;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OAA2C,CAAA;AAEvF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,aAAuD,CAAA;AAEzG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAC/B,KAAG,OAA8B,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,WAAW,CAAC,IAAI,CAAA;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,gBAAgB,CAAC,IAAI,CAAA;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1C,KAAG,aAsBH,CAAA"}
|
.opencode/node_modules/effect/dist/unstable/ai/AiError.js
CHANGED
|
@@ -1,82 +1,15 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* for AI operations.
|
| 4 |
-
*
|
| 5 |
-
* This module uses the `reason` pattern where `AiError` is a top-level
|
| 6 |
-
* wrapper error containing `module`, `method`, and a `reason` field that holds
|
| 7 |
-
* the semantic error. This design enables ergonomic error handling while
|
| 8 |
-
* preserving rich context about failures.
|
| 9 |
-
*
|
| 10 |
-
* ## Semantic Error Categories
|
| 11 |
-
*
|
| 12 |
-
* - **RateLimitError** - Request throttled (429s, provider-specific limits)
|
| 13 |
-
* - **QuotaExhaustedError** - Account/billing limits reached
|
| 14 |
-
* - **AuthenticationError** - Invalid/expired credentials
|
| 15 |
-
* - **ContentPolicyError** - Input/output violated content policy
|
| 16 |
-
* - **InvalidRequestError** - Malformed request parameters
|
| 17 |
-
* - **InvalidUserInputError** - Prompt contains unsupported content
|
| 18 |
-
* - **InternalProviderError** - Provider-side failures (5xx)
|
| 19 |
-
* - **NetworkError** - Transport-level failures
|
| 20 |
-
* - **InvalidOutputError** - LLM output parsing/validation failures
|
| 21 |
-
* - **StructuredOutputError** - LLM generated text that doesn't conform to structured output schema
|
| 22 |
-
* - **UnsupportedSchemaError** - Codec transformer rejected a schema with unsupported constructs
|
| 23 |
-
* - **UnknownError** - Catch-all for unknown errors
|
| 24 |
-
*
|
| 25 |
-
* ## Tool Call Errors
|
| 26 |
-
*
|
| 27 |
-
* - **ToolNotFoundError** - Model requested non-existent tool
|
| 28 |
-
* - **ToolParameterValidationError** - Tool call params failed validation
|
| 29 |
-
* - **InvalidToolResultError** - Tool handler returned invalid result
|
| 30 |
-
* - **ToolResultEncodingError** - Tool result encoding failed
|
| 31 |
-
* - **ToolConfigurationError** - Provider tool misconfigured
|
| 32 |
-
*
|
| 33 |
-
* ## Retryability
|
| 34 |
-
*
|
| 35 |
-
* Each reason type has an `isRetryable` getter indicating whether the error is
|
| 36 |
-
* transient. Some errors also provide a `retryAfter` duration hint.
|
| 37 |
-
*
|
| 38 |
-
* @example
|
| 39 |
-
* ```ts
|
| 40 |
-
* import { Effect, Match } from "effect"
|
| 41 |
-
* import type { AiError } from "effect/unstable/ai"
|
| 42 |
-
*
|
| 43 |
-
* // Handle errors using Match on the reason
|
| 44 |
-
* const handleAiError = Match.type<AiError.AiError>().pipe(
|
| 45 |
-
* Match.when(
|
| 46 |
-
* { reason: { _tag: "RateLimitError" } },
|
| 47 |
-
* (err) => Effect.logWarning(`Rate limited, retry after ${err.retryAfter}`)
|
| 48 |
-
* ),
|
| 49 |
-
* Match.when(
|
| 50 |
-
* { reason: { _tag: "AuthenticationError" } },
|
| 51 |
-
* (err) => Effect.logError(`Auth failed: ${err.reason.kind}`)
|
| 52 |
-
* ),
|
| 53 |
-
* Match.when(
|
| 54 |
-
* { reason: { isRetryable: true } },
|
| 55 |
-
* (err) => Effect.logWarning(`Transient error, retrying: ${err.message}`)
|
| 56 |
-
* ),
|
| 57 |
-
* Match.orElse((err) => Effect.logError(`Permanent error: ${err.message}`))
|
| 58 |
-
* )
|
| 59 |
-
* ```
|
| 60 |
-
*
|
| 61 |
-
* @example
|
| 62 |
-
* ```ts
|
| 63 |
-
* import { Duration, Effect } from "effect"
|
| 64 |
-
* import { AiError } from "effect/unstable/ai"
|
| 65 |
-
*
|
| 66 |
-
* // Create an AiError with a reason
|
| 67 |
-
* const error = AiError.make({
|
| 68 |
-
* module: "OpenAI",
|
| 69 |
-
* method: "completion",
|
| 70 |
-
* reason: new AiError.RateLimitError({
|
| 71 |
-
* retryAfter: Duration.seconds(60)
|
| 72 |
-
* })
|
| 73 |
-
* })
|
| 74 |
*
|
| 75 |
-
*
|
| 76 |
-
*
|
| 77 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
*
|
| 79 |
-
* @since
|
| 80 |
*/
|
| 81 |
import * as Duration from "../../Duration.js";
|
| 82 |
import * as Effect from "../../Effect.js";
|
|
@@ -103,11 +36,14 @@ const redactHeaders = headers => {
|
|
| 103 |
/**
|
| 104 |
* Error indicating a network-level failure before receiving a response.
|
| 105 |
*
|
|
|
|
|
|
|
| 106 |
* This error is raised when issues arise before receiving an HTTP response,
|
| 107 |
* such as network connectivity problems, request encoding issues, or invalid
|
| 108 |
* URLs.
|
| 109 |
*
|
| 110 |
-
*
|
|
|
|
| 111 |
* ```ts
|
| 112 |
* import { AiError } from "effect/unstable/ai"
|
| 113 |
*
|
|
@@ -128,8 +64,8 @@ const redactHeaders = headers => {
|
|
| 128 |
* // "Transport: Connection timeout after 30 seconds (POST https://api.openai.com/v1/completions)"
|
| 129 |
* ```
|
| 130 |
*
|
| 131 |
-
* @since 1.0.0
|
| 132 |
* @category reason
|
|
|
|
| 133 |
*/
|
| 134 |
export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/NetworkError")({
|
| 135 |
_tag: /*#__PURE__*/Schema.tag("NetworkError"),
|
|
@@ -138,13 +74,15 @@ export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 138 |
description: /*#__PURE__*/Schema.optional(Schema.String)
|
| 139 |
}) {
|
| 140 |
/**
|
| 141 |
-
*
|
|
|
|
|
|
|
| 142 |
*/
|
| 143 |
[ReasonTypeId] = ReasonTypeId;
|
| 144 |
/**
|
| 145 |
* Transport errors are retryable; encoding and URL errors are not.
|
| 146 |
*
|
| 147 |
-
* @since
|
| 148 |
*/
|
| 149 |
get isRetryable() {
|
| 150 |
return this.reason === "TransportError";
|
|
@@ -152,7 +90,8 @@ export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 152 |
/**
|
| 153 |
* Creates a NetworkError from a platform HttpClientError.RequestError.
|
| 154 |
*
|
| 155 |
-
*
|
|
|
|
| 156 |
* ```ts
|
| 157 |
* import { AiError } from "effect/unstable/ai"
|
| 158 |
* import type { HttpClientError } from "effect/unstable/http"
|
|
@@ -162,8 +101,7 @@ export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 162 |
* const aiError = AiError.NetworkError.fromRequestError(platformError)
|
| 163 |
* ```
|
| 164 |
*
|
| 165 |
-
* @since
|
| 166 |
-
* @category constructors
|
| 167 |
*/
|
| 168 |
static fromRequestError(error) {
|
| 169 |
return new NetworkError({
|
|
@@ -214,25 +152,37 @@ export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 214 |
/**
|
| 215 |
* Schema for provider-specific metadata which can be attached to error reasons.
|
| 216 |
*
|
| 217 |
-
*
|
| 218 |
*
|
| 219 |
-
*
|
| 220 |
-
*
|
| 221 |
-
*
|
| 222 |
-
*
|
| 223 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
* }
|
| 225 |
* ```
|
| 226 |
*
|
| 227 |
-
* @since 1.0.0
|
| 228 |
* @category schemas
|
|
|
|
| 229 |
*/
|
| 230 |
export const ProviderMetadata = /*#__PURE__*/Schema.Record(Schema.String, /*#__PURE__*/Schema.NullOr(Schema.MutableJson));
|
| 231 |
/**
|
| 232 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
*
|
| 234 |
-
* @since 1.0.0
|
| 235 |
* @category schemas
|
|
|
|
| 236 |
*/
|
| 237 |
export const UsageInfo = /*#__PURE__*/Schema.Struct({
|
| 238 |
promptTokens: Schema.optional(Schema.Number),
|
|
@@ -242,10 +192,23 @@ export const UsageInfo = /*#__PURE__*/Schema.Struct({
|
|
| 242 |
identifier: "UsageInfo"
|
| 243 |
});
|
| 244 |
/**
|
| 245 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
*
|
| 247 |
-
* @since 1.0.0
|
| 248 |
* @category schemas
|
|
|
|
| 249 |
*/
|
| 250 |
export const HttpContext = /*#__PURE__*/Schema.Struct({
|
| 251 |
request: HttpRequestDetails,
|
|
@@ -260,10 +223,13 @@ export const HttpContext = /*#__PURE__*/Schema.Struct({
|
|
| 260 |
/**
|
| 261 |
* Error indicating the request was rate limited.
|
| 262 |
*
|
|
|
|
|
|
|
| 263 |
* Rate limit errors are always retryable. When `retryAfter` is provided,
|
| 264 |
* callers should wait that duration before retrying.
|
| 265 |
*
|
| 266 |
-
*
|
|
|
|
| 267 |
* ```ts
|
| 268 |
* import { Duration } from "effect"
|
| 269 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -276,8 +242,8 @@ export const HttpContext = /*#__PURE__*/Schema.Struct({
|
|
| 276 |
* console.log(rateLimitError.message) // "Rate limit exceeded. Retry after 1 minute"
|
| 277 |
* ```
|
| 278 |
*
|
| 279 |
-
* @since 1.0.0
|
| 280 |
* @category reason
|
|
|
|
| 281 |
*/
|
| 282 |
export class RateLimitError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/RateLimitError")({
|
| 283 |
_tag: /*#__PURE__*/Schema.tag("RateLimitError"),
|
|
@@ -286,13 +252,15 @@ export class RateLimitError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Ai
|
|
| 286 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 287 |
}) {
|
| 288 |
/**
|
| 289 |
-
*
|
|
|
|
|
|
|
| 290 |
*/
|
| 291 |
[ReasonTypeId] = ReasonTypeId;
|
| 292 |
/**
|
| 293 |
* Rate limit errors are always retryable.
|
| 294 |
*
|
| 295 |
-
* @since
|
| 296 |
*/
|
| 297 |
get isRetryable() {
|
| 298 |
return true;
|
|
@@ -306,9 +274,12 @@ export class RateLimitError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Ai
|
|
| 306 |
/**
|
| 307 |
* Error indicating account or billing limits have been reached.
|
| 308 |
*
|
|
|
|
|
|
|
| 309 |
* Quota exhausted errors are not retryable without user action.
|
| 310 |
*
|
| 311 |
-
*
|
|
|
|
| 312 |
* ```ts
|
| 313 |
* import { AiError } from "effect/unstable/ai"
|
| 314 |
*
|
|
@@ -319,8 +290,8 @@ export class RateLimitError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Ai
|
|
| 319 |
* // "Quota exhausted. Check your account billing and usage limits."
|
| 320 |
* ```
|
| 321 |
*
|
| 322 |
-
* @since 1.0.0
|
| 323 |
* @category reason
|
|
|
|
| 324 |
*/
|
| 325 |
export class QuotaExhaustedError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/QuotaExhaustedError")({
|
| 326 |
_tag: /*#__PURE__*/Schema.tag("QuotaExhaustedError"),
|
|
@@ -329,13 +300,15 @@ export class QuotaExhaustedError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 329 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 330 |
}) {
|
| 331 |
/**
|
| 332 |
-
*
|
|
|
|
|
|
|
| 333 |
*/
|
| 334 |
[ReasonTypeId] = ReasonTypeId;
|
| 335 |
/**
|
| 336 |
* Quota exhausted errors require user action and are not retryable.
|
| 337 |
*
|
| 338 |
-
* @since
|
| 339 |
*/
|
| 340 |
get isRetryable() {
|
| 341 |
return false;
|
|
@@ -349,9 +322,12 @@ export class QuotaExhaustedError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 349 |
/**
|
| 350 |
* Error indicating authentication or authorization failure.
|
| 351 |
*
|
|
|
|
|
|
|
| 352 |
* Authentication errors are never retryable without credential changes.
|
| 353 |
*
|
| 354 |
-
*
|
|
|
|
| 355 |
* ```ts
|
| 356 |
* import { AiError } from "effect/unstable/ai"
|
| 357 |
*
|
|
@@ -364,8 +340,8 @@ export class QuotaExhaustedError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 364 |
* // "InvalidKey: Verify your API key is correct"
|
| 365 |
* ```
|
| 366 |
*
|
| 367 |
-
* @since 1.0.0
|
| 368 |
* @category reason
|
|
|
|
| 369 |
*/
|
| 370 |
export class AuthenticationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/AuthenticationError")({
|
| 371 |
_tag: /*#__PURE__*/Schema.tag("AuthenticationError"),
|
|
@@ -374,13 +350,15 @@ export class AuthenticationError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 374 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 375 |
}) {
|
| 376 |
/**
|
| 377 |
-
*
|
|
|
|
|
|
|
| 378 |
*/
|
| 379 |
[ReasonTypeId] = ReasonTypeId;
|
| 380 |
/**
|
| 381 |
* Authentication errors require credential changes and are not retryable.
|
| 382 |
*
|
| 383 |
-
* @since
|
| 384 |
*/
|
| 385 |
get isRetryable() {
|
| 386 |
return false;
|
|
@@ -399,9 +377,12 @@ export class AuthenticationError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 399 |
/**
|
| 400 |
* Error indicating content policy violation.
|
| 401 |
*
|
|
|
|
|
|
|
| 402 |
* Content policy errors are never retryable without content changes.
|
| 403 |
*
|
| 404 |
-
*
|
|
|
|
| 405 |
* ```ts
|
| 406 |
* import { AiError } from "effect/unstable/ai"
|
| 407 |
*
|
|
@@ -414,8 +395,8 @@ export class AuthenticationError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 414 |
* // "Content policy violation: Input contains prohibited content"
|
| 415 |
* ```
|
| 416 |
*
|
| 417 |
-
* @since 1.0.0
|
| 418 |
* @category reason
|
|
|
|
| 419 |
*/
|
| 420 |
export class ContentPolicyError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ContentPolicyError")({
|
| 421 |
_tag: /*#__PURE__*/Schema.tag("ContentPolicyError"),
|
|
@@ -424,13 +405,15 @@ export class ContentPolicyError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 424 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 425 |
}) {
|
| 426 |
/**
|
| 427 |
-
*
|
|
|
|
|
|
|
| 428 |
*/
|
| 429 |
[ReasonTypeId] = ReasonTypeId;
|
| 430 |
/**
|
| 431 |
* Content policy errors require content changes and are not retryable.
|
| 432 |
*
|
| 433 |
-
* @since
|
| 434 |
*/
|
| 435 |
get isRetryable() {
|
| 436 |
return false;
|
|
@@ -442,9 +425,12 @@ export class ContentPolicyError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 442 |
/**
|
| 443 |
* Error indicating the request had invalid or malformed parameters.
|
| 444 |
*
|
|
|
|
|
|
|
| 445 |
* Invalid request errors require fixing the request and are not retryable.
|
| 446 |
*
|
| 447 |
-
*
|
|
|
|
| 448 |
* ```ts
|
| 449 |
* import { AiError } from "effect/unstable/ai"
|
| 450 |
*
|
|
@@ -459,8 +445,8 @@ export class ContentPolicyError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 459 |
* // "Invalid request: parameter 'temperature' must be between 0 and 2. Temperature value 5 is out of range"
|
| 460 |
* ```
|
| 461 |
*
|
| 462 |
-
* @since 1.0.0
|
| 463 |
* @category reason
|
|
|
|
| 464 |
*/
|
| 465 |
export class InvalidRequestError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidRequestError")({
|
| 466 |
_tag: /*#__PURE__*/Schema.tag("InvalidRequestError"),
|
|
@@ -471,13 +457,15 @@ export class InvalidRequestError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 471 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 472 |
}) {
|
| 473 |
/**
|
| 474 |
-
*
|
|
|
|
|
|
|
| 475 |
*/
|
| 476 |
[ReasonTypeId] = ReasonTypeId;
|
| 477 |
/**
|
| 478 |
* Invalid request errors require fixing the request and are not retryable.
|
| 479 |
*
|
| 480 |
-
* @since
|
| 481 |
*/
|
| 482 |
get isRetryable() {
|
| 483 |
return false;
|
|
@@ -493,9 +481,12 @@ export class InvalidRequestError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 493 |
/**
|
| 494 |
* Error indicating the AI provider experienced an internal error.
|
| 495 |
*
|
|
|
|
|
|
|
| 496 |
* Internal provider errors are typically transient and are retryable.
|
| 497 |
*
|
| 498 |
-
*
|
|
|
|
| 499 |
* ```ts
|
| 500 |
* import { AiError } from "effect/unstable/ai"
|
| 501 |
*
|
|
@@ -508,8 +499,8 @@ export class InvalidRequestError extends /*#__PURE__*/Schema.ErrorClass("effect/
|
|
| 508 |
* // "Internal provider error: Server encountered an unexpected error"
|
| 509 |
* ```
|
| 510 |
*
|
| 511 |
-
* @since 1.0.0
|
| 512 |
* @category reason
|
|
|
|
| 513 |
*/
|
| 514 |
export class InternalProviderError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InternalProviderError")({
|
| 515 |
_tag: /*#__PURE__*/Schema.tag("InternalProviderError"),
|
|
@@ -518,13 +509,15 @@ export class InternalProviderError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 518 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 519 |
}) {
|
| 520 |
/**
|
| 521 |
-
*
|
|
|
|
|
|
|
| 522 |
*/
|
| 523 |
[ReasonTypeId] = ReasonTypeId;
|
| 524 |
/**
|
| 525 |
* Internal provider errors are typically transient and are retryable.
|
| 526 |
*
|
| 527 |
-
* @since
|
| 528 |
*/
|
| 529 |
get isRetryable() {
|
| 530 |
return true;
|
|
@@ -536,9 +529,12 @@ export class InternalProviderError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 536 |
/**
|
| 537 |
* Error indicating failure to parse or validate LLM output.
|
| 538 |
*
|
|
|
|
|
|
|
| 539 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 540 |
*
|
| 541 |
-
*
|
|
|
|
| 542 |
* ```ts
|
| 543 |
* import { AiError } from "effect/unstable/ai"
|
| 544 |
*
|
|
@@ -551,8 +547,8 @@ export class InternalProviderError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 551 |
* // "Invalid output: Expected a string but received a number"
|
| 552 |
* ```
|
| 553 |
*
|
| 554 |
-
* @since 1.0.0
|
| 555 |
* @category reason
|
|
|
|
| 556 |
*/
|
| 557 |
export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidOutputError")({
|
| 558 |
_tag: /*#__PURE__*/Schema.tag("InvalidOutputError"),
|
|
@@ -561,13 +557,15 @@ export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 561 |
usage: /*#__PURE__*/Schema.optional(UsageInfo)
|
| 562 |
}) {
|
| 563 |
/**
|
| 564 |
-
*
|
|
|
|
|
|
|
| 565 |
*/
|
| 566 |
[ReasonTypeId] = ReasonTypeId;
|
| 567 |
/**
|
| 568 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 569 |
*
|
| 570 |
-
* @since
|
| 571 |
*/
|
| 572 |
get isRetryable() {
|
| 573 |
return true;
|
|
@@ -575,7 +573,8 @@ export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 575 |
/**
|
| 576 |
* Creates an InvalidOutputError from a Schema error.
|
| 577 |
*
|
| 578 |
-
*
|
|
|
|
| 579 |
* ```ts
|
| 580 |
* import { Schema } from "effect"
|
| 581 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -585,8 +584,7 @@ export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 585 |
* const parseError = AiError.InvalidOutputError.fromSchemaError(schemaError)
|
| 586 |
* ```
|
| 587 |
*
|
| 588 |
-
* @since
|
| 589 |
-
* @category constructors
|
| 590 |
*/
|
| 591 |
static fromSchemaError(error) {
|
| 592 |
return new InvalidOutputError({
|
|
@@ -601,9 +599,12 @@ export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 601 |
* Error indicating the LLM generated text that does not conform to the
|
| 602 |
* requested structured output schema.
|
| 603 |
*
|
|
|
|
|
|
|
| 604 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 605 |
*
|
| 606 |
-
*
|
|
|
|
| 607 |
* ```ts
|
| 608 |
* import { AiError } from "effect/unstable/ai"
|
| 609 |
*
|
|
@@ -617,8 +618,8 @@ export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/a
|
|
| 617 |
* // "Structured output validation failed: Expected a valid JSON object"
|
| 618 |
* ```
|
| 619 |
*
|
| 620 |
-
* @since 1.0.0
|
| 621 |
* @category reason
|
|
|
|
| 622 |
*/
|
| 623 |
export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/StructuredOutputError")({
|
| 624 |
_tag: /*#__PURE__*/Schema.tag("StructuredOutputError"),
|
|
@@ -628,13 +629,15 @@ export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 628 |
usage: /*#__PURE__*/Schema.optional(UsageInfo)
|
| 629 |
}) {
|
| 630 |
/**
|
| 631 |
-
*
|
|
|
|
|
|
|
| 632 |
*/
|
| 633 |
[ReasonTypeId] = ReasonTypeId;
|
| 634 |
/**
|
| 635 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 636 |
*
|
| 637 |
-
* @since
|
| 638 |
*/
|
| 639 |
get isRetryable() {
|
| 640 |
return true;
|
|
@@ -642,7 +645,8 @@ export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 642 |
/**
|
| 643 |
* Creates a StructuredOutputError from a Schema error.
|
| 644 |
*
|
| 645 |
-
*
|
|
|
|
| 646 |
* ```ts
|
| 647 |
* import { Schema } from "effect"
|
| 648 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -653,8 +657,7 @@ export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 653 |
* const parseError = AiError.StructuredOutputError.fromSchemaError(schemaError, rawText)
|
| 654 |
* ```
|
| 655 |
*
|
| 656 |
-
* @since
|
| 657 |
-
* @category constructors
|
| 658 |
*/
|
| 659 |
static fromSchemaError(error, responseText) {
|
| 660 |
return new StructuredOutputError({
|
|
@@ -670,10 +673,13 @@ export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 670 |
* Error indicating a codec transformer rejected a schema because it contains
|
| 671 |
* unsupported constructs.
|
| 672 |
*
|
|
|
|
|
|
|
| 673 |
* Unsupported schema errors are not retryable because they indicate a
|
| 674 |
* programmer error where the schema is incompatible with the provider.
|
| 675 |
*
|
| 676 |
-
*
|
|
|
|
| 677 |
* ```ts
|
| 678 |
* import { AiError } from "effect/unstable/ai"
|
| 679 |
*
|
|
@@ -686,8 +692,8 @@ export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 686 |
* // "Unsupported schema: Unions are not supported in Anthropic structured output"
|
| 687 |
* ```
|
| 688 |
*
|
| 689 |
-
* @since 1.0.0
|
| 690 |
* @category reason
|
|
|
|
| 691 |
*/
|
| 692 |
export class UnsupportedSchemaError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/UnsupportedSchemaError")({
|
| 693 |
_tag: /*#__PURE__*/Schema.tag("UnsupportedSchemaError"),
|
|
@@ -695,13 +701,15 @@ export class UnsupportedSchemaError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 695 |
metadata: /*#__PURE__*/providerMetadataWithDefaults()
|
| 696 |
}) {
|
| 697 |
/**
|
| 698 |
-
*
|
|
|
|
|
|
|
| 699 |
*/
|
| 700 |
[ReasonTypeId] = ReasonTypeId;
|
| 701 |
/**
|
| 702 |
* Unsupported schema errors are not retryable because they indicate a programmer error.
|
| 703 |
*
|
| 704 |
-
* @since
|
| 705 |
*/
|
| 706 |
get isRetryable() {
|
| 707 |
return false;
|
|
@@ -711,11 +719,14 @@ export class UnsupportedSchemaError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 711 |
}
|
| 712 |
}
|
| 713 |
/**
|
| 714 |
-
*
|
|
|
|
|
|
|
| 715 |
*
|
| 716 |
* Unknown errors are not retryable by default since the cause is unknown.
|
| 717 |
*
|
| 718 |
-
*
|
|
|
|
| 719 |
* ```ts
|
| 720 |
* import { AiError } from "effect/unstable/ai"
|
| 721 |
*
|
|
@@ -728,8 +739,8 @@ export class UnsupportedSchemaError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 728 |
* // "An unexpected error occurred"
|
| 729 |
* ```
|
| 730 |
*
|
| 731 |
-
* @since 1.0.0
|
| 732 |
* @category reason
|
|
|
|
| 733 |
*/
|
| 734 |
export class UnknownError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/UnknownError")({
|
| 735 |
_tag: /*#__PURE__*/Schema.tag("UnknownError"),
|
|
@@ -738,13 +749,15 @@ export class UnknownError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 738 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 739 |
}) {
|
| 740 |
/**
|
| 741 |
-
*
|
|
|
|
|
|
|
| 742 |
*/
|
| 743 |
[ReasonTypeId] = ReasonTypeId;
|
| 744 |
/**
|
| 745 |
* Unknown errors are not retryable by default.
|
| 746 |
*
|
| 747 |
-
* @since
|
| 748 |
*/
|
| 749 |
get isRetryable() {
|
| 750 |
return false;
|
|
@@ -759,10 +772,13 @@ export class UnknownError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 759 |
/**
|
| 760 |
* Error indicating the model requested a tool that doesn't exist in the toolkit.
|
| 761 |
*
|
|
|
|
|
|
|
| 762 |
* This error is retryable because the model may self-correct when provided
|
| 763 |
* with the list of available tools.
|
| 764 |
*
|
| 765 |
-
*
|
|
|
|
| 766 |
* ```ts
|
| 767 |
* import { AiError } from "effect/unstable/ai"
|
| 768 |
*
|
|
@@ -776,8 +792,8 @@ export class UnknownError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiEr
|
|
| 776 |
* // "Tool 'unknownTool' not found. Available tools: GetWeather, GetTime"
|
| 777 |
* ```
|
| 778 |
*
|
| 779 |
-
* @since 1.0.0
|
| 780 |
* @category reason
|
|
|
|
| 781 |
*/
|
| 782 |
export class ToolNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolNotFoundError")({
|
| 783 |
_tag: /*#__PURE__*/Schema.tag("ToolNotFoundError"),
|
|
@@ -785,13 +801,15 @@ export class ToolNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai
|
|
| 785 |
availableTools: /*#__PURE__*/Schema.Array(Schema.String)
|
| 786 |
}) {
|
| 787 |
/**
|
| 788 |
-
*
|
|
|
|
|
|
|
| 789 |
*/
|
| 790 |
[ReasonTypeId] = ReasonTypeId;
|
| 791 |
/**
|
| 792 |
* Tool not found errors are retryable because the model may self-correct.
|
| 793 |
*
|
| 794 |
-
* @since
|
| 795 |
*/
|
| 796 |
get isRetryable() {
|
| 797 |
return true;
|
|
@@ -804,10 +822,13 @@ export class ToolNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai
|
|
| 804 |
/**
|
| 805 |
* Error indicating the model's tool call parameters failed schema validation.
|
| 806 |
*
|
|
|
|
|
|
|
| 807 |
* This error is retryable because the model may correct its parameters
|
| 808 |
* on subsequent attempts.
|
| 809 |
*
|
| 810 |
-
*
|
|
|
|
| 811 |
* ```ts
|
| 812 |
* import { AiError } from "effect/unstable/ai"
|
| 813 |
*
|
|
@@ -822,8 +843,8 @@ export class ToolNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai
|
|
| 822 |
* // "Invalid parameters for tool 'GetWeather': Expected string, got number"
|
| 823 |
* ```
|
| 824 |
*
|
| 825 |
-
* @since 1.0.0
|
| 826 |
* @category reason
|
|
|
|
| 827 |
*/
|
| 828 |
export class ToolParameterValidationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolParameterValidationError")({
|
| 829 |
_tag: /*#__PURE__*/Schema.tag("ToolParameterValidationError"),
|
|
@@ -832,13 +853,15 @@ export class ToolParameterValidationError extends /*#__PURE__*/Schema.ErrorClass
|
|
| 832 |
description: Schema.String
|
| 833 |
}) {
|
| 834 |
/**
|
| 835 |
-
*
|
|
|
|
|
|
|
| 836 |
*/
|
| 837 |
[ReasonTypeId] = ReasonTypeId;
|
| 838 |
/**
|
| 839 |
* Parameter validation errors are retryable because the model may correct parameters.
|
| 840 |
*
|
| 841 |
-
* @since
|
| 842 |
*/
|
| 843 |
get isRetryable() {
|
| 844 |
return true;
|
|
@@ -851,10 +874,13 @@ export class ToolParameterValidationError extends /*#__PURE__*/Schema.ErrorClass
|
|
| 851 |
* Error indicating the tool handler returned an invalid result that does not
|
| 852 |
* match the tool's schema.
|
| 853 |
*
|
|
|
|
|
|
|
| 854 |
* This error is not retryable because invalid results indicate a bug in the
|
| 855 |
* tool handler implementation.
|
| 856 |
*
|
| 857 |
-
*
|
|
|
|
| 858 |
* ```ts
|
| 859 |
* import { AiError } from "effect/unstable/ai"
|
| 860 |
*
|
|
@@ -868,8 +894,8 @@ export class ToolParameterValidationError extends /*#__PURE__*/Schema.ErrorClass
|
|
| 868 |
* // "Tool 'GetWeather' returned invalid result: missing 'temperature' field"
|
| 869 |
* ```
|
| 870 |
*
|
| 871 |
-
* @since 1.0.0
|
| 872 |
* @category reason
|
|
|
|
| 873 |
*/
|
| 874 |
export class InvalidToolResultError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidToolResultError")({
|
| 875 |
_tag: /*#__PURE__*/Schema.tag("InvalidToolResultError"),
|
|
@@ -877,13 +903,15 @@ export class InvalidToolResultError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 877 |
description: Schema.String
|
| 878 |
}) {
|
| 879 |
/**
|
| 880 |
-
*
|
|
|
|
|
|
|
| 881 |
*/
|
| 882 |
[ReasonTypeId] = ReasonTypeId;
|
| 883 |
/**
|
| 884 |
* Invalid tool result errors are not retryable because they indicate a bug in the handler.
|
| 885 |
*
|
| 886 |
-
* @since
|
| 887 |
*/
|
| 888 |
get isRetryable() {
|
| 889 |
return false;
|
|
@@ -895,26 +923,29 @@ export class InvalidToolResultError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 895 |
/**
|
| 896 |
* Error indicating the tool result cannot be encoded for sending back to the model.
|
| 897 |
*
|
|
|
|
|
|
|
| 898 |
* This error is not retryable because encoding failures indicate a bug in the
|
| 899 |
* tool schema definitions.
|
| 900 |
*
|
| 901 |
-
*
|
|
|
|
| 902 |
* ```ts
|
| 903 |
* import { AiError } from "effect/unstable/ai"
|
| 904 |
*
|
| 905 |
* const error = new AiError.ToolResultEncodingError({
|
| 906 |
* toolName: "GetWeather",
|
| 907 |
-
* toolResult: {
|
| 908 |
-
* description: "Cannot encode
|
| 909 |
* })
|
| 910 |
*
|
| 911 |
* console.log(error.isRetryable) // false
|
| 912 |
* console.log(error.message)
|
| 913 |
-
* // "Failed to encode result for tool 'GetWeather': Cannot encode
|
| 914 |
* ```
|
| 915 |
*
|
| 916 |
-
* @since 1.0.0
|
| 917 |
* @category reason
|
|
|
|
| 918 |
*/
|
| 919 |
export class ToolResultEncodingError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolResultEncodingError")({
|
| 920 |
_tag: /*#__PURE__*/Schema.tag("ToolResultEncodingError"),
|
|
@@ -923,13 +954,15 @@ export class ToolResultEncodingError extends /*#__PURE__*/Schema.ErrorClass("eff
|
|
| 923 |
description: Schema.String
|
| 924 |
}) {
|
| 925 |
/**
|
| 926 |
-
*
|
|
|
|
|
|
|
| 927 |
*/
|
| 928 |
[ReasonTypeId] = ReasonTypeId;
|
| 929 |
/**
|
| 930 |
* Encoding errors are not retryable because they indicate a code bug.
|
| 931 |
*
|
| 932 |
-
* @since
|
| 933 |
*/
|
| 934 |
get isRetryable() {
|
| 935 |
return false;
|
|
@@ -941,10 +974,13 @@ export class ToolResultEncodingError extends /*#__PURE__*/Schema.ErrorClass("eff
|
|
| 941 |
/**
|
| 942 |
* Error indicating a provider-defined tool was configured with invalid arguments.
|
| 943 |
*
|
|
|
|
|
|
|
| 944 |
* This error is not retryable because it indicates a programming error in the
|
| 945 |
* tool configuration that must be fixed in code.
|
| 946 |
*
|
| 947 |
-
*
|
|
|
|
| 948 |
* ```ts
|
| 949 |
* import { AiError } from "effect/unstable/ai"
|
| 950 |
*
|
|
@@ -958,8 +994,8 @@ export class ToolResultEncodingError extends /*#__PURE__*/Schema.ErrorClass("eff
|
|
| 958 |
* // "Invalid configuration for tool 'OpenAiCodeInterpreter': Invalid container ID format"
|
| 959 |
* ```
|
| 960 |
*
|
| 961 |
-
* @since 1.0.0
|
| 962 |
* @category reason
|
|
|
|
| 963 |
*/
|
| 964 |
export class ToolConfigurationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolConfigurationError")({
|
| 965 |
_tag: /*#__PURE__*/Schema.tag("ToolConfigurationError"),
|
|
@@ -967,13 +1003,15 @@ export class ToolConfigurationError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 967 |
description: Schema.String
|
| 968 |
}) {
|
| 969 |
/**
|
| 970 |
-
*
|
|
|
|
|
|
|
| 971 |
*/
|
| 972 |
[ReasonTypeId] = ReasonTypeId;
|
| 973 |
/**
|
| 974 |
* Configuration errors are not retryable because they indicate a code bug.
|
| 975 |
*
|
| 976 |
-
* @since
|
| 977 |
*/
|
| 978 |
get isRetryable() {
|
| 979 |
return false;
|
|
@@ -985,10 +1023,13 @@ export class ToolConfigurationError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 985 |
/**
|
| 986 |
* Error indicating an operation requires a toolkit but none was provided.
|
| 987 |
*
|
|
|
|
|
|
|
| 988 |
* This error occurs when tool approval responses are present in the prompt
|
| 989 |
* but no toolkit was provided to resolve them.
|
| 990 |
*
|
| 991 |
-
*
|
|
|
|
| 992 |
* ```ts
|
| 993 |
* import { AiError } from "effect/unstable/ai"
|
| 994 |
*
|
|
@@ -1001,8 +1042,8 @@ export class ToolConfigurationError extends /*#__PURE__*/Schema.ErrorClass("effe
|
|
| 1001 |
* // "Toolkit required to resolve pending tool approvals: GetWeather, SendEmail"
|
| 1002 |
* ```
|
| 1003 |
*
|
| 1004 |
-
* @since 1.0.0
|
| 1005 |
* @category reason
|
|
|
|
| 1006 |
*/
|
| 1007 |
export class ToolkitRequiredError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolkitRequiredError")({
|
| 1008 |
_tag: /*#__PURE__*/Schema.tag("ToolkitRequiredError"),
|
|
@@ -1010,13 +1051,15 @@ export class ToolkitRequiredError extends /*#__PURE__*/Schema.ErrorClass("effect
|
|
| 1010 |
description: /*#__PURE__*/Schema.optional(Schema.String)
|
| 1011 |
}) {
|
| 1012 |
/**
|
| 1013 |
-
*
|
|
|
|
|
|
|
| 1014 |
*/
|
| 1015 |
[ReasonTypeId] = ReasonTypeId;
|
| 1016 |
/**
|
| 1017 |
* Toolkit required errors are not retryable without providing a toolkit.
|
| 1018 |
*
|
| 1019 |
-
* @since
|
| 1020 |
*/
|
| 1021 |
get isRetryable() {
|
| 1022 |
return false;
|
|
@@ -1029,38 +1072,43 @@ export class ToolkitRequiredError extends /*#__PURE__*/Schema.ErrorClass("effect
|
|
| 1029 |
/**
|
| 1030 |
* Error indicating the user provided invalid input in their prompt.
|
| 1031 |
*
|
|
|
|
|
|
|
| 1032 |
* This error is raised when the prompt contains content that is structurally
|
| 1033 |
* valid but not supported by the provider (e.g., unsupported media types,
|
| 1034 |
* unsupported file formats, etc.).
|
| 1035 |
*
|
| 1036 |
-
*
|
|
|
|
| 1037 |
* ```ts
|
| 1038 |
* import { AiError } from "effect/unstable/ai"
|
| 1039 |
*
|
| 1040 |
* const error = new AiError.InvalidUserInputError({
|
| 1041 |
-
* description: "Unsupported media type 'video/mp4'. Supported types
|
| 1042 |
* })
|
| 1043 |
*
|
| 1044 |
* console.log(error.isRetryable) // false
|
| 1045 |
* console.log(error.message)
|
| 1046 |
-
* // "Invalid user input: Unsupported media type 'video/mp4'. Supported types
|
| 1047 |
* ```
|
| 1048 |
*
|
| 1049 |
-
* @since 1.0.0
|
| 1050 |
* @category reason
|
|
|
|
| 1051 |
*/
|
| 1052 |
export class InvalidUserInputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidUserInputError")({
|
| 1053 |
_tag: /*#__PURE__*/Schema.tag("InvalidUserInputError"),
|
| 1054 |
description: Schema.String
|
| 1055 |
}) {
|
| 1056 |
/**
|
| 1057 |
-
*
|
|
|
|
|
|
|
| 1058 |
*/
|
| 1059 |
[ReasonTypeId] = ReasonTypeId;
|
| 1060 |
/**
|
| 1061 |
* Invalid user input errors require fixing the input and are not retryable.
|
| 1062 |
*
|
| 1063 |
-
* @since
|
| 1064 |
*/
|
| 1065 |
get isRetryable() {
|
| 1066 |
return false;
|
|
@@ -1072,8 +1120,18 @@ export class InvalidUserInputError extends /*#__PURE__*/Schema.ErrorClass("effec
|
|
| 1072 |
/**
|
| 1073 |
* Schema for validating and parsing AI error reasons.
|
| 1074 |
*
|
| 1075 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1076 |
* @category schemas
|
|
|
|
| 1077 |
*/
|
| 1078 |
export const AiErrorReason = /*#__PURE__*/Schema.Union([RateLimitError, QuotaExhaustedError, AuthenticationError, ContentPolicyError, InvalidRequestError, InternalProviderError, NetworkError, InvalidOutputError, StructuredOutputError, UnsupportedSchemaError, UnknownError, ToolNotFoundError, ToolParameterValidationError, InvalidToolResultError, ToolResultEncodingError, ToolConfigurationError, ToolkitRequiredError, InvalidUserInputError]);
|
| 1079 |
// =============================================================================
|
|
@@ -1081,16 +1139,20 @@ export const AiErrorReason = /*#__PURE__*/Schema.Union([RateLimitError, QuotaExh
|
|
| 1081 |
// =============================================================================
|
| 1082 |
const TypeId = "~effect/unstable/ai/AiError/AiError";
|
| 1083 |
/**
|
| 1084 |
-
*
|
| 1085 |
*
|
| 1086 |
-
*
|
| 1087 |
-
* - `module` and `method` context for where the error occurred
|
| 1088 |
-
* - `reason` field containing the semantic error type
|
| 1089 |
-
* - Delegated `isRetryable` and `retryAfter` to the underlying reason
|
| 1090 |
*
|
| 1091 |
-
* Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1092 |
*
|
| 1093 |
-
* @example
|
| 1094 |
* ```ts
|
| 1095 |
* import { Effect } from "effect"
|
| 1096 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -1108,8 +1170,8 @@ const TypeId = "~effect/unstable/ai/AiError/AiError";
|
|
| 1108 |
* )
|
| 1109 |
* ```
|
| 1110 |
*
|
| 1111 |
-
* @since 1.0.0
|
| 1112 |
* @category schemas
|
|
|
|
| 1113 |
*/
|
| 1114 |
export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/AiError")({
|
| 1115 |
_tag: /*#__PURE__*/Schema.tag("AiError"),
|
|
@@ -1122,7 +1184,7 @@ export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/A
|
|
| 1122 |
/**
|
| 1123 |
* Delegates to the underlying reason's `isRetryable` getter.
|
| 1124 |
*
|
| 1125 |
-
* @since
|
| 1126 |
*/
|
| 1127 |
get isRetryable() {
|
| 1128 |
return this.reason.isRetryable;
|
|
@@ -1130,7 +1192,7 @@ export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/A
|
|
| 1130 |
/**
|
| 1131 |
* Delegates to the underlying reason's `retryAfter` if present.
|
| 1132 |
*
|
| 1133 |
-
* @since
|
| 1134 |
*/
|
| 1135 |
get retryAfter() {
|
| 1136 |
return "retryAfter" in this.reason ? this.reason.retryAfter : undefined;
|
|
@@ -1142,10 +1204,8 @@ export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/A
|
|
| 1142 |
/**
|
| 1143 |
* Type guard to check if a value is an `AiError`.
|
| 1144 |
*
|
| 1145 |
-
*
|
| 1146 |
-
* @returns `true` if the value is an `AiError`, `false` otherwise
|
| 1147 |
*
|
| 1148 |
-
* @example
|
| 1149 |
* ```ts
|
| 1150 |
* import { AiError } from "effect/unstable/ai"
|
| 1151 |
*
|
|
@@ -1160,17 +1220,15 @@ export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/A
|
|
| 1160 |
* console.log(AiError.isAiError(aiError)) // true
|
| 1161 |
* ```
|
| 1162 |
*
|
| 1163 |
-
* @since 1.0.0
|
| 1164 |
* @category guards
|
|
|
|
| 1165 |
*/
|
| 1166 |
export const isAiError = u => Predicate.hasProperty(u, TypeId);
|
| 1167 |
/**
|
| 1168 |
* Type guard to check if a value is an `AiErrorReason`.
|
| 1169 |
*
|
| 1170 |
-
*
|
| 1171 |
-
* @returns `true` if the value is an `AiErrorReason`, `false` otherwise
|
| 1172 |
*
|
| 1173 |
-
* @example
|
| 1174 |
* ```ts
|
| 1175 |
* import { AiError } from "effect/unstable/ai"
|
| 1176 |
*
|
|
@@ -1181,14 +1239,15 @@ export const isAiError = u => Predicate.hasProperty(u, TypeId);
|
|
| 1181 |
* console.log(AiError.isAiErrorReason(genericError)) // false
|
| 1182 |
* ```
|
| 1183 |
*
|
| 1184 |
-
* @since 1.0.0
|
| 1185 |
* @category guards
|
|
|
|
| 1186 |
*/
|
| 1187 |
export const isAiErrorReason = u => Predicate.hasProperty(u, ReasonTypeId);
|
| 1188 |
/**
|
| 1189 |
* Creates an `AiError` with the given reason.
|
| 1190 |
*
|
| 1191 |
-
*
|
|
|
|
| 1192 |
* ```ts
|
| 1193 |
* import { Duration } from "effect"
|
| 1194 |
* import { AiError } from "effect/unstable/ai"
|
|
@@ -1205,16 +1264,20 @@ export const isAiErrorReason = u => Predicate.hasProperty(u, ReasonTypeId);
|
|
| 1205 |
* // "OpenAI.completion: Rate limit exceeded. Retry after 1 minute"
|
| 1206 |
* ```
|
| 1207 |
*
|
| 1208 |
-
* @since 1.0.0
|
| 1209 |
* @category constructors
|
|
|
|
| 1210 |
*/
|
| 1211 |
export const make = params => new AiError(params);
|
| 1212 |
/**
|
| 1213 |
* Maps HTTP status codes to semantic error reasons.
|
| 1214 |
*
|
| 1215 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1216 |
*
|
| 1217 |
-
* @example
|
| 1218 |
* ```ts
|
| 1219 |
* import { AiError } from "effect/unstable/ai"
|
| 1220 |
*
|
|
@@ -1226,8 +1289,8 @@ export const make = params => new AiError(params);
|
|
| 1226 |
* console.log(reason._tag) // "RateLimitError"
|
| 1227 |
* ```
|
| 1228 |
*
|
| 1229 |
-
* @since 1.0.0
|
| 1230 |
* @category constructors
|
|
|
|
| 1231 |
*/
|
| 1232 |
export const reasonFromHttpStatus = params => {
|
| 1233 |
const {
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines shared errors for AI operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
*
|
| 4 |
+
* `AiError` records where a failure happened and stores the detailed reason in a
|
| 5 |
+
* `reason` field. Those reasons cover transport problems, provider responses,
|
| 6 |
+
* rate limits, authentication, content policy failures, invalid requests,
|
| 7 |
+
* invalid output, unsupported schemas, tool failures, invalid user input, and
|
| 8 |
+
* unknown failures. This module also includes metadata schemas, guards,
|
| 9 |
+
* constructors, and helpers for converting HTTP response information into AI
|
| 10 |
+
* error reasons.
|
| 11 |
*
|
| 12 |
+
* @since 4.0.0
|
| 13 |
*/
|
| 14 |
import * as Duration from "../../Duration.js";
|
| 15 |
import * as Effect from "../../Effect.js";
|
|
|
|
| 36 |
/**
|
| 37 |
* Error indicating a network-level failure before receiving a response.
|
| 38 |
*
|
| 39 |
+
* **Details**
|
| 40 |
+
*
|
| 41 |
* This error is raised when issues arise before receiving an HTTP response,
|
| 42 |
* such as network connectivity problems, request encoding issues, or invalid
|
| 43 |
* URLs.
|
| 44 |
*
|
| 45 |
+
* **Example** (Creating a network error)
|
| 46 |
+
*
|
| 47 |
* ```ts
|
| 48 |
* import { AiError } from "effect/unstable/ai"
|
| 49 |
*
|
|
|
|
| 64 |
* // "Transport: Connection timeout after 30 seconds (POST https://api.openai.com/v1/completions)"
|
| 65 |
* ```
|
| 66 |
*
|
|
|
|
| 67 |
* @category reason
|
| 68 |
+
* @since 4.0.0
|
| 69 |
*/
|
| 70 |
export class NetworkError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/NetworkError")({
|
| 71 |
_tag: /*#__PURE__*/Schema.tag("NetworkError"),
|
|
|
|
| 74 |
description: /*#__PURE__*/Schema.optional(Schema.String)
|
| 75 |
}) {
|
| 76 |
/**
|
| 77 |
+
* Marks `NetworkError` as a semantic AI error reason for runtime guards.
|
| 78 |
+
*
|
| 79 |
+
* @since 4.0.0
|
| 80 |
*/
|
| 81 |
[ReasonTypeId] = ReasonTypeId;
|
| 82 |
/**
|
| 83 |
* Transport errors are retryable; encoding and URL errors are not.
|
| 84 |
*
|
| 85 |
+
* @since 4.0.0
|
| 86 |
*/
|
| 87 |
get isRetryable() {
|
| 88 |
return this.reason === "TransportError";
|
|
|
|
| 90 |
/**
|
| 91 |
* Creates a NetworkError from a platform HttpClientError.RequestError.
|
| 92 |
*
|
| 93 |
+
* **Example** (Creating a network error from a request error)
|
| 94 |
+
*
|
| 95 |
* ```ts
|
| 96 |
* import { AiError } from "effect/unstable/ai"
|
| 97 |
* import type { HttpClientError } from "effect/unstable/http"
|
|
|
|
| 101 |
* const aiError = AiError.NetworkError.fromRequestError(platformError)
|
| 102 |
* ```
|
| 103 |
*
|
| 104 |
+
* @since 4.0.0
|
|
|
|
| 105 |
*/
|
| 106 |
static fromRequestError(error) {
|
| 107 |
return new NetworkError({
|
|
|
|
| 152 |
/**
|
| 153 |
* Schema for provider-specific metadata which can be attached to error reasons.
|
| 154 |
*
|
| 155 |
+
* **Details**
|
| 156 |
*
|
| 157 |
+
* Provider-specific metadata is namespaced by provider name. Each provider
|
| 158 |
+
* value can contain arbitrary mutable JSON metadata or `null`.
|
| 159 |
+
*
|
| 160 |
+
* **Example** (Metadata shape)
|
| 161 |
+
*
|
| 162 |
+
* ```ts
|
| 163 |
+
* const metadata = {
|
| 164 |
+
* openai: {
|
| 165 |
+
* errorCode: "rate_limit_exceeded",
|
| 166 |
+
* requestId: "req_123"
|
| 167 |
+
* },
|
| 168 |
+
* anthropic: null
|
| 169 |
* }
|
| 170 |
* ```
|
| 171 |
*
|
|
|
|
| 172 |
* @category schemas
|
| 173 |
+
* @since 4.0.0
|
| 174 |
*/
|
| 175 |
export const ProviderMetadata = /*#__PURE__*/Schema.Record(Schema.String, /*#__PURE__*/Schema.NullOr(Schema.MutableJson));
|
| 176 |
/**
|
| 177 |
+
* Schema for token usage information from AI operations.
|
| 178 |
+
*
|
| 179 |
+
* **Details**
|
| 180 |
+
*
|
| 181 |
+
* Schema for optional provider-reported token counts for prompt tokens,
|
| 182 |
+
* completion tokens, and total tokens.
|
| 183 |
*
|
|
|
|
| 184 |
* @category schemas
|
| 185 |
+
* @since 4.0.0
|
| 186 |
*/
|
| 187 |
export const UsageInfo = /*#__PURE__*/Schema.Struct({
|
| 188 |
promptTokens: Schema.optional(Schema.Number),
|
|
|
|
| 192 |
identifier: "UsageInfo"
|
| 193 |
});
|
| 194 |
/**
|
| 195 |
+
* Schema for the combined HTTP context used in error reporting.
|
| 196 |
+
*
|
| 197 |
+
* **When to use**
|
| 198 |
+
*
|
| 199 |
+
* Use to attach request details, optional response details, and optional body
|
| 200 |
+
* text to AI provider errors.
|
| 201 |
+
*
|
| 202 |
+
* **Details**
|
| 203 |
+
*
|
| 204 |
+
* Includes the required request details plus optional response details and raw
|
| 205 |
+
* response body.
|
| 206 |
+
*
|
| 207 |
+
* @see {@link HttpRequestDetails} for captured request details
|
| 208 |
+
* @see {@link HttpResponseDetails} for captured response details
|
| 209 |
*
|
|
|
|
| 210 |
* @category schemas
|
| 211 |
+
* @since 4.0.0
|
| 212 |
*/
|
| 213 |
export const HttpContext = /*#__PURE__*/Schema.Struct({
|
| 214 |
request: HttpRequestDetails,
|
|
|
|
| 223 |
/**
|
| 224 |
* Error indicating the request was rate limited.
|
| 225 |
*
|
| 226 |
+
* **Details**
|
| 227 |
+
*
|
| 228 |
* Rate limit errors are always retryable. When `retryAfter` is provided,
|
| 229 |
* callers should wait that duration before retrying.
|
| 230 |
*
|
| 231 |
+
* **Example** (Creating a rate limit error)
|
| 232 |
+
*
|
| 233 |
* ```ts
|
| 234 |
* import { Duration } from "effect"
|
| 235 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 242 |
* console.log(rateLimitError.message) // "Rate limit exceeded. Retry after 1 minute"
|
| 243 |
* ```
|
| 244 |
*
|
|
|
|
| 245 |
* @category reason
|
| 246 |
+
* @since 4.0.0
|
| 247 |
*/
|
| 248 |
export class RateLimitError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/RateLimitError")({
|
| 249 |
_tag: /*#__PURE__*/Schema.tag("RateLimitError"),
|
|
|
|
| 252 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 253 |
}) {
|
| 254 |
/**
|
| 255 |
+
* Marks `RateLimitError` as a semantic AI error reason for runtime guards.
|
| 256 |
+
*
|
| 257 |
+
* @since 4.0.0
|
| 258 |
*/
|
| 259 |
[ReasonTypeId] = ReasonTypeId;
|
| 260 |
/**
|
| 261 |
* Rate limit errors are always retryable.
|
| 262 |
*
|
| 263 |
+
* @since 4.0.0
|
| 264 |
*/
|
| 265 |
get isRetryable() {
|
| 266 |
return true;
|
|
|
|
| 274 |
/**
|
| 275 |
* Error indicating account or billing limits have been reached.
|
| 276 |
*
|
| 277 |
+
* **Details**
|
| 278 |
+
*
|
| 279 |
* Quota exhausted errors are not retryable without user action.
|
| 280 |
*
|
| 281 |
+
* **Example** (Creating a quota exhausted error)
|
| 282 |
+
*
|
| 283 |
* ```ts
|
| 284 |
* import { AiError } from "effect/unstable/ai"
|
| 285 |
*
|
|
|
|
| 290 |
* // "Quota exhausted. Check your account billing and usage limits."
|
| 291 |
* ```
|
| 292 |
*
|
|
|
|
| 293 |
* @category reason
|
| 294 |
+
* @since 4.0.0
|
| 295 |
*/
|
| 296 |
export class QuotaExhaustedError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/QuotaExhaustedError")({
|
| 297 |
_tag: /*#__PURE__*/Schema.tag("QuotaExhaustedError"),
|
|
|
|
| 300 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 301 |
}) {
|
| 302 |
/**
|
| 303 |
+
* Marks `QuotaExhaustedError` as a semantic AI error reason for runtime guards.
|
| 304 |
+
*
|
| 305 |
+
* @since 4.0.0
|
| 306 |
*/
|
| 307 |
[ReasonTypeId] = ReasonTypeId;
|
| 308 |
/**
|
| 309 |
* Quota exhausted errors require user action and are not retryable.
|
| 310 |
*
|
| 311 |
+
* @since 4.0.0
|
| 312 |
*/
|
| 313 |
get isRetryable() {
|
| 314 |
return false;
|
|
|
|
| 322 |
/**
|
| 323 |
* Error indicating authentication or authorization failure.
|
| 324 |
*
|
| 325 |
+
* **Details**
|
| 326 |
+
*
|
| 327 |
* Authentication errors are never retryable without credential changes.
|
| 328 |
*
|
| 329 |
+
* **Example** (Creating an authentication error)
|
| 330 |
+
*
|
| 331 |
* ```ts
|
| 332 |
* import { AiError } from "effect/unstable/ai"
|
| 333 |
*
|
|
|
|
| 340 |
* // "InvalidKey: Verify your API key is correct"
|
| 341 |
* ```
|
| 342 |
*
|
|
|
|
| 343 |
* @category reason
|
| 344 |
+
* @since 4.0.0
|
| 345 |
*/
|
| 346 |
export class AuthenticationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/AuthenticationError")({
|
| 347 |
_tag: /*#__PURE__*/Schema.tag("AuthenticationError"),
|
|
|
|
| 350 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 351 |
}) {
|
| 352 |
/**
|
| 353 |
+
* Marks `AuthenticationError` as a semantic AI error reason for runtime guards.
|
| 354 |
+
*
|
| 355 |
+
* @since 4.0.0
|
| 356 |
*/
|
| 357 |
[ReasonTypeId] = ReasonTypeId;
|
| 358 |
/**
|
| 359 |
* Authentication errors require credential changes and are not retryable.
|
| 360 |
*
|
| 361 |
+
* @since 4.0.0
|
| 362 |
*/
|
| 363 |
get isRetryable() {
|
| 364 |
return false;
|
|
|
|
| 377 |
/**
|
| 378 |
* Error indicating content policy violation.
|
| 379 |
*
|
| 380 |
+
* **Details**
|
| 381 |
+
*
|
| 382 |
* Content policy errors are never retryable without content changes.
|
| 383 |
*
|
| 384 |
+
* **Example** (Creating a content policy error)
|
| 385 |
+
*
|
| 386 |
* ```ts
|
| 387 |
* import { AiError } from "effect/unstable/ai"
|
| 388 |
*
|
|
|
|
| 395 |
* // "Content policy violation: Input contains prohibited content"
|
| 396 |
* ```
|
| 397 |
*
|
|
|
|
| 398 |
* @category reason
|
| 399 |
+
* @since 4.0.0
|
| 400 |
*/
|
| 401 |
export class ContentPolicyError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ContentPolicyError")({
|
| 402 |
_tag: /*#__PURE__*/Schema.tag("ContentPolicyError"),
|
|
|
|
| 405 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 406 |
}) {
|
| 407 |
/**
|
| 408 |
+
* Marks `ContentPolicyError` as a semantic AI error reason for runtime guards.
|
| 409 |
+
*
|
| 410 |
+
* @since 4.0.0
|
| 411 |
*/
|
| 412 |
[ReasonTypeId] = ReasonTypeId;
|
| 413 |
/**
|
| 414 |
* Content policy errors require content changes and are not retryable.
|
| 415 |
*
|
| 416 |
+
* @since 4.0.0
|
| 417 |
*/
|
| 418 |
get isRetryable() {
|
| 419 |
return false;
|
|
|
|
| 425 |
/**
|
| 426 |
* Error indicating the request had invalid or malformed parameters.
|
| 427 |
*
|
| 428 |
+
* **Details**
|
| 429 |
+
*
|
| 430 |
* Invalid request errors require fixing the request and are not retryable.
|
| 431 |
*
|
| 432 |
+
* **Example** (Creating an invalid request error)
|
| 433 |
+
*
|
| 434 |
* ```ts
|
| 435 |
* import { AiError } from "effect/unstable/ai"
|
| 436 |
*
|
|
|
|
| 445 |
* // "Invalid request: parameter 'temperature' must be between 0 and 2. Temperature value 5 is out of range"
|
| 446 |
* ```
|
| 447 |
*
|
|
|
|
| 448 |
* @category reason
|
| 449 |
+
* @since 4.0.0
|
| 450 |
*/
|
| 451 |
export class InvalidRequestError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidRequestError")({
|
| 452 |
_tag: /*#__PURE__*/Schema.tag("InvalidRequestError"),
|
|
|
|
| 457 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 458 |
}) {
|
| 459 |
/**
|
| 460 |
+
* Marks `InvalidRequestError` as a semantic AI error reason for runtime guards.
|
| 461 |
+
*
|
| 462 |
+
* @since 4.0.0
|
| 463 |
*/
|
| 464 |
[ReasonTypeId] = ReasonTypeId;
|
| 465 |
/**
|
| 466 |
* Invalid request errors require fixing the request and are not retryable.
|
| 467 |
*
|
| 468 |
+
* @since 4.0.0
|
| 469 |
*/
|
| 470 |
get isRetryable() {
|
| 471 |
return false;
|
|
|
|
| 481 |
/**
|
| 482 |
* Error indicating the AI provider experienced an internal error.
|
| 483 |
*
|
| 484 |
+
* **Details**
|
| 485 |
+
*
|
| 486 |
* Internal provider errors are typically transient and are retryable.
|
| 487 |
*
|
| 488 |
+
* **Example** (Creating an internal provider error)
|
| 489 |
+
*
|
| 490 |
* ```ts
|
| 491 |
* import { AiError } from "effect/unstable/ai"
|
| 492 |
*
|
|
|
|
| 499 |
* // "Internal provider error: Server encountered an unexpected error"
|
| 500 |
* ```
|
| 501 |
*
|
|
|
|
| 502 |
* @category reason
|
| 503 |
+
* @since 4.0.0
|
| 504 |
*/
|
| 505 |
export class InternalProviderError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InternalProviderError")({
|
| 506 |
_tag: /*#__PURE__*/Schema.tag("InternalProviderError"),
|
|
|
|
| 509 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 510 |
}) {
|
| 511 |
/**
|
| 512 |
+
* Marks `InternalProviderError` as a semantic AI error reason for runtime guards.
|
| 513 |
+
*
|
| 514 |
+
* @since 4.0.0
|
| 515 |
*/
|
| 516 |
[ReasonTypeId] = ReasonTypeId;
|
| 517 |
/**
|
| 518 |
* Internal provider errors are typically transient and are retryable.
|
| 519 |
*
|
| 520 |
+
* @since 4.0.0
|
| 521 |
*/
|
| 522 |
get isRetryable() {
|
| 523 |
return true;
|
|
|
|
| 529 |
/**
|
| 530 |
* Error indicating failure to parse or validate LLM output.
|
| 531 |
*
|
| 532 |
+
* **Details**
|
| 533 |
+
*
|
| 534 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 535 |
*
|
| 536 |
+
* **Example** (Creating an invalid output error)
|
| 537 |
+
*
|
| 538 |
* ```ts
|
| 539 |
* import { AiError } from "effect/unstable/ai"
|
| 540 |
*
|
|
|
|
| 547 |
* // "Invalid output: Expected a string but received a number"
|
| 548 |
* ```
|
| 549 |
*
|
|
|
|
| 550 |
* @category reason
|
| 551 |
+
* @since 4.0.0
|
| 552 |
*/
|
| 553 |
export class InvalidOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidOutputError")({
|
| 554 |
_tag: /*#__PURE__*/Schema.tag("InvalidOutputError"),
|
|
|
|
| 557 |
usage: /*#__PURE__*/Schema.optional(UsageInfo)
|
| 558 |
}) {
|
| 559 |
/**
|
| 560 |
+
* Marks `InvalidOutputError` as a semantic AI error reason for runtime guards.
|
| 561 |
+
*
|
| 562 |
+
* @since 4.0.0
|
| 563 |
*/
|
| 564 |
[ReasonTypeId] = ReasonTypeId;
|
| 565 |
/**
|
| 566 |
* Invalid output errors are retryable since LLM outputs are non-deterministic.
|
| 567 |
*
|
| 568 |
+
* @since 4.0.0
|
| 569 |
*/
|
| 570 |
get isRetryable() {
|
| 571 |
return true;
|
|
|
|
| 573 |
/**
|
| 574 |
* Creates an InvalidOutputError from a Schema error.
|
| 575 |
*
|
| 576 |
+
* **Example** (Creating an invalid output error from a schema error)
|
| 577 |
+
*
|
| 578 |
* ```ts
|
| 579 |
* import { Schema } from "effect"
|
| 580 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 584 |
* const parseError = AiError.InvalidOutputError.fromSchemaError(schemaError)
|
| 585 |
* ```
|
| 586 |
*
|
| 587 |
+
* @since 4.0.0
|
|
|
|
| 588 |
*/
|
| 589 |
static fromSchemaError(error) {
|
| 590 |
return new InvalidOutputError({
|
|
|
|
| 599 |
* Error indicating the LLM generated text that does not conform to the
|
| 600 |
* requested structured output schema.
|
| 601 |
*
|
| 602 |
+
* **Details**
|
| 603 |
+
*
|
| 604 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 605 |
*
|
| 606 |
+
* **Example** (Creating a structured output error)
|
| 607 |
+
*
|
| 608 |
* ```ts
|
| 609 |
* import { AiError } from "effect/unstable/ai"
|
| 610 |
*
|
|
|
|
| 618 |
* // "Structured output validation failed: Expected a valid JSON object"
|
| 619 |
* ```
|
| 620 |
*
|
|
|
|
| 621 |
* @category reason
|
| 622 |
+
* @since 4.0.0
|
| 623 |
*/
|
| 624 |
export class StructuredOutputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/StructuredOutputError")({
|
| 625 |
_tag: /*#__PURE__*/Schema.tag("StructuredOutputError"),
|
|
|
|
| 629 |
usage: /*#__PURE__*/Schema.optional(UsageInfo)
|
| 630 |
}) {
|
| 631 |
/**
|
| 632 |
+
* Marks `StructuredOutputError` as a semantic AI error reason for runtime guards.
|
| 633 |
+
*
|
| 634 |
+
* @since 4.0.0
|
| 635 |
*/
|
| 636 |
[ReasonTypeId] = ReasonTypeId;
|
| 637 |
/**
|
| 638 |
* Structured output errors are retryable since LLM outputs are non-deterministic.
|
| 639 |
*
|
| 640 |
+
* @since 4.0.0
|
| 641 |
*/
|
| 642 |
get isRetryable() {
|
| 643 |
return true;
|
|
|
|
| 645 |
/**
|
| 646 |
* Creates a StructuredOutputError from a Schema error.
|
| 647 |
*
|
| 648 |
+
* **Example** (Creating a structured output error from a schema error)
|
| 649 |
+
*
|
| 650 |
* ```ts
|
| 651 |
* import { Schema } from "effect"
|
| 652 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 657 |
* const parseError = AiError.StructuredOutputError.fromSchemaError(schemaError, rawText)
|
| 658 |
* ```
|
| 659 |
*
|
| 660 |
+
* @since 4.0.0
|
|
|
|
| 661 |
*/
|
| 662 |
static fromSchemaError(error, responseText) {
|
| 663 |
return new StructuredOutputError({
|
|
|
|
| 673 |
* Error indicating a codec transformer rejected a schema because it contains
|
| 674 |
* unsupported constructs.
|
| 675 |
*
|
| 676 |
+
* **Details**
|
| 677 |
+
*
|
| 678 |
* Unsupported schema errors are not retryable because they indicate a
|
| 679 |
* programmer error where the schema is incompatible with the provider.
|
| 680 |
*
|
| 681 |
+
* **Example** (Creating an unsupported schema error)
|
| 682 |
+
*
|
| 683 |
* ```ts
|
| 684 |
* import { AiError } from "effect/unstable/ai"
|
| 685 |
*
|
|
|
|
| 692 |
* // "Unsupported schema: Unions are not supported in Anthropic structured output"
|
| 693 |
* ```
|
| 694 |
*
|
|
|
|
| 695 |
* @category reason
|
| 696 |
+
* @since 4.0.0
|
| 697 |
*/
|
| 698 |
export class UnsupportedSchemaError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/UnsupportedSchemaError")({
|
| 699 |
_tag: /*#__PURE__*/Schema.tag("UnsupportedSchemaError"),
|
|
|
|
| 701 |
metadata: /*#__PURE__*/providerMetadataWithDefaults()
|
| 702 |
}) {
|
| 703 |
/**
|
| 704 |
+
* Marks `UnsupportedSchemaError` as a semantic AI error reason for runtime guards.
|
| 705 |
+
*
|
| 706 |
+
* @since 4.0.0
|
| 707 |
*/
|
| 708 |
[ReasonTypeId] = ReasonTypeId;
|
| 709 |
/**
|
| 710 |
* Unsupported schema errors are not retryable because they indicate a programmer error.
|
| 711 |
*
|
| 712 |
+
* @since 4.0.0
|
| 713 |
*/
|
| 714 |
get isRetryable() {
|
| 715 |
return false;
|
|
|
|
| 719 |
}
|
| 720 |
}
|
| 721 |
/**
|
| 722 |
+
* Error data for unknown or unexpected AI failures.
|
| 723 |
+
*
|
| 724 |
+
* **Details**
|
| 725 |
*
|
| 726 |
* Unknown errors are not retryable by default since the cause is unknown.
|
| 727 |
*
|
| 728 |
+
* **Example** (Creating an unknown error)
|
| 729 |
+
*
|
| 730 |
* ```ts
|
| 731 |
* import { AiError } from "effect/unstable/ai"
|
| 732 |
*
|
|
|
|
| 739 |
* // "An unexpected error occurred"
|
| 740 |
* ```
|
| 741 |
*
|
|
|
|
| 742 |
* @category reason
|
| 743 |
+
* @since 4.0.0
|
| 744 |
*/
|
| 745 |
export class UnknownError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/UnknownError")({
|
| 746 |
_tag: /*#__PURE__*/Schema.tag("UnknownError"),
|
|
|
|
| 749 |
http: /*#__PURE__*/Schema.optional(HttpContext)
|
| 750 |
}) {
|
| 751 |
/**
|
| 752 |
+
* Marks `UnknownError` as a semantic AI error reason for runtime guards.
|
| 753 |
+
*
|
| 754 |
+
* @since 4.0.0
|
| 755 |
*/
|
| 756 |
[ReasonTypeId] = ReasonTypeId;
|
| 757 |
/**
|
| 758 |
* Unknown errors are not retryable by default.
|
| 759 |
*
|
| 760 |
+
* @since 4.0.0
|
| 761 |
*/
|
| 762 |
get isRetryable() {
|
| 763 |
return false;
|
|
|
|
| 772 |
/**
|
| 773 |
* Error indicating the model requested a tool that doesn't exist in the toolkit.
|
| 774 |
*
|
| 775 |
+
* **Details**
|
| 776 |
+
*
|
| 777 |
* This error is retryable because the model may self-correct when provided
|
| 778 |
* with the list of available tools.
|
| 779 |
*
|
| 780 |
+
* **Example** (Creating a tool not found error)
|
| 781 |
+
*
|
| 782 |
* ```ts
|
| 783 |
* import { AiError } from "effect/unstable/ai"
|
| 784 |
*
|
|
|
|
| 792 |
* // "Tool 'unknownTool' not found. Available tools: GetWeather, GetTime"
|
| 793 |
* ```
|
| 794 |
*
|
|
|
|
| 795 |
* @category reason
|
| 796 |
+
* @since 4.0.0
|
| 797 |
*/
|
| 798 |
export class ToolNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolNotFoundError")({
|
| 799 |
_tag: /*#__PURE__*/Schema.tag("ToolNotFoundError"),
|
|
|
|
| 801 |
availableTools: /*#__PURE__*/Schema.Array(Schema.String)
|
| 802 |
}) {
|
| 803 |
/**
|
| 804 |
+
* Marks `ToolNotFoundError` as a semantic AI error reason for runtime guards.
|
| 805 |
+
*
|
| 806 |
+
* @since 4.0.0
|
| 807 |
*/
|
| 808 |
[ReasonTypeId] = ReasonTypeId;
|
| 809 |
/**
|
| 810 |
* Tool not found errors are retryable because the model may self-correct.
|
| 811 |
*
|
| 812 |
+
* @since 4.0.0
|
| 813 |
*/
|
| 814 |
get isRetryable() {
|
| 815 |
return true;
|
|
|
|
| 822 |
/**
|
| 823 |
* Error indicating the model's tool call parameters failed schema validation.
|
| 824 |
*
|
| 825 |
+
* **Details**
|
| 826 |
+
*
|
| 827 |
* This error is retryable because the model may correct its parameters
|
| 828 |
* on subsequent attempts.
|
| 829 |
*
|
| 830 |
+
* **Example** (Creating a tool parameter validation error)
|
| 831 |
+
*
|
| 832 |
* ```ts
|
| 833 |
* import { AiError } from "effect/unstable/ai"
|
| 834 |
*
|
|
|
|
| 843 |
* // "Invalid parameters for tool 'GetWeather': Expected string, got number"
|
| 844 |
* ```
|
| 845 |
*
|
|
|
|
| 846 |
* @category reason
|
| 847 |
+
* @since 4.0.0
|
| 848 |
*/
|
| 849 |
export class ToolParameterValidationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolParameterValidationError")({
|
| 850 |
_tag: /*#__PURE__*/Schema.tag("ToolParameterValidationError"),
|
|
|
|
| 853 |
description: Schema.String
|
| 854 |
}) {
|
| 855 |
/**
|
| 856 |
+
* Marks `ToolParameterValidationError` as a semantic AI error reason for runtime guards.
|
| 857 |
+
*
|
| 858 |
+
* @since 4.0.0
|
| 859 |
*/
|
| 860 |
[ReasonTypeId] = ReasonTypeId;
|
| 861 |
/**
|
| 862 |
* Parameter validation errors are retryable because the model may correct parameters.
|
| 863 |
*
|
| 864 |
+
* @since 4.0.0
|
| 865 |
*/
|
| 866 |
get isRetryable() {
|
| 867 |
return true;
|
|
|
|
| 874 |
* Error indicating the tool handler returned an invalid result that does not
|
| 875 |
* match the tool's schema.
|
| 876 |
*
|
| 877 |
+
* **Details**
|
| 878 |
+
*
|
| 879 |
* This error is not retryable because invalid results indicate a bug in the
|
| 880 |
* tool handler implementation.
|
| 881 |
*
|
| 882 |
+
* **Example** (Creating an invalid tool result error)
|
| 883 |
+
*
|
| 884 |
* ```ts
|
| 885 |
* import { AiError } from "effect/unstable/ai"
|
| 886 |
*
|
|
|
|
| 894 |
* // "Tool 'GetWeather' returned invalid result: missing 'temperature' field"
|
| 895 |
* ```
|
| 896 |
*
|
|
|
|
| 897 |
* @category reason
|
| 898 |
+
* @since 4.0.0
|
| 899 |
*/
|
| 900 |
export class InvalidToolResultError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidToolResultError")({
|
| 901 |
_tag: /*#__PURE__*/Schema.tag("InvalidToolResultError"),
|
|
|
|
| 903 |
description: Schema.String
|
| 904 |
}) {
|
| 905 |
/**
|
| 906 |
+
* Marks `InvalidToolResultError` as a semantic AI error reason for runtime guards.
|
| 907 |
+
*
|
| 908 |
+
* @since 4.0.0
|
| 909 |
*/
|
| 910 |
[ReasonTypeId] = ReasonTypeId;
|
| 911 |
/**
|
| 912 |
* Invalid tool result errors are not retryable because they indicate a bug in the handler.
|
| 913 |
*
|
| 914 |
+
* @since 4.0.0
|
| 915 |
*/
|
| 916 |
get isRetryable() {
|
| 917 |
return false;
|
|
|
|
| 923 |
/**
|
| 924 |
* Error indicating the tool result cannot be encoded for sending back to the model.
|
| 925 |
*
|
| 926 |
+
* **Details**
|
| 927 |
+
*
|
| 928 |
* This error is not retryable because encoding failures indicate a bug in the
|
| 929 |
* tool schema definitions.
|
| 930 |
*
|
| 931 |
+
* **Example** (Creating a tool result encoding error)
|
| 932 |
+
*
|
| 933 |
* ```ts
|
| 934 |
* import { AiError } from "effect/unstable/ai"
|
| 935 |
*
|
| 936 |
* const error = new AiError.ToolResultEncodingError({
|
| 937 |
* toolName: "GetWeather",
|
| 938 |
+
* toolResult: { temperature: 72n },
|
| 939 |
+
* description: "Cannot encode bigint values as JSON"
|
| 940 |
* })
|
| 941 |
*
|
| 942 |
* console.log(error.isRetryable) // false
|
| 943 |
* console.log(error.message)
|
| 944 |
+
* // "Failed to encode result for tool 'GetWeather': Cannot encode bigint values as JSON"
|
| 945 |
* ```
|
| 946 |
*
|
|
|
|
| 947 |
* @category reason
|
| 948 |
+
* @since 4.0.0
|
| 949 |
*/
|
| 950 |
export class ToolResultEncodingError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolResultEncodingError")({
|
| 951 |
_tag: /*#__PURE__*/Schema.tag("ToolResultEncodingError"),
|
|
|
|
| 954 |
description: Schema.String
|
| 955 |
}) {
|
| 956 |
/**
|
| 957 |
+
* Marks `ToolResultEncodingError` as a semantic AI error reason for runtime guards.
|
| 958 |
+
*
|
| 959 |
+
* @since 4.0.0
|
| 960 |
*/
|
| 961 |
[ReasonTypeId] = ReasonTypeId;
|
| 962 |
/**
|
| 963 |
* Encoding errors are not retryable because they indicate a code bug.
|
| 964 |
*
|
| 965 |
+
* @since 4.0.0
|
| 966 |
*/
|
| 967 |
get isRetryable() {
|
| 968 |
return false;
|
|
|
|
| 974 |
/**
|
| 975 |
* Error indicating a provider-defined tool was configured with invalid arguments.
|
| 976 |
*
|
| 977 |
+
* **Details**
|
| 978 |
+
*
|
| 979 |
* This error is not retryable because it indicates a programming error in the
|
| 980 |
* tool configuration that must be fixed in code.
|
| 981 |
*
|
| 982 |
+
* **Example** (Creating a tool configuration error)
|
| 983 |
+
*
|
| 984 |
* ```ts
|
| 985 |
* import { AiError } from "effect/unstable/ai"
|
| 986 |
*
|
|
|
|
| 994 |
* // "Invalid configuration for tool 'OpenAiCodeInterpreter': Invalid container ID format"
|
| 995 |
* ```
|
| 996 |
*
|
|
|
|
| 997 |
* @category reason
|
| 998 |
+
* @since 4.0.0
|
| 999 |
*/
|
| 1000 |
export class ToolConfigurationError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolConfigurationError")({
|
| 1001 |
_tag: /*#__PURE__*/Schema.tag("ToolConfigurationError"),
|
|
|
|
| 1003 |
description: Schema.String
|
| 1004 |
}) {
|
| 1005 |
/**
|
| 1006 |
+
* Marks `ToolConfigurationError` as a semantic AI error reason for runtime guards.
|
| 1007 |
+
*
|
| 1008 |
+
* @since 4.0.0
|
| 1009 |
*/
|
| 1010 |
[ReasonTypeId] = ReasonTypeId;
|
| 1011 |
/**
|
| 1012 |
* Configuration errors are not retryable because they indicate a code bug.
|
| 1013 |
*
|
| 1014 |
+
* @since 4.0.0
|
| 1015 |
*/
|
| 1016 |
get isRetryable() {
|
| 1017 |
return false;
|
|
|
|
| 1023 |
/**
|
| 1024 |
* Error indicating an operation requires a toolkit but none was provided.
|
| 1025 |
*
|
| 1026 |
+
* **Details**
|
| 1027 |
+
*
|
| 1028 |
* This error occurs when tool approval responses are present in the prompt
|
| 1029 |
* but no toolkit was provided to resolve them.
|
| 1030 |
*
|
| 1031 |
+
* **Example** (Creating a toolkit required error)
|
| 1032 |
+
*
|
| 1033 |
* ```ts
|
| 1034 |
* import { AiError } from "effect/unstable/ai"
|
| 1035 |
*
|
|
|
|
| 1042 |
* // "Toolkit required to resolve pending tool approvals: GetWeather, SendEmail"
|
| 1043 |
* ```
|
| 1044 |
*
|
|
|
|
| 1045 |
* @category reason
|
| 1046 |
+
* @since 4.0.0
|
| 1047 |
*/
|
| 1048 |
export class ToolkitRequiredError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/ToolkitRequiredError")({
|
| 1049 |
_tag: /*#__PURE__*/Schema.tag("ToolkitRequiredError"),
|
|
|
|
| 1051 |
description: /*#__PURE__*/Schema.optional(Schema.String)
|
| 1052 |
}) {
|
| 1053 |
/**
|
| 1054 |
+
* Marks `ToolkitRequiredError` as a semantic AI error reason for runtime guards.
|
| 1055 |
+
*
|
| 1056 |
+
* @since 4.0.0
|
| 1057 |
*/
|
| 1058 |
[ReasonTypeId] = ReasonTypeId;
|
| 1059 |
/**
|
| 1060 |
* Toolkit required errors are not retryable without providing a toolkit.
|
| 1061 |
*
|
| 1062 |
+
* @since 4.0.0
|
| 1063 |
*/
|
| 1064 |
get isRetryable() {
|
| 1065 |
return false;
|
|
|
|
| 1072 |
/**
|
| 1073 |
* Error indicating the user provided invalid input in their prompt.
|
| 1074 |
*
|
| 1075 |
+
* **Details**
|
| 1076 |
+
*
|
| 1077 |
* This error is raised when the prompt contains content that is structurally
|
| 1078 |
* valid but not supported by the provider (e.g., unsupported media types,
|
| 1079 |
* unsupported file formats, etc.).
|
| 1080 |
*
|
| 1081 |
+
* **Example** (Creating an invalid user input error)
|
| 1082 |
+
*
|
| 1083 |
* ```ts
|
| 1084 |
* import { AiError } from "effect/unstable/ai"
|
| 1085 |
*
|
| 1086 |
* const error = new AiError.InvalidUserInputError({
|
| 1087 |
+
* description: "Unsupported media type 'video/mp4'. Supported types include images, application/pdf, text/plain"
|
| 1088 |
* })
|
| 1089 |
*
|
| 1090 |
* console.log(error.isRetryable) // false
|
| 1091 |
* console.log(error.message)
|
| 1092 |
+
* // "Invalid user input: Unsupported media type 'video/mp4'. Supported types include images, application/pdf, text/plain"
|
| 1093 |
* ```
|
| 1094 |
*
|
|
|
|
| 1095 |
* @category reason
|
| 1096 |
+
* @since 4.0.0
|
| 1097 |
*/
|
| 1098 |
export class InvalidUserInputError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/InvalidUserInputError")({
|
| 1099 |
_tag: /*#__PURE__*/Schema.tag("InvalidUserInputError"),
|
| 1100 |
description: Schema.String
|
| 1101 |
}) {
|
| 1102 |
/**
|
| 1103 |
+
* Marks `InvalidUserInputError` as a semantic AI error reason for runtime guards.
|
| 1104 |
+
*
|
| 1105 |
+
* @since 4.0.0
|
| 1106 |
*/
|
| 1107 |
[ReasonTypeId] = ReasonTypeId;
|
| 1108 |
/**
|
| 1109 |
* Invalid user input errors require fixing the input and are not retryable.
|
| 1110 |
*
|
| 1111 |
+
* @since 4.0.0
|
| 1112 |
*/
|
| 1113 |
get isRetryable() {
|
| 1114 |
return false;
|
|
|
|
| 1120 |
/**
|
| 1121 |
* Schema for validating and parsing AI error reasons.
|
| 1122 |
*
|
| 1123 |
+
* **When to use**
|
| 1124 |
+
*
|
| 1125 |
+
* Use when decoding or validating unknown AI error reason values with Schema.
|
| 1126 |
+
*
|
| 1127 |
+
* **Details**
|
| 1128 |
+
*
|
| 1129 |
+
* This runtime schema is the union of the concrete AI error reason classes.
|
| 1130 |
+
*
|
| 1131 |
+
* @see {@link isAiErrorReason} for checking an existing value without Schema decoding
|
| 1132 |
+
*
|
| 1133 |
* @category schemas
|
| 1134 |
+
* @since 4.0.0
|
| 1135 |
*/
|
| 1136 |
export const AiErrorReason = /*#__PURE__*/Schema.Union([RateLimitError, QuotaExhaustedError, AuthenticationError, ContentPolicyError, InvalidRequestError, InternalProviderError, NetworkError, InvalidOutputError, StructuredOutputError, UnsupportedSchemaError, UnknownError, ToolNotFoundError, ToolParameterValidationError, InvalidToolResultError, ToolResultEncodingError, ToolConfigurationError, ToolkitRequiredError, InvalidUserInputError]);
|
| 1137 |
// =============================================================================
|
|
|
|
| 1139 |
// =============================================================================
|
| 1140 |
const TypeId = "~effect/unstable/ai/AiError/AiError";
|
| 1141 |
/**
|
| 1142 |
+
* Schema for the top-level AI error wrapper using the `reason` pattern.
|
| 1143 |
*
|
| 1144 |
+
* **When to use**
|
|
|
|
|
|
|
|
|
|
| 1145 |
*
|
| 1146 |
+
* Use when you need AI errors that can be handled by semantic reason with
|
| 1147 |
+
* `Effect.catchReason`.
|
| 1148 |
+
*
|
| 1149 |
+
* **Details**
|
| 1150 |
+
*
|
| 1151 |
+
* This error stores `module` and `method` context, the semantic `reason`, and
|
| 1152 |
+
* delegates `isRetryable` and `retryAfter` to the underlying reason.
|
| 1153 |
+
*
|
| 1154 |
+
* **Example** (Handling an AI error by tag)
|
| 1155 |
*
|
|
|
|
| 1156 |
* ```ts
|
| 1157 |
* import { Effect } from "effect"
|
| 1158 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 1170 |
* )
|
| 1171 |
* ```
|
| 1172 |
*
|
|
|
|
| 1173 |
* @category schemas
|
| 1174 |
+
* @since 4.0.0
|
| 1175 |
*/
|
| 1176 |
export class AiError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/AiError/AiError")({
|
| 1177 |
_tag: /*#__PURE__*/Schema.tag("AiError"),
|
|
|
|
| 1184 |
/**
|
| 1185 |
* Delegates to the underlying reason's `isRetryable` getter.
|
| 1186 |
*
|
| 1187 |
+
* @since 4.0.0
|
| 1188 |
*/
|
| 1189 |
get isRetryable() {
|
| 1190 |
return this.reason.isRetryable;
|
|
|
|
| 1192 |
/**
|
| 1193 |
* Delegates to the underlying reason's `retryAfter` if present.
|
| 1194 |
*
|
| 1195 |
+
* @since 4.0.0
|
| 1196 |
*/
|
| 1197 |
get retryAfter() {
|
| 1198 |
return "retryAfter" in this.reason ? this.reason.retryAfter : undefined;
|
|
|
|
| 1204 |
/**
|
| 1205 |
* Type guard to check if a value is an `AiError`.
|
| 1206 |
*
|
| 1207 |
+
* **Example** (Checking for an AI error)
|
|
|
|
| 1208 |
*
|
|
|
|
| 1209 |
* ```ts
|
| 1210 |
* import { AiError } from "effect/unstable/ai"
|
| 1211 |
*
|
|
|
|
| 1220 |
* console.log(AiError.isAiError(aiError)) // true
|
| 1221 |
* ```
|
| 1222 |
*
|
|
|
|
| 1223 |
* @category guards
|
| 1224 |
+
* @since 4.0.0
|
| 1225 |
*/
|
| 1226 |
export const isAiError = u => Predicate.hasProperty(u, TypeId);
|
| 1227 |
/**
|
| 1228 |
* Type guard to check if a value is an `AiErrorReason`.
|
| 1229 |
*
|
| 1230 |
+
* **Example** (Checking for an AI error reason)
|
|
|
|
| 1231 |
*
|
|
|
|
| 1232 |
* ```ts
|
| 1233 |
* import { AiError } from "effect/unstable/ai"
|
| 1234 |
*
|
|
|
|
| 1239 |
* console.log(AiError.isAiErrorReason(genericError)) // false
|
| 1240 |
* ```
|
| 1241 |
*
|
|
|
|
| 1242 |
* @category guards
|
| 1243 |
+
* @since 4.0.0
|
| 1244 |
*/
|
| 1245 |
export const isAiErrorReason = u => Predicate.hasProperty(u, ReasonTypeId);
|
| 1246 |
/**
|
| 1247 |
* Creates an `AiError` with the given reason.
|
| 1248 |
*
|
| 1249 |
+
* **Example** (Creating an AI error)
|
| 1250 |
+
*
|
| 1251 |
* ```ts
|
| 1252 |
* import { Duration } from "effect"
|
| 1253 |
* import { AiError } from "effect/unstable/ai"
|
|
|
|
| 1264 |
* // "OpenAI.completion: Rate limit exceeded. Retry after 1 minute"
|
| 1265 |
* ```
|
| 1266 |
*
|
|
|
|
| 1267 |
* @category constructors
|
| 1268 |
+
* @since 4.0.0
|
| 1269 |
*/
|
| 1270 |
export const make = params => new AiError(params);
|
| 1271 |
/**
|
| 1272 |
* Maps HTTP status codes to semantic error reasons.
|
| 1273 |
*
|
| 1274 |
+
* **When to use**
|
| 1275 |
+
*
|
| 1276 |
+
* Use as the base mapping when provider packages translate HTTP status codes into
|
| 1277 |
+
* provider-specific error reasons.
|
| 1278 |
+
*
|
| 1279 |
+
* **Example** (Mapping an HTTP status to a reason)
|
| 1280 |
*
|
|
|
|
| 1281 |
* ```ts
|
| 1282 |
* import { AiError } from "effect/unstable/ai"
|
| 1283 |
*
|
|
|
|
| 1289 |
* console.log(reason._tag) // "RateLimitError"
|
| 1290 |
* ```
|
| 1291 |
*
|
|
|
|
| 1292 |
* @category constructors
|
| 1293 |
+
* @since 4.0.0
|
| 1294 |
*/
|
| 1295 |
export const reasonFromHttpStatus = params => {
|
| 1296 |
const {
|
.opencode/node_modules/effect/dist/unstable/ai/AiError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"AiError.js","names":["Duration","Effect","Option","Predicate","redact","Redacted","Schema","HttpRequestDetails","HttpResponseDetails","ReasonTypeId","providerMetadataWithDefaults","ProviderMetadata","pipe","withConstructorDefault","succeed","withDecodingDefault","redactHeaders","headers","redacted","result","key","value","isRedacted","toString","NetworkError","ErrorClass","_tag","tag","reason","Literals","request","description","optional","String","isRetryable","fromRequestError","error","hash","getOrUndefined","method","url","urlParams","Array","from","message","methodAndUrl","baseMessage","suggestion","Record","NullOr","MutableJson","UsageInfo","Struct","promptTokens","Number","completionTokens","totalTokens","annotate","identifier","HttpContext","response","body","RateLimitError","retryAfter","metadata","http","msg","format","QuotaExhaustedError","resetAt","DateTimeUtc","AuthenticationError","kind","suggestions","InvalidKey","ExpiredKey","MissingKey","InsufficientPermissions","Unknown","ContentPolicyError","InvalidRequestError","parameter","constraint","InternalProviderError","InvalidOutputError","usage","fromSchemaError","StructuredOutputError","responseText","UnsupportedSchemaError","UnknownError","ToolNotFoundError","toolName","availableTools","length","join","ToolParameterValidationError","toolParams","Json","InvalidToolResultError","ToolResultEncodingError","toolResult","ToolConfigurationError","ToolkitRequiredError","pendingApprovals","tools","InvalidUserInputError","AiErrorReason","Union","TypeId","AiError","module","cause","undefined","isAiError","u","hasProperty","isAiErrorReason","make","params","reasonFromHttpStatus","status","common"],"sources":["../../../src/unstable/ai/AiError.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,OAAO,KAAKA,QAAQ,MAAM,mBAAmB;AAC7C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,MAAM,MAAM,iBA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AAEpD,WAAW,EAAE,cAAc;UAAE,GAAG2F;QAAM,CAAE,CAAC;MAC9E;MACA,OAAO,IAAIhC,YAAY,CAACgC,MAAM,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
|
|
|
|
| 1 |
+
{"version":3,"file":"AiError.js","names":["Duration","Effect","Option","Predicate","redact","Redacted","Schema","HttpRequestDetails","HttpResponseDetails","ReasonTypeId","providerMetadataWithDefaults","ProviderMetadata","pipe","withConstructorDefault","succeed","withDecodingDefault","redactHeaders","headers","redacted","result","key","value","isRedacted","toString","NetworkError","ErrorClass","_tag","tag","reason","Literals","request","description","optional","String","isRetryable","fromRequestError","error","hash","getOrUndefined","method","url","urlParams","Array","from","message","methodAndUrl","baseMessage","suggestion","Record","NullOr","MutableJson","UsageInfo","Struct","promptTokens","Number","completionTokens","totalTokens","annotate","identifier","HttpContext","response","body","RateLimitError","retryAfter","metadata","http","msg","format","QuotaExhaustedError","resetAt","DateTimeUtc","AuthenticationError","kind","suggestions","InvalidKey","ExpiredKey","MissingKey","InsufficientPermissions","Unknown","ContentPolicyError","InvalidRequestError","parameter","constraint","InternalProviderError","InvalidOutputError","usage","fromSchemaError","StructuredOutputError","responseText","UnsupportedSchemaError","UnknownError","ToolNotFoundError","toolName","availableTools","length","join","ToolParameterValidationError","toolParams","Json","InvalidToolResultError","ToolResultEncodingError","toolResult","ToolConfigurationError","ToolkitRequiredError","pendingApprovals","tools","InvalidUserInputError","AiErrorReason","Union","TypeId","AiError","module","cause","undefined","isAiError","u","hasProperty","isAiErrorReason","make","params","reasonFromHttpStatus","status","common"],"sources":["../../../src/unstable/ai/AiError.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;AAaA,OAAO,KAAKA,QAAQ,MAAM,mBAAmB;AAC7C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,SAASC,MAAM,QA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C4D,MAAM,CAAC;IACnC;MACE,IAAID,MAAM,IAAI,GAAG,EAAE;QACjB,OAAO,IAAItC,qBAAqB,CAAC;UAAEpD,WAAW,EAAE,cAAc;UAAE,GAAG2F;QAAM,CAAE,CAAC;MAC9E;MACA,OAAO,IAAIhC,YAAY,CAACgC,MAAM,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.d.ts
CHANGED
|
@@ -1,29 +1,35 @@
|
|
| 1 |
import * as JsonSchema from "../../JsonSchema.ts";
|
| 2 |
import * as Schema from "../../Schema.ts";
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
*
|
| 17 |
-
*
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
-
*
|
| 21 |
-
*
|
| 22 |
-
*
|
| 23 |
-
*
|
| 24 |
-
*
|
| 25 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
* @category Codec Transformation
|
|
|
|
| 27 |
*/
|
| 28 |
export declare function toCodecAnthropic<T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>): {
|
| 29 |
readonly codec: Schema.Codec<T, unknown, RD, RE>;
|
|
|
|
| 1 |
import * as JsonSchema from "../../JsonSchema.ts";
|
| 2 |
import * as Schema from "../../Schema.ts";
|
| 3 |
/**
|
| 4 |
+
* Converts a `Schema.Codec` to Anthropic structured-output JSON Schema and a
|
| 5 |
+
* matching codec for model output.
|
| 6 |
+
*
|
| 7 |
+
* **When to use**
|
| 8 |
+
*
|
| 9 |
+
* Use when you send Effect Schema-backed structured output requests to
|
| 10 |
+
* Anthropic and need provider-compatible JSON Schema without losing the decoded
|
| 11 |
+
* application type.
|
| 12 |
+
*
|
| 13 |
+
* **Details**
|
| 14 |
+
*
|
| 15 |
+
* Returns the JSON Schema to include in the request and the codec to use when
|
| 16 |
+
* decoding the model response. If the input schema already fits Anthropic's
|
| 17 |
+
* supported JSON Schema subset, the original codec is returned unchanged.
|
| 18 |
+
*
|
| 19 |
+
* **Gotchas**
|
| 20 |
+
*
|
| 21 |
+
* - Some schemas use a provider-safe encoded shape: tuples become objects with
|
| 22 |
+
* numeric string keys, records become arrays of `[key, value]` pairs, and
|
| 23 |
+
* optional properties become required nullable properties.
|
| 24 |
+
* - `oneOf` unions are emitted as `anyOf` unions.
|
| 25 |
+
* - Unsupported schema kinds throw during conversion instead of producing a
|
| 26 |
+
* lossy schema.
|
| 27 |
+
*
|
| 28 |
+
* @see {@link LanguageModel.CodecTransformer} for the structured-output transformer contract
|
| 29 |
+
* @see {@link OpenAiStructuredOutput.toCodecOpenAI} for the OpenAI-specific transformer
|
| 30 |
+
*
|
| 31 |
* @category Codec Transformation
|
| 32 |
+
* @since 4.0.0
|
| 33 |
*/
|
| 34 |
export declare function toCodecAnthropic<T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>): {
|
| 35 |
readonly codec: Schema.Codec<T, unknown, RD, RE>;
|
.opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"AnthropicStructuredOutput.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/AnthropicStructuredOutput.ts"],"names":[],"mappings":"
|
|
|
|
| 1 |
+
{"version":3,"file":"AnthropicStructuredOutput.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/AnthropicStructuredOutput.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AAGjD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAOzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAC3C,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,GACjC;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAChD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAA;CAC3C,CAYA"}
|
.opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.js
CHANGED
|
@@ -1,57 +1,61 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
|
|
|
| 3 |
*
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
|
|
|
|
|
|
| 8 |
*
|
| 9 |
-
*
|
| 10 |
-
* - Converting optional properties to nullable unions (`T | null`)
|
| 11 |
-
* - Converting index signatures (records) to arrays of key-value pairs
|
| 12 |
-
* - Converting `oneOf` unions to `anyOf` unions
|
| 13 |
-
* - Stripping unsupported annotations and preserving only Anthropic-compatible
|
| 14 |
-
* formats and descriptions
|
| 15 |
-
*
|
| 16 |
-
* @since 1.0.0
|
| 17 |
*/
|
| 18 |
import * as Arr from "../../Array.js";
|
| 19 |
import * as JsonSchema from "../../JsonSchema.js";
|
| 20 |
import * as Option from "../../Option.js";
|
| 21 |
import * as Predicate from "../../Predicate.js";
|
| 22 |
import * as Schema from "../../Schema.js";
|
| 23 |
-
import * as
|
| 24 |
-
import * as
|
|
|
|
|
|
|
| 25 |
import * as Tool from "./Tool.js";
|
| 26 |
/**
|
| 27 |
-
*
|
| 28 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
*
|
| 30 |
-
*
|
| 31 |
-
* Anthropic does not support natively:
|
| 32 |
*
|
| 33 |
-
* -
|
| 34 |
-
*
|
| 35 |
-
*
|
| 36 |
-
* -
|
| 37 |
-
*
|
| 38 |
-
*
|
| 39 |
-
* pairs.
|
| 40 |
-
* - **`oneOf` unions** are rewritten as `anyOf` unions.
|
| 41 |
-
* - **Filters and annotations** are preserved where compatible (e.g.
|
| 42 |
-
* `description`, supported `format` values like `"date-time"`, `"email"`,
|
| 43 |
-
* `"uuid"`, etc.), and stripped otherwise.
|
| 44 |
*
|
| 45 |
-
*
|
| 46 |
-
*
|
| 47 |
*
|
| 48 |
-
* @since 1.0.0
|
| 49 |
* @category Codec Transformation
|
|
|
|
| 50 |
*/
|
| 51 |
export function toCodecAnthropic(schema) {
|
| 52 |
const to = schema.ast;
|
| 53 |
-
const from = recur(
|
| 54 |
-
const codec = from === to ? schema : Schema.make(
|
| 55 |
const document = JsonSchema.resolveTopLevel$ref(Schema.toJsonSchemaDocument(codec));
|
| 56 |
const jsonSchema = {
|
| 57 |
...document.schema
|
|
@@ -90,7 +94,7 @@ function recur(ast) {
|
|
| 90 |
filters
|
| 91 |
} = get(ast);
|
| 92 |
if (annotations !== undefined || filters !== undefined) {
|
| 93 |
-
return new
|
| 94 |
}
|
| 95 |
return ast;
|
| 96 |
}
|
|
@@ -101,7 +105,7 @@ function recur(ast) {
|
|
| 101 |
filters
|
| 102 |
} = get(ast);
|
| 103 |
if (annotations !== undefined || filters !== undefined) {
|
| 104 |
-
return new
|
| 105 |
}
|
| 106 |
return ast;
|
| 107 |
}
|
|
@@ -116,7 +120,7 @@ function recur(ast) {
|
|
| 116 |
filters
|
| 117 |
} = get(ast);
|
| 118 |
if (annotations !== undefined || filters !== undefined) {
|
| 119 |
-
return new
|
| 120 |
}
|
| 121 |
return ast;
|
| 122 |
}
|
|
@@ -125,15 +129,15 @@ function recur(ast) {
|
|
| 125 |
case "Union":
|
| 126 |
{
|
| 127 |
if (ast.mode === "oneOf") {
|
| 128 |
-
return new
|
| 129 |
}
|
| 130 |
-
const types =
|
| 131 |
const {
|
| 132 |
annotations,
|
| 133 |
filters
|
| 134 |
} = get(ast);
|
| 135 |
if (types !== ast.types || annotations !== undefined || filters !== undefined) {
|
| 136 |
-
return new
|
| 137 |
}
|
| 138 |
return ast;
|
| 139 |
}
|
|
@@ -155,12 +159,12 @@ function recur(ast) {
|
|
| 155 |
annotations.description = TUPLE_DESCRIPTION;
|
| 156 |
}
|
| 157 |
const propertySignatures = ast.elements.map((e, i) => {
|
| 158 |
-
return new
|
| 159 |
});
|
| 160 |
if (ast.rest.length === 1) {
|
| 161 |
-
propertySignatures.push(new
|
| 162 |
}
|
| 163 |
-
return
|
| 164 |
decode: o => {
|
| 165 |
let t = [];
|
| 166 |
for (let i = 0; i < ast.elements.length; i++) {
|
|
@@ -188,9 +192,9 @@ function recur(ast) {
|
|
| 188 |
}
|
| 189 |
}));
|
| 190 |
} else {
|
| 191 |
-
const rest =
|
| 192 |
if (rest !== ast.rest || annotations !== undefined || filters !== undefined) {
|
| 193 |
-
return new
|
| 194 |
}
|
| 195 |
return ast;
|
| 196 |
}
|
|
@@ -202,14 +206,14 @@ function recur(ast) {
|
|
| 202 |
filters
|
| 203 |
} = get(ast);
|
| 204 |
if (ast.indexSignatures.length === 0) {
|
| 205 |
-
const propertySignatures =
|
| 206 |
if (typeof ps.name !== "string") {
|
| 207 |
throw new Error(`${errorPrefix}: Property names must be strings (got ${typeof ps.name})`);
|
| 208 |
}
|
| 209 |
let type = recur(ps.type);
|
| 210 |
// opttional properties are not supported by Anthropic, so we translate them to nullable unions
|
| 211 |
-
if (
|
| 212 |
-
type =
|
| 213 |
decode: Option.filter(Predicate.isNotNull),
|
| 214 |
encode: Option.orElseSome(() => null)
|
| 215 |
}));
|
|
@@ -217,10 +221,10 @@ function recur(ast) {
|
|
| 217 |
if (type === ps.type) {
|
| 218 |
return ps;
|
| 219 |
}
|
| 220 |
-
return new
|
| 221 |
});
|
| 222 |
if (propertySignatures !== ast.propertySignatures || annotations !== undefined || filters !== undefined) {
|
| 223 |
-
return new
|
| 224 |
}
|
| 225 |
} else if (ast.indexSignatures.length === 1 && ast.propertySignatures.length === 0) {
|
| 226 |
const is = ast.indexSignatures[0];
|
|
@@ -234,7 +238,7 @@ function recur(ast) {
|
|
| 234 |
annotations ??= {};
|
| 235 |
annotations.description = RECORD_DESCRIPTION;
|
| 236 |
}
|
| 237 |
-
return
|
| 238 |
decode: Object.fromEntries,
|
| 239 |
encode: Object.entries
|
| 240 |
}));
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Adapts Effect Schema codecs to the JSON Schema subset accepted by Anthropic
|
| 3 |
+
* structured output.
|
| 4 |
*
|
| 5 |
+
* The main entry point returns the JSON Schema to send to Anthropic and a codec
|
| 6 |
+
* for decoding the model response back into the original application type. When
|
| 7 |
+
* Anthropic cannot express the original schema shape directly, the conversion
|
| 8 |
+
* rewrites supported cases such as tuples, records, optional properties, and
|
| 9 |
+
* `oneOf` unions. Schema kinds that cannot be represented throw during
|
| 10 |
+
* conversion instead of producing a lossy schema.
|
| 11 |
*
|
| 12 |
+
* @since 4.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
*/
|
| 14 |
import * as Arr from "../../Array.js";
|
| 15 |
import * as JsonSchema from "../../JsonSchema.js";
|
| 16 |
import * as Option from "../../Option.js";
|
| 17 |
import * as Predicate from "../../Predicate.js";
|
| 18 |
import * as Schema from "../../Schema.js";
|
| 19 |
+
import * as SchemaAST from "../../SchemaAST.js";
|
| 20 |
+
import * as SchemaTransformation from "../../SchemaTransformation.js";
|
| 21 |
+
import * as LanguageModel from "./LanguageModel.js";
|
| 22 |
+
import * as OpenAiStructuredOutput from "./OpenAiStructuredOutput.js";
|
| 23 |
import * as Tool from "./Tool.js";
|
| 24 |
/**
|
| 25 |
+
* Converts a `Schema.Codec` to Anthropic structured-output JSON Schema and a
|
| 26 |
+
* matching codec for model output.
|
| 27 |
+
*
|
| 28 |
+
* **When to use**
|
| 29 |
+
*
|
| 30 |
+
* Use when you send Effect Schema-backed structured output requests to
|
| 31 |
+
* Anthropic and need provider-compatible JSON Schema without losing the decoded
|
| 32 |
+
* application type.
|
| 33 |
+
*
|
| 34 |
+
* **Details**
|
| 35 |
+
*
|
| 36 |
+
* Returns the JSON Schema to include in the request and the codec to use when
|
| 37 |
+
* decoding the model response. If the input schema already fits Anthropic's
|
| 38 |
+
* supported JSON Schema subset, the original codec is returned unchanged.
|
| 39 |
*
|
| 40 |
+
* **Gotchas**
|
|
|
|
| 41 |
*
|
| 42 |
+
* - Some schemas use a provider-safe encoded shape: tuples become objects with
|
| 43 |
+
* numeric string keys, records become arrays of `[key, value]` pairs, and
|
| 44 |
+
* optional properties become required nullable properties.
|
| 45 |
+
* - `oneOf` unions are emitted as `anyOf` unions.
|
| 46 |
+
* - Unsupported schema kinds throw during conversion instead of producing a
|
| 47 |
+
* lossy schema.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
*
|
| 49 |
+
* @see {@link LanguageModel.CodecTransformer} for the structured-output transformer contract
|
| 50 |
+
* @see {@link OpenAiStructuredOutput.toCodecOpenAI} for the OpenAI-specific transformer
|
| 51 |
*
|
|
|
|
| 52 |
* @category Codec Transformation
|
| 53 |
+
* @since 4.0.0
|
| 54 |
*/
|
| 55 |
export function toCodecAnthropic(schema) {
|
| 56 |
const to = schema.ast;
|
| 57 |
+
const from = recur(SchemaAST.toEncoded(to));
|
| 58 |
+
const codec = from === to ? schema : Schema.make(SchemaAST.decodeTo(from, to, SchemaTransformation.passthrough()));
|
| 59 |
const document = JsonSchema.resolveTopLevel$ref(Schema.toJsonSchemaDocument(codec));
|
| 60 |
const jsonSchema = {
|
| 61 |
...document.schema
|
|
|
|
| 94 |
filters
|
| 95 |
} = get(ast);
|
| 96 |
if (annotations !== undefined || filters !== undefined) {
|
| 97 |
+
return new SchemaAST.String(annotations, filters);
|
| 98 |
}
|
| 99 |
return ast;
|
| 100 |
}
|
|
|
|
| 105 |
filters
|
| 106 |
} = get(ast);
|
| 107 |
if (annotations !== undefined || filters !== undefined) {
|
| 108 |
+
return new SchemaAST.Number(annotations, filters);
|
| 109 |
}
|
| 110 |
return ast;
|
| 111 |
}
|
|
|
|
| 120 |
filters
|
| 121 |
} = get(ast);
|
| 122 |
if (annotations !== undefined || filters !== undefined) {
|
| 123 |
+
return new SchemaAST.Literal(ast.literal, annotations, filters);
|
| 124 |
}
|
| 125 |
return ast;
|
| 126 |
}
|
|
|
|
| 129 |
case "Union":
|
| 130 |
{
|
| 131 |
if (ast.mode === "oneOf") {
|
| 132 |
+
return new SchemaAST.Union(ast.types, "anyOf", ast.annotations, ast.checks);
|
| 133 |
}
|
| 134 |
+
const types = SchemaAST.mapOrSame(ast.types, recur);
|
| 135 |
const {
|
| 136 |
annotations,
|
| 137 |
filters
|
| 138 |
} = get(ast);
|
| 139 |
if (types !== ast.types || annotations !== undefined || filters !== undefined) {
|
| 140 |
+
return new SchemaAST.Union(types, "anyOf", annotations, filters);
|
| 141 |
}
|
| 142 |
return ast;
|
| 143 |
}
|
|
|
|
| 159 |
annotations.description = TUPLE_DESCRIPTION;
|
| 160 |
}
|
| 161 |
const propertySignatures = ast.elements.map((e, i) => {
|
| 162 |
+
return new SchemaAST.PropertySignature(String(i), e);
|
| 163 |
});
|
| 164 |
if (ast.rest.length === 1) {
|
| 165 |
+
propertySignatures.push(new SchemaAST.PropertySignature(REST_PROPERTY_NAME, new SchemaAST.Arrays(false, [], ast.rest)));
|
| 166 |
}
|
| 167 |
+
return SchemaAST.decodeTo(recur(new SchemaAST.Objects(propertySignatures, [], annotations, filters)), ast, SchemaTransformation.transform({
|
| 168 |
decode: o => {
|
| 169 |
let t = [];
|
| 170 |
for (let i = 0; i < ast.elements.length; i++) {
|
|
|
|
| 192 |
}
|
| 193 |
}));
|
| 194 |
} else {
|
| 195 |
+
const rest = SchemaAST.mapOrSame(ast.rest, recur);
|
| 196 |
if (rest !== ast.rest || annotations !== undefined || filters !== undefined) {
|
| 197 |
+
return new SchemaAST.Arrays(false, [], rest, annotations, filters);
|
| 198 |
}
|
| 199 |
return ast;
|
| 200 |
}
|
|
|
|
| 206 |
filters
|
| 207 |
} = get(ast);
|
| 208 |
if (ast.indexSignatures.length === 0) {
|
| 209 |
+
const propertySignatures = SchemaAST.mapOrSame(ast.propertySignatures, ps => {
|
| 210 |
if (typeof ps.name !== "string") {
|
| 211 |
throw new Error(`${errorPrefix}: Property names must be strings (got ${typeof ps.name})`);
|
| 212 |
}
|
| 213 |
let type = recur(ps.type);
|
| 214 |
// opttional properties are not supported by Anthropic, so we translate them to nullable unions
|
| 215 |
+
if (SchemaAST.isOptional(ps.type)) {
|
| 216 |
+
type = SchemaAST.decodeTo(new SchemaAST.Union([type, SchemaAST.null], "anyOf"), SchemaAST.optionalKey(type), SchemaTransformation.transformOptional({
|
| 217 |
decode: Option.filter(Predicate.isNotNull),
|
| 218 |
encode: Option.orElseSome(() => null)
|
| 219 |
}));
|
|
|
|
| 221 |
if (type === ps.type) {
|
| 222 |
return ps;
|
| 223 |
}
|
| 224 |
+
return new SchemaAST.PropertySignature(ps.name, type);
|
| 225 |
});
|
| 226 |
if (propertySignatures !== ast.propertySignatures || annotations !== undefined || filters !== undefined) {
|
| 227 |
+
return new SchemaAST.Objects(propertySignatures, [], annotations, filters);
|
| 228 |
}
|
| 229 |
} else if (ast.indexSignatures.length === 1 && ast.propertySignatures.length === 0) {
|
| 230 |
const is = ast.indexSignatures[0];
|
|
|
|
| 238 |
annotations ??= {};
|
| 239 |
annotations.description = RECORD_DESCRIPTION;
|
| 240 |
}
|
| 241 |
+
return SchemaAST.decodeTo(recur(new SchemaAST.Arrays(false, [], [new SchemaAST.Arrays(false, [is.parameter, is.type], [])], annotations)), ast, SchemaTransformation.transform({
|
| 242 |
decode: Object.fromEntries,
|
| 243 |
encode: Object.entries
|
| 244 |
}));
|
.opencode/node_modules/effect/dist/unstable/ai/AnthropicStructuredOutput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"AnthropicStructuredOutput.js","names":["Arr","JsonSchema","Option","Predicate","Schema","AST","Transformation","Tool","toCodecAnthropic","schema","to","ast","from","recur","toEncoded","codec","make","decodeTo","passthrough","document","resolveTopLevel$ref","toJsonSchemaDocument","jsonSchema","Object","keys","definitions","length","$defs","_tag","unsupportedAst","annotations","filters","get","undefined","String","Number","literal","Literal","Error","errorPrefix","mode","Union","types","checks","mapOrSame","rest","elements","description","TUPLE_DESCRIPTION","propertySignatures","map","e","i","PropertySignature","push","REST_PROPERTY_NAME","Arrays","Objects","transform","decode","o","t","k","encode","slice","indexSignatures","ps","name","type","isOptional","null","optionalKey","transformOptional","filter","isNotNull","orElseSome","is","isEmptyParamsRecord","RECORD_DESCRIPTION","parameter","fromEntries","entries","details","base","full","getChecks","check","format","isArrayNonEmpty","getFilters","getAnnotations","out","meta","expected","formats","includes","getFilter","concat","resetFilter","regExp","RegExp","annotate","title","flatMap"],"sources":["../../../src/unstable/ai/AnthropicStructuredOutput.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKA,GAAG,MAAM,gBAAgB;AACrC,OAAO,KAAKC,UAAU,MAAM,qBAAqB;AACjD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,GAAG,MAAM,oBAAoB;AACzC,OAAO,KAAKC,cAAc,MAAM,+BAA+B;AAC/D,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAM,SAAUC,gBAAgBA,CAC9BC,MAAkC;EAKlC,MAAMC,EAAE,GAAGD,MAAM,CAACE,GAAG;EACrB,MAAMC,IAAI,GAAGC,KAAK,CAACR,GAAG,CAACS,SAAS,CAACJ,EAAE,CAAC,CAAC;EACrC,MAAMK,KAAK,GAAGH,IAAI,KAAKF,EAAE,GAAGD,MAAM,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IAAI8D,IAAI,IAAIA,IAAI,CAACO,MAAM,YAAYC,MAAM,EAAE;MACrDT,GAAG,CAACrC,IAAI,CAAC;QAAE1B,IAAI,EAAE,QAAQ;QAAE6C,MAAM,EAAEyB,WAAW,CAACzB,MAAM;MAAC,CAAE,CAAC;IAC3D;EACF;EACA,OAAOkB,GAAG;AACZ;AAEA,SAASO,WAAWA,CAACzB,MAAuB;EAC1C,OAAOA,MAAM,CAAC4B,QAAQ,CAAC;IACrBtD,WAAW,EAAEd,SAAS;IACtB4D,QAAQ,EAAE5D,SAAS;IACnBqE,KAAK,EAAErE,SAAS;IAChBsD,MAAM,EAAEtD;GACT,CAAC;AACJ;AAEA,SAASwD,UAAUA,CAAC9C,MAAsD;EACxE,OAAOA,MAAM,CAAC4D,OAAO,CAAEjB,KAAK,IAAI;IAC9B,QAAQA,KAAK,CAAC1D,IAAI;MAChB,KAAK,QAAQ;QACX,OAAOoE,SAAS,CAACV,KAAK,CAAC;MACzB,KAAK,aAAa;QAChB,OAAOG,UAAU,CAACH,KAAK,CAAC3C,MAAM,CAAC;IACnC;EACF,CAAC,CAAC;AACJ;AAEA,MAAMmD,OAAO,GAAG,CACd,WAAW,EACX,MAAM,EACN,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,CACP","ignoreList":[]}
|
|
|
|
| 1 |
+
{"version":3,"file":"AnthropicStructuredOutput.js","names":["Arr","JsonSchema","Option","Predicate","Schema","SchemaAST","SchemaTransformation","LanguageModel","OpenAiStructuredOutput","Tool","toCodecAnthropic","schema","to","ast","from","recur","toEncoded","codec","make","decodeTo","passthrough","document","resolveTopLevel$ref","toJsonSchemaDocument","jsonSchema","Object","keys","definitions","length","$defs","_tag","unsupportedAst","annotations","filters","get","undefined","String","Number","literal","Literal","Error","errorPrefix","mode","Union","types","checks","mapOrSame","rest","elements","description","TUPLE_DESCRIPTION","propertySignatures","map","e","i","PropertySignature","push","REST_PROPERTY_NAME","Arrays","Objects","transform","decode","o","t","k","encode","slice","indexSignatures","ps","name","type","isOptional","null","optionalKey","transformOptional","filter","isNotNull","orElseSome","is","isEmptyParamsRecord","RECORD_DESCRIPTION","parameter","fromEntries","entries","details","base","full","getChecks","check","format","isArrayNonEmpty","getFilters","getAnnotations","out","meta","expected","formats","includes","getFilter","concat","resetFilter","regExp","RegExp","annotate","title","flatMap"],"sources":["../../../src/unstable/ai/AnthropicStructuredOutput.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;AAaA,OAAO,KAAKA,GAAG,MAAM,gBAAgB;AACrC,OAAO,KAAKC,UAAU,MAAM,qBAAqB;AACjD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,oBAAoB,MAAM,+BAA+B;AACrE,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,sBAAsB,MAAM,6BAA6B;AACrE,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAM,SAAUC,gBAAgBA,CAC9BC,MAAkC;EAKlC,MAAMC,EAAE,GAAGD,MAAM,CAACE,GAAG;EACrB,MAAMC,IAAI,GAAGC,KAAK,CAACV,SAAS,CAACW,SAAS,CAACJ,EAAE,CAAC,CAAC;EAC3C,MAAMK,KAAK,GAAGH,IAAI,KAAKF,EAAE,GACrBD,MAAM,GACNP,MAAM,CAACc,IAAI,CAAgBb,SAAS,CAACc,QAAQ,CAACL,IAAI,EAAEF,EAAE,EAAEN,oBAAoB,CAACc,WAAW,EAAE,CAAC,CAAC;EAChG,MAAMC,QAAQ,GAAGpB,UAAU,CAACqB,mBAAmB,CAAClB,MAAM,CAACmB,oBAAoB,CAACN,KAAK,CAAC,CAAC;EACn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SAASO,WAAWA,CAACzB,MAA6B;EAChD,OAAOA,MAAM,CAAC4B,QAAQ,CAAC;IACrBtD,WAAW,EAAEd,SAAS;IACtB4D,QAAQ,EAAE5D,SAAS;IACnBqE,KAAK,EAAErE,SAAS;IAChBsD,MAAM,EAAEtD;GACT,CAAC;AACJ;AAEA,SAASwD,UAAUA,CAAC9C,MAAkE;EACpF,OAAOA,MAAM,CAAC4D,OAAO,CAAEjB,KAAK,IAAI;IAC9B,QAAQA,KAAK,CAAC1D,IAAI;MAChB,KAAK,QAAQ;QACX,OAAOoE,SAAS,CAACV,KAAK,CAAC;MACzB,KAAK,aAAa;QAChB,OAAOG,UAAU,CAACH,KAAK,CAAC3C,MAAM,CAAC;IACnC;EACF,CAAC,CAAC;AACJ;AAEA,MAAMmD,OAAO,GAAG,CACd,WAAW,EACX,MAAM,EACN,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,CACP","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/Chat.d.ts
CHANGED
|
@@ -15,13 +15,21 @@ import type * as Response from "./Response.ts";
|
|
| 15 |
import type * as Tool from "./Tool.ts";
|
| 16 |
declare const Chat_base: Context.ServiceClass<Chat, "effect/ai/Chat", Service>;
|
| 17 |
/**
|
| 18 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
*
|
| 20 |
* This tag provides access to chat functionality throughout your application,
|
| 21 |
* enabling persistent conversational AI interactions with full context
|
| 22 |
* management.
|
| 23 |
*
|
| 24 |
-
*
|
|
|
|
| 25 |
* ```ts
|
| 26 |
* import { Effect } from "effect"
|
| 27 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -35,25 +43,37 @@ declare const Chat_base: Context.ServiceClass<Chat, "effect/ai/Chat", Service>;
|
|
| 35 |
* })
|
| 36 |
* ```
|
| 37 |
*
|
| 38 |
-
* @since 4.0.0
|
| 39 |
* @category services
|
|
|
|
| 40 |
*/
|
| 41 |
export declare class Chat extends Chat_base {
|
| 42 |
}
|
| 43 |
/**
|
| 44 |
* Represents the interface that the `Chat` service provides.
|
| 45 |
*
|
| 46 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
* @category models
|
|
|
|
| 48 |
*/
|
| 49 |
export interface Service {
|
| 50 |
/**
|
| 51 |
* Reference to the chat history.
|
| 52 |
*
|
|
|
|
|
|
|
| 53 |
* Provides direct access to the conversation history for advanced use cases
|
| 54 |
* like custom history manipulation or inspection.
|
| 55 |
*
|
| 56 |
-
*
|
|
|
|
| 57 |
* ```ts
|
| 58 |
* import { Effect, Ref } from "effect"
|
| 59 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -70,10 +90,13 @@ export interface Service {
|
|
| 70 |
/**
|
| 71 |
* Exports the chat history into a structured format.
|
| 72 |
*
|
|
|
|
|
|
|
| 73 |
* Returns the complete conversation history as a structured object
|
| 74 |
* that can be stored, transmitted, or processed by other systems.
|
| 75 |
*
|
| 76 |
-
*
|
|
|
|
| 77 |
* ```ts
|
| 78 |
* import { Effect } from "effect"
|
| 79 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -93,10 +116,13 @@ export interface Service {
|
|
| 93 |
/**
|
| 94 |
* Exports the chat history as a JSON string.
|
| 95 |
*
|
|
|
|
|
|
|
| 96 |
* Provides a convenient way to serialize the entire conversation
|
| 97 |
* for storage or transmission in JSON format.
|
| 98 |
*
|
| 99 |
-
*
|
|
|
|
| 100 |
* ```ts
|
| 101 |
* import { Effect } from "effect"
|
| 102 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -118,11 +144,14 @@ export interface Service {
|
|
| 118 |
/**
|
| 119 |
* Generate text using a language model for the specified prompt.
|
| 120 |
*
|
|
|
|
|
|
|
| 121 |
* If a toolkit is specified, the language model will have access to tools
|
| 122 |
* for function calling and enhanced capabilities. Both input and output
|
| 123 |
* messages are automatically added to the chat history.
|
| 124 |
*
|
| 125 |
-
*
|
|
|
|
| 126 |
* ```ts
|
| 127 |
* import { Effect } from "effect"
|
| 128 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -160,10 +189,13 @@ export interface Service {
|
|
| 160 |
/**
|
| 161 |
* Generate text using a language model with streaming output.
|
| 162 |
*
|
|
|
|
|
|
|
| 163 |
* Returns a stream of response parts that are emitted as soon as they're
|
| 164 |
* available from the model. Supports tool calling and maintains chat history.
|
| 165 |
*
|
| 166 |
-
*
|
|
|
|
| 167 |
* ```ts
|
| 168 |
* import { Effect, Stream } from "effect"
|
| 169 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -200,11 +232,14 @@ export interface Service {
|
|
| 200 |
/**
|
| 201 |
* Generate a structured object using a language model and schema.
|
| 202 |
*
|
|
|
|
|
|
|
| 203 |
* Forces the model to return data that conforms to the specified schema,
|
| 204 |
* enabling structured data extraction and type-safe responses. The
|
| 205 |
* conversation history is maintained across calls.
|
| 206 |
*
|
| 207 |
-
*
|
|
|
|
| 208 |
* ```ts
|
| 209 |
* import { Effect, Schema } from "effect"
|
| 210 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -235,10 +270,13 @@ export interface Service {
|
|
| 235 |
/**
|
| 236 |
* Creates a new Chat service with empty conversation history.
|
| 237 |
*
|
| 238 |
-
*
|
| 239 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
*
|
| 241 |
-
* @example
|
| 242 |
* ```ts
|
| 243 |
* import { Effect } from "effect"
|
| 244 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -256,17 +294,20 @@ export interface Service {
|
|
| 256 |
* })
|
| 257 |
* ```
|
| 258 |
*
|
| 259 |
-
* @since 4.0.0
|
| 260 |
* @category constructors
|
|
|
|
| 261 |
*/
|
| 262 |
export declare const empty: Effect.Effect<Service>;
|
| 263 |
/**
|
| 264 |
* Creates a new Chat service from an initial prompt.
|
| 265 |
*
|
|
|
|
|
|
|
| 266 |
* This is the primary constructor for creating chat instances. It initializes
|
| 267 |
* a new conversation with the provided prompt as the starting context.
|
| 268 |
*
|
| 269 |
-
*
|
|
|
|
| 270 |
* ```ts
|
| 271 |
* import { Effect } from "effect"
|
| 272 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -285,7 +326,8 @@ export declare const empty: Effect.Effect<Service>;
|
|
| 285 |
* })
|
| 286 |
* ```
|
| 287 |
*
|
| 288 |
-
*
|
|
|
|
| 289 |
* ```ts
|
| 290 |
* import { Effect } from "effect"
|
| 291 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -315,54 +357,70 @@ export declare const empty: Effect.Effect<Service>;
|
|
| 315 |
* })
|
| 316 |
* ```
|
| 317 |
*
|
| 318 |
-
* @since 4.0.0
|
| 319 |
* @category constructors
|
|
|
|
| 320 |
*/
|
| 321 |
export declare const fromPrompt: (prompt: Prompt.RawInput) => Effect.Effect<Service, never, never>;
|
| 322 |
/**
|
| 323 |
* Creates a Chat service from previously exported chat data.
|
| 324 |
*
|
|
|
|
|
|
|
| 325 |
* Restores a chat session from structured data that was previously exported
|
| 326 |
* using the `export` method. Useful for persisting and restoring conversation
|
| 327 |
* state.
|
| 328 |
*
|
| 329 |
-
*
|
|
|
|
| 330 |
* ```ts
|
| 331 |
-
* import { Effect } from "effect"
|
| 332 |
* import { Chat } from "effect/unstable/ai"
|
| 333 |
*
|
| 334 |
-
* declare const loadFromDatabase: (sessionId: string) => Effect.Effect<unknown>
|
| 335 |
-
*
|
| 336 |
* const restoreChat = Effect.gen(function*() {
|
| 337 |
-
*
|
| 338 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
*
|
| 340 |
-
* const
|
|
|
|
|
|
|
| 341 |
*
|
| 342 |
-
*
|
| 343 |
-
*
|
| 344 |
-
*
|
| 345 |
-
*
|
| 346 |
-
*
|
| 347 |
-
*
|
| 348 |
-
*
|
| 349 |
-
*
|
| 350 |
-
*
|
| 351 |
-
*
|
|
|
|
|
|
|
| 352 |
* ```
|
| 353 |
*
|
| 354 |
-
* @since 4.0.0
|
| 355 |
* @category constructors
|
|
|
|
| 356 |
*/
|
| 357 |
export declare const fromExport: (data: unknown) => Effect.Effect<Service, Schema.SchemaError>;
|
| 358 |
/**
|
| 359 |
* Creates a Chat service from previously exported JSON chat data.
|
| 360 |
*
|
|
|
|
|
|
|
| 361 |
* Restores a chat session from JSON string that was previously exported
|
| 362 |
* using the `exportJson` method. This is the most convenient way to
|
| 363 |
* persist and restore chat sessions to/from storage systems.
|
| 364 |
*
|
| 365 |
-
*
|
|
|
|
| 366 |
* ```ts
|
| 367 |
* import { Effect } from "effect"
|
| 368 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -388,8 +446,8 @@ export declare const fromExport: (data: unknown) => Effect.Effect<Service, Schem
|
|
| 388 |
* )
|
| 389 |
* ```
|
| 390 |
*
|
| 391 |
-
* @since 4.0.0
|
| 392 |
* @category constructors
|
|
|
|
| 393 |
*/
|
| 394 |
export declare const fromJson: (data: string) => Effect.Effect<Service, Schema.SchemaError>;
|
| 395 |
declare const ChatNotFoundError_base: Schema.Class<ChatNotFoundError, Schema.Struct<{
|
|
@@ -397,34 +455,45 @@ declare const ChatNotFoundError_base: Schema.Class<ChatNotFoundError, Schema.Str
|
|
| 397 |
readonly chatId: Schema.String;
|
| 398 |
}>, import("../../Cause.ts").YieldableError>;
|
| 399 |
/**
|
| 400 |
-
*
|
| 401 |
* does not exist in the backing persistence store.
|
| 402 |
*
|
| 403 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
* @category errors
|
|
|
|
| 405 |
*/
|
| 406 |
export declare class ChatNotFoundError extends ChatNotFoundError_base {
|
| 407 |
}
|
| 408 |
declare const Persistence_base: Context.ServiceClass<Persistence, "effect/ai/Chat/Persisted", Persistence.Service>;
|
| 409 |
/**
|
| 410 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
*
|
| 412 |
-
* @since 4.0.0
|
| 413 |
* @category services
|
|
|
|
| 414 |
*/
|
| 415 |
export declare class Persistence extends Persistence_base {
|
| 416 |
}
|
| 417 |
/**
|
|
|
|
|
|
|
| 418 |
* @since 4.0.0
|
| 419 |
-
* @category models
|
| 420 |
*/
|
| 421 |
export declare namespace Persistence {
|
| 422 |
/**
|
| 423 |
* Represents the backing persistence for a persisted `Chat`. Allows for
|
| 424 |
* creating and retrieving chats that have been saved to a persistence store.
|
| 425 |
*
|
| 426 |
-
* @since 4.0.0
|
| 427 |
* @category models
|
|
|
|
| 428 |
*/
|
| 429 |
interface Service {
|
| 430 |
/**
|
|
@@ -449,12 +518,14 @@ export declare namespace Persistence {
|
|
| 449 |
/**
|
| 450 |
* Represents a `Chat` that is backed by persistence.
|
| 451 |
*
|
|
|
|
|
|
|
| 452 |
* When calling a text generation method (e.g. `generateText`), the previous
|
| 453 |
* chat history as well as the relevent response parts will be saved to the
|
| 454 |
* backing persistence store.
|
| 455 |
*
|
| 456 |
-
* @since 4.0.0
|
| 457 |
* @category models
|
|
|
|
| 458 |
*/
|
| 459 |
export interface Persisted extends Service {
|
| 460 |
/**
|
|
@@ -469,23 +540,41 @@ export interface Persisted extends Service {
|
|
| 469 |
/**
|
| 470 |
* Creates a new chat persistence service.
|
| 471 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
* The provided store identifier will be used to indicate which "store" the
|
| 473 |
* backing persistence should load chats from.
|
| 474 |
*
|
| 475 |
-
* @
|
|
|
|
| 476 |
* @category constructors
|
|
|
|
| 477 |
*/
|
| 478 |
export declare const makePersisted: (options: {
|
| 479 |
readonly storeId: string;
|
| 480 |
}) => Effect.Effect<Persistence.Service, never, import("../../Scope.ts").Scope | BackingPersistence>;
|
| 481 |
/**
|
| 482 |
-
* Creates a `Layer` new chat persistence service.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
*
|
| 484 |
* The provided store identifier will be used to indicate which "store" the
|
| 485 |
* backing persistence should load chats from.
|
| 486 |
*
|
| 487 |
-
* @
|
|
|
|
| 488 |
* @category constructors
|
|
|
|
| 489 |
*/
|
| 490 |
export declare const layerPersisted: (options: {
|
| 491 |
readonly storeId: string;
|
|
|
|
| 15 |
import type * as Tool from "./Tool.ts";
|
| 16 |
declare const Chat_base: Context.ServiceClass<Chat, "effect/ai/Chat", Service>;
|
| 17 |
/**
|
| 18 |
+
* Service tag for stateful AI conversation sessions.
|
| 19 |
+
*
|
| 20 |
+
* **When to use**
|
| 21 |
+
*
|
| 22 |
+
* Use to access or provide conversational AI sessions through the Effect
|
| 23 |
+
* context.
|
| 24 |
+
*
|
| 25 |
+
* **Details**
|
| 26 |
*
|
| 27 |
* This tag provides access to chat functionality throughout your application,
|
| 28 |
* enabling persistent conversational AI interactions with full context
|
| 29 |
* management.
|
| 30 |
*
|
| 31 |
+
* **Example** (Using the Chat service)
|
| 32 |
+
*
|
| 33 |
* ```ts
|
| 34 |
* import { Effect } from "effect"
|
| 35 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 43 |
* })
|
| 44 |
* ```
|
| 45 |
*
|
|
|
|
| 46 |
* @category services
|
| 47 |
+
* @since 4.0.0
|
| 48 |
*/
|
| 49 |
export declare class Chat extends Chat_base {
|
| 50 |
}
|
| 51 |
/**
|
| 52 |
* Represents the interface that the `Chat` service provides.
|
| 53 |
*
|
| 54 |
+
* **When to use**
|
| 55 |
+
*
|
| 56 |
+
* Use as the service contract for code that receives or constructs a stateful
|
| 57 |
+
* chat session and needs history, export, text generation, streaming, and
|
| 58 |
+
* structured-output operations.
|
| 59 |
+
*
|
| 60 |
+
* @see {@link Chat} for the context tag that provides this service
|
| 61 |
+
* @see {@link Persisted} for the persistence-backed extension
|
| 62 |
+
*
|
| 63 |
* @category models
|
| 64 |
+
* @since 4.0.0
|
| 65 |
*/
|
| 66 |
export interface Service {
|
| 67 |
/**
|
| 68 |
* Reference to the chat history.
|
| 69 |
*
|
| 70 |
+
* **Details**
|
| 71 |
+
*
|
| 72 |
* Provides direct access to the conversation history for advanced use cases
|
| 73 |
* like custom history manipulation or inspection.
|
| 74 |
*
|
| 75 |
+
* **Example** (Inspecting chat history)
|
| 76 |
+
*
|
| 77 |
* ```ts
|
| 78 |
* import { Effect, Ref } from "effect"
|
| 79 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 90 |
/**
|
| 91 |
* Exports the chat history into a structured format.
|
| 92 |
*
|
| 93 |
+
* **Details**
|
| 94 |
+
*
|
| 95 |
* Returns the complete conversation history as a structured object
|
| 96 |
* that can be stored, transmitted, or processed by other systems.
|
| 97 |
*
|
| 98 |
+
* **Example** (Exporting chat history)
|
| 99 |
+
*
|
| 100 |
* ```ts
|
| 101 |
* import { Effect } from "effect"
|
| 102 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 116 |
/**
|
| 117 |
* Exports the chat history as a JSON string.
|
| 118 |
*
|
| 119 |
+
* **Details**
|
| 120 |
+
*
|
| 121 |
* Provides a convenient way to serialize the entire conversation
|
| 122 |
* for storage or transmission in JSON format.
|
| 123 |
*
|
| 124 |
+
* **Example** (Exporting chat history as JSON)
|
| 125 |
+
*
|
| 126 |
* ```ts
|
| 127 |
* import { Effect } from "effect"
|
| 128 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 144 |
/**
|
| 145 |
* Generate text using a language model for the specified prompt.
|
| 146 |
*
|
| 147 |
+
* **Details**
|
| 148 |
+
*
|
| 149 |
* If a toolkit is specified, the language model will have access to tools
|
| 150 |
* for function calling and enhanced capabilities. Both input and output
|
| 151 |
* messages are automatically added to the chat history.
|
| 152 |
*
|
| 153 |
+
* **Example** (Generating chat responses)
|
| 154 |
+
*
|
| 155 |
* ```ts
|
| 156 |
* import { Effect } from "effect"
|
| 157 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 189 |
/**
|
| 190 |
* Generate text using a language model with streaming output.
|
| 191 |
*
|
| 192 |
+
* **Details**
|
| 193 |
+
*
|
| 194 |
* Returns a stream of response parts that are emitted as soon as they're
|
| 195 |
* available from the model. Supports tool calling and maintains chat history.
|
| 196 |
*
|
| 197 |
+
* **Example** (Streaming chat responses)
|
| 198 |
+
*
|
| 199 |
* ```ts
|
| 200 |
* import { Effect, Stream } from "effect"
|
| 201 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 232 |
/**
|
| 233 |
* Generate a structured object using a language model and schema.
|
| 234 |
*
|
| 235 |
+
* **Details**
|
| 236 |
+
*
|
| 237 |
* Forces the model to return data that conforms to the specified schema,
|
| 238 |
* enabling structured data extraction and type-safe responses. The
|
| 239 |
* conversation history is maintained across calls.
|
| 240 |
*
|
| 241 |
+
* **Example** (Generating structured objects)
|
| 242 |
+
*
|
| 243 |
* ```ts
|
| 244 |
* import { Effect, Schema } from "effect"
|
| 245 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 270 |
/**
|
| 271 |
* Creates a new Chat service with empty conversation history.
|
| 272 |
*
|
| 273 |
+
* **When to use**
|
| 274 |
+
*
|
| 275 |
+
* Use when you need to start a fresh chat session without initial context or
|
| 276 |
+
* system prompts.
|
| 277 |
+
*
|
| 278 |
+
* **Example** (Creating an empty chat)
|
| 279 |
*
|
|
|
|
| 280 |
* ```ts
|
| 281 |
* import { Effect } from "effect"
|
| 282 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 294 |
* })
|
| 295 |
* ```
|
| 296 |
*
|
|
|
|
| 297 |
* @category constructors
|
| 298 |
+
* @since 4.0.0
|
| 299 |
*/
|
| 300 |
export declare const empty: Effect.Effect<Service>;
|
| 301 |
/**
|
| 302 |
* Creates a new Chat service from an initial prompt.
|
| 303 |
*
|
| 304 |
+
* **Details**
|
| 305 |
+
*
|
| 306 |
* This is the primary constructor for creating chat instances. It initializes
|
| 307 |
* a new conversation with the provided prompt as the starting context.
|
| 308 |
*
|
| 309 |
+
* **Example** (Creating a chat from a system prompt)
|
| 310 |
+
*
|
| 311 |
* ```ts
|
| 312 |
* import { Effect } from "effect"
|
| 313 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 326 |
* })
|
| 327 |
* ```
|
| 328 |
*
|
| 329 |
+
* **Example** (Restoring chat history from a prompt)
|
| 330 |
+
*
|
| 331 |
* ```ts
|
| 332 |
* import { Effect } from "effect"
|
| 333 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 357 |
* })
|
| 358 |
* ```
|
| 359 |
*
|
|
|
|
| 360 |
* @category constructors
|
| 361 |
+
* @since 4.0.0
|
| 362 |
*/
|
| 363 |
export declare const fromPrompt: (prompt: Prompt.RawInput) => Effect.Effect<Service, never, never>;
|
| 364 |
/**
|
| 365 |
* Creates a Chat service from previously exported chat data.
|
| 366 |
*
|
| 367 |
+
* **Details**
|
| 368 |
+
*
|
| 369 |
* Restores a chat session from structured data that was previously exported
|
| 370 |
* using the `export` method. Useful for persisting and restoring conversation
|
| 371 |
* state.
|
| 372 |
*
|
| 373 |
+
* **Example** (Restoring chat data)
|
| 374 |
+
*
|
| 375 |
* ```ts
|
| 376 |
+
* import { Effect, Ref } from "effect"
|
| 377 |
* import { Chat } from "effect/unstable/ai"
|
| 378 |
*
|
|
|
|
|
|
|
| 379 |
* const restoreChat = Effect.gen(function*() {
|
| 380 |
+
* const originalChat = yield* Chat.fromPrompt([
|
| 381 |
+
* {
|
| 382 |
+
* role: "user",
|
| 383 |
+
* content: "Which library are we using?"
|
| 384 |
+
* },
|
| 385 |
+
* {
|
| 386 |
+
* role: "assistant",
|
| 387 |
+
* content: "The project uses Effect."
|
| 388 |
+
* }
|
| 389 |
+
* ])
|
| 390 |
*
|
| 391 |
+
* const exported = yield* originalChat.export
|
| 392 |
+
* const restoredChat = yield* Chat.fromExport(exported)
|
| 393 |
+
* const restoredHistory = yield* Ref.get(restoredChat.history)
|
| 394 |
*
|
| 395 |
+
* console.log(restoredHistory.content.map((message) => message.role))
|
| 396 |
+
* // ["user", "assistant"]
|
| 397 |
+
*
|
| 398 |
+
* const restoredResponse = restoredHistory.content[1]
|
| 399 |
+
* if (restoredResponse?.role === "assistant") {
|
| 400 |
+
* const restoredText = restoredResponse.content[0]
|
| 401 |
+
* if (restoredText?.type === "text") {
|
| 402 |
+
* console.log(restoredText.text)
|
| 403 |
+
* // "The project uses Effect."
|
| 404 |
+
* }
|
| 405 |
+
* }
|
| 406 |
+
* })
|
| 407 |
* ```
|
| 408 |
*
|
|
|
|
| 409 |
* @category constructors
|
| 410 |
+
* @since 4.0.0
|
| 411 |
*/
|
| 412 |
export declare const fromExport: (data: unknown) => Effect.Effect<Service, Schema.SchemaError>;
|
| 413 |
/**
|
| 414 |
* Creates a Chat service from previously exported JSON chat data.
|
| 415 |
*
|
| 416 |
+
* **Details**
|
| 417 |
+
*
|
| 418 |
* Restores a chat session from JSON string that was previously exported
|
| 419 |
* using the `exportJson` method. This is the most convenient way to
|
| 420 |
* persist and restore chat sessions to/from storage systems.
|
| 421 |
*
|
| 422 |
+
* **Example** (Restoring chat history from JSON)
|
| 423 |
+
*
|
| 424 |
* ```ts
|
| 425 |
* import { Effect } from "effect"
|
| 426 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 446 |
* )
|
| 447 |
* ```
|
| 448 |
*
|
|
|
|
| 449 |
* @category constructors
|
| 450 |
+
* @since 4.0.0
|
| 451 |
*/
|
| 452 |
export declare const fromJson: (data: string) => Effect.Effect<Service, Schema.SchemaError>;
|
| 453 |
declare const ChatNotFoundError_base: Schema.Class<ChatNotFoundError, Schema.Struct<{
|
|
|
|
| 455 |
readonly chatId: Schema.String;
|
| 456 |
}>, import("../../Cause.ts").YieldableError>;
|
| 457 |
/**
|
| 458 |
+
* Represents an error that occurs when attempting to retrieve a persisted `Chat` that
|
| 459 |
* does not exist in the backing persistence store.
|
| 460 |
*
|
| 461 |
+
* **When to use**
|
| 462 |
+
*
|
| 463 |
+
* Use to represent a missing persisted conversation when lookup by id cannot
|
| 464 |
+
* find stored history.
|
| 465 |
+
*
|
| 466 |
* @category errors
|
| 467 |
+
* @since 4.0.0
|
| 468 |
*/
|
| 469 |
export declare class ChatNotFoundError extends ChatNotFoundError_base {
|
| 470 |
}
|
| 471 |
declare const Persistence_base: Context.ServiceClass<Persistence, "effect/ai/Chat/Persisted", Persistence.Service>;
|
| 472 |
/**
|
| 473 |
+
* Service tag for persistence-backed AI conversation storage.
|
| 474 |
+
*
|
| 475 |
+
* **When to use**
|
| 476 |
+
*
|
| 477 |
+
* Use to provide the storage operations needed by persisted conversation
|
| 478 |
+
* sessions.
|
| 479 |
*
|
|
|
|
| 480 |
* @category services
|
| 481 |
+
* @since 4.0.0
|
| 482 |
*/
|
| 483 |
export declare class Persistence extends Persistence_base {
|
| 484 |
}
|
| 485 |
/**
|
| 486 |
+
* Namespace containing the service contract for chat persistence.
|
| 487 |
+
*
|
| 488 |
* @since 4.0.0
|
|
|
|
| 489 |
*/
|
| 490 |
export declare namespace Persistence {
|
| 491 |
/**
|
| 492 |
* Represents the backing persistence for a persisted `Chat`. Allows for
|
| 493 |
* creating and retrieving chats that have been saved to a persistence store.
|
| 494 |
*
|
|
|
|
| 495 |
* @category models
|
| 496 |
+
* @since 4.0.0
|
| 497 |
*/
|
| 498 |
interface Service {
|
| 499 |
/**
|
|
|
|
| 518 |
/**
|
| 519 |
* Represents a `Chat` that is backed by persistence.
|
| 520 |
*
|
| 521 |
+
* **Details**
|
| 522 |
+
*
|
| 523 |
* When calling a text generation method (e.g. `generateText`), the previous
|
| 524 |
* chat history as well as the relevent response parts will be saved to the
|
| 525 |
* backing persistence store.
|
| 526 |
*
|
|
|
|
| 527 |
* @category models
|
| 528 |
+
* @since 4.0.0
|
| 529 |
*/
|
| 530 |
export interface Persisted extends Service {
|
| 531 |
/**
|
|
|
|
| 540 |
/**
|
| 541 |
* Creates a new chat persistence service.
|
| 542 |
*
|
| 543 |
+
* **When to use**
|
| 544 |
+
*
|
| 545 |
+
* Use when you need programmatic persisted chat creation and retrieval backed
|
| 546 |
+
* by the current `BackingPersistence`.
|
| 547 |
+
*
|
| 548 |
+
* **Details**
|
| 549 |
+
*
|
| 550 |
* The provided store identifier will be used to indicate which "store" the
|
| 551 |
* backing persistence should load chats from.
|
| 552 |
*
|
| 553 |
+
* @see {@link layerPersisted} for the `Layer`-based constructor
|
| 554 |
+
*
|
| 555 |
* @category constructors
|
| 556 |
+
* @since 4.0.0
|
| 557 |
*/
|
| 558 |
export declare const makePersisted: (options: {
|
| 559 |
readonly storeId: string;
|
| 560 |
}) => Effect.Effect<Persistence.Service, never, import("../../Scope.ts").Scope | BackingPersistence>;
|
| 561 |
/**
|
| 562 |
+
* Creates a `Layer` for a new chat persistence service.
|
| 563 |
+
*
|
| 564 |
+
* **When to use**
|
| 565 |
+
*
|
| 566 |
+
* Use to provide `Chat.Persistence` from a configured `BackingPersistence` when
|
| 567 |
+
* your application needs persisted chat sessions backed by a named store.
|
| 568 |
+
*
|
| 569 |
+
* **Details**
|
| 570 |
*
|
| 571 |
* The provided store identifier will be used to indicate which "store" the
|
| 572 |
* backing persistence should load chats from.
|
| 573 |
*
|
| 574 |
+
* @see {@link makePersisted} for the effect constructor when building the service directly instead of providing it as a layer
|
| 575 |
+
*
|
| 576 |
* @category constructors
|
| 577 |
+
* @since 4.0.0
|
| 578 |
*/
|
| 579 |
export declare const layerPersisted: (options: {
|
| 580 |
readonly storeId: string;
|
.opencode/node_modules/effect/dist/unstable/ai/Chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/Chat.ts"],"names":[],"mappings":"
|
|
|
|
| 1 |
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/Chat.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAA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MAAM,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAAC,CAAA;QAEpE;;;;;WAKG;QACH,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;YAC/C,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;SACjD,KAAK,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,GAAG,gBAAgB,CAAC,CAAA;KACnE;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAU,SAAQ,OAAO;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,GAAG,gBAAgB,CAAC,CAAA;CACvE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa;sBACN,MAAM;oGA6IxB,CAAA;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,kBAAkB,CAAsD,CAAA"}
|
.opencode/node_modules/effect/dist/unstable/ai/Chat.js
CHANGED
|
@@ -1,46 +1,12 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* models.
|
| 4 |
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
* ```ts
|
| 12 |
-
* import { Effect } from "effect"
|
| 13 |
-
* import { Chat } from "effect/unstable/ai"
|
| 14 |
-
*
|
| 15 |
-
* // Create a new chat session
|
| 16 |
-
* const program = Effect.gen(function*() {
|
| 17 |
-
* const chat = yield* Chat.empty
|
| 18 |
-
*
|
| 19 |
-
* // Send a message and get response
|
| 20 |
-
* const response = yield* chat.generateText({
|
| 21 |
-
* prompt: "Hello! What can you help me with?"
|
| 22 |
-
* })
|
| 23 |
-
*
|
| 24 |
-
* console.log(response.content)
|
| 25 |
-
*
|
| 26 |
-
* return response
|
| 27 |
-
* })
|
| 28 |
-
* ```
|
| 29 |
-
*
|
| 30 |
-
* @example
|
| 31 |
-
* ```ts
|
| 32 |
-
* import { Effect, Stream } from "effect"
|
| 33 |
-
* import { Chat } from "effect/unstable/ai"
|
| 34 |
-
*
|
| 35 |
-
* // Streaming chat with tool support
|
| 36 |
-
* const streamingChat = Effect.gen(function*() {
|
| 37 |
-
* const chat = yield* Chat.empty
|
| 38 |
-
*
|
| 39 |
-
* yield* chat.streamText({
|
| 40 |
-
* prompt: "Generate a creative story"
|
| 41 |
-
* }).pipe(Stream.runForEach((part) => Effect.sync(() => console.log(part))))
|
| 42 |
-
* })
|
| 43 |
-
* ```
|
| 44 |
*
|
| 45 |
* @since 4.0.0
|
| 46 |
*/
|
|
@@ -62,13 +28,21 @@ import * as IdGenerator from "./IdGenerator.js";
|
|
| 62 |
import * as LanguageModel from "./LanguageModel.js";
|
| 63 |
import * as Prompt from "./Prompt.js";
|
| 64 |
/**
|
| 65 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
*
|
| 67 |
* This tag provides access to chat functionality throughout your application,
|
| 68 |
* enabling persistent conversational AI interactions with full context
|
| 69 |
* management.
|
| 70 |
*
|
| 71 |
-
*
|
|
|
|
| 72 |
* ```ts
|
| 73 |
* import { Effect } from "effect"
|
| 74 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -82,8 +56,8 @@ import * as Prompt from "./Prompt.js";
|
|
| 82 |
* })
|
| 83 |
* ```
|
| 84 |
*
|
| 85 |
-
* @since 4.0.0
|
| 86 |
* @category services
|
|
|
|
| 87 |
*/
|
| 88 |
export class Chat extends /*#__PURE__*/Context.Service()("effect/ai/Chat") {}
|
| 89 |
const decodeHistory = /*#__PURE__*/Schema.decodeUnknownEffect(Prompt.Prompt);
|
|
@@ -155,10 +129,13 @@ const makeUnsafe = history => {
|
|
| 155 |
/**
|
| 156 |
* Creates a new Chat service with empty conversation history.
|
| 157 |
*
|
| 158 |
-
*
|
| 159 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
*
|
| 161 |
-
* @example
|
| 162 |
* ```ts
|
| 163 |
* import { Effect } from "effect"
|
| 164 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -176,17 +153,20 @@ const makeUnsafe = history => {
|
|
| 176 |
* })
|
| 177 |
* ```
|
| 178 |
*
|
| 179 |
-
* @since 4.0.0
|
| 180 |
* @category constructors
|
|
|
|
| 181 |
*/
|
| 182 |
export const empty = /*#__PURE__*/Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Prompt.empty)));
|
| 183 |
/**
|
| 184 |
* Creates a new Chat service from an initial prompt.
|
| 185 |
*
|
|
|
|
|
|
|
| 186 |
* This is the primary constructor for creating chat instances. It initializes
|
| 187 |
* a new conversation with the provided prompt as the starting context.
|
| 188 |
*
|
| 189 |
-
*
|
|
|
|
| 190 |
* ```ts
|
| 191 |
* import { Effect } from "effect"
|
| 192 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -205,7 +185,8 @@ export const empty = /*#__PURE__*/Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Pr
|
|
| 205 |
* })
|
| 206 |
* ```
|
| 207 |
*
|
| 208 |
-
*
|
|
|
|
| 209 |
* ```ts
|
| 210 |
* import { Effect } from "effect"
|
| 211 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -235,54 +216,70 @@ export const empty = /*#__PURE__*/Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Pr
|
|
| 235 |
* })
|
| 236 |
* ```
|
| 237 |
*
|
| 238 |
-
* @since 4.0.0
|
| 239 |
* @category constructors
|
|
|
|
| 240 |
*/
|
| 241 |
export const fromPrompt = prompt => Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Prompt.make(prompt))));
|
| 242 |
/**
|
| 243 |
* Creates a Chat service from previously exported chat data.
|
| 244 |
*
|
|
|
|
|
|
|
| 245 |
* Restores a chat session from structured data that was previously exported
|
| 246 |
* using the `export` method. Useful for persisting and restoring conversation
|
| 247 |
* state.
|
| 248 |
*
|
| 249 |
-
*
|
|
|
|
| 250 |
* ```ts
|
| 251 |
-
* import { Effect } from "effect"
|
| 252 |
* import { Chat } from "effect/unstable/ai"
|
| 253 |
*
|
| 254 |
-
* declare const loadFromDatabase: (sessionId: string) => Effect.Effect<unknown>
|
| 255 |
-
*
|
| 256 |
* const restoreChat = Effect.gen(function*() {
|
| 257 |
-
*
|
| 258 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
*
|
| 260 |
-
* const
|
|
|
|
|
|
|
| 261 |
*
|
| 262 |
-
*
|
| 263 |
-
*
|
| 264 |
-
*
|
| 265 |
-
*
|
| 266 |
-
*
|
| 267 |
-
*
|
| 268 |
-
*
|
| 269 |
-
*
|
| 270 |
-
*
|
| 271 |
-
*
|
|
|
|
|
|
|
| 272 |
* ```
|
| 273 |
*
|
| 274 |
-
* @since 4.0.0
|
| 275 |
* @category constructors
|
|
|
|
| 276 |
*/
|
| 277 |
export const fromExport = data => Effect.flatMap(decodeHistory(data), fromPrompt);
|
| 278 |
/**
|
| 279 |
* Creates a Chat service from previously exported JSON chat data.
|
| 280 |
*
|
|
|
|
|
|
|
| 281 |
* Restores a chat session from JSON string that was previously exported
|
| 282 |
* using the `exportJson` method. This is the most convenient way to
|
| 283 |
* persist and restore chat sessions to/from storage systems.
|
| 284 |
*
|
| 285 |
-
*
|
|
|
|
| 286 |
* ```ts
|
| 287 |
* import { Effect } from "effect"
|
| 288 |
* import { Chat } from "effect/unstable/ai"
|
|
@@ -308,40 +305,59 @@ export const fromExport = data => Effect.flatMap(decodeHistory(data), fromPrompt
|
|
| 308 |
* )
|
| 309 |
* ```
|
| 310 |
*
|
| 311 |
-
* @since 4.0.0
|
| 312 |
* @category constructors
|
|
|
|
| 313 |
*/
|
| 314 |
export const fromJson = data => Effect.flatMap(decodeHistoryJson(data), fromPrompt);
|
| 315 |
// =============================================================================
|
| 316 |
// Chat Persistence
|
| 317 |
// =============================================================================
|
| 318 |
/**
|
| 319 |
-
*
|
| 320 |
* does not exist in the backing persistence store.
|
| 321 |
*
|
| 322 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
* @category errors
|
|
|
|
| 324 |
*/
|
| 325 |
export class ChatNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Chat/ChatNotFoundError")({
|
| 326 |
_tag: /*#__PURE__*/Schema.tag("ChatNotFoundError"),
|
| 327 |
chatId: Schema.String
|
| 328 |
}) {}
|
| 329 |
/**
|
| 330 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
*
|
| 332 |
-
* @since 4.0.0
|
| 333 |
* @category services
|
|
|
|
| 334 |
*/
|
| 335 |
// @effect-diagnostics effect/leakingRequirements:off
|
| 336 |
export class Persistence extends /*#__PURE__*/Context.Service()("effect/ai/Chat/Persisted") {}
|
| 337 |
/**
|
| 338 |
* Creates a new chat persistence service.
|
| 339 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
* The provided store identifier will be used to indicate which "store" the
|
| 341 |
* backing persistence should load chats from.
|
| 342 |
*
|
| 343 |
-
* @
|
|
|
|
| 344 |
* @category constructors
|
|
|
|
| 345 |
*/
|
| 346 |
export const makePersisted = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
| 347 |
const persistence = yield* BackingPersistence;
|
|
@@ -445,13 +461,22 @@ export const makePersisted = /*#__PURE__*/Effect.fnUntraced(function* (options)
|
|
| 445 |
});
|
| 446 |
});
|
| 447 |
/**
|
| 448 |
-
* Creates a `Layer` new chat persistence service.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
*
|
| 450 |
* The provided store identifier will be used to indicate which "store" the
|
| 451 |
* backing persistence should load chats from.
|
| 452 |
*
|
| 453 |
-
* @
|
|
|
|
| 454 |
* @category constructors
|
|
|
|
| 455 |
*/
|
| 456 |
export const layerPersisted = options => Layer.effect(Persistence)(makePersisted(options));
|
| 457 |
//# sourceMappingURL=Chat.js.map
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Stateful conversation sessions on top of a language model.
|
|
|
|
| 3 |
*
|
| 4 |
+
* A `Chat` keeps `Prompt` history in a `Ref` and reuses it for text generation,
|
| 5 |
+
* streaming, and structured output. Each generation call combines the current
|
| 6 |
+
* history with the caller's new prompt, invokes the active language model, and
|
| 7 |
+
* appends the response parts back into history. Constructors create fresh
|
| 8 |
+
* sessions, seed sessions from prompts, restore exported history, or connect a
|
| 9 |
+
* chat to persistence.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
*
|
| 11 |
* @since 4.0.0
|
| 12 |
*/
|
|
|
|
| 28 |
import * as LanguageModel from "./LanguageModel.js";
|
| 29 |
import * as Prompt from "./Prompt.js";
|
| 30 |
/**
|
| 31 |
+
* Service tag for stateful AI conversation sessions.
|
| 32 |
+
*
|
| 33 |
+
* **When to use**
|
| 34 |
+
*
|
| 35 |
+
* Use to access or provide conversational AI sessions through the Effect
|
| 36 |
+
* context.
|
| 37 |
+
*
|
| 38 |
+
* **Details**
|
| 39 |
*
|
| 40 |
* This tag provides access to chat functionality throughout your application,
|
| 41 |
* enabling persistent conversational AI interactions with full context
|
| 42 |
* management.
|
| 43 |
*
|
| 44 |
+
* **Example** (Using the Chat service)
|
| 45 |
+
*
|
| 46 |
* ```ts
|
| 47 |
* import { Effect } from "effect"
|
| 48 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 56 |
* })
|
| 57 |
* ```
|
| 58 |
*
|
|
|
|
| 59 |
* @category services
|
| 60 |
+
* @since 4.0.0
|
| 61 |
*/
|
| 62 |
export class Chat extends /*#__PURE__*/Context.Service()("effect/ai/Chat") {}
|
| 63 |
const decodeHistory = /*#__PURE__*/Schema.decodeUnknownEffect(Prompt.Prompt);
|
|
|
|
| 129 |
/**
|
| 130 |
* Creates a new Chat service with empty conversation history.
|
| 131 |
*
|
| 132 |
+
* **When to use**
|
| 133 |
+
*
|
| 134 |
+
* Use when you need to start a fresh chat session without initial context or
|
| 135 |
+
* system prompts.
|
| 136 |
+
*
|
| 137 |
+
* **Example** (Creating an empty chat)
|
| 138 |
*
|
|
|
|
| 139 |
* ```ts
|
| 140 |
* import { Effect } from "effect"
|
| 141 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 153 |
* })
|
| 154 |
* ```
|
| 155 |
*
|
|
|
|
| 156 |
* @category constructors
|
| 157 |
+
* @since 4.0.0
|
| 158 |
*/
|
| 159 |
export const empty = /*#__PURE__*/Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Prompt.empty)));
|
| 160 |
/**
|
| 161 |
* Creates a new Chat service from an initial prompt.
|
| 162 |
*
|
| 163 |
+
* **Details**
|
| 164 |
+
*
|
| 165 |
* This is the primary constructor for creating chat instances. It initializes
|
| 166 |
* a new conversation with the provided prompt as the starting context.
|
| 167 |
*
|
| 168 |
+
* **Example** (Creating a chat from a system prompt)
|
| 169 |
+
*
|
| 170 |
* ```ts
|
| 171 |
* import { Effect } from "effect"
|
| 172 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 185 |
* })
|
| 186 |
* ```
|
| 187 |
*
|
| 188 |
+
* **Example** (Restoring chat history from a prompt)
|
| 189 |
+
*
|
| 190 |
* ```ts
|
| 191 |
* import { Effect } from "effect"
|
| 192 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 216 |
* })
|
| 217 |
* ```
|
| 218 |
*
|
|
|
|
| 219 |
* @category constructors
|
| 220 |
+
* @since 4.0.0
|
| 221 |
*/
|
| 222 |
export const fromPrompt = prompt => Effect.sync(() => makeUnsafe(Ref.makeUnsafe(Prompt.make(prompt))));
|
| 223 |
/**
|
| 224 |
* Creates a Chat service from previously exported chat data.
|
| 225 |
*
|
| 226 |
+
* **Details**
|
| 227 |
+
*
|
| 228 |
* Restores a chat session from structured data that was previously exported
|
| 229 |
* using the `export` method. Useful for persisting and restoring conversation
|
| 230 |
* state.
|
| 231 |
*
|
| 232 |
+
* **Example** (Restoring chat data)
|
| 233 |
+
*
|
| 234 |
* ```ts
|
| 235 |
+
* import { Effect, Ref } from "effect"
|
| 236 |
* import { Chat } from "effect/unstable/ai"
|
| 237 |
*
|
|
|
|
|
|
|
| 238 |
* const restoreChat = Effect.gen(function*() {
|
| 239 |
+
* const originalChat = yield* Chat.fromPrompt([
|
| 240 |
+
* {
|
| 241 |
+
* role: "user",
|
| 242 |
+
* content: "Which library are we using?"
|
| 243 |
+
* },
|
| 244 |
+
* {
|
| 245 |
+
* role: "assistant",
|
| 246 |
+
* content: "The project uses Effect."
|
| 247 |
+
* }
|
| 248 |
+
* ])
|
| 249 |
*
|
| 250 |
+
* const exported = yield* originalChat.export
|
| 251 |
+
* const restoredChat = yield* Chat.fromExport(exported)
|
| 252 |
+
* const restoredHistory = yield* Ref.get(restoredChat.history)
|
| 253 |
*
|
| 254 |
+
* console.log(restoredHistory.content.map((message) => message.role))
|
| 255 |
+
* // ["user", "assistant"]
|
| 256 |
+
*
|
| 257 |
+
* const restoredResponse = restoredHistory.content[1]
|
| 258 |
+
* if (restoredResponse?.role === "assistant") {
|
| 259 |
+
* const restoredText = restoredResponse.content[0]
|
| 260 |
+
* if (restoredText?.type === "text") {
|
| 261 |
+
* console.log(restoredText.text)
|
| 262 |
+
* // "The project uses Effect."
|
| 263 |
+
* }
|
| 264 |
+
* }
|
| 265 |
+
* })
|
| 266 |
* ```
|
| 267 |
*
|
|
|
|
| 268 |
* @category constructors
|
| 269 |
+
* @since 4.0.0
|
| 270 |
*/
|
| 271 |
export const fromExport = data => Effect.flatMap(decodeHistory(data), fromPrompt);
|
| 272 |
/**
|
| 273 |
* Creates a Chat service from previously exported JSON chat data.
|
| 274 |
*
|
| 275 |
+
* **Details**
|
| 276 |
+
*
|
| 277 |
* Restores a chat session from JSON string that was previously exported
|
| 278 |
* using the `exportJson` method. This is the most convenient way to
|
| 279 |
* persist and restore chat sessions to/from storage systems.
|
| 280 |
*
|
| 281 |
+
* **Example** (Restoring chat history from JSON)
|
| 282 |
+
*
|
| 283 |
* ```ts
|
| 284 |
* import { Effect } from "effect"
|
| 285 |
* import { Chat } from "effect/unstable/ai"
|
|
|
|
| 305 |
* )
|
| 306 |
* ```
|
| 307 |
*
|
|
|
|
| 308 |
* @category constructors
|
| 309 |
+
* @since 4.0.0
|
| 310 |
*/
|
| 311 |
export const fromJson = data => Effect.flatMap(decodeHistoryJson(data), fromPrompt);
|
| 312 |
// =============================================================================
|
| 313 |
// Chat Persistence
|
| 314 |
// =============================================================================
|
| 315 |
/**
|
| 316 |
+
* Represents an error that occurs when attempting to retrieve a persisted `Chat` that
|
| 317 |
* does not exist in the backing persistence store.
|
| 318 |
*
|
| 319 |
+
* **When to use**
|
| 320 |
+
*
|
| 321 |
+
* Use to represent a missing persisted conversation when lookup by id cannot
|
| 322 |
+
* find stored history.
|
| 323 |
+
*
|
| 324 |
* @category errors
|
| 325 |
+
* @since 4.0.0
|
| 326 |
*/
|
| 327 |
export class ChatNotFoundError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Chat/ChatNotFoundError")({
|
| 328 |
_tag: /*#__PURE__*/Schema.tag("ChatNotFoundError"),
|
| 329 |
chatId: Schema.String
|
| 330 |
}) {}
|
| 331 |
/**
|
| 332 |
+
* Service tag for persistence-backed AI conversation storage.
|
| 333 |
+
*
|
| 334 |
+
* **When to use**
|
| 335 |
+
*
|
| 336 |
+
* Use to provide the storage operations needed by persisted conversation
|
| 337 |
+
* sessions.
|
| 338 |
*
|
|
|
|
| 339 |
* @category services
|
| 340 |
+
* @since 4.0.0
|
| 341 |
*/
|
| 342 |
// @effect-diagnostics effect/leakingRequirements:off
|
| 343 |
export class Persistence extends /*#__PURE__*/Context.Service()("effect/ai/Chat/Persisted") {}
|
| 344 |
/**
|
| 345 |
* Creates a new chat persistence service.
|
| 346 |
*
|
| 347 |
+
* **When to use**
|
| 348 |
+
*
|
| 349 |
+
* Use when you need programmatic persisted chat creation and retrieval backed
|
| 350 |
+
* by the current `BackingPersistence`.
|
| 351 |
+
*
|
| 352 |
+
* **Details**
|
| 353 |
+
*
|
| 354 |
* The provided store identifier will be used to indicate which "store" the
|
| 355 |
* backing persistence should load chats from.
|
| 356 |
*
|
| 357 |
+
* @see {@link layerPersisted} for the `Layer`-based constructor
|
| 358 |
+
*
|
| 359 |
* @category constructors
|
| 360 |
+
* @since 4.0.0
|
| 361 |
*/
|
| 362 |
export const makePersisted = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
| 363 |
const persistence = yield* BackingPersistence;
|
|
|
|
| 461 |
});
|
| 462 |
});
|
| 463 |
/**
|
| 464 |
+
* Creates a `Layer` for a new chat persistence service.
|
| 465 |
+
*
|
| 466 |
+
* **When to use**
|
| 467 |
+
*
|
| 468 |
+
* Use to provide `Chat.Persistence` from a configured `BackingPersistence` when
|
| 469 |
+
* your application needs persisted chat sessions backed by a named store.
|
| 470 |
+
*
|
| 471 |
+
* **Details**
|
| 472 |
*
|
| 473 |
* The provided store identifier will be used to indicate which "store" the
|
| 474 |
* backing persistence should load chats from.
|
| 475 |
*
|
| 476 |
+
* @see {@link makePersisted} for the effect constructor when building the service directly instead of providing it as a layer
|
| 477 |
+
*
|
| 478 |
* @category constructors
|
| 479 |
+
* @since 4.0.0
|
| 480 |
*/
|
| 481 |
export const layerPersisted = options => Layer.effect(Persistence)(makePersisted(options));
|
| 482 |
//# sourceMappingURL=Chat.js.map
|
.opencode/node_modules/effect/dist/unstable/ai/Chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"Chat.js","names":["Channel","Chunk","Context","Duration","Effect","Layer","Option","Predicate","Ref","Schema","Semaphore","Stream","BackingPersistence","AiError","IdGenerator","LanguageModel","Prompt","Chat","Service","decodeHistory","decodeUnknownEffect","encodeHistory","encodeUnknownEffect","decodeHistoryJson","fromJsonString","encodeHistoryJson","makeUnsafe","history","semaphore","of","export","get","pipe","flatMap","catchTag","error","fail","make","module","method","reason","InvalidOutputError","fromSchemaError","withSpan","exportJson","generateText","fnUntraced","options","newPrompt","prompt","oldPrompt","concat","response","newHistory","fromResponseParts","content","set","withPermits","effect","captureStackTrace","streamText","parts","empty","fromChannel","acquireUseRelease","take","map","mapArray","chunk","appendAll","fromArrayUnsafe","toChannel","andThen","Array","from","release","unwrap","generateObject","attributes","objectName","getObjectName","schema","sync","fromPrompt","fromExport","data","fromJson","ChatNotFoundError","ErrorClass","_tag","tag","chatId","String","Persistence","makePersisted","persistence","store","storeId","toPersisted","chat","ttl","idGenerator","serviceOption","getOrElse","defaultIdGenerator","saveChat","prevHistory","lastMessage","length","messageId","undefined","isNotUndefined","role","key","isUndefined","generateId","i","message","exported","orDie","timeToLive","getOrUndefined","fromInput","persisted","id","save","ensuring","stream","createChat","getChat","previousHistory","die","getOrCreate","layerPersisted"],"sources":["../../../src/unstable/ai/Chat.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,Q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ACrD5B,MAAM,CAAC8B,QAAQ,CAAC,mBAAmB,EAAE,MAAM8F,UAAU,CAACrC,MAAM,EAAE5C,OAAO,EAAEyE,UAAU,CAAC,CAAC,CACpF;EACH,CAAC,EACA9D,MAAM,IACLtD,MAAM,CAACuC,QAAQ,CAACe,MAAM,EAAE,2BAA2B,EAAE;IACnDC,iBAAiB,EAAE;GACpB,CAAC,CACL;EAED,OAAOkC,WAAW,CAAChE,EAAE,CAAC;IACpBE,GAAG;IACHqG;GACD,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;AASA,OAAO,MAAMC,cAAc,GAAItF,OAE9B,IAA0D1C,KAAK,CAACqD,MAAM,CAACmC,WAAW,CAAC,CAACC,aAAa,CAAC/C,OAAO,CAAC,CAAC","ignoreList":[]}
|
|
|
|
| 1 |
+
{"version":3,"file":"Chat.js","names":["Channel","Chunk","Context","Duration","Effect","Layer","Option","Predicate","Ref","Schema","Semaphore","Stream","BackingPersistence","AiError","IdGenerator","LanguageModel","Prompt","Chat","Service","decodeHistory","decodeUnknownEffect","encodeHistory","encodeUnknownEffect","decodeHistoryJson","fromJsonString","encodeHistoryJson","makeUnsafe","history","semaphore","of","export","get","pipe","flatMap","catchTag","error","fail","make","module","method","reason","InvalidOutputError","fromSchemaError","withSpan","exportJson","generateText","fnUntraced","options","newPrompt","prompt","oldPrompt","concat","response","newHistory","fromResponseParts","content","set","withPermits","effect","captureStackTrace","streamText","parts","empty","fromChannel","acquireUseRelease","take","map","mapArray","chunk","appendAll","fromArrayUnsafe","toChannel","andThen","Array","from","release","unwrap","generateObject","attributes","objectName","getObjectName","schema","sync","fromPrompt","fromExport","data","fromJson","ChatNotFoundError","ErrorClass","_tag","tag","chatId","String","Persistence","makePersisted","persistence","store","storeId","toPersisted","chat","ttl","idGenerator","serviceOption","getOrElse","defaultIdGenerator","saveChat","prevHistory","lastMessage","length","messageId","undefined","isNotUndefined","role","key","isUndefined","generateId","i","message","exported","orDie","timeToLive","getOrUndefined","fromInput","persisted","id","save","ensuring","stream","createChat","getChat","previousHistory","die","getOrCreate","layerPersisted"],"sources":["../../../src/unstable/ai/Chat.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,QAAQ,MAAM,mBAAmB;AAC7C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,GAAG,MAAM,cAAc;AACnC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAGzC,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAC/C,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,MAAM,MAAM,aAAa;AAIrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,OAAM,MAAOC,IAAK,sBAAQf,OAAO,CAACgB,OAAO,EAAiB,CACxD,gBAAgB,CACjB;AAyRD,MAAMC,aAAa,gBAAGV,MAAM,CAACW,mBAAmB,CAACJ,MAAM,CAACA,MAAM,CAAC;AAC/D,MAAMK,aAAa,gBAAGZ,MAAM,CAACa,mBAAmB,CAACN,MAAM,CAACA,MAAM,CAAC;AAC/D,MAAMO,iBAAiB,gBAAGd,MAAM,CAACW,mBAAmB,cAACX,MAAM,CAACe,cAAc,CAACR,MAAM,CAACA,MAAM,CAAC,CAAC;AAC1F,MAAMS,iBAAiB,gBAAGhB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EAAE5C,OAAO,EAAEyE,UAAU,CAAC;EACpD,CAAC,EACA9D,MAAM,IACLtD,MAAM,CAACuC,QAAQ,CAACe,MAAM,EAAE,mBAAmB,EAAE;IAC3CC,iBAAiB,EAAE;GACpB,CAAC,CACL;EAED,MAAMyE,WAAW,GAAGhI,MAAM,CAAC0C,UAAU,CACnC,WAAU6C,MAAc,EAAE5C,OAEzB;IACC,OAAO,OAAOkF,OAAO,CAACtC,MAAM,EAAE5C,OAAO,EAAEyE,UAAU,CAAC,CAACxF,IAAI,CACrD5B,MAAM,CAAC8B,QAAQ,CAAC,mBAAmB,EAAE,MAAM8F,UAAU,CAACrC,MAAM,EAAE5C,OAAO,EAAEyE,UAAU,CAAC,CAAC,CACpF;EACH,CAAC,EACA9D,MAAM,IACLtD,MAAM,CAACuC,QAAQ,CAACe,MAAM,EAAE,2BAA2B,EAAE;IACnDC,iBAAiB,EAAE;GACpB,CAAC,CACL;EAED,OAAOkC,WAAW,CAAChE,EAAE,CAAC;IACpBE,GAAG;IACHqG;GACD,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;AAkBA,OAAO,MAAMC,cAAc,GAAItF,OAE9B,IAA0D1C,KAAK,CAACqD,MAAM,CAACmC,WAAW,CAAC,CAACC,aAAa,CAAC/C,OAAO,CAAC,CAAC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
*
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
* const model = yield* EmbeddingModel.EmbeddingModel
|
| 11 |
-
* return yield* model.embed("hello world")
|
| 12 |
-
* })
|
| 13 |
-
* ```
|
| 14 |
*
|
| 15 |
* @since 4.0.0
|
| 16 |
*/
|
|
@@ -24,8 +20,17 @@ declare const EmbeddingModel_base: Context.ServiceClass<EmbeddingModel, "effect/
|
|
| 24 |
/**
|
| 25 |
* Service tag for embedding model operations.
|
| 26 |
*
|
| 27 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
* @category services
|
|
|
|
| 29 |
*/
|
| 30 |
export declare class EmbeddingModel extends EmbeddingModel_base {
|
| 31 |
}
|
|
@@ -33,8 +38,15 @@ declare const Dimensions_base: Context.ServiceClass<Dimensions, "effect/unstable
|
|
| 33 |
/**
|
| 34 |
* Service tag that provides the current embedding dimensions.
|
| 35 |
*
|
| 36 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
* @category services
|
|
|
|
| 38 |
*/
|
| 39 |
export declare class Dimensions extends Dimensions_base {
|
| 40 |
}
|
|
@@ -42,10 +54,16 @@ declare const EmbeddingUsage_base: Schema.Class<EmbeddingUsage, Schema.Struct<{
|
|
| 42 |
readonly inputTokens: Schema.UndefinedOr<Schema.Finite>;
|
| 43 |
}>, {}>;
|
| 44 |
/**
|
| 45 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
*
|
| 47 |
-
* @since 4.0.0
|
| 48 |
* @category models
|
|
|
|
| 49 |
*/
|
| 50 |
export declare class EmbeddingUsage extends EmbeddingUsage_base {
|
| 51 |
}
|
|
@@ -55,8 +73,8 @@ declare const EmbedResponse_base: Schema.Class<EmbedResponse, Schema.Struct<{
|
|
| 55 |
/**
|
| 56 |
* Response for a single embedding request.
|
| 57 |
*
|
| 58 |
-
* @since 4.0.0
|
| 59 |
* @category models
|
|
|
|
| 60 |
*/
|
| 61 |
export declare class EmbedResponse extends EmbedResponse_base {
|
| 62 |
}
|
|
@@ -65,18 +83,27 @@ declare const EmbedManyResponse_base: Schema.Class<EmbedManyResponse, Schema.Str
|
|
| 65 |
readonly usage: typeof EmbeddingUsage;
|
| 66 |
}>, {}>;
|
| 67 |
/**
|
| 68 |
-
* Response for
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
*
|
| 70 |
-
* @since 4.0.0
|
| 71 |
* @category models
|
|
|
|
| 72 |
*/
|
| 73 |
export declare class EmbedManyResponse extends EmbedManyResponse_base {
|
| 74 |
}
|
| 75 |
/**
|
| 76 |
* Provider input options for embedding requests.
|
| 77 |
*
|
|
|
|
| 78 |
* @since 4.0.0
|
| 79 |
-
* @category models
|
| 80 |
*/
|
| 81 |
export interface ProviderOptions {
|
| 82 |
readonly inputs: ReadonlyArray<string>;
|
|
@@ -84,8 +111,8 @@ export interface ProviderOptions {
|
|
| 84 |
/**
|
| 85 |
* Provider response for batch embedding requests.
|
| 86 |
*
|
| 87 |
-
* @since 4.0.0
|
| 88 |
* @category models
|
|
|
|
| 89 |
*/
|
| 90 |
export interface ProviderResponse {
|
| 91 |
readonly results: Array<Array<number>>;
|
|
@@ -97,20 +124,29 @@ declare const EmbeddingRequest_base: new <A extends Record<string, any>, Success
|
|
| 97 |
readonly _tag: "EmbeddingRequest";
|
| 98 |
};
|
| 99 |
/**
|
| 100 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
*
|
| 102 |
-
* @since 4.0.0
|
| 103 |
* @category constructors
|
|
|
|
| 104 |
*/
|
| 105 |
export declare class EmbeddingRequest extends EmbeddingRequest_base<{
|
| 106 |
readonly input: string;
|
| 107 |
}, EmbedResponse, AiError.AiError> {
|
| 108 |
}
|
| 109 |
/**
|
| 110 |
-
*
|
| 111 |
*
|
| 112 |
-
* @since 4.0.0
|
| 113 |
* @category models
|
|
|
|
| 114 |
*/
|
| 115 |
export interface Service {
|
| 116 |
readonly resolver: RequestResolver.RequestResolver<EmbeddingRequest>;
|
|
@@ -120,8 +156,32 @@ export interface Service {
|
|
| 120 |
/**
|
| 121 |
* Creates an EmbeddingModel service from a provider embedMany implementation.
|
| 122 |
*
|
| 123 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
* @category constructors
|
|
|
|
| 125 |
*/
|
| 126 |
export declare const make: (params: {
|
| 127 |
readonly embedMany: (options: ProviderOptions) => Effect.Effect<ProviderResponse, AiError.AiError>;
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines the provider-neutral service for text embeddings.
|
| 3 |
*
|
| 4 |
+
* An `EmbeddingModel` turns text into numeric vectors. It supports single-input
|
| 5 |
+
* embedding and ordered batch embedding, and represents provider failures as
|
| 6 |
+
* `AiError` values. This module also includes the embedding dimensions service,
|
| 7 |
+
* request and response models, usage metadata, provider contracts, and a
|
| 8 |
+
* constructor that adapts a provider batch implementation into the service.
|
| 9 |
+
* Single `embed` calls can be batched together internally.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
*
|
| 11 |
* @since 4.0.0
|
| 12 |
*/
|
|
|
|
| 20 |
/**
|
| 21 |
* Service tag for embedding model operations.
|
| 22 |
*
|
| 23 |
+
* **When to use**
|
| 24 |
+
*
|
| 25 |
+
* Use to retrieve or provide the embedding model service for an `Effect`
|
| 26 |
+
* program that embeds text into vectors.
|
| 27 |
+
*
|
| 28 |
+
* @see {@link Service} for the service contract provided by this tag
|
| 29 |
+
* @see {@link make} for constructing an embedding model service from a provider
|
| 30 |
+
* @see {@link Dimensions} for the current embedding vector size service
|
| 31 |
+
*
|
| 32 |
* @category services
|
| 33 |
+
* @since 4.0.0
|
| 34 |
*/
|
| 35 |
export declare class EmbeddingModel extends EmbeddingModel_base {
|
| 36 |
}
|
|
|
|
| 38 |
/**
|
| 39 |
* Service tag that provides the current embedding dimensions.
|
| 40 |
*
|
| 41 |
+
* **When to use**
|
| 42 |
+
*
|
| 43 |
+
* Use to retrieve or provide the configured embedding vector size through
|
| 44 |
+
* context.
|
| 45 |
+
*
|
| 46 |
+
* @see {@link EmbeddingModel} for the embedding service that uses these dimensions
|
| 47 |
+
*
|
| 48 |
* @category services
|
| 49 |
+
* @since 4.0.0
|
| 50 |
*/
|
| 51 |
export declare class Dimensions extends Dimensions_base {
|
| 52 |
}
|
|
|
|
| 54 |
readonly inputTokens: Schema.UndefinedOr<Schema.Finite>;
|
| 55 |
}>, {}>;
|
| 56 |
/**
|
| 57 |
+
* Represents token usage metadata for embedding operations.
|
| 58 |
+
*
|
| 59 |
+
* **Details**
|
| 60 |
+
*
|
| 61 |
+
* Contains optional provider-reported `inputTokens`. The value may be
|
| 62 |
+
* `undefined` when the provider does not report usage or when `embedMany([])`
|
| 63 |
+
* bypasses the provider.
|
| 64 |
*
|
|
|
|
| 65 |
* @category models
|
| 66 |
+
* @since 4.0.0
|
| 67 |
*/
|
| 68 |
export declare class EmbeddingUsage extends EmbeddingUsage_base {
|
| 69 |
}
|
|
|
|
| 73 |
/**
|
| 74 |
* Response for a single embedding request.
|
| 75 |
*
|
|
|
|
| 76 |
* @category models
|
| 77 |
+
* @since 4.0.0
|
| 78 |
*/
|
| 79 |
export declare class EmbedResponse extends EmbedResponse_base {
|
| 80 |
}
|
|
|
|
| 83 |
readonly usage: typeof EmbeddingUsage;
|
| 84 |
}>, {}>;
|
| 85 |
/**
|
| 86 |
+
* Response for batch embedding requests containing per-input embeddings and usage
|
| 87 |
+
* metadata.
|
| 88 |
+
*
|
| 89 |
+
* **Details**
|
| 90 |
+
*
|
| 91 |
+
* `embeddings` preserves batch order, and `usage` carries token metadata for
|
| 92 |
+
* the operation.
|
| 93 |
+
*
|
| 94 |
+
* @see {@link EmbedResponse} for individual embedding responses
|
| 95 |
+
* @see {@link EmbeddingUsage} for token usage metadata
|
| 96 |
*
|
|
|
|
| 97 |
* @category models
|
| 98 |
+
* @since 4.0.0
|
| 99 |
*/
|
| 100 |
export declare class EmbedManyResponse extends EmbedManyResponse_base {
|
| 101 |
}
|
| 102 |
/**
|
| 103 |
* Provider input options for embedding requests.
|
| 104 |
*
|
| 105 |
+
* @category options
|
| 106 |
* @since 4.0.0
|
|
|
|
| 107 |
*/
|
| 108 |
export interface ProviderOptions {
|
| 109 |
readonly inputs: ReadonlyArray<string>;
|
|
|
|
| 111 |
/**
|
| 112 |
* Provider response for batch embedding requests.
|
| 113 |
*
|
|
|
|
| 114 |
* @category models
|
| 115 |
+
* @since 4.0.0
|
| 116 |
*/
|
| 117 |
export interface ProviderResponse {
|
| 118 |
readonly results: Array<Array<number>>;
|
|
|
|
| 124 |
readonly _tag: "EmbeddingRequest";
|
| 125 |
};
|
| 126 |
/**
|
| 127 |
+
* Represents a tagged request used by request resolvers for embedding operations.
|
| 128 |
+
*
|
| 129 |
+
* **When to use**
|
| 130 |
+
*
|
| 131 |
+
* Use when you need a typed request for one embedding input while building or
|
| 132 |
+
* calling a low-level embedding request resolver.
|
| 133 |
+
*
|
| 134 |
+
* @see {@link Service} for the resolver-bearing service contract
|
| 135 |
+
* @see {@link make} for constructing the request resolver from a provider implementation
|
| 136 |
+
* @see {@link EmbedResponse} for the response produced by this request
|
| 137 |
*
|
|
|
|
| 138 |
* @category constructors
|
| 139 |
+
* @since 4.0.0
|
| 140 |
*/
|
| 141 |
export declare class EmbeddingRequest extends EmbeddingRequest_base<{
|
| 142 |
readonly input: string;
|
| 143 |
}, EmbedResponse, AiError.AiError> {
|
| 144 |
}
|
| 145 |
/**
|
| 146 |
+
* Defines the service interface for embedding operations.
|
| 147 |
*
|
|
|
|
| 148 |
* @category models
|
| 149 |
+
* @since 4.0.0
|
| 150 |
*/
|
| 151 |
export interface Service {
|
| 152 |
readonly resolver: RequestResolver.RequestResolver<EmbeddingRequest>;
|
|
|
|
| 156 |
/**
|
| 157 |
* Creates an EmbeddingModel service from a provider embedMany implementation.
|
| 158 |
*
|
| 159 |
+
* **When to use**
|
| 160 |
+
*
|
| 161 |
+
* Use to adapt a provider's batch embedding implementation into an
|
| 162 |
+
* `EmbeddingModel.Service` that offers single-input and batch embedding
|
| 163 |
+
* operations.
|
| 164 |
+
*
|
| 165 |
+
* **Details**
|
| 166 |
+
*
|
| 167 |
+
* The returned service builds single-input `embed` calls through a request
|
| 168 |
+
* resolver, so concurrent `embed` requests can be batched into one provider
|
| 169 |
+
* `embedMany` call. Direct `embedMany` calls pass the input array to the
|
| 170 |
+
* provider, while `embedMany([])` returns an empty response without calling the
|
| 171 |
+
* provider.
|
| 172 |
+
*
|
| 173 |
+
* **Gotchas**
|
| 174 |
+
*
|
| 175 |
+
* Provider responses are interpreted positionally and must contain exactly one
|
| 176 |
+
* result for each requested input. If the provider returns a different number
|
| 177 |
+
* of results, `embed` and `embedMany` fail with `AiError.InvalidOutputError`.
|
| 178 |
+
*
|
| 179 |
+
* @see {@link Service} for the service shape returned by this constructor
|
| 180 |
+
* @see {@link ProviderOptions} for the input passed to the provider implementation
|
| 181 |
+
* @see {@link ProviderResponse} for the provider response contract consumed by this constructor
|
| 182 |
+
*
|
| 183 |
* @category constructors
|
| 184 |
+
* @since 4.0.0
|
| 185 |
*/
|
| 186 |
export declare const make: (params: {
|
| 187 |
readonly embedMany: (options: ProviderOptions) => Effect.Effect<ProviderResponse, AiError.AiError>;
|
.opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"EmbeddingModel.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/EmbeddingModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"EmbeddingModel.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/EmbeddingModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAEzC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AA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AS,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CACxG;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,MAAM,EAAE;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CACnG,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CA8CzB,CAAA"}
|
.opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
*
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
* const model = yield* EmbeddingModel.EmbeddingModel
|
| 11 |
-
* return yield* model.embed("hello world")
|
| 12 |
-
* })
|
| 13 |
-
* ```
|
| 14 |
*
|
| 15 |
* @since 4.0.0
|
| 16 |
*/
|
|
@@ -24,22 +20,44 @@ import * as AiError from "./AiError.js";
|
|
| 24 |
/**
|
| 25 |
* Service tag for embedding model operations.
|
| 26 |
*
|
| 27 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
* @category services
|
|
|
|
| 29 |
*/
|
| 30 |
export class EmbeddingModel extends /*#__PURE__*/Context.Service()("effect/unstable/ai/EmbeddingModel") {}
|
| 31 |
/**
|
| 32 |
* Service tag that provides the current embedding dimensions.
|
| 33 |
*
|
| 34 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
* @category services
|
|
|
|
| 36 |
*/
|
| 37 |
export class Dimensions extends /*#__PURE__*/Context.Service()("effect/unstable/ai/EmbeddingModel/Dimensions") {}
|
| 38 |
/**
|
| 39 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
*
|
| 41 |
-
* @since 4.0.0
|
| 42 |
* @category models
|
|
|
|
| 43 |
*/
|
| 44 |
export class EmbeddingUsage extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbeddingUsage")({
|
| 45 |
inputTokens: /*#__PURE__*/Schema.UndefinedOr(Schema.Finite)
|
|
@@ -47,27 +65,45 @@ export class EmbeddingUsage extends /*#__PURE__*/Schema.Class("effect/ai/Embeddi
|
|
| 47 |
/**
|
| 48 |
* Response for a single embedding request.
|
| 49 |
*
|
| 50 |
-
* @since 4.0.0
|
| 51 |
* @category models
|
|
|
|
| 52 |
*/
|
| 53 |
export class EmbedResponse extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbedResponse")({
|
| 54 |
vector: /*#__PURE__*/Schema.Array(Schema.Finite)
|
| 55 |
}) {}
|
| 56 |
/**
|
| 57 |
-
* Response for
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
*
|
| 59 |
-
* @since 4.0.0
|
| 60 |
* @category models
|
|
|
|
| 61 |
*/
|
| 62 |
export class EmbedManyResponse extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbedManyResponse")({
|
| 63 |
embeddings: /*#__PURE__*/Schema.Array(EmbedResponse),
|
| 64 |
usage: EmbeddingUsage
|
| 65 |
}) {}
|
| 66 |
/**
|
| 67 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
*
|
| 69 |
-
* @since 4.0.0
|
| 70 |
* @category constructors
|
|
|
|
| 71 |
*/
|
| 72 |
export class EmbeddingRequest extends /*#__PURE__*/Request.TaggedClass("EmbeddingRequest") {}
|
| 73 |
const invalidProviderResponse = description => AiError.make({
|
|
@@ -80,8 +116,32 @@ const invalidProviderResponse = description => AiError.make({
|
|
| 80 |
/**
|
| 81 |
* Creates an EmbeddingModel service from a provider embedMany implementation.
|
| 82 |
*
|
| 83 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
* @category constructors
|
|
|
|
| 85 |
*/
|
| 86 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
| 87 |
const resolver = RequestResolver.make(entries => Effect.flatMap(params.embedMany({
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines the provider-neutral service for text embeddings.
|
| 3 |
*
|
| 4 |
+
* An `EmbeddingModel` turns text into numeric vectors. It supports single-input
|
| 5 |
+
* embedding and ordered batch embedding, and represents provider failures as
|
| 6 |
+
* `AiError` values. This module also includes the embedding dimensions service,
|
| 7 |
+
* request and response models, usage metadata, provider contracts, and a
|
| 8 |
+
* constructor that adapts a provider batch implementation into the service.
|
| 9 |
+
* Single `embed` calls can be batched together internally.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
*
|
| 11 |
* @since 4.0.0
|
| 12 |
*/
|
|
|
|
| 20 |
/**
|
| 21 |
* Service tag for embedding model operations.
|
| 22 |
*
|
| 23 |
+
* **When to use**
|
| 24 |
+
*
|
| 25 |
+
* Use to retrieve or provide the embedding model service for an `Effect`
|
| 26 |
+
* program that embeds text into vectors.
|
| 27 |
+
*
|
| 28 |
+
* @see {@link Service} for the service contract provided by this tag
|
| 29 |
+
* @see {@link make} for constructing an embedding model service from a provider
|
| 30 |
+
* @see {@link Dimensions} for the current embedding vector size service
|
| 31 |
+
*
|
| 32 |
* @category services
|
| 33 |
+
* @since 4.0.0
|
| 34 |
*/
|
| 35 |
export class EmbeddingModel extends /*#__PURE__*/Context.Service()("effect/unstable/ai/EmbeddingModel") {}
|
| 36 |
/**
|
| 37 |
* Service tag that provides the current embedding dimensions.
|
| 38 |
*
|
| 39 |
+
* **When to use**
|
| 40 |
+
*
|
| 41 |
+
* Use to retrieve or provide the configured embedding vector size through
|
| 42 |
+
* context.
|
| 43 |
+
*
|
| 44 |
+
* @see {@link EmbeddingModel} for the embedding service that uses these dimensions
|
| 45 |
+
*
|
| 46 |
* @category services
|
| 47 |
+
* @since 4.0.0
|
| 48 |
*/
|
| 49 |
export class Dimensions extends /*#__PURE__*/Context.Service()("effect/unstable/ai/EmbeddingModel/Dimensions") {}
|
| 50 |
/**
|
| 51 |
+
* Represents token usage metadata for embedding operations.
|
| 52 |
+
*
|
| 53 |
+
* **Details**
|
| 54 |
+
*
|
| 55 |
+
* Contains optional provider-reported `inputTokens`. The value may be
|
| 56 |
+
* `undefined` when the provider does not report usage or when `embedMany([])`
|
| 57 |
+
* bypasses the provider.
|
| 58 |
*
|
|
|
|
| 59 |
* @category models
|
| 60 |
+
* @since 4.0.0
|
| 61 |
*/
|
| 62 |
export class EmbeddingUsage extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbeddingUsage")({
|
| 63 |
inputTokens: /*#__PURE__*/Schema.UndefinedOr(Schema.Finite)
|
|
|
|
| 65 |
/**
|
| 66 |
* Response for a single embedding request.
|
| 67 |
*
|
|
|
|
| 68 |
* @category models
|
| 69 |
+
* @since 4.0.0
|
| 70 |
*/
|
| 71 |
export class EmbedResponse extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbedResponse")({
|
| 72 |
vector: /*#__PURE__*/Schema.Array(Schema.Finite)
|
| 73 |
}) {}
|
| 74 |
/**
|
| 75 |
+
* Response for batch embedding requests containing per-input embeddings and usage
|
| 76 |
+
* metadata.
|
| 77 |
+
*
|
| 78 |
+
* **Details**
|
| 79 |
+
*
|
| 80 |
+
* `embeddings` preserves batch order, and `usage` carries token metadata for
|
| 81 |
+
* the operation.
|
| 82 |
+
*
|
| 83 |
+
* @see {@link EmbedResponse} for individual embedding responses
|
| 84 |
+
* @see {@link EmbeddingUsage} for token usage metadata
|
| 85 |
*
|
|
|
|
| 86 |
* @category models
|
| 87 |
+
* @since 4.0.0
|
| 88 |
*/
|
| 89 |
export class EmbedManyResponse extends /*#__PURE__*/Schema.Class("effect/ai/EmbeddingModel/EmbedManyResponse")({
|
| 90 |
embeddings: /*#__PURE__*/Schema.Array(EmbedResponse),
|
| 91 |
usage: EmbeddingUsage
|
| 92 |
}) {}
|
| 93 |
/**
|
| 94 |
+
* Represents a tagged request used by request resolvers for embedding operations.
|
| 95 |
+
*
|
| 96 |
+
* **When to use**
|
| 97 |
+
*
|
| 98 |
+
* Use when you need a typed request for one embedding input while building or
|
| 99 |
+
* calling a low-level embedding request resolver.
|
| 100 |
+
*
|
| 101 |
+
* @see {@link Service} for the resolver-bearing service contract
|
| 102 |
+
* @see {@link make} for constructing the request resolver from a provider implementation
|
| 103 |
+
* @see {@link EmbedResponse} for the response produced by this request
|
| 104 |
*
|
|
|
|
| 105 |
* @category constructors
|
| 106 |
+
* @since 4.0.0
|
| 107 |
*/
|
| 108 |
export class EmbeddingRequest extends /*#__PURE__*/Request.TaggedClass("EmbeddingRequest") {}
|
| 109 |
const invalidProviderResponse = description => AiError.make({
|
|
|
|
| 116 |
/**
|
| 117 |
* Creates an EmbeddingModel service from a provider embedMany implementation.
|
| 118 |
*
|
| 119 |
+
* **When to use**
|
| 120 |
+
*
|
| 121 |
+
* Use to adapt a provider's batch embedding implementation into an
|
| 122 |
+
* `EmbeddingModel.Service` that offers single-input and batch embedding
|
| 123 |
+
* operations.
|
| 124 |
+
*
|
| 125 |
+
* **Details**
|
| 126 |
+
*
|
| 127 |
+
* The returned service builds single-input `embed` calls through a request
|
| 128 |
+
* resolver, so concurrent `embed` requests can be batched into one provider
|
| 129 |
+
* `embedMany` call. Direct `embedMany` calls pass the input array to the
|
| 130 |
+
* provider, while `embedMany([])` returns an empty response without calling the
|
| 131 |
+
* provider.
|
| 132 |
+
*
|
| 133 |
+
* **Gotchas**
|
| 134 |
+
*
|
| 135 |
+
* Provider responses are interpreted positionally and must contain exactly one
|
| 136 |
+
* result for each requested input. If the provider returns a different number
|
| 137 |
+
* of results, `embed` and `embedMany` fail with `AiError.InvalidOutputError`.
|
| 138 |
+
*
|
| 139 |
+
* @see {@link Service} for the service shape returned by this constructor
|
| 140 |
+
* @see {@link ProviderOptions} for the input passed to the provider implementation
|
| 141 |
+
* @see {@link ProviderResponse} for the provider response contract consumed by this constructor
|
| 142 |
+
*
|
| 143 |
* @category constructors
|
| 144 |
+
* @since 4.0.0
|
| 145 |
*/
|
| 146 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
| 147 |
const resolver = RequestResolver.make(entries => Effect.flatMap(params.embedMany({
|
.opencode/node_modules/effect/dist/unstable/ai/EmbeddingModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"EmbeddingModel.js","names":["Context","Effect","Exit","Request","RequestResolver","Schema","AiError","EmbeddingModel","Service","Dimensions","EmbeddingUsage","Class","inputTokens","UndefinedOr","Finite","EmbedResponse","vector","Array","EmbedManyResponse","embeddings","usage","EmbeddingRequest","TaggedClass","invalidProviderResponse","description","make","module","method","reason","InvalidOutputError","fnUntraced","params","resolver","entries","flatMap","embedMany","inputs","map","entry","request","input","response","mapProviderResults","length","results","i","completeUnsafe","succeed","pipe","withSpan","of","embed","undefined","inputLength","fail"],"sources":["../../../src/unstable/ai/EmbeddingModel.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"EmbeddingModel.js","names":["Context","Effect","Exit","Request","RequestResolver","Schema","AiError","EmbeddingModel","Service","Dimensions","EmbeddingUsage","Class","inputTokens","UndefinedOr","Finite","EmbedResponse","vector","Array","EmbedManyResponse","embeddings","usage","EmbeddingRequest","TaggedClass","invalidProviderResponse","description","make","module","method","reason","InvalidOutputError","fnUntraced","params","resolver","entries","flatMap","embedMany","inputs","map","entry","request","input","response","mapProviderResults","length","results","i","completeUnsafe","succeed","pipe","withSpan","of","embed","undefined","inputLength","fail"],"sources":["../../../src/unstable/ai/EmbeddingModel.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,IAAI,MAAM,eAAe;AACrC,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,eAAe,MAAM,0BAA0B;AAC3D,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;AAeA,OAAM,MAAOC,cAAe,sBAAQP,OAAO,CAACQ,OAAO,EAA2B,CAC5E,mCAAmC,CACpC;AAED;;;;;;;;;;;;;AAaA,OAAM,MAAOC,UAAW,sBAAQT,OAAO,CAACQ,OAAO,EAAsB,CACnE,8CAA8C,CAC/C;AAED;;;;;;;;;;;;AAYA,OAAM,MAAOE,cAAe,sBAAQL,MAAM,CAACM,KAAK,CAC9C,yCAAyC,CAC1C,CAAC;EACAC,WAAW,eAAEP,MAAM,CAACQ,WAAW,CAACR,MAAM,CAACS,MAAM;CAC9C,CAAC;AAEF;;;;;;AAMA,OAAM,MAAOC,aAAc,sBAAQV,MAAM,CAACM,KAAK,CAC7C,wCAAwC,CACzC,CAAC;EACAK,MAAM,eAAEX,MAAM,CAACY,KAAK,CAACZ,MAAM,CAACS,MAAM;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;AAeA,OAAM,MAAOI,iBAAkB,sBAAQb,MAAM,CAACM,KAAK,CACjD,4CAA4C,CAC7C,CAAC;EACAQ,UAAU,eAAEd,MAAM,CAACY,KAAK,CAACF,aAAa,CAAC;EACvCK,KAAK,EAAEV;CACR,CAAC;AAyBF;;;;;;;;;;;;;;;AAeA,O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,EAAE;IACvC,MAAM7B,MAAM,GAAG4B,OAAO,CAACC,CAAC,CAAC;IACzB1B,UAAU,CAAC0B,CAAC,CAAC,GAAG,IAAI9B,aAAa,CAAC;MAAEC;IAAM,CAAE,CAAC;EAC/C;EACA,OAAOf,MAAM,CAAC8C,OAAO,CAAC5B,UAAU,CAAC;AACnC,CAAC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/IdGenerator.d.ts
CHANGED
|
@@ -1,47 +1,11 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* for tool calls and other items in the Effect AI SDKs.
|
| 4 |
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
* import { Effect } from "effect"
|
| 11 |
-
* import { IdGenerator } from "effect/unstable/ai"
|
| 12 |
-
*
|
| 13 |
-
* // Using the default ID generator
|
| 14 |
-
* const program = Effect.gen(function*() {
|
| 15 |
-
* const idGen = yield* IdGenerator.IdGenerator
|
| 16 |
-
* const toolCallId = yield* idGen.generateId()
|
| 17 |
-
* console.log(toolCallId) // "id_A7xK9mP2qR5tY8uV"
|
| 18 |
-
* return toolCallId
|
| 19 |
-
* }).pipe(Effect.provideService(
|
| 20 |
-
* IdGenerator.IdGenerator,
|
| 21 |
-
* IdGenerator.defaultIdGenerator
|
| 22 |
-
* ))
|
| 23 |
-
* ```
|
| 24 |
-
*
|
| 25 |
-
* @example
|
| 26 |
-
* ```ts
|
| 27 |
-
* import { Effect } from "effect"
|
| 28 |
-
* import { IdGenerator } from "effect/unstable/ai"
|
| 29 |
-
*
|
| 30 |
-
* // Creating a custom ID generator for AI tool calls
|
| 31 |
-
* const customLayer = IdGenerator.layer({
|
| 32 |
-
* alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
|
| 33 |
-
* prefix: "tool_call",
|
| 34 |
-
* separator: "-",
|
| 35 |
-
* size: 12
|
| 36 |
-
* })
|
| 37 |
-
*
|
| 38 |
-
* const program = Effect.gen(function*() {
|
| 39 |
-
* const idGen = yield* IdGenerator.IdGenerator
|
| 40 |
-
* const id = yield* idGen.generateId()
|
| 41 |
-
* console.log(id) // "tool_call-A7XK9MP2QR5T"
|
| 42 |
-
* return id
|
| 43 |
-
* }).pipe(Effect.provide(customLayer))
|
| 44 |
-
* ```
|
| 45 |
*
|
| 46 |
* @since 4.0.0
|
| 47 |
*/
|
|
@@ -51,13 +15,21 @@ import * as Effect from "../../Effect.ts";
|
|
| 51 |
import * as Layer from "../../Layer.ts";
|
| 52 |
declare const IdGenerator_base: Context.ServiceClass<IdGenerator, "@effect/ai/IdGenerator", Service>;
|
| 53 |
/**
|
| 54 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
*
|
| 56 |
* This tag is used to provide and access ID generation functionality throughout
|
| 57 |
* the application. It follows Effect's standard service pattern for type-safe
|
| 58 |
* dependency injection.
|
| 59 |
*
|
| 60 |
-
*
|
|
|
|
| 61 |
* ```ts
|
| 62 |
* import { Effect } from "effect"
|
| 63 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -69,37 +41,41 @@ declare const IdGenerator_base: Context.ServiceClass<IdGenerator, "@effect/ai/Id
|
|
| 69 |
* })
|
| 70 |
* ```
|
| 71 |
*
|
|
|
|
| 72 |
* @since 4.0.0
|
| 73 |
-
* @category models
|
| 74 |
*/
|
| 75 |
export declare class IdGenerator extends IdGenerator_base {
|
| 76 |
}
|
| 77 |
/**
|
| 78 |
* The service interface for ID generation.
|
| 79 |
*
|
|
|
|
|
|
|
| 80 |
* Defines the contract that all ID generator implementations must fulfill.
|
| 81 |
* The service provides a single method for generating unique identifiers
|
| 82 |
* in an effectful context.
|
| 83 |
*
|
| 84 |
-
*
|
|
|
|
| 85 |
* ```ts
|
| 86 |
* import { Effect } from "effect"
|
| 87 |
* import type { IdGenerator } from "effect/unstable/ai"
|
| 88 |
*
|
| 89 |
-
* // Custom implementation
|
|
|
|
| 90 |
* const customService: IdGenerator.Service = {
|
| 91 |
-
* generateId: () => Effect.
|
| 92 |
* }
|
| 93 |
*
|
| 94 |
* const program = Effect.gen(function*() {
|
| 95 |
* const id = yield* customService.generateId()
|
| 96 |
-
* console.log(id) // "
|
| 97 |
* return id
|
| 98 |
* })
|
| 99 |
* ```
|
| 100 |
*
|
| 101 |
-
* @since 4.0.0
|
| 102 |
* @category models
|
|
|
|
| 103 |
*/
|
| 104 |
export interface Service {
|
| 105 |
readonly generateId: () => Effect.Effect<string>;
|
|
@@ -107,7 +83,8 @@ export interface Service {
|
|
| 107 |
/**
|
| 108 |
* Configuration options for creating custom ID generators.
|
| 109 |
*
|
| 110 |
-
*
|
|
|
|
| 111 |
* ```ts
|
| 112 |
* import type { IdGenerator } from "effect/unstable/ai"
|
| 113 |
*
|
|
@@ -122,8 +99,8 @@ export interface Service {
|
|
| 122 |
* // This will generate IDs like: "tool_A1B2C3D4"
|
| 123 |
* ```
|
| 124 |
*
|
|
|
|
| 125 |
* @since 4.0.0
|
| 126 |
-
* @category models
|
| 127 |
*/
|
| 128 |
export interface MakeOptions {
|
| 129 |
/**
|
|
@@ -146,11 +123,14 @@ export interface MakeOptions {
|
|
| 146 |
/**
|
| 147 |
* Default ID generator service implementation.
|
| 148 |
*
|
|
|
|
|
|
|
| 149 |
* Uses the standard configuration with "id" prefix and generates IDs in the
|
| 150 |
* format "id_XXXXXXXXXXXXXXXX" where X represents random alphanumeric
|
| 151 |
* characters.
|
| 152 |
*
|
| 153 |
-
*
|
|
|
|
| 154 |
* ```ts
|
| 155 |
* import { Effect } from "effect"
|
| 156 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -170,17 +150,20 @@ export interface MakeOptions {
|
|
| 170 |
* )
|
| 171 |
* ```
|
| 172 |
*
|
| 173 |
-
* @since 4.0.0
|
| 174 |
* @category constructors
|
|
|
|
| 175 |
*/
|
| 176 |
export declare const defaultIdGenerator: Service;
|
| 177 |
/**
|
| 178 |
* Creates a custom ID generator service with the specified options.
|
| 179 |
*
|
|
|
|
|
|
|
| 180 |
* Validates the configuration to ensure the separator is not part of the
|
| 181 |
* alphabet, which would cause ambiguity in parsing generated IDs.
|
| 182 |
*
|
| 183 |
-
*
|
|
|
|
| 184 |
* ```ts
|
| 185 |
* import { Effect } from "effect"
|
| 186 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -200,7 +183,8 @@ export declare const defaultIdGenerator: Service;
|
|
| 200 |
* })
|
| 201 |
* ```
|
| 202 |
*
|
| 203 |
-
*
|
|
|
|
| 204 |
* ```ts
|
| 205 |
* import { Effect } from "effect"
|
| 206 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -223,8 +207,8 @@ export declare const defaultIdGenerator: Service;
|
|
| 223 |
* )
|
| 224 |
* ```
|
| 225 |
*
|
| 226 |
-
* @since 4.0.0
|
| 227 |
* @category constructors
|
|
|
|
| 228 |
*/
|
| 229 |
export declare const make: (args_0: MakeOptions) => Effect.Effect<{
|
| 230 |
readonly generateId: () => Effect.Effect<string, never, never>;
|
|
@@ -233,11 +217,13 @@ export declare const make: (args_0: MakeOptions) => Effect.Effect<{
|
|
| 233 |
* Creates a Layer that provides the IdGenerator service with custom
|
| 234 |
* configuration.
|
| 235 |
*
|
| 236 |
-
*
|
| 237 |
-
*
|
| 238 |
-
*
|
|
|
|
|
|
|
|
|
|
| 239 |
*
|
| 240 |
-
* @example
|
| 241 |
* ```ts
|
| 242 |
* import { Effect } from "effect"
|
| 243 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -258,8 +244,8 @@ export declare const make: (args_0: MakeOptions) => Effect.Effect<{
|
|
| 258 |
* }).pipe(Effect.provide(toolCallIdLayer))
|
| 259 |
* ```
|
| 260 |
*
|
| 261 |
-
* @since 4.0.0
|
| 262 |
* @category constructors
|
|
|
|
| 263 |
*/
|
| 264 |
export declare const layer: (options: MakeOptions) => Layer.Layer<IdGenerator, Cause.IllegalArgumentError>;
|
| 265 |
export {};
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Provides identifier generation for AI features.
|
|
|
|
| 3 |
*
|
| 4 |
+
* The `IdGenerator` service exposes one operation, `generateId`, which returns
|
| 5 |
+
* a string inside `Effect`. AI modules use it for values such as tool call ids
|
| 6 |
+
* and generated response item ids. This module includes the service tag,
|
| 7 |
+
* service interface, default generator, configurable custom generator, and layer
|
| 8 |
+
* for providing the service.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
*
|
| 10 |
* @since 4.0.0
|
| 11 |
*/
|
|
|
|
| 15 |
import * as Layer from "../../Layer.ts";
|
| 16 |
declare const IdGenerator_base: Context.ServiceClass<IdGenerator, "@effect/ai/IdGenerator", Service>;
|
| 17 |
/**
|
| 18 |
+
* Service tag for AI identifier generation services.
|
| 19 |
+
*
|
| 20 |
+
* **When to use**
|
| 21 |
+
*
|
| 22 |
+
* Use to access or provide the service that creates identifiers for AI tool
|
| 23 |
+
* calls and related generated values.
|
| 24 |
+
*
|
| 25 |
+
* **Details**
|
| 26 |
*
|
| 27 |
* This tag is used to provide and access ID generation functionality throughout
|
| 28 |
* the application. It follows Effect's standard service pattern for type-safe
|
| 29 |
* dependency injection.
|
| 30 |
*
|
| 31 |
+
* **Example** (Accessing the ID generator service)
|
| 32 |
+
*
|
| 33 |
* ```ts
|
| 34 |
* import { Effect } from "effect"
|
| 35 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 41 |
* })
|
| 42 |
* ```
|
| 43 |
*
|
| 44 |
+
* @category services
|
| 45 |
* @since 4.0.0
|
|
|
|
| 46 |
*/
|
| 47 |
export declare class IdGenerator extends IdGenerator_base {
|
| 48 |
}
|
| 49 |
/**
|
| 50 |
* The service interface for ID generation.
|
| 51 |
*
|
| 52 |
+
* **Details**
|
| 53 |
+
*
|
| 54 |
* Defines the contract that all ID generator implementations must fulfill.
|
| 55 |
* The service provides a single method for generating unique identifiers
|
| 56 |
* in an effectful context.
|
| 57 |
*
|
| 58 |
+
* **Example** (Implementing a custom ID generator)
|
| 59 |
+
*
|
| 60 |
* ```ts
|
| 61 |
* import { Effect } from "effect"
|
| 62 |
* import type { IdGenerator } from "effect/unstable/ai"
|
| 63 |
*
|
| 64 |
+
* // Custom deterministic implementation
|
| 65 |
+
* let nextId = 0
|
| 66 |
* const customService: IdGenerator.Service = {
|
| 67 |
+
* generateId: () => Effect.sync(() => `custom_${++nextId}`)
|
| 68 |
* }
|
| 69 |
*
|
| 70 |
* const program = Effect.gen(function*() {
|
| 71 |
* const id = yield* customService.generateId()
|
| 72 |
+
* console.log(id) // "custom_1"
|
| 73 |
* return id
|
| 74 |
* })
|
| 75 |
* ```
|
| 76 |
*
|
|
|
|
| 77 |
* @category models
|
| 78 |
+
* @since 4.0.0
|
| 79 |
*/
|
| 80 |
export interface Service {
|
| 81 |
readonly generateId: () => Effect.Effect<string>;
|
|
|
|
| 83 |
/**
|
| 84 |
* Configuration options for creating custom ID generators.
|
| 85 |
*
|
| 86 |
+
* **Example** (Configuring generated IDs)
|
| 87 |
+
*
|
| 88 |
* ```ts
|
| 89 |
* import type { IdGenerator } from "effect/unstable/ai"
|
| 90 |
*
|
|
|
|
| 99 |
* // This will generate IDs like: "tool_A1B2C3D4"
|
| 100 |
* ```
|
| 101 |
*
|
| 102 |
+
* @category options
|
| 103 |
* @since 4.0.0
|
|
|
|
| 104 |
*/
|
| 105 |
export interface MakeOptions {
|
| 106 |
/**
|
|
|
|
| 123 |
/**
|
| 124 |
* Default ID generator service implementation.
|
| 125 |
*
|
| 126 |
+
* **Details**
|
| 127 |
+
*
|
| 128 |
* Uses the standard configuration with "id" prefix and generates IDs in the
|
| 129 |
* format "id_XXXXXXXXXXXXXXXX" where X represents random alphanumeric
|
| 130 |
* characters.
|
| 131 |
*
|
| 132 |
+
* **Example** (Generating default IDs)
|
| 133 |
+
*
|
| 134 |
* ```ts
|
| 135 |
* import { Effect } from "effect"
|
| 136 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 150 |
* )
|
| 151 |
* ```
|
| 152 |
*
|
|
|
|
| 153 |
* @category constructors
|
| 154 |
+
* @since 4.0.0
|
| 155 |
*/
|
| 156 |
export declare const defaultIdGenerator: Service;
|
| 157 |
/**
|
| 158 |
* Creates a custom ID generator service with the specified options.
|
| 159 |
*
|
| 160 |
+
* **Details**
|
| 161 |
+
*
|
| 162 |
* Validates the configuration to ensure the separator is not part of the
|
| 163 |
* alphabet, which would cause ambiguity in parsing generated IDs.
|
| 164 |
*
|
| 165 |
+
* **Example** (Creating a custom generator)
|
| 166 |
+
*
|
| 167 |
* ```ts
|
| 168 |
* import { Effect } from "effect"
|
| 169 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 183 |
* })
|
| 184 |
* ```
|
| 185 |
*
|
| 186 |
+
* **Example** (Handling invalid generator options)
|
| 187 |
+
*
|
| 188 |
* ```ts
|
| 189 |
* import { Effect } from "effect"
|
| 190 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 207 |
* )
|
| 208 |
* ```
|
| 209 |
*
|
|
|
|
| 210 |
* @category constructors
|
| 211 |
+
* @since 4.0.0
|
| 212 |
*/
|
| 213 |
export declare const make: (args_0: MakeOptions) => Effect.Effect<{
|
| 214 |
readonly generateId: () => Effect.Effect<string, never, never>;
|
|
|
|
| 217 |
* Creates a Layer that provides the IdGenerator service with custom
|
| 218 |
* configuration.
|
| 219 |
*
|
| 220 |
+
* **When to use**
|
| 221 |
+
*
|
| 222 |
+
* Use when you need to provide ID generation capabilities from validated
|
| 223 |
+
* configuration.
|
| 224 |
+
*
|
| 225 |
+
* **Example** (Providing an ID generator layer)
|
| 226 |
*
|
|
|
|
| 227 |
* ```ts
|
| 228 |
* import { Effect } from "effect"
|
| 229 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 244 |
* }).pipe(Effect.provide(toolCallIdLayer))
|
| 245 |
* ```
|
| 246 |
*
|
|
|
|
| 247 |
* @category constructors
|
| 248 |
+
* @since 4.0.0
|
| 249 |
*/
|
| 250 |
export declare const layer: (options: MakeOptions) => Layer.Layer<IdGenerator, Cause.IllegalArgumentError>;
|
| 251 |
export {};
|
.opencode/node_modules/effect/dist/unstable/ai/IdGenerator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/IdGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/IdGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAEhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,IAAI;;qCAgBf,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,WAAW,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,oBAAoB,CACtD,CAAA"}
|
.opencode/node_modules/effect/dist/unstable/ai/IdGenerator.js
CHANGED
|
@@ -1,47 +1,11 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
-
* for tool calls and other items in the Effect AI SDKs.
|
| 4 |
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
* import { Effect } from "effect"
|
| 11 |
-
* import { IdGenerator } from "effect/unstable/ai"
|
| 12 |
-
*
|
| 13 |
-
* // Using the default ID generator
|
| 14 |
-
* const program = Effect.gen(function*() {
|
| 15 |
-
* const idGen = yield* IdGenerator.IdGenerator
|
| 16 |
-
* const toolCallId = yield* idGen.generateId()
|
| 17 |
-
* console.log(toolCallId) // "id_A7xK9mP2qR5tY8uV"
|
| 18 |
-
* return toolCallId
|
| 19 |
-
* }).pipe(Effect.provideService(
|
| 20 |
-
* IdGenerator.IdGenerator,
|
| 21 |
-
* IdGenerator.defaultIdGenerator
|
| 22 |
-
* ))
|
| 23 |
-
* ```
|
| 24 |
-
*
|
| 25 |
-
* @example
|
| 26 |
-
* ```ts
|
| 27 |
-
* import { Effect } from "effect"
|
| 28 |
-
* import { IdGenerator } from "effect/unstable/ai"
|
| 29 |
-
*
|
| 30 |
-
* // Creating a custom ID generator for AI tool calls
|
| 31 |
-
* const customLayer = IdGenerator.layer({
|
| 32 |
-
* alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
|
| 33 |
-
* prefix: "tool_call",
|
| 34 |
-
* separator: "-",
|
| 35 |
-
* size: 12
|
| 36 |
-
* })
|
| 37 |
-
*
|
| 38 |
-
* const program = Effect.gen(function*() {
|
| 39 |
-
* const idGen = yield* IdGenerator.IdGenerator
|
| 40 |
-
* const id = yield* idGen.generateId()
|
| 41 |
-
* console.log(id) // "tool_call-A7XK9MP2QR5T"
|
| 42 |
-
* return id
|
| 43 |
-
* }).pipe(Effect.provide(customLayer))
|
| 44 |
-
* ```
|
| 45 |
*
|
| 46 |
* @since 4.0.0
|
| 47 |
*/
|
|
@@ -52,13 +16,21 @@ import * as Layer from "../../Layer.js";
|
|
| 52 |
import * as Predicate from "../../Predicate.js";
|
| 53 |
import * as Random from "../../Random.js";
|
| 54 |
/**
|
| 55 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
*
|
| 57 |
* This tag is used to provide and access ID generation functionality throughout
|
| 58 |
* the application. It follows Effect's standard service pattern for type-safe
|
| 59 |
* dependency injection.
|
| 60 |
*
|
| 61 |
-
*
|
|
|
|
| 62 |
* ```ts
|
| 63 |
* import { Effect } from "effect"
|
| 64 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -70,8 +42,8 @@ import * as Random from "../../Random.js";
|
|
| 70 |
* })
|
| 71 |
* ```
|
| 72 |
*
|
|
|
|
| 73 |
* @since 4.0.0
|
| 74 |
-
* @category models
|
| 75 |
*/
|
| 76 |
export class IdGenerator extends /*#__PURE__*/Context.Service()("@effect/ai/IdGenerator") {}
|
| 77 |
const DEFAULT_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
@@ -100,11 +72,14 @@ const makeGenerator = ({
|
|
| 100 |
/**
|
| 101 |
* Default ID generator service implementation.
|
| 102 |
*
|
|
|
|
|
|
|
| 103 |
* Uses the standard configuration with "id" prefix and generates IDs in the
|
| 104 |
* format "id_XXXXXXXXXXXXXXXX" where X represents random alphanumeric
|
| 105 |
* characters.
|
| 106 |
*
|
| 107 |
-
*
|
|
|
|
| 108 |
* ```ts
|
| 109 |
* import { Effect } from "effect"
|
| 110 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -124,8 +99,8 @@ const makeGenerator = ({
|
|
| 124 |
* )
|
| 125 |
* ```
|
| 126 |
*
|
| 127 |
-
* @since 4.0.0
|
| 128 |
* @category constructors
|
|
|
|
| 129 |
*/
|
| 130 |
export const defaultIdGenerator = {
|
| 131 |
generateId: /*#__PURE__*/makeGenerator({
|
|
@@ -135,10 +110,13 @@ export const defaultIdGenerator = {
|
|
| 135 |
/**
|
| 136 |
* Creates a custom ID generator service with the specified options.
|
| 137 |
*
|
|
|
|
|
|
|
| 138 |
* Validates the configuration to ensure the separator is not part of the
|
| 139 |
* alphabet, which would cause ambiguity in parsing generated IDs.
|
| 140 |
*
|
| 141 |
-
*
|
|
|
|
| 142 |
* ```ts
|
| 143 |
* import { Effect } from "effect"
|
| 144 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -158,7 +136,8 @@ export const defaultIdGenerator = {
|
|
| 158 |
* })
|
| 159 |
* ```
|
| 160 |
*
|
| 161 |
-
*
|
|
|
|
| 162 |
* ```ts
|
| 163 |
* import { Effect } from "effect"
|
| 164 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -181,8 +160,8 @@ export const defaultIdGenerator = {
|
|
| 181 |
* )
|
| 182 |
* ```
|
| 183 |
*
|
| 184 |
-
* @since 4.0.0
|
| 185 |
* @category constructors
|
|
|
|
| 186 |
*/
|
| 187 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
| 188 |
alphabet = DEFAULT_ALPHABET,
|
|
@@ -208,11 +187,13 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
| 208 |
* Creates a Layer that provides the IdGenerator service with custom
|
| 209 |
* configuration.
|
| 210 |
*
|
| 211 |
-
*
|
| 212 |
-
*
|
| 213 |
-
*
|
|
|
|
|
|
|
|
|
|
| 214 |
*
|
| 215 |
-
* @example
|
| 216 |
* ```ts
|
| 217 |
* import { Effect } from "effect"
|
| 218 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
@@ -233,8 +214,8 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
| 233 |
* }).pipe(Effect.provide(toolCallIdLayer))
|
| 234 |
* ```
|
| 235 |
*
|
| 236 |
-
* @since 4.0.0
|
| 237 |
* @category constructors
|
|
|
|
| 238 |
*/
|
| 239 |
export const layer = options => Layer.effect(IdGenerator)(make(options));
|
| 240 |
//# sourceMappingURL=IdGenerator.js.map
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Provides identifier generation for AI features.
|
|
|
|
| 3 |
*
|
| 4 |
+
* The `IdGenerator` service exposes one operation, `generateId`, which returns
|
| 5 |
+
* a string inside `Effect`. AI modules use it for values such as tool call ids
|
| 6 |
+
* and generated response item ids. This module includes the service tag,
|
| 7 |
+
* service interface, default generator, configurable custom generator, and layer
|
| 8 |
+
* for providing the service.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
*
|
| 10 |
* @since 4.0.0
|
| 11 |
*/
|
|
|
|
| 16 |
import * as Predicate from "../../Predicate.js";
|
| 17 |
import * as Random from "../../Random.js";
|
| 18 |
/**
|
| 19 |
+
* Service tag for AI identifier generation services.
|
| 20 |
+
*
|
| 21 |
+
* **When to use**
|
| 22 |
+
*
|
| 23 |
+
* Use to access or provide the service that creates identifiers for AI tool
|
| 24 |
+
* calls and related generated values.
|
| 25 |
+
*
|
| 26 |
+
* **Details**
|
| 27 |
*
|
| 28 |
* This tag is used to provide and access ID generation functionality throughout
|
| 29 |
* the application. It follows Effect's standard service pattern for type-safe
|
| 30 |
* dependency injection.
|
| 31 |
*
|
| 32 |
+
* **Example** (Accessing the ID generator service)
|
| 33 |
+
*
|
| 34 |
* ```ts
|
| 35 |
* import { Effect } from "effect"
|
| 36 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 42 |
* })
|
| 43 |
* ```
|
| 44 |
*
|
| 45 |
+
* @category services
|
| 46 |
* @since 4.0.0
|
|
|
|
| 47 |
*/
|
| 48 |
export class IdGenerator extends /*#__PURE__*/Context.Service()("@effect/ai/IdGenerator") {}
|
| 49 |
const DEFAULT_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
|
|
| 72 |
/**
|
| 73 |
* Default ID generator service implementation.
|
| 74 |
*
|
| 75 |
+
* **Details**
|
| 76 |
+
*
|
| 77 |
* Uses the standard configuration with "id" prefix and generates IDs in the
|
| 78 |
* format "id_XXXXXXXXXXXXXXXX" where X represents random alphanumeric
|
| 79 |
* characters.
|
| 80 |
*
|
| 81 |
+
* **Example** (Generating default IDs)
|
| 82 |
+
*
|
| 83 |
* ```ts
|
| 84 |
* import { Effect } from "effect"
|
| 85 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 99 |
* )
|
| 100 |
* ```
|
| 101 |
*
|
|
|
|
| 102 |
* @category constructors
|
| 103 |
+
* @since 4.0.0
|
| 104 |
*/
|
| 105 |
export const defaultIdGenerator = {
|
| 106 |
generateId: /*#__PURE__*/makeGenerator({
|
|
|
|
| 110 |
/**
|
| 111 |
* Creates a custom ID generator service with the specified options.
|
| 112 |
*
|
| 113 |
+
* **Details**
|
| 114 |
+
*
|
| 115 |
* Validates the configuration to ensure the separator is not part of the
|
| 116 |
* alphabet, which would cause ambiguity in parsing generated IDs.
|
| 117 |
*
|
| 118 |
+
* **Example** (Creating a custom generator)
|
| 119 |
+
*
|
| 120 |
* ```ts
|
| 121 |
* import { Effect } from "effect"
|
| 122 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 136 |
* })
|
| 137 |
* ```
|
| 138 |
*
|
| 139 |
+
* **Example** (Handling invalid generator options)
|
| 140 |
+
*
|
| 141 |
* ```ts
|
| 142 |
* import { Effect } from "effect"
|
| 143 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 160 |
* )
|
| 161 |
* ```
|
| 162 |
*
|
|
|
|
| 163 |
* @category constructors
|
| 164 |
+
* @since 4.0.0
|
| 165 |
*/
|
| 166 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
| 167 |
alphabet = DEFAULT_ALPHABET,
|
|
|
|
| 187 |
* Creates a Layer that provides the IdGenerator service with custom
|
| 188 |
* configuration.
|
| 189 |
*
|
| 190 |
+
* **When to use**
|
| 191 |
+
*
|
| 192 |
+
* Use when you need to provide ID generation capabilities from validated
|
| 193 |
+
* configuration.
|
| 194 |
+
*
|
| 195 |
+
* **Example** (Providing an ID generator layer)
|
| 196 |
*
|
|
|
|
| 197 |
* ```ts
|
| 198 |
* import { Effect } from "effect"
|
| 199 |
* import { IdGenerator } from "effect/unstable/ai"
|
|
|
|
| 214 |
* }).pipe(Effect.provide(toolCallIdLayer))
|
| 215 |
* ```
|
| 216 |
*
|
|
|
|
| 217 |
* @category constructors
|
| 218 |
+
* @since 4.0.0
|
| 219 |
*/
|
| 220 |
export const layer = options => Layer.effect(IdGenerator)(make(options));
|
| 221 |
//# sourceMappingURL=IdGenerator.js.map
|
.opencode/node_modules/effect/dist/unstable/ai/IdGenerator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"IdGenerator.js","names":["Cause","Context","Effect","Layer","Predicate","Random","IdGenerator","Service","DEFAULT_ALPHABET","DEFAULT_SEPARATOR","DEFAULT_SIZE","makeGenerator","alphabet","prefix","separator","size","alphabetLength","length","fnUntraced","chars","Array","i","index","next","identifier","join","isUndefined","defaultIdGenerator","generateId","make","includes","message","IllegalArgumentError","layer","options","effect"],"sources":["../../../src/unstable/ai/IdGenerator.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;
|
|
|
|
| 1 |
+
{"version":3,"file":"IdGenerator.js","names":["Cause","Context","Effect","Layer","Predicate","Random","IdGenerator","Service","DEFAULT_ALPHABET","DEFAULT_SEPARATOR","DEFAULT_SIZE","makeGenerator","alphabet","prefix","separator","size","alphabetLength","length","fnUntraced","chars","Array","i","index","next","identifier","join","isUndefined","defaultIdGenerator","generateId","make","includes","message","IllegalArgumentError","layer","options","effect"],"sources":["../../../src/unstable/ai/IdGenerator.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAKA,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAM,MAAOC,WAAY,sBAAQL,OAAO,CAACM,OAAO,EAAwB,CACtE,wBAAwB,CACzB;AA8ED,MAAMC,gBAAgB,GAAG,gEAAgE;AACzF,MAAMC,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,YAAY,GAAG,EAAE;AAEvB,MAAMC,aAAa,GAAGA,CAAC;EACrBC,QAAQ,GAAGJ,gBAAgB;EAC3BK,MAAM;EACNC,SAAS,GAAGL,iBAAiB;EAC7BM,IAA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O,CAAC;EACvD;EAEA,MAAMH,UAAU,GAAGjB,aAAa,CAAC;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,SAAS;IAAEC;EAAI,CAAE,CAAC;EAEvE,OAAO;IACLa;GACQ;AACZ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,OAAO,MAAMK,KAAK,GAAIC,OAAoB,IACxC/B,KAAK,CAACgC,MAAM,CAAC7B,WAAW,CAAC,CAACuB,IAAI,CAACK,OAAO,CAAC,CAAC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/LanguageModel.d.ts
CHANGED
|
@@ -13,13 +13,15 @@ import type * as Tool from "./Tool.ts";
|
|
| 13 |
import * as Toolkit from "./Toolkit.ts";
|
| 14 |
declare const LanguageModel_base: Context.ServiceClass<LanguageModel, "effect/unstable/ai/LanguageModel", Service>;
|
| 15 |
/**
|
| 16 |
-
*
|
| 17 |
*
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
-
*
|
|
|
|
|
|
|
|
|
|
| 21 |
*
|
| 22 |
-
* @example
|
| 23 |
* ```ts
|
| 24 |
* import { Effect } from "effect"
|
| 25 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -33,19 +35,16 @@ declare const LanguageModel_base: Context.ServiceClass<LanguageModel, "effect/un
|
|
| 33 |
* })
|
| 34 |
* ```
|
| 35 |
*
|
| 36 |
-
* @since 4.0.0
|
| 37 |
* @category services
|
|
|
|
| 38 |
*/
|
| 39 |
export declare class LanguageModel extends LanguageModel_base {
|
| 40 |
}
|
| 41 |
/**
|
| 42 |
-
* The service interface for language model operations.
|
| 43 |
*
|
| 44 |
-
* Defines the contract that all language model implementations must fulfill,
|
| 45 |
-
* providing text generation, structured output, and streaming capabilities.
|
| 46 |
-
*
|
| 47 |
-
* @since 4.0.0
|
| 48 |
* @category models
|
|
|
|
| 49 |
*/
|
| 50 |
export interface Service {
|
| 51 |
/**
|
|
@@ -86,15 +85,16 @@ export interface Service {
|
|
| 86 |
};
|
| 87 |
}
|
| 88 |
/**
|
| 89 |
-
* A function that transforms a `Schema.Codec` into a provider-compatible form
|
| 90 |
-
*
|
|
|
|
| 91 |
*
|
| 92 |
* Different language model providers have varying constraints on the JSON
|
| 93 |
* schemas they accept. A `CodecTransformer` rewrites a codec's encoded side to
|
| 94 |
* satisfy those constraints while preserving the decoded type.
|
| 95 |
*
|
| 96 |
-
* @since 4.0.0
|
| 97 |
* @category models
|
|
|
|
| 98 |
*/
|
| 99 |
export type CodecTransformer = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>) => {
|
| 100 |
readonly codec: Schema.Codec<T, unknown, RD, RE>;
|
|
@@ -104,15 +104,29 @@ export type CodecTransformer = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>
|
|
| 104 |
* The default codec transformer that passes schemas through without
|
| 105 |
* provider-specific rewrites.
|
| 106 |
*
|
| 107 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
* @category services
|
|
|
|
| 109 |
*/
|
| 110 |
export declare const defaultCodecTransformer: CodecTransformer;
|
| 111 |
/**
|
| 112 |
* Configuration options for text generation.
|
| 113 |
*
|
|
|
|
| 114 |
* @since 4.0.0
|
| 115 |
-
* @category models
|
| 116 |
*/
|
| 117 |
export interface GenerateTextOptions<Tools extends Record<string, Tool.Any>> {
|
| 118 |
/**
|
|
@@ -147,15 +161,13 @@ export interface GenerateTextOptions<Tools extends Record<string, Tool.Any>> {
|
|
| 147 |
*/
|
| 148 |
readonly concurrency?: Concurrency | undefined;
|
| 149 |
/**
|
| 150 |
-
* When set to `true`, tool calls requested by the large language model
|
| 151 |
-
*
|
|
|
|
| 152 |
*
|
| 153 |
-
*
|
| 154 |
-
*
|
| 155 |
-
*
|
| 156 |
-
* capability to call tools
|
| 157 |
-
* 2. The user wants to control the execution of tool call resolvers
|
| 158 |
-
* instead of having the framework handle tool call resolution
|
| 159 |
*/
|
| 160 |
readonly disableToolCallResolution?: boolean | undefined;
|
| 161 |
}
|
|
@@ -165,8 +177,8 @@ type GenerateTextOptionsWithoutToolkit = Omit<GenerateTextOptions<{}>, "toolkit"
|
|
| 165 |
/**
|
| 166 |
* Configuration options for structured object generation.
|
| 167 |
*
|
|
|
|
| 168 |
* @since 4.0.0
|
| 169 |
-
* @category models
|
| 170 |
*/
|
| 171 |
export interface GenerateObjectOptions<Tools extends Record<string, Tool.Any>, StructuredOutputSchema extends Schema.Top> extends GenerateTextOptions<Tools> {
|
| 172 |
/**
|
|
@@ -194,8 +206,8 @@ export interface GenerateObjectOptions<Tools extends Record<string, Tool.Any>, S
|
|
| 194 |
* `"required"`, the model **must** call one tool from the allowed subset of
|
| 195 |
* tools.
|
| 196 |
*
|
| 197 |
-
* @since 4.0.0
|
| 198 |
* @category models
|
|
|
|
| 199 |
*/
|
| 200 |
export type ToolChoice<ToolName extends string> = "auto" | "none" | "required" | {
|
| 201 |
readonly tool: ToolName;
|
|
@@ -204,13 +216,10 @@ export type ToolChoice<ToolName extends string> = "auto" | "none" | "required" |
|
|
| 204 |
readonly oneOf: ReadonlyArray<ToolName>;
|
| 205 |
};
|
| 206 |
/**
|
| 207 |
-
* Response class for text generation operations.
|
| 208 |
*
|
| 209 |
-
*
|
| 210 |
-
* extracting different types of response parts like text, tool calls, and usage
|
| 211 |
-
* information.
|
| 212 |
*
|
| 213 |
-
* @example
|
| 214 |
* ```ts
|
| 215 |
* import { Effect } from "effect"
|
| 216 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -228,8 +237,8 @@ export type ToolChoice<ToolName extends string> = "auto" | "none" | "required" |
|
|
| 228 |
* })
|
| 229 |
* ```
|
| 230 |
*
|
| 231 |
-
* @since 4.0.0
|
| 232 |
* @category models
|
|
|
|
| 233 |
*/
|
| 234 |
export declare class GenerateTextResponse<Tools extends Record<string, Tool.Any>> {
|
| 235 |
readonly content: Array<Response.Part<Tools>>;
|
|
@@ -266,7 +275,8 @@ export declare class GenerateTextResponse<Tools extends Record<string, Tool.Any>
|
|
| 266 |
/**
|
| 267 |
* Response class for structured object generation operations.
|
| 268 |
*
|
| 269 |
-
*
|
|
|
|
| 270 |
* ```ts
|
| 271 |
* import { Effect, Schema } from "effect"
|
| 272 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -289,8 +299,8 @@ export declare class GenerateTextResponse<Tools extends Record<string, Tool.Any>
|
|
| 289 |
* })
|
| 290 |
* ```
|
| 291 |
*
|
| 292 |
-
* @since 4.0.0
|
| 293 |
* @category models
|
|
|
|
| 294 |
*/
|
| 295 |
export declare class GenerateObjectResponse<Tools extends Record<string, Tool.Any>, A> extends GenerateTextResponse<Tools> {
|
| 296 |
/**
|
|
@@ -302,41 +312,45 @@ export declare class GenerateObjectResponse<Tools extends Record<string, Tool.An
|
|
| 302 |
/**
|
| 303 |
* The supported toolkit option shapes for language model operations.
|
| 304 |
*
|
| 305 |
-
* @since 4.0.0
|
| 306 |
* @category utility types
|
|
|
|
| 307 |
*/
|
| 308 |
-
export type ToolkitOption<Tools extends Record<string, Tool.Any>, E = never, R = any> = Tools extends any ? (Toolkit.WithHandler<Tools> | Effect.
|
| 309 |
/**
|
| 310 |
* The supported toolkit input shapes for language model operation options.
|
| 311 |
*
|
|
|
|
|
|
|
| 312 |
* Unlike `ToolkitOption`, this type does not distribute over unions. It is
|
| 313 |
* intended for call-site assignability, while `ToolkitOption` remains the
|
| 314 |
* distributive helper used for extraction and inference.
|
| 315 |
*
|
| 316 |
-
* @since 4.0.0
|
| 317 |
* @category utility types
|
|
|
|
| 318 |
*/
|
| 319 |
-
export type ToolkitInput<Tools extends Record<string, Tool.Any>, E = never, R = any> = ToolkitOption<Tools, E, R> | Toolkit.WithHandler<Tools> | Effect.
|
| 320 |
-
type ExtractToolsFromToolkitOption<ToolkitValue> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? Tools : ToolkitValue extends Effect.
|
| 321 |
/**
|
| 322 |
* Utility type that extracts the toolset from LanguageModel options.
|
| 323 |
*
|
| 324 |
-
* @since 4.0.0
|
| 325 |
* @category utility types
|
|
|
|
| 326 |
*/
|
| 327 |
export type ExtractTools<Options> = Options extends {
|
| 328 |
readonly toolkit: infer ToolkitValue;
|
| 329 |
} ? ExtractToolsFromToolkitOption<Exclude<ToolkitValue, undefined>> : {};
|
| 330 |
-
type ExtractErrorFromToolkitOption<ToolkitValue, DisableToolCallResolution extends boolean> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? AiError.AiError | (DisableToolCallResolution extends true ? never : Tool.HandlerError<Tools[keyof Tools]>) : ToolkitValue extends Effect.
|
| 331 |
-
type ExtractServicesFromToolkitOption<ToolkitValue> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? Tool.HandlerServices<Tools[keyof Tools]> | Tool.ResultDecodingServices<Tools[keyof Tools]> : ToolkitValue extends Effect.
|
| 332 |
/**
|
| 333 |
* Utility type that extracts the error type from LanguageModel options.
|
| 334 |
*
|
|
|
|
|
|
|
| 335 |
* Automatically infers the possible error types based on toolkit configuration
|
| 336 |
* and tool call resolution settings.
|
| 337 |
*
|
| 338 |
-
* @since 4.0.0
|
| 339 |
* @category utility types
|
|
|
|
| 340 |
*/
|
| 341 |
export type ExtractError<Options> = Options extends {
|
| 342 |
readonly disableToolCallResolution: true;
|
|
@@ -349,10 +363,12 @@ export type ExtractError<Options> = Options extends {
|
|
| 349 |
/**
|
| 350 |
* Utility type that extracts the context requirements from LanguageModel options.
|
| 351 |
*
|
|
|
|
|
|
|
| 352 |
* Automatically infers the required services based on the toolkit configuration.
|
| 353 |
*
|
| 354 |
-
* @since 4.0.0
|
| 355 |
* @category utility types
|
|
|
|
| 356 |
*/
|
| 357 |
export type ExtractServices<Options> = Options extends {
|
| 358 |
readonly disableToolCallResolution: true;
|
|
@@ -360,15 +376,16 @@ export type ExtractServices<Options> = Options extends {
|
|
| 360 |
readonly toolkit: infer Toolkit;
|
| 361 |
} ? ExtractServicesFromToolkitOption<Exclude<Toolkit, undefined>> : never;
|
| 362 |
/**
|
| 363 |
-
* Configuration options passed along to language model provider
|
| 364 |
-
*
|
|
|
|
| 365 |
*
|
| 366 |
* This interface defines the normalized options that are passed to the
|
| 367 |
* underlying provider implementation, regardless of the specific provider being
|
| 368 |
* used.
|
| 369 |
*
|
|
|
|
| 370 |
* @since 4.0.0
|
| 371 |
-
* @category models
|
| 372 |
*/
|
| 373 |
export interface ProviderOptions {
|
| 374 |
/**
|
|
@@ -381,15 +398,14 @@ export interface ProviderOptions {
|
|
| 381 |
*/
|
| 382 |
readonly tools: ReadonlyArray<Tool.Any>;
|
| 383 |
/**
|
| 384 |
-
* The format
|
| 385 |
-
*
|
| 386 |
-
* If `"text"` is specified, the large language model response will be
|
| 387 |
-
* returned as text.
|
| 388 |
*
|
| 389 |
-
*
|
| 390 |
-
* as an JSON object that conforms to the shape of the specified schema.
|
| 391 |
*
|
| 392 |
-
*
|
|
|
|
|
|
|
|
|
|
| 393 |
*/
|
| 394 |
readonly responseFormat: {
|
| 395 |
readonly type: "text";
|
|
@@ -428,28 +444,44 @@ export interface ProviderOptions {
|
|
| 428 |
readonly incrementalPrompt: Prompt.Prompt | undefined;
|
| 429 |
}
|
| 430 |
/**
|
| 431 |
-
* Creates a LanguageModel service from provider-specific
|
|
|
|
| 432 |
*
|
| 433 |
-
*
|
| 434 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 435 |
*
|
| 436 |
-
* @since 4.0.0
|
| 437 |
* @category constructors
|
|
|
|
| 438 |
*/
|
| 439 |
export declare const make: (params: {
|
| 440 |
/**
|
| 441 |
-
* A method
|
| 442 |
-
* provider.
|
| 443 |
-
*
|
| 444 |
-
* The final result is returned when the large language model provider
|
| 445 |
-
* finishes text generation.
|
| 446 |
*/
|
| 447 |
readonly generateText: (options: ProviderOptions) => Effect.Effect<Array<Response.PartEncoded>, AiError.AiError, IdGenerator>;
|
| 448 |
/**
|
| 449 |
-
* A method
|
| 450 |
-
* provider.
|
| 451 |
-
*
|
| 452 |
-
* Intermediate results are streamed from the large language model provider.
|
| 453 |
*/
|
| 454 |
readonly streamText: (options: ProviderOptions) => Stream.Stream<Response.StreamPartEncoded, AiError.AiError, IdGenerator>;
|
| 455 |
/**
|
|
@@ -459,9 +491,10 @@ export declare const make: (params: {
|
|
| 459 |
readonly codecTransformer?: CodecTransformer | undefined;
|
| 460 |
}) => Effect.Effect<Service>;
|
| 461 |
/**
|
| 462 |
-
*
|
|
|
|
|
|
|
| 463 |
*
|
| 464 |
-
* @example
|
| 465 |
* ```ts
|
| 466 |
* import { Effect } from "effect"
|
| 467 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -479,8 +512,8 @@ export declare const make: (params: {
|
|
| 479 |
* })
|
| 480 |
* ```
|
| 481 |
*
|
| 482 |
-
* @since 4.0.0
|
| 483 |
* @category text generation
|
|
|
|
| 484 |
*/
|
| 485 |
export declare const generateText: {
|
| 486 |
<Options extends NoExcessProperties<GenerateTextOptionsWithoutToolkit, Options>>(options: Options & GenerateTextOptionsWithoutToolkit): Effect.Effect<GenerateTextResponse<{}>, ExtractError<Options>, LanguageModel | ExtractServices<Options>>;
|
|
@@ -496,9 +529,10 @@ export declare const generateText: {
|
|
| 496 |
}): Effect.Effect<GenerateTextResponse<ExtractTools<Options>>, ExtractError<Options>, ExtractServices<Options> | LanguageModel>;
|
| 497 |
};
|
| 498 |
/**
|
| 499 |
-
*
|
|
|
|
|
|
|
| 500 |
*
|
| 501 |
-
* @example
|
| 502 |
* ```ts
|
| 503 |
* import { Effect, Schema } from "effect"
|
| 504 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -524,17 +558,20 @@ export declare const generateText: {
|
|
| 524 |
* })
|
| 525 |
* ```
|
| 526 |
*
|
| 527 |
-
* @since 4.0.0
|
| 528 |
* @category object generation
|
|
|
|
| 529 |
*/
|
| 530 |
export declare const generateObject: <ObjectEncoded extends Record<string, any>, StructuredOutputSchema extends Schema.Encoder<ObjectEncoded, unknown>, Options extends NoExcessProperties<GenerateObjectOptions<any, StructuredOutputSchema>, Options>>(options: Options & GenerateObjectOptions<ExtractTools<Options>, StructuredOutputSchema>) => Effect.Effect<GenerateObjectResponse<ExtractTools<Options>, StructuredOutputSchema["Type"]>, ExtractError<Options>, ExtractServices<Options> | StructuredOutputSchema["DecodingServices"] | LanguageModel>;
|
| 531 |
/**
|
| 532 |
-
*
|
|
|
|
|
|
|
| 533 |
*
|
| 534 |
* Returns a stream of response parts that are emitted as soon as they are
|
| 535 |
* available from the model, enabling real-time text generation experiences.
|
| 536 |
*
|
| 537 |
-
*
|
|
|
|
| 538 |
* ```ts
|
| 539 |
* import { Console, Effect, Stream } from "effect"
|
| 540 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -549,8 +586,8 @@ export declare const generateObject: <ObjectEncoded extends Record<string, any>,
|
|
| 549 |
* }))
|
| 550 |
* ```
|
| 551 |
*
|
| 552 |
-
* @since 4.0.0
|
| 553 |
* @category text generation
|
|
|
|
| 554 |
*/
|
| 555 |
export declare const streamText: {
|
| 556 |
<Options extends NoExcessProperties<GenerateTextOptionsWithoutToolkit, Options>>(options: Options & GenerateTextOptionsWithoutToolkit): Stream.Stream<Response.StreamPart<{}>, ExtractError<Options>, ExtractServices<Options> | LanguageModel>;
|
|
|
|
| 13 |
import * as Toolkit from "./Toolkit.ts";
|
| 14 |
declare const LanguageModel_base: Context.ServiceClass<LanguageModel, "effect/unstable/ai/LanguageModel", Service>;
|
| 15 |
/**
|
| 16 |
+
* Service tag for AI model services.
|
| 17 |
*
|
| 18 |
+
* **When to use**
|
| 19 |
+
*
|
| 20 |
+
* Use to access or provide text generation, streaming generation, structured
|
| 21 |
+
* output, and tool-calling capabilities through the Effect context.
|
| 22 |
+
*
|
| 23 |
+
* **Example** (Accessing the language model service)
|
| 24 |
*
|
|
|
|
| 25 |
* ```ts
|
| 26 |
* import { Effect } from "effect"
|
| 27 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 35 |
* })
|
| 36 |
* ```
|
| 37 |
*
|
|
|
|
| 38 |
* @category services
|
| 39 |
+
* @since 4.0.0
|
| 40 |
*/
|
| 41 |
export declare class LanguageModel extends LanguageModel_base {
|
| 42 |
}
|
| 43 |
/**
|
| 44 |
+
* The service interface for language model operations, defining the contract that all language model implementations must fulfill.
|
| 45 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
* @category models
|
| 47 |
+
* @since 4.0.0
|
| 48 |
*/
|
| 49 |
export interface Service {
|
| 50 |
/**
|
|
|
|
| 85 |
};
|
| 86 |
}
|
| 87 |
/**
|
| 88 |
+
* A function that transforms a `Schema.Codec` into a provider-compatible form for structured output generation.
|
| 89 |
+
*
|
| 90 |
+
* **Details**
|
| 91 |
*
|
| 92 |
* Different language model providers have varying constraints on the JSON
|
| 93 |
* schemas they accept. A `CodecTransformer` rewrites a codec's encoded side to
|
| 94 |
* satisfy those constraints while preserving the decoded type.
|
| 95 |
*
|
|
|
|
| 96 |
* @category models
|
| 97 |
+
* @since 4.0.0
|
| 98 |
*/
|
| 99 |
export type CodecTransformer = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>) => {
|
| 100 |
readonly codec: Schema.Codec<T, unknown, RD, RE>;
|
|
|
|
| 104 |
* The default codec transformer that passes schemas through without
|
| 105 |
* provider-specific rewrites.
|
| 106 |
*
|
| 107 |
+
* **When to use**
|
| 108 |
+
*
|
| 109 |
+
* Use as the codec transformer for provider implementations when the provider
|
| 110 |
+
* accepts the JSON Schema generated from an `Effect` Schema codec without
|
| 111 |
+
* provider-specific rewrites.
|
| 112 |
+
*
|
| 113 |
+
* **Details**
|
| 114 |
+
*
|
| 115 |
+
* The transformer returns the original codec, resolves a top-level `$ref`, and
|
| 116 |
+
* copies schema definitions into `$defs`.
|
| 117 |
+
*
|
| 118 |
+
* @see {@link CodecTransformer} for the structured-output transformer contract
|
| 119 |
+
* @see {@link make} for where this transformer is used as the default
|
| 120 |
+
*
|
| 121 |
* @category services
|
| 122 |
+
* @since 4.0.0
|
| 123 |
*/
|
| 124 |
export declare const defaultCodecTransformer: CodecTransformer;
|
| 125 |
/**
|
| 126 |
* Configuration options for text generation.
|
| 127 |
*
|
| 128 |
+
* @category options
|
| 129 |
* @since 4.0.0
|
|
|
|
| 130 |
*/
|
| 131 |
export interface GenerateTextOptions<Tools extends Record<string, Tool.Any>> {
|
| 132 |
/**
|
|
|
|
| 161 |
*/
|
| 162 |
readonly concurrency?: Concurrency | undefined;
|
| 163 |
/**
|
| 164 |
+
* When set to `true`, tool calls requested by the large language model are not auto-resolved by the framework.
|
| 165 |
+
*
|
| 166 |
+
* **When to use**
|
| 167 |
*
|
| 168 |
+
* Use when you want to include tool call definitions from an `AiToolkit`
|
| 169 |
+
* in requests to the large language model, while controlling tool call
|
| 170 |
+
* resolver execution yourself.
|
|
|
|
|
|
|
|
|
|
| 171 |
*/
|
| 172 |
readonly disableToolCallResolution?: boolean | undefined;
|
| 173 |
}
|
|
|
|
| 177 |
/**
|
| 178 |
* Configuration options for structured object generation.
|
| 179 |
*
|
| 180 |
+
* @category options
|
| 181 |
* @since 4.0.0
|
|
|
|
| 182 |
*/
|
| 183 |
export interface GenerateObjectOptions<Tools extends Record<string, Tool.Any>, StructuredOutputSchema extends Schema.Top> extends GenerateTextOptions<Tools> {
|
| 184 |
/**
|
|
|
|
| 206 |
* `"required"`, the model **must** call one tool from the allowed subset of
|
| 207 |
* tools.
|
| 208 |
*
|
|
|
|
| 209 |
* @category models
|
| 210 |
+
* @since 4.0.0
|
| 211 |
*/
|
| 212 |
export type ToolChoice<ToolName extends string> = "auto" | "none" | "required" | {
|
| 213 |
readonly tool: ToolName;
|
|
|
|
| 216 |
readonly oneOf: ReadonlyArray<ToolName>;
|
| 217 |
};
|
| 218 |
/**
|
| 219 |
+
* Response class for text generation operations, with accessors for extracting text, tool calls, usage information, and other response parts from generated content.
|
| 220 |
*
|
| 221 |
+
* **Example** (Inspecting a text response)
|
|
|
|
|
|
|
| 222 |
*
|
|
|
|
| 223 |
* ```ts
|
| 224 |
* import { Effect } from "effect"
|
| 225 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 237 |
* })
|
| 238 |
* ```
|
| 239 |
*
|
|
|
|
| 240 |
* @category models
|
| 241 |
+
* @since 4.0.0
|
| 242 |
*/
|
| 243 |
export declare class GenerateTextResponse<Tools extends Record<string, Tool.Any>> {
|
| 244 |
readonly content: Array<Response.Part<Tools>>;
|
|
|
|
| 275 |
/**
|
| 276 |
* Response class for structured object generation operations.
|
| 277 |
*
|
| 278 |
+
* **Example** (Inspecting an object response)
|
| 279 |
+
*
|
| 280 |
* ```ts
|
| 281 |
* import { Effect, Schema } from "effect"
|
| 282 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 299 |
* })
|
| 300 |
* ```
|
| 301 |
*
|
|
|
|
| 302 |
* @category models
|
| 303 |
+
* @since 4.0.0
|
| 304 |
*/
|
| 305 |
export declare class GenerateObjectResponse<Tools extends Record<string, Tool.Any>, A> extends GenerateTextResponse<Tools> {
|
| 306 |
/**
|
|
|
|
| 312 |
/**
|
| 313 |
* The supported toolkit option shapes for language model operations.
|
| 314 |
*
|
|
|
|
| 315 |
* @category utility types
|
| 316 |
+
* @since 4.0.0
|
| 317 |
*/
|
| 318 |
+
export type ToolkitOption<Tools extends Record<string, Tool.Any>, E = never, R = any> = Tools extends any ? (Toolkit.WithHandler<Tools> | Effect.Effect<Toolkit.WithHandler<Tools>, E, R>) : never;
|
| 319 |
/**
|
| 320 |
* The supported toolkit input shapes for language model operation options.
|
| 321 |
*
|
| 322 |
+
* **Details**
|
| 323 |
+
*
|
| 324 |
* Unlike `ToolkitOption`, this type does not distribute over unions. It is
|
| 325 |
* intended for call-site assignability, while `ToolkitOption` remains the
|
| 326 |
* distributive helper used for extraction and inference.
|
| 327 |
*
|
|
|
|
| 328 |
* @category utility types
|
| 329 |
+
* @since 4.0.0
|
| 330 |
*/
|
| 331 |
+
export type ToolkitInput<Tools extends Record<string, Tool.Any>, E = never, R = any> = ToolkitOption<Tools, E, R> | Toolkit.WithHandler<Tools> | Effect.Effect<Toolkit.WithHandler<Tools>, E, R>;
|
| 332 |
+
type ExtractToolsFromToolkitOption<ToolkitValue> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? Tools : ToolkitValue extends Effect.Effect<Toolkit.WithHandler<infer _Tools>, infer _E, infer _R> ? _Tools : never;
|
| 333 |
/**
|
| 334 |
* Utility type that extracts the toolset from LanguageModel options.
|
| 335 |
*
|
|
|
|
| 336 |
* @category utility types
|
| 337 |
+
* @since 4.0.0
|
| 338 |
*/
|
| 339 |
export type ExtractTools<Options> = Options extends {
|
| 340 |
readonly toolkit: infer ToolkitValue;
|
| 341 |
} ? ExtractToolsFromToolkitOption<Exclude<ToolkitValue, undefined>> : {};
|
| 342 |
+
type ExtractErrorFromToolkitOption<ToolkitValue, DisableToolCallResolution extends boolean> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? AiError.AiError | (DisableToolCallResolution extends true ? never : Tool.HandlerError<Tools[keyof Tools]>) : ToolkitValue extends Effect.Effect<Toolkit.WithHandler<infer _Tools>, infer E, infer _R> ? AiError.AiError | E | (DisableToolCallResolution extends true ? never : Tool.HandlerError<_Tools[keyof _Tools]>) : AiError.AiError;
|
| 343 |
+
type ExtractServicesFromToolkitOption<ToolkitValue> = ToolkitValue extends Toolkit.WithHandler<infer Tools> ? Tool.HandlerServices<Tools[keyof Tools]> | Tool.ResultDecodingServices<Tools[keyof Tools]> : ToolkitValue extends Effect.Effect<Toolkit.WithHandler<infer Tools>, infer _E, infer R> ? Tool.HandlerServices<Tools[keyof Tools]> | Tool.ResultDecodingServices<Tools[keyof Tools]> | R : never;
|
| 344 |
/**
|
| 345 |
* Utility type that extracts the error type from LanguageModel options.
|
| 346 |
*
|
| 347 |
+
* **Details**
|
| 348 |
+
*
|
| 349 |
* Automatically infers the possible error types based on toolkit configuration
|
| 350 |
* and tool call resolution settings.
|
| 351 |
*
|
|
|
|
| 352 |
* @category utility types
|
| 353 |
+
* @since 4.0.0
|
| 354 |
*/
|
| 355 |
export type ExtractError<Options> = Options extends {
|
| 356 |
readonly disableToolCallResolution: true;
|
|
|
|
| 363 |
/**
|
| 364 |
* Utility type that extracts the context requirements from LanguageModel options.
|
| 365 |
*
|
| 366 |
+
* **Details**
|
| 367 |
+
*
|
| 368 |
* Automatically infers the required services based on the toolkit configuration.
|
| 369 |
*
|
|
|
|
| 370 |
* @category utility types
|
| 371 |
+
* @since 4.0.0
|
| 372 |
*/
|
| 373 |
export type ExtractServices<Options> = Options extends {
|
| 374 |
readonly disableToolCallResolution: true;
|
|
|
|
| 376 |
readonly toolkit: infer Toolkit;
|
| 377 |
} ? ExtractServicesFromToolkitOption<Exclude<Toolkit, undefined>> : never;
|
| 378 |
/**
|
| 379 |
+
* Configuration options passed along to language model provider implementations.
|
| 380 |
+
*
|
| 381 |
+
* **Details**
|
| 382 |
*
|
| 383 |
* This interface defines the normalized options that are passed to the
|
| 384 |
* underlying provider implementation, regardless of the specific provider being
|
| 385 |
* used.
|
| 386 |
*
|
| 387 |
+
* @category options
|
| 388 |
* @since 4.0.0
|
|
|
|
| 389 |
*/
|
| 390 |
export interface ProviderOptions {
|
| 391 |
/**
|
|
|
|
| 398 |
*/
|
| 399 |
readonly tools: ReadonlyArray<Tool.Any>;
|
| 400 |
/**
|
| 401 |
+
* The format the response should be provided in.
|
|
|
|
|
|
|
|
|
|
| 402 |
*
|
| 403 |
+
* **Details**
|
|
|
|
| 404 |
*
|
| 405 |
+
* If `"text"` is specified, the large language model response is returned as
|
| 406 |
+
* text. If `"json"` is specified, the large language model response is
|
| 407 |
+
* provided as a JSON object that conforms to the shape of the specified schema.
|
| 408 |
+
* The default is `{ type: "text" }`.
|
| 409 |
*/
|
| 410 |
readonly responseFormat: {
|
| 411 |
readonly type: "text";
|
|
|
|
| 444 |
readonly incrementalPrompt: Prompt.Prompt | undefined;
|
| 445 |
}
|
| 446 |
/**
|
| 447 |
+
* Creates a LanguageModel service from provider-specific text generation and
|
| 448 |
+
* streaming implementations.
|
| 449 |
*
|
| 450 |
+
* **When to use**
|
| 451 |
+
*
|
| 452 |
+
* Use when you are implementing a provider adapter and need to expose the
|
| 453 |
+
* standard language-model service while keeping provider-specific request hooks
|
| 454 |
+
* behind it.
|
| 455 |
+
*
|
| 456 |
+
* **Details**
|
| 457 |
+
*
|
| 458 |
+
* The returned service implements `generateText`, `generateObject`, and
|
| 459 |
+
* `streamText`. It prepares `ProviderOptions` for each request, including the
|
| 460 |
+
* normalized prompt, tools, tool choice, response format, tracing span, and
|
| 461 |
+
* incremental response fields, before calling the supplied provider hook.
|
| 462 |
+
* Structured object generation uses the `generateText` hook and the configured
|
| 463 |
+
* `codecTransformer`, or `defaultCodecTransformer` when none is supplied.
|
| 464 |
+
*
|
| 465 |
+
* **Gotchas**
|
| 466 |
+
*
|
| 467 |
+
* Provider hooks must return encoded response parts that match the toolkit and
|
| 468 |
+
* response format prepared in `ProviderOptions`; invalid parts fail decoding as
|
| 469 |
+
* `AiError.InvalidOutputError`.
|
| 470 |
+
*
|
| 471 |
+
* @see {@link Service} for the returned service contract
|
| 472 |
+
* @see {@link ProviderOptions} for the normalized options passed to provider hooks
|
| 473 |
+
* @see {@link defaultCodecTransformer} for the default structured-output schema transformer
|
| 474 |
*
|
|
|
|
| 475 |
* @category constructors
|
| 476 |
+
* @since 4.0.0
|
| 477 |
*/
|
| 478 |
export declare const make: (params: {
|
| 479 |
/**
|
| 480 |
+
* A method that requests text generation from the large language model provider and returns the final result when generation finishes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
*/
|
| 482 |
readonly generateText: (options: ProviderOptions) => Effect.Effect<Array<Response.PartEncoded>, AiError.AiError, IdGenerator>;
|
| 483 |
/**
|
| 484 |
+
* A method that requests text generation from the large language model provider and streams intermediate results.
|
|
|
|
|
|
|
|
|
|
| 485 |
*/
|
| 486 |
readonly streamText: (options: ProviderOptions) => Stream.Stream<Response.StreamPartEncoded, AiError.AiError, IdGenerator>;
|
| 487 |
/**
|
|
|
|
| 491 |
readonly codecTransformer?: CodecTransformer | undefined;
|
| 492 |
}) => Effect.Effect<Service>;
|
| 493 |
/**
|
| 494 |
+
* Generates text using a language model.
|
| 495 |
+
*
|
| 496 |
+
* **Example** (Generating text with options)
|
| 497 |
*
|
|
|
|
| 498 |
* ```ts
|
| 499 |
* import { Effect } from "effect"
|
| 500 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 512 |
* })
|
| 513 |
* ```
|
| 514 |
*
|
|
|
|
| 515 |
* @category text generation
|
| 516 |
+
* @since 4.0.0
|
| 517 |
*/
|
| 518 |
export declare const generateText: {
|
| 519 |
<Options extends NoExcessProperties<GenerateTextOptionsWithoutToolkit, Options>>(options: Options & GenerateTextOptionsWithoutToolkit): Effect.Effect<GenerateTextResponse<{}>, ExtractError<Options>, LanguageModel | ExtractServices<Options>>;
|
|
|
|
| 529 |
}): Effect.Effect<GenerateTextResponse<ExtractTools<Options>>, ExtractError<Options>, ExtractServices<Options> | LanguageModel>;
|
| 530 |
};
|
| 531 |
/**
|
| 532 |
+
* Generates a structured object from a schema using a language model.
|
| 533 |
+
*
|
| 534 |
+
* **Example** (Generating an object)
|
| 535 |
*
|
|
|
|
| 536 |
* ```ts
|
| 537 |
* import { Effect, Schema } from "effect"
|
| 538 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 558 |
* })
|
| 559 |
* ```
|
| 560 |
*
|
|
|
|
| 561 |
* @category object generation
|
| 562 |
+
* @since 4.0.0
|
| 563 |
*/
|
| 564 |
export declare const generateObject: <ObjectEncoded extends Record<string, any>, StructuredOutputSchema extends Schema.Encoder<ObjectEncoded, unknown>, Options extends NoExcessProperties<GenerateObjectOptions<any, StructuredOutputSchema>, Options>>(options: Options & GenerateObjectOptions<ExtractTools<Options>, StructuredOutputSchema>) => Effect.Effect<GenerateObjectResponse<ExtractTools<Options>, StructuredOutputSchema["Type"]>, ExtractError<Options>, ExtractServices<Options> | StructuredOutputSchema["DecodingServices"] | LanguageModel>;
|
| 565 |
/**
|
| 566 |
+
* Generates text using a language model with streaming output.
|
| 567 |
+
*
|
| 568 |
+
* **Details**
|
| 569 |
*
|
| 570 |
* Returns a stream of response parts that are emitted as soon as they are
|
| 571 |
* available from the model, enabling real-time text generation experiences.
|
| 572 |
*
|
| 573 |
+
* **Example** (Streaming text deltas)
|
| 574 |
+
*
|
| 575 |
* ```ts
|
| 576 |
* import { Console, Effect, Stream } from "effect"
|
| 577 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 586 |
* }))
|
| 587 |
* ```
|
| 588 |
*
|
|
|
|
| 589 |
* @category text generation
|
| 590 |
+
* @since 4.0.0
|
| 591 |
*/
|
| 592 |
export declare const streamText: {
|
| 593 |
<Options extends NoExcessProperties<GenerateTextOptionsWithoutToolkit, Options>>(options: Options & GenerateTextOptionsWithoutToolkit): Stream.Stream<Response.StreamPart<{}>, ExtractError<Options>, ExtractServices<Options> | LanguageModel>;
|
.opencode/node_modules/effect/dist/unstable/ai/LanguageModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"LanguageModel.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/LanguageModel.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAGzC,OAAO,KAAK,KAAK,UAAU,MAAM,qBAAqB,CAAA;AAKtD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAGzC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAA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d,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAC1B,YAAY,CAAC,OAAO,CAAC,EACrB,eAAe,CAAC,OAAO,CAAC,GAAG,aAAa,CACzC,CAAA;IAED,CACE,OAAO,SAAS;QACd,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;KACrC,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAEzD,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;KAAE,GACvG,MAAM,CAAC,MAAM,CACd,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAC1C,YAAY,CAAC,OAAO,CAAC,EACrB,eAAe,CAAC,OAAO,CAAC,GAAG,aAAa,CACzC,CAAA;CASQ,CAAA"}
|
.opencode/node_modules/effect/dist/unstable/ai/LanguageModel.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as Predicate from "../../Predicate.js";
|
|
| 7 |
import * as Queue from "../../Queue.js";
|
| 8 |
import { CurrentConcurrency } from "../../References.js";
|
| 9 |
import * as Schema from "../../Schema.js";
|
| 10 |
-
import * as
|
| 11 |
import * as Sink from "../../Sink.js";
|
| 12 |
import * as Stream from "../../Stream.js";
|
| 13 |
import * as AiError from "./AiError.js";
|
|
@@ -22,13 +22,15 @@ import * as Toolkit from "./Toolkit.js";
|
|
| 22 |
// Service Definition
|
| 23 |
// =============================================================================
|
| 24 |
/**
|
| 25 |
-
*
|
| 26 |
*
|
| 27 |
-
*
|
| 28 |
-
*
|
| 29 |
-
*
|
|
|
|
|
|
|
|
|
|
| 30 |
*
|
| 31 |
-
* @example
|
| 32 |
* ```ts
|
| 33 |
* import { Effect } from "effect"
|
| 34 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -42,26 +44,37 @@ import * as Toolkit from "./Toolkit.js";
|
|
| 42 |
* })
|
| 43 |
* ```
|
| 44 |
*
|
| 45 |
-
* @since 4.0.0
|
| 46 |
* @category services
|
|
|
|
| 47 |
*/
|
| 48 |
export class LanguageModel extends /*#__PURE__*/Context.Service()("effect/unstable/ai/LanguageModel") {}
|
| 49 |
/**
|
| 50 |
* The default codec transformer that passes schemas through without
|
| 51 |
* provider-specific rewrites.
|
| 52 |
*
|
| 53 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
* @category services
|
|
|
|
| 55 |
*/
|
| 56 |
export const defaultCodecTransformer = InternalCodecTransformer.defaultCodecTransformer;
|
| 57 |
/**
|
| 58 |
-
* Response class for text generation operations.
|
| 59 |
*
|
| 60 |
-
*
|
| 61 |
-
* extracting different types of response parts like text, tool calls, and usage
|
| 62 |
-
* information.
|
| 63 |
*
|
| 64 |
-
* @example
|
| 65 |
* ```ts
|
| 66 |
* import { Effect } from "effect"
|
| 67 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -79,8 +92,8 @@ export const defaultCodecTransformer = InternalCodecTransformer.defaultCodecTran
|
|
| 79 |
* })
|
| 80 |
* ```
|
| 81 |
*
|
| 82 |
-
* @since 4.0.0
|
| 83 |
* @category models
|
|
|
|
| 84 |
*/
|
| 85 |
export class GenerateTextResponse {
|
| 86 |
content;
|
|
@@ -162,7 +175,8 @@ export class GenerateTextResponse {
|
|
| 162 |
/**
|
| 163 |
* Response class for structured object generation operations.
|
| 164 |
*
|
| 165 |
-
*
|
|
|
|
| 166 |
* ```ts
|
| 167 |
* import { Effect, Schema } from "effect"
|
| 168 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -185,8 +199,8 @@ export class GenerateTextResponse {
|
|
| 185 |
* })
|
| 186 |
* ```
|
| 187 |
*
|
| 188 |
-
* @since 4.0.0
|
| 189 |
* @category models
|
|
|
|
| 190 |
*/
|
| 191 |
export class GenerateObjectResponse extends GenerateTextResponse {
|
| 192 |
/**
|
|
@@ -199,13 +213,36 @@ export class GenerateObjectResponse extends GenerateTextResponse {
|
|
| 199 |
}
|
| 200 |
}
|
| 201 |
/**
|
| 202 |
-
* Creates a LanguageModel service from provider-specific
|
|
|
|
| 203 |
*
|
| 204 |
-
*
|
| 205 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
*
|
| 207 |
-
* @since 4.0.0
|
| 208 |
* @category constructors
|
|
|
|
| 209 |
*/
|
| 210 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
| 211 |
const codecTransformer = params.codecTransformer ?? defaultCodecTransformer;
|
|
@@ -731,9 +768,10 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
|
| 731 |
// Accessors
|
| 732 |
// =============================================================================
|
| 733 |
/**
|
| 734 |
-
*
|
|
|
|
|
|
|
| 735 |
*
|
| 736 |
-
* @example
|
| 737 |
* ```ts
|
| 738 |
* import { Effect } from "effect"
|
| 739 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -751,14 +789,15 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
|
| 751 |
* })
|
| 752 |
* ```
|
| 753 |
*
|
| 754 |
-
* @since 4.0.0
|
| 755 |
* @category text generation
|
|
|
|
| 756 |
*/
|
| 757 |
export const generateText = options => Effect.flatMap(Effect.service(LanguageModel), model => model.generateText(options));
|
| 758 |
/**
|
| 759 |
-
*
|
|
|
|
|
|
|
| 760 |
*
|
| 761 |
-
* @example
|
| 762 |
* ```ts
|
| 763 |
* import { Effect, Schema } from "effect"
|
| 764 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -784,17 +823,20 @@ export const generateText = options => Effect.flatMap(Effect.service(LanguageMod
|
|
| 784 |
* })
|
| 785 |
* ```
|
| 786 |
*
|
| 787 |
-
* @since 4.0.0
|
| 788 |
* @category object generation
|
|
|
|
| 789 |
*/
|
| 790 |
export const generateObject = options => Effect.flatMap(Effect.service(LanguageModel), model => model.generateObject(options));
|
| 791 |
/**
|
| 792 |
-
*
|
|
|
|
|
|
|
| 793 |
*
|
| 794 |
* Returns a stream of response parts that are emitted as soon as they are
|
| 795 |
* available from the model, enabling real-time text generation experiences.
|
| 796 |
*
|
| 797 |
-
*
|
|
|
|
| 798 |
* ```ts
|
| 799 |
* import { Console, Effect, Stream } from "effect"
|
| 800 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
@@ -809,8 +851,8 @@ export const generateObject = options => Effect.flatMap(Effect.service(LanguageM
|
|
| 809 |
* }))
|
| 810 |
* ```
|
| 811 |
*
|
| 812 |
-
* @since 4.0.0
|
| 813 |
* @category text generation
|
|
|
|
| 814 |
*/
|
| 815 |
export const streamText = options => Stream.unwrap(Effect.map(Effect.service(LanguageModel), model => model.streamText(options)));
|
| 816 |
const collectToolApprovals = (messages, options) => {
|
|
@@ -1049,7 +1091,7 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
| 1049 |
// =============================================================================
|
| 1050 |
// Utilities
|
| 1051 |
// =============================================================================
|
| 1052 |
-
const resolveToolkit = toolkit =>
|
| 1053 |
/** @internal */
|
| 1054 |
export const getObjectName = (objectName, schema) => {
|
| 1055 |
if (Predicate.isNotUndefined(objectName)) {
|
|
@@ -1058,7 +1100,7 @@ export const getObjectName = (objectName, schema) => {
|
|
| 1058 |
if ("identifier" in schema && typeof schema.identifier === "string") {
|
| 1059 |
return schema.identifier;
|
| 1060 |
}
|
| 1061 |
-
const identifier =
|
| 1062 |
if (typeof identifier === "string") {
|
| 1063 |
return identifier;
|
| 1064 |
}
|
|
|
|
| 7 |
import * as Queue from "../../Queue.js";
|
| 8 |
import { CurrentConcurrency } from "../../References.js";
|
| 9 |
import * as Schema from "../../Schema.js";
|
| 10 |
+
import * as SchemaAST from "../../SchemaAST.js";
|
| 11 |
import * as Sink from "../../Sink.js";
|
| 12 |
import * as Stream from "../../Stream.js";
|
| 13 |
import * as AiError from "./AiError.js";
|
|
|
|
| 22 |
// Service Definition
|
| 23 |
// =============================================================================
|
| 24 |
/**
|
| 25 |
+
* Service tag for AI model services.
|
| 26 |
*
|
| 27 |
+
* **When to use**
|
| 28 |
+
*
|
| 29 |
+
* Use to access or provide text generation, streaming generation, structured
|
| 30 |
+
* output, and tool-calling capabilities through the Effect context.
|
| 31 |
+
*
|
| 32 |
+
* **Example** (Accessing the language model service)
|
| 33 |
*
|
|
|
|
| 34 |
* ```ts
|
| 35 |
* import { Effect } from "effect"
|
| 36 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 44 |
* })
|
| 45 |
* ```
|
| 46 |
*
|
|
|
|
| 47 |
* @category services
|
| 48 |
+
* @since 4.0.0
|
| 49 |
*/
|
| 50 |
export class LanguageModel extends /*#__PURE__*/Context.Service()("effect/unstable/ai/LanguageModel") {}
|
| 51 |
/**
|
| 52 |
* The default codec transformer that passes schemas through without
|
| 53 |
* provider-specific rewrites.
|
| 54 |
*
|
| 55 |
+
* **When to use**
|
| 56 |
+
*
|
| 57 |
+
* Use as the codec transformer for provider implementations when the provider
|
| 58 |
+
* accepts the JSON Schema generated from an `Effect` Schema codec without
|
| 59 |
+
* provider-specific rewrites.
|
| 60 |
+
*
|
| 61 |
+
* **Details**
|
| 62 |
+
*
|
| 63 |
+
* The transformer returns the original codec, resolves a top-level `$ref`, and
|
| 64 |
+
* copies schema definitions into `$defs`.
|
| 65 |
+
*
|
| 66 |
+
* @see {@link CodecTransformer} for the structured-output transformer contract
|
| 67 |
+
* @see {@link make} for where this transformer is used as the default
|
| 68 |
+
*
|
| 69 |
* @category services
|
| 70 |
+
* @since 4.0.0
|
| 71 |
*/
|
| 72 |
export const defaultCodecTransformer = InternalCodecTransformer.defaultCodecTransformer;
|
| 73 |
/**
|
| 74 |
+
* Response class for text generation operations, with accessors for extracting text, tool calls, usage information, and other response parts from generated content.
|
| 75 |
*
|
| 76 |
+
* **Example** (Inspecting a text response)
|
|
|
|
|
|
|
| 77 |
*
|
|
|
|
| 78 |
* ```ts
|
| 79 |
* import { Effect } from "effect"
|
| 80 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 92 |
* })
|
| 93 |
* ```
|
| 94 |
*
|
|
|
|
| 95 |
* @category models
|
| 96 |
+
* @since 4.0.0
|
| 97 |
*/
|
| 98 |
export class GenerateTextResponse {
|
| 99 |
content;
|
|
|
|
| 175 |
/**
|
| 176 |
* Response class for structured object generation operations.
|
| 177 |
*
|
| 178 |
+
* **Example** (Inspecting an object response)
|
| 179 |
+
*
|
| 180 |
* ```ts
|
| 181 |
* import { Effect, Schema } from "effect"
|
| 182 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 199 |
* })
|
| 200 |
* ```
|
| 201 |
*
|
|
|
|
| 202 |
* @category models
|
| 203 |
+
* @since 4.0.0
|
| 204 |
*/
|
| 205 |
export class GenerateObjectResponse extends GenerateTextResponse {
|
| 206 |
/**
|
|
|
|
| 213 |
}
|
| 214 |
}
|
| 215 |
/**
|
| 216 |
+
* Creates a LanguageModel service from provider-specific text generation and
|
| 217 |
+
* streaming implementations.
|
| 218 |
*
|
| 219 |
+
* **When to use**
|
| 220 |
+
*
|
| 221 |
+
* Use when you are implementing a provider adapter and need to expose the
|
| 222 |
+
* standard language-model service while keeping provider-specific request hooks
|
| 223 |
+
* behind it.
|
| 224 |
+
*
|
| 225 |
+
* **Details**
|
| 226 |
+
*
|
| 227 |
+
* The returned service implements `generateText`, `generateObject`, and
|
| 228 |
+
* `streamText`. It prepares `ProviderOptions` for each request, including the
|
| 229 |
+
* normalized prompt, tools, tool choice, response format, tracing span, and
|
| 230 |
+
* incremental response fields, before calling the supplied provider hook.
|
| 231 |
+
* Structured object generation uses the `generateText` hook and the configured
|
| 232 |
+
* `codecTransformer`, or `defaultCodecTransformer` when none is supplied.
|
| 233 |
+
*
|
| 234 |
+
* **Gotchas**
|
| 235 |
+
*
|
| 236 |
+
* Provider hooks must return encoded response parts that match the toolkit and
|
| 237 |
+
* response format prepared in `ProviderOptions`; invalid parts fail decoding as
|
| 238 |
+
* `AiError.InvalidOutputError`.
|
| 239 |
+
*
|
| 240 |
+
* @see {@link Service} for the returned service contract
|
| 241 |
+
* @see {@link ProviderOptions} for the normalized options passed to provider hooks
|
| 242 |
+
* @see {@link defaultCodecTransformer} for the default structured-output schema transformer
|
| 243 |
*
|
|
|
|
| 244 |
* @category constructors
|
| 245 |
+
* @since 4.0.0
|
| 246 |
*/
|
| 247 |
export const make = /*#__PURE__*/Effect.fnUntraced(function* (params) {
|
| 248 |
const codecTransformer = params.codecTransformer ?? defaultCodecTransformer;
|
|
|
|
| 768 |
// Accessors
|
| 769 |
// =============================================================================
|
| 770 |
/**
|
| 771 |
+
* Generates text using a language model.
|
| 772 |
+
*
|
| 773 |
+
* **Example** (Generating text with options)
|
| 774 |
*
|
|
|
|
| 775 |
* ```ts
|
| 776 |
* import { Effect } from "effect"
|
| 777 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 789 |
* })
|
| 790 |
* ```
|
| 791 |
*
|
|
|
|
| 792 |
* @category text generation
|
| 793 |
+
* @since 4.0.0
|
| 794 |
*/
|
| 795 |
export const generateText = options => Effect.flatMap(Effect.service(LanguageModel), model => model.generateText(options));
|
| 796 |
/**
|
| 797 |
+
* Generates a structured object from a schema using a language model.
|
| 798 |
+
*
|
| 799 |
+
* **Example** (Generating an object)
|
| 800 |
*
|
|
|
|
| 801 |
* ```ts
|
| 802 |
* import { Effect, Schema } from "effect"
|
| 803 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 823 |
* })
|
| 824 |
* ```
|
| 825 |
*
|
|
|
|
| 826 |
* @category object generation
|
| 827 |
+
* @since 4.0.0
|
| 828 |
*/
|
| 829 |
export const generateObject = options => Effect.flatMap(Effect.service(LanguageModel), model => model.generateObject(options));
|
| 830 |
/**
|
| 831 |
+
* Generates text using a language model with streaming output.
|
| 832 |
+
*
|
| 833 |
+
* **Details**
|
| 834 |
*
|
| 835 |
* Returns a stream of response parts that are emitted as soon as they are
|
| 836 |
* available from the model, enabling real-time text generation experiences.
|
| 837 |
*
|
| 838 |
+
* **Example** (Streaming text deltas)
|
| 839 |
+
*
|
| 840 |
* ```ts
|
| 841 |
* import { Console, Effect, Stream } from "effect"
|
| 842 |
* import { LanguageModel } from "effect/unstable/ai"
|
|
|
|
| 851 |
* }))
|
| 852 |
* ```
|
| 853 |
*
|
|
|
|
| 854 |
* @category text generation
|
| 855 |
+
* @since 4.0.0
|
| 856 |
*/
|
| 857 |
export const streamText = options => Stream.unwrap(Effect.map(Effect.service(LanguageModel), model => model.streamText(options)));
|
| 858 |
const collectToolApprovals = (messages, options) => {
|
|
|
|
| 1091 |
// =============================================================================
|
| 1092 |
// Utilities
|
| 1093 |
// =============================================================================
|
| 1094 |
+
const resolveToolkit = toolkit => Effect.isEffect(toolkit) ? toolkit : Effect.succeed(toolkit);
|
| 1095 |
/** @internal */
|
| 1096 |
export const getObjectName = (objectName, schema) => {
|
| 1097 |
if (Predicate.isNotUndefined(objectName)) {
|
|
|
|
| 1100 |
if ("identifier" in schema && typeof schema.identifier === "string") {
|
| 1101 |
return schema.identifier;
|
| 1102 |
}
|
| 1103 |
+
const identifier = SchemaAST.resolveIdentifier(schema.ast);
|
| 1104 |
if (typeof identifier === "string") {
|
| 1105 |
return identifier;
|
| 1106 |
}
|
.opencode/node_modules/effect/dist/unstable/ai/LanguageModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"LanguageModel.js","names":["Context","Effect","FiberSet","constFalse","identity","pipe","Option","Predicate","Queue","CurrentConcurrency","Schema","AST","Sink","Stream","AiError","defaultIdGenerator","IdGenerator","InternalCodecTransformer","Prompt","Response","ResponseIdTracker","CurrentSpanTransformer","Toolkit","LanguageModel","Service","defaultCodecTransformer","GenerateTextResponse","content","constructor","text","part","type","push","join","reasoning","filter","reasoningText","length","undefined","toolCalls","toolResults","finishReason","finishPart","find","isUndefined","reason","usage","Usage","inputTokens","uncached","total","cacheRead","cacheWrite","outputTokens","GenerateObjectResponse","value","make","fnUntraced","params","codecTransformer","parentSpanTransformer","serviceOption","getSpanTransformer","map","orElse","idGenerator","getOrElse","generateText","options","useSpan","attributes","concurrency","toolChoice","span","spanTransformer","providerOptions","prompt","tools","responseFormat","previousResponseId","incrementalPrompt","generateContent","applySpanTransformer","catchTag","error","fail","module","method","InvalidOutputError","fromSchemaError","effect","withParentSpan","captureStackTrace","provideService","generateObject","objectName","getObjectName","schema","codec","try","catch","UnsupportedSchemaError","description","Error","message","String","resolveStructuredOutput","streamText","makeSpanScoped","stream","streamContent","isNone","mapArray","parts","ensuring","sync","response","unwrap","mapError","isSchemaError","tracker","getOrUndefined","generateWithNonIncrementalFallback","requestOptions","fallbackPrompt","fallbackOptions","catchReason","_","approved","denied","collectToolApprovals","excludeResolved","hasPendingApprovals","toolkit","ToolkitRequiredError","pendingApprovals","result","toolCall","name","isNotUndefined","prepared","prepareUnsafe","isSome","ResponseSchema","mutable","Array","Part","empty","rawContent","decodeEffect","responseMetadata","id","markParts","resolveToolkit","Object","values","approval","ToolNotFoundError","toolName","availableTools","keys","approvedResults","executeApprovedToolCalls","deniedResults","createDenialResults","preResolvedResults","fromMessages","makeMessage","allResolved","allDenied","stripResolvedApprovals","tool","oneOf","includes","disableToolCallResolution","resolveToolCalls","preliminary","runCollect","streamWithNonIncrementalFallback","pendingApproved","pendingDenied","a","NonEmptyArray","StreamPart","decodeParts","mapArrayEffect","tap","decodedParts","void","preResolvedStreamParts","r","makePart","providerExecuted","encodedResult","isFailure","queue","deferredFinishParts","offerAll","toolCallFibers","handleToolCall","needsApproval","isApprovalNeeded","idGen","approvalId","generateId","approvalPart","toolCallId","offer","handle","runForEach","toolResultPart","runForEachArray","chunk","immediateParts","run","andThen","raceFirst","awaitEmpty","end","tapCause","cause","failCause","forkScoped","fromQueue","flatMap","service","model","messages","requests","Map","responses","toolCallsById","toolResultIds","Set","role","set","add","request","get","has","resolvedApprovalIds","d","cleanedMessages","filteredContent","decodeUnknownEffect","parametersSchema","isEffect","orElseSucceed","approvals","executeTool","die","resultStream","terminalResult","last","match","onNone","onSome","succeed","gen","resolveConcurrency","forEach","denials","results","denial","approvedToolCallIds","deniedByToolCallId","streams","generator","mergeAll","asEffect","identifier","resolveIdentifier","ast","texts","StructuredOutputError","responseText","decode","fromJsonString","transformer"],"sources":["../../../src/unstable/ai/LanguageModel.ts"],"sourcesContent":[null],"mappings":"AAmDA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,QAAQ,MAAM,mBAAmB;AAC7C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,mBAAmB;AAE9D,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,GAAG,MAAM,oBAAoB;AACzC,OAAO,KAAKC,IAAI,MAAM,eAAe;AACrC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAGzC,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,kBAAkB;AAClE,OAAO,KAAKC,wBAAwB,MAAM,iCAAiC;AAC3E,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,iBAAiB,MAAM,wBAAwB;AAE3D,SAASC,sBAAsB,QAAQ,gBAAgB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O,CAAC0C,IAAI,CAAC;MACzB8B,MAAM,EAAE,eAAe;MACvBC,MAAM,EAAE,gBAAgB;MACxB1C,MAAM,EAAE,IAAI/B,OAAO,CAACoQ,qBAAqB,CAAC;QACxC5K,WAAW,EAAE,6BAA6B;QAC1C6K,YAAY,EAAEtP;OACf;KACF,CAAC;EACJ;EAEA,MAAMuP,MAAM,GAAG1Q,MAAM,CAAC2I,YAAY,CAAC3I,MAAM,CAAC2Q,cAAc,CAACpL,MAAM,CAAC,CAAC;EACjE,OAAO,OAAOhG,MAAM,CAACqH,QAAQ,CAAC8J,MAAM,CAACvP,IAAI,CAAC,EAAGuD,KAAK,IAChDtE,OAAO,CAAC0C,IAAI,CAAC;IACX8B,MAAM,EAAE,eAAe;IACvBC,MAAM,EAAE,gBAAgB;IACxB1C,MAAM,EAAE/B,OAAO,CAACoQ,qBAAqB,CAACzL,eAAe,CAACL,KAAK,EAAEvD,IAAI;GAClE,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAMqD,oBAAoB,GAAGA,CAC3BoM,WAA2C,EAC3ClK,QAA+C,EAC/ChD,OAAwB,KAChB;EACR,IAAI9D,MAAM,CAACwI,MAAM,CAACwI,WAAW,CAAC,EAAE;IAC9BA,WAAW,CAAC/N,KAAK,CAAC;MAAE,GAAGa,OAAO;MAAEgD,QAAQ,EAAEA;IAAe,CAAE,CAAC;EAC9D;AACF,CAAC","ignoreList":[]}
|
|
|
|
| 1 |
+
{"version":3,"file":"LanguageModel.js","names":["Context","Effect","FiberSet","constFalse","identity","pipe","Option","Predicate","Queue","CurrentConcurrency","Schema","SchemaAST","Sink","Stream","AiError","defaultIdGenerator","IdGenerator","InternalCodecTransformer","Prompt","Response","ResponseIdTracker","CurrentSpanTransformer","Toolkit","LanguageModel","Service","defaultCodecTransformer","GenerateTextResponse","content","constructor","text","part","type","push","join","reasoning","filter","reasoningText","length","undefined","toolCalls","toolResults","finishReason","finishPart","find","isUndefined","reason","usage","Usage","inputTokens","uncached","total","cacheRead","cacheWrite","outputTokens","GenerateObjectResponse","value","make","fnUntraced","params","codecTransformer","parentSpanTransformer","serviceOption","getSpanTransformer","map","orElse","idGenerator","getOrElse","generateText","options","useSpan","attributes","concurrency","toolChoice","span","spanTransformer","providerOptions","prompt","tools","responseFormat","previousResponseId","incrementalPrompt","generateContent","applySpanTransformer","catchTag","error","fail","module","method","InvalidOutputError","fromSchemaError","effect","withParentSpan","captureStackTrace","provideService","generateObject","objectName","getObjectName","schema","codec","try","catch","UnsupportedSchemaError","description","Error","message","String","resolveStructuredOutput","streamText","makeSpanScoped","stream","streamContent","isNone","mapArray","parts","ensuring","sync","response","unwrap","mapError","isSchemaError","tracker","getOrUndefined","generateWithNonIncrementalFallback","requestOptions","fallbackPrompt","fallbackOptions","catchReason","_","approved","denied","collectToolApprovals","excludeResolved","hasPendingApprovals","toolkit","ToolkitRequiredError","pendingApprovals","result","toolCall","name","isNotUndefined","prepared","prepareUnsafe","isSome","ResponseSchema","mutable","Array","Part","empty","rawContent","decodeEffect","responseMetadata","id","markParts","resolveToolkit","Object","values","approval","ToolNotFoundError","toolName","availableTools","keys","approvedResults","executeApprovedToolCalls","deniedResults","createDenialResults","preResolvedResults","fromMessages","makeMessage","allResolved","allDenied","stripResolvedApprovals","tool","oneOf","includes","disableToolCallResolution","resolveToolCalls","preliminary","runCollect","streamWithNonIncrementalFallback","pendingApproved","pendingDenied","a","NonEmptyArray","StreamPart","decodeParts","mapArrayEffect","tap","decodedParts","void","preResolvedStreamParts","r","makePart","providerExecuted","encodedResult","isFailure","queue","deferredFinishParts","offerAll","toolCallFibers","handleToolCall","needsApproval","isApprovalNeeded","idGen","approvalId","generateId","approvalPart","toolCallId","offer","handle","runForEach","toolResultPart","runForEachArray","chunk","immediateParts","run","andThen","raceFirst","awaitEmpty","end","tapCause","cause","failCause","forkScoped","fromQueue","flatMap","service","model","messages","requests","Map","responses","toolCallsById","toolResultIds","Set","role","set","add","request","get","has","resolvedApprovalIds","d","cleanedMessages","filteredContent","decodeUnknownEffect","parametersSchema","isEffect","orElseSucceed","approvals","executeTool","die","resultStream","terminalResult","last","match","onNone","onSome","succeed","gen","resolveConcurrency","forEach","denials","results","denial","approvedToolCallIds","deniedByToolCallId","streams","generator","mergeAll","identifier","resolveIdentifier","ast","texts","StructuredOutputError","responseText","decode","fromJsonString","transformer"],"sources":["../../../src/unstable/ai/LanguageModel.ts"],"sourcesContent":[null],"mappings":"AAcA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,QAAQ,MAAM,mBAAmB;AAC7C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,mBAAmB;AAE9D,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,IAAI,MAAM,eAAe;AACrC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAGzC,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,kBAAkB;AAClE,OAAO,KAAKC,wBAAwB,MAAM,iCAAiC;AAC3E,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,iBAAiB,MAAM,wBAAwB;AAE3D,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAM,MAAOC,aAAc,sBAAQvB,OAAO,CAACwB,OAAO,EAA0B,CAC1E,kCAAkC,CACnC;AA8HD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qB,CAAC;QACxC3K,WAAW,EAAE,6BAA6B;QAC1C4K,YAAY,EAAErP;OACf;KACF,CAAC;EACJ;EAEA,MAAMsP,MAAM,GAAGzQ,MAAM,CAAC2I,YAAY,CAAC3I,MAAM,CAAC0Q,cAAc,CAACnL,MAAM,CAAC,CAAC;EACjE,OAAO,OAAOhG,MAAM,CAACqH,QAAQ,CAAC6J,MAAM,CAACtP,IAAI,CAAC,EAAGuD,KAAK,IAChDtE,OAAO,CAAC0C,IAAI,CAAC;IACX8B,MAAM,EAAE,eAAe;IACvBC,MAAM,EAAE,gBAAgB;IACxB1C,MAAM,EAAE/B,OAAO,CAACmQ,qBAAqB,CAACxL,eAAe,CAACL,KAAK,EAAEvD,IAAI;GAClE,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAMqD,oBAAoB,GAAGA,CAC3BmM,WAA2C,EAC3CjK,QAA+C,EAC/ChD,OAAwB,KAChB;EACR,IAAI9D,MAAM,CAACwI,MAAM,CAACuI,WAAW,CAAC,EAAE;IAC9BA,WAAW,CAAC9N,KAAK,CAAC;MAAE,GAAGa,OAAO;MAAEgD,QAAQ,EAAEA;IAAe,CAAE,CAAC;EAC9D;AACF,CAAC","ignoreList":[]}
|
.opencode/node_modules/effect/dist/unstable/ai/McpSchema.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
| 1 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
* @since 4.0.0
|
| 3 |
*/
|
| 4 |
import * as Context from "../../Context.ts";
|
|
@@ -12,52 +21,76 @@ import type { RpcClientError } from "../rpc/RpcClientError.ts";
|
|
| 12 |
import * as RpcGroup from "../rpc/RpcGroup.ts";
|
| 13 |
import * as RpcMiddleware from "../rpc/RpcMiddleware.ts";
|
| 14 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
* @since 4.0.0
|
| 16 |
*/
|
| 17 |
export interface optionalWithDefault<S extends Schema.Top & Schema.WithoutConstructorDefault> extends Schema.withConstructorDefault<Schema.decodeTo<Schema.toType<Schema.optionalKey<S>>, Schema.optionalKey<S>>> {
|
| 18 |
}
|
| 19 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
* @since 4.0.0
|
| 21 |
*/
|
| 22 |
export declare const optionalWithDefault: <S extends Schema.Top & Schema.WithoutConstructorDefault>(schema: S, defaultValue: () => Schema.optionalKey<S>["Type"]) => optionalWithDefault<S>;
|
| 23 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
* @since 4.0.0
|
| 25 |
*/
|
| 26 |
export declare const optional: <S extends Schema.Top>(schema: S) => Schema.decodeTo<Schema.optional<S>, Schema.optionalKey<S>>;
|
| 27 |
/**
|
| 28 |
-
*
|
| 29 |
*
|
|
|
|
| 30 |
* @since 4.0.0
|
| 31 |
-
* @category common
|
| 32 |
*/
|
| 33 |
export declare const RequestId: Schema.Union<[
|
| 34 |
typeof Schema.String,
|
| 35 |
typeof Schema.Number
|
| 36 |
]>;
|
| 37 |
/**
|
| 38 |
-
*
|
| 39 |
*
|
|
|
|
| 40 |
* @since 4.0.0
|
| 41 |
-
* @category common
|
| 42 |
*/
|
| 43 |
export type RequestId = typeof RequestId.Type;
|
| 44 |
/**
|
| 45 |
-
*
|
| 46 |
-
* request.
|
| 47 |
*
|
|
|
|
| 48 |
* @since 4.0.0
|
| 49 |
-
* @category common
|
| 50 |
*/
|
| 51 |
export declare const ProgressToken: Schema.Union<[
|
| 52 |
typeof Schema.String,
|
| 53 |
typeof Schema.Number
|
| 54 |
]>;
|
| 55 |
/**
|
| 56 |
-
*
|
| 57 |
-
* request.
|
| 58 |
*
|
|
|
|
| 59 |
* @since 4.0.0
|
| 60 |
-
* @category common
|
| 61 |
*/
|
| 62 |
export type ProgressToken = typeof ProgressToken.Type;
|
| 63 |
declare const RequestMeta_base: Schema.Opaque<RequestMeta, Schema.Struct<{
|
|
@@ -102,8 +135,15 @@ declare const RequestMeta_base: Schema.Opaque<RequestMeta, Schema.Struct<{
|
|
| 102 |
}>>, never, never>;
|
| 103 |
}>, keyof Schema.Top>;
|
| 104 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
* @since 4.0.0
|
| 106 |
-
* @category common
|
| 107 |
*/
|
| 108 |
export declare class RequestMeta extends RequestMeta_base {
|
| 109 |
}
|
|
@@ -121,8 +161,15 @@ declare const ResultMeta_base: Schema.Opaque<ResultMeta, Schema.Struct<{
|
|
| 121 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 122 |
}>, keyof Schema.Top>;
|
| 123 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
* @since 4.0.0
|
| 125 |
-
* @category common
|
| 126 |
*/
|
| 127 |
export declare class ResultMeta extends ResultMeta_base {
|
| 128 |
}
|
|
@@ -140,21 +187,34 @@ declare const NotificationMeta_base: Schema.Opaque<NotificationMeta, Schema.Stru
|
|
| 140 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 141 |
}>, keyof Schema.Top>;
|
| 142 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
* @since 4.0.0
|
| 144 |
-
* @category common
|
| 145 |
*/
|
| 146 |
export declare class NotificationMeta extends NotificationMeta_base {
|
| 147 |
}
|
| 148 |
/**
|
| 149 |
-
*
|
| 150 |
*
|
|
|
|
| 151 |
* @since 4.0.0
|
| 152 |
-
* @category common
|
| 153 |
*/
|
| 154 |
export declare const Cursor: typeof Schema.String;
|
| 155 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
* @since 4.0.0
|
| 157 |
-
* @category common
|
| 158 |
*/
|
| 159 |
export type Cursor = typeof Cursor.Type;
|
| 160 |
declare const PaginatedRequestMeta_base: Schema.Opaque<PaginatedRequestMeta, Schema.Struct<{
|
|
@@ -209,8 +269,15 @@ declare const PaginatedRequestMeta_base: Schema.Opaque<PaginatedRequestMeta, Sch
|
|
| 209 |
}>>, never, never>;
|
| 210 |
}>, keyof Schema.Top>;
|
| 211 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
* @since 4.0.0
|
| 213 |
-
* @category common
|
| 214 |
*/
|
| 215 |
export declare class PaginatedRequestMeta extends PaginatedRequestMeta_base {
|
| 216 |
}
|
|
@@ -238,20 +305,34 @@ declare const PaginatedResultMeta_base: Schema.Opaque<PaginatedResultMeta, Schem
|
|
| 238 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 239 |
}>, keyof Schema.Top>;
|
| 240 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
* @since 4.0.0
|
| 242 |
-
* @category common
|
| 243 |
*/
|
| 244 |
export declare class PaginatedResultMeta extends PaginatedResultMeta_base {
|
| 245 |
}
|
| 246 |
/**
|
| 247 |
-
*
|
|
|
|
|
|
|
| 248 |
* @since 4.0.0
|
| 249 |
-
* @category common
|
| 250 |
*/
|
| 251 |
export declare const Role: Schema.Literals<["user", "assistant"]>;
|
| 252 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
* @since 4.0.0
|
| 254 |
-
* @category common
|
| 255 |
*/
|
| 256 |
export type Role = typeof Role.Type;
|
| 257 |
declare const Annotations_base: Schema.Opaque<Annotations, Schema.Struct<{
|
|
@@ -288,11 +369,15 @@ declare const Annotations_base: Schema.Opaque<Annotations, Schema.Struct<{
|
|
| 288 |
readonly priority: Schema.decodeTo<Schema.optional<Schema.Number>, Schema.optionalKey<Schema.Number>, never, never>;
|
| 289 |
}>, keyof Schema.Top>;
|
| 290 |
/**
|
| 291 |
-
*
|
| 292 |
-
* inform how objects are used or displayed
|
| 293 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
* @since 4.0.0
|
| 295 |
-
* @category common
|
| 296 |
*/
|
| 297 |
export declare class Annotations extends Annotations_base {
|
| 298 |
}
|
|
@@ -308,8 +393,8 @@ declare const Implementation_base: Schema.Opaque<Implementation, Schema.Struct<{
|
|
| 308 |
/**
|
| 309 |
* Describes the name and version of an MCP implementation.
|
| 310 |
*
|
|
|
|
| 311 |
* @since 4.0.0
|
| 312 |
-
* @category common
|
| 313 |
*/
|
| 314 |
export declare class Implementation extends Implementation_base {
|
| 315 |
}
|
|
@@ -347,12 +432,20 @@ declare const ClientCapabilities_base: Schema.Class<ClientCapabilities, Schema.S
|
|
| 347 |
readonly elicitation: Schema.decodeTo<Schema.optional<Schema.Struct<{}>>, Schema.optionalKey<Schema.Struct<{}>>, never, never>;
|
| 348 |
}>, {}>;
|
| 349 |
/**
|
| 350 |
-
*
|
| 351 |
-
*
|
| 352 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 354 |
* @since 4.0.0
|
| 355 |
-
* @category common
|
| 356 |
*/
|
| 357 |
export declare class ClientCapabilities extends ClientCapabilities_base {
|
| 358 |
}
|
|
@@ -494,12 +587,20 @@ declare const ServerCapabilities_base: Schema.Opaque<ServerCapabilities, Schema.
|
|
| 494 |
}>>, never, never>;
|
| 495 |
}>, keyof Schema.Top>;
|
| 496 |
/**
|
| 497 |
-
*
|
| 498 |
-
*
|
| 499 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 500 |
*
|
|
|
|
| 501 |
* @since 4.0.0
|
| 502 |
-
* @category common
|
| 503 |
*/
|
| 504 |
export declare class ServerCapabilities extends ServerCapabilities_base {
|
| 505 |
}
|
|
@@ -520,34 +621,77 @@ declare const McpErrorBase_base: Schema.Class<McpErrorBase, Schema.Struct<{
|
|
| 520 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 521 |
}>, {}>;
|
| 522 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
* @since 4.0.0
|
| 524 |
-
* @category errors
|
| 525 |
*/
|
| 526 |
export declare class McpErrorBase extends McpErrorBase_base {
|
| 527 |
}
|
| 528 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
* @since 4.0.0
|
| 530 |
-
* @category errors
|
| 531 |
*/
|
| 532 |
export declare const INVALID_REQUEST_ERROR_CODE: -32600;
|
| 533 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
* @since 4.0.0
|
| 535 |
-
* @category errors
|
| 536 |
*/
|
| 537 |
export declare const METHOD_NOT_FOUND_ERROR_CODE: -32601;
|
| 538 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
* @since 4.0.0
|
| 540 |
-
* @category errors
|
| 541 |
*/
|
| 542 |
export declare const INVALID_PARAMS_ERROR_CODE: -32602;
|
| 543 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 544 |
* @since 4.0.0
|
| 545 |
-
* @category errors
|
| 546 |
*/
|
| 547 |
export declare const INTERNAL_ERROR_CODE: -32603;
|
| 548 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 549 |
* @since 4.0.0
|
| 550 |
-
* @category errors
|
| 551 |
*/
|
| 552 |
export declare const PARSE_ERROR_CODE: -32700;
|
| 553 |
declare const ParseError_base: Schema.Class<ParseError, Schema.Struct<{
|
|
@@ -565,8 +709,19 @@ declare const ParseError_base: Schema.Class<ParseError, Schema.Struct<{
|
|
| 565 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 566 |
}>, import("../../Cause.ts").YieldableError>;
|
| 567 |
/**
|
| 568 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
* @category errors
|
|
|
|
| 570 |
*/
|
| 571 |
export declare class ParseError extends ParseError_base {
|
| 572 |
}
|
|
@@ -585,8 +740,19 @@ declare const InvalidRequest_base: Schema.Class<InvalidRequest, Schema.Struct<{
|
|
| 585 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 586 |
}>, import("../../Cause.ts").YieldableError>;
|
| 587 |
/**
|
| 588 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
* @category errors
|
|
|
|
| 590 |
*/
|
| 591 |
export declare class InvalidRequest extends InvalidRequest_base {
|
| 592 |
}
|
|
@@ -605,8 +771,18 @@ declare const MethodNotFound_base: Schema.Class<MethodNotFound, Schema.Struct<{
|
|
| 605 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 606 |
}>, import("../../Cause.ts").YieldableError>;
|
| 607 |
/**
|
| 608 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
* @category errors
|
|
|
|
| 610 |
*/
|
| 611 |
export declare class MethodNotFound extends MethodNotFound_base {
|
| 612 |
}
|
|
@@ -625,8 +801,19 @@ declare const InvalidParams_base: Schema.Class<InvalidParams, Schema.Struct<{
|
|
| 625 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 626 |
}>, import("../../Cause.ts").YieldableError>;
|
| 627 |
/**
|
| 628 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 629 |
* @category errors
|
|
|
|
| 630 |
*/
|
| 631 |
export declare class InvalidParams extends InvalidParams_base {
|
| 632 |
}
|
|
@@ -645,25 +832,46 @@ declare const InternalError_base: Schema.Class<InternalError, Schema.Struct<{
|
|
| 645 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 646 |
}>, import("../../Cause.ts").YieldableError>;
|
| 647 |
/**
|
| 648 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 649 |
* @category errors
|
|
|
|
| 650 |
*/
|
| 651 |
export declare class InternalError extends InternalError_base {
|
| 652 |
static readonly notImplemented: InternalError;
|
| 653 |
}
|
| 654 |
/**
|
| 655 |
-
*
|
|
|
|
|
|
|
| 656 |
* @category errors
|
|
|
|
| 657 |
*/
|
| 658 |
export declare const McpError: Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>;
|
| 659 |
declare const Ping_base: Rpc.Rpc<"ping", Schema.UndefinedOr<typeof RequestMeta>, Schema.Struct<{}>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 660 |
/**
|
| 661 |
-
*
|
| 662 |
-
*
|
| 663 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 664 |
*
|
| 665 |
-
* @since 4.0.0
|
| 666 |
* @category ping
|
|
|
|
| 667 |
*/
|
| 668 |
export declare class Ping extends Ping_base {
|
| 669 |
}
|
|
@@ -713,11 +921,10 @@ declare const InitializeResult_base: Schema.Opaque<InitializeResult, Schema.Stru
|
|
| 713 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 714 |
}>, keyof Schema.Top>;
|
| 715 |
/**
|
| 716 |
-
*
|
| 717 |
-
* response.
|
| 718 |
*
|
| 719 |
-
* @since 4.0.0
|
| 720 |
* @category initialization
|
|
|
|
| 721 |
*/
|
| 722 |
export declare class InitializeResult extends InitializeResult_base {
|
| 723 |
}
|
|
@@ -758,21 +965,20 @@ declare const Initialize_base: Rpc.Rpc<"initialize", Schema.Struct<{
|
|
| 758 |
}>>, never, never>;
|
| 759 |
}>, typeof InitializeResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 760 |
/**
|
| 761 |
-
*
|
| 762 |
-
*
|
| 763 |
*
|
| 764 |
-
* @since 4.0.0
|
| 765 |
* @category initialization
|
|
|
|
| 766 |
*/
|
| 767 |
export declare class Initialize extends Initialize_base {
|
| 768 |
}
|
| 769 |
declare const InitializedNotification_base: Rpc.Rpc<"notifications/initialized", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 770 |
/**
|
| 771 |
-
*
|
| 772 |
-
* has finished.
|
| 773 |
*
|
| 774 |
-
* @since 4.0.0
|
| 775 |
* @category initialization
|
|
|
|
| 776 |
*/
|
| 777 |
export declare class InitializedNotification extends InitializedNotification_base {
|
| 778 |
}
|
|
@@ -792,8 +998,16 @@ declare const CancelledNotification_base: Rpc.Rpc<"notifications/cancelled", Sch
|
|
| 792 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 793 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 794 |
/**
|
| 795 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 796 |
* @category cancellation
|
|
|
|
| 797 |
*/
|
| 798 |
export declare class CancelledNotification extends CancelledNotification_base {
|
| 799 |
}
|
|
@@ -819,11 +1033,10 @@ declare const ProgressNotification_base: Rpc.Rpc<"notifications/progress", Schem
|
|
| 819 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 820 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 821 |
/**
|
| 822 |
-
*
|
| 823 |
-
* for a long-running request.
|
| 824 |
*
|
| 825 |
-
* @since 4.0.0
|
| 826 |
* @category progress
|
|
|
|
| 827 |
*/
|
| 828 |
export declare class ProgressNotification extends ProgressNotification_base {
|
| 829 |
}
|
|
@@ -871,10 +1084,10 @@ declare const Resource_base: Schema.Class<Resource, Schema.Struct<{
|
|
| 871 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 872 |
}>, {}>;
|
| 873 |
/**
|
| 874 |
-
*
|
| 875 |
*
|
| 876 |
-
* @since 4.0.0
|
| 877 |
* @category resources
|
|
|
|
| 878 |
*/
|
| 879 |
export declare class Resource extends Resource_base {
|
| 880 |
}
|
|
@@ -913,10 +1126,10 @@ declare const ResourceTemplate_base: Schema.Class<ResourceTemplate, Schema.Struc
|
|
| 913 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 914 |
}>, {}>;
|
| 915 |
/**
|
| 916 |
-
*
|
| 917 |
*
|
| 918 |
-
* @since 4.0.0
|
| 919 |
* @category resources
|
|
|
|
| 920 |
*/
|
| 921 |
export declare class ResourceTemplate extends ResourceTemplate_base {
|
| 922 |
}
|
|
@@ -948,10 +1161,10 @@ declare const ResourceContents_base: Schema.Opaque<ResourceContents, Schema.Stru
|
|
| 948 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 949 |
}>, keyof Schema.Top>;
|
| 950 |
/**
|
| 951 |
-
*
|
| 952 |
*
|
| 953 |
-
* @since 4.0.0
|
| 954 |
* @category resources
|
|
|
|
| 955 |
*/
|
| 956 |
export declare class ResourceContents extends ResourceContents_base {
|
| 957 |
}
|
|
@@ -993,10 +1206,10 @@ declare const TextResourceContents_base: Schema.Opaque<TextResourceContents, Sch
|
|
| 993 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 994 |
}>, keyof Schema.Top>;
|
| 995 |
/**
|
| 996 |
-
*
|
| 997 |
*
|
| 998 |
-
* @since 4.0.0
|
| 999 |
* @category resources
|
|
|
|
| 1000 |
*/
|
| 1001 |
export declare class TextResourceContents extends TextResourceContents_base {
|
| 1002 |
}
|
|
@@ -1036,10 +1249,10 @@ declare const BlobResourceContents_base: Schema.Opaque<BlobResourceContents, Sch
|
|
| 1036 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1037 |
}>, keyof Schema.Top>;
|
| 1038 |
/**
|
| 1039 |
-
*
|
| 1040 |
*
|
| 1041 |
-
* @since 4.0.0
|
| 1042 |
* @category resources
|
|
|
|
| 1043 |
*/
|
| 1044 |
export declare class BlobResourceContents extends BlobResourceContents_base {
|
| 1045 |
}
|
|
@@ -1057,10 +1270,10 @@ declare const ListResourcesResult_base: Schema.Class<ListResourcesResult, Schema
|
|
| 1057 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1058 |
}>, {}>;
|
| 1059 |
/**
|
| 1060 |
-
*
|
| 1061 |
*
|
| 1062 |
-
* @since 4.0.0
|
| 1063 |
* @category resources
|
|
|
|
| 1064 |
*/
|
| 1065 |
export declare class ListResourcesResult extends ListResourcesResult_base {
|
| 1066 |
}
|
|
@@ -1068,8 +1281,8 @@ declare const ListResources_base: Rpc.Rpc<"resources/list", Schema.UndefinedOr<t
|
|
| 1068 |
/**
|
| 1069 |
* Sent from the client to request a list of resources the server has.
|
| 1070 |
*
|
| 1071 |
-
* @since 4.0.0
|
| 1072 |
* @category resources
|
|
|
|
| 1073 |
*/
|
| 1074 |
export declare class ListResources extends ListResources_base {
|
| 1075 |
}
|
|
@@ -1087,10 +1300,11 @@ declare const ListResourceTemplatesResult_base: Schema.Class<ListResourceTemplat
|
|
| 1087 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1088 |
}>, {}>;
|
| 1089 |
/**
|
| 1090 |
-
*
|
|
|
|
| 1091 |
*
|
| 1092 |
-
* @since 4.0.0
|
| 1093 |
* @category resources
|
|
|
|
| 1094 |
*/
|
| 1095 |
export declare class ListResourceTemplatesResult extends ListResourceTemplatesResult_base {
|
| 1096 |
}
|
|
@@ -1098,8 +1312,8 @@ declare const ListResourceTemplates_base: Rpc.Rpc<"resources/templates/list", Sc
|
|
| 1098 |
/**
|
| 1099 |
* Sent from the client to request a list of resource templates the server has.
|
| 1100 |
*
|
| 1101 |
-
* @since 4.0.0
|
| 1102 |
* @category resources
|
|
|
|
| 1103 |
*/
|
| 1104 |
export declare class ListResourceTemplates extends ListResourceTemplates_base {
|
| 1105 |
}
|
|
@@ -1119,10 +1333,10 @@ declare const ReadResourceResult_base: Schema.Opaque<ReadResourceResult, Schema.
|
|
| 1119 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1120 |
}>, keyof Schema.Top>;
|
| 1121 |
/**
|
| 1122 |
-
*
|
| 1123 |
*
|
| 1124 |
-
* @since 4.0.0
|
| 1125 |
* @category resources
|
|
|
|
| 1126 |
*/
|
| 1127 |
export declare class ReadResourceResult extends ReadResourceResult_base {
|
| 1128 |
}
|
|
@@ -1155,19 +1369,25 @@ declare const ReadResource_base: Rpc.Rpc<"resources/read", Schema.Struct<{
|
|
| 1155 |
/**
|
| 1156 |
* Sent from the client to the server, to read a specific resource URI.
|
| 1157 |
*
|
| 1158 |
-
* @since 4.0.0
|
| 1159 |
* @category resources
|
|
|
|
| 1160 |
*/
|
| 1161 |
export declare class ReadResource extends ReadResource_base {
|
| 1162 |
}
|
| 1163 |
declare const ResourceListChangedNotification_base: Rpc.Rpc<"notifications/resources/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 1164 |
/**
|
| 1165 |
-
*
|
| 1166 |
-
*
|
| 1167 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1168 |
*
|
| 1169 |
-
* @since 4.0.0
|
| 1170 |
* @category resources
|
|
|
|
| 1171 |
*/
|
| 1172 |
export declare class ResourceListChangedNotification extends ResourceListChangedNotification_base {
|
| 1173 |
}
|
|
@@ -1201,8 +1421,8 @@ declare const Subscribe_base: Rpc.Rpc<"resources/subscribe", Schema.Struct<{
|
|
| 1201 |
* Sent from the client to request resources/updated notifications from the
|
| 1202 |
* server whenever a particular resource changes.
|
| 1203 |
*
|
| 1204 |
-
* @since 4.0.0
|
| 1205 |
* @category resources
|
|
|
|
| 1206 |
*/
|
| 1207 |
export declare class Subscribe extends Subscribe_base {
|
| 1208 |
}
|
|
@@ -1237,8 +1457,8 @@ declare const Unsubscribe_base: Rpc.Rpc<"resources/unsubscribe", Schema.Struct<{
|
|
| 1237 |
* notifications from the server. This should follow a previous
|
| 1238 |
* resources/subscribe request.
|
| 1239 |
*
|
| 1240 |
-
* @since 4.0.0
|
| 1241 |
* @category resources
|
|
|
|
| 1242 |
*/
|
| 1243 |
export declare class Unsubscribe extends Unsubscribe_base {
|
| 1244 |
}
|
|
@@ -1250,8 +1470,15 @@ declare const ResourceUpdatedNotification_base: Rpc.Rpc<"notifications/resources
|
|
| 1250 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1251 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 1252 |
/**
|
| 1253 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1254 |
* @category resources
|
|
|
|
| 1255 |
*/
|
| 1256 |
export declare class ResourceUpdatedNotification extends ResourceUpdatedNotification_base {
|
| 1257 |
}
|
|
@@ -1287,8 +1514,8 @@ declare const PromptArgument_base: Schema.Opaque<PromptArgument, Schema.Struct<{
|
|
| 1287 |
/**
|
| 1288 |
* Describes an argument that a prompt can accept.
|
| 1289 |
*
|
|
|
|
| 1290 |
* @since 4.0.0
|
| 1291 |
-
* @category prompts
|
| 1292 |
*/
|
| 1293 |
export declare class PromptArgument extends PromptArgument_base {
|
| 1294 |
}
|
|
@@ -1308,10 +1535,10 @@ declare const Prompt_base: Schema.Class<Prompt, Schema.Struct<{
|
|
| 1308 |
readonly arguments: Schema.decodeTo<Schema.optional<Schema.$Array<typeof PromptArgument>>, Schema.optionalKey<Schema.$Array<typeof PromptArgument>>, never, never>;
|
| 1309 |
}>, {}>;
|
| 1310 |
/**
|
| 1311 |
-
*
|
| 1312 |
*
|
|
|
|
| 1313 |
* @since 4.0.0
|
| 1314 |
-
* @category prompts
|
| 1315 |
*/
|
| 1316 |
export declare class Prompt extends Prompt_base {
|
| 1317 |
}
|
|
@@ -1337,10 +1564,10 @@ declare const TextContent_base: Schema.Opaque<TextContent, Schema.Struct<{
|
|
| 1337 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1338 |
}>, keyof Schema.Top>;
|
| 1339 |
/**
|
| 1340 |
-
*
|
| 1341 |
*
|
|
|
|
| 1342 |
* @since 4.0.0
|
| 1343 |
-
* @category prompts
|
| 1344 |
*/
|
| 1345 |
export declare class TextContent extends TextContent_base {
|
| 1346 |
}
|
|
@@ -1376,10 +1603,10 @@ declare const ImageContent_base: Schema.Opaque<ImageContent, Schema.Struct<{
|
|
| 1376 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1377 |
}>, keyof Schema.Top>;
|
| 1378 |
/**
|
| 1379 |
-
*
|
| 1380 |
*
|
|
|
|
| 1381 |
* @since 4.0.0
|
| 1382 |
-
* @category prompts
|
| 1383 |
*/
|
| 1384 |
export declare class ImageContent extends ImageContent_base {
|
| 1385 |
}
|
|
@@ -1415,10 +1642,10 @@ declare const AudioContent_base: Schema.Opaque<AudioContent, Schema.Struct<{
|
|
| 1415 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1416 |
}>, keyof Schema.Top>;
|
| 1417 |
/**
|
| 1418 |
-
*
|
| 1419 |
*
|
|
|
|
| 1420 |
* @since 4.0.0
|
| 1421 |
-
* @category prompts
|
| 1422 |
*/
|
| 1423 |
export declare class AudioContent extends AudioContent_base {
|
| 1424 |
}
|
|
@@ -1438,13 +1665,15 @@ declare const EmbeddedResource_base: Schema.Opaque<EmbeddedResource, Schema.Stru
|
|
| 1438 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1439 |
}>, keyof Schema.Top>;
|
| 1440 |
/**
|
| 1441 |
-
*
|
|
|
|
|
|
|
| 1442 |
*
|
| 1443 |
* It is up to the client how best to render embedded resources for the benefit
|
| 1444 |
* of the LLM and/or the user.
|
| 1445 |
*
|
|
|
|
| 1446 |
* @since 4.0.0
|
| 1447 |
-
* @category prompts
|
| 1448 |
*/
|
| 1449 |
export declare class EmbeddedResource extends EmbeddedResource_base {
|
| 1450 |
}
|
|
@@ -1536,18 +1765,24 @@ declare const ResourceLink_base: Schema.Opaque<ResourceLink, Schema.Struct<{
|
|
| 1536 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1537 |
}>, keyof Schema.Top>;
|
| 1538 |
/**
|
| 1539 |
-
*
|
| 1540 |
*
|
| 1541 |
-
*
|
| 1542 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1543 |
* @since 4.0.0
|
| 1544 |
-
* @category prompts
|
| 1545 |
*/
|
| 1546 |
export declare class ResourceLink extends ResourceLink_base {
|
| 1547 |
}
|
| 1548 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1549 |
* @since 4.0.0
|
| 1550 |
-
* @category prompts
|
| 1551 |
*/
|
| 1552 |
export declare const ContentBlock: Schema.Union<readonly [typeof TextContent, typeof ImageContent, typeof AudioContent, typeof EmbeddedResource, typeof ResourceLink]>;
|
| 1553 |
declare const PromptMessage_base: Schema.Opaque<PromptMessage, Schema.Struct<{
|
|
@@ -1560,11 +1795,13 @@ declare const PromptMessage_base: Schema.Opaque<PromptMessage, Schema.Struct<{
|
|
| 1560 |
/**
|
| 1561 |
* Describes a message returned as part of a prompt.
|
| 1562 |
*
|
|
|
|
|
|
|
| 1563 |
* This is similar to `SamplingMessage`, but also supports the embedding of
|
| 1564 |
* resources from the MCP server.
|
| 1565 |
*
|
|
|
|
| 1566 |
* @since 4.0.0
|
| 1567 |
-
* @category prompts
|
| 1568 |
*/
|
| 1569 |
export declare class PromptMessage extends PromptMessage_base {
|
| 1570 |
}
|
|
@@ -1582,10 +1819,10 @@ declare const ListPromptsResult_base: Schema.Class<ListPromptsResult, Schema.Str
|
|
| 1582 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1583 |
}>, {}>;
|
| 1584 |
/**
|
| 1585 |
-
*
|
| 1586 |
*
|
|
|
|
| 1587 |
* @since 4.0.0
|
| 1588 |
-
* @category prompts
|
| 1589 |
*/
|
| 1590 |
export declare class ListPromptsResult extends ListPromptsResult_base {
|
| 1591 |
}
|
|
@@ -1594,8 +1831,8 @@ declare const ListPrompts_base: Rpc.Rpc<"prompts/list", Schema.UndefinedOr<typeo
|
|
| 1594 |
* Sent from the client to request a list of prompts and prompt templates the
|
| 1595 |
* server has.
|
| 1596 |
*
|
|
|
|
| 1597 |
* @since 4.0.0
|
| 1598 |
-
* @category prompts
|
| 1599 |
*/
|
| 1600 |
export declare class ListPrompts extends ListPrompts_base {
|
| 1601 |
}
|
|
@@ -1612,10 +1849,10 @@ declare const GetPromptResult_base: Schema.Class<GetPromptResult, Schema.Struct<
|
|
| 1612 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1613 |
}>, {}>;
|
| 1614 |
/**
|
| 1615 |
-
*
|
| 1616 |
*
|
|
|
|
| 1617 |
* @since 4.0.0
|
| 1618 |
-
* @category prompts
|
| 1619 |
*/
|
| 1620 |
export declare class GetPromptResult extends GetPromptResult_base {
|
| 1621 |
}
|
|
@@ -1650,21 +1887,27 @@ declare const GetPrompt_base: Rpc.Rpc<"prompts/get", Schema.Struct<{
|
|
| 1650 |
}>>, never, never>;
|
| 1651 |
}>, typeof GetPromptResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 1652 |
/**
|
| 1653 |
-
*
|
| 1654 |
*
|
|
|
|
| 1655 |
* @since 4.0.0
|
| 1656 |
-
* @category prompts
|
| 1657 |
*/
|
| 1658 |
export declare class GetPrompt extends GetPrompt_base {
|
| 1659 |
}
|
| 1660 |
declare const PromptListChangedNotification_base: Rpc.Rpc<"notifications/prompts/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 1661 |
/**
|
| 1662 |
-
*
|
| 1663 |
-
*
|
| 1664 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1665 |
*
|
|
|
|
| 1666 |
* @since 4.0.0
|
| 1667 |
-
* @category prompts
|
| 1668 |
*/
|
| 1669 |
export declare class PromptListChangedNotification extends PromptListChangedNotification_base {
|
| 1670 |
}
|
|
@@ -1746,17 +1989,21 @@ declare const ToolAnnotations_base: Schema.Opaque<ToolAnnotations, Schema.Struct
|
|
| 1746 |
readonly openWorldHint: optionalWithDefault<Schema.Boolean>;
|
| 1747 |
}>, keyof Schema.Top>;
|
| 1748 |
/**
|
| 1749 |
-
*
|
|
|
|
|
|
|
| 1750 |
*
|
| 1751 |
* NOTE: all properties in ToolAnnotations are **hints**. They are not
|
| 1752 |
* guaranteed to provide a faithful description of tool behavior (including
|
| 1753 |
* descriptive properties like `title`).
|
| 1754 |
*
|
|
|
|
|
|
|
| 1755 |
* Clients should never make tool use decisions based on ToolAnnotations
|
| 1756 |
* received from untrusted servers.
|
| 1757 |
*
|
| 1758 |
-
* @since 4.0.0
|
| 1759 |
* @category tools
|
|
|
|
| 1760 |
*/
|
| 1761 |
export declare class ToolAnnotations extends ToolAnnotations_base {
|
| 1762 |
}
|
|
@@ -1789,10 +2036,10 @@ declare const Tool_base: Schema.Class<Tool, Schema.Struct<{
|
|
| 1789 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1790 |
}>, {}>;
|
| 1791 |
/**
|
| 1792 |
-
*
|
| 1793 |
*
|
| 1794 |
-
* @since 4.0.0
|
| 1795 |
* @category tools
|
|
|
|
| 1796 |
*/
|
| 1797 |
export declare class Tool extends Tool_base {
|
| 1798 |
}
|
|
@@ -1810,10 +2057,10 @@ declare const ListToolsResult_base: Schema.Class<ListToolsResult, Schema.Struct<
|
|
| 1810 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1811 |
}>, {}>;
|
| 1812 |
/**
|
| 1813 |
-
*
|
| 1814 |
*
|
| 1815 |
-
* @since 4.0.0
|
| 1816 |
* @category tools
|
|
|
|
| 1817 |
*/
|
| 1818 |
export declare class ListToolsResult extends ListToolsResult_base {
|
| 1819 |
}
|
|
@@ -1821,8 +2068,8 @@ declare const ListTools_base: Rpc.Rpc<"tools/list", Schema.UndefinedOr<typeof Pa
|
|
| 1821 |
/**
|
| 1822 |
* Sent from the client to request a list of tools the server has.
|
| 1823 |
*
|
| 1824 |
-
* @since 4.0.0
|
| 1825 |
* @category tools
|
|
|
|
| 1826 |
*/
|
| 1827 |
export declare class ListTools extends ListTools_base {
|
| 1828 |
}
|
|
@@ -1842,19 +2089,19 @@ declare const CallToolResult_base: Schema.Class<CallToolResult, Schema.Struct<{
|
|
| 1842 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1843 |
}>, {}>;
|
| 1844 |
/**
|
| 1845 |
-
*
|
|
|
|
|
|
|
| 1846 |
*
|
| 1847 |
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 1848 |
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 1849 |
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 1850 |
-
* and self-correct.
|
| 1851 |
-
*
|
| 1852 |
-
*
|
| 1853 |
-
* server does not support tool calls, or any other exceptional conditions,
|
| 1854 |
-
* should be reported as an MCP error response.
|
| 1855 |
*
|
| 1856 |
-
* @since 4.0.0
|
| 1857 |
* @category tools
|
|
|
|
| 1858 |
*/
|
| 1859 |
export declare class CallToolResult extends CallToolResult_base {
|
| 1860 |
}
|
|
@@ -1882,32 +2129,45 @@ declare const CallTool_base: Rpc.Rpc<"tools/call", Schema.Struct<{
|
|
| 1882 |
}>>, never, never>;
|
| 1883 |
}>, typeof CallToolResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 1884 |
/**
|
| 1885 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1886 |
*
|
| 1887 |
-
* @since 4.0.0
|
| 1888 |
* @category tools
|
|
|
|
| 1889 |
*/
|
| 1890 |
export declare class CallTool extends CallTool_base {
|
| 1891 |
}
|
| 1892 |
declare const ToolListChangedNotification_base: Rpc.Rpc<"notifications/tools/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 1893 |
/**
|
| 1894 |
-
*
|
| 1895 |
-
*
|
| 1896 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1897 |
*
|
| 1898 |
-
* @since 4.0.0
|
| 1899 |
* @category tools
|
|
|
|
| 1900 |
*/
|
| 1901 |
export declare class ToolListChangedNotification extends ToolListChangedNotification_base {
|
| 1902 |
}
|
| 1903 |
/**
|
| 1904 |
-
*
|
| 1905 |
-
*
|
| 1906 |
-
*
|
| 1907 |
-
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
| 1908 |
*
|
| 1909 |
-
* @since 4.0.0
|
| 1910 |
* @category logging
|
|
|
|
| 1911 |
*/
|
| 1912 |
export declare const LoggingLevel: Schema.Literals<[
|
| 1913 |
"debug",
|
|
@@ -1920,13 +2180,12 @@ export declare const LoggingLevel: Schema.Literals<[
|
|
| 1920 |
"emergency"
|
| 1921 |
]>;
|
| 1922 |
/**
|
| 1923 |
-
*
|
| 1924 |
-
*
|
| 1925 |
-
*
|
| 1926 |
-
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
| 1927 |
*
|
| 1928 |
-
* @since 4.0.0
|
| 1929 |
* @category logging
|
|
|
|
| 1930 |
*/
|
| 1931 |
export type LoggingLevel = typeof LoggingLevel.Type;
|
| 1932 |
declare const SetLevel_base: Rpc.Rpc<"logging/setLevel", Schema.Struct<{
|
|
@@ -1957,10 +2216,10 @@ declare const SetLevel_base: Rpc.Rpc<"logging/setLevel", Schema.Struct<{
|
|
| 1957 |
}>>, never, never>;
|
| 1958 |
}>, Schema.Void, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 1959 |
/**
|
| 1960 |
-
*
|
| 1961 |
*
|
| 1962 |
-
* @since 4.0.0
|
| 1963 |
* @category logging
|
|
|
|
| 1964 |
*/
|
| 1965 |
export declare class SetLevel extends SetLevel_base {
|
| 1966 |
}
|
|
@@ -1985,8 +2244,15 @@ declare const LoggingMessageNotification_base: Rpc.Rpc<"notifications/message",
|
|
| 1985 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1986 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 1987 |
/**
|
| 1988 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1989 |
* @category logging
|
|
|
|
| 1990 |
*/
|
| 1991 |
export declare class LoggingMessageNotification extends LoggingMessageNotification_base {
|
| 1992 |
}
|
|
@@ -2000,8 +2266,8 @@ declare const SamplingMessage_base: Schema.Opaque<SamplingMessage, Schema.Struct
|
|
| 2000 |
/**
|
| 2001 |
* Describes a message issued to or received from an LLM API.
|
| 2002 |
*
|
| 2003 |
-
* @since 4.0.0
|
| 2004 |
* @category sampling
|
|
|
|
| 2005 |
*/
|
| 2006 |
export declare class SamplingMessage extends SamplingMessage_base {
|
| 2007 |
}
|
|
@@ -2035,13 +2301,15 @@ declare const ModelHint_base: Schema.Opaque<ModelHint, Schema.Struct<{
|
|
| 2035 |
readonly name: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2036 |
}>, keyof Schema.Top>;
|
| 2037 |
/**
|
| 2038 |
-
*
|
|
|
|
|
|
|
| 2039 |
*
|
| 2040 |
* Keys not declared here are currently left unspecified by the spec and are up
|
| 2041 |
* to the client to interpret.
|
| 2042 |
*
|
| 2043 |
-
* @since 4.0.0
|
| 2044 |
* @category sampling
|
|
|
|
| 2045 |
*/
|
| 2046 |
export declare class ModelHint extends ModelHint_base {
|
| 2047 |
}
|
|
@@ -2076,20 +2344,25 @@ declare const ModelPreferences_base: Schema.Class<ModelPreferences, Schema.Struc
|
|
| 2076 |
readonly intelligencePriority: Schema.decodeTo<Schema.optional<Schema.Number>, Schema.optionalKey<Schema.Number>, never, never>;
|
| 2077 |
}>, {}>;
|
| 2078 |
/**
|
| 2079 |
-
*
|
|
|
|
|
|
|
|
|
|
| 2080 |
*
|
| 2081 |
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
| 2082 |
-
* rarely straightforward.
|
| 2083 |
* faster but less capable, others are more capable but more expensive, and so
|
| 2084 |
* on. This interface allows servers to express their priorities across multiple
|
| 2085 |
* dimensions to help clients make an appropriate selection for their use case.
|
| 2086 |
*
|
|
|
|
|
|
|
| 2087 |
* These preferences are always advisory. The client MAY ignore them. It is also
|
| 2088 |
* up to the client to decide how to interpret these preferences and how to
|
| 2089 |
* balance them against other considerations.
|
| 2090 |
*
|
| 2091 |
-
* @since 4.0.0
|
| 2092 |
* @category sampling
|
|
|
|
| 2093 |
*/
|
| 2094 |
export declare class ModelPreferences extends ModelPreferences_base {
|
| 2095 |
}
|
|
@@ -2104,13 +2377,19 @@ declare const CreateMessageResult_base: Schema.Class<CreateMessageResult, Schema
|
|
| 2104 |
readonly stopReason: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2105 |
}>, {}>;
|
| 2106 |
/**
|
| 2107 |
-
*
|
| 2108 |
-
*
|
| 2109 |
-
*
|
| 2110 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2111 |
*
|
| 2112 |
-
* @since 4.0.0
|
| 2113 |
* @category sampling
|
|
|
|
| 2114 |
*/
|
| 2115 |
export declare class CreateMessageResult extends CreateMessageResult_base {
|
| 2116 |
}
|
|
@@ -2145,13 +2424,20 @@ declare const CreateMessage_base: Rpc.Rpc<"sampling/createMessage", Schema.Struc
|
|
| 2145 |
metadata: Schema.Any;
|
| 2146 |
}>, typeof CreateMessageResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2147 |
/**
|
| 2148 |
-
*
|
| 2149 |
-
*
|
| 2150 |
-
*
|
| 2151 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2152 |
*
|
| 2153 |
-
* @since 4.0.0
|
| 2154 |
* @category sampling
|
|
|
|
| 2155 |
*/
|
| 2156 |
export declare class CreateMessage extends CreateMessage_base {
|
| 2157 |
}
|
|
@@ -2169,10 +2455,10 @@ declare const ResourceReference_base: Schema.Opaque<ResourceReference, Schema.St
|
|
| 2169 |
readonly uri: Schema.String;
|
| 2170 |
}>, keyof Schema.Top>;
|
| 2171 |
/**
|
| 2172 |
-
*
|
| 2173 |
*
|
| 2174 |
-
* @since 4.0.0
|
| 2175 |
* @category autocomplete
|
|
|
|
| 2176 |
*/
|
| 2177 |
export declare class ResourceReference extends ResourceReference_base {
|
| 2178 |
}
|
|
@@ -2192,10 +2478,10 @@ declare const PromptReference_base: Schema.Opaque<PromptReference, Schema.Struct
|
|
| 2192 |
readonly title: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2193 |
}>, keyof Schema.Top>;
|
| 2194 |
/**
|
| 2195 |
-
*
|
| 2196 |
*
|
| 2197 |
-
* @since 4.0.0
|
| 2198 |
* @category autocomplete
|
|
|
|
| 2199 |
*/
|
| 2200 |
export declare class PromptReference extends PromptReference_base {
|
| 2201 |
}
|
|
@@ -2235,13 +2521,15 @@ declare const CompleteResult_base: Schema.Opaque<CompleteResult, Schema.Struct<{
|
|
| 2235 |
}>;
|
| 2236 |
}>, keyof Schema.Top>;
|
| 2237 |
/**
|
| 2238 |
-
*
|
| 2239 |
*
|
| 2240 |
-
* @since 4.0.0
|
| 2241 |
* @category autocomplete
|
|
|
|
| 2242 |
*/
|
| 2243 |
export declare class CompleteResult extends CompleteResult_base {
|
| 2244 |
/**
|
|
|
|
|
|
|
| 2245 |
* @since 4.0.0
|
| 2246 |
*/
|
| 2247 |
static readonly empty: CompleteResult;
|
|
@@ -2272,10 +2560,10 @@ declare const Complete_base: Rpc.Rpc<"completion/complete", Schema.Struct<{
|
|
| 2272 |
}>>;
|
| 2273 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2274 |
/**
|
| 2275 |
-
*
|
| 2276 |
*
|
| 2277 |
-
* @since 4.0.0
|
| 2278 |
* @category autocomplete
|
|
|
|
| 2279 |
*/
|
| 2280 |
export declare class Complete extends Complete_base {
|
| 2281 |
}
|
|
@@ -2296,8 +2584,8 @@ declare const Root_base: Schema.Class<Root, Schema.Struct<{
|
|
| 2296 |
/**
|
| 2297 |
* Represents a root directory or file that the server can operate on.
|
| 2298 |
*
|
| 2299 |
-
* @since 4.0.0
|
| 2300 |
* @category roots
|
|
|
|
| 2301 |
*/
|
| 2302 |
export declare class Root extends Root_base {
|
| 2303 |
}
|
|
@@ -2305,12 +2593,14 @@ declare const ListRootsResult_base: Schema.Class<ListRootsResult, Schema.Struct<
|
|
| 2305 |
readonly roots: Schema.$Array<typeof Root>;
|
| 2306 |
}>, {}>;
|
| 2307 |
/**
|
| 2308 |
-
*
|
| 2309 |
-
*
|
| 2310 |
-
*
|
|
|
|
|
|
|
| 2311 |
*
|
| 2312 |
-
* @since 4.0.0
|
| 2313 |
* @category roots
|
|
|
|
| 2314 |
*/
|
| 2315 |
export declare class ListRootsResult extends ListRootsResult_base {
|
| 2316 |
}
|
|
@@ -2319,27 +2609,33 @@ declare const ListRoots_base: Rpc.Rpc<"roots/list", Schema.UndefinedOr<typeof Re
|
|
| 2319 |
* Sent from the server to request a list of root URIs from the client. Roots
|
| 2320 |
* allow servers to ask for specific directories or files to operate on. A
|
| 2321 |
* common example for roots is providing a set of repositories or directories a
|
| 2322 |
-
* server should operate
|
| 2323 |
-
*
|
|
|
|
| 2324 |
*
|
| 2325 |
* This request is typically used when the server needs to understand the file
|
| 2326 |
* system structure or access specific locations that the client has permission
|
| 2327 |
* to read from.
|
| 2328 |
*
|
| 2329 |
-
* @since 4.0.0
|
| 2330 |
* @category roots
|
|
|
|
| 2331 |
*/
|
| 2332 |
export declare class ListRoots extends ListRoots_base {
|
| 2333 |
}
|
| 2334 |
declare const RootsListChangedNotification_base: Rpc.Rpc<"notifications/roots/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 2335 |
/**
|
| 2336 |
-
*
|
| 2337 |
-
*
|
| 2338 |
-
*
|
| 2339 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2340 |
*
|
| 2341 |
-
* @since 4.0.0
|
| 2342 |
* @category roots
|
|
|
|
| 2343 |
*/
|
| 2344 |
export declare class RootsListChangedNotification extends RootsListChangedNotification_base {
|
| 2345 |
}
|
|
@@ -2363,10 +2659,10 @@ declare const ElicitAcceptResult_base: Schema.Class<ElicitAcceptResult, Schema.S
|
|
| 2363 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2364 |
}>, {}>;
|
| 2365 |
/**
|
| 2366 |
-
*
|
| 2367 |
*
|
| 2368 |
-
* @since 4.0.0
|
| 2369 |
* @category elicitation
|
|
|
|
| 2370 |
*/
|
| 2371 |
export declare class ElicitAcceptResult extends ElicitAcceptResult_base {
|
| 2372 |
}
|
|
@@ -2385,18 +2681,18 @@ declare const ElicitDeclineResult_base: Schema.Class<ElicitDeclineResult, Schema
|
|
| 2385 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2386 |
}>, {}>;
|
| 2387 |
/**
|
| 2388 |
-
*
|
| 2389 |
*
|
| 2390 |
-
* @since 4.0.0
|
| 2391 |
* @category elicitation
|
|
|
|
| 2392 |
*/
|
| 2393 |
export declare class ElicitDeclineResult extends ElicitDeclineResult_base {
|
| 2394 |
}
|
| 2395 |
/**
|
| 2396 |
-
*
|
| 2397 |
*
|
| 2398 |
-
* @since 4.0.0
|
| 2399 |
* @category elicitation
|
|
|
|
| 2400 |
*/
|
| 2401 |
export declare const ElicitResult: Schema.Union<readonly [typeof ElicitAcceptResult, typeof ElicitDeclineResult]>;
|
| 2402 |
declare const Elicit_base: Rpc.Rpc<"elicitation/create", Schema.Struct<{
|
|
@@ -2412,8 +2708,16 @@ declare const Elicit_base: Rpc.Rpc<"elicitation/create", Schema.Struct<{
|
|
| 2412 |
requestedSchema: Schema.Any;
|
| 2413 |
}>, Schema.Union<readonly [typeof ElicitAcceptResult, typeof ElicitDeclineResult]>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2414 |
/**
|
| 2415 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2416 |
* @category elicitation
|
|
|
|
| 2417 |
*/
|
| 2418 |
export declare class Elicit extends Elicit_base {
|
| 2419 |
}
|
|
@@ -2434,8 +2738,16 @@ declare const ElicitationDeclined_base: Schema.Class<ElicitationDeclined, Schema
|
|
| 2434 |
readonly cause: Schema.decodeTo<Schema.optional<Schema.Defect>, Schema.optionalKey<Schema.Defect>, never, never>;
|
| 2435 |
}>, import("../../Cause.ts").YieldableError>;
|
| 2436 |
/**
|
| 2437 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2438 |
* @category elicitation
|
|
|
|
| 2439 |
*/
|
| 2440 |
export declare class ElicitationDeclined extends ElicitationDeclined_base {
|
| 2441 |
}
|
|
@@ -2445,21 +2757,34 @@ declare const McpServerClient_base: Context.ServiceClass<McpServerClient, "effec
|
|
| 2445 |
readonly getClient: Effect.Effect<RpcClient.RpcClient<RpcGroup.Rpcs<typeof ServerRequestRpcs>, RpcClientError>, never, Scope.Scope>;
|
| 2446 |
}>;
|
| 2447 |
/**
|
| 2448 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2449 |
* @category client
|
|
|
|
| 2450 |
*/
|
| 2451 |
export declare class McpServerClient extends McpServerClient_base {
|
| 2452 |
}
|
| 2453 |
declare const McpServerClientMiddleware_base: RpcMiddleware.ServiceClass<McpServerClientMiddleware, "effect/ai/McpSchema/McpServerClientMiddleware", McpServerClient, Schema.Never, never, never, false>;
|
| 2454 |
/**
|
| 2455 |
-
*
|
|
|
|
|
|
|
| 2456 |
* @category middleware
|
|
|
|
| 2457 |
*/
|
| 2458 |
export declare class McpServerClientMiddleware extends McpServerClientMiddleware_base {
|
| 2459 |
}
|
| 2460 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2461 |
* @since 4.0.0
|
| 2462 |
-
* @category protocol
|
| 2463 |
*/
|
| 2464 |
export type RequestEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2465 |
readonly _tag: "Request";
|
|
@@ -2468,8 +2793,11 @@ export type RequestEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> ex
|
|
| 2468 |
readonly payload: _Payload["Encoded"];
|
| 2469 |
} : never : never;
|
| 2470 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2471 |
* @since 4.0.0
|
| 2472 |
-
* @category protocol
|
| 2473 |
*/
|
| 2474 |
export type NotificationEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2475 |
readonly _tag: "Notification";
|
|
@@ -2477,8 +2805,11 @@ export type NotificationEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Grou
|
|
| 2477 |
readonly payload: _Payload["Encoded"];
|
| 2478 |
} : never : never;
|
| 2479 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2480 |
* @since 4.0.0
|
| 2481 |
-
* @category protocol
|
| 2482 |
*/
|
| 2483 |
export type SuccessEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2484 |
readonly _tag: "Success";
|
|
@@ -2486,8 +2817,11 @@ export type SuccessEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> ex
|
|
| 2486 |
readonly result: _Success["Encoded"];
|
| 2487 |
} : never : never;
|
| 2488 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2489 |
* @since 4.0.0
|
| 2490 |
-
* @category protocol
|
| 2491 |
*/
|
| 2492 |
export type FailureEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2493 |
readonly _tag: "Failure";
|
|
@@ -2707,26 +3041,41 @@ declare const ClientRequestRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"ping", Schema.U
|
|
| 2707 |
}>>;
|
| 2708 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never>>;
|
| 2709 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2710 |
* @since 4.0.0
|
| 2711 |
-
* @category protocol
|
| 2712 |
*/
|
| 2713 |
export declare class ClientRequestRpcs extends ClientRequestRpcs_base {
|
| 2714 |
}
|
| 2715 |
/**
|
|
|
|
|
|
|
|
|
|
| 2716 |
* @since 4.0.0
|
| 2717 |
-
* @category protocol
|
| 2718 |
*/
|
| 2719 |
export type ClientRequestEncoded = RequestEncoded<typeof ClientRequestRpcs>;
|
| 2720 |
declare const ClientNotificationRpcs_base: RpcGroup.RpcGroup<typeof InitializedNotification | typeof CancelledNotification | typeof ProgressNotification | typeof RootsListChangedNotification>;
|
| 2721 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2722 |
* @since 4.0.0
|
| 2723 |
-
* @category protocol
|
| 2724 |
*/
|
| 2725 |
export declare class ClientNotificationRpcs extends ClientNotificationRpcs_base {
|
| 2726 |
}
|
| 2727 |
/**
|
|
|
|
|
|
|
|
|
|
| 2728 |
* @since 4.0.0
|
| 2729 |
-
* @category protocol
|
| 2730 |
*/
|
| 2731 |
export type ClientNotificationEncoded = NotificationEncoded<typeof ClientNotificationRpcs>;
|
| 2732 |
declare const ClientRpcs_base: RpcGroup.RpcGroup<typeof InitializedNotification | typeof CancelledNotification | typeof ProgressNotification | typeof RootsListChangedNotification | Rpc.Rpc<"ping", Schema.UndefinedOr<typeof RequestMeta>, Schema.Struct<{}>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never> | Rpc.Rpc<"initialize", Schema.Struct<{
|
|
@@ -2942,79 +3291,118 @@ declare const ClientRpcs_base: RpcGroup.RpcGroup<typeof InitializedNotification
|
|
| 2942 |
}>>;
|
| 2943 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never>>;
|
| 2944 |
/**
|
|
|
|
|
|
|
|
|
|
| 2945 |
* @since 4.0.0
|
| 2946 |
-
* @category protocol
|
| 2947 |
*/
|
| 2948 |
export declare class ClientRpcs extends ClientRpcs_base {
|
| 2949 |
}
|
| 2950 |
/**
|
|
|
|
|
|
|
|
|
|
| 2951 |
* @since 4.0.0
|
| 2952 |
-
* @category protocol
|
| 2953 |
*/
|
| 2954 |
export type ClientSuccessEncoded = SuccessEncoded<typeof ServerRequestRpcs>;
|
| 2955 |
/**
|
|
|
|
|
|
|
|
|
|
| 2956 |
* @since 4.0.0
|
| 2957 |
-
* @category protocol
|
| 2958 |
*/
|
| 2959 |
export type ClientFailureEncoded = FailureEncoded<typeof ServerRequestRpcs>;
|
| 2960 |
declare const ServerRequestRpcs_base: RpcGroup.RpcGroup<typeof Ping | typeof CreateMessage | typeof ListRoots | typeof Elicit>;
|
| 2961 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2962 |
* @since 4.0.0
|
| 2963 |
-
* @category protocol
|
| 2964 |
*/
|
| 2965 |
export declare class ServerRequestRpcs extends ServerRequestRpcs_base {
|
| 2966 |
}
|
| 2967 |
/**
|
|
|
|
|
|
|
|
|
|
| 2968 |
* @since 4.0.0
|
| 2969 |
-
* @category protocol
|
| 2970 |
*/
|
| 2971 |
export type ServerRequestEncoded = RequestEncoded<typeof ServerRequestRpcs>;
|
| 2972 |
declare const ServerNotificationRpcs_base: RpcGroup.RpcGroup<typeof CancelledNotification | typeof ProgressNotification | typeof ResourceListChangedNotification | typeof ResourceUpdatedNotification | typeof PromptListChangedNotification | typeof ToolListChangedNotification | typeof LoggingMessageNotification>;
|
| 2973 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2974 |
* @since 4.0.0
|
| 2975 |
-
* @category protocol
|
| 2976 |
*/
|
| 2977 |
export declare class ServerNotificationRpcs extends ServerNotificationRpcs_base {
|
| 2978 |
}
|
| 2979 |
/**
|
|
|
|
|
|
|
|
|
|
| 2980 |
* @since 4.0.0
|
| 2981 |
-
* @category protocol
|
| 2982 |
*/
|
| 2983 |
export type ServerNotificationEncoded = NotificationEncoded<typeof ServerNotificationRpcs>;
|
| 2984 |
/**
|
|
|
|
|
|
|
|
|
|
| 2985 |
* @since 4.0.0
|
| 2986 |
-
* @category protocol
|
| 2987 |
*/
|
| 2988 |
export type ServerSuccessEncoded = SuccessEncoded<typeof ClientRequestRpcs>;
|
| 2989 |
/**
|
|
|
|
|
|
|
|
|
|
| 2990 |
* @since 4.0.0
|
| 2991 |
-
* @category protocol
|
| 2992 |
*/
|
| 2993 |
export type ServerFailureEncoded = FailureEncoded<typeof ClientRequestRpcs>;
|
| 2994 |
/**
|
|
|
|
|
|
|
|
|
|
| 2995 |
* @since 4.0.0
|
| 2996 |
-
* @category protocol
|
| 2997 |
*/
|
| 2998 |
export type ServerResultEncoded = ServerSuccessEncoded | ServerFailureEncoded;
|
| 2999 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3000 |
* @since 4.0.0
|
| 3001 |
-
* @category protocol
|
| 3002 |
*/
|
| 3003 |
export type FromClientEncoded = ClientRequestEncoded | ClientNotificationEncoded;
|
| 3004 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3005 |
* @since 4.0.0
|
| 3006 |
-
* @category protocol
|
| 3007 |
*/
|
| 3008 |
export type FromServerEncoded = ServerResultEncoded | ServerNotificationEncoded;
|
| 3009 |
declare const ParamSchemaTypeId = "~effect/ai/McpSchema/ParamSchema";
|
| 3010 |
/**
|
| 3011 |
-
*
|
|
|
|
|
|
|
| 3012 |
* @category parameters
|
|
|
|
| 3013 |
*/
|
| 3014 |
export declare function isParam(schema: Schema.Top): schema is Param<string, Schema.Top>;
|
| 3015 |
/**
|
| 3016 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3017 |
* @category parameters
|
|
|
|
| 3018 |
*/
|
| 3019 |
export interface Param<Name extends string, S extends Schema.Top> extends Schema.Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], Param<Name, S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
| 3020 |
readonly "Rebuild": Param<Name, S>;
|
|
@@ -3023,10 +3411,10 @@ export interface Param<Name extends string, S extends Schema.Top> extends Schema
|
|
| 3023 |
readonly schema: S;
|
| 3024 |
}
|
| 3025 |
/**
|
| 3026 |
-
*
|
| 3027 |
*
|
| 3028 |
-
* @since 4.0.0
|
| 3029 |
* @category parameters
|
|
|
|
| 3030 |
*/
|
| 3031 |
export declare function param<const Name extends string, S extends Schema.Top>(name: Name, schema: S): Param<Name, S>;
|
| 3032 |
declare const EnabledWhen_base: Context.ServiceClass<EnabledWhen, "effect/unstable/ai/McpSchema/EnabledWhen", Predicate.Predicate<{
|
|
@@ -3041,8 +3429,8 @@ declare const EnabledWhen_base: Context.ServiceClass<EnabledWhen, "effect/unstab
|
|
| 3041 |
* Annotation to conditionally enable or disable tools based on client
|
| 3042 |
* information.
|
| 3043 |
*
|
| 3044 |
-
* @since 4.0.0
|
| 3045 |
* @category annotations
|
|
|
|
| 3046 |
*/
|
| 3047 |
export declare class EnabledWhen extends EnabledWhen_base {
|
| 3048 |
}
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines schemas for Model Context Protocol messages.
|
| 3 |
+
*
|
| 4 |
+
* MCP clients and servers use these schemas to describe the JSON-RPC requests,
|
| 5 |
+
* notifications, results, and errors that can cross the protocol boundary. This
|
| 6 |
+
* module focuses on message shapes: it defines the shared protocol data model,
|
| 7 |
+
* groups related messages for the RPC layer, and provides helpers for optional
|
| 8 |
+
* fields and parameter metadata. Transport and server behavior live in other
|
| 9 |
+
* modules.
|
| 10 |
+
*
|
| 11 |
* @since 4.0.0
|
| 12 |
*/
|
| 13 |
import * as Context from "../../Context.ts";
|
|
|
|
| 21 |
import * as RpcGroup from "../rpc/RpcGroup.ts";
|
| 22 |
import * as RpcMiddleware from "../rpc/RpcMiddleware.ts";
|
| 23 |
/**
|
| 24 |
+
* Schema type returned by `optionalWithDefault`.
|
| 25 |
+
*
|
| 26 |
+
* **Details**
|
| 27 |
+
*
|
| 28 |
+
* It represents an optional struct field that supplies a default value when the
|
| 29 |
+
* field is absent during decoding or construction.
|
| 30 |
+
*
|
| 31 |
+
* @category models
|
| 32 |
* @since 4.0.0
|
| 33 |
*/
|
| 34 |
export interface optionalWithDefault<S extends Schema.Top & Schema.WithoutConstructorDefault> extends Schema.withConstructorDefault<Schema.decodeTo<Schema.toType<Schema.optionalKey<S>>, Schema.optionalKey<S>>> {
|
| 35 |
}
|
| 36 |
/**
|
| 37 |
+
* Marks a struct field as optional and supplies `defaultValue` when the field
|
| 38 |
+
* is absent.
|
| 39 |
+
*
|
| 40 |
+
* **Details**
|
| 41 |
+
*
|
| 42 |
+
* The default is used during decoding and as the constructor default for the
|
| 43 |
+
* schema field.
|
| 44 |
+
*
|
| 45 |
+
* @category schemas
|
| 46 |
* @since 4.0.0
|
| 47 |
*/
|
| 48 |
export declare const optionalWithDefault: <S extends Schema.Top & Schema.WithoutConstructorDefault>(schema: S, defaultValue: () => Schema.optionalKey<S>["Type"]) => optionalWithDefault<S>;
|
| 49 |
/**
|
| 50 |
+
* Creates an optional MCP struct-field schema from a required schema.
|
| 51 |
+
*
|
| 52 |
+
* **Details**
|
| 53 |
+
*
|
| 54 |
+
* The field may be absent, and explicit `undefined` values are omitted when
|
| 55 |
+
* encoding.
|
| 56 |
+
*
|
| 57 |
+
* @category schemas
|
| 58 |
* @since 4.0.0
|
| 59 |
*/
|
| 60 |
export declare const optional: <S extends Schema.Top>(schema: S) => Schema.decodeTo<Schema.optional<S>, Schema.optionalKey<S>>;
|
| 61 |
/**
|
| 62 |
+
* Schema for JSON-RPC request identifiers, allowing string or number ids.
|
| 63 |
*
|
| 64 |
+
* @category schemas
|
| 65 |
* @since 4.0.0
|
|
|
|
| 66 |
*/
|
| 67 |
export declare const RequestId: Schema.Union<[
|
| 68 |
typeof Schema.String,
|
| 69 |
typeof Schema.Number
|
| 70 |
]>;
|
| 71 |
/**
|
| 72 |
+
* Type represented by the JSON-RPC request identifier schema.
|
| 73 |
*
|
| 74 |
+
* @category models
|
| 75 |
* @since 4.0.0
|
|
|
|
| 76 |
*/
|
| 77 |
export type RequestId = typeof RequestId.Type;
|
| 78 |
/**
|
| 79 |
+
* Schema for MCP progress tokens that associate progress notifications with the
|
| 80 |
+
* original request.
|
| 81 |
*
|
| 82 |
+
* @category schemas
|
| 83 |
* @since 4.0.0
|
|
|
|
| 84 |
*/
|
| 85 |
export declare const ProgressToken: Schema.Union<[
|
| 86 |
typeof Schema.String,
|
| 87 |
typeof Schema.Number
|
| 88 |
]>;
|
| 89 |
/**
|
| 90 |
+
* Type represented by the MCP progress token schema.
|
|
|
|
| 91 |
*
|
| 92 |
+
* @category models
|
| 93 |
* @since 4.0.0
|
|
|
|
| 94 |
*/
|
| 95 |
export type ProgressToken = typeof ProgressToken.Type;
|
| 96 |
declare const RequestMeta_base: Schema.Opaque<RequestMeta, Schema.Struct<{
|
|
|
|
| 135 |
}>>, never, never>;
|
| 136 |
}>, keyof Schema.Top>;
|
| 137 |
/**
|
| 138 |
+
* Schema for optional MCP request metadata.
|
| 139 |
+
*
|
| 140 |
+
* **Details**
|
| 141 |
+
*
|
| 142 |
+
* Request metadata may include a progress token that asks the receiver to send
|
| 143 |
+
* out-of-band progress notifications for the request.
|
| 144 |
+
*
|
| 145 |
+
* @category schemas
|
| 146 |
* @since 4.0.0
|
|
|
|
| 147 |
*/
|
| 148 |
export declare class RequestMeta extends RequestMeta_base {
|
| 149 |
}
|
|
|
|
| 161 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 162 |
}>, keyof Schema.Top>;
|
| 163 |
/**
|
| 164 |
+
* Schema for optional MCP result metadata.
|
| 165 |
+
*
|
| 166 |
+
* **Details**
|
| 167 |
+
*
|
| 168 |
+
* The `_meta` field is reserved for protocol, extension, or implementation
|
| 169 |
+
* metadata attached to a result.
|
| 170 |
+
*
|
| 171 |
+
* @category schemas
|
| 172 |
* @since 4.0.0
|
|
|
|
| 173 |
*/
|
| 174 |
export declare class ResultMeta extends ResultMeta_base {
|
| 175 |
}
|
|
|
|
| 187 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 188 |
}>, keyof Schema.Top>;
|
| 189 |
/**
|
| 190 |
+
* Schema for optional MCP notification metadata.
|
| 191 |
+
*
|
| 192 |
+
* **Details**
|
| 193 |
+
*
|
| 194 |
+
* The `_meta` field is reserved for protocol, extension, or implementation
|
| 195 |
+
* metadata attached to a notification.
|
| 196 |
+
*
|
| 197 |
+
* @category schemas
|
| 198 |
* @since 4.0.0
|
|
|
|
| 199 |
*/
|
| 200 |
export declare class NotificationMeta extends NotificationMeta_base {
|
| 201 |
}
|
| 202 |
/**
|
| 203 |
+
* Schema for opaque cursor tokens used in pagination.
|
| 204 |
*
|
| 205 |
+
* @category schemas
|
| 206 |
* @since 4.0.0
|
|
|
|
| 207 |
*/
|
| 208 |
export declare const Cursor: typeof Schema.String;
|
| 209 |
/**
|
| 210 |
+
* Type represented by the MCP cursor schema.
|
| 211 |
+
*
|
| 212 |
+
* **Details**
|
| 213 |
+
*
|
| 214 |
+
* A cursor is an opaque string token used to continue paginated requests.
|
| 215 |
+
*
|
| 216 |
+
* @category models
|
| 217 |
* @since 4.0.0
|
|
|
|
| 218 |
*/
|
| 219 |
export type Cursor = typeof Cursor.Type;
|
| 220 |
declare const PaginatedRequestMeta_base: Schema.Opaque<PaginatedRequestMeta, Schema.Struct<{
|
|
|
|
| 269 |
}>>, never, never>;
|
| 270 |
}>, keyof Schema.Top>;
|
| 271 |
/**
|
| 272 |
+
* Schema for MCP request metadata used by paginated requests.
|
| 273 |
+
*
|
| 274 |
+
* **Details**
|
| 275 |
+
*
|
| 276 |
+
* It includes the base request metadata fields plus an optional cursor
|
| 277 |
+
* indicating where the server should continue listing results.
|
| 278 |
+
*
|
| 279 |
+
* @category schemas
|
| 280 |
* @since 4.0.0
|
|
|
|
| 281 |
*/
|
| 282 |
export declare class PaginatedRequestMeta extends PaginatedRequestMeta_base {
|
| 283 |
}
|
|
|
|
| 305 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 306 |
}>, keyof Schema.Top>;
|
| 307 |
/**
|
| 308 |
+
* Schema for MCP result metadata returned by paginated operations.
|
| 309 |
+
*
|
| 310 |
+
* **Details**
|
| 311 |
+
*
|
| 312 |
+
* It includes the base result metadata fields plus an optional `nextCursor`,
|
| 313 |
+
* which indicates that more results may be available.
|
| 314 |
+
*
|
| 315 |
+
* @category schemas
|
| 316 |
* @since 4.0.0
|
|
|
|
| 317 |
*/
|
| 318 |
export declare class PaginatedResultMeta extends PaginatedResultMeta_base {
|
| 319 |
}
|
| 320 |
/**
|
| 321 |
+
* Schema for MCP conversation roles, allowing user and assistant.
|
| 322 |
+
*
|
| 323 |
+
* @category schemas
|
| 324 |
* @since 4.0.0
|
|
|
|
| 325 |
*/
|
| 326 |
export declare const Role: Schema.Literals<["user", "assistant"]>;
|
| 327 |
/**
|
| 328 |
+
* Type represented by the MCP role schema.
|
| 329 |
+
*
|
| 330 |
+
* **Details**
|
| 331 |
+
*
|
| 332 |
+
* Valid roles are `"user"` and `"assistant"`.
|
| 333 |
+
*
|
| 334 |
+
* @category models
|
| 335 |
* @since 4.0.0
|
|
|
|
| 336 |
*/
|
| 337 |
export type Role = typeof Role.Type;
|
| 338 |
declare const Annotations_base: Schema.Opaque<Annotations, Schema.Struct<{
|
|
|
|
| 369 |
readonly priority: Schema.decodeTo<Schema.optional<Schema.Number>, Schema.optionalKey<Schema.Number>, never, never>;
|
| 370 |
}>, keyof Schema.Top>;
|
| 371 |
/**
|
| 372 |
+
* Schema for optional client-facing annotations on MCP objects.
|
|
|
|
| 373 |
*
|
| 374 |
+
* **When to use**
|
| 375 |
+
*
|
| 376 |
+
* Use to describe intended audience and priority metadata for objects shown or
|
| 377 |
+
* processed by a client.
|
| 378 |
+
*
|
| 379 |
+
* @category schemas
|
| 380 |
* @since 4.0.0
|
|
|
|
| 381 |
*/
|
| 382 |
export declare class Annotations extends Annotations_base {
|
| 383 |
}
|
|
|
|
| 393 |
/**
|
| 394 |
* Describes the name and version of an MCP implementation.
|
| 395 |
*
|
| 396 |
+
* @category schemas
|
| 397 |
* @since 4.0.0
|
|
|
|
| 398 |
*/
|
| 399 |
export declare class Implementation extends Implementation_base {
|
| 400 |
}
|
|
|
|
| 432 |
readonly elicitation: Schema.decodeTo<Schema.optional<Schema.Struct<{}>>, Schema.optionalKey<Schema.Struct<{}>>, never, never>;
|
| 433 |
}>, {}>;
|
| 434 |
/**
|
| 435 |
+
* Describes capabilities advertised by an MCP client.
|
| 436 |
+
*
|
| 437 |
+
* **When to use**
|
| 438 |
+
*
|
| 439 |
+
* Use to describe which optional MCP features a client supports during
|
| 440 |
+
* initialization.
|
| 441 |
+
*
|
| 442 |
+
* **Details**
|
| 443 |
*
|
| 444 |
+
* Known capabilities are represented by this schema, but the capability set is
|
| 445 |
+
* open and clients may define additional capabilities.
|
| 446 |
+
*
|
| 447 |
+
* @category schemas
|
| 448 |
* @since 4.0.0
|
|
|
|
| 449 |
*/
|
| 450 |
export declare class ClientCapabilities extends ClientCapabilities_base {
|
| 451 |
}
|
|
|
|
| 587 |
}>>, never, never>;
|
| 588 |
}>, keyof Schema.Top>;
|
| 589 |
/**
|
| 590 |
+
* Describes capabilities advertised by an MCP server.
|
| 591 |
+
*
|
| 592 |
+
* **When to use**
|
| 593 |
+
*
|
| 594 |
+
* Use to describe which optional MCP features a server supports during
|
| 595 |
+
* initialization.
|
| 596 |
+
*
|
| 597 |
+
* **Details**
|
| 598 |
+
*
|
| 599 |
+
* Known capabilities are represented by this schema, but the capability set is
|
| 600 |
+
* open and servers may define additional capabilities.
|
| 601 |
*
|
| 602 |
+
* @category schemas
|
| 603 |
* @since 4.0.0
|
|
|
|
| 604 |
*/
|
| 605 |
export declare class ServerCapabilities extends ServerCapabilities_base {
|
| 606 |
}
|
|
|
|
| 621 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 622 |
}>, {}>;
|
| 623 |
/**
|
| 624 |
+
* Schema for MCP and JSON-RPC error objects.
|
| 625 |
+
*
|
| 626 |
+
* **Details**
|
| 627 |
+
*
|
| 628 |
+
* It contains the numeric error `code`, a concise `message`, and optional
|
| 629 |
+
* sender-defined `data`.
|
| 630 |
+
*
|
| 631 |
+
* @category schemas
|
| 632 |
* @since 4.0.0
|
|
|
|
| 633 |
*/
|
| 634 |
export declare class McpErrorBase extends McpErrorBase_base {
|
| 635 |
}
|
| 636 |
/**
|
| 637 |
+
* Represents the JSON-RPC error code for requests that are not valid request objects.
|
| 638 |
+
*
|
| 639 |
+
* **When to use**
|
| 640 |
+
*
|
| 641 |
+
* Use when building an MCP/JSON-RPC error response for a syntactically parsed
|
| 642 |
+
* request object that fails request-shape validation.
|
| 643 |
+
*
|
| 644 |
+
* @category constants
|
| 645 |
* @since 4.0.0
|
|
|
|
| 646 |
*/
|
| 647 |
export declare const INVALID_REQUEST_ERROR_CODE: -32600;
|
| 648 |
/**
|
| 649 |
+
* Represents the JSON-RPC error code for requests whose method does not exist or is not
|
| 650 |
+
* available.
|
| 651 |
+
*
|
| 652 |
+
* **When to use**
|
| 653 |
+
*
|
| 654 |
+
* Use when building an MCP/JSON-RPC error response for a request whose
|
| 655 |
+
* `method` is unknown or unavailable.
|
| 656 |
+
*
|
| 657 |
+
* @category constants
|
| 658 |
* @since 4.0.0
|
|
|
|
| 659 |
*/
|
| 660 |
export declare const METHOD_NOT_FOUND_ERROR_CODE: -32601;
|
| 661 |
/**
|
| 662 |
+
* Represents the JSON-RPC error code for invalid method parameters.
|
| 663 |
+
*
|
| 664 |
+
* **When to use**
|
| 665 |
+
*
|
| 666 |
+
* Use when building an MCP/JSON-RPC error response for decoded request
|
| 667 |
+
* parameters that fail method-specific validation.
|
| 668 |
+
*
|
| 669 |
+
* @category constants
|
| 670 |
* @since 4.0.0
|
|
|
|
| 671 |
*/
|
| 672 |
export declare const INVALID_PARAMS_ERROR_CODE: -32602;
|
| 673 |
/**
|
| 674 |
+
* Represents the JSON-RPC error code for internal server errors.
|
| 675 |
+
*
|
| 676 |
+
* **When to use**
|
| 677 |
+
*
|
| 678 |
+
* Use when building an MCP/JSON-RPC error response for an unexpected
|
| 679 |
+
* server-side failure.
|
| 680 |
+
*
|
| 681 |
+
* @category constants
|
| 682 |
* @since 4.0.0
|
|
|
|
| 683 |
*/
|
| 684 |
export declare const INTERNAL_ERROR_CODE: -32603;
|
| 685 |
/**
|
| 686 |
+
* Represents the JSON-RPC error code for invalid JSON that could not be parsed.
|
| 687 |
+
*
|
| 688 |
+
* **When to use**
|
| 689 |
+
*
|
| 690 |
+
* Use when building an MCP/JSON-RPC error response before a request object is
|
| 691 |
+
* available because the JSON payload could not be parsed.
|
| 692 |
+
*
|
| 693 |
+
* @category constants
|
| 694 |
* @since 4.0.0
|
|
|
|
| 695 |
*/
|
| 696 |
export declare const PARSE_ERROR_CODE: -32700;
|
| 697 |
declare const ParseError_base: Schema.Class<ParseError, Schema.Struct<{
|
|
|
|
| 709 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 710 |
}>, import("../../Cause.ts").YieldableError>;
|
| 711 |
/**
|
| 712 |
+
* Represents an MCP/JSON-RPC error for invalid JSON that could not be parsed.
|
| 713 |
+
*
|
| 714 |
+
* **When to use**
|
| 715 |
+
*
|
| 716 |
+
* Use to report a JSON parse failure before a valid JSON-RPC request object is
|
| 717 |
+
* available.
|
| 718 |
+
*
|
| 719 |
+
* **Details**
|
| 720 |
+
*
|
| 721 |
+
* Uses the standard JSON-RPC parse error code `-32700`.
|
| 722 |
+
*
|
| 723 |
* @category errors
|
| 724 |
+
* @since 4.0.0
|
| 725 |
*/
|
| 726 |
export declare class ParseError extends ParseError_base {
|
| 727 |
}
|
|
|
|
| 740 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 741 |
}>, import("../../Cause.ts").YieldableError>;
|
| 742 |
/**
|
| 743 |
+
* Represents an MCP/JSON-RPC error for a request object that is not valid.
|
| 744 |
+
*
|
| 745 |
+
* **When to use**
|
| 746 |
+
*
|
| 747 |
+
* Use to report a syntactically parsed JSON-RPC request that is not a valid
|
| 748 |
+
* request object.
|
| 749 |
+
*
|
| 750 |
+
* **Details**
|
| 751 |
+
*
|
| 752 |
+
* Uses the standard JSON-RPC invalid request code `-32600`.
|
| 753 |
+
*
|
| 754 |
* @category errors
|
| 755 |
+
* @since 4.0.0
|
| 756 |
*/
|
| 757 |
export declare class InvalidRequest extends InvalidRequest_base {
|
| 758 |
}
|
|
|
|
| 771 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 772 |
}>, import("../../Cause.ts").YieldableError>;
|
| 773 |
/**
|
| 774 |
+
* Represents an MCP/JSON-RPC error for an unavailable method.
|
| 775 |
+
*
|
| 776 |
+
* **When to use**
|
| 777 |
+
*
|
| 778 |
+
* Use to report a JSON-RPC method that does not exist or is not available.
|
| 779 |
+
*
|
| 780 |
+
* **Details**
|
| 781 |
+
*
|
| 782 |
+
* Uses the standard JSON-RPC method-not-found code `-32601`.
|
| 783 |
+
*
|
| 784 |
* @category errors
|
| 785 |
+
* @since 4.0.0
|
| 786 |
*/
|
| 787 |
export declare class MethodNotFound extends MethodNotFound_base {
|
| 788 |
}
|
|
|
|
| 801 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 802 |
}>, import("../../Cause.ts").YieldableError>;
|
| 803 |
/**
|
| 804 |
+
* Represents an MCP/JSON-RPC error for invalid method parameters.
|
| 805 |
+
*
|
| 806 |
+
* **When to use**
|
| 807 |
+
*
|
| 808 |
+
* Use to report a request whose method parameters do not match the method
|
| 809 |
+
* schema.
|
| 810 |
+
*
|
| 811 |
+
* **Details**
|
| 812 |
+
*
|
| 813 |
+
* Uses the standard JSON-RPC invalid params code `-32602`.
|
| 814 |
+
*
|
| 815 |
* @category errors
|
| 816 |
+
* @since 4.0.0
|
| 817 |
*/
|
| 818 |
export declare class InvalidParams extends InvalidParams_base {
|
| 819 |
}
|
|
|
|
| 832 |
readonly data: Schema.decodeTo<Schema.optional<Schema.Any>, Schema.optionalKey<Schema.Any>, never, never>;
|
| 833 |
}>, import("../../Cause.ts").YieldableError>;
|
| 834 |
/**
|
| 835 |
+
* Represents an MCP/JSON-RPC error for unexpected internal server failures.
|
| 836 |
+
*
|
| 837 |
+
* **When to use**
|
| 838 |
+
*
|
| 839 |
+
* Use to report an unexpected server-side failure while handling a valid
|
| 840 |
+
* request.
|
| 841 |
+
*
|
| 842 |
+
* **Details**
|
| 843 |
+
*
|
| 844 |
+
* Uses the standard JSON-RPC internal error code `-32603` and includes
|
| 845 |
+
* `InternalError.notImplemented` for unimplemented handlers.
|
| 846 |
+
*
|
| 847 |
* @category errors
|
| 848 |
+
* @since 4.0.0
|
| 849 |
*/
|
| 850 |
export declare class InternalError extends InternalError_base {
|
| 851 |
static readonly notImplemented: InternalError;
|
| 852 |
}
|
| 853 |
/**
|
| 854 |
+
* Schema for MCP protocol errors returned in JSON-RPC failure responses,
|
| 855 |
+
* including standard protocol errors and custom `McpErrorBase` values.
|
| 856 |
+
*
|
| 857 |
* @category errors
|
| 858 |
+
* @since 4.0.0
|
| 859 |
*/
|
| 860 |
export declare const McpError: Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>;
|
| 861 |
declare const Ping_base: Rpc.Rpc<"ping", Schema.UndefinedOr<typeof RequestMeta>, Schema.Struct<{}>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 862 |
/**
|
| 863 |
+
* Represents an MCP ping request used to check whether the peer is still alive.
|
| 864 |
+
*
|
| 865 |
+
* **When to use**
|
| 866 |
+
*
|
| 867 |
+
* Use to implement client or server liveness checks.
|
| 868 |
+
*
|
| 869 |
+
* **Details**
|
| 870 |
+
*
|
| 871 |
+
* The receiver should respond promptly; otherwise the sender may disconnect.
|
| 872 |
*
|
|
|
|
| 873 |
* @category ping
|
| 874 |
+
* @since 4.0.0
|
| 875 |
*/
|
| 876 |
export declare class Ping extends Ping_base {
|
| 877 |
}
|
|
|
|
| 921 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 922 |
}>, keyof Schema.Top>;
|
| 923 |
/**
|
| 924 |
+
* Schema for the server's response to an initialize request from the client.
|
|
|
|
| 925 |
*
|
|
|
|
| 926 |
* @category initialization
|
| 927 |
+
* @since 4.0.0
|
| 928 |
*/
|
| 929 |
export declare class InitializeResult extends InitializeResult_base {
|
| 930 |
}
|
|
|
|
| 965 |
}>>, never, never>;
|
| 966 |
}>, typeof InitializeResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 967 |
/**
|
| 968 |
+
* Sent from the client to the server when it first connects, asking it to begin
|
| 969 |
+
* initialization.
|
| 970 |
*
|
|
|
|
| 971 |
* @category initialization
|
| 972 |
+
* @since 4.0.0
|
| 973 |
*/
|
| 974 |
export declare class Initialize extends Initialize_base {
|
| 975 |
}
|
| 976 |
declare const InitializedNotification_base: Rpc.Rpc<"notifications/initialized", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 977 |
/**
|
| 978 |
+
* Sent from the client to the server after initialization has finished.
|
|
|
|
| 979 |
*
|
|
|
|
| 980 |
* @category initialization
|
| 981 |
+
* @since 4.0.0
|
| 982 |
*/
|
| 983 |
export declare class InitializedNotification extends InitializedNotification_base {
|
| 984 |
}
|
|
|
|
| 998 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 999 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 1000 |
/**
|
| 1001 |
+
* Sent from either peer to cancel a previously issued request in the same
|
| 1002 |
+
* direction.
|
| 1003 |
+
*
|
| 1004 |
+
* **Details**
|
| 1005 |
+
*
|
| 1006 |
+
* The payload identifies the request to cancel and may include a
|
| 1007 |
+
* human-readable reason.
|
| 1008 |
+
*
|
| 1009 |
* @category cancellation
|
| 1010 |
+
* @since 4.0.0
|
| 1011 |
*/
|
| 1012 |
export declare class CancelledNotification extends CancelledNotification_base {
|
| 1013 |
}
|
|
|
|
| 1033 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1034 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 1035 |
/**
|
| 1036 |
+
* Sent from either peer to report progress for a long-running request.
|
|
|
|
| 1037 |
*
|
|
|
|
| 1038 |
* @category progress
|
| 1039 |
+
* @since 4.0.0
|
| 1040 |
*/
|
| 1041 |
export declare class ProgressNotification extends ProgressNotification_base {
|
| 1042 |
}
|
|
|
|
| 1084 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1085 |
}>, {}>;
|
| 1086 |
/**
|
| 1087 |
+
* Schema for a known resource that the server is capable of reading.
|
| 1088 |
*
|
|
|
|
| 1089 |
* @category resources
|
| 1090 |
+
* @since 4.0.0
|
| 1091 |
*/
|
| 1092 |
export declare class Resource extends Resource_base {
|
| 1093 |
}
|
|
|
|
| 1126 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1127 |
}>, {}>;
|
| 1128 |
/**
|
| 1129 |
+
* Schema for a template description of resources available on the server.
|
| 1130 |
*
|
|
|
|
| 1131 |
* @category resources
|
| 1132 |
+
* @since 4.0.0
|
| 1133 |
*/
|
| 1134 |
export declare class ResourceTemplate extends ResourceTemplate_base {
|
| 1135 |
}
|
|
|
|
| 1161 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1162 |
}>, keyof Schema.Top>;
|
| 1163 |
/**
|
| 1164 |
+
* Schema for the contents of a specific resource or sub-resource.
|
| 1165 |
*
|
|
|
|
| 1166 |
* @category resources
|
| 1167 |
+
* @since 4.0.0
|
| 1168 |
*/
|
| 1169 |
export declare class ResourceContents extends ResourceContents_base {
|
| 1170 |
}
|
|
|
|
| 1206 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1207 |
}>, keyof Schema.Top>;
|
| 1208 |
/**
|
| 1209 |
+
* Schema for text resource contents represented as a string.
|
| 1210 |
*
|
|
|
|
| 1211 |
* @category resources
|
| 1212 |
+
* @since 4.0.0
|
| 1213 |
*/
|
| 1214 |
export declare class TextResourceContents extends TextResourceContents_base {
|
| 1215 |
}
|
|
|
|
| 1249 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1250 |
}>, keyof Schema.Top>;
|
| 1251 |
/**
|
| 1252 |
+
* Schema for binary resource contents represented as a `Uint8Array`.
|
| 1253 |
*
|
|
|
|
| 1254 |
* @category resources
|
| 1255 |
+
* @since 4.0.0
|
| 1256 |
*/
|
| 1257 |
export declare class BlobResourceContents extends BlobResourceContents_base {
|
| 1258 |
}
|
|
|
|
| 1270 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1271 |
}>, {}>;
|
| 1272 |
/**
|
| 1273 |
+
* Schema for the server's response to a resources/list request from the client.
|
| 1274 |
*
|
|
|
|
| 1275 |
* @category resources
|
| 1276 |
+
* @since 4.0.0
|
| 1277 |
*/
|
| 1278 |
export declare class ListResourcesResult extends ListResourcesResult_base {
|
| 1279 |
}
|
|
|
|
| 1281 |
/**
|
| 1282 |
* Sent from the client to request a list of resources the server has.
|
| 1283 |
*
|
|
|
|
| 1284 |
* @category resources
|
| 1285 |
+
* @since 4.0.0
|
| 1286 |
*/
|
| 1287 |
export declare class ListResources extends ListResources_base {
|
| 1288 |
}
|
|
|
|
| 1300 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1301 |
}>, {}>;
|
| 1302 |
/**
|
| 1303 |
+
* Schema for the server's response to a resources/templates/list request from
|
| 1304 |
+
* the client.
|
| 1305 |
*
|
|
|
|
| 1306 |
* @category resources
|
| 1307 |
+
* @since 4.0.0
|
| 1308 |
*/
|
| 1309 |
export declare class ListResourceTemplatesResult extends ListResourceTemplatesResult_base {
|
| 1310 |
}
|
|
|
|
| 1312 |
/**
|
| 1313 |
* Sent from the client to request a list of resource templates the server has.
|
| 1314 |
*
|
|
|
|
| 1315 |
* @category resources
|
| 1316 |
+
* @since 4.0.0
|
| 1317 |
*/
|
| 1318 |
export declare class ListResourceTemplates extends ListResourceTemplates_base {
|
| 1319 |
}
|
|
|
|
| 1333 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1334 |
}>, keyof Schema.Top>;
|
| 1335 |
/**
|
| 1336 |
+
* Schema for the server's response to a resources/read request from the client.
|
| 1337 |
*
|
|
|
|
| 1338 |
* @category resources
|
| 1339 |
+
* @since 4.0.0
|
| 1340 |
*/
|
| 1341 |
export declare class ReadResourceResult extends ReadResourceResult_base {
|
| 1342 |
}
|
|
|
|
| 1369 |
/**
|
| 1370 |
* Sent from the client to the server, to read a specific resource URI.
|
| 1371 |
*
|
|
|
|
| 1372 |
* @category resources
|
| 1373 |
+
* @since 4.0.0
|
| 1374 |
*/
|
| 1375 |
export declare class ReadResource extends ReadResource_base {
|
| 1376 |
}
|
| 1377 |
declare const ResourceListChangedNotification_base: Rpc.Rpc<"notifications/resources/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 1378 |
/**
|
| 1379 |
+
* Represents a notification that the server's resource list changed.
|
| 1380 |
+
*
|
| 1381 |
+
* **When to use**
|
| 1382 |
+
*
|
| 1383 |
+
* Use to notify clients that `resources/list` should be requested again.
|
| 1384 |
+
*
|
| 1385 |
+
* **Details**
|
| 1386 |
+
*
|
| 1387 |
+
* Servers may send this notification without a previous client subscription.
|
| 1388 |
*
|
|
|
|
| 1389 |
* @category resources
|
| 1390 |
+
* @since 4.0.0
|
| 1391 |
*/
|
| 1392 |
export declare class ResourceListChangedNotification extends ResourceListChangedNotification_base {
|
| 1393 |
}
|
|
|
|
| 1421 |
* Sent from the client to request resources/updated notifications from the
|
| 1422 |
* server whenever a particular resource changes.
|
| 1423 |
*
|
|
|
|
| 1424 |
* @category resources
|
| 1425 |
+
* @since 4.0.0
|
| 1426 |
*/
|
| 1427 |
export declare class Subscribe extends Subscribe_base {
|
| 1428 |
}
|
|
|
|
| 1457 |
* notifications from the server. This should follow a previous
|
| 1458 |
* resources/subscribe request.
|
| 1459 |
*
|
|
|
|
| 1460 |
* @category resources
|
| 1461 |
+
* @since 4.0.0
|
| 1462 |
*/
|
| 1463 |
export declare class Unsubscribe extends Unsubscribe_base {
|
| 1464 |
}
|
|
|
|
| 1470 |
_meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1471 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 1472 |
/**
|
| 1473 |
+
* Sent from the server when a subscribed resource URI has changed.
|
| 1474 |
+
*
|
| 1475 |
+
* **Details**
|
| 1476 |
+
*
|
| 1477 |
+
* The URI may identify a sub-resource of the resource that the client
|
| 1478 |
+
* originally subscribed to.
|
| 1479 |
+
*
|
| 1480 |
* @category resources
|
| 1481 |
+
* @since 4.0.0
|
| 1482 |
*/
|
| 1483 |
export declare class ResourceUpdatedNotification extends ResourceUpdatedNotification_base {
|
| 1484 |
}
|
|
|
|
| 1514 |
/**
|
| 1515 |
* Describes an argument that a prompt can accept.
|
| 1516 |
*
|
| 1517 |
+
* @category schemas
|
| 1518 |
* @since 4.0.0
|
|
|
|
| 1519 |
*/
|
| 1520 |
export declare class PromptArgument extends PromptArgument_base {
|
| 1521 |
}
|
|
|
|
| 1535 |
readonly arguments: Schema.decodeTo<Schema.optional<Schema.$Array<typeof PromptArgument>>, Schema.optionalKey<Schema.$Array<typeof PromptArgument>>, never, never>;
|
| 1536 |
}>, {}>;
|
| 1537 |
/**
|
| 1538 |
+
* Represents a prompt or prompt template that the server offers.
|
| 1539 |
*
|
| 1540 |
+
* @category schemas
|
| 1541 |
* @since 4.0.0
|
|
|
|
| 1542 |
*/
|
| 1543 |
export declare class Prompt extends Prompt_base {
|
| 1544 |
}
|
|
|
|
| 1564 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1565 |
}>, keyof Schema.Top>;
|
| 1566 |
/**
|
| 1567 |
+
* Represents text content provided to or from an LLM.
|
| 1568 |
*
|
| 1569 |
+
* @category schemas
|
| 1570 |
* @since 4.0.0
|
|
|
|
| 1571 |
*/
|
| 1572 |
export declare class TextContent extends TextContent_base {
|
| 1573 |
}
|
|
|
|
| 1603 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1604 |
}>, keyof Schema.Top>;
|
| 1605 |
/**
|
| 1606 |
+
* Represents image content provided to or from an LLM.
|
| 1607 |
*
|
| 1608 |
+
* @category schemas
|
| 1609 |
* @since 4.0.0
|
|
|
|
| 1610 |
*/
|
| 1611 |
export declare class ImageContent extends ImageContent_base {
|
| 1612 |
}
|
|
|
|
| 1642 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1643 |
}>, keyof Schema.Top>;
|
| 1644 |
/**
|
| 1645 |
+
* Represents audio content provided to or from an LLM.
|
| 1646 |
*
|
| 1647 |
+
* @category schemas
|
| 1648 |
* @since 4.0.0
|
|
|
|
| 1649 |
*/
|
| 1650 |
export declare class AudioContent extends AudioContent_base {
|
| 1651 |
}
|
|
|
|
| 1665 |
readonly annotations: Schema.decodeTo<Schema.optional<typeof Annotations>, Schema.optionalKey<typeof Annotations>, never, never>;
|
| 1666 |
}>, keyof Schema.Top>;
|
| 1667 |
/**
|
| 1668 |
+
* Represents resource contents embedded into a prompt or tool call result.
|
| 1669 |
+
*
|
| 1670 |
+
* **Details**
|
| 1671 |
*
|
| 1672 |
* It is up to the client how best to render embedded resources for the benefit
|
| 1673 |
* of the LLM and/or the user.
|
| 1674 |
*
|
| 1675 |
+
* @category schemas
|
| 1676 |
* @since 4.0.0
|
|
|
|
| 1677 |
*/
|
| 1678 |
export declare class EmbeddedResource extends EmbeddedResource_base {
|
| 1679 |
}
|
|
|
|
| 1765 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1766 |
}>, keyof Schema.Top>;
|
| 1767 |
/**
|
| 1768 |
+
* Represents a readable resource included in a prompt or tool call result.
|
| 1769 |
*
|
| 1770 |
+
* **Gotchas**
|
| 1771 |
*
|
| 1772 |
+
* Resource links returned by tools are not guaranteed to appear in the results
|
| 1773 |
+
* of `resources/list` requests.
|
| 1774 |
+
*
|
| 1775 |
+
* @category schemas
|
| 1776 |
* @since 4.0.0
|
|
|
|
| 1777 |
*/
|
| 1778 |
export declare class ResourceLink extends ResourceLink_base {
|
| 1779 |
}
|
| 1780 |
/**
|
| 1781 |
+
* Schema for MCP content blocks that can appear in prompt messages or tool
|
| 1782 |
+
* results.
|
| 1783 |
+
*
|
| 1784 |
+
* @category schemas
|
| 1785 |
* @since 4.0.0
|
|
|
|
| 1786 |
*/
|
| 1787 |
export declare const ContentBlock: Schema.Union<readonly [typeof TextContent, typeof ImageContent, typeof AudioContent, typeof EmbeddedResource, typeof ResourceLink]>;
|
| 1788 |
declare const PromptMessage_base: Schema.Opaque<PromptMessage, Schema.Struct<{
|
|
|
|
| 1795 |
/**
|
| 1796 |
* Describes a message returned as part of a prompt.
|
| 1797 |
*
|
| 1798 |
+
* **Details**
|
| 1799 |
+
*
|
| 1800 |
* This is similar to `SamplingMessage`, but also supports the embedding of
|
| 1801 |
* resources from the MCP server.
|
| 1802 |
*
|
| 1803 |
+
* @category schemas
|
| 1804 |
* @since 4.0.0
|
|
|
|
| 1805 |
*/
|
| 1806 |
export declare class PromptMessage extends PromptMessage_base {
|
| 1807 |
}
|
|
|
|
| 1819 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1820 |
}>, {}>;
|
| 1821 |
/**
|
| 1822 |
+
* Represents the server response to a prompts/list request from the client.
|
| 1823 |
*
|
| 1824 |
+
* @category schemas
|
| 1825 |
* @since 4.0.0
|
|
|
|
| 1826 |
*/
|
| 1827 |
export declare class ListPromptsResult extends ListPromptsResult_base {
|
| 1828 |
}
|
|
|
|
| 1831 |
* Sent from the client to request a list of prompts and prompt templates the
|
| 1832 |
* server has.
|
| 1833 |
*
|
| 1834 |
+
* @category protocols
|
| 1835 |
* @since 4.0.0
|
|
|
|
| 1836 |
*/
|
| 1837 |
export declare class ListPrompts extends ListPrompts_base {
|
| 1838 |
}
|
|
|
|
| 1849 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 1850 |
}>, {}>;
|
| 1851 |
/**
|
| 1852 |
+
* Represents the server response to a prompts/get request from the client.
|
| 1853 |
*
|
| 1854 |
+
* @category schemas
|
| 1855 |
* @since 4.0.0
|
|
|
|
| 1856 |
*/
|
| 1857 |
export declare class GetPromptResult extends GetPromptResult_base {
|
| 1858 |
}
|
|
|
|
| 1887 |
}>>, never, never>;
|
| 1888 |
}>, typeof GetPromptResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 1889 |
/**
|
| 1890 |
+
* Sent from the client to get a prompt provided by the server.
|
| 1891 |
*
|
| 1892 |
+
* @category protocols
|
| 1893 |
* @since 4.0.0
|
|
|
|
| 1894 |
*/
|
| 1895 |
export declare class GetPrompt extends GetPrompt_base {
|
| 1896 |
}
|
| 1897 |
declare const PromptListChangedNotification_base: Rpc.Rpc<"notifications/prompts/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 1898 |
/**
|
| 1899 |
+
* Represents a notification that the server's prompt list changed.
|
| 1900 |
+
*
|
| 1901 |
+
* **When to use**
|
| 1902 |
+
*
|
| 1903 |
+
* Use to notify clients that `prompts/list` should be requested again.
|
| 1904 |
+
*
|
| 1905 |
+
* **Details**
|
| 1906 |
+
*
|
| 1907 |
+
* Servers may send this notification without a previous client subscription.
|
| 1908 |
*
|
| 1909 |
+
* @category protocols
|
| 1910 |
* @since 4.0.0
|
|
|
|
| 1911 |
*/
|
| 1912 |
export declare class PromptListChangedNotification extends PromptListChangedNotification_base {
|
| 1913 |
}
|
|
|
|
| 1989 |
readonly openWorldHint: optionalWithDefault<Schema.Boolean>;
|
| 1990 |
}>, keyof Schema.Top>;
|
| 1991 |
/**
|
| 1992 |
+
* Schema for additional properties describing a tool to clients.
|
| 1993 |
+
*
|
| 1994 |
+
* **Details**
|
| 1995 |
*
|
| 1996 |
* NOTE: all properties in ToolAnnotations are **hints**. They are not
|
| 1997 |
* guaranteed to provide a faithful description of tool behavior (including
|
| 1998 |
* descriptive properties like `title`).
|
| 1999 |
*
|
| 2000 |
+
* **Gotchas**
|
| 2001 |
+
*
|
| 2002 |
* Clients should never make tool use decisions based on ToolAnnotations
|
| 2003 |
* received from untrusted servers.
|
| 2004 |
*
|
|
|
|
| 2005 |
* @category tools
|
| 2006 |
+
* @since 4.0.0
|
| 2007 |
*/
|
| 2008 |
export declare class ToolAnnotations extends ToolAnnotations_base {
|
| 2009 |
}
|
|
|
|
| 2036 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2037 |
}>, {}>;
|
| 2038 |
/**
|
| 2039 |
+
* Schema for the definition of a tool the client can call.
|
| 2040 |
*
|
|
|
|
| 2041 |
* @category tools
|
| 2042 |
+
* @since 4.0.0
|
| 2043 |
*/
|
| 2044 |
export declare class Tool extends Tool_base {
|
| 2045 |
}
|
|
|
|
| 2057 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2058 |
}>, {}>;
|
| 2059 |
/**
|
| 2060 |
+
* Schema for the server's response to a tools/list request from the client.
|
| 2061 |
*
|
|
|
|
| 2062 |
* @category tools
|
| 2063 |
+
* @since 4.0.0
|
| 2064 |
*/
|
| 2065 |
export declare class ListToolsResult extends ListToolsResult_base {
|
| 2066 |
}
|
|
|
|
| 2068 |
/**
|
| 2069 |
* Sent from the client to request a list of tools the server has.
|
| 2070 |
*
|
|
|
|
| 2071 |
* @category tools
|
| 2072 |
+
* @since 4.0.0
|
| 2073 |
*/
|
| 2074 |
export declare class ListTools extends ListTools_base {
|
| 2075 |
}
|
|
|
|
| 2089 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2090 |
}>, {}>;
|
| 2091 |
/**
|
| 2092 |
+
* Schema for the server's response to a tool call.
|
| 2093 |
+
*
|
| 2094 |
+
* **Details**
|
| 2095 |
*
|
| 2096 |
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 2097 |
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 2098 |
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 2099 |
+
* and self-correct. However, any errors in _finding_ the tool, an error
|
| 2100 |
+
* indicating that the server does not support tool calls, or any other
|
| 2101 |
+
* exceptional conditions, should be reported as an MCP error response.
|
|
|
|
|
|
|
| 2102 |
*
|
|
|
|
| 2103 |
* @category tools
|
| 2104 |
+
* @since 4.0.0
|
| 2105 |
*/
|
| 2106 |
export declare class CallToolResult extends CallToolResult_base {
|
| 2107 |
}
|
|
|
|
| 2129 |
}>>, never, never>;
|
| 2130 |
}>, typeof CallToolResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2131 |
/**
|
| 2132 |
+
* Represents a client request to invoke a tool provided by the server.
|
| 2133 |
+
*
|
| 2134 |
+
* **When to use**
|
| 2135 |
+
*
|
| 2136 |
+
* Use when you need to represent a client request that already knows the tool
|
| 2137 |
+
* name and asks the server to execute it with argument values.
|
| 2138 |
+
*
|
| 2139 |
+
* @see {@link ListTools} for discovering available tools before calling one
|
| 2140 |
+
* @see {@link CallToolResult} for the successful tool-call result shape
|
| 2141 |
*
|
|
|
|
| 2142 |
* @category tools
|
| 2143 |
+
* @since 4.0.0
|
| 2144 |
*/
|
| 2145 |
export declare class CallTool extends CallTool_base {
|
| 2146 |
}
|
| 2147 |
declare const ToolListChangedNotification_base: Rpc.Rpc<"notifications/tools/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 2148 |
/**
|
| 2149 |
+
* Represents a notification that the server's tool list changed.
|
| 2150 |
+
*
|
| 2151 |
+
* **When to use**
|
| 2152 |
+
*
|
| 2153 |
+
* Use to notify clients that `tools/list` should be requested again.
|
| 2154 |
+
*
|
| 2155 |
+
* **Details**
|
| 2156 |
+
*
|
| 2157 |
+
* Servers may send this notification without a previous client subscription.
|
| 2158 |
*
|
|
|
|
| 2159 |
* @category tools
|
| 2160 |
+
* @since 4.0.0
|
| 2161 |
*/
|
| 2162 |
export declare class ToolListChangedNotification extends ToolListChangedNotification_base {
|
| 2163 |
}
|
| 2164 |
/**
|
| 2165 |
+
* Schema for log message severity levels, mapped to syslog message severities
|
| 2166 |
+
* as specified in RFC 5424 section 6.2.1:
|
| 2167 |
+
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1.
|
|
|
|
| 2168 |
*
|
|
|
|
| 2169 |
* @category logging
|
| 2170 |
+
* @since 4.0.0
|
| 2171 |
*/
|
| 2172 |
export declare const LoggingLevel: Schema.Literals<[
|
| 2173 |
"debug",
|
|
|
|
| 2180 |
"emergency"
|
| 2181 |
]>;
|
| 2182 |
/**
|
| 2183 |
+
* Type represented by the MCP logging level schema, mapped to syslog message
|
| 2184 |
+
* severities as specified in RFC 5424 section 6.2.1:
|
| 2185 |
+
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1.
|
|
|
|
| 2186 |
*
|
|
|
|
| 2187 |
* @category logging
|
| 2188 |
+
* @since 4.0.0
|
| 2189 |
*/
|
| 2190 |
export type LoggingLevel = typeof LoggingLevel.Type;
|
| 2191 |
declare const SetLevel_base: Rpc.Rpc<"logging/setLevel", Schema.Struct<{
|
|
|
|
| 2216 |
}>>, never, never>;
|
| 2217 |
}>, Schema.Void, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2218 |
/**
|
| 2219 |
+
* Sent from the client to the server to enable or adjust logging.
|
| 2220 |
*
|
|
|
|
| 2221 |
* @category logging
|
| 2222 |
+
* @since 4.0.0
|
| 2223 |
*/
|
| 2224 |
export declare class SetLevel extends SetLevel_base {
|
| 2225 |
}
|
|
|
|
| 2244 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2245 |
}>, Schema.Void, Schema.Never, never, never>;
|
| 2246 |
/**
|
| 2247 |
+
* Sent from the server to the client carrying a log message.
|
| 2248 |
+
*
|
| 2249 |
+
* **Details**
|
| 2250 |
+
*
|
| 2251 |
+
* The notification includes the severity level, optional logger name, and
|
| 2252 |
+
* JSON-serializable log data.
|
| 2253 |
+
*
|
| 2254 |
* @category logging
|
| 2255 |
+
* @since 4.0.0
|
| 2256 |
*/
|
| 2257 |
export declare class LoggingMessageNotification extends LoggingMessageNotification_base {
|
| 2258 |
}
|
|
|
|
| 2266 |
/**
|
| 2267 |
* Describes a message issued to or received from an LLM API.
|
| 2268 |
*
|
|
|
|
| 2269 |
* @category sampling
|
| 2270 |
+
* @since 4.0.0
|
| 2271 |
*/
|
| 2272 |
export declare class SamplingMessage extends SamplingMessage_base {
|
| 2273 |
}
|
|
|
|
| 2301 |
readonly name: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2302 |
}>, keyof Schema.Top>;
|
| 2303 |
/**
|
| 2304 |
+
* Schema for model selection hints.
|
| 2305 |
+
*
|
| 2306 |
+
* **Details**
|
| 2307 |
*
|
| 2308 |
* Keys not declared here are currently left unspecified by the spec and are up
|
| 2309 |
* to the client to interpret.
|
| 2310 |
*
|
|
|
|
| 2311 |
* @category sampling
|
| 2312 |
+
* @since 4.0.0
|
| 2313 |
*/
|
| 2314 |
export declare class ModelHint extends ModelHint_base {
|
| 2315 |
}
|
|
|
|
| 2344 |
readonly intelligencePriority: Schema.decodeTo<Schema.optional<Schema.Number>, Schema.optionalKey<Schema.Number>, never, never>;
|
| 2345 |
}>, {}>;
|
| 2346 |
/**
|
| 2347 |
+
* Schema for the server's model selection preferences requested of the client
|
| 2348 |
+
* during sampling.
|
| 2349 |
+
*
|
| 2350 |
+
* **Details**
|
| 2351 |
*
|
| 2352 |
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
| 2353 |
+
* rarely straightforward. Different models excel in different areas, some are
|
| 2354 |
* faster but less capable, others are more capable but more expensive, and so
|
| 2355 |
* on. This interface allows servers to express their priorities across multiple
|
| 2356 |
* dimensions to help clients make an appropriate selection for their use case.
|
| 2357 |
*
|
| 2358 |
+
* **Gotchas**
|
| 2359 |
+
*
|
| 2360 |
* These preferences are always advisory. The client MAY ignore them. It is also
|
| 2361 |
* up to the client to decide how to interpret these preferences and how to
|
| 2362 |
* balance them against other considerations.
|
| 2363 |
*
|
|
|
|
| 2364 |
* @category sampling
|
| 2365 |
+
* @since 4.0.0
|
| 2366 |
*/
|
| 2367 |
export declare class ModelPreferences extends ModelPreferences_base {
|
| 2368 |
}
|
|
|
|
| 2377 |
readonly stopReason: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2378 |
}>, {}>;
|
| 2379 |
/**
|
| 2380 |
+
* Represents a client response to an MCP sampling request.
|
| 2381 |
+
*
|
| 2382 |
+
* **When to use**
|
| 2383 |
+
*
|
| 2384 |
+
* Use to return the message produced by client-side model sampling.
|
| 2385 |
+
*
|
| 2386 |
+
* **Details**
|
| 2387 |
+
*
|
| 2388 |
+
* The client should let the user inspect the sampled message before returning
|
| 2389 |
+
* it to the server.
|
| 2390 |
*
|
|
|
|
| 2391 |
* @category sampling
|
| 2392 |
+
* @since 4.0.0
|
| 2393 |
*/
|
| 2394 |
export declare class CreateMessageResult extends CreateMessageResult_base {
|
| 2395 |
}
|
|
|
|
| 2424 |
metadata: Schema.Any;
|
| 2425 |
}>, typeof CreateMessageResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2426 |
/**
|
| 2427 |
+
* Represents a server request for the client to sample an LLM.
|
| 2428 |
+
*
|
| 2429 |
+
* **When to use**
|
| 2430 |
+
*
|
| 2431 |
+
* Use when you need to request model sampling from an MCP client on behalf of a
|
| 2432 |
+
* server.
|
| 2433 |
+
*
|
| 2434 |
+
* **Details**
|
| 2435 |
+
*
|
| 2436 |
+
* The client chooses the model and should ask the user to approve the sampling
|
| 2437 |
+
* request before it begins.
|
| 2438 |
*
|
|
|
|
| 2439 |
* @category sampling
|
| 2440 |
+
* @since 4.0.0
|
| 2441 |
*/
|
| 2442 |
export declare class CreateMessage extends CreateMessage_base {
|
| 2443 |
}
|
|
|
|
| 2455 |
readonly uri: Schema.String;
|
| 2456 |
}>, keyof Schema.Top>;
|
| 2457 |
/**
|
| 2458 |
+
* Schema for a reference to a resource or resource template definition.
|
| 2459 |
*
|
|
|
|
| 2460 |
* @category autocomplete
|
| 2461 |
+
* @since 4.0.0
|
| 2462 |
*/
|
| 2463 |
export declare class ResourceReference extends ResourceReference_base {
|
| 2464 |
}
|
|
|
|
| 2478 |
readonly title: Schema.decodeTo<Schema.optional<Schema.String>, Schema.optionalKey<Schema.String>, never, never>;
|
| 2479 |
}>, keyof Schema.Top>;
|
| 2480 |
/**
|
| 2481 |
+
* Schema for a prompt reference used in autocomplete requests.
|
| 2482 |
*
|
|
|
|
| 2483 |
* @category autocomplete
|
| 2484 |
+
* @since 4.0.0
|
| 2485 |
*/
|
| 2486 |
export declare class PromptReference extends PromptReference_base {
|
| 2487 |
}
|
|
|
|
| 2521 |
}>;
|
| 2522 |
}>, keyof Schema.Top>;
|
| 2523 |
/**
|
| 2524 |
+
* Schema for the server's response to a completion/complete request.
|
| 2525 |
*
|
|
|
|
| 2526 |
* @category autocomplete
|
| 2527 |
+
* @since 4.0.0
|
| 2528 |
*/
|
| 2529 |
export declare class CompleteResult extends CompleteResult_base {
|
| 2530 |
/**
|
| 2531 |
+
* Empty completion result used when a completion request has no values.
|
| 2532 |
+
*
|
| 2533 |
* @since 4.0.0
|
| 2534 |
*/
|
| 2535 |
static readonly empty: CompleteResult;
|
|
|
|
| 2560 |
}>>;
|
| 2561 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2562 |
/**
|
| 2563 |
+
* Sent from the client to the server to ask for completion options.
|
| 2564 |
*
|
|
|
|
| 2565 |
* @category autocomplete
|
| 2566 |
+
* @since 4.0.0
|
| 2567 |
*/
|
| 2568 |
export declare class Complete extends Complete_base {
|
| 2569 |
}
|
|
|
|
| 2584 |
/**
|
| 2585 |
* Represents a root directory or file that the server can operate on.
|
| 2586 |
*
|
|
|
|
| 2587 |
* @category roots
|
| 2588 |
+
* @since 4.0.0
|
| 2589 |
*/
|
| 2590 |
export declare class Root extends Root_base {
|
| 2591 |
}
|
|
|
|
| 2593 |
readonly roots: Schema.$Array<typeof Root>;
|
| 2594 |
}>, {}>;
|
| 2595 |
/**
|
| 2596 |
+
* Represents a client response containing the roots available to the server.
|
| 2597 |
+
*
|
| 2598 |
+
* **When to use**
|
| 2599 |
+
*
|
| 2600 |
+
* Use to return the directories or files that an MCP server may operate on.
|
| 2601 |
*
|
|
|
|
| 2602 |
* @category roots
|
| 2603 |
+
* @since 4.0.0
|
| 2604 |
*/
|
| 2605 |
export declare class ListRootsResult extends ListRootsResult_base {
|
| 2606 |
}
|
|
|
|
| 2609 |
* Sent from the server to request a list of root URIs from the client. Roots
|
| 2610 |
* allow servers to ask for specific directories or files to operate on. A
|
| 2611 |
* common example for roots is providing a set of repositories or directories a
|
| 2612 |
+
* server should operate on.
|
| 2613 |
+
*
|
| 2614 |
+
* **Details**
|
| 2615 |
*
|
| 2616 |
* This request is typically used when the server needs to understand the file
|
| 2617 |
* system structure or access specific locations that the client has permission
|
| 2618 |
* to read from.
|
| 2619 |
*
|
|
|
|
| 2620 |
* @category roots
|
| 2621 |
+
* @since 4.0.0
|
| 2622 |
*/
|
| 2623 |
export declare class ListRoots extends ListRoots_base {
|
| 2624 |
}
|
| 2625 |
declare const RootsListChangedNotification_base: Rpc.Rpc<"notifications/roots/list_changed", Schema.UndefinedOr<typeof NotificationMeta>, Schema.Void, Schema.Never, never, never>;
|
| 2626 |
/**
|
| 2627 |
+
* Represents a notification that the client's root list changed.
|
| 2628 |
+
*
|
| 2629 |
+
* **When to use**
|
| 2630 |
+
*
|
| 2631 |
+
* Use to tell the server that it should request an updated roots list.
|
| 2632 |
+
*
|
| 2633 |
+
* **Details**
|
| 2634 |
+
*
|
| 2635 |
+
* Send this when the client adds, removes, or modifies a root.
|
| 2636 |
*
|
|
|
|
| 2637 |
* @category roots
|
| 2638 |
+
* @since 4.0.0
|
| 2639 |
*/
|
| 2640 |
export declare class RootsListChangedNotification extends RootsListChangedNotification_base {
|
| 2641 |
}
|
|
|
|
| 2659 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2660 |
}>, {}>;
|
| 2661 |
/**
|
| 2662 |
+
* Schema for an accepted client response to an elicitation request.
|
| 2663 |
*
|
|
|
|
| 2664 |
* @category elicitation
|
| 2665 |
+
* @since 4.0.0
|
| 2666 |
*/
|
| 2667 |
export declare class ElicitAcceptResult extends ElicitAcceptResult_base {
|
| 2668 |
}
|
|
|
|
| 2681 |
readonly _meta: Schema.decodeTo<Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
| 2682 |
}>, {}>;
|
| 2683 |
/**
|
| 2684 |
+
* Schema for a declined or canceled client response to an elicitation request.
|
| 2685 |
*
|
|
|
|
| 2686 |
* @category elicitation
|
| 2687 |
+
* @since 4.0.0
|
| 2688 |
*/
|
| 2689 |
export declare class ElicitDeclineResult extends ElicitDeclineResult_base {
|
| 2690 |
}
|
| 2691 |
/**
|
| 2692 |
+
* Schema for every client response to an elicitation request.
|
| 2693 |
*
|
|
|
|
| 2694 |
* @category elicitation
|
| 2695 |
+
* @since 4.0.0
|
| 2696 |
*/
|
| 2697 |
export declare const ElicitResult: Schema.Union<readonly [typeof ElicitAcceptResult, typeof ElicitDeclineResult]>;
|
| 2698 |
declare const Elicit_base: Rpc.Rpc<"elicitation/create", Schema.Struct<{
|
|
|
|
| 2708 |
requestedSchema: Schema.Any;
|
| 2709 |
}>, Schema.Union<readonly [typeof ElicitAcceptResult, typeof ElicitDeclineResult]>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, never, never>;
|
| 2710 |
/**
|
| 2711 |
+
* Sent from the server asking the client to collect structured input from the
|
| 2712 |
+
* user.
|
| 2713 |
+
*
|
| 2714 |
+
* **Details**
|
| 2715 |
+
*
|
| 2716 |
+
* The client responds with accepted content, an explicit decline, or a
|
| 2717 |
+
* cancellation.
|
| 2718 |
+
*
|
| 2719 |
* @category elicitation
|
| 2720 |
+
* @since 4.0.0
|
| 2721 |
*/
|
| 2722 |
export declare class Elicit extends Elicit_base {
|
| 2723 |
}
|
|
|
|
| 2738 |
readonly cause: Schema.decodeTo<Schema.optional<Schema.Defect>, Schema.optionalKey<Schema.Defect>, never, never>;
|
| 2739 |
}>, import("../../Cause.ts").YieldableError>;
|
| 2740 |
/**
|
| 2741 |
+
* Error raised when an MCP elicitation request is declined or fails before
|
| 2742 |
+
* accepted content is returned.
|
| 2743 |
+
*
|
| 2744 |
+
* **Details**
|
| 2745 |
+
*
|
| 2746 |
+
* The error stores the original elicitation request and, when available, the
|
| 2747 |
+
* underlying cause.
|
| 2748 |
+
*
|
| 2749 |
* @category elicitation
|
| 2750 |
+
* @since 4.0.0
|
| 2751 |
*/
|
| 2752 |
export declare class ElicitationDeclined extends ElicitationDeclined_base {
|
| 2753 |
}
|
|
|
|
| 2757 |
readonly getClient: Effect.Effect<RpcClient.RpcClient<RpcGroup.Rpcs<typeof ServerRequestRpcs>, RpcClientError>, never, Scope.Scope>;
|
| 2758 |
}>;
|
| 2759 |
/**
|
| 2760 |
+
* Service available while handling an MCP client request.
|
| 2761 |
+
*
|
| 2762 |
+
* **Details**
|
| 2763 |
+
*
|
| 2764 |
+
* It exposes the current client id, the client's initialize payload, and a
|
| 2765 |
+
* scoped RPC client for server-initiated requests back to that client.
|
| 2766 |
+
*
|
| 2767 |
* @category client
|
| 2768 |
+
* @since 4.0.0
|
| 2769 |
*/
|
| 2770 |
export declare class McpServerClient extends McpServerClient_base {
|
| 2771 |
}
|
| 2772 |
declare const McpServerClientMiddleware_base: RpcMiddleware.ServiceClass<McpServerClientMiddleware, "effect/ai/McpSchema/McpServerClientMiddleware", McpServerClient, Schema.Never, never, never, false>;
|
| 2773 |
/**
|
| 2774 |
+
* RPC middleware that provides `McpServerClient` to handlers for initialized
|
| 2775 |
+
* MCP clients.
|
| 2776 |
+
*
|
| 2777 |
* @category middleware
|
| 2778 |
+
* @since 4.0.0
|
| 2779 |
*/
|
| 2780 |
export declare class McpServerClientMiddleware extends McpServerClientMiddleware_base {
|
| 2781 |
}
|
| 2782 |
/**
|
| 2783 |
+
* Encoded JSON-RPC request message for an RPC in `Group`, including the request
|
| 2784 |
+
* id, method, and encoded payload.
|
| 2785 |
+
*
|
| 2786 |
+
* @category protocols
|
| 2787 |
* @since 4.0.0
|
|
|
|
| 2788 |
*/
|
| 2789 |
export type RequestEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2790 |
readonly _tag: "Request";
|
|
|
|
| 2793 |
readonly payload: _Payload["Encoded"];
|
| 2794 |
} : never : never;
|
| 2795 |
/**
|
| 2796 |
+
* Encoded notification message for an RPC in `Group`, including the method and
|
| 2797 |
+
* encoded payload without a request id.
|
| 2798 |
+
*
|
| 2799 |
+
* @category protocols
|
| 2800 |
* @since 4.0.0
|
|
|
|
| 2801 |
*/
|
| 2802 |
export type NotificationEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2803 |
readonly _tag: "Notification";
|
|
|
|
| 2805 |
readonly payload: _Payload["Encoded"];
|
| 2806 |
} : never : never;
|
| 2807 |
/**
|
| 2808 |
+
* Encoded success response for an RPC in `Group`, containing the original
|
| 2809 |
+
* request id and encoded result.
|
| 2810 |
+
*
|
| 2811 |
+
* @category protocols
|
| 2812 |
* @since 4.0.0
|
|
|
|
| 2813 |
*/
|
| 2814 |
export type SuccessEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2815 |
readonly _tag: "Success";
|
|
|
|
| 2817 |
readonly result: _Success["Encoded"];
|
| 2818 |
} : never : never;
|
| 2819 |
/**
|
| 2820 |
+
* Encoded failure response for an RPC in `Group`, containing the original
|
| 2821 |
+
* request id and encoded error.
|
| 2822 |
+
*
|
| 2823 |
+
* @category protocols
|
| 2824 |
* @since 4.0.0
|
|
|
|
| 2825 |
*/
|
| 2826 |
export type FailureEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
|
| 2827 |
readonly _tag: "Failure";
|
|
|
|
| 3041 |
}>>;
|
| 3042 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never>>;
|
| 3043 |
/**
|
| 3044 |
+
* RPC group for requests that MCP clients send to the server.
|
| 3045 |
+
*
|
| 3046 |
+
* **Details**
|
| 3047 |
+
*
|
| 3048 |
+
* The group includes initialization, resource, prompt, tool, logging,
|
| 3049 |
+
* completion, and ping requests, and installs `McpServerClientMiddleware` for
|
| 3050 |
+
* handlers.
|
| 3051 |
+
*
|
| 3052 |
+
* @category protocols
|
| 3053 |
* @since 4.0.0
|
|
|
|
| 3054 |
*/
|
| 3055 |
export declare class ClientRequestRpcs extends ClientRequestRpcs_base {
|
| 3056 |
}
|
| 3057 |
/**
|
| 3058 |
+
* Encoded union of all client-to-server MCP request messages.
|
| 3059 |
+
*
|
| 3060 |
+
* @category protocols
|
| 3061 |
* @since 4.0.0
|
|
|
|
| 3062 |
*/
|
| 3063 |
export type ClientRequestEncoded = RequestEncoded<typeof ClientRequestRpcs>;
|
| 3064 |
declare const ClientNotificationRpcs_base: RpcGroup.RpcGroup<typeof InitializedNotification | typeof CancelledNotification | typeof ProgressNotification | typeof RootsListChangedNotification>;
|
| 3065 |
/**
|
| 3066 |
+
* RPC group for notifications that MCP clients send to the server, such as
|
| 3067 |
+
* cancellation, progress, initialization completion, and roots list changes.
|
| 3068 |
+
*
|
| 3069 |
+
* @category protocols
|
| 3070 |
* @since 4.0.0
|
|
|
|
| 3071 |
*/
|
| 3072 |
export declare class ClientNotificationRpcs extends ClientNotificationRpcs_base {
|
| 3073 |
}
|
| 3074 |
/**
|
| 3075 |
+
* Encoded union of all client-to-server MCP notification messages.
|
| 3076 |
+
*
|
| 3077 |
+
* @category protocols
|
| 3078 |
* @since 4.0.0
|
|
|
|
| 3079 |
*/
|
| 3080 |
export type ClientNotificationEncoded = NotificationEncoded<typeof ClientNotificationRpcs>;
|
| 3081 |
declare const ClientRpcs_base: RpcGroup.RpcGroup<typeof InitializedNotification | typeof CancelledNotification | typeof ProgressNotification | typeof RootsListChangedNotification | Rpc.Rpc<"ping", Schema.UndefinedOr<typeof RequestMeta>, Schema.Struct<{}>, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never> | Rpc.Rpc<"initialize", Schema.Struct<{
|
|
|
|
| 3291 |
}>>;
|
| 3292 |
}>, typeof CompleteResult, Schema.Union<readonly [typeof ParseError, typeof InvalidRequest, typeof MethodNotFound, typeof InvalidParams, typeof InternalError, typeof McpErrorBase]>, typeof McpServerClientMiddleware, never>>;
|
| 3293 |
/**
|
| 3294 |
+
* RPC group combining all client-to-server MCP requests and notifications.
|
| 3295 |
+
*
|
| 3296 |
+
* @category protocols
|
| 3297 |
* @since 4.0.0
|
|
|
|
| 3298 |
*/
|
| 3299 |
export declare class ClientRpcs extends ClientRpcs_base {
|
| 3300 |
}
|
| 3301 |
/**
|
| 3302 |
+
* Encoded success response sent by a client for a server-initiated request.
|
| 3303 |
+
*
|
| 3304 |
+
* @category protocols
|
| 3305 |
* @since 4.0.0
|
|
|
|
| 3306 |
*/
|
| 3307 |
export type ClientSuccessEncoded = SuccessEncoded<typeof ServerRequestRpcs>;
|
| 3308 |
/**
|
| 3309 |
+
* Encoded failure response sent by a client for a server-initiated request.
|
| 3310 |
+
*
|
| 3311 |
+
* @category protocols
|
| 3312 |
* @since 4.0.0
|
|
|
|
| 3313 |
*/
|
| 3314 |
export type ClientFailureEncoded = FailureEncoded<typeof ServerRequestRpcs>;
|
| 3315 |
declare const ServerRequestRpcs_base: RpcGroup.RpcGroup<typeof Ping | typeof CreateMessage | typeof ListRoots | typeof Elicit>;
|
| 3316 |
/**
|
| 3317 |
+
* RPC group for requests that an MCP server can send to a client, including
|
| 3318 |
+
* ping, sampling, roots listing, and elicitation.
|
| 3319 |
+
*
|
| 3320 |
+
* @category protocols
|
| 3321 |
* @since 4.0.0
|
|
|
|
| 3322 |
*/
|
| 3323 |
export declare class ServerRequestRpcs extends ServerRequestRpcs_base {
|
| 3324 |
}
|
| 3325 |
/**
|
| 3326 |
+
* Encoded union of all server-to-client MCP request messages.
|
| 3327 |
+
*
|
| 3328 |
+
* @category protocols
|
| 3329 |
* @since 4.0.0
|
|
|
|
| 3330 |
*/
|
| 3331 |
export type ServerRequestEncoded = RequestEncoded<typeof ServerRequestRpcs>;
|
| 3332 |
declare const ServerNotificationRpcs_base: RpcGroup.RpcGroup<typeof CancelledNotification | typeof ProgressNotification | typeof ResourceListChangedNotification | typeof ResourceUpdatedNotification | typeof PromptListChangedNotification | typeof ToolListChangedNotification | typeof LoggingMessageNotification>;
|
| 3333 |
/**
|
| 3334 |
+
* RPC group for notifications that an MCP server can send to a client,
|
| 3335 |
+
* including cancellation, progress, logging, and list or resource update
|
| 3336 |
+
* notifications.
|
| 3337 |
+
*
|
| 3338 |
+
* @category protocols
|
| 3339 |
* @since 4.0.0
|
|
|
|
| 3340 |
*/
|
| 3341 |
export declare class ServerNotificationRpcs extends ServerNotificationRpcs_base {
|
| 3342 |
}
|
| 3343 |
/**
|
| 3344 |
+
* Encoded union of all server-to-client MCP notification messages.
|
| 3345 |
+
*
|
| 3346 |
+
* @category protocols
|
| 3347 |
* @since 4.0.0
|
|
|
|
| 3348 |
*/
|
| 3349 |
export type ServerNotificationEncoded = NotificationEncoded<typeof ServerNotificationRpcs>;
|
| 3350 |
/**
|
| 3351 |
+
* Encoded success response sent by the server for a client-initiated request.
|
| 3352 |
+
*
|
| 3353 |
+
* @category protocols
|
| 3354 |
* @since 4.0.0
|
|
|
|
| 3355 |
*/
|
| 3356 |
export type ServerSuccessEncoded = SuccessEncoded<typeof ClientRequestRpcs>;
|
| 3357 |
/**
|
| 3358 |
+
* Encoded failure response sent by the server for a client-initiated request.
|
| 3359 |
+
*
|
| 3360 |
+
* @category protocols
|
| 3361 |
* @since 4.0.0
|
|
|
|
| 3362 |
*/
|
| 3363 |
export type ServerFailureEncoded = FailureEncoded<typeof ClientRequestRpcs>;
|
| 3364 |
/**
|
| 3365 |
+
* Encoded server response to a client request, either success or failure.
|
| 3366 |
+
*
|
| 3367 |
+
* @category protocols
|
| 3368 |
* @since 4.0.0
|
|
|
|
| 3369 |
*/
|
| 3370 |
export type ServerResultEncoded = ServerSuccessEncoded | ServerFailureEncoded;
|
| 3371 |
/**
|
| 3372 |
+
* Encoded MCP messages accepted from a client by the server protocol: client
|
| 3373 |
+
* requests and client notifications.
|
| 3374 |
+
*
|
| 3375 |
+
* @category protocols
|
| 3376 |
* @since 4.0.0
|
|
|
|
| 3377 |
*/
|
| 3378 |
export type FromClientEncoded = ClientRequestEncoded | ClientNotificationEncoded;
|
| 3379 |
/**
|
| 3380 |
+
* Encoded MCP messages emitted by the server protocol to a client: server
|
| 3381 |
+
* responses and server notifications.
|
| 3382 |
+
*
|
| 3383 |
+
* @category protocols
|
| 3384 |
* @since 4.0.0
|
|
|
|
| 3385 |
*/
|
| 3386 |
export type FromServerEncoded = ServerResultEncoded | ServerNotificationEncoded;
|
| 3387 |
declare const ParamSchemaTypeId = "~effect/ai/McpSchema/ParamSchema";
|
| 3388 |
/**
|
| 3389 |
+
* Returns `true` when a schema was created with `param` and therefore carries
|
| 3390 |
+
* a resource URI template parameter name.
|
| 3391 |
+
*
|
| 3392 |
* @category parameters
|
| 3393 |
+
* @since 4.0.0
|
| 3394 |
*/
|
| 3395 |
export declare function isParam(schema: Schema.Top): schema is Param<string, Schema.Top>;
|
| 3396 |
/**
|
| 3397 |
+
* Schema wrapper used for resource URI template parameters.
|
| 3398 |
+
*
|
| 3399 |
+
* **Details**
|
| 3400 |
+
*
|
| 3401 |
+
* A `Param` behaves like the wrapped schema while carrying the parameter name
|
| 3402 |
+
* used for template compilation and completion lookup.
|
| 3403 |
+
*
|
| 3404 |
* @category parameters
|
| 3405 |
+
* @since 4.0.0
|
| 3406 |
*/
|
| 3407 |
export interface Param<Name extends string, S extends Schema.Top> extends Schema.Bottom<S["Type"], S["Encoded"], S["DecodingServices"], S["EncodingServices"], S["ast"], Param<Name, S>, S["~type.make.in"], S["Iso"], S["~type.parameters"], S["~type.make"], S["~type.mutability"], S["~type.optionality"], S["~type.constructor.default"], S["~encoded.mutability"], S["~encoded.optionality"]> {
|
| 3408 |
readonly "Rebuild": Param<Name, S>;
|
|
|
|
| 3411 |
readonly schema: S;
|
| 3412 |
}
|
| 3413 |
/**
|
| 3414 |
+
* Creates a parameter for a resource URI template.
|
| 3415 |
*
|
|
|
|
| 3416 |
* @category parameters
|
| 3417 |
+
* @since 4.0.0
|
| 3418 |
*/
|
| 3419 |
export declare function param<const Name extends string, S extends Schema.Top>(name: Name, schema: S): Param<Name, S>;
|
| 3420 |
declare const EnabledWhen_base: Context.ServiceClass<EnabledWhen, "effect/unstable/ai/McpSchema/EnabledWhen", Predicate.Predicate<{
|
|
|
|
| 3429 |
* Annotation to conditionally enable or disable tools based on client
|
| 3430 |
* information.
|
| 3431 |
*
|
|
|
|
| 3432 |
* @category annotations
|
| 3433 |
+
* @since 4.0.0
|
| 3434 |
*/
|
| 3435 |
export declare class EnabledWhen extends EnabledWhen_base {
|
| 3436 |
}
|
.opencode/node_modules/effect/dist/unstable/ai/McpSchema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"McpSchema.d.ts","sourceRoot":"","sources":["../../../src/unstable/ai/McpSchema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAGzC,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAEzC,OAAO,KAAK,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,KAAK,KAAK,SAAS,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,yBAAyB,CAC1F,SAAQ,MAAM,CAAC,sBA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kBAAkB,CAAC,EACrB,CAAC,CAAC,YAAY,CAAC,EACf,CAAC,CAAC,kBAAkB,CAAC,EACrB,CAAC,CAAC,mBAAmB,CAAC,EACtB,CAAC,CAAC,2BAA2B,CAAC,EAC9B,CAAC,CAAC,qBAAqB,CAAC,EACxB,CAAC,CAAC,sBAAsB,CAAC,CAC1B;IAED,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAClC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,OAAO,iBAAiB,CAAA;IACtD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,EACnE,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,CAAC,GACR,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAEhB;;;;;;;;;AAED;;;;;;GAMG;AACH,qBAAa,WACX,SAAQ,gBAEP;CACD"}
|
.opencode/node_modules/effect/dist/unstable/ai/McpSchema.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
| 1 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
* @since 4.0.0
|
| 3 |
*/
|
| 4 |
import * as Context from "../../Context.js";
|
|
@@ -7,48 +16,72 @@ import { constFalse, constTrue } from "../../Function.js";
|
|
| 7 |
import * as Option from "../../Option.js";
|
| 8 |
import * as Predicate from "../../Predicate.js";
|
| 9 |
import * as Schema from "../../Schema.js";
|
| 10 |
-
import * as
|
| 11 |
import * as Rpc from "../rpc/Rpc.js";
|
| 12 |
import * as RpcGroup from "../rpc/RpcGroup.js";
|
| 13 |
import * as RpcMiddleware from "../rpc/RpcMiddleware.js";
|
| 14 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
* @since 4.0.0
|
| 16 |
*/
|
| 17 |
export const optionalWithDefault = (schema, defaultValue) => {
|
| 18 |
const effect = Effect.sync(defaultValue);
|
| 19 |
return Schema.optionalKey(schema).pipe(Schema.decode({
|
| 20 |
-
decode:
|
| 21 |
-
encode:
|
| 22 |
}), Schema.withConstructorDefault(effect));
|
| 23 |
};
|
| 24 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
* @since 4.0.0
|
| 26 |
*/
|
| 27 |
export const optional = schema => Schema.optionalKey(schema).pipe(Schema.decodeTo(Schema.optional(schema), {
|
| 28 |
-
decode:
|
| 29 |
-
encode:
|
| 30 |
}));
|
| 31 |
// =============================================================================
|
| 32 |
// Common
|
| 33 |
// =============================================================================
|
| 34 |
/**
|
| 35 |
-
*
|
| 36 |
*
|
|
|
|
| 37 |
* @since 4.0.0
|
| 38 |
-
* @category common
|
| 39 |
*/
|
| 40 |
export const RequestId = /*#__PURE__*/Schema.Union([Schema.String, Schema.Number]);
|
| 41 |
/**
|
| 42 |
-
*
|
| 43 |
-
* request.
|
| 44 |
*
|
|
|
|
| 45 |
* @since 4.0.0
|
| 46 |
-
* @category common
|
| 47 |
*/
|
| 48 |
export const ProgressToken = /*#__PURE__*/Schema.Union([Schema.String, Schema.Number]);
|
| 49 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
* @since 4.0.0
|
| 51 |
-
* @category common
|
| 52 |
*/
|
| 53 |
export class RequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 54 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Struct({
|
|
@@ -63,8 +96,15 @@ export class RequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schem
|
|
| 63 |
}))
|
| 64 |
})) {}
|
| 65 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
* @since 4.0.0
|
| 67 |
-
* @category common
|
| 68 |
*/
|
| 69 |
export class ResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 70 |
/**
|
|
@@ -74,8 +114,15 @@ export class ResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema
|
|
| 74 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 75 |
})) {}
|
| 76 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
* @since 4.0.0
|
| 78 |
-
* @category common
|
| 79 |
*/
|
| 80 |
export class NotificationMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 81 |
/**
|
|
@@ -85,15 +132,22 @@ export class NotificationMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/
|
|
| 85 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 86 |
})) {}
|
| 87 |
/**
|
| 88 |
-
*
|
| 89 |
*
|
|
|
|
| 90 |
* @since 4.0.0
|
| 91 |
-
* @category common
|
| 92 |
*/
|
| 93 |
export const Cursor = Schema.String;
|
| 94 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
* @since 4.0.0
|
| 96 |
-
* @category common
|
| 97 |
*/
|
| 98 |
export class PaginatedRequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 99 |
...RequestMeta.fields,
|
|
@@ -104,8 +158,15 @@ export class PaginatedRequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE
|
|
| 104 |
cursor: /*#__PURE__*/optional(Cursor)
|
| 105 |
})) {}
|
| 106 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
* @since 4.0.0
|
| 108 |
-
* @category common
|
| 109 |
*/
|
| 110 |
export class PaginatedResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 111 |
...ResultMeta.fields,
|
|
@@ -116,17 +177,22 @@ export class PaginatedResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE_
|
|
| 116 |
nextCursor: /*#__PURE__*/optional(Cursor)
|
| 117 |
})) {}
|
| 118 |
/**
|
| 119 |
-
*
|
|
|
|
|
|
|
| 120 |
* @since 4.0.0
|
| 121 |
-
* @category common
|
| 122 |
*/
|
| 123 |
export const Role = /*#__PURE__*/Schema.Literals(["user", "assistant"]);
|
| 124 |
/**
|
| 125 |
-
*
|
| 126 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
*
|
|
|
|
| 128 |
* @since 4.0.0
|
| 129 |
-
* @category common
|
| 130 |
*/
|
| 131 |
export class Annotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 132 |
/**
|
|
@@ -151,8 +217,8 @@ export class Annotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schem
|
|
| 151 |
/**
|
| 152 |
* Describes the name and version of an MCP implementation.
|
| 153 |
*
|
|
|
|
| 154 |
* @since 4.0.0
|
| 155 |
-
* @category common
|
| 156 |
*/
|
| 157 |
export class Implementation extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 158 |
name: Schema.String,
|
|
@@ -160,12 +226,20 @@ export class Implementation extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sc
|
|
| 160 |
version: Schema.String
|
| 161 |
})) {}
|
| 162 |
/**
|
| 163 |
-
*
|
| 164 |
-
* this schema, but this is not a closed set: any client can define its own,
|
| 165 |
-
* additional capabilities.
|
| 166 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
* @since 4.0.0
|
| 168 |
-
* @category common
|
| 169 |
*/
|
| 170 |
export class ClientCapabilities extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ClientCapabilities")({
|
| 171 |
/**
|
|
@@ -196,12 +270,20 @@ export class ClientCapabilities extends /*#__PURE__*/Schema.Class("@effect/ai/Mc
|
|
| 196 |
elicitation: /*#__PURE__*/optional(/*#__PURE__*/Schema.Struct({}))
|
| 197 |
}) {}
|
| 198 |
/**
|
| 199 |
-
*
|
| 200 |
-
*
|
| 201 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
*
|
|
|
|
| 203 |
* @since 4.0.0
|
| 204 |
-
* @category common
|
| 205 |
*/
|
| 206 |
export class ServerCapabilities extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 207 |
/**
|
|
@@ -257,8 +339,15 @@ export class ServerCapabilities extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__
|
|
| 257 |
// Errors
|
| 258 |
// =============================================================================
|
| 259 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
* @since 4.0.0
|
| 261 |
-
* @category errors
|
| 262 |
*/
|
| 263 |
export class McpErrorBase extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/McpErrorBase")({
|
| 264 |
/**
|
|
@@ -277,33 +366,80 @@ export class McpErrorBase extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchem
|
|
| 277 |
data: /*#__PURE__*/optional(Schema.Any)
|
| 278 |
}) {}
|
| 279 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
* @since 4.0.0
|
| 281 |
-
* @category errors
|
| 282 |
*/
|
| 283 |
export const INVALID_REQUEST_ERROR_CODE = -32600;
|
| 284 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
* @since 4.0.0
|
| 286 |
-
* @category errors
|
| 287 |
*/
|
| 288 |
export const METHOD_NOT_FOUND_ERROR_CODE = -32601;
|
| 289 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
* @since 4.0.0
|
| 291 |
-
* @category errors
|
| 292 |
*/
|
| 293 |
export const INVALID_PARAMS_ERROR_CODE = -32602;
|
| 294 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
* @since 4.0.0
|
| 296 |
-
* @category errors
|
| 297 |
*/
|
| 298 |
export const INTERNAL_ERROR_CODE = -32603;
|
| 299 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
* @since 4.0.0
|
| 301 |
-
* @category errors
|
| 302 |
*/
|
| 303 |
export const PARSE_ERROR_CODE = -32700;
|
| 304 |
/**
|
| 305 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
* @category errors
|
|
|
|
| 307 |
*/
|
| 308 |
export class ParseError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/ParseError")({
|
| 309 |
...McpErrorBase.fields,
|
|
@@ -311,8 +447,19 @@ export class ParseError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSch
|
|
| 311 |
code: /*#__PURE__*/Schema.tag(PARSE_ERROR_CODE)
|
| 312 |
}) {}
|
| 313 |
/**
|
| 314 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
* @category errors
|
|
|
|
| 316 |
*/
|
| 317 |
export class InvalidRequest extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InvalidRequest")({
|
| 318 |
...McpErrorBase.fields,
|
|
@@ -320,8 +467,18 @@ export class InvalidRequest extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Mc
|
|
| 320 |
code: /*#__PURE__*/Schema.tag(INVALID_REQUEST_ERROR_CODE)
|
| 321 |
}) {}
|
| 322 |
/**
|
| 323 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
* @category errors
|
|
|
|
| 325 |
*/
|
| 326 |
export class MethodNotFound extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/MethodNotFound")({
|
| 327 |
...McpErrorBase.fields,
|
|
@@ -329,8 +486,19 @@ export class MethodNotFound extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Mc
|
|
| 329 |
code: /*#__PURE__*/Schema.tag(METHOD_NOT_FOUND_ERROR_CODE)
|
| 330 |
}) {}
|
| 331 |
/**
|
| 332 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
* @category errors
|
|
|
|
| 334 |
*/
|
| 335 |
export class InvalidParams extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InvalidParams")({
|
| 336 |
...McpErrorBase.fields,
|
|
@@ -338,8 +506,20 @@ export class InvalidParams extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Mcp
|
|
| 338 |
code: /*#__PURE__*/Schema.tag(INVALID_PARAMS_ERROR_CODE)
|
| 339 |
}) {}
|
| 340 |
/**
|
| 341 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
* @category errors
|
|
|
|
| 343 |
*/
|
| 344 |
export class InternalError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InternalError")({
|
| 345 |
...McpErrorBase.fields,
|
|
@@ -351,20 +531,29 @@ export class InternalError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/Mcp
|
|
| 351 |
});
|
| 352 |
}
|
| 353 |
/**
|
| 354 |
-
*
|
|
|
|
|
|
|
| 355 |
* @category errors
|
|
|
|
| 356 |
*/
|
| 357 |
export const McpError = /*#__PURE__*/Schema.Union([ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpErrorBase]);
|
| 358 |
// =============================================================================
|
| 359 |
// Ping
|
| 360 |
// =============================================================================
|
| 361 |
/**
|
| 362 |
-
*
|
| 363 |
-
*
|
| 364 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 365 |
*
|
| 366 |
-
* @since 4.0.0
|
| 367 |
* @category ping
|
|
|
|
| 368 |
*/
|
| 369 |
export class Ping extends /*#__PURE__*/Rpc.make("ping", {
|
| 370 |
success: /*#__PURE__*/Schema.Struct({}),
|
|
@@ -375,11 +564,10 @@ export class Ping extends /*#__PURE__*/Rpc.make("ping", {
|
|
| 375 |
// Initialization
|
| 376 |
// =============================================================================
|
| 377 |
/**
|
| 378 |
-
*
|
| 379 |
-
* response.
|
| 380 |
*
|
| 381 |
-
* @since 4.0.0
|
| 382 |
* @category initialization
|
|
|
|
| 383 |
*/
|
| 384 |
export class InitializeResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 385 |
...ResultMeta.fields,
|
|
@@ -401,11 +589,11 @@ export class InitializeResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/
|
|
| 401 |
instructions: /*#__PURE__*/optional(Schema.String)
|
| 402 |
})) {}
|
| 403 |
/**
|
| 404 |
-
*
|
| 405 |
-
*
|
| 406 |
*
|
| 407 |
-
* @since 4.0.0
|
| 408 |
* @category initialization
|
|
|
|
| 409 |
*/
|
| 410 |
export class Initialize extends /*#__PURE__*/Rpc.make("initialize", {
|
| 411 |
success: InitializeResult,
|
|
@@ -430,11 +618,10 @@ export class Initialize extends /*#__PURE__*/Rpc.make("initialize", {
|
|
| 430 |
}
|
| 431 |
}) {}
|
| 432 |
/**
|
| 433 |
-
*
|
| 434 |
-
* has finished.
|
| 435 |
*
|
| 436 |
-
* @since 4.0.0
|
| 437 |
* @category initialization
|
|
|
|
| 438 |
*/
|
| 439 |
export class InitializedNotification extends /*#__PURE__*/Rpc.make("notifications/initialized", {
|
| 440 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
@@ -443,8 +630,16 @@ export class InitializedNotification extends /*#__PURE__*/Rpc.make("notification
|
|
| 443 |
// Cancellation
|
| 444 |
// =============================================================================
|
| 445 |
/**
|
| 446 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 447 |
* @category cancellation
|
|
|
|
| 448 |
*/
|
| 449 |
export class CancelledNotification extends /*#__PURE__*/Rpc.make("notifications/cancelled", {
|
| 450 |
payload: {
|
|
@@ -467,11 +662,10 @@ export class CancelledNotification extends /*#__PURE__*/Rpc.make("notifications/
|
|
| 467 |
// Progress
|
| 468 |
// =============================================================================
|
| 469 |
/**
|
| 470 |
-
*
|
| 471 |
-
* for a long-running request.
|
| 472 |
*
|
| 473 |
-
* @since 4.0.0
|
| 474 |
* @category progress
|
|
|
|
| 475 |
*/
|
| 476 |
export class ProgressNotification extends /*#__PURE__*/Rpc.make("notifications/progress", {
|
| 477 |
payload: {
|
|
@@ -500,10 +694,10 @@ export class ProgressNotification extends /*#__PURE__*/Rpc.make("notifications/p
|
|
| 500 |
// Resources
|
| 501 |
// =============================================================================
|
| 502 |
/**
|
| 503 |
-
*
|
| 504 |
*
|
| 505 |
-
* @since 4.0.0
|
| 506 |
* @category resources
|
|
|
|
| 507 |
*/
|
| 508 |
export class Resource extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Resource")({
|
| 509 |
/**
|
|
@@ -549,10 +743,10 @@ export class Resource extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Re
|
|
| 549 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 550 |
}) {}
|
| 551 |
/**
|
| 552 |
-
*
|
| 553 |
*
|
| 554 |
-
* @since 4.0.0
|
| 555 |
* @category resources
|
|
|
|
| 556 |
*/
|
| 557 |
export class ResourceTemplate extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResourceTemplate")({
|
| 558 |
/**
|
|
@@ -589,10 +783,10 @@ export class ResourceTemplate extends /*#__PURE__*/Schema.Class("@effect/ai/McpS
|
|
| 589 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 590 |
}) {}
|
| 591 |
/**
|
| 592 |
-
*
|
| 593 |
*
|
| 594 |
-
* @since 4.0.0
|
| 595 |
* @category resources
|
|
|
|
| 596 |
*/
|
| 597 |
export class ResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 598 |
/**
|
|
@@ -609,10 +803,10 @@ export class ResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/
|
|
| 609 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 610 |
})) {}
|
| 611 |
/**
|
| 612 |
-
*
|
| 613 |
*
|
| 614 |
-
* @since 4.0.0
|
| 615 |
* @category resources
|
|
|
|
| 616 |
*/
|
| 617 |
export class TextResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 618 |
...ResourceContents.fields,
|
|
@@ -623,10 +817,10 @@ export class TextResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE
|
|
| 623 |
text: Schema.String
|
| 624 |
})) {}
|
| 625 |
/**
|
| 626 |
-
*
|
| 627 |
*
|
| 628 |
-
* @since 4.0.0
|
| 629 |
* @category resources
|
|
|
|
| 630 |
*/
|
| 631 |
export class BlobResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 632 |
...ResourceContents.fields,
|
|
@@ -636,10 +830,10 @@ export class BlobResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE
|
|
| 636 |
blob: Schema.Uint8Array
|
| 637 |
})) {}
|
| 638 |
/**
|
| 639 |
-
*
|
| 640 |
*
|
| 641 |
-
* @since 4.0.0
|
| 642 |
* @category resources
|
|
|
|
| 643 |
*/
|
| 644 |
export class ListResourcesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourcesResult")({
|
| 645 |
...PaginatedResultMeta.fields,
|
|
@@ -648,8 +842,8 @@ export class ListResourcesResult extends /*#__PURE__*/Schema.Class("@effect/ai/M
|
|
| 648 |
/**
|
| 649 |
* Sent from the client to request a list of resources the server has.
|
| 650 |
*
|
| 651 |
-
* @since 4.0.0
|
| 652 |
* @category resources
|
|
|
|
| 653 |
*/
|
| 654 |
export class ListResources extends /*#__PURE__*/Rpc.make("resources/list", {
|
| 655 |
success: ListResourcesResult,
|
|
@@ -657,10 +851,11 @@ export class ListResources extends /*#__PURE__*/Rpc.make("resources/list", {
|
|
| 657 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 658 |
}) {}
|
| 659 |
/**
|
| 660 |
-
*
|
|
|
|
| 661 |
*
|
| 662 |
-
* @since 4.0.0
|
| 663 |
* @category resources
|
|
|
|
| 664 |
*/
|
| 665 |
export class ListResourceTemplatesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourceTemplatesResult")({
|
| 666 |
...PaginatedResultMeta.fields,
|
|
@@ -669,8 +864,8 @@ export class ListResourceTemplatesResult extends /*#__PURE__*/Schema.Class("@eff
|
|
| 669 |
/**
|
| 670 |
* Sent from the client to request a list of resource templates the server has.
|
| 671 |
*
|
| 672 |
-
* @since 4.0.0
|
| 673 |
* @category resources
|
|
|
|
| 674 |
*/
|
| 675 |
export class ListResourceTemplates extends /*#__PURE__*/Rpc.make("resources/templates/list", {
|
| 676 |
success: ListResourceTemplatesResult,
|
|
@@ -678,10 +873,10 @@ export class ListResourceTemplates extends /*#__PURE__*/Rpc.make("resources/temp
|
|
| 678 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 679 |
}) {}
|
| 680 |
/**
|
| 681 |
-
*
|
| 682 |
*
|
| 683 |
-
* @since 4.0.0
|
| 684 |
* @category resources
|
|
|
|
| 685 |
*/
|
| 686 |
export class ReadResourceResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 687 |
...ResultMeta.fields,
|
|
@@ -690,8 +885,8 @@ export class ReadResourceResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__
|
|
| 690 |
/**
|
| 691 |
* Sent from the client to the server, to read a specific resource URI.
|
| 692 |
*
|
| 693 |
-
* @since 4.0.0
|
| 694 |
* @category resources
|
|
|
|
| 695 |
*/
|
| 696 |
export class ReadResource extends /*#__PURE__*/Rpc.make("resources/read", {
|
| 697 |
success: ReadResourceResult,
|
|
@@ -706,12 +901,18 @@ export class ReadResource extends /*#__PURE__*/Rpc.make("resources/read", {
|
|
| 706 |
}
|
| 707 |
}) {}
|
| 708 |
/**
|
| 709 |
-
*
|
| 710 |
-
*
|
| 711 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 712 |
*
|
| 713 |
-
* @since 4.0.0
|
| 714 |
* @category resources
|
|
|
|
| 715 |
*/
|
| 716 |
export class ResourceListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/list_changed", {
|
| 717 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
@@ -720,8 +921,8 @@ export class ResourceListChangedNotification extends /*#__PURE__*/Rpc.make("noti
|
|
| 720 |
* Sent from the client to request resources/updated notifications from the
|
| 721 |
* server whenever a particular resource changes.
|
| 722 |
*
|
| 723 |
-
* @since 4.0.0
|
| 724 |
* @category resources
|
|
|
|
| 725 |
*/
|
| 726 |
export class Subscribe extends /*#__PURE__*/Rpc.make("resources/subscribe", {
|
| 727 |
error: McpError,
|
|
@@ -739,8 +940,8 @@ export class Subscribe extends /*#__PURE__*/Rpc.make("resources/subscribe", {
|
|
| 739 |
* notifications from the server. This should follow a previous
|
| 740 |
* resources/subscribe request.
|
| 741 |
*
|
| 742 |
-
* @since 4.0.0
|
| 743 |
* @category resources
|
|
|
|
| 744 |
*/
|
| 745 |
export class Unsubscribe extends /*#__PURE__*/Rpc.make("resources/unsubscribe", {
|
| 746 |
error: McpError,
|
|
@@ -754,8 +955,15 @@ export class Unsubscribe extends /*#__PURE__*/Rpc.make("resources/unsubscribe",
|
|
| 754 |
}
|
| 755 |
}) {}
|
| 756 |
/**
|
| 757 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 758 |
* @category resources
|
|
|
|
| 759 |
*/
|
| 760 |
export class ResourceUpdatedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/updated", {
|
| 761 |
payload: {
|
|
@@ -772,8 +980,8 @@ export class ResourceUpdatedNotification extends /*#__PURE__*/Rpc.make("notifica
|
|
| 772 |
/**
|
| 773 |
* Describes an argument that a prompt can accept.
|
| 774 |
*
|
|
|
|
| 775 |
* @since 4.0.0
|
| 776 |
-
* @category prompts
|
| 777 |
*/
|
| 778 |
export class PromptArgument extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 779 |
/**
|
|
@@ -791,10 +999,10 @@ export class PromptArgument extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sc
|
|
| 791 |
required: /*#__PURE__*/optional(Schema.Boolean)
|
| 792 |
})) {}
|
| 793 |
/**
|
| 794 |
-
*
|
| 795 |
*
|
|
|
|
| 796 |
* @since 4.0.0
|
| 797 |
-
* @category prompts
|
| 798 |
*/
|
| 799 |
export class Prompt extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Prompt")({
|
| 800 |
/**
|
|
@@ -812,10 +1020,10 @@ export class Prompt extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Prom
|
|
| 812 |
arguments: /*#__PURE__*/optional(/*#__PURE__*/Schema.Array(PromptArgument))
|
| 813 |
}) {}
|
| 814 |
/**
|
| 815 |
-
*
|
| 816 |
*
|
|
|
|
| 817 |
* @since 4.0.0
|
| 818 |
-
* @category prompts
|
| 819 |
*/
|
| 820 |
export class TextContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 821 |
type: /*#__PURE__*/Schema.tag("text"),
|
|
@@ -829,10 +1037,10 @@ export class TextContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schem
|
|
| 829 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 830 |
})) {}
|
| 831 |
/**
|
| 832 |
-
*
|
| 833 |
*
|
|
|
|
| 834 |
* @since 4.0.0
|
| 835 |
-
* @category prompts
|
| 836 |
*/
|
| 837 |
export class ImageContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 838 |
type: /*#__PURE__*/Schema.tag("image"),
|
|
@@ -851,10 +1059,10 @@ export class ImageContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sche
|
|
| 851 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 852 |
})) {}
|
| 853 |
/**
|
| 854 |
-
*
|
| 855 |
*
|
|
|
|
| 856 |
* @since 4.0.0
|
| 857 |
-
* @category prompts
|
| 858 |
*/
|
| 859 |
export class AudioContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 860 |
type: /*#__PURE__*/Schema.tag("audio"),
|
|
@@ -873,13 +1081,15 @@ export class AudioContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sche
|
|
| 873 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 874 |
})) {}
|
| 875 |
/**
|
| 876 |
-
*
|
|
|
|
|
|
|
| 877 |
*
|
| 878 |
* It is up to the client how best to render embedded resources for the benefit
|
| 879 |
* of the LLM and/or the user.
|
| 880 |
*
|
|
|
|
| 881 |
* @since 4.0.0
|
| 882 |
-
* @category prompts
|
| 883 |
*/
|
| 884 |
export class EmbeddedResource extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 885 |
type: /*#__PURE__*/Schema.tag("resource"),
|
|
@@ -890,40 +1100,48 @@ export class EmbeddedResource extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/
|
|
| 890 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 891 |
})) {}
|
| 892 |
/**
|
| 893 |
-
*
|
|
|
|
|
|
|
| 894 |
*
|
| 895 |
-
*
|
|
|
|
| 896 |
*
|
|
|
|
| 897 |
* @since 4.0.0
|
| 898 |
-
* @category prompts
|
| 899 |
*/
|
| 900 |
export class ResourceLink extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 901 |
...Resource.fields,
|
| 902 |
type: /*#__PURE__*/Schema.tag("resource_link")
|
| 903 |
})) {}
|
| 904 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 905 |
* @since 4.0.0
|
| 906 |
-
* @category prompts
|
| 907 |
*/
|
| 908 |
export const ContentBlock = /*#__PURE__*/Schema.Union([TextContent, ImageContent, AudioContent, EmbeddedResource, ResourceLink]);
|
| 909 |
/**
|
| 910 |
* Describes a message returned as part of a prompt.
|
| 911 |
*
|
|
|
|
|
|
|
| 912 |
* This is similar to `SamplingMessage`, but also supports the embedding of
|
| 913 |
* resources from the MCP server.
|
| 914 |
*
|
|
|
|
| 915 |
* @since 4.0.0
|
| 916 |
-
* @category prompts
|
| 917 |
*/
|
| 918 |
export class PromptMessage extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 919 |
role: Role,
|
| 920 |
content: ContentBlock
|
| 921 |
})) {}
|
| 922 |
/**
|
| 923 |
-
*
|
| 924 |
*
|
|
|
|
| 925 |
* @since 4.0.0
|
| 926 |
-
* @category prompts
|
| 927 |
*/
|
| 928 |
export class ListPromptsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListPromptsResult")({
|
| 929 |
...PaginatedResultMeta.fields,
|
|
@@ -933,8 +1151,8 @@ export class ListPromptsResult extends /*#__PURE__*/Schema.Class("@effect/ai/Mcp
|
|
| 933 |
* Sent from the client to request a list of prompts and prompt templates the
|
| 934 |
* server has.
|
| 935 |
*
|
|
|
|
| 936 |
* @since 4.0.0
|
| 937 |
-
* @category prompts
|
| 938 |
*/
|
| 939 |
export class ListPrompts extends /*#__PURE__*/Rpc.make("prompts/list", {
|
| 940 |
success: ListPromptsResult,
|
|
@@ -942,10 +1160,10 @@ export class ListPrompts extends /*#__PURE__*/Rpc.make("prompts/list", {
|
|
| 942 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 943 |
}) {}
|
| 944 |
/**
|
| 945 |
-
*
|
| 946 |
*
|
|
|
|
| 947 |
* @since 4.0.0
|
| 948 |
-
* @category prompts
|
| 949 |
*/
|
| 950 |
export class GetPromptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/GetPromptResult")({
|
| 951 |
...ResultMeta.fields,
|
|
@@ -956,10 +1174,10 @@ export class GetPromptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSc
|
|
| 956 |
description: /*#__PURE__*/optional(Schema.String)
|
| 957 |
}) {}
|
| 958 |
/**
|
| 959 |
-
*
|
| 960 |
*
|
|
|
|
| 961 |
* @since 4.0.0
|
| 962 |
-
* @category prompts
|
| 963 |
*/
|
| 964 |
export class GetPrompt extends /*#__PURE__*/Rpc.make("prompts/get", {
|
| 965 |
success: GetPromptResult,
|
|
@@ -978,12 +1196,18 @@ export class GetPrompt extends /*#__PURE__*/Rpc.make("prompts/get", {
|
|
| 978 |
}
|
| 979 |
}) {}
|
| 980 |
/**
|
| 981 |
-
*
|
| 982 |
-
* the list of prompts it offers has changed. This may be issued by servers
|
| 983 |
-
* without any previous subscription from the client.
|
| 984 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 985 |
* @since 4.0.0
|
| 986 |
-
* @category prompts
|
| 987 |
*/
|
| 988 |
export class PromptListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/prompts/list_changed", {
|
| 989 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
@@ -992,17 +1216,21 @@ export class PromptListChangedNotification extends /*#__PURE__*/Rpc.make("notifi
|
|
| 992 |
// Tools
|
| 993 |
// =============================================================================
|
| 994 |
/**
|
| 995 |
-
*
|
|
|
|
|
|
|
| 996 |
*
|
| 997 |
* NOTE: all properties in ToolAnnotations are **hints**. They are not
|
| 998 |
* guaranteed to provide a faithful description of tool behavior (including
|
| 999 |
* descriptive properties like `title`).
|
| 1000 |
*
|
|
|
|
|
|
|
| 1001 |
* Clients should never make tool use decisions based on ToolAnnotations
|
| 1002 |
* received from untrusted servers.
|
| 1003 |
*
|
| 1004 |
-
* @since 4.0.0
|
| 1005 |
* @category tools
|
|
|
|
| 1006 |
*/
|
| 1007 |
export class ToolAnnotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1008 |
/**
|
|
@@ -1044,10 +1272,10 @@ export class ToolAnnotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/S
|
|
| 1044 |
openWorldHint: /*#__PURE__*/optionalWithDefault(Schema.Boolean, constTrue)
|
| 1045 |
})) {}
|
| 1046 |
/**
|
| 1047 |
-
*
|
| 1048 |
*
|
| 1049 |
-
* @since 4.0.0
|
| 1050 |
* @category tools
|
|
|
|
| 1051 |
*/
|
| 1052 |
export class Tool extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Tool")({
|
| 1053 |
/**
|
|
@@ -1078,10 +1306,10 @@ export class Tool extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Tool")
|
|
| 1078 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 1079 |
}) {}
|
| 1080 |
/**
|
| 1081 |
-
*
|
| 1082 |
*
|
| 1083 |
-
* @since 4.0.0
|
| 1084 |
* @category tools
|
|
|
|
| 1085 |
*/
|
| 1086 |
export class ListToolsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListToolsResult")({
|
| 1087 |
...PaginatedResultMeta.fields,
|
|
@@ -1090,8 +1318,8 @@ export class ListToolsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSc
|
|
| 1090 |
/**
|
| 1091 |
* Sent from the client to request a list of tools the server has.
|
| 1092 |
*
|
| 1093 |
-
* @since 4.0.0
|
| 1094 |
* @category tools
|
|
|
|
| 1095 |
*/
|
| 1096 |
export class ListTools extends /*#__PURE__*/Rpc.make("tools/list", {
|
| 1097 |
success: ListToolsResult,
|
|
@@ -1099,19 +1327,19 @@ export class ListTools extends /*#__PURE__*/Rpc.make("tools/list", {
|
|
| 1099 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 1100 |
}) {}
|
| 1101 |
/**
|
| 1102 |
-
*
|
|
|
|
|
|
|
| 1103 |
*
|
| 1104 |
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 1105 |
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 1106 |
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 1107 |
-
* and self-correct.
|
|
|
|
|
|
|
| 1108 |
*
|
| 1109 |
-
* However, any errors in _finding_ the tool, an error indicating that the
|
| 1110 |
-
* server does not support tool calls, or any other exceptional conditions,
|
| 1111 |
-
* should be reported as an MCP error response.
|
| 1112 |
-
*
|
| 1113 |
-
* @since 4.0.0
|
| 1114 |
* @category tools
|
|
|
|
| 1115 |
*/
|
| 1116 |
export class CallToolResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CallToolResult")({
|
| 1117 |
...ResultMeta.fields,
|
|
@@ -1125,10 +1353,18 @@ export class CallToolResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSch
|
|
| 1125 |
isError: /*#__PURE__*/optional(Schema.Boolean)
|
| 1126 |
}) {}
|
| 1127 |
/**
|
| 1128 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1129 |
*
|
| 1130 |
-
* @since 4.0.0
|
| 1131 |
* @category tools
|
|
|
|
| 1132 |
*/
|
| 1133 |
export class CallTool extends /*#__PURE__*/Rpc.make("tools/call", {
|
| 1134 |
success: CallToolResult,
|
|
@@ -1140,12 +1376,18 @@ export class CallTool extends /*#__PURE__*/Rpc.make("tools/call", {
|
|
| 1140 |
}
|
| 1141 |
}) {}
|
| 1142 |
/**
|
| 1143 |
-
*
|
| 1144 |
-
*
|
| 1145 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1146 |
*
|
| 1147 |
-
* @since 4.0.0
|
| 1148 |
* @category tools
|
|
|
|
| 1149 |
*/
|
| 1150 |
export class ToolListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/tools/list_changed", {
|
| 1151 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
@@ -1154,20 +1396,19 @@ export class ToolListChangedNotification extends /*#__PURE__*/Rpc.make("notifica
|
|
| 1154 |
// Logging
|
| 1155 |
// =============================================================================
|
| 1156 |
/**
|
| 1157 |
-
*
|
|
|
|
|
|
|
| 1158 |
*
|
| 1159 |
-
* These map to syslog message severities, as specified in RFC-5424:
|
| 1160 |
-
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
| 1161 |
-
*
|
| 1162 |
-
* @since 4.0.0
|
| 1163 |
* @category logging
|
|
|
|
| 1164 |
*/
|
| 1165 |
export const LoggingLevel = /*#__PURE__*/Schema.Literals(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
| 1166 |
/**
|
| 1167 |
-
*
|
| 1168 |
*
|
| 1169 |
-
* @since 4.0.0
|
| 1170 |
* @category logging
|
|
|
|
| 1171 |
*/
|
| 1172 |
export class SetLevel extends /*#__PURE__*/Rpc.make("logging/setLevel", {
|
| 1173 |
payload: {
|
|
@@ -1182,8 +1423,15 @@ export class SetLevel extends /*#__PURE__*/Rpc.make("logging/setLevel", {
|
|
| 1182 |
error: McpError
|
| 1183 |
}) {}
|
| 1184 |
/**
|
| 1185 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1186 |
* @category logging
|
|
|
|
| 1187 |
*/
|
| 1188 |
export class LoggingMessageNotification extends /*#__PURE__*/Rpc.make("notifications/message", {
|
| 1189 |
payload: /*#__PURE__*/Schema.Struct({
|
|
@@ -1209,21 +1457,23 @@ export class LoggingMessageNotification extends /*#__PURE__*/Rpc.make("notificat
|
|
| 1209 |
/**
|
| 1210 |
* Describes a message issued to or received from an LLM API.
|
| 1211 |
*
|
| 1212 |
-
* @since 4.0.0
|
| 1213 |
* @category sampling
|
|
|
|
| 1214 |
*/
|
| 1215 |
export class SamplingMessage extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1216 |
role: Role,
|
| 1217 |
content: /*#__PURE__*/Schema.Union([TextContent, ImageContent, AudioContent])
|
| 1218 |
})) {}
|
| 1219 |
/**
|
| 1220 |
-
*
|
|
|
|
|
|
|
| 1221 |
*
|
| 1222 |
* Keys not declared here are currently left unspecified by the spec and are up
|
| 1223 |
* to the client to interpret.
|
| 1224 |
*
|
| 1225 |
-
* @since 4.0.0
|
| 1226 |
* @category sampling
|
|
|
|
| 1227 |
*/
|
| 1228 |
export class ModelHint extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1229 |
/**
|
|
@@ -1241,20 +1491,25 @@ export class ModelHint extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.
|
|
| 1241 |
name: /*#__PURE__*/optional(Schema.String)
|
| 1242 |
})) {}
|
| 1243 |
/**
|
| 1244 |
-
*
|
|
|
|
|
|
|
|
|
|
| 1245 |
*
|
| 1246 |
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
| 1247 |
-
* rarely straightforward.
|
| 1248 |
* faster but less capable, others are more capable but more expensive, and so
|
| 1249 |
* on. This interface allows servers to express their priorities across multiple
|
| 1250 |
* dimensions to help clients make an appropriate selection for their use case.
|
| 1251 |
*
|
|
|
|
|
|
|
| 1252 |
* These preferences are always advisory. The client MAY ignore them. It is also
|
| 1253 |
* up to the client to decide how to interpret these preferences and how to
|
| 1254 |
* balance them against other considerations.
|
| 1255 |
*
|
| 1256 |
-
* @since 4.0.0
|
| 1257 |
* @category sampling
|
|
|
|
| 1258 |
*/
|
| 1259 |
export class ModelPreferences extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ModelPreferences")({
|
| 1260 |
/**
|
|
@@ -1296,13 +1551,19 @@ export class ModelPreferences extends /*#__PURE__*/Schema.Class("@effect/ai/McpS
|
|
| 1296 |
})))
|
| 1297 |
}) {}
|
| 1298 |
/**
|
| 1299 |
-
*
|
| 1300 |
-
*
|
| 1301 |
-
*
|
| 1302 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1303 |
*
|
| 1304 |
-
* @since 4.0.0
|
| 1305 |
* @category sampling
|
|
|
|
| 1306 |
*/
|
| 1307 |
export class CreateMessageResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CreateMessageResult")({
|
| 1308 |
/**
|
|
@@ -1315,13 +1576,20 @@ export class CreateMessageResult extends /*#__PURE__*/Schema.Class("@effect/ai/M
|
|
| 1315 |
stopReason: /*#__PURE__*/optional(Schema.String)
|
| 1316 |
}) {}
|
| 1317 |
/**
|
| 1318 |
-
*
|
| 1319 |
-
*
|
| 1320 |
-
*
|
| 1321 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1322 |
*
|
| 1323 |
-
* @since 4.0.0
|
| 1324 |
* @category sampling
|
|
|
|
| 1325 |
*/
|
| 1326 |
export class CreateMessage extends /*#__PURE__*/Rpc.make("sampling/createMessage", {
|
| 1327 |
success: CreateMessageResult,
|
|
@@ -1361,10 +1629,10 @@ export class CreateMessage extends /*#__PURE__*/Rpc.make("sampling/createMessage
|
|
| 1361 |
// Autocomplete
|
| 1362 |
// =============================================================================
|
| 1363 |
/**
|
| 1364 |
-
*
|
| 1365 |
*
|
| 1366 |
-
* @since 4.0.0
|
| 1367 |
* @category autocomplete
|
|
|
|
| 1368 |
*/
|
| 1369 |
export class ResourceReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1370 |
type: /*#__PURE__*/Schema.tag("ref/resource"),
|
|
@@ -1374,10 +1642,10 @@ export class ResourceReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*
|
|
| 1374 |
uri: Schema.String
|
| 1375 |
})) {}
|
| 1376 |
/**
|
| 1377 |
-
*
|
| 1378 |
*
|
| 1379 |
-
* @since 4.0.0
|
| 1380 |
* @category autocomplete
|
|
|
|
| 1381 |
*/
|
| 1382 |
export class PromptReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1383 |
type: /*#__PURE__*/Schema.tag("ref/prompt"),
|
|
@@ -1388,10 +1656,10 @@ export class PromptReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/S
|
|
| 1388 |
title: /*#__PURE__*/optional(Schema.String)
|
| 1389 |
})) {}
|
| 1390 |
/**
|
| 1391 |
-
*
|
| 1392 |
*
|
| 1393 |
-
* @since 4.0.0
|
| 1394 |
* @category autocomplete
|
|
|
|
| 1395 |
*/
|
| 1396 |
export class CompleteResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1397 |
completion: /*#__PURE__*/Schema.Struct({
|
|
@@ -1412,6 +1680,8 @@ export class CompleteResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sc
|
|
| 1412 |
})
|
| 1413 |
})) {
|
| 1414 |
/**
|
|
|
|
|
|
|
| 1415 |
* @since 4.0.0
|
| 1416 |
*/
|
| 1417 |
static empty = /*#__PURE__*/CompleteResult.make({
|
|
@@ -1423,10 +1693,10 @@ export class CompleteResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Sc
|
|
| 1423 |
});
|
| 1424 |
}
|
| 1425 |
/**
|
| 1426 |
-
*
|
| 1427 |
*
|
| 1428 |
-
* @since 4.0.0
|
| 1429 |
* @category autocomplete
|
|
|
|
| 1430 |
*/
|
| 1431 |
export class Complete extends /*#__PURE__*/Rpc.make("completion/complete", {
|
| 1432 |
success: CompleteResult,
|
|
@@ -1465,8 +1735,8 @@ export class Complete extends /*#__PURE__*/Rpc.make("completion/complete", {
|
|
| 1465 |
/**
|
| 1466 |
* Represents a root directory or file that the server can operate on.
|
| 1467 |
*
|
| 1468 |
-
* @since 4.0.0
|
| 1469 |
* @category roots
|
|
|
|
| 1470 |
*/
|
| 1471 |
export class Root extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Root")({
|
| 1472 |
/**
|
|
@@ -1483,12 +1753,14 @@ export class Root extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Root")
|
|
| 1483 |
name: /*#__PURE__*/optional(Schema.String)
|
| 1484 |
}) {}
|
| 1485 |
/**
|
| 1486 |
-
*
|
| 1487 |
-
*
|
| 1488 |
-
*
|
|
|
|
|
|
|
| 1489 |
*
|
| 1490 |
-
* @since 4.0.0
|
| 1491 |
* @category roots
|
|
|
|
| 1492 |
*/
|
| 1493 |
export class ListRootsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListRootsResult")({
|
| 1494 |
roots: /*#__PURE__*/Schema.Array(Root)
|
|
@@ -1497,15 +1769,16 @@ export class ListRootsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSc
|
|
| 1497 |
* Sent from the server to request a list of root URIs from the client. Roots
|
| 1498 |
* allow servers to ask for specific directories or files to operate on. A
|
| 1499 |
* common example for roots is providing a set of repositories or directories a
|
| 1500 |
-
* server should operate
|
| 1501 |
-
*
|
|
|
|
| 1502 |
*
|
| 1503 |
* This request is typically used when the server needs to understand the file
|
| 1504 |
* system structure or access specific locations that the client has permission
|
| 1505 |
* to read from.
|
| 1506 |
*
|
| 1507 |
-
* @since 4.0.0
|
| 1508 |
* @category roots
|
|
|
|
| 1509 |
*/
|
| 1510 |
export class ListRoots extends /*#__PURE__*/Rpc.make("roots/list", {
|
| 1511 |
success: ListRootsResult,
|
|
@@ -1513,13 +1786,18 @@ export class ListRoots extends /*#__PURE__*/Rpc.make("roots/list", {
|
|
| 1513 |
payload: /*#__PURE__*/Schema.UndefinedOr(RequestMeta)
|
| 1514 |
}) {}
|
| 1515 |
/**
|
| 1516 |
-
*
|
| 1517 |
-
*
|
| 1518 |
-
*
|
| 1519 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1520 |
*
|
| 1521 |
-
* @since 4.0.0
|
| 1522 |
* @category roots
|
|
|
|
| 1523 |
*/
|
| 1524 |
export class RootsListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/roots/list_changed", {
|
| 1525 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
@@ -1528,10 +1806,10 @@ export class RootsListChangedNotification extends /*#__PURE__*/Rpc.make("notific
|
|
| 1528 |
// Elicitation
|
| 1529 |
// =============================================================================
|
| 1530 |
/**
|
| 1531 |
-
*
|
| 1532 |
*
|
| 1533 |
-
* @since 4.0.0
|
| 1534 |
* @category elicitation
|
|
|
|
| 1535 |
*/
|
| 1536 |
export class ElicitAcceptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ElicitAcceptResult")({
|
| 1537 |
...ResultMeta.fields,
|
|
@@ -1549,10 +1827,10 @@ export class ElicitAcceptResult extends /*#__PURE__*/Schema.Class("@effect/ai/Mc
|
|
| 1549 |
content: Schema.Any
|
| 1550 |
}) {}
|
| 1551 |
/**
|
| 1552 |
-
*
|
| 1553 |
*
|
| 1554 |
-
* @since 4.0.0
|
| 1555 |
* @category elicitation
|
|
|
|
| 1556 |
*/
|
| 1557 |
export class ElicitDeclineResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ElicitDeclineResult")({
|
| 1558 |
...ResultMeta.fields,
|
|
@@ -1565,15 +1843,23 @@ export class ElicitDeclineResult extends /*#__PURE__*/Schema.Class("@effect/ai/M
|
|
| 1565 |
action: /*#__PURE__*/Schema.Literals(["cancel", "decline"])
|
| 1566 |
}) {}
|
| 1567 |
/**
|
| 1568 |
-
*
|
| 1569 |
*
|
| 1570 |
-
* @since 4.0.0
|
| 1571 |
* @category elicitation
|
|
|
|
| 1572 |
*/
|
| 1573 |
export const ElicitResult = /*#__PURE__*/Schema.Union([ElicitAcceptResult, ElicitDeclineResult]);
|
| 1574 |
/**
|
| 1575 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1576 |
* @category elicitation
|
|
|
|
| 1577 |
*/
|
| 1578 |
export class Elicit extends /*#__PURE__*/Rpc.make("elicitation/create", {
|
| 1579 |
success: ElicitResult,
|
|
@@ -1592,65 +1878,106 @@ export class Elicit extends /*#__PURE__*/Rpc.make("elicitation/create", {
|
|
| 1592 |
}
|
| 1593 |
}) {}
|
| 1594 |
/**
|
| 1595 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1596 |
* @category elicitation
|
|
|
|
| 1597 |
*/
|
| 1598 |
export class ElicitationDeclined extends /*#__PURE__*/Schema.ErrorClass("@effect/ai/McpSchema/ElicitationDeclined")({
|
| 1599 |
_tag: /*#__PURE__*/Schema.tag("ElicitationDeclined"),
|
| 1600 |
request: Elicit.payloadSchema,
|
| 1601 |
-
cause: /*#__PURE__*/optional(Schema.Defect)
|
| 1602 |
}) {}
|
| 1603 |
// =============================================================================
|
| 1604 |
// McpServerClient
|
| 1605 |
// =============================================================================
|
| 1606 |
/**
|
| 1607 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1608 |
* @category client
|
|
|
|
| 1609 |
*/
|
| 1610 |
export class McpServerClient extends /*#__PURE__*/Context.Service()("effect/ai/McpSchema/McpServerClient") {}
|
| 1611 |
/**
|
| 1612 |
-
*
|
|
|
|
|
|
|
| 1613 |
* @category middleware
|
|
|
|
| 1614 |
*/
|
| 1615 |
export class McpServerClientMiddleware extends /*#__PURE__*/RpcMiddleware.Service()("effect/ai/McpSchema/McpServerClientMiddleware") {}
|
| 1616 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1617 |
* @since 4.0.0
|
| 1618 |
-
* @category protocol
|
| 1619 |
*/
|
| 1620 |
export class ClientRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, Initialize, Complete, SetLevel, GetPrompt, ListPrompts, ListResources, ListResourceTemplates, ReadResource, Subscribe, Unsubscribe, CallTool, ListTools).middleware(McpServerClientMiddleware) {}
|
| 1621 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1622 |
* @since 4.0.0
|
| 1623 |
-
* @category protocol
|
| 1624 |
*/
|
| 1625 |
export class ClientNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, InitializedNotification, RootsListChangedNotification) {}
|
| 1626 |
/**
|
|
|
|
|
|
|
|
|
|
| 1627 |
* @since 4.0.0
|
| 1628 |
-
* @category protocol
|
| 1629 |
*/
|
| 1630 |
export class ClientRpcs extends /*#__PURE__*/ClientRequestRpcs.merge(ClientNotificationRpcs) {}
|
| 1631 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1632 |
* @since 4.0.0
|
| 1633 |
-
* @category protocol
|
| 1634 |
*/
|
| 1635 |
export class ServerRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, CreateMessage, ListRoots, Elicit) {}
|
| 1636 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1637 |
* @since 4.0.0
|
| 1638 |
-
* @category protocol
|
| 1639 |
*/
|
| 1640 |
export class ServerNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, LoggingMessageNotification, ResourceUpdatedNotification, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification) {}
|
| 1641 |
const ParamSchemaTypeId = "~effect/ai/McpSchema/ParamSchema";
|
| 1642 |
/**
|
| 1643 |
-
*
|
|
|
|
|
|
|
| 1644 |
* @category parameters
|
|
|
|
| 1645 |
*/
|
| 1646 |
export function isParam(schema) {
|
| 1647 |
return Predicate.hasProperty(schema, ParamSchemaTypeId);
|
| 1648 |
}
|
| 1649 |
/**
|
| 1650 |
-
*
|
| 1651 |
*
|
| 1652 |
-
* @since 4.0.0
|
| 1653 |
* @category parameters
|
|
|
|
| 1654 |
*/
|
| 1655 |
export function param(name, schema) {
|
| 1656 |
return Schema.make(schema.ast, {
|
|
@@ -1663,8 +1990,8 @@ export function param(name, schema) {
|
|
| 1663 |
* Annotation to conditionally enable or disable tools based on client
|
| 1664 |
* information.
|
| 1665 |
*
|
| 1666 |
-
* @since 4.0.0
|
| 1667 |
* @category annotations
|
|
|
|
| 1668 |
*/
|
| 1669 |
export class EnabledWhen extends /*#__PURE__*/Context.Service()("effect/unstable/ai/McpSchema/EnabledWhen") {}
|
| 1670 |
//# sourceMappingURL=McpSchema.js.map
|
|
|
|
| 1 |
/**
|
| 2 |
+
* Defines schemas for Model Context Protocol messages.
|
| 3 |
+
*
|
| 4 |
+
* MCP clients and servers use these schemas to describe the JSON-RPC requests,
|
| 5 |
+
* notifications, results, and errors that can cross the protocol boundary. This
|
| 6 |
+
* module focuses on message shapes: it defines the shared protocol data model,
|
| 7 |
+
* groups related messages for the RPC layer, and provides helpers for optional
|
| 8 |
+
* fields and parameter metadata. Transport and server behavior live in other
|
| 9 |
+
* modules.
|
| 10 |
+
*
|
| 11 |
* @since 4.0.0
|
| 12 |
*/
|
| 13 |
import * as Context from "../../Context.js";
|
|
|
|
| 16 |
import * as Option from "../../Option.js";
|
| 17 |
import * as Predicate from "../../Predicate.js";
|
| 18 |
import * as Schema from "../../Schema.js";
|
| 19 |
+
import * as SchemaGetter from "../../SchemaGetter.js";
|
| 20 |
import * as Rpc from "../rpc/Rpc.js";
|
| 21 |
import * as RpcGroup from "../rpc/RpcGroup.js";
|
| 22 |
import * as RpcMiddleware from "../rpc/RpcMiddleware.js";
|
| 23 |
/**
|
| 24 |
+
* Marks a struct field as optional and supplies `defaultValue` when the field
|
| 25 |
+
* is absent.
|
| 26 |
+
*
|
| 27 |
+
* **Details**
|
| 28 |
+
*
|
| 29 |
+
* The default is used during decoding and as the constructor default for the
|
| 30 |
+
* schema field.
|
| 31 |
+
*
|
| 32 |
+
* @category schemas
|
| 33 |
* @since 4.0.0
|
| 34 |
*/
|
| 35 |
export const optionalWithDefault = (schema, defaultValue) => {
|
| 36 |
const effect = Effect.sync(defaultValue);
|
| 37 |
return Schema.optionalKey(schema).pipe(Schema.decode({
|
| 38 |
+
decode: SchemaGetter.withDefault(effect),
|
| 39 |
+
encode: SchemaGetter.passthrough()
|
| 40 |
}), Schema.withConstructorDefault(effect));
|
| 41 |
};
|
| 42 |
/**
|
| 43 |
+
* Creates an optional MCP struct-field schema from a required schema.
|
| 44 |
+
*
|
| 45 |
+
* **Details**
|
| 46 |
+
*
|
| 47 |
+
* The field may be absent, and explicit `undefined` values are omitted when
|
| 48 |
+
* encoding.
|
| 49 |
+
*
|
| 50 |
+
* @category schemas
|
| 51 |
* @since 4.0.0
|
| 52 |
*/
|
| 53 |
export const optional = schema => Schema.optionalKey(schema).pipe(Schema.decodeTo(Schema.optional(schema), {
|
| 54 |
+
decode: SchemaGetter.passthrough(),
|
| 55 |
+
encode: SchemaGetter.transformOptional(Option.flatMap(Option.fromUndefinedOr))
|
| 56 |
}));
|
| 57 |
// =============================================================================
|
| 58 |
// Common
|
| 59 |
// =============================================================================
|
| 60 |
/**
|
| 61 |
+
* Schema for JSON-RPC request identifiers, allowing string or number ids.
|
| 62 |
*
|
| 63 |
+
* @category schemas
|
| 64 |
* @since 4.0.0
|
|
|
|
| 65 |
*/
|
| 66 |
export const RequestId = /*#__PURE__*/Schema.Union([Schema.String, Schema.Number]);
|
| 67 |
/**
|
| 68 |
+
* Schema for MCP progress tokens that associate progress notifications with the
|
| 69 |
+
* original request.
|
| 70 |
*
|
| 71 |
+
* @category schemas
|
| 72 |
* @since 4.0.0
|
|
|
|
| 73 |
*/
|
| 74 |
export const ProgressToken = /*#__PURE__*/Schema.Union([Schema.String, Schema.Number]);
|
| 75 |
/**
|
| 76 |
+
* Schema for optional MCP request metadata.
|
| 77 |
+
*
|
| 78 |
+
* **Details**
|
| 79 |
+
*
|
| 80 |
+
* Request metadata may include a progress token that asks the receiver to send
|
| 81 |
+
* out-of-band progress notifications for the request.
|
| 82 |
+
*
|
| 83 |
+
* @category schemas
|
| 84 |
* @since 4.0.0
|
|
|
|
| 85 |
*/
|
| 86 |
export class RequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 87 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Struct({
|
|
|
|
| 96 |
}))
|
| 97 |
})) {}
|
| 98 |
/**
|
| 99 |
+
* Schema for optional MCP result metadata.
|
| 100 |
+
*
|
| 101 |
+
* **Details**
|
| 102 |
+
*
|
| 103 |
+
* The `_meta` field is reserved for protocol, extension, or implementation
|
| 104 |
+
* metadata attached to a result.
|
| 105 |
+
*
|
| 106 |
+
* @category schemas
|
| 107 |
* @since 4.0.0
|
|
|
|
| 108 |
*/
|
| 109 |
export class ResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 110 |
/**
|
|
|
|
| 114 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 115 |
})) {}
|
| 116 |
/**
|
| 117 |
+
* Schema for optional MCP notification metadata.
|
| 118 |
+
*
|
| 119 |
+
* **Details**
|
| 120 |
+
*
|
| 121 |
+
* The `_meta` field is reserved for protocol, extension, or implementation
|
| 122 |
+
* metadata attached to a notification.
|
| 123 |
+
*
|
| 124 |
+
* @category schemas
|
| 125 |
* @since 4.0.0
|
|
|
|
| 126 |
*/
|
| 127 |
export class NotificationMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 128 |
/**
|
|
|
|
| 132 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 133 |
})) {}
|
| 134 |
/**
|
| 135 |
+
* Schema for opaque cursor tokens used in pagination.
|
| 136 |
*
|
| 137 |
+
* @category schemas
|
| 138 |
* @since 4.0.0
|
|
|
|
| 139 |
*/
|
| 140 |
export const Cursor = Schema.String;
|
| 141 |
/**
|
| 142 |
+
* Schema for MCP request metadata used by paginated requests.
|
| 143 |
+
*
|
| 144 |
+
* **Details**
|
| 145 |
+
*
|
| 146 |
+
* It includes the base request metadata fields plus an optional cursor
|
| 147 |
+
* indicating where the server should continue listing results.
|
| 148 |
+
*
|
| 149 |
+
* @category schemas
|
| 150 |
* @since 4.0.0
|
|
|
|
| 151 |
*/
|
| 152 |
export class PaginatedRequestMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 153 |
...RequestMeta.fields,
|
|
|
|
| 158 |
cursor: /*#__PURE__*/optional(Cursor)
|
| 159 |
})) {}
|
| 160 |
/**
|
| 161 |
+
* Schema for MCP result metadata returned by paginated operations.
|
| 162 |
+
*
|
| 163 |
+
* **Details**
|
| 164 |
+
*
|
| 165 |
+
* It includes the base result metadata fields plus an optional `nextCursor`,
|
| 166 |
+
* which indicates that more results may be available.
|
| 167 |
+
*
|
| 168 |
+
* @category schemas
|
| 169 |
* @since 4.0.0
|
|
|
|
| 170 |
*/
|
| 171 |
export class PaginatedResultMeta extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 172 |
...ResultMeta.fields,
|
|
|
|
| 177 |
nextCursor: /*#__PURE__*/optional(Cursor)
|
| 178 |
})) {}
|
| 179 |
/**
|
| 180 |
+
* Schema for MCP conversation roles, allowing user and assistant.
|
| 181 |
+
*
|
| 182 |
+
* @category schemas
|
| 183 |
* @since 4.0.0
|
|
|
|
| 184 |
*/
|
| 185 |
export const Role = /*#__PURE__*/Schema.Literals(["user", "assistant"]);
|
| 186 |
/**
|
| 187 |
+
* Schema for optional client-facing annotations on MCP objects.
|
| 188 |
+
*
|
| 189 |
+
* **When to use**
|
| 190 |
+
*
|
| 191 |
+
* Use to describe intended audience and priority metadata for objects shown or
|
| 192 |
+
* processed by a client.
|
| 193 |
*
|
| 194 |
+
* @category schemas
|
| 195 |
* @since 4.0.0
|
|
|
|
| 196 |
*/
|
| 197 |
export class Annotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 198 |
/**
|
|
|
|
| 217 |
/**
|
| 218 |
* Describes the name and version of an MCP implementation.
|
| 219 |
*
|
| 220 |
+
* @category schemas
|
| 221 |
* @since 4.0.0
|
|
|
|
| 222 |
*/
|
| 223 |
export class Implementation extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 224 |
name: Schema.String,
|
|
|
|
| 226 |
version: Schema.String
|
| 227 |
})) {}
|
| 228 |
/**
|
| 229 |
+
* Describes capabilities advertised by an MCP client.
|
|
|
|
|
|
|
| 230 |
*
|
| 231 |
+
* **When to use**
|
| 232 |
+
*
|
| 233 |
+
* Use to describe which optional MCP features a client supports during
|
| 234 |
+
* initialization.
|
| 235 |
+
*
|
| 236 |
+
* **Details**
|
| 237 |
+
*
|
| 238 |
+
* Known capabilities are represented by this schema, but the capability set is
|
| 239 |
+
* open and clients may define additional capabilities.
|
| 240 |
+
*
|
| 241 |
+
* @category schemas
|
| 242 |
* @since 4.0.0
|
|
|
|
| 243 |
*/
|
| 244 |
export class ClientCapabilities extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ClientCapabilities")({
|
| 245 |
/**
|
|
|
|
| 270 |
elicitation: /*#__PURE__*/optional(/*#__PURE__*/Schema.Struct({}))
|
| 271 |
}) {}
|
| 272 |
/**
|
| 273 |
+
* Describes capabilities advertised by an MCP server.
|
| 274 |
+
*
|
| 275 |
+
* **When to use**
|
| 276 |
+
*
|
| 277 |
+
* Use to describe which optional MCP features a server supports during
|
| 278 |
+
* initialization.
|
| 279 |
+
*
|
| 280 |
+
* **Details**
|
| 281 |
+
*
|
| 282 |
+
* Known capabilities are represented by this schema, but the capability set is
|
| 283 |
+
* open and servers may define additional capabilities.
|
| 284 |
*
|
| 285 |
+
* @category schemas
|
| 286 |
* @since 4.0.0
|
|
|
|
| 287 |
*/
|
| 288 |
export class ServerCapabilities extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 289 |
/**
|
|
|
|
| 339 |
// Errors
|
| 340 |
// =============================================================================
|
| 341 |
/**
|
| 342 |
+
* Schema for MCP and JSON-RPC error objects.
|
| 343 |
+
*
|
| 344 |
+
* **Details**
|
| 345 |
+
*
|
| 346 |
+
* It contains the numeric error `code`, a concise `message`, and optional
|
| 347 |
+
* sender-defined `data`.
|
| 348 |
+
*
|
| 349 |
+
* @category schemas
|
| 350 |
* @since 4.0.0
|
|
|
|
| 351 |
*/
|
| 352 |
export class McpErrorBase extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/McpErrorBase")({
|
| 353 |
/**
|
|
|
|
| 366 |
data: /*#__PURE__*/optional(Schema.Any)
|
| 367 |
}) {}
|
| 368 |
/**
|
| 369 |
+
* Represents the JSON-RPC error code for requests that are not valid request objects.
|
| 370 |
+
*
|
| 371 |
+
* **When to use**
|
| 372 |
+
*
|
| 373 |
+
* Use when building an MCP/JSON-RPC error response for a syntactically parsed
|
| 374 |
+
* request object that fails request-shape validation.
|
| 375 |
+
*
|
| 376 |
+
* @category constants
|
| 377 |
* @since 4.0.0
|
|
|
|
| 378 |
*/
|
| 379 |
export const INVALID_REQUEST_ERROR_CODE = -32600;
|
| 380 |
/**
|
| 381 |
+
* Represents the JSON-RPC error code for requests whose method does not exist or is not
|
| 382 |
+
* available.
|
| 383 |
+
*
|
| 384 |
+
* **When to use**
|
| 385 |
+
*
|
| 386 |
+
* Use when building an MCP/JSON-RPC error response for a request whose
|
| 387 |
+
* `method` is unknown or unavailable.
|
| 388 |
+
*
|
| 389 |
+
* @category constants
|
| 390 |
* @since 4.0.0
|
|
|
|
| 391 |
*/
|
| 392 |
export const METHOD_NOT_FOUND_ERROR_CODE = -32601;
|
| 393 |
/**
|
| 394 |
+
* Represents the JSON-RPC error code for invalid method parameters.
|
| 395 |
+
*
|
| 396 |
+
* **When to use**
|
| 397 |
+
*
|
| 398 |
+
* Use when building an MCP/JSON-RPC error response for decoded request
|
| 399 |
+
* parameters that fail method-specific validation.
|
| 400 |
+
*
|
| 401 |
+
* @category constants
|
| 402 |
* @since 4.0.0
|
|
|
|
| 403 |
*/
|
| 404 |
export const INVALID_PARAMS_ERROR_CODE = -32602;
|
| 405 |
/**
|
| 406 |
+
* Represents the JSON-RPC error code for internal server errors.
|
| 407 |
+
*
|
| 408 |
+
* **When to use**
|
| 409 |
+
*
|
| 410 |
+
* Use when building an MCP/JSON-RPC error response for an unexpected
|
| 411 |
+
* server-side failure.
|
| 412 |
+
*
|
| 413 |
+
* @category constants
|
| 414 |
* @since 4.0.0
|
|
|
|
| 415 |
*/
|
| 416 |
export const INTERNAL_ERROR_CODE = -32603;
|
| 417 |
/**
|
| 418 |
+
* Represents the JSON-RPC error code for invalid JSON that could not be parsed.
|
| 419 |
+
*
|
| 420 |
+
* **When to use**
|
| 421 |
+
*
|
| 422 |
+
* Use when building an MCP/JSON-RPC error response before a request object is
|
| 423 |
+
* available because the JSON payload could not be parsed.
|
| 424 |
+
*
|
| 425 |
+
* @category constants
|
| 426 |
* @since 4.0.0
|
|
|
|
| 427 |
*/
|
| 428 |
export const PARSE_ERROR_CODE = -32700;
|
| 429 |
/**
|
| 430 |
+
* Represents an MCP/JSON-RPC error for invalid JSON that could not be parsed.
|
| 431 |
+
*
|
| 432 |
+
* **When to use**
|
| 433 |
+
*
|
| 434 |
+
* Use to report a JSON parse failure before a valid JSON-RPC request object is
|
| 435 |
+
* available.
|
| 436 |
+
*
|
| 437 |
+
* **Details**
|
| 438 |
+
*
|
| 439 |
+
* Uses the standard JSON-RPC parse error code `-32700`.
|
| 440 |
+
*
|
| 441 |
* @category errors
|
| 442 |
+
* @since 4.0.0
|
| 443 |
*/
|
| 444 |
export class ParseError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/ParseError")({
|
| 445 |
...McpErrorBase.fields,
|
|
|
|
| 447 |
code: /*#__PURE__*/Schema.tag(PARSE_ERROR_CODE)
|
| 448 |
}) {}
|
| 449 |
/**
|
| 450 |
+
* Represents an MCP/JSON-RPC error for a request object that is not valid.
|
| 451 |
+
*
|
| 452 |
+
* **When to use**
|
| 453 |
+
*
|
| 454 |
+
* Use to report a syntactically parsed JSON-RPC request that is not a valid
|
| 455 |
+
* request object.
|
| 456 |
+
*
|
| 457 |
+
* **Details**
|
| 458 |
+
*
|
| 459 |
+
* Uses the standard JSON-RPC invalid request code `-32600`.
|
| 460 |
+
*
|
| 461 |
* @category errors
|
| 462 |
+
* @since 4.0.0
|
| 463 |
*/
|
| 464 |
export class InvalidRequest extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InvalidRequest")({
|
| 465 |
...McpErrorBase.fields,
|
|
|
|
| 467 |
code: /*#__PURE__*/Schema.tag(INVALID_REQUEST_ERROR_CODE)
|
| 468 |
}) {}
|
| 469 |
/**
|
| 470 |
+
* Represents an MCP/JSON-RPC error for an unavailable method.
|
| 471 |
+
*
|
| 472 |
+
* **When to use**
|
| 473 |
+
*
|
| 474 |
+
* Use to report a JSON-RPC method that does not exist or is not available.
|
| 475 |
+
*
|
| 476 |
+
* **Details**
|
| 477 |
+
*
|
| 478 |
+
* Uses the standard JSON-RPC method-not-found code `-32601`.
|
| 479 |
+
*
|
| 480 |
* @category errors
|
| 481 |
+
* @since 4.0.0
|
| 482 |
*/
|
| 483 |
export class MethodNotFound extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/MethodNotFound")({
|
| 484 |
...McpErrorBase.fields,
|
|
|
|
| 486 |
code: /*#__PURE__*/Schema.tag(METHOD_NOT_FOUND_ERROR_CODE)
|
| 487 |
}) {}
|
| 488 |
/**
|
| 489 |
+
* Represents an MCP/JSON-RPC error for invalid method parameters.
|
| 490 |
+
*
|
| 491 |
+
* **When to use**
|
| 492 |
+
*
|
| 493 |
+
* Use to report a request whose method parameters do not match the method
|
| 494 |
+
* schema.
|
| 495 |
+
*
|
| 496 |
+
* **Details**
|
| 497 |
+
*
|
| 498 |
+
* Uses the standard JSON-RPC invalid params code `-32602`.
|
| 499 |
+
*
|
| 500 |
* @category errors
|
| 501 |
+
* @since 4.0.0
|
| 502 |
*/
|
| 503 |
export class InvalidParams extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InvalidParams")({
|
| 504 |
...McpErrorBase.fields,
|
|
|
|
| 506 |
code: /*#__PURE__*/Schema.tag(INVALID_PARAMS_ERROR_CODE)
|
| 507 |
}) {}
|
| 508 |
/**
|
| 509 |
+
* Represents an MCP/JSON-RPC error for unexpected internal server failures.
|
| 510 |
+
*
|
| 511 |
+
* **When to use**
|
| 512 |
+
*
|
| 513 |
+
* Use to report an unexpected server-side failure while handling a valid
|
| 514 |
+
* request.
|
| 515 |
+
*
|
| 516 |
+
* **Details**
|
| 517 |
+
*
|
| 518 |
+
* Uses the standard JSON-RPC internal error code `-32603` and includes
|
| 519 |
+
* `InternalError.notImplemented` for unimplemented handlers.
|
| 520 |
+
*
|
| 521 |
* @category errors
|
| 522 |
+
* @since 4.0.0
|
| 523 |
*/
|
| 524 |
export class InternalError extends /*#__PURE__*/Schema.ErrorClass("effect/ai/McpSchema/InternalError")({
|
| 525 |
...McpErrorBase.fields,
|
|
|
|
| 531 |
});
|
| 532 |
}
|
| 533 |
/**
|
| 534 |
+
* Schema for MCP protocol errors returned in JSON-RPC failure responses,
|
| 535 |
+
* including standard protocol errors and custom `McpErrorBase` values.
|
| 536 |
+
*
|
| 537 |
* @category errors
|
| 538 |
+
* @since 4.0.0
|
| 539 |
*/
|
| 540 |
export const McpError = /*#__PURE__*/Schema.Union([ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpErrorBase]);
|
| 541 |
// =============================================================================
|
| 542 |
// Ping
|
| 543 |
// =============================================================================
|
| 544 |
/**
|
| 545 |
+
* Represents an MCP ping request used to check whether the peer is still alive.
|
| 546 |
+
*
|
| 547 |
+
* **When to use**
|
| 548 |
+
*
|
| 549 |
+
* Use to implement client or server liveness checks.
|
| 550 |
+
*
|
| 551 |
+
* **Details**
|
| 552 |
+
*
|
| 553 |
+
* The receiver should respond promptly; otherwise the sender may disconnect.
|
| 554 |
*
|
|
|
|
| 555 |
* @category ping
|
| 556 |
+
* @since 4.0.0
|
| 557 |
*/
|
| 558 |
export class Ping extends /*#__PURE__*/Rpc.make("ping", {
|
| 559 |
success: /*#__PURE__*/Schema.Struct({}),
|
|
|
|
| 564 |
// Initialization
|
| 565 |
// =============================================================================
|
| 566 |
/**
|
| 567 |
+
* Schema for the server's response to an initialize request from the client.
|
|
|
|
| 568 |
*
|
|
|
|
| 569 |
* @category initialization
|
| 570 |
+
* @since 4.0.0
|
| 571 |
*/
|
| 572 |
export class InitializeResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 573 |
...ResultMeta.fields,
|
|
|
|
| 589 |
instructions: /*#__PURE__*/optional(Schema.String)
|
| 590 |
})) {}
|
| 591 |
/**
|
| 592 |
+
* Sent from the client to the server when it first connects, asking it to begin
|
| 593 |
+
* initialization.
|
| 594 |
*
|
|
|
|
| 595 |
* @category initialization
|
| 596 |
+
* @since 4.0.0
|
| 597 |
*/
|
| 598 |
export class Initialize extends /*#__PURE__*/Rpc.make("initialize", {
|
| 599 |
success: InitializeResult,
|
|
|
|
| 618 |
}
|
| 619 |
}) {}
|
| 620 |
/**
|
| 621 |
+
* Sent from the client to the server after initialization has finished.
|
|
|
|
| 622 |
*
|
|
|
|
| 623 |
* @category initialization
|
| 624 |
+
* @since 4.0.0
|
| 625 |
*/
|
| 626 |
export class InitializedNotification extends /*#__PURE__*/Rpc.make("notifications/initialized", {
|
| 627 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
|
|
| 630 |
// Cancellation
|
| 631 |
// =============================================================================
|
| 632 |
/**
|
| 633 |
+
* Sent from either peer to cancel a previously issued request in the same
|
| 634 |
+
* direction.
|
| 635 |
+
*
|
| 636 |
+
* **Details**
|
| 637 |
+
*
|
| 638 |
+
* The payload identifies the request to cancel and may include a
|
| 639 |
+
* human-readable reason.
|
| 640 |
+
*
|
| 641 |
* @category cancellation
|
| 642 |
+
* @since 4.0.0
|
| 643 |
*/
|
| 644 |
export class CancelledNotification extends /*#__PURE__*/Rpc.make("notifications/cancelled", {
|
| 645 |
payload: {
|
|
|
|
| 662 |
// Progress
|
| 663 |
// =============================================================================
|
| 664 |
/**
|
| 665 |
+
* Sent from either peer to report progress for a long-running request.
|
|
|
|
| 666 |
*
|
|
|
|
| 667 |
* @category progress
|
| 668 |
+
* @since 4.0.0
|
| 669 |
*/
|
| 670 |
export class ProgressNotification extends /*#__PURE__*/Rpc.make("notifications/progress", {
|
| 671 |
payload: {
|
|
|
|
| 694 |
// Resources
|
| 695 |
// =============================================================================
|
| 696 |
/**
|
| 697 |
+
* Schema for a known resource that the server is capable of reading.
|
| 698 |
*
|
|
|
|
| 699 |
* @category resources
|
| 700 |
+
* @since 4.0.0
|
| 701 |
*/
|
| 702 |
export class Resource extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Resource")({
|
| 703 |
/**
|
|
|
|
| 743 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 744 |
}) {}
|
| 745 |
/**
|
| 746 |
+
* Schema for a template description of resources available on the server.
|
| 747 |
*
|
|
|
|
| 748 |
* @category resources
|
| 749 |
+
* @since 4.0.0
|
| 750 |
*/
|
| 751 |
export class ResourceTemplate extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResourceTemplate")({
|
| 752 |
/**
|
|
|
|
| 783 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 784 |
}) {}
|
| 785 |
/**
|
| 786 |
+
* Schema for the contents of a specific resource or sub-resource.
|
| 787 |
*
|
|
|
|
| 788 |
* @category resources
|
| 789 |
+
* @since 4.0.0
|
| 790 |
*/
|
| 791 |
export class ResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 792 |
/**
|
|
|
|
| 803 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 804 |
})) {}
|
| 805 |
/**
|
| 806 |
+
* Schema for text resource contents represented as a string.
|
| 807 |
*
|
|
|
|
| 808 |
* @category resources
|
| 809 |
+
* @since 4.0.0
|
| 810 |
*/
|
| 811 |
export class TextResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 812 |
...ResourceContents.fields,
|
|
|
|
| 817 |
text: Schema.String
|
| 818 |
})) {}
|
| 819 |
/**
|
| 820 |
+
* Schema for binary resource contents represented as a `Uint8Array`.
|
| 821 |
*
|
|
|
|
| 822 |
* @category resources
|
| 823 |
+
* @since 4.0.0
|
| 824 |
*/
|
| 825 |
export class BlobResourceContents extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 826 |
...ResourceContents.fields,
|
|
|
|
| 830 |
blob: Schema.Uint8Array
|
| 831 |
})) {}
|
| 832 |
/**
|
| 833 |
+
* Schema for the server's response to a resources/list request from the client.
|
| 834 |
*
|
|
|
|
| 835 |
* @category resources
|
| 836 |
+
* @since 4.0.0
|
| 837 |
*/
|
| 838 |
export class ListResourcesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourcesResult")({
|
| 839 |
...PaginatedResultMeta.fields,
|
|
|
|
| 842 |
/**
|
| 843 |
* Sent from the client to request a list of resources the server has.
|
| 844 |
*
|
|
|
|
| 845 |
* @category resources
|
| 846 |
+
* @since 4.0.0
|
| 847 |
*/
|
| 848 |
export class ListResources extends /*#__PURE__*/Rpc.make("resources/list", {
|
| 849 |
success: ListResourcesResult,
|
|
|
|
| 851 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 852 |
}) {}
|
| 853 |
/**
|
| 854 |
+
* Schema for the server's response to a resources/templates/list request from
|
| 855 |
+
* the client.
|
| 856 |
*
|
|
|
|
| 857 |
* @category resources
|
| 858 |
+
* @since 4.0.0
|
| 859 |
*/
|
| 860 |
export class ListResourceTemplatesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourceTemplatesResult")({
|
| 861 |
...PaginatedResultMeta.fields,
|
|
|
|
| 864 |
/**
|
| 865 |
* Sent from the client to request a list of resource templates the server has.
|
| 866 |
*
|
|
|
|
| 867 |
* @category resources
|
| 868 |
+
* @since 4.0.0
|
| 869 |
*/
|
| 870 |
export class ListResourceTemplates extends /*#__PURE__*/Rpc.make("resources/templates/list", {
|
| 871 |
success: ListResourceTemplatesResult,
|
|
|
|
| 873 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 874 |
}) {}
|
| 875 |
/**
|
| 876 |
+
* Schema for the server's response to a resources/read request from the client.
|
| 877 |
*
|
|
|
|
| 878 |
* @category resources
|
| 879 |
+
* @since 4.0.0
|
| 880 |
*/
|
| 881 |
export class ReadResourceResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 882 |
...ResultMeta.fields,
|
|
|
|
| 885 |
/**
|
| 886 |
* Sent from the client to the server, to read a specific resource URI.
|
| 887 |
*
|
|
|
|
| 888 |
* @category resources
|
| 889 |
+
* @since 4.0.0
|
| 890 |
*/
|
| 891 |
export class ReadResource extends /*#__PURE__*/Rpc.make("resources/read", {
|
| 892 |
success: ReadResourceResult,
|
|
|
|
| 901 |
}
|
| 902 |
}) {}
|
| 903 |
/**
|
| 904 |
+
* Represents a notification that the server's resource list changed.
|
| 905 |
+
*
|
| 906 |
+
* **When to use**
|
| 907 |
+
*
|
| 908 |
+
* Use to notify clients that `resources/list` should be requested again.
|
| 909 |
+
*
|
| 910 |
+
* **Details**
|
| 911 |
+
*
|
| 912 |
+
* Servers may send this notification without a previous client subscription.
|
| 913 |
*
|
|
|
|
| 914 |
* @category resources
|
| 915 |
+
* @since 4.0.0
|
| 916 |
*/
|
| 917 |
export class ResourceListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/list_changed", {
|
| 918 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
|
|
| 921 |
* Sent from the client to request resources/updated notifications from the
|
| 922 |
* server whenever a particular resource changes.
|
| 923 |
*
|
|
|
|
| 924 |
* @category resources
|
| 925 |
+
* @since 4.0.0
|
| 926 |
*/
|
| 927 |
export class Subscribe extends /*#__PURE__*/Rpc.make("resources/subscribe", {
|
| 928 |
error: McpError,
|
|
|
|
| 940 |
* notifications from the server. This should follow a previous
|
| 941 |
* resources/subscribe request.
|
| 942 |
*
|
|
|
|
| 943 |
* @category resources
|
| 944 |
+
* @since 4.0.0
|
| 945 |
*/
|
| 946 |
export class Unsubscribe extends /*#__PURE__*/Rpc.make("resources/unsubscribe", {
|
| 947 |
error: McpError,
|
|
|
|
| 955 |
}
|
| 956 |
}) {}
|
| 957 |
/**
|
| 958 |
+
* Sent from the server when a subscribed resource URI has changed.
|
| 959 |
+
*
|
| 960 |
+
* **Details**
|
| 961 |
+
*
|
| 962 |
+
* The URI may identify a sub-resource of the resource that the client
|
| 963 |
+
* originally subscribed to.
|
| 964 |
+
*
|
| 965 |
* @category resources
|
| 966 |
+
* @since 4.0.0
|
| 967 |
*/
|
| 968 |
export class ResourceUpdatedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/updated", {
|
| 969 |
payload: {
|
|
|
|
| 980 |
/**
|
| 981 |
* Describes an argument that a prompt can accept.
|
| 982 |
*
|
| 983 |
+
* @category schemas
|
| 984 |
* @since 4.0.0
|
|
|
|
| 985 |
*/
|
| 986 |
export class PromptArgument extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 987 |
/**
|
|
|
|
| 999 |
required: /*#__PURE__*/optional(Schema.Boolean)
|
| 1000 |
})) {}
|
| 1001 |
/**
|
| 1002 |
+
* Represents a prompt or prompt template that the server offers.
|
| 1003 |
*
|
| 1004 |
+
* @category schemas
|
| 1005 |
* @since 4.0.0
|
|
|
|
| 1006 |
*/
|
| 1007 |
export class Prompt extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Prompt")({
|
| 1008 |
/**
|
|
|
|
| 1020 |
arguments: /*#__PURE__*/optional(/*#__PURE__*/Schema.Array(PromptArgument))
|
| 1021 |
}) {}
|
| 1022 |
/**
|
| 1023 |
+
* Represents text content provided to or from an LLM.
|
| 1024 |
*
|
| 1025 |
+
* @category schemas
|
| 1026 |
* @since 4.0.0
|
|
|
|
| 1027 |
*/
|
| 1028 |
export class TextContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1029 |
type: /*#__PURE__*/Schema.tag("text"),
|
|
|
|
| 1037 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 1038 |
})) {}
|
| 1039 |
/**
|
| 1040 |
+
* Represents image content provided to or from an LLM.
|
| 1041 |
*
|
| 1042 |
+
* @category schemas
|
| 1043 |
* @since 4.0.0
|
|
|
|
| 1044 |
*/
|
| 1045 |
export class ImageContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1046 |
type: /*#__PURE__*/Schema.tag("image"),
|
|
|
|
| 1059 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 1060 |
})) {}
|
| 1061 |
/**
|
| 1062 |
+
* Represents audio content provided to or from an LLM.
|
| 1063 |
*
|
| 1064 |
+
* @category schemas
|
| 1065 |
* @since 4.0.0
|
|
|
|
| 1066 |
*/
|
| 1067 |
export class AudioContent extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1068 |
type: /*#__PURE__*/Schema.tag("audio"),
|
|
|
|
| 1081 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 1082 |
})) {}
|
| 1083 |
/**
|
| 1084 |
+
* Represents resource contents embedded into a prompt or tool call result.
|
| 1085 |
+
*
|
| 1086 |
+
* **Details**
|
| 1087 |
*
|
| 1088 |
* It is up to the client how best to render embedded resources for the benefit
|
| 1089 |
* of the LLM and/or the user.
|
| 1090 |
*
|
| 1091 |
+
* @category schemas
|
| 1092 |
* @since 4.0.0
|
|
|
|
| 1093 |
*/
|
| 1094 |
export class EmbeddedResource extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1095 |
type: /*#__PURE__*/Schema.tag("resource"),
|
|
|
|
| 1100 |
annotations: /*#__PURE__*/optional(Annotations)
|
| 1101 |
})) {}
|
| 1102 |
/**
|
| 1103 |
+
* Represents a readable resource included in a prompt or tool call result.
|
| 1104 |
+
*
|
| 1105 |
+
* **Gotchas**
|
| 1106 |
*
|
| 1107 |
+
* Resource links returned by tools are not guaranteed to appear in the results
|
| 1108 |
+
* of `resources/list` requests.
|
| 1109 |
*
|
| 1110 |
+
* @category schemas
|
| 1111 |
* @since 4.0.0
|
|
|
|
| 1112 |
*/
|
| 1113 |
export class ResourceLink extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1114 |
...Resource.fields,
|
| 1115 |
type: /*#__PURE__*/Schema.tag("resource_link")
|
| 1116 |
})) {}
|
| 1117 |
/**
|
| 1118 |
+
* Schema for MCP content blocks that can appear in prompt messages or tool
|
| 1119 |
+
* results.
|
| 1120 |
+
*
|
| 1121 |
+
* @category schemas
|
| 1122 |
* @since 4.0.0
|
|
|
|
| 1123 |
*/
|
| 1124 |
export const ContentBlock = /*#__PURE__*/Schema.Union([TextContent, ImageContent, AudioContent, EmbeddedResource, ResourceLink]);
|
| 1125 |
/**
|
| 1126 |
* Describes a message returned as part of a prompt.
|
| 1127 |
*
|
| 1128 |
+
* **Details**
|
| 1129 |
+
*
|
| 1130 |
* This is similar to `SamplingMessage`, but also supports the embedding of
|
| 1131 |
* resources from the MCP server.
|
| 1132 |
*
|
| 1133 |
+
* @category schemas
|
| 1134 |
* @since 4.0.0
|
|
|
|
| 1135 |
*/
|
| 1136 |
export class PromptMessage extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1137 |
role: Role,
|
| 1138 |
content: ContentBlock
|
| 1139 |
})) {}
|
| 1140 |
/**
|
| 1141 |
+
* Represents the server response to a prompts/list request from the client.
|
| 1142 |
*
|
| 1143 |
+
* @category schemas
|
| 1144 |
* @since 4.0.0
|
|
|
|
| 1145 |
*/
|
| 1146 |
export class ListPromptsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListPromptsResult")({
|
| 1147 |
...PaginatedResultMeta.fields,
|
|
|
|
| 1151 |
* Sent from the client to request a list of prompts and prompt templates the
|
| 1152 |
* server has.
|
| 1153 |
*
|
| 1154 |
+
* @category protocols
|
| 1155 |
* @since 4.0.0
|
|
|
|
| 1156 |
*/
|
| 1157 |
export class ListPrompts extends /*#__PURE__*/Rpc.make("prompts/list", {
|
| 1158 |
success: ListPromptsResult,
|
|
|
|
| 1160 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 1161 |
}) {}
|
| 1162 |
/**
|
| 1163 |
+
* Represents the server response to a prompts/get request from the client.
|
| 1164 |
*
|
| 1165 |
+
* @category schemas
|
| 1166 |
* @since 4.0.0
|
|
|
|
| 1167 |
*/
|
| 1168 |
export class GetPromptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/GetPromptResult")({
|
| 1169 |
...ResultMeta.fields,
|
|
|
|
| 1174 |
description: /*#__PURE__*/optional(Schema.String)
|
| 1175 |
}) {}
|
| 1176 |
/**
|
| 1177 |
+
* Sent from the client to get a prompt provided by the server.
|
| 1178 |
*
|
| 1179 |
+
* @category protocols
|
| 1180 |
* @since 4.0.0
|
|
|
|
| 1181 |
*/
|
| 1182 |
export class GetPrompt extends /*#__PURE__*/Rpc.make("prompts/get", {
|
| 1183 |
success: GetPromptResult,
|
|
|
|
| 1196 |
}
|
| 1197 |
}) {}
|
| 1198 |
/**
|
| 1199 |
+
* Represents a notification that the server's prompt list changed.
|
|
|
|
|
|
|
| 1200 |
*
|
| 1201 |
+
* **When to use**
|
| 1202 |
+
*
|
| 1203 |
+
* Use to notify clients that `prompts/list` should be requested again.
|
| 1204 |
+
*
|
| 1205 |
+
* **Details**
|
| 1206 |
+
*
|
| 1207 |
+
* Servers may send this notification without a previous client subscription.
|
| 1208 |
+
*
|
| 1209 |
+
* @category protocols
|
| 1210 |
* @since 4.0.0
|
|
|
|
| 1211 |
*/
|
| 1212 |
export class PromptListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/prompts/list_changed", {
|
| 1213 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
|
|
| 1216 |
// Tools
|
| 1217 |
// =============================================================================
|
| 1218 |
/**
|
| 1219 |
+
* Schema for additional properties describing a tool to clients.
|
| 1220 |
+
*
|
| 1221 |
+
* **Details**
|
| 1222 |
*
|
| 1223 |
* NOTE: all properties in ToolAnnotations are **hints**. They are not
|
| 1224 |
* guaranteed to provide a faithful description of tool behavior (including
|
| 1225 |
* descriptive properties like `title`).
|
| 1226 |
*
|
| 1227 |
+
* **Gotchas**
|
| 1228 |
+
*
|
| 1229 |
* Clients should never make tool use decisions based on ToolAnnotations
|
| 1230 |
* received from untrusted servers.
|
| 1231 |
*
|
|
|
|
| 1232 |
* @category tools
|
| 1233 |
+
* @since 4.0.0
|
| 1234 |
*/
|
| 1235 |
export class ToolAnnotations extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1236 |
/**
|
|
|
|
| 1272 |
openWorldHint: /*#__PURE__*/optionalWithDefault(Schema.Boolean, constTrue)
|
| 1273 |
})) {}
|
| 1274 |
/**
|
| 1275 |
+
* Schema for the definition of a tool the client can call.
|
| 1276 |
*
|
|
|
|
| 1277 |
* @category tools
|
| 1278 |
+
* @since 4.0.0
|
| 1279 |
*/
|
| 1280 |
export class Tool extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Tool")({
|
| 1281 |
/**
|
|
|
|
| 1306 |
_meta: /*#__PURE__*/optional(/*#__PURE__*/Schema.Record(Schema.String, Schema.Json))
|
| 1307 |
}) {}
|
| 1308 |
/**
|
| 1309 |
+
* Schema for the server's response to a tools/list request from the client.
|
| 1310 |
*
|
|
|
|
| 1311 |
* @category tools
|
| 1312 |
+
* @since 4.0.0
|
| 1313 |
*/
|
| 1314 |
export class ListToolsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListToolsResult")({
|
| 1315 |
...PaginatedResultMeta.fields,
|
|
|
|
| 1318 |
/**
|
| 1319 |
* Sent from the client to request a list of tools the server has.
|
| 1320 |
*
|
|
|
|
| 1321 |
* @category tools
|
| 1322 |
+
* @since 4.0.0
|
| 1323 |
*/
|
| 1324 |
export class ListTools extends /*#__PURE__*/Rpc.make("tools/list", {
|
| 1325 |
success: ListToolsResult,
|
|
|
|
| 1327 |
payload: /*#__PURE__*/Schema.UndefinedOr(PaginatedRequestMeta)
|
| 1328 |
}) {}
|
| 1329 |
/**
|
| 1330 |
+
* Schema for the server's response to a tool call.
|
| 1331 |
+
*
|
| 1332 |
+
* **Details**
|
| 1333 |
*
|
| 1334 |
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 1335 |
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 1336 |
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 1337 |
+
* and self-correct. However, any errors in _finding_ the tool, an error
|
| 1338 |
+
* indicating that the server does not support tool calls, or any other
|
| 1339 |
+
* exceptional conditions, should be reported as an MCP error response.
|
| 1340 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1341 |
* @category tools
|
| 1342 |
+
* @since 4.0.0
|
| 1343 |
*/
|
| 1344 |
export class CallToolResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CallToolResult")({
|
| 1345 |
...ResultMeta.fields,
|
|
|
|
| 1353 |
isError: /*#__PURE__*/optional(Schema.Boolean)
|
| 1354 |
}) {}
|
| 1355 |
/**
|
| 1356 |
+
* Represents a client request to invoke a tool provided by the server.
|
| 1357 |
+
*
|
| 1358 |
+
* **When to use**
|
| 1359 |
+
*
|
| 1360 |
+
* Use when you need to represent a client request that already knows the tool
|
| 1361 |
+
* name and asks the server to execute it with argument values.
|
| 1362 |
+
*
|
| 1363 |
+
* @see {@link ListTools} for discovering available tools before calling one
|
| 1364 |
+
* @see {@link CallToolResult} for the successful tool-call result shape
|
| 1365 |
*
|
|
|
|
| 1366 |
* @category tools
|
| 1367 |
+
* @since 4.0.0
|
| 1368 |
*/
|
| 1369 |
export class CallTool extends /*#__PURE__*/Rpc.make("tools/call", {
|
| 1370 |
success: CallToolResult,
|
|
|
|
| 1376 |
}
|
| 1377 |
}) {}
|
| 1378 |
/**
|
| 1379 |
+
* Represents a notification that the server's tool list changed.
|
| 1380 |
+
*
|
| 1381 |
+
* **When to use**
|
| 1382 |
+
*
|
| 1383 |
+
* Use to notify clients that `tools/list` should be requested again.
|
| 1384 |
+
*
|
| 1385 |
+
* **Details**
|
| 1386 |
+
*
|
| 1387 |
+
* Servers may send this notification without a previous client subscription.
|
| 1388 |
*
|
|
|
|
| 1389 |
* @category tools
|
| 1390 |
+
* @since 4.0.0
|
| 1391 |
*/
|
| 1392 |
export class ToolListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/tools/list_changed", {
|
| 1393 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
|
|
| 1396 |
// Logging
|
| 1397 |
// =============================================================================
|
| 1398 |
/**
|
| 1399 |
+
* Schema for log message severity levels, mapped to syslog message severities
|
| 1400 |
+
* as specified in RFC 5424 section 6.2.1:
|
| 1401 |
+
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1.
|
| 1402 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1403 |
* @category logging
|
| 1404 |
+
* @since 4.0.0
|
| 1405 |
*/
|
| 1406 |
export const LoggingLevel = /*#__PURE__*/Schema.Literals(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
| 1407 |
/**
|
| 1408 |
+
* Sent from the client to the server to enable or adjust logging.
|
| 1409 |
*
|
|
|
|
| 1410 |
* @category logging
|
| 1411 |
+
* @since 4.0.0
|
| 1412 |
*/
|
| 1413 |
export class SetLevel extends /*#__PURE__*/Rpc.make("logging/setLevel", {
|
| 1414 |
payload: {
|
|
|
|
| 1423 |
error: McpError
|
| 1424 |
}) {}
|
| 1425 |
/**
|
| 1426 |
+
* Sent from the server to the client carrying a log message.
|
| 1427 |
+
*
|
| 1428 |
+
* **Details**
|
| 1429 |
+
*
|
| 1430 |
+
* The notification includes the severity level, optional logger name, and
|
| 1431 |
+
* JSON-serializable log data.
|
| 1432 |
+
*
|
| 1433 |
* @category logging
|
| 1434 |
+
* @since 4.0.0
|
| 1435 |
*/
|
| 1436 |
export class LoggingMessageNotification extends /*#__PURE__*/Rpc.make("notifications/message", {
|
| 1437 |
payload: /*#__PURE__*/Schema.Struct({
|
|
|
|
| 1457 |
/**
|
| 1458 |
* Describes a message issued to or received from an LLM API.
|
| 1459 |
*
|
|
|
|
| 1460 |
* @category sampling
|
| 1461 |
+
* @since 4.0.0
|
| 1462 |
*/
|
| 1463 |
export class SamplingMessage extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1464 |
role: Role,
|
| 1465 |
content: /*#__PURE__*/Schema.Union([TextContent, ImageContent, AudioContent])
|
| 1466 |
})) {}
|
| 1467 |
/**
|
| 1468 |
+
* Schema for model selection hints.
|
| 1469 |
+
*
|
| 1470 |
+
* **Details**
|
| 1471 |
*
|
| 1472 |
* Keys not declared here are currently left unspecified by the spec and are up
|
| 1473 |
* to the client to interpret.
|
| 1474 |
*
|
|
|
|
| 1475 |
* @category sampling
|
| 1476 |
+
* @since 4.0.0
|
| 1477 |
*/
|
| 1478 |
export class ModelHint extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1479 |
/**
|
|
|
|
| 1491 |
name: /*#__PURE__*/optional(Schema.String)
|
| 1492 |
})) {}
|
| 1493 |
/**
|
| 1494 |
+
* Schema for the server's model selection preferences requested of the client
|
| 1495 |
+
* during sampling.
|
| 1496 |
+
*
|
| 1497 |
+
* **Details**
|
| 1498 |
*
|
| 1499 |
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
| 1500 |
+
* rarely straightforward. Different models excel in different areas, some are
|
| 1501 |
* faster but less capable, others are more capable but more expensive, and so
|
| 1502 |
* on. This interface allows servers to express their priorities across multiple
|
| 1503 |
* dimensions to help clients make an appropriate selection for their use case.
|
| 1504 |
*
|
| 1505 |
+
* **Gotchas**
|
| 1506 |
+
*
|
| 1507 |
* These preferences are always advisory. The client MAY ignore them. It is also
|
| 1508 |
* up to the client to decide how to interpret these preferences and how to
|
| 1509 |
* balance them against other considerations.
|
| 1510 |
*
|
|
|
|
| 1511 |
* @category sampling
|
| 1512 |
+
* @since 4.0.0
|
| 1513 |
*/
|
| 1514 |
export class ModelPreferences extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ModelPreferences")({
|
| 1515 |
/**
|
|
|
|
| 1551 |
})))
|
| 1552 |
}) {}
|
| 1553 |
/**
|
| 1554 |
+
* Represents a client response to an MCP sampling request.
|
| 1555 |
+
*
|
| 1556 |
+
* **When to use**
|
| 1557 |
+
*
|
| 1558 |
+
* Use to return the message produced by client-side model sampling.
|
| 1559 |
+
*
|
| 1560 |
+
* **Details**
|
| 1561 |
+
*
|
| 1562 |
+
* The client should let the user inspect the sampled message before returning
|
| 1563 |
+
* it to the server.
|
| 1564 |
*
|
|
|
|
| 1565 |
* @category sampling
|
| 1566 |
+
* @since 4.0.0
|
| 1567 |
*/
|
| 1568 |
export class CreateMessageResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CreateMessageResult")({
|
| 1569 |
/**
|
|
|
|
| 1576 |
stopReason: /*#__PURE__*/optional(Schema.String)
|
| 1577 |
}) {}
|
| 1578 |
/**
|
| 1579 |
+
* Represents a server request for the client to sample an LLM.
|
| 1580 |
+
*
|
| 1581 |
+
* **When to use**
|
| 1582 |
+
*
|
| 1583 |
+
* Use when you need to request model sampling from an MCP client on behalf of a
|
| 1584 |
+
* server.
|
| 1585 |
+
*
|
| 1586 |
+
* **Details**
|
| 1587 |
+
*
|
| 1588 |
+
* The client chooses the model and should ask the user to approve the sampling
|
| 1589 |
+
* request before it begins.
|
| 1590 |
*
|
|
|
|
| 1591 |
* @category sampling
|
| 1592 |
+
* @since 4.0.0
|
| 1593 |
*/
|
| 1594 |
export class CreateMessage extends /*#__PURE__*/Rpc.make("sampling/createMessage", {
|
| 1595 |
success: CreateMessageResult,
|
|
|
|
| 1629 |
// Autocomplete
|
| 1630 |
// =============================================================================
|
| 1631 |
/**
|
| 1632 |
+
* Schema for a reference to a resource or resource template definition.
|
| 1633 |
*
|
|
|
|
| 1634 |
* @category autocomplete
|
| 1635 |
+
* @since 4.0.0
|
| 1636 |
*/
|
| 1637 |
export class ResourceReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1638 |
type: /*#__PURE__*/Schema.tag("ref/resource"),
|
|
|
|
| 1642 |
uri: Schema.String
|
| 1643 |
})) {}
|
| 1644 |
/**
|
| 1645 |
+
* Schema for a prompt reference used in autocomplete requests.
|
| 1646 |
*
|
|
|
|
| 1647 |
* @category autocomplete
|
| 1648 |
+
* @since 4.0.0
|
| 1649 |
*/
|
| 1650 |
export class PromptReference extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1651 |
type: /*#__PURE__*/Schema.tag("ref/prompt"),
|
|
|
|
| 1656 |
title: /*#__PURE__*/optional(Schema.String)
|
| 1657 |
})) {}
|
| 1658 |
/**
|
| 1659 |
+
* Schema for the server's response to a completion/complete request.
|
| 1660 |
*
|
|
|
|
| 1661 |
* @category autocomplete
|
| 1662 |
+
* @since 4.0.0
|
| 1663 |
*/
|
| 1664 |
export class CompleteResult extends /*#__PURE__*/Schema.Opaque()(/*#__PURE__*/Schema.Struct({
|
| 1665 |
completion: /*#__PURE__*/Schema.Struct({
|
|
|
|
| 1680 |
})
|
| 1681 |
})) {
|
| 1682 |
/**
|
| 1683 |
+
* Empty completion result used when a completion request has no values.
|
| 1684 |
+
*
|
| 1685 |
* @since 4.0.0
|
| 1686 |
*/
|
| 1687 |
static empty = /*#__PURE__*/CompleteResult.make({
|
|
|
|
| 1693 |
});
|
| 1694 |
}
|
| 1695 |
/**
|
| 1696 |
+
* Sent from the client to the server to ask for completion options.
|
| 1697 |
*
|
|
|
|
| 1698 |
* @category autocomplete
|
| 1699 |
+
* @since 4.0.0
|
| 1700 |
*/
|
| 1701 |
export class Complete extends /*#__PURE__*/Rpc.make("completion/complete", {
|
| 1702 |
success: CompleteResult,
|
|
|
|
| 1735 |
/**
|
| 1736 |
* Represents a root directory or file that the server can operate on.
|
| 1737 |
*
|
|
|
|
| 1738 |
* @category roots
|
| 1739 |
+
* @since 4.0.0
|
| 1740 |
*/
|
| 1741 |
export class Root extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Root")({
|
| 1742 |
/**
|
|
|
|
| 1753 |
name: /*#__PURE__*/optional(Schema.String)
|
| 1754 |
}) {}
|
| 1755 |
/**
|
| 1756 |
+
* Represents a client response containing the roots available to the server.
|
| 1757 |
+
*
|
| 1758 |
+
* **When to use**
|
| 1759 |
+
*
|
| 1760 |
+
* Use to return the directories or files that an MCP server may operate on.
|
| 1761 |
*
|
|
|
|
| 1762 |
* @category roots
|
| 1763 |
+
* @since 4.0.0
|
| 1764 |
*/
|
| 1765 |
export class ListRootsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListRootsResult")({
|
| 1766 |
roots: /*#__PURE__*/Schema.Array(Root)
|
|
|
|
| 1769 |
* Sent from the server to request a list of root URIs from the client. Roots
|
| 1770 |
* allow servers to ask for specific directories or files to operate on. A
|
| 1771 |
* common example for roots is providing a set of repositories or directories a
|
| 1772 |
+
* server should operate on.
|
| 1773 |
+
*
|
| 1774 |
+
* **Details**
|
| 1775 |
*
|
| 1776 |
* This request is typically used when the server needs to understand the file
|
| 1777 |
* system structure or access specific locations that the client has permission
|
| 1778 |
* to read from.
|
| 1779 |
*
|
|
|
|
| 1780 |
* @category roots
|
| 1781 |
+
* @since 4.0.0
|
| 1782 |
*/
|
| 1783 |
export class ListRoots extends /*#__PURE__*/Rpc.make("roots/list", {
|
| 1784 |
success: ListRootsResult,
|
|
|
|
| 1786 |
payload: /*#__PURE__*/Schema.UndefinedOr(RequestMeta)
|
| 1787 |
}) {}
|
| 1788 |
/**
|
| 1789 |
+
* Represents a notification that the client's root list changed.
|
| 1790 |
+
*
|
| 1791 |
+
* **When to use**
|
| 1792 |
+
*
|
| 1793 |
+
* Use to tell the server that it should request an updated roots list.
|
| 1794 |
+
*
|
| 1795 |
+
* **Details**
|
| 1796 |
+
*
|
| 1797 |
+
* Send this when the client adds, removes, or modifies a root.
|
| 1798 |
*
|
|
|
|
| 1799 |
* @category roots
|
| 1800 |
+
* @since 4.0.0
|
| 1801 |
*/
|
| 1802 |
export class RootsListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/roots/list_changed", {
|
| 1803 |
payload: /*#__PURE__*/Schema.UndefinedOr(NotificationMeta)
|
|
|
|
| 1806 |
// Elicitation
|
| 1807 |
// =============================================================================
|
| 1808 |
/**
|
| 1809 |
+
* Schema for an accepted client response to an elicitation request.
|
| 1810 |
*
|
|
|
|
| 1811 |
* @category elicitation
|
| 1812 |
+
* @since 4.0.0
|
| 1813 |
*/
|
| 1814 |
export class ElicitAcceptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ElicitAcceptResult")({
|
| 1815 |
...ResultMeta.fields,
|
|
|
|
| 1827 |
content: Schema.Any
|
| 1828 |
}) {}
|
| 1829 |
/**
|
| 1830 |
+
* Schema for a declined or canceled client response to an elicitation request.
|
| 1831 |
*
|
|
|
|
| 1832 |
* @category elicitation
|
| 1833 |
+
* @since 4.0.0
|
| 1834 |
*/
|
| 1835 |
export class ElicitDeclineResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ElicitDeclineResult")({
|
| 1836 |
...ResultMeta.fields,
|
|
|
|
| 1843 |
action: /*#__PURE__*/Schema.Literals(["cancel", "decline"])
|
| 1844 |
}) {}
|
| 1845 |
/**
|
| 1846 |
+
* Schema for every client response to an elicitation request.
|
| 1847 |
*
|
|
|
|
| 1848 |
* @category elicitation
|
| 1849 |
+
* @since 4.0.0
|
| 1850 |
*/
|
| 1851 |
export const ElicitResult = /*#__PURE__*/Schema.Union([ElicitAcceptResult, ElicitDeclineResult]);
|
| 1852 |
/**
|
| 1853 |
+
* Sent from the server asking the client to collect structured input from the
|
| 1854 |
+
* user.
|
| 1855 |
+
*
|
| 1856 |
+
* **Details**
|
| 1857 |
+
*
|
| 1858 |
+
* The client responds with accepted content, an explicit decline, or a
|
| 1859 |
+
* cancellation.
|
| 1860 |
+
*
|
| 1861 |
* @category elicitation
|
| 1862 |
+
* @since 4.0.0
|
| 1863 |
*/
|
| 1864 |
export class Elicit extends /*#__PURE__*/Rpc.make("elicitation/create", {
|
| 1865 |
success: ElicitResult,
|
|
|
|
| 1878 |
}
|
| 1879 |
}) {}
|
| 1880 |
/**
|
| 1881 |
+
* Error raised when an MCP elicitation request is declined or fails before
|
| 1882 |
+
* accepted content is returned.
|
| 1883 |
+
*
|
| 1884 |
+
* **Details**
|
| 1885 |
+
*
|
| 1886 |
+
* The error stores the original elicitation request and, when available, the
|
| 1887 |
+
* underlying cause.
|
| 1888 |
+
*
|
| 1889 |
* @category elicitation
|
| 1890 |
+
* @since 4.0.0
|
| 1891 |
*/
|
| 1892 |
export class ElicitationDeclined extends /*#__PURE__*/Schema.ErrorClass("@effect/ai/McpSchema/ElicitationDeclined")({
|
| 1893 |
_tag: /*#__PURE__*/Schema.tag("ElicitationDeclined"),
|
| 1894 |
request: Elicit.payloadSchema,
|
| 1895 |
+
cause: /*#__PURE__*/optional(/*#__PURE__*/Schema.Defect())
|
| 1896 |
}) {}
|
| 1897 |
// =============================================================================
|
| 1898 |
// McpServerClient
|
| 1899 |
// =============================================================================
|
| 1900 |
/**
|
| 1901 |
+
* Service available while handling an MCP client request.
|
| 1902 |
+
*
|
| 1903 |
+
* **Details**
|
| 1904 |
+
*
|
| 1905 |
+
* It exposes the current client id, the client's initialize payload, and a
|
| 1906 |
+
* scoped RPC client for server-initiated requests back to that client.
|
| 1907 |
+
*
|
| 1908 |
* @category client
|
| 1909 |
+
* @since 4.0.0
|
| 1910 |
*/
|
| 1911 |
export class McpServerClient extends /*#__PURE__*/Context.Service()("effect/ai/McpSchema/McpServerClient") {}
|
| 1912 |
/**
|
| 1913 |
+
* RPC middleware that provides `McpServerClient` to handlers for initialized
|
| 1914 |
+
* MCP clients.
|
| 1915 |
+
*
|
| 1916 |
* @category middleware
|
| 1917 |
+
* @since 4.0.0
|
| 1918 |
*/
|
| 1919 |
export class McpServerClientMiddleware extends /*#__PURE__*/RpcMiddleware.Service()("effect/ai/McpSchema/McpServerClientMiddleware") {}
|
| 1920 |
/**
|
| 1921 |
+
* RPC group for requests that MCP clients send to the server.
|
| 1922 |
+
*
|
| 1923 |
+
* **Details**
|
| 1924 |
+
*
|
| 1925 |
+
* The group includes initialization, resource, prompt, tool, logging,
|
| 1926 |
+
* completion, and ping requests, and installs `McpServerClientMiddleware` for
|
| 1927 |
+
* handlers.
|
| 1928 |
+
*
|
| 1929 |
+
* @category protocols
|
| 1930 |
* @since 4.0.0
|
|
|
|
| 1931 |
*/
|
| 1932 |
export class ClientRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, Initialize, Complete, SetLevel, GetPrompt, ListPrompts, ListResources, ListResourceTemplates, ReadResource, Subscribe, Unsubscribe, CallTool, ListTools).middleware(McpServerClientMiddleware) {}
|
| 1933 |
/**
|
| 1934 |
+
* RPC group for notifications that MCP clients send to the server, such as
|
| 1935 |
+
* cancellation, progress, initialization completion, and roots list changes.
|
| 1936 |
+
*
|
| 1937 |
+
* @category protocols
|
| 1938 |
* @since 4.0.0
|
|
|
|
| 1939 |
*/
|
| 1940 |
export class ClientNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, InitializedNotification, RootsListChangedNotification) {}
|
| 1941 |
/**
|
| 1942 |
+
* RPC group combining all client-to-server MCP requests and notifications.
|
| 1943 |
+
*
|
| 1944 |
+
* @category protocols
|
| 1945 |
* @since 4.0.0
|
|
|
|
| 1946 |
*/
|
| 1947 |
export class ClientRpcs extends /*#__PURE__*/ClientRequestRpcs.merge(ClientNotificationRpcs) {}
|
| 1948 |
/**
|
| 1949 |
+
* RPC group for requests that an MCP server can send to a client, including
|
| 1950 |
+
* ping, sampling, roots listing, and elicitation.
|
| 1951 |
+
*
|
| 1952 |
+
* @category protocols
|
| 1953 |
* @since 4.0.0
|
|
|
|
| 1954 |
*/
|
| 1955 |
export class ServerRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, CreateMessage, ListRoots, Elicit) {}
|
| 1956 |
/**
|
| 1957 |
+
* RPC group for notifications that an MCP server can send to a client,
|
| 1958 |
+
* including cancellation, progress, logging, and list or resource update
|
| 1959 |
+
* notifications.
|
| 1960 |
+
*
|
| 1961 |
+
* @category protocols
|
| 1962 |
* @since 4.0.0
|
|
|
|
| 1963 |
*/
|
| 1964 |
export class ServerNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, LoggingMessageNotification, ResourceUpdatedNotification, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification) {}
|
| 1965 |
const ParamSchemaTypeId = "~effect/ai/McpSchema/ParamSchema";
|
| 1966 |
/**
|
| 1967 |
+
* Returns `true` when a schema was created with `param` and therefore carries
|
| 1968 |
+
* a resource URI template parameter name.
|
| 1969 |
+
*
|
| 1970 |
* @category parameters
|
| 1971 |
+
* @since 4.0.0
|
| 1972 |
*/
|
| 1973 |
export function isParam(schema) {
|
| 1974 |
return Predicate.hasProperty(schema, ParamSchemaTypeId);
|
| 1975 |
}
|
| 1976 |
/**
|
| 1977 |
+
* Creates a parameter for a resource URI template.
|
| 1978 |
*
|
|
|
|
| 1979 |
* @category parameters
|
| 1980 |
+
* @since 4.0.0
|
| 1981 |
*/
|
| 1982 |
export function param(name, schema) {
|
| 1983 |
return Schema.make(schema.ast, {
|
|
|
|
| 1990 |
* Annotation to conditionally enable or disable tools based on client
|
| 1991 |
* information.
|
| 1992 |
*
|
|
|
|
| 1993 |
* @category annotations
|
| 1994 |
+
* @since 4.0.0
|
| 1995 |
*/
|
| 1996 |
export class EnabledWhen extends /*#__PURE__*/Context.Service()("effect/unstable/ai/McpSchema/EnabledWhen") {}
|
| 1997 |
//# sourceMappingURL=McpSchema.js.map
|
.opencode/node_modules/effect/dist/unstable/ai/McpSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"McpSchema.js","names":["Context","Effect","constFalse","constTrue","Option","Predicate","Schema","Getter","Rpc","RpcGroup","RpcMiddleware","optionalWithDefault","schema","defaultValue","effect","sync","optionalKey","pipe","decode","withDefault","encode","passthrough","withConstructorDefault","optional","decodeTo","transformOptional","flatMap","fromUndefinedOr","RequestId","Union","String","Number","ProgressToken","RequestMeta","Opaque","Struct","_meta","progressToken","ResultMeta","Record","Json","NotificationMeta","Cursor","PaginatedRequestMeta","fields","cursor","PaginatedResultMeta","nextCursor","Role","Literals","Annotations","audience","Array","priority","check","isBetween","minimum","maximum","Implementation","name","title","version","ClientCapabilities","Class","experimental","extensions","TemplateLiteral","roots","listChanged","Boolean","sampling","elicitation","ServerCapabilities","logging","completions","prompts","resources","subscribe","tools","McpErrorBase","code","message","data","Any","INVALID_REQUEST_ERROR_CODE","METHOD_NOT_FOUND_ERROR_CODE","INVALID_PARAMS_ERROR_CODE","INTERNAL_ERROR_CODE","PARSE_ERROR_CODE","ParseError","ErrorClass","_tag","tag","InvalidRequest","MethodNotFound","InvalidParams","InternalError","notImplemented","McpError","Ping","make","success","error","payload","UndefinedOr","InitializeResult","protocolVersion","capabilities","serverInfo","instructions","Initialize","clientInfo","InitializedNotification","CancelledNotification","requestId","reason","ProgressNotification","progress","total","Resource","uri","description","mimeType","annotations","size","ResourceTemplate","uriTemplate","ResourceContents","TextResourceContents","text","BlobResourceContents","blob","Uint8Array","ListResourcesResult","ListResources","ListResourceTemplatesResult","resourceTemplates","ListResourceTemplates","ReadResourceResult","contents","ReadResource","ResourceListChangedNotification","Subscribe","Unsubscribe","ResourceUpdatedNotification","PromptArgument","required","Prompt","arguments","TextContent","type","ImageContent","AudioContent","EmbeddedResource","resource","ResourceLink","ContentBlock","PromptMessage","role","content","ListPromptsResult","ListPrompts","GetPromptResult","messages","GetPrompt","PromptListChangedNotification","ToolAnnotations","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","Tool","inputSchema","ListToolsResult","ListTools","CallToolResult","structuredContent","isError","CallTool","ToolListChangedNotification","LoggingLevel","SetLevel","level","LoggingMessageNotification","logger","SamplingMessage","ModelHint","ModelPreferences","hints","costPriority","speedPriority","intelligencePriority","CreateMessageResult","model","stopReason","CreateMessage","modelPreferences","systemPrompt","includeContext","temperature","maxTokens","stopSequences","metadata","ResourceReference","PromptReference","CompleteResult","completion","values","hasMore","empty","Complete","ref","argument","value","context","Root","ListRootsResult","ListRoots","RootsListChangedNotification","ElicitAcceptResult","action","Literal","ElicitDeclineResult","ElicitResult","Elicit","requestedSchema","ElicitationDeclined","request","payloadSchema","cause","Defect","McpServerClient","Service","McpServerClientMiddleware","ClientRequestRpcs","middleware","ClientNotificationRpcs","ClientRpcs","merge","ServerRequestRpcs","ServerNotificationRpcs","ParamSchemaTypeId","isParam","hasProperty","param","ast","EnabledWhen"],"sources":["../../../src/unstable/ai/McpSchema.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,SAASC,UAAU,EAAEC,SAAS,QAAQ,mBAAmB;AACzD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,MAAM,MAAM,uBAAuB;AAE/C,OAAO,KAAKC,GAAG,MAAM,eAAe;AAGpC,OAAO,KAAKC,QAAQ,MAAM,oBAAoB;AAC9C,OAAO,KAAKC,aAAa,MAAM,yBAAyB;AASxD;;;AAGA,OAAO,MAAMC,mBAAmB,GAAGA,CACjCC,MAAS,EACTC,YAAiD,KACvB;EAC1B,MAAMC,MAAM,GAAGb,MAAM,CAACc,IAAI,CAACF,YAAY,CAAC;EACxC,OAAOP,MAAM,CAACU,WAAW,CAACJ,MAAM,CAAC,CAACK,IAAI,CACpCX,MAAM,CAACY,MAAM,CAAwB;IACnCA,MAAM,EAAEX,MAAM,CAACY,WAAW,CAACL,MAAM,CAAC;IAClCM,MAAM,EAAEb,MAAM,CAACc,WAAW;GAC3B,CAAC,EACFf,MAAM,CAACgB,sBAAsB,CAE3BR,MAAM,CAAC,CACV;AACH,CAAC;AAED;;;AAGA,OAAO,MAAMS,QAAQ,GAA0BX,MAAS,IACtDN,MAAM,CAACU,WAAW,CAACJ,MAAM,CAAC,CAACK,IAAI,CAC7BX,MAAM,CAACkB,QAAQ,CA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AC8O,WAAW,CAACvO,MAAM,EAAEqO,iBAAiB,CAAC;AACzD;AA+BA;;;;;;AAMA,OAAM,SAAUG,KAAKA,CACnBzL,IAAU,EACV/C,MAAS;EAET,OAAON,MAAM,CAAC8F,IAAI,CAACxF,MAAM,CAACyO,GAAG,EAAE;IAAE,CAACJ,iBAAiB,GAAGA,iBAAiB;IAAEtL,IAAI;IAAE/C;EAAM,CAAE,CAAC;AAC1F;AAEA;;;;;;;AAOA,OAAM,MAAO0O,WACX,sBAAQtP,OAAO,CAACwO,OAAO,EAA0E,CAC/F,0CAA0C,CAC3C","ignoreList":[]}
|
|
|
|
| 1 |
+
{"version":3,"file":"McpSchema.js","names":["Context","Effect","constFalse","constTrue","Option","Predicate","Schema","SchemaGetter","Rpc","RpcGroup","RpcMiddleware","optionalWithDefault","schema","defaultValue","effect","sync","optionalKey","pipe","decode","withDefault","encode","passthrough","withConstructorDefault","optional","decodeTo","transformOptional","flatMap","fromUndefinedOr","RequestId","Union","String","Number","ProgressToken","RequestMeta","Opaque","Struct","_meta","progressToken","ResultMeta","Record","Json","NotificationMeta","Cursor","PaginatedRequestMeta","fields","cursor","PaginatedResultMeta","nextCursor","Role","Literals","Annotations","audience","Array","priority","check","isBetween","minimum","maximum","Implementation","name","title","version","ClientCapabilities","Class","experimental","extensions","TemplateLiteral","roots","listChanged","Boolean","sampling","elicitation","ServerCapabilities","logging","completions","prompts","resources","subscribe","tools","McpErrorBase","code","message","data","Any","INVALID_REQUEST_ERROR_CODE","METHOD_NOT_FOUND_ERROR_CODE","INVALID_PARAMS_ERROR_CODE","INTERNAL_ERROR_CODE","PARSE_ERROR_CODE","ParseError","ErrorClass","_tag","tag","InvalidRequest","MethodNotFound","InvalidParams","InternalError","notImplemented","McpError","Ping","make","success","error","payload","UndefinedOr","InitializeResult","protocolVersion","capabilities","serverInfo","instructions","Initialize","clientInfo","InitializedNotification","CancelledNotification","requestId","reason","ProgressNotification","progress","total","Resource","uri","description","mimeType","annotations","size","ResourceTemplate","uriTemplate","ResourceContents","TextResourceContents","text","BlobResourceContents","blob","Uint8Array","ListResourcesResult","ListResources","ListResourceTemplatesResult","resourceTemplates","ListResourceTemplates","ReadResourceResult","contents","ReadResource","ResourceListChangedNotification","Subscribe","Unsubscribe","ResourceUpdatedNotification","PromptArgument","required","Prompt","arguments","TextContent","type","ImageContent","AudioContent","EmbeddedResource","resource","ResourceLink","ContentBlock","PromptMessage","role","content","ListPromptsResult","ListPrompts","GetPromptResult","messages","GetPrompt","PromptListChangedNotification","ToolAnnotations","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","Tool","inputSchema","ListToolsResult","ListTools","CallToolResult","structuredContent","isError","CallTool","ToolListChangedNotification","LoggingLevel","SetLevel","level","LoggingMessageNotification","logger","SamplingMessage","ModelHint","ModelPreferences","hints","costPriority","speedPriority","intelligencePriority","CreateMessageResult","model","stopReason","CreateMessage","modelPreferences","systemPrompt","includeContext","temperature","maxTokens","stopSequences","metadata","ResourceReference","PromptReference","CompleteResult","completion","values","hasMore","empty","Complete","ref","argument","value","context","Root","ListRootsResult","ListRoots","RootsListChangedNotification","ElicitAcceptResult","action","Literal","ElicitDeclineResult","ElicitResult","Elicit","requestedSchema","ElicitationDeclined","request","payloadSchema","cause","Defect","McpServerClient","Service","McpServerClientMiddleware","ClientRequestRpcs","middleware","ClientNotificationRpcs","ClientRpcs","merge","ServerRequestRpcs","ServerNotificationRpcs","ParamSchemaTypeId","isParam","hasProperty","param","ast","EnabledWhen"],"sources":["../../../src/unstable/ai/McpSchema.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,SAASC,UAAU,EAAEC,SAAS,QAAQ,mBAAmB;AACzD,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,i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