vibe coded maxx

This commit is contained in:
2026-05-22 13:46:02 +02:00
parent 8f7f14c95b
commit 8feb88dfa6
9 changed files with 787 additions and 17 deletions
+33
View File
@@ -0,0 +1,33 @@
import fs from 'fs';
import path from 'path';
export interface ActionDefinition {
template: string;
params?: string[];
}
export interface ActionCatalog {
_comment?: string;
_version?: string;
_targetGroup?: string;
actions: Record<string, ActionDefinition>;
}
const CATALOG_PATH = path.join(__dirname, 'catalog.json');
let cachedCatalog: ActionCatalog | null = null;
export function loadActionCatalog(forceReload = false): ActionCatalog {
if (cachedCatalog && !forceReload) {
return cachedCatalog;
}
const raw = fs.readFileSync(CATALOG_PATH, 'utf-8');
cachedCatalog = JSON.parse(raw);
return cachedCatalog!;
}
export function getAction(actionKey: string): ActionDefinition | undefined {
const catalog = loadActionCatalog();
return catalog.actions[actionKey];
}