@osolmaz/pi-workflows 0.15.3 → 0.16.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.
- package/README.md +24 -8
- package/dist/channels/adapter-entry.d.ts +3 -0
- package/dist/channels/adapter-entry.js +203 -0
- package/dist/channels/adapter-entry.js.map +1 -0
- package/dist/channels/config.d.ts +43 -0
- package/dist/channels/config.js +234 -0
- package/dist/channels/config.js.map +1 -0
- package/dist/channels/protocol.d.ts +94 -0
- package/dist/channels/protocol.js +219 -0
- package/dist/channels/protocol.js.map +1 -0
- package/dist/channels/telegram.d.ts +46 -0
- package/dist/channels/telegram.js +285 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/client/activity.d.ts +2 -0
- package/dist/client/activity.js +6 -0
- package/dist/client/activity.js.map +1 -0
- package/dist/client/client.d.ts +102 -0
- package/dist/client/client.js +737 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/materialize.d.ts +7 -0
- package/dist/client/materialize.js +177 -0
- package/dist/client/materialize.js.map +1 -0
- package/dist/client/protocol.d.ts +60 -0
- package/dist/client/protocol.js +275 -0
- package/dist/client/protocol.js.map +1 -0
- package/dist/client/resolver.d.ts +23 -0
- package/dist/client/resolver.js +2 -0
- package/dist/client/resolver.js.map +1 -0
- package/dist/client/view.d.ts +144 -0
- package/dist/client/view.js +3 -0
- package/dist/client/view.js.map +1 -0
- package/dist/controllers/index.d.ts +1 -1
- package/dist/controllers/index.js.map +1 -1
- package/dist/controllers/sqlite.d.ts +47 -157
- package/dist/controllers/sqlite.js +230 -406
- package/dist/controllers/sqlite.js.map +1 -1
- package/dist/extension/index.d.ts +23 -1
- package/dist/extension/index.js +734 -555
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/recorder.d.ts +95 -0
- package/dist/extension/recorder.js +530 -0
- package/dist/extension/recorder.js.map +1 -0
- package/dist/extension/remote-recorder-store.d.ts +25 -0
- package/dist/extension/remote-recorder-store.js +81 -0
- package/dist/extension/remote-recorder-store.js.map +1 -0
- package/dist/extension/session-events.d.ts +134 -0
- package/dist/extension/session-events.js +60 -0
- package/dist/extension/session-events.js.map +1 -0
- package/dist/extension/session-view.d.ts +9 -2
- package/dist/extension/session-view.js +117 -51
- package/dist/extension/session-view.js.map +1 -1
- package/dist/extension/step-message.d.ts +6 -4
- package/dist/extension/step-message.js +12 -6
- package/dist/extension/step-message.js.map +1 -1
- package/dist/extension/widget.d.ts +3 -2
- package/dist/extension/widget.js +41 -24
- package/dist/extension/widget.js.map +1 -1
- package/dist/extension/workflow-message-coordinator.d.ts +27 -0
- package/dist/extension/workflow-message-coordinator.js +294 -0
- package/dist/extension/workflow-message-coordinator.js.map +1 -0
- package/dist/host/channel-effects.d.ts +72 -0
- package/dist/host/channel-effects.js +271 -0
- package/dist/host/channel-effects.js.map +1 -0
- package/dist/host/channel-supervisor.d.ts +21 -0
- package/dist/host/channel-supervisor.js +54 -0
- package/dist/host/channel-supervisor.js.map +1 -0
- package/dist/host/child-worker-supervisor.js +1 -1
- package/dist/host/child-worker-supervisor.js.map +1 -1
- package/dist/host/resolver-entry.d.ts +2 -23
- package/dist/host/resolver-entry.js +1 -1
- package/dist/host/resolver-entry.js.map +1 -1
- package/dist/host/runner.d.ts +54 -8
- package/dist/host/runner.js +1997 -305
- package/dist/host/runner.js.map +1 -1
- package/dist/host/state.d.ts +25 -19
- package/dist/host/state.js +303 -89
- package/dist/host/state.js.map +1 -1
- package/dist/host/view.d.ts +83 -0
- package/dist/host/view.js +975 -0
- package/dist/host/view.js.map +1 -0
- package/dist/host/worker-protocol.js +1 -1
- package/dist/host/worker-protocol.js.map +1 -1
- package/dist/state/database.d.ts +1 -0
- package/dist/state/database.js +15 -0
- package/dist/state/database.js.map +1 -1
- package/dist/state/prune.d.ts +3 -1
- package/dist/state/prune.js +9 -33
- package/dist/state/prune.js.map +1 -1
- package/dist/state/schema.js +88 -98
- package/dist/state/schema.js.map +1 -1
- package/dist/state/workflow-messages.d.ts +96 -0
- package/dist/state/workflow-messages.js +335 -0
- package/dist/state/workflow-messages.js.map +1 -0
- package/dist/viewer/backup.d.ts +2 -0
- package/dist/viewer/backup.js +28 -0
- package/dist/viewer/backup.js.map +1 -0
- package/dist/viewer/cli.d.ts +4 -0
- package/dist/viewer/cli.js +150 -170
- package/dist/viewer/cli.js.map +1 -1
- package/dist/viewer/render.js +1 -1
- package/dist/viewer/render.js.map +1 -1
- package/dist/viewer/tui.d.ts +5 -7
- package/dist/viewer/tui.js +245 -108
- package/dist/viewer/tui.js.map +1 -1
- package/dist/workflows/human-decision.d.ts +2 -0
- package/dist/workflows/human-decision.js +8 -2
- package/dist/workflows/human-decision.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/settings.d.ts +1 -8
- package/dist/workflows/settings.js.map +1 -1
- package/dist/workflows/store.d.ts +67 -20
- package/dist/workflows/store.js +451 -378
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/tool-input.d.ts +21 -0
- package/dist/workflows/tool-input.js +23 -1
- package/dist/workflows/tool-input.js.map +1 -1
- package/dist/workflows/types.d.ts +5 -5
- package/dist/workflows/workflow-message-content.d.ts +38 -0
- package/dist/workflows/workflow-message-content.js +157 -0
- package/dist/workflows/workflow-message-content.js.map +1 -0
- package/docs/2026-08-18-herdr-piw-plan.md +2 -1
- package/docs/2026-08-20-durable-workflow-launch-plan.md +1 -1
- package/docs/2026-08-25-workflow-follow-ups.md +26 -50
- package/docs/2026-08-30-out-of-process-workflow-host-plan.md +3 -3
- package/docs/2026-09-01-restore-session-delivery-controls-plan.md +4 -0
- package/docs/2026-09-01-unified-workflow-client-plan.md +385 -0
- package/docs/2026-09-02-installed-live-e2e-plan.md +239 -0
- package/docs/2026-09-02-unify-workflow-messages-plan.md +562 -0
- package/docs/DEFERRED_TURNS.md +66 -294
- package/docs/HUMAN_DECISIONS.md +29 -30
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +4 -11
- package/docs/SQLITE_STATE.md +31 -25
- package/docs/WORKFLOW_HOST.md +155 -77
- package/docs/WORKFLOW_STEP_MESSAGES.md +166 -75
- package/docs/development.md +2 -1
- package/docs/live-replay-protocol.md +74 -132
- package/docs/tui-viewer.md +12 -14
- package/docs/workflows.md +78 -28
- package/herdr-plugin.toml +1 -1
- package/package.json +9 -3
- package/plugins/herdr/viewer.mjs +14 -5
- package/protocol/client.v1.schema.json +137 -0
- package/protocol/fixtures/client-v1.json +23 -0
- package/src/channels/adapter-entry.ts +220 -0
- package/src/channels/config.ts +296 -0
- package/src/channels/protocol.ts +333 -0
- package/src/channels/telegram.ts +335 -0
- package/src/client/activity.ts +6 -0
- package/src/client/client.ts +939 -0
- package/src/client/index.ts +25 -0
- package/src/client/materialize.ts +228 -0
- package/src/client/protocol.ts +333 -0
- package/src/client/resolver.ts +26 -0
- package/src/client/view.ts +163 -0
- package/src/controllers/index.ts +0 -1
- package/src/controllers/sqlite.ts +339 -808
- package/src/extension/index.ts +853 -665
- package/src/extension/recorder.ts +687 -0
- package/src/extension/remote-recorder-store.ts +126 -0
- package/src/extension/session-events.ts +119 -0
- package/src/extension/session-view.ts +157 -51
- package/src/extension/step-message.ts +19 -9
- package/src/extension/widget.ts +53 -25
- package/src/extension/workflow-message-coordinator.ts +334 -0
- package/src/host/channel-effects.ts +465 -0
- package/src/host/channel-supervisor.ts +73 -0
- package/src/host/child-worker-supervisor.ts +1 -1
- package/src/host/resolver-entry.ts +11 -26
- package/src/host/runner.ts +2639 -450
- package/src/host/state.ts +404 -137
- package/src/host/view.ts +1212 -0
- package/src/host/worker-protocol.ts +1 -1
- package/src/state/database.ts +13 -0
- package/src/state/prune.ts +14 -42
- package/src/state/schema.ts +88 -98
- package/src/state/workflow-messages.ts +548 -0
- package/src/viewer/backup.ts +29 -0
- package/src/viewer/cli.ts +171 -185
- package/src/viewer/render.ts +1 -5
- package/src/viewer/tui.ts +261 -124
- package/src/workflows/human-decision.ts +18 -2
- package/src/workflows/index.ts +0 -1
- package/src/workflows/settings.ts +1 -20
- package/src/workflows/store.ts +650 -511
- package/src/workflows/tool-input.ts +36 -1
- package/src/workflows/types.ts +5 -5
- package/src/workflows/workflow-message-content.ts +197 -0
- package/dist/extension/decision-channels.d.ts +0 -134
- package/dist/extension/decision-channels.js +0 -1307
- package/dist/extension/decision-channels.js.map +0 -1
- package/dist/host/client.d.ts +0 -48
- package/dist/host/client.js +0 -216
- package/dist/host/client.js.map +0 -1
- package/dist/host/protocol.d.ts +0 -38
- package/dist/host/protocol.js +0 -156
- package/dist/host/protocol.js.map +0 -1
- package/dist/viewer/watch.d.ts +0 -6
- package/dist/viewer/watch.js +0 -46
- package/dist/viewer/watch.js.map +0 -1
- package/src/extension/decision-channels.ts +0 -1826
- package/src/host/client.ts +0 -293
- package/src/host/protocol.ts +0 -196
- package/src/viewer/watch.ts +0 -51
|
@@ -9,6 +9,27 @@ export declare const WorkflowActionSchemas: {
|
|
|
9
9
|
workflow: Type.TString;
|
|
10
10
|
input: Type.TOptional<Type.TUnknown>;
|
|
11
11
|
}>;
|
|
12
|
+
readonly restart: TObject<{
|
|
13
|
+
action: Type.TLiteral<"restart">;
|
|
14
|
+
runId: Type.TString;
|
|
15
|
+
}>;
|
|
16
|
+
readonly "change-settings": TObject<{
|
|
17
|
+
action: Type.TLiteral<"change-settings">;
|
|
18
|
+
runId: Type.TOptional<Type.TString>;
|
|
19
|
+
scopeId: Type.TOptional<Type.TString>;
|
|
20
|
+
expectedChangeNumber: Type.TOptional<Type.TInteger>;
|
|
21
|
+
patch: Type.TUnknown;
|
|
22
|
+
}>;
|
|
23
|
+
readonly "queue-follow-up": TObject<{
|
|
24
|
+
action: Type.TLiteral<"queue-follow-up">;
|
|
25
|
+
runId: Type.TOptional<Type.TString>;
|
|
26
|
+
prompt: Type.TString;
|
|
27
|
+
}>;
|
|
28
|
+
readonly "remove-follow-up": TObject<{
|
|
29
|
+
action: Type.TLiteral<"remove-follow-up">;
|
|
30
|
+
runId: Type.TOptional<Type.TString>;
|
|
31
|
+
followUpId: Type.TString;
|
|
32
|
+
}>;
|
|
12
33
|
readonly status: TObject<{
|
|
13
34
|
action: Type.TLiteral<"status">;
|
|
14
35
|
runId: Type.TOptional<Type.TString>;
|
|
@@ -9,7 +9,7 @@ const inputSchema = Type.Unknown({
|
|
|
9
9
|
description: "Ordinary checkpoint answer for answer; protected human decisions require a human channel; optional structured workflow input for start",
|
|
10
10
|
});
|
|
11
11
|
const runIdSchema = Type.String({
|
|
12
|
-
description: "Run id; optional for status, cancel, and
|
|
12
|
+
description: "Run id; required for restart and optional for status, cancel, answer, settings, and follow-ups",
|
|
13
13
|
});
|
|
14
14
|
const stepSchema = Type.String({
|
|
15
15
|
description: "Workflow step id; required when action is update or submit",
|
|
@@ -32,6 +32,24 @@ export const WorkflowActionSchemas = {
|
|
|
32
32
|
workflow: workflowSchema,
|
|
33
33
|
input: Type.Optional(inputSchema),
|
|
34
34
|
}, noExtraProperties),
|
|
35
|
+
restart: Type.Object({ action: Type.Literal("restart"), runId: runIdSchema }, noExtraProperties),
|
|
36
|
+
"change-settings": Type.Object({
|
|
37
|
+
action: Type.Literal("change-settings"),
|
|
38
|
+
runId: Type.Optional(runIdSchema),
|
|
39
|
+
scopeId: Type.Optional(Type.String()),
|
|
40
|
+
expectedChangeNumber: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
41
|
+
patch: Type.Unknown(),
|
|
42
|
+
}, noExtraProperties),
|
|
43
|
+
"queue-follow-up": Type.Object({
|
|
44
|
+
action: Type.Literal("queue-follow-up"),
|
|
45
|
+
runId: Type.Optional(runIdSchema),
|
|
46
|
+
prompt: Type.String({ minLength: 1 }),
|
|
47
|
+
}, noExtraProperties),
|
|
48
|
+
"remove-follow-up": Type.Object({
|
|
49
|
+
action: Type.Literal("remove-follow-up"),
|
|
50
|
+
runId: Type.Optional(runIdSchema),
|
|
51
|
+
followUpId: Type.String(),
|
|
52
|
+
}, noExtraProperties),
|
|
35
53
|
status: Type.Object({ action: Type.Literal("status"), runId: Type.Optional(runIdSchema) }, noExtraProperties),
|
|
36
54
|
pause: Type.Object({ action: Type.Literal("pause") }, noExtraProperties),
|
|
37
55
|
resume: Type.Object({ action: Type.Literal("resume") }, noExtraProperties),
|
|
@@ -63,6 +81,10 @@ export const WorkflowSubmissionToolParameters = providerObjectSchema(Object.valu
|
|
|
63
81
|
const workflowInputParsers = {
|
|
64
82
|
list: (value) => parseToolInput(WorkflowActionSchemas.list, value, "workflow"),
|
|
65
83
|
start: (value) => parseToolInput(WorkflowActionSchemas.start, value, "workflow"),
|
|
84
|
+
restart: (value) => parseToolInput(WorkflowActionSchemas.restart, value, "workflow"),
|
|
85
|
+
"change-settings": (value) => parseToolInput(WorkflowActionSchemas["change-settings"], value, "workflow"),
|
|
86
|
+
"queue-follow-up": (value) => parseToolInput(WorkflowActionSchemas["queue-follow-up"], value, "workflow"),
|
|
87
|
+
"remove-follow-up": (value) => parseToolInput(WorkflowActionSchemas["remove-follow-up"], value, "workflow"),
|
|
66
88
|
status: (value) => parseToolInput(WorkflowActionSchemas.status, value, "workflow"),
|
|
67
89
|
pause: (value) => parseToolInput(WorkflowActionSchemas.pause, value, "workflow"),
|
|
68
90
|
resume: (value) => parseToolInput(WorkflowActionSchemas.resume, value, "workflow"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-input.js","sourceRoot":"","sources":["../../src/workflows/tool-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA6D,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,iBAAiB,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAW,CAAC;AAEnE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,s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K,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACpE,MAAM,YAAY,GAAG,OAAO,KAAK,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC;YACpF,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,CAAC;QACtD,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,gBAAgB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
|
@@ -79,9 +79,9 @@ export type WorkflowProgressData = {
|
|
|
79
79
|
};
|
|
80
80
|
export type WorkflowNodeCommon = {
|
|
81
81
|
/**
|
|
82
|
-
* Per-node timeout or a callback that derives it from the run context.
|
|
83
|
-
*
|
|
84
|
-
* default (15 minutes).
|
|
82
|
+
* Per-node active-execution timeout or a callback that derives it from the run context.
|
|
83
|
+
* Waiting, paused, disconnected, and host-down origin-session time does not count.
|
|
84
|
+
* Null disables the deadline. Omission falls back to the engine default (15 minutes).
|
|
85
85
|
*/
|
|
86
86
|
timeoutMs?: number | null | ((context: WorkflowNodeContext) => MaybePromise<number | null>);
|
|
87
87
|
/** Short human-readable label shown in the viewer while the node runs. */
|
|
@@ -361,7 +361,7 @@ export type HumanDecisionSettlementRecord = {
|
|
|
361
361
|
decisionId: string;
|
|
362
362
|
requestDigest: string;
|
|
363
363
|
channel: string;
|
|
364
|
-
state: "confirmed" | "failed";
|
|
364
|
+
state: "confirmed" | "failed" | "unknown";
|
|
365
365
|
createdAt: string;
|
|
366
366
|
finishedAt: string;
|
|
367
367
|
errorCode?: string;
|
|
@@ -589,7 +589,7 @@ export type WorkflowRunState = {
|
|
|
589
589
|
currentNode?: string;
|
|
590
590
|
currentAttemptId?: string;
|
|
591
591
|
currentNodeStartedAt?: string;
|
|
592
|
-
/** Durable
|
|
592
|
+
/** Durable active-execution deadline for the current attempt. Null disables the deadline. */
|
|
593
593
|
currentNodeDeadlineAt?: string | null;
|
|
594
594
|
currentSettingsScopeId?: string;
|
|
595
595
|
currentSettingsChangeNumber?: number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { JsonValue } from "../state/json.js";
|
|
2
|
+
import { type WorkflowMessageContent, type WorkflowStepReason } from "../state/workflow-messages.js";
|
|
3
|
+
export declare const WORKFLOW_STEP_MESSAGE_TYPE = "pi-workflows-step";
|
|
4
|
+
export declare const WORKFLOW_DECISION_MESSAGE_TYPE = "pi-workflows-interaction";
|
|
5
|
+
export declare const WORKFLOW_NOTIFICATION_MESSAGE_TYPE = "pi-workflows-notification";
|
|
6
|
+
export declare const WORKFLOW_TERMINAL_MESSAGE_TYPE = "pi-workflows-presentation";
|
|
7
|
+
export declare const WORKFLOW_FOLLOW_UP_MESSAGE_TYPE = "pi-workflows-follow-up";
|
|
8
|
+
export declare function stepWorkflowMessageContent(options: {
|
|
9
|
+
workflowMessageId: string;
|
|
10
|
+
requestId: string;
|
|
11
|
+
contract: JsonValue;
|
|
12
|
+
reason: WorkflowStepReason;
|
|
13
|
+
}): WorkflowMessageContent;
|
|
14
|
+
export declare function decisionWorkflowMessageContent(options: {
|
|
15
|
+
workflowMessageId: string;
|
|
16
|
+
requestId: string;
|
|
17
|
+
runId: string;
|
|
18
|
+
contract: JsonValue;
|
|
19
|
+
}): WorkflowMessageContent;
|
|
20
|
+
export declare function notificationWorkflowMessageContent(options: {
|
|
21
|
+
workflowMessageId: string;
|
|
22
|
+
notificationId: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
kind: "progress" | "final";
|
|
25
|
+
content: string;
|
|
26
|
+
}): WorkflowMessageContent;
|
|
27
|
+
export declare function terminalWorkflowMessageContent(options: {
|
|
28
|
+
workflowMessageId: string;
|
|
29
|
+
runId: string;
|
|
30
|
+
content: string;
|
|
31
|
+
details: JsonValue;
|
|
32
|
+
}): WorkflowMessageContent;
|
|
33
|
+
export declare function followUpWorkflowMessageContent(options: {
|
|
34
|
+
workflowMessageId: string;
|
|
35
|
+
followUpId: string;
|
|
36
|
+
runId: string;
|
|
37
|
+
prompt: string;
|
|
38
|
+
}): WorkflowMessageContent;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { WORKFLOW_MESSAGE_CONTENT_SCHEMA, } from "../state/workflow-messages.js";
|
|
2
|
+
export const WORKFLOW_STEP_MESSAGE_TYPE = "pi-workflows-step";
|
|
3
|
+
export const WORKFLOW_DECISION_MESSAGE_TYPE = "pi-workflows-interaction";
|
|
4
|
+
export const WORKFLOW_NOTIFICATION_MESSAGE_TYPE = "pi-workflows-notification";
|
|
5
|
+
export const WORKFLOW_TERMINAL_MESSAGE_TYPE = "pi-workflows-presentation";
|
|
6
|
+
export const WORKFLOW_FOLLOW_UP_MESSAGE_TYPE = "pi-workflows-follow-up";
|
|
7
|
+
export function stepWorkflowMessageContent(options) {
|
|
8
|
+
const outer = requireRecord(options.contract, "Stored workflow step contract");
|
|
9
|
+
const agent = requireAgentContract(outer.contract);
|
|
10
|
+
const details = {
|
|
11
|
+
schema: "pi-workflows.agent-step-message.v1",
|
|
12
|
+
kind: "step",
|
|
13
|
+
contract: agent,
|
|
14
|
+
requestId: options.requestId,
|
|
15
|
+
workflowMessageId: options.workflowMessageId,
|
|
16
|
+
reason: options.reason,
|
|
17
|
+
};
|
|
18
|
+
if (isRecord(outer.presentation))
|
|
19
|
+
details.presentation = outer.presentation;
|
|
20
|
+
return {
|
|
21
|
+
schema: WORKFLOW_MESSAGE_CONTENT_SCHEMA,
|
|
22
|
+
customType: WORKFLOW_STEP_MESSAGE_TYPE,
|
|
23
|
+
content: typeof outer.prompt === "string" ? outer.prompt : "Continue the workflow step.",
|
|
24
|
+
display: true,
|
|
25
|
+
details,
|
|
26
|
+
triggerTurn: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function decisionWorkflowMessageContent(options) {
|
|
30
|
+
const contract = requireRecord(options.contract, "Stored workflow decision contract");
|
|
31
|
+
return {
|
|
32
|
+
schema: WORKFLOW_MESSAGE_CONTENT_SCHEMA,
|
|
33
|
+
customType: WORKFLOW_DECISION_MESSAGE_TYPE,
|
|
34
|
+
content: decisionPrompt(contract),
|
|
35
|
+
display: true,
|
|
36
|
+
details: {
|
|
37
|
+
workflowMessageId: options.workflowMessageId,
|
|
38
|
+
requestId: options.requestId,
|
|
39
|
+
runId: options.runId,
|
|
40
|
+
kind: "decision",
|
|
41
|
+
},
|
|
42
|
+
triggerTurn: false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function notificationWorkflowMessageContent(options) {
|
|
46
|
+
return {
|
|
47
|
+
schema: WORKFLOW_MESSAGE_CONTENT_SCHEMA,
|
|
48
|
+
customType: WORKFLOW_NOTIFICATION_MESSAGE_TYPE,
|
|
49
|
+
content: options.content,
|
|
50
|
+
display: true,
|
|
51
|
+
details: {
|
|
52
|
+
workflowMessageId: options.workflowMessageId,
|
|
53
|
+
notificationId: options.notificationId,
|
|
54
|
+
runId: options.runId,
|
|
55
|
+
kind: options.kind,
|
|
56
|
+
},
|
|
57
|
+
triggerTurn: false,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function terminalWorkflowMessageContent(options) {
|
|
61
|
+
return {
|
|
62
|
+
schema: WORKFLOW_MESSAGE_CONTENT_SCHEMA,
|
|
63
|
+
customType: WORKFLOW_TERMINAL_MESSAGE_TYPE,
|
|
64
|
+
content: options.content,
|
|
65
|
+
display: false,
|
|
66
|
+
details: {
|
|
67
|
+
workflowMessageId: options.workflowMessageId,
|
|
68
|
+
runId: options.runId,
|
|
69
|
+
kind: "terminal",
|
|
70
|
+
terminal: options.details,
|
|
71
|
+
},
|
|
72
|
+
triggerTurn: true,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function followUpWorkflowMessageContent(options) {
|
|
76
|
+
return {
|
|
77
|
+
schema: WORKFLOW_MESSAGE_CONTENT_SCHEMA,
|
|
78
|
+
customType: WORKFLOW_FOLLOW_UP_MESSAGE_TYPE,
|
|
79
|
+
content: options.prompt,
|
|
80
|
+
display: true,
|
|
81
|
+
details: {
|
|
82
|
+
workflowMessageId: options.workflowMessageId,
|
|
83
|
+
followUpId: options.followUpId,
|
|
84
|
+
runId: options.runId,
|
|
85
|
+
kind: "followUp",
|
|
86
|
+
},
|
|
87
|
+
triggerTurn: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function requireAgentContract(value) {
|
|
91
|
+
if (!isRecord(value) ||
|
|
92
|
+
typeof value.runId !== "string" ||
|
|
93
|
+
typeof value.workflowName !== "string" ||
|
|
94
|
+
typeof value.nodeId !== "string" ||
|
|
95
|
+
typeof value.attemptId !== "string" ||
|
|
96
|
+
(value.completion !== "submit" && value.completion !== "assistant")) {
|
|
97
|
+
throw new Error("Stored workflow agent contract is invalid");
|
|
98
|
+
}
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
function decisionPrompt(contract) {
|
|
102
|
+
const title = typeof contract.title === "string" ? contract.title : "Workflow decision";
|
|
103
|
+
const presentation = isRecord(contract.presentation) ? contract.presentation : {};
|
|
104
|
+
const blocks = Array.isArray(presentation.blocks)
|
|
105
|
+
? presentation.blocks.flatMap((block) => decisionBlockText(block))
|
|
106
|
+
: [];
|
|
107
|
+
const choices = isRecord(contract.choices)
|
|
108
|
+
? Object.entries(contract.choices).map(([key, value]) => {
|
|
109
|
+
const choice = isRecord(value) ? value : {};
|
|
110
|
+
const label = typeof choice.label === "string" ? choice.label : key;
|
|
111
|
+
const input = isRecord(choice.input) ? choice.input : undefined;
|
|
112
|
+
const prompt = input === undefined ? "" : `; input: ${String(input.prompt ?? "text")}`;
|
|
113
|
+
return `- ${key}: ${label}${prompt}`;
|
|
114
|
+
})
|
|
115
|
+
: [];
|
|
116
|
+
return [
|
|
117
|
+
title,
|
|
118
|
+
typeof presentation.summary === "string" ? presentation.summary : "",
|
|
119
|
+
...blocks,
|
|
120
|
+
choices.length === 0 ? "" : `Choices:\n${choices.join("\n")}`,
|
|
121
|
+
"A human must answer this protected decision with `/workflow answer`.",
|
|
122
|
+
]
|
|
123
|
+
.filter(Boolean)
|
|
124
|
+
.join("\n\n");
|
|
125
|
+
}
|
|
126
|
+
function decisionBlockText(value) {
|
|
127
|
+
if (!isRecord(value))
|
|
128
|
+
return [];
|
|
129
|
+
if (value.kind === "paragraph" && typeof value.text === "string")
|
|
130
|
+
return [value.text];
|
|
131
|
+
if (value.kind === "section" && typeof value.title === "string")
|
|
132
|
+
return [value.title];
|
|
133
|
+
if (value.kind === "preformatted" && typeof value.text === "string")
|
|
134
|
+
return [value.text];
|
|
135
|
+
if (value.kind === "bullets" && Array.isArray(value.items)) {
|
|
136
|
+
return [value.items.map((item) => `- ${String(item)}`).join("\n")];
|
|
137
|
+
}
|
|
138
|
+
if (value.kind === "fields" && Array.isArray(value.items)) {
|
|
139
|
+
return [
|
|
140
|
+
value.items
|
|
141
|
+
.flatMap((item) => isRecord(item) && typeof item.label === "string" && typeof item.value === "string"
|
|
142
|
+
? [`${item.label}: ${item.value}`]
|
|
143
|
+
: [])
|
|
144
|
+
.join("\n"),
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
function requireRecord(value, label) {
|
|
150
|
+
if (!isRecord(value))
|
|
151
|
+
throw new Error(`${label} is invalid`);
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
function isRecord(value) {
|
|
155
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=workflow-message-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-message-content.js","sourceRoot":"","sources":["../../src/workflows/workflow-message-content.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,GAGhC,MAAM,+BAA+B,CAAC;AAGvC,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AACzE,MAAM,CAAC,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AAC9E,MAAM,CAAC,MAAM,8BAA8B,GAAG,2BAA2B,CAAC;AAC1E,MAAM,CAAC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AAExE,MAAM,UAAU,0BAA0B,CAAC,OAK1C;IACC,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAC;IAC/E,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,OAAO,GAA8B;QACzC,MAAM,EAAE,oCAAoC;QAC5C,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAA6B;QACvC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;IACF,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAAE,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC,YAAyB,CAAC;IACzF,OAAO;QACL,MAAM,EAAE,+BAA+B;QACvC,UAAU,EAAE,0BAA0B;QACtC,OAAO,EAAE,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,6BAA6B;QACxF,OAAO,EAAE,IAAI;QACb,OAAO;QACP,WAAW,EAAE,IAAI;KAClB,CAA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CAAC,EAAE,CACP;iBACA,IAAI,CAAC,IAAI,CAAC;SACd,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,KAAa;IAClD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -26,7 +26,7 @@ When pi-workflows runs inside Herdr, show a shortcut that opens the current run
|
|
|
26
26
|
|
|
27
27
|
### One package with two host entry points
|
|
28
28
|
|
|
29
|
-
The package root will contain `herdr-plugin.toml`. Pi loads the existing extension entry point. Herdr loads a `piw` pane entry point from the same package root. A small checked-in JavaScript launcher validates
|
|
29
|
+
The package root will contain `herdr-plugin.toml`. Pi loads the existing extension entry point. Herdr loads a `piw` pane entry point from the same package root. A small checked-in JavaScript launcher validates the workflow run ID and starts `piw` with an argv array. It uses Herdr's configured executable path when that path works. If Herdr replaced its executable after the server started and the configured path no longer exists, the launcher retries the pane label command through `PATH`.
|
|
30
30
|
|
|
31
31
|
`pi-workflows herdr setup` explicitly links the current package root with `herdr plugin link`. It is idempotent and never changes plugin registration during normal Pi startup.
|
|
32
32
|
|
|
@@ -58,6 +58,7 @@ Herdr's public snapshot does not expose plugin metadata tokens. The launcher wil
|
|
|
58
58
|
- All six placements work and preserve the calling pane unless the user selects a focused viewer.
|
|
59
59
|
- Repeated opens and Pi reloads focus the existing run viewer.
|
|
60
60
|
- Failures produce bounded, useful messages and leave no empty tab or workspace.
|
|
61
|
+
- A viewer still opens when the Herdr server supplies a replaced executable path and the current `herdr` command is in `PATH`.
|
|
61
62
|
- The package tarball contains the Herdr manifest and launcher.
|
|
62
63
|
- `osolmaz/pi-workflows` is public, has a root `herdr-plugin.toml`, and has the `herdr-plugin` GitHub topic.
|
|
63
64
|
|
|
@@ -6,7 +6,7 @@ date: 2026-08-20
|
|
|
6
6
|
|
|
7
7
|
# Make deferred workflow launches durable
|
|
8
8
|
|
|
9
|
-
The launch queue and activation contract in this plan remain current. [
|
|
9
|
+
The launch queue and activation contract in this plan remain current. The send-specific parts are historical. [Terminal workflow messages](DEFERRED_TURNS.md) and the approved [workflow-message restoration plan](2026-09-02-unify-workflow-messages-plan.md) replace every deferred-turn intent and launch-failure sender in this plan with the shared `workflow_messages` path.
|
|
10
10
|
|
|
11
11
|
## Goal
|
|
12
12
|
|
|
@@ -6,9 +6,9 @@ date: 2026-08-25
|
|
|
6
6
|
|
|
7
7
|
# Continue normal work after a workflow finishes
|
|
8
8
|
|
|
9
|
-
A workflow can save several normal
|
|
9
|
+
A workflow can save several prompts for normal work while it runs. Pi Workflows sends them in order only after the workflow is officially terminal, its terminal message is sent, and its terminal model turn has ended. The completed workflow stays terminal and does not enter its start node again.
|
|
10
10
|
|
|
11
|
-
Follow-up prompts are separate from workflow settings. JSON Patch changes future workflow behavior. Follow-up actions create later normal
|
|
11
|
+
Follow-up prompts are separate from workflow settings. JSON Patch changes future workflow behavior. Follow-up actions create later normal conversation turns.
|
|
12
12
|
|
|
13
13
|
## Queue and remove prompts
|
|
14
14
|
|
|
@@ -61,74 +61,50 @@ The host creates the actor and stable request identity. Prompt data cannot claim
|
|
|
61
61
|
|
|
62
62
|
## Ordering and run states
|
|
63
63
|
|
|
64
|
-
Prompts keep database acceptance order. Several
|
|
64
|
+
Prompts keep database acceptance order. Several requests can add several prompts while one workflow response is in progress.
|
|
65
65
|
|
|
66
66
|
- Running, paused, parked, and waiting workflows accept new prompts.
|
|
67
67
|
- Pause and park keep prompts queued.
|
|
68
|
-
- A checkpoint continuation
|
|
69
|
-
- Successful completion records the terminal run and terminal
|
|
68
|
+
- A checkpoint continuation keeps queued prompt rows attached to the chain member that accepted them. The host walks the continuation chain to determine their final source outcome; it does not rewrite the rows.
|
|
69
|
+
- Successful completion records the terminal run and terminal workflow message before a follow-up can send.
|
|
70
70
|
- Failed, timed-out, and cancelled workflows cancel every unsent prompt.
|
|
71
71
|
- A terminal workflow rejects new prompts. Repeating an earlier request ID can still return its first result.
|
|
72
72
|
|
|
73
73
|
A repeated request ID with the same prompt returns the first result. Reusing that ID with different content fails.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Each accepted prompt creates its `workflow_follow_ups` source record and one `followUp` workflow message in one transaction. The message points to its source through `sourceId`; the source row stores no message pointer. The host derives eligibility from saved domain facts. A follow-up is eligible only after the source continuation chain completes successfully, its terminal message turn ends, every earlier accepted follow-up is settled or cancelled, and no nonterminal run, including one waiting for a checkpoint or protected decision, reserves the origin session.
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
## One message path
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
- `pending`: the terminal run has a final response that has not settled;
|
|
81
|
-
- `settled`: the active session branch contains the presentation message and its completed assistant response;
|
|
82
|
-
- `unavailable`: the extension recorded a definite timeout, failure, or restart gap.
|
|
79
|
+
The shared `WorkflowMessageCoordinator` handles follow-ups. There is no follow-up sender.
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
1. Wait for the terminal outcome, sent terminal workflow message, and matching model-turn end.
|
|
82
|
+
2. After every host connection, wait for the complete origin-session view and report the active branch.
|
|
83
|
+
3. Wait until the host view names this `followUp` as the next eligible pending message, Pi is idle, and no earlier workflow message is active.
|
|
84
|
+
4. Keep its ID in the coordinator's in-memory queued map and report a matching active-branch entry when one already exists.
|
|
85
|
+
5. Otherwise, recheck synchronously that Pi is idle, has no pending input, the message is absent, and the connection still owns the active coordinator epoch. Call documented `pi.sendMessage()` with the follow-up prompt and `triggerTurn: true` without an `await` between the check and call.
|
|
86
|
+
6. Report the active branch so the host saves the observed Pi entry ID and marks the message `sent`.
|
|
87
|
+
7. Wait for that turn and any workflow it starts to finish before the next follow-up becomes eligible.
|
|
85
88
|
|
|
86
|
-
The
|
|
87
|
-
|
|
88
|
-
## Delivery
|
|
89
|
-
|
|
90
|
-
The follow-up coordinator handles one prompt at a time:
|
|
91
|
-
|
|
92
|
-
1. Wait for terminal workflow state, a resolved terminal decision intent, and a completed final-response barrier.
|
|
93
|
-
2. Wait for the target session to be idle and have no active workflow.
|
|
94
|
-
3. Claim the first ready prompt with a lease.
|
|
95
|
-
4. Scan the active session branch for its stable follow-up ID.
|
|
96
|
-
5. If the message already exists, save its session entry ID without sending it again.
|
|
97
|
-
6. Otherwise, call documented `pi.sendUserMessage` with the prompt and a short nonsecret ID in a Markdown comment.
|
|
98
|
-
7. After Pi saves the normal user message, scan the branch and save its entry ID and send time.
|
|
99
|
-
8. Wait for that user turn and any workflow it starts to finish before taking the next prompt.
|
|
100
|
-
|
|
101
|
-
`pi.sendUserMessage` returns no message ID. Branch evidence is required after a new send and after restart.
|
|
102
|
-
|
|
103
|
-
The follow-up message is a normal user message. It can start normal work or a different workflow. It cannot resume or reactivate the completed workflow. A `restart` selected from the terminal decision is a separate immutable workflow run, not a follow-up prompt.
|
|
89
|
+
The follow-up custom message starts normal conversation work and can use a user-style renderer. Its internal workflow message ID stays in custom details and does not enter provider-facing content. It can ask the model to start another workflow, but it cannot resume or reactivate the completed workflow. Text that starts with `/` remains plain model input; a custom message cannot dispatch a Pi slash command or expand a prompt template. A `restart` chosen from the terminal turn creates a separate immutable workflow run.
|
|
104
90
|
|
|
105
91
|
Follow-up storage contains only prompts explicitly queued through this feature. Terminal restart does not find, copy, hash, or store an original user message. Conversation history remains owned by Pi.
|
|
106
92
|
|
|
107
93
|
## Failure handling
|
|
108
94
|
|
|
109
|
-
- A crash before
|
|
110
|
-
- A crash after
|
|
111
|
-
- A
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
- Branching follows the active Pi branch. A message on another branch does not count as delivered on the active branch.
|
|
95
|
+
- A crash before send leaves the workflow message `pending`.
|
|
96
|
+
- A crash after send but before the branch report also leaves it `pending`; reconnect reports the active branch before another send.
|
|
97
|
+
- A matching hidden workflow message ID changes a pending or cancelled message to `sent` because the Pi entry already exists.
|
|
98
|
+
- An unavailable session leaves the workflow message `pending`.
|
|
99
|
+
- An entry on another Pi branch does not confirm the send on the active branch.
|
|
100
|
+
- A stale coordinator epoch cannot send or report message state.
|
|
116
101
|
|
|
117
|
-
|
|
102
|
+
Documented Pi APIs do not prove cross-branch absence or exactly-once model execution. Pi Workflows guarantees only its saved order, message state, active-branch evidence, and local state. Sending also needs a later live Pi process, target session, and provider. This feature adds no external service.
|
|
118
103
|
|
|
119
104
|
## Saved states
|
|
120
105
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
- `queued`;
|
|
124
|
-
- `pending_presentation`;
|
|
125
|
-
- `ready`;
|
|
126
|
-
- `sent`;
|
|
127
|
-
- `removed`;
|
|
128
|
-
- `cancelled`.
|
|
129
|
-
|
|
130
|
-
A lease is temporary claim data, not another follow-up state.
|
|
106
|
+
`workflow_follow_ups` stores each prompt, source, queue order, and whether the source was removed or cancelled. It does not copy a workflow message ID, message state, or Pi entry ID. `workflow_messages` owns `pending`, `sent`, and `cancelled` state and points back to the source row.
|
|
131
107
|
|
|
132
|
-
|
|
108
|
+
Prompt text stays in the existing content-addressed value store. Normal status views show IDs, order, source type, and state without printing full prompts.
|
|
133
109
|
|
|
134
|
-
This is
|
|
110
|
+
This is an alpha hard change. It keeps schema version 1 and adds no Pi core change, private Pi API, external queue, compatibility reader, dual write, alias, fallback, or second schema.
|
|
@@ -6,7 +6,7 @@ date: 2026-08-30
|
|
|
6
6
|
|
|
7
7
|
# Run workflows outside Pi
|
|
8
8
|
|
|
9
|
-
Status: implemented
|
|
9
|
+
Status: implemented. The implementation keeps schema version 1, uses one global on-demand host, and has no embedded production fallback. The approved [workflow-message restoration plan](2026-09-02-unify-workflow-messages-plan.md) fixes the later model-turn status bug and restores session features that the hard cut removed.
|
|
10
10
|
|
|
11
11
|
A live workflow lost its lease while it was still working. The workflow engine kept the Node.js event loop busy, so its renewal timer did not run before the 30-second lease expired. The next state write used a generic error, the extension treated the error as a crash, and durable state was left with a running queue row, a running attempt, an expired lease, and a separate failed audit event.
|
|
12
12
|
|
|
@@ -209,7 +209,7 @@ Keep one active interactive request per Pi session. Other requests remain ordere
|
|
|
209
209
|
|
|
210
210
|
A protected human decision is displayed without starting a model turn. The model-facing workflow tool rejects it. A person answers it through the origin Pi session, while an ordinary checkpoint keeps its model-facing answer path.
|
|
211
211
|
|
|
212
|
-
Notify nodes
|
|
212
|
+
Notify nodes and terminal results create `workflow_messages` records in the same transaction as their source facts. The origin Pi session claims and adopts both message kinds through the one shared coordinator. There is no notification outbox or terminal-turn intent send path.
|
|
213
213
|
|
|
214
214
|
Detached workflows can use host-managed `pi --mode rpc` children. Their execution mode and origin are durable provenance.
|
|
215
215
|
|
|
@@ -236,7 +236,7 @@ The new state shape will add the minimum durable records needed for:
|
|
|
236
236
|
- child process epochs and exits;
|
|
237
237
|
- uncertain effects when existing effect rows cannot express the state.
|
|
238
238
|
|
|
239
|
-
Reuse
|
|
239
|
+
Reuse attempts, effects, and feature-specific source records when they already provide the required contract. `workflow_messages` is the only record for content that Pi must add to an origin session. Add no parallel send record for the same fact.
|
|
240
240
|
|
|
241
241
|
## Part 10: Hard cutover
|
|
242
242
|
|
|
@@ -6,6 +6,10 @@ date: 2026-09-01
|
|
|
6
6
|
|
|
7
7
|
# Restore workflow session delivery and controls
|
|
8
8
|
|
|
9
|
+
## Follow-up
|
|
10
|
+
|
|
11
|
+
This repair restored the widget, Escape pause, and the first shared sender. Version 0.16.0 still has a model-turn status bug and did not preserve all earlier session features. The approved [workflow-message restoration plan](2026-09-02-unify-workflow-messages-plan.md) replaces separate send records with one workflow-message contract and restores the remaining behavior.
|
|
12
|
+
|
|
9
13
|
The out-of-process workflow host removed the Pi workflow widget and Escape-to-pause behavior. A later delivery safety fix also caused normal polling to report `Interactive request presentation claim conflict`. This plan restores those features and fixes delivery without bringing back the embedded workflow runtime.
|
|
10
14
|
|
|
11
15
|
[Workflow host](WORKFLOW_HOST.md) remains the process and state specification. [Workflow step messages](WORKFLOW_STEP_MESSAGES.md) remains the session message specification. This plan records the cause, scope, implementation order, and acceptance checks for the repair.
|