chore: generate

This commit is contained in:
opencode-agent[bot]
2026-03-26 00:56:34 +00:00
parent ea04b23745
commit 31ad6e85ba
5 changed files with 49 additions and 53 deletions

View File

@@ -159,22 +159,20 @@ export namespace Vcs {
const value = { current, root }
log.info("initialized", { branch: value.current, default_branch: value.root?.name })
yield* bus
.subscribe(FileWatcher.Event.Updated)
.pipe(
Stream.filter((evt) => evt.properties.file.endsWith("HEAD")),
Stream.runForEach((_evt) =>
Effect.gen(function* () {
const next = yield* Effect.promise(() => get())
if (next !== value.current) {
log.info("branch changed", { from: value.current, to: next })
value.current = next
yield* bus.publish(Event.BranchUpdated, { branch: next })
}
}),
),
Effect.forkScoped,
)
yield* bus.subscribe(FileWatcher.Event.Updated).pipe(
Stream.filter((evt) => evt.properties.file.endsWith("HEAD")),
Stream.runForEach((_evt) =>
Effect.gen(function* () {
const next = yield* Effect.promise(() => get())
if (next !== value.current) {
log.info("branch changed", { from: value.current, to: next })
value.current = next
yield* bus.publish(Event.BranchUpdated, { branch: next })
}
}),
),
Effect.forkScoped,
)
return value
}),