Skip to content

@lastshotlabs/slingshot-orchestration

npm install @lastshotlabs/slingshot-orchestration

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,): SlingshotPackageDefinition

Source: packages/slingshot-orchestration/src/plugin.ts

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): SlingshotEventSink

Source: packages/slingshot-orchestration/src/eventSink.ts

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): OrchestrationRuntime

Source: packages/slingshot-orchestration/src/context.ts

Read the orchestration runtime through the typed contract, returning null when the plugin is not present.

function getOrchestrationOrNull(ctx: SlingshotContext): OrchestrationRuntime | null

Source: packages/slingshot-orchestration/src/context.ts

Manifest schema for the Slingshot orchestration plugin configuration.

FieldDescription
adapterAdapter selection and its backend-specific configuration.
routePrefixURL prefix for orchestration routes (e.g. ‘/orchestration’).
routesMount the orchestration HTTP API routes. Defaults to false.
routeTimeoutMsPer-request timeout in milliseconds for orchestration HTTP route adapter calls.
tasksHandler names of tasks to register with the orchestration runtime.
workflowsHandler names of workflows to register. Omit when only tasks are used.

Source: packages/slingshot-orchestration/src/validation.ts

Provider-owned package contract for slingshot-orchestration.

Source: packages/slingshot-orchestration/src/public.ts

Plugin name used for registration, dependency declarations, and event ownership.

Source: packages/slingshot-orchestration/src/context.ts

Typed capability handle resolving to the orchestration runtime.

Source: packages/slingshot-orchestration/src/public.ts

Errors thrown by the orchestration plugin integration layer.

Source: packages/slingshot-orchestration/src/errors.ts

Request-scoped orchestration metadata resolved by the HTTP layer before a run is started or authorized.

Source: packages/slingshot-orchestration/src/types.ts

Input passed to custom run-authorization hooks for reads, listing, signals, and cancellations.

Source: packages/slingshot-orchestration/src/types.ts

Full code-first orchestration plugin options, including optional HTTP route hooks.

Source: packages/slingshot-orchestration/src/types.ts

Canonical configuration name for the orchestration plugin.

Source: packages/slingshot-orchestration/src/types.ts

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

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

Hook that decides whether a caller can view or control a specific run.

Source: packages/slingshot-orchestration/src/types.ts

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