@osolmaz/pi-workflows 0.10.0 → 0.11.0
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.
- package/README.md +23 -12
- package/dist/builtins/autodoc.workflow.d.ts +58 -0
- package/dist/builtins/autodoc.workflow.js +266 -0
- package/dist/builtins/autodoc.workflow.js.map +1 -0
- package/dist/builtins/autoimplement.workflow.d.ts +210 -11
- package/dist/builtins/autoimplement.workflow.js +245 -13
- package/dist/builtins/autoimplement.workflow.js.map +1 -1
- package/dist/builtins/{autodevise.workflow.d.ts → autoplan.workflow.d.ts} +9 -9
- package/dist/builtins/{autodevise.workflow.js → autoplan.workflow.js} +20 -20
- package/dist/builtins/autoplan.workflow.js.map +1 -0
- package/dist/builtins/catalog.js +8 -4
- package/dist/builtins/catalog.js.map +1 -1
- package/dist/builtins/index.d.ts +6 -3
- package/dist/builtins/index.js +5 -2
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/monitor.workflow.d.ts +4 -0
- package/dist/builtins/monitor.workflow.js +134 -9
- package/dist/builtins/monitor.workflow.js.map +1 -1
- package/dist/builtins/plan-approval.workflow.d.ts +83 -0
- package/dist/builtins/plan-approval.workflow.js +148 -0
- package/dist/builtins/plan-approval.workflow.js.map +1 -0
- package/dist/builtins/plan-presentation.d.ts +7 -0
- package/dist/builtins/plan-presentation.js +44 -0
- package/dist/builtins/plan-presentation.js.map +1 -0
- package/dist/extension/decision-channels.d.ts +132 -0
- package/dist/extension/decision-channels.js +1082 -0
- package/dist/extension/decision-channels.js.map +1 -0
- package/dist/extension/index.d.ts +1 -0
- package/dist/extension/index.js +426 -11
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/widget.js +26 -2
- package/dist/extension/widget.js.map +1 -1
- package/dist/extension/workflow-tool.d.ts +1 -37
- package/dist/extension/workflow-tool.js +1 -42
- package/dist/extension/workflow-tool.js.map +1 -1
- package/dist/host/rpc-bridge.js +4 -21
- package/dist/host/rpc-bridge.js.map +1 -1
- package/dist/render/graph-render.js +33 -8
- package/dist/render/graph-render.js.map +1 -1
- package/dist/viewer/render.js +36 -2
- package/dist/viewer/render.js.map +1 -1
- package/dist/workflows/composition.js +15 -1
- package/dist/workflows/composition.js.map +1 -1
- package/dist/workflows/decision-presentation.d.ts +18 -0
- package/dist/workflows/decision-presentation.js +417 -0
- package/dist/workflows/decision-presentation.js.map +1 -0
- package/dist/workflows/engine.d.ts +2 -1
- package/dist/workflows/engine.js +86 -4
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/human-decision.d.ts +87 -0
- package/dist/workflows/human-decision.js +583 -0
- package/dist/workflows/human-decision.js.map +1 -0
- package/dist/workflows/index.d.ts +3 -1
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/schema.js +15 -0
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/store.js +7 -0
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/tool-input.d.ts +72 -0
- package/dist/workflows/tool-input.js +141 -0
- package/dist/workflows/tool-input.js.map +1 -0
- package/dist/workflows/types.d.ts +223 -0
- package/docs/HUMAN_DECISIONS.md +371 -0
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +323 -0
- package/docs/MONITOR.md +17 -6
- package/docs/WORKFLOW_COMPOSITION.md +13 -6
- package/docs/plans/2026-08-19-human-decision-gates-plan.md +296 -0
- package/docs/plans/2026-08-19-human-decision-presentations-plan.md +172 -0
- package/docs/plans/2026-08-19-provider-compatible-workflow-tool-schema-plan.md +45 -0
- package/docs/plans/2026-08-19-workflow-composition-plan.md +25 -17
- package/docs/run-bundles.md +23 -2
- package/docs/workflows.md +43 -5
- package/examples/workflows/approved-plan.workflow.ts +58 -0
- package/examples/workflows/autoplan.workflow.ts +1 -0
- package/examples/workflows/human-decision.workflow.ts +62 -0
- package/herdr-plugin.toml +1 -1
- package/package.json +2 -1
- package/schemas/decision-presentation-v1.schema.json +83 -0
- package/schemas/human-decision-accepted-v1.schema.json +44 -0
- package/schemas/human-decision-accepted-v2.schema.json +50 -0
- package/schemas/human-decision-answer-attempt-v1.schema.json +37 -0
- package/schemas/human-decision-cancellation-v1.schema.json +15 -0
- package/schemas/human-decision-continuation-v1.schema.json +16 -0
- package/schemas/human-decision-delivery-v1.schema.json +28 -0
- package/schemas/human-decision-delivery-v2.schema.json +36 -0
- package/schemas/human-decision-receipt-v1.schema.json +33 -0
- package/schemas/human-decision-receipt-v2.schema.json +39 -0
- package/schemas/human-decision-request-v1.schema.json +59 -0
- package/schemas/human-decision-request-v2.schema.json +69 -0
- package/schemas/human-decision-resolution-v1.schema.json +27 -0
- package/schemas/human-decision-resolution-v2.schema.json +27 -0
- package/schemas/human-decision-settlement-v1.schema.json +28 -0
- package/skills/autodoc/SKILL.md +43 -0
- package/skills/autoimplement/SKILL.md +58 -0
- package/skills/autoimplement/agents/openai.yaml +4 -0
- package/skills/autoplan/SKILL.md +25 -0
- package/skills/monitor/SKILL.md +3 -1
- package/skills/pi-workflows/SKILL.md +3 -3
- package/src/builtins/autodoc.workflow.ts +325 -0
- package/src/builtins/autoimplement.workflow.ts +281 -14
- package/src/builtins/{autodevise.workflow.ts → autoplan.workflow.ts} +32 -32
- package/src/builtins/catalog.ts +8 -4
- package/src/builtins/index.ts +25 -6
- package/src/builtins/monitor.workflow.ts +162 -8
- package/src/builtins/plan-approval.workflow.ts +190 -0
- package/src/builtins/plan-presentation.ts +57 -0
- package/src/extension/decision-channels.ts +1533 -0
- package/src/extension/index.ts +499 -9
- package/src/extension/widget.ts +39 -2
- package/src/extension/workflow-tool.ts +5 -81
- package/src/host/rpc-bridge.ts +7 -30
- package/src/render/graph-render.ts +40 -3
- package/src/viewer/render.ts +56 -3
- package/src/workflows/composition.ts +16 -1
- package/src/workflows/decision-presentation.ts +501 -0
- package/src/workflows/engine.ts +108 -4
- package/src/workflows/human-decision.ts +819 -0
- package/src/workflows/index.ts +69 -0
- package/src/workflows/schema.ts +17 -0
- package/src/workflows/store.ts +8 -0
- package/src/workflows/tool-input.ts +202 -0
- package/src/workflows/types.ts +265 -0
- package/dist/builtins/autodevise.workflow.js.map +0 -1
- package/examples/workflows/autodevise.workflow.ts +0 -1
package/docs/workflows.md
CHANGED
|
@@ -15,8 +15,11 @@ Files are discovered by suffix (`.workflow.ts`, `.workflow.js`, `.workflow.mts`,
|
|
|
15
15
|
2. `~/.pi/agent/workflows/` globally
|
|
16
16
|
3. Workflows built into Pi Workflows
|
|
17
17
|
|
|
18
|
-
Pi Workflows includes
|
|
19
|
-
|
|
18
|
+
Pi Workflows includes built-in `autoplan`, `autodoc`, `autoimplement`,
|
|
19
|
+
`plan-approval`, and `monitor` workflows. `autoplan` is the current name for the
|
|
20
|
+
planning workflow that was first released as `autodevise`; the old command and
|
|
21
|
+
export are not retained. A project or global file named `monitor.workflow.ts`
|
|
22
|
+
replaces the built-in monitor. The package registers each built-in in
|
|
20
23
|
a process-local catalog with a stable reference such as `builtin:monitor` and
|
|
21
24
|
an explicit revision. Built-ins are imported with the engine when a Pi process
|
|
22
25
|
starts. They are not read from the package directory when a run starts or
|
|
@@ -271,6 +274,39 @@ checkpoint({
|
|
|
271
274
|
});
|
|
272
275
|
```
|
|
273
276
|
|
|
277
|
+
A typed human decision is an authoring layer over checkpoint:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
const choices = defineHumanChoices({
|
|
281
|
+
continue: choice({ label: "Continue" }),
|
|
282
|
+
stop: choice({ label: "Stop" }),
|
|
283
|
+
replan: choice({
|
|
284
|
+
label: "Replan",
|
|
285
|
+
input: textInput({ name: "instructions", prompt: "What should change?" }),
|
|
286
|
+
}),
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
humanDecision({
|
|
290
|
+
audience: "operator",
|
|
291
|
+
choices,
|
|
292
|
+
request: ({ outputs }) => ({
|
|
293
|
+
title: "Approve plan",
|
|
294
|
+
subject: outputs.plan,
|
|
295
|
+
presentation: {
|
|
296
|
+
schema: "pi-workflows.decision-presentation.v1",
|
|
297
|
+
summary: "Review the implementation plan.",
|
|
298
|
+
blocks: [{ kind: "paragraph", text: "The plan is ready for approval." }],
|
|
299
|
+
},
|
|
300
|
+
}),
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
The waiting run stores a versioned request and asks every channel configured for the logical audience. The structured `subject` remains machine data. Channels receive only the normalized `presentation`, title, choices, and input prompts. The first valid verified human answer wins. A continuation preserves the original workflow input and exposes the accepted answer as the checkpoint output. `humanDecisionEdge()` provides exhaustive routing for the choices. Existing `body` requests remain a legacy compatibility form and use deterministic readable formatting.
|
|
305
|
+
|
|
306
|
+
The model-facing workflow tool cannot answer a protected human decision. Pi interactive UI and configured external channels use a host-owned answer path. Ordinary checkpoints keep the existing `/workflow answer` behavior.
|
|
307
|
+
|
|
308
|
+
See [Human decisions](HUMAN_DECISIONS.md) for channels, recovery, persistence, and plan approval.
|
|
309
|
+
|
|
274
310
|
### decision
|
|
275
311
|
|
|
276
312
|
`decision` is sugar over `agent` for constrained choices. It builds the prompt
|
|
@@ -364,7 +400,7 @@ The model sees one `workflow` tool. Its `action` field supports:
|
|
|
364
400
|
- `start` with a workflow name or path and structured input.
|
|
365
401
|
- `status` for the active run or a supplied run ID.
|
|
366
402
|
- `pause`, `resume`, and `cancel` for the active run.
|
|
367
|
-
- `answer` with checkpoint input and an optional run ID.
|
|
403
|
+
- `answer` with ordinary checkpoint input and an optional run ID. Protected `humanDecision()` gates reject this model-facing action.
|
|
368
404
|
- `update` for a non-completing update from the current agent attempt.
|
|
369
405
|
- `submit` for the current workflow step contract.
|
|
370
406
|
|
|
@@ -377,7 +413,9 @@ runs.
|
|
|
377
413
|
|
|
378
414
|
### Built-in planning and implementation
|
|
379
415
|
|
|
380
|
-
The built-in `
|
|
416
|
+
The built-in `autoplan` workflow selects a practical in-scope solution and writes a detailed plan. The standalone `autodoc` workflow finds an already selected plan, records it in canonical documentation, verifies those documents, and never devises or implements. The built-in `autoimplement` workflow finds a clear existing plan from explicit input, conversation context, or referenced canonical documents. It blocks when no clear plan exists. An explicit plan bypasses autodoc only when a current-document receipt carries its matching plan digest; otherwise autodoc inspects and adopts or updates the canonical documents. Later invalidating evidence returns to `autoplan` followed by `autodoc`.
|
|
417
|
+
|
|
418
|
+
The built-in `plan-approval` workflow offers verified human `continue`, `stop`, and exact-text `replan` exits. It is optional. A replan exit returns the unchanged text to autoplan, documents the revised plan, and asks again through a new plan digest.
|
|
381
419
|
|
|
382
420
|
Autoimplement writes and runs the exact Pi Reviewer command. It records P0 through P2 by review round. P0 or P1 work requires another review. P2-only work can be addressed and verified without another reviewer run. CI tracking commands are also explicit. One CI watch lasts at most five minutes, after which the model runs more useful local tests before checking CI again.
|
|
383
421
|
|
|
@@ -397,7 +435,7 @@ one looping workflow run. Its input is:
|
|
|
397
435
|
}
|
|
398
436
|
```
|
|
399
437
|
|
|
400
|
-
The first check runs immediately. Omit `repair` for observation-only monitoring. An authorized repair
|
|
438
|
+
The first check runs immediately. Omit `repair` for observation-only monitoring. An authorized repair routes through outer `autoplan`, `autodoc`, optional `plan-approval`, `autoimplement`, and internal redesign before the monitor checks the target again. A repeated issue with unchanged target evidence stops as blocked. Add `repair.approval` with a named audience and bounded replan limit only when the operator wants a human decision before implementation.
|
|
401
439
|
|
|
402
440
|
`everyMinutes` defaults to 30. Each accepted check must provide one concise report and choose `continue`, `repair` when authorized, or `stop`. The
|
|
403
441
|
runtime queues that report as a workflow notification with `triggerTurn:
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { compute, defineWorkflow, includeWorkflow, includedResult } from "@osolmaz/pi-workflows";
|
|
2
|
+
import autodoc from "../../src/builtins/autodoc.workflow.js";
|
|
3
|
+
import autoplan from "../../src/builtins/autoplan.workflow.js";
|
|
4
|
+
import planApproval from "../../src/builtins/plan-approval.workflow.js";
|
|
5
|
+
|
|
6
|
+
export default defineWorkflow({
|
|
7
|
+
name: "approved-plan-example",
|
|
8
|
+
startAt: "design",
|
|
9
|
+
maxSteps: 80,
|
|
10
|
+
includes: {
|
|
11
|
+
design: includeWorkflow(autoplan, {
|
|
12
|
+
input: ({ input, outputs }) => {
|
|
13
|
+
const prior = outputs.design as { exit?: string; output?: { plan?: unknown } } | undefined;
|
|
14
|
+
const answer = outputs.approval as
|
|
15
|
+
| { exit?: string; output?: { instructions?: string } }
|
|
16
|
+
| undefined;
|
|
17
|
+
return {
|
|
18
|
+
problem: (input as { task: string }).task,
|
|
19
|
+
...(prior?.exit === "ready" ? { previousPlan: prior.output?.plan } : {}),
|
|
20
|
+
...(answer?.exit === "replan" ? { newEvidence: answer.output?.instructions } : {}),
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
documentation: includeWorkflow(autodoc, {
|
|
25
|
+
input: ({ input, outputs }) => {
|
|
26
|
+
const result = includedResult(autoplan, outputs.design);
|
|
27
|
+
if (result.exit !== "ready") throw new Error("design is not ready");
|
|
28
|
+
return { task: (input as { task: string }).task, plan: result.output.plan };
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
approval: includeWorkflow(planApproval, {
|
|
32
|
+
input: ({ input, outputs }) => {
|
|
33
|
+
const result = includedResult(autodoc, outputs.documentation);
|
|
34
|
+
if (result.exit !== "ready") throw new Error("documentation is not ready");
|
|
35
|
+
return {
|
|
36
|
+
task: (input as { task: string }).task,
|
|
37
|
+
plan: result.output.plan,
|
|
38
|
+
planDigest: result.output.planDigest,
|
|
39
|
+
audience: "operator",
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
nodes: {
|
|
45
|
+
done: compute({ run: ({ outputs }) => ({ status: "approved", approval: outputs.approval }) }),
|
|
46
|
+
stopped: compute({ run: ({ outputs }) => ({ status: "stopped", approval: outputs.approval }) }),
|
|
47
|
+
blocked: compute({ run: ({ outputs }) => ({ status: "blocked", outputs }) }),
|
|
48
|
+
},
|
|
49
|
+
edges: [
|
|
50
|
+
{ from: "design.ready", to: "documentation" },
|
|
51
|
+
{ from: "design.blocked", to: "blocked" },
|
|
52
|
+
{ from: "documentation.ready", to: "approval" },
|
|
53
|
+
{ from: "documentation.blocked", to: "blocked" },
|
|
54
|
+
{ from: "approval.continue", to: "done" },
|
|
55
|
+
{ from: "approval.stop", to: "stopped" },
|
|
56
|
+
{ from: "approval.replan", to: "design" },
|
|
57
|
+
],
|
|
58
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { autoplanWorkflow as default } from "@osolmaz/pi-workflows/builtins";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
choice,
|
|
3
|
+
compute,
|
|
4
|
+
defineHumanChoices,
|
|
5
|
+
defineWorkflow,
|
|
6
|
+
humanDecision,
|
|
7
|
+
humanDecisionEdge,
|
|
8
|
+
textInput,
|
|
9
|
+
} from "@osolmaz/pi-workflows";
|
|
10
|
+
|
|
11
|
+
const choices = defineHumanChoices({
|
|
12
|
+
continue: choice({ label: "Yes, continue" }),
|
|
13
|
+
stop: choice({ label: "No, stop" }),
|
|
14
|
+
replan: choice({
|
|
15
|
+
label: "Replan",
|
|
16
|
+
input: textInput({ name: "instructions", prompt: "What should change?" }),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default defineWorkflow({
|
|
21
|
+
name: "human-decision-example",
|
|
22
|
+
startAt: "proposal",
|
|
23
|
+
nodes: {
|
|
24
|
+
proposal: compute({
|
|
25
|
+
run: ({ input }) => ({
|
|
26
|
+
summary: "Apply the proposed workflow change.",
|
|
27
|
+
changes: ["Keep the durable subject.", "Show readable decision text."],
|
|
28
|
+
source: input,
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
approve: humanDecision({
|
|
32
|
+
audience: "operator",
|
|
33
|
+
choices,
|
|
34
|
+
request: ({ outputs }) => {
|
|
35
|
+
const proposal = outputs.proposal as { summary: string; changes: string[] };
|
|
36
|
+
return {
|
|
37
|
+
title: "Approve the proposal",
|
|
38
|
+
subject: proposal,
|
|
39
|
+
presentation: {
|
|
40
|
+
schema: "pi-workflows.decision-presentation.v1",
|
|
41
|
+
summary: proposal.summary,
|
|
42
|
+
blocks: [
|
|
43
|
+
{ kind: "section", title: "Changes" },
|
|
44
|
+
{ kind: "bullets", items: proposal.changes },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
continued: compute({ run: ({ outputs }) => ({ status: "continue", answer: outputs.approve }) }),
|
|
51
|
+
stopped: compute({ run: ({ outputs }) => ({ status: "stop", answer: outputs.approve }) }),
|
|
52
|
+
replan: compute({ run: ({ outputs }) => ({ status: "replan", answer: outputs.approve }) }),
|
|
53
|
+
},
|
|
54
|
+
edges: [
|
|
55
|
+
{ from: "proposal", to: "approve" },
|
|
56
|
+
humanDecisionEdge({
|
|
57
|
+
from: "approve",
|
|
58
|
+
choices,
|
|
59
|
+
cases: { continue: "continued", stop: "stopped", replan: "replan" },
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
});
|
package/herdr-plugin.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osolmaz/pi-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Workflow and controller runtime with a live terminal viewer for the pi coding agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"skills",
|
|
24
24
|
"examples",
|
|
25
25
|
"docs",
|
|
26
|
+
"schemas",
|
|
26
27
|
"plugins/herdr",
|
|
27
28
|
"herdr-plugin.toml",
|
|
28
29
|
"README.md",
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/decision-presentation-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows decision presentation v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "summary", "blocks"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "pi-workflows.decision-presentation.v1" },
|
|
10
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 16000 },
|
|
11
|
+
"blocks": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"maxItems": 256,
|
|
14
|
+
"items": {
|
|
15
|
+
"oneOf": [
|
|
16
|
+
{
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["kind", "text"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"kind": { "const": "paragraph" },
|
|
22
|
+
"text": { "type": "string", "minLength": 1, "maxLength": 16000 }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["kind", "title"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"kind": { "const": "section" },
|
|
31
|
+
"title": { "type": "string", "minLength": 1, "maxLength": 16000 }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": ["kind", "items"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"kind": { "const": "bullets" },
|
|
40
|
+
"items": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"minItems": 1,
|
|
43
|
+
"maxItems": 256,
|
|
44
|
+
"items": { "type": "string", "minLength": 1, "maxLength": 16000 }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["kind", "items"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"kind": { "const": "fields" },
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"minItems": 1,
|
|
57
|
+
"maxItems": 256,
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": ["label", "value"],
|
|
62
|
+
"properties": {
|
|
63
|
+
"label": { "type": "string", "minLength": 1, "maxLength": 16000 },
|
|
64
|
+
"value": { "type": "string", "minLength": 1, "maxLength": 16000 }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": ["kind", "text"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"kind": { "const": "preformatted" },
|
|
76
|
+
"text": { "type": "string", "minLength": 1, "maxLength": 16000 }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-accepted-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows accepted human decision v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"decisionId",
|
|
10
|
+
"requestDigest",
|
|
11
|
+
"response",
|
|
12
|
+
"source",
|
|
13
|
+
"idempotencyKey",
|
|
14
|
+
"acceptedAt",
|
|
15
|
+
"answerDigest"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"schema": { "const": "pi-workflows.human-decision-accepted.v1" },
|
|
19
|
+
"decisionId": { "type": "string" },
|
|
20
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
21
|
+
"response": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["choice"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"choice": { "type": "string" },
|
|
27
|
+
"input": { "type": "object", "additionalProperties": { "type": "string" } }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"source": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["channel", "actorId", "eventId"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"channel": { "type": "string" },
|
|
36
|
+
"actorId": { "type": "string" },
|
|
37
|
+
"eventId": { "type": "string" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"idempotencyKey": { "type": "string" },
|
|
41
|
+
"acceptedAt": { "type": "string", "format": "date-time" },
|
|
42
|
+
"answerDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-answer-attempt-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows human decision answer attempt v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"attemptId",
|
|
10
|
+
"attemptedAt",
|
|
11
|
+
"decisionId",
|
|
12
|
+
"requestDigest",
|
|
13
|
+
"choice",
|
|
14
|
+
"source",
|
|
15
|
+
"idempotencyKey"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"schema": { "const": "pi-workflows.human-decision-answer-attempt.v1" },
|
|
19
|
+
"attemptId": { "type": "string" },
|
|
20
|
+
"attemptedAt": { "type": "string", "format": "date-time" },
|
|
21
|
+
"decisionId": { "type": "string" },
|
|
22
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
23
|
+
"choice": { "type": "string" },
|
|
24
|
+
"input": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
25
|
+
"source": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["channel", "actorId", "eventId"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"channel": { "type": "string" },
|
|
31
|
+
"actorId": { "type": "string" },
|
|
32
|
+
"eventId": { "type": "string" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"idempotencyKey": { "type": "string" }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-cancellation-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows human decision cancellation v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "decisionId", "requestDigest", "cancelledAt", "reason"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "pi-workflows.human-decision-cancellation.v1" },
|
|
10
|
+
"decisionId": { "type": "string" },
|
|
11
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
12
|
+
"cancelledAt": { "type": "string", "format": "date-time" },
|
|
13
|
+
"reason": { "enum": ["cancelled", "expired"] }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-continuation-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows human decision continuation v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "decisionId", "requestDigest", "parentRunId", "runId", "createdAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "pi-workflows.human-decision-continuation.v1" },
|
|
10
|
+
"decisionId": { "type": "string" },
|
|
11
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
12
|
+
"parentRunId": { "type": "string" },
|
|
13
|
+
"runId": { "type": "string" },
|
|
14
|
+
"createdAt": { "type": "string", "format": "date-time" }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-delivery-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows human decision delivery v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"attemptId",
|
|
10
|
+
"decisionId",
|
|
11
|
+
"requestDigest",
|
|
12
|
+
"channel",
|
|
13
|
+
"state",
|
|
14
|
+
"createdAt"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schema": { "const": "pi-workflows.human-decision-delivery.v1" },
|
|
18
|
+
"attemptId": { "type": "string" },
|
|
19
|
+
"decisionId": { "type": "string" },
|
|
20
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
21
|
+
"channel": { "type": "string" },
|
|
22
|
+
"state": { "enum": ["intent", "confirmed", "failed", "unknown"] },
|
|
23
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
24
|
+
"finishedAt": { "type": "string", "format": "date-time" },
|
|
25
|
+
"messageCount": { "type": "integer", "minimum": 0 },
|
|
26
|
+
"errorCode": { "type": "string" }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/osolmaz/pi-workflows/schemas/human-decision-receipt-v1.schema.json",
|
|
4
|
+
"title": "Pi Workflows redacted human decision receipt v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"decisionId",
|
|
10
|
+
"requestDigest",
|
|
11
|
+
"nodeId",
|
|
12
|
+
"response",
|
|
13
|
+
"acceptedAt",
|
|
14
|
+
"answerDigest"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schema": { "const": "pi-workflows.human-decision-receipt.v1" },
|
|
18
|
+
"decisionId": { "type": "string" },
|
|
19
|
+
"requestDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
20
|
+
"nodeId": { "type": "string" },
|
|
21
|
+
"response": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["choice"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"choice": { "type": "string" },
|
|
27
|
+
"input": { "type": "object", "additionalProperties": { "type": "string" } }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"acceptedAt": { "type": "string", "format": "date-time" },
|
|
31
|
+
"answerDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|