@opencode/schema 0.0.0-dev-20283 → 0.0.0-dev-20285

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.
@@ -1,5 +1,16 @@
1
1
  export * as Connection from "./connection.js";
2
2
  import { Schema } from "effect";
3
+ /**
4
+ * Runtime problem an integration reported for a connection. `needs_auth` asks the user to sign in again:
5
+ * at `url` when set (the credential itself stays valid), otherwise by reconnecting the integration.
6
+ */
7
+ export interface Status extends Schema.Schema.Type<typeof Status> {
8
+ }
9
+ export declare const Status: Schema.Struct<{
10
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
11
+ readonly message: Schema.String;
12
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
13
+ }>;
3
14
  export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {
4
15
  }
5
16
  export declare const CredentialInfo: Schema.Struct<{
@@ -10,12 +21,30 @@ export declare const CredentialInfo: Schema.Struct<{
10
21
  readonly label: Schema.String;
11
22
  /** How the credential was obtained: a stored key or an OAuth grant. */
12
23
  readonly method: Schema.Literals<readonly ["key", "oauth"]>;
24
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
25
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
26
+ readonly message: Schema.String;
27
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
28
+ }>>>, Schema.optionalKey<Schema.Struct<{
29
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
30
+ readonly message: Schema.String;
31
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
32
+ }>>, never, never>;
13
33
  }>;
14
34
  export interface EnvInfo extends Schema.Schema.Type<typeof EnvInfo> {
15
35
  }
16
36
  export declare const EnvInfo: Schema.Struct<{
17
37
  readonly type: Schema.Literal<"env">;
18
38
  readonly name: Schema.String;
39
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
40
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
41
+ readonly message: Schema.String;
42
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
43
+ }>>>, Schema.optionalKey<Schema.Struct<{
44
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
45
+ readonly message: Schema.String;
46
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
47
+ }>>, never, never>;
19
48
  }>;
20
49
  export declare const Info: Schema.Union<readonly [Schema.Struct<{
21
50
  readonly type: Schema.Literal<"credential">;
@@ -25,8 +54,26 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
25
54
  readonly label: Schema.String;
26
55
  /** How the credential was obtained: a stored key or an OAuth grant. */
27
56
  readonly method: Schema.Literals<readonly ["key", "oauth"]>;
57
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
58
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
59
+ readonly message: Schema.String;
60
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
61
+ }>>>, Schema.optionalKey<Schema.Struct<{
62
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
63
+ readonly message: Schema.String;
64
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
65
+ }>>, never, never>;
28
66
  }>, Schema.Struct<{
29
67
  readonly type: Schema.Literal<"env">;
30
68
  readonly name: Schema.String;
69
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
70
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
71
+ readonly message: Schema.String;
72
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
73
+ }>>>, Schema.optionalKey<Schema.Struct<{
74
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
75
+ readonly message: Schema.String;
76
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
77
+ }>>, never, never>;
31
78
  }>]>;
32
79
  export type Info = typeof Info.Type;
@@ -1,16 +1,24 @@
1
1
  export * as Connection from "./connection.js";
2
2
  import { Schema } from "effect";
3
3
  import { Credential } from "./credential.js";
4
+ import { optional } from "./schema.js";
5
+ export const Status = Schema.Struct({
6
+ status: Schema.Literals(["needs_auth"]),
7
+ message: Schema.String,
8
+ url: optional(Schema.String),
9
+ }).annotate({ identifier: "Connection.Status" });
4
10
  export const CredentialInfo = Schema.Struct({
5
11
  type: Schema.Literal("credential"),
6
12
  id: Credential.ID,
7
13
  label: Schema.String,
8
14
  /** How the credential was obtained: a stored key or an OAuth grant. */
9
15
  method: Schema.Literals(["key", "oauth"]),
16
+ status: optional(Status),
10
17
  }).annotate({ identifier: "Connection.CredentialInfo" });
11
18
  export const EnvInfo = Schema.Struct({
12
19
  type: Schema.Literal("env"),
13
20
  name: Schema.String,
21
+ status: optional(Status),
14
22
  }).annotate({ identifier: "Connection.EnvInfo" });
15
23
  export const Info = Schema.Union([CredentialInfo, EnvInfo])
16
24
  .pipe(Schema.toTaggedUnion("type"))
@@ -1572,9 +1572,27 @@ export declare const Info: Schema.Struct<{
1572
1572
  };
1573
1573
  readonly label: Schema.String;
1574
1574
  readonly method: Schema.Literals<readonly ["key", "oauth"]>;
1575
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1576
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
1577
+ readonly message: Schema.String;
1578
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1579
+ }>>>, Schema.optionalKey<Schema.Struct<{
1580
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
1581
+ readonly message: Schema.String;
1582
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1583
+ }>>, never, never>;
1575
1584
  }>, Schema.Struct<{
1576
1585
  readonly type: Schema.Literal<"env">;
1577
1586
  readonly name: Schema.String;
1587
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1588
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
1589
+ readonly message: Schema.String;
1590
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1591
+ }>>>, Schema.optionalKey<Schema.Struct<{
1592
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
1593
+ readonly message: Schema.String;
1594
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1595
+ }>>, never, never>;
1578
1596
  }>]>>;
1579
1597
  }>;
1580
1598
  export interface Info extends Schema.Schema.Type<typeof Info> {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "0.0.0-dev-20283",
4
+ "version": "0.0.0-dev-20285",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {