@nylorun/runtime 0.10.0-beta → 0.12.0-beta
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/CHANGELOG.md +86 -0
- package/README.md +53 -51
- package/dist/adapters/execution/restate.d.ts +130 -0
- package/dist/adapters/execution/restate.js +442 -0
- package/dist/adapters/sandbox/virtual.js +1 -1
- package/dist/adapters/streams/s2.d.ts +18 -0
- package/dist/adapters/streams/s2.js +361 -0
- package/dist/core/executors.d.ts +4 -1
- package/dist/core/executors.js +20 -1
- package/dist/core/flow-host.d.ts +93 -132
- package/dist/core/flow-host.js +282 -547
- package/dist/core/sandbox-routes.d.ts +13 -4
- package/dist/core/sandbox-routes.js +14 -12
- package/dist/execution/memory.d.ts +54 -0
- package/dist/execution/memory.js +217 -0
- package/dist/execution/types.d.ts +125 -0
- package/dist/execution/types.js +52 -0
- package/dist/host/config-for.d.ts +2 -1
- package/dist/host/config-for.js +3 -21
- package/dist/host/config.d.ts +0 -8
- package/dist/host/create-host.d.ts +36 -1
- package/dist/host/create-host.js +51 -24
- package/dist/host/execution.d.ts +61 -0
- package/dist/host/execution.js +69 -0
- package/dist/host/http.d.ts +4 -0
- package/dist/host/http.js +6 -0
- package/dist/host/index.d.ts +3 -1
- package/dist/host/index.js +2 -0
- package/dist/host/main.js +106 -47
- package/dist/host/stack-config.d.ts +72 -0
- package/dist/host/stack-config.js +193 -0
- package/dist/index.d.ts +1 -1
- package/dist/infra/database.d.ts +16 -0
- package/dist/infra/database.js +31 -0
- package/dist/infra/execution.d.ts +39 -0
- package/dist/infra/execution.js +68 -0
- package/dist/infra/index.d.ts +42 -0
- package/dist/infra/index.js +56 -0
- package/dist/infra/readiness.d.ts +33 -0
- package/dist/infra/readiness.js +53 -0
- package/dist/infra/streams.d.ts +17 -0
- package/dist/infra/streams.js +33 -0
- package/dist/infra/workers.d.ts +39 -0
- package/dist/infra/workers.js +31 -0
- package/dist/model/pi-model.d.ts +2 -2
- package/dist/model/pi-model.js +5 -5
- package/dist/sandbox/manager.d.ts +26 -8
- package/dist/sandbox/manager.js +95 -47
- package/dist/sandbox/select.d.ts +1 -1
- package/dist/sandbox/select.js +4 -5
- package/dist/sandbox/types.d.ts +2 -2
- package/dist/store/canonical.d.ts +5 -0
- package/dist/store/canonical.js +17 -0
- package/dist/store/cursor.d.ts +9 -0
- package/dist/store/cursor.js +18 -0
- package/dist/store/memory.d.ts +57 -0
- package/dist/store/memory.js +645 -0
- package/dist/store/ownership.d.ts +19 -0
- package/dist/store/ownership.js +33 -0
- package/dist/store/postgres/connect.d.ts +25 -0
- package/dist/store/postgres/connect.js +25 -0
- package/dist/store/postgres/locking.d.ts +16 -0
- package/dist/store/postgres/locking.js +22 -0
- package/dist/store/postgres/migrations/001_initial.d.ts +27 -0
- package/dist/store/postgres/migrations/001_initial.js +196 -0
- package/dist/store/postgres/migrations/002_session_owner.d.ts +6 -0
- package/dist/store/postgres/migrations/002_session_owner.js +13 -0
- package/dist/store/postgres/migrations/index.d.ts +49 -0
- package/dist/store/postgres/migrations/index.js +76 -0
- package/dist/store/postgres/names.d.ts +11 -0
- package/dist/store/postgres/names.js +42 -0
- package/dist/store/postgres/store.d.ts +11 -0
- package/dist/store/postgres/store.js +797 -0
- package/dist/store/postgres/tenants.d.ts +90 -0
- package/dist/store/postgres/tenants.js +214 -0
- package/dist/store/types.d.ts +442 -0
- package/dist/store/types.js +10 -0
- package/dist/streams/basin.d.ts +23 -0
- package/dist/streams/basin.js +51 -0
- package/dist/streams/memory.d.ts +25 -0
- package/dist/streams/memory.js +124 -0
- package/dist/streams/relay.d.ts +37 -0
- package/dist/streams/relay.js +254 -0
- package/dist/streams/types.d.ts +115 -0
- package/dist/streams/types.js +86 -0
- package/dist/tenant/actions.d.ts +153 -0
- package/dist/tenant/actions.js +191 -0
- package/dist/tenant/advance.d.ts +15 -0
- package/dist/tenant/advance.js +439 -0
- package/dist/tenant/auth.d.ts +32 -0
- package/dist/tenant/auth.js +169 -0
- package/dist/tenant/commands.d.ts +3 -0
- package/dist/tenant/commands.js +393 -0
- package/dist/tenant/context.d.ts +147 -0
- package/dist/tenant/context.js +48 -0
- package/dist/tenant/effects.d.ts +20 -0
- package/dist/tenant/effects.js +564 -0
- package/dist/tenant/envelope.d.ts +0 -3
- package/dist/tenant/envelope.js +2 -34
- package/dist/tenant/ephemeral.d.ts +15 -4
- package/dist/tenant/ephemeral.js +106 -38
- package/dist/tenant/http.d.ts +38 -0
- package/dist/tenant/http.js +53 -0
- package/dist/tenant/live.d.ts +92 -0
- package/dist/tenant/live.js +290 -0
- package/dist/tenant/model-setting.d.ts +16 -0
- package/dist/tenant/model-setting.js +12 -0
- package/dist/tenant/module.d.ts +29 -8
- package/dist/tenant/module.js +165 -158
- package/dist/tenant/paths.d.ts +12 -8
- package/dist/tenant/paths.js +38 -12
- package/dist/tenant/principals.d.ts +12 -13
- package/dist/tenant/principals.js +50 -38
- package/dist/tenant/quarantine-error.d.ts +1 -1
- package/dist/tenant/quarantine-error.js +2 -8
- package/dist/tenant/quarantine.d.ts +0 -8
- package/dist/tenant/quarantine.js +8 -30
- package/dist/tenant/reset.d.ts +7 -6
- package/dist/tenant/reset.js +7 -51
- package/dist/tenant/routes-tenant.d.ts +12 -0
- package/dist/tenant/routes-tenant.js +137 -0
- package/dist/tenant/routes.d.ts +9 -0
- package/dist/tenant/routes.js +151 -0
- package/dist/tenant/runtime.d.ts +59 -58
- package/dist/tenant/runtime.js +243 -2201
- package/dist/tenant/scheduler.d.ts +25 -0
- package/dist/tenant/scheduler.js +84 -0
- package/dist/tenant/session.d.ts +60 -0
- package/dist/tenant/session.js +94 -0
- package/dist/tenant/sessions.d.ts +40 -0
- package/dist/tenant/sessions.js +163 -0
- package/dist/tenant/status.d.ts +13 -4
- package/dist/tenant/status.js +76 -41
- package/dist/tenant/store-memory.d.ts +9 -12
- package/dist/tenant/store-memory.js +79 -68
- package/dist/tenant/store-pg.d.ts +15 -0
- package/dist/tenant/store-pg.js +140 -0
- package/dist/tenant/streams.d.ts +126 -0
- package/dist/tenant/streams.js +419 -0
- package/dist/tenant/sweep.d.ts +15 -0
- package/dist/tenant/sweep.js +122 -0
- package/dist/tenant/transcript.d.ts +104 -0
- package/dist/tenant/transcript.js +58 -0
- package/dist/tenant/types.d.ts +101 -15
- package/dist/tenant/types.js +23 -1
- package/dist/tenant/worker.d.ts +84 -0
- package/dist/tenant/worker.js +189 -0
- package/dist/vault/service.d.ts +44 -31
- package/dist/vault/service.js +454 -360
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +15 -14
- package/dist/adapters/sandbox/microsandbox.d.ts +0 -2
- package/dist/adapters/sandbox/microsandbox.js +0 -238
- package/dist/core/store.d.ts +0 -32
- package/dist/core/store.js +0 -143
- package/dist/launcher/commands.d.ts +0 -24
- package/dist/launcher/commands.js +0 -260
- package/dist/launcher/ensure-config.d.ts +0 -16
- package/dist/launcher/ensure-config.js +0 -79
- package/dist/launcher/errors.d.ts +0 -12
- package/dist/launcher/errors.js +0 -22
- package/dist/launcher/host-config.d.ts +0 -17
- package/dist/launcher/host-config.js +0 -64
- package/dist/launcher/host-state.d.ts +0 -17
- package/dist/launcher/host-state.js +0 -61
- package/dist/launcher/lifecycle.d.ts +0 -66
- package/dist/launcher/lifecycle.js +0 -407
- package/dist/launcher/locks.d.ts +0 -26
- package/dist/launcher/locks.js +0 -117
- package/dist/launcher/logs.d.ts +0 -18
- package/dist/launcher/logs.js +0 -117
- package/dist/launcher/main.d.ts +0 -2
- package/dist/launcher/main.js +0 -66
- package/dist/launcher/output.d.ts +0 -11
- package/dist/launcher/output.js +0 -68
- package/dist/launcher/paths.d.ts +0 -20
- package/dist/launcher/paths.js +0 -36
- package/dist/launcher/probe.d.ts +0 -23
- package/dist/launcher/probe.js +0 -72
- package/dist/launcher/protocol.d.ts +0 -62
- package/dist/launcher/protocol.js +0 -1
- package/dist/launcher/schema-guard.d.ts +0 -6
- package/dist/launcher/schema-guard.js +0 -36
- package/dist/launcher/spawn.d.ts +0 -22
- package/dist/launcher/spawn.js +0 -85
- package/dist/launcher/status.d.ts +0 -6
- package/dist/launcher/status.js +0 -65
- package/dist/tenant/migration.d.ts +0 -16
- package/dist/tenant/migration.js +0 -116
- package/dist/tenant/schema.d.ts +0 -23
- package/dist/tenant/schema.js +0 -151
- package/dist/tenant/store-fs.d.ts +0 -16
- package/dist/tenant/store-fs.js +0 -205
package/dist/core/flow-host.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { Action,
|
|
1
|
+
import type { Action, ActionOutcome } from "@nylorun/core/contracts";
|
|
2
2
|
import type { JsonValue, WorkflowManifest } from "@nylorun/core/define";
|
|
3
|
-
import type {
|
|
3
|
+
import type { HostEffect } from "@nylorun/harness/run";
|
|
4
|
+
import type { Wake } from "../execution/types.js";
|
|
5
|
+
import type { EffectDoc, Tx } from "../store/types.js";
|
|
4
6
|
import { type FlowLimits } from "./limits.js";
|
|
5
7
|
/** Deterministic agent session id: derive(workflowSessionId, path, …parts). */
|
|
6
8
|
export declare function deriveSessionId(workflowSessionId: string, path: string, ...parts: string[]): string;
|
|
@@ -24,12 +26,6 @@ export type FlowLink = {
|
|
|
24
26
|
readonly effectId: string;
|
|
25
27
|
readonly turnId: string;
|
|
26
28
|
};
|
|
27
|
-
export type FlowHostStore = {
|
|
28
|
-
get<T = any>(table: string, id: string): T | undefined;
|
|
29
|
-
put(table: string, id: string, body: unknown): void;
|
|
30
|
-
all<T = any>(table: string): T[];
|
|
31
|
-
event(sessionId: string, turnId: string | null, type: string, payload: unknown): LiveEvent;
|
|
32
|
-
};
|
|
33
29
|
export type FlowHostSession = {
|
|
34
30
|
id: string;
|
|
35
31
|
agentId: string;
|
|
@@ -45,8 +41,20 @@ export type FlowHostSession = {
|
|
|
45
41
|
creation?: unknown;
|
|
46
42
|
waits?: unknown;
|
|
47
43
|
lastOutput?: JsonValue;
|
|
44
|
+
/** The turn `status`, `lastOutput` and `error` describe, once it ended. */
|
|
45
|
+
lastTurnId?: string;
|
|
48
46
|
error?: string;
|
|
49
47
|
};
|
|
48
|
+
/** How a linked agent turn ended. */
|
|
49
|
+
export type LinkedTurnEnd = {
|
|
50
|
+
readonly turnId: string;
|
|
51
|
+
} & ({
|
|
52
|
+
readonly status: "completed";
|
|
53
|
+
readonly output: JsonValue;
|
|
54
|
+
} | {
|
|
55
|
+
readonly status: "failed" | "cancelled";
|
|
56
|
+
readonly error?: string;
|
|
57
|
+
});
|
|
50
58
|
export type FlowWait = {
|
|
51
59
|
readonly sessionId: string;
|
|
52
60
|
readonly path: string;
|
|
@@ -67,121 +75,72 @@ export type CascadeCancelPlan = {
|
|
|
67
75
|
readonly pendingActionIds: string[];
|
|
68
76
|
readonly claimedActionIds: string[];
|
|
69
77
|
};
|
|
78
|
+
/** Wakes a session after commit (`DurableExecution.wake` through the Tenant context). */
|
|
79
|
+
type Schedule = (sessionId: string, wake: Wake) => void | Promise<void>;
|
|
80
|
+
/** Effect documents as the flow host writes them. */
|
|
81
|
+
export type FlowEffect = EffectDoc & {
|
|
82
|
+
agentSessionId?: string;
|
|
83
|
+
outcome?: ActionOutcome;
|
|
84
|
+
error?: string;
|
|
85
|
+
};
|
|
86
|
+
/** Active agent turns + pending/claimed actions for one workflow turn. */
|
|
87
|
+
export declare function countActiveFlowWork(t: Tx, workflowSessionId: string, turnId: string): Promise<number>;
|
|
88
|
+
/** The `commands` document key of a session command's idempotency key (`tenant/commands.ts`). */
|
|
89
|
+
export declare function commandKey(sessionId: string, idempotencyKey: string): string;
|
|
90
|
+
/** The idempotency key of the message a flow `agent` effect sends its linked session. */
|
|
91
|
+
export declare function linkedMessageKey(request: HostEffect): string;
|
|
70
92
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
93
|
+
* The linked turn an `agent` effect started: the turn its message opened, or undefined until
|
|
94
|
+
* that message commits.
|
|
95
|
+
*/
|
|
96
|
+
export declare function linkedTurnOf(t: Tx, agentSessionId: string, request: HostEffect): Promise<string | undefined>;
|
|
97
|
+
/**
|
|
98
|
+
* How the linked turn an `agent` effect started ended, or undefined while it has not: before
|
|
99
|
+
* its message commits, the linked session's status and `lastOutput` describe an earlier turn.
|
|
100
|
+
* `agent` is the linked session, read in the caller's transaction.
|
|
101
|
+
*/
|
|
102
|
+
export declare function linkedTurnEnd(t: Tx, effect: Pick<FlowEffect, "request" | "agentSessionId">, agent: FlowHostSession | undefined): Promise<LinkedTurnEnd | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* After a linked agent turn ends, settle the `agent` effect that started it and wake the
|
|
105
|
+
* workflow. `turnId` is the linked session's turn that ended; an effect bound to another turn
|
|
106
|
+
* (a later iteration whose message has not committed yet) is left alone.
|
|
73
107
|
*/
|
|
74
|
-
export declare function resolveFlowEffect(input: {
|
|
75
|
-
readonly request: HostEffect;
|
|
76
|
-
readonly store: FlowHostStore;
|
|
77
|
-
readonly session: FlowHostSession;
|
|
78
|
-
readonly limits?: FlowLimits;
|
|
79
|
-
readonly putLinkedSession: (args: {
|
|
80
|
-
id: string;
|
|
81
|
-
agentId: string;
|
|
82
|
-
ownerUserId: string;
|
|
83
|
-
vaultIds?: readonly string[];
|
|
84
|
-
credentialSelections?: readonly unknown[];
|
|
85
|
-
}) => FlowHostSession;
|
|
86
|
-
readonly sendMessage: (args: {
|
|
87
|
-
sessionId: string;
|
|
88
|
-
content?: string;
|
|
89
|
-
data?: JsonValue;
|
|
90
|
-
idempotencyKey: string;
|
|
91
|
-
requestId: string;
|
|
92
|
-
}) => {
|
|
93
|
-
turnId: string | null;
|
|
94
|
-
};
|
|
95
|
-
readonly readSession: (id: string) => FlowHostSession | undefined;
|
|
96
|
-
readonly publish: (event: LiveEvent) => void;
|
|
97
|
-
readonly notify: () => void;
|
|
98
|
-
readonly schedule: (sessionId: string) => void;
|
|
99
|
-
}): EffectResolution;
|
|
100
|
-
/** Active agent turns + pending/claimed actions for one workflow turn. */
|
|
101
|
-
export declare function countActiveFlowWork(store: FlowHostStore, workflowSessionId: string, turnId: string): number;
|
|
102
|
-
/** After an agent turn settles, wake the owning workflow if linked. */
|
|
103
108
|
export declare function wakeLinkedWorkflow(input: {
|
|
109
|
+
readonly t: Tx;
|
|
104
110
|
readonly agentSessionId: string;
|
|
105
|
-
readonly
|
|
111
|
+
readonly turnId: string | null;
|
|
106
112
|
readonly output?: JsonValue;
|
|
107
113
|
readonly failed?: boolean;
|
|
108
114
|
readonly cancelled?: boolean;
|
|
109
115
|
readonly error?: string;
|
|
110
|
-
readonly schedule:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
export declare function reconcilePendingAgentEffects(input: {
|
|
115
|
-
readonly store: FlowHostStore;
|
|
116
|
-
readonly schedule: (sessionId: string) => void;
|
|
117
|
-
readonly publish: (event: LiveEvent) => void;
|
|
118
|
-
}): void;
|
|
119
|
-
/** Re-offer orphaned fn/verify claims after a process restart (SD-P7 / WF-C9). */
|
|
120
|
-
export declare function reofferOrphanedFnVerifyClaims(store: FlowHostStore): number;
|
|
116
|
+
readonly schedule: Schedule;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
/** Pending workflow `agent` effects with a linked session, for the Tenant sweep. */
|
|
119
|
+
export declare function pendingAgentEffects(t: Tx): Promise<FlowEffect[]>;
|
|
121
120
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
121
|
+
* Tenant sweep: settle one pending `agent` effect whose linked turn already finished (the
|
|
122
|
+
* linked settle normally does this in its own transaction). Runs in its own transaction and
|
|
123
|
+
* locks the linked agent (child) session before the workflow (parent), per the lock order in
|
|
124
|
+
* `store/types.ts`. Only the linked turn the effect started settles it (`linkedTurnEnd`): the
|
|
125
|
+
* linked session may still show an earlier iteration's settled turn while this effect's message
|
|
126
|
+
* is not committed. A linked session still `running` or `runnable` is left to the sweep's
|
|
127
|
+
* orphan re-wake; a paused one surfaces on the workflow when the workflow settles. Returns
|
|
128
|
+
* true when it changed something.
|
|
124
129
|
*/
|
|
125
|
-
export declare function
|
|
126
|
-
readonly
|
|
127
|
-
readonly
|
|
128
|
-
readonly
|
|
129
|
-
}):
|
|
130
|
-
/**
|
|
131
|
-
export declare function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export declare function
|
|
139
|
-
readonly store: FlowHostStore;
|
|
140
|
-
readonly session: FlowHostSession;
|
|
141
|
-
readonly publish: (event: LiveEvent) => void;
|
|
142
|
-
}, payload: {
|
|
143
|
-
path: string;
|
|
144
|
-
kind: string;
|
|
145
|
-
key: string;
|
|
146
|
-
iterations?: string;
|
|
147
|
-
}): LiveEvent;
|
|
148
|
-
export declare function emitNodeCompleted(input: {
|
|
149
|
-
readonly store: FlowHostStore;
|
|
150
|
-
readonly session: FlowHostSession;
|
|
151
|
-
readonly publish: (event: LiveEvent) => void;
|
|
152
|
-
}, payload: {
|
|
153
|
-
path: string;
|
|
154
|
-
iterations?: string;
|
|
155
|
-
}): LiveEvent;
|
|
156
|
-
export declare function emitNodeFailed(input: {
|
|
157
|
-
readonly store: FlowHostStore;
|
|
158
|
-
readonly session: FlowHostSession;
|
|
159
|
-
readonly publish: (event: LiveEvent) => void;
|
|
160
|
-
}, payload: {
|
|
161
|
-
path: string;
|
|
162
|
-
iterations?: string;
|
|
163
|
-
error: {
|
|
164
|
-
code: string;
|
|
165
|
-
message: string;
|
|
166
|
-
path?: string;
|
|
167
|
-
};
|
|
168
|
-
}): LiveEvent;
|
|
169
|
-
export declare function emitSwitchSelected(input: {
|
|
170
|
-
readonly store: FlowHostStore;
|
|
171
|
-
readonly session: FlowHostSession;
|
|
172
|
-
readonly publish: (event: LiveEvent) => void;
|
|
173
|
-
}, payload: {
|
|
174
|
-
path: string;
|
|
175
|
-
case: string;
|
|
176
|
-
}): LiveEvent;
|
|
177
|
-
export declare function emitMapItems(input: {
|
|
178
|
-
readonly store: FlowHostStore;
|
|
179
|
-
readonly session: FlowHostSession;
|
|
180
|
-
readonly publish: (event: LiveEvent) => void;
|
|
181
|
-
}, payload: {
|
|
182
|
-
path: string;
|
|
183
|
-
count: number;
|
|
184
|
-
}): LiveEvent;
|
|
130
|
+
export declare function reconcilePendingAgentEffect(input: {
|
|
131
|
+
readonly t: Tx;
|
|
132
|
+
readonly effectId: string;
|
|
133
|
+
readonly schedule: Schedule;
|
|
134
|
+
}): Promise<boolean>;
|
|
135
|
+
/** Claimed `fn`/`verify` Actions, for the re-offer after a Tenant opens. */
|
|
136
|
+
export declare function claimedFnVerifyActions(t: Tx): Promise<Action[]>;
|
|
137
|
+
/**
|
|
138
|
+
* Re-offer one claimed `fn`/`verify` Action (SD-P7 / WF-C9): they are pure or repeat-safe, so
|
|
139
|
+
* a claim left by an executor of an earlier process is offered again at once rather than
|
|
140
|
+
* after its lease. The next claim bumps the generation, which fences a late result. Locks
|
|
141
|
+
* only the Action's session. Returns true when it re-offered.
|
|
142
|
+
*/
|
|
143
|
+
export declare function reofferFnVerifyClaim(t: Tx, actionId: string): Promise<boolean>;
|
|
185
144
|
/** Path depth for deepest-first cancel ordering. */
|
|
186
145
|
export declare function pathDepth(path: string): number;
|
|
187
146
|
/**
|
|
@@ -189,10 +148,10 @@ export declare function pathDepth(path: string): number;
|
|
|
189
148
|
* then pending → cancelled and claimed → uncertain actions (SD-P11 / WF-R53).
|
|
190
149
|
*/
|
|
191
150
|
export declare function planCancelCascade(input: {
|
|
192
|
-
readonly
|
|
151
|
+
readonly t: Tx;
|
|
193
152
|
readonly workflowSessionId: string;
|
|
194
153
|
readonly turnId: string | null;
|
|
195
|
-
}): CascadeCancelPlan
|
|
154
|
+
}): Promise<CascadeCancelPlan>;
|
|
196
155
|
/**
|
|
197
156
|
* Cancel sibling work under a Parallel/Map parent when one branch fails (PAR-R6).
|
|
198
157
|
* Agent turns listed in `agentSessionIds` are returned for the caller to cancel;
|
|
@@ -201,64 +160,66 @@ export declare function planCancelCascade(input: {
|
|
|
201
160
|
* paths are included in the sibling path set.
|
|
202
161
|
*/
|
|
203
162
|
export declare function cancelSiblingWork(input: {
|
|
204
|
-
readonly
|
|
163
|
+
readonly t: Tx;
|
|
205
164
|
readonly workflowSessionId: string;
|
|
206
165
|
readonly turnId: string;
|
|
207
166
|
/** Paths of siblings still running (not the failed branch). */
|
|
208
167
|
readonly siblingPaths?: readonly string[];
|
|
209
168
|
/** Effect ids the flow engine marked for fail-fast cancel. */
|
|
210
169
|
readonly cancelEffectIds?: readonly string[];
|
|
211
|
-
}): CancelSiblingResult
|
|
170
|
+
}): Promise<CancelSiblingResult>;
|
|
212
171
|
/**
|
|
213
172
|
* Apply cancel fencing to workflow-session actions (pending→cancelled, claimed→uncertain).
|
|
214
173
|
*/
|
|
215
174
|
export declare function fenceWorkflowActions(input: {
|
|
216
|
-
readonly
|
|
175
|
+
readonly t: Tx;
|
|
217
176
|
readonly workflowSessionId: string;
|
|
218
177
|
readonly turnId: string | null;
|
|
219
|
-
}): {
|
|
178
|
+
}): Promise<{
|
|
220
179
|
cancelled: string[];
|
|
221
180
|
uncertain: string[];
|
|
222
|
-
}
|
|
181
|
+
}>;
|
|
223
182
|
/**
|
|
224
183
|
* Aggregate human waits across the workflow session and linked agent sessions (WF-R51).
|
|
225
184
|
*/
|
|
226
185
|
export declare function aggregateWaits(input: {
|
|
227
|
-
readonly
|
|
186
|
+
readonly t: Tx;
|
|
228
187
|
readonly workflowSessionId: string;
|
|
229
|
-
}): FlowWait[]
|
|
188
|
+
}): Promise<FlowWait[]>;
|
|
230
189
|
/**
|
|
231
190
|
* Look up which session owns an interaction id. Used for 409 foreign approvals (WF-R52).
|
|
232
191
|
*/
|
|
233
192
|
export declare function findInteractionOwner(input: {
|
|
234
|
-
readonly
|
|
193
|
+
readonly t: Tx;
|
|
235
194
|
readonly workflowSessionId: string;
|
|
236
195
|
readonly interactionId: string;
|
|
237
|
-
}): {
|
|
196
|
+
}): Promise<{
|
|
238
197
|
sessionId: string;
|
|
239
198
|
path: string;
|
|
240
|
-
} | undefined
|
|
199
|
+
} | undefined>;
|
|
241
200
|
/**
|
|
242
201
|
* If approve/respond targets an interaction owned by a linked agent session,
|
|
243
202
|
* return a 409 message naming that session (WF-R52 / LOOP-A4).
|
|
244
203
|
*/
|
|
245
204
|
export declare function foreignInteractionConflict(input: {
|
|
246
|
-
readonly
|
|
205
|
+
readonly t: Tx;
|
|
247
206
|
readonly workflowSessionId: string;
|
|
248
207
|
readonly interactionId: string;
|
|
249
|
-
}): {
|
|
208
|
+
}): Promise<{
|
|
250
209
|
status: 409;
|
|
251
210
|
message: string;
|
|
252
211
|
ownerSessionId: string;
|
|
253
|
-
} | undefined
|
|
212
|
+
} | undefined>;
|
|
254
213
|
/**
|
|
255
214
|
* When concurrency slots free, re-enter the workflow so queued effects can start
|
|
256
|
-
* (status stays `queued` until
|
|
215
|
+
* (status stays `queued` until the effect resolver dispatches them). Returns
|
|
216
|
+
* true when a wake was scheduled.
|
|
257
217
|
*/
|
|
258
218
|
export declare function wakeForQueuedEffects(input: {
|
|
259
|
-
readonly
|
|
219
|
+
readonly t: Tx;
|
|
260
220
|
readonly workflowSessionId: string;
|
|
261
221
|
readonly turnId: string;
|
|
262
222
|
readonly limits: FlowLimits;
|
|
263
|
-
readonly schedule:
|
|
264
|
-
}): boolean
|
|
223
|
+
readonly schedule: Schedule;
|
|
224
|
+
}): Promise<boolean>;
|
|
225
|
+
export {};
|