@qaick/executor 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/executor.d.ts +30 -0
- package/dist/executor.js +556 -0
- package/dist/in-memory-action-executor.d.ts +5 -0
- package/dist/in-memory-action-executor.js +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/migrated-adapter.d.ts +5 -0
- package/dist/migrated-adapter.js +4 -0
- package/dist/migrated-artifact-hash.d.ts +3 -0
- package/dist/migrated-artifact-hash.js +19 -0
- package/dist/migrated-executor.d.ts +22 -0
- package/dist/migrated-executor.js +61 -0
- package/dist/migrated-project-engine.d.ts +21 -0
- package/dist/migrated-project-engine.js +118 -0
- package/dist/migrated-runner-engine.d.ts +33 -0
- package/dist/migrated-runner-engine.js +705 -0
- package/dist/migrated-types.d.ts +77 -0
- package/dist/migrated-types.js +4 -0
- package/dist/types.d.ts +159 -0
- package/dist/types.js +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Compatibility import for Runner modules. The canonical contract is the published @qaick/contract package. */
|
|
2
|
+
export * from '@qaick/contract';
|
|
3
|
+
/** The exact published contract package consumed by this Runner release. */
|
|
4
|
+
export declare const RUNNER_CONTRACT_VERSION: "0.2.10";
|
|
5
|
+
export type ExecutionControlState = 'idle' | 'running' | 'pause-requested' | 'paused' | 'resuming' | 'stopped' | 'failed' | 'completed';
|
|
6
|
+
export interface RunnerDebugSession {
|
|
7
|
+
breakpoints: string[];
|
|
8
|
+
stopAfterStepId?: string;
|
|
9
|
+
selectedStepId?: string;
|
|
10
|
+
}
|
|
11
|
+
export type ExecutionControlEventType = 'pause-requested' | 'breakpoint-reached' | 'paused' | 'resumed' | 'step-requested' | 'step-completed' | 'stop-after-reached' | 'interactive-retry-requested' | 'retry-attempt-started' | 'retry-attempt-completed';
|
|
12
|
+
declare module '@qaick/contract' {
|
|
13
|
+
interface ExecutionPackage {
|
|
14
|
+
artifactSchemaVersion?: number;
|
|
15
|
+
}
|
|
16
|
+
interface StepTransportTiming {
|
|
17
|
+
requestStartedAt: string;
|
|
18
|
+
responseReceivedAt: string;
|
|
19
|
+
durationMs: number;
|
|
20
|
+
}
|
|
21
|
+
interface StepResult {
|
|
22
|
+
transportTiming?: StepTransportTiming;
|
|
23
|
+
}
|
|
24
|
+
interface StepResult {
|
|
25
|
+
attempts?: Array<{
|
|
26
|
+
attempt: number;
|
|
27
|
+
kind: 'automatic' | 'interactive';
|
|
28
|
+
state: 'finished' | 'failed';
|
|
29
|
+
startedAt: string;
|
|
30
|
+
finishedAt: string;
|
|
31
|
+
inputs: Record<string, unknown>;
|
|
32
|
+
outputs: Record<string, unknown>;
|
|
33
|
+
durationMs: number;
|
|
34
|
+
children?: StepResult[];
|
|
35
|
+
error?: {
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
interface ExecutionResult {
|
|
42
|
+
artifactHash?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ExecutionResult {
|
|
45
|
+
warnings?: Array<{
|
|
46
|
+
code: string;
|
|
47
|
+
message: string;
|
|
48
|
+
stepId?: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
interface ExecutionResult {
|
|
52
|
+
provenance?: {
|
|
53
|
+
kind: 'run-from-here';
|
|
54
|
+
sourceRequestId: string;
|
|
55
|
+
sourceArtifactHash?: string;
|
|
56
|
+
selectedStepId: string;
|
|
57
|
+
selectedInvocationPath?: string[];
|
|
58
|
+
omittedStepIds: string[];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
interface ExecutionResult {
|
|
62
|
+
executionTiming?: {
|
|
63
|
+
wallDurationMs: number;
|
|
64
|
+
activeDurationMs: number;
|
|
65
|
+
pausedDurationMs: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
interface RunnerRequest {
|
|
69
|
+
debugSession?: RunnerDebugSession;
|
|
70
|
+
}
|
|
71
|
+
interface ExecutionEvent {
|
|
72
|
+
control?: {
|
|
73
|
+
type: ExecutionControlEventType;
|
|
74
|
+
stepId?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Compatibility import for Runner modules. The canonical contract is the published @qaick/contract package. */
|
|
2
|
+
export * from '@qaick/contract';
|
|
3
|
+
/** The exact published contract package consumed by this Runner release. */
|
|
4
|
+
export const RUNNER_CONTRACT_VERSION = '0.2.10';
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { ExecutionPackage, ExecutionStep, ExecutionState, InvocationState, TerminalReason } from '@qaick/contract';
|
|
2
|
+
export type { ExecutionPackage, ExecutionStep, ExecutionState, InvocationState, TerminalReason } from '@qaick/contract';
|
|
3
|
+
export type ActionFailureCode = 'ACTION_FAILED' | 'ACTION_TIMEOUT' | 'ACTION_CANCELLED' | 'UNSUPPORTED_ACTION' | 'BINDING_RESOLUTION_ERROR' | 'CONTROL_BLOCK_ERROR' | 'PREFLIGHT_ERROR' | 'INTERNAL_EXECUTION_ERROR';
|
|
4
|
+
export interface ActionFailure {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
category?: ActionFailureCode | string;
|
|
8
|
+
details?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface ActionExecutionContext {
|
|
11
|
+
action: string;
|
|
12
|
+
inputs: Record<string, unknown>;
|
|
13
|
+
environment: string;
|
|
14
|
+
runtimeValues: Record<string, unknown>;
|
|
15
|
+
step: ExecutionStep;
|
|
16
|
+
signal: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface ActionExecutionResult {
|
|
19
|
+
outputs: Record<string, unknown>;
|
|
20
|
+
evidence?: Record<string, unknown>;
|
|
21
|
+
timing?: {
|
|
22
|
+
startedAt: string;
|
|
23
|
+
finishedAt: string;
|
|
24
|
+
durationMs: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ActionExecutor {
|
|
28
|
+
supports(action: string): boolean;
|
|
29
|
+
execute(context: ActionExecutionContext): Promise<ActionExecutionResult | Record<string, unknown>>;
|
|
30
|
+
}
|
|
31
|
+
export interface ExecutorRequest {
|
|
32
|
+
requestId: string;
|
|
33
|
+
executionPackage: ExecutionPackage;
|
|
34
|
+
inputs: Record<string, unknown>;
|
|
35
|
+
environment: string;
|
|
36
|
+
runtimeValues?: Record<string, unknown>;
|
|
37
|
+
options?: {
|
|
38
|
+
timeoutMs?: number;
|
|
39
|
+
dryRun?: boolean;
|
|
40
|
+
};
|
|
41
|
+
debugSession?: {
|
|
42
|
+
breakpoints: string[];
|
|
43
|
+
stopAfterStepId?: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface ExecutionAttempt {
|
|
47
|
+
attempt: number;
|
|
48
|
+
kind?: 'automatic' | 'interactive';
|
|
49
|
+
state: 'finished' | 'failed' | 'cancelled';
|
|
50
|
+
startedAt: string;
|
|
51
|
+
finishedAt: string;
|
|
52
|
+
inputs: Record<string, unknown>;
|
|
53
|
+
outputs: Record<string, unknown>;
|
|
54
|
+
durationMs: number;
|
|
55
|
+
error?: ActionFailure;
|
|
56
|
+
evidence?: Record<string, unknown>;
|
|
57
|
+
children?: ExecutorStepResult[];
|
|
58
|
+
}
|
|
59
|
+
export interface ExecutorStepResult {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
state: InvocationState;
|
|
63
|
+
inputs: Record<string, unknown>;
|
|
64
|
+
outputs: Record<string, unknown>;
|
|
65
|
+
durationMs: number;
|
|
66
|
+
invocationId?: string;
|
|
67
|
+
invocationPath?: string[];
|
|
68
|
+
kind?: 'action' | 'operation' | 'control-block';
|
|
69
|
+
terminalReason?: TerminalReason;
|
|
70
|
+
children?: ExecutorStepResult[];
|
|
71
|
+
attempts?: ExecutionAttempt[];
|
|
72
|
+
evidence?: Record<string, unknown>;
|
|
73
|
+
iteration?: {
|
|
74
|
+
loopId: string;
|
|
75
|
+
current: number;
|
|
76
|
+
total: number;
|
|
77
|
+
};
|
|
78
|
+
error?: ActionFailure;
|
|
79
|
+
}
|
|
80
|
+
export interface ExecutorResult {
|
|
81
|
+
requestId: string;
|
|
82
|
+
state: Exclude<ExecutionState, 'created' | 'preflighting' | 'running'>;
|
|
83
|
+
target: ExecutionPackage['target'];
|
|
84
|
+
environment: string;
|
|
85
|
+
startedAt: string;
|
|
86
|
+
finishedAt: string;
|
|
87
|
+
steps: ExecutorStepResult[];
|
|
88
|
+
children?: ExecutorResult[];
|
|
89
|
+
terminalReason?: TerminalReason;
|
|
90
|
+
error?: ActionFailure;
|
|
91
|
+
issues?: Array<{
|
|
92
|
+
code: string;
|
|
93
|
+
message: string;
|
|
94
|
+
stepId?: string;
|
|
95
|
+
}>;
|
|
96
|
+
executionTiming?: {
|
|
97
|
+
wallDurationMs: number;
|
|
98
|
+
activeDurationMs: number;
|
|
99
|
+
pausedDurationMs: number;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface ExecutorEvent {
|
|
103
|
+
requestId: string;
|
|
104
|
+
sequence: number;
|
|
105
|
+
type: 'run_started' | 'preflight_started' | 'step_started' | 'waiting' | 'step_finished' | 'run_finished';
|
|
106
|
+
state: ExecutionState | InvocationState;
|
|
107
|
+
stepId?: string;
|
|
108
|
+
stepName?: string;
|
|
109
|
+
message: string;
|
|
110
|
+
timestamp: string;
|
|
111
|
+
iteration?: {
|
|
112
|
+
loopId: string;
|
|
113
|
+
current: number;
|
|
114
|
+
total: number;
|
|
115
|
+
};
|
|
116
|
+
parallel?: {
|
|
117
|
+
groupId: string;
|
|
118
|
+
completed: number;
|
|
119
|
+
total: number;
|
|
120
|
+
join: 'all' | 'first';
|
|
121
|
+
};
|
|
122
|
+
control?: {
|
|
123
|
+
type: ControlCommand['type'];
|
|
124
|
+
stepId?: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export type ControlCommand = {
|
|
128
|
+
type: 'pause';
|
|
129
|
+
} | {
|
|
130
|
+
type: 'resume';
|
|
131
|
+
} | {
|
|
132
|
+
type: 'step';
|
|
133
|
+
} | {
|
|
134
|
+
type: 'stop';
|
|
135
|
+
} | {
|
|
136
|
+
type: 'stop-after';
|
|
137
|
+
stepId: string;
|
|
138
|
+
};
|
|
139
|
+
export type ExecutionControlState = 'idle' | 'running' | 'pause-requested' | 'paused' | 'resuming' | 'stopped' | 'failed' | 'completed';
|
|
140
|
+
export interface ExecutorRun {
|
|
141
|
+
requestId: string;
|
|
142
|
+
result: Promise<ExecutorResult>;
|
|
143
|
+
}
|
|
144
|
+
export interface ExecutorConfiguration {
|
|
145
|
+
actionExecutors?: ActionExecutor[];
|
|
146
|
+
maxTimeoutMs?: number;
|
|
147
|
+
}
|
|
148
|
+
export interface Executor {
|
|
149
|
+
execute(request: ExecutorRequest): Promise<ExecutorRun>;
|
|
150
|
+
cancel(requestId: string): Promise<void>;
|
|
151
|
+
control(requestId: string, command: ControlCommand): Promise<void>;
|
|
152
|
+
controlState(requestId: string): ExecutionControlState | undefined;
|
|
153
|
+
events(requestId: string): AsyncIterable<ExecutorEvent>;
|
|
154
|
+
result(requestId: string): Promise<ExecutorResult>;
|
|
155
|
+
retryAction(requestId: string, stepId: string, invocationPath?: string[]): Promise<void>;
|
|
156
|
+
retryOperation(requestId: string, stepId: string, invocationPath?: string[]): Promise<void>;
|
|
157
|
+
runFromHere(requestId: string, stepId: string, invocationPath?: string[]): Promise<ExecutorRun | undefined>;
|
|
158
|
+
registerActionExecutor(executor: ActionExecutor): void;
|
|
159
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qaick/executor",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Host-neutral QAick action execution primitives.",
|
|
5
|
+
"files": ["dist", "README.md"],
|
|
6
|
+
"engines": { "node": ">=20" },
|
|
7
|
+
"publishConfig": { "access": "public", "tag": "alpha" },
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/vladmus/QAICK_Executor.git"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clean": "node scripts/clean-dist.mjs",
|
|
23
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@qaick/contract": "0.2.10"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^24.13.3",
|
|
33
|
+
"typescript": "~6.0.2",
|
|
34
|
+
"vitest": "^5.0.1"
|
|
35
|
+
}
|
|
36
|
+
}
|