Effect API
Generated public TypeScript reference for relkit/effect.
Common APIs
For configuration and examples, read effect.
Most-used APIs
These entries carry each API’s contract and example. The complete reference follows.
defineApp
Defines one immutable application topology synchronously.
Throws
The original validation error for invalid options.
Example
import { defineApp } from "relkit";
import { defineEnv } from "relkit/config";
const app = defineApp({ env: defineEnv({}), server: { port: 3000 } });
Signature
declare const defineApp: <
const Shape extends EnvShape,
const Bucket extends AppProviderBindings["bucket"] = undefined,
const Cache extends AppProviderBindings["cache"] = undefined,
const Jobs extends AppProviderBindings["jobs"] = undefined,
const Event extends AppProviderBindings["event"] = undefined,
const Model extends AppProviderBindings["model"] = undefined,
const Realtime extends AppProviderBindings["realtime"] = undefined,
const AgentState extends AppProviderBindings["agent-state"] = undefined,
const Exporters extends TelemetryExporterMap = Readonly<
Record<string, TelemetryExporterDescriptor<string, string, object>>
>,
>(
options: DefineAppOptions<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>,
) => ApplicationDescriptor<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>;
Since v0.2.0
Complete reference
Public imports
relkit/effect— 24 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.
agents.ts
“../agents/index.js” (namespace export)
Re-exports all named exports from the “../agents/index.js” module.
Signature
export * from "../agents/index.js";
app-config.types.ts
Declares server exposure and optional HTTP capability selection without loading native SDKs. Compiler validation supplies defaults before runtime generation; inspector settings select only the development bridge, independently of a tool.
ApiDocsConfig (interface)
API documentation visibility and domain exclusions.
Example
const docs: ApiDocsConfig = { enabledInProduction: false };
Signature
export interface ApiDocsConfig {
/** Explicitly selects Scalar; omitted/false keeps JSON OpenAPI only. */
readonly ui?: "scalar" | false;
/** Serves the OpenAPI document and the reference in production too. Defaults to `false`. */
readonly enabledInProduction?: boolean;
/** Services left out of the served document; their routes still answer. */
readonly excludeDomains?: readonly string[];
}
InspectorConfig (interface)
Development bridge selection; installing or running the UI is independent.
Example
const inspector: InspectorConfig = { enabled: true };
Signature
export interface InspectorConfig extends InspectorConfigurationInput {
/** Starts the bridge the Inspector connects to. Defaults to `false`. */
readonly enabled?: boolean;
/** Address the bridge listens on; port `0` takes a free port. */
readonly connection?: { readonly host?: string; readonly port?: number };
/** Largest payload preview the bridge returns, in bytes. Defaults to 1,048,576. */
readonly maxPreviewBytes?: number;
}
ServerConfig (interface)
HTTP server settings attached to an application descriptor.
Example
const server: ServerConfig = { port: 3000, apiDocs: { enabledInProduction: false } };
Signature
export interface ServerConfig {
/** Port the HTTP server listens on. */
readonly port?: number;
/** Largest request body in bytes; a larger one is answered `413`. A route can set its own. */
readonly maxBodyBytes?: number;
/** The served OpenAPI document and its reference page. */
readonly apiDocs?: ApiDocsConfig;
/** Serves the contract that the generated client reads. */
readonly clientContract?: boolean;
/** Enables the MCP endpoint; `{ auth: "required" }` limits it to signed-in callers. */
readonly mcp?: boolean | { readonly auth?: "required" };
/** Explicitly selects the optional AG-UI HTTP protocol independently of agent RPC. */
readonly agUi?: boolean;
/** Runs once after the application's providers are ready and before the server accepts
* requests; `getRelkit()` returns the application's handle inside it. A rejection stops startup.
* @example onStart: async () => { await getRelkit().functions.catalog.warmPrices({}); }
*/
readonly onStart?: () => void | Promise<void>;
}
app-observability.ts
AppTelemetry (class)
Injectable observer for application authoring operations.
Example
Effect.provide(defineAppEffect(options), AppTelemetryLive);
Signature
declare class AppTelemetry
AppTelemetryLive
Live spans, counts, failures, and durations for application operations.
Example
Effect.provide(defineAppEffect(options), AppTelemetryLive);
Signature
declare const AppTelemetryLive: Layer.Layer<AppTelemetry, never, never>;
observeApp
Applies an injected observer or the live observer to one operation.
Example
observeApp("define", Effect.succeed(app));
Signature
declare const observeApp: <A, E, R>(
operation: AppOperation,
effect: Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, R>;
app-observability.types.ts
Defines bounded application-authoring operation labels and the injectable observer contract. Observers preserve each operation’s success/error/services while the live implementation records its spans and outcomes.
AppOperation (type alias)
Fixed operation labels used for application authoring telemetry.
Example
const operation: AppOperation = "define";
Signature
type AppOperation =
| "define"
| "env.isDefinition"
| "id.derive"
| "runtimeMetadata.normalize"
| "constants.define"
| "prompt.define"
| "context.create"
| "context.resolve";
AppTelemetryService (interface)
A replaceable observer for application authoring operations.
Example
const observer: AppTelemetryService = { observe: (_name, effect) => effect };
Signature
export interface AppTelemetryService {
/** Surrounds one operation without changing its result.
* @param operation - A fixed operation label.
* @param effect - The operation to observe.
* @returns The observed Effect with its success and error channels intact.
* @example observer.observe("define", Effect.succeed(app));
*/
readonly observe: <A, E, R>(
operation: AppOperation,
effect: Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, R>;
}
app-provider-capabilities.ts
Provider capabilities accepted by application descriptors.
APP_PROVIDER_CAPABILITIES
Provider capabilities accepted by application descriptors.
Signature
declare const APP_PROVIDER_CAPABILITIES: readonly [
"bucket",
"cache",
"job",
"event",
"model",
"realtime",
"agent-state",
];
app-provider-normalization.ts
copyEffect
Copies a serializable configuration value through RelKit’s serializer.
Example
Effect.runSync(copyEffect({ port: 3000 }));
Signature
declare const copyEffect: <Value>(
value: Value,
) => Effect.Effect<Value, AppValidationFailure, never>;
normalizeDefaultsEffect
Checks default profile selections and returns an immutable copy.
Example
Effect.runSync(normalizeDefaultsEffect({}, undefined));
Signature
declare const normalizeDefaultsEffect: <Providers extends AppProviderBindings>(
providers: Partial<
Record<
"bucket" | "cache" | "job" | "event" | "model" | "realtime" | "agent-state",
NormalizedProviderProfiles<ProviderAdapter>
>
>,
defaults: AppProviderDefaults<Providers> | undefined,
) => Effect.Effect<
Readonly<{
bucket?: ProfileFor<Providers, "bucket">;
cache?: ProfileFor<Providers, "cache">;
job?: ProfileFor<Providers, "job">;
event?: ProfileFor<Providers, "event">;
model?: ProfileFor<Providers, "model">;
realtime?: ProfileFor<Providers, "realtime">;
"agent-state"?: ProfileFor<Providers, "agent-state">;
}>,
AppValidationFailure,
never
>;
normalizeProvidersEffect
Normalizes configured provider profiles in capability order.
Example
Effect.runSync(normalizeProvidersEffect({}));
Signature
declare const normalizeProvidersEffect: (
options: AppProviderBindings,
) => Effect.Effect<
Partial<
Record<
"bucket" | "cache" | "job" | "event" | "model" | "realtime" | "agent-state",
NormalizedProviderProfiles<ProviderAdapter>
>
>,
AppValidationFailure,
never
>;
app-provider.types.ts
AppProviderBinding (type alias)
The binding of one capability among the bindings of a defineApp call, or undefined.
Example
type Cache = AppProviderBinding<{ cache: typeof redisAdapter }, "cache">;
Signature
type AppProviderBinding<Providers, Key> = Key extends keyof Providers ? Providers[Key] : undefined;
AppProviderBindings (type alias)
Provider bindings as one defineApp call infers them: a capability the call leaves out is
undefined, which is how a default for it is told apart from a default for a bound one.
Example
const bindings: AppProviderBindings = { cache: redisAdapter, bucket: undefined };
Signature
type AppProviderBindings = {
readonly [Key in keyof AppProviderInputs]?: AppProviderInputs[Key] | undefined;
};
AppProviderCapability (type alias)
Provider capabilities accepted by the application descriptor.
Example
const capability: AppProviderCapability = "cache";
Signature
type AppProviderCapability = (typeof APP_PROVIDER_CAPABILITIES)[number];
AppProviderDefaults (type alias)
Default profile per capability, named as the options are (jobs, not job). Each entry
accepts the profile names of that capability’s binding, or "default" for a single adapter.
Example
const defaults: AppProviderDefaults<typeof providers> = { cache: "default" };
Signature
type AppProviderDefaults<Providers extends AppProviderBindings> = {
// NoInfer: a default never decides what a binding is; it is only checked against it.
readonly [Key in keyof AppProviderInputs]?: NoInfer<
DefaultProfile<AppProviderBinding<Providers, Key>, Key>
>;
};
AppProviderInputs (interface)
Optional provider bindings for every supported capability.
Example
const providers: AppProviderInputs = { cache: redisAdapter };
Signature
export interface AppProviderInputs {
/** Object storage for buckets: one adapter, or a map of named profiles. */
readonly bucket?: CapabilityInput<"bucket">;
/** Key-value storage for caches: one adapter, or a map of named profiles. */
readonly cache?: CapabilityInput<"cache">;
/** The backend that runs jobs and tasks: one adapter, or a map of named profiles. */
readonly jobs?: CapabilityInput<"job">;
/** The transport that delivers events: one adapter, or a map of named profiles. */
readonly event?: CapabilityInput<"event">;
/** Language models for agents: one adapter, or a map of named profiles. */
readonly model?: CapabilityInput<"model">;
/** The transport of realtime channels: one adapter, or a map of named profiles. */
readonly realtime?: CapabilityInput<"realtime">;
/** Storage for agent threads and runs: one adapter, or a map of named profiles. */
readonly "agent-state"?: CapabilityInput<"agent-state">;
}
AppProviderOptions (type alias)
The provider options of defineApp, one property per capability so that each binding is
inferred from its own property.
Example
const options: AppProviderOptions<{ cache: typeof redisAdapter }> = { cache: redisAdapter };
Signature
type AppProviderOptions<Providers extends AppProviderBindings> = {
readonly [Key in keyof AppProviderInputs]?: AppProviderBinding<Providers, Key>;
};
ApplicationProfilesOf (type alias)
The profile names of an application per capability, from the type of its descriptor. The
generated context registry uses it to type profile in buckets, caches, events and channels.
A capability without a provider has no names.
Example
interface ApplicationProfiles extends ApplicationProfilesOf<typeof app> {}
Signature
type ApplicationProfilesOf<Application> = Application extends {
readonly defaults: infer Defaults;
}
? { readonly [Capability in keyof Defaults]-?: NonNullable<Defaults[Capability]> }
: {};
NoProviderConfigured (interface)
The type a defaults entry has when the application binds no provider to its capability, so
the type error on that entry names the capability.
Example
const missing: NoProviderConfigured<"cache"> = { capability: "cache" };
Signature
export interface NoProviderConfigured<Capability extends string> {
readonly capability: Capability;
}
NormalizedAppProviderDefaults (type alias)
Validated default profiles keyed by normalized capability names.
Example
const defaults: NormalizedAppProviderDefaults<typeof providers> = { cache: "default" };
Signature
type NormalizedAppProviderDefaults<Providers extends AppProviderBindings> = Readonly<{
[Capability in AppProviderCapability]?: ProfileFor<Providers, Capability>;
}>;
NormalizedProviders (type alias)
Provider profiles inferred from the authored provider bindings.
Example
type Profiles = NormalizedProviders<typeof providers>;
Signature
type NormalizedProviders<Providers extends AppProviderBindings> = {
readonly [
Capability in AppProviderCapability as [ProviderInputFor<Providers, Capability>] extends [never]
? never
: Capability
]: NormalizedProviderProfiles<AdapterOf<ProviderInputFor<Providers, Capability>>>;
};
app-runtime-metadata.ts
Copies application server/deployment metadata and validates optional inspection selection before descriptor freezing. These pure authoring effects acquire no listeners or providers; invalid input retains the public validation cause.
normalizeAppRuntimeMetadataEffect
Normalizes immutable runtime policy without starting its selected features.
Signature
declare const normalizeAppRuntimeMetadataEffect: (
options: Pick<ApplicationDescriptor, "server" | "inspector" | "deployment" | "check">,
) => Effect.Effect<
{
server:
| {
port?: number;
maxBodyBytes?: number;
apiDocs?: ApiDocsConfig;
clientContract?: boolean;
mcp?: boolean | { readonly auth?: "required" };
agUi?: boolean;
}
| undefined;
inspector: InspectorConfiguration | undefined;
deployment: Readonly<Record<string, JsonValue>> | undefined;
check: AppCheckConfig | undefined;
},
AppValidationFailure,
never
>;
app-validation.ts
AppValidationFailure (class)
Expected invalid application input with the original cause preserved.
Example
if (error._tag === "AppValidationFailure") console.error(error.message);
Signature
declare class AppValidationFailure
deriveApplicationId
Synchronous package-name ID adapter.
Throws
The original normalization error for invalid input.
Example
deriveApplicationId("@acme/orders");
Signature
declare const deriveApplicationId: (packageName: string) => string;
deriveApplicationIdEffect
Derives an application ID from a package name in Effect.
Example
Effect.runSync(deriveApplicationIdEffect("@acme/orders"));
Signature
declare const deriveApplicationIdEffect: (
packageName: string,
) => Effect.Effect<StableId, AppValidationFailure, never>;
isEnvDefinition
Synchronous environment descriptor guard.
Example
if (isEnvDefinition(value)) console.log(value.shape);
Signature
declare const isEnvDefinition: (value: unknown) => value is EnvDefinition<EnvShape>;
isEnvDefinitionEffect
Checks the complete environment descriptor shape in Effect.
Example
Effect.runSync(isEnvDefinitionEffect(value));
Signature
declare const isEnvDefinitionEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
buckets.ts
“../buckets/index.js” (namespace export)
Re-exports all named exports from the “../buckets/index.js” module.
Signature
export * from "../buckets/index.js";
cache.ts
“../cache/index.js” (namespace export)
Re-exports all named exports from the “../cache/index.js” module.
Signature
export * from "../cache/index.js";
config.ts
“../config/index.js” (namespace export)
Re-exports all named exports from the “../config/index.js” module.
Signature
export * from "../config/index.js";
“./app-validation.js” (namespace export)
Re-exports all named exports from the “./app-validation.js” module.
Signature
export * from "./app-validation.js";
“./context-descriptors.js” (namespace export)
Re-exports all named exports from the “./context-descriptors.js” module.
Signature
export * from "./context-descriptors.js";
“./define-app.js” (namespace export)
Re-exports all named exports from the “./define-app.js” module.
Signature
export * from "./define-app.js";
AppTelemetry
Signature
declare const AppTelemetry: typeof AppTelemetry;
AppTelemetryLive
Signature
declare const AppTelemetryLive: Layer<AppTelemetry, never, never>;
context-descriptors.ts
“./context-descriptors.types.js” (namespace export)
Re-exports all named exports from the “./context-descriptors.types.js” module.
Signature
export * from "./context-descriptors.types.js";
ContextDescriptorFailure (class)
Expected invalid constant or prompt descriptor input.
Example
if (error._tag === "ContextDescriptorFailure") console.error(error.message);
Signature
declare class ContextDescriptorFailure
defineConstants
Synchronous constants descriptor adapter.
Throws
The original validation error for invalid values.
Example
import { defineConstants, defineEnv, env } from "relkit";
const environment = defineEnv({ REGION: env.string() });
const limits = defineConstants({ maxItems: 20, region: environment.REGION });
// Literal values are immutable; the environment reference resolves with the context.
See
Signature
declare const defineConstants: <const Values extends ConstantsShape>(
values: Values,
options?: ContextDescriptorOptions,
) => ConstantsDescriptor<Values>;
defineConstantsEffect
Defines a frozen constants descriptor in Effect.
Example
Effect.runSync(defineConstantsEffect({ region: "eu" }));
Signature
declare const defineConstantsEffect: <const Values extends ConstantsShape>(
values: Values,
options?: ContextDescriptorOptions | undefined,
) => Effect.Effect<ConstantsDescriptor<Values>, ContextDescriptorFailure, never>;
definePrompt
Synchronous prompt descriptor adapter.
Throws
The original validation error for invalid text.
Example
import { definePrompt } from "relkit";
const support = definePrompt(["Use the order details.", "Do not invent delivery dates."]);
// support.value preserves the two fragments in order.
See
Signature
declare const definePrompt: <const Value extends PromptValue>(
value: Value,
options?: ContextDescriptorOptions,
) => PromptDescriptor<Value>;
definePromptEffect
Defines a frozen prompt descriptor in Effect.
Example
Effect.runSync(definePromptEffect("Be concise."));
Signature
declare const definePromptEffect: <const Value extends PromptValue>(
value: Value,
options?: ContextDescriptorOptions | undefined,
) => Effect.Effect<PromptDescriptor<Value>, ContextDescriptorFailure, never>;
context-descriptors.types.ts
ConstantResolver (type alias)
Computes one constant for each context resolution.
Example
const region: ConstantResolver<string> = ({ env }) => String(env.REGION);
Signature
type ConstantResolver<Value = unknown> = (options: ContextResolverOptions) => MaybePromise<Value>;
ConstantValue (type alias)
Accepted static, environment, or dynamic constant input.
Example
const value: ConstantValue = "eu-west-1";
Signature
type ConstantValue = JsonValue | EnvRef | ConstantResolver;
ConstantsDescriptor (interface)
Immutable descriptor for one set of constants.
Example
const descriptor: ConstantsDescriptor = defineConstants({ region: "eu" });
Signature
export interface ConstantsDescriptor<
Values extends ConstantsShape = ConstantsShape,
> extends DescriptorBase<"constants", string> {
readonly values: Values;
}
ConstantsShape (type alias)
Named constant inputs for one descriptor.
Example
const values: ConstantsShape = { region: "eu-west-1" };
Signature
type ConstantsShape = Readonly<Record<string, ConstantValue>>;
ContextDescriptorOptions (interface)
Optional stable identity for a context descriptor.
Example
const options: ContextDescriptorOptions = { id: "support.prompt" };
Signature
export interface ContextDescriptorOptions {
readonly id?: string;
}
ContextResolverOptions (interface)
Inputs available to a dynamic constant resolver.
Example
const options: ContextResolverOptions = { env: {}, signal, log };
Signature
export interface ContextResolverOptions {
readonly env: Readonly<Record<string, unknown>>;
readonly signal: AbortSignal;
readonly log: PublicLogger;
}
PromptDescriptor (interface)
Immutable descriptor for one prompt.
Example
const descriptor: PromptDescriptor = definePrompt("Be concise.");
Signature
export interface PromptDescriptor<Value extends PromptValue = PromptValue> extends DescriptorBase<
"prompt",
string
> {
readonly value: Value;
}
PromptValue (type alias)
Prompt text or an ordered list of prompt fragments.
Example
const prompt: PromptValue = ["Be concise.", "Use tools."];
Signature
type PromptValue = string | readonly string[];
ResolvedConstants (type alias)
Resolved values inferred from a constants descriptor.
Example
type Values = ResolvedConstants<typeof constants>;
Signature
type ResolvedConstants<Descriptor extends ConstantsDescriptor> = {
readonly [Key in keyof Descriptor["values"]]: ResolveConstant<Descriptor["values"][Key]>;
};
ResolvedPrompt (type alias)
Resolved prompt text inferred from a prompt descriptor.
Example
type Text = ResolvedPrompt<typeof prompt>;
Signature
type ResolvedPrompt<Descriptor extends PromptDescriptor> = Descriptor["value"];
context-resolution-service.ts
AppConstantRunner (class)
Replaceable boundary for dynamic constant callback execution.
Example
Effect.provide(resolver.resolveEffect(context), AppConstantRunnerLive);
Signature
declare class AppConstantRunner
AppConstantRunnerLive
Live runner that propagates Effect interruption into callback AbortSignals.
Example
Effect.provide(resolver.resolveEffect(context), AppConstantRunnerLive);
Signature
declare const AppConstantRunnerLive: Layer.Layer<AppConstantRunner, never, never>;
AppConstantRunnerPromiseLive
Compatibility runner that passes the caller’s exact signal to callbacks.
Signature
declare const AppConstantRunnerPromiseLive: Layer.Layer<AppConstantRunner, never, never>;
AppConstantRunnerService
Replaceable execution boundary for dynamic constant callbacks.
Example
const runner: AppConstantRunnerService = { run: () => Effect.succeed("eu") };
Signature
export interface AppConstantRunnerService {
/** Invokes a dynamic constant resolver.
* @param resolver - User supplied constant callback.
* @param options - Environment, logger, and caller signal available to the callback.
* @returns The callback result or ContextResolutionFailure.
* @example runner.run(() => "eu", { env: {}, log });
*/
readonly run: (
resolver: ConstantResolver,
options: {
readonly env: Readonly<Record<string, unknown>>;
readonly log: PublicLogger;
readonly signal: AbortSignal;
},
) => Effect.Effect<unknown, ContextResolutionFailure>;
}
context-resolution-service.types.ts
AppConstantRunnerService (interface)
Replaceable execution boundary for dynamic constant callbacks.
Example
const runner: AppConstantRunnerService = { run: () => Effect.succeed("eu") };
Signature
export interface AppConstantRunnerService {
/** Invokes a dynamic constant resolver.
* @param resolver - User supplied constant callback.
* @param options - Environment, logger, and caller signal available to the callback.
* @returns The callback result or ContextResolutionFailure.
* @example runner.run(() => "eu", { env: {}, log });
*/
readonly run: (
resolver: ConstantResolver,
options: {
readonly env: Readonly<Record<string, unknown>>;
readonly log: PublicLogger;
readonly signal: AbortSignal;
},
) => Effect.Effect<unknown, ContextResolutionFailure>;
}
context-resolver.ts
“./context-resolver.types.js” (namespace export)
Re-exports all named exports from the “./context-resolver.types.js” module.
Signature
export * from "./context-resolver.types.js";
ContextResolutionFailure (class)
Expected context registration or resolution failure with its original cause.
Example
if (error._tag === "ContextResolutionFailure") console.error(error.message);
Signature
declare class ContextResolutionFailure
createApplicationContextResolver
Builds a context resolver synchronously for existing application callers.
Throws
TypeError when constant names collide.
Example
createApplicationContextResolver({ env: {} });
Signature
declare const createApplicationContextResolver: (
options: ApplicationContextOptions,
) => ApplicationContextResolver;
createApplicationContextResolverEffect
Builds an application context resolver in Effect.
Example
Effect.runSync(createApplicationContextResolverEffect({ env: {} }));
Signature
declare const createApplicationContextResolverEffect: (
options: ApplicationContextOptions,
) => Effect.Effect<ApplicationContextResolver, ContextResolutionFailure, never>;
context-resolver.types.ts
ApplicationContextOptions (interface)
Static and dynamic descriptor inputs for one context resolver.
Example
const options: ApplicationContextOptions = { env: {} };
Signature
export interface ApplicationContextOptions {
readonly constants?: Readonly<Record<string, ConstantsDescriptor>>;
readonly prompts?: Readonly<Record<string, PromptDescriptor>>;
readonly env: Readonly<Record<string, unknown>>;
}
ApplicationContextResolver (interface)
Resolves the current application constants and prompts.
Example
const resolver: ApplicationContextResolver = createApplicationContextResolver({ env: {} });
Signature
export interface ApplicationContextResolver {
/** Resolves values in Effect with a replaceable constant runner.
* @param options - Logger and cancellation signal.
* @returns Resolved values or ContextResolutionFailure; requires AppConstantRunner.
* @example Effect.runPromise(resolver.resolveEffect(context).pipe(Effect.provide(AppConstantRunnerLive)));
*/
readonly resolveEffect: (
options: ApplicationResolveOptions,
) => Effect.Effect<ResolvedApplicationContext, ContextResolutionFailure, AppConstantRunner>;
/** Promise compatibility adapter for application handlers.
* @param options - Logger and cancellation signal.
* @returns Resolved values or a rejection with the original resolver error.
* @example await resolver.resolve({ signal, log });
*/
readonly resolve: (options: ApplicationResolveOptions) => Promise<ResolvedApplicationContext>;
}
ApplicationResolveOptions (interface)
Invocation inputs required to resolve dynamic constants.
Example
const context: ApplicationResolveOptions = { signal, log };
Signature
export interface ApplicationResolveOptions {
readonly signal: AbortSignal;
readonly log: PublicLogger;
}
ResolvedApplicationContext (interface)
Context values produced by a resolver invocation.
Example
const constants = resolved.constants;
Signature
export interface ResolvedApplicationContext {
readonly constants: Readonly<Record<string, unknown>>;
readonly prompts: Readonly<Record<string, PromptValue>>;
}
define-app.ts
Constructs immutable application descriptors without acquiring providers or optional tools. Shared bridge validation rejects obsolete inspection settings; the synchronous facade preserves original validation errors for authors.
“./define-app.types.js” (namespace export)
Re-exports all named exports from the “./define-app.types.js” module.
Signature
export * from "./define-app.types.js";
APP_PROVIDER_CAPABILITIES
Signature
declare const APP_PROVIDER_CAPABILITIES: readonly [
"bucket",
"cache",
"job",
"event",
"model",
"realtime",
"agent-state",
];
defineAppEffect
Defines one immutable application topology in Effect.
Example
Effect.runSync(defineAppEffect({ env: defineEnv({}) }));
Signature
declare const defineAppEffect: <
const Shape extends EnvShape,
const Bucket extends AppProviderBindings["bucket"] = undefined,
const Cache extends AppProviderBindings["cache"] = undefined,
const Jobs extends AppProviderBindings["jobs"] = undefined,
const Event extends AppProviderBindings["event"] = undefined,
const Model extends AppProviderBindings["model"] = undefined,
const Realtime extends AppProviderBindings["realtime"] = undefined,
const AgentState extends AppProviderBindings["agent-state"] = undefined,
const Exporters extends TelemetryExporterMap = Readonly<
Record<string, TelemetryExporterDescriptor<string, string, object>>
>,
>(
options: DefineAppOptions<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>,
) => Effect.Effect<
ApplicationDescriptor<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>,
AppValidationFailure,
never
>;
define-app.types.ts
ApiDocsConfig
API documentation visibility and domain exclusions.
Example
const docs: ApiDocsConfig = { enabledInProduction: false };
Signature
export interface ApiDocsConfig {
/** Explicitly selects Scalar; omitted/false keeps JSON OpenAPI only. */
readonly ui?: "scalar" | false;
/** Serves the OpenAPI document and the reference in production too. Defaults to `false`. */
readonly enabledInProduction?: boolean;
/** Services left out of the served document; their routes still answer. */
readonly excludeDomains?: readonly string[];
}
AppCheckConfig (interface)
Opt-in relkit check rules.
Example
const check: AppCheckConfig = { unusedErrors: true };
Signature
export interface AppCheckConfig {
/** Warn when a function declares an error that its handler never raises. Defaults to `false`. */
readonly unusedErrors?: boolean;
}
AppDeploymentConfig (type alias)
JSON deployment metadata attached to the application descriptor.
Example
const deployment: AppDeploymentConfig = { engine: "pulumi" };
Signature
type AppDeploymentConfig = Readonly<Record<string, JsonValue>>;
AppProviderBinding
The binding of one capability among the bindings of a defineApp call, or undefined.
Example
type Cache = AppProviderBinding<{ cache: typeof redisAdapter }, "cache">;
Signature
type AppProviderBinding<Providers, Key> = Key extends keyof Providers ? Providers[Key] : undefined;
AppProviderBindings
Provider bindings as one defineApp call infers them: a capability the call leaves out is
undefined, which is how a default for it is told apart from a default for a bound one.
Example
const bindings: AppProviderBindings = { cache: redisAdapter, bucket: undefined };
Signature
type AppProviderBindings = {
readonly [Key in keyof AppProviderInputs]?: AppProviderInputs[Key] | undefined;
};
AppProviderCapability
Signature
declare const AppProviderCapability:
"bucket" | "cache" | "job" | "event" | "model" | "realtime" | "agent-state";
AppProviderDefaults
Default profile per capability, named as the options are (jobs, not job). Each entry
accepts the profile names of that capability’s binding, or "default" for a single adapter.
Example
const defaults: AppProviderDefaults<typeof providers> = { cache: "default" };
Signature
type AppProviderDefaults<Providers extends AppProviderBindings> = {
// NoInfer: a default never decides what a binding is; it is only checked against it.
readonly [Key in keyof AppProviderInputs]?: NoInfer<
DefaultProfile<AppProviderBinding<Providers, Key>, Key>
>;
};
AppProviderInputs
Optional provider bindings for every supported capability.
Example
const providers: AppProviderInputs = { cache: redisAdapter };
Signature
export interface AppProviderInputs {
/** Object storage for buckets: one adapter, or a map of named profiles. */
readonly bucket?: CapabilityInput<"bucket">;
/** Key-value storage for caches: one adapter, or a map of named profiles. */
readonly cache?: CapabilityInput<"cache">;
/** The backend that runs jobs and tasks: one adapter, or a map of named profiles. */
readonly jobs?: CapabilityInput<"job">;
/** The transport that delivers events: one adapter, or a map of named profiles. */
readonly event?: CapabilityInput<"event">;
/** Language models for agents: one adapter, or a map of named profiles. */
readonly model?: CapabilityInput<"model">;
/** The transport of realtime channels: one adapter, or a map of named profiles. */
readonly realtime?: CapabilityInput<"realtime">;
/** Storage for agent threads and runs: one adapter, or a map of named profiles. */
readonly "agent-state"?: CapabilityInput<"agent-state">;
}
AppProviderOptions
The provider options of defineApp, one property per capability so that each binding is
inferred from its own property.
Example
const options: AppProviderOptions<{ cache: typeof redisAdapter }> = { cache: redisAdapter };
Signature
type AppProviderOptions<Providers extends AppProviderBindings> = {
readonly [Key in keyof AppProviderInputs]?: AppProviderBinding<Providers, Key>;
};
AppTelemetryConfig (interface)
Application telemetry settings parameterized by exporters.
Example
const telemetry: AppTelemetryConfig = { redaction: { mode: "off" } };
Signature
export interface AppTelemetryConfig<
Exporters extends TelemetryExporterMap = TelemetryExporterMap,
> extends TelemetryConfiguration<Exporters> {
/** Which signals are recorded; all of them when omitted. */
readonly capture?: NonNullable<TelemetryConfiguration<Exporters>["capture"]>;
/** How recorded payloads are redacted, and the largest payload kept. */
readonly redaction?: NonNullable<TelemetryConfiguration<Exporters>["redaction"]>;
/** Limits of the local store: records, age and bytes. */
readonly localRetention?: NonNullable<TelemetryConfiguration<Exporters>["localRetention"]>;
/** Share of traces and lowest log level sent to exporters. */
readonly exportSampling?: NonNullable<TelemetryConfiguration<Exporters>["exportSampling"]>;
/** Exporters by name, such as `otlp()` or `sentry()`. */
readonly exporters?: Exporters;
}
ApplicationDescriptor (type alias)
Immutable normalized application descriptor returned by defineApp.
Example
const descriptor: ApplicationDescriptor = defineApp({ env: defineEnv({}) });
Signature
type ApplicationDescriptor<
Shape extends EnvShape = EnvShape,
Providers extends AppProviderBindings = AppProviderBindings,
Exporters extends TelemetryExporterMap = TelemetryExporterMap,
> = DescriptorBase<"app", string> &
NormalizedProviders<Providers> & {
readonly env: EnvDefinition<Shape>;
readonly defaults: NormalizedAppProviderDefaults<Providers>;
readonly telemetry?: AppTelemetryConfig<Exporters>;
readonly server?: ServerConfig;
readonly inspector?: InspectorConfig;
readonly deployment?: AppDeploymentConfig;
readonly check?: AppCheckConfig;
};
ApplicationProfilesOf
The profile names of an application per capability, from the type of its descriptor. The
generated context registry uses it to type profile in buckets, caches, events and channels.
A capability without a provider has no names.
Example
interface ApplicationProfiles extends ApplicationProfilesOf<typeof app> {}
Signature
type ApplicationProfilesOf<Application> = Application extends {
readonly defaults: infer Defaults;
}
? { readonly [Capability in keyof Defaults]-?: NonNullable<Defaults[Capability]> }
: {};
DefineAppBindings (interface)
The bindings of one defineApp call, from its one type parameter per capability.
Example
type Bindings = DefineAppBindings<typeof s3Adapter>;
Signature
export interface DefineAppBindings<
Bucket = undefined,
Cache = undefined,
Jobs = undefined,
Event = undefined,
Model = undefined,
Realtime = undefined,
AgentState = undefined,
> {
readonly bucket: Bucket;
readonly cache: Cache;
readonly jobs: Jobs;
readonly event: Event;
readonly model: Model;
readonly realtime: Realtime;
readonly "agent-state": AgentState;
}
DefineAppOptions (type alias)
Authored application topology and runtime settings.
Example
const options: DefineAppOptions<{}, {}> = { env: defineEnv({}) };
Signature
type DefineAppOptions<
Shape extends EnvShape,
Providers extends AppProviderBindings,
Exporters extends TelemetryExporterMap = TelemetryExporterMap,
> = DescriptorMetadata & {
/** Stable name of the application in graphs, telemetry and deployment. */
readonly id?: string;
/** The environment contract from `defineEnv`; handlers read it as `context.env`. */
readonly env: EnvDefinition<Shape>;
/** Object storage for buckets: one adapter, or a map of named profiles. */
readonly bucket?: AppProviderBinding<Providers, "bucket">;
/** Key-value storage for caches: one adapter, or a map of named profiles. */
readonly cache?: AppProviderBinding<Providers, "cache">;
/** The backend that runs jobs and tasks: one adapter, or a map of named profiles. */
readonly jobs?: AppProviderBinding<Providers, "jobs">;
/** The transport that delivers events: one adapter, or a map of named profiles. */
readonly event?: AppProviderBinding<Providers, "event">;
/** Language models for agents: one adapter, or a map of named profiles. */
readonly model?: AppProviderBinding<Providers, "model">;
/** The transport of realtime channels: one adapter, or a map of named profiles. */
readonly realtime?: AppProviderBinding<Providers, "realtime">;
/** Storage for agent threads and runs: one adapter, or a map of named profiles. */
readonly "agent-state"?: AppProviderBinding<Providers, "agent-state">;
/** The profile a descriptor uses when it names none, per capability. */
readonly defaults?: AppProviderDefaults<Providers>;
/** Redaction, local retention, sampling and exporters of telemetry. */
readonly telemetry?: AppTelemetryConfig<Exporters>;
/** The HTTP server: port, body limit, API reference, MCP and startup hook. */
readonly server?: ServerConfig;
/** The development Inspector's bridge; off unless `enabled` is `true`. */
readonly inspector?: InspectorConfig;
/** JSON metadata for the deployment engine, such as `{ engine: "pulumi" }`. */
readonly deployment?: AppDeploymentConfig;
/** Opt-in rules of `relkit check`. */
readonly check?: AppCheckConfig;
};
InspectorConfig
Development bridge selection; installing or running the UI is independent.
Example
const inspector: InspectorConfig = { enabled: true };
Signature
export interface InspectorConfig extends InspectorConfigurationInput {
/** Starts the bridge the Inspector connects to. Defaults to `false`. */
readonly enabled?: boolean;
/** Address the bridge listens on; port `0` takes a free port. */
readonly connection?: { readonly host?: string; readonly port?: number };
/** Largest payload preview the bridge returns, in bytes. Defaults to 1,048,576. */
readonly maxPreviewBytes?: number;
}
NoProviderConfigured
The type a defaults entry has when the application binds no provider to its capability, so
the type error on that entry names the capability.
Example
const missing: NoProviderConfigured<"cache"> = { capability: "cache" };
Signature
export interface NoProviderConfigured<Capability extends string> {
readonly capability: Capability;
}
NormalizedAppProviderDefaults
Signature
declare const NormalizedAppProviderDefaults: Readonly<{
bucket?: ProfileFor<Providers, "bucket">;
cache?: ProfileFor<Providers, "cache">;
job?: ProfileFor<Providers, "job">;
event?: ProfileFor<Providers, "event">;
model?: ProfileFor<Providers, "model">;
realtime?: ProfileFor<Providers, "realtime">;
"agent-state"?: ProfileFor<Providers, "agent-state">;
}>;
ServerConfig
HTTP server settings attached to an application descriptor.
Example
const server: ServerConfig = { port: 3000, apiDocs: { enabledInProduction: false } };
Signature
export interface ServerConfig {
/** Port the HTTP server listens on. */
readonly port?: number;
/** Largest request body in bytes; a larger one is answered `413`. A route can set its own. */
readonly maxBodyBytes?: number;
/** The served OpenAPI document and its reference page. */
readonly apiDocs?: ApiDocsConfig;
/** Serves the contract that the generated client reads. */
readonly clientContract?: boolean;
/** Enables the MCP endpoint; `{ auth: "required" }` limits it to signed-in callers. */
readonly mcp?: boolean | { readonly auth?: "required" };
/** Explicitly selects the optional AG-UI HTTP protocol independently of agent RPC. */
readonly agUi?: boolean;
/** Runs once after the application's providers are ready and before the server accepts
* requests; `getRelkit()` returns the application's handle inside it. A rejection stops startup.
* @example onStart: async () => { await getRelkit().functions.catalog.warmPrices({}); }
*/
readonly onStart?: () => void | Promise<void>;
}
dev-handler-table.ts
Holds the function handler table of a generated server behind a stable registry object,
so relkit dev can replace every handler at once without restarting the process. The
generated server passes the stable registry to invocation and keeps its executable
manifest object; swap replaces the registry and the manifest’s functions and
targets entries in one synchronous step, so a request sees either the old table or the
new one, never a mix. Requests already running keep the handler they resolved.
HandlerTable
A stable registry whose table can be replaced atomically.
Signature
export interface HandlerTable {
/** Registry object handed to invocation; it always delegates to the current table. */
readonly registry: SwappableRegistry;
/** Number of swaps applied since startup. */
readonly generation: number;
/**
* Replaces the registry and the manifest's function and target entries in one step.
* @param next - Registry verified against the new graph and manifest.
* @param manifest - The new generation's manifest maps.
*/
readonly swap: (next: SwappableRegistry, manifest: SwappableManifest) => void;
}
SwappableManifest
The manifest maps the running server reads handlers and targets from.
Signature
export interface SwappableManifest {
readonly functions?: Record<string, SwappableHandler>;
readonly targets?: Record<string, object>;
}
createHandlerTable
Wraps a verified registry and the manifest whose entries routes resolve per request.
Signature
declare const createHandlerTable: (
initial: SwappableRegistry,
manifest: SwappableManifest,
) => HandlerTable;
dev-handler-table.types.ts
Contracts of the development handler table and its reload hook.
DevelopmentReloadOptions (interface)
Inputs the generated server supplies to the reload hook.
Signature
export interface DevelopmentReloadOptions {
readonly projectRoot: string;
/** Directory of the running server's `index.ts`. */
readonly serverDirectory: string;
readonly table: HandlerTable;
/** Manifest the server started with; later reloads compare against the last one applied. */
readonly runtimeManifest: ReloadedManifest;
/**
* Verifies a graph and manifest pair the same way startup does.
* @param graph - Graph of the new generation.
* @param manifest - Manifest module's `runtimeManifest` export.
* @returns The verified registry.
*/
readonly createRegistry: (
graph: ApplicationGraph,
manifest: SwappableManifest,
) => SwappableRegistry;
}
DevelopmentReloadReply (type alias)
The server’s answer to a reload request.
Signature
type DevelopmentReloadReply =
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: true;
/** Application modules evaluated again, project-relative. */
readonly reimported: readonly string[];
readonly pid: number;
}
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: false;
readonly error: string;
readonly pid: number;
};
DevelopmentReloadRequest (interface)
A request from relkit dev to load a new handler table.
Signature
export interface DevelopmentReloadRequest {
readonly type: "relkit.dev.reload";
/** Correlates the acknowledgement. */
readonly id: number;
/** Manifest module file name in the server directory. */
readonly manifest: string;
/** Graph JSON file name in the server directory. */
readonly graph: string;
}
HandlerTable (interface)
A stable registry whose table can be replaced atomically.
Signature
export interface HandlerTable {
/** Registry object handed to invocation; it always delegates to the current table. */
readonly registry: SwappableRegistry;
/** Number of swaps applied since startup. */
readonly generation: number;
/**
* Replaces the registry and the manifest's function and target entries in one step.
* @param next - Registry verified against the new graph and manifest.
* @param manifest - The new generation's manifest maps.
*/
readonly swap: (next: SwappableRegistry, manifest: SwappableManifest) => void;
}
ReloadedManifest (interface)
Manifest maps that a reload must leave untouched; a re-evaluated entry forces a restart.
Signature
export interface ReloadedManifest extends SwappableManifest {
readonly middleware?: Readonly<Record<string, object>>;
readonly hooks?: Readonly<Record<string, object>>;
readonly requestTransforms?: Readonly<Record<string, object>>;
readonly agents?: Readonly<Record<string, object>>;
readonly tools?: Readonly<Record<string, object>>;
readonly channels?: Readonly<Record<string, object>>;
readonly tasks?: Readonly<Record<string, object>>;
readonly jobs?: Readonly<Record<string, object>>;
readonly application?: object;
}
SwappableHandler (type alias)
A handler as the generated server stores it: a function or a handler-bearing descriptor.
Signature
type SwappableHandler = object;
SwappableManifest (interface)
The manifest maps the running server reads handlers and targets from.
Signature
export interface SwappableManifest {
readonly functions?: Record<string, SwappableHandler>;
readonly targets?: Record<string, object>;
}
SwappableRegistry (interface)
The function registry shape the engine’s verified registry has; declared structurally
here because relkit/host may not depend on the engine.
Signature
export interface SwappableRegistry extends ReadonlyMap<string, SwappableHandler> {
readonly graphHash: string;
readonly functionIds: readonly string[];
readonly handlers: Readonly<Record<string, SwappableHandler>>;
readonly targets: Readonly<Record<string, object>>;
}
dev-module-reload.ts
Tracks the application modules a development process has loaded and evicts the changed
ones, together with every loaded module that imports them, from the runtime’s module registry.
The warm evaluator and the development server both use it: after eviction the next
import evaluates a fresh module record for each evicted file while every other module
keeps its cached instance. Bun keys ES modules by path, and a fresh query string alone
would still bind static imports to the old dependency, so eviction is what makes a
re-import observe the edit. Only files below the project root and outside
node_modules and .relkit are tracked. Development-only; the registry comes from the runtime
adapter, and runtimes without one (Node) restart the process instead.
ModuleReloader
Loaded-module tracking and eviction for one project root.
Signature
export interface ModuleReloader {
/**
* Records the modification stamp of every loaded application module.
* @param before - Stamps taken with {@link ModuleReloader.stamps} before the modules were
* imported; a file changed while they loaded keeps its earlier stamp, so the next `changed`
* reports it instead of the loaded module silently standing for the newer file.
*/
readonly record: (before?: ReadonlyMap<string, string>) => void;
/** @returns The current modification stamp of every loaded application module. */
readonly stamps: () => ReadonlyMap<string, string>;
/** @returns Every application module currently in the registry, sorted. */
readonly loaded: () => readonly string[];
/** @returns Loaded application modules whose file changed or disappeared since `record`. */
readonly changed: () => readonly string[];
/**
* Drops, by path, every file evicted since it last loaded, and the new files it imports,
* whether loaded or not. Call it after an import fails: a module that failed to parse stays in
* the runtime's loader without appearing in the registry keys, and a later import of it, or of
* a module importing it, never settles; one that threw at the top level stays half-initialized.
* `invalidate` first drops the ones that are not loaded, which covers the next reload.
* @returns The dropped absolute files, sorted.
*/
readonly discardFailed: () => readonly string[];
/**
* Evicts files and every loaded module that transitively imports them.
* @param files - Absolute or project-relative changed files.
* @returns Every evicted absolute file, sorted.
*/
readonly invalidate: (files: readonly string[]) => readonly string[];
}
createModuleReloader
Creates a reloader for one project root.
Signature
declare const createModuleReloader: (
projectRoot: string,
modules: RuntimeModules,
) => ModuleReloader;
dev-module-reload.types.ts
Loaded-module tracking and eviction for one project root.
ModuleReloader (interface)
Loaded-module tracking and eviction for one project root.
Signature
export interface ModuleReloader {
/**
* Records the modification stamp of every loaded application module.
* @param before - Stamps taken with {@link ModuleReloader.stamps} before the modules were
* imported; a file changed while they loaded keeps its earlier stamp, so the next `changed`
* reports it instead of the loaded module silently standing for the newer file.
*/
readonly record: (before?: ReadonlyMap<string, string>) => void;
/** @returns The current modification stamp of every loaded application module. */
readonly stamps: () => ReadonlyMap<string, string>;
/** @returns Every application module currently in the registry, sorted. */
readonly loaded: () => readonly string[];
/** @returns Loaded application modules whose file changed or disappeared since `record`. */
readonly changed: () => readonly string[];
/**
* Drops, by path, every file evicted since it last loaded, and the new files it imports,
* whether loaded or not. Call it after an import fails: a module that failed to parse stays in
* the runtime's loader without appearing in the registry keys, and a later import of it, or of
* a module importing it, never settles; one that threw at the top level stays half-initialized.
* `invalidate` first drops the ones that are not loaded, which covers the next reload.
* @returns The dropped absolute files, sorted.
*/
readonly discardFailed: () => readonly string[];
/**
* Evicts files and every loaded module that transitively imports them.
* @param files - Absolute or project-relative changed files.
* @returns Every evicted absolute file, sorted.
*/
readonly invalidate: (files: readonly string[]) => readonly string[];
}
dev-reload.ts
The development reload hook a generated server installs when relkit dev starts it with
an IPC channel. On a relkit.dev.reload message it evicts the application modules that
changed since the last load, together with their importers, imports the new generation’s
manifest module from the server directory (which re-evaluates exactly those modules),
verifies it against the new graph like startup does, and swaps the handler table. The
reply says whether the swap happened; on failure the previous table keeps serving and
relkit dev falls back to starting a new generation.
DevelopmentReloadOptions
Inputs the generated server supplies to the reload hook.
Signature
export interface DevelopmentReloadOptions {
readonly projectRoot: string;
/** Directory of the running server's `index.ts`. */
readonly serverDirectory: string;
readonly table: HandlerTable;
/** Manifest the server started with; later reloads compare against the last one applied. */
readonly runtimeManifest: ReloadedManifest;
/**
* Verifies a graph and manifest pair the same way startup does.
* @param graph - Graph of the new generation.
* @param manifest - Manifest module's `runtimeManifest` export.
* @returns The verified registry.
*/
readonly createRegistry: (
graph: ApplicationGraph,
manifest: SwappableManifest,
) => SwappableRegistry;
}
DevelopmentReloadReply
The server’s answer to a reload request.
Signature
type DevelopmentReloadReply =
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: true;
/** Application modules evaluated again, project-relative. */
readonly reimported: readonly string[];
readonly pid: number;
}
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: false;
readonly error: string;
readonly pid: number;
};
DevelopmentReloadRequest
A request from relkit dev to load a new handler table.
Signature
export interface DevelopmentReloadRequest {
readonly type: "relkit.dev.reload";
/** Correlates the acknowledgement. */
readonly id: number;
/** Manifest module file name in the server directory. */
readonly manifest: string;
/** Graph JSON file name in the server directory. */
readonly graph: string;
}
installDevelopmentReload
Listens for reload requests on the process IPC channel.
Signature
declare const installDevelopmentReload: (options: DevelopmentReloadOptions) => boolean;
effect.ts
The Effect form of each root API, for applications written with Effect. Handlers may return an Effect without importing anything from here; these helpers build descriptors and failures as Effects instead of plain values.
FunctionOperationError
Signature
declare const FunctionOperationError: typeof FunctionOperationError;
callGraphNodeEffect
Signature
declare const callGraphNodeEffect: <
Id extends string,
FunctionId extends string,
Input,
Output,
Errors extends readonly ErrorDescriptorAny[],
InputSchema extends StandardSchemaV1,
OutputSchema extends StandardSchemaV1,
Dependencies extends FunctionDependencies,
>(
node: FunctionGraphNodeDescriptor<
Id,
FunctionId,
Input,
Output,
Errors,
InputSchema,
OutputSchema,
Dependencies
>,
input: InferInput<InputSchema>,
) => Effect<Output, FunctionOperationError>;
callToolEffect
Signature
declare const callToolEffect: <const Id extends string, const Target extends FunctionRefAny>(
tool: FunctionToolDescriptor<Id, Target>,
input: InferInput<Target["input"]>,
options?: FunctionToolInvokeOptions,
) => ReturnType<FunctionToolInvokeEffect<Target>>;
defineAgentEffect
Signature
declare const defineAgentEffect: <
const Id extends string,
const InputSchema extends StandardSchemaV1,
const OutputSchema extends StandardSchemaV1,
const Tools extends readonly ToolRefAny[],
const Runtime extends AgentRuntimeAdapterAny,
>(
options: DefineAgentOptions<Id, InputSchema, OutputSchema, Tools, Runtime>,
) => Effect<
AgentDefinition<Id, InputSchema, OutputSchema, Tools, Runtime>,
AgentDefinitionFailure,
never
>;
defineAppEffect
Signature
declare const defineAppEffect: <
const Shape extends EnvShape,
const Bucket extends AppProviderBindings["bucket"] = undefined,
const Cache extends AppProviderBindings["cache"] = undefined,
const Jobs extends AppProviderBindings["jobs"] = undefined,
const Event extends AppProviderBindings["event"] = undefined,
const Model extends AppProviderBindings["model"] = undefined,
const Realtime extends AppProviderBindings["realtime"] = undefined,
const AgentState extends AppProviderBindings["agent-state"] = undefined,
const Exporters extends TelemetryExporterMap = Readonly<
Record<string, TelemetryExporterDescriptor<string, string, object>>
>,
>(
options: DefineAppOptions<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>,
) => Effect<
ApplicationDescriptor<
Shape,
DefineAppBindings<Bucket, Cache, Jobs, Event, Model, Realtime, AgentState>,
Exporters
>,
AppValidationFailure,
never
>;
defineBucketEffect
Signature
declare const defineBucketEffect: <const Id extends string>(
options: DefineBucketOptions<Id>,
) => Effect<BucketDescriptor<Id>, BucketValidationError, never>;
defineCacheEffect
Signature
declare const defineCacheEffect: <
const Id extends string,
const KeySchema extends StandardSchemaV1,
const ValueSchema extends StandardSchemaV1,
>(
options: DefineCacheOptions<Id, KeySchema, ValueSchema>,
) => Effect<
CacheDescriptor<Id, InferInput<KeySchema>, InferOutput<ValueSchema>, KeySchema, ValueSchema>,
CacheDescriptorError,
never
>;
defineChannelEffect
Signature
declare const defineChannelEffect: <
const Id extends string,
const ParamsSchema extends StandardSchemaV1,
const Events extends Readonly<Record<string, StandardSchemaV1>>,
const Client extends ChannelClientPolicy<ChannelGuard<InferOutput<ParamsSchema>>> | undefined,
const Presence extends ChannelPresence<InferOutput<ParamsSchema>> | undefined = undefined,
>(
options: DefineChannelOptions<Id, ParamsSchema, Events, Client, Presence>,
) => Effect<
ChannelDescriptor<Id, ParamsSchema, Events, Client, Presence>,
ChannelValidationError,
never
>;
defineConstantsEffect
Signature
declare const defineConstantsEffect: <const Values extends ConstantsShape>(
values: Values,
options?: ContextDescriptorOptions | undefined,
) => Effect<ConstantsDescriptor<Values>, ContextDescriptorFailure, never>;
defineEnvEffect
Signature
declare const defineEnvEffect: <const S extends EnvShape>(
shape: S & { readonly PORT?: never; readonly RELKIT_ENV?: never },
) => Effect<EnvDefinition<S>, ConfigValidationError>;
defineErrorEffect
Signature
declare const defineErrorEffect: <
const Id extends string,
const DataSchema extends StandardSchemaV1,
>(
options: DefineErrorOptions<Id, DataSchema>,
) => Effect<
ErrorDescriptor<Id, InferOutput<DataSchema>, DataSchema>,
FunctionOperationError,
never
>;
defineFunctionEffect
Signature
declare const defineFunctionEffect: DefineFunctionEffect;
defineJobEffect
Signature
declare const defineJobEffect: <
const Name extends string,
const Task extends TaskDescriptorAny,
const Id extends string = Name,
>(
options: DefineJobOptions<Name, Task, Id>,
) => Effect<JobDescriptor<Name, Id, Task>, JobDefinitionFailure, never>;
defineMiddlewareEffect
Signature
declare const defineMiddlewareEffect: (
path: string,
definition: MiddlewareHandler | TypedMiddlewareOptions<StandardSchemaV1<unknown, unknown>>,
) => Effect<MiddlewareDescriptor<string, any>, RouteOperationError, never>;
definePromptEffect
Signature
declare const definePromptEffect: <const Value extends PromptValue>(
value: Value,
options?: ContextDescriptorOptions | undefined,
) => Effect<PromptDescriptor<Value>, ContextDescriptorFailure, never>;
defineRouteEffect
Signature
declare const defineRouteEffect: <
const Id extends string,
const Target extends FunctionRefAny | undefined = undefined,
const Request extends HttpRequestMapping | undefined = undefined,
const Handler extends RawHttpHandler = RawHttpHandler,
>(
options: DefineRouteOptions<Id, Target, Request, Handler>,
) => Effect<DefinedRoute<Id, Target, Request, Handler>, RouteOperationError>;
defineServiceEffect
Signature
declare const defineServiceEffect: <
const Id extends string,
const Functions extends ServiceFunctionMap = Readonly<Record<never, never>>,
const Events extends ServiceEventMap = Readonly<Record<never, never>>,
const Tasks extends ServiceTaskMap = Readonly<Record<never, never>>,
const Jobs extends ServiceJobMap = Readonly<Record<never, never>>,
>(
options: DefineServiceOptions<Id, Functions, Events, Tasks, Jobs>,
) => Effect<ServiceDescriptor<Id, Functions, Events, Tasks, Jobs>, ServiceValidationError, never>;
defineServiceRoutesEffect
Signature
declare const defineServiceRoutesEffect: <
const Service extends ServiceDescriptor<string, any, any>,
const Options extends Partial<Readonly<Record<ServiceRouteMethod, ServiceRouteEntry<Service>>>>,
>(
service: Service,
options: Options & Record<Exclude<keyof Options, ServiceRouteMethod>, never>,
) => Effect<
Readonly<{
[Method in keyof Options]: FunctionRouteDescriptor<
string,
Extract<
ServiceFunctions<Service>[Extract<
EntryName<Options[Method]>,
Extract<keyof ServiceFunctions<Service>, string>
>],
FunctionRefAny
>,
EntryRequest<Options[Method]>
> &
ServiceRouteMethodMarker<Method>;
}>,
RouteOperationError,
never
>;
defineTaskEffect
Signature
declare const defineTaskEffect: <
const Id extends string,
const Version extends string,
const InputSchema extends StandardSchemaV1,
const OutputSchema extends StandardSchemaV1,
const Dependencies extends TaskDependencies = {},
const Errors extends readonly ErrorDescriptorAny[] = readonly [],
const ProgressSchema extends StandardSchemaV1 | undefined = undefined,
const Streams extends Readonly<Record<string, StandardSchemaV1<unknown, unknown>>> = {},
const Execution extends TaskExecution = TaskExecution,
>(
options: DefineTaskCallOptions<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
Execution
>,
) => Effect<
TaskDescriptor<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
TaskForm<Execution>
>,
TaskDefinitionFailure,
never
>;
defineToolEffect
Signature
declare const defineToolEffect: <const Id extends string, const Target extends FunctionRefAny>(
options: DefineToolOptions<Id, Target>,
) => Effect<ToolDescriptor<Id, Target>, ToolOperationFailure, never>;
defineTransformEffect
Signature
declare const defineTransformEffect: <
const Id extends string,
const Schema extends StandardSchemaV1,
>(
options: DefineTransformOptions<Id, Schema>,
) => Effect<HttpTransformDescriptor<Id, Schema>, RouteOperationError, never>;
failEffect
Signature
declare const failEffect: <const Descriptor extends ErrorDescriptorAny>(
descriptor: Descriptor,
data: Parameters<Descriptor["create"]>[0],
) => Effect<never, DeclaredErrorOf<Descriptor>>;
httpEffects
Signature
declare const httpEffects: {
constant: <const V extends JsonValue>(
value: V,
) => Effect<HttpConstantMapping<V>, RouteOperationError, never>;
optional: <const M extends HttpMappingNode>(
value: M,
) => Effect<HttpOptionalMapping<M>, RouteOperationError, never>;
default: <const M extends HttpMappingNode, const V extends JsonValue>(
value: M,
fallback: V,
) => Effect<HttpDefaultMapping<M, V>, RouteOperationError, never>;
transform: <const T extends HttpTransformRef | string, const M extends HttpMappingNode>(
transform: T,
value?: M | undefined,
) => Effect<HttpTransformMapping<TransformOutput<T>>, RouteOperationError, never>;
success: (
status: number,
schema?: StandardSchemaV1<unknown, unknown> | undefined,
) => Effect<HttpResponseMapping, RouteOperationError, never>;
error: (
errorId: string,
status: number,
schema?: StandardSchemaV1<unknown, unknown> | undefined,
) => Effect<HttpResponseMapping, RouteOperationError, never>;
validationError: (
status?: number | undefined,
schema?: StandardSchemaV1<unknown, unknown> | undefined,
) => Effect<HttpResponseMapping, RouteOperationError, never>;
response: (
id: string,
status: number,
schema?: StandardSchemaV1<unknown, unknown> | undefined,
) => Effect<HttpResponseMapping, RouteOperationError, never>;
continue: () => Effect<ContinueMapping, RouteOperationError, never>;
respond: (
response: string | HttpResponseMapping,
body?: HttpMappingNode | undefined,
) => Effect<RespondMapping, RouteOperationError, never>;
input: <const S extends HttpMappingShape>(
fields: S,
) => Effect<HttpInputMapping<S>, RouteOperationError, never>;
nested: <const S extends HttpMappingShape>(
fields: S,
) => Effect<HttpNestedMapping<S>, RouteOperationError, never>;
path: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
pathSegments: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
query: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
header: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
cookie: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
body: (
name?: string | undefined,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
wholeBody: () => Effect<HttpWholeBodyMapping<unknown>, RouteOperationError, never>;
multipart: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
multipartAll: (
name: string,
options?: HttpSourceOptions | undefined,
) => Effect<HttpMappingNode, RouteOperationError, never>;
};
streamOfEffect
Signature
declare const streamOfEffect: <const ItemSchema extends StandardSchemaV1>(
item: ItemSchema,
) => Effect<StreamOutputSchema<ItemSchema>, FunctionOperationError, never>;
events.ts
“../events/index.js” (namespace export)
Re-exports all named exports from the “../events/index.js” module.
Signature
export * from "../events/index.js";
functions.ts
“../functions/index.js” (namespace export)
Re-exports all named exports from the “../functions/index.js” module.
Signature
export * from "../functions/index.js";
host.ts
Exposes the framework-owned descriptor identity and application context wiring needed by emitted hosts, including selected dependency preflight. Re-exports preserve identity while resolving framework dependencies from their owning app.
“./context-resolver.js” (namespace export)
Re-exports all named exports from the “./context-resolver.js” module.
Signature
export * from "./context-resolver.js";
AppConstantRunner
Signature
declare const AppConstantRunner: typeof AppConstantRunner;
AppConstantRunnerLive
Signature
declare const AppConstantRunnerLive: Layer<AppConstantRunner, never, never>;
DevelopmentReloadOptions
Inputs the generated server supplies to the reload hook.
Signature
export interface DevelopmentReloadOptions {
readonly projectRoot: string;
/** Directory of the running server's `index.ts`. */
readonly serverDirectory: string;
readonly table: HandlerTable;
/** Manifest the server started with; later reloads compare against the last one applied. */
readonly runtimeManifest: ReloadedManifest;
/**
* Verifies a graph and manifest pair the same way startup does.
* @param graph - Graph of the new generation.
* @param manifest - Manifest module's `runtimeManifest` export.
* @returns The verified registry.
*/
readonly createRegistry: (
graph: ApplicationGraph,
manifest: SwappableManifest,
) => SwappableRegistry;
}
DevelopmentReloadReply
The server’s answer to a reload request.
Signature
type DevelopmentReloadReply =
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: true;
/** Application modules evaluated again, project-relative. */
readonly reimported: readonly string[];
readonly pid: number;
}
| {
readonly type: "relkit.dev.reloaded";
readonly id: number;
readonly ok: false;
readonly error: string;
readonly pid: number;
};
DevelopmentReloadRequest
A request from relkit dev to load a new handler table.
Signature
export interface DevelopmentReloadRequest {
readonly type: "relkit.dev.reload";
/** Correlates the acknowledgement. */
readonly id: number;
/** Manifest module file name in the server directory. */
readonly manifest: string;
/** Graph JSON file name in the server directory. */
readonly graph: string;
}
HandlerTable
A stable registry whose table can be replaced atomically.
Signature
export interface HandlerTable {
/** Registry object handed to invocation; it always delegates to the current table. */
readonly registry: SwappableRegistry;
/** Number of swaps applied since startup. */
readonly generation: number;
/**
* Replaces the registry and the manifest's function and target entries in one step.
* @param next - Registry verified against the new graph and manifest.
* @param manifest - The new generation's manifest maps.
*/
readonly swap: (next: SwappableRegistry, manifest: SwappableManifest) => void;
}
ModuleReloader
Loaded-module tracking and eviction for one project root.
Signature
export interface ModuleReloader {
/**
* Records the modification stamp of every loaded application module.
* @param before - Stamps taken with {@link ModuleReloader.stamps} before the modules were
* imported; a file changed while they loaded keeps its earlier stamp, so the next `changed`
* reports it instead of the loaded module silently standing for the newer file.
*/
readonly record: (before?: ReadonlyMap<string, string>) => void;
/** @returns The current modification stamp of every loaded application module. */
readonly stamps: () => ReadonlyMap<string, string>;
/** @returns Every application module currently in the registry, sorted. */
readonly loaded: () => readonly string[];
/** @returns Loaded application modules whose file changed or disappeared since `record`. */
readonly changed: () => readonly string[];
/**
* Drops, by path, every file evicted since it last loaded, and the new files it imports,
* whether loaded or not. Call it after an import fails: a module that failed to parse stays in
* the runtime's loader without appearing in the registry keys, and a later import of it, or of
* a module importing it, never settles; one that threw at the top level stays half-initialized.
* `invalidate` first drops the ones that are not loaded, which covers the next reload.
* @returns The dropped absolute files, sorted.
*/
readonly discardFailed: () => readonly string[];
/**
* Evicts files and every loaded module that transitively imports them.
* @param files - Absolute or project-relative changed files.
* @returns Every evicted absolute file, sorted.
*/
readonly invalidate: (files: readonly string[]) => readonly string[];
}
ProviderRealtimeDispatcherOptions
Signature
declare const ProviderRealtimeDispatcherOptions: ProviderRealtimeDispatcherOptions;
RealtimeDispatcher
Signature
declare const RealtimeDispatcher: RealtimeDispatcher;
SwappableManifest
The manifest maps the running server reads handlers and targets from.
Signature
export interface SwappableManifest {
readonly functions?: Record<string, SwappableHandler>;
readonly targets?: Record<string, object>;
}
bindDescriptorIdentity
Signature
declare const bindDescriptorIdentity: <T extends object>(descriptor: T, id: string) => T;
checkRuntimeIntegrations
Signature
declare const checkRuntimeIntegrations: (
plan: RuntimeIntegrationPlan,
options: { readonly projectRoot: string; readonly phase: IntegrationDependencyPhase },
) => Promise<void>;
createHandlerTable
Signature
declare const createHandlerTable: (
initial: SwappableRegistry,
manifest: SwappableManifest,
) => HandlerTable;
createModuleReloader
Signature
declare const createModuleReloader: (
projectRoot: string,
modules: RuntimeModules,
) => ModuleReloader;
createProviderRealtimeDispatcher
Signature
declare const createProviderRealtimeDispatcher: (
options: ProviderRealtimeDispatcherOptions,
) => RealtimeDispatcher;
installDevelopmentReload
Signature
declare const installDevelopmentReload: (options: DevelopmentReloadOptions) => boolean;
loadRuntimeIntegration
Signature
declare const loadRuntimeIntegration: <Module>(
packageName: string,
load: () => Promise<Module>,
) => Promise<Module>;
runWithRealtimeDispatcher
Signature
declare const runWithRealtimeDispatcher: <Value>(
dispatcher: RealtimeDispatcher,
action: () => Value,
) => Value;
setActiveRealtimeDispatcher
Signature
declare const setActiveRealtimeDispatcher: (dispatcher: RealtimeDispatcher | undefined) => void;
index.ts
The surface the relkit root had before it became a curated list. The curated root picks its
names from here, and the deprecated @relkit/app re-exports all of it as relkit/app.
“../agents/index.js” (namespace export)
Re-exports all named exports from the “../agents/index.js” module.
Signature
export * from "../agents/index.js";
“../buckets/index.js” (namespace export)
Re-exports all named exports from the “../buckets/index.js” module.
Signature
export * from "../buckets/index.js";
“../cache/index.js” (namespace export)
Re-exports all named exports from the “../cache/index.js” module.
Signature
export * from "../cache/index.js";
“../events/index.js” (namespace export)
Re-exports all named exports from the “../events/index.js” module.
Signature
export * from "../events/index.js";
“../functions/index.js” (namespace export)
Re-exports all named exports from the “../functions/index.js” module.
Signature
export * from "../functions/index.js";
“../jobs/index.js” (namespace export)
Re-exports all named exports from the “../jobs/index.js” module.
Signature
export * from "../jobs/index.js";
“../realtime/index.js” (namespace export)
Re-exports all named exports from the “../realtime/index.js” module.
Signature
export * from "../realtime/index.js";
“../routes/index.js” (namespace export)
Re-exports all named exports from the “../routes/index.js” module.
Signature
export * from "../routes/index.js";
“../services/index.js” (namespace export)
Re-exports all named exports from the “../services/index.js” module.
Signature
export * from "../services/index.js";
“../tools/index.js” (namespace export)
Re-exports all named exports from the “../tools/index.js” module.
Signature
export * from "../tools/index.js";
“./config.js” (namespace export)
Re-exports all named exports from the “./config.js” module.
Signature
export * from "./config.js";
“./context-resolver.js” (namespace export)
Re-exports all named exports from the “./context-resolver.js” module.
Signature
export * from "./context-resolver.js";
“./tasks.js” (namespace export)
Re-exports all named exports from the “./tasks.js” module.
Signature
export * from "./tasks.js";
AppConstantRunner
Signature
declare const AppConstantRunner: typeof AppConstantRunner;
AppConstantRunnerLive
Signature
declare const AppConstantRunnerLive: Layer<AppConstantRunner, never, never>;
EventAttributeValue
Signature
declare const EventAttributeValue: EventAttributeValue;
EventPublishOptions
Signature
declare const EventPublishOptions: EventPublishOptions;
EventPublishResult
Signature
declare const EventPublishResult: EventPublishResult<Id, Version, Payload>;
TaskClientFor
Signature
declare const TaskClientFor: TaskClientFor<T>;
TaskClients
Signature
declare const TaskClients: TaskClients<M>;
TaskTriggerOptions
Signature
declare const TaskTriggerOptions: TaskTriggerOptions<Task>;
bindDescriptorIdentity
Signature
declare const bindDescriptorIdentity: <T extends object>(descriptor: T, id: string) => T;
jobs.ts
“../jobs/index.js” (namespace export)
Re-exports all named exports from the “../jobs/index.js” module.
Signature
export * from "../jobs/index.js";
RunStatus
Signature
declare const RunStatus: JobRunStatus;
realtime.ts
“../realtime/index.js” (namespace export)
Re-exports all named exports from the “../realtime/index.js” module.
Signature
export * from "../realtime/index.js";
routes.ts
“../routes/index.js” (namespace export)
Re-exports all named exports from the “../routes/index.js” module.
Signature
export * from "../routes/index.js";
schema.ts
“../schema/index.js” (namespace export)
Re-exports all named exports from the “../schema/index.js” module.
Signature
export * from "../schema/index.js";
services.ts
“../services/index.js” (namespace export)
Re-exports all named exports from the “../services/index.js” module.
Signature
export * from "../services/index.js";
tasks.ts
DefineTaskCallOptions
Signature
declare const DefineTaskCallOptions: DefineTaskCallOptions<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
Execution
>;
DefineTaskOptions
Signature
declare const DefineTaskOptions: DefineTaskOptions<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
Execution
>;
JobDescriptorForThisTask
Signature
declare const JobDescriptorForThisTask: JobDescriptorForThisTask<Task>;
NormalizedTaskRetryPolicy
Signature
declare const NormalizedTaskRetryPolicy: NormalizedTaskRetryPolicy;
RunResultOptions
Signature
declare const RunResultOptions: RunResultOptions;
ServerTriggerOptions
Signature
declare const ServerTriggerOptions: ServerTriggerOptions;
TaskAuthContext
Signature
declare const TaskAuthContext: TaskAuthContext<Session>;
TaskCallerInput
Signature
declare const TaskCallerInput: TaskCallerInput<T>;
TaskCanonicalInput
Signature
declare const TaskCanonicalInput: TaskCanonicalInput<T>;
TaskConcurrency
Signature
declare const TaskConcurrency: TaskConcurrency<InputKey>;
TaskContext
Signature
declare const TaskContext: TaskContext<Execution, Dependencies, ProgressSchema, Streams>;
TaskContextBase
Signature
declare const TaskContextBase: TaskContextBase<Dependencies>;
TaskDependencies
Signature
declare const TaskDependencies: TaskDependencies;
TaskDescriptor
Signature
declare const TaskDescriptor: TaskDescriptor<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
Execution
>;
TaskDescriptorAny
Signature
declare const TaskDescriptorAny: TaskDescriptorAny;
TaskExecution
Signature
declare const TaskExecution: TaskExecution;
TaskFailureHook
Signature
declare const TaskFailureHook: TaskFailureHook<Dependencies>;
TaskForm
Signature
declare const TaskForm: TaskForm<Execution>;
TaskHandler
Signature
declare const TaskHandler: TaskHandler<
InputSchema,
OutputSchema,
Execution,
Dependencies,
Errors,
ProgressSchema,
Streams
>;
TaskHandlerResult
Signature
declare const TaskHandlerResult: TaskHandlerResult<Output, Errors>;
TaskHookContext
Signature
declare const TaskHookContext: TaskHookContext<Dependencies>;
TaskInput
Signature
declare const TaskInput: TaskInput<T>;
TaskLogging
Signature
declare const TaskLogging: TaskLogging;
TaskOutput
Signature
declare const TaskOutput: TaskOutput<T>;
TaskProgressEmitter
Signature
declare const TaskProgressEmitter: TaskProgressEmitter<Value>;
TaskProgressInput
Signature
declare const TaskProgressInput: TaskProgressInput<Schema>;
TaskProgressOutput
Signature
declare const TaskProgressOutput: TaskProgressOutput<Schema>;
TaskRawHandlerOutput
Signature
declare const TaskRawHandlerOutput: TaskRawHandlerOutput<T>;
TaskResources
Signature
declare const TaskResources: TaskResources;
TaskRetryPolicy
Signature
declare const TaskRetryPolicy: TaskRetryPolicy;
TaskRunContext
Signature
declare const TaskRunContext: TaskRunContext;
TaskSleepOptions
Signature
declare const TaskSleepOptions: TaskSleepOptions;
TaskStartHook
Signature
declare const TaskStartHook: TaskStartHook<InputSchema, Dependencies>;
TaskStreamEmitter
Signature
declare const TaskStreamEmitter: TaskStreamEmitter<Value>;
TaskStreamEmitters
Signature
declare const TaskStreamEmitters: TaskStreamEmitters<Streams>;
TaskStreamFrames
Signature
declare const TaskStreamFrames: TaskStreamFrames<Streams>;
TaskStreamInput
Signature
declare const TaskStreamInput: TaskStreamInput<Schema>;
TaskStreamItem
Signature
declare const TaskStreamItem: TaskStreamItem<Schema>;
TaskStreamOutput
Signature
declare const TaskStreamOutput: TaskStreamOutput<Schema>;
TaskStreamSchemas
Signature
declare const TaskStreamSchemas: Readonly<Record<string, StandardSchemaV1<unknown, unknown>>>;
TaskSuccessHook
Signature
declare const TaskSuccessHook: TaskSuccessHook<OutputSchema, Dependencies>;
TaskTriggerOptions
Signature
declare const TaskTriggerOptions: TaskTriggerOptions<Task>;
TaskValidatedOutput
Signature
declare const TaskValidatedOutput: TaskValidatedOutput<T>;
TriggerOptions
Signature
declare const TriggerOptions: TriggerOptions;
assertTaskDescriptor
Signature
declare const assertTaskDescriptor: (value: unknown) => asserts value is TaskDescriptorAny;
defineTask
Signature
declare const defineTask: <
const Id extends string,
const Version extends string,
const InputSchema extends StandardSchemaV1,
const OutputSchema extends StandardSchemaV1,
const Dependencies extends TaskDependencies = {},
const Errors extends readonly ErrorDescriptorAny[] = readonly [],
const ProgressSchema extends StandardSchemaV1 | undefined = undefined,
const Streams extends TaskStreamSchemas = {},
const Execution extends TaskExecution = TaskExecution,
>(
options: DefineTaskCallOptions<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
Execution
>,
) => TaskDescriptor<
Id,
Version,
InputSchema,
OutputSchema,
Dependencies,
Errors,
ProgressSchema,
Streams,
TaskForm<Execution>
>;
isTaskDescriptor
Signature
declare const isTaskDescriptor: (value: unknown) => value is TaskDescriptorAny;
tools.ts
“../tools/index.js” (namespace export)
Re-exports all named exports from the “../tools/index.js” module.
Signature
export * from "../tools/index.js";