@qaick/runtime 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 +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/runtime.d.ts +17 -0
- package/dist/runtime.js +20 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# QAick Runtime
|
|
2
|
+
|
|
3
|
+
`@qaick/runtime` is the host-neutral composition layer for QAick execution. It configures `@qaick/executor`, registers host-provided Action Executors, and routes execution handles, controls, events, results, retries, and Run From Here operations.
|
|
4
|
+
|
|
5
|
+
Host transports and framework APIs remain outside this package. The current local development dependency points to the sibling `QAICK_Executor` repository.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createRuntime } from '@qaick/runtime';
|
|
9
|
+
|
|
10
|
+
const runtime = createRuntime({ actionExecutors: [actionExecutor] });
|
|
11
|
+
const run = await runtime.execute(request);
|
|
12
|
+
const result = await run.result;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The package requires Node 20 or newer and `@qaick/executor` as a peer dependency.
|
|
16
|
+
|
|
17
|
+
For local development, run `npm run typecheck`, `npm test`, and `npm run build`. Use `npm pack --dry-run` to inspect the publication contents.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runtime.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runtime.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActionExecutor, ControlCommand, ExecutionControlState, Executor, ExecutorConfiguration, ExecutorEvent, ExecutorRequest, ExecutorResult, ExecutorRun } from '@qaick/executor';
|
|
2
|
+
export interface RuntimeConfiguration extends ExecutorConfiguration {
|
|
3
|
+
executor?: Executor;
|
|
4
|
+
}
|
|
5
|
+
export interface QaickRuntime {
|
|
6
|
+
execute(request: ExecutorRequest): Promise<ExecutorRun>;
|
|
7
|
+
cancel(requestId: string): Promise<void>;
|
|
8
|
+
control(requestId: string, command: ControlCommand): Promise<void>;
|
|
9
|
+
controlState(requestId: string): ExecutionControlState | undefined;
|
|
10
|
+
events(requestId: string): AsyncIterable<ExecutorEvent>;
|
|
11
|
+
result(requestId: string): Promise<ExecutorResult>;
|
|
12
|
+
retryAction(requestId: string, stepId: string, invocationPath?: string[]): Promise<void>;
|
|
13
|
+
retryOperation(requestId: string, stepId: string, invocationPath?: string[]): Promise<void>;
|
|
14
|
+
runFromHere(requestId: string, stepId: string, invocationPath?: string[]): Promise<ExecutorRun | undefined>;
|
|
15
|
+
registerActionExecutor(executor: ActionExecutor): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function createRuntime(configuration?: RuntimeConfiguration): QaickRuntime;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createMigratedExecutor } from '@qaick/executor';
|
|
2
|
+
export function createRuntime(configuration = {}) {
|
|
3
|
+
return new ComposedQaickRuntime(configuration.executor ?? createMigratedExecutor(configuration));
|
|
4
|
+
}
|
|
5
|
+
class ComposedQaickRuntime {
|
|
6
|
+
executor;
|
|
7
|
+
constructor(executor) {
|
|
8
|
+
this.executor = executor;
|
|
9
|
+
}
|
|
10
|
+
execute(request) { return this.executor.execute(request); }
|
|
11
|
+
cancel(requestId) { return this.executor.cancel(requestId); }
|
|
12
|
+
control(requestId, command) { return this.executor.control(requestId, command); }
|
|
13
|
+
controlState(requestId) { return this.executor.controlState(requestId); }
|
|
14
|
+
events(requestId) { return this.executor.events(requestId); }
|
|
15
|
+
result(requestId) { return this.executor.result(requestId); }
|
|
16
|
+
retryAction(requestId, stepId, invocationPath) { return this.executor.retryAction(requestId, stepId, invocationPath); }
|
|
17
|
+
retryOperation(requestId, stepId, invocationPath) { return this.executor.retryOperation(requestId, stepId, invocationPath); }
|
|
18
|
+
runFromHere(requestId, stepId, invocationPath) { return this.executor.runFromHere(requestId, stepId, invocationPath); }
|
|
19
|
+
registerActionExecutor(executor) { this.executor.registerActionExecutor(executor); }
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qaick/runtime",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Host-neutral composition layer for QAick execution.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": ["dist", "README.md"],
|
|
7
|
+
"engines": { "node": ">=20" },
|
|
8
|
+
"publishConfig": { "access": "public", "tag": "alpha" },
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/vladmus/QAICK_Runtime.git"
|
|
12
|
+
},
|
|
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
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@qaick/executor": ">=0.1.0-alpha.1 <0.2.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@qaick/executor": "file:../QAICK_Executor",
|
|
32
|
+
"typescript": "~6.0.2",
|
|
33
|
+
"vitest": "^5.0.0"
|
|
34
|
+
}
|
|
35
|
+
}
|