Skip to content

Commit 4647aa8

Browse files
authored
effectify Worktree service (anomalyco#18679)
1 parent a379eb3 commit 4647aa8

File tree

5 files changed

+609
-478
lines changed

5 files changed

+609
-478
lines changed

packages/opencode/specs/effect-migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Still open and likely worth migrating:
164164
- [x] `Plugin`
165165
- [x] `ToolRegistry`
166166
- [ ] `Pty`
167-
- [ ] `Worktree`
167+
- [x] `Worktree`
168168
- [ ] `Bus`
169169
- [x] `Command`
170170
- [ ] `Config`

packages/opencode/src/control-plane/adaptors/worktree.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ export const WorktreeAdaptor: Adaptor = {
2222
},
2323
async create(info) {
2424
const config = Config.parse(info)
25-
const bootstrap = await Worktree.createFromInfo({
25+
await Worktree.createFromInfo({
2626
name: config.name,
2727
directory: config.directory,
2828
branch: config.branch,
2929
})
30-
return bootstrap()
3130
},
3231
async remove(info) {
3332
const config = Config.parse(info)

packages/opencode/src/server/routes/experimental.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const ExperimentalRoutes = lazy(() =>
108108
...errors(400),
109109
},
110110
}),
111-
validator("json", Worktree.create.schema),
111+
validator("json", Worktree.CreateInput.optional()),
112112
async (c) => {
113113
const body = c.req.valid("json")
114114
const worktree = await Worktree.create(body)
@@ -155,7 +155,7 @@ export const ExperimentalRoutes = lazy(() =>
155155
...errors(400),
156156
},
157157
}),
158-
validator("json", Worktree.remove.schema),
158+
validator("json", Worktree.RemoveInput),
159159
async (c) => {
160160
const body = c.req.valid("json")
161161
await Worktree.remove(body)
@@ -181,7 +181,7 @@ export const ExperimentalRoutes = lazy(() =>
181181
...errors(400),
182182
},
183183
}),
184-
validator("json", Worktree.reset.schema),
184+
validator("json", Worktree.ResetInput),
185185
async (c) => {
186186
const body = c.req.valid("json")
187187
await Worktree.reset(body)

0 commit comments

Comments
 (0)