ai-workflow-contract 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-contract",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "description": "Shared AI workflow contracts over WorkCtrlFlow and EagerDataFlow substrates",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -520,6 +520,29 @@ export interface AIWorkflowAuthoredEffects {
520
520
  ): Promise<AIAgentRunResult<Output>>;
521
521
  }
522
522
 
523
+ export interface RunStepExtensionSelector {
524
+ readonly instanceId: string;
525
+ readonly runId: string;
526
+ readonly stepId: string;
527
+ readonly kind: string;
528
+ }
529
+
530
+ export interface RunStepExtensionMutationInvocation {
531
+ readonly expectedRevision: number;
532
+ readonly value: FlowClosedValue;
533
+ }
534
+
535
+ export type RunStepExtensionMutationConfig = Readonly<Record<string, never>>;
536
+
537
+ /** Runtime-bound authored facade for the targeted StepExtension Processor. */
538
+ export interface AIWorkflowAuthoredStepExtensions {
539
+ mutateRunStepExtension(
540
+ selector: RunStepExtensionSelector,
541
+ invocation: RunStepExtensionMutationInvocation,
542
+ config: RunStepExtensionMutationConfig,
543
+ ): Promise<AIWorkflowFlowRunCheckpoint>;
544
+ }
545
+
523
546
  /** Closed durable AI profile state stored inside the Flow checkpoint owner. */
524
547
  export interface AIWorkflowProfileDurableState {
525
548
  readonly schemaVersion: typeof AI_AGENT_CHECKPOINT_STATE_SCHEMA_VERSION;
@@ -655,6 +678,10 @@ export interface AIWorkflowRuntimeContext<
655
678
  export type AIWorkflowAuthoredRuntimeContext<Store extends AIWorkflowStateProjection = AIWorkflowStateProjection> =
656
679
  AIWorkflowRuntimeContext<AIWorkflowAuthoredEffects, Store>;
657
680
 
681
+ export type AIWorkflowStepExtensionAuthoredRuntimeContext<
682
+ Store extends AIWorkflowStateProjection = AIWorkflowStateProjection,
683
+ > = AIWorkflowRuntimeContext<AIWorkflowAuthoredEffects & AIWorkflowAuthoredStepExtensions, Store>;
684
+
658
685
  export interface AICtrlWorkflowRuntime<
659
686
  Effects extends AIWorkflowEffectProvider | AIWorkflowAuthoredEffects = AIWorkflowEffectProvider,
660
687
  Store extends AIWorkflowStateProjection = AIWorkflowStateProjection,