Forked from brdcastro/maestro
"use strict";
/**
* @file Dynamic tools documentation — compact system instructions.
* The model already receives tool schemas from LM Studio.
* This only adds behavioral rules that aren't in the schemas.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildToolsDocumentation = buildToolsDocumentation;
function buildToolsDocumentation(cfg) {
const lines = [
'# Rules',
'',
'1. First turn: call Recall("topic") then get_project_context().',
'2. Editing existing files: use replace_text_in_file or patch_file, never save_file.',
'3. Large file (>12K chars, e.g. a full HTML page): NEVER emit it in one save_file call — the generation truncates mid-stream and the tool call fails to parse. Instead: (a) save_file a skeleton ending with the marker <!--INSERT-->, (b) call replace_text_in_file repeatedly, each replacing <!--INSERT--> with one section + <!--INSERT--> again. Keep every call under ~8K chars. Remove the final marker last.',
'4. Never repeat the same tool call. If it failed, try differently.',
'5. Remember user preferences and corrections with Remember().',
];
let nextRule = 6;
if (cfg.enableDesignMode) {
lines.push(`${nextRule}. Design tasks: list_design_systems with a style filter, load_design_system by id, then load_design_reference for 1-2 topics. For a page/landing build, load 'layout-patterns' (pick named macrostructures BEFORE writing CSS — avoids the generic centered-hero + 3-cards layout) and 'frontend-aesthetics'. Output self-contained HTML with a <style> block — but build it section by section per rule 3, never one giant save_file.`);
nextRule++;
}
if (cfg.enableSecondaryAgent) {
lines.push(`${nextRule}. Delegate subtasks (summarize, research, review) to consult_secondary_agent. Never delegate the main request.`);
nextRule++;
}
if (cfg.enableVideoRendering) {
lines.push(`${nextRule}. Video tasks: load_design_reference("video-composition") AND ("video-blocks") FIRST. Save entry as index.html in its own project dir (mandatory). For SCENE-TO-SCENE TRANSITIONS use the CSS snippets in video-composition Section 7 (crossfade/blur/push/zoom) — NEVER embed cinematic-zoom/glitch/thermal-distortion etc. via data-composition-src, those are 4s demo clips with placeholder 'SCENE A/B' content. Drop-in blocks (instagram-follow, data-chart, logo-outro) MUST have compositions/<id>.html edited to swap HF demo defaults (#3d348b purple, #f7b801 yellow) for project palette before embedding. Then call render_html_video. Render is slow — run once per finalized composition.`);
nextRule++;
}
return lines.join('\n');
}
//# sourceMappingURL=toolsDocumentation.js.map