@osolmaz/pi-workflows 0.11.2 → 0.12.1

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 (177) hide show
  1. package/README.md +15 -10
  2. package/dist/builtins/autoimplement-command-batches.d.ts +52 -0
  3. package/dist/builtins/autoimplement-command-batches.js +258 -0
  4. package/dist/builtins/autoimplement-command-batches.js.map +1 -0
  5. package/dist/builtins/autoimplement.workflow.d.ts +509 -124
  6. package/dist/builtins/autoimplement.workflow.js +884 -327
  7. package/dist/builtins/autoimplement.workflow.js.map +1 -1
  8. package/dist/builtins/catalog.js +5 -3
  9. package/dist/builtins/catalog.js.map +1 -1
  10. package/dist/builtins/index.d.ts +4 -1
  11. package/dist/builtins/index.js +3 -1
  12. package/dist/builtins/index.js.map +1 -1
  13. package/dist/builtins/monitor.workflow.d.ts +2 -4
  14. package/dist/builtins/monitor.workflow.js +26 -128
  15. package/dist/builtins/monitor.workflow.js.map +1 -1
  16. package/dist/builtins/pi-agent-group.d.ts +72 -0
  17. package/dist/builtins/pi-agent-group.js +1087 -0
  18. package/dist/builtins/pi-agent-group.js.map +1 -0
  19. package/dist/builtins/plan-approval.workflow.d.ts +39 -5
  20. package/dist/builtins/plan-approval.workflow.js +92 -14
  21. package/dist/builtins/plan-approval.workflow.js.map +1 -1
  22. package/dist/builtins/plan-change.workflow.d.ts +301 -0
  23. package/dist/builtins/plan-change.workflow.js +256 -0
  24. package/dist/builtins/plan-change.workflow.js.map +1 -0
  25. package/dist/builtins/plan-presentation.js +2 -2
  26. package/dist/builtins/plan-presentation.js.map +1 -1
  27. package/dist/builtins/sanity-check.workflow.d.ts +85 -0
  28. package/dist/builtins/sanity-check.workflow.js +482 -0
  29. package/dist/builtins/sanity-check.workflow.js.map +1 -0
  30. package/dist/controllers/sqlite.d.ts +90 -2
  31. package/dist/controllers/sqlite.js +380 -5
  32. package/dist/controllers/sqlite.js.map +1 -1
  33. package/dist/extension/decision-channels.d.ts +2 -2
  34. package/dist/extension/decision-channels.js +29 -35
  35. package/dist/extension/decision-channels.js.map +1 -1
  36. package/dist/extension/deferred-turn-coordinator.d.ts +32 -0
  37. package/dist/extension/deferred-turn-coordinator.js +143 -0
  38. package/dist/extension/deferred-turn-coordinator.js.map +1 -0
  39. package/dist/extension/deferred-turn.d.ts +44 -0
  40. package/dist/extension/deferred-turn.js +110 -0
  41. package/dist/extension/deferred-turn.js.map +1 -0
  42. package/dist/extension/index.js +348 -80
  43. package/dist/extension/index.js.map +1 -1
  44. package/dist/extension/session-events.d.ts +2 -2
  45. package/dist/extension/step-message.d.ts +1 -0
  46. package/dist/extension/step-message.js.map +1 -1
  47. package/dist/extension/widget.js +23 -3
  48. package/dist/extension/widget.js.map +1 -1
  49. package/dist/herdr/setup.js +4 -4
  50. package/dist/render/graph-render.js +1 -2
  51. package/dist/render/graph-render.js.map +1 -1
  52. package/dist/viewer/render.js +7 -6
  53. package/dist/viewer/render.js.map +1 -1
  54. package/dist/workflows/catalog.js +7 -2
  55. package/dist/workflows/catalog.js.map +1 -1
  56. package/dist/workflows/command-batch.d.ts +38 -0
  57. package/dist/workflows/command-batch.js +176 -0
  58. package/dist/workflows/command-batch.js.map +1 -0
  59. package/dist/workflows/composition.js +8 -0
  60. package/dist/workflows/composition.js.map +1 -1
  61. package/dist/workflows/decision-presentation.d.ts +1 -1
  62. package/dist/workflows/decision-presentation.js +51 -38
  63. package/dist/workflows/decision-presentation.js.map +1 -1
  64. package/dist/workflows/engine.d.ts +2 -2
  65. package/dist/workflows/engine.js +22 -17
  66. package/dist/workflows/engine.js.map +1 -1
  67. package/dist/workflows/errors.d.ts +13 -0
  68. package/dist/workflows/errors.js +15 -0
  69. package/dist/workflows/errors.js.map +1 -1
  70. package/dist/workflows/human-decision.d.ts +16 -4
  71. package/dist/workflows/human-decision.js +175 -72
  72. package/dist/workflows/human-decision.js.map +1 -1
  73. package/dist/workflows/index.d.ts +3 -2
  74. package/dist/workflows/index.js +2 -1
  75. package/dist/workflows/index.js.map +1 -1
  76. package/dist/workflows/progress.d.ts +1 -0
  77. package/dist/workflows/progress.js +15 -3
  78. package/dist/workflows/progress.js.map +1 -1
  79. package/dist/workflows/schema.js +12 -1
  80. package/dist/workflows/schema.js.map +1 -1
  81. package/dist/workflows/shell.d.ts +4 -0
  82. package/dist/workflows/shell.js +6 -0
  83. package/dist/workflows/shell.js.map +1 -1
  84. package/dist/workflows/store.js +8 -1
  85. package/dist/workflows/store.js.map +1 -1
  86. package/dist/workflows/types.d.ts +37 -48
  87. package/docs/2026-08-18-herdr-piw-plan.md +1 -1
  88. package/docs/2026-08-20-durable-workflow-launch-plan.md +19 -23
  89. package/docs/CONTROLLERS.md +2 -2
  90. package/docs/DEFERRED_TURNS.md +298 -0
  91. package/docs/DESIGN_PHILOSOPHY.md +1 -1
  92. package/docs/HUMAN_DECISIONS.md +30 -40
  93. package/docs/HUMAN_DECISION_PRESENTATIONS.md +17 -27
  94. package/docs/MONITOR.md +7 -13
  95. package/docs/WORKFLOW_COMPOSITION.md +10 -9
  96. package/docs/WORKFLOW_STEP_MESSAGES.md +5 -5
  97. package/docs/WORKFLOW_UPDATES.md +28 -5
  98. package/docs/plans/2026-08-04-controller-runtime-plan.md +1 -1
  99. package/docs/plans/2026-08-05-always-on-workflows-plan.md +1 -1
  100. package/docs/plans/2026-08-10-agent-managed-monitor-workflows-plan.md +9 -9
  101. package/docs/plans/2026-08-13-built-in-workflow-catalog-plan.md +1 -1
  102. package/docs/plans/2026-08-13-session-addressed-workflow-notifications-plan.md +1 -1
  103. package/docs/plans/2026-08-16-workflow-updates-plan.md +3 -3
  104. package/docs/plans/2026-08-17-bundled-skills-plan.md +6 -6
  105. package/docs/plans/2026-08-19-human-decision-gates-plan.md +5 -5
  106. package/docs/plans/2026-08-19-human-decision-presentations-plan.md +1 -1
  107. package/docs/plans/2026-08-19-provider-compatible-workflow-tool-schema-plan.md +1 -1
  108. package/docs/plans/2026-08-19-workflow-composition-plan.md +6 -6
  109. package/docs/plans/2026-08-20-autoimplement-blocker-challenge-plan.md +3 -3
  110. package/docs/plans/2026-08-20-bounded-command-batches-plan.md +206 -0
  111. package/docs/plans/2026-08-20-herdr-plugin-sync-plan.md +9 -9
  112. package/docs/plans/2026-08-21-autoimplement-timeout-fallback-plan.md +242 -0
  113. package/docs/plans/2026-08-21-deferred-turn-intents-plan.md +324 -0
  114. package/docs/plans/2026-08-21-plan-change-approval-policy-plan.md +322 -0
  115. package/docs/plans/2026-08-21-sanity-check-plan.md +283 -0
  116. package/docs/run-bundles.md +8 -6
  117. package/docs/workflows.md +85 -22
  118. package/examples/workflows/approved-plan.workflow.ts +19 -46
  119. package/examples/workflows/command-batch.workflow.ts +50 -0
  120. package/examples/workflows/sanity-check.workflow.ts +1 -0
  121. package/herdr-plugin.toml +3 -3
  122. package/package.json +7 -7
  123. package/schemas/decision-presentation-v1.schema.json +1 -1
  124. package/schemas/human-decision-accepted-v1.schema.json +16 -4
  125. package/schemas/human-decision-answer-attempt-v1.schema.json +1 -1
  126. package/schemas/human-decision-cancellation-v1.schema.json +1 -1
  127. package/schemas/human-decision-continuation-v1.schema.json +11 -2
  128. package/schemas/human-decision-delivery-v1.schema.json +9 -1
  129. package/schemas/human-decision-receipt-v1.schema.json +9 -1
  130. package/schemas/human-decision-request-v1.schema.json +25 -5
  131. package/schemas/human-decision-resolution-v1.schema.json +1 -1
  132. package/schemas/human-decision-settlement-v1.schema.json +1 -1
  133. package/skills/autodoc/SKILL.md +33 -2
  134. package/skills/autoimplement/SKILL.md +93 -12
  135. package/skills/autoplan/SKILL.md +26 -2
  136. package/skills/monitor/SKILL.md +66 -24
  137. package/skills/pi-workflows/SKILL.md +21 -6
  138. package/skills/sanity-check/SKILL.md +44 -0
  139. package/src/builtins/autoimplement-command-batches.ts +364 -0
  140. package/src/builtins/autoimplement.workflow.ts +1075 -370
  141. package/src/builtins/catalog.ts +5 -3
  142. package/src/builtins/index.ts +24 -0
  143. package/src/builtins/monitor.workflow.ts +27 -150
  144. package/src/builtins/pi-agent-group.ts +1407 -0
  145. package/src/builtins/plan-approval.workflow.ts +157 -24
  146. package/src/builtins/plan-change.workflow.ts +321 -0
  147. package/src/builtins/plan-presentation.ts +2 -2
  148. package/src/builtins/sanity-check.workflow.ts +769 -0
  149. package/src/controllers/sqlite.ts +580 -7
  150. package/src/extension/decision-channels.ts +36 -66
  151. package/src/extension/deferred-turn-coordinator.ts +171 -0
  152. package/src/extension/deferred-turn.ts +166 -0
  153. package/src/extension/index.ts +438 -90
  154. package/src/extension/session-events.ts +2 -2
  155. package/src/extension/step-message.ts +1 -0
  156. package/src/extension/widget.ts +24 -5
  157. package/src/herdr/setup.ts +4 -4
  158. package/src/render/graph-render.ts +1 -2
  159. package/src/viewer/render.ts +7 -6
  160. package/src/workflows/catalog.ts +7 -2
  161. package/src/workflows/command-batch.ts +254 -0
  162. package/src/workflows/composition.ts +9 -0
  163. package/src/workflows/decision-presentation.ts +56 -43
  164. package/src/workflows/engine.ts +25 -20
  165. package/src/workflows/errors.ts +24 -0
  166. package/src/workflows/human-decision.ts +218 -101
  167. package/src/workflows/index.ts +20 -11
  168. package/src/workflows/progress.ts +18 -3
  169. package/src/workflows/schema.ts +19 -1
  170. package/src/workflows/shell.ts +10 -0
  171. package/src/workflows/store.ts +8 -1
  172. package/src/workflows/types.ts +43 -59
  173. package/schemas/human-decision-accepted-v2.schema.json +0 -50
  174. package/schemas/human-decision-delivery-v2.schema.json +0 -36
  175. package/schemas/human-decision-receipt-v2.schema.json +0 -39
  176. package/schemas/human-decision-request-v2.schema.json +0 -69
  177. package/schemas/human-decision-resolution-v2.schema.json +0 -27
@@ -71,9 +71,10 @@ export type WorkflowProgressData = {
71
71
  export type WorkflowNodeCommon = {
72
72
  /**
73
73
  * Per-node timeout or a callback that derives it from the run context.
74
- * Falls back to the engine default (15 minutes).
74
+ * Null disables the wall-clock deadline. Omission falls back to the engine
75
+ * default (15 minutes).
75
76
  */
76
- timeoutMs?: number | ((context: WorkflowNodeContext) => MaybePromise<number>);
77
+ timeoutMs?: number | null | ((context: WorkflowNodeContext) => MaybePromise<number | null>);
77
78
  /** Short human-readable label shown in the viewer while the node runs. */
78
79
  statusDetail?: string;
79
80
  };
@@ -230,37 +231,34 @@ export type DecisionPresentation = {
230
231
  blocks: DecisionPresentationBlock[];
231
232
  };
232
233
 
233
- export type LegacyHumanDecisionPrompt = {
234
- title: string;
235
- body: unknown;
236
- subject?: never;
237
- presentation?: never;
238
- revision?: never;
239
- /** Optional absolute expiry. An expired request cannot accept an answer. */
240
- expiresAt?: string;
241
- };
242
-
243
- export type PresentedHumanDecisionPrompt<TSubject = unknown> = {
234
+ export type HumanDecisionPrompt<TSubject = unknown> = {
244
235
  title: string;
245
236
  subject: TSubject;
246
237
  presentation: DecisionPresentation;
247
- body?: never;
248
238
  /** Positive revision of the decision subject and presentation. Defaults to 1. */
249
239
  revision?: number;
250
240
  /** Optional absolute expiry. An expired request cannot accept an answer. */
251
241
  expiresAt?: string;
252
242
  };
253
243
 
254
- export type HumanDecisionPrompt = LegacyHumanDecisionPrompt | PresentedHumanDecisionPrompt;
255
-
256
244
  export type HumanDecisionAudience =
257
245
  | string
258
246
  | ((context: WorkflowNodeContext) => MaybePromise<string>);
259
247
 
248
+ export type HumanDecisionTimeout = {
249
+ afterMs: number;
250
+ response: HumanDecisionResponse;
251
+ };
252
+
253
+ export type HumanDecisionTimeoutPolicy =
254
+ | HumanDecisionTimeout
255
+ | ((context: WorkflowNodeContext) => MaybePromise<HumanDecisionTimeout | undefined>);
256
+
260
257
  export type HumanDecisionNodeContract = {
261
258
  audience: HumanDecisionAudience;
262
259
  choices: HumanDecisionChoiceMap;
263
260
  request: (context: WorkflowNodeContext) => MaybePromise<HumanDecisionPrompt>;
261
+ onTimeout?: HumanDecisionTimeoutPolicy;
264
262
  };
265
263
 
266
264
  type HumanDecisionRequestCommon = {
@@ -275,15 +273,11 @@ type HumanDecisionRequestCommon = {
275
273
  choices: HumanDecisionChoiceMap;
276
274
  createdAt: string;
277
275
  expiresAt?: string;
276
+ defaultResponse?: HumanDecisionResponse;
278
277
  };
279
278
 
280
- export type HumanDecisionRequestV1 = HumanDecisionRequestCommon & {
279
+ export type HumanDecisionRequest = HumanDecisionRequestCommon & {
281
280
  schema: "pi-workflows.human-decision-request.v1";
282
- body: unknown;
283
- };
284
-
285
- export type HumanDecisionRequestV2 = HumanDecisionRequestCommon & {
286
- schema: "pi-workflows.human-decision-request.v2";
287
281
  subject: unknown;
288
282
  presentation: DecisionPresentation;
289
283
  revision: number;
@@ -291,11 +285,9 @@ export type HumanDecisionRequestV2 = HumanDecisionRequestCommon & {
291
285
  presentationDigest: string;
292
286
  };
293
287
 
294
- export type HumanDecisionRequest = HumanDecisionRequestV1 | HumanDecisionRequestV2;
295
-
296
288
  /**
297
289
  * Complete operator-facing request passed to a decision channel. It excludes
298
- * the canonical subject and legacy body by design.
290
+ * the canonical subject by design.
299
291
  */
300
292
  export type HumanDecisionChannelRequest = HumanDecisionRequestCommon & {
301
293
  schema: "pi-workflows.human-decision-channel-request.v1";
@@ -323,69 +315,62 @@ export type HumanDecisionSubmission = HumanDecisionResponse & {
323
315
  idempotencyKey: string;
324
316
  };
325
317
 
326
- type AcceptedHumanDecisionCommon = {
318
+ type ResolvedHumanDecisionCommon = {
327
319
  decisionId: string;
328
320
  requestDigest: string;
329
321
  response: HumanDecisionResponse;
330
- source: HumanDecisionAnswerSource;
331
- idempotencyKey: string;
322
+ provenance: "human" | "timeout";
332
323
  acceptedAt: string;
333
324
  answerDigest: string;
334
325
  };
335
326
 
336
- export type AcceptedHumanDecisionV1 = AcceptedHumanDecisionCommon & {
337
- schema: "pi-workflows.human-decision-accepted.v1";
327
+ type AcceptedHumanDecisionCommon = ResolvedHumanDecisionCommon & {
328
+ provenance: "human";
329
+ source: HumanDecisionAnswerSource;
330
+ idempotencyKey: string;
338
331
  };
339
332
 
340
- export type AcceptedHumanDecisionV2 = AcceptedHumanDecisionCommon & {
341
- schema: "pi-workflows.human-decision-accepted.v2";
333
+ type DefaultedHumanDecisionCommon = ResolvedHumanDecisionCommon & {
334
+ provenance: "timeout";
335
+ };
336
+
337
+ export type AcceptedHumanDecision = AcceptedHumanDecisionCommon & {
338
+ schema: "pi-workflows.human-decision-accepted.v1";
342
339
  subjectDigest: string;
343
340
  presentationDigest: string;
344
341
  revision: number;
345
342
  };
346
343
 
347
- export type AcceptedHumanDecision = AcceptedHumanDecisionV1 | AcceptedHumanDecisionV2;
344
+ export type DefaultedHumanDecision = DefaultedHumanDecisionCommon & {
345
+ schema: "pi-workflows.human-decision-accepted.v1";
346
+ subjectDigest: string;
347
+ presentationDigest: string;
348
+ revision: number;
349
+ };
350
+ export type ResolvedHumanDecision = AcceptedHumanDecision | DefaultedHumanDecision;
348
351
 
349
352
  type HumanDecisionReceiptCommon = {
350
353
  decisionId: string;
351
354
  requestDigest: string;
352
355
  nodeId: string;
353
356
  response: HumanDecisionResponse;
357
+ provenance: "human" | "timeout";
354
358
  acceptedAt: string;
355
359
  answerDigest: string;
356
360
  };
357
361
 
358
- export type HumanDecisionReceiptV1 = HumanDecisionReceiptCommon & {
362
+ export type HumanDecisionReceipt = HumanDecisionReceiptCommon & {
359
363
  schema: "pi-workflows.human-decision-receipt.v1";
360
- };
361
-
362
- export type HumanDecisionReceiptV2 = HumanDecisionReceiptCommon & {
363
- schema: "pi-workflows.human-decision-receipt.v2";
364
364
  subjectDigest: string;
365
365
  presentationDigest: string;
366
366
  revision: number;
367
367
  };
368
368
 
369
- export type HumanDecisionReceipt = HumanDecisionReceiptV1 | HumanDecisionReceiptV2;
370
-
371
- export type HumanDecisionDeliveryRecordV1 = {
369
+ export type HumanDecisionDeliveryRecord = {
372
370
  schema: "pi-workflows.human-decision-delivery.v1";
373
371
  attemptId: string;
374
372
  decisionId: string;
375
373
  requestDigest: string;
376
- channel: string;
377
- state: "intent" | "confirmed" | "failed" | "unknown";
378
- createdAt: string;
379
- finishedAt?: string;
380
- messageCount?: number;
381
- errorCode?: string;
382
- };
383
-
384
- export type HumanDecisionDeliveryRecordV2 = {
385
- schema: "pi-workflows.human-decision-delivery.v2";
386
- attemptId: string;
387
- decisionId: string;
388
- requestDigest: string;
389
374
  presentationDigest: string;
390
375
  channel: string;
391
376
  phase: "intent" | "part" | "complete";
@@ -400,10 +385,6 @@ export type HumanDecisionDeliveryRecordV2 = {
400
385
  errorCode?: string;
401
386
  };
402
387
 
403
- export type HumanDecisionDeliveryRecord =
404
- | HumanDecisionDeliveryRecordV1
405
- | HumanDecisionDeliveryRecordV2;
406
-
407
388
  export type HumanDecisionSettlementRecord = {
408
389
  schema: "pi-workflows.human-decision-settlement.v1";
409
390
  attemptId: string;
@@ -428,6 +409,7 @@ export type HumanDecisionContinuationRecord = {
428
409
  schema: "pi-workflows.human-decision-continuation.v1";
429
410
  decisionId: string;
430
411
  requestDigest: string;
412
+ provenance: "human" | "timeout";
431
413
  parentRunId: string;
432
414
  runId: string;
433
415
  createdAt: string;
@@ -715,7 +697,7 @@ export type WorkflowRunState = {
715
697
 
716
698
  export type WorkflowNodeSnapshot = {
717
699
  nodeType: WorkflowNodeDefinition["nodeType"];
718
- timeoutMs?: number;
700
+ timeoutMs?: number | null;
719
701
  statusDetail?: string;
720
702
  summary?: string;
721
703
  expectedOutput?: string;
@@ -727,6 +709,8 @@ export type WorkflowNodeSnapshot = {
727
709
  audience: string;
728
710
  dynamicAudience?: boolean;
729
711
  choices: HumanDecisionChoiceMap;
712
+ onTimeout?: HumanDecisionTimeout;
713
+ dynamicTimeout?: boolean;
730
714
  };
731
715
  };
732
716
 
@@ -1,50 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-accepted-v2.schema.json",
4
- "title": "Pi Workflows accepted human decision v2",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema",
9
- "decisionId",
10
- "requestDigest",
11
- "subjectDigest",
12
- "presentationDigest",
13
- "revision",
14
- "response",
15
- "source",
16
- "idempotencyKey",
17
- "acceptedAt",
18
- "answerDigest"
19
- ],
20
- "properties": {
21
- "schema": { "const": "pi-workflows.human-decision-accepted.v2" },
22
- "decisionId": { "type": "string" },
23
- "requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
24
- "subjectDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
25
- "presentationDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
26
- "revision": { "type": "integer", "minimum": 1 },
27
- "response": {
28
- "type": "object",
29
- "additionalProperties": false,
30
- "required": ["choice"],
31
- "properties": {
32
- "choice": { "type": "string" },
33
- "input": { "type": "object", "additionalProperties": { "type": "string" } }
34
- }
35
- },
36
- "source": {
37
- "type": "object",
38
- "additionalProperties": false,
39
- "required": ["channel", "actorId", "eventId"],
40
- "properties": {
41
- "channel": { "type": "string" },
42
- "actorId": { "type": "string" },
43
- "eventId": { "type": "string" }
44
- }
45
- },
46
- "idempotencyKey": { "type": "string" },
47
- "acceptedAt": { "type": "string", "format": "date-time" },
48
- "answerDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
49
- }
50
- }
@@ -1,36 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-delivery-v2.schema.json",
4
- "title": "Pi Workflows human decision delivery v2",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema",
9
- "attemptId",
10
- "decisionId",
11
- "requestDigest",
12
- "presentationDigest",
13
- "channel",
14
- "phase",
15
- "state",
16
- "createdAt"
17
- ],
18
- "properties": {
19
- "schema": { "const": "pi-workflows.human-decision-delivery.v2" },
20
- "attemptId": { "type": "string" },
21
- "decisionId": { "type": "string" },
22
- "requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
23
- "presentationDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
24
- "channel": { "type": "string" },
25
- "phase": { "enum": ["intent", "part", "complete"] },
26
- "state": { "enum": ["intent", "confirmed", "failed", "unknown"] },
27
- "createdAt": { "type": "string", "format": "date-time" },
28
- "finishedAt": { "type": "string", "format": "date-time" },
29
- "recipientIndex": { "type": "integer", "minimum": 1 },
30
- "partIndex": { "type": "integer", "minimum": 1 },
31
- "partCount": { "type": "integer", "minimum": 1, "maximum": 20 },
32
- "contentDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
33
- "messageCount": { "type": "integer", "minimum": 0 },
34
- "errorCode": { "type": "string" }
35
- }
36
- }
@@ -1,39 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-receipt-v2.schema.json",
4
- "title": "Pi Workflows redacted human decision receipt v2",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema",
9
- "decisionId",
10
- "requestDigest",
11
- "subjectDigest",
12
- "presentationDigest",
13
- "revision",
14
- "nodeId",
15
- "response",
16
- "acceptedAt",
17
- "answerDigest"
18
- ],
19
- "properties": {
20
- "schema": { "const": "pi-workflows.human-decision-receipt.v2" },
21
- "decisionId": { "type": "string" },
22
- "requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
23
- "subjectDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
24
- "presentationDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
25
- "revision": { "type": "integer", "minimum": 1 },
26
- "nodeId": { "type": "string" },
27
- "response": {
28
- "type": "object",
29
- "additionalProperties": false,
30
- "required": ["choice"],
31
- "properties": {
32
- "choice": { "type": "string" },
33
- "input": { "type": "object", "additionalProperties": { "type": "string" } }
34
- }
35
- },
36
- "acceptedAt": { "type": "string", "format": "date-time" },
37
- "answerDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
38
- }
39
- }
@@ -1,69 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-request-v2.schema.json",
4
- "title": "Pi Workflows human decision request v2",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema",
9
- "decisionId",
10
- "requestDigest",
11
- "subjectDigest",
12
- "presentationDigest",
13
- "runId",
14
- "workflowName",
15
- "nodeId",
16
- "attemptId",
17
- "audience",
18
- "title",
19
- "subject",
20
- "presentation",
21
- "revision",
22
- "choices",
23
- "createdAt"
24
- ],
25
- "properties": {
26
- "schema": { "const": "pi-workflows.human-decision-request.v2" },
27
- "decisionId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$" },
28
- "requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
29
- "subjectDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
30
- "presentationDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
31
- "runId": { "type": "string" },
32
- "workflowName": { "type": "string" },
33
- "nodeId": { "type": "string" },
34
- "attemptId": { "type": "string" },
35
- "audience": { "type": "string" },
36
- "title": { "type": "string", "minLength": 1 },
37
- "subject": true,
38
- "presentation": {
39
- "$ref": "decision-presentation-v1.schema.json"
40
- },
41
- "revision": { "type": "integer", "minimum": 1 },
42
- "choices": {
43
- "type": "object",
44
- "minProperties": 1,
45
- "additionalProperties": {
46
- "type": "object",
47
- "additionalProperties": false,
48
- "required": ["label"],
49
- "properties": {
50
- "label": { "type": "string", "minLength": 1 },
51
- "input": {
52
- "type": "object",
53
- "additionalProperties": false,
54
- "required": ["kind", "name", "prompt", "minLength", "maxLength"],
55
- "properties": {
56
- "kind": { "const": "text" },
57
- "name": { "type": "string" },
58
- "prompt": { "type": "string", "minLength": 1 },
59
- "minLength": { "type": "integer", "minimum": 0 },
60
- "maxLength": { "type": "integer", "minimum": 1 }
61
- }
62
- }
63
- }
64
- }
65
- },
66
- "createdAt": { "type": "string", "format": "date-time" },
67
- "expiresAt": { "type": "string", "format": "date-time" }
68
- }
69
- }
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-resolution-v2.schema.json",
4
- "title": "Pi Workflows human decision resolution v2",
5
- "oneOf": [
6
- {
7
- "type": "object",
8
- "additionalProperties": false,
9
- "required": ["schema", "outcome", "decision"],
10
- "properties": {
11
- "schema": { "const": "pi-workflows.human-decision-resolution.v2" },
12
- "outcome": { "const": "accepted" },
13
- "decision": { "$ref": "human-decision-accepted-v2.schema.json" }
14
- }
15
- },
16
- {
17
- "type": "object",
18
- "additionalProperties": false,
19
- "required": ["schema", "outcome", "cancellation"],
20
- "properties": {
21
- "schema": { "const": "pi-workflows.human-decision-resolution.v2" },
22
- "outcome": { "const": "cancelled" },
23
- "cancellation": { "$ref": "human-decision-cancellation-v1.schema.json" }
24
- }
25
- }
26
- ]
27
- }