@lastshotlabs/slingshot-orchestration
npm install @lastshotlabs/slingshot-orchestration
Functions
Section titled “Functions”createOrchestrationPackage
Section titled “createOrchestrationPackage”Create the Slingshot integration package for the portable orchestration runtime.
Publishes the runtime through OrchestrationRuntimeCap, bridges lifecycle events
onto ctx.bus, optionally mounts HTTP routes, and manages adapter startup/shutdown
when an adapter instance is provided instead of a pre-built runtime.
function createOrchestrationPackage(options: ConfigurableOrchestrationPluginOptions,): SlingshotPackageDefinitionSource: packages/slingshot-orchestration/src/plugin.ts
createSlingshotEventSink
Section titled “createSlingshotEventSink”Adapt orchestration lifecycle events onto Slingshot’s event bus.
Errors thrown by the bus are caught and logged so that a broken or misconfigured
event bus never disrupts orchestration task execution. The returned sink owns
any subscriptions registered through subscribe() and provides dispose() so
the plugin teardown can release them.
function createSlingshotEventSink(bus: SlingshotEventBus): SlingshotEventSinkSource: packages/slingshot-orchestration/src/eventSink.ts
getOrchestration
Section titled “getOrchestration”Read the orchestration runtime published by createOrchestrationPackage().
Resolves through the typed OrchestrationRuntimeCap contract capability. Throws
when the plugin has not been registered for the current app instance.
Equivalent to ctx.capabilities.require(OrchestrationRuntimeCap) — the contract
handle is the canonical way to consume this surface; this helper exists for
call-site ergonomics and back-compat with documented examples.
function getOrchestration(ctx: SlingshotContext): OrchestrationRuntimeSource: packages/slingshot-orchestration/src/context.ts
getOrchestrationOrNull
Section titled “getOrchestrationOrNull”Read the orchestration runtime through the typed contract, returning null when the
plugin is not present.
function getOrchestrationOrNull(ctx: SlingshotContext): OrchestrationRuntime | nullSource: packages/slingshot-orchestration/src/context.ts
orchestrationPluginConfigSchema
Section titled “orchestrationPluginConfigSchema”Manifest schema for the Slingshot orchestration plugin configuration.
Config Fields
Section titled “Config Fields”| Field | Description |
|---|---|
adapter | Adapter selection and its backend-specific configuration. |
routePrefix | URL prefix for orchestration routes (e.g. ‘/orchestration’). |
routes | Mount the orchestration HTTP API routes. Defaults to false. |
routeTimeoutMs | Per-request timeout in milliseconds for orchestration HTTP route adapter calls. |
tasks | Handler names of tasks to register with the orchestration runtime. |
workflows | Handler names of workflows to register. Omit when only tasks are used. |
Source: packages/slingshot-orchestration/src/validation.ts
Constants
Section titled “Constants”Orchestration
Section titled “Orchestration”Provider-owned package contract for slingshot-orchestration.
Source: packages/slingshot-orchestration/src/public.ts
ORCHESTRATION_PLUGIN_STATE_KEY
Section titled “ORCHESTRATION_PLUGIN_STATE_KEY”Plugin name used for registration, dependency declarations, and event ownership.
Source: packages/slingshot-orchestration/src/context.ts
OrchestrationRuntimeCap
Section titled “OrchestrationRuntimeCap”Typed capability handle resolving to the orchestration runtime.
Source: packages/slingshot-orchestration/src/public.ts
Classes
Section titled “Classes”InvalidResolverResultError
Section titled “InvalidResolverResultError”Errors thrown by the orchestration plugin integration layer.
Source: packages/slingshot-orchestration/src/errors.ts
Interfaces
Section titled “Interfaces”OrchestrationRequestContext
Section titled “OrchestrationRequestContext”Request-scoped orchestration metadata resolved by the HTTP layer before a run is started or authorized.
Source: packages/slingshot-orchestration/src/types.ts
OrchestrationRunAuthorizationInput
Section titled “OrchestrationRunAuthorizationInput”Input passed to custom run-authorization hooks for reads, listing, signals, and cancellations.
Source: packages/slingshot-orchestration/src/types.ts
ConfigurableOrchestrationPluginOptions
Section titled “ConfigurableOrchestrationPluginOptions”Full code-first orchestration plugin options, including optional HTTP route hooks.
Source: packages/slingshot-orchestration/src/types.ts
OrchestrationPluginConfig
Section titled “OrchestrationPluginConfig”Canonical configuration name for the orchestration plugin.
Source: packages/slingshot-orchestration/src/types.ts
OrchestrationPluginOptions
Section titled “OrchestrationPluginOptions”Options for wiring the portable orchestration runtime into a Slingshot app.
Pass either a prebuilt runtime or a concrete adapter plus task/workflow
definitions. When routes is enabled, routeMiddleware must contain at least
one guard so the HTTP surface is never mounted unprotected by accident.
Source: packages/slingshot-orchestration/src/types.ts
OrchestrationRequestContextResolver
Section titled “OrchestrationRequestContextResolver”Hook that maps an HTTP request onto orchestration tenant/actor metadata without coupling the router to a specific identity package.
Source: packages/slingshot-orchestration/src/types.ts
OrchestrationRunAuthorizer
Section titled “OrchestrationRunAuthorizer”Hook that decides whether a caller can view or control a specific run.
Source: packages/slingshot-orchestration/src/types.ts
ResolvedOrchestrationPluginOptions
Section titled “ResolvedOrchestrationPluginOptions”Fully resolved orchestration plugin options after declarative configuration has been normalized. Combines the adapter/runtime choice with the optional HTTP route hooks for the orchestration API surface.
Source: packages/slingshot-orchestration/src/types.ts