@powerhousedao/reactor-workflow 6.2.3-dev.83 → 6.2.3-dev.85
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 +206 -38
- package/dist/index.d.ts +263 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1786 -171
- package/dist/index.js.map +1 -1
- package/dist/{piece-registry-ByALLpvA.d.ts → piece-registry-DNIk31Vv.d.ts} +82 -3
- package/dist/piece-registry-DNIk31Vv.d.ts.map +1 -0
- package/dist/{telemetry-5AAX-Pst.js → telemetry-B5OOpfCS.js} +708 -29
- package/dist/telemetry-B5OOpfCS.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/worker-entry.js +161 -16
- package/dist/worker-entry.js.map +1 -1
- package/package.json +7 -7
- package/dist/piece-registry-ByALLpvA.d.ts.map +0 -1
- package/dist/telemetry-5AAX-Pst.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as PropertySettingDef, E as ReactorTap, F as BlockMatch, I as BlockResolution, L as PieceOrigin, M as EgressPolicy, T as WorkflowRunResult, b as WorkflowTelemetry, f as SecretStat, g as ModelManifestSource, h as IPieceWorker, i as ReplayedStep, k as PieceResolver, l as ConnectionRequest, n as packagePieces, p as SecretStore, r as CORE_PIECE_NAME, s as AttachmentPort, t as PieceRegistry, v as PieceWorkerResult, w as StepExecutionRecord, x as WorkflowTelemetryOptions, y as TELEMETRY_SCOPE } from "./piece-registry-
|
|
1
|
+
import { C as PropertySettingDef, E as ReactorTap, F as BlockMatch, I as BlockResolution, L as PieceOrigin, M as EgressPolicy, T as WorkflowRunResult, b as WorkflowTelemetry, f as SecretStat, g as ModelManifestSource, h as IPieceWorker, i as ReplayedStep, k as PieceResolver, l as ConnectionRequest, n as packagePieces, p as SecretStore, r as CORE_PIECE_NAME, s as AttachmentPort, t as PieceRegistry, v as PieceWorkerResult, w as StepExecutionRecord, x as WorkflowTelemetryOptions, y as TELEMETRY_SCOPE } from "./piece-registry-DNIk31Vv.js";
|
|
2
2
|
import { ActionBase, IndexQueryRequest, IndexQueryResult, TriggerBase } from "@powerhousedao/pieces-framework";
|
|
3
3
|
import { ILogger, OperationWithContext } from "document-model";
|
|
4
4
|
import "@powerhousedao/pieces-framework/workflow";
|
|
@@ -65,21 +65,61 @@ interface OAuthAppClient {
|
|
|
65
65
|
interface OAuthAppRegistry {
|
|
66
66
|
client(appId: string, kind: OAuthClientKind): OAuthAppClient | undefined;
|
|
67
67
|
clients(appId: string): OAuthAppClient[];
|
|
68
|
+
/** The app's relay, or undefined when it has none. */
|
|
69
|
+
relay(appId: string): OAuthAppRelay | undefined;
|
|
68
70
|
}
|
|
69
71
|
/** One app as a host configures it: per client kind, the provider's client file. */
|
|
70
72
|
interface OAuthAppDefinition {
|
|
71
73
|
id: string;
|
|
72
74
|
/** Paths to the provider's downloaded client files (Google's client_secret_*.json). */
|
|
73
75
|
clients: Partial<Record<OAuthClientKind, string>>;
|
|
76
|
+
/**
|
|
77
|
+
* The broker a web sign-in goes through when the host has no web client
|
|
78
|
+
* file. Absent, a web sign-in needs the web client.
|
|
79
|
+
*/
|
|
80
|
+
relay?: OAuthAppRelay;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A token broker for an app's web client: the provider sends the browser to
|
|
84
|
+
* `redirectUri`, which forwards to the callback the state names; `tokenUrl`
|
|
85
|
+
* takes the code exchange and every refresh, with `clientId` and no secret.
|
|
86
|
+
*/
|
|
87
|
+
interface OAuthAppRelay {
|
|
88
|
+
clientId: string;
|
|
89
|
+
redirectUri: string;
|
|
90
|
+
tokenUrl: string;
|
|
74
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* A relay as configured, or the reason it cannot be used: it needs a client
|
|
94
|
+
* id and two absolute https URLs without credentials.
|
|
95
|
+
*/
|
|
96
|
+
export declare function parseRelay(raw: unknown): OAuthAppRelay | string;
|
|
75
97
|
export declare class StaticOAuthAppRegistry implements OAuthAppRegistry {
|
|
76
98
|
private readonly entries;
|
|
77
|
-
|
|
99
|
+
private readonly relays;
|
|
100
|
+
constructor(entries: readonly OAuthAppClient[], relays?: ReadonlyMap<string, OAuthAppRelay>);
|
|
78
101
|
client(appId: string, kind: OAuthClientKind): OAuthAppClient | undefined;
|
|
79
102
|
clients(appId: string): OAuthAppClient[];
|
|
103
|
+
relay(appId: string): OAuthAppRelay | undefined;
|
|
80
104
|
}
|
|
81
105
|
/** Desktop for a callback to this machine, web for one the provider reaches over the internet. */
|
|
82
106
|
export declare function clientKindFor(redirectUri: string): OAuthClientKind;
|
|
107
|
+
/**
|
|
108
|
+
* How this host signs in with a publisher's app for a callback: the
|
|
109
|
+
* desktop client for one to this machine; else the web client when the host
|
|
110
|
+
* has its file; else the app's relay; else not at all.
|
|
111
|
+
*/
|
|
112
|
+
type OAuthSignIn = {
|
|
113
|
+
mode: "desktop" | "web";
|
|
114
|
+
client: OAuthAppClient;
|
|
115
|
+
} | {
|
|
116
|
+
mode: "relay";
|
|
117
|
+
relay: OAuthAppRelay;
|
|
118
|
+
} | {
|
|
119
|
+
mode: "none";
|
|
120
|
+
kind: OAuthClientKind;
|
|
121
|
+
};
|
|
122
|
+
export declare function oauthSignInFor(apps: OAuthAppRegistry, appId: string, redirectUri: string): OAuthSignIn;
|
|
83
123
|
/**
|
|
84
124
|
* Config key the runtime writes after a sign-in: the scopes the provider
|
|
85
125
|
* granted (its token response's `scope`, else the ones asked for). A
|
|
@@ -103,11 +143,14 @@ export declare function parseClientFile(text: string): {
|
|
|
103
143
|
* Reads each configured client file and keeps its secret in the store under a
|
|
104
144
|
* fixed label: created the first time, rotated when the file changed, left
|
|
105
145
|
* alone otherwise. A client whose file cannot be read is skipped with the
|
|
106
|
-
* reason, so one bad file does not take the others down.
|
|
146
|
+
* reason, so one bad file does not take the others down. A relay without a
|
|
147
|
+
* client id or with a URL that is not absolute https is dropped with the
|
|
148
|
+
* reason.
|
|
107
149
|
*/
|
|
108
150
|
export declare function loadOAuthApps(definitions: readonly OAuthAppDefinition[], store: SecretStore, options?: {
|
|
109
151
|
read?: (path: string) => Promise<string>;
|
|
110
152
|
onSkip?: (appId: string, kind: OAuthClientKind, reason: string) => void;
|
|
153
|
+
onRelayDropped?: (appId: string, reason: string) => void;
|
|
111
154
|
}): Promise<StaticOAuthAppRegistry>;
|
|
112
155
|
//#endregion
|
|
113
156
|
//#region src/reactor/run-scope.d.ts
|
|
@@ -154,6 +197,7 @@ interface WorkflowRuntimeHostDeps {
|
|
|
154
197
|
modelManifest?(): ModelManifestEntry[];
|
|
155
198
|
modelEntries?(documentType: string): ModelManifestEntry[];
|
|
156
199
|
webhooks?: IWebhookScope;
|
|
200
|
+
waitpointBaseUrl?: string;
|
|
157
201
|
attachments?: AttachmentClientLike;
|
|
158
202
|
canReadAttachmentRef?(request: AttachmentReadRequest): Promise<boolean>;
|
|
159
203
|
secrets?: SecretStore;
|
|
@@ -18965,10 +19009,43 @@ interface WorkflowParkRow {
|
|
|
18965
19009
|
reason: string;
|
|
18966
19010
|
parked_at: string;
|
|
18967
19011
|
}
|
|
19012
|
+
interface RunPinRow {
|
|
19013
|
+
definition_hash: string | null;
|
|
19014
|
+
definition_op_index: number | null;
|
|
19015
|
+
definition_scope_hash: string | null;
|
|
19016
|
+
}
|
|
19017
|
+
type NullableColumn<T> = ColumnType<T | null, T | null | undefined, T | null>;
|
|
19018
|
+
interface WaitpointRow {
|
|
19019
|
+
id: string;
|
|
19020
|
+
run_id: string;
|
|
19021
|
+
workflow_id: string;
|
|
19022
|
+
step_id: string;
|
|
19023
|
+
step_key: string;
|
|
19024
|
+
step_path: string;
|
|
19025
|
+
piece_name: string;
|
|
19026
|
+
block_name: string;
|
|
19027
|
+
type: string;
|
|
19028
|
+
kind: string;
|
|
19029
|
+
status: string;
|
|
19030
|
+
token_hash: string | null;
|
|
19031
|
+
created_at: string;
|
|
19032
|
+
resume_at: string | null;
|
|
19033
|
+
expires_at: string | null;
|
|
19034
|
+
resolved_at: string | null;
|
|
19035
|
+
decided_by: string | null;
|
|
19036
|
+
approval: string | null;
|
|
19037
|
+
resume_payload: string | null;
|
|
19038
|
+
response_to_send: string | null;
|
|
19039
|
+
}
|
|
18968
19040
|
interface WorkflowRuntimeDB {
|
|
18969
19041
|
run: RunRow & {
|
|
18970
19042
|
admit_attempts: ColumnType<number, number | undefined, number>;
|
|
19043
|
+
definition_hash: NullableColumn<string>;
|
|
19044
|
+
definition_op_index: NullableColumn<number>;
|
|
19045
|
+
definition_scope_hash: NullableColumn<string>;
|
|
19046
|
+
waiting_on: NullableColumn<string>;
|
|
18971
19047
|
};
|
|
19048
|
+
waitpoint: WaitpointRow;
|
|
18972
19049
|
step_execution: StepExecutionRow;
|
|
18973
19050
|
run_document: RunDocumentRow;
|
|
18974
19051
|
trigger_state: TriggerStateRow;
|
|
@@ -18980,6 +19057,11 @@ interface WorkflowRuntimeDB {
|
|
|
18980
19057
|
applied_at: string;
|
|
18981
19058
|
};
|
|
18982
19059
|
}
|
|
19060
|
+
interface EndedWait {
|
|
19061
|
+
runId: string;
|
|
19062
|
+
reason: string;
|
|
19063
|
+
closed: string[];
|
|
19064
|
+
}
|
|
18983
19065
|
interface ErasedRuns {
|
|
18984
19066
|
runs: number;
|
|
18985
19067
|
steps: number;
|
|
@@ -19023,6 +19105,8 @@ declare class WorkflowRunStore {
|
|
|
19023
19105
|
private readonly unmigrated;
|
|
19024
19106
|
private readonly runsInFlight;
|
|
19025
19107
|
private readonly journaledSteps;
|
|
19108
|
+
private readonly pausingRuns;
|
|
19109
|
+
private readonly resumedLegs;
|
|
19026
19110
|
private constructor();
|
|
19027
19111
|
static create(relationalDb: IRelationalDb): Promise<WorkflowRunStore>;
|
|
19028
19112
|
hasUnmigratedTriggerState(workflowId: string): boolean;
|
|
@@ -19040,7 +19124,8 @@ declare class WorkflowRunStore {
|
|
|
19040
19124
|
* passed its `runTimeoutSeconds`. Separate from `failRun` because a
|
|
19041
19125
|
* CANCELLED run is not rerunnable and must not read as a workflow defect.
|
|
19042
19126
|
*/
|
|
19043
|
-
cancelRun(runId: string, reason: string): Promise<
|
|
19127
|
+
cancelRun(runId: string, reason: string): Promise<string[]>;
|
|
19128
|
+
private endLiveRun;
|
|
19044
19129
|
enqueueRun(options: EnqueueRunOptions): Promise<string>;
|
|
19045
19130
|
private unmarkOnFailure;
|
|
19046
19131
|
/**
|
|
@@ -19117,13 +19202,17 @@ declare class WorkflowRunStore {
|
|
|
19117
19202
|
beginRun(runId: string, details: {
|
|
19118
19203
|
workflowName: string;
|
|
19119
19204
|
workflowVersion: number;
|
|
19120
|
-
}): Promise<
|
|
19205
|
+
}): Promise<boolean>;
|
|
19121
19206
|
startRun(options: StartRunOptions): Promise<string>;
|
|
19122
19207
|
recordStep(runId: string, ordinal: number, step: StepExecutionRecord): Promise<void>;
|
|
19123
19208
|
private sweepIsNoop;
|
|
19124
|
-
finishRun(runId: string, result: WorkflowRunResult, executionOrder?: ReadonlyMap<string, number
|
|
19209
|
+
finishRun(runId: string, result: WorkflowRunResult, executionOrder?: ReadonlyMap<string, number>, pin?: RunPinRow): Promise<{
|
|
19210
|
+
held: boolean;
|
|
19211
|
+
closed: string[];
|
|
19212
|
+
}>;
|
|
19125
19213
|
private sweepSteps;
|
|
19126
|
-
|
|
19214
|
+
private withRunRow;
|
|
19215
|
+
failRun(runId: string, error: string, errorName?: string): Promise<string[]>;
|
|
19127
19216
|
listRuns(workflowId?: string | string[], limit?: number, options?: ListRunsOptions): Promise<RunRow[]>;
|
|
19128
19217
|
getRun(id: string): Promise<RunRow | undefined>;
|
|
19129
19218
|
getSteps(runId: string): Promise<StepExecutionRow[]>;
|
|
@@ -19160,6 +19249,45 @@ declare class WorkflowRunStore {
|
|
|
19160
19249
|
recordPollFailure(workflowId: string, error: string, nowIso: string, nextPollAtIso: string, consecutiveFailures: number): Promise<void>;
|
|
19161
19250
|
claimDedupe(workflowId: string, dedupeKey: string, ttlMs: number, nowIso: string): Promise<boolean>;
|
|
19162
19251
|
deleteDedupe(workflowId: string): Promise<void>;
|
|
19252
|
+
createWaitpoint(row: WaitpointRow): Promise<{
|
|
19253
|
+
waitpoint: WaitpointRow;
|
|
19254
|
+
created: boolean;
|
|
19255
|
+
}>;
|
|
19256
|
+
getWaitpoint(id: string): Promise<WaitpointRow | undefined>;
|
|
19257
|
+
getWaitpointByTokenHash(tokenHash: string): Promise<WaitpointRow | undefined>;
|
|
19258
|
+
completeWaitpoint(id: string, resolution: {
|
|
19259
|
+
payload: unknown;
|
|
19260
|
+
decidedBy?: string | null;
|
|
19261
|
+
resolvedAt?: string;
|
|
19262
|
+
}): Promise<WaitpointRow | undefined>;
|
|
19263
|
+
claimDueDelayWaitpoints(nowIso: string, limit: number): Promise<WaitpointRow[]>;
|
|
19264
|
+
expireDueWaitpoints(nowIso: string, limit: number): Promise<{
|
|
19265
|
+
expired: WaitpointRow[];
|
|
19266
|
+
ended: EndedWait[];
|
|
19267
|
+
}>;
|
|
19268
|
+
endStrandedWaits(limit: number): Promise<EndedWait[]>;
|
|
19269
|
+
nextExpiry(): Promise<string | undefined>;
|
|
19270
|
+
countWaitingRuns(): Promise<number>;
|
|
19271
|
+
nextDelayDue(): Promise<string | undefined>;
|
|
19272
|
+
hasCompletedWaitpoint(runId: string): Promise<boolean>;
|
|
19273
|
+
heldRunIds(): Promise<string[]>;
|
|
19274
|
+
isRunInFlight(runId: string): boolean;
|
|
19275
|
+
claimWaitingRun(runId: string): Promise<boolean>;
|
|
19276
|
+
returnToWaiting(runId: string): Promise<void>;
|
|
19277
|
+
consumeCompletedWaitpoint(runId: string): Promise<{
|
|
19278
|
+
waitpoint: WaitpointRow;
|
|
19279
|
+
closed: string[];
|
|
19280
|
+
} | undefined>;
|
|
19281
|
+
getRunPin(runId: string): Promise<RunPinRow | undefined>;
|
|
19282
|
+
cancelIdleRun(runId: string, reason: string): Promise<string | undefined>;
|
|
19283
|
+
endWait(runId: string, end: {
|
|
19284
|
+
status: "CANCELLED" | "FAILED";
|
|
19285
|
+
reason: string;
|
|
19286
|
+
errorName: string;
|
|
19287
|
+
waitpoints: "EXPIRED" | "CANCELLED";
|
|
19288
|
+
}): Promise<string[]>;
|
|
19289
|
+
listWaitpointsForRuns(runIds: string[]): Promise<Map<string, WaitpointRow[]>>;
|
|
19290
|
+
listWaitingRuns(workflowId: string | string[] | undefined, limit: number): Promise<RunRow[]>;
|
|
19163
19291
|
pruneFinishedRuns(cutoffIso: string, batchSize?: number): Promise<number>;
|
|
19164
19292
|
eraseRunsForDocuments(documentIds: string[]): Promise<ErasedRuns>;
|
|
19165
19293
|
pruneDedupe(cutoffIso: string): Promise<number>;
|
|
@@ -19349,9 +19477,69 @@ declare class TriggerSupervisor {
|
|
|
19349
19477
|
private failRefused;
|
|
19350
19478
|
}
|
|
19351
19479
|
//#endregion
|
|
19480
|
+
//#region src/reactor/waitpoint-types.d.ts
|
|
19481
|
+
type WaitpointType = "DELAY" | "WEBHOOK";
|
|
19482
|
+
type WaitpointStatus = "PENDING" | "COMPLETED" | "CONSUMED" | "EXPIRED" | "CANCELLED";
|
|
19483
|
+
type WaitpointKind = "approval" | "webhook" | "delay";
|
|
19484
|
+
type ReasonRequiredOn = "none" | "reject" | "both";
|
|
19485
|
+
interface ApprovalRequest {
|
|
19486
|
+
title: string;
|
|
19487
|
+
body: string | null;
|
|
19488
|
+
approveLabel: string;
|
|
19489
|
+
rejectLabel: string;
|
|
19490
|
+
reasonRequiredOn: ReasonRequiredOn;
|
|
19491
|
+
approvers: string[];
|
|
19492
|
+
}
|
|
19493
|
+
interface WaitpointResumePayload {
|
|
19494
|
+
body?: unknown;
|
|
19495
|
+
headers?: Record<string, string>;
|
|
19496
|
+
queryParams?: Record<string, string>;
|
|
19497
|
+
}
|
|
19498
|
+
interface WaitpointDescription {
|
|
19499
|
+
workflowName: string;
|
|
19500
|
+
stepName: string;
|
|
19501
|
+
status: WaitpointStatus;
|
|
19502
|
+
workflowDescription?: string;
|
|
19503
|
+
actionName?: string;
|
|
19504
|
+
waitingSince: string;
|
|
19505
|
+
expiresAt?: string;
|
|
19506
|
+
startedAt?: string;
|
|
19507
|
+
triggerName?: string;
|
|
19508
|
+
}
|
|
19509
|
+
interface WaitpointRecord {
|
|
19510
|
+
id: string;
|
|
19511
|
+
runId: string;
|
|
19512
|
+
workflowId: string;
|
|
19513
|
+
stepId: string;
|
|
19514
|
+
stepKey: string;
|
|
19515
|
+
stepPath: string;
|
|
19516
|
+
pieceName: string;
|
|
19517
|
+
blockName: string;
|
|
19518
|
+
type: WaitpointType;
|
|
19519
|
+
kind: WaitpointKind;
|
|
19520
|
+
status: WaitpointStatus;
|
|
19521
|
+
createdAt: string;
|
|
19522
|
+
resumeAt: string | null;
|
|
19523
|
+
expiresAt: string | null;
|
|
19524
|
+
resolvedAt: string | null;
|
|
19525
|
+
decidedBy: string | null;
|
|
19526
|
+
approval: ApprovalRequest | null;
|
|
19527
|
+
}
|
|
19528
|
+
interface ResolveWaitpointInput {
|
|
19529
|
+
approved: boolean;
|
|
19530
|
+
reason?: string;
|
|
19531
|
+
}
|
|
19532
|
+
interface WaitingRunsArgs {
|
|
19533
|
+
driveId?: string;
|
|
19534
|
+
workflowId?: string;
|
|
19535
|
+
first?: number;
|
|
19536
|
+
}
|
|
19537
|
+
export declare const WAITPOINT_EXPIRED_ERROR_NAME = "WaitpointExpired";
|
|
19538
|
+
export declare const WAITPOINT_NOT_LIVE_ERROR_NAME = "WaitpointNotLive";
|
|
19539
|
+
//#endregion
|
|
19352
19540
|
//#region src/reactor/service.d.ts
|
|
19353
19541
|
/** Why a firing was journaled CANCELLED without running, when it was. */
|
|
19354
|
-
type FiringRefusal = "parked" | "singleton" | "stale" | "queue-full" | "expired";
|
|
19542
|
+
type FiringRefusal = "parked" | "singleton" | "stale" | "queue-full" | "expired" | "cancelled";
|
|
19355
19543
|
type PersistedRunResult = WorkflowRunResult & {
|
|
19356
19544
|
runId: string | null;
|
|
19357
19545
|
refusal?: FiringRefusal;
|
|
@@ -19634,6 +19822,7 @@ export declare class WorkflowRuntimeService {
|
|
|
19634
19822
|
checkConnection(connectionId: string, ctx?: WorkflowCaller): Promise<ConnectionCheckResult>;
|
|
19635
19823
|
private connectionDocument;
|
|
19636
19824
|
private checkConnectionDocument;
|
|
19825
|
+
oauthSignInMode(appId: string, redirectUri: string): Promise<OAuthSignIn["mode"]>;
|
|
19637
19826
|
startOAuth(connectionId: string, ctx: WorkflowCaller | undefined, options: {
|
|
19638
19827
|
redirectUri: string;
|
|
19639
19828
|
returnUrl?: string;
|
|
@@ -19687,6 +19876,8 @@ export declare class WorkflowRuntimeService {
|
|
|
19687
19876
|
private dispatcher;
|
|
19688
19877
|
fire(workflowId: string, triggerPayload?: unknown, triggerKind?: string, resume?: RunResume, ctx?: WorkflowCaller, enqueuedRunId?: string): Promise<PersistedRunResult>;
|
|
19689
19878
|
private runFired;
|
|
19879
|
+
private executeLeg;
|
|
19880
|
+
private endUnheldWait;
|
|
19690
19881
|
private readonly runGate;
|
|
19691
19882
|
private readonly unsettledFirings;
|
|
19692
19883
|
private readonly runLimits;
|
|
@@ -19703,6 +19894,9 @@ export declare class WorkflowRuntimeService {
|
|
|
19703
19894
|
private pollHeld;
|
|
19704
19895
|
private settleFiring;
|
|
19705
19896
|
private readonly heldReplies;
|
|
19897
|
+
private readonly runResponders;
|
|
19898
|
+
private readonly queuedReplies;
|
|
19899
|
+
private readonly syncResumes;
|
|
19706
19900
|
/** Why a trigger's firing of a PARKED workflow is refused; undefined when
|
|
19707
19901
|
* it is not parked, or when an operator started the run. */
|
|
19708
19902
|
private parkedFiring;
|
|
@@ -19738,6 +19932,63 @@ export declare class WorkflowRuntimeService {
|
|
|
19738
19932
|
private applyFailureMode;
|
|
19739
19933
|
rerun(runId: string, ctx?: WorkflowCaller): Promise<PersistedRunResult>;
|
|
19740
19934
|
private rereads;
|
|
19935
|
+
private readonly resuming;
|
|
19936
|
+
private readonly definitionHashes;
|
|
19937
|
+
/** Our hash of the runnable definition: computed once per published version. */
|
|
19938
|
+
private definitionHash;
|
|
19939
|
+
private waitpointPort;
|
|
19940
|
+
/** Re-enters a WAITING run that holds a COMPLETED waitpoint, through the
|
|
19941
|
+
* dispatcher. Whoever writes second, the resume or the WAITING, delivers. */
|
|
19942
|
+
private deliverHeld;
|
|
19943
|
+
private answerNotWaiting;
|
|
19944
|
+
private readonly waitpointPoller;
|
|
19945
|
+
private unobserveSuspended?;
|
|
19946
|
+
/** Test hook: one waitpoint poll pass now; a no-op until the supervisor starts. */
|
|
19947
|
+
pollWaitpointsNow(): Promise<void>;
|
|
19948
|
+
private startWaitpointPoller;
|
|
19949
|
+
private stopWaitpointPoller;
|
|
19950
|
+
private answerHeldResumes;
|
|
19951
|
+
private answerClosed;
|
|
19952
|
+
private heldResume;
|
|
19953
|
+
private answerUnresumed;
|
|
19954
|
+
private deliverAllHeld;
|
|
19955
|
+
private resumeRun;
|
|
19956
|
+
private runResumed;
|
|
19957
|
+
private answerShutDown;
|
|
19958
|
+
private resumePolicy;
|
|
19959
|
+
private resumeStopped;
|
|
19960
|
+
private pinnedState;
|
|
19961
|
+
private rebuildWorkflowState;
|
|
19962
|
+
/** Resolves a WEBHOOK waitpoint from the editor, as the calling DID. */
|
|
19963
|
+
resolveWaitpoint(waitpointId: string, input: ResolveWaitpointInput, ctx?: WorkflowCaller): Promise<WaitpointRecord>;
|
|
19964
|
+
/** A POST to a resume URL. Single-use: only a PENDING waitpoint resumes. */
|
|
19965
|
+
resumeWaitpointByToken(token: string, payload: WaitpointResumePayload): Promise<{
|
|
19966
|
+
status: "resumed" | "already" | "gone";
|
|
19967
|
+
}>;
|
|
19968
|
+
/** A POST to a resume URL's `/sync`, held like a sync webhook until the
|
|
19969
|
+
* resumed leg responds, waits, ends, or times out. The first answer wins. */
|
|
19970
|
+
resumeWaitpointByTokenSync(token: string, payload: WaitpointResumePayload, options?: {
|
|
19971
|
+
timeoutMs?: number;
|
|
19972
|
+
}): Promise<{
|
|
19973
|
+
status: "resumed" | "already" | "gone";
|
|
19974
|
+
reply?: WebhookReply;
|
|
19975
|
+
}>;
|
|
19976
|
+
private holdSyncResume;
|
|
19977
|
+
private resumeByToken;
|
|
19978
|
+
/** What a resume URL's confirm page shows. */
|
|
19979
|
+
describeWaitpointByToken(token: string): Promise<WaitpointDescription | undefined>;
|
|
19980
|
+
private workflowStateForPage;
|
|
19981
|
+
private blockDisplayName;
|
|
19982
|
+
/** The waitpoints of one run, for a caller who may read the run. */
|
|
19983
|
+
waitpointsForRun(runId: string, ctx?: WorkflowCaller): Promise<WaitpointRecord[]>;
|
|
19984
|
+
/** WAITING runs this caller may read, oldest first, with their waitpoints. */
|
|
19985
|
+
waitingRuns(args: WaitingRunsArgs, ctx?: WorkflowCaller): Promise<Array<{
|
|
19986
|
+
run: RunRecord;
|
|
19987
|
+
waitpoints: WaitpointRecord[];
|
|
19988
|
+
}>>;
|
|
19989
|
+
/** Cancels a WAITING or PENDING run; its waitpoints stop resuming. */
|
|
19990
|
+
cancelRun(runId: string, ctx?: WorkflowCaller): Promise<RunRecord>;
|
|
19991
|
+
private callerDid;
|
|
19741
19992
|
testStep(workflowId: string, stepId: string, ctx?: WorkflowCaller, access?: WorkflowAccessOptions): Promise<StepTestResult>;
|
|
19742
19993
|
private testScope;
|
|
19743
19994
|
private readReferencedDocuments;
|
|
@@ -19747,6 +19998,9 @@ export declare class WorkflowRuntimeService {
|
|
|
19747
19998
|
blockResolutions(workflowId: string, ctx?: WorkflowCaller): Promise<BlockResolutionRecord[]>;
|
|
19748
19999
|
private draftOf;
|
|
19749
20000
|
}
|
|
20001
|
+
export declare const WORKFLOW_DISABLED_ERROR_NAME = "WorkflowDisabled";
|
|
20002
|
+
export declare const WORKFLOW_PARKED_ERROR_NAME = "WorkflowParked";
|
|
20003
|
+
export declare function waitpointRecord(row: WaitpointRow): WaitpointRecord;
|
|
19750
20004
|
/** The runtime a host composes: one instance, its lifetime the host's. */
|
|
19751
20005
|
export declare function createWorkflowRuntime(deps: WorkflowRuntimeHostDeps): WorkflowRuntimeService;
|
|
19752
20006
|
//#endregion
|
|
@@ -19930,6 +20184,6 @@ interface WebhookPayload {
|
|
|
19930
20184
|
body: unknown;
|
|
19931
20185
|
}
|
|
19932
20186
|
//#endregion
|
|
19933
|
-
export { type AcquireSingletonOptions, type AttachmentClientLike, type AttachmentReadRequest, type BlockResolutionRecord, CORE_PIECE_NAME, type ConnectionCheckResult, type ConnectionSummary, type HostIdentity, type OAuthAppClient, type OAuthAppDefinition, type OAuthAppRegistry, type OAuthAttemptStatus, type OAuthAttemptView, type OAuthClientKind, type OAuthStart, type OutputTree, type OutputTreeNode, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type RunPage, type RunRecord, type RunRow, type RunsArgs, type RunsPageArgs, type ScheduleTriggerBinding, type StepExecutionRow, type StepTestResult, TELEMETRY_SCOPE, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, type WebhookConfig, type WebhookPayload, type WorkflowAccessOptions, type WorkflowCaller, type WorkflowHealth, type WorkflowHealthReader, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, type WorkflowSingletonLease, type WorkflowSingletonLoss, type WorkflowTelemetryOptions, packagePieces };
|
|
20187
|
+
export { type AcquireSingletonOptions, type ApprovalRequest, type AttachmentClientLike, type AttachmentReadRequest, type BlockResolutionRecord, CORE_PIECE_NAME, type ConnectionCheckResult, type ConnectionSummary, type HostIdentity, type OAuthAppClient, type OAuthAppDefinition, type OAuthAppRegistry, type OAuthAppRelay, type OAuthAttemptStatus, type OAuthAttemptView, type OAuthClientKind, type OAuthSignIn, type OAuthStart, type OutputTree, type OutputTreeNode, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type ReasonRequiredOn, type ResolveWaitpointInput, type RunPage, type RunPinRow, type RunRecord, type RunRow, type RunsArgs, type RunsPageArgs, type ScheduleTriggerBinding, type StepExecutionRow, type StepTestResult, TELEMETRY_SCOPE, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, type WaitingRunsArgs, type WaitpointDescription, type WaitpointKind, type WaitpointRecord, type WaitpointResumePayload, type WaitpointRow, type WaitpointStatus, type WaitpointType, type WebhookConfig, type WebhookPayload, type WorkflowAccessOptions, type WorkflowCaller, type WorkflowHealth, type WorkflowHealthReader, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, type WorkflowSingletonLease, type WorkflowSingletonLoss, type WorkflowTelemetryOptions, packagePieces };
|
|
19934
20188
|
export {};
|
|
19935
20189
|
//# sourceMappingURL=index.d.ts.map
|