import { Context, Layer, Option, Schema } from 'effect'; import { runtime } from 'effect/unstable/reactivity/Atom'; import { EditReplacement } from '../EditReplacement.ts'; export namespace MatcherInput { export class Value extends Schema.Class('MatcherInput')({ filePath: Schema.Option(Schema.String), content: Schema.Option(Schema.String), changedSpans: Schema.Option(Schema.Array(EditReplacement.Span)), command: Schema.Option(Schema.String), pattern: Schema.Option(Schema.String), query: Schema.Option(Schema.String), url: Schema.Option(Schema.String), prompt: Schema.Option(Schema.String) }) {} export class Current extends Context.Service()( 'pi-harness-kit/kernel/MatcherInput/Current' ) {} export const empty = () => new Value({ filePath: Option.none(), content: Option.none(), changedSpans: Option.none(), command: Option.none(), pattern: Option.none(), query: Option.none(), url: Option.none(), prompt: Option.none() }); export const layer = (value: Value) => Layer.succeed(Current, Current.of(value)); export const atomRuntime = (value: Value) => runtime(layer(value)); }