@contractspec/integration.workflow-devkit 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/browser/compiler.js +3 -0
- package/dist/browser/index.js +3 -0
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.js +3 -0
- package/dist/helpers.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/node/compiler.js +3 -0
- package/dist/node/index.js +3 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/types.d.ts +2 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -19,6 +19,17 @@ Workflow DevKit compiler and runtime bridges for ContractSpec `WorkflowSpec`.
|
|
|
19
19
|
- `@contractspec/integration.workflow-devkit/agent-adapter`
|
|
20
20
|
- `@contractspec/integration.workflow-devkit/next`
|
|
21
21
|
|
|
22
|
+
## Workflow vs step boundary
|
|
23
|
+
|
|
24
|
+
Workflow DevKit code runs across two different execution contexts:
|
|
25
|
+
|
|
26
|
+
- Workflow functions (`"use workflow"`) orchestrate control flow and must stay deterministic.
|
|
27
|
+
- Step functions (`"use step"`) perform the actual Node.js work.
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
For `WorkflowSpec` authoring in Workflow-hosted apps, import the safe authoring API from `@contractspec/lib.contracts-spec/workflow/spec`, not the broad `@contractspec/lib.contracts-spec/workflow` barrel.
|
|
32
|
+
|
|
22
33
|
## Next.js example
|
|
23
34
|
|
|
24
35
|
```ts
|
|
@@ -52,6 +63,8 @@ import { onboardingWorkflow } from "./onboarding.workflow";
|
|
|
52
63
|
export async function runOnboarding(input: Record<string, unknown>, bridge: WorkflowDevkitRuntimeBridge) {
|
|
53
64
|
"use workflow";
|
|
54
65
|
|
|
66
|
+
// Keep this function deterministic. Node.js work belongs in `use step`
|
|
67
|
+
// helpers that your bridge dispatches to.
|
|
55
68
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
56
69
|
spec: onboardingWorkflow,
|
|
57
70
|
initialData: input,
|
package/dist/browser/compiler.js
CHANGED
|
@@ -158,6 +158,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
158
158
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
159
159
|
"use workflow";
|
|
160
160
|
|
|
161
|
+
// Keep the workflow function deterministic.
|
|
162
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
163
|
+
// your bridge calls, not in this orchestrator itself.
|
|
161
164
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
162
165
|
spec: ${exportName},
|
|
163
166
|
initialData: input,
|
package/dist/browser/index.js
CHANGED
|
@@ -326,6 +326,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
326
326
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
327
327
|
"use workflow";
|
|
328
328
|
|
|
329
|
+
// Keep the workflow function deterministic.
|
|
330
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
331
|
+
// your bridge calls, not in this orchestrator itself.
|
|
329
332
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
330
333
|
spec: ${exportName},
|
|
331
334
|
initialData: input,
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow';
|
|
1
|
+
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
2
2
|
import type { WorkflowDevkitCompilation, WorkflowDevkitGeneratedArtifacts } from './types';
|
|
3
3
|
export interface CompileWorkflowSpecToWorkflowDevkitOptions {
|
|
4
4
|
exportName: string;
|
package/dist/compiler.js
CHANGED
|
@@ -159,6 +159,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
159
159
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
160
160
|
"use workflow";
|
|
161
161
|
|
|
162
|
+
// Keep the workflow function deterministic.
|
|
163
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
164
|
+
// your bridge calls, not in this orchestrator itself.
|
|
162
165
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
163
166
|
spec: ${exportName},
|
|
164
167
|
initialData: input,
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Step, WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
2
|
-
export declare function inferWorkflowDevkitBehavior(step: Step): import("@contractspec/lib.contracts-spec/workflow").StepType | import("@contractspec/lib.contracts-spec/workflow").WorkflowDevkitStepBehavior;
|
|
2
|
+
export declare function inferWorkflowDevkitBehavior(step: Step): import("@contractspec/lib.contracts-spec/workflow/spec").StepType | import("@contractspec/lib.contracts-spec/workflow/workflow-devkit").WorkflowDevkitStepBehavior;
|
|
3
3
|
export declare function resolveWorkflowDevkitEntryStepId(spec: WorkflowSpec): string;
|
|
4
4
|
export declare function resolveWorkflowDevkitRunIdentity(spec: WorkflowSpec, runIdentity?: string): string;
|
|
5
5
|
export declare function resolveWorkflowDevkitWaitToken(spec: WorkflowSpec, step: Step, runIdentity?: string): string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -327,6 +327,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
327
327
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
328
328
|
"use workflow";
|
|
329
329
|
|
|
330
|
+
// Keep the workflow function deterministic.
|
|
331
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
332
|
+
// your bridge calls, not in this orchestrator itself.
|
|
330
333
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
331
334
|
spec: ${exportName},
|
|
332
335
|
initialData: input,
|
package/dist/node/compiler.js
CHANGED
|
@@ -158,6 +158,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
158
158
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
159
159
|
"use workflow";
|
|
160
160
|
|
|
161
|
+
// Keep the workflow function deterministic.
|
|
162
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
163
|
+
// your bridge calls, not in this orchestrator itself.
|
|
161
164
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
162
165
|
spec: ${exportName},
|
|
163
166
|
initialData: input,
|
package/dist/node/index.js
CHANGED
|
@@ -326,6 +326,9 @@ import { ${exportName} } from "${specImportPath}";
|
|
|
326
326
|
export async function ${workflowFunctionName}(input = {}, bridge = {}) {
|
|
327
327
|
"use workflow";
|
|
328
328
|
|
|
329
|
+
// Keep the workflow function deterministic.
|
|
330
|
+
// Any Node.js or side-effectful logic should live in "use step" helpers that
|
|
331
|
+
// your bridge calls, not in this orchestrator itself.
|
|
329
332
|
return runWorkflowSpecWithWorkflowDevkit({
|
|
330
333
|
spec: ${exportName},
|
|
331
334
|
initialData: input,
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow';
|
|
1
|
+
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
2
2
|
import type { WorkflowDevkitPrimitives, WorkflowDevkitRunResult, WorkflowDevkitRuntimeBridge } from './types';
|
|
3
3
|
export interface RunWorkflowSpecWithWorkflowDevkitOptions {
|
|
4
4
|
bridge?: WorkflowDevkitRuntimeBridge;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Step,
|
|
1
|
+
import type { Step, WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
2
|
+
import type { WorkflowDevkitHostTarget, WorkflowDevkitIntegrationMode, WorkflowDevkitStepBehavior, WorkflowDevkitStepRuntimeConfig } from '@contractspec/lib.contracts-spec/workflow/workflow-devkit';
|
|
2
3
|
import type { UIMessageChunk } from 'ai';
|
|
3
4
|
export interface WorkflowDevkitCompiledTransition {
|
|
4
5
|
condition?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/integration.workflow-devkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Workflow DevKit compiler and runtime bridges for ContractSpec workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -90,15 +90,15 @@
|
|
|
90
90
|
"typecheck": "tsc --noEmit"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@contractspec/lib.ai-agent": "8.0.
|
|
94
|
-
"@contractspec/lib.contracts-spec": "5.0
|
|
93
|
+
"@contractspec/lib.ai-agent": "8.0.5",
|
|
94
|
+
"@contractspec/lib.contracts-spec": "5.1.0",
|
|
95
95
|
"@workflow/ai": "^4.1.0-beta.58",
|
|
96
96
|
"ai": "6.0.138",
|
|
97
97
|
"workflow": "^4.2.0-beta.72"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@contractspec/tool.bun": "3.7.
|
|
101
|
-
"@contractspec/tool.typescript": "3.7.
|
|
100
|
+
"@contractspec/tool.bun": "3.7.13",
|
|
101
|
+
"@contractspec/tool.typescript": "3.7.13",
|
|
102
102
|
"typescript": "^5.9.3"
|
|
103
103
|
},
|
|
104
104
|
"publishConfig": {
|