summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-04-27 20:52:42 +0000
committeropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-04-27 20:52:42 +0000
commitdfc0075f90e5dae6f17beb5c337a0b09c3216908 (patch)
tree669ccbb2a9473ae81bb4573acd6e5e72c4cb3c2c
parentacd15dcc8ab5a01cf8c0f2ef3e21c71e2450a9f2 (diff)
downloadopencode-dfc0075f90e5dae6f17beb5c337a0b09c3216908.tar.gz
opencode-dfc0075f90e5dae6f17beb5c337a0b09c3216908.zip
chore: generate
-rw-r--r--packages/opencode/src/server/routes/instance/httpapi/control.ts77
-rw-r--r--packages/opencode/src/server/routes/instance/httpapi/event.ts31
-rw-r--r--packages/opencode/src/server/routes/instance/httpapi/global.ts125
-rw-r--r--packages/opencode/src/server/routes/instance/httpapi/pty.ts36
-rw-r--r--packages/opencode/test/server/httpapi-bridge.test.ts4
5 files changed, 136 insertions, 137 deletions
diff --git a/packages/opencode/src/server/routes/instance/httpapi/control.ts b/packages/opencode/src/server/routes/instance/httpapi/control.ts
index 14cbdf7c4..f850f76e7 100644
--- a/packages/opencode/src/server/routes/instance/httpapi/control.ts
+++ b/packages/opencode/src/server/routes/instance/httpapi/control.ts
@@ -31,42 +31,41 @@ export const ControlPaths = {
log: "/log",
} as const
-export const ControlApi = HttpApi.make("control")
- .add(
- HttpApiGroup.make("control")
- .add(
- HttpApiEndpoint.put("authSet", ControlPaths.auth, {
- params: AuthParams,
- payload: Auth.Info,
- success: Schema.Boolean,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "auth.set",
- summary: "Set auth credentials",
- description: "Set authentication credentials",
- }),
- ),
- HttpApiEndpoint.delete("authRemove", ControlPaths.auth, {
- params: AuthParams,
- success: Schema.Boolean,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "auth.remove",
- summary: "Remove auth credentials",
- description: "Remove authentication credentials",
- }),
- ),
- HttpApiEndpoint.post("log", ControlPaths.log, {
- query: LogQuery,
- payload: LogInput,
- success: Schema.Boolean,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "app.log",
- summary: "Write log",
- description: "Write a log entry to the server logs with specified level and metadata.",
- }),
- ),
- )
- .annotateMerge(OpenApi.annotations({ title: "control", description: "Control plane routes." })),
- )
+export const ControlApi = HttpApi.make("control").add(
+ HttpApiGroup.make("control")
+ .add(
+ HttpApiEndpoint.put("authSet", ControlPaths.auth, {
+ params: AuthParams,
+ payload: Auth.Info,
+ success: Schema.Boolean,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "auth.set",
+ summary: "Set auth credentials",
+ description: "Set authentication credentials",
+ }),
+ ),
+ HttpApiEndpoint.delete("authRemove", ControlPaths.auth, {
+ params: AuthParams,
+ success: Schema.Boolean,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "auth.remove",
+ summary: "Remove auth credentials",
+ description: "Remove authentication credentials",
+ }),
+ ),
+ HttpApiEndpoint.post("log", ControlPaths.log, {
+ query: LogQuery,
+ payload: LogInput,
+ success: Schema.Boolean,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "app.log",
+ summary: "Write log",
+ description: "Write a log entry to the server logs with specified level and metadata.",
+ }),
+ ),
+ )
+ .annotateMerge(OpenApi.annotations({ title: "control", description: "Control plane routes." })),
+)
diff --git a/packages/opencode/src/server/routes/instance/httpapi/event.ts b/packages/opencode/src/server/routes/instance/httpapi/event.ts
index 3194210ce..1d548e0ba 100644
--- a/packages/opencode/src/server/routes/instance/httpapi/event.ts
+++ b/packages/opencode/src/server/routes/instance/httpapi/event.ts
@@ -11,22 +11,21 @@ export const EventPaths = {
event: "/event",
} as const
-export const EventApi = HttpApi.make("event")
- .add(
- HttpApiGroup.make("event")
- .add(
- HttpApiEndpoint.get("subscribe", EventPaths.event, {
- success: Schema.Unknown,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "event.subscribe",
- summary: "Subscribe to events",
- description: "Get events",
- }),
- ),
- )
- .annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })),
- )
+export const EventApi = HttpApi.make("event").add(
+ HttpApiGroup.make("event")
+ .add(
+ HttpApiEndpoint.get("subscribe", EventPaths.event, {
+ success: Schema.Unknown,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "event.subscribe",
+ summary: "Subscribe to events",
+ description: "Get events",
+ }),
+ ),
+ )
+ .annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })),
+)
function eventData(data: unknown) {
return `data: ${JSON.stringify(data)}\n\n`
diff --git a/packages/opencode/src/server/routes/instance/httpapi/global.ts b/packages/opencode/src/server/routes/instance/httpapi/global.ts
index 44789b12f..215c19ef7 100644
--- a/packages/opencode/src/server/routes/instance/httpapi/global.ts
+++ b/packages/opencode/src/server/routes/instance/httpapi/global.ts
@@ -37,66 +37,65 @@ export const GlobalPaths = {
upgrade: "/global/upgrade",
} as const
-export const GlobalApi = HttpApi.make("global")
- .add(
- HttpApiGroup.make("global")
- .add(
- HttpApiEndpoint.get("health", GlobalPaths.health, {
- success: GlobalHealth,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.health",
- summary: "Get health",
- description: "Get health information about the OpenCode server.",
- }),
- ),
- HttpApiEndpoint.get("event", GlobalPaths.event, {
- success: GlobalEvent,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.event",
- summary: "Get global events",
- description: "Subscribe to global events from the OpenCode system using server-sent events.",
- }),
- ),
- HttpApiEndpoint.get("configGet", GlobalPaths.config, {
- success: Config.Info,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.config.get",
- summary: "Get global configuration",
- description: "Retrieve the current global OpenCode configuration settings and preferences.",
- }),
- ),
- HttpApiEndpoint.patch("configUpdate", GlobalPaths.config, {
- payload: Config.Info,
- success: Config.Info,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.config.update",
- summary: "Update global configuration",
- description: "Update global OpenCode configuration settings and preferences.",
- }),
- ),
- HttpApiEndpoint.post("dispose", GlobalPaths.dispose, {
- success: Schema.Boolean,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.dispose",
- summary: "Dispose instance",
- description: "Clean up and dispose all OpenCode instances, releasing all resources.",
- }),
- ),
- HttpApiEndpoint.post("upgrade", GlobalPaths.upgrade, {
- payload: GlobalUpgradeInput,
- success: GlobalUpgradeResult,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "global.upgrade",
- summary: "Upgrade opencode",
- description: "Upgrade opencode to the specified version or latest if not specified.",
- }),
- ),
- )
- .annotateMerge(OpenApi.annotations({ title: "global", description: "Global server routes." })),
- )
+export const GlobalApi = HttpApi.make("global").add(
+ HttpApiGroup.make("global")
+ .add(
+ HttpApiEndpoint.get("health", GlobalPaths.health, {
+ success: GlobalHealth,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.health",
+ summary: "Get health",
+ description: "Get health information about the OpenCode server.",
+ }),
+ ),
+ HttpApiEndpoint.get("event", GlobalPaths.event, {
+ success: GlobalEvent,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.event",
+ summary: "Get global events",
+ description: "Subscribe to global events from the OpenCode system using server-sent events.",
+ }),
+ ),
+ HttpApiEndpoint.get("configGet", GlobalPaths.config, {
+ success: Config.Info,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.config.get",
+ summary: "Get global configuration",
+ description: "Retrieve the current global OpenCode configuration settings and preferences.",
+ }),
+ ),
+ HttpApiEndpoint.patch("configUpdate", GlobalPaths.config, {
+ payload: Config.Info,
+ success: Config.Info,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.config.update",
+ summary: "Update global configuration",
+ description: "Update global OpenCode configuration settings and preferences.",
+ }),
+ ),
+ HttpApiEndpoint.post("dispose", GlobalPaths.dispose, {
+ success: Schema.Boolean,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.dispose",
+ summary: "Dispose instance",
+ description: "Clean up and dispose all OpenCode instances, releasing all resources.",
+ }),
+ ),
+ HttpApiEndpoint.post("upgrade", GlobalPaths.upgrade, {
+ payload: GlobalUpgradeInput,
+ success: GlobalUpgradeResult,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "global.upgrade",
+ summary: "Upgrade opencode",
+ description: "Upgrade opencode to the specified version or latest if not specified.",
+ }),
+ ),
+ )
+ .annotateMerge(OpenApi.annotations({ title: "global", description: "Global server routes." })),
+)
diff --git a/packages/opencode/src/server/routes/instance/httpapi/pty.ts b/packages/opencode/src/server/routes/instance/httpapi/pty.ts
index 21a2dec5c..f1ac09399 100644
--- a/packages/opencode/src/server/routes/instance/httpapi/pty.ts
+++ b/packages/opencode/src/server/routes/instance/httpapi/pty.ts
@@ -113,24 +113,24 @@ export const PtyApi = HttpApi.make("pty")
}),
)
-export const PtyConnectApi = HttpApi.make("pty-connect")
- .add(
- HttpApiGroup.make("pty-connect")
- .add(
- HttpApiEndpoint.get("connect", PtyPaths.connect, {
- params: Params,
- query: CursorQuery,
- success: Schema.Boolean,
- }).annotateMerge(
- OpenApi.annotations({
- identifier: "pty.connect",
- summary: "Connect to PTY session",
- description: "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
- }),
- ),
- )
- .annotateMerge(OpenApi.annotations({ title: "pty", description: "PTY websocket route." })),
- )
+export const PtyConnectApi = HttpApi.make("pty-connect").add(
+ HttpApiGroup.make("pty-connect")
+ .add(
+ HttpApiEndpoint.get("connect", PtyPaths.connect, {
+ params: Params,
+ query: CursorQuery,
+ success: Schema.Boolean,
+ }).annotateMerge(
+ OpenApi.annotations({
+ identifier: "pty.connect",
+ summary: "Connect to PTY session",
+ description:
+ "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
+ }),
+ ),
+ )
+ .annotateMerge(OpenApi.annotations({ title: "pty", description: "PTY websocket route." })),
+)
export const ptyHandlers = Layer.unwrap(
Effect.gen(function* () {
diff --git a/packages/opencode/test/server/httpapi-bridge.test.ts b/packages/opencode/test/server/httpapi-bridge.test.ts
index d185dee3b..c0482293b 100644
--- a/packages/opencode/test/server/httpapi-bridge.test.ts
+++ b/packages/opencode/test/server/httpapi-bridge.test.ts
@@ -80,7 +80,9 @@ function reflectedHttpApiRoutes() {
function openApiRouteKeys(spec: { paths: Record<string, Partial<Record<(typeof methods)[number], unknown>>> }) {
return Object.entries(spec.paths)
- .flatMap(([path, item]) => methods.filter((method) => item[method]).map((method) => `${method.toUpperCase()} ${path}`))
+ .flatMap(([path, item]) =>
+ methods.filter((method) => item[method]).map((method) => `${method.toUpperCase()} ${path}`),
+ )
.sort()
}