@opencode/schema 0.0.0-dev-21269 → 0.0.0-dev-21289
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/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 +36 -274
- package/dist/event-manifest.js +1 -2
- package/dist/session-event.d.ts +114 -612
- package/dist/session-event.js +9 -12
- package/dist/session-legacy.d.ts +7 -0
- package/dist/session-legacy.js +118 -0
- package/dist/session-message.d.ts +31 -174
- package/dist/session-message.js +13 -12
- package/dist/session-transfer.d.ts +5 -55
- package/package.json +1 -1
- 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
|
@@ -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"),
|