|
|
@@ -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." })),
|
|
|
+)
|