import type React from "react"; import type { BunSQLiteDatabase } from "drizzle-orm/bun-sqlite"; import type { Sequence as BaseSequence, Parallel as BaseParallel, MergeQueue as BaseMergeQueue, Branch as BaseBranch, Loop as BaseLoop, Ralph as BaseRalph, ContinueAsNew as BaseContinueAsNew, continueAsNew as baseContinueAsNew, Worktree as BaseWorktree, Timer as BaseTimer, } from "@smithers-orchestrator/components"; import type { ApprovalProps } from "@smithers-orchestrator/components/components/ApprovalProps"; import type { DepsSpec } from "@smithers-orchestrator/components/components/DepsSpec"; import type { SandboxProps } from "@smithers-orchestrator/components/components/SandboxProps"; import type { SignalProps } from "@smithers-orchestrator/components/components/SignalProps"; import type { TaskProps } from "@smithers-orchestrator/components/components/TaskProps"; import type { WorkflowProps } from "@smithers-orchestrator/components/components/WorkflowProps"; import type { SmithersWorkflow } from "@smithers-orchestrator/components/SmithersWorkflow"; import type { SmithersWorkflowOptions } from "@smithers-orchestrator/scheduler/SmithersWorkflowOptions"; import type { SmithersCtx } from "@smithers-orchestrator/driver/SmithersCtx"; import type { z } from "zod"; /** Union of all Zod schema values registered in the schema, constrained to ZodObject. */ type SchemaOutput = Extract>; type RuntimeSchema = Schema extends { input: infer Input } ? Omit & { input: Input extends z.ZodTypeAny ? z.infer : Input; } : Schema; export type CreateSmithersApi = { Workflow: (props: WorkflowProps) => React.ReactElement; Approval: (props: ApprovalProps>) => React.ReactElement; Task: ( props: TaskProps, D>, ) => React.ReactElement; Sequence: typeof BaseSequence; Parallel: typeof BaseParallel; MergeQueue: typeof BaseMergeQueue; Branch: typeof BaseBranch; Loop: typeof BaseLoop; Ralph: typeof BaseRalph; ContinueAsNew: typeof BaseContinueAsNew; continueAsNew: typeof baseContinueAsNew; Worktree: typeof BaseWorktree; Sandbox: (props: SandboxProps) => React.ReactElement; Signal: >( props: SignalProps, ) => React.ReactElement; Timer: typeof BaseTimer; useCtx: () => SmithersCtx>; smithers: ( build: (ctx: SmithersCtx>) => React.ReactElement, opts?: SmithersWorkflowOptions, ) => SmithersWorkflow>; db: BunSQLiteDatabase>; tables: { [K in keyof Schema]: unknown }; outputs: { [K in keyof Schema]: Schema[K] }; };