@qaick/runner 0.29.0 → 0.30.0
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/package-dist/package.json +5 -5
- package/package-dist/src/runner/RunnerModule.d.ts +11 -2
- package/package-dist/src/runner/RunnerModule.d.ts.map +1 -1
- package/package-dist/src/runner/RunnerModule.js +43 -31
- package/package-dist/src/runner/RunnerModule.js.map +1 -1
- package/package-dist/src/runner/action-template-lowering.d.ts +18 -0
- package/package-dist/src/runner/action-template-lowering.d.ts.map +1 -0
- package/package-dist/src/runner/action-template-lowering.js +79 -0
- package/package-dist/src/runner/action-template-lowering.js.map +1 -0
- package/package-dist/src/runner/adapters.d.ts +45 -0
- package/package-dist/src/runner/adapters.d.ts.map +1 -0
- package/package-dist/src/runner/adapters.js +203 -0
- package/package-dist/src/runner/adapters.js.map +1 -0
- package/package-dist/src/runner/execution-context.d.ts +3 -0
- package/package-dist/src/runner/execution-context.d.ts.map +1 -0
- package/package-dist/src/runner/execution-context.js +4 -0
- package/package-dist/src/runner/execution-context.js.map +1 -0
- package/package-dist/src/runner/fixture.d.ts.map +1 -1
- package/package-dist/src/runner/fixture.js +14 -27
- package/package-dist/src/runner/fixture.js.map +1 -1
- package/package-dist/src/runner/legacy-types.d.ts +81 -0
- package/package-dist/src/runner/legacy-types.d.ts.map +1 -0
- package/package-dist/src/runner/legacy-types.js +7 -0
- package/package-dist/src/runner/legacy-types.js.map +1 -0
- package/package-dist/src/runner/package-loader.d.ts +3 -2
- package/package-dist/src/runner/package-loader.d.ts.map +1 -1
- package/package-dist/src/runner/package-loader.js +3 -112
- package/package-dist/src/runner/package-loader.js.map +1 -1
- package/package-dist/src/runner/runtime-client-adapter.d.ts +25 -0
- package/package-dist/src/runner/runtime-client-adapter.d.ts.map +1 -1
- package/package-dist/src/runner/runtime-client-adapter.js +43 -2
- package/package-dist/src/runner/runtime-client-adapter.js.map +1 -1
- package/package-dist/src/runner/studio-artifact-loader.d.ts +3 -5
- package/package-dist/src/runner/studio-artifact-loader.d.ts.map +1 -1
- package/package-dist/src/runner/studio-artifact-loader.js +4 -335
- package/package-dist/src/runner/studio-artifact-loader.js.map +1 -1
- package/package-dist/src/runner/studio-hierarchy-loader.d.ts +10 -0
- package/package-dist/src/runner/studio-hierarchy-loader.d.ts.map +1 -0
- package/package-dist/src/runner/studio-hierarchy-loader.js +271 -0
- package/package-dist/src/runner/studio-hierarchy-loader.js.map +1 -0
- package/package-dist/src/runner/types.d.ts +12 -0
- package/package-dist/src/runner/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,114 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { validateArtifact } from '@qaick/contract';
|
|
3
|
-
import { loadStudioFlowArtifact, loadStudioProjectFile } from './studio-artifact-loader.js';
|
|
4
|
-
import { PackageLoadError } from './package-load-error.js';
|
|
1
|
+
import { loadHierarchyExecutionPackage } from './studio-hierarchy-loader.js';
|
|
5
2
|
export { PackageLoadError } from './package-load-error.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
candidate = JSON.parse(serialized);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
throw new PackageLoadError('The selected file is not valid JSON.');
|
|
13
|
-
}
|
|
14
|
-
if (isRecord(candidate) && candidate.artifactKind === 'flow' && (candidate.schemaVersion === 7 || candidate.schemaVersion === STUDIO_ARTIFACT_SCHEMA_VERSION)) {
|
|
15
|
-
assertStudioContract(candidate);
|
|
16
|
-
return loadStudioFlowArtifact(candidate);
|
|
17
|
-
}
|
|
18
|
-
if (isRecord(candidate) && (candidate.schemaVersion === 7 || candidate.schemaVersion === STUDIO_ARTIFACT_SCHEMA_VERSION) && isRecord(candidate.project)) {
|
|
19
|
-
assertStudioContract(candidate);
|
|
20
|
-
return loadStudioProjectFile(candidate);
|
|
21
|
-
}
|
|
22
|
-
if (isRecord(candidate) && candidate.artifactKind === 'project' && (candidate.schemaVersion === 7 || candidate.schemaVersion === STUDIO_ARTIFACT_SCHEMA_VERSION)) {
|
|
23
|
-
throw new PackageLoadError('This Studio Project is a published reference artifact. Load the complete Studio project file or provide the referenced catalog definitions.');
|
|
24
|
-
}
|
|
25
|
-
if (isRecord(candidate) && typeof candidate.schemaVersion === 'number' && candidate.schemaVersion < 7 && isRecord(candidate.project)) {
|
|
26
|
-
throw new PackageLoadError(`This Studio project uses schema version ${candidate.schemaVersion}. Open it in QAick Studio, save the project, and then load the newly saved file in Runner.`);
|
|
27
|
-
}
|
|
28
|
-
if (!isRecord(candidate) || candidate.schemaVersion !== RUNNER_PACKAGE_SCHEMA_VERSION) {
|
|
29
|
-
throw new PackageLoadError(`The package must use QAick schema version ${RUNNER_PACKAGE_SCHEMA_VERSION}.`);
|
|
30
|
-
}
|
|
31
|
-
if (typeof candidate.packageId !== 'string' || candidate.packageId.trim() === '') {
|
|
32
|
-
throw new PackageLoadError('The package id is missing.');
|
|
33
|
-
}
|
|
34
|
-
if (!isRecord(candidate.target) || !isTargetKind(candidate.target.kind) || typeof candidate.target.id !== 'string' || typeof candidate.target.name !== 'string') {
|
|
35
|
-
throw new PackageLoadError('The package target is incomplete.');
|
|
36
|
-
}
|
|
37
|
-
const hasValidFlowSteps = Array.isArray(candidate.steps) && candidate.steps.length > 0 && candidate.steps.every(isStep);
|
|
38
|
-
const hasValidProjectFlows = candidate.target.kind === 'project' && Array.isArray(candidate.flows) && candidate.flows.length > 0 && candidate.flows.every(isFlow);
|
|
39
|
-
if (!hasValidFlowSteps && !hasValidProjectFlows) {
|
|
40
|
-
throw new PackageLoadError('The package must contain at least one valid executable step.');
|
|
41
|
-
}
|
|
42
|
-
if (hasValidFlowSteps)
|
|
43
|
-
validateStepGraph(candidate.steps);
|
|
44
|
-
if (hasValidProjectFlows) {
|
|
45
|
-
for (const flow of candidate.flows)
|
|
46
|
-
validateStepGraph(flow.steps);
|
|
47
|
-
}
|
|
48
|
-
if (!Array.isArray(candidate.definitions)) {
|
|
49
|
-
throw new PackageLoadError('The package definitions are missing.');
|
|
50
|
-
}
|
|
51
|
-
if (!candidate.definitions.every(isDefinition)) {
|
|
52
|
-
throw new PackageLoadError('The package contains an invalid definition.');
|
|
53
|
-
}
|
|
54
|
-
const target = candidate.target;
|
|
55
|
-
const targetDefinition = candidate.definitions.find(definition => isRecord(definition) && definition.id === target.id && definition.kind === target.kind);
|
|
56
|
-
if (!targetDefinition) {
|
|
57
|
-
throw new PackageLoadError('The package target definition is missing.');
|
|
58
|
-
}
|
|
59
|
-
if (candidate.runtimeRequirements !== undefined && (!Array.isArray(candidate.runtimeRequirements) || !candidate.runtimeRequirements.every(value => typeof value === 'string' && value.trim() !== '') || new Set(candidate.runtimeRequirements).size !== candidate.runtimeRequirements.length)) {
|
|
60
|
-
throw new PackageLoadError('The package runtime requirements are invalid.');
|
|
61
|
-
}
|
|
62
|
-
if (candidate.catalogReferences !== undefined && (!Array.isArray(candidate.catalogReferences) || !candidate.catalogReferences.every(isCatalogReference) || new Set(candidate.catalogReferences.map(reference => reference.catalogId)).size !== candidate.catalogReferences.length)) {
|
|
63
|
-
throw new PackageLoadError('The package catalog references are invalid.');
|
|
64
|
-
}
|
|
65
|
-
return candidate;
|
|
66
|
-
}
|
|
67
|
-
function assertStudioContract(candidate) {
|
|
68
|
-
const issues = validateArtifact(candidate);
|
|
69
|
-
if (issues.length > 0) {
|
|
70
|
-
throw new PackageLoadError(`The Studio artifact failed contract validation with ${issues.length} issue${issues.length === 1 ? '' : 's'}.`, issues.map((issue) => ({ path: issue.path, code: issue.code, message: issue.message })));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function isRecord(value) { return typeof value === 'object' && value !== null; }
|
|
74
|
-
function isTargetKind(value) { return value === 'flow' || value === 'project'; }
|
|
75
|
-
function isStep(value) {
|
|
76
|
-
return isRecord(value) && typeof value.id === 'string' && typeof value.name === 'string' && typeof value.action === 'string' && isRecord(value.output)
|
|
77
|
-
&& (value.dependsOn === undefined || Array.isArray(value.dependsOn) && value.dependsOn.every(dependency => typeof dependency === 'string'))
|
|
78
|
-
&& (value.children === undefined || Array.isArray(value.children) && value.children.length > 0 && value.children.every(isStep))
|
|
79
|
-
&& (value.retry === undefined || isRecord(value.retry) && typeof value.retry.maxAttempts === 'number' && value.retry.maxAttempts >= 1)
|
|
80
|
-
&& (value.control === undefined || isRecord(value.control) && (value.control.type === 'sequence' || value.control.type === 'repeat' || value.control.type === 'condition' || value.control.type === 'branch' || value.control.type === 'parallel')
|
|
81
|
-
&& (value.control.iterations === undefined || typeof value.control.iterations === 'number' && Number.isInteger(value.control.iterations) && value.control.iterations >= 1)
|
|
82
|
-
&& (value.control.condition === undefined || typeof value.control.condition === 'boolean' || isCondition(value.control.condition))
|
|
83
|
-
&& (value.control.branches === undefined || Array.isArray(value.control.branches) && value.control.branches.length > 0 && value.control.branches.every(branch => isRecord(branch) && typeof branch.id === 'string' && isCondition(branch.condition) && Array.isArray(branch.children) && branch.children.length > 0 && branch.children.every(isStep)))
|
|
84
|
-
&& (value.control.join === undefined || value.control.join === 'all' || value.control.join === 'first')
|
|
85
|
-
&& (value.control.merge === undefined || value.control.merge === 'collect' || value.control.merge === 'first' || value.control.merge === 'last')
|
|
86
|
-
&& (value.control.mergeBindings === undefined || isRecord(value.control.mergeBindings) && Object.entries(value.control.mergeBindings).every(([name, source]) => name.trim() !== '' && typeof source === 'string' && /^[^.]+\.[^.]+$/.test(source)))
|
|
87
|
-
&& (value.control.durationMs === undefined || typeof value.control.durationMs === 'number' && value.control.durationMs >= 0)
|
|
88
|
-
&& (value.control.iterationDelayMs === undefined || typeof value.control.iterationDelayMs === 'number' && value.control.iterationDelayMs >= 0));
|
|
89
|
-
}
|
|
90
|
-
function isFlow(value) { return isRecord(value) && typeof value.id === 'string' && typeof value.name === 'string' && Array.isArray(value.steps) && value.steps.length > 0 && value.steps.every(isStep); }
|
|
91
|
-
function isDefinition(value) { return isRecord(value) && typeof value.id === 'string' && typeof value.name === 'string' && (value.kind === 'action' || value.kind === 'flow' || value.kind === 'project'); }
|
|
92
|
-
function isCatalogReference(value) { return isRecord(value) && typeof value.catalogId === 'string' && (value.source === 'embedded' || value.source === 'remote') && (value.uri === undefined || typeof value.uri === 'string') && (value.integrity === undefined || typeof value.integrity === 'string'); }
|
|
93
|
-
function validateStepGraph(steps) {
|
|
94
|
-
const ids = new Set();
|
|
95
|
-
const dependencies = [];
|
|
96
|
-
const collect = (nested) => {
|
|
97
|
-
for (const step of nested) {
|
|
98
|
-
if (ids.has(step.id))
|
|
99
|
-
throw new PackageLoadError(`The package contains duplicate step id ${step.id}.`);
|
|
100
|
-
ids.add(step.id);
|
|
101
|
-
dependencies.push({ id: step.id, dependsOn: step.dependsOn ?? [] });
|
|
102
|
-
if (step.control?.branches)
|
|
103
|
-
step.control.branches.forEach(branch => collect(branch.children));
|
|
104
|
-
else if (step.children)
|
|
105
|
-
collect(step.children);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
collect(steps);
|
|
109
|
-
const missing = dependencies.flatMap(item => item.dependsOn.map(dependency => ({ step: item.id, dependency }))).find(item => !ids.has(item.dependency));
|
|
110
|
-
if (missing)
|
|
111
|
-
throw new PackageLoadError(`Step ${missing.step} depends on missing step ${missing.dependency}.`);
|
|
112
|
-
}
|
|
113
|
-
function isCondition(value) { return (typeof value === 'boolean') || (isRecord(value) && typeof value.binding === 'string' && (value.equals === undefined || ['string', 'number', 'boolean'].includes(typeof value.equals)) && (value.notEquals === undefined || ['string', 'number', 'boolean'].includes(typeof value.notEquals)) && (value.exists === undefined || typeof value.exists === 'boolean')); }
|
|
3
|
+
/** Normal package load preserves authored structural context through canonical lowering. */
|
|
4
|
+
export const loadExecutionPackage = loadHierarchyExecutionPackage;
|
|
114
5
|
//# sourceMappingURL=package-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-loader.js","sourceRoot":"","sources":["../../../src/runner/package-loader.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"package-loader.js","sourceRoot":"","sources":["../../../src/runner/package-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,oBAAoB,GAAC,6BAA6B,CAAC"}
|
|
@@ -18,4 +18,29 @@ export interface RunnerHostRuntimeBridge {
|
|
|
18
18
|
controlState(requestId: string): ExecutionControlState | undefined | Promise<ExecutionControlState | undefined>;
|
|
19
19
|
}
|
|
20
20
|
export declare function createRunnerRuntimeClient(bridge: RunnerHostRuntimeBridge): RunnerRuntimeClient;
|
|
21
|
+
/** Browser normal-run composition; no proxy, replay registry or hidden session propagation. */
|
|
22
|
+
export declare function createBrowserRuntimeBridge(): {
|
|
23
|
+
execute(request: RunnerRequest): Promise<{
|
|
24
|
+
requestId: string;
|
|
25
|
+
}>;
|
|
26
|
+
cancel: (id: string) => Promise<void>;
|
|
27
|
+
control: (id: string, command: import("@qaick/runtime").ControlCommand) => Promise<void>;
|
|
28
|
+
controlState: (id: string) => Promise<import("@qaick/executor").ExecutionControlState | undefined>;
|
|
29
|
+
getResult: (id: string) => Promise<import("@qaick/executor").ExecutorResult>;
|
|
30
|
+
subscribe(id: string, listener: (event: ExecutionEvent) => void): () => void;
|
|
31
|
+
getRuntimeInfo: () => Promise<import("@qaick/runtime").RuntimeInfo>;
|
|
32
|
+
retryAction: () => Promise<never>;
|
|
33
|
+
retryOperation: () => Promise<never>;
|
|
34
|
+
runFromHere: () => Promise<never>;
|
|
35
|
+
testHttpRequest(request: {
|
|
36
|
+
url: string;
|
|
37
|
+
method: string;
|
|
38
|
+
headers: Record<string, string>;
|
|
39
|
+
body?: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
headers: Record<string, string | string[]>;
|
|
42
|
+
status: number;
|
|
43
|
+
body: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
21
46
|
//# sourceMappingURL=runtime-client-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-client-adapter.d.ts","sourceRoot":"","sources":["../../../src/runner/runtime-client-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-client-adapter.d.ts","sourceRoot":"","sources":["../../../src/runner/runtime-client-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5I,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5F,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC5G,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACpF,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACvD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;CACjH;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,uBAAuB,GAAG,mBAAmB,CAkB9F;AAwBD,+FAA+F;AAC/F,wBAAgB,0BAA0B;qBAUlB,aAAa;;;iBACxB,MAAM;kBAAkC,MAAM,WAAS,OAAO,gBAAgB,EAAE,cAAc;uBACnF,MAAM;oBAA0C,MAAM;kBAC/D,MAAM,YAAU,CAAC,KAAK,EAAC,cAAc,KAAG,IAAI;;;;;6BAE3B;QAAC,GAAG,EAAC,MAAM,CAAC;QAAA,MAAM,EAAC,MAAM,CAAC;QAAA,OAAO,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC;QAAA,IAAI,CAAC,EAAC,MAAM,CAAA;KAAC;;;;;EAEpG"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { createRuntime, InMemoryActionExecutor } from '@qaick/runtime';
|
|
2
|
+
import { HttpActionExecutor } from '@qaick/http-executor';
|
|
3
|
+
import { FetchHttpTransport } from './adapters.js';
|
|
4
|
+
import { assertSupportedExecutionContext } from './execution-context.js';
|
|
1
5
|
export function createRunnerRuntimeClient(bridge) {
|
|
2
6
|
return {
|
|
3
|
-
submit:
|
|
7
|
+
submit: async (request) => {
|
|
8
|
+
assertSupportedExecutionContext(request.executionPackage.schemaVersion);
|
|
9
|
+
return bridge.execute(request);
|
|
10
|
+
},
|
|
4
11
|
cancel: bridge.cancel,
|
|
5
12
|
events: requestId => eventStream(bridge, requestId),
|
|
6
13
|
result: bridge.getResult,
|
|
@@ -20,7 +27,7 @@ async function* eventStream(bridge, requestId) {
|
|
|
20
27
|
let terminal = false;
|
|
21
28
|
const unsubscribe = bridge.subscribe(requestId, event => {
|
|
22
29
|
queued.push(event);
|
|
23
|
-
if (event.
|
|
30
|
+
if (event.type === 'run_finished')
|
|
24
31
|
terminal = true;
|
|
25
32
|
resolveNext?.();
|
|
26
33
|
resolveNext = undefined;
|
|
@@ -37,4 +44,38 @@ async function* eventStream(bridge, requestId) {
|
|
|
37
44
|
unsubscribe();
|
|
38
45
|
}
|
|
39
46
|
}
|
|
47
|
+
/** Browser normal-run composition; no proxy, replay registry or hidden session propagation. */
|
|
48
|
+
export function createBrowserRuntimeBridge() {
|
|
49
|
+
const transport = new FetchHttpTransport();
|
|
50
|
+
const runtime = createRuntime({ actionExecutors: [new HttpActionExecutor(transport), new InMemoryActionExecutor()] });
|
|
51
|
+
const buffers = new Map(), listeners = new Map();
|
|
52
|
+
const expiry = new Map();
|
|
53
|
+
const release = (id) => { buffers.delete(id); listeners.delete(id); const timer = expiry.get(id); if (timer)
|
|
54
|
+
clearTimeout(timer); expiry.delete(id); };
|
|
55
|
+
// This is a transport grace period for unclaimed terminal events, not Run/history retention.
|
|
56
|
+
const expireUnclaimed = (id) => { const timer = setTimeout(() => { if (!listeners.get(id)?.size)
|
|
57
|
+
release(id); }, 60_000); const handle = timer; if (typeof handle === 'object' && handle !== null && 'unref' in handle && typeof handle.unref === 'function')
|
|
58
|
+
handle.unref(); expiry.set(id, timer); };
|
|
59
|
+
const unsupported = async () => { throw Object.assign(new Error('unsupported-interactive-integration: Interactive application integration is not yet reviewed.'), { code: 'unsupported-interactive-integration' }); };
|
|
60
|
+
return {
|
|
61
|
+
async execute(request) { const run = await runtime.execute(request); buffers.set(run.requestId, []); void (async () => { for await (const event of runtime.events(run.requestId)) {
|
|
62
|
+
buffers.get(run.requestId).push(event);
|
|
63
|
+
listeners.get(run.requestId)?.forEach(listener => listener(event));
|
|
64
|
+
if (event.type === 'run_finished') {
|
|
65
|
+
if (buffers.has(run.requestId) && !listeners.get(run.requestId)?.size)
|
|
66
|
+
expireUnclaimed(run.requestId);
|
|
67
|
+
}
|
|
68
|
+
} })(); return { requestId: run.requestId }; },
|
|
69
|
+
cancel: (id) => runtime.cancel(id), control: (id, command) => runtime.control(id, command),
|
|
70
|
+
controlState: async (id) => runtime.controlState(id), getResult: (id) => runtime.result(id),
|
|
71
|
+
subscribe(id, listener) { const set = listeners.get(id) ?? new Set(); listeners.set(id, set); set.add(listener); for (const event of buffers.get(id) ?? [])
|
|
72
|
+
listener(event); return () => { set.delete(listener); if (!set.size) {
|
|
73
|
+
listeners.delete(id);
|
|
74
|
+
if (buffers.get(id)?.at(-1)?.type === 'run_finished')
|
|
75
|
+
release(id);
|
|
76
|
+
} }; },
|
|
77
|
+
getRuntimeInfo: async () => runtime.info(), retryAction: unsupported, retryOperation: unsupported, runFromHere: unsupported,
|
|
78
|
+
async testHttpRequest(request) { const response = await transport.request(request.url, { ...request, signal: new AbortController().signal }); return { ...response, headers: response.headers ?? {} }; },
|
|
79
|
+
};
|
|
80
|
+
}
|
|
40
81
|
//# sourceMappingURL=runtime-client-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-client-adapter.js","sourceRoot":"","sources":["../../../src/runner/runtime-client-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-client-adapter.js","sourceRoot":"","sources":["../../../src/runner/runtime-client-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAiBtE,MAAM,UAAU,yBAAyB,CAAC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AAE,EAAE,GAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA,IAAG,CAAC,GAAG,CAAC,IAAI,EAAC,CAAC;YAAA,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAAA,IAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,KAAG,cAAc;gBAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAAA,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC;QACvU,cAAc,EAAC,KAAK,IAAE,EAAE,CAAA,OAAO,CAAC,IAAK,EAAE,EAAC,WAAW,EAAC,WAAW,EAAC,cAAc,EAAC,WAAW,EAAC,WAAW,EAAC,WAAW;QAClH,KAAK,CAAC,eAAe,CAAC,OAA6E,IAAE,MAAM,QAAQ,GAAC,MAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAC,EAAC,GAAG,OAAO,EAAC,MAAM,EAAC,IAAI,eAAe,EAAE,CAAC,MAAM,EAAC,CAAC,CAAC,CAAA,OAAO,EAAC,GAAG,QAAQ,EAAC,OAAO,EAAC,QAAQ,CAAC,OAAO,IAAE,EAAE,EAAC,CAAC,CAAA,CAAC;KAC7P,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare function loadStudioFlowArtifact(candidate: StudioFlowArtifact): ExecutionPackage;
|
|
5
|
-
export declare function loadStudioProjectFile(candidate: StudioProjectFile): ExecutionPackage;
|
|
1
|
+
export { lowerStudioHierarchy, loadHierarchyExecutionPackage } from './studio-hierarchy-loader';
|
|
2
|
+
export declare function loadStudioFlowArtifact(artifact: import('@qaick/contract').StudioFlowArtifact): import("@qaick/contract").ExecutionPackageV7;
|
|
3
|
+
export declare function loadStudioProjectFile(artifact: import('@qaick/contract').StudioProjectFile): import("@qaick/contract").ExecutionPackageV7;
|
|
6
4
|
//# sourceMappingURL=studio-artifact-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studio-artifact-loader.d.ts","sourceRoot":"","sources":["../../../src/runner/studio-artifact-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studio-artifact-loader.d.ts","sourceRoot":"","sources":["../../../src/runner/studio-artifact-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,6BAA6B,EAAC,MAAM,2BAA2B,CAAC;AAC7F,wBAAgB,sBAAsB,CAAC,QAAQ,EAAC,OAAO,iBAAiB,EAAE,kBAAkB,gDAAyC;AACrI,wBAAgB,qBAAqB,CAAC,QAAQ,EAAC,OAAO,iBAAiB,EAAE,iBAAiB,gDAAyC"}
|