Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified archify.zip
Binary file not shown.
725 changes: 724 additions & 1 deletion archify/assets/template.html

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions archify/bin/archify.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function usage() {
archify examples
archify doctor
archify demo [output-directory]
archify export-drawio <type> <input.json> [output.drawio] [--strict] [--json]

Types:
architecture, workflow, sequence, dataflow, lifecycle
Expand Down Expand Up @@ -1156,6 +1157,41 @@ function commandCheck(args) {
if (result.status !== 0) exitFrom(result);
}

function commandExportDrawio(args) {
const json = args.includes('--json');
const strict = args.includes('--strict');
const knownOptions = new Set(['--json', '--strict']);
const unknown = args.filter((arg) => arg.startsWith('--') && !knownOptions.has(arg));
if (unknown.length) fail(`Unknown export-drawio option "${unknown[0]}".`);
const positional = args.filter((arg) => !knownOptions.has(arg));
const [type, input, output] = positional;
if (!type || !input || positional.length > 3) fail(usage());
rendererPath(type); // validates type against TYPES, fails(2) on unknown.
const exporter = path.join(skillRoot, 'scripts/export-drawio.mjs');
const result = runNode(
[exporter, type, input, ...(output ? [output] : []), ...(strict ? ['--strict'] : [])],
{ stdio: json ? 'pipe' : 'inherit' },
);
if (result.status !== 0) {
if (json) {
console.log(JSON.stringify({
schemaVersion: 1, ok: false, command: 'export-drawio',
type, input: path.resolve(input),
error: 'Drawio export failed.',
}, null, 2));
}
exitFrom(result);
}
if (json) {
console.log(JSON.stringify({
schemaVersion: 1, ok: true, command: 'export-drawio',
type, input: path.resolve(input),
...(strict ? { strict: true } : {}),
...(output ? { output: path.resolve(output) } : {}),
}, null, 2));
}
}

async function commandVisualCheck(args) {
const json = args.includes('--json');
const knownOptions = new Set(['--json']);
Expand Down Expand Up @@ -1578,6 +1614,9 @@ switch (command) {
case 'demo':
commandDemo(args);
break;
case 'export-drawio':
commandExportDrawio(args);
break;
default:
fail(`Unknown command "${command}".\n\n${usage()}`);
}
727 changes: 725 additions & 2 deletions archify/examples/dataflow-product-analytics.html

Large diffs are not rendered by default.

727 changes: 725 additions & 2 deletions archify/examples/lifecycle-agent-run.html

Large diffs are not rendered by default.

751 changes: 737 additions & 14 deletions archify/examples/sequence-cache-miss-request.html

Large diffs are not rendered by default.

727 changes: 725 additions & 2 deletions archify/examples/web-app-rendered.html

Large diffs are not rendered by default.

727 changes: 725 additions & 2 deletions archify/examples/workflow-agent-tool-call-rendered.html

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions archify/renderers/sequence/render-sequence.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ function renderActivation(activation) {
const fill = componentFill[activation.type] || componentFill[participant.type] || 'c-external';
const x = participant.cx - 5;
const height = activation.to - activation.from;
return ` <rect x="${x}" y="${activation.from}" width="10" height="${height}" rx="3" class="c-mask"/>
<rect x="${x}" y="${activation.from}" width="10" height="${height}" rx="3" class="${fill}" stroke-width="1"/>`;
const identity = ` data-graph-role="activation" data-activation-participant="${esc(activation.participant)}"`;
return ` <rect${identity} x="${x}" y="${activation.from}" width="10" height="${height}" rx="3" class="c-mask"/>
<rect${identity} x="${x}" y="${activation.from}" width="10" height="${height}" rx="3" class="${fill}" stroke-width="1"/>`;
}

function messageLabel(message, x1, x2) {
Expand Down
5 changes: 5 additions & 0 deletions archify/renderers/shared/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function writeDiagram({ outPath, template, diagramType, meta, svg, cards,
visualPreset: meta.visual_preset || 'classic',
guidedViews: meta.views || [],
sourceEvidence,
diagramType,
}));
outputPathGuards.delete(outPath);
console.log(outPath);
Expand Down Expand Up @@ -166,6 +167,10 @@ export function animateAttr(meta, kind, step) {
// Stable semantic hooks for the standalone HTML explorer. IDs already pass
// the schema's conservative identifier pattern; escape again at the markup
// boundary so these helpers remain safe if that contract expands later.
// Attribute-order contract: `id` must stay FIRST with data-node-* after —
// the draw.io exporters regex-parse these groups and anchor on that order
// (NODE_G_RE in renderers/shared/svg-to-drawio.mjs and the viewer's
// drawioParseSvg in assets/template.html).
export function focusNodeAttrs(id, label, metadata = {}) {
const optional = [
['data-node-kind', metadata.kind],
Expand Down
Loading