@markdstage/markdstage 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/shared/README.md +61 -9
- package/shared/architecture-editor/editor.js +1 -1
- package/shared/architecture-reference.mjs +150 -0
- package/shared/architecture-validation.mjs +309 -0
- package/shared/markdstage-guide.mjs +62 -142
- package/shared/renderer/architecture-contract.mjs +13707 -0
- package/shared/renderer/architecture-diagnostics.mjs +426 -0
- package/shared/renderer/architecture-scene.mjs +312 -0
- package/shared/renderer/architecture.mjs +221 -217
- package/shared/renderer/index.html +9 -1
- package/shared/renderer/mermaid-scene.mjs +1248 -0
- package/shared/renderer/renderer.js +429 -232
- package/shared/renderer/scene-graph.mjs +739 -0
- package/shared/renderer/scene-pptx.mjs +265 -0
- package/shared/renderer/scene-svg.mjs +321 -0
- package/shared/renderer/slides.css +23 -0
- package/shared/renderer/theme.mjs +54 -0
- package/shared/runtime/architecture-editor-server.mjs +5 -0
- package/shared/runtime/architecture-source.mjs +9 -1
- package/shared/runtime/pptx-package.mjs +4 -3
- package/shared/schema/README.md +60 -5
- package/shared/schema/architecture-contract.mjs +355 -0
- package/shared/scripts/generate-architecture-contract.mjs +41 -0
- package/src/commands/validate.mjs +39 -3
- package/src/runtime.mjs +4 -0
- package/src/skills.mjs +6 -2
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
MarkdStageError,
|
|
5
5
|
architectureValidationErrors,
|
|
6
|
+
architectureValidationReport,
|
|
6
7
|
createDeckSession,
|
|
7
8
|
createUrlToken,
|
|
8
9
|
hasFrontMatter,
|
|
@@ -27,10 +28,24 @@ export async function validateCommand(options) {
|
|
|
27
28
|
code: error.code,
|
|
28
29
|
message: error.message,
|
|
29
30
|
});
|
|
30
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
valid: false,
|
|
34
|
+
complete: false,
|
|
35
|
+
truncated: false,
|
|
36
|
+
file: options.file,
|
|
37
|
+
total: 0,
|
|
38
|
+
errors,
|
|
39
|
+
warnings,
|
|
40
|
+
stages: { json: "skipped", structure: "skipped", semantic: "skipped", layout: "skipped" },
|
|
41
|
+
diagnostics: [],
|
|
42
|
+
diagnosticCount: 0,
|
|
43
|
+
blocks: [],
|
|
44
|
+
};
|
|
31
45
|
}
|
|
32
46
|
|
|
33
|
-
|
|
47
|
+
const validation = architectureValidationReport(session.slides);
|
|
48
|
+
for (const issue of architectureValidationErrors(session.slides, { validation })) {
|
|
34
49
|
errors.push({
|
|
35
50
|
code: issue.code,
|
|
36
51
|
page: issue.page,
|
|
@@ -38,6 +53,12 @@ export async function validateCommand(options) {
|
|
|
38
53
|
message: issue.message,
|
|
39
54
|
});
|
|
40
55
|
}
|
|
56
|
+
if (validation.truncated) {
|
|
57
|
+
errors.push({
|
|
58
|
+
code: "validation_incomplete",
|
|
59
|
+
message: `Architecture validation reached inspection limits (${validation.budget.limitsReached.join(", ")}). Validate smaller inputs before treating the deck as valid.`,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
41
62
|
|
|
42
63
|
session.slides.forEach((slide, index) => {
|
|
43
64
|
if (!hasFrontMatter(slide)) {
|
|
@@ -51,7 +72,10 @@ export async function validateCommand(options) {
|
|
|
51
72
|
});
|
|
52
73
|
|
|
53
74
|
return {
|
|
54
|
-
ok: errors.length === 0,
|
|
75
|
+
ok: errors.length === 0 && validation.valid,
|
|
76
|
+
valid: errors.length === 0 && validation.valid,
|
|
77
|
+
complete: validation.complete,
|
|
78
|
+
truncated: validation.truncated,
|
|
55
79
|
file: session.file,
|
|
56
80
|
workspace: session.workspaceRoot,
|
|
57
81
|
total: session.slides.length,
|
|
@@ -59,6 +83,13 @@ export async function validateCommand(options) {
|
|
|
59
83
|
themeFile: session.customThemeFile || undefined,
|
|
60
84
|
errors,
|
|
61
85
|
warnings,
|
|
86
|
+
stages: validation.stages,
|
|
87
|
+
diagnostics: validation.diagnostics,
|
|
88
|
+
diagnosticCount: validation.diagnosticCount,
|
|
89
|
+
blocks: validation.blocks,
|
|
90
|
+
skipped: validation.skipped,
|
|
91
|
+
limits: validation.limits,
|
|
92
|
+
budget: validation.budget,
|
|
62
93
|
};
|
|
63
94
|
}
|
|
64
95
|
|
|
@@ -74,6 +105,11 @@ export function formatValidateReport(report) {
|
|
|
74
105
|
for (const warning of report.warnings) {
|
|
75
106
|
lines.push(` warn slide ${warning.page}: ${warning.message}`);
|
|
76
107
|
}
|
|
108
|
+
if (report.complete === false) {
|
|
109
|
+
lines.push(report.truncated
|
|
110
|
+
? " Validation incomplete: inspection limits were reached; unchecked content is not valid."
|
|
111
|
+
: " Architecture validation incomplete: fix the reported errors and validate again.");
|
|
112
|
+
}
|
|
77
113
|
lines.push(report.ok ? " OK: the deck is valid." : ` ${report.errors.length} error(s) found.`);
|
|
78
114
|
return lines.join("\n");
|
|
79
115
|
}
|
package/src/runtime.mjs
CHANGED
|
@@ -48,6 +48,7 @@ const [
|
|
|
48
48
|
guide,
|
|
49
49
|
presenterWindow,
|
|
50
50
|
markdownFiles,
|
|
51
|
+
architectureValidation,
|
|
51
52
|
] = await Promise.all([
|
|
52
53
|
load("runtime/errors.mjs"),
|
|
53
54
|
load("runtime/deck-session.mjs"),
|
|
@@ -58,6 +59,7 @@ const [
|
|
|
58
59
|
load("markdstage-guide.mjs"),
|
|
59
60
|
load("presenter-window.mjs"),
|
|
60
61
|
load("scripts/markdown-files.mjs"),
|
|
62
|
+
load("architecture-validation.mjs"),
|
|
61
63
|
]);
|
|
62
64
|
|
|
63
65
|
export const { MarkdStageError } = errors;
|
|
@@ -75,9 +77,11 @@ export const { findChromiumBrowser, terminateProcessTree, isProcessRunning } = b
|
|
|
75
77
|
export const { captureDirectoryName, pdfNameForSource, pptxNameForSource } = outputPaths;
|
|
76
78
|
export const {
|
|
77
79
|
architectureValidationErrors,
|
|
80
|
+
architectureValidationReport,
|
|
78
81
|
deckValidationFeedback,
|
|
79
82
|
hasFrontMatter,
|
|
80
83
|
readGuide,
|
|
81
84
|
} = guide;
|
|
85
|
+
export const { validateArchitectureInput, createArchitectureValidationTool } = architectureValidation;
|
|
82
86
|
export const { buildPresenterBrowserArgs } = presenterWindow;
|
|
83
87
|
export const { isMarkdownPath, MARKDOWN_MAX_BYTES } = markdownFiles;
|
package/src/skills.mjs
CHANGED
|
@@ -73,11 +73,15 @@ what the MarkdStage canvas and MarkdStage Desktop render.
|
|
|
73
73
|
required diagrams, and output format.
|
|
74
74
|
2. Read only the relevant guidance. Start with
|
|
75
75
|
\`markdstage guide slide-format\`, then retrieve \`themes\`,
|
|
76
|
-
\`custom-themes\`, or \`architecture-
|
|
76
|
+
\`custom-themes\`, or \`architecture-schema\` when needed. Before drafting
|
|
77
|
+
Architecture DSL, read the compact \`architecture-schema\` contract first;
|
|
78
|
+
use \`architecture-dsl\` for advanced behavior.
|
|
77
79
|
3. Create the complete deck as one Markdown source file (see
|
|
78
80
|
\`references/slide-format.md\`).
|
|
79
81
|
4. Validate structure, themes, and Architecture DSL before visual review:
|
|
80
|
-
\`markdstage validate slides.md --json\`.
|
|
82
|
+
\`markdstage validate slides.md --json\`. Review diagnostic codes, JSON Pointers,
|
|
83
|
+
and completeness, fix independent issues together, and preserve the same
|
|
84
|
+
validated content when presenting. Suggestions are never automatic repairs.
|
|
81
85
|
5. Use \`markdstage preview slides.md --watch\` for live source-backed authoring.
|
|
82
86
|
It reloads on save without losing the current slide and keeps the last valid
|
|
83
87
|
deck while a save is incomplete.
|