Add Python macro worker runtime, ScriptEngine resolution, and PageRenderer/registry integration

Co-authored-by: rfc1437 <774975+rfc1437@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-26 21:41:26 +00:00
parent dd5a2e3377
commit b34cb4a110
8 changed files with 679 additions and 23 deletions

View File

@@ -222,6 +222,24 @@ export class ScriptEngine extends EventEmitter {
return Promise.all(rows.map((item) => this.toScriptData(item)));
}
async getEnabledMacroScripts(): Promise<ScriptData[]> {
const rows = await this.getAllScriptRows();
const macroRows = rows.filter((row) => row.kind === 'macro' && row.enabled);
return Promise.all(macroRows.map((item) => this.toScriptData(item)));
}
async getMacroScriptBySlug(slug: string): Promise<ScriptData | null> {
const normalizedSlug = slug.toLowerCase();
const rows = await this.getAllScriptRows();
const match = rows.find(
(row) => row.kind === 'macro' && row.enabled && row.slug.toLowerCase() === normalizedSlug,
);
if (!match) {
return null;
}
return this.toScriptData(match);
}
async rebuildDatabaseFromFiles(): Promise<void> {
const db = getDatabase().getLocal();
const scriptsDir = this.getScriptsDir();