schematex 0.9.17 → 0.9.18
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/dist/ai/ai-sdk.cjs +8 -8
- package/dist/ai/ai-sdk.js +3 -3
- package/dist/ai/index.cjs +17 -17
- package/dist/ai/index.js +4 -4
- package/dist/browser.cjs +9 -9
- package/dist/browser.js +3 -3
- package/dist/{chunk-24YHD4YI.cjs → chunk-AG4WA4NF.cjs} +9 -7
- package/dist/chunk-AG4WA4NF.cjs.map +1 -0
- package/dist/{chunk-HVPSY7LV.js → chunk-DSKPJYQO.js} +3 -3
- package/dist/{chunk-HVPSY7LV.js.map → chunk-DSKPJYQO.js.map} +1 -1
- package/dist/{chunk-37WDY4G4.js → chunk-FA6Y4QRS.js} +9 -7
- package/dist/chunk-FA6Y4QRS.js.map +1 -0
- package/dist/{chunk-ATN2WLSL.cjs → chunk-JWILBXGR.cjs} +5 -5
- package/dist/{chunk-ATN2WLSL.cjs.map → chunk-JWILBXGR.cjs.map} +1 -1
- package/dist/{chunk-LUJ4IBEO.js → chunk-LZHLFNM3.js} +3 -3
- package/dist/{chunk-LUJ4IBEO.js.map → chunk-LZHLFNM3.js.map} +1 -1
- package/dist/{chunk-KHIPNN35.cjs → chunk-VLK5T7B7.cjs} +4 -4
- package/dist/{chunk-KHIPNN35.cjs.map → chunk-VLK5T7B7.cjs.map} +1 -1
- package/dist/diagrams/circuit/index.cjs +8 -8
- package/dist/diagrams/circuit/index.js +1 -1
- package/dist/index.cjs +41 -41
- package/dist/index.js +4 -4
- package/dist/react.cjs +3 -3
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-24YHD4YI.cjs.map +0 -1
- package/dist/chunk-37WDY4G4.js.map +0 -1
package/dist/ai/ai-sdk.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkJWILBXGR_cjs = require('../chunk-JWILBXGR.cjs');
|
|
4
|
+
require('../chunk-VLK5T7B7.cjs');
|
|
5
5
|
require('../chunk-UHRNFBWY.cjs');
|
|
6
6
|
require('../chunk-IBZKIMT5.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-AG4WA4NF.cjs');
|
|
8
8
|
require('../chunk-T55OQILI.cjs');
|
|
9
9
|
require('../chunk-US4QZ7J7.cjs');
|
|
10
10
|
require('../chunk-AWUUGDN4.cjs');
|
|
@@ -32,7 +32,7 @@ var schematexTools = {
|
|
|
32
32
|
listDiagrams: ai.tool({
|
|
33
33
|
description: "List every Schematex diagram type with a tagline, 'use when' hint, domain cluster, and authoritative standard. Call this first to discover what's available.",
|
|
34
34
|
inputSchema: zod.z.object({}),
|
|
35
|
-
execute: async () =>
|
|
35
|
+
execute: async () => chunkJWILBXGR_cjs.listDiagrams()
|
|
36
36
|
}),
|
|
37
37
|
getSyntax: ai.tool({
|
|
38
38
|
description: "Return syntax for one diagram type. Default `detail: canonical` is the compact first-shot generation path: canonical header, preferred forms, rules, and repair checks. Request `detail: reference` only for advanced forms or imported adapters after choosing a type.",
|
|
@@ -47,7 +47,7 @@ var schematexTools = {
|
|
|
47
47
|
execute: async ({
|
|
48
48
|
type,
|
|
49
49
|
detail
|
|
50
|
-
}) =>
|
|
50
|
+
}) => chunkJWILBXGR_cjs.getSyntax(type, { detail })
|
|
51
51
|
}),
|
|
52
52
|
getExamples: ai.tool({
|
|
53
53
|
description: "Return curated real-world DSL examples for a diagram type, each with scenario notes and tags. Use as few-shot context before generating DSL.",
|
|
@@ -57,7 +57,7 @@ var schematexTools = {
|
|
|
57
57
|
preferFeatured: zod.z.boolean().optional().describe("Rank featured examples first."),
|
|
58
58
|
maxComplexity: zod.z.number().int().min(1).max(5).optional().describe("Only return examples with complexity <= this value (1=simplest).")
|
|
59
59
|
}),
|
|
60
|
-
execute: async (args) =>
|
|
60
|
+
execute: async (args) => chunkJWILBXGR_cjs.getExamples(args.type, {
|
|
61
61
|
limit: args.limit,
|
|
62
62
|
preferFeatured: args.preferFeatured,
|
|
63
63
|
maxComplexity: args.maxComplexity
|
|
@@ -71,7 +71,7 @@ var schematexTools = {
|
|
|
71
71
|
),
|
|
72
72
|
dsl: zod.z.string().describe("The DSL source text to validate.")
|
|
73
73
|
}),
|
|
74
|
-
execute: async ({ type, dsl }) =>
|
|
74
|
+
execute: async ({ type, dsl }) => chunkJWILBXGR_cjs.validateDsl(type, dsl)
|
|
75
75
|
}),
|
|
76
76
|
renderDsl: ai.tool({
|
|
77
77
|
description: "Render Schematex DSL to an SVG string. Returns { ok: true, svg } or { ok: false, errors }. Use when the caller needs the actual diagram output, not just validation.",
|
|
@@ -86,7 +86,7 @@ var schematexTools = {
|
|
|
86
86
|
dsl,
|
|
87
87
|
theme,
|
|
88
88
|
padding
|
|
89
|
-
}) =>
|
|
89
|
+
}) => chunkJWILBXGR_cjs.renderDsl(type, dsl, { theme, padding })
|
|
90
90
|
})
|
|
91
91
|
};
|
|
92
92
|
|
package/dist/ai/ai-sdk.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-DSKPJYQO.js';
|
|
2
|
+
import '../chunk-LZHLFNM3.js';
|
|
3
3
|
import '../chunk-EB7T5SEO.js';
|
|
4
4
|
import '../chunk-PGMKMIGM.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-FA6Y4QRS.js';
|
|
6
6
|
import '../chunk-P4U565XH.js';
|
|
7
7
|
import '../chunk-I7UYVCKH.js';
|
|
8
8
|
import '../chunk-6GVFKOSH.js';
|
package/dist/ai/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkJWILBXGR_cjs = require('../chunk-JWILBXGR.cjs');
|
|
4
|
+
require('../chunk-VLK5T7B7.cjs');
|
|
5
5
|
require('../chunk-UHRNFBWY.cjs');
|
|
6
6
|
require('../chunk-IBZKIMT5.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-AG4WA4NF.cjs');
|
|
8
8
|
require('../chunk-T55OQILI.cjs');
|
|
9
9
|
require('../chunk-US4QZ7J7.cjs');
|
|
10
10
|
require('../chunk-AWUUGDN4.cjs');
|
|
@@ -28,10 +28,10 @@ require('../chunk-3WNW5Y7P.cjs');
|
|
|
28
28
|
|
|
29
29
|
// src/ai/prompt-context.ts
|
|
30
30
|
function buildPromptContext(type, opts = {}) {
|
|
31
|
-
const resolved =
|
|
31
|
+
const resolved = chunkJWILBXGR_cjs.resolveDiagramType(type) ?? type;
|
|
32
32
|
const detail = opts.detail ?? "canonical";
|
|
33
33
|
const limit = opts.examples ?? 2;
|
|
34
|
-
const { type: canonical, name, standard, syntax } =
|
|
34
|
+
const { type: canonical, name, standard, syntax } = chunkJWILBXGR_cjs.getSyntax(resolved, {
|
|
35
35
|
detail
|
|
36
36
|
});
|
|
37
37
|
const parts = [
|
|
@@ -42,7 +42,7 @@ function buildPromptContext(type, opts = {}) {
|
|
|
42
42
|
];
|
|
43
43
|
let exampleCount = 0;
|
|
44
44
|
if (limit > 0) {
|
|
45
|
-
const examples =
|
|
45
|
+
const examples = chunkJWILBXGR_cjs.getExamples(canonical, {
|
|
46
46
|
preferFeatured: opts.preferFeatured ?? true,
|
|
47
47
|
limit,
|
|
48
48
|
maxComplexity: opts.maxComplexity
|
|
@@ -68,47 +68,47 @@ function buildPromptContext(type, opts = {}) {
|
|
|
68
68
|
|
|
69
69
|
Object.defineProperty(exports, "DIAGRAM_REGISTRY", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkJWILBXGR_cjs.DIAGRAM_REGISTRY; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "DIAGRAM_SINCE", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkJWILBXGR_cjs.DIAGRAM_SINCE; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "getAllDiagramTypes", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkJWILBXGR_cjs.getAllDiagramTypes; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "getDiagramMeta", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkJWILBXGR_cjs.getDiagramMeta; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "getDiagramSince", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkJWILBXGR_cjs.getDiagramSince; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "getExamples", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkJWILBXGR_cjs.getExamples; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "getSyntax", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkJWILBXGR_cjs.getSyntax; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "listDiagrams", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkJWILBXGR_cjs.listDiagrams; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "renderDsl", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkJWILBXGR_cjs.renderDsl; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "resolveDiagramType", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkJWILBXGR_cjs.resolveDiagramType; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "validateDsl", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkJWILBXGR_cjs.validateDsl; }
|
|
112
112
|
});
|
|
113
113
|
exports.buildPromptContext = buildPromptContext;
|
|
114
114
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { resolveDiagramType, getSyntax, getExamples } from '../chunk-
|
|
2
|
-
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { resolveDiagramType, getSyntax, getExamples } from '../chunk-DSKPJYQO.js';
|
|
2
|
+
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-DSKPJYQO.js';
|
|
3
|
+
import '../chunk-LZHLFNM3.js';
|
|
4
4
|
import '../chunk-EB7T5SEO.js';
|
|
5
5
|
import '../chunk-PGMKMIGM.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-FA6Y4QRS.js';
|
|
7
7
|
import '../chunk-P4U565XH.js';
|
|
8
8
|
import '../chunk-I7UYVCKH.js';
|
|
9
9
|
import '../chunk-6GVFKOSH.js';
|
package/dist/browser.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVLK5T7B7_cjs = require('./chunk-VLK5T7B7.cjs');
|
|
4
4
|
require('./chunk-UHRNFBWY.cjs');
|
|
5
5
|
require('./chunk-IBZKIMT5.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-AG4WA4NF.cjs');
|
|
7
7
|
require('./chunk-T55OQILI.cjs');
|
|
8
8
|
require('./chunk-US4QZ7J7.cjs');
|
|
9
9
|
require('./chunk-AWUUGDN4.cjs');
|
|
@@ -27,10 +27,10 @@ require('./chunk-3WNW5Y7P.cjs');
|
|
|
27
27
|
|
|
28
28
|
// src/browser.ts
|
|
29
29
|
function renderToElement(text, config) {
|
|
30
|
-
return svgStringToElement(
|
|
30
|
+
return svgStringToElement(chunkVLK5T7B7_cjs.render(text, config));
|
|
31
31
|
}
|
|
32
32
|
function renderPreviewToElement(text, config) {
|
|
33
|
-
return svgStringToElement(
|
|
33
|
+
return svgStringToElement(chunkVLK5T7B7_cjs.renderPreview(text, config));
|
|
34
34
|
}
|
|
35
35
|
function svgStringToElement(svgString) {
|
|
36
36
|
const parser = new DOMParser();
|
|
@@ -43,23 +43,23 @@ function svgStringToElement(svgString) {
|
|
|
43
43
|
return el;
|
|
44
44
|
}
|
|
45
45
|
function renderToContainer(text, container, config) {
|
|
46
|
-
container.innerHTML =
|
|
46
|
+
container.innerHTML = chunkVLK5T7B7_cjs.render(text, config);
|
|
47
47
|
}
|
|
48
48
|
function renderPreviewToContainer(text, container, config) {
|
|
49
|
-
container.innerHTML =
|
|
49
|
+
container.innerHTML = chunkVLK5T7B7_cjs.renderPreview(text, config);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
Object.defineProperty(exports, "render", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkVLK5T7B7_cjs.render; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "renderPreview", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkVLK5T7B7_cjs.renderPreview; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "renderResult", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkVLK5T7B7_cjs.renderResult; }
|
|
63
63
|
});
|
|
64
64
|
exports.renderPreviewToContainer = renderPreviewToContainer;
|
|
65
65
|
exports.renderPreviewToElement = renderPreviewToElement;
|
package/dist/browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { render, renderPreview } from './chunk-
|
|
2
|
-
export { render, renderPreview, renderResult } from './chunk-
|
|
1
|
+
import { render, renderPreview } from './chunk-LZHLFNM3.js';
|
|
2
|
+
export { render, renderPreview, renderResult } from './chunk-LZHLFNM3.js';
|
|
3
3
|
import './chunk-EB7T5SEO.js';
|
|
4
4
|
import './chunk-PGMKMIGM.js';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-FA6Y4QRS.js';
|
|
6
6
|
import './chunk-P4U565XH.js';
|
|
7
7
|
import './chunk-I7UYVCKH.js';
|
|
8
8
|
import './chunk-6GVFKOSH.js';
|
|
@@ -1656,7 +1656,7 @@ function parseNetlist(body, title2) {
|
|
|
1656
1656
|
for (let lineIdx = 0; lineIdx < lines.length; lineIdx++) {
|
|
1657
1657
|
const raw = lines[lineIdx];
|
|
1658
1658
|
if (/^\s*\*/.test(raw)) continue;
|
|
1659
|
-
const stripped = raw.replace(
|
|
1659
|
+
const stripped = raw.replace(/[#;].*$/, "").trim();
|
|
1660
1660
|
if (!stripped) continue;
|
|
1661
1661
|
const tokens = tokenize(stripped);
|
|
1662
1662
|
if (tokens.length < 2) {
|
|
@@ -2021,12 +2021,12 @@ function parseAttrs(rest) {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
function parseCircuit(text2) {
|
|
2023
2023
|
const rawLines = text2.split("\n");
|
|
2024
|
-
const firstMeaningful = rawLines.map((l) => l.replace(
|
|
2024
|
+
const firstMeaningful = rawLines.map((l) => l.replace(/[#;].*$/, "").trim()).find((l) => l.length > 0) ?? "";
|
|
2025
2025
|
if (/^circuit\b.*\bnetlist\s*$/i.test(firstMeaningful)) {
|
|
2026
2026
|
const netlistTitle = chunkVHDSPI6A_cjs.matchQuotedTitle(firstMeaningful);
|
|
2027
2027
|
let headerIdx = -1;
|
|
2028
2028
|
for (let i = 0; i < rawLines.length; i++) {
|
|
2029
|
-
const s = rawLines[i].replace(
|
|
2029
|
+
const s = rawLines[i].replace(/[#;].*$/, "").trim();
|
|
2030
2030
|
if (s.length > 0) {
|
|
2031
2031
|
headerIdx = i;
|
|
2032
2032
|
break;
|
|
@@ -2044,7 +2044,7 @@ function parseCircuit(text2) {
|
|
|
2044
2044
|
let pendingAt;
|
|
2045
2045
|
const mkId = (prefix) => `${prefix}_${autoId++}`;
|
|
2046
2046
|
for (const rawLine of lines) {
|
|
2047
|
-
const stripped = rawLine.replace(
|
|
2047
|
+
const stripped = rawLine.replace(/[#;].*$/, "").trim();
|
|
2048
2048
|
if (!stripped) continue;
|
|
2049
2049
|
if (/^circuit\b/i.test(stripped)) {
|
|
2050
2050
|
const t = chunkVHDSPI6A_cjs.matchQuotedTitle(stripped);
|
|
@@ -2143,7 +2143,9 @@ function parseCircuit(text2) {
|
|
|
2143
2143
|
const typeStr = bareMatch[1];
|
|
2144
2144
|
const norm = normalizeType(typeStr);
|
|
2145
2145
|
if (!norm) {
|
|
2146
|
-
|
|
2146
|
+
throw new CircuitParseError(
|
|
2147
|
+
`Unknown component type: "${typeStr}". For SPICE-style connectivity (Id net1 net2 [value]), start the diagram with the \`netlist\` header: circuit "..." netlist.`
|
|
2148
|
+
);
|
|
2147
2149
|
}
|
|
2148
2150
|
const rest = bareMatch[2] ?? "";
|
|
2149
2151
|
const parsed = parseAttrs(rest);
|
|
@@ -2891,5 +2893,5 @@ exports.lintCircuit = lintCircuit;
|
|
|
2891
2893
|
exports.parseCircuit = parseCircuit;
|
|
2892
2894
|
exports.parseNetlist = parseNetlist;
|
|
2893
2895
|
exports.renderCircuit = renderCircuit;
|
|
2894
|
-
//# sourceMappingURL=chunk-
|
|
2895
|
-
//# sourceMappingURL=chunk-
|
|
2896
|
+
//# sourceMappingURL=chunk-AG4WA4NF.cjs.map
|
|
2897
|
+
//# sourceMappingURL=chunk-AG4WA4NF.cjs.map
|