@qaick/executor 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declared-inputs.d.ts +2 -2
- package/dist/declared-inputs.js +3 -3
- package/dist/executor.d.ts +17 -4
- package/dist/executor.js +513 -262
- package/dist/migrated-artifact-hash.d.ts +1 -1
- package/dist/migrated-executor.d.ts +4 -4
- package/dist/migrated-executor.js +16 -11
- package/dist/types.d.ts +82 -6
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ExecutableInput } from '@qaick/contract';
|
|
2
|
-
/** Shared invocation semantics.
|
|
2
|
+
/** Shared invocation semantics. Top-level null arguments are omitted; nested JSON remains intact. */
|
|
3
3
|
export declare function resolveDeclaredInputs(declarations?: readonly ExecutableInput[], arguments_?: Record<string, unknown>): {
|
|
4
4
|
inputs: {
|
|
5
|
-
[
|
|
5
|
+
[k: string]: unknown;
|
|
6
6
|
};
|
|
7
7
|
issues: {
|
|
8
8
|
code: string;
|
package/dist/declared-inputs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** Shared invocation semantics.
|
|
1
|
+
/** Shared invocation semantics. Top-level null arguments are omitted; nested JSON remains intact. */
|
|
2
2
|
export function resolveDeclaredInputs(declarations = [], arguments_ = {}) {
|
|
3
|
-
const inputs =
|
|
3
|
+
const inputs = Object.fromEntries(Object.entries(arguments_).filter(([, value]) => value !== null));
|
|
4
4
|
const issues = [];
|
|
5
5
|
if (!Array.isArray(declarations))
|
|
6
6
|
return { inputs, issues: [{ code: 'INVALID_INPUT', message: 'Declared inputs must be an array.' }] };
|
|
@@ -11,7 +11,7 @@ export function resolveDeclaredInputs(declarations = [], arguments_ = {}) {
|
|
|
11
11
|
continue;
|
|
12
12
|
}
|
|
13
13
|
seen.add(declaration.name);
|
|
14
|
-
const supplied = Object.hasOwn(arguments_, declaration.name);
|
|
14
|
+
const supplied = Object.hasOwn(arguments_, declaration.name) && arguments_[declaration.name] !== null;
|
|
15
15
|
const value = supplied ? arguments_[declaration.name] : declaration.defaultValue;
|
|
16
16
|
if (value === undefined) {
|
|
17
17
|
delete inputs[declaration.name];
|
package/dist/executor.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionExecutor, ControlCommand, ExecutionControlState, Executor, ExecutorConfiguration, ExecutorEvent, ExecutorRequest, ExecutorResult, ExecutorRun } from './types.js';
|
|
1
|
+
import type { ActReplayTarget, ActReplayHandle, OperationReplayHandle, ActionExecutor, ControlCommand, ExecutionControlState, Executor, ExecutorConfiguration, ExecutorEvent, ExecutorRequest, ExecutorResult, ExecutorRun } from './types.js';
|
|
2
2
|
export declare function createExecutor(configuration?: ExecutorConfiguration): Executor;
|
|
3
3
|
export declare class DefaultExecutor implements Executor {
|
|
4
4
|
private readonly runs;
|
|
@@ -7,23 +7,36 @@ export declare class DefaultExecutor implements Executor {
|
|
|
7
7
|
constructor(configuration?: ExecutorConfiguration);
|
|
8
8
|
registerActionExecutor(executor: ActionExecutor): void;
|
|
9
9
|
execute(request: ExecutorRequest): Promise<ExecutorRun>;
|
|
10
|
+
private startRun;
|
|
10
11
|
cancel(requestId: string): Promise<void>;
|
|
11
12
|
control(requestId: string, command: ControlCommand): Promise<void>;
|
|
12
13
|
controlState(requestId: string): ExecutionControlState | undefined;
|
|
13
14
|
events(requestId: string): AsyncIterable<ExecutorEvent>;
|
|
14
15
|
result(requestId: string): Promise<ExecutorResult>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
private replayTarget;
|
|
17
|
+
retryAction(requestId: string, target: ActReplayTarget): Promise<ActReplayHandle>;
|
|
18
|
+
private replayEvents;
|
|
19
|
+
private emitReplay;
|
|
20
|
+
private replayAct;
|
|
21
|
+
retryOperation(requestId: string, target: ActReplayTarget): Promise<OperationReplayHandle>;
|
|
22
|
+
private replayOperation;
|
|
23
|
+
runFromHere(sourceRequestId: string, target: ActReplayTarget): Promise<ExecutorRun>;
|
|
18
24
|
private run;
|
|
19
25
|
private executeProject;
|
|
20
26
|
private executeFlow;
|
|
21
27
|
private executeStep;
|
|
22
28
|
private executeControl;
|
|
29
|
+
private resolveBindings;
|
|
30
|
+
private resolveOperand;
|
|
31
|
+
private evaluateCondition;
|
|
32
|
+
private capture;
|
|
33
|
+
private captureExternalEvidence;
|
|
34
|
+
private assertActive;
|
|
23
35
|
private executeAction;
|
|
24
36
|
private boundary;
|
|
25
37
|
private pauseAtBoundary;
|
|
26
38
|
private emit;
|
|
39
|
+
private emitReplayOccurrence;
|
|
27
40
|
private finish;
|
|
28
41
|
private baseResult;
|
|
29
42
|
private failure;
|