Skip to content
RELKIT
Esc
↑↓navigate↵open⌘Jpreview
On this page

Project generator API

Generated public TypeScript reference for create-relkit.

For configuration and examples, read automation.

Public imports

  • create-relkit — 113 exports
  • create-relkit/cli — 1 exports
  • create-relkit/launcher — 1 exports
  • create-relkit/catalog-resolution — 2 exports

All exported APIs

Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API’s inline sample, a maintained repository usage, or the shared module walkthrough.

API Kind Import from Example
ADD_FAILURE_CODES Value create-relkit Source example
ADD_KINDS Value create-relkit Module example
AddFailureCode Type create-relkit Module example
AddKind Type create-relkit Module example
AddRequest Type create-relkit Module example
AddRequestBase Type create-relkit Module example
AddResult Type create-relkit Module example
AddScaffoldError Value create-relkit Source example
assertCreateCapability Value create-relkit Source example
CatalogManifest Type create-relkit, create-relkit/catalog-resolution Module example
ChoicePromptOptions Type create-relkit Module example
CREATE_CAPABILITY_TABLE Value create-relkit Source example
CREATE_CLOUDS Value create-relkit Module example
CREATE_DEPLOYMENTS Value create-relkit Module example
CREATE_JOBS Value create-relkit Module example
CREATE_OPTION_DEFAULTS Value create-relkit Source example
CREATE_TEMPLATES Value create-relkit Source example
CreateCapabilityEvidence Type create-relkit Module example
CreateCapabilityIdentity Type create-relkit Module example
CreateCapabilityTuple Type create-relkit Module example
createClackPromptDriver Value create-relkit Module example
CreateCloud Type create-relkit Module example
CreateDeployment Type create-relkit Module example
createGenerateNextSteps Value create-relkit Source example
CreateJobs Type create-relkit Module example
CreateOptions Type create-relkit Source example
CreateOptionsContext Type create-relkit Module example
CreateOptionsError Value create-relkit Module example
CreateScaffoldPlan Type create-relkit Module example
CreateTemplate Type create-relkit Module example
CreateValidationContext Type create-relkit Module example
CreateValidationError Value create-relkit Module example
currentCreateCapabilityIdentity Value create-relkit Source example
DatabaseDialect Type create-relkit Module example
DependencySection Type create-relkit Module example
domainError Value create-relkit Module example
domainTry Value create-relkit Source example
errorMessage Value create-relkit Module example
formatCreatePlan Value create-relkit Module example
formatGenerateResult Value create-relkit Source example
GenerateCommandResult Type create-relkit Module example
GenerateCommandRunner Type create-relkit Module example
GenerateFailurePoint Type create-relkit Source example
GenerateNextSteps Type create-relkit Module example
generateProject Value create-relkit Source example
GenerateProjectContext Type create-relkit Source example
generateProjectEffect Value create-relkit Source example
GenerateProjectError Value create-relkit Source example
GenerateProjectResult Type create-relkit Module example
GeneratorCleanupFailure Type create-relkit Module example
generatorCleanupFailures Value create-relkit Source example
GeneratorCommandResult Type create-relkit Module example
GeneratorCommandRunner Type create-relkit Module example
GeneratorDirectoryEntry Type create-relkit Module example
GeneratorDomainError Value create-relkit Module example
GeneratorEntryKind Type create-relkit Module example
GeneratorFileMetadata Type create-relkit Module example
GeneratorFileSystem Value create-relkit API example
generatorFileSystemLive Value create-relkit Source example
GeneratorFileSystemService Type create-relkit Source example
GeneratorIoError Value create-relkit Source example
GeneratorPaths Value create-relkit Source example
generatorPathsLive Value create-relkit Source example
GeneratorPathsService Type create-relkit Module example
GeneratorProcess Value create-relkit API example
GeneratorProcessError Value create-relkit Source example
generatorProcessLayer Value create-relkit Module example
generatorProcessLive Value create-relkit Source example
GeneratorProcessService Type create-relkit Module example
GeneratorPrompt Value create-relkit Source example
GeneratorPromptError Value create-relkit Module example
generatorPromptLayer Value create-relkit API example
GeneratorPromptService Type create-relkit Module example
hasErrno Value create-relkit Module example
isValidPackageName Value create-relkit Source example
launchBun Value create-relkit/launcher Module example
main Value create-relkit/cli Module example
normalizeCreateOptions Value create-relkit Source example
planCreate Value create-relkit Source example
planCreateEffect Value create-relkit Module example
ProjectGeneration Value create-relkit Module example
projectGenerationLive Value create-relkit Source example
PromptDriver Type create-relkit Source example
PromptOption Type create-relkit Module example
publicFailure Value create-relkit Source example
recordCleanupFailure Value create-relkit Source example
resolveCatalogVersion Value create-relkit, create-relkit/catalog-resolution Module example
ResolveCreateContext Type create-relkit Module example
resolveCreateDestination Value create-relkit Module example
resolveCreateDestinationEffect Value create-relkit Module example
resolveCreateOptions Value create-relkit Module example
resolveCreateOptionsDetails Value create-relkit Source example
resolveCreateOptionsDetailsEffect Value create-relkit Module example
ResolvedCreateOptions Type create-relkit Module example
resolveTemplateRoot Value create-relkit Module example
resolveTemplateRootEffect Value create-relkit Module example
RouteMethod Type create-relkit Module example
SCAFFOLD_DEPENDENCIES Value create-relkit Source example
scaffoldDependency Value create-relkit Module example
ScaffoldDependency Type create-relkit Module example
ScaffoldDependencyName Type create-relkit Source example
scaffoldErrors Value create-relkit Module example
ScaffoldFileOperation Type create-relkit Module example
ScaffoldPlan Type create-relkit Source example
ScaffoldVerification Type create-relkit Module example
ScaffoldWarning Type create-relkit Module example
ServiceInclude Type create-relkit Module example
supported Value create-relkit Module example
supportedCreateTemplates Value create-relkit Source example
TextPromptOptions Type create-relkit Module example
transferCleanupFailures Value create-relkit Module example
validateCreateOptions Value create-relkit Module example
validateCreateOptionsEffect Value create-relkit Module example
ValidatedCreateOptions Type create-relkit Module example
validatePackageName Value create-relkit Module example

add-transaction-files.ts

Snapshots, writes and restores transaction-owned files and lock artifacts using the creator filesystem service; rollback preserves original bytes and modes.

FileSnapshot

Signature

declare const FileSnapshot: FileSnapshot;

Source

applyFileOperations

Signature

declare const applyFileOperations: (
  root: string,
  operations: readonly ScaffoldFileOperation[],
  createdDirectories: Set<string>,
) => Promise<void>;

Source

applyFileOperationsEffect

Applies planned files in order; each temporary atomic-write asset has its own scope.

Signature

declare const applyFileOperationsEffect: (
  root: string,
  operations: ReadonlyArray<ScaffoldFileOperation>,
  createdDirectories: Set<string>,
) => Effect.Effect<void, GeneratorDomainError | GeneratorIoError, GeneratorFileSystem>;

Source

operationPath

Resolves one relative operation while rejecting broad and escaping paths.

Signature

declare const operationPath: (root: string, path: string) => string;

Source

restoreFiles

Signature

declare const restoreFiles: (
  snapshots: readonly FileSnapshot[],
  createdDirectories: ReadonlySet<string>,
) => Promise<void>;

Source

restoreFilesEffect

Restores all touched files even when one restoration fails, then removes only owned empty directories.

Signature

declare const restoreFilesEffect: (
  snapshots: ReadonlyArray<FileSnapshot>,
  createdDirectories: ReadonlySet<string>,
) => Effect.Effect<undefined, GeneratorIoError, GeneratorFileSystem>;

Source

snapshotFiles

Signature

declare const snapshotFiles: (
  root: string,
  operations: readonly ScaffoldFileOperation[],
  includeLock: boolean,
) => Promise<readonly FileSnapshot[]>;

Source

snapshotFilesEffect

Snapshots bytes and modes, including both Bun lock formats when installation is required.

Signature

declare const snapshotFilesEffect: (
  root: string,
  operations: ReadonlyArray<ScaffoldFileOperation>,
  includeLock: boolean,
) => Effect.Effect<
  Array<
    | { path: string; content?: never; mode?: never }
    | { path: string; content: Uint8Array<ArrayBufferLike>; mode: number }
  >,
  GeneratorDomainError | GeneratorIoError,
  GeneratorFileSystem
>;

Source

validateOperationActions

Signature

declare const validateOperationActions: (
  root: string,
  operations: readonly ScaffoldFileOperation[],
) => Promise<void>;

Source

validateOperationActionsEffect

Validates every destination before any transaction write, retaining deterministic error order.

Signature

declare const validateOperationActionsEffect: (
  root: string,
  operations: ReadonlyArray<ScaffoldFileOperation>,
) => Effect.Effect<void, GeneratorDomainError | GeneratorIoError, GeneratorFileSystem>;

Source

add-types.ts

Supported artifact kinds accepted by relkit add.

ADD_FAILURE_CODES

Stable public diagnostic codes for scaffold failure categories.

Signature

declare const ADD_FAILURE_CODES: Readonly<{
  readonly usage: "RELKIT_ADD_USAGE";
  readonly invalidProject: "RELKIT_ADD_INVALID_PROJECT";
  readonly collision: "RELKIT_ADD_COLLISION";
  readonly unsupportedSourceShape: "RELKIT_ADD_UNSUPPORTED_SOURCE_SHAPE";
  readonly installation: "RELKIT_ADD_INSTALLATION_FAILED";
  readonly validation: "RELKIT_ADD_VALIDATION_FAILED";
  readonly cancellation: "RELKIT_ADD_CANCELLED";
}>;

Source

ADD_KINDS

Supported artifact kinds accepted by relkit add.

Signature

declare const ADD_KINDS: readonly [
  "service",
  "function",
  "error",
  "event",
  "event-function",
  "task",
  "job",
  "cache",
  "bucket",
  "tool",
  "prompt",
  "agent",
  "constants",
  "route",
  "middleware",
  "transform",
  "database",
  "auth",
  "inspector",
];

Source

AddFailureCode (type alias)

Stable public diagnostic category of AddScaffoldError.

Signature

type AddFailureCode = (typeof ADD_FAILURE_CODES)[keyof typeof ADD_FAILURE_CODES];

Source

AddKind (type alias)

Supported relkit add artifact discriminant.

Signature

type AddKind = (typeof ADD_KINDS)[number];

Source

AddRequest (type alias)

Validated discriminated union of supported artifact scaffold requests.

Signature

type AddRequest =
  | NamedRequest<"service", { full: boolean; include: readonly ServiceInclude[] }>
  | NamedRequest<"function", { internal: boolean }>
  | NamedRequest<"error">
  | NamedRequest<"event", { internal: boolean; profile?: string }>
  | NamedRequest<
      "event-function",
      { event: string; delivery: "transient" | "durable"; profile?: string }
    >
  | NamedRequest<"task", { version: string; execution: "durable" | "retryable" }>
  | NamedRequest<"job", { target: string; profile?: string }>
  | NamedRequest<
      "cache",
      {
        profile?: string;
        provider?: "redis" | "cloudflare-kv";
        source?: "docker" | "connected" | "aws";
      }
    >
  | NamedRequest<
      "bucket",
      {
        profile?: string;
        provider?: "s3" | "cloudflare-r2";
        source?: "docker" | "connected" | "aws";
      }
    >
  | NamedRequest<
      "tool",
      {
        target: string;
        createFunction?: boolean;
        sideEffect: "none" | "read" | "write" | "external";
        approval: "never" | "on-write" | "always";
      }
    >
  | NamedRequest<"prompt", { text: readonly string[] }>
  | NamedRequest<
      "agent",
      {
        model?: string;
        tools: readonly string[];
        prompt?: string;
        instructions?: string;
      }
    >
  | NamedRequest<"constants">
  | (AddRequestBase & {
      readonly kind: "route";
      readonly path: string;
      readonly mode: "route" | "service-route";
      readonly maps: Readonly<Partial<Record<RouteMethod, string>>>;
    })
  | NamedRequest<"middleware", { path: string }>
  | NamedRequest<"transform">
  | (AddRequestBase & {
      readonly kind: "database";
      readonly orm: "drizzle";
      readonly dialect: DatabaseDialect;
      readonly authSchema?: boolean;
    })
  | (AddRequestBase & {
      readonly kind: "auth";
      readonly adapter: "better-auth";
      readonly databaseDialect: DatabaseDialect;
      readonly basePath: string;
    })
  /** Enables the development bridge and installs the project-local inspector UI. */
  | (AddRequestBase & { readonly kind: "inspector" });

Source

AddRequestBase (interface)

Project, installation and optional service selection shared by all add requests.

Signature

export interface AddRequestBase {
  readonly projectRoot: string;
  readonly service?: string;
  readonly createService?: string;
  readonly install: boolean;
}

Source

AddResult (interface)

Completed add transaction’s files, packages, warnings, verification and next steps.

Signature

export interface AddResult {
  readonly ok: true;
  readonly command: "add";
  readonly kind: AddKind;
  readonly projectRoot: string;
  readonly createdFiles: readonly string[];
  readonly updatedFiles: readonly string[];
  readonly installedPackages: readonly string[];
  readonly warnings: readonly ScaffoldWarning[];
  readonly verification: ScaffoldVerification;
  readonly nextSteps: readonly string[];
}

Source

AddScaffoldError (class)

Public scaffold failure retaining its stable code, name and category-specific exit status.

Signature

declare class AddScaffoldError { constructor(
    readonly code: AddFailureCode,
    message: string,
  ) }

Source

exitCode (property)

Signature

readonly exitCode: 1 | 2 | 130

Source

DatabaseDialect (type alias)

Supported database dialect for Drizzle and authentication scaffolds.

Signature

type DatabaseDialect = "sqlite" | "postgresql" | "mysql";

Source

RouteMethod (type alias)

Supported HTTP method used by generated route mappings.

Signature

type RouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";

Source

ScaffoldFileOperation (interface)

One ordered project-relative create/update operation with complete content and optional mode.

Signature

export interface ScaffoldFileOperation {
  readonly path: string;
  readonly action: "create" | "update";
  readonly content: string;
  readonly mode?: number;
}

Source

ScaffoldPlan (interface)

Complete conflict-checked request, ordered writes, concrete dependencies and follow-up details.

Signature

export interface ScaffoldPlan {
  readonly request: AddRequest;
  readonly projectRoot: string;
  readonly operations: readonly ScaffoldFileOperation[];
  readonly dependencies: Readonly<Record<string, string>>;
  readonly artifacts: readonly Readonly<{
    kind: string;
    path: string;
    id: string;
    binding: string;
  }>[];
  readonly profiles: readonly Readonly<{ capability: string; name: string }>[];
  readonly warnings: readonly ScaffoldWarning[];
  readonly nextSteps: readonly string[];
}

Source

ScaffoldVerification (type alias)

Public result of the requested post-mutation project check.

Signature

type ScaffoldVerification =
  | { readonly status: "passed"; readonly command: string }
  | { readonly status: "skipped"; readonly reason: string; readonly command: string };

Source

ScaffoldWarning (interface)

Stable warning category and user-facing message retained in plans and results.

Signature

export interface ScaffoldWarning {
  readonly code: string;
  readonly message: string;
}

Source

ServiceInclude (type alias)

Artifact kinds that can be included in a generic service scaffold.

Signature

type ServiceInclude = Exclude<
  AddKind,
  "service" | "database" | "auth" | "inspector" | "middleware" | "transform"
>;

Source

build-catalog.ts

buildCatalogDependency

Reads a concrete dependency version materialized into this package at build time.

Signature

declare const buildCatalogDependency: (name: string) => string;

Source

buildCatalogPatch

Validates the patch descriptor against its centrally materialized dependency version.

Signature

declare const buildCatalogPatch: (name: string) => DependencyPatchDescriptor;

Source

buildCatalogProvider

Reads a selected provider’s own version independently of the application API version.

Signature

declare const buildCatalogProvider: (name: string) => string;

Source

catalog-resolution.ts

CatalogManifest

Signature

declare const CatalogManifest: CatalogManifest;

Source

resolveCatalogVersion

Resolves one dependency against its owning default or named Bun catalog.

Throws

When the reference, catalog, or catalog entry is missing or recursive.

Signature

declare const resolveCatalogVersion: (
  manifest: CatalogManifest,
  name: string,
  spec: unknown,
) => string;

Source

catalog-resolution.types.ts

JSON package metadata accepted by the shared strict catalog resolver.

CatalogManifest (type alias)

JSON package metadata accepted by the shared strict catalog resolver.

Signature

type CatalogManifest = Record<string, unknown>;

Source

cli.ts

Builds the creator command presentation and signal scope around pure project creation, returning JSON or terminal results after owned work settles.

main

Runs the executable presentation boundary with invocation-owned signal listeners.

Signature

declare const main: (args: readonly string[]) => Promise<void>;

Source

create-capabilities.ts

Packaged creation support is an allow-list backed by exact packed readiness evidence. Candidate literals remain parseable so explicit unsupported requests can return a precise pre-staging diagnostic instead of masquerading as syntax errors.

CREATE_CAPABILITY_TABLE

Signature

declare const CREATE_CAPABILITY_TABLE: Readonly<{
  version: 1;
  entries: ReadonlyArray<CreateCapabilityEvidence>;
}>;

Source

CreateCapabilityEvidence

Signature

declare const CreateCapabilityEvidence: CreateCapabilityEvidence;

Source

CreateCapabilityIdentity

Signature

declare const CreateCapabilityIdentity: CreateCapabilityIdentity;

Source

CreateCapabilityTuple

Signature

declare const CreateCapabilityTuple: CreateCapabilityTuple;

Source

assertCreateCapability

Rejects missing or stale tuples before destination planning or installation.

Signature

declare const assertCreateCapability: (
  options: Pick<CreateOptions, "template" | "cloud" | "deploy" | "jobs" | "examples">,
  identity?: CreateCapabilityIdentity,
) => void;

Source

currentCreateCapabilityIdentity

Reads the executing SDK’s release and pinned dependency catalog without acquiring application clients.

Signature

declare const currentCreateCapabilityIdentity: () => CreateCapabilityIdentity;

Source

supported

Checks every field of a complete tuple and its exact tool identity.

Signature

declare const supported: (
  options: Pick<CreateOptions, "template" | "cloud" | "deploy" | "jobs" | "examples">,
  identity?: CreateCapabilityIdentity,
) => boolean;

Source

supportedCreateTemplates

Filters interactive template choices through the same evidence allow-list.

Signature

declare const supportedCreateTemplates: (
  options: PartialCreateCapability,
  identity?: CreateCapabilityIdentity,
) => readonly CreateTemplate[];

Source

create-capabilities.types.ts

Describes exact creation tuples and their recorded package, tool and template evidence identities.

CreateCapabilityEvidence (interface)

Offered tuple backed by complete fresh and restart measurements for its template bytes.

Signature

export interface CreateCapabilityEvidence extends CreateCapabilityTuple {
  /** Exact tool and package catalog identity measured by the recorded certification host. */
  readonly identity: CreateCapabilityIdentity;
  /** SHA-256 over ordered template paths and their complete bytes. */
  readonly templateDigest: string;
  /** Repository-relative complete 20-attempt fresh report. */
  readonly freshEvidence: string;
  /** Repository-relative complete 20-attempt restart report. */
  readonly restartEvidence: string;
}

Source

CreateCapabilityIdentity (interface)

Every field must match the running packaged tool before a tuple is offered.

Signature

export interface CreateCapabilityIdentity {
  /** Exact first-party release version. */
  readonly release: string;
  /** Pinned native Bun version. */
  readonly bun: string;
  /** Exact TypeScript package version. */
  readonly typescript: string;
  /** SHA-256 of the complete tool dependency catalog. */
  readonly packageCatalogDigest: string;
  /** Exact source template directory identity. */
  readonly template: string;
  /** Prepared-input snapshot protocol version. */
  readonly snapshotProtocol: number;
}

Source

CreateCapabilityTuple (interface)

Complete public creation combination; absence of jobs preserves the native no-jobs option.

Signature

export interface CreateCapabilityTuple {
  /** Authored starter selected by the public CLI. */
  readonly template: CreateOptions["template"];
  /** Explicit cloud ownership selection. */
  readonly cloud: CreateOptions["cloud"];
  /** Explicit deployment engine selection. */
  readonly deploy: CreateOptions["deploy"];
  /** Optional durable-job integration selection. */
  readonly jobs?: CreateOptions["jobs"];
  /** Whether the starter's example sources are retained. */
  readonly examples: boolean;
}

Source

PartialCreateCapability (type alias)

Unresolved interactive choices used only to filter certified complete tuples.

Signature

type PartialCreateCapability = Readonly<{
  /** Optional starter choice. */
  template?: string;
  /** Optional cloud choice. */
  cloud?: string;
  /** Optional deployment choice. */
  deploy?: string;
  /** Optional job choice; undefined retains the native prompt semantics. */
  jobs?: string | undefined;
  /** Optional example choice. */
  examples?: boolean;
}>;

Source

create-preview.ts

Builds a no-install creation preview from maintained template bytes and metadata without importing or evaluating authored template configuration.

CreateScaffoldPlan

Signature

declare const CreateScaffoldPlan: CreateScaffoldPlan;

Source

formatCreatePlan

Formats an immutable preview as the existing human-readable terminal output.

Signature

declare const formatCreatePlan: (plan: CreateScaffoldPlan) => string;

Source

planCreate

Preserves the existing preview Promise API.

Signature

declare const planCreate: (
  options: CreateOptions,
  context?: Pick<GenerateProjectContext, "cwd" | "templateRoot">,
) => Promise<CreateScaffoldPlan>;

Source

planCreateEffect

Previews explicit creation flags without mutating project or staging paths.

Signature

declare const planCreateEffect: (
  options: CreateOptions,
  context?: Pick<GenerateProjectContext, "cwd" | "templateRoot"> | undefined,
) => Effect.Effect<
  Readonly<{
    destination: string;
    files: ReadonlyArray<string>;
    dependencies: Readonly<{ [k: string]: string }>;
    profiles: ReadonlyArray<never>;
    warnings: ReadonlyArray<never>;
  }>,
  GeneratorDomainError | GeneratorIoError,
  GeneratorFileSystem | GeneratorPaths
>;

Source

create-preview.types.ts

Existing read-only creation preview result.

CreateScaffoldPlan (interface)

Existing read-only creation preview result.

Signature

export interface CreateScaffoldPlan {
  readonly destination: string;
  readonly files: readonly string[];
  readonly dependencies: Readonly<Record<string, string>>;
  readonly profiles: readonly string[];
  readonly warnings: readonly string[];
}

Source

create-resolver.ts

Resolves creation options and certified template choices through the prompt service while preserving headless defaults and explicit user arguments.

ResolveCreateContext

Signature

declare const ResolveCreateContext: ResolveCreateContext;

Source

ResolvedCreateOptions

Signature

declare const ResolvedCreateOptions: ResolvedCreateOptions;

Source

resolveCreateOptions

Preserves normalized creation’s Promise compatibility API.

Signature

declare const resolveCreateOptions: (
  args: readonly string[],
  context?: ResolveCreateContext,
) => Promise<CreateOptions>;

Source

resolveCreateOptionsDetails

Preserves detailed creation resolution with the shared interactive choices.

Signature

declare const resolveCreateOptionsDetails: (
  args: readonly string[],
  context?: ResolveCreateContext,
) => Promise<ResolvedCreateOptions>;

Source

resolveCreateOptionsDetailsEffect

Resolves explicit flags and prompts for missing name, template, jobs and destination choices.

Signature

declare const resolveCreateOptionsDetailsEffect: (
  args: ReadonlyArray<string>,
  context?: ResolveCreateContext | undefined,
) => Effect.Effect<
  { options: CreateOptions; prompted: boolean },
  GeneratorDomainError | GeneratorPromptError,
  GeneratorPrompt
>;

Source

create-resolver.types.ts

ResolveCreateContext (interface)

Existing create-resolution settings; noninteractive input never needs prompt authority.

Signature

export interface ResolveCreateContext {
  readonly json?: boolean;
  readonly interactive?: boolean;
  readonly promptDriver?: PromptDriver;
  readonly signal?: AbortSignal;
}

Source

ResolvedCreateOptions (interface)

Existing resolver result; prompted records whether any creation choice was requested.

Signature

export interface ResolvedCreateOptions {
  readonly options: CreateOptions;
  readonly prompted: boolean;
}

Source

dependency-patch-installation.ts

dependencyPatchNeedsInstall

Preserves the patch-installation Promise compatibility API.

Signature

declare const dependencyPatchNeedsInstall: (plan: ScaffoldPlan) => Promise<boolean>;

Source

dependencyPatchNeedsInstallEffect

Detects patch-only installation requirements before a transaction mutates the project.

Signature

declare const dependencyPatchNeedsInstallEffect: (
  plan: ScaffoldPlan,
) => Effect.Effect<boolean, GeneratorDomainError | GeneratorIoError, GeneratorFileSystem>;

Source

dependency-patches.ts

Loads and plans the canonical selected Drizzle repair, validating conflicts before delivery and preserving its release pin and exact patch bytes.

planDependencyPatch

Preserves patch planning’s Promise API and collision constructors.

Signature

declare const planDependencyPatch: (
  projectRoot: string,
  source: string,
  patch: DependencyPatch,
) => Promise<DependencyPatchPlan>;

Source

planDependencyPatchEffect

Plans byte-identical repair ownership without mutating project assets.

Signature

declare const planDependencyPatchEffect: (
  projectRoot: string,
  source: string,
  patch: DependencyPatch,
) => Effect.Effect<
  { operation?: { path: string; action: "create"; content: string }; content: string },
  GeneratorDomainError | GeneratorIoError,
  GeneratorFileSystem
>;

Source

prepareProjectDependencyPatch

Preserves staging repair delivery’s Promise API.

Signature

declare const prepareProjectDependencyPatch: (projectRoot: string) => Promise<void>;

Source

prepareProjectDependencyPatchEffect

Delivers repair assets before the first installation inside a generation-owned stage.

Signature

declare const prepareProjectDependencyPatchEffect: (
  projectRoot: string,
) => Effect.Effect<void, GeneratorDomainError | GeneratorIoError, GeneratorFileSystem>;

Source

readDrizzlePatch

Preserves the verified repair Promise API.

Signature

declare const readDrizzlePatch: () => Promise<DependencyPatch>;

Source

readDrizzlePatchEffect

Loads verified Drizzle declaration repairs from source or the owning packed release.

Signature

declare const readDrizzlePatchEffect: () => Effect.Effect<
  Readonly<{
    path: `patches/${string}.patch`;
    content: string;
    version: string;
    key: string;
    asset: string;
    hash: string;
  }>,
  GeneratorDomainError | GeneratorIoError,
  GeneratorFileSystem
>;

Source

generate-output.ts

Renders local onboarding from the generated project’s actual installation state. Pure command construction exposes finite preparation after skipped installation; schema guards recognize presentation values without promoting arbitrary output into the generated-result contract. Formatting performs no runtime acquisition.

GenerateNextSteps

Signature

declare const GenerateNextSteps: GenerateNextSteps;

Source

createGenerateNextSteps

Builds local commands and endpoints for a generated project.

Signature

declare const createGenerateNextSteps: (
  options: Pick<CreateOptions, "examples" | "install">,
  destination: string,
  cwd?: string,
) => GenerateNextSteps;

Source

formatGenerateResult

Formats a recognizable generation result for terminal display.

Signature

declare const formatGenerateResult: <T>(value: T) => string;

Source

generate-output.types.ts

Local commands and endpoints displayed after successful project creation.

GenerateNextSteps (interface)

Local commands and endpoints displayed after successful project creation.

Signature

export interface GenerateNextSteps {
  readonly commands: Readonly<{
    readonly cd: string;
    readonly install?: "bun install";
    /** Finite validation/preparation required after a skipped dependency installation. */
    readonly prepare?: "bunx --no-install relkit dev --prepare";
    readonly dev: "bun run dev";
    readonly test: "bun run test";
    readonly check: "bun run check";
    readonly build: "bun run build";
  }>;
  readonly endpoints: Readonly<{
    /** A served backend URL: the example route, or the API reference without examples. */
    readonly backend:
      "http://localhost:3000/hello?name=RelKit" | "http://localhost:3000/_relkit/v1/api-reference";
    readonly inspector: "http://localhost:3210";
    readonly openapi: "http://localhost:3000/_relkit/v1/openapi.json";
    /** Present when the generated application selects the Scalar reference UI (the template default). */
    readonly apiReference?: "http://localhost:3000/_relkit/v1/api-reference";
    readonly route?: "GET http://localhost:3000/hello?name=RelKit";
  }>;
}

Source

generate-process.ts

Runs creation installation and verification commands through the selected process service, retaining local executable resolution and cleanup boundaries.

generationError

Maps a boundary failure to the public generation error contract.

Signature

declare const generationError: (
  error: unknown,
  fallback: string,
  cleanup?: StageCleanupResult,
) => GenerateProjectError;

Source

injectGenerateFailure

Runs deterministic failure injection for generation regression tests.

Signature

declare const injectGenerateFailure: (
  context: GenerateProjectContext,
  point: GenerateFailurePoint,
) => void;

Source

resolveRelkitExecutable

Signature

declare const resolveRelkitExecutable: (
  context: GenerateProjectContext,
  root: string,
) => Promise<string>;

Source

resolveRelkitExecutableEffect

Signature

declare const resolveRelkitExecutableEffect: (
  context: Pick<GenerateProjectContext, "relkitExecutable" | "commandRunner">,
  root: string,
) => Effect.Effect<string, GeneratorDomainError, GeneratorFileSystem>;

Source

runProjectCommand

Signature

declare const runProjectCommand: (
  command: readonly string[],
  cwd: string,
  signal?: AbortSignal,
) => Promise<GenerateCommandResult>;

Source

runProjectStep

Preserves generation step’s public Promise adapter.

Signature

declare const runProjectStep: (
  context: GenerateProjectContext,
  command: readonly string[],
  cwd: string,
  step: string,
  point: GenerateFailurePoint,
) => Promise<void>;

Source

runProjectStepEffect

Executes one generation step through scoped process authority.

Signature

declare const runProjectStepEffect: (
  context: GenerateProjectContext,
  command: ReadonlyArray<string>,
  cwd: string,
  step: string,
  point: GenerateFailurePoint,
) => Effect.Effect<undefined, GeneratorDomainError | GeneratorProcessError, GeneratorProcess>;

Source

throwIfAborted

Throws the caller’s existing cancellation reason before any new work is started.

Signature

declare const throwIfAborted: (signal: AbortSignal | undefined) => void;

Source

generate-types.ts

GenerateCommandResult (interface)

Native process exit status and captured standard output/error.

Signature

export interface GenerateCommandResult {
  readonly exitCode: number;
  readonly stdout?: string;
  readonly stderr?: string;
}

Source

GenerateCommandRunner (type alias)

Existing Promise process adapter receiving literal arguments, cwd and optional cancellation.

Signature

type GenerateCommandRunner = (
  command: readonly string[],
  cwd: string,
  signal?: AbortSignal,
) => Promise<GenerateCommandResult>;

Source

GenerateFailurePoint (type alias)

Named generation stages available for deterministic failure injection.

Signature

type GenerateFailurePoint =
  "copy" | "substitute" | "install" | "git" | "doctor" | "check" | "rename";

Source

GenerateProjectContext (interface)

Caller-owned templates, process/prompt adapters, cancellation and progress settings.

Signature

export interface GenerateProjectContext {
  readonly cwd?: string;
  readonly templateRoot?: string;
  readonly commandRunner?: GenerateCommandRunner;
  readonly bunExecutable?: string;
  readonly gitExecutable?: string;
  readonly relkitExecutable?: string;
  readonly signal?: AbortSignal;
  /**
   * Reports the current step through the caller's progress sink.
   * @param message - User-facing progress text for the current step.
   * @returns Completion after the sink receives one progress message.
   */
  readonly onProgress?: (message: string) => void;
  /**
   * Injects a failure at a named stage for deterministic generation tests.
   * @param point - Fixed deterministic generation failure-injection point.
   * @returns Completion after the hook runs; a thrown failure aborts that stage.
   */
  readonly failAt?: (point: GenerateFailurePoint) => void;
  readonly interactive?: boolean;
  readonly promptDriver?: PromptDriver;
}

Source

GenerateProjectError (class)

Public generation failure carrying its diagnostic code, exit status and optional staging path.

Signature

declare class GenerateProjectError { constructor(
    readonly code: string,
    message: string,
    temporaryPath?: string,
    exitCode: 1 | 2 | 130 | 143 = defaultExitCode(code),
  ) }

Source

exitCode (property)

Signature

readonly exitCode: 1 | 2 | 130 | 143

Source

temporaryPath (property)

Signature

readonly temporaryPath: string | undefined

Source

GenerateProjectResult (interface)

Published project’s options, destination, files, warnings and local next steps.

Signature

export interface GenerateProjectResult {
  readonly ok: true;
  readonly command: "create";
  readonly name: string;
  readonly template: CreateOptions["template"];
  readonly cloud: CreateOptions["cloud"];
  readonly deploy: CreateOptions["deploy"];
  readonly destination: string;
  readonly files: readonly string[];
  readonly installed: boolean;
  readonly gitInitialized: boolean;
  readonly additions: readonly AddResult[];
  readonly warnings: readonly ScaffoldWarning[];
  readonly nextSteps: GenerateNextSteps;
}

Source

generate.ts

ProjectGeneration (class)

Owns one complete creation workflow, including consent and atomic publication.

Signature

declare class ProjectGeneration

Source

generateProject

Preserves the public Promise API, flags, errors and generated result shape.

Signature

declare const generateProject: (
  options: CreateOptions,
  context?: GenerateProjectContext,
) => Promise<GenerateProjectResult>;

Source

generateProjectEffect

Generates a project through explicitly acquired creation authority.

Signature

declare const generateProjectEffect: (
  options: CreateOptions,
  context?: GenerateProjectContext | undefined,
) => Effect.Effect<
  GenerateProjectResult,
  GeneratorDomainError | GeneratorIoError | GeneratorPromptError | GeneratorProcessError,
  ProjectGeneration
>;

Source

projectGenerationLive

Generation captures explicit filesystem, path, process and prompt authority at acquisition.

Signature

declare const projectGenerationLive: Layer.Layer<
  ProjectGeneration,
  never,
  GeneratorFileSystem | GeneratorPaths | GeneratorPrompt | GeneratorProcess
>;

Source

generator-cleanup.ts

GeneratorCleanupFailure

Signature

declare const GeneratorCleanupFailure: GeneratorCleanupFailure;

Source

generatorCleanupFailures

Reads secondary cleanup evidence without changing error identity or enumerable JSON contracts.

Signature

declare const generatorCleanupFailures: (value: unknown) => readonly GeneratorCleanupFailure[];

Source

recordCleanupFailure

Attaches bounded release evidence to the original scoped exit’s public owner.

Signature

declare const recordCleanupFailure: (
  exit: Exit.Exit<unknown, unknown>,
  operation: GeneratorCleanupFailure["operation"],
  cause: unknown,
  ownerOverride?: unknown,
) => Effect.Effect<void>;

Source

transferCleanupFailures

Retains release diagnostics when an existing compatibility contract translates a native failure.

Signature

declare const transferCleanupFailures: <A extends object>(original: unknown, translated: A) => A;

Source

generator-cleanup.types.ts

Secondary resource-release evidence, separated from the authoritative public failure.

GeneratorCleanupFailure (interface)

Secondary resource-release evidence, separated from the authoritative public failure.

Signature

export interface GeneratorCleanupFailure {
  readonly operation: "temporary-file" | "rollback" | "marker" | "stage" | "process";
  readonly cause: unknown;
}

Source

generator-errors.ts

GeneratorDomainError (class)

An expected legacy domain failure carried through a typed Effect workflow.

Signature

declare class GeneratorDomainError

Source

GeneratorIoError (class)

A failed native filesystem operation, retaining its original diagnostic.

Signature

declare class GeneratorIoError

Source

GeneratorProcessError (class)

A failed child-process adapter operation. Command arguments are never telemetry labels.

Signature

declare class GeneratorProcessError

Source

GeneratorPromptError (class)

A failed or cancelled prompt adapter operation.

Signature

declare class GeneratorPromptError

Source

domainError

Carries an expected public error through internal domain composition.

Signature

declare const domainError: (cause: unknown) => GeneratorDomainError;

Source

domainTry

Executes a pure validation boundary without converting downstream defects or interruption.

Signature

declare const domainTry: <A>(evaluate: () => A) => Effect.Effect<A, GeneratorDomainError>;

Source

errorMessage

Formats diagnostic text without assuming an Error instance.

Signature

declare const errorMessage: (cause: unknown) => string;

Source

hasErrno

Tests an adapter rejection’s native errno without an unchecked assertion.

Signature

declare const hasErrno: (cause: unknown, code: string) => boolean;

Source

publicFailure

Restores the original rejection at a public Promise or synchronous adapter.

Signature

declare const publicFailure: (error: unknown) => unknown;

Source

scaffoldErrors

Translates only existing synchronous scaffold validators into the typed channel.

Signature

declare const scaffoldErrors: <A, E, R>(
  effect: Effect.Effect<A, E, R>,
) => Effect.Effect<A, E | GeneratorDomainError, R>;

Source

generator-filesystem.ts

Provides injectable filesystem operations used by creation and transaction workflows, preserving native I/O failures and atomic file ownership.

GeneratorFileSystem (class)

Native filesystem authority supplied through live or deterministic test Layers.

Example

import { Effect } from "effect";
import { GeneratorFileSystem, generatorFileSystemLive } from "create-relkit";
const inspect = GeneratorFileSystem.use((fs) => fs.metadata("./package.json"));
const supplied = inspect.pipe(Effect.provide(generatorFileSystemLive));

Signature

declare class GeneratorFileSystem

Source

generatorFileSystemLive

Live Node/Bun adapter. Mutating calls settle before scoped transaction cleanup can run.

Signature

declare const generatorFileSystemLive: Layer.Layer<GeneratorFileSystem, never, never>;

Source

generator-filesystem.types.ts

GeneratorDirectoryEntry (interface)

A directory entry read without following symlinks.

Signature

export interface GeneratorDirectoryEntry {
  readonly name: string;
  readonly kind: GeneratorEntryKind;
}

Source

GeneratorEntryKind (type alias)

Native entry classification without following symlinks.

Signature

type GeneratorEntryKind = "file" | "directory" | "symlink" | "other";

Source

GeneratorFileMetadata (interface)

Filesystem metadata needed for safe mutation and mode restoration.

Signature

export interface GeneratorFileMetadata {
  readonly kind: GeneratorEntryKind;
  readonly mode: number;
}

Source

GeneratorFileSystemService (interface)

Explicit native filesystem authority for generator workflows.

Signature

export interface GeneratorFileSystemService {
  /**
   * Reads UTF-8 file contents with interruptible native read authority.
   * @param path - Path inside the current project or owned resource.
   * @returns File contents, or a typed native read failure.
   */
  readonly readText: (path: string) => Effect.Effect<string, GeneratorIoError>;
  /**
   * Reads original file bytes for exact rollback snapshots.
   * @param path - Path inside the current project or owned resource.
   * @returns File bytes, or a typed native read failure.
   */
  readonly readBytes: (path: string) => Effect.Effect<Uint8Array, GeneratorIoError>;
  /**
   * Checks native accessibility without granting file mutation.
   * @param path - Path inside the current project or owned resource.
   * @returns Completion when the destination is accessible.
   */
  readonly access: (path: string) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Reads kind and permissions without dereferencing symlinks.
   * @param path - Path inside the current project or owned resource.
   * @returns Entry kind and mode, undefined when absent; symlinks are not followed.
   */
  readonly metadata: (
    path: string,
  ) => Effect.Effect<GeneratorFileMetadata | undefined, GeneratorIoError>;
  /**
   * Reads directory entries for deterministic declaration traversal.
   * @param path - Path inside the current project or owned resource.
   * @returns Directory entries without following symlinks.
   */
  readonly entries: (
    path: string,
  ) => Effect.Effect<readonly GeneratorDirectoryEntry[], GeneratorIoError>;
  /**
   * Writes complete content and waits for physical native settlement.
   * @param path - Path inside the current project or owned resource.
   * @param content - Complete bytes or text planned for the destination.
   * @param options - Explicit options retaining existing defaults.
   * @returns Completion after native bytes physically settle, before rollback can run.
   */
  readonly write: (
    path: string,
    content: string | Uint8Array,
    options?: { readonly mode?: number; readonly flag?: "wx" },
  ) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Creates owned directories and waits for physical native settlement.
   * @param path - Path inside the current project or owned resource.
   * @param options - Explicit options retaining existing defaults.
   * @returns Completion after native directory creation physically settles.
   */
  readonly mkdir: (
    path: string,
    options?: { readonly recursive?: boolean; readonly mode?: number },
  ) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Acquires a unique staging directory from its literal prefix.
   * @param prefix - Literal sibling-stage prefix owned by this invocation.
   * @returns The owned staging path after creation settles.
   */
  readonly temporaryDirectory: (prefix: string) => Effect.Effect<string, GeneratorIoError>;
  /**
   * Atomically moves an owned native path and waits for settlement.
   * @param from - Owned source path.
   * @param to - Validated destination path.
   * @returns Completion after the atomic native handoff settles.
   */
  readonly rename: (from: string, to: string) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Removes an owned native path with explicit recursive and force policy.
   * @param path - Path inside the current project or owned resource.
   * @param options - Explicit options retaining existing defaults.
   * @returns Completion after owned path removal settles.
   */
  readonly remove: (
    path: string,
    options?: { readonly recursive?: boolean; readonly force?: boolean },
  ) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Removes an owned directory only when it is empty.
   * @param path - Path inside the current project or owned resource.
   * @returns Completion after removing an owned empty directory.
   */
  readonly removeDirectory: (path: string) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Restores or sets native permission bits after content settlement.
   * @param path - Path inside the current project or owned resource.
   * @param mode - Optional restored or generated permission mode.
   * @returns Completion after native permission restoration settles.
   */
  readonly chmod: (path: string, mode: number) => Effect.Effect<void, GeneratorIoError>;
  /**
   * Enumerates sorted source paths with a declaration-owned glob pattern.
   * @param root - Absolute project or owned resource root.
   * @param pattern - Declaration-owned glob or ignore pattern.
   * @returns Sorted source-relative paths matching the declaration pattern.
   */
  readonly glob: (
    root: string,
    pattern: string,
  ) => Effect.Effect<readonly string[], GeneratorIoError>;
}

Source

generator-paths.ts

GeneratorPaths (class)

Read-only path authority; synchronous compatibility does not grant filesystem mutation.

Signature

declare class GeneratorPaths

Source

generatorPathsLive

Native read-only path adapter used by both Effect workflows and synchronous public validators.

Signature

declare const generatorPathsLive: Layer.Layer<GeneratorPaths, never, never>;

Source

generator-paths.types.ts

GeneratorPathsService (interface)

Read-only native path authority that preserves existing synchronous validation APIs.

Signature

export interface GeneratorPathsService {
  /**
   * Reads kind and permissions without dereferencing symlinks.
   * @param path - Path inside the current project or owned resource.
   * @returns Entry kind and mode, undefined when absent; symlinks are not followed.
   */
  readonly metadata: (
    path: string,
  ) => Effect.Effect<GeneratorFileMetadata | undefined, GeneratorIoError>;
  /**
   * Reads directory entries for deterministic declaration traversal.
   * @param path - Path inside the current project or owned resource.
   * @returns Directory entries without following symlinks.
   */
  readonly entries: (path: string) => Effect.Effect<readonly string[], GeneratorIoError>;
  /**
   * Canonicalizes an existing path for safe destination validation.
   * @param path - Path inside the current project or owned resource.
   * @returns Canonical existing path, or a typed native failure.
   */
  readonly realpath: (path: string) => Effect.Effect<string, GeneratorIoError>;
  /**
   * Reads the composition root's native current directory.
   * @returns Current native working directory.
   */
  readonly cwd: () => Effect.Effect<string>;
  /**
   * Reads the user's native home directory for destination safety.
   * @returns Native user home directory.
   */
  readonly home: () => Effect.Effect<string>;
  /**
   * Reads the native temporary root for destination safety.
   * @returns Native temporary directory root.
   */
  readonly temporaryRoot: () => Effect.Effect<string>;
}

Source

generator-process.ts

Provides the scoped native process adapter for creator workflows, joining exit and output drains before release or transactional rollback.

GeneratorProcess (class)

Child-process authority, replaceable at the same Layer boundary in tests.

Example

import { Effect } from "effect";
import { GeneratorProcess, generatorProcessLive } from "create-relkit";
const locate = GeneratorProcess.use((process) => process.which("bun"));
const supplied = locate.pipe(Effect.provide(generatorProcessLive));

Signature

declare class GeneratorProcess

Source

generatorProcessLayer

Constructs a live process adapter or adapts an existing injected command runner.

Signature

declare const generatorProcessLayer: (
  runner?: GeneratorCommandRunner,
) => Layer.Layer<GeneratorProcess>;

Source

generatorProcessLive

Live scoped Bun child-process implementation.

Signature

declare const generatorProcessLive: Layer.Layer<GeneratorProcess, never, never>;

Source

generator-process.types.ts

GeneratorCommandResult (interface)

Captured process result, matching both existing command-runner compatibility contracts.

Signature

export interface GeneratorCommandResult {
  readonly exitCode: number;
  readonly stdout?: string;
  readonly stderr?: string;
}

Source

GeneratorCommandRunner (type alias)

Existing external runner adapter; its signal is aborted when the owning fiber is interrupted.

Signature

type GeneratorCommandRunner = (
  command: readonly string[],
  cwd: string,
  signal?: AbortSignal,
) => Promise<GeneratorCommandResult>;

Source

GeneratorProcessService (interface)

Explicit process-spawning authority. Each invocation owns its child through completion.

Signature

export interface GeneratorProcessService {
  /**
   * Owns one command, output drains and child settlement through scope release.
   * @param command - Literal executable and argument vector.
   * @param cwd - Working directory for the operation.
   * @returns Captured output and exit status after child settlement and scoped cleanup.
   */
  readonly run: (
    command: readonly string[],
    cwd: string,
  ) => Effect.Effect<GeneratorCommandResult, GeneratorProcessError>;
  /**
   * Locates an executable through the native process adapter.
   * @param executable - Executable name resolved through the native search path.
   * @returns Executable path, or null when unavailable.
   */
  readonly which: (executable: string) => Effect.Effect<string | null, GeneratorProcessError>;
}

Source

generator-prompt.ts

Provides the prompt service adapter used by creation and CLI scaffolding while preserving cancellation and the selected prompt driver’s values.

GeneratorPrompt (class)

Prompt authority; interactive workflows cannot run without an explicit live or test adapter.

Signature

declare class GeneratorPrompt

Source

generatorPromptLayer

Adapts the existing public prompt driver to typed, interruptible operations.

Example

import { Effect } from "effect";
import { GeneratorPrompt, generatorPromptLayer, createClackPromptDriver } from "create-relkit";
const confirmed = GeneratorPrompt.use((prompt) => prompt.confirm({ message: "Continue?" }));
const run = confirmed.pipe(Effect.provide(generatorPromptLayer(createClackPromptDriver())));

Signature

declare const generatorPromptLayer: (driver: PromptDriver) => Layer.Layer<GeneratorPrompt>;

Source

generator-prompt.types.ts

GeneratorPromptService (interface)

Explicit interactive input authority, shared by Clack and deterministic test drivers.

Signature

export interface GeneratorPromptService {
  /**
   * Asks for text through the explicit, cancellation-aware native driver.
   * @param options - Explicit options retaining existing defaults.
   * @returns Decoded text; prompt interruption propagates to the native driver.
   */
  readonly text: (options: TextPromptOptions) => Effect.Effect<string, GeneratorPromptError>;
  /**
   * Asks for one declared option and decodes the native answer.
   * @typeParam Value - Union of declared prompt option values.
   * @param options - Question, declared choices and optional initial selection.
   * @returns One decoded declared option; invalid native answers fail.
   */
  readonly select: <Value extends string>(
    options: ChoicePromptOptions<Value>,
  ) => Effect.Effect<Value, GeneratorPromptError>;
  /**
   * Asks for declared options and decodes their ordered native answers.
   * @typeParam Value - Union of declared prompt option values.
   * @param options - Question, declared choices and optional required-selection policy.
   * @returns Decoded declared options in driver order.
   */
  readonly multiselect: <Value extends string>(
    options: ChoicePromptOptions<Value> & { readonly required?: boolean },
  ) => Effect.Effect<readonly Value[], GeneratorPromptError>;
  /**
   * Asks for boolean consent and decodes the native answer.
   * @param options - Explicit options retaining existing defaults.
   * @returns Decoded consent; cancellation retains its original rejection.
   */
  readonly confirm: (options: {
    readonly message: string;
    readonly initialValue?: boolean;
  }) => Effect.Effect<boolean, GeneratorPromptError>;
}

Source

generator-runtime.ts

runGeneratorPromise

Runs a public Promise compatibility edge without changing rejection identity.

Signature

declare const runGeneratorPromise: <A, E>(
  effect: Effect.Effect<A, E, GeneratorFileSystem | GeneratorProcess | GeneratorPaths>,
  signal?: AbortSignal,
) => Promise<A>;

Source

runGeneratorSync

Runs a pure synchronous compatibility edge in the shared owner.

Signature

declare const runGeneratorSync: <A, E>(effect: Effect.Effect<A, E, GeneratorPaths>) => A;

Source

index.ts

Publishes pure project creation, normalized options and portable template metadata; existing-project AST discovery and add execution belong to the CLI.

“./add-types.js” (namespace export)

Re-exports all named exports from the “./add-types.js” module.

Signature

export * from "./add-types.js";

Source

“./create-capabilities.js” (namespace export)

Re-exports all named exports from the “./create-capabilities.js” module.

Signature

export * from "./create-capabilities.js";

Source

“./create-preview.js” (namespace export)

Re-exports all named exports from the “./create-preview.js” module.

Signature

export * from "./create-preview.js";

Source

“./create-resolver.js” (namespace export)

Re-exports all named exports from the “./create-resolver.js” module.

Signature

export * from "./create-resolver.js";

Source

“./generate-output.js” (namespace export)

Re-exports all named exports from the “./generate-output.js” module.

Signature

export * from "./generate-output.js";

Source

“./generate-types.js” (namespace export)

Re-exports all named exports from the “./generate-types.js” module.

Signature

export * from "./generate-types.js";

Source

“./generate.js” (namespace export)

Re-exports all named exports from the “./generate.js” module.

Signature

export * from "./generate.js";

Source

“./generator-cleanup.js” (namespace export)

Re-exports all named exports from the “./generator-cleanup.js” module.

Signature

export * from "./generator-cleanup.js";

Source

“./generator-errors.js” (namespace export)

Re-exports all named exports from the “./generator-errors.js” module.

Signature

export * from "./generator-errors.js";

Source

“./generator-filesystem.js” (namespace export)

Re-exports all named exports from the “./generator-filesystem.js” module.

Signature

export * from "./generator-filesystem.js";

Source

“./generator-filesystem.types.js” (namespace export)

Re-exports all named exports from the “./generator-filesystem.types.js” module.

Signature

export * from "./generator-filesystem.types.js";

Source

“./generator-paths.js” (namespace export)

Re-exports all named exports from the “./generator-paths.js” module.

Signature

export * from "./generator-paths.js";

Source

“./generator-paths.types.js” (namespace export)

Re-exports all named exports from the “./generator-paths.types.js” module.

Signature

export * from "./generator-paths.types.js";

Source

“./generator-process.js” (namespace export)

Re-exports all named exports from the “./generator-process.js” module.

Signature

export * from "./generator-process.js";

Source

“./generator-process.types.js” (namespace export)

Re-exports all named exports from the “./generator-process.types.js” module.

Signature

export * from "./generator-process.types.js";

Source

“./generator-prompt.js” (namespace export)

Re-exports all named exports from the “./generator-prompt.js” module.

Signature

export * from "./generator-prompt.js";

Source

“./generator-prompt.types.js” (namespace export)

Re-exports all named exports from the “./generator-prompt.types.js” module.

Signature

export * from "./generator-prompt.types.js";

Source

“./options.js” (namespace export)

Re-exports all named exports from the “./options.js” module.

Signature

export * from "./options.js";

Source

“./prompt-driver.js” (namespace export)

Re-exports all named exports from the “./prompt-driver.js” module.

Signature

export * from "./prompt-driver.js";

Source

“./scaffold-catalog.js” (namespace export)

Re-exports all named exports from the “./scaffold-catalog.js” module.

Signature

export * from "./scaffold-catalog.js";

Source

“./template-root.js” (namespace export)

Re-exports all named exports from the “./template-root.js” module.

Signature

export * from "./template-root.js";

Source

“./validate.js” (namespace export)

Re-exports all named exports from the “./validate.js” module.

Signature

export * from "./validate.js";

Source

CatalogManifest

Signature

declare const CatalogManifest: CatalogManifest;

Source

resolveCatalogVersion

Signature

declare const resolveCatalogVersion: (
  manifest: CatalogManifest,
  name: string,
  spec: unknown,
) => string;

Source

launcher.ts

Owns one Bun child until exit, forwarding terminal cancellation before releasing listeners.

launchBun

Executes a literal entrypoint under Bun and joins its actual completion.

Signature

declare const launchBun: (entry: string, args: readonly string[], cwd?: string) => Promise<number>;

Source

options.ts

Validates and normalizes pure creation options before selecting templates, destinations and optional installation or Git initialization.

CREATE_CLOUDS

Supported cloud selections; none is the default.

Signature

declare const CREATE_CLOUDS: readonly ["aws", "none"];

Source

CREATE_DEPLOYMENTS

Supported deployment selections; none is the default.

Signature

declare const CREATE_DEPLOYMENTS: readonly ["pulumi", "none"];

Source

CREATE_JOBS

Supported explicit local job-provider selections.

Signature

declare const CREATE_JOBS: readonly ["inngest-docker", "effect-mq-docker", "trigger-docker"];

Source

CREATE_OPTION_DEFAULTS

Minimal local defaults applied before explicit create flags are parsed.

Signature

declare const CREATE_OPTION_DEFAULTS: Readonly<{
  template: CreateTemplate;
  cloud: CreateCloud;
  deploy: CreateDeployment;
  jobs: CreateJobs | undefined;
  install: boolean;
  git: boolean;
  examples: boolean;
  forceEmptyDirectory: boolean;
  json: boolean;
}>;

Source

CREATE_TEMPLATES

Templates supported by explicit –template selection.

Signature

declare const CREATE_TEMPLATES: readonly ["minimal", "api", "agent", "fullstack"];

Source

CreateCloud (type alias)

Supported cloud choice for project generation.

Signature

type CreateCloud = (typeof CREATE_CLOUDS)[number];

Source

CreateDeployment (type alias)

Supported deployment choice for project generation.

Signature

type CreateDeployment = (typeof CREATE_DEPLOYMENTS)[number];

Source

CreateJobs (type alias)

Supported local job provider selected by an explicit creation flag.

Signature

type CreateJobs = (typeof CREATE_JOBS)[number];

Source

CreateOptions (interface)

Normalized creation flags preserving omitted directory and job-provider fields.

Signature

export interface CreateOptions {
  readonly name: string;
  readonly template: CreateTemplate;
  readonly cloud: CreateCloud;
  readonly deploy: CreateDeployment;
  readonly jobs?: CreateJobs;
  readonly install: boolean;
  readonly git: boolean;
  readonly examples: boolean;
  readonly directory?: string;
  readonly forceEmptyDirectory: boolean;
  readonly json: boolean;
}

Source

CreateOptionsContext (interface)

Additional JSON output policy used while parsing creation flags.

Signature

export interface CreateOptionsContext {
  readonly json?: boolean;
}

Source

CreateOptionsError (class)

Public creation-flag usage failure with the stable RELKIT_CREATE_USAGE code.

Signature

declare class CreateOptionsError {
  constructor(message: string);
}

Source

code (property)

Stable usage code reported by CreateOptionsError.

Signature

readonly code: "RELKIT_CREATE_USAGE"

Source

CreateTemplate (type alias)

Supported template selected by an explicit creation flag.

Signature

type CreateTemplate = (typeof CREATE_TEMPLATES)[number];

Source

normalizeCreateOptions

Parses non-interactive create flags and applies the cloud-free defaults.

Signature

declare const normalizeCreateOptions: (
  args: readonly string[],
  context?: CreateOptionsContext,
) => CreateOptions;

Source

project-manifest.schemas.ts

JsonObject

JSON object boundary, retaining unrelated package and workspace fields.

Signature

declare const JsonObject: Schema.$Record<Schema.String, Schema.Unknown>;

Source

ProjectManifest

Validated string-valued package fields owned by scaffold planning.

Signature

declare const ProjectManifest: Schema.StructWithRest<
  Schema.Struct<{
    readonly dependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
    readonly devDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
    readonly scripts: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
    readonly patchedDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
  }>,
  readonly [Schema.$Record<Schema.String, Schema.Unknown>]
>;

Source

ScaffoldManifestSchema

Owned manifest fields; unrelated metadata keeps its authored order and shape.

Signature

declare const ScaffoldManifestSchema: Schema.StructWithRest<
  Schema.Struct<{
    readonly dependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
    readonly devDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
    readonly scripts: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
  }>,
  readonly [Schema.$Record<Schema.String, Schema.Unknown>]
>;

Source

TemplateManifest

Required starter fields used by deployment customization.

Signature

declare const TemplateManifest: Schema.StructWithRest<
  Schema.Struct<{
    readonly dependencies: Schema.$Record<Schema.String, Schema.String>;
    readonly scripts: Schema.$Record<Schema.String, Schema.String>;
  }>,
  readonly [Schema.$Record<Schema.String, Schema.Unknown>]
>;

Source

prompt-driver.ts

Defines the prompt driver’s text, choice and cancellation contract shared by creator workflows and CLI scaffolding adapters.

ChoicePromptOptions

Signature

declare const ChoicePromptOptions: ChoicePromptOptions<Value>;

Source

PromptDriver

Signature

declare const PromptDriver: PromptDriver;

Source

PromptOption

Signature

declare const PromptOption: PromptOption<Value>;

Source

TextPromptOptions

Signature

declare const TextPromptOptions: TextPromptOptions;

Source

createClackPromptDriver

Creates the public Clack adapter, forwarding fiber-owned cancellation to native prompts.

Signature

declare const createClackPromptDriver: (cancellationCode?: string) => PromptDriver;

Source

prompt-driver.types.ts

One declared prompt choice with a label and optional explanatory hint.

ChoicePromptOptions (interface)

Question and finite choices accepted by a prompt adapter.

Signature

export interface ChoicePromptOptions<Value extends string> {
  readonly message: string;
  readonly options: readonly PromptOption<Value>[];
  readonly initialValue?: Value;
}

Source

PromptDriver (interface)

Clack-compatible native questions and progress output, with optional caller cancellation.

Signature

export interface PromptDriver {
  /**
   * Asks for text through the explicit, cancellation-aware native driver.
   * @param options - Explicit options retaining existing defaults.
   * @param signal - Optional caller cancellation signal.
   * @returns Decoded text; prompt interruption propagates to the native driver.
   */
  readonly text: (options: TextPromptOptions, signal?: AbortSignal) => Promise<string>;
  /**
   * Asks the native driver for one declared choice.
   * @typeParam Value - Union of declared native choice values.
   * @param options - Question, declared choices and optional initial selection.
   * @param signal - Optional caller cancellation signal.
   * @returns A Promise for the native choice; cancellation rejects with the configured public code.
   */
  readonly select: <Value extends string>(
    options: ChoicePromptOptions<Value>,
    signal?: AbortSignal,
  ) => Promise<Value>;
  /**
   * Asks the native driver for declared choices in selection order.
   * @typeParam Value - Union of declared native choice values.
   * @param options - Question, declared choices and optional required-selection policy.
   * @param signal - Optional caller cancellation signal.
   * @returns A Promise for selected native choices; cancellation rejects with the configured public code.
   */
  readonly multiselect: <Value extends string>(
    options: ChoicePromptOptions<Value> & { readonly required?: boolean },
    signal?: AbortSignal,
  ) => Promise<readonly Value[]>;
  /**
   * Asks for boolean consent and decodes the native answer.
   * @param options - Explicit options retaining existing defaults.
   * @param signal - Optional caller cancellation signal.
   * @returns Decoded consent; cancellation retains its original rejection.
   */
  readonly confirm: (
    options: {
      readonly message: string;
      readonly initialValue?: boolean;
    },
    signal?: AbortSignal,
  ) => Promise<boolean>;
  /**
   * Presents an existing explanatory note through the terminal adapter.
   * @param message - Existing user-facing diagnostic.
   * @param title - Title displayed by the native progress/prompt sink.
   * @returns Completion after the existing contract has been applied.
   */
  readonly note: (message: string, title?: string) => void;
  /**
   * Presents the existing flow introduction through the terminal adapter.
   * @param title - Title displayed by the native progress/prompt sink.
   * @returns Completion after the existing contract has been applied.
   */
  readonly intro: (title: string) => void;
  /**
   * Presents the existing flow completion through the terminal adapter.
   * @param message - Existing user-facing diagnostic.
   * @returns Completion after the existing contract has been applied.
   */
  readonly outro: (message: string) => void;
}

Source

PromptOption (interface)

One declared prompt choice with a label and optional explanatory hint.

Signature

export interface PromptOption<Value extends string = string> {
  readonly value: Value;
  readonly label: string;
  readonly hint?: string;
}

Source

TextPromptOptions (interface)

Text question with optional initial input and native validation callback.

Signature

export interface TextPromptOptions {
  readonly message: string;
  readonly placeholder?: string;
  readonly initialValue?: string;
  /**
   * Returns a user-facing validation message for unacceptable native text input.
   * @param value - Current native text input, possibly undefined.
   * @returns A rejection message/Error, or undefined when the text is acceptable.
   */
  readonly validate?: (value: string | undefined) => string | Error | undefined;
}

Source

scaffold-catalog.ts

Declares portable feature dependency metadata and selected SDK owners used by creation and add manifest producers.

DependencySection

Signature

declare const DependencySection: DependencySection;

Source

SCAFFOLD_DEPENDENCIES

Versions copied into generated projects from each package’s own release metadata.

Signature

declare const SCAFFOLD_DEPENDENCIES: Readonly<{
  "@cloudflare/workers-types": { version: string; section: "devDependencies" };
  "@relkit/aws": { version: string; section: "dependencies" };
  "@relkit/better-auth": { version: string; section: "dependencies" };
  "@relkit/cloudflare": { version: string; section: "dependencies" };
  "@relkit/docker": { version: string; section: "dependencies" };
  "@relkit/effect-mq": { version: string; section: "dependencies" };
  "@relkit/inspector": { version: string; section: "devDependencies" };
  "@relkit/inngest": { version: string; section: "dependencies" };
  "@relkit/drizzle": { version: string; section: "dependencies" };
  "@relkit/local": { version: string; section: "dependencies" };
  "@relkit/langchain": { version: string; section: "dependencies" };
  "@relkit/pulumi": { version: string; section: "dependencies" };
  "@relkit/redis": { version: string; section: "dependencies" };
  "@relkit/s3": { version: string; section: "dependencies" };
  "@relkit/trigger": { version: string; section: "dependencies" };
  "better-auth": { version: string; section: "dependencies" };
  "drizzle-kit": { version: string; section: "devDependencies" };
  "drizzle-orm": { version: string; section: "dependencies" };
  langchain: { version: string; section: "dependencies" };
  "@langchain/core": { version: string; section: "dependencies" };
  "@langchain/langgraph": { version: string; section: "dependencies" };
  langsmith: { version: string; section: "dependencies" };
}>;

Source

ScaffoldDependency

Signature

declare const ScaffoldDependency: ScaffoldDependency;

Source

ScaffoldDependencyName

Signature

declare const ScaffoldDependencyName:
  | "drizzle-orm"
  | "@cloudflare/workers-types"
  | "@relkit/aws"
  | "@relkit/better-auth"
  | "@relkit/cloudflare"
  | "@relkit/docker"
  | "@relkit/effect-mq"
  | "@relkit/inspector"
  | "@relkit/inngest"
  | "@relkit/drizzle"
  | "@relkit/local"
  | "@relkit/langchain"
  | "@relkit/pulumi"
  | "@relkit/redis"
  | "@relkit/s3"
  | "@relkit/trigger"
  | "better-auth"
  | "drizzle-kit"
  | "langchain"
  | "@langchain/core"
  | "@langchain/langgraph"
  | "langsmith";

Source

scaffoldDependency

Selects one supported dependency from the release’s portable scaffold catalog.

Signature

declare const scaffoldDependency: (name: ScaffoldDependencyName) => ScaffoldDependency;

Source

scaffold-catalog.types.ts

DependencySection (type alias)

Manifest section in which a scaffold introduces a supported dependency.

Signature

type DependencySection = "dependencies" | "devDependencies";

Source

ScaffoldDependency (interface)

Concrete release-supported version and owning project manifest section.

Signature

export interface ScaffoldDependency {
  readonly version: string;
  readonly section: DependencySection;
}

Source

ScaffoldDependencyName (type alias)

Intentional scaffold dependency names, retaining their literal keyed catalog contract.

Signature

type ScaffoldDependencyName = keyof typeof SCAFFOLD_DEPENDENCIES;

Source

template-root.ts

resolveTemplateRoot

Preserves synchronous template-root resolution without a hidden filesystem dependency.

Signature

declare const resolveTemplateRoot: (
  context: Pick<GenerateProjectContext, "cwd" | "templateRoot">,
) => string;

Source

resolveTemplateRootEffect

Finds explicit, packed or source-owned templates through read-only path authority.

Signature

declare const resolveTemplateRootEffect: (
  context: Pick<GenerateProjectContext, "cwd" | "templateRoot">,
) => Effect.Effect<string, GeneratorIoError, GeneratorPaths>;

Source

validate-errors.ts

Stable public creation-validation constructor, independent of native I/O adapters.

CreateValidationError (class)

Stable public creation-validation constructor, independent of native I/O adapters.

Signature

declare class CreateValidationError { constructor(
    readonly code: string,
    message: string,
  ) }

Source

validate-paths.ts

canonicalizeMissingPathEffect

Canonicalizes missing child segments only after proving the existing parent is a directory.

Signature

declare const canonicalizeMissingPathEffect: (
  path: string,
) => Effect.Effect<string, GeneratorDomainError, GeneratorPaths>;

Source

existingDirectoryEffect

Resolves an existing real directory without permitting symlink indirection.

Signature

declare const existingDirectoryEffect: (
  path: string,
  label: string,
) => Effect.Effect<string, GeneratorDomainError, GeneratorPaths>;

Source

failure

Constructs a typed failure retaining the exact public validation code and message.

Signature

declare const failure: (
  code: string,
  message: string,
) => Effect.Effect<never, GeneratorDomainError, never>;

Source

inspectDestinationEffect

Inspects only an absent or real directory destination without following symlinks.

Signature

declare const inspectDestinationEffect: (
  path: string,
) => Effect.Effect<DestinationState, GeneratorDomainError, GeneratorPaths>;

Source

invalid

Carries existing validation failures in the internal typed channel.

Signature

declare const invalid: (message: string) => GeneratorDomainError;

Source

isAncestorOrSame

Checks a canonical path relationship using no I/O.

Signature

declare const isAncestorOrSame: (parent: string, child: string) => boolean;

Source

validate.ts

CreateValidationContext

Signature

declare const CreateValidationContext: CreateValidationContext;

Source

CreateValidationError

Signature

declare const CreateValidationError: typeof CreateValidationError;

Source

ValidatedCreateOptions

Signature

declare const ValidatedCreateOptions: ValidatedCreateOptions;

Source

isValidPackageName

Checks unscoped or scoped npm names without filesystem or Effect authority.

Signature

declare const isValidPackageName: (value: unknown) => value is string;

Source

resolveCreateDestination

Preserves synchronous safe-destination resolution and its stable public errors.

Signature

declare const resolveCreateDestination: (
  options: Pick<CreateOptions, "name" | "directory">,
  context?: CreateValidationContext,
) => string;

Source

resolveCreateDestinationEffect

Resolves a safe creation destination through explicit read-only path authority.

Signature

declare const resolveCreateDestinationEffect: (
  options: Pick<CreateOptions, "directory" | "name">,
  context?: CreateValidationContext | undefined,
) => Effect.Effect<string, GeneratorDomainError, GeneratorPaths>;

Source

validateCreateOptions

Preserves synchronous destination validation and its existing immutable result.

Signature

declare const validateCreateOptions: (
  options: CreateOptions,
  context?: CreateValidationContext,
) => ValidatedCreateOptions;

Source

validateCreateOptionsEffect

Validates destination state using the same path service as the existing synchronous API.

Signature

declare const validateCreateOptionsEffect: (
  options: CreateOptions,
  context?: CreateValidationContext | undefined,
) => Effect.Effect<
  Readonly<{
    destination: string;
    destinationExists: boolean;
    destinationEmpty: boolean;
    name: string;
    template: CreateTemplate;
    cloud: CreateCloud;
    deploy: CreateDeployment;
    jobs?: CreateJobs;
    install: boolean;
    git: boolean;
    examples: boolean;
    directory?: string;
    forceEmptyDirectory: boolean;
    json: boolean;
  }>,
  GeneratorDomainError,
  GeneratorPaths
>;

Source

validatePackageName

Asserts the existing package-name contract using its unchanged public constructor.

Signature

declare const validatePackageName: (value: unknown) => asserts value is string;

Source

validate.types.ts

CreateValidationContext (interface)

Existing read-only creation-validation context.

Signature

export interface CreateValidationContext {
  readonly cwd?: string;
  readonly homeDirectory?: string;
  readonly temporaryDirectory?: string;
}

Source

DestinationState (interface)

Destination facts obtained before any generation mutation.

Signature

export interface DestinationState {
  readonly exists: boolean;
  readonly empty: boolean;
}

Source

ValidatedCreateOptions (interface)

Existing validated creation result with inspected destination state.

Signature

export interface ValidatedCreateOptions extends CreateOptions {
  readonly destination: string;
  readonly destinationExists: boolean;
  readonly destinationEmpty: boolean;
}

Source