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.27",
"version": "1.14.28",
"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.27",
"version": "1.14.28",
"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.27",
"version": "1.14.28",
"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.27",
"version": "1.14.28",
"$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.27",
"version": "1.14.28",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/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.27",
"version": "1.14.28",
"name": "@opencode-ai/core",
"type": "module",
"license": "MIT",
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.27",
"version": "1.14.28",
"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.27",
"version": "1.14.28",
"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.27",
"version": "1.14.28",
"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.27"
version = "1.14.28"
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.27/opencode-darwin-arm64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.28/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.27/opencode-darwin-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.28/opencode-darwin-x64.zip"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.linux-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.27/opencode-linux-arm64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.28/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.27/opencode-linux-x64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.28/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.27/opencode-windows-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.28/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.27",
"version": "1.14.28",
"$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.27",
"version": "1.14.28",
"name": "opencode",
"type": "module",
"license": "MIT",
Expand Down
11 changes: 7 additions & 4 deletions packages/opencode/src/project/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export const layer: Layer.Layer<
type DiscoveryResult = { id: ProjectID; worktree: string; sandbox: string; vcs: Info["vcs"] }

const data: DiscoveryResult = yield* Effect.gen(function* () {
const dotjj = (yield* fs.up({ targets: [".jj"], start: directory }).pipe(Effect.orDie))[0]
const jjRoot = dotjj ? pathSvc.dirname(dotjj) : undefined
const activeSandbox = (root: string) => (jjRoot && AppFileSystem.contains(root, jjRoot) ? jjRoot : root)
const dotgitMatches = yield* fs.up({ targets: [".git"], start: directory }).pipe(Effect.orDie)
const dotgit = dotgitMatches[0]

Expand All @@ -208,7 +211,7 @@ export const layer: Layer.Layer<
return {
id: id ?? ProjectID.global,
worktree: sandbox,
sandbox,
sandbox: activeSandbox(sandbox),
vcs: fakeVcs,
}
}
Expand All @@ -218,7 +221,7 @@ export const layer: Layer.Layer<
return {
id: id ?? ProjectID.global,
worktree: sandbox,
sandbox,
sandbox: activeSandbox(sandbox),
vcs: fakeVcs,
}
}
Expand Down Expand Up @@ -246,7 +249,7 @@ export const layer: Layer.Layer<
}

if (!id) {
return { id: ProjectID.global, worktree: sandbox, sandbox, vcs: "git" as const }
return { id: ProjectID.global, worktree: sandbox, sandbox: activeSandbox(sandbox), vcs: "git" as const }
}

const topLevel = yield* git(["rev-parse", "--show-toplevel"], { cwd: sandbox })
Expand All @@ -258,7 +261,7 @@ export const layer: Layer.Layer<
vcs: fakeVcs,
}
}
sandbox = resolveGitPath(sandbox, topLevel.text.trim())
sandbox = activeSandbox(resolveGitPath(sandbox, topLevel.text.trim()))

return { id, sandbox, worktree, vcs: "git" as const }
})
Expand Down
15 changes: 15 additions & 0 deletions packages/opencode/test/project/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test"
import { Project } from "../../src/project"
import { Log } from "../../src/util"
import { $ } from "bun"
import * as fs from "fs/promises"
import path from "path"
import { tmpdir } from "../fixture/fixture"
import { GlobalBus } from "../../src/bus/global"
Expand Down Expand Up @@ -175,6 +176,20 @@ describe("Project.fromDirectory with worktrees", () => {
}
})

test("uses nested jj workspace as sandbox while keeping parent git project root", async () => {
await using tmp = await tmpdir({ git: true })

const workspace = path.join(tmp.path, ".dmux", "worktrees", "feature")
await fs.mkdir(path.join(workspace, ".jj"), { recursive: true })

const { project, sandbox } = await run((svc) => svc.fromDirectory(workspace))

expect(project.worktree).toBe(tmp.path)
expect(sandbox).toBe(workspace)
expect(project.sandboxes).toContain(workspace)
expect(project.sandboxes).not.toContain(tmp.path)
})

test("worktree should share project ID with main repo", async () => {
await using tmp = await tmpdir({ git: true })

Expand Down
27 changes: 27 additions & 0 deletions packages/opencode/test/tool/apply_patch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,33 @@ describe("tool.apply_patch freeform", () => {
})
})

test("uses jj workspace root for display paths", async () => {
await using fixture = await tmpdir({ git: true })
const { ctx, calls } = makeCtx()

const workspace = path.join(fixture.path, ".dmux", "worktrees", "feature")
await fs.mkdir(path.join(workspace, ".jj"), { recursive: true })

await Instance.provide({
directory: workspace,
fn: async () => {
await fs.mkdir(path.join(workspace, "src"), { recursive: true })
await fs.writeFile(path.join(workspace, "src", "example.ts"), "const value = 1\n", "utf-8")

const result = await execute(
{
patchText: "*** Begin Patch\n*** Update File: src/example.ts\n@@\n-const value = 1\n+const value = 2\n*** End Patch",
},
ctx,
)

expect(calls[0].metadata.files[0]?.relativePath).toBe("src/example.ts")
expect(result.output).toContain("M src/example.ts")
expect(result.output).not.toContain(".dmux/worktrees/feature")
},
})
})

test("applies multiple hunks to one file", async () => {
await using fixture = await tmpdir()
const { ctx } = makeCtx()
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/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/plugin",
"version": "1.14.27",
"version": "1.14.28",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
Loading