mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-26 15:55:45 +00:00
- Rewrite all account CLI commands (login, logout, switch, orgs) as Effect.fn with AccountService accessed directly via yield* - Convert PollResult from plain object union to Schema.TaggedClass variants with Schema.Union and Match.valueTags for exhaustive matching - Add recursive poll function for device auth flow (stack-safe via Effect trampolining) - Add shared Effect runtime at src/effect/runtime.ts - Add Effect wrappers for @clack/prompts at src/cli/effect/prompt.ts - Add @effect/language-service TS plugin for editor support - Refactor repo tests to use testEffect helper with Layer-based setup - Parallelize org fetching in orgs command Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8 lines
290 B
TypeScript
8 lines
290 B
TypeScript
import { test } from "bun:test"
|
|
import { Effect, Layer } from "effect"
|
|
|
|
export const testEffect = <R, E>(layer: Layer.Layer<R, E, never>) => ({
|
|
effect: <A, E2>(name: string, value: Effect.Effect<A, E2, R>) =>
|
|
test(name, () => Effect.runPromise(value.pipe(Effect.provide(layer)))),
|
|
})
|