@effect/ai-openrouter 4.0.0-beta.70 → 4.0.0-beta.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,15 @@ declare const OpenRouterClient_base: Context.ServiceClass<OpenRouterClient, "@ef
71
71
  /**
72
72
  * Service identifier for the OpenRouter client.
73
73
  *
74
+ * **When to use**
75
+ *
76
+ * Use when accessing or providing the OpenRouter client service through
77
+ * Effect's context.
78
+ *
79
+ * @see {@link make} for constructing an OpenRouter client effectfully
80
+ * @see {@link layer} for providing a client from explicit options
81
+ * @see {@link layerConfig} for providing a client from `Config`
82
+ *
74
83
  * @category services
75
84
  * @since 4.0.0
76
85
  */
@@ -98,12 +107,33 @@ export type Options = {
98
107
  *
99
108
  * **When to use**
100
109
  *
101
- * Use this to add middleware, logging, or custom request/response handling.
110
+ * Use to add middleware, logging, or custom request/response handling.
102
111
  */
103
112
  readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined;
104
113
  };
105
114
  /**
106
- * Creates an OpenRouter client service with the given options.
115
+ * Creates an OpenRouter client service from explicit options.
116
+ *
117
+ * **When to use**
118
+ *
119
+ * Use to construct the OpenRouter client service inside an effect when you need
120
+ * the service value directly.
121
+ *
122
+ * **Details**
123
+ *
124
+ * The returned service uses the current `HttpClient`, prepends `apiUrl` or
125
+ * `https://openrouter.ai/api/v1`, adds the bearer token and optional
126
+ * `HTTP-Referer` and `X-Title` headers, accepts JSON responses, and applies
127
+ * `transformClient` when provided.
128
+ *
129
+ * **Gotchas**
130
+ *
131
+ * Scoped `OpenRouterConfig.withClientTransform` applies to generated client
132
+ * request methods. Streaming chat completion requests are sent directly by this
133
+ * module and do not read that scoped transform.
134
+ *
135
+ * @see {@link layer} for providing this client from explicit options
136
+ * @see {@link layerConfig} for loading client settings from `Config`
107
137
  *
108
138
  * @category constructors
109
139
  * @since 4.0.0
@@ -112,13 +142,34 @@ export declare const make: (options: Options) => Effect.Effect<Service, never, H
112
142
  /**
113
143
  * Creates a layer for the OpenRouter client with the given options.
114
144
  *
145
+ * **When to use**
146
+ *
147
+ * Use when you already have the OpenRouter client options in code and want to
148
+ * provide `OpenRouterClient` as a layer.
149
+ *
150
+ * @see {@link make} for constructing the client service effectfully
151
+ * @see {@link layerConfig} for loading client settings from `Config`
152
+ *
115
153
  * @category layers
116
154
  * @since 4.0.0
117
155
  */
118
156
  export declare const layer: (options: Options) => Layer.Layer<OpenRouterClient, never, HttpClient.HttpClient>;
119
157
  /**
120
- * Creates a layer for the OpenRouter client, loading the requisite
121
- * configuration via Effect's `Config` module.
158
+ * Creates a layer for the OpenRouter client from provided `Config` values.
159
+ *
160
+ * **When to use**
161
+ *
162
+ * Use when OpenRouter client settings should be read from Effect `Config`
163
+ * values while providing `OpenRouterClient` as a layer.
164
+ *
165
+ * **Details**
166
+ *
167
+ * Only config values supplied in `options` are loaded. Omitted fields are
168
+ * passed to `make` as `undefined`, and `transformClient` is forwarded as a
169
+ * plain option.
170
+ *
171
+ * @see {@link make} for constructing the client service effectfully
172
+ * @see {@link layer} for providing the client from already-resolved options
122
173
  *
123
174
  * @category layers
124
175
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"OpenRouterClient.d.ts","sourceRoot":"","sources":["../src/OpenRouterClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAEhD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,OAAO,MAAM,4BAA4B,CAAA;AAG1D,OAAO,KAAK,UAAU,MAAM,iC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;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAEnD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAEzD;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAEtD;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,KAAK,UAAU,CAAC,UAAU,CAAC,GAAG,SAAS,CAAA;CAClG,KAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,UAAU,CAwBxE,CAAA"}
@@ -18,6 +18,15 @@ import { OpenRouterConfig } from "./OpenRouterConfig.js";
18
18
  /**
19
19
  * Service identifier for the OpenRouter client.
20
20
  *
21
+ * **When to use**
22
+ *
23
+ * Use when accessing or providing the OpenRouter client service through
24
+ * Effect's context.
25
+ *
26
+ * @see {@link make} for constructing an OpenRouter client effectfully
27
+ * @see {@link layer} for providing a client from explicit options
28
+ * @see {@link layerConfig} for providing a client from `Config`
29
+ *
21
30
  * @category services
22
31
  * @since 4.0.0
23
32
  */
@@ -26,7 +35,28 @@ export class OpenRouterClient extends /*#__PURE__*/Context.Service()("@effect/ai
26
35
  // Constructor
27
36
  // =============================================================================
28
37
  /**
29
- * Creates an OpenRouter client service with the given options.
38
+ * Creates an OpenRouter client service from explicit options.
39
+ *
40
+ * **When to use**
41
+ *
42
+ * Use to construct the OpenRouter client service inside an effect when you need
43
+ * the service value directly.
44
+ *
45
+ * **Details**
46
+ *
47
+ * The returned service uses the current `HttpClient`, prepends `apiUrl` or
48
+ * `https://openrouter.ai/api/v1`, adds the bearer token and optional
49
+ * `HTTP-Referer` and `X-Title` headers, accepts JSON responses, and applies
50
+ * `transformClient` when provided.
51
+ *
52
+ * **Gotchas**
53
+ *
54
+ * Scoped `OpenRouterConfig.withClientTransform` applies to generated client
55
+ * request methods. Streaming chat completion requests are sent directly by this
56
+ * module and do not read that scoped transform.
57
+ *
58
+ * @see {@link layer} for providing this client from explicit options
59
+ * @see {@link layerConfig} for loading client settings from `Config`
30
60
  *
31
61
  * @category constructors
32
62
  * @since 4.0.0
@@ -87,13 +117,34 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
87
117
  /**
88
118
  * Creates a layer for the OpenRouter client with the given options.
89
119
  *
120
+ * **When to use**
121
+ *
122
+ * Use when you already have the OpenRouter client options in code and want to
123
+ * provide `OpenRouterClient` as a layer.
124
+ *
125
+ * @see {@link make} for constructing the client service effectfully
126
+ * @see {@link layerConfig} for loading client settings from `Config`
127
+ *
90
128
  * @category layers
91
129
  * @since 4.0.0
92
130
  */
93
131
  export const layer = options => Layer.effect(OpenRouterClient, make(options));
94
132
  /**
95
- * Creates a layer for the OpenRouter client, loading the requisite
96
- * configuration via Effect's `Config` module.
133
+ * Creates a layer for the OpenRouter client from provided `Config` values.
134
+ *
135
+ * **When to use**
136
+ *
137
+ * Use when OpenRouter client settings should be read from Effect `Config`
138
+ * values while providing `OpenRouterClient` as a layer.
139
+ *
140
+ * **Details**
141
+ *
142
+ * Only config values supplied in `options` are loaded. Omitted fields are
143
+ * passed to `make` as `undefined`, and `transformClient` is forwarded as a
144
+ * plain option.
145
+ *
146
+ * @see {@link make} for constructing the client service effectfully
147
+ * @see {@link layer} for providing the client from already-resolved options
97
148
  *
98
149
  * @category layers
99
150
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"OpenRouterClient.js","names":["Context","Effect","identity","Layer","Predicate","Schema","Stream","Sse","HttpBody","HttpClient","HttpClientRequest","Generated","Errors","OpenRouterConfig","OpenRouterClient","Service","make","fnUntraced","options","baseClient","httpClient","pipe","mapRequest","request","prependUrl","apiUrl","apiKey","bearerToken","siteReferrer","setHeader","siteTitle","acceptJson","transformClient","httpClientOk","filterStatusOk","client","config","getOrUndefined","isNotUndefined","createChatCompletion","payload","sendChatCompletionRequest","includeResponse","catchTags","SendChatCompletionRequest400","error","fail","mapClientError","SendChatCompletionRequest401","SendChatCompletionRequest429","SendChatCompletionRequest500","HttpClientError","mapHttpClientError","SchemaError","mapSchemaError","buildChatCompletionStream","response","stream","decodeText","pipeThroughChannel","decode","mapEffect","event","decodeChatCompletionSseData","data","takeWhile","Retry","die","fromEffect","createChatCompletionStream","execute","post","body","jsonUnsafe","stream_options","include_usage","map","catchTag","of","layer","effect","layerConfig","gen","undefined","ChatStreamingResponseChunkDataFromString","fromJsonString","ChatStreamingResponseChunk","fields","decodeChatStreamingResponseChunkData","decodeUnknownEffect","succeed"],"sources":["../src/OpenRouterClient.ts"],"sourcesContent":[null],"mappings":"AA0BA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAE7C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAKC,GAAG,MAAM,8BAA8B;AACnD,OAAO,KAAKC,QAAQ,MAAM,+BAA+B;AACzD,OAAO,KAAKC,UAAU,MAAM,iCAAiC;AAC7D,OAAO,KAAKC,iBAAiB,MAAM,wCAAwC;AAE3E,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,MAAM,MAAM,sBAAsB;AAC9C,SAASC,gBAAgB,QAAQ,uBAAuB;AAmDxD;AACA;AACA;AAEA;;;;;;AAMA,OAAM,MAAOC,gBAAiB,sBAAQd,OAAO,CAACe,OAAO,EAGlD,CAAC,wCAAwC,CAAC;AAqC7C;AACA;AACA;A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b,MAAM,CAACiF,GAAG,CAAC,aAAS;EAClB,MAAMxD,MAAM,GAAGtB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEQ,MAAM,CAAC,GACpD,OAAOR,OAAO,CAACQ,MAAM,GACrByD,SAAS;EACb,MAAM1D,MAAM,GAAGrB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEO,MAAM,CAAC,GACpD,OAAOP,OAAO,CAACO,MAAM,GACrB0D,SAAS;EACb,MAAMvD,YAAY,GAAGxB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEU,YAAY,CAAC,GAChE,OAAOV,OAAO,CAACU,YAAY,GAC3BuD,SAAS;EACb,MAAMrD,SAAS,GAAG1B,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEY,SAAS,CAAC,GAC1D,OAAOZ,OAAO,CAACY,SAAS,GACxBqD,SAAS;EACb,OAAO,OAAOnE,IAAI,CAAC;IACjBU,MAAM;IACND,MAAM;IACNG,YAAY;IACZE,SAAS;IACTE,eAAe,EAAEd,OAAO,EAAEc;GAC3B,CAAC;AACJ,CAAC,CAAC,CACH;AAEH;AACA;AACA;AAEA,MAAMoD,wCAAwC,gBAAG/E,MAAM,CAACgF,cAAc,CAAC1E,SAAS,CAAC2E,0BAA0B,CAACC,MAAM,CAACvB,IAAI,CAAC;AACxH,MAAMwB,oCAAoC,gBAAGnF,MAAM,CAACoF,mBAAmB,CAACL,wCAAwC,CAAC;AAEjH,MAAMrB,2BAA2B,GAC/BC,IAAY,IAEZA,IAAI,KAAK,QAAQ,GACb/D,MAAM,CAACyF,OAAO,CAAC1B,IAAI,CAAC,GACpBwB,oCAAoC,CAACxB,IAAI,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OpenRouterClient.js","names":["Context","Effect","identity","Layer","Predicate","Schema","Stream","Sse","HttpBody","HttpClient","HttpClientRequest","Generated","Errors","OpenRouterConfig","OpenRouterClient","Service","make","fnUntraced","options","baseClient","httpClient","pipe","mapRequest","request","prependUrl","apiUrl","apiKey","bearerToken","siteReferrer","setHeader","siteTitle","acceptJson","transformClient","httpClientOk","filterStatusOk","client","config","getOrUndefined","isNotUndefined","createChatCompletion","payload","sendChatCompletionRequest","includeResponse","catchTags","SendChatCompletionRequest400","error","fail","mapClientError","SendChatCompletionRequest401","SendChatCompletionRequest429","SendChatCompletionRequest500","HttpClientError","mapHttpClientError","SchemaError","mapSchemaError","buildChatCompletionStream","response","stream","decodeText","pipeThroughChannel","decode","mapEffect","event","decodeChatCompletionSseData","data","takeWhile","Retry","die","fromEffect","createChatCompletionStream","execute","post","body","jsonUnsafe","stream_options","include_usage","map","catchTag","of","layer","effect","layerConfig","gen","undefined","ChatStreamingResponseChunkDataFromString","fromJsonString","ChatStreamingResponseChunk","fields","decodeChatStreamingResponseChunkData","decodeUnknownEffect","succeed"],"sources":["../src/OpenRouterClient.ts"],"sourcesContent":[null],"mappings":"AA0BA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAE7C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAKC,GAAG,MAAM,8BAA8B;AACnD,OAAO,KAAKC,QAAQ,MAAM,+BAA+B;AACzD,OAAO,KAAKC,UAAU,MAAM,iCAAiC;AAC7D,OAAO,KAAKC,iBAAiB,MAAM,wCAAwC;AAE3E,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,MAAM,MAAM,sBAAsB;AAC9C,SAASC,gBAAgB,QAAQ,uBAAuB;AAmDxD;AACA;AACA;AAEA;;;;;;;;;;;;;;;AAeA,OAAM,MAAOC,gBAAiB,sBAAQd,OAAO,CAACe,OAAO,EAGlD,CAAC,wCAAwC,CAAC;AAq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AAW,GAAI/D,OAyB3B,IACCf,KAAK,CAAC6E,MAAM,CACVlE,gBAAgB,EAChBb,MAAM,CAACiF,GAAG,CAAC,aAAS;EAClB,MAAMxD,MAAM,GAAGtB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEQ,MAAM,CAAC,GACpD,OAAOR,OAAO,CAACQ,MAAM,GACrByD,SAAS;EACb,MAAM1D,MAAM,GAAGrB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEO,MAAM,CAAC,GACpD,OAAOP,OAAO,CAACO,MAAM,GACrB0D,SAAS;EACb,MAAMvD,YAAY,GAAGxB,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEU,YAAY,CAAC,GAChE,OAAOV,OAAO,CAACU,YAAY,GAC3BuD,SAAS;EACb,MAAMrD,SAAS,GAAG1B,SAAS,CAACkC,cAAc,CAACpB,OAAO,EAAEY,SAAS,CAAC,GAC1D,OAAOZ,OAAO,CAACY,SAAS,GACxBqD,SAAS;EACb,OAAO,OAAOnE,IAAI,CAAC;IACjBU,MAAM;IACND,MAAM;IACNG,YAAY;IACZE,SAAS;IACTE,eAAe,EAAEd,OAAO,EAAEc;GAC3B,CAAC;AACJ,CAAC,CAAC,CACH;AAEH;AACA;AACA;AAEA,MAAMoD,wCAAwC,gBAAG/E,MAAM,CAACgF,cAAc,CAAC1E,SAAS,CAAC2E,0BAA0B,CAACC,MAAM,CAACvB,IAAI,CAAC;AACxH,MAAMwB,oCAAoC,gBAAGnF,MAAM,CAACoF,mBAAmB,CAACL,wCAAwC,CAAC;AAEjH,MAAMrB,2BAA2B,GAC/BC,IAAY,IAEZA,IAAI,KAAK,QAAQ,GACb/D,MAAM,CAACyF,OAAO,CAAC1B,IAAI,CAAC,GACpBwB,oCAAoC,CAACxB,IAAI,CAAC","ignoreList":[]}
@@ -1,21 +1,34 @@
1
1
  /**
2
- * The `OpenRouterConfig` module provides contextual configuration for the
3
- * OpenRouter provider integration. It is used to customize the HTTP client that
4
- * backs OpenRouter requests without rebuilding the provider layer itself.
2
+ * The `OpenRouterConfig` module provides scoped contextual configuration for
3
+ * OpenRouter request execution. It lets a workflow customize the HTTP client
4
+ * used by generated OpenRouter request methods without rebuilding the
5
+ * `OpenRouterClient` layer.
5
6
  *
6
- * Use {@link withClientTransform} when a single effect, workflow, or scoped
7
- * portion of an application needs to add cross-cutting HTTP client behavior
8
- * such as request logging, retries, proxy routing, additional headers, or test
9
- * doubles. The configuration is read from the current Effect context, so the
10
- * transform only applies where the returned effect is run with that context.
7
+ * **Mental model**
8
+ *
9
+ * - {@link OpenRouterConfig} is a context service carrying optional
10
+ * OpenRouter-specific request configuration
11
+ * - {@link withClientTransform} provides that service around one effect
12
+ * - Generated request methods read the current context and apply the transform
13
+ * to their `HttpClient`
14
+ * - The scoped configuration only applies while the returned effect is run
15
+ *
16
+ * **Common tasks**
17
+ *
18
+ * - Add request logging, retries, proxy routing, headers, or test doubles with
19
+ * {@link withClientTransform}
20
+ * - Scope OpenRouter client customization to one workflow without changing the
21
+ * shared client layer
11
22
  *
12
23
  * **Gotchas**
13
24
  *
14
- * - Each call to {@link withClientTransform} replaces the current client
15
- * transform for the provided effect; compose transforms manually when both
16
- * behaviors should apply.
25
+ * - Each {@link withClientTransform} call replaces the current scoped
26
+ * transform for the supplied effect; compose transforms manually when both
27
+ * behaviors should apply
17
28
  * - The transform receives and returns an `HttpClient`, so it should preserve
18
- * the OpenRouter client contract while adding behavior around it.
29
+ * the OpenRouter request contract while adding behavior around it
30
+ * - Streaming chat completion requests are sent directly by `OpenRouterClient`
31
+ * and do not read this scoped transform
19
32
  *
20
33
  * @since 4.0.0
21
34
  */
@@ -27,6 +40,13 @@ declare const OpenRouterConfig_base: Context.ServiceClass<OpenRouterConfig, "@ef
27
40
  * Context service carrying scoped OpenRouter provider configuration for client
28
41
  * operations.
29
42
  *
43
+ * **When to use**
44
+ *
45
+ * Use as the context service tag when manually providing or reading scoped
46
+ * OpenRouter provider configuration in an Effect context.
47
+ *
48
+ * @see {@link withClientTransform} for scoping an HTTP client transformation
49
+ *
30
50
  * @category services
31
51
  * @since 4.0.0
32
52
  */
@@ -59,6 +79,24 @@ export declare namespace OpenRouterConfig {
59
79
  * Provides a scoped transform for the OpenRouter HTTP client used by provider
60
80
  * operations.
61
81
  *
82
+ * **When to use**
83
+ *
84
+ * Use when a single effect or workflow needs temporary OpenRouter HTTP client
85
+ * customization without rebuilding the client layer.
86
+ *
87
+ * **Details**
88
+ *
89
+ * Supports both data-first and data-last forms. The transform is stored in the
90
+ * scoped `OpenRouterConfig` service and read by generated OpenRouter request
91
+ * operations while running the supplied effect.
92
+ *
93
+ * **Gotchas**
94
+ *
95
+ * If a transform is already present in the scoped config, this helper replaces
96
+ * it. Compose transforms manually when both should apply. Streaming chat
97
+ * completion requests are sent directly by `OpenRouterClient.make` and do not
98
+ * read this scoped transform.
99
+ *
62
100
  * @category configuration
63
101
  * @since 4.0.0
64
102
  */
@@ -67,6 +105,24 @@ export declare const withClientTransform: {
67
105
  * Provides a scoped transform for the OpenRouter HTTP client used by provider
68
106
  * operations.
69
107
  *
108
+ * **When to use**
109
+ *
110
+ * Use when a single effect or workflow needs temporary OpenRouter HTTP client
111
+ * customization without rebuilding the client layer.
112
+ *
113
+ * **Details**
114
+ *
115
+ * Supports both data-first and data-last forms. The transform is stored in the
116
+ * scoped `OpenRouterConfig` service and read by generated OpenRouter request
117
+ * operations while running the supplied effect.
118
+ *
119
+ * **Gotchas**
120
+ *
121
+ * If a transform is already present in the scoped config, this helper replaces
122
+ * it. Compose transforms manually when both should apply. Streaming chat
123
+ * completion requests are sent directly by `OpenRouterClient.make` and do not
124
+ * read this scoped transform.
125
+ *
70
126
  * @category configuration
71
127
  * @since 4.0.0
72
128
  */
@@ -75,6 +131,24 @@ export declare const withClientTransform: {
75
131
  * Provides a scoped transform for the OpenRouter HTTP client used by provider
76
132
  * operations.
77
133
  *
134
+ * **When to use**
135
+ *
136
+ * Use when a single effect or workflow needs temporary OpenRouter HTTP client
137
+ * customization without rebuilding the client layer.
138
+ *
139
+ * **Details**
140
+ *
141
+ * Supports both data-first and data-last forms. The transform is stored in the
142
+ * scoped `OpenRouterConfig` service and read by generated OpenRouter request
143
+ * operations while running the supplied effect.
144
+ *
145
+ * **Gotchas**
146
+ *
147
+ * If a transform is already present in the scoped config, this helper replaces
148
+ * it. Compose transforms manually when both should apply. Streaming chat
149
+ * completion requests are sent directly by `OpenRouterClient.make` and do not
150
+ * read this scoped transform.
151
+ *
78
152
  * @category configuration
79
153
  * @since 4.0.0
80
154
  */
@@ -1 +1 @@
1
- {"version":3,"file":"OpenRouterConfig.d.ts","sourceRoot":"","sources":["../src/OpenRouterConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;;AAEjE;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,qBAGO;IAC3C;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,CAGzF;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC;;;;;;OAMG;IACH,UAAiB,OAAO;QACtB,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,GAAG,SAAS,CAAA;KAC5E;CACF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE;IAChC;;;;;;OAMG;IACH,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,E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,KAAK,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAClH;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACN,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,GAC5C,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CAgE1B,CAAA"}
@@ -1,21 +1,34 @@
1
1
  /**
2
- * The `OpenRouterConfig` module provides contextual configuration for the
3
- * OpenRouter provider integration. It is used to customize the HTTP client that
4
- * backs OpenRouter requests without rebuilding the provider layer itself.
2
+ * The `OpenRouterConfig` module provides scoped contextual configuration for
3
+ * OpenRouter request execution. It lets a workflow customize the HTTP client
4
+ * used by generated OpenRouter request methods without rebuilding the
5
+ * `OpenRouterClient` layer.
5
6
  *
6
- * Use {@link withClientTransform} when a single effect, workflow, or scoped
7
- * portion of an application needs to add cross-cutting HTTP client behavior
8
- * such as request logging, retries, proxy routing, additional headers, or test
9
- * doubles. The configuration is read from the current Effect context, so the
10
- * transform only applies where the returned effect is run with that context.
7
+ * **Mental model**
8
+ *
9
+ * - {@link OpenRouterConfig} is a context service carrying optional
10
+ * OpenRouter-specific request configuration
11
+ * - {@link withClientTransform} provides that service around one effect
12
+ * - Generated request methods read the current context and apply the transform
13
+ * to their `HttpClient`
14
+ * - The scoped configuration only applies while the returned effect is run
15
+ *
16
+ * **Common tasks**
17
+ *
18
+ * - Add request logging, retries, proxy routing, headers, or test doubles with
19
+ * {@link withClientTransform}
20
+ * - Scope OpenRouter client customization to one workflow without changing the
21
+ * shared client layer
11
22
  *
12
23
  * **Gotchas**
13
24
  *
14
- * - Each call to {@link withClientTransform} replaces the current client
15
- * transform for the provided effect; compose transforms manually when both
16
- * behaviors should apply.
25
+ * - Each {@link withClientTransform} call replaces the current scoped
26
+ * transform for the supplied effect; compose transforms manually when both
27
+ * behaviors should apply
17
28
  * - The transform receives and returns an `HttpClient`, so it should preserve
18
- * the OpenRouter client contract while adding behavior around it.
29
+ * the OpenRouter request contract while adding behavior around it
30
+ * - Streaming chat completion requests are sent directly by `OpenRouterClient`
31
+ * and do not read this scoped transform
19
32
  *
20
33
  * @since 4.0.0
21
34
  */
@@ -26,6 +39,13 @@ import { dual } from "effect/Function";
26
39
  * Context service carrying scoped OpenRouter provider configuration for client
27
40
  * operations.
28
41
  *
42
+ * **When to use**
43
+ *
44
+ * Use as the context service tag when manually providing or reading scoped
45
+ * OpenRouter provider configuration in an Effect context.
46
+ *
47
+ * @see {@link withClientTransform} for scoping an HTTP client transformation
48
+ *
29
49
  * @category services
30
50
  * @since 4.0.0
31
51
  */
@@ -41,6 +61,24 @@ export class OpenRouterConfig extends /*#__PURE__*/Context.Service()("@effect/ai
41
61
  * Provides a scoped transform for the OpenRouter HTTP client used by provider
42
62
  * operations.
43
63
  *
64
+ * **When to use**
65
+ *
66
+ * Use when a single effect or workflow needs temporary OpenRouter HTTP client
67
+ * customization without rebuilding the client layer.
68
+ *
69
+ * **Details**
70
+ *
71
+ * Supports both data-first and data-last forms. The transform is stored in the
72
+ * scoped `OpenRouterConfig` service and read by generated OpenRouter request
73
+ * operations while running the supplied effect.
74
+ *
75
+ * **Gotchas**
76
+ *
77
+ * If a transform is already present in the scoped config, this helper replaces
78
+ * it. Compose transforms manually when both should apply. Streaming chat
79
+ * completion requests are sent directly by `OpenRouterClient.make` and do not
80
+ * read this scoped transform.
81
+ *
44
82
  * @category configuration
45
83
  * @since 4.0.0
46
84
  */
@@ -1 +1 @@
1
- {"version":3,"file":"OpenRouterConfig.js","names":["Context","Effect","dual","OpenRouterConfig","Service","getOrUndefined","map","context","services","mapUnsafe","get","key","withClientTransform","self","transformClient","flatMap","config","provideService"],"sources":["../src/OpenRouterConfig.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,IAAI,QAAQ,iBAAiB;AAGtC;;;;;;;AAOA,OAAM,MAAOC,gBAAiB,sBAAQH,OAAO,CAACI,OAAO,EAGlD,CAAC,wCAAwC,CAAC;EAC3C;;;;;EAKA,OAAgBC,cAAc,gBAA+DJ,MAAM,CAACK,GAAG,cACrGL,MAAM,CAACM,OAAO,EAAS,EACtBC,QAAQ,IAAKA,QAAQ,CAACC,SAAS,CAACC,GAAG,CAACP,gBAAgB,CAACQ,GAAG,CAAC,CAC3D;;AAqBH;;;;;;;AAOA,OAAO,MAAMC,mBAAmB,gBAoB5BV,IAAI,CAqBN,CAAC,EACD,CAACW,IAAI,EAAEC,eAAe,KACpBb,MAAM,CAACc,OAAO,CACZZ,gBAAgB,CAACE,cAAc,EAC9BW,MAAM,IAAKf,MAAM,CAACgB,cAAc,CAACJ,IAAI,EAAEV,gBAAgB,EAAE;EAAE,GAAGa,MAAM;EAAEF;AAAe,CAAE,CAAC,CAC1F,CACJ","ignoreList":[]}
1
+ {"version":3,"file":"OpenRouterConfig.js","names":["Context","Effect","dual","OpenRouterConfig","Service","getOrUndefined","map","context","services","mapUnsafe","get","key","withClientTransform","self","transformClient","flatMap","config","provideService"],"sources":["../src/OpenRouterConfig.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,IAAI,QAAQ,iBAAiB;AAGtC;;;;;;;;;;;;;;AAcA,OAAM,MAAOC,gBAAiB,sBAAQH,OAAO,CAACI,OAAO,EAGlD,CAAC,wCAAwC,CAAC;EAC3C;;;;;EAKA,OAAgBC,cAAc,gBAA+DJ,MAAM,CAACK,GAAG,cACrGL,MAAM,CAACM,OAAO,EAAS,EACtBC,QAAQ,IAAKA,QAAQ,CAACC,SAAS,CAACC,GAAG,CAACP,gBAAgB,CAACQ,GAAG,CAAC,CAC3D;;AAqBH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMC,mBAAmB,gBAwD5BV,IAAI,CAyDN,CAAC,EACD,CAACW,IAAI,EAAEC,eAAe,KACpBb,MAAM,CAACc,OAAO,CACZZ,gBAAgB,CAACE,cAAc,EAC9BW,MAAM,IAAKf,MAAM,CAACgB,cAAc,CAACJ,IAAI,EAAEV,gBAAgB,EAAE;EAAE,GAAGa,MAAM;EAAEF;AAAe,CAAE,CAAC,CAC1F,CACJ","ignoreList":[]}
@@ -101,6 +101,13 @@ declare const Config_base: Context.ServiceClass<Config, "@effect/ai-openrouter/O
101
101
  /**
102
102
  * Service definition for OpenRouter language model configuration.
103
103
  *
104
+ * **When to use**
105
+ *
106
+ * Use to provide scoped OpenRouter chat completion defaults or per-operation
107
+ * overrides for an OpenRouter language model service.
108
+ *
109
+ * @see {@link withConfigOverride} for scoping language model request overrides
110
+ *
104
111
  * @category services
105
112
  * @since 4.0.0
106
113
  */
@@ -222,7 +229,7 @@ declare module "effect/unstable/ai/Prompt" {
222
229
  *
223
230
  * **When to use**
224
231
  *
225
- * Use these options to control how text content is sent to OpenRouter.
232
+ * Use when you use these options to control how text content is sent to OpenRouter.
226
233
  *
227
234
  * @category request
228
235
  * @since 4.0.0
@@ -486,14 +493,51 @@ declare module "effect/unstable/ai/Response" {
486
493
  }
487
494
  }
488
495
  /**
489
- * Creates an AI model descriptor for an OpenRouter language model.
496
+ * Creates an OpenRouter model descriptor that can be provided with
497
+ * `Effect.provide`.
498
+ *
499
+ * **When to use**
500
+ *
501
+ * Use when you want an OpenRouter language model value that carries provider
502
+ * and model metadata and can be supplied directly to an Effect program.
503
+ *
504
+ * **Details**
505
+ *
506
+ * The returned model requires `OpenRouterClient` and provides
507
+ * `LanguageModel.LanguageModel`.
508
+ *
509
+ * @see {@link layer} for creating a `LanguageModel.LanguageModel` layer directly
510
+ * @see {@link make} for constructing the language model service effectfully
511
+ * @see {@link withConfigOverride} for scoping OpenRouter request overrides
490
512
  *
491
513
  * @category constructors
492
514
  * @since 4.0.0
493
515
  */
494
516
  export declare const model: (model: string, config?: Omit<typeof Config.Service, "model">) => AiModel.Model<"openai", LanguageModel.LanguageModel, OpenRouterClient>;
495
517
  /**
496
- * Creates an OpenRouter language model service.
518
+ * Creates an OpenRouter `LanguageModel` service from a model identifier and
519
+ * optional request defaults.
520
+ *
521
+ * **When to use**
522
+ *
523
+ * Use when an Effect needs to construct a `LanguageModel.Service` value backed
524
+ * by `OpenRouterClient`.
525
+ *
526
+ * **Details**
527
+ *
528
+ * The returned effect requires `OpenRouterClient`. Request defaults from the
529
+ * `config` option are merged with any `Config` service in the context, with
530
+ * context values taking precedence. The service supports both `generateText`
531
+ * and `streamText`.
532
+ *
533
+ * **Gotchas**
534
+ *
535
+ * Provider-defined tools are not supported by this provider integration;
536
+ * requests that include them fail with an `InvalidUserInputError`.
537
+ *
538
+ * @see {@link layer} for providing the service as a `Layer`
539
+ * @see {@link model} for creating a model descriptor for `Effect.provide`
540
+ * @see {@link withConfigOverride} for scoping request defaults around operations
497
541
  *
498
542
  * @category constructors
499
543
  * @since 4.0.0
@@ -505,6 +549,15 @@ export declare const make: (args_0: {
505
549
  /**
506
550
  * Creates a layer for the OpenRouter language model.
507
551
  *
552
+ * **When to use**
553
+ *
554
+ * Use when composing application layers and you want OpenRouter to satisfy
555
+ * `LanguageModel.LanguageModel` while supplying `OpenRouterClient` from another
556
+ * layer.
557
+ *
558
+ * @see {@link make} for constructing the language model service effectfully
559
+ * @see {@link model} for creating a model descriptor for `Effect.provide`
560
+ *
508
561
  * @category layers
509
562
  * @since 4.0.0
510
563
  */
@@ -515,6 +568,20 @@ export declare const layer: (options: {
515
568
  /**
516
569
  * Provides config overrides for OpenRouter language model operations.
517
570
  *
571
+ * **When to use**
572
+ *
573
+ * Use to apply OpenRouter request configuration to one effect without changing
574
+ * the model's default configuration.
575
+ *
576
+ * **Details**
577
+ *
578
+ * The overrides are merged with any existing `Config` service for the duration
579
+ * of the supplied effect. Fields in `overrides` take precedence over existing
580
+ * config, and the helper supports both pipe form and
581
+ * `withConfigOverride(effect, overrides)`.
582
+ *
583
+ * @see {@link Config} for available OpenRouter request configuration fields
584
+ *
518
585
  * @category configuration
519
586
  * @since 4.0.0
520
587
  */
@@ -522,6 +589,20 @@ export declare const withConfigOverride: {
522
589
  /**
523
590
  * Provides config overrides for OpenRouter language model operations.
524
591
  *
592
+ * **When to use**
593
+ *
594
+ * Use to apply OpenRouter request configuration to one effect without changing
595
+ * the model's default configuration.
596
+ *
597
+ * **Details**
598
+ *
599
+ * The overrides are merged with any existing `Config` service for the duration
600
+ * of the supplied effect. Fields in `overrides` take precedence over existing
601
+ * config, and the helper supports both pipe form and
602
+ * `withConfigOverride(effect, overrides)`.
603
+ *
604
+ * @see {@link Config} for available OpenRouter request configuration fields
605
+ *
525
606
  * @category configuration
526
607
  * @since 4.0.0
527
608
  */
@@ -529,6 +610,20 @@ export declare const withConfigOverride: {
529
610
  /**
530
611
  * Provides config overrides for OpenRouter language model operations.
531
612
  *
613
+ * **When to use**
614
+ *
615
+ * Use to apply OpenRouter request configuration to one effect without changing
616
+ * the model's default configuration.
617
+ *
618
+ * **Details**
619
+ *
620
+ * The overrides are merged with any existing `Config` service for the duration
621
+ * of the supplied effect. Fields in `overrides` take precedence over existing
622
+ * config, and the helper supports both pipe form and
623
+ * `withConfigOverride(effect, overrides)`.
624
+ *
625
+ * @see {@link Config} for available OpenRouter request configuration fields
626
+ *
532
627
  * @category configuration
533
628
  * @since 4.0.0
534
629
  */
@@ -1 +1 @@
1
- {"version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