/** @effect-diagnostics anyUnknownInErrorContext:off */ import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Scope from "effect/Scope"; import type { Platform } from "../../Platform.ts"; import type { ResourceClassLike, ResourceLike } from "../../Resource.ts"; /** * The AWS dev sidecar entry URL ([Local.ts](./Local.ts)) — every * {@link makeDevWatchProvider} consumer passes this so all floci dev * providers share ONE sidecar process. */ export declare const flociSidecarEntry: () => string; /** A diff decision produced by {@link DevWatchSpec.replaceOn}. */ export interface DevReplaceDecision { readonly action: "replace"; readonly deleteFirst?: boolean; } /** * The context handed to {@link DevWatchSpec.startWatch}. Runs inside the * sidecar with the floci override services provided. */ export interface DevWatchContext { readonly id: string; readonly instanceId: string; /** The resolved props of the reconcile that started this watcher. */ readonly news: Props; /** Attributes at watch start. */ readonly attrs: Attrs; /** The freshest attributes (updated by {@link rerunReconcile}). */ readonly currentAttrs: Effect.Effect; /** * Re-runs the wrapped LIVE reconcile with the latest engine input * (props/bindings) and the current attributes as `output`, records and * returns the fresh attributes. Serialized with engine reconciles/deletes * on the same logical id. */ readonly rerunReconcile: Effect.Effect; } /** * The per-resource contract for {@link makeDevWatchProvider}: everything the * shared skeleton cannot know about the resource. */ export interface DevWatchSpec { /** * The LIVE provider layer (e.g. `() => FunctionProvider()`). Built inside * the floci override context and endpoint-wrapped, exactly like the plain * `flociDual` resources. */ readonly liveProvider: () => Layer.Layer; /** * Extra service layers built alongside {@link flociServices} inside the * override context (e.g. Lambda's fresh `AssetsLive`, whose cached bucket * lookup must resolve against the emulator and never share a cache with * the live arm's instance). */ readonly services?: Layer.Layer; /** * The restart surface of the watch loop: everything that changes WHAT the * watcher builds or WHERE it publishes. Plain, canonically-hashable data * only — closures degrade to stable placeholders under * {@link canonicalHash}. `news` arrives {@link stripEffects}-stripped. */ readonly watchConfigOf: (news: Props, attrs: Attrs) => unknown; /** * Resource-specific replacement rules, mirroring the LIVE diff's cheap * checks (never bundling/building). Checked before the generic dev policy. */ readonly replaceOn?: (input: { id: string; olds: Props; news: Props; output: Attrs; }) => Effect.Effect; /** * Normalization applied to both sides before the structural code-only * `noop` equivalence check (e.g. Lambda resolves layer references to ARNs). * @default identity */ readonly normalizeProps?: (props: Props) => unknown; /** * Pin `precreate`'s news to a stub-compatible shape (Lambda pins the * handler-affecting props to the 503 stub's own single-module shape). * Only consulted when the live provider implements `precreate`. */ readonly transformPrecreateNews?: (news: Props) => Props; /** * The watch loop, forked (detached, in the provider scope) after every * successful reconcile that changes the watch config. Runs with the floci * override services provided; failures are logged, never propagated. A * spec with nothing to watch for a given props shape simply returns. */ readonly startWatch: (ctx: DevWatchContext) => Effect.Effect; } /** * Build an RPC-sidecar-hosted `alchemy dev` provider that delegates its * lifecycle to the LIVE provider inside the floci override context and owns * a per-resource watch loop. See the module doc for the exact split between * the shared skeleton and the {@link DevWatchSpec}. */ export declare const makeDevWatchProvider: (cls: ResourceClassLike | Platform, serverEntryUrl: string, spec: DevWatchSpec) => Layer.Layer, never, import("../../AlchemyContext.ts").AlchemyContext | import("../../Artifacts.ts").ArtifactStore | Scope.Scope | import("../../Stack.ts").Stack>; //# sourceMappingURL=DevWatchProvider.d.ts.map