import { Context, Effect, Layer } from "effect";
import { type Executor, type ExecutorConfig } from "./executor";
import type { FumaDb } from "./fuma-runtime";
import { type AnyPlugin } from "./plugin";
import type { SqliteTestFumaDb } from "./sqlite-test-db";
export type TestDatabaseBackend = "sqlite";
export type TestFumaDb = Pick<SqliteTestFumaDb, "db" | "close"> & {
    readonly warm: () => Promise<void>;
};
/** The OAuth callback the in-memory test executor advertises. The OAuth flow
 *  tests exercise `start` (authorization_code), which now REQUIRES an explicit
 *  `redirectUri` — there is no localhost default. The test authorization server
 *  accepts any redirect_uri for an unregistered client, so this stable value is
 *  what the test AS echoes back. Tests asserting the "missing redirectUri fails
 *  loudly" path override this with `redirectUri: null`. */
export declare const TEST_OAUTH_REDIRECT_URI = "http://localhost/oauth/callback";
export type TestConfigOptions<TPlugins extends readonly AnyPlugin[] = readonly []> = {
    readonly tenant?: string;
    readonly subject?: string | null;
    readonly plugins?: TPlugins;
    readonly backend?: TestDatabaseBackend;
    readonly dataDir?: string;
    readonly coreTools?: ExecutorConfig<TPlugins>["coreTools"];
    /** Override the OAuth callback URL. Pass `null` to construct an executor with
     *  no OAuth callback (exercises the fail-loud redirect path). */
    readonly redirectUri?: string | null;
};
export declare const makeTestConfig: <const TPlugins extends readonly AnyPlugin[] = readonly []>(options?: TestConfigOptions<TPlugins>) => Omit<ExecutorConfig<TPlugins>, "db"> & {
    readonly db: FumaDb;
    readonly testDb: TestFumaDb;
};
export interface TestWorkspaceHarness<TPlugins extends readonly AnyPlugin[] = readonly AnyPlugin[]> {
    readonly config: ExecutorConfig<TPlugins> & {
        readonly testDb: TestFumaDb;
    };
    readonly executor: Executor<TPlugins>;
    readonly testDb: TestFumaDb;
    readonly tenant: string;
    readonly subject: string | null;
}
declare const TestWorkspace_base: Context.ServiceClass<TestWorkspace, "executor-sdk/TestWorkspace", TestWorkspaceHarness<readonly AnyPlugin[]>>;
export declare class TestWorkspace extends TestWorkspace_base {
    static readonly current: <const TPlugins extends readonly AnyPlugin[] = readonly AnyPlugin[]>() => Effect.Effect<TestWorkspaceHarness<TPlugins>, never, TestWorkspace>;
}
export declare const makeTestWorkspaceHarness: <const TPlugins extends readonly AnyPlugin[] = readonly []>(options?: TestConfigOptions<TPlugins>) => Effect.Effect<{
    readonly config: Omit<ExecutorConfig<TPlugins>, "db"> & {
        readonly db: FumaDb;
        readonly testDb: TestFumaDb;
    };
    readonly executor: Executor<TPlugins>;
    readonly testDb: TestFumaDb;
    readonly tenant: string;
    readonly subject: string | null;
}, import("./fuma-runtime").StorageFailure, import("effect/Scope").Scope>;
export declare const makeTestWorkspaceLayer: <const TPlugins extends readonly AnyPlugin[] = readonly []>(options?: TestConfigOptions<TPlugins>) => Layer.Layer<TestWorkspace, import("./fuma-runtime").StorageFailure, never>;
export declare const makeTestExecutor: <const TPlugins extends readonly AnyPlugin[] = readonly []>(options?: TestConfigOptions<TPlugins>) => Effect.Effect<Executor<TPlugins>, import("./fuma-runtime").StorageFailure, import("effect/Scope").Scope>;
/** Built-in in-memory writable credential provider, contributed as a plugin
 *  so tests always have a default writable store for inline connection values. */
export declare const memoryCredentialsPlugin: import("./plugin").ConfiguredPlugin<"memory-credentials", object, {}, {}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
export {};
//# sourceMappingURL=test-config.d.ts.map