schematex 0.9.13 → 0.9.15
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 +7 -7
- package/dist/ai/ai-sdk.js +2 -2
- package/dist/ai/index.cjs +16 -16
- package/dist/ai/index.js +3 -3
- package/dist/browser.cjs +8 -8
- package/dist/browser.js +2 -2
- package/dist/{chunk-XJ5MTQLJ.cjs → chunk-3VKMRHBU.cjs} +5 -5
- package/dist/{chunk-XJ5MTQLJ.cjs.map → chunk-3VKMRHBU.cjs.map} +1 -1
- package/dist/{chunk-WPNMVV3U.js → chunk-F72IQZ6O.js} +113 -16
- package/dist/chunk-F72IQZ6O.js.map +1 -0
- package/dist/{chunk-GHMSKPYN.js → chunk-LXM32NGV.js} +3 -3
- package/dist/{chunk-GHMSKPYN.js.map → chunk-LXM32NGV.js.map} +1 -1
- package/dist/{chunk-KTAEPUAE.cjs → chunk-O4XRVW3R.cjs} +113 -16
- package/dist/chunk-O4XRVW3R.cjs.map +1 -0
- package/dist/index.cjs +37 -37
- package/dist/index.js +2 -2
- package/dist/react.cjs +2 -2
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KTAEPUAE.cjs.map +0 -1
- package/dist/chunk-WPNMVV3U.js.map +0 -1
package/dist/ai/ai-sdk.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunk3VKMRHBU_cjs = require('../chunk-3VKMRHBU.cjs');
|
|
4
|
+
require('../chunk-O4XRVW3R.cjs');
|
|
5
5
|
require('../chunk-UHRNFBWY.cjs');
|
|
6
6
|
require('../chunk-IBZKIMT5.cjs');
|
|
7
7
|
require('../chunk-24YHD4YI.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 () => chunk3VKMRHBU_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
|
+
}) => chunk3VKMRHBU_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) => chunk3VKMRHBU_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 }) => chunk3VKMRHBU_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
|
+
}) => chunk3VKMRHBU_cjs.renderDsl(type, dsl, { theme, padding })
|
|
90
90
|
})
|
|
91
91
|
};
|
|
92
92
|
|
package/dist/ai/ai-sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-LXM32NGV.js';
|
|
2
|
+
import '../chunk-F72IQZ6O.js';
|
|
3
3
|
import '../chunk-EB7T5SEO.js';
|
|
4
4
|
import '../chunk-PGMKMIGM.js';
|
|
5
5
|
import '../chunk-37WDY4G4.js';
|
package/dist/ai/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunk3VKMRHBU_cjs = require('../chunk-3VKMRHBU.cjs');
|
|
4
|
+
require('../chunk-O4XRVW3R.cjs');
|
|
5
5
|
require('../chunk-UHRNFBWY.cjs');
|
|
6
6
|
require('../chunk-IBZKIMT5.cjs');
|
|
7
7
|
require('../chunk-24YHD4YI.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 = chunk3VKMRHBU_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 } = chunk3VKMRHBU_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 = chunk3VKMRHBU_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 chunk3VKMRHBU_cjs.DIAGRAM_REGISTRY; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "DIAGRAM_SINCE", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk3VKMRHBU_cjs.DIAGRAM_SINCE; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "getAllDiagramTypes", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunk3VKMRHBU_cjs.getAllDiagramTypes; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "getDiagramMeta", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunk3VKMRHBU_cjs.getDiagramMeta; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "getDiagramSince", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunk3VKMRHBU_cjs.getDiagramSince; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "getExamples", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunk3VKMRHBU_cjs.getExamples; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "getSyntax", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunk3VKMRHBU_cjs.getSyntax; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "listDiagrams", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunk3VKMRHBU_cjs.listDiagrams; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "renderDsl", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunk3VKMRHBU_cjs.renderDsl; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "resolveDiagramType", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunk3VKMRHBU_cjs.resolveDiagramType; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "validateDsl", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunk3VKMRHBU_cjs.validateDsl; }
|
|
112
112
|
});
|
|
113
113
|
exports.buildPromptContext = buildPromptContext;
|
|
114
114
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-LXM32NGV.js';
|
|
2
|
+
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-LXM32NGV.js';
|
|
3
|
+
import '../chunk-F72IQZ6O.js';
|
|
4
4
|
import '../chunk-EB7T5SEO.js';
|
|
5
5
|
import '../chunk-PGMKMIGM.js';
|
|
6
6
|
import '../chunk-37WDY4G4.js';
|
package/dist/browser.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO4XRVW3R_cjs = require('./chunk-O4XRVW3R.cjs');
|
|
4
4
|
require('./chunk-UHRNFBWY.cjs');
|
|
5
5
|
require('./chunk-IBZKIMT5.cjs');
|
|
6
6
|
require('./chunk-24YHD4YI.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(chunkO4XRVW3R_cjs.render(text, config));
|
|
31
31
|
}
|
|
32
32
|
function renderPreviewToElement(text, config) {
|
|
33
|
-
return svgStringToElement(
|
|
33
|
+
return svgStringToElement(chunkO4XRVW3R_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 = chunkO4XRVW3R_cjs.render(text, config);
|
|
47
47
|
}
|
|
48
48
|
function renderPreviewToContainer(text, container, config) {
|
|
49
|
-
container.innerHTML =
|
|
49
|
+
container.innerHTML = chunkO4XRVW3R_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 chunkO4XRVW3R_cjs.render; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "renderPreview", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkO4XRVW3R_cjs.renderPreview; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "renderResult", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkO4XRVW3R_cjs.renderResult; }
|
|
63
63
|
});
|
|
64
64
|
exports.renderPreviewToContainer = renderPreviewToContainer;
|
|
65
65
|
exports.renderPreviewToElement = renderPreviewToElement;
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { render, renderPreview } from './chunk-
|
|
2
|
-
export { render, renderPreview, renderResult } from './chunk-
|
|
1
|
+
import { render, renderPreview } from './chunk-F72IQZ6O.js';
|
|
2
|
+
export { render, renderPreview, renderResult } from './chunk-F72IQZ6O.js';
|
|
3
3
|
import './chunk-EB7T5SEO.js';
|
|
4
4
|
import './chunk-PGMKMIGM.js';
|
|
5
5
|
import './chunk-37WDY4G4.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO4XRVW3R_cjs = require('./chunk-O4XRVW3R.cjs');
|
|
4
4
|
|
|
5
5
|
// src/ai/registry.ts
|
|
6
6
|
var DIAGRAM_REGISTRY = [
|
|
@@ -6689,7 +6689,7 @@ function getExamples(type, opts = {}) {
|
|
|
6689
6689
|
function validateDsl(type, dsl) {
|
|
6690
6690
|
const resolvedType = type ? resolveDiagramType(type) : void 0;
|
|
6691
6691
|
const config = type ? { type: resolvedType ?? type } : void 0;
|
|
6692
|
-
const result =
|
|
6692
|
+
const result = chunkO4XRVW3R_cjs.parseResult(dsl, config);
|
|
6693
6693
|
if (result.ok) {
|
|
6694
6694
|
return {
|
|
6695
6695
|
ok: true,
|
|
@@ -6715,7 +6715,7 @@ function renderDsl(type, dsl, options = {}) {
|
|
|
6715
6715
|
...options,
|
|
6716
6716
|
...type ? { type: resolvedType ?? type } : {}
|
|
6717
6717
|
};
|
|
6718
|
-
const result =
|
|
6718
|
+
const result = chunkO4XRVW3R_cjs.renderResult(dsl, config);
|
|
6719
6719
|
if (result.ok) {
|
|
6720
6720
|
return {
|
|
6721
6721
|
ok: true,
|
|
@@ -6777,5 +6777,5 @@ exports.listDiagrams = listDiagrams;
|
|
|
6777
6777
|
exports.renderDsl = renderDsl;
|
|
6778
6778
|
exports.resolveDiagramType = resolveDiagramType;
|
|
6779
6779
|
exports.validateDsl = validateDsl;
|
|
6780
|
-
//# sourceMappingURL=chunk-
|
|
6781
|
-
//# sourceMappingURL=chunk-
|
|
6780
|
+
//# sourceMappingURL=chunk-3VKMRHBU.cjs.map
|
|
6781
|
+
//# sourceMappingURL=chunk-3VKMRHBU.cjs.map
|