aboutsummaryrefslogtreecommitdiff
path: root/types/execution/execution.interfaces.ts
blob: eb52b40879d21d238f56fc46cb92ffe95fc12925 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import {ResultLine} from '../resultline/resultline.interfaces.js';

export type FilenameTransformFunc = (filename: string) => string;

export type UnprocessedExecResult = {
    code: number;
    okToCache: boolean;
    filenameTransform: FilenameTransformFunc;
    stdout: string;
    stderr: string;
    execTime: string;
    timedOut: boolean;
    languageId?: string;
    truncated: boolean;
};

export type TypicalExecutionFunc = (
    executable: string,
    args: string[],
    execOptions: object,
) => Promise<UnprocessedExecResult>;

export type BasicExecutionResult = {
    code: number;
    okToCache: boolean;
    filenameTransform: FilenameTransformFunc;
    stdout: ResultLine[];
    stderr: ResultLine[];
    execTime: string;
    processExecutionResultTime?: number;
    timedOut: boolean;
    languageId?: string;
    truncated?: boolean;
};

export enum RuntimeToolType {
    env = 'env',
    heaptrack = 'heaptrack',
}

export type RuntimeToolOption = {
    name: string;
    value: string;
};

export type PossibleRuntimeToolOption = {
    name: string;
    possibleValues: string[];
};

export type PossibleRuntimeTool = {
    name: RuntimeToolType;
    description: string;
    possibleOptions: PossibleRuntimeToolOption[];
};
export type PossibleRuntimeTools = PossibleRuntimeTool[];

export type RuntimeToolOptions = RuntimeToolOption[];

export type ConfiguredRuntimeTool = {
    name: RuntimeToolType;
    options: RuntimeToolOptions;
};

export type ConfiguredRuntimeTools = ConfiguredRuntimeTool[];

export type ExecutableExecutionOptions = {
    args: string[];
    stdin: string;
    ldPath: string[];
    env: Record<string, string>;
    runtimeTools?: ConfiguredRuntimeTools;
};