Move service state into InstanceState, flatten service facades#18483
Merged
kitlangton merged 34 commits intodevfrom Mar 21, 2026
Merged
Move service state into InstanceState, flatten service facades#18483kitlangton merged 34 commits intodevfrom
kitlangton merged 34 commits intodevfrom
Conversation
…delete runtime - File service: InstanceState for cache/fiber, flatten index.ts + service.ts - FileWatcher: wrap subscription setup in InstanceState, add init() - Question: flatten index.ts + service.ts - ProviderAuth: flatten auth.ts + auth-service.ts, remove fn() wrappers - Account CLI: use Account.runPromise instead of runtime - Delete effect/runtime.ts and effect/instances.ts (no more centralized runtime) - Delete runtime.test.ts (no longer applicable)
…ades - FileWatcher, Vcs, Installation: move runPromise inside namespace - Truncate: flatten truncate-effect.ts → truncate.ts - Account: flatten effect.ts → index.ts - Server: use Vcs.branch() facade instead of raw runPromise - Auth stays split (dual Schema/Zod types)
…pose, mutation isolation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InstanceStateas a centralized Effect cache for per-instance service state, replacing scattered module-level mutable staterunService) for global singleton services (format, question)service.tsinto the main module index for permission, snapshot, format, skill, file, and othersruntime.tsandinstances.tsmodulesPermissionNexttoPermissionTest plan
bun run test)bun run typecheck)InstanceStateandrunService