integration.workflow-devkit
Workflow DevKit compiler and runtime bridges for ContractSpec workflows
@lssm-tech/integration.workflow-devkitbun add @lssm-tech/integration.workflow-devkitManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Workflow DevKit compiler and runtime bridges for ContractSpec WorkflowSpec.
What it provides
- Compile a
WorkflowSpecinto a deterministic Workflow DevKit manifest. - Generate Workflow, Next.js, and generic-host scaffolding.
- Run a
WorkflowSpecthrough injected Workflow DevKit primitives such assleep, hooks, and webhooks. - Create a Workflow-backed
AgentRuntimeAdapterBundlefor@lssm-tech/lib.ai-agent. - Expose chat route helpers and re-export
WorkflowChatTransportfor reconnectable chat UIs.
Entry points
@lssm-tech/integration.workflow-devkit@lssm-tech/integration.workflow-devkit/compiler@lssm-tech/integration.workflow-devkit/runtime@lssm-tech/integration.workflow-devkit/chat-routes@lssm-tech/integration.workflow-devkit/agent-adapter@lssm-tech/integration.workflow-devkit/next
Workflow vs step boundary
Workflow DevKit code runs across two different execution contexts:
- Workflow functions (
"use workflow") orchestrate control flow and must stay deterministic. - Step functions (
"use step") perform the actual Node.js work.
This matches the Workflow docs: workflow functions do not have full Node.js access, while step functions do. Keep Node.js core modules, SDK clients, database access, and other side effects inside use step helpers. The workflow function itself should only compose Workflow primitives and call step helpers.
For WorkflowSpec authoring in Workflow-hosted apps, import the safe authoring API from @lssm-tech/lib.contracts-spec/workflow/spec, not the broad @lssm-tech/lib.contracts-spec/workflow barrel.
Next.js example
import { withContractSpecWorkflow } from "@lssm-tech/integration.workflow-devkit/next";
import { createWorkflowChatRoutes } from "@lssm-tech/module.ai-chat/core/workflow";
export default withContractSpecWorkflow({
experimental: {},
});
const routes = createWorkflowChatRoutes({
workflow: async (payload) => payload,
getFollowUpToken({ runId }) {
return `chat:${runId}`;
},
});
export const POST = routes.start;Generic host example
import { createHook, createWebhook, sleep } from "workflow";
import {
runWorkflowSpecWithWorkflowDevkit,
type WorkflowDevkitRuntimeBridge,
} from "@lssm-tech/integration.workflow-devkit";
import { onboardingWorkflow } from "./onboarding.workflow";
export async function runOnboarding(input: Record<string, unknown>, bridge: WorkflowDevkitRuntimeBridge) {
"use workflow";
// Keep this function deterministic. Node.js work belongs in `use step`
// helpers that your bridge dispatches to.
return runWorkflowSpecWithWorkflowDevkit({
spec: onboardingWorkflow,
initialData: input,
bridge,
primitives: {
sleep,
createHook,
createWebhook,
},
});
}Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
8 declarations
@lssm-tech/lib.ai-agentworkspace:^
Read the package manual ↗@lssm-tech/lib.orchestration-specworkspace:^
Read the package manual ↗@lssm-tech/lib.workflow-composerworkspace:^
Read the package manual ↗@workflow/ai^4.2.1
ai^6.0.286
workflow^4.8.9
Declared capabilities
Workflow DevKit compiler and runtime bridges for ContractSpec workflows
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typesdevcontractspec-bun-build devcleanrimraf dist .turbolintbun lint:fixlint:fixnode ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .lint:checknode ../../../scripts/biome.cjs check .testbun testprebuildcontractspec-bun-build prebuildtypechecktsgo --noEmit