- Added a new Archify skill, enabling users to create polished architecture, workflow, sequence, data-flow, and lifecycle diagrams. - Implemented comprehensive functionality including rendering, validation, and delivery of diagrams in various formats. - Integrated a user-friendly command-line interface for generating and previewing diagrams. - Developed supporting files including package.json, LICENSE, and SKILL.md for documentation and licensing. - Added unit tests to ensure reliability and functionality of the new skill. These changes enhance the application by providing a structured approach to visualizing system architecture and workflows, improving user experience and data representation.
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { loadDiagramWithBrandMarks, writeDiagram } from '../shared/cli.mjs';
|
|
import { throwDiagnosticError } from '../shared/diagnostics.mjs';
|
|
import { compileWorkflow } from './workflow-compiler.mjs';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const { diagram: workflow, template, outPath } = await loadDiagramWithBrandMarks({
|
|
rendererDir: __dirname,
|
|
diagramType: 'workflow',
|
|
defaultExample: 'agent-tool-call.workflow.json'
|
|
});
|
|
|
|
const compiled = compileWorkflow({
|
|
workflow,
|
|
qualityProfile: process.env.ARCHIFY_QUALITY_PROFILE || workflow.meta?.quality_profile,
|
|
});
|
|
|
|
const layoutJson = process.argv.includes('--layout-json');
|
|
|
|
if (layoutJson) {
|
|
process.stdout.write(`${JSON.stringify(compiled.receipt, null, 2)}\n`);
|
|
if (!compiled.ok) process.exitCode = 1;
|
|
} else if (!compiled.ok) {
|
|
throwDiagnosticError(compiled.error || 'Workflow compilation failed.', compiled.diagnostics);
|
|
} else {
|
|
writeDiagram({
|
|
outPath,
|
|
template,
|
|
diagramType: 'workflow',
|
|
meta: workflow.meta,
|
|
svg: compiled.svg,
|
|
cards: workflow.cards,
|
|
});
|
|
}
|