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
@@ -10,10 +10,7 @@ const WorktreeConfig = Schema.Struct({
const decodeWorktreeConfig = Schema.decodeUnknownSync(WorktreeConfig) const decodeWorktreeConfig = Schema.decodeUnknownSync(WorktreeConfig)
async function loadWorktree() { async function loadWorktree() {
const [{ AppRuntime }, { Worktree }] = await Promise.all([ const [{ AppRuntime }, { Worktree }] = await Promise.all([import("@/effect/app-runtime"), import("@/worktree")])
import("@/effect/app-runtime"),
import("@/worktree"),
])
return { AppRuntime, Worktree } return { AppRuntime, Worktree }
} }
@@ -34,7 +31,10 @@ export const WorktreeAdapter: WorkspaceAdapter = {
async configure(info, context) { async configure(info, context) {
const { AppRuntime, Worktree } = await loadWorktree() const { AppRuntime, Worktree } = await loadWorktree()
const next = await AppRuntime.runPromise( 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 { return {
...info, ...info,
@@ -62,7 +62,12 @@ export const WorktreeAdapter: WorkspaceAdapter = {
const { AppRuntime, Worktree } = await loadWorktree() const { AppRuntime, Worktree } = await loadWorktree()
const ctx = requireInstance(context) const ctx = requireInstance(context)
return ( 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) => ({ ).map((info) => ({
type: "worktree", type: "worktree",
name: info.name, name: info.name,
@@ -75,7 +80,10 @@ export const WorktreeAdapter: WorkspaceAdapter = {
const { AppRuntime, Worktree } = await loadWorktree() const { AppRuntime, Worktree } = await loadWorktree()
const config = decodeWorktreeConfig(info) const config = decodeWorktreeConfig(info)
await AppRuntime.runPromise( 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) { target(info) {
+6 -1
View File
@@ -28,7 +28,12 @@ export const bind = <Args extends readonly unknown[], Result>(fn: (...args: Args
const captured = captureSync() const captured = captureSync()
return (...args: Args) => return (...args: Args) =>
restoreWorkspace(captured.workspace, () => restoreWorkspace(captured.workspace, () =>
Effect.runSync(attachWith(Effect.sync(() => fn(...args)), captured)), Effect.runSync(
attachWith(
Effect.sync(() => fn(...args)),
captured,
),
),
) )
} }
+3 -3
View File
@@ -174,9 +174,9 @@ export async function create(input: {
const updatePushDiagnostics = (filePath: string, next: Diagnostic[]) => { const updatePushDiagnostics = (filePath: string, next: Diagnostic[]) => {
pushDiagnostics.set(filePath, next) pushDiagnostics.set(filePath, next)
void busRuntime.runPromise((svc) => void busRuntime.runPromise((svc) =>
svc.publish(Event.Diagnostics, { path: filePath, serverID: input.serverID }).pipe( svc
Effect.provideService(InstanceRef, instance), .publish(Event.Diagnostics, { path: filePath, serverID: input.serverID })
), .pipe(Effect.provideService(InstanceRef, instance)),
) )
} }
const updatePullDiagnostics = (filePath: string, next: Diagnostic[]) => { const updatePullDiagnostics = (filePath: string, next: Diagnostic[]) => {