mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-10 19:49:52 +08:00
- Add a drawing guide adapted from the web system prompt (layout, edge routing, styles, minimal style, editing rules), returned by start_session, a new get_drawing_guide tool and the diagram-workflow prompt - Add get_shape_library with the 30 icon libraries; the build copies docs/shape-libraries into dist and CI checks the packed files - Accept bare mxCell lists in create_new_diagram and add_page; the server adds the wrapper and root cells - Send server instructions, shorten create_new_diagram's description to fit Claude Code's 2,048 character limit, and annotate every tool - Fix dead links and the totals in docs/shape-libraries/README.md
18 lines
659 B
JavaScript
18 lines
659 B
JavaScript
// Fail if the npm package would miss files the server reads at runtime.
|
|
// Tests run from src/ (tsx) and cannot notice a broken dist/ copy step.
|
|
// Run after `npm run build`.
|
|
import { execSync } from "node:child_process"
|
|
|
|
const REQUIRED = ["dist/index.js", "dist/shape-libraries/aws4.md"]
|
|
|
|
const [pack] = JSON.parse(
|
|
execSync("npm pack --dry-run --json", { encoding: "utf8" }),
|
|
)
|
|
const files = new Set(pack.files.map((f) => f.path))
|
|
const missing = REQUIRED.filter((f) => !files.has(f))
|
|
if (missing.length > 0) {
|
|
console.error(`npm package is missing: ${missing.join(", ")}`)
|
|
process.exit(1)
|
|
}
|
|
console.log(`npm package OK (${files.size} files)`)
|