Project generator API
Generated public TypeScript reference for create-relkit.
For configuration and examples, read automation.
Public imports
create-relkit— 113 exportscreate-relkit/cli— 1 exportscreate-relkit/launcher— 1 exportscreate-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.
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;
applyFileOperations
Signature
declare const applyFileOperations: (
root: string,
operations: readonly ScaffoldFileOperation[],
createdDirectories: Set<string>,
) => Promise<void>;
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>;
operationPath
Resolves one relative operation while rejecting broad and escaping paths.
Signature
declare const operationPath: (root: string, path: string) => string;
restoreFiles
Signature
declare const restoreFiles: (
snapshots: readonly FileSnapshot[],
createdDirectories: ReadonlySet<string>,
) => Promise<void>;
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>;
snapshotFiles
Signature
declare const snapshotFiles: (
root: string,
operations: readonly ScaffoldFileOperation[],
includeLock: boolean,
) => Promise<readonly FileSnapshot[]>;
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
>;
validateOperationActions
Signature
declare const validateOperationActions: (
root: string,
operations: readonly ScaffoldFileOperation[],
) => Promise<void>;
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>;
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";
}>;
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",
];
AddFailureCode (type alias)
Stable public diagnostic category of AddScaffoldError.
Signature
type AddFailureCode = (typeof ADD_FAILURE_CODES)[keyof typeof ADD_FAILURE_CODES];
AddKind (type alias)
Supported relkit add artifact discriminant.
Signature
type AddKind = (typeof ADD_KINDS)[number];
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" });
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;
}
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[];
}
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,
) }
exitCode (property)
Signature
readonly exitCode: 1 | 2 | 130
DatabaseDialect (type alias)
Supported database dialect for Drizzle and authentication scaffolds.
Signature
type DatabaseDialect = "sqlite" | "postgresql" | "mysql";
RouteMethod (type alias)
Supported HTTP method used by generated route mappings.
Signature
type RouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
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;
}
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[];
}
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 };
ScaffoldWarning (interface)
Stable warning category and user-facing message retained in plans and results.
Signature
export interface ScaffoldWarning {
readonly code: string;
readonly message: string;
}
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"
>;
build-catalog.ts
buildCatalogDependency
Reads a concrete dependency version materialized into this package at build time.
Signature
declare const buildCatalogDependency: (name: string) => string;
buildCatalogPatch
Validates the patch descriptor against its centrally materialized dependency version.
Signature
declare const buildCatalogPatch: (name: string) => DependencyPatchDescriptor;
buildCatalogProvider
Reads a selected provider’s own version independently of the application API version.
Signature
declare const buildCatalogProvider: (name: string) => string;
catalog-resolution.ts
CatalogManifest
Signature
declare const CatalogManifest: CatalogManifest;
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;
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>;
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>;
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>;
}>;
CreateCapabilityEvidence
Signature
declare const CreateCapabilityEvidence: CreateCapabilityEvidence;
CreateCapabilityIdentity
Signature
declare const CreateCapabilityIdentity: CreateCapabilityIdentity;
CreateCapabilityTuple
Signature
declare const CreateCapabilityTuple: CreateCapabilityTuple;
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;
currentCreateCapabilityIdentity
Reads the executing SDK’s release and pinned dependency catalog without acquiring application clients.
Signature
declare const currentCreateCapabilityIdentity: () => CreateCapabilityIdentity;
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;
supportedCreateTemplates
Filters interactive template choices through the same evidence allow-list.
Signature
declare const supportedCreateTemplates: (
options: PartialCreateCapability,
identity?: CreateCapabilityIdentity,
) => readonly CreateTemplate[];
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;
}
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;
}
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;
}
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;
}>;
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;
formatCreatePlan
Formats an immutable preview as the existing human-readable terminal output.
Signature
declare const formatCreatePlan: (plan: CreateScaffoldPlan) => string;
planCreate
Preserves the existing preview Promise API.
Signature
declare const planCreate: (
options: CreateOptions,
context?: Pick<GenerateProjectContext, "cwd" | "templateRoot">,
) => Promise<CreateScaffoldPlan>;
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
>;
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[];
}
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;
ResolvedCreateOptions
Signature
declare const ResolvedCreateOptions: ResolvedCreateOptions;
resolveCreateOptions
Preserves normalized creation’s Promise compatibility API.
Signature
declare const resolveCreateOptions: (
args: readonly string[],
context?: ResolveCreateContext,
) => Promise<CreateOptions>;
resolveCreateOptionsDetails
Preserves detailed creation resolution with the shared interactive choices.
Signature
declare const resolveCreateOptionsDetails: (
args: readonly string[],
context?: ResolveCreateContext,
) => Promise<ResolvedCreateOptions>;
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
>;
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;
}
ResolvedCreateOptions (interface)
Existing resolver result; prompted records whether any creation choice was requested.
Signature
export interface ResolvedCreateOptions {
readonly options: CreateOptions;
readonly prompted: boolean;
}
dependency-patch-installation.ts
dependencyPatchNeedsInstall
Preserves the patch-installation Promise compatibility API.
Signature
declare const dependencyPatchNeedsInstall: (plan: ScaffoldPlan) => Promise<boolean>;
dependencyPatchNeedsInstallEffect
Detects patch-only installation requirements before a transaction mutates the project.
Signature
declare const dependencyPatchNeedsInstallEffect: (
plan: ScaffoldPlan,
) => Effect.Effect<boolean, GeneratorDomainError | GeneratorIoError, GeneratorFileSystem>;
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>;
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
>;
prepareProjectDependencyPatch
Preserves staging repair delivery’s Promise API.
Signature
declare const prepareProjectDependencyPatch: (projectRoot: string) => Promise<void>;
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>;
readDrizzlePatch
Preserves the verified repair Promise API.
Signature
declare const readDrizzlePatch: () => Promise<DependencyPatch>;
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
>;
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;
createGenerateNextSteps
Builds local commands and endpoints for a generated project.
Signature
declare const createGenerateNextSteps: (
options: Pick<CreateOptions, "examples" | "install">,
destination: string,
cwd?: string,
) => GenerateNextSteps;
formatGenerateResult
Formats a recognizable generation result for terminal display.
Signature
declare const formatGenerateResult: <T>(value: T) => string;
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";
}>;
}
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;
injectGenerateFailure
Runs deterministic failure injection for generation regression tests.
Signature
declare const injectGenerateFailure: (
context: GenerateProjectContext,
point: GenerateFailurePoint,
) => void;
resolveRelkitExecutable
Signature
declare const resolveRelkitExecutable: (
context: GenerateProjectContext,
root: string,
) => Promise<string>;
resolveRelkitExecutableEffect
Signature
declare const resolveRelkitExecutableEffect: (
context: Pick<GenerateProjectContext, "relkitExecutable" | "commandRunner">,
root: string,
) => Effect.Effect<string, GeneratorDomainError, GeneratorFileSystem>;
runProjectCommand
Signature
declare const runProjectCommand: (
command: readonly string[],
cwd: string,
signal?: AbortSignal,
) => Promise<GenerateCommandResult>;
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>;
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>;
throwIfAborted
Throws the caller’s existing cancellation reason before any new work is started.
Signature
declare const throwIfAborted: (signal: AbortSignal | undefined) => void;
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;
}
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>;
GenerateFailurePoint (type alias)
Named generation stages available for deterministic failure injection.
Signature
type GenerateFailurePoint =
"copy" | "substitute" | "install" | "git" | "doctor" | "check" | "rename";
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;
}
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),
) }
exitCode (property)
Signature
readonly exitCode: 1 | 2 | 130 | 143
temporaryPath (property)
Signature
readonly temporaryPath: string | undefined
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;
}
generate.ts
ProjectGeneration (class)
Owns one complete creation workflow, including consent and atomic publication.
Signature
declare class ProjectGeneration
generateProject
Preserves the public Promise API, flags, errors and generated result shape.
Signature
declare const generateProject: (
options: CreateOptions,
context?: GenerateProjectContext,
) => Promise<GenerateProjectResult>;
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
>;
projectGenerationLive
Generation captures explicit filesystem, path, process and prompt authority at acquisition.
Signature
declare const projectGenerationLive: Layer.Layer<
ProjectGeneration,
never,
GeneratorFileSystem | GeneratorPaths | GeneratorPrompt | GeneratorProcess
>;
generator-cleanup.ts
GeneratorCleanupFailure
Signature
declare const GeneratorCleanupFailure: GeneratorCleanupFailure;
generatorCleanupFailures
Reads secondary cleanup evidence without changing error identity or enumerable JSON contracts.
Signature
declare const generatorCleanupFailures: (value: unknown) => readonly GeneratorCleanupFailure[];
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>;
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;
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;
}
generator-errors.ts
GeneratorDomainError (class)
An expected legacy domain failure carried through a typed Effect workflow.
Signature
declare class GeneratorDomainError
GeneratorIoError (class)
A failed native filesystem operation, retaining its original diagnostic.
Signature
declare class GeneratorIoError
GeneratorProcessError (class)
A failed child-process adapter operation. Command arguments are never telemetry labels.
Signature
declare class GeneratorProcessError
GeneratorPromptError (class)
A failed or cancelled prompt adapter operation.
Signature
declare class GeneratorPromptError
domainError
Carries an expected public error through internal domain composition.
Signature
declare const domainError: (cause: unknown) => GeneratorDomainError;
domainTry
Executes a pure validation boundary without converting downstream defects or interruption.
Signature
declare const domainTry: <A>(evaluate: () => A) => Effect.Effect<A, GeneratorDomainError>;
errorMessage
Formats diagnostic text without assuming an Error instance.
Signature
declare const errorMessage: (cause: unknown) => string;
hasErrno
Tests an adapter rejection’s native errno without an unchecked assertion.
Signature
declare const hasErrno: (cause: unknown, code: string) => boolean;
publicFailure
Restores the original rejection at a public Promise or synchronous adapter.
Signature
declare const publicFailure: (error: unknown) => unknown;
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>;
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
generatorFileSystemLive
Live Node/Bun adapter. Mutating calls settle before scoped transaction cleanup can run.
Signature
declare const generatorFileSystemLive: Layer.Layer<GeneratorFileSystem, never, never>;
generator-filesystem.types.ts
GeneratorDirectoryEntry (interface)
A directory entry read without following symlinks.
Signature
export interface GeneratorDirectoryEntry {
readonly name: string;
readonly kind: GeneratorEntryKind;
}
GeneratorEntryKind (type alias)
Native entry classification without following symlinks.
Signature
type GeneratorEntryKind = "file" | "directory" | "symlink" | "other";
GeneratorFileMetadata (interface)
Filesystem metadata needed for safe mutation and mode restoration.
Signature
export interface GeneratorFileMetadata {
readonly kind: GeneratorEntryKind;
readonly mode: number;
}
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>;
}
generator-paths.ts
GeneratorPaths (class)
Read-only path authority; synchronous compatibility does not grant filesystem mutation.
Signature
declare class GeneratorPaths
generatorPathsLive
Native read-only path adapter used by both Effect workflows and synchronous public validators.
Signature
declare const generatorPathsLive: Layer.Layer<GeneratorPaths, never, never>;
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>;
}
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
generatorProcessLayer
Constructs a live process adapter or adapts an existing injected command runner.
Signature
declare const generatorProcessLayer: (
runner?: GeneratorCommandRunner,
) => Layer.Layer<GeneratorProcess>;
generatorProcessLive
Live scoped Bun child-process implementation.
Signature
declare const generatorProcessLive: Layer.Layer<GeneratorProcess, never, never>;
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;
}
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>;
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>;
}
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
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>;
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>;
}
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>;
runGeneratorSync
Runs a pure synchronous compatibility edge in the shared owner.
Signature
declare const runGeneratorSync: <A, E>(effect: Effect.Effect<A, E, GeneratorPaths>) => A;
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";
“./create-capabilities.js” (namespace export)
Re-exports all named exports from the “./create-capabilities.js” module.
Signature
export * from "./create-capabilities.js";
“./create-preview.js” (namespace export)
Re-exports all named exports from the “./create-preview.js” module.
Signature
export * from "./create-preview.js";
“./create-resolver.js” (namespace export)
Re-exports all named exports from the “./create-resolver.js” module.
Signature
export * from "./create-resolver.js";
“./generate-output.js” (namespace export)
Re-exports all named exports from the “./generate-output.js” module.
Signature
export * from "./generate-output.js";
“./generate-types.js” (namespace export)
Re-exports all named exports from the “./generate-types.js” module.
Signature
export * from "./generate-types.js";
“./generate.js” (namespace export)
Re-exports all named exports from the “./generate.js” module.
Signature
export * from "./generate.js";
“./generator-cleanup.js” (namespace export)
Re-exports all named exports from the “./generator-cleanup.js” module.
Signature
export * from "./generator-cleanup.js";
“./generator-errors.js” (namespace export)
Re-exports all named exports from the “./generator-errors.js” module.
Signature
export * from "./generator-errors.js";
“./generator-filesystem.js” (namespace export)
Re-exports all named exports from the “./generator-filesystem.js” module.
Signature
export * from "./generator-filesystem.js";
“./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";
“./generator-paths.js” (namespace export)
Re-exports all named exports from the “./generator-paths.js” module.
Signature
export * from "./generator-paths.js";
“./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";
“./generator-process.js” (namespace export)
Re-exports all named exports from the “./generator-process.js” module.
Signature
export * from "./generator-process.js";
“./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";
“./generator-prompt.js” (namespace export)
Re-exports all named exports from the “./generator-prompt.js” module.
Signature
export * from "./generator-prompt.js";
“./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";
“./options.js” (namespace export)
Re-exports all named exports from the “./options.js” module.
Signature
export * from "./options.js";
“./prompt-driver.js” (namespace export)
Re-exports all named exports from the “./prompt-driver.js” module.
Signature
export * from "./prompt-driver.js";
“./scaffold-catalog.js” (namespace export)
Re-exports all named exports from the “./scaffold-catalog.js” module.
Signature
export * from "./scaffold-catalog.js";
“./template-root.js” (namespace export)
Re-exports all named exports from the “./template-root.js” module.
Signature
export * from "./template-root.js";
“./validate.js” (namespace export)
Re-exports all named exports from the “./validate.js” module.
Signature
export * from "./validate.js";
CatalogManifest
Signature
declare const CatalogManifest: CatalogManifest;
resolveCatalogVersion
Signature
declare const resolveCatalogVersion: (
manifest: CatalogManifest,
name: string,
spec: unknown,
) => string;
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>;
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"];
CREATE_DEPLOYMENTS
Supported deployment selections; none is the default.
Signature
declare const CREATE_DEPLOYMENTS: readonly ["pulumi", "none"];
CREATE_JOBS
Supported explicit local job-provider selections.
Signature
declare const CREATE_JOBS: readonly ["inngest-docker", "effect-mq-docker", "trigger-docker"];
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;
}>;
CREATE_TEMPLATES
Templates supported by explicit –template selection.
Signature
declare const CREATE_TEMPLATES: readonly ["minimal", "api", "agent", "fullstack"];
CreateCloud (type alias)
Supported cloud choice for project generation.
Signature
type CreateCloud = (typeof CREATE_CLOUDS)[number];
CreateDeployment (type alias)
Supported deployment choice for project generation.
Signature
type CreateDeployment = (typeof CREATE_DEPLOYMENTS)[number];
CreateJobs (type alias)
Supported local job provider selected by an explicit creation flag.
Signature
type CreateJobs = (typeof CREATE_JOBS)[number];
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;
}
CreateOptionsContext (interface)
Additional JSON output policy used while parsing creation flags.
Signature
export interface CreateOptionsContext {
readonly json?: boolean;
}
CreateOptionsError (class)
Public creation-flag usage failure with the stable RELKIT_CREATE_USAGE code.
Signature
declare class CreateOptionsError {
constructor(message: string);
}
code (property)
Stable usage code reported by CreateOptionsError.
Signature
readonly code: "RELKIT_CREATE_USAGE"
CreateTemplate (type alias)
Supported template selected by an explicit creation flag.
Signature
type CreateTemplate = (typeof CREATE_TEMPLATES)[number];
normalizeCreateOptions
Parses non-interactive create flags and applies the cloud-free defaults.
Signature
declare const normalizeCreateOptions: (
args: readonly string[],
context?: CreateOptionsContext,
) => CreateOptions;
project-manifest.schemas.ts
JsonObject
JSON object boundary, retaining unrelated package and workspace fields.
Signature
declare const JsonObject: Schema.$Record<Schema.String, Schema.Unknown>;
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>]
>;
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>]
>;
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>]
>;
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>;
PromptDriver
Signature
declare const PromptDriver: PromptDriver;
PromptOption
Signature
declare const PromptOption: PromptOption<Value>;
TextPromptOptions
Signature
declare const TextPromptOptions: TextPromptOptions;
createClackPromptDriver
Creates the public Clack adapter, forwarding fiber-owned cancellation to native prompts.
Signature
declare const createClackPromptDriver: (cancellationCode?: string) => PromptDriver;
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;
}
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;
}
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;
}
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;
}
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;
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" };
}>;
ScaffoldDependency
Signature
declare const ScaffoldDependency: ScaffoldDependency;
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";
scaffoldDependency
Selects one supported dependency from the release’s portable scaffold catalog.
Signature
declare const scaffoldDependency: (name: ScaffoldDependencyName) => ScaffoldDependency;
scaffold-catalog.types.ts
DependencySection (type alias)
Manifest section in which a scaffold introduces a supported dependency.
Signature
type DependencySection = "dependencies" | "devDependencies";
ScaffoldDependency (interface)
Concrete release-supported version and owning project manifest section.
Signature
export interface ScaffoldDependency {
readonly version: string;
readonly section: DependencySection;
}
ScaffoldDependencyName (type alias)
Intentional scaffold dependency names, retaining their literal keyed catalog contract.
Signature
type ScaffoldDependencyName = keyof typeof SCAFFOLD_DEPENDENCIES;
template-root.ts
resolveTemplateRoot
Preserves synchronous template-root resolution without a hidden filesystem dependency.
Signature
declare const resolveTemplateRoot: (
context: Pick<GenerateProjectContext, "cwd" | "templateRoot">,
) => string;
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>;
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,
) }
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>;
existingDirectoryEffect
Resolves an existing real directory without permitting symlink indirection.
Signature
declare const existingDirectoryEffect: (
path: string,
label: string,
) => Effect.Effect<string, GeneratorDomainError, GeneratorPaths>;
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>;
inspectDestinationEffect
Inspects only an absent or real directory destination without following symlinks.
Signature
declare const inspectDestinationEffect: (
path: string,
) => Effect.Effect<DestinationState, GeneratorDomainError, GeneratorPaths>;
invalid
Carries existing validation failures in the internal typed channel.
Signature
declare const invalid: (message: string) => GeneratorDomainError;
isAncestorOrSame
Checks a canonical path relationship using no I/O.
Signature
declare const isAncestorOrSame: (parent: string, child: string) => boolean;
validate.ts
CreateValidationContext
Signature
declare const CreateValidationContext: CreateValidationContext;
CreateValidationError
Signature
declare const CreateValidationError: typeof CreateValidationError;
ValidatedCreateOptions
Signature
declare const ValidatedCreateOptions: ValidatedCreateOptions;
isValidPackageName
Checks unscoped or scoped npm names without filesystem or Effect authority.
Signature
declare const isValidPackageName: (value: unknown) => value is string;
resolveCreateDestination
Preserves synchronous safe-destination resolution and its stable public errors.
Signature
declare const resolveCreateDestination: (
options: Pick<CreateOptions, "name" | "directory">,
context?: CreateValidationContext,
) => string;
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>;
validateCreateOptions
Preserves synchronous destination validation and its existing immutable result.
Signature
declare const validateCreateOptions: (
options: CreateOptions,
context?: CreateValidationContext,
) => ValidatedCreateOptions;
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
>;
validatePackageName
Asserts the existing package-name contract using its unchanged public constructor.
Signature
declare const validatePackageName: (value: unknown) => asserts value is string;
validate.types.ts
CreateValidationContext (interface)
Existing read-only creation-validation context.
Signature
export interface CreateValidationContext {
readonly cwd?: string;
readonly homeDirectory?: string;
readonly temporaryDirectory?: string;
}
DestinationState (interface)
Destination facts obtained before any generation mutation.
Signature
export interface DestinationState {
readonly exists: boolean;
readonly empty: boolean;
}
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;
}