ai-workflow-contract 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.
Files changed (2) hide show
  1. package/package.json +2 -3
  2. package/src/index.ts +23 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-contract",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "Shared AI workflow contracts over WorkCtrlFlow and EagerDataFlow substrates",
6
6
  "type": "module",
@@ -17,7 +17,6 @@
17
17
  "src"
18
18
  ],
19
19
  "publishConfig": {
20
- "access": "public",
21
- "registry": "https://registry.npmjs.com"
20
+ "access": "public"
22
21
  }
23
22
  }
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ import type {
5
5
  ResourceRecord,
6
6
  ResourceRegistry,
7
7
  ResourceTree,
8
+ ResourceValue,
8
9
  Sha256Digest,
9
10
  } from 'halfcode-compiler.xnl/resource-core';
10
11
  import type { FlowBundleSpec, WorkCtrlFlowRuntime } from 'work-ctrl-flow-contract';
@@ -144,11 +145,27 @@ export interface AIWorkflowTypedResourceRef {
144
145
  readonly resource: ResourceRecord;
145
146
  }
146
147
 
148
+ export interface AIWorkflowMessageSchemaProjection extends AIWorkflowTypedResourceRef {
149
+ readonly kind: 'MessageSchema';
150
+ readonly schema: Readonly<Record<string, ResourceValue>>;
151
+ }
152
+
153
+ export type AIWorkflowEffectToolMode = 'declared-only' | 'none';
154
+
155
+ export interface AIWorkflowEffectPolicyProjection extends AIWorkflowTypedResourceRef {
156
+ readonly kind: 'EffectPolicy';
157
+ readonly toolMode: AIWorkflowEffectToolMode;
158
+ }
159
+
160
+ export interface AIWorkflowMaterialValueProjection extends AIWorkflowTypedResourceRef {
161
+ readonly value: ResourceValue;
162
+ }
163
+
147
164
  export interface AIAgentMessageProjection {
148
165
  readonly id: string;
149
166
  readonly role: AIAgentMessageRole;
150
167
  readonly prompt: AIWorkflowTypedResourceRef;
151
- readonly schema?: AIWorkflowTypedResourceRef;
168
+ readonly schema?: AIWorkflowMessageSchemaProjection;
152
169
  }
153
170
 
154
171
  export interface MaterialPortProjection {
@@ -158,7 +175,7 @@ export interface MaterialPortProjection {
158
175
  readonly materialKind: string;
159
176
  readonly required: boolean;
160
177
  readonly cardinality: MaterialCardinality;
161
- readonly schema?: AIWorkflowTypedResourceRef;
178
+ readonly schema?: AIWorkflowMessageSchemaProjection;
162
179
  }
163
180
 
164
181
  export interface AIAgentDefinitionProjection {
@@ -166,10 +183,10 @@ export interface AIAgentDefinitionProjection {
166
183
  readonly fqn: string;
167
184
  readonly resource: ResourceRecord;
168
185
  readonly messages: readonly AIAgentMessageProjection[];
169
- readonly inputSchema?: AIWorkflowTypedResourceRef;
170
- readonly outputSchema?: AIWorkflowTypedResourceRef;
186
+ readonly inputSchema?: AIWorkflowMessageSchemaProjection;
187
+ readonly outputSchema?: AIWorkflowMessageSchemaProjection;
171
188
  readonly tools: readonly AIWorkflowTypedResourceRef[];
172
- readonly effectPolicy?: AIWorkflowTypedResourceRef;
189
+ readonly effectPolicy?: AIWorkflowEffectPolicyProjection;
173
190
  readonly materialPorts: readonly AIWorkflowTypedResourceRef[];
174
191
  }
175
192
 
@@ -186,7 +203,7 @@ export interface MaterialBindingProjection {
186
203
  readonly resource: ResourceRecord;
187
204
  readonly task: AIWorkflowAgentTaskRef;
188
205
  readonly port: MaterialPortProjection;
189
- readonly material: AIWorkflowTypedResourceRef;
206
+ readonly material: AIWorkflowMaterialValueProjection;
190
207
  }
191
208
 
192
209
  export interface AIWorkflowAgentResourceProjection {