FabricFabricHarness
Reference

API reference

Generated public API inventory for every published Fabric Harness entrypoint.

This reference is generated from the declaration files shipped in each package. Import from the entrypoint shown in the table; symbols marked type are TypeScript-only exports.

@fabric-harness/azure

@fabric-harness/azure

ExportKindSummary
azureAgentvaluePublic export.
AzureAgentOptionstypePublic export.
AzureAksClusterReftypePublic export.
azureAksRunCommandToolvaluePublic export.
AzureArmClientvaluePublic export.
AzureArmClientOptionstypePublic export.
AzureBlobArtifactStoretypePublic export.
AzureBlobArtifactStoreOptionstypePublic export.
AzureBundletypePublic export.
AzureBundleConfigtypePublic export.
AzureContainerAppsJobReftypePublic export.
azureContainerAppsJobToolvaluePublic export.
azureContainerInstanceExecToolvaluePublic export.
AzureContainerInstanceReftypePublic export.
azureKeyVaultSecretProvidervalueKey Vault adapter for chainSecretProviders() and secretResolver().
AzureKeyVaultSecretResolverOptionstypePublic export.
AzureOpenAIModelProvidervaluePublic export.
AzureOpenAIModelProviderOptionstypePublic export.
AzureResourceReftypePublic export.
createAzureArmClientvaluePublic export.
createAzureBlobArtifactStorevaluePublic export.
createAzureKeyVaultSecretResolvervaluePublic export.
createFoundryAgentServiceClientvaluePublic export.
defineAzureAgentvaluePublic export.
DefineAzureAgentOptionstypePublic export.
FoundryAgentDefinitiontypePublic export.
FoundryAgentInvocationOptionstypePublic export.
FoundryAgentInvocationResulttypePublic export.
foundryAgentLifecycleToolsvaluePublic export.
FoundryAgentServiceClientvaluePublic export.
FoundryAgentServiceOptionstypePublic export.
foundryAgentToolvaluePublic export.
FoundryHostedAgentSandboxOptionstypePublic export.
FoundryRuntimeModelProvidervalueModel provider that calls the Foundry-managed Azure OpenAI surface using a Bearer token (managed identity) instead of an API key. Designed for the Azure AI Foundry Hosted Agent runtime, but useful on any Azure compute with a managed identity (ACA / AKS / VM) — you don't need the Foundry runtime adapter to use this provider. The runtime injects: - AZURE_OPENAI_ENDPOINT — the Foundry-routed Azure OpenAI endpoint. - AZURE_OPENAI_DEPLOYMENT — the model deployment name. - FOUNDRY_AGENT_TOKEN (or AZURE_AI_FOUNDRY_TOKEN) — a pre-issued token when running inside the Hosted Agent contain...
FoundryRuntimeModelProviderOptionstypePublic export.
FoundryThreadMessagetypePublic export.
FoundryTokenResolvertypeToken resolver — returns a Bearer token for the Foundry runtime's managed Azure OpenAI surface. Implementations may cache and refresh.
MockAzureModelProvidervalueA deterministic ModelProvider for Azure agent tests and init templates. Returns structured responses without requiring real Azure credentials.
MockAzureModelProviderOptionstypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/azure/aks-sandbox

ExportKindSummary
aksSandboxvaluePublic export.
AksSandboxOptionstypeAKS-flavored Kubernetes sandbox. Pulls cluster credentials from the AKS listClusterUserCredentials endpoint, builds a @kubernetes/client-node KubeConfig, and delegates to kubernetesSandbox. Requires both peer deps: ```sh npm install

@fabric-harness/azure/app-insights

ExportKindSummary
ApplicationInsightsClientLiketypeOptional Azure Monitor / Application Insights telemetry exporter. Adapts Fabric's TelemetrySpan shape into App Insights TelemetryClient trackDependency calls. The Azure Monitor SDK is provided by the caller — we don't take a hard dependency. Install peer dep: See the package declarations for an example. Usage: See the package declarations for an example.
applicationInsightsExportervaluePublic export.
ApplicationInsightsExporterOptionstypePublic export.

@fabric-harness/azure/foundry-runtime

ExportKindSummary
FoundryRuntimeModelProvidervalueModel provider that calls the Foundry-managed Azure OpenAI surface using a Bearer token (managed identity) instead of an API key. Designed for the Azure AI Foundry Hosted Agent runtime, but useful on any Azure compute with a managed identity (ACA / AKS / VM) — you don't need the Foundry runtime adapter to use this provider. The runtime injects: - AZURE_OPENAI_ENDPOINT — the Foundry-routed Azure OpenAI endpoint. - AZURE_OPENAI_DEPLOYMENT — the model deployment name. - FOUNDRY_AGENT_TOKEN (or AZURE_AI_FOUNDRY_TOKEN) — a pre-issued token when running inside the Hosted Agent contain...
FoundryRuntimeModelProviderOptionstypePublic export.
FoundryTokenResolvertypeToken resolver — returns a Bearer token for the Foundry runtime's managed Azure OpenAI surface. Implementations may cache and refresh.

@fabric-harness/azure/agent

ExportKindSummary
azurevalueBundle factory for Azure agents. Returns an AzureBundle with a model provider, Azure-specific tools, and a safe default egress policy.
azureAgentvaluePublic export.
AzureAgentOptionstypePublic export.
AzureBundletypePublic export.
AzureBundleConfigtypePublic export.
defineAzureAgentvaluePublic export.
DefineAzureAgentOptionstypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/channels

@fabric-harness/channels

ExportKindSummary
bytesToHexvaluePublic export.
ChanneltypePublic export.
channelCompatibilityvaluePublished channel compatibility contract. Provider payload changes that only add fields are supported without a Fabric release; breaking provider versions are added here before becoming the default.
ChannelCompatibilitytypePublic export.
channelCompatibilityPolicyvaluePublic export.
ChannelCompatibilityStatustypePublic export.
ChannelContexttypePublic export.
ChannelDispatchtypePublic export.
ChannelDispatchRequesttypePublic export.
ChannelRoutetypeChannels turn platform webhooks (Slack, GitHub, …) into agent dispatches. Handlers are written against the Web Request/Response API and crypto.subtle, so the same channel runs on Node and Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer — session continuity falls out of the key (same thread → same key → same session).
conversationKeyvaluePublic export.
defineChannelvalueValidates and brands a channel's routes.
FirstPartyChannelNametypePublic export.
hexToBytesvaluePublic export.
hmacSha256valuePublic export.
parseConversationKeyvaluePublic export.
ParsedConversationKeytypePublic export.
readRequestBodyvalueReads the full request body as bytes, or returns undefined if it exceeds limitBytes. NOTE: this consumes the request stream (single read). Signature-verifying channels need the exact bytes for HMAC and the parsed JSON afterward — don't call request.json() as well. Use readJsonBody to get both from one read.
verifyHmacSha256valueConstant-time HMAC-SHA256 verification (via crypto.subtle.verify).

@fabric-harness/channels/compatibility

ExportKindSummary
channelCompatibilityvaluePublished channel compatibility contract. Provider payload changes that only add fields are supported without a Fabric release; breaking provider versions are added here before becoming the default.
ChannelCompatibilitytypePublic export.
channelCompatibilityPolicyvaluePublic export.
ChannelCompatibilityStatustypePublic export.
FirstPartyChannelNametypePublic export.

@fabric-harness/channels/slack

ExportKindSummary
createSlackChannelvalueSlack events channel. Verifies the v0 HMAC signature, answers the URL-verification challenge, and dispatches app_mention / threaded message events to a persistent agent keyed by the Slack thread — with the Slack event_id as the dedupe key (exactly-once), the team as tenant, and the user as the acting actor (which is what powers on-behalf-of governance downstream).
parseSlackConversationKeyvalueParse a Slack instance id back into the thread ref (e.g. to bind replyInSlackThread at agent init).
replyInSlackThreadvalueOutbound tool: reply in the Slack thread this agent is handling.
SlackChanneltypePublic export.
SlackChannelOptionstypePublic export.
slackConversationKeyvalueSerialize a Slack thread into the stable instance id used by createSlackChannel.
SlackEventtypePublic export.
SlackEventsPayloadtypePublic export.
SlackThreadReftypePublic export.

@fabric-harness/channels/github

ExportKindSummary
commentOnGitHubIssuevalueOutbound tool: comment on the GitHub issue / PR this agent is handling.
createGitHubChannelvalueGitHub webhook channel. Verifies the X-Hub-Signature-256 (sha256=<hex> HMAC over the raw body), and dispatches issue / PR / comment events to a persistent agent keyed by owner/repo/<kind>/<number> — with X-GitHub-Delivery as the dedupe key (exactly-once), the owner as tenant, and the sender as the acting actor. Bot senders are ignored to avoid loops; ping is acknowledged.
GitHubChanneltypePublic export.
GitHubChannelOptionstypePublic export.
githubConversationKeyvaluePublic export.
GitHubIssueReftypePublic export.
GitHubWebhookPayloadtypePublic export.
NormalizedGitHubEventtypePublic export.
normalizeGitHubEventvaluePublic export.
parseGitHubConversationKeyvaluePublic export.

@fabric-harness/channels/discord

ExportKindSummary
createDiscordChannelvaluePublic export.
DiscordChanneltypePublic export.
DiscordChannelOptionstypePublic export.
discordConversationKeyvaluePublic export.
DiscordConversationReftypePublic export.
DiscordInteractionPayloadtypePublic export.
parseDiscordConversationKeyvaluePublic export.
replyInDiscordvaluePublic export.
verifyDiscordSignaturevaluePublic export.

@fabric-harness/channels/teams

ExportKindSummary
BotFrameworkAuthenticatorOptionstypePublic export.
createBotFrameworkAuthenticatorvalueVerify Microsoft Bot Connector signatures, issuer, audience, lifetime, service URL, and endorsement.
createTeamsChannelvaluePublic export.
parseTeamsConversationKeyvaluePublic export.
replyInTeamsConversationvaluePublic export.
TeamsActivityPayloadtypePublic export.
TeamsChanneltypePublic export.
TeamsChannelOptionstypePublic export.
teamsConversationKeyvaluePublic export.
TeamsConversationReftypePublic export.

@fabric-harness/channels/telegram

ExportKindSummary
createTelegramChannelvaluePublic export.
parseTelegramConversationKeyvaluePublic export.
replyInTelegramvaluePublic export.
TelegramChanneltypePublic export.
TelegramChannelOptionstypePublic export.
telegramConversationKeyvaluePublic export.
TelegramConversationReftypePublic export.
TelegramMessagePayloadtypePublic export.
TelegramUpdatePayloadtypePublic export.

@fabric-harness/channels/twilio

ExportKindSummary
createTwilioChannelvaluePublic export.
parseTwilioConversationKeyvaluePublic export.
replyWithTwiliovaluePublic export.
TwilioChanneltypePublic export.
TwilioChannelOptionstypePublic export.
twilioConversationKeyvaluePublic export.
TwilioConversationReftypePublic export.
TwilioMessagePayloadtypePublic export.
verifyTwilioSignaturevaluePublic export.

@fabric-harness/channels/whatsapp

ExportKindSummary
createWhatsAppChannelvaluePublic export.
parseWhatsAppConversationKeyvaluePublic export.
replyInWhatsAppvaluePublic export.
WhatsAppChanneltypePublic export.
WhatsAppChannelOptionstypePublic export.
whatsAppConversationKeyvaluePublic export.
WhatsAppConversationReftypePublic export.
WhatsAppWebhookPayloadtypePublic export.

@fabric-harness/channels/google-chat

ExportKindSummary
createGoogleChatChannelvaluePublic export.
GoogleChatChanneltypePublic export.
GoogleChatChannelOptionstypePublic export.
googleChatConversationKeyvaluePublic export.
GoogleChatConversationReftypePublic export.
GoogleChatEventtypePublic export.
parseGoogleChatConversationKeyvaluePublic export.
replyInGoogleChatvaluePublic export.
verifyGoogleChatRequestvaluePublic export.

@fabric-harness/channels/linear

ExportKindSummary
commentOnLinearIssuevaluePublic export.
createLinearChannelvaluePublic export.
LinearChanneltypePublic export.
LinearChannelOptionstypePublic export.
linearConversationKeyvaluePublic export.
LinearConversationReftypePublic export.
LinearWebhookPayloadtypePublic export.
parseLinearConversationKeyvaluePublic export.

@fabric-harness/channels/notion

ExportKindSummary
commentOnNotionPagevaluePublic export.
createNotionChannelvaluePublic export.
NotionChanneltypePublic export.
NotionChannelOptionstypePublic export.
notionConversationKeyvaluePublic export.
NotionConversationReftypePublic export.
NotionWebhookPayloadtypePublic export.
parseNotionConversationKeyvaluePublic export.

@fabric-harness/channels/stripe

ExportKindSummary
createStripeChannelvaluePublic export.
parseStripeConversationKeyvaluePublic export.
StripeChanneltypePublic export.
StripeChannelOptionstypePublic export.
stripeConversationKeyvaluePublic export.
StripeConversationReftypePublic export.
StripeEventPayloadtypePublic export.
updateStripeCustomervaluePublic export.
verifyStripeSignaturevaluePublic export.

@fabric-harness/channels/zendesk

ExportKindSummary
commentOnZendeskTicketvaluePublic export.
createZendeskChannelvaluePublic export.
parseZendeskConversationKeyvaluePublic export.
ZendeskChanneltypePublic export.
ZendeskChannelOptionstypePublic export.
zendeskConversationKeyvaluePublic export.
ZendeskConversationReftypePublic export.
ZendeskWebhookPayloadtypePublic export.

@fabric-harness/channels/intercom

ExportKindSummary
createIntercomChannelvaluePublic export.
IntercomChanneltypePublic export.
IntercomChannelOptionstypePublic export.
intercomConversationKeyvaluePublic export.
IntercomConversationReftypePublic export.
IntercomWebhookPayloadtypePublic export.
parseIntercomConversationKeyvaluePublic export.
replyInIntercomvaluePublic export.

@fabric-harness/channels/shopify

ExportKindSummary
createShopifyChannelvaluePublic export.
parseShopifyConversationKeyvaluePublic export.
ShopifyChanneltypePublic export.
ShopifyChannelOptionstypePublic export.
shopifyConversationKeyvaluePublic export.
ShopifyConversationReftypePublic export.
ShopifyWebhookPayloadtypePublic export.
updateShopifyOrderNotevaluePublic export.

@fabric-harness/channels/messenger

ExportKindSummary
createMessengerChannelvaluePublic export.
MessengerChanneltypePublic export.
MessengerChannelOptionstypePublic export.
messengerConversationKeyvaluePublic export.
MessengerConversationReftypePublic export.
MessengerWebhookPayloadtypePublic export.
parseMessengerConversationKeyvaluePublic export.
replyInMessengervaluePublic export.

@fabric-harness/channels/resend

ExportKindSummary
createResendChannelvaluePublic export.
parseResendConversationKeyvaluePublic export.
ResendChanneltypePublic export.
ResendChannelOptionstypePublic export.
resendConversationKeyvaluePublic export.
ResendConversationReftypePublic export.
ResendWebhookPayloadtypePublic export.
sendWithResendvaluePublic export.
verifyResendSignaturevaluePublic export.

@fabric-harness/channels/salesforce-marketing-cloud

ExportKindSummary
createSalesforceMarketingCloudChannelvaluePublic export.
parseSalesforceMarketingCloudConversationKeyvaluePublic export.
SalesforceMarketingCloudChanneltypePublic export.
SalesforceMarketingCloudChannelOptionstypePublic export.
salesforceMarketingCloudConversationKeyvaluePublic export.
SalesforceMarketingCloudConversationReftypePublic export.
SalesforceMarketingCloudEventtypePublic export.
SalesforceMarketingCloudWebhookPayloadtypePublic export.
sendMarketingCloudMessagevaluePublic export.

@fabric-harness/cli

@fabric-harness/cli

ExportKindSummary
No named exports

@fabric-harness/cli/config

ExportKindSummary
defineConfigvaluePublic export.
DefineConfigInputtypePublic export.

@fabric-harness/cloudflare

@fabric-harness/cloudflare

ExportKindSummary
cloudflarevalueOne-call wiring for a Cloudflare-native agent: model provider, Workers AI binding tools, a safe default egress policy, and an optional Durable Object session store.
CLOUDFLARE_BUILD_TARGETvaluePublic export.
cloudflareAgentvaluePublic export.
CloudflareAgentOptionstypePublic export.
CloudflareBundletypePublic export.
CloudflareBundleConfigtypePublic export.
CloudflareCronHandlerOptionstypePublic export.
CloudflareDurableObjectSessionStoreOptionstypePublic export.
CloudflareDurableObjectSqlStoragetypePublic export.
CloudflareDurablePersistenceStorestypePublic export.
CloudflareExecutionContextLiketypePublic export.
CloudflareExtensiontypePublic export.
CloudflareR2BucketLiketypePublic export.
CloudflareR2ListResultLiketypePublic export.
CloudflareR2ObjectBodyLiketypePublic export.
CloudflareSandboxEnvOptionstypePublic export.
CloudflareSandboxExecResulttypePublic export.
CloudflareSandboxFileInfotypePublic export.
CloudflareSandboxLiketypePublic export.
CloudflareSandboxProcessLiketypePublic export.
CloudflareScheduledControllertypePublic export.
CloudflareScheduledJobtypePublic export.
cloudflareScheduleIdempotencyKeyvaluePublic export.
createCloudflareCronHandlervalueBuild a Cloudflare scheduled() handler that admits matching jobs through the finite-run seam.
createCloudflareDurableObjectSessionStorevalueMinimal Durable Object SQL-backed SessionStore used by the Cloudflare build target. It intentionally depends only on the small SQL shape exposed by Workers Durable Objects so Cloudflare SDK types do not leak into the SDK.
createCloudflareDurablePersistenceStoresvalueDurable Object SQLite stores for the v2 submission and stream lifecycle.
createCloudflareRunStorevalueCloudflare Durable Object SQL-backed RunStore for workflow events. Enforces append-only semantics via a UNIQUE(run_id, event_index) primary key on the fabric_harness_workflow_events table. Duplicate event indexes for the same runId are rejected at the storage layer. A BEFORE INSERT trigger on fabric_harness_runs deletes existing events when a run is reset with the same id (same-ID reset behaviour).
createCloudflareSandboxEnvvalueAdapt an instance returned by getSandbox(env.Sandbox, id) from @cloudflare/sandbox into Fabric's provider-neutral SandboxEnv contract.
defineCloudflareAgentvaluePublic export.
DefineCloudflareAgentOptionstypePublic export.
extendvaluePublic export.
ExtensionClasstypePublic export.
MockCloudflareModelProvidervalueA deterministic ModelProvider for Cloudflare agent tests and init templates. Returns structured responses without requiring real Cloudflare credentials.
MockCloudflareModelProviderOptionstypePublic export.
r2FilesystemSourcevalueRead Cloudflare R2 objects as a Fabric filesystem source. Mount it with withFilesystemSources() so support agents can grep/read R2-backed knowledge bases through the normal sandbox tools.
R2FilesystemSourceOptionstypePublic export.
registerCloudflareSandboxRefDecodervalueRegister cross-process/Worker attachment for Cloudflare Sandbox IDs.
resolveCloudflareExtensionvaluePublic export.
ResolvedCloudflareExtensiontypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/cloudflare/agent

ExportKindSummary
cloudflareAgentvaluePublic export.
CloudflareAgentOptionstypePublic export.
defineCloudflareAgentvaluePublic export.
DefineCloudflareAgentOptionstypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/cloudflare/workers-ai

ExportKindSummary
BUILTIN_WORKERS_AI_MODEL_INFOvaluePublic export.
CLOUDFLARE_WORKERS_AI_MODEL_PREFIXvalueReserved model-string prefix that routes through the Workers AI binding provider. init({ model: 'cloudflare/@cf/meta/llama-3.1-8b-instruct' }) picks this provider when one is registered with the matching name.
CloudflareWorkersAIBindingLiketypeStructural shape of Cloudflare Workers' AI binding (env.AI). The real Ai type lives in @cloudflare/workers-types; we accept a narrower structural type so this package doesn't peer-dep workers-types. The run() method accepts the OpenAI Chat Completions request body and returns an OpenAI-shaped response when stream: false is passed.
CloudflareWorkersAIGatewayOptionstypePublic export.
CloudflareWorkersAIModelInfotypePublic export.
CloudflareWorkersAIModelProvidervalueModel provider that dispatches to Cloudflare Workers AI via the platform binding (env.AI.run()) instead of HTTP. Use on a Cloudflare Workers deployment to skip API tokens, gain Workers-AI-native rate limiting, and keep inference inside Cloudflare's network. Workers AI accepts the OpenAI Chat Completions request body verbatim, so we serialize through the SDK's toOpenAIMessage/toOpenAITool helpers and parse the binding's response with openAIChatCompletionToModelResponse. See the package declarations for an example. Pair with the cloudflare/ model prefix to make routing explicit when...
CloudflareWorkersAIModelProviderOptionstypePublic export.
mapReasoningEffortvalueMap Fabric's ordinal ThinkingLevel to Cloudflare's shared reasoning_effort option: minimal/lowlow, mediummedium, high/xhighhigh. 'off' is handled by the caller (the field is omitted) and never reaches this function.
stripCloudflarePrefixvalueStrip the cloudflare/ routing prefix from a model id, leaving the raw Workers AI model id (e.g. @cf/meta/llama-3.1-8b-instruct).
WorkersAIReasoningEfforttypeCloudflare Workers AI reasoning-effort wire values.

@fabric-harness/cloudflare/shell

ExportKindSummary
CloudflareShellCodeExecutorLiketypePublic export.
CloudflareShellCodeInputtypePublic export.
CloudflareShellCodeToolOptionstypePublic export.
CloudflareShellContexttypePublic export.
CloudflareShellWorkspaceSandboxtypePublic export.
CloudflareShellWorkspaceSandboxOptionstypePublic export.
CloudflareWorkerLoaderLiketypePublic export.
createCloudflareShellCodeToolvaluePublic export.
createCloudflareShellCodeToolFromExecutorvaluePublic export.
createCloudflareShellWorkspaceSandboxEnvvaluePublic export.
getCloudflareShellContextvaluePublic export.
getCloudflareShellWorkspaceSandboxvaluePublic export.
getDefaultCloudflareWorkspacevalueConstruct the default
GetDefaultCloudflareWorkspaceOptionstypePublic export.
hydrateCloudflareWorkspaceFromR2valueEagerly copy R2 objects into a
HydrateCloudflareWorkspaceFromR2OptionstypePublic export.
registerCloudflareShellWorkspaceRefDecodervalueRegister attachment for a durable Cloudflare Shell workspace routing ID.
runWithCloudflareShellContextvaluePublic export.

@fabric-harness/cloudflare/scheduled

ExportKindSummary
CloudflareCronHandlerOptionstypePublic export.
CloudflareExecutionContextLiketypePublic export.
CloudflareScheduledControllertypePublic export.
CloudflareScheduledJobtypePublic export.
cloudflareScheduleIdempotencyKeyvaluePublic export.
createCloudflareCronHandlervalueBuild a Cloudflare scheduled() handler that admits matching jobs through the finite-run seam.

@fabric-harness/cloudflare/persistence

ExportKindSummary
CloudflareDurablePersistenceStorestypePublic export.
createCloudflareDurablePersistenceStoresvalueDurable Object SQLite stores for the v2 submission and stream lifecycle.

@fabric-harness/connectors

@fabric-harness/connectors

ExportKindSummary
assertSandboxCertificationvaluePublic export.
AzureBlobBodyLiketypePublic export.
AzureBlobFilesystemClientLiketypePublic export.
azureBlobFilesystemSourcevaluePublic export.
AzureBlobListResultLiketypePublic export.
certifySandboxAdaptervalueExercise the portable Fabric sandbox contract and return secret-free, machine-readable evidence suitable for a CI artifact.
daytonaSandboxvaluePublic export.
daytonaSandboxFactoryvaluePublic export.
DaytonaSandboxLiketypePublic export.
DaytonaSandboxOptionstypePublic export.
e2bSandboxvaluePublic export.
E2BSandboxLiketypePublic export.
FilesystemSourcetypeA read-only content source that can be mounted into a sandbox at sandbox-creation time. The agent then has built-in read, glob, and grep tools available over the mounted content — no retrieval pipeline, no embeddings, no vector store required. Sources are intentionally minimal: they yield (path, content) pairs. Implementations decide how to enumerate (eager vs lazy is up to the source author) — the mount step pulls the full set into the sandbox.
ModalFileInfoLiketypePublic export.
ModalFilesystemLiketypePublic export.
ModalProcessLiketypePublic export.
ModalReadStreamLiketypePublic export.
modalSandboxvaluePublic export.
ModalSandboxLiketypePublic export.
modalSdkSandboxvalueAdapt a native Modal TypeScript SDK Sandbox without exposing credentials to the Fabric runtime or model context.
ModalSdkSandboxLiketypeStructural subset implemented by modal 0.9 Sandbox.
ModalSdkSandboxOptionstypePublic export.
ObjectStorageFilesystemSourceOptionstypePublic export.
ProviderCleanupOptionstypePublic export.
RemoteAdapterOptionstypePublic export.
remoteSandboxvalueDependency-free structural connector for provider-owned remote sandboxes. Provider-specific packages can keep their SDK/client types private and map them to RemoteSandboxApi, then return this SandboxFactory. Credentials stay in the provider client and are never serialized into Fabric session history.
RemoteSandboxApitypePublic export.
RemoteSandboxConnectorOptionstypePublic export.
remoteSandboxEnvvaluePublic export.
RemoteSandboxOptionstypePublic export.
S3FilesystemClientLiketypePublic export.
s3FilesystemSourcevaluePublic export.
S3ObjectBodyLiketypePublic export.
S3ObjectListResultLiketypePublic export.
SANDBOX_PROVIDER_COMPATIBILITYvaluePublic export.
SandboxAdapterValidationOptionstypePublic export.
SandboxAdapterValidationResulttypePublic export.
SandboxCertificationChecktypePublic export.
SandboxCertificationCheckNametypePublic export.
SandboxCertificationErrorvaluePublic export.
SandboxCertificationOptionstypePublic export.
SandboxCertificationReporttypePublic export.
SandboxFactorytypePublic export.
validateSandboxAdaptervaluePublic export.

@fabric-harness/connectors/s3

ExportKindSummary
s3SourcevalueRead-only S3 connector. Mount with session.mount(mountAt, s3Source(...)). The agent's built-in read, grep, glob, and bash tools then operate over the mounted prefix as if it were a local directory.
S3SourceOptionstypeConcrete S3 connector backed by @aws-sdk/client-s3. Users pass bucket config; this module constructs the SDK client internally and adapts it to Fabric Harness's FilesystemSource contract. Install peer dep: ```sh npm install
s3WritervaluePublic export.
S3WritertypePublic export.
S3WriterOptionstypeWrite-side helper for S3. Use to publish artifacts or mount a writable view. See the package declarations for an example.

@fabric-harness/connectors/azure-blob

ExportKindSummary
azureBlobSourcevaluePublic export.
AzureBlobSourceOptionstypeConcrete Azure Blob connector backed by @azure/storage-blob. Install peer deps: ```sh npm install
azureBlobWritervaluePublic export.
AzureBlobWritertypePublic export.
AzureBlobWriterOptionstypePublic export.

@fabric-harness/connectors/gcs

ExportKindSummary
gcsSourcevaluePublic export.
GcsSourceOptionstypeConcrete Google Cloud Storage connector backed by @google-cloud/storage. Install peer dep: ```sh npm install
gcsWritervaluePublic export.
GcsWritertypePublic export.
GcsWriterOptionstypePublic export.

@fabric-harness/connectors/github

ExportKindSummary
githubSourcevaluePublic export.
GithubSourceOptionstypeRead-only GitHub repository connector backed by octokit. Mounts a repository (at a given ref) as files inside the sandbox. Uses the Git Trees API in recursive mode for efficient enumeration. Install peer dep: See the package declarations for an example.

@fabric-harness/connectors/databricks-volume

ExportKindSummary
databricksVolumeSourcevaluePublic export.
DatabricksVolumeSourceOptionstypeDatabricks Unity Catalog Volume connector backed by the Files API (/api/2.0/fs/files/...). No SDK dependency — uses fetch directly. Volume paths are addressed as /Volumes/<catalog>/<schema>/<volume>/<path>. Usage: See the package declarations for an example.
databricksVolumeWritervaluePublic export.
DatabricksVolumeWritertypePublic export.
DatabricksVolumeWriterOptionstypePublic export.

@fabric-harness/connectors/k8s

ExportKindSummary
createKubernetesEgressNetworkPolicyvalueBuild a deny-by-default Kubernetes egress boundary. Domain filtering belongs in the selected proxy; Kubernetes NetworkPolicy is intentionally limited to DNS, that proxy, and explicit private endpoint CIDRs.
createKubernetesPodvaluePublic export.
createKubernetesPodFromImagevaluePublic export.
CreateKubernetesPodFromImageOptionstypeProvision an ephemeral pod from an image and return a KubernetesPodLike ready for kubernetesSandbox(). Works against any cluster reachable via the resolved kubeconfig — in-cluster, $KUBECONFIG, or ~/.kube/config. The pod is created with restartPolicy: Never and runs sleep infinity so it stays attachable. cleanup() (when wired via kubernetesSandbox's cleanup: true) deletes the pod. For Azure-managed clusters, prefer aksSandbox() from @fabric-harness/azure/aks-sandbox which adds ARM-resolved kubeconfig. See the package declarations for an example.
CreateKubernetesPodOptionstypeConvenience helper: build a KubernetesPodLike from a @kubernetes/client-node KubeConfig plus pod identity. Suitable when kubectl already gets you in the door — for AKS, prefer aksSandbox() from @fabric-harness/azure. Files are transferred over exec using base64-encoded cat / tee. Works for text and small binaries; for large objects mount external storage via s3Source / gcsSource / azureBlobSource instead.
KubernetesEgressNetworkPolicyOptionstypePublic export.
KubernetesNetworkPolicyManifesttypePublic export.
KubernetesPodLiketypeStructural Kubernetes pod adapter. The caller wires up @kubernetes/client-node (or any SPDY/exec-capable client) and supplies an object that satisfies KubernetesPodLike. Why structural: cluster auth, RBAC, and the exec wire format vary too much across environments (in-cluster, kubeconfig, AKS managed identity, GKE Workload Identity, EKS IRSA, …) for a single concrete adapter to be sensible. Pattern matches daytonaSandbox / e2bSandbox. For Azure-hosted clusters use the higher-level aksSandbox() from @fabric-harness/azure, which wires this adapter to Azure-managed credentials.
kubernetesSandboxvaluePublic export.
KubernetesSandboxOptionstypePublic export.

@fabric-harness/connectors/vercel

ExportKindSummary
vercelSandboxvalueWrap a Vercel Sandbox instance as a Fabric Harness SandboxEnv. The sandbox's filesystem and shell exec are mapped to the fabric contract; cleanup: true calls sandbox.stop() when the Fabric session tears down. See the package declarations for an example. Vercel's runCommand accepts cwd, env, AbortSignal, and output streams. Fabric maps its millisecond timeout to an AbortSignal and resolves the command object's async stdout()/stderr() methods used by SDK 1.x.
vercelSandboxFactoryvalueConvenience factory that returns a SandboxFactory, suitable for init({ sandbox: vercelSandboxFactory(...) }). Provisions a fresh sandbox on first use via the supplied create() callback.
VercelSandboxLiketypeStructural shape of @vercel/sandbox's Sandbox instance, kept narrow so this package doesn't peer-dep on @vercel/sandbox directly. Pass any object satisfying this contract — the real Sandbox from @vercel/sandbox does. See https://vercel.com/docs/vercel-sandbox/sdk-reference for the upstream API. This adapter targets the post-GA shape (runCommand, fs.*).
VercelSandboxOptionstypePublic export.

@fabric-harness/connectors/modal

ExportKindSummary
ModalFileInfoLiketypePublic export.
ModalFilesystemLiketypePublic export.
ModalProcessLiketypePublic export.
ModalReadStreamLiketypePublic export.
modalSdkSandboxvalueAdapt a native Modal TypeScript SDK Sandbox without exposing credentials to the Fabric runtime or model context.
ModalSdkSandboxLiketypeStructural subset implemented by modal 0.9 Sandbox.
ModalSdkSandboxOptionstypePublic export.

@fabric-harness/connectors/sandbox-refs

ExportKindSummary
RegisterStandardDecodersOptionstypeStandard cross-process sandbox-ref decoders for the connectors that ship here. Call this once at startup in any process that needs to attach to sandboxes encoded by session.sandboxRef({ portable: true }). Each connect* callback is responsible for hydrating a provider-native client object from providerData; the connectors package wraps that client in a SandboxEnv exactly the way the upstream factory functions do (daytonaSandbox, e2bSandbox, modalSandbox, kubernetesSandbox). See the package declarations for an example.
registerStandardSandboxRefDecodersvaluePublic export.

@fabric-harness/connectors/sandbox-certification

ExportKindSummary
assertSandboxCertificationvaluePublic export.
certifySandboxAdaptervalueExercise the portable Fabric sandbox contract and return secret-free, machine-readable evidence suitable for a CI artifact.
SandboxCertificationChecktypePublic export.
SandboxCertificationCheckNametypePublic export.
SandboxCertificationErrorvaluePublic export.
SandboxCertificationOptionstypePublic export.
SandboxCertificationReporttypePublic export.

@fabric-harness/databases

@fabric-harness/databases

ExportKindSummary
assertReadOnlyStatementvaluePublic export.
governedDatabaseToolvalueCommon database tool boundary: effect metadata, timeout, size cap, and redacted failures.
GovernedDatabaseToolOptionstypePublic export.
MongoCollectionLiketypePublic export.
MongoCursorLiketypePublic export.
mongoFindToolvalueCollection-bound find tool. Host code constructs the filter and projection.
MongoFindToolOptionstypePublic export.
MysqlClientLiketypePublic export.
mysqlToolvaluePublic export.
MysqlToolOptionstypePublic export.
PostgresClientLiketypePublic export.
postgresToolvalueFixed-statement Postgres tool. The model supplies values, never SQL text.
PostgresToolOptionstypePublic export.
RedisClientLiketypePublic export.
RedisToolOptionstypePublic export.
redisToolsvaluePublic export.
SqliteClientLiketypePublic export.
SqliteStatementLiketypePublic export.
sqliteToolvaluePublic export.
SqliteToolOptionstypePublic export.

@fabric-harness/databases/postgres

ExportKindSummary
PostgresClientLiketypePublic export.
postgresToolvalueFixed-statement Postgres tool. The model supplies values, never SQL text.
PostgresToolOptionstypePublic export.

@fabric-harness/databases/mysql

ExportKindSummary
MysqlClientLiketypePublic export.
mysqlToolvaluePublic export.
MysqlToolOptionstypePublic export.

@fabric-harness/databases/sqlite

ExportKindSummary
SqliteClientLiketypePublic export.
SqliteStatementLiketypePublic export.
sqliteToolvaluePublic export.
SqliteToolOptionstypePublic export.

@fabric-harness/databases/mongodb

ExportKindSummary
MongoCollectionLiketypePublic export.
MongoCursorLiketypePublic export.
mongoFindToolvalueCollection-bound find tool. Host code constructs the filter and projection.
MongoFindToolOptionstypePublic export.

@fabric-harness/databases/redis

ExportKindSummary
RedisClientLiketypePublic export.
RedisToolOptionstypePublic export.
redisToolsvaluePublic export.

@fabric-harness/databricks

@fabric-harness/databricks

ExportKindSummary
AgentEvaluationRecordtypePublic export.
appServicePrincipalFromEnvvalueThe service principal a Databricks App runs as, from the standard app runtime environment (DATABRICKS_HOST / DATABRICKS_CLIENT_ID / DATABRICKS_CLIENT_SECRET). Returns undefined when any variable is missing, so callers can fall back to explicit configuration.
buildMlflowTracevalueBuild the MLflow V3 POST /api/3.0/mlflow/traces payload for one settled submission. Pure and deterministic: trace/span ids derive from the submission id (+ span index) via SHA-256, so replaying the same settled submission produces byte-identical ids. The root span covers the whole submission; buffered TelemetrySpans become its children.
ConsumptionGroupBytypePublic export.
ConsumptionSummarytypePublic export.
ConsumptionSummaryOptionstypePublic export.
createDatabricksClientvaluePublic export.
createDatabricksRagChainvalueThin orchestration of Databricks-native Vector Search + Model Serving for the online RAG inference chain documented in the Databricks AI Cookbook. Prefer databricksRagChain from the package root when you have a databricks({ vectorSearch }) config — it wires the bundle for you. Does not implement offline chunking/indexing (use Databricks Jobs/Lakeflow). Does not replace Mosaic Agent Evaluation — export turns with rag-eval helpers.
databricksvalueOne-call wiring for a Databricks-native agent: model serving, a UC principal threaded through model + data + state, governed tools, an approval/egress policy, and (optionally) Lakebase-backed durable state. Also registers databricks/* model refs. Everything is layered on Unity Catalog — never a replacement for it.
DATABRICKS_API_VERSIONSvaluePublic export.
DATABRICKS_AUTH_MODESvaluePublic export.
DATABRICKS_PACKAGE_COMPATIBILITYvaluePublic export.
databricksActualCostSourcevalueCreate a Databricks-backed ActualCostSource that queries system.billing.usage joined to system.billing.list_prices for real spend data. Results are cached per-scope-key for cacheTtlMs (default 60s) to avoid hammering the SQL warehouse.
DatabricksActualCostSourceOptionstypePublic export.
databricksAgentvaluePublic export.
DatabricksAgentOptionstypePublic export.
databricksAiQueryToolvalueai_query(endpoint, request) — run model inference inside the SQL warehouse against a serving endpoint. Drives both serving and SQL-warehouse consumption. Uses named SQL parameters, so the endpoint and request are never string-interpolated into SQL.
DatabricksAiQueryToolOptionstypePublic export.
databricksAppvaluePublic export.
DatabricksAppOptionstypeProduction preset for agents hosted on Databricks Apps (v2, workstream C5). One call resolves the runtime from the standard app environment: the app's service principal (client-credentials OAuth), the workspace REST client and serving-endpoint model provider, Lakebase-backed persistence for sessions + submissions + conversation streams, and submission-keyed telemetry — all running as one governed identity that Unity Catalog enforces. See the package declarations for an example.
DatabricksApprovalRuleOptionstypePublic export.
databricksApprovalRulesvalueBuilds approval rules (one per gated tool) for CapabilityPolicy.toolPolicy.approvalRules.
DatabricksAppRuntimetypePublic export.
DatabricksAppUserAuthorizationInspectiontypePublic export.
DatabricksBundletypePublic export.
DatabricksBundleConfigtypePublic export.
DatabricksCertificationChecktypePublic export.
DatabricksCertificationEvidencetypePublic export.
DatabricksCertificationResulttypePublic export.
DatabricksCertificationStatustypePublic export.
DatabricksClientOptionstypePublic export.
DatabricksCloudtypePublic export.
databricksCompatibilityRecordvalueConvert successful, fully identified certification evidence into a publishable matrix row.
databricksConsumptionvalueSystem-Tables consumption reporting. Reads system.billing.usage joined to list_prices to report real DBUs + list cost — the "prove the consumption" artifact for chargeback and partner credit.
DatabricksConsumptiontypePublic export.
DatabricksConsumptionOptionstypePublic export.
databricksConsumptionToolvalueAgent-callable consumption report over the last days (default 30) or an explicit date window.
DatabricksConsumptionToolOptionstypePublic export.
DatabricksCostReconciliationOptionstypePublic export.
DatabricksCostReconciliationResulttypePublic export.
databricksEmbeddingsvalueEmbeddings via a Mosaic AI serving embedding endpoint. Databricks exposes the OpenAI-compatible embeddings surface at <host>/serving-endpoints/embeddings with the endpoint name as model. Reuses the bundle's REST client, so it inherits the rotating UC-principal token. (URL/response schema worth a smoke test against a live embedding endpoint — chat and embeddings share the OpenAI-compatible convention but endpoint families can differ.)
DatabricksEmbeddingsOptionstypePublic export.
databricksFeatureLookupToolvalueLow-latency feature lookup from a Databricks Feature Serving endpoint (backed by an Online Table). The model passes primary-key records; the endpoint returns the served feature values. Drives serving consumption and keeps features governed by Unity Catalog under the bundle principal.
DatabricksFeatureLookupToolOptionstypePublic export.
databricksFoundationModelProvidervalueDatabricks inference provider supporting both Unity AI Gateway model services and custom Model Serving endpoints. In auto mode, fully-qualified system.ai.* models use AI Gateway and other endpoint names retain the /serving-endpoints route.
databricksGenieToolvalueAI/BI Genie — delegate a natural-language analytics question to a governed Genie space. Genie generates and runs SQL on the warehouse and returns an answer; this tool returns the answer text, the generated SQL, and the result rows. Pass conversationId to continue a multi-turn thread. Genie response field names vary by API version — parsed defensively; smoke-test against a live space.
DatabricksGenieToolOptionstypePublic export.
DatabricksGovernanceOptionstypePublic export.
databricksGovernancePolicyvalueAssembles a CapabilityPolicy for a Databricks tool set: approval routing for sensitive operations (if stewardAudience is set) plus an egress allowlist pinned to the workspace host(s). Used by the databricks() bundle; can also be merged into an agent's own policy.
DatabricksGovernancePolicyOptionstypePublic export.
databricksIdentityvalueBuilds a cached, auto-refreshing token provider for a Databricks principal.
DatabricksInferenceModetypePublic export.
databricksJobsvaluePublic export.
DatabricksJobsvaluePublic export.
DatabricksJobsWaitOptionstypePublic export.
databricksLakeflowToolsvalueThe default Lakeflow tool set added by the bundle's lakeflow option.
DatabricksLineageEvidenceRowtypePublic export.
DatabricksLineageRecordtypeGovernance for Databricks tools is layered on top of Unity Catalog, never a replacement. UC enforces table/row/column ACLs natively via the acting principal (see identity.ts). These helpers add the things UC doesn't: an audit/lineage stamp on every tool call, approval routing for sensitive operations, and an egress allowlist pinned to the workspace — all expressed through the SDK's existing CapabilityPolicy, so the loop enforces them without a bespoke engine.
databricksMlflowLogMetricToolvaluePublic export.
databricksMlflowLogParamToolvaluePublic export.
databricksModelBaseUrlvalueBuild the OpenAI-compatible base URL used for one Databricks inference mode.
DatabricksModelOptionstypePublic export.
DatabricksModelServicetypePublic export.
DatabricksModelServiceDiscoveryOptionstypePublic export.
databricksNotebookToolvaluePublic export.
databricksPersistencevalueOne-call Lakebase persistence for Databricks-hosted agents. See the package declarations for an example. The Postgres store implementations come from @fabric-harness/node (optional peer) and run unchanged against Lakebase — the only Databricks specifics are database-credential exchange, refresh caching, and TLS defaults from lakebaseClient.
DatabricksPersistencetypeEverything the v2 runtime persists, on Lakebase, in one adapter: sessions (canonical conversation state), durable agent submissions (admission/FIFO/leases/settlement), and offset-addressable conversation streams. Implements the SDK PersistenceAdapter contract, so it plugs straight into init({ persistence }); the extra connect* methods feed startDevServer({ submissionStore, conversationStreamStore }).
DatabricksPersistenceOptionstypePublic export.
DatabricksPersistenceStoreModuletypeThe slice of @fabric-harness/node this adapter assembles. Loaded dynamically (node is an optional peer — Databricks Apps always run on Node, but this package stays importable without it); injectable for tests.
databricksPipelineListToolvalueLakeflow Declarative Pipelines (formerly DLT). These drive heavy continuous-compute consumption. start/stop mutate pipeline state (effect: 'execute', governable); list/status are reads.
databricksPipelineStartToolvaluePublic export.
databricksPipelineStatusToolvaluePublic export.
databricksPipelineStopToolvaluePublic export.
DatabricksPrincipaltypePublic export.
DatabricksPrincipalEnvOptionstypePublic export.
databricksPrincipalFromEnvvalueResolve a PAT or OAuth M2M principal consistently across CLIs, recipes, Apps, and tests.
databricksRagChainvalueCookbook-style online RAG chain over native Mosaic Vector Search + Model Serving. See the package declarations for an example.
DatabricksRagChaintypePublic export.
DatabricksRagChainOptionstypePublic export.
DatabricksRagChainResolvedOptionstypeInputs once a bundle (or explicit retriever + model) is resolved.
DatabricksRequestOptionstypePublic export.
DatabricksRequestTagstypePublic export.
DatabricksRestClientvaluePublic export.
databricksRunJobToolvaluePublic export.
DatabricksRunLifeCycleStatetypePublic export.
DatabricksRunOutputtypePublic export.
DatabricksRunReceipttypePublic export.
DatabricksRunResultStatetypePublic export.
DatabricksRunStatetypePublic export.
DatabricksRunTimeoutErrorvaluePublic export.
databricksSecretsProvidervalueDatabricks Secret Management adapter. Secret values are decoded only at runtime.
DatabricksSecretsProviderOptionstypePublic export.
databricksSqlToolvaluePublic export.
DatabricksSqlToolOptionstypePublic export.
databricksTableInfoToolvaluePublic export.
databricksTelemetryvaluePublic export.
DatabricksTelemetrytypePublic export.
DatabricksTelemetryOptionstypeCost + lineage as core telemetry (v2, workstream C4): submission lifecycle events and governed tool-call lineage land in Lakebase tables keyed by the same submissionId that drives events, settlement, and audit — so spend, lineage, and outcomes join on one stable key. Writes are fire-and-forget: a telemetry failure must never affect execution.
databricksTenantCostLimitvaluePublic export.
DatabricksTokenProvidertypeA bearer-token resolver awaited per request. Shape matches what DatabricksRestClient, databricksFoundationModelProvider (via tokenProvider), and the Lakebase store accept, so a single principal threads through model calls, data calls, and state.
databricksVectorSearchvalueDatabricks Mosaic AI Vector Search as a Retriever. Runs under the bundle's UC principal.
DatabricksVectorSearchOptionstypePublic export.
DatabricksWaitOptionstypePublic export.
DatabricksWorkspaceCompatibilityRecordtypePublic export.
databricksWorkspaceOriginvalueNormalize a workspace hostname or URL to its HTTPS origin.
databricksWorkspaceSourcevaluePublic export.
DatabricksWorkspaceSourceOptionstypePublic export.
defineDatabricksAgentvaluePublic export.
DefineDatabricksAgentOptionstypePublic export.
ensureDatabricksAiGatewayvalueVerify that Unity AI Gateway v2 is enabled. A successful empty listing still means the service is available; model-service discovery reports whether usable models exist.
ensureDatabricksTelemetryTablesvalueCreate the telemetry tables when absent. Idempotent.
exportAgentEvaluationJsonlvalueSerialize evaluation records as JSONL for MLflow / Agent Evaluation import.
exportMlflow3EvaluationJsonlvalueSerialize structured MLflow 3 evaluation rows as newline-delimited JSON.
fabricPrincipalForvalueMap a Databricks principal onto the SDK's FabricPrincipal so the governed identity rides submissions → tool calls → lineage/cost records. Never carries a token — ids and labels only.
FabricPrincipalOverridestypePublic export.
inferenceTableUsageQueryvalueSQL aggregating a serving endpoint's inference/payload table by client_request_id — one row per submission with the request count and the first/last request timestamps — for offline joins against fh_submission_telemetry.submission_id. Join contract: callers MUST send the submission id as the serving request's client_request_id (e.g. the client_request_id field on the serving-endpoint invocation) — the inference table records it verbatim, and this query's submission_id column only joins when that convention holds. Rows without a client_request_id (traffic from other callers) are...
InferenceTableUsageQueryOptionstypePublic export.
inspectDatabricksAppUserAuthorizationvalueValidate a Databricks Apps forwarded user token and return non-secret identity/lifetime metadata suitable for OBO lifecycle certification. The access token is never returned or included in an error.
isDatabricksModelServicevalueTrue for Unity Catalog model-service identifiers accepted by Unity AI Gateway.
lakebaseClientvaluePublic export.
LakebaseClienttypePublic export.
LakebaseClientOptionstypePublic export.
lakebaseCredentialProvidervalueExchange a workspace OAuth token for a Lakebase database credential. The result is cached, refreshed early with jitter, and refreshes are single-flight.
LakebaseCredentialProviderOptionstypePublic export.
LakebasePoolConfigtypePublic export.
LakebasePoolFactorytypePublic export.
LegacyAgentEvaluationRecordtypeOne row in the shape commonly used with Databricks / MLflow GenAI evaluation tables (request / response / retrieved_context). This is an export for Mosaic Agent Evaluation and notebooks — not a reimplementation of judges.
listDatabricksModelServicesvalueList fully-qualified Unity Catalog model services with bounded, loop-safe pagination.
Mlflow3RagEvaluationRecordtypeMLflow 3 evaluation-dataset row with structured inputs, outputs, and expectations.
mlflowTraceExportervaluePublic export.
MlflowTraceExportertypePublic export.
MlflowTraceExporterOptionstypeMLflow trace export (v2 migration, workstream C6): one MLflow trace per settled submission, so agent activity shows up in the workspace's MLflow experiment UI next to models and evaluations. Wiring: sink goes into createSubmissionRunner({ telemetry }) and onEvent fans in with the app's onEvent callback. A submission_started telemetry event opens a span buffer keyed by the store session id (agent:<agent>:<instanceId>:<session> — the sessionId stamped on FabricEvents during the attempt); every event that matches an open buffer and converts via the S...
MlflowTraceInputtypePublic export.
MlflowTracePayloadtypePublic export.
MockDatabricksModelProvidervalueA deterministic ModelProvider for Databricks agent tests and init templates. Returns structured responses for SQL/table-info tool calls without requiring real Databricks credentials.
MockDatabricksModelProviderOptionstypePublic export.
onBehalfOfFromHeadersvalueOn-behalf-of principal from Databricks Apps user-authorization headers: the platform forwards the signed-in user's access token as x-forwarded-access-token (plus x-forwarded-email/x-forwarded-user). Returns undefined when the request carries no user token (e.g. app service-to-service traffic) so callers fall back to the app principal.
queryDatabricksLineageEvidencevalueJoin governed object access to the submission actor, outcome, and model/tool cost.
RagChainPostProcessOptionstypePublic export.
RagChainPromptOptionstypePublic export.
RagEvalExpectedtypePublic export.
RagPreprocesstypePublic export.
RagTurntypeStructured result of one online RAG inference turn. Mirrors the Databricks AI Cookbook chain: preprocess → retrieve (Vector Search) → prompt augment → generate → post-process. Fabric does not reimplement Vector Search or Model Serving — this is a thin orchestration over native Databricks APIs already exposed by this package.
ragTurnCitationsScorervaluePublic export.
ragTurnContainsScorervalueAdapter for @fabric-harness/evals scorers when the suite output is a RagTurn. Keep heavy quality judges in Databricks Agent Evaluation; use these for CI smoke.
RagTurnScoretypePublic export.
reconcileDatabricksCostvalueCompare immediate estimates with delayed System Tables actuals and apply an explicit outage policy.
registerDatabricksModelProvidervalueRegister databricks/<model> model references.
resolveToolRefsvaluePublic export.
runDatabricksCertificationvalueRun live capability checks and produce stable, secret-redacted CI evidence.
RunDatabricksCertificationOptionstypePublic export.
RunDatabricksJobInputtypePublic export.
scoreRagTurnvalueLightweight local checks before/alongside Databricks Agent Evaluation.
servingUsageCapturevalueBuild an onEvent fan-in that turns model-usage events into submission_usage telemetry. For every FabricEvent carrying data.usage ({ inputTokens?, outputTokens?, costUsd? }, at least one numeric field) — and optionally data.model — while an ambient currentSubmissionContext is set, it emits one submission_usage event stamped with the submission correlation (submission/attempt ids, agent identity, tenant, actor). Events observed outside a submission context are dropped silently — not every session turn belongs to a submission. The submission context does not carry the...
ServingUsageCaptureOptionstypeServing usage capture (v2 migration, workstream C7): attribute model/serving spend to submissions through the ambient submission context.
SubmitDatabricksNotebookInputtypePublic export.
toAgentEvaluationRecordvalueConvert a RagTurn into a Databricks-friendly evaluation record. Upload JSONL of these rows to MLflow / Agent Evaluation rather than building a parallel judge stack in Fabric.
toMlflow3EvaluationRecordvalueConvert a RAG turn into the structured MLflow 3 evaluation-dataset shape.
UcVolumesAttachmentStorevaluePublic export.
UcVolumesAttachmentStoreOptionstypeUnity Catalog Volumes attachment backend (v2 migration, workstream C2). Implements the SDK AttachmentStore contract on a UC Volume via the Databricks Files API, so attachment bytes are governed by Unity Catalog grants like every other Databricks asset. Layout under the volume: See the package declarations for an example. The bare <digest> file holds the raw bytes; the <digest>.json sidecar holds the AttachmentRef metadata and doubles as the record's existence marker: put is first-write-wins per (scope, digest) — when the sidecar already exists the put is a no-op, so...
unityCatalogTablesToolvaluePublic export.
waitForDatabricksRunvaluePublic export.
waitForDatabricksStatementvaluePublic export.
withGovernancevalueWraps one Databricks tool to stamp lineage/audit and enforce the optional catalog allowlist.
withGovernanceToolsvalueWraps a set of Databricks tools with withGovernance.

@fabric-harness/databricks/agent

ExportKindSummary
databricksAgentvaluePublic export.
DatabricksAgentOptionstypePublic export.
defineDatabricksAgentvaluePublic export.
DefineDatabricksAgentOptionstypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/databricks/sql-sandbox

ExportKindSummary
databricksSqlSandboxvaluePublic export.
DatabricksSqlSandboxOptionstypeSandbox backend that maps exec(command) to a Databricks SQL Statement Execution API call against a SQL Warehouse. Useful for data agents whose "shell" is a query interface. Behavior: - exec(sql) runs the SQL synchronously (with a timeout) and returns the serialized result set as stdout (newline-delimited JSON rows by default, or CSV when resultFormat: 'csv'). - File operations are intentionally minimal: the sandbox-virtual filesystem keeps a small in-memory map. SQL warehouses are not file servers; mount actual data via databricksVolumeSource from @fabric-harness/connectors. Usa...

@fabric-harness/node

@fabric-harness/node

ExportKindSummary
AgentDescriptiontypePublic export.
AgentModuletypePublic export.
AgentNotFoundErrorvaluePublic export.
AgentSummarytypePublic export.
applyEnvModelProvidervaluePublic export.
ApprovalSummarytypePublic export.
asJsonObjectvaluePublic export.
assertDataResidencyvaluePublic export.
BackupObjectStoretypePublic export.
backupPostgresPersistencevalueCreate a transactionally consistent logical backup and write it to object storage.
BuildBundleStrategytypePublic export.
BuildManifesttypePublic export.
BuildManifestAgenttypePublic export.
BuildManifestFiletypePublic export.
BuildManifestRoletypePublic export.
BuildManifestSkilltypePublic export.
BuildSummarytypePublic export.
BuildTargettypePublic export.
buildWorkspacevaluePublic export.
BuildWorkspaceOptionstypePublic export.
BuildWorkspaceResulttypePublic export.
cancelSessionTaskvaluePublic export.
cancelTaskInStorevaluePublic export.
CheckpointSummarytypePublic export.
compactPersistedSessionvaluePublic export.
CompactPersistedSessionOptionstypePublic export.
compactSessionInStorevaluePublic export.
createConfiguredSessionStorevaluePublic export.
CreateConfiguredSessionStoreOptionstypePublic export.
createFabricRunContextvaluePublic export.
CreateFabricRunContextOptionstypePublic export.
createMcpHttpServervalueExpose governed Harness tools through stateless MCP Streamable HTTP.
createPersistentDispatchProcessorvalueBuild a DispatchProcessor that applies dispatched inputs to a persistent instance session. Idempotent by dispatchId: a marker entry is appended to the instance session after a dispatch is applied, and re-delivery of the same dispatchId is skipped. The marker lives in the shared session store, so dedup holds across separate processings (and survives restart when the store is durable).
createPersistentSubmissionExecutorvalueThe SubmissionExecutor that applies durable submissions to persistent instance sessions. execute runs a real session turn (session.prompt is idempotent by submission id, so a recovered attempt resumes instead of double-applying its input); everything else operates store-level so reconciliation never needs a live agent.
createPrivateNetworkFetchvalueCreate an outbound Node client with one policy and transport trust path. Credentials and PEM material remain in the dispatcher and are never placed in request URLs, Fabric events, or model messages.
currentMcpRequestContextvaluePublic export.
databricksAppsOidcAuthenticatorvalueDatabricks workspace OIDC preset for Apps ingress and workspace-scoped RBAC claims.
DatabricksAppsOidcAuthenticatorOptionstypePublic export.
daytonavalueOne-call wiring for a Daytona-native agent: resolves the model provider from config or env, includes Daytona-specific workspace tools, and sets a safe default egress policy.
daytonaAgentvaluePublic export.
DaytonaAgentOptionstypePublic export.
DaytonaBundletypePublic export.
DaytonaBundleConfigtypePublic export.
defineApplicationvalueIdentity helper that preserves route/middleware inference in workspace config.
defineDaytonaAgentvaluePublic export.
DefineDaytonaAgentOptionstypePublic export.
defineDockerAgentvaluePublic export.
DefineDockerAgentOptionstypePublic export.
defineE2bAgentvaluePublic export.
DefineE2bAgentOptionstypePublic export.
defineK8sAgentvaluePublic export.
DefineK8sAgentOptionstypePublic export.
defineModalAgentvaluePublic export.
DefineModalAgentOptionstypePublic export.
defineNodeAgentvaluePublic export.
DefineNodeAgentOptionstypePublic export.
DeletionEvidenceSignertypePublic export.
DeletionEvidenceStoretypePublic export.
describeAgentFilevaluePublic export.
DevServerHandletypePublic export.
DevServerOptionstypePublic export.
discoverWorkspacevaluePublic export.
dockervalueOne-call wiring for a Docker-native agent: resolves the model provider from config or env, includes Docker-specific container tools, and sets a safe default egress policy.
dockerAgentvaluePublic export.
DockerAgentOptionstypePublic export.
DockerBundletypePublic export.
DockerBundleConfigtypePublic export.
e2bvalueOne-call wiring for an E2B-native agent: resolves the model provider from config or env, includes built-in tools, and sets a safe default egress policy.
e2bAgentvaluePublic export.
E2bAgentOptionstypePublic export.
E2bBundletypePublic export.
E2bBundleConfigtypePublic export.
ed25519DeletionEvidenceSignervaluePublic export.
enforcePersistenceRetentionvalueEnforce durable data retention. Use a deletion-evidence-wrapped bundle for signed session receipts.
ensurePostgresAttachmentTablesvalueCreate the attachments table when absent. Idempotent.
ensurePostgresConversationStreamTablesvalueCreate the conversation stream tables when absent. Idempotent.
ensurePostgresSubmissionTablesvalueCreate the submission tables and indexes when absent. Idempotent.
ensureSqliteAttachmentTablesvalueCreate the attachments table when absent. Idempotent.
ensureSqliteConversationStreamTablesvalueCreate the conversation stream tables when absent. Idempotent.
ensureSqliteSubmissionTablesvalueCreate the submission tables and indexes when absent. Idempotent.
entraIdAuthenticatorvalueMicrosoft Entra ID v2 preset with tenant, roles, groups, and app/user identity mapping.
EntraIdAuthenticatorOptionstypePublic export.
ExternalRetentionTargettypePublic export.
FabricApplicationtypePublic export.
FabricApplicationMiddlewaretypePublic export.
FabricApplicationNexttypePublic export.
FabricApplicationPublicMiddlewaretypePublic export.
FabricApplicationPublicRequestContexttypePublic export.
FabricApplicationRequestContexttypePublic export.
FabricApplicationRoutetypePublic export.
FabricApplicationStorestypePublic export.
FabricBuildContexttypePublic export.
FabricBuildErrorvaluePublic export.
FabricBuildErrorCodetypePublic export.
FabricBuildPlugintypePublic export.
FabricHarnessConfigtypePublic export.
FabricHarnessDatabricksConfigtypePublic export.
FabricHarnessDatabricksServingConfigtypePublic export.
FabricHarnessEnvironmentConfigtypePublic export.
FabricHarnessPersistenceConfigtypePublic export.
FabricHarnessSandboxConfigtypePublic export.
FabricHarnessStoreConfigtypePublic export.
FabricHarnessTemporalConfigtypePublic export.
FabricMcpHttpServertypePublic export.
FabricMcpRequestContexttypePublic export.
FabricPersistencetypePublic export.
FabricPersistenceErrorvaluePublic export.
FabricPersistenceErrorCodetypePublic export.
FabricPersistenceHealthtypePublic export.
fabricPostgresMigrationsvaluePublic export.
FabricRetentionPolicytypePublic export.
FileAttachmentStorevaluePublic export.
FileAttachmentStoreOptionstypePublic export.
FileConversationStreamStorevaluePublic export.
FileConversationStreamStoreOptionstypePublic export.
FileSessionStorevaluePublic export.
FileSessionStoreOptionstypePublic export.
findWorkspaceRootvaluePublic export.
forkSessionAtStepvalueForks a session at the given step into a new session in the same store. The new session contains the active-path entries up to and including stepId, and its leafId is set to stepId. Used by fh replay --rerun. If a user_prompt entry exists immediately after the cut on the original active path, its text is returned as resumePromptText so the caller can resubmit it against the forked session.
ForkSessionAtStepResulttypePublic export.
getMetricsFromStorevaluePublic export.
getRequiredAgentDefinitionvaluePublic export.
getSessionApprovalStatevaluePublic export.
getSessionArtifactvaluePublic export.
getSessionMetricsvaluePublic export.
getSessionTaskvaluePublic export.
getSessionTimelinevaluePublic export.
getTaskFromStorevaluePublic export.
hmacDeletionEvidenceSignervaluePublic export.
httpBackupObjectStorevalueHTTP PUT/GET object store for presigned S3/R2, Azure Blob SAS, or an internal object gateway.
HttpRateLimitClasstypePublic export.
HttpRateLimitConfigtypePublic export.
HttpRateLimitContexttypePublic export.
HttpRateLimitDecisiontypePublic export.
HttpRateLimitertypePublic export.
HttpRateLimitRuletypePublic export.
inspectReplayvaluePublic export.
inspectReplayFromStorevaluePublic export.
inspectSessionvaluePublic export.
inspectSessionFromStorevaluePublic export.
isDefinedAgentvaluePublic export.
isPersistentAgentvaluePublic export.
JobSchedulertypePublic export.
JobSchedulerOptionstypePublic export.
k8svalueOne-call wiring for a Kubernetes-native agent: resolves the model provider from config or env, includes K8s-specific kubectl tools, and sets a safe default egress policy.
k8sAgentvaluePublic export.
K8sAgentOptionstypePublic export.
K8sBundletypePublic export.
K8sBundleConfigtypePublic export.
libsqlPersistencevalueFull local libSQL or remote Turso bundle using optimistic version fencing.
LibSqlPersistenceClienttypePublic export.
LibSqlPersistenceOptionstypePublic export.
LibSqlResultSettypePublic export.
listAgentFilesvaluePublic export.
listAgentSummariesvaluePublic export.
listApprovalsFromStorevaluePublic export.
listApprovalStatesFromStorevaluePublic export.
listBuildsvaluePublic export.
listCheckpointsFromStorevaluePublic export.
listSessionApprovalsvaluePublic export.
listSessionApprovalStatesvaluePublic export.
listSessionArtifactsvaluePublic export.
listSessionCheckpointsvaluePublic export.
listSessionsvaluePublic export.
listSessionSummariesFromStorevaluePublic export.
listSessionTasksvaluePublic export.
listTasksFromStorevaluePublic export.
loadAgentModulevaluePublic export.
LoadAgentModuleOptionstypePublic export.
loadFabricHarnessConfigvaluePublic export.
LoadFabricHarnessConfigOptionstypePublic export.
loadRolesvaluePublic export.
loadSkillsvaluePublic export.
mapOidcPrincipalvaluePublic export.
memoryDeletionEvidenceStorevaluePublic export.
memoryPersistencevalueInfrastructure-free unified bundle for tests and lightweight applications.
memorySchedulerLeaseStorevaluePublic export.
migratePostgresPersistencevaluePublic export.
MockDaytonaModelProvidervalueA deterministic ModelProvider for Daytona agent tests and init templates. Returns structured responses without requiring real API credentials.
MockDaytonaModelProviderOptionstypePublic export.
MockDockerModelProvidervalueA deterministic ModelProvider for Docker agent tests and init templates. Returns structured responses without requiring real API credentials.
MockDockerModelProviderOptionstypePublic export.
MockE2bModelProvidervalueA deterministic ModelProvider for E2B agent tests and init templates. Returns structured responses without requiring real API credentials.
MockE2bModelProviderOptionstypePublic export.
MockK8sModelProvidervalueA deterministic ModelProvider for Kubernetes agent tests and init templates. Returns structured responses without requiring real API credentials.
MockK8sModelProviderOptionstypePublic export.
MockModalModelProvidervalueA deterministic ModelProvider for Modal agent tests and init templates. Returns structured responses without requiring real API credentials.
MockModalModelProviderOptionstypePublic export.
MockNodeModelProvidervalueA deterministic ModelProvider for Node agent tests and init templates. Returns structured responses without requiring real API credentials.
MockNodeModelProviderOptionstypePublic export.
modalvalueOne-call wiring for a Modal-native agent: resolves the model provider from config or env, includes built-in tools, and sets a safe default egress policy.
modalAgentvaluePublic export.
ModalAgentOptionstypePublic export.
ModalBundletypePublic export.
ModalBundleConfigtypePublic export.
mongodbPersistencevalueFull bundle over a MongoDB collection using _id + version compare-and-swap.
MongoPersistenceClienttypePublic export.
MongoPersistenceCollectiontypePublic export.
MongoPersistenceOptionstypePublic export.
mysqlPersistencevalueFull bundle over a MySQL 8 compatible database using version-fenced snapshot rows.
MySqlPersistenceClienttypePublic export.
MySqlPersistenceOptionstypePublic export.
nextScheduledAtvaluePublic export.
nodevalueOne-call wiring for a Node-native agent: resolves the model provider from config or env, includes built-in file/shell tools, and sets a safe default egress policy.
nodeAgentvaluePublic export.
NodeAgentOptionstypePublic export.
NodeBundletypePublic export.
NodeBundleConfigtypePublic export.
OidcClaimMappingtypePublic export.
oidcJwtAuthenticatorvalueValidate Bearer JWTs with a local or remote JWKS and map claims into server RBAC.
OidcJwtAuthenticatorOptionstypePublic export.
OidcPrincipalContexttypePublic export.
parseCookievalueParse the Cookie header on an IncomingMessage and return a named cookie's value, or undefined when missing. Use inside a custom extractAuthToken to validate session cookies set by your existing identity layer.
parseFrontmattervaluePublic export.
pathExistsvaluePublic export.
PersistedCompactionResulttypePublic export.
PersistentDispatchProcessorOptionstypePublic export.
PersistentPromptOptionstypePublic export.
PersistentPromptResulttypePublic export.
PersistentSessionBusyErrorvaluePublic export.
PersistentSubmissionExecutorOptionstypePublic export.
PostgresAttachmentStorevaluePublic export.
PostgresAttachmentStoreOptionstypePublic export.
PostgresBackupRecordtypePublic export.
PostgresClientLiketypePublic export.
PostgresConversationStreamStorevaluePublic export.
PostgresConversationStreamStoreOptionstypePublic export.
postgresCostBudgetStorevaluePostgres-backed cost budget store. Pair with init({ costLimit: { perScope, scopeKey, store } }) to enforce a budget that survives process restarts — per-tenant, per-day, per-organization caps, etc. The table holds one row per scope key: (scope TEXT PRIMARY KEY, total_usd NUMERIC, updated_at TIMESTAMPTZ). Increments use ON CONFLICT UPDATE for atomic compare-and-set semantics.
PostgresCostBudgetStoreOptionstypePublic export.
postgresDeletionEvidenceStorevaluePublic export.
PostgresMigrationtypePublic export.
PostgresMigrationResulttypePublic export.
postgresPersistencevalueOne Postgres/Lakebase bundle for every durable Node server store.
PostgresPersistenceOptionstypePublic export.
PostgresRestoreResulttypePublic export.
postgresSandboxOwnershipLeaseStorevalueAtomic, expiry-aware ownership leases for portable sandboxes.
postgresSchedulerLeaseStorevaluePostgres-backed scheduler leases for horizontally scaled Node deployments.
postgresSessionMemoryvaluePostgres-backed SessionMemory. Persistent across process restarts; scoped by tenantId. Pair with init({ memory }) to share recall across a fleet of agents. Schema: CREATE TABLE fabric_harness_session_memory ( tenant_id TEXT NOT NULL DEFAULT '', key TEXT NOT NULL, value JSONB NOT NULL, metadata JSONB, expires_at TIMESTAMPTZ, updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), PRIMARY KEY (tenant_id, key) ); Set/Get scrub expired rows lazily on access. Run a scheduled DELETE WHERE expires_at < NOW() if you have many TTL'd entries.
PostgresSessionMemoryOptionstypePublic export.
PostgresSessionStorevaluePublic export.
PostgresSessionStoreOptionstypePublic export.
PostgresSubmissionStorevaluePublic export.
PostgresSubmissionStoreOptionstypePublic export.
principalHasPermissionvaluePublic export.
principalToActorvaluePublic export.
principalToApprovalActorvaluePublic export.
PrivateNetworkFetchClienttypePublic export.
PrivateNetworkFetchOptionstypePublic export.
PrivateNetworkProxyOptionstypePublic export.
PrivateNetworkTlsOptionstypePublic export.
readBuildManifestvaluePublic export.
redisApprovalNotificationStorevalueDistributed dedupe state for approvalNotificationHandler().
RedisApprovalNotificationStoreOptionstypePublic export.
RedisClientLiketypeCross-process token-bucket rate limiter backed by Redis. Pair with OpenAICompatibleModelProvider / AnthropicModelProvider to enforce a shared API-key quota across a fleet of containers. RedisClientLike only requires an eval method — both ioredis and @upstash/redis ship a compatible signature. fabric-harness does NOT depend on either; users pass their own client.
redisHttpRateLimitervalueCreates an atomic, cross-process HTTP limiter for startDevServer. The caller supplies its Redis client so the Node package has no Redis SDK dependency.
RedisHttpRateLimiterOptionstypePublic export.
redisPersistencevalueRedis/Valkey bundle with cluster-safe keys, binary attachments, and optional retention TTL.
RedisPersistenceClienttypePublic export.
RedisPersistenceOptionstypePublic export.
redisRateLimitervaluePublic export.
RedisRateLimiterOptionstypePublic export.
renderOperatorConsolevaluePublic export.
ReplayInspectiontypePublic export.
resolveAgentPathvaluePublic export.
resolveApprovalInStorevaluePublic export.
resolveConfigPathvaluePublic export.
resolveDaytonaToolRefsvaluePublic export.
resolveDockerToolRefsvaluePublic export.
resolveE2bToolRefsvaluePublic export.
resolveK8sToolRefsvaluePublic export.
resolveModalToolRefsvaluePublic export.
resolvePrincipalTenantvaluePublic export.
resolveServerPermissionvaluePublic export.
resolveSessionApprovalvaluePublic export.
resolveSseKeepaliveMsvalueResolve the SSE keepalive interval from the environment. Returns the parsed FABRIC_HARNESS_SSE_KEEPALIVE_MS value, or the 15000ms default. Negative or unparseable values fall back to the default. Returns 0 when explicitly set to 0, disabling keepalive.
resolveToolRefsvaluePublic export.
restorePostgresPersistencevalueVerify and restore a logical backup under an exclusive advisory lock and transaction.
RetentionResulttypePublic export.
RetentionRuletypePublic export.
runAgentvaluePublic export.
RunAgentOptionstypePublic export.
RunAgentResulttypePublic export.
runPersistentPromptvaluePublic export.
runPostgresRecoveryDrillvaluePublic export.
SandboxOwnershipPostgresClienttypePublic export.
SchedulerLeaseStoretypePublic export.
SchedulerPostgresClienttypePublic export.
ServerAuthorizationContexttypePublic export.
ServerPermissiontypePublic export.
ServerPrincipaltypePublic export.
SessionMetricstypePublic export.
sessionRunStorevaluePublic export.
SessionSummarytypePublic export.
SessionTimelinetypePublic export.
SqliteAttachmentStorevaluePublic export.
SqliteAttachmentStoreOptionstypePublic export.
SqliteConversationStreamStorevaluePublic export.
SqliteConversationStreamStoreOptionstypePublic export.
SqliteCostBudgetStorevalueAtomic cross-process cost totals for a single-node SQLite deployment.
SqliteCostBudgetStoreOptionstypePublic export.
SqliteDatabaseLiketypeThe slice of node:sqlite's DatabaseSync this store uses.
sqlitePersistencevalueUnified durable bundle for local and single-node deployments.
SqlitePersistenceOptionstypePublic export.
SQLiteSessionStorevaluePublic export.
SQLiteSessionStoreOptionstypePublic export.
SqliteSubmissionStorevaluePublic export.
SqliteSubmissionStoreOptionstypePublic export.
SSE_KEEPALIVE_DEFAULT_MSvaluePublic export.
startDevServervaluePublic export.
startJobSchedulervalueStart an in-process cron scheduler for finite job triggers.schedule values.
TaskStatustypePublic export.
TaskSummarytypePublic export.
TimelineItemtypePublic export.
transpileAgentvaluePublic export.
TranspileAgentOptionstypePublic export.
vaultSecretProvidervalueHashiCorp Vault KV v2 provider. Vault tokens remain in the adapter closure.
VaultSecretProviderOptionstypePublic export.
verifyAttestationvaluePublic export.
verifyProvenancevaluePublic export.
withDeletionEvidencevalueAdd signed, append-only deletion evidence to any persistence bundle.
withPostgresConnectionvaluePublic export.
WorkspaceInfotypePublic export.

@fabric-harness/node/agent

ExportKindSummary
defineNodeAgentvaluePublic export.
DefineNodeAgentOptionstypePublic export.
nodevalueOne-call wiring for a Node-native agent: resolves the model provider from config or env, includes built-in file/shell tools, and sets a safe default egress policy.
nodeAgentvaluePublic export.
NodeAgentOptionstypePublic export.
NodeBundletypePublic export.
NodeBundleConfigtypePublic export.
resolveToolRefsvaluePublic export.

@fabric-harness/node/docker-agent

ExportKindSummary
defineDockerAgentvaluePublic export.
DefineDockerAgentOptionstypePublic export.
dockervalueOne-call wiring for a Docker-native agent: resolves the model provider from config or env, includes Docker-specific container tools, and sets a safe default egress policy.
dockerAgentvaluePublic export.
DockerAgentOptionstypePublic export.
DockerBundletypePublic export.
DockerBundleConfigtypePublic export.
resolveDockerToolRefsvaluePublic export.

@fabric-harness/node/k8s-agent

ExportKindSummary
defineK8sAgentvaluePublic export.
DefineK8sAgentOptionstypePublic export.
k8svalueOne-call wiring for a Kubernetes-native agent: resolves the model provider from config or env, includes K8s-specific kubectl tools, and sets a safe default egress policy.
k8sAgentvaluePublic export.
K8sAgentOptionstypePublic export.
K8sBundletypePublic export.
K8sBundleConfigtypePublic export.
resolveK8sToolRefsvaluePublic export.

@fabric-harness/sdk

@fabric-harness/sdk

ExportKindSummary
actionAsToolvalueExpose an action to the model as a tool on an agent profile. The tool's JSON schema comes from the action's input schema; execution validates input/output exactly like runAction.
ActionContexttypeContext passed to an action's run. Unlike a tool's execute (a leaf capability invoked by the model), an action receives the harness itself and can orchestrate: prompt models, spawn sessions, call other actions.
ActionDefinitiontypeA named, schema-validated unit of harness work created with defineAction. First-class in v2: registrable on agent profiles as a tool, callable from jobs and agents, evaluable via fh test, and deployable as a platform job task.
ActionErrorvaluePublic export.
ActionHosttypeWhat an action runs against: the harness entry point (init can prompt models, spawn sessions, and call tools) plus the platform environment. Jobs, agents, and servers all satisfy this — it is the harness slice of FabricContext.
ActionOptionstypePublic export.
ActivateSkillInputtypePublic export.
ActorIdentitytypePublic export.
ActualCostSourcetypeExternal source for actual (non-estimated) spend. Implementations can query provider billing APIs, Databricks usage tables, or other real-time cost data.
admitSubmissionWithBackendvalueShared submission admission algorithm for row-oriented backends: dispatch-receipt check → insert-or-ignore → read-back → payload compare (idempotent replay vs. conflict). The message payload is stored as JSON verbatim; payload identity is deep JSON equality, so a backend that normalizes stored JSON (e.g. Postgres JSONB key ordering) still recognizes an exact replay. The caller owns transaction scoping — invoke this inside one transaction and pass callbacks bound to it. When every callback is synchronous the result is returned synchronously, so the algorithm also fits synchronous backends.
agentvalueDefaults-injecting agent builder. Exported as agent from the bare @fabric-harness/sdk entry point. Wraps init() so the headless defaults are applied unless the caller overrides them: - runtime: 'stateless' - sandbox: 'virtual' - loopRuntime: pi-agent-core - compaction: { enabled: true } If runtime: 'temporal' is selected from this builder, a one-time console.warn is emitted because auto-compaction is non-deterministic across Temporal replay. Use @fabric-harness/sdk/strict for Temporal.
AgentAttemptMarkertypeHarness-owned durable evidence that a submission attempt was started and has not yet settled. A coordinator inserts a marker immediately before starting an attempt and deletes it when the attempt settles; reconciliation treats a fresh marker as proof that the attempt may still be running and must not be reconciled as interrupted.
AgentDefinitiontypePublic export.
AgentDispatchAdmissiontypePublic export.
AgentDispatchReceipttypePublic export.
AgentDispatchRequesttypeAsync delivery request to a persistent agent instance + session.
AgentEventtypePublic export.
AgentEventBasetypeCommon envelope shared by every event variant.
AgentEventCallbacktypeCallback signature accepted by init({ onEvent }), agent.session(id, { onEvent }), and session.prompt(text, { onEvent }).
AgentEventTypetypePublic export.
AgentInittypePublic export.
AgentLoopRuntimetypePublic export.
AgentProfiletypePublic export.
AgentProfileOptionstypePublic export.
AgentSubmissiontypePublic export.
AgentSubmissionDurabilitytypePublic export.
AgentSubmissionInputtypeOne admitted agent submission — the persisted operational payload for both transports. kind records how the submission arrived ('dispatch' via dispatch(), 'direct' via the agent HTTP route); a dispatch's submissionId is the public dispatchId from its receipt.
AgentSubmissionStatustypePublic export.
AgentSubmissionStoretypeDurable submission lifecycle storage. Stability: the lease method group mirrors the durable-execution engine and is subject to change until 1.0. This applies to every backend equally.
AgentTriggerstypePublic export.
aiGatewayvalueGeneric OpenAI-compatible AI gateway helper. Use for any gateway that speaks the OpenAI Chat Completions request/response shape: Helicone, Portkey, LiteLLM (self-hosted), Cloudflare AI Gateway, internal corp proxies, etc. See the package declarations for an example. For Vercel AI Gateway, prefer the vercelAIGateway preset — same factory under the hood with the gateway URL pre-baked.
AIGatewayOptionstypePublic export.
AnthropicModelProvidervaluePublic export.
AnthropicProviderOptionstypePublic export.
applyEstimatedCostvalueIdempotently populate usage.costUsd from the static price table. Mutates usage and returns it. No-op when: - usage is undefined, - usage.costUsd is already set (provider supplied it directly), - no price row matches modelRef.
ApprovalCallbacktypePublic export.
ApprovalDecisiontypePublic export.
ApprovalNotificationtypePublic export.
ApprovalNotificationDeadLettertypePublic export.
ApprovalNotificationDeliveryStoretypePublic export.
approvalNotificationFromEventvaluePublic export.
approvalNotificationHandlervalueConvert approval events into retryable, deduplicated notifications. This callback never throws.
ApprovalNotificationHandlerOptionstypePublic export.
ApprovalNotificationStatetypePublic export.
ApprovalNotifiertypePublic export.
ApprovalOptionstypePublic export.
ApprovalPolicyRuletypePer-pattern approval metadata. Lets policy authors route specific tools/commands to a named audience (e.g. 'reviewer', 'compliance-team', 'project-admin'). The audience id is opaque to fabric-harness — host applications map ids to humans via their own identity layer.
ApprovalRequesttypePublic export.
ApprovalResponsetypePublic export.
ApprovalRisktypePublic export.
ApprovalStatetypePublic export.
approvalStatesFromEntriesvaluePublic export.
ApprovalStateStatustypePublic export.
ApprovalUnavailableStrategytypePublic export.
ApprovalVotetypePublic export.
ArtifactCreateOptionstypePublic export.
ArtifactReftypePublic export.
assertEnforceableNetworkPolicyvalueRefuse production network policy when it can be bypassed by code in the sandbox. This validates an operator assertion; the named network boundary must still be provisioned by Docker, Kubernetes, or the cloud provider.
attachmentDigestvalueLowercase hex SHA-256 of the bytes (WebCrypto).
AttachmentLimitErrorvaluePublic export.
AttachmentPutInputtypePublic export.
AttachmentReftypeContent-addressed descriptor of one stored attachment.
AttachmentStoretypeDurable content-addressed attachment storage. - put is idempotent by (scope, digest) — re-putting the same content succeeds without duplicating storage (the first stored ref metadata is retained). It MUST verify the digest against the bytes and reject a mismatch with AttachmentStoreError('DIGEST_MISMATCH') before writing. - get/getByAttachmentId return null on a miss. - delete removes one stored attachment and throws AttachmentStoreError('NOT_FOUND') when nothing is stored under (scope, digest).
AttachmentStoreErrorvaluePublic export.
attachSandboxvalueBuild a SandboxFactory that, when invoked, returns an AttachedSandboxEnv delegating to the registered sandbox without owning its lifecycle. Calling cleanup() on the attached env unregisters this attachment but does NOT tear down the underlying sandbox. Pass an in-process SandboxRef to attach within the same process, or a SerializedSandboxRef (from session.sandboxRef({ portable: true })) to rehydrate a sandbox handed off from another process. Cross-process refs require a decoder registered for serialized.provider via registerSandboxRefDecoder().
AttachSandboxOptionstypePublic export.
AttributionQuerytypeQuery filters for retrieving aggregated cost attribution rows.
AutonomyModetypePublic export.
AutonomyOptionstypePublic export.
AzureOpenAIModelProvidervaluePublic export.
AzureOpenAIProviderOptionstypePublic export.
BashInputtypePublic export.
bashToolvaluePublic export.
BedrockModelProvidervaluePublic export.
BedrockProviderOptionstypePublic export.
buildModelMessagesFromHistoryvaluePublic export.
buildResultFollowUpPromptvalueFollow-up prompt sent when the LLM ends a turn without calling finish or give_up.
buildResultFootervalueFooter appended to user prompts/skill bodies when a result schema is set.
buildResultRetryPromptvaluePublic export.
BuiltinFileTooltypePublic export.
BuiltinTooltypePublic export.
bytesToHexvaluePublic export.
CapabilityPolicytypePublic export.
CartesiaSttProvidervaluePublic export.
CartesiaSttProviderOptionstypePublic export.
CartesiaTtsProvidervaluePublic export.
CartesiaTtsProviderOptionstypePublic export.
chainSecretProvidersvalueResolve from providers in order; errors fail closed instead of falling through.
ChanneltypePublic export.
ChannelContexttypePublic export.
ChannelDispatchtypePublic export.
ChannelDispatchRequesttypePublic export.
ChannelRoutetypeChannels turn platform webhooks (Slack, GitHub, …) into agent dispatches. Handlers are written against the Web Request/Response API and crypto.subtle, so the same channel runs on Node and Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer — session continuity falls out of the key (same thread → same key → same session).
CheckpointCreateOptionstypePublic export.
CheckpointRestoreOptionstypePublic export.
CheckpointResulttypePublic export.
claimSandboxOwnershipvalueClaim exclusive ownership of an already-connected portable sandbox.
clampCommandTimeoutvaluePublic export.
clampReadLimitvaluePublic export.
classifySubmissionStatevalueClassify how far a persisted submission input progressed. - absent — the input entry never landed in session history: the attempt crashed before applying it. Safe to requeue for a clean first attempt. - completed — finished work: a canonical settlement entry exists, an assistant response follows the input with no unresolved trailing tool batch, or a later user input shows the conversation moved on. Settle as success; never retry (retrying completed work is the one unrecoverable corruption). - continuable — the trailing turn carries unresolved tool calls. The next session.prompt() re...
CohereModelProvidervaluePublic export.
CohereProviderOptionstypePublic export.
combineSubmissionTelemetrySinksvalueFan one event out to several sinks.
CommandtypePublic export.
CommandEnvValuetypePublic export.
CommandPolicytypePublic export.
CommandToolInputtypePublic export.
CommandToolOptionstypePublic export.
CompactionOptionstypePublic export.
CompactionResulttypePublic export.
configureDispatchRuntimevalueConfigure the ambient dispatch queue used by dispatch.
configureJobInvocationRuntimevaluePublic export.
connectFabricVoicevaluePublic export.
connectFabricWsvaluePublic export.
connectMcpServervaluePublic export.
consoleTelemetryExportervalueTelemetry exporter that writes spans through the SDK logger (default console-backed). Useful for local development and as a fallback when no OpenTelemetry collector is wired up. Use openTelemetryExporter or langfuseExporter for production.
ContextBudgettypePublic export.
ContextBudgetOptionstypePublic export.
CONVERSATION_STREAM_DEFAULT_READ_LIMITvaluePublic export.
CONVERSATION_STREAM_MAX_READ_LIMITvaluePublic export.
conversationKeyvaluePublic export.
ConversationProducerClaimtypePublic export.
ConversationProjectorvaluePublic export.
ConversationStreamAppendInputtypePublic export.
ConversationStreamBatchtypePublic export.
ConversationStreamIdentitytypePublic export.
ConversationStreamMetatypePublic export.
conversationStreamPathvalueStream path for a session's conversation projection.
ConversationStreamReadResulttypePublic export.
ConversationStreamRecordtypeAppend-only conversation stream — the durable, offset-addressable projection of a session's active path (v2 migration, phase A4). The SessionEntry DAG remains the single source of truth for model context; this stream exists so clients can read a conversation with offsets (catch-up + live tail), across processes, without count-based replay. The projection appends one record per active-path entry, and — because the DAG can branch (fork/replay/checkpoint-restore) while a stream cannot — an explicit truncated record whenever the active path rewinds, paired with a producer-epoch bump so stale...
ConversationStreamStoretypeDurable append-only conversation stream storage. Batch atomicity is a hard contract requirement: every record in an append must be persisted together under one offset, all-or-nothing. First-party adapters satisfy this by serializing the batch into a single row/document write; an adapter that splits records across non-atomic writes violates the contract. Producer fencing: acquireProducer bumps the producer epoch; appends carrying a stale epoch are rejected. The (path, producerId, epoch, sequence) uniqueness makes redelivered appends idempotent — a retried append with the same coo...
ConversationStreamStoreErrorvaluePublic export.
CostAttributiontypeAttribution dimensions for a single cost observation. All fields are optional so callers can tag as much or as little metadata as they have.
CostAttributionRowtypeA single row of aggregated cost attribution data.
CostBudgetStoretypeAsync store for cross-process spend aggregation. Pair with CostLimit.scopeKey + CostLimit.perScope to enforce a budget that survives process restarts — "tenant:acme spends ≤ $50 today" or "company-wide ≤ $100 this hour". Built-in implementations: - inMemoryCostBudgetStore() — process-local; default. - @fabric-harness/node exposes postgresCostBudgetStore({ pool }).
CostBudgetTrackervalueTracks cumulative session spend. Cheap to construct; one per session.
CostLimittypePublic export.
CostLimitContexttypePublic export.
CostLimitExceededErrorvaluePublic export.
createActivateSkillToolvaluePublic export.
createAgentvalueDefine a persistent, URL-addressable agent. Files in .fabricharness/agents/ default-export createAgent(...); the runtime resolves a fresh config per interaction and keeps sessions across direct prompts and dispatched inputs.
createAttachmentRefvalueBuild an AttachmentRef for the given bytes, computing the SHA-256 digest via WebCrypto (crypto.subtle) so the SDK stays runtime-agnostic.
createBuiltinToolsvaluePublic export.
createCommandToolsvaluePublic export.
createConsoleLoggervalueBuild a Console-backed logger with an explicit level. Useful for tests that want to capture or silence SDK output without touching globals.
CreatedAgenttypeA persistent, addressable agent created with createAgent. Distinct from a finite agent({ run }) job: it has no run — the initializer returns configuration, and the runtime maintains sessions across interactions.
createDirectAgentSubmissionInputvalueMint a direct-prompt submission input with a fresh submission id.
createDispatchAgentSubmissionInputvalueMap a DispatchInput onto the persisted submission input shape.
createFabricContextvaluePublic export.
createFabricFsvalueAdapt a sandbox into the public filesystem convenience surface.
createFileToolsvaluePublic export.
createMcpAuthorizationCodeAuthvalueAuthorization-code + PKCE provider; the MCP SDK refreshes stored tokens automatically.
createMcpClientCredentialsAuthvalueOAuth client-credentials provider with MCP SDK token refresh handling.
createMcpToolsvaluePublic export.
CreateMcpToolsOptionstypePublic export.
createObservabilityObservervalueCreate a fail-open event observer suitable for Braintrust, Sentry, Jetty, or a custom sink.
createObservabilityRecordvalueConvert a Fabric event into a vendor-neutral, low-cardinality record.
createOperationalMetricsCollectorvalueLow-cardinality operational metrics collector suitable for OTel/Prometheus bridging.
createRemoteSandboxEnvvalueWrap a provider-owned remote sandbox client in Fabric's SandboxEnv contract. Provider credentials and SDK objects remain outside model context/history; Fabric only sees the narrow file/shell/snapshot API exposed here.
createResultToolsvalueProduce the per-call finish and give_up tool pair for a given ResultValidator. - finish's parameters are a generic JSON Schema object because we can't derive a precise schema from ResultValidator. The validator's safeParse handles actual validation. - First successful finish (or give_up) call wins. Subsequent calls return an error tool result rather than throwing, to keep the conversation transcript natural.
createSandboxEnvvaluePublic export.
createScopedSandboxEnvvalueReturn a view of a sandbox with a narrower default cwd. Relative file paths and shell cwd values are resolved from this scoped cwd while the underlying sandbox still enforces its workspace boundary.
createSearchToolvalueExposes a Retriever to the model as a search tool. The tool is read-only; wrap it with a governance decorator to stamp lineage or route approvals.
createSessionSubmissionExecutorvalueProvider-neutral durable submission executor for hosts that can open a Fabric session themselves. Node, Durable Objects, and custom runtimes share the same recovery and conservative interrupted-tool settlement behavior.
createStdioMcpClientvaluePublic export.
createSubmissionRunnervaluePublic export.
createUnifiedInMemoryStorevalueFactory that returns a fresh UnifiedInMemoryStore. The returned object can be passed as store, streamChunkStore, and runStore simultaneously.
createVirtualSandboxEnvvaluePublic export.
CredentialMissingStrategytypePublic export.
currentJobInvocationvaluePublic export.
currentSubmissionContextvalueThe submission owning the current execution, or undefined outside one.
DeepgramSttProvidervaluePublic export.
DeepgramSttProviderOptionstypePublic export.
DEFAULT_HEADLESS_PREAMBLEvaluePublic export.
defaultAgentProfilevaluePublic export.
defaultLoopRuntimevaluePublic export.
defaultModelProvidervaluePublic export.
defaultSessionStorevaluePublic export.
defineActionvalueDefine an action — the harness-context counterpart to defineTool. A tool is a leaf capability the model calls; an action holds the harness (context.init) and can prompt, spawn sessions, and compose other work. Input/output use the harness schema builders and are validated on every runAction call; outputs must be JSON-serializable.
defineAgentvalueCanonical v2 name for createAgent: persistent, URL-addressable agents are defined, and the runtime instantiates them per addressed id. createAgent remains supported as an alias.
defineAgentProfilevaluePublic export.
defineChannelvalueValidates and brands a channel's routes.
defineCommandvaluePublic export.
DefinedAgenttypePublic export.
defineJobvalueDefaults-injecting finite-job builder exported from the bare SDK entry point.
defineToolvaluePublic export.
defineWebhookSubscriptionvalueHelper that returns the definition unchanged. Useful for type inference and to keep agent files declarative. See the package declarations for an example.
DeletionCompletionRecordtypePublic export.
DeliveredAttachmenttypeOne attachment on a kind: 'user' message. Today the only supported attachment is an image, carried either inline (data, base64) or as a durable content-addressed reference (ref) once an attachment store is configured — admission materializes inline bytes into refs. An attachment must carry data or ref (or both, transiently during materialization).
DeliveredAttachmentReftypeDurable reference to attachment bytes in an attachment store.
DeliveredMessagetypeDeliveredMessage — the single unified input shape for everything that enters a persistent agent's session: direct HTTP prompts, dispatch, channels/webhooks, Databricks events, SDK clients, and tests. kind: 'user' is a direct user talking to the assistant (1:1 chat surface), optionally carrying attachments. kind: 'signal' models everything beyond that direct exchange — a Slack thread or a Lakeflow job event is activity the agent observes, not the assistant's own user speaking. Sender identity and structured metadata go in attributes; the message itself in body. Signals render into mo...
deliveredSignalToEntryDatavalueMap a signal-kind message onto the persisted signal entry's data shape.
deriveCompactionDefaultsvalueCompute model-aware compaction defaults. Reserve is capped at the model's max output because reserving more than the model can emit in one turn wastes context; the preserved tail stays flat because recent-context fidelity depends on the active work, not on the model's total window size.
dispatchvaluePublic export.
DispatchInputtypeInternal enqueued form, carrying correlation + isolation metadata.
DispatchProcessortypeConsumes enqueued dispatches and applies them to an instance session.
DispatchQueuetypeAdmission queue for dispatches. The default is in-process; durable backends implement the same shape.
DispatchReceipttypeAcceptance confirmation for an enqueued dispatch.
DockerSandboxEnvvaluePublic export.
DockerSandboxOptionstypePublic export.
DURABILITY_DEFAULT_MAX_ATTEMPTSvalueDefault maximum total attempts before terminalization.
DURABILITY_DEFAULT_TIMEOUT_MSvalueDefault submission timeout in milliseconds (one hour).
DurableSessionRuntimetypeStructural delegate for durable session execution. When init() is given a sessionRuntime factory that produces one of these, the SDK's session calls (prompt, task, shell, checkpoint.*) are routed through the runtime instead of executing inline. This is the seam for Temporal workflows, external orchestration runtimes, or test fakes. mount, history, artifact, and compact remain SDK-local concerns and are not delegated — they operate against the local session store.
DurableSessionRuntimeFactorytypePublic export.
editFileToolvaluePublic export.
EditInputtypePublic export.
ElevenLabsTtsProvidervaluePublic export.
ElevenLabsTtsProviderOptionstypePublic export.
EmbeddingProvidertypeEmbeddings seam. Feeds self-managed-embedding vector indexes (embed the query → query vector) and any bring-your-own retrieval pipeline. Returns one vector per input text, order-preserving.
emitOpenTelemetrySpanvaluePublic export.
emitSubmissionTelemetryvalueDeliver an event to a sink, swallowing (and reporting) sink failures.
EmptySandboxEnvvaluePublic export.
enqueueDispatchvalueValidate + normalize a named request and enqueue it, generating the dispatch id.
entryToTelemetrySpanvaluePublic export.
environmentSecretProvidervalueRuntime-only environment provider with optional prefix and explicit allowlist.
EnvironmentSecretProviderOptionstypePublic export.
estimateCostUsdvalueEstimate USD cost for a single model call. Returns 0 when no row matches modelRef — callers should treat 0 as "unknown" and not overwrite an existing costUsd from the provider.
estimateModelMessagesTokensvaluePublic export.
estimateSessionEntriesTokensvaluePublic export.
estimateTextTokensvaluePublic export.
evaluateCommandPolicyvaluePublic export.
evaluateContextBudgetvaluePublic export.
evaluateNetworkPolicyvalueEvaluate a URL or Request against the configured network policy. Returns { allowed: true } when the request is permitted, otherwise a denial with the reason and matched pattern.
evaluateOperationalSlosvaluePublic export.
evaluateToolCallPolicyvaluePublic export.
eventToTelemetrySpanvaluePublic export.
ExistsInputtypePublic export.
existsToolvaluePublic export.
extractResultValuevaluePublic export.
FABRIC_OPERATIONAL_METRICSvaluePublic export.
FabricActortypePublic export.
FabricAgenttypePublic export.
FabricContexttypePublic export.
FabricErrorvaluePublic export.
FabricErrorCodetypePublic export.
FabricErrorOptionstypePublic export.
FabricEventtypePublic export.
FabricEventCallbacktypePublic export.
FabricEventTypetypePublic export.
FabricFstypeOut-of-band filesystem surface for a session sandbox. These operations do not write to conversation history and are intended for host-side plumbing: staging files, collecting artifacts, and preparing scratch space. If the model should reason about a file, prompt it to use the normal read/write/edit tools instead.
FabricObservabilityRecordtypePublic export.
FabricPrincipaltypeThe governed identity a piece of work runs as (v2). Distinct from ActorIdentity (who asked): the principal is what the platform's access control enforces — a human user, a machine service principal, or a hosted app's own identity. ucPrincipal carries the catalog-governance principal name when the platform has one (e.g. Unity Catalog).
FabricRuntimetypeExecution runtime selection. - inline (default): single-process execution. Uses the configured SessionStore (in-memory by default) for history, artifacts, approvals. - stateless: explicit headless / ephemeral mode. No session store, no artifact persistence, no approval waiting. Each invocation is independent. Use for high-volume webhook agents and edge runtimes where state would just be discarded anyway. In production (FABRIC_ENV=production or NODE_ENV=production) this mode must be selected explicitly — inline without an explicit store will warn or fail depending on `FABRIC_ALLO...
FabricSessiontypePublic export.
FallbackModelProvidervaluePublic export.
FallbackModelProviderOptionstypePublic export.
FileStattypePublic export.
FilesystemEntrytypePublic export.
FilesystemPolicytypePublic export.
FilesystemSourcetypeA read-only content source that can be mounted into a sandbox at sandbox-creation time. The agent then has built-in read, glob, and grep tools available over the mounted content — no retrieval pipeline, no embeddings, no vector store required. Sources are intentionally minimal: they yield (path, content) pairs. Implementations decide how to enumerate (eager vs lazy is up to the source author) — the mount step pulls the full set into the sandbox.
findSubmissionInputIndexvalueIndex of the (last) user_prompt entry carrying the submission id, or -1.
findTrailingDanglingToolCallsvalueFind trailing tool_call entries on the active path that were never settled — no matching tool_result (paired by toolCallId, falling back to tool name) and no subsequent error entry for the same tool. A dangling call means a model turn died (crash/abort) between recording the call and recording its outcome. Left in place it produces an assistant tool_use with no tool_result on resume, which providers reject — the repair path appends synthetic interrupted outcomes for exactly the entries returned here. Conservative by construction: only the window after the last turn boundary (use...
findTrailingUnfinishedTasksvalueTrailing task_start entries in the same window with no matching task_end — a subtask that was in flight when the turn died. These do not corrupt model context (task entries are bookkeeping), but settling them keeps UI/audit state coherent.
formatSchemaIssuesvaluePublic export.
formatStreamOffsetvaluePublic export.
fumadocsSourcevalueMount a local Fumadocs content directory as a knowledge base. Strips MDX frontmatter by default for cleaner agent context. For a published Fumadocs site, fetch its llms.txt / sitemap and pass the URLs to httpFilesystemSource.
GeminiModelProvidervaluePublic export.
GeminiProviderOptionstypePublic export.
generateAffinityKeyvalueGenerate a deterministic aff_\u003cULID\u003e affinity key from an (agentId, sessionId) pair. The same pair always produces the same key, which is stable across restarts. Different pairs produce different keys with overwhelming probability.
generateWithRuntimevaluePublic export.
getAgentDefinitionvaluePublic export.
getCreatedAgentvalueReturn the CreatedAgent carried by a value, or undefined.
getLoggervalueGet the currently configured logger.
getVirtualSandboxvalueOne-liner helper for the most common pattern: mount a single read-only source into a virtual sandbox. Equivalent to: See the package declarations for an example. Used for support agents, runbook lookup, FAQ assistants — anywhere a small Markdown corpus needs to be searchable via the agent's built-in grep/glob/read tools. See the package declarations for an example.
GlobInputtypePublic export.
globToolvaluePublic export.
GrepInputtypePublic export.
GrepMatchtypePublic export.
grepToolvaluePublic export.
hasSubmissionSettledEntryvalueTrue when the path carries a canonical submission_settled entry for the id.
hexToBytesvaluePublic export.
hmacSha256valuePublic export.
httpFilesystemSourcevalueFetch a list of URLs and mount each response body as a file. Useful for pulling a small published docs set into the sandbox so the built-in read/grep/glob tools can search it like local files.
HttpResourcetypePublic export.
initvaluePublic export.
initializePersistentAgentvalueResolve a persistent agent's config for an instance and build a FabricAgent. Runtime-specific resources (session store, workspace roles/skills, loop runtime) are layered by the host that calls this.
inMemoryApprovalNotificationStorevalueProcess-local atomic delivery state for development and single-process hosts.
InMemoryAttachmentStorevalueIn-memory attachment store (dev / runtime: 'stateless' / tests).
InMemoryConversationStreamStorevalueIn-memory conversation stream store (dev / runtime: 'stateless' / tests).
inMemoryCostBudgetStorevalueProcess-local cost budget store. Default when store is not provided.
InMemoryDispatchQueuevalueIn-process dispatch queue: microtask-drained, concurrent across sessions, serialized within a single session. Suitable for the inline/stateless runtimes and dev. Durable delivery (surviving restarts) is provided by the Temporal-backed queue, which implements this same interface.
inMemorySessionMemoryvalueProcess-local in-memory implementation. Default when init({ memory }) is not configured — pair with Postgres for durability across restarts.
InMemorySessionStorevaluePublic export.
inMemorySourcevalueBuild a source from an in-memory map of path -> content. Useful for tests, fixtures, and small static knowledge bases bundled into the agent module itself.
InMemoryStreamChunkStorevaluePublic export.
InMemorySubmissionStorevaluePublic export.
InterruptedToolCallReftypeA tool call settled with an explicit interrupted-outcome marker at terminalization.
InvalidDeliveredMessageErrorvalueThrown by parseDeliveredMessage on malformed input.
invokevaluePublic export.
isActionDefinitionvaluePublic export.
isContextOverflowErrorvaluePublic export.
isCreatedAgentvalueWhether a value is a CreatedAgent.
isDeliveredMessageShapevalueTrue when a raw value already looks like a DeliveredMessage (has a valid kind).
isEventvalueType guard: narrow an AgentEvent to a specific variant. See the package declarations for an example.
isFabricErrorvaluePublic export.
isInMemoryStorevalueReturns true when store is the in-memory default (no appendEntry persistence beyond memory). Used by stateless mode to skip writes.
isStatelessRuntimevaluePublic export.
isSubmissionPayloadvalueValidate that a parsed JSON payload matches the expected submission shape. Used after deserializing a persisted payload to verify the object is a well-formed AgentSubmissionInput that is consistent with the stored submission metadata. Both dispatch and direct payloads carry the same message: DeliveredMessage field — validated identically here regardless of transport kind.
isValidAffinityKeyvaluePublic export.
jobvalueDefaults-injecting agent builder. Exported as agent from the bare @fabric-harness/sdk entry point. Wraps init() so the headless defaults are applied unless the caller overrides them: - runtime: 'stateless' - sandbox: 'virtual' - loopRuntime: pi-agent-core - compaction: { enabled: true } If runtime: 'temporal' is selected from this builder, a one-time console.warn is emitted because auto-compaction is non-deterministic across Temporal replay. Use @fabric-harness/sdk/strict for Temporal.
JobContexttypeRuntime-ready context for finite jobs. The default session is initialized lazily.
JobDefinitiontypePublic export.
JobInvocationContexttypePublic export.
JobInvocationOptionstypePublic export.
JobInvocationReceipttypePublic export.
JobInvocationRuntimetypePublic export.
JobMiddlewaretypePublic export.
JournalCallbackstypePublic export.
jsonDeepEqualvalueStructural equality over JSON values (objects compared key-order-insensitively).
JsonObjecttypePublic export.
JsonPrimitivetypePublic export.
JsonSchemaObjecttypePublic export.
JsonValuetypePublic export.
LangfuseClientLiketypeOptional Langfuse exporter. Adapts Fabric's TelemetrySpan shape to Langfuse's tracing API. The Langfuse client is provided by the caller — we don't take a hard dependency. Install peer dep: See the package declarations for an example. Usage: See the package declarations for an example.
langfuseExportervaluePublic export.
LangfuseExporterOptionstypePublic export.
LEASE_DURATION_MSvalueDefault lease duration for submission ownership in milliseconds (30 seconds).
listModelPricesvalueAll currently-registered rows (newest-last). Returns a copy.
listSandboxRefDecodersvalueReturns the list of currently registered providers.
localDirectorySourcevalueRead a host directory recursively as a read-only source. include is called for each candidate file path (relative to hostPath). Return false to skip. Defaults to including everything.
LocalSandboxEnvvaluePublic export.
LocalSandboxOptionstypePublic export.
LoggertypeMinimal logger seam used by the SDK for non-event diagnostic output (warnings, deprecation notices, telemetry fallbacks). All console.* inside the SDK should route through getLogger() so ops teams can redirect or silence messages in production. The default logger writes to console and respects FABRIC_HARNESS_LOG_LEVEL=debug|info|warn|error|silent (default warn).
LogLeveltypePublic export.
lookupModelPricevalueLook up the most recently-registered row matching modelRef. modelRef can be: - 'provider/model' (preferred, e.g. 'openai/gpt-4o') - 'model' alone (e.g. 'gpt-4o') — first row whose model matches wins Provider matching is case-insensitive. Model matching is exact.
materializeMessageAttachmentsvalueMaterialize a message's inline attachments into durable refs: decode the base64 data, store the bytes under scope, and return a NEW message whose attachments carry { type, mimeType, filename?, ref } and no data. Deterministic by construction — attachment ids are ${idPrefix}_${index} and digests derive from content — so an exact redelivery of the same message produces an identical materialized payload (admission idempotency). Messages without inline attachments are returned unchanged (same reference).
MAX_ATTACHMENT_DATA_LENGTHvalueMaximum accepted base64 length for a single inline attachment.
McpAuthorizationCodeOptionstypePublic export.
McpAuthorizationCodeStatetypePublic export.
McpClientCredentialsOptionstypePublic export.
McpClientLiketypePublic export.
McpServerConnectiontypePublic export.
McpServerOptionstypePublic export.
McpToolDescriptortypePublic export.
McpTransporttypePublic export.
memorySandboxOwnershipLeaseStorevalueProcess-local lease store for tests and single-replica durable workers.
messageHasDataAttachmentsvalueTrue when the message carries at least one inline (base64) attachment.
mintlifySourcevalueMount a checked-out Mintlify content directory. For a hosted Mintlify MCP server, use connectMcpServer('mintlify', { url, transport: 'streamable-http' }) instead.
MissingInputStrategytypePublic export.
MkdirInputtypePublic export.
mkdirToolvaluePublic export.
ModelAttemptEventtypePublic export.
ModelConfigtypePublic export.
ModelMessagetypePublic export.
ModelMessageRoletypePublic export.
ModelMetadatatypePublic export.
ModelPriceRowtypeStatic USD price table for model providers. Used to populate ModelUsage.costUsd on responses that don't include billing info from the provider directly (most providers — only pi-loop-runtime and a handful of gateways report cost). Prices are stamped with effectiveAt. The table is best-effort: real billing reconciliation should use vendor invoices. Override or extend at runtime with registerModelPrices for custom-rate contracts.
ModelPricingUsagetypePublic export.
ModelProvidertypePublic export.
ModelProviderFactorytypeResolves a parsed provider/model-id ref into a concrete provider. Registered factories let out-of-core packages (e.g.
ModelRequesttypePublic export.
ModelResponsetypePublic export.
ModelRuntimeOptionstypePublic export.
ModelStreamChunktypePublic export.
ModelToolCalltypePublic export.
ModelToolSchematypePublic export.
ModelUsagetypePublic export.
MountedSourcetypePublic export.
MountResulttypePublic export.
NamedAgentDispatchRequesttypeA dispatch request that names its target agent.
NamedJobInvocationtypePublic export.
NativeLoopRuntimevaluePublic export.
negotiateSandboxContinuityvalueReport the continuity operations that a backend or serialized ref can support.
NetworkEnforcementLayertypePublic export.
NetworkEnforcementRequirementtypePublic export.
NetworkPolicytypePublic export.
noopSessionStorevaluePublic export.
NoopSessionStorevalueNo-op session store for runtime: 'stateless' mode. All writes are discarded; reads always return the empty initial session. Use this when the agent is intended as a pure request/response handler with no persistence (typical for high-volume webhooks and edge runtimes). Approvals and artifact retrieval are not supported — wiring those up requires a real store. Callers in stateless mode should not rely on artifact persistence or approval gating.
normalizeDeliveredMessagevalueNormalize legacy inputs into a DeliveredMessage: - a string → a user message with that body - a value with a kind discriminator → validated as a DeliveredMessage - any other JSON value → a user message with the JSON-stringified body (matching the historical dispatch rendering, so behavior is unchanged for pre-DeliveredMessage callers)
ObservabilityCorrelationtypePublic export.
ObservabilityObserverOptionstypePublic export.
OpenAIChatCompletiontypePublic export.
openAIChatCompletionToModelResponsevaluePublic export.
OpenAICompatibleModelProvidervaluePublic export.
OpenAICompatibleProviderOptionstypePublic export.
OpenAIRealtimeVoiceProvidervalueOpenAI Realtime voice provider. Connects via WebSocket; emits audio_delta / text_delta / transcript / tool_call / response_done events. No transitive dependency on ws — uses the global WebSocket available on Node 22+ and browsers. See the package declarations for an example.
OpenAIRealtimeVoiceProviderOptionstypePublic export.
openTelemetryExportervalueBridge Fabric's SDK-neutral TelemetrySpan into a real
OpenTelemetryExporterOptionstypePublic export.
OperationalMetricsCollectortypePublic export.
OperationalMetricsSnapshottypePublic export.
OperationalSloEvaluationtypePublic export.
OperationalSloTargetstypePublic export.
parseConversationKeyvaluePublic export.
ParsedConversationKeytypePublic export.
parseDeliveredMessagevalueValidate a raw value as a DeliveredMessage. Shared by dispatch admission and the direct HTTP route so every transport produces the same structured error on bad input.
ParsedModelReftypePublic export.
ParsedScopeKeytypePublic export.
parseModelRefvaluePublic export.
parsePersistentSessionIdvalueInverse of persistentStoreSessionId: decode a store session id back into { agent, instanceId, session }, or undefined if it is not a persistent-instance key. Useful for admin surfaces that list raw session ids.
parseRetryAfterMsvalueParse a Retry-After header value (RFC 7231) into milliseconds. Accepts both delta-seconds and HTTP-date forms. Returns undefined when the value is missing or unparseable.
parseScopeKeyvalueParse a scope key into its structured components. Recognized patterns: tenant:<id>:day:YYYY-MM-DD tenant:<id>:hour:YYYY-MM-DDTHH:00Z tenant:<id>:month:YYYY-MM agent:<id>:day:YYYY-MM-DD agent:<id>:hour:YYYY-MM-DDTHH:00Z agent:<id>:month:YYYY-MM user:<id>:day:YYYY-MM-DD user:<id>:hour:YYYY-MM-DDTHH:00Z user:<id>:month:YYYY-MM Unknown prefixes fall back to kind: 'custom' with raw: scopeKey. Returns undefined for empty strings.
parseStreamOffsetvaluePublic export.
persistenceAdaptervalueCreate an in-memory PersistenceAdapter backed by a fresh InMemorySessionStore. This is the default when no persistence is configured. The returned adapter's connect() always returns the same store instance.
PersistenceAdaptertypeA persistence adapter abstracts over storage backends (SQLite, Postgres, file, etc.). The SDK only requires connect() → SessionStore. Optional methods connectRunStore and connectRunRegistry are used by workflow backends (Temporal, Cloudflare). The optional migrate() hook is called once at startup to ensure schema exists, and close() releases resources.
PersistenceBundletypeComplete persistence surface consumed by a Fabric host.
PersistenceDeleteResulttypePublic export.
PersistenceHealthtypePublic export.
PersistentAgentConfigtypeRuntime configuration returned by a createAgent initializer. Mirrors the agent-level slice of AgentInit; instructions becomes the session system prompt (a role), and subagents map to named roles.
PersistentAgentContexttypePer-interaction context passed to a createAgent initializer. id is the URL &lt;id&gt; of the addressed instance (or the dispatch target id); env is the platform environment supplied by the runtime.
persistentConfigToAgentInitvalueTranslate a PersistentAgentConfig into an AgentInit.
PersistentSessionIdentitytypeDecoded identity of a persistent instance session store key.
persistentStoreSessionIdvalueStore-session key for a persistent instance's named session. Collapses the (agentName, instanceId, sessionName) identity onto Fabric's single-string sessionId, keeping persistent sessions inside the existing session stores.
PipelineVoiceProvidervaluePublic export.
PipelineVoiceProviderOptionstypePublic export.
policiedFetchvaluePublic export.
PoliciedFetchOptionstypeWrap a fetch-like function with CapabilityPolicy enforcement. Tools and connectors that make outbound HTTP should accept a custom fetch and pass the result of policiedFetch(fetch, policy). Throws a FabricError (POLICY_DENIED) when a request violates the policy; never sends a forbidden request.
PolicyDecisiontypePublic export.
PromptOptionstypePublic export.
PromptRunInputtypePublic export.
PromptRunResulttypePublic export.
ProviderHttpErrorvaluePublic export.
ProvidersConfigtypePublic export.
ProviderSettingstypePublic export.
pruneSnapshotsvaluePublic export.
RateLimitertypePublic export.
RateLimiterAcquireOptionstypeProcess-local rate limiter for outbound provider calls. Use to prevent a fleet of agents from stampeding a single API key when the host runs many sessions in parallel. The default token-bucket impl is in-memory; Redis-backed implementations are a v1.8+ topic. fabric-harness ships this as a generic primitive — the same limiter can be reused for outbound HTTP calls inside connectors, webhook fan-out, or anywhere else throttling is useful.
ReaddirInputtypePublic export.
readdirToolvaluePublic export.
ReadFileBufferInputtypePublic export.
readFileBufferToolvaluePublic export.
ReadFileInputtypePublic export.
readFileToolvaluePublic export.
readJsonBodyvalueReads the body once and returns the raw bytes, the decoded text, and the parsed JSON together — so a channel can HMAC-verify the exact bytes and use the JSON without re-reading the (already consumed) stream. Returns undefined only when the body exceeds limitBytes.
readRequestBodyvalueReads the full request body as bytes, or returns undefined if it exceeds limitBytes. NOTE: this consumes the request stream (single read). Signature-verifying channels need the exact bytes for HMAC and the parsed JSON afterward — don't call request.json() as well. Use readJsonBody to get both from one read.
ReconstructedPartialAssistantMessagetypePublic export.
reconstructInterruptedStreamvaluePublic export.
redactErrorvaluePublic export.
RedactionOptionstypePublic export.
redactJsonvaluePublic export.
redactTextvaluePublic export.
registerCreatedAgentNamevalueRegister a name for a CreatedAgent so dispatch(agent, ...) can resolve it.
registeredModelProvidersvalueNames of externally registered providers, for diagnostics.
registerJobNamevaluePublic export.
registerModelPricesvalueAdd or override price rows. Later rows take precedence over earlier ones.
registerModelProvidervalueRegister a model provider resolvable via FABRIC_MODEL=&lt;name&gt;/&lt;model-id&gt;. Built-in providers always take precedence; registering a name a built-in already owns has no effect on routing. Idempotent by name (last registration wins). Call at module import time.
registerSandboxvalueRegister a sandbox in the in-process registry and return a portable ref. Subsequent calls for the same env return the same ref.
registerSandboxRefDecodervalueRegister a decoder for provider so attachSandbox(serialized) can rehydrate a sandbox from another process. Typically called once at startup by the package that owns the provider integration (e.g. @fabric-harness/connectors/e2b registers the e2b provider).
RemoteSandboxApitypePublic export.
RemoteSandboxOptionstypePublic export.
renderDeliveredMessagevalueRender a delivered message to the prompt text form. User messages pass their body through verbatim; signals render as their XML envelope via the shared renderSignalMessage machinery.
RequestBodytypePublic export.
resetDispatchRuntimevalueClear the ambient dispatch runtime (tests/teardown).
resetJobInvocationRuntimevaluePublic export.
resetModelPricesToBuiltinsvalueReset the registry to the built-in seed (test/utility).
ResolvedModelProvidertypePublic export.
resolveModelProvidervaluePublic export.
ResolveModelProviderOptionstypePublic export.
resolveRuntimeModevalueResolve the effective runtime mode for an init() call, applying production safety rules: - In production (FABRIC_ENV=production or NODE_ENV=production), choosing stateless is allowed but logged as an explicit choice. - inline (the default) without an explicit SessionStore falls back to in-memory storage. In production this emits a warning unless FABRIC_ALLOW_EPHEMERAL_STATE=1 is set or runtime is explicitly 'stateless'. - Unknown runtime values fall through to 'inline' with a warning.
RESULT_END_DELIMITERvaluePublic export.
RESULT_START_DELIMITERvaluePublic export.
ResultExtractionOptionstypePublic export.
ResultOutcometypePublic export.
ResultToolBundletypePublic export.
ResultUnavailableErrorvalueThrown when the LLM calls the give_up tool, indicating it cannot produce a result that conforms to the required schema.
ResultValidatortypePublic export.
RetrievedChunktypeGeneric, provider-agnostic retrieval seam. RAG is query-time, so it does NOT fit FilesystemSource (an eager full-dump mount) — a retriever resolves the top matches for a query on demand. Databricks Vector Search is the flagship implementation, but this is reusable for any vector store.
RetrieveOptionstypePublic export.
RetrievertypePublic export.
RmInputtypePublic export.
rmToolvaluePublic export.
RoletypePublic export.
runActionvalueValidate input, run the action against host, validate + JSON-clone the output. The returned value is always safely serializable (a fresh JSON clone), so callers can persist or transmit it without sharing references.
RunEventtypeA workflow event with append-only identity enforced by (runId, eventIndex).
RunRegistrytypeMinimal interface for a workflow run registry. Used by durable runtime backends to index and track run statuses.
RunStoretypeMinimal interface for a workflow/event run store. Used by durable runtime backends (Temporal, Cloudflare, etc.) to persist run metadata and events.
RuntimeModeResolutiontypePublic export.
runWithJobInvocationvaluePublic export.
runWithSubmissionContextvalueRun fn with context as the ambient submission correlation.
SandboxAdapterDescriptortypeAdapter expectations: - Every backend must expose the SandboxEnv contract above and map paths into a scoped workspace. - Secrets and provider credentials must stay in adapter-owned environment/config, not model context. - exec should enforce backend-specific command, network, and timeout policy before process launch. - snapshot/restore is optional because not all targets support filesystem or VM snapshots. - Future adapters should be added without changing session/runtime code. Planned backends: local, Docker, Azure Container Apps, Azure Container Instances, AKS, Databricks, E2B, Daytona, C...
SandboxBackendtypePublic export.
SandboxCapabilitiestypePublic export.
SandboxContinuityCapabilitiestypePublic export.
SandboxContinuityModetypePublic export.
SandboxEnvtypePublic export.
SandboxExecOptionstypePublic export.
SandboxFactorytypePublic export.
SandboxFactoryOptionstypePublic export.
SandboxForktypePublic export.
SandboxOwnershipLeaseStoretypePublic export.
SandboxOwnershipOptionstypePublic export.
SandboxReftypePublic export.
SandboxRefDecodertypeDecoder for a SerializedSandboxRef.provider. Returns a SandboxFactory that, when invoked, produces a SandboxEnv connected to the existing remote sandbox identified by providerData. Decoders SHOULD attach without owning the remote sandbox's lifecycle — the returned env's cleanup() should detach, not destroy.
SandboxSnapshottypePublic export.
sanitizeObservabilityDatavaluePublic export.
sanitizePublicJsonvaluePublic export.
sanitizePublicTextvalueRemove credentials and host filesystem locations from caller-visible text.
schemavaluePublic export.
SchematypePublic export.
SchemaIssuetypePublic export.
SchemaValidationErrorvaluePublic export.
SearchToolInputtypePublic export.
SearchToolOptionstypePublic export.
SearchToolResulttypePublic export.
secretvaluePublic export.
SecretProvidertypePublic export.
SecretReftypePublic export.
SecretResolutionContexttypePublic export.
secretResolvervalueAdapt a provider to the existing init(&#123; resolveSecret &#125;) callback.
SerializedFabricErrortypePublic export.
SerializedSandboxReftypeCross-process / cross-machine sandbox reference. Created by session.sandboxRef(&#123; portable: true &#125;) and re-attached via attachSandbox(serialized) in a separate process. Each provider string maps to a decoder registered via registerSandboxRefDecoder().
serializeFabricErrorvalueConvert any thrown value into the stable public/developer transport shape.
serializeSandboxRefvalueSerialize an in-process SandboxRef into the cross-process form. Requires the underlying sandbox to implement encodeRef(). Throws SANDBOX_UNAVAILABLE if the backend is in-process-only.
SessionDatatypePublic export.
SessionEntrytypePublic export.
SessionEntryTypetypePublic export.
SessionHistoryvaluePublic export.
SessionMemorytypePublic export.
SessionMemoryEntrytypePersistent key/value store for facts an agent should remember across sessions — borrower preferences, prior outcomes, learned task history. Distinct from SessionEntry (which is the audit log): memory is for recall, entries are for audit. Memory writes do NOT land in the session log, so they don't pollute prompt context unless the agent explicitly reads them. Tenancy: every operation accepts an optional tenantId. Two tenants with the same key get isolated values. tenantId defaults to the empty string for non-tenant deployments.
SessionMemoryFiltertypePublic export.
SessionMemoryGetOptionstypePublic export.
SessionMemorySetInputtypePublic export.
SessionOptionstypePublic export.
SessionStoretypePublic export.
SessionSubmissionExecutorOptionstypePublic export.
setLoggervalueReplace the global SDK logger. Call once at startup before any init(). Pass a custom Logger to redirect to your structured logging system.
ShellOptionstypePublic export.
shellQuotevaluePublic export.
ShellResulttypePublic export.
SkilltypePublic export.
SkillOptionstypePublic export.
slackApprovalNotifiervalueSlack incoming-webhook notifier. The webhook URL remains in host configuration, never event data.
SnapshotPruneOptionstypePublic export.
SnapshotPruneResulttypePublic export.
StatInputtypePublic export.
statToolvaluePublic export.
StdioMcpClientvaluePublic export.
StdioMcpClientOptionstypePublic export.
StoredAttachmenttypePublic export.
StreamChunkStoretypePublic export.
StreamChunkWritervaluePublic export.
StreamListenerRegistryvalueProcess-local listener registry shared by store implementations — registration, unsubscribe-and-prune, and error-swallowing notify.
SttEventtypePublic export.
SttProvidertypePublic export.
SttSessiontypePublic export.
SttSessionOptionstypePublic export.
SttSessionUsagetypePublic export.
SubmissionAbortedErrorvaluePublic export.
SubmissionAdmissionBackendtypeStorage callbacks for admitSubmissionWithBackend. Every callback runs inside the transaction the caller has already opened (or the backend's equivalent atomicity scope). Callbacks may return plain values (synchronous backends) or native Promises — non-native thenables are not supported.
SubmissionAdmissionRowtypeThe minimal shape admitSubmissionWithBackend needs from a persisted submission row: the transport kind and persisted payload it compares against the incoming admission. payload may be the serialized JSON string or an already-deserialized object (e.g. a Postgres JSONB column).
SubmissionAttemptReftypePublic export.
SubmissionClaimReftypePublic export.
SubmissionContexttypePublic export.
SubmissionDurabilitytypePublic export.
SubmissionExecuteOptionstypePublic export.
SubmissionExecutortypeHow the runner touches sessions. execute applies the submission's input to the addressed instance session and resolves with the turn result; everything else is store-level and must not require a live agent. Contract requirements: - execute must be idempotent by submission id (a resumed attempt whose input entry already exists must not append it again). - recordTerminal settles the conversation to a deterministic rest state (unresolved trailing tool calls get explicit interrupted-outcome markers — NEVER re-executed) and appends a terminal advisory. - appendSettlement appends the cano...
SubmissionInsertRowtypeThe queued row that admitSubmissionWithBackend writes on first admission.
SubmissionInspectiontypeCoarse persisted-progress classification consumed by reconciliation.
SubmissionInterruptedErrorvaluePublic export.
SubmissionInterruptiontypePublic export.
SubmissionPayloadContexttypeContext needed for submission payload validation. Implementations extract these fields from their storage-specific row/document type before calling isSubmissionPayload.
SubmissionRetryExhaustedErrorvaluePublic export.
SubmissionRunnertypePublic export.
SubmissionRunnerOptionstypePublic export.
submissionSessionKeyvalueStore-session FIFO key of a submission (re-exported convenience).
SubmissionSettledRecordtypeMinimal canonical settlement record for a direct submission. The conversation-stream phase reuses this shape as the durable terminal record a reconnecting waiter observes.
SubmissionSettlementtypePublic export.
submissionSettlementEntryIdvalueDeterministic canonical settlement entry id for a submission.
SubmissionSettlementObligationtypePublic export.
submissionStoreSessionIdvalueThe harness identity string (agent:&lt;name&gt;:&lt;id&gt;:&lt;session&gt;) targeted by a submission input. This is the persistentStoreSessionId of the addressed instance session and the per-session FIFO key of the store.
SubmissionTelemetryEventtypePublic export.
SubmissionTelemetrySinktypePublic export.
SubmissionTimeoutErrorvaluePublic export.
TaskOptionstypePublic export.
TelemetryExportertypePublic export.
TelemetrySpantypePublic export.
tenantCostLimitvalueSugar over CostLimit.perScope + scopeKey + store for the common "per-tenant ceiling per period" pattern. Pick one of perDayUsd, perHourUsd, or perMonthUsd; when multiple are set, the most restrictive (smallest absolute) wins. Scope key convention: tenant:&lt;id&gt;:&lt;period&gt; where &lt;period&gt; is day:YYYY-MM-DD, hour:YYYY-MM-DDTHH:00Z, or month:YYYY-MM. Reset semantics (rollover) are the host's job — call store.reset(scopeKey) from a scheduled task to clear the period total. See the package declarations for an example.
TenantCostLimittypePublic export.
ThinkingLeveltypeReasoning-effort input level, ordered from least to most thinking. Maps to each provider's native control (Workers AI / OpenAI reasoning_effort, Anthropic thinking.budget_tokens, Gemini thinkingConfig). 'off' (the default when unset) requests no reasoning. Providers that don't support reasoning ignore the level — see ModelMetadata.supportsReasoning.
toFabricErrorvaluePublic export.
tokenBucketRateLimitervalueIn-memory token-bucket rate limiter. Each key has its own bucket — keys are independent (waiting on one key doesn't block another). Buckets refill continuously at tokensPerSecond.
TokenBucketRateLimiterOptionstypePublic export.
ToolCalltypePublic export.
ToolCallResulttypePublic export.
ToolContexttypePublic export.
ToolDeftypePublic export.
ToolEffecttypePublic export.
ToolPolicytypePublic export.
toolsToModelSchemasvaluePublic export.
toOpenAIMessagevaluePublic export.
toOpenAIToolvaluePublic export.
TtsProvidertypePublic export.
TtsSynthesisOptionstypePublic export.
TtsSynthesisUsagetypePublic export.
TurnJournalStatetypePublic export.
UnifiedInMemoryStorevalueA unified in-memory store that implements SessionStore, StreamChunkStore, and RunStore. Useful for testing and dev environments where a single object needs to be passed as store, streamChunkStore, and runStore. Backed by separate Maps for each concern so that stream chunks and run data do not pollute session state.
UnimplementedSandboxEnvvaluePublic export.
unregisterSandboxvalueMark a registered sandbox as dead so future attach attempts fail. Called from the owner session's cleanup path.
unregisterSandboxRefDecodervalueTest/internal: remove a decoder.
validateResultvaluePublic export.
VERCEL_AI_GATEWAY_BASE_URLvalueDefault base URL for Vercel AI Gateway's OpenAI-compatible Chat Completions endpoint. The gateway accepts the standard OpenAI request body and routes through to the configured provider; switching from OpenAI to the gateway is just a base-URL change. See https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-compat
vercelAIGatewayvalueVercel AI Gateway model provider. The gateway is an OpenAI-compatible HTTP endpoint that brokers between your agent and any of the major model providers (OpenAI, Anthropic, Google, xAI, Groq, etc.) with a single key, observability, caching, and spend controls. Use this provider on any deploy target — Node, Cloudflare Workers, Vercel — to route inference through the gateway. See the package declarations for an example. Returns an OpenAICompatibleModelProvider configured for the gateway — use it anywhere a ModelProvider is accepted. Compatible with fabric-harness's tool-calling, retries,...
VercelAIGatewayProviderOptionstypePublic export.
verifyAttachmentBytesvalueVerify that bytes match the ref's digest (and declared size), throwing AttachmentStoreError('DIGEST_MISMATCH') otherwise. Every store's put MUST run this check before persisting.
verifyHmacSha256valueConstant-time HMAC-SHA256 verification (via crypto.subtle.verify).
VertexAIModelProvidervaluePublic export.
VertexAIProviderOptionstypePublic export.
VirtualSandboxEnvvalueVirtual sandbox backend powered by just-bash. Provides an in-memory filesystem and a bash subset (grep, glob, cat, read, mkdir, rm, ls, echo, etc.) without shelling out to the host. The backend is fast, cheap, safe, and high-concurrency. Selected automatically by the bare @fabric-harness/sdk import when the caller doesn't pass sandbox. Override with 'local', 'docker', a SandboxFactory, or a SandboxEnv when you need real shell access.
VoiceAudioFormattypeBidirectional voice / audio streaming surface. fabric-harness ships an OpenAI Realtime implementation; bring-your-own-vendor for Anthropic / Gemini Live / on-prem TTS+ASR pipelines. Audio frames flow in raw bytes — the standard format is PCM 16-bit little-endian at 24kHz mono (OpenAI Realtime default). Telephony bridges (Twilio Media Streams μ-law 8kHz, etc.) resample at the edge. Tool execution is the caller's responsibility: a tool_call event surfaces, the host code runs the tool through whatever governance gates apply (approvals, cost caps, rate limits), then calls `submitToolResult(...
VoiceConnectOptionstypePublic export.
VoiceEventtypeEvents streamed from a VoiceSession. audio_delta carries raw audio bytes; text_delta and transcript carry text; tool_call and response_done mark structured boundaries; error is fatal.
VoiceProvidertypePublic export.
VoiceSessiontypePublic export.
VoiceToolResultInputtypePublic export.
VoiceWsClientEventtypePublic export.
VoiceWsClientHandletypePublic export.
VoiceWsClientOptionstypeLightweight WebSocket client for the fh server WS /sessions/:id/voice endpoint. Server-side bridge owns the provider connection and API keys; this client just streams audio + control messages over WS. Works in browsers and on Node 22+ (uses the global WebSocket).
webhookApprovalNotifiervaluePublic export.
WebhookSubscriptionContexttypeGeneric webhook subscription primitive — wakes an agent on inbound events from any external system (event bus, queue, scheduler, third-party SaaS webhook, your own application's domain events). fabric-harness consumes a JSON payload and dispatches to the user-provided handler. The host event system decides which payloads land here; fabric-harness has no opinion on event taxonomy or producer.
WebhookSubscriptionDefinitiontypePublic export.
withConversationProjectionvalueWrap a SessionStore so active-path appends are mirrored into an append-only ConversationStreamStore projection (v2 A4). The SessionEntry DAG stays the single source of truth; the stream gives clients offset-based catch-up + live tail. Two rules keep them coherent: 1. Idempotent by entryId — a crash between the DAG write and the stream write is repaired on the next append: the projector diffs the stream tail against the active path and re-emits anything missing. 2. Truncation is explicit — the DAG can branch (fork/replay/ checkpoint-restore rewrite leafId); the stream cannot. W...
withFilesystemSourcesvaluePublic export.
WriteFileInputtypePublic export.
writeFileToolvaluePublic export.
WsClientCommandtypePublic export.
WsClientHandletypePublic export.
WsClientOptionstypeLightweight WebSocket client for the fh server WS /sessions/:id/ws endpoint. Works in browsers and on Node 22+ (uses the global WebSocket). Does NOT depend on the ws package — that's the server side's optional peer dep.

@fabric-harness/sdk/strict

ExportKindSummary
actionAsToolvalueExpose an action to the model as a tool on an agent profile. The tool's JSON schema comes from the action's input schema; execution validates input/output exactly like runAction.
ActionContexttypeContext passed to an action's run. Unlike a tool's execute (a leaf capability invoked by the model), an action receives the harness itself and can orchestrate: prompt models, spawn sessions, call other actions.
ActionDefinitiontypeA named, schema-validated unit of harness work created with defineAction. First-class in v2: registrable on agent profiles as a tool, callable from jobs and agents, evaluable via fh test, and deployable as a platform job task.
ActionErrorvaluePublic export.
ActionHosttypeWhat an action runs against: the harness entry point (init can prompt models, spawn sessions, and call tools) plus the platform environment. Jobs, agents, and servers all satisfy this — it is the harness slice of FabricContext.
ActionOptionstypePublic export.
ActorIdentitytypePublic export.
admitSubmissionWithBackendvalueShared submission admission algorithm for row-oriented backends: dispatch-receipt check → insert-or-ignore → read-back → payload compare (idempotent replay vs. conflict). The message payload is stored as JSON verbatim; payload identity is deep JSON equality, so a backend that normalizes stored JSON (e.g. Postgres JSONB key ordering) still recognizes an exact replay. The caller owns transaction scoping — invoke this inside one transaction and pass callbacks bound to it. When every callback is synchronous the result is returned synchronously, so the algorithm also fits synchronous backends.
agentvalueNo-defaults agent builder. Exported as agent from @fabric-harness/sdk/strict. Every init() option must be declared explicitly — useful for Temporal replay determinism and audit/compliance workloads where implicit behaviour is unwelcome.
AgentAttemptMarkertypeHarness-owned durable evidence that a submission attempt was started and has not yet settled. A coordinator inserts a marker immediately before starting an attempt and deletes it when the attempt settles; reconciliation treats a fresh marker as proof that the attempt may still be running and must not be reconciled as interrupted.
AgentDefinitiontypePublic export.
AgentDispatchAdmissiontypePublic export.
AgentDispatchReceipttypePublic export.
AgentDispatchRequesttypeAsync delivery request to a persistent agent instance + session.
AgentEventtypePublic export.
AgentEventBasetypeCommon envelope shared by every event variant.
AgentEventCallbacktypeCallback signature accepted by init(&#123; onEvent &#125;), agent.session(id, &#123; onEvent &#125;), and session.prompt(text, &#123; onEvent &#125;).
AgentEventTypetypePublic export.
AgentInittypePublic export.
AgentLoopRuntimetypePublic export.
AgentSubmissiontypePublic export.
AgentSubmissionDurabilitytypePublic export.
AgentSubmissionInputtypeOne admitted agent submission — the persisted operational payload for both transports. kind records how the submission arrived ('dispatch' via dispatch(), 'direct' via the agent HTTP route); a dispatch's submissionId is the public dispatchId from its receipt.
AgentSubmissionStatustypePublic export.
AgentSubmissionStoretypeDurable submission lifecycle storage. Stability: the lease method group mirrors the durable-execution engine and is subject to change until 1.0. This applies to every backend equally.
AgentTriggerstypePublic export.
aiGatewayvalueGeneric OpenAI-compatible AI gateway helper. Use for any gateway that speaks the OpenAI Chat Completions request/response shape: Helicone, Portkey, LiteLLM (self-hosted), Cloudflare AI Gateway, internal corp proxies, etc. See the package declarations for an example. For Vercel AI Gateway, prefer the vercelAIGateway preset — same factory under the hood with the gateway URL pre-baked.
AIGatewayOptionstypePublic export.
AnthropicModelProvidervaluePublic export.
AnthropicProviderOptionstypePublic export.
applyEstimatedCostvalueIdempotently populate usage.costUsd from the static price table. Mutates usage and returns it. No-op when: - usage is undefined, - usage.costUsd is already set (provider supplied it directly), - no price row matches modelRef.
ApprovalCallbacktypePublic export.
ApprovalDecisiontypePublic export.
ApprovalNotificationtypePublic export.
ApprovalNotificationDeadLettertypePublic export.
ApprovalNotificationDeliveryStoretypePublic export.
approvalNotificationFromEventvaluePublic export.
approvalNotificationHandlervalueConvert approval events into retryable, deduplicated notifications. This callback never throws.
ApprovalNotificationHandlerOptionstypePublic export.
ApprovalNotificationStatetypePublic export.
ApprovalNotifiertypePublic export.
ApprovalOptionstypePublic export.
ApprovalPolicyRuletypePer-pattern approval metadata. Lets policy authors route specific tools/commands to a named audience (e.g. 'reviewer', 'compliance-team', 'project-admin'). The audience id is opaque to fabric-harness — host applications map ids to humans via their own identity layer.
ApprovalRequesttypePublic export.
ApprovalResponsetypePublic export.
ApprovalRisktypePublic export.
ApprovalStatetypePublic export.
approvalStatesFromEntriesvaluePublic export.
ApprovalStateStatustypePublic export.
ApprovalUnavailableStrategytypePublic export.
ApprovalVotetypePublic export.
ArtifactCreateOptionstypePublic export.
ArtifactReftypePublic export.
assertEnforceableNetworkPolicyvalueRefuse production network policy when it can be bypassed by code in the sandbox. This validates an operator assertion; the named network boundary must still be provisioned by Docker, Kubernetes, or the cloud provider.
attachmentDigestvalueLowercase hex SHA-256 of the bytes (WebCrypto).
AttachmentLimitErrorvaluePublic export.
AttachmentPutInputtypePublic export.
AttachmentReftypeContent-addressed descriptor of one stored attachment.
AttachmentStoretypeDurable content-addressed attachment storage. - put is idempotent by (scope, digest) — re-putting the same content succeeds without duplicating storage (the first stored ref metadata is retained). It MUST verify the digest against the bytes and reject a mismatch with AttachmentStoreError('DIGEST_MISMATCH') before writing. - get/getByAttachmentId return null on a miss. - delete removes one stored attachment and throws AttachmentStoreError('NOT_FOUND') when nothing is stored under (scope, digest).
AttachmentStoreErrorvaluePublic export.
attachSandboxvalueBuild a SandboxFactory that, when invoked, returns an AttachedSandboxEnv delegating to the registered sandbox without owning its lifecycle. Calling cleanup() on the attached env unregisters this attachment but does NOT tear down the underlying sandbox. Pass an in-process SandboxRef to attach within the same process, or a SerializedSandboxRef (from session.sandboxRef(&#123; portable: true &#125;)) to rehydrate a sandbox handed off from another process. Cross-process refs require a decoder registered for serialized.provider via registerSandboxRefDecoder().
AutonomyModetypePublic export.
AutonomyOptionstypePublic export.
AzureOpenAIModelProvidervaluePublic export.
AzureOpenAIProviderOptionstypePublic export.
BashInputtypePublic export.
bashToolvaluePublic export.
BedrockModelProvidervaluePublic export.
BedrockProviderOptionstypePublic export.
buildModelMessagesFromHistoryvaluePublic export.
buildResultFollowUpPromptvalueFollow-up prompt sent when the LLM ends a turn without calling finish or give_up.
buildResultFootervalueFooter appended to user prompts/skill bodies when a result schema is set.
buildResultRetryPromptvaluePublic export.
BuiltinFileTooltypePublic export.
BuiltinTooltypePublic export.
bytesToHexvaluePublic export.
CapabilityPolicytypePublic export.
CartesiaSttProvidervaluePublic export.
CartesiaSttProviderOptionstypePublic export.
CartesiaTtsProvidervaluePublic export.
CartesiaTtsProviderOptionstypePublic export.
chainSecretProvidersvalueResolve from providers in order; errors fail closed instead of falling through.
ChanneltypePublic export.
ChannelContexttypePublic export.
ChannelDispatchtypePublic export.
ChannelDispatchRequesttypePublic export.
ChannelRoutetypeChannels turn platform webhooks (Slack, GitHub, …) into agent dispatches. Handlers are written against the Web Request/Response API and crypto.subtle, so the same channel runs on Node and Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer — session continuity falls out of the key (same thread → same key → same session).
CheckpointCreateOptionstypePublic export.
CheckpointRestoreOptionstypePublic export.
CheckpointResulttypePublic export.
clampCommandTimeoutvaluePublic export.
clampReadLimitvaluePublic export.
classifySubmissionStatevalueClassify how far a persisted submission input progressed. - absent — the input entry never landed in session history: the attempt crashed before applying it. Safe to requeue for a clean first attempt. - completed — finished work: a canonical settlement entry exists, an assistant response follows the input with no unresolved trailing tool batch, or a later user input shows the conversation moved on. Settle as success; never retry (retrying completed work is the one unrecoverable corruption). - continuable — the trailing turn carries unresolved tool calls. The next session.prompt() re...
CohereModelProvidervaluePublic export.
CohereProviderOptionstypePublic export.
combineSubmissionTelemetrySinksvalueFan one event out to several sinks.
CommandtypePublic export.
CommandEnvValuetypePublic export.
CommandPolicytypePublic export.
CommandToolInputtypePublic export.
CommandToolOptionstypePublic export.
CompactionOptionstypePublic export.
CompactionResulttypePublic export.
configureDispatchRuntimevalueConfigure the ambient dispatch queue used by dispatch.
configureJobInvocationRuntimevaluePublic export.
connectFabricVoicevaluePublic export.
connectFabricWsvaluePublic export.
connectMcpServervaluePublic export.
consoleTelemetryExportervalueTelemetry exporter that writes spans through the SDK logger (default console-backed). Useful for local development and as a fallback when no OpenTelemetry collector is wired up. Use openTelemetryExporter or langfuseExporter for production.
ContextBudgettypePublic export.
ContextBudgetOptionstypePublic export.
CONVERSATION_STREAM_DEFAULT_READ_LIMITvaluePublic export.
CONVERSATION_STREAM_MAX_READ_LIMITvaluePublic export.
conversationKeyvaluePublic export.
ConversationProducerClaimtypePublic export.
ConversationProjectorvaluePublic export.
ConversationStreamAppendInputtypePublic export.
ConversationStreamBatchtypePublic export.
ConversationStreamIdentitytypePublic export.
ConversationStreamMetatypePublic export.
conversationStreamPathvalueStream path for a session's conversation projection.
ConversationStreamReadResulttypePublic export.
ConversationStreamRecordtypeAppend-only conversation stream — the durable, offset-addressable projection of a session's active path (v2 migration, phase A4). The SessionEntry DAG remains the single source of truth for model context; this stream exists so clients can read a conversation with offsets (catch-up + live tail), across processes, without count-based replay. The projection appends one record per active-path entry, and — because the DAG can branch (fork/replay/checkpoint-restore) while a stream cannot — an explicit truncated record whenever the active path rewinds, paired with a producer-epoch bump so stale...
ConversationStreamStoretypeDurable append-only conversation stream storage. Batch atomicity is a hard contract requirement: every record in an append must be persisted together under one offset, all-or-nothing. First-party adapters satisfy this by serializing the batch into a single row/document write; an adapter that splits records across non-atomic writes violates the contract. Producer fencing: acquireProducer bumps the producer epoch; appends carrying a stale epoch are rejected. The (path, producerId, epoch, sequence) uniqueness makes redelivered appends idempotent — a retried append with the same coo...
ConversationStreamStoreErrorvaluePublic export.
CostBudgetStoretypeAsync store for cross-process spend aggregation. Pair with CostLimit.scopeKey + CostLimit.perScope to enforce a budget that survives process restarts — "tenant:acme spends ≤ $50 today" or "company-wide ≤ $100 this hour". Built-in implementations: - inMemoryCostBudgetStore() — process-local; default. - @fabric-harness/node exposes postgresCostBudgetStore(&#123; pool &#125;).
CostBudgetTrackervalueTracks cumulative session spend. Cheap to construct; one per session.
CostLimittypePublic export.
CostLimitContexttypePublic export.
CostLimitExceededErrorvaluePublic export.
createAgentvalueDefine a persistent, URL-addressable agent. Files in .fabricharness/agents/ default-export createAgent(...); the runtime resolves a fresh config per interaction and keeps sessions across direct prompts and dispatched inputs.
createAttachmentRefvalueBuild an AttachmentRef for the given bytes, computing the SHA-256 digest via WebCrypto (crypto.subtle) so the SDK stays runtime-agnostic.
createBuiltinToolsvaluePublic export.
createCommandToolsvaluePublic export.
createConsoleLoggervalueBuild a Console-backed logger with an explicit level. Useful for tests that want to capture or silence SDK output without touching globals.
CreatedAgenttypeA persistent, addressable agent created with createAgent. Distinct from a finite agent(&#123; run &#125;) job: it has no run — the initializer returns configuration, and the runtime maintains sessions across interactions.
createDirectAgentSubmissionInputvalueMint a direct-prompt submission input with a fresh submission id.
createDispatchAgentSubmissionInputvalueMap a DispatchInput onto the persisted submission input shape.
createFabricContextvaluePublic export.
createFabricFsvalueAdapt a sandbox into the public filesystem convenience surface.
createFileToolsvaluePublic export.
createMcpAuthorizationCodeAuthvalueAuthorization-code + PKCE provider; the MCP SDK refreshes stored tokens automatically.
createMcpClientCredentialsAuthvalueOAuth client-credentials provider with MCP SDK token refresh handling.
createMcpToolsvaluePublic export.
CreateMcpToolsOptionstypePublic export.
createObservabilityObservervalueCreate a fail-open event observer suitable for Braintrust, Sentry, Jetty, or a custom sink.
createObservabilityRecordvalueConvert a Fabric event into a vendor-neutral, low-cardinality record.
createOperationalMetricsCollectorvalueLow-cardinality operational metrics collector suitable for OTel/Prometheus bridging.
createPiAgentLoopRuntimevaluePublic export.
createRemoteSandboxEnvvalueWrap a provider-owned remote sandbox client in Fabric's SandboxEnv contract. Provider credentials and SDK objects remain outside model context/history; Fabric only sees the narrow file/shell/snapshot API exposed here.
createResultToolsvalueProduce the per-call finish and give_up tool pair for a given ResultValidator. - finish's parameters are a generic JSON Schema object because we can't derive a precise schema from ResultValidator. The validator's safeParse handles actual validation. - First successful finish (or give_up) call wins. Subsequent calls return an error tool result rather than throwing, to keep the conversation transcript natural.
createSandboxEnvvaluePublic export.
createScopedSandboxEnvvalueReturn a view of a sandbox with a narrower default cwd. Relative file paths and shell cwd values are resolved from this scoped cwd while the underlying sandbox still enforces its workspace boundary.
createSearchToolvalueExposes a Retriever to the model as a search tool. The tool is read-only; wrap it with a governance decorator to stamp lineage or route approvals.
createStdioMcpClientvaluePublic export.
createSubmissionRunnervaluePublic export.
createVirtualSandboxEnvvaluePublic export.
CredentialMissingStrategytypePublic export.
currentJobInvocationvaluePublic export.
currentSubmissionContextvalueThe submission owning the current execution, or undefined outside one.
DeepgramSttProvidervaluePublic export.
DeepgramSttProviderOptionstypePublic export.
DEFAULT_HEADLESS_PREAMBLEvaluePublic export.
defaultLoopRuntimevaluePublic export.
defaultModelProvidervaluePublic export.
defaultSessionStorevaluePublic export.
defineActionvalueDefine an action — the harness-context counterpart to defineTool. A tool is a leaf capability the model calls; an action holds the harness (context.init) and can prompt, spawn sessions, and compose other work. Input/output use the harness schema builders and are validated on every runAction call; outputs must be JSON-serializable.
defineAgentvalueCanonical v2 name for createAgent: persistent, URL-addressable agents are defined, and the runtime instantiates them per addressed id. createAgent remains supported as an alias.
defineChannelvalueValidates and brands a channel's routes.
defineCommandvaluePublic export.
DefinedAgenttypePublic export.
defineJobvalueNo-defaults finite-job builder with lazy default-session helpers.
defineToolvaluePublic export.
defineWebhookSubscriptionvalueHelper that returns the definition unchanged. Useful for type inference and to keep agent files declarative. See the package declarations for an example.
DeletionCompletionRecordtypePublic export.
DeliveredAttachmenttypeOne attachment on a kind: 'user' message. Today the only supported attachment is an image, carried either inline (data, base64) or as a durable content-addressed reference (ref) once an attachment store is configured — admission materializes inline bytes into refs. An attachment must carry data or ref (or both, transiently during materialization).
DeliveredAttachmentReftypeDurable reference to attachment bytes in an attachment store.
DeliveredMessagetypeDeliveredMessage — the single unified input shape for everything that enters a persistent agent's session: direct HTTP prompts, dispatch, channels/webhooks, Databricks events, SDK clients, and tests. kind: 'user' is a direct user talking to the assistant (1:1 chat surface), optionally carrying attachments. kind: 'signal' models everything beyond that direct exchange — a Slack thread or a Lakeflow job event is activity the agent observes, not the assistant's own user speaking. Sender identity and structured metadata go in attributes; the message itself in body. Signals render into mo...
deliveredSignalToEntryDatavalueMap a signal-kind message onto the persisted signal entry's data shape.
deriveCompactionDefaultsvalueCompute model-aware compaction defaults. Reserve is capped at the model's max output because reserving more than the model can emit in one turn wastes context; the preserved tail stays flat because recent-context fidelity depends on the active work, not on the model's total window size.
dispatchvaluePublic export.
DispatchInputtypeInternal enqueued form, carrying correlation + isolation metadata.
DispatchProcessortypeConsumes enqueued dispatches and applies them to an instance session.
DispatchQueuetypeAdmission queue for dispatches. The default is in-process; durable backends implement the same shape.
DispatchReceipttypeAcceptance confirmation for an enqueued dispatch.
DockerSandboxEnvvaluePublic export.
DockerSandboxOptionstypePublic export.
DURABILITY_DEFAULT_MAX_ATTEMPTSvalueDefault maximum total attempts before terminalization.
DURABILITY_DEFAULT_TIMEOUT_MSvalueDefault submission timeout in milliseconds (one hour).
DurableSessionRuntimetypeStructural delegate for durable session execution. When init() is given a sessionRuntime factory that produces one of these, the SDK's session calls (prompt, task, shell, checkpoint.*) are routed through the runtime instead of executing inline. This is the seam for Temporal workflows, external orchestration runtimes, or test fakes. mount, history, artifact, and compact remain SDK-local concerns and are not delegated — they operate against the local session store.
DurableSessionRuntimeFactorytypePublic export.
editFileToolvaluePublic export.
EditInputtypePublic export.
ElevenLabsTtsProvidervaluePublic export.
ElevenLabsTtsProviderOptionstypePublic export.
EmbeddingProvidertypeEmbeddings seam. Feeds self-managed-embedding vector indexes (embed the query → query vector) and any bring-your-own retrieval pipeline. Returns one vector per input text, order-preserving.
emitOpenTelemetrySpanvaluePublic export.
emitSubmissionTelemetryvalueDeliver an event to a sink, swallowing (and reporting) sink failures.
EmptySandboxEnvvaluePublic export.
enqueueDispatchvalueValidate + normalize a named request and enqueue it, generating the dispatch id.
entryToTelemetrySpanvaluePublic export.
environmentSecretProvidervalueRuntime-only environment provider with optional prefix and explicit allowlist.
EnvironmentSecretProviderOptionstypePublic export.
estimateCostUsdvalueEstimate USD cost for a single model call. Returns 0 when no row matches modelRef — callers should treat 0 as "unknown" and not overwrite an existing costUsd from the provider.
estimateModelMessagesTokensvaluePublic export.
estimateSessionEntriesTokensvaluePublic export.
estimateTextTokensvaluePublic export.
evaluateCommandPolicyvaluePublic export.
evaluateContextBudgetvaluePublic export.
evaluateNetworkPolicyvalueEvaluate a URL or Request against the configured network policy. Returns &#123; allowed: true &#125; when the request is permitted, otherwise a denial with the reason and matched pattern.
evaluateOperationalSlosvaluePublic export.
evaluateToolCallPolicyvaluePublic export.
eventToTelemetrySpanvaluePublic export.
ExistsInputtypePublic export.
existsToolvaluePublic export.
extractResultValuevaluePublic export.
FABRIC_OPERATIONAL_METRICSvaluePublic export.
FabricActortypePublic export.
FabricAgenttypePublic export.
FabricContexttypePublic export.
FabricErrorvaluePublic export.
FabricErrorCodetypePublic export.
FabricErrorOptionstypePublic export.
FabricEventtypePublic export.
FabricEventCallbacktypePublic export.
FabricEventTypetypePublic export.
FabricFstypeOut-of-band filesystem surface for a session sandbox. These operations do not write to conversation history and are intended for host-side plumbing: staging files, collecting artifacts, and preparing scratch space. If the model should reason about a file, prompt it to use the normal read/write/edit tools instead.
FabricObservabilityRecordtypePublic export.
FabricPrincipaltypeThe governed identity a piece of work runs as (v2). Distinct from ActorIdentity (who asked): the principal is what the platform's access control enforces — a human user, a machine service principal, or a hosted app's own identity. ucPrincipal carries the catalog-governance principal name when the platform has one (e.g. Unity Catalog).
FabricRuntimetypeExecution runtime selection. - inline (default): single-process execution. Uses the configured SessionStore (in-memory by default) for history, artifacts, approvals. - stateless: explicit headless / ephemeral mode. No session store, no artifact persistence, no approval waiting. Each invocation is independent. Use for high-volume webhook agents and edge runtimes where state would just be discarded anyway. In production (FABRIC_ENV=production or NODE_ENV=production) this mode must be selected explicitly — inline without an explicit store will warn or fail depending on `FABRIC_ALLO...
FabricSessiontypePublic export.
FallbackModelProvidervaluePublic export.
FallbackModelProviderOptionstypePublic export.
FileStattypePublic export.
FilesystemEntrytypePublic export.
FilesystemPolicytypePublic export.
FilesystemSourcetypeA read-only content source that can be mounted into a sandbox at sandbox-creation time. The agent then has built-in read, glob, and grep tools available over the mounted content — no retrieval pipeline, no embeddings, no vector store required. Sources are intentionally minimal: they yield (path, content) pairs. Implementations decide how to enumerate (eager vs lazy is up to the source author) — the mount step pulls the full set into the sandbox.
findSubmissionInputIndexvalueIndex of the (last) user_prompt entry carrying the submission id, or -1.
findTrailingDanglingToolCallsvalueFind trailing tool_call entries on the active path that were never settled — no matching tool_result (paired by toolCallId, falling back to tool name) and no subsequent error entry for the same tool. A dangling call means a model turn died (crash/abort) between recording the call and recording its outcome. Left in place it produces an assistant tool_use with no tool_result on resume, which providers reject — the repair path appends synthetic interrupted outcomes for exactly the entries returned here. Conservative by construction: only the window after the last turn boundary (use...
findTrailingUnfinishedTasksvalueTrailing task_start entries in the same window with no matching task_end — a subtask that was in flight when the turn died. These do not corrupt model context (task entries are bookkeeping), but settling them keeps UI/audit state coherent.
formatSchemaIssuesvaluePublic export.
formatStreamOffsetvaluePublic export.
fumadocsSourcevalueMount a local Fumadocs content directory as a knowledge base. Strips MDX frontmatter by default for cleaner agent context. For a published Fumadocs site, fetch its llms.txt / sitemap and pass the URLs to httpFilesystemSource.
GeminiModelProvidervaluePublic export.
GeminiProviderOptionstypePublic export.
generateAffinityKeyvalueGenerate a deterministic aff_\u003cULID\u003e affinity key from an (agentId, sessionId) pair. The same pair always produces the same key, which is stable across restarts. Different pairs produce different keys with overwhelming probability.
generateWithRuntimevaluePublic export.
getAgentDefinitionvaluePublic export.
getCreatedAgentvalueReturn the CreatedAgent carried by a value, or undefined.
getLoggervalueGet the currently configured logger.
getVirtualSandboxvalueOne-liner helper for the most common pattern: mount a single read-only source into a virtual sandbox. Equivalent to: See the package declarations for an example. Used for support agents, runbook lookup, FAQ assistants — anywhere a small Markdown corpus needs to be searchable via the agent's built-in grep/glob/read tools. See the package declarations for an example.
GlobInputtypePublic export.
globToolvaluePublic export.
GrepInputtypePublic export.
GrepMatchtypePublic export.
grepToolvaluePublic export.
hasSubmissionSettledEntryvalueTrue when the path carries a canonical submission_settled entry for the id.
hexToBytesvaluePublic export.
hmacSha256valuePublic export.
httpFilesystemSourcevalueFetch a list of URLs and mount each response body as a file. Useful for pulling a small published docs set into the sandbox so the built-in read/grep/glob tools can search it like local files.
HttpResourcetypePublic export.
initvaluePublic export.
initializePersistentAgentvalueResolve a persistent agent's config for an instance and build a FabricAgent. Runtime-specific resources (session store, workspace roles/skills, loop runtime) are layered by the host that calls this.
inMemoryApprovalNotificationStorevalueProcess-local atomic delivery state for development and single-process hosts.
InMemoryAttachmentStorevalueIn-memory attachment store (dev / runtime: 'stateless' / tests).
InMemoryConversationStreamStorevalueIn-memory conversation stream store (dev / runtime: 'stateless' / tests).
inMemoryCostBudgetStorevalueProcess-local cost budget store. Default when store is not provided.
InMemoryDispatchQueuevalueIn-process dispatch queue: microtask-drained, concurrent across sessions, serialized within a single session. Suitable for the inline/stateless runtimes and dev. Durable delivery (surviving restarts) is provided by the Temporal-backed queue, which implements this same interface.
inMemorySessionMemoryvalueProcess-local in-memory implementation. Default when init(&#123; memory &#125;) is not configured — pair with Postgres for durability across restarts.
InMemorySessionStorevaluePublic export.
inMemorySourcevalueBuild a source from an in-memory map of path -&gt; content. Useful for tests, fixtures, and small static knowledge bases bundled into the agent module itself.
InMemorySubmissionStorevaluePublic export.
InterruptedToolCallReftypeA tool call settled with an explicit interrupted-outcome marker at terminalization.
InvalidDeliveredMessageErrorvalueThrown by parseDeliveredMessage on malformed input.
invokevaluePublic export.
isActionDefinitionvaluePublic export.
isContextOverflowErrorvaluePublic export.
isCreatedAgentvalueWhether a value is a CreatedAgent.
isDeliveredMessageShapevalueTrue when a raw value already looks like a DeliveredMessage (has a valid kind).
isEventvalueType guard: narrow an AgentEvent to a specific variant. See the package declarations for an example.
isFabricErrorvaluePublic export.
isInMemoryStorevalueReturns true when store is the in-memory default (no appendEntry persistence beyond memory). Used by stateless mode to skip writes.
isStatelessRuntimevaluePublic export.
isSubmissionPayloadvalueValidate that a parsed JSON payload matches the expected submission shape. Used after deserializing a persisted payload to verify the object is a well-formed AgentSubmissionInput that is consistent with the stored submission metadata. Both dispatch and direct payloads carry the same message: DeliveredMessage field — validated identically here regardless of transport kind.
isValidAffinityKeyvaluePublic export.
jobvalueNo-defaults agent builder. Exported as agent from @fabric-harness/sdk/strict. Every init() option must be declared explicitly — useful for Temporal replay determinism and audit/compliance workloads where implicit behaviour is unwelcome.
JobContexttypeRuntime-ready context for finite jobs. The default session is initialized lazily.
JobDefinitiontypePublic export.
JobInvocationContexttypePublic export.
JobInvocationOptionstypePublic export.
JobInvocationReceipttypePublic export.
JobInvocationRuntimetypePublic export.
JobMiddlewaretypePublic export.
JournalCallbackstypePublic export.
jsonDeepEqualvalueStructural equality over JSON values (objects compared key-order-insensitively).
JsonObjecttypePublic export.
JsonPrimitivetypePublic export.
JsonSchemaObjecttypePublic export.
JsonValuetypePublic export.
LangfuseClientLiketypeOptional Langfuse exporter. Adapts Fabric's TelemetrySpan shape to Langfuse's tracing API. The Langfuse client is provided by the caller — we don't take a hard dependency. Install peer dep: See the package declarations for an example. Usage: See the package declarations for an example.
langfuseExportervaluePublic export.
LangfuseExporterOptionstypePublic export.
LEASE_DURATION_MSvalueDefault lease duration for submission ownership in milliseconds (30 seconds).
listModelPricesvalueAll currently-registered rows (newest-last). Returns a copy.
listSandboxRefDecodersvalueReturns the list of currently registered providers.
localDirectorySourcevalueRead a host directory recursively as a read-only source. include is called for each candidate file path (relative to hostPath). Return false to skip. Defaults to including everything.
LocalSandboxEnvvaluePublic export.
LocalSandboxOptionstypePublic export.
LoggertypeMinimal logger seam used by the SDK for non-event diagnostic output (warnings, deprecation notices, telemetry fallbacks). All console.* inside the SDK should route through getLogger() so ops teams can redirect or silence messages in production. The default logger writes to console and respects FABRIC_HARNESS_LOG_LEVEL=debug|info|warn|error|silent (default warn).
LogLeveltypePublic export.
lookupModelPricevalueLook up the most recently-registered row matching modelRef. modelRef can be: - 'provider/model' (preferred, e.g. 'openai/gpt-4o') - 'model' alone (e.g. 'gpt-4o') — first row whose model matches wins Provider matching is case-insensitive. Model matching is exact.
materializeMessageAttachmentsvalueMaterialize a message's inline attachments into durable refs: decode the base64 data, store the bytes under scope, and return a NEW message whose attachments carry &#123; type, mimeType, filename?, ref &#125; and no data. Deterministic by construction — attachment ids are $&#123;idPrefix&#125;_$&#123;index&#125; and digests derive from content — so an exact redelivery of the same message produces an identical materialized payload (admission idempotency). Messages without inline attachments are returned unchanged (same reference).
MAX_ATTACHMENT_DATA_LENGTHvalueMaximum accepted base64 length for a single inline attachment.
McpAuthorizationCodeOptionstypePublic export.
McpAuthorizationCodeStatetypePublic export.
McpClientCredentialsOptionstypePublic export.
McpClientLiketypePublic export.
McpServerConnectiontypePublic export.
McpServerOptionstypePublic export.
McpToolDescriptortypePublic export.
McpTransporttypePublic export.
messageHasDataAttachmentsvalueTrue when the message carries at least one inline (base64) attachment.
mintlifySourcevalueMount a checked-out Mintlify content directory. For a hosted Mintlify MCP server, use connectMcpServer('mintlify', &#123; url, transport: 'streamable-http' &#125;) instead.
MissingInputStrategytypePublic export.
MkdirInputtypePublic export.
mkdirToolvaluePublic export.
MockModelProvidervaluePublic export.
ModelAttemptEventtypePublic export.
ModelConfigtypePublic export.
ModelMessagetypePublic export.
ModelMessageRoletypePublic export.
ModelMetadatatypePublic export.
ModelPriceRowtypeStatic USD price table for model providers. Used to populate ModelUsage.costUsd on responses that don't include billing info from the provider directly (most providers — only pi-loop-runtime and a handful of gateways report cost). Prices are stamped with effectiveAt. The table is best-effort: real billing reconciliation should use vendor invoices. Override or extend at runtime with registerModelPrices for custom-rate contracts.
ModelPricingUsagetypePublic export.
ModelProvidertypePublic export.
ModelProviderFactorytypeResolves a parsed provider/model-id ref into a concrete provider. Registered factories let out-of-core packages (e.g.
ModelRequesttypePublic export.
ModelResponsetypePublic export.
ModelRuntimeOptionstypePublic export.
ModelStreamChunktypePublic export.
ModelToolCalltypePublic export.
ModelToolSchematypePublic export.
ModelUsagetypePublic export.
MountedSourcetypePublic export.
MountResulttypePublic export.
NamedAgentDispatchRequesttypeA dispatch request that names its target agent.
NamedJobInvocationtypePublic export.
NativeLoopRuntimevaluePublic export.
NetworkEnforcementLayertypePublic export.
NetworkEnforcementRequirementtypePublic export.
NetworkPolicytypePublic export.
noopSessionStorevaluePublic export.
NoopSessionStorevalueNo-op session store for runtime: 'stateless' mode. All writes are discarded; reads always return the empty initial session. Use this when the agent is intended as a pure request/response handler with no persistence (typical for high-volume webhooks and edge runtimes). Approvals and artifact retrieval are not supported — wiring those up requires a real store. Callers in stateless mode should not rely on artifact persistence or approval gating.
normalizeDeliveredMessagevalueNormalize legacy inputs into a DeliveredMessage: - a string → a user message with that body - a value with a kind discriminator → validated as a DeliveredMessage - any other JSON value → a user message with the JSON-stringified body (matching the historical dispatch rendering, so behavior is unchanged for pre-DeliveredMessage callers)
ObservabilityCorrelationtypePublic export.
ObservabilityObserverOptionstypePublic export.
openAIChatCompletionToModelResponsevaluePublic export.
OpenAICompatibleModelProvidervaluePublic export.
OpenAICompatibleProviderOptionstypePublic export.
OpenAIRealtimeVoiceProvidervalueOpenAI Realtime voice provider. Connects via WebSocket; emits audio_delta / text_delta / transcript / tool_call / response_done events. No transitive dependency on ws — uses the global WebSocket available on Node 22+ and browsers. See the package declarations for an example.
OpenAIRealtimeVoiceProviderOptionstypePublic export.
openTelemetryExportervalueBridge Fabric's SDK-neutral TelemetrySpan into a real
OpenTelemetryExporterOptionstypePublic export.
OperationalMetricsCollectortypePublic export.
OperationalMetricsSnapshottypePublic export.
OperationalSloEvaluationtypePublic export.
OperationalSloTargetstypePublic export.
parseConversationKeyvaluePublic export.
ParsedConversationKeytypePublic export.
parseDeliveredMessagevalueValidate a raw value as a DeliveredMessage. Shared by dispatch admission and the direct HTTP route so every transport produces the same structured error on bad input.
ParsedModelReftypePublic export.
parseModelRefvaluePublic export.
parsePersistentSessionIdvalueInverse of persistentStoreSessionId: decode a store session id back into &#123; agent, instanceId, session &#125;, or undefined if it is not a persistent-instance key. Useful for admin surfaces that list raw session ids.
parseRetryAfterMsvalueParse a Retry-After header value (RFC 7231) into milliseconds. Accepts both delta-seconds and HTTP-date forms. Returns undefined when the value is missing or unparseable.
parseStreamOffsetvaluePublic export.
PersistenceBundletypeComplete persistence surface consumed by a Fabric host.
PersistenceDeleteResulttypePublic export.
PersistenceHealthtypePublic export.
PersistentAgentConfigtypeRuntime configuration returned by a createAgent initializer. Mirrors the agent-level slice of AgentInit; instructions becomes the session system prompt (a role), and subagents map to named roles.
PersistentAgentContexttypePer-interaction context passed to a createAgent initializer. id is the URL &lt;id&gt; of the addressed instance (or the dispatch target id); env is the platform environment supplied by the runtime.
persistentConfigToAgentInitvalueTranslate a PersistentAgentConfig into an AgentInit.
PersistentSessionIdentitytypeDecoded identity of a persistent instance session store key.
persistentStoreSessionIdvalueStore-session key for a persistent instance's named session. Collapses the (agentName, instanceId, sessionName) identity onto Fabric's single-string sessionId, keeping persistent sessions inside the existing session stores.
PiAgentLoopRuntimevaluePublic export.
PiAgentLoopRuntimeOptionstypePublic export.
PiCustomModeltypePublic export.
PipelineVoiceProvidervaluePublic export.
PipelineVoiceProviderOptionstypePublic export.
policiedFetchvaluePublic export.
PoliciedFetchOptionstypeWrap a fetch-like function with CapabilityPolicy enforcement. Tools and connectors that make outbound HTTP should accept a custom fetch and pass the result of policiedFetch(fetch, policy). Throws a FabricError (POLICY_DENIED) when a request violates the policy; never sends a forbidden request.
policiedSandboxEnvvalueWrap a SandboxEnv with CapabilityPolicy enforcement at the sandbox layer. Without this decorator, agent code that calls (await session.sandbox).exec(...) directly bypasses the policy that session.shell() and tool dispatch enforce. policiedSandboxEnv() closes that gap by re-running the same policy evaluation against exec / readFile / writeFile / mkdir / rm / etc. Throws FabricError: - COMMAND_DENIED when an exec is denied or requires approval. - POLICY_DENIED when a filesystem op is denied or requires approval. The decorator does NOT auto-resolve requireApproval p...
PolicyDecisiontypePublic export.
PromptOptionstypePublic export.
PromptRunInputtypePublic export.
PromptRunResulttypePublic export.
ProviderHttpErrorvaluePublic export.
ProvidersConfigtypePublic export.
ProviderSettingstypePublic export.
pruneSnapshotsvaluePublic export.
RateLimitertypePublic export.
RateLimiterAcquireOptionstypeProcess-local rate limiter for outbound provider calls. Use to prevent a fleet of agents from stampeding a single API key when the host runs many sessions in parallel. The default token-bucket impl is in-memory; Redis-backed implementations are a v1.8+ topic. fabric-harness ships this as a generic primitive — the same limiter can be reused for outbound HTTP calls inside connectors, webhook fan-out, or anywhere else throttling is useful.
ReaddirInputtypePublic export.
readdirToolvaluePublic export.
ReadFileBufferInputtypePublic export.
readFileBufferToolvaluePublic export.
ReadFileInputtypePublic export.
readFileToolvaluePublic export.
readJsonBodyvalueReads the body once and returns the raw bytes, the decoded text, and the parsed JSON together — so a channel can HMAC-verify the exact bytes and use the JSON without re-reading the (already consumed) stream. Returns undefined only when the body exceeds limitBytes.
readRequestBodyvalueReads the full request body as bytes, or returns undefined if it exceeds limitBytes. NOTE: this consumes the request stream (single read). Signature-verifying channels need the exact bytes for HMAC and the parsed JSON afterward — don't call request.json() as well. Use readJsonBody to get both from one read.
redactErrorvaluePublic export.
RedactionOptionstypePublic export.
redactJsonvaluePublic export.
redactTextvaluePublic export.
registerCreatedAgentNamevalueRegister a name for a CreatedAgent so dispatch(agent, ...) can resolve it.
registeredModelProvidersvalueNames of externally registered providers, for diagnostics.
registerJobNamevaluePublic export.
registerModelPricesvalueAdd or override price rows. Later rows take precedence over earlier ones.
registerModelProvidervalueRegister a model provider resolvable via FABRIC_MODEL=&lt;name&gt;/&lt;model-id&gt;. Built-in providers always take precedence; registering a name a built-in already owns has no effect on routing. Idempotent by name (last registration wins). Call at module import time.
registerSandboxvalueRegister a sandbox in the in-process registry and return a portable ref. Subsequent calls for the same env return the same ref.
registerSandboxRefDecodervalueRegister a decoder for provider so attachSandbox(serialized) can rehydrate a sandbox from another process. Typically called once at startup by the package that owns the provider integration (e.g. @fabric-harness/connectors/e2b registers the e2b provider).
RemoteSandboxApitypePublic export.
RemoteSandboxOptionstypePublic export.
renderDeliveredMessagevalueRender a delivered message to the prompt text form. User messages pass their body through verbatim; signals render as their XML envelope via the shared renderSignalMessage machinery.
RequestBodytypePublic export.
resetDispatchRuntimevalueClear the ambient dispatch runtime (tests/teardown).
resetJobInvocationRuntimevaluePublic export.
resetModelPricesToBuiltinsvalueReset the registry to the built-in seed (test/utility).
ResolvedModelProvidertypePublic export.
resolveModelProvidervaluePublic export.
ResolveModelProviderOptionstypePublic export.
resolveRuntimeModevalueResolve the effective runtime mode for an init() call, applying production safety rules: - In production (FABRIC_ENV=production or NODE_ENV=production), choosing stateless is allowed but logged as an explicit choice. - inline (the default) without an explicit SessionStore falls back to in-memory storage. In production this emits a warning unless FABRIC_ALLOW_EPHEMERAL_STATE=1 is set or runtime is explicitly 'stateless'. - Unknown runtime values fall through to 'inline' with a warning.
RESULT_END_DELIMITERvaluePublic export.
RESULT_START_DELIMITERvaluePublic export.
ResultExtractionOptionstypePublic export.
ResultOutcometypePublic export.
ResultToolBundletypePublic export.
ResultUnavailableErrorvalueThrown when the LLM calls the give_up tool, indicating it cannot produce a result that conforms to the required schema.
ResultValidatortypePublic export.
RetrievedChunktypeGeneric, provider-agnostic retrieval seam. RAG is query-time, so it does NOT fit FilesystemSource (an eager full-dump mount) — a retriever resolves the top matches for a query on demand. Databricks Vector Search is the flagship implementation, but this is reusable for any vector store.
RetrieveOptionstypePublic export.
RetrievertypePublic export.
RmInputtypePublic export.
rmToolvaluePublic export.
RoletypePublic export.
runActionvalueValidate input, run the action against host, validate + JSON-clone the output. The returned value is always safely serializable (a fresh JSON clone), so callers can persist or transmit it without sharing references.
RuntimeModeResolutiontypePublic export.
runWithJobInvocationvaluePublic export.
runWithSubmissionContextvalueRun fn with context as the ambient submission correlation.
SandboxAdapterDescriptortypeAdapter expectations: - Every backend must expose the SandboxEnv contract above and map paths into a scoped workspace. - Secrets and provider credentials must stay in adapter-owned environment/config, not model context. - exec should enforce backend-specific command, network, and timeout policy before process launch. - snapshot/restore is optional because not all targets support filesystem or VM snapshots. - Future adapters should be added without changing session/runtime code. Planned backends: local, Docker, Azure Container Apps, Azure Container Instances, AKS, Databricks, E2B, Daytona, C...
SandboxBackendtypePublic export.
SandboxCapabilitiestypePublic export.
SandboxEnvtypePublic export.
SandboxExecOptionstypePublic export.
SandboxFactorytypePublic export.
SandboxFactoryOptionstypePublic export.
SandboxForktypePublic export.
SandboxReftypePublic export.
SandboxRefDecodertypeDecoder for a SerializedSandboxRef.provider. Returns a SandboxFactory that, when invoked, produces a SandboxEnv connected to the existing remote sandbox identified by providerData. Decoders SHOULD attach without owning the remote sandbox's lifecycle — the returned env's cleanup() should detach, not destroy.
SandboxSnapshottypePublic export.
sanitizeObservabilityDatavaluePublic export.
sanitizePublicJsonvaluePublic export.
sanitizePublicTextvalueRemove credentials and host filesystem locations from caller-visible text.
schemavaluePublic export.
SchematypePublic export.
SchemaIssuetypePublic export.
SchemaValidationErrorvaluePublic export.
SearchToolInputtypePublic export.
SearchToolOptionstypePublic export.
SearchToolResulttypePublic export.
secretvaluePublic export.
SecretProvidertypePublic export.
SecretReftypePublic export.
SecretResolutionContexttypePublic export.
secretResolvervalueAdapt a provider to the existing init(&#123; resolveSecret &#125;) callback.
SerializedFabricErrortypePublic export.
SerializedSandboxReftypeCross-process / cross-machine sandbox reference. Created by session.sandboxRef(&#123; portable: true &#125;) and re-attached via attachSandbox(serialized) in a separate process. Each provider string maps to a decoder registered via registerSandboxRefDecoder().
serializeFabricErrorvalueConvert any thrown value into the stable public/developer transport shape.
serializeSandboxRefvalueSerialize an in-process SandboxRef into the cross-process form. Requires the underlying sandbox to implement encodeRef(). Throws SANDBOX_UNAVAILABLE if the backend is in-process-only.
SessionDatatypePublic export.
SessionEntrytypePublic export.
SessionEntryTypetypePublic export.
SessionHistoryvaluePublic export.
SessionMemorytypePublic export.
SessionMemoryEntrytypePersistent key/value store for facts an agent should remember across sessions — borrower preferences, prior outcomes, learned task history. Distinct from SessionEntry (which is the audit log): memory is for recall, entries are for audit. Memory writes do NOT land in the session log, so they don't pollute prompt context unless the agent explicitly reads them. Tenancy: every operation accepts an optional tenantId. Two tenants with the same key get isolated values. tenantId defaults to the empty string for non-tenant deployments.
SessionMemoryFiltertypePublic export.
SessionMemoryGetOptionstypePublic export.
SessionMemorySetInputtypePublic export.
SessionOptionstypePublic export.
SessionStoretypePublic export.
setLoggervalueReplace the global SDK logger. Call once at startup before any init(). Pass a custom Logger to redirect to your structured logging system.
ShellOptionstypePublic export.
shellQuotevaluePublic export.
ShellResulttypePublic export.
SkilltypePublic export.
SkillOptionstypePublic export.
slackApprovalNotifiervalueSlack incoming-webhook notifier. The webhook URL remains in host configuration, never event data.
SnapshotPruneOptionstypePublic export.
SnapshotPruneResulttypePublic export.
StatInputtypePublic export.
statToolvaluePublic export.
StdioMcpClientvaluePublic export.
StdioMcpClientOptionstypePublic export.
StoredAttachmenttypePublic export.
StreamListenerRegistryvalueProcess-local listener registry shared by store implementations — registration, unsubscribe-and-prune, and error-swallowing notify.
SttEventtypePublic export.
SttProvidertypePublic export.
SttSessiontypePublic export.
SttSessionOptionstypePublic export.
SttSessionUsagetypePublic export.
StubFabricAgentvaluePublic export.
StubFabricSessionvaluePublic export.
SubmissionAbortedErrorvaluePublic export.
SubmissionAdmissionBackendtypeStorage callbacks for admitSubmissionWithBackend. Every callback runs inside the transaction the caller has already opened (or the backend's equivalent atomicity scope). Callbacks may return plain values (synchronous backends) or native Promises — non-native thenables are not supported.
SubmissionAdmissionRowtypeThe minimal shape admitSubmissionWithBackend needs from a persisted submission row: the transport kind and persisted payload it compares against the incoming admission. payload may be the serialized JSON string or an already-deserialized object (e.g. a Postgres JSONB column).
SubmissionAttemptReftypePublic export.
SubmissionClaimReftypePublic export.
SubmissionContexttypePublic export.
SubmissionDurabilitytypePublic export.
SubmissionExecuteOptionstypePublic export.
SubmissionExecutortypeHow the runner touches sessions. execute applies the submission's input to the addressed instance session and resolves with the turn result; everything else is store-level and must not require a live agent. Contract requirements: - execute must be idempotent by submission id (a resumed attempt whose input entry already exists must not append it again). - recordTerminal settles the conversation to a deterministic rest state (unresolved trailing tool calls get explicit interrupted-outcome markers — NEVER re-executed) and appends a terminal advisory. - appendSettlement appends the cano...
SubmissionInsertRowtypeThe queued row that admitSubmissionWithBackend writes on first admission.
SubmissionInspectiontypeCoarse persisted-progress classification consumed by reconciliation.
SubmissionInterruptedErrorvaluePublic export.
SubmissionInterruptiontypePublic export.
SubmissionPayloadContexttypeContext needed for submission payload validation. Implementations extract these fields from their storage-specific row/document type before calling isSubmissionPayload.
SubmissionRetryExhaustedErrorvaluePublic export.
SubmissionRunnertypePublic export.
SubmissionRunnerOptionstypePublic export.
submissionSessionKeyvalueStore-session FIFO key of a submission (re-exported convenience).
SubmissionSettledRecordtypeMinimal canonical settlement record for a direct submission. The conversation-stream phase reuses this shape as the durable terminal record a reconnecting waiter observes.
SubmissionSettlementtypePublic export.
submissionSettlementEntryIdvalueDeterministic canonical settlement entry id for a submission.
SubmissionSettlementObligationtypePublic export.
submissionStoreSessionIdvalueThe harness identity string (agent:&lt;name&gt;:&lt;id&gt;:&lt;session&gt;) targeted by a submission input. This is the persistentStoreSessionId of the addressed instance session and the per-session FIFO key of the store.
SubmissionTelemetryEventtypePublic export.
SubmissionTelemetrySinktypePublic export.
SubmissionTimeoutErrorvaluePublic export.
SuspendingSandboxEnvvalueDecorator that adds idle-based auto-suspend to any SandboxEnv whose underlying implementation supports suspend() / resume(). If the inner env doesn't implement them, the decorator is a no-op pass-through (the idle timer never fires anything). The decorator tracks a lastAccessAt timestamp on every operation. After idleSuspendMs elapses without activity, it calls inner.suspend(). The next operation transparently calls inner.resume() first (unless autoResumeOnAccess: false). cleanup() cancels the idle timer.
SuspendingSandboxOptionstypePublic export.
TaskOptionstypePublic export.
TelemetryExportertypePublic export.
TelemetrySpantypePublic export.
tenantCostLimitvalueSugar over CostLimit.perScope + scopeKey + store for the common "per-tenant ceiling per period" pattern. Pick one of perDayUsd, perHourUsd, or perMonthUsd; when multiple are set, the most restrictive (smallest absolute) wins. Scope key convention: tenant:&lt;id&gt;:&lt;period&gt; where &lt;period&gt; is day:YYYY-MM-DD, hour:YYYY-MM-DDTHH:00Z, or month:YYYY-MM. Reset semantics (rollover) are the host's job — call store.reset(scopeKey) from a scheduled task to clear the period total. See the package declarations for an example.
TenantCostLimittypePublic export.
toFabricErrorvaluePublic export.
tokenBucketRateLimitervalueIn-memory token-bucket rate limiter. Each key has its own bucket — keys are independent (waiting on one key doesn't block another). Buckets refill continuously at tokensPerSecond.
TokenBucketRateLimiterOptionstypePublic export.
ToolCalltypePublic export.
ToolCallResulttypePublic export.
ToolContexttypePublic export.
ToolDeftypePublic export.
ToolEffecttypePublic export.
ToolPolicytypePublic export.
toolsToModelSchemasvaluePublic export.
toOpenAIMessagevaluePublic export.
toOpenAIToolvaluePublic export.
TtsProvidertypePublic export.
TtsSynthesisOptionstypePublic export.
TtsSynthesisUsagetypePublic export.
TurnJournalStatetypePublic export.
UnimplementedSandboxEnvvaluePublic export.
unregisterSandboxvalueMark a registered sandbox as dead so future attach attempts fail. Called from the owner session's cleanup path.
unregisterSandboxRefDecodervalueTest/internal: remove a decoder.
validateResultvaluePublic export.
VERCEL_AI_GATEWAY_BASE_URLvalueDefault base URL for Vercel AI Gateway's OpenAI-compatible Chat Completions endpoint. The gateway accepts the standard OpenAI request body and routes through to the configured provider; switching from OpenAI to the gateway is just a base-URL change. See https://vercel.com/docs/ai-gateway/sdks-and-apis/openai-compat
vercelAIGatewayvalueVercel AI Gateway model provider. The gateway is an OpenAI-compatible HTTP endpoint that brokers between your agent and any of the major model providers (OpenAI, Anthropic, Google, xAI, Groq, etc.) with a single key, observability, caching, and spend controls. Use this provider on any deploy target — Node, Cloudflare Workers, Vercel — to route inference through the gateway. See the package declarations for an example. Returns an OpenAICompatibleModelProvider configured for the gateway — use it anywhere a ModelProvider is accepted. Compatible with fabric-harness's tool-calling, retries,...
VercelAIGatewayProviderOptionstypePublic export.
verifyAttachmentBytesvalueVerify that bytes match the ref's digest (and declared size), throwing AttachmentStoreError('DIGEST_MISMATCH') otherwise. Every store's put MUST run this check before persisting.
verifyHmacSha256valueConstant-time HMAC-SHA256 verification (via crypto.subtle.verify).
VertexAIModelProvidervaluePublic export.
VertexAIProviderOptionstypePublic export.
VirtualSandboxEnvvalueVirtual sandbox backend powered by just-bash. Provides an in-memory filesystem and a bash subset (grep, glob, cat, read, mkdir, rm, ls, echo, etc.) without shelling out to the host. The backend is fast, cheap, safe, and high-concurrency. Selected automatically by the bare @fabric-harness/sdk import when the caller doesn't pass sandbox. Override with 'local', 'docker', a SandboxFactory, or a SandboxEnv when you need real shell access.
VoiceAudioFormattypeBidirectional voice / audio streaming surface. fabric-harness ships an OpenAI Realtime implementation; bring-your-own-vendor for Anthropic / Gemini Live / on-prem TTS+ASR pipelines. Audio frames flow in raw bytes — the standard format is PCM 16-bit little-endian at 24kHz mono (OpenAI Realtime default). Telephony bridges (Twilio Media Streams μ-law 8kHz, etc.) resample at the edge. Tool execution is the caller's responsibility: a tool_call event surfaces, the host code runs the tool through whatever governance gates apply (approvals, cost caps, rate limits), then calls `submitToolResult(...
VoiceConnectOptionstypePublic export.
VoiceEventtypeEvents streamed from a VoiceSession. audio_delta carries raw audio bytes; text_delta and transcript carry text; tool_call and response_done mark structured boundaries; error is fatal.
VoiceProvidertypePublic export.
VoiceSessiontypePublic export.
VoiceToolResultInputtypePublic export.
VoiceWsClientEventtypePublic export.
VoiceWsClientHandletypePublic export.
VoiceWsClientOptionstypeLightweight WebSocket client for the fh server WS /sessions/:id/voice endpoint. Server-side bridge owns the provider connection and API keys; this client just streams audio + control messages over WS. Works in browsers and on Node 22+ (uses the global WebSocket).
webhookApprovalNotifiervaluePublic export.
WebhookSubscriptionContexttypeGeneric webhook subscription primitive — wakes an agent on inbound events from any external system (event bus, queue, scheduler, third-party SaaS webhook, your own application's domain events). fabric-harness consumes a JSON payload and dispatches to the user-provided handler. The host event system decides which payloads land here; fabric-harness has no opinion on event taxonomy or producer.
WebhookSubscriptionDefinitiontypePublic export.
withConversationProjectionvalueWrap a SessionStore so active-path appends are mirrored into an append-only ConversationStreamStore projection (v2 A4). The SessionEntry DAG stays the single source of truth; the stream gives clients offset-based catch-up + live tail. Two rules keep them coherent: 1. Idempotent by entryId — a crash between the DAG write and the stream write is repaired on the next append: the projector diffs the stream tail against the active path and re-emits anything missing. 2. Truncation is explicit — the DAG can branch (fork/replay/ checkpoint-restore rewrite leafId); the stream cannot. W...
withFilesystemSourcesvaluePublic export.
withIdleSuspendvalueWrap any SandboxEnv with idle-based auto-suspend. Returns the inner env unchanged when idleSuspendMs is undefined or the inner env doesn't implement suspend().
WriteFileInputtypePublic export.
writeFileToolvaluePublic export.
WsClientCommandtypePublic export.
WsClientHandletypePublic export.
WsClientOptionstypeLightweight WebSocket client for the fh server WS /sessions/:id/ws endpoint. Works in browsers and on Node 22+ (uses the global WebSocket). Does NOT depend on the ws package — that's the server side's optional peer dep.

@fabric-harness/sdk/cloudflare

ExportKindSummary
CloudflareR2BucketLiketypePublic export.
CloudflareR2ListResultLiketypePublic export.
CloudflareR2ObjectBodyLiketypePublic export.
r2FilesystemSourcevalueRead Cloudflare R2 objects as a Fabric filesystem source. Mount it with withFilesystemSources() (or getVirtualSandbox(...)) so agents can grep/read R2-backed knowledge bases through the normal sandbox tools. See the package declarations for an example.
R2FilesystemSourceOptionstypePublic export.

@fabric-harness/sdk/channel

ExportKindSummary
bytesToHexvaluePublic export.
ChanneltypePublic export.
ChannelContexttypePublic export.
ChannelDispatchtypePublic export.
ChannelDispatchRequesttypePublic export.
ChannelRoutetypeChannels turn platform webhooks (Slack, GitHub, …) into agent dispatches. Handlers are written against the Web Request/Response API and crypto.subtle, so the same channel runs on Node and Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer — session continuity falls out of the key (same thread → same key → same session).
conversationKeyvaluePublic export.
defineChannelvalueValidates and brands a channel's routes.
defineToolvalueEdge-safe identity helper equivalent to the root SDK's defineTool.
hexToBytesvaluePublic export.
hmacSha256valuePublic export.
parseConversationKeyvaluePublic export.
ParsedConversationKeytypePublic export.
readJsonBodyvalueReads the body once and returns the raw bytes, the decoded text, and the parsed JSON together — so a channel can HMAC-verify the exact bytes and use the JSON without re-reading the (already consumed) stream. Returns undefined only when the body exceeds limitBytes.
readRequestBodyvalueReads the full request body as bytes, or returns undefined if it exceeds limitBytes. NOTE: this consumes the request stream (single read). Signature-verifying channels need the exact bytes for HMAC and the parsed JSON afterward — don't call request.json() as well. Use readJsonBody to get both from one read.
RequestBodytypePublic export.
ToolDeftypePublic export.
ToolEffecttypePublic export.
verifyHmacSha256valueConstant-time HMAC-SHA256 verification (via crypto.subtle.verify).

@fabric-harness/sdk/experimental

ExportKindSummary
createPiAgentLoopRuntimevaluePublic export.
PiAgentLoopRuntimevaluePublic export.
PiAgentLoopRuntimeOptionstypePublic export.
PiCustomModeltypePublic export.
policiedSandboxEnvvalueWrap a SandboxEnv with CapabilityPolicy enforcement at the sandbox layer. Without this decorator, agent code that calls (await session.sandbox).exec(...) directly bypasses the policy that session.shell() and tool dispatch enforce. policiedSandboxEnv() closes that gap by re-running the same policy evaluation against exec / readFile / writeFile / mkdir / rm / etc. Throws FabricError: - COMMAND_DENIED when an exec is denied or requires approval. - POLICY_DENIED when a filesystem op is denied or requires approval. The decorator does NOT auto-resolve requireApproval p...
SuspendingSandboxEnvvalueDecorator that adds idle-based auto-suspend to any SandboxEnv whose underlying implementation supports suspend() / resume(). If the inner env doesn't implement them, the decorator is a no-op pass-through (the idle timer never fires anything). The decorator tracks a lastAccessAt timestamp on every operation. After idleSuspendMs elapses without activity, it calls inner.suspend(). The next operation transparently calls inner.resume() first (unless autoResumeOnAccess: false). cleanup() cancels the idle timer.
SuspendingSandboxOptionstypePublic export.
withIdleSuspendvalueWrap any SandboxEnv with idle-based auto-suspend. Returns the inner env unchanged when idleSuspendMs is undefined or the inner env doesn't implement suspend().

@fabric-harness/sdk/otel-observer

ExportKindSummary
createOpenTelemetryObservervaluePublic export.
OpenTelemetryObserverOptionstypeBuild a hierarchical OpenTelemetry trace from Fabric's event stream. Unlike openTelemetryExporter (which emits one flat span per duration-bearing event), this observer nests spans into a tree: prompt/skill operations contain turns, which contain tool / shell spans, with task sub-work nested under the active operation. The result is a single parent trace per operation that visualizes the full agent run. This module lives on the @fabric-harness/sdk/otel-observer subpath (not the main entry) because building parent contexts requires @opentelemetry/api at runtime; the main SDK...

@fabric-harness/sdk/testing

ExportKindSummary
MockModelProvidervaluePublic export.
StubFabricAgentvaluePublic export.
StubFabricSessionvaluePublic export.

@fabric-harness/sdk/testing/contracts

ExportKindSummary
AttachmentStoreContractHandletypePublic export.
ChannelContractDispatchtypePublic export.
ChannelContractFixturetypePublic export.
ChannelContractRequesttypePublic export.
ConversationStreamStoreContractHandletypePublic export.
defineAttachmentStoreContractTestsvalueRegister the standard AttachmentStore contract tests under the given describe label. Each test gets a fresh store from factory().
defineChannelContractTestsvalueShared behavioral contract for first-party and community channel adapters.
defineConversationStreamStoreContractTestsvalueRegister the standard ConversationStreamStore contract tests under the given describe label. Each test gets a fresh store from factory().
definePersistenceBundleContractTestsvalueCompose all store contracts with bundle health, cost, run, and cascade checks.
defineSubmissionStoreContractTestsvalueRegister the standard AgentSubmissionStore contract tests under the given describe label. Each test gets a fresh store from factory().
PersistenceBundleContractHandletypePublic export.
SubmissionStoreContractHandletypePublic export.

@fabric-harness/temporal

@fabric-harness/temporal

ExportKindSummary
ActivityIdempotencytypePublic export.
ActivityTimeoutPolicytypePublic export.
adaptSessionRuntimevalueAdapt any SessionRuntime (Temporal-backed, Mock, or otherwise) into the SDK's DurableSessionRuntime shape. The two interfaces are structurally identical, but the type bridging keeps SDK types out of the temporal package's public API.
AppendSessionEntryActivityInputtypePublic export.
AppendSessionEntryActivityResulttypePublic export.
AppendSessionEventActivityInputtypePublic export.
APPROVAL_SIGNALvaluePublic export.
approvalSignalvaluePublic export.
ApprovalSignaltypePublic export.
BuildContextActivityInputtypePublic export.
BuildContextActivityResulttypePublic export.
CHECKPOINT_CREATE_WORKFLOW_NAMEvaluePublic export.
CHECKPOINT_RESTORE_WORKFLOW_NAMEvaluePublic export.
CheckpointActivityInputtypePublic export.
CheckpointActivityResulttypePublic export.
checkpointCreateWorkflowvaluePublic export.
checkpointRestoreWorkflowvaluePublic export.
CompactSessionActivityInputtypePublic export.
CompactSessionActivityResulttypePublic export.
connectTemporalWithRetryvaluePublic export.
createInlineSessionRuntimevaluePublic export.
createLocalTemporalActivitiesvaluePublic export.
createMockTemporalRuntimevaluePublic export.
createTemporalClientvaluePublic export.
createTemporalClientConnectionOptionsvaluePublic export.
createTemporalDispatchActivitiesvalueWrap a DispatchProcessor as a Temporal activity. The processor is idempotent by dispatchId, so Temporal retries are safe.
CreateTemporalDispatchActivitiesOptionstypePublic export.
createTemporalSessionRuntimeActivitiesvaluePublic export.
CreateTemporalSessionRuntimeActivitiesOptionstypePublic export.
createTemporalWorkerConnectionOptionsvaluePublic export.
CUSTOM_APPROVAL_WORKFLOW_NAMEvaluePublic export.
customApprovalWorkflowvalueDurable custom approval gate used by session.approval.request().
CustomApprovalWorkflowInputtypePublic export.
DEFAULT_TEMPORAL_ACTIVITY_TIMEOUTSvaluePublic export.
DEFAULT_TEMPORAL_ADDRESSvalueDefault Temporal frontend address used by CLI / build scaffolds when nothing is configured.
DEFAULT_TEMPORAL_NAMESPACEvalueDefault namespace.
DEFAULT_TEMPORAL_TASK_QUEUEvalueDefault task queue name.
defineTemporalAgentvaluePublic export.
DefineTemporalAgentOptionstypePublic export.
DISPATCH_WORKFLOW_NAMEvaluePublic export.
dispatchWorkflowvalueDurable dispatch: applies one dispatched input to a persistent instance via the processDispatch activity. The activity is idempotent by dispatchId, so Temporal retries (and worker restarts) won't double-apply.
ExecuteToolActivityInputtypePublic export.
ExecuteToolActivityResulttypePublic export.
HYBRID_PROMPT_WORKFLOW_NAMEvaluePublic export.
hybridPromptWorkflowvalueHybrid durable prompt workflow. The workflow owns deterministic turn orchestration while activities perform nondeterministic effects: context construction, model calls, tool execution, approval policy checks, and durable entry/event appends.
InlineSessionRuntimevaluePublic export.
LoadSessionActivityInputtypePublic export.
LocalTemporalActivitiesOptionstypePublic export.
MockTemporalClientvalueMinimal mock Temporal client that satisfies enough of the TemporalClientHandle interface for agent tests. Delegates SessionRuntime calls to MockTemporalRuntime.
MockTemporalModelProvidervalueMinimal mock model provider for Temporal agent tests. Returns deterministic responses based on the latest user message.
MockTemporalRuntimevaluePublic export.
MockTemporalRuntimeOptionstypePublic export.
ModelGenerateActivityInputtypePublic export.
ModelGenerateActivityResulttypePublic export.
PendingApprovalStatetypePublic export.
PROMPT_WORKFLOW_NAMEvaluePublic export.
promptWorkflowvalueCoarse one-shot prompt workflow. Useful as a compatibility path while the hybrid loop is still gaining lower-level activity implementations.
PromptWorkflowInputtypePublic export.
PromptWorkflowResulttypePublic export.
requireIdempotencyvaluePublic export.
ResolvedTemporalConnectionConfigtypePublic export.
ResolveSecretActivityInputtypePublic export.
resolveTemporalConnectionConfigvaluePublic export.
resolveToolRefsvaluePublic export.
RuntimeCheckpointCreateActivityInputtypePublic export.
RuntimeCheckpointRestoreActivityInputtypePublic export.
RuntimePromptActivityInputtypePublic export.
RuntimeShellActivityInputtypePublic export.
SESSION_STATE_QUERYvaluePublic export.
SessionRuntimetypePublic export.
SessionRuntimeApprovalInputtypePublic export.
SessionRuntimeCheckpointCreateInputtypePublic export.
SessionRuntimeCheckpointRestoreInputtypePublic export.
SessionRuntimeFactorytypePublic export.
SessionRuntimePromptInputtypePublic export.
SessionRuntimeShellInputtypePublic export.
SessionRuntimeTaskInputtypePublic export.
sessionStateQueryvaluePublic export.
sessionWorkflowvalueLong-lived session coordination workflow. This first production Temporal integration supports approval signaling and state queries. Prompt/shell/checkpoint operations are workflows below.
SessionWorkflowDefinitiontypePublic export.
SHELL_WORKFLOW_NAMEvaluePublic export.
shellWorkflowvaluePublic export.
SnapshotReftypePublic export.
startTemporalWorkervaluePublic export.
TASK_WORKFLOW_NAMEvaluePublic export.
taskWorkflowvaluePublic export.
TaskWorkflowInputtypePublic export.
temporalvaluePublic export.
TemporalActivitiestypePublic export.
TemporalActivityTimeoutstypePublic export.
temporalAgentvaluePublic export.
TemporalAgentOptionstypePublic export.
TemporalBundletypePublic export.
TemporalBundleConfigtypePublic export.
TemporalClientHandletypePublic export.
TemporalClientOptionstypePublic export.
TemporalConnectionConfigtypePublic export.
TemporalConnectRetryOptionstypePublic export.
TemporalDispatchActivitiestypeActivity that durably applies a dispatched input to a persistent instance.
TemporalDispatchClientLiketypeMinimal Temporal client surface needed to start a dispatch workflow.
temporalDispatchQueuevalueDurable dispatch queue. enqueue starts a dispatchWorkflow keyed by the dispatchId, so delivery survives worker/process restarts and a duplicate dispatchId maps to the same workflow id (idempotent admission). Implements the SDK's DispatchQueue; pair with createTemporalDispatchActivities on the worker. When runtime: 'temporal' is configured, this is the default dispatch queue (D4) unless an explicit queue is supplied.
TemporalDispatchQueueOptionstypePublic export.
TemporalIntegrationModetypePublic export.
TemporalPromptWorkflowModetypePublic export.
TemporalRunStatustypePublic export.
TemporalRuntimeOptionstypePublic export.
temporalSessionRuntimevalueBuild a DurableSessionRuntimeFactory for init(&#123; sessionRuntime &#125;) that delegates each session's prompt/task/shell/checkpoint calls to a Temporal workflow. The Temporal client connection is opened lazily on the first session and shared across all sessions produced by this factory. Pair with runtime: 'temporal' for production deployments. For tests, pass mode: 'mock' to use the in-process mock runtime. See the package declarations for an example.
TemporalSessionRuntimevaluePublic export.
TemporalSessionRuntimeActivitiestypePublic export.
TemporalSessionWorkflowInputtypePublic export.
TemporalSignalClienttypePublic export.
TemporalTlsConfigtypePublic export.
TemporalWorkerHandletypePublic export.
TemporalWorkerOptionstypePublic export.
TemporalWorkflowQueryStatetypePublic export.
ToolApprovalRequesttypePublic export.

@fabric-harness/temporal/agent

ExportKindSummary
defineTemporalAgentvaluePublic export.
DefineTemporalAgentOptionstypePublic export.
resolveToolRefsvaluePublic export.
temporalvaluePublic export.
temporalAgentvaluePublic export.
TemporalAgentOptionstypePublic export.
TemporalBundletypePublic export.
TemporalBundleConfigtypePublic export.

On this page

@fabric-harness/azure@fabric-harness/azure@fabric-harness/azure/aks-sandbox@fabric-harness/azure/app-insights@fabric-harness/azure/foundry-runtime@fabric-harness/azure/agent@fabric-harness/channels@fabric-harness/channels@fabric-harness/channels/compatibility@fabric-harness/channels/slack@fabric-harness/channels/github@fabric-harness/channels/discord@fabric-harness/channels/teams@fabric-harness/channels/telegram@fabric-harness/channels/twilio@fabric-harness/channels/whatsapp@fabric-harness/channels/google-chat@fabric-harness/channels/linear@fabric-harness/channels/notion@fabric-harness/channels/stripe@fabric-harness/channels/zendesk@fabric-harness/channels/intercom@fabric-harness/channels/shopify@fabric-harness/channels/messenger@fabric-harness/channels/resend@fabric-harness/channels/salesforce-marketing-cloud@fabric-harness/cli@fabric-harness/cli@fabric-harness/cli/config@fabric-harness/cloudflare@fabric-harness/cloudflare@fabric-harness/cloudflare/agent@fabric-harness/cloudflare/workers-ai@fabric-harness/cloudflare/shell@fabric-harness/cloudflare/scheduled@fabric-harness/cloudflare/persistence@fabric-harness/connectors@fabric-harness/connectors@fabric-harness/connectors/s3@fabric-harness/connectors/azure-blob@fabric-harness/connectors/gcs@fabric-harness/connectors/github@fabric-harness/connectors/databricks-volume@fabric-harness/connectors/k8s@fabric-harness/connectors/vercel@fabric-harness/connectors/modal@fabric-harness/connectors/sandbox-refs@fabric-harness/connectors/sandbox-certification@fabric-harness/databases@fabric-harness/databases@fabric-harness/databases/postgres@fabric-harness/databases/mysql@fabric-harness/databases/sqlite@fabric-harness/databases/mongodb@fabric-harness/databases/redis@fabric-harness/databricks@fabric-harness/databricks@fabric-harness/databricks/agent@fabric-harness/databricks/sql-sandbox@fabric-harness/node@fabric-harness/node@fabric-harness/node/agent@fabric-harness/node/docker-agent@fabric-harness/node/k8s-agent@fabric-harness/sdk@fabric-harness/sdk@fabric-harness/sdk/strict@fabric-harness/sdk/cloudflare@fabric-harness/sdk/channel@fabric-harness/sdk/experimental@fabric-harness/sdk/otel-observer@fabric-harness/sdk/testing@fabric-harness/sdk/testing/contracts@fabric-harness/temporal@fabric-harness/temporal@fabric-harness/temporal/agent