@opencode-ai/protocol
Advanced tools
| import { Location } from "@opencode-ai/schema/location"; | ||
| import { Schema } from "effect"; | ||
| import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi"; | ||
| import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi"; | ||
| import { InvalidRequestError, ServiceUnavailableError } from "../errors.js"; | ||
| export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", HttpApiEndpoint.HttpApiEndpoint<"plugin.list", "GET", "/api/plugin", never, Schema.toCodecStringTree<Schema.Struct<{ | ||
@@ -17,3 +18,5 @@ readonly location: Schema.optional<Schema.Struct<{ | ||
| readonly type: Schema.Literal<"package">; | ||
| readonly package: Schema.String; | ||
| readonly target: Schema.String; | ||
| readonly version: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| readonly outdated: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>; | ||
| }>, Schema.Struct<{ | ||
@@ -37,2 +40,9 @@ readonly type: Schema.Literal<"local">; | ||
| }>>; | ||
| }>>, never, never, never>, false>; | ||
| }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.update", "POST", "/api/plugin/update", never, Schema.toCodecStringTree<Schema.Struct<{ | ||
| readonly location: Schema.optional<Schema.Struct<{ | ||
| readonly directory: Schema.optional<Schema.String>; | ||
| readonly workspace: Schema.optional<Schema.String>; | ||
| }>>; | ||
| }>>, Schema.toCodecJson<Schema.Struct<{ | ||
| readonly target: Schema.String; | ||
| }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>; |
| import { Location } from "@opencode-ai/schema/location"; | ||
| import { Plugin } from "@opencode-ai/schema/plugin"; | ||
| import { Schema } from "effect"; | ||
| import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"; | ||
| import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"; | ||
| import { InvalidRequestError, ServiceUnavailableError } from "../errors.js"; | ||
| import { LocationQuery, locationQueryOpenApi } from "./location.js"; | ||
@@ -17,5 +18,17 @@ export const PluginGroup = HttpApiGroup.make("server.plugin") | ||
| }))) | ||
| .add(HttpApiEndpoint.post("plugin.update", "/api/plugin/update", { | ||
| query: LocationQuery, | ||
| payload: Schema.Struct({ target: Schema.String }), | ||
| success: HttpApiSchema.NoContent, | ||
| error: [InvalidRequestError, ServiceUnavailableError], | ||
| }) | ||
| .annotateMerge(locationQueryOpenApi) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.plugin.update", | ||
| summary: "Update plugin", | ||
| description: "Update one package plugin and notify active locations to reload it.", | ||
| }))) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| title: "plugin", | ||
| description: "Experimental plugin routes.", | ||
| })); |
+2
-2
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/protocol", | ||
| "version": "0.0.0-dev-18792", | ||
| "version": "0.0.0-dev-18793", | ||
| "type": "module", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@opencode-ai/schema": "0.0.0-dev-18792", | ||
| "@opencode-ai/schema": "0.0.0-dev-18793", | ||
| "effect": "4.0.0-rc.112" | ||
@@ -38,0 +38,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.
2098184
0.07%33681
0.07%+ Added
- Removed