chore: generate

This commit is contained in:
opencode-agent[bot]
2026-04-27 20:52:42 +00:00
parent acd15dcc8a
commit dfc0075f90
5 changed files with 136 additions and 137 deletions
@@ -31,42 +31,41 @@ export const ControlPaths = {
log: "/log", log: "/log",
} as const } as const
export const ControlApi = HttpApi.make("control") export const ControlApi = HttpApi.make("control").add(
.add( HttpApiGroup.make("control")
HttpApiGroup.make("control") .add(
.add( HttpApiEndpoint.put("authSet", ControlPaths.auth, {
HttpApiEndpoint.put("authSet", ControlPaths.auth, { params: AuthParams,
params: AuthParams, payload: Auth.Info,
payload: Auth.Info, success: Schema.Boolean,
success: Schema.Boolean, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "auth.set",
identifier: "auth.set", summary: "Set auth credentials",
summary: "Set auth credentials", description: "Set authentication credentials",
description: "Set authentication credentials", }),
}), ),
), HttpApiEndpoint.delete("authRemove", ControlPaths.auth, {
HttpApiEndpoint.delete("authRemove", ControlPaths.auth, { params: AuthParams,
params: AuthParams, success: Schema.Boolean,
success: Schema.Boolean, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "auth.remove",
identifier: "auth.remove", summary: "Remove auth credentials",
summary: "Remove auth credentials", description: "Remove authentication credentials",
description: "Remove authentication credentials", }),
}), ),
), HttpApiEndpoint.post("log", ControlPaths.log, {
HttpApiEndpoint.post("log", ControlPaths.log, { query: LogQuery,
query: LogQuery, payload: LogInput,
payload: LogInput, success: Schema.Boolean,
success: Schema.Boolean, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "app.log",
identifier: "app.log", summary: "Write log",
summary: "Write log", description: "Write a log entry to the server logs with specified level and metadata.",
description: "Write a log entry to the server logs with specified level and metadata.", }),
}), ),
), )
) .annotateMerge(OpenApi.annotations({ title: "control", description: "Control plane routes." })),
.annotateMerge(OpenApi.annotations({ title: "control", description: "Control plane routes." })), )
)
@@ -11,22 +11,21 @@ export const EventPaths = {
event: "/event", event: "/event",
} as const } as const
export const EventApi = HttpApi.make("event") export const EventApi = HttpApi.make("event").add(
.add( HttpApiGroup.make("event")
HttpApiGroup.make("event") .add(
.add( HttpApiEndpoint.get("subscribe", EventPaths.event, {
HttpApiEndpoint.get("subscribe", EventPaths.event, { success: Schema.Unknown,
success: Schema.Unknown, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "event.subscribe",
identifier: "event.subscribe", summary: "Subscribe to events",
summary: "Subscribe to events", description: "Get events",
description: "Get events", }),
}), ),
), )
) .annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })),
.annotateMerge(OpenApi.annotations({ title: "event", description: "Instance event stream route." })), )
)
function eventData(data: unknown) { function eventData(data: unknown) {
return `data: ${JSON.stringify(data)}\n\n` return `data: ${JSON.stringify(data)}\n\n`
@@ -37,66 +37,65 @@ export const GlobalPaths = {
upgrade: "/global/upgrade", upgrade: "/global/upgrade",
} as const } as const
export const GlobalApi = HttpApi.make("global") export const GlobalApi = HttpApi.make("global").add(
.add( HttpApiGroup.make("global")
HttpApiGroup.make("global") .add(
.add( HttpApiEndpoint.get("health", GlobalPaths.health, {
HttpApiEndpoint.get("health", GlobalPaths.health, { success: GlobalHealth,
success: GlobalHealth, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.health",
identifier: "global.health", summary: "Get health",
summary: "Get health", description: "Get health information about the OpenCode server.",
description: "Get health information about the OpenCode server.", }),
}), ),
), HttpApiEndpoint.get("event", GlobalPaths.event, {
HttpApiEndpoint.get("event", GlobalPaths.event, { success: GlobalEvent,
success: GlobalEvent, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.event",
identifier: "global.event", summary: "Get global events",
summary: "Get global events", description: "Subscribe to global events from the OpenCode system using server-sent events.",
description: "Subscribe to global events from the OpenCode system using server-sent events.", }),
}), ),
), HttpApiEndpoint.get("configGet", GlobalPaths.config, {
HttpApiEndpoint.get("configGet", GlobalPaths.config, { success: Config.Info,
success: Config.Info, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.config.get",
identifier: "global.config.get", summary: "Get global configuration",
summary: "Get global configuration", description: "Retrieve the current global OpenCode configuration settings and preferences.",
description: "Retrieve the current global OpenCode configuration settings and preferences.", }),
}), ),
), HttpApiEndpoint.patch("configUpdate", GlobalPaths.config, {
HttpApiEndpoint.patch("configUpdate", GlobalPaths.config, { payload: Config.Info,
payload: Config.Info, success: Config.Info,
success: Config.Info, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.config.update",
identifier: "global.config.update", summary: "Update global configuration",
summary: "Update global configuration", description: "Update global OpenCode configuration settings and preferences.",
description: "Update global OpenCode configuration settings and preferences.", }),
}), ),
), HttpApiEndpoint.post("dispose", GlobalPaths.dispose, {
HttpApiEndpoint.post("dispose", GlobalPaths.dispose, { success: Schema.Boolean,
success: Schema.Boolean, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.dispose",
identifier: "global.dispose", summary: "Dispose instance",
summary: "Dispose instance", description: "Clean up and dispose all OpenCode instances, releasing all resources.",
description: "Clean up and dispose all OpenCode instances, releasing all resources.", }),
}), ),
), HttpApiEndpoint.post("upgrade", GlobalPaths.upgrade, {
HttpApiEndpoint.post("upgrade", GlobalPaths.upgrade, { payload: GlobalUpgradeInput,
payload: GlobalUpgradeInput, success: GlobalUpgradeResult,
success: GlobalUpgradeResult, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "global.upgrade",
identifier: "global.upgrade", summary: "Upgrade opencode",
summary: "Upgrade opencode", description: "Upgrade opencode to the specified version or latest if not specified.",
description: "Upgrade opencode to the specified version or latest if not specified.", }),
}), ),
), )
) .annotateMerge(OpenApi.annotations({ title: "global", description: "Global server routes." })),
.annotateMerge(OpenApi.annotations({ title: "global", description: "Global server routes." })), )
)
@@ -113,24 +113,24 @@ export const PtyApi = HttpApi.make("pty")
}), }),
) )
export const PtyConnectApi = HttpApi.make("pty-connect") export const PtyConnectApi = HttpApi.make("pty-connect").add(
.add( HttpApiGroup.make("pty-connect")
HttpApiGroup.make("pty-connect") .add(
.add( HttpApiEndpoint.get("connect", PtyPaths.connect, {
HttpApiEndpoint.get("connect", PtyPaths.connect, { params: Params,
params: Params, query: CursorQuery,
query: CursorQuery, success: Schema.Boolean,
success: Schema.Boolean, }).annotateMerge(
}).annotateMerge( OpenApi.annotations({
OpenApi.annotations({ identifier: "pty.connect",
identifier: "pty.connect", summary: "Connect to PTY session",
summary: "Connect to PTY session", description:
description: "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.", "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
}), }),
), ),
) )
.annotateMerge(OpenApi.annotations({ title: "pty", description: "PTY websocket route." })), .annotateMerge(OpenApi.annotations({ title: "pty", description: "PTY websocket route." })),
) )
export const ptyHandlers = Layer.unwrap( export const ptyHandlers = Layer.unwrap(
Effect.gen(function* () { Effect.gen(function* () {
@@ -80,7 +80,9 @@ function reflectedHttpApiRoutes() {
function openApiRouteKeys(spec: { paths: Record<string, Partial<Record<(typeof methods)[number], unknown>>> }) { function openApiRouteKeys(spec: { paths: Record<string, Partial<Record<(typeof methods)[number], unknown>>> }) {
return Object.entries(spec.paths) 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() .sort()
} }