chore: generate

This commit is contained in:
opencode-agent[bot] 2026-05-15 17:37:07 +00:00
parent 0c9cfe923f
commit 48293c5271
3 changed files with 24 additions and 11 deletions

View File

@ -10,10 +10,7 @@ const WorktreeConfig = Schema.Struct({
const decodeWorktreeConfig = Schema.decodeUnknownSync(WorktreeConfig)
async function loadWorktree() {
const [{ AppRuntime }, { Worktree }] = await Promise.all([
import("@/effect/app-runtime"),
import("@/worktree"),
])
const [{ AppRuntime }, { Worktree }] = await Promise.all([import("@/effect/app-runtime"), import("@/worktree")])
return { AppRuntime, Worktree }
}
@ -34,7 +31,10 @@ export const WorktreeAdapter: WorkspaceAdapter = {
async configure(info, context) {
const { AppRuntime, Worktree } = await loadWorktree()
const next = await AppRuntime.runPromise(
provideContext(Worktree.Service.use((svc) => svc.makeWorktreeInfo({ detached: true })), context),
provideContext(
Worktree.Service.use((svc) => svc.makeWorktreeInfo({ detached: true })),
context,
),
)
return {
...info,
@ -62,7 +62,12 @@ export const WorktreeAdapter: WorkspaceAdapter = {
const { AppRuntime, Worktree } = await loadWorktree()
const ctx = requireInstance(context)
return (
await AppRuntime.runPromise(provideContext(Worktree.Service.use((svc) => svc.list()), context))
await AppRuntime.runPromise(
provideContext(
Worktree.Service.use((svc) => svc.list()),
context,
),
)
).map((info) => ({
type: "worktree",
name: info.name,
@ -75,7 +80,10 @@ export const WorktreeAdapter: WorkspaceAdapter = {
const { AppRuntime, Worktree } = await loadWorktree()
const config = decodeWorktreeConfig(info)
await AppRuntime.runPromise(
provideContext(Worktree.Service.use((svc) => svc.remove({ directory: config.directory })), context),
provideContext(
Worktree.Service.use((svc) => svc.remove({ directory: config.directory })),
context,
),
)
},
target(info) {

View File

@ -28,7 +28,12 @@ export const bind = <Args extends readonly unknown[], Result>(fn: (...args: Args
const captured = captureSync()
return (...args: Args) =>
restoreWorkspace(captured.workspace, () =>
Effect.runSync(attachWith(Effect.sync(() => fn(...args)), captured)),
Effect.runSync(
attachWith(
Effect.sync(() => fn(...args)),
captured,
),
),
)
}

View File

@ -174,9 +174,9 @@ export async function create(input: {
const updatePushDiagnostics = (filePath: string, next: Diagnostic[]) => {
pushDiagnostics.set(filePath, next)
void busRuntime.runPromise((svc) =>
svc.publish(Event.Diagnostics, { path: filePath, serverID: input.serverID }).pipe(
Effect.provideService(InstanceRef, instance),
),
svc
.publish(Event.Diagnostics, { path: filePath, serverID: input.serverID })
.pipe(Effect.provideService(InstanceRef, instance)),
)
}
const updatePullDiagnostics = (filePath: string, next: Diagnostic[]) => {