@atolis-hq/wake 0.4.78 → 0.4.79
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/dist/src/bootstrap/composition-root.js +2 -2
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +2 -1
- package/dist/src/control-plane/application/advance-once-dispatch.d.ts +2 -1
- package/dist/src/control-plane/application/advance-once-dispatch.js +7 -0
- package/dist/src/control-plane/domain/dispatch-policy.d.ts +6 -0
- package/dist/src/control-plane/domain/dispatch-policy.js +4 -1
- package/dist/src/orchestration/application/advance-workflow.d.ts +4 -5
- package/dist/src/orchestration/application/advance-workflow.js +6 -6
- package/dist/src/orchestration/application/orchestration-service.d.ts +4 -6
- package/dist/src/orchestration/application/orchestration-service.js +3 -3
- package/dist/src/orchestration/application/pending-activations.d.ts +13 -0
- package/dist/src/orchestration/application/pending-activations.js +32 -0
- package/dist/src/orchestration/application/resource-transition-matching.js +1 -0
- package/dist/src/orchestration/contracts/config.d.ts +1 -0
- package/dist/src/orchestration/contracts/event-decoder.d.ts +1 -0
- package/dist/src/orchestration/contracts/event-decoder.js +1 -0
- package/dist/src/orchestration/contracts/events.d.ts +2 -0
- package/dist/src/orchestration/contracts/views.d.ts +1 -0
- package/dist/src/orchestration/domain/compiler.js +4 -13
- package/dist/src/orchestration/domain/decision-events.d.ts +1 -0
- package/dist/src/orchestration/domain/decision-events.js +1 -0
- package/dist/src/orchestration/domain/dispatch-priority.d.ts +9 -0
- package/dist/src/orchestration/domain/dispatch-priority.js +16 -0
- package/dist/src/orchestration/domain/runner-quota-retry-policy.js +1 -0
- package/dist/src/orchestration/domain/signal-policy.d.ts +2 -0
- package/dist/src/orchestration/domain/signal-policy.js +10 -4
- package/dist/src/orchestration/domain/transition-target.d.ts +4 -0
- package/dist/src/orchestration/domain/transition-target.js +14 -0
- package/dist/src/orchestration/domain/transition.d.ts +1 -1
- package/dist/src/orchestration/domain/transition.js +4 -3
- package/dist/src/orchestration/domain/workflow-graph.d.ts +8 -0
- package/dist/src/orchestration/domain/workflow-graph.js +41 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +1 -0
- package/dist/src/orchestration/index.d.ts +2 -0
- package/dist/src/orchestration/index.js +2 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { createConversationService } from '../conversations/index.js';
|
|
|
6
6
|
import { ExecutionCancellationReason, GitWorkspaceProvider, RecoveryService, TranscriptStore, createExecutionService, createLocalProcessInspector, createRunnerMemoryProfileDecorator, } from '../execution/index.js';
|
|
7
7
|
import { createGitHubAgentContextReader, gitHubProviderDefinition, resolveGitHubResourceUrl, } from '../integrations/github/index.js';
|
|
8
8
|
import { SystemClock, UlidIdGenerator } from '../kernel/index.js';
|
|
9
|
-
import { compileWorkflow, createOrchestrationService } from '../orchestration/index.js';
|
|
9
|
+
import { compileWorkflow, createAgentActivityClassifier, createOrchestrationService, } from '../orchestration/index.js';
|
|
10
10
|
import { createResourceLookup, createResourceService, resourceId, } from '../resources/index.js';
|
|
11
11
|
import { createWorkService } from '../work/index.js';
|
|
12
12
|
import { createFileActivationSchedulerSerialiser } from './activation-scheduler-serialiser.js';
|
|
@@ -58,7 +58,7 @@ export async function createCompositionRoot(wakeRoot, options = {}) {
|
|
|
58
58
|
name,
|
|
59
59
|
compileWorkflow(name, definition, activities, Object.keys(config.orchestration.workflows)),
|
|
60
60
|
]));
|
|
61
|
-
const orchestration = createOrchestrationService(journal, work, definitions, projections);
|
|
61
|
+
const orchestration = createOrchestrationService(journal, work, definitions, projections, createAgentActivityClassifier(activities));
|
|
62
62
|
const workspaces = new GitWorkspaceProvider(paths.workspacesRoot, {
|
|
63
63
|
async cloneLocator(id) {
|
|
64
64
|
const resource = await resources.get(resourceId(id));
|
|
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
|
|
|
124
124
|
return `g${headHash.slice(0, 7)}`;
|
|
125
125
|
return '0.1.0-dev';
|
|
126
126
|
}
|
|
127
|
-
export const wakeVersion = "v0.4.
|
|
127
|
+
export const wakeVersion = "v0.4.79";
|
|
128
128
|
/** The registry-installable version used by packaged sandbox images. */
|
|
129
129
|
export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
2
|
import type { ExecutionFailureCode, RunView, WorkspaceRecovery } from '../../execution/index.js';
|
|
3
3
|
import type { IdGenerator } from '../../kernel/index.js';
|
|
4
|
-
import type { ActivityActivationView, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
4
|
+
import type { ActivityActivationView, PendingActivationPriority, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
5
5
|
import type { ResourceService } from '../../resources/index.js';
|
|
6
6
|
import type { WorkStatus } from '../../work/index.js';
|
|
7
7
|
import type { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
@@ -10,6 +10,7 @@ export interface OrchestrationPort {
|
|
|
10
10
|
listPendingActivations(workItemId?: string): Promise<readonly {
|
|
11
11
|
workflow: WorkflowInstanceView;
|
|
12
12
|
activation: ActivityActivationView;
|
|
13
|
+
priority?: PendingActivationPriority;
|
|
13
14
|
}[]>;
|
|
14
15
|
listWaiting(): Promise<readonly (WorkflowInstanceView | null)[]>;
|
|
15
16
|
get?(workflowInstanceId: string): Promise<WorkflowInstanceView | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
2
|
import { type ActivityOutcome } from '../../activities/index.js';
|
|
3
|
-
import type { ActivityActivationView, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
3
|
+
import type { ActivityActivationView, PendingActivationPriority, WorkflowInstanceView } from '../../orchestration/index.js';
|
|
4
4
|
import type { ResourceService } from '../../resources/index.js';
|
|
5
5
|
import type { AdvanceResult } from '../contracts/views.js';
|
|
6
6
|
import type { DispatchPolicy } from '../domain/dispatch-policy.js';
|
|
@@ -24,6 +24,7 @@ export interface DispatchLoopContext {
|
|
|
24
24
|
interface PendingActivation {
|
|
25
25
|
readonly workflow: WorkflowInstanceView;
|
|
26
26
|
readonly activation: ActivityActivationView;
|
|
27
|
+
readonly priority?: PendingActivationPriority | undefined;
|
|
27
28
|
}
|
|
28
29
|
export declare function advancementWasDurablyApplied(orchestration: OrchestrationPort, workflowInstanceId: WorkflowInstanceView['workflowInstanceId'], activationId: ActivityActivationView['activationId']): Promise<boolean>;
|
|
29
30
|
export declare function isolatedWorkflowReason(error: unknown): string;
|
|
@@ -3,6 +3,12 @@ import { ActivationClaimConflictError, isActiveRunStatus, NoEligibleRunnerError,
|
|
|
3
3
|
import { WorkflowStatus } from '../../orchestration/index.js';
|
|
4
4
|
import { canDispatchWorkItem, readOpenWorkItemIds, } from '../domain/open-work-policy.js';
|
|
5
5
|
import { isExecutionFailureTerminal } from './execution-reconciliation.js';
|
|
6
|
+
// Ports without priority (older fakes) rank neutrally and fall back to oldest-first.
|
|
7
|
+
const neutralPriority = {
|
|
8
|
+
remainingAgentSteps: 0,
|
|
9
|
+
watchDriven: false,
|
|
10
|
+
retried: false,
|
|
11
|
+
};
|
|
6
12
|
export async function advancementWasDurablyApplied(orchestration, workflowInstanceId, activationId) {
|
|
7
13
|
const current = await orchestration.get?.(workflowInstanceId);
|
|
8
14
|
return (current !== undefined && current !== null && current.acceptedOutcomes.includes(activationId));
|
|
@@ -83,6 +89,7 @@ export async function runDispatchLoop(pending, ctx) {
|
|
|
83
89
|
workItemId: item.workflow.workItemId,
|
|
84
90
|
activationId: item.activation.activationId,
|
|
85
91
|
requestedPosition,
|
|
92
|
+
priority: item.priority ?? neutralPriority,
|
|
86
93
|
hasActiveRun: dispatchedIds.has(item.activation.activationId) ||
|
|
87
94
|
activeActivationIds.has(item.activation.activationId) ||
|
|
88
95
|
branchActiveWorkflowIds.has(item.workflow.workflowInstanceId),
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
export interface DispatchPriority {
|
|
2
|
+
readonly remainingAgentSteps: number;
|
|
3
|
+
readonly watchDriven: boolean;
|
|
4
|
+
readonly retried: boolean;
|
|
5
|
+
}
|
|
1
6
|
export interface DispatchCandidate {
|
|
2
7
|
readonly workItemId: string;
|
|
3
8
|
readonly activationId: string;
|
|
4
9
|
readonly requestedPosition: number;
|
|
10
|
+
readonly priority: DispatchPriority;
|
|
5
11
|
readonly hasActiveRun: boolean;
|
|
6
12
|
readonly cancelled: boolean;
|
|
7
13
|
}
|
|
@@ -8,7 +8,10 @@ export class DispatchPolicy {
|
|
|
8
8
|
return [];
|
|
9
9
|
return [...candidates]
|
|
10
10
|
.filter((candidate) => !candidate.cancelled && !candidate.hasActiveRun)
|
|
11
|
-
.sort((left, right) => left.
|
|
11
|
+
.sort((left, right) => left.priority.remainingAgentSteps - right.priority.remainingAgentSteps ||
|
|
12
|
+
Number(right.priority.watchDriven) - Number(left.priority.watchDriven) ||
|
|
13
|
+
Number(right.priority.retried) - Number(left.priority.retried) ||
|
|
14
|
+
left.requestedPosition - right.requestedPosition ||
|
|
12
15
|
left.activationId.localeCompare(right.activationId))
|
|
13
16
|
.slice(0, this.options.maxDispatches);
|
|
14
17
|
}
|
|
@@ -5,6 +5,7 @@ import type { SupplementalActivityRequest } from '../contracts/events.js';
|
|
|
5
5
|
import { type SignalName, type WorkflowInstanceId } from '../contracts/identifiers.js';
|
|
6
6
|
import type { AcceptActivityOutcome } from './accept-activity-outcome.js';
|
|
7
7
|
import type { OrchestrationRepository } from './orchestration-repository.js';
|
|
8
|
+
import { type AgentActivityClassifier, type PendingActivationEntry } from './pending-activations.js';
|
|
8
9
|
import { type ExecutionFailureInput } from './resolve-execution-failure.js';
|
|
9
10
|
import type { StartWorkflow } from './start-workflow.js';
|
|
10
11
|
export declare class OperatorRetryIneligibleError extends Error {
|
|
@@ -15,7 +16,8 @@ export declare class AdvanceWorkflow {
|
|
|
15
16
|
private readonly repository;
|
|
16
17
|
private readonly workflows;
|
|
17
18
|
private readonly acceptOutcome;
|
|
18
|
-
|
|
19
|
+
private readonly isAgentActivity;
|
|
20
|
+
constructor(repository: OrchestrationRepository, workflows: StartWorkflow, acceptOutcome: AcceptActivityOutcome['execute'], isAgentActivity?: AgentActivityClassifier);
|
|
19
21
|
requestSupplementalActivity(id: WorkflowInstanceId, request: SupplementalActivityRequest, context: CommandContext): Promise<import("../index.js").WorkflowInstanceView>;
|
|
20
22
|
markActivationStarted(id: WorkflowInstanceId, activationId: ActivationId, context: CommandContext): Promise<import("../index.js").WorkflowInstanceView | null>;
|
|
21
23
|
blockAwaitingActivation(id: WorkflowInstanceId, activationId: ActivationId, reason: string, context: CommandContext): Promise<import("../index.js").WorkflowInstanceView | null>;
|
|
@@ -34,10 +36,7 @@ export declare class AdvanceWorkflow {
|
|
|
34
36
|
resumeBlockedStageForChanges(id: WorkflowInstanceId, context: CommandContext): Promise<import("../index.js").WorkflowInstanceView | null>;
|
|
35
37
|
resumeNeedsClarificationStage(id: WorkflowInstanceId, context: CommandContext): Promise<import("../index.js").WorkflowInstanceView | null>;
|
|
36
38
|
get(id: WorkflowInstanceId): Promise<import("../index.js").WorkflowInstanceView | null>;
|
|
37
|
-
listPendingActivations(workItemId?: string): Promise<
|
|
38
|
-
workflow: import("../index.js").WorkflowInstanceView;
|
|
39
|
-
activation: import("../index.js").ActivityActivationView;
|
|
40
|
-
}[]>;
|
|
39
|
+
listPendingActivations(workItemId?: string): Promise<readonly PendingActivationEntry[]>;
|
|
41
40
|
listWaiting(signalKind?: SignalName): Promise<import("../index.js").WorkflowInstanceView[]>;
|
|
42
41
|
listAll(): Promise<import("../index.js").WorkflowInstanceView[]>;
|
|
43
42
|
listResourceTransitionMatches(event: PersistedEvent): Promise<readonly import("./resource-transition-matching.js").ResourceTransitionMatch[]>;
|
|
@@ -8,6 +8,7 @@ import { isAuthorisedActor } from '../domain/supplemental-policy.js';
|
|
|
8
8
|
import { appendWithIntentRecovery } from './durable-append.js';
|
|
9
9
|
import { expireTimedOutWaits } from './expire-timed-out-waits.js';
|
|
10
10
|
import { attributeOperatorRetry } from './operator-retry-attribution.js';
|
|
11
|
+
import { prioritisePendingActivations, } from './pending-activations.js';
|
|
11
12
|
import { resolveExecutionFailure, } from './resolve-execution-failure.js';
|
|
12
13
|
import { acceptResourceTransition, matchResourceTransitions, } from './resource-transition-matching.js';
|
|
13
14
|
import { matchWatches } from './watch-matching.js';
|
|
@@ -21,10 +22,12 @@ export class AdvanceWorkflow {
|
|
|
21
22
|
repository;
|
|
22
23
|
workflows;
|
|
23
24
|
acceptOutcome;
|
|
24
|
-
|
|
25
|
+
isAgentActivity;
|
|
26
|
+
constructor(repository, workflows, acceptOutcome, isAgentActivity = () => true) {
|
|
25
27
|
this.repository = repository;
|
|
26
28
|
this.workflows = workflows;
|
|
27
29
|
this.acceptOutcome = acceptOutcome;
|
|
30
|
+
this.isAgentActivity = isAgentActivity;
|
|
28
31
|
}
|
|
29
32
|
async requestSupplementalActivity(id, request, context) {
|
|
30
33
|
const loaded = await this.repository.loadRequired(id);
|
|
@@ -191,11 +194,8 @@ export class AdvanceWorkflow {
|
|
|
191
194
|
return (await this.repository.load(id)).view;
|
|
192
195
|
}
|
|
193
196
|
async listPendingActivations(workItemId) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
view.pendingActivation !== undefined &&
|
|
197
|
-
(workItemId === undefined || view.workItemId === workItemId))
|
|
198
|
-
.map(({ view }) => ({ workflow: view, activation: view.pendingActivation }));
|
|
197
|
+
const views = (await this.listAllLoaded()).map(({ view }) => view);
|
|
198
|
+
return prioritisePendingActivations(this.workflows, views, this.isAgentActivity, workItemId);
|
|
199
199
|
}
|
|
200
200
|
async listWaiting(signalKind) {
|
|
201
201
|
return (await this.listAllLoaded())
|
|
@@ -10,6 +10,7 @@ import { type SignalName, type WorkflowInstanceId } from '../contracts/identifie
|
|
|
10
10
|
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
11
11
|
import { AdvanceWorkflow } from './advance-workflow.js';
|
|
12
12
|
import { type ConversationCommandInput, type ConversationCommandResult } from './conversation-command.js';
|
|
13
|
+
import type { AgentActivityClassifier } from './pending-activations.js';
|
|
13
14
|
export declare class OrchestrationService {
|
|
14
15
|
private readonly startWorkflow;
|
|
15
16
|
private readonly acceptActivityOutcome;
|
|
@@ -23,7 +24,7 @@ export declare class OrchestrationService {
|
|
|
23
24
|
private readonly journal;
|
|
24
25
|
private readonly definitions;
|
|
25
26
|
private readonly work;
|
|
26
|
-
constructor(journal: EventJournal, work: WorkService, definitions: Readonly<Record<string, CompiledWorkflow>>, projections?: ProjectionStore);
|
|
27
|
+
constructor(journal: EventJournal, work: WorkService, definitions: Readonly<Record<string, CompiledWorkflow>>, projections?: ProjectionStore, isAgentActivity?: AgentActivityClassifier);
|
|
27
28
|
start(command: StartWorkflowInstance, context: CommandContext): Promise<WorkflowInstanceView>;
|
|
28
29
|
requestChild(request: ChildWorkflowRequest & {
|
|
29
30
|
readonly maxPerGroup: number;
|
|
@@ -68,10 +69,7 @@ export declare class OrchestrationService {
|
|
|
68
69
|
}, context: CommandContext): Promise<import("../contracts/views.js").GroupBudgetExhaustedView | WorkflowInstanceView>;
|
|
69
70
|
get(id: WorkflowInstanceId): Promise<WorkflowInstanceView | null>;
|
|
70
71
|
getPrimaryWorkflowInstanceId(workItemId: WorkItemId): Promise<string | undefined>;
|
|
71
|
-
listPendingActivations(workItemId?: string): Promise<
|
|
72
|
-
workflow: WorkflowInstanceView;
|
|
73
|
-
activation: import("../contracts/views.js").ActivityActivationView;
|
|
74
|
-
}[]>;
|
|
72
|
+
listPendingActivations(workItemId?: string): Promise<readonly import("./pending-activations.js").PendingActivationEntry[]>;
|
|
75
73
|
listWaiting(signalKind?: SignalName): Promise<WorkflowInstanceView[]>;
|
|
76
74
|
expireTimedOutWaits(context: CommandContext): Promise<WorkflowInstanceView[]>;
|
|
77
75
|
listAll(): Promise<WorkflowInstanceView[]>;
|
|
@@ -103,4 +101,4 @@ export type OperationCoordinator = <Result>(operation: () => Promise<Result>) =>
|
|
|
103
101
|
export interface WatchChildCancellation {
|
|
104
102
|
cancelSupersededWatchChildren(workflowInstanceIds: readonly string[]): Promise<unknown>;
|
|
105
103
|
}
|
|
106
|
-
export declare const createOrchestrationService: (journal: EventJournal, work: WorkService, definitions: Readonly<Record<string, CompiledWorkflow>>, projections?: ProjectionStore) => OrchestrationService;
|
|
104
|
+
export declare const createOrchestrationService: (journal: EventJournal, work: WorkService, definitions: Readonly<Record<string, CompiledWorkflow>>, projections?: ProjectionStore, isAgentActivity?: AgentActivityClassifier) => OrchestrationService;
|
|
@@ -31,7 +31,7 @@ export class OrchestrationService {
|
|
|
31
31
|
journal;
|
|
32
32
|
definitions;
|
|
33
33
|
work;
|
|
34
|
-
constructor(journal, work, definitions, projections) {
|
|
34
|
+
constructor(journal, work, definitions, projections, isAgentActivity) {
|
|
35
35
|
this.projections = projections;
|
|
36
36
|
this.journal = journal;
|
|
37
37
|
this.work = work;
|
|
@@ -39,7 +39,7 @@ export class OrchestrationService {
|
|
|
39
39
|
this.claims = new CoordinationClaims(journal);
|
|
40
40
|
this.definitions = new WorkflowDefinitionRegistry(journal, projections, definitions);
|
|
41
41
|
this.startWorkflow = new StartWorkflow(repository, this.claims, work, this.definitions);
|
|
42
|
-
this.advanceWorkflow = new AdvanceWorkflow(repository, this.startWorkflow, (command, context) => this.acceptActivityOutcome.execute(command, context));
|
|
42
|
+
this.advanceWorkflow = new AdvanceWorkflow(repository, this.startWorkflow, (command, context) => this.acceptActivityOutcome.execute(command, context), isAgentActivity);
|
|
43
43
|
this.acceptWorkflowSignal = new AcceptSignal(repository, this.startWorkflow, work);
|
|
44
44
|
this.childWorkflows = new RequestChild(repository, this.claims, new GroupBudgetRecorder(journal), this.startWorkflow, this.advanceWorkflow);
|
|
45
45
|
this.acceptActivityOutcome = new AcceptActivityOutcome(repository, this.startWorkflow, (context) => this.childWorkflows.reconcileChildCompletions(context));
|
|
@@ -303,7 +303,7 @@ async function journalGroupBudgetExhaustion(journal, workflowInstanceId) {
|
|
|
303
303
|
: [];
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
export const createOrchestrationService = (journal, work, definitions, projections) => new OrchestrationService(journal, work, definitions, projections);
|
|
306
|
+
export const createOrchestrationService = (journal, work, definitions, projections, isAgentActivity) => new OrchestrationService(journal, work, definitions, projections, isAgentActivity);
|
|
307
307
|
function isWorkControllable(work) {
|
|
308
308
|
return work !== null && !work.deleted && !work.frozen && work.state === WorkStatus.Open;
|
|
309
309
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ActivityName, type ActivityRegistry } from '../../activities/index.js';
|
|
2
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../contracts/views.js';
|
|
3
|
+
import { type PendingActivationPriority } from '../domain/dispatch-priority.js';
|
|
4
|
+
import type { StartWorkflow } from './start-workflow.js';
|
|
5
|
+
/** Whether a stage's activity runs an agent; unknown activities conservatively count as agents. */
|
|
6
|
+
export type AgentActivityClassifier = (activity: ActivityName) => boolean;
|
|
7
|
+
export declare function createAgentActivityClassifier(registry: ActivityRegistry): AgentActivityClassifier;
|
|
8
|
+
export interface PendingActivationEntry {
|
|
9
|
+
readonly workflow: WorkflowInstanceView;
|
|
10
|
+
readonly activation: ActivityActivationView;
|
|
11
|
+
readonly priority: PendingActivationPriority;
|
|
12
|
+
}
|
|
13
|
+
export declare function prioritisePendingActivations(workflows: StartWorkflow, views: readonly WorkflowInstanceView[], isAgentActivity: AgentActivityClassifier, workItemId?: string): Promise<readonly PendingActivationEntry[]>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ActivityExecutionKind, } from '../../activities/index.js';
|
|
2
|
+
import { WorkflowStatus } from '../contracts/vocabulary.js';
|
|
3
|
+
import { pendingActivationPriority, } from '../domain/dispatch-priority.js';
|
|
4
|
+
import { WorkflowDefinitionUnavailableError } from './workflow-definition-registry.js';
|
|
5
|
+
export function createAgentActivityClassifier(registry) {
|
|
6
|
+
const kinds = new Map(registry.list().map((activity) => [activity.name, activity.executionKind]));
|
|
7
|
+
return (activity) => {
|
|
8
|
+
const kind = kinds.get(activity);
|
|
9
|
+
return kind === undefined || kind === ActivityExecutionKind.Agent;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
// Read-only: an unavailable definition ranks last rather than blocking the instance.
|
|
13
|
+
async function resolveDefinition(workflows, view) {
|
|
14
|
+
try {
|
|
15
|
+
return await workflows.definitionFor(view);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error instanceof WorkflowDefinitionUnavailableError)
|
|
19
|
+
return null;
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function prioritisePendingActivations(workflows, views, isAgentActivity, workItemId) {
|
|
24
|
+
const pending = views.filter((view) => view.status === WorkflowStatus.Active &&
|
|
25
|
+
view.pendingActivation !== undefined &&
|
|
26
|
+
(workItemId === undefined || view.workItemId === workItemId));
|
|
27
|
+
return Promise.all(pending.map(async (view) => ({
|
|
28
|
+
workflow: view,
|
|
29
|
+
activation: view.pendingActivation,
|
|
30
|
+
priority: pendingActivationPriority(await resolveDefinition(workflows, view), view, view.pendingActivation, isAgentActivity),
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
@@ -78,6 +78,7 @@ export async function acceptResourceTransition(repository, workflows, id, target
|
|
|
78
78
|
occurredAt: context.occurredAt,
|
|
79
79
|
causationId: `${context.commandId}:${evidenceId}`,
|
|
80
80
|
consent: true,
|
|
81
|
+
resourceTransition: true,
|
|
81
82
|
});
|
|
82
83
|
if (decision.kind === 'append') {
|
|
83
84
|
const recovered = await appendWithIntentRecovery({
|
|
@@ -399,6 +399,7 @@ export interface CompiledWatch extends Omit<WatchConfig, 'workflow' | 'while' |
|
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
401
|
export interface CompiledWorkflow {
|
|
402
|
+
readonly remainingAgentSteps?: Readonly<Record<StageName, number>>;
|
|
402
403
|
readonly name: WorkflowName;
|
|
403
404
|
readonly entry: StageName;
|
|
404
405
|
readonly commands: Readonly<Record<CommandName, CompiledSupplementalCommand>>;
|
|
@@ -68,6 +68,7 @@ export declare const activityRequestedSchema: z.ZodObject<{
|
|
|
68
68
|
followOnIndex: z.ZodOptional<z.ZodNumber>;
|
|
69
69
|
sessionPolicy: z.ZodOptional<z.ZodLiteral<"fresh">>;
|
|
70
70
|
supplemental: z.ZodOptional<z.ZodLiteral<true>>;
|
|
71
|
+
watchDriven: z.ZodOptional<z.ZodLiteral<true>>;
|
|
71
72
|
}, z.core.$strict>;
|
|
72
73
|
export declare const expectationSchema: z.ZodObject<{
|
|
73
74
|
signalKind: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").SignalName, string>>;
|
|
@@ -80,6 +80,7 @@ export const activityRequestedSchema = z
|
|
|
80
80
|
followOnIndex: z.number().int().nonnegative().optional(),
|
|
81
81
|
sessionPolicy: z.literal('fresh').optional(),
|
|
82
82
|
supplemental: z.literal(true).optional(),
|
|
83
|
+
watchDriven: z.literal(true).optional(),
|
|
83
84
|
})
|
|
84
85
|
.strict();
|
|
85
86
|
const approvalAuthoritySchema = z.discriminatedUnion('kind', [
|
|
@@ -184,6 +184,8 @@ export interface ActivityRequestedPayload {
|
|
|
184
184
|
readonly sessionPolicy?: 'fresh' | undefined;
|
|
185
185
|
readonly followOnIndex?: number | undefined;
|
|
186
186
|
readonly supplemental?: boolean | undefined;
|
|
187
|
+
/** Requested as the resume of a watch- or provider-observed signal; absent means false. */
|
|
188
|
+
readonly watchDriven?: true | undefined;
|
|
187
189
|
}
|
|
188
190
|
export interface SignalExpectation {
|
|
189
191
|
readonly signalKind: SignalName;
|
|
@@ -14,6 +14,7 @@ export interface ActivityActivationView {
|
|
|
14
14
|
readonly status: ActivityActivationStatus;
|
|
15
15
|
readonly followOnIndex?: number;
|
|
16
16
|
readonly supplemental?: boolean;
|
|
17
|
+
readonly watchDriven?: true;
|
|
17
18
|
}
|
|
18
19
|
export interface SignalExpectationView {
|
|
19
20
|
readonly signalKind: SignalName;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ActivityEventType, activityName, ActivityOutcomeKind, } from '../../activities/index.js';
|
|
1
|
+
import { ActivityEventType, ActivityExecutionKind, activityName, ActivityOutcomeKind, } from '../../activities/index.js';
|
|
2
2
|
import { workflowDefinitionConfigSchema, } from '../contracts/config.js';
|
|
3
3
|
import { commandName, signalName, stageName, watchId, workflowName, } from '../contracts/identifiers.js';
|
|
4
4
|
import { ApprovalAuthorityKind, TransitionTargetKind } from '../contracts/vocabulary.js';
|
|
5
5
|
import { defaultApprovalAwait } from './approval-defaults.js';
|
|
6
6
|
import { compileResourceTransitions } from './resource-transition-compiler.js';
|
|
7
|
-
import {
|
|
7
|
+
import { compileTarget, isReservedRouteTarget, isReservedTerminalTarget, } from './transition-target.js';
|
|
8
|
+
import { assertCyclesBounded, assertReachable, remainingAgentSteps } from './workflow-graph.js';
|
|
8
9
|
export function compileWorkflow(name, input, activities, knownWorkflowNames = [name]) {
|
|
9
10
|
const compiledName = workflowName(name);
|
|
10
11
|
const config = workflowDefinitionConfigSchema.parse(input);
|
|
@@ -25,6 +26,7 @@ export function compileWorkflow(name, input, activities, knownWorkflowNames = [n
|
|
|
25
26
|
assertReachable(compiledEntry, stages);
|
|
26
27
|
assertCyclesBounded(stages);
|
|
27
28
|
return Object.freeze({
|
|
29
|
+
remainingAgentSteps: Object.freeze(remainingAgentSteps(stages, (activity) => activities.describe(activity).executionKind === ActivityExecutionKind.Agent)),
|
|
28
30
|
name: compiledName,
|
|
29
31
|
entry: compiledEntry,
|
|
30
32
|
commands: Object.freeze(commands),
|
|
@@ -181,14 +183,3 @@ function compileCommands(config, activities) {
|
|
|
181
183
|
}),
|
|
182
184
|
]));
|
|
183
185
|
}
|
|
184
|
-
const isReservedRouteTarget = (target) => target === ActivityOutcomeKind.Done || target === 'await-human' || target === 'wait';
|
|
185
|
-
const isReservedTerminalTarget = (target) => target === ActivityOutcomeKind.Done || target === 'await-human';
|
|
186
|
-
function compileTarget(target, outcomeKind) {
|
|
187
|
-
if (target === ActivityOutcomeKind.Done)
|
|
188
|
-
return { kind: TransitionTargetKind.Complete };
|
|
189
|
-
if (target === 'await-human')
|
|
190
|
-
return { kind: TransitionTargetKind.AwaitSignal, signal: signalName(outcomeKind) };
|
|
191
|
-
if (target === 'wait')
|
|
192
|
-
return { kind: TransitionTargetKind.ResourceTransitionWait };
|
|
193
|
-
return { kind: TransitionTargetKind.Stage, stage: stageName(target) };
|
|
194
|
-
}
|
|
@@ -18,6 +18,7 @@ export declare function activation(id: WorkflowInstanceId, ordinal: number, acti
|
|
|
18
18
|
readonly stage?: StageName;
|
|
19
19
|
readonly followOnIndex?: number;
|
|
20
20
|
readonly supplemental?: boolean;
|
|
21
|
+
readonly watchDriven?: boolean;
|
|
21
22
|
}): ActivityRequestedPayload;
|
|
22
23
|
type WorkflowDraftInput = {
|
|
23
24
|
[Type in WorkflowOrchestrationEventName]: {
|
|
@@ -18,6 +18,7 @@ export function activation(id, ordinal, activity, input, options) {
|
|
|
18
18
|
...(options.sessionPolicy === undefined ? {} : { sessionPolicy: options.sessionPolicy }),
|
|
19
19
|
...(options.followOnIndex === undefined ? {} : { followOnIndex: options.followOnIndex }),
|
|
20
20
|
...(options.supplemental === true ? { supplemental: true } : {}),
|
|
21
|
+
...(options.watchDriven === true ? { watchDriven: true } : {}),
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
export function startDraft(input, event, ordinal) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CompiledStage, CompiledWorkflow } from '../contracts/config.js';
|
|
2
|
+
import type { ActivityActivationView, WorkflowInstanceView } from '../contracts/views.js';
|
|
3
|
+
export interface PendingActivationPriority {
|
|
4
|
+
/** Agent stages left on the cheapest path to completion, or UnreachableRemainingSteps. */
|
|
5
|
+
readonly remainingAgentSteps: number;
|
|
6
|
+
readonly watchDriven: boolean;
|
|
7
|
+
readonly retried: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function pendingActivationPriority(definition: CompiledWorkflow | null, view: WorkflowInstanceView, activation: ActivityActivationView, isAgentActivity: (activity: CompiledStage['activity']) => boolean): PendingActivationPriority;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { remainingAgentSteps, UnreachableRemainingSteps } from './workflow-graph.js';
|
|
2
|
+
// Retry keys are `<stage>:<outcomeKind>`; a stage is retried once any key for it has counted.
|
|
3
|
+
function isStageRetried(view, stage) {
|
|
4
|
+
return Object.entries(view.retryCounts).some(([key, count]) => count > 0 && key.startsWith(`${stage}:`));
|
|
5
|
+
}
|
|
6
|
+
export function pendingActivationPriority(definition, view, activation, isAgentActivity) {
|
|
7
|
+
const stage = activation.stage ?? view.currentStage;
|
|
8
|
+
const costs = definition === null
|
|
9
|
+
? undefined
|
|
10
|
+
: (definition.remainingAgentSteps ?? remainingAgentSteps(definition.stages, isAgentActivity));
|
|
11
|
+
return {
|
|
12
|
+
remainingAgentSteps: costs?.[stage] ?? UnreachableRemainingSteps,
|
|
13
|
+
watchDriven: activation.watchDriven === true,
|
|
14
|
+
retried: isStageRetried(view, stage),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -33,6 +33,7 @@ export function requestRunnerQuotaRetry(state, input) {
|
|
|
33
33
|
eventType: OrchestrationEventType.ActivityRequested,
|
|
34
34
|
payload: activation(state.workflowInstanceId, nextOrdinal(state), interrupted.activity, interrupted.input, {
|
|
35
35
|
execution: interrupted.execution,
|
|
36
|
+
...(interrupted.watchDriven === true ? { watchDriven: true } : {}),
|
|
36
37
|
...(interrupted.stage === undefined ? {} : { stage: interrupted.stage }),
|
|
37
38
|
...(interrupted.followOnIndex === undefined
|
|
38
39
|
? {}
|
|
@@ -6,6 +6,8 @@ import type { AcceptActivityOutcome, DecisionContext, OrchestrationDecision } fr
|
|
|
6
6
|
export declare const AwaitTimeoutBlockReason = "await.timeout-exceeded";
|
|
7
7
|
export interface AcceptSignal extends DecisionContext {
|
|
8
8
|
readonly signal: OrchestrationSignal;
|
|
9
|
+
/** A confirmed resource transition can share the wait's watch-verdict channel. */
|
|
10
|
+
readonly resourceTransition?: true;
|
|
9
11
|
readonly consent?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare function waitForSignal(state: WorkflowInstanceView, expectation: SignalExpectation, input: DecisionContext): OrchestrationDecision;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActivityOutcomeKind } from '../../activities/index.js';
|
|
2
|
-
import { OrchestrationEventType } from '../contracts/events.js';
|
|
2
|
+
import { OrchestrationEventType, ResourceTransitionSignal } from '../contracts/events.js';
|
|
3
3
|
import { stageName } from '../contracts/identifiers.js';
|
|
4
4
|
import { ActivityActivationStatus, ApprovalAuthorityKind, WorkflowStatus, } from '../contracts/vocabulary.js';
|
|
5
5
|
import { activation, nextOrdinal, stateDraft } from './decision-events.js';
|
|
@@ -32,10 +32,15 @@ export function acceptSignal(definition, state, input) {
|
|
|
32
32
|
}, 1),
|
|
33
33
|
];
|
|
34
34
|
const target = signal.outcome === ActivityOutcomeKind.Rejected ? expected.onRejectResume : expected.resume;
|
|
35
|
+
// Human-only gate approvals are not "reacting to something"; watch verdicts and
|
|
36
|
+
// provider-observed resource transitions are.
|
|
37
|
+
const watchDriven = input.resourceTransition === true ||
|
|
38
|
+
authority.kind === ApprovalAuthorityKind.Watch ||
|
|
39
|
+
signal.kind === ResourceTransitionSignal;
|
|
35
40
|
if (target !== undefined)
|
|
36
|
-
resumeToTarget(events, definition, state, input, target);
|
|
41
|
+
resumeToTarget(events, definition, state, input, target, watchDriven);
|
|
37
42
|
else
|
|
38
|
-
requestLegacyReentry(events, definition, state, input);
|
|
43
|
+
requestLegacyReentry(events, definition, state, input, watchDriven);
|
|
39
44
|
return { kind: 'append', events };
|
|
40
45
|
}
|
|
41
46
|
export function hasTimedOutAwait(state, occurredAt) {
|
|
@@ -61,13 +66,14 @@ export function expireTimedOutAwait(state, input) {
|
|
|
61
66
|
],
|
|
62
67
|
};
|
|
63
68
|
}
|
|
64
|
-
function requestLegacyReentry(events, definition, state, input) {
|
|
69
|
+
function requestLegacyReentry(events, definition, state, input, watchDriven) {
|
|
65
70
|
const stage = definition.stages[stageName(state.currentStage)];
|
|
66
71
|
events.push(stateDraft(state, input, {
|
|
67
72
|
eventType: OrchestrationEventType.ActivityRequested,
|
|
68
73
|
payload: activation(state.workflowInstanceId, nextOrdinal(state), stage.activity, stage.with, {
|
|
69
74
|
execution: stage.execution,
|
|
70
75
|
stage: stageName(state.currentStage),
|
|
76
|
+
watchDriven,
|
|
71
77
|
}),
|
|
72
78
|
}, events.length + 1));
|
|
73
79
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CompiledOutcomeRoute } from '../contracts/config.js';
|
|
2
|
+
export declare const isReservedRouteTarget: (target: string) => boolean;
|
|
3
|
+
export declare const isReservedTerminalTarget: (target: string) => boolean;
|
|
4
|
+
export declare function compileTarget(target: string, outcomeKind: string): CompiledOutcomeRoute['target'];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActivityOutcomeKind } from '../../activities/index.js';
|
|
2
|
+
import { signalName, stageName } from '../contracts/identifiers.js';
|
|
3
|
+
import { TransitionTargetKind } from '../contracts/vocabulary.js';
|
|
4
|
+
export const isReservedRouteTarget = (target) => target === ActivityOutcomeKind.Done || target === 'await-human' || target === 'wait';
|
|
5
|
+
export const isReservedTerminalTarget = (target) => target === ActivityOutcomeKind.Done || target === 'await-human';
|
|
6
|
+
export function compileTarget(target, outcomeKind) {
|
|
7
|
+
if (target === ActivityOutcomeKind.Done)
|
|
8
|
+
return { kind: TransitionTargetKind.Complete };
|
|
9
|
+
if (target === 'await-human')
|
|
10
|
+
return { kind: TransitionTargetKind.AwaitSignal, signal: signalName(outcomeKind) };
|
|
11
|
+
if (target === 'wait')
|
|
12
|
+
return { kind: TransitionTargetKind.ResourceTransitionWait };
|
|
13
|
+
return { kind: TransitionTargetKind.Stage, stage: stageName(target) };
|
|
14
|
+
}
|
|
@@ -12,5 +12,5 @@ interface DecisionContext {
|
|
|
12
12
|
readonly causationId: string;
|
|
13
13
|
}
|
|
14
14
|
export declare function finishRoute(events: WorkflowOrchestrationEventData[], definition: CompiledWorkflow, state: WorkflowInstanceView, input: TransitionInput, route: CompiledOutcomeRoute): void;
|
|
15
|
-
export declare function resumeToTarget(events: WorkflowOrchestrationEventData[], definition: CompiledWorkflow, state: WorkflowInstanceView, input: DecisionContext, target: TransitionTarget): void;
|
|
15
|
+
export declare function resumeToTarget(events: WorkflowOrchestrationEventData[], definition: CompiledWorkflow, state: WorkflowInstanceView, input: DecisionContext, target: TransitionTarget, watchDriven?: boolean): void;
|
|
16
16
|
export {};
|
|
@@ -62,19 +62,20 @@ export function finishRoute(events, definition, state, input, route) {
|
|
|
62
62
|
}
|
|
63
63
|
pushStageEntry(events, definition, state, input, route.target.stage);
|
|
64
64
|
}
|
|
65
|
-
function pushStageEntry(events, definition, state, input, stageName) {
|
|
65
|
+
function pushStageEntry(events, definition, state, input, stageName, watchDriven = false) {
|
|
66
66
|
const stage = definition.stages[stageName];
|
|
67
67
|
events.push(stateDraft(state, input, { eventType: OrchestrationEventType.StageEntered, payload: { stage: stageName } }, events.length + 1), stateDraft(state, input, {
|
|
68
68
|
eventType: OrchestrationEventType.ActivityRequested,
|
|
69
69
|
payload: activation(state.workflowInstanceId, nextOrdinal(state), stage.activity, stage.with, {
|
|
70
70
|
execution: stage.execution,
|
|
71
71
|
stage: stageName,
|
|
72
|
+
watchDriven,
|
|
72
73
|
}),
|
|
73
74
|
}, events.length + 2));
|
|
74
75
|
}
|
|
75
76
|
// Shared by a route with no gate (target reached directly) and a resumed wait
|
|
76
77
|
// (target reached after an accepted signal); neither carries repeat counting.
|
|
77
|
-
export function resumeToTarget(events, definition, state, input, target) {
|
|
78
|
+
export function resumeToTarget(events, definition, state, input, target, watchDriven = false) {
|
|
78
79
|
if (target.kind === TransitionTargetKind.Complete) {
|
|
79
80
|
events.push(stateDraft(state, input, { eventType: OrchestrationEventType.InstanceCompleted, payload: {} }, events.length + 1));
|
|
80
81
|
return;
|
|
@@ -88,5 +89,5 @@ export function resumeToTarget(events, definition, state, input, target) {
|
|
|
88
89
|
}
|
|
89
90
|
if (target.kind === TransitionTargetKind.ResourceTransitionWait)
|
|
90
91
|
throw new Error('resource-transition wait must be resumed by a resource transition');
|
|
91
|
-
pushStageEntry(events, definition, state, input, target.stage);
|
|
92
|
+
pushStageEntry(events, definition, state, input, target.stage, watchDriven);
|
|
92
93
|
}
|
|
@@ -2,3 +2,11 @@ import type { CompiledStage } from '../contracts/config.js';
|
|
|
2
2
|
import type { StageName } from '../contracts/identifiers.js';
|
|
3
3
|
export declare function assertReachable(entry: StageName, stages: Readonly<Record<StageName, CompiledStage>>): void;
|
|
4
4
|
export declare function assertCyclesBounded(stages: Readonly<Record<StageName, CompiledStage>>): void;
|
|
5
|
+
/** Cost of a stage that cannot reach a terminal stage; finite so it survives JSON. */
|
|
6
|
+
export declare const UnreachableRemainingSteps: number;
|
|
7
|
+
/**
|
|
8
|
+
* Minimum number of agent-running stages from each stage to a terminal stage,
|
|
9
|
+
* counting the stage itself. Costs are non-negative, so loop-backs never lie on
|
|
10
|
+
* a shortest path. Stages with no path to completion get UnreachableRemainingSteps.
|
|
11
|
+
*/
|
|
12
|
+
export declare function remainingAgentSteps(stages: Readonly<Record<StageName, CompiledStage>>, isAgentActivity: (activity: CompiledStage['activity']) => boolean): Readonly<Record<StageName, number>>;
|
|
@@ -31,6 +31,47 @@ export function assertCyclesBounded(stages) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
/** Cost of a stage that cannot reach a terminal stage; finite so it survives JSON. */
|
|
35
|
+
export const UnreachableRemainingSteps = Number.MAX_SAFE_INTEGER;
|
|
36
|
+
function routeTargets(stage) {
|
|
37
|
+
return Object.values(stage.on).flatMap((route) => [
|
|
38
|
+
route.target,
|
|
39
|
+
...(route.await === undefined ? [] : [route.await.resume]),
|
|
40
|
+
...(route.watchGates ?? []).map((gate) => gate.onRejectTarget),
|
|
41
|
+
...(route.resourceTransitions ?? []).map((transition) => transition.target),
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Minimum number of agent-running stages from each stage to a terminal stage,
|
|
46
|
+
* counting the stage itself. Costs are non-negative, so loop-backs never lie on
|
|
47
|
+
* a shortest path. Stages with no path to completion get UnreachableRemainingSteps.
|
|
48
|
+
*/
|
|
49
|
+
export function remainingAgentSteps(stages, isAgentActivity) {
|
|
50
|
+
const names = Object.keys(stages);
|
|
51
|
+
const cost = Object.fromEntries(names.map((name) => [name, UnreachableRemainingSteps]));
|
|
52
|
+
const targetCost = (target) => {
|
|
53
|
+
if (target.kind === TransitionTargetKind.Complete)
|
|
54
|
+
return 0;
|
|
55
|
+
if (target.kind === TransitionTargetKind.Stage)
|
|
56
|
+
return cost[target.stage];
|
|
57
|
+
return UnreachableRemainingSteps;
|
|
58
|
+
};
|
|
59
|
+
for (let changed = true; changed;) {
|
|
60
|
+
changed = false;
|
|
61
|
+
for (const name of names) {
|
|
62
|
+
const stage = stages[name];
|
|
63
|
+
const onward = Math.min(UnreachableRemainingSteps, ...routeTargets(stage).map(targetCost));
|
|
64
|
+
const next = onward >= UnreachableRemainingSteps
|
|
65
|
+
? UnreachableRemainingSteps
|
|
66
|
+
: onward + (isAgentActivity(stage.activity) ? 1 : 0);
|
|
67
|
+
if (next < cost[name]) {
|
|
68
|
+
cost[name] = next;
|
|
69
|
+
changed = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return cost;
|
|
74
|
+
}
|
|
34
75
|
function canReach(stages, from, target) {
|
|
35
76
|
const seen = new Set();
|
|
36
77
|
const visit = (name) => {
|
|
@@ -213,6 +213,7 @@ function applyActivityRequested(state, payload) {
|
|
|
213
213
|
status: ActivityActivationStatus.Pending,
|
|
214
214
|
...(payload.followOnIndex === undefined ? {} : { followOnIndex: payload.followOnIndex }),
|
|
215
215
|
...(payload.supplemental === true ? { supplemental: true } : {}),
|
|
216
|
+
...(payload.watchDriven === true ? { watchDriven: true } : {}),
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
export function immutableWorkflowInstanceView(state) {
|
|
@@ -2,6 +2,7 @@ export * from './application/orchestration-projection.js';
|
|
|
2
2
|
export * from './application/orchestration-repository.js';
|
|
3
3
|
export * from './application/orchestration-service.js';
|
|
4
4
|
export * from './application/advance-workflow.js';
|
|
5
|
+
export * from './application/pending-activations.js';
|
|
5
6
|
export * from './application/durable-append.js';
|
|
6
7
|
export * from './application/pull-request-transition-evidence.js';
|
|
7
8
|
export { isPolicyBlockedMergeWait } from './application/policy-blocked-merge-recovery.js';
|
|
@@ -25,6 +26,7 @@ export * from './contracts/streams.js';
|
|
|
25
26
|
export * from './contracts/views.js';
|
|
26
27
|
export * from './contracts/vocabulary.js';
|
|
27
28
|
export * from './domain/compiler.js';
|
|
29
|
+
export * from './domain/dispatch-priority.js';
|
|
28
30
|
export * from './domain/interpreter.js';
|
|
29
31
|
export * from './domain/workflow-instance.js';
|
|
30
32
|
export * from './domain/workflow-selector.js';
|
|
@@ -2,6 +2,7 @@ export * from './application/orchestration-projection.js';
|
|
|
2
2
|
export * from './application/orchestration-repository.js';
|
|
3
3
|
export * from './application/orchestration-service.js';
|
|
4
4
|
export * from './application/advance-workflow.js';
|
|
5
|
+
export * from './application/pending-activations.js';
|
|
5
6
|
export * from './application/durable-append.js';
|
|
6
7
|
export * from './application/pull-request-transition-evidence.js';
|
|
7
8
|
export { isPolicyBlockedMergeWait } from './application/policy-blocked-merge-recovery.js';
|
|
@@ -25,6 +26,7 @@ export * from './contracts/streams.js';
|
|
|
25
26
|
export * from './contracts/views.js';
|
|
26
27
|
export * from './contracts/vocabulary.js';
|
|
27
28
|
export * from './domain/compiler.js';
|
|
29
|
+
export * from './domain/dispatch-priority.js';
|
|
28
30
|
export * from './domain/interpreter.js';
|
|
29
31
|
export * from './domain/workflow-instance.js';
|
|
30
32
|
export * from './domain/workflow-selector.js';
|