refactor(permission): keep effect server internal
Keep the experimental Effect-native HttpApi server as an internal implementation detail for now instead of exposing it through the CLI serve command or a public env flag.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Server } from "../../server/server"
|
||||
import { ExperimentalHttpApiServer } from "../../server/instance/httpapi/server"
|
||||
import { cmd } from "./cmd"
|
||||
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
||||
import { Flag } from "../../flag/flag"
|
||||
@@ -18,18 +17,8 @@ export const ServeCommand = cmd({
|
||||
const opts = await resolveNetworkOptions(args)
|
||||
const server = await Server.listen(opts)
|
||||
console.log(`opencode server listening on http://${server.hostname}:${server.port}`)
|
||||
const httpapi = Flag.OPENCODE_EXPERIMENTAL_HTTPAPI_PORT
|
||||
? await ExperimentalHttpApiServer.listen({
|
||||
hostname: opts.hostname,
|
||||
port: Flag.OPENCODE_EXPERIMENTAL_HTTPAPI_PORT,
|
||||
})
|
||||
: undefined
|
||||
if (httpapi) {
|
||||
console.log(`experimental httpapi listening on http://${httpapi.hostname}:${httpapi.port}`)
|
||||
}
|
||||
|
||||
await new Promise(() => {})
|
||||
await httpapi?.stop()
|
||||
await server.stop()
|
||||
},
|
||||
})
|
||||
|
||||
@@ -47,7 +47,6 @@ export namespace Flag {
|
||||
export declare const OPENCODE_CLIENT: string
|
||||
export const OPENCODE_SERVER_PASSWORD = process.env["OPENCODE_SERVER_PASSWORD"]
|
||||
export const OPENCODE_SERVER_USERNAME = process.env["OPENCODE_SERVER_USERNAME"]
|
||||
export const OPENCODE_EXPERIMENTAL_HTTPAPI_PORT = number("OPENCODE_EXPERIMENTAL_HTTPAPI_PORT")
|
||||
export const OPENCODE_ENABLE_QUESTION_TOOL = truthy("OPENCODE_ENABLE_QUESTION_TOOL")
|
||||
|
||||
// Experimental
|
||||
|
||||
Reference in New Issue
Block a user