@opencode/schema 2.0.32 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/experimental.d.ts +1 -0
- package/dist/config/experimental.js +3 -0
- package/dist/config/provider.d.ts +56 -52
- package/dist/credential-legacy.d.ts +54 -0
- package/dist/credential-legacy.js +19 -0
- package/dist/credential.d.ts +0 -4
- package/dist/credential.js +0 -2
- package/dist/event-manifest.d.ts +1111 -1149
- package/dist/event-manifest.js +1 -2
- package/dist/form.d.ts +213 -213
- package/dist/instruction-entry.d.ts +1 -1
- package/dist/integration.d.ts +257 -257
- package/dist/model-compatibility.d.ts +3 -0
- package/dist/model-compatibility.js +2 -0
- package/dist/model.d.ts +76 -74
- package/dist/persistent-pty.d.ts +88 -88
- package/dist/prompt-input.d.ts +3 -3
- package/dist/prompt.d.ts +28 -28
- package/dist/provider.d.ts +2 -0
- package/dist/session-event.d.ts +5729 -5723
- package/dist/session-event.js +20 -13
- package/dist/session-inbox.d.ts +20 -20
- package/dist/session-legacy.d.ts +7 -0
- package/dist/session-legacy.js +118 -0
- package/dist/session-message.d.ts +125 -268
- package/dist/session-message.js +13 -12
- package/dist/session-revert.d.ts +407 -183
- package/dist/session-transfer.d.ts +33 -83
- package/dist/session.d.ts +109 -1
- package/dist/session.js +64 -2
- package/dist/v1/permission.d.ts +8 -8
- package/dist/v1/session.d.ts +696 -696
- package/package.json +4 -4
- package/dist/session-compaction-event.d.ts +0 -87
- package/dist/session-compaction-event.js +0 -10
- package/dist/session-provider-context.d.ts +0 -54
- package/dist/session-provider-context.js +0 -17
|
@@ -2,6 +2,7 @@ export * as ConfigExperimental from "./experimental.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
4
4
|
readonly portable_shell_scanner: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
5
|
+
readonly todo: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
5
6
|
readonly subagent_depth: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
6
7
|
readonly policies: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
7
8
|
readonly action: Schema.Literals<readonly ["provider.use", "tool.use", "integration.use"]>;
|
|
@@ -6,6 +6,9 @@ export class Info extends Schema.Class("ConfigExperimental.Info")({
|
|
|
6
6
|
portable_shell_scanner: Schema.Boolean.pipe(optional).annotate({
|
|
7
7
|
description: "Enable the experimental portable shell permission scanner. Defaults to false.",
|
|
8
8
|
}),
|
|
9
|
+
todo: Schema.Boolean.pipe(optional).annotate({
|
|
10
|
+
description: "Enable the experimental todowrite tool. Defaults to false.",
|
|
11
|
+
}),
|
|
9
12
|
subagent_depth: NonNegativeInt.pipe(optional).annotate({
|
|
10
13
|
description: "Maximum subagent nesting depth. Defaults to 1.",
|
|
11
14
|
}),
|
|
@@ -126,6 +126,59 @@ export declare const Reasoning: Schema.Union<readonly [Schema.Struct<{
|
|
|
126
126
|
}>]>;
|
|
127
127
|
export type Reasoning = typeof Reasoning.Type;
|
|
128
128
|
declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
129
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
130
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
131
|
+
readonly type: Schema.Literal<"summary">;
|
|
132
|
+
}>, Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"native">;
|
|
134
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly type: Schema.Literal<"summary">;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly type: Schema.Literal<"native">;
|
|
138
|
+
}>]>>, never, never>;
|
|
139
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
140
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
141
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
142
|
+
readonly type: Schema.Literal<"summary">;
|
|
143
|
+
}>, Schema.Struct<{
|
|
144
|
+
readonly type: Schema.Literal<"native">;
|
|
145
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
146
|
+
readonly type: Schema.Literal<"summary">;
|
|
147
|
+
}>, Schema.Struct<{
|
|
148
|
+
readonly type: Schema.Literal<"native">;
|
|
149
|
+
}>]>>, never, never>;
|
|
150
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
151
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
152
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
153
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<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>;
|
|
154
|
+
readonly modelID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.ID">>, never, never>;
|
|
155
|
+
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
156
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
157
|
+
readonly releaseDate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
158
|
+
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
159
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
160
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
161
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
162
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
163
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
164
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
165
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
166
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
167
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
168
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
169
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
170
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
171
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
172
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
173
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
174
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
175
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
176
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
177
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
178
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
179
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
180
|
+
}>>, never, never>;
|
|
181
|
+
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
129
182
|
readonly capabilities: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
130
183
|
readonly tools: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
131
184
|
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
@@ -249,62 +302,10 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
249
302
|
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [typeof Cost, Schema.$Array<typeof Cost>]>>>, Schema.optionalKey<Schema.Union<readonly [typeof Cost, Schema.$Array<typeof Cost>]>>, never, never>;
|
|
250
303
|
readonly disabled: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
251
304
|
readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<typeof Limit>>, Schema.optionalKey<typeof Limit>, never, never>;
|
|
252
|
-
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
253
|
-
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
254
|
-
readonly type: Schema.Literal<"summary">;
|
|
255
|
-
}>, Schema.Struct<{
|
|
256
|
-
readonly type: Schema.Literal<"native">;
|
|
257
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
258
|
-
readonly type: Schema.Literal<"summary">;
|
|
259
|
-
}>, Schema.Struct<{
|
|
260
|
-
readonly type: Schema.Literal<"native">;
|
|
261
|
-
}>]>>, never, never>;
|
|
262
|
-
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
263
|
-
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
264
|
-
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
265
|
-
readonly type: Schema.Literal<"summary">;
|
|
266
|
-
}>, Schema.Struct<{
|
|
267
|
-
readonly type: Schema.Literal<"native">;
|
|
268
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
269
|
-
readonly type: Schema.Literal<"summary">;
|
|
270
|
-
}>, Schema.Struct<{
|
|
271
|
-
readonly type: Schema.Literal<"native">;
|
|
272
|
-
}>]>>, never, never>;
|
|
273
|
-
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
274
|
-
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
275
|
-
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
276
|
-
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<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>;
|
|
277
|
-
readonly modelID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.ID">>, never, never>;
|
|
278
|
-
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
279
|
-
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
280
|
-
readonly releaseDate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
281
|
-
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
282
|
-
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
283
|
-
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
284
|
-
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
285
|
-
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
286
|
-
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
287
|
-
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
288
|
-
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
289
|
-
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
290
|
-
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
291
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
292
|
-
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
293
|
-
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
294
|
-
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
295
|
-
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
296
|
-
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
297
|
-
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
298
|
-
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
299
|
-
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
300
|
-
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
301
|
-
}>>, never, never>;
|
|
302
|
-
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
303
305
|
}>, {}>;
|
|
304
306
|
declare class Model extends Model_base {
|
|
305
307
|
}
|
|
306
308
|
declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
307
|
-
readonly models: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, typeof Model>>>, Schema.optionalKey<Schema.$Record<Schema.String, typeof Model>>, never, never>;
|
|
308
309
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
309
310
|
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
310
311
|
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
@@ -373,6 +374,7 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
373
374
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
374
375
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
375
376
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
377
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
376
378
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
377
379
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
378
380
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
@@ -381,8 +383,10 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
381
383
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
382
384
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
383
385
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
386
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
384
387
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
385
388
|
}>>, never, never>;
|
|
389
|
+
readonly models: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, typeof Model>>>, Schema.optionalKey<Schema.$Record<Schema.String, typeof Model>>, never, never>;
|
|
386
390
|
}>, {}>;
|
|
387
391
|
export declare class Info extends Info_base {
|
|
388
392
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export * as CredentialLegacy from "./credential-legacy.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** Decodes a stored or exported credential value of either shape into the current `Credential.Value`. */
|
|
4
|
+
export declare const Value: Schema.Union<readonly [Schema.Struct<{
|
|
5
|
+
readonly type: Schema.Literal<"oauth">;
|
|
6
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
7
|
+
readonly refresh: Schema.String;
|
|
8
|
+
readonly access: Schema.String;
|
|
9
|
+
readonly expires: Schema.Int;
|
|
10
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
11
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
12
|
+
readonly type: Schema.Literal<"key">;
|
|
13
|
+
readonly key: Schema.String;
|
|
14
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
15
|
+
}>, Schema.Struct<{
|
|
16
|
+
readonly type: Schema.Literal<"key">;
|
|
17
|
+
readonly key: Schema.String;
|
|
18
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
19
|
+
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
20
|
+
}>, never, never>, Schema.Struct<{
|
|
21
|
+
readonly type: Schema.Literal<"external">;
|
|
22
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
23
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
24
|
+
}>]>;
|
|
25
|
+
/** Decodes an `auth export` entry of either shape into the current `Credential.Entry`. */
|
|
26
|
+
export declare const Entry: Schema.Struct<{
|
|
27
|
+
readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
|
|
28
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
29
|
+
};
|
|
30
|
+
readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
31
|
+
readonly label: Schema.String;
|
|
32
|
+
readonly active: Schema.Boolean;
|
|
33
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
34
|
+
readonly type: Schema.Literal<"oauth">;
|
|
35
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
36
|
+
readonly refresh: Schema.String;
|
|
37
|
+
readonly access: Schema.String;
|
|
38
|
+
readonly expires: Schema.Int;
|
|
39
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
40
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
41
|
+
readonly type: Schema.Literal<"key">;
|
|
42
|
+
readonly key: Schema.String;
|
|
43
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
44
|
+
}>, Schema.Struct<{
|
|
45
|
+
readonly type: Schema.Literal<"key">;
|
|
46
|
+
readonly key: Schema.String;
|
|
47
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
48
|
+
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
49
|
+
}>, never, never>, Schema.Struct<{
|
|
50
|
+
readonly type: Schema.Literal<"external">;
|
|
51
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
52
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
53
|
+
}>]>;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * as CredentialLegacy from "./credential-legacy.js";
|
|
2
|
+
import { Schema, SchemaTransformation } from "effect";
|
|
3
|
+
import { Credential } from "./credential.js";
|
|
4
|
+
import { Form } from "./form.js";
|
|
5
|
+
import { optional } from "./schema.js";
|
|
6
|
+
/**
|
|
7
|
+
* Storage and import compatibility for credentials written before v2.1 (not V1 contracts). Key credentials then kept
|
|
8
|
+
* their setup-form answers in `configuration`; they now live in `metadata`. Only decoders for stored rows and
|
|
9
|
+
* `auth export` files use these schemas, so the public credential contract never sees the old field.
|
|
10
|
+
*/
|
|
11
|
+
const Key = Schema.Struct({ ...Credential.Key.fields, configuration: optional(Form.Answer) }).pipe(Schema.decodeTo(Credential.Key, SchemaTransformation.transform({
|
|
12
|
+
// Form answers overrode metadata when both reached provider settings, so they keep precedence.
|
|
13
|
+
decode: ({ configuration, ...key }) => configuration === undefined ? key : { ...key, metadata: { ...key.metadata, ...configuration } },
|
|
14
|
+
encode: (key) => key,
|
|
15
|
+
})));
|
|
16
|
+
/** Decodes a stored or exported credential value of either shape into the current `Credential.Value`. */
|
|
17
|
+
export const Value = Schema.Union([Credential.OAuth, Key, Credential.External]);
|
|
18
|
+
/** Decodes an `auth export` entry of either shape into the current `Credential.Entry`. */
|
|
19
|
+
export const Entry = Schema.Struct({ ...Credential.Entry.fields, value: Value });
|
package/dist/credential.d.ts
CHANGED
|
@@ -173,7 +173,6 @@ export declare const Key: Schema.Struct<{
|
|
|
173
173
|
readonly type: Schema.Literal<"key">;
|
|
174
174
|
readonly key: Schema.String;
|
|
175
175
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
176
|
-
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
177
176
|
}>;
|
|
178
177
|
/** References a credential source whose secrets and renewal are managed outside the credential store. */
|
|
179
178
|
export interface External extends Schema.Schema.Type<typeof External> {
|
|
@@ -194,7 +193,6 @@ export declare const Value: Schema.Union<readonly [Schema.Struct<{
|
|
|
194
193
|
readonly type: Schema.Literal<"key">;
|
|
195
194
|
readonly key: Schema.String;
|
|
196
195
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
197
|
-
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
198
196
|
}>, Schema.Struct<{
|
|
199
197
|
readonly type: Schema.Literal<"external">;
|
|
200
198
|
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
@@ -221,7 +219,6 @@ export declare const Entry: Schema.Struct<{
|
|
|
221
219
|
readonly type: Schema.Literal<"key">;
|
|
222
220
|
readonly key: Schema.String;
|
|
223
221
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
224
|
-
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
225
222
|
}>, Schema.Struct<{
|
|
226
223
|
readonly type: Schema.Literal<"external">;
|
|
227
224
|
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
@@ -249,7 +246,6 @@ export declare const CreateInput: Schema.Struct<{
|
|
|
249
246
|
readonly type: Schema.Literal<"key">;
|
|
250
247
|
readonly key: Schema.String;
|
|
251
248
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
252
|
-
readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
|
|
253
249
|
}>, Schema.Struct<{
|
|
254
250
|
readonly type: Schema.Literal<"external">;
|
|
255
251
|
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
package/dist/credential.js
CHANGED
|
@@ -5,7 +5,6 @@ import { ephemeral, inventory } from "./event.js";
|
|
|
5
5
|
import { IntegrationID, IntegrationMethodID } from "./integration-id.js";
|
|
6
6
|
import { ascending } from "./identifier.js";
|
|
7
7
|
import { NonNegativeInt, statics } from "./schema.js";
|
|
8
|
-
import { Form } from "./form.js";
|
|
9
8
|
export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), Schema.annotate({ identifier: "Credential.ID" }), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
|
|
10
9
|
const Updated = ephemeral({
|
|
11
10
|
type: "credential.updated",
|
|
@@ -32,7 +31,6 @@ export const Key = Schema.Struct({
|
|
|
32
31
|
type: Schema.Literal("key"),
|
|
33
32
|
key: Schema.String,
|
|
34
33
|
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
35
|
-
configuration: optional(Form.Answer),
|
|
36
34
|
}).annotate({ identifier: "Credential.Key" });
|
|
37
35
|
export const External = Schema.Struct({
|
|
38
36
|
type: Schema.Literal("external"),
|