@opencode-ai/protocol
Advanced tools
@@ -138,2 +138,13 @@ import { SessionMessage } from "@opencode-ai/schema/session-message"; | ||
| }))) | ||
| .add(HttpApiEndpoint.delete("session.remove", "/api/session/:sessionID", { | ||
| params: { sessionID: Session.ID }, | ||
| success: HttpApiSchema.NoContent, | ||
| error: SessionNotFoundError, | ||
| }) | ||
| .middleware(sessionLocationMiddleware) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.remove", | ||
| summary: "Delete session", | ||
| description: "Delete a session and its child sessions.", | ||
| }))) | ||
| .add(HttpApiEndpoint.post("session.fork", "/api/session/:sessionID/fork", { | ||
@@ -140,0 +151,0 @@ params: { sessionID: Session.ID }, |
@@ -38,3 +38,3 @@ import { Location } from "@opencode-ai/schema/location"; | ||
| readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>; | ||
| readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>; | ||
| readonly timeout: Schema.Int; | ||
| readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>; | ||
@@ -91,2 +91,34 @@ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{ | ||
| }>; | ||
| }>>, HttpApiEndpoint.Json<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.timeout", "PATCH", "/api/shell/:id/timeout", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
| id: Schema.brand<Schema.String, "ShellID"> & { | ||
| create: () => string & import("effect/Brand").Brand<"ShellID">; | ||
| ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">; | ||
| }; | ||
| }>>, 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 timeout: Schema.Int; | ||
| }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{ | ||
| readonly location: typeof Location.Info; | ||
| readonly data: Schema.Struct<{ | ||
| readonly id: Schema.brand<Schema.String, "ShellID"> & { | ||
| create: () => string & import("effect/Brand").Brand<"ShellID">; | ||
| ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">; | ||
| }; | ||
| readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>; | ||
| readonly command: Schema.String; | ||
| readonly cwd: Schema.String; | ||
| readonly shell: Schema.String; | ||
| readonly file: Schema.String; | ||
| readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>; | ||
| readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>; | ||
| readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>; | ||
| readonly time: Schema.Struct<{ | ||
| readonly started: Schema.Number; | ||
| readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>; | ||
| }>; | ||
| }>; | ||
| }>>, HttpApiEndpoint.Json<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.output", "GET", "/api/shell/:id/output", HttpApiEndpoint.StringTree<Schema.Struct<{ | ||
@@ -93,0 +125,0 @@ id: Schema.brand<Schema.String, "ShellID"> & { |
+17
-0
| import { Shell } from "@opencode-ai/schema/shell"; | ||
| import { Location } from "@opencode-ai/schema/location"; | ||
| import { NonNegativeInt } from "@opencode-ai/schema/schema"; | ||
| import { Schema } from "effect"; | ||
@@ -7,2 +8,5 @@ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"; | ||
| import { LocationQuery, locationQueryOpenApi } from "./location.js"; | ||
| const TimeoutInput = Schema.Struct({ | ||
| timeout: NonNegativeInt, | ||
| }); | ||
| export const ShellGroup = HttpApiGroup.make("server.shell") | ||
@@ -42,2 +46,15 @@ .add(HttpApiEndpoint.get("shell.list", "/api/shell", { | ||
| }))) | ||
| .add(HttpApiEndpoint.patch("shell.timeout", "/api/shell/:id/timeout", { | ||
| params: { id: Shell.ID }, | ||
| query: LocationQuery, | ||
| payload: TimeoutInput, | ||
| success: Location.response(Shell.Info), | ||
| error: ShellNotFoundError, | ||
| }) | ||
| .annotateMerge(locationQueryOpenApi) | ||
| .annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.shell.timeout", | ||
| summary: "Update shell timeout", | ||
| description: "Replace a running shell command's timeout from now, or clear it with zero.", | ||
| }))) | ||
| .add(HttpApiEndpoint.get("shell.output", "/api/shell/:id/output", { | ||
@@ -44,0 +61,0 @@ params: { id: Shell.ID }, |
+2
-2
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/protocol", | ||
| "version": "0.0.0-next-15021", | ||
| "version": "0.0.0-next-15026", | ||
| "type": "module", | ||
@@ -29,3 +29,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@opencode-ai/schema": "0.0.0-next-15021", | ||
| "@opencode-ai/schema": "0.0.0-next-15026", | ||
| "effect": "4.0.0-beta.83" | ||
@@ -32,0 +32,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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.
1780511
0.79%29004
0.88%+ Added
- Removed