ai-workflow-contract 0.1.5 → 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 +3 -3
  2. package/src/index.ts +29 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-contract",
3
- "version": "0.1.5",
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",
@@ -9,9 +9,9 @@
9
9
  ".": "./src/index.ts"
10
10
  },
11
11
  "dependencies": {
12
- "eager-data-flow-contract": "0.1.2",
12
+ "eager-data-flow-contract": "0.1.3",
13
13
  "halfcode-compiler.xnl": "0.2.2",
14
- "work-ctrl-flow-contract": "0.1.2"
14
+ "work-ctrl-flow-contract": "0.1.3"
15
15
  },
16
16
  "files": [
17
17
  "src"
package/src/index.ts CHANGED
@@ -29,6 +29,8 @@ export {
29
29
  type FlowDefinitionProvenance,
30
30
  type FlowInstanceDescriptor,
31
31
  type FlowRunCheckpoint,
32
+ type FlowRunStepExtensionFact,
33
+ type FlowRunStepExtensions,
32
34
  type FlowRunCheckpointCommit,
33
35
  type FlowRunCheckpointKey,
34
36
  type FlowRunCheckpointStore,
@@ -518,6 +520,29 @@ export interface AIWorkflowAuthoredEffects {
518
520
  ): Promise<AIAgentRunResult<Output>>;
519
521
  }
520
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
+
521
546
  /** Closed durable AI profile state stored inside the Flow checkpoint owner. */
522
547
  export interface AIWorkflowProfileDurableState {
523
548
  readonly schemaVersion: typeof AI_AGENT_CHECKPOINT_STATE_SCHEMA_VERSION;
@@ -653,6 +678,10 @@ export interface AIWorkflowRuntimeContext<
653
678
  export type AIWorkflowAuthoredRuntimeContext<Store extends AIWorkflowStateProjection = AIWorkflowStateProjection> =
654
679
  AIWorkflowRuntimeContext<AIWorkflowAuthoredEffects, Store>;
655
680
 
681
+ export type AIWorkflowStepExtensionAuthoredRuntimeContext<
682
+ Store extends AIWorkflowStateProjection = AIWorkflowStateProjection,
683
+ > = AIWorkflowRuntimeContext<AIWorkflowAuthoredEffects & AIWorkflowAuthoredStepExtensions, Store>;
684
+
656
685
  export interface AICtrlWorkflowRuntime<
657
686
  Effects extends AIWorkflowEffectProvider | AIWorkflowAuthoredEffects = AIWorkflowEffectProvider,
658
687
  Store extends AIWorkflowStateProjection = AIWorkflowStateProjection,