@opencode-ai/protocol
Advanced tools
@@ -86,2 +86,7 @@ import { Integration } from "@opencode-ai/schema/integration"; | ||
| }>, 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">; | ||
@@ -186,2 +191,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">; | ||
@@ -214,3 +224,3 @@ readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| readonly label: Schema.optional<Schema.String>; | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.connect.oauth", "POST", "/api/integration/:integrationID/connect/oauth", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.connect", "POST", "/api/integration/:integrationID/connect/oauth", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
@@ -229,3 +239,4 @@ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| readonly data: typeof Integration.Attempt; | ||
| }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.status", "GET", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.status", "GET", "/api/integration/:integrationID/connect/oauth/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
@@ -267,3 +278,4 @@ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| }>]>; | ||
| }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.complete", "POST", "/api/integration/attempt/:attemptID/complete", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.complete", "POST", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
@@ -279,3 +291,4 @@ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| readonly code: Schema.optional<Schema.String>; | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.cancel", "DELETE", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.cancel", "DELETE", "/api/integration/:integrationID/connect/oauth/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
@@ -289,2 +302,72 @@ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| }>>; | ||
| }>>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.connect", "POST", "/api/integration/:integrationID/connect/command", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| }>>, HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| readonly location: Schema.optional<Schema.Struct<{ | ||
| readonly directory: Schema.optional<Schema.String>; | ||
| readonly workspace: Schema.optional<Schema.String>; | ||
| }>>; | ||
| }>>, HttpApiEndpoint.Json<Schema.Struct<{ | ||
| readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">; | ||
| readonly label: Schema.optional<Schema.String>; | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{ | ||
| readonly location: typeof Location.Info; | ||
| readonly data: 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; | ||
| }>; | ||
| }>; | ||
| }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.status", "GET", "/api/integration/:integrationID/connect/command/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
| create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| }; | ||
| }>>, HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| readonly location: Schema.optional<Schema.Struct<{ | ||
| readonly directory: Schema.optional<Schema.String>; | ||
| readonly workspace: Schema.optional<Schema.String>; | ||
| }>>; | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{ | ||
| readonly location: typeof Location.Info; | ||
| readonly data: 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; | ||
| }>; | ||
| }>]>; | ||
| }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.cancel", "DELETE", "/api/integration/:integrationID/connect/command/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| integrationID: Schema.brand<Schema.String, "Integration.ID">; | ||
| attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & { | ||
| create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">; | ||
| }; | ||
| }>>, HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| readonly location: Schema.optional<Schema.Struct<{ | ||
| readonly directory: Schema.optional<Schema.String>; | ||
| readonly workspace: Schema.optional<Schema.String>; | ||
| }>>; | ||
| }>>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<never>, never, never>, false>; |
@@ -46,3 +46,3 @@ import { Integration } from "@opencode-ai/schema/integration"; | ||
| }))) | ||
| .add(HttpApiEndpoint.post("integration.connect.oauth", "/api/integration/:integrationID/connect/oauth", { | ||
| .add(HttpApiEndpoint.post("integration.oauth.connect", "/api/integration/:integrationID/connect/oauth", { | ||
| params: { integrationID: Integration.ID }, | ||
@@ -60,8 +60,8 @@ query: LocationQuery, | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.connect.oauth", | ||
| identifier: "v2.integration.oauth.connect", | ||
| summary: "Begin OAuth connection", | ||
| description: "Start an OAuth attempt and return the authorization details.", | ||
| }))) | ||
| .add(HttpApiEndpoint.get("integration.attempt.status", "/api/integration/attempt/:attemptID", { | ||
| params: { attemptID: Integration.AttemptID }, | ||
| .add(HttpApiEndpoint.get("integration.oauth.status", "/api/integration/:integrationID/connect/oauth/:attemptID", { | ||
| params: { integrationID: Integration.ID, attemptID: Integration.AttemptID }, | ||
| query: LocationQuery, | ||
@@ -72,8 +72,8 @@ success: Location.response(Integration.AttemptStatus), | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.attempt.status", | ||
| identifier: "v2.integration.oauth.status", | ||
| summary: "Get OAuth attempt status", | ||
| description: "Poll the current status of an OAuth attempt.", | ||
| }))) | ||
| .add(HttpApiEndpoint.post("integration.attempt.complete", "/api/integration/attempt/:attemptID/complete", { | ||
| params: { attemptID: Integration.AttemptID }, | ||
| .add(HttpApiEndpoint.post("integration.oauth.complete", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", { | ||
| params: { integrationID: Integration.ID, attemptID: Integration.AttemptID }, | ||
| query: LocationQuery, | ||
@@ -86,8 +86,8 @@ payload: Schema.Struct({ code: Schema.optional(Schema.String) }), | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.attempt.complete", | ||
| identifier: "v2.integration.oauth.complete", | ||
| summary: "Complete OAuth connection", | ||
| description: "Complete a code-based OAuth attempt and store the resulting credential.", | ||
| }))) | ||
| .add(HttpApiEndpoint.delete("integration.attempt.cancel", "/api/integration/attempt/:attemptID", { | ||
| params: { attemptID: Integration.AttemptID }, | ||
| .add(HttpApiEndpoint.delete("integration.oauth.cancel", "/api/integration/:integrationID/connect/oauth/:attemptID", { | ||
| params: { integrationID: Integration.ID, attemptID: Integration.AttemptID }, | ||
| query: LocationQuery, | ||
@@ -98,6 +98,44 @@ success: HttpApiSchema.NoContent, | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.attempt.cancel", | ||
| identifier: "v2.integration.oauth.cancel", | ||
| summary: "Cancel OAuth connection", | ||
| description: "Cancel an OAuth attempt and release its resources.", | ||
| }))) | ||
| .add(HttpApiEndpoint.post("integration.command.connect", "/api/integration/:integrationID/connect/command", { | ||
| params: { integrationID: Integration.ID }, | ||
| query: LocationQuery, | ||
| payload: Schema.Struct({ | ||
| methodID: Integration.MethodID, | ||
| label: Schema.optional(Schema.String), | ||
| }), | ||
| success: Location.response(Integration.CommandAttempt), | ||
| error: InvalidRequestError, | ||
| }) | ||
| .annotateMerge(locationQueryOpenApi) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.command.connect", | ||
| summary: "Begin command connection", | ||
| description: "Start a command authentication attempt.", | ||
| }))) | ||
| .add(HttpApiEndpoint.get("integration.command.status", "/api/integration/:integrationID/connect/command/:attemptID", { | ||
| params: { integrationID: Integration.ID, attemptID: Integration.AttemptID }, | ||
| query: LocationQuery, | ||
| success: Location.response(Integration.CommandAttemptStatus), | ||
| }) | ||
| .annotateMerge(locationQueryOpenApi) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.command.status", | ||
| summary: "Get command attempt status", | ||
| description: "Poll the current status and output of a command authentication attempt.", | ||
| }))) | ||
| .add(HttpApiEndpoint.delete("integration.command.cancel", "/api/integration/:integrationID/connect/command/:attemptID", { | ||
| params: { integrationID: Integration.ID, attemptID: Integration.AttemptID }, | ||
| query: LocationQuery, | ||
| success: HttpApiSchema.NoContent, | ||
| }) | ||
| .annotateMerge(locationQueryOpenApi) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.integration.command.cancel", | ||
| summary: "Cancel command connection", | ||
| description: "Cancel a command authentication attempt and terminate its process.", | ||
| }))) | ||
| .annotateMerge(OpenApi.annotations({ title: "integration", description: "Integration discovery and authentication routes." })); |
+2
-2
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/protocol", | ||
| "version": "0.0.0-next-15623", | ||
| "version": "0.0.0-next-15627", | ||
| "type": "module", | ||
@@ -29,3 +29,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@opencode-ai/schema": "0.0.0-next-15623", | ||
| "@opencode-ai/schema": "0.0.0-next-15627", | ||
| "effect": "4.0.0-beta.83" | ||
@@ -32,0 +32,0 @@ }, |
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.
1868976
0.35%30168
0.41%+ Added
- Removed