@peac/schema 0.10.8 → 0.10.10

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 (79) hide show
  1. package/LICENSE +1 -1
  2. package/dist/attestation-receipt.cjs +127 -0
  3. package/dist/attestation-receipt.cjs.map +1 -0
  4. package/dist/attestation-receipt.mjs +113 -0
  5. package/dist/attestation-receipt.mjs.map +1 -0
  6. package/dist/attribution.cjs +249 -0
  7. package/dist/attribution.cjs.map +1 -0
  8. package/dist/attribution.mjs +227 -0
  9. package/dist/attribution.mjs.map +1 -0
  10. package/dist/dispute.d.ts.map +1 -1
  11. package/dist/index.cjs +2818 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.mjs +2577 -0
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/interaction.cjs +619 -0
  18. package/dist/interaction.cjs.map +1 -0
  19. package/dist/interaction.mjs +583 -0
  20. package/dist/interaction.mjs.map +1 -0
  21. package/dist/normalize.cjs +84 -0
  22. package/dist/normalize.cjs.map +1 -0
  23. package/dist/normalize.d.ts +21 -15
  24. package/dist/normalize.d.ts.map +1 -1
  25. package/dist/normalize.mjs +82 -0
  26. package/dist/normalize.mjs.map +1 -0
  27. package/dist/receipt-parser.cjs +333 -0
  28. package/dist/receipt-parser.cjs.map +1 -0
  29. package/dist/receipt-parser.d.ts +68 -0
  30. package/dist/receipt-parser.d.ts.map +1 -0
  31. package/dist/receipt-parser.mjs +331 -0
  32. package/dist/receipt-parser.mjs.map +1 -0
  33. package/dist/workflow.cjs +321 -0
  34. package/dist/workflow.cjs.map +1 -0
  35. package/dist/workflow.mjs +292 -0
  36. package/dist/workflow.mjs.map +1 -0
  37. package/package.json +50 -6
  38. package/dist/agent-identity.js +0 -357
  39. package/dist/agent-identity.js.map +0 -1
  40. package/dist/attestation-receipt.js +0 -249
  41. package/dist/attestation-receipt.js.map +0 -1
  42. package/dist/attribution.js +0 -444
  43. package/dist/attribution.js.map +0 -1
  44. package/dist/constants.js +0 -73
  45. package/dist/constants.js.map +0 -1
  46. package/dist/control.js +0 -9
  47. package/dist/control.js.map +0 -1
  48. package/dist/dispute.js +0 -832
  49. package/dist/dispute.js.map +0 -1
  50. package/dist/envelope.js +0 -9
  51. package/dist/envelope.js.map +0 -1
  52. package/dist/errors.js +0 -116
  53. package/dist/errors.js.map +0 -1
  54. package/dist/evidence.js +0 -8
  55. package/dist/evidence.js.map +0 -1
  56. package/dist/index.js +0 -280
  57. package/dist/index.js.map +0 -1
  58. package/dist/interaction.js +0 -918
  59. package/dist/interaction.js.map +0 -1
  60. package/dist/json.js +0 -267
  61. package/dist/json.js.map +0 -1
  62. package/dist/normalize.js +0 -102
  63. package/dist/normalize.js.map +0 -1
  64. package/dist/obligations.js +0 -337
  65. package/dist/obligations.js.map +0 -1
  66. package/dist/purpose.js +0 -296
  67. package/dist/purpose.js.map +0 -1
  68. package/dist/schemas.js +0 -7
  69. package/dist/schemas.js.map +0 -1
  70. package/dist/subject.js +0 -9
  71. package/dist/subject.js.map +0 -1
  72. package/dist/types.js +0 -6
  73. package/dist/types.js.map +0 -1
  74. package/dist/validators.js +0 -421
  75. package/dist/validators.js.map +0 -1
  76. package/dist/version.js +0 -7
  77. package/dist/version.js.map +0 -1
  78. package/dist/workflow.js +0 -523
  79. package/dist/workflow.js.map +0 -1
package/dist/workflow.js DELETED
@@ -1,523 +0,0 @@
1
- "use strict";
2
- /**
3
- * PEAC Workflow Correlation Types (v0.10.2+)
4
- *
5
- * Workflow correlation primitives for multi-agent orchestration.
6
- * These types enable tracking and verification of multi-step agentic workflows
7
- * across different frameworks (MCP, A2A, CrewAI, LangGraph, etc.).
8
- *
9
- * Design principles:
10
- * - Non-breaking: Uses extensions mechanism (auth.extensions['org.peacprotocol/workflow'])
11
- * - DAG semantics: Parent linking for execution graph reconstruction
12
- * - Framework-agnostic: Works with any orchestration layer
13
- * - Deterministic: Supports offline verification and audit
14
- *
15
- * @see docs/specs/WORKFLOW-CORRELATION.md
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.WorkflowSummaryAttestationSchema = exports.WorkflowSummaryEvidenceSchema = exports.WorkflowErrorContextSchema = exports.WorkflowContextSchema = exports.OrchestrationFrameworkSchema = exports.WorkflowStatusSchema = exports.StepIdSchema = exports.WorkflowIdSchema = exports.STEP_ID_PATTERN = exports.WORKFLOW_ID_PATTERN = exports.WORKFLOW_LIMITS = exports.FRAMEWORK_ID_PATTERN = exports.ORCHESTRATION_FRAMEWORKS = exports.WELL_KNOWN_FRAMEWORKS = exports.WORKFLOW_STATUSES = exports.WORKFLOW_SUMMARY_TYPE = exports.WORKFLOW_EXTENSION_KEY = void 0;
19
- exports.validateWorkflowContextOrdered = validateWorkflowContextOrdered;
20
- exports.createWorkflowId = createWorkflowId;
21
- exports.createStepId = createStepId;
22
- exports.validateWorkflowContext = validateWorkflowContext;
23
- exports.isValidWorkflowContext = isValidWorkflowContext;
24
- exports.validateWorkflowSummaryAttestation = validateWorkflowSummaryAttestation;
25
- exports.isWorkflowSummaryAttestation = isWorkflowSummaryAttestation;
26
- exports.isTerminalWorkflowStatus = isTerminalWorkflowStatus;
27
- exports.hasValidDagSemantics = hasValidDagSemantics;
28
- exports.createWorkflowContext = createWorkflowContext;
29
- exports.createWorkflowSummaryAttestation = createWorkflowSummaryAttestation;
30
- const zod_1 = require("zod");
31
- // ============================================================================
32
- // Constants
33
- // ============================================================================
34
- /**
35
- * Extension key for workflow context
36
- * Used in auth.extensions['org.peacprotocol/workflow']
37
- */
38
- exports.WORKFLOW_EXTENSION_KEY = 'org.peacprotocol/workflow';
39
- /**
40
- * Attestation type for workflow summaries
41
- */
42
- exports.WORKFLOW_SUMMARY_TYPE = 'peac/workflow-summary';
43
- /**
44
- * Workflow status values
45
- */
46
- exports.WORKFLOW_STATUSES = ['in_progress', 'completed', 'failed', 'cancelled'];
47
- /**
48
- * Well-known orchestration frameworks (informational, not normative)
49
- *
50
- * The framework field accepts any string matching the framework grammar.
51
- * These well-known values are listed in the PEAC registries for interop.
52
- * New frameworks do NOT require protocol updates - just use the name.
53
- *
54
- * @see docs/specs/registries.json - orchestration_frameworks section
55
- */
56
- exports.WELL_KNOWN_FRAMEWORKS = [
57
- 'mcp',
58
- 'a2a',
59
- 'crewai',
60
- 'langgraph',
61
- 'autogen',
62
- 'custom',
63
- ];
64
- /**
65
- * @deprecated Use WELL_KNOWN_FRAMEWORKS instead. Kept for backwards compatibility.
66
- */
67
- exports.ORCHESTRATION_FRAMEWORKS = exports.WELL_KNOWN_FRAMEWORKS;
68
- /**
69
- * Framework identifier grammar pattern
70
- *
71
- * Lowercase letters, digits, hyphens, underscores.
72
- * Must start with a letter. Max 64 characters.
73
- * Examples: "mcp", "a2a", "crewai", "langgraph", "dspy", "smolagents"
74
- */
75
- exports.FRAMEWORK_ID_PATTERN = /^[a-z][a-z0-9_-]*$/;
76
- /**
77
- * Workflow correlation limits (DoS protection)
78
- */
79
- exports.WORKFLOW_LIMITS = {
80
- /** Maximum parent steps per step (DAG fan-in) */
81
- maxParentSteps: 16,
82
- /** Maximum workflow ID length */
83
- maxWorkflowIdLength: 128,
84
- /** Maximum step ID length */
85
- maxStepIdLength: 128,
86
- /** Maximum tool name length */
87
- maxToolNameLength: 256,
88
- /** Maximum framework identifier length */
89
- maxFrameworkLength: 64,
90
- /** Maximum agents in a workflow summary */
91
- maxAgentsInvolved: 100,
92
- /** Maximum receipt refs in a workflow summary */
93
- maxReceiptRefs: 10000,
94
- /** Maximum error message length */
95
- maxErrorMessageLength: 1024,
96
- };
97
- // ============================================================================
98
- // ID Format Patterns
99
- // ============================================================================
100
- /**
101
- * Workflow ID format: wf_{ulid} or wf_{uuid}
102
- * Examples:
103
- * - wf_01HXYZ... (ULID)
104
- * - wf_550e8400-e29b-41d4-a716-446655440000 (UUID)
105
- */
106
- exports.WORKFLOW_ID_PATTERN = /^wf_[a-zA-Z0-9_-]{20,48}$/;
107
- /**
108
- * Step ID format: step_{ulid} or step_{uuid}
109
- * Examples:
110
- * - step_01HXYZ... (ULID)
111
- * - step_550e8400-e29b-41d4-a716-446655440000 (UUID)
112
- */
113
- exports.STEP_ID_PATTERN = /^step_[a-zA-Z0-9_-]{20,48}$/;
114
- // ============================================================================
115
- // Zod Schemas
116
- // ============================================================================
117
- /**
118
- * Workflow ID schema
119
- */
120
- exports.WorkflowIdSchema = zod_1.z
121
- .string()
122
- .regex(exports.WORKFLOW_ID_PATTERN, 'Invalid workflow ID format (expected wf_{ulid|uuid})')
123
- .max(exports.WORKFLOW_LIMITS.maxWorkflowIdLength);
124
- /**
125
- * Step ID schema
126
- */
127
- exports.StepIdSchema = zod_1.z
128
- .string()
129
- .regex(exports.STEP_ID_PATTERN, 'Invalid step ID format (expected step_{ulid|uuid})')
130
- .max(exports.WORKFLOW_LIMITS.maxStepIdLength);
131
- /**
132
- * Workflow status schema
133
- */
134
- exports.WorkflowStatusSchema = zod_1.z.enum(exports.WORKFLOW_STATUSES);
135
- /**
136
- * Orchestration framework schema
137
- *
138
- * Open string field with constrained grammar. Any lowercase identifier
139
- * matching the framework grammar is valid. Well-known values are listed
140
- * in WELL_KNOWN_FRAMEWORKS and the PEAC registries.
141
- *
142
- * Grammar: /^[a-z][a-z0-9_-]*$/ (max 64 chars)
143
- */
144
- exports.OrchestrationFrameworkSchema = zod_1.z
145
- .string()
146
- .regex(exports.FRAMEWORK_ID_PATTERN, 'Invalid framework identifier (must be lowercase alphanumeric with hyphens/underscores, starting with a letter)')
147
- .max(exports.WORKFLOW_LIMITS.maxFrameworkLength);
148
- /**
149
- * Workflow context schema - attached to individual receipts
150
- *
151
- * This is the core primitive that links receipts into a workflow DAG.
152
- * Place in auth.extensions['org.peacprotocol/workflow']
153
- */
154
- exports.WorkflowContextSchema = zod_1.z
155
- .object({
156
- // Correlation
157
- /** Globally unique workflow/run ID */
158
- workflow_id: exports.WorkflowIdSchema,
159
- /** This step's unique ID */
160
- step_id: exports.StepIdSchema,
161
- /** DAG parent step IDs (empty array for root step) */
162
- parent_step_ids: zod_1.z.array(exports.StepIdSchema).max(exports.WORKFLOW_LIMITS.maxParentSteps).default([]),
163
- // Orchestration identity
164
- /** Agent identity ref of the orchestrator (optional) */
165
- orchestrator_id: zod_1.z.string().max(256).optional(),
166
- /** Receipt ID that initiated this workflow (optional) */
167
- orchestrator_receipt_ref: zod_1.z.string().max(256).optional(),
168
- // Sequencing (for linear workflows)
169
- /** 0-based position in sequential runs (optional) */
170
- step_index: zod_1.z.number().int().nonnegative().optional(),
171
- /** Total steps if known upfront (optional) */
172
- step_total: zod_1.z.number().int().positive().optional(),
173
- // Metadata
174
- /** Tool or skill name (MCP tool, A2A skill, etc.) */
175
- tool_name: zod_1.z.string().max(exports.WORKFLOW_LIMITS.maxToolNameLength).optional(),
176
- /** Orchestration framework */
177
- framework: exports.OrchestrationFrameworkSchema.optional(),
178
- // Hash chain (for streaming/progressive receipts)
179
- /** SHA-256 hash of previous receipt in chain (for ordering) */
180
- prev_receipt_hash: zod_1.z
181
- .string()
182
- .regex(/^sha256:[a-f0-9]{64}$/)
183
- .optional(),
184
- })
185
- .strict();
186
- /**
187
- * Error context for failed workflows
188
- */
189
- exports.WorkflowErrorContextSchema = zod_1.z
190
- .object({
191
- /** Step ID where failure occurred */
192
- failed_step_id: exports.StepIdSchema,
193
- /** Error code (E_* format preferred) */
194
- error_code: zod_1.z.string().max(64),
195
- /** Human-readable error message */
196
- error_message: zod_1.z.string().max(exports.WORKFLOW_LIMITS.maxErrorMessageLength),
197
- })
198
- .strict();
199
- /**
200
- * Workflow summary evidence - the "proof of run" artifact
201
- *
202
- * Used in peac/workflow-summary attestations.
203
- * This is the single handle auditors use to verify an entire workflow.
204
- */
205
- exports.WorkflowSummaryEvidenceSchema = zod_1.z
206
- .object({
207
- /** Workflow ID this summary describes */
208
- workflow_id: exports.WorkflowIdSchema,
209
- /** Workflow status */
210
- status: exports.WorkflowStatusSchema,
211
- /** When the workflow started (ISO 8601) */
212
- started_at: zod_1.z.string().datetime(),
213
- /** When the workflow completed (ISO 8601, undefined if in_progress) */
214
- completed_at: zod_1.z.string().datetime().optional(),
215
- // Receipt commitment
216
- /** Ordered list of receipt IDs (for small workflows) */
217
- receipt_refs: zod_1.z.array(zod_1.z.string().max(256)).max(exports.WORKFLOW_LIMITS.maxReceiptRefs).optional(),
218
- /** Merkle root of receipt digests (for large workflows, RFC 6962 style) */
219
- receipt_merkle_root: zod_1.z
220
- .string()
221
- .regex(/^sha256:[a-f0-9]{64}$/)
222
- .optional(),
223
- /** Total receipt count (required if using Merkle root) */
224
- receipt_count: zod_1.z.number().int().nonnegative().optional(),
225
- // Orchestration
226
- /** Agent identity ref of the orchestrator */
227
- orchestrator_id: zod_1.z.string().max(256),
228
- /** List of agent IDs involved in the workflow */
229
- agents_involved: zod_1.z.array(zod_1.z.string().max(256)).max(exports.WORKFLOW_LIMITS.maxAgentsInvolved),
230
- // Outcome
231
- /** SHA-256 hash of final output artifact (optional) */
232
- final_result_hash: zod_1.z
233
- .string()
234
- .regex(/^sha256:[a-f0-9]{64}$/)
235
- .optional(),
236
- /** Error context if workflow failed */
237
- error_context: exports.WorkflowErrorContextSchema.optional(),
238
- })
239
- .strict()
240
- .refine((data) => {
241
- // Must have either receipt_refs or receipt_merkle_root (or both)
242
- return data.receipt_refs !== undefined || data.receipt_merkle_root !== undefined;
243
- }, {
244
- message: 'Workflow summary must include receipt_refs or receipt_merkle_root',
245
- })
246
- .refine((data) => {
247
- // If using Merkle root, must include receipt_count
248
- if (data.receipt_merkle_root !== undefined && data.receipt_count === undefined) {
249
- return false;
250
- }
251
- return true;
252
- }, {
253
- message: 'receipt_count is required when using receipt_merkle_root',
254
- });
255
- /**
256
- * Workflow summary attestation schema
257
- *
258
- * A signed attestation containing the workflow summary evidence.
259
- */
260
- exports.WorkflowSummaryAttestationSchema = zod_1.z
261
- .object({
262
- /** Attestation type (must be 'peac/workflow-summary') */
263
- type: zod_1.z.literal(exports.WORKFLOW_SUMMARY_TYPE),
264
- /** Who issued this attestation (HTTPS URL) */
265
- issuer: zod_1.z.string().url().startsWith('https://'),
266
- /** When this attestation was issued (ISO 8601) */
267
- issued_at: zod_1.z.string().datetime(),
268
- /** When this attestation expires (ISO 8601, optional) */
269
- expires_at: zod_1.z.string().datetime().optional(),
270
- /** The workflow summary evidence */
271
- evidence: exports.WorkflowSummaryEvidenceSchema,
272
- })
273
- .strict();
274
- /**
275
- * Validate a WorkflowContext with explicit evaluation ordering.
276
- *
277
- * Implements Section 6.5.1 of WORKFLOW-CORRELATION.md:
278
- * 1. Required field format (rules 4, 5)
279
- * 2. Structural constraints (rule 3)
280
- * 3. Optional field format (rules 6, 7)
281
- * 4. Semantic DAG checks (rules 1, 2)
282
- *
283
- * This function does NOT depend on Zod's internal validation ordering.
284
- * Cross-language implementations MUST produce identical error_code values
285
- * for the same invalid input.
286
- *
287
- * @param input - Raw input to validate
288
- * @returns Validation result with canonical error code on failure
289
- */
290
- function validateWorkflowContextOrdered(input) {
291
- if (typeof input !== 'object' || input === null) {
292
- return {
293
- valid: false,
294
- error_code: 'E_WORKFLOW_CONTEXT_INVALID',
295
- error: 'Input must be an object',
296
- };
297
- }
298
- const obj = input;
299
- // Step 1: Required field format (rules 4, 5)
300
- if (typeof obj.workflow_id !== 'string' ||
301
- !exports.WORKFLOW_ID_PATTERN.test(obj.workflow_id) ||
302
- obj.workflow_id.length > exports.WORKFLOW_LIMITS.maxWorkflowIdLength) {
303
- return {
304
- valid: false,
305
- error_code: 'E_WORKFLOW_ID_INVALID',
306
- error: 'Invalid workflow ID format',
307
- };
308
- }
309
- if (typeof obj.step_id !== 'string' ||
310
- !exports.STEP_ID_PATTERN.test(obj.step_id) ||
311
- obj.step_id.length > exports.WORKFLOW_LIMITS.maxStepIdLength) {
312
- return {
313
- valid: false,
314
- error_code: 'E_WORKFLOW_STEP_ID_INVALID',
315
- error: 'Invalid step ID format',
316
- };
317
- }
318
- // Step 2: Structural constraints (rule 3)
319
- const parentStepIds = obj.parent_step_ids;
320
- if (Array.isArray(parentStepIds) && parentStepIds.length > exports.WORKFLOW_LIMITS.maxParentSteps) {
321
- return {
322
- valid: false,
323
- error_code: 'E_WORKFLOW_LIMIT_EXCEEDED',
324
- error: 'Exceeds maximum parent steps',
325
- };
326
- }
327
- // Step 3: Optional field format (rules 6, 7)
328
- if (obj.framework !== undefined) {
329
- if (typeof obj.framework !== 'string' ||
330
- !exports.FRAMEWORK_ID_PATTERN.test(obj.framework) ||
331
- obj.framework.length > exports.WORKFLOW_LIMITS.maxFrameworkLength) {
332
- return {
333
- valid: false,
334
- error_code: 'E_WORKFLOW_CONTEXT_INVALID',
335
- error: 'Invalid framework identifier grammar',
336
- };
337
- }
338
- }
339
- if (obj.prev_receipt_hash !== undefined) {
340
- if (typeof obj.prev_receipt_hash !== 'string' ||
341
- !/^sha256:[a-f0-9]{64}$/.test(obj.prev_receipt_hash)) {
342
- return {
343
- valid: false,
344
- error_code: 'E_WORKFLOW_CONTEXT_INVALID',
345
- error: 'Invalid hash format',
346
- };
347
- }
348
- }
349
- // Step 4: Semantic DAG checks (rules 1, 2)
350
- if (Array.isArray(parentStepIds)) {
351
- if (parentStepIds.includes(obj.step_id)) {
352
- return {
353
- valid: false,
354
- error_code: 'E_WORKFLOW_DAG_INVALID',
355
- error: 'Self-parent cycle detected',
356
- };
357
- }
358
- const uniqueParents = new Set(parentStepIds);
359
- if (uniqueParents.size !== parentStepIds.length) {
360
- return {
361
- valid: false,
362
- error_code: 'E_WORKFLOW_DAG_INVALID',
363
- error: 'Duplicate parent step IDs',
364
- };
365
- }
366
- }
367
- // Full schema validation for remaining structural rules (types, strict mode, etc.)
368
- const result = exports.WorkflowContextSchema.safeParse(input);
369
- if (!result.success) {
370
- return {
371
- valid: false,
372
- error_code: 'E_WORKFLOW_CONTEXT_INVALID',
373
- error: result.error.issues[0]?.message || 'Schema validation failed',
374
- };
375
- }
376
- return { valid: true, value: result.data };
377
- }
378
- // ============================================================================
379
- // Helper Functions
380
- // ============================================================================
381
- /**
382
- * Generate a workflow ID with the wf_ prefix
383
- *
384
- * @param id - ULID or UUID payload (without prefix)
385
- * @returns Prefixed workflow ID
386
- */
387
- function createWorkflowId(id) {
388
- const workflowId = `wf_${id}`;
389
- return exports.WorkflowIdSchema.parse(workflowId);
390
- }
391
- /**
392
- * Generate a step ID with the step_ prefix
393
- *
394
- * @param id - ULID or UUID payload (without prefix)
395
- * @returns Prefixed step ID
396
- */
397
- function createStepId(id) {
398
- const stepId = `step_${id}`;
399
- return exports.StepIdSchema.parse(stepId);
400
- }
401
- /**
402
- * Validate a workflow context object
403
- *
404
- * @param context - Object to validate
405
- * @returns Validated WorkflowContext
406
- * @throws ZodError if validation fails
407
- */
408
- function validateWorkflowContext(context) {
409
- return exports.WorkflowContextSchema.parse(context);
410
- }
411
- /**
412
- * Check if an object is a valid workflow context (non-throwing)
413
- *
414
- * @param context - Object to check
415
- * @returns True if valid WorkflowContext
416
- */
417
- function isValidWorkflowContext(context) {
418
- return exports.WorkflowContextSchema.safeParse(context).success;
419
- }
420
- /**
421
- * Validate a workflow summary attestation
422
- *
423
- * @param attestation - Object to validate
424
- * @returns Validated WorkflowSummaryAttestation
425
- * @throws ZodError if validation fails
426
- */
427
- function validateWorkflowSummaryAttestation(attestation) {
428
- return exports.WorkflowSummaryAttestationSchema.parse(attestation);
429
- }
430
- /**
431
- * Check if an object is a workflow summary attestation (non-throwing)
432
- *
433
- * @param attestation - Object to check
434
- * @returns True if valid WorkflowSummaryAttestation
435
- */
436
- function isWorkflowSummaryAttestation(attestation) {
437
- return exports.WorkflowSummaryAttestationSchema.safeParse(attestation).success;
438
- }
439
- /**
440
- * Check if a workflow summary is in a terminal state
441
- *
442
- * @param status - Workflow status
443
- * @returns True if completed, failed, or cancelled
444
- */
445
- function isTerminalWorkflowStatus(status) {
446
- return status === 'completed' || status === 'failed' || status === 'cancelled';
447
- }
448
- /**
449
- * Check if workflow context has valid DAG semantics (no self-parent)
450
- *
451
- * @param context - Workflow context to check
452
- * @returns True if DAG semantics are valid
453
- */
454
- function hasValidDagSemantics(context) {
455
- // Step cannot be its own parent
456
- if (context.parent_step_ids.includes(context.step_id)) {
457
- return false;
458
- }
459
- // No duplicate parents
460
- const uniqueParents = new Set(context.parent_step_ids);
461
- if (uniqueParents.size !== context.parent_step_ids.length) {
462
- return false;
463
- }
464
- return true;
465
- }
466
- /**
467
- * Create a workflow context for attaching to a receipt
468
- *
469
- * @param params - Workflow context parameters
470
- * @returns Validated WorkflowContext
471
- */
472
- function createWorkflowContext(params) {
473
- const context = {
474
- workflow_id: params.workflow_id,
475
- step_id: params.step_id,
476
- parent_step_ids: (params.parent_step_ids ?? []),
477
- ...(params.orchestrator_id && { orchestrator_id: params.orchestrator_id }),
478
- ...(params.orchestrator_receipt_ref && {
479
- orchestrator_receipt_ref: params.orchestrator_receipt_ref,
480
- }),
481
- ...(params.step_index !== undefined && { step_index: params.step_index }),
482
- ...(params.step_total !== undefined && { step_total: params.step_total }),
483
- ...(params.tool_name && { tool_name: params.tool_name }),
484
- ...(params.framework && { framework: params.framework }),
485
- ...(params.prev_receipt_hash && { prev_receipt_hash: params.prev_receipt_hash }),
486
- };
487
- // Validate
488
- const validated = validateWorkflowContext(context);
489
- // Check DAG semantics
490
- if (!hasValidDagSemantics(validated)) {
491
- throw new Error('Invalid DAG semantics: step cannot be its own parent or have duplicate parents');
492
- }
493
- return validated;
494
- }
495
- /**
496
- * Create a workflow summary attestation
497
- *
498
- * @param params - Attestation parameters
499
- * @returns Validated WorkflowSummaryAttestation
500
- */
501
- function createWorkflowSummaryAttestation(params) {
502
- const attestation = {
503
- type: exports.WORKFLOW_SUMMARY_TYPE,
504
- issuer: params.issuer,
505
- issued_at: params.issued_at,
506
- ...(params.expires_at && { expires_at: params.expires_at }),
507
- evidence: {
508
- workflow_id: params.workflow_id,
509
- status: params.status,
510
- started_at: params.started_at,
511
- ...(params.completed_at && { completed_at: params.completed_at }),
512
- ...(params.receipt_refs && { receipt_refs: params.receipt_refs }),
513
- ...(params.receipt_merkle_root && { receipt_merkle_root: params.receipt_merkle_root }),
514
- ...(params.receipt_count !== undefined && { receipt_count: params.receipt_count }),
515
- orchestrator_id: params.orchestrator_id,
516
- agents_involved: params.agents_involved,
517
- ...(params.final_result_hash && { final_result_hash: params.final_result_hash }),
518
- ...(params.error_context && { error_context: params.error_context }),
519
- },
520
- };
521
- return validateWorkflowSummaryAttestation(attestation);
522
- }
523
- //# sourceMappingURL=workflow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAwVH,wEAwGC;AAYD,4CAGC;AAQD,oCAGC;AASD,0DAEC;AAQD,wDAEC;AASD,gFAIC;AAQD,oEAIC;AAQD,4DAEC;AAQD,oDAWC;AAQD,sDAsCC;AA4BD,4EAwBC;AAroBD,6BAAwB;AAExB,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;GAGG;AACU,QAAA,sBAAsB,GAAG,2BAA2B,CAAC;AAElE;;GAEG;AACU,QAAA,qBAAqB,GAAG,uBAAgC,CAAC;AAEtE;;GAEG;AACU,QAAA,iBAAiB,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAE9F;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,QAAQ;IACR,WAAW;IACX,SAAS;IACT,QAAQ;CACA,CAAC;AAEX;;GAEG;AACU,QAAA,wBAAwB,GAAG,6BAAqB,CAAC;AAE9D;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,iDAAiD;IACjD,cAAc,EAAE,EAAE;IAClB,iCAAiC;IACjC,mBAAmB,EAAE,GAAG;IACxB,6BAA6B;IAC7B,eAAe,EA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