Revert "feat(core): optional mdns service (#6192)"

This reverts commit 26e7043718.
This commit is contained in:
Aiden Cline
2025-12-26 11:43:52 -06:00
parent 2e10ffac6b
commit 505068d5a6
16 changed files with 115 additions and 237 deletions

View File

@@ -6,8 +6,6 @@ import path from "path"
import { UI } from "@/cli/ui"
import { iife } from "@/util/iife"
import { Log } from "@/util/log"
import { withNetworkOptions, resolveNetworkOptions } from "@/cli/network"
import { Config } from "@/config/config"
declare global {
const OPENCODE_WORKER_PATH: string
@@ -17,7 +15,7 @@ export const TuiThreadCommand = cmd({
command: "$0 [project]",
describe: "start opencode tui",
builder: (yargs) =>
withNetworkOptions(yargs)
yargs
.positional("project", {
type: "string",
describe: "path to start opencode in",
@@ -38,12 +36,23 @@ export const TuiThreadCommand = cmd({
describe: "session id to continue",
})
.option("prompt", {
alias: ["p"],
type: "string",
describe: "prompt to use",
})
.option("agent", {
type: "string",
describe: "agent to use",
})
.option("port", {
type: "number",
describe: "port to listen on",
default: 0,
})
.option("hostname", {
type: "string",
describe: "hostname to listen on",
default: "127.0.0.1",
}),
handler: async (args) => {
// Resolve relative paths against PWD to preserve behavior when using --cwd flag
@@ -78,9 +87,10 @@ export const TuiThreadCommand = cmd({
process.on("unhandledRejection", (e) => {
Log.Default.error(e)
})
const config = await Config.get()
const networkOpts = resolveNetworkOptions(args, config)
const server = await client.call("server", networkOpts)
const server = await client.call("server", {
port: args.port,
hostname: args.hostname,
})
const prompt = await iife(async () => {
const piped = !process.stdin.isTTY ? await Bun.stdin.text() : undefined
if (!args.prompt) return piped