Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/app",
"version": "1.14.18",
"version": "1.14.19",
"description": "",
"type": "module",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-app",
"version": "1.14.18",
"version": "1.14.19",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/console-core",
"version": "1.14.18",
"version": "1.14.19",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/console/function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-function",
"version": "1.14.18",
"version": "1.14.19",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/console/mail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-mail",
"version": "1.14.18",
"version": "1.14.19",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop-electron",
"private": true,
"version": "1.14.18",
"version": "1.14.19",
"type": "module",
"license": "MIT",
"homepage": "https://opencode.ai",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop",
"private": true,
"version": "1.14.18",
"version": "1.14.19",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/enterprise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/enterprise",
"version": "1.14.18",
"version": "1.14.19",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions packages/extensions/zed/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "opencode"
name = "OpenCode"
description = "The open source coding agent."
version = "1.14.18"
version = "1.14.19"
schema_version = 1
authors = ["Anomaly"]
repository = "https://github.com/anomalyco/opencode"
Expand All @@ -11,26 +11,26 @@ name = "OpenCode"
icon = "./icons/opencode.svg"

[agent_servers.opencode.targets.darwin-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.18/opencode-darwin-arm64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.19/opencode-darwin-arm64.zip"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.darwin-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.18/opencode-darwin-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.19/opencode-darwin-x64.zip"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.linux-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.18/opencode-linux-arm64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.19/opencode-linux-arm64.tar.gz"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.linux-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.18/opencode-linux-x64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.19/opencode-linux-x64.tar.gz"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.windows-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.18/opencode-windows-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.19/opencode-windows-x64.zip"
cmd = "./opencode.exe"
args = ["acp"]
2 changes: 1 addition & 1 deletion packages/function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/function",
"version": "1.14.18",
"version": "1.14.19",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "1.14.18",
"version": "1.14.19",
"name": "opencode",
"type": "module",
"license": "MIT",
Expand Down
49 changes: 42 additions & 7 deletions packages/opencode/src/cli/cmd/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { McpOAuthProvider } from "../../mcp/oauth-provider"
import { Config } from "../../config"
import { ConfigMCP } from "../../config/mcp"
import { Instance } from "../../project/instance"
import { Installation } from "../../installation"
import { InstallationVersion } from "../../installation/version"
import path from "path"
import { Global } from "../../global"
Expand Down Expand Up @@ -68,14 +67,49 @@ async function listState() {
return AppRuntime.runPromise(
Effect.gen(function* () {
const cfg = yield* Config.Service
const mcp = yield* MCP.Service
const auth = yield* McpAuth.Service
const config = yield* cfg.get()
const statuses = yield* mcp.status()
const global = yield* cfg.getGlobal()

const serverStatuses = yield* Effect.promise(() => {
const hostname = global.server?.hostname === "0.0.0.0" ? "127.0.0.1" : (global.server?.hostname ?? "127.0.0.1")
const password = process.env.OPENCODE_SERVER_PASSWORD
const username = process.env.OPENCODE_SERVER_USERNAME ?? "opencode"
const headers = password
? {
Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`,
}
: undefined

const ports = [...new Set([global.server?.port, 18790, 4096].filter((value): value is number => !!value))]
if (ports.length === 0) return Promise.resolve(undefined)

return (async () => {
for (const port of ports) {
const response = await fetch(`http://${hostname}:${port}/mcp`, {
headers,
signal: AbortSignal.timeout(1_000),
}).catch(() => undefined)

if (response?.ok) return (await response.json()) as Record<string, MCP.Status>
}

return undefined
})()
})

const statuses =
serverStatuses ??
(yield* Effect.gen(function* () {
const mcp = yield* MCP.Service
return yield* mcp.status()
}))

const stored = yield* Effect.all(
Object.fromEntries(configuredServers(config).map(([name]) => [name, mcp.hasStoredTokens(name)])),
Object.fromEntries(configuredServers(config).map(([name]) => [name, Effect.map(auth.get(name), (entry) => !!entry?.tokens)])),
{ concurrency: "unbounded" },
)
return { config, statuses, stored }
return { config, statuses, stored, source: serverStatuses ? ("server" as const) : ("local" as const) }
}),
)
}
Expand Down Expand Up @@ -120,7 +154,7 @@ export const McpListCommand = cmd({
UI.empty()
prompts.intro("MCP Servers")

const { config, statuses, stored } = await listState()
const { config, statuses, stored, source } = await listState()
const servers = configuredServers(config)

if (servers.length === 0) {
Expand Down Expand Up @@ -169,7 +203,8 @@ export const McpListCommand = cmd({
)
}

prompts.outro(`${servers.length} server(s)`)
const sourceText = source === "server" ? "live server state" : "local process state"
prompts.outro(`${servers.length} server(s) · source: ${sourceText}`)
},
})
},
Expand Down
1 change: 0 additions & 1 deletion packages/opencode/src/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export const layer = Layer.effect(

export const defaultLayer = layer.pipe(
Layer.provide(Config.defaultLayer),
Layer.provide(MCP.defaultLayer),
Layer.provide(Skill.defaultLayer),
)

Expand Down
10 changes: 7 additions & 3 deletions packages/opencode/src/effect/app-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ import { SessionShare } from "@/share"
import { Npm } from "@/npm"
import { memoMap } from "./memo-map"

const mcpLayer = MCP.defaultLayer
const commandLayer = Command.defaultLayer.pipe(Layer.provide(mcpLayer))
const sessionPromptLayer = SessionPrompt.defaultLayer.pipe(Layer.provide(mcpLayer))

export const AppLayer = Layer.mergeAll(
Npm.defaultLayer,
AppFileSystem.defaultLayer,
Expand Down Expand Up @@ -78,13 +82,13 @@ export const AppLayer = Layer.mergeAll(
SessionCompaction.defaultLayer,
SessionRevert.defaultLayer,
SessionSummary.defaultLayer,
SessionPrompt.defaultLayer,
sessionPromptLayer,
Instruction.defaultLayer,
LLM.defaultLayer,
LSP.defaultLayer,
MCP.defaultLayer,
mcpLayer,
McpAuth.defaultLayer,
Command.defaultLayer,
commandLayer,
Truncate.defaultLayer,
ToolRegistry.defaultLayer,
Format.defaultLayer,
Expand Down
1 change: 0 additions & 1 deletion packages/opencode/src/file/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const layer = Layer.effect(
Effect.gen(function* () {
const config = yield* Config.Service
const git = yield* Git.Service

const state = yield* InstanceState.make(
Effect.fn("FileWatcher.state")(
function* () {
Expand Down
Loading
Loading