@osolmaz/pi-workflows 0.16.5 → 0.16.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.
- package/README.md +5 -5
- package/dist/builtins/autoimplement.workflow.d.ts +5 -1
- package/dist/builtins/autoimplement.workflow.js +29 -10
- package/dist/builtins/autoimplement.workflow.js.map +1 -1
- package/dist/client/client.js +3 -1
- package/dist/client/client.js.map +1 -1
- package/dist/client/protocol.d.ts +1 -1
- package/dist/client/protocol.js +18 -1
- package/dist/client/protocol.js.map +1 -1
- package/dist/client/view.d.ts +7 -5
- package/dist/extension/index.d.ts +2 -1
- package/dist/extension/index.js +116 -166
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/recorder.d.ts +1 -1
- package/dist/extension/recorder.js +2 -2
- package/dist/extension/recorder.js.map +1 -1
- package/dist/extension/step-message.d.ts +1 -1
- package/dist/extension/step-message.js +4 -4
- package/dist/extension/step-message.js.map +1 -1
- package/dist/extension/widget.js +1 -1
- package/dist/extension/widget.js.map +1 -1
- package/dist/extension/workflow-message-coordinator.d.ts +12 -3
- package/dist/extension/workflow-message-coordinator.js +108 -94
- package/dist/extension/workflow-message-coordinator.js.map +1 -1
- package/dist/render/graph-render.js +1 -1
- package/dist/resource-managers/index.d.ts +1 -2
- package/dist/resource-managers/index.js +1 -2
- package/dist/resource-managers/index.js.map +1 -1
- package/dist/resource-managers/sqlite.d.ts +2 -295
- package/dist/resource-managers/sqlite.js +71 -1528
- package/dist/resource-managers/sqlite.js.map +1 -1
- package/dist/resource-managers/types.d.ts +2 -7
- package/dist/server/resource-runner-entry.js +2 -6
- package/dist/server/resource-runner-entry.js.map +1 -1
- package/dist/server/rpc-bridge.js +1 -1
- package/dist/server/rpc-bridge.js.map +1 -1
- package/dist/server/rpc-executor.js +2 -4
- package/dist/server/rpc-executor.js.map +1 -1
- package/dist/server/server-entry.js +3 -0
- package/dist/server/server-entry.js.map +1 -1
- package/dist/server/server.d.ts +9 -8
- package/dist/server/server.js +364 -541
- package/dist/server/server.js.map +1 -1
- package/dist/server/state.d.ts +16 -29
- package/dist/server/state.js +105 -319
- package/dist/server/state.js.map +1 -1
- package/dist/server/view.d.ts +6 -5
- package/dist/server/view.js +68 -51
- package/dist/server/view.js.map +1 -1
- package/dist/server/workflow-runner-entry.d.ts +1 -1
- package/dist/server/workflow-runner-entry.js +1 -49
- package/dist/server/workflow-runner-entry.js.map +1 -1
- package/dist/server/workflow-runner-protocol.d.ts +2 -7
- package/dist/server/workflow-runner-protocol.js +5 -10
- package/dist/server/workflow-runner-protocol.js.map +1 -1
- package/dist/server/workflow-runner-store.d.ts +5 -6
- package/dist/server/workflow-runner-store.js +7 -14
- package/dist/server/workflow-runner-store.js.map +1 -1
- package/dist/state/attempt-time.d.ts +21 -0
- package/dist/state/attempt-time.js +95 -0
- package/dist/state/attempt-time.js.map +1 -0
- package/dist/state/json.d.ts +2 -1
- package/dist/state/json.js.map +1 -1
- package/dist/state/project-store.d.ts +39 -0
- package/dist/state/project-store.js +154 -0
- package/dist/state/project-store.js.map +1 -0
- package/dist/state/prune.js +0 -7
- package/dist/state/prune.js.map +1 -1
- package/dist/state/schema.js +23 -23
- package/dist/state/workflow-messages.d.ts +1 -1
- package/dist/state/workflow-messages.js +3 -1
- package/dist/state/workflow-messages.js.map +1 -1
- package/dist/viewer/backup.js +5 -0
- package/dist/viewer/backup.js.map +1 -1
- package/dist/workflows/diagnostics.d.ts +8 -0
- package/dist/workflows/diagnostics.js +61 -0
- package/dist/workflows/diagnostics.js.map +1 -0
- package/dist/workflows/engine.d.ts +2 -16
- package/dist/workflows/engine.js +128 -252
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/errors.d.ts +1 -1
- package/dist/workflows/errors.js +2 -2
- package/dist/workflows/errors.js.map +1 -1
- package/dist/workflows/human-decision.d.ts +3 -7
- package/dist/workflows/human-decision.js +2 -56
- package/dist/workflows/human-decision.js.map +1 -1
- package/dist/workflows/index.d.ts +2 -1
- package/dist/workflows/index.js +1 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/queue.d.ts +267 -0
- package/dist/workflows/queue.js +1248 -0
- package/dist/workflows/queue.js.map +1 -0
- package/dist/workflows/requests.d.ts +47 -0
- package/dist/workflows/requests.js +158 -0
- package/dist/workflows/requests.js.map +1 -0
- package/dist/workflows/schema.js +2 -4
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/store.d.ts +11 -16
- package/dist/workflows/store.js +177 -174
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/tool-input.d.ts +6 -9
- package/dist/workflows/tool-input.js +15 -12
- package/dist/workflows/tool-input.js.map +1 -1
- package/dist/workflows/transitions.d.ts +38 -0
- package/dist/workflows/transitions.js +276 -0
- package/dist/workflows/transitions.js.map +1 -0
- package/dist/workflows/types.d.ts +9 -42
- package/dist/workflows/workflow-message-content.d.ts +7 -1
- package/dist/workflows/workflow-message-content.js +22 -4
- package/dist/workflows/workflow-message-content.js.map +1 -1
- package/docs/2026-08-25-workflow-follow-ups.md +5 -5
- package/docs/2026-09-02-unify-workflow-messages-plan.md +2 -0
- package/docs/2026-09-04-workflow-run-state-plan.md +2 -0
- package/docs/2026-09-06-durable-execution-plan.md +176 -0
- package/docs/2026-09-07-workflow-handoff-plan.md +84 -0
- package/docs/DEFERRED_TURNS.md +84 -105
- package/docs/HUMAN_DECISIONS.md +17 -19
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +1 -1
- package/docs/SQLITE_STATE.md +68 -29
- package/docs/WORKFLOW_SERVER.md +21 -10
- package/docs/WORKFLOW_STEP_MESSAGES.md +83 -54
- package/docs/plans/2026-08-04-controller-runtime-plan.md +2 -0
- package/docs/plans/2026-08-21-deferred-turn-intents-plan.md +2 -0
- package/docs/plans/2026-08-27-workflow-terminal-restart-plan.md +2 -0
- package/docs/workflows.md +111 -45
- package/examples/workflows/autoresearch.workflow.ts +0 -2
- package/examples/workflows/branch.workflow.ts +0 -4
- package/examples/workflows/echo.workflow.ts +0 -2
- package/examples/workflows/live-settings.workflow.ts +0 -2
- package/examples/workflows/two-turn.workflow.ts +0 -2
- package/herdr-plugin.toml +1 -1
- package/package.json +1 -1
- package/protocol/fixtures/client-v1.json +1 -1
- package/skills/pi-workflows/SKILL.md +8 -7
- package/src/builtins/autoimplement.workflow.ts +31 -10
- package/src/client/client.ts +3 -1
- package/src/client/protocol.ts +21 -1
- package/src/client/view.ts +9 -5
- package/src/extension/index.ts +118 -190
- package/src/extension/recorder.ts +2 -2
- package/src/extension/step-message.ts +4 -4
- package/src/extension/widget.ts +1 -1
- package/src/extension/workflow-message-coordinator.ts +133 -95
- package/src/render/graph-render.ts +1 -1
- package/src/resource-managers/index.ts +1 -9
- package/src/resource-managers/sqlite.ts +330 -2655
- package/src/resource-managers/types.ts +2 -3
- package/src/server/resource-runner-entry.ts +2 -7
- package/src/server/rpc-bridge.ts +1 -1
- package/src/server/rpc-executor.ts +4 -9
- package/src/server/server-entry.ts +3 -0
- package/src/server/server.ts +416 -641
- package/src/server/state.ts +122 -466
- package/src/server/view.ts +73 -58
- package/src/server/workflow-runner-entry.ts +2 -55
- package/src/server/workflow-runner-protocol.ts +5 -15
- package/src/server/workflow-runner-store.ts +12 -27
- package/src/state/attempt-time.ts +122 -0
- package/src/state/json.ts +2 -1
- package/src/state/project-store.ts +218 -0
- package/src/state/prune.ts +0 -13
- package/src/state/schema.ts +23 -23
- package/src/state/workflow-messages.ts +4 -2
- package/src/viewer/backup.ts +7 -0
- package/src/workflows/diagnostics.ts +78 -0
- package/src/workflows/engine.ts +136 -299
- package/src/workflows/errors.ts +4 -2
- package/src/workflows/human-decision.ts +3 -81
- package/src/workflows/index.ts +8 -2
- package/src/workflows/queue.ts +2091 -0
- package/src/workflows/requests.ts +283 -0
- package/src/workflows/schema.ts +2 -6
- package/src/workflows/store.ts +226 -236
- package/src/workflows/tool-input.ts +20 -12
- package/src/workflows/transitions.ts +330 -0
- package/src/workflows/types.ts +9 -46
- package/src/workflows/workflow-message-content.ts +28 -4
- package/dist/resource-managers/runtime.d.ts +0 -59
- package/dist/resource-managers/runtime.js +0 -423
- package/dist/resource-managers/runtime.js.map +0 -1
- package/src/resource-managers/runtime.ts +0 -576
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Workflow messages in Pi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is the current workflow-message contract. The [durable execution plan](2026-09-06-durable-execution-plan.md) supersedes the earlier automatic terminal-turn and reminder behavior.
|
|
4
4
|
|
|
5
5
|
## Goal
|
|
6
6
|
|
|
7
|
-
Pi Workflows must add several kinds of content to an origin Pi conversation. These include interactive step prompts, protected human decisions, passive notifications, terminal results, and follow-up prompts. Initial
|
|
7
|
+
Pi Workflows must add several kinds of content to an origin Pi conversation. These include interactive step prompts, protected human decisions, passive notifications, terminal results, and follow-up prompts. Initial and resumed prompts are one step-message kind with different display reasons.
|
|
8
8
|
|
|
9
9
|
The server saves all of them as workflow messages. One extension component sends them through documented Pi APIs. Feature records continue to own workflow results, answers, settings, and timeouts.
|
|
10
10
|
|
|
@@ -16,13 +16,13 @@ A workflow message is content that Pi Workflows requires Pi to add to one conver
|
|
|
16
16
|
|
|
17
17
|
The message kinds are:
|
|
18
18
|
|
|
19
|
-
| Kind | Pi behavior
|
|
20
|
-
| -------------- |
|
|
21
|
-
| `step` | Custom message that starts a model turn
|
|
22
|
-
| `decision` | Custom message that does not start a model turn
|
|
23
|
-
| `notification` | Custom message that does not start a model turn
|
|
24
|
-
| `terminal` |
|
|
25
|
-
| `followUp` | Custom message that starts normal work
|
|
19
|
+
| Kind | Pi behavior | Purpose |
|
|
20
|
+
| -------------- | ------------------------------------------------ | ------------------------------------------ |
|
|
21
|
+
| `step` | Custom message that starts a model turn | Initial or resumed interactive prompt |
|
|
22
|
+
| `decision` | Custom message that does not start a model turn | Protected choice for a person |
|
|
23
|
+
| `notification` | Custom message that does not start a model turn | Passive workflow notice |
|
|
24
|
+
| `terminal` | Visible message that does not start a model turn | Recorded terminal result |
|
|
25
|
+
| `followUp` | Custom message that starts normal work | Work saved for after successful completion |
|
|
26
26
|
|
|
27
27
|
The server stores one `WorkflowMessage` record before Pi can send it:
|
|
28
28
|
|
|
@@ -61,7 +61,7 @@ Every step message uses the custom type `pi-workflows-step`:
|
|
|
61
61
|
export type WorkflowAgentStepMessageDetails = {
|
|
62
62
|
schema: "pi-workflows.agent-step-message.v1";
|
|
63
63
|
workflowMessageId: string;
|
|
64
|
-
reason: "initial" | "
|
|
64
|
+
reason: "initial" | "resumed";
|
|
65
65
|
contract: AgentStepContract;
|
|
66
66
|
presentation?: {
|
|
67
67
|
runTitle?: string;
|
|
@@ -84,7 +84,7 @@ pi.sendMessage(
|
|
|
84
84
|
|
|
85
85
|
The renderer reads `details` and does not parse the prompt. It shows a compact summary by default and the complete prompt when expanded. If the renderer is unavailable, Pi still retains the custom message and its content.
|
|
86
86
|
|
|
87
|
-
Submitted agent steps call
|
|
87
|
+
Submitted agent steps call `workflow submit` or `workflow update` with the exact `requestId`. Assistant-message steps reply normally and are accepted only through the separate assistant-response path at `agent_settled`. Ordinary checkpoints accept `answer`; protected decisions accept only the verified human path or their declared timeout policy. Both forms keep the existing `agent` node and use `expectedOutput` to select the completion form.
|
|
88
88
|
|
|
89
89
|
## Engine boundary
|
|
90
90
|
|
|
@@ -103,10 +103,10 @@ A collapsed step card shows only the workflow identity and current work. For exa
|
|
|
103
103
|
Checking the monitored target
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
A
|
|
106
|
+
A resumed prompt adds a short label:
|
|
107
107
|
|
|
108
108
|
```text
|
|
109
|
-
↻ monitor › check ·
|
|
109
|
+
↻ monitor › check · resumed
|
|
110
110
|
Checking the monitored target
|
|
111
111
|
```
|
|
112
112
|
|
|
@@ -120,6 +120,16 @@ Notifications keep the custom type `pi-workflows-notification` and use `triggerT
|
|
|
120
120
|
|
|
121
121
|
The extension has one `WorkflowMessageCoordinator` for all message kinds. The server keeps one active coordinator connection and process-local epoch for each origin session. A replacement connection fences the old one, so two Pi processes cannot send for the same session.
|
|
122
122
|
|
|
123
|
+
The coordinator retains only workflow-owned turns. Its local state is absent,
|
|
124
|
+
delivering, running, or settled awaiting acknowledgment. An ordinary chat turn
|
|
125
|
+
never creates an owned turn or blocks later workflow delivery. Recovery requires
|
|
126
|
+
an already recorded active workflow turn and its exact message as the latest
|
|
127
|
+
user or custom input in the active Pi branch. A delivered step with no active
|
|
128
|
+
workflow turn cannot claim a later ordinary chat response.
|
|
129
|
+
A delayed acknowledgment retains the same message, turn ID, and exact response;
|
|
130
|
+
it never creates another model attempt. Unconfirmed delivery stays visible as
|
|
131
|
+
unconfirmed instead of being reported as a received step.
|
|
132
|
+
|
|
123
133
|
The coordinator follows this sequence:
|
|
124
134
|
|
|
125
135
|
1. After every server connection, wait for the complete origin-session view and report the active branch before any send or turn report.
|
|
@@ -141,58 +151,76 @@ After Pi, the extension, or the server restarts, branch reporting runs before an
|
|
|
141
151
|
|
|
142
152
|
## Model-turn status
|
|
143
153
|
|
|
144
|
-
`agent_start` has no message payload.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
`agent_start` has no message payload. A locally delivered prompt binds its start
|
|
155
|
+
through the coordinator's saved message identity. Reconnect requires the same
|
|
156
|
+
recorded active turn, run, session, and message, with no later user or custom
|
|
157
|
+
input in the active branch. Neither a session view nor an old branch entry alone
|
|
158
|
+
proves that a message caused the current turn.
|
|
159
|
+
|
|
160
|
+
Only pending, unpaused agent requests and explicit follow-ups can open model
|
|
161
|
+
turns. Decisions, notifications, and terminal notices cannot. A stale start can
|
|
162
|
+
adopt an already closed result but cannot create new activity. An identity
|
|
163
|
+
mismatch is rejected before a turn changes.
|
|
164
|
+
|
|
165
|
+
`agent_end` records low-level stop information. The coordinator retains the
|
|
166
|
+
workflow turn through automatic Pi retries and waits for `agent_settled` before
|
|
167
|
+
submitting visible assistant text, recording the turn end, or delivering more
|
|
168
|
+
work. End reports carry `completed`, `aborted`, `error`, or `lost` and the exact
|
|
169
|
+
response-entry evidence when available. A delayed acknowledgment keeps the settled
|
|
170
|
+
response ID pending. Once message and turn ownership are confirmed, the coordinator
|
|
171
|
+
submits that exact response before it reports the end. Later events cannot replace
|
|
172
|
+
the pending turn or its response. Repeated reports adopt the saved result.
|
|
173
|
+
|
|
174
|
+
An aborted pending step pauses its run. Resume retains the request and attempt,
|
|
175
|
+
advances the request revision, and creates one resumed step message when needed.
|
|
176
|
+
A protected decision keeps its answer revision and decision message. A missing
|
|
177
|
+
submission stays pending: the host adds no reminder turn or hidden retry limit.
|
|
178
|
+
|
|
179
|
+
Execution status and Pi activity remain separate. A completed run remains
|
|
180
|
+
completed during reporting or follow-up work. A waiting run can have an active
|
|
181
|
+
origin-session turn without changing its execution status to running. Host
|
|
182
|
+
recovery closes active-time intervals at their last durable samples, not the Pi
|
|
183
|
+
turn itself. Only an idle-session branch report can prove an unended turn lost.
|
|
159
184
|
|
|
160
185
|
## Feature ownership
|
|
161
186
|
|
|
162
187
|
The workflow message stores only Pi send facts. Other records remain authoritative:
|
|
163
188
|
|
|
164
|
-
- interactive requests own
|
|
165
|
-
-
|
|
189
|
+
- interactive requests own exact response identity, kind, validation, and accepted submissions;
|
|
190
|
+
- node attempts and active intervals own execution history and the active-time budget;
|
|
191
|
+
- human decisions own choices, verified answers, and absolute expiry;
|
|
166
192
|
- terminal runs own outcomes, reasons, restart lineage, and results;
|
|
167
193
|
- notification nodes own their node results;
|
|
168
194
|
- follow-up records own prompt source and authority;
|
|
169
195
|
- settings records own current values and accepted changes.
|
|
170
196
|
|
|
171
|
-
Submitted
|
|
172
|
-
|
|
173
|
-
|
|
197
|
+
Submitted and assistant-message steps keep their exact attempt while parked.
|
|
198
|
+
Recovery adopts accepted receipts and matching branch evidence; it does not use
|
|
199
|
+
the oldest pending request or accept text from another request or branch.
|
|
174
200
|
|
|
175
|
-
|
|
201
|
+
Requests and their required messages commit together. Terminal reporting can be
|
|
202
|
+
retried from recorded facts after execution settles; a reporting failure cannot
|
|
203
|
+
reverse execution or cancellation.
|
|
176
204
|
|
|
177
|
-
|
|
205
|
+
## Terminal results and follow-ups
|
|
178
206
|
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- protected decisions in Pi and approved external channels;
|
|
185
|
-
- passive notifications that do not start model turns;
|
|
186
|
-
- terminal result retention while its message is pending or its first turn is open, and then for 60 seconds after that turn ends, in the widget and `piw`;
|
|
187
|
-
- conversation recording linked to workflow attempts.
|
|
207
|
+
A terminal result is visible but does not start a model turn. It stays in the
|
|
208
|
+
origin-session view while pending and for 60 seconds after confirmed delivery.
|
|
209
|
+
An explicit restart targets the terminal run and revision and creates fresh
|
|
210
|
+
work without copying old steps, changed settings, approvals, or effects. It has
|
|
211
|
+
no terminal-turn prerequisite or hard-coded count limit.
|
|
188
212
|
|
|
189
|
-
|
|
213
|
+
Explicit follow-ups wait for successful completion, terminal notice delivery,
|
|
214
|
+
prior follow-up settlement, and release of the session reservation. They remain
|
|
215
|
+
normal conversation work. Slash-looking text cannot dispatch an extension
|
|
216
|
+
command. External effects still require saved receipts or explicit recovery of
|
|
217
|
+
an ambiguous outcome. See [terminal workflow messages](DEFERRED_TURNS.md).
|
|
190
218
|
|
|
191
219
|
## Session recording
|
|
192
220
|
|
|
193
221
|
The extension records workflow-related Pi events through a batched server client operation. It uses documented Pi events and does not read or edit Pi session files.
|
|
194
222
|
|
|
195
|
-
The server deduplicates settled entries by Pi entry ID. It links attempts to their prompt, response, first, and last entries. A recording failure does not fail workflow execution.
|
|
223
|
+
The server deduplicates settled entries by Pi entry ID. It links attempts to their prompt, response, first, and last entries. The coordinator finalizes capture after the terminal notice has a confirmed entry on the current branch, without starting a model turn. Explicit follow-up turns have their own capture segment. A recording failure does not fail workflow execution or block the next delivery.
|
|
196
224
|
|
|
197
225
|
## Public API boundary
|
|
198
226
|
|
|
@@ -205,26 +233,27 @@ This design does not change Pi core, use private Pi APIs, or change Pi session s
|
|
|
205
233
|
Tests must prove:
|
|
206
234
|
|
|
207
235
|
- every message kind uses the one coordinator;
|
|
208
|
-
- one workflow message ID
|
|
236
|
+
- one workflow message ID adopts its confirmed Pi entry before another send;
|
|
237
|
+
- an automatic Pi retry cannot submit a partial response before the settled boundary;
|
|
209
238
|
- a later manual turn uses a new workflow turn ID without creating another Pi entry;
|
|
210
239
|
- two Pi processes that open one session cannot both send because one process-local coordinator epoch is active;
|
|
211
240
|
- restart recovery reports the branch and adopts an existing entry before it sends;
|
|
212
241
|
- branch absence is usable only when Pi is idle and has no pending input;
|
|
213
242
|
- a crash after send leaves the message pending and cannot cause a resend before branch reporting;
|
|
214
243
|
- messages remain in saved order without message-pointer deadlocks;
|
|
215
|
-
- an early `agent_start` and `
|
|
216
|
-
-
|
|
217
|
-
- normal runner
|
|
244
|
+
- an early `agent_start` and `agent_settled` wait for the message receipt and session view, then apply in order;
|
|
245
|
+
- model activity remains separate from durable execution status;
|
|
246
|
+
- normal runner progress leaves the active session capture open until the matching turn ends;
|
|
218
247
|
- stale turn-end reports and starts against closed messages are rejected;
|
|
219
248
|
- a manual turn cancels pending step messages that it supersedes;
|
|
220
249
|
- a turn cannot bind to an interaction whose run is paused;
|
|
221
|
-
- aborted turns pause without
|
|
250
|
+
- aborted pending turns pause without adding reminder work;
|
|
222
251
|
- resuming an aborted step creates one new resumed message and one fresh model turn;
|
|
223
252
|
- resuming a protected decision keeps its answer revision and does not create a duplicate decision message;
|
|
224
253
|
- server restart does not close a live Pi turn, while an idle-session branch report can close an unended turn as lost;
|
|
225
|
-
-
|
|
226
|
-
- initial
|
|
227
|
-
- terminal and follow-
|
|
254
|
+
- repeated missing submissions remain pending without automatic extra model turns;
|
|
255
|
+
- initial and resumed prompts use the same step kind and differ only by reason;
|
|
256
|
+
- terminal messages never start turns, and follow-ups start only at their declared boundary;
|
|
228
257
|
- a branch switch creates one resumed-reason step only when that branch has no entry for the interaction;
|
|
229
258
|
- a missing protected decision creates another decision message, not a step;
|
|
230
259
|
- branch evidence changes a cancelled message to sent;
|
|
@@ -8,6 +8,8 @@ status: implemented
|
|
|
8
8
|
|
|
9
9
|
# ResourceManager runtime plan
|
|
10
10
|
|
|
11
|
+
> Historical plan. The [durable execution plan](../2026-09-06-durable-execution-plan.md) supersedes its continuation, scheduling, and automatic model-turn choices. Use the current reference pages for the implemented contract.
|
|
12
|
+
|
|
11
13
|
pi-workflows needs a controller mode for automation that spans repeated events, external state changes, and process restarts. The design in [RESOURCE_MANAGERS.md](../RESOURCE_MANAGERS.md) follows the Kubernetes controller pattern. Durable resources hold desired and observed state, events enqueue resource keys, and each reconciliation reads current facts before acting.
|
|
12
14
|
|
|
13
15
|
The implementation keeps the graph engine focused on finite jobs. Controllers start and observe workflows through a child-run interface. Workflow graphs keep their finite execution model.
|
|
@@ -6,6 +6,8 @@ date: 2026-08-21
|
|
|
6
6
|
|
|
7
7
|
# Guarantee one successor turn after workflow interruption
|
|
8
8
|
|
|
9
|
+
> Historical plan. The [durable execution plan](../2026-09-06-durable-execution-plan.md) supersedes its continuation, scheduling, and automatic model-turn choices. Use the current reference pages for the implemented contract.
|
|
10
|
+
|
|
9
11
|
Pi Workflows can stop the active agent turn before the agent receives a tool result or can take its next action. This happens when an active workflow step is cancelled, times out, loses its queue claim, or is interrupted by a controller. The workflow can also return a successful start result and then fail asynchronously before it sends its first prompt. In that case, the user can see a UI error while the model still believes that the workflow started successfully.
|
|
10
12
|
|
|
11
13
|
Add one general rule: an eligible workflow event creates one durable obligation for one later agent turn. The next normal workflow prompt or result presentation satisfies the obligation when one exists. Otherwise, Pi Workflows sends one factual fallback turn after the old turn settles.
|
|
@@ -6,6 +6,8 @@ date: 2026-08-27
|
|
|
6
6
|
|
|
7
7
|
# Full plan
|
|
8
8
|
|
|
9
|
+
> Historical plan. The [durable execution plan](../2026-09-06-durable-execution-plan.md) supersedes its continuation, scheduling, and automatic model-turn choices. Use the current reference pages for the implemented contract.
|
|
10
|
+
|
|
9
11
|
## Goal
|
|
10
12
|
|
|
11
13
|
After every top-level workflow run ends, give the model one normal successor turn.
|
package/docs/workflows.md
CHANGED
|
@@ -5,6 +5,23 @@ covers the file format, every node type, edge routing, the step contract the
|
|
|
5
5
|
model sees, and how runs behave at runtime. For durable state, see
|
|
6
6
|
[SQLITE_STATE.md](SQLITE_STATE.md).
|
|
7
7
|
|
|
8
|
+
## Starting and resuming runs
|
|
9
|
+
|
|
10
|
+
A successful start call confirms that a run was created. Wait for the delivered
|
|
11
|
+
step contract before submitting an agent result. Report worktree creation or
|
|
12
|
+
implementation progress only after the corresponding recorded steps succeed.
|
|
13
|
+
The status view distinguishes unconfirmed step delivery, active agent work,
|
|
14
|
+
required results, and a durable pause. Waiting uses a different glyph from pause.
|
|
15
|
+
|
|
16
|
+
Resume uses the run's original source and graph, including ordinary workflows
|
|
17
|
+
without included workflows. Source and graph checks run before any durable
|
|
18
|
+
mutation. `WorkflowEngine.resumeRun` has no `force` option. Restore the original
|
|
19
|
+
source to resume its accepted work, or explicitly start a new run for changed
|
|
20
|
+
code. A new run does not inherit outputs, approvals, or effect receipts.
|
|
21
|
+
File and built-in source identities verify code; callers of the direct engine
|
|
22
|
+
API must supply source identity to detect callback-body changes that leave the
|
|
23
|
+
structural graph unchanged.
|
|
24
|
+
|
|
8
25
|
## Workflow files
|
|
9
26
|
|
|
10
27
|
A workflow is a TypeScript module whose default export is `defineWorkflow(...)`.
|
|
@@ -126,12 +143,12 @@ pi-workflows server run
|
|
|
126
143
|
`server run` stays attached. The other commands start, inspect, or stop the
|
|
127
144
|
on-demand process. No command installs an operating-system service.
|
|
128
145
|
|
|
129
|
-
The extension, CLI, and `piw` use the same version-1 client protocol over a Unix socket or Windows named pipe. The server sends byte-bounded run-list and run-view pages. Clients collect a complete run list for one revision and reject stale run pages whose cursor or revision no longer matches. The server reads only the selected history ranges and reuses an unchanged subscribed view after a lightweight revision check. It waits for a slow socket to drain and removes every subscription when its client unsubscribes. Large values stay available through verified content chunks. Server-generated aggregate values are saved and linked to the run before the server advertises them.
|
|
146
|
+
The extension, CLI, and `piw` use the same version-1 client protocol over a Unix socket or Windows named pipe. The server sends byte-bounded run-list and run-view pages. Clients collect a complete run list for one revision and reject stale run pages whose cursor or revision no longer matches. A run view's `revision` is the presentation cursor; `runRevision` is the execution resource revision used by restart and other exact execution commands. The server reads only the selected history ranges and reuses an unchanged subscribed view after a lightweight revision check. It waits for a slow socket to drain and removes every subscription when its client unsubscribes. Large values stay available through verified content chunks. Server-generated aggregate values are saved and linked to the run before the server advertises them.
|
|
130
147
|
|
|
131
148
|
A runner verifies the root and all mounted source identities before it loads
|
|
132
149
|
workflow modules. It then checks the resolved mounted-source map and executes
|
|
133
|
-
from committed state through a server-backed store. Resume
|
|
134
|
-
|
|
150
|
+
from committed state through a server-backed store. Resume reads return only
|
|
151
|
+
`WorkflowRunState`. Session messages, tool results, activity
|
|
135
152
|
events, viewer history, settings, follow-ups, and other inspection data stay in
|
|
136
153
|
server-owned SQLite. If one required result exceeds the runner protocol frame,
|
|
137
154
|
the server returns a digest-bound reference and the runner reads and verifies it
|
|
@@ -154,7 +171,7 @@ same request pending and returns the error to the model. Closing Pi leaves that
|
|
|
154
171
|
request pending; reopening the same session adopts the existing session entry
|
|
155
172
|
or presents it once. Step prompts, protected decisions, notifications, terminal
|
|
156
173
|
results, and follow-ups use the server-owned `workflow_messages` table and one
|
|
157
|
-
extension sender. Initial
|
|
174
|
+
extension sender. Initial and resumed prompts are the same step-message
|
|
158
175
|
kind with different display reasons. A terminal workflow message becomes
|
|
159
176
|
eligible only after the terminal outcome is committed. A resource manager child
|
|
160
177
|
without an origin session can use a supervised headless `pi --mode rpc` child
|
|
@@ -208,10 +225,11 @@ the client stops waiting but does not cancel the durable server command. A retry
|
|
|
208
225
|
uses a new transport request ID with the same durable submission identity and
|
|
209
226
|
adopts the stored result. Rejected submissions return
|
|
210
227
|
the validation error and can retry in the same step. If the model settles
|
|
211
|
-
without submitting, the
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
reported model turn, and cancellation remains active throughout.
|
|
228
|
+
without submitting, the exact request stays pending. The server does not add
|
|
229
|
+
reminder turns or apply a hidden retry limit. Additional model work must follow
|
|
230
|
+
a declared graph path or an explicit user request. The timeout remains active
|
|
231
|
+
during each reported model turn, and cancellation remains active throughout.
|
|
232
|
+
For assistant-message output, the engine appends a normal-response contract,
|
|
215
233
|
waits for `agent_settled`, rejects empty, failed, aborted, or tool-only results,
|
|
216
234
|
and never suppresses the visible text. Timeout and cancellation abort either
|
|
217
235
|
form's active Pi turn.
|
|
@@ -226,6 +244,28 @@ function can use prepared outputs to select a policy for this run. It has 30
|
|
|
226
244
|
seconds to return. Computed timeout functions are runtime code, so definition
|
|
227
245
|
snapshots omit them. Snapshots keep fixed numbers and fixed `null` values.
|
|
228
246
|
|
|
247
|
+
### Explicit summaries and fresh restarts
|
|
248
|
+
|
|
249
|
+
Terminal notices show the recorded status, result, and error. They are visible
|
|
250
|
+
messages, not model prompts. Use an explicit `assistantMessage()` node when a
|
|
251
|
+
workflow needs a written explanation. `presentationPrompt` is not supported.
|
|
252
|
+
Autoimplement prepares its structured result, runs an explicit summary node,
|
|
253
|
+
and then returns the prepared result. A failed summary cannot erase accepted work.
|
|
254
|
+
|
|
255
|
+
The extension submits visible assistant text and records the end of a workflow
|
|
256
|
+
turn at `agent_settled`. `agent_end` records only low-level activity. Automatic Pi
|
|
257
|
+
retries keep the same unsettled turn and cannot submit an unfinished response.
|
|
258
|
+
Branch evidence must identify the exact workflow message before reconnect can
|
|
259
|
+
adopt its turn.
|
|
260
|
+
|
|
261
|
+
A fresh restart requires an explicit user request and targets `runId` plus
|
|
262
|
+
`expectedRevision`. It starts from the original input in a new run. It does not
|
|
263
|
+
copy old steps, changed settings, decisions, or effects. The host rejects a stale
|
|
264
|
+
revision or unsettled external effects before reserving work. An identical retry
|
|
265
|
+
adopts the same child run. There is no terminal-message requirement or hard-coded
|
|
266
|
+
restart count. Explicit queued follow-ups become eligible after terminal notice
|
|
267
|
+
delivery; they do not wait for a terminal model turn.
|
|
268
|
+
|
|
229
269
|
### compute
|
|
230
270
|
|
|
231
271
|
Runs a TypeScript function inline. Use it for pure data shaping.
|
|
@@ -340,20 +380,21 @@ a manual effect becomes ambiguous. This is not an exactly-once claim.
|
|
|
340
380
|
|
|
341
381
|
### checkpoint
|
|
342
382
|
|
|
343
|
-
|
|
344
|
-
terminal
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
383
|
+
Creates a durable input request and parks the worker. The run is waiting, not
|
|
384
|
+
terminal. Its input, settings, history, and active attempt stay unchanged.
|
|
385
|
+
The optional callback creates the request content once. It does not complete
|
|
386
|
+
the node.
|
|
387
|
+
|
|
388
|
+
An answer completes that exact request in the same run. The answer becomes the
|
|
389
|
+
checkpoint output, and execution follows its outgoing edge. A checkpoint at the
|
|
390
|
+
end of the graph completes the run with its answer. Each answered checkpoint
|
|
391
|
+
counts once toward `maxSteps`. Invalid responses do not create another run or
|
|
392
|
+
change another request.
|
|
352
393
|
|
|
353
394
|
```typescript
|
|
354
395
|
checkpoint({
|
|
355
396
|
summary: "human decides how to proceed",
|
|
356
|
-
run: ({ outputs }) => outputs.reconcile, // optional;
|
|
397
|
+
run: ({ outputs }) => outputs.reconcile, // optional request content; defaults to { summary }
|
|
357
398
|
});
|
|
358
399
|
```
|
|
359
400
|
|
|
@@ -388,9 +429,9 @@ humanDecision({
|
|
|
388
429
|
});
|
|
389
430
|
```
|
|
390
431
|
|
|
391
|
-
The waiting run stores
|
|
432
|
+
The waiting run stores the request and asks every channel configured for the audience. The structured `subject` remains machine data. Channels receive the normalized `presentation`, title, choices, input prompts, and deadline policy. The first valid verified human answer wins. When `onTimeout` is present and no human answer wins before the saved deadline, the server accepts the declared response with `timeout` provenance and resumes the same run. This policy can continue without a configured channel. The original input remains unchanged, and the resolved response becomes the checkpoint output. `humanDecisionEdge()` provides exhaustive routing for the choices.
|
|
392
433
|
|
|
393
|
-
The model-facing workflow tool cannot answer a protected human decision. The origin Pi session displays the request without starting a model turn. A person uses `/workflow answer
|
|
434
|
+
The model-facing workflow tool cannot answer a protected human decision. The origin Pi session displays the request without starting a model turn. A person uses `/workflow answer <requestId> <response>` to send the answer through the server-owned path. Ordinary checkpoints can also use the model-facing `answer` action.
|
|
394
435
|
|
|
395
436
|
See [Human decisions](HUMAN_DECISIONS.md) for channels, recovery, persistence, and plan approval.
|
|
396
437
|
|
|
@@ -488,9 +529,9 @@ The model sees one `workflow` tool. Its `action` field supports:
|
|
|
488
529
|
- `status` for the active run or a supplied run ID;
|
|
489
530
|
- `pause` and `resume` for the active session run;
|
|
490
531
|
- `cancel` for the active run or a supplied run ID;
|
|
491
|
-
- `answer` with checkpoint
|
|
492
|
-
- `update`
|
|
493
|
-
- `submit`
|
|
532
|
+
- `answer` with an exact checkpoint `requestId` and input;
|
|
533
|
+
- `update` with an exact agent `requestId` and a non-completing update;
|
|
534
|
+
- `submit` with an exact agent `requestId` and its output.
|
|
494
535
|
|
|
495
536
|
A direct user request to continue or resume the active workflow maps to
|
|
496
537
|
`resume` immediately. The model does not call `status` instead of `resume` or
|
|
@@ -678,36 +719,42 @@ and resume later by running that wait again from the beginning.
|
|
|
678
719
|
A monitor uses the session's single active workflow slot. It does not provide
|
|
679
720
|
cron syntax, calendar scheduling, OS notifications, or a background service.
|
|
680
721
|
|
|
722
|
+
## Worker capacity
|
|
723
|
+
|
|
724
|
+
Workflow runs and resource-manager reconciles share one host scheduler. Start, restart, resume, result validation, and timeout recovery all wait for the same worker capacity. The default is four execution workers; set `PI_WORKFLOWS_MAX_WORKERS` before starting the host to change it. Waiting and paused requests keep their durable identity without occupying a worker. A submitted candidate stays durable until a worker can validate it. Cancellation does not wait for capacity.
|
|
725
|
+
|
|
726
|
+
One unfinished interactive run reserves its origin Pi session, including while waiting or paused. Independent headless work does not reserve that session.
|
|
727
|
+
|
|
681
728
|
## The step contract
|
|
682
729
|
|
|
683
730
|
Every `agent` prompt ends with a step contract block naming the workflow, the
|
|
684
|
-
step id,
|
|
731
|
+
step id, attempt id, durable request id, and expected output shape:
|
|
685
732
|
|
|
686
733
|
```
|
|
687
734
|
---
|
|
688
735
|
Workflow step contract (workflow: autoimplement, step: review, attempt: 6f9d…)
|
|
689
736
|
|
|
690
737
|
Complete this step by calling the `workflow` tool exactly once with:
|
|
691
|
-
{"action": "submit", "
|
|
738
|
+
{"action": "submit", "requestId": "request-EXACT_ID_FROM_CONTRACT", "output": <your result>}
|
|
692
739
|
Expected output: { "route": "clean" | "issues_found", "reason": "short justification" }
|
|
693
740
|
The step is complete only after the workflow tool accepts the output.
|
|
694
741
|
If the tool reports a validation error, correct the output and call it again.
|
|
695
742
|
```
|
|
696
743
|
|
|
697
|
-
The `workflow` tool uses `{ action: "submit",
|
|
698
|
-
results.
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
`validate
|
|
744
|
+
The `workflow` tool uses `{ action: "submit", requestId, output }` for step
|
|
745
|
+
results. The request binds one run and one attempt. Loops and retries get new
|
|
746
|
+
request IDs; they cannot accept an earlier request's output. A missing, stale,
|
|
747
|
+
wrong-kind, or other-session request is rejected, as is output that fails
|
|
748
|
+
`validate`. The server never selects the oldest pending request.
|
|
702
749
|
Acceptance resolves the step and the engine advances. In an interactive Pi
|
|
703
750
|
session, each agent prompt arrives as a `pi-workflows-step` custom message
|
|
704
751
|
with `triggerTurn: true`. The model receives the complete prompt, while the
|
|
705
752
|
conversation shows a compact workflow and node card. Expanding tool output with
|
|
706
|
-
Ctrl+O shows the exact contract and full prompt. Step messages with reason `
|
|
753
|
+
Ctrl+O shows the exact contract and full prompt. Step messages with reason `resumed` use the same card and keep the active attempt ID.
|
|
707
754
|
|
|
708
755
|
Headless RPC execution receives the same complete prompt without TUI metadata.
|
|
709
756
|
Workflow notifications use a custom message with `triggerTurn: false`, so a
|
|
710
|
-
notification does not start an assistant response. Step prompts, decisions, notifications, terminal results, and follow-ups use the same saved workflow-message contract and extension coordinator. Initial
|
|
757
|
+
notification does not start an assistant response. Step prompts, decisions, notifications, terminal results, and follow-ups use the same saved workflow-message contract and extension coordinator. Initial and resumed prompts use the same step kind. See
|
|
711
758
|
[Workflow messages in Pi](WORKFLOW_STEP_MESSAGES.md) and the approved
|
|
712
759
|
[workflow-message restoration plan](2026-09-02-unify-workflow-messages-plan.md).
|
|
713
760
|
|
|
@@ -726,31 +773,34 @@ returns its stored receipt.
|
|
|
726
773
|
|
|
727
774
|
A headless resource manager child cannot produce a visible assistant message without
|
|
728
775
|
an approved origin-session binding. Use structured agent output for detached
|
|
729
|
-
work. A
|
|
776
|
+
work. A terminal run creates its own terminal workflow message through the shared coordinator only after the outcome is durable.
|
|
730
777
|
|
|
731
778
|
## Runtime behavior
|
|
732
779
|
|
|
733
|
-
Runs execute one node at a time.
|
|
734
|
-
|
|
735
|
-
|
|
780
|
+
Runs execute one node at a time. Workers propose narrow transitions; the host
|
|
781
|
+
validates and commits them before execution moves on. A start must follow the
|
|
782
|
+
accepted graph route. A completed run must return its accepted final node output.
|
|
783
|
+
Workers cannot skip a checkpoint, rewrite an active attempt's start, or replace
|
|
784
|
+
the full saved run state. Defaults worth knowing:
|
|
736
785
|
|
|
737
786
|
- Node timeout is 15 minutes unless the node sets `timeoutMs` to a positive
|
|
738
787
|
number or context callback. A timed-out node has outcome `timed_out` and can
|
|
739
788
|
be routed with `$result.outcome`. A timed-out agent node also aborts its Pi
|
|
740
789
|
turn, and late output for that attempt is rejected. Interactive runs save the
|
|
741
|
-
resolved
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
790
|
+
resolved budget before they park. The host records active intervals with a
|
|
791
|
+
monotonic clock. Message delivery, waiting, pauses, disconnects, wall-clock
|
|
792
|
+
changes, and server downtime do not consume the limit. Recovery keeps the last
|
|
793
|
+
saved elapsed-time sample without rewriting the attempt's start timestamp.
|
|
794
|
+
Human decision deadlines remain absolute wall-clock deadlines.
|
|
745
795
|
- `maxSteps` (workflow-level, default 100) bounds loops built from cycles in
|
|
746
796
|
the graph.
|
|
747
797
|
- `/workflow pause` atomically parks the run with `paused: true`, stores the
|
|
748
798
|
receipt, and fences the runner before process-group shutdown. `/workflow
|
|
749
799
|
resume` takes a new generation and reruns only work after the last durable
|
|
750
800
|
boundary.
|
|
751
|
-
- The server tells each runner to `start`, `resume`,
|
|
752
|
-
|
|
753
|
-
|
|
801
|
+
- The server tells each runner to `start`, `resume`, or `restart`.
|
|
802
|
+
An answered checkpoint resumes its exact attempt in the same run. An explicit
|
|
803
|
+
restart creates a new run at the workflow start.
|
|
754
804
|
- Resuming an active run adopts the existing work. Duplicate start, control,
|
|
755
805
|
update, and submission messages return their stored receipts.
|
|
756
806
|
- A start is committed as `queued` with its final run ID before the command
|
|
@@ -773,7 +823,7 @@ resume` takes a new generation and reruns only work after the last durable
|
|
|
773
823
|
|
|
774
824
|
## Run history retention
|
|
775
825
|
|
|
776
|
-
Pi Workflows keeps a terminal root run and all its restart
|
|
826
|
+
Pi Workflows keeps a terminal root run and all its explicit restart descendants for 30 days from `finished_at`. The server can remove the tree after that point only when every descendant is terminal and no protected work or outside reference remains.
|
|
777
827
|
|
|
778
828
|
Protected work includes waiting or parked runs, live queue rows, pending workflow messages, open workflow turns, pending interactions or decisions, recording session segments, queued follow-ups, active leases, unsettled effects, controller ownership, active runner content, resumable checkpoints, and undelivered terminal results.
|
|
779
829
|
|
|
@@ -862,8 +912,24 @@ npm run test:e2e:live -- \
|
|
|
862
912
|
--model gpt-5.6-luna
|
|
863
913
|
```
|
|
864
914
|
|
|
915
|
+
For providers that reserve credit against the requested output allowance, pass
|
|
916
|
+
`--max-output-tokens N` with the generated profile. OpenRouter can reject a
|
|
917
|
+
small smoke test when the model's catalog default requests hundreds of thousands
|
|
918
|
+
of output tokens. This option changes only the exact built-in model's `maxTokens`
|
|
919
|
+
through Pi's documented `modelOverrides`. It does not change the provider, model
|
|
920
|
+
ID, API, endpoint, or credentials. The test verifies and reports the allowance,
|
|
921
|
+
keeps the complete response, and fails immediately on a provider error.
|
|
922
|
+
|
|
923
|
+
```bash
|
|
924
|
+
npm run test:e2e:live -- \
|
|
925
|
+
--provider openrouter \
|
|
926
|
+
--model deepseek/deepseek-v4-flash \
|
|
927
|
+
--max-output-tokens 4096
|
|
928
|
+
```
|
|
929
|
+
|
|
865
930
|
For subscription authentication, use a dedicated Pi profile that has no other
|
|
866
|
-
extensions or resources
|
|
931
|
+
extensions or resources. The output-budget option cannot modify this existing
|
|
932
|
+
profile:
|
|
867
933
|
|
|
868
934
|
```bash
|
|
869
935
|
npm run test:e2e:live -- \
|
|
@@ -24,8 +24,6 @@ export default defineWorkflow({
|
|
|
24
24
|
const goal = (input as AutoresearchInput).goal;
|
|
25
25
|
return goal ? `autoresearch: ${goal.slice(0, 60)}` : undefined;
|
|
26
26
|
},
|
|
27
|
-
presentationPrompt:
|
|
28
|
-
"Report the research conclusion in plain language: the winner and its numbers, or the strongest negative result, plus the journal path.",
|
|
29
27
|
maxSteps: 40,
|
|
30
28
|
startAt: "setup",
|
|
31
29
|
nodes: {
|
|
@@ -12,10 +12,6 @@ const classifyChoices = ["continue", "checkpoint"] as const;
|
|
|
12
12
|
*/
|
|
13
13
|
export default defineWorkflow({
|
|
14
14
|
name: "branch",
|
|
15
|
-
presentationPrompt: ({ state }) =>
|
|
16
|
-
state.status === "waiting"
|
|
17
|
-
? "Explain briefly why the task needs clarification, then ask the user one concrete clarification question."
|
|
18
|
-
: "Tell the user in one concise sentence how the workflow recommends proceeding.",
|
|
19
15
|
startAt: "classify",
|
|
20
16
|
nodes: {
|
|
21
17
|
classify: decision({
|
|
@@ -7,8 +7,6 @@ type EchoInput = {
|
|
|
7
7
|
/** Smallest possible workflow: one agent step that submits a JSON reply. */
|
|
8
8
|
export default defineWorkflow({
|
|
9
9
|
name: "echo",
|
|
10
|
-
presentationPrompt:
|
|
11
|
-
"Give the user the concise reply from the workflow result, with no extra commentary.",
|
|
12
10
|
startAt: "reply",
|
|
13
11
|
nodes: {
|
|
14
12
|
reply: agent({
|
|
@@ -88,6 +88,4 @@ export default defineWorkflow({
|
|
|
88
88
|
switch: { on: "$.route", cases: { normal: "normal", careful: "careful" } },
|
|
89
89
|
},
|
|
90
90
|
],
|
|
91
|
-
presentationPrompt:
|
|
92
|
-
"Explain which route and settings were used. Any queued follow-up prompts run only after this response settles.",
|
|
93
91
|
});
|
package/herdr-plugin.toml
CHANGED