@opencode-ai/schema
Advanced tools
@@ -158,2 +158,10 @@ export * as Integration from "./integration.js"; | ||
| }>; | ||
| export interface CommandMethod extends Schema.Schema.Type<typeof CommandMethod> { | ||
| } | ||
| export declare const CommandMethod: Schema.Struct<{ | ||
| readonly id: Schema.brand<Schema.String, "Integration.MethodID">; | ||
| readonly type: Schema.Literal<"command">; | ||
| readonly label: Schema.String; | ||
| readonly command: Schema.$Array<Schema.String>; | ||
| }>; | ||
| export interface KeyMethod extends Schema.Schema.Type<typeof KeyMethod> { | ||
@@ -241,2 +249,7 @@ } | ||
| }>, Schema.Struct<{ | ||
| readonly id: Schema.brand<Schema.String, "Integration.MethodID">; | ||
| readonly type: Schema.Literal<"command">; | ||
| readonly label: Schema.String; | ||
| readonly command: Schema.$Array<Schema.String>; | ||
| }>, Schema.Struct<{ | ||
| readonly type: Schema.Literal<"key">; | ||
@@ -471,2 +484,7 @@ readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| }>, Schema.Struct<{ | ||
| readonly id: Schema.brand<Schema.String, "Integration.MethodID">; | ||
| readonly type: Schema.Literal<"command">; | ||
| readonly label: Schema.String; | ||
| readonly command: Schema.$Array<Schema.String>; | ||
| }>, Schema.Struct<{ | ||
| readonly type: Schema.Literal<"key">; | ||
@@ -536,1 +554,40 @@ readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| export type AttemptStatus = typeof AttemptStatus.Type; | ||
| export interface CommandAttempt extends Schema.Schema.Type<typeof CommandAttempt> { | ||
| } | ||
| export declare const CommandAttempt: Schema.Struct<{ | ||
| readonly attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
| create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| }; | ||
| readonly time: Schema.Struct<{ | ||
| readonly created: Schema.Number; | ||
| readonly expires: Schema.Number; | ||
| }>; | ||
| }>; | ||
| export declare const CommandAttemptStatus: Schema.Union<readonly [Schema.Struct<{ | ||
| readonly status: Schema.Literal<"pending">; | ||
| readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| readonly time: Schema.Struct<{ | ||
| readonly created: Schema.Number; | ||
| readonly expires: Schema.Number; | ||
| }>; | ||
| }>, Schema.Struct<{ | ||
| readonly status: Schema.Literal<"complete">; | ||
| readonly time: Schema.Struct<{ | ||
| readonly created: Schema.Number; | ||
| readonly expires: Schema.Number; | ||
| }>; | ||
| }>, Schema.Struct<{ | ||
| readonly status: Schema.Literal<"failed">; | ||
| readonly message: Schema.String; | ||
| readonly time: Schema.Struct<{ | ||
| readonly created: Schema.Number; | ||
| readonly expires: Schema.Number; | ||
| }>; | ||
| }>, Schema.Struct<{ | ||
| readonly status: Schema.Literal<"expired">; | ||
| readonly time: Schema.Struct<{ | ||
| readonly created: Schema.Number; | ||
| readonly expires: Schema.Number; | ||
| }>; | ||
| }>]>; | ||
| export type CommandAttemptStatus = typeof CommandAttemptStatus.Type; |
+19
-1
@@ -41,2 +41,8 @@ export * as Integration from "./integration.js"; | ||
| }).annotate({ identifier: "Integration.OAuthMethod" }); | ||
| export const CommandMethod = Schema.Struct({ | ||
| id: MethodID, | ||
| type: Schema.Literal("command"), | ||
| label: Schema.String, | ||
| command: Schema.Array(Schema.String), | ||
| }).annotate({ identifier: "Integration.CommandMethod" }); | ||
| export const KeyMethod = Schema.Struct({ | ||
@@ -50,3 +56,3 @@ type: Schema.Literal("key"), | ||
| }).annotate({ identifier: "Integration.EnvMethod" }); | ||
| export const Method = Schema.Union([OAuthMethod, KeyMethod, EnvMethod]) | ||
| export const Method = Schema.Union([OAuthMethod, CommandMethod, KeyMethod, EnvMethod]) | ||
| .pipe(Schema.toTaggedUnion("type")) | ||
@@ -95,1 +101,13 @@ .annotate({ identifier: "Integration.Method" }); | ||
| .annotate({ identifier: "Integration.AttemptStatus" }); | ||
| export const CommandAttempt = Schema.Struct({ | ||
| attemptID: AttemptID, | ||
| time: AttemptTime, | ||
| }).annotate({ identifier: "Integration.CommandAttempt" }); | ||
| export const CommandAttemptStatus = Schema.Union([ | ||
| Schema.Struct({ status: Schema.Literal("pending"), message: optional(Schema.String), time: AttemptTime }), | ||
| Schema.Struct({ status: Schema.Literal("complete"), time: AttemptTime }), | ||
| Schema.Struct({ status: Schema.Literal("failed"), message: Schema.String, time: AttemptTime }), | ||
| Schema.Struct({ status: Schema.Literal("expired"), time: AttemptTime }), | ||
| ]) | ||
| .pipe(Schema.toTaggedUnion("status")) | ||
| .annotate({ identifier: "Integration.CommandAttemptStatus" }); |
+1
-1
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/schema", | ||
| "version": "0.0.0-next-15623", | ||
| "version": "0.0.0-next-15627", | ||
| "type": "module", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
3593348
0.09%56502
0.13%