feat: more work on python scriptiong basics

This commit is contained in:
2026-02-23 11:45:13 +01:00
parent 94b7ca2c80
commit caa3f3c061
18 changed files with 752 additions and 33 deletions

View File

@@ -0,0 +1,34 @@
import type { PythonMacroRenderOptions, PythonMacroSourceOptions } from './PythonRuntimeManager';
export interface MacroRenderOptionInput {
timeoutMs?: number;
cacheKey?: string;
hook?: string;
source?: PythonMacroSourceOptions;
}
export function createMacroRenderOptions(input?: MacroRenderOptionInput): PythonMacroRenderOptions {
if (!input) {
return {};
}
const options: PythonMacroRenderOptions = {};
if (input.timeoutMs !== undefined) {
options.timeoutMs = input.timeoutMs;
}
if (input.cacheKey !== undefined) {
options.cacheKey = input.cacheKey;
}
if (input.hook !== undefined) {
options.macroHook = input.hook;
}
if (input.source !== undefined) {
options.macroSource = input.source;
}
return options;
}