mirror of
https://github.com/morluto/rea.git
synced 2026-11-04 05:46:17 +00:00
* refactor(process): separate capture implementation from analyst workflows * fix(ci): generate source catalog before shard tests
25 lines
811 B
TypeScript
25 lines
811 B
TypeScript
import type { ProcessScenario } from "../../domain/process/processCapture.js";
|
|
|
|
interface ProcessCaptureEnvironmentOptions {
|
|
readonly scenario: ProcessScenario;
|
|
readonly runId: string;
|
|
readonly hostEnvironment: Readonly<Record<string, string | undefined>>;
|
|
}
|
|
|
|
/** Build the child environment from the host plus caller-selected overrides. */
|
|
export const makeProcessCaptureEnvironment = (
|
|
options: ProcessCaptureEnvironmentOptions,
|
|
): Record<string, string> => ({
|
|
...Object.fromEntries(
|
|
Object.entries(options.hostEnvironment).filter(
|
|
(entry): entry is [string, string] => entry[1] !== undefined,
|
|
),
|
|
),
|
|
...options.scenario.environment,
|
|
TERM:
|
|
options.scenario.environment.TERM ??
|
|
options.hostEnvironment.TERM ??
|
|
"xterm-256color",
|
|
REA_PROCESS_RUN_ID: options.runId,
|
|
});
|